diff options
author | Felix Held <felix-coreboot@felixheld.de> | 2023-02-09 16:25:38 +0100 |
---|---|---|
committer | Felix Held <felix-coreboot@felixheld.de> | 2023-02-10 18:27:32 +0000 |
commit | 383a06ef8d567adb53f9c7031d711fcec32e7d0d (patch) | |
tree | 49eebd321ff58483f04af805225cb48306a4a225 /src | |
parent | f5a1ad1450aa53638600bc7c6a163f7aedf6bd27 (diff) |
acpi/acpigen: use acpigen_write_if_lgreater_* 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: I660bd5d357eb86c19a5a7847925f6176c3fb4425
Reviewed-on: https://review.coreboot.org/c/coreboot/+/72935
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.c | 20 |
1 files changed, 4 insertions, 16 deletions
diff --git a/src/acpi/acpigen.c b/src/acpi/acpigen.c index 63953b86b1..8eea91c5f4 100644 --- a/src/acpi/acpigen.c +++ b/src/acpi/acpigen.c @@ -2015,10 +2015,7 @@ void acpigen_write_rom(void *bios, const size_t length) /* ACPI SPEC requires to return at maximum 4KiB */ /* If (LGreater (Local1, 0x1000)) */ - acpigen_write_if(); - acpigen_emit_byte(LGREATER_OP); - acpigen_emit_byte(LOCAL1_OP); - acpigen_write_integer(0x1000); + acpigen_write_if_lgreater_op_int(LOCAL1_OP, 0x1000); /* Store (0x1000, Local1) */ acpigen_write_store(); @@ -2034,10 +2031,7 @@ void acpigen_write_rom(void *bios, const size_t length) acpigen_emit_byte(LOCAL3_OP); /* If (LGreater (Local0, length)) */ - acpigen_write_if(); - acpigen_emit_byte(LGREATER_OP); - acpigen_emit_byte(LOCAL0_OP); - acpigen_write_integer(length); + acpigen_write_if_lgreater_op_int(LOCAL0_OP, length); /* Return(Buffer(Local1){0}) */ acpigen_emit_byte(RETURN_OP); @@ -2051,10 +2045,7 @@ void acpigen_write_rom(void *bios, const size_t length) acpigen_pop_len(); /* If (LGreater (Local0, length - 4096)) */ - acpigen_write_if(); - acpigen_emit_byte(LGREATER_OP); - acpigen_emit_byte(LOCAL0_OP); - acpigen_write_integer(length - 4096); + acpigen_write_if_lgreater_op_int(LOCAL0_OP, length - 4096); /* Subtract (length, Local0, Local2) */ acpigen_emit_byte(SUBTRACT_OP); @@ -2063,10 +2054,7 @@ void acpigen_write_rom(void *bios, const size_t length) acpigen_emit_byte(LOCAL2_OP); /* If (LGreater (Local1, Local2)) */ - acpigen_write_if(); - acpigen_emit_byte(LGREATER_OP); - acpigen_emit_byte(LOCAL1_OP); - acpigen_emit_byte(LOCAL2_OP); + acpigen_write_if_lgreater_op_op(LOCAL1_OP, LOCAL2_OP); /* Store (Local2, Local1) */ acpigen_write_store(); |