context.c revision 677833bc953b6cb418c701facbdcf4aa18d6c44e
/*
* context switching
* 2003-10 by SONE Takeshi
*/
#include <etherboot.h>
#include "segment.h"
#include "context.h"
#define MAIN_STACK_SIZE 16384
#define IMAGE_STACK_SIZE 4096
static void start_main(void); /* forward decl. */
void __exit_context(void); /* assembly routine */
/*
* Main context structure
* It is placed at the bottom of our stack, and loaded by assembly routine
* to start us up.
*/
};
#if 0
/* Stack for loaded ELF image */
#endif
/* Pointer to startup context (physical address) */
unsigned long __boot_ctx;
/*
* Main starter
* This is the C function that runs first.
*/
static void start_main(void)
{
int retval;
extern int filo(void);
/* Save startup context, so we can refer to it later.
* We have to keep it in physical address since we will relocate. */
/* Start the real fun */
/* Pass return value to startup context. Bootloader may see it. */
/* Returning from here should jump to __exit_context */
}
/* Setup a new context using the given stack.
*/
struct context *
{
/* Fill in reasonable default for flat memory model */
return ctx;
}
/* Switch to another context. */
{
asm ("pushl %cs; call __switch_context");
return ret;
}
#if 0
//We will use elf_start in Etherboot
/* Start ELF Boot image */
{
}
#endif