From 4f37a7705ee598b18eada858227f53547676fba3 Mon Sep 17 00:00:00 2001 From: Marek Marczykowski Date: Thu, 8 Sep 2011 15:33:42 +0200 Subject: [PATCH] u2mfn: fix compile with 3.x kernels --- u2mfn/u2mfn.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/u2mfn/u2mfn.c b/u2mfn/u2mfn.c index 80a1d0b..4cadccd 100644 --- a/u2mfn/u2mfn.c +++ b/u2mfn/u2mfn.c @@ -20,6 +20,7 @@ */ #include +#include #include #include #include @@ -30,12 +31,15 @@ #include #include "/usr/include/u2mfn-kernel.h" + +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,0,0) static inline unsigned long virt_to_phys(volatile void *address) { return __pa((unsigned long) address); } +#endif -#if HAVE_GET_PHYS_TO_MACHINE +#ifdef virt_to_mfn #define VIRT_TO_MFN virt_to_mfn #else extern unsigned long *phys_to_machine_mapping;