hc
2023-11-07 f45e756958099c35d6afb746df1d40a1c6302cfc
kernel/include/linux/swait.h
....@@ -160,7 +160,9 @@
160160 extern void swake_up_one(struct swait_queue_head *q);
161161 extern void swake_up_all(struct swait_queue_head *q);
162162 extern void swake_up_locked(struct swait_queue_head *q);
163
+extern void swake_up_all_locked(struct swait_queue_head *q);
163164
165
+extern void __prepare_to_swait(struct swait_queue_head *q, struct swait_queue *wait);
164166 extern void prepare_to_swait_exclusive(struct swait_queue_head *q, struct swait_queue *wait, int state);
165167 extern long prepare_to_swait_event(struct swait_queue_head *q, struct swait_queue *wait, int state);
166168
....@@ -297,4 +299,18 @@
297299 __ret; \
298300 })
299301
302
+#define __swait_event_lock_irq(wq, condition, lock, cmd) \
303
+ ___swait_event(wq, condition, TASK_UNINTERRUPTIBLE, 0, \
304
+ raw_spin_unlock_irq(&lock); \
305
+ cmd; \
306
+ schedule(); \
307
+ raw_spin_lock_irq(&lock))
308
+
309
+#define swait_event_lock_irq(wq_head, condition, lock) \
310
+ do { \
311
+ if (condition) \
312
+ break; \
313
+ __swait_event_lock_irq(wq_head, condition, lock, ); \
314
+ } while (0)
315
+
300316 #endif /* _LINUX_SWAIT_H */