patch-2.4.19 linux-2.4.19/include/asm-s390x/uaccess.h
Next file: linux-2.4.19/include/asm-s390x/unistd.h
Previous file: linux-2.4.19/include/asm-s390x/timex.h
Back to the patch index
Back to the overall index
- Lines: 126
- Date:
Fri Aug 2 17:39:45 2002
- Orig file:
linux-2.4.18/include/asm-s390x/uaccess.h
- Orig date:
Mon Feb 25 11:38:13 2002
diff -urN linux-2.4.18/include/asm-s390x/uaccess.h linux-2.4.19/include/asm-s390x/uaccess.h
@@ -175,42 +175,37 @@
*/
#define __put_user(x, ptr) \
({ \
+ __typeof__(*(ptr)) *__pu_addr = (ptr); \
+ __typeof__(*(ptr)) __x = (x); \
int __pu_err; \
- switch (sizeof (*(ptr))) { \
- case 1: \
- __pu_err = __put_user_asm_1((__u8)(__u64)(x),(ptr));\
- break; \
- case 2: \
- __pu_err = __put_user_asm_2((__u16)(__u64)(x),(ptr));\
- break; \
- case 4: \
- __pu_err = __put_user_asm_4((__u32)(__u64)(x),(ptr));\
- break; \
- case 8: \
- __pu_err = __put_user_asm_8((__u64)(x),(ptr));\
- break; \
- default: \
+ switch (sizeof (*(__pu_addr))) { \
+ case 1: \
+ __pu_err = __put_user_asm_1((__u8)(__u64)(__x), \
+ __pu_addr); \
+ break; \
+ case 2: \
+ __pu_err = __put_user_asm_2((__u16)(__u64)(__x),\
+ __pu_addr); \
+ break; \
+ case 4: \
+ __pu_err = __put_user_asm_4((__u32)(__u64)(__x),\
+ __pu_addr); \
+ break; \
+ case 8: \
+ __pu_err = __put_user_asm_8((__u64)(__x), \
+ __pu_addr); \
+ break; \
+ default: \
__pu_err = __put_user_bad(); \
break; \
} \
__pu_err; \
})
-#define put_user(x, ptr) \
-({ \
- long __pu_err = -EFAULT; \
- __typeof__(*(ptr)) *__pu_addr = (ptr); \
- __typeof__(*(ptr)) __x = (x); \
- if (__access_ok((long)__pu_addr,sizeof(*(ptr)))) { \
- __pu_err = 0; \
- __put_user((__x), (__pu_addr)); \
- } \
- __pu_err; \
-})
+#define put_user(x, ptr) __put_user(x, ptr)
extern int __put_user_bad(void);
-
#define __get_user_asm_8(x, ptr, err) \
({ \
__asm__ __volatile__ ( " sr %1,%1\n" \
@@ -293,42 +288,32 @@
#define __get_user(x, ptr) \
({ \
+ __typeof__(ptr) __gu_addr = (ptr); \
+ __typeof__(*(ptr)) __x; \
int __gu_err; \
switch (sizeof(*(ptr))) { \
- case 1: \
- __get_user_asm_1(x,ptr,__gu_err); \
- break; \
- case 2: \
- __get_user_asm_2(x,ptr,__gu_err); \
- break; \
- case 4: \
- __get_user_asm_4(x,ptr,__gu_err); \
- break; \
- case 8: \
- __get_user_asm_8(x,ptr,__gu_err); \
- break; \
- default: \
- (x) = 0; \
- __gu_err = __get_user_bad(); \
+ case 1: \
+ __get_user_asm_1(__x,__gu_addr,__gu_err); \
+ break; \
+ case 2: \
+ __get_user_asm_2(__x,__gu_addr,__gu_err); \
+ break; \
+ case 4: \
+ __get_user_asm_4(__x,__gu_addr,__gu_err); \
+ break; \
+ case 8: \
+ __get_user_asm_8(__x,__gu_addr,__gu_err); \
+ break; \
+ default: \
+ __x = 0; \
+ __gu_err = __get_user_bad(); \
break; \
} \
+ (x) = __x; \
__gu_err; \
})
-#define get_user(x, ptr) \
-({ \
- long __gu_err = -EFAULT; \
- __typeof__(ptr) __gu_addr = (ptr); \
- __typeof__(*(ptr)) __x; \
- if (__access_ok((long)__gu_addr,sizeof(*(ptr)))) { \
- __gu_err = 0; \
- __get_user((__x), (__gu_addr)); \
- (x) = __x; \
- } \
- else \
- (x) = 0; \
- __gu_err; \
-})
+#define get_user(x, ptr) __get_user(x, ptr)
extern int __get_user_bad(void);
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)