Browse Source

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.
tags/v0.9.3
Michael Brown 18 years ago
parent
commit
897313007b
2 changed files with 14 additions and 4 deletions
  1. 2
    0
      src/arch/i386/include/libkir.h
  2. 12
    4
      src/arch/i386/include/librm.h

+ 2
- 0
src/arch/i386/include/libkir.h View File

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

+ 12
- 4
src/arch/i386/include/librm.h View File

@@ -20,12 +20,20 @@ extern char *data16;
20 20
 extern char *text16;
21 21
 
22 22
 #define __data16( variable )						\
23
-	_data16_ ## variable __asm__ ( #variable )			\
24
-	__attribute__ (( section ( ".data16" ) ))
23
+	__attribute__ (( section ( ".data16" ) ))			\
24
+	_data16_ ## variable __asm__ ( #variable )
25
+
26
+#define __data16_array( variable, array )				\
27
+	__attribute__ (( section ( ".data16" ) ))			\
28
+	_data16_ ## variable array __asm__ ( #variable )
25 29
 
26 30
 #define __text16( variable )						\
27
-	_text16_ ## variable __asm__ ( #variable )			\
28
-	__attribute__ (( section ( ".text16.data" ) ))
31
+	__attribute__ (( section ( ".text16.data" ) ))			\
32
+	_text16_ ## variable __asm__ ( #variable )
33
+
34
+#define __text16_array( variable, array )				\
35
+	__attribute__ (( section ( ".text16.data" ) ))			\
36
+	_text16_ ## variable array __asm__ ( #variable )
29 37
 
30 38
 #define __use_data16( variable )					\
31 39
 	( * ( ( typeof ( _data16_ ## variable ) * )			\

Loading…
Cancel
Save