]>
Commit | Line | Data |
---|---|---|
1c79356b | 1 | /* |
91447636 | 2 | * Copyright (c) 2000-2004 Apple Computer, Inc. All rights reserved. |
1c79356b | 3 | * |
6601e61a | 4 | * @APPLE_LICENSE_HEADER_START@ |
1c79356b | 5 | * |
6601e61a A |
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. | |
8f6c56a5 | 11 | * |
6601e61a A |
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 | |
8f6c56a5 A |
14 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, |
15 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | |
6601e61a A |
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. | |
8f6c56a5 | 19 | * |
6601e61a | 20 | * @APPLE_LICENSE_HEADER_END@ |
1c79356b A |
21 | */ |
22 | /* | |
23 | * @OSF_COPYRIGHT@ | |
24 | */ | |
25 | /* | |
26 | * Mach Operating System | |
27 | * Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University | |
28 | * All Rights Reserved. | |
29 | * | |
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. | |
35 | * | |
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. | |
39 | * | |
40 | * Carnegie Mellon requests users of this software to return to | |
41 | * | |
42 | * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU | |
43 | * School of Computer Science | |
44 | * Carnegie Mellon University | |
45 | * Pittsburgh PA 15213-3890 | |
46 | * | |
47 | * any improvements or extensions that they make and grant Carnegie Mellon | |
48 | * the rights to redistribute these changes. | |
49 | */ | |
50 | /* | |
51 | */ | |
52 | ||
53 | #ifndef _KERN_IPC_TT_H_ | |
54 | #define _KERN_IPC_TT_H_ | |
55 | ||
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> | |
67 | ||
68 | ||
69 | /* Initialize a task's IPC state */ | |
70 | extern void ipc_task_init( | |
71 | task_t task, | |
72 | task_t parent); | |
73 | ||
74 | /* Enable a task for IPC access */ | |
75 | extern void ipc_task_enable( | |
76 | task_t task); | |
77 | ||
78 | /* Disable IPC access to a task */ | |
79 | extern void ipc_task_disable( | |
80 | task_t task); | |
81 | ||
91447636 A |
82 | /* Clear out a task's IPC state */ |
83 | extern void ipc_task_reset( | |
84 | task_t task); | |
85 | ||
1c79356b A |
86 | /* Clean up and destroy a task's IPC state */ |
87 | extern void ipc_task_terminate( | |
88 | task_t task); | |
89 | ||
90 | /* Initialize a thread's IPC state */ | |
91 | extern void ipc_thread_init( | |
92 | thread_t thread); | |
93 | ||
91447636 A |
94 | /* Disable IPC access to a thread */ |
95 | extern void ipc_thread_disable( | |
96 | thread_t thread); | |
97 | ||
1c79356b A |
98 | /* Clean up and destroy a thread's IPC state */ |
99 | extern void ipc_thread_terminate( | |
100 | thread_t thread); | |
101 | ||
6601e61a A |
102 | /* Clear out a thread's IPC state */ |
103 | extern void ipc_thread_reset( | |
104 | thread_t thread); | |
105 | ||
1c79356b A |
106 | /* Return a send right for the task's user-visible self port */ |
107 | extern ipc_port_t retrieve_task_self_fast( | |
108 | task_t task); | |
109 | ||
110 | /* Return a send right for the thread's user-visible self port */ | |
91447636 A |
111 | extern ipc_port_t retrieve_thread_self_fast( |
112 | thread_t thread); | |
1c79356b A |
113 | |
114 | /* Convert from a port to a task */ | |
115 | extern task_t convert_port_to_task( | |
116 | ipc_port_t port); | |
117 | ||
91447636 A |
118 | extern task_t port_name_to_task( |
119 | mach_port_name_t name); | |
1c79356b A |
120 | |
121 | extern boolean_t ref_task_port_locked( | |
122 | ipc_port_t port, task_t *ptask); | |
123 | ||
124 | /* Convert from a port to a space */ | |
125 | extern ipc_space_t convert_port_to_space( | |
126 | ipc_port_t port); | |
127 | ||
128 | extern boolean_t ref_space_port_locked( | |
129 | ipc_port_t port, ipc_space_t *pspace); | |
130 | ||
131 | /* Convert from a port to a map */ | |
132 | extern vm_map_t convert_port_to_map( | |
133 | ipc_port_t port); | |
134 | ||
1c79356b | 135 | /* Convert from a port to a thread */ |
91447636 A |
136 | extern thread_t convert_port_to_thread( |
137 | ipc_port_t port); | |
1c79356b | 138 | |
91447636 | 139 | extern thread_t port_name_to_thread( |
1c79356b A |
140 | mach_port_name_t port_name); |
141 | ||
1c79356b A |
142 | /* Convert from a task to a port */ |
143 | extern ipc_port_t convert_task_to_port( | |
91447636 | 144 | task_t task); |
1c79356b A |
145 | |
146 | /* Convert from a thread to a port */ | |
91447636 A |
147 | extern ipc_port_t convert_thread_to_port( |
148 | thread_t thread); | |
0b4e3aa0 | 149 | |
1c79356b A |
150 | /* Deallocate a space ref produced by convert_port_to_space */ |
151 | extern void space_deallocate( | |
91447636 | 152 | ipc_space_t space); |
1c79356b A |
153 | |
154 | #endif /* _KERN_IPC_TT_H_ */ |