2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
6 * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved.
8 * This file contains Original Code and/or Modifications of Original Code
9 * as defined in and that are subject to the Apple Public Source License
10 * Version 2.0 (the 'License'). You may not use this file except in
11 * compliance with the License. Please obtain a copy of the License at
12 * http://www.opensource.apple.com/apsl/ and read it before using this
15 * The Original Code and all software distributed under the License are
16 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
17 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
18 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
20 * Please see the License for the specific language governing rights and
21 * limitations under the License.
23 * @APPLE_LICENSE_HEADER_END@
29 * Mach Operating System
30 * Copyright (c) 1991,1990,1989,1988 Carnegie Mellon University
31 * All Rights Reserved.
33 * Permission to use, copy, modify and distribute this software and its
34 * documentation is hereby granted, provided that both the copyright
35 * notice and this permission notice appear in all copies of the
36 * software, derivative works or modified versions, and any portions
37 * thereof, and that both notices appear in supporting documentation.
39 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
40 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
41 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
43 * Carnegie Mellon requests users of this software to return to
45 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
46 * School of Computer Science
47 * Carnegie Mellon University
48 * Pittsburgh PA 15213-3890
50 * any improvements or extensions that they make and grant Carnegie Mellon
51 * the rights to redistribute these changes.
57 * File: mach/host_info.h
59 * Definitions for host_info call.
62 #ifndef _MACH_HOST_INFO_H_
63 #define _MACH_HOST_INFO_H_
65 #include <mach/vm_statistics.h>
66 #include <mach/machine.h>
67 #include <mach/machine/vm_types.h>
68 #include <mach/time_value.h>
71 * Generic information structure to allow for expansion.
73 typedef integer_t
*host_info_t
; /* varying array of int. */
75 #define HOST_INFO_MAX (1024) /* max array size */
76 typedef integer_t host_info_data_t
[HOST_INFO_MAX
];
78 #define KERNEL_VERSION_MAX (512)
79 typedef char kernel_version_t
[KERNEL_VERSION_MAX
];
81 #define KERNEL_BOOT_INFO_MAX (4096)
82 typedef char kernel_boot_info_t
[KERNEL_BOOT_INFO_MAX
];
84 #define KERNEL_BOOTMAGIC_MAX (8192)
87 * Currently defined information.
90 typedef integer_t host_flavor_t
;
91 #define HOST_BASIC_INFO 1 /* basic info */
92 #define HOST_SCHED_INFO 3 /* scheduling info */
93 #define HOST_RESOURCE_SIZES 4 /* kernel struct sizes */
94 #define HOST_PRIORITY_INFO 5 /* priority information */
95 #define HOST_SEMAPHORE_TRAPS 7 /* Has semaphore traps */
96 #define HOST_MACH_MSG_TRAP 8 /* Has mach_msg_trap */
98 struct host_basic_info
{
99 integer_t max_cpus
; /* max number of cpus possible */
100 integer_t avail_cpus
; /* number of cpus now available */
101 vm_size_t memory_size
; /* size of memory in bytes */
102 cpu_type_t cpu_type
; /* cpu type */
103 cpu_subtype_t cpu_subtype
; /* cpu subtype */
106 typedef struct host_basic_info host_basic_info_data_t
;
107 typedef struct host_basic_info
*host_basic_info_t
;
108 #define HOST_BASIC_INFO_COUNT \
109 (sizeof(host_basic_info_data_t)/sizeof(integer_t))
111 struct host_sched_info
{
112 integer_t min_timeout
; /* minimum timeout in milliseconds */
113 integer_t min_quantum
; /* minimum quantum in milliseconds */
116 typedef struct host_sched_info host_sched_info_data_t
;
117 typedef struct host_sched_info
*host_sched_info_t
;
118 #define HOST_SCHED_INFO_COUNT \
119 (sizeof(host_sched_info_data_t)/sizeof(integer_t))
121 struct kernel_resource_sizes
{
125 vm_size_t memory_region
;
126 vm_size_t memory_object
;
129 typedef struct kernel_resource_sizes kernel_resource_sizes_data_t
;
130 typedef struct kernel_resource_sizes
*kernel_resource_sizes_t
;
131 #define HOST_RESOURCE_SIZES_COUNT \
132 (sizeof(kernel_resource_sizes_data_t)/sizeof(integer_t))
134 struct host_priority_info
{
135 integer_t kernel_priority
;
136 integer_t system_priority
;
137 integer_t server_priority
;
138 integer_t user_priority
;
139 integer_t depress_priority
;
140 integer_t idle_priority
;
141 integer_t minimum_priority
;
142 integer_t maximum_priority
;
145 typedef struct host_priority_info host_priority_info_data_t
;
146 typedef struct host_priority_info
*host_priority_info_t
;
147 #define HOST_PRIORITY_INFO_COUNT \
148 (sizeof(host_priority_info_data_t)/sizeof(integer_t))
150 /* host_statistics() */
151 #define HOST_LOAD_INFO 1 /* System loading stats */
152 #define HOST_VM_INFO 2 /* Virtual memory stats */
153 #define HOST_CPU_LOAD_INFO 3 /* CPU load stats */
155 struct host_load_info
{
156 integer_t avenrun
[3]; /* scaled by LOAD_SCALE */
157 integer_t mach_factor
[3]; /* scaled by LOAD_SCALE */
160 typedef struct host_load_info host_load_info_data_t
;
161 typedef struct host_load_info
*host_load_info_t
;
162 #define HOST_LOAD_INFO_COUNT \
163 (sizeof(host_load_info_data_t)/sizeof(integer_t))
165 /* in <mach/vm_statistics.h> */
166 #define HOST_VM_INFO_COUNT \
167 (sizeof(vm_statistics_data_t)/sizeof(integer_t))
169 struct host_cpu_load_info
{ /* number of ticks while running... */
170 unsigned long cpu_ticks
[CPU_STATE_MAX
]; /* ... in the given mode */
172 typedef struct host_cpu_load_info host_cpu_load_info_data_t
;
173 typedef struct host_cpu_load_info
*host_cpu_load_info_t
;
174 #define HOST_CPU_LOAD_INFO_COUNT \
175 (sizeof (host_cpu_load_info_data_t) / sizeof (integer_t))
177 #endif /* _MACH_HOST_INFO_H_ */