]>
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_OSREFERENCE_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. 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.
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
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
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
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.
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
32 * Mach Operating System
33 * Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University
34 * All Rights Reserved.
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.
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.
46 * Carnegie Mellon requests users of this software to return to
48 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
49 * School of Computer Science
50 * Carnegie Mellon University
51 * Pittsburgh PA 15213-3890
53 * any improvements or extensions that they make and grant Carnegie Mellon
54 * the rights to redistribute these changes.
59 * File: h/kern_return.h
60 * Author: Avadis Tevanian, Jr.
63 * Kernel return codes.
67 #ifndef _MACH_KERN_RETURN_H_
68 #define _MACH_KERN_RETURN_H_
70 #include <mach/machine/kern_return.h>
72 #define KERN_SUCCESS 0
74 #define KERN_INVALID_ADDRESS 1
75 /* Specified address is not currently valid.
78 #define KERN_PROTECTION_FAILURE 2
79 /* Specified memory is valid, but does not permit the
80 * required forms of access.
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
89 #define KERN_INVALID_ARGUMENT 4
90 /* The function requested was not applicable to this
91 * type of argument, or an argument is invalid
94 #define KERN_FAILURE 5
95 /* The function could not be performed. A catch-all.
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.
103 #define KERN_NOT_RECEIVER 7
104 /* The task in question does not hold receive rights
105 * for the port argument.
108 #define KERN_NO_ACCESS 8
109 /* Bogus access restriction.
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.
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
126 #define KERN_ALREADY_IN_SET 11
127 /* The receive right is already a member of the portset.
130 #define KERN_NOT_IN_SET 12
131 /* The receive right is not a member of a port set.
134 #define KERN_NAME_EXISTS 13
135 /* The name already denotes a right in the task.
138 #define KERN_ABORTED 14
139 /* The operation was aborted. Ipc code will
140 * catch this and reflect it as a message error.
143 #define KERN_INVALID_NAME 15
144 /* The name doesn't denote a right in the task.
147 #define KERN_INVALID_TASK 16
148 /* Target task isn't an active task.
151 #define KERN_INVALID_RIGHT 17
152 /* The name denotes a right, but not an appropriate right.
155 #define KERN_INVALID_VALUE 18
156 /* A blatant range error.
159 #define KERN_UREFS_OVERFLOW 19
160 /* Operation would overflow limit on user-references.
163 #define KERN_INVALID_CAPABILITY 20
164 /* The supplied (port) capability is improper.
167 #define KERN_RIGHT_EXISTS 21
168 /* The task already has send or receive rights
169 * for the port under another name.
172 #define KERN_INVALID_HOST 22
173 /* Target host isn't actually a host.
176 #define KERN_MEMORY_PRESENT 23
177 /* An attempt was made to supply "precious" data
178 * for memory that is already present in a
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
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.
206 #define KERN_INVALID_PROCESSOR_SET 26
207 /* An argument applied to assert processor set privilege
208 * was not a processor set control port.
211 #define KERN_POLICY_LIMIT 27
212 /* The specified scheduling attributes exceed the thread's
216 #define KERN_INVALID_POLICY 28
217 /* The specified scheduling policy is not currently
218 * enabled for the processor set.
221 #define KERN_INVALID_OBJECT 29
222 /* The external memory manager failed to initialize the
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.
231 #define KERN_DEFAULT_SET 31
232 /* An attempt was made to destroy the default processor
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.
242 #define KERN_INVALID_LEDGER 33
243 /* A ledger was required but not supplied.
246 #define KERN_INVALID_MEMORY_CONTROL 34
247 /* The port was not a memory cache control port.
250 #define KERN_INVALID_SECURITY 35
251 /* An argument supplied to assert security privilege
252 * was not a host security port.
255 #define KERN_NOT_DEPRESSED 36
256 /* thread_depress_abort was called on a thread which
257 * was not currently depressed.
260 #define KERN_TERMINATED 37
261 /* Object has been terminated and is no longer available
264 #define KERN_LOCK_SET_DESTROYED 38
265 /* Lock set has been destroyed and is no longer available.
268 #define KERN_LOCK_UNSTABLE 39
269 /* The thread holding the lock terminated before releasing
273 #define KERN_LOCK_OWNED 40
274 /* The lock is already owned by another thread
277 #define KERN_LOCK_OWNED_SELF 41
278 /* The lock is already owned by the calling thread
281 #define KERN_SEMAPHORE_DESTROYED 42
282 /* Semaphore has been destroyed and is no longer available.
285 #define KERN_RPC_SERVER_TERMINATED 43
286 /* Return from RPC indicating the target server was
287 * terminated before it successfully replied
290 #define KERN_RPC_TERMINATE_ORPHAN 44
291 /* Terminate an orphaned activation.
294 #define KERN_RPC_CONTINUE_ORPHAN 45
295 /* Allow an orphaned activation to continue executing.
298 #define KERN_NOT_SUPPORTED 46
299 /* Empty thread activation (No thread linked to it)
302 #define KERN_NODE_DOWN 47
303 /* Remote node down or inaccessible.
306 #define KERN_NOT_WAITING 48
307 /* A signalled thread was not actually waiting. */
309 #define KERN_OPERATION_TIMED_OUT 49
310 /* Some thread-oriented operation (semaphore_wait) timed out
313 #define KERN_CODESIGN_ERROR 50
314 /* During a page fault, indicates that the page was rejected
315 * as a result of a signature check.
318 #define KERN_POLICY_STATIC 51
319 /* The requested property cannot be changed at this time.
322 #define KERN_INSUFFICIENT_BUFFER_SIZE 52
323 /* The provided buffer is of insufficient size for the requested data.
326 #define KERN_RETURN_MAX 0x100
327 /* Maximum return value allowable
330 #endif /* _MACH_KERN_RETURN_H_ */