summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMichael Brown2006-05-06 20:57:31 +0200
committerMichael Brown2006-05-06 20:57:31 +0200
commitf8e087767bb9fa82eac04b6819bb3cb78b2e8028 (patch)
tree0bd2d1b9edf7b46ecfbd5e0a11b2a831bee674fe /src
parentPreserve GDT across prot_call(). (diff)
downloadipxe-f8e087767bb9fa82eac04b6819bb3cb78b2e8028.tar.gz
ipxe-f8e087767bb9fa82eac04b6819bb3cb78b2e8028.tar.xz
ipxe-f8e087767bb9fa82eac04b6819bb3cb78b2e8028.zip
Allow access to variables in .text16 as well as .data16. Chained
interrupt vectors, for example, will be easiest to handle if placed in .text16.
Diffstat (limited to 'src')
-rw-r--r--src/arch/i386/include/libkir.h4
-rw-r--r--src/arch/i386/include/librm.h11
-rw-r--r--src/arch/i386/include/realmode.h3
3 files changed, 16 insertions, 2 deletions
diff --git a/src/arch/i386/include/libkir.h b/src/arch/i386/include/libkir.h
index 44cb75e2..28db8308 100644
--- a/src/arch/i386/include/libkir.h
+++ b/src/arch/i386/include/libkir.h
@@ -10,9 +10,11 @@
*
*/
-/* Access to variables in .data16, in a way compatible with librm */
+/* Access to variables in .data16 and .text16 in a way compatible with librm */
#define __data16( variable ) variable
+#define __text16( variable ) variable
#define __use_data16( variable ) variable
+#define __use_text16( variable ) variable
/* Copy to/from base memory */
diff --git a/src/arch/i386/include/librm.h b/src/arch/i386/include/librm.h
index b4970c02..3a5d9468 100644
--- a/src/arch/i386/include/librm.h
+++ b/src/arch/i386/include/librm.h
@@ -15,17 +15,26 @@
*
*/
-/* Access to variables in .data16 */
+/* Access to variables in .data16 and .text16 */
extern char *data16;
+extern char *text16;
#define __data16( variable ) \
_data16_ ## variable __asm__ ( #variable ) \
__attribute__ (( section ( ".data16" ) ))
+#define __text16( variable ) \
+ _text16_ ## variable __asm__ ( #variable ) \
+ __attribute__ (( section ( ".text16" ) ))
+
#define __use_data16( variable ) \
( * ( ( typeof ( _data16_ ## variable ) * ) \
& ( data16 [ ( size_t ) & ( _data16_ ## variable ) ] ) ) )
+#define __use_text16( variable ) \
+ ( * ( ( typeof ( _text16_ ## variable ) * ) \
+ & ( text16 [ ( size_t ) & ( _text16_ ## variable ) ] ) ) )
+
/* Variables in librm.S, present in the normal data segment */
extern uint16_t rm_sp;
extern uint16_t rm_ss;
diff --git a/src/arch/i386/include/realmode.h b/src/arch/i386/include/realmode.h
index b7f0dc9d..fa8c7863 100644
--- a/src/arch/i386/include/realmode.h
+++ b/src/arch/i386/include/realmode.h
@@ -80,6 +80,9 @@ typedef struct {
* return foo;
* }
*
+ * 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.
*/
/*