2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
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.
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
20 * @APPLE_LICENSE_HEADER_END@
26 * Mach Operating System
27 * Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University
28 * All Rights Reserved.
30 * Permission to use, copy, modify and distribute this software and its
31 * documentation is hereby granted, provided that both the copyright
32 * notice and this permission notice appear in all copies of the
33 * software, derivative works or modified versions, and any portions
34 * thereof, and that both notices appear in supporting documentation.
36 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
37 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
38 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
40 * Carnegie Mellon requests users of this software to return to
42 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
43 * School of Computer Science
44 * Carnegie Mellon University
45 * Pittsburgh PA 15213-3890
47 * any improvements or extensions that they make and grant Carnegie Mellon
48 * the rights to redistribute these changes.
53 #ifndef _KERN_IPC_TT_H_
54 #define _KERN_IPC_TT_H_
56 #include <mach/boolean.h>
57 #include <mach/port.h>
58 #include <vm/vm_kern.h>
59 #include <kern/kern_types.h>
60 #include <kern/ipc_kobject.h>
61 #include <ipc/ipc_space.h>
62 #include <ipc/ipc_table.h>
63 #include <ipc/ipc_port.h>
64 #include <ipc/ipc_right.h>
65 #include <ipc/ipc_entry.h>
66 #include <ipc/ipc_object.h>
69 /* Initialize a task's IPC state */
70 extern void ipc_task_init(
74 /* Enable a task for IPC access */
75 extern void ipc_task_enable(
78 /* Disable IPC access to a task */
79 extern void ipc_task_disable(
82 /* Clean up and destroy a task's IPC state */
83 extern void ipc_task_terminate(
86 /* Initialize a thread's IPC state */
87 extern void ipc_thread_init(
90 /* Clean up and destroy a thread's IPC state */
91 extern void ipc_thread_terminate(
94 /* Return a send right for the task's user-visible self port */
95 extern ipc_port_t
retrieve_task_self_fast(
98 /* Return a send right for the thread's user-visible self port */
99 extern ipc_port_t
retrieve_act_self_fast(
102 /* Convert from a port to a task */
103 extern task_t
convert_port_to_task(
106 /* Convert from a port entry port to a task */
107 extern task_t
convert_port_to_task(
110 extern boolean_t
ref_task_port_locked(
111 ipc_port_t port
, task_t
*ptask
);
113 /* Convert from a port to a space */
114 extern ipc_space_t
convert_port_to_space(
117 extern boolean_t
ref_space_port_locked(
118 ipc_port_t port
, ipc_space_t
*pspace
);
120 /* Convert from a port to a map */
121 extern vm_map_t
convert_port_to_map(
124 /* Convert from a map entry port to a map */
125 extern vm_map_t
convert_port_entry_to_map(
128 /* Convert from a port to a vm_object */
129 extern vm_object_t
convert_port_entry_to_object(
132 /* Convert from a port to a upl_object */
133 extern upl_t
convert_port_to_upl(
136 /* Convert from a port to a thread */
137 extern thread_act_t
convert_port_to_act(
140 extern thread_act_t
port_name_to_act(
141 mach_port_name_t port_name
);
143 extern boolean_t
ref_act_port_locked(
144 ipc_port_t port
, thread_act_t
*pthr_act
);
146 /* Convert from a task to a port */
147 extern ipc_port_t
convert_task_to_port(
150 /* Convert from a thread to a port */
151 extern ipc_port_t
convert_act_to_port( thread_act_t
);
153 /* Deallocate a space ref produced by convert_port_to_space */
154 extern void space_deallocate(
157 /* Allocate a reply port */
158 extern mach_port_name_t
mach_reply_port(void);
160 /* Initialize a thread_act's ipc mechanism */
161 extern void ipc_thr_act_init(task_t
, thread_act_t
);
163 /* Disable IPC access to a thread_act */
164 extern void ipc_thr_act_disable(thread_act_t
);
166 /* Clean up and destroy a thread_act's IPC state */
167 extern void ipc_thr_act_terminate(thread_act_t
);
169 #endif /* _KERN_IPC_TT_H_ */