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