diff --git a/kernel/src/arch/hosted/process.rs b/kernel/src/arch/hosted/process.rs index 3ac462e2f..8f381a63e 100644 --- a/kernel/src/arch/hosted/process.rs +++ b/kernel/src/arch/hosted/process.rs @@ -179,6 +179,10 @@ impl Process { process.threads[thread - 1].allocated = true; } + pub fn retry_instruction(&mut self, _tid: TID) -> Result<(), xous_kernel::Error> { + Ok(()) + } + pub fn setup_process(pid: PID, setup: ThreadInit) -> Result<(), xous_kernel::Error> { let mut tmp = Process { pid }; tmp.setup_thread(INITIAL_TID, setup) diff --git a/kernel/src/arch/riscv/process.rs b/kernel/src/arch/riscv/process.rs index 5a5d8e04c..c4f439809 100644 --- a/kernel/src/arch/riscv/process.rs +++ b/kernel/src/arch/riscv/process.rs @@ -235,6 +235,15 @@ impl Process { } } + pub fn retry_instruction(&mut self, tid: TID) -> Result<(), xous_kernel::Error> { + let process = unsafe { &mut *PROCESS }; + let mut thread = &mut process.threads[tid]; + if thread.sepc >= 4 { + thread.sepc -= 4; + } + Ok(()) + } + /// Initialize this process thread with the given entrypoint and stack /// addresses. pub fn setup_process(pid: PID, thread_init: ThreadInit) -> Result<(), xous_kernel::Error> {