use crate::memory::virtual_address::VirtualAddress;
use std::{ops::Range, path::PathBuf};
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub struct MemoryProtection {
pub read: bool,
pub write: bool,
pub execute: bool,
}
impl MemoryProtection {
pub fn new(read: bool, write: bool, execute: bool) -> Self {
Self {
read,
write,
execute,
}
}
}
#[derive(Debug, Clone)]
pub struct FileBacking {
pub path: PathBuf,
pub offset: u64,
}
#[derive(Debug, Clone)]
pub struct MemoryMapping {
pub virtual_address: VirtualAddress,
pub task: VirtualAddress,
pub region: Range<VirtualAddress>,
pub protection: MemoryProtection,
pub shared: bool,
pub file_backing: Option<FileBacking>,
}