VirtualBox

Ignore:
Timestamp:
Aug 11, 2020 5:05:29 PM (4 years ago)
Author:
vboxsync
Message:

IPRT,lnx-kmods: Use new linux kernel version checking macros. Moved them to separate wrapper header.

File:
1 edited

Legend:

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

    r82968 r85698  
    5151#endif
    5252
    53 #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 31)
     53#if RTLNX_VER_MAX(2,6,31)
    5454# define mod_timer_pinned               mod_timer
    5555# define HRTIMER_MODE_ABS_PINNED        HRTIMER_MODE_ABS
     
    368368        if (fPinned)
    369369        {
    370 # if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0)
     370# if RTLNX_VER_MIN(4,8,0)
    371371            mod_timer(&pSubTimer->u.Std.LnxTimer, pSubTimer->u.Std.ulNextJiffies);
    372372# else
     
    721721
    722722
    723 #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0)
     723#if RTLNX_VER_MIN(4,15,0)
    724724/**
    725725 * Timer callback function for standard timers.
     
    840840            if (pTimer->fSpecificCpu || pTimer->fAllCpus)
    841841            {
    842 # if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0)
     842# if RTLNX_VER_MIN(4,8,0)
    843843                mod_timer(&pSubTimer->u.Std.LnxTimer, ulNextJiffies);
    844844# else
     
    903903                    if (pTimer->fSpecificCpu || pTimer->fAllCpus)
    904904                    {
    905 # if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0)
     905# if RTLNX_VER_MIN(4,8,0)
    906906                        mod_timer(&pSubTimer->u.Std.LnxTimer, pSubTimer->u.Std.ulNextJiffies);
    907907# else
     
    15201520        /* For paranoid reasons, defer actually destroying the semaphore when
    15211521           in atomic or interrupt context. */
    1522 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 5, 32)
     1522#if RTLNX_VER_MIN(2,5,32)
    15231523        if (in_atomic() || in_interrupt())
    15241524#else
     
    16211621#endif
    16221622        {
    1623 #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0)
     1623#if RTLNX_VER_MIN(4,15,0)
    16241624            timer_setup(&pTimer->aSubTimers[iCpu].u.Std.LnxTimer, rtTimerLinuxStdCallback, TIMER_PINNED);
    1625 #elif LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0)
     1625#elif RTLNX_VER_MIN(4,8,0)
    16261626            init_timer_pinned(&pTimer->aSubTimers[iCpu].u.Std.LnxTimer);
    16271627#else
    16281628            init_timer(&pTimer->aSubTimers[iCpu].u.Std.LnxTimer);
    16291629#endif
    1630 #if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
     1630#if RTLNX_VER_MAX(4,15,0)
    16311631            pTimer->aSubTimers[iCpu].u.Std.LnxTimer.data        = (unsigned long)&pTimer->aSubTimers[iCpu];
    16321632            pTimer->aSubTimers[iCpu].u.Std.LnxTimer.function    = rtTimerLinuxStdCallback;
     
    16871687#endif
    16881688    /* */
    1689 #if LINUX_VERSION_CODE < KERNEL_VERSION(4, 9, 0) || LINUX_VERSION_CODE >= KERNEL_VERSION(4, 13, 0)
     1689#if RTLNX_VER_MAX(4,9,0) || RTLNX_VER_MIN(4,13,0)
    16901690    /* On 4.9, 4.10 and 4.12 we've observed tstRTR0Timer failures of the omni timer tests
    16911691       where we get about half of the ticks we want.  The failing test is using this value
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