[PATCH 1/2] acpi: acpidump: Add ACPI 5.0 BGRT support.
Alex Hung
alex.hung at canonical.com
Tue Jul 3 07:05:34 UTC 2012
On 06/30/2012 01:14 AM, Colin King wrote:
> From: Colin Ian King <colin.king at canonical.com>
>
> Adding support to ACPI 5.0 Boot Graphics Resource Table the acpidump
>
> Signed-off-by: Colin Ian King <colin.king at canonical.com>
> ---
> src/acpi/acpidump/acpidump.c | 24 ++++++++++++++++++++++++
> src/lib/include/fwts_acpi.h | 10 ++++++++++
> 2 files changed, 34 insertions(+)
>
> diff --git a/src/acpi/acpidump/acpidump.c b/src/acpi/acpidump/acpidump.c
> index c475628..9fc5204 100644
> --- a/src/acpi/acpidump/acpidump.c
> +++ b/src/acpi/acpidump/acpidump.c
> @@ -1437,6 +1437,29 @@ static void acpidump_uefi(fwts_framework *fw, fwts_acpi_table_info *table)
> sizeof(fwts_acpi_table_uefi));
> }
>
> +/*
> + * acpidump_bgrt()
> + * dump BGRT, see 5.2.22 Boot Graphics Resource Table (BGRT)
> + * of version 5.0 ACPI spec.
> + */
> +static void acpidump_bgrt(fwts_framework *fw, fwts_acpi_table_info *table)
> +{
> + uint8_t *data = (uint8_t *)table->data;
> + size_t length = table->length;
> +
> + static fwts_acpidump_field bgrt_fields[] = {
> + FIELD_UINT("Version", fwts_acpi_table_bgrt, version),
> + FIELD_UINT("Status", fwts_acpi_table_bgrt, status),
> + FIELD_UINT("Image Type", fwts_acpi_table_bgrt, image_type),
> + FIELD_UINT("Image Address", fwts_acpi_table_bgrt, image_addr),
> + FIELD_UINT("Image Offset X", fwts_acpi_table_bgrt, image_offset_x),
> + FIELD_UINT("Image Offset Y", fwts_acpi_table_bgrt, image_offset_t),
> + FIELD_END
> + };
> +
> + acpi_dump_table_fields(fw, data, bgrt_fields, length, length);
> +}
> +
> typedef struct {
> char *name;
> void (*func)(fwts_framework *fw, fwts_acpi_table_info *table);
> @@ -1452,6 +1475,7 @@ static acpidump_table_vec table_vec[] = {
> { "APIC", acpidump_madt, 1 },
> { "ASF!", acpidump_asf, 1 },
> { "BERT", acpidump_bert, 1 },
> + { "BGRT", acpidump_bgrt, 1 },
> { "BOOT", acpidump_boot, 1 },
> { "CPEP", acpidump_cpep, 1 },
> { "DSDT", acpidump_amlcode, 1 },
> diff --git a/src/lib/include/fwts_acpi.h b/src/lib/include/fwts_acpi.h
> index 7fdb67f..29a506d 100644
> --- a/src/lib/include/fwts_acpi.h
> +++ b/src/lib/include/fwts_acpi.h
> @@ -591,6 +591,16 @@ typedef struct {
> uint8_t data[0];
> } __attribute__ ((packed)) fwts_acpi_table_uefi;
>
> +/* 5.2.22 Boot Graphics Resource Table (BGRT) ACPI 5.0 Spec */
> +typedef struct {
> + uint16_t version;
> + uint8_t status;
> + uint8_t image_type;
> + uint64_t image_addr;
> + uint32_t image_offset_x;
> + uint32_t image_offset_t;
> +} __attribute__ ((packed)) fwts_acpi_table_bgrt;
> +
> void fwts_acpi_table_get_header(fwts_acpi_table_header *hdr, uint8_t *data);
>
> #endif
>
Acked-by: Alex Hung <alex.hung at canonical.com>
More information about the fwts-devel
mailing list