summaryrefslogtreecommitdiff
path: root/sys/dev/pv/pvbus.c
diff options
context:
space:
mode:
authorJonathan Matthew <jmatthew@cvs.openbsd.org>2017-06-22 06:21:13 +0000
committerJonathan Matthew <jmatthew@cvs.openbsd.org>2017-06-22 06:21:13 +0000
commitacaa668c481b678a1a19aa55581bdc2be5bef018 (patch)
treed2add82a1dbba3b4afda0a85b60c796094a8ac53 /sys/dev/pv/pvbus.c
parentc8a70ec733e996474829edeefc15383497b0fa62 (diff)
Add a hypervisor-specific function pointer in pvbus(4) that gets called during
cpu_hatch() on each cpu, allowing initialization of per-cpu features on each cpu as it starts up. input from reyk@ and mikeb@ ok mikeb@
Diffstat (limited to 'sys/dev/pv/pvbus.c')
-rw-r--r--sys/dev/pv/pvbus.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/sys/dev/pv/pvbus.c b/sys/dev/pv/pvbus.c
index ecc60b3c6b3..902221ec6f5 100644
--- a/sys/dev/pv/pvbus.c
+++ b/sys/dev/pv/pvbus.c
@@ -1,4 +1,4 @@
-/* $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>
@@ -210,6 +210,19 @@ pvbus_identify(void)
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)
{