Deleted Added
full compact
vmbus_brvar.h (307486) vmbus_brvar.h (307599)
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/vmbus/vmbus_brvar.h 307486 2016-10-17 07:16:04Z sephe $
28 * $FreeBSD: stable/11/sys/dev/hyperv/vmbus/vmbus_brvar.h 307599 2016-10-19 02:24:17Z sephe $
29 */
30
31#ifndef _VMBUS_BRVAR_H_
32#define _VMBUS_BRVAR_H_
33
34#include <sys/param.h>
35#include <sys/lock.h>
36#include <sys/mutex.h>

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

78 /*
79 * - 64 bits for the trailing start index (- sizeof(uint64_t)).
80 * - The rindex and windex can't be same (- 1). See
81 * the comment near vmbus_bufring.br_{r,w}index.
82 */
83 return (tbr->txbr_dsize - sizeof(uint64_t) - 1);
84}
85
29 */
30
31#ifndef _VMBUS_BRVAR_H_
32#define _VMBUS_BRVAR_H_
33
34#include <sys/param.h>
35#include <sys/lock.h>
36#include <sys/mutex.h>

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

78 /*
79 * - 64 bits for the trailing start index (- sizeof(uint64_t)).
80 * - The rindex and windex can't be same (- 1). See
81 * the comment near vmbus_bufring.br_{r,w}index.
82 */
83 return (tbr->txbr_dsize - sizeof(uint64_t) - 1);
84}
85
86static __inline bool
87vmbus_txbr_empty(const struct vmbus_txbr *tbr)
88{
89
90 return (tbr->txbr_windex == tbr->txbr_rindex ? true : false);
91}
92
93static __inline bool
94vmbus_rxbr_empty(const struct vmbus_rxbr *rbr)
95{
96
97 return (rbr->rxbr_windex == rbr->rxbr_rindex ? true : false);
98}
99
86static __inline int
87vmbus_br_nelem(int br_size, int elem_size)
88{
89
90 /* Strip bufring header */
91 br_size -= sizeof(struct vmbus_bufring);
92 /* Add per-element trailing index */
93 elem_size += sizeof(uint64_t);

--- 23 unchanged lines hidden ---
100static __inline int
101vmbus_br_nelem(int br_size, int elem_size)
102{
103
104 /* Strip bufring header */
105 br_size -= sizeof(struct vmbus_bufring);
106 /* Add per-element trailing index */
107 elem_size += sizeof(uint64_t);

--- 23 unchanged lines hidden ---