]>
git.saurik.com Git - apple/xnu.git/blob - osfmk/mach/kern_return.h
622e6d908ca886886e52cfa733b0e5884a6d88f0
2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
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
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.
21 * @APPLE_LICENSE_HEADER_END@
27 * Mach Operating System
28 * Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University
29 * All Rights Reserved.
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.
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.
41 * Carnegie Mellon requests users of this software to return to
43 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
44 * School of Computer Science
45 * Carnegie Mellon University
46 * Pittsburgh PA 15213-3890
48 * any improvements or extensions that they make and grant Carnegie Mellon
49 * the rights to redistribute these changes.
54 * File: h/kern_return.h
55 * Author: Avadis Tevanian, Jr.
58 * Kernel return codes.
62 #ifndef _MACH_KERN_RETURN_H_
63 #define _MACH_KERN_RETURN_H_
65 #include <mach/machine/kern_return.h>
67 #define KERN_SUCCESS 0
69 #define KERN_INVALID_ADDRESS 1
70 /* Specified address is not currently valid.
73 #define KERN_PROTECTION_FAILURE 2
74 /* Specified memory is valid, but does not permit the
75 * required forms of access.
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
84 #define KERN_INVALID_ARGUMENT 4
85 /* The function requested was not applicable to this
86 * type of argument, or an argument is invalid
89 #define KERN_FAILURE 5
90 /* The function could not be performed. A catch-all.
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.
98 #define KERN_NOT_RECEIVER 7
99 /* The task in question does not hold receive rights
100 * for the port argument.
103 #define KERN_NO_ACCESS 8
104 /* Bogus access restriction.
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.
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
121 #define KERN_ALREADY_IN_SET 11
122 /* The receive right is already a member of the portset.
125 #define KERN_NOT_IN_SET 12
126 /* The receive right is not a member of a port set.
129 #define KERN_NAME_EXISTS 13
130 /* The name already denotes a right in the task.
133 #define KERN_ABORTED 14
134 /* The operation was aborted. Ipc code will
135 * catch this and reflect it as a message error.
138 #define KERN_INVALID_NAME 15
139 /* The name doesn't denote a right in the task.
142 #define KERN_INVALID_TASK 16
143 /* Target task isn't an active task.
146 #define KERN_INVALID_RIGHT 17
147 /* The name denotes a right, but not an appropriate right.
150 #define KERN_INVALID_VALUE 18
151 /* A blatant range error.
154 #define KERN_UREFS_OVERFLOW 19
155 /* Operation would overflow limit on user-references.
158 #define KERN_INVALID_CAPABILITY 20
159 /* The supplied (port) capability is improper.
162 #define KERN_RIGHT_EXISTS 21
163 /* The task already has send or receive rights
164 * for the port under another name.
167 #define KERN_INVALID_HOST 22
168 /* Target host isn't actually a host.
171 #define KERN_MEMORY_PRESENT 23
172 /* An attempt was made to supply "precious" data
173 * for memory that is already present in a
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
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.
201 #define KERN_INVALID_PROCESSOR_SET 26
202 /* An argument applied to assert processor set privilege
203 * was not a processor set control port.
206 #define KERN_POLICY_LIMIT 27
207 /* The specified scheduling attributes exceed the thread's
211 #define KERN_INVALID_POLICY 28
212 /* The specified scheduling policy is not currently
213 * enabled for the processor set.
216 #define KERN_INVALID_OBJECT 29
217 /* The external memory manager failed to initialize the
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.
226 #define KERN_DEFAULT_SET 31
227 /* An attempt was made to destroy the default processor
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.
237 #define KERN_INVALID_LEDGER 33
238 /* A ledger was required but not supplied.
241 #define KERN_INVALID_MEMORY_CONTROL 34
242 /* The port was not a memory cache control port.
245 #define KERN_INVALID_SECURITY 35
246 /* An argument supplied to assert security privilege
247 * was not a host security port.
250 #define KERN_NOT_DEPRESSED 36
251 /* thread_depress_abort was called on a thread which
252 * was not currently depressed.
255 #define KERN_TERMINATED 37
256 /* Object has been terminated and is no longer available
259 #define KERN_LOCK_SET_DESTROYED 38
260 /* Lock set has been destroyed and is no longer available.
263 #define KERN_LOCK_UNSTABLE 39
264 /* The thread holding the lock terminated before releasing
268 #define KERN_LOCK_OWNED 40
269 /* The lock is already owned by another thread
272 #define KERN_LOCK_OWNED_SELF 41
273 /* The lock is already owned by the calling thread
276 #define KERN_SEMAPHORE_DESTROYED 42
277 /* Semaphore has been destroyed and is no longer available.
280 #define KERN_RPC_SERVER_TERMINATED 43
281 /* Return from RPC indicating the target server was
282 * terminated before it successfully replied
285 #define KERN_RPC_TERMINATE_ORPHAN 44
286 /* Terminate an orphaned activation.
289 #define KERN_RPC_CONTINUE_ORPHAN 45
290 /* Allow an orphaned activation to continue executing.
293 #define KERN_NOT_SUPPORTED 46
294 /* Empty thread activation (No thread linked to it)
297 #define KERN_NODE_DOWN 47
298 /* Remote node down or inaccessible.
301 #define KERN_NOT_WAITING 48
302 /* A signalled thread was not actually waiting. */
304 #define KERN_OPERATION_TIMED_OUT 49
305 /* Some thread-oriented operation (semaphore_wait) timed out
308 #define KERN_RETURN_MAX 0x100
309 /* Maximum return value allowable
312 #endif /* _MACH_KERN_RETURN_H_ */