-/* $OpenBSD: conf.c,v 1.40 2018/04/18 16:34:58 deraadt Exp $ */
+/* $OpenBSD: conf.c,v 1.41 2018/07/11 14:48:40 mlarkin Exp $ */
/*
* Copyright (c) 1996 Michael Shalayeff
#include <biosdev.h>
#include <dev/cons.h>
-const char version[] = "3.39";
+const char version[] = "3.40";
int debug = 1;
-/* $OpenBSD: conf.c,v 1.35 2018/04/18 16:34:58 deraadt Exp $ */
+/* $OpenBSD: conf.c,v 1.36 2018/07/11 14:48:40 mlarkin Exp $ */
/*
* Copyright (c) 2004 Tom Cosgrove
#include <biosdev.h>
#include <dev/cons.h>
-const char version[] = "3.39";
+const char version[] = "3.40";
int debug = 1;
-/* $OpenBSD: machdep.c,v 1.6 2015/09/18 13:30:56 miod Exp $ */
+/* $OpenBSD: machdep.c,v 1.7 2018/07/11 14:48:40 mlarkin Exp $ */
/*
* Copyright (c) 2004 Tom Cosgrove
#include "biosdev.h"
#include <machine/apmvar.h>
#include <machine/biosvar.h>
+#include <machine/specialreg.h>
+#include <machine/vmmvar.h>
#ifdef EFIBOOT
#include "efiboot.h"
#define CKPT(c) /* c */
#endif
+const char *vmm_hv_signature = VMM_HV_SIGNATURE;
+
void
machdep(void)
{
- int i, j;
+ int i, j, vmm = 0;
struct i386_boot_probes *pr;
+ uint32_t dummy, ebx, ecx, edx;
+ dev_t dev;
/*
* The list of probe routines is now in conf.c.
printf("\n");
}
}
+
+ CPUID(0x1, dummy, dummy, ecx, dummy);
+ if (ecx & CPUIDECX_HV) {
+ CPUID(0x40000000, dummy, ebx, ecx, edx);
+ if (memcmp(&ebx, &vmm_hv_signature[0], sizeof(uint32_t)) == 0 &&
+ memcmp(&ecx, &vmm_hv_signature[4], sizeof(uint32_t)) == 0 &&
+ memcmp(&edx, &vmm_hv_signature[8], sizeof(uint32_t)) == 0)
+ vmm = 1;
+ }
+
+ /* Set console to com0/115200 by default in vmm */
+ if (vmm) {
+ dev = ttydev("com0");
+ cnspeed(dev, 115200);
+ cnset(dev);
+ }
}
int
-/* $OpenBSD: conf.c,v 1.39 2018/04/18 16:34:58 deraadt Exp $ */
+/* $OpenBSD: conf.c,v 1.40 2018/07/11 14:48:40 mlarkin Exp $ */
/*
* Copyright (c) 2004 Tom Cosgrove
#include "pxeboot.h"
#include "pxe_net.h"
-const char version[] = "3.39";
+const char version[] = "3.40";
int debug = 0;
void (*sa_cleanup)(void) = pxe_shutdown;