Parcourir la 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 il y a 18 ans
Parent
révision
897313007b
2 fichiers modifiés avec 14 ajouts et 4 suppressions
  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 Voir le fichier

@@ -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 Voir le fichier

@@ -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 ) * )			\

Chargement…
Annuler
Enregistrer