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>


   8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
   9  * or http://www.opensolaris.org/os/licensing.
  10  * See the License for the specific language governing permissions
  11  * and limitations under the License.
  12  *
  13  * When distributing Covered Code, include this CDDL HEADER in each
  14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15  * If applicable, add the following below this CDDL HEADER, with the
  16  * fields enclosed by brackets "[]" replaced with your own identifying
  17  * information: Portions Copyright [yyyy] [name of copyright owner]
  18  *
  19  * CDDL HEADER END
  20  */
  21 /*
  22  * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
  23  * Use is subject to license terms.
  24  */
  25 
  26 /*
  27  * Copyright (c) 2015, Joyent, Inc.  All rights reserved.

  28  */
  29 
  30 #ifndef _SYS_MEM_H
  31 #define _SYS_MEM_H
  32 
  33 #ifdef  __cplusplus
  34 extern "C" {
  35 #endif
  36 
  37 #include <sys/types.h>
  38 #include <sys/uio.h>
  39 
  40 /*
  41  * Memory Device Minor Numbers
  42  */
  43 #define M_MEM           0       /* /dev/mem - physical main memory */
  44 #define M_KMEM          1       /* /dev/kmem - virtual kernel memory */
  45 #define M_NULL          2       /* /dev/null - EOF & Rathole */
  46 #define M_ALLKMEM       3       /* /dev/allkmem - virtual kernel memory & I/O */
  47 #define M_ZERO          12      /* /dev/zero - source of private memory */

  48 
  49 /*
  50  * Private ioctl for libkvm: translate virtual address to physical address.
  51  */
  52 #define MEM_VTOP                (('M' << 8) | 0x01)
  53 
  54 typedef struct mem_vtop {
  55         struct as       *m_as;
  56         void            *m_va;
  57         pfn_t           m_pfn;
  58 } mem_vtop_t;
  59 
  60 #if defined(_SYSCALL32)
  61 typedef struct mem_vtop32 {
  62         uint32_t        m_as;
  63         uint32_t        m_va;
  64         uint32_t        m_pfn;
  65 } mem_vtop32_t;
  66 #endif
  67 




   8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
   9  * or http://www.opensolaris.org/os/licensing.
  10  * See the License for the specific language governing permissions
  11  * and limitations under the License.
  12  *
  13  * When distributing Covered Code, include this CDDL HEADER in each
  14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15  * If applicable, add the following below this CDDL HEADER, with the
  16  * fields enclosed by brackets "[]" replaced with your own identifying
  17  * information: Portions Copyright [yyyy] [name of copyright owner]
  18  *
  19  * CDDL HEADER END
  20  */
  21 /*
  22  * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
  23  * Use is subject to license terms.
  24  */
  25 
  26 /*
  27  * Copyright (c) 2015, Joyent, Inc.  All rights reserved.
  28  * Copyright (c) 2017 James S Blachly, MD <james.blachly@gmail.com>
  29  */
  30 
  31 #ifndef _SYS_MEM_H
  32 #define _SYS_MEM_H
  33 
  34 #ifdef  __cplusplus
  35 extern "C" {
  36 #endif
  37 
  38 #include <sys/types.h>
  39 #include <sys/uio.h>
  40 
  41 /*
  42  * Memory Device Minor Numbers
  43  */
  44 #define M_MEM           0       /* /dev/mem - physical main memory */
  45 #define M_KMEM          1       /* /dev/kmem - virtual kernel memory */
  46 #define M_NULL          2       /* /dev/null - EOF & Rathole */
  47 #define M_ALLKMEM       3       /* /dev/allkmem - virtual kernel memory & I/O */
  48 #define M_ZERO          12      /* /dev/zero - source of private memory */
  49 #define M_FULL          13      /* /dev/full - write always ret ENOSPC */
  50 
  51 /*
  52  * Private ioctl for libkvm: translate virtual address to physical address.
  53  */
  54 #define MEM_VTOP                (('M' << 8) | 0x01)
  55 
  56 typedef struct mem_vtop {
  57         struct as       *m_as;
  58         void            *m_va;
  59         pfn_t           m_pfn;
  60 } mem_vtop_t;
  61 
  62 #if defined(_SYSCALL32)
  63 typedef struct mem_vtop32 {
  64         uint32_t        m_as;
  65         uint32_t        m_va;
  66         uint32_t        m_pfn;
  67 } mem_vtop32_t;
  68 #endif
  69