FreeBSD/Linux Kernel Cross Reference
sys/mach/policy.h
1 /*
2 * Mach Operating System
3 * Copyright (c) 1993,1991,1990,1989,1988 Carnegie Mellon University
4 * All Rights Reserved.
5 *
6 * Permission to use, copy, modify and distribute this software and its
7 * documentation is hereby granted, provided that both the copyright
8 * notice and this permission notice appear in all copies of the
9 * software, derivative works or modified versions, and any portions
10 * thereof, and that both notices appear in supporting documentation.
11 *
12 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
13 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
14 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
15 *
16 * Carnegie Mellon requests users of this software to return to
17 *
18 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
19 * School of Computer Science
20 * Carnegie Mellon University
21 * Pittsburgh PA 15213-3890
22 *
23 * any improvements or extensions that they make and grant Carnegie Mellon
24 * the rights to redistribute these changes.
25 */
26 /*
27 * HISTORY
28 * $Log: policy.h,v $
29 * Revision 2.6 93/11/17 17:43:48 dbg
30 * Moved names for real-time policies to mach/realtime_policy.h.
31 * Added common scheduling attributes for background, timesharing,
32 * fixed-priority policies.
33 * [93/05/10 dbg]
34 *
35 * Added real-time and background policies.
36 * [93/04/09 dbg]
37 *
38 * Revision 2.5 93/01/14 17:46:25 danner
39 * Cleanup.
40 * [92/06/10 pds]
41 *
42 * Revision 2.4 91/05/14 16:58:29 mrt
43 * Correcting copyright
44 *
45 * Revision 2.3 91/02/05 17:35:22 mrt
46 * Changed to new Mach copyright
47 * [91/02/01 17:20:11 mrt]
48 *
49 * Revision 2.2 90/06/02 14:59:37 rpd
50 * Created for new host/processor technology.
51 * [90/03/26 23:51:22 rpd]
52 *
53 * Cleanup changes.
54 * [89/08/02 dlb]
55 * Created.
56 * [89/07/25 18:47:00 dlb]
57 *
58 * Revision 2.3 89/10/15 02:05:50 rpd
59 * Minor cleanups.
60 *
61 * Revision 2.2 89/10/11 14:40:53 dlb
62 * Cleanup changes.
63 * [89/08/02 dlb]
64 *
65 */
66
67 #ifndef _MACH_POLICY_H_
68 #define _MACH_POLICY_H_
69
70 /*
71 * mach/policy.h
72 *
73 * Definitions for scheduing policy.
74 */
75 #include <mach/machine/vm_types.h> /* for integer_t */
76
77 #define POLICY_BACKGROUND 0
78 #define POLICY_TIMESHARE 1
79 #define POLICY_FIXEDPRI 2
80
81 /*
82 * Parameters and limits for standard policies.
83 */
84 typedef natural_t *policy_param_t;
85 /* varying array of unsigned integers */
86 #define POLICY_PARAM_MAX_COUNT (1024) /* maximum array size */
87
88 /*
89 * Background threads have no parameters or limit values.
90 */
91
92 /*
93 * Timesharing threads:
94 *
95 * Policy parameter and limit values include only the
96 * base priority for the thread.
97 */
98 struct policy_param_timeshare {
99 natural_t priority; /* base priority for thread */
100 };
101 #define POLICY_PARAM_TIMESHARE_COUNT \
102 (sizeof(struct policy_param_timeshare)/sizeof(natural_t))
103
104 /*
105 * Information for timesharing threads includes
106 * the base, current, and maximum (limit) priorities.
107 */
108 struct policy_info_timeshare {
109 natural_t base_priority; /* base priority */
110 natural_t cur_priority; /* current priority, including
111 aging */
112 natural_t max_priority; /* maximum priority allowed */
113 };
114 #define POLICY_INFO_TIMESHARE_COUNT \
115 (sizeof(struct policy_info_timeshare)/sizeof(natural_t))
116
117 /*
118 * Fixed-priority threads:
119 *
120 * Policy parameters include the priority, and
121 * whether the thread is preemptible by others at
122 * the same priority.
123 */
124 struct policy_param_fixedpri {
125 natural_t priority; /* priority of thread */
126 /* boolean_t */
127 natural_t no_preempt; /* TRUE for non-preemptive
128 (FIFO) scheduling
129 FALSE for preemptinve
130 (round-robin) scheduling */
131 };
132 #define POLICY_PARAM_FIXEDPRI_COUNT \
133 (sizeof(struct policy_param_fixedpri)/sizeof(natural_t))
134
135 /*
136 * Info for fixed-priority threads also includes the
137 * maximum allowed priority.
138 */
139 struct policy_info_fixedpri {
140 natural_t priority;
141 /* boolean_t */
142 natural_t no_preempt;
143 natural_t max_priority;
144 };
145 #define POLICY_INFO_FIXEDPRI_COUNT \
146 (sizeof(struct policy_info_fixedpri)/sizeof(natural_t))
147
148 #endif /* _MACH_POLICY_H_ */
Cache object: b06d281033c67e891a9059bfbf28afd8
|