]> git.saurik.com Git - apple/xnu.git/blob - osfmk/mach/kern_return.h
622e6d908ca886886e52cfa733b0e5884a6d88f0
[apple/xnu.git] / osfmk / mach / kern_return.h
1 /*
2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
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.
12 *
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
15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
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.
20 *
21 * @APPLE_LICENSE_HEADER_END@
22 */
23 /*
24 * @OSF_COPYRIGHT@
25 */
26 /*
27 * Mach Operating System
28 * Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University
29 * All Rights Reserved.
30 *
31 * Permission to use, copy, modify and distribute this software and its
32 * documentation is hereby granted, provided that both the copyright
33 * notice and this permission notice appear in all copies of the
34 * software, derivative works or modified versions, and any portions
35 * thereof, and that both notices appear in supporting documentation.
36 *
37 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
38 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
39 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
40 *
41 * Carnegie Mellon requests users of this software to return to
42 *
43 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
44 * School of Computer Science
45 * Carnegie Mellon University
46 * Pittsburgh PA 15213-3890
47 *
48 * any improvements or extensions that they make and grant Carnegie Mellon
49 * the rights to redistribute these changes.
50 */
51 /*
52 */
53 /*
54 * File: h/kern_return.h
55 * Author: Avadis Tevanian, Jr.
56 * Date: 1985
57 *
58 * Kernel return codes.
59 *
60 */
61
62 #ifndef _MACH_KERN_RETURN_H_
63 #define _MACH_KERN_RETURN_H_
64
65 #include <mach/machine/kern_return.h>
66
67 #define KERN_SUCCESS 0
68
69 #define KERN_INVALID_ADDRESS 1
70 /* Specified address is not currently valid.
71 */
72
73 #define KERN_PROTECTION_FAILURE 2
74 /* Specified memory is valid, but does not permit the
75 * required forms of access.
76 */
77
78 #define KERN_NO_SPACE 3
79 /* The address range specified is already in use, or
80 * no address range of the size specified could be
81 * found.
82 */
83
84 #define KERN_INVALID_ARGUMENT 4
85 /* The function requested was not applicable to this
86 * type of argument, or an argument is invalid
87 */
88
89 #define KERN_FAILURE 5
90 /* The function could not be performed. A catch-all.
91 */
92
93 #define KERN_RESOURCE_SHORTAGE 6
94 /* A system resource could not be allocated to fulfill
95 * this request. This failure may not be permanent.
96 */
97
98 #define KERN_NOT_RECEIVER 7
99 /* The task in question does not hold receive rights
100 * for the port argument.
101 */
102
103 #define KERN_NO_ACCESS 8
104 /* Bogus access restriction.
105 */
106
107 #define KERN_MEMORY_FAILURE 9
108 /* During a page fault, the target address refers to a
109 * memory object that has been destroyed. This
110 * failure is permanent.
111 */
112
113 #define KERN_MEMORY_ERROR 10
114 /* During a page fault, the memory object indicated
115 * that the data could not be returned. This failure
116 * may be temporary; future attempts to access this
117 * same data may succeed, as defined by the memory
118 * object.
119 */
120
121 #define KERN_ALREADY_IN_SET 11
122 /* The receive right is already a member of the portset.
123 */
124
125 #define KERN_NOT_IN_SET 12
126 /* The receive right is not a member of a port set.
127 */
128
129 #define KERN_NAME_EXISTS 13
130 /* The name already denotes a right in the task.
131 */
132
133 #define KERN_ABORTED 14
134 /* The operation was aborted. Ipc code will
135 * catch this and reflect it as a message error.
136 */
137
138 #define KERN_INVALID_NAME 15
139 /* The name doesn't denote a right in the task.
140 */
141
142 #define KERN_INVALID_TASK 16
143 /* Target task isn't an active task.
144 */
145
146 #define KERN_INVALID_RIGHT 17
147 /* The name denotes a right, but not an appropriate right.
148 */
149
150 #define KERN_INVALID_VALUE 18
151 /* A blatant range error.
152 */
153
154 #define KERN_UREFS_OVERFLOW 19
155 /* Operation would overflow limit on user-references.
156 */
157
158 #define KERN_INVALID_CAPABILITY 20
159 /* The supplied (port) capability is improper.
160 */
161
162 #define KERN_RIGHT_EXISTS 21
163 /* The task already has send or receive rights
164 * for the port under another name.
165 */
166
167 #define KERN_INVALID_HOST 22
168 /* Target host isn't actually a host.
169 */
170
171 #define KERN_MEMORY_PRESENT 23
172 /* An attempt was made to supply "precious" data
173 * for memory that is already present in a
174 * memory object.
175 */
176
177 #define KERN_MEMORY_DATA_MOVED 24
178 /* A page was requested of a memory manager via
179 * memory_object_data_request for an object using
180 * a MEMORY_OBJECT_COPY_CALL strategy, with the
181 * VM_PROT_WANTS_COPY flag being used to specify
182 * that the page desired is for a copy of the
183 * object, and the memory manager has detected
184 * the page was pushed into a copy of the object
185 * while the kernel was walking the shadow chain
186 * from the copy to the object. This error code
187 * is delivered via memory_object_data_error
188 * and is handled by the kernel (it forces the
189 * kernel to restart the fault). It will not be
190 * seen by users.
191 */
192
193 #define KERN_MEMORY_RESTART_COPY 25
194 /* A strategic copy was attempted of an object
195 * upon which a quicker copy is now possible.
196 * The caller should retry the copy using
197 * vm_object_copy_quickly. This error code
198 * is seen only by the kernel.
199 */
200
201 #define KERN_INVALID_PROCESSOR_SET 26
202 /* An argument applied to assert processor set privilege
203 * was not a processor set control port.
204 */
205
206 #define KERN_POLICY_LIMIT 27
207 /* The specified scheduling attributes exceed the thread's
208 * limits.
209 */
210
211 #define KERN_INVALID_POLICY 28
212 /* The specified scheduling policy is not currently
213 * enabled for the processor set.
214 */
215
216 #define KERN_INVALID_OBJECT 29
217 /* The external memory manager failed to initialize the
218 * memory object.
219 */
220
221 #define KERN_ALREADY_WAITING 30
222 /* A thread is attempting to wait for an event for which
223 * there is already a waiting thread.
224 */
225
226 #define KERN_DEFAULT_SET 31
227 /* An attempt was made to destroy the default processor
228 * set.
229 */
230
231 #define KERN_EXCEPTION_PROTECTED 32
232 /* An attempt was made to fetch an exception port that is
233 * protected, or to abort a thread while processing a
234 * protected exception.
235 */
236
237 #define KERN_INVALID_LEDGER 33
238 /* A ledger was required but not supplied.
239 */
240
241 #define KERN_INVALID_MEMORY_CONTROL 34
242 /* The port was not a memory cache control port.
243 */
244
245 #define KERN_INVALID_SECURITY 35
246 /* An argument supplied to assert security privilege
247 * was not a host security port.
248 */
249
250 #define KERN_NOT_DEPRESSED 36
251 /* thread_depress_abort was called on a thread which
252 * was not currently depressed.
253 */
254
255 #define KERN_TERMINATED 37
256 /* Object has been terminated and is no longer available
257 */
258
259 #define KERN_LOCK_SET_DESTROYED 38
260 /* Lock set has been destroyed and is no longer available.
261 */
262
263 #define KERN_LOCK_UNSTABLE 39
264 /* The thread holding the lock terminated before releasing
265 * the lock
266 */
267
268 #define KERN_LOCK_OWNED 40
269 /* The lock is already owned by another thread
270 */
271
272 #define KERN_LOCK_OWNED_SELF 41
273 /* The lock is already owned by the calling thread
274 */
275
276 #define KERN_SEMAPHORE_DESTROYED 42
277 /* Semaphore has been destroyed and is no longer available.
278 */
279
280 #define KERN_RPC_SERVER_TERMINATED 43
281 /* Return from RPC indicating the target server was
282 * terminated before it successfully replied
283 */
284
285 #define KERN_RPC_TERMINATE_ORPHAN 44
286 /* Terminate an orphaned activation.
287 */
288
289 #define KERN_RPC_CONTINUE_ORPHAN 45
290 /* Allow an orphaned activation to continue executing.
291 */
292
293 #define KERN_NOT_SUPPORTED 46
294 /* Empty thread activation (No thread linked to it)
295 */
296
297 #define KERN_NODE_DOWN 47
298 /* Remote node down or inaccessible.
299 */
300
301 #define KERN_NOT_WAITING 48
302 /* A signalled thread was not actually waiting. */
303
304 #define KERN_OPERATION_TIMED_OUT 49
305 /* Some thread-oriented operation (semaphore_wait) timed out
306 */
307
308 #define KERN_RETURN_MAX 0x100
309 /* Maximum return value allowable
310 */
311
312 #endif /* _MACH_KERN_RETURN_H_ */