acexcep.h 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301
  1. /******************************************************************************
  2. *
  3. * Name: acexcep.h - Exception codes returned by the ACPI subsystem
  4. *
  5. *****************************************************************************/
  6. /*
  7. * Copyright (C) 2000 - 2011, Intel Corp.
  8. * All rights reserved.
  9. *
  10. * Redistribution and use in source and binary forms, with or without
  11. * modification, are permitted provided that the following conditions
  12. * are met:
  13. * 1. Redistributions of source code must retain the above copyright
  14. * notice, this list of conditions, and the following disclaimer,
  15. * without modification.
  16. * 2. Redistributions in binary form must reproduce at minimum a disclaimer
  17. * substantially similar to the "NO WARRANTY" disclaimer below
  18. * ("Disclaimer") and any redistribution must be conditioned upon
  19. * including a substantially similar Disclaimer requirement for further
  20. * binary redistribution.
  21. * 3. Neither the names of the above-listed copyright holders nor the names
  22. * of any contributors may be used to endorse or promote products derived
  23. * from this software without specific prior written permission.
  24. *
  25. * Alternatively, this software may be distributed under the terms of the
  26. * GNU General Public License ("GPL") version 2 as published by the Free
  27. * Software Foundation.
  28. *
  29. * NO WARRANTY
  30. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  31. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  32. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
  33. * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  34. * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  35. * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  36. * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  37. * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
  38. * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
  39. * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  40. * POSSIBILITY OF SUCH DAMAGES.
  41. */
  42. #ifndef __ACEXCEP_H__
  43. #define __ACEXCEP_H__
  44. /*
  45. * Exceptions returned by external ACPI interfaces
  46. */
  47. #define AE_CODE_ENVIRONMENTAL 0x0000
  48. #define AE_CODE_PROGRAMMER 0x1000
  49. #define AE_CODE_ACPI_TABLES 0x2000
  50. #define AE_CODE_AML 0x3000
  51. #define AE_CODE_CONTROL 0x4000
  52. #define AE_CODE_MASK 0xF000
  53. #define ACPI_SUCCESS(a) (!(a))
  54. #define ACPI_FAILURE(a) (a)
  55. #define ACPI_SKIP(a) (a == AE_CTRL_SKIP)
  56. #define AE_OK (acpi_status) 0x0000
  57. /*
  58. * Environmental exceptions
  59. */
  60. #define AE_ERROR (acpi_status) (0x0001 | AE_CODE_ENVIRONMENTAL)
  61. #define AE_NO_ACPI_TABLES (acpi_status) (0x0002 | AE_CODE_ENVIRONMENTAL)
  62. #define AE_NO_NAMESPACE (acpi_status) (0x0003 | AE_CODE_ENVIRONMENTAL)
  63. #define AE_NO_MEMORY (acpi_status) (0x0004 | AE_CODE_ENVIRONMENTAL)
  64. #define AE_NOT_FOUND (acpi_status) (0x0005 | AE_CODE_ENVIRONMENTAL)
  65. #define AE_NOT_EXIST (acpi_status) (0x0006 | AE_CODE_ENVIRONMENTAL)
  66. #define AE_ALREADY_EXISTS (acpi_status) (0x0007 | AE_CODE_ENVIRONMENTAL)
  67. #define AE_TYPE (acpi_status) (0x0008 | AE_CODE_ENVIRONMENTAL)
  68. #define AE_NULL_OBJECT (acpi_status) (0x0009 | AE_CODE_ENVIRONMENTAL)
  69. #define AE_NULL_ENTRY (acpi_status) (0x000A | AE_CODE_ENVIRONMENTAL)
  70. #define AE_BUFFER_OVERFLOW (acpi_status) (0x000B | AE_CODE_ENVIRONMENTAL)
  71. #define AE_STACK_OVERFLOW (acpi_status) (0x000C | AE_CODE_ENVIRONMENTAL)
  72. #define AE_STACK_UNDERFLOW (acpi_status) (0x000D | AE_CODE_ENVIRONMENTAL)
  73. #define AE_NOT_IMPLEMENTED (acpi_status) (0x000E | AE_CODE_ENVIRONMENTAL)
  74. #define AE_SUPPORT (acpi_status) (0x000F | AE_CODE_ENVIRONMENTAL)
  75. #define AE_LIMIT (acpi_status) (0x0010 | AE_CODE_ENVIRONMENTAL)
  76. #define AE_TIME (acpi_status) (0x0011 | AE_CODE_ENVIRONMENTAL)
  77. #define AE_ACQUIRE_DEADLOCK (acpi_status) (0x0012 | AE_CODE_ENVIRONMENTAL)
  78. #define AE_RELEASE_DEADLOCK (acpi_status) (0x0013 | AE_CODE_ENVIRONMENTAL)
  79. #define AE_NOT_ACQUIRED (acpi_status) (0x0014 | AE_CODE_ENVIRONMENTAL)
  80. #define AE_ALREADY_ACQUIRED (acpi_status) (0x0015 | AE_CODE_ENVIRONMENTAL)
  81. #define AE_NO_HARDWARE_RESPONSE (acpi_status) (0x0016 | AE_CODE_ENVIRONMENTAL)
  82. #define AE_NO_GLOBAL_LOCK (acpi_status) (0x0017 | AE_CODE_ENVIRONMENTAL)
  83. #define AE_ABORT_METHOD (acpi_status) (0x0018 | AE_CODE_ENVIRONMENTAL)
  84. #define AE_SAME_HANDLER (acpi_status) (0x0019 | AE_CODE_ENVIRONMENTAL)
  85. #define AE_NO_HANDLER (acpi_status) (0x001A | AE_CODE_ENVIRONMENTAL)
  86. #define AE_OWNER_ID_LIMIT (acpi_status) (0x001B | AE_CODE_ENVIRONMENTAL)
  87. #define AE_NOT_CONFIGURED (acpi_status) (0x001C | AE_CODE_ENVIRONMENTAL)
  88. #define AE_CODE_ENV_MAX 0x001C
  89. /*
  90. * Programmer exceptions
  91. */
  92. #define AE_BAD_PARAMETER (acpi_status) (0x0001 | AE_CODE_PROGRAMMER)
  93. #define AE_BAD_CHARACTER (acpi_status) (0x0002 | AE_CODE_PROGRAMMER)
  94. #define AE_BAD_PATHNAME (acpi_status) (0x0003 | AE_CODE_PROGRAMMER)
  95. #define AE_BAD_DATA (acpi_status) (0x0004 | AE_CODE_PROGRAMMER)
  96. #define AE_BAD_HEX_CONSTANT (acpi_status) (0x0005 | AE_CODE_PROGRAMMER)
  97. #define AE_BAD_OCTAL_CONSTANT (acpi_status) (0x0006 | AE_CODE_PROGRAMMER)
  98. #define AE_BAD_DECIMAL_CONSTANT (acpi_status) (0x0007 | AE_CODE_PROGRAMMER)
  99. #define AE_MISSING_ARGUMENTS (acpi_status) (0x0008 | AE_CODE_PROGRAMMER)
  100. #define AE_BAD_ADDRESS (acpi_status) (0x0009 | AE_CODE_PROGRAMMER)
  101. #define AE_CODE_PGM_MAX 0x0009
  102. /*
  103. * Acpi table exceptions
  104. */
  105. #define AE_BAD_SIGNATURE (acpi_status) (0x0001 | AE_CODE_ACPI_TABLES)
  106. #define AE_BAD_HEADER (acpi_status) (0x0002 | AE_CODE_ACPI_TABLES)
  107. #define AE_BAD_CHECKSUM (acpi_status) (0x0003 | AE_CODE_ACPI_TABLES)
  108. #define AE_BAD_VALUE (acpi_status) (0x0004 | AE_CODE_ACPI_TABLES)
  109. #define AE_INVALID_TABLE_LENGTH (acpi_status) (0x0005 | AE_CODE_ACPI_TABLES)
  110. #define AE_CODE_TBL_MAX 0x0005
  111. /*
  112. * AML exceptions. These are caused by problems with
  113. * the actual AML byte stream
  114. */
  115. #define AE_AML_BAD_OPCODE (acpi_status) (0x0001 | AE_CODE_AML)
  116. #define AE_AML_NO_OPERAND (acpi_status) (0x0002 | AE_CODE_AML)
  117. #define AE_AML_OPERAND_TYPE (acpi_status) (0x0003 | AE_CODE_AML)
  118. #define AE_AML_OPERAND_VALUE (acpi_status) (0x0004 | AE_CODE_AML)
  119. #define AE_AML_UNINITIALIZED_LOCAL (acpi_status) (0x0005 | AE_CODE_AML)
  120. #define AE_AML_UNINITIALIZED_ARG (acpi_status) (0x0006 | AE_CODE_AML)
  121. #define AE_AML_UNINITIALIZED_ELEMENT (acpi_status) (0x0007 | AE_CODE_AML)
  122. #define AE_AML_NUMERIC_OVERFLOW (acpi_status) (0x0008 | AE_CODE_AML)
  123. #define AE_AML_REGION_LIMIT (acpi_status) (0x0009 | AE_CODE_AML)
  124. #define AE_AML_BUFFER_LIMIT (acpi_status) (0x000A | AE_CODE_AML)
  125. #define AE_AML_PACKAGE_LIMIT (acpi_status) (0x000B | AE_CODE_AML)
  126. #define AE_AML_DIVIDE_BY_ZERO (acpi_status) (0x000C | AE_CODE_AML)
  127. #define AE_AML_BAD_NAME (acpi_status) (0x000D | AE_CODE_AML)
  128. #define AE_AML_NAME_NOT_FOUND (acpi_status) (0x000E | AE_CODE_AML)
  129. #define AE_AML_INTERNAL (acpi_status) (0x000F | AE_CODE_AML)
  130. #define AE_AML_INVALID_SPACE_ID (acpi_status) (0x0010 | AE_CODE_AML)
  131. #define AE_AML_STRING_LIMIT (acpi_status) (0x0011 | AE_CODE_AML)
  132. #define AE_AML_NO_RETURN_VALUE (acpi_status) (0x0012 | AE_CODE_AML)
  133. #define AE_AML_METHOD_LIMIT (acpi_status) (0x0013 | AE_CODE_AML)
  134. #define AE_AML_NOT_OWNER (acpi_status) (0x0014 | AE_CODE_AML)
  135. #define AE_AML_MUTEX_ORDER (acpi_status) (0x0015 | AE_CODE_AML)
  136. #define AE_AML_MUTEX_NOT_ACQUIRED (acpi_status) (0x0016 | AE_CODE_AML)
  137. #define AE_AML_INVALID_RESOURCE_TYPE (acpi_status) (0x0017 | AE_CODE_AML)
  138. #define AE_AML_INVALID_INDEX (acpi_status) (0x0018 | AE_CODE_AML)
  139. #define AE_AML_REGISTER_LIMIT (acpi_status) (0x0019 | AE_CODE_AML)
  140. #define AE_AML_NO_WHILE (acpi_status) (0x001A | AE_CODE_AML)
  141. #define AE_AML_ALIGNMENT (acpi_status) (0x001B | AE_CODE_AML)
  142. #define AE_AML_NO_RESOURCE_END_TAG (acpi_status) (0x001C | AE_CODE_AML)
  143. #define AE_AML_BAD_RESOURCE_VALUE (acpi_status) (0x001D | AE_CODE_AML)
  144. #define AE_AML_CIRCULAR_REFERENCE (acpi_status) (0x001E | AE_CODE_AML)
  145. #define AE_AML_BAD_RESOURCE_LENGTH (acpi_status) (0x001F | AE_CODE_AML)
  146. #define AE_AML_ILLEGAL_ADDRESS (acpi_status) (0x0020 | AE_CODE_AML)
  147. #define AE_AML_INFINITE_LOOP (acpi_status) (0x0021 | AE_CODE_AML)
  148. #define AE_CODE_AML_MAX 0x0021
  149. /*
  150. * Internal exceptions used for control
  151. */
  152. #define AE_CTRL_RETURN_VALUE (acpi_status) (0x0001 | AE_CODE_CONTROL)
  153. #define AE_CTRL_PENDING (acpi_status) (0x0002 | AE_CODE_CONTROL)
  154. #define AE_CTRL_TERMINATE (acpi_status) (0x0003 | AE_CODE_CONTROL)
  155. #define AE_CTRL_TRUE (acpi_status) (0x0004 | AE_CODE_CONTROL)
  156. #define AE_CTRL_FALSE (acpi_status) (0x0005 | AE_CODE_CONTROL)
  157. #define AE_CTRL_DEPTH (acpi_status) (0x0006 | AE_CODE_CONTROL)
  158. #define AE_CTRL_END (acpi_status) (0x0007 | AE_CODE_CONTROL)
  159. #define AE_CTRL_TRANSFER (acpi_status) (0x0008 | AE_CODE_CONTROL)
  160. #define AE_CTRL_BREAK (acpi_status) (0x0009 | AE_CODE_CONTROL)
  161. #define AE_CTRL_CONTINUE (acpi_status) (0x000A | AE_CODE_CONTROL)
  162. #define AE_CTRL_SKIP (acpi_status) (0x000B | AE_CODE_CONTROL)
  163. #define AE_CTRL_PARSE_CONTINUE (acpi_status) (0x000C | AE_CODE_CONTROL)
  164. #define AE_CTRL_PARSE_PENDING (acpi_status) (0x000D | AE_CODE_CONTROL)
  165. #define AE_CODE_CTRL_MAX 0x000D
  166. /* Exception strings for acpi_format_exception */
  167. #ifdef DEFINE_ACPI_GLOBALS
  168. /*
  169. * String versions of the exception codes above
  170. * These strings must match the corresponding defines exactly
  171. */
  172. char const *acpi_gbl_exception_names_env[] = {
  173. "AE_OK",
  174. "AE_ERROR",
  175. "AE_NO_ACPI_TABLES",
  176. "AE_NO_NAMESPACE",
  177. "AE_NO_MEMORY",
  178. "AE_NOT_FOUND",
  179. "AE_NOT_EXIST",
  180. "AE_ALREADY_EXISTS",
  181. "AE_TYPE",
  182. "AE_NULL_OBJECT",
  183. "AE_NULL_ENTRY",
  184. "AE_BUFFER_OVERFLOW",
  185. "AE_STACK_OVERFLOW",
  186. "AE_STACK_UNDERFLOW",
  187. "AE_NOT_IMPLEMENTED",
  188. "AE_SUPPORT",
  189. "AE_LIMIT",
  190. "AE_TIME",
  191. "AE_ACQUIRE_DEADLOCK",
  192. "AE_RELEASE_DEADLOCK",
  193. "AE_NOT_ACQUIRED",
  194. "AE_ALREADY_ACQUIRED",
  195. "AE_NO_HARDWARE_RESPONSE",
  196. "AE_NO_GLOBAL_LOCK",
  197. "AE_ABORT_METHOD",
  198. "AE_SAME_HANDLER",
  199. "AE_NO_HANDLER",
  200. "AE_OWNER_ID_LIMIT",
  201. "AE_NOT_CONFIGURED"
  202. };
  203. char const *acpi_gbl_exception_names_pgm[] = {
  204. NULL,
  205. "AE_BAD_PARAMETER",
  206. "AE_BAD_CHARACTER",
  207. "AE_BAD_PATHNAME",
  208. "AE_BAD_DATA",
  209. "AE_BAD_HEX_CONSTANT",
  210. "AE_BAD_OCTAL_CONSTANT",
  211. "AE_BAD_DECIMAL_CONSTANT",
  212. "AE_MISSING_ARGUMENTS",
  213. "AE_BAD_ADDRESS"
  214. };
  215. char const *acpi_gbl_exception_names_tbl[] = {
  216. NULL,
  217. "AE_BAD_SIGNATURE",
  218. "AE_BAD_HEADER",
  219. "AE_BAD_CHECKSUM",
  220. "AE_BAD_VALUE",
  221. "AE_INVALID_TABLE_LENGTH"
  222. };
  223. char const *acpi_gbl_exception_names_aml[] = {
  224. NULL,
  225. "AE_AML_BAD_OPCODE",
  226. "AE_AML_NO_OPERAND",
  227. "AE_AML_OPERAND_TYPE",
  228. "AE_AML_OPERAND_VALUE",
  229. "AE_AML_UNINITIALIZED_LOCAL",
  230. "AE_AML_UNINITIALIZED_ARG",
  231. "AE_AML_UNINITIALIZED_ELEMENT",
  232. "AE_AML_NUMERIC_OVERFLOW",
  233. "AE_AML_REGION_LIMIT",
  234. "AE_AML_BUFFER_LIMIT",
  235. "AE_AML_PACKAGE_LIMIT",
  236. "AE_AML_DIVIDE_BY_ZERO",
  237. "AE_AML_BAD_NAME",
  238. "AE_AML_NAME_NOT_FOUND",
  239. "AE_AML_INTERNAL",
  240. "AE_AML_INVALID_SPACE_ID",
  241. "AE_AML_STRING_LIMIT",
  242. "AE_AML_NO_RETURN_VALUE",
  243. "AE_AML_METHOD_LIMIT",
  244. "AE_AML_NOT_OWNER",
  245. "AE_AML_MUTEX_ORDER",
  246. "AE_AML_MUTEX_NOT_ACQUIRED",
  247. "AE_AML_INVALID_RESOURCE_TYPE",
  248. "AE_AML_INVALID_INDEX",
  249. "AE_AML_REGISTER_LIMIT",
  250. "AE_AML_NO_WHILE",
  251. "AE_AML_ALIGNMENT",
  252. "AE_AML_NO_RESOURCE_END_TAG",
  253. "AE_AML_BAD_RESOURCE_VALUE",
  254. "AE_AML_CIRCULAR_REFERENCE",
  255. "AE_AML_BAD_RESOURCE_LENGTH",
  256. "AE_AML_ILLEGAL_ADDRESS",
  257. "AE_AML_INFINITE_LOOP"
  258. };
  259. char const *acpi_gbl_exception_names_ctrl[] = {
  260. NULL,
  261. "AE_CTRL_RETURN_VALUE",
  262. "AE_CTRL_PENDING",
  263. "AE_CTRL_TERMINATE",
  264. "AE_CTRL_TRUE",
  265. "AE_CTRL_FALSE",
  266. "AE_CTRL_DEPTH",
  267. "AE_CTRL_END",
  268. "AE_CTRL_TRANSFER",
  269. "AE_CTRL_BREAK",
  270. "AE_CTRL_CONTINUE",
  271. "AE_CTRL_SKIP",
  272. "AE_CTRL_PARSE_CONTINUE",
  273. "AE_CTRL_PARSE_PENDING"
  274. };
  275. #endif /* ACPI GLOBALS */
  276. #endif /* __ACEXCEP_H__ */