mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-19 09:00:54 +00:00
patching routine for memory regions.
ended up not being used because main memory is a special case :P
This commit is contained in:
parent
aff3620bdf
commit
cf32b4edb5
1 changed files with 9 additions and 0 deletions
|
|
@ -84,6 +84,15 @@ impl MemoryRegions {
|
||||||
pub fn len(&self) -> usize { self.regions.len() }
|
pub fn len(&self) -> usize { self.regions.len() }
|
||||||
|
|
||||||
pub fn is_empty(&self) -> bool { self.regions.is_empty() }
|
pub fn is_empty(&self) -> bool { self.regions.is_empty() }
|
||||||
|
|
||||||
|
#[allow(dead_code)]
|
||||||
|
pub fn patch(&mut self, region_name: &str, new_spec: MemoryRegion) {
|
||||||
|
if let Some(index) = self.regions.iter().position(|&x| x.name == MemoryRegion::make_name(region_name))
|
||||||
|
{
|
||||||
|
self.regions.remove(index);
|
||||||
|
self.regions.insert(index, new_spec);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl XousArgument for MemoryRegions {
|
impl XousArgument for MemoryRegions {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue