From 2fe7471962dd32f4bbf97d815692f956685e903a Mon Sep 17 00:00:00 2001 From: Duncan Laurie Date: Mon, 1 Jun 2020 17:36:56 -0700 Subject: acpigen: Add some new helper functions These build on existing functions but use different object types in order to provide functions for upcoming changes: acpigen_write_return_op(): Return an operator. acpigen_write_if_lequal_op_op(): Check if 2 operands are equal. acpigen_get_package_op_element(): Read an element from a package into an operator. This one just provides the missing helper, the other 3 already exist: acpigen_get_tx_gpio: Read TX gpio state. Signed-off-by: Duncan Laurie Change-Id: I1141fd132d6f09cf482f74e95308947cba2c5846 Reviewed-on: https://review.coreboot.org/c/coreboot/+/41985 Reviewed-by: Furquan Shaikh Tested-by: build bot (Jenkins) --- src/acpi/acpigen.c | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) (limited to 'src/acpi') diff --git a/src/acpi/acpigen.c b/src/acpi/acpigen.c index 793841cc5b..efc5a16195 100644 --- a/src/acpi/acpigen.c +++ b/src/acpi/acpigen.c @@ -339,6 +339,18 @@ void acpigen_write_scope(const char *name) acpigen_emit_namestring(name); } +void acpigen_get_package_op_element(uint8_t package_op, unsigned int element, uint8_t dest_op) +{ + /* = DeRefOf ([pins[0]); + + if (gpio->polarity == ACPI_GPIO_ACTIVE_LOW) + acpigen_write_xor(LOCAL0_OP, 1, LOCAL0_OP); +} + /* refer to ACPI 6.4.3.5.3 Word Address Space Descriptor section for details */ void acpigen_resource_word(u16 res_type, u16 gen_flags, u16 type_flags, u16 gran, u16 range_min, u16 range_max, u16 translation, u16 length) -- cgit v1.2.3