Merge commit '9276b3991ba20d5a5660887ba81b0bc7bed25a0c'
[unleashed.git] / share / man / man9f / vmem_add.9f
blobe15b70c3cd835b2ecdf4449219fec8eb69788726
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
30 illumos DDI specific
31 .Sh PARAMETERS
32 .Bl -tag -width Ds
33 .It Fa vmp
34 The vmem arena to which the span should be added.
35 .It Fa vaddr
36 The base address of the span to add.
37 .It Fa size
38 The size of the span to add.
39 .It Fa vmflag
40 Flags affecting the allocation of the span to add.
41 .El
42 .Sh DESCRIPTION
43 The
44 .Fn vmem_add
45 function adds
46 .Fa size
47 bytes starting at
48 .Fa vaddr
49 to a vmem arena from which future calls to
50 .Fn vmem_alloc
51 may allocate.
52 .Pp
53 .Dv VM_SLEEP
55 .Dv VM_NOSLEEP
56 must be specified in
57 .Fa vmflag ,
58 and indicate whether the addition may block.
59 .Sh CONTEXT
60 This function can be called from either user or kernel context.
61 If the
62 .Dv VM_NOSLEEP
63 flag is specified, it may also be called from interrupt context.
64 .Sh RETURN VALUES
65 Upon success
66 .Fn vmem_add
67 returns
68 .Fa vaddr .
69 On failure,
70 .Dv NULL
71 is returned.
72 .Sh SEE ALSO
73 .Xr vmem 9 ,
74 .Xr vmem_alloc 9F ,
75 .Xr vmem_create 9F