david/ipxe
david
/
ipxe
Archived
1
0
Fork 0

Add __{text,data}16_array, since there's no way I can see to make the

usual __{text,data}16 trick work with arrays.  gcc seems to accept the
__asm__ ( asmlabel ) only after the [] of the array declaration, not
before.
This commit is contained in:
Michael Brown 2006-05-23 23:42:45 +00:00
parent 5ec2b2c251
commit 897313007b
2 changed files with 14 additions and 4 deletions

View File

@ -12,7 +12,9 @@
/* Access to variables in .data16 and .text16 in a way compatible with librm */
#define __data16( variable ) variable
#define __data16_array( variable, array ) variable array
#define __text16( variable ) variable
#define __text16_array( variable,array ) variable array
#define __use_data16( variable ) variable
#define __use_text16( variable ) variable
#define __from_data16( variable ) variable

View File

@ -20,12 +20,20 @@ extern char *data16;
extern char *text16;
#define __data16( variable ) \
_data16_ ## variable __asm__ ( #variable ) \
__attribute__ (( section ( ".data16" ) ))
__attribute__ (( section ( ".data16" ) )) \
_data16_ ## variable __asm__ ( #variable )
#define __data16_array( variable, array ) \
__attribute__ (( section ( ".data16" ) )) \
_data16_ ## variable array __asm__ ( #variable )
#define __text16( variable ) \
_text16_ ## variable __asm__ ( #variable ) \
__attribute__ (( section ( ".text16.data" ) ))
__attribute__ (( section ( ".text16.data" ) )) \
_text16_ ## variable __asm__ ( #variable )
#define __text16_array( variable, array ) \
__attribute__ (( section ( ".text16.data" ) )) \
_text16_ ## variable array __asm__ ( #variable )
#define __use_data16( variable ) \
( * ( ( typeof ( _data16_ ## variable ) * ) \