Chameleon Applications

Chameleon Applications Svn Source Tree

Root/branches/iFabio/Chameleon/i386/include/mach/host_info.h

Source at commit 296 created 12 years 10 months ago.
By ifabio, add i386 folder
1/*
2 * Copyright (c) 2000-2009 Apple Inc. All rights reserved.
3 *
4 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
5 *
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
14 *
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
17 *
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
25 *
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
27 */
28/*
29 * @OSF_COPYRIGHT@
30 */
31/*
32 * Mach Operating System
33 * Copyright (c) 1991,1990,1989,1988 Carnegie Mellon University
34 * All Rights Reserved.
35 *
36 * Permission to use, copy, modify and distribute this software and its
37 * documentation is hereby granted, provided that both the copyright
38 * notice and this permission notice appear in all copies of the
39 * software, derivative works or modified versions, and any portions
40 * thereof, and that both notices appear in supporting documentation.
41 *
42 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
43 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
44 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
45 *
46 * Carnegie Mellon requests users of this software to return to
47 *
48 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
49 * School of Computer Science
50 * Carnegie Mellon University
51 * Pittsburgh PA 15213-3890
52 *
53 * any improvements or extensions that they make and grant Carnegie Mellon
54 * the rights to redistribute these changes.
55 */
56/*
57 */
58
59/*
60 *File:mach/host_info.h
61 *
62 *Definitions for host_info call.
63 */
64
65#ifndef_MACH_HOST_INFO_H_
66#define_MACH_HOST_INFO_H_
67
68#include <mach/message.h>
69#include <mach/vm_statistics.h>
70#include <mach/machine.h>
71#include <mach/machine/vm_types.h>
72#include <mach/time_value.h>
73
74#include <sys/cdefs.h>
75
76/*
77 *Generic information structure to allow for expansion.
78 */
79typedef integer_t*host_info_t;/* varying array of int. */
80typedef integer_t*host_info64_t;/* varying array of int. */
81
82#defineHOST_INFO_MAX(1024)/* max array size */
83typedef integer_thost_info_data_t[HOST_INFO_MAX];
84
85#define KERNEL_VERSION_MAX (512)
86typedef charkernel_version_t[KERNEL_VERSION_MAX];
87
88#define KERNEL_BOOT_INFO_MAX (4096)
89typedef charkernel_boot_info_t[KERNEL_BOOT_INFO_MAX];
90
91/*
92 *Currently defined information.
93 */
94/* host_info() */
95typedefinteger_thost_flavor_t;
96#define HOST_BASIC_INFO1/* basic info */
97#define HOST_SCHED_INFO3/* scheduling info */
98#define HOST_RESOURCE_SIZES4/* kernel struct sizes */
99#define HOST_PRIORITY_INFO5/* priority information */
100#define HOST_SEMAPHORE_TRAPS7/* Has semaphore traps */
101#define HOST_MACH_MSG_TRAP8/* Has mach_msg_trap */
102
103
104#pragma pack(4)
105
106struct host_basic_info {
107integer_tmax_cpus;/* max number of CPUs possible */
108integer_tavail_cpus;/* number of CPUs now available */
109natural_tmemory_size;/* size of memory in bytes, capped at 2 GB */
110cpu_type_tcpu_type;/* cpu type */
111cpu_subtype_tcpu_subtype;/* cpu subtype */
112cpu_threadtype_tcpu_threadtype;/* cpu threadtype */
113integer_tphysical_cpu;/* number of physical CPUs now available */
114integer_tphysical_cpu_max;/* max number of physical CPUs possible */
115integer_tlogical_cpu;/* number of logical cpu now available */
116integer_tlogical_cpu_max;/* max number of physical CPUs possible */
117uint64_tmax_mem;/* actual size of physical memory */
118};
119
120#pragma pack()
121
122typedefstruct host_basic_infohost_basic_info_data_t;
123typedef struct host_basic_info*host_basic_info_t;
124#define HOST_BASIC_INFO_COUNT ((mach_msg_type_number_t) \
125(sizeof(host_basic_info_data_t)/sizeof(integer_t)))
126
127struct host_sched_info {
128integer_tmin_timeout;/* minimum timeout in milliseconds */
129integer_tmin_quantum;/* minimum quantum in milliseconds */
130};
131
132typedefstruct host_sched_infohost_sched_info_data_t;
133typedef struct host_sched_info*host_sched_info_t;
134#define HOST_SCHED_INFO_COUNT ((mach_msg_type_number_t) \
135(sizeof(host_sched_info_data_t)/sizeof(integer_t)))
136
137struct kernel_resource_sizes {
138natural_ttask;
139 natural_tthread;
140 natural_tport;
141 natural_tmemory_region;
142 natural_tmemory_object;
143};
144
145typedef struct kernel_resource_sizeskernel_resource_sizes_data_t;
146typedef struct kernel_resource_sizes*kernel_resource_sizes_t;
147#define HOST_RESOURCE_SIZES_COUNT ((mach_msg_type_number_t) \
148(sizeof(kernel_resource_sizes_data_t)/sizeof(integer_t)))
149
150struct host_priority_info {
151 integer_tkernel_priority;
152 integer_tsystem_priority;
153 integer_tserver_priority;
154 integer_tuser_priority;
155 integer_tdepress_priority;
156 integer_tidle_priority;
157 integer_tminimum_priority;
158integer_tmaximum_priority;
159};
160
161typedef struct host_priority_infohost_priority_info_data_t;
162typedef struct host_priority_info*host_priority_info_t;
163#define HOST_PRIORITY_INFO_COUNT ((mach_msg_type_number_t) \
164(sizeof(host_priority_info_data_t)/sizeof(integer_t)))
165
166/* host_statistics() */
167#defineHOST_LOAD_INFO1/* System loading stats */
168#define HOST_VM_INFO2/* Virtual memory stats */
169#define HOST_CPU_LOAD_INFO3/* CPU load stats */
170
171/* host_statistics64() */
172#define HOST_VM_INFO644/* 64-bit virtual memory stats */
173
174
175struct host_load_info {
176integer_tavenrun[3];/* scaled by LOAD_SCALE */
177integer_tmach_factor[3];/* scaled by LOAD_SCALE */
178};
179
180typedef struct host_load_infohost_load_info_data_t;
181typedef struct host_load_info*host_load_info_t;
182#defineHOST_LOAD_INFO_COUNT ((mach_msg_type_number_t) \
183(sizeof(host_load_info_data_t)/sizeof(integer_t)))
184
185/* in <mach/vm_statistics.h> */
186/* vm_statistics64 */
187#defineHOST_VM_INFO64_COUNT ((mach_msg_type_number_t) \
188(sizeof(vm_statistics64_data_t)/sizeof(integer_t)))
189
190/* size of the latest version of the structure */
191#define HOST_VM_INFO64_LATEST_COUNT HOST_VM_INFO64_COUNT
192
193
194/* vm_statistics */
195#defineHOST_VM_INFO_COUNT ((mach_msg_type_number_t) \
196(sizeof(vm_statistics_data_t)/sizeof(integer_t)))
197
198/* size of the latest version of the structure */
199#define HOST_VM_INFO_LATEST_COUNT HOST_VM_INFO_COUNT
200#defineHOST_VM_INFO_REV2_COUNT HOST_VM_INFO_LATEST_COUNT
201/* previous versions: adjust the size according to what was added each time */
202#defineHOST_VM_INFO_REV1_COUNT /* added "speculative_count" (1 int) */\
203((mach_msg_type_number_t) \
204 (HOST_VM_INFO_REV2_COUNT - 1))
205#defineHOST_VM_INFO_REV0_COUNT /* added "purgable" info (2 ints) */ \
206((mach_msg_type_number_t) \
207 (HOST_VM_INFO_REV1_COUNT - 2))
208
209struct host_cpu_load_info {/* number of ticks while running... */
210natural_tcpu_ticks[CPU_STATE_MAX]; /* ... in the given mode */
211};
212
213typedef struct host_cpu_load_infohost_cpu_load_info_data_t;
214typedef struct host_cpu_load_info*host_cpu_load_info_t;
215#define HOST_CPU_LOAD_INFO_COUNT ((mach_msg_type_number_t) \
216(sizeof (host_cpu_load_info_data_t) / sizeof (integer_t)))
217
218#endif/* _MACH_HOST_INFO_H_ */
219

Archive Download this file

Revision: 296