summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFelix Held <felix-coreboot@felixheld.de>2023-02-09 16:26:26 +0100
committerFelix Held <felix-coreboot@felixheld.de>2023-02-10 18:28:38 +0000
commitf28f27bc5477026644eb2484cacdadda184db913 (patch)
tree535043ba3798787a60ef326d1f4c4493a809e1c7 /src
parent178cf35098685fa2dc331d9e59dded379e8574bb (diff)
acpi/acpigen: use acpigen_write_store_* in acpigen_write_rom
Use existing functions instead of open-coding the same functionality. Signed-off-by: Felix Held <felix-coreboot@felixheld.de> Change-Id: Ie35c7e0fd3caa25b0d3d02443609e54dd2fdcb7c Reviewed-on: https://review.coreboot.org/c/coreboot/+/72937 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Tim Wawrzynczak <inforichland@gmail.com> Reviewed-by: Elyes Haouas <ehaouas@noos.fr>
Diffstat (limited to 'src')
-rw-r--r--src/acpi/acpigen.c24
1 files changed, 6 insertions, 18 deletions
diff --git a/src/acpi/acpigen.c b/src/acpi/acpigen.c
index 2479f58ef4..d30893004e 100644
--- a/src/acpi/acpigen.c
+++ b/src/acpi/acpigen.c
@@ -2012,31 +2012,23 @@ void acpigen_write_rom(void *bios, const size_t length)
acpigen_write_field(opreg.name, l, 2, FIELD_ANYACC | FIELD_NOLOCK | FIELD_PRESERVE);
/* Store (Arg0, Local0) */
- acpigen_write_store();
- acpigen_emit_byte(ARG0_OP);
- acpigen_emit_byte(LOCAL0_OP);
+ acpigen_write_store_ops(ARG0_OP, LOCAL0_OP);
/* Store (Arg1, Local1) */
- acpigen_write_store();
- acpigen_emit_byte(ARG1_OP);
- acpigen_emit_byte(LOCAL1_OP);
+ acpigen_write_store_ops(ARG1_OP, LOCAL1_OP);
/* ACPI SPEC requires to return at maximum 4KiB */
/* If (LGreater (Local1, 0x1000)) */
acpigen_write_if_lgreater_op_int(LOCAL1_OP, 0x1000);
/* Store (0x1000, Local1) */
- acpigen_write_store();
- acpigen_write_integer(0x1000);
- acpigen_emit_byte(LOCAL1_OP);
+ acpigen_write_store_int_to_op(0x1000, LOCAL1_OP);
/* Pop if */
acpigen_pop_len();
/* Store (Local1, Local3) */
- acpigen_write_store();
- acpigen_emit_byte(LOCAL1_OP);
- acpigen_emit_byte(LOCAL3_OP);
+ acpigen_write_store_ops(LOCAL1_OP, LOCAL3_OP);
/* If (LGreater (Local0, length)) */
acpigen_write_if_lgreater_op_int(LOCAL0_OP, length);
@@ -2065,9 +2057,7 @@ void acpigen_write_rom(void *bios, const size_t length)
acpigen_write_if_lgreater_op_op(LOCAL1_OP, LOCAL2_OP);
/* Store (Local2, Local1) */
- acpigen_write_store();
- acpigen_emit_byte(LOCAL2_OP);
- acpigen_emit_byte(LOCAL1_OP);
+ acpigen_write_store_ops(LOCAL2_OP, LOCAL1_OP);
/* Pop if */
acpigen_pop_len();
@@ -2103,9 +2093,7 @@ void acpigen_write_rom(void *bios, const size_t length)
acpigen_emit_namestring("TMPB");
/* Store (TMPB, ROM1) */
- acpigen_write_store();
- acpigen_emit_namestring("TMPB");
- acpigen_emit_namestring("ROM1");
+ acpigen_write_store_namestr_to_namestr("TMPB", "ROM1");
/* Return (ROM1) */
acpigen_emit_byte(RETURN_OP);