VirtualBox

Changeset 22073 in vbox


Ignore:
Timestamp:
Aug 7, 2009 3:26:56 PM (16 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
50819
Message:

iprt/r0drv/solaris: context assertions (RT_MORE_STRICT).

Location:
trunk/src/VBox/Runtime/r0drv/solaris
Files:
29 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/r0drv/solaris/RTLogWriteDebugger-r0drv-solaris.c

    • Property svn:keywords set to Author Date Id Revision
    r21292 r22073  
    2929 */
    3030
     31
     32/*******************************************************************************
     33*   Header Files                                                               *
     34*******************************************************************************/
    3135#include "the-solaris-kernel.h"
     36#include "internal/iprt.h"
    3237#include <iprt/log.h>
     38
    3339#include <iprt/assert.h>
     40
    3441
    3542
  • trunk/src/VBox/Runtime/r0drv/solaris/RTMpPokeCpu-r0drv-solaris.c

    r19501 r22073  
    3434*******************************************************************************/
    3535#include "the-solaris-kernel.h"
     36#include "internal/iprt.h"
    3637#include <iprt/mp.h>
     38
     39#include <iprt/asm.h>
    3740#include <iprt/err.h>
    3841
     
    4144RTDECL(int) RTMpPokeCpu(RTCPUID idCpu)
    4245{
     46    RT_ASSERT_INTS_ON();
    4347    if (idCpu >= RTMpGetCount())
    4448        return VERR_CPU_NOT_FOUND;
  • trunk/src/VBox/Runtime/r0drv/solaris/alloc-r0drv-solaris.c

    • Property svn:keywords changed from Id to Author Date Id Revision
    r8245 r22073  
    3434*******************************************************************************/
    3535#include "the-solaris-kernel.h"
     36#include "internal/iprt.h"
     37#include <iprt/mem.h>
    3638
    37 #include <iprt/alloc.h>
    3839#include <iprt/assert.h>
    39 #include <iprt/types.h>
    4040#include <iprt/param.h>
     41#include <iprt/thread.h>
    4142#include "r0drv/alloc-r0drv.h"
    4243
     
    9394    AssertPtr(pPhys);
    9495    Assert(cb > 0);
     96    RT_ASSERT_PREEMPTIBLE();
    9597
    9698    /* Allocate physically contiguous page-aligned memory. */
     
    108110{
    109111    NOREF(cb);
     112    RT_ASSERT_PREEMPTIBLE();
    110113    if (pv)
    111114        i_ddi_mem_free(pv, NULL);
  • trunk/src/VBox/Runtime/r0drv/solaris/assert-r0drv-solaris.c

    • Property svn:keywords changed from Id to Author Date Id Revision
    r13314 r22073  
    3434*******************************************************************************/
    3535#include "the-solaris-kernel.h"
     36#include "internal/iprt.h"
     37#include <iprt/assert.h>
    3638
    37 #include <iprt/assert.h>
     39#include <iprt/asm.h>
    3840#include <iprt/log.h>
     41#include <iprt/stdarg.h>
    3942#include <iprt/string.h>
    40 #include <iprt/stdarg.h>
    41 #include <iprt/asm.h>
    4243
    4344
  • trunk/src/VBox/Runtime/r0drv/solaris/initterm-r0drv-solaris.c

    • Property svn:keywords changed from Id to Author Date Id Revision
    r8245 r22073  
    3434*******************************************************************************/
    3535#include "the-solaris-kernel.h"
     36#include "internal/iprt.h"
     37
    3638#include <iprt/err.h>
    37 #include <iprt/assert.h>
    3839#include "internal/initterm.h"
    3940
    40 
    41 /*******************************************************************************
    42 *   Internal Functions                                                         *
    43 *******************************************************************************/
    4441
    4542
     
    5350{
    5451}
     52
  • trunk/src/VBox/Runtime/r0drv/solaris/memobj-r0drv-solaris.c

    • Property svn:keywords changed from Id to Author Date Id Revision
    r21621 r22073  
    3434*******************************************************************************/
    3535#include "the-solaris-kernel.h"
    36 
     36#include "internal/iprt.h"
    3737#include <iprt/memobj.h>
     38
     39#include <iprt/assert.h>
     40#include <iprt/err.h>
     41#include <iprt/log.h>
    3842#include <iprt/mem.h>
    39 #include <iprt/err.h>
    40 #include <iprt/assert.h>
    41 #include <iprt/log.h>
    4243#include <iprt/param.h>
    4344#include <iprt/process.h>
     
    6162} RTR0MEMOBJSOLARIS, *PRTR0MEMOBJSOLARIS;
    6263
     64
     65/*******************************************************************************
     66*   Global Variables                                                           *
     67*******************************************************************************/
    6368/**
    6469 * Used for supplying the solaris kernel info. about memory limits
     
    8085    0                       /* bus-specific flags */
    8186};
     87
    8288
    8389
  • trunk/src/VBox/Runtime/r0drv/solaris/memuserkernel-r0drv-solaris.c

    r21284 r22073  
    3434*******************************************************************************/
    3535#include "the-solaris-kernel.h"
     36#include "internal/iprt.h"
     37#include <iprt/mem.h>
    3638
    37 #include <iprt/mem.h>
     39#include <iprt/asm.h>
     40#include <iprt/assert.h>
    3841#include <iprt/err.h>
    3942
     
    4144RTR0DECL(int) RTR0MemUserCopyFrom(void *pvDst, RTR3PTR R3PtrSrc, size_t cb)
    4245{
    43     int rc = ddi_copyin((const char *)R3PtrSrc, pvDst, cb, 0 /*flags*/);
     46    int rc;
     47    RT_ASSERT_INTS_ON();
     48
     49    rc = ddi_copyin((const char *)R3PtrSrc, pvDst, cb, 0 /*flags*/);
    4450    if (RT_LIKELY(rc == 0))
    4551        return VINF_SUCCESS;
     
    5056RTR0DECL(int) RTR0MemUserCopyTo(RTR3PTR R3PtrDst, void const *pvSrc, size_t cb)
    5157{
    52     int rc = ddi_copyout(pvSrc, (void *)R3PtrDst, cb, 0 /*flags*/);
     58    int rc;
     59    RT_ASSERT_INTS_ON();
     60
     61    rc = ddi_copyout(pvSrc, (void *)R3PtrDst, cb, 0 /*flags*/);
    5362    if (RT_LIKELY(rc == 0))
    5463        return VINF_SUCCESS;
  • trunk/src/VBox/Runtime/r0drv/solaris/mp-r0drv-solaris.c

    r19391 r22073  
    3434*******************************************************************************/
    3535#include "the-solaris-kernel.h"
    36 
     36#include "internal/iprt.h"
    3737#include <iprt/mp.h>
     38
     39#include <iprt/asm.h>
    3840#include <iprt/cpuset.h>
    3941#include <iprt/err.h>
    40 #include <iprt/asm.h>
    4142#include "r0drv/mp-r0drv.h"
     43
    4244
    4345
     
    156158    cpuset_t Set;
    157159    RTMPARGS Args;
     160    RT_ASSERT_INTS_ON();
    158161
    159162    Args.pfnWorker = pfnWorker;
     
    201204    cpuset_t Set;
    202205    RTMPARGS Args;
    203 
    204     /* The caller should disable preemption, but take no chances.*/
     206    RT_ASSERT_INTS_ON();
     207
     208    /* The caller should disable preemption, but take no chances. */
    205209    kpreempt_disable();
    206210
     
    249253    cpuset_t Set;
    250254    RTMPARGS Args;
     255    RT_ASSERT_INTS_ON();
    251256
    252257    if (idCpu >= NCPU)
  • trunk/src/VBox/Runtime/r0drv/solaris/mpnotification-r0drv-solaris.c

    r11982 r22073  
    2929 */
    3030
     31
    3132/*******************************************************************************
    3233*   Header Files                                                               *
    3334*******************************************************************************/
    3435#include "the-solaris-kernel.h"
     36#include "internal/iprt.h"
     37#include <iprt/mp.h>
    3538
    36 #include <iprt/err.h>
    37 #include <iprt/mp.h>
    3839#include <iprt/err.h>
    3940#include "r0drv/mp-r0drv.h"
  • trunk/src/VBox/Runtime/r0drv/solaris/process-r0drv-solaris.c

    • Property svn:keywords changed from Id to Author Date Id Revision
    r19338 r22073  
    3333*******************************************************************************/
    3434#include "the-solaris-kernel.h"
    35 
     35#include "internal/iprt.h"
    3636#include <iprt/process.h>
    3737
  • trunk/src/VBox/Runtime/r0drv/solaris/semevent-r0drv-solaris.c

    • Property svn:keywords changed from Id to Author Date Id Revision
    r22052 r22073  
    3737#include <iprt/semaphore.h>
    3838
    39 #include <iprt/alloc.h>
    4039#include <iprt/assert.h>
    4140#include <iprt/asm.h>
    4241#include <iprt/err.h>
     42#include <iprt/mem.h>
    4343#include <iprt/mp.h>
    4444#include <iprt/thread.h>
     
    6969
    7070
     71
    7172RTDECL(int)  RTSemEventCreate(PRTSEMEVENT pEventSem)
    7273{
    7374    Assert(sizeof(RTSEMEVENTINTERNAL) > sizeof(void *));
    7475    AssertPtrReturn(pEventSem, VERR_INVALID_POINTER);
     76    RT_ASSERT_PREEMPTIBLE();
    7577
    7678    PRTSEMEVENTINTERNAL pEventInt = (PRTSEMEVENTINTERNAL)RTMemAlloc(sizeof(*pEventInt));
     
    163165                    ("pEventInt=%p u32Magic=%#x\n", pEventInt, pEventInt->u32Magic),
    164166                    VERR_INVALID_HANDLE);
    165     RT_ASSERT_PREEMPTIBLE();
     167    if (cMillies)
     168        RT_ASSERT_PREEMPTIBLE();
    166169
    167170    mutex_enter(&pEventInt->Mtx);
     
    173176        rc = VINF_SUCCESS;
    174177    }
     178    else if (!cMillies)
     179        rc = VERR_TIMEOUT;
    175180    else
    176181    {
  • trunk/src/VBox/Runtime/r0drv/solaris/semeventmulti-r0drv-solaris.c

    • Property svn:keywords changed from Id to Author Date Id Revision
    r20793 r22073  
    3434*******************************************************************************/
    3535#include "the-solaris-kernel.h"
    36 
     36#include "internal/iprt.h"
    3737#include <iprt/semaphore.h>
    38 #include <iprt/alloc.h>
     38
     39#include <iprt/assert.h>
    3940#include <iprt/asm.h>
    40 #include <iprt/assert.h>
    4141#include <iprt/err.h>
    42 
     42#include <iprt/mem.h>
     43#include <iprt/mp.h>
     44#include <iprt/thread.h>
    4345#include "internal/magics.h"
    4446
     
    6769
    6870
     71
    6972RTDECL(int)  RTSemEventMultiCreate(PRTSEMEVENTMULTI pEventMultiSem)
    7073{
    7174    Assert(sizeof(RTSEMEVENTMULTIINTERNAL) > sizeof(void *));
    7275    AssertPtrReturn(pEventMultiSem, VERR_INVALID_POINTER);
     76    RT_ASSERT_PREEMPTIBLE();
    7377
    7478    PRTSEMEVENTMULTIINTERNAL pThis = (PRTSEMEVENTMULTIINTERNAL)RTMemAlloc(sizeof(*pThis));
     
    97101                    ("pThis=%p u32Magic=%#x\n", pThis, pThis->u32Magic),
    98102                    VERR_INVALID_HANDLE);
     103    RT_ASSERT_INTS_ON();
    99104
    100105    mutex_enter(&pThis->Mtx);
     
    125130{
    126131    PRTSEMEVENTMULTIINTERNAL pThis = (PRTSEMEVENTMULTIINTERNAL)EventMultiSem;
    127     AssertPtrReturn(pThis, VERR_INVALID_HANDLE);
    128     AssertMsgReturn(pThis->u32Magic == RTSEMEVENTMULTI_MAGIC,
    129                     ("pThis=%p u32Magic=%#x\n", pThis, pThis->u32Magic),
    130                     VERR_INVALID_HANDLE);
     132    RT_ASSERT_PREEMPT_CPUID_VAR();
     133
     134    AssertPtrReturn(pThis, VERR_INVALID_HANDLE);
     135    AssertMsgReturn(pThis->u32Magic == RTSEMEVENTMULTI_MAGIC,
     136                    ("pThis=%p u32Magic=%#x\n", pThis, pThis->u32Magic),
     137                    VERR_INVALID_HANDLE);
     138    RT_ASSERT_INTS_ON();
    131139
    132140    mutex_enter(&pThis->Mtx);
     
    141149
    142150    mutex_exit(&pThis->Mtx);
     151
     152    RT_ASSERT_PREEMPT_CPUID();
    143153    return VINF_SUCCESS;
    144154}
     
    148158{
    149159    PRTSEMEVENTMULTIINTERNAL pThis = (PRTSEMEVENTMULTIINTERNAL)EventMultiSem;
    150     AssertPtrReturn(pThis, VERR_INVALID_HANDLE);
    151     AssertMsgReturn(pThis->u32Magic == RTSEMEVENTMULTI_MAGIC,
    152                     ("pThis=%p u32Magic=%#x\n", pThis, pThis->u32Magic),
    153                     VERR_INVALID_HANDLE);
     160    RT_ASSERT_PREEMPT_CPUID_VAR();
     161
     162    AssertPtrReturn(pThis, VERR_INVALID_HANDLE);
     163    AssertMsgReturn(pThis->u32Magic == RTSEMEVENTMULTI_MAGIC,
     164                    ("pThis=%p u32Magic=%#x\n", pThis, pThis->u32Magic),
     165                    VERR_INVALID_HANDLE);
     166    RT_ASSERT_INTS_ON();
    154167
    155168    mutex_enter(&pThis->Mtx);
    156169    ASMAtomicXchgU8(&pThis->fSignaled, false);
    157170    mutex_exit(&pThis->Mtx);
     171
     172    RT_ASSERT_PREEMPT_CPUID();
    158173    return VINF_SUCCESS;
    159174}
     
    168183                    ("pThis=%p u32Magic=%#x\n", pThis, pThis->u32Magic),
    169184                    VERR_INVALID_HANDLE);
     185    if (cMillies)
     186        RT_ASSERT_PREEMPTIBLE();
    170187
    171188    mutex_enter(&pThis->Mtx);
     
    173190    if (pThis->fSignaled)
    174191        rc = VINF_SUCCESS;
     192    else if (!cMillies)
     193        rc = VERR_TIMEOUT;
    175194    else
    176195    {
  • trunk/src/VBox/Runtime/r0drv/solaris/semfastmutex-r0drv-solaris.c

    • Property svn:keywords changed from Id to Author Date Id Revision
    r16200 r22073  
    3434*******************************************************************************/
    3535#include "the-solaris-kernel.h"
     36#include "internal/iprt.h"
     37#include <iprt/semaphore.h>
    3638
    37 #include <iprt/semaphore.h>
     39#include <iprt/asm.h>
     40#include <iprt/assert.h>
    3841#include <iprt/err.h>
    39 #include <iprt/alloc.h>
    40 #include <iprt/assert.h>
    41 #include <iprt/asm.h>
    42 
     42#include <iprt/mem.h>
     43#include <iprt/thread.h>
    4344#include "internal/magics.h"
    4445
     
    5960
    6061
     62
    6163RTDECL(int)  RTSemFastMutexCreate(PRTSEMFASTMUTEX pMutexSem)
    6264{
    6365    AssertCompile(sizeof(RTSEMFASTMUTEXINTERNAL) > sizeof(void *));
    6466    AssertPtrReturn(pMutexSem, VERR_INVALID_POINTER);
     67    RT_ASSERT_PREEMPTIBLE();
    6568
    6669    PRTSEMFASTMUTEXINTERNAL pFastInt = (PRTSEMFASTMUTEXINTERNAL)RTMemAlloc(sizeof(*pFastInt));
     
    8588                    ("pFastInt->u32Magic=%RX32 pFastInt=%p\n", pFastInt->u32Magic, pFastInt),
    8689                    VERR_INVALID_PARAMETER);
     90    RT_ASSERT_INTS_ON();
    8791
    8892    ASMAtomicXchgU32(&pFastInt->u32Magic, RTSEMFASTMUTEX_MAGIC_DEAD);
     
    101105                    ("pFastInt->u32Magic=%RX32 pFastInt=%p\n", pFastInt->u32Magic, pFastInt),
    102106                    VERR_INVALID_PARAMETER);
     107    RT_ASSERT_PREEMPTIBLE();
    103108
    104109    rw_enter(&pFastInt->Mtx, RW_WRITER);
     
    114119                    ("pFastInt->u32Magic=%RX32 pFastInt=%p\n", pFastInt->u32Magic, pFastInt),
    115120                    VERR_INVALID_PARAMETER);
     121    RT_ASSERT_INTS_ON();
    116122
    117123    rw_exit(&pFastInt->Mtx);
  • trunk/src/VBox/Runtime/r0drv/solaris/spinlock-r0drv-solaris.c

    • Property svn:keywords changed from Id to Author Date Id Revision
    r20793 r22073  
    2929 */
    3030
     31
    3132/*******************************************************************************
    3233*   Header Files                                                               *
    3334*******************************************************************************/
    3435#include "the-solaris-kernel.h"
     36#include "internal/iprt.h"
     37#include <iprt/spinlock.h>
    3538
    36 #include <iprt/spinlock.h>
     39#include <iprt/asm.h>
     40#include <iprt/assert.h>
    3741#include <iprt/err.h>
    38 #include <iprt/alloc.h>
    39 #include <iprt/assert.h>
    40 #include <iprt/asm.h>
    41 
     42#include <iprt/mem.h>
     43#include <iprt/thread.h>
    4244#include "internal/magics.h"
    4345
     
    5860
    5961
     62
    6063RTDECL(int)  RTSpinlockCreate(PRTSPINLOCK pSpinlock)
    6164{
     
    6366     * Allocate.
    6467     */
     68    RT_ASSERT_PREEMPTIBLE();
    6569    AssertCompile(sizeof(RTSPINLOCKINTERNAL) > sizeof(void *));
    6670    PRTSPINLOCKINTERNAL pSpinlockInt = (PRTSPINLOCKINTERNAL)RTMemAlloc(sizeof(*pSpinlockInt));
     
    8387     * Validate input.
    8488     */
     89    RT_ASSERT_INTS_ON();
    8590    PRTSPINLOCKINTERNAL pSpinlockInt = (PRTSPINLOCKINTERNAL)Spinlock;
    8691    if (!pSpinlockInt)
     
    107112    NOREF(pTmp);
    108113
     114    /** @todo r=bird: are interrupts disabled implicitly by mutex_enter?!? */
    109115    mutex_enter(&pSpinlockInt->Mtx);
    110116}
  • trunk/src/VBox/Runtime/r0drv/solaris/thread-r0drv-solaris.c

    • Property svn:keywords changed from Id to Author Date Id Revision
    r21595 r22073  
    3434*******************************************************************************/
    3535#include "the-solaris-kernel.h"
     36#include "internal/iprt.h"
     37#include <iprt/thread.h>
    3638
    37 #include <iprt/thread.h>
    3839#include <iprt/asm.h>
    3940#include <iprt/assert.h>
    4041#include <iprt/err.h>
     42
    4143
    4244
     
    5153    clock_t cTicks;
    5254    unsigned long timeout;
     55    RT_ASSERT_PREEMPTIBLE();
    5356
    5457    if (!cMillies)
     
    9699RTDECL(bool) RTThreadYield(void)
    97100{
    98     schedctl_set_yield(curthread, 0);
     101    RT_ASSERT_PREEMPTIBLE();
     102    schedctl_set_yield(curthread, 0); /** @todo this is incomplete/wrong. */
    99103    return true;
    100104}
  • trunk/src/VBox/Runtime/r0drv/solaris/thread2-r0drv-solaris.c

    • Property svn:keywords changed from Id to Author Date Id Revision
    r19355 r22073  
    2929 */
    3030
     31
    3132/*******************************************************************************
    3233*   Header Files                                                               *
    3334*******************************************************************************/
    3435#include "the-solaris-kernel.h"
     36#include "internal/iprt.h"
     37#include <iprt/thread.h>
    3538
    3639#include <iprt/assert.h>
    3740#include <iprt/err.h>
    38 #include <iprt/thread.h>
    3941#include <iprt/process.h>
     42#include "internal/thread.h"
    4043
    41 #include "internal/thread.h"
     44
    4245
    4346int rtThreadNativeInit(void)
     
    102105int rtThreadNativeCreate(PRTTHREADINT pThreadInt, PRTNATIVETHREAD pNativeThread)
    103106{
    104     int rc;
    105     kthread_t* pKernThread = thread_create(NULL, NULL, rtThreadNativeMain, pThreadInt, 0,
    106                                            (void *)RTR0ProcHandleSelf(), TS_RUN, minclsyspri);
     107    kthread_t *pKernThread;
     108    RT_ASSERT_PREEMPTIBLE();
     109
     110    pKernThread = thread_create(NULL, NULL, rtThreadNativeMain, pThreadInt, 0,
     111                                (void *)RTR0ProcHandleSelf(), TS_RUN, minclsyspri);
    107112    if (pKernThread)
    108113    {
    109         *pNativeThread = (RTNATIVETHREAD)pKernThread;
     114        *pNativeThread = (RTNATIVETHREAD)pvKernThread;
    110115        return VINF_SUCCESS;
    111116    }
    112117
    113     return RTErrConvertFromErrno(rc);
     118    return VERR_OUT_OF_RESOURCES;
    114119}
    115120
  • trunk/src/VBox/Runtime/r0drv/solaris/time-r0drv-solaris.c

    • Property svn:keywords changed from Id to Author Date Id Revision
    r8245 r22073  
    3333*   Header Files                                                               *
    3434*******************************************************************************/
     35#define RTTIME_INCL_TIMESPEC
    3536#include "the-solaris-kernel.h"
    36 #define RTTIME_INCL_TIMESPEC
     37#include "internal/iprt.h"
     38#include <iprt/time.h>
    3739
    38 #include <iprt/time.h>
    3940
    4041
     
    6970    return RTTimeSpecSetNano(pTime, (uint64_t)tv.tv_sec * 1000000000 + tv.tv_nsec);
    7071}
     72
  • trunk/src/VBox/Runtime/r0drv/solaris/timer-r0drv-solaris.c

    • Property svn:keywords changed from Id to Author Date Id Revision
    r9557 r22073  
    3434*******************************************************************************/
    3535#include "the-solaris-kernel.h"
    36 
     36#include "internal/iprt.h"
    3737#include <iprt/timer.h>
    38 #include <iprt/time.h>
     38
     39#include <iprt/asm.h>
     40#include <iprt/assert.h>
     41#include <iprt/err.h>
     42#include <iprt/mem.h>
    3943#include <iprt/mp.h>
    4044#include <iprt/spinlock.h>
    41 #include <iprt/err.h>
    42 #include <iprt/asm.h>
    43 #include <iprt/assert.h>
    44 #include <iprt/alloc.h>
    45 
     45#include <iprt/thread.h>
     46#include <iprt/time.h>
    4647#include "internal/magics.h"
    4748
     
    142143     * Validate flags.
    143144     */
     145    RT_ASSERT_PREEMPTIBLE();
    144146    if (!RTTIMER_FLAGS_ARE_VALID(fFlags))
    145147        return VERR_INVALID_PARAMETER;
     
    196198     * Validate.
    197199     */
     200    RT_ASSERT_PREEMPTIBLE();
    198201    if (pTimer == NULL)
    199202        return VINF_SUCCESS;
    200203    AssertPtrReturn(pTimer, VERR_INVALID_HANDLE);
    201204    AssertReturn(pTimer->u32Magic == RTTIMER_MAGIC, VERR_INVALID_HANDLE);
     205    RT_ASSERT_INTS_ON();
    202206
    203207    /*
     
    225229    AssertPtrReturn(pTimer, VERR_INVALID_HANDLE);
    226230    AssertReturn(pTimer->u32Magic == RTTIMER_MAGIC, VERR_INVALID_HANDLE);
     231    RT_ASSERT_INTS_ON();
    227232    if (rtTimerSolarisGetCyclicId(pTimer) != CYCLIC_NONE)
    228233    {
     
    324329    AssertPtrReturn(pTimer, VERR_INVALID_HANDLE);
    325330    AssertReturn(pTimer->u32Magic == RTTIMER_MAGIC, VERR_INVALID_HANDLE);
     331    RT_ASSERT_INTS_ON();
    326332
    327333    /*
  • trunk/src/VBox/Runtime/r0drv/solaris/vbi/RTLogWriteDebugger-r0drv-solaris.c

    • Property svn:keywords set to Author Date Id Revision
    r21292 r22073  
    2929 */
    3030
     31
     32/*******************************************************************************
     33*   Header Files                                                               *
     34*******************************************************************************/
    3135#include "the-solaris-kernel.h"
    3236#include <iprt/log.h>
     37
    3338#include <iprt/assert.h>
    3439
  • trunk/src/VBox/Runtime/r0drv/solaris/vbi/RTMpPokeCpu-r0drv-solaris.c

    r19501 r22073  
    3434*******************************************************************************/
    3535#include "the-solaris-kernel.h"
     36#include "internal/iprt.h"
    3637#include <iprt/mp.h>
     38
     39#include <iprt/asm.h>
    3740#include <iprt/err.h>
    3841
     
    4144RTDECL(int) RTMpPokeCpu(RTCPUID idCpu)
    4245{
     46    RT_ASSERT_INTS_ON();
    4347    vbi_poke_cpu(idCpu);
    4448    return VINF_SUCCESS;
  • trunk/src/VBox/Runtime/r0drv/solaris/vbi/alloc-r0drv-solaris.c

    • Property svn:keywords changed from Id to Author Date Id Revision
    r9149 r22073  
    3434*******************************************************************************/
    3535#include "the-solaris-kernel.h"
     36#include "internal/iprt.h"
     37#include <iprt/mem.h>
    3638
    37 #include <iprt/alloc.h>
    3839#include <iprt/assert.h>
    39 #include <iprt/types.h>
    4040#include <iprt/param.h>
     41#include <iprt/thread.h>
    4142#include "r0drv/alloc-r0drv.h"
     43
    4244
    4345
     
    9395    AssertPtr(pPhys);
    9496    Assert(cb > 0);
     97    RT_ASSERT_PREEMPTIBLE();
    9598
    9699    /* Allocate physically contiguous page-aligned memory. */
     
    111114RTR0DECL(void) RTMemContFree(void *pv, size_t cb)
    112115{
     116    RT_ASSERT_PREEMPTIBLE();
    113117    if (pv)
    114118        vbi_contig_free(pv, cb);
  • trunk/src/VBox/Runtime/r0drv/solaris/vbi/memobj-r0drv-solaris.c

    • Property svn:keywords changed from Id to Author Date Id Revision
    r21633 r22073  
    3434*******************************************************************************/
    3535#include "the-solaris-kernel.h"
    36 
     36#include "internal/iprt.h"
    3737#include <iprt/memobj.h>
     38
     39#include <iprt/assert.h>
     40#include <iprt/err.h>
     41#include <iprt/log.h>
    3842#include <iprt/mem.h>
    39 #include <iprt/err.h>
    40 #include <iprt/assert.h>
    41 #include <iprt/log.h>
    4243#include <iprt/param.h>
    4344#include <iprt/process.h>
     
    326327            cmn_err(CE_NOTE, "rtR0MemObjNativeMapUser: no page to map.\n");
    327328            rc = VERR_MAP_FAILED;
    328             goto done;
     329            goto l_done;
    329330        }
    330331        pv = (void *)((uintptr_t)pv + PAGE_SIZE);
     
    337338        rc = VERR_MAP_FAILED;
    338339        rtR0MemObjDelete(&pMemSolaris->Core);
    339         goto done;
     340        goto l_done;
    340341    }
    341342    else
     
    345346    pMemSolaris->Core.pv = addr;
    346347    *ppMem = &pMemSolaris->Core;
    347 done:
     348l_done:
    348349    kmem_free(paddrs, sizeof(uint64_t) * cPages);
    349350    return rc;
  • trunk/src/VBox/Runtime/r0drv/solaris/vbi/mp-r0drv-solaris.c

    r19391 r22073  
    3434*******************************************************************************/
    3535#include "the-solaris-kernel.h"
    36 
     36#include "internal/iprt.h"
    3737#include <iprt/mp.h>
     38
     39#include <iprt/asm.h>
    3840#include <iprt/cpuset.h>
    3941#include <iprt/err.h>
    40 #include <iprt/asm.h>
    4142#include "r0drv/mp-r0drv.h"
     43
    4244
    4345
     
    160162{
    161163    RTMPARGS Args;
     164    RT_ASSERT_INTS_ON();
    162165
    163166    Args.pfnWorker = pfnWorker;
     
    203206    int rc;
    204207    RTMPARGS Args;
     208    RT_ASSERT_INTS_ON();
    205209
    206210    /* The caller is supposed to have disabled preemption, but take no chances. */
     
    249253    int rc;
    250254    RTMPARGS Args;
     255    RT_ASSERT_INTS_ON();
    251256
    252257    if (idCpu >= vbi_cpu_count())
  • trunk/src/VBox/Runtime/r0drv/solaris/vbi/mpnotification-r0drv-solaris.c

    r11982 r22073  
    3333*******************************************************************************/
    3434#include "the-solaris-kernel.h"
     35#include "internal/iprt.h"
    3536
     37#include <iprt/err.h>
    3638#include <iprt/mp.h>
    37 #include <iprt/err.h>
    3839#include "r0drv/mp-r0drv.h"
     40
     41
     42/*******************************************************************************
     43*   Global Variables                                                           *
     44*******************************************************************************/
     45static vbi_cpu_watch_t *g_hVbiCpuWatch = NULL;
    3946
    4047
     
    5057}
    5158
    52 static vbi_cpu_watch_t *watch_handle = NULL;
    5359
    5460int rtR0MpNotificationNativeInit(void)
     
    5662    if (vbi_revision_level < 2)
    5763        return VERR_NOT_SUPPORTED;
    58     if (watch_handle != NULL)
    59         return VERR_INVALID_PARAMETER;
    60     watch_handle = vbi_watch_cpus(rtMpNotificationSolarisCallback, NULL, 0);
     64    if (g_hVbiCpuWatch != NULL)
     65        return VERR_WRONG_ORDER;
     66    g_hVbiCpuWatch = vbi_watch_cpus(rtMpNotificationSolarisCallback, NULL, 0);
    6167    return VINF_SUCCESS;
    6268}
     
    6571void rtR0MpNotificationNativeTerm(void)
    6672{
    67     if (vbi_revision_level >= 2 && watch_handle != NULL)
    68         vbi_ignore_cpus(watch_handle);
    69     watch_handle = NULL;
     73    if (vbi_revision_level >= 2 && g_hVbiCpuWatch != NULL)
     74        vbi_ignore_cpus(g_hVbiCpuWatch);
     75    g_hVbiCpuWatch = NULL;
    7076}
    7177
  • trunk/src/VBox/Runtime/r0drv/solaris/vbi/process-r0drv-solaris.c

    • Property svn:keywords changed from Id to Author Date Id Revision
    r9149 r22073  
    2929 */
    3030
     31
    3132/*******************************************************************************
    3233*   Header Files                                                               *
    3334*******************************************************************************/
    3435#include "the-solaris-kernel.h"
     36#include "internal/iprt.h"
     37#include <iprt/process.h>
    3538
    36 #include <iprt/process.h>
    3739
    3840
  • trunk/src/VBox/Runtime/r0drv/solaris/vbi/thread-r0drv-solaris.c

    • Property svn:keywords changed from Id to Author Date Id Revision
    r21595 r22073  
    3434*******************************************************************************/
    3535#include "the-solaris-kernel.h"
     36#include "internal/iprt.h"
     37#include <iprt/thread.h>
    3638
    37 #include <iprt/thread.h>
    3839#include <iprt/asm.h>
    3940#include <iprt/assert.h>
    4041#include <iprt/err.h>
     42
    4143
    4244
     
    5153    clock_t cTicks;
    5254    unsigned long timeout;
     55    RT_ASSERT_PREEMPTIBLE();
    5356
    5457    if (!cMillies)
     
    9699RTDECL(bool) RTThreadYield(void)
    97100{
     101    RT_ASSERT_PREEMPTIBLE();
    98102    return vbi_yield();
    99103}
  • trunk/src/VBox/Runtime/r0drv/solaris/vbi/thread2-r0drv-solaris.c

    • Property svn:keywords changed from Id to Author Date Id Revision
    r9149 r22073  
    2929 */
    3030
     31
    3132/*******************************************************************************
    3233*   Header Files                                                               *
    3334*******************************************************************************/
    3435#include "the-solaris-kernel.h"
     36#include "internal/iprt.h"
     37#include <iprt/thread.h>
    3538
    3639#include <iprt/assert.h>
    3740#include <iprt/err.h>
    38 #include <iprt/thread.h>
     41#include "internal/thread.h"
    3942
    40 #include "internal/thread.h"
     43
    4144
    4245int rtThreadNativeInit(void)
     
    9093{
    9194    PRTTHREADINT pThreadInt = (PRTTHREADINT)pvThreadInt;
    92     int rc;
    9395
    94     rc = rtThreadMain(pThreadInt, (RTNATIVETHREAD)vbi_curthread(), &pThreadInt->szName[0]);
     96    rtThreadMain(pThreadInt, (RTNATIVETHREAD)vbi_curthread(), &pThreadInt->szName[0]);
    9597    vbi_thread_exit();
    9698}
     
    99101int rtThreadNativeCreate(PRTTHREADINT pThreadInt, PRTNATIVETHREAD pNativeThread)
    100102{
    101     int rc;
    102     void *pKernThread = vbi_thread_create(rtThreadNativeMain, pThreadInt,
    103                                            sizeof (pThreadInt), minclsyspri);
    104     if (pKernThread)
     103    void   *pvKernThread;
     104    RT_ASSERT_PREEMPTIBLE();
     105
     106    pvKernThread = vbi_thread_create(rtThreadNativeMain, pThreadInt, sizeof(pThreadInt), minclsyspri);
     107    if (pvKernThread)
    105108    {
    106         *pNativeThread = (RTNATIVETHREAD)pKernThread;
     109        *pNativeThread = (RTNATIVETHREAD)pvKernThread;
    107110        return VINF_SUCCESS;
    108111    }
    109112
    110     return RTErrConvertFromErrno(rc);
     113    return VERR_OUT_OF_RESOURCES;
    111114}
    112115
  • trunk/src/VBox/Runtime/r0drv/solaris/vbi/time-r0drv-solaris.c

    • Property svn:keywords changed from Id to Author Date Id Revision
    r9149 r22073  
    3333*   Header Files                                                               *
    3434*******************************************************************************/
     35#define RTTIME_INCL_TIMESPEC
    3536#include "the-solaris-kernel.h"
    36 #define RTTIME_INCL_TIMESPEC
    37 
     37#include "internal/iprt.h"
    3838#include <iprt/time.h>
    3939
     
    6767    return RTTimeSpecSetNano(pTime, vbi_tod());
    6868}
     69
  • trunk/src/VBox/Runtime/r0drv/solaris/vbi/timer-r0drv-solaris.c

    • Property svn:keywords changed from Id to Author Date Id Revision
    r14318 r22073  
    1 /** $Id$ */
     1/* $Id$ */
    22/** @file
    33 * IPRT - Timer, Ring-0 Driver, Solaris.
     
    3434*******************************************************************************/
    3535#include "the-solaris-kernel.h"
    36 
     36#include "internal/iprt.h"
    3737#include <iprt/timer.h>
    38 #include <iprt/time.h>
     38
     39#include <iprt/asm.h>
     40#include <iprt/assert.h>
     41#include <iprt/err.h>
     42#include <iprt/mem.h>
    3943#include <iprt/mp.h>
    4044#include <iprt/spinlock.h>
    41 #include <iprt/err.h>
    42 #include <iprt/asm.h>
    43 #include <iprt/assert.h>
    44 #include <iprt/alloc.h>
    45 
     45#include <iprt/time.h>
     46#include <iprt/thread.h>
    4647#include "internal/magics.h"
    4748
     
    7071    uint64_t                interval;
    7172    /** simple Solaris timer handle. */
    72     vbi_stimer_t            *stimer;
     73    vbi_stimer_t           *stimer;
    7374    /** global Solaris timer handle. */
    74     vbi_gtimer_t            *gtimer;
     75    vbi_gtimer_t           *gtimer;
    7576    /** The user callback. */
    7677    PFNRTTIMER              pfnTimer;
    7778    /** The argument for the user callback. */
    78     void                    *pvUser;
     79    void                   *pvUser;
    7980} RTTIMER;
     81
     82
     83/*******************************************************************************
     84*   Defined Constants And Macros                                               *
     85*******************************************************************************/
     86/** Validates that the timer is valid. */
     87#define RTTIMER_ASSERT_VALID_RET(pTimer) \
     88    do \
     89    { \
     90        AssertPtrReturn(pTimer, VERR_INVALID_HANDLE); \
     91        AssertReturn((pTimer)->u32Magic == RTTIMER_MAGIC, VERR_INVALID_HANDLE); \
     92    } while (0)
    8093
    8194
     
    93106RTDECL(int) RTTimerCreateEx(PRTTIMER *ppTimer, uint64_t u64NanoInterval, unsigned fFlags, PFNRTTIMER pfnTimer, void *pvUser)
    94107{
     108    RT_ASSERT_PREEMPTIBLE();
    95109    *ppTimer = NULL;
    96110
     
    149163
    150164
    151 /**
    152  * Validates the timer handle.
    153  *
    154  * @returns true if valid, false if invalid.
    155  * @param   pTimer  The handle.
    156  */
    157 DECLINLINE(bool) rtTimerIsValid(PRTTIMER pTimer)
    158 {
    159     AssertReturn(VALID_PTR(pTimer), false);
    160     AssertReturn(pTimer->u32Magic == RTTIMER_MAGIC, false);
    161     return true;
    162 }
    163 
    164 
    165165RTDECL(int) RTTimerDestroy(PRTTIMER pTimer)
    166166{
    167167    if (pTimer == NULL)
    168168        return VINF_SUCCESS;
    169     if (!rtTimerIsValid(pTimer))
    170         return VERR_INVALID_HANDLE;
     169    RTTIMER_ASSERT_VALID_RET(pTimer);
     170    RT_ASSERT_INTS_ON();
    171171
    172172    /*
     
    174174     */
    175175    RTTimerStop(pTimer);
    176     pTimer->u32Magic++;
     176    ASMAtomicWriteU32(pTimer, ~RTTIMER_MAGIC);
    177177    RTMemFree(pTimer);
    178178    return VINF_SUCCESS;
     
    182182RTDECL(int) RTTimerStart(PRTTIMER pTimer, uint64_t u64First)
    183183{
    184     int cpu = VBI_ANY_CPU;
    185 
    186     if (!rtTimerIsValid(pTimer))
    187         return VERR_INVALID_HANDLE;
     184    RTTIMER_ASSERT_VALID_RET(pTimer);
     185    RT_ASSERT_INTS_ON();
     186
    188187    if (!pTimer->fSuspended)
    189188        return VERR_TIMER_ACTIVE;
     
    198197    else
    199198    {
     199        int cpu = VBI_ANY_CPU;
    200200        if (pTimer->fSpecificCpu)
    201201            cpu = pTimer->iCpu;
     
    215215RTDECL(int) RTTimerStop(PRTTIMER pTimer)
    216216{
    217     if (!rtTimerIsValid(pTimer))
    218         return VERR_INVALID_HANDLE;
     217    RTTIMER_ASSERT_VALID_RET(pTimer);
     218    RT_ASSERT_INTS_ON();
     219
    219220    if (pTimer->fSuspended)
    220221        return VERR_TIMER_SUSPENDED;
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