2 * Copyright (c) 2000 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 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
27 * 10 October 2000 (debo)
30 * 30 November 2000 (debo)
31 * Final resolution of review feedback.
34 #ifndef _MACH_TASK_POLICY_H_
35 #define _MACH_TASK_POLICY_H_
37 #include <mach/mach_types.h>
40 * These are the calls for accessing the policy parameters
41 * of a particular task.
43 * The extra 'get_default' parameter to the second call is
45 * 1) if asserted on the way in it indicates that the default
46 * values should be returned, not the ones currently set, in
47 * this case 'get_default' will always be asserted on return;
48 * 2) if unasserted on the way in, the current settings are
49 * desired and if still unasserted on return, then the info
50 * returned reflects the current settings, otherwise if
51 * 'get_default' returns asserted, it means that there are no
52 * current settings due to other parameters taking precedence,
53 * and the default ones are being returned instead.
56 typedef natural_t task_policy_flavor_t
;
57 typedef integer_t
*task_policy_t
;
60 kern_return_t task_policy_set(
62 task_policy_flavor_t flavor,
63 task_policy_t policy_info,
64 mach_msg_type_number_t count);
66 kern_return_t task_policy_get(
68 task_policy_flavor_t flavor,
69 task_policy_t policy_info,
70 mach_msg_type_number_t *count,
71 boolean_t *get_default);
78 * TASK_CATEGORY_POLICY:
80 * This provides information to the kernel about the role
81 * of the task in the system.
85 * role: Enumerated as follows:
87 * TASK_UNSPECIFIED is the default, since the role is not
88 * inherited from the parent.
90 * TASK_FOREGROUND_APPLICATION should be assigned when the
91 * task is a normal UI application in the foreground from
92 * the HI point of view.
93 * **N.B. There may be more than one of these at a given time.
95 * TASK_BACKGROUND_APPLICATION should be assigned when the
96 * task is a normal UI application in the background from
97 * the HI point of view.
99 * TASK_CONTROL_APPLICATION should be assigned to the unique
100 * UI application which implements the pop-up application dialog.
101 * There can only be one task at a time with this designation,
102 * which is assigned FCFS.
104 * TASK_GRAPHICS_SERVER should be assigned to the graphics
105 * management (window) server. There can only be one task at
106 * a time with this designation, which is assigned FCFS.
109 #define TASK_CATEGORY_POLICY 1
113 TASK_UNSPECIFIED
= 0,
114 TASK_FOREGROUND_APPLICATION
,
115 TASK_BACKGROUND_APPLICATION
,
116 TASK_CONTROL_APPLICATION
,
120 typedef enum task_role task_role_t
;
122 struct task_category_policy
{
126 typedef struct task_category_policy task_category_policy_data_t
;
127 typedef struct task_category_policy
*task_category_policy_t
;
129 #define TASK_CATEGORY_POLICY_COUNT \
130 (sizeof (task_category_policy_data_t) / sizeof (integer_t))
132 #endif /* _MACH_TASK_POLICY_H_ */