pmap.h revision 120831
1163953Srrs/* 2185694Srrs * Copyright (c) 1991, 1993 3235828Stuexen * The Regents of the University of California. All rights reserved. 4235828Stuexen * 5163953Srrs * This code is derived from software contributed to Berkeley by 6163953Srrs * The Mach Operating System project at Carnegie-Mellon University. 7163953Srrs * 8163953Srrs * Redistribution and use in source and binary forms, with or without 9163953Srrs * modification, are permitted provided that the following conditions 10228653Stuexen * are met: 11163953Srrs * 1. Redistributions of source code must retain the above copyright 12163953Srrs * notice, this list of conditions and the following disclaimer. 13163953Srrs * 2. Redistributions in binary form must reproduce the above copyright 14228653Stuexen * notice, this list of conditions and the following disclaimer in the 15163953Srrs * documentation and/or other materials provided with the distribution. 16163953Srrs * 3. All advertising materials mentioning features or use of this software 17163953Srrs * must display the following acknowledgement: 18163953Srrs * This product includes software developed by the University of 19163953Srrs * California, Berkeley and its contributors. 20163953Srrs * 4. Neither the name of the University nor the names of its contributors 21163953Srrs * may be used to endorse or promote products derived from this software 22163953Srrs * without specific prior written permission. 23163953Srrs * 24163953Srrs * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 25163953Srrs * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 26163953Srrs * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 27163953Srrs * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 28163953Srrs * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 29163953Srrs * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 30163953Srrs * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 31163953Srrs * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 32163953Srrs * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 33163953Srrs * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 34163953Srrs * SUCH DAMAGE. 35235828Stuexen * 36166086Srrs * from: @(#)pmap.h 8.1 (Berkeley) 6/11/93 37163953Srrs * 38163953Srrs * 39163953Srrs * Copyright (c) 1987, 1990 Carnegie-Mellon University. 40163953Srrs * All rights reserved. 41238475Stuexen * 42167695Srrs * Author: Avadis Tevanian, Jr. 43167598Srrs * 44163953Srrs * Permission to use, copy, modify and distribute this software and 45163953Srrs * its documentation is hereby granted, provided that both the copyright 46163953Srrs * notice and this permission notice appear in all copies of the 47163953Srrs * software, derivative works or modified versions, and any portions 48163953Srrs * thereof, and that both notices appear in supporting documentation. 49163953Srrs * 50163953Srrs * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" 51170091Srrs * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND 52185694Srrs * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. 53164085Srrs * 54163953Srrs * Carnegie Mellon requests users of this software to return to 55163953Srrs * 56217611Stuexen * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU 57217760Stuexen * School of Computer Science 58170091Srrs * Carnegie Mellon University 59163953Srrs * Pittsburgh PA 15213-3890 60163953Srrs * 61163953Srrs * any improvements or extensions that they make and grant Carnegie the 62163953Srrs * rights to redistribute these changes. 63163953Srrs * 64179783Srrs * $FreeBSD: head/sys/vm/pmap.h 120831 2003-10-06 01:47:12Z bms $ 65179783Srrs */ 66163953Srrs 67179783Srrs/* 68163953Srrs * Machine address mapping definitions -- machine-independent 69163953Srrs * section. [For machine-dependent section, see "machine/pmap.h".] 70163953Srrs */ 71163953Srrs 72163953Srrs#ifndef _PMAP_VM_ 73179783Srrs#define _PMAP_VM_ 74170056Srrs/* 75163953Srrs * Each machine dependent implementation is expected to 76163953Srrs * keep certain statistics. They may do this anyway they 77163953Srrs * so choose, but are expected to return the statistics 78163953Srrs * in the following structure. 79163953Srrs */ 80179783Srrsstruct pmap_statistics { 81179783Srrs long resident_count; /* # of pages mapped (total) */ 82179783Srrs long wired_count; /* # of pages wired */ 83179783Srrs}; 84179783Srrstypedef struct pmap_statistics *pmap_statistics_t; 85179783Srrs 86179783Srrs#include <machine/pmap.h> 87179783Srrs 88179783Srrs#ifdef _KERNEL 89163953Srrsstruct proc; 90163953Srrsstruct thread; 91179783Srrs 92179783Srrs/* 93179783Srrs * Updates to kernel_vm_end are synchronized by the kernel_map's system mutex. 94179783Srrs */ 95179783Srrsextern vm_offset_t kernel_vm_end; 96163953Srrs 97166023Srrsextern int pmap_pagedaemon_waken; 98163953Srrs 99179157Srrsvoid pmap_change_wiring(pmap_t, vm_offset_t, boolean_t); 100228653Stuexenvoid pmap_clear_modify(vm_page_t m); 101163953Srrsvoid pmap_clear_reference(vm_page_t m); 102163953Srrsvoid pmap_copy(pmap_t, pmap_t, vm_offset_t, vm_size_t, vm_offset_t); 103197257Stuexenvoid pmap_copy_page(vm_page_t, vm_page_t); 104163953Srrsvoid pmap_enter(pmap_t, vm_offset_t, vm_page_t, vm_prot_t, 105163953Srrs boolean_t); 106163953Srrsvm_page_t pmap_enter_quick(pmap_t pmap, vm_offset_t va, vm_page_t m, 107163953Srrs vm_page_t mpte); 108197257Stuexenvm_paddr_t pmap_extract(pmap_t pmap, vm_offset_t va); 109197257Stuexenvm_page_t pmap_extract_and_hold(pmap_t pmap, vm_offset_t va, 110197257Stuexen vm_prot_t prot); 111197257Stuexenvoid pmap_growkernel(vm_offset_t); 112163953Srrsvoid pmap_init(vm_paddr_t, vm_paddr_t); 113197257Stuexenboolean_t pmap_is_modified(vm_page_t m); 114163953Srrsboolean_t pmap_is_prefaultable(pmap_t pmap, vm_offset_t va); 115163953Srrsboolean_t pmap_ts_referenced(vm_page_t m); 116163953Srrsvm_offset_t pmap_map(vm_offset_t *, vm_paddr_t, vm_paddr_t, int); 117163953Srrsvoid pmap_object_init_pt(pmap_t pmap, vm_offset_t addr, 118197257Stuexen vm_object_t object, vm_pindex_t pindex, vm_size_t size); 119163953Srrsboolean_t pmap_page_exists_quick(pmap_t pmap, vm_page_t m); 120163953Srrsvoid pmap_page_protect(vm_page_t m, vm_prot_t prot); 121163953Srrsvoid pmap_pinit(pmap_t); 122163953Srrsvoid pmap_pinit0(pmap_t); 123163953Srrsvoid pmap_pinit2(pmap_t); 124190689Srrsvoid pmap_protect(pmap_t, vm_offset_t, vm_offset_t, vm_prot_t); 125190689Srrsvoid pmap_qenter(vm_offset_t, vm_page_t *, int); 126190689Srrsvoid pmap_qremove(vm_offset_t, int); 127190689Srrsvoid pmap_release(pmap_t); 128163953Srrsvoid pmap_remove(pmap_t, vm_offset_t, vm_offset_t); 129163953Srrsvoid pmap_remove_all(vm_page_t m); 130163953Srrsvoid pmap_remove_pages(pmap_t, vm_offset_t, vm_offset_t); 131163953Srrsvoid pmap_zero_page(vm_page_t); 132163953Srrsvoid pmap_zero_page_area(vm_page_t, int off, int size); 133179783Srrsvoid pmap_zero_page_idle(vm_page_t); 134170744Srrsint pmap_mincore(pmap_t pmap, vm_offset_t addr); 135170744Srrsvoid pmap_activate(struct thread *td); 136170744Srrsvm_offset_t pmap_addr_hint(vm_object_t obj, vm_offset_t addr, vm_size_t size); 137170744Srrsvoid *pmap_kenter_temporary(vm_offset_t pa, int i); 138170744Srrsvoid pmap_init2(void); 139170744Srrs 140163953Srrs#define pmap_resident_count(pm) ((pm)->pm_stats.resident_count) 141163953Srrs#define pmap_wired_count(pm) ((pm)->pm_stats.wired_count) 142163953Srrs 143163953Srrs#endif /* _KERNEL */ 144163953Srrs#endif /* _PMAP_VM_ */ 145163953Srrs