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
This commit is contained in:
Rafaël Carré 2010-06-12 16:55:51 +00:00
parent a331e0d3fb
commit 646a999e35

View file

@ -181,7 +181,12 @@ newstart:
* we're in. Second parameter is exception number, used for a string lookup * we're in. Second parameter is exception number, used for a string lookup
* in UIE. */ * in UIE. */
undef_instr_handler: undef_instr_handler:
sub r0, lr, #4 sub r0, lr, #4 @ r0 points to the faulty ARM instruction
#ifdef USE_THUMB
mrs r1, spsr
tst r1, #(1<<5) @ T bit set ?
subne r0, lr, #2 @ if yes, r0 points to the faulty THUMB instruction
#endif /* USE_THUMB */
mov r1, #0 mov r1, #0
b UIE b UIE