1rmfree(9F) Kernel Functions for Drivers rmfree(9F)
2
3
4
6 rmfree - free space back into a resource map
7
9 #include <sys/map.h>
10 #include <sys/ddi.h>
11
12
13
14 void rmfree(struct map *mp, size_t size, ulong_t index);
15
16
18 Architecture independent level 1 (DDI/DKI).
19
21 mp Pointer to the map structure.
22
23
24 size Number of units being freed.
25
26
27 index Index of the first unit of the allocated resource.
28
29
31 The rmfree() function releases space back into a resource map. It is
32 the opposite of rmalloc(9F), which allocates space that is controlled
33 by a resource map structure.
34
35
36 When releasing resources using rmfree() the size and index passed to
37 rmfree() must exactly match the size and index values passed to and
38 returned from a previous call to rmalloc(). Resources cannot be
39 returned piecemeal.
40
41
42 Drivers may define resource maps for resource allocation, in terms of
43 arbitrary units, using the rmallocmap(9F) function. The system main‐
44 tains the resource map structure by size and index, computed in units
45 appropriate for the resource. For example, units may be byte addresses,
46 pages of memory, or blocks. rmfree() frees up unallocated space for re-
47 use.
48
49
50 The rmfree() function can also be used to initialize a resource map, in
51 which case the size and index should cover the entire resource area.
52
54 The rmfree() function can be called from user, interrupt, or kernel
55 context.
56
58 rmalloc(9F), rmalloc_wait(9F), rmallocmap(9F), rmfreemap(9F)
59
60
61 Writing Device Drivers
62
63
64
65SunOS 5.11 16 Jan 2006 rmfree(9F)