RetroArch
Classes | Macros | Typedefs | Functions
lwp_mutex.h File Reference
#include <gctypes.h>
#include <lwp_threadq.h>
Include dependency graph for lwp_mutex.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  _lwpmutexattr
 
struct  _lwpmutex
 

Macros

#define LWP_MUTEX_LOCKED   0
 
#define LWP_MUTEX_UNLOCKED   1
 
#define LWP_MUTEX_NEST_ACQUIRE   0
 
#define LWP_MUTEX_NEST_ERROR   1
 
#define LWP_MUTEX_NEST_BLOCK   2
 
#define LWP_MUTEX_FIFO   0
 
#define LWP_MUTEX_PRIORITY   1
 
#define LWP_MUTEX_INHERITPRIO   2
 
#define LWP_MUTEX_PRIORITYCEIL   3
 
#define LWP_MUTEX_SUCCESSFUL   0
 
#define LWP_MUTEX_UNSATISFIED_NOWAIT   1
 
#define LWP_MUTEX_NEST_NOTALLOWED   2
 
#define LWP_MUTEX_NOTOWNER   3
 
#define LWP_MUTEX_DELETED   4
 
#define LWP_MUTEX_TIMEOUT   5
 
#define LWP_MUTEX_CEILINGVIOL   6
 
#define __lwp_mutex_seize(_mutex_t, _id, _wait, _timeout, _level)
 

Typedefs

typedef struct _lwpmutexattr lwp_mutex_attr
 
typedef struct _lwpmutex lwp_mutex
 

Functions

void __lwp_mutex_initialize (lwp_mutex *mutex, lwp_mutex_attr *attrs, u32 init_lock)
 
u32 __lwp_mutex_surrender (lwp_mutex *mutex)
 
void __lwp_mutex_seize_irq_blocking (lwp_mutex *mutex, u64 timeout)
 
void __lwp_mutex_flush (lwp_mutex *mutex, u32 status)
 
static __inline__ u32 __lwp_mutex_seize_irq_trylock (lwp_mutex *mutex, u32 *isr_level)
 

Macro Definition Documentation

◆ __lwp_mutex_seize

#define __lwp_mutex_seize (   _mutex_t,
  _id,
  _wait,
  _timeout,
  _level 
)
Value:
do { \
if(__lwp_mutex_seize_irq_trylock(_mutex_t,&_level)) { \
if(!_wait) { \
_CPU_ISR_Restore(_level); \
_thr_executing->wait.ret_code = LWP_MUTEX_UNSATISFIED_NOWAIT; \
} else { \
__lwp_threadqueue_csenter(&(_mutex_t)->wait_queue); \
_thr_executing->wait.queue = &(_mutex_t)->wait_queue; \
_thr_executing->wait.id = _id; \
__lwp_thread_dispatchdisable(); \
_CPU_ISR_Restore(_level); \
__lwp_mutex_seize_irq_blocking(_mutex_t,(u64)_timeout); \
} \
} \
} while(0)
#define LWP_MUTEX_UNSATISFIED_NOWAIT
Definition: lwp_mutex.h:20
static __inline__ u32 __lwp_mutex_seize_irq_trylock(lwp_mutex *mutex, u32 *isr_level)
uint64_t u64
64bit unsigned integer
Definition: gctypes.h:20

◆ LWP_MUTEX_CEILINGVIOL

#define LWP_MUTEX_CEILINGVIOL   6

◆ LWP_MUTEX_DELETED

#define LWP_MUTEX_DELETED   4

◆ LWP_MUTEX_FIFO

#define LWP_MUTEX_FIFO   0

◆ LWP_MUTEX_INHERITPRIO

#define LWP_MUTEX_INHERITPRIO   2

◆ LWP_MUTEX_LOCKED

#define LWP_MUTEX_LOCKED   0

◆ LWP_MUTEX_NEST_ACQUIRE

#define LWP_MUTEX_NEST_ACQUIRE   0

◆ LWP_MUTEX_NEST_BLOCK

#define LWP_MUTEX_NEST_BLOCK   2

◆ LWP_MUTEX_NEST_ERROR

#define LWP_MUTEX_NEST_ERROR   1

◆ LWP_MUTEX_NEST_NOTALLOWED

#define LWP_MUTEX_NEST_NOTALLOWED   2

◆ LWP_MUTEX_NOTOWNER

#define LWP_MUTEX_NOTOWNER   3

◆ LWP_MUTEX_PRIORITY

#define LWP_MUTEX_PRIORITY   1

◆ LWP_MUTEX_PRIORITYCEIL

#define LWP_MUTEX_PRIORITYCEIL   3

◆ LWP_MUTEX_SUCCESSFUL

#define LWP_MUTEX_SUCCESSFUL   0

◆ LWP_MUTEX_TIMEOUT

#define LWP_MUTEX_TIMEOUT   5

◆ LWP_MUTEX_UNLOCKED

#define LWP_MUTEX_UNLOCKED   1

◆ LWP_MUTEX_UNSATISFIED_NOWAIT

#define LWP_MUTEX_UNSATISFIED_NOWAIT   1

Typedef Documentation

◆ lwp_mutex

typedef struct _lwpmutex lwp_mutex

◆ lwp_mutex_attr

typedef struct _lwpmutexattr lwp_mutex_attr

Function Documentation

◆ __lwp_mutex_flush()

void __lwp_mutex_flush ( lwp_mutex mutex,
u32  status 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ __lwp_mutex_initialize()

void __lwp_mutex_initialize ( lwp_mutex mutex,
lwp_mutex_attr attrs,
u32  init_lock 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ __lwp_mutex_seize_irq_blocking()

void __lwp_mutex_seize_irq_blocking ( lwp_mutex mutex,
u64  timeout 
)
Here is the call graph for this function:

◆ __lwp_mutex_seize_irq_trylock()

static __inline__ u32 __lwp_mutex_seize_irq_trylock ( lwp_mutex mutex,
u32 isr_level 
)
static

◆ __lwp_mutex_surrender()

u32 __lwp_mutex_surrender ( lwp_mutex mutex)
Here is the call graph for this function:
Here is the caller graph for this function: