[pcbios] Don't use "lret $2" to return from an interrupt

Using "lret $2" to return from an interrupt causes interrupts to be
disabled in the calling program, since the INT instruction will have
disabled interrupts.  Instead, patch CF on the stack and use iret to
return.

Interestingly, the original PC BIOS had this bug in at least one
place.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Signed-off-by: Michael Brown <mcb30@etherboot.org>
This commit is contained in:
H. Peter Anvin
2009-04-11 18:30:22 -07:00
committed by Michael Brown
parent dc387547a3
commit f44205b9ea
3 changed files with 26 additions and 13 deletions

View File

@@ -63,6 +63,8 @@ void fake_e820 ( void ) {
"cmpl $0x534d4150, %%edx\n\t"
"jne 99f\n\t"
"pushaw\n\t"
"movw %%sp, %%bp\n\t"
"andb $~0x01, 22(%%bp)\n\t" /* Clear return CF */
"leaw e820map(%%bx), %%si\n\t"
"cs rep movsb\n\t"
"popaw\n\t"
@@ -73,8 +75,7 @@ void fake_e820 ( void ) {
"xorl %%ebx,%%ebx\n\t"
"\n1:\n\t"
"popfw\n\t"
"clc\n\t"
"lret $2\n\t"
"iret\n\t"
"\n99:\n\t"
"popfw\n\t"
"ljmp *%%cs:real_int15_vector\n\t" )