Tim Wawrzynczak has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/42102 )
Change subject: acpigen: Add acpigen_notify ......................................................................
acpigen: Add acpigen_notify
A fairly common thing in ACPI is notifying a device when some kind of device-specific event happens; this function simplifies writing this pattern.
Signed-off-by: Tim Wawrzynczak twawrzynczak@chromium.org Change-Id: I0f18db9cc836ec9249604452f03ed9b4c6478827 --- M src/acpi/acpigen.c M src/include/acpi/acpigen.h 2 files changed, 10 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/02/42102/1
diff --git a/src/acpi/acpigen.c b/src/acpi/acpigen.c index efc5a16..d687a33 100644 --- a/src/acpi/acpigen.c +++ b/src/acpi/acpigen.c @@ -1953,3 +1953,10 @@ (((uint64_t)address->part_id & 0xffff) << 8) | (((uint64_t)address->class & 0xff))); } + +void acpigen_notify(const char *namestr, int value) +{ + acpigen_emit_byte(NOTIFY_OP); + acpigen_emit_namestring(namestr); + acpigen_write_integer(value); +} diff --git a/src/include/acpi/acpigen.h b/src/include/acpi/acpigen.h index dffde85..e0519ab 100644 --- a/src/include/acpi/acpigen.h +++ b/src/include/acpi/acpigen.h @@ -508,4 +508,7 @@ void acpigen_resource_qword(u16 res_type, u16 gen_flags, u16 type_flags, u64 gran, u64 range_min, u64 range_max, u64 translation, u64 length);
+/* Emits Notify(namestr, value) */ +void acpigen_notify(const char *namestr, int value); + #endif /* __ACPI_ACPIGEN_H__ */
Duncan Laurie has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/42102 )
Change subject: acpigen: Add acpigen_notify ......................................................................
Patch Set 3: Code-Review+2
Sumeet R Pawnikar has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/42102 )
Change subject: acpigen: Add acpigen_notify ......................................................................
Patch Set 7: Code-Review+2
Nick Vaccaro has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/42102 )
Change subject: acpigen: Add acpigen_notify ......................................................................
Patch Set 7: Code-Review+2
Duncan Laurie has submitted this change. ( https://review.coreboot.org/c/coreboot/+/42102 )
Change subject: acpigen: Add acpigen_notify ......................................................................
acpigen: Add acpigen_notify
A fairly common thing in ACPI is notifying a device when some kind of device-specific event happens; this function simplifies writing this pattern.
Signed-off-by: Tim Wawrzynczak twawrzynczak@chromium.org Change-Id: I0f18db9cc836ec9249604452f03ed9b4c6478827 Reviewed-on: https://review.coreboot.org/c/coreboot/+/42102 Reviewed-by: Sumeet R Pawnikar sumeet.r.pawnikar@intel.com Reviewed-by: Nick Vaccaro nvaccaro@google.com Reviewed-by: Duncan Laurie dlaurie@chromium.org Tested-by: build bot (Jenkins) no-reply@coreboot.org --- M src/acpi/acpigen.c M src/include/acpi/acpigen.h 2 files changed, 10 insertions(+), 0 deletions(-)
Approvals: build bot (Jenkins): Verified Duncan Laurie: Looks good to me, approved Sumeet R Pawnikar: Looks good to me, approved Nick Vaccaro: Looks good to me, approved
diff --git a/src/acpi/acpigen.c b/src/acpi/acpigen.c index bf1b373..a4a74f6 100644 --- a/src/acpi/acpigen.c +++ b/src/acpi/acpigen.c @@ -1964,3 +1964,10 @@ (((uint64_t)address->part_id & 0xffff) << 8) | (((uint64_t)address->class & 0xff))); } + +void acpigen_notify(const char *namestr, int value) +{ + acpigen_emit_byte(NOTIFY_OP); + acpigen_emit_namestring(namestr); + acpigen_write_integer(value); +} diff --git a/src/include/acpi/acpigen.h b/src/include/acpi/acpigen.h index 701e44ba..98a9fe4 100644 --- a/src/include/acpi/acpigen.h +++ b/src/include/acpi/acpigen.h @@ -509,4 +509,7 @@ void acpigen_resource_qword(u16 res_type, u16 gen_flags, u16 type_flags, u64 gran, u64 range_min, u64 range_max, u64 translation, u64 length);
+/* Emits Notify(namestr, value) */ +void acpigen_notify(const char *namestr, int value); + #endif /* __ACPI_ACPIGEN_H__ */