From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from EUR04-HE1-obe.outbound.protection.outlook.com (EUR04-HE1-obe.outbound.protection.outlook.com [40.107.7.78]) by mx.groups.io with SMTP id smtpd.web11.850.1611602622441910062 for ; Mon, 25 Jan 2021 11:23:44 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=Q9Ci4023; spf=pass (domain: arm.com, ip: 40.107.7.78, 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=C6+vU0UoSLmVDHWhF6JA5y+oMaxrxjO/u1lApo0sn44=; b=Q9Ci4023s++pIXW3jzKYJ77HZpuyzPWQmfVs5i6VYJ1bGNSsmnYGcP+bmQTN2ZScM5VeKehqbKrFK6Wu3N42TMmqkRs8r5jbdIHVKKUKHJ9ItZd89QR7JkJCYj2EzRyExihl9m7DBco3ti+qzbH5EZXjHePfl6pGLUl1e7ay5mY= Received: from AM5PR0402CA0022.eurprd04.prod.outlook.com (2603:10a6:203:90::32) by DB9PR08MB6364.eurprd08.prod.outlook.com (2603:10a6:10:253::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3784.17; Mon, 25 Jan 2021 19:23:28 +0000 Received: from AM5EUR03FT046.eop-EUR03.prod.protection.outlook.com (2603:10a6:203:90:cafe::55) by AM5PR0402CA0022.outlook.office365.com (2603:10a6:203:90::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3784.12 via Frontend Transport; Mon, 25 Jan 2021 19:23:28 +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 AM5EUR03FT046.mail.protection.outlook.com (10.152.16.164) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3784.11 via Frontend Transport; Mon, 25 Jan 2021 19:23:28 +0000 Received: ("Tessian outbound 4d8113405d55:v71"); Mon, 25 Jan 2021 19:23:27 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 9fd004a107653508 X-CR-MTA-TID: 64aa7808 Received: from a0d1de3d6218.2 by 64aa7808-outbound-1.mta.getcheckrecipient.com id C4236277-43B9-43F7-95FD-EB5F81141529.1; Mon, 25 Jan 2021 19:23:22 +0000 Received: from EUR03-VE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id a0d1de3d6218.2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Mon, 25 Jan 2021 19:23:22 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=V38vAZha7h0BAtHuSnNtlkRpqKzsxcpn7n86SI/fthmcK6APYvMbqwvLhBOwbiYT88dLxRPmTjKS9qEAjx+QimkrSYNJbVKwMsmpEfgkE/Y14Yi8IgTs67FQELYxdEUeiBOgavkCzu2MvqhRWlrn4LMa+uoFhEM+XJEBR7HZoGjXRMU9B2pj0T5AqROSTRtDB6nVz1r1RtbEzTGLHRssiMijG7RroTOS5TK8J71G1eW/ybb5fBuj5naeGKfcNFKnqRlvpXrXv1z4vNbSN/NM6Sdj2AyhO8Qy8c9JImWqRJJbKb7V5uy0XZjBiNvVwUmimM62kQZdWdTgbGPfORAj6Q== 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=C6+vU0UoSLmVDHWhF6JA5y+oMaxrxjO/u1lApo0sn44=; b=B+yftE7Z6OM1ceATScIZ6X66HORJf8ls00AsaMpAxblVXaPUMnekvpJ2bw/1GMazJ4aUpxli0koKTWq+hUrIrem00C2sNVS3gciyUXtL8P6bcpPRKYVTknBxH1/ER5q5n+FCNTUv5lDIAB9as8mcxlmFU5J+5zzSDMjQEPpSzTltx9SF2ESocUabyhu9LKqTUX5GuIbXeZNca/qJ5665zbjldvcH52c74X1nssAck40vwGrUoxCbQ1FYwtq2SP+8UD6jT0DMT1XD+pOdXMozJLUkUGToWOT4byaUcZA9Oma1wcLxYdJuTBx20zZ0ZmLZlM6sFtOUoyFI6apLPdUX2A== 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=C6+vU0UoSLmVDHWhF6JA5y+oMaxrxjO/u1lApo0sn44=; b=Q9Ci4023s++pIXW3jzKYJ77HZpuyzPWQmfVs5i6VYJ1bGNSsmnYGcP+bmQTN2ZScM5VeKehqbKrFK6Wu3N42TMmqkRs8r5jbdIHVKKUKHJ9ItZd89QR7JkJCYj2EzRyExihl9m7DBco3ti+qzbH5EZXjHePfl6pGLUl1e7ay5mY= Received: from DB7PR08MB3260.eurprd08.prod.outlook.com (2603:10a6:5:21::23) by DB8PR08MB5369.eurprd08.prod.outlook.com (2603:10a6:10:11c::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3784.12; Mon, 25 Jan 2021 19:23:20 +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.3784.016; Mon, 25 Jan 2021 19:23:19 +0000 From: "Samer El-Haj-Mahmoud" To: "devel@edk2.groups.io" , "rebecca@nuviainc.com" CC: Leif Lindholm , Ard Biesheuvel , nd , Sami Mujawar , Liming Gao , Michael D Kinney , Zhiguang Liu Subject: Re: [edk2-devel] [PATCH v6 18/22] ArmPkg: Add Universal/Smbios/SmbiosMiscDxe/Type03 Thread-Topic: [edk2-devel] [PATCH v6 18/22] ArmPkg: Add Universal/Smbios/SmbiosMiscDxe/Type03 Thread-Index: AQHW6pToVTZQrxFiF02/3mrSDw91z6o4yeUw Date: Mon, 25 Jan 2021 19:23:19 +0000 Message-ID: References: <20210114163628.31952-1-rebecca@nuviainc.com> <20210114163628.31952-19-rebecca@nuviainc.com> In-Reply-To: <20210114163628.31952-19-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: 57c1dab6-0b43-4fbb-e671-08d8c166b188 x-ms-traffictypediagnostic: DB8PR08MB5369:|DB9PR08MB6364: x-ms-exchange-transport-forked: True X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true nodisclaimer: true x-ms-oob-tlc-oobclassifiers: OLM:494;OLM:494; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: Kzt8fZJL0D8sWCDWHrxkE/KNw0Oj3m20VqrqNVV35l5DXU5qaWjNotRL/zWLtq3qdgtrMyFGCb0LXszYZQGn119G5GGLryJu5MxtkGob+KJMmO/QYwRRrfSULRksQnUbYOcdEZTQt05VVxzjtglYpaR9nCh6gTCxco82gY2zEkS9bMrQvx3C6u1U2xgFcZFbn9Q1rEkXmRjYnoLPA5AJbuyC5om3nmt31qmZU0ikgAfweE1J5KdPep7ynEHc2P4F2ZxhIe2Ia+WXkTrwsUPSrMYjn2ncyPoA21sY9BLH8DaThLa66PVogmeAUh2Ckr/8gxkEE9AhsEeBFQylEShS9QGxZ3UE6rREooUMVASh9fnrsAFY8KQGIM8xFqq4MWIFrVnPR8QnRk0fWK4Al6UkMf8WFsJA/yX/U2gtuYDsqxxUcXZxSgXW03/c3LwTig3rF0UUFLRaYihdKOOIrHBX73nFkFujKFNuvZszjKGtiAbOEwbJhGRhXJmNJU6GMsK6Z/g2I/w+N+M38oCX2QxX0r2yukF94exveOqAVNWU/ee7hFLBmX+pyJp7zIobLNE9LX3+QI04q0Grpte0pN+7/IIxK0lSmOBS5/kHnpLZjl4= 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)(366004)(346002)(136003)(376002)(396003)(39860400002)(53546011)(6506007)(54906003)(52536014)(110136005)(316002)(7696005)(33656002)(9686003)(64756008)(76116006)(66946007)(66446008)(66556008)(66476007)(71200400001)(4326008)(966005)(26005)(2906002)(86362001)(186003)(30864003)(83380400001)(5660300002)(478600001)(55016002)(8676002)(19627235002)(8936002);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata: =?us-ascii?Q?jY9FgXIkvXz8cDoL1i69UioWPo524zC6QPaGdwFqPosVDgCdETaJJtBvledn?= =?us-ascii?Q?LLLuP7aSh8U7zT8fKDty7s22pAnGaOaQ7GRaChe6azwNZ2orK1nGuzOcYvtd?= =?us-ascii?Q?fM7BXNhCzn9UlTyXm5zg08ZHWizjIlNV1Iw0ICNoB31G+7/qSp61Z93DqhnV?= =?us-ascii?Q?e0Euz9dvM9j+1Jrg0n9kVWpWyOoDn4Qw79qhoK5EH1DjVS0LEt+qW8x+V7b5?= =?us-ascii?Q?Ol6RiXpmZ2IMoOt7vQL++sVbbc7RpY+l91MBXiJtX1B6HCvtWoIMpw2LWXP5?= =?us-ascii?Q?KqgQ//me1ti/imYauc/D+pUXi/Iwehdkj1pd9p+5rQmUowuL64frwlWFL9dc?= =?us-ascii?Q?q71bL2os4eeLSS0VB8aYB350iBFisEIYR9IHx/yo0xBAEXEKNUbC6Mjx2bBX?= =?us-ascii?Q?zcB7jYNEGJB3SYTzeOFSRxCQlU29U+xybiOVwHkyL2SExQhm5wdevrHCSvbA?= =?us-ascii?Q?aGr40br79zA5DLcfrwSJQd3T2d45FwNkLJxmDTyWNowd709UcdNRCAzudc5i?= =?us-ascii?Q?2QJFwkuA9QT3Qar5jBtAm3Mnff31r4/awGIuM2taDS9CLOnJ7Bp482H07VAO?= =?us-ascii?Q?Jl5sV3qhNFvrlDgjzReD2w3HTUwz9LJ3S6MDcDidKNn1m/+wDYOQj7IDAELA?= =?us-ascii?Q?cbYoGz4haPV3+9rBxflCqdQiz5HnDkgu0XCa0Z0JtDVMepteP9OT22yIjRaH?= =?us-ascii?Q?cHxKdR8XNngIt7YQ8kt6Z9SEZBFiyzP0t7XHVzKI50jJPvb27bhdYlKPNB30?= =?us-ascii?Q?usegilraapwfz3XvsRfgXwtxtOj6BXPbinIqChhO+8fdc59m9MxbG6jy8cN9?= =?us-ascii?Q?uBnvwge0IuwxqwMldvihH/5FNFMeCqgQYkQiZ3JpYVVoowwfPa+27YBTN9GC?= =?us-ascii?Q?Iaq5sMfaedodnzRxyJhRfpLJWxTT+iq8I7/WfdNrG/QNVEW+PQ9al+R940h4?= =?us-ascii?Q?/Tda4LhYMkUX1xNZFQVjITfP4PaseNRRmgwLi589dfJjsMI98Oi14Sn0GEiy?= =?us-ascii?Q?wYaeO6ytG+JWN43ED6WgFiW0R1YII/8Ly76wcqt2yzrlc2fEpqmu6I9rFtiz?= =?us-ascii?Q?ImruSqiy?= MIME-Version: 1.0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8PR08MB5369 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: AM5EUR03FT046.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: d4be433f-5f5c-47a6-dee2-08d8c166ac99 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: pFywsBp1ZDMnbyKTMGAyy+nmt4xDTfdVVE0/DA0KRKudfosujsHA/TRmrcP81FC6nZppxPIZLOP6mGlEeNQU7u45JphQB7/8EeUxTLAYqkP1PP++7ONNwNcqWyDJsh6APyFdfEtbdZzv1xEjA4PI4zqqvb2BVGlsKUk/3yspVi2c3k0oEslIYGJCNEGHb4+Qb2k+OarVmw2ZyzUzViEpoUTMKjmxwR+92qDvVS8nTCiSUpGt6/GmtPNDK7x8vdQPOaRtzq35+lnIMflJDh1K0xTcB1FRhanLNa2+F5wXlWQuQYLL5norh+S56Xjmgl9pWGmPKbVdgarJu8pXi+r3JP9Xk25FFWBgiG1tcor6TmLkA2zHQGR8bvTPII9bjU8MYmfMSPCfLObnjkgGxlJRMrSWcrokBiuyXKh0fh+biJEf2vRQn4L+w8W9WSYLWJpCGc4GDo+Yb0UYomizwj8TVAjEe2+NKREJt7cb+2q2abzFw8Wz3dd85m8FYfM0z3kkD5FAwTo0X9cuaDqPwEeY9+OiTKUgHTOlDb7MnsEqD8o= 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)(136003)(39860400002)(346002)(396003)(46966006)(30864003)(81166007)(53546011)(6506007)(8676002)(2906002)(4326008)(52536014)(26005)(356005)(54906003)(186003)(82740400003)(8936002)(966005)(7696005)(86362001)(336012)(316002)(47076005)(83380400001)(70586007)(19627235002)(5660300002)(70206006)(9686003)(478600001)(33656002)(82310400003)(55016002)(110136005)(107886003);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jan 2021 19:23:28.1539 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 57c1dab6-0b43-4fbb-e671-08d8c166b188 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: AM5EUR03FT046.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR08MB6364 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Samer El-Haj-Mahmoud > -----Original Message----- > From: devel@edk2.groups.io On Behalf Of Rebecca > Cran via groups.io > Sent: Thursday, January 14, 2021 11:36 AM > To: devel@edk2.groups.io > Cc: Rebecca Cran ; Leif Lindholm > ; Ard Biesheuvel ; nd > ; Sami Mujawar ; Liming Gao > ; Michael D Kinney > ; Zhiguang Liu > Subject: [edk2-devel] [PATCH v6 18/22] ArmPkg: Add > Universal/Smbios/SmbiosMiscDxe/Type03 >=20 > This code provides information for the SMBIOS Type 3 table. >=20 > Signed-off-by: Rebecca Cran > --- >=20 > ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type03/MiscChassisManufactur > erData.c | 52 +++++ >=20 > ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type03/MiscChassisManufactur > erFunction.c | 224 ++++++++++++++++++++ >=20 > ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type03/MiscChassisManufactur > er.uni | 18 ++ > 3 files changed, 294 insertions(+) >=20 > diff --git > a/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type03/MiscChassisManufact > urerData.c > b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type03/MiscChassisManufact > urerData.c > new file mode 100644 > index 000000000000..137bd941d0b1 > --- /dev/null > +++ > b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type03/MiscChassisManufact > ur > +++ erData.c > @@ -0,0 +1,52 @@ > +/** @file > + This file provides Smbios Type3 Data > + > + Based on files under Nt32Pkg/MiscSubClassPlatformDxe/ > + > + Copyright (c) 2021, NUVIA Inc. All rights reserved.
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. > +// > +SMBIOS_MISC_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 > + { > + 0, // OemDefined= [0] > + 0, // OemDefined= [1] > + 0, // OemDefined= [2] > + 0 // OemDefined= [3] > + }, > + 2, // Height > + 1, // NumberofPo= werCords > + 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/MiscChassisManufact > urerFunction.c > b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type03/MiscChassisManufact > urerFunction.c > new file mode 100644 > index 000000000000..e6adbceba2d5 > --- /dev/null > +++ > b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type03/MiscChassisManufact > ur > +++ erFunction.c > @@ -0,0 +1,224 @@ > +/** @file > + This driver parses the mMiscSubclassDataTable structure and reports > + any generated data to smbios. > + > + Based on files under Nt32Pkg/MiscSubClassPlatformDxe/ > + > + Copyright (c) 2021, NUVIA Inc. All rights reserved.
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 > +#include > +#include > +#include > +#include #include > + #include #include > + > + > +#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) record. > + > + @param RecordData Pointer to SMBIOS table with defau= lt values. > + @param Smbios SMBIOS protocol. > + > + @retval EFI_SUCCESS The SMBIOS table was successfully = added. > + @retval EFI_INVALID_PARAMETER Invalid parameter was found. > + @retval EFI_OUT_OF_RESOURCES Failed to allocate required memory= . > + > +**/ > +SMBIOS_MISC_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; > + 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; > + > + OemUpdateSmbiosInfo ( > + mSmbiosMiscHiiHandle, > + STRING_TOKEN (STR_MISC_CHASSIS_ASSET_TAG), > + AssetTagType03 > + ); > + OemUpdateSmbiosInfo ( > + mSmbiosMiscHiiHandle, > + STRING_TOKEN (STR_MISC_CHASSIS_SERIAL_NUMBER), > + SerialNumberType03 > + ); > + OemUpdateSmbiosInfo ( > + mSmbiosMiscHiiHandle, > + STRING_TOKEN (STR_MISC_CHASSIS_VERSION), > + VersionType03 > + ); > + OemUpdateSmbiosInfo ( > + mSmbiosMiscHiiHandle, > + STRING_TOKEN (STR_MISC_CHASSIS_MANUFACTURER), > + ManufacturerType03 > + ); > + OemUpdateSmbiosInfo ( > + mSmbiosMiscHiiHandle, > + STRING_TOKEN (STR_MISC_CHASSIS_SKU_NUMBER), > + SkuNumberType03 > + ); > + > + 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) + > ExtendLength > + + 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 SmbiosMiscAddRecord ((UINT8*)SmbiosRecord, NULL); 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/MiscChassisManufact > urer.uni > b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type03/MiscChassisManufact > urer.uni > new file mode 100644 > index 000000000000..9512b354fe9a > --- /dev/null > +++ > b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type03/MiscChassisManufact > ur > +++ er.uni > @@ -0,0 +1,18 @@ > +/** @file > + Based on files under Nt32Pkg/MiscSubClassPlatformDxe/ > + > + Copyright (c) 2021, NUVIA Inc. All rights reserved.
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 >=20 >=20 >=20 >=20