mirror of
https://github.com/panpaul/tiny_os
synced 2024-09-20 09:45:19 +08:00
fix: add missing bound for KernelObject
This commit is contained in:
parent
ee6166c657
commit
dd5325db2a
@ -1,4 +1,4 @@
|
||||
#[derive(Clone, Copy, FromPrimitive, ToPrimitive)]
|
||||
#[derive(Clone, Copy, Eq, PartialEq, FromPrimitive, ToPrimitive)]
|
||||
pub enum ObjectType {
|
||||
Null = 0,
|
||||
CNode = 1,
|
||||
|
@ -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
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user