FD.io VPP  v21.06-3-gbb25fbf28
Vector Packet Processing
lock.h File Reference
+ Include dependency graph for lock.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  clib_spinlock_s
 
struct  clib_rw_lock_
 

Macros

#define CLIB_PAUSE()   __builtin_ia32_pause ()
 
#define CLIB_LOCK_DBG(_p)
 
#define CLIB_LOCK_DBG_CLEAR(_p)
 
#define CLIB_SPINLOCK_IS_LOCKED(_p)   (*(_p))->lock
 
#define CLIB_SPINLOCK_ASSERT_LOCKED(_p)   ASSERT(CLIB_SPINLOCK_IS_LOCKED((_p)))
 

Typedefs

typedef struct clib_spinlock_sclib_spinlock_t
 
typedef struct clib_rw_lock_clib_rwlock_t
 

Functions

static void clib_spinlock_init (clib_spinlock_t *p)
 
static void clib_spinlock_free (clib_spinlock_t *p)
 
static_always_inline void clib_spinlock_lock (clib_spinlock_t *p)
 
static_always_inline int clib_spinlock_trylock (clib_spinlock_t *p)
 
static_always_inline void clib_spinlock_lock_if_init (clib_spinlock_t *p)
 
static_always_inline int clib_spinlock_trylock_if_init (clib_spinlock_t *p)
 
static_always_inline void clib_spinlock_unlock (clib_spinlock_t *p)
 
static_always_inline void clib_spinlock_unlock_if_init (clib_spinlock_t *p)
 
static void clib_rwlock_init (clib_rwlock_t *p)
 
static void clib_rwlock_free (clib_rwlock_t *p)
 
static void clib_rwlock_reader_lock (clib_rwlock_t *p)
 
static void clib_rwlock_reader_unlock (clib_rwlock_t *p)
 
static void clib_rwlock_writer_lock (clib_rwlock_t *p)
 
static void clib_rwlock_writer_unlock (clib_rwlock_t *p)
 

Macro Definition Documentation

◆ CLIB_LOCK_DBG

#define CLIB_LOCK_DBG (   _p)

Definition at line 44 of file lock.h.

◆ CLIB_LOCK_DBG_CLEAR

#define CLIB_LOCK_DBG_CLEAR (   _p)

Definition at line 45 of file lock.h.

◆ CLIB_PAUSE

#define CLIB_PAUSE ( )    __builtin_ia32_pause ()

Definition at line 23 of file lock.h.

◆ CLIB_SPINLOCK_ASSERT_LOCKED

#define CLIB_SPINLOCK_ASSERT_LOCKED (   _p)    ASSERT(CLIB_SPINLOCK_IS_LOCKED((_p)))

Definition at line 49 of file lock.h.

◆ CLIB_SPINLOCK_IS_LOCKED

#define CLIB_SPINLOCK_IS_LOCKED (   _p)    (*(_p))->lock

Definition at line 48 of file lock.h.

Typedef Documentation

◆ clib_rwlock_t

typedef struct clib_rw_lock_ * clib_rwlock_t

◆ clib_spinlock_t

Definition at line 62 of file lock.h.

Function Documentation

◆ clib_rwlock_free()

static void clib_rwlock_free ( clib_rwlock_t p)
inlinestatic

Definition at line 159 of file lock.h.

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

◆ clib_rwlock_init()

static void clib_rwlock_init ( clib_rwlock_t p)
inlinestatic

Definition at line 152 of file lock.h.

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

◆ clib_rwlock_reader_lock()

static void clib_rwlock_reader_lock ( clib_rwlock_t p)
inlinestatic

Definition at line 169 of file lock.h.

+ Here is the caller graph for this function:

◆ clib_rwlock_reader_unlock()

static void clib_rwlock_reader_unlock ( clib_rwlock_t p)
inlinestatic

Definition at line 184 of file lock.h.

+ Here is the caller graph for this function:

◆ clib_rwlock_writer_lock()

static void clib_rwlock_writer_lock ( clib_rwlock_t p)
inlinestatic

Definition at line 192 of file lock.h.

+ Here is the caller graph for this function:

◆ clib_rwlock_writer_unlock()

static void clib_rwlock_writer_unlock ( clib_rwlock_t p)
inlinestatic

Definition at line 206 of file lock.h.

+ Here is the caller graph for this function:

◆ clib_spinlock_free()

static void clib_spinlock_free ( clib_spinlock_t p)
inlinestatic

Definition at line 72 of file lock.h.

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

◆ clib_spinlock_init()

static void clib_spinlock_init ( clib_spinlock_t p)
inlinestatic

Definition at line 65 of file lock.h.

+ Here is the call graph for this function:

◆ clib_spinlock_lock()

static_always_inline void clib_spinlock_lock ( clib_spinlock_t p)

Definition at line 82 of file lock.h.

+ Here is the call graph for this function:

◆ clib_spinlock_lock_if_init()

static_always_inline void clib_spinlock_lock_if_init ( clib_spinlock_t p)

Definition at line 106 of file lock.h.

+ Here is the call graph for this function:

◆ clib_spinlock_trylock()

static_always_inline int clib_spinlock_trylock ( clib_spinlock_t p)

Definition at line 97 of file lock.h.

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

◆ clib_spinlock_trylock_if_init()

static_always_inline int clib_spinlock_trylock_if_init ( clib_spinlock_t p)

Definition at line 113 of file lock.h.

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

◆ clib_spinlock_unlock()

static_always_inline void clib_spinlock_unlock ( clib_spinlock_t p)

Definition at line 121 of file lock.h.

◆ clib_spinlock_unlock_if_init()

static_always_inline void clib_spinlock_unlock_if_init ( clib_spinlock_t p)

Definition at line 129 of file lock.h.

+ Here is the call graph for this function: