Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
uaccess_64.h
Go to the documentation of this file.
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((void *)&x, \
30  (long)ptr); \
31  break; \
32  case 2: \
33  retval = __get_user_asm_w((void *)&x, \
34  (long)ptr); \
35  break; \
36  case 4: \
37  retval = __get_user_asm_l((void *)&x, \
38  (long)ptr); \
39  break; \
40  case 8: \
41  retval = __get_user_asm_q((void *)&x, \
42  (long)ptr); \
43  break; \
44  default: \
45  __get_user_unknown(); \
46  break; \
47  } \
48 } while (0)
49 
50 extern long __get_user_asm_b(void *, long);
51 extern long __get_user_asm_w(void *, long);
52 extern long __get_user_asm_l(void *, long);
53 extern long __get_user_asm_q(void *, long);
54 extern void __get_user_unknown(void);
55 
56 #define __put_user_size(x,ptr,size,retval) \
57 do { \
58  retval = 0; \
59  switch (size) { \
60  case 1: \
61  retval = __put_user_asm_b((void *)&x, \
62  (long)ptr); \
63  break; \
64  case 2: \
65  retval = __put_user_asm_w((void *)&x, \
66  (long)ptr); \
67  break; \
68  case 4: \
69  retval = __put_user_asm_l((void *)&x, \
70  (long)ptr); \
71  break; \
72  case 8: \
73  retval = __put_user_asm_q((void *)&x, \
74  (long)ptr); \
75  break; \
76  default: \
77  __put_user_unknown(); \
78  } \
79 } while (0)
80 
81 extern long __put_user_asm_b(void *, long);
82 extern long __put_user_asm_w(void *, long);
83 extern long __put_user_asm_l(void *, long);
84 extern long __put_user_asm_q(void *, long);
85 extern void __put_user_unknown(void);
86 
87 #endif /* __ASM_SH_UACCESS_64_H */