Xenomai  3.0.5
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_get_irqsave(__lock, __context)   ((__context) = __rtdm_lock_get_irqsave(__lock))
 Acquire lock and disable preemption, by stalling the head domain. More...
 
#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

◆ rtdm_lock_get_irqsave

#define rtdm_lock_get_irqsave (   __lock,
  __context 
)    ((__context) = __rtdm_lock_get_irqsave(__lock))

Acquire lock and disable preemption, by stalling the head domain.

Parameters
__lockAddress of lock variable
__contextname of local variable to store the context in
Tags
unrestricted

Referenced by rtdm_ratelimit().

◆ rtdm_lock_irqrestore

#define rtdm_lock_irqrestore (   __context)    splexit(__context)

Restore preemption state.

Parameters
__contextname of local variable which stored the context
Tags
unrestricted

◆ rtdm_lock_irqsave

#define rtdm_lock_irqsave (   __context)    splhigh(__context)

Disable preemption locally.

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

Function Documentation

◆ rtdm_lock_get()

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.

◆ rtdm_lock_init()

static void rtdm_lock_init ( rtdm_lock_t lock)
inlinestatic

Dynamic lock initialisation.

Parameters
lockAddress of lock variable
Tags
task-unrestricted

◆ rtdm_lock_put()

static void rtdm_lock_put ( rtdm_lock_t lock)
inlinestatic

Release lock without preemption restoration.

Parameters
lockAddress of lock variable
Tags
unrestricted, might-switch

◆ rtdm_lock_put_irqrestore()

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().