* the rights to redistribute these changes.
*/
-#ifndef _PPC_HW_LOCK_H_
-#define _PPC_HW_LOCK_H_
+#ifndef _PPC_LOCK_H_
+#define _PPC_LOCK_H_
+
+#include <sys/appleapiopts.h>
+
+#ifdef __APPLE_API_PRIVATE
#include <kern/macro_help.h>
#include <kern/assert.h>
-#define NEED_ATOMIC 1
+extern unsigned int LockTimeOut; /* Number of hardware ticks of a lock timeout */
+
+#if defined(MACH_KERNEL_PRIVATE)
-#define mutex_try _mutex_try
-#define mutex_lock(m) \
-MACRO_BEGIN \
- assert(assert_wait_possible()); \
- _mutex_lock((m)); \
-MACRO_END
+#include <cpus.h>
-extern unsigned int LockTimeOut; /* Number of hardware ticks of a lock timeout */
+#if !(NCPUS == 1 || ETAP_LOCK_TRACE || USLOCK_DEBUG)
+
+#include <ppc/hw_lock_types.h>
+
+#define simple_lock_init(l,t) hw_lock_init(l)
+#define __slock_held_func__(l) hw_lock_held(l)
+
+extern void fast_usimple_lock(simple_lock_t);
+extern void fast_usimple_unlock(simple_lock_t);
+extern unsigned int fast_usimple_lock_try(simple_lock_t);
+
+#define simple_lock(l) fast_usimple_lock(l)
+#define simple_unlock(l) fast_usimple_unlock(l)
+#define simple_lock_try(l) fast_usimple_lock_try(l)
+#define simple_lock_addr(l) (&(l))
+#define thread_sleep_simple_lock(l, e, i) \
+ thread_sleep_fast_usimple_lock((l), (e), (i))
+
+#endif /* !(NCPUS == 1 || ETAP_LOCK_TRACE || USLOCK_DEBUG) */
+
+#endif /* MACH_KERNEL_PRIVATE */
+
+#endif /* __APPLE_API_PRIVATE */
-#endif /* _PPC_HW_LOCK_H_ */
+#endif /* _PPC_LOCK_H_ */