Go to the documentation of this file.
13 #ifndef _ASM_PACCESS_H
14 #define _ASM_PACCESS_H
16 #include <linux/errno.h>
19 #define __PA_ADDR ".word"
22 #define __PA_ADDR ".dword"
28 #define put_dbe(x, ptr) __put_dbe((x), (ptr), sizeof(*(ptr)))
29 #define get_dbe(x, ptr) __get_dbe((x), (ptr), sizeof(*(ptr)))
32 #define __mp(x) (*(struct __large_pstruct *)(x))
34 #define __get_dbe(x, ptr, size) \
37 __typeof__(*(ptr)) __gu_val; \
38 unsigned long __gu_addr; \
39 __asm__("":"=r" (__gu_val)); \
40 __gu_addr = (unsigned long) (ptr); \
41 __asm__("":"=r" (__gu_err)); \
43 case 1: __get_dbe_asm("lb"); break; \
44 case 2: __get_dbe_asm("lh"); break; \
45 case 4: __get_dbe_asm("lw"); break; \
46 case 8: __get_dbe_asm("ld"); break; \
47 default: __get_dbe_unknown(); break; \
49 x = (__typeof__(*(ptr))) __gu_val; \
53 #define __get_dbe_asm(insn) \
55 __asm__ __volatile__( \
56 "1:\t" insn "\t%1,%2\n\t" \
59 ".section\t.fixup,\"ax\"\n" \
64 ".section\t__dbe_table,\"a\"\n\t" \
65 __PA_ADDR "\t1b, 3b\n\t" \
67 :"=r" (__gu_err), "=r" (__gu_val) \
68 :"o" (__mp(__gu_addr)), "i" (-EFAULT)); \
73 #define __put_dbe(x, ptr, size) \
76 __typeof__(*(ptr)) __pu_val; \
79 __pu_addr = (long) (ptr); \
80 __asm__("":"=r" (__pu_err)); \
82 case 1: __put_dbe_asm("sb"); break; \
83 case 2: __put_dbe_asm("sh"); break; \
84 case 4: __put_dbe_asm("sw"); break; \
85 case 8: __put_dbe_asm("sd"); break; \
86 default: __put_dbe_unknown(); break; \
91 #define __put_dbe_asm(insn) \
93 __asm__ __volatile__( \
94 "1:\t" insn "\t%1,%2\n\t" \
97 ".section\t.fixup,\"ax\"\n" \
101 ".section\t__dbe_table,\"a\"\n\t" \
102 __PA_ADDR "\t1b, 3b\n\t" \
105 : "r" (__pu_val), "o" (__mp(__pu_addr)), "i" (-EFAULT)); \