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