Add vm_set_register() and vm_set_desc() callbacks. These callbacks

translate directly into calls to their namesake API functions in
libvmmapi.

It is an improvement over the existing setreg(), setmsr(), setcr()
setgdt() and exec() callbacks in that the new additions give full
control and don't assume we're booting FreeBSD, like exec() and
don't assume one only wants to set the value of RSP, like setreg().
This commit is contained in:
Marcel Moolenaar 2016-02-26 16:00:16 +00:00
parent 3210b87554
commit 7eb9cc0975
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=296099

View File

@ -33,6 +33,14 @@
#define USERBOOT_VERSION_2 2
#define USERBOOT_VERSION_3 3
/*
* Version 4 added more generic callbacks for setting up
* registers and descriptors. The callback structure is
* backward compatible (new callbacks have been added at
* the tail end).
*/
#define USERBOOT_VERSION_4 4
/*
* Exit codes from the loader
*/
@ -195,4 +203,11 @@ struct loader_callbacks {
* each invocation will add 1 to the previous value of 'num'.
*/
const char * (*getenv)(void *arg, int num);
/*
* Version 4 additions.
*/
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,
u_int limit, u_int access);
};