summaryrefslogtreecommitdiff
path: root/usr.bin/oemu/include
diff options
context:
space:
mode:
authorIan Moffett <ian@osmora.org>2025-07-22 14:43:37 -0400
committerIan Moffett <ian@osmora.org>2025-07-22 14:43:37 -0400
commitff5a77f6f2ee9e7086b0f2c16cf0752a2d105d33 (patch)
treec3e9529b4a4741106b074b53bfc0f2c5a26e9b6b /usr.bin/oemu/include
parentcf3b1238d3ebdf6184a9977ee6e0d3057313444c (diff)
oemu: cpu: Add link registers and SR_STATE
Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'usr.bin/oemu/include')
-rw-r--r--usr.bin/oemu/include/oemu/cpu.h13
1 files changed, 13 insertions, 0 deletions
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,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,10 +60,16 @@ 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 {