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

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

#include <sys/vmem.h>

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

size_t
vmem_size(vmem_t *vmp, int typemask);

illumos DDI specific

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

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

() 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