pmap.h revision 27922
11590Srgrimes/* 21590Srgrimes * Copyright (c) 1991, 1993 31590Srgrimes * The Regents of the University of California. All rights reserved. 41590Srgrimes * 51590Srgrimes * This code is derived from software contributed to Berkeley by 61590Srgrimes * The Mach Operating System project at Carnegie-Mellon University. 71590Srgrimes * 81590Srgrimes * Redistribution and use in source and binary forms, with or without 91590Srgrimes * modification, are permitted provided that the following conditions 101590Srgrimes * are met: 111590Srgrimes * 1. Redistributions of source code must retain the above copyright 121590Srgrimes * notice, this list of conditions and the following disclaimer. 131590Srgrimes * 2. Redistributions in binary form must reproduce the above copyright 141590Srgrimes * notice, this list of conditions and the following disclaimer in the 151590Srgrimes * documentation and/or other materials provided with the distribution. 161590Srgrimes * 3. All advertising materials mentioning features or use of this software 171590Srgrimes * must display the following acknowledgement: 181590Srgrimes * This product includes software developed by the University of 191590Srgrimes * California, Berkeley and its contributors. 201590Srgrimes * 4. Neither the name of the University nor the names of its contributors 211590Srgrimes * may be used to endorse or promote products derived from this software 221590Srgrimes * without specific prior written permission. 231590Srgrimes * 241590Srgrimes * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 251590Srgrimes * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 261590Srgrimes * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 271590Srgrimes * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 281590Srgrimes * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 291590Srgrimes * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 301590Srgrimes * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 311590Srgrimes * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 321590Srgrimes * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 331590Srgrimes * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 341590Srgrimes * SUCH DAMAGE. 3527423Scharnier * 361590Srgrimes * from: @(#)pmap.h 8.1 (Berkeley) 6/11/93 371590Srgrimes * 381590Srgrimes * 391590Srgrimes * Copyright (c) 1987, 1990 Carnegie-Mellon University. 401590Srgrimes * All rights reserved. 4127423Scharnier * 421590Srgrimes * Author: Avadis Tevanian, Jr. 4327423Scharnier * 4498254Sjmallett * Permission to use, copy, modify and distribute this software and 4598254Sjmallett * its documentation is hereby granted, provided that both the copyright 4698254Sjmallett * notice and this permission notice appear in all copies of the 4798254Sjmallett * software, derivative works or modified versions, and any portions 481590Srgrimes * thereof, and that both notices appear in supporting documentation. 491590Srgrimes * 501590Srgrimes * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" 511590Srgrimes * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND 521590Srgrimes * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. 531590Srgrimes * 541590Srgrimes * Carnegie Mellon requests users of this software to return to 5527423Scharnier * 561590Srgrimes * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU 571590Srgrimes * School of Computer Science 5899457Smike * Carnegie Mellon University 591590Srgrimes * Pittsburgh PA 15213-3890 60164026Sdds * 611590Srgrimes * any improvements or extensions that they make and grant Carnegie the 62200462Sdelphij * rights to redistribute these changes. 6323511Sache * 641590Srgrimes * $Id: pmap.h,v 1.22 1997/08/05 01:32:50 dyson Exp $ 65164046Sdds */ 661590Srgrimes 671590Srgrimes/* 681590Srgrimes * Machine address mapping definitions -- machine-independent 691590Srgrimes * section. [For machine-dependent section, see "machine/pmap.h".] 701590Srgrimes */ 71164046Sdds 72164021Sdds#ifndef _PMAP_VM_ 73164021Sdds#define _PMAP_VM_ 74164021Sdds 75164021Sdds/* 76164021Sdds * Each machine dependent implementation is expected to 77164028Sdds * keep certain statistics. They may do this anyway they 781590Srgrimes * so choose, but are expected to return the statistics 79164046Sdds * in the following structure. 80164046Sdds */ 81164046Sddsstruct pmap_statistics { 82164046Sdds long resident_count; /* # of pages mapped (total) */ 83164046Sdds long wired_count; /* # of pages wired */ 84164046Sdds}; 85164046Sddstypedef struct pmap_statistics *pmap_statistics_t; 86164046Sdds 871590Srgrimes#include <machine/pmap.h> 88164046Sdds 89164046Sdds#ifdef KERNEL 90164046Sddsvoid pmap_change_wiring __P((pmap_t, vm_offset_t, boolean_t)); 9192920Simpvoid pmap_clear_modify __P((vm_offset_t pa)); 921590Srgrimesvoid pmap_clear_reference __P((vm_offset_t pa)); 931590Srgrimesvoid pmap_copy __P((pmap_t, pmap_t, vm_offset_t, vm_size_t, 9498254Sjmallett vm_offset_t)); 951590Srgrimesvoid pmap_copy_page __P((vm_offset_t, vm_offset_t)); 96164046Sddsvoid pmap_destroy __P((pmap_t)); 97164046Sddsvoid pmap_enter __P((pmap_t, vm_offset_t, vm_offset_t, vm_prot_t, 98164046Sdds boolean_t)); 99164046Sddsvm_offset_t pmap_extract __P((pmap_t, vm_offset_t)); 100164046Sddsvoid pmap_growkernel __P((vm_offset_t)); 101164046Sddsvoid pmap_init __P((vm_offset_t, vm_offset_t)); 102164046Sddsboolean_t pmap_is_modified __P((vm_offset_t pa)); 103164046Sddsboolean_t pmap_ts_referenced __P((vm_offset_t pa)); 104195443Sbrianvoid pmap_kenter __P((vm_offset_t, vm_offset_t)); 105164046Sddsvoid pmap_kremove __P((vm_offset_t)); 106195443Sbrianvm_offset_t pmap_map __P((vm_offset_t, vm_offset_t, vm_offset_t, int)); 107195443Sbrianvoid pmap_object_init_pt __P((pmap_t pmap, vm_offset_t addr, 108164025Sdds vm_object_t object, vm_pindex_t pindex, vm_offset_t size, 109164025Sdds int pagelimit)); 110195443Sbrianboolean_t pmap_page_exists __P((pmap_t, vm_offset_t)); 1111590Srgrimesvoid pmap_page_protect __P((vm_offset_t, vm_prot_t)); 112164046Sddsvoid pmap_pageable __P((pmap_t, vm_offset_t, vm_offset_t, 11398254Sjmallett boolean_t)); 1141590Srgrimesvm_offset_t pmap_phys_address __P((int)); 115164046Sddsvoid pmap_pinit __P((pmap_t)); 11677276Sddvoid pmap_protect __P((pmap_t, vm_offset_t, vm_offset_t, 1171590Srgrimes vm_prot_t)); 11877276Sddvoid pmap_qenter __P((vm_offset_t, vm_page_t *, int)); 11977276Sddvoid pmap_qremove __P((vm_offset_t, int)); 12077276Sddvoid pmap_reference __P((pmap_t)); 121164035Sddsvoid pmap_release __P((pmap_t)); 1221590Srgrimesvoid pmap_remove __P((pmap_t, vm_offset_t, vm_offset_t)); 123164046Sddsvoid pmap_remove_pages __P((pmap_t, vm_offset_t, vm_offset_t)); 124164046Sddsvoid pmap_zero_page __P((vm_offset_t)); 1251590Srgrimesvoid pmap_prefault __P((pmap_t pmap, vm_offset_t addra, 126164046Sdds vm_map_entry_t entry, vm_object_t object)); 127164046Sddsint pmap_mincore __P((pmap_t pmap, vm_offset_t addr)); 128164046Sddsvoid pmap_new_proc __P((struct proc *p)); 1291590Srgrimesvoid pmap_dispose_proc __P((struct proc *p)); 13077276Sddvoid pmap_swapout_proc __P((struct proc *p)); 1311590Srgrimesvoid pmap_swapin_proc __P((struct proc *p)); 13227423Scharniervoid pmap_activate __P((struct proc *p)); 133164035Sddsvm_offset_t pmap_addr_hint __P((vm_object_t obj, vm_offset_t addr, vm_size_t size)); 1341590Srgrimes 135164046Sdds#endif /* KERNEL */ 136164046Sdds 137164046Sdds#endif /* _PMAP_VM_ */ 138164046Sdds