Expand PMF_FN_* macros.
[netbsd-mini2440.git] / sys / compat / mach / mach_task.h
blob5507cbc3716fe81f387c7835f84c12e4bb4ed10a
1 /* $NetBSD: mach_task.h,v 1.15 2005/12/11 12:20:20 christos Exp $ */
3 /*-
4 * Copyright (c) 2002-2003 The NetBSD Foundation, Inc.
5 * All rights reserved.
7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Emmanuel Dreyfus
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.
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.
32 #ifndef _MACH_TASK_H_
33 #define _MACH_TASK_H_
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
43 typedef struct {
44 mach_msg_header_t req_msgh;
45 mach_ndr_record_t req_ndr;
46 int req_which_port;
47 } mach_task_get_special_port_request_t;
49 typedef struct {
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 */
58 typedef struct {
59 mach_msg_header_t req_msgh;
60 } mach_ports_lookup_request_t;
62 typedef struct {
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 */
73 typedef struct {
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;
78 int req_which_port;
79 } mach_task_set_special_port_request_t;
81 typedef struct {
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;
88 /* task_threads */
90 typedef struct {
91 mach_msg_header_t req_msgh;
92 } mach_task_threads_request_t;
94 typedef struct {
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 */
105 typedef struct {
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;
111 typedef struct {
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 */
125 typedef struct {
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;
135 typedef struct {
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;
142 /* task_info */
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;
172 typedef struct {
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;
179 typedef struct {
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;
188 /* task_suspend */
190 typedef struct {
191 mach_msg_header_t req_msgh;
192 } mach_task_suspend_request_t;
194 typedef struct {
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;
201 /* task_resume */
203 typedef struct {
204 mach_msg_header_t req_msgh;
205 } mach_task_resume_request_t;
207 typedef struct {
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;
214 /* task_terminate */
216 typedef struct {
217 mach_msg_header_t req_msgh;
218 } mach_task_terminate_request_t;
220 typedef struct {
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_ */