forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-01-04 1543e317f1da31b75942316931e8f491a8920811
kernel/drivers/acpi/acpica/nsparse.c
....@@ -3,7 +3,7 @@
33 *
44 * Module Name: nsparse - namespace interface to AML parser
55 *
6
- * Copyright (C) 2000 - 2018, Intel Corp.
6
+ * Copyright (C) 2000 - 2020, Intel Corp.
77 *
88 *****************************************************************************/
99
....@@ -107,7 +107,19 @@
107107 goto cleanup;
108108 }
109109
110
+ /* Optional object evaluation log */
111
+
112
+ ACPI_DEBUG_PRINT_RAW((ACPI_DB_EVALUATION,
113
+ "%-26s: (Definition Block level)\n",
114
+ "Module-level evaluation"));
115
+
110116 status = acpi_ps_execute_table(info);
117
+
118
+ /* Optional object evaluation log */
119
+
120
+ ACPI_DEBUG_PRINT_RAW((ACPI_DB_EVALUATION,
121
+ "%-26s: (Definition Block level)\n",
122
+ "Module-level complete"));
111123
112124 cleanup:
113125 if (info) {
....@@ -191,7 +203,7 @@
191203
192204 /* Found OSDT table, enable the namespace override feature */
193205
194
- if (ACPI_COMPARE_NAME(table->signature, ACPI_SIG_OSDT) &&
206
+ if (ACPI_COMPARE_NAMESEG(table->signature, ACPI_SIG_OSDT) &&
195207 pass_number == ACPI_IMODE_LOAD_PASS1) {
196208 walk_state->namespace_override = TRUE;
197209 }
....@@ -241,61 +253,19 @@
241253
242254 ACPI_FUNCTION_TRACE(ns_parse_table);
243255
244
- if (acpi_gbl_execute_tables_as_methods) {
245
- /*
246
- * This case executes the AML table as one large control method.
247
- * The point of this is to execute any module-level code in-place
248
- * as the table is parsed. Some AML code depends on this behavior.
249
- *
250
- * It is a run-time option at this time, but will eventually become
251
- * the default.
252
- *
253
- * Note: This causes the table to only have a single-pass parse.
254
- * However, this is compatible with other ACPI implementations.
255
- */
256
- ACPI_DEBUG_PRINT_RAW((ACPI_DB_PARSE,
257
- "%s: **** Start table execution pass\n",
258
- ACPI_GET_FUNCTION_NAME));
256
+ /*
257
+ * Executes the AML table as one large control method.
258
+ * The point of this is to execute any module-level code in-place
259
+ * as the table is parsed. Some AML code depends on this behavior.
260
+ *
261
+ * Note: This causes the table to only have a single-pass parse.
262
+ * However, this is compatible with other ACPI implementations.
263
+ */
264
+ ACPI_DEBUG_PRINT_RAW((ACPI_DB_PARSE,
265
+ "%s: **** Start table execution pass\n",
266
+ ACPI_GET_FUNCTION_NAME));
259267
260
- status = acpi_ns_execute_table(table_index, start_node);
261
- if (ACPI_FAILURE(status)) {
262
- return_ACPI_STATUS(status);
263
- }
264
- } else {
265
- /*
266
- * AML Parse, pass 1
267
- *
268
- * In this pass, we load most of the namespace. Control methods
269
- * are not parsed until later. A parse tree is not created.
270
- * Instead, each Parser Op subtree is deleted when it is finished.
271
- * This saves a great deal of memory, and allows a small cache of
272
- * parse objects to service the entire parse. The second pass of
273
- * the parse then performs another complete parse of the AML.
274
- */
275
- ACPI_DEBUG_PRINT((ACPI_DB_PARSE, "**** Start pass 1\n"));
276
-
277
- status = acpi_ns_one_complete_parse(ACPI_IMODE_LOAD_PASS1,
278
- table_index, start_node);
279
- if (ACPI_FAILURE(status)) {
280
- return_ACPI_STATUS(status);
281
- }
282
-
283
- /*
284
- * AML Parse, pass 2
285
- *
286
- * In this pass, we resolve forward references and other things
287
- * that could not be completed during the first pass.
288
- * Another complete parse of the AML is performed, but the
289
- * overhead of this is compensated for by the fact that the
290
- * parse objects are all cached.
291
- */
292
- ACPI_DEBUG_PRINT((ACPI_DB_PARSE, "**** Start pass 2\n"));
293
- status = acpi_ns_one_complete_parse(ACPI_IMODE_LOAD_PASS2,
294
- table_index, start_node);
295
- if (ACPI_FAILURE(status)) {
296
- return_ACPI_STATUS(status);
297
- }
298
- }
268
+ status = acpi_ns_execute_table(table_index, start_node);
299269
300270 return_ACPI_STATUS(status);
301271 }