summaryrefslogtreecommitdiff
path: root/drivers/acpi/acpica/dsfield.c
diff options
context:
space:
mode:
authorErik Schmauss <erik.schmauss@intel.com>2018-08-11 00:43:00 +0300
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2018-08-15 00:49:13 +0300
commit77d4e0966a8a6f8a3aa9d27b067a1fc0ec10628d (patch)
tree37d09062dc984732812fadc92ad76129be3c2c9b /drivers/acpi/acpica/dsfield.c
parentfb2ef998af44fb94214f3cf1c0e85d7a4e642fcb (diff)
downloadlinux-77d4e0966a8a6f8a3aa9d27b067a1fc0ec10628d.tar.xz
ACPICA: acpi_exec: fixing -fi option
Field elements listed in the init file used to be initialized after the table load and before executing module-level code blocks. The recent changes in module-level code mean that the table load becomes a method execution. If fields are used within module-level code and we are executing with -fi option, then these values are populated after the table has finished loading. This commit changes the initialization of objects listed in the init file so that field unit values are populated during the table load. Signed-off-by: Erik Schmauss <erik.schmauss@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/acpi/acpica/dsfield.c')
-rw-r--r--drivers/acpi/acpica/dsfield.c35
1 files changed, 34 insertions, 1 deletions
diff --git a/drivers/acpi/acpica/dsfield.c b/drivers/acpi/acpica/dsfield.c
index 7c937595dfcb..5581300927de 100644
--- a/drivers/acpi/acpica/dsfield.c
+++ b/drivers/acpi/acpica/dsfield.c
@@ -15,6 +15,10 @@
#include "acnamesp.h"
#include "acparser.h"
+#ifdef ACPI_EXEC_APP
+#include "aecommon.h"
+#endif
+
#define _COMPONENT ACPI_DISPATCHER
ACPI_MODULE_NAME("dsfield")
@@ -259,6 +263,13 @@ acpi_ds_get_field_names(struct acpi_create_field_info *info,
u64 position;
union acpi_parse_object *child;
+#ifdef ACPI_EXEC_APP
+ u64 value = 0;
+ union acpi_operand_object *result_desc;
+ union acpi_operand_object *obj_desc;
+ char *name_path;
+#endif
+
ACPI_FUNCTION_TRACE_PTR(ds_get_field_names, info);
/* First field starts at bit zero */
@@ -391,6 +402,26 @@ acpi_ds_get_field_names(struct acpi_create_field_info *info,
if (ACPI_FAILURE(status)) {
return_ACPI_STATUS(status);
}
+#ifdef ACPI_EXEC_APP
+ name_path =
+ acpi_ns_get_external_pathname(info->
+ field_node);
+ obj_desc =
+ acpi_ut_create_integer_object
+ (value);
+ if (ACPI_SUCCESS
+ (ae_lookup_init_file_entry
+ (name_path, &value))) {
+ acpi_ex_write_data_to_field
+ (obj_desc,
+ acpi_ns_get_attached_object
+ (info->field_node),
+ &result_desc);
+ ACPI_FREE(name_path);
+ acpi_ut_remove_reference
+ (obj_desc);
+ }
+#endif
}
}
@@ -573,7 +604,9 @@ acpi_ds_init_field_objects(union acpi_parse_object *op,
!(walk_state->parse_flags & ACPI_PARSE_MODULE_LEVEL)) {
flags |= ACPI_NS_TEMPORARY;
}
-
+#ifdef ACPI_EXEC_APP
+ flags |= ACPI_NS_OVERRIDE_IF_FOUND;
+#endif
/*
* Walk the list of entries in the field_list
* Note: field_list can be of zero length. In this case, Arg will be NULL.