]>
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 * 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 * File: h/kern_return.h
54 * Author: Avadis Tevanian, Jr.
57 * Kernel return codes.
61 #ifndef _MACH_KERN_RETURN_H_
62 #define _MACH_KERN_RETURN_H_
64 #include <mach/machine/kern_return.h>
67 * N.B.: If you add errors, please update
68 * mach_services/lib/libmach/err_kern.sub
71 #define KERN_SUCCESS 0
73 #define KERN_INVALID_ADDRESS 1
74 /* Specified address is not currently valid.
77 #define KERN_PROTECTION_FAILURE 2
78 /* Specified memory is valid, but does not permit the
79 * required forms of access.
82 #define KERN_NO_SPACE 3
83 /* The address range specified is already in use, or
84 * no address range of the size specified could be
88 #define KERN_INVALID_ARGUMENT 4
89 /* The function requested was not applicable to this
90 * type of argument, or an argument is invalid
93 #define KERN_FAILURE 5
94 /* The function could not be performed. A catch-all.
97 #define KERN_RESOURCE_SHORTAGE 6
98 /* A system resource could not be allocated to fulfill
99 * this request. This failure may not be permanent.
102 #define KERN_NOT_RECEIVER 7
103 /* The task in question does not hold receive rights
104 * for the port argument.
107 #define KERN_NO_ACCESS 8
108 /* Bogus access restriction.
111 #define KERN_MEMORY_FAILURE 9
112 /* During a page fault, the target address refers to a
113 * memory object that has been destroyed. This
114 * failure is permanent.
117 #define KERN_MEMORY_ERROR 10
118 /* During a page fault, the memory object indicated
119 * that the data could not be returned. This failure
120 * may be temporary; future attempts to access this
121 * same data may succeed, as defined by the memory
125 #define KERN_ALREADY_IN_SET 11
126 /* The receive right is already a member of the portset.
129 #define KERN_NOT_IN_SET 12
130 /* The receive right is not a member of a port set.
133 #define KERN_NAME_EXISTS 13
134 /* The name already denotes a right in the task.
137 #define KERN_ABORTED 14
138 /* The operation was aborted. Ipc code will
139 * catch this and reflect it as a message error.
142 #define KERN_INVALID_NAME 15
143 /* The name doesn't denote a right in the task.
146 #define KERN_INVALID_TASK 16
147 /* Target task isn't an active task.
150 #define KERN_INVALID_RIGHT 17
151 /* The name denotes a right, but not an appropriate right.
154 #define KERN_INVALID_VALUE 18
155 /* A blatant range error.
158 #define KERN_UREFS_OVERFLOW 19
159 /* Operation would overflow limit on user-references.
162 #define KERN_INVALID_CAPABILITY 20
163 /* The supplied (port) capability is improper.
166 #define KERN_RIGHT_EXISTS 21
167 /* The task already has send or receive rights
168 * for the port under another name.
171 #define KERN_INVALID_HOST 22
172 /* Target host isn't actually a host.
175 #define KERN_MEMORY_PRESENT 23
176 /* An attempt was made to supply "precious" data
177 * for memory that is already present in a
181 #define KERN_MEMORY_DATA_MOVED 24
182 /* A page was requested of a memory manager via
183 * memory_object_data_request for an object using
184 * a MEMORY_OBJECT_COPY_CALL strategy, with the
185 * VM_PROT_WANTS_COPY flag being used to specify
186 * that the page desired is for a copy of the
187 * object, and the memory manager has detected
188 * the page was pushed into a copy of the object
189 * while the kernel was walking the shadow chain
190 * from the copy to the object. This error code
191 * is delivered via memory_object_data_error
192 * and is handled by the kernel (it forces the
193 * kernel to restart the fault). It will not be
197 #define KERN_MEMORY_RESTART_COPY 25
198 /* A strategic copy was attempted of an object
199 * upon which a quicker copy is now possible.
200 * The caller should retry the copy using
201 * vm_object_copy_quickly. This error code
202 * is seen only by the kernel.
205 #define KERN_INVALID_PROCESSOR_SET 26
206 /* An argument applied to assert processor set privilege
207 * was not a processor set control port.
210 #define KERN_POLICY_LIMIT 27
211 /* The specified scheduling attributes exceed the thread's
215 #define KERN_INVALID_POLICY 28
216 /* The specified scheduling policy is not currently
217 * enabled for the processor set.
220 #define KERN_INVALID_OBJECT 29
221 /* The external memory manager failed to initialize the
225 #define KERN_ALREADY_WAITING 30
226 /* A thread is attempting to wait for an event for which
227 * there is already a waiting thread.
230 #define KERN_DEFAULT_SET 31
231 /* An attempt was made to destroy the default processor
235 #define KERN_EXCEPTION_PROTECTED 32
236 /* An attempt was made to fetch an exception port that is
237 * protected, or to abort a thread while processing a
238 * protected exception.
241 #define KERN_INVALID_LEDGER 33
242 /* A ledger was required but not supplied.
245 #define KERN_INVALID_MEMORY_CONTROL 34
246 /* The port was not a memory cache control port.
249 #define KERN_INVALID_SECURITY 35
250 /* An argument supplied to assert security privilege
251 * was not a host security port.
254 #define KERN_NOT_DEPRESSED 36
255 /* thread_depress_abort was called on a thread which
256 * was not currently depressed.
259 #define KERN_TERMINATED 37
260 /* Object has been terminated and is no longer available
263 #define KERN_LOCK_SET_DESTROYED 38
264 /* Lock set has been destroyed and is no longer available.
267 #define KERN_LOCK_UNSTABLE 39
268 /* The thread holding the lock terminated before releasing
272 #define KERN_LOCK_OWNED 40
273 /* The lock is already owned by another thread
276 #define KERN_LOCK_OWNED_SELF 41
277 /* The lock is already owned by the calling thread
280 #define KERN_SEMAPHORE_DESTROYED 42
281 /* Semaphore has been destroyed and is no longer available.
284 #define KERN_RPC_SERVER_TERMINATED 43
285 /* Return from RPC indicating the target server was
286 * terminated before it successfully replied
289 #define KERN_RPC_TERMINATE_ORPHAN 44
290 /* Terminate an orphaned activation.
293 #define KERN_RPC_CONTINUE_ORPHAN 45
294 /* Allow an orphaned activation to continue executing.
297 #define KERN_NOT_SUPPORTED 46
298 /* Empty thread activation (No thread linked to it)
301 #define KERN_NODE_DOWN 47
302 /* Remote node down or inaccessible.
305 #define KERN_NOT_WAITING 48
306 /* A signalled thread was not actually waiting. */
308 #define KERN_OPERATION_TIMED_OUT 49
309 /* Some thread-oriented operation (semaphore_wait) timed out
312 #define KERN_RETURN_MAX 0x100
313 /* Maximum return value allowable
316 #endif /* _MACH_KERN_RETURN_H_ */