Skip to content

Commit

Permalink
Merge pull request #469 from Freax13/fix/clean
Browse files Browse the repository at this point in the history
properly jump the address gap in CleanUp
  • Loading branch information
phil-opp committed Mar 15, 2024
2 parents a441868 + 31f1d04 commit a20e690
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/structures/paging/mapper/mapped_page_table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -646,7 +646,11 @@ impl<'a, P: PageTableFrameMapping> CleanUp for MappedPageTable<'a, P> {
.skip(usize::from(start))
{
if let Ok(page_table) = page_table_walker.next_table_mut(entry) {
let start = table_addr + (offset_per_entry * (i as u64));
let start = VirtAddr::forward_checked_impl(
table_addr,
(offset_per_entry as usize) * i,
)
.unwrap();
let end = start + (offset_per_entry - 1);
let start = Page::<Size4KiB>::containing_address(start);
let start = start.max(range.start);
Expand Down
6 changes: 5 additions & 1 deletion src/structures/paging/mapper/recursive_page_table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -891,7 +891,11 @@ impl<'a> CleanUp for RecursivePageTable<'a> {
})
{
if let Ok(frame) = entry.frame() {
let start = table_addr + (offset_per_entry * (i as u64));
let start = VirtAddr::forward_checked_impl(
table_addr,
(offset_per_entry as usize) * i,
)
.unwrap();
let end = start + (offset_per_entry - 1);
let start = Page::<Size4KiB>::containing_address(start);
let start = start.max(range.start);
Expand Down

0 comments on commit a20e690

Please sign in to comment.