forked from Lephenixnoir/gint
33 lines
695 B
C
33 lines
695 B
C
//---
|
|
// gint:kernel:hypervisor - small hypervisor that perform world switch
|
|
//---
|
|
#include <gint/gint.h>
|
|
#include <gint/atomic.h>
|
|
#include <gint/defs/attributes.h>
|
|
#include <gint/drivers.h>
|
|
|
|
/* external symbols */
|
|
extern void *kernel_env_casio;
|
|
extern void *kernel_env_gint;
|
|
|
|
#if 0
|
|
/* gint_switch(): Temporarily switch out of gint */
|
|
GWEAK void gint_switch(void (*function)(void))
|
|
{
|
|
void *buffctx;
|
|
|
|
/* check useless switch */
|
|
if(function == NULL)
|
|
return;
|
|
|
|
/* Switch from gint to the OS after a short wait */
|
|
buffctx = drivers_switch(kernel_env_casio);
|
|
|
|
/* involve function */
|
|
function();
|
|
|
|
/* Then switch back to gint once the OS finishes working */
|
|
drivers_switch(buffctx);
|
|
}
|
|
#endif
|