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