src/acpi: add function gen: if_lgreater_ and namestr assignment

1. add functions to generate if greater than conditions:
acpigen_write_if_lgreater_op_op:
   if (op1 > op2)
acpigen_write_if_lgreater_op_int:
   if (op > val)
acpigen_write_if_lgreater_namestr_int:
   if (namestr > val)
2. add function to assignal value to a namestr
 acpigen_write_store_namestr_to_op:
   namestr = val

TEST=Use above functions and check the generated SSDT table after OS
boot.

Signed-off-by: Cliff Huang <cliff.huang@intel.com>
Change-Id: Iffe1b23362a7ab58bdc2aa8daf45cd6f086ee818
Reviewed-on: https://review.coreboot.org/c/coreboot/+/72825
Reviewed-by: Eric Lai <eric_lai@quanta.corp-partner.google.com>
Reviewed-by: Jérémy Compostella <jeremy.compostella@intel.com>
Reviewed-by: Anil Kumar K <anil.kumar.k@intel.corp-partner.google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
Cliff Huang
2023-02-04 21:11:51 -08:00
committed by Felix Held
parent 9a5a9635b7
commit 24f3dc8a17
2 changed files with 54 additions and 0 deletions

View File

@@ -487,6 +487,7 @@ 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_store_namestr_to_op(const char *src, uint8_t dst);
void acpigen_write_or(uint8_t arg1, uint8_t arg2, uint8_t res);
void acpigen_write_xor(uint8_t arg1, uint8_t arg2, uint8_t res);
void acpigen_write_and(uint8_t arg1, uint8_t arg2, uint8_t res);
@@ -506,8 +507,11 @@ void acpigen_write_debug_concatenate_string_op(const char *str1, uint8_t res, ui
void acpigen_write_if(void);
void acpigen_write_if_and(uint8_t arg1, uint8_t arg2);
void acpigen_write_if_lequal_op_op(uint8_t op, uint8_t val);
void acpigen_write_if_lgreater_op_op(uint8_t op1, uint8_t op2);
void acpigen_write_if_lequal_op_int(uint8_t op, uint64_t val);
void acpigen_write_if_lgreater_op_int(uint8_t op, uint64_t val);
void acpigen_write_if_lequal_namestr_int(const char *namestr, uint64_t val);
void acpigen_write_if_lgreater_namestr_int(const char *namestr, uint64_t val);
__always_inline void acpigen_write_if_end(void)
{
acpigen_pop_len();