]> git.saurik.com Git - apple/xnu.git/blame - osfmk/ipc/ipc_types.h
xnu-6153.61.1.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 3 *
2d21ac55 4 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
0a7de745 5 *
2d21ac55
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. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
0a7de745 14 *
2d21ac55
A
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
0a7de745 17 *
2d21ac55
A
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
8f6c56a5
A
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
2d21ac55
A
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
0a7de745 25 *
2d21ac55 26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
1c79356b
A
27 */
28/*
29 * @OSF_COPYRIGHT@
30 */
91447636 31
1c79356b
A
32/*
33 * Define Basic IPC types available to callers.
34 * These are not intended to be used directly, but
35 * are used to define other types available through
36 * port.h and mach_types.h for in-kernel entities.
37 */
91447636 38
0a7de745
A
39#ifndef _IPC_IPC_TYPES_H_
40#define _IPC_IPC_TYPES_H_
1c79356b 41
9bccf70c
A
42#include <mach/port.h>
43#include <mach/message.h>
44#include <mach/mach_types.h>
1c79356b 45
0a7de745 46#ifdef MACH_KERNEL_PRIVATE
91447636 47
0a7de745
A
48typedef natural_t ipc_table_index_t; /* index into tables */
49typedef natural_t ipc_table_elems_t; /* size of tables */
91447636 50typedef natural_t ipc_entry_bits_t;
0a7de745 51typedef ipc_table_elems_t ipc_entry_num_t; /* number of entries */
91447636
A
52typedef ipc_table_index_t ipc_port_request_index_t;
53
0a7de745
A
54typedef mach_port_name_t mach_port_index_t; /* index values */
55typedef mach_port_name_t mach_port_gen_t; /* generation numbers */
91447636
A
56
57typedef struct ipc_entry *ipc_entry_t;
316670eb 58
91447636
A
59typedef struct ipc_table_size *ipc_table_size_t;
60typedef struct ipc_port_request *ipc_port_request_t;
61typedef struct ipc_pset *ipc_pset_t;
62typedef struct ipc_kmsg *ipc_kmsg_t;
5ba3f43e 63typedef uint8_t sync_qos_count_t;
91447636 64
0a7de745 65#define IE_NULL ((ipc_entry_t) 0)
316670eb 66
0a7de745
A
67#define ITS_NULL ((ipc_table_size_t) 0)
68#define ITS_SIZE_NONE ((ipc_table_elems_t) -1)
69#define IPR_NULL ((ipc_port_request_t) 0)
70#define IPS_NULL ((ipc_pset_t) 0)
71#define IKM_NULL ((ipc_kmsg_t) 0)
91447636 72
0a7de745
A
73typedef void (*mach_msg_continue_t)(mach_msg_return_t); /* after wakeup */
74#define MACH_MSG_CONTINUE_NULL ((mach_msg_continue_t) 0)
91447636 75
fe8ab488 76typedef struct ipc_importance_elem *ipc_importance_elem_t;
0a7de745 77#define IIE_NULL ((ipc_importance_elem_t)0)
fe8ab488
A
78
79typedef struct ipc_importance_task *ipc_importance_task_t;
0a7de745 80#define IIT_NULL ((ipc_importance_task_t)0)
fe8ab488
A
81
82typedef struct ipc_importance_inherit *ipc_importance_inherit_t;
0a7de745 83#define III_NULL ((ipc_importance_inherit_t)0)
fe8ab488
A
84
85
0a7de745 86#else /* MACH_KERNEL_PRIVATE */
1c79356b 87
0a7de745 88struct ipc_object;
1c79356b 89
0a7de745 90#endif /* MACH_KERNEL_PRIVATE */
1c79356b 91
0a7de745 92typedef struct ipc_object *ipc_object_t;
1c79356b 93
0a7de745
A
94#define IPC_OBJECT_NULL ((ipc_object_t) 0)
95#define IPC_OBJECT_DEAD ((ipc_object_t)~0)
96#define IPC_OBJECT_VALID(io) (((io) != IPC_OBJECT_NULL) && \
97 ((io) != IPC_OBJECT_DEAD))
1c79356b 98
0a7de745 99#endif /* _IPC_IPC_TYPES_H_ */