[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.
This commit is contained in:
Michael Brown
2009-02-17 03:33:26 +00:00
parent 7f903f03af
commit 5026a35fef
5 changed files with 40 additions and 14 deletions

View File

@@ -78,7 +78,7 @@ extern void com32_cfarcall_wrapper ( );
extern int comboot_resolv ( const char *name, struct in_addr *address );
/* setjmp/longjmp context buffer used to return after loading an image */
extern jmp_buf comboot_return;
extern rmjmp_buf comboot_return;
/* Replacement image when exiting with COMBOOT_EXIT_RUN_KERNEL */
extern struct image *comboot_replacement_image;