2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
6 * The contents of this file constitute Original Code as defined in and
7 * are subject to the Apple Public Source License Version 1.1 (the
8 * "License"). You may not use this file except in compliance with the
9 * License. Please obtain a copy of the License at
10 * http://www.apple.com/publicsource and read it before using this file.
12 * This Original Code and all software distributed under the License are
13 * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
14 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
15 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
17 * License for the specific language governing rights and limitations
20 * @APPLE_LICENSE_HEADER_END@
30 #include <mach/message.h>
31 #include <sys/kdebug.h>
34 * Define the trace points for MIG-generated calls. One traces the input parameters
35 * to MIG called things, another traces the outputs, and one traces bad message IDs.
37 #ifdef _MIG_TRACE_PARAMETERS_
39 #define __BeforeRcvCallTrace(msgid,arg1,arg2,arg3,arg4) \
40 KERNEL_DEBUG_CONSTANT(KDBG_MIGCODE(msgid) | DBG_FUNC_START, \
41 (unsigned int)(arg1), \
42 (unsigned int)(arg2), \
43 (unsigned int)(arg3), \
44 (unsigned int)(arg4), \
47 #define __AfterRcvCallTrace(msgid,arg1,arg2,arg3,arg4) \
48 KERNEL_DEBUG_CONSTANT(KDBG_MIGCODE(msgid) | DBG_FUNC_END, \
49 (unsigned int)(arg1), \
50 (unsigned int)(arg2), \
51 (unsigned int)(arg3), \
52 (unsigned int)(arg4), \
55 #define __BeforeSimpleCallTrace(msgid,arg1,arg2,arg3,arg4) \
56 KERNEL_DEBUG_CONSTANT(KDBG_MIGCODE(msgid) | DBG_FUNC_START, \
57 (unsigned int)(arg1), \
58 (unsigned int)(arg2), \
59 (unsigned int)(arg3), \
60 (unsigned int)(arg4), \
63 #define __AfterSimpleCallTrace(msgid,arg1,arg2,arg3,arg4) \
64 KERNEL_DEBUG_CONSTANT(KDBG_MIGCODE(msgid) | DBG_FUNC_END, \
65 (unsigned int)(arg1), \
66 (unsigned int)(arg2), \
67 (unsigned int)(arg3), \
68 (unsigned int)(arg4), \
71 #else /* !_MIG_TRACE_PARAMETERS_ */
73 #define __BeforeRcvRpc(msgid, _NAME_) \
74 KERNEL_DEBUG_CONSTANT(KDBG_MIGCODE(msgid) | DBG_FUNC_START, \
81 #define __AfterRcvRpc(msgid, _NAME_) \
82 KERNEL_DEBUG_CONSTANT(KDBG_MIGCODE(msgid) | DBG_FUNC_END, \
90 #define __BeforeRcvSimple(msgid, _NAME_) \
91 KERNEL_DEBUG_CONSTANT(KDBG_MIGCODE(msgid) | DBG_FUNC_START, \
98 #define __AfterRcvSimple(msgid, _NAME_) \
99 KERNEL_DEBUG_CONSTANT(KDBG_MIGCODE(msgid) | DBG_FUNC_END, \
106 #endif /* !_MIG_TRACE_PARAMETERS_ */
108 #define _MIG_MSGID_INVALID(msgid) \
109 KERNEL_DEBUG_CONSTANT(MACHDBG_CODE(DBG_MACH_MSGID_INVALID, (msgid)), \
116 /* Send a message from the kernel */
117 extern mach_msg_return_t
mach_msg_send_from_kernel(
118 mach_msg_header_t
*msg
,
119 mach_msg_size_t send_size
);
122 extern mach_msg_return_t
mach_msg_rpc_from_kernel(
123 mach_msg_header_t
*msg
,
124 mach_msg_size_t send_size
,
125 mach_msg_size_t rcv_size
);
127 extern void mach_msg_receive_continue(void);
129 #include <sys/appleapiopts.h>
131 #ifdef __APPLE_API_EVOLVING
133 * Kernel implementation of the MIG object base class
135 * Conforms to the MIGObjectInterface defined in <mach/mig.h>
136 * Ports are automatically allocated for the duration of outstanding
137 * cross-task references and then released.
140 typedef struct mig_object
{
141 IMIGObjectVtbl
*pVtbl
; /* our interface def */
142 mach_port_t port
; /* our port pointer */
147 * MIG notify base class definition
148 * These are chained off the mig object to which the are registered.
149 * When that object triggers a notification delivery, we walk this
150 * chain and deliver the appropriate notification.
152 typedef struct mig_notify_object
{
153 IMIGNotifyObjectVtbl
*pVtbl
; /* our interface def */
154 mach_port_t port
; /* our port pointer */
155 } mig_notify_object_data_t
;
157 #endif /* __APPLE_API_EVOLVING */
159 #endif /* _IPC_MIG_H_ */