2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
6 * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved.
8 * This file contains Original Code and/or Modifications of Original Code
9 * as defined in and that are subject to the Apple Public Source License
10 * Version 2.0 (the 'License'). You may not use this file except in
11 * compliance with the License. Please obtain a copy of the License at
12 * http://www.opensource.apple.com/apsl/ and read it before using this
15 * The Original Code and all software distributed under the License are
16 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
17 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
18 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
20 * Please see the License for the specific language governing rights and
21 * limitations under the License.
23 * @APPLE_LICENSE_HEADER_END@
33 #include <mach/message.h>
34 #include <sys/kdebug.h>
37 * Define the trace points for MIG-generated calls. One traces the input parameters
38 * to MIG called things, another traces the outputs, and one traces bad message IDs.
40 #ifdef _MIG_TRACE_PARAMETERS_
42 #define __BeforeRcvCallTrace(msgid,arg1,arg2,arg3,arg4) \
43 KERNEL_DEBUG_CONSTANT(KDBG_MIGCODE(msgid) | DBG_FUNC_START, \
44 (unsigned int)(arg1), \
45 (unsigned int)(arg2), \
46 (unsigned int)(arg3), \
47 (unsigned int)(arg4), \
50 #define __AfterRcvCallTrace(msgid,arg1,arg2,arg3,arg4) \
51 KERNEL_DEBUG_CONSTANT(KDBG_MIGCODE(msgid) | DBG_FUNC_END, \
52 (unsigned int)(arg1), \
53 (unsigned int)(arg2), \
54 (unsigned int)(arg3), \
55 (unsigned int)(arg4), \
58 #define __BeforeSimpleCallTrace(msgid,arg1,arg2,arg3,arg4) \
59 KERNEL_DEBUG_CONSTANT(KDBG_MIGCODE(msgid) | DBG_FUNC_START, \
60 (unsigned int)(arg1), \
61 (unsigned int)(arg2), \
62 (unsigned int)(arg3), \
63 (unsigned int)(arg4), \
66 #define __AfterSimpleCallTrace(msgid,arg1,arg2,arg3,arg4) \
67 KERNEL_DEBUG_CONSTANT(KDBG_MIGCODE(msgid) | DBG_FUNC_END, \
68 (unsigned int)(arg1), \
69 (unsigned int)(arg2), \
70 (unsigned int)(arg3), \
71 (unsigned int)(arg4), \
74 #else /* !_MIG_TRACE_PARAMETERS_ */
76 #define __BeforeRcvRpc(msgid, _NAME_) \
77 KERNEL_DEBUG_CONSTANT(KDBG_MIGCODE(msgid) | DBG_FUNC_START, \
84 #define __AfterRcvRpc(msgid, _NAME_) \
85 KERNEL_DEBUG_CONSTANT(KDBG_MIGCODE(msgid) | DBG_FUNC_END, \
93 #define __BeforeRcvSimple(msgid, _NAME_) \
94 KERNEL_DEBUG_CONSTANT(KDBG_MIGCODE(msgid) | DBG_FUNC_START, \
101 #define __AfterRcvSimple(msgid, _NAME_) \
102 KERNEL_DEBUG_CONSTANT(KDBG_MIGCODE(msgid) | DBG_FUNC_END, \
109 #endif /* !_MIG_TRACE_PARAMETERS_ */
111 #define _MIG_MSGID_INVALID(msgid) \
112 KERNEL_DEBUG_CONSTANT(MACHDBG_CODE(DBG_MACH_MSGID_INVALID, (msgid)), \
119 /* Send a message from the kernel */
120 extern mach_msg_return_t
mach_msg_send_from_kernel(
121 mach_msg_header_t
*msg
,
122 mach_msg_size_t send_size
);
125 extern mach_msg_return_t
mach_msg_rpc_from_kernel(
126 mach_msg_header_t
*msg
,
127 mach_msg_size_t send_size
,
128 mach_msg_size_t rcv_size
);
130 extern void mach_msg_receive_continue(void);
132 #include <sys/appleapiopts.h>
134 #ifdef __APPLE_API_EVOLVING
136 * Kernel implementation of the MIG object base class
138 * Conforms to the MIGObjectInterface defined in <mach/mig.h>
139 * Ports are automatically allocated for the duration of outstanding
140 * cross-task references and then released.
143 typedef struct mig_object
{
144 IMIGObjectVtbl
*pVtbl
; /* our interface def */
145 mach_port_t port
; /* our port pointer */
150 * MIG notify base class definition
151 * These are chained off the mig object to which the are registered.
152 * When that object triggers a notification delivery, we walk this
153 * chain and deliver the appropriate notification.
155 typedef struct mig_notify_object
{
156 IMIGNotifyObjectVtbl
*pVtbl
; /* our interface def */
157 mach_port_t port
; /* our port pointer */
158 } mig_notify_object_data_t
;
160 #endif /* __APPLE_API_EVOLVING */
162 #endif /* _IPC_MIG_H_ */