]> git.saurik.com Git - apple/xnu.git/blame - osfmk/ipc/ipc_types.h
xnu-201.42.3.tar.gz
[apple/xnu.git] / osfmk / ipc / ipc_types.h
CommitLineData
1c79356b
A
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 */
44struct ipc_object ;
45struct ipc_space ;
46struct ipc_port ;
47
48#endif /* !MACH_KERNEL_PRIVATE */
49
50typedef struct ipc_object *ipc_object_t;
51typedef struct ipc_space *ipc_space_t;
52typedef 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_ */