core: pxe: need to save/restore es around EFI CSM hack syslinux-4.00-pre6
authorH. Peter Anvin <hpa@zytor.com>
Fri, 4 Sep 2009 23:15:37 +0000 (16:15 -0700)
committerH. Peter Anvin <hpa@zytor.com>
Fri, 4 Sep 2009 23:15:37 +0000 (16:15 -0700)
Unlike in the Syslinux 3.x branch, we need to save/restore es around
the PXE EFI CSM localboot hack.  This really should be moved to C,
anyway, at the same time USE_PXE_PROVIDED_STACK is finally killed off.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
core/pxelinux.asm

index 1ebd2b5..93ef8b4 100644 (file)
@@ -176,6 +176,7 @@ _start1:
 ; if we want to reset", so that chainloading other NBPs will work.
 ;
 efi_csm_workaround:
+               push es
                les bp,[InitStack]      ; GS:SP -> original stack
                les bx,[es:bp+44]       ; Return address
                cmp word [es:bx],18CDh  ; Already pointing to INT 18h?
@@ -229,6 +230,7 @@ efi_csm_workaround:
                rep movsb
 
 .skip: 
+               pop es                  ; Restore CS == DS == ES
 
                section .data16
                alignz 4