ostd/
error.rs

1// SPDX-License-Identifier: MPL-2.0
2
3use crate::mm::page_table::PageTableError;
4
5/// The error type which is returned from the APIs of this crate.
6#[derive(Clone, Copy, PartialEq, Eq, Debug)]
7pub enum Error {
8    /// Invalid arguments provided.
9    InvalidArgs,
10    /// Insufficient memory available.
11    NoMemory,
12    /// Page fault occurred.
13    PageFault,
14    /// Access to a resource is denied.
15    AccessDenied,
16    /// Input/output error.
17    IoError,
18    /// Insufficient system resources.
19    NotEnoughResources,
20    /// Arithmetic Overflow occurred.
21    Overflow,
22}
23
24impl From<PageTableError> for Error {
25    fn from(_err: PageTableError) -> Error {
26        Error::AccessDenied
27    }
28}