From 25c0a696a3a7fe547fd69ff505759cf0e222927d Mon Sep 17 00:00:00 2001 From: Ian Moffett Date: Sun, 12 Oct 2025 22:03:32 -0400 Subject: emux64: cpu: Add initial CPU cycle loop w/ HLT Signed-off-by: Ian Moffett --- emux64/src/include/cpu/cpu.h | 12 ++++++++++++ emux64/src/include/rom.h | 2 ++ 2 files changed, 14 insertions(+) (limited to 'emux64/src/include') diff --git a/emux64/src/include/cpu/cpu.h b/emux64/src/include/cpu/cpu.h index 2d35c73..bffb6c0 100644 --- a/emux64/src/include/cpu/cpu.h +++ b/emux64/src/include/cpu/cpu.h @@ -62,12 +62,14 @@ * @fn: IEEE 754 single-precision registers * @dn: IEEE 754 double-precision registers * @pc: Program counter + * @run: Processor running */ struct osmx_core { uint64_t xn[N_GPREG]; float fn[N_FLOATREG]; double dn[N_DUBREG]; uintptr_t pc; + uint8_t run : 1; }; /* @@ -97,4 +99,14 @@ int cpu_reset(struct osmx_core *core); */ void cpu_dump(struct osmx_core *core); +/* + * Initialize the registers to use for the + * CPU + * + * @core: Core to use + * + * Returns zero on success + */ +int cpu_run(struct osmx_core *core); + #endif /* !CPU_CPU_H */ diff --git a/emux64/src/include/rom.h b/emux64/src/include/rom.h index 8d3501c..0480440 100644 --- a/emux64/src/include/rom.h +++ b/emux64/src/include/rom.h @@ -44,6 +44,8 @@ struct osmx_rom { size_t length; }; +extern struct osmx_rom g_firmware; + /* * Open a ROM file by path * -- cgit v1.2.3