diff options
author | Catalin Marinas <catalin.marinas@arm.com> | 2009-02-16 05:42:09 -0500 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2009-02-19 06:27:35 -0500 |
commit | c4c5716e16c4ee971dec446a7e4801fbb8a1066b (patch) | |
tree | a1fb65c5b694bdc0b61bcd06371c2204968eb3b3 /arch/arm/kernel/entry-armv.S | |
parent | 2e1926e7b5d39eb31880152d636e8d8d011888cb (diff) |
[ARM] 5385/2: unwind: Add unwinding information to exception entry points
This is needed to allow or stop the unwinding at certain points in the
kernel like exception entries.
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/kernel/entry-armv.S')
-rw-r--r-- | arch/arm/kernel/entry-armv.S | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/arch/arm/kernel/entry-armv.S b/arch/arm/kernel/entry-armv.S index 85040cfeb5e5..d662a2f1fd85 100644 --- a/arch/arm/kernel/entry-armv.S +++ b/arch/arm/kernel/entry-armv.S | |||
@@ -20,6 +20,7 @@ | |||
20 | #include <asm/vfpmacros.h> | 20 | #include <asm/vfpmacros.h> |
21 | #include <mach/entry-macro.S> | 21 | #include <mach/entry-macro.S> |
22 | #include <asm/thread_notify.h> | 22 | #include <asm/thread_notify.h> |
23 | #include <asm/unwind.h> | ||
23 | 24 | ||
24 | #include "entry-header.S" | 25 | #include "entry-header.S" |
25 | 26 | ||
@@ -123,6 +124,8 @@ ENDPROC(__und_invalid) | |||
123 | #endif | 124 | #endif |
124 | 125 | ||
125 | .macro svc_entry, stack_hole=0 | 126 | .macro svc_entry, stack_hole=0 |
127 | UNWIND(.fnstart ) | ||
128 | UNWIND(.save {r0 - pc} ) | ||
126 | sub sp, sp, #(S_FRAME_SIZE + \stack_hole) | 129 | sub sp, sp, #(S_FRAME_SIZE + \stack_hole) |
127 | SPFIX( tst sp, #4 ) | 130 | SPFIX( tst sp, #4 ) |
128 | SPFIX( bicne sp, sp, #4 ) | 131 | SPFIX( bicne sp, sp, #4 ) |
@@ -196,6 +199,7 @@ __dabt_svc: | |||
196 | ldr r0, [sp, #S_PSR] | 199 | ldr r0, [sp, #S_PSR] |
197 | msr spsr_cxsf, r0 | 200 | msr spsr_cxsf, r0 |
198 | ldmia sp, {r0 - pc}^ @ load r0 - pc, cpsr | 201 | ldmia sp, {r0 - pc}^ @ load r0 - pc, cpsr |
202 | UNWIND(.fnend ) | ||
199 | ENDPROC(__dabt_svc) | 203 | ENDPROC(__dabt_svc) |
200 | 204 | ||
201 | .align 5 | 205 | .align 5 |
@@ -228,6 +232,7 @@ __irq_svc: | |||
228 | bleq trace_hardirqs_on | 232 | bleq trace_hardirqs_on |
229 | #endif | 233 | #endif |
230 | ldmia sp, {r0 - pc}^ @ load r0 - pc, cpsr | 234 | ldmia sp, {r0 - pc}^ @ load r0 - pc, cpsr |
235 | UNWIND(.fnend ) | ||
231 | ENDPROC(__irq_svc) | 236 | ENDPROC(__irq_svc) |
232 | 237 | ||
233 | .ltorg | 238 | .ltorg |
@@ -278,6 +283,7 @@ __und_svc: | |||
278 | ldr lr, [sp, #S_PSR] @ Get SVC cpsr | 283 | ldr lr, [sp, #S_PSR] @ Get SVC cpsr |
279 | msr spsr_cxsf, lr | 284 | msr spsr_cxsf, lr |
280 | ldmia sp, {r0 - pc}^ @ Restore SVC registers | 285 | ldmia sp, {r0 - pc}^ @ Restore SVC registers |
286 | UNWIND(.fnend ) | ||
281 | ENDPROC(__und_svc) | 287 | ENDPROC(__und_svc) |
282 | 288 | ||
283 | .align 5 | 289 | .align 5 |
@@ -320,6 +326,7 @@ __pabt_svc: | |||
320 | ldr r0, [sp, #S_PSR] | 326 | ldr r0, [sp, #S_PSR] |
321 | msr spsr_cxsf, r0 | 327 | msr spsr_cxsf, r0 |
322 | ldmia sp, {r0 - pc}^ @ load r0 - pc, cpsr | 328 | ldmia sp, {r0 - pc}^ @ load r0 - pc, cpsr |
329 | UNWIND(.fnend ) | ||
323 | ENDPROC(__pabt_svc) | 330 | ENDPROC(__pabt_svc) |
324 | 331 | ||
325 | .align 5 | 332 | .align 5 |
@@ -343,6 +350,8 @@ ENDPROC(__pabt_svc) | |||
343 | #endif | 350 | #endif |
344 | 351 | ||
345 | .macro usr_entry | 352 | .macro usr_entry |
353 | UNWIND(.fnstart ) | ||
354 | UNWIND(.cantunwind ) @ don't unwind the user space | ||
346 | sub sp, sp, #S_FRAME_SIZE | 355 | sub sp, sp, #S_FRAME_SIZE |
347 | stmib sp, {r1 - r12} | 356 | stmib sp, {r1 - r12} |
348 | 357 | ||
@@ -420,6 +429,7 @@ __dabt_usr: | |||
420 | mov r2, sp | 429 | mov r2, sp |
421 | adr lr, ret_from_exception | 430 | adr lr, ret_from_exception |
422 | b do_DataAbort | 431 | b do_DataAbort |
432 | UNWIND(.fnend ) | ||
423 | ENDPROC(__dabt_usr) | 433 | ENDPROC(__dabt_usr) |
424 | 434 | ||
425 | .align 5 | 435 | .align 5 |
@@ -450,6 +460,7 @@ __irq_usr: | |||
450 | 460 | ||
451 | mov why, #0 | 461 | mov why, #0 |
452 | b ret_to_user | 462 | b ret_to_user |
463 | UNWIND(.fnend ) | ||
453 | ENDPROC(__irq_usr) | 464 | ENDPROC(__irq_usr) |
454 | 465 | ||
455 | .ltorg | 466 | .ltorg |
@@ -484,6 +495,7 @@ __und_usr: | |||
484 | #else | 495 | #else |
485 | b __und_usr_unknown | 496 | b __und_usr_unknown |
486 | #endif | 497 | #endif |
498 | UNWIND(.fnend ) | ||
487 | ENDPROC(__und_usr) | 499 | ENDPROC(__und_usr) |
488 | 500 | ||
489 | @ | 501 | @ |
@@ -671,14 +683,18 @@ __pabt_usr: | |||
671 | enable_irq @ Enable interrupts | 683 | enable_irq @ Enable interrupts |
672 | mov r1, sp @ regs | 684 | mov r1, sp @ regs |
673 | bl do_PrefetchAbort @ call abort handler | 685 | bl do_PrefetchAbort @ call abort handler |
686 | UNWIND(.fnend ) | ||
674 | /* fall through */ | 687 | /* fall through */ |
675 | /* | 688 | /* |
676 | * This is the return code to user mode for abort handlers | 689 | * This is the return code to user mode for abort handlers |
677 | */ | 690 | */ |
678 | ENTRY(ret_from_exception) | 691 | ENTRY(ret_from_exception) |
692 | UNWIND(.fnstart ) | ||
693 | UNWIND(.cantunwind ) | ||
679 | get_thread_info tsk | 694 | get_thread_info tsk |
680 | mov why, #0 | 695 | mov why, #0 |
681 | b ret_to_user | 696 | b ret_to_user |
697 | UNWIND(.fnend ) | ||
682 | ENDPROC(__pabt_usr) | 698 | ENDPROC(__pabt_usr) |
683 | ENDPROC(ret_from_exception) | 699 | ENDPROC(ret_from_exception) |
684 | 700 | ||
@@ -688,6 +704,8 @@ ENDPROC(ret_from_exception) | |||
688 | * previous and next are guaranteed not to be the same. | 704 | * previous and next are guaranteed not to be the same. |
689 | */ | 705 | */ |
690 | ENTRY(__switch_to) | 706 | ENTRY(__switch_to) |
707 | UNWIND(.fnstart ) | ||
708 | UNWIND(.cantunwind ) | ||
691 | add ip, r1, #TI_CPU_SAVE | 709 | add ip, r1, #TI_CPU_SAVE |
692 | ldr r3, [r2, #TI_TP_VALUE] | 710 | ldr r3, [r2, #TI_TP_VALUE] |
693 | stmia ip!, {r4 - sl, fp, sp, lr} @ Store most regs on stack | 711 | stmia ip!, {r4 - sl, fp, sp, lr} @ Store most regs on stack |
@@ -717,6 +735,7 @@ ENTRY(__switch_to) | |||
717 | bl atomic_notifier_call_chain | 735 | bl atomic_notifier_call_chain |
718 | mov r0, r5 | 736 | mov r0, r5 |
719 | ldmia r4, {r4 - sl, fp, sp, pc} @ Load all regs saved previously | 737 | ldmia r4, {r4 - sl, fp, sp, pc} @ Load all regs saved previously |
738 | UNWIND(.fnend ) | ||
720 | ENDPROC(__switch_to) | 739 | ENDPROC(__switch_to) |
721 | 740 | ||
722 | __INIT | 741 | __INIT |