Merge tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost
[cris-mirror.git] / arch / sh / include / asm / uaccess_64.h
blobca5073dd459674d1ad835406fc46baa1957d01ac
1 #ifndef __ASM_SH_UACCESS_64_H
2 #define __ASM_SH_UACCESS_64_H
4 /*
5 * include/asm-sh/uaccess_64.h
7 * Copyright (C) 2000, 2001 Paolo Alberelli
8 * Copyright (C) 2003, 2004 Paul Mundt
10 * User space memory access functions
12 * Copyright (C) 1999 Niibe Yutaka
14 * Based on:
15 * MIPS implementation version 1.15 by
16 * Copyright (C) 1996, 1997, 1998 by Ralf Baechle
17 * and i386 version.
19 * This file is subject to the terms and conditions of the GNU General Public
20 * License. See the file "COPYING" in the main directory of this archive
21 * for more details.
24 #define __get_user_size(x,ptr,size,retval) \
25 do { \
26 retval = 0; \
27 x = 0; \
28 switch (size) { \
29 case 1: \
30 retval = __get_user_asm_b((void *)&x, \
31 (long)ptr); \
32 break; \
33 case 2: \
34 retval = __get_user_asm_w((void *)&x, \
35 (long)ptr); \
36 break; \
37 case 4: \
38 retval = __get_user_asm_l((void *)&x, \
39 (long)ptr); \
40 break; \
41 case 8: \
42 retval = __get_user_asm_q((void *)&x, \
43 (long)ptr); \
44 break; \
45 default: \
46 __get_user_unknown(); \
47 break; \
48 } \
49 } while (0)
51 extern long __get_user_asm_b(void *, long);
52 extern long __get_user_asm_w(void *, long);
53 extern long __get_user_asm_l(void *, long);
54 extern long __get_user_asm_q(void *, long);
55 extern void __get_user_unknown(void);
57 #define __put_user_size(x,ptr,size,retval) \
58 do { \
59 retval = 0; \
60 switch (size) { \
61 case 1: \
62 retval = __put_user_asm_b((void *)&x, \
63 (__force long)ptr); \
64 break; \
65 case 2: \
66 retval = __put_user_asm_w((void *)&x, \
67 (__force long)ptr); \
68 break; \
69 case 4: \
70 retval = __put_user_asm_l((void *)&x, \
71 (__force long)ptr); \
72 break; \
73 case 8: \
74 retval = __put_user_asm_q((void *)&x, \
75 (__force long)ptr); \
76 break; \
77 default: \
78 __put_user_unknown(); \
79 } \
80 } while (0)
82 extern long __put_user_asm_b(void *, long);
83 extern long __put_user_asm_w(void *, long);
84 extern long __put_user_asm_l(void *, long);
85 extern long __put_user_asm_q(void *, long);
86 extern void __put_user_unknown(void);
88 #endif /* __ASM_SH_UACCESS_64_H */