1
/*********************************************************
2
* Copyright (C) 2010 VMware, Inc. All rights reserved.
4
* This program is free software; you can redistribute it and/or modify it
5
* under the terms of the GNU General Public License as published by the
6
* Free Software Foundation version 2 and no later version.
8
* This program is distributed in the hope that it will be useful, but
9
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
10
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13
* You should have received a copy of the GNU General Public License along
14
* with this program; if not, write to the Free Software Foundation, Inc.,
15
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
17
*********************************************************/
19
#ifndef _VMCI_QPAIR_H_
20
#define _VMCI_QPAIR_H_
26
* Defines the interface to the VMCI kernel module for clients.
29
#define INCLUDE_ALLOW_MODULE
30
#define INCLUDE_ALLOW_VMKERNEL
31
#define INCLUDE_ALLOW_VMK_MODULE
32
#include "includeCheck.h"
34
#include "vmci_defs.h"
36
typedef struct VMCIQPair VMCIQPair;
38
int VMCIQPair_Alloc(VMCIQPair **qpair,
44
VMCIPrivilegeFlags privFlags);
46
void VMCIQPair_Detach(VMCIQPair **qpair);
48
void VMCIQPair_Init(VMCIQPair *qpair);
49
void VMCIQPair_GetProduceIndexes(const VMCIQPair *qpair,
51
uint64 *consumerHead);
52
void VMCIQPair_GetConsumeIndexes(const VMCIQPair *qpair,
54
uint64 *producerHead);
55
int64 VMCIQPair_ProduceFreeSpace(const VMCIQPair *qpair);
56
int64 VMCIQPair_ProduceBufReady(const VMCIQPair *qpair);
57
int64 VMCIQPair_ConsumeFreeSpace(const VMCIQPair *qpair);
58
int64 VMCIQPair_ConsumeBufReady(const VMCIQPair *qpair);
59
ssize_t VMCIQPair_Enqueue(VMCIQPair *qpair,
63
ssize_t VMCIQPair_Dequeue(VMCIQPair *qpair,
67
ssize_t VMCIQPair_Peek(VMCIQPair *qpair,
72
#if defined (SOLARIS) || (defined(__APPLE__) && !defined (VMX86_TOOLS)) || \
73
(defined(__linux__) && defined(__KERNEL__))
75
* Environments that support struct iovec
78
ssize_t VMCIQPair_EnqueueV(VMCIQPair *qpair,
82
ssize_t VMCIQPair_DequeueV(VMCIQPair *qpair,
86
ssize_t VMCIQPair_PeekV(VMCIQPair *qpair,
90
#endif /* Systems that support struct iovec */
93
#endif /* _VMCIQPAIR_H_ */
95
/*********************************************************
96
* Copyright (C) 2010 VMware, Inc. All rights reserved.
98
* This program is free software; you can redistribute it and/or modify it
99
* under the terms of the GNU General Public License as published by the
100
* Free Software Foundation version 2 and no later version.
102
* This program is distributed in the hope that it will be useful, but
103
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
104
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
107
* You should have received a copy of the GNU General Public License along
108
* with this program; if not, write to the Free Software Foundation, Inc.,
109
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
111
*********************************************************/
113
#ifndef _VMCI_QPAIR_H_
114
#define _VMCI_QPAIR_H_
120
* Defines the interface to the VMCI kernel module for clients.
123
#define INCLUDE_ALLOW_MODULE
124
#define INCLUDE_ALLOW_VMKERNEL
125
#define INCLUDE_ALLOW_VMK_MODULE
126
#include "includeCheck.h"
128
#include "vmci_defs.h"
130
typedef struct VMCIQPair VMCIQPair;
132
int VMCIQPair_Alloc(VMCIQPair **qpair,
138
VMCIPrivilegeFlags privFlags);
140
void VMCIQPair_Detach(VMCIQPair **qpair);
142
void VMCIQPair_Init(VMCIQPair *qpair);
143
void VMCIQPair_GetProduceIndexes(const VMCIQPair *qpair,
144
uint64 *producerTail,
145
uint64 *consumerHead);
146
void VMCIQPair_GetConsumeIndexes(const VMCIQPair *qpair,
147
uint64 *consumerTail,
148
uint64 *producerHead);
149
int64 VMCIQPair_ProduceFreeSpace(const VMCIQPair *qpair);
150
int64 VMCIQPair_ProduceBufReady(const VMCIQPair *qpair);
151
int64 VMCIQPair_ConsumeFreeSpace(const VMCIQPair *qpair);
152
int64 VMCIQPair_ConsumeBufReady(const VMCIQPair *qpair);
153
ssize_t VMCIQPair_Enqueue(VMCIQPair *qpair,
157
ssize_t VMCIQPair_Dequeue(VMCIQPair *qpair,
161
ssize_t VMCIQPair_Peek(VMCIQPair *qpair,
166
#if defined (SOLARIS) || (defined(__APPLE__) && !defined (VMX86_TOOLS)) || \
167
(defined(__linux__) && defined(__KERNEL__))
169
* Environments that support struct iovec
172
ssize_t VMCIQPair_EnqueueV(VMCIQPair *qpair,
176
ssize_t VMCIQPair_DequeueV(VMCIQPair *qpair,
180
ssize_t VMCIQPair_PeekV(VMCIQPair *qpair,
184
#endif /* Systems that support struct iovec */
187
#endif /* _VMCIQPAIR_H_ */