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@
29 #include <mach/message.h>
30 #include <sys/kdebug.h>
33 * Define the trace points for MIG-generated calls. One traces the input parameters
34 * to MIG called things, another traces the outputs, and one traces bad message IDs.
36 #ifdef _MIG_TRACE_PARAMETERS_
38 #define __BeforeRcvCallTrace(msgid,arg1,arg2,arg3,arg4) \
39 KERNEL_DEBUG_CONSTANT(KDBG_MIGCODE(msgid) | DBG_FUNC_START, \
40 (unsigned int)(arg1), \
41 (unsigned int)(arg2), \
42 (unsigned int)(arg3), \
43 (unsigned int)(arg4), \
46 #define __AfterRcvCallTrace(msgid,arg1,arg2,arg3,arg4) \
47 KERNEL_DEBUG_CONSTANT(KDBG_MIGCODE(msgid) | DBG_FUNC_END, \
48 (unsigned int)(arg1), \
49 (unsigned int)(arg2), \
50 (unsigned int)(arg3), \
51 (unsigned int)(arg4), \
54 #define __BeforeSimpleCallTrace(msgid,arg1,arg2,arg3,arg4) \
55 KERNEL_DEBUG_CONSTANT(KDBG_MIGCODE(msgid) | DBG_FUNC_START, \
56 (unsigned int)(arg1), \
57 (unsigned int)(arg2), \
58 (unsigned int)(arg3), \
59 (unsigned int)(arg4), \
62 #define __AfterSimpleCallTrace(msgid,arg1,arg2,arg3,arg4) \
63 KERNEL_DEBUG_CONSTANT(KDBG_MIGCODE(msgid) | DBG_FUNC_END, \
64 (unsigned int)(arg1), \
65 (unsigned int)(arg2), \
66 (unsigned int)(arg3), \
67 (unsigned int)(arg4), \
70 #else /* !_MIG_TRACE_PARAMETERS_ */
72 #define __BeforeRcvRpc(msgid, _NAME_) \
73 KERNEL_DEBUG_CONSTANT(KDBG_MIGCODE(msgid) | DBG_FUNC_START, \
80 #define __AfterRcvRpc(msgid, _NAME_) \
81 KERNEL_DEBUG_CONSTANT(KDBG_MIGCODE(msgid) | DBG_FUNC_END, \
89 #define __BeforeRcvSimple(msgid, _NAME_) \
90 KERNEL_DEBUG_CONSTANT(KDBG_MIGCODE(msgid) | DBG_FUNC_START, \
97 #define __AfterRcvSimple(msgid, _NAME_) \
98 KERNEL_DEBUG_CONSTANT(KDBG_MIGCODE(msgid) | DBG_FUNC_END, \
105 #endif /* !_MIG_TRACE_PARAMETERS_ */
107 #define _MIG_MSGID_INVALID(msgid) \
108 KERNEL_DEBUG_CONSTANT(MACHDBG_CODE(DBG_MACH_MSGID_INVALID, (msgid)), \
115 /* Send a message from the kernel */
116 extern mach_msg_return_t
mach_msg_send_from_kernel(
117 mach_msg_header_t
*msg
,
118 mach_msg_size_t send_size
);
121 extern mach_msg_return_t
mach_msg_rpc_from_kernel(
122 mach_msg_header_t
*msg
,
123 mach_msg_size_t send_size
,
124 mach_msg_size_t rcv_size
);
126 extern void mach_msg_receive_continue(void);
128 #endif /* _IPC_MIG_H_ */