1*0f4c859eSApple OSS Distributions /* 2*0f4c859eSApple OSS Distributions * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. 3*0f4c859eSApple OSS Distributions * 4*0f4c859eSApple OSS Distributions * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ 5*0f4c859eSApple OSS Distributions * 6*0f4c859eSApple OSS Distributions * This file contains Original Code and/or Modifications of Original Code 7*0f4c859eSApple OSS Distributions * as defined in and that are subject to the Apple Public Source License 8*0f4c859eSApple OSS Distributions * Version 2.0 (the 'License'). You may not use this file except in 9*0f4c859eSApple OSS Distributions * compliance with the License. The rights granted to you under the License 10*0f4c859eSApple OSS Distributions * may not be used to create, or enable the creation or redistribution of, 11*0f4c859eSApple OSS Distributions * unlawful or unlicensed copies of an Apple operating system, or to 12*0f4c859eSApple OSS Distributions * circumvent, violate, or enable the circumvention or violation of, any 13*0f4c859eSApple OSS Distributions * terms of an Apple operating system software license agreement. 14*0f4c859eSApple OSS Distributions * 15*0f4c859eSApple OSS Distributions * Please obtain a copy of the License at 16*0f4c859eSApple OSS Distributions * http://www.opensource.apple.com/apsl/ and read it before using this file. 17*0f4c859eSApple OSS Distributions * 18*0f4c859eSApple OSS Distributions * The Original Code and all software distributed under the License are 19*0f4c859eSApple OSS Distributions * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 20*0f4c859eSApple OSS Distributions * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 21*0f4c859eSApple OSS Distributions * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 22*0f4c859eSApple OSS Distributions * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 23*0f4c859eSApple OSS Distributions * Please see the License for the specific language governing rights and 24*0f4c859eSApple OSS Distributions * limitations under the License. 25*0f4c859eSApple OSS Distributions * 26*0f4c859eSApple OSS Distributions * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ 27*0f4c859eSApple OSS Distributions */ 28*0f4c859eSApple OSS Distributions /* 29*0f4c859eSApple OSS Distributions * @OSF_COPYRIGHT@ 30*0f4c859eSApple OSS Distributions */ 31*0f4c859eSApple OSS Distributions /* 32*0f4c859eSApple OSS Distributions * Mach Operating System 33*0f4c859eSApple OSS Distributions * Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University 34*0f4c859eSApple OSS Distributions * All Rights Reserved. 35*0f4c859eSApple OSS Distributions * 36*0f4c859eSApple OSS Distributions * Permission to use, copy, modify and distribute this software and its 37*0f4c859eSApple OSS Distributions * documentation is hereby granted, provided that both the copyright 38*0f4c859eSApple OSS Distributions * notice and this permission notice appear in all copies of the 39*0f4c859eSApple OSS Distributions * software, derivative works or modified versions, and any portions 40*0f4c859eSApple OSS Distributions * thereof, and that both notices appear in supporting documentation. 41*0f4c859eSApple OSS Distributions * 42*0f4c859eSApple OSS Distributions * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" 43*0f4c859eSApple OSS Distributions * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR 44*0f4c859eSApple OSS Distributions * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. 45*0f4c859eSApple OSS Distributions * 46*0f4c859eSApple OSS Distributions * Carnegie Mellon requests users of this software to return to 47*0f4c859eSApple OSS Distributions * 48*0f4c859eSApple OSS Distributions * Software Distribution Coordinator or [email protected] 49*0f4c859eSApple OSS Distributions * School of Computer Science 50*0f4c859eSApple OSS Distributions * Carnegie Mellon University 51*0f4c859eSApple OSS Distributions * Pittsburgh PA 15213-3890 52*0f4c859eSApple OSS Distributions * 53*0f4c859eSApple OSS Distributions * any improvements or extensions that they make and grant Carnegie Mellon 54*0f4c859eSApple OSS Distributions * the rights to redistribute these changes. 55*0f4c859eSApple OSS Distributions */ 56*0f4c859eSApple OSS Distributions /* 57*0f4c859eSApple OSS Distributions */ 58*0f4c859eSApple OSS Distributions /* 59*0f4c859eSApple OSS Distributions * File: h/kern_return.h 60*0f4c859eSApple OSS Distributions * Author: Avadis Tevanian, Jr. 61*0f4c859eSApple OSS Distributions * Date: 1985 62*0f4c859eSApple OSS Distributions * 63*0f4c859eSApple OSS Distributions * Kernel return codes. 64*0f4c859eSApple OSS Distributions * 65*0f4c859eSApple OSS Distributions */ 66*0f4c859eSApple OSS Distributions 67*0f4c859eSApple OSS Distributions #ifndef _MACH_KERN_RETURN_H_ 68*0f4c859eSApple OSS Distributions #define _MACH_KERN_RETURN_H_ 69*0f4c859eSApple OSS Distributions 70*0f4c859eSApple OSS Distributions #include <mach/machine/kern_return.h> 71*0f4c859eSApple OSS Distributions 72*0f4c859eSApple OSS Distributions #define KERN_SUCCESS 0 73*0f4c859eSApple OSS Distributions 74*0f4c859eSApple OSS Distributions #define KERN_INVALID_ADDRESS 1 75*0f4c859eSApple OSS Distributions /* Specified address is not currently valid. 76*0f4c859eSApple OSS Distributions */ 77*0f4c859eSApple OSS Distributions 78*0f4c859eSApple OSS Distributions #define KERN_PROTECTION_FAILURE 2 79*0f4c859eSApple OSS Distributions /* Specified memory is valid, but does not permit the 80*0f4c859eSApple OSS Distributions * required forms of access. 81*0f4c859eSApple OSS Distributions */ 82*0f4c859eSApple OSS Distributions 83*0f4c859eSApple OSS Distributions #define KERN_NO_SPACE 3 84*0f4c859eSApple OSS Distributions /* The address range specified is already in use, or 85*0f4c859eSApple OSS Distributions * no address range of the size specified could be 86*0f4c859eSApple OSS Distributions * found. 87*0f4c859eSApple OSS Distributions */ 88*0f4c859eSApple OSS Distributions 89*0f4c859eSApple OSS Distributions #define KERN_INVALID_ARGUMENT 4 90*0f4c859eSApple OSS Distributions /* The function requested was not applicable to this 91*0f4c859eSApple OSS Distributions * type of argument, or an argument is invalid 92*0f4c859eSApple OSS Distributions */ 93*0f4c859eSApple OSS Distributions 94*0f4c859eSApple OSS Distributions #define KERN_FAILURE 5 95*0f4c859eSApple OSS Distributions /* The function could not be performed. A catch-all. 96*0f4c859eSApple OSS Distributions */ 97*0f4c859eSApple OSS Distributions 98*0f4c859eSApple OSS Distributions #define KERN_RESOURCE_SHORTAGE 6 99*0f4c859eSApple OSS Distributions /* A system resource could not be allocated to fulfill 100*0f4c859eSApple OSS Distributions * this request. This failure may not be permanent. 101*0f4c859eSApple OSS Distributions */ 102*0f4c859eSApple OSS Distributions 103*0f4c859eSApple OSS Distributions #define KERN_NOT_RECEIVER 7 104*0f4c859eSApple OSS Distributions /* The task in question does not hold receive rights 105*0f4c859eSApple OSS Distributions * for the port argument. 106*0f4c859eSApple OSS Distributions */ 107*0f4c859eSApple OSS Distributions 108*0f4c859eSApple OSS Distributions #define KERN_NO_ACCESS 8 109*0f4c859eSApple OSS Distributions /* Bogus access restriction. 110*0f4c859eSApple OSS Distributions */ 111*0f4c859eSApple OSS Distributions 112*0f4c859eSApple OSS Distributions #define KERN_MEMORY_FAILURE 9 113*0f4c859eSApple OSS Distributions /* During a page fault, the target address refers to a 114*0f4c859eSApple OSS Distributions * memory object that has been destroyed. This 115*0f4c859eSApple OSS Distributions * failure is permanent. 116*0f4c859eSApple OSS Distributions */ 117*0f4c859eSApple OSS Distributions 118*0f4c859eSApple OSS Distributions #define KERN_MEMORY_ERROR 10 119*0f4c859eSApple OSS Distributions /* During a page fault, the memory object indicated 120*0f4c859eSApple OSS Distributions * that the data could not be returned. This failure 121*0f4c859eSApple OSS Distributions * may be temporary; future attempts to access this 122*0f4c859eSApple OSS Distributions * same data may succeed, as defined by the memory 123*0f4c859eSApple OSS Distributions * object. 124*0f4c859eSApple OSS Distributions */ 125*0f4c859eSApple OSS Distributions 126*0f4c859eSApple OSS Distributions #define KERN_ALREADY_IN_SET 11 127*0f4c859eSApple OSS Distributions /* The receive right is already a member of the portset. 128*0f4c859eSApple OSS Distributions */ 129*0f4c859eSApple OSS Distributions 130*0f4c859eSApple OSS Distributions #define KERN_NOT_IN_SET 12 131*0f4c859eSApple OSS Distributions /* The receive right is not a member of a port set. 132*0f4c859eSApple OSS Distributions */ 133*0f4c859eSApple OSS Distributions 134*0f4c859eSApple OSS Distributions #define KERN_NAME_EXISTS 13 135*0f4c859eSApple OSS Distributions /* The name already denotes a right in the task. 136*0f4c859eSApple OSS Distributions */ 137*0f4c859eSApple OSS Distributions 138*0f4c859eSApple OSS Distributions #define KERN_ABORTED 14 139*0f4c859eSApple OSS Distributions /* The operation was aborted. Ipc code will 140*0f4c859eSApple OSS Distributions * catch this and reflect it as a message error. 141*0f4c859eSApple OSS Distributions */ 142*0f4c859eSApple OSS Distributions 143*0f4c859eSApple OSS Distributions #define KERN_INVALID_NAME 15 144*0f4c859eSApple OSS Distributions /* The name doesn't denote a right in the task. 145*0f4c859eSApple OSS Distributions */ 146*0f4c859eSApple OSS Distributions 147*0f4c859eSApple OSS Distributions #define KERN_INVALID_TASK 16 148*0f4c859eSApple OSS Distributions /* Target task isn't an active task. 149*0f4c859eSApple OSS Distributions */ 150*0f4c859eSApple OSS Distributions 151*0f4c859eSApple OSS Distributions #define KERN_INVALID_RIGHT 17 152*0f4c859eSApple OSS Distributions /* The name denotes a right, but not an appropriate right. 153*0f4c859eSApple OSS Distributions */ 154*0f4c859eSApple OSS Distributions 155*0f4c859eSApple OSS Distributions #define KERN_INVALID_VALUE 18 156*0f4c859eSApple OSS Distributions /* A blatant range error. 157*0f4c859eSApple OSS Distributions */ 158*0f4c859eSApple OSS Distributions 159*0f4c859eSApple OSS Distributions #define KERN_UREFS_OVERFLOW 19 160*0f4c859eSApple OSS Distributions /* Operation would overflow limit on user-references. 161*0f4c859eSApple OSS Distributions */ 162*0f4c859eSApple OSS Distributions 163*0f4c859eSApple OSS Distributions #define KERN_INVALID_CAPABILITY 20 164*0f4c859eSApple OSS Distributions /* The supplied (port) capability is improper. 165*0f4c859eSApple OSS Distributions */ 166*0f4c859eSApple OSS Distributions 167*0f4c859eSApple OSS Distributions #define KERN_RIGHT_EXISTS 21 168*0f4c859eSApple OSS Distributions /* The task already has send or receive rights 169*0f4c859eSApple OSS Distributions * for the port under another name. 170*0f4c859eSApple OSS Distributions */ 171*0f4c859eSApple OSS Distributions 172*0f4c859eSApple OSS Distributions #define KERN_INVALID_HOST 22 173*0f4c859eSApple OSS Distributions /* Target host isn't actually a host. 174*0f4c859eSApple OSS Distributions */ 175*0f4c859eSApple OSS Distributions 176*0f4c859eSApple OSS Distributions #define KERN_MEMORY_PRESENT 23 177*0f4c859eSApple OSS Distributions /* An attempt was made to supply "precious" data 178*0f4c859eSApple OSS Distributions * for memory that is already present in a 179*0f4c859eSApple OSS Distributions * memory object. 180*0f4c859eSApple OSS Distributions */ 181*0f4c859eSApple OSS Distributions 182*0f4c859eSApple OSS Distributions #define KERN_MEMORY_DATA_MOVED 24 183*0f4c859eSApple OSS Distributions /* A page was requested of a memory manager via 184*0f4c859eSApple OSS Distributions * memory_object_data_request for an object using 185*0f4c859eSApple OSS Distributions * a MEMORY_OBJECT_COPY_CALL strategy, with the 186*0f4c859eSApple OSS Distributions * VM_PROT_WANTS_COPY flag being used to specify 187*0f4c859eSApple OSS Distributions * that the page desired is for a copy of the 188*0f4c859eSApple OSS Distributions * object, and the memory manager has detected 189*0f4c859eSApple OSS Distributions * the page was pushed into a copy of the object 190*0f4c859eSApple OSS Distributions * while the kernel was walking the shadow chain 191*0f4c859eSApple OSS Distributions * from the copy to the object. This error code 192*0f4c859eSApple OSS Distributions * is delivered via memory_object_data_error 193*0f4c859eSApple OSS Distributions * and is handled by the kernel (it forces the 194*0f4c859eSApple OSS Distributions * kernel to restart the fault). It will not be 195*0f4c859eSApple OSS Distributions * seen by users. 196*0f4c859eSApple OSS Distributions */ 197*0f4c859eSApple OSS Distributions 198*0f4c859eSApple OSS Distributions #define KERN_MEMORY_RESTART_COPY 25 199*0f4c859eSApple OSS Distributions /* A strategic copy was attempted of an object 200*0f4c859eSApple OSS Distributions * upon which a quicker copy is now possible. 201*0f4c859eSApple OSS Distributions * The caller should retry the copy using 202*0f4c859eSApple OSS Distributions * vm_object_copy_quickly. This error code 203*0f4c859eSApple OSS Distributions * is seen only by the kernel. 204*0f4c859eSApple OSS Distributions */ 205*0f4c859eSApple OSS Distributions 206*0f4c859eSApple OSS Distributions #define KERN_INVALID_PROCESSOR_SET 26 207*0f4c859eSApple OSS Distributions /* An argument applied to assert processor set privilege 208*0f4c859eSApple OSS Distributions * was not a processor set control port. 209*0f4c859eSApple OSS Distributions */ 210*0f4c859eSApple OSS Distributions 211*0f4c859eSApple OSS Distributions #define KERN_POLICY_LIMIT 27 212*0f4c859eSApple OSS Distributions /* The specified scheduling attributes exceed the thread's 213*0f4c859eSApple OSS Distributions * limits. 214*0f4c859eSApple OSS Distributions */ 215*0f4c859eSApple OSS Distributions 216*0f4c859eSApple OSS Distributions #define KERN_INVALID_POLICY 28 217*0f4c859eSApple OSS Distributions /* The specified scheduling policy is not currently 218*0f4c859eSApple OSS Distributions * enabled for the processor set. 219*0f4c859eSApple OSS Distributions */ 220*0f4c859eSApple OSS Distributions 221*0f4c859eSApple OSS Distributions #define KERN_INVALID_OBJECT 29 222*0f4c859eSApple OSS Distributions /* The external memory manager failed to initialize the 223*0f4c859eSApple OSS Distributions * memory object. 224*0f4c859eSApple OSS Distributions */ 225*0f4c859eSApple OSS Distributions 226*0f4c859eSApple OSS Distributions #define KERN_ALREADY_WAITING 30 227*0f4c859eSApple OSS Distributions /* A thread is attempting to wait for an event for which 228*0f4c859eSApple OSS Distributions * there is already a waiting thread. 229*0f4c859eSApple OSS Distributions */ 230*0f4c859eSApple OSS Distributions 231*0f4c859eSApple OSS Distributions #define KERN_DEFAULT_SET 31 232*0f4c859eSApple OSS Distributions /* An attempt was made to destroy the default processor 233*0f4c859eSApple OSS Distributions * set. 234*0f4c859eSApple OSS Distributions */ 235*0f4c859eSApple OSS Distributions 236*0f4c859eSApple OSS Distributions #define KERN_EXCEPTION_PROTECTED 32 237*0f4c859eSApple OSS Distributions /* An attempt was made to fetch an exception port that is 238*0f4c859eSApple OSS Distributions * protected, or to abort a thread while processing a 239*0f4c859eSApple OSS Distributions * protected exception. 240*0f4c859eSApple OSS Distributions */ 241*0f4c859eSApple OSS Distributions 242*0f4c859eSApple OSS Distributions #define KERN_INVALID_LEDGER 33 243*0f4c859eSApple OSS Distributions /* A ledger was required but not supplied. 244*0f4c859eSApple OSS Distributions */ 245*0f4c859eSApple OSS Distributions 246*0f4c859eSApple OSS Distributions #define KERN_INVALID_MEMORY_CONTROL 34 247*0f4c859eSApple OSS Distributions /* The port was not a memory cache control port. 248*0f4c859eSApple OSS Distributions */ 249*0f4c859eSApple OSS Distributions 250*0f4c859eSApple OSS Distributions #define KERN_INVALID_SECURITY 35 251*0f4c859eSApple OSS Distributions /* An argument supplied to assert security privilege 252*0f4c859eSApple OSS Distributions * was not a host security port. 253*0f4c859eSApple OSS Distributions */ 254*0f4c859eSApple OSS Distributions 255*0f4c859eSApple OSS Distributions #define KERN_NOT_DEPRESSED 36 256*0f4c859eSApple OSS Distributions /* thread_depress_abort was called on a thread which 257*0f4c859eSApple OSS Distributions * was not currently depressed. 258*0f4c859eSApple OSS Distributions */ 259*0f4c859eSApple OSS Distributions 260*0f4c859eSApple OSS Distributions #define KERN_TERMINATED 37 261*0f4c859eSApple OSS Distributions /* Object has been terminated and is no longer available 262*0f4c859eSApple OSS Distributions */ 263*0f4c859eSApple OSS Distributions 264*0f4c859eSApple OSS Distributions #define KERN_LOCK_SET_DESTROYED 38 265*0f4c859eSApple OSS Distributions /* Lock set has been destroyed and is no longer available. 266*0f4c859eSApple OSS Distributions */ 267*0f4c859eSApple OSS Distributions 268*0f4c859eSApple OSS Distributions #define KERN_LOCK_UNSTABLE 39 269*0f4c859eSApple OSS Distributions /* The thread holding the lock terminated before releasing 270*0f4c859eSApple OSS Distributions * the lock 271*0f4c859eSApple OSS Distributions */ 272*0f4c859eSApple OSS Distributions 273*0f4c859eSApple OSS Distributions #define KERN_LOCK_OWNED 40 274*0f4c859eSApple OSS Distributions /* The lock is already owned by another thread 275*0f4c859eSApple OSS Distributions */ 276*0f4c859eSApple OSS Distributions 277*0f4c859eSApple OSS Distributions #define KERN_LOCK_OWNED_SELF 41 278*0f4c859eSApple OSS Distributions /* The lock is already owned by the calling thread 279*0f4c859eSApple OSS Distributions */ 280*0f4c859eSApple OSS Distributions 281*0f4c859eSApple OSS Distributions #define KERN_SEMAPHORE_DESTROYED 42 282*0f4c859eSApple OSS Distributions /* Semaphore has been destroyed and is no longer available. 283*0f4c859eSApple OSS Distributions */ 284*0f4c859eSApple OSS Distributions 285*0f4c859eSApple OSS Distributions #define KERN_RPC_SERVER_TERMINATED 43 286*0f4c859eSApple OSS Distributions /* Return from RPC indicating the target server was 287*0f4c859eSApple OSS Distributions * terminated before it successfully replied 288*0f4c859eSApple OSS Distributions */ 289*0f4c859eSApple OSS Distributions 290*0f4c859eSApple OSS Distributions #define KERN_RPC_TERMINATE_ORPHAN 44 291*0f4c859eSApple OSS Distributions /* Terminate an orphaned activation. 292*0f4c859eSApple OSS Distributions */ 293*0f4c859eSApple OSS Distributions 294*0f4c859eSApple OSS Distributions #define KERN_RPC_CONTINUE_ORPHAN 45 295*0f4c859eSApple OSS Distributions /* Allow an orphaned activation to continue executing. 296*0f4c859eSApple OSS Distributions */ 297*0f4c859eSApple OSS Distributions 298*0f4c859eSApple OSS Distributions #define KERN_NOT_SUPPORTED 46 299*0f4c859eSApple OSS Distributions /* Empty thread activation (No thread linked to it) 300*0f4c859eSApple OSS Distributions */ 301*0f4c859eSApple OSS Distributions 302*0f4c859eSApple OSS Distributions #define KERN_NODE_DOWN 47 303*0f4c859eSApple OSS Distributions /* Remote node down or inaccessible. 304*0f4c859eSApple OSS Distributions */ 305*0f4c859eSApple OSS Distributions 306*0f4c859eSApple OSS Distributions #define KERN_NOT_WAITING 48 307*0f4c859eSApple OSS Distributions /* A signalled thread was not actually waiting. */ 308*0f4c859eSApple OSS Distributions 309*0f4c859eSApple OSS Distributions #define KERN_OPERATION_TIMED_OUT 49 310*0f4c859eSApple OSS Distributions /* Some thread-oriented operation (semaphore_wait) timed out 311*0f4c859eSApple OSS Distributions */ 312*0f4c859eSApple OSS Distributions 313*0f4c859eSApple OSS Distributions #define KERN_CODESIGN_ERROR 50 314*0f4c859eSApple OSS Distributions /* During a page fault, indicates that the page was rejected 315*0f4c859eSApple OSS Distributions * as a result of a signature check. 316*0f4c859eSApple OSS Distributions */ 317*0f4c859eSApple OSS Distributions 318*0f4c859eSApple OSS Distributions #define KERN_POLICY_STATIC 51 319*0f4c859eSApple OSS Distributions /* The requested property cannot be changed at this time. 320*0f4c859eSApple OSS Distributions */ 321*0f4c859eSApple OSS Distributions 322*0f4c859eSApple OSS Distributions #define KERN_INSUFFICIENT_BUFFER_SIZE 52 323*0f4c859eSApple OSS Distributions /* The provided buffer is of insufficient size for the requested data. 324*0f4c859eSApple OSS Distributions */ 325*0f4c859eSApple OSS Distributions 326*0f4c859eSApple OSS Distributions #define KERN_DENIED 53 327*0f4c859eSApple OSS Distributions /* Denied by security policy 328*0f4c859eSApple OSS Distributions */ 329*0f4c859eSApple OSS Distributions 330*0f4c859eSApple OSS Distributions #define KERN_MISSING_KC 54 331*0f4c859eSApple OSS Distributions /* The KC on which the function is operating is missing 332*0f4c859eSApple OSS Distributions */ 333*0f4c859eSApple OSS Distributions 334*0f4c859eSApple OSS Distributions #define KERN_INVALID_KC 55 335*0f4c859eSApple OSS Distributions /* The KC on which the function is operating is invalid 336*0f4c859eSApple OSS Distributions */ 337*0f4c859eSApple OSS Distributions 338*0f4c859eSApple OSS Distributions #define KERN_NOT_FOUND 56 339*0f4c859eSApple OSS Distributions /* A search or query operation did not return a result 340*0f4c859eSApple OSS Distributions */ 341*0f4c859eSApple OSS Distributions 342*0f4c859eSApple OSS Distributions #define KERN_RETURN_MAX 0x100 343*0f4c859eSApple OSS Distributions /* Maximum return value allowable 344*0f4c859eSApple OSS Distributions */ 345*0f4c859eSApple OSS Distributions 346*0f4c859eSApple OSS Distributions #endif /* _MACH_KERN_RETURN_H_ */ 347