arch/x86/acpigen: Add more functions to ACPIGEN library

1. If (LEqual (Op1, Op2))
2. ToBuffer (src, dst)
3. ToInteger (src, dst)
4. Buffer (n) { op1, op2 .... }
5. Return ( )

BUG=chrome-os-partner:57846

Change-Id: I24fe647c690b2dd4849f0c53b2672ac7a2caa2de
Signed-off-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-on: https://review.coreboot.org/17088
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
This commit is contained in:
Furquan Shaikh
2016-10-21 16:21:07 -07:00
committed by Furquan Shaikh
parent 3ce104e5d8
commit 9b39adb454
2 changed files with 63 additions and 0 deletions

View File

@@ -987,12 +987,65 @@ void acpigen_write_if_and(uint8_t arg1, uint8_t arg2)
acpigen_emit_byte(arg2);
}
void acpigen_write_if_lequal(uint8_t arg1, uint8_t arg2)
{
acpigen_write_if();
acpigen_emit_byte(LEQUAL_OP);
acpigen_emit_byte(arg1);
acpigen_emit_byte(arg2);
}
void acpigen_write_else(void)
{
acpigen_emit_byte(ELSE_OP);
acpigen_write_len_f();
}
void acpigen_write_to_buffer(uint8_t src, uint8_t dst)
{
acpigen_emit_byte(TO_BUFFER_OP);
acpigen_emit_byte(src);
acpigen_emit_byte(dst);
}
void acpigen_write_to_integer(uint8_t src, uint8_t dst)
{
acpigen_emit_byte(TO_INTEGER_OP);
acpigen_emit_byte(src);
acpigen_emit_byte(dst);
}
void acpigen_write_byte_buffer(uint8_t *arr, uint8_t size)
{
uint8_t i;
acpigen_emit_byte(BUFFER_OP);
acpigen_write_len_f();
acpigen_emit_byte(size);
for (i = 0; i < size; i++)
acpigen_emit_byte(arr[i]);
acpigen_pop_len();
}
void acpigen_write_return_byte_buffer(uint8_t *arr, uint8_t size)
{
acpigen_emit_byte(RETURN_OP);
acpigen_write_byte_buffer(arr, size);
}
void acpigen_write_return_singleton_buffer(uint8_t arg)
{
acpigen_write_return_byte_buffer(&arg, 1);
}
void acpigen_write_return_byte(uint8_t arg)
{
acpigen_emit_byte(RETURN_OP);
acpigen_write_byte(arg);
}
/* Soc-implemented functions -- weak definitions. */
int __attribute__((weak)) acpigen_soc_read_rx_gpio(unsigned int gpio_num)
{