Skip to content
Snippets Groups Projects
Verified Commit f13c84c1 authored by jD91mZM2's avatar jD91mZM2
Browse files

Add comment about why this doesn't work

parent 886b2bf5
No related branches found
No related tags found
No related merge requests found
......@@ -178,6 +178,14 @@ impl Scheme for MemoryScheme {
fn funmap3(&self, flags: usize, address: usize, size: usize) -> Result<usize> {
let flags = u8::try_from(flags).ok().and_then(Flags::from_bits).expect("MemoryScheme::funmap3: bits contained bad flags");
// OH NO!! The `funmap` system call will unmap the grant by default, but
// we haven't necessarily created a grant with fmap, we may very well
// just have given the pointer of a physical region!
//
// This will fail!! Is this "abuse" of fmap bad? Do we keep the phys*
// functions instead? If no, how do we fix this? Do we make each kernel
// scheme responsible for clearing up the grants themselves?
if flags.contains(Flags::MODE_PHYSICAL) {
driver::inner_physfree(address, size)
} else if flags.contains(Flags::MODE_PHYSMAP) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment