]> git.saurik.com Git - apple/xnu.git/blob - libkern/libkern/OSReturn.h
ace65fcc06022f3d994a92ddb8f787e68045322d
[apple/xnu.git] / libkern / libkern / OSReturn.h
1 /*
2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
5 *
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.
14 *
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
17 *
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.
25 *
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
27 */
28 /*
29 * Copyright (c) 1998 Apple Computer, Inc. All rights reserved.
30 *
31 * HISTORY
32 *
33 */
34
35 /*
36 * Core IOReturn values. Others may be family defined.
37 */
38
39 #ifndef __LIBKERN_OSRETURN_H
40 #define __LIBKERN_OSRETURN_H
41
42 #include <sys/cdefs.h>
43
44 __BEGIN_DECLS
45
46 #include <mach/error.h>
47
48 typedef kern_return_t OSReturn;
49
50 #ifndef sys_libkern
51 #define sys_libkern err_system(0x37)
52 #endif /* sys_libkern */
53
54 #define sub_libkern_common err_sub(0)
55 #define sub_libkern_metaclass err_sub(1)
56 #define sub_libkern_reserved err_sub(-1)
57
58 #define libkern_common_err(return) \
59 (sys_libkern|sub_libkern_common|(return))
60 #define libkern_metaclass_err(return) \
61 (sys_libkern|sub_libkern_metaclass|(return))
62
63 #define kOSReturnSuccess KERN_SUCCESS // OK
64 #define kOSReturnError libkern_common_err(1) // general error
65
66
67 // OSMetaClass subsystem error's
68 #define kOSMetaClassInternal libkern_metaclass_err(1) // runtime internal error
69 #define kOSMetaClassHasInstances libkern_metaclass_err(2) // Can't unload outstanding instances
70 #define kOSMetaClassNoInit libkern_metaclass_err(3) // kmodInitializeLoad wasn't called, runtime internal error
71 #define kOSMetaClassNoTempData libkern_metaclass_err(4) // Allocation failure internal data
72 #define kOSMetaClassNoDicts libkern_metaclass_err(5) // Allocation failure for Metaclass internal dictionaries
73 #define kOSMetaClassNoKModSet libkern_metaclass_err(6) // Allocation failure for internal kmodule set
74 #define kOSMetaClassNoInsKModSet libkern_metaclass_err(7) // Can't insert the KMod set into the module dictionary
75 #define kOSMetaClassNoSuper libkern_metaclass_err(8) // Can't associate a class with its super class
76 #define kOSMetaClassInstNoSuper libkern_metaclass_err(9) // During instance construction can't find a super class
77 #define kOSMetaClassDuplicateClass libkern_metaclass_err(10) // Found class duplicate during module load
78
79 __END_DECLS
80
81 #endif /* ! __LIBKERN_OSRETURN_H */