VirtualBox

Changeset 48148 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Aug 29, 2013 12:04:40 PM (11 years ago)
Author:
vboxsync
Message:

Runtime/r0drv/solaris: Fix race with specific timers and enabled tstRTR0Timer testing of it.

Location:
trunk/src/VBox/Runtime
Files:
2 edited

Legend:

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

    r44528 r48148  
    206206        return VERR_NOT_SUPPORTED;
    207207
     208    /* One-shot timers are not supported by the cyclic system. */
     209    if (u64NanoInterval == 0)
     210        return VERR_NOT_SUPPORTED;
     211
    208212    /*
    209213     * Allocate and initialize the timer handle.
     
    342346            pSingleTimer->hFireTime.cyt_interval = pTimer->interval;
    343347
     348        /* Disable interrupts to prevent timer firing between cyclic_add() and cyclic_bind(). */
     349        RTCCUINTREG uEflags = ASMIntDisableFlags();
     350
    344351        pTimer->hCyclicId = cyclic_add(&pSingleTimer->hHandler, &pSingleTimer->hFireTime);
    345352        if (iCpu != SOL_TIMER_ANY_CPU)
    346353            cyclic_bind(pTimer->hCyclicId, cpu[iCpu], NULL /* cpupart */);
    347354
     355        ASMSetFlags(uEflags);
    348356        mutex_exit(&cpu_lock);
    349357    }
  • trunk/src/VBox/Runtime/testcase/tstRTR0TimerDriver.cpp

    r48129 r48148  
    6161     * Standard timers.
    6262     */
    63 #  ifndef RT_OS_SOLARIS // one-shot timers currently not supported on Solaris
    6463    RTR3TestR0SimpleTest(TSTRTR0TIMER_ONE_SHOT_BASIC,       "Basic one shot");
    65 #  endif
    6664    RTR3TestR0SimpleTest(TSTRTR0TIMER_PERIODIC_BASIC,       "Basic periodic");
    6765    if (RTTestErrorCount(g_hTest) == 0)
    6866    {
    6967#  if 1
    70 #   ifndef RT_OS_SOLARIS // one-shot timers currently not supported on Solaris
    7168        RTR3TestR0SimpleTest(TSTRTR0TIMER_ONE_SHOT_RESTART, "Restart one shot from callback");
    7269        RTR3TestR0SimpleTest(TSTRTR0TIMER_ONE_SHOT_DESTROY, "Destroy one shot from callback");
    73 #   endif
    7470        RTR3TestR0SimpleTest(TSTRTR0TIMER_PERIODIC_CSSD_LOOPS, "Create-start-stop-destroy loops");
    7571        for (uint32_t i = 0; i <= 7; i++)
    7672            RTR3TestR0SimpleTestWithArg(TSTRTR0TIMER_PERIODIC_CHANGE_INTERVAL, i, "Change interval from callback, variation %u", i);
    7773#  endif
    78 #   ifndef RT_OS_SOLARIS // one-shot timers currently not supported on Solaris
    7974        RTR3TestR0SimpleTest(TSTRTR0TIMER_ONE_SHOT_SPECIFIC, "One shot cpu specific");
    80 #   endif
    81 #   ifndef RT_OS_SOLARIS // periodic specific timers have currently a bug on Solaris
    8275        RTR3TestR0SimpleTest(TSTRTR0TIMER_PERIODIC_SPECIFIC, "Periodic cpu specific");
    83 #   endif
    8476        RTR3TestR0SimpleTest(TSTRTR0TIMER_PERIODIC_OMNI, "Periodic omni timer");
    8577    }
     
    108100        RTR3TestR0SimpleTest(TSTRTR0TIMER_ONE_SHOT_SPECIFIC_HIRES, "One shot hires cpu specific");
    109101#   endif
    110 #   ifndef RT_OS_SOLARIS // periodic specific timers have currently a bug on Solaris
    111102        RTR3TestR0SimpleTest(TSTRTR0TIMER_PERIODIC_SPECIFIC_HIRES, "Periodic hires cpu specific");
    112 #   endif
    113103        RTR3TestR0SimpleTest(TSTRTR0TIMER_PERIODIC_OMNI, "Periodic omni hires timer");
    114104    }
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