FreeBSD/Linux Kernel Cross Reference
sys/mach/host_info.h
1 /*
2 * Mach Operating System
3 * Copyright (c) 1993,1992,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: host_info.h,v $
29 * Revision 2.7 93/11/17 17:38:28 dbg
30 * Finished the 64-bit cleanup: made host_sched_info be a struct of
31 * integer_t, since it is passed as a host_info_t.
32 * [93/11/09 dbg]
33 *
34 * Revision 2.6 93/01/14 17:41:41 danner
35 * Cleanup.
36 * [92/06/10 pds]
37 * 64bit cleanup.
38 * [92/12/01 af]
39 *
40 * Revision 2.5 92/03/10 16:26:51 jsb
41 * From durriya@ri.osf.org: defined kernel_boot_info_t.
42 * [92/03/07 08:16:27 jsb]
43 *
44 * Revision 2.4 91/05/14 16:51:48 mrt
45 * Correcting copyright
46 *
47 * Revision 2.3 91/02/05 17:31:58 mrt
48 * Changed to new Mach copyright
49 * [91/02/01 17:17:13 mrt]
50 *
51 * Revision 2.2 90/06/02 14:57:58 rpd
52 * Added HOST_LOAD_INFO and related definitions.
53 * [90/04/27 rpd]
54 * Created for new host/processor technology.
55 * [90/03/26 23:50:51 rpd]
56 *
57 * Cleanup changes.
58 * [89/08/02 dlb]
59 * Add sched_info flavor to return minimum times for use by
60 * external schedulers.
61 * [89/06/08 dlb]
62 * Added kernel_version type definitions.
63 * [88/12/02 dlb]
64 *
65 * Revision 2.4 89/10/15 02:05:31 rpd
66 * Minor cleanups.
67 *
68 * Revision 2.3 89/10/11 17:32:15 dlb
69 * Include mach/machine/vm_types.h instead of mach/vm_param.h
70 * [89/10/11 dlb]
71 *
72 * Revision 2.2 89/10/11 14:36:55 dlb
73 * Add sched_info flavor to return minimum times for use by
74 * external schedulers.
75 * [89/06/08 dlb]
76 *
77 * Added kernel_version type definitions.
78 * [88/12/02 dlb]
79 *
80 * 30-Nov-88 David Black (dlb) at Carnegie-Mellon University
81 * Created. 2 flavors so far: basic info, slot numbers.
82 *
83 */
84
85 /*
86 * File: mach/host_info.h
87 *
88 * Definitions for host_info call.
89 */
90
91 #ifndef _MACH_HOST_INFO_H_
92 #define _MACH_HOST_INFO_H_
93
94 #include <mach/machine.h>
95 #include <mach/machine/vm_types.h>
96
97 /*
98 * Generic information structure to allow for expansion.
99 */
100 typedef integer_t *host_info_t; /* varying array of integers */
101
102 #define HOST_INFO_MAX (1024) /* max array size */
103 typedef integer_t host_info_data_t[HOST_INFO_MAX];
104
105 #define KERNEL_VERSION_MAX (512)
106 typedef char kernel_version_t[KERNEL_VERSION_MAX];
107
108 #define KERNEL_BOOT_INFO_MAX (4096)
109 typedef char kernel_boot_info_t[KERNEL_BOOT_INFO_MAX];
110
111 /*
112 * Currently defined information.
113 */
114 #define HOST_BASIC_INFO 1 /* basic info */
115 #define HOST_PROCESSOR_SLOTS 2 /* processor slot numbers */
116 #define HOST_SCHED_INFO 3 /* scheduling info */
117 #define HOST_LOAD_INFO 4 /* avenrun/mach_factor info */
118
119 struct host_basic_info {
120 integer_t max_cpus; /* max number of cpus possible */
121 integer_t avail_cpus; /* number of cpus now available */
122 vm_size_t memory_size; /* size of memory in bytes */
123 cpu_type_t cpu_type; /* cpu type */
124 cpu_subtype_t cpu_subtype; /* cpu subtype */
125 };
126
127 typedef struct host_basic_info host_basic_info_data_t;
128 typedef struct host_basic_info *host_basic_info_t;
129 #define HOST_BASIC_INFO_COUNT \
130 (sizeof(host_basic_info_data_t)/sizeof(integer_t))
131
132 struct host_sched_info {
133 integer_t min_timeout; /* minimum timeout in milliseconds */
134 integer_t min_quantum; /* minimum quantum in milliseconds */
135 };
136
137 typedef struct host_sched_info host_sched_info_data_t;
138 typedef struct host_sched_info *host_sched_info_t;
139 #define HOST_SCHED_INFO_COUNT \
140 (sizeof(host_sched_info_data_t)/sizeof(integer_t))
141
142 struct host_load_info {
143 integer_t avenrun[3]; /* scaled by LOAD_SCALE */
144 integer_t mach_factor[3]; /* scaled by LOAD_SCALE */
145 };
146
147 typedef struct host_load_info host_load_info_data_t;
148 typedef struct host_load_info *host_load_info_t;
149 #define HOST_LOAD_INFO_COUNT \
150 (sizeof(host_load_info_data_t)/sizeof(integer_t))
151
152 #endif /* _MACH_HOST_INFO_H_ */
Cache object: 51f2d180da4c5aa78919b2a21caff484
|