Changeset View
Changeset View
Standalone View
Standalone View
stand/userboot/userboot.h
Show All 36 Lines | |||||
* Version 4 added more generic callbacks for setting up | * Version 4 added more generic callbacks for setting up | ||||
* registers and descriptors. The callback structure is | * registers and descriptors. The callback structure is | ||||
* backward compatible (new callbacks have been added at | * backward compatible (new callbacks have been added at | ||||
* the tail end). | * the tail end). | ||||
*/ | */ | ||||
#define USERBOOT_VERSION_4 4 | #define USERBOOT_VERSION_4 4 | ||||
/* | /* | ||||
* Version 5 adds callbacks to set unrestricted guest | |||||
fabian.freyer_physik.tu-berlin.de: Tbh this is no longer true, so I will update the patch to fix the comment | |||||
* capabilities and reset the vcpu state. The callback | |||||
* structure backward compatible (new callbacks have | |||||
* been added at the tail end). | |||||
*/ | |||||
#define USERBOOT_VERSION_5 5 | |||||
/* | |||||
* Exit codes from the loader | * Exit codes from the loader | ||||
*/ | */ | ||||
#define USERBOOT_EXIT_QUIT 1 | #define USERBOOT_EXIT_QUIT 1 | ||||
#define USERBOOT_EXIT_REBOOT 2 | #define USERBOOT_EXIT_REBOOT 2 | ||||
struct loader_callbacks { | struct loader_callbacks { | ||||
/* | /* | ||||
* Console i/o | * Console i/o | ||||
▲ Show 20 Lines • Show All 152 Lines • ▼ Show 20 Lines | struct loader_callbacks { | ||||
char * (*getenv)(void *arg, int num); | char * (*getenv)(void *arg, int num); | ||||
/* | /* | ||||
* Version 4 additions. | * Version 4 additions. | ||||
*/ | */ | ||||
int (*vm_set_register)(void *arg, int vcpu, int reg, uint64_t val); | int (*vm_set_register)(void *arg, int vcpu, int reg, uint64_t val); | ||||
int (*vm_set_desc)(void *arg, int vcpu, int reg, uint64_t base, | int (*vm_set_desc)(void *arg, int vcpu, int reg, uint64_t base, | ||||
u_int limit, u_int access); | u_int limit, u_int access); | ||||
/* | |||||
* Version 5 additions. | |||||
* | |||||
* vm_get_unrestricted_guest checks support for the UNRESTRICTED_GUEST | |||||
* capability and if supported, sets 'retval'. If unsupported, an error | |||||
* code is returned. | |||||
* | |||||
* vm_set_unrestricted_guest sets the UNRESTRICTED_GUEST capability if | |||||
* supported, and returns an error code otherwise. | |||||
* | |||||
* vcpu_reset initializes the vCPU state as defined in | |||||
* Intel Vol 3a, Table 9.1. IA-32 Processor States Following Power-up, | |||||
* Reset or INIT | |||||
*/ | |||||
int (*vm_get_unrestricted_guest)(void* arg, int vcpu, int *retval); | |||||
int (*vm_set_unrestricted_guest)(void* arg, int vcpu, int val); | |||||
int (*vcpu_reset)(void* arg, int vcpu); | |||||
}; | }; |
Tbh this is no longer true, so I will update the patch to fix the comment