diff options
Diffstat (limited to 'firmware/target/arm/s5l8700/crt0.S')
-rw-r--r-- | firmware/target/arm/s5l8700/crt0.S | 34 |
1 files changed, 19 insertions, 15 deletions
diff --git a/firmware/target/arm/s5l8700/crt0.S b/firmware/target/arm/s5l8700/crt0.S index 0d9793208c..0582ab0c8f 100644 --- a/firmware/target/arm/s5l8700/crt0.S +++ b/firmware/target/arm/s5l8700/crt0.S | |||
@@ -465,15 +465,6 @@ start_loc: | |||
465 | bhi 1b | 465 | bhi 1b |
466 | #endif | 466 | #endif |
467 | 467 | ||
468 | /* Set up some stack and munge it with 0xdeadbeef */ | ||
469 | ldr sp, =stackend | ||
470 | ldr r2, =stackbegin | ||
471 | ldr r3, =0xdeadbeef | ||
472 | 1: | ||
473 | cmp sp, r2 | ||
474 | strhi r3, [r2], #4 | ||
475 | bhi 1b | ||
476 | |||
477 | /* Set up stack for IRQ mode */ | 468 | /* Set up stack for IRQ mode */ |
478 | msr cpsr_c, #0xd2 | 469 | msr cpsr_c, #0xd2 |
479 | ldr sp, =_irqstackend | 470 | ldr sp, =_irqstackend |
@@ -482,14 +473,25 @@ start_loc: | |||
482 | msr cpsr_c, #0xd1 | 473 | msr cpsr_c, #0xd1 |
483 | ldr sp, =_fiqstackend | 474 | ldr sp, =_fiqstackend |
484 | 475 | ||
485 | /* Let abort and undefined modes use IRQ stack */ | 476 | /* Let svc, abort and undefined modes use irq stack */ |
477 | msr cpsr_c, #0xd3 | ||
478 | ldr sp, =_irqstackend | ||
486 | msr cpsr_c, #0xd7 | 479 | msr cpsr_c, #0xd7 |
487 | ldr sp, =_irqstackend | 480 | ldr sp, =_irqstackend |
488 | msr cpsr_c, #0xdb | 481 | msr cpsr_c, #0xdb |
489 | ldr sp, =_irqstackend | 482 | ldr sp, =_irqstackend |
490 | 483 | ||
491 | /* Switch back to supervisor mode */ | 484 | /* Switch to sys mode */ |
492 | msr cpsr_c, #0xd3 | 485 | msr cpsr_c, #0xdf |
486 | |||
487 | /* Set up some stack and munge it with 0xdeadbeef */ | ||
488 | ldr sp, =stackend | ||
489 | ldr r2, =stackbegin | ||
490 | ldr r3, =0xdeadbeef | ||
491 | 1: | ||
492 | cmp sp, r2 | ||
493 | strhi r3, [r2], #4 | ||
494 | bhi 1b | ||
493 | 495 | ||
494 | // if we did not switch remap on, device | 496 | // if we did not switch remap on, device |
495 | // would crash when MENU is pressed, | 497 | // would crash when MENU is pressed, |
@@ -518,11 +520,13 @@ undef_instr_handler: | |||
518 | mov r1, #0 | 520 | mov r1, #0 |
519 | b UIE | 521 | b UIE |
520 | 522 | ||
521 | /* We run supervisor mode most of the time, and should never see a software | 523 | /* We run sys mode most of the time, and should never see a software |
522 | * exception being thrown. Perhaps make it illegal and call UIE? */ | 524 | * exception being thrown. Make it illegal and call UIE. */ |
523 | software_int_handler: | 525 | software_int_handler: |
524 | reserved_handler: | 526 | reserved_handler: |
525 | movs pc, lr | 527 | sub r0, lr, #4 |
528 | mov r1, #4 | ||
529 | b UIE | ||
526 | 530 | ||
527 | prefetch_abort_handler: | 531 | prefetch_abort_handler: |
528 | sub r0, lr, #4 | 532 | sub r0, lr, #4 |