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 , 4 years ago) |
|---|
-
src/VBox/Runtime/r0drv/linux/time-r0drv-linux.c
a b 31 31 #define LOG_GROUP RTLOGGROUP_TIME 32 32 #include "the-linux-kernel.h" 33 33 #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 34 40 #include <iprt/time.h> 35 41 #include <iprt/asm.h> 36 42 … … RT_EXPORT_SYMBOL(RTTimeSystemMilliTS); 181 187 RTDECL(PRTTIMESPEC) RTTimeNow(PRTTIMESPEC pTime) 182 188 { 183 189 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) 187 191 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. */ 193 193 IPRT_LINUX_RESTORE_EFL_AC(); 194 # ifdef _LINUX_TIME64_H195 194 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(); 197 200 return RTTimeSpecSetTimespec(pTime, &Ts); 198 # endif 199 #else /* < 2.6.16 */201 202 #else /* < 2.6.16 */ 200 203 struct timeval Tv; 201 204 do_gettimeofday(&Tv); 202 205 IPRT_LINUX_RESTORE_EFL_AC();

