VirtualBox

Changeset 3978 in vbox for trunk/include


Ignore:
Timestamp:
Aug 2, 2007 12:39:19 AM (17 years ago)
Author:
vboxsync
Message:

Extended the RTTimerCreateEx interface by defining some flags for specifying the CPU(s) the timer should run on.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/iprt/timer.h

    r3630 r3978  
    9797 *                              a recurring timer. This is rounded to the fit the system timer granularity.
    9898 *                              For one shot timers, pass 0.
    99  * @param   fFlags              Timer flags. No flags has been defined yet, pass 0.
     99 * @param   fFlags              Timer flags.
    100100 * @param   pfnTimer            Callback function which shall be scheduled for execution
    101101 *                              on every timer tick.
     
    104104 */
    105105RTDECL(int) RTTimerCreateEx(PRTTIMER *ppTimer, uint64_t u64NanoInterval, unsigned fFlags, PFNRTTIMER pfnTimer, void *pvUser);
     106
     107/** @name RTTimerCreateEx flags
     108 * @{ */
     109/** Any CPU is fine. (Must be 0.) */
     110#define RTTIMER_FLAGS_CPU_ANY        0
     111/** One specific CPU */
     112#define RTTIMER_FLAGS_CPU_SPECIFIC   BIT(8)
     113/** All online CPUs. */
     114#define RTTIMER_FLAGS_CPU_ALL        ( RTTIMER_FLAGS_CPU_MASK | RTTIMER_FLAGS_CPU_SPECIFIC )
     115/** CPU mask. */
     116#define RTTIMER_FLAGS_CPU_MASK       0xff
     117/** Convert a CPU number (0-based) to RTTimerCreateEx flags.
     118 * This will automatically OR in the RTTIMER_FLAG_CPU_SPECIFIC flag. */
     119#define RTTIMER_FLAGS_CPU(iCpu)      ( (iCpu) | RTTIMER_FLAG_CPU_SPECIFIC )
     120/** Macro that validates the flags. */
     121#define RTTIMER_FLAGS_IS_VALID(fFlags) ( !((fFlags) & ((fFlags) & RTTIMER_FLAGS_CPU_SPECIFIC ? 0x1ff : 0x100)) )
     122/** @} */
    106123
    107124/**
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