Deleted Added
full compact
hyperv.h (307453) hyperv.h (307454)
1/*-
2 * Copyright (c) 2009-2012,2016 Microsoft Corp.
3 * Copyright (c) 2012 NetApp Inc.
4 * Copyright (c) 2012 Citrix Inc.
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions

--- 11 unchanged lines hidden (view full) ---

20 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 *
1/*-
2 * Copyright (c) 2009-2012,2016 Microsoft Corp.
3 * Copyright (c) 2012 NetApp Inc.
4 * Copyright (c) 2012 Citrix Inc.
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions

--- 11 unchanged lines hidden (view full) ---

20 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 *
28 * $FreeBSD: stable/11/sys/dev/hyperv/include/hyperv.h 307453 2016-10-17 02:23:05Z sephe $
28 * $FreeBSD: stable/11/sys/dev/hyperv/include/hyperv.h 307454 2016-10-17 02:25:43Z sephe $
29 */
30
31/**
32 * HyperV definitions for messages that are sent between instances of the
33 * Channel Management Library in separate partitions, or in some cases,
34 * back to itself.
35 */
36

--- 200 unchanged lines hidden (view full) ---

237} __packed hv_vmbus_multipage_buffer;
238
239typedef struct {
240 hv_vmbus_ring_buffer* ring_buffer;
241 struct mtx ring_lock;
242 uint32_t ring_data_size; /* ring_size */
243} hv_vmbus_ring_buffer_info;
244
29 */
30
31/**
32 * HyperV definitions for messages that are sent between instances of the
33 * Channel Management Library in separate partitions, or in some cases,
34 * back to itself.
35 */
36

--- 200 unchanged lines hidden (view full) ---

237} __packed hv_vmbus_multipage_buffer;
238
239typedef struct {
240 hv_vmbus_ring_buffer* ring_buffer;
241 struct mtx ring_lock;
242 uint32_t ring_data_size; /* ring_size */
243} hv_vmbus_ring_buffer_info;
244
245typedef void (*hv_vmbus_pfn_channel_callback)(void *context);
245typedef void (*vmbus_chan_callback_t)(void *);
246
247typedef struct hv_vmbus_channel {
248 device_t ch_dev;
249 struct vmbus_softc *vmbus_sc;
250 uint32_t ch_flags; /* VMBUS_CHAN_FLAG_ */
251 uint32_t ch_id; /* channel id */
252
253 /*

--- 7 unchanged lines hidden (view full) ---

261 * send to parent
262 */
263 hv_vmbus_ring_buffer_info outbound;
264 /*
265 * receive from parent
266 */
267 hv_vmbus_ring_buffer_info inbound;
268
246
247typedef struct hv_vmbus_channel {
248 device_t ch_dev;
249 struct vmbus_softc *vmbus_sc;
250 uint32_t ch_flags; /* VMBUS_CHAN_FLAG_ */
251 uint32_t ch_id; /* channel id */
252
253 /*

--- 7 unchanged lines hidden (view full) ---

261 * send to parent
262 */
263 hv_vmbus_ring_buffer_info outbound;
264 /*
265 * receive from parent
266 */
267 hv_vmbus_ring_buffer_info inbound;
268
269 struct taskqueue * rxq;
270 struct task channel_task;
271 hv_vmbus_pfn_channel_callback on_channel_callback;
272 void* channel_callback_context;
269 struct taskqueue *ch_tq;
270 struct task ch_task;
271 vmbus_chan_callback_t ch_cb;
272 void *ch_cbarg;
273
274 struct hyperv_mon_param *ch_monprm;
275 struct hyperv_dma ch_monprm_dma;
276
273
274 struct hyperv_mon_param *ch_monprm;
275 struct hyperv_dma ch_monprm_dma;
276
277 int ch_cpuid; /* owner cpu */
277 /*
278 /*
278 * From Win8, this field specifies the target virtual process
279 * on which to deliver the interrupt from the host to guest.
280 * Before Win8, all channel interrupts would only be
281 * delivered on cpu 0. Setting this value to 0 would preserve
282 * the earlier behavior.
279 * Virtual cpuid for ch_cpuid; it is used to communicate cpuid
280 * related information w/ Hyper-V. If MSR_HV_VP_INDEX does not
281 * exist, ch_vcpuid will always be 0 for compatibility.
283 */
282 */
284 uint32_t target_vcpu;
285 /* The corresponding CPUID in the guest */
286 uint32_t target_cpu;
283 uint32_t ch_vcpuid;
287
288 /*
289 * If this is a primary channel, ch_subchan* fields
290 * contain sub-channels belonging to this primary
291 * channel.
292 */
293 struct mtx ch_subchan_lock;
294 TAILQ_HEAD(, hv_vmbus_channel) ch_subchans;

--- 65 unchanged lines hidden (view full) ---

360 uint64_t* request_id);
361
362int hv_vmbus_channel_open(
363 hv_vmbus_channel* channel,
364 uint32_t send_ring_buffer_size,
365 uint32_t recv_ring_buffer_size,
366 void* user_data,
367 uint32_t user_data_len,
284
285 /*
286 * If this is a primary channel, ch_subchan* fields
287 * contain sub-channels belonging to this primary
288 * channel.
289 */
290 struct mtx ch_subchan_lock;
291 TAILQ_HEAD(, hv_vmbus_channel) ch_subchans;

--- 65 unchanged lines hidden (view full) ---

357 uint64_t* request_id);
358
359int hv_vmbus_channel_open(
360 hv_vmbus_channel* channel,
361 uint32_t send_ring_buffer_size,
362 uint32_t recv_ring_buffer_size,
363 void* user_data,
364 uint32_t user_data_len,
368 hv_vmbus_pfn_channel_callback
369 pfn_on_channel_callback,
370 void* context);
365 vmbus_chan_callback_t cb,
366 void *cbarg);
371
372void hv_vmbus_channel_close(hv_vmbus_channel *channel);
373
374int hv_vmbus_channel_send_packet(
375 hv_vmbus_channel* channel,
376 void* buffer,
377 uint32_t buffer_len,
378 uint64_t request_id,

--- 60 unchanged lines hidden ---
367
368void hv_vmbus_channel_close(hv_vmbus_channel *channel);
369
370int hv_vmbus_channel_send_packet(
371 hv_vmbus_channel* channel,
372 void* buffer,
373 uint32_t buffer_len,
374 uint64_t request_id,

--- 60 unchanged lines hidden ---