From c94871fa4656b7e0549e342fa67e64612e3876ea Mon Sep 17 00:00:00 2001 From: Berkus Decker Date: Thu, 3 Dec 2020 02:32:19 +0200 Subject: [PATCH] [sq] add more untyped accessors --- nucleus/src/arch/aarch64/caps.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/nucleus/src/arch/aarch64/caps.rs b/nucleus/src/arch/aarch64/caps.rs index f7f98cb..3653af5 100644 --- a/nucleus/src/arch/aarch64/caps.rs +++ b/nucleus/src/arch/aarch64/caps.rs @@ -388,7 +388,7 @@ impl UntypedCapability { pub fn is_device(&self) -> bool { self.0.read(UntypedCap::IsDevice) == 1 } - // BlockSize OFFSET(58) NUMBITS(6) [], + pub fn block_size(&self) -> usize { 1 << self.0.read(UntypedCap::BlockSizePower) } @@ -402,7 +402,10 @@ impl UntypedCapability { .unwrap(), ) } - // Ptr OFFSET(80) NUMBITS(48) [] + + pub fn base(&self) -> PhysAddr { + self.0.read(UntypedCap::Ptr) + } // #define MAX_FREE_INDEX(sizeBits) (BIT( (sizeBits) - seL4_MinUntypedBits )) pub fn max_free_index_from_bits(size_bits: usize) -> usize {