From 4b263725912939748427faa105f8b2745999a627 Mon Sep 17 00:00:00 2001 From: Aidan MacDonald Date: Wed, 7 Apr 2021 19:27:22 +0100 Subject: 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 --- firmware/rolo.c | 1 + 1 file changed, 1 insertion(+) (limited to 'firmware') 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, commit_discard_idcache(); asm volatile( "jr %0 \n" + "nop\n" : : "r"(dest) ); #endif -- cgit v1.2.3