summaryrefslogtreecommitdiffstats
path: root/src/arch/i386/include/librm.h
diff options
context:
space:
mode:
authorMichael Brown2006-05-04 19:00:20 +0200
committerMichael Brown2006-05-04 19:00:20 +0200
commitf4429533a6d2174e5f5e7674159090a63032be1a (patch)
tree76baf4d689ee0dbbe040598df18ccee92a7a9dd0 /src/arch/i386/include/librm.h
parentBSS is now zeroed by libprefix (along with the otherwise non-zeroable (diff)
downloadipxe-f4429533a6d2174e5f5e7674159090a63032be1a.tar.gz
ipxe-f4429533a6d2174e5f5e7674159090a63032be1a.tar.xz
ipxe-f4429533a6d2174e5f5e7674159090a63032be1a.zip
Added methods for efficiently declaring and accessing variables in
.data16. librm will need to supply "char *data16", i.e. the virtual address of the start of .data16.
Diffstat (limited to 'src/arch/i386/include/librm.h')
-rw-r--r--src/arch/i386/include/librm.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/arch/i386/include/librm.h b/src/arch/i386/include/librm.h
index 76ef8d62..b4970c02 100644
--- a/src/arch/i386/include/librm.h
+++ b/src/arch/i386/include/librm.h
@@ -15,6 +15,17 @@
*
*/
+/* Access to variables in .data16 */
+extern char *data16;
+
+#define __data16( variable ) \
+ _data16_ ## variable __asm__ ( #variable ) \
+ __attribute__ (( section ( ".data16" ) ))
+
+#define __use_data16( variable ) \
+ ( * ( ( typeof ( _data16_ ## variable ) * ) \
+ & ( data16 [ ( size_t ) & ( _data16_ ## variable ) ] ) ) )
+
/* Variables in librm.S, present in the normal data segment */
extern uint16_t rm_sp;
extern uint16_t rm_ss;