-#ifdef MACH_KERNEL
-#define DPT_LOCK_INIT(lock) mutex_init(&(lock), ETAP_DPAGE_VSTRUCT)
-#define DPT_LOCK(lock) mutex_lock(&(lock))
-#define DPT_UNLOCK(lock) mutex_unlock(&(lock))
-#define DPT_SLEEP(lock, e, i) thread_sleep_mutex(&(lock), (event_t)(e), i)
-#define VS_LOCK_TYPE hw_lock_data_t
-#define VS_LOCK_INIT(vs) hw_lock_init(&(vs)->vs_lock)
-#define VS_TRY_LOCK(vs) (VS_LOCK(vs),TRUE)
-#define VS_LOCK(vs) hw_lock_lock(&(vs)->vs_lock)
-#define VS_UNLOCK(vs) hw_lock_unlock(&(vs)->vs_lock)
-#define VS_MAP_LOCK_TYPE mutex_t
-#define VS_MAP_LOCK_INIT(vs) mutex_init(&(vs)->vs_map_lock, ETAP_DPAGE_VSMAP)
-#define VS_MAP_LOCK(vs) mutex_lock(&(vs)->vs_map_lock)
-#define VS_MAP_TRY_LOCK(vs) mutex_try(&(vs)->vs_map_lock)
-#define VS_MAP_UNLOCK(vs) mutex_unlock(&(vs)->vs_map_lock)
-#else
-#define VS_LOCK_TYPE struct mutex
-#define VS_LOCK_INIT(vs) mutex_init(&(vs)->vs_lock, ETAP_DPAGE_VSTRUCT)
-#define VS_TRY_LOCK(vs) mutex_try(&(vs)->vs_lock)
-#define VS_LOCK(vs) mutex_lock(&(vs)->vs_lock)
-#define VS_UNLOCK(vs) mutex_unlock(&(vs)->vs_lock)
-#define VS_MAP_LOCK_TYPE struct mutex
-#define VS_MAP_LOCK_INIT(vs) mutex_init(&(vs)->vs_map_lock)
-#define VS_MAP_LOCK(vs) mutex_lock(&(vs)->vs_map_lock)
-#define VS_MAP_TRY_LOCK(vs) mutex_try(&(vs)->vs_map_lock)
-#define VS_MAP_UNLOCK(vs) mutex_unlock(&(vs)->vs_map_lock)
-#endif
+#define DPT_LOCK_INIT(lock) lck_mtx_init(&(lock), &default_pager_lck_grp, &default_pager_lck_attr)
+#define DPT_LOCK_DESTROY(lock) lck_mtx_destroy(&(lock), &default_pager_lck_grp)
+#define DPT_LOCK(lock) lck_mtx_lock(&(lock))
+#define DPT_UNLOCK(lock) lck_mtx_unlock(&(lock))
+#define DPT_SLEEP(lock, e, i) lck_mtx_sleep(&(lock), LCK_SLEEP_DEFAULT, (event_t)(e), i)
+#define VS_LOCK_TYPE hw_lock_data_t
+#define VS_LOCK_INIT(vs) hw_lock_init(&(vs)->vs_lock)
+#define VS_TRY_LOCK(vs) (VS_LOCK(vs),TRUE)
+#define VS_LOCK(vs) hw_lock_lock(&(vs)->vs_lock)
+#define VS_UNLOCK(vs) hw_lock_unlock(&(vs)->vs_lock)
+#define VS_MAP_LOCK_TYPE lck_mtx_t
+#define VS_MAP_LOCK_INIT(vs) lck_mtx_init(&(vs)->vs_map_lock, &default_pager_lck_grp, &default_pager_lck_attr)
+#define VS_MAP_LOCK_DESTROY(vs) lck_mtx_destroy(&(vs)->vs_map_lock, &default_pager_lck_grp)
+#define VS_MAP_LOCK(vs) lck_mtx_lock(&(vs)->vs_map_lock)
+#define VS_MAP_TRY_LOCK(vs) lck_mtx_try_lock(&(vs)->vs_map_lock)
+#define VS_MAP_UNLOCK(vs) lck_mtx_unlock(&(vs)->vs_map_lock)