[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

@@ -199,9 +199,12 @@ pxe_int_1a:
shll $4, %edx
addl $pxenv, %edx
movw $0x564e, %ax
pushw %bp
movw %sp, %bp
andb $~0x01, 8(%bp) /* Clear CF on return */
popw %bp
popfw
clc
lret $2
iret
1: /* INT 1A,other - pass through */
popfw
ljmp *%cs:pxe_int_1a_vector