]> git.saurik.com Git - apple/xnu.git/blobdiff - osfmk/ipc/ipc_space.h
xnu-344.tar.gz
[apple/xnu.git] / osfmk / ipc / ipc_space.h
index 33431cf9b1babe3c0af7cfa991e6c3bfa4695270..6ac5349513c73c1e8cef00e1f554d7bb0a7b8eac 100644 (file)
 #include <mach/kern_return.h>
 #include <mach/vm_types.h>
 
+#include <sys/appleapiopts.h>
+
+#ifdef __APPLE_API_PRIVATE
 #ifdef MACH_KERNEL_PRIVATE
 #include <mach_kdb.h>
 #include <kern/macro_help.h>
+#include <kern/kern_types.h>
 #include <kern/lock.h>
 #include <kern/task.h>
 #include <kern/zalloc.h>
@@ -157,10 +161,16 @@ MACRO_END
 
 #define        is_read_lock(is)        mutex_lock(&(is)->is_lock_data)
 #define is_read_unlock(is)     mutex_unlock(&(is)->is_lock_data)
+#define is_read_sleep(is)      thread_sleep_mutex((event_t)(is),       \
+                                                  &(is)->is_lock_data, \
+                                                  THREAD_UNINT)
 
 #define        is_write_lock(is)       mutex_lock(&(is)->is_lock_data)
 #define        is_write_lock_try(is)   mutex_try(&(is)->is_lock_data)
 #define is_write_unlock(is)    mutex_unlock(&(is)->is_lock_data)
+#define is_write_sleep(is)     thread_sleep_mutex((event_t)(is),       \
+                                                  &(is)->is_lock_data, \
+                                                  THREAD_UNINT)
 
 #define        is_reference(is)        ipc_space_reference(is)
 #define        is_release(is)          ipc_space_release(is)
@@ -170,11 +180,29 @@ MACRO_END
 #define        current_space_fast()    (current_task_fast()->itk_space)
 #define current_space()                (current_space_fast())
 
-#else /* !MACH_KERNEL_PRIVATE */
+/* Create a special IPC space */
+extern kern_return_t ipc_space_create_special(
+       ipc_space_t     *spacep);
 
-extern ipc_space_t             current_space(void);
+/* Create  new IPC space */
+extern kern_return_t ipc_space_create(
+       ipc_table_size_t        initial,
+       ipc_space_t             *spacep);
+
+/* Mark a space as dead and cleans up the entries*/
+extern void ipc_space_destroy(
+       ipc_space_t     space);
 
 #endif /* MACH_KERNEL_PRIVATE */
+#endif /* __APPLE_API_PRIVATE */
+
+#ifdef  __APPLE_API_UNSTABLE
+#ifndef MACH_KERNEL_PRIVATE
+
+extern ipc_space_t             current_space(void);
+
+#endif /* !MACH_KERNEL_PRIVATE */
+#endif /* __APPLE_API_UNSTABLE */
 
 /* Take a reference on a space */
 extern void ipc_space_reference(
@@ -184,18 +212,4 @@ extern void ipc_space_reference(
 extern void ipc_space_release(
        ipc_space_t     space);
 
-
-/* Create  new IPC space */
-extern kern_return_t ipc_space_create(
-       ipc_table_size_t        initial,
-       ipc_space_t             *spacep);
-
-/* Create a special IPC space */
-extern kern_return_t ipc_space_create_special(
-       ipc_space_t     *spacep);
-
-/* Mark a space as dead and cleans up the entries*/
-extern void ipc_space_destroy(
-       ipc_space_t     space);
-
 #endif /* _IPC_IPC_SPACE_H_ */