From 2b63e7d4ec49c46f80e5ce6755197b9a0e57fe61 Mon Sep 17 00:00:00 2001 From: Markus Koch Date: Thu, 30 Jan 2025 20:18:44 +0100 Subject: [PATCH] sw: bootrom: Remove jump workaround With the naked attribute, this no longer causes gcc to push stuff onto the stack. --- sw/bootrom/main.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sw/bootrom/main.c b/sw/bootrom/main.c index b989913..ca1da1f 100644 --- a/sw/bootrom/main.c +++ b/sw/bootrom/main.c @@ -49,8 +49,7 @@ __attribute__((noreturn, naked)) void main() { case 5: // Address ptr = (uint8_t*)sr; if (opcode == 3) { // Jump - //((void (*)()) ptr)(); - asm("jalr %0" : : "r"(ptr)); // Not sure why, but the jump above causes GCC to save variables to the stack at the beginning of this function + ((void (*)()) ptr)(); __builtin_unreachable(); } break;