Robert Lopez / CMSIS5
Embed: (wiki syntax)

« Back to documentation index

CMSIS Core Instruction Interface

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 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]valueValue to reverse
Returns:
Reversed value

Definition at line 468 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]valueValue to reverse
Returns:
Reversed value

Definition at line 483 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]valueValue to rotate
Returns:
Rotated value

Definition at line 670 of file cmsis_armcc.h.

__attribute__ ( (always_inline)   )

Signed Saturate.

Saturates a signed value.

Parameters:
[in]valueValue to be saturated
[in]satBit position to saturate to (1..32)
Returns:
Saturated value

Definition at line 521 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 1135 of file cmsis_gcc.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 891 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 880 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 869 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]ptrPointer to data
Returns:
value of type uint32_t at (*ptr)

Definition at line 1214 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]ptrPointer to data
Returns:
value of type uint8_t at (*ptr)

Definition at line 1184 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]ptrPointer to data
Returns:
value of type uint32_t at (*ptr)

Definition at line 1468 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]ptrPointer to data
Returns:
value of type uint8_t at (*ptr)

Definition at line 1438 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]ptrPointer to data
Returns:
value of type uint16_t at (*ptr)

Definition at line 1453 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]ptrPointer to data
Returns:
value of type uint16_t at (*ptr)

Definition at line 1199 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]ptrPointer to data
Returns:
value of type uint8_t at (*ptr)

Definition at line 1044 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]ptrPointer to data
Returns:
value of type uint8_t at (*ptr)

Definition at line 1027 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]ptrPointer to data
Returns:
value of type uint16_t at (*ptr)

Definition at line 1049 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]ptrPointer to data
Returns:
value of type uint32_t at (*ptr)

Definition at line 1071 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]ptrPointer to data
Returns:
value of type uint16_t at (*ptr)

Definition at line 1059 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]ptrPointer to data
Returns:
value of type uint32_t at (*ptr)

Definition at line 1074 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]valueValue to reverse
Returns:
Reversed value

Definition at line 984 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]valueValue to reverse
Returns:
Reversed value

Definition at line 903 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]valueValue to reverse
Returns:
Reversed value

Definition at line 922 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]valueValue to reverse
Returns:
Reversed value

Definition at line 937 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]op1Value to rotate
[in]op2Number of Bits to rotate
Returns:
Rotated value

Definition at line 884 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]valueValue to rotate
Returns:
Rotated value

Definition at line 1029 of file cmsis_armclang.h.

__STATIC_FORCEINLINE int32_t __SSAT ( int32_t  val,
uint32_t  sat 
)

Signed Saturate.

Saturates a signed value.

Parameters:
[in]valueValue to be saturated
[in]satBit position to saturate to (1..32)
Returns:
Saturated value

Definition at line 1129 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]valueValue to store
[in]ptrPointer to location

Definition at line 1253 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]valueValue to store
[in]ptrPointer to location

Definition at line 1229 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]valueValue to store
[in]ptrPointer to location
Returns:
0 Function succeeded
1 Function failed

Definition at line 1519 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]valueValue to store
[in]ptrPointer to location
Returns:
0 Function succeeded
1 Function failed

Definition at line 1485 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]valueValue to store
[in]ptrPointer to location
Returns:
0 Function succeeded
1 Function failed

Definition at line 1502 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]valueValue to store
[in]ptrPointer to location

Definition at line 1241 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]valueValue to store
[in]ptrPointer to location

Definition at line 1089 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]valueValue to store
[in]ptrPointer to location
Returns:
0 Function succeeded
1 Function failed

Definition at line 1088 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]valueValue to store
[in]ptrPointer to location
Returns:
0 Function succeeded
1 Function failed

Definition at line 1105 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]valueValue to store
[in]ptrPointer to location
Returns:
0 Function succeeded
1 Function failed

Definition at line 1122 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]valueValue to store
[in]ptrPointer to location

Definition at line 1101 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]valueValue to store
[in]ptrPointer to location

Definition at line 1113 of file cmsis_armclang.h.

__STATIC_FORCEINLINE uint32_t __USAT ( int32_t  val,
uint32_t  sat 
)

Unsigned Saturate.

Saturates an unsigned value.

Parameters:
[in]valueValue to be saturated
[in]satBit position to saturate to (0..31)
Returns:
Saturated value

Definition at line 1154 of file cmsis_armclang.h.