xref: /illumos-gate/usr/src/man/man9f/vmem_add.9f (revision bc1f688b4872ace323eaddbb1a6365d054e7bf56)
1.\"
2.\" This file and its contents are supplied under the terms of the
3.\" Common Development and Distribution License ("CDDL"), version 1.0.
4.\" You may only use this file in accordance with the terms of version
5.\" 1.0 of the CDDL.
6.\"
7.\" A full copy of the text of the CDDL should have accompanied this
8.\" source.  A copy of the CDDL is also available via the Internet at
9.\" http://www.illumos.org/license/CDDL.
10.\"
11.\"
12.\" Copyright 2017, Richard Lowe.
13.\"
14.Dd Jan 18, 2017
15.Dt VMEM_ADD 9F
16.Os
17.Sh NAME
18.Nm vmem_add
19.Nd add spans to a vmem arena
20.Sh SYNOPSIS
21.In sys/vmem.h
22.Ft void *
23.Fo vmem_add
24.Fa "vmem_t *vmp"
25.Fa "void *vaddr"
26.Fa "size_t size"
27.Fa "int vmflag"
28.Fc
29.Sh INTERFACE LEVEL
30illumos DDI specific
31.Sh PARAMETERS
32.Bl -tag -width Ds
33.It Fa vmp
34The vmem arena to which the span should be added.
35.It Fa vaddr
36The base address of the span to add.
37.It Fa size
38The size of the span to add.
39.It Fa vmflag
40Flags affecting the allocation of the span to add.
41.El
42.Sh DESCRIPTION
43The
44.Fn vmem_add
45function adds
46.Fa size
47bytes starting at
48.Fa vaddr
49to a vmem arena from which future calls to
50.Fn vmem_alloc
51may allocate.
52.Pp
53.Dv VM_SLEEP
54or
55.Dv VM_NOSLEEP
56must be specified in
57.Fa vmflag ,
58and indicate whether the addition may block.
59.Sh CONTEXT
60This function can be called from either user or kernel context.
61If the
62.Dv VM_NOSLEEP
63flag is specified, it may also be called from interrupt context.
64.Sh RETURN VALUES
65Upon success
66.Fn vmem_add
67returns
68.Fa vaddr .
69On failure,
70.Dv NULL
71is returned.
72.Sh SEE ALSO
73.Xr vmem 9 ,
74.Xr vmem_alloc 9F ,
75.Xr vmem_create 9F
76