mirror of
https://github.com/asterinas/asterinas.git
synced 2025-06-22 00:43:24 +00:00
Remove the shim kernel crate
This commit is contained in:
committed by
Tate, Hongliang Tian
parent
d76c7a5b1e
commit
dafd16075f
15
kernel/src/syscall/munmap.rs
Normal file
15
kernel/src/syscall/munmap.rs
Normal file
@ -0,0 +1,15 @@
|
||||
// SPDX-License-Identifier: MPL-2.0
|
||||
|
||||
use align_ext::AlignExt;
|
||||
|
||||
use super::SyscallReturn;
|
||||
use crate::prelude::*;
|
||||
|
||||
pub fn sys_munmap(addr: Vaddr, len: usize, ctx: &Context) -> Result<SyscallReturn> {
|
||||
debug!("addr = 0x{:x}, len = {}", addr, len);
|
||||
let root_vmar = ctx.process.root_vmar();
|
||||
let len = len.align_up(PAGE_SIZE);
|
||||
debug!("unmap range = 0x{:x} - 0x{:x}", addr, addr + len);
|
||||
root_vmar.destroy(addr..addr + len)?;
|
||||
Ok(SyscallReturn::Return(0))
|
||||
}
|
Reference in New Issue
Block a user