2 * Copyright (c) 2000-2001 Apple Computer, Inc. All Rights Reserved.
4 * The contents of this file constitute Original Code as defined in and are
5 * subject to the Apple Public Source License Version 1.2 (the 'License').
6 * You may not use this file except in compliance with the License. Please obtain
7 * a copy of the License at http://www.apple.com/publicsource and read it before
10 * This Original Code and all software distributed under the License are
11 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS
12 * OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, INCLUDING WITHOUT
13 * LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
14 * PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. Please see the License for the
15 * specific language governing rights and limitations under the License.
21 * stub generated Wed Mar 29 13:49:14 2000
22 * with a MiG generated Sat Feb 5 17:40:06 PST 2000 by root@salzburg
24 * NOTE: This file was originally generated by MIG, but has since been hand-massaged
25 * to the point where re-generating it is not advised.
32 #include <mach/boolean.h>
33 #include <mach/kern_return.h>
34 #include <mach/notify.h>
35 #include <mach/mach_types.h>
36 #include <mach/message.h>
37 #include <mach/mig_errors.h>
38 #include <mach/port.h>
40 #include <mach/std_types.h>
43 #define mig_internal static
44 #endif /* mig_internal */
48 #endif /* mig_external */
52 #endif /* TypeCheck */
56 #endif /* LimitCheck */
59 #define min(a,b) ( ((a) < (b))? (a): (b) )
62 #ifndef UseStaticTemplates
63 #define UseStaticTemplates 1
64 #endif /* UseStaticTemplates */
66 #define _WALIGN_(x) (((x) + 3) & ~3)
67 #define _WALIGNSZ_(x) _WALIGN_(sizeof(x))
68 #ifndef __DeclareRcvRpc
69 #define __DeclareRcvRpc(_NUM_, _NAME_)
70 #endif /* __DeclareRcvRpc */
72 #ifndef __BeforeRcvRpc
73 #define __BeforeRcvRpc(_NUM_, _NAME_)
74 #endif /* __BeforeRcvRpc */
77 #define __AfterRcvRpc(_NUM_, _NAME_)
78 #endif /* __AfterRcvRpc */
80 #ifndef __DeclareRcvSimple
81 #define __DeclareRcvSimple(_NUM_, _NAME_)
82 #endif /* __DeclareRcvSimple */
84 #ifndef __BeforeRcvSimple
85 #define __BeforeRcvSimple(_NUM_, _NAME_)
86 #endif /* __BeforeRcvSimple */
88 #ifndef __AfterRcvSimple
89 #define __AfterRcvSimple(_NUM_, _NAME_)
90 #endif /* __AfterRcvSimple */
94 #define msgh_request_port msgh_local_port
95 #define MACH_MSGH_BITS_REQUEST(bits) MACH_MSGH_BITS_LOCAL(bits)
96 #define msgh_reply_port msgh_remote_port
97 #define MACH_MSGH_BITS_REPLY(bits) MACH_MSGH_BITS_REMOTE(bits)
99 #define MIG_RETURN_ERROR(X, code) {\
100 ((mig_reply_error_t *)X)->RetCode = code;\
101 ((mig_reply_error_t *)X)->NDR = NDR_record;\
105 /* typedefs for all replies */
108 mach_msg_header_t Head
;
110 kern_return_t RetCode
;
111 } __Reply__mach_notify_port_deleted_t
;
114 mach_msg_header_t Head
;
116 kern_return_t RetCode
;
117 } __Reply__mach_notify_port_destroyed_t
;
120 mach_msg_header_t Head
;
122 kern_return_t RetCode
;
123 } __Reply__mach_notify_no_senders_t
;
126 mach_msg_header_t Head
;
128 kern_return_t RetCode
;
129 } __Reply__mach_notify_send_once_t
;
132 mach_msg_header_t Head
;
134 kern_return_t RetCode
;
135 } __Reply__mach_notify_dead_name_t
;
138 /* Forward Declarations */
141 mig_internal novalue _Xmach_notify_port_deleted
142 (mach_msg_header_t
*InHeadP
, mach_msg_header_t
*OutHeadP
);
144 mig_internal novalue _Xmach_notify_port_destroyed
145 (mach_msg_header_t
*InHeadP
, mach_msg_header_t
*OutHeadP
);
147 mig_internal novalue _Xmach_notify_no_senders
148 (mach_msg_header_t
*InHeadP
, mach_msg_header_t
*OutHeadP
);
150 mig_internal novalue _Xmach_notify_send_once
151 (mach_msg_header_t
*InHeadP
, mach_msg_header_t
*OutHeadP
);
153 mig_internal novalue _Xmach_notify_dead_name
154 (mach_msg_header_t
*InHeadP
, mach_msg_header_t
*OutHeadP
);
157 /* SimpleRoutine mach_notify_port_deleted */
162 #endif /* mig_external */
163 kern_return_t cdsa_mach_notify_port_deleted
166 mach_port_name_t name
169 /* SimpleRoutine mach_notify_port_deleted */
170 mig_internal novalue _Xmach_notify_port_deleted
171 (mach_msg_header_t
*InHeadP
, mach_msg_header_t
*OutHeadP
)
174 mach_msg_header_t Head
;
176 mach_port_name_t name
;
177 mach_msg_trailer_t trailer
;
180 typedef __Reply__mach_notify_port_deleted_t Reply
;
182 mach_msg_header_t Head
;
184 mach_port_name_t name
;
189 * mach_msg_header_t Head;
191 * kern_return_t RetCode;
192 * } mig_reply_error_t;
195 register Request
*In0P
= (Request
*) InHeadP
;
196 register Reply
*OutP
= (Reply
*) OutHeadP
;
197 __DeclareRcvSimple(65, "mach_notify_port_deleted")
198 __BeforeRcvSimple(65, "mach_notify_port_deleted")
200 if ((In0P
->Head
.msgh_bits
& MACH_MSGH_BITS_COMPLEX
) ||
201 (In0P
->Head
.msgh_size
!= sizeof(__Request
)))
202 { MIG_RETURN_ERROR(OutP
, MIG_BAD_ARGUMENTS
); }
203 #endif /* TypeCheck */
205 OutP
->RetCode
= cdsa_mach_notify_port_deleted(In0P
->Head
.msgh_request_port
, In0P
->name
);
206 __AfterRcvSimple(65, "mach_notify_port_deleted")
209 /* SimpleRoutine mach_notify_port_destroyed */
214 #endif /* mig_external */
215 kern_return_t cdsa_mach_notify_port_destroyed
221 /* SimpleRoutine mach_notify_port_destroyed */
222 mig_internal novalue _Xmach_notify_port_destroyed
223 (mach_msg_header_t
*InHeadP
, mach_msg_header_t
*OutHeadP
)
226 mach_msg_header_t Head
;
227 /* start of the kernel processed data */
228 mach_msg_body_t msgh_body
;
229 mach_msg_port_descriptor_t rights
;
230 /* end of the kernel processed data */
231 mach_msg_trailer_t trailer
;
234 typedef __Reply__mach_notify_port_destroyed_t Reply
;
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 */
245 * mach_msg_header_t Head;
247 * kern_return_t RetCode;
248 * } mig_reply_error_t;
251 register Request
*In0P
= (Request
*) InHeadP
;
252 register Reply
*OutP
= (Reply
*) OutHeadP
;
253 __DeclareRcvSimple(69, "mach_notify_port_destroyed")
254 __BeforeRcvSimple(69, "mach_notify_port_destroyed")
256 if (!(In0P
->Head
.msgh_bits
& MACH_MSGH_BITS_COMPLEX
) ||
257 (In0P
->msgh_body
.msgh_descriptor_count
!= 1) ||
258 (In0P
->Head
.msgh_size
!= sizeof(__Request
)))
259 { MIG_RETURN_ERROR(OutP
, MIG_BAD_ARGUMENTS
); }
260 #endif /* TypeCheck */
263 if (In0P
->rights
.type
!= MACH_MSG_PORT_DESCRIPTOR
||
264 In0P
->rights
.disposition
!= MACH_MSG_TYPE_MOVE_RECEIVE
)
265 { MIG_RETURN_ERROR(OutP
, MIG_TYPE_ERROR
); }
266 #endif /* TypeCheck */
268 OutP
->RetCode
= cdsa_mach_notify_port_destroyed(In0P
->Head
.msgh_request_port
, In0P
->rights
.name
);
269 __AfterRcvSimple(69, "mach_notify_port_destroyed")
272 /* SimpleRoutine mach_notify_no_senders */
277 #endif /* mig_external */
278 kern_return_t cdsa_mach_notify_no_senders
281 mach_port_mscount_t mscount
284 /* SimpleRoutine mach_notify_no_senders */
285 mig_internal novalue _Xmach_notify_no_senders
286 (mach_msg_header_t
*InHeadP
, mach_msg_header_t
*OutHeadP
)
289 mach_msg_header_t Head
;
291 mach_port_mscount_t mscount
;
292 mach_msg_trailer_t trailer
;
295 typedef __Reply__mach_notify_no_senders_t Reply
;
297 mach_msg_header_t Head
;
299 mach_port_mscount_t mscount
;
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 __Reply__mach_notify_send_once_t Reply
;
346 mach_msg_header_t Head
;
351 * mach_msg_header_t Head;
353 * kern_return_t RetCode;
354 * } mig_reply_error_t;
357 register Request
*In0P
= (Request
*) InHeadP
;
358 register Reply
*OutP
= (Reply
*) OutHeadP
;
359 __DeclareRcvSimple(71, "mach_notify_send_once")
360 __BeforeRcvSimple(71, "mach_notify_send_once")
362 if ((In0P
->Head
.msgh_bits
& MACH_MSGH_BITS_COMPLEX
) ||
363 (In0P
->Head
.msgh_size
!= sizeof(__Request
)))
364 { MIG_RETURN_ERROR(OutP
, MIG_BAD_ARGUMENTS
); }
365 #endif /* TypeCheck */
367 OutP
->RetCode
= cdsa_mach_notify_send_once(In0P
->Head
.msgh_request_port
);
368 __AfterRcvSimple(71, "mach_notify_send_once")
371 /* SimpleRoutine mach_notify_dead_name */
376 #endif /* mig_external */
377 kern_return_t cdsa_mach_notify_dead_name
380 mach_port_name_t name
383 /* SimpleRoutine mach_notify_dead_name */
384 mig_internal novalue _Xmach_notify_dead_name
385 (mach_msg_header_t
*InHeadP
, mach_msg_header_t
*OutHeadP
)
388 mach_msg_header_t Head
;
390 mach_port_name_t name
;
391 mach_msg_trailer_t trailer
;
394 typedef __Reply__mach_notify_dead_name_t Reply
;
396 mach_msg_header_t Head
;
398 mach_port_name_t name
;
403 * mach_msg_header_t Head;
405 * kern_return_t RetCode;
406 * } mig_reply_error_t;
409 register Request
*In0P
= (Request
*) InHeadP
;
410 register Reply
*OutP
= (Reply
*) OutHeadP
;
411 __DeclareRcvSimple(72, "mach_notify_dead_name")
412 __BeforeRcvSimple(72, "mach_notify_dead_name")
414 if ((In0P
->Head
.msgh_bits
& MACH_MSGH_BITS_COMPLEX
) ||
415 (In0P
->Head
.msgh_size
!= sizeof(__Request
)))
416 { MIG_RETURN_ERROR(OutP
, MIG_BAD_ARGUMENTS
); }
417 #endif /* TypeCheck */
419 OutP
->RetCode
= cdsa_mach_notify_dead_name(In0P
->Head
.msgh_request_port
, In0P
->name
);
420 __AfterRcvSimple(72, "mach_notify_dead_name")
423 /* union of all replies */
426 __Reply__mach_notify_port_deleted_t Reply_mach_notify_port_deleted
;
427 __Reply__mach_notify_port_destroyed_t Reply_mach_notify_port_destroyed
;
428 __Reply__mach_notify_no_senders_t Reply_mach_notify_no_senders
;
429 __Reply__mach_notify_send_once_t Reply_mach_notify_send_once
;
430 __Reply__mach_notify_dead_name_t Reply_mach_notify_dead_name
;
434 extern boolean_t
notify_server(
435 mach_msg_header_t
*InHeadP
,
436 mach_msg_header_t
*OutHeadP
);
438 extern mig_routine_t
notify_server_routine(
439 mach_msg_header_t
*InHeadP
);
442 /* Description of this subsystem, for use in direct RPC */
443 const struct cdsa_notify_subsystem
{
444 struct subsystem
* subsystem
; /* Reserved for system use */
445 mach_msg_id_t start
; /* Min routine number */
446 mach_msg_id_t end
; /* Max routine number + 1 */
447 unsigned int maxsize
; /* Max msg size */
448 vm_address_t base_addr
; /* Base ddress */
449 struct routine_descriptor
/*Array of routine descriptors */
451 struct routine_arg_descriptor
/*Array of arg descriptors */
453 } cdsa_notify_subsystem
= {
455 (struct routine_arg_descriptor *)&cdsa_notify_subsystem.arg_descriptor[n]
459 sizeof(union __ReplyUnion
),
460 (vm_address_t
)&cdsa_notify_subsystem
,
463 { (mig_impl_routine_t
) cdsa_mach_notify_port_deleted
,
464 (mig_stub_routine_t
) _Xmach_notify_port_deleted
, 2, 1, ARGDES(0), sizeof(__Reply__mach_notify_port_deleted_t
) },
468 { (mig_impl_routine_t
) cdsa_mach_notify_port_destroyed
,
469 (mig_stub_routine_t
) _Xmach_notify_port_destroyed
, 2, 2, ARGDES(1), sizeof(__Reply__mach_notify_port_destroyed_t
) },
470 { (mig_impl_routine_t
) cdsa_mach_notify_no_senders
,
471 (mig_stub_routine_t
) _Xmach_notify_no_senders
, 2, 1, ARGDES(3), sizeof(__Reply__mach_notify_no_senders_t
) },
472 { (mig_impl_routine_t
) cdsa_mach_notify_send_once
,
473 (mig_stub_routine_t
) _Xmach_notify_send_once
, 1, 1, ARGDES(4), sizeof(__Reply__mach_notify_send_once_t
) },
474 { (mig_impl_routine_t
) cdsa_mach_notify_dead_name
,
475 (mig_stub_routine_t
) _Xmach_notify_dead_name
, 2, 1, ARGDES(5), sizeof(__Reply__mach_notify_dead_name_t
) },
480 0 | MACH_RPC_PORT
| MACH_RPC_MOVE_SEND_ONCE
,
486 0 | MACH_RPC_PORT
| MACH_RPC_MOVE_SEND_ONCE
,
492 0 | MACH_RPC_PORT
| MACH_RPC_IN
,
498 0 | MACH_RPC_PORT
| MACH_RPC_MOVE_SEND_ONCE
,
504 0 | MACH_RPC_PORT
| MACH_RPC_MOVE_SEND_ONCE
,
510 0 | MACH_RPC_PORT
| MACH_RPC_MOVE_SEND_ONCE
,
519 mig_external boolean_t cdsa_notify_server
520 (mach_msg_header_t
*InHeadP
, mach_msg_header_t
*OutHeadP
)
524 * mach_msg_header_t Head;
526 * kern_return_t RetCode;
527 * } mig_reply_error_t;
530 register mig_routine_t routine
;
532 OutHeadP
->msgh_bits
= MACH_MSGH_BITS(MACH_MSGH_BITS_REPLY(InHeadP
->msgh_bits
), 0);
533 OutHeadP
->msgh_remote_port
= InHeadP
->msgh_reply_port
;
534 /* Minimal size: routine() will update it if different */
535 OutHeadP
->msgh_size
= sizeof(mig_reply_error_t
);
536 OutHeadP
->msgh_local_port
= MACH_PORT_NULL
;
537 OutHeadP
->msgh_id
= InHeadP
->msgh_id
+ 100;
539 if ((InHeadP
->msgh_id
> 72) || (InHeadP
->msgh_id
< 64) ||
540 ((routine
= cdsa_notify_subsystem
.routine
[InHeadP
->msgh_id
- 64].stub_routine
) == 0)) {
541 ((mig_reply_error_t
*)OutHeadP
)->NDR
= NDR_record
;
542 ((mig_reply_error_t
*)OutHeadP
)->RetCode
= MIG_BAD_ID
;
545 (*routine
) (InHeadP
, OutHeadP
);
549 mig_external mig_routine_t cdsa_notify_server_routine
550 (mach_msg_header_t
*InHeadP
)
552 register int msgh_id
;
554 msgh_id
= InHeadP
->msgh_id
- 64;
556 if ((msgh_id
> 8) || (msgh_id
< 0))
559 return cdsa_notify_subsystem
.routine
[msgh_id
].stub_routine
;