aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorGlenn Elliott <gelliott@cs.unc.edu>2013-02-07 13:07:48 -0500
committerGlenn Elliott <gelliott@cs.unc.edu>2013-02-07 13:07:48 -0500
commit955683d320ad8d3ce232693e8870b134006c7771 (patch)
tree82dbf7baef945595a3eee28985ec5f94e07f9125 /include
parent9aacc135e0abe206b7d778af937babaaa7f3c199 (diff)
Rename RSM Mutex to FIFO Mutex
Diffstat (limited to 'include')
-rw-r--r--include/litmus/fdso.h4
-rw-r--r--include/litmus/fifo_lock.h55
-rw-r--r--include/litmus/rsm_lock.h55
3 files changed, 57 insertions, 57 deletions
diff --git a/include/litmus/fdso.h b/include/litmus/fdso.h
index 1469c0fd0460..e1a0ac24b8a2 100644
--- a/include/litmus/fdso.h
+++ b/include/litmus/fdso.h
@@ -26,7 +26,7 @@ typedef enum {
26 26
27 PCP_SEM = 5, 27 PCP_SEM = 5,
28 28
29 RSM_MUTEX = 6, 29 FIFO_MUTEX = 6,
30 IKGLP_SEM = 7, 30 IKGLP_SEM = 7,
31 KFMLP_SEM = 8, 31 KFMLP_SEM = 8,
32 32
@@ -83,7 +83,7 @@ static inline void* od_lookup(int od, obj_type_t type)
83#define lookup_srp_sem(od) ((struct srp_semaphore*) od_lookup(od, SRP_SEM)) 83#define lookup_srp_sem(od) ((struct srp_semaphore*) od_lookup(od, SRP_SEM))
84#define lookup_ics(od) ((struct ics*) od_lookup(od, ICS_ID)) 84#define lookup_ics(od) ((struct ics*) od_lookup(od, ICS_ID))
85 85
86#define lookup_rsm_mutex(od)((struct litmus_lock*) od_lookup(od, FMLP_SEM)) 86#define lookup_fifo_mutex(od)((struct litmus_lock*) od_lookup(od, FIFO_MUTEX))
87 87
88 88
89#endif 89#endif
diff --git a/include/litmus/fifo_lock.h b/include/litmus/fifo_lock.h
new file mode 100644
index 000000000000..4b970806117f
--- /dev/null
+++ b/include/litmus/fifo_lock.h
@@ -0,0 +1,55 @@
1#ifndef LITMUS_fifo_H
2#define LITMUS_fifo_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 fifo_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 fifo_mutex* fifo_mutex_from_lock(struct litmus_lock* lock)
27{
28 return container_of(lock, struct fifo_mutex, litmus_lock);
29}
30
31#ifdef CONFIG_LITMUS_DGL_SUPPORT
32int fifo_mutex_is_owner(struct litmus_lock *l, struct task_struct *t);
33int fifo_mutex_dgl_lock(struct litmus_lock *l, dgl_wait_state_t* dgl_wait, wait_queue_t* wq_node);
34void fifo_mutex_enable_priority(struct litmus_lock *l, dgl_wait_state_t* dgl_wait);
35#endif
36
37void fifo_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 fifo_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 fifo_mutex_lock(struct litmus_lock* l);
48int fifo_mutex_unlock(struct litmus_lock* l);
49int fifo_mutex_close(struct litmus_lock* l);
50void fifo_mutex_free(struct litmus_lock* l);
51struct litmus_lock* fifo_mutex_new(struct litmus_lock_ops*);
52
53
54#endif
55
diff --git a/include/litmus/rsm_lock.h b/include/litmus/rsm_lock.h
deleted file mode 100644
index f0d263322a69..000000000000
--- a/include/litmus/rsm_lock.h
+++ /dev/null
@@ -1,55 +0,0 @@
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
55