'\" t .\" Title: allocate_resource .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 .\" Date: January 2017 .\" Manual: Hardware Interfaces .\" Source: Kernel Hackers Manual 4.8.15 .\" Language: English .\" .TH "ALLOCATE_RESOURCE" "9" "January 2017" "Kernel Hackers Manual 4\&.8\&." "Hardware Interfaces" .\" ----------------------------------------------------------------- .\" * 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" allocate_resource \- allocate empty slot in the resource tree given range & alignment\&. The resource will be reallocated with a new size if it was already allocated .SH "SYNOPSIS" .HP \w'int\ allocate_resource('u .BI "int allocate_resource(struct\ resource\ *\ " "root" ", struct\ resource\ *\ " "new" ", resource_size_t\ " "size" ", resource_size_t\ " "min" ", resource_size_t\ " "max" ", resource_size_t\ " "align" ", resource_size_t\ (*" "alignf" ")\ (void\ *,\ const\ struct\ resource\ *,\ resource_size_t,\ resource_size_t), void\ *\ " "alignf_data" ");" .SH "ARGUMENTS" .PP \fIroot\fR .RS 4 root resource descriptor .RE .PP \fInew\fR .RS 4 resource descriptor desired by caller .RE .PP \fIsize\fR .RS 4 requested resource region size .RE .PP \fImin\fR .RS 4 minimum boundary to allocate .RE .PP \fImax\fR .RS 4 maximum boundary to allocate .RE .PP \fIalign\fR .RS 4 alignment requested, in bytes .RE .PP \fIalignf\fR .RS 4 alignment function, optional, called if not NULL .RE .PP \fIalignf_data\fR .RS 4 arbitrary data to pass to the \fIalignf\fR function .RE .SH "COPYRIGHT" .br