[][src]Struct cortex_m::cmse::TestTarget

pub struct TestTarget { /* fields omitted */ }

Abstraction of TT instructions and helper functions to determine the security and privilege attribute of a target address, accessed in different ways.

Implementations

impl TestTarget[src]

pub fn check(addr: *mut u32, access_type: AccessType) -> Self[src]

Creates a Test Target Response Payload by testing addr using access_type.

pub fn check_range(
    addr: *mut u32,
    size: usize,
    access_type: AccessType
) -> Option<Self>
[src]

Creates a Test Target Response Payload by testing the zone from addr to addr + size - 1 using access_type. Returns None if:

  • the address zone overlaps SAU, IDAU or MPU region boundaries
  • size is 0
  • addr + size - 1 overflows

pub fn access_type(self) -> AccessType[src]

Access type that was used for this test target.

pub fn as_u32(self) -> u32[src]

Get the raw u32 value returned by the TT instruction used.

pub fn readable(self) -> bool[src]

Read accessibility of the target address. Only returns the MPU settings without checking the Security state of the target. For Unprivileged and NonSecureUnprivileged access types, returns the permissions for unprivileged access, regardless of whether the current mode is privileged or unprivileged. Returns false if the TT instruction was executed from an unprivileged mode and the NonSecure access type was not specified. Returns false if the address matches multiple MPU regions.

pub fn read_and_writable(self) -> bool[src]

Read and write accessibility of the target address. Only returns the MPU settings without checking the Security state of the target. For Unprivileged and NonSecureUnprivileged access types, returns the permissions for unprivileged access, regardless of whether the current mode is privileged or unprivileged. Returns false if the TT instruction was executed from an unprivileged mode and the NonSecure access type was not specified. Returns false if the address matches multiple MPU regions.

pub fn mpu_region(self) -> Option<u8>[src]

Indicate the MPU region number containing the target address. Returns None if the value is not valid:

  • the MPU is not implemented or MPU_CTRL.ENABLE is set to zero
  • the register argument specified by the MREGION field does not match any enabled MPU regions
  • the address matched multiple MPU regions
  • the address specified by the SREGION field is exempt from the secure memory attribution
  • the TT instruction was executed from an unprivileged mode and the A flag was not specified.

pub fn secure(self) -> bool[src]

Indicates the Security attribute of the target address. Independent of AccessType. Always zero when the test target is done in the Non-Secure state.

pub fn ns_readable(self) -> bool[src]

Non-Secure Read accessibility of the target address. Same as readable() && !secure()

pub fn ns_read_and_writable(self) -> bool[src]

Non-Secure Read and Write accessibility of the target address. Same as read_and_writable() && !secure()

pub fn idau_region(self) -> Option<u8>[src]

Indicate the IDAU region number containing the target address. Independent of AccessType. Returns None if the value is not valid:

  • the IDAU cannot provide a region number
  • the address is exempt from security attribution
  • the test target is done from Non-Secure state

pub fn sau_region(self) -> Option<u8>[src]

Indicate the SAU region number containing the target address. Independent of AccessType. Returns None if the value is not valid:

  • SAU_CTRL.ENABLE is set to zero
  • the register argument specified in the SREGION field does not match any enabled SAU regions
  • the address specified matches multiple enabled SAU regions
  • the address specified by the SREGION field is exempt from the secure memory attribution
  • the TT instruction was executed from the Non-secure state or the Security Extension is not implemented

Trait Implementations

impl Clone for TestTarget[src]

impl Copy for TestTarget[src]

impl Debug for TestTarget[src]

impl PartialEq<TestTarget> for TestTarget[src]

impl StructuralPartialEq for TestTarget[src]

Auto Trait Implementations

impl Send for TestTarget

impl Sync for TestTarget

impl Unpin for TestTarget

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.