| VMEM_CREATE(9F) | Kernel Functions for Drivers | VMEM_CREATE(9F) | 
vmem_create,
    vmem_xcreate, vmem_destroy
    — create and destroy vmem arenas
#include
    <sys/vmem.h>
typedef struct vmem vmem_t;
  
  typedef void *(vmem_alloc_t)(vmem_t *, size_t, int);
  
  typedef void (vmem_free_t)(vmem_t *, void *, size_t);
  
  typedef void *(vmem_ximport_t)(vmem_t *, size_t *, size_t,
    int);
vmem_t *
  
  vmem_create(const char *name,
    void *base, size_t size,
    size_t quantum, vmem_alloc_t
    *afunc, vmem_free_t *ffunc,
    vmem_t *source, size_t
    qcache_max, int vmflag);
vmem_t *
  
  vmem_xcreate(const char *name,
    void *base, size_t size,
    size_t quantum, vmem_ximport_t
    *afunc, vmem_free_t *ffunc,
    vmem_t *source, size_t
    qcache_max, int vmflag);
void
  
  vmem_destroy(vmem_t *vmp);
illumos DDI specific
NULL if
      this arena does not import from another. When calling
      vmem_create(),
      afunc is a vmem_alloc_t, a
      function taking three parameters and returning a pointer to
      void (the imported space):
    vmem_create().When calling
        vmem_xcreate(),
        afunc is a vmem_ximport_t, a
        function taking four parameters and returning a pointer to
        void (the imported space):
vmem_xcreate().NULL if
      this arena does not import from another. This is a
      vmem_free_t, a function taking three parameters and
      returning void:
    vmem_create() or
          vmem_xcreate().NULL if this arena does not import from
    another.VMC_IDENTIFIERA vmem
    arena is a section of an arbitrary address space (a range of integer
    addresses). This commonly represents virtual memory, but can in fact be an
    arbitrary set of integers. The VMC_IDENTIFIER flag
    set at arena creation time differentiates between these two cases.
The afunc,
    ffunc, and source arguments
    combine to support a hierarchical structure of arenas, each importing from a
    single parent (the source). The
    vmem_create()
    and vmem_xcreate() functions differ in that the
    latter provides an interface for afunc to alter the
    size of the span imported from source. It is only
    legal to increase this size.
These functions can be called from user or kernel context.
Upon successful completion the
    vmem_create() and
    vmem_xcreate() functions return a pointer to a vmem
    arena. Otherwise, NULL is returned to indicate the
    arena could not be created.
| January 18, 2017 | OmniOS |