'\" t .\" Title: wait_on_bit_lock .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 .\" Date: January 2017 .\" Manual: Driver Basics .\" Source: Kernel Hackers Manual 4.8.15 .\" Language: English .\" .TH "WAIT_ON_BIT_LOCK" "9" "January 2017" "Kernel Hackers Manual 4\&.8\&." "Driver Basics" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" wait_on_bit_lock \- wait for a bit to be cleared, when wanting to set it .SH "SYNOPSIS" .HP \w'int\ wait_on_bit_lock('u .BI "int wait_on_bit_lock(unsigned\ long\ *\ " "word" ", int\ " "bit" ", unsigned\ " "mode" ");" .SH "ARGUMENTS" .PP \fIword\fR .RS 4 the word being waited on, a kernel virtual address .RE .PP \fIbit\fR .RS 4 the bit of the word being waited on .RE .PP \fImode\fR .RS 4 the task state to sleep in .RE .SH "DESCRIPTION" .PP There is a standard hashed waitqueue table for generic use\&. This is the part of the hashtable\*(Aqs accessor API that waits on a bit when one intends to set it, for instance, trying to lock bitflags\&. For instance, if one were to have waiters trying to set bitflag and waiting for it to clear before setting it, one would call \fBwait_on_bit\fR in threads waiting to be able to set the bit\&. One uses \fBwait_on_bit_lock\fR where one is waiting for the bit to clear with the intention of setting it, and when done, clearing it\&. .PP Returns zero if the bit was (eventually) found to be clear and was set\&. Returns non\-zero if a signal was delivered to the process and the \fImode\fR allows that signal to wake the process\&. .SH "COPYRIGHT" .br