STM MATLAB Simulator
Loading...
Searching...
No Matches
Macros
arm_defines.h File Reference
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define __disable_irq()
 
#define __ASM   __asm
 
#define __IO   volatile
 
#define __inline   inline
 
#define __INLINE   __inline
 
#define __STATIC_INLINE   static __inline
 
#define __STATIC_FORCEINLINE   static __forceinline
 
#define __NO_RETURN   __declspec(noreturn)
 
#define __USED   __attribute__((used))
 
#define __WEAK   __declspec(selectany)
 
#define __PACKED   __attribute__((packed))
 
#define __PACKED_STRUCT   __packed struct
 
#define __PACKED_UNION   __packed union
 
#define __UNALIGNED_UINT32(x)   (*((__packed uint32_t *)(x)))
 
#define __UNALIGNED_UINT16_WRITE(addr, val)   ((*((__packed uint16_t *)(addr))) = (val))
 
#define __UNALIGNED_UINT16_READ(addr)   (*((const __packed uint16_t *)(addr)))
 
#define __UNALIGNED_UINT32_WRITE(addr, val)   ((*((__packed uint32_t *)(addr))) = (val))
 
#define __UNALIGNED_UINT32_READ(addr)   (*((const __packed uint32_t *)(addr)))
 
#define __ALIGNED(x)   __attribute__((aligned(x)))
 
#define __RESTRICT   __restrict
 
#define __NOP()
 No Operation.
 
#define __WFI()
 Wait For Interrupt.
 
#define __WFE()
 Wait For Event.
 
#define __SEV()
 Send Event.
 
#define __ISB()
 Instruction Synchronization Barrier.
 
#define __DSB()
 Data Synchronization Barrier.
 
#define __DMB()
 Data Memory Barrier.
 
#define __REV(value)   value
 Reverse byte order (32 bit)
 
#define __REV16(value)   value
 Reverse byte order (16 bit)
 
#define __REVSH(value)   value
 Reverse byte order (16 bit)
 
#define __ROR()
 Rotate Right in unsigned value (32 bit)
 
#define __BKPT(value)   value
 Breakpoint.
 
#define __RBIT()   _byteswap_ulong(_rotr(value, 16))
 Reverse bit order of value.
 
#define __CLZ()   __lzcnt(value)
 Count leading zeros.
 
#define __LDREXB(ptr)   (*(volatile uint8_t *)(ptr))
 LDR Exclusive (8 bit)
 
#define __LDREXH(ptr)   (*(volatile uint16_t *)(ptr))
 LDR Exclusive (16 bit)
 
#define __LDREXW(ptr)   (*(volatile uint32_t *)(ptr))
 LDR Exclusive (32 bit)
 
#define __STREXB(value, ptr)   (*(volatile uint8_t *)(ptr) = (value), 0)
 STR Exclusive (8 bit)
 
#define __STREXH(value, ptr)   (*(volatile uint16_t *)(ptr) = (value), 0)
 STR Exclusive (16 bit)
 
#define __STREXW(value, ptr)   (*(volatile uint32_t *)(ptr) = (value), 0)
 STR Exclusive (32 bit)
 
#define __CLREX
 Remove the exclusive lock.
 
#define __SSAT
 Signed Saturate.
 
#define __USAT
 Unsigned Saturate.
 

Macro Definition Documentation

◆ __disable_irq

#define __disable_irq ( )

◆ __ASM

#define __ASM   __asm

◆ __IO

#define __IO   volatile

◆ __inline

#define __inline   inline

◆ __INLINE

#define __INLINE   __inline

◆ __STATIC_INLINE

#define __STATIC_INLINE   static __inline

◆ __STATIC_FORCEINLINE

#define __STATIC_FORCEINLINE   static __forceinline

◆ __NO_RETURN

#define __NO_RETURN   __declspec(noreturn)

◆ __USED

#define __USED   __attribute__((used))

◆ __WEAK

#define __WEAK   __declspec(selectany)

◆ __PACKED

#define __PACKED   __attribute__((packed))

◆ __PACKED_STRUCT

#define __PACKED_STRUCT   __packed struct

◆ __PACKED_UNION

#define __PACKED_UNION   __packed union

◆ __UNALIGNED_UINT32

#define __UNALIGNED_UINT32 ( x)    (*((__packed uint32_t *)(x)))

◆ __UNALIGNED_UINT16_WRITE

#define __UNALIGNED_UINT16_WRITE ( addr,
val )   ((*((__packed uint16_t *)(addr))) = (val))

◆ __UNALIGNED_UINT16_READ

#define __UNALIGNED_UINT16_READ ( addr)    (*((const __packed uint16_t *)(addr)))

◆ __UNALIGNED_UINT32_WRITE

#define __UNALIGNED_UINT32_WRITE ( addr,
val )   ((*((__packed uint32_t *)(addr))) = (val))

◆ __UNALIGNED_UINT32_READ

#define __UNALIGNED_UINT32_READ ( addr)    (*((const __packed uint32_t *)(addr)))

◆ __ALIGNED

#define __ALIGNED ( x)    __attribute__((aligned(x)))

◆ __RESTRICT

#define __RESTRICT   __restrict

◆ __NOP

#define __NOP ( )

No Operation.

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

◆ __WFI

#define __WFI ( )

Wait For Interrupt.

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

◆ __WFE

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

◆ __SEV

#define __SEV ( )

Send Event.

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

◆ __ISB

#define __ISB ( )

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.

◆ __DSB

#define __DSB ( )

Data Synchronization Barrier.

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

◆ __DMB

#define __DMB ( )

Data Memory Barrier.

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

◆ __REV

#define __REV ( value)    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

#define __REV16 ( value)    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

#define __REVSH ( value)    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

#define __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]op1Value to rotate
[in]op2Number of Bits to rotate
Returns
Rotated value

◆ __BKPT

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

◆ __RBIT

#define __RBIT ( )    _byteswap_ulong(_rotr(value, 16))

Reverse bit order of value.

Reverses the bit order of the given value.

Parameters
[in]valueValue to reverse
Returns
Reversed value

◆ __CLZ

#define __CLZ ( )    __lzcnt(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

◆ __LDREXB

#define __LDREXB ( ptr)    (*(volatile uint8_t *)(ptr))

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)

◆ __LDREXH

#define __LDREXH ( ptr)    (*(volatile uint16_t *)(ptr))

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)

◆ __LDREXW

#define __LDREXW ( ptr)    (*(volatile uint32_t *)(ptr))

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)

◆ __STREXB

#define __STREXB ( value,
ptr )   (*(volatile uint8_t *)(ptr) = (value), 0)

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

◆ __STREXH

#define __STREXH ( value,
ptr )   (*(volatile uint16_t *)(ptr) = (value), 0)

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

◆ __STREXW

#define __STREXW ( value,
ptr )   (*(volatile uint32_t *)(ptr) = (value), 0)

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

◆ __CLREX

#define __CLREX

Remove the exclusive lock.

Removes the exclusive lock which is created by LDREX.

◆ __SSAT

#define __SSAT

Signed Saturate.

Saturates a signed value.

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

◆ __USAT

#define __USAT

Unsigned Saturate.

Saturates an unsigned value.

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