mm: bugfix #133: MapArea::copy_data does not need &mut PageTable
This commit is contained in:
parent
60483378d7
commit
9c3a12a342
1 changed files with 2 additions and 2 deletions
|
@ -77,7 +77,7 @@ impl MemorySet {
|
||||||
pub fn push(&mut self, mut map_area: MapArea, data: Option<&[u8]>) {
|
pub fn push(&mut self, mut map_area: MapArea, data: Option<&[u8]>) {
|
||||||
map_area.map(&mut self.page_table);
|
map_area.map(&mut self.page_table);
|
||||||
if let Some(data) = data {
|
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);
|
self.areas.push(map_area);
|
||||||
}
|
}
|
||||||
|
@ -316,7 +316,7 @@ impl MapArea {
|
||||||
}
|
}
|
||||||
/// data: start-aligned but maybe with shorter length
|
/// data: start-aligned but maybe with shorter length
|
||||||
/// assume that all frames were cleared before
|
/// 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);
|
assert_eq!(self.map_type, MapType::Framed);
|
||||||
let mut start: usize = 0;
|
let mut start: usize = 0;
|
||||||
let mut current_vpn = self.vpn_range.get_start();
|
let mut current_vpn = self.vpn_range.get_start();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue