Skip to content

Commit

Permalink
tool: fix logic bugs
Browse files Browse the repository at this point in the history
Mistakes from the rewrite of the tool.

Signed-off-by: Ivan Velickovic <[email protected]>
  • Loading branch information
Ivan-Velickovic committed Jun 11, 2024
1 parent 0cdcd54 commit f8f1697
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tool/microkit/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,9 @@ impl DisjointMemoryRegion {
pub fn insert_region(&mut self, base: u64, end: u64) {
let mut insert_idx = self.regions.len();
for (idx, region) in self.regions.iter().enumerate() {
if end >= region.base {
if end < region.base {
insert_idx = idx;
break;
}
}
// FIXME: Should extend here if adjacent rather than
Expand Down
1 change: 1 addition & 0 deletions tool/microkit/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -627,6 +627,7 @@ fn emulate_kernel_boot(kernel_config: &Config, kernel_elf: &ElfFile, initial_tas
let start = util::round_down(region.end - initial_objects_size, 1 << initial_objects_align);
if start >= region.base {
region_to_remove = Some(start);
break;
}
}
if let Some(start) = region_to_remove {
Expand Down

0 comments on commit f8f1697

Please sign in to comment.