Changeset 43366 in vbox
- Timestamp:
- Sep 20, 2012 12:31:54 PM (12 years ago)
- Location:
- trunk/src/VBox
- Files:
-
- 17 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/common/VBoxGuest/VBoxGuest-haiku-stubs.c
r43363 r43366 64 64 #include <iprt/thread.h> 65 65 66 // >>> file('/tmp/stubs.c', 'w').writelines([re.sub(r'^(?P<returntype>[^(]+) \(\*_(?P<functionname>[A-Za-z0-9_]+)\)\((?P<params>[^)]+)\);', lambda m: '%s %s(%s) {\n\t%sg_VBoxGuest->_%s(%s);\n}\n' % (m.group(1), m.group(2), m.group(3), ('return ' if m.group(1) != 'void' else ''), m.group(2), (', '.join(a.split(' ')[-1].replace('*', '') for a in m.group(3).split(',')) if m.group(3) != 'void' else '')), f) for f in functions])66 // >>> file('/tmp/stubs.c', 'w').writelines([re.sub(r'^(?P<returntype>[^(]+) \(\*_(?P<functionname>[A-Za-z0-9_]+)\)\((?P<params>[^)]+)\);', lambda m: '%s %s(%s)\n{\n %sg_VBoxGuest->_%s(%s);\n}\n' % (m.group(1), m.group(2), m.group(3), ('return ' if m.group(1) != 'void' else ''), m.group(2), (', '.join(a.split(' ')[-1].replace('*', '') for a in m.group(3).split(',')) if m.group(3) != 'void' else '')), f) for f in functions]) 67 67 68 68 struct vboxguest_module_info *g_VBoxGuest; 69 69 70 size_t RTLogBackdoorPrintf(const char *pszFormat, ...) { 70 size_t RTLogBackdoorPrintf(const char *pszFormat, ...) 71 { 71 72 va_list args; 72 73 size_t cb; … … 78 79 return cb; 79 80 } 80 size_t RTLogBackdoorPrintfV(const char *pszFormat, va_list args) { 81 size_t RTLogBackdoorPrintfV(const char *pszFormat, va_list args) 82 { 81 83 return g_VBoxGuest->_RTLogBackdoorPrintfV(pszFormat, args); 82 84 } 83 int RTLogSetDefaultInstanceThread(PRTLOGGER pLogger, uintptr_t uKey) { 85 int RTLogSetDefaultInstanceThread(PRTLOGGER pLogger, uintptr_t uKey) 86 { 84 87 return g_VBoxGuest->_RTLogSetDefaultInstanceThread(pLogger, uKey); 85 88 } 86 int RTMemAllocExTag(size_t cb, size_t cbAlignment, uint32_t fFlags, const char *pszTag, void **ppv) { 89 int RTMemAllocExTag(size_t cb, size_t cbAlignment, uint32_t fFlags, const char *pszTag, void **ppv) 90 { 87 91 return g_VBoxGuest->_RTMemAllocExTag(cb, cbAlignment, fFlags, pszTag, ppv); 88 92 } 89 void * RTMemContAlloc(PRTCCPHYS pPhys, size_t cb) { 93 void* RTMemContAlloc(PRTCCPHYS pPhys, size_t cb) 94 { 90 95 return g_VBoxGuest->_RTMemContAlloc(pPhys, cb); 91 96 } 92 void RTMemContFree(void *pv, size_t cb) { 97 void RTMemContFree(void *pv, size_t cb) 98 { 93 99 g_VBoxGuest->_RTMemContFree(pv, cb); 94 100 } 95 void RTMemFreeEx(void *pv, size_t cb) { 101 void RTMemFreeEx(void *pv, size_t cb) 102 { 96 103 g_VBoxGuest->_RTMemFreeEx(pv, cb); 97 104 } 98 bool RTMpIsCpuPossible(RTCPUID idCpu) { 105 bool RTMpIsCpuPossible(RTCPUID idCpu) 106 { 99 107 return g_VBoxGuest->_RTMpIsCpuPossible(idCpu); 100 108 } 101 int RTMpNotificationDeregister(PFNRTMPNOTIFICATION pfnCallback, void *pvUser) { 109 int RTMpNotificationDeregister(PFNRTMPNOTIFICATION pfnCallback, void *pvUser) 110 { 102 111 return g_VBoxGuest->_RTMpNotificationDeregister(pfnCallback, pvUser); 103 112 } 104 int RTMpNotificationRegister(PFNRTMPNOTIFICATION pfnCallback, void *pvUser) { 113 int RTMpNotificationRegister(PFNRTMPNOTIFICATION pfnCallback, void *pvUser) 114 { 105 115 return g_VBoxGuest->_RTMpNotificationRegister(pfnCallback, pvUser); 106 116 } 107 int RTMpOnAll(PFNRTMPWORKER pfnWorker, void *pvUser1, void *pvUser2) { 117 int RTMpOnAll(PFNRTMPWORKER pfnWorker, void *pvUser1, void *pvUser2) 118 { 108 119 return g_VBoxGuest->_RTMpOnAll(pfnWorker, pvUser1, pvUser2); 109 120 } 110 int RTMpOnOthers(PFNRTMPWORKER pfnWorker, void *pvUser1, void *pvUser2) { 121 int RTMpOnOthers(PFNRTMPWORKER pfnWorker, void *pvUser1, void *pvUser2) 122 { 111 123 return g_VBoxGuest->_RTMpOnOthers(pfnWorker, pvUser1, pvUser2); 112 124 } 113 int RTMpOnSpecific(RTCPUID idCpu, PFNRTMPWORKER pfnWorker, void *pvUser1, void *pvUser2) { 125 int RTMpOnSpecific(RTCPUID idCpu, PFNRTMPWORKER pfnWorker, void *pvUser1, void *pvUser2) 126 { 114 127 return g_VBoxGuest->_RTMpOnSpecific(idCpu, pfnWorker, pvUser1, pvUser2); 115 128 } 116 int RTPowerNotificationDeregister(PFNRTPOWERNOTIFICATION pfnCallback, void *pvUser) { 129 int RTPowerNotificationDeregister(PFNRTPOWERNOTIFICATION pfnCallback, void *pvUser) 130 { 117 131 return g_VBoxGuest->_RTPowerNotificationDeregister(pfnCallback, pvUser); 118 132 } 119 int RTPowerNotificationRegister(PFNRTPOWERNOTIFICATION pfnCallback, void *pvUser) { 133 int RTPowerNotificationRegister(PFNRTPOWERNOTIFICATION pfnCallback, void *pvUser) 134 { 120 135 return g_VBoxGuest->_RTPowerNotificationRegister(pfnCallback, pvUser); 121 136 } 122 int RTPowerSignalEvent(RTPOWEREVENT enmEvent) { 137 int RTPowerSignalEvent(RTPOWEREVENT enmEvent) 138 { 123 139 return g_VBoxGuest->_RTPowerSignalEvent(enmEvent); 124 140 } 125 void RTR0AssertPanicSystem(void) { 141 void RTR0AssertPanicSystem(void) 142 { 126 143 g_VBoxGuest->_RTR0AssertPanicSystem(); 127 144 } 128 int RTR0Init(unsigned fReserved) { 145 int RTR0Init(unsigned fReserved) 146 { 129 147 return g_VBoxGuest->_RTR0Init(fReserved); 130 148 } 131 void * RTR0MemObjAddress(RTR0MEMOBJ MemObj) { 149 void* RTR0MemObjAddress(RTR0MEMOBJ MemObj) 150 { 132 151 return g_VBoxGuest->_RTR0MemObjAddress(MemObj); 133 152 } 134 RTR3PTR RTR0MemObjAddressR3(RTR0MEMOBJ MemObj) { 153 RTR3PTR RTR0MemObjAddressR3(RTR0MEMOBJ MemObj) 154 { 135 155 return g_VBoxGuest->_RTR0MemObjAddressR3(MemObj); 136 156 } 137 int RTR0MemObjAllocContTag(PRTR0MEMOBJ pMemObj, size_t cb, bool fExecutable, const char *pszTag) { 157 int RTR0MemObjAllocContTag(PRTR0MEMOBJ pMemObj, size_t cb, bool fExecutable, const char *pszTag) 158 { 138 159 return g_VBoxGuest->_RTR0MemObjAllocContTag(pMemObj, cb, fExecutable, pszTag); 139 160 } 140 int RTR0MemObjAllocLowTag(PRTR0MEMOBJ pMemObj, size_t cb, bool fExecutable, const char *pszTag) { 161 int RTR0MemObjAllocLowTag(PRTR0MEMOBJ pMemObj, size_t cb, bool fExecutable, const char *pszTag) 162 { 141 163 return g_VBoxGuest->_RTR0MemObjAllocLowTag(pMemObj, cb, fExecutable, pszTag); 142 164 } 143 int RTR0MemObjAllocPageTag(PRTR0MEMOBJ pMemObj, size_t cb, bool fExecutable, const char *pszTag) { 165 int RTR0MemObjAllocPageTag(PRTR0MEMOBJ pMemObj, size_t cb, bool fExecutable, const char *pszTag) 166 { 144 167 return g_VBoxGuest->_RTR0MemObjAllocPageTag(pMemObj, cb, fExecutable, pszTag); 145 168 } 146 int RTR0MemObjAllocPhysExTag(PRTR0MEMOBJ pMemObj, size_t cb, RTHCPHYS PhysHighest, size_t uAlignment, const char *pszTag) { 169 int RTR0MemObjAllocPhysExTag(PRTR0MEMOBJ pMemObj, size_t cb, RTHCPHYS PhysHighest, size_t uAlignment, const char *pszTag) 170 { 147 171 return g_VBoxGuest->_RTR0MemObjAllocPhysExTag(pMemObj, cb, PhysHighest, uAlignment, pszTag); 148 172 } 149 int RTR0MemObjAllocPhysNCTag(PRTR0MEMOBJ pMemObj, size_t cb, RTHCPHYS PhysHighest, const char *pszTag) { 173 int RTR0MemObjAllocPhysNCTag(PRTR0MEMOBJ pMemObj, size_t cb, RTHCPHYS PhysHighest, const char *pszTag) 174 { 150 175 return g_VBoxGuest->_RTR0MemObjAllocPhysNCTag(pMemObj, cb, PhysHighest, pszTag); 151 176 } 152 int RTR0MemObjAllocPhysTag(PRTR0MEMOBJ pMemObj, size_t cb, RTHCPHYS PhysHighest, const char *pszTag) { 177 int RTR0MemObjAllocPhysTag(PRTR0MEMOBJ pMemObj, size_t cb, RTHCPHYS PhysHighest, const char *pszTag) 178 { 153 179 return g_VBoxGuest->_RTR0MemObjAllocPhysTag(pMemObj, cb, PhysHighest, pszTag); 154 180 } 155 int RTR0MemObjEnterPhysTag(PRTR0MEMOBJ pMemObj, RTHCPHYS Phys, size_t cb, uint32_t uCachePolicy, const char *pszTag) { 181 int RTR0MemObjEnterPhysTag(PRTR0MEMOBJ pMemObj, RTHCPHYS Phys, size_t cb, uint32_t uCachePolicy, const char *pszTag) 182 { 156 183 return g_VBoxGuest->_RTR0MemObjEnterPhysTag(pMemObj, Phys, cb, uCachePolicy, pszTag); 157 184 } 158 int RTR0MemObjFree(RTR0MEMOBJ MemObj, bool fFreeMappings) { 185 int RTR0MemObjFree(RTR0MEMOBJ MemObj, bool fFreeMappings) 186 { 159 187 return g_VBoxGuest->_RTR0MemObjFree(MemObj, fFreeMappings); 160 188 } 161 RTHCPHYS RTR0MemObjGetPagePhysAddr(RTR0MEMOBJ MemObj, size_t iPage) { 189 RTHCPHYS RTR0MemObjGetPagePhysAddr(RTR0MEMOBJ MemObj, size_t iPage) 190 { 162 191 return g_VBoxGuest->_RTR0MemObjGetPagePhysAddr(MemObj, iPage); 163 192 } 164 bool RTR0MemObjIsMapping(RTR0MEMOBJ MemObj) { 193 bool RTR0MemObjIsMapping(RTR0MEMOBJ MemObj) 194 { 165 195 return g_VBoxGuest->_RTR0MemObjIsMapping(MemObj); 166 196 } 167 int RTR0MemObjLockKernelTag(PRTR0MEMOBJ pMemObj, void *pv, size_t cb, uint32_t fAccess, const char *pszTag) { 197 int RTR0MemObjLockKernelTag(PRTR0MEMOBJ pMemObj, void *pv, size_t cb, uint32_t fAccess, const char *pszTag) 198 { 168 199 return g_VBoxGuest->_RTR0MemObjLockKernelTag(pMemObj, pv, cb, fAccess, pszTag); 169 200 } 170 int RTR0MemObjLockUserTag(PRTR0MEMOBJ pMemObj, RTR3PTR R3Ptr, size_t cb, uint32_t fAccess, RTR0PROCESS R0Process, const char *pszTag) { 201 int RTR0MemObjLockUserTag(PRTR0MEMOBJ pMemObj, RTR3PTR R3Ptr, size_t cb, uint32_t fAccess, RTR0PROCESS R0Process, const char *pszTag) 202 { 171 203 return g_VBoxGuest->_RTR0MemObjLockUserTag(pMemObj, R3Ptr, cb, fAccess, R0Process, pszTag); 172 204 } 173 int RTR0MemObjMapKernelExTag(PRTR0MEMOBJ pMemObj, RTR0MEMOBJ MemObjToMap, void *pvFixed, size_t uAlignment, unsigned fProt, size_t offSub, size_t cbSub, const char *pszTag) { 205 int RTR0MemObjMapKernelExTag(PRTR0MEMOBJ pMemObj, RTR0MEMOBJ MemObjToMap, void *pvFixed, size_t uAlignment, unsigned fProt, size_t offSub, size_t cbSub, const char *pszTag) 206 { 174 207 return g_VBoxGuest->_RTR0MemObjMapKernelExTag(pMemObj, MemObjToMap, pvFixed, uAlignment, fProt, offSub, cbSub, pszTag); 175 208 } 176 int RTR0MemObjMapKernelTag(PRTR0MEMOBJ pMemObj, RTR0MEMOBJ MemObjToMap, void *pvFixed, size_t uAlignment, unsigned fProt, const char *pszTag) { 209 int RTR0MemObjMapKernelTag(PRTR0MEMOBJ pMemObj, RTR0MEMOBJ MemObjToMap, void *pvFixed, size_t uAlignment, unsigned fProt, const char *pszTag) 210 { 177 211 return g_VBoxGuest->_RTR0MemObjMapKernelTag(pMemObj, MemObjToMap, pvFixed, uAlignment, fProt, pszTag); 178 212 } 179 int RTR0MemObjMapUserTag(PRTR0MEMOBJ pMemObj, RTR0MEMOBJ MemObjToMap, RTR3PTR R3PtrFixed, size_t uAlignment, unsigned fProt, RTR0PROCESS R0Process, const char *pszTag) { 213 int RTR0MemObjMapUserTag(PRTR0MEMOBJ pMemObj, RTR0MEMOBJ MemObjToMap, RTR3PTR R3PtrFixed, size_t uAlignment, unsigned fProt, RTR0PROCESS R0Process, const char *pszTag) 214 { 180 215 return g_VBoxGuest->_RTR0MemObjMapUserTag(pMemObj, MemObjToMap, R3PtrFixed, uAlignment, fProt, R0Process, pszTag); 181 216 } 182 int RTR0MemObjProtect(RTR0MEMOBJ hMemObj, size_t offSub, size_t cbSub, uint32_t fProt) { 217 int RTR0MemObjProtect(RTR0MEMOBJ hMemObj, size_t offSub, size_t cbSub, uint32_t fProt) 218 { 183 219 return g_VBoxGuest->_RTR0MemObjProtect(hMemObj, offSub, cbSub, fProt); 184 220 } 185 int RTR0MemObjReserveKernelTag(PRTR0MEMOBJ pMemObj, void *pvFixed, size_t cb, size_t uAlignment, const char *pszTag) { 221 int RTR0MemObjReserveKernelTag(PRTR0MEMOBJ pMemObj, void *pvFixed, size_t cb, size_t uAlignment, const char *pszTag) 222 { 186 223 return g_VBoxGuest->_RTR0MemObjReserveKernelTag(pMemObj, pvFixed, cb, uAlignment, pszTag); 187 224 } 188 int RTR0MemObjReserveUserTag(PRTR0MEMOBJ pMemObj, RTR3PTR R3PtrFixed, size_t cb, size_t uAlignment, RTR0PROCESS R0Process, const char *pszTag) { 225 int RTR0MemObjReserveUserTag(PRTR0MEMOBJ pMemObj, RTR3PTR R3PtrFixed, size_t cb, size_t uAlignment, RTR0PROCESS R0Process, const char *pszTag) 226 { 189 227 return g_VBoxGuest->_RTR0MemObjReserveUserTag(pMemObj, R3PtrFixed, cb, uAlignment, R0Process, pszTag); 190 228 } 191 size_t RTR0MemObjSize(RTR0MEMOBJ MemObj) { 229 size_t RTR0MemObjSize(RTR0MEMOBJ MemObj) 230 { 192 231 return g_VBoxGuest->_RTR0MemObjSize(MemObj); 193 232 } 194 RTR0PROCESS RTR0ProcHandleSelf(void) { 233 RTR0PROCESS RTR0ProcHandleSelf(void) 234 { 195 235 return g_VBoxGuest->_RTR0ProcHandleSelf(); 196 236 } 197 void RTR0Term(void) { 237 void RTR0Term(void) 238 { 198 239 g_VBoxGuest->_RTR0Term(); 199 240 } 200 void RTR0TermForced(void) { 241 void RTR0TermForced(void) 242 { 201 243 g_VBoxGuest->_RTR0TermForced(); 202 244 } 203 RTPROCESS RTProcSelf(void) { 204 return g_VBoxGuest->_RTProcSelf(); 205 } 206 uint32_t RTSemEventGetResolution(void) { 245 RTPROCESS RTProcSelf(void) 246 { 247 return g_VBoxGuest->_RTProcSelf(); 248 } 249 uint32_t RTSemEventGetResolution(void) 250 { 207 251 return g_VBoxGuest->_RTSemEventGetResolution(); 208 252 } 209 uint32_t RTSemEventMultiGetResolution(void) { 253 uint32_t RTSemEventMultiGetResolution(void) 254 { 210 255 return g_VBoxGuest->_RTSemEventMultiGetResolution(); 211 256 } 212 int RTSemEventMultiWaitEx(RTSEMEVENTMULTI hEventMultiSem, uint32_t fFlags, uint64_t uTimeout) { 257 int RTSemEventMultiWaitEx(RTSEMEVENTMULTI hEventMultiSem, uint32_t fFlags, uint64_t uTimeout) 258 { 213 259 return g_VBoxGuest->_RTSemEventMultiWaitEx(hEventMultiSem, fFlags, uTimeout); 214 260 } 215 int RTSemEventMultiWaitExDebug(RTSEMEVENTMULTI hEventMultiSem, uint32_t fFlags, uint64_t uTimeout, RTHCUINTPTR uId, RT_SRC_POS_DECL) { 261 int RTSemEventMultiWaitExDebug(RTSEMEVENTMULTI hEventMultiSem, uint32_t fFlags, uint64_t uTimeout, RTHCUINTPTR uId, RT_SRC_POS_DECL) 262 { 216 263 return g_VBoxGuest->_RTSemEventMultiWaitExDebug(hEventMultiSem, fFlags, uTimeout, uId, pszFile, iLine, pszFunction); 217 264 } 218 int RTSemEventWaitEx(RTSEMEVENT hEventSem, uint32_t fFlags, uint64_t uTimeout) { 265 int RTSemEventWaitEx(RTSEMEVENT hEventSem, uint32_t fFlags, uint64_t uTimeout) 266 { 219 267 return g_VBoxGuest->_RTSemEventWaitEx(hEventSem, fFlags, uTimeout); 220 268 } 221 int RTSemEventWaitExDebug(RTSEMEVENT hEventSem, uint32_t fFlags, uint64_t uTimeout, RTHCUINTPTR uId, RT_SRC_POS_DECL) { 269 int RTSemEventWaitExDebug(RTSEMEVENT hEventSem, uint32_t fFlags, uint64_t uTimeout, RTHCUINTPTR uId, RT_SRC_POS_DECL) 270 { 222 271 return g_VBoxGuest->_RTSemEventWaitExDebug(hEventSem, fFlags, uTimeout, uId, pszFile, iLine, pszFunction); 223 272 } 224 bool RTThreadIsInInterrupt(RTTHREAD hThread) { 273 bool RTThreadIsInInterrupt(RTTHREAD hThread) 274 { 225 275 return g_VBoxGuest->_RTThreadIsInInterrupt(hThread); 226 276 } 227 void RTThreadPreemptDisable(PRTTHREADPREEMPTSTATE pState) { 277 void RTThreadPreemptDisable(PRTTHREADPREEMPTSTATE pState) 278 { 228 279 g_VBoxGuest->_RTThreadPreemptDisable(pState); 229 280 } 230 bool RTThreadPreemptIsEnabled(RTTHREAD hThread) { 281 bool RTThreadPreemptIsEnabled(RTTHREAD hThread) 282 { 231 283 return g_VBoxGuest->_RTThreadPreemptIsEnabled(hThread); 232 284 } 233 bool RTThreadPreemptIsPending(RTTHREAD hThread) { 285 bool RTThreadPreemptIsPending(RTTHREAD hThread) 286 { 234 287 return g_VBoxGuest->_RTThreadPreemptIsPending(hThread); 235 288 } 236 bool RTThreadPreemptIsPendingTrusty(void) { 289 bool RTThreadPreemptIsPendingTrusty(void) 290 { 237 291 return g_VBoxGuest->_RTThreadPreemptIsPendingTrusty(); 238 292 } 239 bool RTThreadPreemptIsPossible(void) { 293 bool RTThreadPreemptIsPossible(void) 294 { 240 295 return g_VBoxGuest->_RTThreadPreemptIsPossible(); 241 296 } 242 void RTThreadPreemptRestore(PRTTHREADPREEMPTSTATE pState) { 297 void RTThreadPreemptRestore(PRTTHREADPREEMPTSTATE pState) 298 { 243 299 g_VBoxGuest->_RTThreadPreemptRestore(pState); 244 300 } 245 uint32_t RTTimerGetSystemGranularity(void) { 301 uint32_t RTTimerGetSystemGranularity(void) 302 { 246 303 return g_VBoxGuest->_RTTimerGetSystemGranularity(); 247 304 } 248 int RTTimerReleaseSystemGranularity(uint32_t u32Granted) { 305 int RTTimerReleaseSystemGranularity(uint32_t u32Granted) 306 { 249 307 return g_VBoxGuest->_RTTimerReleaseSystemGranularity(u32Granted); 250 308 } 251 int RTTimerRequestSystemGranularity(uint32_t u32Request, uint32_t *pu32Granted) { 309 int RTTimerRequestSystemGranularity(uint32_t u32Request, uint32_t *pu32Granted) 310 { 252 311 return g_VBoxGuest->_RTTimerRequestSystemGranularity(u32Request, pu32Granted); 253 312 } 254 void RTSpinlockAcquire(RTSPINLOCK Spinlock) { 313 void RTSpinlockAcquire(RTSPINLOCK Spinlock) 314 { 255 315 g_VBoxGuest->_RTSpinlockAcquire(Spinlock); 256 316 } 257 void RTSpinlockRelease(RTSPINLOCK Spinlock) { 317 void RTSpinlockRelease(RTSPINLOCK Spinlock) 318 { 258 319 g_VBoxGuest->_RTSpinlockRelease(Spinlock); 259 320 } 260 void RTSpinlockReleaseNoInts(RTSPINLOCK Spinlock) { 321 void RTSpinlockReleaseNoInts(RTSPINLOCK Spinlock) 322 { 261 323 g_VBoxGuest->_RTSpinlockReleaseNoInts(Spinlock); 262 324 } 263 void * RTMemTmpAllocTag(size_t cb, const char *pszTag) { 325 void* RTMemTmpAllocTag(size_t cb, const char *pszTag) 326 { 264 327 return g_VBoxGuest->_RTMemTmpAllocTag(cb, pszTag); 265 328 } 266 void RTMemTmpFree(void *pv) { 329 void RTMemTmpFree(void *pv) 330 { 267 331 g_VBoxGuest->_RTMemTmpFree(pv); 268 332 } 269 PRTLOGGER RTLogDefaultInstance(void) { 333 PRTLOGGER RTLogDefaultInstance(void) 334 { 270 335 return g_VBoxGuest->_RTLogDefaultInstance(); 271 336 } 272 PRTLOGGER RTLogRelDefaultInstance(void) { 337 PRTLOGGER RTLogRelDefaultInstance(void) 338 { 273 339 return g_VBoxGuest->_RTLogRelDefaultInstance(); 274 340 } 275 int RTErrConvertToErrno(int iErr) { 341 int RTErrConvertToErrno(int iErr) 342 { 276 343 return g_VBoxGuest->_RTErrConvertToErrno(iErr); 277 344 } 278 int VBoxGuestCommonIOCtl(unsigned iFunction, PVBOXGUESTDEVEXT pDevExt, PVBOXGUESTSESSION pSession, void *pvData, size_t cbData, size_t *pcbDataReturned) { 345 int VBoxGuestCommonIOCtl(unsigned iFunction, PVBOXGUESTDEVEXT pDevExt, PVBOXGUESTSESSION pSession, void *pvData, size_t cbData, size_t *pcbDataReturned) 346 { 279 347 return g_VBoxGuest->_VBoxGuestCommonIOCtl(iFunction, pDevExt, pSession, pvData, cbData, pcbDataReturned); 280 348 } 281 int VBoxGuestCreateUserSession(PVBOXGUESTDEVEXT pDevExt, PVBOXGUESTSESSION *ppSession) { 349 int VBoxGuestCreateUserSession(PVBOXGUESTDEVEXT pDevExt, PVBOXGUESTSESSION *ppSession) 350 { 282 351 return g_VBoxGuest->_VBoxGuestCreateUserSession(pDevExt, ppSession); 283 352 } 284 void VBoxGuestCloseSession(PVBOXGUESTDEVEXT pDevExt, PVBOXGUESTSESSION pSession) { 353 void VBoxGuestCloseSession(PVBOXGUESTDEVEXT pDevExt, PVBOXGUESTSESSION pSession) 354 { 285 355 g_VBoxGuest->_VBoxGuestCloseSession(pDevExt, pSession); 286 356 } 287 void * VBoxGuestIDCOpen(uint32_t *pu32Version) { 357 void* VBoxGuestIDCOpen(uint32_t *pu32Version) 358 { 288 359 return g_VBoxGuest->_VBoxGuestIDCOpen(pu32Version); 289 360 } 290 int VBoxGuestIDCClose(void *pvSession) { 361 int VBoxGuestIDCClose(void *pvSession) 362 { 291 363 return g_VBoxGuest->_VBoxGuestIDCClose(pvSession); 292 364 } 293 int VBoxGuestIDCCall(void *pvSession, unsigned iCmd, void *pvData, size_t cbData, size_t *pcbDataReturned) { 365 int VBoxGuestIDCCall(void *pvSession, unsigned iCmd, void *pvData, size_t cbData, size_t *pcbDataReturned) 366 { 294 367 return g_VBoxGuest->_VBoxGuestIDCCall(pvSession, iCmd, pvData, cbData, pcbDataReturned); 295 368 } 296 void RTAssertMsg1Weak(const char *pszExpr, unsigned uLine, const char *pszFile, const char *pszFunction) { 369 void RTAssertMsg1Weak(const char *pszExpr, unsigned uLine, const char *pszFile, const char *pszFunction) 370 { 297 371 g_VBoxGuest->_RTAssertMsg1Weak(pszExpr, uLine, pszFile, pszFunction); 298 372 } 299 void RTAssertMsg2Weak(const char *pszFormat, ...) { 373 void RTAssertMsg2Weak(const char *pszFormat, ...) 374 { 300 375 va_list va; 301 376 va_start(va, pszFormat); … … 303 378 va_end(va); 304 379 } 305 void RTAssertMsg2WeakV(const char *pszFormat, va_list va) { 380 void RTAssertMsg2WeakV(const char *pszFormat, va_list va) 381 { 306 382 g_VBoxGuest->_RTAssertMsg2WeakV(pszFormat, va); 307 383 } 308 bool RTAssertShouldPanic(void) { 384 bool RTAssertShouldPanic(void) 385 { 309 386 return g_VBoxGuest->_RTAssertShouldPanic(); 310 387 } 311 int RTSemFastMutexCreate(PRTSEMFASTMUTEX phFastMtx) { 388 int RTSemFastMutexCreate(PRTSEMFASTMUTEX phFastMtx) 389 { 312 390 return g_VBoxGuest->_RTSemFastMutexCreate(phFastMtx); 313 391 } 314 int RTSemFastMutexDestroy(RTSEMFASTMUTEX hFastMtx) { 392 int RTSemFastMutexDestroy(RTSEMFASTMUTEX hFastMtx) 393 { 315 394 return g_VBoxGuest->_RTSemFastMutexDestroy(hFastMtx); 316 395 } 317 int RTSemFastMutexRelease(RTSEMFASTMUTEX hFastMtx) { 396 int RTSemFastMutexRelease(RTSEMFASTMUTEX hFastMtx) 397 { 318 398 return g_VBoxGuest->_RTSemFastMutexRelease(hFastMtx); 319 399 } 320 int RTSemFastMutexRequest(RTSEMFASTMUTEX hFastMtx) { 400 int RTSemFastMutexRequest(RTSEMFASTMUTEX hFastMtx) 401 { 321 402 return g_VBoxGuest->_RTSemFastMutexRequest(hFastMtx); 322 403 } 323 int RTSemMutexCreate(PRTSEMMUTEX phFastMtx) { 404 int RTSemMutexCreate(PRTSEMMUTEX phFastMtx) 405 { 324 406 return g_VBoxGuest->_RTSemMutexCreate(phFastMtx); 325 407 } 326 int RTSemMutexDestroy(RTSEMMUTEX hFastMtx) { 408 int RTSemMutexDestroy(RTSEMMUTEX hFastMtx) 409 { 327 410 return g_VBoxGuest->_RTSemMutexDestroy(hFastMtx); 328 411 } 329 int RTSemMutexRelease(RTSEMMUTEX hFastMtx) { 412 int RTSemMutexRelease(RTSEMMUTEX hFastMtx) 413 { 330 414 return g_VBoxGuest->_RTSemMutexRelease(hFastMtx); 331 415 } 332 int RTSemMutexRequest(RTSEMMUTEX hFastMtx, RTMSINTERVAL cMillies) { 416 int RTSemMutexRequest(RTSEMMUTEX hFastMtx, RTMSINTERVAL cMillies) 417 { 333 418 return g_VBoxGuest->_RTSemMutexRequest(hFastMtx, cMillies); 334 419 } 335 int RTHeapSimpleRelocate(RTHEAPSIMPLE hHeap, uintptr_t offDelta) { 420 int RTHeapSimpleRelocate(RTHEAPSIMPLE hHeap, uintptr_t offDelta) 421 { 336 422 return g_VBoxGuest->_RTHeapSimpleRelocate(hHeap, offDelta); 337 423 } 338 int RTHeapOffsetInit(PRTHEAPOFFSET phHeap, void *pvMemory, size_t cbMemory) { 424 int RTHeapOffsetInit(PRTHEAPOFFSET phHeap, void *pvMemory, size_t cbMemory) 425 { 339 426 return g_VBoxGuest->_RTHeapOffsetInit(phHeap, pvMemory, cbMemory); 340 427 } 341 int RTHeapSimpleInit(PRTHEAPSIMPLE pHeap, void *pvMemory, size_t cbMemory) { 428 int RTHeapSimpleInit(PRTHEAPSIMPLE pHeap, void *pvMemory, size_t cbMemory) 429 { 342 430 return g_VBoxGuest->_RTHeapSimpleInit(pHeap, pvMemory, cbMemory); 343 431 } 344 void * RTHeapOffsetAlloc(RTHEAPOFFSET hHeap, size_t cb, size_t cbAlignment) { 432 void* RTHeapOffsetAlloc(RTHEAPOFFSET hHeap, size_t cb, size_t cbAlignment) 433 { 345 434 return g_VBoxGuest->_RTHeapOffsetAlloc(hHeap, cb, cbAlignment); 346 435 } 347 void * RTHeapSimpleAlloc(RTHEAPSIMPLE Heap, size_t cb, size_t cbAlignment) { 436 void* RTHeapSimpleAlloc(RTHEAPSIMPLE Heap, size_t cb, size_t cbAlignment) 437 { 348 438 return g_VBoxGuest->_RTHeapSimpleAlloc(Heap, cb, cbAlignment); 349 439 } 350 void RTHeapOffsetFree(RTHEAPOFFSET hHeap, void *pv) { 440 void RTHeapOffsetFree(RTHEAPOFFSET hHeap, void *pv) 441 { 351 442 g_VBoxGuest->_RTHeapOffsetFree(hHeap, pv); 352 443 } 353 void RTHeapSimpleFree(RTHEAPSIMPLE Heap, void *pv) { 444 void RTHeapSimpleFree(RTHEAPSIMPLE Heap, void *pv) 445 { 354 446 g_VBoxGuest->_RTHeapSimpleFree(Heap, pv); 355 447 } -
trunk/src/VBox/Additions/common/VBoxGuest/VBoxGuest-haiku.c
r43363 r43366 105 105 static pci_module_info *gPCI; 106 106 107 static struct vboxguest_module_info g_VBoxGuest = { 107 static struct vboxguest_module_info g_VBoxGuest = 108 { 108 109 { 109 110 MODULE_NAME, … … 111 112 std_ops 112 113 }, 113 { 0},114 { 0},114 { 0 }, 115 { 0 }, 115 116 0, 116 117 RTLogBackdoorPrintf, … … 224 225 */ 225 226 if (!ppDev) 226 227 return; 227 228 if (strcmp(pszName, "vboxguest") == 0) 228 229 iUnit = -1; 229 230 else if (dev_stdclone(pszName, NULL, "vboxguest", &iUnit) != 1) 230 231 return; 231 232 if (iUnit >= 256) 232 233 { … … 252 253 (*ppDev)->si_flags |= SI_CHEAPCLONE; 253 254 Log(("VBoxGuestHaikuClone: Created *ppDev=%p iUnit=%d si_drv1=%p si_drv2=%p\n", 254 255 *ppDev, iUnit, (*ppDev)->si_drv1, (*ppDev)->si_drv2)); 255 256 (*ppDev)->si_drv1 = (*ppDev)->si_drv2 = NULL; 256 257 } 257 258 else 258 259 Log(("VBoxGuestHaikuClone: make_dev iUnit=%d failed\n", iUnit)); 259 260 } 260 261 else 261 262 262 Log(("VBoxGuestHaikuClone: Existing *ppDev=%p iUnit=%d si_drv1=%p si_drv2=%p\n", 263 *ppDev, iUnit, (*ppDev)->si_drv1, (*ppDev)->si_drv2)); 263 264 } 264 265 #endif … … 296 297 } 297 298 299 298 300 /** 299 301 * Interrupt service routine. … … 310 312 return fOurIRQ ? B_HANDLED_INTERRUPT : B_UNHANDLED_INTERRUPT; 311 313 } 314 312 315 313 316 void VBoxGuestNativeISRMousePollEvent(PVBOXGUESTDEVEXT pDevExt) … … 325 328 RTSpinlockAcquire(g_Spinlock); 326 329 327 if (sState.selectSync) { 330 if (sState.selectSync) 331 { 328 332 //dprintf(MODULE_NAME ": isr mouse: notify\n"); 329 333 notify_select_event(sState.selectSync, sState.selectEvent); … … 331 335 sState.selectRef = (uint32_t)0; 332 336 sState.selectSync = NULL; 333 } else 337 } 338 else 334 339 err = B_ERROR; 335 340 336 341 RTSpinlockRelease(g_Spinlock); 337 342 } 343 338 344 339 345 /** … … 358 364 } 359 365 366 360 367 /** 361 368 * Removes IRQ for VMMDev. … … 369 376 remove_io_interrupt_handler(pState->iIrqResId, VBoxGuestHaikuISR, pState); 370 377 } 378 371 379 372 380 static status_t VBoxGuestHaikuAttach(const pci_info *pDevice) … … 376 384 int iResId = 0; 377 385 struct VBoxGuestDeviceState *pState = &sState; 378 static const char * 386 static const char *const s_apszGroups[] = VBOX_LOGGROUP_NAMES; 379 387 PRTLOGGER pRelLogger; 380 388 … … 387 395 if (RT_FAILURE(rc)) 388 396 { 389 397 /** @todo r=ramshankar: use dprintf here */ 390 398 LogFunc(("RTR0Init failed.\n")); 391 399 return ENXIO; … … 395 403 if (RT_FAILURE(rc)) 396 404 { 397 398 405 LogRel(("VBoxGuestHaikuAttach: RTSpinlock create failed. rc=%Rrc\n", rc)); 406 return ENXIO; 399 407 } 400 408 … … 405 413 * early failures using the LogRel macro.) 406 414 */ 407 rc = RTLogCreate(&pRelLogger, 0 |RTLOGFLAGS_PREFIX_THREAD /* fFlags */, "all",415 rc = RTLogCreate(&pRelLogger, 0 | RTLOGFLAGS_PREFIX_THREAD /* fFlags */, "all", 408 416 "VBOX_RELEASE_LOG", RT_ELEMENTS(s_apszGroups), s_apszGroups, 409 417 RTLOGDEST_STDOUT | RTLOGDEST_DEBUGGER | RTLOGDEST_USER, NULL); 410 dprintf(MODULE_NAME ": RTLogCreate: %d\n", rc);418 dprintf(MODULE_NAME ": RTLogCreate: %d\n", rc); 411 419 if (RT_SUCCESS(rc)) 412 420 { … … 415 423 //RTLogDestinations(pRelLogger, "/var/log/vboxguest.log"); 416 424 RTLogRelSetDefaultInstance(pRelLogger); 417 RTLogSetDefaultInstance(pRelLogger); //XXX425 RTLogSetDefaultInstance(pRelLogger); //XXX 418 426 } 419 427 #endif … … 436 444 pState->VMMDevMemSize = pDevice->u.h0.base_register_sizes[1]; 437 445 pState->iVMMDevMemAreaId = map_physical_memory("VirtualBox Guest MMIO", 438 phys, pState->VMMDevMemSize, B_ANY_KERNEL_BLOCK_ADDRESS,439 B_KERNEL_READ_AREA | B_KERNEL_WRITE_AREA, &pState->pMMIOBase);446 phys, pState->VMMDevMemSize, B_ANY_KERNEL_BLOCK_ADDRESS, 447 B_KERNEL_READ_AREA | B_KERNEL_WRITE_AREA, &pState->pMMIOBase); 440 448 441 449 if (pState->iVMMDevMemAreaId > 0 && pState->pMMIOBase) … … 481 489 } 482 490 491 483 492 static status_t VBoxGuestHaikuProbe(pci_info *pDevice) 484 493 { … … 488 497 return ENXIO; 489 498 } 499 490 500 491 501 status_t init_module(void) … … 498 508 return ENOSYS; 499 509 500 while ((*gPCI->get_nth_pci_info)(ix++, &info) == B_OK) { 501 if (VBoxGuestHaikuProbe(&info) == 0) { 510 while ((*gPCI->get_nth_pci_info)(ix++, &info) == B_OK) 511 { 512 if (VBoxGuestHaikuProbe(&info) == 0) 513 { 502 514 // we found it 503 515 status = VBoxGuestHaikuAttach(&info); … … 509 521 } 510 522 523 511 524 void uninit_module(void) 512 525 { … … 516 529 } 517 530 518 static status_t std_ops(int32 op, ...) { 519 switch(op) { 520 case B_MODULE_INIT: 521 dprintf(MODULE_NAME ": B_MODULE_INIT\n"); 522 return init_module(); 523 case B_MODULE_UNINIT: 524 dprintf(MODULE_NAME ": B_MODULE_UNINIT\n"); 525 uninit_module(); 526 return B_OK; 527 default: 528 return B_ERROR; 529 } 530 } 531 532 _EXPORT module_info *modules[] = { 533 (module_info*) &g_VBoxGuest, 531 532 static status_t std_ops(int32 op, ...) 533 { 534 switch (op) 535 { 536 case B_MODULE_INIT: 537 dprintf(MODULE_NAME ": B_MODULE_INIT\n"); 538 return init_module(); 539 case B_MODULE_UNINIT: 540 dprintf(MODULE_NAME ": B_MODULE_UNINIT\n"); 541 uninit_module(); 542 return B_OK; 543 default: 544 return B_ERROR; 545 } 546 } 547 548 549 _EXPORT module_info *modules[] = 550 { 551 (module_info *)&g_VBoxGuest, 534 552 NULL 535 553 }; … … 537 555 /* Common code that depend on g_DevExt. */ 538 556 #include "VBoxGuestIDC-unix.c.h" 557 -
trunk/src/VBox/Additions/common/VBoxGuest/VBoxGuest-haiku.h
r43363 r43366 101 101 }; 102 102 103 struct vboxguest_module_info { 103 struct vboxguest_module_info 104 { 104 105 module_info module; 105 106 … … 108 109 volatile uint32_t _cUsers; 109 110 110 size_t 111 size_t 111 size_t(*_RTLogBackdoorPrintf)(const char *pszFormat, ...); 112 size_t(*_RTLogBackdoorPrintfV)(const char *pszFormat, va_list args); 112 113 int (*_RTLogSetDefaultInstanceThread)(PRTLOGGER pLogger, uintptr_t uKey); 113 114 int (*_RTMemAllocExTag)(size_t cb, size_t cbAlignment, uint32_t fFlags, const char *pszTag, void **ppv); 114 void 115 void* (*_RTMemContAlloc)(PRTCCPHYS pPhys, size_t cb); 115 116 void (*_RTMemContFree)(void *pv, size_t cb); 116 117 void (*_RTMemFreeEx)(void *pv, size_t cb); … … 126 127 void (*_RTR0AssertPanicSystem)(void); 127 128 int (*_RTR0Init)(unsigned fReserved); 128 void 129 RTR3PTR 129 void* (*_RTR0MemObjAddress)(RTR0MEMOBJ MemObj); 130 RTR3PTR(*_RTR0MemObjAddressR3)(RTR0MEMOBJ MemObj); 130 131 int (*_RTR0MemObjAllocContTag)(PRTR0MEMOBJ pMemObj, size_t cb, bool fExecutable, const char *pszTag); 131 132 int (*_RTR0MemObjAllocLowTag)(PRTR0MEMOBJ pMemObj, size_t cb, bool fExecutable, const char *pszTag); … … 136 137 int (*_RTR0MemObjEnterPhysTag)(PRTR0MEMOBJ pMemObj, RTHCPHYS Phys, size_t cb, uint32_t uCachePolicy, const char *pszTag); 137 138 int (*_RTR0MemObjFree)(RTR0MEMOBJ MemObj, bool fFreeMappings); 138 RTHCPHYS 139 RTHCPHYS(*_RTR0MemObjGetPagePhysAddr)(RTR0MEMOBJ MemObj, size_t iPage); 139 140 bool (*_RTR0MemObjIsMapping)(RTR0MEMOBJ MemObj); 140 141 int (*_RTR0MemObjLockKernelTag)(PRTR0MEMOBJ pMemObj, void *pv, size_t cb, uint32_t fAccess, const char *pszTag); 141 142 int (*_RTR0MemObjLockUserTag)(PRTR0MEMOBJ pMemObj, RTR3PTR R3Ptr, size_t cb, uint32_t fAccess, 142 RTR0PROCESS R0Process, const char *pszTag);143 RTR0PROCESS R0Process, const char *pszTag); 143 144 int (*_RTR0MemObjMapKernelExTag)(PRTR0MEMOBJ pMemObj, RTR0MEMOBJ MemObjToMap, void *pvFixed, size_t uAlignment, 144 unsigned fProt, size_t offSub, size_t cbSub, const char *pszTag);145 unsigned fProt, size_t offSub, size_t cbSub, const char *pszTag); 145 146 int (*_RTR0MemObjMapKernelTag)(PRTR0MEMOBJ pMemObj, RTR0MEMOBJ MemObjToMap, void *pvFixed, 146 size_t uAlignment, unsigned fProt, const char *pszTag);147 size_t uAlignment, unsigned fProt, const char *pszTag); 147 148 int (*_RTR0MemObjMapUserTag)(PRTR0MEMOBJ pMemObj, RTR0MEMOBJ MemObjToMap, RTR3PTR R3PtrFixed, 148 size_t uAlignment, unsigned fProt, RTR0PROCESS R0Process, const char *pszTag);149 size_t uAlignment, unsigned fProt, RTR0PROCESS R0Process, const char *pszTag); 149 150 int (*_RTR0MemObjProtect)(RTR0MEMOBJ hMemObj, size_t offSub, size_t cbSub, uint32_t fProt); 150 151 int (*_RTR0MemObjReserveKernelTag)(PRTR0MEMOBJ pMemObj, void *pvFixed, size_t cb, size_t uAlignment, const char *pszTag); 151 152 int (*_RTR0MemObjReserveUserTag)(PRTR0MEMOBJ pMemObj, RTR3PTR R3PtrFixed, size_t cb, size_t uAlignment, 152 RTR0PROCESS R0Process, const char *pszTag);153 size_t 154 RTR0PROCESS 153 RTR0PROCESS R0Process, const char *pszTag); 154 size_t(*_RTR0MemObjSize)(RTR0MEMOBJ MemObj); 155 RTR0PROCESS(*_RTR0ProcHandleSelf)(void); 155 156 void (*_RTR0Term)(void); 156 157 void (*_RTR0TermForced)(void); 157 RTPROCESS 158 uint32_t 159 uint32_t 158 RTPROCESS(*_RTProcSelf)(void); 159 uint32_t(*_RTSemEventGetResolution)(void); 160 uint32_t(*_RTSemEventMultiGetResolution)(void); 160 161 int (*_RTSemEventMultiWaitEx)(RTSEMEVENTMULTI hEventMultiSem, uint32_t fFlags, uint64_t uTimeout); 161 162 int (*_RTSemEventMultiWaitExDebug)(RTSEMEVENTMULTI hEventMultiSem, uint32_t fFlags, uint64_t uTimeout, 162 RTHCUINTPTR uId, RT_SRC_POS_DECL);163 RTHCUINTPTR uId, RT_SRC_POS_DECL); 163 164 int (*_RTSemEventWaitEx)(RTSEMEVENT hEventSem, uint32_t fFlags, uint64_t uTimeout); 164 165 int (*_RTSemEventWaitExDebug)(RTSEMEVENT hEventSem, uint32_t fFlags, uint64_t uTimeout, 165 RTHCUINTPTR uId, RT_SRC_POS_DECL);166 RTHCUINTPTR uId, RT_SRC_POS_DECL); 166 167 bool (*_RTThreadIsInInterrupt)(RTTHREAD hThread); 167 168 void (*_RTThreadPreemptDisable)(PRTTHREADPREEMPTSTATE pState); … … 171 172 bool (*_RTThreadPreemptIsPossible)(void); 172 173 void (*_RTThreadPreemptRestore)(PRTTHREADPREEMPTSTATE pState); 173 uint32_t 174 uint32_t(*_RTTimerGetSystemGranularity)(void); 174 175 int (*_RTTimerReleaseSystemGranularity)(uint32_t u32Granted); 175 176 int (*_RTTimerRequestSystemGranularity)(uint32_t u32Request, uint32_t *pu32Granted); … … 177 178 void (*_RTSpinlockRelease)(RTSPINLOCK Spinlock); 178 179 void (*_RTSpinlockReleaseNoInts)(RTSPINLOCK Spinlock); 179 void 180 void* (*_RTMemTmpAllocTag)(size_t cb, const char *pszTag); 180 181 void (*_RTMemTmpFree)(void *pv); 181 PRTLOGGER 182 PRTLOGGER 182 PRTLOGGER(*_RTLogDefaultInstance)(void); 183 PRTLOGGER(*_RTLogRelDefaultInstance)(void); 183 184 int (*_RTErrConvertToErrno)(int iErr); 184 185 int (*_VBoxGuestCommonIOCtl)(unsigned iFunction, PVBOXGUESTDEVEXT pDevExt, PVBOXGUESTSESSION pSession, 185 void *pvData, size_t cbData, size_t *pcbDataReturned);186 void *pvData, size_t cbData, size_t *pcbDataReturned); 186 187 int (*_VBoxGuestCreateUserSession)(PVBOXGUESTDEVEXT pDevExt, PVBOXGUESTSESSION *ppSession); 187 188 void (*_VBoxGuestCloseSession)(PVBOXGUESTDEVEXT pDevExt, PVBOXGUESTSESSION pSession); 188 void 189 void* (*_VBoxGuestIDCOpen)(uint32_t *pu32Version); 189 190 int (*_VBoxGuestIDCClose)(void *pvSession); 190 191 int (*_VBoxGuestIDCCall)(void *pvSession, unsigned iCmd, void *pvData, size_t cbData, size_t *pcbDataReturned); … … 204 205 int (*_RTHeapOffsetInit)(PRTHEAPOFFSET phHeap, void *pvMemory, size_t cbMemory); 205 206 int (*_RTHeapSimpleInit)(PRTHEAPSIMPLE pHeap, void *pvMemory, size_t cbMemory); 206 void 207 void 207 void* (*_RTHeapOffsetAlloc)(RTHEAPOFFSET hHeap, size_t cb, size_t cbAlignment); 208 void* (*_RTHeapSimpleAlloc)(RTHEAPSIMPLE Heap, size_t cb, size_t cbAlignment); 208 209 void (*_RTHeapOffsetFree)(RTHEAPOFFSET hHeap, void *pv); 209 210 void (*_RTHeapSimpleFree)(RTHEAPSIMPLE Heap, void *pv); -
trunk/src/VBox/Additions/haiku/VBoxVideo/driver/driver.cpp
r43364 r43366 77 77 struct Benaphore 78 78 { 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 79 sem_id sem; 80 int32 count; 81 82 status_t Init(const char *name) 83 { 84 count = 0; 85 sem = create_sem(0, name); 86 return sem < 0 ? sem : B_OK; 87 } 88 89 status_t Acquire() 90 { 91 if (atomic_add(&count, 1) > 0) 92 return acquire_sem(sem); 93 return B_OK; 94 } 95 96 status_t Release() 97 { 98 if (atomic_add(&count, -1) > 1) 99 return release_sem(sem); 100 return B_OK; 101 } 102 103 void Delete() 104 { 105 delete_sem(sem); 106 } 107 107 }; 108 108 109 109 struct DeviceInfo 110 110 { 111 112 113 114 115 116 111 uint32 openCount; // count of how many times device has been opened 112 uint32 flags; // device flags 113 area_id sharedArea; // area shared between driver and all accelerants 114 SharedInfo *sharedInfo; // pointer to shared info area memory 115 pci_info pciInfo; // copy of pci info for this device 116 char name[B_OS_NAME_LENGTH]; // name of device 117 117 }; 118 118 -
trunk/src/VBox/Runtime/Makefile.kmk
r43292 r43366 950 950 generic/RTSystemQueryDmiString-generic.cpp 951 951 952 RuntimeR3_SOURCES.haiku = \ 953 generic/RTDirQueryInfo-generic.cpp \ 954 generic/RTDirSetTimes-generic.cpp \ 955 generic/RTFileMove-generic.cpp \ 956 generic/RTLogWriteDebugger-generic.cpp \ 957 generic/RTProcDaemonize-generic.cpp \ 958 generic/RTTimeLocalNow-generic.cpp \ 959 generic/RTTimerCreate-generic.cpp \ 960 generic/RTUuidCreate-generic.cpp \ 961 generic/mppresent-generic.cpp \ 962 generic/RTSemEventMultiWait-2-ex-generic.cpp \ 963 generic/RTSemEventMultiWaitNoResume-2-ex-generic.cpp \ 964 generic/sched-generic.cpp \ 965 generic/semrw-$(if-expr defined(VBOX_WITH_LOCKLESS_SEMRW),ockless-,)generic.cpp \ 966 generic/timer-generic.cpp \ 967 generic/utf16locale-generic.cpp \ 968 generic/uuid-generic.cpp\ 969 generic/RTProcIsRunningByName-generic.cpp \ 970 generic/RTThreadGetNativeState-generic.cpp \ 971 r3/haiku/rtProcInitExePath-haiku.cpp \ 972 r3/haiku/time-haiku.cpp \ 973 r3/posix/RTFileQueryFsSizes-posix.cpp \ 974 r3/posix/RTHandleGetStandard-posix.cpp \ 975 r3/posix/RTMemProtect-posix.cpp \ 976 r3/posix/RTPathUserHome-posix.cpp \ 977 r3/posix/RTSystemQueryOSInfo-posix.cpp \ 978 r3/posix/RTSystemQueryTotalRam-posix.cpp \ 979 r3/posix/RTTimeNow-posix.cpp \ 980 r3/posix/dir-posix.cpp \ 981 r3/posix/env-posix.cpp \ 982 r3/posix/errvars-posix.cpp \ 983 r3/posix/fileio-posix.cpp \ 984 r3/posix/fileio2-posix.cpp \ 985 r3/posix/filelock-posix.cpp \ 986 r3/posix/fs-posix.cpp \ 987 r3/posix/fs2-posix.cpp \ 988 r3/posix/fs3-posix.cpp \ 989 r3/posix/ldrNative-posix.cpp \ 990 r3/posix/rtmempage-exec-mmap-heap-posix.cpp \ 991 r3/posix/path-posix.cpp \ 992 r3/posix/path2-posix.cpp \ 993 r3/posix/pathhost-posix.cpp \ 994 r3/posix/pipe-posix.cpp \ 995 r3/posix/poll-posix.cpp \ 996 r3/posix/process-posix.cpp \ 997 r3/posix/process-creation-posix.cpp \ 998 r3/posix/rand-posix.cpp \ 999 r3/posix/semevent-posix.cpp \ 1000 r3/posix/semeventmulti-posix.cpp \ 1001 r3/posix/semmutex-posix.cpp \ 1002 r3/posix/symlink-posix.cpp \ 1003 r3/posix/thread-posix.cpp \ 1004 r3/posix/thread2-posix.cpp \ 1005 r3/posix/timelocal-posix.cpp \ 1006 r3/posix/tls-posix.cpp \ 1007 r3/posix/utf8-posix.cpp 1008 952 1009 ## PORTME: Porters add their selection of platform specific files for Ring-3 here. 953 1010 … … 1319 1376 iconv \ 1320 1377 rt 1378 VBoxRT_LIBS.haiku = \ 1379 iconv 1321 1380 VBoxRT_LIBS.solaris = \ 1322 1381 kstat \ … … 1918 1977 r0drv/solaris/timer-r0drv-solaris.c 1919 1978 1979 RuntimeR0Drv_SOURCES.haiku = \ 1980 common/misc/thread.cpp \ 1981 common/string/memchr.asm \ 1982 common/string/memmove.asm \ 1983 common/string/strpbrk.cpp \ 1984 common/string/memcmp.asm \ 1985 common/string/strchr.asm \ 1986 generic/RTAssertShouldPanic-generic.cpp \ 1987 generic/RTTimerCreate-generic.cpp \ 1988 generic/mppresent-generic.cpp \ 1989 r0drv/generic/RTMpIsCpuWorkPending-r0drv-generic.cpp \ 1990 r0drv/generic/mpnotification-r0drv-generic.cpp \ 1991 r0drv/haiku/alloc-r0drv-haiku.c \ 1992 r0drv/haiku/assert-r0drv-haiku.c \ 1993 r0drv/haiku/initterm-r0drv-haiku.c \ 1994 r0drv/haiku/memobj-r0drv-haiku.c \ 1995 r0drv/haiku/mp-r0drv-haiku.c \ 1996 r0drv/haiku/process-r0drv-haiku.c \ 1997 r0drv/haiku/RTLogWriteDebugger-r0drv-haiku.c \ 1998 r0drv/haiku/RTLogWriteStdOut-r0drv-haiku.c \ 1999 r0drv/haiku/semevent-r0drv-haiku.c \ 2000 r0drv/haiku/semeventmulti-r0drv-haiku.c \ 2001 r0drv/haiku/semfastmutex-r0drv-haiku.c \ 2002 r0drv/haiku/semmutex-r0drv-haiku.c \ 2003 r0drv/haiku/spinlock-r0drv-haiku.c \ 2004 r0drv/haiku/thread-r0drv-haiku.c \ 2005 r0drv/haiku/thread2-r0drv-haiku.c \ 2006 r0drv/haiku/time-r0drv-haiku.c \ 2007 generic/timer-generic.cpp \ 2008 r0drv/memobj-r0drv.cpp \ 2009 r0drv/powernotification-r0drv.c 1920 2010 1921 2011 ## PORTME: Porters create and add their selection of platform specific Ring-0 Driver files here. … … 2217 2307 $(dir) \ 2218 2308 $(dir)/darwin \ 2309 $(dir)/haiku \ 2219 2310 $(dir)/l4 \ 2220 2311 $(dir)/linux \ 2221 2312 $(dir)/nt \ 2222 2313 $(dir)/os2 \ 2314 $(dir)/solaris \ 2223 2315 $(dir)/win \ 2224 2316 $(dir)/win32 \ -
trunk/src/VBox/Runtime/r0drv/haiku/RTLogWriteDebugger-r0drv-haiku.c
r43363 r43366 36 36 RTDECL(void) RTLogWriteDebugger(const char *pch, size_t cb) 37 37 { 38 38 /** @todo implement this */ 39 39 /*kprintf("%.*s", (int)cb, pch);*/ 40 40 return; -
trunk/src/VBox/Runtime/r0drv/haiku/alloc-r0drv-haiku.c
r43363 r43366 51 51 if (RT_UNLIKELY(!pHdr)) 52 52 { 53 LogRel(("rtR0MemAllocEx(%u, %#x) failed\n", 53 LogRel(("rtR0MemAllocEx(%u, %#x) failed\n",(unsigned)cb + sizeof(*pHdr), fFlags)); 54 54 return VERR_NO_MEMORY; 55 55 } … … 90 90 void *pv; 91 91 area_id area = create_area("VirtualBox Contig Alloc", &pv, 92 93 92 B_ANY_KERNEL_ADDRESS, cb, B_32_BIT_CONTIGUOUS, 93 B_READ_AREA | B_WRITE_AREA); 94 94 95 95 if (area >= 0) 96 96 { 97 98 if (get_memory_map(pv, cb, physMap, 2)>= B_OK)99 100 97 physical_entry physMap[2]; 98 if (get_memory_map(pv, cb, physMap, 2)>= B_OK) 99 { 100 *pPhys = physMap[0].address; 101 101 return pv; 102 102 } 103 103 delete_area(area); 104 AssertMsgFailed(("Cannot get_memory_map for contig alloc! cb=%u\n", 104 AssertMsgFailed(("Cannot get_memory_map for contig alloc! cb=%u\n",(unsigned)cb)); 105 105 } 106 106 else 107 AssertMsgFailed(("Cannot create_area for contig alloc! cb=%u error=0x%08lx\n",(unsigned)cb, area));107 AssertMsgFailed(("Cannot create_area for contig alloc! cb=%u error=0x%08lx\n",(unsigned)cb, area)); 108 108 return NULL; 109 109 } … … 119 119 area_id area = area_for(pv); 120 120 if (area >= B_OK) 121 122 123 AssertMsgFailed(("Cannot find area to delete! cb=%u error=0x%08lx\n",(unsigned)cb, area));121 delete_area(area); 122 else 123 AssertMsgFailed(("Cannot find area to delete! cb=%u error=0x%08lx\n",(unsigned)cb, area)); 124 124 } 125 125 } 126 -
trunk/src/VBox/Runtime/r0drv/haiku/initterm-r0drv-haiku.c
r43363 r43366 39 39 int rtR0InitNative(void) 40 40 { 41 41 return VINF_SUCCESS; 42 42 } 43 43 -
trunk/src/VBox/Runtime/r0drv/haiku/memobj-r0drv-haiku.c
r43363 r43366 78 78 case RTR0MEMOBJTYPE_LOCK: 79 79 return pMem->u.Lock.R0Process == NIL_RTR0PROCESS 80 81 80 ? kernel_map 81 : &((struct proc *)pMem->u.Lock.R0Process)->p_vmspace->vm_map; 82 82 83 83 case RTR0MEMOBJTYPE_RES_VIRT: 84 84 return pMem->u.ResVirt.R0Process == NIL_RTR0PROCESS 85 86 85 ? kernel_map 86 : &((struct proc *)pMem->u.ResVirt.R0Process)->p_vmspace->vm_map; 87 87 88 88 case RTR0MEMOBJTYPE_MAPPING: 89 89 return pMem->u.Mapping.R0Process == NIL_RTR0PROCESS 90 91 90 ? kernel_map 91 : &((struct proc *)pMem->u.Mapping.R0Process)->p_vmspace->vm_map; 92 92 93 93 default: … … 150 150 151 151 static int rtR0MemObjNativeAllocArea(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, 152 bool fExecutable, RTR0MEMOBJTYPE type, RTHCPHYS PhysHighest, size_t uAlignment)152 bool fExecutable, RTR0MEMOBJTYPE type, RTHCPHYS PhysHighest, size_t uAlignment) 153 153 { 154 154 NOREF(fExecutable); … … 159 159 uint32 addressSpec = B_ANY_KERNEL_ADDRESS; 160 160 uint32 fLock = ~0U; 161 LogFlowFunc(("ppMem=%p cb=%u, fExecutable=%s, type=%08x, PhysHighest=%RX64 uAlignment=%u\n", ppMem, 162 fExecutable ? "true" : "false", type, PhysHighest,(unsigned)uAlignment));161 LogFlowFunc(("ppMem=%p cb=%u, fExecutable=%s, type=%08x, PhysHighest=%RX64 uAlignment=%u\n", ppMem,(unsigned)cb, 162 fExecutable ? "true" : "false", type, PhysHighest,(unsigned)uAlignment)); 163 163 164 164 switch (type) … … 194 194 case RTR0MEMOBJTYPE_LOCK: 195 195 break; 196 #endif 196 #endif 197 197 default: 198 198 return VERR_INTERNAL_ERROR; … … 237 237 } 238 238 239 239 delete_area(pMemHaiku->AreaId); 240 240 } 241 241 … … 277 277 { 278 278 AssertReturn(uCachePolicy == RTMEM_CACHE_POLICY_DONT_CARE, VERR_NOT_SUPPORTED); 279 LogFlowFunc(("ppMem=%p Phys=%08x cb=%u uCachePolicy=%x\n", ppMem, Phys, 279 LogFlowFunc(("ppMem=%p Phys=%08x cb=%u uCachePolicy=%x\n", ppMem, Phys,(unsigned)cb, uCachePolicy)); 280 280 281 281 /* Create the object. */ … … 315 315 316 316 LogFlowFunc(("ppMem=%p pvStart=%p cb=%u fAccess=%x R0Process=%d fFlags=%x\n", ppMem, pvStart, cb, fAccess, R0Process, 317 fFlags));317 fFlags)); 318 318 319 319 /* Create the object. */ … … 365 365 366 366 if (R0Process != NIL_RTR0PROCESS) 367 367 team = (team_id)R0Process; 368 368 369 369 /* Check that the specified alignment is supported. */ 370 370 if (uAlignment > PAGE_SIZE) 371 371 return VERR_NOT_SUPPORTED; 372 372 373 373 /* Create the object. */ 374 374 PRTR0MEMOBJHAIKU pMemHaiku = (PRTR0MEMOBJHAIKU)rtR0MemObjNew(sizeof(*pMemHaiku), RTR0MEMOBJTYPE_RES_VIRT, NULL, cb); 375 375 if (!pMemHaiku) 376 376 return VERR_NO_MEMORY; 377 377 378 378 /* Ask the kernel to reserve the address range. */ … … 410 410 /** @todo r=ramshankar: Wrong format specifiers, fix later! */ 411 411 dprintf("%s(%p, %p, %p, %d, %x, %u, %u)\n", __FUNCTION__, ppMem, pMemToMap, pvFixed, uAlignment, 412 fProt, offSub, cbSub);412 fProt, offSub, cbSub); 413 413 #endif 414 414 /* Check that the specified alignment is supported. */ … … 436 436 rc = area = clone_area("IPRT R0MemObj MapKernel", &pvMap, uAddrSpec, fProtect, pMemToMapHaiku->AreaId); 437 437 LogFlow(("rtR0MemObjNativeMapKernel: clone_area uAddrSpec=%d fProtect=%x AreaId=%d rc=%d\n", uAddrSpec, fProtect, 438 pMemToMapHaiku->AreaId, rc));438 pMemToMapHaiku->AreaId, rc)); 439 439 } 440 440 else if (pMemToMapHaiku->Core.enmType == RTR0MEMOBJTYPE_PHYS) … … 457 457 pMemToMapHaiku->Core.cb); 458 458 if (RT_UNLIKELY(!pMemHaiku)) 459 459 return VERR_NO_MEMORY; 460 460 461 461 pMemHaiku->Core.u.Mapping.R0Process = NIL_RTR0PROCESS; … … 483 483 AssertMsgReturn(R3PtrFixed == (RTR3PTR)-1, ("%p\n", R3PtrFixed), VERR_NOT_SUPPORTED); 484 484 if (uAlignment > PAGE_SIZE) 485 485 return VERR_NOT_SUPPORTED; 486 486 487 487 int rc; … … 493 493 vm_prot_t ProtectionFlags = 0; 494 494 if ((fProt & RTMEM_PROT_NONE) == RTMEM_PROT_NONE) 495 495 ProtectionFlags = VM_PROT_NONE; 496 496 if ((fProt & RTMEM_PROT_READ) == RTMEM_PROT_READ) 497 497 ProtectionFlags |= VM_PROT_READ; 498 498 if ((fProt & RTMEM_PROT_WRITE) == RTMEM_PROT_WRITE) 499 499 ProtectionFlags |= VM_PROT_WRITE; 500 500 if ((fProt & RTMEM_PROT_EXEC) == RTMEM_PROT_EXEC) 501 501 ProtectionFlags |= VM_PROT_EXECUTE; 502 502 503 503 /* calc mapping address */ … … 562 562 */ 563 563 PRTR0MEMOBJHAIKU pMemHaiku = (PRTR0MEMOBJHAIKU)rtR0MemObjNew(sizeof(RTR0MEMOBJHAIKU), 564 565 566 564 RTR0MEMOBJTYPE_MAPPING, 565 (void *)AddrR3, 566 pMemToMap->cb); 567 567 if (pMemHaiku) 568 568 { … … 591 591 PRTR0MEMOBJHAIKU pMemHaiku = (PRTR0MEMOBJHAIKU)pMem; 592 592 status_t rc; 593 593 594 594 /** @todo r=ramshankar: Validate objects */ 595 596 LogFlow(("rtR0MemObjNativeGetPagePhysAddr: pMem=%p enmType=%x iPage=%u\n", pMem, pMemHaiku->Core.enmType, 595 596 LogFlow(("rtR0MemObjNativeGetPagePhysAddr: pMem=%p enmType=%x iPage=%u\n", pMem, pMemHaiku->Core.enmType,(unsigned)iPage)); 597 597 598 598 switch (pMemHaiku->Core.enmType) … … 602 602 team_id TeamId = B_SYSTEM_TEAM; 603 603 physical_entry aPhysMap[2]; 604 int32 cPhysMap = 2; 604 int32 cPhysMap = 2; /** @todo r=ramshankar: why not use RT_ELEMENTS? */ 605 605 606 606 if (pMemHaiku->Core.u.Lock.R0Process != NIL_RTR0PROCESS) … … 643 643 team_id TeamId = B_SYSTEM_TEAM; 644 644 physical_entry aPhysMap[2]; 645 int32 cPhysMap = 2; 645 int32 cPhysMap = 2; /** @todo r=ramshankar: why not use RT_ELEMENTS? */ 646 646 647 647 void *pb = pMemHaiku->Core.pv + (iPage << PAGE_SHIFT); -
trunk/src/VBox/Runtime/r0drv/haiku/semevent-r0drv-haiku.c
r43363 r43366 183 183 if (fFlags & RTSEMWAIT_FLAGS_INDEFINITE) 184 184 timeout = B_INFINITE_TIMEOUT; 185 else { 185 else 186 { 186 187 if (fFlags & RTSEMWAIT_FLAGS_NANOSECS) 187 188 timeout = uTimeout / 1000; -
trunk/src/VBox/Runtime/r0drv/haiku/semfastmutex-r0drv-haiku.c
r43363 r43366 63 63 PRTSEMFASTMUTEXINTERNAL pThis = (PRTSEMFASTMUTEXINTERNAL)RTMemAllocZ(sizeof(*pThis)); 64 64 if (RT_UNLIKELY(!pThis)) 65 65 return VERR_NO_MEMORY; 66 66 67 67 pThis->u32Magic = RTSEMFASTMUTEX_MAGIC; … … 74 74 } 75 75 RTMemFree(pThis); 76 return VERR_TOO_MANY_SEMAPHORES; 76 return VERR_TOO_MANY_SEMAPHORES; /** @todo r=ramshankar: use RTErrConvertFromHaikuKernReturn */ 77 77 } 78 78 -
trunk/src/VBox/Runtime/r0drv/haiku/semmutex-r0drv-haiku.c
r43363 r43366 83 83 } 84 84 RTMemFree(pThis); 85 return VERR_TOO_MANY_SEMAPHORES; 85 return VERR_TOO_MANY_SEMAPHORES; /** @todo r=ramshankar: use RTErrConvertFromHaikuKernReturn */ 86 86 } 87 87 … … 125 125 else 126 126 { 127 127 if (fFlags & RTSEMWAIT_FLAGS_NANOSECS) 128 128 timeout = uTimeout / 1000; 129 129 else if (fFlags & RTSEMWAIT_FLAGS_MILLISECS) -
trunk/src/VBox/Runtime/r0drv/haiku/spinlock-r0drv-haiku.c
r43363 r43366 36 36 #include <iprt/asm.h> 37 37 #if defined(RT_ARCH_AMD64) || defined(RT_ARCH_X86) 38 # 38 #include <iprt/asm-amd64-x86.h> 39 39 #endif 40 40 #include <iprt/err.h> … … 142 142 if (!(Spinlock->fFlags & RTSPINLOCK_FLAGS_INTERRUPT_SAFE)) 143 143 RTAssertMsg2("RTSpinlockReleaseNoInts: p=%p (magic=%#x)\n", Spinlock, Spinlock->u32Magic); 144 RTSpinlockRelease(Spinlock); 144 RTSpinlockRelease(Spinlock); 145 145 } -
trunk/src/VBox/Runtime/r0drv/haiku/the-haiku-kernel.h
r43363 r43366 52 52 extern status_t vm_unreserve_address_range(team_id team, void *address, addr_t size); 53 53 extern status_t vm_reserve_address_range(team_id team, void **_address, uint32 addressSpec, addr_t size, uint32 flags); 54 extern area_id vm_clone_area(team_id team, const char *name, void **address, uint32 addressSpec, uint32 protection,55 uint32 mapping, area_id sourceArea, bool kernel);54 extern area_id vm_clone_area(team_id team, const char *name, void **address, uint32 addressSpec, uint32 protection, 55 uint32 mapping, area_id sourceArea, bool kernel); 56 56 57 57 /* headers/private/kernel/thread_type.h */ … … 62 62 typedef struct 63 63 { 64 int32 flags;// summary of events relevant in interrupt65 66 64 int32 flags; // summary of events relevant in interrupt 65 // handlers (signals pending, user debugging 66 // enabled, etc.) 67 67 #if 0 68 Thread*all_next;69 Thread*team_next;70 Thread *queue_next;/* i.e. run queue, release queue, etc. */71 timeralarm;72 thread_idid;73 charname[B_OS_NAME_LENGTH];74 int32priority;75 int32next_priority;76 int32io_priority;77 int32state;78 int32next_state;68 Thread *all_next; 69 Thread *team_next; 70 Thread *queue_next; /* i.e. run queue, release queue, etc. */ 71 timer alarm; 72 thread_id id; 73 char name[B_OS_NAME_LENGTH]; 74 int32 priority; 75 int32 next_priority; 76 int32 io_priority; 77 int32 state; 78 int32 next_state; 79 79 #endif 80 80 // and a lot more... 81 81 } Thread; 82 82 83 83 /* headers/private/kernel/thread.h */ 84 84 85 extern Thread *thread_get_thread_struct(thread_id id);86 extern Thread *thread_get_thread_struct_locked(thread_id id);85 extern Thread* thread_get_thread_struct(thread_id id); 86 extern Thread* thread_get_thread_struct_locked(thread_id id); 87 87 88 88 extern void thread_yield(bool force); … … 110 110 /* Misc stuff from newer kernels. */ 111 111 #ifndef CALLOUT_FLAG_ABSOLUTE 112 # 112 #define CALLOUT_FLAG_ABSOLUTE 2 113 113 #endif 114 114 #endif … … 126 126 { 127 127 case B_OK: return VINF_SUCCESS; 128 129 130 case B_BAD_THREAD_ID:return VERR_INVALID_PARAMETER;131 132 case B_BAD_TEAM_ID:return VERR_INVALID_PARAMETER;133 134 //default: return VERR_GENERAL_FAILURE;135 /** POSIX Errors are defined as a subset of system errors. */128 case B_BAD_SEM_ID: return VERR_SEM_ERROR; 129 case B_NO_MORE_SEMS: return VERR_TOO_MANY_SEMAPHORES; 130 case B_BAD_THREAD_ID: return VERR_INVALID_PARAMETER; 131 case B_NO_MORE_THREADS: return VERR_MAX_THRDS_REACHED; 132 case B_BAD_TEAM_ID: return VERR_INVALID_PARAMETER; 133 case B_NO_MORE_TEAMS: return VERR_MAX_PROCS_REACHED; 134 //default: return VERR_GENERAL_FAILURE; 135 /** POSIX Errors are defined as a subset of system errors. */ 136 136 default: return RTErrConvertFromErrno(rc); 137 137 } … … 139 139 140 140 #endif /* ___the_haiku_kernel_h */ 141 -
trunk/src/VBox/Runtime/r0drv/haiku/thread-r0drv-haiku.c
r43363 r43366 34 34 35 35 #if defined(RT_ARCH_AMD64) || defined(RT_ARCH_X86) 36 # 36 #include <iprt/asm-amd64-x86.h> 37 37 #endif 38 38 #include <iprt/assert.h> … … 69 69 Assert(hThread == NIL_RTTHREAD); 70 70 71 71 //XXX: can't do this, it might actually be held by another cpu 72 72 //return !B_SPINLOCK_IS_LOCKED(&gThreadSpinlock); 73 73 return ASMIntAreEnabled(); /** @todo find a better way. */ … … 78 78 { 79 79 Assert(hThread == NIL_RTTHREAD); 80 81 80 /** @todo check if Thread::next_priority or 81 * cpu_ent::invoke_scheduler could do. */ 82 82 return false; 83 83 } -
trunk/src/VBox/Runtime/r0drv/haiku/thread2-r0drv-haiku.c
r43363 r43366 34 34 35 35 #if defined(RT_ARCH_AMD64) || defined(RT_ARCH_X86) 36 # 36 #include <iprt/asm-amd64-x86.h> 37 37 #endif 38 38 #include <iprt/assert.h> … … 76 76 } 77 77 78 78 status = set_thread_priority((thread_id)pThread->Core.Key, iPriority); 79 79 80 80 return RTErrConvertFromHaikuKernReturn(status); 81 81 } 82 82 … … 109 109 int rc = rtThreadMain(pThread, (RTNATIVETHREAD)Self, &pThread->szName[0]); 110 110 111 112 113 111 if (rc < 0) 112 return RTErrConvertFromHaikuKernReturn(rc); 113 return rc; 114 114 } 115 115 … … 117 117 int rtThreadNativeCreate(PRTTHREADINT pThreadInt, PRTNATIVETHREAD pNativeThread) 118 118 { 119 119 thread_id NativeThread; 120 120 RT_ASSERT_PREEMPTIBLE(); 121 121 … … 123 123 if (NativeThread >= B_OK) 124 124 { 125 125 resume_thread(NativeThread); 126 126 *pNativeThread = (RTNATIVETHREAD)NativeThread; 127 127 return VINF_SUCCESS; -
trunk/src/VBox/Runtime/r0drv/haiku/time-r0drv-haiku.c
r43363 r43366 39 39 DECLINLINE(uint64_t) rtTimeGetSystemNanoTS(void) 40 40 { 41 41 return system_time() * 1000; 42 42 } 43 43 … … 45 45 DECLINLINE(uint64_t) rtTimeGetSystemMilliTS(void) 46 46 { 47 47 return system_time() / 1000; 48 48 } 49 49
Note:
See TracChangeset
for help on using the changeset viewer.