[BACK]Return to uvm_pager.h CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / sys / uvm

Annotation of src/sys/uvm/uvm_pager.h, Revision 1.23.2.2

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

CVSweb <webmaster@jp.NetBSD.org>