Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions | Variables
rtmutex.c File Reference
#include <linux/spinlock.h>
#include <linux/export.h>
#include <linux/sched.h>
#include <linux/timer.h>
#include "rtmutex_common.h"

Go to the source code of this file.

Macros

#define rt_mutex_cmpxchg(l, c, n)   (0)
 

Functions

int rt_mutex_getprio (struct task_struct *task)
 
void rt_mutex_adjust_pi (struct task_struct *task)
 
void __sched rt_mutex_lock (struct rt_mutex *lock)
 
 EXPORT_SYMBOL_GPL (rt_mutex_lock)
 
int __sched rt_mutex_lock_interruptible (struct rt_mutex *lock, int detect_deadlock)
 
 EXPORT_SYMBOL_GPL (rt_mutex_lock_interruptible)
 
int rt_mutex_timed_lock (struct rt_mutex *lock, struct hrtimer_sleeper *timeout, int detect_deadlock)
 
 EXPORT_SYMBOL_GPL (rt_mutex_timed_lock)
 
int __sched rt_mutex_trylock (struct rt_mutex *lock)
 
 EXPORT_SYMBOL_GPL (rt_mutex_trylock)
 
void __sched rt_mutex_unlock (struct rt_mutex *lock)
 
 EXPORT_SYMBOL_GPL (rt_mutex_unlock)
 
void rt_mutex_destroy (struct rt_mutex *lock)
 
 EXPORT_SYMBOL_GPL (rt_mutex_destroy)
 
void __rt_mutex_init (struct rt_mutex *lock, const char *name)
 
 EXPORT_SYMBOL_GPL (__rt_mutex_init)
 
void rt_mutex_init_proxy_locked (struct rt_mutex *lock, struct task_struct *proxy_owner)
 
void rt_mutex_proxy_unlock (struct rt_mutex *lock, struct task_struct *proxy_owner)
 
int rt_mutex_start_proxy_lock (struct rt_mutex *lock, struct rt_mutex_waiter *waiter, struct task_struct *task, int detect_deadlock)
 
struct task_structrt_mutex_next_owner (struct rt_mutex *lock)
 
int rt_mutex_finish_proxy_lock (struct rt_mutex *lock, struct hrtimer_sleeper *to, struct rt_mutex_waiter *waiter, int detect_deadlock)
 

Variables

int max_lock_depth = 1024
 

Macro Definition Documentation

#define rt_mutex_cmpxchg (   l,
  c,
  n 
)    (0)

Definition at line 85 of file rtmutex.c.

Function Documentation

void __rt_mutex_init ( struct rt_mutex lock,
const char name 
)

__rt_mutex_init - initialize the rt lock

: the rt lock to be initialized

Initialize the rt lock to unlocked state.

Initializing of a locked rt lock is not allowed

Definition at line 889 of file rtmutex.c.

EXPORT_SYMBOL_GPL ( rt_mutex_lock  )
EXPORT_SYMBOL_GPL ( rt_mutex_lock_interruptible  )
EXPORT_SYMBOL_GPL ( rt_mutex_timed_lock  )
EXPORT_SYMBOL_GPL ( rt_mutex_trylock  )
EXPORT_SYMBOL_GPL ( rt_mutex_unlock  )
EXPORT_SYMBOL_GPL ( rt_mutex_destroy  )
EXPORT_SYMBOL_GPL ( __rt_mutex_init  )
void rt_mutex_adjust_pi ( struct task_struct task)

Definition at line 546 of file rtmutex.c.

void rt_mutex_destroy ( struct rt_mutex lock)

rt_mutex_destroy - mark a mutex unusable : the mutex to be destroyed

This function marks the mutex uninitialized, and any subsequent use of the mutex is forbidden. The mutex must not be locked when this function is called.

Definition at line 870 of file rtmutex.c.

int rt_mutex_finish_proxy_lock ( struct rt_mutex lock,
struct hrtimer_sleeper to,
struct rt_mutex_waiter waiter,
int  detect_deadlock 
)

rt_mutex_finish_proxy_lock() - Complete lock acquisition : the rt_mutex we were woken on : the timeout, null if none. hrtimer should already have been started. : the pre-initialized rt_mutex_waiter : perform deadlock detection (1) or not (0)

Complete the lock acquisition started our behalf by another thread.

Returns: 0 - success <0 - error, one of -EINTR, -ETIMEDOUT, or -EDEADLK

Special API call for PI-futex requeue support

Definition at line 1019 of file rtmutex.c.

int rt_mutex_getprio ( struct task_struct task)

Definition at line 99 of file rtmutex.c.

void rt_mutex_init_proxy_locked ( struct rt_mutex lock,
struct task_struct proxy_owner 
)

rt_mutex_init_proxy_locked - initialize and lock a rt_mutex on behalf of a proxy owner

: the rt_mutex to be locked :the task to set as owner

No locking. Caller has to do serializing itself Special API call for PI-futex support

Definition at line 909 of file rtmutex.c.

void __sched rt_mutex_lock ( struct rt_mutex lock)

rt_mutex_lock - lock a rt_mutex

: the rt_mutex to be locked

Definition at line 783 of file rtmutex.c.

int __sched rt_mutex_lock_interruptible ( struct rt_mutex lock,
int  detect_deadlock 
)

rt_mutex_lock_interruptible - lock a rt_mutex interruptible

: the rt_mutex to be locked : deadlock detection on/off

Returns: 0 on success -EINTR when interrupted by a signal -EDEADLK when the lock would deadlock (when deadlock detection is on)

Definition at line 802 of file rtmutex.c.

struct task_struct* rt_mutex_next_owner ( struct rt_mutex lock)
read

rt_mutex_next_owner - return the next owner of the lock

: the rt lock query

Returns the next owner of the lock or NULL

Caller has to serialize against other accessors to the lock itself.

Special API call for PI-futex support

Definition at line 995 of file rtmutex.c.

void rt_mutex_proxy_unlock ( struct rt_mutex lock,
struct task_struct proxy_owner 
)

rt_mutex_proxy_unlock - release a lock on behalf of owner

: the rt_mutex to be locked

No locking. Caller has to do serializing itself Special API call for PI-futex support

Definition at line 926 of file rtmutex.c.

int rt_mutex_start_proxy_lock ( struct rt_mutex lock,
struct rt_mutex_waiter waiter,
struct task_struct task,
int  detect_deadlock 
)

rt_mutex_start_proxy_lock() - Start lock acquisition for another task : the rt_mutex to take : the pre-initialized rt_mutex_waiter : the task to prepare : perform deadlock detection (1) or not (0)

Returns: 0 - task blocked on lock 1 - acquired the lock for task, caller should wake it up <0 - error

Special API call for FUTEX_REQUEUE_PI support.

Definition at line 948 of file rtmutex.c.

int rt_mutex_timed_lock ( struct rt_mutex lock,
struct hrtimer_sleeper timeout,
int  detect_deadlock 
)

rt_mutex_timed_lock - lock a rt_mutex interruptible the timeout structure is provided by the caller

: the rt_mutex to be locked : timeout structure or NULL (no timeout) : deadlock detection on/off

Returns: 0 on success -EINTR when interrupted by a signal -ETIMEDOUT when the timeout expired -EDEADLK when the lock would deadlock (when deadlock detection is on)

Definition at line 828 of file rtmutex.c.

int __sched rt_mutex_trylock ( struct rt_mutex lock)

rt_mutex_trylock - try to lock a rt_mutex

: the rt_mutex to be locked

Returns 1 on success and 0 on contention

Definition at line 845 of file rtmutex.c.

void __sched rt_mutex_unlock ( struct rt_mutex lock)

rt_mutex_unlock - unlock a rt_mutex

: the rt_mutex to be unlocked

Definition at line 856 of file rtmutex.c.

Variable Documentation

int max_lock_depth = 1024

Definition at line 142 of file rtmutex.c.