From 3782b5911c5a3ba09a2b1c452d09b0073751f1cd Mon Sep 17 00:00:00 2001 From: David Schleef Date: Thu, 2 May 2002 23:10:41 +0000 Subject: [PATCH] Improved compatibility for 2.2.14. May break other 2.2.x kernels. --- include/linux/devfs_fs_kernel.h | 7 +++++-- include/linux/module.h | 13 +++++++++++++ include/linux/pci.h | 3 +++ 3 files changed, 21 insertions(+), 2 deletions(-) diff --git a/include/linux/devfs_fs_kernel.h b/include/linux/devfs_fs_kernel.h index 851191a5..9751b6af 100644 --- a/include/linux/devfs_fs_kernel.h +++ b/include/linux/devfs_fs_kernel.h @@ -9,6 +9,9 @@ #if LINUX_VERSION_CODE < 0x020400 +#define DEVFS_FL_DEFAULT 0 +#define DEVFS_SPECIAL_CHR 0 + typedef struct devfs_entry * devfs_handle_t; static inline int devfs_register_chrdev (unsigned int major, const char *name, @@ -40,9 +43,9 @@ static inline devfs_handle_t devfs_get_handle (devfs_handle_t dir, return NULL; } -#endif - +#else #include_next +#endif #endif diff --git a/include/linux/module.h b/include/linux/module.h index 1c7010e3..5f40d754 100644 --- a/include/linux/module.h +++ b/include/linux/module.h @@ -37,6 +37,19 @@ #endif #endif +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,2,18) /* ? */ + typedef int (*__init_module_func_t)(void); + typedef void (*__cleanup_module_func_t)(void); + #define module_init(x) \ + int init_module(void) __attribute__((alias(#x))); \ + static inline __init_module_func_t __init_module_inline(void) \ + { return x; } + #define module_exit(x) \ + void cleanup_module(void) __attribute__((alias(#x))); \ + static inline __cleanup_module_func_t __cleanup_module_inline(void) \ + { return x; } +#endif + #if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,0) #define MODULE_DEVICE_TABLE(a,b) #endif diff --git a/include/linux/pci.h b/include/linux/pci.h index fb311d65..b3943d34 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h @@ -16,6 +16,9 @@ #define PCI_SUPPORT_VER2 #if LINUX_VERSION_CODE < 0x020300 /* XXX */ +#include + +typedef u64 dma_addr_t; #define pci_for_each_dev(x) \ for((x)=pci_devices;(x);(x)=(x)->next) -- 2.26.2