Rename aster-frame to ostd

This commit is contained in:
Jianfeng Jiang
2024-06-19 08:18:39 +00:00
committed by Tate, Hongliang Tian
parent fb59fa7a55
commit 59350a8578
300 changed files with 425 additions and 427 deletions

30
ostd/src/error.rs Normal file
View 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
}
}