mirror of
https://github.com/asterinas/asterinas.git
synced 2025-06-23 01:13:23 +00:00
Set the access bit when mapping a frame to the page table in userspace
This commit is contained in:
committed by
Tate, Hongliang Tian
parent
2d6da11d92
commit
e555d8c616
@ -306,10 +306,12 @@ impl CursorMut<'_> {
|
|||||||
/// Map a frame into the current slot.
|
/// Map a frame into the current slot.
|
||||||
///
|
///
|
||||||
/// This method will bring the cursor to the next slot after the modification.
|
/// This method will bring the cursor to the next slot after the modification.
|
||||||
pub fn map(&mut self, frame: Frame, prop: PageProperty) {
|
pub fn map(&mut self, frame: Frame, mut prop: PageProperty) {
|
||||||
let start_va = self.virt_addr();
|
let start_va = self.virt_addr();
|
||||||
let end_va = start_va + frame.size();
|
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.
|
// SAFETY: It is safe to map untyped memory into the userspace.
|
||||||
unsafe {
|
unsafe {
|
||||||
self.0.map(frame.into(), prop);
|
self.0.map(frame.into(), prop);
|
||||||
|
Reference in New Issue
Block a user