2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
6 * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved.
8 * This file contains Original Code and/or Modifications of Original Code
9 * as defined in and that are subject to the Apple Public Source License
10 * Version 2.0 (the 'License'). You may not use this file except in
11 * compliance with the License. Please obtain a copy of the License at
12 * http://www.opensource.apple.com/apsl/ and read it before using this
15 * The Original Code and all software distributed under the License are
16 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
17 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
18 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
20 * Please see the License for the specific language governing rights and
21 * limitations under the License.
23 * @APPLE_LICENSE_HEADER_END@
26 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
30 * 10 October 2000 (debo)
33 * 30 November 2000 (debo)
34 * Final resolution of review feedback.
37 #ifndef _MACH_TASK_POLICY_H_
38 #define _MACH_TASK_POLICY_H_
40 #include <mach/mach_types.h>
43 * These are the calls for accessing the policy parameters
44 * of a particular task.
46 * The extra 'get_default' parameter to the second call is
48 * 1) if asserted on the way in it indicates that the default
49 * values should be returned, not the ones currently set, in
50 * this case 'get_default' will always be asserted on return;
51 * 2) if unasserted on the way in, the current settings are
52 * desired and if still unasserted on return, then the info
53 * returned reflects the current settings, otherwise if
54 * 'get_default' returns asserted, it means that there are no
55 * current settings due to other parameters taking precedence,
56 * and the default ones are being returned instead.
59 typedef natural_t task_policy_flavor_t
;
60 typedef integer_t
*task_policy_t
;
63 kern_return_t task_policy_set(
65 task_policy_flavor_t flavor,
66 task_policy_t policy_info,
67 mach_msg_type_number_t count);
69 kern_return_t task_policy_get(
71 task_policy_flavor_t flavor,
72 task_policy_t policy_info,
73 mach_msg_type_number_t *count,
74 boolean_t *get_default);
81 * TASK_CATEGORY_POLICY:
83 * This provides information to the kernel about the role
84 * of the task in the system.
88 * role: Enumerated as follows:
90 * TASK_UNSPECIFIED is the default, since the role is not
91 * inherited from the parent.
93 * TASK_FOREGROUND_APPLICATION should be assigned when the
94 * task is a normal UI application in the foreground from
95 * the HI point of view.
96 * **N.B. There may be more than one of these at a given time.
98 * TASK_BACKGROUND_APPLICATION should be assigned when the
99 * task is a normal UI application in the background from
100 * the HI point of view.
102 * TASK_CONTROL_APPLICATION should be assigned to the unique
103 * UI application which implements the pop-up application dialog.
104 * There can only be one task at a time with this designation,
105 * which is assigned FCFS.
107 * TASK_GRAPHICS_SERVER should be assigned to the graphics
108 * management (window) server. There can only be one task at
109 * a time with this designation, which is assigned FCFS.
112 #define TASK_CATEGORY_POLICY 1
116 TASK_UNSPECIFIED
= 0,
117 TASK_FOREGROUND_APPLICATION
,
118 TASK_BACKGROUND_APPLICATION
,
119 TASK_CONTROL_APPLICATION
,
123 typedef enum task_role task_role_t
;
125 struct task_category_policy
{
129 typedef struct task_category_policy task_category_policy_data_t
;
130 typedef struct task_category_policy
*task_category_policy_t
;
132 #define TASK_CATEGORY_POLICY_COUNT \
133 (sizeof (task_category_policy_data_t) / sizeof (integer_t))
135 #endif /* _MACH_TASK_POLICY_H_ */