VirtualBox

source: vbox/trunk/src/VBox/Additions/common/VBoxGuestLib/VBGLInternal.h@ 28112

Last change on this file since 28112 was 26425, checked in by vboxsync, 15 years ago

alternative license for VBoxGuestLib is CDDL

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 3.4 KB
Line 
1/* $Revision: 26425 $ */
2/** @file
3 * VBoxGuestLibR0 - Internal header.
4 */
5
6/*
7 * Copyright (C) 2006-2007 Sun Microsystems, Inc.
8 *
9 * This file is part of VirtualBox Open Source Edition (OSE), as
10 * available from http://www.virtualbox.org. This file is free software;
11 * you can redistribute it and/or modify it under the terms of the GNU
12 * General Public License (GPL) as published by the Free Software
13 * Foundation, in version 2 as it comes in the "COPYING" file of the
14 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
15 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
16 *
17 * The contents of this file may alternatively be used under the terms
18 * of the Common Development and Distribution License Version 1.0
19 * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
20 * VirtualBox OSE distribution, in which case the provisions of the
21 * CDDL are applicable instead of those of the GPL.
22 *
23 * You may elect to license modified versions of this file under the
24 * terms and conditions of either the GPL or the CDDL or both.
25 *
26 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
27 * Clara, CA 95054 USA or visit http://www.sun.com if you need
28 * additional information or have any questions.
29 */
30
31#ifndef ___VBoxGuestLib_VBGLInternal_h
32#define ___VBoxGuestLib_VBGLInternal_h
33
34#include <VBox/VMMDev.h>
35#include <VBox/VBoxGuest.h>
36#include <VBox/VBoxGuestLib.h>
37
38#include <VBox/log.h>
39
40
41#ifdef RT_OS_WINDOWS /** @todo dprintf() -> Log() */
42#if (defined(DEBUG) && !defined(NO_LOGGING)) || defined(LOG_ENABLED)
43# define dprintf(a) RTLogBackdoorPrintf a
44#else
45# define dprintf(a) do {} while (0)
46#endif
47#else
48# define dprintf(a) Log(a)
49#endif
50
51#include "SysHlp.h"
52
53#pragma pack(4) /** @todo r=bird: What do we need packing for here? None of these structures are shared between drivers AFAIK. */
54
55struct _VBGLPHYSHEAPBLOCK;
56typedef struct _VBGLPHYSHEAPBLOCK VBGLPHYSHEAPBLOCK;
57struct _VBGLPHYSHEAPCHUNK;
58typedef struct _VBGLPHYSHEAPCHUNK VBGLPHYSHEAPCHUNK;
59
60#ifndef VBGL_VBOXGUEST
61struct VBGLHGCMHANDLEDATA
62{
63 uint32_t fAllocated;
64 VBGLDRIVER driver;
65};
66#endif
67
68enum VbglLibStatus
69{
70 VbglStatusNotInitialized = 0,
71 VbglStatusInitializing,
72 VbglStatusReady
73};
74
75/**
76 * Global VBGL ring-0 data.
77 * Lives in VbglR0Init.cpp.
78 */
79typedef struct _VBGLDATA
80{
81 enum VbglLibStatus status;
82
83 VBGLIOPORT portVMMDev;
84
85 VMMDevMemory *pVMMDevMemory;
86
87 /**
88 * Physical memory heap data.
89 * @{
90 */
91
92 VBGLPHYSHEAPBLOCK *pFreeBlocksHead;
93 VBGLPHYSHEAPBLOCK *pAllocBlocksHead;
94 VBGLPHYSHEAPCHUNK *pChunkHead;
95
96 RTSEMFASTMUTEX mutexHeap;
97 /** @} */
98
99 /**
100 * The host version data.
101 */
102 VMMDevReqHostVersion hostVersion;
103
104
105#ifndef VBGL_VBOXGUEST
106 /**
107 * Fast heap for HGCM handles data.
108 * @{
109 */
110
111 RTSEMFASTMUTEX mutexHGCMHandle;
112
113 struct VBGLHGCMHANDLEDATA aHGCMHandleData[64];
114
115 /** @} */
116#endif
117} VBGLDATA;
118
119
120#pragma pack()
121
122#ifndef VBGL_DECL_DATA
123extern VBGLDATA g_vbgldata;
124#endif
125
126/**
127 * Internal macro for checking whether we can pass phyical page lists to the
128 * host.
129 *
130 * ASSUMES that vbglR0Enter has been called already.
131 */
132#define VBGLR0_CAN_USE_PHYS_PAGE_LIST() \
133 ( !!(g_vbgldata.hostVersion.features & VMMDEV_HVF_HGCM_PHYS_PAGE_LIST) )
134
135int vbglR0Enter (void);
136
137#ifdef VBOX_WITH_HGCM
138# ifndef VBGL_VBOXGUEST
139int vbglR0HGCMInit (void);
140int vbglR0HGCMTerminate (void);
141# endif
142#endif /* VBOX_WITH_HGCM */
143
144#endif /* !___VBoxGuestLib_VBGLInternal_h */
145
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette