Browse Source

Removed REAL_EXEC(); there is no longer any code using it.

tags/v0.9.3
Michael Brown 18 years ago
parent
commit
02cf755f3f
3 changed files with 14 additions and 44 deletions
  1. 0
    11
      src/arch/i386/include/librm.h
  2. 13
    32
      src/arch/i386/include/realmode.h
  3. 1
    1
      src/arch/i386/transitions/librm.S

+ 0
- 11
src/arch/i386/include/librm.h View File

@@ -191,17 +191,6 @@ extern void remove_from_rm_stack ( void *data, size_t size );
191 191
 	".code32\n\t"					\
192 192
 	".previous\n\t"
193 193
 
194
-/* REAL_EXEC: execute a fragment of code in real mode */
195
-#define OUT_CONSTRAINTS(...) __VA_ARGS__
196
-#define IN_CONSTRAINTS(...) __VA_ARGS__
197
-#define CLOBBER(...) __VA_ARGS__
198
-#define REAL_EXEC( name, asm_code_str, num_out_constraints,		\
199
-		   out_constraints, in_constraints, clobber ) do {	\
200
-	__asm__ __volatile__ (						\
201
-		REAL_CODE ( asm_code_str )				\
202
-		: out_constraints : in_constraints : clobber );		\
203
-	} while ( 0 )
204
-
205 194
 #endif /* ASSEMBLY */
206 195
 
207 196
 #endif /* LIBRM_H */

+ 13
- 32
src/arch/i386/include/realmode.h View File

@@ -68,17 +68,16 @@ typedef struct segoff segoff_t;
68 68
  *
69 69
  * You should place variables in .data16 when they need to be accessed
70 70
  * by real-mode code.  Real-mode assembly (e.g. as created by
71
- * REAL_EXEC()) can access these variables via the usual data segment.
71
+ * REAL_CODE()) can access these variables via the usual data segment.
72 72
  * You can therefore write something like
73 73
  *
74 74
  *   static uint16_t __data16 ( foo );
75 75
  *   #define foo __use_data16 ( foo )
76 76
  *
77 77
  *   int bar ( void ) {
78
- *     REAL_EXEC ( baz,
79
- *                 "int $0xff\n\t"
80
- *                 "movw %ax, foo",
81
- *                 ... );
78
+ *     __asm__ __volatile__ ( REAL_CODE ( "int $0xff\n\t"
79
+ *                                        "movw %ax, foo" )
80
+ *                            : : );
82 81
  *     return foo;
83 82
  *   }
84 83
  *
@@ -113,33 +112,15 @@ typedef struct segoff segoff_t;
113 112
  */
114 113
 
115 114
 /*
116
- * REAL_EXEC ( name, asm_code_str, num_out_constraints, out_constraints,
117
- *	       in_constraints, clobber )
118
- *
119
- * out_constraints must be of the form OUT_CONSTRAINTS(constraints),
120
- * and in_constraints must be of the form IN_CONSTRAINTS(constraints),
121
- * where "constraints" is a constraints list as would be used in an
122
- * inline __asm__()
123
- *
124
- * clobber must be of the form CLOBBER ( clobber_list ), where
125
- * "clobber_list" is a clobber list as would be used in an inline
126
- * __asm__().
127
- *
128
- * These are best illustrated by example.  To write a character to the
129
- * console using INT 10, you would do something like:
130
- *
131
- *	REAL_EXEC ( rm_test_librm,
132
- *		    "int $0x10",
133
- *		    1,
134
- *		    OUT_CONSTRAINTS ( "=a" ( discard ) ),
135
- *		    IN_CONSTRAINTS ( "a" ( 0x0e00 + character ),
136
- *				     "b" ( 1 ) ),
137
- *		    CLOBBER ( "ebx", "ecx", "edx", "ebp", "esi", "edi" ) );
138
- *
139
- * IMPORTANT: gcc does not automatically assume that input operands
140
- * get clobbered.  The only way to specify that an input operand may
141
- * be modified is to also specify it as an output operand; hence the
142
- * "(discard)" in the above code.
115
+ * REAL_CODE ( asm_code_str )
116
+ *
117
+ * This can be used in inline assembly to create a fragment of code
118
+ * that will execute in real mode.  For example: to write a character
119
+ * to the BIOS console using INT 10, you would do something like:
120
+ *
121
+ *     __asm__ __volatile__ ( REAL_CODE ( "int $0x16" )
122
+ *			      : "=a" ( character ) : "a" ( 0x0000 ) );
123
+ *
143 124
  */
144 125
 
145 126
 #endif /* ASSEMBLY */

+ 1
- 1
src/arch/i386/transitions/librm.S View File

@@ -421,7 +421,7 @@ prot_call:
421 421
  * callee to preserve.  Gate A20 will be re-enabled in case the
422 422
  * real-mode routine disabled it.
423 423
  *
424
- * librm.h defines a convenient macro REAL_EXEC() for using real_call.
424
+ * librm.h defines a convenient macro REAL_CODE() for using real_call.
425 425
  * See librm.h and realmode.h for details and examples.
426 426
  *
427 427
  * Parameters:

Loading…
Cancel
Save