1 | /** @file
|
---|
2 | *
|
---|
3 | * VBoxGuestLib - A support library for VirtualBox guest additions:
|
---|
4 | * Internal header
|
---|
5 | */
|
---|
6 |
|
---|
7 | /*
|
---|
8 | * Copyright (C) 2006-2007 innotek 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 "SysHlp.h"
|
---|
42 |
|
---|
43 | #pragma pack(4)
|
---|
44 |
|
---|
45 | struct _VBGLPHYSHEAPBLOCK;
|
---|
46 | typedef struct _VBGLPHYSHEAPBLOCK VBGLPHYSHEAPBLOCK;
|
---|
47 | struct _VBGLPHYSHEAPCHUNK;
|
---|
48 | typedef struct _VBGLPHYSHEAPCHUNK VBGLPHYSHEAPCHUNK;
|
---|
49 |
|
---|
50 | #ifndef VBGL_VBOXGUEST
|
---|
51 | struct VBGLHGCMHANDLEDATA
|
---|
52 | {
|
---|
53 | uint32_t fAllocated;
|
---|
54 | VBGLDRIVER driver;
|
---|
55 | };
|
---|
56 | #endif
|
---|
57 |
|
---|
58 | enum VbglLibStatus
|
---|
59 | {
|
---|
60 | VbglStatusNotInitialized = 0,
|
---|
61 | VbglStatusInitializing,
|
---|
62 | VbglStatusReady
|
---|
63 | };
|
---|
64 |
|
---|
65 | typedef struct _VBGLDATA
|
---|
66 | {
|
---|
67 | enum VbglLibStatus status;
|
---|
68 |
|
---|
69 | VBGLIOPORT portVMMDev;
|
---|
70 |
|
---|
71 | VMMDevMemory *pVMMDevMemory;
|
---|
72 |
|
---|
73 | /**
|
---|
74 | * Physical memory heap data.
|
---|
75 | * @{
|
---|
76 | */
|
---|
77 |
|
---|
78 | VBGLPHYSHEAPBLOCK *pFreeBlocksHead;
|
---|
79 | VBGLPHYSHEAPBLOCK *pAllocBlocksHead;
|
---|
80 | VBGLPHYSHEAPCHUNK *pChunkHead;
|
---|
81 |
|
---|
82 | RTSEMFASTMUTEX mutexHeap;
|
---|
83 | /** @} */
|
---|
84 |
|
---|
85 | #ifndef VBGL_VBOXGUEST
|
---|
86 | /**
|
---|
87 | * Fast heap for HGCM handles data.
|
---|
88 | * @{
|
---|
89 | */
|
---|
90 |
|
---|
91 | RTSEMFASTMUTEX mutexHGCMHandle;
|
---|
92 |
|
---|
93 | struct VBGLHGCMHANDLEDATA aHGCMHandleData[64];
|
---|
94 |
|
---|
95 | /** @} */
|
---|
96 | #endif
|
---|
97 | } VBGLDATA;
|
---|
98 |
|
---|
99 | #pragma pack()
|
---|
100 |
|
---|
101 | #ifndef VBGL_DECL_DATA
|
---|
102 | extern VBGLDATA g_vbgldata;
|
---|
103 | #endif
|
---|
104 |
|
---|
105 | /* Check if library has been initialized before entering
|
---|
106 | * a public library function.
|
---|
107 | */
|
---|
108 | int VbglEnter (void);
|
---|
109 |
|
---|
110 | #ifdef VBOX_HGCM
|
---|
111 | #ifndef VBGL_VBOXGUEST
|
---|
112 | /* Initialize HGCM subsystem. */
|
---|
113 | int vbglHGCMInit (void);
|
---|
114 | /* Terminate HGCM subsystem. */
|
---|
115 | int vbglHGCMTerminate (void);
|
---|
116 | #endif
|
---|
117 | #endif
|
---|
118 |
|
---|
119 | #endif /* __VBGLINTERNAL__H */
|
---|