2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
6 * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved.
8 * This file contains Original Code and/or Modifications of Original Code
9 * as defined in and that are subject to the Apple Public Source License
10 * Version 2.0 (the 'License'). You may not use this file except in
11 * compliance with the License. Please obtain a copy of the License at
12 * http://www.opensource.apple.com/apsl/ and read it before using this
15 * The Original Code and all software distributed under the License are
16 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
17 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
18 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
20 * Please see the License for the specific language governing rights and
21 * limitations under the License.
23 * @APPLE_LICENSE_HEADER_END@
29 * Mach Operating System
30 * Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University
31 * All Rights Reserved.
33 * Permission to use, copy, modify and distribute this software and its
34 * documentation is hereby granted, provided that both the copyright
35 * notice and this permission notice appear in all copies of the
36 * software, derivative works or modified versions, and any portions
37 * thereof, and that both notices appear in supporting documentation.
39 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
40 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
41 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
43 * Carnegie Mellon requests users of this software to return to
45 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
46 * School of Computer Science
47 * Carnegie Mellon University
48 * Pittsburgh PA 15213-3890
50 * any improvements or extensions that they make and grant Carnegie Mellon
51 * the rights to redistribute these changes.
56 #ifndef _KERN_IPC_TT_H_
57 #define _KERN_IPC_TT_H_
59 #include <mach/boolean.h>
60 #include <mach/port.h>
61 #include <vm/vm_kern.h>
62 #include <kern/kern_types.h>
63 #include <kern/ipc_kobject.h>
64 #include <ipc/ipc_space.h>
65 #include <ipc/ipc_table.h>
66 #include <ipc/ipc_port.h>
67 #include <ipc/ipc_right.h>
68 #include <ipc/ipc_entry.h>
69 #include <ipc/ipc_object.h>
72 /* Initialize a task's IPC state */
73 extern void ipc_task_init(
77 /* Enable a task for IPC access */
78 extern void ipc_task_enable(
81 /* Disable IPC access to a task */
82 extern void ipc_task_disable(
85 /* Clean up and destroy a task's IPC state */
86 extern void ipc_task_terminate(
89 /* Initialize a thread's IPC state */
90 extern void ipc_thread_init(
93 /* Clean up and destroy a thread's IPC state */
94 extern void ipc_thread_terminate(
97 /* Return a send right for the task's user-visible self port */
98 extern ipc_port_t
retrieve_task_self_fast(
101 /* Return a send right for the thread's user-visible self port */
102 extern ipc_port_t
retrieve_act_self_fast(
105 /* Convert from a port to a task */
106 extern task_t
convert_port_to_task(
109 /* Convert from a port entry port to a task */
110 extern task_t
convert_port_to_task(
113 extern boolean_t
ref_task_port_locked(
114 ipc_port_t port
, task_t
*ptask
);
116 /* Convert from a port to a space */
117 extern ipc_space_t
convert_port_to_space(
120 extern boolean_t
ref_space_port_locked(
121 ipc_port_t port
, ipc_space_t
*pspace
);
123 /* Convert from a port to a map */
124 extern vm_map_t
convert_port_to_map(
127 /* Convert from a map entry port to a map */
128 extern vm_map_t
convert_port_entry_to_map(
131 /* Convert from a port to a vm_object */
132 extern vm_object_t
convert_port_entry_to_object(
135 /* Convert from a port to a upl_object */
136 extern upl_t
convert_port_to_upl(
139 /* Convert from a port to a thread */
140 extern thread_act_t
convert_port_to_act(
143 extern thread_act_t
port_name_to_act(
144 mach_port_name_t port_name
);
146 extern boolean_t
ref_act_port_locked(
147 ipc_port_t port
, thread_act_t
*pthr_act
);
149 /* Convert from a task to a port */
150 extern ipc_port_t
convert_task_to_port(
153 /* Convert from a thread to a port */
154 extern ipc_port_t
convert_act_to_port( thread_act_t
);
156 /* Convert from a upl to a port */
157 extern ipc_port_t
convert_upl_to_port( upl_t
);
159 /* Deallocate a space ref produced by convert_port_to_space */
160 extern void space_deallocate(
163 /* Allocate a reply port */
164 extern mach_port_name_t
mach_reply_port(void);
166 /* Initialize a thread_act's ipc mechanism */
167 extern void ipc_thr_act_init(task_t
, thread_act_t
);
169 /* Disable IPC access to a thread_act */
170 extern void ipc_thr_act_disable(thread_act_t
);
172 /* Clean up and destroy a thread_act's IPC state */
173 extern void ipc_thr_act_terminate(thread_act_t
);
175 #endif /* _KERN_IPC_TT_H_ */