summaryrefslogtreecommitdiffstats
path: root/sys/dev/hyperv/include
diff options
context:
space:
mode:
authorsephe <sephe@FreeBSD.org>2016-02-05 07:09:58 +0000
committersephe <sephe@FreeBSD.org>2016-02-05 07:09:58 +0000
commit241c7a11bd40d303492821ebef545ea3ffbca849 (patch)
tree9944b8d35d6357d2f101861eac433339caec3dce /sys/dev/hyperv/include
parent43993ba1f9ee4bff5c7ee1666dde2f5fc919456b (diff)
downloadFreeBSD-src-241c7a11bd40d303492821ebef545ea3ffbca849.zip
FreeBSD-src-241c7a11bd40d303492821ebef545ea3ffbca849.tar.gz
hyperv: Use standard taskqueue instead of hv_work_queue
HyperV code was ported from Linux. There is an implementation of work queue called hv_work_queue. In FreeBSD, taskqueue could be used for the same purpose. Convert all the consumer of hv_work_queue to use taskqueue, and remove work queue implementation. Submitted by: Jun Su <junsu microsoft com> Reviewed by: adrian, Hongjiang Zhang <honzhan microsoft com> Approved by: adrian (mentor) MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D4963
Diffstat (limited to 'sys/dev/hyperv/include')
-rw-r--r--sys/dev/hyperv/include/hyperv.h33
1 files changed, 7 insertions, 26 deletions
diff --git a/sys/dev/hyperv/include/hyperv.h b/sys/dev/hyperv/include/hyperv.h
index 852e14e..8e2ca57 100644
--- a/sys/dev/hyperv/include/hyperv.h
+++ b/sys/dev/hyperv/include/hyperv.h
@@ -908,30 +908,6 @@ int hv_vmbus_channel_teardown_gpdal(
struct hv_vmbus_channel* vmbus_select_outgoing_channel(struct hv_vmbus_channel *promary);
-/*
- * Work abstraction defines
- */
-typedef struct hv_work_queue {
- struct taskqueue* queue;
- struct proc* proc;
- struct sema* work_sema;
-} hv_work_queue;
-
-typedef struct hv_work_item {
- struct task work;
- void (*callback)(void *);
- void* context;
- hv_work_queue* wq;
-} hv_work_item;
-
-struct hv_work_queue* hv_work_queue_create(char* name);
-
-void hv_work_queue_close(struct hv_work_queue* wq);
-
-int hv_queue_work_item(
- hv_work_queue* wq,
- void (*callback)(void *),
- void* context);
/**
* @brief Get physical address from virtual
*/
@@ -952,8 +928,8 @@ typedef struct hv_vmbus_service {
hv_guid guid; /* Hyper-V GUID */
char *name; /* name of service */
boolean_t enabled; /* service enabled */
- hv_work_queue *work_queue; /* background work queue */
-
+ void* context;
+ struct task task;
/*
* function to initialize service
*/
@@ -963,6 +939,11 @@ typedef struct hv_vmbus_service {
* function to process Hyper-V messages
*/
void (*callback)(void *);
+
+ /*
+ * function to uninitilize service
+ */
+ int (*uninit)(struct hv_vmbus_service *);
} hv_vmbus_service;
extern uint8_t* receive_buffer[];
OpenPOWER on IntegriCloud