summaryrefslogtreecommitdiffstats
path: root/bsps/i386/include/bsp/realmode_int.h
diff options
context:
space:
mode:
authorChris Johns <chrisj@rtems.org>2017-12-23 18:18:56 +1100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2018-01-25 08:45:26 +0100
commit2afb22b7e1ebcbe40373ff7e0efae7d207c655a9 (patch)
tree44759efe9374f13200a97e96d91bd9a2b7e5ce2a /bsps/i386/include/bsp/realmode_int.h
parentMAINTAINERS: Add myself to Write After Approval. (diff)
downloadrtems-2afb22b7e1ebcbe40373ff7e0efae7d207c655a9.tar.bz2
Remove make preinstall
A speciality of the RTEMS build system was the make preinstall step. It copied header files from arbitrary locations into the build tree. The header files were included via the -Bsome/build/tree/path GCC command line option. This has at least seven problems: * The make preinstall step itself needs time and disk space. * Errors in header files show up in the build tree copy. This makes it hard for editors to open the right file to fix the error. * There is no clear relationship between source and build tree header files. This makes an audit of the build process difficult. * The visibility of all header files in the build tree makes it difficult to enforce API barriers. For example it is discouraged to use BSP-specifics in the cpukit. * An introduction of a new build system is difficult. * Include paths specified by the -B option are system headers. This may suppress warnings. * The parallel build had sporadic failures on some hosts. This patch removes the make preinstall step. All installed header files are moved to dedicated include directories in the source tree. Let @RTEMS_CPU@ be the target architecture, e.g. arm, powerpc, sparc, etc. Let @RTEMS_BSP_FAMILIY@ be a BSP family base directory, e.g. erc32, imx, qoriq, etc. The new cpukit include directories are: * cpukit/include * cpukit/score/cpu/@RTEMS_CPU@/include * cpukit/libnetworking The new BSP include directories are: * bsps/include * bsps/@RTEMS_CPU@/include * bsps/@RTEMS_CPU@/@RTEMS_BSP_FAMILIY@/include There are build tree include directories for generated files. The include directory order favours the most general header file, e.g. it is not possible to override general header files via the include path order. The "bootstrap -p" option was removed. The new "bootstrap -H" option should be used to regenerate the "headers.am" files. Update #3254.
Diffstat (limited to 'bsps/i386/include/bsp/realmode_int.h')
-rw-r--r--bsps/i386/include/bsp/realmode_int.h97
1 files changed, 97 insertions, 0 deletions
diff --git a/bsps/i386/include/bsp/realmode_int.h b/bsps/i386/include/bsp/realmode_int.h
new file mode 100644
index 0000000000..e8a1e36d01
--- /dev/null
+++ b/bsps/i386/include/bsp/realmode_int.h
@@ -0,0 +1,97 @@
+/**
+ * @file realmode_int.h
+ *
+ * @ingroup i386_shared
+ *
+ * @brief Definitioins supporting real mode interrupt calls.
+ *
+ * Interface allows calling given interrupt number with content of the
+ * registers defined. For passing or receiving higher amounts of the data
+ * there is a buffer accessible from real mode available. Real mode pointer
+ * to this buffer is passed to the interrupt in the registers.
+ */
+
+/*
+ * Copyright (C) 2014 Jan Doležal (dolezj21@fel.cvut.cz)
+ * CTU in Prague.
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.org/license/LICENSE.
+ */
+
+#ifndef _REALMODE_INT_H
+#define _REALMODE_INT_H
+
+#include <rtems/score/cpu.h>
+#include <stdint.h>
+
+#ifndef ASM /* ASM */
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+/* --- BIOS service interrupt number --- */
+/* number of interrupt servicing video functions */
+#define INTERRUPT_NO_VIDEO_SERVICES 0x10
+
+/**
+ * @brief Used for passing and retrieving registers content to/from real mode
+ * interrupt call.
+ */
+typedef struct {
+ uint32_t reg_eax;
+ uint32_t reg_ebx;
+ uint32_t reg_ecx;
+ uint32_t reg_edx;
+ uint32_t reg_esi;
+ uint32_t reg_edi;
+ uint16_t reg_ds;
+ uint16_t reg_es;
+ uint16_t reg_fs;
+ uint16_t reg_gs;
+} RTEMS_PACKED i386_realmode_interrupt_registers;
+
+/**
+ * @brief Returns buffer and its size usable with real mode interrupt call.
+ *
+ * Provides position to real mode buffer. It is buffer
+ * accessible from real mode context - it is located below
+ * address ~0x100000 in order for it to be accessible
+ * This buffer is meant to be pointed to by segReg:GenPurpReg
+ * and through this get bigger portion of an information to/from
+ * interrupt service routine than just by using register.
+ *
+ * @param[out] size pointer to variable, where the size of buffer
+ * will be filled
+ * @retval pointer to buffer
+ */
+extern void *i386_get_default_rm_buffer(uint16_t *size);
+
+/**
+ * @brief Call to real mode interrupt with specified int NO and processor
+ * registers.
+ *
+ * This function allows calling interrupts in real mode and to set processor
+ * registers as desired before interrupt call is made and to retrieve the
+ * registers content after call was made.
+ *
+ * @param[in] interrupt_number interrupt number to be called
+ * @param[in] ir pointer to structure containing registers to be passed to
+ * interrupt and to retrieve register content after call was made.
+ * @retval 0 call failed (GDT too small or pagin is on)
+ * @retval 1 call successful
+ */
+extern int i386_real_interrupt_call(
+ uint8_t interrupt_number,
+ i386_realmode_interrupt_registers *ir
+);
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* ASM */
+
+#endif /* _REALMODE_INT_H */