]>
git.saurik.com Git - apple/xnu.git/blob - osfmk/mach/kern_return.h
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 * File: h/kern_return.h
57 * Author: Avadis Tevanian, Jr.
60 * Kernel return codes.
64 #ifndef _MACH_KERN_RETURN_H_
65 #define _MACH_KERN_RETURN_H_
67 #include <mach/machine/kern_return.h>
70 * N.B.: If you add errors, please update
71 * mach_services/lib/libmach/err_kern.sub
74 #define KERN_SUCCESS 0
76 #define KERN_INVALID_ADDRESS 1
77 /* Specified address is not currently valid.
80 #define KERN_PROTECTION_FAILURE 2
81 /* Specified memory is valid, but does not permit the
82 * required forms of access.
85 #define KERN_NO_SPACE 3
86 /* The address range specified is already in use, or
87 * no address range of the size specified could be
91 #define KERN_INVALID_ARGUMENT 4
92 /* The function requested was not applicable to this
93 * type of argument, or an argument is invalid
96 #define KERN_FAILURE 5
97 /* The function could not be performed. A catch-all.
100 #define KERN_RESOURCE_SHORTAGE 6
101 /* A system resource could not be allocated to fulfill
102 * this request. This failure may not be permanent.
105 #define KERN_NOT_RECEIVER 7
106 /* The task in question does not hold receive rights
107 * for the port argument.
110 #define KERN_NO_ACCESS 8
111 /* Bogus access restriction.
114 #define KERN_MEMORY_FAILURE 9
115 /* During a page fault, the target address refers to a
116 * memory object that has been destroyed. This
117 * failure is permanent.
120 #define KERN_MEMORY_ERROR 10
121 /* During a page fault, the memory object indicated
122 * that the data could not be returned. This failure
123 * may be temporary; future attempts to access this
124 * same data may succeed, as defined by the memory
128 #define KERN_ALREADY_IN_SET 11
129 /* The receive right is already a member of the portset.
132 #define KERN_NOT_IN_SET 12
133 /* The receive right is not a member of a port set.
136 #define KERN_NAME_EXISTS 13
137 /* The name already denotes a right in the task.
140 #define KERN_ABORTED 14
141 /* The operation was aborted. Ipc code will
142 * catch this and reflect it as a message error.
145 #define KERN_INVALID_NAME 15
146 /* The name doesn't denote a right in the task.
149 #define KERN_INVALID_TASK 16
150 /* Target task isn't an active task.
153 #define KERN_INVALID_RIGHT 17
154 /* The name denotes a right, but not an appropriate right.
157 #define KERN_INVALID_VALUE 18
158 /* A blatant range error.
161 #define KERN_UREFS_OVERFLOW 19
162 /* Operation would overflow limit on user-references.
165 #define KERN_INVALID_CAPABILITY 20
166 /* The supplied (port) capability is improper.
169 #define KERN_RIGHT_EXISTS 21
170 /* The task already has send or receive rights
171 * for the port under another name.
174 #define KERN_INVALID_HOST 22
175 /* Target host isn't actually a host.
178 #define KERN_MEMORY_PRESENT 23
179 /* An attempt was made to supply "precious" data
180 * for memory that is already present in a
184 #define KERN_MEMORY_DATA_MOVED 24
185 /* A page was requested of a memory manager via
186 * memory_object_data_request for an object using
187 * a MEMORY_OBJECT_COPY_CALL strategy, with the
188 * VM_PROT_WANTS_COPY flag being used to specify
189 * that the page desired is for a copy of the
190 * object, and the memory manager has detected
191 * the page was pushed into a copy of the object
192 * while the kernel was walking the shadow chain
193 * from the copy to the object. This error code
194 * is delivered via memory_object_data_error
195 * and is handled by the kernel (it forces the
196 * kernel to restart the fault). It will not be
200 #define KERN_MEMORY_RESTART_COPY 25
201 /* A strategic copy was attempted of an object
202 * upon which a quicker copy is now possible.
203 * The caller should retry the copy using
204 * vm_object_copy_quickly. This error code
205 * is seen only by the kernel.
208 #define KERN_INVALID_PROCESSOR_SET 26
209 /* An argument applied to assert processor set privilege
210 * was not a processor set control port.
213 #define KERN_POLICY_LIMIT 27
214 /* The specified scheduling attributes exceed the thread's
218 #define KERN_INVALID_POLICY 28
219 /* The specified scheduling policy is not currently
220 * enabled for the processor set.
223 #define KERN_INVALID_OBJECT 29
224 /* The external memory manager failed to initialize the
228 #define KERN_ALREADY_WAITING 30
229 /* A thread is attempting to wait for an event for which
230 * there is already a waiting thread.
233 #define KERN_DEFAULT_SET 31
234 /* An attempt was made to destroy the default processor
238 #define KERN_EXCEPTION_PROTECTED 32
239 /* An attempt was made to fetch an exception port that is
240 * protected, or to abort a thread while processing a
241 * protected exception.
244 #define KERN_INVALID_LEDGER 33
245 /* A ledger was required but not supplied.
248 #define KERN_INVALID_MEMORY_CONTROL 34
249 /* The port was not a memory cache control port.
252 #define KERN_INVALID_SECURITY 35
253 /* An argument supplied to assert security privilege
254 * was not a host security port.
257 #define KERN_NOT_DEPRESSED 36
258 /* thread_depress_abort was called on a thread which
259 * was not currently depressed.
262 #define KERN_TERMINATED 37
263 /* Object has been terminated and is no longer available
266 #define KERN_LOCK_SET_DESTROYED 38
267 /* Lock set has been destroyed and is no longer available.
270 #define KERN_LOCK_UNSTABLE 39
271 /* The thread holding the lock terminated before releasing
275 #define KERN_LOCK_OWNED 40
276 /* The lock is already owned by another thread
279 #define KERN_LOCK_OWNED_SELF 41
280 /* The lock is already owned by the calling thread
283 #define KERN_SEMAPHORE_DESTROYED 42
284 /* Semaphore has been destroyed and is no longer available.
287 #define KERN_RPC_SERVER_TERMINATED 43
288 /* Return from RPC indicating the target server was
289 * terminated before it successfully replied
292 #define KERN_RPC_TERMINATE_ORPHAN 44
293 /* Terminate an orphaned activation.
296 #define KERN_RPC_CONTINUE_ORPHAN 45
297 /* Allow an orphaned activation to continue executing.
300 #define KERN_NOT_SUPPORTED 46
301 /* Empty thread activation (No thread linked to it)
304 #define KERN_NODE_DOWN 47
305 /* Remote node down or inaccessible.
308 #define KERN_NOT_WAITING 48
309 /* A signalled thread was not actually waiting. */
311 #define KERN_OPERATION_TIMED_OUT 49
312 /* Some thread-oriented operation (semaphore_wait) timed out
315 #define KERN_RETURN_MAX 0x100
316 /* Maximum return value allowable
319 #endif /* _MACH_KERN_RETURN_H_ */