diff options
author | Glenn Elliott <gelliott@cs.unc.edu> | 2013-02-07 13:07:48 -0500 |
---|---|---|
committer | Glenn Elliott <gelliott@cs.unc.edu> | 2013-02-07 13:07:48 -0500 |
commit | 955683d320ad8d3ce232693e8870b134006c7771 (patch) | |
tree | 82dbf7baef945595a3eee28985ec5f94e07f9125 /include | |
parent | 9aacc135e0abe206b7d778af937babaaa7f3c199 (diff) |
Rename RSM Mutex to FIFO Mutex
Diffstat (limited to 'include')
-rw-r--r-- | include/litmus/fdso.h | 4 | ||||
-rw-r--r-- | include/litmus/fifo_lock.h | 55 | ||||
-rw-r--r-- | include/litmus/rsm_lock.h | 55 |
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 */ | ||
9 | struct 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 | |||
26 | static 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 | ||
32 | int fifo_mutex_is_owner(struct litmus_lock *l, struct task_struct *t); | ||
33 | int fifo_mutex_dgl_lock(struct litmus_lock *l, dgl_wait_state_t* dgl_wait, wait_queue_t* wq_node); | ||
34 | void fifo_mutex_enable_priority(struct litmus_lock *l, dgl_wait_state_t* dgl_wait); | ||
35 | #endif | ||
36 | |||
37 | void 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 | |||
42 | void 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 | |||
47 | int fifo_mutex_lock(struct litmus_lock* l); | ||
48 | int fifo_mutex_unlock(struct litmus_lock* l); | ||
49 | int fifo_mutex_close(struct litmus_lock* l); | ||
50 | void fifo_mutex_free(struct litmus_lock* l); | ||
51 | struct 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 */ | ||
9 | struct 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 | |||
26 | static 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 | ||
32 | int rsm_mutex_is_owner(struct litmus_lock *l, struct task_struct *t); | ||
33 | int rsm_mutex_dgl_lock(struct litmus_lock *l, dgl_wait_state_t* dgl_wait, wait_queue_t* wq_node); | ||
34 | void rsm_mutex_enable_priority(struct litmus_lock *l, dgl_wait_state_t* dgl_wait); | ||
35 | #endif | ||
36 | |||
37 | void 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 | |||
42 | void 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 | |||
47 | int rsm_mutex_lock(struct litmus_lock* l); | ||
48 | int rsm_mutex_unlock(struct litmus_lock* l); | ||
49 | int rsm_mutex_close(struct litmus_lock* l); | ||
50 | void rsm_mutex_free(struct litmus_lock* l); | ||
51 | struct litmus_lock* rsm_mutex_new(struct litmus_lock_ops*); | ||
52 | |||
53 | |||
54 | #endif | ||
55 | |||