From 93d1b5695a55cfc6085deb7ceef4685a6cc9d6fb Mon Sep 17 00:00:00 2001 From: Ian Campbell Date: Thu, 5 Apr 2007 15:38:09 +0100 Subject: LINUX: PVonHVM: Fixes to build with kernels back to 2.6.5. Signed-off-by: Ian Campbell --- .../linux-2.6/compat-include/xen/platform-compat.h | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (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 d327d703ea..f6a9371034 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 @@ -40,7 +40,7 @@ /* Some kernels have this typedef backported so we cannot reliably * detect based on version number, hence we forcibly #define it. */ -#if defined(__LINUX_TYPES_H) || defined(__LINUX_GFP_H) +#if defined(__LINUX_TYPES_H) || defined(__LINUX_GFP_H) || defined(_LINUX_KERNEL_H) #define gfp_t unsigned #endif @@ -51,6 +51,14 @@ #define atomic_notifier_call_chain(chain,val,v) notifier_call_chain(chain,val,v) #endif +#if defined(_LINUX_MM_H) && defined set_page_count +#define init_page_count(page) set_page_count(page, 1) +#endif + +#if defined(__LINUX_GFP_H) && !defined __GFP_NOMEMALLOC +#define __GFP_NOMEMALLOC 0 +#endif + #if defined(_LINUX_FS_H) && LINUX_VERSION_CODE < KERNEL_VERSION(2,6,9) #define nonseekable_open(inode, filp) /* Nothing to do */ #endif @@ -75,6 +83,10 @@ void *kzalloc(size_t size, int flags); #define end_that_request_last(req, uptodate) end_that_request_last(req) #endif +#if defined(_LINUX_CAPABILITY_H) && LINUX_VERSION_CODE < KERNEL_VERSION(2,6,16) +#define capable(cap) (1) +#endif + #if defined(_LINUX_KERNEL_H) && LINUX_VERSION_CODE < KERNEL_VERSION(2,6,18) extern char *kasprintf(gfp_t gfp, const char *fmt, ...) __attribute__ ((format (printf, 2, 3))); -- cgit v1.2.3