Browse Source

Allow access to variables in .text16 as well as .data16. Chained

interrupt vectors, for example, will be easiest to handle if placed in
.text16.
tags/v0.9.3
Michael Brown 19 years ago
parent
commit
f8e087767b
3 changed files with 16 additions and 2 deletions
  1. 3
    1
      src/arch/i386/include/libkir.h
  2. 10
    1
      src/arch/i386/include/librm.h
  3. 3
    0
      src/arch/i386/include/realmode.h

+ 3
- 1
src/arch/i386/include/libkir.h View File

@@ -10,9 +10,11 @@
10 10
  *
11 11
  */
12 12
 
13
-/* Access to variables in .data16, in a way compatible with librm */
13
+/* Access to variables in .data16 and .text16 in a way compatible with librm */
14 14
 #define __data16( variable ) variable
15
+#define __text16( variable ) variable
15 16
 #define __use_data16( variable ) variable
17
+#define __use_text16( variable ) variable
16 18
 
17 19
 /* Copy to/from base memory */
18 20
 

+ 10
- 1
src/arch/i386/include/librm.h View File

@@ -15,17 +15,26 @@
15 15
  *
16 16
  */
17 17
 
18
-/* Access to variables in .data16 */
18
+/* Access to variables in .data16 and .text16 */
19 19
 extern char *data16;
20
+extern char *text16;
20 21
 
21 22
 #define __data16( variable )						\
22 23
 	_data16_ ## variable __asm__ ( #variable )			\
23 24
 	__attribute__ (( section ( ".data16" ) ))
24 25
 
26
+#define __text16( variable )						\
27
+	_text16_ ## variable __asm__ ( #variable )			\
28
+	__attribute__ (( section ( ".text16" ) ))
29
+
25 30
 #define __use_data16( variable )					\
26 31
 	( * ( ( typeof ( _data16_ ## variable ) * )			\
27 32
 	      & ( data16 [ ( size_t ) & ( _data16_ ## variable ) ] ) ) )
28 33
 
34
+#define __use_text16( variable )					\
35
+	( * ( ( typeof ( _text16_ ## variable ) * )			\
36
+	      & ( text16 [ ( size_t ) & ( _text16_ ## variable ) ] ) ) )
37
+
29 38
 /* Variables in librm.S, present in the normal data segment */
30 39
 extern uint16_t rm_sp;
31 40
 extern uint16_t rm_ss;

+ 3
- 0
src/arch/i386/include/realmode.h View File

@@ -80,6 +80,9 @@ typedef struct {
80 80
  *     return foo;
81 81
  *   }
82 82
  *
83
+ * Variables may also be placed in .text16 using __text16 and
84
+ * __use_text16.  Some variables (e.g. chained interrupt vectors) fit
85
+ * most naturally in .text16; most should be in .data16.
83 86
  */
84 87
 
85 88
 /*

Loading…
Cancel
Save