diff options
author | Aidan MacDonald <amachronic@protonmail.com> | 2021-04-07 19:27:22 +0100 |
---|---|---|
committer | Aidan MacDonald <amachronic@protonmail.com> | 2021-04-07 19:59:57 +0100 |
commit | 4b263725912939748427faa105f8b2745999a627 (patch) | |
tree | d4711faa6326c7c97e67d498146f8670747875d3 /firmware | |
parent | 213d372c929668417e7c89468a0adf284377b161 (diff) | |
download | rockbox-4b263725912939748427faa105f8b2745999a627.tar.gz rockbox-4b263725912939748427faa105f8b2745999a627.zip |
MIPS: make sure to fill 'jr' branch delay slot with 'nop'
Inline assembly in RoLO and the FiiO M3K bootloader used 'jr' to
jump to a newly loaded Rockbox binary, but incorrectly left the
branch delay slot open. That gives GCC an opening to place illegal
instrutions, etc, which might cause an unhandled exception.
Change-Id: Ia7a561fe530e94a41189d25f18a767c448177960
Diffstat (limited to 'firmware')
-rw-r--r-- | firmware/rolo.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/firmware/rolo.c b/firmware/rolo.c index f58b56e827..622110576a 100644 --- a/firmware/rolo.c +++ b/firmware/rolo.c | |||
@@ -204,6 +204,7 @@ void rolo_restart(const unsigned char* source, unsigned char* dest, | |||
204 | commit_discard_idcache(); | 204 | commit_discard_idcache(); |
205 | asm volatile( | 205 | asm volatile( |
206 | "jr %0 \n" | 206 | "jr %0 \n" |
207 | "nop\n" | ||
207 | : : "r"(dest) | 208 | : : "r"(dest) |
208 | ); | 209 | ); |
209 | #endif | 210 | #endif |