1 | /** @file
|
---|
2 | *
|
---|
3 | * VBoxGuestLib - A support library for VirtualBox guest additions:
|
---|
4 | * Internal header
|
---|
5 | */
|
---|
6 |
|
---|
7 | /*
|
---|
8 | * Copyright (C) 2006 InnoTek Systemberatung GmbH
|
---|
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 as published by the Free Software Foundation,
|
---|
14 | * in version 2 as it comes in the "COPYING" file of the VirtualBox OSE
|
---|
15 | * distribution. VirtualBox OSE is distributed in the hope that it will
|
---|
16 | * be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
17 | *
|
---|
18 | * If you received this file as part of a commercial VirtualBox
|
---|
19 | * distribution, then only the terms of your commercial VirtualBox
|
---|
20 | * license agreement apply instead of the previous paragraph.
|
---|
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 | #if (defined(DEBUG) && !defined(NO_LOGGING)) || defined(LOG_ENABLED)
|
---|
35 | #include <VBox/log.h>
|
---|
36 | # define dprintf(a) RTLogBackdoorPrintf a
|
---|
37 | #else
|
---|
38 | # define dprintf(a) do {} while (0)
|
---|
39 | #endif
|
---|
40 |
|
---|
41 | #include "PhysHeap.h"
|
---|
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_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 */
|
---|