rmfree(D3DK) —
NAME
rmfree − free space into a private space management map .IX \f4rmfree\fP(D3DK)
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
mpPointer to the map.
sizeNumber of units to free into the map.
indexIndex of the first unit of the space being freed.
DESCRIPTION
rmfree releases space into the private space management map pointed to by mp and wakes up any processes that are waiting for space using rmalloc_wait(D3DK). rmfree should be called to return space that had been allocated by a previous call to rmalloc(D3DK), 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.
RETURN VALUE
None.
LEVEL
Base or Interrupt.
NOTES
Does not sleep.
Driver-defined basic locks, read/write locks, and sleep locks may be held across calls to this function.
If the rmfree call causes the number of fragments in the map to exceed the number of map entries allocated by rmallocmap(D3DK), 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 allocating the map with rmallocmap.
SEE ALSO
rmalloc(D3DK), rmalloc_wait(D3DK), rmallocmap(D3DK), rmfreemap(D3DK)
DDI/DKI