]>
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>
66 #define KERN_SUCCESS 0
68 #define KERN_INVALID_ADDRESS 1
69 /* Specified address is not currently valid.
72 #define KERN_PROTECTION_FAILURE 2
73 /* Specified memory is valid, but does not permit the
74 * required forms of access.
77 #define KERN_NO_SPACE 3
78 /* The address range specified is already in use, or
79 * no address range of the size specified could be
83 #define KERN_INVALID_ARGUMENT 4
84 /* The function requested was not applicable to this
85 * type of argument, or an argument is invalid
88 #define KERN_FAILURE 5
89 /* The function could not be performed. A catch-all.
92 #define KERN_RESOURCE_SHORTAGE 6
93 /* A system resource could not be allocated to fulfill
94 * this request. This failure may not be permanent.
97 #define KERN_NOT_RECEIVER 7
98 /* The task in question does not hold receive rights
99 * for the port argument.
102 #define KERN_NO_ACCESS 8
103 /* Bogus access restriction.
106 #define KERN_MEMORY_FAILURE 9
107 /* During a page fault, the target address refers to a
108 * memory object that has been destroyed. This
109 * failure is permanent.
112 #define KERN_MEMORY_ERROR 10
113 /* During a page fault, the memory object indicated
114 * that the data could not be returned. This failure
115 * may be temporary; future attempts to access this
116 * same data may succeed, as defined by the memory
120 #define KERN_ALREADY_IN_SET 11
121 /* The receive right is already a member of the portset.
124 #define KERN_NOT_IN_SET 12
125 /* The receive right is not a member of a port set.
128 #define KERN_NAME_EXISTS 13
129 /* The name already denotes a right in the task.
132 #define KERN_ABORTED 14
133 /* The operation was aborted. Ipc code will
134 * catch this and reflect it as a message error.
137 #define KERN_INVALID_NAME 15
138 /* The name doesn't denote a right in the task.
141 #define KERN_INVALID_TASK 16
142 /* Target task isn't an active task.
145 #define KERN_INVALID_RIGHT 17
146 /* The name denotes a right, but not an appropriate right.
149 #define KERN_INVALID_VALUE 18
150 /* A blatant range error.
153 #define KERN_UREFS_OVERFLOW 19
154 /* Operation would overflow limit on user-references.
157 #define KERN_INVALID_CAPABILITY 20
158 /* The supplied (port) capability is improper.
161 #define KERN_RIGHT_EXISTS 21
162 /* The task already has send or receive rights
163 * for the port under another name.
166 #define KERN_INVALID_HOST 22
167 /* Target host isn't actually a host.
170 #define KERN_MEMORY_PRESENT 23
171 /* An attempt was made to supply "precious" data
172 * for memory that is already present in a
176 #define KERN_MEMORY_DATA_MOVED 24
177 /* A page was requested of a memory manager via
178 * memory_object_data_request for an object using
179 * a MEMORY_OBJECT_COPY_CALL strategy, with the
180 * VM_PROT_WANTS_COPY flag being used to specify
181 * that the page desired is for a copy of the
182 * object, and the memory manager has detected
183 * the page was pushed into a copy of the object
184 * while the kernel was walking the shadow chain
185 * from the copy to the object. This error code
186 * is delivered via memory_object_data_error
187 * and is handled by the kernel (it forces the
188 * kernel to restart the fault). It will not be
192 #define KERN_MEMORY_RESTART_COPY 25
193 /* A strategic copy was attempted of an object
194 * upon which a quicker copy is now possible.
195 * The caller should retry the copy using
196 * vm_object_copy_quickly. This error code
197 * is seen only by the kernel.
200 #define KERN_INVALID_PROCESSOR_SET 26
201 /* An argument applied to assert processor set privilege
202 * was not a processor set control port.
205 #define KERN_POLICY_LIMIT 27
206 /* The specified scheduling attributes exceed the thread's
210 #define KERN_INVALID_POLICY 28
211 /* The specified scheduling policy is not currently
212 * enabled for the processor set.
215 #define KERN_INVALID_OBJECT 29
216 /* The external memory manager failed to initialize the
220 #define KERN_ALREADY_WAITING 30
221 /* A thread is attempting to wait for an event for which
222 * there is already a waiting thread.
225 #define KERN_DEFAULT_SET 31
226 /* An attempt was made to destroy the default processor
230 #define KERN_EXCEPTION_PROTECTED 32
231 /* An attempt was made to fetch an exception port that is
232 * protected, or to abort a thread while processing a
233 * protected exception.
236 #define KERN_INVALID_LEDGER 33
237 /* A ledger was required but not supplied.
240 #define KERN_INVALID_MEMORY_CONTROL 34
241 /* The port was not a memory cache control port.
244 #define KERN_INVALID_SECURITY 35
245 /* An argument supplied to assert security privilege
246 * was not a host security port.
249 #define KERN_NOT_DEPRESSED 36
250 /* thread_depress_abort was called on a thread which
251 * was not currently depressed.
254 #define KERN_TERMINATED 37
255 /* Object has been terminated and is no longer available
258 #define KERN_LOCK_SET_DESTROYED 38
259 /* Lock set has been destroyed and is no longer available.
262 #define KERN_LOCK_UNSTABLE 39
263 /* The thread holding the lock terminated before releasing
267 #define KERN_LOCK_OWNED 40
268 /* The lock is already owned by another thread
271 #define KERN_LOCK_OWNED_SELF 41
272 /* The lock is already owned by the calling thread
275 #define KERN_SEMAPHORE_DESTROYED 42
276 /* Semaphore has been destroyed and is no longer available.
279 #define KERN_RPC_SERVER_TERMINATED 43
280 /* Return from RPC indicating the target server was
281 * terminated before it successfully replied
284 #define KERN_RPC_TERMINATE_ORPHAN 44
285 /* Terminate an orphaned activation.
288 #define KERN_RPC_CONTINUE_ORPHAN 45
289 /* Allow an orphaned activation to continue executing.
292 #define KERN_NOT_SUPPORTED 46
293 /* Empty thread activation (No thread linked to it)
296 #define KERN_NODE_DOWN 47
297 /* Remote node down or inaccessible.
300 #define KERN_NOT_WAITING 48
301 /* A signalled thread was not actually waiting. */
303 #define KERN_OPERATION_TIMED_OUT 49
304 /* Some thread-oriented operation (semaphore_wait) timed out
307 #define KERN_RETURN_MAX 0x100
308 /* Maximum return value allowable
311 #endif /* _MACH_KERN_RETURN_H_ */