From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.93; helo=mga11.intel.com; envelope-from=mang.guo@intel.com; receiver=edk2-devel@lists.01.org Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id EEB9521139F63 for ; Mon, 17 Sep 2018 04:13:02 -0700 (PDT) X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 17 Sep 2018 04:13:02 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.53,385,1531810800"; d="dat'59?scan'59,208,59";a="263253166" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by fmsmga005.fm.intel.com with ESMTP; 17 Sep 2018 04:13:02 -0700 Received: from fmsmsx114.amr.corp.intel.com (10.18.116.8) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.319.2; Mon, 17 Sep 2018 04:13:02 -0700 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by FMSMSX114.amr.corp.intel.com (10.18.116.8) with Microsoft SMTP Server (TLS) id 14.3.319.2; Mon, 17 Sep 2018 04:13:01 -0700 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.240]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.16]) with mapi id 14.03.0319.002; Mon, 17 Sep 2018 19:12:59 +0800 From: "Guo, Mang" To: "edk2-devel@lists.01.org" CC: "Wei, David" Thread-Topic: [Patch][edk2-platforms/devel-MinnowBoardMax-UDK2017] Produce SMBIOS type 1 Thread-Index: AdROd2Q3Qg6tCyYhS7q1EjV0etT8FA== Date: Mon, 17 Sep 2018 11:12:59 +0000 Message-ID: <22D2C85ED001C54AA20BFE3B0E4751D1526DA201@SHSMSX103.ccr.corp.intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: <22D2C85ED001C54AA20BFE3B0E4751D1526DA201@SHSMSX103.ccr.corp.intel.com> x-originating-ip: [10.239.127.40] MIME-Version: 1.0 X-Content-Filtered-By: Mailman/MimeDel 2.1.29 Subject: [Patch][edk2-platforms/devel-MinnowBoardMax-UDK2017] Produce SMBIOS type 1 X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Sep 2018 11:13:03 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Produce SMBIOS type 1 table before ready to boot event so BDS driver can ge= t product name, CUP info from SMBIOS table and show the info in front page = before boot. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Guo Mang CC: David Wei --- .../SmBiosMiscDxe/MiscSystemManufacturerFunction.c | 26 ++++++++++++++++++= +--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscSystemManufacturerFunction= .c b/Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscSystemManufacturerFunction.c index 1199374..40a84a8 100644 --- a/Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscSystemManufacturerFunction.c +++ b/Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscSystemManufacturerFunction.c @@ -206,11 +206,14 @@ AddSmbiosManuCallback ( CHAR16 *Uuid; UINT64 TempData; UINTN Index; + static BOOLEAN RemoveTable =3D TRUE; + EFI_SMBIOS_TABLE_HEADER *Record; =20 =20 =20 - +if (Event !=3D NULL) { gBS->CloseEvent (Event); // Unload this event. +} =20 DEBUG ((EFI_D_INFO, "Executing AddSmbiosManuCallback.\n")); =20 @@ -453,6 +456,21 @@ AddSmbiosManuCallback ( // Now we have got the full smbios record, call smbios protocol to add t= his record. // SmbiosHandle =3D SMBIOS_HANDLE_PI_RESERVED; + if (RemoveTable =3D=3D TRUE) { + Status =3D EFI_SUCCESS; + while (!EFI_ERROR(Status)) { + Status =3D Smbios->GetNext (Smbios, &SmbiosHandle, NULL, &Record, NU= LL); + if (Record->Type =3D=3D SMBIOS_TYPE_SYSTEM_INFORMATION) { + Status =3D Smbios-> Remove( + Smbios, + SmbiosHandle + ); + RemoveTable =3D FALSE; + break; + } + } + } + Status =3D Smbios-> Add( Smbios, NULL, @@ -481,6 +499,9 @@ MISC_SMBIOS_TABLE_FUNCTION(MiscSystemManufacturer) static BOOLEAN CallbackIsInstalledManu =3D FALSE; EFI_EVENT AddSmbiosManuCallbackEvent; =20 + + Status =3D AddSmbiosManuCallback (NULL, RecordData); + if (CallbackIsInstalledManu =3D=3D FALSE) { CallbackIsInstalledManu =3D TRUE; // Prevent more than 1 callback. DEBUG ((EFI_D_INFO, "Create Smbios Manu callback.\n")); @@ -492,10 +513,9 @@ MISC_SMBIOS_TABLE_FUNCTION(MiscSystemManufacturer) RecordData, &AddSmbiosManuCallbackEvent ); - return Status; } =20 - return EFI_SUCCESS; + return Status; =20 } =20 --=20 2.10.1.windows.1