]> git.saurik.com Git - apple/xnu.git/blobdiff - osfmk/kern/locks.h
xnu-2422.115.4.tar.gz
[apple/xnu.git] / osfmk / kern / locks.h
index 659336194cd76b8cac6ade2ac905186919280ee2..dbf40e76bf8d88c6a54db14203dbf0209ec0b16d 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003-2007 Apple Inc. All rights reserved.
+ * Copyright (c) 2003-2012 Apple Inc. All rights reserved.
  *
  * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
  * 
@@ -40,7 +40,7 @@
 #include       <kern/queue.h>
 
 extern void                            lck_mod_init(
-                                                               void) __attribute__((section("__TEXT, initcode")));
+                                                               void);
 
 typedef        unsigned int    lck_type_t;
 
@@ -286,12 +286,8 @@ extern void                                lck_mtx_init(
 extern void                            lck_mtx_lock(
                                                                        lck_mtx_t               *lck);
 
-#if    defined(__i386__)
-extern void    lck_mtx_unlock(lck_mtx_t                *lck) __DARWIN10_ALIAS(lck_mtx_unlock);
-#else
 extern void                            lck_mtx_unlock(
                                                                        lck_mtx_t               *lck);
-#endif /* __i386__ */
 
 extern void                            lck_mtx_destroy(
                                                                        lck_mtx_t               *lck,
@@ -328,6 +324,9 @@ extern void                         lck_mtx_yield (
 extern boolean_t               lck_mtx_try_lock_spin(
                                                                        lck_mtx_t               *lck);
 
+extern boolean_t               lck_mtx_try_lock_spin_always(
+                                                                       lck_mtx_t               *lck);
+
 extern void                    lck_mtx_lock_spin_always(
                                                                        lck_mtx_t               *lck);
 
@@ -342,6 +341,7 @@ extern void                 lck_mtx_convert_spin(
 #else
 #define lck_mtx_try_lock_spin(l)       lck_mtx_try_lock(l)
 #define        lck_mtx_lock_spin(l)            lck_mtx_lock(l)
+#define lck_mtx_try_lock_spin_always(l)        lck_spin_try_lock(l)
 #define lck_mtx_lock_spin_always(l)    lck_spin_lock(l)
 #define lck_mtx_unlock_always(l)       lck_spin_unlock(l)
 #define        lck_mtx_convert_spin(l)         do {} while (0)
@@ -387,7 +387,8 @@ typedef unsigned int         lck_rw_type_t;
 #ifdef XNU_KERNEL_PRIVATE
 #define LCK_RW_ASSERT_SHARED   0x01
 #define LCK_RW_ASSERT_EXCLUSIVE        0x02
-#define LCK_RW_ASSERT_HELD     (LCK_RW_ASSERT_SHARED | LCK_RW_ASSERT_EXCLUSIVE)
+#define LCK_RW_ASSERT_HELD             0x03
+#define LCK_RW_ASSERT_NOTHELD  0x04
 #endif
 
 __BEGIN_DECLS
@@ -430,6 +431,9 @@ extern void                         lck_rw_unlock_exclusive(
 extern void                            lck_rw_assert(
                                                                        lck_rw_t                *lck,
                                                                        unsigned int            type);
+
+extern void                            lck_rw_clear_promotion(
+                                                                       thread_t                thread);
 #endif
 
 #ifdef KERNEL_PRIVATE