Refactor Vmar and VmMapping.

Co-authored-by: Zhang Junyang <junyang@stu.pku.edu.cn>
This commit is contained in:
Wang Siyuan
2024-11-09 01:44:11 +00:00
committed by Tate, Hongliang Tian
parent e453649d78
commit 4ea3e49788
12 changed files with 782 additions and 1272 deletions

View File

@ -70,7 +70,7 @@ pub use pager::Pager;
/// Compared with `Frame`,
/// `Vmo` is easier to use (by offering more powerful APIs) and
/// harder to misuse (thanks to its nature of being capability).
///
#[derive(Debug)]
pub struct Vmo<R = Rights>(pub(super) Arc<Vmo_>, R);
/// Functions exist both for static capbility and dynamic capability
@ -176,6 +176,15 @@ pub(super) struct Vmo_ {
pages: Pages,
}
impl Debug for Vmo_ {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
f.debug_struct("Vmo_")
.field("flags", &self.flags)
.field("size", &self.size())
.finish()
}
}
bitflags! {
/// Commit Flags.
pub struct CommitFlags: u8 {