VirtualBox

source: vbox/trunk/include/VBox/cdefs.h@ 35855

Last change on this file since 35855 was 35855, checked in by vboxsync, 14 years ago

PCI: start of driver communication infrastructure

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 11.9 KB
Line 
1/** @file
2 * VirtualBox - Common C and C++ definition.
3 */
4
5/*
6 * Copyright (C) 2006-2007 Oracle Corporation
7 *
8 * This file is part of VirtualBox Open Source Edition (OSE), as
9 * available from http://www.virtualbox.org. This file is free software;
10 * you can redistribute it and/or modify it under the terms of the GNU
11 * General Public License (GPL) as published by the Free Software
12 * Foundation, in version 2 as it comes in the "COPYING" file of the
13 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
14 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
15 *
16 * The contents of this file may alternatively be used under the terms
17 * of the Common Development and Distribution License Version 1.0
18 * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
19 * VirtualBox OSE distribution, in which case the provisions of the
20 * CDDL are applicable instead of those of the GPL.
21 *
22 * You may elect to license modified versions of this file under the
23 * terms and conditions of either the GPL or the CDDL or both.
24 */
25
26#ifndef ___VBox_cdefs_h
27#define ___VBox_cdefs_h
28
29#include <iprt/cdefs.h>
30
31
32/** @def VBOX_WITH_STATISTICS
33 * When defined all statistics will be included in the build.
34 * This is enabled by default in all debug builds.
35 */
36#ifndef VBOX_WITH_STATISTICS
37# ifdef DEBUG
38# define VBOX_WITH_STATISTICS
39# endif
40#endif
41
42/** @def VBOX_STRICT
43 * Alias for RT_STRICT.
44 */
45#ifdef RT_STRICT
46# ifndef VBOX_STRICT
47# define VBOX_STRICT
48# endif
49#endif
50
51
52/*
53 * Shut up DOXYGEN warnings and guide it properly thru the code.
54 */
55#ifdef DOXYGEN_RUNNING
56#define VBOX_WITH_STATISTICS
57#define VBOX_STRICT
58#define IN_DBG
59#define IN_DIS
60#define IN_INTNET_R0
61#define IN_INTNET_R3
62#define IN_PCIRAW_R0
63#define IN_PCIRAW_R3
64#define IN_REM_R3
65#define IN_SUP_R0
66#define IN_SUP_R3
67#define IN_SUP_RC
68#define IN_SUP_STATIC
69#define IN_USBLIB
70#define IN_VBOXDDU
71#define IN_VMM_RC
72#define IN_VMM_R0
73#define IN_VMM_R3
74#define IN_VMM_STATIC
75#endif
76
77
78
79
80/** @def VBOXCALL
81 * The standard calling convention for VBOX interfaces.
82 */
83#define VBOXCALL RTCALL
84
85
86
87/** @def IN_DIS
88 * Used to indicate whether we're inside the same link module as the
89 * disassembler.
90 */
91/** @def DISDECL(type)
92 * Disassembly export or import declaration.
93 * @param type The return type of the function declaration.
94 */
95#if defined(IN_DIS)
96# define DISDECL(type) DECLEXPORT(type) VBOXCALL
97#else
98# define DISDECL(type) DECLIMPORT(type) VBOXCALL
99#endif
100
101
102
103/** @def IN_DBG
104 * Used to indicate whether we're inside the same link module as the debugger
105 * console, gui, and related things (ring-3).
106 */
107/** @def DBGDECL(type)
108 * Debugger module export or import declaration.
109 * Functions declared using this exists only in R3 since the
110 * debugger modules is R3 only.
111 * @param type The return type of the function declaration.
112 */
113#if defined(IN_DBG_R3) || defined(IN_DBG)
114# define DBGDECL(type) DECLEXPORT(type) VBOXCALL
115#else
116# define DBGDECL(type) DECLIMPORT(type) VBOXCALL
117#endif
118
119
120
121/** @def IN_INTNET_R3
122 * Used to indicate whether we're inside the same link module as the Ring-3
123 * Internal Networking Service.
124 */
125/** @def INTNETR3DECL(type)
126 * Internal Networking Service export or import declaration.
127 * @param type The return type of the function declaration.
128 */
129#ifdef IN_INTNET_R3
130# define INTNETR3DECL(type) DECLEXPORT(type) VBOXCALL
131#else
132# define INTNETR3DECL(type) DECLIMPORT(type) VBOXCALL
133#endif
134
135/** @def IN_INTNET_R0
136 * Used to indicate whether we're inside the same link module as the R0
137 * Internal Network Service.
138 */
139/** @def INTNETR0DECL(type)
140 * Internal Networking Service export or import declaration.
141 * @param type The return type of the function declaration.
142 */
143#ifdef IN_INTNET_R0
144# define INTNETR0DECL(type) DECLEXPORT(type) VBOXCALL
145#else
146# define INTNETR0DECL(type) DECLIMPORT(type) VBOXCALL
147#endif
148
149/** @def IN_PCIRAW_R3
150 * Used to indicate whether we're inside the same link module as the Ring-3
151 * PCI passthrough support.
152 */
153/** @def PCIRAWR3DECL(type)
154 * PCI passthrough export or import declaration.
155 * @param type The return type of the function declaration.
156 */
157#ifdef IN_PCIRAW_R3
158# define PCIRAWR3DECL(type) DECLEXPORT(type) VBOXCALL
159#else
160# define PCIRAWR3DECL(type) DECLIMPORT(type) VBOXCALL
161#endif
162
163/** @def IN_PCIRAW_R0
164 * Used to indicate whether we're inside the same link module as the R0
165 * PCI passthrough support.
166 */
167/** @def PCIRAWR0DECL(type)
168 * PCI passthroug export or import declaration.
169 * @param type The return type of the function declaration.
170 */
171#ifdef IN_PCIRAW_R0
172# define PCIRAWR0DECL(type) DECLEXPORT(type) VBOXCALL
173#else
174# define PCIRAWR0DECL(type) DECLIMPORT(type) VBOXCALL
175#endif
176
177
178/** @def IN_REM_R3
179 * Used to indicate whether we're inside the same link module as
180 * the HC Ring-3 Recompiled Execution Manager.
181 */
182/** @def REMR3DECL(type)
183 * Recompiled Execution Manager HC Ring-3 export or import declaration.
184 * @param type The return type of the function declaration.
185 */
186#ifdef IN_REM_R3
187# define REMR3DECL(type) DECLEXPORT(type) VBOXCALL
188#else
189# define REMR3DECL(type) DECLIMPORT(type) VBOXCALL
190#endif
191
192
193
194/** @def IN_SUP_R3
195 * Used to indicate whether we're inside the same link module as the Ring-3
196 * Support Library or not.
197 */
198/** @def SUPR3DECL(type)
199 * Support library export or import declaration.
200 * @param type The return type of the function declaration.
201 */
202#ifdef IN_SUP_R3
203# define SUPR3DECL(type) DECLEXPORT(type) VBOXCALL
204#else
205# define SUPR3DECL(type) DECLIMPORT(type) VBOXCALL
206#endif
207
208/** @def IN_SUP_R0
209 * Used to indicate whether we're inside the same link module as the Ring-0
210 * Support Library or not.
211 */
212/** @def IN_SUP_STATIC
213 * Used to indicate that the Support Library is built or used as a static
214 * library.
215 */
216/** @def SUPR0DECL(type)
217 * Support library export or import declaration.
218 * @param type The return type of the function declaration.
219 */
220#ifdef IN_SUP_R0
221# ifdef IN_SUP_STATIC
222# define SUPR0DECL(type) DECLHIDDEN(type) VBOXCALL
223# else
224# define SUPR0DECL(type) DECLEXPORT(type) VBOXCALL
225# endif
226#else
227# ifdef IN_SUP_STATIC
228# define SUPR0DECL(type) DECLHIDDEN(type) VBOXCALL
229# else
230# define SUPR0DECL(type) DECLIMPORT(type) VBOXCALL
231# endif
232#endif
233
234/** @def IN_SUP_RC
235 * Used to indicate whether we're inside the same link module as the RC Support
236 * Library or not.
237 */
238/** @def SUPRCDECL(type)
239 * Support library export or import declaration.
240 * @param type The return type of the function declaration.
241 */
242#ifdef IN_SUP_RC
243# define SUPRCDECL(type) DECLEXPORT(type) VBOXCALL
244#else
245# define SUPRCDECL(type) DECLIMPORT(type) VBOXCALL
246#endif
247
248/** @def IN_SUP_R0
249 * Used to indicate whether we're inside the same link module as the Ring-0
250 * Support Library or not.
251 */
252/** @def SUPR0DECL(type)
253 * Support library export or import declaration.
254 * @param type The return type of the function declaration.
255 */
256#if defined(IN_SUP_R0) || defined(IN_SUP_R3) || defined(IN_SUP_RC)
257# define SUPDECL(type) DECLEXPORT(type) VBOXCALL
258#else
259# define SUPDECL(type) DECLIMPORT(type) VBOXCALL
260#endif
261
262
263
264/** @def IN_USBLIB
265 * Used to indicate whether we're inside the same link module as the USBLib.
266 */
267/** @def USBLIB_DECL
268 * USBLIB export or import declaration.
269 * @param type The return type of the function declaration.
270 */
271#ifdef IN_RING0
272# define USBLIB_DECL(type) type VBOXCALL
273#elif defined(IN_USBLIB)
274# define USBLIB_DECL(type) DECLEXPORT(type) VBOXCALL
275#else
276# define USBLIB_DECL(type) DECLIMPORT(type) VBOXCALL
277#endif
278
279
280
281/** @def IN_VMM_STATIC
282 * Used to indicate that the virtual machine monitor is built or used as a
283 * static library.
284 */
285/** @def IN_VMM_R3
286 * Used to indicate whether we're inside the same link module as the ring 3 part of the
287 * virtual machine monitor or not.
288 */
289/** @def VMMR3DECL
290 * Ring-3 VMM export or import declaration.
291 * @param type The return type of the function declaration.
292 */
293#ifdef IN_VMM_R3
294# ifdef IN_VMM_STATIC
295# define VMMR3DECL(type) DECLHIDDEN(type) VBOXCALL
296# else
297# define VMMR3DECL(type) DECLEXPORT(type) VBOXCALL
298# endif
299#elif defined(IN_RING3)
300# ifdef IN_VMM_STATIC
301# define VMMR3DECL(type) DECLHIDDEN(type) VBOXCALL
302# else
303# define VMMR3DECL(type) DECLIMPORT(type) VBOXCALL
304# endif
305#else
306# define VMMR3DECL(type) DECL_INVALID(type)
307#endif
308
309/** @def IN_VMM_R0
310 * Used to indicate whether we're inside the same link module as the ring-0 part
311 * of the virtual machine monitor or not.
312 */
313/** @def VMMR0DECL
314 * Ring-0 VMM export or import declaration.
315 * @param type The return type of the function declaration.
316 */
317#ifdef IN_VMM_R0
318# define VMMR0DECL(type) DECLEXPORT(type) VBOXCALL
319#elif defined(IN_RING0)
320# define VMMR0DECL(type) DECLIMPORT(type) VBOXCALL
321#else
322# define VMMR0DECL(type) DECL_INVALID(type)
323#endif
324
325/** @def IN_VMM_RC
326 * Used to indicate whether we're inside the same link module as the raw-mode
327 * context part of the virtual machine monitor or not.
328 */
329/** @def VMMRCDECL
330 * Raw-mode context VMM export or import declaration.
331 * @param type The return type of the function declaration.
332 */
333#ifdef IN_VMM_RC
334# define VMMRCDECL(type) DECLEXPORT(type) VBOXCALL
335#elif defined(IN_RC)
336# define VMMRCDECL(type) DECLIMPORT(type) VBOXCALL
337#else
338# define VMMRCDECL(type) DECL_INVALID(type)
339#endif
340
341/** @def VMMRZDECL
342 * Ring-0 and Raw-mode context VMM export or import declaration.
343 * @param type The return type of the function declaration.
344 */
345#if defined(IN_VMM_R0) || defined(IN_VMM_RC)
346# define VMMRZDECL(type) DECLEXPORT(type) VBOXCALL
347#elif defined(IN_RING0) || defined(IN_RZ)
348# define VMMRZDECL(type) DECLIMPORT(type) VBOXCALL
349#else
350# define VMMRZDECL(type) DECL_INVALID(type)
351#endif
352
353/** @def VMMDECL
354 * VMM export or import declaration.
355 * @param type The return type of the function declaration.
356 */
357#ifdef IN_VMM_STATIC
358# define VMMDECL(type) DECLHIDDEN(type) VBOXCALL
359#elif defined(IN_VMM_R3) || defined(IN_VMM_R0) || defined(IN_VMM_RC)
360# define VMMDECL(type) DECLEXPORT(type) VBOXCALL
361#else
362# define VMMDECL(type) DECLIMPORT(type) VBOXCALL
363#endif
364
365/** @def VMM_INT_DECL
366 * VMM internal function.
367 * @param type The return type of the function declaration.
368 */
369#if defined(IN_VMM_R3) || defined(IN_VMM_R0) || defined(IN_VMM_RC)
370# define VMM_INT_DECL(type) DECLHIDDEN(type) VBOXCALL
371#else
372# define VMM_INT_DECL(type) DECL_INVALID(type)
373#endif
374
375/** @def VMMR3_INT_DECL
376 * VMM internal function, ring-3.
377 * @param type The return type of the function declaration.
378 */
379#ifdef IN_VMM_R3
380# define VMMR3_INT_DECL(type) DECLHIDDEN(type) VBOXCALL
381#else
382# define VMMR3_INT_DECL(type) DECL_INVALID(type)
383#endif
384
385/** @def VMMR0_INT_DECL
386 * VMM internal function, ring-0.
387 * @param type The return type of the function declaration.
388 */
389#ifdef IN_VMM_R0
390# define VMMR0_INT_DECL(type) DECLHIDDEN(type) VBOXCALL
391#else
392# define VMMR0_INT_DECL(type) DECL_INVALID(type)
393#endif
394
395/** @def VMMRC_INT_DECL
396 * VMM internal function, raw-mode context.
397 * @param type The return type of the function declaration.
398 */
399#ifdef IN_VMM_RC
400# define VMMRC_INT_DECL(type) DECLHIDDEN(type) VBOXCALL
401#else
402# define VMMRC_INT_DECL(type) DECL_INVALID(type)
403#endif
404
405/** @def VMMRZ_INT_DECL
406 * VMM internal function, ring-0 + raw-mode context.
407 * @param type The return type of the function declaration.
408 */
409#ifdef IN_VMM_RZ
410# define VMMRZ_INT_DECL(type) DECLHIDDEN(type) VBOXCALL
411#else
412# define VMMRZ_INT_DECL(type) DECL_INVALID(type)
413#endif
414
415
416
417/** @def IN_VBOXDDU
418 * Used to indicate whether we're inside the VBoxDDU shared object.
419 */
420/** @def VBOXDDU_DECL(type)
421 * VBoxDDU export or import (ring-3).
422 * @param type The return type of the function declaration.
423 */
424#ifdef IN_VBOXDDU
425# ifdef IN_VBOXDDU_STATIC
426# define VBOXDDU_DECL(type) type
427# else
428# define VBOXDDU_DECL(type) DECLEXPORT(type) VBOXCALL
429# endif
430#else
431# define VBOXDDU_DECL(type) DECLIMPORT(type) VBOXCALL
432#endif
433
434
435#endif
436
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette