X-Git-Url: https://git.saurik.com/apple/xnu.git/blobdiff_plain/1c79356b52d46aa6b508fb032f5ae709b1f2897b..43866e378188c25dd1e2208016ab3cbeb086ae6c:/osfmk/i386/pmap.c diff --git a/osfmk/i386/pmap.c b/osfmk/i386/pmap.c index a4d2b70b3..14edd7326 100644 --- a/osfmk/i386/pmap.c +++ b/osfmk/i386/pmap.c @@ -3,19 +3,22 @@ * * @APPLE_LICENSE_HEADER_START@ * - * The contents of this file constitute Original Code as defined in and - * are subject to the Apple Public Source License Version 1.1 (the - * "License"). You may not use this file except in compliance with the - * License. Please obtain a copy of the License at - * http://www.apple.com/publicsource and read it before using this file. + * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved. * - * This Original Code and all software distributed under the License are - * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the - * License for the specific language governing rights and limitations - * under the License. + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. * * @APPLE_LICENSE_HEADER_END@ */ @@ -552,7 +555,7 @@ pmap_map( ps = PAGE_SIZE; while (start < end) { - pmap_enter(kernel_pmap, virt, start, prot, FALSE); + pmap_enter(kernel_pmap, virt, start, prot, 0, FALSE); virt += ps; start += ps; } @@ -1261,6 +1264,21 @@ pmap_remove_range( pmap->stats.wired_count -= num_unwired; } +/* + * Remove phys addr if mapped in specified map + * + */ +void +pmap_remove_some_phys( + pmap_t map, + vm_offset_t phys_addr) +{ + +/* Implement to support working set code */ + +} + + /* * Remove the given range of addresses * from the specified map. @@ -1400,9 +1418,6 @@ pmap_page_protect( /* * Remove the mapping, collecting any modify bits. */ - if (iswired(*pte)) - panic("pmap_remove_all removing a wired page"); - { register int i = ptes_per_vm_page; @@ -1569,6 +1584,7 @@ pmap_enter( vm_offset_t v, register vm_offset_t pa, vm_prot_t prot, + unsigned int flags, boolean_t wired) { register pt_entry_t *pte; @@ -2011,6 +2027,7 @@ pmap_change_wiring( register int i; spl_t spl; +#if 0 /* * We must grab the pmap system lock because we may * change a pte_page queue. @@ -2043,6 +2060,11 @@ pmap_change_wiring( } PMAP_READ_UNLOCK(map, spl); + +#else + return; +#endif + } /* @@ -2909,7 +2931,7 @@ pmap_movepage(unsigned long from, unsigned long to, vm_size_t size) PMAP_READ_UNLOCK(kernel_pmap, spl); pmap_enter(kernel_pmap, to, i386_trunc_page(*pte), - VM_PROT_READ|VM_PROT_WRITE, *pte & INTEL_PTE_WIRED); + VM_PROT_READ|VM_PROT_WRITE, 0, *pte & INTEL_PTE_WIRED); pmap_remove(kernel_pmap, from, from+PAGE_SIZE); @@ -2960,3 +2982,12 @@ kern_return_t bmapmapr(vm_offset_t va) { } #endif +/* temporary workaround */ +boolean_t +coredumpok(vm_map_t map, vm_offset_t va) +{ + pt_entry_t *ptep; + ptep = pmap_pte(map->pmap, va); + if (0 == ptep) return FALSE; + return ((*ptep & (INTEL_PTE_NCACHE|INTEL_PTE_WIRED)) != (INTEL_PTE_NCACHE|INTEL_PTE_WIRED)); +}