Rev 445 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 445 | Rev 456 | ||
---|---|---|---|
1 | # |
1 | # |
2 | # Copyright (C) 2005 Jakub Vana |
2 | # Copyright (C) 2005 Jakub Vana |
3 | # All rights reserved. |
3 | # All rights reserved. |
4 | # |
4 | # |
5 | # Redistribution and use in source and binary forms, with or without |
5 | # Redistribution and use in source and binary forms, with or without |
6 | # modification, are permitted provided that the following conditions |
6 | # modification, are permitted provided that the following conditions |
7 | # are met: |
7 | # are met: |
8 | # |
8 | # |
9 | # - Redistributions of source code must retain the above copyright |
9 | # - Redistributions of source code must retain the above copyright |
10 | # notice, this list of conditions and the following disclaimer. |
10 | # notice, this list of conditions and the following disclaimer. |
11 | # - Redistributions in binary form must reproduce the above copyright |
11 | # - Redistributions in binary form must reproduce the above copyright |
12 | # notice, this list of conditions and the following disclaimer in the |
12 | # notice, this list of conditions and the following disclaimer in the |
13 | # documentation and/or other materials provided with the distribution. |
13 | # documentation and/or other materials provided with the distribution. |
14 | # - The name of the author may not be used to endorse or promote products |
14 | # - The name of the author may not be used to endorse or promote products |
15 | # derived from this software without specific prior written permission. |
15 | # derived from this software without specific prior written permission. |
16 | # |
16 | # |
17 | # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR |
17 | # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR |
18 | # IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES |
18 | # IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES |
19 | # OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
19 | # OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
20 | # IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, |
20 | # IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, |
21 | # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT |
21 | # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT |
22 | # NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
22 | # NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
23 | # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
23 | # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
24 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
24 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
25 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
25 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
26 | # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
27 | # |
27 | # |
28 | 28 | ||
29 | #include <arch/stack.h> |
29 | #include <arch/stack.h> |
30 | 30 | ||
31 | #define STACK_ITEMS 12 |
31 | #define STACK_ITEMS 12 |
32 | #define STACK_FRAME_SIZE ((STACK_ITEMS*STACK_ITEM_SIZE) + STACK_SCRATCH_AREA_SIZE) |
32 | #define STACK_FRAME_SIZE ((STACK_ITEMS*STACK_ITEM_SIZE) + STACK_SCRATCH_AREA_SIZE) |
33 | 33 | ||
34 | #if (STACK_FRAME_SIZE % STACK_ALIGNMENT != 0) |
34 | #if (STACK_FRAME_SIZE % STACK_ALIGNMENT != 0) |
35 | #error Memory stack must be 16-byte aligned. |
35 | #error Memory stack must be 16-byte aligned. |
36 | #endif |
36 | #endif |
37 | 37 | ||
38 | /** Heavyweight interrupt handler |
38 | /** Heavyweight interrupt handler |
39 | * |
39 | * |
40 | * This macro roughly follows steps from 1 to 19 described in |
40 | * This macro roughly follows steps from 1 to 19 described in |
41 | * Intel Itanium Architecture Software Developer's Manual, Chapter 3.4.2. |
41 | * Intel Itanium Architecture Software Developer's Manual, Chapter 3.4.2. |
42 | * |
42 | * |
43 | * HEAVYWEIGHT_HANDLER macro must cram into 16 bundles (48 instructions). |
43 | * HEAVYWEIGHT_HANDLER macro must cram into 16 bundles (48 instructions). |
44 | * This goal is achieved by using procedure calls after RSE becomes operational. |
44 | * This goal is achieved by using procedure calls after RSE becomes operational. |
45 | * |
45 | * |
46 | * Some steps are skipped (enabling and disabling interrupts). |
46 | * Some steps are skipped (enabling and disabling interrupts). |
47 | * Some steps are not fully supported yet (e.g. interruptions |
47 | * Some steps are not fully supported yet (e.g. interruptions |
48 | * from userspace and floating-point context). |
48 | * from userspace and floating-point context). |
- | 49 | * |
|
- | 50 | * @param offs Offset from the beginning of IVT. |
|
- | 51 | * @param handler Interrupt handler address. |
|
49 | */ |
52 | */ |
50 | .macro HEAVYWEIGHT_HANDLER offs handler |
53 | .macro HEAVYWEIGHT_HANDLER offs handler |
51 | .org IVT + \offs |
54 | .org IVT + \offs |
52 | 55 | ||
53 | /* 1. copy interrupt registers into bank 0 */ |
56 | /* 1. copy interrupt registers into bank 0 */ |
54 | mov r24 = cr.iip |
57 | mov r24 = cr.iip |
55 | mov r25 = cr.ipsr |
58 | mov r25 = cr.ipsr |
56 | mov r26 = cr.iipa |
59 | mov r26 = cr.iipa |
57 | mov r27 = cr.isr |
60 | mov r27 = cr.isr |
58 | mov r28 = cr.ifa |
61 | mov r28 = cr.ifa |
59 | 62 | ||
60 | /* 2. preserve predicate register into bank 0 */ |
63 | /* 2. preserve predicate register into bank 0 */ |
61 | mov r29 = pr ;; |
64 | mov r29 = pr ;; |
62 | 65 | ||
63 | /* 3. switch to kernel memory stack */ |
66 | /* 3. switch to kernel memory stack */ |
64 | /* TODO: support interruptions from userspace */ |
67 | /* TODO: support interruptions from userspace */ |
65 | /* assume kernel stack */ |
68 | /* assume kernel stack */ |
66 | 69 | ||
67 | /* 4. save registers in bank 0 into memory stack */ |
70 | /* 4. save registers in bank 0 into memory stack */ |
68 | add r31 = -8, r12 ;; |
71 | add r31 = -8, r12 ;; |
69 | add r12 = -STACK_FRAME_SIZE, r12 ;; |
72 | add r12 = -STACK_FRAME_SIZE, r12 ;; |
70 | 73 | ||
71 | st8 [r31] = r29, -8 ;; /* save predicate registers */ |
74 | st8 [r31] = r29, -8 ;; /* save predicate registers */ |
72 | 75 | ||
73 | st8 [r31] = r24, -8 ;; /* save cr.iip */ |
76 | st8 [r31] = r24, -8 ;; /* save cr.iip */ |
74 | st8 [r31] = r25, -8 ;; /* save cr.ipsr */ |
77 | st8 [r31] = r25, -8 ;; /* save cr.ipsr */ |
75 | st8 [r31] = r26, -8 ;; /* save cr.iipa */ |
78 | st8 [r31] = r26, -8 ;; /* save cr.iipa */ |
76 | st8 [r31] = r27, -8 ;; /* save cr.isr */ |
79 | st8 [r31] = r27, -8 ;; /* save cr.isr */ |
77 | st8 [r31] = r28, -8 ;; /* save cr.ifa */ |
80 | st8 [r31] = r28, -8 ;; /* save cr.ifa */ |
78 | 81 | ||
79 | /* 5. RSE switch from interrupted context */ |
82 | /* 5. RSE switch from interrupted context */ |
80 | .auto |
83 | .auto |
81 | mov r24 = ar.rsc |
84 | mov r24 = ar.rsc |
82 | mov r25 = ar.pfs |
85 | mov r25 = ar.pfs |
83 | cover |
86 | cover |
84 | mov r26 = cr.ifs |
87 | mov r26 = cr.ifs |
85 | 88 | ||
86 | st8 [r31] = r24, -8 /* save ar.rsc */ |
89 | st8 [r31] = r24, -8 /* save ar.rsc */ |
87 | st8 [r31] = r25, -8 /* save ar.pfs */ |
90 | st8 [r31] = r25, -8 /* save ar.pfs */ |
88 | st8 [r31] = r26, -8 /* save ar.ifs */ |
91 | st8 [r31] = r26, -8 /* save ar.ifs */ |
89 | 92 | ||
90 | and r30 = ~3, r24 |
93 | and r30 = ~3, r24 |
91 | mov ar.rsc = r30 /* place RSE in enforced lazy mode */ |
94 | mov ar.rsc = r30 /* place RSE in enforced lazy mode */ |
92 | 95 | ||
93 | mov r27 = ar.rnat |
96 | mov r27 = ar.rnat |
94 | mov r28 = ar.bspstore |
97 | mov r28 = ar.bspstore |
95 | 98 | ||
96 | /* assume kernel backing store */ |
99 | /* assume kernel backing store */ |
97 | mov ar.bspstore = r28 |
100 | mov ar.bspstore = r28 |
98 | 101 | ||
99 | mov r29 = ar.bsp |
102 | mov r29 = ar.bsp |
100 | 103 | ||
101 | st8 [r31] = r27, -8 /* save ar.rnat */ |
104 | st8 [r31] = r27, -8 /* save ar.rnat */ |
102 | st8 [r31] = r28, -8 /* save ar.bspstore */ |
105 | st8 [r31] = r28, -8 /* save ar.bspstore */ |
103 | st8 [r31] = r29 /* save ar.bsp */ |
106 | st8 [r31] = r29, -8 /* save ar.bsp */ |
104 | 107 | ||
105 | mov ar.rsc = r24 /* restore RSE's setting */ |
108 | mov ar.rsc = r24 /* restore RSE's setting */ |
106 | .explicit |
109 | .explicit |
107 | 110 | ||
108 | /* the rest of the save-handler can be kept outside IVT */ |
111 | /* the rest of the save-handler can be kept outside IVT */ |
109 | 112 | ||
110 | movl r24 = \handler |
113 | movl r24 = \handler |
111 | mov r25 = b0 |
114 | mov r25 = b0 |
112 | br.call.sptk.many rp = heavyweight_handler_inner |
115 | br.call.sptk.many rp = heavyweight_handler_inner |
113 | 0: mov b0 = r25 |
116 | 0: mov b0 = r25 |
114 | 117 | ||
115 | br heavyweight_handler_finalize |
118 | br heavyweight_handler_finalize |
116 | .endm |
119 | .endm |
117 | 120 | ||
118 | .global heavyweight_handler_inner |
121 | .global heavyweight_handler_inner |
119 | heavyweight_handler_inner: |
122 | heavyweight_handler_inner: |
120 | /* |
123 | /* |
121 | * From this point, the rest of the interrupted context |
124 | * From this point, the rest of the interrupted context |
122 | * will be preserved in stacked registers and backing store. |
125 | * will be preserved in stacked registers and backing store. |
123 | */ |
126 | */ |
124 | alloc loc0 = ar.pfs, 0, 46, 0, 0 ;; |
127 | alloc loc0 = ar.pfs, 0, 46, 0, 0 ;; |
125 | 128 | ||
126 | /* copy handler address (r24 from bank 0 will be invisible soon) */ |
129 | /* copy handler address (r24 from bank 0 will be invisible soon) */ |
127 | mov loc1 = r24 |
130 | mov loc1 = r24 |
128 | 131 | ||
129 | /* 6. switch to bank 1 and reenable PSR.ic */ |
132 | /* 6. switch to bank 1 and reenable PSR.ic */ |
130 | ssm 0x2000 |
133 | ssm 0x2000 |
131 | bsw.1 ;; |
134 | bsw.1 ;; |
132 | srlz.d |
135 | srlz.d |
133 | 136 | ||
134 | /* 7. preserve branch and application registers */ |
137 | /* 7. preserve branch and application registers */ |
135 | mov loc2 = ar.unat |
138 | mov loc2 = ar.unat |
136 | mov loc3 = ar.lc |
139 | mov loc3 = ar.lc |
137 | mov loc4 = ar.ec |
140 | mov loc4 = ar.ec |
138 | mov loc5 = ar.ccv |
141 | mov loc5 = ar.ccv |
139 | mov loc6 = ar.csd |
142 | mov loc6 = ar.csd |
140 | mov loc7 = ar.ssd |
143 | mov loc7 = ar.ssd |
141 | 144 | ||
142 | mov loc8 = b0 |
145 | mov loc8 = b0 |
143 | mov loc9 = b1 |
146 | mov loc9 = b1 |
144 | mov loc10 = b2 |
147 | mov loc10 = b2 |
145 | mov loc11 = b3 |
148 | mov loc11 = b3 |
146 | mov loc12 = b4 |
149 | mov loc12 = b4 |
147 | mov loc13 = b5 |
150 | mov loc13 = b5 |
148 | mov loc14 = b6 |
151 | mov loc14 = b6 |
149 | mov loc15 = b7 |
152 | mov loc15 = b7 |
150 | 153 | ||
151 | /* 8. preserve general and floating-point registers */ |
154 | /* 8. preserve general and floating-point registers */ |
152 | /* TODO: save floating-point context */ |
155 | /* TODO: save floating-point context */ |
153 | mov loc16 = r1 |
156 | mov loc16 = r1 |
154 | mov loc17 = r2 |
157 | mov loc17 = r2 |
155 | mov loc18 = r3 |
158 | mov loc18 = r3 |
156 | mov loc19 = r4 |
159 | mov loc19 = r4 |
157 | mov loc20 = r5 |
160 | mov loc20 = r5 |
158 | mov loc21 = r6 |
161 | mov loc21 = r6 |
159 | mov loc22 = r7 |
162 | mov loc22 = r7 |
160 | mov loc23 = r8 |
163 | mov loc23 = r8 |
161 | mov loc24 = r9 |
164 | mov loc24 = r9 |
162 | mov loc25 = r10 |
165 | mov loc25 = r10 |
163 | mov loc26 = r11 |
166 | mov loc26 = r11 |
164 | /* skip r12 (stack pointer) */ |
167 | /* skip r12 (stack pointer) */ |
165 | mov loc27 = r13 |
168 | mov loc27 = r13 |
166 | mov loc28 = r14 |
169 | mov loc28 = r14 |
167 | mov loc29 = r15 |
170 | mov loc29 = r15 |
168 | mov loc30 = r16 |
171 | mov loc30 = r16 |
169 | mov loc31 = r17 |
172 | mov loc31 = r17 |
170 | mov loc32 = r18 |
173 | mov loc32 = r18 |
171 | mov loc33 = r19 |
174 | mov loc33 = r19 |
172 | mov loc34 = r20 |
175 | mov loc34 = r20 |
173 | mov loc35 = r21 |
176 | mov loc35 = r21 |
174 | mov loc36 = r22 |
177 | mov loc36 = r22 |
175 | mov loc37 = r23 |
178 | mov loc37 = r23 |
176 | mov loc38 = r24 |
179 | mov loc38 = r24 |
177 | mov loc39 = r25 |
180 | mov loc39 = r25 |
178 | mov loc40 = r26 |
181 | mov loc40 = r26 |
179 | mov loc41 = r27 |
182 | mov loc41 = r27 |
180 | mov loc42 = r28 |
183 | mov loc42 = r28 |
181 | mov loc43 = r29 |
184 | mov loc43 = r29 |
182 | mov loc44 = r30 |
185 | mov loc44 = r30 |
183 | mov loc45 = r31 |
186 | mov loc45 = r31 |
184 | 187 | ||
185 | /* 9. skipped (will not enable interrupts) */ |
188 | /* 9. skipped (will not enable interrupts) */ |
186 | 189 | ||
187 | /* 10. call handler */ |
190 | /* 10. call handler */ |
188 | mov b1 = loc1 |
191 | mov b1 = loc1 |
189 | br.call.sptk.many b0 = b1 |
192 | br.call.sptk.many b0 = b1 |
190 | 193 | ||
191 | /* 11. return from handler */ |
194 | /* 11. return from handler */ |
192 | 0: |
195 | 0: |
193 | 196 | ||
194 | /* 12. skipped (will not disable interrupts) */ |
197 | /* 12. skipped (will not disable interrupts) */ |
195 | 198 | ||
196 | /* 13. restore general and floating-point registers */ |
199 | /* 13. restore general and floating-point registers */ |
197 | /* TODO: restore floating-point context */ |
200 | /* TODO: restore floating-point context */ |
198 | mov r1 = loc16 |
201 | mov r1 = loc16 |
199 | mov r2 = loc17 |
202 | mov r2 = loc17 |
200 | mov r3 = loc18 |
203 | mov r3 = loc18 |
201 | mov r4 = loc19 |
204 | mov r4 = loc19 |
202 | mov r5 = loc20 |
205 | mov r5 = loc20 |
203 | mov r6 = loc21 |
206 | mov r6 = loc21 |
204 | mov r7 = loc22 |
207 | mov r7 = loc22 |
205 | mov r8 = loc23 |
208 | mov r8 = loc23 |
206 | mov r9 = loc24 |
209 | mov r9 = loc24 |
207 | mov r10 = loc25 |
210 | mov r10 = loc25 |
208 | mov r11 = loc26 |
211 | mov r11 = loc26 |
209 | /* skip r12 (stack pointer) */ |
212 | /* skip r12 (stack pointer) */ |
210 | mov r13 = loc27 |
213 | mov r13 = loc27 |
211 | mov r14 = loc28 |
214 | mov r14 = loc28 |
212 | mov r15 = loc29 |
215 | mov r15 = loc29 |
213 | mov r16 = loc30 |
216 | mov r16 = loc30 |
214 | mov r17 = loc31 |
217 | mov r17 = loc31 |
215 | mov r18 = loc32 |
218 | mov r18 = loc32 |
216 | mov r19 = loc33 |
219 | mov r19 = loc33 |
217 | mov r20 = loc34 |
220 | mov r20 = loc34 |
218 | mov r21 = loc35 |
221 | mov r21 = loc35 |
219 | mov r22 = loc36 |
222 | mov r22 = loc36 |
220 | mov r23 = loc37 |
223 | mov r23 = loc37 |
221 | mov r24 = loc38 |
224 | mov r24 = loc38 |
222 | mov r25 = loc39 |
225 | mov r25 = loc39 |
223 | mov r26 = loc40 |
226 | mov r26 = loc40 |
224 | mov r27 = loc41 |
227 | mov r27 = loc41 |
225 | mov r28 = loc42 |
228 | mov r28 = loc42 |
226 | mov r29 = loc43 |
229 | mov r29 = loc43 |
227 | mov r30 = loc44 |
230 | mov r30 = loc44 |
228 | mov r31 = loc45 |
231 | mov r31 = loc45 |
229 | 232 | ||
230 | /* 14. restore branch and application registers */ |
233 | /* 14. restore branch and application registers */ |
231 | mov ar.unat = loc2 |
234 | mov ar.unat = loc2 |
232 | mov ar.lc = loc3 |
235 | mov ar.lc = loc3 |
233 | mov ar.ec = loc4 |
236 | mov ar.ec = loc4 |
234 | mov ar.ccv = loc5 |
237 | mov ar.ccv = loc5 |
235 | mov ar.csd = loc6 |
238 | mov ar.csd = loc6 |
236 | mov ar.ssd = loc7 |
239 | mov ar.ssd = loc7 |
237 | 240 | ||
238 | mov b0 = loc8 |
241 | mov b0 = loc8 |
239 | mov b1 = loc9 |
242 | mov b1 = loc9 |
240 | mov b2 = loc10 |
243 | mov b2 = loc10 |
241 | mov b3 = loc11 |
244 | mov b3 = loc11 |
242 | mov b4 = loc12 |
245 | mov b4 = loc12 |
243 | mov b5 = loc13 |
246 | mov b5 = loc13 |
244 | mov b6 = loc14 |
247 | mov b6 = loc14 |
245 | mov b7 = loc15 |
248 | mov b7 = loc15 |
246 | 249 | ||
247 | /* 15. disable PSR.ic and switch to bank 0 */ |
250 | /* 15. disable PSR.ic and switch to bank 0 */ |
248 | rsm 0x2000 |
251 | rsm 0x2000 |
249 | bsw.0 ;; |
252 | bsw.0 ;; |
250 | srlz.d |
253 | srlz.d |
251 | 254 | ||
252 | mov ar.pfs = loc0 |
255 | mov ar.pfs = loc0 |
253 | br.ret.sptk.many rp |
256 | br.ret.sptk.many rp |
254 | 257 | ||
255 | .global heavyweight_handler_finalize |
258 | .global heavyweight_handler_finalize |
256 | heavyweight_handler_finalize: |
259 | heavyweight_handler_finalize: |
257 | /* 16. RSE switch to interrupted context */ |
260 | /* 16. RSE switch to interrupted context */ |
258 | - | ||
259 | /********************************************************************************************/ |
- | |
260 | - | ||
261 | - | ||
262 | - | ||
263 | .auto |
261 | .auto |
264 | cover /*Allocate zerro size frame (Step 1(from Intel Docs))*/ |
262 | cover /* allocate zerro size frame (step 1 (from Intel Docs)) */ |
265 | 263 | ||
266 | add r31 = STACK_SCRATCH_AREA_SIZE, r12 |
264 | add r31 = STACK_SCRATCH_AREA_SIZE, r12 |
267 | 265 | ||
268 | mov r28 = ar.bspstore /*Calculate loadrs (step 2)*/ |
266 | mov r28 = ar.bspstore /* calculate loadrs (step 2) */ |
269 | ld8 r29 = [r31], +8 |
267 | ld8 r29 = [r31], +8 /* load ar.bsp */ |
270 | sub r27 = r29 , r28 |
268 | sub r27 = r29 , r28 |
271 | shl r27 = r27, 16 |
269 | shl r27 = r27, 16 |
272 | 270 | ||
273 | mov r24 = ar.rsc |
271 | mov r24 = ar.rsc |
274 | and r30 = ~3, r24 |
272 | and r30 = ~3, r24 |
275 | or r24 = r30 , r27 |
273 | or r24 = r30 , r27 |
276 | mov ar.rsc = r24 /* place RSE in enforced lazy mode */ |
274 | mov ar.rsc = r24 /* place RSE in enforced lazy mode */ |
277 | 275 | ||
- | 276 | loadrs /* (step 3) */ |
|
278 | 277 | ||
- | 278 | ld8 r28 = [r31], +8 /* load ar.bspstore */ |
|
- | 279 | ld8 r27 = [r31], +8 /* load ar.rnat */ |
|
- | 280 | ld8 r26 = [r31], +8 /* load cr.ifs */ |
|
- | 281 | ld8 r25 = [r31], +8 /* load ar.pfs */ |
|
- | 282 | ld8 r24 = [r31], +8 /* load ar.rsc */ |
|
279 | 283 | ||
280 | loadrs /*(Step 3)*/ |
284 | mov ar.bspstore = r28 /* (step 4) */ |
281 | - | ||
282 | - | ||
283 | /*Read saved registers*/ |
- | |
284 | ld8 r28 = [r31], +8 /*ar.bspstore*/ |
- | |
285 | ld8 r27 = [r31], +8 /*ar.rnat*/ |
- | |
286 | ld8 r26 = [r31], +8 /*cr.ifs*/ |
- | |
287 | ld8 r25 = [r31], +8 /*ar.pfs*/ |
- | |
288 | ld8 r24 = [r31], +8 /*ar.rsc*/ |
285 | mov ar.rnat = r27 /* (step 5) */ |
289 | 286 | ||
290 | - | ||
291 | mov ar.bspstore = r28 /*(Step 4)*/ |
- | |
292 | mov ar.rnat = r27 /*(Step 5)*/ |
- | |
293 | - | ||
294 | mov ar.pfs = r25 /*(Step 6)*/ |
287 | mov ar.pfs = r25 /* (step 6) */ |
295 | mov cr.ifs = r26 |
288 | mov cr.ifs = r26 |
296 | 289 | ||
297 | mov ar.rsc = r24 /*(Step 7)*/ |
290 | mov ar.rsc = r24 /* (step 7) */ |
298 | - | ||
299 | - | ||
300 | .explicit |
291 | .explicit |
301 | 292 | ||
302 | - | ||
303 | /********************************************************************************************/ |
- | |
304 | - | ||
305 | - | ||
306 | - | ||
307 | /* 17. restore interruption state from memory stack */ |
293 | /* 17. restore interruption state from memory stack */ |
308 | - | ||
309 | ld8 r28 = [r31] , +8 ;; /* load cr.ifa */ |
294 | ld8 r28 = [r31], +8 ;; /* load cr.ifa */ |
310 | ld8 r27 = [r31] , +8 ;; /* load cr.isr */ |
295 | ld8 r27 = [r31], +8 ;; /* load cr.isr */ |
311 | ld8 r26 = [r31] , +8 ;; /* load cr.iipa */ |
296 | ld8 r26 = [r31], +8 ;; /* load cr.iipa */ |
312 | ld8 r25 = [r31] , +8 ;; /* load cr.ipsr */ |
297 | ld8 r25 = [r31], +8 ;; /* load cr.ipsr */ |
313 | ld8 r24 = [r31] , +8 ;; /* load cr.iip */ |
298 | ld8 r24 = [r31], +8 ;; /* load cr.iip */ |
314 | - | ||
315 | 299 | ||
316 | mov cr.iip = r24 |
300 | mov cr.iip = r24 |
317 | mov cr.ipsr = r25 |
301 | mov cr.ipsr = r25 |
318 | mov cr.iipa = r26 |
302 | mov cr.iipa = r26 |
319 | mov cr.isr = r27 |
303 | mov cr.isr = r27 |
320 | mov cr.ifa = r28 |
304 | mov cr.ifa = r28 |
321 | 305 | ||
322 | - | ||
323 | - | ||
324 | /* 18. restore predicate registers from memory stack */ |
306 | /* 18. restore predicate registers from memory stack */ |
325 | - | ||
326 | - | ||
327 | ld8 r29 = [r31] , -8 ;; /* load predicate registers */ |
307 | ld8 r29 = [r31] , -8 ;; /* load predicate registers */ |
328 | mov pr =r29 ;; |
308 | mov pr = r29 |
329 | - | ||
330 | add r12 = STACK_FRAME_SIZE,r12;; |
- | |
331 | 309 | ||
332 | /* 19. return from interruption */ |
310 | /* 19. return from interruption */ |
- | 311 | add r12 = STACK_FRAME_SIZE, r12 |
|
333 | rfi;; |
312 | rfi ;; |
334 | - | ||
335 | 313 | ||
336 | dump_gregs: |
314 | dump_gregs: |
337 | mov r16 = REG_DUMP;; |
315 | mov r16 = REG_DUMP;; |
338 | st8 [r16] = r0;; |
316 | st8 [r16] = r0;; |
339 | add r16 = 8,r16 ;; |
317 | add r16 = 8,r16 ;; |
340 | st8 [r16] = r1;; |
318 | st8 [r16] = r1;; |
341 | add r16 = 8,r16 ;; |
319 | add r16 = 8,r16 ;; |
342 | st8 [r16] = r2;; |
320 | st8 [r16] = r2;; |
343 | add r16 = 8,r16 ;; |
321 | add r16 = 8,r16 ;; |
344 | st8 [r16] = r3;; |
322 | st8 [r16] = r3;; |
345 | add r16 = 8,r16 ;; |
323 | add r16 = 8,r16 ;; |
346 | st8 [r16] = r4;; |
324 | st8 [r16] = r4;; |
347 | add r16 = 8,r16 ;; |
325 | add r16 = 8,r16 ;; |
348 | st8 [r16] = r5;; |
326 | st8 [r16] = r5;; |
349 | add r16 = 8,r16 ;; |
327 | add r16 = 8,r16 ;; |
350 | st8 [r16] = r6;; |
328 | st8 [r16] = r6;; |
351 | add r16 = 8,r16 ;; |
329 | add r16 = 8,r16 ;; |
352 | st8 [r16] = r7;; |
330 | st8 [r16] = r7;; |
353 | add r16 = 8,r16 ;; |
331 | add r16 = 8,r16 ;; |
354 | st8 [r16] = r8;; |
332 | st8 [r16] = r8;; |
355 | add r16 = 8,r16 ;; |
333 | add r16 = 8,r16 ;; |
356 | st8 [r16] = r9;; |
334 | st8 [r16] = r9;; |
357 | add r16 = 8,r16 ;; |
335 | add r16 = 8,r16 ;; |
358 | st8 [r16] = r10;; |
336 | st8 [r16] = r10;; |
359 | add r16 = 8,r16 ;; |
337 | add r16 = 8,r16 ;; |
360 | st8 [r16] = r11;; |
338 | st8 [r16] = r11;; |
361 | add r16 = 8,r16 ;; |
339 | add r16 = 8,r16 ;; |
362 | st8 [r16] = r12;; |
340 | st8 [r16] = r12;; |
363 | add r16 = 8,r16 ;; |
341 | add r16 = 8,r16 ;; |
364 | st8 [r16] = r13;; |
342 | st8 [r16] = r13;; |
365 | add r16 = 8,r16 ;; |
343 | add r16 = 8,r16 ;; |
366 | st8 [r16] = r14;; |
344 | st8 [r16] = r14;; |
367 | add r16 = 8,r16 ;; |
345 | add r16 = 8,r16 ;; |
368 | st8 [r16] = r15;; |
346 | st8 [r16] = r15;; |
369 | add r16 = 8,r16 ;; |
347 | add r16 = 8,r16 ;; |
370 | 348 | ||
371 | bsw.1;; |
349 | bsw.1;; |
372 | mov r15 = r16;; |
350 | mov r15 = r16;; |
373 | bsw.0;; |
351 | bsw.0;; |
374 | st8 [r16] = r15;; |
352 | st8 [r16] = r15;; |
375 | add r16 = 8,r16 ;; |
353 | add r16 = 8,r16 ;; |
376 | bsw.1;; |
354 | bsw.1;; |
377 | mov r15 = r17;; |
355 | mov r15 = r17;; |
378 | bsw.0;; |
356 | bsw.0;; |
379 | st8 [r16] = r15;; |
357 | st8 [r16] = r15;; |
380 | add r16 = 8,r16 ;; |
358 | add r16 = 8,r16 ;; |
381 | bsw.1;; |
359 | bsw.1;; |
382 | mov r15 = r18;; |
360 | mov r15 = r18;; |
383 | bsw.0;; |
361 | bsw.0;; |
384 | st8 [r16] = r15;; |
362 | st8 [r16] = r15;; |
385 | add r16 = 8,r16 ;; |
363 | add r16 = 8,r16 ;; |
386 | bsw.1;; |
364 | bsw.1;; |
387 | mov r15 = r19;; |
365 | mov r15 = r19;; |
388 | bsw.0;; |
366 | bsw.0;; |
389 | st8 [r16] = r15;; |
367 | st8 [r16] = r15;; |
390 | add r16 = 8,r16 ;; |
368 | add r16 = 8,r16 ;; |
391 | bsw.1;; |
369 | bsw.1;; |
392 | mov r15 = r20;; |
370 | mov r15 = r20;; |
393 | bsw.0;; |
371 | bsw.0;; |
394 | st8 [r16] = r15;; |
372 | st8 [r16] = r15;; |
395 | add r16 = 8,r16 ;; |
373 | add r16 = 8,r16 ;; |
396 | bsw.1;; |
374 | bsw.1;; |
397 | mov r15 = r21;; |
375 | mov r15 = r21;; |
398 | bsw.0;; |
376 | bsw.0;; |
399 | st8 [r16] = r15;; |
377 | st8 [r16] = r15;; |
400 | add r16 = 8,r16 ;; |
378 | add r16 = 8,r16 ;; |
401 | bsw.1;; |
379 | bsw.1;; |
402 | mov r15 = r22;; |
380 | mov r15 = r22;; |
403 | bsw.0;; |
381 | bsw.0;; |
404 | st8 [r16] = r15;; |
382 | st8 [r16] = r15;; |
405 | add r16 = 8,r16 ;; |
383 | add r16 = 8,r16 ;; |
406 | bsw.1;; |
384 | bsw.1;; |
407 | mov r15 = r23;; |
385 | mov r15 = r23;; |
408 | bsw.0;; |
386 | bsw.0;; |
409 | st8 [r16] = r15;; |
387 | st8 [r16] = r15;; |
410 | add r16 = 8,r16 ;; |
388 | add r16 = 8,r16 ;; |
411 | bsw.1;; |
389 | bsw.1;; |
412 | mov r15 = r24;; |
390 | mov r15 = r24;; |
413 | bsw.0;; |
391 | bsw.0;; |
414 | st8 [r16] = r15;; |
392 | st8 [r16] = r15;; |
415 | add r16 = 8,r16 ;; |
393 | add r16 = 8,r16 ;; |
416 | bsw.1;; |
394 | bsw.1;; |
417 | mov r15 = r25;; |
395 | mov r15 = r25;; |
418 | bsw.0;; |
396 | bsw.0;; |
419 | st8 [r16] = r15;; |
397 | st8 [r16] = r15;; |
420 | add r16 = 8,r16 ;; |
398 | add r16 = 8,r16 ;; |
421 | bsw.1;; |
399 | bsw.1;; |
422 | mov r15 = r26;; |
400 | mov r15 = r26;; |
423 | bsw.0;; |
401 | bsw.0;; |
424 | st8 [r16] = r15;; |
402 | st8 [r16] = r15;; |
425 | add r16 = 8,r16 ;; |
403 | add r16 = 8,r16 ;; |
426 | bsw.1;; |
404 | bsw.1;; |
427 | mov r15 = r27;; |
405 | mov r15 = r27;; |
428 | bsw.0;; |
406 | bsw.0;; |
429 | st8 [r16] = r15;; |
407 | st8 [r16] = r15;; |
430 | add r16 = 8,r16 ;; |
408 | add r16 = 8,r16 ;; |
431 | bsw.1;; |
409 | bsw.1;; |
432 | mov r15 = r28;; |
410 | mov r15 = r28;; |
433 | bsw.0;; |
411 | bsw.0;; |
434 | st8 [r16] = r15;; |
412 | st8 [r16] = r15;; |
435 | add r16 = 8,r16 ;; |
413 | add r16 = 8,r16 ;; |
436 | bsw.1;; |
414 | bsw.1;; |
437 | mov r15 = r29;; |
415 | mov r15 = r29;; |
438 | bsw.0;; |
416 | bsw.0;; |
439 | st8 [r16] = r15;; |
417 | st8 [r16] = r15;; |
440 | add r16 = 8,r16 ;; |
418 | add r16 = 8,r16 ;; |
441 | bsw.1;; |
419 | bsw.1;; |
442 | mov r15 = r30;; |
420 | mov r15 = r30;; |
443 | bsw.0;; |
421 | bsw.0;; |
444 | st8 [r16] = r15;; |
422 | st8 [r16] = r15;; |
445 | add r16 = 8,r16 ;; |
423 | add r16 = 8,r16 ;; |
446 | bsw.1;; |
424 | bsw.1;; |
447 | mov r15 = r31;; |
425 | mov r15 = r31;; |
448 | bsw.0;; |
426 | bsw.0;; |
449 | st8 [r16] = r15;; |
427 | st8 [r16] = r15;; |
450 | add r16 = 8,r16 ;; |
428 | add r16 = 8,r16 ;; |
451 | 429 | ||
452 | 430 | ||
453 | st8 [r16] = r32;; |
431 | st8 [r16] = r32;; |
454 | add r16 = 8,r16 ;; |
432 | add r16 = 8,r16 ;; |
455 | st8 [r16] = r33;; |
433 | st8 [r16] = r33;; |
456 | add r16 = 8,r16 ;; |
434 | add r16 = 8,r16 ;; |
457 | st8 [r16] = r34;; |
435 | st8 [r16] = r34;; |
458 | add r16 = 8,r16 ;; |
436 | add r16 = 8,r16 ;; |
459 | st8 [r16] = r35;; |
437 | st8 [r16] = r35;; |
460 | add r16 = 8,r16 ;; |
438 | add r16 = 8,r16 ;; |
461 | st8 [r16] = r36;; |
439 | st8 [r16] = r36;; |
462 | add r16 = 8,r16 ;; |
440 | add r16 = 8,r16 ;; |
463 | st8 [r16] = r37;; |
441 | st8 [r16] = r37;; |
464 | add r16 = 8,r16 ;; |
442 | add r16 = 8,r16 ;; |
465 | st8 [r16] = r38;; |
443 | st8 [r16] = r38;; |
466 | add r16 = 8,r16 ;; |
444 | add r16 = 8,r16 ;; |
467 | st8 [r16] = r39;; |
445 | st8 [r16] = r39;; |
468 | add r16 = 8,r16 ;; |
446 | add r16 = 8,r16 ;; |
469 | st8 [r16] = r40;; |
447 | st8 [r16] = r40;; |
470 | add r16 = 8,r16 ;; |
448 | add r16 = 8,r16 ;; |
471 | st8 [r16] = r41;; |
449 | st8 [r16] = r41;; |
472 | add r16 = 8,r16 ;; |
450 | add r16 = 8,r16 ;; |
473 | st8 [r16] = r42;; |
451 | st8 [r16] = r42;; |
474 | add r16 = 8,r16 ;; |
452 | add r16 = 8,r16 ;; |
475 | st8 [r16] = r43;; |
453 | st8 [r16] = r43;; |
476 | add r16 = 8,r16 ;; |
454 | add r16 = 8,r16 ;; |
477 | st8 [r16] = r44;; |
455 | st8 [r16] = r44;; |
478 | add r16 = 8,r16 ;; |
456 | add r16 = 8,r16 ;; |
479 | st8 [r16] = r45;; |
457 | st8 [r16] = r45;; |
480 | add r16 = 8,r16 ;; |
458 | add r16 = 8,r16 ;; |
481 | st8 [r16] = r46;; |
459 | st8 [r16] = r46;; |
482 | add r16 = 8,r16 ;; |
460 | add r16 = 8,r16 ;; |
483 | st8 [r16] = r47;; |
461 | st8 [r16] = r47;; |
484 | add r16 = 8,r16 ;; |
462 | add r16 = 8,r16 ;; |
485 | st8 [r16] = r48;; |
463 | st8 [r16] = r48;; |
486 | add r16 = 8,r16 ;; |
464 | add r16 = 8,r16 ;; |
487 | st8 [r16] = r49;; |
465 | st8 [r16] = r49;; |
488 | add r16 = 8,r16 ;; |
466 | add r16 = 8,r16 ;; |
489 | st8 [r16] = r50;; |
467 | st8 [r16] = r50;; |
490 | add r16 = 8,r16 ;; |
468 | add r16 = 8,r16 ;; |
491 | st8 [r16] = r51;; |
469 | st8 [r16] = r51;; |
492 | add r16 = 8,r16 ;; |
470 | add r16 = 8,r16 ;; |
493 | st8 [r16] = r52;; |
471 | st8 [r16] = r52;; |
494 | add r16 = 8,r16 ;; |
472 | add r16 = 8,r16 ;; |
495 | st8 [r16] = r53;; |
473 | st8 [r16] = r53;; |
496 | add r16 = 8,r16 ;; |
474 | add r16 = 8,r16 ;; |
497 | st8 [r16] = r54;; |
475 | st8 [r16] = r54;; |
498 | add r16 = 8,r16 ;; |
476 | add r16 = 8,r16 ;; |
499 | st8 [r16] = r55;; |
477 | st8 [r16] = r55;; |
500 | add r16 = 8,r16 ;; |
478 | add r16 = 8,r16 ;; |
501 | st8 [r16] = r56;; |
479 | st8 [r16] = r56;; |
502 | add r16 = 8,r16 ;; |
480 | add r16 = 8,r16 ;; |
503 | st8 [r16] = r57;; |
481 | st8 [r16] = r57;; |
504 | add r16 = 8,r16 ;; |
482 | add r16 = 8,r16 ;; |
505 | st8 [r16] = r58;; |
483 | st8 [r16] = r58;; |
506 | add r16 = 8,r16 ;; |
484 | add r16 = 8,r16 ;; |
507 | st8 [r16] = r59;; |
485 | st8 [r16] = r59;; |
508 | add r16 = 8,r16 ;; |
486 | add r16 = 8,r16 ;; |
509 | st8 [r16] = r60;; |
487 | st8 [r16] = r60;; |
510 | add r16 = 8,r16 ;; |
488 | add r16 = 8,r16 ;; |
511 | st8 [r16] = r61;; |
489 | st8 [r16] = r61;; |
512 | add r16 = 8,r16 ;; |
490 | add r16 = 8,r16 ;; |
513 | st8 [r16] = r62;; |
491 | st8 [r16] = r62;; |
514 | add r16 = 8,r16 ;; |
492 | add r16 = 8,r16 ;; |
515 | st8 [r16] = r63;; |
493 | st8 [r16] = r63;; |
516 | add r16 = 8,r16 ;; |
494 | add r16 = 8,r16 ;; |
517 | 495 | ||
518 | 496 | ||
519 | 497 | ||
520 | st8 [r16] = r64;; |
498 | st8 [r16] = r64;; |
521 | add r16 = 8,r16 ;; |
499 | add r16 = 8,r16 ;; |
522 | st8 [r16] = r65;; |
500 | st8 [r16] = r65;; |
523 | add r16 = 8,r16 ;; |
501 | add r16 = 8,r16 ;; |
524 | st8 [r16] = r66;; |
502 | st8 [r16] = r66;; |
525 | add r16 = 8,r16 ;; |
503 | add r16 = 8,r16 ;; |
526 | st8 [r16] = r67;; |
504 | st8 [r16] = r67;; |
527 | add r16 = 8,r16 ;; |
505 | add r16 = 8,r16 ;; |
528 | st8 [r16] = r68;; |
506 | st8 [r16] = r68;; |
529 | add r16 = 8,r16 ;; |
507 | add r16 = 8,r16 ;; |
530 | st8 [r16] = r69;; |
508 | st8 [r16] = r69;; |
531 | add r16 = 8,r16 ;; |
509 | add r16 = 8,r16 ;; |
532 | st8 [r16] = r70;; |
510 | st8 [r16] = r70;; |
533 | add r16 = 8,r16 ;; |
511 | add r16 = 8,r16 ;; |
534 | st8 [r16] = r71;; |
512 | st8 [r16] = r71;; |
535 | add r16 = 8,r16 ;; |
513 | add r16 = 8,r16 ;; |
536 | st8 [r16] = r72;; |
514 | st8 [r16] = r72;; |
537 | add r16 = 8,r16 ;; |
515 | add r16 = 8,r16 ;; |
538 | st8 [r16] = r73;; |
516 | st8 [r16] = r73;; |
539 | add r16 = 8,r16 ;; |
517 | add r16 = 8,r16 ;; |
540 | st8 [r16] = r74;; |
518 | st8 [r16] = r74;; |
541 | add r16 = 8,r16 ;; |
519 | add r16 = 8,r16 ;; |
542 | st8 [r16] = r75;; |
520 | st8 [r16] = r75;; |
543 | add r16 = 8,r16 ;; |
521 | add r16 = 8,r16 ;; |
544 | st8 [r16] = r76;; |
522 | st8 [r16] = r76;; |
545 | add r16 = 8,r16 ;; |
523 | add r16 = 8,r16 ;; |
546 | st8 [r16] = r77;; |
524 | st8 [r16] = r77;; |
547 | add r16 = 8,r16 ;; |
525 | add r16 = 8,r16 ;; |
548 | st8 [r16] = r78;; |
526 | st8 [r16] = r78;; |
549 | add r16 = 8,r16 ;; |
527 | add r16 = 8,r16 ;; |
550 | st8 [r16] = r79;; |
528 | st8 [r16] = r79;; |
551 | add r16 = 8,r16 ;; |
529 | add r16 = 8,r16 ;; |
552 | st8 [r16] = r80;; |
530 | st8 [r16] = r80;; |
553 | add r16 = 8,r16 ;; |
531 | add r16 = 8,r16 ;; |
554 | st8 [r16] = r81;; |
532 | st8 [r16] = r81;; |
555 | add r16 = 8,r16 ;; |
533 | add r16 = 8,r16 ;; |
556 | st8 [r16] = r82;; |
534 | st8 [r16] = r82;; |
557 | add r16 = 8,r16 ;; |
535 | add r16 = 8,r16 ;; |
558 | st8 [r16] = r83;; |
536 | st8 [r16] = r83;; |
559 | add r16 = 8,r16 ;; |
537 | add r16 = 8,r16 ;; |
560 | st8 [r16] = r84;; |
538 | st8 [r16] = r84;; |
561 | add r16 = 8,r16 ;; |
539 | add r16 = 8,r16 ;; |
562 | st8 [r16] = r85;; |
540 | st8 [r16] = r85;; |
563 | add r16 = 8,r16 ;; |
541 | add r16 = 8,r16 ;; |
564 | st8 [r16] = r86;; |
542 | st8 [r16] = r86;; |
565 | add r16 = 8,r16 ;; |
543 | add r16 = 8,r16 ;; |
566 | st8 [r16] = r87;; |
544 | st8 [r16] = r87;; |
567 | add r16 = 8,r16 ;; |
545 | add r16 = 8,r16 ;; |
568 | st8 [r16] = r88;; |
546 | st8 [r16] = r88;; |
569 | add r16 = 8,r16 ;; |
547 | add r16 = 8,r16 ;; |
570 | st8 [r16] = r89;; |
548 | st8 [r16] = r89;; |
571 | add r16 = 8,r16 ;; |
549 | add r16 = 8,r16 ;; |
572 | st8 [r16] = r90;; |
550 | st8 [r16] = r90;; |
573 | add r16 = 8,r16 ;; |
551 | add r16 = 8,r16 ;; |
574 | st8 [r16] = r91;; |
552 | st8 [r16] = r91;; |
575 | add r16 = 8,r16 ;; |
553 | add r16 = 8,r16 ;; |
576 | st8 [r16] = r92;; |
554 | st8 [r16] = r92;; |
577 | add r16 = 8,r16 ;; |
555 | add r16 = 8,r16 ;; |
578 | st8 [r16] = r93;; |
556 | st8 [r16] = r93;; |
579 | add r16 = 8,r16 ;; |
557 | add r16 = 8,r16 ;; |
580 | st8 [r16] = r94;; |
558 | st8 [r16] = r94;; |
581 | add r16 = 8,r16 ;; |
559 | add r16 = 8,r16 ;; |
582 | st8 [r16] = r95;; |
560 | st8 [r16] = r95;; |
583 | add r16 = 8,r16 ;; |
561 | add r16 = 8,r16 ;; |
584 | 562 | ||
585 | 563 | ||
586 | 564 | ||
587 | st8 [r16] = r96;; |
565 | st8 [r16] = r96;; |
588 | add r16 = 8,r16 ;; |
566 | add r16 = 8,r16 ;; |
589 | st8 [r16] = r97;; |
567 | st8 [r16] = r97;; |
590 | add r16 = 8,r16 ;; |
568 | add r16 = 8,r16 ;; |
591 | st8 [r16] = r98;; |
569 | st8 [r16] = r98;; |
592 | add r16 = 8,r16 ;; |
570 | add r16 = 8,r16 ;; |
593 | st8 [r16] = r99;; |
571 | st8 [r16] = r99;; |
594 | add r16 = 8,r16 ;; |
572 | add r16 = 8,r16 ;; |
595 | st8 [r16] = r100;; |
573 | st8 [r16] = r100;; |
596 | add r16 = 8,r16 ;; |
574 | add r16 = 8,r16 ;; |
597 | st8 [r16] = r101;; |
575 | st8 [r16] = r101;; |
598 | add r16 = 8,r16 ;; |
576 | add r16 = 8,r16 ;; |
599 | st8 [r16] = r102;; |
577 | st8 [r16] = r102;; |
600 | add r16 = 8,r16 ;; |
578 | add r16 = 8,r16 ;; |
601 | st8 [r16] = r103;; |
579 | st8 [r16] = r103;; |
602 | add r16 = 8,r16 ;; |
580 | add r16 = 8,r16 ;; |
603 | st8 [r16] = r104;; |
581 | st8 [r16] = r104;; |
604 | add r16 = 8,r16 ;; |
582 | add r16 = 8,r16 ;; |
605 | st8 [r16] = r105;; |
583 | st8 [r16] = r105;; |
606 | add r16 = 8,r16 ;; |
584 | add r16 = 8,r16 ;; |
607 | st8 [r16] = r106;; |
585 | st8 [r16] = r106;; |
608 | add r16 = 8,r16 ;; |
586 | add r16 = 8,r16 ;; |
609 | st8 [r16] = r107;; |
587 | st8 [r16] = r107;; |
610 | add r16 = 8,r16 ;; |
588 | add r16 = 8,r16 ;; |
611 | st8 [r16] = r108;; |
589 | st8 [r16] = r108;; |
612 | add r16 = 8,r16 ;; |
590 | add r16 = 8,r16 ;; |
613 | st8 [r16] = r109;; |
591 | st8 [r16] = r109;; |
614 | add r16 = 8,r16 ;; |
592 | add r16 = 8,r16 ;; |
615 | st8 [r16] = r110;; |
593 | st8 [r16] = r110;; |
616 | add r16 = 8,r16 ;; |
594 | add r16 = 8,r16 ;; |
617 | st8 [r16] = r111;; |
595 | st8 [r16] = r111;; |
618 | add r16 = 8,r16 ;; |
596 | add r16 = 8,r16 ;; |
619 | st8 [r16] = r112;; |
597 | st8 [r16] = r112;; |
620 | add r16 = 8,r16 ;; |
598 | add r16 = 8,r16 ;; |
621 | st8 [r16] = r113;; |
599 | st8 [r16] = r113;; |
622 | add r16 = 8,r16 ;; |
600 | add r16 = 8,r16 ;; |
623 | st8 [r16] = r114;; |
601 | st8 [r16] = r114;; |
624 | add r16 = 8,r16 ;; |
602 | add r16 = 8,r16 ;; |
625 | st8 [r16] = r115;; |
603 | st8 [r16] = r115;; |
626 | add r16 = 8,r16 ;; |
604 | add r16 = 8,r16 ;; |
627 | st8 [r16] = r116;; |
605 | st8 [r16] = r116;; |
628 | add r16 = 8,r16 ;; |
606 | add r16 = 8,r16 ;; |
629 | st8 [r16] = r117;; |
607 | st8 [r16] = r117;; |
630 | add r16 = 8,r16 ;; |
608 | add r16 = 8,r16 ;; |
631 | st8 [r16] = r118;; |
609 | st8 [r16] = r118;; |
632 | add r16 = 8,r16 ;; |
610 | add r16 = 8,r16 ;; |
633 | st8 [r16] = r119;; |
611 | st8 [r16] = r119;; |
634 | add r16 = 8,r16 ;; |
612 | add r16 = 8,r16 ;; |
635 | st8 [r16] = r120;; |
613 | st8 [r16] = r120;; |
636 | add r16 = 8,r16 ;; |
614 | add r16 = 8,r16 ;; |
637 | st8 [r16] = r121;; |
615 | st8 [r16] = r121;; |
638 | add r16 = 8,r16 ;; |
616 | add r16 = 8,r16 ;; |
639 | st8 [r16] = r122;; |
617 | st8 [r16] = r122;; |
640 | add r16 = 8,r16 ;; |
618 | add r16 = 8,r16 ;; |
641 | st8 [r16] = r123;; |
619 | st8 [r16] = r123;; |
642 | add r16 = 8,r16 ;; |
620 | add r16 = 8,r16 ;; |
643 | st8 [r16] = r124;; |
621 | st8 [r16] = r124;; |
644 | add r16 = 8,r16 ;; |
622 | add r16 = 8,r16 ;; |
645 | st8 [r16] = r125;; |
623 | st8 [r16] = r125;; |
646 | add r16 = 8,r16 ;; |
624 | add r16 = 8,r16 ;; |
647 | st8 [r16] = r126;; |
625 | st8 [r16] = r126;; |
648 | add r16 = 8,r16 ;; |
626 | add r16 = 8,r16 ;; |
649 | st8 [r16] = r127;; |
627 | st8 [r16] = r127;; |
650 | add r16 = 8,r16 ;; |
628 | add r16 = 8,r16 ;; |
651 | 629 | ||
652 | 630 | ||
653 | 631 | ||
654 | br.ret.sptk.many b0;; |
632 | br.ret.sptk.many b0;; |
655 | 633 | ||
656 | 634 | ||
657 | 635 | ||
658 | 636 | ||
659 | 637 | ||
660 | .macro Handler o h |
638 | .macro Handler o h |
661 | .org IVT + \o |
639 | .org IVT + \o |
662 | br \h;; |
640 | br \h;; |
663 | .endm |
641 | .endm |
664 | 642 | ||
665 | .macro Handler2 o |
643 | .macro Handler2 o |
666 | .org IVT + \o |
644 | .org IVT + \o |
667 | br.call.sptk.many b0 = dump_gregs;; |
645 | br.call.sptk.many b0 = dump_gregs;; |
668 | mov r16 = \o ;; |
646 | mov r16 = \o ;; |
669 | bsw.1;; |
647 | bsw.1;; |
670 | br universal_handler;; |
648 | br universal_handler;; |
671 | .endm |
649 | .endm |
672 | 650 | ||
673 | 651 | ||
674 | 652 | ||
675 | .global IVT |
653 | .global IVT |
676 | .align 32768 |
654 | .align 32768 |
677 | IVT: |
655 | IVT: |
678 | 656 | ||
679 | 657 | ||
680 | Handler2 0x0000 |
658 | Handler2 0x0000 |
681 | Handler2 0x0400 |
659 | Handler2 0x0400 |
682 | Handler2 0x0800 |
660 | Handler2 0x0800 |
683 | Handler2 0x0c00 |
661 | Handler2 0x0c00 |
684 | Handler2 0x1000 |
662 | Handler2 0x1000 |
685 | Handler2 0x1400 |
663 | Handler2 0x1400 |
686 | Handler2 0x1800 |
664 | Handler2 0x1800 |
687 | Handler2 0x1c00 |
665 | Handler2 0x1c00 |
688 | Handler2 0x2000 |
666 | Handler2 0x2000 |
689 | Handler2 0x2400 |
667 | Handler2 0x2400 |
690 | Handler2 0x2800 |
668 | Handler2 0x2800 |
691 | Handler 0x2c00 break_instruction |
669 | Handler 0x2c00 break_instruction |
692 | HEAVYWEIGHT_HANDLER 0x3000 external_interrupt /* For external interrupt, heavyweight handler is used. */ |
670 | HEAVYWEIGHT_HANDLER 0x3000 external_interrupt /* For external interrupt, heavyweight handler is used. */ |
693 | Handler2 0x3400 |
671 | Handler2 0x3400 |
694 | Handler2 0x3800 |
672 | Handler2 0x3800 |
695 | Handler2 0x3c00 |
673 | Handler2 0x3c00 |
696 | Handler2 0x4000 |
674 | Handler2 0x4000 |
697 | Handler2 0x4400 |
675 | Handler2 0x4400 |
698 | Handler2 0x4800 |
676 | Handler2 0x4800 |
699 | Handler2 0x4c00 |
677 | Handler2 0x4c00 |
700 | 678 | ||
701 | Handler2 0x5000 |
679 | Handler2 0x5000 |
702 | Handler2 0x5100 |
680 | Handler2 0x5100 |
703 | Handler2 0x5200 |
681 | Handler2 0x5200 |
704 | Handler2 0x5300 |
682 | Handler2 0x5300 |
705 | #Handler 0x5400 general_exception |
683 | #Handler 0x5400 general_exception |
706 | Handler2 0x5400 |
684 | Handler2 0x5400 |
707 | Handler2 0x5500 |
685 | Handler2 0x5500 |
708 | Handler2 0x5600 |
686 | Handler2 0x5600 |
709 | Handler2 0x5700 |
687 | Handler2 0x5700 |
710 | Handler2 0x5800 |
688 | Handler2 0x5800 |
711 | Handler2 0x5900 |
689 | Handler2 0x5900 |
712 | Handler2 0x5a00 |
690 | Handler2 0x5a00 |
713 | Handler2 0x5b00 |
691 | Handler2 0x5b00 |
714 | Handler2 0x5c00 |
692 | Handler2 0x5c00 |
715 | Handler2 0x5d00 |
693 | Handler2 0x5d00 |
716 | Handler2 0x5e00 |
694 | Handler2 0x5e00 |
717 | Handler2 0x5f00 |
695 | Handler2 0x5f00 |
718 | 696 | ||
719 | Handler2 0x6000 |
697 | Handler2 0x6000 |
720 | Handler2 0x6100 |
698 | Handler2 0x6100 |
721 | Handler2 0x6200 |
699 | Handler2 0x6200 |
722 | Handler2 0x6300 |
700 | Handler2 0x6300 |
723 | Handler2 0x6400 |
701 | Handler2 0x6400 |
724 | Handler2 0x6500 |
702 | Handler2 0x6500 |
725 | Handler2 0x6600 |
703 | Handler2 0x6600 |
726 | Handler2 0x6700 |
704 | Handler2 0x6700 |
727 | Handler2 0x6800 |
705 | Handler2 0x6800 |
728 | Handler2 0x6900 |
706 | Handler2 0x6900 |
729 | Handler2 0x6a00 |
707 | Handler2 0x6a00 |
730 | Handler2 0x6b00 |
708 | Handler2 0x6b00 |
731 | Handler2 0x6c00 |
709 | Handler2 0x6c00 |
732 | Handler2 0x6d00 |
710 | Handler2 0x6d00 |
733 | Handler2 0x6e00 |
711 | Handler2 0x6e00 |
734 | Handler2 0x6f00 |
712 | Handler2 0x6f00 |
735 | 713 | ||
736 | Handler2 0x7000 |
714 | Handler2 0x7000 |
737 | Handler2 0x7100 |
715 | Handler2 0x7100 |
738 | Handler2 0x7200 |
716 | Handler2 0x7200 |
739 | Handler2 0x7300 |
717 | Handler2 0x7300 |
740 | Handler2 0x7400 |
718 | Handler2 0x7400 |
741 | Handler2 0x7500 |
719 | Handler2 0x7500 |
742 | Handler2 0x7600 |
720 | Handler2 0x7600 |
743 | Handler2 0x7700 |
721 | Handler2 0x7700 |
744 | Handler2 0x7800 |
722 | Handler2 0x7800 |
745 | Handler2 0x7900 |
723 | Handler2 0x7900 |
746 | Handler2 0x7a00 |
724 | Handler2 0x7a00 |
747 | Handler2 0x7b00 |
725 | Handler2 0x7b00 |
748 | Handler2 0x7c00 |
726 | Handler2 0x7c00 |
749 | Handler2 0x7d00 |
727 | Handler2 0x7d00 |
750 | Handler2 0x7e00 |
728 | Handler2 0x7e00 |
751 | Handler2 0x7f00 |
729 | Handler2 0x7f00 |
752 | 730 | ||
753 | 731 | ||
754 | 732 | ||
755 | 733 | ||
756 | 734 | ||
757 | 735 | ||
758 | 736 | ||
759 | 737 | ||
760 | .align 32768 |
738 | .align 32768 |
761 | .global REG_DUMP |
739 | .global REG_DUMP |
762 | 740 | ||
763 | REG_DUMP: |
741 | REG_DUMP: |
764 | .space 128*8 |
742 | .space 128*8 |
765 | 743 | ||
766 | 744 |