saimaa: banked SPs for SVC

This commit is contained in:
SashegDev
2026-09-07 09:21:50 +00:00
parent 4e95ff3d42
commit 61cb6b9db3
+6 -2
View File
@@ -174,8 +174,12 @@ static void saimaa_machine_init(MachineState *machine)
exit(1);
}
cpu_set_pc(first_cpu, entry);
/* PBL normally sets up SBL stack + r0=pbl_shared; fake it */
ARM_CPU(first_cpu)->env.regs[13] = 0x085FFF00; /* top of DDRLOW */
/* PBL normally sets up SBL stack + r0=pbl_shared; fake it.
* All banked SPs: reset lands in SVC, regs[13] alone is USR. */
for (int b = 0; b < 8; b++) {
ARM_CPU(first_cpu)->env.banked_r13[b] = 0x085FFF00;
}
ARM_CPU(first_cpu)->env.regs[13] = 0x085FFF00;
ARM_CPU(first_cpu)->env.regs[0] = 0x00220000; /* fake pbl_shared */
printf("saimaa: SBL1 %s loaded (%zd bytes), entry 0x%lx\n",
sms->sbl1, sz, (unsigned long)entry);