[PATCH 1/5] acpi: acpidump: Add dump of TCPA

Colin King colin.king at canonical.com
Fri Jun 29 13:11:03 UTC 2012


From: Colin Ian King <colin.king at canonical.com>

This is a fairly easy table to dump out, so lets add it to
the acpidump'ing tool.

Signed-off-by: Colin Ian King <colin.king at canonical.com>
---
 src/acpi/acpidump/acpidump.c |   16 +++++++++++++++-
 src/lib/include/fwts_acpi.h  |    9 +++++++++
 2 files changed, 24 insertions(+), 1 deletion(-)

diff --git a/src/acpi/acpidump/acpidump.c b/src/acpi/acpidump/acpidump.c
index fa71535..3b4b2d0 100644
--- a/src/acpi/acpidump/acpidump.c
+++ b/src/acpi/acpidump/acpidump.c
@@ -1025,6 +1025,20 @@ static void acpidump_srat(fwts_framework *fw, fwts_acpi_table_info *table)
 	}
 }
 
+static void acpidump_tcpa(fwts_framework *fw, fwts_acpi_table_info *table)
+{
+	uint8_t *data = (uint8_t *)table->data;
+	size_t length = table->length;
+
+	fwts_acpidump_field fields[] = {
+		FIELD_UINT("Reserved", 		fwts_acpi_table_tcpa, reserved),
+		FIELD_UINT("Log Zone Length", 	fwts_acpi_table_tcpa, log_zone_length),
+		FIELD_UINT("Log Zone Address", 	fwts_acpi_table_tcpa, log_zone_addr),
+		FIELD_END
+	};
+
+	acpi_dump_table_fields(fw, data, fields, length, length);
+}
 
 typedef struct {
 	char *name;
@@ -1059,6 +1073,7 @@ static acpidump_table_vec table_vec[] = {
 	{ "SSDT", 	acpidump_amlcode, 1 },
 	{ "SLIT", 	acpidump_slit,  1 },
 	{ "SRAT", 	acpidump_srat,  1 },
+	{ "TCPA",	acpidump_tcpa,	1 },
 	{ "XSDT", 	acpidump_xsdt, 	1 },
 	{ NULL,		NULL,		0 },
 };
@@ -1107,7 +1122,6 @@ static int acpidump_test1(fwts_framework *fw)
 	return FWTS_OK;
 }
 
-
 static fwts_framework_minor_test acpidump_tests[] = {
 	{ acpidump_test1, "Dump ACPI tables." },
 	{ NULL, NULL }
diff --git a/src/lib/include/fwts_acpi.h b/src/lib/include/fwts_acpi.h
index 180a83e..c5fe9d5 100644
--- a/src/lib/include/fwts_acpi.h
+++ b/src/lib/include/fwts_acpi.h
@@ -419,6 +419,15 @@ typedef struct {
 	uint8_t		reserved[3];
 } __attribute__ ((packed)) fwts_acpi_madt_local_x2apic_nmi;
 
+/* From http://www.kuro5hin.org/story/2002/10/27/16622/530,
+   and also http://www.cl.cam.ac.uk/~rja14/tcpa-faq.html */
+typedef struct {
+	fwts_acpi_table_header	header;	
+	uint16_t	reserved;
+	uint32_t	log_zone_length;
+	uint64_t	log_zone_addr;
+}  __attribute__ ((packed)) fwts_acpi_table_tcpa;
+
 void fwts_acpi_table_get_header(fwts_acpi_table_header *hdr, uint8_t *data);
 
 #endif
-- 
1.7.10.4





More information about the fwts-devel mailing list