]> git.saurik.com Git - apple/xnu.git/blame - osfmk/mach/kern_return.h
xnu-344.23.tar.gz
[apple/xnu.git] / osfmk / mach / kern_return.h
CommitLineData
1c79356b
A
1/*
2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
de355530
A
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.
1c79356b 11 *
de355530
A
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
1c79356b
A
14 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
15 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
de355530
A
16 * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
17 * License for the specific language governing rights and limitations
18 * under the License.
1c79356b
A
19 *
20 * @APPLE_LICENSE_HEADER_END@
21 */
22/*
23 * @OSF_COPYRIGHT@
24 */
25/*
26 * Mach Operating System
27 * Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University
28 * All Rights Reserved.
29 *
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.
35 *
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.
39 *
40 * Carnegie Mellon requests users of this software to return to
41 *
42 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
43 * School of Computer Science
44 * Carnegie Mellon University
45 * Pittsburgh PA 15213-3890
46 *
47 * any improvements or extensions that they make and grant Carnegie Mellon
48 * the rights to redistribute these changes.
49 */
50/*
51 */
52/*
53 * File: h/kern_return.h
54 * Author: Avadis Tevanian, Jr.
55 * Date: 1985
56 *
57 * Kernel return codes.
58 *
59 */
60
61#ifndef _MACH_KERN_RETURN_H_
62#define _MACH_KERN_RETURN_H_
63
64#include <mach/machine/kern_return.h>
65
66/*
67 * N.B.: If you add errors, please update
68 * mach_services/lib/libmach/err_kern.sub
69 */
70
71#define KERN_SUCCESS 0
72
73#define KERN_INVALID_ADDRESS 1
74 /* Specified address is not currently valid.
75 */
76
77#define KERN_PROTECTION_FAILURE 2
78 /* Specified memory is valid, but does not permit the
79 * required forms of access.
80 */
81
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
85 * found.
86 */
87
88#define KERN_INVALID_ARGUMENT 4
89 /* The function requested was not applicable to this
90 * type of argument, or an argument is invalid
91 */
92
93#define KERN_FAILURE 5
94 /* The function could not be performed. A catch-all.
95 */
96
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.
100 */
101
102#define KERN_NOT_RECEIVER 7
103 /* The task in question does not hold receive rights
104 * for the port argument.
105 */
106
107#define KERN_NO_ACCESS 8
108 /* Bogus access restriction.
109 */
110
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.
115 */
116
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
122 * object.
123 */
124
125#define KERN_ALREADY_IN_SET 11
126 /* The receive right is already a member of the portset.
127 */
128
129#define KERN_NOT_IN_SET 12
130 /* The receive right is not a member of a port set.
131 */
132
133#define KERN_NAME_EXISTS 13
134 /* The name already denotes a right in the task.
135 */
136
137#define KERN_ABORTED 14
138 /* The operation was aborted. Ipc code will
139 * catch this and reflect it as a message error.
140 */
141
142#define KERN_INVALID_NAME 15
143 /* The name doesn't denote a right in the task.
144 */
145
146#define KERN_INVALID_TASK 16
147 /* Target task isn't an active task.
148 */
149
150#define KERN_INVALID_RIGHT 17
151 /* The name denotes a right, but not an appropriate right.
152 */
153
154#define KERN_INVALID_VALUE 18
155 /* A blatant range error.
156 */
157
158#define KERN_UREFS_OVERFLOW 19
159 /* Operation would overflow limit on user-references.
160 */
161
162#define KERN_INVALID_CAPABILITY 20
163 /* The supplied (port) capability is improper.
164 */
165
166#define KERN_RIGHT_EXISTS 21
167 /* The task already has send or receive rights
168 * for the port under another name.
169 */
170
171#define KERN_INVALID_HOST 22
172 /* Target host isn't actually a host.
173 */
174
175#define KERN_MEMORY_PRESENT 23
176 /* An attempt was made to supply "precious" data
177 * for memory that is already present in a
178 * memory object.
179 */
180
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
194 * seen by users.
195 */
196
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.
203 */
204
205#define KERN_INVALID_PROCESSOR_SET 26
206 /* An argument applied to assert processor set privilege
207 * was not a processor set control port.
208 */
209
210#define KERN_POLICY_LIMIT 27
211 /* The specified scheduling attributes exceed the thread's
212 * limits.
213 */
214
215#define KERN_INVALID_POLICY 28
216 /* The specified scheduling policy is not currently
217 * enabled for the processor set.
218 */
219
220#define KERN_INVALID_OBJECT 29
221 /* The external memory manager failed to initialize the
222 * memory object.
223 */
224
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.
228 */
229
230#define KERN_DEFAULT_SET 31
231 /* An attempt was made to destroy the default processor
232 * set.
233 */
234
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.
239 */
240
241#define KERN_INVALID_LEDGER 33
242 /* A ledger was required but not supplied.
243 */
244
245#define KERN_INVALID_MEMORY_CONTROL 34
246 /* The port was not a memory cache control port.
247 */
248
249#define KERN_INVALID_SECURITY 35
250 /* An argument supplied to assert security privilege
251 * was not a host security port.
252 */
253
254#define KERN_NOT_DEPRESSED 36
255 /* thread_depress_abort was called on a thread which
256 * was not currently depressed.
257 */
258
259#define KERN_TERMINATED 37
260 /* Object has been terminated and is no longer available
261 */
262
263#define KERN_LOCK_SET_DESTROYED 38
264 /* Lock set has been destroyed and is no longer available.
265 */
266
267#define KERN_LOCK_UNSTABLE 39
268 /* The thread holding the lock terminated before releasing
269 * the lock
270 */
271
272#define KERN_LOCK_OWNED 40
273 /* The lock is already owned by another thread
274 */
275
276#define KERN_LOCK_OWNED_SELF 41
277 /* The lock is already owned by the calling thread
278 */
279
280#define KERN_SEMAPHORE_DESTROYED 42
281 /* Semaphore has been destroyed and is no longer available.
282 */
283
284#define KERN_RPC_SERVER_TERMINATED 43
285 /* Return from RPC indicating the target server was
286 * terminated before it successfully replied
287 */
288
289#define KERN_RPC_TERMINATE_ORPHAN 44
290 /* Terminate an orphaned activation.
291 */
292
293#define KERN_RPC_CONTINUE_ORPHAN 45
294 /* Allow an orphaned activation to continue executing.
295 */
296
297#define KERN_NOT_SUPPORTED 46
298 /* Empty thread activation (No thread linked to it)
299 */
300
301#define KERN_NODE_DOWN 47
302 /* Remote node down or inaccessible.
303 */
304
305#define KERN_NOT_WAITING 48
306 /* A signalled thread was not actually waiting. */
307
308#define KERN_OPERATION_TIMED_OUT 49
309 /* Some thread-oriented operation (semaphore_wait) timed out
310 */
311
312#define KERN_RETURN_MAX 0x100
313 /* Maximum return value allowable
314 */
315
316#endif /* _MACH_KERN_RETURN_H_ */