Struct cortex_m::cmse::TestTarget

source ·
pub struct TestTarget { /* private fields */ }
Expand description

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

Implementations§

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

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

Access type that was used for this test target.

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

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.

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.

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.

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

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

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

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

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§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
This method tests for self and other values to be equal, and is used by ==.
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.