Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/usr.sbin/acpitools/acpidump Dump TPM2.
details: https://anonhg.NetBSD.org/src/rev/8ab4fc7a5cea
branches: trunk
changeset: 999882:8ab4fc7a5cea
user: maxv <maxv%NetBSD.org@localhost>
date: Sat Jun 22 12:39:40 2019 +0000
description:
Dump TPM2.
diffstat:
usr.sbin/acpitools/acpidump/acpi.c | 32 ++++++++++++++++++++++++++++++--
usr.sbin/acpitools/acpidump/acpidump.8 | 5 +++--
2 files changed, 33 insertions(+), 4 deletions(-)
diffs (93 lines):
diff -r a8449e7306e2 -r 8ab4fc7a5cea usr.sbin/acpitools/acpidump/acpi.c
--- a/usr.sbin/acpitools/acpidump/acpi.c Sat Jun 22 10:58:39 2019 +0000
+++ b/usr.sbin/acpitools/acpidump/acpi.c Sat Jun 22 12:39:40 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi.c,v 1.45 2019/04/29 02:49:35 dogcow Exp $ */
+/* $NetBSD: acpi.c,v 1.46 2019/06/22 12:39:40 maxv Exp $ */
/*-
* Copyright (c) 1998 Doug Rabson
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__RCSID("$NetBSD: acpi.c,v 1.45 2019/04/29 02:49:35 dogcow Exp $");
+__RCSID("$NetBSD: acpi.c,v 1.46 2019/06/22 12:39:40 maxv Exp $");
#include <sys/param.h>
#include <sys/endian.h>
@@ -115,6 +115,7 @@
static void acpi_print_srat(ACPI_SUBTABLE_HEADER *srat);
static void acpi_handle_srat(ACPI_TABLE_HEADER *sdp);
static void acpi_handle_tcpa(ACPI_TABLE_HEADER *sdp);
+static void acpi_handle_tpm2(ACPI_TABLE_HEADER *sdp);
static void acpi_print_nfit(ACPI_NFIT_HEADER *nfit);
static void acpi_handle_nfit(ACPI_TABLE_HEADER *sdp);
static void acpi_handle_uefi(ACPI_TABLE_HEADER *sdp);
@@ -3339,6 +3340,31 @@
printf(END_COMMENT);
}
+static void
+acpi_handle_tpm2(ACPI_TABLE_HEADER *sdp)
+{
+ ACPI_TABLE_TPM2 *tpm2;
+ const char *class;
+
+ printf(BEGIN_COMMENT);
+
+ acpi_print_sdt(sdp);
+ tpm2 = (ACPI_TABLE_TPM2 *)sdp;
+
+ if (tpm2->PlatformClass == 0) {
+ class = "Client";
+ } else if (tpm2->PlatformClass == 1) {
+ class = "Server";
+ } else {
+ class = "Unknown";
+ }
+ printf("\tClass=%s (%u)\n", class, tpm2->PlatformClass);
+ printf("\tControl Address=0x%"PRIx64"\n", tpm2->ControlAddress);
+ printf("\tStart Method=%u\n", tpm2->StartMethod);
+
+ printf(END_COMMENT);
+}
+
static const char *
devscope_type2str(int type)
{
@@ -4297,6 +4323,8 @@
acpi_handle_srat(sdp);
else if (!memcmp(sdp->Signature, ACPI_SIG_TCPA, 4))
acpi_handle_tcpa(sdp);
+ else if (!memcmp(sdp->Signature, ACPI_SIG_TPM2, 4))
+ acpi_handle_tpm2(sdp);
else if (!memcmp(sdp->Signature, ACPI_SIG_NFIT, 4))
acpi_handle_nfit(sdp);
else if (!memcmp(sdp->Signature, ACPI_SIG_UEFI, 4))
diff -r a8449e7306e2 -r 8ab4fc7a5cea usr.sbin/acpitools/acpidump/acpidump.8
--- a/usr.sbin/acpitools/acpidump/acpidump.8 Sat Jun 22 10:58:39 2019 +0000
+++ b/usr.sbin/acpitools/acpidump/acpidump.8 Sat Jun 22 12:39:40 2019 +0000
@@ -1,4 +1,4 @@
-.\" $NetBSD: acpidump.8,v 1.15 2018/12/02 10:51:07 msaitoh Exp $
+.\" $NetBSD: acpidump.8,v 1.16 2019/06/22 12:39:40 maxv Exp $
.\" ACPI (ACPI Package)
.\"
.\" Copyright (c) 1999 Doug Rabson <dfr%FreeBSD.org@localhost>
@@ -30,7 +30,7 @@
.\"
.\" $FreeBSD: head/usr.sbin/acpi/acpidump/acpidump.8 267668 2014-06-20 09:57:27Z bapt $
.\"
-.Dd December 2, 2018
+.Dd June 22, 2019
.Dt ACPIDUMP 8
.Os
.Sh NAME
@@ -128,6 +128,7 @@
.It SPMI
.It SRAT
.It TCPA
+.It TPM2
.It UEFI
.It WAET
.It WDAT
Home |
Main Index |
Thread Index |
Old Index