MCPcopy Create free account
hub / github.com/LPC4/Full-Stack / reset_pc

Method reset_pc

crates/virtual-machine/src/cpu/pipeline.rs:128–136  ·  view source on GitHub ↗

Reset the program counter and flush the pipeline. Used by `VirtualMachine::new_kernel` to redirect the CPU to `ROM_BASE` after the ELF has been loaded into RAM, so that the ROM's `_start` boot stub runs first.

(&mut self, pc: u64)

Source from the content-addressed store, hash-verified

126 self.if_id = None;
127 self.id_ex = None;
128 self.ex_mem = None;
129 self.mem_wb = None;
130 self.pending_mem_wb = None;
131 self.memory_wait_cycles = 0;
132 self.tlb.flush();
133 }
134
135 /// Set register a0 (x10) to the kernel entry point so ROM `_start` can
136 /// `csrw mepc, a0` without knowing the address at assembly time.
137 pub fn set_boot_entry(&mut self, entry: u64) {
138 self.architectural.registers_mut().write_x(10, entry);
139 }

Callers

nothing calls this directly

Calls 1

flushMethod · 0.80

Tested by

no test coverage detected