ACK: [PATCH 03/16] lib: fwts_acpi_tables: update fwts_get_acpi_version (mantis: 2105)
Colin Ian King
colin.king at canonical.com
Tue Jan 26 20:42:30 UTC 2021
On 26/01/2021 20:30, Alex Hung wrote:
> ACPI 6.4 changes FADT minor format to include errata as followings:
>
> Bits 0-3 - The low order bits correspond to the minor
> version of the specification version. For instance, ACPI
> 6.3 has a major version of 6, and a minor version of 3.
>
> Bits 4-7 - The high order bits correspond to the version
> of the ACPI Specification errata this table complies
> with. A value of 0 means that it complies with the base
> version of the current specification. A value of 1 means
> this is compatible with Errata A, 2 would be
> compatible with Errata B, and so on.
Urgh, what an ugly change in the spec. :-(
>
> Signed-off-by: Alex Hung <alex.hung at canonical.com>
> ---
> src/lib/src/fwts_acpi_tables.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/src/lib/src/fwts_acpi_tables.c b/src/lib/src/fwts_acpi_tables.c
> index f2824cdf..ae3b732f 100644
> --- a/src/lib/src/fwts_acpi_tables.c
> +++ b/src/lib/src/fwts_acpi_tables.c
> @@ -1757,6 +1757,7 @@ uint32_t fwts_get_acpi_version(fwts_framework *fw)
> {
> fwts_acpi_table_fadt *fadt;
> fwts_acpi_table_info *table;
> + uint8_t minor;
>
> if (acpi_version != 0)
> return acpi_version;
> @@ -1772,7 +1773,8 @@ uint32_t fwts_get_acpi_version(fwts_framework *fw)
> }
>
> fadt = (fwts_acpi_table_fadt *) table->data;
> - acpi_version = (fadt->header.revision << 8) + (fadt->minor_version << 4);
> + minor = ((fadt->minor_version && 0xF) << 4) + ((fadt->minor_version && 0xF0) >> 4);
> + acpi_version = (fadt->header.revision << 8) + minor;
>
> /* check FACP returns an invalid value */
> if (acpi_version > FWTS_ACPI_VERSION_NEXT ||
>
Acked-by: Colin Ian King <colin.king at canonical.com>
More information about the fwts-devel
mailing list