forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-01-04 1543e317f1da31b75942316931e8f491a8920811
kernel/drivers/acpi/acpica/dswexec.c
....@@ -4,7 +4,7 @@
44 * Module Name: dswexec - Dispatcher method execution callbacks;
55 * dispatch to interpreter.
66 *
7
- * Copyright (C) 2000 - 2018, Intel Corp.
7
+ * Copyright (C) 2000 - 2020, Intel Corp.
88 *
99 *****************************************************************************/
1010
....@@ -16,6 +16,9 @@
1616 #include "acinterp.h"
1717 #include "acnamesp.h"
1818 #include "acdebug.h"
19
+#ifdef ACPI_EXEC_APP
20
+#include "aecommon.h"
21
+#endif
1922
2023 #define _COMPONENT ACPI_DISPATCHER
2124 ACPI_MODULE_NAME("dswexec")
....@@ -329,6 +332,10 @@
329332 u32 op_class;
330333 union acpi_parse_object *next_op;
331334 union acpi_parse_object *first_arg;
335
+#ifdef ACPI_EXEC_APP
336
+ char *namepath;
337
+ union acpi_operand_object *obj_desc;
338
+#endif
332339
333340 ACPI_FUNCTION_TRACE_PTR(ds_exec_end_op, walk_state);
334341
....@@ -537,6 +544,32 @@
537544
538545 status =
539546 acpi_ds_eval_buffer_field_operands(walk_state, op);
547
+ if (ACPI_FAILURE(status)) {
548
+ break;
549
+ }
550
+#ifdef ACPI_EXEC_APP
551
+ /*
552
+ * acpi_exec support for namespace initialization file (initialize
553
+ * buffer_fields in this code.)
554
+ */
555
+ namepath =
556
+ acpi_ns_get_external_pathname(op->common.node);
557
+ status = ae_lookup_init_file_entry(namepath, &obj_desc);
558
+ if (ACPI_SUCCESS(status)) {
559
+ status =
560
+ acpi_ex_write_data_to_field(obj_desc,
561
+ op->common.
562
+ node->object,
563
+ NULL);
564
+ if ACPI_FAILURE
565
+ (status) {
566
+ ACPI_EXCEPTION((AE_INFO, status,
567
+ "While writing to buffer field"));
568
+ }
569
+ }
570
+ ACPI_FREE(namepath);
571
+ status = AE_OK;
572
+#endif
540573 break;
541574
542575 case AML_TYPE_CREATE_OBJECT: