summaryrefslogtreecommitdiff
path: root/drivers/acpi/acpica/exconfig.c
diff options
context:
space:
mode:
authorBob Moore <robert.moore@intel.com>2022-04-11 20:51:27 +0200
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2022-04-13 20:24:57 +0200
commit39ea1bbf270a617c81369f2867ca14b8eac331bd (patch)
tree7f800a0310030f410eca4365af3395a12a7f8881 /drivers/acpi/acpica/exconfig.c
parent8bd24835db1781685f9abd0d1b628eaaac20d7c1 (diff)
ACPICA: Add new ACPI 6.4 semantics to the Load() operator
ACPICA commit 84bf573ab7222c4e1c22167b22d29c4da1552b20 DDB_HANDLE is gone, now Load() returns a pass/fail integer, as well as storing it in an optional 2nd argument. Link: https://github.com/acpica/acpica/commit/84bf573a Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/acpi/acpica/exconfig.c')
-rw-r--r--drivers/acpi/acpica/exconfig.c35
1 files changed, 19 insertions, 16 deletions
diff --git a/drivers/acpi/acpica/exconfig.c b/drivers/acpi/acpica/exconfig.c
index 6c2685a6a4c1..d92e9e8e42ba 100644
--- a/drivers/acpi/acpica/exconfig.c
+++ b/drivers/acpi/acpica/exconfig.c
@@ -249,7 +249,7 @@ acpi_ex_region_read(union acpi_operand_object *obj_desc, u32 length, u8 *buffer)
*
* PARAMETERS: obj_desc - Region or Buffer/Field where the table will be
* obtained
- * target - Where a handle to the table will be stored
+ * target - Where the status of the load will be stored
* walk_state - Current state
*
* RETURN: Status
@@ -278,6 +278,20 @@ acpi_ex_load_op(union acpi_operand_object *obj_desc,
ACPI_FUNCTION_TRACE(ex_load_op);
+ if (target->common.descriptor_type == ACPI_DESC_TYPE_NAMED) {
+ target =
+ acpi_ns_get_attached_object(ACPI_CAST_PTR
+ (struct acpi_namespace_node,
+ target));
+ }
+ if (target->common.type != ACPI_TYPE_INTEGER) {
+ ACPI_EXCEPTION((AE_INFO, AE_TYPE,
+ "Type not integer: %X\n", target->common.type));
+ return_ACPI_STATUS(AE_AML_OPERAND_TYPE);
+ }
+
+ target->integer.value = 0;
+
/* Source Object can be either an op_region or a Buffer/Field */
switch (obj_desc->common.type) {
@@ -430,9 +444,6 @@ acpi_ex_load_op(union acpi_operand_object *obj_desc,
*/
status = acpi_ex_add_table(table_index, &ddb_handle);
if (ACPI_FAILURE(status)) {
-
- /* On error, table_ptr was deallocated above */
-
return_ACPI_STATUS(status);
}
@@ -442,21 +453,13 @@ acpi_ex_load_op(union acpi_operand_object *obj_desc,
acpi_ns_initialize_objects();
acpi_ex_enter_interpreter();
- /* Store the ddb_handle into the Target operand */
+ /* Remove the reference to ddb_handle created by acpi_ex_add_table above */
- status = acpi_ex_store(ddb_handle, target, walk_state);
- if (ACPI_FAILURE(status)) {
- (void)acpi_ex_unload_table(ddb_handle);
-
- /* table_ptr was deallocated above */
-
- acpi_ut_remove_reference(ddb_handle);
- return_ACPI_STATUS(status);
- }
+ acpi_ut_remove_reference(ddb_handle);
- /* Remove the reference by added by acpi_ex_store above */
+ /* Return -1 (non-zero) indicates success */
- acpi_ut_remove_reference(ddb_handle);
+ target->integer.value = 0xFFFFFFFFFFFFFFFF;
return_ACPI_STATUS(status);
}