diff options
author | Perry Hung <iperry@gmail.com> | 2011-02-27 15:49:51 -0500 |
---|---|---|
committer | Perry Hung <iperry@gmail.com> | 2011-02-27 15:56:40 -0500 |
commit | 214941537f2211d5e2ef16e34440485d7e872d1a (patch) | |
tree | af951df8867ab47bc474828d57a0bd22eed36ae0 /libmaple/exc.S | |
parent | 43c5092d944ee1aa1424f2743c31bf33cb860c27 (diff) | |
download | librambutan-214941537f2211d5e2ef16e34440485d7e872d1a.tar.gz librambutan-214941537f2211d5e2ef16e34440485d7e872d1a.zip |
Refactor linker scripts. Rename irq and exception handlers.
Add common linker scripts for ram and rom. Add medium and high density
libraries for libcs3.
Diffstat (limited to 'libmaple/exc.S')
-rw-r--r-- | libmaple/exc.S | 44 |
1 files changed, 35 insertions, 9 deletions
diff --git a/libmaple/exc.S b/libmaple/exc.S index a9f6561..d01e3d5 100644 --- a/libmaple/exc.S +++ b/libmaple/exc.S @@ -41,16 +41,42 @@ # SP--> r0 .text -.globl HardFaultException +.globl __exc_hardfault +.globl __exc_nmi +.globl __exc_hardfault +.globl __exc_memmanage +.globl __exc_busfault +.globl __exc_usagefault + +/* TODO: Fix this up. */ +.thumb_func +__exc_nmi: + mov r0, #1 + +.thumb_func +__exc_hardfault: + mov r0, #2 + .thumb_func -HardFaultException: - ldr r0, CPSR_MASK @ Set default CPSR - push {r0} - ldr r0, TARGET_PC @ Set target pc - push {r0} - sub sp, sp, #24 @ its not like i even care - ldr r0, EXC_RETURN @ Return to thread mode - mov lr, r0 +__exc_memmanage: + mov r0, #3 + +.thumb_func +__exc_busfault: + mov r0, #4 + +.thumb_func +__exc_usagefault: + mov r0, #5 + +__default: + ldr r1, CPSR_MASK @ Set default CPSR + push {r1} + ldr r1, TARGET_PC @ Set target pc + push {r1} + sub sp, sp, #24 @ Don't care + ldr r1, EXC_RETURN @ Return to thread mode + mov lr, r1 bx lr @ Exception exit .align 4 |