]> git.saurik.com Git - apple/xnu.git/blobdiff - osfmk/default_pager/dp_memory_object.c
xnu-344.32.tar.gz
[apple/xnu.git] / osfmk / default_pager / dp_memory_object.c
index 353b2d9f274d129fb73a08a8cbb2dc164deb3d9a..da49b7bf886e235d8cd1f1361c97fea6ab22abe3 100644 (file)
@@ -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@
  */
@@ -659,7 +656,7 @@ dp_memory_object_data_initialize(
        DEBUG(DEBUG_MO_EXTERNAL,
              ("mem_obj=0x%x,offset=0x%x,cnt=0x%x\n",
               (int)mem_obj, (int)offset, (int)size));
-       GSTAT(global_stats.gs_pages_init += atop_32(size));
+       GSTAT(global_stats.gs_pages_init += atop(size));
 
        vs_lookup(mem_obj, vs);
        vs_lock(vs);
@@ -900,10 +897,10 @@ default_pager_objects(
        if (kr != KERN_SUCCESS)
                return kr;
 
-       osize = round_page_32(*ocountp * sizeof * objects);
+       osize = round_page(*ocountp * sizeof * objects);
        kr = vm_map_wire(ipc_kernel_map, 
-                       trunc_page_32((vm_offset_t)objects),
-                       round_page_32(((vm_offset_t)objects) + osize), 
+                       trunc_page((vm_offset_t)objects),
+                       round_page(((vm_offset_t)objects) + osize), 
                        VM_PROT_READ|VM_PROT_WRITE, FALSE);
        osize=0;
 
@@ -929,7 +926,7 @@ default_pager_objects(
                vm_offset_t     newaddr;
                vm_size_t       newsize;
 
-               newsize = 2 * round_page_32(actual * sizeof * objects);
+               newsize = 2 * round_page(actual * sizeof * objects);
 
                kr = vm_allocate(kernel_map, &newaddr, newsize, TRUE);
                if (kr != KERN_SUCCESS)
@@ -945,7 +942,7 @@ default_pager_objects(
                vm_offset_t     newaddr;
                vm_size_t       newsize;
 
-               newsize = 2 * round_page_32(actual * sizeof * pagers);
+               newsize = 2 * round_page(actual * sizeof * pagers);
 
                kr = vm_allocate(kernel_map, &newaddr, newsize, TRUE);
                if (kr != KERN_SUCCESS)
@@ -1043,7 +1040,7 @@ default_pager_objects(
        } else {
                vm_offset_t used;
 
-               used = round_page_32(actual * sizeof * objects);
+               used = round_page(actual * sizeof * objects);
 
                if (used != osize)
                        (void) vm_deallocate(kernel_map,
@@ -1069,7 +1066,7 @@ default_pager_objects(
        } else {
                vm_offset_t used;
 
-               used = round_page_32(actual * sizeof * pagers);
+               used = round_page(actual * sizeof * pagers);
 
                if (used != psize)
                        (void) vm_deallocate(kernel_map,
@@ -1125,10 +1122,10 @@ default_pager_object_pages(
        if (kr != KERN_SUCCESS)
                return kr;
 
-       size = round_page_32(*countp * sizeof * pages);
+       size = round_page(*countp * sizeof * pages);
        kr = vm_map_wire(ipc_kernel_map, 
-                       trunc_page_32((vm_offset_t)pages),
-                       round_page_32(((vm_offset_t)pages) + size), 
+                       trunc_page((vm_offset_t)pages),
+                       round_page(((vm_offset_t)pages) + size), 
                        VM_PROT_READ|VM_PROT_WRITE, FALSE);
        size=0;
 
@@ -1184,7 +1181,7 @@ default_pager_object_pages(
 
                if (pages != *pagesp)
                        (void) vm_deallocate(kernel_map, addr, size);
-               size = round_page_32(actual * sizeof * pages);
+               size = round_page(actual * sizeof * pages);
                kr = vm_allocate(kernel_map, &addr, size, TRUE);
                if (kr != KERN_SUCCESS)
                        return kr;
@@ -1213,7 +1210,7 @@ default_pager_object_pages(
        } else {
                vm_offset_t used;
 
-               used = round_page_32(actual * sizeof * pages);
+               used = round_page(actual * sizeof * pages);
 
                if (used != size)
                        (void) vm_deallocate(kernel_map,