summaryrefslogtreecommitdiff
path: root/sys/dev/hyperv/vmbus
diff options
context:
space:
mode:
authorSepherosa Ziehau <sephe@FreeBSD.org>2016-11-30 07:45:05 +0000
committerSepherosa Ziehau <sephe@FreeBSD.org>2016-11-30 07:45:05 +0000
commitb5c7e2415e02bb1b2a0e63a42396c732cf31b0aa (patch)
tree182c0cb2817e60fabaff7dd214bbaba4333a3292 /sys/dev/hyperv/vmbus
parent91c915facf29fa2ded409354e49e9b8833c132f3 (diff)
Notes
Diffstat (limited to 'sys/dev/hyperv/vmbus')
-rw-r--r--sys/dev/hyperv/vmbus/vmbus.c12
-rw-r--r--sys/dev/hyperv/vmbus/vmbus_if.m7
2 files changed, 19 insertions, 0 deletions
diff --git a/sys/dev/hyperv/vmbus/vmbus.c b/sys/dev/hyperv/vmbus/vmbus.c
index 6007864b5598..193e4489183d 100644
--- a/sys/dev/hyperv/vmbus/vmbus.c
+++ b/sys/dev/hyperv/vmbus/vmbus.c
@@ -97,6 +97,8 @@ static int vmbus_probe_guid_method(device_t, device_t,
const struct hyperv_guid *);
static uint32_t vmbus_get_vcpu_id_method(device_t bus,
device_t dev, int cpu);
+static struct taskqueue *vmbus_get_eventtq_method(device_t, device_t,
+ int);
static int vmbus_init(struct vmbus_softc *);
static int vmbus_connect(struct vmbus_softc *, uint32_t);
@@ -172,6 +174,7 @@ static device_method_t vmbus_methods[] = {
DEVMETHOD(vmbus_get_version, vmbus_get_version_method),
DEVMETHOD(vmbus_probe_guid, vmbus_probe_guid_method),
DEVMETHOD(vmbus_get_vcpu_id, vmbus_get_vcpu_id_method),
+ DEVMETHOD(vmbus_get_event_taskq, vmbus_get_eventtq_method),
DEVMETHOD_END
};
@@ -1126,6 +1129,15 @@ vmbus_get_vcpu_id_method(device_t bus, device_t dev, int cpu)
return (VMBUS_PCPU_GET(sc, vcpuid, cpu));
}
+static struct taskqueue *
+vmbus_get_eventtq_method(device_t bus, device_t dev __unused, int cpu)
+{
+ const struct vmbus_softc *sc = device_get_softc(bus);
+
+ KASSERT(cpu >= 0 && cpu < mp_ncpus, ("invalid cpu%d", cpu));
+ return (VMBUS_PCPU_GET(sc, event_tq, cpu));
+}
+
#ifdef NEW_PCIB
#define VTPM_BASE_ADDR 0xfed40000
#define FOUR_GB (1ULL << 32)
diff --git a/sys/dev/hyperv/vmbus/vmbus_if.m b/sys/dev/hyperv/vmbus/vmbus_if.m
index 65de846eb6be..3b41c5148fdf 100644
--- a/sys/dev/hyperv/vmbus/vmbus_if.m
+++ b/sys/dev/hyperv/vmbus/vmbus_if.m
@@ -33,6 +33,7 @@ INTERFACE vmbus;
HEADER {
struct hyperv_guid;
+ struct taskqueue;
};
METHOD uint32_t get_version {
@@ -51,3 +52,9 @@ METHOD uint32_t get_vcpu_id {
device_t dev;
int cpu;
};
+
+METHOD struct taskqueue * get_event_taskq {
+ device_t bus;
+ device_t dev;
+ int cpu;
+};