rmfree(D3)rmfree(D3)NAMErmfree - free space into a private space management map
SYNOPSIS
#include <sys/types.h>
#include <sys/map.h>
#include <sys/ddi.h>
void rmfree(struct map *mp, size_t size, ulong_t index);
Arguments
mp Pointer to the map.
size Number of units to free into the map.
index Index of the first unit of the space being freed.
DESCRIPTIONrmfree releases space into the private space management map pointed to by
mp and wakes up any processes that are waiting for space.
Return Values
None
USAGErmfree should be called to return space that had been allocated by a
previous call to rmalloc(D3), in which case index is the value returned
from the corresponding call to rmalloc. rmfree should also be called to
add space to a newly allocated map prior to the first call to rmalloc, in
which case index specifies the base of the space being added.
Both size and index are in arbitrary units. The driver using the map
places whatever semantics on the units are appropriate for the type of
space being managed. For example, units may be byte addresses, pages of
memory, or blocks on a device.
If the space being returned is adjacent to other space in the map, rmfree
will coalesce the adjacent fragments.
If the rmfree call causes the number of fragments in the map to exceed
the number of map entries specified by rminit(D3) (for singlethreaded
drivers) or rmallocmap(D3) (for multithreaded drivers) the following
warning message is displayed on the console:
WARNING: rmfree map overflow mp lost size items at index
This implies that the driver should specify a larger number of map
entries when initializing the map.
Level
Base or Interrupt.
Page 1
rmfree(D3)rmfree(D3)
Synchronization Constraints
Does not sleep.
Driver-defined basic locks, read/write locks, and sleep locks may be held
across calls to this function.
Examples
See rmalloc(D3) for an example of rmfree.
REFERENCESrmalloc(D3), rmalloc_wait(D3), rmallocmap(D3), rmfreemap(D3), rminit(D3),
rmsetwant(D3)
Page 2