1 | /* |
2 | * IDENTIFICATION: |
3 | * stub generated by bootstrap_cmds-133 |
4 | * OPTIONS: |
5 | * KernelUser |
6 | */ |
7 | #define __MIG_check__Reply__notify_subsystem__ 1 |
8 | |
9 | #include "mach_notify.h" |
10 | |
11 | /* TODO: #include <mach/mach.h> */ |
12 | #ifdef __cplusplus |
13 | extern "C" { |
14 | #endif /* __cplusplus */ |
15 | extern void mach_msg_destroy(mach_msg_header_t *); |
16 | #ifdef __cplusplus |
17 | } |
18 | #endif /* __cplusplus */ |
19 | |
20 | #ifndef mig_internal |
21 | #define mig_internal static __inline__ |
22 | #endif /* mig_internal */ |
23 | |
24 | #ifndef mig_external |
25 | #define mig_external |
26 | #endif /* mig_external */ |
27 | |
28 | #if !defined(__MigTypeCheck) && defined(TypeCheck) |
29 | #define __MigTypeCheck TypeCheck /* Legacy setting */ |
30 | #endif /* !defined(__MigTypeCheck) */ |
31 | |
32 | #if !defined(__MigKernelSpecificCode) && defined(_MIG_KERNEL_SPECIFIC_CODE_) |
33 | #define __MigKernelSpecificCode _MIG_KERNEL_SPECIFIC_CODE_ /* Legacy setting */ |
34 | #endif /* !defined(__MigKernelSpecificCode) */ |
35 | |
36 | #ifndef LimitCheck |
37 | #define LimitCheck 0 |
38 | #endif /* LimitCheck */ |
39 | |
40 | #ifndef min |
41 | #define min(a,b) ( ((a) < (b))? (a): (b) ) |
42 | #endif /* min */ |
43 | |
44 | #if !defined(_WALIGN_) |
45 | #define _WALIGN_(x) (((x) + 3) & ~3) |
46 | #endif /* !defined(_WALIGN_) */ |
47 | |
48 | #if !defined(_WALIGNSZ_) |
49 | #define _WALIGNSZ_(x) _WALIGN_(sizeof(x)) |
50 | #endif /* !defined(_WALIGNSZ_) */ |
51 | |
52 | #ifndef UseStaticTemplates |
53 | #define UseStaticTemplates 0 |
54 | #endif /* UseStaticTemplates */ |
55 | |
56 | #ifndef MIG_SERVER_ROUTINE |
57 | #define MIG_SERVER_ROUTINE |
58 | #endif |
59 | |
60 | #ifndef __MachMsgErrorWithTimeout |
61 | #define __MachMsgErrorWithTimeout(_R_) { \ |
62 | switch (_R_) { \ |
63 | case MACH_SEND_INVALID_DATA: \ |
64 | case MACH_SEND_INVALID_DEST: \ |
65 | case MACH_SEND_INVALID_HEADER: \ |
66 | mig_put_reply_port(InP->Head.msgh_reply_port); \ |
67 | break; \ |
68 | case MACH_SEND_TIMED_OUT: \ |
69 | case MACH_RCV_TIMED_OUT: \ |
70 | default: \ |
71 | mig_dealloc_reply_port(InP->Head.msgh_reply_port); \ |
72 | } \ |
73 | } |
74 | #endif /* __MachMsgErrorWithTimeout */ |
75 | |
76 | #ifndef __MachMsgErrorWithoutTimeout |
77 | #define __MachMsgErrorWithoutTimeout(_R_) { \ |
78 | switch (_R_) { \ |
79 | case MACH_SEND_INVALID_DATA: \ |
80 | case MACH_SEND_INVALID_DEST: \ |
81 | case MACH_SEND_INVALID_HEADER: \ |
82 | mig_put_reply_port(InP->Head.msgh_reply_port); \ |
83 | break; \ |
84 | default: \ |
85 | mig_dealloc_reply_port(InP->Head.msgh_reply_port); \ |
86 | } \ |
87 | } |
88 | #endif /* __MachMsgErrorWithoutTimeout */ |
89 | |
90 | #ifndef __DeclareSendRpc |
91 | #define __DeclareSendRpc(_NUM_, _NAME_) |
92 | #endif /* __DeclareSendRpc */ |
93 | |
94 | #ifndef __BeforeSendRpc |
95 | #define __BeforeSendRpc(_NUM_, _NAME_) |
96 | #endif /* __BeforeSendRpc */ |
97 | |
98 | #ifndef __AfterSendRpc |
99 | #define __AfterSendRpc(_NUM_, _NAME_) |
100 | #endif /* __AfterSendRpc */ |
101 | |
102 | #ifndef __DeclareSendSimple |
103 | #define __DeclareSendSimple(_NUM_, _NAME_) |
104 | #endif /* __DeclareSendSimple */ |
105 | |
106 | #ifndef __BeforeSendSimple |
107 | #define __BeforeSendSimple(_NUM_, _NAME_) |
108 | #endif /* __BeforeSendSimple */ |
109 | |
110 | #ifndef __AfterSendSimple |
111 | #define __AfterSendSimple(_NUM_, _NAME_) |
112 | #endif /* __AfterSendSimple */ |
113 | |
114 | #define msgh_request_port msgh_remote_port |
115 | #define msgh_reply_port msgh_local_port |
116 | |
117 | |
118 | |
119 | /* SimpleRoutine mach_notify_port_deleted */ |
120 | mig_external kern_return_t mach_notify_port_deleted |
121 | ( |
122 | mach_port_t notify, |
123 | mach_port_name_t name |
124 | ) |
125 | { |
126 | |
127 | #ifdef __MigPackStructs |
128 | #pragma pack(push, 4) |
129 | #endif |
130 | typedef struct { |
131 | mach_msg_header_t Head; |
132 | NDR_record_t NDR; |
133 | mach_port_name_t name; |
134 | } Request __attribute__((unused)); |
135 | #ifdef __MigPackStructs |
136 | #pragma pack(pop) |
137 | #endif |
138 | /* |
139 | * typedef struct { |
140 | * mach_msg_header_t Head; |
141 | * NDR_record_t NDR; |
142 | * kern_return_t RetCode; |
143 | * } mig_reply_error_t; |
144 | */ |
145 | |
146 | union { |
147 | Request In; |
148 | } Mess; |
149 | |
150 | Request *InP = &Mess.In; |
151 | |
152 | mach_msg_return_t msg_result; |
153 | |
154 | #ifdef __MIG_check__Reply__mach_notify_port_deleted_t__defined |
155 | kern_return_t check_result; |
156 | #endif /* __MIG_check__Reply__mach_notify_port_deleted_t__defined */ |
157 | |
158 | __DeclareSendSimple(65, "mach_notify_port_deleted" ) |
159 | |
160 | InP->NDR = NDR_record; |
161 | |
162 | InP->name = name; |
163 | |
164 | InP->Head.msgh_reply_port = MACH_PORT_NULL; |
165 | InP->Head.msgh_bits = |
166 | MACH_MSGH_BITS(18, 0); |
167 | /* msgh_size passed as argument */ |
168 | InP->Head.msgh_request_port = notify; |
169 | InP->Head.msgh_id = 65; |
170 | InP->Head.msgh_reserved = 0; |
171 | |
172 | __BeforeSendSimple(65, "mach_notify_port_deleted" ) |
173 | #if __MigKernelSpecificCode |
174 | msg_result = mach_msg_send_from_kernel(msg: &InP->Head, send_size: (mach_msg_size_t)sizeof(Request)); |
175 | #else |
176 | msg_result = mach_msg(&InP->Head, MACH_SEND_MSG|MACH_MSG_OPTION_NONE, (mach_msg_size_t)sizeof(Request), 0, MACH_PORT_NULL, MACH_MSG_TIMEOUT_NONE, MACH_PORT_NULL); |
177 | #endif /* __MigKernelSpecificCode */ |
178 | __AfterSendSimple(65, "mach_notify_port_deleted" ) |
179 | return msg_result; |
180 | } |
181 | |
182 | /* SimpleRoutine mach_notify_send_possible */ |
183 | mig_external kern_return_t mach_notify_send_possible |
184 | ( |
185 | mach_port_t notify, |
186 | mach_port_name_t name |
187 | ) |
188 | { |
189 | |
190 | #ifdef __MigPackStructs |
191 | #pragma pack(push, 4) |
192 | #endif |
193 | typedef struct { |
194 | mach_msg_header_t Head; |
195 | NDR_record_t NDR; |
196 | mach_port_name_t name; |
197 | } Request __attribute__((unused)); |
198 | #ifdef __MigPackStructs |
199 | #pragma pack(pop) |
200 | #endif |
201 | /* |
202 | * typedef struct { |
203 | * mach_msg_header_t Head; |
204 | * NDR_record_t NDR; |
205 | * kern_return_t RetCode; |
206 | * } mig_reply_error_t; |
207 | */ |
208 | |
209 | union { |
210 | Request In; |
211 | } Mess; |
212 | |
213 | Request *InP = &Mess.In; |
214 | |
215 | mach_msg_return_t msg_result; |
216 | |
217 | #ifdef __MIG_check__Reply__mach_notify_send_possible_t__defined |
218 | kern_return_t check_result; |
219 | #endif /* __MIG_check__Reply__mach_notify_send_possible_t__defined */ |
220 | |
221 | __DeclareSendSimple(66, "mach_notify_send_possible" ) |
222 | |
223 | InP->NDR = NDR_record; |
224 | |
225 | InP->name = name; |
226 | |
227 | InP->Head.msgh_reply_port = MACH_PORT_NULL; |
228 | InP->Head.msgh_bits = |
229 | MACH_MSGH_BITS(18, 0); |
230 | /* msgh_size passed as argument */ |
231 | InP->Head.msgh_request_port = notify; |
232 | InP->Head.msgh_id = 66; |
233 | InP->Head.msgh_reserved = 0; |
234 | |
235 | __BeforeSendSimple(66, "mach_notify_send_possible" ) |
236 | #if __MigKernelSpecificCode |
237 | msg_result = mach_msg_send_from_kernel(msg: &InP->Head, send_size: (mach_msg_size_t)sizeof(Request)); |
238 | #else |
239 | msg_result = mach_msg(&InP->Head, MACH_SEND_MSG|MACH_MSG_OPTION_NONE, (mach_msg_size_t)sizeof(Request), 0, MACH_PORT_NULL, MACH_MSG_TIMEOUT_NONE, MACH_PORT_NULL); |
240 | #endif /* __MigKernelSpecificCode */ |
241 | __AfterSendSimple(66, "mach_notify_send_possible" ) |
242 | return msg_result; |
243 | } |
244 | |
245 | /* SimpleRoutine mach_notify_port_destroyed */ |
246 | mig_external kern_return_t mach_notify_port_destroyed |
247 | ( |
248 | mach_port_t notify, |
249 | mach_port_t rights |
250 | ) |
251 | { |
252 | |
253 | #ifdef __MigPackStructs |
254 | #pragma pack(push, 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 rights; |
261 | /* end of the kernel processed data */ |
262 | } Request __attribute__((unused)); |
263 | #ifdef __MigPackStructs |
264 | #pragma pack(pop) |
265 | #endif |
266 | /* |
267 | * typedef struct { |
268 | * mach_msg_header_t Head; |
269 | * NDR_record_t NDR; |
270 | * kern_return_t RetCode; |
271 | * } mig_reply_error_t; |
272 | */ |
273 | |
274 | union { |
275 | Request In; |
276 | } Mess; |
277 | |
278 | Request *InP = &Mess.In; |
279 | |
280 | mach_msg_return_t msg_result; |
281 | |
282 | #ifdef __MIG_check__Reply__mach_notify_port_destroyed_t__defined |
283 | kern_return_t check_result; |
284 | #endif /* __MIG_check__Reply__mach_notify_port_destroyed_t__defined */ |
285 | |
286 | __DeclareSendSimple(69, "mach_notify_port_destroyed" ) |
287 | |
288 | #if UseStaticTemplates |
289 | const static mach_msg_port_descriptor_t rightsTemplate = { |
290 | /* name = */ MACH_PORT_NULL, |
291 | /* pad1 = */ 0, |
292 | /* pad2 = */ 0, |
293 | /* disp = */ 16, |
294 | /* type = */ MACH_MSG_PORT_DESCRIPTOR, |
295 | }; |
296 | #endif /* UseStaticTemplates */ |
297 | |
298 | InP->msgh_body.msgh_descriptor_count = 1; |
299 | #if UseStaticTemplates |
300 | InP->rights = rightsTemplate; |
301 | InP->rights.name = rights; |
302 | #else /* UseStaticTemplates */ |
303 | InP->rights.name = rights; |
304 | InP->rights.disposition = 16; |
305 | InP->rights.type = MACH_MSG_PORT_DESCRIPTOR; |
306 | #endif /* UseStaticTemplates */ |
307 | |
308 | InP->Head.msgh_reply_port = MACH_PORT_NULL; |
309 | InP->Head.msgh_bits = MACH_MSGH_BITS_COMPLEX| |
310 | MACH_MSGH_BITS(18, 0); |
311 | /* msgh_size passed as argument */ |
312 | InP->Head.msgh_request_port = notify; |
313 | InP->Head.msgh_id = 69; |
314 | InP->Head.msgh_reserved = 0; |
315 | |
316 | __BeforeSendSimple(69, "mach_notify_port_destroyed" ) |
317 | #if __MigKernelSpecificCode |
318 | msg_result = mach_msg_send_from_kernel(msg: &InP->Head, send_size: (mach_msg_size_t)sizeof(Request)); |
319 | #else |
320 | msg_result = mach_msg(&InP->Head, MACH_SEND_MSG|MACH_MSG_OPTION_NONE, (mach_msg_size_t)sizeof(Request), 0, MACH_PORT_NULL, MACH_MSG_TIMEOUT_NONE, MACH_PORT_NULL); |
321 | #endif /* __MigKernelSpecificCode */ |
322 | __AfterSendSimple(69, "mach_notify_port_destroyed" ) |
323 | return msg_result; |
324 | } |
325 | |
326 | /* SimpleRoutine mach_notify_no_senders */ |
327 | mig_external kern_return_t mach_notify_no_senders |
328 | ( |
329 | mach_port_t notify, |
330 | mach_port_mscount_t mscount |
331 | ) |
332 | { |
333 | |
334 | #ifdef __MigPackStructs |
335 | #pragma pack(push, 4) |
336 | #endif |
337 | typedef struct { |
338 | mach_msg_header_t Head; |
339 | NDR_record_t NDR; |
340 | mach_port_mscount_t mscount; |
341 | } Request __attribute__((unused)); |
342 | #ifdef __MigPackStructs |
343 | #pragma pack(pop) |
344 | #endif |
345 | /* |
346 | * typedef struct { |
347 | * mach_msg_header_t Head; |
348 | * NDR_record_t NDR; |
349 | * kern_return_t RetCode; |
350 | * } mig_reply_error_t; |
351 | */ |
352 | |
353 | union { |
354 | Request In; |
355 | } Mess; |
356 | |
357 | Request *InP = &Mess.In; |
358 | |
359 | mach_msg_return_t msg_result; |
360 | |
361 | #ifdef __MIG_check__Reply__mach_notify_no_senders_t__defined |
362 | kern_return_t check_result; |
363 | #endif /* __MIG_check__Reply__mach_notify_no_senders_t__defined */ |
364 | |
365 | __DeclareSendSimple(70, "mach_notify_no_senders" ) |
366 | |
367 | InP->NDR = NDR_record; |
368 | |
369 | InP->mscount = mscount; |
370 | |
371 | InP->Head.msgh_reply_port = MACH_PORT_NULL; |
372 | InP->Head.msgh_bits = |
373 | MACH_MSGH_BITS(18, 0); |
374 | /* msgh_size passed as argument */ |
375 | InP->Head.msgh_request_port = notify; |
376 | InP->Head.msgh_id = 70; |
377 | InP->Head.msgh_reserved = 0; |
378 | |
379 | __BeforeSendSimple(70, "mach_notify_no_senders" ) |
380 | #if __MigKernelSpecificCode |
381 | msg_result = mach_msg_send_from_kernel(msg: &InP->Head, send_size: (mach_msg_size_t)sizeof(Request)); |
382 | #else |
383 | msg_result = mach_msg(&InP->Head, MACH_SEND_MSG|MACH_MSG_OPTION_NONE, (mach_msg_size_t)sizeof(Request), 0, MACH_PORT_NULL, MACH_MSG_TIMEOUT_NONE, MACH_PORT_NULL); |
384 | #endif /* __MigKernelSpecificCode */ |
385 | __AfterSendSimple(70, "mach_notify_no_senders" ) |
386 | return msg_result; |
387 | } |
388 | |
389 | /* SimpleRoutine mach_notify_send_once */ |
390 | mig_external kern_return_t mach_notify_send_once |
391 | ( |
392 | mach_port_t notify |
393 | ) |
394 | { |
395 | |
396 | #ifdef __MigPackStructs |
397 | #pragma pack(push, 4) |
398 | #endif |
399 | typedef struct { |
400 | mach_msg_header_t Head; |
401 | } Request __attribute__((unused)); |
402 | #ifdef __MigPackStructs |
403 | #pragma pack(pop) |
404 | #endif |
405 | /* |
406 | * typedef struct { |
407 | * mach_msg_header_t Head; |
408 | * NDR_record_t NDR; |
409 | * kern_return_t RetCode; |
410 | * } mig_reply_error_t; |
411 | */ |
412 | |
413 | union { |
414 | Request In; |
415 | } Mess; |
416 | |
417 | Request *InP = &Mess.In; |
418 | |
419 | mach_msg_return_t msg_result; |
420 | |
421 | #ifdef __MIG_check__Reply__mach_notify_send_once_t__defined |
422 | kern_return_t check_result; |
423 | #endif /* __MIG_check__Reply__mach_notify_send_once_t__defined */ |
424 | |
425 | __DeclareSendSimple(71, "mach_notify_send_once" ) |
426 | |
427 | InP->Head.msgh_reply_port = MACH_PORT_NULL; |
428 | InP->Head.msgh_bits = |
429 | MACH_MSGH_BITS(18, 0); |
430 | /* msgh_size passed as argument */ |
431 | InP->Head.msgh_request_port = notify; |
432 | InP->Head.msgh_id = 71; |
433 | InP->Head.msgh_reserved = 0; |
434 | |
435 | __BeforeSendSimple(71, "mach_notify_send_once" ) |
436 | #if __MigKernelSpecificCode |
437 | msg_result = mach_msg_send_from_kernel(msg: &InP->Head, send_size: (mach_msg_size_t)sizeof(Request)); |
438 | #else |
439 | msg_result = mach_msg(&InP->Head, MACH_SEND_MSG|MACH_MSG_OPTION_NONE, (mach_msg_size_t)sizeof(Request), 0, MACH_PORT_NULL, MACH_MSG_TIMEOUT_NONE, MACH_PORT_NULL); |
440 | #endif /* __MigKernelSpecificCode */ |
441 | __AfterSendSimple(71, "mach_notify_send_once" ) |
442 | return msg_result; |
443 | } |
444 | |
445 | /* SimpleRoutine mach_notify_dead_name */ |
446 | mig_external kern_return_t mach_notify_dead_name |
447 | ( |
448 | mach_port_t notify, |
449 | mach_port_name_t name |
450 | ) |
451 | { |
452 | |
453 | #ifdef __MigPackStructs |
454 | #pragma pack(push, 4) |
455 | #endif |
456 | typedef struct { |
457 | mach_msg_header_t Head; |
458 | NDR_record_t NDR; |
459 | mach_port_name_t name; |
460 | } Request __attribute__((unused)); |
461 | #ifdef __MigPackStructs |
462 | #pragma pack(pop) |
463 | #endif |
464 | /* |
465 | * typedef struct { |
466 | * mach_msg_header_t Head; |
467 | * NDR_record_t NDR; |
468 | * kern_return_t RetCode; |
469 | * } mig_reply_error_t; |
470 | */ |
471 | |
472 | union { |
473 | Request In; |
474 | } Mess; |
475 | |
476 | Request *InP = &Mess.In; |
477 | |
478 | mach_msg_return_t msg_result; |
479 | |
480 | #ifdef __MIG_check__Reply__mach_notify_dead_name_t__defined |
481 | kern_return_t check_result; |
482 | #endif /* __MIG_check__Reply__mach_notify_dead_name_t__defined */ |
483 | |
484 | __DeclareSendSimple(72, "mach_notify_dead_name" ) |
485 | |
486 | InP->NDR = NDR_record; |
487 | |
488 | InP->name = name; |
489 | |
490 | InP->Head.msgh_reply_port = MACH_PORT_NULL; |
491 | InP->Head.msgh_bits = |
492 | MACH_MSGH_BITS(18, 0); |
493 | /* msgh_size passed as argument */ |
494 | InP->Head.msgh_request_port = notify; |
495 | InP->Head.msgh_id = 72; |
496 | InP->Head.msgh_reserved = 0; |
497 | |
498 | __BeforeSendSimple(72, "mach_notify_dead_name" ) |
499 | #if __MigKernelSpecificCode |
500 | msg_result = mach_msg_send_from_kernel(msg: &InP->Head, send_size: (mach_msg_size_t)sizeof(Request)); |
501 | #else |
502 | msg_result = mach_msg(&InP->Head, MACH_SEND_MSG|MACH_MSG_OPTION_NONE, (mach_msg_size_t)sizeof(Request), 0, MACH_PORT_NULL, MACH_MSG_TIMEOUT_NONE, MACH_PORT_NULL); |
503 | #endif /* __MigKernelSpecificCode */ |
504 | __AfterSendSimple(72, "mach_notify_dead_name" ) |
505 | return msg_result; |
506 | } |
507 | |