Store funmap data with the context's grants

This commit is contained in:
Jeremy Soller
2021-08-10 20:46:30 -06:00
parent f94dc3beb8
commit 0c3542ff51
2 changed files with 25 additions and 6 deletions
+4 -1
View File
@@ -1,4 +1,4 @@
use alloc::collections::{BTreeSet, VecDeque};
use alloc::collections::{BTreeMap, BTreeSet, VecDeque};
use alloc::sync::{Arc, Weak};
use core::borrow::Borrow;
use core::cmp::{self, Eq, Ordering, PartialEq, PartialOrd};
@@ -39,7 +39,10 @@ pub fn page_flags(flags: MapFlags) -> PageFlags<RmmA> {
#[derive(Debug, Default)]
pub struct UserGrants {
pub inner: BTreeSet<Grant>,
//TODO: technically VirtualAddress is from a scheme's context!
pub funmap: BTreeMap<Region, VirtualAddress>,
}
impl UserGrants {
/// Returns the grant, if any, which occupies the specified address
pub fn contains(&self, address: VirtualAddress) -> Option<&Grant> {