VirtualBox

Ticket #19644: vb-6.0.24-kernel-5.8-p4-1.patch

File vb-6.0.24-kernel-5.8-p4-1.patch, 1.6 KB (added by hwertz, 4 years ago)

6.0.24 patch 1

  • src/VBox/Runtime/r0drv/linux/time-r0drv-linux.c

    a b  
    3131#define LOG_GROUP RTLOGGROUP_TIME
    3232#include "the-linux-kernel.h"
    3333#include "internal/iprt.h"
     34/* Make sure we have the setting functions we need for RTTimeNow: */
     35#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 16)
     36# define RTTIME_INCL_TIMEVAL
     37#elif LINUX_VERSION_CODE < KERNEL_VERSION(3, 17, 0)
     38# define RTTIME_INCL_TIMESPEC
     39#endif
    3440#include <iprt/time.h>
    3541#include <iprt/asm.h>
    3642
    RT_EXPORT_SYMBOL(RTTimeSystemMilliTS);  
    181187RTDECL(PRTTIMESPEC) RTTimeNow(PRTTIMESPEC pTime)
    182188{
    183189    IPRT_LINUX_SAVE_EFL_AC();
    184 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 16)
    185 /* On Linux 4.20, time.h includes time64.h and we have to use 64-bit times. */
    186 # ifdef _LINUX_TIME64_H
     190#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 17, 0)
    187191    struct timespec64 Ts;
    188     ktime_get_real_ts64(&Ts);
    189 # else
    190     struct timespec Ts;
    191     ktime_get_real_ts(&Ts);
    192 # endif
     192    ktime_get_real_ts64(&Ts);   /* ktime_get_real_ts64 was added as a macro in 3.17, function since 4.18. */
    193193    IPRT_LINUX_RESTORE_EFL_AC();
    194 # ifdef _LINUX_TIME64_H
    195194    return RTTimeSpecSetTimespec64(pTime, &Ts);
    196 # else
     195
     196#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 16)
     197    struct timespec Ts;
     198    ktime_get_real_ts(&Ts);     /* ktime_get_real_ts was removed in Linux 4.20. */
     199    IPRT_LINUX_RESTORE_EFL_AC();
    197200    return RTTimeSpecSetTimespec(pTime, &Ts);
    198 # endif
    199 #else   /* < 2.6.16 */
     201
     202#else /* < 2.6.16 */
    200203    struct timeval Tv;
    201204    do_gettimeofday(&Tv);
    202205    IPRT_LINUX_RESTORE_EFL_AC();

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy