Files
k-os/crates/domain/src/error.rs

45 lines
1.3 KiB
Rust

use types::{
bounded::CapSlot,
id::{EndpointId, IrqId, ProcessId, ThreadId},
permission::Permission,
};
#[derive(Debug)]
pub enum KernelError {
InvalidSlot(CapSlot),
RevokedCapability(CapSlot),
PermissionDenied {
slot: CapSlot,
needed: Permission,
},
NoFreeSlot,
InvalidProcess(ProcessId),
WouldBlock,
TooManyThreadsInProcess,
TooManyProcesses,
InvalidStateTransition(ThreadId),
InvalidThread(ThreadId),
TooManyThreads,
OutOfMemory,
InvalidEndpoint(EndpointId),
InvalidIrq(IrqId),
EndpointFull,
ProcessCreateDenied,
IrqAlreadyOwned(IrqId),
/// Address outside the user window, unaligned, or not owned by the caller.
InvalidAddress,
/// The target virtual range already holds a mapping.
AddressInUse,
InvalidRegion,
/// The region is mapped executable somewhere and the request would map
/// it writable, or the other way round (W^X across processes).
WritableAndExecutable,
/// The object a capability would refer to no longer exists.
NoSuchObject,
/// The capability names the wrong kind of object for this operation.
WrongObject,
/// `Reply` with an empty reply slot, or a call whose reply was dropped.
NoReply,
InvalidArgument,
}