[comboot] Restore the real-mode stack pointer on exit from a COMBOOT image
authorMichael Brown <mcb30@etherboot.org>
Tue, 17 Feb 2009 03:33:26 +0000 (03:33 +0000)
committerMichael Brown <mcb30@etherboot.org>
Tue, 17 Feb 2009 03:38:40 +0000 (03:38 +0000)
commit5026a35fef9d036be304d2e3923d40f613531f1b
treef6c44ddc330883503844f045a961dca77d335ad0
parent7f903f03afbadd809923a10fac57d59400e94182
[comboot] Restore the real-mode stack pointer on exit from a COMBOOT image

COMBOOT images use INTs to issue API calls; these end up making calls
into gPXE from real mode, and so temporarily change the real-mode
stack pointer.  When our COMBOOT code uses a longjmp() to implement
the various "exit COMBOOT image" API calls, this leaves the real-mode
stack pointer stuck with its temporary value, which causes problems if
we eventually try to exit out of gPXE back to the BIOS.

Fix by adding rmsetjmp() and rmlongjmp() calls (analogous to
sigsetjmp()/siglongjmp()); these save and restore the additional state
needed for real-mode calls to function correctly.
src/arch/i386/image/com32.c
src/arch/i386/image/comboot.c
src/arch/i386/include/comboot.h
src/arch/i386/include/setjmp.h
src/arch/i386/interface/syslinux/comboot_call.c