VirtualBox

Changeset 83471 in vbox for trunk/src/VBox/Runtime/r0drv


Ignore:
Timestamp:
Mar 27, 2020 3:49:44 PM (5 years ago)
Author:
vboxsync
Message:

Linux: ticketref:19312 Linux: kernel 5.6 - we need changes

Location:
trunk/src/VBox/Runtime/r0drv/linux
Files:
2 edited

Legend:

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

    r82968 r83471  
    14621462             */
    14631463            Assert(pMemLnxToMap->Core.enmType == RTR0MEMOBJTYPE_PHYS && !pMemLnxToMap->Core.u.Phys.fAllocated);
     1464#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 25)
     1465            /*
     1466             * ioremap() defaults to no caching since the 2.6 kernels.
     1467             * ioremap_nocache() has been removed finally in 5.6-rc1.
     1468             */
     1469            pMemLnx->Core.pv = pMemLnxToMap->Core.u.Phys.uCachePolicy == RTMEM_CACHE_POLICY_MMIO
     1470                             ? ioremap(pMemLnxToMap->Core.u.Phys.PhysBase + offSub, cbSub)
     1471                             : ioremap_cache(pMemLnxToMap->Core.u.Phys.PhysBase + offSub, cbSub);
     1472#else /* KERNEL_VERSION < 2.6.25 */
    14641473            pMemLnx->Core.pv = pMemLnxToMap->Core.u.Phys.uCachePolicy == RTMEM_CACHE_POLICY_MMIO
    14651474                             ? ioremap_nocache(pMemLnxToMap->Core.u.Phys.PhysBase + offSub, cbSub)
    14661475                             : ioremap(pMemLnxToMap->Core.u.Phys.PhysBase + offSub, cbSub);
     1476#endif /* KERNEL_VERSION < 2.6.25 */
    14671477            if (pMemLnx->Core.pv)
    14681478            {
  • trunk/src/VBox/Runtime/r0drv/linux/time-r0drv-linux.c

    r82968 r83471  
    3939DECLINLINE(uint64_t) rtTimeGetSystemNanoTS(void)
    4040{
    41 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 16) /* This must match timer-r0drv-linux.c! */
     41#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 6, 0)
     42    /*
     43     * Starting with kernel version 5.6-rc3 only 64-bit time interfaces
     44     * are allowed in the kernel.
     45     */
     46    uint64_t u64;
     47    struct timespec64 Ts = { 0, 0 };
     48
     49    ktime_get_ts64(&Ts);
     50    u64 = Ts.tv_sec * RT_NS_1SEC_64 + Ts.tv_nsec;
     51    return u64;
     52
     53#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 16) /* This must match timer-r0drv-linux.c! */
    4254    /*
    4355     * Use ktime_get_ts, this is also what clock_gettime(CLOCK_MONOTONIC,) is using.
    4456     */
    4557    uint64_t u64;
    46     struct timespec Ts;
     58    struct timespec Ts = { 0, 0 };
    4759    ktime_get_ts(&Ts);
    4860    u64 = Ts.tv_sec * RT_NS_1SEC_64 + Ts.tv_nsec;
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