2007-11-28 06:19:38 -05:00
|
|
|
#ifndef __ASM_SH_UACCESS_64_H
|
|
|
|
#define __ASM_SH_UACCESS_64_H
|
2005-04-16 18:20:36 -04:00
|
|
|
|
|
|
|
/*
|
2007-11-28 06:19:38 -05:00
|
|
|
* include/asm-sh/uaccess_64.h
|
2005-04-16 18:20:36 -04: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 06:19:38 -05: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-16 18:20:36 -04:00
|
|
|
*/
|
|
|
|
|
|
|
|
#define __get_user_size(x,ptr,size,retval) \
|
|
|
|
do { \
|
|
|
|
retval = 0; \
|
|
|
|
switch (size) { \
|
|
|
|
case 1: \
|
2008-09-29 06:43:44 -04:00
|
|
|
retval = __get_user_asm_b((void *)&x, \
|
|
|
|
(long)ptr); \
|
2005-04-16 18:20:36 -04:00
|
|
|
break; \
|
|
|
|
case 2: \
|
2008-09-29 06:43:44 -04:00
|
|
|
retval = __get_user_asm_w((void *)&x, \
|
|
|
|
(long)ptr); \
|
2005-04-16 18:20:36 -04:00
|
|
|
break; \
|
|
|
|
case 4: \
|
2008-09-29 06:43:44 -04:00
|
|
|
retval = __get_user_asm_l((void *)&x, \
|
|
|
|
(long)ptr); \
|
2005-04-16 18:20:36 -04:00
|
|
|
break; \
|
|
|
|
case 8: \
|
2008-09-29 06:43:44 -04:00
|
|
|
retval = __get_user_asm_q((void *)&x, \
|
|
|
|
(long)ptr); \
|
2005-04-16 18:20:36 -04: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 06:43:44 -04:00
|
|
|
retval = __put_user_asm_b((void *)&x, \
|
|
|
|
(long)ptr); \
|
2005-04-16 18:20:36 -04:00
|
|
|
break; \
|
|
|
|
case 2: \
|
2008-09-29 06:43:44 -04:00
|
|
|
retval = __put_user_asm_w((void *)&x, \
|
|
|
|
(long)ptr); \
|
2005-04-16 18:20:36 -04:00
|
|
|
break; \
|
|
|
|
case 4: \
|
2008-09-29 06:43:44 -04:00
|
|
|
retval = __put_user_asm_l((void *)&x, \
|
|
|
|
(long)ptr); \
|
2005-04-16 18:20:36 -04:00
|
|
|
break; \
|
|
|
|
case 8: \
|
2008-09-29 06:43:44 -04:00
|
|
|
retval = __put_user_asm_q((void *)&x, \
|
|
|
|
(long)ptr); \
|
2005-04-16 18:20:36 -04: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);
|
|
|
|
|
2008-08-22 11:20:29 -04:00
|
|
|
extern long __strnlen_user(const char *__s, long __n);
|
2008-09-29 06:45:16 -04:00
|
|
|
extern int __strncpy_from_user(unsigned long __dest,
|
|
|
|
unsigned long __user __src, int __count);
|
2008-08-22 11:20:29 -04:00
|
|
|
|
2007-11-28 06:19:38 -05:00
|
|
|
#endif /* __ASM_SH_UACCESS_64_H */
|