--- /dev/null
+/*
+ * asm/dma.h compatibility header
+ */
+
+#ifndef __COMPAT_ASM_DMA_H_
+#define __COMPAT_ASM_DMA_H_
+
+#include <linux/version.h>
+
+#if LINUX_VERSION_CODE < 0x020200
+#include <asm/system.h>
+static __inline__ unsigned long claim_dma_lock(void)
+{
+ unsigned long flags;
+ save_flags(flags);
+ cli();
+ return flags;
+}
+#define release_dma_lock(x) restore_flags(x)
+#endif
+
+#include_next <asm/dma.h>
+
+#endif
+
#include <linux/kdev_t.h>
#include <linux/malloc.h>
#include <linux/errno.h>
+#include <linux/spinlock.h>
+
#include <linux/comedi.h>
#include <linux/version.h>
+#if LINUX_VERSION_CODE < 0x020400
+/* no fasync */
+#define KILL_FASYNC(a,b,c)
+#else
#if LINUX_VERSION_CODE < 0x020400
#define KILL_FASYNC(a,b,c) kill_fasync((a),(c))
#else
#define KILL_FASYNC(a,b,c) kill_fasync(&(a),(b),(c))
#endif
+#endif
#include_next <linux/fs.h>
--- /dev/null
+/*
+ * linux/kmod.h compatibility header
+ */
+
+#ifndef __COMPAT_LINUX_KMOD_H_
+#define __COMPAT_LINUX_KMOD_H_
+
+#include <linux/version.h>
+
+#if LINUX_VERSION_CODE < 0x020200
+
+#else
+#include_next <linux/kmod.h>
+#endif
+
+#endif
+
#endif
#define __MOD_INC_USE_COUNT(x) ((*(long *)(x))++, (*(long *)(x)) |= MOD_VISITED)
#define __MOD_DEC_USE_COUNT(x) ((*(long *)(x))--, (*(long *)(x)) |= MOD_VISITED)
+ #define EXPORT_SYMBOL(x)
#else
#ifdef MODULE
#define THIS_MODULE &__this_module
--- /dev/null
+/*
+ * linux/poll.h compatibility header
+ */
+
+#ifndef __COMPAT_LINUX_POLL_H_
+#define __COMPAT_LINUX_POLL_H_
+
+#include <linux/version.h>
+
+#if LINUX_VERSION_CODE < 0x020200
+
+#else
+#include_next <linux/poll.h>
+#endif
+
+#endif
+
--- /dev/null
+/*
+ * linux/fs.h compatibility header
+ */
+
+#ifndef __COMPAT_LINUX_POLL_H_
+#define __COMPAT_LINUX_POLL_H_
+
+#include <linux/version.h>
+
+#if LINUX_VERSION_CODE < 0x020200
+#define signal_pending(x) (((x)->signal) & (~(x)->blocked))
+#endif
+
+#include_next <linux/sched.h>
+
+#endif
+
#include <linux/version.h>
+#if LINUX_VERSION_CODE < 0x020100
+/* no spinlocks */
+typedef int spinlock_t;
+
+#define spin_lock_init(lock) do { } while(0)
+#define spin_lock(lock) (void)(lock) /* Not "unused variable". */
+#define spin_trylock(lock) (1)
+#define spin_unlock_wait(lock) do { } while(0)
+#define spin_unlock(lock) do { } while(0)
+#define spin_lock_irq(lock) cli()
+#define spin_unlock_irq(lock) sti()
+
+#define spin_lock_irqsave(lock, flags) \
+ do { save_flags(flags); cli(); } while (0)
+#define spin_unlock_irqrestore(lock, flags) \
+ restore_flags(flags)
+
+#define SPIN_LOCK_UNLOCKED 0
+
+#else
#if LINUX_VERSION_CODE < 0x020300
#include <asm/spinlock.h>
#else
#include_next <linux/spinlock.h>
#endif
+#endif
#endif /* _COMPAT_SPINLOCK_H */
--- /dev/null
+/*
+ * linux/timer.h compatibility header
+ */
+
+#ifndef __COMPAT_LINUX_TIMER_H_
+#define __COMPAT_LINUX_TIMER_H_
+
+#include <linux/version.h>
+
+#if LINUX_VERSION_CODE < 0x020200
+
+#define mod_timer(a,b) do{del_timer((a));(a)->expires=(b);add_timer((a));}while(0)
+#endif
+
+#include_next <linux/timer.h>
+
+#endif
+
--- /dev/null
+/*
+ * linux/vmalloc.h compatibility header
+ */
+
+#ifndef __COMPAT_LINUX_VMALLOC_H_
+#define __COMPAT_LINUX_VMALLOC_H_
+
+#include <linux/version.h>
+
+#if LINUX_VERSION_CODE < 0x020200
+
+#else
+#include_next <linux/vmalloc.h>
+#endif
+
+#endif
+