patch from Ian Abbott <abbotti@mev.co.uk>:
authorFrank Mori Hess <fmhess@speakeasy.net>
Sun, 27 Feb 2005 22:26:45 +0000 (22:26 +0000)
committerFrank Mori Hess <fmhess@speakeasy.net>
Sun, 27 Feb 2005 22:26:45 +0000 (22:26 +0000)
This patch against CVS also applies to comedi-0.7.69 and allows it to
compile correctly against Red Hat 9's 2.4.20-8 kernel, and probably
others using the "statm" kernel patch.  It also changes the conditions
for defining the pte_offset_kernel() macro in the asm/pgtable.h
compatibility header to avoid it being redefined.

include/asm/pgtable.h
include/linux/mm.h

index 84017b2fc692d0464ddd9bcbf1cbb4d77e4fbb9b..20fe5b8d438fb83c8d60797124a0e26f11b09d07 100644 (file)
 #ifndef __COMPAT_ASM_PGTABLE_H_
 #define __COMPAT_ASM_PGTABLE_H_
 
-#include <linux/version.h>
-
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
+#include_next <asm/pgtable.h>
 
+#ifndef pte_offset_kernel
 #define pte_offset_kernel(dir,address) pte_offset(dir,address)
-
 #endif
 
-#include_next <asm/pgtable.h>
-
 #endif /* __COMPAT_ASM_PGTABLE_H_ */
 
index a7ab7ce9c7cd65b209613a8a2f035d8e87064ed5..39ed289b114eeef804abdfe6eeb013d28e9f5add 100644 (file)
 #define VM_OFFSET(a)   ((a)->vm_pgoff * PAGE_SIZE)
 #endif
 
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,10) \
+                         && LINUX_VERSION_CODE < KERNEL_VERSION(2,5,3)
+#include <asm/tlb.h>   /* look for tlb_vma() macro for "statm" patch */
+#endif
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,3) && !defined(tlb_vma)
 #define REMAP_PAGE_RANGE(a,b,c,d,e) remap_page_range(b,c,d,e)
 #else
 #define REMAP_PAGE_RANGE(a,b,c,d,e) remap_page_range(a,b,c,d,e)