The Design and Implementation of the FreeBSD Operating System, Second Edition
Now available: The Design and Implementation of the FreeBSD Operating System (Second Edition)


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]

FreeBSD/Linux Kernel Cross Reference
sys/uvm/uvm.h

Version: -  FREEBSD  -  FREEBSD-13-STABLE  -  FREEBSD-13-0  -  FREEBSD-12-STABLE  -  FREEBSD-12-0  -  FREEBSD-11-STABLE  -  FREEBSD-11-0  -  FREEBSD-10-STABLE  -  FREEBSD-10-0  -  FREEBSD-9-STABLE  -  FREEBSD-9-0  -  FREEBSD-8-STABLE  -  FREEBSD-8-0  -  FREEBSD-7-STABLE  -  FREEBSD-7-0  -  FREEBSD-6-STABLE  -  FREEBSD-6-0  -  FREEBSD-5-STABLE  -  FREEBSD-5-0  -  FREEBSD-4-STABLE  -  FREEBSD-3-STABLE  -  FREEBSD22  -  l41  -  OPENBSD  -  linux-2.6  -  MK84  -  PLAN9  -  xnu-8792 
SearchContext: -  none  -  3  -  10 

    1 /*      $OpenBSD: uvm.h,v 1.71 2022/10/07 05:01:44 deraadt Exp $        */
    2 /*      $NetBSD: uvm.h,v 1.24 2000/11/27 08:40:02 chs Exp $     */
    3 
    4 /*
    5  * Copyright (c) 1997 Charles D. Cranor and Washington University.
    6  * All rights reserved.
    7  *
    8  * Redistribution and use in source and binary forms, with or without
    9  * modification, are permitted provided that the following conditions
   10  * are met:
   11  * 1. Redistributions of source code must retain the above copyright
   12  *    notice, this list of conditions and the following disclaimer.
   13  * 2. Redistributions in binary form must reproduce the above copyright
   14  *    notice, this list of conditions and the following disclaimer in the
   15  *    documentation and/or other materials provided with the distribution.
   16  *
   17  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
   18  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   19  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
   20  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
   21  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
   22  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
   23  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
   24  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
   25  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
   26  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
   27  *
   28  * from: Id: uvm.h,v 1.1.2.14 1998/02/02 20:07:19 chuck Exp
   29  */
   30 
   31 #ifndef _UVM_UVM_H_
   32 #define _UVM_UVM_H_
   33 
   34 #include <uvm/uvm_extern.h>
   35 #include <uvm/uvm_amap.h>
   36 #include <uvm/uvm_aobj.h>
   37 #include <uvm/uvm_fault.h>
   38 #include <uvm/uvm_glue.h>
   39 #include <uvm/uvm_km.h>
   40 #include <uvm/uvm_swap.h>
   41 
   42 #include <uvm/uvm_pmemrange.h>
   43 
   44 /*
   45  * uvm structure (vm global state: collected in one structure for ease
   46  * of reference...)
   47  *
   48  *  Locks used to protect struct members in this file:
   49  *      Q       uvm.pageqlock
   50  */
   51 struct uvm {
   52         /* vm_page related parameters */
   53 
   54         /* vm_page queues */
   55         struct pglist page_active;      /* [Q] allocated pages, in use */
   56         struct pglist page_inactive;    /* [Q] pages inactive (reclaim/free) */
   57         /* Lock order: pageqlock, then fpageqlock. */
   58         struct mutex pageqlock;         /* [] lock for active/inactive page q */
   59         struct mutex fpageqlock;        /* [] lock for free page q  + pdaemon */
   60         boolean_t page_init_done;       /* TRUE if uvm_page_init() finished */
   61         struct uvm_pmr_control pmr_control; /* pmemrange data */
   62 
   63                 /* page daemon trigger */
   64         int pagedaemon;                 /* daemon sleeps on this */
   65         struct proc *pagedaemon_proc;   /* daemon's pid */
   66 
   67                 /* aiodone daemon trigger */
   68         int aiodoned;                   /* daemon sleeps on this */
   69         struct proc *aiodoned_proc;     /* daemon's pid */
   70         struct mutex aiodoned_lock;
   71 
   72         /* static kernel map entry pool */
   73         SLIST_HEAD(, vm_map_entry) kentry_free; /* free page pool */
   74 
   75         /* aio_done is locked by uvm.aiodoned_lock. */
   76         TAILQ_HEAD(, buf) aio_done;             /* done async i/o reqs */
   77 
   78         /* kernel object: to support anonymous pageable kernel memory */
   79         struct uvm_object *kernel_object;
   80 };
   81 
   82 /*
   83  * vm_map_entry etype bits:
   84  */
   85 #define UVM_ET_OBJ              0x0001  /* it is a uvm_object */
   86 #define UVM_ET_SUBMAP           0x0002  /* it is a vm_map submap */
   87 #define UVM_ET_COPYONWRITE      0x0004  /* copy_on_write */
   88 #define UVM_ET_NEEDSCOPY        0x0008  /* needs_copy */
   89 #define UVM_ET_HOLE             0x0010  /* no backend */
   90 #define UVM_ET_NOFAULT          0x0020  /* don't fault */
   91 #define UVM_ET_STACK            0x0040  /* this is a stack */
   92 #define UVM_ET_WC               0x0080  /* write combining */
   93 #define UVM_ET_CONCEAL          0x0100  /* omit from dumps */
   94 #define UVM_ET_SYSCALL          0x0200  /* syscall text segment */
   95 #define UVM_ET_IMMUTABLE        0x0400  /* entry may not be changed */
   96 #define UVM_ET_FREEMAPPED       0x8000  /* map entry is on free list (DEBUG) */
   97 
   98 #define UVM_ET_ISOBJ(E)         (((E)->etype & UVM_ET_OBJ) != 0)
   99 #define UVM_ET_ISSUBMAP(E)      (((E)->etype & UVM_ET_SUBMAP) != 0)
  100 #define UVM_ET_ISCOPYONWRITE(E) (((E)->etype & UVM_ET_COPYONWRITE) != 0)
  101 #define UVM_ET_ISNEEDSCOPY(E)   (((E)->etype & UVM_ET_NEEDSCOPY) != 0)
  102 #define UVM_ET_ISHOLE(E)        (((E)->etype & UVM_ET_HOLE) != 0)
  103 #define UVM_ET_ISNOFAULT(E)     (((E)->etype & UVM_ET_NOFAULT) != 0)
  104 #define UVM_ET_ISSTACK(E)       (((E)->etype & UVM_ET_STACK) != 0)
  105 #define UVM_ET_ISWC(E)          (((E)->etype & UVM_ET_WC) != 0)
  106 #define UVM_ET_ISCONCEAL(E)     (((E)->etype & UVM_ET_CONCEAL) != 0)
  107 
  108 #ifdef _KERNEL
  109 
  110 /*
  111  * holds all the internal UVM data
  112  */
  113 extern struct uvm uvm;
  114 
  115 /*
  116  * UVM_PAGE_OWN: track page ownership (only if UVM_PAGE_TRKOWN)
  117  */
  118 
  119 #if defined(UVM_PAGE_TRKOWN)
  120 #define UVM_PAGE_OWN(PG, TAG) uvm_page_own(PG, TAG)
  121 #else
  122 #define UVM_PAGE_OWN(PG, TAG) /* nothing */
  123 #endif /* UVM_PAGE_TRKOWN */
  124 
  125 /*
  126  * uvm_map internal functions.
  127  * Used by uvm_map address selectors.
  128  */
  129 struct vm_map_entry     *uvm_map_entrybyaddr(struct uvm_map_addr *, vaddr_t);
  130 int                      uvm_map_isavail(struct vm_map *,
  131                             struct uvm_addr_state *,
  132                             struct vm_map_entry **, struct vm_map_entry**,
  133                             vaddr_t, vsize_t);
  134 struct uvm_addr_state   *uvm_map_uaddr(struct vm_map *, vaddr_t);
  135 struct uvm_addr_state   *uvm_map_uaddr_e(struct vm_map *, struct vm_map_entry *);
  136 
  137 #define VMMAP_FREE_START(_entry)        ((_entry)->end + (_entry)->guard)
  138 #define VMMAP_FREE_END(_entry)          ((_entry)->end + (_entry)->guard + \
  139                                             (_entry)->fspace)
  140 
  141 #endif /* _KERNEL */
  142 
  143 #endif /* _UVM_UVM_H_ */

Cache object: 2b6e6de9fbcdcd3f43c23d7b4bc07a9f


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]


This page is part of the FreeBSD/Linux Linux Kernel Cross-Reference, and was automatically generated using a modified version of the LXR engine.