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_pager.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 /*      $NetBSD: uvm_pager.h,v 1.28.14.1 2005/08/24 18:43:38 riz Exp $  */
    2 
    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  * 3. All advertising materials mentioning features or use of this software
   17  *    must display the following acknowledgement:
   18  *      This product includes software developed by Charles D. Cranor and
   19  *      Washington University.
   20  * 4. The name of the author may not be used to endorse or promote products
   21  *    derived from this software without specific prior written permission.
   22  *
   23  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
   24  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   25  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
   26  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
   27  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
   28  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
   29  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
   30  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
   31  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
   32  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
   33  *
   34  * from: Id: uvm_pager.h,v 1.1.2.14 1998/01/13 19:00:50 chuck Exp
   35  */
   36 
   37 /*
   38  * Copyright (c) 1991, 1993
   39  *      The Regents of the University of California.  All rights reserved.
   40  *
   41  * This code is derived from software contributed to Berkeley by
   42  * the Systems Programming Group of the University of Utah Computer
   43  * Science Department.
   44  *
   45  * Redistribution and use in source and binary forms, with or without
   46  * modification, are permitted provided that the following conditions
   47  * are met:
   48  * 1. Redistributions of source code must retain the above copyright
   49  *    notice, this list of conditions and the following disclaimer.
   50  * 2. Redistributions in binary form must reproduce the above copyright
   51  *    notice, this list of conditions and the following disclaimer in the
   52  *    documentation and/or other materials provided with the distribution.
   53  * 3. Neither the name of the University nor the names of its contributors
   54  *    may be used to endorse or promote products derived from this software
   55  *    without specific prior written permission.
   56  *
   57  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
   58  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
   59  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
   60  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
   61  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
   62  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
   63  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
   64  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
   65  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
   66  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   67  * SUCH DAMAGE.
   68  *
   69  *      @(#)vm_pager.h  8.5 (Berkeley) 7/7/94
   70  */
   71 
   72 /*
   73  * Copyright (c) 1990 University of Utah.
   74  *
   75  * This code is derived from software contributed to Berkeley by
   76  * the Systems Programming Group of the University of Utah Computer
   77  * Science Department.
   78  *
   79  * Redistribution and use in source and binary forms, with or without
   80  * modification, are permitted provided that the following conditions
   81  * are met:
   82  * 1. Redistributions of source code must retain the above copyright
   83  *    notice, this list of conditions and the following disclaimer.
   84  * 2. Redistributions in binary form must reproduce the above copyright
   85  *    notice, this list of conditions and the following disclaimer in the
   86  *    documentation and/or other materials provided with the distribution.
   87  * 3. All advertising materials mentioning features or use of this software
   88  *    must display the following acknowledgement:
   89  *      This product includes software developed by the University of
   90  *      California, Berkeley and its contributors.
   91  * 4. Neither the name of the University nor the names of its contributors
   92  *    may be used to endorse or promote products derived from this software
   93  *    without specific prior written permission.
   94  *
   95  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
   96  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
   97  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
   98  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
   99  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  100  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  101  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  102  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  103  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  104  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  105  * SUCH DAMAGE.
  106  *
  107  *      @(#)vm_pager.h  8.5 (Berkeley) 7/7/94
  108  */
  109 
  110 #ifndef _UVM_UVM_PAGER_H_
  111 #define _UVM_UVM_PAGER_H_
  112 
  113 /*
  114  * uvm_pager.h
  115  */
  116 
  117 /*
  118  * forward structure declarations
  119  */
  120 
  121 struct uvm_faultinfo;
  122 
  123 /*
  124  * pager ops
  125  */
  126 
  127 struct uvm_pagerops {
  128 
  129         /* init pager */
  130         void    (*pgo_init)(void);
  131 
  132         /* add reference to obj */
  133         void    (*pgo_reference)(struct uvm_object *);
  134 
  135         /* drop reference to obj */
  136         void    (*pgo_detach)(struct uvm_object *);
  137 
  138         /* special non-standard fault processing */
  139         int     (*pgo_fault)(struct uvm_faultinfo *, vaddr_t, struct vm_page **,
  140                              int, int, vm_fault_t, vm_prot_t, int);
  141 
  142         /* get/read pages */
  143         int     (*pgo_get)(struct uvm_object *, voff_t, struct vm_page **,
  144                            int *, int, vm_prot_t, int, int);
  145 
  146         /* put/write pages */
  147         int     (*pgo_put)(struct uvm_object *, voff_t, voff_t, int);
  148 };
  149 
  150 /* pager flags [mostly for flush] */
  151 
  152 #define PGO_CLEANIT     0x001   /* write dirty pages to backing store */
  153 #define PGO_SYNCIO      0x002   /* if PGO_CLEANIT: use sync I/O? */
  154 #define PGO_DEACTIVATE  0x004   /* deactivate flushed pages */
  155 #define PGO_FREE        0x008   /* free flushed pages */
  156 /* if PGO_FREE is not set then the pages stay where they are. */
  157 
  158 #define PGO_ALLPAGES    0x010   /* flush whole object/get all pages */
  159 #define PGO_LOCKED      0x040   /* fault data structures are locked [get] */
  160 #define PGO_BUSYFAIL    0x080   /* fail if a page is busy [put] */
  161 #define PGO_OVERWRITE   0x200   /* pages will be overwritten before unlocked */
  162 #define PGO_PASTEOF     0x400   /* allow allocation of pages past EOF */
  163 #define PGO_NOBLOCKALLOC 0x800  /* backing block allocation is not needed */
  164 #define PGO_NOTIMESTAMP 0x1000  /* don't mark object accessed/modified */
  165 
  166 /* page we are not interested in getting */
  167 #define PGO_DONTCARE ((struct vm_page *) -1L)   /* [get only] */
  168 
  169 #ifdef _KERNEL
  170 
  171 /*
  172  * handle inline options
  173  */
  174 
  175 #ifdef UVM_PAGER_INLINE
  176 #define PAGER_INLINE static __inline
  177 #else
  178 #define PAGER_INLINE /* nothing */
  179 #endif /* UVM_PAGER_INLINE */
  180 
  181 /*
  182  * prototypes
  183  */
  184 
  185 void    uvm_pager_init(void);
  186 PAGER_INLINE struct vm_page *uvm_pageratop(vaddr_t);
  187 vaddr_t uvm_pagermapin(struct vm_page **, int, int);
  188 void    uvm_pagermapout(vaddr_t, int);
  189 
  190 /* Flags to uvm_pagermapin() */
  191 #define UVMPAGER_MAPIN_WAITOK   0x01    /* it's okay to wait */
  192 #define UVMPAGER_MAPIN_READ     0x02    /* device -> host */
  193 #define UVMPAGER_MAPIN_WRITE    0x00    /* host -> device (pseudo flag) */
  194 
  195 /*
  196  * XXX
  197  * this is needed until the device strategy interface
  198  * is changed to do physically-addressed i/o.
  199  */
  200 
  201 #ifndef PAGER_MAP_SIZE
  202 #define PAGER_MAP_SIZE       (16 * 1024 * 1024)
  203 #endif
  204 
  205 #endif /* _KERNEL */
  206 
  207 #endif /* _UVM_UVM_PAGER_H_ */

Cache object: be80a16088c8a03ea2aaee45a2398897


[ 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.