diff options
Diffstat (limited to 'firmware/target/arm/tcc780x/crt0.S')
-rw-r--r-- | firmware/target/arm/tcc780x/crt0.S | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/firmware/target/arm/tcc780x/crt0.S b/firmware/target/arm/tcc780x/crt0.S index 1612973866..1dbccf9828 100644 --- a/firmware/target/arm/tcc780x/crt0.S +++ b/firmware/target/arm/tcc780x/crt0.S @@ -120,17 +120,16 @@ copied_start: ldr r11, =dma_play_data #endif - /* Let abort and undefined modes use IRQ stack */ - mov r0,#0xd7 - msr cpsr, r0 + /* Let svc, abort and undefined modes use irq stack */ + msr cpsr, #0xd3 ldr sp, =irq_stack - mov r0,#0xdb - msr cpsr, r0 + msr cpsr, #0xd7 + ldr sp, =irq_stack + msr cpsr, #0xdb ldr sp, =irq_stack - /* Switch to supervisor mode */ - mov r0,#0xd3 - msr cpsr, r0 + /* Switch to sys mode */ + msr cpsr, #0xdf ldr sp, =stackend /* Enable MMU & caches. At present this is just doing what the OF does. @@ -293,12 +292,14 @@ undef_instr_handler: mov r1, #0 b UIE -/* We run supervisor mode most of the time, and should never see a software - exception being thrown. Perhaps make it illegal and call UIE? +/* We run sys mode most of the time, and should never see a software + exception being thrown. Make it illegal and call UIE. */ software_int_handler: reserved_handler: - movs pc, lr + sub r0, lr, #4 + mov r1, #4 + b UIE prefetch_abort_handler: sub r0, lr, #4 |