Fixes for compiling with 2.0.x
authorDavid Schleef <ds@schleef.org>
Mon, 27 Aug 2001 09:55:40 +0000 (09:55 +0000)
committerDavid Schleef <ds@schleef.org>
Mon, 27 Aug 2001 09:55:40 +0000 (09:55 +0000)
include/asm/dma.h [new file with mode: 0644]
include/linux/comedidev.h
include/linux/fs.h
include/linux/kmod.h [new file with mode: 0644]
include/linux/module.h
include/linux/poll.h [new file with mode: 0644]
include/linux/sched.h [new file with mode: 0644]
include/linux/spinlock.h
include/linux/timer.h [new file with mode: 0644]
include/linux/vmalloc.h [new file with mode: 0644]

diff --git a/include/asm/dma.h b/include/asm/dma.h
new file mode 100644 (file)
index 0000000..60abc15
--- /dev/null
@@ -0,0 +1,25 @@
+/*
+ * 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
+
index bf46295b28cd9c371339377fce18f4eba1a8d3dd..3b41c2c5eb816b281bdddae05214b1c988beae5a 100644 (file)
@@ -29,6 +29,8 @@
 #include <linux/kdev_t.h>
 #include <linux/malloc.h>
 #include <linux/errno.h>
+#include <linux/spinlock.h>
+
 #include <linux/comedi.h>
 
 
index 736b592df1a4b317c029dcee8d1acfd2802a77fd..7baf131477c36121e81c474cc2fc246fe726dec5 100644 (file)
@@ -7,11 +7,16 @@
 
 #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>
 
diff --git a/include/linux/kmod.h b/include/linux/kmod.h
new file mode 100644 (file)
index 0000000..f356b8f
--- /dev/null
@@ -0,0 +1,17 @@
+/*
+ * 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
+
index e7e38d13a97a2071849db1ef23292dfc6fc5b2e8..979b365a892255b17137576704cdf2853fd0e958 100644 (file)
@@ -23,6 +23,7 @@
   #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
diff --git a/include/linux/poll.h b/include/linux/poll.h
new file mode 100644 (file)
index 0000000..bafeb0a
--- /dev/null
@@ -0,0 +1,17 @@
+/*
+ * 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
+
diff --git a/include/linux/sched.h b/include/linux/sched.h
new file mode 100644 (file)
index 0000000..66d0af3
--- /dev/null
@@ -0,0 +1,17 @@
+/*
+ * 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
+
index aa71cbf738f0c034454e1d5de5b9af090a5cc3f2..8588796a1c7f24066f6ec4f9c5e20aa4a7758ad6 100644 (file)
@@ -7,11 +7,32 @@
 
 #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 */
diff --git a/include/linux/timer.h b/include/linux/timer.h
new file mode 100644 (file)
index 0000000..2b0f113
--- /dev/null
@@ -0,0 +1,18 @@
+/*
+ * 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
+
diff --git a/include/linux/vmalloc.h b/include/linux/vmalloc.h
new file mode 100644 (file)
index 0000000..def457c
--- /dev/null
@@ -0,0 +1,17 @@
+/*
+ * 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
+