]> git.saurik.com Git - apple/xnu.git/blobdiff - osfmk/kern/simple_lock.h
xnu-3789.51.2.tar.gz
[apple/xnu.git] / osfmk / kern / simple_lock.h
index 4c9c7b31c2c860a31e7af569a15b06b582e7bc63..8ef311a88731d955abb19258ddcad0e6812b410a 100644 (file)
@@ -89,7 +89,7 @@ extern void                   hw_lock_unlock(
 
 extern unsigned int            hw_lock_to(
                                        hw_lock_t,
-                                       unsigned int);
+                                       uint64_t);
 
 extern unsigned int            hw_lock_try(
                                        hw_lock_t);
@@ -102,25 +102,41 @@ extern unsigned int               hw_lock_held(
 __BEGIN_DECLS
 
 extern uint32_t                        hw_atomic_add(
-                                       uint32_t        *dest,
+                                       volatile uint32_t       *dest,
                                        uint32_t        delt);
 
 extern uint32_t                        hw_atomic_sub(
-                                       uint32_t        *dest,
+                                       volatile uint32_t       *dest,
                                        uint32_t        delt);
 
 extern uint32_t                        hw_atomic_or(
-                                       uint32_t        *dest,
+                                       volatile uint32_t       *dest,
                                        uint32_t        mask);
 
 extern uint32_t                        hw_atomic_and(
-                                       uint32_t        *dest,
+                                       volatile uint32_t       *dest,
+                                       uint32_t        mask);
+
+/*
+ * Variant of hw_atomic_or which doesn't return a value; potentially
+ * more efficient on some platforms.
+ */
+extern void                    hw_atomic_or_noret(
+                                       volatile uint32_t       *dest,
+                                       uint32_t        mask);
+/*
+ * Variant of hw_atomic_and which doesn't return a value; potentially
+ * more efficient on some platforms.
+ */
+
+extern void                    hw_atomic_and_noret(
+                                       volatile uint32_t       *dest,
                                        uint32_t        mask);
 
 extern uint32_t                        hw_compare_and_store(
                                        uint32_t        oldval,
                                        uint32_t        newval,
-                                       uint32_t        *dest);
+                                       volatile uint32_t       *dest);
 
 extern void                    hw_queue_atomic(
                                        unsigned int *anchor,
@@ -150,6 +166,9 @@ extern void                 usimple_unlock(
 extern unsigned int            usimple_lock_try(
                                        usimple_lock_t);
 
+extern void            usimple_lock_try_lock_loop(
+                                       usimple_lock_t);
+
 __END_DECLS
 
 #define        ETAP_NO_TRACE   0
@@ -165,9 +184,8 @@ __END_DECLS
 #define        simple_lock(l)          usimple_lock(l)
 #define        simple_unlock(l)        usimple_unlock(l)
 #define simple_lock_try(l)     usimple_lock_try(l)
+#define simple_lock_try_lock_loop(l)   usimple_lock_try_lock_loop(l)
 #define simple_lock_addr(l)    (&(l))
-#define thread_sleep_simple_lock(l, e, i) \
-                               thread_sleep_usimple_lock((l), (e), (i))
 #endif /* !defined(simple_lock_init) */
 
 #endif /*!_KERN_SIMPLE_LOCK_H_*/