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 | #if (defined(DEBUG) && !defined(NO_LOGGING)) || defined(LOG_ENABLED)
|
---|
27 | #include <VBox/log.h>
|
---|
28 | # define dprintf(a) RTLogBackdoorPrintf a
|
---|
29 | #else
|
---|
30 | # define dprintf(a) do {} while (0)
|
---|
31 | #endif
|
---|
32 |
|
---|
33 | #include "PhysHeap.h"
|
---|
34 | #include "SysHlp.h"
|
---|
35 |
|
---|
36 | #pragma pack(4)
|
---|
37 |
|
---|
38 | struct _VBGLPHYSHEAPBLOCK;
|
---|
39 | typedef struct _VBGLPHYSHEAPBLOCK VBGLPHYSHEAPBLOCK;
|
---|
40 | struct _VBGLPHYSHEAPCHUNK;
|
---|
41 | typedef struct _VBGLPHYSHEAPCHUNK VBGLPHYSHEAPCHUNK;
|
---|
42 |
|
---|
43 | #ifndef VBGL_VBOXGUEST
|
---|
44 | struct VBGLHGCMHANDLEDATA
|
---|
45 | {
|
---|
46 | uint32_t fAllocated;
|
---|
47 | VBGLDRIVER driver;
|
---|
48 | };
|
---|
49 |
|
---|
50 | typedef struct VBGLHGCMHANDLEDATA *VBGLHGCMHANDLE;
|
---|
51 | #endif
|
---|
52 |
|
---|
53 | enum VbglLibStatus
|
---|
54 | {
|
---|
55 | VbglStatusNotInitialized = 0,
|
---|
56 | VbglStatusInitializing,
|
---|
57 | VbglStatusReady
|
---|
58 | };
|
---|
59 |
|
---|
60 | typedef struct _VBGLDATA
|
---|
61 | {
|
---|
62 | VbglLibStatus status;
|
---|
63 |
|
---|
64 | VBGLIOPORT portVMMDev;
|
---|
65 |
|
---|
66 | VMMDevMemory *pVMMDevMemory;
|
---|
67 |
|
---|
68 | /**
|
---|
69 | * Physical memory heap data.
|
---|
70 | * @{
|
---|
71 | */
|
---|
72 |
|
---|
73 | VBGLPHYSHEAPBLOCK *pFreeBlocksHead;
|
---|
74 | VBGLPHYSHEAPBLOCK *pAllocBlocksHead;
|
---|
75 | VBGLPHYSHEAPCHUNK *pChunkHead;
|
---|
76 |
|
---|
77 | RTSEMFASTMUTEX mutexHeap;
|
---|
78 | /** @} */
|
---|
79 |
|
---|
80 | #ifndef VBGL_VBOXGUEST
|
---|
81 | /**
|
---|
82 | * Fast heap for HGCM handles data.
|
---|
83 | * @{
|
---|
84 | */
|
---|
85 |
|
---|
86 | RTSEMFASTMUTEX mutexHGCMHandle;
|
---|
87 |
|
---|
88 | struct VBGLHGCMHANDLEDATA aHGCMHandleData[64];
|
---|
89 |
|
---|
90 | /** @} */
|
---|
91 | #endif
|
---|
92 | } VBGLDATA;
|
---|
93 |
|
---|
94 | #pragma pack()
|
---|
95 |
|
---|
96 | #ifndef VBGL_DECL_DATA
|
---|
97 | extern VBGLDATA g_vbgldata;
|
---|
98 | #endif
|
---|
99 |
|
---|
100 | /* Check if library has been initialized before entering
|
---|
101 | * a public library function.
|
---|
102 | */
|
---|
103 | int VbglEnter (void);
|
---|
104 |
|
---|
105 | #ifdef VBOX_HGCM
|
---|
106 | #ifndef VBGL_VBOXGUEST
|
---|
107 | /* Initialize HGCM subsystem. */
|
---|
108 | int vbglHGCMInit (void);
|
---|
109 | /* Terminate HGCM subsystem. */
|
---|
110 | int vbglHGCMTerminate (void);
|
---|
111 | #endif
|
---|
112 | #endif
|
---|
113 |
|
---|
114 | #endif /* __VBGLINTERNAL__H */
|
---|