X-Git-Url: https://git.saurik.com/apple/xnu.git/blobdiff_plain/d7e50217d7adf6e52786a38bcaa4cd698cb9a79e..d12e16782ebf8bb779633dff9e14486293bf6d07:/osfmk/vm/memory_object.c?ds=sidebyside diff --git a/osfmk/vm/memory_object.c b/osfmk/vm/memory_object.c index c3e0f22f0..b65cc9948 100644 --- a/osfmk/vm/memory_object.c +++ b/osfmk/vm/memory_object.c @@ -3,22 +3,19 @@ * * @APPLE_LICENSE_HEADER_START@ * - * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved. + * 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. * - * 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 + * This 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, QUIET ENJOYMENT OR NON-INFRINGEMENT. - * Please see the License for the specific language governing rights and - * limitations under the License. + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. * * @APPLE_LICENSE_HEADER_END@ */ @@ -135,7 +132,7 @@ vm_object_update(vm_object_t, vm_object_offset_t, #define memory_object_should_return_page(m, should_return) \ (should_return != MEMORY_OBJECT_RETURN_NONE && \ - (((m)->dirty || ((m)->dirty = pmap_is_modified((m)->phys_page))) || \ + (((m)->dirty || ((m)->dirty = pmap_is_modified((m)->phys_addr))) || \ ((m)->precious && (should_return) == MEMORY_OBJECT_RETURN_ALL) || \ (should_return) == MEMORY_OBJECT_RETURN_ANYTHING)) @@ -258,7 +255,7 @@ memory_object_lock_page( if (prot != VM_PROT_NO_CHANGE) { if ((m->page_lock ^ prot) & prot) { - pmap_page_protect(m->phys_page, VM_PROT_ALL & ~prot); + pmap_page_protect(m->phys_addr, VM_PROT_ALL & ~prot); } #if 0 /* code associated with the vestigial @@ -303,7 +300,7 @@ memory_object_lock_page( vm_page_unlock_queues(); if (!should_flush) - pmap_page_protect(m->phys_page, VM_PROT_NONE); + pmap_page_protect(m->phys_addr, VM_PROT_NONE); if (m->dirty) return(MEMORY_OBJECT_LOCK_RESULT_MUST_CLEAN); @@ -409,7 +406,7 @@ memory_object_lock_request( if ((prot & ~VM_PROT_ALL) != 0 && prot != VM_PROT_NO_CHANGE) return (KERN_INVALID_ARGUMENT); - size = round_page_64(size); + size = round_page(size); /* * Lock the object, and acquire a paging reference to @@ -963,7 +960,7 @@ vm_object_set_attributes_common( temporary = TRUE; if (cluster_size != 0) { int pages_per_cluster; - pages_per_cluster = atop_32(cluster_size); + pages_per_cluster = atop(cluster_size); /* * Cluster size must be integral multiple of page size, * and be a power of 2 number of pages. @@ -1099,7 +1096,7 @@ memory_object_change_attributes( perf = (memory_object_perf_info_t) attributes; may_cache = perf->may_cache; - cluster_size = round_page_32(perf->cluster_size); + cluster_size = round_page(perf->cluster_size); break; } @@ -1424,7 +1421,7 @@ host_default_memory_manager( mutex_unlock(&memory_manager_default_lock); return KERN_INVALID_ARGUMENT; #else - cluster_size = round_page_32(cluster_size); + cluster_size = round_page(cluster_size); #endif } memory_manager_default_cluster = cluster_size; @@ -1551,12 +1548,12 @@ memory_object_deactivate_pages( if ((m->wire_count == 0) && (!m->private) && (!m->gobbled) && (!m->busy)) { m->reference = FALSE; - pmap_clear_reference(m->phys_page); + pmap_clear_reference(m->phys_addr); if ((kill_page) && (object->internal)) { m->precious = FALSE; m->dirty = FALSE; - pmap_clear_modify(m->phys_page); + pmap_clear_modify(m->phys_addr); vm_external_state_clr(object->existence_map, offset); } VM_PAGE_QUEUES_REMOVE(m); @@ -1610,7 +1607,7 @@ memory_object_page_op( memory_object_control_t control, memory_object_offset_t offset, int ops, - ppnum_t *phys_entry, + vm_offset_t *phys_entry, int *flags) { vm_object_t object; @@ -1626,8 +1623,8 @@ memory_object_page_op( if(ops & UPL_POP_PHYSICAL) { if(object->phys_contiguous) { if (phys_entry) { - *phys_entry = (ppnum_t) - (object->shadow_offset >> 12); + *phys_entry = (vm_offset_t) + object->shadow_offset; } vm_object_unlock(object); return KERN_SUCCESS; @@ -1678,7 +1675,7 @@ memory_object_page_op( if(dst_page->busy) *flags |= UPL_POP_BUSY; } if (phys_entry) - *phys_entry = dst_page->phys_page; + *phys_entry = dst_page->phys_addr; /* The caller should have made a call either contingent with */ /* or prior to this call to set UPL_POP_BUSY */