diff options
author | Helge Deller <deller@gmx.de> | 2007-01-28 08:52:57 -0500 |
---|---|---|
committer | Kyle McMartin <kyle@athena.road.mcmartin.ca> | 2007-02-17 01:16:26 -0500 |
commit | 0b3d643f9ead9b5141dedbb2d1b06ce15469fc4a (patch) | |
tree | 3be51559fb366dea87dc0eacfea2f94c15190875 /include | |
parent | 8e9e9844b44dd9f855d824d035b3097b199e44ed (diff) |
[PARISC] add ASM_EXCEPTIONTABLE_ENTRY() macro
- this macro unifies the code to add exception table entries
- additionally use ENTRY()/ENDPROC() at more places
Signed-off-by: Helge Deller <deller@gmx.de>
Signed-off-by: Kyle McMartin <kyle@parisc-linux.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/asm-parisc/assembly.h | 8 | ||||
-rw-r--r-- | include/asm-parisc/bug.h | 12 | ||||
-rw-r--r-- | include/asm-parisc/uaccess.h | 53 |
3 files changed, 35 insertions, 38 deletions
diff --git a/include/asm-parisc/assembly.h b/include/asm-parisc/assembly.h index 5a1e0e8b1c3..7e26fcbe56d 100644 --- a/include/asm-parisc/assembly.h +++ b/include/asm-parisc/assembly.h | |||
@@ -31,9 +31,13 @@ | |||
31 | #define STREGM std,ma | 31 | #define STREGM std,ma |
32 | #define SHRREG shrd | 32 | #define SHRREG shrd |
33 | #define SHLREG shld | 33 | #define SHLREG shld |
34 | #define ADDIB addib,* | ||
35 | #define CMPB cmpb,* | ||
36 | #define ANDCM andcm,* | ||
34 | #define RP_OFFSET 16 | 37 | #define RP_OFFSET 16 |
35 | #define FRAME_SIZE 128 | 38 | #define FRAME_SIZE 128 |
36 | #define CALLEE_REG_FRAME_SIZE 144 | 39 | #define CALLEE_REG_FRAME_SIZE 144 |
40 | #define ASM_ULONG_INSN .dword | ||
37 | #else /* CONFIG_64BIT */ | 41 | #else /* CONFIG_64BIT */ |
38 | #define LDREG ldw | 42 | #define LDREG ldw |
39 | #define STREG stw | 43 | #define STREG stw |
@@ -42,9 +46,13 @@ | |||
42 | #define STREGM stwm | 46 | #define STREGM stwm |
43 | #define SHRREG shr | 47 | #define SHRREG shr |
44 | #define SHLREG shlw | 48 | #define SHLREG shlw |
49 | #define ADDIB addib, | ||
50 | #define CMPB cmpb, | ||
51 | #define ANDCM andcm | ||
45 | #define RP_OFFSET 20 | 52 | #define RP_OFFSET 20 |
46 | #define FRAME_SIZE 64 | 53 | #define FRAME_SIZE 64 |
47 | #define CALLEE_REG_FRAME_SIZE 128 | 54 | #define CALLEE_REG_FRAME_SIZE 128 |
55 | #define ASM_ULONG_INSN .word | ||
48 | #endif | 56 | #endif |
49 | 57 | ||
50 | #define CALLEE_SAVE_FRAME_SIZE (CALLEE_REG_FRAME_SIZE + CALLEE_FLOAT_FRAME_SIZE) | 58 | #define CALLEE_SAVE_FRAME_SIZE (CALLEE_REG_FRAME_SIZE + CALLEE_FLOAT_FRAME_SIZE) |
diff --git a/include/asm-parisc/bug.h b/include/asm-parisc/bug.h index cfe39a2547a..83ba510ed5d 100644 --- a/include/asm-parisc/bug.h +++ b/include/asm-parisc/bug.h | |||
@@ -14,10 +14,10 @@ | |||
14 | #define PARISC_BUG_BREAK_ASM "break 0x1f, 0x1fff" | 14 | #define PARISC_BUG_BREAK_ASM "break 0x1f, 0x1fff" |
15 | #define PARISC_BUG_BREAK_INSN 0x03ffe01f /* PARISC_BUG_BREAK_ASM */ | 15 | #define PARISC_BUG_BREAK_INSN 0x03ffe01f /* PARISC_BUG_BREAK_ASM */ |
16 | 16 | ||
17 | #ifdef CONFIG_64BIT | 17 | #if defined(CONFIG_64BIT) |
18 | #define ASM_ULONG_INSN ".dword" | 18 | #define ASM_WORD_INSN ".dword\t" |
19 | #else | 19 | #else |
20 | #define ASM_ULONG_INSN ".word" | 20 | #define ASM_WORD_INSN ".word\t" |
21 | #endif | 21 | #endif |
22 | 22 | ||
23 | #ifdef CONFIG_DEBUG_BUGVERBOSE | 23 | #ifdef CONFIG_DEBUG_BUGVERBOSE |
@@ -26,7 +26,7 @@ | |||
26 | asm volatile("\n" \ | 26 | asm volatile("\n" \ |
27 | "1:\t" PARISC_BUG_BREAK_ASM "\n" \ | 27 | "1:\t" PARISC_BUG_BREAK_ASM "\n" \ |
28 | "\t.pushsection __bug_table,\"a\"\n" \ | 28 | "\t.pushsection __bug_table,\"a\"\n" \ |
29 | "2:\t" ASM_ULONG_INSN " 1b, %c0\n" \ | 29 | "2:\t" ASM_WORD_INSN "1b, %c0\n" \ |
30 | "\t.short %c1, %c2\n" \ | 30 | "\t.short %c1, %c2\n" \ |
31 | "\t.org 2b+%c3\n" \ | 31 | "\t.org 2b+%c3\n" \ |
32 | "\t.popsection" \ | 32 | "\t.popsection" \ |
@@ -49,7 +49,7 @@ | |||
49 | asm volatile("\n" \ | 49 | asm volatile("\n" \ |
50 | "1:\t" PARISC_BUG_BREAK_ASM "\n" \ | 50 | "1:\t" PARISC_BUG_BREAK_ASM "\n" \ |
51 | "\t.pushsection __bug_table,\"a\"\n" \ | 51 | "\t.pushsection __bug_table,\"a\"\n" \ |
52 | "2:\t" ASM_ULONG_INSN " 1b, %c0\n" \ | 52 | "2:\t" ASM_WORD_INSN "1b, %c0\n" \ |
53 | "\t.short %c1, %c2\n" \ | 53 | "\t.short %c1, %c2\n" \ |
54 | "\t.org 2b+%c3\n" \ | 54 | "\t.org 2b+%c3\n" \ |
55 | "\t.popsection" \ | 55 | "\t.popsection" \ |
@@ -63,7 +63,7 @@ | |||
63 | asm volatile("\n" \ | 63 | asm volatile("\n" \ |
64 | "1:\t" PARISC_BUG_BREAK_ASM "\n" \ | 64 | "1:\t" PARISC_BUG_BREAK_ASM "\n" \ |
65 | "\t.pushsection __bug_table,\"a\"\n" \ | 65 | "\t.pushsection __bug_table,\"a\"\n" \ |
66 | "2:\t" ASM_ULONG_INSN " 1b\n" \ | 66 | "2:\t" ASM_WORD_INSN "1b\n" \ |
67 | "\t.short %c0\n" \ | 67 | "\t.short %c0\n" \ |
68 | "\t.org 2b+%c1\n" \ | 68 | "\t.org 2b+%c1\n" \ |
69 | "\t.popsection" \ | 69 | "\t.popsection" \ |
diff --git a/include/asm-parisc/uaccess.h b/include/asm-parisc/uaccess.h index d5d831ea7bc..4878b9501f2 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"); \ |