VirtualBox

Ignore:
Timestamp:
Jan 4, 2018 12:44:33 PM (7 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
120064
Message:

Runtime: Adapt Linux R0 timer implementation to work with the upcoming 4.15. Contributed by Larry Finger, thanks!

File:
1 edited

Legend:

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

    r69111 r70458  
    55
    66/*
    7  * Copyright (C) 2006-2017 Oracle Corporation
     7 * Copyright (C) 2006-2018 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    716716
    717717
     718#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0)
    718719/**
    719720 * Timer callback function for standard timers.
    720721 *
     722 * @param   pLnxTimer   Pointer to the Linux timer structure.
     723 */
     724static void rtTimerLinuxStdCallback(struct timer_list *pLnxTimer)
     725{
     726    PRTTIMERLNXSUBTIMER pSubTimer = from_timer(pSubTimer, pLnxTimer, u.Std.LnxTimer);
     727#else
     728/**
     729 * Timer callback function for standard timers.
     730 *
    721731 * @param   ulUser      Address of the sub-timer structure.
    722732 */
     
    724734{
    725735    PRTTIMERLNXSUBTIMER pSubTimer = (PRTTIMERLNXSUBTIMER)ulUser;
     736#endif
    726737    PRTTIMER            pTimer    = pSubTimer->pParent;
    727738
     
    15851596#endif
    15861597        {
    1587 #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0)
     1598#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0)
     1599            timer_setup(&pTimer->aSubTimers[iCpu].u.Std.LnxTimer, rtTimerLinuxStdCallback, TIMER_PINNED);
     1600#elif LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0)
    15881601            init_timer_pinned(&pTimer->aSubTimers[iCpu].u.Std.LnxTimer);
    15891602#else
    15901603            init_timer(&pTimer->aSubTimers[iCpu].u.Std.LnxTimer);
    15911604#endif
     1605#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
    15921606            pTimer->aSubTimers[iCpu].u.Std.LnxTimer.data        = (unsigned long)&pTimer->aSubTimers[iCpu];
    15931607            pTimer->aSubTimers[iCpu].u.Std.LnxTimer.function    = rtTimerLinuxStdCallback;
     1608#endif
    15941609            pTimer->aSubTimers[iCpu].u.Std.LnxTimer.expires     = jiffies;
    15951610            pTimer->aSubTimers[iCpu].u.Std.u64NextTS            = 0;
Note: See TracChangeset for help on using the changeset viewer.

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