]> git.saurik.com Git - apple/xnu.git/blobdiff - osfmk/mach/thread_info.h
xnu-4570.41.2.tar.gz
[apple/xnu.git] / osfmk / mach / thread_info.h
index c4794aab52fc1211af7b5141e9f8ba39d90a59f8..e39523ffc210883a6c7c6edd01299c7822cfaf49 100644 (file)
@@ -182,16 +182,19 @@ typedef struct thread_debug_info_internal  thread_debug_info_internal_data_t;
 
 #endif /* PRIVATE */
 
+#define IO_NUM_PRIORITIES      4
 
-/*
- * Obsolete interfaces.
- */
-
-#define THREAD_SCHED_TIMESHARE_INFO    10
-#define THREAD_SCHED_RR_INFO           11
-#define THREAD_SCHED_FIFO_INFO         12
+#define UPDATE_IO_STATS(info, size)                            \
+{                                                              \
+       info.count++;                                           \
+       info.size += size;                                      \
+}
 
-#define IO_NUM_PRIORITIES      4
+#define UPDATE_IO_STATS_ATOMIC(info, io_size)                  \
+{                                                              \
+       OSIncrementAtomic64((SInt64 *)&(info.count));           \
+       OSAddAtomic64(io_size, (SInt64 *)&(info.size));         \
+}
 
 struct io_stat_entry {
        uint64_t        count;
@@ -208,4 +211,12 @@ struct io_stat_info {
 
 typedef struct io_stat_info *io_stat_info_t;
 
+/* 
+ * Obsolete interfaces.
+ */
+
+#define THREAD_SCHED_TIMESHARE_INFO     10
+#define THREAD_SCHED_RR_INFO            11
+#define THREAD_SCHED_FIFO_INFO          12
+
 #endif /* _MACH_THREAD_INFO_H_ */