VMEM_WALK(9F) Kernel Functions for Drivers VMEM_WALK(9F)

vmem_walk, vmem_size
walk a (sub-)set of the segments in a vmem arena

#include <sys/vmem.h>

vmem_walk(vmem_t *vmp, int typemask, void (*func)(void *, void *, size_t), void *arg);

vmem_size(vmem_t *vmp, int typemask);

illumos DDI specific

The vmem arena to walk.
A bitmask indicating the types of segment to operate on.
Allocated segments.
Free segments.
The function to apply to each segment matching typemask. func should accept 3 arguments and return void:
void *arg
The arg passed to vmem_walk().
void *vaddr
The base address of the segment.
size_t size
The size of the segment.
An arbitrary argument passed to each call to func().

vmem_walk() walks each segment in the arena vmp and applies func to each which matches typemask.

vmem_size() walks each segment in the arena vmp and totals the size of each matching typemask.

This function may be called from user or kernel context.

vmem(9), vmem_alloc(9F), vmem_create(9F)
January 18, 2017 OmniOS