Files
sablink-distro/app-emulation/virtualbox-modules/files/virtualbox_2.6.25.patch
T
lxnay d80cdd71b8 virtualbox-modules working with 2.6.25
git-svn-id: http://svn.sabayonlinux.org/overlay@2209 d7aec97c-591d-0410-af39-a8856400b30a
2008-04-22 00:40:47 +00:00

45 lines
1.5 KiB
Diff

diff -ur virtualbox-ose_1.5.6/r0drv/linux/the-linux-kernel.h virtualbox-ose/r0drv/linux/the-linux-kernel.h
--- virtualbox-ose_1.5.6/r0drv/linux/the-linux-kernel.h 2008-02-23 11:10:06.000000000 +0100
+++ virtualbox-ose/r0drv/linux/the-linux-kernel.h 2008-02-27 01:57:20.000000000 +0100
@@ -225,12 +225,16 @@
#undef bool
/*
- * There are post-2.6.24 kernels (confusingly with unchanged version number)
- * which eliminate macros which were marked as deprecated.
+ * The 2.6.25 kernel eliminates macros that were marked as deprecated and eliminates
+ * routine change_page_attr() in favor of the set_pages_* API.
*/
#ifndef __attribute_used__
#define __attribute_used__ __used
#endif
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 25)
+int change_page_attr(struct page *page, int numpages, pgprot_t prot);
+#endif
+
#endif
diff -ur virtualbox-ose_1.5.6/linux/SUPDrv-linux.c virtualbox-ose/linux/SUPDrv-linux.c
--- virtualbox-ose_1.5.6/linux/SUPDrv-linux.c 2008-02-23 11:10:05.000000000 +0100
+++ virtualbox-ose/linux/SUPDrv-linux.c 2008-02-27 01:54:17.000000000 +0100
@@ -2069,6 +2069,17 @@
/* GCC C++ hack. */
unsigned __gxx_personality_v0 = 0xcccccccc;
+/* Add the change_page_attr routine for kernels 2.6.25 or later */
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 25)
+int change_page_attr(struct page *page, int numpages, pgprot_t prot)
+{
+ /* use the set_pages_* API */
+ if (pgprot_val(prot) & _PAGE_NX)
+ set_pages_nx(page, numpages);
+ set_pages_uc(page, numpages);
+ return 0;
+}
+#endif
module_init(VBoxSupDrvInit);
module_exit(VBoxSupDrvUnload);