]> err.no Git - linux-2.6/blobdiff - include/asm-um/uaccess.h
sh: Fix DMAC base address for SH7709S
[linux-2.6] / include / asm-um / uaccess.h
index 801710d00a404ec6dd175714a9e074789ffe158e..b9a895d6fa1df7cf0447573e58983f5b095e36d2 100644 (file)
@@ -6,7 +6,15 @@
 #ifndef __UM_UACCESS_H
 #define __UM_UACCESS_H
 
-#include "linux/sched.h"
+#include <asm/errno.h>
+#include <asm/processor.h>
+
+/* thread_info has a mm_segment_t in it, so put the definition up here */
+typedef struct {
+       unsigned long seg;
+} mm_segment_t;
+
+#include "linux/thread_info.h"
 
 #define VERIFY_READ 0
 #define VERIFY_WRITE 1
 
 #define __get_user(x, ptr) \
 ({ \
-        const __typeof__(ptr) __private_ptr = ptr; \
-        __typeof__(*(__private_ptr)) __private_val; \
-        int __private_ret = -EFAULT; \
-        (x) = 0; \
-       if (__copy_from_user(&__private_val, (__private_ptr), \
-           sizeof(*(__private_ptr))) == 0) {\
-               (x) = (__typeof__(*(__private_ptr))) __private_val; \
-               __private_ret = 0; \
-       } \
-        __private_ret; \
+       const __typeof__(*(ptr)) __user *__private_ptr = (ptr); \
+       __typeof__(x) __private_val;                    \
+       int __private_ret = -EFAULT;                    \
+       (x) = (__typeof__(*(__private_ptr)))0;                          \
+       if (__copy_from_user((__force void *)&__private_val, (__private_ptr),\
+                            sizeof(*(__private_ptr))) == 0) {          \
+               (x) = (__typeof__(*(__private_ptr))) __private_val;     \
+               __private_ret = 0;                                      \
+       }                                                               \
+       __private_ret;                                                  \
 }) 
 
 #define get_user(x, ptr) \
 ({ \
         const __typeof__((*(ptr))) __user *private_ptr = (ptr); \
         (access_ok(VERIFY_READ, private_ptr, sizeof(*private_ptr)) ? \
-        __get_user(x, private_ptr) : ((x) = 0, -EFAULT)); \
+        __get_user(x, private_ptr) : ((x) = (__typeof__(*ptr))0, -EFAULT)); \
 })
 
 #define __put_user(x, ptr) \
 ({ \
-        __typeof__(ptr) __private_ptr = ptr; \
+        __typeof__(*(ptr)) __user *__private_ptr = ptr; \
         __typeof__(*(__private_ptr)) __private_val; \
         int __private_ret = -EFAULT; \
         __private_val = (__typeof__(*(__private_ptr))) (x); \
@@ -80,7 +88,7 @@
         __put_user(x, private_ptr) : -EFAULT); \
 })
 
-#define strlen_user(str) strnlen_user(str, ~0UL >> 1)
+#define strlen_user(str) strnlen_user(str, ~0U >> 1)
 
 struct exception_table_entry
 {
@@ -89,14 +97,3 @@ struct exception_table_entry
 };
 
 #endif
-
-/*
- * Overrides for Emacs so that we follow Linus's tabbing style.
- * Emacs will notice this stuff at the end of the file and automatically
- * adjust the settings for this buffer only.  This must remain at the end
- * of the file.
- * ---------------------------------------------------------------------------
- * Local variables:
- * c-file-style: "linux"
- * End:
- */