]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - include/asm-s390/uaccess.h
[SCSI] qla2xxx: Add port-speed FC transport attribute.
[linux-2.6-omap-h63xx.git] / include / asm-s390 / uaccess.h
index 3e3bfe6a8fa84188f86f1acef2d17e84814771c3..be104f21c70a004dd8ac0c992267a031c126d3d7 100644 (file)
 #define segment_eq(a,b) ((a).ar4 == (b).ar4)
 
 
-#define __access_ok(addr,size) (1)
-
-#define access_ok(type,addr,size) __access_ok(addr,size)
-
-/* this function will go away soon - use access_ok() instead */
-extern inline int __deprecated verify_area(int type, const void __user *addr,
-                                               unsigned long size)
+static inline int __access_ok(const void *addr, unsigned long size)
 {
-       return access_ok(type, addr, size) ? 0 : -EFAULT;
+       return 1;
 }
+#define access_ok(type,addr,size) __access_ok(addr,size)
 
 /*
  * The exception table consists of pairs of addresses: the first is the
@@ -207,21 +202,37 @@ extern int __put_user_bad(void) __attribute__((noreturn));
 
 #define __get_user(x, ptr)                                     \
 ({                                                             \
-       __typeof__(*(ptr)) __x;                                 \
        int __gu_err;                                           \
         __chk_user_ptr(ptr);                                    \
        switch (sizeof(*(ptr))) {                               \
-       case 1:                                                 \
-       case 2:                                                 \
-       case 4:                                                 \
-       case 8:                                                 \
+       case 1: {                                               \
+               unsigned char __x;                              \
+               __get_user_asm(__x, ptr, __gu_err);             \
+               (x) = *(__typeof__(*(ptr)) *) &__x;             \
+               break;                                          \
+       };                                                      \
+       case 2: {                                               \
+               unsigned short __x;                             \
+               __get_user_asm(__x, ptr, __gu_err);             \
+               (x) = *(__typeof__(*(ptr)) *) &__x;             \
+               break;                                          \
+       };                                                      \
+       case 4: {                                               \
+               unsigned int __x;                               \
+               __get_user_asm(__x, ptr, __gu_err);             \
+               (x) = *(__typeof__(*(ptr)) *) &__x;             \
+               break;                                          \
+       };                                                      \
+       case 8: {                                               \
+               unsigned long long __x;                         \
                __get_user_asm(__x, ptr, __gu_err);             \
+               (x) = *(__typeof__(*(ptr)) *) &__x;             \
                break;                                          \
+       };                                                      \
        default:                                                \
                __get_user_bad();                               \
                break;                                          \
        }                                                       \
-       (x) = __x;                                              \
        __gu_err;                                               \
 })