1/*
2 * Copyright (c) 2008 Apple Inc. All rights reserved.
3 *
4 * @APPLE_OSREFERENCE_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_OSREFERENCE_LICENSE_HEADER_END@
21 */
22
23/*
24 *	File: 	err_libkern.sub
25 *	Author:	Nik Gervae, Apple Inc.
26 *	Date:	October 2008
27 *
28 *	error codes for Libkern/C++
29 */
30
31#include <libkern/OSReturn.h>
32#include <libkern/OSKextLib.h>
33
34
35/* These codes are specified in decimal in OSReturn.h.
36 */
37static const char * const err_codes_libkern_common[] = {
38	NO_SUCH_ERROR,
39	"(libkern/common) general/unspecified error",    /* 1 */
40};
41
42/* These codes are specified in decimal in OSReturn.h.
43 */
44static const char * const err_codes_libkern_metaclass[] = {
45	NO_SUCH_ERROR,
46	"(libkern/metaclass) runtime internal error",                                       /* 1 */
47	"(libkern/metaclass) class has instances",                                          /* 2 */
48	"(libkern/metaclass) OSMetaClass::preModLoad() not called, runtime internal error", /* 3 */
49	"(libkern/metaclass) allocation failure, internal data",                            /* 4 */
50	"(libkern/metaclass) allocation failure, class tracking dictionaries",              /* 5 */
51	"(libkern/metaclass) allocation failure, no kext/class set",                        /* 6 */
52	"(libkern/metaclass) failed to insert class into class dictionary",                 /* 7 */
53	"(libkern/metaclass) can't associate class with its superclass",                    /* 8 */
54	"(libkern/metaclass) can't find superclass during instance creation",               /* 9 */
55	"(libkern/metaclass) duplicate class name encountered",                             /* 10 */
56	"(libkern/metaclass) no kext for metaclass",                                        /* 11 */
57};
58
59/* These codes are specified in hexadecimal in OSKextLib.h.
60 */
61static const char * const err_codes_libkern_kext[] = {
62	NO_SUCH_ERROR,
63	"(libkern/kext) internal error",                                      /* 0x1 */
64	"(libkern/kext) allocation failure",                                  /* 0x2 */
65	"(libkern/kext) resource shortage",                                   /* 0x3 */
66	"(libkern/kext) not privileged",                                      /* 0x4 */
67	"(libkern/kext) invalid argument",                                    /* 0x5 */
68	"(libkern/kext) not found",                                           /* 0x6 */
69	"(libkern/kext) bad data (mkext/other)",                              /* 0x7 */
70	"(libkern/kext) XML (un)serialization error",                         /* 0x8 */
71	"(libkern/kext) function/version unsupported",                        /* 0x9 */
72	"(libkern/kext) function disabled",                                   /* 0xa */
73
74	"(libkern/kext) malformed kext (bundle layout/missing plist)",        /* 0xb */
75	"(libkern/kext) validation failure (plist/executable)",               /* 0xc */
76	"(libkern/kext) authentication failure (file ownership/permissions)", /* 0xd */
77	"(libkern/kext) dependency resolution failure",                       /* 0xe */
78	"(libkern/kext) requested architecture/executable not found",         /* 0xf */
79	"(libkern/kext) cache error",                                         /* 0x10 */
80
81	"(libkern/kext) operation deferred (queued to user space)",           /* 0x11 */
82	"(libkern/kext) operation/kext not allowed at current boot level",    /* 0x12 */
83	"(libkern/kext) not loadable (reason unspecified)",                   /* 0x13 */
84	"(libkern/kext) different version/uuid already loaded",               /* 0x14 */
85
86	"(libkern/kext) dependency load failed",                              /* 0x15 */
87	"(libkern/kext) link error",                                          /* 0x16 */
88	"(libkern/kext) kext (kmod) start/stop routine failed",               /* 0x17 */
89	"(libkern/kext) kext is in use or retained (cannot unload)",          /* 0x18 */
90	"(libkern/kext) kext request timed out",                              /* 0x19 */
91	"(libkern/kext) kext is stopping and cannot issue requests",          /* 0x1a */
92};
93
94/* libkern is err_system(0x37) */
95static const struct error_subsystem err_libkern_sub[] = {
96	/* subsystem 0 */
97    {
98        "(libkern/common)",
99        errlib_count(err_codes_libkern_common),
100        err_codes_libkern_common,
101	},
102
103	/* subsystem 1 */
104    {
105        "(libkern/metaclass)",
106        errlib_count(err_codes_libkern_metaclass),
107        err_codes_libkern_metaclass,
108	},
109
110	/* subsystem 2 */
111    {
112        "(libkern/kext)",
113        errlib_count(err_codes_libkern_kext),
114        err_codes_libkern_kext,
115	},
116};
117