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

Function framebuffer_writes_route_to_device

crates/virtual-machine/src/bus.rs:357–371  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

355
356 /// Debug read. ROM and MMIO go direct, RAM goes through the caches and so
357 /// perturbs cache stats: use `peek_bytes_raw` when that matters.
358 pub fn peek_bytes(&mut self, addr: u64, len: usize) -> Vec<u8> {
359 (0..len as u64)
360 .map(|i| match addr + i {
361 a if a >= ROM_BASE && a <= ROM_END => self.rom.read_byte(a).unwrap_or(0),
362 a if a >= UART_BASE && a <= UART_END => {
363 self.uart.read_byte(a - UART_BASE).unwrap_or(0)
364 }
365 a if a >= CLINT_BASE && a <= CLINT_END => {
366 self.clint.read_byte(a - CLINT_BASE).unwrap_or(0)
367 }
368 a if a >= PLIC_BASE && a <= PLIC_END => {
369 self.plic.read_byte(a - PLIC_BASE).unwrap_or(0)
370 }
371 a if a >= FB_BASE && a <= FB_END => self
372 .framebuffer
373 .pixels()
374 .get((a - FB_BASE) as usize)

Callers

nothing calls this directly

Calls 3

write_wordMethod · 0.45
write_byteMethod · 0.45
peek_framebufferMethod · 0.45

Tested by

no test coverage detected