2 * Copyright (c) 2000-2005 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
6 * The contents of this file constitute Original Code as defined in and
7 * are subject to the Apple Public Source License Version 1.1 (the
8 * "License"). You may not use this file except in compliance with the
9 * License. Please obtain a copy of the License at
10 * http://www.apple.com/publicsource and read it before using this file.
12 * This Original Code and all software distributed under the License are
13 * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
14 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
15 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
17 * License for the specific language governing rights and limitations
20 * @APPLE_LICENSE_HEADER_END@
23 #ifndef _MACH_TASK_POLICY_H_
24 #define _MACH_TASK_POLICY_H_
26 #include <mach/mach_types.h>
29 * These are the calls for accessing the policy parameters
30 * of a particular task.
32 * The extra 'get_default' parameter to the second call is
34 * 1) if asserted on the way in it indicates that the default
35 * values should be returned, not the ones currently set, in
36 * this case 'get_default' will always be asserted on return;
37 * 2) if unasserted on the way in, the current settings are
38 * desired and if still unasserted on return, then the info
39 * returned reflects the current settings, otherwise if
40 * 'get_default' returns asserted, it means that there are no
41 * current settings due to other parameters taking precedence,
42 * and the default ones are being returned instead.
45 typedef natural_t task_policy_flavor_t
;
46 typedef integer_t
*task_policy_t
;
49 kern_return_t task_policy_set(
51 task_policy_flavor_t flavor,
52 task_policy_t policy_info,
53 mach_msg_type_number_t count);
55 kern_return_t task_policy_get(
57 task_policy_flavor_t flavor,
58 task_policy_t policy_info,
59 mach_msg_type_number_t *count,
60 boolean_t *get_default);
67 * TASK_CATEGORY_POLICY:
69 * This provides information to the kernel about the role
70 * of the task in the system.
74 * role: Enumerated as follows:
76 * TASK_UNSPECIFIED is the default, since the role is not
77 * inherited from the parent.
79 * TASK_FOREGROUND_APPLICATION should be assigned when the
80 * task is a normal UI application in the foreground from
81 * the HI point of view.
82 * **N.B. There may be more than one of these at a given time.
84 * TASK_BACKGROUND_APPLICATION should be assigned when the
85 * task is a normal UI application in the background from
86 * the HI point of view.
88 * TASK_CONTROL_APPLICATION should be assigned to the unique
89 * UI application which implements the pop-up application dialog.
90 * There can only be one task at a time with this designation,
91 * which is assigned FCFS.
93 * TASK_GRAPHICS_SERVER should be assigned to the graphics
94 * management (window) server. There can only be one task at
95 * a time with this designation, which is assigned FCFS.
98 #define TASK_CATEGORY_POLICY 1
102 TASK_UNSPECIFIED
= 0,
103 TASK_FOREGROUND_APPLICATION
,
104 TASK_BACKGROUND_APPLICATION
,
105 TASK_CONTROL_APPLICATION
,
109 typedef enum task_role task_role_t
;
111 struct task_category_policy
{
115 typedef struct task_category_policy task_category_policy_data_t
;
116 typedef struct task_category_policy
*task_category_policy_t
;
118 #define TASK_CATEGORY_POLICY_COUNT ((mach_msg_type_number_t) \
119 (sizeof (task_category_policy_data_t) / sizeof (integer_t)))
121 #endif /* _MACH_TASK_POLICY_H_ */