feat: kernel/objects/null: add override_cap

This commit is contained in:
Paul Pan 2024-09-03 19:39:08 +08:00
parent 55547d336e
commit 13180fe9f4

View File

@ -14,6 +14,10 @@ impl<'a> NullCap<'a> {
pub fn mint() -> RawCap {
RawCap::new(0, 0, PhysAddr(0), ObjectType::Null)
}
pub fn override_cap(&self, new: RawCap) {
unsafe { self.cte.cap.update(|cap| *cap = new) };
}
}
impl Debug for NullCap<'_> {