acpi: aml: add helper for Opcode Arg2 Arg2 [Dst] AML pattern
commit439e2a6e10ed7f5da819bf7dcaa54b8cfdbeab0d
authorIgor Mammedov <imammedo@redhat.com>
Wed, 9 Dec 2015 23:41:01 +0000 (10 00:41 +0100)
committerMichael S. Tsirkin <mst@redhat.com>
Tue, 22 Dec 2015 16:39:20 +0000 (22 18:39 +0200)
tree8dc2c24082a34d4e63f705c79321339f4bff8c80
parent7e192a383b941d1f422117dd0915bbeff5fee5bd
acpi: aml: add helper for Opcode Arg2 Arg2 [Dst] AML pattern

Currently AML API doesn't compose terms in form of
following pattern:

   Opcode Arg2 Arg2 [Dst]

but ASL used in piix4/q35 DSDT ACPI tables uses that
form, so for clean conversion of it, AML API should
be able to handle an optional 'Dst' argumet used there.

Since above pattern is used by arithmetic/bit ops,
introduce helper that they could reuse.
It reduces code duplication in existing 5 aml_foo()
functions and also will prevent more duplication
when exiting functions are extended to support
optional 'Dst' argument.

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>
Reviewed-by: Shannon Zhao <shannon.zhao@linaro.org>
hw/acpi/aml-build.c