]> git.saurik.com Git - apple/xnu.git/blob - libkern/libkern/OSReturn.h
xnu-344.49.tar.gz
[apple/xnu.git] / libkern / libkern / OSReturn.h
1 /*
2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
6 * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved.
7 *
8 * This file contains Original Code and/or Modifications of Original Code
9 * as defined in and that are subject to the Apple Public Source License
10 * Version 2.0 (the 'License'). You may not use this file except in
11 * compliance with the License. Please obtain a copy of the License at
12 * http://www.opensource.apple.com/apsl/ and read it before using this
13 * file.
14 *
15 * The Original Code and all software distributed under the License are
16 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
17 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
18 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
20 * Please see the License for the specific language governing rights and
21 * limitations under the License.
22 *
23 * @APPLE_LICENSE_HEADER_END@
24 */
25 /*
26 * Copyright (c) 1998 Apple Computer, Inc. All rights reserved.
27 *
28 * HISTORY
29 *
30 */
31
32 /*
33 * Core IOReturn values. Others may be family defined.
34 */
35
36 #ifndef __LIBKERN_OSRETURN_H
37 #define __LIBKERN_OSRETURN_H
38
39 #include <sys/cdefs.h>
40
41 __BEGIN_DECLS
42
43 #include <mach/error.h>
44
45 typedef kern_return_t OSReturn;
46
47 #ifndef sys_libkern
48 #define sys_libkern err_system(0x37)
49 #endif /* sys_libkern */
50
51 #define sub_libkern_common err_sub(0)
52 #define sub_libkern_metaclass err_sub(1)
53 #define sub_libkern_reserved err_sub(-1)
54
55 #define libkern_common_err(return) \
56 (sys_libkern|sub_libkern_common|(return))
57 #define libkern_metaclass_err(return) \
58 (sys_libkern|sub_libkern_metaclass|(return))
59
60 #define kOSReturnSuccess KERN_SUCCESS // OK
61 #define kOSReturnError libkern_common_err(1) // general error
62
63
64 // OSMetaClass subsystem error's
65 #define kOSMetaClassInternal libkern_metaclass_err(1) // runtime internal error
66 #define kOSMetaClassHasInstances libkern_metaclass_err(2) // Can't unload outstanding instances
67 #define kOSMetaClassNoInit libkern_metaclass_err(3) // kmodInitializeLoad wasn't called, runtime internal error
68 #define kOSMetaClassNoTempData libkern_metaclass_err(4) // Allocation failure internal data
69 #define kOSMetaClassNoDicts libkern_metaclass_err(5) // Allocation failure for Metaclass internal dictionaries
70 #define kOSMetaClassNoKModSet libkern_metaclass_err(6) // Allocation failure for internal kmodule set
71 #define kOSMetaClassNoInsKModSet libkern_metaclass_err(7) // Can't insert the KMod set into the module dictionary
72 #define kOSMetaClassNoSuper libkern_metaclass_err(8) // Can't associate a class with its super class
73 #define kOSMetaClassInstNoSuper libkern_metaclass_err(9) // During instance construction can't find a super class
74 #define kOSMetaClassDuplicateClass libkern_metaclass_err(10) // Found class duplicate during module load
75
76 __END_DECLS
77
78 #endif /* ! __LIBKERN_OSRETURN_H */