Index: /trunk/configure.ac
===================================================================
--- /trunk/configure.ac	(revision 442)
+++ /trunk/configure.ac	(revision 443)
@@ -2064,4 +2064,10 @@
 	[
 	if test "x${enable_khide}" != xno; then
+
+	   kernel_testsupport=`uname -r | sed s,^3.*,LINUX3,`
+	   if test "x${kernel_testsupport}" = "xLINUX3"; then
+	      AC_MSG_ERROR([The --enable-khide option is not supported on Linux kernel version 3.x or above.])
+	   fi
+
 	   if test "x${enableval}" != "xyes"; then
 		khidemap="${enableval}"
Index: /trunk/docs/Changelog
===================================================================
--- /trunk/docs/Changelog	(revision 442)
+++ /trunk/docs/Changelog	(revision 443)
@@ -1,2 +1,3 @@
+	* Drop support for --enable-khide on kernel version 3.x and above
 	* Fix IgnoreAdded to anchor regex at beginning of path (reported by
 	  R.Lindner)
Index: /trunk/src/samhain_erase.c
===================================================================
--- /trunk/src/samhain_erase.c	(revision 442)
+++ /trunk/src/samhain_erase.c	(revision 443)
@@ -71,8 +71,17 @@
 /* The configure options (#defines) for the Kernel
  */
+#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))
+
+#if SH_KERNEL_NUMERIC >= KERNEL_VERSION(2,6,33)
+#include <generated/autoconf.h>
+#else
+#if SH_KERNEL_NUMERIC >= KERNEL_VERSION(2,6,19)
+#include <linux/autoconf.h>
+#else
 #include <linux/config.h>
-
 #ifdef CONFIG_MODVERSIONS
 #include <linux/modversions.h>
+#endif
+#endif
 #endif
 
Index: /trunk/src/samhain_hide.c
===================================================================
--- /trunk/src/samhain_hide.c	(revision 442)
+++ /trunk/src/samhain_hide.c	(revision 443)
@@ -101,6 +101,10 @@
 
 #ifndef LINUX26
+#ifndef __KERNEL__
 #define __KERNEL__
+#endif
+#ifndef MODULE
 #define MODULE
+#endif
 #endif
 #define LINUX
@@ -137,10 +141,13 @@
 #endif
 
-#ifndef LINUX26
+#if SH_KERNEL_NUMERIC < KERNEL_VERSION(2,6,0)
 #ifdef CONFIG_MODVERSIONS
 #include <linux/modversions.h>
 #endif
-#endif
-
+#else
+#ifndef LINUX26
+#define LINUX26
+#endif
+#endif
 
 #ifdef LINUX26
@@ -179,5 +186,10 @@
 /* Include for lock_kernel().
  */
+#if SH_KERNEL_NUMERIC < KERNEL_VERSION(3,0,0)
 #include <linux/smp_lock.h>
+#else
+static inline void lock_kernel(void) { }
+static inline void unlock_kernel(void) { }
+#endif
 
 #if SH_KERNEL_NUMERIC >= SH_KERNEL_MIN
