Xenomai  3.0-rc7
Spinlock with preemption deactivation
Collaboration diagram for Spinlock with preemption deactivation:

Macros

#define RTDM_LOCK_UNLOCKED(__name)   IPIPE_SPIN_LOCK_UNLOCKED
 Static lock initialisation.
 
#define rtdm_lock_irqsave(context)   splhigh(context)
 Disable preemption locally. More...
 
#define rtdm_lock_irqrestore(context)   splexit(context)
 Restore preemption state. More...
 

Typedefs

typedef ipipe_spinlock_t rtdm_lock_t
 Lock variable.
 
typedef unsigned long rtdm_lockctx_t
 Variable to save the context while holding a lock.
 

Functions

static void rtdm_lock_init (rtdm_lock_t *lock)
 Dynamic lock initialisation. More...
 
static void rtdm_lock_get (rtdm_lock_t *lock)
 Acquire lock from non-preemptible contexts. More...
 
static void rtdm_lock_put (rtdm_lock_t *lock)
 Release lock without preemption restoration. More...
 
static void rtdm_lock_put_irqrestore (rtdm_lock_t *lock, rtdm_lockctx_t context)
 Release lock and restore preemption state. More...
 

Detailed Description

Macro Definition Documentation

#define rtdm_lock_irqrestore (   context)    splexit(context)

Restore preemption state.

Parameters
contextname of local variable which stored the context
Tags
unrestricted
#define rtdm_lock_irqsave (   context)    splhigh(context)

Disable preemption locally.

Parameters
contextname of local variable to store the context in
Tags
unrestricted

Function Documentation

static void rtdm_lock_get ( rtdm_lock_t lock)
inlinestatic

Acquire lock from non-preemptible contexts.

Parameters
lockAddress of lock variable
Tags
unrestricted

References spltest.

static void rtdm_lock_init ( rtdm_lock_t lock)
inlinestatic

Dynamic lock initialisation.

Parameters
lockAddress of lock variable
Tags
task-unrestricted
static void rtdm_lock_put ( rtdm_lock_t lock)
inlinestatic

Release lock without preemption restoration.

Parameters
lockAddress of lock variable
Tags
unrestricted, might-switch
static void rtdm_lock_put_irqrestore ( rtdm_lock_t lock,
rtdm_lockctx_t  context 
)
inlinestatic

Release lock and restore preemption state.

Parameters
lockAddress of lock variable
contextname of local variable which stored the context
Tags
unrestricted

Referenced by rtdm_ratelimit().