patch-2.4.0-test3 linux/include/asm-mips/uaccess.h
Next file: linux/include/asm-mips64/addrspace.h
Previous file: linux/include/asm-mips/types.h
Back to the patch index
Back to the overall index
- Lines: 74
- Date:
Sun Jul 9 22:18:15 2000
- Orig file:
v2.4.0-test2/linux/include/asm-mips/uaccess.h
- Orig date:
Tue May 23 15:31:36 2000
diff -u --recursive --new-file v2.4.0-test2/linux/include/asm-mips/uaccess.h linux/include/asm-mips/uaccess.h
@@ -1,11 +1,10 @@
-/* $Id: uaccess.h,v 1.12 2000/02/21 18:05:07 ralf Exp $
- *
+/*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
* for more details.
*
- * Copyright (C) 1996, 1997, 1998, 1999 by Ralf Baechle
- * Copyright (C) 1999 Silicon Graphics, Inc.
+ * Copyright (C) 1996, 1997, 1998, 1999, 2000 by Ralf Baechle
+ * Copyright (C) 1999, 2000 Silicon Graphics, Inc.
*/
#ifndef _ASM_UACCESS_H
#define _ASM_UACCESS_H
@@ -70,16 +69,20 @@
* (a) re-use the arguments for side effects (sizeof is ok)
* (b) require any knowledge of processes at this stage
*/
-#define put_user(x,ptr) __put_user_check((x),(ptr),sizeof(*(ptr)),__access_mask)
-#define get_user(x,ptr) __get_user_check((x),(ptr),sizeof(*(ptr)),__access_mask)
+#define put_user(x,ptr) \
+ __put_user_check((__typeof__(*(ptr)))(x),(ptr),sizeof(*(ptr)))
+#define get_user(x,ptr) \
+ __get_user_check((__typeof__(*(ptr)))(x),(ptr),sizeof(*(ptr)))
/*
* The "__xxx" versions do not do address space checking, useful when
* doing multiple accesses to the same area (the user has to do the
* checks by hand with "access_ok()")
*/
-#define __put_user(x,ptr) __put_user_nocheck((x),(ptr),sizeof(*(ptr)))
-#define __get_user(x,ptr) __get_user_nocheck((x),(ptr),sizeof(*(ptr)))
+#define __put_user(x,ptr) \
+ __put_user_nocheck((__typeof__(*(ptr)))(x),(ptr),sizeof(*(ptr)))
+#define __get_user(x,ptr) \
+ __get_user_nocheck((__typeof__(*(ptr)))(x),(ptr),sizeof(*(ptr)))
/*
* The "xxx_ret" versions return constant specified in third argument, if
@@ -127,14 +130,14 @@
default: __get_user_unknown(); break; \
} x = (__typeof__(*(ptr))) __gu_val; __gu_err; })
-#define __get_user_check(x,ptr,size,mask) ({ \
+#define __get_user_check(x,ptr,size) ({ \
long __gu_err; \
__typeof__(*(ptr)) __gu_val; \
long __gu_addr; \
__asm__("":"=r" (__gu_val)); \
__gu_addr = (long) (ptr); \
__asm__("":"=r" (__gu_err)); \
-if (__access_ok(__gu_addr,size,mask)) { \
+if (__access_ok(__gu_addr,size,__access_mask)) { \
switch (size) { \
case 1: __get_user_asm("lb"); break; \
case 2: __get_user_asm("lh"); break; \
@@ -210,14 +213,14 @@
default: __put_user_unknown(); break; \
} __pu_err; })
-#define __put_user_check(x,ptr,size,mask) ({ \
+#define __put_user_check(x,ptr,size) ({ \
long __pu_err; \
__typeof__(*(ptr)) __pu_val; \
long __pu_addr; \
__pu_val = (x); \
__pu_addr = (long) (ptr); \
__asm__("":"=r" (__pu_err)); \
-if (__access_ok(__pu_addr,size,mask)) { \
+if (__access_ok(__pu_addr,size,__access_mask)) { \
switch (size) { \
case 1: __put_user_asm("sb"); break; \
case 2: __put_user_asm("sh"); break; \
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)