fix: add missing bound for KernelObject

This commit is contained in:
Paul Pan 2024-03-20 21:18:32 +08:00
parent ee6166c657
commit dd5325db2a
2 changed files with 5 additions and 2 deletions

View File

@ -1,4 +1,4 @@
#[derive(Clone, Copy, FromPrimitive, ToPrimitive)]
#[derive(Clone, Copy, Eq, PartialEq, FromPrimitive, ToPrimitive)]
pub enum ObjectType {
Null = 0,
CNode = 1,

View File

@ -6,10 +6,13 @@ use core::marker::PhantomData;
/// NullObject is used as empty (capability) slot
pub struct NullObject {}
pub type NullCap<'a> = Cap<'a, NullObject>;
impl KernelObject for NullObject {
const OBJ_TYPE: ObjectType = ObjectType::Null;
}
impl<'a> NullCap<'a> {
pub fn mint() -> RawCap {
let mut cap = RawCap::new(0, 0, ObjectType::Null);
let cap = RawCap::new(0, 0, ObjectType::Null);
cap
}