svn commit: r296101 - head/usr.sbin/bhyveload

Marcel Moolenaar marcel at FreeBSD.org
Fri Feb 26 16:12:21 UTC 2016


Author: marcel
Date: Fri Feb 26 16:12:20 2016
New Revision: 296101
URL: https://svnweb.freebsd.org/changeset/base/296101

Log:
  Support version 4 of the userboot structure by implementing the
  vm_set_register() and vm_set_desc() callbacks.

Modified:
  head/usr.sbin/bhyveload/bhyveload.c

Modified: head/usr.sbin/bhyveload/bhyveload.c
==============================================================================
--- head/usr.sbin/bhyveload/bhyveload.c	Fri Feb 26 16:04:47 2016	(r296100)
+++ head/usr.sbin/bhyveload/bhyveload.c	Fri Feb 26 16:12:20 2016	(r296101)
@@ -542,6 +542,21 @@ cb_getenv(void *arg, int num)
 	return (NULL);
 }
 
+static int
+cb_vm_set_register(void *arg, int vcpu, int reg, uint64_t val)
+{
+
+	return (vm_set_register(ctx, vcpu, reg, val));
+}
+
+static int
+cb_vm_set_desc(void *arg, int vcpu, int reg, uint64_t base, u_int limit,
+    u_int access)
+{
+
+	return (vm_set_desc(ctx, vcpu, reg, base, limit, access));
+}
+
 static struct loader_callbacks cb = {
 	.getc = cb_getc,
 	.putc = cb_putc,
@@ -571,6 +586,10 @@ static struct loader_callbacks cb = {
 	.getmem = cb_getmem,
 
 	.getenv = cb_getenv,
+
+	/* Version 4 additions */
+	.vm_set_register = cb_vm_set_register,
+	.vm_set_desc = cb_vm_set_desc,
 };
 
 static int
@@ -765,7 +784,7 @@ main(int argc, char** argv)
 	addenv("smbios.bios.vendor=BHYVE");
 	addenv("boot_serial=1");
 
-	func(&cb, NULL, USERBOOT_VERSION_3, ndisks);
+	func(&cb, NULL, USERBOOT_VERSION_4, ndisks);
 
 	free(loader);
 	return (0);


More information about the svn-src-all mailing list