Quick check whether an address falls inside this ROM.
(&self, addr: u64)
| 21 | |
| 22 | /// Quick check whether an address falls inside this ROM. |
| 23 | pub fn contains(&self, addr: u64) -> bool { |
| 24 | addr >= self.base && addr < self.base + self.size |
| 25 | } |
| 26 | |
| 27 | // Physical address -> index into the data array; `None` if out of bounds. |
| 28 | fn index(&self, addr: u64) -> Option<usize> { |