VirtualBox

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


Ignore:
Timestamp:
Mar 25, 2008 11:02:24 AM (17 years ago)
Author:
vboxsync
Message:

vboxdrv: set_pages_attr is not available for 2.6.25 anymore

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

Legend:

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

    r7042 r7531  
    258258            SetPageReserved(&paPages[iPage]);
    259259#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 4, 20) /** @todo find the exact kernel where change_page_attr was introduced. */
    260             if (pgprot_val(MY_PAGE_KERNEL_EXEC) != pgprot_val(PAGE_KERNEL))
    261                 MY_CHANGE_PAGE_ATTR(&paPages[iPage], 1, MY_PAGE_KERNEL_EXEC);
     260            MY_SET_PAGES_EXEC(&paPages[iPage], 1);
    262261#endif
    263262        }
     
    302301            ClearPageReserved(&paPages[iPage]);
    303302#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 4, 20) /** @todo find the exact kernel where change_page_attr was introduced. */
    304             if (pgprot_val(MY_PAGE_KERNEL_EXEC) != pgprot_val(PAGE_KERNEL))
    305                 MY_CHANGE_PAGE_ATTR(&paPages[iPage], 1, PAGE_KERNEL);
     303            MY_SET_PAGES_NOEXEC(&paPages[iPage], 1);
    306304#endif
    307305        }
  • trunk/src/VBox/Runtime/r0drv/linux/memobj-r0drv-linux.c

    r6477 r7531  
    220220    {
    221221        pMemLnx->apPages[iPage] = &paPages[iPage];
    222         if (pgprot_val(MY_PAGE_KERNEL_EXEC) != pgprot_val(PAGE_KERNEL))
    223             MY_CHANGE_PAGE_ATTR(pMemLnx->apPages[iPage], 1, MY_PAGE_KERNEL_EXEC);
     222        MY_SET_PAGES_EXEC(pMemLnx->apPages[iPage], 1);
    224223        if (PageHighMem(pMemLnx->apPages[iPage]))
    225224            BUG();
     
    261260#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 4, 22)
    262261#else
    263             if (pgprot_val(MY_PAGE_KERNEL_EXEC) != pgprot_val(PAGE_KERNEL))
    264                 MY_CHANGE_PAGE_ATTR(pMemLnx->apPages[iPage], 1, PAGE_KERNEL);
     262            MY_SET_PAGES_NOEXEC(pMemLnx->apPages[iPage]);
    265263#endif
    266264        }
  • trunk/src/VBox/Runtime/r0drv/linux/the-linux-kernel.h

    r7032 r7531  
    208208#endif /* !NO_REDHAT_HACKS */
    209209
     210#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 25)
     211# define MY_SET_PAGES_EXEC(pPages, cPages)    set_pages_x(pPages, cPages)
     212# define MY_SET_PAGES_NOEXEC(pPages, cPages)  set_pages_nx(pPages, cPages)
     213#else
     214# define MY_SET_PAGES_EXEC(pPages, cPages)    MY_CHANGE_PAGE_ATTR(pPages, cPages, MY_PAGE_KERNEL_EXEC)
     215# define MY_SET_PAGES_NOEXEC(pPages, cPages)  MY_CHANGE_PAGE_ATTR(pPages, cPages, PAGE_KERNEL)
     216#endif
    210217
    211218#ifndef MY_DO_MUNMAP
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