fixed compilation against 2.2.0 kernel
authorFrank Mori Hess <fmhess@speakeasy.net>
Fri, 3 May 2002 16:13:43 +0000 (16:13 +0000)
committerFrank Mori Hess <fmhess@speakeasy.net>
Fri, 3 May 2002 16:13:43 +0000 (16:13 +0000)
include/asm/page.h [new file with mode: 0644]
include/linux/pci.h
include/linux/vmalloc.h

diff --git a/include/asm/page.h b/include/asm/page.h
new file mode 100644 (file)
index 0000000..00caf19
--- /dev/null
@@ -0,0 +1,28 @@
+/*
+ * asm/page.h compatibility header
+ */
+
+#ifndef __COMPAT_PAGE_TYPES_H_
+#define __COMPAT_PAGE_TYPES_H_
+
+#include <linux/version.h>
+#include_next <asm/page.h>
+
+#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_
+
index f7558321757bb394aaed1f11ce50726ca5f7629a..6584919b9adae2a41327c4b4776fc5169286d1fa 100644 (file)
@@ -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);
                }
        }
 
index f959e51bb7c3aca9b3db8233a3f903f7c25d4601..d24c4ae85a32d7b21da42274664a328182edb7ff 100644 (file)
@@ -7,15 +7,19 @@
 
 #include <linux/version.h>
 
-// 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 <linux/vmalloc.h>
+
+#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