1 /* $NetBSD: mach_task.h,v 1.14 2005/02/26 23:10:20 perry Exp $ */
2
3 /*-
4 * Copyright (c) 2002-2003 The NetBSD Foundation, Inc.
5 * All rights reserved.
6 *
7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Emmanuel Dreyfus
9 *
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions
12 * are met:
13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer.
15 * 2. Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in the
17 * documentation and/or other materials provided with the distribution.
18 * 3. All advertising materials mentioning features or use of this software
19 * must display the following acknowledgement:
20 * This product includes software developed by the NetBSD
21 * Foundation, Inc. and its contributors.
22 * 4. Neither the name of The NetBSD Foundation nor the names of its
23 * contributors may be used to endorse or promote products derived
24 * from this software without specific prior written permission.
25 *
26 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
27 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
28 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
29 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
30 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
31 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
32 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
33 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
34 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
35 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36 * POSSIBILITY OF SUCH DAMAGE.
37 */
38
39 #ifndef _MACH_TASK_H_
40 #define _MACH_TASK_H_
41
42 /* task_get_special_port */
43
44 #define MACH_TASK_KERNEL_PORT 1
45 #define MACH_TASK_HOST_PORT 2
46 #define MACH_TASK_BOOTSTRAP_PORT 4
47 #define MACH_TASK_WIRED_LEDGER_PORT 5
48 #define MACH_TASK_PAGED_LEDGER_PORT 6
49
50 typedef struct {
51 mach_msg_header_t req_msgh;
52 mach_ndr_record_t req_ndr;
53 int req_which_port;
54 } mach_task_get_special_port_request_t;
55
56 typedef struct {
57 mach_msg_header_t rep_msgh;
58 mach_msg_body_t rep_msgh_body;
59 mach_msg_port_descriptor_t rep_special_port;
60 mach_msg_trailer_t rep_trailer;
61 } mach_task_get_special_port_reply_t;
62
63 /* mach_ports_lookup */
64
65 typedef struct {
66 mach_msg_header_t req_msgh;
67 } mach_ports_lookup_request_t;
68
69 typedef struct {
70 mach_msg_header_t rep_msgh;
71 mach_msg_body_t rep_msgh_body;
72 mach_msg_ool_ports_descriptor_t rep_init_port_set;
73 mach_ndr_record_t rep_ndr;
74 mach_msg_type_number_t rep_init_port_set_count;
75 mach_msg_trailer_t rep_trailer;
76 } mach_ports_lookup_reply_t;
77
78 /* mach_set_special_port */
79
80 typedef struct {
81 mach_msg_header_t req_msgh;
82 mach_msg_body_t req_msgh_body;
83 mach_msg_port_descriptor_t req_special_port;
84 mach_ndr_record_t req_ndr;
85 int req_which_port;
86 } mach_task_set_special_port_request_t;
87
88 typedef struct {
89 mach_msg_header_t rep_msgh;
90 mach_ndr_record_t rep_ndr;
91 mach_kern_return_t rep_retval;
92 mach_msg_trailer_t rep_trailer;
93 } mach_task_set_special_port_reply_t;
94
95 /* task_threads */
96
97 typedef struct {
98 mach_msg_header_t req_msgh;
99 } mach_task_threads_request_t;
100
101 typedef struct {
102 mach_msg_header_t rep_msgh;
103 mach_msg_body_t rep_body;
104 mach_msg_ool_ports_descriptor_t rep_list;
105 mach_ndr_record_t rep_ndr;
106 mach_msg_type_number_t rep_count;
107 mach_msg_trailer_t rep_trailer;
108 } mach_task_threads_reply_t;
109
110 /* task_get_exception_ports */
111
112 typedef struct {
113 mach_msg_header_t req_msgh;
114 mach_ndr_record_t req_ndr;
115 mach_exception_mask_t req_mask;
116 } mach_task_get_exception_ports_request_t;
117
118 typedef struct {
119 mach_msg_header_t rep_msgh;
120 mach_msg_body_t rep_body;
121 mach_msg_port_descriptor_t rep_old_handler[32];
122 mach_ndr_record_t rep_ndr;
123 mach_msg_type_number_t rep_masks_count;
124 mach_exception_mask_t rep_masks[32];
125 mach_exception_behavior_t rep_old_behaviors[32];
126 mach_thread_state_flavor_t rep_old_flavors[32];
127 mach_msg_trailer_t rep_trailer;
128 } mach_task_get_exception_ports_reply_t;
129
130 /* task_set_exception_ports */
131
132 typedef struct {
133 mach_msg_header_t req_msgh;
134 mach_msg_body_t req_body;
135 mach_msg_port_descriptor_t req_new_port;
136 mach_ndr_record_t req_ndr;
137 mach_exception_mask_t req_mask;
138 mach_exception_behavior_t req_behavior;
139 mach_thread_state_flavor_t req_flavor;
140 } mach_task_set_exception_ports_request_t;
141
142 typedef struct {
143 mach_msg_header_t rep_msgh;
144 mach_ndr_record_t rep_ndr;
145 mach_kern_return_t rep_retval;
146 mach_msg_trailer_t rep_trailer;
147 } mach_task_set_exception_ports_reply_t;
148
149 /* task_info */
150
151 #define MACH_TASK_BASIC_INFO 4
152 struct mach_task_basic_info {
153 mach_integer_t mtbi_suspend_count;
154 mach_vm_size_t mtbi_virtual_size;
155 mach_vm_size_t mtbi_resident_size;
156 mach_time_value_t mtbi_user_time;
157 mach_time_value_t mtbi_system_time;
158 mach_policy_t mtbi_policy;
159 };
160
161 #define MACH_TASK_EVENTS_INFO 2
162 struct mach_task_events_info {
163 mach_integer_t mtei_faults;
164 mach_integer_t mtei_pageins;
165 mach_integer_t mtei_cow_faults;
166 mach_integer_t mtei_message_sent;
167 mach_integer_t mtei_message_received;
168 mach_integer_t mtei_syscalls_mach;
169 mach_integer_t mtei_syscalls_unix;
170 mach_integer_t mtei_csw;
171 };
172
173 #define MACH_TASK_THREAD_TIMES_INFO 3
174 struct mach_task_thread_times_info {
175 mach_time_value_t mttti_user_time;
176 mach_time_value_t mttti_system_time;
177 };
178
179 typedef struct {
180 mach_msg_header_t req_msgh;
181 mach_ndr_record_t req_ndr;
182 mach_task_flavor_t req_flavor;
183 mach_msg_type_number_t req_count;
184 } mach_task_info_request_t;
185
186 typedef struct {
187 mach_msg_header_t rep_msgh;
188 mach_ndr_record_t rep_ndr;
189 mach_kern_return_t rep_retval;
190 mach_msg_type_number_t rep_count;
191 mach_integer_t rep_info[8];
192 mach_msg_trailer_t rep_trailer;
193 } mach_task_info_reply_t;
194
195 /* task_suspend */
196
197 typedef struct {
198 mach_msg_header_t req_msgh;
199 } mach_task_suspend_request_t;
200
201 typedef struct {
202 mach_msg_header_t rep_msgh;
203 mach_ndr_record_t rep_ndr;
204 mach_kern_return_t rep_retval;
205 mach_msg_trailer_t rep_trailer;
206 } mach_task_suspend_reply_t;
207
208 /* task_resume */
209
210 typedef struct {
211 mach_msg_header_t req_msgh;
212 } mach_task_resume_request_t;
213
214 typedef struct {
215 mach_msg_header_t rep_msgh;
216 mach_ndr_record_t rep_ndr;
217 mach_kern_return_t rep_retval;
218 mach_msg_trailer_t rep_trailer;
219 } mach_task_resume_reply_t;
220
221 /* task_terminate */
222
223 typedef struct {
224 mach_msg_header_t req_msgh;
225 } mach_task_terminate_request_t;
226
227 typedef struct {
228 mach_msg_header_t rep_msgh;
229 mach_ndr_record_t rep_ndr;
230 mach_kern_return_t rep_retval;
231 mach_msg_trailer_t rep_trailer;
232 } mach_task_terminate_reply_t;
233
234 #endif /* _MACH_TASK_H_ */
Cache object: 92362d35a320feda55a1b034526131ac
|