Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
CMSIS Core Instruction Interface
Access to dedicated instructions. More...
Functions | |
__attribute__ ((section(".rev16_text"))) __STATIC_INLINE __ASM uint32_t __REV16(uint32_t value) | |
Reverse byte order (16 bit) | |
__attribute__ ((section(".revsh_text"))) __STATIC_INLINE __ASM int16_t __REVSH(int16_t value) | |
Reverse byte order (16 bit) | |
__attribute__ ((always_inline)) __STATIC_INLINE int32_t __SSAT(int32_t val | |
Signed Saturate. | |
__attribute__ ((section(".rrx_text"))) __STATIC_INLINE __ASM uint32_t __RRX(uint32_t value) | |
Rotate Right with Extend (32 bit) | |
__STATIC_FORCEINLINE uint32_t | __ROR (uint32_t op1, uint32_t op2) |
Rotate Right in unsigned value (32 bit) | |
__STATIC_FORCEINLINE uint8_t | __CLZ (uint32_t value) |
Count leading zeros. | |
__STATIC_FORCEINLINE uint32_t | __RRX (uint32_t value) |
Rotate Right with Extend (32 bit) | |
__STATIC_FORCEINLINE uint8_t | __LDRBT (volatile uint8_t *ptr) |
LDRT Unprivileged (8 bit) | |
__STATIC_FORCEINLINE uint16_t | __LDRHT (volatile uint16_t *ptr) |
LDRT Unprivileged (16 bit) | |
__STATIC_FORCEINLINE uint32_t | __LDRT (volatile uint32_t *ptr) |
LDRT Unprivileged (32 bit) | |
__STATIC_FORCEINLINE void | __STRBT (uint8_t value, volatile uint8_t *ptr) |
STRT Unprivileged (8 bit) | |
__STATIC_FORCEINLINE void | __STRHT (uint16_t value, volatile uint16_t *ptr) |
STRT Unprivileged (16 bit) | |
__STATIC_FORCEINLINE void | __STRT (uint32_t value, volatile uint32_t *ptr) |
STRT Unprivileged (32 bit) | |
__STATIC_FORCEINLINE int32_t | __SSAT (int32_t val, uint32_t sat) |
Signed Saturate. | |
__STATIC_FORCEINLINE uint32_t | __USAT (int32_t val, uint32_t sat) |
Unsigned Saturate. | |
__STATIC_FORCEINLINE uint8_t | __LDAB (volatile uint8_t *ptr) |
Load-Acquire (8 bit) | |
__STATIC_FORCEINLINE uint16_t | __LDAH (volatile uint16_t *ptr) |
Load-Acquire (16 bit) | |
__STATIC_FORCEINLINE uint32_t | __LDA (volatile uint32_t *ptr) |
Load-Acquire (32 bit) | |
__STATIC_FORCEINLINE void | __STLB (uint8_t value, volatile uint8_t *ptr) |
Store-Release (8 bit) | |
__STATIC_FORCEINLINE void | __STLH (uint16_t value, volatile uint16_t *ptr) |
Store-Release (16 bit) | |
__STATIC_FORCEINLINE void | __STL (uint32_t value, volatile uint32_t *ptr) |
Store-Release (32 bit) | |
__STATIC_FORCEINLINE void | __ISB (void) |
Instruction Synchronization Barrier. | |
__STATIC_FORCEINLINE void | __DSB (void) |
Data Synchronization Barrier. | |
__STATIC_FORCEINLINE void | __DMB (void) |
Data Memory Barrier. | |
__STATIC_FORCEINLINE uint32_t | __REV (uint32_t value) |
Reverse byte order (32 bit) | |
__STATIC_FORCEINLINE uint32_t | __REV16 (uint32_t value) |
Reverse byte order (16 bit) | |
__STATIC_FORCEINLINE int16_t | __REVSH (int16_t value) |
Reverse byte order (16 bit) | |
__STATIC_FORCEINLINE uint32_t | __RBIT (uint32_t value) |
Reverse bit order of value. | |
__STATIC_FORCEINLINE uint8_t | __LDREXB (volatile uint8_t *addr) |
LDR Exclusive (8 bit) | |
__STATIC_FORCEINLINE uint16_t | __LDREXH (volatile uint16_t *addr) |
LDR Exclusive (16 bit) | |
__STATIC_FORCEINLINE uint32_t | __LDREXW (volatile uint32_t *addr) |
LDR Exclusive (32 bit) | |
__STATIC_FORCEINLINE uint32_t | __STREXB (uint8_t value, volatile uint8_t *addr) |
STR Exclusive (8 bit) | |
__STATIC_FORCEINLINE uint32_t | __STREXH (uint16_t value, volatile uint16_t *addr) |
STR Exclusive (16 bit) | |
__STATIC_FORCEINLINE uint32_t | __STREXW (uint32_t value, volatile uint32_t *addr) |
STR Exclusive (32 bit) | |
__STATIC_FORCEINLINE void | __CLREX (void) |
Remove the exclusive lock. | |
__STATIC_FORCEINLINE uint8_t | __LDAEXB (volatile uint8_t *ptr) |
Load-Acquire Exclusive (8 bit) | |
__STATIC_FORCEINLINE uint16_t | __LDAEXH (volatile uint16_t *ptr) |
Load-Acquire Exclusive (16 bit) | |
__STATIC_FORCEINLINE uint32_t | __LDAEX (volatile uint32_t *ptr) |
Load-Acquire Exclusive (32 bit) | |
__STATIC_FORCEINLINE uint32_t | __STLEXB (uint8_t value, volatile uint8_t *ptr) |
Store-Release Exclusive (8 bit) | |
__STATIC_FORCEINLINE uint32_t | __STLEXH (uint16_t value, volatile uint16_t *ptr) |
Store-Release Exclusive (16 bit) | |
__STATIC_FORCEINLINE uint32_t | __STLEX (uint32_t value, volatile uint32_t *ptr) |
Store-Release Exclusive (32 bit) |
Detailed Description
Access to dedicated instructions.
Function Documentation
__attribute__ | ( | (section(".rev16_text")) | ) |
Reverse byte order (16 bit)
Reverses the byte order within each halfword of a word. For example, 0x12345678 becomes 0x34127856.
- Parameters:
-
[in] value Value to reverse
- Returns:
- Reversed value
Definition at line 480 of file cmsis_armcc.h.
__attribute__ | ( | (section(".revsh_text")) | ) |
Reverse byte order (16 bit)
Reverses the byte order in a 16-bit value and returns the signed 16-bit result. For example, 0x0080 becomes 0x8000.
- Parameters:
-
[in] value Value to reverse
- Returns:
- Reversed value
Definition at line 495 of file cmsis_armcc.h.
__attribute__ | ( | (section(".rrx_text")) | ) |
Rotate Right with Extend (32 bit)
Moves each bit of a bitstring right by one bit. The carry input is shifted in at the left end of the bitstring.
- Parameters:
-
[in] value Value to rotate
- Returns:
- Rotated value
Definition at line 682 of file cmsis_armcc.h.
__attribute__ | ( | (always_inline) | ) |
Signed Saturate.
Saturates a signed value.
- Parameters:
-
[in] value Value to be saturated [in] sat Bit position to saturate to (1..32)
- Returns:
- Saturated value
Definition at line 533 of file cmsis_armcc.h.
__STATIC_FORCEINLINE void __CLREX | ( | void | ) |
Remove the exclusive lock.
Removes the exclusive lock which is created by LDREX.
Definition at line 1215 of file cmsis_gcc.h.
__STATIC_FORCEINLINE uint8_t __CLZ | ( | uint32_t | value ) |
Count leading zeros.
Counts the number of leading zeros of a data value.
- Parameters:
-
[in] value Value to count the leading zeros
- Returns:
- number of leading zeros in value
Definition at line 937 of file cmsis_armclang.h.
__STATIC_FORCEINLINE void __DMB | ( | void | ) |
Data Memory Barrier.
Ensures the apparent order of the explicit memory operations before and after the instruction, without ensuring their completion.
Definition at line 955 of file cmsis_gcc.h.
__STATIC_FORCEINLINE void __DSB | ( | void | ) |
Data Synchronization Barrier.
Acts as a special kind of Data Memory Barrier. It completes when all explicit memory accesses before this instruction complete.
Definition at line 944 of file cmsis_gcc.h.
__STATIC_FORCEINLINE void __ISB | ( | void | ) |
Instruction Synchronization Barrier.
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.
Definition at line 933 of file cmsis_gcc.h.
__STATIC_FORCEINLINE uint32_t __LDA | ( | volatile uint32_t * | ptr ) |
Load-Acquire (32 bit)
Executes a LDA instruction for 32 bit values.
- Parameters:
-
[in] ptr Pointer to data
- Returns:
- value of type uint32_t at (*ptr)
Definition at line 1248 of file cmsis_armclang.h.
__STATIC_FORCEINLINE uint8_t __LDAB | ( | volatile uint8_t * | ptr ) |
Load-Acquire (8 bit)
Executes a LDAB instruction for 8 bit value.
- Parameters:
-
[in] ptr Pointer to data
- Returns:
- value of type uint8_t at (*ptr)
Definition at line 1218 of file cmsis_armclang.h.
__STATIC_FORCEINLINE uint32_t __LDAEX | ( | volatile uint32_t * | ptr ) |
Load-Acquire Exclusive (32 bit)
Executes a LDA exclusive instruction for 32 bit values.
- Parameters:
-
[in] ptr Pointer to data
- Returns:
- value of type uint32_t at (*ptr)
Definition at line 1548 of file cmsis_gcc.h.
__STATIC_FORCEINLINE uint8_t __LDAEXB | ( | volatile uint8_t * | ptr ) |
Load-Acquire Exclusive (8 bit)
Executes a LDAB exclusive instruction for 8 bit value.
- Parameters:
-
[in] ptr Pointer to data
- Returns:
- value of type uint8_t at (*ptr)
Definition at line 1518 of file cmsis_gcc.h.
__STATIC_FORCEINLINE uint16_t __LDAEXH | ( | volatile uint16_t * | ptr ) |
Load-Acquire Exclusive (16 bit)
Executes a LDAH exclusive instruction for 16 bit values.
- Parameters:
-
[in] ptr Pointer to data
- Returns:
- value of type uint16_t at (*ptr)
Definition at line 1533 of file cmsis_gcc.h.
__STATIC_FORCEINLINE uint16_t __LDAH | ( | volatile uint16_t * | ptr ) |
Load-Acquire (16 bit)
Executes a LDAH instruction for 16 bit values.
- Parameters:
-
[in] ptr Pointer to data
- Returns:
- value of type uint16_t at (*ptr)
Definition at line 1233 of file cmsis_armclang.h.
__STATIC_FORCEINLINE uint8_t __LDRBT | ( | volatile uint8_t * | ptr ) |
LDRT Unprivileged (8 bit)
Executes a Unprivileged LDRT instruction for 8 bit value.
- Parameters:
-
[in] ptr Pointer to data
- Returns:
- value of type uint8_t at (*ptr)
Definition at line 1078 of file cmsis_armclang.h.
__STATIC_FORCEINLINE uint8_t __LDREXB | ( | volatile uint8_t * | addr ) |
LDR Exclusive (8 bit)
Executes a exclusive LDR instruction for 8 bit value.
- Parameters:
-
[in] ptr Pointer to data
- Returns:
- value of type uint8_t at (*ptr)
Definition at line 1107 of file cmsis_gcc.h.
__STATIC_FORCEINLINE uint16_t __LDREXH | ( | volatile uint16_t * | addr ) |
LDR Exclusive (16 bit)
Executes a exclusive LDR instruction for 16 bit values.
- Parameters:
-
[in] ptr Pointer to data
- Returns:
- value of type uint16_t at (*ptr)
Definition at line 1129 of file cmsis_gcc.h.
__STATIC_FORCEINLINE uint32_t __LDREXW | ( | volatile uint32_t * | addr ) |
LDR Exclusive (32 bit)
Executes a exclusive LDR instruction for 32 bit values.
- Parameters:
-
[in] ptr Pointer to data
- Returns:
- value of type uint32_t at (*ptr)
Definition at line 1151 of file cmsis_gcc.h.
__STATIC_FORCEINLINE uint16_t __LDRHT | ( | volatile uint16_t * | ptr ) |
LDRT Unprivileged (16 bit)
Executes a Unprivileged LDRT instruction for 16 bit values.
- Parameters:
-
[in] ptr Pointer to data
- Returns:
- value of type uint16_t at (*ptr)
Definition at line 1093 of file cmsis_armclang.h.
__STATIC_FORCEINLINE uint32_t __LDRT | ( | volatile uint32_t * | ptr ) |
LDRT Unprivileged (32 bit)
Executes a Unprivileged LDRT instruction for 32 bit values.
- Parameters:
-
[in] ptr Pointer to data
- Returns:
- value of type uint32_t at (*ptr)
Definition at line 1108 of file cmsis_armclang.h.
__STATIC_FORCEINLINE uint32_t __RBIT | ( | uint32_t | value ) |
Reverse bit order of value.
Reverses the bit order of the given value.
- Parameters:
-
[in] value Value to reverse
- Returns:
- Reversed value
Definition at line 1048 of file cmsis_gcc.h.
__STATIC_FORCEINLINE uint32_t __REV | ( | uint32_t | value ) |
Reverse byte order (32 bit)
Reverses the byte order in unsigned integer value. For example, 0x12345678 becomes 0x78563412.
- Parameters:
-
[in] value Value to reverse
- Returns:
- Reversed value
Definition at line 967 of file cmsis_gcc.h.
__STATIC_FORCEINLINE uint32_t __REV16 | ( | uint32_t | value ) |
Reverse byte order (16 bit)
Reverses the byte order within each halfword of a word. For example, 0x12345678 becomes 0x34127856.
- Parameters:
-
[in] value Value to reverse
- Returns:
- Reversed value
Definition at line 986 of file cmsis_gcc.h.
__STATIC_FORCEINLINE int16_t __REVSH | ( | int16_t | value ) |
Reverse byte order (16 bit)
Reverses the byte order in a 16-bit value and returns the signed 16-bit result. For example, 0x0080 becomes 0x8000.
- Parameters:
-
[in] value Value to reverse
- Returns:
- Reversed value
Definition at line 1001 of file cmsis_gcc.h.
__STATIC_FORCEINLINE uint32_t __ROR | ( | uint32_t | op1, |
uint32_t | op2 | ||
) |
Rotate Right in unsigned value (32 bit)
Rotate Right (immediate) provides the value of the contents of a register rotated by a variable number of bits.
- Parameters:
-
[in] op1 Value to rotate [in] op2 Number of Bits to rotate
- Returns:
- Rotated value
Definition at line 902 of file cmsis_armclang.h.
__STATIC_FORCEINLINE uint32_t __RRX | ( | uint32_t | value ) |
Rotate Right with Extend (32 bit)
Moves each bit of a bitstring right by one bit. The carry input is shifted in at the left end of the bitstring.
- Parameters:
-
[in] value Value to rotate
- Returns:
- Rotated value
Definition at line 1063 of file cmsis_armclang.h.
__STATIC_FORCEINLINE int32_t __SSAT | ( | int32_t | val, |
uint32_t | sat | ||
) |
Signed Saturate.
Saturates a signed value.
- Parameters:
-
[in] value Value to be saturated [in] sat Bit position to saturate to (1..32)
- Returns:
- Saturated value
Definition at line 1163 of file cmsis_armclang.h.
__STATIC_FORCEINLINE void __STL | ( | uint32_t | value, |
volatile uint32_t * | ptr | ||
) |
Store-Release (32 bit)
Executes a STL instruction for 32 bit values.
- Parameters:
-
[in] value Value to store [in] ptr Pointer to location
Definition at line 1287 of file cmsis_armclang.h.
__STATIC_FORCEINLINE void __STLB | ( | uint8_t | value, |
volatile uint8_t * | ptr | ||
) |
Store-Release (8 bit)
Executes a STLB instruction for 8 bit values.
- Parameters:
-
[in] value Value to store [in] ptr Pointer to location
Definition at line 1263 of file cmsis_armclang.h.
__STATIC_FORCEINLINE uint32_t __STLEX | ( | uint32_t | value, |
volatile uint32_t * | ptr | ||
) |
Store-Release Exclusive (32 bit)
Executes a STL exclusive instruction for 32 bit values.
- Parameters:
-
[in] value Value to store [in] ptr Pointer to location
- Returns:
- 0 Function succeeded
- 1 Function failed
Definition at line 1599 of file cmsis_gcc.h.
__STATIC_FORCEINLINE uint32_t __STLEXB | ( | uint8_t | value, |
volatile uint8_t * | ptr | ||
) |
Store-Release Exclusive (8 bit)
Executes a STLB exclusive instruction for 8 bit values.
- Parameters:
-
[in] value Value to store [in] ptr Pointer to location
- Returns:
- 0 Function succeeded
- 1 Function failed
Definition at line 1565 of file cmsis_gcc.h.
__STATIC_FORCEINLINE uint32_t __STLEXH | ( | uint16_t | value, |
volatile uint16_t * | ptr | ||
) |
Store-Release Exclusive (16 bit)
Executes a STLH exclusive instruction for 16 bit values.
- Parameters:
-
[in] value Value to store [in] ptr Pointer to location
- Returns:
- 0 Function succeeded
- 1 Function failed
Definition at line 1582 of file cmsis_gcc.h.
__STATIC_FORCEINLINE void __STLH | ( | uint16_t | value, |
volatile uint16_t * | ptr | ||
) |
Store-Release (16 bit)
Executes a STLH instruction for 16 bit values.
- Parameters:
-
[in] value Value to store [in] ptr Pointer to location
Definition at line 1275 of file cmsis_armclang.h.
__STATIC_FORCEINLINE void __STRBT | ( | uint8_t | value, |
volatile uint8_t * | ptr | ||
) |
STRT Unprivileged (8 bit)
Executes a Unprivileged STRT instruction for 8 bit values.
- Parameters:
-
[in] value Value to store [in] ptr Pointer to location
Definition at line 1123 of file cmsis_armclang.h.
__STATIC_FORCEINLINE uint32_t __STREXB | ( | uint8_t | value, |
volatile uint8_t * | addr | ||
) |
STR Exclusive (8 bit)
Executes a exclusive STR instruction for 8 bit values.
- Parameters:
-
[in] value Value to store [in] ptr Pointer to location
- Returns:
- 0 Function succeeded
- 1 Function failed
Definition at line 1168 of file cmsis_gcc.h.
__STATIC_FORCEINLINE uint32_t __STREXH | ( | uint16_t | value, |
volatile uint16_t * | addr | ||
) |
STR Exclusive (16 bit)
Executes a exclusive STR instruction for 16 bit values.
- Parameters:
-
[in] value Value to store [in] ptr Pointer to location
- Returns:
- 0 Function succeeded
- 1 Function failed
Definition at line 1185 of file cmsis_gcc.h.
__STATIC_FORCEINLINE uint32_t __STREXW | ( | uint32_t | value, |
volatile uint32_t * | addr | ||
) |
STR Exclusive (32 bit)
Executes a exclusive STR instruction for 32 bit values.
- Parameters:
-
[in] value Value to store [in] ptr Pointer to location
- Returns:
- 0 Function succeeded
- 1 Function failed
Definition at line 1202 of file cmsis_gcc.h.
__STATIC_FORCEINLINE void __STRHT | ( | uint16_t | value, |
volatile uint16_t * | ptr | ||
) |
STRT Unprivileged (16 bit)
Executes a Unprivileged STRT instruction for 16 bit values.
- Parameters:
-
[in] value Value to store [in] ptr Pointer to location
Definition at line 1135 of file cmsis_armclang.h.
__STATIC_FORCEINLINE void __STRT | ( | uint32_t | value, |
volatile uint32_t * | ptr | ||
) |
STRT Unprivileged (32 bit)
Executes a Unprivileged STRT instruction for 32 bit values.
- Parameters:
-
[in] value Value to store [in] ptr Pointer to location
Definition at line 1147 of file cmsis_armclang.h.
__STATIC_FORCEINLINE uint32_t __USAT | ( | int32_t | val, |
uint32_t | sat | ||
) |
Unsigned Saturate.
Saturates an unsigned value.
- Parameters:
-
[in] value Value to be saturated [in] sat Bit position to saturate to (0..31)
- Returns:
- Saturated value
Definition at line 1188 of file cmsis_armclang.h.
Generated on Tue Jul 12 2022 15:37:31 by
