Duncan Laurie has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/46255 )
Change subject: acpigen: Add helpers for common Store operations ......................................................................
acpigen: Add helpers for common Store operations
Add helpers for some store operations:
Store(INTEGER, NAME) ex: Store (100, SAVE) Store(INTEGER, OP) ex: Store (100, Local0)
Change-Id: Ia1b3f451acbfb2fc50180a8dcd96db24d330c946 Signed-off-by: Duncan Laurie dlaurie@google.com --- M src/acpi/acpigen.c M src/include/acpi/acpigen.h 2 files changed, 18 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/55/46255/1
diff --git a/src/acpi/acpigen.c b/src/acpi/acpigen.c index a3beb10..ee7c90c 100644 --- a/src/acpi/acpigen.c +++ b/src/acpi/acpigen.c @@ -1243,6 +1243,22 @@ acpigen_emit_namestring(dst); }
+/* Store (src, "namestr") */ +void acpigen_write_store_int_to_namestr(uint64_t src, const char *dst) +{ + acpigen_write_store(); + acpigen_write_integer(src); + acpigen_emit_namestring(dst); +} + +/* Store (src, dst) */ +void acpigen_write_store_int_to_op(uint64_t src, uint8_t dst) +{ + acpigen_write_store(); + acpigen_write_integer(src); + acpigen_emit_byte(dst); +} + /* Or (arg1, arg2, res) */ void acpigen_write_or(uint8_t arg1, uint8_t arg2, uint8_t res) { diff --git a/src/include/acpi/acpigen.h b/src/include/acpi/acpigen.h index 10e328b..e443267 100644 --- a/src/include/acpi/acpigen.h +++ b/src/include/acpi/acpigen.h @@ -361,6 +361,8 @@ const char * const dev_states[], size_t dev_states_count); void acpigen_write_sleep(uint64_t sleep_ms); void acpigen_write_store(void); +void acpigen_write_store_int_to_namestr(uint64_t src, const char *dst); +void acpigen_write_store_int_to_op(uint64_t src, uint8_t dst); void acpigen_write_store_ops(uint8_t src, uint8_t dst); void acpigen_write_store_op_to_namestr(uint8_t src, const char *dst); void acpigen_write_or(uint8_t arg1, uint8_t arg2, uint8_t res);
Furquan Shaikh has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/46255 )
Change subject: acpigen: Add helpers for common Store operations ......................................................................
Patch Set 2: Code-Review+2
Duncan Laurie has submitted this change. ( https://review.coreboot.org/c/coreboot/+/46255 )
Change subject: acpigen: Add helpers for common Store operations ......................................................................
acpigen: Add helpers for common Store operations
Add helpers for some store operations:
Store(INTEGER, NAME) ex: Store (100, SAVE) Store(INTEGER, OP) ex: Store (100, Local0)
Change-Id: Ia1b3f451acbfb2fc50180a8dcd96db24d330c946 Signed-off-by: Duncan Laurie dlaurie@google.com Reviewed-on: https://review.coreboot.org/c/coreboot/+/46255 Reviewed-by: Furquan Shaikh furquan@google.com Tested-by: build bot (Jenkins) no-reply@coreboot.org --- M src/acpi/acpigen.c M src/include/acpi/acpigen.h 2 files changed, 18 insertions(+), 0 deletions(-)
Approvals: build bot (Jenkins): Verified Furquan Shaikh: Looks good to me, approved
diff --git a/src/acpi/acpigen.c b/src/acpi/acpigen.c index a3beb10..ee7c90c 100644 --- a/src/acpi/acpigen.c +++ b/src/acpi/acpigen.c @@ -1243,6 +1243,22 @@ acpigen_emit_namestring(dst); }
+/* Store (src, "namestr") */ +void acpigen_write_store_int_to_namestr(uint64_t src, const char *dst) +{ + acpigen_write_store(); + acpigen_write_integer(src); + acpigen_emit_namestring(dst); +} + +/* Store (src, dst) */ +void acpigen_write_store_int_to_op(uint64_t src, uint8_t dst) +{ + acpigen_write_store(); + acpigen_write_integer(src); + acpigen_emit_byte(dst); +} + /* Or (arg1, arg2, res) */ void acpigen_write_or(uint8_t arg1, uint8_t arg2, uint8_t res) { diff --git a/src/include/acpi/acpigen.h b/src/include/acpi/acpigen.h index 10e328b..e443267 100644 --- a/src/include/acpi/acpigen.h +++ b/src/include/acpi/acpigen.h @@ -361,6 +361,8 @@ const char * const dev_states[], size_t dev_states_count); void acpigen_write_sleep(uint64_t sleep_ms); void acpigen_write_store(void); +void acpigen_write_store_int_to_namestr(uint64_t src, const char *dst); +void acpigen_write_store_int_to_op(uint64_t src, uint8_t dst); void acpigen_write_store_ops(uint8_t src, uint8_t dst); void acpigen_write_store_op_to_namestr(uint8_t src, const char *dst); void acpigen_write_or(uint8_t arg1, uint8_t arg2, uint8_t res);