summaryrefslogtreecommitdiffstats
path: root/src/arch/i386/include/realmode.h
diff options
context:
space:
mode:
authorMichael Brown2006-05-13 13:11:55 +0200
committerMichael Brown2006-05-13 13:11:55 +0200
commitf7b963da5141578c3769a89d0fa55b0155822e86 (patch)
tree8678c1229a5c532ea023f059dcaa227f04249247 /src/arch/i386/include/realmode.h
parent(Redoing check-in lost by SourceForge's failure.) (diff)
downloadipxe-f7b963da5141578c3769a89d0fa55b0155822e86.tar.gz
ipxe-f7b963da5141578c3769a89d0fa55b0155822e86.tar.xz
ipxe-f7b963da5141578c3769a89d0fa55b0155822e86.zip
(Redoing check-in lost by SourceForge's failure.)
Use .text16.data section with "aw" attributes, to avoid section type conflicts when placing both code and data into .text16. Add __from_{text16,data16}.
Diffstat (limited to 'src/arch/i386/include/realmode.h')
-rw-r--r--src/arch/i386/include/realmode.h16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/arch/i386/include/realmode.h b/src/arch/i386/include/realmode.h
index fa8c7863..07d41e54 100644
--- a/src/arch/i386/include/realmode.h
+++ b/src/arch/i386/include/realmode.h
@@ -15,10 +15,12 @@
/* Segment:offset structure. Note that the order within the structure
* is offset:segment.
*/
-typedef struct {
+struct segoff {
uint16_t offset;
uint16_t segment;
-} __attribute__ (( packed )) segoff_t;
+} __attribute__ (( packed ));
+
+typedef struct segoff segoff_t;
/* Macro hackery needed to stringify bits of inline assembly */
#define RM_XSTR(x) #x
@@ -50,8 +52,8 @@ typedef struct {
* extern uint32_t __data16 ( bar );
* #define bar __use_data16 ( bar );
*
- * extern long __data16 ( baz ) = 0xff000000UL;
- * #define bar __use_data16 ( baz );
+ * static long __data16 ( baz ) = 0xff000000UL;
+ * #define baz __use_data16 ( baz );
*
* i.e. take a normal declaration, add __data16() around the variable
* name, and add a line saying "#define <name> __use_data16 ( <name> )
@@ -83,6 +85,12 @@ typedef struct {
* Variables may also be placed in .text16 using __text16 and
* __use_text16. Some variables (e.g. chained interrupt vectors) fit
* most naturally in .text16; most should be in .data16.
+ *
+ * If you have only a pointer to a magic symbol within .data16 or
+ * .text16, rather than the symbol itself, you can attempt to extract
+ * the underlying symbol name using __from_data16() or
+ * __from_text16(). This is not for the faint-hearted; check the
+ * assembler output to make sure that it's doing the right thing.
*/
/*