X-Git-Url: https://git.saurik.com/apple/xnu.git/blobdiff_plain/d52fe63fc81f7e44faaae711812a211a78434976..9bccf70c0258c7cac2dcb80011b2a964d884c552:/osfmk/ipc/ipc_space.h diff --git a/osfmk/ipc/ipc_space.h b/osfmk/ipc/ipc_space.h index 33431cf9b..6ac534951 100644 --- a/osfmk/ipc/ipc_space.h +++ b/osfmk/ipc/ipc_space.h @@ -66,9 +66,13 @@ #include #include +#include + +#ifdef __APPLE_API_PRIVATE #ifdef MACH_KERNEL_PRIVATE #include #include +#include #include #include #include @@ -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_ */