diff --git a/src/kxos-std/src/vm/vmar/static_cap.rs b/src/kxos-std/src/vm/vmar/static_cap.rs index 6d3b9045..9c3adfdd 100644 --- a/src/kxos-std/src/vm/vmar/static_cap.rs +++ b/src/kxos-std/src/vm/vmar/static_cap.rs @@ -5,7 +5,10 @@ use kxos_frame::prelude::Result; use kxos_frame::{vm::VmIo, Error}; use kxos_rights_proc::require; -use crate::{rights::*, vm::vmo::Vmo}; +use crate::{ + rights::{Dup, Read, Rights, TRights}, + vm::vmo::Vmo, +}; use super::{ options::{VmarChildOptions, VmarMapOptions}, @@ -163,12 +166,12 @@ impl Vmar { impl VmIo for Vmar { fn read_bytes(&self, offset: usize, buf: &mut [u8]) -> Result<()> { - // self.check_rights!(Rights::READ)?; + self.check_rights(Rights::READ)?; self.0.read(offset, buf) } fn write_bytes(&self, offset: usize, buf: &[u8]) -> Result<()> { - // self.check_rights!(Rights::WRITE)?; + self.check_rights(Rights::WRITE)?; self.0.write(offset, buf) } } diff --git a/src/kxos-std/src/vm/vmo/options.rs b/src/kxos-std/src/vm/vmo/options.rs index 7e534918..cad075ab 100644 --- a/src/kxos-std/src/vm/vmo/options.rs +++ b/src/kxos-std/src/vm/vmo/options.rs @@ -313,12 +313,13 @@ impl VmoChildOptions { /// /// The child VMO is initially assigned all the parent's access rights /// plus the Write right. - pub fn alloc(mut self) -> Result> -// TODO: R1 must contain the Write right. To do so at the type level, - // we need to implement a type-level operator - // (say, `TRightsExtend(L, F)`) - // that may extend a list (`L`) of type-level flags with an extra flag `F`. - // TRightsExtend + pub fn alloc(mut self) -> Result> + where + R1: TRights, // TODO: R1 must contain the Write right. To do so at the type level, + // we need to implement a type-level operator + // (say, `TRightsExtend(L, F)`) + // that may extend a list (`L`) of type-level flags with an extra flag `F`. + // TRightsExtend { todo!() }