![]() |
CMSIS-Core (Cortex-M)
Version 5.3.0
CMSIS-Core support for Cortex-M processor-based devices
|
Functions that generate specific Cortex-M CPU Instructions. More...
Functions | |
void | __NOP (void) |
No Operation. More... | |
void | __WFI (void) |
Wait For Interrupt. More... | |
void | __WFE (void) |
Wait For Event. More... | |
void | __SEV (void) |
Send Event. More... | |
void | __BKPT (uint8_t value) |
Set Breakpoint. More... | |
void | __ISB (void) |
Instruction Synchronization Barrier. More... | |
void | __DSB (void) |
Data Synchronization Barrier. More... | |
void | __DMB (void) |
Data Memory Barrier. More... | |
uint32_t | __REV (uint32_t value) |
Reverse byte order (32 bit) More... | |
uint32_t | __REV16 (uint32_t value) |
Reverse byte order (16 bit) More... | |
int16_t | __REVSH (int16_t value) |
Reverse byte order (16 bit) More... | |
uint32_t | __RBIT (uint32_t value) |
Reverse bit order of value. More... | |
uint32_t | __ROR (uint32_t value, uint32_t shift) |
Rotate a value right by a number of bits. More... | |
uint8_t | __LDREXB (volatile uint8_t *addr) |
LDR Exclusive (8 bit) [not for Cortex-M0, Cortex-M0+, or SC000]. More... | |
uint16_t | __LDREXH (volatile uint16_t *addr) |
LDR Exclusive (16 bit) [not for Cortex-M0, Cortex-M0+, or SC000]. More... | |
uint32_t | __LDREXW (volatile uint32_t *addr) |
LDR Exclusive (32 bit) [not for Cortex-M0, Cortex-M0+, or SC000]. More... | |
uint32_t | __STREXB (uint8_t value, volatile uint8_t *addr) |
STR Exclusive (8 bit) [not for Cortex-M0, Cortex-M0+, or SC000]. More... | |
uint32_t | __STREXH (uint16_t value, volatile uint16_t *addr) |
STR Exclusive (16 bit) [not for Cortex-M0, Cortex-M0+, or SC000]. More... | |
uint32_t | __STREXW (uint32_t value, volatile uint32_t *addr) |
STR Exclusive (32 bit) [not for Cortex-M0, Cortex-M0+, or SC000]. More... | |
void | __CLREX (void) |
Remove the exclusive lock [not for Cortex-M0, Cortex-M0+, or SC000]. More... | |
int32_t | __SSAT (int32_t value, uint32_t sat) |
Signed Saturate [not for Cortex-M0, Cortex-M0+, or SC000]. More... | |
uint32_t | __USAT (uint32_t value, uint32_t sat) |
Unsigned Saturate [not for Cortex-M0, Cortex-M0+, or SC000]. More... | |
uint8_t | __CLZ (uint32_t value) |
Count leading zeros. More... | |
uint32_t | __RRX (uint32_t value) |
Rotate Right with Extend (32 bit) More... | |
uint8_t | __LDRBT (uint8_t ptr) |
LDRT Unprivileged (8 bit) More... | |
uint16_t | __LDRHT (uint16_t ptr) |
LDRT Unprivileged (16 bit) More... | |
uint32_t | __LDRT (uint32_t ptr) |
LDRT Unprivileged (32 bit) More... | |
void | __STRBT (uint8_t value, uint8_t ptr) |
STRT Unprivileged (8 bit) More... | |
void | __STRHT (uint16_t value, uint16_t ptr) |
STRT Unprivileged (16 bit) More... | |
void | __STRT (uint32_t value, uint32_t ptr) |
STRT Unprivileged (32 bit) More... | |
uint8_t | __LDAB (volatile uint8_t *ptr) |
Load-Acquire (8 bit) More... | |
uint16_t | __LDAH (volatile uint16_t *ptr) |
Load-Acquire (16 bit) More... | |
uint32_t | __LDA (volatile uint32_t *ptr) |
Load-Acquire (32 bit) More... | |
void | __STLB (uint8_t value, volatile uint8_t *ptr) |
Store-Release (8 bit) More... | |
void | __STLH (uint16_t value, volatile uint16_t *ptr) |
Store-Release (16 bit) More... | |
void | __STL (uint32_t value, volatile uint32_t *ptr) |
Store-Release (32 bit) More... | |
uint8_t | __LDAEXB (volatile uint32_t *ptr) |
Load-Acquire Exclusive (8 bit) More... | |
uint16_t | __LDAEXH (volatile uint32_t *ptr) |
Load-Acquire Exclusive (16 bit) More... | |
uint32_t | __LDAEX (volatile uint32_t *ptr) |
Load-Acquire Exclusive (32 bit) More... | |
uint32_t | __STLEXB (uint8_t value, volatile uint8_t *ptr) |
Store-Release Exclusive (8 bit) More... | |
uint32_t | __STLEXH (uint16_t value, volatile uint16_t *ptr) |
Store-Release Exclusive (16 bit) More... | |
uint32_t | __STLEX (uint32_t value, volatile uint32_t *ptr) |
Store-Release Exclusive (32 bit) More... | |
The following functions generate specific Cortex-M instructions that cannot be directly accessed by the C/C++ Compiler. Refer to the Cortex-M Reference Manuals for detailed information about these Cortex-M instructions.
void __BKPT | ( | uint8_t | value | ) |
This function causes the processor to enter Debug state. Debug tools can use this to investigate system state when the instruction at a particular address is reached.
[in] | value | is ignored by the processor. If required, a debugger can use it to obtain additional information about the breakpoint. |
void __CLREX | ( | void | ) |
This function removes the exclusive lock which is created by LDREX [not for Cortex-M0, Cortex-M0+, or SC000].
uint8_t __CLZ | ( | uint32_t | value | ) |
This function counts the number of leading zeros of a data value.
On Armv6-M (Cortex-M0, Cortex-M0+, and SC000) this function is not available as a core instruction instruction and thus __CLZ is implemented in software.
[in] | value | Value to count the leading zeros |
void __DMB | ( | void | ) |
This function ensures the apparent order of the explicit memory operations before and after the instruction, without ensuring their completion.
void __DSB | ( | void | ) |
This function acts as a special kind of Data Memory Barrier. It completes when all explicit memory accesses before this instruction complete.
void __ISB | ( | void | ) |
Instruction Synchronization Barrier flushes the pipeline in the processor, so that all instructions following the ISB are fetched from cache or memory, after the instruction has been completed.
uint32_t __LDA | ( | volatile uint32_t * | ptr | ) |
Executes a LDA instruction for 32 bit values.
[in] | ptr | Pointer to data |
uint8_t __LDAB | ( | volatile uint8_t * | ptr | ) |
Executes a LDAB instruction for 8 bit value.
[in] | ptr | Pointer to data |
uint32_t __LDAEX | ( | volatile uint32_t * | ptr | ) |
Executes a LDA exclusive instruction for 32 bit values.
[in] | ptr | Pointer to data |
uint8_t __LDAEXB | ( | volatile uint32_t * | ptr | ) |
Executes a LDAB exclusive instruction for 8 bit value.
[in] | ptr | Pointer to data |
uint16_t __LDAEXH | ( | volatile uint32_t * | ptr | ) |
Executes a LDAH exclusive instruction for 16 bit values.
[in] | ptr | Pointer to data |
uint16_t __LDAH | ( | volatile uint16_t * | ptr | ) |
Executes a LDAH instruction for 16 bit values.
[in] | ptr | Pointer to data |
uint8_t __LDRBT | ( | uint8_t | ptr | ) |
This function executed an Unprivileged LDRT command for 8 bit value.
[in] | ptr | Pointer to data |
uint8_t __LDREXB | ( | volatile uint8_t * | addr | ) |
This function executed an exclusive LDR command for 8 bit value [not for Cortex-M0, Cortex-M0+, or SC000].
[in] | *addr | Pointer to data |
uint16_t __LDREXH | ( | volatile uint16_t * | addr | ) |
This function executed an exclusive LDR command for 16 bit values [not for Cortex-M0, Cortex-M0+, or SC000].
[in] | *addr | Pointer to data |
uint32_t __LDREXW | ( | volatile uint32_t * | addr | ) |
This function executed an exclusive LDR command for 32 bit values [not for Cortex-M0, Cortex-M0+, or SC000].
[in] | *addr | Pointer to data |
uint16_t __LDRHT | ( | uint16_t | ptr | ) |
This function executed an Unprivileged LDRT command for 16 bit values.
[in] | ptr | Pointer to data |
uint32_t __LDRT | ( | uint32_t | ptr | ) |
This function executed an Unprivileged LDRT command for 32 bit values.
[in] | ptr | Pointer to data |
void __NOP | ( | void | ) |
This function does nothing. This instruction can be used for code alignment purposes.
uint32_t __RBIT | ( | uint32_t | value | ) |
[in] | value | Value to reverse |
uint32_t __REV | ( | uint32_t | value | ) |
Reverses the byte order in unsigned integer value. For example, 0x12345678 becomes 0x78563412.
[in] | value | Value to reverse |
uint32_t __REV16 | ( | uint32_t | value | ) |
Reverses the byte order within each halfword of a word. For example, 0x12345678 becomes 0x34127856.
[in] | value | Value to reverse |
int16_t __REVSH | ( | int16_t | value | ) |
Reverses the byte order in a 16-bit value and returns the signed 16-bit result. For example, 0x0080 becomes 0x8000.
[in] | value | Value to reverse |
uint32_t __ROR | ( | uint32_t | value, |
uint32_t | shift | ||
) |
This function rotates a value right by a specified number of bits.
[in] | value | Value to be shifted right |
[in] | shift | Number of bits in the range [1..31] |
uint32_t __RRX | ( | uint32_t | value | ) |
This function moves each bit of a bitstring right by one bit. The carry input is shifted in at the left end of the bitstring.
[in] | value | Value to rotate |
void __SEV | ( | void | ) |
Send Event is a hint instruction. It causes an event to be signaled to the CPU.
int32_t __SSAT | ( | int32_t | value, |
uint32_t | sat | ||
) |
This function saturates a signed value [not for Cortex-M0, Cortex-M0+, or SC000]. The Q bit is set if saturation occurs.
[in] | value | Value to be saturated |
[in] | sat | Bit position to saturate to [1..32] |
void __STL | ( | uint32_t | value, |
volatile uint32_t * | ptr | ||
) |
Executes a STL instruction for 32 bit values.
[in] | value | Value to store |
[in] | ptr | Pointer to location |
void __STLB | ( | uint8_t | value, |
volatile uint8_t * | ptr | ||
) |
Executes a STLB instruction for 8 bit values.
[in] | value | Value to store |
[in] | ptr | Pointer to location |
uint32_t __STLEX | ( | uint32_t | value, |
volatile uint32_t * | ptr | ||
) |
Executes a STL exclusive instruction for 32 bit values.
[in] | value | Value to store |
[in] | ptr | Pointer to location |
uint32_t __STLEXB | ( | uint8_t | value, |
volatile uint8_t * | ptr | ||
) |
Executes a STLB exclusive instruction for 8 bit values.
[in] | value | Value to store |
[in] | ptr | Pointer to location |
uint32_t __STLEXH | ( | uint16_t | value, |
volatile uint16_t * | ptr | ||
) |
Executes a STLH exclusive instruction for 16 bit values.
[in] | value | Value to store |
[in] | ptr | Pointer to location |
void __STLH | ( | uint16_t | value, |
volatile uint16_t * | ptr | ||
) |
Executes a STLH instruction for 16 bit values.
[in] | value | Value to store |
[in] | ptr | Pointer to location |
void __STRBT | ( | uint8_t | value, |
uint8_t | ptr | ||
) |
This function executed an Unprivileged STRT command for 8 bit values.
[in] | value | Value to store |
[in] | ptr | Pointer to location |
uint32_t __STREXB | ( | uint8_t | value, |
volatile uint8_t * | addr | ||
) |
This function executed an exclusive STR command for 8 bit values [not for Cortex-M0, Cortex-M0+, or SC000].
[in] | value | Value to store |
[in] | *addr | Pointer to location |
uint32_t __STREXH | ( | uint16_t | value, |
volatile uint16_t * | addr | ||
) |
This function executed an exclusive STR command for 16 bit values [not for Cortex-M0, Cortex-M0+, or SC000].
[in] | value | Value to store |
[in] | *addr | Pointer to location |
uint32_t __STREXW | ( | uint32_t | value, |
volatile uint32_t * | addr | ||
) |
This function executed an exclusive STR command for 32 bit values [not for Cortex-M0, Cortex-M0+, or SC000].
[in] | value | Value to store |
[in] | *addr | Pointer to location |
void __STRHT | ( | uint16_t | value, |
uint16_t | ptr | ||
) |
This function executed an Unprivileged STRT command for 16 bit values.
[in] | value | Value to store |
[in] | ptr | Pointer to location |
void __STRT | ( | uint32_t | value, |
uint32_t | ptr | ||
) |
This function executed an Unprivileged STRT command for 32 bit values.
[in] | value | Value to store |
[in] | ptr | Pointer to location |
uint32_t __USAT | ( | uint32_t | value, |
uint32_t | sat | ||
) |
This function saturates an unsigned value [not for Cortex-M0, Cortex-M0+, or SC000]. The Q bit is set if saturation occurs.
[in] | value | Value to be saturated |
[in] | sat | Bit position to saturate to [0..31] |
void __WFE | ( | void | ) |
Wait For Event is a hint instruction that permits the processor to enter a low-power state until an events occurs:
void __WFI | ( | void | ) |
WFI is a hint instruction that suspends execution until one of the following events occurs: