1 /* $NetBSD: mach_task.h,v 1.15 2005/12/11 12:20:20 christos Exp $ */
4 * Copyright (c) 2002-2003 The NetBSD Foundation, Inc.
7 * This code is derived from software contributed to The NetBSD Foundation
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions
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.
19 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
20 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
23 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 * POSSIBILITY OF SUCH DAMAGE.
35 /* task_get_special_port */
37 #define MACH_TASK_KERNEL_PORT 1
38 #define MACH_TASK_HOST_PORT 2
39 #define MACH_TASK_BOOTSTRAP_PORT 4
40 #define MACH_TASK_WIRED_LEDGER_PORT 5
41 #define MACH_TASK_PAGED_LEDGER_PORT 6
44 mach_msg_header_t req_msgh
;
45 mach_ndr_record_t req_ndr
;
47 } mach_task_get_special_port_request_t
;
50 mach_msg_header_t rep_msgh
;
51 mach_msg_body_t rep_msgh_body
;
52 mach_msg_port_descriptor_t rep_special_port
;
53 mach_msg_trailer_t rep_trailer
;
54 } mach_task_get_special_port_reply_t
;
56 /* mach_ports_lookup */
59 mach_msg_header_t req_msgh
;
60 } mach_ports_lookup_request_t
;
63 mach_msg_header_t rep_msgh
;
64 mach_msg_body_t rep_msgh_body
;
65 mach_msg_ool_ports_descriptor_t rep_init_port_set
;
66 mach_ndr_record_t rep_ndr
;
67 mach_msg_type_number_t rep_init_port_set_count
;
68 mach_msg_trailer_t rep_trailer
;
69 } mach_ports_lookup_reply_t
;
71 /* mach_set_special_port */
74 mach_msg_header_t req_msgh
;
75 mach_msg_body_t req_msgh_body
;
76 mach_msg_port_descriptor_t req_special_port
;
77 mach_ndr_record_t req_ndr
;
79 } mach_task_set_special_port_request_t
;
82 mach_msg_header_t rep_msgh
;
83 mach_ndr_record_t rep_ndr
;
84 mach_kern_return_t rep_retval
;
85 mach_msg_trailer_t rep_trailer
;
86 } mach_task_set_special_port_reply_t
;
91 mach_msg_header_t req_msgh
;
92 } mach_task_threads_request_t
;
95 mach_msg_header_t rep_msgh
;
96 mach_msg_body_t rep_body
;
97 mach_msg_ool_ports_descriptor_t rep_list
;
98 mach_ndr_record_t rep_ndr
;
99 mach_msg_type_number_t rep_count
;
100 mach_msg_trailer_t rep_trailer
;
101 } mach_task_threads_reply_t
;
103 /* task_get_exception_ports */
106 mach_msg_header_t req_msgh
;
107 mach_ndr_record_t req_ndr
;
108 mach_exception_mask_t req_mask
;
109 } mach_task_get_exception_ports_request_t
;
112 mach_msg_header_t rep_msgh
;
113 mach_msg_body_t rep_body
;
114 mach_msg_port_descriptor_t rep_old_handler
[32];
115 mach_ndr_record_t rep_ndr
;
116 mach_msg_type_number_t rep_masks_count
;
117 mach_exception_mask_t rep_masks
[32];
118 mach_exception_behavior_t rep_old_behaviors
[32];
119 mach_thread_state_flavor_t rep_old_flavors
[32];
120 mach_msg_trailer_t rep_trailer
;
121 } mach_task_get_exception_ports_reply_t
;
123 /* task_set_exception_ports */
126 mach_msg_header_t req_msgh
;
127 mach_msg_body_t req_body
;
128 mach_msg_port_descriptor_t req_new_port
;
129 mach_ndr_record_t req_ndr
;
130 mach_exception_mask_t req_mask
;
131 mach_exception_behavior_t req_behavior
;
132 mach_thread_state_flavor_t req_flavor
;
133 } mach_task_set_exception_ports_request_t
;
136 mach_msg_header_t rep_msgh
;
137 mach_ndr_record_t rep_ndr
;
138 mach_kern_return_t rep_retval
;
139 mach_msg_trailer_t rep_trailer
;
140 } mach_task_set_exception_ports_reply_t
;
144 #define MACH_TASK_BASIC_INFO 4
145 struct mach_task_basic_info
{
146 mach_integer_t mtbi_suspend_count
;
147 mach_vm_size_t mtbi_virtual_size
;
148 mach_vm_size_t mtbi_resident_size
;
149 mach_time_value_t mtbi_user_time
;
150 mach_time_value_t mtbi_system_time
;
151 mach_policy_t mtbi_policy
;
154 #define MACH_TASK_EVENTS_INFO 2
155 struct mach_task_events_info
{
156 mach_integer_t mtei_faults
;
157 mach_integer_t mtei_pageins
;
158 mach_integer_t mtei_cow_faults
;
159 mach_integer_t mtei_message_sent
;
160 mach_integer_t mtei_message_received
;
161 mach_integer_t mtei_syscalls_mach
;
162 mach_integer_t mtei_syscalls_unix
;
163 mach_integer_t mtei_csw
;
166 #define MACH_TASK_THREAD_TIMES_INFO 3
167 struct mach_task_thread_times_info
{
168 mach_time_value_t mttti_user_time
;
169 mach_time_value_t mttti_system_time
;
173 mach_msg_header_t req_msgh
;
174 mach_ndr_record_t req_ndr
;
175 mach_task_flavor_t req_flavor
;
176 mach_msg_type_number_t req_count
;
177 } mach_task_info_request_t
;
180 mach_msg_header_t rep_msgh
;
181 mach_ndr_record_t rep_ndr
;
182 mach_kern_return_t rep_retval
;
183 mach_msg_type_number_t rep_count
;
184 mach_integer_t rep_info
[8];
185 mach_msg_trailer_t rep_trailer
;
186 } mach_task_info_reply_t
;
191 mach_msg_header_t req_msgh
;
192 } mach_task_suspend_request_t
;
195 mach_msg_header_t rep_msgh
;
196 mach_ndr_record_t rep_ndr
;
197 mach_kern_return_t rep_retval
;
198 mach_msg_trailer_t rep_trailer
;
199 } mach_task_suspend_reply_t
;
204 mach_msg_header_t req_msgh
;
205 } mach_task_resume_request_t
;
208 mach_msg_header_t rep_msgh
;
209 mach_ndr_record_t rep_ndr
;
210 mach_kern_return_t rep_retval
;
211 mach_msg_trailer_t rep_trailer
;
212 } mach_task_resume_reply_t
;
217 mach_msg_header_t req_msgh
;
218 } mach_task_terminate_request_t
;
221 mach_msg_header_t rep_msgh
;
222 mach_ndr_record_t rep_ndr
;
223 mach_kern_return_t rep_retval
;
224 mach_msg_trailer_t rep_trailer
;
225 } mach_task_terminate_reply_t
;
227 #endif /* _MACH_TASK_H_ */