acpi: include PkgLength size only when requested
commit19fff2d405d3bcc88fd7b860ec47797b3f7af977
authorIgor Mammedov <imammedo@redhat.com>
Wed, 18 Feb 2015 19:14:33 +0000 (18 19:14 +0000)
committerMichael S. Tsirkin <mst@redhat.com>
Thu, 26 Feb 2015 12:04:14 +0000 (26 13:04 +0100)
tree2bf7e7c4a984cad9d8588e8a674cc81f0d5d57f2
parent52fa397c58667080979e8aa64177c0f69b1851b7
acpi: include PkgLength size only when requested

Named/Reserved{Field} definition uses PkgLength [1] encoding to specify
field length, however it doesn't include size of PkgLength field itself,
while other block objects that have explicit length of its body account
for PkgLength size while encoding it [2].
This special casing isn't mentioned in ACPI spec, but that's what 'iasl'
compiles NamedField to so add extra argument to build_prepend_pkg_length()
to allow it handle the case.

--
1. ACPI Spec 5.0, 20.2.5.2 Named Objects Encoding, page 822
2. ACPI Spec 5.0, 5.4 Definition Block Encoding

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>
hw/acpi/aml-build.c
include/hw/acpi/aml-build.h