diff options
author | Rafaël Carré <rafael.carre@gmail.com> | 2010-06-11 04:41:36 +0000 |
---|---|---|
committer | Rafaël Carré <rafael.carre@gmail.com> | 2010-06-11 04:41:36 +0000 |
commit | 45c7498f59ad2889f2120a865a51043004eddd5d (patch) | |
tree | 1a62b0e8549a7f2750679de8d7dd3f82039c5719 /firmware/target/arm/pcm-pp.c | |
parent | fe7ca44471b309a0adea563cce947de9efb62ab5 (diff) | |
download | rockbox-45c7498f59ad2889f2120a865a51043004eddd5d.tar.gz rockbox-45c7498f59ad2889f2120a865a51043004eddd5d.zip |
FS#11335 by me: make ARM assembly functions thumb-friendly
We can't pop into pc on ARMv4t when using thumb: the T bit won't be
modified if we are returning to a thumb function
Code running on ARMv4t should use the new ldrpc / ldmpc macros instead
of ldr pc, [sp], #4 and ldm(cond) sp!, {regs, pc}
No modification on pure ARM builds and ARMv5+
Note: USE_THUMB is currently never defined, no targets can currently be
built with -mthumb, see FS#6734
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26756 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target/arm/pcm-pp.c')
-rw-r--r-- | firmware/target/arm/pcm-pp.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/firmware/target/arm/pcm-pp.c b/firmware/target/arm/pcm-pp.c index 6289b4c730..bffc69f771 100644 --- a/firmware/target/arm/pcm-pp.c +++ b/firmware/target/arm/pcm-pp.c | |||
@@ -74,9 +74,14 @@ void fiq_handler(void) ICODE_ATTR __attribute__((naked)); | |||
74 | void fiq_handler(void) | 74 | void fiq_handler(void) |
75 | { | 75 | { |
76 | asm volatile ( | 76 | asm volatile ( |
77 | "ldr pc, [pc, #-4] \n" | 77 | #if ARM_ARCH == 4 && defined(USE_THUMB) |
78 | "fiq_function: \n" | 78 | "ldr r12, [pc, #-4] \n" |
79 | ".word 0 \n" | 79 | "bx r12 \n" |
80 | #else | ||
81 | "ldr pc, [pc, #-4] \n" | ||
82 | #endif | ||
83 | "fiq_function: \n" | ||
84 | ".word 0 \n" | ||
80 | ); | 85 | ); |
81 | } | 86 | } |
82 | 87 | ||