]> git.saurik.com Git - apple/xnu.git/blame - libsyscall/mach/error_codes.c
xnu-7195.81.3.tar.gz
[apple/xnu.git] / libsyscall / mach / error_codes.c
CommitLineData
2d21ac55 1/*
cb323159 2 * Copyright (c) 2003-2019 Apple Inc. All rights reserved.
2d21ac55
A
3 *
4 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
0a7de745 5 *
2d21ac55
A
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.
0a7de745 14 *
2d21ac55
A
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
0a7de745 17 *
2d21ac55
A
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.
0a7de745 25 *
2d21ac55
A
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
27 */
28/*
29 * @OSF_COPYRIGHT@
30 */
0a7de745 31/*
2d21ac55
A
32 * Mach Operating System
33 * Copyright (c) 1991,1990,1989 Carnegie Mellon University
34 * All Rights Reserved.
0a7de745 35 *
2d21ac55
A
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.
0a7de745
A
41 *
42 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS
2d21ac55
A
43 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
44 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
0a7de745 45 *
2d21ac55 46 * Carnegie Mellon requests users of this software to return to
0a7de745 47 *
2d21ac55
A
48 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
49 * School of Computer Science
50 * Carnegie Mellon University
51 * Pittsburgh PA 15213-3890
0a7de745 52 *
2d21ac55
A
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
cb323159 65#include <TargetConditionals.h>
2d21ac55
A
66#include <mach/error.h>
67#include "errorlib.h"
cb323159 68#if !TARGET_OS_DRIVERKIT
b0d623f7 69#include "err_libkern.sub"
2d21ac55 70#include "err_iokit.sub"
cb323159 71#endif // !TARGET_OS_DRIVERKIT
2d21ac55
A
72#include "err_ipc.sub"
73#include "err_kern.sub"
74#include "err_mach_ipc.sub"
75#include "err_server.sub"
76#include "err_us.sub"
77
0a7de745 78const struct error_system _mach_errors[err_max_system + 1] = {
2d21ac55
A
79 /* 0; err_kern */
80 {
cb323159
A
81 .max_sub = errlib_count(err_os_sub),
82 .bad_sub = "(operating system/?) unknown subsystem error",
83 .subsystem = err_os_sub,
2d21ac55
A
84 },
85 /* 1; err_us */
86 {
cb323159
A
87 .max_sub = errlib_count(err_us_sub),
88 .bad_sub = "(user space/?) unknown subsystem error",
89 .subsystem = err_us_sub,
2d21ac55
A
90 },
91 /* 2; err_server */
92 {
cb323159
A
93 .max_sub = errlib_count(err_server_sub),
94 .bad_sub = "(server/?) unknown subsystem error",
95 .subsystem = err_server_sub,
2d21ac55
A
96 },
97 /* 3 (& 3f); err_ipc */
98 {
cb323159
A
99 .max_sub = errlib_count(err_ipc_sub),
100 .bad_sub = "(ipc/?) unknown subsystem error",
101 .subsystem = err_ipc_sub,
2d21ac55
A
102 },
103 /* 4; err_mach_ipc */
104 {
cb323159
A
105 .max_sub = errlib_count(err_mach_ipc_sub),
106 .bad_sub = "(ipc/?) unknown subsystem error",
107 .subsystem = err_mach_ipc_sub,
2d21ac55
A
108 },
109
110 /* 0x05 */ errorlib_system_null,
111 /* 0x06 */ errorlib_system_null, /* 0x07 */ errorlib_system_null,
112 /* 0x08 */ errorlib_system_null, /* 0x09 */ errorlib_system_null,
113 /* 0x0a */ errorlib_system_null, /* 0x0b */ errorlib_system_null,
114 /* 0x0c */ errorlib_system_null, /* 0x0d */ errorlib_system_null,
115 /* 0x0e */ errorlib_system_null, /* 0x0f */ errorlib_system_null,
116
117 /* 0x10 */ errorlib_system_null, /* 0x11 */ errorlib_system_null,
118 /* 0x12 */ errorlib_system_null, /* 0x13 */ errorlib_system_null,
119 /* 0x14 */ errorlib_system_null, /* 0x15 */ errorlib_system_null,
120 /* 0x16 */ errorlib_system_null, /* 0x17 */ errorlib_system_null,
121 /* 0x18 */ errorlib_system_null, /* 0x19 */ errorlib_system_null,
122 /* 0x1a */ errorlib_system_null, /* 0x1b */ errorlib_system_null,
123 /* 0x1c */ errorlib_system_null, /* 0x1d */ errorlib_system_null,
124 /* 0x1e */ errorlib_system_null, /* 0x1f */ errorlib_system_null,
125
126 /* 0x20 */ errorlib_system_null, /* 0x21 */ errorlib_system_null,
127 /* 0x22 */ errorlib_system_null, /* 0x23 */ errorlib_system_null,
128 /* 0x24 */ errorlib_system_null, /* 0x25 */ errorlib_system_null,
129 /* 0x26 */ errorlib_system_null, /* 0x27 */ errorlib_system_null,
130 /* 0x28 */ errorlib_system_null, /* 0x29 */ errorlib_system_null,
131 /* 0x2a */ errorlib_system_null, /* 0x2b */ errorlib_system_null,
132 /* 0x2c */ errorlib_system_null, /* 0x2d */ errorlib_system_null,
133 /* 0x2e */ errorlib_system_null, /* 0x2f */ errorlib_system_null,
134
135 /* 0x30 */ errorlib_system_null, /* 0x31 */ errorlib_system_null,
136 /* 0x32 */ errorlib_system_null, /* 0x33 */ errorlib_system_null,
137 /* 0x34 */ errorlib_system_null, /* 0x35 */ errorlib_system_null,
b0d623f7
A
138 /* 0x36 */ errorlib_system_null,
139
cb323159 140#if !TARGET_OS_DRIVERKIT
b0d623f7
A
141 /* 0x37; err_libkern */
142 {
cb323159
A
143 .max_sub = errlib_count(err_libkern_sub),
144 .bad_sub = "(libkern/?) unknown subsystem error",
145 .subsystem = err_libkern_sub,
b0d623f7 146 },
2d21ac55
A
147
148 /* 0x38; err_iokit */
149 {
cb323159
A
150 .max_sub = errlib_count(err_iokit_sub),
151 .bad_sub = "(iokit/?) unknown subsystem error",
152 .subsystem = err_iokit_sub,
153 .map_table = err_iokit_sub_map,
154 .map_count = errlib_count(err_iokit_sub_map)
2d21ac55 155 },
cb323159
A
156#else
157 /* 0x37 */ errorlib_system_null, /* 0x38 */ errorlib_system_null,
158#endif // TARGET_OS_DRIVERKIT
2d21ac55 159
0a7de745 160 /* 0x39 */ errorlib_system_null,
2d21ac55
A
161 /* 0x3a */ errorlib_system_null, /* 0x3b */ errorlib_system_null,
162 /* 0x3c */ errorlib_system_null, /* 0x3d */ errorlib_system_null,
163 /* 0x3e */ errorlib_system_null, /* 0x3f */ errorlib_system_null,
164};
165
166// int error_system_count = errlib_count(_mach_errors);