From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from EUR02-VE1-obe.outbound.protection.outlook.com (EUR02-VE1-obe.outbound.protection.outlook.com [40.107.2.44]) by mx.groups.io with SMTP id smtpd.web12.10696.1588693581894746032 for ; Tue, 05 May 2020 08:46:22 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=cROlZwJ/; spf=pass (domain: arm.com, ip: 40.107.2.44, mailfrom: krzysztof.koch@arm.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=m+ICCV54uSnBQ7v6nyogxbyS7FGEoF+HkQWGUoprtTY=; b=cROlZwJ/+xcYBROJOcgJltFUSfdPHo1TSVZDlo3UKhLdbynu/rfkfr4gsJbETvV8hZ6quzeS/G5r4a4MqSTo9vwkxFunssaCG6xADMr7vVqdqhbG0cOAcXjvVJ/4IjRcPM2qoVRJtpAoM9rvGASPKYqIIt14xZbHIx52V4pLF0U= Received: from AM7PR04CA0006.eurprd04.prod.outlook.com (2603:10a6:20b:110::16) by HE1PR0801MB2108.eurprd08.prod.outlook.com (2603:10a6:3:51::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2958.21; Tue, 5 May 2020 15:46:19 +0000 Received: from VE1EUR03FT046.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:110:cafe::32) by AM7PR04CA0006.outlook.office365.com (2603:10a6:20b:110::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2958.20 via Frontend Transport; Tue, 5 May 2020 15:46:19 +0000 Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; edk2.groups.io; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;edk2.groups.io; dmarc=bestguesspass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by VE1EUR03FT046.mail.protection.outlook.com (10.152.19.226) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2958.20 via Frontend Transport; Tue, 5 May 2020 15:46:18 +0000 Received: ("Tessian outbound b3a67fbfbb1f:v54"); Tue, 05 May 2020 15:46:18 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 183ecd3ec8c5d1e7 X-CR-MTA-TID: 64aa7808 Received: from 73efd33e49d0.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 12AFBE3E-E75A-4D37-9A93-434844198231.1; Tue, 05 May 2020 15:46:12 +0000 Received: from EUR04-DB3-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 73efd33e49d0.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Tue, 05 May 2020 15:46:12 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gvIj5ceEQnjZ6Dj0/kZjeXTxMQ5gW2GrxjGmncE6nwGuiNrc7UpbPxfLSWNIXVyBuUg3hlerC6zjDg5PxvBYp3CZ+6G3EjV2gaDpX+YUqvc4c9GveYEwf8zfuB9zmgZWr3G+wxtuSHea5uLoUHvHm/ZjfC5othehyr4z0ySA7JynHoP5vwAvyVMW9RpLiAU7mtCol3tV6SjKMUD/2fxcfdqqipJ+S/D0FghSg8nbO9STH0YfWrKKs6kG1nCzW/9nLo70Qk5+ibrPhkqWWfC0/GS6fXLyDIYjsz1aLKr7Sa1M2dzdfrgYx9HGPgd2xyMtlD9a0unUURDdkZ/FOHDHrQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=m+ICCV54uSnBQ7v6nyogxbyS7FGEoF+HkQWGUoprtTY=; b=IGcq2B1c8njSmY0PnlqHBQ/AB1RFyitOvaJ7Df2etplbU5ECbhHEZHPWjBq3SwJW85a6cpqcwYCogqT33ysf2ekMe+wgBbTLxACW5izmc8Vu79HLqtmLDy5u4Qzg0cu1IJRazu+7JImCQ5iur5jD1yJKiPPy5UAbq4mn04tDjloxM64t/VXlpex3qUa+TtVhhsboHA/TuLUzcaZqgJYpUPhYRA9yYOmQjbxhoHUMgXIQnasI2Em3DQGyOZYVYQQmaPA+jOVuB56pF3DV9odEbnwSammd5rnJIfeDsfRvxbVX3JS3Dm/DpPNl0rplUg5X8CV5Ld1lZfcVy399o4RHJA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 40.67.248.234) smtp.rcpttodomain=edk2.groups.io smtp.mailfrom=arm.com; dmarc=bestguesspass action=none header.from=arm.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=m+ICCV54uSnBQ7v6nyogxbyS7FGEoF+HkQWGUoprtTY=; b=cROlZwJ/+xcYBROJOcgJltFUSfdPHo1TSVZDlo3UKhLdbynu/rfkfr4gsJbETvV8hZ6quzeS/G5r4a4MqSTo9vwkxFunssaCG6xADMr7vVqdqhbG0cOAcXjvVJ/4IjRcPM2qoVRJtpAoM9rvGASPKYqIIt14xZbHIx52V4pLF0U= Received: from DB6PR07CA0201.eurprd07.prod.outlook.com (2603:10a6:6:42::31) by DB6PR0801MB1687.eurprd08.prod.outlook.com (2603:10a6:4:39::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2958.29; Tue, 5 May 2020 15:46:12 +0000 Received: from DB5EUR03FT058.eop-EUR03.prod.protection.outlook.com (2603:10a6:6:42:cafe::13) by DB6PR07CA0201.outlook.office365.com (2603:10a6:6:42::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.17 via Frontend Transport; Tue, 5 May 2020 15:46:12 +0000 Authentication-Results-Original: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; edk2.groups.io; dkim=none (message not signed) header.d=none;edk2.groups.io; dmarc=bestguesspass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 40.67.248.234 as permitted sender) receiver=protection.outlook.com; client-ip=40.67.248.234; helo=nebula.arm.com; Received: from nebula.arm.com (40.67.248.234) by DB5EUR03FT058.mail.protection.outlook.com (10.152.20.255) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.2958.20 via Frontend Transport; Tue, 5 May 2020 15:46:11 +0000 Received: from AZ-NEU-EX01.Emea.Arm.com (10.251.26.4) by AZ-NEU-EX04.Arm.com (10.251.24.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.1415.2; Tue, 5 May 2020 15:46:07 +0000 Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) by AZ-NEU-EX01.Emea.Arm.com (10.251.26.4) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1779.2; Tue, 5 May 2020 15:46:07 +0000 Received: from E119924.Arm.com (10.57.59.39) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.1415.2 via Frontend Transport; Tue, 5 May 2020 15:46:07 +0000 From: "Krzysztof Koch" To: CC: , , , , Subject: [PATCH v1 3/6] ShellPkg: acpiview: Make SRAT parsing logic data driven Date: Tue, 5 May 2020 16:46:01 +0100 Message-ID: <20200505154604.9848-4-krzysztof.koch@arm.com> X-Mailer: git-send-email 2.16.2.windows.1 In-Reply-To: <20200505154604.9848-1-krzysztof.koch@arm.com> References: <20200505154604.9848-1-krzysztof.koch@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report-Untrusted: CIP:40.67.248.234;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:nebula.arm.com;PTR:InfoDomainNonexistent;CAT:NONE;SFTY:;SFS:(4636009)(136003)(39860400002)(346002)(376002)(396003)(46966005)(33430700001)(33440700001)(478600001)(1076003)(5660300002)(6666004)(86362001)(36756003)(2906002)(26005)(82310400002)(70206006)(186003)(4326008)(70586007)(19627235002)(336012)(2616005)(426003)(44832011)(81166007)(6916009)(356005)(7696005)(316002)(8936002)(82740400003)(47076004)(54906003)(8676002);DIR:OUT;SFP:1101; X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d68967b0-8243-4a2a-68b9-08d7f10b73d7 X-MS-TrafficTypeDiagnostic: DB6PR0801MB1687:|HE1PR0801MB2108: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:9508;OLM:9508; X-Forefront-PRVS: 0394259C80 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: yC5JQTM08Mg49XTdNf+wZSzxdPBtbw3uYJ8iNA0bjksQuc/2+XfVIiJy6FtkrRluc//mmqveb91EmuI9AGOSBGc0j0C09PsFJASI0LN6dDxhQ595K+YVuGazOZCK3f4RODucq7wVXxd7UW1e1J+y73uUcYB749gd+47DCCg3tMzoHQTdcmZnMd6kjliwri43HwPX+rvir5klfHqjJZrbUDdIea/Y6+/JlMDtJVs9EfeGAo+3AzhdNF7yGPQr/QXT7moi7hsol8LFb9vtVIV9KmGbxC4rp7PVmFyEm+yq2FT1asDKEelMwE8PPf6BAndynMrkjwJooKdglJF/ecXCsYOsM6G06dz3g9sJynYNFYQBCGtHd7URNQdYU5HAUll7UNA3Nwrp6dLpceRYcG0I+bWQWjVtXnumc5/m8ssE2xE4lrU38MoK7oT9UiR5TXmwyVErrjz4dMm5dhDGkFGfSXUyQvpzuamDAldp7kaEJrPlGhR6yltHwP8mVniJVwd6MprgC29Eu6LjGkvl2pvHeLL5hfj3a+CZVdEilGPSuT7itvABNS4LGbYlSQy8HnjPWAu0V0qhJ/bqLnEPhPO+Ow== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0801MB1687 Original-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; edk2.groups.io; dkim=none (message not signed) header.d=none;edk2.groups.io; dmarc=bestguesspass action=none header.from=arm.com; Return-Path: Krzysztof.Koch@arm.com X-MS-Exchange-Transport-CrossTenantHeadersStripped: VE1EUR03FT046.eop-EUR03.prod.protection.outlook.com X-Forefront-Antispam-Report: CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFTY:;SFS:(4636009)(136003)(346002)(39860400002)(376002)(396003)(46966005)(33430700001)(36756003)(70586007)(70206006)(44832011)(81166007)(47076004)(19627235002)(82310400002)(336012)(82740400003)(5660300002)(478600001)(8676002)(6916009)(54906003)(316002)(33440700001)(2906002)(8936002)(426003)(1076003)(36906005)(186003)(26005)(2616005)(4326008)(7696005)(6666004)(86362001);DIR:OUT;SFP:1101; X-MS-Office365-Filtering-Correlation-Id-Prvs: 934dbb30-e880-4f20-6c26-08d7f10b6fcf X-Forefront-PRVS: 0394259C80 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: io7HOv5N3qlakkdD4wqqxuFLnNYjrzG03OFnw3E7f6uW9/E5TgdUIq5nCjmm92LQ5FaclxILYKhWfVVflPZpYteBIhQ5DQociQComt2v9EDGTjVb5cRBaubXATaXWX9PwitP2f8YnbD5RLvDJ77c3Y2/QbV3dZ3Bv6ncZNYr+3g9/InI3k9kaTCqumWWBZ92kmjQCXRORZSgQNbYGR4SNo9RWoUAto+AKxF9SwpXr7g8cjMXgXJiwt89WWmgseNmSiN+HdhkxoMzvreaZtCFTm9UdqANSiSNqwjzpUVmlGKyPMJr4GSkA0RkPZWZWOLxOSXwRiACi7ZIoleS2bjtsxOnwodaizj9kRjGMl8cZWstH7SddLGuOkE7m0gKs8YVbKcBelYRjNk0d7+AfYQ7MtpbRTPHtbfIyvkvafmnmKkzQDtG/Ed6ykdjJuloPRzVjU52bo7enbQhTz9AjxLLrrttRdXKb6JYy0eXIzLDLo/Cwh5/v8EW7N/dKI3n92anfjslIzISGEe2lcaxj2CZXP0n6BY7EFZvNqWMS3dhK2Vx5DUEza0wu9VcSTxtGaoeX/kMwW/W6DMAGx2TagSSNA== X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 May 2020 15:46:18.5206 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d68967b0-8243-4a2a-68b9-08d7f10b73d7 X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR0801MB2108 Content-Type: text/plain Replace the switch statement in the main parser loop with a table-driven approach. Use the ParseAcpiStruct () method to resolve how each Static Resource Allocation Structure given should be parsed. Print the offset of each Static Resource Allocation Structure from the start of the table. Consolidate all metadata about each Static Resource Allocation Structure. Define an array of ACPI_STRUCT_INFO structures to store the name, instance count, architecture support and handling information. Use this array to construct the ACPI_STRUCT_DATABASE for the System Resource Affinity Table (SRAT). Count the number of instances of each Static Resource Allocation Structure type. Optionally report these counts after SRAT table parsing is finished and validate that Advanced Programmable Interrupt Controller (APIC) structures are not present on Arm-based platforms. References: - ACPI 6.3 Specification - January 2019, Section 5.2.16 Signed-off-by: Krzysztof Koch --- Notes: v1: - Make SRAT parsing logic data driven [Krzysztof] ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Srat/SratParser.c | 204 ++++++++------------ 1 file changed, 77 insertions(+), 127 deletions(-) diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Srat/SratParser.c b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Srat/SratParser.c index 6f66be68cc0bed14811a0432c61a79fd47c54890..8ec233a52861b039979bb8291b3c90193acd86fa 100644 --- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Srat/SratParser.c +++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Srat/SratParser.c @@ -13,6 +13,7 @@ #include #include "AcpiParser.h" #include "AcpiTableParser.h" +#include "AcpiView.h" // Local Variables STATIC CONST UINT8* SratRAType; @@ -330,6 +331,57 @@ STATIC CONST ACPI_PARSER SratX2ApciAffinityParser[] = { {L"Reserved", 4, 20, L"0x%x", NULL, NULL, NULL, NULL} }; +/** + Information about each Static Resource Allocation Structure type. +**/ +STATIC ACPI_STRUCT_INFO SratStructs[] = { + ADD_ACPI_STRUCT_INFO_ARRAY ( + "Processor Local APIC/SAPIC Affinity", + EFI_ACPI_6_3_PROCESSOR_LOCAL_APIC_SAPIC_AFFINITY, + ARCH_COMPAT_IA32 | ARCH_COMPAT_X64, + SratApciSapicAffinityParser + ), + ADD_ACPI_STRUCT_INFO_ARRAY ( + "Memory Affinity", + EFI_ACPI_6_3_MEMORY_AFFINITY, + ARCH_COMPAT_IA32 | ARCH_COMPAT_X64 | ARCH_COMPAT_ARM | ARCH_COMPAT_AARCH64, + SratMemAffinityParser + ), + ADD_ACPI_STRUCT_INFO_ARRAY ( + "Processor Local x2APIC Affinity", + EFI_ACPI_6_3_PROCESSOR_LOCAL_X2APIC_AFFINITY, + ARCH_COMPAT_IA32 | ARCH_COMPAT_X64, + SratX2ApciAffinityParser + ), + ADD_ACPI_STRUCT_INFO_ARRAY ( + "GICC Affinity Structure", + EFI_ACPI_6_3_GICC_AFFINITY, + ARCH_COMPAT_ARM | ARCH_COMPAT_AARCH64, + SratGicCAffinityParser + ), + ADD_ACPI_STRUCT_INFO_ARRAY ( + "GIC ITS Affinity", + EFI_ACPI_6_3_GIC_ITS_AFFINITY, + ARCH_COMPAT_ARM | ARCH_COMPAT_AARCH64, + SratGicITSAffinityParser + ), + ADD_ACPI_STRUCT_INFO_ARRAY ( + "Generic Initiator Affinity", + EFI_ACPI_6_3_GENERIC_INITIATOR_AFFINITY, + ARCH_COMPAT_IA32 | ARCH_COMPAT_X64 | ARCH_COMPAT_ARM |ARCH_COMPAT_AARCH64, + SratGenericInitiatorAffinityParser + ) +}; + +/** + SRAT structure database +**/ +STATIC ACPI_STRUCT_DATABASE SratDatabase = { + "Static Resource Allocation Structure", + SratStructs, + ARRAY_SIZE (SratStructs) +}; + /** This function parses the ACPI SRAT table. When trace is enabled this function parses the SRAT table and @@ -357,27 +409,15 @@ ParseAcpiSrat ( IN UINT8 AcpiTableRevision ) { - UINT32 Offset; - UINT8* ResourcePtr; - UINT32 GicCAffinityIndex; - UINT32 GicITSAffinityIndex; - UINT32 GenericInitiatorAffinityIndex; - UINT32 MemoryAffinityIndex; - UINT32 ApicSapicAffinityIndex; - UINT32 X2ApicAffinityIndex; - CHAR8 Buffer[80]; // Used for AsciiName param of ParseAcpi - - GicCAffinityIndex = 0; - GicITSAffinityIndex = 0; - GenericInitiatorAffinityIndex = 0; - MemoryAffinityIndex = 0; - ApicSapicAffinityIndex = 0; - X2ApicAffinityIndex = 0; + UINT32 Offset; + UINT8* ResourcePtr; if (!Trace) { return; } + ResetAcpiStructCounts (&SratDatabase); + Offset = ParseAcpi ( TRUE, 0, @@ -406,7 +446,8 @@ ParseAcpiSrat ( IncrementErrorCount (); Print ( L"ERROR: Insufficient remaining table buffer length to read the " \ - L"Static Resource Allocation structure header. Length = %d.\n", + L"%a header. Length = %d.\n", + SratDatabase.Name, AcpiTableLength - Offset ); return; @@ -417,8 +458,9 @@ ParseAcpiSrat ( ((Offset + (*SratRALength)) > AcpiTableLength)) { IncrementErrorCount (); Print ( - L"ERROR: Invalid Static Resource Allocation Structure length. " \ - L"Length = %d. Offset = %d. AcpiTableLength = %d.\n", + L"ERROR: Invalid %a length. Length = %d. Offset = %d. " \ + L"AcpiTableLength = %d.\n", + SratDatabase.Name, *SratRALength, Offset, AcpiTableLength @@ -426,116 +468,24 @@ ParseAcpiSrat ( return; } - switch (*SratRAType) { - case EFI_ACPI_6_3_GICC_AFFINITY: - AsciiSPrint ( - Buffer, - sizeof (Buffer), - "GICC Affinity Structure [%d]", - GicCAffinityIndex++ - ); - ParseAcpi ( - TRUE, - 2, - Buffer, - ResourcePtr, - *SratRALength, - PARSER_PARAMS (SratGicCAffinityParser) - ); - break; - - case EFI_ACPI_6_3_GIC_ITS_AFFINITY: - AsciiSPrint ( - Buffer, - sizeof (Buffer), - "GIC ITS Affinity Structure [%d]", - GicITSAffinityIndex++ - ); - ParseAcpi ( - TRUE, - 2, - Buffer, - ResourcePtr, - *SratRALength, - PARSER_PARAMS (SratGicITSAffinityParser) - ); - break; - - case EFI_ACPI_6_3_GENERIC_INITIATOR_AFFINITY: - AsciiSPrint ( - Buffer, - sizeof (Buffer), - "Generic Initiator Affinity Structure [%d]", - GenericInitiatorAffinityIndex++ - ); - ParseAcpi ( - TRUE, - 2, - Buffer, - ResourcePtr, - *SratRALength, - PARSER_PARAMS (SratGenericInitiatorAffinityParser) - ); - break; - - case EFI_ACPI_6_3_MEMORY_AFFINITY: - AsciiSPrint ( - Buffer, - sizeof (Buffer), - "Memory Affinity Structure [%d]", - MemoryAffinityIndex++ - ); - ParseAcpi ( - TRUE, - 2, - Buffer, - ResourcePtr, - *SratRALength, - PARSER_PARAMS (SratMemAffinityParser) - ); - break; - - case EFI_ACPI_6_3_PROCESSOR_LOCAL_APIC_SAPIC_AFFINITY: - AsciiSPrint ( - Buffer, - sizeof (Buffer), - "APIC/SAPIC Affinity Structure [%d]", - ApicSapicAffinityIndex++ - ); - ParseAcpi ( - TRUE, - 2, - Buffer, - ResourcePtr, - *SratRALength, - PARSER_PARAMS (SratApciSapicAffinityParser) - ); - break; - - case EFI_ACPI_6_3_PROCESSOR_LOCAL_X2APIC_AFFINITY: - AsciiSPrint ( - Buffer, - sizeof (Buffer), - "X2APIC Affinity Structure [%d]", - X2ApicAffinityIndex++ - ); - ParseAcpi ( - TRUE, - 2, - Buffer, - ResourcePtr, - *SratRALength, - PARSER_PARAMS (SratX2ApciAffinityParser) - ); - break; - - default: - IncrementErrorCount (); - Print (L"ERROR: Unknown SRAT Affinity type = 0x%x\n", *SratRAType); - break; - } + // Parse the Static Resource Allocation Structure + ParseAcpiStruct ( + 2, + ResourcePtr, + &SratDatabase, + Offset, + *SratRAType, + *SratRALength, + NULL, + NULL + ); ResourcePtr += (*SratRALength); Offset += (*SratRALength); } + + // Report and validate Static Resource Allocation Structure counts + if (GetConsistencyChecking ()) { + ValidateAcpiStructCounts (&SratDatabase); + } } -- 'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)'