diff options
Diffstat (limited to 'usr.bin/oemu/include/oemu/cpu.h')
-rw-r--r-- | usr.bin/oemu/include/oemu/cpu.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/usr.bin/oemu/include/oemu/cpu.h b/usr.bin/oemu/include/oemu/cpu.h index df4cc80..882fe93 100644 --- a/usr.bin/oemu/include/oemu/cpu.h +++ b/usr.bin/oemu/include/oemu/cpu.h @@ -31,6 +31,7 @@ #define _OEMU_CPU_H_ #include <sys/types.h> +#include <sys/param.h> #include <stdint.h> #include <stddef.h> #include <oemu/types.h> @@ -38,6 +39,12 @@ #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 * * @mem: Data @@ -53,16 +60,23 @@ struct sysmem { * * @xreg: X<n> * @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 { struct cpu_regs regs; }; +void cpu_regdump(struct oemu_cpu *cpu); void cpu_reset(struct oemu_cpu *cpu); void cpu_kick(struct oemu_cpu *cpu, struct sysmem *mem); |