diff options
author | Jay Monkman <jtm@smoothsmoothie.com> | 2006-06-02 21:49:36 +0000 |
---|---|---|
committer | Jay Monkman <jtm@smoothsmoothie.com> | 2006-06-02 21:49:36 +0000 |
commit | aed1db6c00b26fc6d0f503eaa84a1a6d80f5afd3 (patch) | |
tree | 9af2681c09835ee036020f4360e7bcb2cbf3f2b0 /cpukit/score/cpu/arm/cpu_asm.S | |
parent | Fixed ARM Data Abort handling. (diff) | |
download | rtems-aed1db6c00b26fc6d0f503eaa84a1a6d80f5afd3.tar.bz2 |
2006-06-02 Jay Monkman <jtm@lopingdog.com>
* cpu.c, cpu_asm.S: Fixed ARM Data Abort handling.
Diffstat (limited to '')
-rw-r--r-- | cpukit/score/cpu/arm/cpu_asm.S | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/cpukit/score/cpu/arm/cpu_asm.S b/cpukit/score/cpu/arm/cpu_asm.S index a418657c72..7abc881e45 100644 --- a/cpukit/score/cpu/arm/cpu_asm.S +++ b/cpukit/score/cpu/arm/cpu_asm.S @@ -134,21 +134,31 @@ _go_back_2: ldr lr, [r13, #REG_LR] add r13,r13,#SIZE_REGS subs pc,r14,#4 /* return */ + +#define ABORT_REGS_OFFS 32-REG_R4 +#define ABORT_SIZE_REGS SIZE_REGS+ABORT_REGS_OFFS .globl _exc_data_abort _exc_data_abort: - sub sp, sp, #SIZE_REGS /* reserve register frame */ - stmia sp, {r0-r12} + sub sp, sp, #ABORT_SIZE_REGS /* reserve register frame */ + stmia sp, {r0-r11} + add sp, sp, #ABORT_REGS_OFFS /* the Context_Control structure starts by CPSR, R4, ... */ + + str ip, [sp, #REG_PC] /* store R12 (ip) somewhere, oh hackery, hackery, hack */ str lr, [sp, #REG_LR] + mov r1, lr ldr r0, [r1, #-8] /* r0 = bad instruction */ mrs r1, spsr /* r1 = spsr */ - mov r2, r13 /* r2 = exception frame */ + mov r2, r13 /* r2 = exception frame of Context_Control type */ bl do_data_abort ldr lr, [sp, #REG_LR] - ldmia sp, {r0-r12} - add sp, sp, #SIZE_REGS + ldr ip, [sp, #REG_PC] /* restore R12 (ip) */ + + sub sp, sp, #ABORT_REGS_OFFS + ldmia sp, {r0-r11} + add sp, sp, #ABORT_SIZE_REGS subs pc, r14, #4 /* return to the instruction */ /* _AFTER_ the aborted one */ |