From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from EUR03-VE1-obe.outbound.protection.outlook.com (EUR03-VE1-obe.outbound.protection.outlook.com [40.107.5.84]) by mx.groups.io with SMTP id smtpd.web09.211.1609883260075866756 for ; Tue, 05 Jan 2021 13:47:40 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=5Z9CgT3O; spf=pass (domain: arm.com, ip: 40.107.5.84, mailfrom: samer.el-haj-mahmoud@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=hKR9CElip9Pmm+VDfzw/jaSvN5MS8i1oemXeWMH3X3M=; b=5Z9CgT3OQHlXfETSzbD4iH2fAAzAsiP/4LAmDRMoBHWA5Iejcobm/sI0LHToWBtGKezMS1WjXZC7ABPPevV15KFatOJHtiwQk3418D1JaD8wvGVd0zgvCBJgrDm+uvpiK1aITg2pvhGXCDbeEnvI3u8QlvX7QHtXSbkSguoVB9Y= Received: from AM6P193CA0107.EURP193.PROD.OUTLOOK.COM (2603:10a6:209:88::48) by AM6PR08MB5173.eurprd08.prod.outlook.com (2603:10a6:20b:e5::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3721.24; Tue, 5 Jan 2021 21:47:35 +0000 Received: from AM5EUR03FT022.eop-EUR03.prod.protection.outlook.com (2603:10a6:209:88:cafe::9b) by AM6P193CA0107.outlook.office365.com (2603:10a6:209:88::48) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3721.20 via Frontend Transport; Tue, 5 Jan 2021 21:47:35 +0000 X-MS-Exchange-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=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; Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by AM5EUR03FT022.mail.protection.outlook.com (10.152.16.79) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3721.21 via Frontend Transport; Tue, 5 Jan 2021 21:47:35 +0000 Received: ("Tessian outbound 6af064f543d4:v71"); Tue, 05 Jan 2021 21:47:33 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: a75c117549fab92b X-CR-MTA-TID: 64aa7808 Received: from ade3f0d438e5.3 by 64aa7808-outbound-1.mta.getcheckrecipient.com id EEB3A296-598B-4D66-9735-2FA8DCD0E0CC.1; Tue, 05 Jan 2021 21:47:27 +0000 Received: from EUR04-HE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id ade3f0d438e5.3 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Tue, 05 Jan 2021 21:47:27 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kfZOr1obsBoDdHuWqxjikLd33i8DXhgt5onwC84k2n2wbxf7oe1QPHSWAmA98c0z7/blLSO68XMu8TUx2JAbRf0EGhLfrjpabjH8DI/9bbu+Ct9Mu4SzrVgigVaFrtssJyVMTP/rKFTbWovypyJeIxbgMtrlIOxMybveiAaMrHpmOJY1TMnOX8N7yvr6huS67kQlrnEHs6gw1/VGVIyGDNLUobJjdB+W230kl+i3a5cvPzLPfSYgRaUaN0AjeH96Yd7hQdT3egTk9pWOmCZd4kalReq/W+7LTUU4wLwnxpWn7s7oUFcD1Wllyy72H5f1W3i0XpZ59Xj7z7UXtHSFtw== 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=hKR9CElip9Pmm+VDfzw/jaSvN5MS8i1oemXeWMH3X3M=; b=YzCjBroaiq1IZGbAa4pblql7Bru4JLe14050pd5rT70xBSXRw+dWXXfVlHY7nCCZ1in/PBwJpRDkg9/riWC4i+VuQMzKFTOp9+1RdFZzPniBY/4VAvyzlQDasEFl94x4yACGCYHMpsqeQzwJ86YF6YXM50K+K5RFvtV4Mt0dBWaNjJ4OdN8zcKzyT+GJa2hh3wWYFxhvpRmfTQD5ED7B2hFPe9rLHZ0VSYQ2ScaFxGAELHfoGiK6fa3SEIdXi0O9L4GnaINDt787H3yWpmUUTi2vo8tTGN1i4/wT4u7MHR/gv0fPqG4BhGyG5kkRv3vMRkAqb6JoZyCT/8n7hADzyQ== 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=hKR9CElip9Pmm+VDfzw/jaSvN5MS8i1oemXeWMH3X3M=; b=5Z9CgT3OQHlXfETSzbD4iH2fAAzAsiP/4LAmDRMoBHWA5Iejcobm/sI0LHToWBtGKezMS1WjXZC7ABPPevV15KFatOJHtiwQk3418D1JaD8wvGVd0zgvCBJgrDm+uvpiK1aITg2pvhGXCDbeEnvI3u8QlvX7QHtXSbkSguoVB9Y= Received: from DB7PR08MB3260.eurprd08.prod.outlook.com (2603:10a6:5:21::23) by DBBPR08MB6203.eurprd08.prod.outlook.com (2603:10a6:10:201::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3721.23; Tue, 5 Jan 2021 21:47:25 +0000 Received: from DB7PR08MB3260.eurprd08.prod.outlook.com ([fe80::a1f1:ccfd:b17f:a490]) by DB7PR08MB3260.eurprd08.prod.outlook.com ([fe80::a1f1:ccfd:b17f:a490%5]) with mapi id 15.20.3721.023; Tue, 5 Jan 2021 21:47:25 +0000 From: "Samer El-Haj-Mahmoud" To: "devel@edk2.groups.io" , "rebecca@nuviainc.com" CC: Leif Lindholm , Ard Biesheuvel , Sami Mujawar , Liming Gao , Michael D Kinney , Zhiguang Liu , Samer El-Haj-Mahmoud Subject: Re: [edk2-devel] [PATCH v5 15/23] ArmPkg: Add Universal/Smbios/SmbiosMiscDxe/Type03 Thread-Topic: [edk2-devel] [PATCH v5 15/23] ArmPkg: Add Universal/Smbios/SmbiosMiscDxe/Type03 Thread-Index: AQHW4u4O5a6/I5Wyd0K/YJSqclesa6oZkckQ Date: Tue, 5 Jan 2021 21:47:25 +0000 Message-ID: References: <20210104225830.12606-1-rebecca@nuviainc.com> <20210104225830.12606-16-rebecca@nuviainc.com> In-Reply-To: <20210104225830.12606-16-rebecca@nuviainc.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: Authentication-Results-Original: edk2.groups.io; dkim=none (message not signed) header.d=none;edk2.groups.io; dmarc=none action=none header.from=arm.com; x-originating-ip: [99.132.126.10] x-ms-publictraffictype: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: d8313749-2dfb-4e3c-33a4-08d8b1c3836a x-ms-traffictypediagnostic: DBBPR08MB6203:|AM6PR08MB5173: x-ms-exchange-transport-forked: True X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true nodisclaimer: true x-ms-oob-tlc-oobclassifiers: OLM:3173;OLM:8273; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: p9WScSNRbhqfCnuTvYigcGSrF/k27LdyY1eAExvN6j7YCmwBLy94ibgzqNCUcWWR0Jk/4juGu0mKEIrQQOMCJhKPI/IfXOetmPTPI4FV7MN66heo9lc3qer/x1O8hLYN4E6B3OXD103fsviKFyJRBeaOIsQT6ilS2gVkxrniAY7Z1Ihz8kvhigAlCw0oCAbT6FrtP8WBP9sERDQHEbQ2b98n/wMKukhtQEX2+nlq6scRQSjfDG8AoS53FcxFCu6seTMjsqSr92rHGPPC1+Fq7026gSyRap9CgX0aE0ZnNix+6mATemEcUACYltygCbUYqCTJIfwn2lE5zhzR6Li+baS8rBynsNsyLXQ89kDR9c/AkwLCqEYIWE3p4ToAXAArgv5YX6/nMnkfXGw2dWSu3HenyXixpqKHwxCcGxhyUl5QUjvLpJhxdyuHK8vyDxa/Dj9Fu0+RNUkYplZVYV+zSA== X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DB7PR08MB3260.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(346002)(376002)(39850400004)(396003)(366004)(136003)(33656002)(55016002)(110136005)(54906003)(966005)(86362001)(66446008)(66476007)(66946007)(9686003)(8676002)(64756008)(66556008)(5660300002)(2906002)(478600001)(53546011)(186003)(6506007)(76116006)(71200400001)(19627235002)(83380400001)(4326008)(52536014)(8936002)(7696005)(30864003)(316002)(26005);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata: =?us-ascii?Q?375Fi7kRA40M+UFQQZg+Tw1BmvC/qofYYoAm2HJlOdJZdzoSyr+oxkWtQ+W5?= =?us-ascii?Q?1Tay93/Z/aEMG4nDBtBu/z2+5L3vvH1b63Lvi2ciam90eYEiR+h+aaH0AA/S?= =?us-ascii?Q?AlvuN7jS7kIGYFZP+JDPhz4f9YHjOc1vsLtnLRVU+IHUpVwGyz4fxNf/zWlg?= =?us-ascii?Q?KomlF0SBuJE/3sGGRCSqBqDl13ZVH4VqBkcu5xdXBrYfx286XvVA6m94z7hx?= =?us-ascii?Q?67iqJkgnAF0UKiQqUCgn7PaGQRnjyKZ5AerS52XQYfaMwQIALix++MXCYt7/?= =?us-ascii?Q?S7zouXeG0/J7ruUcOCS2G9E/Szw/JVi9Vc7wjtdLqhYRr6YWC+s71l92y95N?= =?us-ascii?Q?m0Gtbp+jIAlOfgnWGWT1DO56mdBiePPf+cBKUxNfPZgo4BcnDQbMJOtIqaTn?= =?us-ascii?Q?RC5taUziv++ixMM0y5jjulAnfMXv/GXZrnCpMAvxSUSghoR/9Qk1kkb0kQaR?= =?us-ascii?Q?lNWdvyYuxDrVGWEHw2KS0c9loWU4KCIVKsKGaXsAfVsLkkfyl1txj+lTPB9j?= =?us-ascii?Q?m7y1TxI6Kqqid9C3ZC/gwZ8a2xpTQyiNCx5WbS5sZFX7GmoICa0h3DPaE7Bp?= =?us-ascii?Q?l/8IWNj2FkJBCUZvGig5lzOklwbJRTUt4euPNBNwyYIAhZF9D3E6ds3Lpf2Q?= =?us-ascii?Q?6NRfyPScAYtOXmNBupERC2tWfXT/xjDwC9f7h6r/0UvBcfxya5IVIiwLe1un?= =?us-ascii?Q?nJvcMpxR9dLrgWMHzdSxh0/pzVpkOVsZZtFnWuqphy5WSkRNBBigo2tZY27P?= =?us-ascii?Q?h1tipMfUz9TEuYgjQ0hrUPgzBnE1xQSIR+e1uV8YrQCF9aKU8PPmcmTTYKVi?= =?us-ascii?Q?/La1FcpTCxplEmML+X6bV3Bv7VwMzyV8X+DJwfTfteT27EVixp774PngnXiS?= =?us-ascii?Q?4LW6FAerCJt7kCANo0vZQ/0o+WacWO+vyfdG1ebSVpcmNa71Js7qSZCi7ZGs?= =?us-ascii?Q?L2GQr7BH3Gns42Pktsg0DsPTVnr8+7AzgeCp/R3ZNUE=3D?= MIME-Version: 1.0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR08MB6203 Original-Authentication-Results: edk2.groups.io; dkim=none (message not signed) header.d=none;edk2.groups.io; dmarc=none action=none header.from=arm.com; Return-Path: Samer.El-Haj-Mahmoud@arm.com X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM5EUR03FT022.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: 4636b03d-bd22-4dff-e6c9-08d8b1c37d4c X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 3emkBgznLBsu3NtzEqgQAvsd9ghzS905KOT2KOej6xzO98DUSLhWy+0cElLj7gtGC/qtuKZ8k2CFqLLD+y0i2/AZaj1XwiZo+QyTpBDAbLCy29iN+MIckB1jYIjT9f21+vd+ba02xWynxVWrrXcMEIsB9eCJ708jAS1BcekCgk6u6pSVCbPvde1rjf0LkJ4HjqJATDQCiUGLBIX3F5REJpDNT+y+er8Jqu1PMSjCqYLNBXjhSx152YCbEyrCGYEj4fpXIOLOlXOUtjfsSYHKCxTtsRu4Q/fHKv85JcOHBJoFsm1Tr5d3b+isT3pWw5HQkOmugAQmiijBL5W0/YG+w+ZCwQJtTik4Ia6ufHxUkDgTZ1xaZYC73NMZTnFyyrjXAw23tk/ZwhyyBW9QwLhqguvGdlEfWsxjrnNN4B4P1I9Mp/7HTSGWzyZbLygOL3BB7GwR2ha+50XusVOuviY/sVzcpptu3/kV3LNozptpylBrJePOCBSQTDbx3Z8oEtKCqKL75YnYatpfunX/vJhcdZD1gPgVLIkhhKH+U3kI5wc= 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:(4636009)(376002)(346002)(39850400004)(136003)(396003)(46966006)(8936002)(2906002)(33656002)(30864003)(70206006)(5660300002)(70586007)(82310400003)(6506007)(8676002)(52536014)(19627235002)(356005)(81166007)(336012)(7696005)(110136005)(86362001)(53546011)(186003)(9686003)(966005)(26005)(316002)(55016002)(82740400003)(54906003)(4326008)(478600001)(47076005)(83380400001);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jan 2021 21:47:35.3739 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d8313749-2dfb-4e3c-33a4-08d8b1c3836a 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: AM5EUR03FT022.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR08MB5173 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable > -----Original Message----- > From: devel@edk2.groups.io On Behalf Of Rebecca > Cran via groups.io > Sent: Monday, January 4, 2021 5:58 PM > To: devel@edk2.groups.io > Cc: Rebecca Cran ; Leif Lindholm > ; Ard Biesheuvel ; Sami > Mujawar ; Liming Gao > ; Michael D Kinney > ; Zhiguang Liu > Subject: [edk2-devel] [PATCH v5 15/23] ArmPkg: Add > Universal/Smbios/SmbiosMiscDxe/Type03 > > This code provides information for the SMBIOS Type 3 table. > > Signed-off-by: Rebecca Cran > --- > > ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type03/MiscChassisManufacturerDa > ta.c | 51 +++++ > > ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type03/MiscChassisManufacturerFu > nction.c | 208 ++++++++++++++++++++ > > ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type03/MiscChassisManufacturer.u > ni | 17 ++ > 3 files changed, 276 insertions(+) > > diff --git > a/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type03/MiscChassisManufacturer > Data.c > b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type03/MiscChassisManufacturer > Data.c > new file mode 100644 > index 000000000000..d20338b0906c > --- /dev/null > +++ > b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type03/MiscChassisManufactur > +++ erData.c > @@ -0,0 +1,51 @@ > +/** @file > + This file provides Smbios Type3 Data > + > + Based on files under Nt32Pkg/MiscSubClassPlatformDxe/ > + > + Copyright (c) 2006 - 2009, Intel Corporation. All rights > + reserved.
Copyright (c) 2015, Hisilicon Limited. All rights > + reserved.
Copyright (c) 2015, Linaro Limited. All rights > + reserved.
> + SPDX-License-Identifier: BSD-2-Clause-Patent > + > +**/ > + > +#include "SmbiosMisc.h" > + > + > +// > +// Static (possibly build generated) Chassis Manufacturer data. > +// > +MISC_SMBIOS_TABLE_DATA(SMBIOS_TABLE_TYPE3, > MiscChassisManufacturer) =3D { > + { // Hdr > + EFI_SMBIOS_TYPE_SYSTEM_ENCLOSURE, // Type, > + 0, // Length, > + 0 // Handle > + }, > + 1, // Manufactru= rer > + MiscChassisTypeMainServerChassis, // Type > + 2, // Version > + 3, // SerialNumb= er > + 4, // AssetTag > + ChassisStateSafe, // BootupStat= e > + ChassisStateSafe, // PowerSuppl= yState > + ChassisStateSafe, // ThermalSta= te > + ChassisSecurityStatusNone, // SecuritySt= ate Platforms should be able to update their chassis boot state information. T= his is especially important for servers. Platform PCD or OEM library call? > + { > + 0, // OemDefined= [0] > + 0, // OemDefined= [1] > + 0, // OemDefined= [2] > + 0 // OemDefined= [3] > + }, > + 2, // Height Same as this one. Platform PCD or OEM library call? > + 1, // NumberofPo= werCords Same as this one. Platform PCD or OEM library call? > + 0, // ContainedE= lementCount > + 0, // ContainedE= lementRecordLength > + { // ContainedE= lements[0] > + { > + 0, // Containe= dElementType > + 0, // Containe= dElementMinimum > + 0 // Containe= dElementMaximum > + } > + } > +}; > diff --git > a/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type03/MiscChassisManufacturer > Function.c > b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type03/MiscChassisManufacturer > Function.c > new file mode 100644 > index 000000000000..f73e008c80ba > --- /dev/null > +++ > b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type03/MiscChassisManufactur > +++ erFunction.c > @@ -0,0 +1,208 @@ > +/** @file > + This driver parses the mMiscSubclassDataTable structure and reports > + any generated data to smbios. > + > + Based on files under Nt32Pkg/MiscSubClassPlatformDxe/ > + > + Copyright (c) 2009 - 2011, Intel Corporation. All rights > + reserved.
Copyright (c) 2015, Hisilicon Limited. All rights > + reserved.
Copyright (c) 2015, Linaro Limited. All rights > + reserved.
> + SPDX-License-Identifier: BSD-2-Clause-Patent > + > +**/ > + > +#include "SmbiosMisc.h" > + > +/** > + * Returns the chassis type in SMBIOS format. > + * > + * @return Chassis type > +**/ > +UINT8 > +GetChassisType ( > + VOID > + ) > +{ > + EFI_STATUS Status; > + UINT8 ChassisType; > + > + Status =3D OemGetChassisType (&ChassisType); if (EFI_ERROR (Status))= { > + return 0; > + } > + > + return ChassisType; > +} > + > +/** > + This function makes boot time changes to the contents of the > + MiscChassisManufacturer (Type 3). > + > + @param RecordData Pointer to copy of RecordData from= the Data > Table. > + > + @retval EFI_SUCCESS All parameters were valid. > + @retval EFI_UNSUPPORTED Unexpected RecordType value. > + @retval EFI_INVALID_PARAMETER Invalid parameter was found. > + > +**/ > +MISC_SMBIOS_TABLE_FUNCTION(MiscChassisManufacturer) > +{ > + CHAR8 *OptionalStrStart; > + CHAR8 *StrStart; > + UINTN RecordLength; > + UINTN ManuStrLen; > + UINTN VerStrLen; > + UINTN AssertTagStrLen; > + UINTN SerialNumStrLen; > + UINTN ChaNumStrLen; > + EFI_STRING Manufacturer; > + EFI_STRING Version; > + EFI_STRING SerialNumber; > + EFI_STRING AssertTag; > + EFI_STRING ChassisSkuNumber; > + EFI_STRING_ID TokenToGet; > + EFI_SMBIOS_HANDLE SmbiosHandle; > + SMBIOS_TABLE_TYPE3 *SmbiosRecord; > + SMBIOS_TABLE_TYPE3 *InputData; > + EFI_STATUS Status; > + > + UINT8 ContainedElementCount; > + CONTAINED_ELEMENT ContainedElements; > + UINT8 ExtendLength; > + > + UINT8 ChassisType; > + > + ExtendLength =3D 0; > + > + // > + // First check for invalid parameters. > + // > + if (RecordData =3D=3D NULL) { > + return EFI_INVALID_PARAMETER; > + } > + > + InputData =3D (SMBIOS_TABLE_TYPE3 *)RecordData; > + > + UpdateSmbiosInfo ( > + mHiiHandle, > + STRING_TOKEN (STR_MISC_CHASSIS_ASSET_TAG), > + AssetTagType03 > + ); > + UpdateSmbiosInfo ( > + mHiiHandle, > + STRING_TOKEN (STR_MISC_CHASSIS_SERIAL_NUMBER), > + SerialNumberType03 > + ); > + UpdateSmbiosInfo ( > + mHiiHandle, > + STRING_TOKEN (STR_MISC_CHASSIS_VERSION), > + VersionType03 > + ); > + UpdateSmbiosInfo ( > + mHiiHandle, > + STRING_TOKEN (STR_MISC_CHASSIS_MANUFACTURER), > + ManufacturerType03 > + ); > + > + TokenToGet =3D STRING_TOKEN (STR_MISC_CHASSIS_MANUFACTURER); > + Manufacturer =3D HiiGetPackageString (&gEfiCallerIdGuid, TokenToGet, > + NULL); ManuStrLen =3D StrLen (Manufacturer); > + > + TokenToGet =3D STRING_TOKEN (STR_MISC_CHASSIS_VERSION); Version =3D > + HiiGetPackageString (&gEfiCallerIdGuid, TokenToGet, NULL); VerStrLen > + =3D StrLen (Version); > + > + TokenToGet =3D STRING_TOKEN (STR_MISC_CHASSIS_SERIAL_NUMBER); > + SerialNumber =3D HiiGetPackageString (&gEfiCallerIdGuid, TokenToGet, > + NULL); SerialNumStrLen =3D StrLen (SerialNumber); > + > + TokenToGet =3D STRING_TOKEN (STR_MISC_CHASSIS_ASSET_TAG); AssertTag = = =3D > + HiiGetPackageString (&gEfiCallerIdGuid, TokenToGet, NULL); > + AssertTagStrLen =3D StrLen (AssertTag); > + > + TokenToGet =3D STRING_TOKEN (STR_MISC_CHASSIS_SKU_NUMBER); > + ChassisSkuNumber =3D HiiGetPackageString (&gEfiCallerIdGuid, TokenToGe= t, > + NULL); ChaNumStrLen =3D StrLen (ChassisSkuNumber); > + > + ContainedElementCount =3D InputData->ContainedElementCount; > + > + if (ContainedElementCount > 1) { > + ExtendLength =3D (ContainedElementCount - 1) * sizeof > + (CONTAINED_ELEMENT); } > + > + // > + // Two zeros following the last string. > + // > + RecordLength =3D sizeof (SMBIOS_TABLE_TYPE3) + > + ExtendLength + 1 + > + ManuStrLen + 1 + > + VerStrLen + 1 + > + SerialNumStrLen + 1 + > + AssertTagStrLen + 1 + > + ChaNumStrLen + 1 + 1; > + SmbiosRecord =3D AllocateZeroPool (RecordLength); if (SmbiosRecord = =3D=3D > + NULL) { > + Status =3D EFI_OUT_OF_RESOURCES; > + goto Exit; > + } > + > + (VOID)CopyMem (SmbiosRecord, InputData, sizeof (SMBIOS_TABLE_TYPE3)); > + > + SmbiosRecord->Hdr.Length =3D sizeof (SMBIOS_TABLE_TYPE3) + ExtendLeng= th > + + 1; > + > + ChassisType =3D GetChassisType (); > + if (ChassisType !=3D 0) { > + SmbiosRecord->Type =3D ChassisType; > + } > + > + //ContainedElements > + ASSERT (ContainedElementCount < 2); > + (VOID)CopyMem (SmbiosRecord + 1, &ContainedElements, ExtendLength); > + > + //ChassisSkuNumber > + *((UINT8 *)SmbiosRecord + sizeof (SMBIOS_TABLE_TYPE3) + ExtendLength) > + =3D 5; > + > + OptionalStrStart =3D (CHAR8 *)((UINT8 *)SmbiosRecord + sizeof > + (SMBIOS_TABLE_TYPE3) + ExtendLength + 1); UnicodeStrToAsciiStrS > + (Manufacturer, OptionalStrStart, ManuStrLen + 1); StrStart =3D > + OptionalStrStart + ManuStrLen + 1; UnicodeStrToAsciiStrS (Version, > + StrStart, VerStrLen + 1); StrStart +=3D VerStrLen + 1; > + UnicodeStrToAsciiStrS (SerialNumber, StrStart, SerialNumStrLen + 1); > + StrStart +=3D SerialNumStrLen + 1; UnicodeStrToAsciiStrS (AssertTag, > + StrStart, AssertTagStrLen + 1); StrStart +=3D AssertTagStrLen + 1; > + UnicodeStrToAsciiStrS (ChassisSkuNumber, StrStart, ChaNumStrLen + 1); > + // // Now we have got the full smbios record, call smbios protocol to > + add this record. > + // > + Status =3D LogSmbiosData ((UINT8*)SmbiosRecord, &SmbiosHandle); if > + (EFI_ERROR (Status)) { > + DEBUG ((DEBUG_ERROR, "[%a]:[%dL] Smbios Type03 Table Log Failed! %r > \n", > + __FUNCTION__, __LINE__, Status)); } > + > + FreePool (SmbiosRecord); > + > +Exit: > + if (Manufacturer !=3D NULL) { > + FreePool (Manufacturer); > + } > + > + if (Version !=3D NULL) { > + FreePool (Version); > + } > + > + if (SerialNumber !=3D NULL) { > + FreePool (SerialNumber); > + } > + > + if (AssertTag !=3D NULL) { > + FreePool (AssertTag); > + } > + > + if (ChassisSkuNumber !=3D NULL) { > + FreePool (ChassisSkuNumber); > + } > + > + return 0; > +} > diff --git > a/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type03/MiscChassisManufacturer. > uni > b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type03/MiscChassisManufacturer. > uni > new file mode 100644 > index 000000000000..dacb195bff28 > --- /dev/null > +++ > b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type03/MiscChassisManufactur > +++ er.uni > @@ -0,0 +1,17 @@ > +/** @file > + Based on files under Nt32Pkg/MiscSubClassPlatformDxe/ > + > + Copyright (c) 2006 - 2010, Intel Corporation. All rights > + reserved.
Copyright (c) 2015, Hisilicon Limited. All rights > + reserved.
Copyright (c) 2015, Linaro Limited. All rights > + reserved.
> + SPDX-License-Identifier: BSD-2-Clause-Patent > + > +**/ > + > +/=3D# > + > +#string STR_MISC_CHASSIS_MANUFACTURER #language en-US "Not > Specified" > +#string STR_MISC_CHASSIS_VERSION #language en-US "Not Specified" > +#string STR_MISC_CHASSIS_SERIAL_NUMBER #language en-US "Not > Specified" > +#string STR_MISC_CHASSIS_ASSET_TAG #language en-US "Not Specified" > +#string STR_MISC_CHASSIS_SKU_NUMBER #language en-US "Not Specified" > -- > 2.26.2 > > > >=20 > IMPORTANT NOTICE: The contents of this email and any attachments are confi= dential and may also be privileged. If you are not the intended recipient, = please notify the sender immediately and do not disclose the contents to an= y other person, use it for any purpose, or store or copy the information in= any medium. Thank you.