From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-vs1-f43.google.com (mail-vs1-f43.google.com [209.85.217.43]) by mx.groups.io with SMTP id smtpd.web12.6205.1648432298031809316 for ; Sun, 27 Mar 2022 18:51:38 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=V35vf+rS; spf=pass (domain: gmail.com, ip: 209.85.217.43, mailfrom: pedro.falcato@gmail.com) Received: by mail-vs1-f43.google.com with SMTP id k15so11864847vsr.11 for ; Sun, 27 Mar 2022 18:51:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=W4lSigijnYDLvTAdREtBSueMC+WfktySiCi59JUugdM=; b=V35vf+rSB5E0aWaINt0cxUjXU0tEgrwOAt+c9fL0oresCVWZzLJns2MjrBhFN04gIO C0AQDMHCTWgt9VLiNh9K+e7sYf4eshNXwmevZHuofEeUlkVqUuk7CRMdnH2DylOCFH7E Z1GboRdoNggFOZed5TGjp0D4jSa5r2CxHsL3T3ZN1gUJkKIpgLDSs8mHsY0KVYeSAfEH FaPj+KkOp2ONjTFNzcZeQMxB2CkL/THskOKwqiYZ/T37b0u22MQVCsBSnm7OEAWhtSaZ LMng6rkvGtnPYJzUPkQY+64hHjPKg2TWfS3iYAO2HfY/AUOCwqzZh1EyqxunR+xw8P+1 rNnQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=W4lSigijnYDLvTAdREtBSueMC+WfktySiCi59JUugdM=; b=XUHbbmGET76CpiWXgLkat7x7asqJ8hT6lfdY0gQruM9SX9PJXU3a88lyQ5vKst3IPY bMCZitX7LXVyztdRz5KW1YMGVMOJ+kAZbpZwtAHgAjw/0BINiVcwdYDGahifeShOMc6x Gb3RtTMBhUsKaCt5vu4HYdgAdGUGD2lTw7hpwCOOXmgvLhO4o4qE/whwuXghAPKqrG0y m4rMnrGEvG0rtuLMNNbQ1DNV0gJ9m0h1BEtjSOUklGN3O1JPZ2xyH6eJZZClVMJvHxAf sSIVosC5iuGHbH7nPQzNSEmHhHb1zvxYYjxEuzC3/4TrptRuuKOHmAZgqKBxveV00HN7 eiJA== X-Gm-Message-State: AOAM532ajZ0HXO41Qi9RcJdHgPg6cuh8ysw1Xc+4ReXPMdKrRcH3LuSC jfUrlEQI52syIwKzHEZksmb+OFJeyNkp/9ek5fY5Zxdq1USVEw== X-Google-Smtp-Source: ABdhPJx66BGD70K2qFJSE8S1XGPjQy2uSAYrGCkhIgCFzGRTN/JD44Jl+8xZOGaAngMwqQ9EHt8ctQ2e9dVHQPj4aiQ= X-Received: by 2002:a05:6102:302a:b0:325:4cea:b1c8 with SMTP id v10-20020a056102302a00b003254ceab1c8mr8652432vsa.75.1648432297032; Sun, 27 Mar 2022 18:51:37 -0700 (PDT) MIME-Version: 1.0 References: <20220327005905.92480-1-pedro.falcato@gmail.com> <20220327005905.92480-3-pedro.falcato@gmail.com> In-Reply-To: <20220327005905.92480-3-pedro.falcato@gmail.com> From: "Pedro Falcato" Date: Mon, 28 Mar 2022 02:51:25 +0100 Message-ID: Subject: Re: [PATCH edk2-platforms 2/2] WhitleyOpenBoardPkg: Replace BaseCrcLib with BaseLib To: edk2-devel-groups-io Cc: Isaac Oram , Nate DeSimone , Chasel Chiu Content-Type: multipart/alternative; boundary="00000000000080451905db3d8d75" --00000000000080451905db3d8d75 Content-Type: text/plain; charset="UTF-8" Hi, Just wanted to note that this patch set is not mergeable/testable right now. I'll submit a correct v2 as soon as possible. Thanks for the understanding, Pedro On Sun, Mar 27, 2022 at 12:59 AM Pedro Falcato wrote: > BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3871 > > Delete BaseCrcLib and slightly adjust each CalculateCrc16 call > for the BaseLib CalculateCrc16() interface, as part of an effort to > unify CRC16 implementations. > > Cc: Isaac Oram > Cc: Nate DeSimone > Cc: Chasel Chiu > > Signed-off-by: Pedro Falcato > --- > .../Include/Library/CrcLib.h | 42 ----------- > .../AcpiPlatformLibBdat.c | 46 ++++-------- > .../Library/BaseCrcLib/BaseCrcLib.c | 71 ------------------- > .../Library/BaseCrcLib/BaseCrcLib.inf | 23 ------ > .../Intel/WhitleyOpenBoardPkg/PlatformPkg.dsc | 1 - > 5 files changed, 12 insertions(+), 171 deletions(-) > delete mode 100644 > Platform/Intel/WhitleyOpenBoardPkg/Include/Library/CrcLib.h > delete mode 100644 > Platform/Intel/WhitleyOpenBoardPkg/Library/BaseCrcLib/BaseCrcLib.c > delete mode 100644 > Platform/Intel/WhitleyOpenBoardPkg/Library/BaseCrcLib/BaseCrcLib.inf > > diff --git a/Platform/Intel/WhitleyOpenBoardPkg/Include/Library/CrcLib.h > b/Platform/Intel/WhitleyOpenBoardPkg/Include/Library/CrcLib.h > deleted file mode 100644 > index 7ca3b7cabb14..000000000000 > --- a/Platform/Intel/WhitleyOpenBoardPkg/Include/Library/CrcLib.h > +++ /dev/null > @@ -1,42 +0,0 @@ > -/** @file > - Interface header file for the CRC library class. > - > - @copyright > - Copyright 2016 - 2018 Intel Corporation.
> - > - SPDX-License-Identifier: BSD-2-Clause-Patent > -**/ > - > -#ifndef _CRC_LIB_H_ > -#define _CRC_LIB_H_ > - > -#include > - > -/** > - Calculate a 16-bit CRC. > - > - The algorithm used is MSB-first form of the ITU-T Recommendation V.41, > which > - uses an initial value of 0x0000 and a polynomial of 0x1021. It is the > same > - algorithm used by XMODEM. > - > - The output CRC location is not updated until the calculation is > finished, so > - it is possible to pass a structure as the data, and the CRC field of > the same > - structure as the output location for the calculated CRC. The CRC field > should > - be set to zero before calling this function. Once the CRC field is > updated by > - this function, running it again over the structure produces a CRC of > zero. > - > - @param[in] Data A pointer to the target data. > - @param[in] DataSize The target data size. > - @param[out] CrcOut A pointer to the return location of the > CRC. > - > - @retval EFI_SUCCESS The CRC was calculated successfully. > - @retval EFI_INVALID_PARAMETER A null pointer was provided. > -**/ > -EFI_STATUS > -CalculateCrc16 ( > - IN VOID *Data, > - IN UINTN DataSize, > - OUT UINT16 *CrcOut > - ); > - > -#endif // _CRC_LIB_H_ > diff --git > a/Platform/Intel/WhitleyOpenBoardPkg/Library/AcpiPlatformTableLib/AcpiPlatformLibBdat.c > b/Platform/Intel/WhitleyOpenBoardPkg/Library/AcpiPlatformTableLib/AcpiPlatformLibBdat.c > index 09464b4a11d1..a1780ced39aa 100644 > --- > a/Platform/Intel/WhitleyOpenBoardPkg/Library/AcpiPlatformTableLib/AcpiPlatformLibBdat.c > +++ > b/Platform/Intel/WhitleyOpenBoardPkg/Library/AcpiPlatformTableLib/AcpiPlatformLibBdat.c > @@ -11,9 +11,9 @@ > // Statements that include other files > // > #include "AcpiPlatformLibLocal.h" > -#include > #include > #include > +#include > #include > #include > #include > @@ -287,15 +287,12 @@ CreateBdatHeader ( > // CRC16 value of the BDAT_STRUCTURE > // > (*BdatHeaderStructPtr)->BdatHeader.Crc16 = 0; > - Status = CalculateCrc16 ( > + (*BdatHeaderStructPtr)->BdatHeader.Crc16 = CalculateCrc16 ( > (VOID *)(*BdatHeaderStructPtr), > BdatSize, > - &(*BdatHeaderStructPtr)->BdatHeader.Crc16 > + 0 > ); > - ASSERT_EFI_ERROR (Status); > - if (EFI_ERROR (Status)) { > - (*BdatHeaderStructPtr)->BdatHeader.Crc16 = 0xFFFF; > - } > + > (*BdatHeaderStructPtr)->BdatSchemas.SchemaListLength = NumberOfSchema; > (*BdatHeaderStructPtr)->BdatSchemas.Reserved = 0; > (*BdatHeaderStructPtr)->BdatSchemas.Reserved1 = 0; > @@ -1088,15 +1085,11 @@ SaveBssaResultsToBdat ( > // CRC16 value of the BDAT_SCHEMA_HEADER_STRUCTURE > // > BssaSchemaHeaderPtr->Crc16 = 0; > - Status = CalculateCrc16 ( > + BssaSchemaHeaderPtr->Crc16 = CalculateCrc16 ( > (VOID *) BssaSchemaHeaderPtr, > sizeof (BDAT_SCHEMA_HEADER_STRUCTURE), > - &BssaSchemaHeaderPtr->Crc16 > + 0 > ); > - ASSERT_EFI_ERROR (Status); > - if (EFI_ERROR (Status)) { > - BssaSchemaHeaderPtr->Crc16 = 0xFFFF; > - } > > if (RemainingHobSizeBssaSchema < CurrentHobSize) { > DEBUG ((DEBUG_WARN, "Not enough space to add complete BIOS SSA > result\n")); > @@ -1217,17 +1210,12 @@ SaveEwlToBdat ( > // CRC16 value of the BDAT_SCHEMA_HEADER_STRUCTURE > // > EwlSchemaHeaderPtr->Crc16 = 0; > - Status = CalculateCrc16 ( > + EwlSchemaHeaderPtr->Crc16 = CalculateCrc16 ( > (VOID *)EwlSchemaHeaderPtr, > sizeof(BDAT_SCHEMA_HEADER_STRUCTURE), > - &EwlSchemaHeaderPtr->Crc16 > + 0 > ); > > - ASSERT_EFI_ERROR (Status); > - if (EFI_ERROR (Status)) { > - EwlSchemaHeaderPtr->Crc16 = 0xFFFF; > - } > - > GuidHob = GetFirstGuidHob (&EWLDataGuid); > EwlPrivateData = GET_GUID_HOB_DATA (GuidHob); > > @@ -1334,17 +1322,12 @@ SaveSpdToBdat ( > // CRC16 value of the BDAT_SCHEMA_HEADER_STRUCTURE > // > SpdSchemaHeaderPtr->Crc16 = 0; > - Status = CalculateCrc16 ( > + SpdSchemaHeaderPtr->Crc16 = CalculateCrc16 ( > (VOID *)SpdSchemaHeaderPtr, > sizeof(BDAT_SCHEMA_HEADER_STRUCTURE), > - &SpdSchemaHeaderPtr->Crc16 > + 0 > ); > > - ASSERT_EFI_ERROR (Status); > - if (EFI_ERROR (Status)) { > - SpdSchemaHeaderPtr->Crc16 = 0xFFFF; > - } > - > Address = Address + sizeof(BDAT_SCHEMA_HEADER_STRUCTURE); > *SchemaSpaceUsed = *SchemaSpaceUsed + > sizeof(BDAT_SCHEMA_HEADER_STRUCTURE); > > @@ -1483,17 +1466,12 @@ SaveTrainingDataToBdat ( > // CRC16 value of the BDAT_SCHEMA_HEADER_STRUCTURE > // > SchemaHeaderPtr->Crc16 = 0; > - Status = CalculateCrc16 ( > + SchemaHeaderPtr->Crc16 = CalculateCrc16 ( > (VOID *)SchemaHeaderPtr, > sizeof(BDAT_SCHEMA_HEADER_STRUCTURE), > - &SchemaHeaderPtr->Crc16 > + 0 > ); > > - ASSERT_EFI_ERROR (Status); > - if (EFI_ERROR (Status)) { > - SchemaHeaderPtr->Crc16 = 0xFFFF; > - } > - > GuidHob = GetFirstGuidHob (&TrainingDataGuid); > > ASSERT (GuidHob != NULL); > diff --git > a/Platform/Intel/WhitleyOpenBoardPkg/Library/BaseCrcLib/BaseCrcLib.c > b/Platform/Intel/WhitleyOpenBoardPkg/Library/BaseCrcLib/BaseCrcLib.c > deleted file mode 100644 > index 3e8fa402add3..000000000000 > --- a/Platform/Intel/WhitleyOpenBoardPkg/Library/BaseCrcLib/BaseCrcLib.c > +++ /dev/null > @@ -1,71 +0,0 @@ > -/** @file > - Base implementation of the CRC library class. > - > - @copyright > - Copyright 2016 - 2018 Intel Corporation.
> - > - SPDX-License-Identifier: BSD-2-Clause-Patent > -**/ > - > -#include > -#include > - > -/** > - Calculate a 16-bit CRC. > - > - The algorithm used is MSB-first form of the ITU-T Recommendation V.41, > which > - uses an initial value of 0x0000 and a polynomial of 0x1021. It is the > same > - algorithm used by XMODEM. > - > - The output CRC location is not updated until the calculation is > finished, so > - it is possible to pass a structure as the data, and the CRC field of > the same > - structure as the output location for the calculated CRC. The CRC field > should > - be set to zero before calling this function. Once the CRC field is > updated by > - this function, running it again over the structure produces a CRC of > zero. > - > - @param[in] Data A pointer to the target data. > - @param[in] DataSize The target data size. > - @param[out] CrcOut A pointer to the return location of the > CRC. > - > - @retval EFI_SUCCESS The CRC was calculated successfully. > - @retval EFI_INVALID_PARAMETER A null pointer was provided. > -**/ > -EFI_STATUS > -CalculateCrc16 ( > - IN VOID *Data, > - IN UINTN DataSize, > - OUT UINT16 *CrcOut > - ) > -{ > - UINT32 Crc; > - UINTN Index; > - UINT8 *Byte; > - > - if (Data == NULL || CrcOut == NULL) { > - return EFI_INVALID_PARAMETER; > - } > - > - Crc = 0x0000; > - for (Byte = (UINT8 *) Data; Byte < (UINT8 *) Data + DataSize; Byte++) { > - // > - // XOR the next data byte into the CRC. > - // > - Crc ^= (UINT16) *Byte << 8; > - // > - // Shift out eight bits, feeding back based on the polynomial > whenever a > - // 1 is shifted out of bit 15. > - // > - for (Index = 0; Index < 8; Index++) { > - Crc <<= 1; > - if (Crc & BIT16) { > - Crc ^= 0x1021; > - } > - } > - } > - > - // > - // Mask and return the 16-bit CRC. > - // > - *CrcOut = (UINT16) (Crc & 0xFFFF); > - return EFI_SUCCESS; > -} > diff --git > a/Platform/Intel/WhitleyOpenBoardPkg/Library/BaseCrcLib/BaseCrcLib.inf > b/Platform/Intel/WhitleyOpenBoardPkg/Library/BaseCrcLib/BaseCrcLib.inf > deleted file mode 100644 > index 6b404e125959..000000000000 > --- a/Platform/Intel/WhitleyOpenBoardPkg/Library/BaseCrcLib/BaseCrcLib.inf > +++ /dev/null > @@ -1,23 +0,0 @@ > -## @file > -# Base implementation of the CRC library class. > -# > -# @copyright > -# Copyright 2016 Intel Corporation.
> -# > -# SPDX-License-Identifier: BSD-2-Clause-Patent > -## > - > -[Defines] > - INF_VERSION = 0x00010019 > - BASE_NAME = BaseCrcLib > - FILE_GUID = F3BE9A28-78A2-4B02-AB26-D27EE85D9256 > - MODULE_TYPE = BASE > - VERSION_STRING = 1.0 > - LIBRARY_CLASS = CrcLib > - > -[Sources] > - BaseCrcLib.c > - > -[Packages] > - MdePkg/MdePkg.dec > - WhitleyOpenBoardPkg/PlatformPkg.dec > diff --git a/Platform/Intel/WhitleyOpenBoardPkg/PlatformPkg.dsc > b/Platform/Intel/WhitleyOpenBoardPkg/PlatformPkg.dsc > index 8c4b9cf6ce28..5b9b08feca46 100644 > --- a/Platform/Intel/WhitleyOpenBoardPkg/PlatformPkg.dsc > +++ b/Platform/Intel/WhitleyOpenBoardPkg/PlatformPkg.dsc > @@ -618,7 +618,6 @@ > > PciSegmentInfoLib|$(PLATFORM_PKG)/Pci/Library/PciSegmentInfoLibSimple/PciSegmentInfoLibSimple.inf > > PlatformOpromPolicyLib|$(RP_PKG)/Library/PlatformOpromPolicyLibNull/PlatformOpromPolicyLibNull.inf > VmgExitLib|UefiCpuPkg/Library/VmgExitLibNull/VmgExitLibNull.inf > - CrcLib|WhitleyOpenBoardPkg/Library/BaseCrcLib/BaseCrcLib.inf > > PlatformSpecificAcpiTableLib|WhitleyOpenBoardPkg/Library/PlatformSpecificAcpiTableLibNull/PlatformSpecificAcpiTableLibNull.inf > > BuildAcpiTablesLib|WhitleyOpenBoardPkg/Library/BuildAcpiTablesLib/DxeBuildAcpiTablesLib.inf > > AcpiPlatformTableLib|WhitleyOpenBoardPkg/Library/AcpiPlatformTableLib/AcpiPlatformLib.inf > -- > 2.35.1 > > -- Pedro Falcato --00000000000080451905db3d8d75 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi,

Just wanted to note that= this patch set is not mergeable/testable right now. I'll submit a corr= ect v2 as soon as possible.

Thanks for the underst= anding,
Pedro

On Sun, Mar 27, 2022 at 12:59 AM Pedro Fal= cato <pedro.falcato@gmail.com= > wrote:
= BZ: https://bugzilla.tianocore.org/show_bug.c= gi?id=3D3871

Delete BaseCrcLib and slightly adjust each CalculateCrc16 call
for the BaseLib CalculateCrc16() interface, as part of an effort to
unify CRC16 implementations.

Cc: Isaac Oram <isaac.w.oram@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Chasel Chiu <chasel.chiu@intel.com>

Signed-off-by: Pedro Falcato <pedro.falcato@gmail.com>
---
=C2=A0.../Include/Library/CrcLib.h=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 | 42 -----------
=C2=A0.../AcpiPlatformLibBdat.c=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0| 46 ++++--------
=C2=A0.../Library/BaseCrcLib/BaseCrcLib.c=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0| 71 -------------------
=C2=A0.../Library/BaseCrcLib/BaseCrcLib.inf=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0| 23 ------
=C2=A0.../Intel/WhitleyOpenBoardPkg/PlatformPkg.dsc |=C2=A0 1 -
=C2=A05 files changed, 12 insertions(+), 171 deletions(-)
=C2=A0delete mode 100644 Platform/Intel/WhitleyOpenBoardPkg/Include/Library= /CrcLib.h
=C2=A0delete mode 100644 Platform/Intel/WhitleyOpenBoardPkg/Library/BaseCrc= Lib/BaseCrcLib.c
=C2=A0delete mode 100644 Platform/Intel/WhitleyOpenBoardPkg/Library/BaseCrc= Lib/BaseCrcLib.inf

diff --git a/Platform/Intel/WhitleyOpenBoardPkg/Include/Library/CrcLib.h b/= Platform/Intel/WhitleyOpenBoardPkg/Include/Library/CrcLib.h
deleted file mode 100644
index 7ca3b7cabb14..000000000000
--- a/Platform/Intel/WhitleyOpenBoardPkg/Include/Library/CrcLib.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/** @file
-=C2=A0 Interface header file for the CRC library class.
-
-=C2=A0 @copyright
-=C2=A0 Copyright 2016 - 2018 Intel Corporation. <BR>
-
-=C2=A0 SPDX-License-Identifier: BSD-2-Clause-Patent
-**/
-
-#ifndef _CRC_LIB_H_
-#define _CRC_LIB_H_
-
-#include <Uefi.h>
-
-/**
-=C2=A0 Calculate a 16-bit CRC.
-
-=C2=A0 The algorithm used is MSB-first form of the ITU-T Recommendation V.= 41, which
-=C2=A0 uses an initial value of 0x0000 and a polynomial of 0x1021. It is t= he same
-=C2=A0 algorithm used by XMODEM.
-
-=C2=A0 The output CRC location is not updated until the calculation is fin= ished, so
-=C2=A0 it is possible to pass a structure as the data, and the CRC field o= f the same
-=C2=A0 structure as the output location for the calculated CRC. The CRC fi= eld should
-=C2=A0 be set to zero before calling this function. Once the CRC field is = updated by
-=C2=A0 this function, running it again over the structure produces a CRC o= f zero.
-
-=C2=A0 @param[in]=C2=A0 Data=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 A pointer to the target data.
-=C2=A0 @param[in]=C2=A0 DataSize=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 The tar= get data size.
-=C2=A0 @param[out] CrcOut=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 A point= er to the return location of the CRC.
-
-=C2=A0 @retval EFI_SUCCESS=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0The CRC= was calculated successfully.
-=C2=A0 @retval EFI_INVALID_PARAMETER A null pointer was provided.
-**/
-EFI_STATUS
-CalculateCrc16 (
-=C2=A0 IN=C2=A0 VOID=C2=A0 =C2=A0 *Data,
-=C2=A0 IN=C2=A0 UINTN=C2=A0 =C2=A0DataSize,
-=C2=A0 OUT UINT16=C2=A0 *CrcOut
-=C2=A0 );
-
-#endif=C2=A0 // _CRC_LIB_H_
diff --git a/Platform/Intel/WhitleyOpenBoardPkg/Library/AcpiPlatformTableLi= b/AcpiPlatformLibBdat.c b/Platform/Intel/WhitleyOpenBoardPkg/Library/AcpiPl= atformTableLib/AcpiPlatformLibBdat.c
index 09464b4a11d1..a1780ced39aa 100644
--- a/Platform/Intel/WhitleyOpenBoardPkg/Library/AcpiPlatformTableLib/AcpiP= latformLibBdat.c
+++ b/Platform/Intel/WhitleyOpenBoardPkg/Library/AcpiPlatformTableLib/AcpiP= latformLibBdat.c
@@ -11,9 +11,9 @@
=C2=A0// Statements that include other files
=C2=A0//
=C2=A0#include "AcpiPlatformLibLocal.h"
-#include <Library/CrcLib.h>
=C2=A0#include <BdatSchema.h>
=C2=A0#include <Guid/MemoryMapData.h>
+#include <Library/BaseLib.h>
=C2=A0#include <Library/CompressedVariableLib.h>
=C2=A0#include <Protocol/DynamicSiLibraryProtocol2.h>
=C2=A0#include <Protocol/DynamicSiLibraryProtocol2.h>
@@ -287,15 +287,12 @@ CreateBdatHeader (
=C2=A0 =C2=A0// CRC16 value of the BDAT_STRUCTURE
=C2=A0 =C2=A0//
=C2=A0 =C2=A0(*BdatHeaderStructPtr)->BdatHeader.Crc16 =3D 0;
-=C2=A0 Status =3D CalculateCrc16 (
+=C2=A0 (*BdatHeaderStructPtr)->BdatHeader.Crc16 =3D CalculateCrc16 ( =C2=A0 =C2=A0 =C2=A0(VOID *)(*BdatHeaderStructPtr),
=C2=A0 =C2=A0 =C2=A0BdatSize,
-=C2=A0 =C2=A0 &(*BdatHeaderStructPtr)->BdatHeader.Crc16
+=C2=A0 =C2=A0 0
=C2=A0 =C2=A0);
-=C2=A0 ASSERT_EFI_ERROR (Status);
-=C2=A0 if (EFI_ERROR (Status)) {
-=C2=A0 =C2=A0 (*BdatHeaderStructPtr)->BdatHeader.Crc16 =3D 0xFFFF;
-=C2=A0 }
+
=C2=A0 =C2=A0(*BdatHeaderStructPtr)->BdatSchemas.SchemaListLength =3D Nu= mberOfSchema;
=C2=A0 =C2=A0(*BdatHeaderStructPtr)->BdatSchemas.Reserved =3D 0;
=C2=A0 =C2=A0(*BdatHeaderStructPtr)->BdatSchemas.Reserved1 =3D 0;
@@ -1088,15 +1085,11 @@ SaveBssaResultsToBdat (
=C2=A0 =C2=A0 =C2=A0 =C2=A0// CRC16 value of the BDAT_SCHEMA_HEADER_STRUCTU= RE
=C2=A0 =C2=A0 =C2=A0 =C2=A0//
=C2=A0 =C2=A0 =C2=A0 =C2=A0BssaSchemaHeaderPtr->Crc16 =3D 0;
-=C2=A0 =C2=A0 =C2=A0 Status =3D CalculateCrc16 (
+=C2=A0 =C2=A0 =C2=A0 BssaSchemaHeaderPtr->Crc16 =3D CalculateCrc16 ( =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(VOID *) BssaSchemaHeaderPtr,
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0sizeof (BDAT_SCHEMA_HEADER_STRUCTURE), -=C2=A0 =C2=A0 =C2=A0 =C2=A0 &BssaSchemaHeaderPtr->Crc16
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 0
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0);
-=C2=A0 =C2=A0 =C2=A0 ASSERT_EFI_ERROR (Status);
-=C2=A0 =C2=A0 =C2=A0 if (EFI_ERROR (Status)) {
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 BssaSchemaHeaderPtr->Crc16 =3D 0xFFFF;
-=C2=A0 =C2=A0 =C2=A0 }

=C2=A0 =C2=A0 =C2=A0 =C2=A0if (RemainingHobSizeBssaSchema < CurrentHobSi= ze) {
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0DEBUG ((DEBUG_WARN, "Not enough spac= e to add complete BIOS SSA result\n"));
@@ -1217,17 +1210,12 @@ SaveEwlToBdat (
=C2=A0 =C2=A0// CRC16 value of the BDAT_SCHEMA_HEADER_STRUCTURE
=C2=A0 =C2=A0//
=C2=A0 =C2=A0EwlSchemaHeaderPtr->Crc16 =3D 0;
-=C2=A0 Status =3D CalculateCrc16 (
+=C2=A0 EwlSchemaHeaderPtr->Crc16 =3D CalculateCrc16 (
=C2=A0 =C2=A0 =C2=A0(VOID *)EwlSchemaHeaderPtr,
=C2=A0 =C2=A0 =C2=A0sizeof(BDAT_SCHEMA_HEADER_STRUCTURE),
-=C2=A0 =C2=A0 &EwlSchemaHeaderPtr->Crc16
+=C2=A0 =C2=A0 0
=C2=A0 =C2=A0);

-=C2=A0 ASSERT_EFI_ERROR (Status);
-=C2=A0 if (EFI_ERROR (Status)) {
-=C2=A0 =C2=A0 EwlSchemaHeaderPtr->Crc16 =3D 0xFFFF;
-=C2=A0 }
-
=C2=A0 =C2=A0GuidHob =3D GetFirstGuidHob (&EWLDataGuid);
=C2=A0 =C2=A0EwlPrivateData =3D GET_GUID_HOB_DATA (GuidHob);

@@ -1334,17 +1322,12 @@ SaveSpdToBdat (
=C2=A0 =C2=A0// CRC16 value of the BDAT_SCHEMA_HEADER_STRUCTURE
=C2=A0 =C2=A0//
=C2=A0 =C2=A0SpdSchemaHeaderPtr->Crc16 =3D 0;
-=C2=A0 Status =3D CalculateCrc16 (
+=C2=A0 SpdSchemaHeaderPtr->Crc16 =3D CalculateCrc16 (
=C2=A0 =C2=A0 =C2=A0(VOID *)SpdSchemaHeaderPtr,
=C2=A0 =C2=A0 =C2=A0sizeof(BDAT_SCHEMA_HEADER_STRUCTURE),
-=C2=A0 =C2=A0 &SpdSchemaHeaderPtr->Crc16
+=C2=A0 =C2=A0 0
=C2=A0 =C2=A0);

-=C2=A0 ASSERT_EFI_ERROR (Status);
-=C2=A0 if (EFI_ERROR (Status)) {
-=C2=A0 =C2=A0 SpdSchemaHeaderPtr->Crc16 =3D 0xFFFF;
-=C2=A0 }
-
=C2=A0 =C2=A0Address =3D Address + sizeof(BDAT_SCHEMA_HEADER_STRUCTURE); =C2=A0 =C2=A0*SchemaSpaceUsed =3D *SchemaSpaceUsed + sizeof(BDAT_SCHEMA_HEA= DER_STRUCTURE);

@@ -1483,17 +1466,12 @@ SaveTrainingDataToBdat (
=C2=A0 =C2=A0// CRC16 value of the BDAT_SCHEMA_HEADER_STRUCTURE
=C2=A0 =C2=A0//
=C2=A0 =C2=A0SchemaHeaderPtr->Crc16 =3D 0;
-=C2=A0 Status =3D CalculateCrc16 (
+=C2=A0 SchemaHeaderPtr->Crc16 =3D CalculateCrc16 (
=C2=A0 =C2=A0 =C2=A0(VOID *)SchemaHeaderPtr,
=C2=A0 =C2=A0 =C2=A0sizeof(BDAT_SCHEMA_HEADER_STRUCTURE),
-=C2=A0 =C2=A0 &SchemaHeaderPtr->Crc16
+=C2=A0 =C2=A0 0
=C2=A0 =C2=A0);

-=C2=A0 ASSERT_EFI_ERROR (Status);
-=C2=A0 if (EFI_ERROR (Status)) {
-=C2=A0 =C2=A0 SchemaHeaderPtr->Crc16 =3D 0xFFFF;
-=C2=A0 }
-
=C2=A0 =C2=A0GuidHob =3D GetFirstGuidHob (&TrainingDataGuid);

=C2=A0 =C2=A0ASSERT (GuidHob !=3D NULL);
diff --git a/Platform/Intel/WhitleyOpenBoardPkg/Library/BaseCrcLib/BaseCrcL= ib.c b/Platform/Intel/WhitleyOpenBoardPkg/Library/BaseCrcLib/BaseCrcLib.c deleted file mode 100644
index 3e8fa402add3..000000000000
--- a/Platform/Intel/WhitleyOpenBoardPkg/Library/BaseCrcLib/BaseCrcLib.c +++ /dev/null
@@ -1,71 +0,0 @@
-/** @file
-=C2=A0 Base implementation of the CRC library class.
-
-=C2=A0 @copyright
-=C2=A0 Copyright 2016 - 2018 Intel Corporation. <BR>
-
-=C2=A0 SPDX-License-Identifier: BSD-2-Clause-Patent
-**/
-
-#include <Base.h>
-#include <Library/CrcLib.h>
-
-/**
-=C2=A0 Calculate a 16-bit CRC.
-
-=C2=A0 The algorithm used is MSB-first form of the ITU-T Recommendation V.= 41, which
-=C2=A0 uses an initial value of 0x0000 and a polynomial of 0x1021. It is t= he same
-=C2=A0 algorithm used by XMODEM.
-
-=C2=A0 The output CRC location is not updated until the calculation is fin= ished, so
-=C2=A0 it is possible to pass a structure as the data, and the CRC field o= f the same
-=C2=A0 structure as the output location for the calculated CRC. The CRC fi= eld should
-=C2=A0 be set to zero before calling this function. Once the CRC field is = updated by
-=C2=A0 this function, running it again over the structure produces a CRC o= f zero.
-
-=C2=A0 @param[in]=C2=A0 Data=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 A pointer to the target data.
-=C2=A0 @param[in]=C2=A0 DataSize=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 The tar= get data size.
-=C2=A0 @param[out] CrcOut=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 A point= er to the return location of the CRC.
-
-=C2=A0 @retval EFI_SUCCESS=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0The CRC= was calculated successfully.
-=C2=A0 @retval EFI_INVALID_PARAMETER A null pointer was provided.
-**/
-EFI_STATUS
-CalculateCrc16 (
-=C2=A0 IN=C2=A0 VOID=C2=A0 =C2=A0 *Data,
-=C2=A0 IN=C2=A0 UINTN=C2=A0 =C2=A0DataSize,
-=C2=A0 OUT UINT16=C2=A0 *CrcOut
-=C2=A0 )
-{
-=C2=A0 UINT32=C2=A0 Crc;
-=C2=A0 UINTN=C2=A0 =C2=A0Index;
-=C2=A0 UINT8=C2=A0 =C2=A0*Byte;
-
-=C2=A0 if (Data =3D=3D NULL || CrcOut =3D=3D NULL) {
-=C2=A0 =C2=A0 return EFI_INVALID_PARAMETER;
-=C2=A0 }
-
-=C2=A0 Crc =3D 0x0000;
-=C2=A0 for (Byte =3D (UINT8 *) Data; Byte < (UINT8 *) Data + DataSize; = Byte++) {
-=C2=A0 =C2=A0 //
-=C2=A0 =C2=A0 // XOR the next data byte into the CRC.
-=C2=A0 =C2=A0 //
-=C2=A0 =C2=A0 Crc ^=3D (UINT16) *Byte << 8;
-=C2=A0 =C2=A0 //
-=C2=A0 =C2=A0 // Shift out eight bits, feeding back based on the polynomia= l whenever a
-=C2=A0 =C2=A0 // 1 is shifted out of bit 15.
-=C2=A0 =C2=A0 //
-=C2=A0 =C2=A0 for (Index =3D 0; Index < 8; Index++) {
-=C2=A0 =C2=A0 =C2=A0 Crc <<=3D 1;
-=C2=A0 =C2=A0 =C2=A0 if (Crc & BIT16) {
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 Crc ^=3D 0x1021;
-=C2=A0 =C2=A0 =C2=A0 }
-=C2=A0 =C2=A0 }
-=C2=A0 }
-
-=C2=A0 //
-=C2=A0 // Mask and return the 16-bit CRC.
-=C2=A0 //
-=C2=A0 *CrcOut =3D (UINT16) (Crc & 0xFFFF);
-=C2=A0 return EFI_SUCCESS;
-}
diff --git a/Platform/Intel/WhitleyOpenBoardPkg/Library/BaseCrcLib/BaseCrcL= ib.inf b/Platform/Intel/WhitleyOpenBoardPkg/Library/BaseCrcLib/BaseCrcLib.i= nf
deleted file mode 100644
index 6b404e125959..000000000000
--- a/Platform/Intel/WhitleyOpenBoardPkg/Library/BaseCrcLib/BaseCrcLib.inf<= br> +++ /dev/null
@@ -1,23 +0,0 @@
-## @file
-# Base implementation of the CRC library class.
-#
-# @copyright
-# Copyright 2016 Intel Corporation. <BR>
-#
-# SPDX-License-Identifier: BSD-2-Clause-Patent
-##
-
-[Defines]
-=C2=A0 INF_VERSION=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0=3D 0x00010019
-=C2=A0 BASE_NAME=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0=3D BaseCrcLib
-=C2=A0 FILE_GUID=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0=3D F3BE9A28-78A2-4B02-AB26-D27EE85D9256
-=C2=A0 MODULE_TYPE=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0=3D BASE
-=C2=A0 VERSION_STRING=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =3D 1.0
-=C2=A0 LIBRARY_CLASS=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0=3D CrcLib
-
-[Sources]
-=C2=A0 BaseCrcLib.c
-
-[Packages]
-=C2=A0 MdePkg/MdePkg.dec
-=C2=A0 WhitleyOpenBoardPkg/PlatformPkg.dec
diff --git a/Platform/Intel/WhitleyOpenBoardPkg/PlatformPkg.dsc b/Platform/= Intel/WhitleyOpenBoardPkg/PlatformPkg.dsc
index 8c4b9cf6ce28..5b9b08feca46 100644
--- a/Platform/Intel/WhitleyOpenBoardPkg/PlatformPkg.dsc
+++ b/Platform/Intel/WhitleyOpenBoardPkg/PlatformPkg.dsc
@@ -618,7 +618,6 @@
=C2=A0 =C2=A0PciSegmentInfoLib|$(PLATFORM_PKG)/Pci/Library/PciSegmentInfoLi= bSimple/PciSegmentInfoLibSimple.inf
=C2=A0 =C2=A0PlatformOpromPolicyLib|$(RP_PKG)/Library/PlatformOpromPolicyLi= bNull/PlatformOpromPolicyLibNull.inf
=C2=A0 =C2=A0VmgExitLib|UefiCpuPkg/Library/VmgExitLibNull/VmgExitLibNull.in= f
-=C2=A0 CrcLib|WhitleyOpenBoardPkg/Library/BaseCrcLib/BaseCrcLib.inf
=C2=A0 =C2=A0PlatformSpecificAcpiTableLib|WhitleyOpenBoardPkg/Library/Platf= ormSpecificAcpiTableLibNull/PlatformSpecificAcpiTableLibNull.inf
=C2=A0 =C2=A0BuildAcpiTablesLib|WhitleyOpenBoardPkg/Library/BuildAcpiTables= Lib/DxeBuildAcpiTablesLib.inf
=C2=A0 =C2=A0AcpiPlatformTableLib|WhitleyOpenBoardPkg/Library/AcpiPlatformT= ableLib/AcpiPlatformLib.inf
--
2.35.1



--
Pedro Falcato
--00000000000080451905db3d8d75--