Contiki-NG
Macros | Functions

Access to dedicated instructions. More...

Macros

#define __NOP   __nop
 No Operation. More...
 
#define __WFI   __wfi
 Wait For Interrupt. More...
 
#define __WFE   __wfe
 Wait For Event. More...
 
#define __SEV   __sev
 Send Event. More...
 
#define __ISB()
 Instruction Synchronization Barrier. More...
 
#define __DSB()
 Data Synchronization Barrier. More...
 
#define __DMB()
 Data Memory Barrier. More...
 
#define __REV   __rev
 Reverse byte order (32 bit) More...
 
#define __ROR   __ror
 Rotate Right in unsigned value (32 bit) More...
 
#define __BKPT(value)   __breakpoint(value)
 Breakpoint. More...
 
#define __CLZ   __clz
 Count leading zeros. More...
 
#define __NOP   __builtin_arm_nop
 No Operation. More...
 
#define __WFI   __builtin_arm_wfi
 Wait For Interrupt. More...
 
#define __WFE   __builtin_arm_wfe
 Wait For Event. More...
 
#define __SEV   __builtin_arm_sev
 Send Event. More...
 
#define __ISB()   __builtin_arm_isb(0xF);
 Instruction Synchronization Barrier. More...
 
#define __DSB()   __builtin_arm_dsb(0xF);
 Data Synchronization Barrier. More...
 
#define __DMB()   __builtin_arm_dmb(0xF);
 Data Memory Barrier. More...
 
#define __REV   __builtin_bswap32
 Reverse byte order (32 bit) More...
 
#define __REV16   __builtin_bswap16 /* ToDo: ARMCC_V6: check if __builtin_bswap16 could be used */
 Reverse byte order (16 bit) More...
 
#define __BKPT(value)   __ASM volatile ("bkpt "#value)
 Breakpoint. More...
 
#define __CLZ   __builtin_clz
 Count leading zeros. More...
 
#define __BKPT(value)   __ASM volatile ("bkpt "#value)
 Breakpoint. More...
 
#define __CLZ   __builtin_clz
 Count leading zeros. More...
 

Functions

__STATIC_INLINE __ASM uint32_t __REV16 (uint32_t value)
 Reverse byte order (16 bit) More...
 
__STATIC_INLINE __ASM int32_t __REVSH (int32_t value)
 Reverse byte order in signed short value. More...
 
__STATIC_INLINE uint32_t __RBIT (uint32_t value)
 Reverse bit order of value. More...
 
__STATIC_INLINE uint32_t __ROR (uint32_t op1, uint32_t op2)
 Rotate Right in unsigned value (32 bit) More...
 
__STATIC_INLINE void __NOP (void)
 No Operation. More...
 
__STATIC_INLINE void __WFI (void)
 Wait For Interrupt. More...
 
__STATIC_INLINE void __WFE (void)
 Wait For Event. More...
 
__STATIC_INLINE void __SEV (void)
 Send Event. More...
 
__STATIC_INLINE void __ISB (void)
 Instruction Synchronization Barrier. More...
 
__STATIC_INLINE void __DSB (void)
 Data Synchronization Barrier. More...
 
__STATIC_INLINE void __DMB (void)
 Data Memory Barrier. More...
 
__STATIC_INLINE uint32_t __REV (uint32_t value)
 Reverse byte order (32 bit) More...
 

Detailed Description

Access to dedicated instructions.

Macro Definition Documentation

◆ __BKPT [1/3]

#define __BKPT (   value)    __breakpoint(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.

Definition at line 427 of file cmsis_armcc.h.

◆ __BKPT [2/3]

#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.

Definition at line 517 of file cmsis_gcc.h.

◆ __BKPT [3/3]

#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.

Definition at line 865 of file cmsis_armcc_V6.h.

◆ __CLZ [1/3]

#define __CLZ   __clz

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

Definition at line 463 of file cmsis_armcc.h.

◆ __CLZ [2/3]

#define __CLZ   __builtin_clz

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

Definition at line 554 of file cmsis_gcc.h.

◆ __CLZ [3/3]

#define __CLZ   __builtin_clz

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

Definition at line 903 of file cmsis_armcc_V6.h.

◆ __DMB [1/2]

#define __DMB (   void)
Value:
do {\
__schedule_barrier();\
__dmb(0xF);\
__schedule_barrier();\
} while (0U)

Data Memory Barrier.

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

Definition at line 366 of file cmsis_armcc.h.

◆ __DMB [2/2]

#define __DMB (   void)    __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.

Definition at line 799 of file cmsis_armcc_V6.h.

◆ __DSB [1/2]

#define __DSB (   void)
Value:
do {\
__schedule_barrier();\
__dsb(0xF);\
__schedule_barrier();\
} while (0U)

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 355 of file cmsis_armcc.h.

◆ __DSB [2/2]

#define __DSB (   void)    __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.

Definition at line 791 of file cmsis_armcc_V6.h.

◆ __ISB [1/2]

#define __ISB (   void)
Value:
do {\
__schedule_barrier();\
__isb(0xF);\
__schedule_barrier();\
} while (0U)

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 344 of file cmsis_armcc.h.

◆ __ISB [2/2]

#define __ISB (   void)    __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.

Definition at line 784 of file cmsis_armcc_V6.h.

◆ __NOP [1/2]

#define __NOP   __nop

No Operation.

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

Definition at line 313 of file cmsis_armcc.h.

◆ __NOP [2/2]

#define __NOP   __builtin_arm_nop

No Operation.

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

Definition at line 754 of file cmsis_armcc_V6.h.

◆ __REV [1/2]

#define __REV   __rev

Reverse byte order (32 bit)

Reverses the byte order in integer value.

Parameters
[in]valueValue to reverse
Returns
Reversed value

Definition at line 378 of file cmsis_armcc.h.

◆ __REV [2/2]

#define __REV   __builtin_bswap32

Reverse byte order (32 bit)

Reverses the byte order in integer value.

Parameters
[in]valueValue to reverse
Returns
Reversed value

Definition at line 808 of file cmsis_armcc_V6.h.

◆ __REV16

#define __REV16   __builtin_bswap16 /* ToDo: ARMCC_V6: check if __builtin_bswap16 could be used */

Reverse byte order (16 bit)

Reverses the byte order in two unsigned short values.

Parameters
[in]valueValue to reverse
Returns
Reversed value

Definition at line 817 of file cmsis_armcc_V6.h.

◆ __ROR

#define __ROR   __ror

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]valueValue to rotate
[in]valueNumber of Bits to rotate
Returns
Rotated value

Definition at line 417 of file cmsis_armcc.h.

◆ __SEV [1/2]

#define __SEV   __sev

Send Event.

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

Definition at line 335 of file cmsis_armcc.h.

◆ __SEV [2/2]

#define __SEV   __builtin_arm_sev

Send Event.

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

Definition at line 775 of file cmsis_armcc_V6.h.

◆ __WFE [1/2]

#define __WFE   __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.

Definition at line 328 of file cmsis_armcc.h.

◆ __WFE [2/2]

#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.

Definition at line 768 of file cmsis_armcc_V6.h.

◆ __WFI [1/2]

#define __WFI   __wfi

Wait For Interrupt.

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

Definition at line 320 of file cmsis_armcc.h.

◆ __WFI [2/2]

#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.

Definition at line 760 of file cmsis_armcc_V6.h.

Function Documentation

◆ __DMB()

__STATIC_INLINE 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 438 of file cmsis_gcc.h.

◆ __DSB()

__STATIC_INLINE 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 427 of file cmsis_gcc.h.

Referenced by NVIC_DecodePriority(), NVIC_SystemReset(), SCB_CleanDCache(), SCB_CleanDCache_by_Addr(), SCB_CleanInvalidateDCache(), SCB_CleanInvalidateDCache_by_Addr(), SCB_DisableDCache(), SCB_DisableICache(), SCB_EnableDCache(), SCB_EnableICache(), SCB_InvalidateDCache(), SCB_InvalidateDCache_by_Addr(), and SCB_InvalidateICache().

◆ __ISB()

__STATIC_INLINE 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 416 of file cmsis_gcc.h.

Referenced by SCB_CleanDCache_by_Addr(), SCB_CleanInvalidateDCache_by_Addr(), SCB_DisableICache(), SCB_EnableICache(), SCB_InvalidateDCache_by_Addr(), and SCB_InvalidateICache().

◆ __NOP()

__STATIC_INLINE void __NOP ( void  )

No Operation.

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

Definition at line 373 of file cmsis_gcc.h.

Referenced by ITM_SendChar(), NVIC_DecodePriority(), and NVIC_SystemReset().

◆ __RBIT()

__STATIC_INLINE 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 439 of file cmsis_armcc.h.

◆ __REV()

__STATIC_INLINE uint32_t __REV ( uint32_t  value)

Reverse byte order (32 bit)

Reverses the byte order in integer value.

Parameters
[in]valueValue to reverse
Returns
Reversed value

Definition at line 450 of file cmsis_gcc.h.

◆ __REV16()

__STATIC_INLINE uint32_t __REV16 ( uint32_t  value)

Reverse byte order (16 bit)

Reverses the byte order in two unsigned short values.

Parameters
[in]valueValue to reverse
Returns
Reversed value

Definition at line 388 of file cmsis_armcc.h.

◆ __REVSH()

__STATIC_INLINE int32_t __REVSH ( int32_t  value)

Reverse byte order in signed short value.

Reverses the byte order in a signed short value with sign extension to integer.

Parameters
[in]valueValue to reverse
Returns
Reversed value

Definition at line 402 of file cmsis_armcc.h.

◆ __ROR()

__STATIC_INLINE 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 852 of file cmsis_armcc_V6.h.

◆ __SEV()

__STATIC_INLINE void __SEV ( void  )

Send Event.

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

Definition at line 404 of file cmsis_gcc.h.

◆ __WFE()

__STATIC_INLINE void __WFE ( void  )

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.

Definition at line 394 of file cmsis_gcc.h.

◆ __WFI()

__STATIC_INLINE void __WFI ( void  )

Wait For Interrupt.

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

Definition at line 383 of file cmsis_gcc.h.

Referenced by lpm_drop().