2 .\" Copyright (c) 2006, Sun Microsystems, Inc.
3 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
4 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
5 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
6 .TH RMFREE 9F "Jan 16, 2006"
8 rmfree \- free space back into a resource map
17 \fBvoid\fR \fBrmfree\fR(\fBstruct map *\fR\fImp\fR, \fBsize_t\fR \fIsize\fR, \fBulong_t\fR \fIindex\fR);
23 Architecture independent level 1 (DDI/DKI).
31 Pointer to the map structure.
40 Number of units being freed.
49 Index of the first unit of the allocated resource.
55 The \fBrmfree()\fR function releases space back into a resource map. It is the
56 opposite of \fBrmalloc\fR(9F), which allocates space that is controlled by a
57 resource map structure.
60 When releasing resources using \fBrmfree()\fR the size and index passed to
61 \fBrmfree()\fR must exactly match the size and index values passed to and
62 returned from a previous call to \fBrmalloc()\fR. Resources cannot be returned
66 Drivers may define resource maps for resource allocation, in terms of arbitrary
67 units, using the \fBrmallocmap\fR(9F) function. The system maintains the
68 resource map structure by size and index, computed in units appropriate for the
69 resource. For example, units may be byte addresses, pages of memory, or blocks.
70 \fBrmfree()\fR frees up unallocated space for re-use.
73 The \fBrmfree()\fR function can also be used to initialize a resource map, in
74 which case the size and index should cover the entire resource area.
78 The \fBrmfree()\fR function can be called from user, interrupt, or kernel
83 \fBrmalloc\fR(9F), \fBrmalloc_wait\fR(9F), \fBrmallocmap\fR(9F),
87 \fIWriting Device Drivers\fR