This source file includes following definitions.
- ACPI_MODULE_NAME
- ACPI_EXPORT_SYMBOL
1
2
3
4
5
6
7
8 #define EXPORT_ACPI_INTERFACES
9
10 #define ACPI_DEFINE_EXCEPTION_TABLE
11 #include <acpi/acpi.h>
12 #include "accommon.h"
13
14 #define _COMPONENT ACPI_UTILITIES
15 ACPI_MODULE_NAME("utexcep")
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30 const char *acpi_format_exception(acpi_status status)
31 {
32 const struct acpi_exception_info *exception;
33
34 ACPI_FUNCTION_ENTRY();
35
36 exception = acpi_ut_validate_exception(status);
37 if (!exception) {
38
39
40
41 ACPI_ERROR((AE_INFO,
42 "Unknown exception code: 0x%8.8X", status));
43
44 return ("UNKNOWN_STATUS_CODE");
45 }
46
47 return (exception->name);
48 }
49
50 ACPI_EXPORT_SYMBOL(acpi_format_exception)
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65 const struct acpi_exception_info *acpi_ut_validate_exception(acpi_status status)
66 {
67 u32 sub_status;
68 const struct acpi_exception_info *exception = NULL;
69
70 ACPI_FUNCTION_ENTRY();
71
72
73
74
75 sub_status = (status & ~AE_CODE_MASK);
76
77 switch (status & AE_CODE_MASK) {
78 case AE_CODE_ENVIRONMENTAL:
79
80 if (sub_status <= AE_CODE_ENV_MAX) {
81 exception = &acpi_gbl_exception_names_env[sub_status];
82 }
83 break;
84
85 case AE_CODE_PROGRAMMER:
86
87 if (sub_status <= AE_CODE_PGM_MAX) {
88 exception = &acpi_gbl_exception_names_pgm[sub_status];
89 }
90 break;
91
92 case AE_CODE_ACPI_TABLES:
93
94 if (sub_status <= AE_CODE_TBL_MAX) {
95 exception = &acpi_gbl_exception_names_tbl[sub_status];
96 }
97 break;
98
99 case AE_CODE_AML:
100
101 if (sub_status <= AE_CODE_AML_MAX) {
102 exception = &acpi_gbl_exception_names_aml[sub_status];
103 }
104 break;
105
106 case AE_CODE_CONTROL:
107
108 if (sub_status <= AE_CODE_CTRL_MAX) {
109 exception = &acpi_gbl_exception_names_ctrl[sub_status];
110 }
111 break;
112
113 default:
114
115 break;
116 }
117
118 if (!exception || !exception->name) {
119 return (NULL);
120 }
121
122 return (exception);
123 }