aboutsummaryrefslogtreecommitdiffstats
path: root/include/litmus/rsm_lock.h
diff options
context:
space:
mode:
authorGlenn Elliott <gelliott@cs.unc.edu>2013-01-10 16:21:07 -0500
committerGlenn Elliott <gelliott@cs.unc.edu>2013-01-10 16:21:07 -0500
commit8d00682ce5ddaedfb62287773d21c727f08fda69 (patch)
tree61a4b7bac5960c6f0ab25fe087404e9ca1725e05 /include/litmus/rsm_lock.h
parentfdf0a6b73001976c5d02d631ebdd0927819d7c91 (diff)
parent1235a665a5e00dc762e6646c01381b3ed5019d86 (diff)
Merge branch 'wip-gpu-cleanup' into wip-2012.3-gpu
Conflicts: include/litmus/fpmath.h include/litmus/litmus.h include/litmus/rt_param.h include/litmus/trace.h kernel/sched.c kernel/softirq.c litmus/edf_common.c litmus/jobs.c litmus/litmus.c litmus/locking.c litmus/preempt.c litmus/sched_cedf.c litmus/sched_gsn_edf.c litmus/sched_litmus.c litmus/sync.c
Diffstat (limited to 'include/litmus/rsm_lock.h')
-rw-r--r--include/litmus/rsm_lock.h54
1 files changed, 54 insertions, 0 deletions
diff --git a/include/litmus/rsm_lock.h b/include/litmus/rsm_lock.h
new file mode 100644
index 000000000000..a15189683de4
--- /dev/null
+++ b/include/litmus/rsm_lock.h
@@ -0,0 +1,54 @@
1#ifndef LITMUS_RSM_H
2#define LITMUS_RSM_H
3
4#include <litmus/litmus.h>
5#include <litmus/binheap.h>
6#include <litmus/locking.h>
7
8/* struct for semaphore with priority inheritance */
9struct rsm_mutex {
10 struct litmus_lock litmus_lock;
11
12 /* current resource holder */
13 struct task_struct *owner;
14
15 /* highest-priority waiter */
16 struct task_struct *hp_waiter;
17
18 /* FIFO queue of waiting tasks -- for now. time stamp in the future. */
19 wait_queue_head_t wait;
20
21 /* we do some nesting within spinlocks, so we can't use the normal
22 sleeplocks found in wait_queue_head_t. */
23 raw_spinlock_t lock;
24};
25
26static inline struct rsm_mutex* rsm_mutex_from_lock(struct litmus_lock* lock)
27{
28 return container_of(lock, struct rsm_mutex, litmus_lock);
29}
30
31#ifdef CONFIG_LITMUS_DGL_SUPPORT
32int rsm_mutex_is_owner(struct litmus_lock *l, struct task_struct *t);
33int rsm_mutex_dgl_lock(struct litmus_lock *l, dgl_wait_state_t* dgl_wait, wait_queue_t* wq_node);
34void rsm_mutex_enable_priority(struct litmus_lock *l, dgl_wait_state_t* dgl_wait);
35#endif
36
37void rsm_mutex_propagate_increase_inheritance(struct litmus_lock* l,
38 struct task_struct* t,
39 raw_spinlock_t* to_unlock,
40 unsigned long irqflags);
41
42void rsm_mutex_propagate_decrease_inheritance(struct litmus_lock* l,
43 struct task_struct* t,
44 raw_spinlock_t* to_unlock,
45 unsigned long irqflags);
46
47int rsm_mutex_lock(struct litmus_lock* l);
48int rsm_mutex_unlock(struct litmus_lock* l);
49int rsm_mutex_close(struct litmus_lock* l);
50void rsm_mutex_free(struct litmus_lock* l);
51struct litmus_lock* rsm_mutex_new(struct litmus_lock_ops*);
52
53
54#endif \ No newline at end of file