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

type Cap

type CapAddrInt

type CapAddrBits

type CapLen

type OType

type Perms

type Flags

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

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

Loading content...

Implementors

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

Loading content...