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
  54 or
  55 .Dv VM_NOSLEEP
  56 must be specified, and indicate whether the addition may block.
  57 .Sh CONTEXT
  58 This function can be called from either user or kernel context.
  59 If the
  60 .Dv VM_NOSLEEP
  61 flag is specified, it may also be called from interrupt context.
  62 .Sh RETURN VALUES
  63 Upon success
  64 .Fn vmem_add
  65 returns
  66 .Fa vaddr .
  67 On failure,
  68 .Dv NULL
  69 is returned.
  70 .Sh SEE ALSO
  71 .Xr vmem 9 ,
  72 .Xr vmem_alloc 9F ,
  73 .Xr vmem_create 9F