From 5a246a63328b8768b0270490281c9945bb124fd5 Mon Sep 17 00:00:00 2001 From: Ian Campbell Date: Wed, 25 Oct 2006 13:58:30 +0100 Subject: PV-on-HVM: Include compatability vmalloc_to_pfn for kernels before 2.6.10 Signed-off-by: Ian Campbell Signed-off-by: K. Y. Srinivasan Signed-off-by: Tsunehisa Doi --- .../linux-2.6/compat-include/xen/platform-compat.h | 4 ++++ unmodified_drivers/linux-2.6/platform-pci/platform-compat.c | 12 ++++++++++++ 2 files changed, 16 insertions(+) (limited to 'unmodified_drivers') diff --git a/unmodified_drivers/linux-2.6/compat-include/xen/platform-compat.h b/unmodified_drivers/linux-2.6/compat-include/xen/platform-compat.h index 191777a8ff..185a97449c 100644 --- a/unmodified_drivers/linux-2.6/compat-include/xen/platform-compat.h +++ b/unmodified_drivers/linux-2.6/compat-include/xen/platform-compat.h @@ -29,4 +29,8 @@ #define nonseekable_open(inode, filp) /* Nothing to do */ #endif +#if defined(_LINUX_MM_H) && LINUX_VERSION_CODE < KERNEL_VERSION(2,6,10) +unsigned long vmalloc_to_pfn(void *addr); +#endif + #endif diff --git a/unmodified_drivers/linux-2.6/platform-pci/platform-compat.c b/unmodified_drivers/linux-2.6/platform-pci/platform-compat.c index 6538964ecf..b79006bc21 100644 --- a/unmodified_drivers/linux-2.6/platform-pci/platform-compat.c +++ b/unmodified_drivers/linux-2.6/platform-pci/platform-compat.c @@ -1,6 +1,7 @@ #include #include +#include #include #include @@ -29,3 +30,14 @@ size_t strcspn(const char *s, const char *reject) } EXPORT_SYMBOL(strcspn); #endif + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,10) +/* + * Map a vmalloc()-space virtual address to the physical page frame number. + */ +unsigned long vmalloc_to_pfn(void * vmalloc_addr) +{ + return page_to_pfn(vmalloc_to_page(vmalloc_addr)); +} +EXPORT_SYMBOL(vmalloc_to_pfn); +#endif -- cgit v1.2.3