From 12dc84078ed18b56320dbf3f969b5538c9ab7cbf Mon Sep 17 00:00:00 2001 From: Frank Mori Hess Date: Fri, 3 May 2002 16:13:43 +0000 Subject: [PATCH] fixed compilation against 2.2.0 kernel --- include/asm/page.h | 28 ++++++++++++++++++++++++++++ include/linux/pci.h | 2 +- include/linux/vmalloc.h | 12 ++++++++---- 3 files changed, 37 insertions(+), 5 deletions(-) create mode 100644 include/asm/page.h diff --git a/include/asm/page.h b/include/asm/page.h new file mode 100644 index 00000000..00caf190 --- /dev/null +++ b/include/asm/page.h @@ -0,0 +1,28 @@ +/* + * asm/page.h compatibility header + */ + +#ifndef __COMPAT_PAGE_TYPES_H_ +#define __COMPAT_PAGE_TYPES_H_ + +#include +#include_next + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,2,1) +/* Pure 2^n version of get_order */ +static __inline__ int get_order(unsigned long size) +{ + int order; + + size = (size-1) >> (PAGE_SHIFT-1); + order = -1; + do { + size >>= 1; + order++; + } while (size); + return order; +} +#endif + +#endif // __COMPAT_ASM_PAGE_H_ + diff --git a/include/linux/pci.h b/include/linux/pci.h index f7558321..6584919b 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h @@ -107,7 +107,7 @@ extern inline int pci_request_regions(struct pci_dev *dev, char *name) { if(dev->base_address[i] & PCI_BASE_ADDRESS_SPACE_IO) request_region(pci_resource_start(dev, i), - fake_length); + fake_length, name); } } diff --git a/include/linux/vmalloc.h b/include/linux/vmalloc.h index f959e51b..d24c4ae8 100644 --- a/include/linux/vmalloc.h +++ b/include/linux/vmalloc.h @@ -7,15 +7,19 @@ #include -// XXX 2.2.19 already has vmalloc_32() compatibility, not sure when it was introduced -#if LINUX_VERSION_CODE < 0x020200 -#define vmalloc_32(x) vmalloc((x)) -#endif #if LINUX_VERSION_CODE < 0x020200 #else #include_next + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 2, 18) +extern inline void * vmalloc_32(unsigned long size) +{ + return vmalloc(size); +} +#endif // 2.2.18 + #endif #endif -- 2.26.2