new
authorDavid Schleef <ds@schleef.org>
Sun, 15 Oct 2000 22:33:01 +0000 (22:33 +0000)
committerDavid Schleef <ds@schleef.org>
Sun, 15 Oct 2000 22:33:01 +0000 (22:33 +0000)
include/asm/uaccess.h [new file with mode: 0644]
include/linux/wait.h [new file with mode: 0644]

diff --git a/include/asm/uaccess.h b/include/asm/uaccess.h
new file mode 100644 (file)
index 0000000..0123547
--- /dev/null
@@ -0,0 +1,48 @@
+
+#ifndef __COMPAT_ASM_UACCESS_H
+#define __COMPAT_ASM_UACCESS_H
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,2,0)
+/* unknown, approx 2.1.4 */
+
+
+#include <asm/segment.h>
+
+static inline int copy_to_user(void * to,const void *from,unsigned long n_bytes)
+{
+       int i;
+
+       if((i=verify_area(VERIFY_WRITE,to,n_bytes)) != 0)
+               return i;
+       memcpy_tofs(to,from,n_bytes);
+       return 0;
+}
+
+static inline int copy_from_user(void * to,const void *from,unsigned long n_bytes)
+{
+       int i;
+       if((i=verify_area(VERIFY_READ,from,n_bytes))!=0)
+               return i;
+       memcpy_fromfs(to,from,n_bytes);
+       return 0;
+}
+
+static inline int clear_user(void * mem,unsigned long len)
+{
+       char *cmem=mem;
+       
+       if(verify_area(VERIFY_WRITE,mem,len))
+               return len;
+       /* this is slow, but I'm lazy */
+       while(len--){put_user(0,cmem);cmem++;}
+       return 0;
+}
+
+#else
+
+#include_next <asm/uaccess.h>
+
+#endif
+
+#endif
+
diff --git a/include/linux/wait.h b/include/linux/wait.h
new file mode 100644 (file)
index 0000000..43a378c
--- /dev/null
@@ -0,0 +1,16 @@
+
+#ifndef __COMPAT_LINUX_WAIT_H
+#define __COMPAT_LINUX_WAIT_H
+
+#include <linux/version.h>
+
+#include_next <linux/wait.h>
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,2,18)
+typedef struct wait_queue *wait_queue_head_t;
+#define DECLARE_WAITQUEUE(x,y) struct wait_queue x={y,NULL}
+#define init_waitqueue_head(x)
+#endif
+
+#endif
+