memory_set/lib.rs
1#![cfg_attr(not(test), no_std)]
2#![doc = include_str!("../README.md")]
3
4extern crate alloc;
5
6mod area;
7mod backend;
8mod set;
9
10#[cfg(test)]
11mod tests;
12
13pub use self::area::MemoryArea;
14pub use self::backend::MappingBackend;
15pub use self::set::MemorySet;
16
17/// Error type for memory mapping operations.
18#[derive(Debug, Eq, PartialEq)]
19pub enum MappingError {
20 /// Invalid parameter (e.g., `addr`, `size`, `flags`, etc.)
21 InvalidParam,
22 /// The given range overlaps with an existing mapping.
23 AlreadyExists,
24 /// The backend page table is in a bad state.
25 BadState,
26}
27
28/// A [`Result`] type with [`MappingError`] as the error type.
29pub type MappingResult<T = ()> = Result<T, MappingError>;