Add debug entry for fmap2

This commit is contained in:
jD91mZM2
2020-07-18 13:40:12 +02:00
parent 310a425c65
commit 2d63009ba4
2 changed files with 12 additions and 3 deletions

View File

@@ -50,8 +50,9 @@ impl Scheme for MemoryScheme {
let mut to_address = if map.address == 0 { crate::USER_GRANT_OFFSET } else {
if // map.address < crate::USER_GRANT_OFFSET || map.address + map.size > crate::USER_GRANT_OFFSET + crate::PML4_SIZE ||
map.address % PAGE_SIZE != 0 {
return Err(Error::new(EINVAL));
map.address % PAGE_SIZE != 0
{
return Err(Error::new(EINVAL));
}
map.address
};

View File

@@ -2,7 +2,7 @@ use core::{ascii, mem};
use alloc::string::String;
use alloc::vec::Vec;
use super::data::{Map, Stat, TimeSpec};
use super::data::{Map, Map2, Stat, TimeSpec};
use super::flag::*;
use super::number::*;
use super::validate::*;
@@ -114,6 +114,14 @@ pub fn format_call(a: usize, b: usize, c: usize, d: usize, e: usize, f: usize) -
d/mem::size_of::<Map>()
),
),
SYS_FMAP2 => format!(
"fmap2({}, {:?})",
b,
validate_slice(
c as *const Map2,
d/mem::size_of::<Map2>()
),
),
SYS_FUNMAP => format!(
"funmap({:#X})",
b