Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Bob Moore and committed by
Rafael J. Wysocki
39ea1bbf 8bd24835

+44 -20
+1 -1
drivers/acpi/acpica/dswexec.c
··· 30 30 acpi_ex_opcode_0A_0T_1R, 31 31 acpi_ex_opcode_1A_0T_0R, 32 32 acpi_ex_opcode_1A_0T_1R, 33 - acpi_ex_opcode_1A_1T_0R, 33 + NULL, /* Was: acpi_ex_opcode_1A_0T_0R (Was for Load operator) */ 34 34 acpi_ex_opcode_1A_1T_1R, 35 35 acpi_ex_opcode_2A_0T_0R, 36 36 acpi_ex_opcode_2A_0T_1R,
+20 -17
drivers/acpi/acpica/exconfig.c
··· 249 249 * 250 250 * PARAMETERS: obj_desc - Region or Buffer/Field where the table will be 251 251 * obtained 252 - * target - Where a handle to the table will be stored 252 + * target - Where the status of the load will be stored 253 253 * walk_state - Current state 254 254 * 255 255 * RETURN: Status ··· 277 277 u32 length; 278 278 279 279 ACPI_FUNCTION_TRACE(ex_load_op); 280 + 281 + if (target->common.descriptor_type == ACPI_DESC_TYPE_NAMED) { 282 + target = 283 + acpi_ns_get_attached_object(ACPI_CAST_PTR 284 + (struct acpi_namespace_node, 285 + target)); 286 + } 287 + if (target->common.type != ACPI_TYPE_INTEGER) { 288 + ACPI_EXCEPTION((AE_INFO, AE_TYPE, 289 + "Type not integer: %X\n", target->common.type)); 290 + return_ACPI_STATUS(AE_AML_OPERAND_TYPE); 291 + } 292 + 293 + target->integer.value = 0; 280 294 281 295 /* Source Object can be either an op_region or a Buffer/Field */ 282 296 ··· 444 430 */ 445 431 status = acpi_ex_add_table(table_index, &ddb_handle); 446 432 if (ACPI_FAILURE(status)) { 447 - 448 - /* On error, table_ptr was deallocated above */ 449 - 450 433 return_ACPI_STATUS(status); 451 434 } 452 435 ··· 453 442 acpi_ns_initialize_objects(); 454 443 acpi_ex_enter_interpreter(); 455 444 456 - /* Store the ddb_handle into the Target operand */ 457 - 458 - status = acpi_ex_store(ddb_handle, target, walk_state); 459 - if (ACPI_FAILURE(status)) { 460 - (void)acpi_ex_unload_table(ddb_handle); 461 - 462 - /* table_ptr was deallocated above */ 463 - 464 - acpi_ut_remove_reference(ddb_handle); 465 - return_ACPI_STATUS(status); 466 - } 467 - 468 - /* Remove the reference by added by acpi_ex_store above */ 445 + /* Remove the reference to ddb_handle created by acpi_ex_add_table above */ 469 446 470 447 acpi_ut_remove_reference(ddb_handle); 448 + 449 + /* Return -1 (non-zero) indicates success */ 450 + 451 + target->integer.value = 0xFFFFFFFFFFFFFFFF; 471 452 return_ACPI_STATUS(status); 472 453 } 473 454
+21
drivers/acpi/acpica/exoparg1.c
··· 163 163 return_ACPI_STATUS(status); 164 164 } 165 165 166 + #ifdef _OBSOLETE_CODE /* Was originally used for Load() operator */ 166 167 /******************************************************************************* 167 168 * 168 169 * FUNCTION: acpi_ex_opcode_1A_1T_0R ··· 188 187 /* Examine the AML opcode */ 189 188 190 189 switch (walk_state->opcode) { 190 + #ifdef _OBSOLETE_CODE 191 191 case AML_LOAD_OP: 192 192 193 193 status = acpi_ex_load_op(operand[0], operand[1], walk_state); 194 194 break; 195 + #endif 195 196 196 197 default: /* Unknown opcode */ 197 198 ··· 207 204 208 205 return_ACPI_STATUS(status); 209 206 } 207 + #endif 210 208 211 209 /******************************************************************************* 212 210 * ··· 219 215 * 220 216 * DESCRIPTION: Execute opcode with one argument, one target, and a 221 217 * return value. 218 + * January 2022: Added Load operator, with new ACPI 6.4 219 + * semantics. 222 220 * 223 221 ******************************************************************************/ 224 222 ··· 245 239 case AML_FIND_SET_LEFT_BIT_OP: 246 240 case AML_FIND_SET_RIGHT_BIT_OP: 247 241 case AML_FROM_BCD_OP: 242 + case AML_LOAD_OP: 248 243 case AML_TO_BCD_OP: 249 244 case AML_CONDITIONAL_REF_OF_OP: 250 245 ··· 342 335 /* Next power of 10 */ 343 336 344 337 power_of_ten *= 10; 338 + } 339 + break; 340 + 341 + case AML_LOAD_OP: /* Result1 = Load (Operand[0], Result1) */ 342 + 343 + return_desc->integer.value = 0; 344 + status = 345 + acpi_ex_load_op(operand[0], return_desc, 346 + walk_state); 347 + if (ACPI_SUCCESS(status)) { 348 + 349 + /* Return -1 (non-zero) indicates success */ 350 + 351 + return_desc->integer.value = 0xFFFFFFFFFFFFFFFF; 345 352 } 346 353 break; 347 354
+2 -2
drivers/acpi/acpica/psopcode.c
··· 408 408 AML_HAS_ARGS | AML_NSOBJECT | AML_NSNODE | 409 409 AML_DEFER | AML_FIELD | AML_CREATE), 410 410 /* 4A */ ACPI_OP("Load", ARGP_LOAD_OP, ARGI_LOAD_OP, ACPI_TYPE_ANY, 411 - AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_1T_0R, 412 - AML_FLAGS_EXEC_1A_1T_0R), 411 + AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_1T_1R, 412 + AML_FLAGS_EXEC_1A_1T_1R), 413 413 /* 4B */ ACPI_OP("Stall", ARGP_STALL_OP, ARGI_STALL_OP, ACPI_TYPE_ANY, 414 414 AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_0T_0R, 415 415 AML_FLAGS_EXEC_1A_0T_0R),