Skip to main content

handle_store

Function handle_store 

Source
pub fn handle_store(
    cpu: &mut CpuState,
    addr: u32,
    val: u32,
    output_buf: Option<&mut Vec<u8>>,
) -> StepResult
Expand description

Handle an MMIO store (write).

Returns StepResult::Ok in all normal cases. Returns StepResult::Restart or StepResult::Poweroff when the kernel writes to SYSCON, which causes the run loop to exit immediately.

The output_buf parameter controls UART output routing:

  • None — bytes are printed directly to stdout (native binary mode).
  • Some(buf) — bytes are appended to the buffer (WASM mode).