Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
rwsem.h File Reference
#include <linux/linkage.h>
#include <linux/types.h>
#include <linux/kernel.h>
#include <linux/list.h>
#include <linux/spinlock.h>
#include <linux/atomic.h>
#include <asm/rwsem.h>

Go to the source code of this file.

Data Structures

struct  rw_semaphore
 

Macros

#define __RWSEM_DEP_MAP_INIT(lockname)
 
#define __RWSEM_INITIALIZER(name)
 
#define DECLARE_RWSEM(name)   struct rw_semaphore name = __RWSEM_INITIALIZER(name)
 
#define init_rwsem(sem)
 
#define down_read_nested(sem, subclass)   down_read(sem)
 
#define down_write_nested(sem, subclass)   down_write(sem)
 

Functions

struct rw_semaphorerwsem_down_read_failed (struct rw_semaphore *sem)
 
struct rw_semaphorerwsem_down_write_failed (struct rw_semaphore *sem)
 
struct rw_semaphorerwsem_wake (struct rw_semaphore *)
 
struct rw_semaphorerwsem_downgrade_wake (struct rw_semaphore *sem)
 
void __init_rwsem (struct rw_semaphore *sem, const char *name, struct lock_class_key *key)
 
void down_read (struct rw_semaphore *sem)
 
int down_read_trylock (struct rw_semaphore *sem)
 
void down_write (struct rw_semaphore *sem)
 
int down_write_trylock (struct rw_semaphore *sem)
 
void up_read (struct rw_semaphore *sem)
 
void up_write (struct rw_semaphore *sem)
 
void downgrade_write (struct rw_semaphore *sem)
 

Macro Definition Documentation

#define __RWSEM_DEP_MAP_INIT (   lockname)

Definition at line 55 of file rwsem.h.

#define __RWSEM_INITIALIZER (   name)
Value:
__RAW_SPIN_LOCK_UNLOCKED(name.wait_lock), \
LIST_HEAD_INIT((name).wait_list) \
__RWSEM_DEP_MAP_INIT(name) }

Definition at line 58 of file rwsem.h.

#define DECLARE_RWSEM (   name)    struct rw_semaphore name = __RWSEM_INITIALIZER(name)

Definition at line 64 of file rwsem.h.

#define down_read_nested (   sem,
  subclass 
)    down_read(sem)

Definition at line 129 of file rwsem.h.

#define down_write_nested (   sem,
  subclass 
)    down_write(sem)

Definition at line 130 of file rwsem.h.

#define init_rwsem (   sem)
Value:
do { \
static struct lock_class_key __key; \
__init_rwsem((sem), #sem, &__key); \
} while (0)

Definition at line 70 of file rwsem.h.

Function Documentation

void __init_rwsem ( struct rw_semaphore sem,
const char name,
struct lock_class_key key 
)

Definition at line 36 of file rwsem-spinlock.c.

void down_read ( struct rw_semaphore sem)

Definition at line 18 of file rwsem.c.

int down_read_trylock ( struct rw_semaphore sem)

Definition at line 31 of file rwsem.c.

void down_write ( struct rw_semaphore sem)

Definition at line 45 of file rwsem.c.

int down_write_trylock ( struct rw_semaphore sem)

Definition at line 58 of file rwsem.c.

void downgrade_write ( struct rw_semaphore sem)

Definition at line 96 of file rwsem.c.

struct rw_semaphore* rwsem_down_read_failed ( struct rw_semaphore sem)
read

Definition at line 225 of file rwsem.c.

struct rw_semaphore* rwsem_down_write_failed ( struct rw_semaphore sem)
read

Definition at line 234 of file rwsem.c.

struct rw_semaphore* rwsem_downgrade_wake ( struct rw_semaphore sem)
read

Definition at line 264 of file rwsem.c.

struct rw_semaphore* rwsem_wake ( struct rw_semaphore )
read

Definition at line 244 of file rwsem.c.

void up_read ( struct rw_semaphore sem)

Definition at line 72 of file rwsem.c.

void up_write ( struct rw_semaphore sem)

Definition at line 84 of file rwsem.c.