1 /*
2 * Mach Operating System
3 * Copyright (c) 1993,1992,1991,1990,1989 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: processor_info.h,v $
29 * Revision 2.6 93/11/17 17:44:04 dbg
30 * Finished the 64-bit cleanup: made processor_set_basic_info and
31 * processor_set_sched_info be structs of integer_t, since they are
32 * passed as processor_set_info_t.
33 * [93/11/09 dbg]
34 *
35 * Revision 2.5 93/01/14 17:46:35 danner
36 * Cleanup.
37 * [92/06/10 pds]
38 * 64bit cleanup.
39 * [92/12/01 af]
40 *
41 * Revision 2.4 91/05/14 16:58:46 mrt
42 * Correcting copyright
43 *
44 * Revision 2.3 91/02/05 17:35:31 mrt
45 * Changed to new Mach copyright
46 * [91/02/01 17:20:39 mrt]
47 *
48 * Revision 2.2 90/06/02 14:59:49 rpd
49 * Created for new host/processor technology.
50 * [90/03/26 23:51:38 rpd]
51 *
52 * Merge to X96
53 * [89/08/02 23:12:21 dlb]
54 *
55 * Add scheduling flavor of information.
56 * [89/07/25 18:52:18 dlb]
57 *
58 * Add load average and mach factor to processor set basic info.
59 * [89/02/09 dlb]
60 *
61 * Revision 2.3 89/10/15 02:05:54 rpd
62 * Minor cleanups.
63 *
64 * Revision 2.2 89/10/11 14:41:03 dlb
65 * Add scheduling flavor of information.
66 *
67 * Add load average and mach factor to processor set basic info.
68 * [89/02/09 dlb]
69 *
70 */
71
72 /*
73 * File: mach/processor_info.h
74 * Author: David L. Black
75 * Date: 1988
76 *
77 * Data structure definitions for processor_info, processor_set_info
78 */
79
80 #ifndef _MACH_PROCESSOR_INFO_H_
81 #define _MACH_PROCESSOR_INFO_H_
82
83 #include <mach/machine.h>
84
85 /*
86 * Generic information structure to allow for expansion.
87 */
88 typedef integer_t *processor_info_t; /* varying array of int. */
89
90 #define PROCESSOR_INFO_MAX (1024) /* max array size */
91 typedef integer_t processor_info_data_t[PROCESSOR_INFO_MAX];
92
93
94 typedef integer_t *processor_set_info_t; /* varying array of int. */
95
96 #define PROCESSOR_SET_INFO_MAX (1024) /* max array size */
97 typedef integer_t processor_set_info_data_t[PROCESSOR_SET_INFO_MAX];
98
99 /*
100 * Currently defined information.
101 */
102 #define PROCESSOR_BASIC_INFO 1 /* basic information */
103
104 struct processor_basic_info {
105 cpu_type_t cpu_type; /* type of cpu */
106 cpu_subtype_t cpu_subtype; /* subtype of cpu */
107 /*boolean_t*/integer_t running; /* is processor running */
108 integer_t slot_num; /* slot number */
109 /*boolean_t*/integer_t is_master; /* is this the master processor */
110 };
111
112 typedef struct processor_basic_info processor_basic_info_data_t;
113 typedef struct processor_basic_info *processor_basic_info_t;
114 #define PROCESSOR_BASIC_INFO_COUNT \
115 (sizeof(processor_basic_info_data_t)/sizeof(integer_t))
116
117
118 #define PROCESSOR_SET_BASIC_INFO 1 /* basic information */
119
120 struct processor_set_basic_info {
121 integer_t processor_count; /* How many processors */
122 integer_t task_count; /* How many tasks */
123 integer_t thread_count; /* How many threads */
124 integer_t load_average; /* Scaled */
125 integer_t mach_factor; /* Scaled */
126 };
127
128 /*
129 * Scaling factor for load_average, mach_factor.
130 */
131 #define LOAD_SCALE 1000
132
133 typedef struct processor_set_basic_info processor_set_basic_info_data_t;
134 typedef struct processor_set_basic_info *processor_set_basic_info_t;
135 #define PROCESSOR_SET_BASIC_INFO_COUNT \
136 (sizeof(processor_set_basic_info_data_t)/sizeof(integer_t))
137
138 #define PROCESSOR_SET_SCHED_INFO 2 /* scheduling info */
139
140 struct processor_set_sched_info {
141 integer_t policies; /* allowed policies */
142 integer_t max_priority; /* max priority for new threads */
143 };
144
145 typedef struct processor_set_sched_info processor_set_sched_info_data_t;
146 typedef struct processor_set_sched_info *processor_set_sched_info_t;
147 #define PROCESSOR_SET_SCHED_INFO_COUNT \
148 (sizeof(processor_set_sched_info_data_t)/sizeof(integer_t))
149
150 #endif /* _MACH_PROCESSOR_INFO_H_ */
Cache object: e88fe1092dde9d36b640f4d7c87fe532
|