vmbus_var.h (307461) | vmbus_var.h (307466) |
---|---|
1/*- 2 * Copyright (c) 2016 Microsoft Corp. 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 9 unchanged lines hidden (view full) --- 18 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 19 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 * | 1/*- 2 * Copyright (c) 2016 Microsoft Corp. 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 9 unchanged lines hidden (view full) --- 18 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 19 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 * |
26 * $FreeBSD: stable/11/sys/dev/hyperv/vmbus/vmbus_var.h 307461 2016-10-17 03:24:03Z sephe $ | 26 * $FreeBSD: stable/11/sys/dev/hyperv/vmbus/vmbus_var.h 307466 2016-10-17 03:48:22Z sephe $ |
27 */ 28 29#ifndef _VMBUS_VAR_H_ 30#define _VMBUS_VAR_H_ 31 32#include <sys/param.h> | 27 */ 28 29#ifndef _VMBUS_VAR_H_ 30#define _VMBUS_VAR_H_ 31 32#include <sys/param.h> |
33#include <sys/bus_dma.h> | |
34#include <sys/taskqueue.h> 35 36#include <dev/hyperv/include/hyperv_busdma.h> 37 38/* 39 * NOTE: DO NOT CHANGE THIS. 40 */ 41#define VMBUS_SINT_MESSAGE 2 --- 74 unchanged lines hidden (view full) --- 116 /* Primary channels */ 117 struct mtx vmbus_prichan_lock; 118 TAILQ_HEAD(, vmbus_channel) vmbus_prichans; 119}; 120 121#define VMBUS_FLAG_ATTACHED 0x0001 /* vmbus was attached */ 122#define VMBUS_FLAG_SYNIC 0x0002 /* SynIC was setup */ 123 | 33#include <sys/taskqueue.h> 34 35#include <dev/hyperv/include/hyperv_busdma.h> 36 37/* 38 * NOTE: DO NOT CHANGE THIS. 39 */ 40#define VMBUS_SINT_MESSAGE 2 --- 74 unchanged lines hidden (view full) --- 115 /* Primary channels */ 116 struct mtx vmbus_prichan_lock; 117 TAILQ_HEAD(, vmbus_channel) vmbus_prichans; 118}; 119 120#define VMBUS_FLAG_ATTACHED 0x0001 /* vmbus was attached */ 121#define VMBUS_FLAG_SYNIC 0x0002 /* SynIC was setup */ 122 |
124extern struct vmbus_softc *vmbus_sc; 125 126static __inline struct vmbus_softc * 127vmbus_get_softc(void) 128{ 129 return vmbus_sc; 130} 131 132static __inline device_t 133vmbus_get_device(void) 134{ 135 return vmbus_sc->vmbus_dev; 136} 137 | |
138#define VMBUS_PCPU_GET(sc, field, cpu) (sc)->vmbus_pcpu[(cpu)].field 139#define VMBUS_PCPU_PTR(sc, field, cpu) &(sc)->vmbus_pcpu[(cpu)].field 140 141struct vmbus_channel; 142struct trapframe; 143struct vmbus_message; 144struct vmbus_msghc; 145 | 123#define VMBUS_PCPU_GET(sc, field, cpu) (sc)->vmbus_pcpu[(cpu)].field 124#define VMBUS_PCPU_PTR(sc, field, cpu) &(sc)->vmbus_pcpu[(cpu)].field 125 126struct vmbus_channel; 127struct trapframe; 128struct vmbus_message; 129struct vmbus_msghc; 130 |
146void vmbus_handle_intr(struct trapframe *); 147int vmbus_add_child(struct vmbus_channel *); 148int vmbus_delete_child(struct vmbus_channel *); 149void vmbus_et_intr(struct trapframe *); 150uint32_t vmbus_gpadl_alloc(struct vmbus_softc *); | 131void vmbus_handle_intr(struct trapframe *); 132int vmbus_add_child(struct vmbus_channel *); 133int vmbus_delete_child(struct vmbus_channel *); 134void vmbus_et_intr(struct trapframe *); 135uint32_t vmbus_gpadl_alloc(struct vmbus_softc *); |
151 | 136 |
152struct vmbus_msghc *vmbus_msghc_get(struct vmbus_softc *, size_t); 153void vmbus_msghc_put(struct vmbus_softc *, struct vmbus_msghc *); 154void *vmbus_msghc_dataptr(struct vmbus_msghc *); 155int vmbus_msghc_exec_noresult(struct vmbus_msghc *); 156int vmbus_msghc_exec(struct vmbus_softc *, struct vmbus_msghc *); 157const struct vmbus_message *vmbus_msghc_wait_result(struct vmbus_softc *, 158 struct vmbus_msghc *); 159void vmbus_msghc_wakeup(struct vmbus_softc *, const struct vmbus_message *); 160void vmbus_msghc_reset(struct vmbus_msghc *, size_t); | 137struct vmbus_msghc * 138 vmbus_msghc_get(struct vmbus_softc *, size_t); 139void vmbus_msghc_put(struct vmbus_softc *, struct vmbus_msghc *); 140void *vmbus_msghc_dataptr(struct vmbus_msghc *); 141int vmbus_msghc_exec_noresult(struct vmbus_msghc *); 142int vmbus_msghc_exec(struct vmbus_softc *, struct vmbus_msghc *); 143const struct vmbus_message * 144 vmbus_msghc_wait_result(struct vmbus_softc *, 145 struct vmbus_msghc *); 146void vmbus_msghc_wakeup(struct vmbus_softc *, 147 const struct vmbus_message *); 148void vmbus_msghc_reset(struct vmbus_msghc *, size_t); |
161 162#endif /* !_VMBUS_VAR_H_ */ | 149 150#endif /* !_VMBUS_VAR_H_ */ |