[PATCH] acpi: acpidump: update SMM Communication fields on UEFI table

Alex Hung alex.hung at canonical.com
Thu Jul 2 02:26:56 UTC 2015


On 06/30/2015 04:28 PM, Ivan Hu wrote:
> The first use of UEFI ACPI table format is the SMM Communication ACPI Table.
> Defined in UEFI spec Appendix O. Checking the SMM Communication ACPI GUID and
> dumping relative fields.
> 
> Signed-off-by: Ivan Hu <ivan.hu at canonical.com>
> ---
>  src/acpi/acpidump/acpidump.c | 28 +++++++++++++++++++++++-----
>  src/lib/include/fwts_acpi.h  |  7 +++++++
>  2 files changed, 30 insertions(+), 5 deletions(-)
> 
> diff --git a/src/acpi/acpidump/acpidump.c b/src/acpi/acpidump/acpidump.c
> index 683a50f..c55956c 100644
> --- a/src/acpi/acpidump/acpidump.c
> +++ b/src/acpi/acpidump/acpidump.c
> @@ -1587,17 +1587,35 @@ static void acpidump_slic(fwts_framework *fw, const fwts_acpi_table_info *table)
>   */
>  static void acpidump_uefi(fwts_framework *fw, const fwts_acpi_table_info *table)
>  {
> +
> +	/*
> +	 * GUID for SMM Communication ACPI Table
> +	 * {0xc68ed8e2, 0x9dc6, 0x4cbd, 0x9d, 0x94, 0xdb, 0x65, 0xac, 0xc5, 0xc3, 0x32}
> +	*/
> +	static const uint8_t guid_smm[16] = { 0xe2, 0xd8, 0x8e, 0xc6, 0xc6, 0x9d, 0xbd, 0x4c,
> +						0x9d, 0x94, 0xdb, 0x65, 0xac, 0xc5, 0xc3, 0x32 };
> +
>  	fwts_acpi_table_uefi *uefi = (fwts_acpi_table_uefi *)table->data;
>  
> -	static const fwts_acpidump_field uefi_fields[] = {
> +	static const fwts_acpidump_field boot_fields[] = {

Is "boot_fields" a copy-and-pasted error? uefi_fields seems more
reasonable here.

Everything else looks good.

>  		FIELD_GUID("UUID", 	fwts_acpi_table_uefi, uuid),
> +		FIELD_UINT("DataOffset", fwts_acpi_table_uefi, dataoffset),
>  		FIELD_END
>  	};
>  
> -	__acpi_dump_table_fields(fw, table->data, uefi_fields, 0);
> -	fwts_log_nl(fw);
> -	acpi_dump_raw_data(fw, uefi->data, table->length - sizeof(fwts_acpi_table_uefi),
> -		sizeof(fwts_acpi_table_uefi));
> +	static const fwts_acpidump_field smmcomm_fields[] = {
> +		FIELD_UINT("SW SMI Number", 	fwts_acpi_table_uefi_smmcomm, sw_smi_number),
> +		FIELD_UINT("Buffer Prt Address", fwts_acpi_table_uefi_smmcomm, buf_ptr_addr),
> +		FIELD_END
> +	};
> +	__acpi_dump_table_fields(fw, table->data, boot_fields, 0);
> +
> +	if (memcmp(uefi->uuid, guid_smm, 16) != 0) {
> +		fwts_log_nl(fw);
> +		acpi_dump_raw_data(fw, uefi->data, table->length - sizeof(fwts_acpi_table_uefi),
> +				sizeof(fwts_acpi_table_uefi));
> +	} else
> +		__acpi_dump_table_fields(fw, table->data, smmcomm_fields, 0);
>  }
>  
>  /*
> diff --git a/src/lib/include/fwts_acpi.h b/src/lib/include/fwts_acpi.h
> index e27c68c..55db8e1 100644
> --- a/src/lib/include/fwts_acpi.h
> +++ b/src/lib/include/fwts_acpi.h
> @@ -696,9 +696,16 @@ typedef struct {
>  typedef struct {
>  	fwts_acpi_table_header header;
>  	uint8_t		uuid[16];
> +	uint16_t	dataoffset;
>  	uint8_t		data[0];
>  } __attribute__ ((packed)) fwts_acpi_table_uefi;
>  
> +typedef struct {
> +	fwts_acpi_table_uefi boot;
> +	uint32_t	sw_smi_number;
> +	uint64_t	buf_ptr_addr;
> +} __attribute__ ((packed)) fwts_acpi_table_uefi_smmcomm;
> +
>  /* 5.2.22 Boot Graphics Resource Table (BGRT) ACPI 5.0 Spec */
>  typedef struct {
>  	fwts_acpi_table_header header;
> 


-- 
Cheers,
Alex Hung



More information about the fwts-devel mailing list