]> git.saurik.com Git - apple/xnu.git/blobdiff - bsd/net/init.c
xnu-1699.22.73.tar.gz
[apple/xnu.git] / bsd / net / init.c
index 91617387c90c0e0cf4ed4f7feb0f0cb0e57adf0f..85464da74d9263f439f51a4f080b243907c30d34 100644 (file)
@@ -1,14 +1,19 @@
 /*
  * Copyright (c) 2000-2004 Apple Computer, Inc. All rights reserved.
  *
- * @APPLE_LICENSE_HEADER_START@
+ * @APPLE_OSREFERENCE_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. Please obtain a copy of the License at
- * http://www.opensource.apple.com/apsl/ and read it before using this
- * file.
+ * 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.
+ * 
+ * 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
@@ -18,7 +23,7 @@
  * Please see the License for the specific language governing rights and
  * limitations under the License.
  * 
- * @APPLE_LICENSE_HEADER_END@
+ * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
  */
 
 #include <kern/kalloc.h>
@@ -68,8 +73,7 @@ net_init_add(
                        kfree(entry, sizeof(*entry));
                        return EALREADY;
                }
-       } while(!OSCompareAndSwap((UInt32)entry->next, (UInt32)entry,
-                                                         (UInt32*)&list_head));
+       } while(!OSCompareAndSwapPtr(entry->next, entry, &list_head));
        
        return 0;
 }
@@ -87,8 +91,7 @@ net_init_run(void)
         */
        do {
                backward_head = list_head;
-       } while (!OSCompareAndSwap((UInt32)backward_head, (UInt32)LIST_RAN,
-                                                          (UInt32*)&list_head));
+       } while (!OSCompareAndSwapPtr(backward_head, LIST_RAN, &list_head));
        
        /* Reverse the order of the list */
        while (backward_head != 0) {