2007-11-28 19:19:38 +08:00
|
|
|
#ifndef __ASM_SH_UACCESS_64_H
|
|
|
|
#define __ASM_SH_UACCESS_64_H
|
2005-04-17 06:20:36 +08:00
|
|
|
|
|
|
|
/*
|
2007-11-28 19:19:38 +08:00
|
|
|
* include/asm-sh/uaccess_64.h
|
2005-04-17 06:20:36 +08:00
|
|
|
*
|
|
|
|
* Copyright (C) 2000, 2001 Paolo Alberelli
|
|
|
|
* Copyright (C) 2003, 2004 Paul Mundt
|
|
|
|
*
|
|
|
|
* User space memory access functions
|
|
|
|
*
|
|
|
|
* Copyright (C) 1999 Niibe Yutaka
|
|
|
|
*
|
|
|
|
* Based on:
|
|
|
|
* MIPS implementation version 1.15 by
|
|
|
|
* Copyright (C) 1996, 1997, 1998 by Ralf Baechle
|
|
|
|
* and i386 version.
|
|
|
|
*
|
2007-11-28 19:19:38 +08:00
|
|
|
* 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.
|
2005-04-17 06:20:36 +08:00
|
|
|
*/
|
|
|
|
|
|
|
|
#define __get_user_size(x,ptr,size,retval) \
|
|
|
|
do { \
|
|
|
|
retval = 0; \
|
2016-08-22 11:33:47 +08:00
|
|
|
x = 0; \
|
2005-04-17 06:20:36 +08:00
|
|
|
switch (size) { \
|
|
|
|
case 1: \
|
2008-09-29 18:43:44 +08:00
|
|
|
retval = __get_user_asm_b((void *)&x, \
|
|
|
|
(long)ptr); \
|
2005-04-17 06:20:36 +08:00
|
|
|
break; \
|
|
|
|
case 2: \
|
2008-09-29 18:43:44 +08:00
|
|
|
retval = __get_user_asm_w((void *)&x, \
|
|
|
|
(long)ptr); \
|
2005-04-17 06:20:36 +08:00
|
|
|
break; \
|
|
|
|
case 4: \
|
2008-09-29 18:43:44 +08:00
|
|
|
retval = __get_user_asm_l((void *)&x, \
|
|
|
|
(long)ptr); \
|
2005-04-17 06:20:36 +08:00
|
|
|
break; \
|
|
|
|
case 8: \
|
2008-09-29 18:43:44 +08:00
|
|
|
retval = __get_user_asm_q((void *)&x, \
|
|
|
|
(long)ptr); \
|
2005-04-17 06:20:36 +08:00
|
|
|
break; \
|
|
|
|
default: \
|
|
|
|
__get_user_unknown(); \
|
|
|
|
break; \
|
|
|
|
} \
|
|
|
|
} while (0)
|
|
|
|
|
|
|
|
extern long __get_user_asm_b(void *, long);
|
|
|
|
extern long __get_user_asm_w(void *, long);
|
|
|
|
extern long __get_user_asm_l(void *, long);
|
|
|
|
extern long __get_user_asm_q(void *, long);
|
|
|
|
extern void __get_user_unknown(void);
|
|
|
|
|
|
|
|
#define __put_user_size(x,ptr,size,retval) \
|
|
|
|
do { \
|
|
|
|
retval = 0; \
|
|
|
|
switch (size) { \
|
|
|
|
case 1: \
|
2008-09-29 18:43:44 +08:00
|
|
|
retval = __put_user_asm_b((void *)&x, \
|
2015-01-06 20:37:22 +08:00
|
|
|
(__force long)ptr); \
|
2005-04-17 06:20:36 +08:00
|
|
|
break; \
|
|
|
|
case 2: \
|
2008-09-29 18:43:44 +08:00
|
|
|
retval = __put_user_asm_w((void *)&x, \
|
2015-01-06 20:37:22 +08:00
|
|
|
(__force long)ptr); \
|
2005-04-17 06:20:36 +08:00
|
|
|
break; \
|
|
|
|
case 4: \
|
2008-09-29 18:43:44 +08:00
|
|
|
retval = __put_user_asm_l((void *)&x, \
|
2015-01-06 20:37:22 +08:00
|
|
|
(__force long)ptr); \
|
2005-04-17 06:20:36 +08:00
|
|
|
break; \
|
|
|
|
case 8: \
|
2008-09-29 18:43:44 +08:00
|
|
|
retval = __put_user_asm_q((void *)&x, \
|
2015-01-06 20:37:22 +08:00
|
|
|
(__force long)ptr); \
|
2005-04-17 06:20:36 +08:00
|
|
|
break; \
|
|
|
|
default: \
|
|
|
|
__put_user_unknown(); \
|
|
|
|
} \
|
|
|
|
} while (0)
|
|
|
|
|
|
|
|
extern long __put_user_asm_b(void *, long);
|
|
|
|
extern long __put_user_asm_w(void *, long);
|
|
|
|
extern long __put_user_asm_l(void *, long);
|
|
|
|
extern long __put_user_asm_q(void *, long);
|
|
|
|
extern void __put_user_unknown(void);
|
|
|
|
|
2007-11-28 19:19:38 +08:00
|
|
|
#endif /* __ASM_SH_UACCESS_64_H */
|