]> git.saurik.com Git - apple/xnu.git/blobdiff - osfmk/kern/block_hint.h
xnu-4903.270.47.tar.gz
[apple/xnu.git] / osfmk / kern / block_hint.h
index c72ec7f623a834b794f1faa325c53046d05c5a12..7f351fe989c1d10e325ecc2b26a0dc12b6d2340f 100644 (file)
  * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
  */
 
  * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
  */
 
-#ifndef        _KERN_BLOCK_HINT_H_
+#ifndef _KERN_BLOCK_HINT_H_
 #define _KERN_BLOCK_HINT_H_
 
 #define _KERN_BLOCK_HINT_H_
 
-/* This must fit inside a short  */
 typedef enum thread_snapshot_wait_flags {
 typedef enum thread_snapshot_wait_flags {
-       kThreadWaitNone                 = 0x00,
+       kThreadWaitNone                 = 0x00,
        kThreadWaitKernelMutex          = 0x01,
        kThreadWaitPortReceive          = 0x02,
        kThreadWaitPortSetReceive       = 0x03,
        kThreadWaitKernelMutex          = 0x01,
        kThreadWaitPortReceive          = 0x02,
        kThreadWaitPortSetReceive       = 0x03,
@@ -47,6 +46,31 @@ typedef enum thread_snapshot_wait_flags {
        kThreadWaitPThreadRWLockWrite   = 0x0d,
        kThreadWaitPThreadCondVar       = 0x0e,
        kThreadWaitParkedWorkQueue      = 0x0f,
        kThreadWaitPThreadRWLockWrite   = 0x0d,
        kThreadWaitPThreadCondVar       = 0x0e,
        kThreadWaitParkedWorkQueue      = 0x0f,
+       kThreadWaitWorkloopSyncWait     = 0x10,
+       kThreadWaitOnProcess            = 0x11,
 } __attribute__((packed)) block_hint_t;
 
 } __attribute__((packed)) block_hint_t;
 
+_Static_assert(sizeof(block_hint_t) <= sizeof(short),
+    "block_hint_t must fit within a short");
+
+#ifdef XNU_KERNEL_PRIVATE
+
+struct waitq;
+struct stackshot_thread_waitinfo;
+typedef struct stackshot_thread_waitinfo thread_waitinfo_t;
+
+/* Used for stackshot_thread_waitinfo_unsafe */
+extern void kdp_lck_mtx_find_owner(struct waitq * waitq, event64_t event, thread_waitinfo_t *waitinfo);
+extern void kdp_sema_find_owner(struct waitq * waitq, event64_t event, thread_waitinfo_t *waitinfo);
+extern void kdp_mqueue_send_find_owner(struct waitq * waitq, event64_t event, thread_waitinfo_t *waitinfo);
+extern void kdp_mqueue_recv_find_owner(struct waitq * waitq, event64_t event, thread_waitinfo_t *waitinfo);
+extern void kdp_ulock_find_owner(struct waitq * waitq, event64_t event, thread_waitinfo_t *waitinfo);
+extern void kdp_rwlck_find_owner(struct waitq * waitq, event64_t event, thread_waitinfo_t *waitinfo);
+extern void kdp_pthread_find_owner(thread_t thread, thread_waitinfo_t *waitinfo);
+extern void *kdp_pthread_get_thread_kwq(thread_t thread);
+extern void kdp_workloop_sync_wait_find_owner(thread_t thread, event64_t event, thread_waitinfo_t *waitinfo);
+extern void kdp_wait4_find_process(thread_t thread, event64_t event, thread_waitinfo_t *waitinfo);
+
+#endif /* XNU_KERNEL_PRIVATE */
+
 #endif /* !_KERN_BLOCK_HINT_H_ */
 #endif /* !_KERN_BLOCK_HINT_H_ */