1*5a342f14SRichard Lowe.\" 2*5a342f14SRichard Lowe.\" This file and its contents are supplied under the terms of the 3*5a342f14SRichard Lowe.\" Common Development and Distribution License ("CDDL"), version 1.0. 4*5a342f14SRichard Lowe.\" You may only use this file in accordance with the terms of version 5*5a342f14SRichard Lowe.\" 1.0 of the CDDL. 6*5a342f14SRichard Lowe.\" 7*5a342f14SRichard Lowe.\" A full copy of the text of the CDDL should have accompanied this 8*5a342f14SRichard Lowe.\" source. A copy of the CDDL is also available via the Internet at 9*5a342f14SRichard Lowe.\" http://www.illumos.org/license/CDDL. 10*5a342f14SRichard Lowe.\" 11*5a342f14SRichard Lowe.\" 12*5a342f14SRichard Lowe.\" Copyright 2017, Richard Lowe. 13*5a342f14SRichard Lowe.\" 14*5a342f14SRichard Lowe.Dd Jan 18, 2017 15*5a342f14SRichard Lowe.Dt VMEM_WALK 9F 16*5a342f14SRichard Lowe.Os 17*5a342f14SRichard Lowe.Sh NAME 18*5a342f14SRichard Lowe.Nm vmem_walk , 19*5a342f14SRichard Lowe.Nm vmem_size 20*5a342f14SRichard Lowe.Nd walk a (sub\-)set of the segments in a vmem arena 21*5a342f14SRichard Lowe.Sh SYNOPSIS 22*5a342f14SRichard Lowe.In sys/vmem.h 23*5a342f14SRichard Lowe.Ft void 24*5a342f14SRichard Lowe.Fo vmem_walk 25*5a342f14SRichard Lowe.Fa "vmem_t *vmp" 26*5a342f14SRichard Lowe.Fa "int typemask" 27*5a342f14SRichard Lowe.Fa "void (*func)(void *, void *, size_t)" 28*5a342f14SRichard Lowe.Fa "void *arg" 29*5a342f14SRichard Lowe.Fc 30*5a342f14SRichard Lowe.Ft size_t 31*5a342f14SRichard Lowe.Fo vmem_size 32*5a342f14SRichard Lowe.Fa "vmem_t *vmp" 33*5a342f14SRichard Lowe.Fa "int typemask" 34*5a342f14SRichard Lowe.Fc 35*5a342f14SRichard Lowe.Sh INTERFACE LEVEL 36*5a342f14SRichard Loweillumos DDI specific 37*5a342f14SRichard Lowe.Sh PARAMETERS 38*5a342f14SRichard Lowe.Bl -tag -width Ds 39*5a342f14SRichard Lowe.It Fa vmp 40*5a342f14SRichard LoweThe vmem arena to walk. 41*5a342f14SRichard Lowe.It Fa typemask 42*5a342f14SRichard LoweA bitmask indicating the types of segment to operate on. 43*5a342f14SRichard Lowe.Bl -tag -width Ds 44*5a342f14SRichard Lowe.It Dv VMEM_ALLOC 45*5a342f14SRichard LoweAllocated segments. 46*5a342f14SRichard Lowe.It Dv VMEM_FREE 47*5a342f14SRichard LoweFree segments. 48*5a342f14SRichard Lowe.El 49*5a342f14SRichard Lowe.It Fa func 50*5a342f14SRichard LoweThe function to apply to each segment matching 51*5a342f14SRichard Lowe.Fa typemask . 52*5a342f14SRichard Lowe.Fa func 53*5a342f14SRichard Loweshould accept 3 arguments and return void: 54*5a342f14SRichard Lowe.Bl -tag -width Ds 55*5a342f14SRichard Lowe.It Fa "void *arg" 56*5a342f14SRichard LoweThe 57*5a342f14SRichard Lowe.Fa arg 58*5a342f14SRichard Lowepassed to 59*5a342f14SRichard Lowe.Fn vmem_walk . 60*5a342f14SRichard Lowe.It Fa "void *vaddr" 61*5a342f14SRichard LoweThe base address of the segment. 62*5a342f14SRichard Lowe.It Fa "size_t size" 63*5a342f14SRichard LoweThe size of the segment. 64*5a342f14SRichard Lowe.El 65*5a342f14SRichard Lowe.It Fa arg 66*5a342f14SRichard LoweAn arbitrary argument passed to each call to 67*5a342f14SRichard Lowe.Fn func . 68*5a342f14SRichard Lowe.El 69*5a342f14SRichard Lowe.Sh DESCRIPTION 70*5a342f14SRichard Lowe.Fn vmem_walk 71*5a342f14SRichard Lowewalks each segment in the arena 72*5a342f14SRichard Lowe.Fa vmp 73*5a342f14SRichard Loweand applies 74*5a342f14SRichard Lowe.Fa func 75*5a342f14SRichard Loweto each which matches 76*5a342f14SRichard Lowe.Fa typemask . 77*5a342f14SRichard Lowe.Pp 78*5a342f14SRichard Lowe.Fn vmem_size 79*5a342f14SRichard Lowewalks each segment in the arena 80*5a342f14SRichard Lowe.Fa vmp 81*5a342f14SRichard Loweand totals the size of each matching 82*5a342f14SRichard Lowe.Fa typemask . 83*5a342f14SRichard Lowe.Sh CONTEXT 84*5a342f14SRichard LoweThis function may be called from user or kernel context. 85*5a342f14SRichard Lowe.Sh SEE ALSO 86*5a342f14SRichard Lowe.Xr vmem 9 , 87*5a342f14SRichard Lowe.Xr vmem_alloc 9F , 88*5a342f14SRichard Lowe.Xr vmem_create 9F 89