'\" t .\" Title: fence_add_callback .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 .\" Date: January 2017 .\" Manual: Device drivers infrastructure .\" Source: Kernel Hackers Manual 4.8.15 .\" Language: English .\" .TH "FENCE_ADD_CALLBACK" "9" "January 2017" "Kernel Hackers Manual 4\&.8\&." "Device drivers infrastructure" .\" ----------------------------------------------------------------- .\" * 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" fence_add_callback \- add a callback to be called when the fence is signaled .SH "SYNOPSIS" .HP \w'int\ fence_add_callback('u .BI "int fence_add_callback(struct\ fence\ *\ " "fence" ", struct\ fence_cb\ *\ " "cb" ", fence_func_t\ " "func" ");" .SH "ARGUMENTS" .PP \fIfence\fR .RS 4 [in] the fence to wait on .RE .PP \fIcb\fR .RS 4 [in] the callback to register .RE .PP \fIfunc\fR .RS 4 [in] the function to call .RE .SH "DESCRIPTION" .PP cb will be initialized by fence_add_callback, no initialization by the caller is required\&. Any number of callbacks can be registered to a fence, but a callback can only be registered to one fence at a time\&. .PP Note that the callback can be called from an atomic context\&. If fence is already signaled, this function will return \-ENOENT (and *not* call the callback) .PP Add a software callback to the fence\&. Same restrictions apply to refcount as it does to fence_wait, however the caller doesn\*(Aqt need to keep a refcount to fence afterwards: when software access is enabled, the creator of the fence is required to keep the fence alive until after it signals with fence_signal\&. The callback itself can be called from irq context\&. .SH "COPYRIGHT" .br