Index: /trunk/src/VBox/HostDrivers/Support/Makefile.kmk
===================================================================
--- /trunk/src/VBox/HostDrivers/Support/Makefile.kmk	(revision 6844)
+++ /trunk/src/VBox/HostDrivers/Support/Makefile.kmk	(revision 6845)
@@ -163,5 +163,7 @@
 vboxdrv_DEFS         += VBOX_WITH_IDT_PATCHING
 endif
-vboxdrv_INCS         := $(PATH_SUB_CURRENT)
+vboxdrv_INCS         := \
+	$(PATH_SUB_CURRENT) \
+	$(PATH_ROOT)/src/VBox/Runtime/r0drv/linux
 vboxdrv_LIBS          = $(PATH_LIB)/RuntimeR0Drv$(VBOX_SUFF_LIB)
 vboxdrv_LIBS.debug    = $(vboxdrv_LIBS) $(VBOX_GCC_LIBGCC)
Index: /trunk/src/VBox/HostDrivers/Support/linux/SUPDrv-linux.c
===================================================================
--- /trunk/src/VBox/HostDrivers/Support/linux/SUPDrv-linux.c	(revision 6844)
+++ /trunk/src/VBox/HostDrivers/Support/linux/SUPDrv-linux.c	(revision 6845)
@@ -30,4 +30,5 @@
 *******************************************************************************/
 #include "SUPDRV.h"
+#include "the-linux-kernel.h"
 #include "version-generated.h"
 
@@ -40,21 +41,5 @@
 #include <iprt/mem.h>
 
-#include <linux/module.h>
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 0)
-# include <linux/moduleparam.h>
-#endif
-#include <linux/kernel.h>
-#include <linux/init.h>
-#include <linux/fs.h>
-#include <linux/mm.h>
-#include <linux/pagemap.h>
 #include <linux/sched.h>
-#include <linux/slab.h>
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 0)
-# include <linux/jiffies.h>
-#endif
-#include <asm/mman.h>
-#include <asm/io.h>
-#include <asm/uaccess.h>
 #ifdef CONFIG_DEVFS_FS
 # include <linux/devfs_fs_kernel.h>
@@ -69,12 +54,6 @@
 # endif
 #endif
-#ifndef HAVE_UNLOCKED_IOCTL /* linux/fs.h defines this */
-# include <linux/smp_lock.h>
-#endif
 
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 0)
-# ifndef page_to_pfn
-#  define page_to_pfn(page) ((page) - mem_map)
-# endif
 # include <asm/pgtable.h>
 # define global_flush_tlb __flush_tlb_global
Index: /trunk/src/VBox/HostDrivers/Support/linux/SUPDrv-linux.mod.c
===================================================================
--- /trunk/src/VBox/HostDrivers/Support/linux/SUPDrv-linux.mod.c	(revision 6844)
+++ /trunk/src/VBox/HostDrivers/Support/linux/SUPDrv-linux.mod.c	(revision 6845)
@@ -27,7 +27,5 @@
 
 #include "SUPDRV.h" /* for KBUILD_STR */
-#include <linux/module.h>
-#include <linux/vermagic.h>
-#include <linux/compiler.h>
+#include "the-linux-kernel.h"
 
 MODULE_INFO(vermagic, VERMAGIC_STRING);
Index: /trunk/src/VBox/Runtime/r0drv/linux/the-linux-kernel.h
===================================================================
--- /trunk/src/VBox/Runtime/r0drv/linux/the-linux-kernel.h	(revision 6844)
+++ /trunk/src/VBox/Runtime/r0drv/linux/the-linux-kernel.h	(revision 6845)
@@ -64,4 +64,8 @@
 #include <asm/semaphore.h>
 #include <linux/module.h>
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 0)
+# include <linux/moduleparam.h>
+#endif
+#include <linux/vermagic.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
@@ -80,4 +84,8 @@
 #include <linux/interrupt.h>
 #include <linux/completion.h>
+#include <linux/compiler.h>
+#ifndef HAVE_UNLOCKED_IOCTL /* linux/fs.h defines this */
+# include <linux/smp_lock.h>
+#endif
 /* For the shared folders module */
 #include <linux/vmalloc.h>
@@ -227,4 +235,12 @@
 #undef bool
 
-#endif
-
+/*
+ * There are post-2.6.24 kernels (confusingly with unchanged version number)
+ * which eliminate macros which were marked as deprecated.
+ */
+#ifndef __attribute_used__
+#define __attribute_used__ __used
+#endif
+
+#endif
+
