Set right A/D bits at the right place

This commit is contained in:
Zhang Junyang
2024-09-01 12:20:15 +08:00
committed by Tate, Hongliang Tian
parent 4e9460593d
commit f13e5d12c1
2 changed files with 15 additions and 9 deletions

View File

@ -348,12 +348,9 @@ impl CursorMut<'_, '_> {
/// Map a frame into the current slot.
///
/// This method will bring the cursor to the next slot after the modification.
pub fn map(&mut self, frame: Frame, mut prop: PageProperty) {
pub fn map(&mut self, frame: Frame, prop: PageProperty) {
let start_va = self.virt_addr();
let end_va = start_va + frame.size();
// TODO: this is a temporary fix to avoid the overhead of setting ACCESSED bit in userspace.
// When this bit is truly enabled, it needs to be set at a more appropriate location.
prop.flags |= PageFlags::ACCESSED;
// SAFETY: It is safe to map untyped memory into the userspace.
let old = unsafe { self.pt_cursor.map(frame.into(), prop) };