On 2015/4/28 14:56, Igor Mammedov wrote: > On Wed, 15 Apr 2015 21:25:03 +0800 > Shannon Zhao <zhaoshengl...@huawei.com> wrote: > >> From: Shannon Zhao <shannon.z...@linaro.org> >> >> Add aml_or() term and expose build_append_int_noprefix >> as it wiil be used by creating a buffer. >> >> Signed-off-by: Shannon Zhao <zhaoshengl...@huawei.com> >> Signed-off-by: Shannon Zhao <shannon.z...@linaro.org> >> --- >> hw/acpi/aml-build.c | 12 +++++++++++- >> include/hw/acpi/aml-build.h | 2 ++ >> 2 files changed, 13 insertions(+), 1 deletion(-) >> >> diff --git a/hw/acpi/aml-build.c b/hw/acpi/aml-build.c >> index 316d5a5..cd4ffe2 100644 >> --- a/hw/acpi/aml-build.c >> +++ b/hw/acpi/aml-build.c >> @@ -242,7 +242,7 @@ static void build_extop_package(GArray *package, uint8_t >> op) >> build_prepend_byte(package, 0x5B); /* ExtOpPrefix */ >> } >> >> -static void build_append_int_noprefix(GArray *table, uint64_t value, int >> size) >> +void build_append_int_noprefix(GArray *table, uint64_t value, int size) >> { >> int i; >> >> @@ -456,6 +456,16 @@ Aml *aml_and(Aml *arg1, Aml *arg2) >> return var; >> } >> >> +/* ACPI 1.0b: 16.2.5.4 Type 2 Opcodes Encoding: DefOr */ >> +Aml *aml_or(Aml *arg1, Aml *arg2) >> +{ >> + Aml *var = aml_opcode(0x7D /* OrOp */); >> + aml_append(var, arg1); >> + aml_append(var, arg2); >> + build_append_byte(var->buf, 0x00 /* NullNameOp */); >> + return var; >> +} >> + >> /* ACPI 1.0b: 16.2.5.3 Type 1 Opcodes Encoding: DefNotify */ >> Aml *aml_notify(Aml *arg1, Aml *arg2) >> { >> diff --git a/include/hw/acpi/aml-build.h b/include/hw/acpi/aml-build.h >> index b41fd0c..61c1a03 100644 >> --- a/include/hw/acpi/aml-build.h >> +++ b/include/hw/acpi/aml-build.h >> @@ -202,6 +202,7 @@ Aml *aml_int(const uint64_t val); >> Aml *aml_arg(int pos); >> Aml *aml_store(Aml *val, Aml *target); >> Aml *aml_and(Aml *arg1, Aml *arg2); >> +Aml *aml_or(Aml *arg1, Aml *arg2); >> Aml *aml_notify(Aml *arg1, Aml *arg2); >> Aml *aml_call1(const char *method, Aml *arg1); >> Aml *aml_call2(const char *method, Aml *arg1, Aml *arg2); >> @@ -260,6 +261,7 @@ Aml *aml_resource_template(void); >> Aml *aml_field(const char *name, AmlFieldFlags flags); >> Aml *aml_varpackage(uint32_t num_elements); >> Aml *aml_touuid(const char *uuid); >> +void build_append_int_noprefix(GArray *table, uint64_t value, int size); > why does it exports internal function and
This will be used for adding elements to buffer like in ptach 19/20. + buf = aml_buffer(); + build_append_int_noprefix(buf->buf, 0x01, 1); > why it's related to this patch in particular? I should move this to another patch. -- Thanks, Shannon