mirror of
https://github.com/ipxe/ipxe
synced 2025-12-26 09:32:33 +03:00
[comboot] Allow for tail recursion of COMBOOT images
Multi-level menus via COMBOOT rely on the COMBOOT program being able to exit and invoke a new COMBOOT program (the next menu). This works, but rapidly (within about five iterations) runs out of space in gPXE's internal stack, since each new image is executed in a new function context. Fix by allowing tail recursion between images; an image can now specify a replacement image for itself, and image_exec() will perform the necessary tail recursion.
This commit is contained in:
@@ -23,6 +23,7 @@
|
||||
#define ERRFILE_comboot ( ERRFILE_ARCH | ERRFILE_IMAGE | 0x00070000 )
|
||||
#define ERRFILE_com32 ( ERRFILE_ARCH | ERRFILE_IMAGE | 0x00080000 )
|
||||
#define ERRFILE_comboot_resolv ( ERRFILE_ARCH | ERRFILE_IMAGE | 0x00090000 )
|
||||
#define ERRFILE_comboot_call ( ERRFILE_ARCH | ERRFILE_IMAGE | 0x000a0000 )
|
||||
|
||||
#define ERRFILE_undi ( ERRFILE_ARCH | ERRFILE_NET | 0x00000000 )
|
||||
#define ERRFILE_undiload ( ERRFILE_ARCH | ERRFILE_NET | 0x00010000 )
|
||||
|
||||
@@ -79,18 +79,14 @@ 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;
|
||||
|
||||
/* Command line to execute when returning via comboot_return
|
||||
* with COMBOOT_RETURN_RUN_KERNEL
|
||||
*/
|
||||
extern char *comboot_kernel_cmdline;
|
||||
|
||||
/* Execute comboot_image_cmdline */
|
||||
extern void comboot_run_kernel ( );
|
||||
/* Replacement image when exiting with COMBOOT_EXIT_RUN_KERNEL */
|
||||
extern struct image *comboot_replacement_image;
|
||||
|
||||
extern void *com32_external_esp;
|
||||
|
||||
#define COMBOOT_RETURN_EXIT 1
|
||||
#define COMBOOT_RETURN_RUN_KERNEL 2
|
||||
#define COMBOOT_EXIT 1
|
||||
#define COMBOOT_EXIT_RUN_KERNEL 2
|
||||
#define COMBOOT_EXIT_COMMAND 3
|
||||
|
||||
extern void comboot_force_text_mode ( void );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user