]> git.saurik.com Git - apple/xnu.git/blame - osfmk/ipc/ipc_types.h
xnu-792.6.56.tar.gz
[apple/xnu.git] / osfmk / ipc / ipc_types.h
CommitLineData
1c79356b 1/*
91447636 2 * Copyright (c) 2000-2005 Apple Computer, Inc. All rights reserved.
1c79356b
A
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
ff6e181a
A
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. Please obtain a copy of the License at
10 * http://www.opensource.apple.com/apsl/ and read it before using this
11 * file.
1c79356b 12 *
ff6e181a
A
13 * The Original Code and all software distributed under the License are
14 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
1c79356b
A
15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
ff6e181a
A
17 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18 * Please see the License for the specific language governing rights and
19 * limitations under the License.
1c79356b
A
20 *
21 * @APPLE_LICENSE_HEADER_END@
22 */
23/*
24 * @OSF_COPYRIGHT@
25 */
91447636 26
1c79356b
A
27/*
28 * Define Basic IPC types available to callers.
29 * These are not intended to be used directly, but
30 * are used to define other types available through
31 * port.h and mach_types.h for in-kernel entities.
32 */
91447636
A
33
34#ifndef _IPC_IPC_TYPES_H_
35#define _IPC_IPC_TYPES_H_
1c79356b 36
9bccf70c
A
37#include <mach/port.h>
38#include <mach/message.h>
39#include <mach/mach_types.h>
1c79356b 40
91447636
A
41#ifdef MACH_KERNEL_PRIVATE
42
43typedef natural_t ipc_table_index_t; /* index into tables */
44typedef natural_t ipc_table_elems_t; /* size of tables */
45typedef natural_t ipc_entry_bits_t;
46typedef ipc_table_elems_t ipc_entry_num_t; /* number of entries */
47typedef ipc_table_index_t ipc_port_request_index_t;
48
49typedef mach_port_name_t mach_port_index_t; /* index values */
50typedef mach_port_name_t mach_port_gen_t; /* generation numbers */
51
52typedef struct ipc_entry *ipc_entry_t;
53typedef struct ipc_tree_entry *ipc_tree_entry_t;
54typedef struct ipc_table_size *ipc_table_size_t;
55typedef struct ipc_port_request *ipc_port_request_t;
56typedef struct ipc_pset *ipc_pset_t;
57typedef struct ipc_kmsg *ipc_kmsg_t;
58
59#define IE_NULL ((ipc_entry_t) 0)
60#define ITE_NULL ((ipc_tree_entry_t) 0)
61#define ITS_NULL ((ipc_table_size_t) 0)
62#define ITS_SIZE_NONE ((ipc_table_elems_t) -1)
63#define IPR_NULL ((ipc_port_request_t) 0)
64#define IPS_NULL ((ipc_pset_t) 0)
65#define IKM_NULL ((ipc_kmsg_t) 0)
66
67typedef void (*mach_msg_continue_t)(mach_msg_return_t); /* after wakeup */
68
69#else /* MACH_KERNEL_PRIVATE */
1c79356b 70
1c79356b 71struct ipc_object ;
1c79356b 72
91447636 73#endif /* MACH_KERNEL_PRIVATE */
1c79356b
A
74
75typedef struct ipc_object *ipc_object_t;
1c79356b
A
76
77#define IPC_OBJECT_NULL ((ipc_object_t) 0)
78#define IPC_OBJECT_DEAD ((ipc_object_t)~0)
79#define IPC_OBJECT_VALID(io) (((io) != IPC_OBJECT_NULL) && \
80 ((io) != IPC_OBJECT_DEAD))
81
91447636 82#endif /* _IPC_IPC_TYPES_H_ */