VirtualBox

Changeset 53427 in vbox for trunk/src/VBox/Runtime


Ignore:
Timestamp:
Dec 2, 2014 9:18:18 PM (10 years ago)
Author:
vboxsync
Message:

Runtime/r0drv/linux: fix RTR0MemKernelIsValidAddr() for 64-bit Linux 2.6.10 and earlier.

File:
1 edited

Legend:

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

    r44529 r53427  
    6464{
    6565    /* Couldn't find a straight forward way of doing this... */
    66 #ifdef RT_ARCH_X86
    67 # ifdef CONFIG_X86_HIGH_ENTRY
     66#if defined(RT_ARCH_X86) && defined(CONFIG_X86_HIGH_ENTRY)
    6867    return true; /* ?? */
    69 # else
     68#elif defined(RT_ARCH_X86) || defined(RT_ARCH_AMD64)
    7069    return (uintptr_t)pv >= PAGE_OFFSET;
    71 # endif
    72 
    73 #elif defined(RT_ARCH_AMD64)
    74 # if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 11)
    75     /* Linux 2.6.0 ... 2.6.10 set PAGE_OFFSET to 0x0000010000000000.
    76      * Linux 2.6.11 sets PAGE_OFFSET to 0xffff810000000000.
    77      * Linux 2.6.33 sets PAGE_OFFSET to 0xffff880000000000. */
    78     return (uintptr_t)pv >= PAGE_OFFSET;
    79 # else
    80     /* Not correct (KERNEL_TEXT_START=0xffffffff80000000),
    81      * VMALLOC_START (0xffffff0000000000) would be better */
    82     return (uintptr_t)pv >= KERNEL_TEXT_START;
    83 # endif
    84 
    8570#else
    8671# error "PORT ME"
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