pxelinux: revert to a separate stack implementation
authorH. Peter Anvin <hpa@zytor.com>
Tue, 19 May 2009 01:34:55 +0000 (18:34 -0700)
committerH. Peter Anvin <hpa@zytor.com>
Tue, 19 May 2009 01:34:55 +0000 (18:34 -0700)
Return to using a private stack, except immediately around a pxenv
call.  The systems on which this broke has been lost in time, and with
more code in 32-bit space there is a risk of deeper stacks (due to
more mode-switch calls.)

It is still a single configuration variable to flip back to the
unified 16-bit stack, however.  If most of the code is in 32-bit mode
and there is small likelihood of several transitions, it might still
be the best option in the end.

Note: the PXE stack is 1.5K in size (and we must account for the
possibility of receiving an interrupt.)

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

index e1a62c7..4656e0b 100644 (file)
@@ -48,7 +48,11 @@ TFTP_LARGEBLK        equ (TFTP_MTU-20-8-4)   ; MTU - IP hdr - UDP hdr - TFTP hdr
 ; Standard TFTP block size
 TFTP_BLOCKSIZE_LG2 equ 9               ; log2(bytes/block)
 TFTP_BLOCKSIZE equ (1 << TFTP_BLOCKSIZE_LG2)
-%assign USE_PXE_PROVIDED_STACK 1       ; Use stack provided by PXE?
+
+;
+; Set to 1 to disable switching to a private stack
+;
+%assign USE_PXE_PROVIDED_STACK 0       ; Use stack provided by PXE?
 
 SECTOR_SHIFT   equ TFTP_BLOCKSIZE_LG2
 SECTOR_SIZE    equ TFTP_BLOCKSIZE
@@ -2689,7 +2693,7 @@ gpxe_file_read:
                section .data16
 
                alignz 4
-BaseStack      dd StackBuf             ; ESP of base stack
+BaseStack      dd StackTop             ; ESP of base stack
                dw 0                    ; SS of base stack
 NextSocket     dw 49152                ; Counter for allocating socket numbers
 KeepPXE                db 0                    ; Should PXE be kept around?