aboutsummaryrefslogtreecommitdiffstats
path: root/gpxe/src/arch/i386/interface
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2009-04-14 21:52:50 -0700
committerH. Peter Anvin <hpa@zytor.com>2009-04-14 21:52:50 -0700
commit51c8b419b201678ea27edfa9d037c851f18b7fb5 (patch)
tree566b8d74bcffd41fb392df83e8db28d77b4977f7 /gpxe/src/arch/i386/interface
parent927a28f0f852b31950fd9d4f9d96049397d1eaa1 (diff)
downloadsyslinux.git-51c8b419b201678ea27edfa9d037c851f18b7fb5.tar.gz
syslinux.git-51c8b419b201678ea27edfa9d037c851f18b7fb5.tar.xz
syslinux.git-51c8b419b201678ea27edfa9d037c851f18b7fb5.zip
gpxe: 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>
Diffstat (limited to 'gpxe/src/arch/i386/interface')
-rw-r--r--gpxe/src/arch/i386/interface/pxe/pxe_entry.S7
1 files changed, 5 insertions, 2 deletions
diff --git a/gpxe/src/arch/i386/interface/pxe/pxe_entry.S b/gpxe/src/arch/i386/interface/pxe/pxe_entry.S
index 22ef4181..0e8c8e2d 100644
--- a/gpxe/src/arch/i386/interface/pxe/pxe_entry.S
+++ b/gpxe/src/arch/i386/interface/pxe/pxe_entry.S
@@ -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