]> git.saurik.com Git - apple/xnu.git/blob - osfmk/ipc/ipc_types.h
cebbc57f7a30480d943cc58539540d67b063a87a
[apple/xnu.git] / osfmk / ipc / ipc_types.h
1 /*
2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
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.
11 *
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
18 * under the License.
19 *
20 * @APPLE_LICENSE_HEADER_END@
21 */
22 /*
23 * @OSF_COPYRIGHT@
24 */
25 /*
26 * Define Basic IPC types available to callers.
27 * These are not intended to be used directly, but
28 * are used to define other types available through
29 * port.h and mach_types.h for in-kernel entities.
30 */
31 #ifndef _IPC_TYPES_H_
32 #define _IPC_TYPES_H_
33
34 #ifdef KERNEL_PRIVATE
35
36 #if !defined(MACH_KERNEL_PRIVATE)
37
38 /*
39 * For kernel code that resides outside of mach
40 * we define empty structs so that everything will
41 * remain strongly typed, without giving out
42 * implementation details.
43 */
44 struct ipc_object ;
45 struct ipc_space ;
46 struct ipc_port ;
47
48 #endif /* !MACH_KERNEL_PRIVATE */
49
50 typedef struct ipc_object *ipc_object_t;
51 typedef struct ipc_space *ipc_space_t;
52 typedef struct ipc_port *ipc_port_t;
53
54 #define IPC_OBJECT_NULL ((ipc_object_t) 0)
55 #define IPC_OBJECT_DEAD ((ipc_object_t)~0)
56 #define IPC_OBJECT_VALID(io) (((io) != IPC_OBJECT_NULL) && \
57 ((io) != IPC_OBJECT_DEAD))
58
59 #define IPC_PORT_NULL ((ipc_port_t) 0)
60 #define IPC_PORT_DEAD ((ipc_port_t)~0)
61 #define IPC_PORT_VALID(port) (((port) != IPC_PORT_NULL) && \
62 ((port) != IPC_PORT_DEAD))
63
64 #define IPC_SPACE_NULL ((ipc_space_t) 0)
65
66 #endif /* KERNEL_PRIVATE */
67
68 #endif /* _IPC_TYPES_H_ */