david/ipxe
david
/
ipxe
Archived
1
0
Fork 0

Use TEXT16_CODE() rather than manually specifying ".code16" etc, since

our manual ".code32" will break a KEEP_IT_REAL build.
This commit is contained in:
Michael Brown 2006-08-24 18:43:28 +00:00
parent 028bc034e4
commit 19883779ba
1 changed files with 14 additions and 18 deletions

View File

@ -391,24 +391,20 @@ static void hook_int13 ( void ) {
* should not chain to the previous handler. (The wrapper * should not chain to the previous handler. (The wrapper
* clears CF and OF before calling int13()). * clears CF and OF before calling int13()).
*/ */
__asm__ __volatile__ ( ".section \".text16\", \"ax\", @progbits\n\t" __asm__ __volatile__ (
".code16\n\t" TEXT16_CODE ( "\nint13_wrapper:\n\t"
"\nint13_wrapper:\n\t" "orb $0, %%al\n\t" /* clear CF and OF */
"orb $0, %%al\n\t" /* clear CF and OF */ "pushl %0\n\t" /* call int13() */
"pushl %0\n\t" /* call int13() */ "pushw %%cs\n\t"
"pushw %%cs\n\t" "call prot_call\n\t"
"call prot_call\n\t" "jo 1f\n\t" /* chain if OF not set */
"jo 1f\n\t" /* chain if OF not set */ "pushfw\n\t"
"pushfw\n\t" "lcall *%%cs:int13_vector\n\t"
"lcall *%%cs:int13_vector\n\t" "\n1:\n\t"
"\n1:\n\t" "call 2f\n\t" /* return with flags intact */
"call 2f\n\t" /* return with flags intact */ "lret $2\n\t"
"lret $2\n\t" "\n2:\n\t"
"\n2:\n\t" "ret $4\n\t" ) : : "i" ( int13 ) );
"ret $4\n\t"
".previous\n\t"
".code32\n\t" : :
"i" ( int13 ) );
hook_bios_interrupt ( 0x13, ( unsigned int ) int13_wrapper, hook_bios_interrupt ( 0x13, ( unsigned int ) int13_wrapper,
&int13_vector ); &int13_vector );