-/* $OpenBSD: cpu.c,v 1.105 2017/05/30 15:11:32 deraadt Exp $ */
+/* $OpenBSD: cpu.c,v 1.106 2017/06/22 06:21:12 jmatthew Exp $ */
/* $NetBSD: cpu.c,v 1.1 2003/04/26 18:39:26 fvdl Exp $ */
/*-
#include "lapic.h"
#include "ioapic.h"
#include "vmm.h"
+#include "pvbus.h"
#include <sys/param.h>
#include <sys/timeout.h>
#include <machine/i82093var.h>
#endif
+#if NPVBUS > 0
+#include <dev/pv/pvvar.h>
+#endif
+
#include <dev/ic/mc146818reg.h>
#include <amd64/isa/nvram.h>
#include <dev/isa/isareg.h>
lldt(0);
cpu_init(ci);
+#if NPVBUS > 0
+ pvbus_init_cpu();
+#endif
/* Re-initialise memory range handling on AP */
if (mem_range_softc.mr_op != NULL)
-/* $OpenBSD: cpu.c,v 1.84 2017/05/30 15:11:32 deraadt Exp $ */
+/* $OpenBSD: cpu.c,v 1.85 2017/06/22 06:21:12 jmatthew Exp $ */
/* $NetBSD: cpu.c,v 1.1.2.7 2000/06/26 02:04:05 sommerfeld Exp $ */
/*-
#include "lapic.h"
#include "ioapic.h"
#include "vmm.h"
+#include "pvbus.h"
#include <sys/param.h>
#include <sys/timeout.h>
#include <machine/i82093var.h>
#endif
+#if NPVBUS > 0
+#include <dev/pv/pvvar.h>
+#endif
+
#include <dev/ic/mc146818reg.h>
#include <i386/isa/nvram.h>
#include <dev/isa/isareg.h>
ci->ci_curpmap = pmap_kernel();
cpu_init(ci);
+#if NPVBUS > 0
+ pvbus_init_cpu();
+#endif
/* Re-initialise memory range handling on AP */
if (mem_range_softc.mr_op != NULL)
-/* $OpenBSD: pvbus.c,v 1.16 2017/01/10 17:16:39 reyk Exp $ */
+/* $OpenBSD: pvbus.c,v 1.17 2017/06/22 06:21:12 jmatthew Exp $ */
/*
* Copyright (c) 2015 Reyk Floeter <reyk@openbsd.org>
has_hv_cpuid = 1;
}
+void
+pvbus_init_cpu(void)
+{
+ int i;
+
+ for (i = 0; i < PVBUS_MAX; i++) {
+ if (pvbus_hv[i].hv_base == 0)
+ continue;
+ if (pvbus_hv[i].hv_init_cpu != NULL)
+ (pvbus_hv[i].hv_init_cpu)(&pvbus_hv[i]);
+ }
+}
+
int
pvbus_activate(struct device *self, int act)
{
-/* $OpenBSD: pvvar.h,v 1.9 2017/01/10 17:16:39 reyk Exp $ */
+/* $OpenBSD: pvvar.h,v 1.10 2017/06/22 06:21:12 jmatthew Exp $ */
/*
* Copyright (c) 2015 Reyk Floeter <reyk@openbsd.org>
void *hv_arg;
int (*hv_kvop)(void *, int, char *, char *, size_t);
+ void (*hv_init_cpu)(struct pvbus_hv *);
};
struct pvbus_softc {
void pvbus_identify(void);
int pvbus_probe(void);
+void pvbus_init_cpu(void);
void pvbus_reboot(struct device *);
void pvbus_shutdown(struct device *);