From 0189cc9d771e5911b07fbf91ca18da3a338f8d30 Mon Sep 17 00:00:00 2001 From: Nathan Lee Date: Sat, 3 Oct 2026 21:37:57 -0500 Subject: add first userspace invocation --- website-emu/src/state.rs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'website-emu/src/state.rs') diff --git a/website-emu/src/state.rs b/website-emu/src/state.rs index 4b32713..62df0d0 100644 --- a/website-emu/src/state.rs +++ b/website-emu/src/state.rs @@ -1,11 +1,19 @@ use crate::mem::CpuMemory; +#[derive(Debug)] +pub enum Mode { + MACHINE, + USER +} + pub struct CpuState { pub memory: CpuMemory, pub registers: [u32; 32], pub csr: [u32; 4096], pub pc: u32, - pub on: bool + pub on: bool, + + pub mode: Mode } impl CpuState { @@ -15,7 +23,8 @@ impl CpuState { registers: [0u32; 32], csr: [0u32; 4096], pc: 0, - on: true + on: true, + mode: Mode::MACHINE, } } } -- cgit v1.2.3