From ff5a77f6f2ee9e7086b0f2c16cf0752a2d105d33 Mon Sep 17 00:00:00 2001 From: Ian Moffett Date: Tue, 22 Jul 2025 14:43:37 -0400 Subject: oemu: cpu: Add link registers and SR_STATE Signed-off-by: Ian Moffett --- usr.bin/oemu/include/oemu/cpu.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'usr.bin/oemu/include') diff --git a/usr.bin/oemu/include/oemu/cpu.h b/usr.bin/oemu/include/oemu/cpu.h index 78b92da..882fe93 100644 --- a/usr.bin/oemu/include/oemu/cpu.h +++ b/usr.bin/oemu/include/oemu/cpu.h @@ -31,12 +31,19 @@ #define _OEMU_CPU_H_ #include +#include #include #include #include #define MEMORY_SIZE 512 +/* + * Processor state register + */ +#define CPU_SRS_SV BIT(1) /* Supervisor flag */ +#define CPU_SRS_CARRY BIT(2) /* Carry flag */ + /* * System memory * @@ -53,10 +60,16 @@ struct sysmem { * * @xreg: X * @ip: Instruction pointer + * @sr_state: Processor state register + * @blr: Branch link register + * @ilr: Interrupt link register */ struct cpu_regs { reg_t xreg[16]; reg_t ip; + reg_t sr_state; + reg_t blr; + reg_t ilr; }; struct oemu_cpu { -- cgit v1.2.3