diff options
author | Igor Mammedov <imammedo@redhat.com> | 2015-12-10 00:41:00 +0100 |
---|---|---|
committer | Timothy Pearson <tpearson@raptorengineering.com> | 2019-11-29 19:28:21 -0600 |
commit | e504ad6b065ae7fb8659c3191dcb1b07ef6ddc64 (patch) | |
tree | 5cd2c48c484634748055e59e409f3783e1624d0e /hw/acpi/aml-build.c | |
parent | e8ac075f7b38d4ab79aa3f0bd2cacec6ea9718d9 (diff) | |
download | hqemu-e504ad6b065ae7fb8659c3191dcb1b07ef6ddc64.zip hqemu-e504ad6b065ae7fb8659c3191dcb1b07ef6ddc64.tar.gz |
acpi: add aml_create_qword_field()
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Marcel Apfelbaum <marcel@redhat.com>
Diffstat (limited to 'hw/acpi/aml-build.c')
-rw-r--r-- | hw/acpi/aml-build.c | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/hw/acpi/aml-build.c b/hw/acpi/aml-build.c index c4120ef..95f9af9 100644 --- a/hw/acpi/aml-build.c +++ b/hw/acpi/aml-build.c @@ -910,17 +910,30 @@ Aml *aml_field(const char *name, AmlAccessType type, AmlUpdateRule rule) return var; } -/* ACPI 1.0b: 16.2.5.2 Named Objects Encoding: DefCreateDWordField */ -Aml *aml_create_dword_field(Aml *srcbuf, Aml *index, const char *name) +static +Aml *create_field_common(int opcode, Aml *srcbuf, Aml *index, const char *name) { - Aml *var = aml_alloc(); - build_append_byte(var->buf, 0x8A); /* CreateDWordFieldOp */ + Aml *var = aml_opcode(opcode); aml_append(var, srcbuf); aml_append(var, index); build_append_namestring(var->buf, "%s", name); return var; } +/* ACPI 1.0b: 16.2.5.2 Named Objects Encoding: DefCreateDWordField */ +Aml *aml_create_dword_field(Aml *srcbuf, Aml *index, const char *name) +{ + return create_field_common(0x8A /* CreateDWordFieldOp */, + srcbuf, index, name); +} + +/* ACPI 2.0a: 17.2.4.2 Named Objects Encoding: DefCreateQWordField */ +Aml *aml_create_qword_field(Aml *srcbuf, Aml *index, const char *name) +{ + return create_field_common(0x8F /* CreateQWordFieldOp */, + srcbuf, index, name); +} + /* ACPI 1.0b: 16.2.3 Data Objects Encoding: String */ Aml *aml_string(const char *name_format, ...) { |