1 | #ifndef␉_processor_user_␊ |
2 | #define␉_processor_user_␊ |
3 | ␊ |
4 | /* Module processor */␊ |
5 | ␊ |
6 | #include <string.h>␊ |
7 | #include <mach/ndr.h>␊ |
8 | #include <mach/boolean.h>␊ |
9 | #include <mach/kern_return.h>␊ |
10 | #include <mach/notify.h>␊ |
11 | #include <mach/mach_types.h>␊ |
12 | #include <mach/message.h>␊ |
13 | #include <mach/mig_errors.h>␊ |
14 | #include <mach/port.h>␊ |
15 | ␊ |
16 | #ifdef AUTOTEST␊ |
17 | #ifndef FUNCTION_PTR_T␊ |
18 | #define FUNCTION_PTR_T␊ |
19 | typedef void (*function_ptr_t)(mach_port_t, char *, mach_msg_type_number_t);␊ |
20 | typedef struct {␊ |
21 | char *name;␊ |
22 | function_ptr_t function;␊ |
23 | } function_table_entry;␊ |
24 | typedef function_table_entry *function_table_t;␊ |
25 | #endif /* FUNCTION_PTR_T */␊ |
26 | #endif /* AUTOTEST */␊ |
27 | ␊ |
28 | #ifndef␉processor_MSG_COUNT␊ |
29 | #define␉processor_MSG_COUNT␉6␊ |
30 | #endif␉/* processor_MSG_COUNT */␊ |
31 | ␊ |
32 | #include <mach/std_types.h>␊ |
33 | #include <mach/mig.h>␊ |
34 | #include <mach/mig.h>␊ |
35 | #include <mach/mach_types.h>␊ |
36 | ␊ |
37 | #ifdef __BeforeMigUserHeader␊ |
38 | __BeforeMigUserHeader␊ |
39 | #endif /* __BeforeMigUserHeader */␊ |
40 | ␊ |
41 | #include <sys/cdefs.h>␊ |
42 | __BEGIN_DECLS␊ |
43 | ␊ |
44 | ␊ |
45 | /* Routine processor_start */␊ |
46 | #ifdef␉mig_external␊ |
47 | mig_external␊ |
48 | #else␊ |
49 | extern␊ |
50 | #endif␉/* mig_external */␊ |
51 | kern_return_t processor_start␊ |
52 | (␊ |
53 | ␉processor_t processor␊ |
54 | );␊ |
55 | ␊ |
56 | /* Routine processor_exit */␊ |
57 | #ifdef␉mig_external␊ |
58 | mig_external␊ |
59 | #else␊ |
60 | extern␊ |
61 | #endif␉/* mig_external */␊ |
62 | kern_return_t processor_exit␊ |
63 | (␊ |
64 | ␉processor_t processor␊ |
65 | );␊ |
66 | ␊ |
67 | /* Routine processor_info */␊ |
68 | #ifdef␉mig_external␊ |
69 | mig_external␊ |
70 | #else␊ |
71 | extern␊ |
72 | #endif␉/* mig_external */␊ |
73 | kern_return_t processor_info␊ |
74 | (␊ |
75 | ␉processor_t processor,␊ |
76 | ␉processor_flavor_t flavor,␊ |
77 | ␉host_t *host,␊ |
78 | ␉processor_info_t processor_info_out,␊ |
79 | ␉mach_msg_type_number_t *processor_info_outCnt␊ |
80 | );␊ |
81 | ␊ |
82 | /* Routine processor_control */␊ |
83 | #ifdef␉mig_external␊ |
84 | mig_external␊ |
85 | #else␊ |
86 | extern␊ |
87 | #endif␉/* mig_external */␊ |
88 | kern_return_t processor_control␊ |
89 | (␊ |
90 | ␉processor_t processor,␊ |
91 | ␉processor_info_t processor_cmd,␊ |
92 | ␉mach_msg_type_number_t processor_cmdCnt␊ |
93 | );␊ |
94 | ␊ |
95 | /* Routine processor_assign */␊ |
96 | #ifdef␉mig_external␊ |
97 | mig_external␊ |
98 | #else␊ |
99 | extern␊ |
100 | #endif␉/* mig_external */␊ |
101 | kern_return_t processor_assign␊ |
102 | (␊ |
103 | ␉processor_t processor,␊ |
104 | ␉processor_set_t new_set,␊ |
105 | ␉boolean_t wait␊ |
106 | );␊ |
107 | ␊ |
108 | /* Routine processor_get_assignment */␊ |
109 | #ifdef␉mig_external␊ |
110 | mig_external␊ |
111 | #else␊ |
112 | extern␊ |
113 | #endif␉/* mig_external */␊ |
114 | kern_return_t processor_get_assignment␊ |
115 | (␊ |
116 | ␉processor_t processor,␊ |
117 | ␉processor_set_name_t *assigned_set␊ |
118 | );␊ |
119 | ␊ |
120 | __END_DECLS␊ |
121 | ␊ |
122 | /********************** Caution **************************/␊ |
123 | /* The following data types should be used to calculate */␊ |
124 | /* maximum message sizes only. The actual message may be */␊ |
125 | /* smaller, and the position of the arguments within the */␊ |
126 | /* message layout may vary from what is presented here. */␊ |
127 | /* For example, if any of the arguments are variable- */␊ |
128 | /* sized, and less than the maximum is sent, the data */␊ |
129 | /* will be packed tight in the actual message to reduce */␊ |
130 | /* the presence of holes. */␊ |
131 | /********************** Caution **************************/␊ |
132 | ␊ |
133 | /* typedefs for all requests */␊ |
134 | ␊ |
135 | #ifndef __Request__processor_subsystem__defined␊ |
136 | #define __Request__processor_subsystem__defined␊ |
137 | ␊ |
138 | #ifdef __MigPackStructs␊ |
139 | #pragma pack(4)␊ |
140 | #endif␊ |
141 | ␉typedef struct {␊ |
142 | ␉␉mach_msg_header_t Head;␊ |
143 | ␉} __Request__processor_start_t;␊ |
144 | #ifdef __MigPackStructs␊ |
145 | #pragma pack()␊ |
146 | #endif␊ |
147 | ␊ |
148 | #ifdef __MigPackStructs␊ |
149 | #pragma pack(4)␊ |
150 | #endif␊ |
151 | ␉typedef struct {␊ |
152 | ␉␉mach_msg_header_t Head;␊ |
153 | ␉} __Request__processor_exit_t;␊ |
154 | #ifdef __MigPackStructs␊ |
155 | #pragma pack()␊ |
156 | #endif␊ |
157 | ␊ |
158 | #ifdef __MigPackStructs␊ |
159 | #pragma pack(4)␊ |
160 | #endif␊ |
161 | ␉typedef struct {␊ |
162 | ␉␉mach_msg_header_t Head;␊ |
163 | ␉␉NDR_record_t NDR;␊ |
164 | ␉␉processor_flavor_t flavor;␊ |
165 | ␉␉mach_msg_type_number_t processor_info_outCnt;␊ |
166 | ␉} __Request__processor_info_t;␊ |
167 | #ifdef __MigPackStructs␊ |
168 | #pragma pack()␊ |
169 | #endif␊ |
170 | ␊ |
171 | #ifdef __MigPackStructs␊ |
172 | #pragma pack(4)␊ |
173 | #endif␊ |
174 | ␉typedef struct {␊ |
175 | ␉␉mach_msg_header_t Head;␊ |
176 | ␉␉NDR_record_t NDR;␊ |
177 | ␉␉mach_msg_type_number_t processor_cmdCnt;␊ |
178 | ␉␉integer_t processor_cmd[12];␊ |
179 | ␉} __Request__processor_control_t;␊ |
180 | #ifdef __MigPackStructs␊ |
181 | #pragma pack()␊ |
182 | #endif␊ |
183 | ␊ |
184 | #ifdef __MigPackStructs␊ |
185 | #pragma pack(4)␊ |
186 | #endif␊ |
187 | ␉typedef struct {␊ |
188 | ␉␉mach_msg_header_t Head;␊ |
189 | ␉␉/* start of the kernel processed data */␊ |
190 | ␉␉mach_msg_body_t msgh_body;␊ |
191 | ␉␉mach_msg_port_descriptor_t new_set;␊ |
192 | ␉␉/* end of the kernel processed data */␊ |
193 | ␉␉NDR_record_t NDR;␊ |
194 | ␉␉boolean_t wait;␊ |
195 | ␉} __Request__processor_assign_t;␊ |
196 | #ifdef __MigPackStructs␊ |
197 | #pragma pack()␊ |
198 | #endif␊ |
199 | ␊ |
200 | #ifdef __MigPackStructs␊ |
201 | #pragma pack(4)␊ |
202 | #endif␊ |
203 | ␉typedef struct {␊ |
204 | ␉␉mach_msg_header_t Head;␊ |
205 | ␉} __Request__processor_get_assignment_t;␊ |
206 | #ifdef __MigPackStructs␊ |
207 | #pragma pack()␊ |
208 | #endif␊ |
209 | #endif /* !__Request__processor_subsystem__defined */␊ |
210 | ␊ |
211 | /* union of all requests */␊ |
212 | ␊ |
213 | #ifndef __RequestUnion__processor_subsystem__defined␊ |
214 | #define __RequestUnion__processor_subsystem__defined␊ |
215 | union __RequestUnion__processor_subsystem {␊ |
216 | ␉__Request__processor_start_t Request_processor_start;␊ |
217 | ␉__Request__processor_exit_t Request_processor_exit;␊ |
218 | ␉__Request__processor_info_t Request_processor_info;␊ |
219 | ␉__Request__processor_control_t Request_processor_control;␊ |
220 | ␉__Request__processor_assign_t Request_processor_assign;␊ |
221 | ␉__Request__processor_get_assignment_t Request_processor_get_assignment;␊ |
222 | };␊ |
223 | #endif /* !__RequestUnion__processor_subsystem__defined */␊ |
224 | /* typedefs for all replies */␊ |
225 | ␊ |
226 | #ifndef __Reply__processor_subsystem__defined␊ |
227 | #define __Reply__processor_subsystem__defined␊ |
228 | ␊ |
229 | #ifdef __MigPackStructs␊ |
230 | #pragma pack(4)␊ |
231 | #endif␊ |
232 | ␉typedef struct {␊ |
233 | ␉␉mach_msg_header_t Head;␊ |
234 | ␉␉NDR_record_t NDR;␊ |
235 | ␉␉kern_return_t RetCode;␊ |
236 | ␉} __Reply__processor_start_t;␊ |
237 | #ifdef __MigPackStructs␊ |
238 | #pragma pack()␊ |
239 | #endif␊ |
240 | ␊ |
241 | #ifdef __MigPackStructs␊ |
242 | #pragma pack(4)␊ |
243 | #endif␊ |
244 | ␉typedef struct {␊ |
245 | ␉␉mach_msg_header_t Head;␊ |
246 | ␉␉NDR_record_t NDR;␊ |
247 | ␉␉kern_return_t RetCode;␊ |
248 | ␉} __Reply__processor_exit_t;␊ |
249 | #ifdef __MigPackStructs␊ |
250 | #pragma pack()␊ |
251 | #endif␊ |
252 | ␊ |
253 | #ifdef __MigPackStructs␊ |
254 | #pragma pack(4)␊ |
255 | #endif␊ |
256 | ␉typedef struct {␊ |
257 | ␉␉mach_msg_header_t Head;␊ |
258 | ␉␉/* start of the kernel processed data */␊ |
259 | ␉␉mach_msg_body_t msgh_body;␊ |
260 | ␉␉mach_msg_port_descriptor_t host;␊ |
261 | ␉␉/* end of the kernel processed data */␊ |
262 | ␉␉NDR_record_t NDR;␊ |
263 | ␉␉mach_msg_type_number_t processor_info_outCnt;␊ |
264 | ␉␉integer_t processor_info_out[12];␊ |
265 | ␉} __Reply__processor_info_t;␊ |
266 | #ifdef __MigPackStructs␊ |
267 | #pragma pack()␊ |
268 | #endif␊ |
269 | ␊ |
270 | #ifdef __MigPackStructs␊ |
271 | #pragma pack(4)␊ |
272 | #endif␊ |
273 | ␉typedef struct {␊ |
274 | ␉␉mach_msg_header_t Head;␊ |
275 | ␉␉NDR_record_t NDR;␊ |
276 | ␉␉kern_return_t RetCode;␊ |
277 | ␉} __Reply__processor_control_t;␊ |
278 | #ifdef __MigPackStructs␊ |
279 | #pragma pack()␊ |
280 | #endif␊ |
281 | ␊ |
282 | #ifdef __MigPackStructs␊ |
283 | #pragma pack(4)␊ |
284 | #endif␊ |
285 | ␉typedef struct {␊ |
286 | ␉␉mach_msg_header_t Head;␊ |
287 | ␉␉NDR_record_t NDR;␊ |
288 | ␉␉kern_return_t RetCode;␊ |
289 | ␉} __Reply__processor_assign_t;␊ |
290 | #ifdef __MigPackStructs␊ |
291 | #pragma pack()␊ |
292 | #endif␊ |
293 | ␊ |
294 | #ifdef __MigPackStructs␊ |
295 | #pragma pack(4)␊ |
296 | #endif␊ |
297 | ␉typedef struct {␊ |
298 | ␉␉mach_msg_header_t Head;␊ |
299 | ␉␉/* start of the kernel processed data */␊ |
300 | ␉␉mach_msg_body_t msgh_body;␊ |
301 | ␉␉mach_msg_port_descriptor_t assigned_set;␊ |
302 | ␉␉/* end of the kernel processed data */␊ |
303 | ␉} __Reply__processor_get_assignment_t;␊ |
304 | #ifdef __MigPackStructs␊ |
305 | #pragma pack()␊ |
306 | #endif␊ |
307 | #endif /* !__Reply__processor_subsystem__defined */␊ |
308 | ␊ |
309 | /* union of all replies */␊ |
310 | ␊ |
311 | #ifndef __ReplyUnion__processor_subsystem__defined␊ |
312 | #define __ReplyUnion__processor_subsystem__defined␊ |
313 | union __ReplyUnion__processor_subsystem {␊ |
314 | ␉__Reply__processor_start_t Reply_processor_start;␊ |
315 | ␉__Reply__processor_exit_t Reply_processor_exit;␊ |
316 | ␉__Reply__processor_info_t Reply_processor_info;␊ |
317 | ␉__Reply__processor_control_t Reply_processor_control;␊ |
318 | ␉__Reply__processor_assign_t Reply_processor_assign;␊ |
319 | ␉__Reply__processor_get_assignment_t Reply_processor_get_assignment;␊ |
320 | };␊ |
321 | #endif /* !__RequestUnion__processor_subsystem__defined */␊ |
322 | ␊ |
323 | #ifndef subsystem_to_name_map_processor␊ |
324 | #define subsystem_to_name_map_processor \␊ |
325 | { "processor_start", 3000 },\␊ |
326 | { "processor_exit", 3001 },\␊ |
327 | { "processor_info", 3002 },\␊ |
328 | { "processor_control", 3003 },\␊ |
329 | { "processor_assign", 3004 },\␊ |
330 | { "processor_get_assignment", 3005 }␊ |
331 | #endif␊ |
332 | ␊ |
333 | #ifdef __AfterMigUserHeader␊ |
334 | __AfterMigUserHeader␊ |
335 | #endif /* __AfterMigUserHeader */␊ |
336 | ␊ |
337 | #endif␉ /* _processor_user_ */␊ |
338 | |