]>
git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blob - ubuntu/vbox/include/VBox/cdefs.h
fe3476090c22912a8d717f79f124c3633ae08573
2 * VirtualBox - Common C and C++ definition.
6 * Copyright (C) 2006-2016 Oracle Corporation
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.
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.
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.
26 #ifndef ___VBox_cdefs_h
27 #define ___VBox_cdefs_h
29 #include <iprt/cdefs.h>
32 /** @defgroup VBox Common Defintions and Macros
36 /** @def VBOX_WITH_STATISTICS
37 * When defined all statistics will be included in the build.
38 * This is enabled by default in all debug builds.
40 #ifndef VBOX_WITH_STATISTICS
42 # define VBOX_WITH_STATISTICS
47 * Alias for RT_STRICT.
57 * Shut up DOXYGEN warnings and guide it properly thru the code.
59 #ifdef DOXYGEN_RUNNING
60 #define VBOX_WITH_STATISTICS
85 * The standard calling convention for VBOX interfaces.
87 #define VBOXCALL RTCALL
92 * Used to indicate whether we're inside the same link module as the
95 /** @def DISDECL(type)
96 * Disassembly export or import declaration.
97 * @param type The return type of the function declaration.
100 # define DISDECL(type) DECLEXPORT(type) VBOXCALL
102 # define DISDECL(type) DECLIMPORT(type) VBOXCALL
108 * Used to indicate whether we're inside the same link module as the debugger
109 * console, gui, and related things (ring-3).
111 /** @def DBGDECL(type)
112 * Debugger module export or import declaration.
113 * Functions declared using this exists only in R3 since the
114 * debugger modules is R3 only.
115 * @param type The return type of the function declaration.
117 #if defined(IN_DBG_R3) || defined(IN_DBG)
118 # define DBGDECL(type) DECLEXPORT(type) VBOXCALL
120 # define DBGDECL(type) DECLIMPORT(type) VBOXCALL
125 /** @def IN_INTNET_R3
126 * Used to indicate whether we're inside the same link module as the Ring-3
127 * Internal Networking Service.
129 /** @def INTNETR3DECL(type)
130 * Internal Networking Service export or import declaration.
131 * @param type The return type of the function declaration.
134 # define INTNETR3DECL(type) DECLEXPORT(type) VBOXCALL
136 # define INTNETR3DECL(type) DECLIMPORT(type) VBOXCALL
139 /** @def IN_INTNET_R0
140 * Used to indicate whether we're inside the same link module as the R0
141 * Internal Network Service.
143 /** @def INTNETR0DECL(type)
144 * Internal Networking Service export or import declaration.
145 * @param type The return type of the function declaration.
148 # define INTNETR0DECL(type) DECLEXPORT(type) VBOXCALL
150 # define INTNETR0DECL(type) DECLIMPORT(type) VBOXCALL
155 /** @def IN_PCIRAW_R3
156 * Used to indicate whether we're inside the same link module as the Ring-3
157 * PCI passthrough support.
159 /** @def PCIRAWR3DECL(type)
160 * PCI passthrough export or import declaration.
161 * @param type The return type of the function declaration.
164 # define PCIRAWR3DECL(type) DECLEXPORT(type) VBOXCALL
166 # define PCIRAWR3DECL(type) DECLIMPORT(type) VBOXCALL
169 /** @def IN_PCIRAW_R0
170 * Used to indicate whether we're inside the same link module as the R0
171 * PCI passthrough support.
173 /** @def PCIRAWR0DECL(type)
174 * PCI passthroug export or import declaration.
175 * @param type The return type of the function declaration.
178 # define PCIRAWR0DECL(type) DECLEXPORT(type) VBOXCALL
180 # define PCIRAWR0DECL(type) DECLIMPORT(type) VBOXCALL
186 * Used to indicate whether we're inside the same link module as
187 * the HC Ring-3 Recompiled Execution Manager.
189 /** @def REMR3DECL(type)
190 * Recompiled Execution Manager HC Ring-3 export or import declaration.
191 * @param type The return type of the function declaration.
194 # define REMR3DECL(type) DECLEXPORT(type) VBOXCALL
196 # define REMR3DECL(type) DECLIMPORT(type) VBOXCALL
202 * Used to indicate whether we're inside the same link module as the Ring-3
203 * Support Library or not.
205 /** @def SUPR3DECL(type)
206 * Support library export or import declaration.
207 * @param type The return type of the function declaration.
210 # ifdef IN_SUP_STATIC
211 # define SUPR3DECL(type) DECLHIDDEN(type) VBOXCALL
213 # define SUPR3DECL(type) DECLEXPORT(type) VBOXCALL
216 # ifdef IN_SUP_STATIC
217 # define SUPR3DECL(type) DECLHIDDEN(type) VBOXCALL
219 # define SUPR3DECL(type) DECLIMPORT(type) VBOXCALL
224 * Used to indicate whether we're inside the same link module as the Ring-0
225 * Support Library or not.
227 /** @def IN_SUP_STATIC
228 * Used to indicate that the Support Library is built or used as a static
231 /** @def SUPR0DECL(type)
232 * Support library export or import declaration.
233 * @param type The return type of the function declaration.
236 # ifdef IN_SUP_STATIC
237 # define SUPR0DECL(type) DECLHIDDEN(type) VBOXCALL
239 # define SUPR0DECL(type) DECLEXPORT(type) VBOXCALL
242 # ifdef IN_SUP_STATIC
243 # define SUPR0DECL(type) DECLHIDDEN(type) VBOXCALL
245 # define SUPR0DECL(type) DECLIMPORT(type) VBOXCALL
250 * Used to indicate whether we're inside the same link module as the RC Support
253 /** @def SUPRCDECL(type)
254 * Support library export or import declaration.
255 * @param type The return type of the function declaration.
258 # define SUPRCDECL(type) DECLEXPORT(type) VBOXCALL
260 # define SUPRCDECL(type) DECLIMPORT(type) VBOXCALL
264 * Used to indicate whether we're inside the same link module as the Ring-0
265 * Support Library or not.
267 /** @def SUPR0DECL(type)
268 * Support library export or import declaration.
269 * @param type The return type of the function declaration.
271 #if defined(IN_SUP_R0) || defined(IN_SUP_R3) || defined(IN_SUP_RC)
272 # define SUPDECL(type) DECLEXPORT(type) VBOXCALL
274 # define SUPDECL(type) DECLIMPORT(type) VBOXCALL
280 * Used to indicate whether we're inside the same link module as the USBLib.
283 * USBLIB export or import declaration.
284 * @param type The return type of the function declaration.
287 # define USBLIB_DECL(type) type VBOXCALL
288 #elif defined(IN_USBLIB)
289 # define USBLIB_DECL(type) DECLEXPORT(type) VBOXCALL
291 # define USBLIB_DECL(type) DECLIMPORT(type) VBOXCALL
296 /** @def IN_VMM_STATIC
297 * Used to indicate that the virtual machine monitor is built or used as a
301 * Used to indicate whether we're inside the same link module as the ring 3 part of the
302 * virtual machine monitor or not.
305 * Ring-3 VMM export or import declaration.
306 * @param type The return type of the function declaration.
309 # ifdef IN_VMM_STATIC
310 # define VMMR3DECL(type) DECLHIDDEN(type) VBOXCALL
312 # define VMMR3DECL(type) DECLEXPORT(type) VBOXCALL
314 #elif defined(IN_RING3)
315 # ifdef IN_VMM_STATIC
316 # define VMMR3DECL(type) DECLHIDDEN(type) VBOXCALL
318 # define VMMR3DECL(type) DECLIMPORT(type) VBOXCALL
321 # define VMMR3DECL(type) DECL_INVALID(type)
325 * Used to indicate whether we're inside the same link module as the ring-0 part
326 * of the virtual machine monitor or not.
329 * Ring-0 VMM export or import declaration.
330 * @param type The return type of the function declaration.
333 # define VMMR0DECL(type) DECLEXPORT(type) VBOXCALL
334 #elif defined(IN_RING0)
335 # define VMMR0DECL(type) DECLIMPORT(type) VBOXCALL
337 # define VMMR0DECL(type) DECL_INVALID(type)
341 * Used to indicate whether we're inside the same link module as the raw-mode
342 * context part of the virtual machine monitor or not.
345 * Raw-mode context VMM export or import declaration.
346 * @param type The return type of the function declaration.
349 # define VMMRCDECL(type) DECLEXPORT(type) VBOXCALL
351 # define VMMRCDECL(type) DECLIMPORT(type) VBOXCALL
353 # define VMMRCDECL(type) DECL_INVALID(type)
357 * Ring-0 and Raw-mode context VMM export or import declaration.
358 * @param type The return type of the function declaration.
360 #if defined(IN_VMM_R0) || defined(IN_VMM_RC)
361 # define VMMRZDECL(type) DECLEXPORT(type) VBOXCALL
362 #elif defined(IN_RING0) || defined(IN_RZ)
363 # define VMMRZDECL(type) DECLIMPORT(type) VBOXCALL
365 # define VMMRZDECL(type) DECL_INVALID(type)
369 * VMM export or import declaration.
370 * @param type The return type of the function declaration.
373 # define VMMDECL(type) DECLHIDDEN(type) VBOXCALL
374 #elif defined(IN_VMM_R3) || defined(IN_VMM_R0) || defined(IN_VMM_RC)
375 # define VMMDECL(type) DECLEXPORT(type) VBOXCALL
377 # define VMMDECL(type) DECLIMPORT(type) VBOXCALL
380 /** @def VMM_INT_DECL
381 * VMM internal function.
382 * @param type The return type of the function declaration.
384 #if defined(IN_VMM_R3) || defined(IN_VMM_R0) || defined(IN_VMM_RC)
385 # define VMM_INT_DECL(type) DECLHIDDEN(type) VBOXCALL
387 # define VMM_INT_DECL(type) DECL_INVALID(type)
390 /** @def VMMR3_INT_DECL
391 * VMM internal function, ring-3.
392 * @param type The return type of the function declaration.
395 # define VMMR3_INT_DECL(type) DECLHIDDEN(type) VBOXCALL
397 # define VMMR3_INT_DECL(type) DECL_INVALID(type)
400 /** @def VMMR0_INT_DECL
401 * VMM internal function, ring-0.
402 * @param type The return type of the function declaration.
405 # define VMMR0_INT_DECL(type) DECLHIDDEN(type) VBOXCALL
407 # define VMMR0_INT_DECL(type) DECL_INVALID(type)
410 /** @def VMMRC_INT_DECL
411 * VMM internal function, raw-mode context.
412 * @param type The return type of the function declaration.
415 # define VMMRC_INT_DECL(type) DECLHIDDEN(type) VBOXCALL
417 # define VMMRC_INT_DECL(type) DECL_INVALID(type)
420 /** @def VMMRZ_INT_DECL
421 * VMM internal function, ring-0 + raw-mode context.
422 * @param type The return type of the function declaration.
424 #if defined(IN_VMM_RC) || defined(IN_VMM_R0)
425 # define VMMRZ_INT_DECL(type) DECLHIDDEN(type) VBOXCALL
427 # define VMMRZ_INT_DECL(type) DECL_INVALID(type)
433 * Used to indicate whether we're inside the VBoxDDU shared object.
435 /** @def VBOXDDU_DECL(type)
436 * VBoxDDU export or import (ring-3).
437 * @param type The return type of the function declaration.
440 # ifdef IN_VBOXDDU_STATIC
441 # define VBOXDDU_DECL(type) type
443 # define VBOXDDU_DECL(type) DECLEXPORT(type) VBOXCALL
446 # define VBOXDDU_DECL(type) DECLIMPORT(type) VBOXCALL
452 /** @defgroup grp_devdrv Device Emulations and Drivers