aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-parisc/uaccess.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/asm-parisc/uaccess.h')
-rw-r--r--include/asm-parisc/uaccess.h53
1 files changed, 21 insertions, 32 deletions
diff --git a/include/asm-parisc/uaccess.h b/include/asm-parisc/uaccess.h
index d5d831ea7bc6..4878b9501f24 100644
--- a/include/asm-parisc/uaccess.h
+++ b/include/asm-parisc/uaccess.h
@@ -67,6 +67,11 @@ struct exception_table_entry {
67 long fixup; /* fixup routine */ 67 long fixup; /* fixup routine */
68}; 68};
69 69
70#define ASM_EXCEPTIONTABLE_ENTRY( fault_addr, except_addr )\
71 ".section __ex_table,\"aw\"\n" \
72 ASM_WORD_INSN #fault_addr ", " #except_addr "\n\t" \
73 ".previous\n"
74
70/* 75/*
71 * The page fault handler stores, in a per-cpu area, the following information 76 * The page fault handler stores, in a per-cpu area, the following information
72 * if a fixup routine is available. 77 * if a fixup routine is available.
@@ -106,21 +111,15 @@ struct exception_data {
106}) 111})
107 112
108#define __get_kernel_asm(ldx,ptr) \ 113#define __get_kernel_asm(ldx,ptr) \
109 __asm__("\n1:\t" ldx "\t0(%2),%0\n" \ 114 __asm__("\n1:\t" ldx "\t0(%2),%0\n\t" \
110 "\t.section __ex_table,\"aw\"\n" \ 115 ASM_EXCEPTIONTABLE_ENTRY(1b, fixup_get_user_skip_1)\
111 "\t" ASM_WORD_INSN \
112 "1b,fixup_get_user_skip_1\n" \
113 "\t.previous" \
114 : "=r"(__gu_val), "=r"(__gu_err) \ 116 : "=r"(__gu_val), "=r"(__gu_err) \
115 : "r"(ptr), "1"(__gu_err) \ 117 : "r"(ptr), "1"(__gu_err) \
116 : "r1"); 118 : "r1");
117 119
118#define __get_user_asm(ldx,ptr) \ 120#define __get_user_asm(ldx,ptr) \
119 __asm__("\n1:\t" ldx "\t0(%%sr3,%2),%0\n" \ 121 __asm__("\n1:\t" ldx "\t0(%%sr3,%2),%0\n\t" \
120 "\t.section __ex_table,\"aw\"\n" \ 122 ASM_EXCEPTIONTABLE_ENTRY(1b,fixup_get_user_skip_1)\
121 "\t" ASM_WORD_INSN \
122 "1b,fixup_get_user_skip_1\n" \
123 "\t.previous" \
124 : "=r"(__gu_val), "=r"(__gu_err) \ 123 : "=r"(__gu_val), "=r"(__gu_err) \
125 : "r"(ptr), "1"(__gu_err) \ 124 : "r"(ptr), "1"(__gu_err) \
126 : "r1"); 125 : "r1");
@@ -164,22 +163,16 @@ struct exception_data {
164 163
165#define __put_kernel_asm(stx,x,ptr) \ 164#define __put_kernel_asm(stx,x,ptr) \
166 __asm__ __volatile__ ( \ 165 __asm__ __volatile__ ( \
167 "\n1:\t" stx "\t%2,0(%1)\n" \ 166 "\n1:\t" stx "\t%2,0(%1)\n\t" \
168 "\t.section __ex_table,\"aw\"\n" \ 167 ASM_EXCEPTIONTABLE_ENTRY(1b,fixup_put_user_skip_1)\
169 "\t" ASM_WORD_INSN \
170 "1b,fixup_put_user_skip_1\n" \
171 "\t.previous" \
172 : "=r"(__pu_err) \ 168 : "=r"(__pu_err) \
173 : "r"(ptr), "r"(x), "0"(__pu_err) \ 169 : "r"(ptr), "r"(x), "0"(__pu_err) \
174 : "r1") 170 : "r1")
175 171
176#define __put_user_asm(stx,x,ptr) \ 172#define __put_user_asm(stx,x,ptr) \
177 __asm__ __volatile__ ( \ 173 __asm__ __volatile__ ( \
178 "\n1:\t" stx "\t%2,0(%%sr3,%1)\n" \ 174 "\n1:\t" stx "\t%2,0(%%sr3,%1)\n\t" \
179 "\t.section __ex_table,\"aw\"\n" \ 175 ASM_EXCEPTIONTABLE_ENTRY(1b,fixup_put_user_skip_1)\
180 "\t" ASM_WORD_INSN \
181 "1b,fixup_put_user_skip_1\n" \
182 "\t.previous" \
183 : "=r"(__pu_err) \ 176 : "=r"(__pu_err) \
184 : "r"(ptr), "r"(x), "0"(__pu_err) \ 177 : "r"(ptr), "r"(x), "0"(__pu_err) \
185 : "r1") 178 : "r1")
@@ -192,12 +185,10 @@ struct exception_data {
192 u32 hi = (__val64) >> 32; \ 185 u32 hi = (__val64) >> 32; \
193 u32 lo = (__val64) & 0xffffffff; \ 186 u32 lo = (__val64) & 0xffffffff; \
194 __asm__ __volatile__ ( \ 187 __asm__ __volatile__ ( \
195 "\n1:\tstw %2,0(%1)\n" \ 188 "\n1:\tstw %2,0(%1)" \
196 "\n2:\tstw %3,4(%1)\n" \ 189 "\n2:\tstw %3,4(%1)\n\t" \
197 "\t.section __ex_table,\"aw\"\n" \ 190 ASM_EXCEPTIONTABLE_ENTRY(1b,fixup_put_user_skip_2)\
198 "\t.word\t1b,fixup_put_user_skip_2\n" \ 191 ASM_EXCEPTIONTABLE_ENTRY(2b,fixup_put_user_skip_1)\
199 "\t.word\t2b,fixup_put_user_skip_1\n" \
200 "\t.previous" \
201 : "=r"(__pu_err) \ 192 : "=r"(__pu_err) \
202 : "r"(ptr), "r"(hi), "r"(lo), "0"(__pu_err) \ 193 : "r"(ptr), "r"(hi), "r"(lo), "0"(__pu_err) \
203 : "r1"); \ 194 : "r1"); \
@@ -208,12 +199,10 @@ struct exception_data {
208 u32 hi = (__val64) >> 32; \ 199 u32 hi = (__val64) >> 32; \
209 u32 lo = (__val64) & 0xffffffff; \ 200 u32 lo = (__val64) & 0xffffffff; \
210 __asm__ __volatile__ ( \ 201 __asm__ __volatile__ ( \
211 "\n1:\tstw %2,0(%%sr3,%1)\n" \ 202 "\n1:\tstw %2,0(%%sr3,%1)" \
212 "\n2:\tstw %3,4(%%sr3,%1)\n" \ 203 "\n2:\tstw %3,4(%%sr3,%1)\n\t" \
213 "\t.section __ex_table,\"aw\"\n" \ 204 ASM_EXCEPTIONTABLE_ENTRY(1b,fixup_put_user_skip_2)\
214 "\t.word\t1b,fixup_put_user_skip_2\n" \ 205 ASM_EXCEPTIONTABLE_ENTRY(2b,fixup_put_user_skip_1)\
215 "\t.word\t2b,fixup_put_user_skip_1\n" \
216 "\t.previous" \
217 : "=r"(__pu_err) \ 206 : "=r"(__pu_err) \
218 : "r"(ptr), "r"(hi), "r"(lo), "0"(__pu_err) \ 207 : "r"(ptr), "r"(hi), "r"(lo), "0"(__pu_err) \
219 : "r1"); \ 208 : "r1"); \