mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-16 08:38:26 +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
b06dd72e7d
commit
8c219f8fb1
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 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 {
|
||||
|
|
|
|||
Loading…
Reference in a new issue