3 * stub generated Fri Mar 1 18:02:22 2002
4 * with a MiG generated Thu Feb 21 15:16:47 PST 2002 by root@blur
12 #include <mach/boolean.h>
13 #include <mach/kern_return.h>
14 #include <mach/notify.h>
15 #include <mach/mach_types.h>
16 #include <mach/message.h>
17 #include <mach/mig_errors.h>
18 #include <mach/port.h>
20 #include <mach/std_types.h>
24 #define mig_internal static
25 #endif /* mig_internal */
29 #endif /* mig_external */
33 #endif /* TypeCheck */
37 #endif /* LimitCheck */
40 #define min(a,b) ( ((a) < (b))? (a): (b) )
43 #ifndef UseStaticTemplates
44 #define UseStaticTemplates 1
45 #endif /* UseStaticTemplates */
47 #define _WALIGN_(x) (((x) + 3) & ~3)
48 #define _WALIGNSZ_(x) _WALIGN_(sizeof(x))
49 #ifndef __DeclareRcvRpc
50 #define __DeclareRcvRpc(_NUM_, _NAME_)
51 #endif /* __DeclareRcvRpc */
53 #ifndef __BeforeRcvRpc
54 #define __BeforeRcvRpc(_NUM_, _NAME_)
55 #endif /* __BeforeRcvRpc */
58 #define __AfterRcvRpc(_NUM_, _NAME_)
59 #endif /* __AfterRcvRpc */
61 #ifndef __DeclareRcvSimple
62 #define __DeclareRcvSimple(_NUM_, _NAME_)
63 #endif /* __DeclareRcvSimple */
65 #ifndef __BeforeRcvSimple
66 #define __BeforeRcvSimple(_NUM_, _NAME_)
67 #endif /* __BeforeRcvSimple */
69 #ifndef __AfterRcvSimple
70 #define __AfterRcvSimple(_NUM_, _NAME_)
71 #endif /* __AfterRcvSimple */
75 #define msgh_request_port msgh_local_port
76 #define MACH_MSGH_BITS_REQUEST(bits) MACH_MSGH_BITS_LOCAL(bits)
77 #define msgh_reply_port msgh_remote_port
78 #define MACH_MSGH_BITS_REPLY(bits) MACH_MSGH_BITS_REMOTE(bits)
80 #define MIG_RETURN_ERROR(X, code) {\
81 ((mig_reply_error_t *)X)->RetCode = code;\
82 ((mig_reply_error_t *)X)->NDR = NDR_record;\
86 /* typedefs for all requests */
89 mach_msg_header_t Head
;
91 mach_port_name_t name
;
92 } __Request__mach_notify_port_deleted_t
;
95 mach_msg_header_t Head
;
96 /* start of the kernel processed data */
97 mach_msg_body_t msgh_body
;
98 mach_msg_port_descriptor_t rights
;
99 /* end of the kernel processed data */
100 } __Request__mach_notify_port_destroyed_t
;
103 mach_msg_header_t Head
;
105 mach_port_mscount_t mscount
;
106 } __Request__mach_notify_no_senders_t
;
109 mach_msg_header_t Head
;
110 } __Request__mach_notify_send_once_t
;
113 mach_msg_header_t Head
;
115 mach_port_name_t name
;
116 } __Request__mach_notify_dead_name_t
;
119 /* typedefs for all replies */
122 mach_msg_header_t Head
;
124 kern_return_t RetCode
;
125 } __Reply__mach_notify_port_deleted_t
;
128 mach_msg_header_t Head
;
130 kern_return_t RetCode
;
131 } __Reply__mach_notify_port_destroyed_t
;
134 mach_msg_header_t Head
;
136 kern_return_t RetCode
;
137 } __Reply__mach_notify_no_senders_t
;
140 mach_msg_header_t Head
;
142 kern_return_t RetCode
;
143 } __Reply__mach_notify_send_once_t
;
146 mach_msg_header_t Head
;
148 kern_return_t RetCode
;
149 } __Reply__mach_notify_dead_name_t
;
152 /* Forward Declarations */
155 mig_internal novalue _Xmach_notify_port_deleted
156 (mach_msg_header_t
*InHeadP
, mach_msg_header_t
*OutHeadP
);
158 mig_internal novalue _Xmach_notify_port_destroyed
159 (mach_msg_header_t
*InHeadP
, mach_msg_header_t
*OutHeadP
);
161 mig_internal novalue _Xmach_notify_no_senders
162 (mach_msg_header_t
*InHeadP
, mach_msg_header_t
*OutHeadP
);
164 mig_internal novalue _Xmach_notify_send_once
165 (mach_msg_header_t
*InHeadP
, mach_msg_header_t
*OutHeadP
);
167 mig_internal novalue _Xmach_notify_dead_name
168 (mach_msg_header_t
*InHeadP
, mach_msg_header_t
*OutHeadP
);
171 /* SimpleRoutine mach_notify_port_deleted */
176 #endif /* mig_external */
177 kern_return_t cdsa_mach_notify_port_deleted
180 mach_port_name_t name
183 /* SimpleRoutine mach_notify_port_deleted */
184 mig_internal novalue _Xmach_notify_port_deleted
185 (mach_msg_header_t
*InHeadP
, mach_msg_header_t
*OutHeadP
)
188 mach_msg_header_t Head
;
190 mach_port_name_t name
;
191 mach_msg_trailer_t trailer
;
194 typedef __Request__mach_notify_port_deleted_t __Request
;
196 typedef __Reply__mach_notify_port_deleted_t Reply
;
199 * mach_msg_header_t Head;
201 * kern_return_t RetCode;
202 * } mig_reply_error_t;
205 register Request
*In0P
= (Request
*) InHeadP
;
206 register Reply
*OutP
= (Reply
*) OutHeadP
;
207 __DeclareRcvSimple(65, "mach_notify_port_deleted")
208 __BeforeRcvSimple(65, "mach_notify_port_deleted")
210 if ((In0P
->Head
.msgh_bits
& MACH_MSGH_BITS_COMPLEX
) ||
211 (In0P
->Head
.msgh_size
!= sizeof(__Request
)))
212 { MIG_RETURN_ERROR(OutP
, MIG_BAD_ARGUMENTS
); }
213 #endif /* TypeCheck */
215 OutP
->RetCode
= cdsa_mach_notify_port_deleted(In0P
->Head
.msgh_request_port
, In0P
->name
);
216 __AfterRcvSimple(65, "mach_notify_port_deleted")
219 /* SimpleRoutine mach_notify_port_destroyed */
224 #endif /* mig_external */
225 kern_return_t cdsa_mach_notify_port_destroyed
231 /* SimpleRoutine mach_notify_port_destroyed */
232 mig_internal novalue _Xmach_notify_port_destroyed
233 (mach_msg_header_t
*InHeadP
, mach_msg_header_t
*OutHeadP
)
236 mach_msg_header_t Head
;
237 /* start of the kernel processed data */
238 mach_msg_body_t msgh_body
;
239 mach_msg_port_descriptor_t rights
;
240 /* end of the kernel processed data */
241 mach_msg_trailer_t trailer
;
244 typedef __Request__mach_notify_port_destroyed_t __Request
;
246 typedef __Reply__mach_notify_port_destroyed_t Reply
;
249 * mach_msg_header_t Head;
251 * kern_return_t RetCode;
252 * } mig_reply_error_t;
255 register Request
*In0P
= (Request
*) InHeadP
;
256 register Reply
*OutP
= (Reply
*) OutHeadP
;
257 __DeclareRcvSimple(69, "mach_notify_port_destroyed")
258 __BeforeRcvSimple(69, "mach_notify_port_destroyed")
260 if (!(In0P
->Head
.msgh_bits
& MACH_MSGH_BITS_COMPLEX
) ||
261 (In0P
->msgh_body
.msgh_descriptor_count
!= 1) ||
262 (In0P
->Head
.msgh_size
!= sizeof(__Request
)))
263 { MIG_RETURN_ERROR(OutP
, MIG_BAD_ARGUMENTS
); }
264 #endif /* TypeCheck */
267 if (In0P
->rights
.type
!= MACH_MSG_PORT_DESCRIPTOR
||
268 In0P
->rights
.disposition
!= MACH_MSG_TYPE_MOVE_RECEIVE
)
269 { MIG_RETURN_ERROR(OutP
, MIG_TYPE_ERROR
); }
270 #endif /* TypeCheck */
272 OutP
->RetCode
= cdsa_mach_notify_port_destroyed(In0P
->Head
.msgh_request_port
, In0P
->rights
.name
);
273 __AfterRcvSimple(69, "mach_notify_port_destroyed")
276 /* SimpleRoutine mach_notify_no_senders */
281 #endif /* mig_external */
282 kern_return_t cdsa_mach_notify_no_senders
285 mach_port_mscount_t mscount
288 /* SimpleRoutine mach_notify_no_senders */
289 mig_internal novalue _Xmach_notify_no_senders
290 (mach_msg_header_t
*InHeadP
, mach_msg_header_t
*OutHeadP
)
293 mach_msg_header_t Head
;
295 mach_port_mscount_t mscount
;
296 mach_msg_trailer_t trailer
;
299 typedef __Request__mach_notify_no_senders_t __Request
;
301 typedef __Reply__mach_notify_no_senders_t Reply
;
304 * mach_msg_header_t Head;
306 * kern_return_t RetCode;
307 * } mig_reply_error_t;
310 register Request
*In0P
= (Request
*) InHeadP
;
311 register Reply
*OutP
= (Reply
*) OutHeadP
;
312 __DeclareRcvSimple(70, "mach_notify_no_senders")
313 __BeforeRcvSimple(70, "mach_notify_no_senders")
315 if ((In0P
->Head
.msgh_bits
& MACH_MSGH_BITS_COMPLEX
) ||
316 (In0P
->Head
.msgh_size
!= sizeof(__Request
)))
317 { MIG_RETURN_ERROR(OutP
, MIG_BAD_ARGUMENTS
); }
318 #endif /* TypeCheck */
320 OutP
->RetCode
= cdsa_mach_notify_no_senders(In0P
->Head
.msgh_request_port
, In0P
->mscount
);
321 __AfterRcvSimple(70, "mach_notify_no_senders")
324 /* SimpleRoutine mach_notify_send_once */
329 #endif /* mig_external */
330 kern_return_t cdsa_mach_notify_send_once
335 /* SimpleRoutine mach_notify_send_once */
336 mig_internal novalue _Xmach_notify_send_once
337 (mach_msg_header_t
*InHeadP
, mach_msg_header_t
*OutHeadP
)
340 mach_msg_header_t Head
;
341 mach_msg_trailer_t trailer
;
344 typedef __Request__mach_notify_send_once_t __Request
;
346 typedef __Reply__mach_notify_send_once_t Reply
;
349 * mach_msg_header_t Head;
351 * kern_return_t RetCode;
352 * } mig_reply_error_t;
355 register Request
*In0P
= (Request
*) InHeadP
;
356 register Reply
*OutP
= (Reply
*) OutHeadP
;
357 __DeclareRcvSimple(71, "mach_notify_send_once")
358 __BeforeRcvSimple(71, "mach_notify_send_once")
360 if ((In0P
->Head
.msgh_bits
& MACH_MSGH_BITS_COMPLEX
) ||
361 (In0P
->Head
.msgh_size
!= sizeof(__Request
)))
362 { MIG_RETURN_ERROR(OutP
, MIG_BAD_ARGUMENTS
); }
363 #endif /* TypeCheck */
365 OutP
->RetCode
= cdsa_mach_notify_send_once(In0P
->Head
.msgh_request_port
);
366 __AfterRcvSimple(71, "mach_notify_send_once")
369 /* SimpleRoutine mach_notify_dead_name */
374 #endif /* mig_external */
375 kern_return_t cdsa_mach_notify_dead_name
378 mach_port_name_t name
381 /* SimpleRoutine mach_notify_dead_name */
382 mig_internal novalue _Xmach_notify_dead_name
383 (mach_msg_header_t
*InHeadP
, mach_msg_header_t
*OutHeadP
)
386 mach_msg_header_t Head
;
388 mach_port_name_t name
;
389 mach_msg_trailer_t trailer
;
392 typedef __Request__mach_notify_dead_name_t __Request
;
394 typedef __Reply__mach_notify_dead_name_t Reply
;
397 * mach_msg_header_t Head;
399 * kern_return_t RetCode;
400 * } mig_reply_error_t;
403 register Request
*In0P
= (Request
*) InHeadP
;
404 register Reply
*OutP
= (Reply
*) OutHeadP
;
405 __DeclareRcvSimple(72, "mach_notify_dead_name")
406 __BeforeRcvSimple(72, "mach_notify_dead_name")
408 if ((In0P
->Head
.msgh_bits
& MACH_MSGH_BITS_COMPLEX
) ||
409 (In0P
->Head
.msgh_size
!= sizeof(__Request
)))
410 { MIG_RETURN_ERROR(OutP
, MIG_BAD_ARGUMENTS
); }
411 #endif /* TypeCheck */
413 OutP
->RetCode
= cdsa_mach_notify_dead_name(In0P
->Head
.msgh_request_port
, In0P
->name
);
414 __AfterRcvSimple(72, "mach_notify_dead_name")
417 /* union of all requests */
419 union __RequestUnion__cdsa_notify_subsystem
{
420 __Request__mach_notify_port_deleted_t Request_mach_notify_port_deleted
;
421 __Request__mach_notify_port_destroyed_t Request_mach_notify_port_destroyed
;
422 __Request__mach_notify_no_senders_t Request_mach_notify_no_senders
;
423 __Request__mach_notify_send_once_t Request_mach_notify_send_once
;
424 __Request__mach_notify_dead_name_t Request_mach_notify_dead_name
;
427 /* union of all replies */
429 union __ReplyUnion__cdsa_notify_subsystem
{
430 __Reply__mach_notify_port_deleted_t Reply_mach_notify_port_deleted
;
431 __Reply__mach_notify_port_destroyed_t Reply_mach_notify_port_destroyed
;
432 __Reply__mach_notify_no_senders_t Reply_mach_notify_no_senders
;
433 __Reply__mach_notify_send_once_t Reply_mach_notify_send_once
;
434 __Reply__mach_notify_dead_name_t Reply_mach_notify_dead_name
;
438 extern boolean_t
cdsa_notify_server(
439 mach_msg_header_t
*InHeadP
,
440 mach_msg_header_t
*OutHeadP
);
442 extern mig_routine_t
notify_server_routine(
443 mach_msg_header_t
*InHeadP
);
446 /* Description of this subsystem, for use in direct RPC */
447 const struct cdsa_notify_subsystem
{
448 mig_server_routine_t server
; /* Server routine */
449 mach_msg_id_t start
; /* Min routine number */
450 mach_msg_id_t end
; /* Max routine number + 1 */
451 unsigned int maxsize
; /* Max msg size */
452 vm_address_t reserved
; /* Reserved */
453 struct routine_descriptor
/*Array of routine descriptors */
455 } cdsa_notify_subsystem
= {
456 notify_server_routine
,
459 sizeof(union __ReplyUnion__cdsa_notify_subsystem
),
463 { (mig_impl_routine_t
) 0,
464 (mig_stub_routine_t
) _Xmach_notify_port_deleted
, 2, 0, (routine_arg_descriptor_t
)0, sizeof(__Reply__mach_notify_port_deleted_t
)},
468 { (mig_impl_routine_t
) 0,
469 (mig_stub_routine_t
) _Xmach_notify_port_destroyed
, 2, 0, (routine_arg_descriptor_t
)0, sizeof(__Reply__mach_notify_port_destroyed_t
)},
470 { (mig_impl_routine_t
) 0,
471 (mig_stub_routine_t
) _Xmach_notify_no_senders
, 2, 0, (routine_arg_descriptor_t
)0, sizeof(__Reply__mach_notify_no_senders_t
)},
472 { (mig_impl_routine_t
) 0,
473 (mig_stub_routine_t
) _Xmach_notify_send_once
, 1, 0, (routine_arg_descriptor_t
)0, sizeof(__Reply__mach_notify_send_once_t
)},
474 { (mig_impl_routine_t
) 0,
475 (mig_stub_routine_t
) _Xmach_notify_dead_name
, 2, 0, (routine_arg_descriptor_t
)0, sizeof(__Reply__mach_notify_dead_name_t
)},
479 mig_external boolean_t cdsa_notify_server
480 (mach_msg_header_t
*InHeadP
, mach_msg_header_t
*OutHeadP
)
484 * mach_msg_header_t Head;
486 * kern_return_t RetCode;
487 * } mig_reply_error_t;
490 register mig_routine_t routine
;
492 OutHeadP
->msgh_bits
= MACH_MSGH_BITS(MACH_MSGH_BITS_REPLY(InHeadP
->msgh_bits
), 0);
493 OutHeadP
->msgh_remote_port
= InHeadP
->msgh_reply_port
;
494 /* Minimal size: routine() will update it if different */
495 OutHeadP
->msgh_size
= sizeof(mig_reply_error_t
);
496 OutHeadP
->msgh_local_port
= MACH_PORT_NULL
;
497 OutHeadP
->msgh_id
= InHeadP
->msgh_id
+ 100;
499 if ((InHeadP
->msgh_id
> 72) || (InHeadP
->msgh_id
< 64) ||
500 ((routine
= cdsa_notify_subsystem
.routine
[InHeadP
->msgh_id
- 64].stub_routine
) == 0)) {
501 ((mig_reply_error_t
*)OutHeadP
)->NDR
= NDR_record
;
502 ((mig_reply_error_t
*)OutHeadP
)->RetCode
= MIG_BAD_ID
;
505 (*routine
) (InHeadP
, OutHeadP
);
509 mig_external mig_routine_t notify_server_routine
510 (mach_msg_header_t
*InHeadP
)
512 register int msgh_id
;
514 msgh_id
= InHeadP
->msgh_id
- 64;
516 if ((msgh_id
> 8) || (msgh_id
< 0))
519 return cdsa_notify_subsystem
.routine
[msgh_id
].stub_routine
;