~n-muench/ubuntu/precise/open-vm-tools/open-vm-tools-precise.sid-sync1a

« back to all changes in this revision

Viewing changes to modules/linux/shared/vmciQPair.h

  • Committer: Bazaar Package Importer
  • Author(s): Nate Muench
  • Date: 2010-09-06 21:06:01 UTC
  • mfrom: (2.4.19 sid)
  • Revision ID: james.westby@ubuntu.com-20100906210601-gxxy30e5roil4srt
Tags: 2010.06.16-268169-3ubuntu1
* Merge from Debian testing (LP: #632101), remaining changes:
  - Recommend open-vm-toolbox in open-vm-tools.
  - Rediffing vsock.patch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*********************************************************
2
 
 * Copyright (C) 2010 VMware, Inc. All rights reserved.
3
 
 *
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.
7
 
 *
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
11
 
 * for more details.
12
 
 *
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
16
 
 *
17
 
 *********************************************************/
18
 
 
19
 
#ifndef _VMCI_QPAIR_H_
20
 
#define _VMCI_QPAIR_H_
21
 
 
22
 
/*
23
 
 *
24
 
 * vmciQPair.h --
25
 
 *
26
 
 *    Defines the interface to the VMCI kernel module for clients.
27
 
 */
28
 
 
29
 
#define INCLUDE_ALLOW_MODULE
30
 
#define INCLUDE_ALLOW_VMKERNEL
31
 
#define INCLUDE_ALLOW_VMK_MODULE
32
 
#include "includeCheck.h"
33
 
 
34
 
#include "vmci_defs.h"
35
 
 
36
 
typedef struct VMCIQPair VMCIQPair;
37
 
 
38
 
int VMCIQPair_Alloc(VMCIQPair **qpair,
39
 
                    VMCIHandle *handle,
40
 
                    uint64 produceQSize,
41
 
                    uint64 consumeQSize,
42
 
                    VMCIId peer,
43
 
                    uint32 flags,
44
 
                    VMCIPrivilegeFlags privFlags);
45
 
 
46
 
void VMCIQPair_Detach(VMCIQPair **qpair);
47
 
 
48
 
void VMCIQPair_Init(VMCIQPair *qpair);
49
 
void VMCIQPair_GetProduceIndexes(const VMCIQPair *qpair,
50
 
                                 uint64 *producerTail,
51
 
                                 uint64 *consumerHead);
52
 
void VMCIQPair_GetConsumeIndexes(const VMCIQPair *qpair,
53
 
                                 uint64 *consumerTail,
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,
60
 
                          const void *buf,
61
 
                          size_t bufSize,
62
 
                          int mode);
63
 
ssize_t VMCIQPair_Dequeue(VMCIQPair *qpair,
64
 
                          void *buf,
65
 
                          size_t bufSize,
66
 
                          int mode);
67
 
ssize_t VMCIQPair_Peek(VMCIQPair *qpair,
68
 
                       void *buf,
69
 
                       size_t bufSize,
70
 
                       int mode);
71
 
 
72
 
#if defined (SOLARIS) || (defined(__APPLE__) && !defined (VMX86_TOOLS)) || \
73
 
    (defined(__linux__) && defined(__KERNEL__))
74
 
/*
75
 
 * Environments that support struct iovec
76
 
 */
77
 
 
78
 
ssize_t VMCIQPair_EnqueueV(VMCIQPair *qpair,
79
 
                           void *iov,
80
 
                           size_t iovSize,
81
 
                           int mode);
82
 
ssize_t VMCIQPair_DequeueV(VMCIQPair *qpair,
83
 
                           void *iov,
84
 
                           size_t iovSize,
85
 
                           int mode);
86
 
ssize_t VMCIQPair_PeekV(VMCIQPair *qpair,
87
 
                        void *iov,
88
 
                        size_t iovSize,
89
 
                        int mode);
90
 
#endif /* Systems that support struct iovec */
91
 
 
92
 
 
93
 
#endif /* _VMCIQPAIR_H_ */
94
 
 
95
 
/*********************************************************
96
 
 * Copyright (C) 2010 VMware, Inc. All rights reserved.
97
 
 *
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.
101
 
 *
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
105
 
 * for more details.
106
 
 *
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
110
 
 *
111
 
 *********************************************************/
112
 
 
113
 
#ifndef _VMCI_QPAIR_H_
114
 
#define _VMCI_QPAIR_H_
115
 
 
116
 
/*
117
 
 *
118
 
 * vmciQPair.h --
119
 
 *
120
 
 *    Defines the interface to the VMCI kernel module for clients.
121
 
 */
122
 
 
123
 
#define INCLUDE_ALLOW_MODULE
124
 
#define INCLUDE_ALLOW_VMKERNEL
125
 
#define INCLUDE_ALLOW_VMK_MODULE
126
 
#include "includeCheck.h"
127
 
 
128
 
#include "vmci_defs.h"
129
 
 
130
 
typedef struct VMCIQPair VMCIQPair;
131
 
 
132
 
int VMCIQPair_Alloc(VMCIQPair **qpair,
133
 
                    VMCIHandle *handle,
134
 
                    uint64 produceQSize,
135
 
                    uint64 consumeQSize,
136
 
                    VMCIId peer,
137
 
                    uint32 flags,
138
 
                    VMCIPrivilegeFlags privFlags);
139
 
 
140
 
void VMCIQPair_Detach(VMCIQPair **qpair);
141
 
 
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,
154
 
                          const void *buf,
155
 
                          size_t bufSize,
156
 
                          int mode);
157
 
ssize_t VMCIQPair_Dequeue(VMCIQPair *qpair,
158
 
                          void *buf,
159
 
                          size_t bufSize,
160
 
                          int mode);
161
 
ssize_t VMCIQPair_Peek(VMCIQPair *qpair,
162
 
                       void *buf,
163
 
                       size_t bufSize,
164
 
                       int mode);
165
 
 
166
 
#if defined (SOLARIS) || (defined(__APPLE__) && !defined (VMX86_TOOLS)) || \
167
 
    (defined(__linux__) && defined(__KERNEL__))
168
 
/*
169
 
 * Environments that support struct iovec
170
 
 */
171
 
 
172
 
ssize_t VMCIQPair_EnqueueV(VMCIQPair *qpair,
173
 
                           void *iov,
174
 
                           size_t iovSize,
175
 
                           int mode);
176
 
ssize_t VMCIQPair_DequeueV(VMCIQPair *qpair,
177
 
                           void *iov,
178
 
                           size_t iovSize,
179
 
                           int mode);
180
 
ssize_t VMCIQPair_PeekV(VMCIQPair *qpair,
181
 
                        void *iov,
182
 
                        size_t iovSize,
183
 
                        int mode);
184
 
#endif /* Systems that support struct iovec */
185
 
 
186
 
 
187
 
#endif /* _VMCIQPAIR_H_ */
188