From 3258b0a6ffd6095b6351b3e95859b115454e47fc Mon Sep 17 00:00:00 2001 From: SashegDev Date: Mon, 7 Sep 2026 09:32:34 +0000 Subject: [PATCH] saimaa: pc slot is 14th word (r0-r12,pc) --- qemu/saimaa.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/qemu/saimaa.c b/qemu/saimaa.c index 2845bd6..6ea2ece 100644 --- a/qemu/saimaa.c +++ b/qemu/saimaa.c @@ -187,7 +187,8 @@ static void saimaa_machine_init(MachineState *machine) uint32_t tgt = strtoul(sms->sblmain, NULL, 0); uint32_t zero = 0; cpu_physical_memory_write(0x085FFF00, &zero, 4); - cpu_physical_memory_write(0x085FFF00 + 12 * 4, &tgt, 4); + /* trampoline pops r0-r12,pc: pc slot is 14th word */ + cpu_physical_memory_write(0x085FFF00 + 13 * 4, &tgt, 4); printf("saimaa: stack-pc override -> 0x%x\n", tgt); } printf("saimaa: SBL1 %s loaded (%zd bytes), entry 0x%lx\n",