X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=include%2Fasm-um%2Fuaccess.h;h=b9a895d6fa1df7cf0447573e58983f5b095e36d2;hb=8192ab42bf60e1e9b7efa046990e9cc5e4a95cf4;hp=bea5a015f6674b4102030cf81de18813a07e2883;hpb=a8b59e79ed55de97949ff1ca7d933786b95b39bd;p=powerpc.git diff --git a/include/asm-um/uaccess.h b/include/asm-um/uaccess.h index bea5a015f6..b9a895d6fa 100644 --- a/include/asm-um/uaccess.h +++ b/include/asm-um/uaccess.h @@ -6,7 +6,15 @@ #ifndef __UM_UACCESS_H #define __UM_UACCESS_H -#include "linux/sched.h" +#include +#include + +/* 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 @@ -41,11 +49,11 @@ #define __get_user(x, ptr) \ ({ \ - const __typeof__(ptr) __private_ptr = ptr; \ + const __typeof__(*(ptr)) __user *__private_ptr = (ptr); \ __typeof__(x) __private_val; \ int __private_ret = -EFAULT; \ (x) = (__typeof__(*(__private_ptr)))0; \ - if (__copy_from_user((void *) &__private_val, (__private_ptr), \ + if (__copy_from_user((__force void *)&__private_val, (__private_ptr),\ sizeof(*(__private_ptr))) == 0) { \ (x) = (__typeof__(*(__private_ptr))) __private_val; \ __private_ret = 0; \ @@ -62,7 +70,7 @@ #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 {