Switch Context::grants to RwLock

This commit is contained in:
Jeremy Soller
2021-02-13 13:06:13 -07:00
parent 2611985a38
commit c19bd573b5
7 changed files with 18 additions and 18 deletions
+2 -2
View File
@@ -126,7 +126,7 @@ impl UserInner {
let mut new_table = unsafe { InactivePageTable::from_address(context.arch.get_page_table()) };
let mut temporary_page = TemporaryPage::new(Page::containing_address(VirtualAddress::new(crate::USER_TMP_GRANT_OFFSET)));
let mut grants = context.grants.lock();
let mut grants = context.grants.write();
let from_address = round_down_pages(address);
let offset = address - from_address;
@@ -157,7 +157,7 @@ impl UserInner {
let mut new_table = unsafe { InactivePageTable::from_address(context.arch.get_page_table()) };
let mut temporary_page = TemporaryPage::new(Page::containing_address(VirtualAddress::new(crate::USER_TMP_GRANT_OFFSET)));
let mut grants = context.grants.lock();
let mut grants = context.grants.write();
if let Some(region) = grants.contains(VirtualAddress::new(address)).map(Region::from) {
grants.take(&region).unwrap().unmap_inactive(&mut new_table, &mut temporary_page);