Skip to content

Commit

Permalink
mm: bugfix #133: MapArea::copy_data does not need &mut PageTable
Browse files Browse the repository at this point in the history
  • Loading branch information
wyfcyx committed Jun 30, 2024
1 parent de0d739 commit f3917fd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions os/src/mm/memory_set.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ impl MemorySet {
fn push(&mut self, mut map_area: MapArea, data: Option<&[u8]>) {
map_area.map(&mut self.page_table);
if let Some(data) = data {
map_area.copy_data(&mut self.page_table, data);
map_area.copy_data(&self.page_table, data);
}
self.areas.push(map_area);
}
Expand Down Expand Up @@ -341,7 +341,7 @@ impl MapArea {
}
/// data: start-aligned but maybe with shorter length
/// assume that all frames were cleared before
pub fn copy_data(&mut self, page_table: &mut PageTable, data: &[u8]) {
pub fn copy_data(&mut self, page_table: &PageTable, data: &[u8]) {
assert_eq!(self.map_type, MapType::Framed);
let mut start: usize = 0;
let mut current_vpn = self.vpn_range.get_start();
Expand Down

0 comments on commit f3917fd

Please sign in to comment.