]> git.saurik.com Git - apple/xnu.git/blob - libsyscall/mach/error_codes.c
xnu-4903.241.1.tar.gz
[apple/xnu.git] / libsyscall / mach / error_codes.c
1 /*
2 * Copyright (c) 2003-2010 Apple 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 * @OSF_COPYRIGHT@
30 */
31 /*
32 * Mach Operating System
33 * Copyright (c) 1991,1990,1989 Carnegie Mellon University
34 * All Rights Reserved.
35 *
36 * Permission to use, copy, modify and distribute this software and its
37 * documentation is hereby granted, provided that both the copyright
38 * notice and this permission notice appear in all copies of the
39 * software, derivative works or modified versions, and any portions
40 * thereof, and that both notices appear in supporting documentation.
41 *
42 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS
43 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
44 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
45 *
46 * Carnegie Mellon requests users of this software to return to
47 *
48 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
49 * School of Computer Science
50 * Carnegie Mellon University
51 * Pittsburgh PA 15213-3890
52 *
53 * any improvements or extensions that they make and grant Carnegie the
54 * rights to redistribute these changes.
55 */
56
57 /*
58 * File: error_codes.c
59 * Author: Douglas Orr, Carnegie Mellon University
60 * Date: Mar, 1988
61 *
62 * Generic error code interface
63 */
64
65 #include <mach/error.h>
66 #include "errorlib.h"
67 #include "err_libkern.sub"
68 #include "err_iokit.sub"
69 #include "err_ipc.sub"
70 #include "err_kern.sub"
71 #include "err_mach_ipc.sub"
72 #include "err_server.sub"
73 #include "err_us.sub"
74
75 const struct error_system _mach_errors[err_max_system+1] = {
76 /* 0; err_kern */
77 {
78 errlib_count(err_os_sub),
79 "(operating system/?) unknown subsystem error",
80 err_os_sub,
81 },
82 /* 1; err_us */
83 {
84 errlib_count(err_us_sub),
85 "(user space/?) unknown subsystem error",
86 err_us_sub,
87 },
88 /* 2; err_server */
89 {
90 errlib_count(err_server_sub),
91 "(server/?) unknown subsystem error",
92 err_server_sub,
93 },
94 /* 3 (& 3f); err_ipc */
95 {
96 errlib_count(err_ipc_sub),
97 "(ipc/?) unknown subsystem error",
98 err_ipc_sub,
99 },
100 /* 4; err_mach_ipc */
101 {
102 errlib_count(err_mach_ipc_sub),
103 "(ipc/?) unknown subsystem error",
104 err_mach_ipc_sub,
105 },
106
107 /* 0x05 */ errorlib_system_null,
108 /* 0x06 */ errorlib_system_null, /* 0x07 */ errorlib_system_null,
109 /* 0x08 */ errorlib_system_null, /* 0x09 */ errorlib_system_null,
110 /* 0x0a */ errorlib_system_null, /* 0x0b */ errorlib_system_null,
111 /* 0x0c */ errorlib_system_null, /* 0x0d */ errorlib_system_null,
112 /* 0x0e */ errorlib_system_null, /* 0x0f */ errorlib_system_null,
113
114 /* 0x10 */ errorlib_system_null, /* 0x11 */ errorlib_system_null,
115 /* 0x12 */ errorlib_system_null, /* 0x13 */ errorlib_system_null,
116 /* 0x14 */ errorlib_system_null, /* 0x15 */ errorlib_system_null,
117 /* 0x16 */ errorlib_system_null, /* 0x17 */ errorlib_system_null,
118 /* 0x18 */ errorlib_system_null, /* 0x19 */ errorlib_system_null,
119 /* 0x1a */ errorlib_system_null, /* 0x1b */ errorlib_system_null,
120 /* 0x1c */ errorlib_system_null, /* 0x1d */ errorlib_system_null,
121 /* 0x1e */ errorlib_system_null, /* 0x1f */ errorlib_system_null,
122
123 /* 0x20 */ errorlib_system_null, /* 0x21 */ errorlib_system_null,
124 /* 0x22 */ errorlib_system_null, /* 0x23 */ errorlib_system_null,
125 /* 0x24 */ errorlib_system_null, /* 0x25 */ errorlib_system_null,
126 /* 0x26 */ errorlib_system_null, /* 0x27 */ errorlib_system_null,
127 /* 0x28 */ errorlib_system_null, /* 0x29 */ errorlib_system_null,
128 /* 0x2a */ errorlib_system_null, /* 0x2b */ errorlib_system_null,
129 /* 0x2c */ errorlib_system_null, /* 0x2d */ errorlib_system_null,
130 /* 0x2e */ errorlib_system_null, /* 0x2f */ errorlib_system_null,
131
132 /* 0x30 */ errorlib_system_null, /* 0x31 */ errorlib_system_null,
133 /* 0x32 */ errorlib_system_null, /* 0x33 */ errorlib_system_null,
134 /* 0x34 */ errorlib_system_null, /* 0x35 */ errorlib_system_null,
135 /* 0x36 */ errorlib_system_null,
136
137 /* 0x37; err_libkern */
138 {
139 errlib_count(err_libkern_sub),
140 "(libkern/?) unknown subsystem error",
141 err_libkern_sub,
142 },
143
144 /* 0x38; err_iokit */
145 {
146 errlib_count(err_iokit_sub),
147 "(iokit/?) unknown subsystem error",
148 err_iokit_sub,
149 err_iokit_sub_map,
150 errlib_count(err_iokit_sub_map)
151 },
152
153 /* 0x39 */ errorlib_system_null,
154 /* 0x3a */ errorlib_system_null, /* 0x3b */ errorlib_system_null,
155 /* 0x3c */ errorlib_system_null, /* 0x3d */ errorlib_system_null,
156 /* 0x3e */ errorlib_system_null, /* 0x3f */ errorlib_system_null,
157 };
158
159 // int error_system_count = errlib_count(_mach_errors);