From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from EUR04-DB3-obe.outbound.protection.outlook.com (EUR04-DB3-obe.outbound.protection.outlook.com [40.107.6.86]) by mx.groups.io with SMTP id smtpd.web11.23865.1678465716907099897 for ; Fri, 10 Mar 2023 08:28:37 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="body hash did not verify" header.i=@armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=F/eL5Syc; spf=pass (domain: arm.com, ip: 40.107.6.86, mailfrom: sami.mujawar@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=aA6gFv56S6Z5C/IWP9XfUGF+VHUeixTXYbu8y0n8SI0=; b=F/eL5Sycyf2U5Nx1bI46z7B9Jhrrwgwt2EnNOAGAi4LvUirSywTl+TlH5eswyW7xXfElURGHEewpaRx2njAboYWcvaFhCaOcEV8JGEgsYESE4UcvTIrfhEVHbR3RWRvSyHriPo68V3zC0S8AypA1yPmor8NAC+MajKOe1HGRMM8= Received: from DB9PR02CA0029.eurprd02.prod.outlook.com (2603:10a6:10:1d9::34) by DBBPR08MB6043.eurprd08.prod.outlook.com (2603:10a6:10:20b::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.19; Fri, 10 Mar 2023 16:28:32 +0000 Received: from DBAEUR03FT064.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:1d9:cafe::35) by DB9PR02CA0029.outlook.office365.com (2603:10a6:10:1d9::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.19 via Frontend Transport; Fri, 10 Mar 2023 16:28:32 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dmarc=pass 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; pr=C Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by DBAEUR03FT064.mail.protection.outlook.com (100.127.143.3) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.19 via Frontend Transport; Fri, 10 Mar 2023 16:28:32 +0000 Received: ("Tessian outbound 55ffa3012b8f:v135"); Fri, 10 Mar 2023 16:28:32 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 91bd2efb6b7b1b75 X-CR-MTA-TID: 64aa7808 Received: from e9e09edf406b.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 4FA93C75-2587-4972-BB61-DE70CA2134A0.1; Fri, 10 Mar 2023 16:28:21 +0000 Received: from EUR04-DB3-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id e9e09edf406b.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Fri, 10 Mar 2023 16:28:21 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XhFMA4F35NITJbCfuHvTnrJjsdf4RO5o5xzX4wWiyEomKa2iBEHGD7ch6Iz95uujdNXpGioLRONxAII5v2TiPG0rxaujO4NWIwGqrv2YG8gfMj1yhUIm+34Li9whraW5gvxGEygSaDjqxg+El2rLvDNYe9J/FicF4YQOuqBVimGAl1FrRXWVATeQ/w67/ySHycQvBKZZE+13i8SGad7YITQYmtePI08/TbfhA1J7m7zZ3VU4cHk9SDXQrfHqtu4RiFTHbb42kTB19aKVRQY5Gds/iO2Y5SJTK1yToSiM7P97nh1rZtpQDlIxjPryHA12ucgSAGHHBdYduzymTrPMTQ== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=aA6gFv56S6Z5C/IWP9XfUGF+VHUeixTXYbu8y0n8SI0=; b=SZ8SnpJA6p491/nWnNFdAAJR6RBeCJPvrneaSrot5SF9561id28OYP2htNa2xdiUpx+Z4kz2guZkOmGqPRmIT3uMoppmZeggYFq4wfeVyatau4J/am3qkORxciaxCTBtFt/6HqULaesG7ua0RwWqIndAzMve9cpgasmBl2AVW2yiWG30GvRsQwOyAKuK8Pc8iJFZ8qCFqiaPlovq9/MyJeE0sEjqp+2LSNJD7seoIgM9F4lPB5s+PzrrvUagFvz6/jig7Z7Fq2evEkdFGIFxJtDjMhoiHJNYFC3fYp5WwiwJupAyushpeHZT1cDJiEQV27RZBAD4L7aAGXUzyOQdtA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; 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=aA6gFv56S6Z5C/IWP9XfUGF+VHUeixTXYbu8y0n8SI0=; b=F/eL5Sycyf2U5Nx1bI46z7B9Jhrrwgwt2EnNOAGAi4LvUirSywTl+TlH5eswyW7xXfElURGHEewpaRx2njAboYWcvaFhCaOcEV8JGEgsYESE4UcvTIrfhEVHbR3RWRvSyHriPo68V3zC0S8AypA1yPmor8NAC+MajKOe1HGRMM8= Authentication-Results-Original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; Received: from AS8PR08MB6806.eurprd08.prod.outlook.com (2603:10a6:20b:39b::12) by DB9PR08MB7533.eurprd08.prod.outlook.com (2603:10a6:10:301::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.19; Fri, 10 Mar 2023 16:28:17 +0000 Received: from AS8PR08MB6806.eurprd08.prod.outlook.com ([fe80::c224:ef61:cd4c:7727]) by AS8PR08MB6806.eurprd08.prod.outlook.com ([fe80::c224:ef61:cd4c:7727%3]) with mapi id 15.20.6178.019; Fri, 10 Mar 2023 16:28:16 +0000 Message-ID: <9bfe354b-914d-4534-1b8e-5d32411b5354@arm.com> Date: Fri, 10 Mar 2023 16:28:15 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.8.0 Subject: Re: [PATCH v2 2/4] DynamicTablesPkg: Add SMBIOS table dispatcher To: Girish Mahadevan , "devel@edk2.groups.io" CC: Alexei Fedorov , Pierre Gondois , "abner.chang@amd.com" , "Jeff Brasen (jbrasen@nvidia.com)" , "ashishsingha@nvidia.com" , "nramirez@nvidia.com" , "wwatson@nvidia.com" , Matteo Carlini , Akanksha Jain , Ben Adderson , Samer El-Haj-Mahmoud , Jose Marinho , nd References: <20230308081626.33124-1-sami.mujawar@arm.com> <20230308081626.33124-3-sami.mujawar@arm.com> <1bf32de1-2aa2-c680-4760-bffa0da59adc@nvidia.com> <8FC92511-1E75-4C4B-91C7-9D252728C69E@arm.com> <59d00c3a-0ed8-f73a-68e0-70eb304a7d25@nvidia.com> From: "Sami Mujawar" In-Reply-To: <59d00c3a-0ed8-f73a-68e0-70eb304a7d25@nvidia.com> X-ClientProxiedBy: LO4P123CA0460.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:1aa::15) To AS8PR08MB6806.eurprd08.prod.outlook.com (2603:10a6:20b:39b::12) MIME-Version: 1.0 X-MS-TrafficTypeDiagnostic: AS8PR08MB6806:EE_|DB9PR08MB7533:EE_|DBAEUR03FT064:EE_|DBBPR08MB6043:EE_ X-MS-Office365-Filtering-Correlation-Id: 722f480d-2243-47a7-fe1b-08db21847d65 X-LD-Processed: f34e5979-57d9-4aaa-ad4d-b122a662184d,ExtAddr x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: pLBaQCNZ/CKWisztpSEAIgvagviU/mOykKWnjDqIMMerTefRMtnaZdYgYQwb+M5M9pKbBJ9Esx29orFgIi0kVjeC9ElnkfiicJ4Ff6mQo3dBfmZ0QGgmgEFjFsDEF5pjaaND6sDtkILr3oBy4UbFhE4smJlGXTJX8zmVhKH6oQx59qzjxg3OUbUszh/7WNyEgxYhmwKQ8807sYgqOvsTZ905vAcCzE17Xy3nMi8kKHFiDlO0bX6yEmLuXjM7V1f3dSKAyqXTDtkxsBd27JvgCnUCh5grvUKXvstmOqmcAKQbtiX8M9tzct/oIh1+k53IqBYNbc579TAcLMgpW+05MfAoLLvwhG1s9TsaSC2r+hPK6X0Fi/vD72SS1V+pSebaQTmgHFR3GLgkz0osVgY6tx2uM4SQVNkUaa6ld3ABR4ruuV8S1+0NANLgYLvYMDdUt7Ne4HXLCaF28/04RB9XDlWqwf3YJ2+Sjmhm12twb31bBE5QX2hDKp363kMVWYOWUBuyTS5P9mz+73kC0rFK2yK40QA9vZEyu0tCuYDN+YTbKXLUKzbRWBeZGCV/6OayLLlMGZ7iG+q2ltt5Oe5mbnHdO3AVhOI0CDoBeoSDz521vty5obagB9Vp/d4MWDIHHvWKt3jgHfIbprCXeOlsYj/BTXxW1aObcZ47f3BFPG0fEeAVMwv95YCxQeuqA43tsU5C/9s12MRrmd5AjXtTd/IyFm2zDBrJN/DQPTABj58= X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR08MB6806.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230025)(4636009)(376002)(136003)(346002)(366004)(39860400002)(396003)(451199018)(36756003)(316002)(54906003)(110136005)(966005)(6486002)(44832011)(45080400002)(5660300002)(66556008)(2906002)(66946007)(66476007)(8936002)(8676002)(30864003)(4326008)(41300700001)(26005)(86362001)(31696002)(38100700002)(53546011)(186003)(2616005)(6506007)(6512007)(478600001)(83380400001)(31686004)(45980500001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR08MB7533 Original-Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; Return-Path: Sami.Mujawar@arm.com X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DBAEUR03FT064.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: b08ed9de-5716-48eb-862d-08db218473de X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 6RpXtsJsl0D8wj/8NqUGL8IUoYzo8vRPNQeCEiI6AL2mqsMU5lBwfEFhByvaB+SK/qNAc4UYbTeebhSCnt3qS6cVY0Kx0CZtX6tuCEbAiQUH4jV1JYZn7opgMqU3Q5E+XalUdBNrRza4DGSdf70aKG6abmpj2e8vQPtGnZBV/xLbnPY7iCeDu3vylVR35HX4LueemZUl+SSvVototeDDVTPQBpGgPCPdMpgpWsFdSi0Q3juDcfAO7bzVmmyVG+HzixoUS1ESzBwlXnaRvIYSCZOR4qlIzTz/CP6/8qqrG9sEKKT9YvKWj47U7W02LI2dVO9ObXe3HCNAOBBp6dQc0PDk2D+F8IxNnWXlCSbgz0KAH/B5pQfGMIK9Rl8H6ZtqNqYPokbHp4kt/zcAwWawEdc/Xm0oAAIWl4yEx1Kvua9L455jT6hvylUXx1zwk6DgWG5N0E8abVjl5UH6Rl6m5XsmjKzBDAl3wBEN3ifuRRtC/MgZeK7UudaDiiwEKyhc+ziBFCZD5p4Q5Y8oS5IAVk00ioIWuPi6HNSVf5P95Qv5W1u3bAmfNVuqlJe0BHl+Jvg/GDxsQkotavrNRGg0oQoEuQACK+ug2dU+C5UU1hHd4Exk+Bz89Ex/I6kFsQuwHJASGca4AvO52PSeWADdgaMIQv8mBPIeKtqOEa9vwfWEHTWjtUNywZiIpiz93p7tmUZ2WEQC56S2vRcIB/fbVNq/z5gmesF1AKZsKnxpXBM= 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;SFS:(13230025)(4636009)(39860400002)(346002)(136003)(376002)(396003)(451199018)(40470700004)(46966006)(36840700001)(336012)(47076005)(31686004)(110136005)(54906003)(316002)(36756003)(40460700003)(356005)(40480700001)(86362001)(31696002)(82740400003)(81166007)(26005)(36860700001)(6512007)(53546011)(2616005)(82310400005)(83380400001)(6506007)(186003)(45080400002)(5660300002)(966005)(6486002)(478600001)(8936002)(41300700001)(44832011)(70586007)(2906002)(30864003)(8676002)(4326008)(70206006)(43740500002);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Mar 2023 16:28:32.6293 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 722f480d-2243-47a7-fe1b-08db21847d65 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-AuthSource: DBAEUR03FT064.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR08MB6043 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable Hi Girish, On 10/03/2023 04:23 pm, Girish Mahadevan wrote: > Hi Sami > > Response inline.[GM] > > Best Regards > Girish > > On 3/9/2023 3:41 AM, Sami Mujawar wrote: >> External email: Use caution opening links or attachments >> >> >> Hi Girish, >> >> Thank you for your feedback. >> >> Please find my response inline marked [SAMI]. >> >> Regards, >> >> Sami Mujawar >> >> =EF=BB=BFOn 08/03/2023, 17:41, "Girish Mahadevan" > > wrote: >> >> >> Hi Sami >> >> >> Thanks for v2, I will apply these to my tree and test it out. >> One small comment before I review/test the patch train inline (prefixed >> by [GM]) >> >> >> Best Regards >> Girish >> >> >> On 3/8/2023 1:16 AM, Sami Mujawar wrote: >>> External email: Use caution opening links or attachments >>> >>> >>> Some SMBIOS structure/table fields have dependency on other SMBIOS >>> structures/tables. These dependencies are established using handles >>> pointing to the dependent tables. >>> >>> A SMBIOS table handle can be obtained by either installing a SMBIOS >>> table or by allocating a handle, which requires complex management >>> to avoid any clashes. >>> >>> Obtaining a SMBIOS handle by installation requires that the dependent >>> table is installed before the parent SMBIOS table can be installed. >>> Therefore, introduce a SMBIOS table dispatcher that walks the SMBIOS >>> dependency list and schedules the dependent tables to be installed >>> before the parent table is installed. >>> >>> Signed-off-by: Sami Mujawar >> > >>> Cc: Alexei Fedorov >> > >>> Cc: Pierre Gondois >> > >>> Cc: Girish Mahadevan >> > >>> Cc: Jeff Brasen > >>> Cc: Ashish Singhal >> > >>> Cc: Nick Ramirez > >>> Cc: William Watson > >>> Cc: Abner Chang > >>> Cc: Samer El-Haj-Mahmoud >> > >>> Cc: Jose Marinho > >>> --- >>> >>> Notes: >>> v2: >>> - Update dispatcher state machine to remove StUnknown. [SAMI] >>> - Move extern function to header file and move debug [ABNER] >>> code together. >>> - Updated code based on review feedback to move extern [SAMI] >>> function to header file and also moved the debug code >>> together. >>> Ref:=20 >>> https://nam11.safelinks.protection.outlook.com/?url=3Dhttps%3A%2F%2Fedk= 2.groups.io%2Fg%2Fdevel%2Fmessage%2F95341&data=3D05%7C01%7Cgmahadevan%40nvi= dia.com%7C57205f56a9f84d2470b408db208ade8b%7C43083d15727340c1b7db39efd9ccc1= 7a%7C0%7C0%7C638139553079754853%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDA= iLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=3DJab= 1Rf4UjvIJybcAXFAVXRZBxGaOQki%2BC1KxnPjaxGE%3D&reserved=3D0=20 >>> =20 >>> >>> >>> DynamicTablesPkg/Drivers/DynamicTableManagerDxe/DynamicTableManagerDxe.= inf=20 >>> | 4 +- >>> DynamicTablesPkg/Drivers/DynamicTableManagerDxe/SmbiosTableDispatcher.c= =20 >>> | 282 ++++++++++++++++++++ >>> DynamicTablesPkg/Drivers/DynamicTableManagerDxe/SmbiosTableDispatcher.h= =20 >>> | 159 +++++++++++ >>> 3 files changed, 444 insertions(+), 1 deletion(-) >>> >>> diff --git=20 >>> a/DynamicTablesPkg/Drivers/DynamicTableManagerDxe/DynamicTableManagerDx= e.inf=20 >>> b/DynamicTablesPkg/Drivers/DynamicTableManagerDxe/DynamicTableManagerDx= e.inf=20 >>> >>> index=20 >>> ad8b3d037c169ca848b5ea84fd1086b83f37876f..b09272d883c6f4f05eb03dcdab3ef= eda92b2fbb6=20 >>> 100644 >>> ---=20 >>> a/DynamicTablesPkg/Drivers/DynamicTableManagerDxe/DynamicTableManagerDx= e.inf >>> +++=20 >>> b/DynamicTablesPkg/Drivers/DynamicTableManagerDxe/DynamicTableManagerDx= e.inf >>> @@ -1,7 +1,7 @@ >>> ## @file >>> # Module that drives the table generation and installation process. >>> # >>> -# Copyright (c) 2017 - 2019, ARM Limited. All rights reserved. >>> +# Copyright (c) 2017 - 2022, Arm Limited. All rights reserved. >>> # >>> # SPDX-License-Identifier: BSD-2-Clause-Patent >>> ## >>> @@ -22,6 +22,8 @@ [Defines] >>> >>> [Sources] >>> DynamicTableManagerDxe.c >>> + SmbiosTableDispatcher.c >>> + SmbiosTableDispatcher.h >>> >>> [Packages] >>> MdePkg/MdePkg.dec >>> diff --git=20 >>> a/DynamicTablesPkg/Drivers/DynamicTableManagerDxe/SmbiosTableDispatcher= .c=20 >>> b/DynamicTablesPkg/Drivers/DynamicTableManagerDxe/SmbiosTableDispatcher= .c=20 >>> >>> new file mode 100644 >>> index=20 >>> 0000000000000000000000000000000000000000..0e728538d9f6eb0b164fea3a160d3= 233db833f8d >>> --- /dev/null >>> +++=20 >>> b/DynamicTablesPkg/Drivers/DynamicTableManagerDxe/SmbiosTableDispatcher= .c >>> @@ -0,0 +1,282 @@ >>> +/** @file >>> + Dynamic Smbios Table Dispatcher >>> + >>> + Copyright (c) 2022 - 2023, Arm Limited. All rights reserved. >>> + >>> + SPDX-License-Identifier: BSD-2-Clause-Patent >>> + >>> +**/ >>> +#include >>> +#include >>> + >>> +#include >>> +#include >>> + >>> +/** >>> + The SMBIOS dispatcher state table. >>> + >>> + The SMBIOS dispatcher state table is used to establish the dependency >>> + order in which the SMBIOS tables are installed. This allows the=20 >>> SMBIOS >>> + dispatcher to dispatch the dependent tables for installation=20 >>> before the >>> + parent table is installed. >>> + The SMBIOS_TABLE_DISPATCHER.Dependency[] field is used to=20 >>> establish the >>> + dependency list. >>> + Elements in the Dependency list are resolved by increasing index.=20 >>> However, >>> + all orders are equivalent as: >>> + - the Parent SMBIOS table will only be installed once all=20 >>> dependencies >>> + have been satisfied. >>> + - no cyclic dependency is allowed. >>> + The dependency list is terminated by SMTT_NULL. >>> +*/ >>> +STATIC >>> +SMBIOS_TABLE_DISPATCHER mSmBiosDispatcher[MAX_SMBIOS_TABLES] =3D { >>> + SMBIOS_TABLE_DEP (SMBIOS_TYPE_BIOS_INFORMATION, SMTT_NULL,=20 >>> SMTT_NULL, SMTT_NULL, SMTT_NULL, SMTT_NULL), >>> + SMBIOS_TABLE_DEP (SMBIOS_TYPE_SYSTEM_INFORMATION, SMTT_NULL,=20 >>> SMTT_NULL, SMTT_NULL, SMTT_NULL, SMTT_NULL), >>> + SMBIOS_TABLE_DEP (SMBIOS_TYPE_BASEBOARD_INFORMATION, SMTT_NULL,=20 >>> SMTT_NULL, SMTT_NULL, SMTT_NULL, SMTT_NULL), >>> + SMBIOS_TABLE_DEP (SMBIOS_TYPE_SYSTEM_ENCLOSURE, SMTT_NULL,=20 >>> SMTT_NULL, SMTT_NULL, SMTT_NULL, SMTT_NULL), >>> + SMBIOS_TABLE_DEP (SMBIOS_TYPE_PROCESSOR_INFORMATION,=20 >>> SMBIOS_TYPE_CACHE_INFORMATION, SMTT_NULL, SMTT_NULL, SMTT_NULL,=20 >>> SMTT_NULL), >>> + SMBIOS_TABLE_DEP (SMBIOS_TYPE_MEMORY_CONTROLLER_INFORMATION,=20 >>> SMTT_NULL, SMTT_NULL, SMTT_NULL, SMTT_NULL, SMTT_NULL), >>> + SMBIOS_TABLE_DEP (SMBIOS_TYPE_MEMORY_MODULE_INFORMATON, SMTT_NULL,=20 >>> SMTT_NULL, SMTT_NULL, SMTT_NULL, SMTT_NULL), >>> + SMBIOS_TABLE_DEP (SMBIOS_TYPE_CACHE_INFORMATION, SMTT_NULL,=20 >>> SMTT_NULL, SMTT_NULL, SMTT_NULL, SMTT_NULL), >>> + SMBIOS_TABLE_DEP (SMBIOS_TYPE_PORT_CONNECTOR_INFORMATION,=20 >>> SMTT_NULL, SMTT_NULL, SMTT_NULL, SMTT_NULL, SMTT_NULL), >>> + SMBIOS_TABLE_DEP (SMBIOS_TYPE_SYSTEM_SLOTS, SMTT_NULL, SMTT_NULL,=20 >>> SMTT_NULL, SMTT_NULL, SMTT_NULL), >>> + SMBIOS_TABLE_DEP (SMBIOS_TYPE_ONBOARD_DEVICE_INFORMATION,=20 >>> SMTT_NULL, SMTT_NULL, SMTT_NULL, SMTT_NULL, SMTT_NULL), >>> + SMBIOS_TABLE_DEP (SMBIOS_TYPE_OEM_STRINGS, SMTT_NULL, SMTT_NULL,=20 >>> SMTT_NULL, SMTT_NULL, SMTT_NULL), >>> + SMBIOS_TABLE_DEP (SMBIOS_TYPE_SYSTEM_CONFIGURATION_OPTIONS,=20 >>> SMTT_NULL, SMTT_NULL, SMTT_NULL, SMTT_NULL, SMTT_NULL), >>> + SMBIOS_TABLE_DEP (SMBIOS_TYPE_BIOS_LANGUAGE_INFORMATION,=20 >>> SMTT_NULL, SMTT_NULL, SMTT_NULL, SMTT_NULL, SMTT_NULL), >>> + SMBIOS_TABLE_DEP (SMBIOS_TYPE_GROUP_ASSOCIATIONS, SMTT_NULL,=20 >>> SMTT_NULL, SMTT_NULL, SMTT_NULL, SMTT_NULL), >>> + SMBIOS_TABLE_DEP (SMBIOS_TYPE_SYSTEM_EVENT_LOG, SMTT_NULL,=20 >>> SMTT_NULL, SMTT_NULL, SMTT_NULL, SMTT_NULL), >>> + SMBIOS_TABLE_DEP (SMBIOS_TYPE_PHYSICAL_MEMORY_ARRAY,=20 >>> SMBIOS_TYPE_32BIT_MEMORY_ERROR_INFORMATION,=20 >>> SMBIOS_TYPE_64BIT_MEMORY_ERROR_INFORMATION, SMTT_NULL, SMTT_NULL,=20 >>> SMTT_NULL), >>> + SMBIOS_TABLE_DEP (SMBIOS_TYPE_MEMORY_DEVICE,=20 >>> SMBIOS_TYPE_PHYSICAL_MEMORY_ARRAY,=20 >>> SMBIOS_TYPE_32BIT_MEMORY_ERROR_INFORMATION,=20 >>> SMBIOS_TYPE_64BIT_MEMORY_ERROR_INFORMATION, SMTT_NULL, SMTT_NULL), >>> + SMBIOS_TABLE_DEP (SMBIOS_TYPE_32BIT_MEMORY_ERROR_INFORMATION,=20 >>> SMTT_NULL, SMTT_NULL, SMTT_NULL, SMTT_NULL, SMTT_NULL), >>> + SMBIOS_TABLE_DEP (SMBIOS_TYPE_MEMORY_ARRAY_MAPPED_ADDRESS,=20 >>> SMTT_NULL, SMTT_NULL, SMTT_NULL, SMTT_NULL, SMTT_NULL), >>> + SMBIOS_TABLE_DEP (SMBIOS_TYPE_MEMORY_DEVICE_MAPPED_ADDRESS,=20 >>> SMTT_NULL, SMTT_NULL, SMTT_NULL, SMTT_NULL, SMTT_NULL), >>> + SMBIOS_TABLE_DEP (SMBIOS_TYPE_BUILT_IN_POINTING_DEVICE, SMTT_NULL,=20 >>> SMTT_NULL, SMTT_NULL, SMTT_NULL, SMTT_NULL), >>> + SMBIOS_TABLE_DEP (SMBIOS_TYPE_PORTABLE_BATTERY, SMTT_NULL,=20 >>> SMTT_NULL, SMTT_NULL, SMTT_NULL, SMTT_NULL), >>> + SMBIOS_TABLE_DEP (SMBIOS_TYPE_SYSTEM_RESET, SMTT_NULL, SMTT_NULL,=20 >>> SMTT_NULL, SMTT_NULL, SMTT_NULL), >>> + SMBIOS_TABLE_DEP (SMBIOS_TYPE_HARDWARE_SECURITY, SMTT_NULL,=20 >>> SMTT_NULL, SMTT_NULL, SMTT_NULL, SMTT_NULL), >>> + SMBIOS_TABLE_DEP (SMBIOS_TYPE_SYSTEM_POWER_CONTROLS, SMTT_NULL,=20 >>> SMTT_NULL, SMTT_NULL, SMTT_NULL, SMTT_NULL), >>> + SMBIOS_TABLE_DEP (SMBIOS_TYPE_VOLTAGE_PROBE, SMTT_NULL, SMTT_NULL,=20 >>> SMTT_NULL, SMTT_NULL, SMTT_NULL), >>> + SMBIOS_TABLE_DEP (SMBIOS_TYPE_COOLING_DEVICE, SMTT_NULL,=20 >>> SMTT_NULL, SMTT_NULL, SMTT_NULL, SMTT_NULL), >>> + SMBIOS_TABLE_DEP (SMBIOS_TYPE_TEMPERATURE_PROBE, SMTT_NULL,=20 >>> SMTT_NULL, SMTT_NULL, SMTT_NULL, SMTT_NULL), >>> + SMBIOS_TABLE_DEP (SMBIOS_TYPE_ELECTRICAL_CURRENT_PROBE, SMTT_NULL,=20 >>> SMTT_NULL, SMTT_NULL, SMTT_NULL, SMTT_NULL), >>> + SMBIOS_TABLE_DEP (SMBIOS_TYPE_OUT_OF_BAND_REMOTE_ACCESS,=20 >>> SMTT_NULL, SMTT_NULL, SMTT_NULL, SMTT_NULL, SMTT_NULL), >>> + SMBIOS_TABLE_DEP (SMBIOS_TYPE_BOOT_INTEGRITY_SERVICE, SMTT_NULL,=20 >>> SMTT_NULL, SMTT_NULL, SMTT_NULL, SMTT_NULL), >>> + SMBIOS_TABLE_DEP (SMBIOS_TYPE_SYSTEM_BOOT_INFORMATION, SMTT_NULL,=20 >>> SMTT_NULL, SMTT_NULL, SMTT_NULL, SMTT_NULL), >>> + SMBIOS_TABLE_DEP (SMBIOS_TYPE_64BIT_MEMORY_ERROR_INFORMATION,=20 >>> SMTT_NULL, SMTT_NULL, SMTT_NULL, SMTT_NULL, SMTT_NULL), >>> + SMBIOS_TABLE_DEP (SMBIOS_TYPE_MANAGEMENT_DEVICE, SMTT_NULL,=20 >>> SMTT_NULL, SMTT_NULL, SMTT_NULL, SMTT_NULL), >>> + SMBIOS_TABLE_DEP (SMBIOS_TYPE_MANAGEMENT_DEVICE_COMPONENT,=20 >>> SMTT_NULL, SMTT_NULL, SMTT_NULL, SMTT_NULL, SMTT_NULL), >>> + SMBIOS_TABLE_DEP (SMBIOS_TYPE_MANAGEMENT_DEVICE_THRESHOLD_DATA,=20 >>> SMTT_NULL, SMTT_NULL, SMTT_NULL, SMTT_NULL, SMTT_NULL), >>> + SMBIOS_TABLE_DEP (SMBIOS_TYPE_MEMORY_CHANNEL, SMTT_NULL,=20 >>> SMTT_NULL, SMTT_NULL, SMTT_NULL, SMTT_NULL), >>> + SMBIOS_TABLE_DEP (SMBIOS_TYPE_IPMI_DEVICE_INFORMATION, SMTT_NULL,=20 >>> SMTT_NULL, SMTT_NULL, SMTT_NULL, SMTT_NULL), >>> + SMBIOS_TABLE_DEP (SMBIOS_TYPE_SYSTEM_POWER_SUPPLY, SMTT_NULL,=20 >>> SMTT_NULL, SMTT_NULL, SMTT_NULL, SMTT_NULL), >>> + SMBIOS_TABLE_DEP (SMBIOS_TYPE_ADDITIONAL_INFORMATION, SMTT_NULL,=20 >>> SMTT_NULL, SMTT_NULL, SMTT_NULL, SMTT_NULL), >>> + SMBIOS_TABLE_DEP=20 >>> (SMBIOS_TYPE_ONBOARD_DEVICES_EXTENDED_INFORMATION, SMTT_NULL,=20 >>> SMTT_NULL, SMTT_NULL, SMTT_NULL, SMTT_NULL), >>> + SMBIOS_TABLE_DEP=20 >>> (SMBIOS_TYPE_MANAGEMENT_CONTROLLER_HOST_INTERFACE, SMTT_NULL,=20 >>> SMTT_NULL, SMTT_NULL, SMTT_NULL, SMTT_NULL), >>> + SMBIOS_TABLE_DEP (SMBIOS_TYPE_TPM_DEVICE, SMTT_NULL, SMTT_NULL,=20 >>> SMTT_NULL, SMTT_NULL, SMTT_NULL), >>> + SMBIOS_TABLE_DEP (SMBIOS_TYPE_PROCESSOR_ADDITIONAL_INFORMATION,=20 >>> SMTT_NULL, SMTT_NULL, SMTT_NULL, SMTT_NULL, SMTT_NULL), >>> + SMBIOS_TABLE_DEP (SMBIOS_TYPE_FIRMWARE_INVENTORY_INFORMATION,=20 >>> SMTT_NULL, SMTT_NULL, SMTT_NULL, SMTT_NULL, SMTT_NULL), >>> + SMBIOS_TABLE_DEP (SMBIOS_TYPE_STRING_PROPERTY_INFORMATION,=20 >>> SMTT_NULL, SMTT_NULL, SMTT_NULL, SMTT_NULL, SMTT_NULL) >>> +}; >>> + >>> +#if !defined (MDEPKG_NDEBUG) >>> + >>> +/** >>> + A string table describing the SMBIOS dispatcher states. >>> +*/ >>> +STATIC >>> +CONST CHAR8 *SmbiosTableStateTxt[] =3D { >>> + "StNotPresent", >>> + "StPresent", >>> + "StDispatched" >>> +}; >>> + >>> +/** >>> + Print the SMBIOS Table Dispatcher state information. >>> + >>> + @param Verbose Print detailed report >>> +**/ >>> +STATIC >>> +VOID >>> +EFIAPI >>> +PrintDispatcherStatus ( >>> + IN BOOLEAN Verbose >>> + ) >>> +{ >>> + UINTN Index; >>> + >>> + DEBUG ((DEBUG_VERBOSE, "Dispatcher Status:\n")); >>> + for (Index =3D 0; Index < ARRAY_SIZE (mSmBiosDispatcher); Index++) { >>> + if ((!Verbose) && (mSmBiosDispatcher[Index].State =3D=3D StNotPresent= )) { >>> + continue; >>> + } >>> + >>> + DEBUG (( >>> + DEBUG_VERBOSE, >>> + "%02d: %10a [%02d, %02d, %02d, %02d, %02d]\n", >>> + mSmBiosDispatcher[Index].TableType, >>> + SmbiosTableStateTxt[mSmBiosDispatcher[Index].State], >>> + mSmBiosDispatcher[Index].Dependency[0], >>> + mSmBiosDispatcher[Index].Dependency[1], >>> + mSmBiosDispatcher[Index].Dependency[2], >>> + mSmBiosDispatcher[Index].Dependency[3], >>> + mSmBiosDispatcher[Index].Dependency[4] >>> + )); >>> + } // for >>> + >>> + DEBUG ((DEBUG_VERBOSE, "\n")); >>> +} >>> + >>> +#define DEBUG_PRINT_DISPATCHER_STATUS(Verbose)=20 >>> PrintDispatcherStatus (Verbose) >>> +#else >>> +#define DEBUG_PRINT_DISPATCHER_STATUS(x) >>> +#endif >>> + >>> +/** >>> + Initialise the SMBIOS table dispatcher. >>> + >>> + @param SmbiosTableInfo Pointer to the list of SMBIOS tables to be=20 >>> installed. >>> + @param SmbiosTableCount Count of SMBIOS tables to be installed. >>> +**/ >>> +VOID >>> +EFIAPI >>> +InitSmbiosTableDispatcher ( >>> + IN CM_STD_OBJ_SMBIOS_TABLE_INFO *SmbiosTableInfo, >>> + IN UINT32 SmbiosTableCount >>> + ) >>> +{ >>> + UINTN Index; >>> + SMBIOS_TABLE_TYPE TableType; >>> + >>> + // Search for the list of SMBIOS tables presented >>> + // for installation and update the dispatcher status. >>> + for (Index =3D 0; Index < SmbiosTableCount; Index++) { >>> + TableType =3D SmbiosTableInfo[Index].TableType; >>> + ASSERT (mSmBiosDispatcher[TableType].State !=3D StPresent); >> >> >> [GM] >> This ASSERT will be hit even if we have multiple SMBIOS CM objects of >> the same type which is legal (for e.g there are multiple tables for >> type17/19 ) >> >> [SAMI] The understanding is that SmbiosTableInfo[] will only contain=20 >> one entry for a given TableType as it is used to indicate which=20 >> generators are to be instantiated. >> >> Following is the sequence of operations: >> - The dispatcher is initialised in InitSmbiosTableDispatcher(), which=20 >> will set the mSmBiosDispatcher[].State to StPresent if=20 >> SmbiosTableInfo[] contains a table of Table_Type. >> - SmbiosTableInfo[] will only contain one entry for each table type,=20 >> e.g. even if there are multiple Type17/Type19 tables to be installed.=20 >> This entry indicates that table(s) of Type17/Type19 is/are requested=20 >> to be installed and that the corresponding generator must be=20 >> instantiated. >> - Once the SMBIOS table generator is instantiated, it will then=20 >> request for the object(s) of the required type from the Configuration=20 >> Manager that are required to construct the table. >> - The generator can then decide if multiple SMBIOS tables are to be=20 >> constructed based on the objects returned by the Configuration=20 >> Manager. e.g. if multiple Cm_Type17_objects are returned then the=20 >> corresponding number of Type17 tables will be built by the generator. >> >> Therefore, I think we should not hit the above assert. >> > > [GM] > That sounds right, I'd made a mistake when installing the CM objects. > > I should be installing one of each SMBIOS table so that=20 > GetEStdObjSmbiosTableList gets the list of the available tables and=20 > each generator should install multiple tables of a given type based on=20 > the number of CM objects available. > > I did expand the existing SMBIOS factory code to install multiple tables. > > Thanks for the clarification. > > Best Regards > Girish > [SAMI] No worries. Please let me know if you face any issues with the=20 dispatcher or if you identify any problem during integration. Regards, Sami Mujawar > >> However, the code that may need to change/extend is the call to=20 >> BuildAndInstallSmbiosTable(). I am not sure if we need to indicate=20 >> that there could be multiple SMBIOS tables that may be installed. For=20 >> now, BuildAndInstallSmbiosTable() implies that a generator of the=20 >> specified type is to be instantiated for building the SMBIOS table of=20 >> the specified type. >> >> Hope this clarifies the scenario and please do let me know if I am=20 >> missing something. >> >> Also, I have only tested this patch with simulated data and there may=20 >> be some issues that we may find when the full stack is integrated. >> So, thank you for going through the patch in detail. >> >> [SAMI] >> >> Best Regards >> Girish >> >> >>> + mSmBiosDispatcher[TableType].State =3D StPresent; >>> + } >>> + >>> + DEBUG_PRINT_DISPATCHER_STATUS (FALSE); >>> +} >>> + >>> +/** Schedule the dispatch of a SMBIOS table. >>> + >>> + The SMBIOS dispatcher state table is used to establish the dependency >>> + order in which the SMBIOS tables are installed. This allows the=20 >>> SMBIOS >>> + dispatcher to dispatch the dependent tables for installation=20 >>> before the >>> + parent table is installed. >>> + The SMBIOS_TABLE_DISPATCHER.Dependency[] field is used to=20 >>> establish the >>> + dependency list. >>> + Elements in the Dependency list are resolved by increasing index.=20 >>> However, >>> + all orders are equivalent as: >>> + - the Parent SMBIOS table will only be installed once all=20 >>> dependencies >>> + have been satisfied. >>> + - no cyclic dependency is allowed. >>> + The dependency list is terminated by SMTT_NULL. >>> + >>> + @param [in] TableType The SMBIOS table type to schedule for >>> + dispatch. >>> + @param [in] TableFactoryProtocol Pointer to the Table Factory=20 >>> Protocol >>> + interface. >>> + @param [in] CfgMgrProtocol Pointer to the Configuration Manager >>> + Protocol Interface. >>> + @param [in] SmbiosProtocol Pointer to the SMBIOS protocol. >>> + @param [in] SmbiosTableInfo Pointer to the SMBIOS table Info. >>> + @param [in] SmbiosTableCount Count of SMBIOS table info objects. >>> + >>> + @retval EFI_SUCCESS Success. >>> + @retval EFI_INVALID_PARAMETER A parameter is invalid. >>> + @retval EFI_NOT_FOUND Required object is not found. >>> + @retval EFI_BAD_BUFFER_SIZE Size returned by the Configuration=20 >>> Manager >>> + is less than the Object size for the >>> + requested object. >>> +**/ >>> +EFI_STATUS >>> +EFIAPI >>> +DispatchSmbiosTable ( >>> + IN CONST SMBIOS_TABLE_TYPE TableType, >>> + IN CONST EDKII_DYNAMIC_TABLE_FACTORY_PROTOCOL *CONST=20 >>> TableFactoryProtocol, >>> + IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST CfgMgrProtocol, >>> + IN EFI_SMBIOS_PROTOCOL *SmbiosProtocol, >>> + IN CM_STD_OBJ_SMBIOS_TABLE_INFO *CONST SmbiosTableInfo, >>> + IN CONST UINT32 SmbiosTableCount >>> + ) >>> +{ >>> + EFI_STATUS Status; >>> + UINTN Index; >>> + SMBIOS_TABLE_DISPATCHER *Disp; >>> + >>> + DEBUG ((DEBUG_VERBOSE, "->DP %02d\n", TableType)); >>> + Disp =3D &mSmBiosDispatcher[TableType]; >>> + if (Disp->State =3D=3D StNotPresent) { >>> + DEBUG ((DEBUG_VERBOSE, "<-DP %02d : EFI_NOT_FOUND\n", TableType)); >>> + return EFI_NOT_FOUND; >>> + } >>> + >>> + if (Disp->State =3D=3D StDispatched) { >>> + DEBUG ((DEBUG_VERBOSE, "<-DP %02d : EFI_ALREADY_STARTED\n",=20 >>> TableType)); >>> + return EFI_ALREADY_STARTED; >>> + } >>> + >>> + // Table is present so check the dependency. >>> + for (Index =3D 0; Index < MAX_SMBIOS_DEPENDENCY; Index++) { >>> + // Check if the dependency list is terminated by SMTT_NULL. >>> + if (Disp->Dependency[Index] =3D=3D SMTT_NULL) { >>> + break; >>> + } >>> + >>> + Status =3D DispatchSmbiosTable ( >>> + Disp->Dependency[Index], >>> + TableFactoryProtocol, >>> + CfgMgrProtocol, >>> + SmbiosProtocol, >>> + SmbiosTableInfo, >>> + SmbiosTableCount >>> + ); >>> + if (EFI_ERROR (Status)) { >>> + if ((Status =3D=3D EFI_ALREADY_STARTED) || (Status =3D=3D EFI_NOT_FOU= ND)) { >>> + // Some dependencies may already be satisfied >>> + // as other tables may also have similar >>> + // dependencies i.e. EFI_ALREADY_STARTED >>> + // Or >>> + // the dependent table may be optional >>> + // and not provided i.e. EFI_NOT_FOUND. >>> + continue; >>> + } >>> + >>> + DEBUG ((DEBUG_VERBOSE, "<-DP %02d : Status =3D %d\n", TableType,=20 >>> Status)); >>> + return Status; >>> + } >>> + } >>> + >>> + DEBUG ((DEBUG_VERBOSE, "DP %02d : Status =3D %d\n", TableType,=20 >>> Status)); >>> + >>> + // All dependencies satisfied - Install SMBIOS table >>> + Disp->State =3D StDispatched; >>> + // Find the SMBIOS table info matching the TableType >>> + for (Index =3D 0; Index < SmbiosTableCount; Index++) { >>> + if (SmbiosTableInfo[Index].TableType =3D=3D TableType) { >>> + break; >>> + } >>> + } >>> + >>> + Status =3D BuildAndInstallSmbiosTable ( >>> + TableFactoryProtocol, >>> + CfgMgrProtocol, >>> + SmbiosProtocol, >>> + &SmbiosTableInfo[Index] >>> + ); >>> + if (EFI_ERROR (Status)) { >>> + DEBUG (( >>> + DEBUG_ERROR, >>> + "ERROR: Failed to install SMBIOS Table." \ >>> + " Id =3D %u Status =3D %r\n", >>> + SmbiosTableInfo[Index].TableGeneratorId, >>> + Status >>> + )); >>> + } >>> + >>> + DEBUG_PRINT_DISPATCHER_STATUS (FALSE); >>> + DEBUG ((DEBUG_VERBOSE, "<-DP %0d\n", TableType)); >>> + return Status; >>> +} >>> diff --git=20 >>> a/DynamicTablesPkg/Drivers/DynamicTableManagerDxe/SmbiosTableDispatcher= .h=20 >>> b/DynamicTablesPkg/Drivers/DynamicTableManagerDxe/SmbiosTableDispatcher= .h=20 >>> >>> new file mode 100644 >>> index=20 >>> 0000000000000000000000000000000000000000..d59eab4223c142293bdaf4905588f= 08e7a4a467f >>> --- /dev/null >>> +++=20 >>> b/DynamicTablesPkg/Drivers/DynamicTableManagerDxe/SmbiosTableDispatcher= .h >>> @@ -0,0 +1,159 @@ >>> +/** @file >>> + >>> + Copyright (c) 2022 - 2023, Arm Limited. All rights reserved. >>> + >>> + SPDX-License-Identifier: BSD-2-Clause-Patent >>> + >>> +**/ >>> + >>> +#ifndef SMBIOS_TABLE_DISPATCHER_H_ >>> +#define SMBIOS_TABLE_DISPATCHER_H_ >>> + >>> +#include >>> +#include >>> + >>> +/** >>> + A SMBIOS Table Type from the OEM range reserved for terminating >>> + the SMBIOS table dispatch dependency. >>> + >>> + Note: According to the SMBIOS specification, Table Types 0 >>> + through 127 (7Fh) are reserved for and defined by the >>> + SMBIOS specification. >>> + Types 128 through 256 (80h to FFh) are available for system and >>> + OEM-specific information. >>> + >>> + This Dynamic SMBIOS table generation implementation defines >>> + TableType FFh as a NULL table which is used by the Dynamic >>> + SMBIOS table dispatcher to terminate the dependency list. >>> +*/ >>> +#define SMTT_NULL 0xFF >>> + >>> +/** >>> + A macro defining the maximum number of dependendant SMBIOS tables >>> + represented by the SMBIOS table dispatcher. >>> +*/ >>> +#define MAX_SMBIOS_DEPENDENCY 5 >>> + >>> +/** >>> + A macro defining the maximum table types handled by the SMBIOS >>> + table dispatcher. >>> +*/ >>> +#define MAX_SMBIOS_TABLES (SMBIOS_TYPE_STRING_PROPERTY_INFORMATION=20 >>> + 1) >>> + >>> +/** >>> + A helper macro to populate the SMBIOS table dispatcher table >>> +*/ >>> +#define SMBIOS_TABLE_DEP(TableId, Dep1, Dep2, Dep3, Dep4, Dep5) \ >>> + { \ >>> + TableId, \ >>> + StNotPresent, \ >>> + { Dep1, Dep2, Dep3, Dep4, Dep5 } \ >>> + } >>> + >>> +/** >>> + An enum describing the states of the SMBIOS table dispatcher. >>> +*/ >>> +typedef enum SmbiosTableState { >>> + StNotPresent, ///< SMBIOS table is not present for installation. >>> + StPresent, ///< SMBIOS table is present for installation. >>> + StDispatched ///< SMBIOS table generators have been dispatched. >>> +} SMBIOS_TABLE_STATE; >>> + >>> +/** >>> + A structure describing the dependencies for a SMBIOS table and >>> + the dispatcher state information. >>> +*/ >>> +typedef struct SmBiosTableDispatcher { >>> + /// SMBIOS Structure/Table Type >>> + SMBIOS_TABLE_TYPE TableType; >>> + /// SMBIOS dispatcher state >>> + SMBIOS_TABLE_STATE State; >>> + /// SMBIOS Structure/Table dependency list >>> + /// The list is terminated using SMTT_NULL. >>> + SMBIOS_TABLE_TYPE Dependency[MAX_SMBIOS_DEPENDENCY]; >>> +} SMBIOS_TABLE_DISPATCHER; >>> + >>> +/** >>> + A helper function to build and install a SMBIOS table. >>> + >>> + @param [in] TableFactoryProtocol Pointer to the Table Factory=20 >>> Protocol >>> + interface. >>> + @param [in] CfgMgrProtocol Pointer to the Configuration Manager >>> + Protocol Interface. >>> + @param [in] SmbiosProtocol Pointer to the SMBIOS protocol. >>> + @param [in] SmbiosTableInfo Pointer to the SMBIOS table Info. >>> + >>> + @retval EFI_SUCCESS Success. >>> + @retval EFI_INVALID_PARAMETER A parameter is invalid. >>> + @retval EFI_NOT_FOUND Required object is not found. >>> + @retval EFI_BAD_BUFFER_SIZE Size returned by the Configuration=20 >>> Manager >>> + is less than the Object size for the >>> + requested object. >>> +**/ >>> +extern >>> +EFI_STATUS >>> +EFIAPI >>> +BuildAndInstallSmbiosTable ( >>> + IN CONST EDKII_DYNAMIC_TABLE_FACTORY_PROTOCOL *CONST=20 >>> TableFactoryProtocol, >>> + IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST CfgMgrProtocol, >>> + IN EFI_SMBIOS_PROTOCOL *SmbiosProtocol, >>> + IN CM_STD_OBJ_SMBIOS_TABLE_INFO *CONST SmbiosTableInfo >>> + ); >>> + >>> +/** >>> + Initialise the SMBIOS table dispatcher. >>> + >>> + @param SmbiosTableInfo Pointer to the list of SMBIOS tables to be=20 >>> installed. >>> + @param SmbiosTableCount Count of SMBIOS tables to be installed. >>> +**/ >>> +VOID >>> +EFIAPI >>> +InitSmbiosTableDispatcher ( >>> + IN CM_STD_OBJ_SMBIOS_TABLE_INFO *SmbiosTableInfo, >>> + IN UINT32 SmbiosTableCount >>> + ); >>> + >>> +/** Schedule the dispatch of a SMBIOS table. >>> + >>> + The SMBIOS dispatcher state table is used to establish the dependency >>> + order in which the SMBIOS tables are installed. This allows the=20 >>> SMBIOS >>> + dispatcher to dispatch the dependent tables for installation=20 >>> before the >>> + parent table is installed. >>> + The SMBIOS_TABLE_DISPATCHER.Dependency[] field is used to=20 >>> establish the >>> + dependency list. >>> + Elements in the Dependency list are resolved by increasing index.=20 >>> However, >>> + all orders are equivalent as: >>> + - the Parent SMBIOS table will only be installed once all=20 >>> dependencies >>> + have been satisfied. >>> + - no cyclic dependency is allowed. >>> + The dependency list is terminated by SMTT_NULL. >>> + >>> + @param [in] TableType The SMBIOS table type to schedule for >>> + dispatch. >>> + @param [in] TableFactoryProtocol Pointer to the Table Factory=20 >>> Protocol >>> + interface. >>> + @param [in] CfgMgrProtocol Pointer to the Configuration Manager >>> + Protocol Interface. >>> + @param [in] SmbiosProtocol Pointer to the SMBIOS protocol. >>> + @param [in] SmbiosTableInfo Pointer to the SMBIOS table Info. >>> + @param [in] SmbiosTableCount Count of SMBIOS table info objects. >>> + >>> + @retval EFI_SUCCESS Success. >>> + @retval EFI_INVALID_PARAMETER A parameter is invalid. >>> + @retval EFI_NOT_FOUND Required object is not found. >>> + @retval EFI_BAD_BUFFER_SIZE Size returned by the Configuration=20 >>> Manager >>> + is less than the Object size for the >>> + requested object. >>> +**/ >>> +EFI_STATUS >>> +EFIAPI >>> +DispatchSmbiosTable ( >>> + IN CONST SMBIOS_TABLE_TYPE TableType, >>> + IN CONST EDKII_DYNAMIC_TABLE_FACTORY_PROTOCOL *CONST=20 >>> TableFactoryProtocol, >>> + IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST CfgMgrProtocol, >>> + IN EFI_SMBIOS_PROTOCOL *SmbiosProtocol, >>> + IN CM_STD_OBJ_SMBIOS_TABLE_INFO *CONST SmbiosTableInfo, >>> + IN CONST UINT32 SmbiosTableCount >>> + ); >>> + >>> +#endif // SMBIOS_TABLE_DISPATCHER_H_ >>> --=20 >>> 'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)' >>> >> >> >>