libopencm3
A free/libre/open-source firmware library for various ARM Cortex-M3 microcontrollers.
sync.h File Reference
#include "common.h"
Include dependency graph for sync.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define MUTEX_UNLOCKED   0
 
#define MUTEX_LOCKED   1
 

Typedefs

typedef uint32_t mutex_t
 

Functions

void __dmb (void)
 
uint32_t __ldrex (volatile uint32_t *addr)
 
uint32_t __strex (uint32_t val, volatile uint32_t *addr)
 
void mutex_lock (mutex_t *m)
 
uint32_t mutex_trylock (mutex_t *m)
 
void mutex_unlock (mutex_t *m)
 

Macro Definition Documentation

◆ MUTEX_LOCKED

#define MUTEX_LOCKED   1

Definition at line 49 of file sync.h.

◆ MUTEX_UNLOCKED

#define MUTEX_UNLOCKED   0

Definition at line 48 of file sync.h.

Typedef Documentation

◆ mutex_t

typedef uint32_t mutex_t

Definition at line 46 of file sync.h.

Function Documentation

◆ __dmb()

void __dmb ( void  )

Definition at line 23 of file sync.c.

Referenced by mutex_trylock(), and mutex_unlock().

Here is the caller graph for this function:

◆ __ldrex()

uint32_t __ldrex ( volatile uint32_t *  addr)

Definition at line 31 of file sync.c.

Referenced by mutex_trylock().

Here is the caller graph for this function:

◆ __strex()

uint32_t __strex ( uint32_t  val,
volatile uint32_t *  addr 
)

Definition at line 38 of file sync.c.

Referenced by mutex_trylock().

Here is the caller graph for this function:

◆ mutex_lock()

void mutex_lock ( mutex_t m)

Definition at line 46 of file sync.c.

References mutex_trylock().

Here is the call graph for this function:

◆ mutex_trylock()

uint32_t mutex_trylock ( mutex_t m)

Definition at line 52 of file sync.c.

References __dmb(), __ldrex(), __strex(), MUTEX_LOCKED, and MUTEX_UNLOCKED.

Referenced by mutex_lock().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mutex_unlock()

void mutex_unlock ( mutex_t m)

Definition at line 70 of file sync.c.

References __dmb(), and MUTEX_UNLOCKED.

Here is the call graph for this function: