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>
; 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
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?