VirtualBox

Changeset 43366 in vbox


Ignore:
Timestamp:
Sep 20, 2012 12:31:54 PM (12 years ago)
Author:
vboxsync
Message:

Haiku Additions: cleanup, missed file.

Location:
trunk/src/VBox
Files:
17 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/common/VBoxGuest/VBoxGuest-haiku-stubs.c

    r43363 r43366  
    6464#include <iprt/thread.h>
    6565
    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])
    6767
    6868struct vboxguest_module_info *g_VBoxGuest;
    6969
    70 size_t RTLogBackdoorPrintf(const char *pszFormat, ...) {
     70size_t RTLogBackdoorPrintf(const char *pszFormat, ...)
     71{
    7172    va_list args;
    7273    size_t cb;
     
    7879    return cb;
    7980}
    80 size_t RTLogBackdoorPrintfV(const char *pszFormat, va_list args) {
     81size_t RTLogBackdoorPrintfV(const char *pszFormat, va_list args)
     82{
    8183    return g_VBoxGuest->_RTLogBackdoorPrintfV(pszFormat, args);
    8284}
    83 int RTLogSetDefaultInstanceThread(PRTLOGGER pLogger, uintptr_t uKey) {
     85int RTLogSetDefaultInstanceThread(PRTLOGGER pLogger, uintptr_t uKey)
     86{
    8487    return g_VBoxGuest->_RTLogSetDefaultInstanceThread(pLogger, uKey);
    8588}
    86 int RTMemAllocExTag(size_t cb, size_t cbAlignment, uint32_t fFlags, const char *pszTag, void **ppv) {
     89int RTMemAllocExTag(size_t cb, size_t cbAlignment, uint32_t fFlags, const char *pszTag, void **ppv)
     90{
    8791    return g_VBoxGuest->_RTMemAllocExTag(cb, cbAlignment, fFlags, pszTag, ppv);
    8892}
    89 void * RTMemContAlloc(PRTCCPHYS pPhys, size_t cb) {
     93void* RTMemContAlloc(PRTCCPHYS pPhys, size_t cb)
     94{
    9095    return g_VBoxGuest->_RTMemContAlloc(pPhys, cb);
    9196}
    92 void RTMemContFree(void *pv, size_t cb) {
     97void RTMemContFree(void *pv, size_t cb)
     98{
    9399    g_VBoxGuest->_RTMemContFree(pv, cb);
    94100}
    95 void RTMemFreeEx(void *pv, size_t cb) {
     101void RTMemFreeEx(void *pv, size_t cb)
     102{
    96103    g_VBoxGuest->_RTMemFreeEx(pv, cb);
    97104}
    98 bool RTMpIsCpuPossible(RTCPUID idCpu) {
     105bool RTMpIsCpuPossible(RTCPUID idCpu)
     106{
    99107    return g_VBoxGuest->_RTMpIsCpuPossible(idCpu);
    100108}
    101 int RTMpNotificationDeregister(PFNRTMPNOTIFICATION pfnCallback, void *pvUser) {
     109int RTMpNotificationDeregister(PFNRTMPNOTIFICATION pfnCallback, void *pvUser)
     110{
    102111    return g_VBoxGuest->_RTMpNotificationDeregister(pfnCallback, pvUser);
    103112}
    104 int RTMpNotificationRegister(PFNRTMPNOTIFICATION pfnCallback, void *pvUser) {
     113int RTMpNotificationRegister(PFNRTMPNOTIFICATION pfnCallback, void *pvUser)
     114{
    105115    return g_VBoxGuest->_RTMpNotificationRegister(pfnCallback, pvUser);
    106116}
    107 int RTMpOnAll(PFNRTMPWORKER pfnWorker, void *pvUser1, void *pvUser2) {
     117int RTMpOnAll(PFNRTMPWORKER pfnWorker, void *pvUser1, void *pvUser2)
     118{
    108119    return g_VBoxGuest->_RTMpOnAll(pfnWorker, pvUser1, pvUser2);
    109120}
    110 int RTMpOnOthers(PFNRTMPWORKER pfnWorker, void *pvUser1, void *pvUser2) {
     121int RTMpOnOthers(PFNRTMPWORKER pfnWorker, void *pvUser1, void *pvUser2)
     122{
    111123    return g_VBoxGuest->_RTMpOnOthers(pfnWorker, pvUser1, pvUser2);
    112124}
    113 int RTMpOnSpecific(RTCPUID idCpu, PFNRTMPWORKER pfnWorker, void *pvUser1, void *pvUser2) {
     125int RTMpOnSpecific(RTCPUID idCpu, PFNRTMPWORKER pfnWorker, void *pvUser1, void *pvUser2)
     126{
    114127    return g_VBoxGuest->_RTMpOnSpecific(idCpu, pfnWorker, pvUser1, pvUser2);
    115128}
    116 int RTPowerNotificationDeregister(PFNRTPOWERNOTIFICATION pfnCallback, void *pvUser) {
     129int RTPowerNotificationDeregister(PFNRTPOWERNOTIFICATION pfnCallback, void *pvUser)
     130{
    117131    return g_VBoxGuest->_RTPowerNotificationDeregister(pfnCallback, pvUser);
    118132}
    119 int RTPowerNotificationRegister(PFNRTPOWERNOTIFICATION pfnCallback, void *pvUser) {
     133int RTPowerNotificationRegister(PFNRTPOWERNOTIFICATION pfnCallback, void *pvUser)
     134{
    120135    return g_VBoxGuest->_RTPowerNotificationRegister(pfnCallback, pvUser);
    121136}
    122 int RTPowerSignalEvent(RTPOWEREVENT enmEvent) {
     137int RTPowerSignalEvent(RTPOWEREVENT enmEvent)
     138{
    123139    return g_VBoxGuest->_RTPowerSignalEvent(enmEvent);
    124140}
    125 void RTR0AssertPanicSystem(void) {
     141void RTR0AssertPanicSystem(void)
     142{
    126143    g_VBoxGuest->_RTR0AssertPanicSystem();
    127144}
    128 int RTR0Init(unsigned fReserved) {
     145int RTR0Init(unsigned fReserved)
     146{
    129147    return g_VBoxGuest->_RTR0Init(fReserved);
    130148}
    131 void * RTR0MemObjAddress(RTR0MEMOBJ MemObj) {
     149void* RTR0MemObjAddress(RTR0MEMOBJ MemObj)
     150{
    132151    return g_VBoxGuest->_RTR0MemObjAddress(MemObj);
    133152}
    134 RTR3PTR RTR0MemObjAddressR3(RTR0MEMOBJ MemObj) {
     153RTR3PTR RTR0MemObjAddressR3(RTR0MEMOBJ MemObj)
     154{
    135155    return g_VBoxGuest->_RTR0MemObjAddressR3(MemObj);
    136156}
    137 int RTR0MemObjAllocContTag(PRTR0MEMOBJ pMemObj, size_t cb, bool fExecutable, const char *pszTag) {
     157int RTR0MemObjAllocContTag(PRTR0MEMOBJ pMemObj, size_t cb, bool fExecutable, const char *pszTag)
     158{
    138159    return g_VBoxGuest->_RTR0MemObjAllocContTag(pMemObj, cb, fExecutable, pszTag);
    139160}
    140 int RTR0MemObjAllocLowTag(PRTR0MEMOBJ pMemObj, size_t cb, bool fExecutable, const char *pszTag) {
     161int RTR0MemObjAllocLowTag(PRTR0MEMOBJ pMemObj, size_t cb, bool fExecutable, const char *pszTag)
     162{
    141163    return g_VBoxGuest->_RTR0MemObjAllocLowTag(pMemObj, cb, fExecutable, pszTag);
    142164}
    143 int RTR0MemObjAllocPageTag(PRTR0MEMOBJ pMemObj, size_t cb, bool fExecutable, const char *pszTag) {
     165int RTR0MemObjAllocPageTag(PRTR0MEMOBJ pMemObj, size_t cb, bool fExecutable, const char *pszTag)
     166{
    144167    return g_VBoxGuest->_RTR0MemObjAllocPageTag(pMemObj, cb, fExecutable, pszTag);
    145168}
    146 int RTR0MemObjAllocPhysExTag(PRTR0MEMOBJ pMemObj, size_t cb, RTHCPHYS PhysHighest, size_t uAlignment, const char *pszTag) {
     169int RTR0MemObjAllocPhysExTag(PRTR0MEMOBJ pMemObj, size_t cb, RTHCPHYS PhysHighest, size_t uAlignment, const char *pszTag)
     170{
    147171    return g_VBoxGuest->_RTR0MemObjAllocPhysExTag(pMemObj, cb, PhysHighest, uAlignment, pszTag);
    148172}
    149 int RTR0MemObjAllocPhysNCTag(PRTR0MEMOBJ pMemObj, size_t cb, RTHCPHYS PhysHighest, const char *pszTag) {
     173int RTR0MemObjAllocPhysNCTag(PRTR0MEMOBJ pMemObj, size_t cb, RTHCPHYS PhysHighest, const char *pszTag)
     174{
    150175    return g_VBoxGuest->_RTR0MemObjAllocPhysNCTag(pMemObj, cb, PhysHighest, pszTag);
    151176}
    152 int RTR0MemObjAllocPhysTag(PRTR0MEMOBJ pMemObj, size_t cb, RTHCPHYS PhysHighest, const char *pszTag) {
     177int RTR0MemObjAllocPhysTag(PRTR0MEMOBJ pMemObj, size_t cb, RTHCPHYS PhysHighest, const char *pszTag)
     178{
    153179    return g_VBoxGuest->_RTR0MemObjAllocPhysTag(pMemObj, cb, PhysHighest, pszTag);
    154180}
    155 int RTR0MemObjEnterPhysTag(PRTR0MEMOBJ pMemObj, RTHCPHYS Phys, size_t cb, uint32_t uCachePolicy, const char *pszTag) {
     181int RTR0MemObjEnterPhysTag(PRTR0MEMOBJ pMemObj, RTHCPHYS Phys, size_t cb, uint32_t uCachePolicy, const char *pszTag)
     182{
    156183    return g_VBoxGuest->_RTR0MemObjEnterPhysTag(pMemObj, Phys, cb, uCachePolicy, pszTag);
    157184}
    158 int RTR0MemObjFree(RTR0MEMOBJ MemObj, bool fFreeMappings) {
     185int RTR0MemObjFree(RTR0MEMOBJ MemObj, bool fFreeMappings)
     186{
    159187    return g_VBoxGuest->_RTR0MemObjFree(MemObj, fFreeMappings);
    160188}
    161 RTHCPHYS RTR0MemObjGetPagePhysAddr(RTR0MEMOBJ MemObj, size_t iPage) {
     189RTHCPHYS RTR0MemObjGetPagePhysAddr(RTR0MEMOBJ MemObj, size_t iPage)
     190{
    162191    return g_VBoxGuest->_RTR0MemObjGetPagePhysAddr(MemObj, iPage);
    163192}
    164 bool RTR0MemObjIsMapping(RTR0MEMOBJ MemObj) {
     193bool RTR0MemObjIsMapping(RTR0MEMOBJ MemObj)
     194{
    165195    return g_VBoxGuest->_RTR0MemObjIsMapping(MemObj);
    166196}
    167 int RTR0MemObjLockKernelTag(PRTR0MEMOBJ pMemObj, void *pv, size_t cb, uint32_t fAccess, const char *pszTag) {
     197int RTR0MemObjLockKernelTag(PRTR0MEMOBJ pMemObj, void *pv, size_t cb, uint32_t fAccess, const char *pszTag)
     198{
    168199    return g_VBoxGuest->_RTR0MemObjLockKernelTag(pMemObj, pv, cb, fAccess, pszTag);
    169200}
    170 int RTR0MemObjLockUserTag(PRTR0MEMOBJ pMemObj, RTR3PTR R3Ptr, size_t cb, uint32_t fAccess, RTR0PROCESS R0Process, const char *pszTag) {
     201int RTR0MemObjLockUserTag(PRTR0MEMOBJ pMemObj, RTR3PTR R3Ptr, size_t cb, uint32_t fAccess, RTR0PROCESS R0Process, const char *pszTag)
     202{
    171203    return g_VBoxGuest->_RTR0MemObjLockUserTag(pMemObj, R3Ptr, cb, fAccess, R0Process, pszTag);
    172204}
    173 int RTR0MemObjMapKernelExTag(PRTR0MEMOBJ pMemObj, RTR0MEMOBJ MemObjToMap, void *pvFixed, size_t uAlignment, unsigned fProt, size_t offSub, size_t cbSub, const char *pszTag) {
     205int RTR0MemObjMapKernelExTag(PRTR0MEMOBJ pMemObj, RTR0MEMOBJ MemObjToMap, void *pvFixed, size_t uAlignment, unsigned fProt, size_t offSub, size_t cbSub, const char *pszTag)
     206{
    174207    return g_VBoxGuest->_RTR0MemObjMapKernelExTag(pMemObj, MemObjToMap, pvFixed, uAlignment, fProt, offSub, cbSub, pszTag);
    175208}
    176 int RTR0MemObjMapKernelTag(PRTR0MEMOBJ pMemObj, RTR0MEMOBJ MemObjToMap, void *pvFixed, size_t uAlignment, unsigned fProt, const char *pszTag) {
     209int RTR0MemObjMapKernelTag(PRTR0MEMOBJ pMemObj, RTR0MEMOBJ MemObjToMap, void *pvFixed, size_t uAlignment, unsigned fProt, const char *pszTag)
     210{
    177211    return g_VBoxGuest->_RTR0MemObjMapKernelTag(pMemObj, MemObjToMap, pvFixed, uAlignment, fProt, pszTag);
    178212}
    179 int RTR0MemObjMapUserTag(PRTR0MEMOBJ pMemObj, RTR0MEMOBJ MemObjToMap, RTR3PTR R3PtrFixed, size_t uAlignment, unsigned fProt, RTR0PROCESS R0Process, const char *pszTag) {
     213int RTR0MemObjMapUserTag(PRTR0MEMOBJ pMemObj, RTR0MEMOBJ MemObjToMap, RTR3PTR R3PtrFixed, size_t uAlignment, unsigned fProt, RTR0PROCESS R0Process, const char *pszTag)
     214{
    180215    return g_VBoxGuest->_RTR0MemObjMapUserTag(pMemObj, MemObjToMap, R3PtrFixed, uAlignment, fProt, R0Process, pszTag);
    181216}
    182 int RTR0MemObjProtect(RTR0MEMOBJ hMemObj, size_t offSub, size_t cbSub, uint32_t fProt) {
     217int RTR0MemObjProtect(RTR0MEMOBJ hMemObj, size_t offSub, size_t cbSub, uint32_t fProt)
     218{
    183219    return g_VBoxGuest->_RTR0MemObjProtect(hMemObj, offSub, cbSub, fProt);
    184220}
    185 int RTR0MemObjReserveKernelTag(PRTR0MEMOBJ pMemObj, void *pvFixed, size_t cb, size_t uAlignment, const char *pszTag) {
     221int RTR0MemObjReserveKernelTag(PRTR0MEMOBJ pMemObj, void *pvFixed, size_t cb, size_t uAlignment, const char *pszTag)
     222{
    186223    return g_VBoxGuest->_RTR0MemObjReserveKernelTag(pMemObj, pvFixed, cb, uAlignment, pszTag);
    187224}
    188 int RTR0MemObjReserveUserTag(PRTR0MEMOBJ pMemObj, RTR3PTR R3PtrFixed, size_t cb, size_t uAlignment, RTR0PROCESS R0Process, const char *pszTag) {
     225int RTR0MemObjReserveUserTag(PRTR0MEMOBJ pMemObj, RTR3PTR R3PtrFixed, size_t cb, size_t uAlignment, RTR0PROCESS R0Process, const char *pszTag)
     226{
    189227    return g_VBoxGuest->_RTR0MemObjReserveUserTag(pMemObj, R3PtrFixed, cb, uAlignment, R0Process, pszTag);
    190228}
    191 size_t RTR0MemObjSize(RTR0MEMOBJ MemObj) {
     229size_t RTR0MemObjSize(RTR0MEMOBJ MemObj)
     230{
    192231    return g_VBoxGuest->_RTR0MemObjSize(MemObj);
    193232}
    194 RTR0PROCESS RTR0ProcHandleSelf(void) {
     233RTR0PROCESS RTR0ProcHandleSelf(void)
     234{
    195235    return g_VBoxGuest->_RTR0ProcHandleSelf();
    196236}
    197 void RTR0Term(void) {
     237void RTR0Term(void)
     238{
    198239    g_VBoxGuest->_RTR0Term();
    199240}
    200 void RTR0TermForced(void) {
     241void RTR0TermForced(void)
     242{
    201243    g_VBoxGuest->_RTR0TermForced();
    202244}
    203 RTPROCESS RTProcSelf(void) {
    204         return g_VBoxGuest->_RTProcSelf();
    205 }
    206 uint32_t RTSemEventGetResolution(void) {
     245RTPROCESS RTProcSelf(void)
     246{
     247    return g_VBoxGuest->_RTProcSelf();
     248}
     249uint32_t RTSemEventGetResolution(void)
     250{
    207251    return g_VBoxGuest->_RTSemEventGetResolution();
    208252}
    209 uint32_t RTSemEventMultiGetResolution(void) {
     253uint32_t RTSemEventMultiGetResolution(void)
     254{
    210255    return g_VBoxGuest->_RTSemEventMultiGetResolution();
    211256}
    212 int RTSemEventMultiWaitEx(RTSEMEVENTMULTI hEventMultiSem, uint32_t fFlags, uint64_t uTimeout) {
     257int RTSemEventMultiWaitEx(RTSEMEVENTMULTI hEventMultiSem, uint32_t fFlags, uint64_t uTimeout)
     258{
    213259    return g_VBoxGuest->_RTSemEventMultiWaitEx(hEventMultiSem, fFlags, uTimeout);
    214260}
    215 int RTSemEventMultiWaitExDebug(RTSEMEVENTMULTI hEventMultiSem, uint32_t fFlags, uint64_t uTimeout, RTHCUINTPTR uId, RT_SRC_POS_DECL) {
     261int RTSemEventMultiWaitExDebug(RTSEMEVENTMULTI hEventMultiSem, uint32_t fFlags, uint64_t uTimeout, RTHCUINTPTR uId, RT_SRC_POS_DECL)
     262{
    216263    return g_VBoxGuest->_RTSemEventMultiWaitExDebug(hEventMultiSem, fFlags, uTimeout, uId, pszFile, iLine, pszFunction);
    217264}
    218 int RTSemEventWaitEx(RTSEMEVENT hEventSem, uint32_t fFlags, uint64_t uTimeout) {
     265int RTSemEventWaitEx(RTSEMEVENT hEventSem, uint32_t fFlags, uint64_t uTimeout)
     266{
    219267    return g_VBoxGuest->_RTSemEventWaitEx(hEventSem, fFlags, uTimeout);
    220268}
    221 int RTSemEventWaitExDebug(RTSEMEVENT hEventSem, uint32_t fFlags, uint64_t uTimeout, RTHCUINTPTR uId, RT_SRC_POS_DECL) {
     269int RTSemEventWaitExDebug(RTSEMEVENT hEventSem, uint32_t fFlags, uint64_t uTimeout, RTHCUINTPTR uId, RT_SRC_POS_DECL)
     270{
    222271    return g_VBoxGuest->_RTSemEventWaitExDebug(hEventSem, fFlags, uTimeout, uId, pszFile, iLine, pszFunction);
    223272}
    224 bool RTThreadIsInInterrupt(RTTHREAD hThread) {
     273bool RTThreadIsInInterrupt(RTTHREAD hThread)
     274{
    225275    return g_VBoxGuest->_RTThreadIsInInterrupt(hThread);
    226276}
    227 void RTThreadPreemptDisable(PRTTHREADPREEMPTSTATE pState) {
     277void RTThreadPreemptDisable(PRTTHREADPREEMPTSTATE pState)
     278{
    228279    g_VBoxGuest->_RTThreadPreemptDisable(pState);
    229280}
    230 bool RTThreadPreemptIsEnabled(RTTHREAD hThread) {
     281bool RTThreadPreemptIsEnabled(RTTHREAD hThread)
     282{
    231283    return g_VBoxGuest->_RTThreadPreemptIsEnabled(hThread);
    232284}
    233 bool RTThreadPreemptIsPending(RTTHREAD hThread) {
     285bool RTThreadPreemptIsPending(RTTHREAD hThread)
     286{
    234287    return g_VBoxGuest->_RTThreadPreemptIsPending(hThread);
    235288}
    236 bool RTThreadPreemptIsPendingTrusty(void) {
     289bool RTThreadPreemptIsPendingTrusty(void)
     290{
    237291    return g_VBoxGuest->_RTThreadPreemptIsPendingTrusty();
    238292}
    239 bool RTThreadPreemptIsPossible(void) {
     293bool RTThreadPreemptIsPossible(void)
     294{
    240295    return g_VBoxGuest->_RTThreadPreemptIsPossible();
    241296}
    242 void RTThreadPreemptRestore(PRTTHREADPREEMPTSTATE pState) {
     297void RTThreadPreemptRestore(PRTTHREADPREEMPTSTATE pState)
     298{
    243299    g_VBoxGuest->_RTThreadPreemptRestore(pState);
    244300}
    245 uint32_t RTTimerGetSystemGranularity(void) {
     301uint32_t RTTimerGetSystemGranularity(void)
     302{
    246303    return g_VBoxGuest->_RTTimerGetSystemGranularity();
    247304}
    248 int RTTimerReleaseSystemGranularity(uint32_t u32Granted) {
     305int RTTimerReleaseSystemGranularity(uint32_t u32Granted)
     306{
    249307    return g_VBoxGuest->_RTTimerReleaseSystemGranularity(u32Granted);
    250308}
    251 int RTTimerRequestSystemGranularity(uint32_t u32Request, uint32_t *pu32Granted) {
     309int RTTimerRequestSystemGranularity(uint32_t u32Request, uint32_t *pu32Granted)
     310{
    252311    return g_VBoxGuest->_RTTimerRequestSystemGranularity(u32Request, pu32Granted);
    253312}
    254 void RTSpinlockAcquire(RTSPINLOCK Spinlock) {
     313void RTSpinlockAcquire(RTSPINLOCK Spinlock)
     314{
    255315    g_VBoxGuest->_RTSpinlockAcquire(Spinlock);
    256316}
    257 void RTSpinlockRelease(RTSPINLOCK Spinlock) {
     317void RTSpinlockRelease(RTSPINLOCK Spinlock)
     318{
    258319    g_VBoxGuest->_RTSpinlockRelease(Spinlock);
    259320}
    260 void RTSpinlockReleaseNoInts(RTSPINLOCK Spinlock) {
     321void RTSpinlockReleaseNoInts(RTSPINLOCK Spinlock)
     322{
    261323    g_VBoxGuest->_RTSpinlockReleaseNoInts(Spinlock);
    262324}
    263 void * RTMemTmpAllocTag(size_t cb, const char *pszTag) {
     325void* RTMemTmpAllocTag(size_t cb, const char *pszTag)
     326{
    264327    return g_VBoxGuest->_RTMemTmpAllocTag(cb, pszTag);
    265328}
    266 void RTMemTmpFree(void *pv) {
     329void RTMemTmpFree(void *pv)
     330{
    267331    g_VBoxGuest->_RTMemTmpFree(pv);
    268332}
    269 PRTLOGGER RTLogDefaultInstance(void) {
     333PRTLOGGER RTLogDefaultInstance(void)
     334{
    270335    return g_VBoxGuest->_RTLogDefaultInstance();
    271336}
    272 PRTLOGGER RTLogRelDefaultInstance(void) {
     337PRTLOGGER RTLogRelDefaultInstance(void)
     338{
    273339    return g_VBoxGuest->_RTLogRelDefaultInstance();
    274340}
    275 int RTErrConvertToErrno(int iErr) {
     341int RTErrConvertToErrno(int iErr)
     342{
    276343    return g_VBoxGuest->_RTErrConvertToErrno(iErr);
    277344}
    278 int VBoxGuestCommonIOCtl(unsigned iFunction, PVBOXGUESTDEVEXT pDevExt, PVBOXGUESTSESSION pSession, void *pvData, size_t cbData, size_t *pcbDataReturned) {
     345int VBoxGuestCommonIOCtl(unsigned iFunction, PVBOXGUESTDEVEXT pDevExt, PVBOXGUESTSESSION pSession, void *pvData, size_t cbData, size_t *pcbDataReturned)
     346{
    279347    return g_VBoxGuest->_VBoxGuestCommonIOCtl(iFunction, pDevExt, pSession, pvData, cbData, pcbDataReturned);
    280348}
    281 int VBoxGuestCreateUserSession(PVBOXGUESTDEVEXT pDevExt, PVBOXGUESTSESSION *ppSession) {
     349int VBoxGuestCreateUserSession(PVBOXGUESTDEVEXT pDevExt, PVBOXGUESTSESSION *ppSession)
     350{
    282351    return g_VBoxGuest->_VBoxGuestCreateUserSession(pDevExt, ppSession);
    283352}
    284 void VBoxGuestCloseSession(PVBOXGUESTDEVEXT pDevExt, PVBOXGUESTSESSION pSession) {
     353void VBoxGuestCloseSession(PVBOXGUESTDEVEXT pDevExt, PVBOXGUESTSESSION pSession)
     354{
    285355    g_VBoxGuest->_VBoxGuestCloseSession(pDevExt, pSession);
    286356}
    287 void * VBoxGuestIDCOpen(uint32_t *pu32Version) {
     357void* VBoxGuestIDCOpen(uint32_t *pu32Version)
     358{
    288359    return g_VBoxGuest->_VBoxGuestIDCOpen(pu32Version);
    289360}
    290 int VBoxGuestIDCClose(void *pvSession) {
     361int VBoxGuestIDCClose(void *pvSession)
     362{
    291363    return g_VBoxGuest->_VBoxGuestIDCClose(pvSession);
    292364}
    293 int VBoxGuestIDCCall(void *pvSession, unsigned iCmd, void *pvData, size_t cbData, size_t *pcbDataReturned) {
     365int VBoxGuestIDCCall(void *pvSession, unsigned iCmd, void *pvData, size_t cbData, size_t *pcbDataReturned)
     366{
    294367    return g_VBoxGuest->_VBoxGuestIDCCall(pvSession, iCmd, pvData, cbData, pcbDataReturned);
    295368}
    296 void RTAssertMsg1Weak(const char *pszExpr, unsigned uLine, const char *pszFile, const char *pszFunction) {
     369void RTAssertMsg1Weak(const char *pszExpr, unsigned uLine, const char *pszFile, const char *pszFunction)
     370{
    297371    g_VBoxGuest->_RTAssertMsg1Weak(pszExpr, uLine, pszFile, pszFunction);
    298372}
    299 void RTAssertMsg2Weak(const char *pszFormat, ...) {
     373void RTAssertMsg2Weak(const char *pszFormat, ...)
     374{
    300375    va_list va;
    301376    va_start(va, pszFormat);
     
    303378    va_end(va);
    304379}
    305 void RTAssertMsg2WeakV(const char *pszFormat, va_list va) {
     380void RTAssertMsg2WeakV(const char *pszFormat, va_list va)
     381{
    306382    g_VBoxGuest->_RTAssertMsg2WeakV(pszFormat, va);
    307383}
    308 bool RTAssertShouldPanic(void) {
     384bool RTAssertShouldPanic(void)
     385{
    309386    return g_VBoxGuest->_RTAssertShouldPanic();
    310387}
    311 int RTSemFastMutexCreate(PRTSEMFASTMUTEX phFastMtx) {
     388int RTSemFastMutexCreate(PRTSEMFASTMUTEX phFastMtx)
     389{
    312390    return g_VBoxGuest->_RTSemFastMutexCreate(phFastMtx);
    313391}
    314 int RTSemFastMutexDestroy(RTSEMFASTMUTEX hFastMtx) {
     392int RTSemFastMutexDestroy(RTSEMFASTMUTEX hFastMtx)
     393{
    315394    return g_VBoxGuest->_RTSemFastMutexDestroy(hFastMtx);
    316395}
    317 int RTSemFastMutexRelease(RTSEMFASTMUTEX hFastMtx) {
     396int RTSemFastMutexRelease(RTSEMFASTMUTEX hFastMtx)
     397{
    318398    return g_VBoxGuest->_RTSemFastMutexRelease(hFastMtx);
    319399}
    320 int RTSemFastMutexRequest(RTSEMFASTMUTEX hFastMtx) {
     400int RTSemFastMutexRequest(RTSEMFASTMUTEX hFastMtx)
     401{
    321402    return g_VBoxGuest->_RTSemFastMutexRequest(hFastMtx);
    322403}
    323 int RTSemMutexCreate(PRTSEMMUTEX phFastMtx) {
     404int RTSemMutexCreate(PRTSEMMUTEX phFastMtx)
     405{
    324406    return g_VBoxGuest->_RTSemMutexCreate(phFastMtx);
    325407}
    326 int RTSemMutexDestroy(RTSEMMUTEX hFastMtx) {
     408int RTSemMutexDestroy(RTSEMMUTEX hFastMtx)
     409{
    327410    return g_VBoxGuest->_RTSemMutexDestroy(hFastMtx);
    328411}
    329 int RTSemMutexRelease(RTSEMMUTEX hFastMtx) {
     412int RTSemMutexRelease(RTSEMMUTEX hFastMtx)
     413{
    330414    return g_VBoxGuest->_RTSemMutexRelease(hFastMtx);
    331415}
    332 int RTSemMutexRequest(RTSEMMUTEX hFastMtx, RTMSINTERVAL cMillies) {
     416int RTSemMutexRequest(RTSEMMUTEX hFastMtx, RTMSINTERVAL cMillies)
     417{
    333418    return g_VBoxGuest->_RTSemMutexRequest(hFastMtx, cMillies);
    334419}
    335 int RTHeapSimpleRelocate(RTHEAPSIMPLE hHeap, uintptr_t offDelta) {
     420int RTHeapSimpleRelocate(RTHEAPSIMPLE hHeap, uintptr_t offDelta)
     421{
    336422    return g_VBoxGuest->_RTHeapSimpleRelocate(hHeap, offDelta);
    337423}
    338 int RTHeapOffsetInit(PRTHEAPOFFSET phHeap, void *pvMemory, size_t cbMemory) {
     424int RTHeapOffsetInit(PRTHEAPOFFSET phHeap, void *pvMemory, size_t cbMemory)
     425{
    339426    return g_VBoxGuest->_RTHeapOffsetInit(phHeap, pvMemory, cbMemory);
    340427}
    341 int RTHeapSimpleInit(PRTHEAPSIMPLE pHeap, void *pvMemory, size_t cbMemory) {
     428int RTHeapSimpleInit(PRTHEAPSIMPLE pHeap, void *pvMemory, size_t cbMemory)
     429{
    342430    return g_VBoxGuest->_RTHeapSimpleInit(pHeap, pvMemory, cbMemory);
    343431}
    344 void * RTHeapOffsetAlloc(RTHEAPOFFSET hHeap, size_t cb, size_t cbAlignment) {
     432void* RTHeapOffsetAlloc(RTHEAPOFFSET hHeap, size_t cb, size_t cbAlignment)
     433{
    345434    return g_VBoxGuest->_RTHeapOffsetAlloc(hHeap, cb, cbAlignment);
    346435}
    347 void * RTHeapSimpleAlloc(RTHEAPSIMPLE Heap, size_t cb, size_t cbAlignment) {
     436void* RTHeapSimpleAlloc(RTHEAPSIMPLE Heap, size_t cb, size_t cbAlignment)
     437{
    348438    return g_VBoxGuest->_RTHeapSimpleAlloc(Heap, cb, cbAlignment);
    349439}
    350 void RTHeapOffsetFree(RTHEAPOFFSET hHeap, void *pv) {
     440void RTHeapOffsetFree(RTHEAPOFFSET hHeap, void *pv)
     441{
    351442    g_VBoxGuest->_RTHeapOffsetFree(hHeap, pv);
    352443}
    353 void RTHeapSimpleFree(RTHEAPSIMPLE Heap, void *pv) {
     444void RTHeapSimpleFree(RTHEAPSIMPLE Heap, void *pv)
     445{
    354446    g_VBoxGuest->_RTHeapSimpleFree(Heap, pv);
    355447}
  • trunk/src/VBox/Additions/common/VBoxGuest/VBoxGuest-haiku.c

    r43363 r43366  
    105105static pci_module_info *gPCI;
    106106
    107 static struct vboxguest_module_info g_VBoxGuest = {
     107static struct vboxguest_module_info g_VBoxGuest =
     108{
    108109    {
    109110        MODULE_NAME,
     
    111112        std_ops
    112113    },
    113     {0},
    114     {0},
     114    { 0 },
     115    { 0 },
    115116    0,
    116117    RTLogBackdoorPrintf,
     
    224225     */
    225226    if (!ppDev)
    226         return;
     227    return;
    227228    if (strcmp(pszName, "vboxguest") == 0)
    228         iUnit =  -1;
     229    iUnit =  -1;
    229230    else if (dev_stdclone(pszName, NULL, "vboxguest", &iUnit) != 1)
    230         return;
     231    return;
    231232    if (iUnit >= 256)
    232233    {
     
    252253            (*ppDev)->si_flags |= SI_CHEAPCLONE;
    253254            Log(("VBoxGuestHaikuClone: Created *ppDev=%p iUnit=%d si_drv1=%p si_drv2=%p\n",
    254                      *ppDev, iUnit, (*ppDev)->si_drv1, (*ppDev)->si_drv2));
     255                 *ppDev, iUnit, (*ppDev)->si_drv1, (*ppDev)->si_drv2));
    255256            (*ppDev)->si_drv1 = (*ppDev)->si_drv2 = NULL;
    256257        }
    257258        else
    258             Log(("VBoxGuestHaikuClone: make_dev iUnit=%d failed\n", iUnit));
     259        Log(("VBoxGuestHaikuClone: make_dev iUnit=%d failed\n", iUnit));
    259260    }
    260261    else
    261         Log(("VBoxGuestHaikuClone: Existing *ppDev=%p iUnit=%d si_drv1=%p si_drv2=%p\n",
    262              *ppDev, iUnit, (*ppDev)->si_drv1, (*ppDev)->si_drv2));
     262    Log(("VBoxGuestHaikuClone: Existing *ppDev=%p iUnit=%d si_drv1=%p si_drv2=%p\n",
     263         *ppDev, iUnit, (*ppDev)->si_drv1, (*ppDev)->si_drv2));
    263264}
    264265#endif
     
    296297}
    297298
     299
    298300/**
    299301 * Interrupt service routine.
     
    310312    return fOurIRQ ? B_HANDLED_INTERRUPT : B_UNHANDLED_INTERRUPT;
    311313}
     314
    312315
    313316void VBoxGuestNativeISRMousePollEvent(PVBOXGUESTDEVEXT pDevExt)
     
    325328    RTSpinlockAcquire(g_Spinlock);
    326329
    327     if (sState.selectSync) {
     330    if (sState.selectSync)
     331    {
    328332        //dprintf(MODULE_NAME ": isr mouse: notify\n");
    329333        notify_select_event(sState.selectSync, sState.selectEvent);
     
    331335        sState.selectRef = (uint32_t)0;
    332336        sState.selectSync = NULL;
    333     } else
     337    }
     338    else
    334339        err = B_ERROR;
    335340
    336341    RTSpinlockRelease(g_Spinlock);
    337342}
     343
    338344
    339345/**
     
    358364}
    359365
     366
    360367/**
    361368 * Removes IRQ for VMMDev.
     
    369376    remove_io_interrupt_handler(pState->iIrqResId, VBoxGuestHaikuISR, pState);
    370377}
     378
    371379
    372380static status_t VBoxGuestHaikuAttach(const pci_info *pDevice)
     
    376384    int iResId = 0;
    377385    struct VBoxGuestDeviceState *pState = &sState;
    378     static const char * const   s_apszGroups[] = VBOX_LOGGROUP_NAMES;
     386    static const char *const   s_apszGroups[] = VBOX_LOGGROUP_NAMES;
    379387    PRTLOGGER                   pRelLogger;
    380388
     
    387395    if (RT_FAILURE(rc))
    388396    {
    389         /** @todo r=ramshankar: use dprintf here */
     397        /** @todo r=ramshankar: use dprintf here */
    390398        LogFunc(("RTR0Init failed.\n"));
    391399        return ENXIO;
     
    395403    if (RT_FAILURE(rc))
    396404    {
    397         LogRel(("VBoxGuestHaikuAttach: RTSpinlock create failed. rc=%Rrc\n", rc));
    398         return ENXIO;
     405        LogRel(("VBoxGuestHaikuAttach: RTSpinlock create failed. rc=%Rrc\n", rc));
     406        return ENXIO;
    399407    }
    400408
     
    405413     * early failures using the LogRel macro.)
    406414     */
    407     rc = RTLogCreate(&pRelLogger, 0|RTLOGFLAGS_PREFIX_THREAD /* fFlags */, "all",
     415    rc = RTLogCreate(&pRelLogger, 0 | RTLOGFLAGS_PREFIX_THREAD /* fFlags */, "all",
    408416                     "VBOX_RELEASE_LOG", RT_ELEMENTS(s_apszGroups), s_apszGroups,
    409417                     RTLOGDEST_STDOUT | RTLOGDEST_DEBUGGER | RTLOGDEST_USER, NULL);
    410 dprintf(MODULE_NAME ": RTLogCreate: %d\n", rc);
     418    dprintf(MODULE_NAME ": RTLogCreate: %d\n", rc);
    411419    if (RT_SUCCESS(rc))
    412420    {
     
    415423        //RTLogDestinations(pRelLogger, "/var/log/vboxguest.log");
    416424        RTLogRelSetDefaultInstance(pRelLogger);
    417         RTLogSetDefaultInstance(pRelLogger);//XXX
     425        RTLogSetDefaultInstance(pRelLogger); //XXX
    418426    }
    419427#endif
     
    436444        pState->VMMDevMemSize    = pDevice->u.h0.base_register_sizes[1];
    437445        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);
    440448
    441449        if (pState->iVMMDevMemAreaId > 0 && pState->pMMIOBase)
     
    481489}
    482490
     491
    483492static status_t VBoxGuestHaikuProbe(pci_info *pDevice)
    484493{
     
    488497    return ENXIO;
    489498}
     499
    490500
    491501status_t init_module(void)
     
    498508        return ENOSYS;
    499509
    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        {
    502514            // we found it
    503515            status = VBoxGuestHaikuAttach(&info);
     
    509521}
    510522
     523
    511524void uninit_module(void)
    512525{
     
    516529}
    517530
    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
     532static 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,
    534552    NULL
    535553};
     
    537555/* Common code that depend on g_DevExt. */
    538556#include "VBoxGuestIDC-unix.c.h"
     557
  • trunk/src/VBox/Additions/common/VBoxGuest/VBoxGuest-haiku.h

    r43363 r43366  
    101101};
    102102
    103 struct vboxguest_module_info {
     103struct vboxguest_module_info
     104{
    104105    module_info module;
    105106
     
    108109    volatile uint32_t _cUsers;
    109110
    110     size_t (*_RTLogBackdoorPrintf)(const char *pszFormat, ...);
    111     size_t (*_RTLogBackdoorPrintfV)(const char *pszFormat, va_list args);
     111    size_t(*_RTLogBackdoorPrintf)(const char *pszFormat, ...);
     112    size_t(*_RTLogBackdoorPrintfV)(const char *pszFormat, va_list args);
    112113    int (*_RTLogSetDefaultInstanceThread)(PRTLOGGER pLogger, uintptr_t uKey);
    113114    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* (*_RTMemContAlloc)(PRTCCPHYS pPhys, size_t cb);
    115116    void (*_RTMemContFree)(void *pv, size_t cb);
    116117    void (*_RTMemFreeEx)(void *pv, size_t cb);
     
    126127    void (*_RTR0AssertPanicSystem)(void);
    127128    int (*_RTR0Init)(unsigned fReserved);
    128     void * (*_RTR0MemObjAddress)(RTR0MEMOBJ MemObj);
    129     RTR3PTR (*_RTR0MemObjAddressR3)(RTR0MEMOBJ MemObj);
     129    void* (*_RTR0MemObjAddress)(RTR0MEMOBJ MemObj);
     130    RTR3PTR(*_RTR0MemObjAddressR3)(RTR0MEMOBJ MemObj);
    130131    int (*_RTR0MemObjAllocContTag)(PRTR0MEMOBJ pMemObj, size_t cb, bool fExecutable, const char *pszTag);
    131132    int (*_RTR0MemObjAllocLowTag)(PRTR0MEMOBJ pMemObj, size_t cb, bool fExecutable, const char *pszTag);
     
    136137    int (*_RTR0MemObjEnterPhysTag)(PRTR0MEMOBJ pMemObj, RTHCPHYS Phys, size_t cb, uint32_t uCachePolicy, const char *pszTag);
    137138    int (*_RTR0MemObjFree)(RTR0MEMOBJ MemObj, bool fFreeMappings);
    138     RTHCPHYS (*_RTR0MemObjGetPagePhysAddr)(RTR0MEMOBJ MemObj, size_t iPage);
     139    RTHCPHYS(*_RTR0MemObjGetPagePhysAddr)(RTR0MEMOBJ MemObj, size_t iPage);
    139140    bool (*_RTR0MemObjIsMapping)(RTR0MEMOBJ MemObj);
    140141    int (*_RTR0MemObjLockKernelTag)(PRTR0MEMOBJ pMemObj, void *pv, size_t cb, uint32_t fAccess, const char *pszTag);
    141142    int (*_RTR0MemObjLockUserTag)(PRTR0MEMOBJ pMemObj, RTR3PTR R3Ptr, size_t cb, uint32_t fAccess,
    142         RTR0PROCESS R0Process, const char *pszTag);
     143                                  RTR0PROCESS R0Process, const char *pszTag);
    143144    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);
    145146    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);
    147148    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);
    149150    int (*_RTR0MemObjProtect)(RTR0MEMOBJ hMemObj, size_t offSub, size_t cbSub, uint32_t fProt);
    150151    int (*_RTR0MemObjReserveKernelTag)(PRTR0MEMOBJ pMemObj, void *pvFixed, size_t cb, size_t uAlignment, const char *pszTag);
    151152    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);
     153                                     RTR0PROCESS R0Process, const char *pszTag);
     154    size_t(*_RTR0MemObjSize)(RTR0MEMOBJ MemObj);
     155    RTR0PROCESS(*_RTR0ProcHandleSelf)(void);
    155156    void (*_RTR0Term)(void);
    156157    void (*_RTR0TermForced)(void);
    157     RTPROCESS (*_RTProcSelf)(void);
    158     uint32_t (*_RTSemEventGetResolution)(void);
    159     uint32_t (*_RTSemEventMultiGetResolution)(void);
     158    RTPROCESS(*_RTProcSelf)(void);
     159    uint32_t(*_RTSemEventGetResolution)(void);
     160    uint32_t(*_RTSemEventMultiGetResolution)(void);
    160161    int (*_RTSemEventMultiWaitEx)(RTSEMEVENTMULTI hEventMultiSem, uint32_t fFlags, uint64_t uTimeout);
    161162    int (*_RTSemEventMultiWaitExDebug)(RTSEMEVENTMULTI hEventMultiSem, uint32_t fFlags, uint64_t uTimeout,
    162         RTHCUINTPTR uId, RT_SRC_POS_DECL);
     163                                       RTHCUINTPTR uId, RT_SRC_POS_DECL);
    163164    int (*_RTSemEventWaitEx)(RTSEMEVENT hEventSem, uint32_t fFlags, uint64_t uTimeout);
    164165    int (*_RTSemEventWaitExDebug)(RTSEMEVENT hEventSem, uint32_t fFlags, uint64_t uTimeout,
    165         RTHCUINTPTR uId, RT_SRC_POS_DECL);
     166                                  RTHCUINTPTR uId, RT_SRC_POS_DECL);
    166167    bool (*_RTThreadIsInInterrupt)(RTTHREAD hThread);
    167168    void (*_RTThreadPreemptDisable)(PRTTHREADPREEMPTSTATE pState);
     
    171172    bool (*_RTThreadPreemptIsPossible)(void);
    172173    void (*_RTThreadPreemptRestore)(PRTTHREADPREEMPTSTATE pState);
    173     uint32_t (*_RTTimerGetSystemGranularity)(void);
     174    uint32_t(*_RTTimerGetSystemGranularity)(void);
    174175    int (*_RTTimerReleaseSystemGranularity)(uint32_t u32Granted);
    175176    int (*_RTTimerRequestSystemGranularity)(uint32_t u32Request, uint32_t *pu32Granted);
     
    177178    void (*_RTSpinlockRelease)(RTSPINLOCK Spinlock);
    178179    void (*_RTSpinlockReleaseNoInts)(RTSPINLOCK Spinlock);
    179     void * (*_RTMemTmpAllocTag)(size_t cb, const char *pszTag);
     180    void* (*_RTMemTmpAllocTag)(size_t cb, const char *pszTag);
    180181    void (*_RTMemTmpFree)(void *pv);
    181     PRTLOGGER (*_RTLogDefaultInstance)(void);
    182     PRTLOGGER (*_RTLogRelDefaultInstance)(void);
     182    PRTLOGGER(*_RTLogDefaultInstance)(void);
     183    PRTLOGGER(*_RTLogRelDefaultInstance)(void);
    183184    int (*_RTErrConvertToErrno)(int iErr);
    184185    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);
    186187    int (*_VBoxGuestCreateUserSession)(PVBOXGUESTDEVEXT pDevExt, PVBOXGUESTSESSION *ppSession);
    187188    void (*_VBoxGuestCloseSession)(PVBOXGUESTDEVEXT pDevExt, PVBOXGUESTSESSION pSession);
    188     void * (*_VBoxGuestIDCOpen)(uint32_t *pu32Version);
     189    void* (*_VBoxGuestIDCOpen)(uint32_t *pu32Version);
    189190    int (*_VBoxGuestIDCClose)(void *pvSession);
    190191    int (*_VBoxGuestIDCCall)(void *pvSession, unsigned iCmd, void *pvData, size_t cbData, size_t *pcbDataReturned);
     
    204205    int (*_RTHeapOffsetInit)(PRTHEAPOFFSET phHeap, void *pvMemory, size_t cbMemory);
    205206    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);
     207    void* (*_RTHeapOffsetAlloc)(RTHEAPOFFSET hHeap, size_t cb, size_t cbAlignment);
     208    void* (*_RTHeapSimpleAlloc)(RTHEAPSIMPLE Heap, size_t cb, size_t cbAlignment);
    208209    void (*_RTHeapOffsetFree)(RTHEAPOFFSET hHeap, void *pv);
    209210    void (*_RTHeapSimpleFree)(RTHEAPSIMPLE Heap, void *pv);
  • trunk/src/VBox/Additions/haiku/VBoxVideo/driver/driver.cpp

    r43364 r43366  
    7777struct Benaphore
    7878{
    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                 }
     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    }
    107107};
    108108
    109109struct DeviceInfo
    110110{
    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
     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
    117117};
    118118
  • trunk/src/VBox/Runtime/Makefile.kmk

    r43292 r43366  
    950950        generic/RTSystemQueryDmiString-generic.cpp
    951951
     952RuntimeR3_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
    9521009## PORTME: Porters add their selection of platform specific files for Ring-3 here.
    9531010
     
    13191376        iconv \
    13201377        rt
     1378VBoxRT_LIBS.haiku              = \
     1379        iconv
    13211380VBoxRT_LIBS.solaris            = \
    13221381        kstat \
     
    19181977        r0drv/solaris/timer-r0drv-solaris.c
    19191978
     1979RuntimeR0Drv_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
    19202010
    19212011## PORTME: Porters create and add their selection of platform specific Ring-0 Driver files here.
     
    22172307                $(dir) \
    22182308                $(dir)/darwin \
     2309                $(dir)/haiku \
    22192310                $(dir)/l4 \
    22202311                $(dir)/linux \
    22212312                $(dir)/nt \
    22222313                $(dir)/os2 \
     2314                $(dir)/solaris \
    22232315                $(dir)/win \
    22242316                $(dir)/win32 \
  • trunk/src/VBox/Runtime/r0drv/haiku/RTLogWriteDebugger-r0drv-haiku.c

    r43363 r43366  
    3636RTDECL(void) RTLogWriteDebugger(const char *pch, size_t cb)
    3737{
    38         /** @todo implement this */
     38    /** @todo implement this */
    3939    /*kprintf("%.*s", (int)cb, pch);*/
    4040    return;
  • trunk/src/VBox/Runtime/r0drv/haiku/alloc-r0drv-haiku.c

    r43363 r43366  
    5151    if (RT_UNLIKELY(!pHdr))
    5252    {
    53         LogRel(("rtR0MemAllocEx(%u, %#x) failed\n", (unsigned)cb + sizeof(*pHdr), fFlags));
     53        LogRel(("rtR0MemAllocEx(%u, %#x) failed\n",(unsigned)cb + sizeof(*pHdr), fFlags));
    5454        return VERR_NO_MEMORY;
    5555    }
     
    9090    void *pv;
    9191    area_id area = create_area("VirtualBox Contig Alloc", &pv,
    92         B_ANY_KERNEL_ADDRESS, cb, B_32_BIT_CONTIGUOUS,
    93         B_READ_AREA | B_WRITE_AREA);
     92                               B_ANY_KERNEL_ADDRESS, cb, B_32_BIT_CONTIGUOUS,
     93                               B_READ_AREA | B_WRITE_AREA);
    9494
    9595    if (area >= 0)
    9696    {
    97         physical_entry physMap[2];
    98                 if (get_memory_map(pv, cb, physMap, 2) >= B_OK)
    99                 {
    100                 *pPhys = physMap[0].address;
     97        physical_entry physMap[2];
     98        if (get_memory_map(pv, cb, physMap, 2)>= B_OK)
     99        {
     100            *pPhys = physMap[0].address;
    101101            return pv;
    102102        }
    103103        delete_area(area);
    104         AssertMsgFailed(("Cannot get_memory_map for contig alloc! cb=%u\n", (unsigned)cb));
     104        AssertMsgFailed(("Cannot get_memory_map for contig alloc! cb=%u\n",(unsigned)cb));
    105105    }
    106106    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));
    108108    return NULL;
    109109}
     
    119119        area_id area = area_for(pv);
    120120        if (area >= B_OK)
    121                 delete_area(area);
    122                 else
    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));
    124124    }
    125125}
     126
  • trunk/src/VBox/Runtime/r0drv/haiku/initterm-r0drv-haiku.c

    r43363 r43366  
    3939int rtR0InitNative(void)
    4040{
    41         return VINF_SUCCESS;
     41    return VINF_SUCCESS;
    4242}
    4343
  • trunk/src/VBox/Runtime/r0drv/haiku/memobj-r0drv-haiku.c

    r43363 r43366  
    7878        case RTR0MEMOBJTYPE_LOCK:
    7979            return pMem->u.Lock.R0Process == NIL_RTR0PROCESS
    80                 ? kernel_map
    81                 : &((struct proc *)pMem->u.Lock.R0Process)->p_vmspace->vm_map;
     80            ? kernel_map
     81            : &((struct proc *)pMem->u.Lock.R0Process)->p_vmspace->vm_map;
    8282
    8383        case RTR0MEMOBJTYPE_RES_VIRT:
    8484            return pMem->u.ResVirt.R0Process == NIL_RTR0PROCESS
    85                 ? kernel_map
    86                 : &((struct proc *)pMem->u.ResVirt.R0Process)->p_vmspace->vm_map;
     85            ? kernel_map
     86            : &((struct proc *)pMem->u.ResVirt.R0Process)->p_vmspace->vm_map;
    8787
    8888        case RTR0MEMOBJTYPE_MAPPING:
    8989            return pMem->u.Mapping.R0Process == NIL_RTR0PROCESS
    90                 ? kernel_map
    91                 : &((struct proc *)pMem->u.Mapping.R0Process)->p_vmspace->vm_map;
     90            ? kernel_map
     91            : &((struct proc *)pMem->u.Mapping.R0Process)->p_vmspace->vm_map;
    9292
    9393        default:
     
    150150
    151151static 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)
    153153{
    154154    NOREF(fExecutable);
     
    159159    uint32 addressSpec  = B_ANY_KERNEL_ADDRESS;
    160160    uint32 fLock        = ~0U;
    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));
     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));
    163163
    164164    switch (type)
     
    194194        case RTR0MEMOBJTYPE_LOCK:
    195195            break;
    196 #endif       
     196#endif
    197197        default:
    198198            return VERR_INTERNAL_ERROR;
     
    237237        }
    238238
    239            delete_area(pMemHaiku->AreaId);
     239        delete_area(pMemHaiku->AreaId);
    240240    }
    241241
     
    277277{
    278278    AssertReturn(uCachePolicy == RTMEM_CACHE_POLICY_DONT_CARE, VERR_NOT_SUPPORTED);
    279     LogFlowFunc(("ppMem=%p Phys=%08x cb=%u uCachePolicy=%x\n", ppMem, Phys, (unsigned)cb, uCachePolicy));
     279    LogFlowFunc(("ppMem=%p Phys=%08x cb=%u uCachePolicy=%x\n", ppMem, Phys,(unsigned)cb, uCachePolicy));
    280280
    281281    /* Create the object. */
     
    315315
    316316    LogFlowFunc(("ppMem=%p pvStart=%p cb=%u fAccess=%x R0Process=%d fFlags=%x\n", ppMem, pvStart, cb, fAccess, R0Process,
    317                 fFlags));
     317                 fFlags));
    318318
    319319    /* Create the object. */
     
    365365
    366366    if (R0Process != NIL_RTR0PROCESS)
    367         team = (team_id)R0Process;
     367    team = (team_id)R0Process;
    368368
    369369    /* Check that the specified alignment is supported. */
    370370    if (uAlignment > PAGE_SIZE)
    371         return VERR_NOT_SUPPORTED;
     371    return VERR_NOT_SUPPORTED;
    372372
    373373    /* Create the object. */
    374374    PRTR0MEMOBJHAIKU pMemHaiku = (PRTR0MEMOBJHAIKU)rtR0MemObjNew(sizeof(*pMemHaiku), RTR0MEMOBJTYPE_RES_VIRT, NULL, cb);
    375375    if (!pMemHaiku)
    376         return VERR_NO_MEMORY;
     376    return VERR_NO_MEMORY;
    377377
    378378    /* Ask the kernel to reserve the address range. */
     
    410410    /** @todo r=ramshankar: Wrong format specifiers, fix later! */
    411411    dprintf("%s(%p, %p, %p, %d, %x, %u, %u)\n", __FUNCTION__, ppMem, pMemToMap, pvFixed, uAlignment,
    412         fProt, offSub, cbSub);
     412            fProt, offSub, cbSub);
    413413#endif
    414414    /* Check that the specified alignment is supported. */
     
    436436        rc = area = clone_area("IPRT R0MemObj MapKernel", &pvMap, uAddrSpec, fProtect, pMemToMapHaiku->AreaId);
    437437        LogFlow(("rtR0MemObjNativeMapKernel: clone_area uAddrSpec=%d fProtect=%x AreaId=%d rc=%d\n", uAddrSpec, fProtect,
    438                 pMemToMapHaiku->AreaId, rc));
     438                 pMemToMapHaiku->AreaId, rc));
    439439    }
    440440    else if (pMemToMapHaiku->Core.enmType == RTR0MEMOBJTYPE_PHYS)
     
    457457                                                    pMemToMapHaiku->Core.cb);
    458458        if (RT_UNLIKELY(!pMemHaiku))
    459                return VERR_NO_MEMORY;
     459            return VERR_NO_MEMORY;
    460460
    461461        pMemHaiku->Core.u.Mapping.R0Process = NIL_RTR0PROCESS;
     
    483483    AssertMsgReturn(R3PtrFixed == (RTR3PTR)-1, ("%p\n", R3PtrFixed), VERR_NOT_SUPPORTED);
    484484    if (uAlignment > PAGE_SIZE)
    485         return VERR_NOT_SUPPORTED;
     485    return VERR_NOT_SUPPORTED;
    486486
    487487    int                rc;
     
    493493    vm_prot_t       ProtectionFlags = 0;
    494494    if ((fProt & RTMEM_PROT_NONE) == RTMEM_PROT_NONE)
    495         ProtectionFlags = VM_PROT_NONE;
     495    ProtectionFlags = VM_PROT_NONE;
    496496    if ((fProt & RTMEM_PROT_READ) == RTMEM_PROT_READ)
    497         ProtectionFlags |= VM_PROT_READ;
     497    ProtectionFlags |= VM_PROT_READ;
    498498    if ((fProt & RTMEM_PROT_WRITE) == RTMEM_PROT_WRITE)
    499         ProtectionFlags |= VM_PROT_WRITE;
     499    ProtectionFlags |= VM_PROT_WRITE;
    500500    if ((fProt & RTMEM_PROT_EXEC) == RTMEM_PROT_EXEC)
    501         ProtectionFlags |= VM_PROT_EXECUTE;
     501    ProtectionFlags |= VM_PROT_EXECUTE;
    502502
    503503    /* calc mapping address */
     
    562562         */
    563563        PRTR0MEMOBJHAIKU pMemHaiku = (PRTR0MEMOBJHAIKU)rtR0MemObjNew(sizeof(RTR0MEMOBJHAIKU),
    564                                                                            RTR0MEMOBJTYPE_MAPPING,
    565                                                                            (void *)AddrR3,
    566                                                                            pMemToMap->cb);
     564                                                                     RTR0MEMOBJTYPE_MAPPING,
     565                                                                     (void *)AddrR3,
     566                                                                     pMemToMap->cb);
    567567        if (pMemHaiku)
    568568        {
     
    591591    PRTR0MEMOBJHAIKU pMemHaiku = (PRTR0MEMOBJHAIKU)pMem;
    592592    status_t rc;
    593    
     593
    594594    /** @todo r=ramshankar: Validate objects */
    595  
    596     LogFlow(("rtR0MemObjNativeGetPagePhysAddr: pMem=%p enmType=%x iPage=%u\n", pMem, pMemHaiku->Core.enmType, (unsigned)iPage));
     595
     596    LogFlow(("rtR0MemObjNativeGetPagePhysAddr: pMem=%p enmType=%x iPage=%u\n", pMem, pMemHaiku->Core.enmType,(unsigned)iPage));
    597597
    598598    switch (pMemHaiku->Core.enmType)
     
    602602            team_id        TeamId = B_SYSTEM_TEAM;
    603603            physical_entry aPhysMap[2];
    604             int32          cPhysMap = 2;        /** @todo r=ramshankar: why not use RT_ELEMENTS? */
     604            int32          cPhysMap = 2;    /** @todo r=ramshankar: why not use RT_ELEMENTS? */
    605605
    606606            if (pMemHaiku->Core.u.Lock.R0Process != NIL_RTR0PROCESS)
     
    643643            team_id        TeamId = B_SYSTEM_TEAM;
    644644            physical_entry aPhysMap[2];
    645             int32          cPhysMap = 2;        /** @todo r=ramshankar: why not use RT_ELEMENTS? */
     645            int32          cPhysMap = 2;    /** @todo r=ramshankar: why not use RT_ELEMENTS? */
    646646
    647647            void *pb = pMemHaiku->Core.pv + (iPage << PAGE_SHIFT);
  • trunk/src/VBox/Runtime/r0drv/haiku/semevent-r0drv-haiku.c

    r43363 r43366  
    183183    if (fFlags & RTSEMWAIT_FLAGS_INDEFINITE)
    184184        timeout = B_INFINITE_TIMEOUT;
    185     else {
     185    else
     186    {
    186187        if (fFlags & RTSEMWAIT_FLAGS_NANOSECS)
    187188            timeout = uTimeout / 1000;
  • trunk/src/VBox/Runtime/r0drv/haiku/semfastmutex-r0drv-haiku.c

    r43363 r43366  
    6363    PRTSEMFASTMUTEXINTERNAL pThis = (PRTSEMFASTMUTEXINTERNAL)RTMemAllocZ(sizeof(*pThis));
    6464    if (RT_UNLIKELY(!pThis))
    65         return VERR_NO_MEMORY;
     65        return VERR_NO_MEMORY;
    6666
    6767    pThis->u32Magic = RTSEMFASTMUTEX_MAGIC;
     
    7474    }
    7575    RTMemFree(pThis);
    76     return VERR_TOO_MANY_SEMAPHORES;    /** @todo r=ramshankar: use RTErrConvertFromHaikuKernReturn */
     76    return VERR_TOO_MANY_SEMAPHORES;    /** @todo r=ramshankar: use RTErrConvertFromHaikuKernReturn */
    7777}
    7878
  • trunk/src/VBox/Runtime/r0drv/haiku/semmutex-r0drv-haiku.c

    r43363 r43366  
    8383    }
    8484    RTMemFree(pThis);
    85     return VERR_TOO_MANY_SEMAPHORES;    /** @todo r=ramshankar: use RTErrConvertFromHaikuKernReturn */
     85    return VERR_TOO_MANY_SEMAPHORES;    /** @todo r=ramshankar: use RTErrConvertFromHaikuKernReturn */
    8686}
    8787
     
    125125    else
    126126    {
    127         if (fFlags & RTSEMWAIT_FLAGS_NANOSECS)
     127        if (fFlags & RTSEMWAIT_FLAGS_NANOSECS)
    128128            timeout = uTimeout / 1000;
    129129        else if (fFlags & RTSEMWAIT_FLAGS_MILLISECS)
  • trunk/src/VBox/Runtime/r0drv/haiku/spinlock-r0drv-haiku.c

    r43363 r43366  
    3636#include <iprt/asm.h>
    3737#if defined(RT_ARCH_AMD64) || defined(RT_ARCH_X86)
    38 # include <iprt/asm-amd64-x86.h>
     38#include <iprt/asm-amd64-x86.h>
    3939#endif
    4040#include <iprt/err.h>
     
    142142    if (!(Spinlock->fFlags & RTSPINLOCK_FLAGS_INTERRUPT_SAFE))
    143143        RTAssertMsg2("RTSpinlockReleaseNoInts: p=%p (magic=%#x)\n", Spinlock, Spinlock->u32Magic);
    144     RTSpinlockRelease(Spinlock); 
     144    RTSpinlockRelease(Spinlock);
    145145}
  • trunk/src/VBox/Runtime/r0drv/haiku/the-haiku-kernel.h

    r43363 r43366  
    5252extern status_t vm_unreserve_address_range(team_id team, void *address, addr_t size);
    5353extern 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);
     54extern 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);
    5656
    5757/* headers/private/kernel/thread_type.h */
     
    6262typedef struct
    6363{
    64         int32                   flags;                  // summary of events relevant in interrupt
    65                                                                         // handlers (signals pending, user debugging
    66                                                                         // enabled, etc.)
     64    int32            flags;            // summary of events relevant in interrupt
     65                                       // handlers (signals pending, user debugging
     66                                       // enabled, etc.)
    6767#if 0
    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;
     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;
    7979#endif
    80         // and a lot more...
     80    // and a lot more...
    8181} Thread;
    8282
    8383/* headers/private/kernel/thread.h */
    8484
    85 extern Thread *thread_get_thread_struct(thread_id id);
    86 extern Thread *thread_get_thread_struct_locked(thread_id id);
     85extern Thread* thread_get_thread_struct(thread_id id);
     86extern Thread* thread_get_thread_struct_locked(thread_id id);
    8787
    8888extern void thread_yield(bool force);
     
    110110/* Misc stuff from newer kernels. */
    111111#ifndef CALLOUT_FLAG_ABSOLUTE
    112 # define CALLOUT_FLAG_ABSOLUTE 2
     112#define CALLOUT_FLAG_ABSOLUTE 2
    113113#endif
    114114#endif
     
    126126    {
    127127        case B_OK:               return VINF_SUCCESS;
    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. */
     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. */
    136136        default:                 return RTErrConvertFromErrno(rc);
    137137    }
     
    139139
    140140#endif /* ___the_haiku_kernel_h */
     141
  • trunk/src/VBox/Runtime/r0drv/haiku/thread-r0drv-haiku.c

    r43363 r43366  
    3434
    3535#if defined(RT_ARCH_AMD64) || defined(RT_ARCH_X86)
    36 # include <iprt/asm-amd64-x86.h>
     36#include <iprt/asm-amd64-x86.h>
    3737#endif
    3838#include <iprt/assert.h>
     
    6969    Assert(hThread == NIL_RTTHREAD);
    7070
    71         //XXX: can't do this, it might actually be held by another cpu
     71    //XXX: can't do this, it might actually be held by another cpu
    7272    //return !B_SPINLOCK_IS_LOCKED(&gThreadSpinlock);
    7373    return ASMIntAreEnabled(); /** @todo find a better way. */
     
    7878{
    7979    Assert(hThread == NIL_RTTHREAD);
    80         /** @todo check if Thread::next_priority or
    81         *        cpu_ent::invoke_scheduler could do. */
     80    /** @todo check if Thread::next_priority or
     81    *        cpu_ent::invoke_scheduler could do. */
    8282    return false;
    8383}
  • trunk/src/VBox/Runtime/r0drv/haiku/thread2-r0drv-haiku.c

    r43363 r43366  
    3434
    3535#if defined(RT_ARCH_AMD64) || defined(RT_ARCH_X86)
    36 # include <iprt/asm-amd64-x86.h>
     36#include <iprt/asm-amd64-x86.h>
    3737#endif
    3838#include <iprt/assert.h>
     
    7676    }
    7777
    78         status = set_thread_priority((thread_id)pThread->Core.Key, iPriority);
     78    status = set_thread_priority((thread_id)pThread->Core.Key, iPriority);
    7979
    80         return RTErrConvertFromHaikuKernReturn(status);
     80    return RTErrConvertFromHaikuKernReturn(status);
    8181}
    8282
     
    109109    int rc = rtThreadMain(pThread, (RTNATIVETHREAD)Self, &pThread->szName[0]);
    110110
    111         if (rc < 0)
    112                 return RTErrConvertFromHaikuKernReturn(rc);
    113         return rc;
     111    if (rc < 0)
     112        return RTErrConvertFromHaikuKernReturn(rc);
     113    return rc;
    114114}
    115115
     
    117117int rtThreadNativeCreate(PRTTHREADINT pThreadInt, PRTNATIVETHREAD pNativeThread)
    118118{
    119         thread_id NativeThread;
     119    thread_id NativeThread;
    120120    RT_ASSERT_PREEMPTIBLE();
    121121
     
    123123    if (NativeThread >= B_OK)
    124124    {
    125         resume_thread(NativeThread);
     125        resume_thread(NativeThread);
    126126        *pNativeThread = (RTNATIVETHREAD)NativeThread;
    127127        return VINF_SUCCESS;
  • trunk/src/VBox/Runtime/r0drv/haiku/time-r0drv-haiku.c

    r43363 r43366  
    3939DECLINLINE(uint64_t) rtTimeGetSystemNanoTS(void)
    4040{
    41         return system_time() * 1000;
     41    return system_time() * 1000;
    4242}
    4343
     
    4545DECLINLINE(uint64_t) rtTimeGetSystemMilliTS(void)
    4646{
    47         return system_time() / 1000;
     47    return system_time() / 1000;
    4848}
    4949
Note: See TracChangeset for help on using the changeset viewer.

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