CMSIS-Core (Cortex-A)  
CMSIS-Core support for Cortex-A processor-based devices
 
Loading...
Searching...
No Matches
Intrinsic Functions

Functions that generate specific Cortex-A CPU Instructions. More...

Macros

#define __NOP   __builtin_arm_nop
 No Operation.
 
#define __WFI   __builtin_arm_wfi
 Wait For Interrupt.
 
#define __WFE   __builtin_arm_wfe
 Wait For Event.
 
#define __SEV   __builtin_arm_sev
 Send Event.
 
#define __ISB()   __builtin_arm_isb(0xF)
 Instruction Synchronization Barrier.
 
#define __DSB()   __builtin_arm_dsb(0xF)
 Data Synchronization Barrier.
 
#define __DMB()   __builtin_arm_dmb(0xF)
 Data Memory Barrier.
 
#define __BKPT(value)   __ASM volatile ("bkpt "#value)
 Breakpoint.
 

Functions

uint32_t __REV (uint32_t value)
 Reverse byte order (32 bit)
 
uint16_t __REV16 (uint16_t value)
 Reverse byte order (16 bit)
 
int32_t __REVSH (int32_t value)
 Reverse byte order (16 bit)
 
uint32_t __ROR (uint32_t op1, uint32_t op2)
 Rotate Right in unsigned value (32 bit)
 
uint32_t __RBIT (uint32_t value)
 Reverse bit order of value.
 
uint8_t __CLZ (uint32_t value)
 Count leading zeros.
 

Description

Functions that generate specific Cortex-A CPU Instructions.

Macro Definition Documentation

◆ __BKPT

#define __BKPT (   value)    __ASM volatile ("bkpt "#value)

Breakpoint.

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.

Parameters
[in]valueis ignored by the processor. If required, a debugger can use it to store additional information about the breakpoint.

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.

◆ __DMB

#define __DMB ( )    __builtin_arm_dmb(0xF)

Data Memory Barrier.

Ensures the apparent order of the explicit memory operations before and after the instruction, without ensuring their completion.

◆ __DSB

#define __DSB ( )    __builtin_arm_dsb(0xF)

Data Synchronization Barrier.

Acts as a special kind of Data Memory Barrier. It completes when all explicit memory accesses before this instruction complete.

◆ __ISB

#define __ISB ( )    __builtin_arm_isb(0xF)

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.

◆ __NOP

#define __NOP   __builtin_arm_nop

No Operation.

No Operation does nothing. This instruction can be used for code alignment purposes.

◆ __SEV

#define __SEV   __builtin_arm_sev

Send Event.

Send Event is a hint instruction. It causes an event to be signaled to the CPU.

◆ __WFE

#define __WFE   __builtin_arm_wfe

Wait For Event.

Wait For Event is a hint instruction that permits the processor to enter a low-power state until one of a number of events occurs.

Wait For Event is a hint instruction that permits the processor to enter

◆ __WFI

#define __WFI   __builtin_arm_wfi

Wait For Interrupt.

Wait For Interrupt is a hint instruction that suspends execution until one of a number of events occurs.

Function Documentation

◆ __CLZ()

uint8_t __CLZ ( uint32_t  value)

Count leading zeros.

Counts the number of leading zeros of a data value.

Parameters
[in]valueValue to count the leading zeros
Returns
number of leading zeros in value

◆ __RBIT()

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

◆ __REV()

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

◆ __REV16()

uint16_t __REV16 ( uint16_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

◆ __REVSH()

int32_t __REVSH ( int32_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

◆ __ROR()

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