david/ipxe
david
/
ipxe
Archived
1
0
Fork 0

Updated to REAL_CODE()

This commit is contained in:
Michael Brown 2006-05-24 13:28:39 +00:00
parent c4d688c005
commit e8550035af
1 changed files with 11 additions and 14 deletions

View File

@ -50,26 +50,23 @@ static void empty_8042 ( void )
*/ */
void gateA20_set ( void ) { void gateA20_set ( void ) {
static char reentry_guard = 0; static char reentry_guard = 0;
uint16_t flags, status; unsigned int discard_a;
unsigned int flags;
if ( reentry_guard ) if ( reentry_guard )
return; return;
reentry_guard = 1; reentry_guard = 1;
REAL_EXEC ( rm_enableA20, __asm__ __volatile__ ( REAL_CODE ( "sti\n\t"
"sti\n\t" "stc\n\t"
"stc\n\t" "int $0x15\n\t"
"int $0x15\n\t" "pushfw\n\t"
"pushfw\n\t" "popw %w0\n\t"
"popw %%bx\n\t" "cli\n\t" )
"cli\n\t", : "=r" ( flags ), "=a" ( discard_a )
2, : "a" ( Enable_A20 ) );
OUT_CONSTRAINTS ( "=a" ( status ), "=b" ( flags ) ),
IN_CONSTRAINTS ( "a" ( Enable_A20 ) ),
CLOBBER ( "ecx", "edx", "ebp", "esi", "edi" ) );
if ( ( flags & CF ) || if ( flags & CF ) {
( ( status >> 8 ) & 0xff ) ) {
/* INT 15 method failed, try alternatives */ /* INT 15 method failed, try alternatives */
#ifdef IBM_L40 #ifdef IBM_L40
outb(0x2, 0x92); outb(0x2, 0x92);