diff --git a/crates/examples/root-task/example-root-task-without-runtime/src/main.rs b/crates/examples/root-task/example-root-task-without-runtime/src/main.rs index 685584bc2..ae58ee3b9 100644 --- a/crates/examples/root-task/example-root-task-without-runtime/src/main.rs +++ b/crates/examples/root-task/example-root-task-without-runtime/src/main.rs @@ -46,9 +46,9 @@ fn main(bootinfo: &sel4::BootInfoPtr) -> sel4::Result { cnode .with(&mut ipc_buffer) - .relative(badged_notification_slot.cptr()) + .absolute_cptr(badged_notification_slot.cptr()) .mint( - &cnode.relative(unbadged_notification_slot.cptr()), + &cnode.absolute_cptr(unbadged_notification_slot.cptr()), sel4::CapRights::write_only(), badge, )?; diff --git a/crates/examples/root-task/example-root-task/src/main.rs b/crates/examples/root-task/example-root-task/src/main.rs index f9a6b8cd7..ddf0ca970 100644 --- a/crates/examples/root-task/example-root-task/src/main.rs +++ b/crates/examples/root-task/example-root-task/src/main.rs @@ -41,8 +41,8 @@ fn main(bootinfo: &sel4::BootInfoPtr) -> sel4::Result { let badge = 0x1337; - cnode.relative(badged_notification_slot.cptr()).mint( - &cnode.relative(unbadged_notification_slot.cptr()), + cnode.absolute_cptr(badged_notification_slot.cptr()).mint( + &cnode.absolute_cptr(unbadged_notification_slot.cptr()), sel4::CapRights::write_only(), badge, )?; diff --git a/crates/examples/root-task/serial-device/src/main.rs b/crates/examples/root-task/serial-device/src/main.rs index 4d6b59549..5726d094b 100644 --- a/crates/examples/root-task/serial-device/src/main.rs +++ b/crates/examples/root-task/serial-device/src/main.rs @@ -41,7 +41,7 @@ fn main(bootinfo: &sel4::BootInfoPtr) -> sel4::Result { SERIAL_DEVICE_IRQ.try_into().unwrap(), &sel4::init_thread::slot::CNODE .cap() - .relative(irq_handler_cap), + .absolute_cptr(irq_handler_cap), ) .unwrap(); @@ -165,10 +165,10 @@ fn trim_untyped( ) { let rel_a = sel4::init_thread::slot::CNODE .cap() - .relative(free_slot_a.cptr()); + .absolute_cptr(free_slot_a.cptr()); let rel_b = sel4::init_thread::slot::CNODE .cap() - .relative(free_slot_b.cptr()); + .absolute_cptr(free_slot_b.cptr()); let mut cur_paddr = ut_paddr; while cur_paddr != target_paddr { let size_bits = (target_paddr - cur_paddr).ilog2().try_into().unwrap(); diff --git a/crates/examples/root-task/spawn-task/src/main.rs b/crates/examples/root-task/spawn-task/src/main.rs index 010c67116..12dec4837 100644 --- a/crates/examples/root-task/spawn-task/src/main.rs +++ b/crates/examples/root-task/spawn-task/src/main.rs @@ -53,7 +53,7 @@ fn main(bootinfo: &sel4::BootInfoPtr) -> sel4::Result { .mint( &sel4::init_thread::slot::CNODE .cap() - .relative(inter_task_nfn), + .absolute_cptr(inter_task_nfn), sel4::CapRights::write_only(), 0, ) @@ -75,7 +75,9 @@ fn main(bootinfo: &sel4::BootInfoPtr) -> sel4::Result { child_cnode .absolute_cptr_from_bits_with_depth(2, child_cnode_size_bits) .mint( - &sel4::init_thread::slot::CNODE.cap().relative(child_tcb), + &sel4::init_thread::slot::CNODE + .cap() + .absolute_cptr(child_tcb), sel4::CapRights::all(), 0, ) diff --git a/crates/sel4-capdl-initializer/core/src/lib.rs b/crates/sel4-capdl-initializer/core/src/lib.rs index 44e9ac283..3c34ec6aa 100644 --- a/crates/sel4-capdl-initializer/core/src/lib.rs +++ b/crates/sel4-capdl-initializer/core/src/lib.rs @@ -673,9 +673,9 @@ impl<'a, N: ObjectName, D: Content, M: GetEmbeddedFrame, B: BorrowMut<[PerObject if badge == 0 && rights == CapRights::all() { orig } else { - let src = init_thread::slot::CNODE.cap().relative(orig); + let src = init_thread::slot::CNODE.cap().absolute_cptr(orig); let new = self.cslot_alloc_or_panic().cap(); - let dst = init_thread::slot::CNODE.cap().relative(new); + let dst = init_thread::slot::CNODE.cap().absolute_cptr(new); dst.mint(&src, rights, badge)?; new.cast() } @@ -757,7 +757,7 @@ impl<'a, N: ObjectName, D: Content, M: GetEmbeddedFrame, B: BorrowMut<[PerObject let rights = cap.rights().map(From::from).unwrap_or(CapRights::all()); let src = init_thread::slot::CNODE .cap() - .relative(self.orig_cap::(cap.obj())); + .absolute_cptr(self.orig_cap::(cap.obj())); let dst = cnode .absolute_cptr_from_bits_with_depth((*i).try_into().unwrap(), obj.size_bits); match badge { @@ -784,7 +784,7 @@ impl<'a, N: ObjectName, D: Content, M: GetEmbeddedFrame, B: BorrowMut<[PerObject fn copy(&mut self, cap: sel4::Cap) -> Result> { let slot = self.cslot_alloc_or_panic(); - let src = init_thread::slot::CNODE.cap().relative(cap); + let src = init_thread::slot::CNODE.cap().absolute_cptr(cap); cslot_to_relative_cptr(slot).copy(&src, CapRights::all())?; Ok(slot.cap().downcast()) } @@ -823,7 +823,7 @@ impl<'a, N: ObjectName, D: Content, M: GetEmbeddedFrame, B: BorrowMut<[PerObject } fn cslot_to_relative_cptr(slot: Slot) -> sel4::AbsoluteCPtr { - init_thread::slot::CNODE.cap().relative(slot.cptr()) + init_thread::slot::CNODE.cap().absolute_cptr(slot.cptr()) } fn init_thread_cnode_relative_cptr() -> sel4::AbsoluteCPtr { diff --git a/crates/sel4/src/cptr.rs b/crates/sel4/src/cptr.rs index 8bd10f1a8..f1c263ac9 100644 --- a/crates/sel4/src/cptr.rs +++ b/crates/sel4/src/cptr.rs @@ -390,7 +390,7 @@ impl HasCPtrWithDepth for CPtrWithDepth { } impl CNode { - pub fn relative(self, path: T) -> AbsoluteCPtr { + pub fn absolute_cptr(self, path: T) -> AbsoluteCPtr { AbsoluteCPtr { root: self, path: path.cptr_with_depth(), @@ -402,10 +402,10 @@ impl CNode { bits: CPtrBits, depth: usize, ) -> AbsoluteCPtr { - self.relative(CPtrWithDepth::from_bits_with_depth(bits, depth)) + self.absolute_cptr(CPtrWithDepth::from_bits_with_depth(bits, depth)) } pub fn absolute_cptr_for_self(self) -> AbsoluteCPtr { - self.relative(CPtrWithDepth::empty()) + self.absolute_cptr(CPtrWithDepth::empty()) } }