u2mfn: fix compile with 3.x kernels

This commit is contained in:
Marek Marczykowski 2011-09-08 15:33:42 +02:00
parent 85db6178a8
commit 4f37a7705e

View File

@ -20,6 +20,7 @@
*/
#include <linux/module.h>
#include <linux/version.h>
#include <linux/proc_fs.h>
#include <linux/fs.h>
#include <linux/mm.h>
@ -30,12 +31,15 @@
#include <linux/highmem.h>
#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;