acexcep.h
上传用户:jlfgdled
上传日期:2013-04-10
资源大小:33168k
文件大小:9k
源码类别:

Linux/Unix编程

开发平台:

Unix_Linux

  1. /******************************************************************************
  2.  *
  3.  * Name: acexcep.h - Exception codes returned by the ACPI subsystem
  4.  *       $Revision: 50 $
  5.  *
  6.  *****************************************************************************/
  7. /*
  8.  *  Copyright (C) 2000, 2001 R. Byron Moore
  9.  *
  10.  *  This program is free software; you can redistribute it and/or modify
  11.  *  it under the terms of the GNU General Public License as published by
  12.  *  the Free Software Foundation; either version 2 of the License, or
  13.  *  (at your option) any later version.
  14.  *
  15.  *  This program is distributed in the hope that it will be useful,
  16.  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
  17.  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  18.  *  GNU General Public License for more details.
  19.  *
  20.  *  You should have received a copy of the GNU General Public License
  21.  *  along with this program; if not, write to the Free Software
  22.  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  23.  */
  24. #ifndef __ACEXCEP_H__
  25. #define __ACEXCEP_H__
  26. /*
  27.  * Exceptions returned by external ACPI interfaces
  28.  */
  29. #define AE_CODE_ENVIRONMENTAL           0x0000
  30. #define AE_CODE_PROGRAMMER              0x1000
  31. #define AE_CODE_ACPI_TABLES             0x2000
  32. #define AE_CODE_AML                     0x3000
  33. #define AE_CODE_CONTROL                 0x4000
  34. #define AE_CODE_MASK                    0xF000
  35. #define ACPI_SUCCESS(a)                 (!(a))
  36. #define ACPI_FAILURE(a)                 (a)
  37. #define AE_OK                           (acpi_status) 0x0000
  38. /*
  39.  * Environmental exceptions
  40.  */
  41. #define AE_ERROR                        (acpi_status) (0x0001 | AE_CODE_ENVIRONMENTAL)
  42. #define AE_NO_ACPI_TABLES               (acpi_status) (0x0002 | AE_CODE_ENVIRONMENTAL)
  43. #define AE_NO_NAMESPACE                 (acpi_status) (0x0003 | AE_CODE_ENVIRONMENTAL)
  44. #define AE_NO_MEMORY                    (acpi_status) (0x0004 | AE_CODE_ENVIRONMENTAL)
  45. #define AE_NOT_FOUND                    (acpi_status) (0x0005 | AE_CODE_ENVIRONMENTAL)
  46. #define AE_NOT_EXIST                    (acpi_status) (0x0006 | AE_CODE_ENVIRONMENTAL)
  47. #define AE_EXIST                        (acpi_status) (0x0007 | AE_CODE_ENVIRONMENTAL)
  48. #define AE_TYPE                         (acpi_status) (0x0008 | AE_CODE_ENVIRONMENTAL)
  49. #define AE_NULL_OBJECT                  (acpi_status) (0x0009 | AE_CODE_ENVIRONMENTAL)
  50. #define AE_NULL_ENTRY                   (acpi_status) (0x000A | AE_CODE_ENVIRONMENTAL)
  51. #define AE_BUFFER_OVERFLOW              (acpi_status) (0x000B | AE_CODE_ENVIRONMENTAL)
  52. #define AE_STACK_OVERFLOW               (acpi_status) (0x000C | AE_CODE_ENVIRONMENTAL)
  53. #define AE_STACK_UNDERFLOW              (acpi_status) (0x000D | AE_CODE_ENVIRONMENTAL)
  54. #define AE_NOT_IMPLEMENTED              (acpi_status) (0x000E | AE_CODE_ENVIRONMENTAL)
  55. #define AE_VERSION_MISMATCH             (acpi_status) (0x000F | AE_CODE_ENVIRONMENTAL)
  56. #define AE_SUPPORT                      (acpi_status) (0x0010 | AE_CODE_ENVIRONMENTAL)
  57. #define AE_SHARE                        (acpi_status) (0x0011 | AE_CODE_ENVIRONMENTAL)
  58. #define AE_LIMIT                        (acpi_status) (0x0012 | AE_CODE_ENVIRONMENTAL)
  59. #define AE_TIME                         (acpi_status) (0x0013 | AE_CODE_ENVIRONMENTAL)
  60. #define AE_UNKNOWN_STATUS               (acpi_status) (0x0014 | AE_CODE_ENVIRONMENTAL)
  61. #define AE_ACQUIRE_DEADLOCK             (acpi_status) (0x0015 | AE_CODE_ENVIRONMENTAL)
  62. #define AE_RELEASE_DEADLOCK             (acpi_status) (0x0016 | AE_CODE_ENVIRONMENTAL)
  63. #define AE_NOT_ACQUIRED                 (acpi_status) (0x0017 | AE_CODE_ENVIRONMENTAL)
  64. #define AE_ALREADY_ACQUIRED             (acpi_status) (0x0018 | AE_CODE_ENVIRONMENTAL)
  65. #define AE_NO_HARDWARE_RESPONSE         (acpi_status) (0x0019 | AE_CODE_ENVIRONMENTAL)
  66. #define AE_NO_GLOBAL_LOCK               (acpi_status) (0x001A | AE_CODE_ENVIRONMENTAL)
  67. #define AE_CODE_ENV_MAX                 0x001A
  68. /*
  69.  * Programmer exceptions
  70.  */
  71. #define AE_BAD_PARAMETER                (acpi_status) (0x0001 | AE_CODE_PROGRAMMER)
  72. #define AE_BAD_CHARACTER                (acpi_status) (0x0002 | AE_CODE_PROGRAMMER)
  73. #define AE_BAD_PATHNAME                 (acpi_status) (0x0003 | AE_CODE_PROGRAMMER)
  74. #define AE_BAD_DATA                     (acpi_status) (0x0004 | AE_CODE_PROGRAMMER)
  75. #define AE_BAD_ADDRESS                  (acpi_status) (0x0005 | AE_CODE_PROGRAMMER)
  76. #define AE_CODE_PGM_MAX                 0x0005
  77. /*
  78.  * Acpi table exceptions
  79.  */
  80. #define AE_BAD_SIGNATURE                (acpi_status) (0x0001 | AE_CODE_ACPI_TABLES)
  81. #define AE_BAD_HEADER                   (acpi_status) (0x0002 | AE_CODE_ACPI_TABLES)
  82. #define AE_BAD_CHECKSUM                 (acpi_status) (0x0003 | AE_CODE_ACPI_TABLES)
  83. #define AE_BAD_VALUE                    (acpi_status) (0x0004 | AE_CODE_ACPI_TABLES)
  84. #define AE_CODE_TBL_MAX                 0x0003
  85. /*
  86.  * AML exceptions.  These are caused by problems with
  87.  * the actual AML byte stream
  88.  */
  89. #define AE_AML_ERROR                    (acpi_status) (0x0001 | AE_CODE_AML)
  90. #define AE_AML_PARSE                    (acpi_status) (0x0002 | AE_CODE_AML)
  91. #define AE_AML_BAD_OPCODE               (acpi_status) (0x0003 | AE_CODE_AML)
  92. #define AE_AML_NO_OPERAND               (acpi_status) (0x0004 | AE_CODE_AML)
  93. #define AE_AML_OPERAND_TYPE             (acpi_status) (0x0005 | AE_CODE_AML)
  94. #define AE_AML_OPERAND_VALUE            (acpi_status) (0x0006 | AE_CODE_AML)
  95. #define AE_AML_UNINITIALIZED_LOCAL      (acpi_status) (0x0007 | AE_CODE_AML)
  96. #define AE_AML_UNINITIALIZED_ARG        (acpi_status) (0x0008 | AE_CODE_AML)
  97. #define AE_AML_UNINITIALIZED_ELEMENT    (acpi_status) (0x0009 | AE_CODE_AML)
  98. #define AE_AML_NUMERIC_OVERFLOW         (acpi_status) (0x000A | AE_CODE_AML)
  99. #define AE_AML_REGION_LIMIT             (acpi_status) (0x000B | AE_CODE_AML)
  100. #define AE_AML_BUFFER_LIMIT             (acpi_status) (0x000C | AE_CODE_AML)
  101. #define AE_AML_PACKAGE_LIMIT            (acpi_status) (0x000D | AE_CODE_AML)
  102. #define AE_AML_DIVIDE_BY_ZERO           (acpi_status) (0x000E | AE_CODE_AML)
  103. #define AE_AML_BAD_NAME                 (acpi_status) (0x000F | AE_CODE_AML)
  104. #define AE_AML_NAME_NOT_FOUND           (acpi_status) (0x0010 | AE_CODE_AML)
  105. #define AE_AML_INTERNAL                 (acpi_status) (0x0011 | AE_CODE_AML)
  106. #define AE_AML_INVALID_SPACE_ID         (acpi_status) (0x0012 | AE_CODE_AML)
  107. #define AE_AML_STRING_LIMIT             (acpi_status) (0x0013 | AE_CODE_AML)
  108. #define AE_AML_NO_RETURN_VALUE          (acpi_status) (0x0014 | AE_CODE_AML)
  109. #define AE_AML_METHOD_LIMIT             (acpi_status) (0x0015 | AE_CODE_AML)
  110. #define AE_AML_NOT_OWNER                (acpi_status) (0x0016 | AE_CODE_AML)
  111. #define AE_AML_MUTEX_ORDER              (acpi_status) (0x0017 | AE_CODE_AML)
  112. #define AE_AML_MUTEX_NOT_ACQUIRED       (acpi_status) (0x0018 | AE_CODE_AML)
  113. #define AE_AML_INVALID_RESOURCE_TYPE    (acpi_status) (0x0019 | AE_CODE_AML)
  114. #define AE_CODE_AML_MAX                 0x0019
  115. /*
  116.  * Internal exceptions used for control
  117.  */
  118. #define AE_CTRL_RETURN_VALUE            (acpi_status) (0x0001 | AE_CODE_CONTROL)
  119. #define AE_CTRL_PENDING                 (acpi_status) (0x0002 | AE_CODE_CONTROL)
  120. #define AE_CTRL_TERMINATE               (acpi_status) (0x0003 | AE_CODE_CONTROL)
  121. #define AE_CTRL_TRUE                    (acpi_status) (0x0004 | AE_CODE_CONTROL)
  122. #define AE_CTRL_FALSE                   (acpi_status) (0x0005 | AE_CODE_CONTROL)
  123. #define AE_CTRL_DEPTH                   (acpi_status) (0x0006 | AE_CODE_CONTROL)
  124. #define AE_CTRL_END                     (acpi_status) (0x0007 | AE_CODE_CONTROL)
  125. #define AE_CTRL_TRANSFER                (acpi_status) (0x0008 | AE_CODE_CONTROL)
  126. #define AE_CODE_CTRL_MAX                0x0008
  127. #ifdef DEFINE_ACPI_GLOBALS
  128. /*
  129.  * String versions of the exception codes above
  130.  * These strings must match the corresponding defines exactly
  131.  */
  132. NATIVE_CHAR const   *acpi_gbl_exception_names_env[] =
  133. {
  134. "AE_OK",
  135. "AE_ERROR",
  136. "AE_NO_ACPI_TABLES",
  137. "AE_NO_NAMESPACE",
  138. "AE_NO_MEMORY",
  139. "AE_NOT_FOUND",
  140. "AE_NOT_EXIST",
  141. "AE_EXIST",
  142. "AE_TYPE",
  143. "AE_NULL_OBJECT",
  144. "AE_NULL_ENTRY",
  145. "AE_BUFFER_OVERFLOW",
  146. "AE_STACK_OVERFLOW",
  147. "AE_STACK_UNDERFLOW",
  148. "AE_NOT_IMPLEMENTED",
  149. "AE_VERSION_MISMATCH",
  150. "AE_SUPPORT",
  151. "AE_SHARE",
  152. "AE_LIMIT",
  153. "AE_TIME",
  154. "AE_UNKNOWN_STATUS",
  155. "AE_ACQUIRE_DEADLOCK",
  156. "AE_RELEASE_DEADLOCK",
  157. "AE_NOT_ACQUIRED",
  158. "AE_ALREADY_ACQUIRED",
  159. "AE_NO_HARDWARE_RESPONSE",
  160. "AE_NO_GLOBAL_LOCK",
  161. };
  162. NATIVE_CHAR const   *acpi_gbl_exception_names_pgm[] =
  163. {
  164. "AE_BAD_PARAMETER",
  165. "AE_BAD_CHARACTER",
  166. "AE_BAD_PATHNAME",
  167. "AE_BAD_DATA",
  168. "AE_BAD_ADDRESS",
  169. };
  170. NATIVE_CHAR const   *acpi_gbl_exception_names_tbl[] =
  171. {
  172. "AE_BAD_SIGNATURE",
  173. "AE_BAD_HEADER",
  174. "AE_BAD_CHECKSUM",
  175. "AE_BAD_VALUE",
  176. };
  177. NATIVE_CHAR const   *acpi_gbl_exception_names_aml[] =
  178. {
  179. "AE_AML_ERROR",
  180. "AE_AML_PARSE",
  181. "AE_AML_BAD_OPCODE",
  182. "AE_AML_NO_OPERAND",
  183. "AE_AML_OPERAND_TYPE",
  184. "AE_AML_OPERAND_VALUE",
  185. "AE_AML_UNINITIALIZED_LOCAL",
  186. "AE_AML_UNINITIALIZED_ARG",
  187. "AE_AML_UNINITIALIZED_ELEMENT",
  188. "AE_AML_NUMERIC_OVERFLOW",
  189. "AE_AML_REGION_LIMIT",
  190. "AE_AML_BUFFER_LIMIT",
  191. "AE_AML_PACKAGE_LIMIT",
  192. "AE_AML_DIVIDE_BY_ZERO",
  193. "AE_AML_BAD_NAME",
  194. "AE_AML_NAME_NOT_FOUND",
  195. "AE_AML_INTERNAL",
  196. "AE_AML_INVALID_SPACE_ID",
  197. "AE_AML_STRING_LIMIT",
  198. "AE_AML_NO_RETURN_VALUE",
  199. "AE_AML_METHOD_LIMIT",
  200. "AE_AML_NOT_OWNER",
  201. "AE_AML_MUTEX_ORDER",
  202. "AE_AML_MUTEX_NOT_ACQUIRED",
  203. "AE_AML_INVALID_RESOURCE_TYPE",
  204. };
  205. NATIVE_CHAR const   *acpi_gbl_exception_names_ctrl[] =
  206. {
  207. "AE_CTRL_RETURN_VALUE",
  208. "AE_CTRL_PENDING",
  209. "AE_CTRL_TERMINATE",
  210. "AE_CTRL_TRUE",
  211. "AE_CTRL_FALSE",
  212. "AE_CTRL_DEPTH",
  213. "AE_CTRL_END",
  214. "AE_CTRL_TRANSFER",
  215. };
  216. #endif /* ACPI GLOBALS */
  217. #endif /* __ACEXCEP_H__ */