master
  1/*
  2 * Copyright (c) 2000-2007, 2015 Apple Inc. All rights reserved.
  3 *
  4 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
  5 *
  6 * This file contains Original Code and/or Modifications of Original Code
  7 * as defined in and that are subject to the Apple Public Source License
  8 * Version 2.0 (the 'License'). You may not use this file except in
  9 * compliance with the License. The rights granted to you under the License
 10 * may not be used to create, or enable the creation or redistribution of,
 11 * unlawful or unlicensed copies of an Apple operating system, or to
 12 * circumvent, violate, or enable the circumvention or violation of, any
 13 * terms of an Apple operating system software license agreement.
 14 *
 15 * Please obtain a copy of the License at
 16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
 17 *
 18 * The Original Code and all software distributed under the License are
 19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
 20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
 21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
 22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
 23 * Please see the License for the specific language governing rights and
 24 * limitations under the License.
 25 *
 26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
 27 */
 28/*
 29 * @OSF_COPYRIGHT@
 30 */
 31/*
 32 * Mach Operating System
 33 * Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University
 34 * All Rights Reserved.
 35 *
 36 * Permission to use, copy, modify and distribute this software and its
 37 * documentation is hereby granted, provided that both the copyright
 38 * notice and this permission notice appear in all copies of the
 39 * software, derivative works or modified versions, and any portions
 40 * thereof, and that both notices appear in supporting documentation.
 41 *
 42 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
 43 * CONDITION.  CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
 44 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
 45 *
 46 * Carnegie Mellon requests users of this software to return to
 47 *
 48 *  Software Distribution Coordinator  or  Software.Distribution@CS.CMU.EDU
 49 *  School of Computer Science
 50 *  Carnegie Mellon University
 51 *  Pittsburgh PA 15213-3890
 52 *
 53 * any improvements or extensions that they make and grant Carnegie Mellon
 54 * the rights to redistribute these changes.
 55 */
 56/*
 57 *	Machine-independent task information structures and definitions.
 58 *
 59 *	The definitions in this file are exported to the user.  The kernel
 60 *	will translate its internal data structures to these structures
 61 *	as appropriate.
 62 *
 63 */
 64
 65#ifndef _MACH_TASK_INFO_H_
 66#define _MACH_TASK_INFO_H_
 67
 68#include <mach/message.h>
 69#include <mach/machine/vm_types.h>
 70#include <mach/time_value.h>
 71#include <mach/policy.h>
 72#include <mach/vm_statistics.h> /* for vm_extmod_statistics_data_t */
 73#include <Availability.h>
 74
 75#include <sys/cdefs.h>
 76
 77/*
 78 *	Generic information structure to allow for expansion.
 79 */
 80typedef natural_t       task_flavor_t;
 81typedef integer_t       *task_info_t;           /* varying array of int */
 82
 83/* Deprecated, use per structure _data_t's instead */
 84#define TASK_INFO_MAX   (1024)          /* maximum array size */
 85typedef integer_t       task_info_data_t[TASK_INFO_MAX];
 86
 87/*
 88 *	Currently defined information structures.
 89 */
 90
 91#pragma pack(push, 4)
 92
 93/* Don't use this, use MACH_TASK_BASIC_INFO instead */
 94#define TASK_BASIC_INFO_32      4       /* basic information */
 95#define TASK_BASIC2_INFO_32      6
 96
 97struct task_basic_info_32 {
 98	integer_t       suspend_count;  /* suspend count for task */
 99	natural_t       virtual_size;   /* virtual memory size (bytes) */
100	natural_t       resident_size;  /* resident memory size (bytes) */
101	time_value_t    user_time;      /* total user run time for
102	                                 *  terminated threads */
103	time_value_t    system_time;    /* total system run time for
104	                                 *  terminated threads */
105	policy_t        policy;         /* default policy for new threads */
106};
107typedef struct task_basic_info_32       task_basic_info_32_data_t;
108typedef struct task_basic_info_32       *task_basic_info_32_t;
109#define TASK_BASIC_INFO_32_COUNT   \
110	        (sizeof(task_basic_info_32_data_t) / sizeof(natural_t))
111
112/* Don't use this, use MACH_TASK_BASIC_INFO instead */
113struct task_basic_info_64 {
114	integer_t       suspend_count;  /* suspend count for task */
115#if defined(__arm__) || defined(__arm64__)
116	mach_vm_size_t  virtual_size;   /* virtual memory size (bytes) */
117	mach_vm_size_t  resident_size;  /* resident memory size (bytes) */
118#else /* defined(__arm__) || defined(__arm64__) */
119	mach_vm_size_t  virtual_size;   /* virtual memory size (bytes) */
120	mach_vm_size_t  resident_size;  /* resident memory size (bytes) */
121#endif /* defined(__arm__) || defined(__arm64__) */
122	time_value_t    user_time;      /* total user run time for
123	                                 *  terminated threads */
124	time_value_t    system_time;    /* total system run time for
125	                                 *  terminated threads */
126	policy_t        policy;         /* default policy for new threads */
127};
128typedef struct task_basic_info_64       task_basic_info_64_data_t;
129typedef struct task_basic_info_64       *task_basic_info_64_t;
130
131#if defined(__arm__) || defined(__arm64__)
132	#if   defined(__arm__) && defined(__IPHONE_OS_VERSION_MIN_REQUIRED) && (__IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_5_0)
133/*
134 * Note: arm64 can't use the old flavor.  If you somehow manage to,
135 * you can cope with the nonsense data yourself.
136 */
137	#define TASK_BASIC_INFO_64      5
138	#define TASK_BASIC_INFO_64_COUNT   \
139	        (sizeof(task_basic_info_64_data_t) / sizeof(natural_t))
140
141	#else
142
143	#define TASK_BASIC_INFO_64              TASK_BASIC_INFO_64_2
144	#define TASK_BASIC_INFO_64_COUNT        TASK_BASIC_INFO_64_2_COUNT
145	#endif
146#else /* defined(__arm__) || defined(__arm64__) */
147#define TASK_BASIC_INFO_64      5       /* 64-bit capable basic info */
148#define TASK_BASIC_INFO_64_COUNT   \
149	        (sizeof(task_basic_info_64_data_t) / sizeof(natural_t))
150#endif
151
152
153/* localized structure - cannot be safely passed between tasks of differing sizes */
154/* Don't use this, use MACH_TASK_BASIC_INFO instead */
155struct task_basic_info {
156	integer_t       suspend_count;  /* suspend count for task */
157	vm_size_t       virtual_size;   /* virtual memory size (bytes) */
158	vm_size_t       resident_size;  /* resident memory size (bytes) */
159	time_value_t    user_time;      /* total user run time for
160	                                 *  terminated threads */
161	time_value_t    system_time;    /* total system run time for
162	                                 *  terminated threads */
163	policy_t        policy;         /* default policy for new threads */
164};
165
166typedef struct task_basic_info          task_basic_info_data_t;
167typedef struct task_basic_info          *task_basic_info_t;
168#define TASK_BASIC_INFO_COUNT   \
169	        (sizeof(task_basic_info_data_t) / sizeof(natural_t))
170#if !defined(__LP64__)
171#define TASK_BASIC_INFO TASK_BASIC_INFO_32
172#else
173#define TASK_BASIC_INFO TASK_BASIC_INFO_64
174#endif
175
176
177
178#define TASK_EVENTS_INFO        2       /* various event counts */
179
180struct task_events_info {
181	integer_t       faults;         /* number of page faults */
182	integer_t       pageins;        /* number of actual pageins */
183	integer_t       cow_faults;     /* number of copy-on-write faults */
184	integer_t       messages_sent;  /* number of messages sent */
185	integer_t       messages_received; /* number of messages received */
186	integer_t       syscalls_mach;  /* number of mach system calls */
187	integer_t       syscalls_unix;  /* number of unix system calls */
188	integer_t       csw;            /* number of context switches */
189};
190typedef struct task_events_info         task_events_info_data_t;
191typedef struct task_events_info         *task_events_info_t;
192#define TASK_EVENTS_INFO_COUNT          ((mach_msg_type_number_t) \
193	        (sizeof(task_events_info_data_t) / sizeof(natural_t)))
194
195#define TASK_THREAD_TIMES_INFO  3       /* total times for live threads -
196	                                 *  only accurate if suspended */
197
198struct task_thread_times_info {
199	time_value_t    user_time;      /* total user run time for
200	                                 *  live threads */
201	time_value_t    system_time;    /* total system run time for
202	                                 *  live threads */
203};
204
205typedef struct task_thread_times_info   task_thread_times_info_data_t;
206typedef struct task_thread_times_info   *task_thread_times_info_t;
207#define TASK_THREAD_TIMES_INFO_COUNT    ((mach_msg_type_number_t) \
208	        (sizeof(task_thread_times_info_data_t) / sizeof(natural_t)))
209
210#define TASK_ABSOLUTETIME_INFO  1
211
212struct task_absolutetime_info {
213	uint64_t                total_user;
214	uint64_t                total_system;
215	uint64_t                threads_user;   /* existing threads only */
216	uint64_t                threads_system;
217};
218
219typedef struct task_absolutetime_info   task_absolutetime_info_data_t;
220typedef struct task_absolutetime_info   *task_absolutetime_info_t;
221#define TASK_ABSOLUTETIME_INFO_COUNT    ((mach_msg_type_number_t) \
222	        (sizeof (task_absolutetime_info_data_t) / sizeof (natural_t)))
223
224#define TASK_KERNELMEMORY_INFO  7
225
226struct task_kernelmemory_info {
227	uint64_t                total_palloc;   /* private kernel mem alloc'ed */
228	uint64_t                total_pfree;    /* private kernel mem freed */
229	uint64_t                total_salloc;   /* shared kernel mem alloc'ed */
230	uint64_t                total_sfree;    /* shared kernel mem freed */
231};
232
233typedef struct task_kernelmemory_info   task_kernelmemory_info_data_t;
234typedef struct task_kernelmemory_info   *task_kernelmemory_info_t;
235#define TASK_KERNELMEMORY_INFO_COUNT    ((mach_msg_type_number_t) \
236	        (sizeof (task_kernelmemory_info_data_t) / sizeof (natural_t)))
237
238#define TASK_SECURITY_TOKEN             13
239#define TASK_SECURITY_TOKEN_COUNT       ((mach_msg_type_number_t) \
240	        (sizeof(security_token_t) / sizeof(natural_t)))
241
242#define TASK_AUDIT_TOKEN                15
243#define TASK_AUDIT_TOKEN_COUNT  \
244	        (sizeof(audit_token_t) / sizeof(natural_t))
245
246
247#define TASK_AFFINITY_TAG_INFO          16      /* This is experimental. */
248
249struct task_affinity_tag_info {
250	integer_t               set_count;
251	integer_t               min;
252	integer_t               max;
253	integer_t               task_count;
254};
255typedef struct task_affinity_tag_info   task_affinity_tag_info_data_t;
256typedef struct task_affinity_tag_info   *task_affinity_tag_info_t;
257#define TASK_AFFINITY_TAG_INFO_COUNT    \
258	        (sizeof(task_affinity_tag_info_data_t) / sizeof(natural_t))
259
260#define TASK_DYLD_INFO                  17
261
262struct task_dyld_info {
263	mach_vm_address_t       all_image_info_addr;
264	mach_vm_size_t          all_image_info_size;
265	integer_t               all_image_info_format;
266};
267typedef struct task_dyld_info   task_dyld_info_data_t;
268typedef struct task_dyld_info   *task_dyld_info_t;
269#define TASK_DYLD_INFO_COUNT    \
270	        (sizeof(task_dyld_info_data_t) / sizeof(natural_t))
271#define TASK_DYLD_ALL_IMAGE_INFO_32     0       /* format value */
272#define TASK_DYLD_ALL_IMAGE_INFO_64     1       /* format value */
273
274#if defined(__arm__) || defined(__arm64__)
275
276/* Don't use this, use MACH_TASK_BASIC_INFO instead */
277/* Compatibility for old 32-bit mach_vm_*_t */
278#define TASK_BASIC_INFO_64_2     18       /* 64-bit capable basic info */
279
280struct task_basic_info_64_2 {
281	integer_t       suspend_count;  /* suspend count for task */
282	mach_vm_size_t  virtual_size;   /* virtual memory size (bytes) */
283	mach_vm_size_t  resident_size;  /* resident memory size (bytes) */
284	time_value_t    user_time;      /* total user run time for
285	                                 *  terminated threads */
286	time_value_t    system_time;    /* total system run time for
287	                                 *  terminated threads */
288	policy_t        policy;         /* default policy for new threads */
289};
290typedef struct task_basic_info_64_2       task_basic_info_64_2_data_t;
291typedef struct task_basic_info_64_2       *task_basic_info_64_2_t;
292#define TASK_BASIC_INFO_64_2_COUNT   \
293	        (sizeof(task_basic_info_64_2_data_t) / sizeof(natural_t))
294#endif
295
296#define TASK_EXTMOD_INFO                        19
297
298struct task_extmod_info {
299	unsigned char   task_uuid[16];
300	vm_extmod_statistics_data_t             extmod_statistics;
301};
302typedef struct task_extmod_info task_extmod_info_data_t;
303typedef struct task_extmod_info *task_extmod_info_t;
304#define TASK_EXTMOD_INFO_COUNT  \
305	        (sizeof(task_extmod_info_data_t) / sizeof(natural_t))
306
307
308#define MACH_TASK_BASIC_INFO     20         /* always 64-bit basic info */
309struct mach_task_basic_info {
310	mach_vm_size_t  virtual_size;       /* virtual memory size (bytes) */
311	mach_vm_size_t  resident_size;      /* resident memory size (bytes) */
312	mach_vm_size_t  resident_size_max;  /* maximum resident memory size (bytes) */
313	time_value_t    user_time;          /* total user run time for
314	                                     *  terminated threads */
315	time_value_t    system_time;        /* total system run time for
316	                                     *  terminated threads */
317	policy_t        policy;             /* default policy for new threads */
318	integer_t       suspend_count;      /* suspend count for task */
319};
320typedef struct mach_task_basic_info       mach_task_basic_info_data_t;
321typedef struct mach_task_basic_info       *mach_task_basic_info_t;
322#define MACH_TASK_BASIC_INFO_COUNT   \
323	        (sizeof(mach_task_basic_info_data_t) / sizeof(natural_t))
324
325
326#define TASK_POWER_INFO 21
327
328struct task_power_info {
329	uint64_t                total_user;
330	uint64_t                total_system;
331	uint64_t                task_interrupt_wakeups;
332	uint64_t                task_platform_idle_wakeups;
333	uint64_t                task_timer_wakeups_bin_1;
334	uint64_t                task_timer_wakeups_bin_2;
335};
336
337typedef struct task_power_info  task_power_info_data_t;
338typedef struct task_power_info  *task_power_info_t;
339#define TASK_POWER_INFO_COUNT   ((mach_msg_type_number_t) \
340	        (sizeof (task_power_info_data_t) / sizeof (natural_t)))
341
342
343
344#define TASK_VM_INFO            22
345#define TASK_VM_INFO_PURGEABLE  23
346struct task_vm_info {
347	mach_vm_size_t  virtual_size;       /* virtual memory size (bytes) */
348	integer_t       region_count;       /* number of memory regions */
349	integer_t       page_size;
350	mach_vm_size_t  resident_size;      /* resident memory size (bytes) */
351	mach_vm_size_t  resident_size_peak; /* peak resident size (bytes) */
352
353	mach_vm_size_t  device;
354	mach_vm_size_t  device_peak;
355	mach_vm_size_t  internal;
356	mach_vm_size_t  internal_peak;
357	mach_vm_size_t  external;
358	mach_vm_size_t  external_peak;
359	mach_vm_size_t  reusable;
360	mach_vm_size_t  reusable_peak;
361	mach_vm_size_t  purgeable_volatile_pmap;
362	mach_vm_size_t  purgeable_volatile_resident;
363	mach_vm_size_t  purgeable_volatile_virtual;
364	mach_vm_size_t  compressed;
365	mach_vm_size_t  compressed_peak;
366	mach_vm_size_t  compressed_lifetime;
367
368	/* added for rev1 */
369	mach_vm_size_t  phys_footprint;
370
371	/* added for rev2 */
372	mach_vm_address_t       min_address;
373	mach_vm_address_t       max_address;
374
375	/* added for rev3 */
376	int64_t ledger_phys_footprint_peak;
377	int64_t ledger_purgeable_nonvolatile;
378	int64_t ledger_purgeable_novolatile_compressed;
379	int64_t ledger_purgeable_volatile;
380	int64_t ledger_purgeable_volatile_compressed;
381	int64_t ledger_tag_network_nonvolatile;
382	int64_t ledger_tag_network_nonvolatile_compressed;
383	int64_t ledger_tag_network_volatile;
384	int64_t ledger_tag_network_volatile_compressed;
385	int64_t ledger_tag_media_footprint;
386	int64_t ledger_tag_media_footprint_compressed;
387	int64_t ledger_tag_media_nofootprint;
388	int64_t ledger_tag_media_nofootprint_compressed;
389	int64_t ledger_tag_graphics_footprint;
390	int64_t ledger_tag_graphics_footprint_compressed;
391	int64_t ledger_tag_graphics_nofootprint;
392	int64_t ledger_tag_graphics_nofootprint_compressed;
393	int64_t ledger_tag_neural_footprint;
394	int64_t ledger_tag_neural_footprint_compressed;
395	int64_t ledger_tag_neural_nofootprint;
396	int64_t ledger_tag_neural_nofootprint_compressed;
397
398	/* added for rev4 */
399	uint64_t limit_bytes_remaining;
400
401	/* added for rev5 */
402	integer_t decompressions;
403
404	/* added for rev6 */
405	int64_t ledger_swapins;
406
407	/* added for rev7 */
408	int64_t ledger_tag_neural_nofootprint_total;
409	int64_t ledger_tag_neural_nofootprint_peak;
410};
411typedef struct task_vm_info     task_vm_info_data_t;
412typedef struct task_vm_info     *task_vm_info_t;
413#define TASK_VM_INFO_COUNT      ((mach_msg_type_number_t) \
414	        (sizeof (task_vm_info_data_t) / sizeof (natural_t)))
415/*
416 * The capacity of task_info_t in mach_types.defs also needs to be adjusted
417 */
418#define TASK_VM_INFO_REV7_COUNT TASK_VM_INFO_COUNT
419#define TASK_VM_INFO_REV6_COUNT /* doesn't include neural total and peak */ \
420	((mach_msg_type_number_t) (TASK_VM_INFO_REV7_COUNT - 4))
421#define TASK_VM_INFO_REV5_COUNT /* doesn't include ledger swapins */ \
422	((mach_msg_type_number_t) (TASK_VM_INFO_REV6_COUNT - 2))
423#define TASK_VM_INFO_REV4_COUNT /* doesn't include decompressions */ \
424	((mach_msg_type_number_t) (TASK_VM_INFO_REV5_COUNT - 1))
425#define TASK_VM_INFO_REV3_COUNT /* doesn't include limit bytes */ \
426	((mach_msg_type_number_t) (TASK_VM_INFO_REV4_COUNT - 2))
427#define TASK_VM_INFO_REV2_COUNT /* doesn't include extra ledgers info */ \
428	((mach_msg_type_number_t) (TASK_VM_INFO_REV3_COUNT - 42))
429#define TASK_VM_INFO_REV1_COUNT /* doesn't include min and max address */ \
430	((mach_msg_type_number_t) (TASK_VM_INFO_REV2_COUNT - 4))
431#define TASK_VM_INFO_REV0_COUNT /* doesn't include phys_footprint */ \
432	((mach_msg_type_number_t) (TASK_VM_INFO_REV1_COUNT - 2))
433
434typedef struct vm_purgeable_info        task_purgable_info_t;
435
436
437#define TASK_TRACE_MEMORY_INFO  24  /* no longer supported */
438struct task_trace_memory_info {
439	uint64_t  user_memory_address;  /* address of start of trace memory buffer */
440	uint64_t  buffer_size;                  /* size of buffer in bytes */
441	uint64_t  mailbox_array_size;   /* size of mailbox area in bytes */
442};
443typedef struct task_trace_memory_info task_trace_memory_info_data_t;
444typedef struct task_trace_memory_info * task_trace_memory_info_t;
445#define TASK_TRACE_MEMORY_INFO_COUNT  ((mach_msg_type_number_t) \
446	        (sizeof(task_trace_memory_info_data_t) / sizeof(natural_t)))
447
448#define TASK_WAIT_STATE_INFO  25    /* deprecated. */
449struct task_wait_state_info {
450	uint64_t  total_wait_state_time;        /* Time that all threads past and present have been in a wait state */
451	uint64_t  total_wait_sfi_state_time;    /* Time that threads have been in SFI wait (should be a subset of total wait state time */
452	uint32_t  _reserved[4];
453};
454typedef struct task_wait_state_info task_wait_state_info_data_t;
455typedef struct task_wait_state_info * task_wait_state_info_t;
456#define TASK_WAIT_STATE_INFO_COUNT  ((mach_msg_type_number_t) \
457	        (sizeof(task_wait_state_info_data_t) / sizeof(natural_t)))
458
459#define TASK_POWER_INFO_V2      26
460
461typedef struct {
462	uint64_t                task_gpu_utilisation;
463	uint64_t                task_gpu_stat_reserved0;
464	uint64_t                task_gpu_stat_reserved1;
465	uint64_t                task_gpu_stat_reserved2;
466} gpu_energy_data;
467
468typedef gpu_energy_data *gpu_energy_data_t;
469struct task_power_info_v2 {
470	task_power_info_data_t  cpu_energy;
471	gpu_energy_data gpu_energy;
472#if defined(__arm__) || defined(__arm64__)
473	uint64_t                task_energy;
474#endif /* defined(__arm__) || defined(__arm64__) */
475	uint64_t                task_ptime;
476	uint64_t                task_pset_switches;
477};
478
479typedef struct task_power_info_v2       task_power_info_v2_data_t;
480typedef struct task_power_info_v2       *task_power_info_v2_t;
481#define TASK_POWER_INFO_V2_COUNT_OLD    \
482	        ((mach_msg_type_number_t) (sizeof (task_power_info_v2_data_t) - sizeof(uint64_t)*2) / sizeof (natural_t))
483#define TASK_POWER_INFO_V2_COUNT        \
484	        ((mach_msg_type_number_t) (sizeof (task_power_info_v2_data_t) / sizeof (natural_t)))
485
486#define TASK_VM_INFO_PURGEABLE_ACCOUNT 27 /* Used for xnu purgeable vm unit tests */
487
488
489#define TASK_FLAGS_INFO  28                     /* return t_flags field */
490struct task_flags_info {
491	uint32_t        flags;                          /* task flags */
492};
493typedef struct task_flags_info task_flags_info_data_t;
494typedef struct task_flags_info * task_flags_info_t;
495#define TASK_FLAGS_INFO_COUNT  ((mach_msg_type_number_t) \
496	        (sizeof(task_flags_info_data_t) / sizeof (natural_t)))
497
498#define TF_LP64         0x00000001 /* task has 64-bit addressing */
499#define TF_64B_DATA     0x00000002 /* task has 64-bit data registers */
500
501#define TASK_DEBUG_INFO_INTERNAL    29 /* Used for kernel internal development tests. */
502
503
504
505#define TASK_SECURITY_CONFIG_INFO  32 /* Runtime security mitigations configuration for the task */
506struct task_security_config_info {
507	uint32_t  config;                       /* Configuration bitmask */
508};
509
510typedef struct task_security_config_info * task_security_config_info_t;
511#define TASK_SECURITY_CONFIG_INFO_COUNT  ((mach_msg_type_number_t) \
512	        (sizeof(struct task_security_config_info) / sizeof(natural_t)))
513
514
515#define TASK_IPC_SPACE_POLICY_INFO  33 /* Runtime security mitigations configuration for the task */
516struct task_ipc_space_policy_info {
517	uint32_t  space_policy;                       /* Configuration bitmask */
518};
519
520typedef struct task_ipc_space_policy_info * task_ipc_space_policy_info_t;
521#define TASK_IPC_SPACE_POLICY_INFO_COUNT  ((mach_msg_type_number_t) \
522	        (sizeof(struct task_ipc_space_policy_info) / sizeof(natural_t)))
523
524/*
525 * Type to control EXC_GUARD delivery options for a task
526 * via task_get/set_exc_guard_behavior interface(s).
527 */
528typedef uint32_t task_exc_guard_behavior_t;
529
530/* EXC_GUARD optional delivery settings on a per-task basis */
531#define TASK_EXC_GUARD_NONE                  0x00
532#define TASK_EXC_GUARD_VM_DELIVER            0x01 /* Deliver virtual memory EXC_GUARD exceptions */
533#define TASK_EXC_GUARD_VM_ONCE               0x02 /* Deliver them only once */
534#define TASK_EXC_GUARD_VM_CORPSE             0x04 /* Deliver them via a forked corpse */
535#define TASK_EXC_GUARD_VM_FATAL              0x08 /* Virtual Memory EXC_GUARD delivery is fatal */
536#define TASK_EXC_GUARD_VM_ALL                0x0f
537
538#define TASK_EXC_GUARD_MP_DELIVER            0x10 /* Deliver mach port EXC_GUARD exceptions */
539#define TASK_EXC_GUARD_MP_ONCE               0x20 /* Deliver them only once */
540#define TASK_EXC_GUARD_MP_CORPSE             0x40 /* Deliver them via a forked corpse */
541#define TASK_EXC_GUARD_MP_FATAL              0x80 /* mach port EXC_GUARD delivery is fatal */
542#define TASK_EXC_GUARD_MP_ALL                0xf0
543
544#define TASK_EXC_GUARD_ALL                   0xff /* All optional deliver settings */
545
546
547/*
548 * Type to control corpse forking options for a task
549 * via task_get/set_corpse_forking_behavior interface(s).
550 */
551typedef uint32_t task_corpse_forking_behavior_t;
552
553#define TASK_CORPSE_FORKING_DISABLED_MEM_DIAG  0x01 /* Disable corpse forking because the task is running under a diagnostic tool */
554
555
556/*
557 * Obsolete interfaces.
558 */
559
560#define TASK_SCHED_TIMESHARE_INFO       10
561#define TASK_SCHED_RR_INFO              11
562#define TASK_SCHED_FIFO_INFO            12
563
564#define TASK_SCHED_INFO                 14
565
566#pragma pack(pop)
567
568#endif  /* _MACH_TASK_INFO_H_ */