This source file includes following definitions.
- ACPI_MODULE_NAME
- acpi_ex_opcode_6A_0T_1R
1
2
3
4
5
6
7
8
9
10 #include <acpi/acpi.h>
11 #include "accommon.h"
12 #include "acinterp.h"
13 #include "acparser.h"
14 #include "amlcode.h"
15
16 #define _COMPONENT ACPI_EXECUTER
17 ACPI_MODULE_NAME("exoparg6")
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41 static u8
42 acpi_ex_do_match(u32 match_op,
43 union acpi_operand_object *package_obj,
44 union acpi_operand_object *match_obj);
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62 static u8
63 acpi_ex_do_match(u32 match_op,
64 union acpi_operand_object *package_obj,
65 union acpi_operand_object *match_obj)
66 {
67 u8 logical_result = TRUE;
68 acpi_status status;
69
70
71
72
73
74
75
76
77
78
79
80 switch (match_op) {
81 case MATCH_MTR:
82
83
84
85 break;
86
87 case MATCH_MEQ:
88
89
90
91
92 status =
93 acpi_ex_do_logical_op(AML_LOGICAL_EQUAL_OP, match_obj,
94 package_obj, &logical_result);
95 if (ACPI_FAILURE(status)) {
96 return (FALSE);
97 }
98 break;
99
100 case MATCH_MLE:
101
102
103
104
105 status =
106 acpi_ex_do_logical_op(AML_LOGICAL_LESS_OP, match_obj,
107 package_obj, &logical_result);
108 if (ACPI_FAILURE(status)) {
109 return (FALSE);
110 }
111 logical_result = (u8) ! logical_result;
112 break;
113
114 case MATCH_MLT:
115
116
117
118
119 status =
120 acpi_ex_do_logical_op(AML_LOGICAL_GREATER_OP, match_obj,
121 package_obj, &logical_result);
122 if (ACPI_FAILURE(status)) {
123 return (FALSE);
124 }
125 break;
126
127 case MATCH_MGE:
128
129
130
131
132 status =
133 acpi_ex_do_logical_op(AML_LOGICAL_GREATER_OP, match_obj,
134 package_obj, &logical_result);
135 if (ACPI_FAILURE(status)) {
136 return (FALSE);
137 }
138 logical_result = (u8) ! logical_result;
139 break;
140
141 case MATCH_MGT:
142
143
144
145
146 status =
147 acpi_ex_do_logical_op(AML_LOGICAL_LESS_OP, match_obj,
148 package_obj, &logical_result);
149 if (ACPI_FAILURE(status)) {
150 return (FALSE);
151 }
152 break;
153
154 default:
155
156
157
158 return (FALSE);
159 }
160
161 return (logical_result);
162 }
163
164
165
166
167
168
169
170
171
172
173
174
175
176 acpi_status acpi_ex_opcode_6A_0T_1R(struct acpi_walk_state *walk_state)
177 {
178 union acpi_operand_object **operand = &walk_state->operands[0];
179 union acpi_operand_object *return_desc = NULL;
180 acpi_status status = AE_OK;
181 u64 index;
182 union acpi_operand_object *this_element;
183
184 ACPI_FUNCTION_TRACE_STR(ex_opcode_6A_0T_1R,
185 acpi_ps_get_opcode_name(walk_state->opcode));
186
187 switch (walk_state->opcode) {
188 case AML_MATCH_OP:
189
190
191
192
193
194
195
196 if ((operand[1]->integer.value > MAX_MATCH_OPERATOR) ||
197 (operand[3]->integer.value > MAX_MATCH_OPERATOR)) {
198 ACPI_ERROR((AE_INFO, "Match operator out of range"));
199 status = AE_AML_OPERAND_VALUE;
200 goto cleanup;
201 }
202
203
204
205 index = operand[5]->integer.value;
206 if (index >= operand[0]->package.count) {
207 ACPI_ERROR((AE_INFO,
208 "Index (0x%8.8X%8.8X) beyond package end (0x%X)",
209 ACPI_FORMAT_UINT64(index),
210 operand[0]->package.count));
211 status = AE_AML_PACKAGE_LIMIT;
212 goto cleanup;
213 }
214
215
216
217
218 return_desc = acpi_ut_create_integer_object(ACPI_UINT64_MAX);
219 if (!return_desc) {
220 status = AE_NO_MEMORY;
221 goto cleanup;
222
223 }
224
225
226
227
228
229
230
231
232
233
234
235
236 for (; index < operand[0]->package.count; index++) {
237
238
239
240 this_element = operand[0]->package.elements[index];
241
242
243
244 if (!this_element) {
245 continue;
246 }
247
248
249
250
251
252
253 if (!acpi_ex_do_match((u32) operand[1]->integer.value,
254 this_element, operand[2])) {
255 continue;
256 }
257
258 if (!acpi_ex_do_match((u32) operand[3]->integer.value,
259 this_element, operand[4])) {
260 continue;
261 }
262
263
264
265 return_desc->integer.value = index;
266 break;
267 }
268 break;
269
270 case AML_LOAD_TABLE_OP:
271
272 status = acpi_ex_load_table_op(walk_state, &return_desc);
273 break;
274
275 default:
276
277 ACPI_ERROR((AE_INFO, "Unknown AML opcode 0x%X",
278 walk_state->opcode));
279
280 status = AE_AML_BAD_OPCODE;
281 goto cleanup;
282 }
283
284 cleanup:
285
286
287
288 if (ACPI_FAILURE(status)) {
289 acpi_ut_remove_reference(return_desc);
290 }
291
292
293
294 else {
295 walk_state->result_obj = return_desc;
296 }
297
298 return_ACPI_STATUS(status);
299 }