diff options
Diffstat (limited to 'include/litmus/locking.h')
-rw-r--r-- | include/litmus/locking.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/include/litmus/locking.h b/include/litmus/locking.h index 4a5f198a0407..22f7372bf621 100644 --- a/include/litmus/locking.h +++ b/include/litmus/locking.h | |||
@@ -24,6 +24,11 @@ static inline struct task_struct* top_priority(struct binheap* handle) { | |||
24 | void print_hp_waiters(struct binheap_node* n, int depth); | 24 | void print_hp_waiters(struct binheap_node* n, int depth); |
25 | #endif | 25 | #endif |
26 | 26 | ||
27 | #define LOCK_NAME_LEN 16 | ||
28 | struct litmus_lock_proc_ops { | ||
29 | void (*add)(struct litmus_lock *l); | ||
30 | void (*remove)(struct litmus_lock *l); | ||
31 | }; | ||
27 | 32 | ||
28 | /* Generic base struct for LITMUS^RT userspace semaphores. | 33 | /* Generic base struct for LITMUS^RT userspace semaphores. |
29 | * This structure should be embedded in protocol-specific semaphores. | 34 | * This structure should be embedded in protocol-specific semaphores. |
@@ -41,6 +46,10 @@ struct litmus_lock { | |||
41 | struct lock_class_key key; | 46 | struct lock_class_key key; |
42 | //#endif | 47 | //#endif |
43 | #endif | 48 | #endif |
49 | |||
50 | struct litmus_lock_proc_ops *proc; | ||
51 | struct proc_dir_entry *proc_entry; | ||
52 | char name[LOCK_NAME_LEN]; | ||
44 | }; | 53 | }; |
45 | 54 | ||
46 | #ifdef CONFIG_LITMUS_DGL_SUPPORT | 55 | #ifdef CONFIG_LITMUS_DGL_SUPPORT |
@@ -131,12 +140,16 @@ struct litmus_lock_ops { | |||
131 | /* DGL requires a big lock to implement nested inheritance */ | 140 | /* DGL requires a big lock to implement nested inheritance */ |
132 | #define lock_global_irqsave(lock, flags) raw_spin_lock_irqsave((lock), (flags)) | 141 | #define lock_global_irqsave(lock, flags) raw_spin_lock_irqsave((lock), (flags)) |
133 | #define lock_global(lock) raw_spin_lock((lock)) | 142 | #define lock_global(lock) raw_spin_lock((lock)) |
143 | #define trylock_global_irqsave(lock, flags) raw_spin_trylock_irqsave((lock), (flags)) | ||
144 | #define trylock_global(lock) raw_spin_trylock((lock)) | ||
134 | #define unlock_global_irqrestore(lock, flags) raw_spin_unlock_irqrestore((lock), (flags)) | 145 | #define unlock_global_irqrestore(lock, flags) raw_spin_unlock_irqrestore((lock), (flags)) |
135 | #define unlock_global(lock) raw_spin_unlock((lock)) | 146 | #define unlock_global(lock) raw_spin_unlock((lock)) |
136 | 147 | ||
137 | /* fine-grain locking are no-ops with DGL support */ | 148 | /* fine-grain locking are no-ops with DGL support */ |
138 | #define lock_fine_irqsave(lock, flags) | 149 | #define lock_fine_irqsave(lock, flags) |
139 | #define lock_fine(lock) | 150 | #define lock_fine(lock) |
151 | #define trylock_fine_irqsave(lock, flags) | ||
152 | #define trylock_fine(lock) | ||
140 | #define unlock_fine_irqrestore(lock, flags) | 153 | #define unlock_fine_irqrestore(lock, flags) |
141 | #define unlock_fine(lock) | 154 | #define unlock_fine(lock) |
142 | 155 | ||
@@ -145,11 +158,15 @@ struct litmus_lock_ops { | |||
145 | /* global locking are no-ops without DGL support */ | 158 | /* global locking are no-ops without DGL support */ |
146 | #define lock_global_irqsave(lock, flags) | 159 | #define lock_global_irqsave(lock, flags) |
147 | #define lock_global(lock) | 160 | #define lock_global(lock) |
161 | #define trylock_global_irqsave(lock, flags) | ||
162 | #define trylock_global(lock) | ||
148 | #define unlock_global_irqrestore(lock, flags) | 163 | #define unlock_global_irqrestore(lock, flags) |
149 | #define unlock_global(lock) | 164 | #define unlock_global(lock) |
150 | 165 | ||
151 | #define lock_fine_irqsave(lock, flags) raw_spin_lock_irqsave((lock), (flags)) | 166 | #define lock_fine_irqsave(lock, flags) raw_spin_lock_irqsave((lock), (flags)) |
152 | #define lock_fine(lock) raw_spin_lock((lock)) | 167 | #define lock_fine(lock) raw_spin_lock((lock)) |
168 | #define trylock_fine_irqsave(lock, flags) raw_spin_trylock_irqsave((lock), (flags)) | ||
169 | #define trylock_fine(lock) raw_spin_trylock((lock)) | ||
153 | #define unlock_fine_irqrestore(lock, flags) raw_spin_unlock_irqrestore((lock), (flags)) | 170 | #define unlock_fine_irqrestore(lock, flags) raw_spin_unlock_irqrestore((lock), (flags)) |
154 | #define unlock_fine(lock) raw_spin_unlock((lock)) | 171 | #define unlock_fine(lock) raw_spin_unlock((lock)) |
155 | 172 | ||