6b2b515577
git-svn-id: https://svn.disconnected-by-peer.at/svn/linamh/trunk/linamh@1868 6952d904-891a-0410-993b-d76249ca496b
80 lines
2.8 KiB
Diff
80 lines
2.8 KiB
Diff
--- a/linux/SUPDrv-linux.c
|
|
+++ b/linux/SUPDrv-linux.c
|
|
@@ -115,44 +115,6 @@
|
|
# error "CONFIG_X86_HIGH_ENTRY is not supported by VBoxDrv at this time."
|
|
#endif
|
|
|
|
-/*
|
|
- * This sucks soooo badly on x86! Why don't they export __PAGE_KERNEL_EXEC so PAGE_KERNEL_EXEC would be usable?
|
|
- */
|
|
-#if defined(RT_ARCH_AMD64)
|
|
-# define MY_PAGE_KERNEL_EXEC PAGE_KERNEL_EXEC
|
|
-#elif defined(PAGE_KERNEL_EXEC) && defined(CONFIG_X86_PAE)
|
|
-# define MY_PAGE_KERNEL_EXEC __pgprot(cpu_has_pge ? _PAGE_KERNEL_EXEC | _PAGE_GLOBAL : _PAGE_KERNEL_EXEC)
|
|
-#else
|
|
-# define MY_PAGE_KERNEL_EXEC PAGE_KERNEL
|
|
-#endif
|
|
-
|
|
-/*
|
|
- * The redhat hack section.
|
|
- * - The current hacks are for 2.4.21-15.EL only.
|
|
- */
|
|
-#ifndef NO_REDHAT_HACKS
|
|
-/* accounting. */
|
|
-# if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 0)
|
|
-# ifdef VM_ACCOUNT
|
|
-# define MY_DO_MUNMAP(a,b,c) do_munmap(a, b, c, 0) /* should it be 1 or 0? */
|
|
-# endif
|
|
-# endif
|
|
-
|
|
-/* backported remap_page_range. */
|
|
-# if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 0)
|
|
-# include <asm/tlb.h>
|
|
-# ifdef tlb_vma /* probably not good enough... */
|
|
-# define HAVE_26_STYLE_REMAP_PAGE_RANGE 1
|
|
-# endif
|
|
-# endif
|
|
-
|
|
-#endif /* !NO_REDHAT_HACKS */
|
|
-
|
|
-
|
|
-#ifndef MY_DO_MUNMAP
|
|
-# define MY_DO_MUNMAP(a,b,c) do_munmap(a, b, c)
|
|
-#endif
|
|
-
|
|
|
|
/** @def ONE_MSEC_IN_JIFFIES
|
|
* The number of jiffies that make up 1 millisecond. Must be at least 1! */
|
|
--- a/r0drv/linux/alloc-r0drv-linux.c
|
|
+++ b/r0drv/linux/alloc-r0drv-linux.c
|
|
@@ -131,11 +131,10 @@ PRTMEMHDR rtMemAlloc(size_t cb, uint32_t
|
|
}
|
|
else
|
|
# endif
|
|
- pHdr = (PRTMEMHDR)__vmalloc(cb + sizeof(*pHdr), GFP_KERNEL | __GFP_HIGHMEM, PAGE_KERNEL_EXEC);
|
|
+ pHdr = (PRTMEMHDR)__vmalloc(cb + sizeof(*pHdr), GFP_KERNEL | __GFP_HIGHMEM, MY_PAGE_KERNEL_EXEC);
|
|
|
|
#elif defined(PAGE_KERNEL_EXEC) && defined(CONFIG_X86_PAE)
|
|
- pHdr = (PRTMEMHDR)__vmalloc(cb + sizeof(*pHdr), GFP_KERNEL | __GFP_HIGHMEM,
|
|
- __pgprot(cpu_has_pge ? _PAGE_KERNEL_EXEC | _PAGE_GLOBAL : _PAGE_KERNEL_EXEC));
|
|
+ pHdr = (PRTMEMHDR)__vmalloc(cb + sizeof(*pHdr), GFP_KERNEL | __GFP_HIGHMEM, MY_PAGE_KERNEL_EXEC);
|
|
#else
|
|
pHdr = (PRTMEMHDR)vmalloc(cb + sizeof(*pHdr));
|
|
#endif
|
|
--- a/r0drv/linux/the-linux-kernel.h
|
|
+++ b/r0drv/linux/the-linux-kernel.h
|
|
@@ -174,7 +174,12 @@ DECLINLINE(unsigned long) msecs_to_jiffi
|
|
#if defined(RT_ARCH_AMD64)
|
|
# define MY_PAGE_KERNEL_EXEC PAGE_KERNEL_EXEC
|
|
#elif defined(PAGE_KERNEL_EXEC) && defined(CONFIG_X86_PAE)
|
|
-# define MY_PAGE_KERNEL_EXEC __pgprot(cpu_has_pge ? _PAGE_KERNEL_EXEC | _PAGE_GLOBAL : _PAGE_KERNEL_EXEC)
|
|
+# ifdef __PAGE_KERNEL_EXEC
|
|
+ /* >= 2.6.27 */
|
|
+# define MY_PAGE_KERNEL_EXEC __pgprot(cpu_has_pge ? __PAGE_KERNEL_EXEC | _PAGE_GLOBAL : __PAGE_KERNEL_EXEC)
|
|
+# else
|
|
+# define MY_PAGE_KERNEL_EXEC __pgprot(cpu_has_pge ? _PAGE_KERNEL_EXEC | _PAGE_GLOBAL : _PAGE_KERNEL_EXEC)
|
|
+# endif
|
|
#else
|
|
# define MY_PAGE_KERNEL_EXEC PAGE_KERNEL
|
|
#endif
|