Sugnan Prabhu S has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/41620 )
Change subject: acpi: Add support for call method and store value ......................................................................
Patch Set 10:
(2 comments)
https://review.coreboot.org/c/coreboot/+/41620/5/src/acpi/acpigen.c File src/acpi/acpigen.c:
https://review.coreboot.org/c/coreboot/+/41620/5/src/acpi/acpigen.c@1928 PS5, Line 1928: void acpigen_call_method(const char *name, unsigned char *params, int params_len) : { : int i; : char ud[] = "____"; : for (i = 0; i < 4; i++) { : if ((name[i] == '\0')) { : acpigen_emit_stream(ud, 4 - i); : break; : } : acpigen_emit_byte(name[i]); : } : : for (i = 0; i < params_len; i++) : acpigen_write_byte(params[i]); : }
Why is this necessary?
This is required to call any method. we are using this in powerresource generation patch to call MCON and MCOF
https://review.coreboot.org/c/coreboot/+/41624/11/src/drivers/intel/mipi_cam...
https://review.coreboot.org/c/coreboot/+/41620/5/src/acpi/acpigen.c@1944 PS5, Line 1944: void acpigen_write_store_var(const char *name, uint8_t value) : { : int i; : char ud[] = "____"; : : acpigen_write_store(); : acpigen_emit_byte(value); : : for (i = 0; i < 4; i++) { : if ((name[i] == '\0')) { : acpigen_emit_stream(ud, 4 - i); : break; : } : acpigen_emit_byte(name[i]); : } : }
Why is this necessary?
This method has been removed in the latest patch. https://review.coreboot.org/c/coreboot/+/41620/10/src/acpi/acpigen.c
During development I couldn't find any method for storing value in to a variable, but later found that acpigen_write_store_op_to_namestr has been added.