From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id CB4D274003A for ; Fri, 5 Jan 2024 19:28:30 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=/Bs++tV6/ERyuVVOZltf5A/UEw2hdxDJXx78LRuyxh4=; c=relaxed/simple; d=groups.io; h=ARC-Seal:ARC-Message-Signature:ARC-Authentication-Results:From:To:CC:Subject:Thread-Topic:Thread-Index:Date:Message-ID:References:In-Reply-To:Accept-Language:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Language:Content-Type:Content-Transfer-Encoding; s=20140610; t=1704482909; v=1; b=Lq3w7X0FHgHXHwRiEazvfsqV//ZxeGAj1DBoCyu+2qdF2dNB0C6b1i364CD1b27ZLbrMZfok 6e/004d3NmWUroYJxGkxkZNPGRKOpcJueUJxrQlXnBBlwn8ftqnYInuFfgDa9OfnSis10N+IN6Q BQrpE0g4WrJrhTsdXMEo3iQo= X-Received: by 127.0.0.2 with SMTP id cDiyYY7687511xmv1elQ8LRt; Fri, 05 Jan 2024 11:28:29 -0800 X-Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.7]) by mx.groups.io with SMTP id smtpd.web11.32383.1704482908816560379 for ; Fri, 05 Jan 2024 11:28:28 -0800 X-IronPort-AV: E=McAfee;i="6600,9927,10944"; a="19082514" X-IronPort-AV: E=Sophos;i="6.04,334,1695711600"; d="scan'208";a="19082514" X-Received: from orviesa001.jf.intel.com ([10.64.159.141]) by fmvoesa101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Jan 2024 11:27:07 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.04,334,1695711600"; d="scan'208";a="29194833" X-Received: from orsmsx601.amr.corp.intel.com ([10.22.229.14]) by orviesa001.jf.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 05 Jan 2024 11:27:07 -0800 X-Received: from orsmsx612.amr.corp.intel.com (10.22.229.25) by ORSMSX601.amr.corp.intel.com (10.22.229.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Fri, 5 Jan 2024 11:27:06 -0800 X-Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) by ORSMSX612.amr.corp.intel.com (10.22.229.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Fri, 5 Jan 2024 11:27:06 -0800 X-Received: from orsedg603.ED.cps.intel.com (10.7.248.4) by orsmsx610.amr.corp.intel.com (10.22.229.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35 via Frontend Transport; Fri, 5 Jan 2024 11:27:06 -0800 X-Received: from NAM12-MW2-obe.outbound.protection.outlook.com (104.47.66.40) by edgegateway.intel.com (134.134.137.100) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Fri, 5 Jan 2024 11:27:06 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lqntJPoACFFcTvmVZ2Htk9WaQZrzO5Pj9pCGrsedCoB6XCfJR7L2azSyfIeoS6Pwz6Ipo5kPN1yI9gTubDDMXwanvSYf/aa6EO80Z5dcSvKC2HI7FGej2iImoNRkQHxiW316KSZwxVaFeB0N0g1vxqsSEHQHtqjTNNCHj3XAt6OmgP5QYY0bi/B416b90Auc31J0rvPlHc2Q9gIb/j3/1kzEu83MVyXDSBgE4u9kdv4yt7y6YpLr5b9rc5aNGDA3jXBfepZOMxnT5S6N0ZHkb75InxMY+fJvrNxbhzwS/lnlaqcKNMjAw393AMMSQOWvdwfM3hIytGhqM4tGoNAUrg== 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=yqroaeArwjsNp1cyEAvDS4O7UxA4kb0+X7LXcFHwB4E=; b=njE82McE4F0jpAOPf+BTFFAS7OiSp1WUjcbHjK1yXzNny4AGiynpblu3IlTNi2/x3JLUVt3DgDElo0MP6/ol6wBVLdU2VEW4v1jw7aU00P6/ps4i2Vu3qYyriUtQi9ghvhScuJh5JeZA/uRaIl5hhh+ILZZlxQHAS339/8jCpxwcA4ttmOVNBBXSTf9P8ucBCnT4YGhYLY1TzJwFKu79FxWsNTykYKq99FbjpPOxwVHfNporPoc6Hm1M34u5J5xzxf7Ct2zd7W9xXbKfvw/LvuqMIWC4JX8rrRmAZxm4BpkIeZccG/XvtWJU6coIen3hdHTKIQpJ/xMgEx1SiTQnDQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none X-Received: from MW4PR11MB5821.namprd11.prod.outlook.com (2603:10b6:303:184::5) by IA1PR11MB6513.namprd11.prod.outlook.com (2603:10b6:208:3a3::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7159.16; Fri, 5 Jan 2024 19:27:03 +0000 X-Received: from MW4PR11MB5821.namprd11.prod.outlook.com ([fe80::7d4f:b2b0:e284:aeff]) by MW4PR11MB5821.namprd11.prod.outlook.com ([fe80::7d4f:b2b0:e284:aeff%4]) with mapi id 15.20.7159.013; Fri, 5 Jan 2024 19:27:03 +0000 From: "Nate DeSimone" To: "Huang, Li-Xia" , "devel@edk2.groups.io" CC: "Dong, Eric" Subject: Re: [edk2-devel] [PATCH v1 1/1] BoardModulePkg\Library\BiosIdLib: Support Standalone MM Thread-Topic: [PATCH v1 1/1] BoardModulePkg\Library\BiosIdLib: Support Standalone MM Thread-Index: AQHaN9D4TA0r9+1NTUiw89lSkVC1EbDLqpug Date: Fri, 5 Jan 2024 19:27:03 +0000 Message-ID: References: <20231226075555.3947-1-lisa.huang@intel.com> In-Reply-To: <20231226075555.3947-1-lisa.huang@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-traffictypediagnostic: MW4PR11MB5821:EE_|IA1PR11MB6513:EE_ x-ms-office365-filtering-correlation-id: 35a2bb01-c858-41e6-cffe-08dc0e244bae x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam-message-info: /wKxRKXVbLEB4Nz4uvBGLm7kbwn8h4CawJL/maoDAlAiM2tY8/EkL3o/yH5vCc3F90B493uLyKXKUzr1RuUfZhOhlSxpD++D0zX7R47/zFM6+wFxQ/1igwQWXTvwRnhZw8MiEVsJC/Rh9VyHonJk82aR+mMqZQxzkzemrvzw5v5TEOZpxStXX5iBBuHTTW18/lxSq3u9Q4++icNPuAU4M//42V51UDfOlpRazxIlQtLEmaTCTJ+6DZ13m/9vrpDMBU5NoXp8EO2leRhD85ve6vsszh/KV+2iNPPeVRotZFiBLZL2IkOFwEK/V7duLXL7vpjm55sZiXKkK1VRp0hrxIejIUd5XhdX0HeUAo+t+JBEeEs/3ktf7GKtyUauoTCqSqQCgBppuce9Gkd7MywBzoZI9aKgN+sOG8sO3L+8KKxnacwWxPfq+IoAs+W0vhSXeM38fbAWfZG6y4aN06jHEdgxiZUuEV0RpKEpCfLcGXcW5YozlIb69229algMvO3rl9Os97h8obfFUXlX0FWOaK9xarVPeJ2oTdilGxyb9GBlHEE8OikwtSOa6lOt4chKtramnX/n3VfjUfS0LUg91dthRnB/ZQxj8dFCH75lFmeea93aAgJ32jvKkkmghBYB x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?mvpVbTixVeRQq+CQwlO5hyhDI+nZbp0Czbu/o/Bdm2CS1s9S55rp3KXDqW5u?= =?us-ascii?Q?IO52GTvC6rve5sRb3KeP+7Ipx/TTGolmECVwUt8x4MFJC/q2UjqWJF8ne1pg?= =?us-ascii?Q?wuLfyrMA3uFqUgzns3SnoFmHrUscCLPWR999XePkvhKCdkR/7rz3rBeuDD4c?= =?us-ascii?Q?1ICOHcp61WW6Nw6DP1dAyFEUFgaF41wE8HAAAChbeiQRZIpFOYtZ+OxrSQB0?= =?us-ascii?Q?G6qY750jqUDnZTBDQVI6qf0d/axzJpc/TKkfJo8ONLMcJkLV8C25aWl/9dzt?= =?us-ascii?Q?ChQS61CXc0UWfFa9+vr9prfyVBxjkP8Sich4FvTp2+Kr9XCnBNe/07Crqrw6?= =?us-ascii?Q?yk2Qgy3j155FJA98LalUcj9QwD8di8wq/oHmoHBFL44LsxRHAx+aYoAMntJC?= =?us-ascii?Q?nCVc6F0Vu7vVYKCLQzJ+hyLRHV6xXHn75MeJGhaJMGZzZ4bX6cdmBFJ3LI9P?= =?us-ascii?Q?x75jQEe9XXSQefk1pzHvpouv0He5SsfqjydQ8Iab/AvKy/9Eznh4jQSDsc4S?= =?us-ascii?Q?oFnr8gYMDBzgsTnL9gxXDYPegnBxaheFLder7lBYZHrD8ijhnv6xtm0wvZKD?= =?us-ascii?Q?sXIjVI9enka5wABoFsI2yczoxVAfjDWKnovC2VO0tFjI9OVi1783Ln3ejjAb?= =?us-ascii?Q?uef6CpQ5uXTblPUjs1FZms3jR9GBrbpqPmXWanW4LWenfbEQvn/UXy20qf5a?= =?us-ascii?Q?uESRfujKcq9Cg3vgURg/qV6nzOYFv4BwIG++C28jFvkX82oxkQIWOC4sBOJO?= =?us-ascii?Q?1aULxykXcYLRNnm/XYqrCnZ1nSQw1ZQiiOWRkq6lf3+NdX+sPqnjnJejfayU?= =?us-ascii?Q?2JGKvJs3sz1H8Ba+vum/CpQxvkJLHqEO46DanqXswCFtttKhnH2xmU6W5xja?= =?us-ascii?Q?2fdfgfpvgQCZR4qY0icERx/ucyPuOKM6DQuihiCSaFjpMmCt+tECj16oCseu?= =?us-ascii?Q?pseXbQ47mUvvHJXskvwhtXq73RFzOJsH6r4n6dxnj6/oc4d3WqvfkUMxJmfw?= =?us-ascii?Q?K75fQqJN2Qpl3DEQNd7XlSBrmvy2V6qv03Me7gOC1mYpVqcaepsZLxEKEwjY?= =?us-ascii?Q?wEckPQtdNYosMFMfecaP+YqSURhWcQaUJF4PGCV5dcpn08mbQL04DSezPobL?= =?us-ascii?Q?Jmpy8E+jk7XqeQg5sgLeSSsvUaLEaImlAf4qMQW5atDmKRSyDX/j6pAFqKIv?= =?us-ascii?Q?ksmCGJKlVuNpne1JbKGWo3GS7hAD4A7m0KzmodoZNhERdDeIpa7Kh8yhN+Et?= =?us-ascii?Q?WlXSCkePbfDkrOc7jyhfNh9r6stSLx6Oz7HNxVpG16cAS0gx6WlNiO8aN/Dr?= =?us-ascii?Q?OETnABYtOy5drkL/30rx/mY3OZ+sO64FRHs4TqoUvTQ1l6zyq13bNI4ttoo4?= =?us-ascii?Q?mqE+8Hp4APtT2JlEhvww8wHeX0VWilPlPbp1+w/tJfq2prnet+SZReNESZxK?= =?us-ascii?Q?29dHlzjE/0iqijyrOYtlDdCVhnSpE+A/yRKxRkfJI4xsLN20QpqdiasuqtxT?= =?us-ascii?Q?/KUblskdbczsJWf0eASK92yp6xNGb4BjNn9OlQ44H9AAhzKNqpXATF8clBJ1?= =?us-ascii?Q?EPyjzpm6u5+k3VkSKjRTle6h7dvvcETKuwhmYkoznm4AokU8d9a5tRSunC0B?= =?us-ascii?Q?KA=3D=3D?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MW4PR11MB5821.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 35a2bb01-c858-41e6-cffe-08dc0e244bae X-MS-Exchange-CrossTenant-originalarrivaltime: 05 Jan 2024 19:27:03.0762 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: QGQ+8vTCuXCVbl7enImHzl2rT63+qS7QkgcQlgg3UWY7CBTdjFfqRuTeKCsenZCeR9112QRtBNmkYhq+pqVyaFvDA79WJXqJX1ERCsz7whI= X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR11MB6513 X-OriginatorOrg: intel.com Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,nathaniel.l.desimone@intel.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: Sa60oX1iVSJoBb2HXyEK3GPux7686176AA= Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=Lq3w7X0F; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=intel.com (policy=none); spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io; arc=reject ("signature check failed: fail, {[1] = sig:microsoft.com:reject}") Pushed as b46ecad > -----Original Message----- > From: Huang, Li-Xia > Sent: Monday, December 25, 2023 11:56 PM > To: devel@edk2.groups.io > Cc: Dong, Eric ; Desimone, Nathaniel L > > Subject: [PATCH v1 1/1] BoardModulePkg\Library\BiosIdLib: Support > Standalone MM >=20 > Add Standalone Mm BiosIdLib and format code with Uncrustify. >=20 > Cc: Eric Dong > Cc: Nate DeSimone >=20 > Signed-off-by: Lixia Huang > --- > Platform/Intel/BoardModulePkg/Library/BiosIdLib/BiosIdCommon.c = | > 96 ++++++++++++++++ > Platform/Intel/BoardModulePkg/Library/BiosIdLib/DxeBiosIdLib.c = | 111 > +++--------------- > Platform/Intel/BoardModulePkg/Library/BiosIdLib/PeiBiosIdLib.c = | 118 > +++----------------- > Platform/Intel/BoardModulePkg/Library/BiosIdLib/StandaloneMmBiosIdLib.c > | 65 +++++++++++ > Platform/Intel/BoardModulePkg/BoardModulePkg.dsc = | 1 + > Platform/Intel/BoardModulePkg/Library/BiosIdLib/DxeBiosIdLib.inf = | 1 > + > Platform/Intel/BoardModulePkg/Library/BiosIdLib/PeiBiosIdLib.inf = | 6 > +- >=20 > Platform/Intel/BoardModulePkg/Library/BiosIdLib/StandaloneMmBiosIdLib.i > nf | 42 +++++++ > 8 files changed, 241 insertions(+), 199 deletions(-) >=20 > diff --git > a/Platform/Intel/BoardModulePkg/Library/BiosIdLib/BiosIdCommon.c > b/Platform/Intel/BoardModulePkg/Library/BiosIdLib/BiosIdCommon.c > new file mode 100644 > index 000000000000..5735566bfe3a > --- /dev/null > +++ b/Platform/Intel/BoardModulePkg/Library/BiosIdLib/BiosIdCommon.c > @@ -0,0 +1,96 @@ > +/** @file > + Boot service common BIOS ID library implementation. > + > + These functions in this file can be called during DXE and cannot be > + called during runtime or in SMM which should use a RT or SMM library. > + > + > +Copyright (c) 2023, Intel Corporation. All rights reserved.
> +SPDX-License-Identifier: BSD-2-Clause-Patent > + > +**/ > + > +#include > +#include > +#include > +#include > + > +/** > + This function returns the BIOS Version & Release Date and Time by gett= ing > and converting BIOS ID. > + > + @param[out] BiosVersion The Bios Version out of the conversion. > + @param[out] BiosReleaseDate The Bios Release Date out of the > conversion. > + @param[out] BiosReleaseTime The Bios Release Time out of the > conversion. > + > + @retval EFI_SUCCESS BIOS Version & Release Date and Time= have > been got successfully. > + @retval EFI_NOT_FOUND BIOS ID image is not found, and no > parameter will be modified. > + @retval EFI_INVALID_PARAMETER All the parameters are NULL. > + > +**/ > +EFI_STATUS > +EFIAPI > +GetBiosVersionDateTime ( > + OUT CHAR16 *BiosVersion OPTIONAL, > + OUT CHAR16 *BiosReleaseDate OPTIONAL, > + OUT CHAR16 *BiosReleaseTime OPTIONAL > + ) > +{ > + EFI_STATUS Status; > + BIOS_ID_IMAGE BiosIdImage; > + > + if ((BiosVersion =3D=3D NULL) && (BiosReleaseDate =3D=3D NULL) && > (BiosReleaseTime =3D=3D NULL)) { > + return EFI_INVALID_PARAMETER; > + } > + > + Status =3D GetBiosId (&BiosIdImage); > + if (EFI_ERROR (Status)) { > + return EFI_NOT_FOUND; > + } > + > + if (BiosVersion !=3D NULL) { > + // > + // Fill the BiosVersion data from the BIOS ID. > + // > + CopyMem (BiosVersion, &(BiosIdImage.BiosIdString), sizeof > + (BIOS_ID_STRING)); } > + > + if (BiosReleaseDate !=3D NULL) { > + // > + // Fill the build timestamp date from the BIOS ID in the "MM/DD/YY" > format. > + // > + BiosReleaseDate[0] =3D BiosIdImage.BiosIdString.TimeStamp[2]; > + BiosReleaseDate[1] =3D BiosIdImage.BiosIdString.TimeStamp[3]; > + BiosReleaseDate[2] =3D (CHAR16)((UINT8)('/')); > + > + BiosReleaseDate[3] =3D BiosIdImage.BiosIdString.TimeStamp[4]; > + BiosReleaseDate[4] =3D BiosIdImage.BiosIdString.TimeStamp[5]; > + BiosReleaseDate[5] =3D (CHAR16)((UINT8)('/')); > + > + // > + // Add 20 for SMBIOS table > + // Current Linux kernel will misjudge 09 as year 0, so using 2009 fo= r > SMBIOS table > + // > + BiosReleaseDate[6] =3D '2'; > + BiosReleaseDate[7] =3D '0'; > + BiosReleaseDate[8] =3D BiosIdImage.BiosIdString.TimeStamp[0]; > + BiosReleaseDate[9] =3D BiosIdImage.BiosIdString.TimeStamp[1]; > + > + BiosReleaseDate[10] =3D (CHAR16)((UINT8)('\0')); } > + > + if (BiosReleaseTime !=3D NULL) { > + // > + // Fill the build timestamp time from the BIOS ID in the "HH:MM" for= mat. > + // > + BiosReleaseTime[0] =3D BiosIdImage.BiosIdString.TimeStamp[6]; > + BiosReleaseTime[1] =3D BiosIdImage.BiosIdString.TimeStamp[7]; > + BiosReleaseTime[2] =3D (CHAR16)((UINT8)(':')); > + > + BiosReleaseTime[3] =3D BiosIdImage.BiosIdString.TimeStamp[8]; > + BiosReleaseTime[4] =3D BiosIdImage.BiosIdString.TimeStamp[9]; > + > + BiosReleaseTime[5] =3D (CHAR16)((UINT8)('\0')); } > + > + return EFI_SUCCESS; > +} > diff --git a/Platform/Intel/BoardModulePkg/Library/BiosIdLib/DxeBiosIdLib= .c > b/Platform/Intel/BoardModulePkg/Library/BiosIdLib/DxeBiosIdLib.c > index 3e614d9efc3e..6535bb36f6c9 100644 > --- a/Platform/Intel/BoardModulePkg/Library/BiosIdLib/DxeBiosIdLib.c > +++ b/Platform/Intel/BoardModulePkg/Library/BiosIdLib/DxeBiosIdLib.c > @@ -5,7 +5,7 @@ > or in SMM which should use a RT or SMM library. >=20 >=20 > -Copyright (c) 2015 - 2019, Intel Corporation. All rights reserved.
> +Copyright (c) 2015 - 2023, Intel Corporation. All rights reserved.
> SPDX-License-Identifier: BSD-2-Clause-Patent >=20 > **/ > @@ -15,7 +15,6 @@ SPDX-License-Identifier: BSD-2-Clause-Patent #include > #include #include > -#include #include > #include #include > @@ -36,16 +35,16 @@ SPDX-License-Identifier: BSD-2- > Clause-Patent EFI_STATUS EFIAPI GetBiosId ( > - OUT BIOS_ID_IMAGE *BiosIdImage OPTIONAL > + OUT BIOS_ID_IMAGE *BiosIdImage OPTIONAL > ) > { > - EFI_STATUS Status; > - BIOS_ID_IMAGE TempBiosIdImage; > - VOID *Address; > - UINTN Size; > + EFI_STATUS Status; > + BIOS_ID_IMAGE TempBiosIdImage; > + VOID *Address; > + UINTN Size; >=20 > Address =3D NULL; > - Size =3D 0; > + Size =3D 0; >=20 > if (BiosIdImage =3D=3D NULL) { > // > @@ -58,10 +57,10 @@ GetBiosId ( > Address =3D GetFirstGuidHob (&gBiosIdGuid); > if (Address !=3D NULL) { > Size =3D sizeof (BIOS_ID_IMAGE); > - CopyMem ((VOID *) BiosIdImage, GET_GUID_HOB_DATA (Address), Size); > + CopyMem ((VOID *)BiosIdImage, GET_GUID_HOB_DATA (Address), Size); >=20 > - DEBUG ((EFI_D_INFO, "DXE get BIOS ID from HOB successfully\n")); > - DEBUG ((EFI_D_INFO, "BIOS ID: %s\n", (CHAR16 *) (&(BiosIdImage- > >BiosIdString)))); > + DEBUG ((DEBUG_INFO, "DXE get BIOS ID from HOB successfully\n")); > + DEBUG ((DEBUG_INFO, "BIOS ID: %s\n", (CHAR16 > + *)(&(BiosIdImage->BiosIdString)))); > return EFI_SUCCESS; > } >=20 > @@ -77,99 +76,17 @@ GetBiosId ( > // BIOS ID image is present in FV. > // > Size =3D sizeof (BIOS_ID_IMAGE); > - CopyMem ((VOID *) BiosIdImage, Address, Size); > + CopyMem ((VOID *)BiosIdImage, Address, Size); > // > // GetSectionFromAnyFv () allocated buffer for Address, now free it. > // > FreePool (Address); >=20 > - DEBUG ((EFI_D_INFO, "DXE get BIOS ID from FV successfully\n")); > - DEBUG ((EFI_D_INFO, "BIOS ID: %s\n", (CHAR16 *) (&(BiosIdImage- > >BiosIdString)))); > + DEBUG ((DEBUG_INFO, "DXE get BIOS ID from FV successfully\n")); > + DEBUG ((DEBUG_INFO, "BIOS ID: %s\n", (CHAR16 > + *)(&(BiosIdImage->BiosIdString)))); > return EFI_SUCCESS; > } >=20 > - DEBUG ((EFI_D_ERROR, "DXE get BIOS ID failed: %r\n", EFI_NOT_FOUND)); > + DEBUG ((DEBUG_ERROR, "DXE get BIOS ID failed: %r\n", > EFI_NOT_FOUND)); > return EFI_NOT_FOUND; > } > - > -/** > - This function returns the BIOS Version & Release Date and Time by gett= ing > and converting BIOS ID. > - > - @param[out] BiosVersion The Bios Version out of the conversion. > - @param[out] BiosReleaseDate The Bios Release Date out of the convers= ion. > - @param[out] BiosReleaseTime The Bios Release Time out of the > conversion. > - > - @retval EFI_SUCCESS BIOS Version & Release Date and Time= have > been got successfully. > - @retval EFI_NOT_FOUND BIOS ID image is not found, and no > parameter will be modified. > - @retval EFI_INVALID_PARAMETER All the parameters are NULL. > - > -**/ > -EFI_STATUS > -EFIAPI > -GetBiosVersionDateTime ( > - OUT CHAR16 *BiosVersion, OPTIONAL > - OUT CHAR16 *BiosReleaseDate, OPTIONAL > - OUT CHAR16 *BiosReleaseTime OPTIONAL > - ) > -{ > - EFI_STATUS Status; > - BIOS_ID_IMAGE BiosIdImage; > - > - if ((BiosVersion =3D=3D NULL) && (BiosReleaseDate =3D=3D NULL) && > (BiosReleaseTime =3D=3D NULL)) { > - return EFI_INVALID_PARAMETER; > - } > - > - Status =3D GetBiosId (&BiosIdImage); > - if (EFI_ERROR (Status)) { > - return EFI_NOT_FOUND; > - } > - > - if (BiosVersion !=3D NULL) { > - // > - // Fill the BiosVersion data from the BIOS ID. > - // > - CopyMem (BiosVersion, &(BiosIdImage.BiosIdString), sizeof > (BIOS_ID_STRING)); > - } > - > - if (BiosReleaseDate !=3D NULL) { > - // > - // Fill the build timestamp date from the BIOS ID in the "MM/DD/YY" > format. > - // > - BiosReleaseDate[0] =3D BiosIdImage.BiosIdString.TimeStamp[2]; > - BiosReleaseDate[1] =3D BiosIdImage.BiosIdString.TimeStamp[3]; > - BiosReleaseDate[2] =3D (CHAR16) ((UINT8) ('/')); > - > - BiosReleaseDate[3] =3D BiosIdImage.BiosIdString.TimeStamp[4]; > - BiosReleaseDate[4] =3D BiosIdImage.BiosIdString.TimeStamp[5]; > - BiosReleaseDate[5] =3D (CHAR16) ((UINT8) ('/')); > - > - // > - // Add 20 for SMBIOS table > - // Current Linux kernel will misjudge 09 as year 0, so using 2009 fo= r SMBIOS > table > - // > - BiosReleaseDate[6] =3D '2'; > - BiosReleaseDate[7] =3D '0'; > - BiosReleaseDate[8] =3D BiosIdImage.BiosIdString.TimeStamp[0]; > - BiosReleaseDate[9] =3D BiosIdImage.BiosIdString.TimeStamp[1]; > - > - BiosReleaseDate[10] =3D (CHAR16) ((UINT8) ('\0')); > - } > - > - if (BiosReleaseTime !=3D NULL) { > - > - // > - // Fill the build timestamp time from the BIOS ID in the "HH:MM" for= mat. > - // > - BiosReleaseTime[0] =3D BiosIdImage.BiosIdString.TimeStamp[6]; > - BiosReleaseTime[1] =3D BiosIdImage.BiosIdString.TimeStamp[7]; > - BiosReleaseTime[2] =3D (CHAR16) ((UINT8) (':')); > - > - BiosReleaseTime[3] =3D BiosIdImage.BiosIdString.TimeStamp[8]; > - BiosReleaseTime[4] =3D BiosIdImage.BiosIdString.TimeStamp[9]; > - > - BiosReleaseTime[5] =3D (CHAR16) ((UINT8) ('\0')); > - } > - > - return EFI_SUCCESS; > -} > - > diff --git a/Platform/Intel/BoardModulePkg/Library/BiosIdLib/PeiBiosIdLib= .c > b/Platform/Intel/BoardModulePkg/Library/BiosIdLib/PeiBiosIdLib.c > index b0f15d2cb8d5..c1295a16444d 100644 > --- a/Platform/Intel/BoardModulePkg/Library/BiosIdLib/PeiBiosIdLib.c > +++ b/Platform/Intel/BoardModulePkg/Library/BiosIdLib/PeiBiosIdLib.c > @@ -1,7 +1,7 @@ > /** @file > Boot service PEI BIOS ID library implementation. >=20 > -Copyright (c) 2-015 - 2019, Intel Corporation. All rights reserved.
> +Copyright (c) 2015 - 2023, Intel Corporation. All rights reserved.
> SPDX-License-Identifier: BSD-2-Clause-Patent >=20 > **/ > @@ -30,19 +30,19 @@ SPDX-License-Identifier: BSD-2-Clause-Patent > EFI_STATUS EFIAPI GetBiosId ( > - OUT BIOS_ID_IMAGE *BiosIdImage OPTIONAL > + OUT BIOS_ID_IMAGE *BiosIdImage OPTIONAL > ) > { > - EFI_STATUS Status; > - BIOS_ID_IMAGE TempBiosIdImage; > - VOID *Address; > - UINTN Size; > - UINTN Instance; > - EFI_PEI_FV_HANDLE VolumeHandle; > - EFI_PEI_FILE_HANDLE FileHandle; > + EFI_STATUS Status; > + BIOS_ID_IMAGE TempBiosIdImage; > + VOID *Address; > + UINTN Size; > + UINTN Instance; > + EFI_PEI_FV_HANDLE VolumeHandle; > + EFI_PEI_FILE_HANDLE FileHandle; >=20 > Address =3D NULL; > - Size =3D 0; > + Size =3D 0; >=20 > if (BiosIdImage =3D=3D NULL) { > // > @@ -55,15 +55,15 @@ GetBiosId ( > Address =3D GetFirstGuidHob (&gBiosIdGuid); > if (Address !=3D NULL) { > Size =3D sizeof (BIOS_ID_IMAGE); > - CopyMem ((VOID *) BiosIdImage, GET_GUID_HOB_DATA (Address), Size); > + CopyMem ((VOID *)BiosIdImage, GET_GUID_HOB_DATA (Address), Size); >=20 > - DEBUG ((EFI_D_INFO, "PEI get BIOS ID from HOB successfully\n")); > - DEBUG ((EFI_D_INFO, "BIOS ID: %s\n", (CHAR16 *) (&(BiosIdImage- > >BiosIdString)))); > + DEBUG ((DEBUG_INFO, "PEI get BIOS ID from HOB successfully\n")); > + DEBUG ((DEBUG_INFO, "BIOS ID: %s\n", (CHAR16 > + *)(&(BiosIdImage->BiosIdString)))); > return EFI_SUCCESS; > } >=20 > VolumeHandle =3D NULL; > - Instance =3D 0; > + Instance =3D 0; > while (TRUE) { > // > // Traverse all firmware volume instances. > @@ -74,7 +74,7 @@ GetBiosId ( > } >=20 > FileHandle =3D NULL; > - Status =3D PeiServicesFfsFindFileByName (&gBiosIdGuid, VolumeHandle, > &FileHandle); > + Status =3D PeiServicesFfsFindFileByName (&gBiosIdGuid, VolumeHan= dle, > &FileHandle); > if (!EFI_ERROR (Status)) { > // > // Search RAW section. > @@ -85,10 +85,10 @@ GetBiosId ( > // BIOS ID image is present in this FV. > // > Size =3D sizeof (BIOS_ID_IMAGE); > - CopyMem ((VOID *) BiosIdImage, Address, Size); > + CopyMem ((VOID *)BiosIdImage, Address, Size); >=20 > - DEBUG ((EFI_D_INFO, "PEI get BIOS ID from FV successfully\n")); > - DEBUG ((EFI_D_INFO, "BIOS ID: %s\n", (CHAR16 *) (&(BiosIdImage- > >BiosIdString)))); > + DEBUG ((DEBUG_INFO, "PEI get BIOS ID from FV successfully\n")); > + DEBUG ((DEBUG_INFO, "BIOS ID: %s\n", (CHAR16 > + *)(&(BiosIdImage->BiosIdString)))); >=20 > // > // Build GUID HOB for the BIOS ID image. > @@ -107,85 +107,3 @@ GetBiosId ( > DEBUG ((EFI_D_ERROR, "PEI get BIOS ID failed: %r\n", EFI_NOT_FOUND)); > return EFI_NOT_FOUND; > } > - > -/** > - This function returns the BIOS Version & Release Date and Time by gett= ing > and converting BIOS ID. > - > - @param[out] BiosVersion The Bios Version out of the conversion. > - @param[out] BiosReleaseDate The Bios Release Date out of the convers= ion. > - @param[out] BiosReleaseTime The Bios Release Time out of the > conversion. > - > - @retval EFI_SUCCESS BIOS Version & Release Date and Time= have > been got successfully. > - @retval EFI_NOT_FOUND BIOS ID image is not found, and no > parameter will be modified. > - @retval EFI_INVALID_PARAMETER All the parameters are NULL. > - > -**/ > -EFI_STATUS > -EFIAPI > -GetBiosVersionDateTime ( > - OUT CHAR16 *BiosVersion, OPTIONAL > - OUT CHAR16 *BiosReleaseDate, OPTIONAL > - OUT CHAR16 *BiosReleaseTime OPTIONAL > - ) > -{ > - EFI_STATUS Status; > - BIOS_ID_IMAGE BiosIdImage; > - > - if ((BiosVersion =3D=3D NULL) && (BiosReleaseDate =3D=3D NULL) && > (BiosReleaseTime =3D=3D NULL)) { > - return EFI_INVALID_PARAMETER; > - } > - > - Status =3D GetBiosId (&BiosIdImage); > - if (EFI_ERROR (Status)) { > - return EFI_NOT_FOUND; > - } > - > - if (BiosVersion !=3D NULL) { > - // > - // Fill the BiosVersion data from the BIOS ID. > - // > - CopyMem (BiosVersion, &(BiosIdImage.BiosIdString), sizeof > (BIOS_ID_STRING)); > - } > - > - if (BiosReleaseDate !=3D NULL) { > - // > - // Fill the build timestamp date from the BIOS ID in the "MM/DD/YY" > format. > - // > - BiosReleaseDate[0] =3D BiosIdImage.BiosIdString.TimeStamp[2]; > - BiosReleaseDate[1] =3D BiosIdImage.BiosIdString.TimeStamp[3]; > - BiosReleaseDate[2] =3D (CHAR16) ((UINT8) ('/')); > - > - BiosReleaseDate[3] =3D BiosIdImage.BiosIdString.TimeStamp[4]; > - BiosReleaseDate[4] =3D BiosIdImage.BiosIdString.TimeStamp[5]; > - BiosReleaseDate[5] =3D (CHAR16) ((UINT8) ('/')); > - > - // > - // Add 20 for SMBIOS table > - // Current Linux kernel will misjudge 09 as year 0, so using 2009 fo= r SMBIOS > table > - // > - BiosReleaseDate[6] =3D '2'; > - BiosReleaseDate[7] =3D '0'; > - BiosReleaseDate[8] =3D BiosIdImage.BiosIdString.TimeStamp[0]; > - BiosReleaseDate[9] =3D BiosIdImage.BiosIdString.TimeStamp[1]; > - > - BiosReleaseDate[10] =3D (CHAR16) ((UINT8) ('\0')); > - } > - > - if (BiosReleaseTime !=3D NULL) { > - > - // > - // Fill the build timestamp time from the BIOS ID in the "HH:MM" for= mat. > - // > - BiosReleaseTime[0] =3D BiosIdImage.BiosIdString.TimeStamp[6]; > - BiosReleaseTime[1] =3D BiosIdImage.BiosIdString.TimeStamp[7]; > - BiosReleaseTime[2] =3D (CHAR16) ((UINT8) (':')); > - > - BiosReleaseTime[3] =3D BiosIdImage.BiosIdString.TimeStamp[8]; > - BiosReleaseTime[4] =3D BiosIdImage.BiosIdString.TimeStamp[9]; > - > - BiosReleaseTime[5] =3D (CHAR16) ((UINT8) ('\0')); > - } > - > - return EFI_SUCCESS; > -} > - > diff --git > a/Platform/Intel/BoardModulePkg/Library/BiosIdLib/StandaloneMmBiosIdLib > .c > b/Platform/Intel/BoardModulePkg/Library/BiosIdLib/StandaloneMmBiosIdLi > b.c > new file mode 100644 > index 000000000000..af2d47f2b133 > --- /dev/null > +++ > b/Platform/Intel/BoardModulePkg/Library/BiosIdLib/StandaloneMmBiosId > +++ Lib.c > @@ -0,0 +1,65 @@ > +/** @file > + Boot service StandaloneMm BIOS ID library implementation. > + > + These functions in this file can be called during DXE and cannot be > + called during runtime or in SMM which should use a RT or SMM library. > + > + > +Copyright (c) 2023, Intel Corporation. All rights reserved.
> +SPDX-License-Identifier: BSD-2-Clause-Patent > + > +**/ > + > +#include > +#include > +#include > +#include > +#include > + > +#include > + > +/** > + This function returns BIOS ID by searching HOB. > + It also debug print the BIOS ID found. > + > + @param[out] BiosIdImage The BIOS ID got from HOB or FV. It is option= al, > + no BIOS ID will be returned if it is NULL as= input. > + > + @retval EFI_SUCCESS BIOS ID has been got successfully. > + @retval EFI_NOT_FOUND BIOS ID image is not found, and no > parameter will be modified. > + > +**/ > +EFI_STATUS > +EFIAPI > +GetBiosId ( > + OUT BIOS_ID_IMAGE *BiosIdImage OPTIONAL > + ) > +{ > + BIOS_ID_IMAGE TempBiosIdImage; > + VOID *Address; > + UINTN Size; > + > + Address =3D NULL; > + Size =3D 0; > + > + if (BiosIdImage =3D=3D NULL) { > + // > + // It is NULL as input, so no BIOS ID will be returned. > + // Use temp buffer to hold the BIOS ID. > + // > + BiosIdImage =3D &TempBiosIdImage; > + } > + > + Address =3D GetFirstGuidHob (&gBiosIdGuid); if (Address !=3D NULL) { > + Size =3D sizeof (BIOS_ID_IMAGE); > + CopyMem ((VOID *)BiosIdImage, GET_GUID_HOB_DATA (Address), Size); > + > + DEBUG ((DEBUG_INFO, "StandaloneMm get BIOS ID from HOB > successfully\n")); > + DEBUG ((DEBUG_INFO, "BIOS ID: %s\n", (CHAR16 *)(&(BiosIdImage- > >BiosIdString)))); > + return EFI_SUCCESS; > + } > + > + DEBUG ((DEBUG_ERROR, "StandaloneMm get BIOS ID failed: %r\n", > +EFI_NOT_FOUND)); > + return EFI_NOT_FOUND; > +} > diff --git a/Platform/Intel/BoardModulePkg/BoardModulePkg.dsc > b/Platform/Intel/BoardModulePkg/BoardModulePkg.dsc > index 9f00592a19c0..44a2abd03f58 100644 > --- a/Platform/Intel/BoardModulePkg/BoardModulePkg.dsc > +++ b/Platform/Intel/BoardModulePkg/BoardModulePkg.dsc > @@ -88,6 +88,7 @@ >=20 > BoardModulePkg/Library/BiosIdLib/DxeBiosIdLib.inf > BoardModulePkg/Library/BiosIdLib/PeiBiosIdLib.inf > + BoardModulePkg/Library/BiosIdLib/StandaloneMmBiosIdLib.inf >=20 >=20 > BoardModulePkg/Library/PeiFirmwareBootMediaInfoLib/PeiFirmwareBootMe > diaInfoLib.inf > BoardModulePkg/Library/BdsPs2KbcLib/BdsPs2KbcLib.inf > diff --git a/Platform/Intel/BoardModulePkg/Library/BiosIdLib/DxeBiosIdLib= .inf > b/Platform/Intel/BoardModulePkg/Library/BiosIdLib/DxeBiosIdLib.inf > index 39f42e91a0cc..f73ab1f3b6b6 100644 > --- a/Platform/Intel/BoardModulePkg/Library/BiosIdLib/DxeBiosIdLib.inf > +++ b/Platform/Intel/BoardModulePkg/Library/BiosIdLib/DxeBiosIdLib.inf > @@ -22,6 +22,7 @@ >=20 > [Sources.common] > DxeBiosIdLib.c > + BiosIdCommon.c >=20 > [Packages] > MdePkg/MdePkg.dec > diff --git a/Platform/Intel/BoardModulePkg/Library/BiosIdLib/PeiBiosIdLib= .inf > b/Platform/Intel/BoardModulePkg/Library/BiosIdLib/PeiBiosIdLib.inf > index e38d17bd9bb1..c197a3f18316 100644 > --- a/Platform/Intel/BoardModulePkg/Library/BiosIdLib/PeiBiosIdLib.inf > +++ b/Platform/Intel/BoardModulePkg/Library/BiosIdLib/PeiBiosIdLib.inf > @@ -1,7 +1,7 @@ > ### @file > # PEI BIOS ID library. > # > -# Copyright (c) 2015 - 2019, Intel Corporation. All rights reserved.
> +# Copyright (c) 2015 - 2023, Intel Corporation. All rights > +reserved.
> # > # SPDX-License-Identifier: BSD-2-Clause-Patent # @@ -22,10 +22,12 @@ >=20 > [Sources.common] > PeiBiosIdLib.c > + BiosIdCommon.c >=20 > [Packages] > MdePkg/MdePkg.dec > - BoardModulePkg/BoardModulePkg.dec >=20 > + BoardModulePkg/BoardModulePkg.dec > + >=20 > [LibraryClasses] > BaseLib > diff --git > a/Platform/Intel/BoardModulePkg/Library/BiosIdLib/StandaloneMmBiosIdLib > .inf > b/Platform/Intel/BoardModulePkg/Library/BiosIdLib/StandaloneMmBiosIdLi > b.inf > new file mode 100644 > index 000000000000..40f64b8067d1 > --- /dev/null > +++ > b/Platform/Intel/BoardModulePkg/Library/BiosIdLib/StandaloneMmBiosId > +++ Lib.inf > @@ -0,0 +1,42 @@ > +### @file > +# StandaloneMm BIOS ID library. > +# > +# Copyright (c) 2023, Intel Corporation. All rights reserved.
# # > +SPDX-License-Identifier: BSD-2-Clause-Patent # ### [Defines] > + INF_VERSION =3D 0x00010005 > + BASE_NAME =3D StandaloneMmBiosIdLib > + FILE_GUID =3D b6304cdf-6d3e-4762-8a88-ff98dcad6b14 > + MODULE_TYPE =3D MM_STANDALONE > + VERSION_STRING =3D 1.0 > + PI_SPECIFICATION_VERSION =3D 0x00010032 > + LIBRARY_CLASS =3D BiosIdLib| MM_CORE_STANDALONE > MM_STANDALONE > + > +# > +# The following information is for reference only and not required by th= e build > tools. > +# > +# VALID_ARCHITECTURES =3D IA32 X64 > +# > + > +[Sources.common] > + StandaloneMmBiosIdLib.c > + BiosIdCommon.c > + > +[Packages] > + MdePkg/MdePkg.dec > + BoardModulePkg/BoardModulePkg.dec > + > +[LibraryClasses] > + BaseLib > + BaseMemoryLib > + HobLib > + DebugLib > + > +[Guids] > + ## SOMETIMES_CONSUMES ## HOB > + ## SOMETIMES_CONSUMES ## GUID > + gBiosIdGuid > + > -- > 2.26.2.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#113317): https://edk2.groups.io/g/devel/message/113317 Mute This Topic: https://groups.io/mt/103367466/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-