From 905cad0bf5201bddb99675687bab9b6666b88f71 Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin" Date: Mon, 18 May 2009 18:34:55 -0700 Subject: [PATCH] pxelinux: revert to a separate stack implementation 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 --- core/pxelinux.asm | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/core/pxelinux.asm b/core/pxelinux.asm index e1a62c7..4656e0b 100644 --- a/core/pxelinux.asm +++ b/core/pxelinux.asm @@ -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? -- 2.7.4