VirtualBox

source: vbox/trunk/src/VBox/Additions/common/VBoxGuest/VBoxGuest-haiku.h@ 43363

最後變更 在這個檔案從43363是 43363,由 vboxsync 提交於 13 年 前

Haiku Additions.

  • 屬性 svn:eol-style 設為 native
  • 屬性 svn:keywords 設為 Author Date Id Revision
檔案大小: 10.9 KB
 
1/* $Id: VBoxGuest-haiku.h 43363 2012-09-20 09:56:07Z vboxsync $ */
2/** @file
3 * VBoxGuest kernel module, Haiku Guest Additions, header.
4 */
5
6/*
7 * Copyright (C) 2012 Oracle Corporation
8 *
9 * This file is part of VirtualBox Open Source Edition (OSE), as
10 * available from http://www.alldomusa.eu.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
18/*
19 * This code is based on:
20 *
21 * VirtualBox Guest Additions for Haiku.
22 * Copyright (c) 2011 Mike Smith <[email protected]>
23 * François Revol <[email protected]>
24 *
25 * Permission is hereby granted, free of charge, to any person
26 * obtaining a copy of this software and associated documentation
27 * files (the "Software"), to deal in the Software without
28 * restriction, including without limitation the rights to use,
29 * copy, modify, merge, publish, distribute, sublicense, and/or sell
30 * copies of the Software, and to permit persons to whom the
31 * Software is furnished to do so, subject to the following
32 * conditions:
33 *
34 * The above copyright notice and this permission notice shall be
35 * included in all copies or substantial portions of the Software.
36 *
37 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
38 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
39 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
40 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
41 * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
42 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
43 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
44 * OTHER DEALINGS IN THE SOFTWARE.
45 */
46
47
48#ifndef ___VBoxGuest_haiku_h
49#define ___VBoxGuest_haiku_h
50
51#include <OS.h>
52#include <Drivers.h>
53#include <drivers/module.h>
54
55#include "VBoxGuestInternal.h"
56#include <VBox/log.h>
57#include <iprt/assert.h>
58#include <iprt/initterm.h>
59#include <iprt/process.h>
60#include <iprt/mem.h>
61#include <iprt/asm.h>
62#include <iprt/mp.h>
63#include <iprt/power.h>
64#include <iprt/thread.h>
65
66/** The module name. */
67#define VBOXGUEST_MODULE_NAME "generic/vboxguest"
68
69struct VBoxGuestDeviceState
70{
71 /** Resource ID of the I/O port */
72 int iIOPortResId;
73 /** Pointer to the I/O port resource. */
74// struct resource *pIOPortRes;
75 /** Start address of the IO Port. */
76 uint16_t uIOPortBase;
77 /** Resource ID of the MMIO area */
78 area_id iVMMDevMemAreaId;
79 /** Pointer to the MMIO resource. */
80// struct resource *pVMMDevMemRes;
81 /** Handle of the MMIO resource. */
82// bus_space_handle_t VMMDevMemHandle;
83 /** Size of the memory area. */
84 size_t VMMDevMemSize;
85 /** Mapping of the register space */
86 void *pMMIOBase;
87 /** IRQ number */
88 int iIrqResId;
89 /** IRQ resource handle. */
90// struct resource *pIrqRes;
91 /** Pointer to the IRQ handler. */
92// void *pfnIrqHandler;
93 /** VMMDev version */
94 uint32_t u32Version;
95
96 /** The (only) select data we wait on. */
97 //XXX: should leave in pSession ?
98 uint8_t selectEvent;
99 uint32_t selectRef;
100 void *selectSync;
101};
102
103struct vboxguest_module_info {
104 module_info module;
105
106 VBOXGUESTDEVEXT devExt;
107 struct VBoxGuestDeviceState _sState;
108 volatile uint32_t _cUsers;
109
110 size_t (*_RTLogBackdoorPrintf)(const char *pszFormat, ...);
111 size_t (*_RTLogBackdoorPrintfV)(const char *pszFormat, va_list args);
112 int (*_RTLogSetDefaultInstanceThread)(PRTLOGGER pLogger, uintptr_t uKey);
113 int (*_RTMemAllocExTag)(size_t cb, size_t cbAlignment, uint32_t fFlags, const char *pszTag, void **ppv);
114 void * (*_RTMemContAlloc)(PRTCCPHYS pPhys, size_t cb);
115 void (*_RTMemContFree)(void *pv, size_t cb);
116 void (*_RTMemFreeEx)(void *pv, size_t cb);
117 bool (*_RTMpIsCpuPossible)(RTCPUID idCpu);
118 int (*_RTMpNotificationDeregister)(PFNRTMPNOTIFICATION pfnCallback, void *pvUser);
119 int (*_RTMpNotificationRegister)(PFNRTMPNOTIFICATION pfnCallback, void *pvUser);
120 int (*_RTMpOnAll)(PFNRTMPWORKER pfnWorker, void *pvUser1, void *pvUser2);
121 int (*_RTMpOnOthers)(PFNRTMPWORKER pfnWorker, void *pvUser1, void *pvUser2);
122 int (*_RTMpOnSpecific)(RTCPUID idCpu, PFNRTMPWORKER pfnWorker, void *pvUser1, void *pvUser2);
123 int (*_RTPowerNotificationDeregister)(PFNRTPOWERNOTIFICATION pfnCallback, void *pvUser);
124 int (*_RTPowerNotificationRegister)(PFNRTPOWERNOTIFICATION pfnCallback, void *pvUser);
125 int (*_RTPowerSignalEvent)(RTPOWEREVENT enmEvent);
126 void (*_RTR0AssertPanicSystem)(void);
127 int (*_RTR0Init)(unsigned fReserved);
128 void * (*_RTR0MemObjAddress)(RTR0MEMOBJ MemObj);
129 RTR3PTR (*_RTR0MemObjAddressR3)(RTR0MEMOBJ MemObj);
130 int (*_RTR0MemObjAllocContTag)(PRTR0MEMOBJ pMemObj, size_t cb, bool fExecutable, const char *pszTag);
131 int (*_RTR0MemObjAllocLowTag)(PRTR0MEMOBJ pMemObj, size_t cb, bool fExecutable, const char *pszTag);
132 int (*_RTR0MemObjAllocPageTag)(PRTR0MEMOBJ pMemObj, size_t cb, bool fExecutable, const char *pszTag);
133 int (*_RTR0MemObjAllocPhysExTag)(PRTR0MEMOBJ pMemObj, size_t cb, RTHCPHYS PhysHighest, size_t uAlignment, const char *pszTag);
134 int (*_RTR0MemObjAllocPhysNCTag)(PRTR0MEMOBJ pMemObj, size_t cb, RTHCPHYS PhysHighest, const char *pszTag);
135 int (*_RTR0MemObjAllocPhysTag)(PRTR0MEMOBJ pMemObj, size_t cb, RTHCPHYS PhysHighest, const char *pszTag);
136 int (*_RTR0MemObjEnterPhysTag)(PRTR0MEMOBJ pMemObj, RTHCPHYS Phys, size_t cb, uint32_t uCachePolicy, const char *pszTag);
137 int (*_RTR0MemObjFree)(RTR0MEMOBJ MemObj, bool fFreeMappings);
138 RTHCPHYS (*_RTR0MemObjGetPagePhysAddr)(RTR0MEMOBJ MemObj, size_t iPage);
139 bool (*_RTR0MemObjIsMapping)(RTR0MEMOBJ MemObj);
140 int (*_RTR0MemObjLockKernelTag)(PRTR0MEMOBJ pMemObj, void *pv, size_t cb, uint32_t fAccess, const char *pszTag);
141 int (*_RTR0MemObjLockUserTag)(PRTR0MEMOBJ pMemObj, RTR3PTR R3Ptr, size_t cb, uint32_t fAccess,
142 RTR0PROCESS R0Process, const char *pszTag);
143 int (*_RTR0MemObjMapKernelExTag)(PRTR0MEMOBJ pMemObj, RTR0MEMOBJ MemObjToMap, void *pvFixed, size_t uAlignment,
144 unsigned fProt, size_t offSub, size_t cbSub, const char *pszTag);
145 int (*_RTR0MemObjMapKernelTag)(PRTR0MEMOBJ pMemObj, RTR0MEMOBJ MemObjToMap, void *pvFixed,
146 size_t uAlignment, unsigned fProt, const char *pszTag);
147 int (*_RTR0MemObjMapUserTag)(PRTR0MEMOBJ pMemObj, RTR0MEMOBJ MemObjToMap, RTR3PTR R3PtrFixed,
148 size_t uAlignment, unsigned fProt, RTR0PROCESS R0Process, const char *pszTag);
149 int (*_RTR0MemObjProtect)(RTR0MEMOBJ hMemObj, size_t offSub, size_t cbSub, uint32_t fProt);
150 int (*_RTR0MemObjReserveKernelTag)(PRTR0MEMOBJ pMemObj, void *pvFixed, size_t cb, size_t uAlignment, const char *pszTag);
151 int (*_RTR0MemObjReserveUserTag)(PRTR0MEMOBJ pMemObj, RTR3PTR R3PtrFixed, size_t cb, size_t uAlignment,
152 RTR0PROCESS R0Process, const char *pszTag);
153 size_t (*_RTR0MemObjSize)(RTR0MEMOBJ MemObj);
154 RTR0PROCESS (*_RTR0ProcHandleSelf)(void);
155 void (*_RTR0Term)(void);
156 void (*_RTR0TermForced)(void);
157 RTPROCESS (*_RTProcSelf)(void);
158 uint32_t (*_RTSemEventGetResolution)(void);
159 uint32_t (*_RTSemEventMultiGetResolution)(void);
160 int (*_RTSemEventMultiWaitEx)(RTSEMEVENTMULTI hEventMultiSem, uint32_t fFlags, uint64_t uTimeout);
161 int (*_RTSemEventMultiWaitExDebug)(RTSEMEVENTMULTI hEventMultiSem, uint32_t fFlags, uint64_t uTimeout,
162 RTHCUINTPTR uId, RT_SRC_POS_DECL);
163 int (*_RTSemEventWaitEx)(RTSEMEVENT hEventSem, uint32_t fFlags, uint64_t uTimeout);
164 int (*_RTSemEventWaitExDebug)(RTSEMEVENT hEventSem, uint32_t fFlags, uint64_t uTimeout,
165 RTHCUINTPTR uId, RT_SRC_POS_DECL);
166 bool (*_RTThreadIsInInterrupt)(RTTHREAD hThread);
167 void (*_RTThreadPreemptDisable)(PRTTHREADPREEMPTSTATE pState);
168 bool (*_RTThreadPreemptIsEnabled)(RTTHREAD hThread);
169 bool (*_RTThreadPreemptIsPending)(RTTHREAD hThread);
170 bool (*_RTThreadPreemptIsPendingTrusty)(void);
171 bool (*_RTThreadPreemptIsPossible)(void);
172 void (*_RTThreadPreemptRestore)(PRTTHREADPREEMPTSTATE pState);
173 uint32_t (*_RTTimerGetSystemGranularity)(void);
174 int (*_RTTimerReleaseSystemGranularity)(uint32_t u32Granted);
175 int (*_RTTimerRequestSystemGranularity)(uint32_t u32Request, uint32_t *pu32Granted);
176 void (*_RTSpinlockAcquire)(RTSPINLOCK Spinlock);
177 void (*_RTSpinlockRelease)(RTSPINLOCK Spinlock);
178 void (*_RTSpinlockReleaseNoInts)(RTSPINLOCK Spinlock);
179 void * (*_RTMemTmpAllocTag)(size_t cb, const char *pszTag);
180 void (*_RTMemTmpFree)(void *pv);
181 PRTLOGGER (*_RTLogDefaultInstance)(void);
182 PRTLOGGER (*_RTLogRelDefaultInstance)(void);
183 int (*_RTErrConvertToErrno)(int iErr);
184 int (*_VBoxGuestCommonIOCtl)(unsigned iFunction, PVBOXGUESTDEVEXT pDevExt, PVBOXGUESTSESSION pSession,
185 void *pvData, size_t cbData, size_t *pcbDataReturned);
186 int (*_VBoxGuestCreateUserSession)(PVBOXGUESTDEVEXT pDevExt, PVBOXGUESTSESSION *ppSession);
187 void (*_VBoxGuestCloseSession)(PVBOXGUESTDEVEXT pDevExt, PVBOXGUESTSESSION pSession);
188 void * (*_VBoxGuestIDCOpen)(uint32_t *pu32Version);
189 int (*_VBoxGuestIDCClose)(void *pvSession);
190 int (*_VBoxGuestIDCCall)(void *pvSession, unsigned iCmd, void *pvData, size_t cbData, size_t *pcbDataReturned);
191 void (*_RTAssertMsg1Weak)(const char *pszExpr, unsigned uLine, const char *pszFile, const char *pszFunction);
192 void (*_RTAssertMsg2Weak)(const char *pszFormat, ...);
193 void (*_RTAssertMsg2WeakV)(const char *pszFormat, va_list va);
194 bool (*_RTAssertShouldPanic)(void);
195 int (*_RTSemFastMutexCreate)(PRTSEMFASTMUTEX phFastMtx);
196 int (*_RTSemFastMutexDestroy)(RTSEMFASTMUTEX hFastMtx);
197 int (*_RTSemFastMutexRelease)(RTSEMFASTMUTEX hFastMtx);
198 int (*_RTSemFastMutexRequest)(RTSEMFASTMUTEX hFastMtx);
199 int (*_RTSemMutexCreate)(PRTSEMMUTEX phFastMtx);
200 int (*_RTSemMutexDestroy)(RTSEMMUTEX hFastMtx);
201 int (*_RTSemMutexRelease)(RTSEMMUTEX hFastMtx);
202 int (*_RTSemMutexRequest)(RTSEMMUTEX hFastMtx, RTMSINTERVAL cMillies);
203 int (*_RTHeapSimpleRelocate)(RTHEAPSIMPLE hHeap, uintptr_t offDelta);
204 int (*_RTHeapOffsetInit)(PRTHEAPOFFSET phHeap, void *pvMemory, size_t cbMemory);
205 int (*_RTHeapSimpleInit)(PRTHEAPSIMPLE pHeap, void *pvMemory, size_t cbMemory);
206 void * (*_RTHeapOffsetAlloc)(RTHEAPOFFSET hHeap, size_t cb, size_t cbAlignment);
207 void * (*_RTHeapSimpleAlloc)(RTHEAPSIMPLE Heap, size_t cb, size_t cbAlignment);
208 void (*_RTHeapOffsetFree)(RTHEAPOFFSET hHeap, void *pv);
209 void (*_RTHeapSimpleFree)(RTHEAPSIMPLE Heap, void *pv);
210};
211
212
213#ifdef IN_VBOXGUEST
214#define g_DevExt (g_VBoxGuest.devExt)
215#define cUsers (g_VBoxGuest._cUsers)
216#define sState (g_VBoxGuest._sState)
217#else
218#define g_DevExt (g_VBoxGuest->devExt)
219#define cUsers (g_VBoxGuest->_cUsers)
220#define sState (g_VBoxGuest->_sState)
221extern struct vboxguest_module_info *g_VBoxGuest;
222#endif
223
224#endif
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

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