Lines Matching +full:a +full:- +full:bit
1 /* SPDX-License-Identifier: GPL-2.0 */
6 * Linux wait-bit related types and methods:
21 #define __WAIT_BIT_KEY_INITIALIZER(word, bit) \ argument
22 { .flags = word, .bit_nr = bit, }
26 void __wake_up_bit(struct wait_queue_head *wq_head, void *word, int bit);
29 void wake_up_bit(void *word, int bit);
33 struct wait_queue_head *bit_waitqueue(void *word, int bit);
38 #define DEFINE_WAIT_BIT(name, word, bit) \ argument
40 .key = __WAIT_BIT_KEY_INITIALIZER(word, bit), \
55 * wait_on_bit - wait for a bit to be cleared
56 * @word: the word being waited on, a kernel virtual address
57 * @bit: the bit of the word being waited on
60 * There is a standard hashed waitqueue table for generic use. This
61 * is the part of the hashtable's accessor API that waits on a bit.
62 * For instance, if one were to have waiters on a bitflag, one would
63 * call wait_on_bit() in threads waiting for the bit to clear.
64 * One uses wait_on_bit() where one is waiting for the bit to clear,
66 * Returned value will be zero if the bit was cleared, or non-zero
67 * if the process received a signal and the mode permitted wakeup
71 wait_on_bit(unsigned long *word, int bit, unsigned mode) in wait_on_bit() argument
74 if (!test_bit_acquire(bit, word)) in wait_on_bit()
76 return out_of_line_wait_on_bit(word, bit, in wait_on_bit()
82 * wait_on_bit_io - wait for a bit to be cleared
83 * @word: the word being waited on, a kernel virtual address
84 * @bit: the bit of the word being waited on
87 * Use the standard hashed waitqueue table to wait for a bit
91 * Returned value will be zero if the bit was cleared, or non-zero
92 * if the process received a signal and the mode permitted wakeup
96 wait_on_bit_io(unsigned long *word, int bit, unsigned mode) in wait_on_bit_io() argument
99 if (!test_bit_acquire(bit, word)) in wait_on_bit_io()
101 return out_of_line_wait_on_bit(word, bit, in wait_on_bit_io()
107 * wait_on_bit_timeout - wait for a bit to be cleared or a timeout elapses
108 * @word: the word being waited on, a kernel virtual address
109 * @bit: the bit of the word being waited on
113 * Use the standard hashed waitqueue table to wait for a bit
114 * to be cleared. This is similar to wait_on_bit(), except also takes a
117 * Returned value will be zero if the bit was cleared before the
118 * @timeout elapsed, or non-zero if the @timeout elapsed or process
119 * received a signal and the mode permitted wakeup on that signal.
122 wait_on_bit_timeout(unsigned long *word, int bit, unsigned mode, in wait_on_bit_timeout() argument
126 if (!test_bit_acquire(bit, word)) in wait_on_bit_timeout()
128 return out_of_line_wait_on_bit_timeout(word, bit, in wait_on_bit_timeout()
134 * wait_on_bit_action - wait for a bit to be cleared
135 * @word: the word being waited on, a kernel virtual address
136 * @bit: the bit of the word being waited on
140 * Use the standard hashed waitqueue table to wait for a bit
145 * Returned value will be zero if the bit was cleared, or non-zero
146 * if the process received a signal and the mode permitted wakeup
150 wait_on_bit_action(unsigned long *word, int bit, wait_bit_action_f *action, in wait_on_bit_action() argument
154 if (!test_bit_acquire(bit, word)) in wait_on_bit_action()
156 return out_of_line_wait_on_bit(word, bit, action, mode); in wait_on_bit_action()
160 * wait_on_bit_lock - wait for a bit to be cleared, when wanting to set it
161 * @word: the word being waited on, a kernel virtual address
162 * @bit: the bit of the word being waited on
165 * There is a standard hashed waitqueue table for generic use. This
166 * is the part of the hashtable's accessor API that waits on a bit
170 * wait_on_bit() in threads waiting to be able to set the bit.
171 * One uses wait_on_bit_lock() where one is waiting for the bit to
174 * Returns zero if the bit was (eventually) found to be clear and was
175 * set. Returns non-zero if a signal was delivered to the process and
179 wait_on_bit_lock(unsigned long *word, int bit, unsigned mode) in wait_on_bit_lock() argument
182 if (!test_and_set_bit(bit, word)) in wait_on_bit_lock()
184 return out_of_line_wait_on_bit_lock(word, bit, bit_wait, mode); in wait_on_bit_lock()
188 * wait_on_bit_lock_io - wait for a bit to be cleared, when wanting to set it
189 * @word: the word being waited on, a kernel virtual address
190 * @bit: the bit of the word being waited on
193 * Use the standard hashed waitqueue table to wait for a bit
198 * Returns zero if the bit was (eventually) found to be clear and was
199 * set. Returns non-zero if a signal was delivered to the process and
203 wait_on_bit_lock_io(unsigned long *word, int bit, unsigned mode) in wait_on_bit_lock_io() argument
206 if (!test_and_set_bit(bit, word)) in wait_on_bit_lock_io()
208 return out_of_line_wait_on_bit_lock(word, bit, bit_wait_io, mode); in wait_on_bit_lock_io()
212 * wait_on_bit_lock_action - wait for a bit to be cleared, when wanting to set it
213 * @word: the word being waited on, a kernel virtual address
214 * @bit: the bit of the word being waited on
218 * Use the standard hashed waitqueue table to wait for a bit
224 * Returns zero if the bit was (eventually) found to be clear and was
225 * set. Returns non-zero if a signal was delivered to the process and
229 wait_on_bit_lock_action(unsigned long *word, int bit, wait_bit_action_f *action, in wait_on_bit_lock_action() argument
233 if (!test_and_set_bit(bit, word)) in wait_on_bit_lock_action()
235 return out_of_line_wait_on_bit_lock(word, bit, action, mode); in wait_on_bit_lock_action()
322 * clear_and_wake_up_bit - clear a bit and wake up anyone waiting on that bit
324 * @bit: the bit of the word being waited on
325 * @word: the word being waited on, a kernel virtual address
328 * non-atomically under a lock.
330 static inline void clear_and_wake_up_bit(int bit, void *word) in clear_and_wake_up_bit() argument
332 clear_bit_unlock(bit, word); in clear_and_wake_up_bit()
335 wake_up_bit(word, bit); in clear_and_wake_up_bit()