diff options
author | Amaury Pouly <amaury.pouly@gmail.com> | 2012-04-02 15:11:21 +0200 |
---|---|---|
committer | Amaury Pouly <amaury.pouly@gmail.com> | 2012-04-06 13:46:32 +0200 |
commit | f33330c0ff90adad8855250877a4a3d0a407bba4 (patch) | |
tree | 6b5ad86aeb2e6b0a57f78965e59c618b4a26f30f /firmware/target/arm/crt0.S | |
parent | bb0e4cc543e4c7bed6dff3a41d092b6867632535 (diff) | |
download | rockbox-f33330c0ff90adad8855250877a4a3d0a407bba4.tar.gz rockbox-f33330c0ff90adad8855250877a4a3d0a407bba4.zip |
arm: factor all exception handlers out of the crt0.S files
Remove the implementations of all exceptions handlers from the
various crt0.S files and have a single implementation in system-arm.h
The new implementation is weak so that it can be overwritten by some
specific code (like the unwinder)
Change-Id: Ib3e041ed6037376bbe0e79286057e1051640dd90
Reviewed-on: http://gerrit.rockbox.org/205
Reviewed-by: Marcin Bukat <marcin.bukat@gmail.com>
Diffstat (limited to 'firmware/target/arm/crt0.S')
-rw-r--r-- | firmware/target/arm/crt0.S | 32 |
1 files changed, 0 insertions, 32 deletions
diff --git a/firmware/target/arm/crt0.S b/firmware/target/arm/crt0.S index 7befecb593..b9cc27f5c5 100644 --- a/firmware/target/arm/crt0.S +++ b/firmware/target/arm/crt0.S | |||
@@ -137,38 +137,6 @@ newstart: | |||
137 | ldr ip, =main @ make sure we are using the virtual address | 137 | ldr ip, =main @ make sure we are using the virtual address |
138 | bx ip | 138 | bx ip |
139 | 139 | ||
140 | /* All illegal exceptions call into UIE with exception address as first | ||
141 | * parameter. This is calculated differently depending on which exception | ||
142 | * we're in. Second parameter is exception number, used for a string lookup | ||
143 | * in UIE. */ | ||
144 | undef_instr_handler: | ||
145 | sub r0, lr, #4 @ r0 points to the faulty ARM instruction | ||
146 | #ifdef USE_THUMB | ||
147 | mrs r1, spsr | ||
148 | tst r1, #(1<<5) @ T bit set ? | ||
149 | subne r0, lr, #2 @ if yes, r0 points to the faulty THUMB instruction | ||
150 | #endif /* USE_THUMB */ | ||
151 | mov r1, #0 | ||
152 | b UIE | ||
153 | |||
154 | /* We run sys mode most of the time, and should never see a software | ||
155 | * exception being thrown. Make it illegal and call UIE. */ | ||
156 | software_int_handler: | ||
157 | reserved_handler: | ||
158 | sub r0, lr, #4 | ||
159 | mov r1, #4 | ||
160 | b UIE | ||
161 | |||
162 | prefetch_abort_handler: | ||
163 | sub r0, lr, #4 | ||
164 | mov r1, #1 | ||
165 | b UIE | ||
166 | |||
167 | data_abort_handler: | ||
168 | sub r0, lr, #8 | ||
169 | mov r1, #2 | ||
170 | b UIE | ||
171 | |||
172 | /* Cache-align interrupt stacks */ | 140 | /* Cache-align interrupt stacks */ |
173 | .balign 32 | 141 | .balign 32 |
174 | 142 | ||