--- /dev/null
+/*
+ asm/pgtable.h compatibility header
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#ifndef __COMPAT_ASM_PGTABLE_H_
+#define __COMPAT_ASM_PGTABLE_H_
+
+#include <linux/version.h>
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
+
+#define pte_offset_kernel(dir,address) pte_offset(dir,address)
+
+#endif
+
+#include_next <asm/pgtable.h>
+
+#endif /* __COMPAT_ASM_PGTABLE_H_ */
+
#include <linux/init.h>
#include <linux/vmalloc.h>
#include <linux/mm.h>
+#include <linux/interrupt.h>
#include <asm/uaccess.h>
#include <asm/io.h>
#include <linux/version.h>
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 2, 18)
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 2, 18) || LINUX_VERSION_CODE >= KERNEL_VERSION(2, 5, 0)
#define DEVFS_FL_DEFAULT 0
#define DEVFS_SPECIAL_CHR 0
--- /dev/null
+/*
+ linux/interrupt.h compatibility header
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#ifndef __COMPAT_LINUX_INTERRUPT_H_
+#define __COMPAT_LINUX_INTERRUPT_H_
+
+#include <linux/version.h>
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 0)
+typedef void irqreturn_t;
+#define IRQ_NONE
+#define IRQ_HANDLED
+#define IRQ_RETVAL(x)
+#endif
+
+#include_next <linux/interrupt.h>
+
+#endif
+
#include <linux/version.h>
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
+#define __MOD_INC_USE_COUNT(x)
+#define __MOD_DEC_USE_COUNT(x)
+#define MOD_IN_USE (0)
+#endif
+
#if LINUX_VERSION_CODE < 0x020115
#define MODULE_AUTHOR(a)
#define MODULE_DESCRIPTION(a)
#include_next <linux/pci.h>
#define PCI_SUPPORT_VER2
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
+/* we should get rid of this, as it has been dropped from 2.6 */
+#define pci_for_each_dev(x) \
+ for((x) = pci_dev_g(pci_devices.next), prefetch((x)->global_list.next); \
+ x->global_list.next != &pci_devices; (x) = pci_dev_g((x)->global_list.next), \
+ prefetch((x)->global_list.next))
+#endif
+
#if LINUX_VERSION_CODE < 0x020300 /* XXX */
#define pci_for_each_dev(x) \
--- /dev/null
+/*
+ linux/wrapper.h compatibility header
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#ifndef __COMPAT_LINUX_WRAPPER_H_
+#define __COMPAT_LINUX_WRAPPER_H_
+
+#include <linux/version.h>
+
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
+#define mem_map_reserve(p) set_bit(PG_reserved, &((p)->flags))
+#define mem_map_unreserve(p) clear_bit(PG_reserved, &((p)->flags))
+#else
+#include_next <linux/wrapper.h>
+#endif
+
+#endif /* __COMPAT_LINUX_WRAPPER_H_ */
+