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