Skip to content

Commit

Permalink
book: ch4: MapArea::copy_data does not require &mut PageTable
Browse files Browse the repository at this point in the history
  • Loading branch information
wyfcyx committed Jun 30, 2024
1 parent 188f312 commit d4b93c4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions source/chapter4/5kernel-app-spaces.rst
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@
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 @@ -170,7 +170,7 @@
}
/// 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 d4b93c4

Please sign in to comment.