Print this page
code review from Josh and Robert
   1 VMEM_WALK(9F)            Kernel Functions for Drivers            VMEM_WALK(9F)
   2 
   3 NAME
   4      vmem_walk, vmem_size - walk a (sub-)set of the segments in a vmem arena
   5 
   6 SYNOPSIS
   7      #include <sys/vmem.h>
   8 
   9      void
  10      vmem_walk(vmem_t *vmp, int typemask,
  11          void (*func)(void *, void *, size_t), void *arg);
  12 
  13      size_t
  14      vmem_size(vmem_t *vmp, int typemask);
  15 
  16 INTERFACE LEVEL
  17      illumos DDI specific
  18 
  19 PARAMETERS
  20      vmp     The vmem arena to walk
  21 
  22      typemask
  23              A bitmask indicating the types of segment to operate on
  24 
  25              VMEM_ALLOC
  26                      Allocated segments
  27 
  28              VMEM_FREE
  29                      Free segments
  30 
  31      func    The function to apply to each segment matching typemask.  func
  32              should be of 3 values and return void:
  33 
  34              void *arg
  35                      The arg passed to vmem_walk()
  36 
  37              void *vaddr
  38                      The base address of the segment
  39 
  40              size_t size
  41                      The size of the segment
  42 
  43      arg     An arbitrary argument passed to each call to func()
  44 
  45 DESCRIPTION
  46      vmem_walk() walks each segment in the arena vmp and applies func to each
  47      which matches typemask.
  48 
  49      vmem_size() walks each segment in the arena vmp and totals the size of
  50      each matching typemask.
  51 
  52 CONTEXT
  53      This function may be called from user or kernel context.
  54 
  55 SEE ALSO
  56      vmem(9), vmem_alloc(9F), vmem_create(9F)
  57 
  58 illumos                        January 18, 2017                        illumos
   1 VMEM_WALK(9F)            Kernel Functions for Drivers            VMEM_WALK(9F)
   2 
   3 NAME
   4      vmem_walk, vmem_size - walk a (sub-)set of the segments in a vmem arena
   5 
   6 SYNOPSIS
   7      #include <sys/vmem.h>
   8 
   9      void
  10      vmem_walk(vmem_t *vmp, int typemask,
  11          void (*func)(void *, void *, size_t), void *arg);
  12 
  13      size_t
  14      vmem_size(vmem_t *vmp, int typemask);
  15 
  16 INTERFACE LEVEL
  17      illumos DDI specific
  18 
  19 PARAMETERS
  20      vmp     The vmem arena to walk.
  21 
  22      typemask
  23              A bitmask indicating the types of segment to operate on.
  24 
  25              VMEM_ALLOC
  26                      Allocated segments.
  27 
  28              VMEM_FREE
  29                      Free segments.
  30 
  31      func    The function to apply to each segment matching typemask.  func
  32              should accept 3 arguments and return void:
  33 
  34              void *arg
  35                      The arg passed to vmem_walk().
  36 
  37              void *vaddr
  38                      The base address of the segment.
  39 
  40              size_t size
  41                      The size of the segment.
  42 
  43      arg     An arbitrary argument passed to each call to func().
  44 
  45 DESCRIPTION
  46      vmem_walk() walks each segment in the arena vmp and applies func to each
  47      which matches typemask.
  48 
  49      vmem_size() walks each segment in the arena vmp and totals the size of
  50      each matching typemask.
  51 
  52 CONTEXT
  53      This function may be called from user or kernel context.
  54 
  55 SEE ALSO
  56      vmem(9), vmem_alloc(9F), vmem_create(9F)
  57 
  58 illumos                        January 18, 2017                        illumos