31 lines
670 B
C
31 lines
670 B
C
//---
|
|
// hypervisor:env - Environment manager
|
|
//---
|
|
#include "fxBoot/hypervisor.h"
|
|
|
|
#include <gint/drivers.h>
|
|
#include <gint/std/string.h>
|
|
|
|
/* hidden Gint world information */
|
|
extern void *kernel_env_casio;
|
|
extern void *kernel_env_gint;
|
|
|
|
//---
|
|
// Env API
|
|
//---
|
|
/* hypervisor_env_set(): Set the appropriate environment */
|
|
int hypervisor_env_set(struct hworld *world)
|
|
{
|
|
if (world == NULL)
|
|
return (-1);
|
|
void *env = NULL;
|
|
switch (world->private.env) {
|
|
case HYPERVISOR_ENV_CASIO: env = kernel_env_casio; break;
|
|
case HYPERVISOR_ENV_GINT: env = kernel_env_gint; break;
|
|
default:
|
|
return (-2);
|
|
}
|
|
drivers_context_duplicate(&world->context.drivers, env);
|
|
return (0);
|
|
}
|