Sitelet https://github.com/r55-eth/rvemu/commit/07994c5261f69a130b6abcea70ba1ed0e2c9bbaf
Skip to content

Commit 07994c5

Browse files
authored
Merge pull request d0iasm#21 from pixelspark/feature/expose-rom
feat: expose ROM so it can be changed externally
2 parents 54f1020 + 897f2cf commit 07994c5

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

‎src/bus.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ pub struct Bus {
5151
pub uart: Uart,
5252
pub virtio: Virtio,
5353
dram: Dram,
54-
rom: Rom,
54+
pub rom: Rom,
5555
}
5656

5757
impl Bus {

‎src/rom.rs‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,10 @@ impl Rom {
159159
Self { data: rom }
160160
}
161161

162+
pub fn new_with_data(data: Vec<u8>) -> Rom {
163+
Rom { data }
164+
}
165+
162166
/// Load `size`-bit data from the memory.
163167
pub fn read(&self, addr: u64, size: u8) -> Result<u64, Exception> {
164168
match size {

0 commit comments

Comments
 (0)