summaryrefslogtreecommitdiffstats
path: root/src/arch/i386/include/librm.h
diff options
context:
space:
mode:
authorMichael Brown2008-07-01 03:52:13 +0200
committerMichael Brown2008-07-01 03:52:13 +0200
commit4fbbf651d7cb91983801904f5ed2b07d15566c1d (patch)
tree36e8d2ecd24b17a0fd4cbe9dfd7c0143bb0d578f /src/arch/i386/include/librm.h
parent[pxe] Fix a typo in PXENV_GET_CACHED_INFO that broke Altiris (diff)
downloadipxe-4fbbf651d7cb91983801904f5ed2b07d15566c1d.tar.gz
ipxe-4fbbf651d7cb91983801904f5ed2b07d15566c1d.tar.xz
ipxe-4fbbf651d7cb91983801904f5ed2b07d15566c1d.zip
[i386] Change semantics of __from_data16 and __from_text16
__from_data16 and __from_text16 now take a pointer to a .data16/.text16 variable, and return the real-mode offset within the appropriate segment. This matches the use case for every occurrence of these macros, and prevents potential future bugs such as that fixed in commit d51d80f. (The bug arose essentially because "&pointer" is still syntactically valid.)
Diffstat (limited to 'src/arch/i386/include/librm.h')
-rw-r--r--src/arch/i386/include/librm.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/arch/i386/include/librm.h b/src/arch/i386/include/librm.h
index 31b50979..413f0362 100644
--- a/src/arch/i386/include/librm.h
+++ b/src/arch/i386/include/librm.h
@@ -51,13 +51,13 @@ extern char *text16;
( * ( ( typeof ( _text16_ ## variable ) * ) \
& ( text16 [ ( size_t ) & ( _text16_ ## variable ) ] ) ) )
-#define __from_data16( variable ) \
- ( * ( ( typeof ( variable ) * ) \
- ( ( ( void * ) &(variable) ) - ( ( void * ) data16 ) ) ) )
+#define __from_data16( pointer ) \
+ ( ( unsigned int ) \
+ ( ( ( void * ) (pointer) ) - ( ( void * ) data16 ) ) )
-#define __from_text16( variable ) \
- ( * ( ( typeof ( variable ) * ) \
- ( ( ( void * ) &(variable) ) - ( ( void * ) text16 ) ) ) )
+#define __from_text16( pointer ) \
+ ( ( unsigned int ) \
+ ( ( ( void * ) (pointer) ) - ( ( void * ) text16 ) ) )
/* Variables in librm.S, present in the normal data segment */
extern uint16_t __data16 ( rm_cs );