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

1.44.14.1! pgoyette    1: /*     $NetBSD$        */
1.1       mrg         2:
                      3: /*
                      4:  * Copyright (c) 1997 Charles D. Cranor and Washington University.
                      5:  * All rights reserved.
                      6:  *
                      7:  * Redistribution and use in source and binary forms, with or without
                      8:  * modification, are permitted provided that the following conditions
                      9:  * are met:
                     10:  * 1. Redistributions of source code must retain the above copyright
                     11:  *    notice, this list of conditions and the following disclaimer.
                     12:  * 2. Redistributions in binary form must reproduce the above copyright
                     13:  *    notice, this list of conditions and the following disclaimer in the
                     14:  *    documentation and/or other materials provided with the distribution.
                     15:  *
                     16:  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
                     17:  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
                     18:  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
                     19:  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
                     20:  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
                     21:  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
                     22:  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
                     23:  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
                     24:  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
                     25:  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
1.3       mrg        26:  *
                     27:  * from: Id: uvm_pager.h,v 1.1.2.14 1998/01/13 19:00:50 chuck Exp
1.1       mrg        28:  */
                     29:
1.16      mrg        30: /*
                     31:  * Copyright (c) 1991, 1993
                     32:  *     The Regents of the University of California.  All rights reserved.
1.27      agc        33:  *
                     34:  * This code is derived from software contributed to Berkeley by
                     35:  * the Systems Programming Group of the University of Utah Computer
                     36:  * Science Department.
                     37:  *
                     38:  * Redistribution and use in source and binary forms, with or without
                     39:  * modification, are permitted provided that the following conditions
                     40:  * are met:
                     41:  * 1. Redistributions of source code must retain the above copyright
                     42:  *    notice, this list of conditions and the following disclaimer.
                     43:  * 2. Redistributions in binary form must reproduce the above copyright
                     44:  *    notice, this list of conditions and the following disclaimer in the
                     45:  *    documentation and/or other materials provided with the distribution.
                     46:  * 3. Neither the name of the University nor the names of its contributors
                     47:  *    may be used to endorse or promote products derived from this software
                     48:  *    without specific prior written permission.
                     49:  *
                     50:  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
                     51:  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
                     52:  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
                     53:  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
                     54:  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
                     55:  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
                     56:  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
                     57:  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
                     58:  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
                     59:  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
                     60:  * SUCH DAMAGE.
                     61:  *
                     62:  *     @(#)vm_pager.h  8.5 (Berkeley) 7/7/94
                     63:  */
                     64:
                     65: /*
                     66:  * Copyright (c) 1990 University of Utah.
1.16      mrg        67:  *
                     68:  * This code is derived from software contributed to Berkeley by
                     69:  * the Systems Programming Group of the University of Utah Computer
                     70:  * Science Department.
                     71:  *
                     72:  * Redistribution and use in source and binary forms, with or without
                     73:  * modification, are permitted provided that the following conditions
                     74:  * are met:
                     75:  * 1. Redistributions of source code must retain the above copyright
                     76:  *    notice, this list of conditions and the following disclaimer.
                     77:  * 2. Redistributions in binary form must reproduce the above copyright
                     78:  *    notice, this list of conditions and the following disclaimer in the
                     79:  *    documentation and/or other materials provided with the distribution.
1.41      chuck      80:  * 3. Neither the name of the University nor the names of its contributors
1.16      mrg        81:  *    may be used to endorse or promote products derived from this software
                     82:  *    without specific prior written permission.
                     83:  *
                     84:  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
                     85:  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
                     86:  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
                     87:  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
                     88:  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
                     89:  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
                     90:  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
                     91:  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
                     92:  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
                     93:  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
                     94:  * SUCH DAMAGE.
                     95:  *
                     96:  *     @(#)vm_pager.h  8.5 (Berkeley) 7/7/94
                     97:  */
                     98:
1.4       perry      99: #ifndef _UVM_UVM_PAGER_H_
                    100: #define _UVM_UVM_PAGER_H_
                    101:
1.1       mrg       102: /*
                    103:  * uvm_pager.h
                    104:  */
                    105:
                    106: /*
1.24      chs       107:  * forward structure declarations
                    108:  */
                    109:
                    110: struct uvm_faultinfo;
1.44      christos  111: struct uvm_object;
1.24      chs       112:
                    113: /*
1.1       mrg       114:  * pager ops
                    115:  */
                    116:
                    117: struct uvm_pagerops {
1.24      chs       118:
                    119:        /* init pager */
1.28      junyoung  120:        void    (*pgo_init)(void);
1.24      chs       121:
                    122:        /* add reference to obj */
                    123:        void    (*pgo_reference)(struct uvm_object *);
                    124:
                    125:        /* drop reference to obj */
                    126:        void    (*pgo_detach)(struct uvm_object *);
                    127:
                    128:        /* special non-standard fault processing */
                    129:        int     (*pgo_fault)(struct uvm_faultinfo *, vaddr_t, struct vm_page **,
1.34      drochner  130:                             int, int, vm_prot_t, int);
1.24      chs       131:
                    132:        /* get/read pages */
                    133:        int     (*pgo_get)(struct uvm_object *, voff_t, struct vm_page **,
                    134:                           int *, int, vm_prot_t, int, int);
                    135:
                    136:        /* put/write pages */
                    137:        int     (*pgo_put)(struct uvm_object *, voff_t, voff_t, int);
1.1       mrg       138: };
                    139:
                    140: /* pager flags [mostly for flush] */
                    141:
                    142: #define PGO_CLEANIT    0x001   /* write dirty pages to backing store */
1.36      pooka     143: #define PGO_SYNCIO     0x002   /* use sync I/O */
1.1       mrg       144: #define PGO_DEACTIVATE 0x004   /* deactivate flushed pages */
                    145: #define PGO_FREE       0x008   /* free flushed pages */
1.20      chs       146: /* if PGO_FREE is not set then the pages stay where they are. */
1.1       mrg       147:
                    148: #define PGO_ALLPAGES   0x010   /* flush whole object/get all pages */
1.44.14.1! pgoyette  149: #define PGO_JOURNALLOCKED 0x020        /* journal is already locked [get/put] */
1.1       mrg       150: #define PGO_LOCKED     0x040   /* fault data structures are locked [get] */
1.26      perseant  151: #define PGO_BUSYFAIL   0x080   /* fail if a page is busy [put] */
1.20      chs       152: #define PGO_OVERWRITE  0x200   /* pages will be overwritten before unlocked */
1.25      chs       153: #define PGO_PASTEOF    0x400   /* allow allocation of pages past EOF */
1.29      yamt      154: #define PGO_NOBLOCKALLOC 0x800 /* backing block allocation is not needed */
1.30      yamt      155: #define PGO_NOTIMESTAMP 0x1000 /* don't mark object accessed/modified */
1.35      chs       156: #define PGO_RECLAIM    0x2000  /* object is being reclaimed */
1.39      chs       157: #define PGO_GLOCKHELD  0x4000  /* genfs_node's lock is already held */
1.43      chs       158: #define PGO_LAZY       0x8000  /* equivalent of MNT_LAZY / FSYNC_LAZY */
1.1       mrg       159:
                    160: /* page we are not interested in getting */
1.20      chs       161: #define PGO_DONTCARE ((struct vm_page *) -1L)  /* [get only] */
1.1       mrg       162:
1.10      thorpej   163: #ifdef _KERNEL
                    164:
1.1       mrg       165: /*
                    166:  * prototypes
                    167:  */
                    168:
1.28      junyoung  169: void   uvm_pager_init(void);
1.42      matt      170: void   uvm_pager_realloc_emerg(void);
1.33      yamt      171: struct vm_page *uvm_pageratop(vaddr_t);
1.28      junyoung  172: vaddr_t        uvm_pagermapin(struct vm_page **, int, int);
                    173: void   uvm_pagermapout(vaddr_t, int);
1.15      thorpej   174:
1.37      yamt      175: extern size_t pager_map_size;
                    176:
1.15      thorpej   177: /* Flags to uvm_pagermapin() */
                    178: #define        UVMPAGER_MAPIN_WAITOK   0x01    /* it's okay to wait */
1.24      chs       179: #define        UVMPAGER_MAPIN_READ     0x02    /* device -> host */
                    180: #define        UVMPAGER_MAPIN_WRITE    0x00    /* host -> device (pseudo flag) */
1.18      chs       181:
1.10      thorpej   182: #endif /* _KERNEL */
1.4       perry     183:
                    184: #endif /* _UVM_UVM_PAGER_H_ */

CVSweb <webmaster@jp.NetBSD.org>