mirror of
https://github.com/asterinas/asterinas.git
synced 2025-06-25 02:13:24 +00:00
Rename aster-frame to ostd
This commit is contained in:
committed by
Tate, Hongliang Tian
parent
fb59fa7a55
commit
59350a8578
30
ostd/src/error.rs
Normal file
30
ostd/src/error.rs
Normal file
@ -0,0 +1,30 @@
|
||||
// SPDX-License-Identifier: MPL-2.0
|
||||
|
||||
use crate::mm::page_table::PageTableError;
|
||||
|
||||
/// The error type which is returned from the APIs of this crate.
|
||||
#[derive(Clone, Copy, PartialEq, Eq, Debug)]
|
||||
pub enum Error {
|
||||
/// Invalid arguments provided.
|
||||
InvalidArgs,
|
||||
/// Insufficient memory available.
|
||||
NoMemory,
|
||||
/// Page fault occurred.
|
||||
PageFault,
|
||||
/// Access to a resource is denied.
|
||||
AccessDenied,
|
||||
/// Input/output error.
|
||||
IoError,
|
||||
/// Insufficient system resources.
|
||||
NotEnoughResources,
|
||||
/// Arithmetic Overflow occurred.
|
||||
Overflow,
|
||||
/// Memory mapping already exists for the given virtual address.
|
||||
MapAlreadyMappedVaddr,
|
||||
}
|
||||
|
||||
impl From<PageTableError> for Error {
|
||||
fn from(_err: PageTableError) -> Error {
|
||||
Error::AccessDenied
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user