]> git.saurik.com Git - apple/xnu.git/blobdiff - osfmk/kern/zalloc.c
xnu-792.24.17.tar.gz
[apple/xnu.git] / osfmk / kern / zalloc.c
index 45de75913111ecc24c5c755f54fa4aafab11d8bb..bb68d22362e4d4b5524694dbf5a25e7d8aa015b9 100644 (file)
@@ -1,29 +1,23 @@
 /*
  * Copyright (c) 2000-2004 Apple Computer, Inc. All rights reserved.
  *
- * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
+ * @APPLE_LICENSE_HEADER_START@
  * 
- * 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. The rights granted to you under the License
- * may not be used to create, or enable the creation or redistribution of,
- * unlawful or unlicensed copies of an Apple operating system, or to
- * circumvent, violate, or enable the circumvention or violation of, any
- * terms of an Apple operating system software license agreement.
+ * 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.
  * 
- * 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_OSREFERENCE_LICENSE_HEADER_END@
+ * @APPLE_LICENSE_HEADER_END@
  */
 /*
  * @OSF_COPYRIGHT@
 #else /* !defined(__alpha) */
 
 #define is_kernel_data_addr(a)                                         \
-  (!(a) || ((a) >= vm_min_kernel_address && !((a) & 0x3)))
+  (!(a) || ((a) >= VM_MIN_KERNEL_ADDRESS && !((a) & 0x3)))
 
 #endif /* defined(__alpha) */
 
@@ -1233,7 +1227,7 @@ zone_gc(void)
                 */
 
                scan = (void *)z->free_elements;
-               z->free_elements = 0;
+               (void *)z->free_elements = NULL;
 
                unlock_zone(z);
 
@@ -1277,7 +1271,7 @@ zone_gc(void)
 
                                        if (keep != NULL) {
                                                tail->next = (void *)z->free_elements;
-                                               z->free_elements = (vm_offset_t) keep;
+                                               (void *)z->free_elements = keep;
                                                tail = keep = NULL;
                                        } else {
                                                m =0;
@@ -1289,7 +1283,7 @@ zone_gc(void)
                                                }
                                                if (m !=0 ) {
                                                        prev->next = (void *)z->free_elements;
-                                                       z->free_elements = (vm_offset_t) base_elt;
+                                                       (void *)z->free_elements = (void *)base_elt;
                                                        base_prev->next = elt;
                                                        prev = base_prev;
                                                }
@@ -1314,7 +1308,7 @@ zone_gc(void)
                        lock_zone(z);
 
                        tail->next = (void *)z->free_elements;
-                       z->free_elements = (vm_offset_t) keep;
+                       (void *)z->free_elements = keep;
 
                        unlock_zone(z);
                }
@@ -1367,7 +1361,7 @@ zone_gc(void)
 
                                if (keep != NULL) {
                                        tail->next = (void *)z->free_elements;
-                                       z->free_elements = (vm_offset_t) keep;
+                                       (void *)z->free_elements = keep;
                                }
 
                                if (z->waiting) {
@@ -1394,7 +1388,7 @@ zone_gc(void)
 
                        if (keep != NULL) {
                                tail->next = (void *)z->free_elements;
-                               z->free_elements = (vm_offset_t) keep;
+                               (void *)z->free_elements = keep;
                        }
 
                }
@@ -1480,7 +1474,7 @@ host_zone_info(
 #ifdef ppc
        max_zones = num_zones + 4;
 #else
-       max_zones = num_zones + 3; /* ATN: count the number below!! */
+       max_zones = num_zones + 2;
 #endif
        z = first_zone;
        simple_unlock(&all_zones_lock);
@@ -1564,15 +1558,6 @@ host_zone_info(
        zn++;
        zi++;
 #endif
-
-#ifdef i386
-       strcpy(zn->zn_name, "page_tables");
-       pt_fake_zone_info(&zi->zi_count, &zi->zi_cur_size, &zi->zi_max_size, &zi->zi_elem_size,
-                         &zi->zi_alloc_size, &zi->zi_collectable, &zi->zi_exhaustible);
-       zn++;
-       zi++;
-#endif
-
        strcpy(zn->zn_name, "kalloc.large");
        kalloc_fake_zone_info(&zi->zi_count, &zi->zi_cur_size, &zi->zi_max_size, &zi->zi_elem_size,
                               &zi->zi_alloc_size, &zi->zi_collectable, &zi->zi_exhaustible);