Trait rsim::CheriRVFuncs [−]
pub trait CheriRVFuncs<T> where
T: CompressedCapability, { type Cap; type CapAddrInt; type CapAddrBits; type CapLen; type OType; type Perms; type Flags;}Show methods
pub fn getCapBounds(c: &Self::Cap) -> (Self::CapAddrInt, Self::CapLen); pub fn getCapBaseBits(c: &Self::Cap) -> Self::CapAddrBits; pub fn getCapTop(c: &Self::Cap) -> Self::CapLen; pub fn getCapLength(c: &Self::Cap) -> Self::CapLen; pub fn inCapBounds(
c: &Self::Cap,
addr: Self::CapAddrBits,
size: Self::CapLen
) -> bool; pub fn getCapCursor(c: &Self::Cap) -> Self::CapAddrInt; pub fn getCapOffsetBits(c: &Self::Cap) -> Self::CapAddrBits; pub fn setCapBounds(
c: &Self::Cap,
base: Self::CapAddrBits,
top: Self::CapLen
) -> (bool, Self::Cap); pub fn setCapAddr(
c: &Self::Cap,
addr: Self::CapAddrBits
) -> (bool, Self::Cap); pub fn setCapOffset(
c: &Self::Cap,
offset: Self::CapAddrBits
) -> (bool, Self::Cap); pub fn incCapOffset(
c: &Self::Cap,
offset_inc: Self::CapAddrBits
) -> (bool, Self::Cap); pub fn getRepresentableAlignmentMask(val: Self::CapLen) -> Self::CapLen; pub fn getRepresentableLength(val: Self::CapLen) -> Self::CapLen; pub fn sealCap(c: &Self::Cap, otype: Self::OType) -> Self::Cap; pub fn unsealCap(c: &Self::Cap) -> Self::Cap; pub fn isCapSealed(c: &Self::Cap) -> bool; pub fn hasReservedOType(c: &Self::Cap) -> bool; pub fn invalidateCap(c: &Self::Cap) -> Self::Cap; pub fn getCapPerms(c: &Self::Cap) -> Self::Perms; pub fn setCapPerms(c: &Self::Cap, perms: Self::Perms) -> Self::Cap; pub fn getCapFlags(c: &Self::Cap) -> Self::Flags; pub fn setCapFlags(c: &Self::Cap, flags: Self::Flags) -> Self::Cap;
Publically exposed CHERI-related structures. All pulled from [rust_cheri_compressed_cap]. Trait exposing the utility functions used to specify CHERI-RISC-V behaviour in Tech Report 951. Behaviour is derived from the Sail specification
Associated Types
Loading content...Required methods
pub fn getCapBounds(c: &Self::Cap) -> (Self::CapAddrInt, Self::CapLen)
pub fn getCapBaseBits(c: &Self::Cap) -> Self::CapAddrBits
pub fn getCapTop(c: &Self::Cap) -> Self::CapLen
pub fn getCapLength(c: &Self::Cap) -> Self::CapLen
pub fn inCapBounds(
c: &Self::Cap,
addr: Self::CapAddrBits,
size: Self::CapLen
) -> bool
c: &Self::Cap,
addr: Self::CapAddrBits,
size: Self::CapLen
) -> bool
pub fn getCapCursor(c: &Self::Cap) -> Self::CapAddrInt
pub fn getCapOffsetBits(c: &Self::Cap) -> Self::CapAddrBits
pub fn setCapBounds(
c: &Self::Cap,
base: Self::CapAddrBits,
top: Self::CapLen
) -> (bool, Self::Cap)
c: &Self::Cap,
base: Self::CapAddrBits,
top: Self::CapLen
) -> (bool, Self::Cap)
pub fn setCapAddr(c: &Self::Cap, addr: Self::CapAddrBits) -> (bool, Self::Cap)
pub fn setCapOffset(
c: &Self::Cap,
offset: Self::CapAddrBits
) -> (bool, Self::Cap)
c: &Self::Cap,
offset: Self::CapAddrBits
) -> (bool, Self::Cap)
pub fn incCapOffset(
c: &Self::Cap,
offset_inc: Self::CapAddrBits
) -> (bool, Self::Cap)
c: &Self::Cap,
offset_inc: Self::CapAddrBits
) -> (bool, Self::Cap)
pub fn getRepresentableAlignmentMask(val: Self::CapLen) -> Self::CapLen
pub fn getRepresentableLength(val: Self::CapLen) -> Self::CapLen
pub fn sealCap(c: &Self::Cap, otype: Self::OType) -> Self::Cap
pub fn unsealCap(c: &Self::Cap) -> Self::Cap
pub fn isCapSealed(c: &Self::Cap) -> bool
pub fn hasReservedOType(c: &Self::Cap) -> bool
pub fn invalidateCap(c: &Self::Cap) -> Self::Cap
pub fn getCapPerms(c: &Self::Cap) -> Self::Perms
pub fn setCapPerms(c: &Self::Cap, perms: Self::Perms) -> Self::Cap
pub fn getCapFlags(c: &Self::Cap) -> Self::Flags
pub fn setCapFlags(c: &Self::Cap, flags: Self::Flags) -> Self::Cap
Implementors
impl<T> CheriRVFuncs<T> for T where
T: CompressedCapability,
<T as CompressedCapability>::Offset: TryInto<<T as CompressedCapability>::Addr>,
impl<T> CheriRVFuncs<T> for T where
T: CompressedCapability,
<T as CompressedCapability>::Offset: TryInto<<T as CompressedCapability>::Addr>,
type Cap = CcxCap<T>
type CapAddrInt = <T as CompressedCapability>::Addr
type CapAddrBits = <T as CompressedCapability>::Addr
type CapLen = <T as CompressedCapability>::Length
type OType = u32
type Perms = u32
type Flags = u8
pub fn getCapBounds(
c: &<T as CheriRVFuncs<T>>::Cap
) -> (<T as CheriRVFuncs<T>>::CapAddrInt, <T as CheriRVFuncs<T>>::CapLen)
c: &<T as CheriRVFuncs<T>>::Cap
) -> (<T as CheriRVFuncs<T>>::CapAddrInt, <T as CheriRVFuncs<T>>::CapLen)
pub fn getCapBaseBits(
c: &<T as CheriRVFuncs<T>>::Cap
) -> <T as CheriRVFuncs<T>>::CapAddrBits
c: &<T as CheriRVFuncs<T>>::Cap
) -> <T as CheriRVFuncs<T>>::CapAddrBits
pub fn getCapTop(
c: &<T as CheriRVFuncs<T>>::Cap
) -> <T as CheriRVFuncs<T>>::CapLen
c: &<T as CheriRVFuncs<T>>::Cap
) -> <T as CheriRVFuncs<T>>::CapLen
pub fn getCapLength(
c: &<T as CheriRVFuncs<T>>::Cap
) -> <T as CheriRVFuncs<T>>::CapLen
c: &<T as CheriRVFuncs<T>>::Cap
) -> <T as CheriRVFuncs<T>>::CapLen
pub fn inCapBounds(
c: &<T as CheriRVFuncs<T>>::Cap,
addr: <T as CheriRVFuncs<T>>::CapAddrBits,
size: <T as CheriRVFuncs<T>>::CapLen
) -> bool
c: &<T as CheriRVFuncs<T>>::Cap,
addr: <T as CheriRVFuncs<T>>::CapAddrBits,
size: <T as CheriRVFuncs<T>>::CapLen
) -> bool
pub fn getCapCursor(
c: &<T as CheriRVFuncs<T>>::Cap
) -> <T as CheriRVFuncs<T>>::CapAddrInt
c: &<T as CheriRVFuncs<T>>::Cap
) -> <T as CheriRVFuncs<T>>::CapAddrInt
pub fn getCapOffsetBits(
c: &<T as CheriRVFuncs<T>>::Cap
) -> <T as CheriRVFuncs<T>>::CapAddrBits
c: &<T as CheriRVFuncs<T>>::Cap
) -> <T as CheriRVFuncs<T>>::CapAddrBits
pub fn setCapBounds(
c: &<T as CheriRVFuncs<T>>::Cap,
base: <T as CheriRVFuncs<T>>::CapAddrBits,
top: <T as CheriRVFuncs<T>>::CapLen
) -> (bool, <T as CheriRVFuncs<T>>::Cap)
c: &<T as CheriRVFuncs<T>>::Cap,
base: <T as CheriRVFuncs<T>>::CapAddrBits,
top: <T as CheriRVFuncs<T>>::CapLen
) -> (bool, <T as CheriRVFuncs<T>>::Cap)
pub fn setCapAddr(
c: &<T as CheriRVFuncs<T>>::Cap,
addr: <T as CheriRVFuncs<T>>::CapAddrBits
) -> (bool, <T as CheriRVFuncs<T>>::Cap)
c: &<T as CheriRVFuncs<T>>::Cap,
addr: <T as CheriRVFuncs<T>>::CapAddrBits
) -> (bool, <T as CheriRVFuncs<T>>::Cap)
pub fn setCapOffset(
c: &<T as CheriRVFuncs<T>>::Cap,
offset: <T as CheriRVFuncs<T>>::CapAddrBits
) -> (bool, <T as CheriRVFuncs<T>>::Cap)
c: &<T as CheriRVFuncs<T>>::Cap,
offset: <T as CheriRVFuncs<T>>::CapAddrBits
) -> (bool, <T as CheriRVFuncs<T>>::Cap)
pub fn incCapOffset(
c: &<T as CheriRVFuncs<T>>::Cap,
offset_inc: <T as CheriRVFuncs<T>>::CapAddrBits
) -> (bool, <T as CheriRVFuncs<T>>::Cap)
c: &<T as CheriRVFuncs<T>>::Cap,
offset_inc: <T as CheriRVFuncs<T>>::CapAddrBits
) -> (bool, <T as CheriRVFuncs<T>>::Cap)
pub fn getRepresentableAlignmentMask(
val: <T as CheriRVFuncs<T>>::CapLen
) -> <T as CheriRVFuncs<T>>::CapLen
val: <T as CheriRVFuncs<T>>::CapLen
) -> <T as CheriRVFuncs<T>>::CapLen
pub fn getRepresentableLength(
val: <T as CheriRVFuncs<T>>::CapLen
) -> <T as CheriRVFuncs<T>>::CapLen
val: <T as CheriRVFuncs<T>>::CapLen
) -> <T as CheriRVFuncs<T>>::CapLen
pub fn sealCap(
c: &<T as CheriRVFuncs<T>>::Cap,
otype: <T as CheriRVFuncs<T>>::OType
) -> <T as CheriRVFuncs<T>>::Cap
c: &<T as CheriRVFuncs<T>>::Cap,
otype: <T as CheriRVFuncs<T>>::OType
) -> <T as CheriRVFuncs<T>>::Cap
pub fn unsealCap(c: &<T as CheriRVFuncs<T>>::Cap) -> <T as CheriRVFuncs<T>>::Cap
pub fn isCapSealed(c: &<T as CheriRVFuncs<T>>::Cap) -> bool
pub fn hasReservedOType(c: &<T as CheriRVFuncs<T>>::Cap) -> bool
pub fn invalidateCap(
c: &<T as CheriRVFuncs<T>>::Cap
) -> <T as CheriRVFuncs<T>>::Cap
c: &<T as CheriRVFuncs<T>>::Cap
) -> <T as CheriRVFuncs<T>>::Cap
pub fn getCapPerms(
c: &<T as CheriRVFuncs<T>>::Cap
) -> <T as CheriRVFuncs<T>>::Perms
c: &<T as CheriRVFuncs<T>>::Cap
) -> <T as CheriRVFuncs<T>>::Perms
pub fn setCapPerms(
c: &<T as CheriRVFuncs<T>>::Cap,
perms: <T as CheriRVFuncs<T>>::Perms
) -> <T as CheriRVFuncs<T>>::Cap
c: &<T as CheriRVFuncs<T>>::Cap,
perms: <T as CheriRVFuncs<T>>::Perms
) -> <T as CheriRVFuncs<T>>::Cap
pub fn getCapFlags(
c: &<T as CheriRVFuncs<T>>::Cap
) -> <T as CheriRVFuncs<T>>::Flags
c: &<T as CheriRVFuncs<T>>::Cap
) -> <T as CheriRVFuncs<T>>::Flags
pub fn setCapFlags(
c: &<T as CheriRVFuncs<T>>::Cap,
flags: <T as CheriRVFuncs<T>>::Flags
) -> <T as CheriRVFuncs<T>>::Cap
c: &<T as CheriRVFuncs<T>>::Cap,
flags: <T as CheriRVFuncs<T>>::Flags
) -> <T as CheriRVFuncs<T>>::Cap