From 02cf755f3fc61bd932f64cd95bda0f12a062f358 Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Wed, 24 May 2006 14:10:15 +0000 Subject: Removed REAL_EXEC(); there is no longer any code using it. --- src/arch/i386/include/librm.h | 11 ---------- src/arch/i386/include/realmode.h | 45 ++++++++++++---------------------------- 2 files changed, 13 insertions(+), 43 deletions(-) (limited to 'src/arch/i386/include') diff --git a/src/arch/i386/include/librm.h b/src/arch/i386/include/librm.h index b1b37b61..8b0169ed 100644 --- a/src/arch/i386/include/librm.h +++ b/src/arch/i386/include/librm.h @@ -191,17 +191,6 @@ extern void remove_from_rm_stack ( void *data, size_t size ); ".code32\n\t" \ ".previous\n\t" -/* REAL_EXEC: execute a fragment of code in real mode */ -#define OUT_CONSTRAINTS(...) __VA_ARGS__ -#define IN_CONSTRAINTS(...) __VA_ARGS__ -#define CLOBBER(...) __VA_ARGS__ -#define REAL_EXEC( name, asm_code_str, num_out_constraints, \ - out_constraints, in_constraints, clobber ) do { \ - __asm__ __volatile__ ( \ - REAL_CODE ( asm_code_str ) \ - : out_constraints : in_constraints : clobber ); \ - } while ( 0 ) - #endif /* ASSEMBLY */ #endif /* LIBRM_H */ diff --git a/src/arch/i386/include/realmode.h b/src/arch/i386/include/realmode.h index 4c519ff6..5d3ddf50 100644 --- a/src/arch/i386/include/realmode.h +++ b/src/arch/i386/include/realmode.h @@ -68,17 +68,16 @@ typedef struct segoff segoff_t; * * You should place variables in .data16 when they need to be accessed * by real-mode code. Real-mode assembly (e.g. as created by - * REAL_EXEC()) can access these variables via the usual data segment. + * REAL_CODE()) can access these variables via the usual data segment. * You can therefore write something like * * static uint16_t __data16 ( foo ); * #define foo __use_data16 ( foo ) * * int bar ( void ) { - * REAL_EXEC ( baz, - * "int $0xff\n\t" - * "movw %ax, foo", - * ... ); + * __asm__ __volatile__ ( REAL_CODE ( "int $0xff\n\t" + * "movw %ax, foo" ) + * : : ); * return foo; * } * @@ -113,33 +112,15 @@ typedef struct segoff segoff_t; */ /* - * REAL_EXEC ( name, asm_code_str, num_out_constraints, out_constraints, - * in_constraints, clobber ) - * - * out_constraints must be of the form OUT_CONSTRAINTS(constraints), - * and in_constraints must be of the form IN_CONSTRAINTS(constraints), - * where "constraints" is a constraints list as would be used in an - * inline __asm__() - * - * clobber must be of the form CLOBBER ( clobber_list ), where - * "clobber_list" is a clobber list as would be used in an inline - * __asm__(). - * - * These are best illustrated by example. To write a character to the - * console using INT 10, you would do something like: - * - * REAL_EXEC ( rm_test_librm, - * "int $0x10", - * 1, - * OUT_CONSTRAINTS ( "=a" ( discard ) ), - * IN_CONSTRAINTS ( "a" ( 0x0e00 + character ), - * "b" ( 1 ) ), - * CLOBBER ( "ebx", "ecx", "edx", "ebp", "esi", "edi" ) ); - * - * IMPORTANT: gcc does not automatically assume that input operands - * get clobbered. The only way to specify that an input operand may - * be modified is to also specify it as an output operand; hence the - * "(discard)" in the above code. + * REAL_CODE ( asm_code_str ) + * + * This can be used in inline assembly to create a fragment of code + * that will execute in real mode. For example: to write a character + * to the BIOS console using INT 10, you would do something like: + * + * __asm__ __volatile__ ( REAL_CODE ( "int $0x16" ) + * : "=a" ( character ) : "a" ( 0x0000 ) ); + * */ #endif /* ASSEMBLY */ -- cgit v1.2.3-55-g7522