sh: migrate to arch/sh/include/
[linux-2.6.git] / arch / sh / include / asm / uaccess_64.h
1 #ifndef __ASM_SH_UACCESS_64_H
2 #define __ASM_SH_UACCESS_64_H
3
4 /*
5  * include/asm-sh/uaccess_64.h
6  *
7  * Copyright (C) 2000, 2001  Paolo Alberelli
8  * Copyright (C) 2003, 2004  Paul Mundt
9  *
10  * User space memory access functions
11  *
12  * Copyright (C) 1999  Niibe Yutaka
13  *
14  *  Based on:
15  *     MIPS implementation version 1.15 by
16  *              Copyright (C) 1996, 1997, 1998 by Ralf Baechle
17  *     and i386 version.
18  *
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.
22  */
23
24 #define __get_user_size(x,ptr,size,retval)                      \
25 do {                                                            \
26         retval = 0;                                             \
27         switch (size) {                                         \
28         case 1:                                                 \
29                 retval = __get_user_asm_b(x, ptr);              \
30                 break;                                          \
31         case 2:                                                 \
32                 retval = __get_user_asm_w(x, ptr);              \
33                 break;                                          \
34         case 4:                                                 \
35                 retval = __get_user_asm_l(x, ptr);              \
36                 break;                                          \
37         case 8:                                                 \
38                 retval = __get_user_asm_q(x, ptr);              \
39                 break;                                          \
40         default:                                                \
41                 __get_user_unknown();                           \
42                 break;                                          \
43         }                                                       \
44 } while (0)
45
46 extern long __get_user_asm_b(void *, long);
47 extern long __get_user_asm_w(void *, long);
48 extern long __get_user_asm_l(void *, long);
49 extern long __get_user_asm_q(void *, long);
50 extern void __get_user_unknown(void);
51
52 #define __put_user_size(x,ptr,size,retval)                      \
53 do {                                                            \
54         retval = 0;                                             \
55         switch (size) {                                         \
56         case 1:                                                 \
57                 retval = __put_user_asm_b(x, ptr);              \
58                 break;                                          \
59         case 2:                                                 \
60                 retval = __put_user_asm_w(x, ptr);              \
61                 break;                                          \
62         case 4:                                                 \
63                 retval = __put_user_asm_l(x, ptr);              \
64                 break;                                          \
65         case 8:                                                 \
66                 retval = __put_user_asm_q(x, ptr);              \
67                 break;                                          \
68         default:                                                \
69                 __put_user_unknown();                           \
70         }                                                       \
71 } while (0)
72
73 extern long __put_user_asm_b(void *, long);
74 extern long __put_user_asm_w(void *, long);
75 extern long __put_user_asm_l(void *, long);
76 extern long __put_user_asm_q(void *, long);
77 extern void __put_user_unknown(void);
78
79 #endif /* __ASM_SH_UACCESS_64_H */