diff options
author | Rafaël Carré <rafael.carre@gmail.com> | 2010-06-12 16:55:51 +0000 |
---|---|---|
committer | Rafaël Carré <rafael.carre@gmail.com> | 2010-06-12 16:55:51 +0000 |
commit | 646a999e35f5724affaa06fbfac183ca4d80d0c9 (patch) | |
tree | f749a36ae22b680f3ba86b40461afa468b6ba5b7 | |
parent | a331e0d3fb5b108abc0ac78ba061f70831b06645 (diff) | |
download | rockbox-646a999e35f5724affaa06fbfac183ca4d80d0c9.tar.gz rockbox-646a999e35f5724affaa06fbfac183ca4d80d0c9.zip |
Sansa AMS: call the exception handler with the correct address when the exception happened in Thumb state
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26818 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | firmware/target/arm/crt0.S | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/firmware/target/arm/crt0.S b/firmware/target/arm/crt0.S index 53b8a67ea1..6def9a1a88 100644 --- a/firmware/target/arm/crt0.S +++ b/firmware/target/arm/crt0.S | |||
@@ -181,7 +181,12 @@ newstart: | |||
181 | * we're in. Second parameter is exception number, used for a string lookup | 181 | * we're in. Second parameter is exception number, used for a string lookup |
182 | * in UIE. */ | 182 | * in UIE. */ |
183 | undef_instr_handler: | 183 | undef_instr_handler: |
184 | sub r0, lr, #4 | 184 | sub r0, lr, #4 @ r0 points to the faulty ARM instruction |
185 | #ifdef USE_THUMB | ||
186 | mrs r1, spsr | ||
187 | tst r1, #(1<<5) @ T bit set ? | ||
188 | subne r0, lr, #2 @ if yes, r0 points to the faulty THUMB instruction | ||
189 | #endif /* USE_THUMB */ | ||
185 | mov r1, #0 | 190 | mov r1, #0 |
186 | b UIE | 191 | b UIE |
187 | 192 | ||