1 | /** @file
|
---|
2 | *
|
---|
3 | * VBoxGuestLib - A support library for VirtualBox guest additions:
|
---|
4 | * Internal header
|
---|
5 | */
|
---|
6 |
|
---|
7 | /*
|
---|
8 | * Copyright (C) 2006-2007 Sun Microsystems, Inc.
|
---|
9 | *
|
---|
10 | * This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
11 | * available from http://www.virtualbox.org. This file is free software;
|
---|
12 | * you can redistribute it and/or modify it under the terms of the GNU
|
---|
13 | * General Public License (GPL) as published by the Free Software
|
---|
14 | * Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
15 | * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
16 | * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
17 | *
|
---|
18 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
|
---|
19 | * Clara, CA 95054 USA or visit http://www.sun.com if you need
|
---|
20 | * additional information or have any questions.
|
---|
21 | */
|
---|
22 |
|
---|
23 | #ifndef __VBGLINTERNAL__H
|
---|
24 | #define __VBGLINTERNAL__H
|
---|
25 |
|
---|
26 | /* I have added this include here as
|
---|
27 | a) This file is always included before VBGLInternal and
|
---|
28 | b) It contains a definition for VBGLHGCMHANDLE, so we definitely do not
|
---|
29 | need to redefine that here. The C (without ++) compiler was complaining
|
---|
30 | that it was defined twice.
|
---|
31 | */
|
---|
32 | #include <VBox/VBoxGuestLib.h>
|
---|
33 |
|
---|
34 | #include <VBox/log.h>
|
---|
35 |
|
---|
36 | #if (defined(DEBUG) && !defined(NO_LOGGING)) || defined(LOG_ENABLED)
|
---|
37 | # define dprintf(a) RTLogBackdoorPrintf a
|
---|
38 | #else
|
---|
39 | # define dprintf(a) do {} while (0)
|
---|
40 | #endif
|
---|
41 |
|
---|
42 | #include "SysHlp.h"
|
---|
43 |
|
---|
44 | #pragma pack(4)
|
---|
45 |
|
---|
46 | struct _VBGLPHYSHEAPBLOCK;
|
---|
47 | typedef struct _VBGLPHYSHEAPBLOCK VBGLPHYSHEAPBLOCK;
|
---|
48 | struct _VBGLPHYSHEAPCHUNK;
|
---|
49 | typedef struct _VBGLPHYSHEAPCHUNK VBGLPHYSHEAPCHUNK;
|
---|
50 |
|
---|
51 | #ifndef VBGL_VBOXGUEST
|
---|
52 | struct VBGLHGCMHANDLEDATA
|
---|
53 | {
|
---|
54 | uint32_t fAllocated;
|
---|
55 | VBGLDRIVER driver;
|
---|
56 | };
|
---|
57 | #endif
|
---|
58 |
|
---|
59 | enum VbglLibStatus
|
---|
60 | {
|
---|
61 | VbglStatusNotInitialized = 0,
|
---|
62 | VbglStatusInitializing,
|
---|
63 | VbglStatusReady
|
---|
64 | };
|
---|
65 |
|
---|
66 | typedef struct _VBGLDATA
|
---|
67 | {
|
---|
68 | enum VbglLibStatus status;
|
---|
69 |
|
---|
70 | VBGLIOPORT portVMMDev;
|
---|
71 |
|
---|
72 | VMMDevMemory *pVMMDevMemory;
|
---|
73 |
|
---|
74 | /**
|
---|
75 | * Physical memory heap data.
|
---|
76 | * @{
|
---|
77 | */
|
---|
78 |
|
---|
79 | VBGLPHYSHEAPBLOCK *pFreeBlocksHead;
|
---|
80 | VBGLPHYSHEAPBLOCK *pAllocBlocksHead;
|
---|
81 | VBGLPHYSHEAPCHUNK *pChunkHead;
|
---|
82 |
|
---|
83 | RTSEMFASTMUTEX mutexHeap;
|
---|
84 | /** @} */
|
---|
85 |
|
---|
86 | #ifndef VBGL_VBOXGUEST
|
---|
87 | /**
|
---|
88 | * Fast heap for HGCM handles data.
|
---|
89 | * @{
|
---|
90 | */
|
---|
91 |
|
---|
92 | RTSEMFASTMUTEX mutexHGCMHandle;
|
---|
93 |
|
---|
94 | struct VBGLHGCMHANDLEDATA aHGCMHandleData[64];
|
---|
95 |
|
---|
96 | /** @} */
|
---|
97 | #endif
|
---|
98 | } VBGLDATA;
|
---|
99 |
|
---|
100 | #pragma pack()
|
---|
101 |
|
---|
102 | #ifndef VBGL_DECL_DATA
|
---|
103 | extern VBGLDATA g_vbgldata;
|
---|
104 | #endif
|
---|
105 |
|
---|
106 | /* Check if library has been initialized before entering
|
---|
107 | * a public library function.
|
---|
108 | */
|
---|
109 | int VbglEnter (void);
|
---|
110 |
|
---|
111 | #ifdef VBOX_WITH_HGCM
|
---|
112 | #ifndef VBGL_VBOXGUEST
|
---|
113 | /* Initialize HGCM subsystem. */
|
---|
114 | int vbglHGCMInit (void);
|
---|
115 | /* Terminate HGCM subsystem. */
|
---|
116 | int vbglHGCMTerminate (void);
|
---|
117 | #endif
|
---|
118 | #endif
|
---|
119 |
|
---|
120 | #endif /* __VBGLINTERNAL__H */
|
---|