Print this page
7882 Add /dev/full , the always-full memory device
Reviewed by: Adam Stevko <adam.stevko@gmail.com>
Reviewed by: Toomas Soome <tsoome@me.com>

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/sys/mem.h
          +++ new/usr/src/uts/common/sys/mem.h
↓ open down ↓ 17 lines elided ↑ open up ↑
  18   18   *
  19   19   * CDDL HEADER END
  20   20   */
  21   21  /*
  22   22   * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
  23   23   * Use is subject to license terms.
  24   24   */
  25   25  
  26   26  /*
  27   27   * Copyright (c) 2015, Joyent, Inc.  All rights reserved.
       28 + * Copyright (c) 2017 James S Blachly, MD <james.blachly@gmail.com>
  28   29   */
  29   30  
  30   31  #ifndef _SYS_MEM_H
  31   32  #define _SYS_MEM_H
  32   33  
  33   34  #ifdef  __cplusplus
  34   35  extern "C" {
  35   36  #endif
  36   37  
  37   38  #include <sys/types.h>
  38   39  #include <sys/uio.h>
  39   40  
  40   41  /*
  41   42   * Memory Device Minor Numbers
  42   43   */
  43   44  #define M_MEM           0       /* /dev/mem - physical main memory */
  44   45  #define M_KMEM          1       /* /dev/kmem - virtual kernel memory */
  45   46  #define M_NULL          2       /* /dev/null - EOF & Rathole */
  46   47  #define M_ALLKMEM       3       /* /dev/allkmem - virtual kernel memory & I/O */
  47   48  #define M_ZERO          12      /* /dev/zero - source of private memory */
       49 +#define M_FULL          13      /* /dev/full - write always ret ENOSPC */
  48   50  
  49   51  /*
  50   52   * Private ioctl for libkvm: translate virtual address to physical address.
  51   53   */
  52   54  #define MEM_VTOP                (('M' << 8) | 0x01)
  53   55  
  54   56  typedef struct mem_vtop {
  55   57          struct as       *m_as;
  56   58          void            *m_va;
  57   59          pfn_t           m_pfn;
↓ open down ↓ 93 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX