On 1/9/26 01:34, Alex Bennée wrote:
As the mbar/rambar0 values are currently fixed we can migrate the
setting of them to the reset handler as well.
Signed-off-by: Alex Bennée <[email protected]>
---
hw/m68k/an5206.c | 24 +++++++++++++++++-------
1 file changed, 17 insertions(+), 7 deletions(-)
diff --git a/hw/m68k/an5206.c b/hw/m68k/an5206.c
index f92a5d6a339..918c376a384 100644
--- a/hw/m68k/an5206.c
+++ b/hw/m68k/an5206.c
@@ -15,11 +15,26 @@
#include "elf.h"
#include "qemu/error-report.h"
#include "system/qtest.h"
+#include "system/reset.h"
#define KERNEL_LOAD_ADDR 0x10000
#define AN5206_MBAR_ADDR 0x10000000
#define AN5206_RAMBAR_ADDR 0x20000000
+static void an5206_cpu_reset(void *opaque)
+{
+ M68kCPU *cpu = opaque;
+ CPUM68KState *env = &cpu->env;
+ CPUState *cs = CPU(cpu);
+
+ cpu_reset(cs);
+ cpu->env.vbr = 0;
+ cpu->env.mbar = AN5206_MBAR_ADDR | 1;
+ cpu->env.rambar0 = AN5206_RAMBAR_ADDR | 1;
+
+ cpu->env.pc = env->reset_pc;
+}
Don't mix cpu->env with plain env.
Otherwise,
Reviewed-by: Richard Henderson <[email protected]>
r~