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