From nobody Sat May 18 21:26:57 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+81403+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+81403+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1633316898; cv=none; d=zohomail.com; s=zohoarc; b=F4pV6Q4BmbZtf+SaH1ecKsmnQY+tXBPEoWM+/BTeR1kjth44QofBBByB2dVsaa3yEl9ue56Bt+4aJ+j9tDzgVAtK3XLxnF+SKM4VNmFqe9bYO9gE5lMc/qJRXnBUwnNtX6tJzYbZnetczNFERopeeWtT8ylxlIzwbnf3vvCReoc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1633316898; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=chft/rXnlHtlr8AHjuhIs6jXg14yjNnDNNHtX+Y0Dks=; b=S2BKD3lGYKc/FxHuY6KZUTCEPaNRXPkn653KO5hS5ocKPMrlBl+0S9S0XcfClW0eEMypQ6RD5a1C4OQNp+05GPyToaPBALtuaPhIiCsmmPdXjooC0rCz3ehWUg6iiYBIosO6UGrDF6mlZNCp1vNAAhhXbKEDyFexqpm7j546mrM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+81403+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1633316898325847.1402271002574; Sun, 3 Oct 2021 20:08:18 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id 8d4OYY1788612xDl1Vp2iP6t; Sun, 03 Oct 2021 20:08:17 -0700 X-Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mx.groups.io with SMTP id smtpd.web08.4343.1633316897238349669 for ; Sun, 03 Oct 2021 20:08:17 -0700 X-IronPort-AV: E=McAfee;i="6200,9189,10126"; a="248523995" X-IronPort-AV: E=Sophos;i="5.85,344,1624345200"; d="scan'208";a="248523995" X-Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Oct 2021 20:08:00 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,344,1624345200"; d="scan'208";a="710824531" X-Received: from ikuox-desk1.gar.corp.intel.com ([10.227.107.18]) by fmsmga006.fm.intel.com with ESMTP; 03 Oct 2021 20:07:58 -0700 From: "IanX Kuo" To: devel@edk2.groups.io Cc: amy.chan@intel.com, ray.ni@intel.com, IanX Kuo , Michael D Kinney , Liming Gao , Zhiguang Liu Subject: [edk2-devel] [PATCH v3 1/4] MdePkg/BaseLib: Add QuickSort function on BaseLib Date: Mon, 4 Oct 2021 11:07:46 +0800 Message-Id: <20211004030749.1813-2-ianx.kuo@intel.com> In-Reply-To: <20211004030749.1813-1-ianx.kuo@intel.com> References: <20211004030749.1813-1-ianx.kuo@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: 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,ianx.kuo@intel.com X-Gm-Message-State: xLTS6k0CXKtctW3Y6wzZAbWEx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1633316897; bh=haJWyAduf6RpIVp+3kf1J3kE0iuTEbpAE7unznG22mY=; h=Cc:Date:From:Reply-To:Subject:To; b=lq8YIBcC3MgVV3+2nq6aF0vIkE4QD2vNqUhznXe29huawszvOK3ZbyzpuIV4KZpqkp1 VLns3avW06Cvrlx1DChdjIlTrBnsNqyuw26zPLL63tfTkudinArhRoiVqLo8YIb+frZZO IQz5LgxewwFkIfocmroADklrvf4De05SI3Y= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1633316898993100002 Content-Type: text/plain; charset="utf-8" From: IanX Kuo REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D3675 Add QuickSort function into BaseLib Cc: Ray Ni Cc: Michael D Kinney Cc: Liming Gao Cc: Zhiguang Liu Signed-off-by: IanX Kuo --- MdePkg/Include/Library/BaseLib.h | 49 ++++++++ MdePkg/Library/BaseLib/BaseLib.inf | 1 + MdePkg/Library/BaseLib/QuickSort.c | 117 ++++++++++++++++++ .../Library/BaseLib/UnitTestHostBaseLib.inf | 3 +- 4 files changed, 169 insertions(+), 1 deletion(-) create mode 100644 MdePkg/Library/BaseLib/QuickSort.c diff --git a/MdePkg/Include/Library/BaseLib.h b/MdePkg/Include/Library/Base= Lib.h index 2452c1d92e..2423169be4 100644 --- a/MdePkg/Include/Library/BaseLib.h +++ b/MdePkg/Include/Library/BaseLib.h @@ -13,6 +13,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent =20 #ifndef __BASE_LIB__ #define __BASE_LIB__ +#include =20 // // Definitions for architecture-specific types @@ -2856,6 +2857,54 @@ RemoveEntryList ( // // Math Services // +/** + Prototype for comparison function for any two element types. + + @param[in] Buffer1 The pointer to first buffer. + @param[in] Buffer2 The pointer to second buffer. + + @retval 0 Buffer1 equal to Buffer2. + @return <0 Buffer1 is less than Buffer2. + @return >0 Buffer1 is greater than Buffer2. +**/ +typedef +INTN +(EFIAPI *BASE_SORT_COMPARE)( + IN CONST VOID *Buffer1, + IN CONST VOID *Buffer2 + ); + +/** + Worker function for QuickSorting. This function is identical to perform= QuickSort, + except that is uses the pre-allocated buffer so the in place sorting doe= s not need to + allocate and free buffers constantly. + + Each element must be equal sized. + + if Count is < 2 then perform no action. + if Size is < 1 then perform no action. + + @param[in, out] BufferToSort on call a Buffer of (possibly sorted) ele= ments + on return a buffer of sorted elements + @param[in] Count the number of elements in the buffer to s= ort + @param[in] ElementSize Size of an element in bytes + @param[in] CompareFunction The function to call to perform the compa= rison + of any 2 elements + @param [in] BufferOneElement Caller provided buffer whose size equals = to ElementSize. + It's used by QuickSort() for swapping in = sorting. + + @retval EFI_SUCCESS The quick sort is finished. + @retval EFI_INVALID_PARAMETER When BufferToSort is NULL, CompareFunctio= n is NULL or Buffer is NULL +**/ +EFI_STATUS +EFIAPI +QuickSort ( + IN OUT VOID *BufferToSort, + IN CONST UINTN Count, + IN CONST UINTN ElementSize, + IN BASE_SORT_COMPARE CompareFunction, + IN VOID *BufferOneElement + ); =20 /** Shifts a 64-bit integer left between 0 and 63 bits. The low bits are fil= led diff --git a/MdePkg/Library/BaseLib/BaseLib.inf b/MdePkg/Library/BaseLib/Ba= seLib.inf index 6efa5315b6..cebda3b210 100644 --- a/MdePkg/Library/BaseLib/BaseLib.inf +++ b/MdePkg/Library/BaseLib/BaseLib.inf @@ -32,6 +32,7 @@ SwapBytes16.c LongJump.c SetJump.c + QuickSort.c RShiftU64.c RRotU64.c RRotU32.c diff --git a/MdePkg/Library/BaseLib/QuickSort.c b/MdePkg/Library/BaseLib/Qu= ickSort.c new file mode 100644 index 0000000000..f95af9e238 --- /dev/null +++ b/MdePkg/Library/BaseLib/QuickSort.c @@ -0,0 +1,117 @@ +/** @file + Math worker functions. + + Copyright (c) 2021, Intel Corporation. All rights reserved.
+ SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#include "BaseLibInternals.h" +#include + +/** + Worker function for QuickSorting. This function is identical to perform= QuickSort, + except that is uses the pre-allocated buffer so the in place sorting doe= s not need to + allocate and free buffers constantly. + + Each element must be equal sized. + + if Count is < 2 then perform no action. + if Size is < 1 then perform no action. + + @param[in, out] BufferToSort on call a Buffer of (possibly sorted) ele= ments + on return a buffer of sorted elements + @param[in] Count the number of elements in the buffer to s= ort + @param[in] ElementSize Size of an element in bytes + @param[in] CompareFunction The function to call to perform the compa= rison + of any 2 elements + @param [in] BufferOneElement Caller provided buffer whose size equals = to ElementSize. + It's used by QuickSort() for swapping in = sorting. + + @retval EFI_SUCCESS The quick sort is finished. + @retval EFI_INVALID_PARAMETER When BufferToSort is NULL, CompareFunctio= n is NULL, or BufferOneElement is NULL + +**/ +EFI_STATUS +EFIAPI +QuickSort ( + IN OUT VOID *BufferToSort, + IN CONST UINTN Count, + IN CONST UINTN ElementSize, + IN BASE_SORT_COMPARE CompareFunction, + IN VOID *BufferOneElement + ) +{ + VOID *Pivot; + UINTN LoopCount; + UINTN NextSwapLocation; + + if ((BufferToSort =3D=3D NULL) || (CompareFunction =3D=3D NULL) || (Buff= erOneElement =3D=3D NULL)) { + return EFI_INVALID_PARAMETER; + } + + if (Count < 2 || ElementSize < 1) { + return EFI_SUCCESS; + } + + NextSwapLocation =3D 0; + + // + // pick a pivot (we choose last element) + // + Pivot =3D ((UINT8*) BufferToSort + ((Count - 1) * ElementSize)); + + // + // Now get the pivot such that all on "left" are below it + // and everything "right" are above it + // + for (LoopCount =3D 0; LoopCount < Count -1; LoopCount++) { + // + // if the element is less than the pivot + // + if (CompareFunction ((VOID*) ((UINT8*) BufferToSort + ((LoopCount) * E= lementSize)), Pivot) <=3D 0){ + // + // swap + // + CopyMem (BufferOneElement, (UINT8*) BufferToSort + (NextSwapLocation= * ElementSize), ElementSize); + CopyMem ((UINT8*) BufferToSort + (NextSwapLocation * ElementSize), (= UINT8*) BufferToSort + ((LoopCount) * ElementSize), ElementSize); + CopyMem ((UINT8*) BufferToSort + ((LoopCount)*ElementSize), BufferOn= eElement, ElementSize); + + // + // increment NextSwapLocation + // + NextSwapLocation++; + } + } + // + // swap pivot to it's final position (NextSwapLocation) + // + CopyMem (BufferOneElement, Pivot, ElementSize); + CopyMem (Pivot, (UINT8*) BufferToSort + (NextSwapLocation * ElementSize)= , ElementSize); + CopyMem ((UINT8*) BufferToSort + (NextSwapLocation * ElementSize), Buffe= rOneElement, ElementSize); + + // + // Now recurse on 2 partial lists. neither of these will have the 'pivo= t' element + // IE list is sorted left half, pivot element, sorted right half... + // + if (NextSwapLocation >=3D 2) { + QuickSort ( + BufferToSort, + NextSwapLocation, + ElementSize, + CompareFunction, + BufferOneElement + ); + } + + if ((Count - NextSwapLocation - 1) >=3D 2) { + QuickSort ( + (UINT8 *)BufferToSort + (NextSwapLocation + 1) * ElementSize, + Count - NextSwapLocation - 1, + ElementSize, + CompareFunction, + BufferOneElement + ); + } + return EFI_SUCCESS; +} diff --git a/MdePkg/Library/BaseLib/UnitTestHostBaseLib.inf b/MdePkg/Librar= y/BaseLib/UnitTestHostBaseLib.inf index eae1a7158d..d09bd12bef 100644 --- a/MdePkg/Library/BaseLib/UnitTestHostBaseLib.inf +++ b/MdePkg/Library/BaseLib/UnitTestHostBaseLib.inf @@ -1,7 +1,7 @@ ## @file # Base Library implementation for use with host based unit tests. # -# Copyright (c) 2007 - 2020, Intel Corporation. All rights reserved.
+# Copyright (c) 2007 - 2021, Intel Corporation. All rights reserved.
# Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
# Portions copyright (c) 2011 - 2013, ARM Ltd. All rights reserved.
# Copyright (c) 2020, Hewlett Packard Enterprise Development LP. All righ= ts reserved.
@@ -33,6 +33,7 @@ SwapBytes16.c LongJump.c SetJump.c + QuickSort.c RShiftU64.c RRotU64.c RRotU32.c --=20 2.30.0.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 (#81403): https://edk2.groups.io/g/devel/message/81403 Mute This Topic: https://groups.io/mt/86057879/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Sat May 18 21:26:57 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+81406+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+81406+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1633316900; cv=none; d=zohomail.com; s=zohoarc; b=m/x8Tz8Y5Z8XTJa30o9uMLWAYesjXZcmj+poeWeaabFkM6XQvpsCC28b27a24tfAZtxz0Fu36Ch2Gbw7mo2whROkU5oEMeWaGx9UjXmPEqFmbjc/i8/FJQChzZkM+I2LuwJBcd6GHAlj1g2fHxI5smHYV/3Rnp2e+3kFCOJ6EY4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1633316900; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=gDyIn1o4XKolFYSI4IGCA3adghF7TdH2Nfg8t/6mTA4=; b=P8xzkmfjsm6f5LxfelZqgQosUxH93U6CfBL1ocqLPdKPp0jjCUbbnhsbmrE0bstyBLlgVCDx9tbI8XN6hRUJay3Kvrl0UWGsGIquEn0BJK2e3vWaiqkKg3YTPIXINCjotNiGnQ+PA5lyGosK5fSGRHY6y88DspxAFkNfOtVVWwk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+81406+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1633316900329457.45997143371767; Sun, 3 Oct 2021 20:08:20 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id Kn3CYY1788612xO68pu6xJ2n; Sun, 03 Oct 2021 20:08:20 -0700 X-Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mx.groups.io with SMTP id smtpd.web11.4467.1633316897949394936 for ; Sun, 03 Oct 2021 20:08:18 -0700 X-IronPort-AV: E=McAfee;i="6200,9189,10126"; a="248524004" X-IronPort-AV: E=Sophos;i="5.85,344,1624345200"; d="scan'208";a="248524004" X-Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Oct 2021 20:08:01 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,344,1624345200"; d="scan'208";a="710824554" X-Received: from ikuox-desk1.gar.corp.intel.com ([10.227.107.18]) by fmsmga006.fm.intel.com with ESMTP; 03 Oct 2021 20:08:00 -0700 From: "IanX Kuo" To: devel@edk2.groups.io Cc: amy.chan@intel.com, ray.ni@intel.com, IanX Kuo , Jian J Wang , Liming Gao Subject: [edk2-devel] [PATCH v3 2/4] MdeModulePkg/SortLib: Add QuickSort function on BaseLib Date: Mon, 4 Oct 2021 11:07:47 +0800 Message-Id: <20211004030749.1813-3-ianx.kuo@intel.com> In-Reply-To: <20211004030749.1813-1-ianx.kuo@intel.com> References: <20211004030749.1813-1-ianx.kuo@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: 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,ianx.kuo@intel.com X-Gm-Message-State: S9OQOmR1NWObbpn1OAxdehGDx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1633316900; bh=3lL16bDde132xigBNuZjAe9weakOx3R0rzfAoEgTKB4=; h=Cc:Date:From:Reply-To:Subject:To; b=XC8fMAF8CCY3oeiwNpGkBVQSMUOc7SYQAy7w16ZdhfR1YH1ASA+knGo6qw5mBwJUSmh jiOgPFhNKL6W+/70yFsuMDEuQcsDYlH0vpNzhkgo8ny1Ew/9FqszMfn3gqdsDbZ3owRK+ Gj0IGou/4HV7l5CaPmtw3CSL7m+xAfTW3Nc= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1633316900784100015 Content-Type: text/plain; charset="utf-8" From: IanX Kuo REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D3675 Use QuickSort instead of QuickSortWorker Cc: Ray Ni Cc: Jian J Wang Cc: Liming Gao Signed-off-by: IanX Kuo --- .../Library/BaseSortLib/BaseSortLib.c | 117 +---------------- .../Library/UefiSortLib/UefiSortLib.c | 118 +----------------- 2 files changed, 10 insertions(+), 225 deletions(-) diff --git a/MdeModulePkg/Library/BaseSortLib/BaseSortLib.c b/MdeModulePkg/= Library/BaseSortLib/BaseSortLib.c index a12c7bc0ec..b33339ac7c 100644 --- a/MdeModulePkg/Library/BaseSortLib/BaseSortLib.c +++ b/MdeModulePkg/Library/BaseSortLib/BaseSortLib.c @@ -1,7 +1,7 @@ /** @file Library used for sorting routines. =20 - Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.
+ Copyright (c) 2009 - 2021, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent =20 **/ @@ -13,114 +13,6 @@ #include #include =20 -/** - Worker function for QuickSorting. This function is identical to Perform= QuickSort, - except that is uses the pre-allocated buffer so the in place sorting doe= s not need to - allocate and free buffers constantly. - - Each element must be equal sized. - - if BufferToSort is NULL, then ASSERT. - if CompareFunction is NULL, then ASSERT. - if Buffer is NULL, then ASSERT. - - if Count is < 2 then perform no action. - if Size is < 1 then perform no action. - - @param[in, out] BufferToSort on call a Buffer of (possibly sorted) ele= ments - on return a buffer of sorted elements - @param[in] Count the number of elements in the buffer to s= ort - @param[in] ElementSize Size of an element in bytes - @param[in] CompareFunction The function to call to perform the compa= rison - of any 2 elements - @param[in] Buffer Buffer of size ElementSize for use in swa= pping -**/ -VOID -EFIAPI -QuickSortWorker ( - IN OUT VOID *BufferToSort, - IN CONST UINTN Count, - IN CONST UINTN ElementSize, - IN SORT_COMPARE CompareFunction, - IN VOID *Buffer - ) -{ - VOID *Pivot; - UINTN LoopCount; - UINTN NextSwapLocation; - - ASSERT(BufferToSort !=3D NULL); - ASSERT(CompareFunction !=3D NULL); - ASSERT(Buffer !=3D NULL); - - if ( Count < 2 - || ElementSize < 1 - ){ - return; - } - - NextSwapLocation =3D 0; - - // - // pick a pivot (we choose last element) - // - Pivot =3D ((UINT8*)BufferToSort+((Count-1)*ElementSize)); - - // - // Now get the pivot such that all on "left" are below it - // and everything "right" are above it - // - for ( LoopCount =3D 0 - ; LoopCount < Count -1 - ; LoopCount++ - ){ - // - // if the element is less than the pivot - // - if (CompareFunction((VOID*)((UINT8*)BufferToSort+((LoopCount)*ElementS= ize)),Pivot) <=3D 0){ - // - // swap - // - CopyMem (Buffer, (UINT8*)BufferToSort+(NextSwapLocation*ElementSize)= , ElementSize); - CopyMem ((UINT8*)BufferToSort+(NextSwapLocation*ElementSize), (UINT8= *)BufferToSort+((LoopCount)*ElementSize), ElementSize); - CopyMem ((UINT8*)BufferToSort+((LoopCount)*ElementSize), Buffer, Ele= mentSize); - - // - // increment NextSwapLocation - // - NextSwapLocation++; - } - } - // - // swap pivot to it's final position (NextSwapLocaiton) - // - CopyMem (Buffer, Pivot, ElementSize); - CopyMem (Pivot, (UINT8*)BufferToSort+(NextSwapLocation*ElementSize), Ele= mentSize); - CopyMem ((UINT8*)BufferToSort+(NextSwapLocation*ElementSize), Buffer, El= ementSize); - - // - // Now recurse on 2 paritial lists. neither of these will have the 'piv= ot' element - // IE list is sorted left half, pivot element, sorted right half... - // - if (NextSwapLocation >=3D 2) { - QuickSortWorker( - BufferToSort, - NextSwapLocation, - ElementSize, - CompareFunction, - Buffer); - } - - if ((Count - NextSwapLocation - 1) >=3D 2) { - QuickSortWorker( - (UINT8 *)BufferToSort + (NextSwapLocation+1) * ElementSize, - Count - NextSwapLocation - 1, - ElementSize, - CompareFunction, - Buffer); - } - return; -} /** Function to perform a Quick Sort alogrithm on a buffer of comparable ele= ments. =20 @@ -156,12 +48,13 @@ PerformQuickSort ( Buffer =3D AllocateZeroPool(ElementSize); ASSERT(Buffer !=3D NULL); =20 - QuickSortWorker( + QuickSort ( BufferToSort, Count, ElementSize, - CompareFunction, - Buffer); + (SORT_COMPARE) CompareFunction, + Buffer + ); =20 FreePool(Buffer); return; diff --git a/MdeModulePkg/Library/UefiSortLib/UefiSortLib.c b/MdeModulePkg/= Library/UefiSortLib/UefiSortLib.c index 46dc443638..151a5a9ac3 100644 --- a/MdeModulePkg/Library/UefiSortLib/UefiSortLib.c +++ b/MdeModulePkg/Library/UefiSortLib/UefiSortLib.c @@ -1,7 +1,7 @@ /** @file Library used for sorting routines. =20 - Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.
+ Copyright (c) 2009 - 2021, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent =20 **/ @@ -29,115 +29,6 @@ STATIC EFI_UNICODE_COLLATION_PROTOCOL *mUnicodeCollat= ion =3D NULL; } \ } =20 -/** - Worker function for QuickSorting. This function is identical to Perform= QuickSort, - except that is uses the pre-allocated buffer so the in place sorting doe= s not need to - allocate and free buffers constantly. - - Each element must be equal sized. - - if BufferToSort is NULL, then ASSERT. - if CompareFunction is NULL, then ASSERT. - if Buffer is NULL, then ASSERT. - - if Count is < 2 then perform no action. - if Size is < 1 then perform no action. - - @param[in, out] BufferToSort on call a Buffer of (possibly sorted) ele= ments - on return a buffer of sorted elements - @param[in] Count the number of elements in the buffer to s= ort - @param[in] ElementSize Size of an element in bytes - @param[in] CompareFunction The function to call to perform the compa= rison - of any 2 elements - @param[in] Buffer Buffer of size ElementSize for use in swa= pping -**/ -VOID -EFIAPI -QuickSortWorker ( - IN OUT VOID *BufferToSort, - IN CONST UINTN Count, - IN CONST UINTN ElementSize, - IN SORT_COMPARE CompareFunction, - IN VOID *Buffer - ) -{ - VOID *Pivot; - UINTN LoopCount; - UINTN NextSwapLocation; - - ASSERT(BufferToSort !=3D NULL); - ASSERT(CompareFunction !=3D NULL); - ASSERT(Buffer !=3D NULL); - - if ( Count < 2 - || ElementSize < 1 - ){ - return; - } - - NextSwapLocation =3D 0; - - // - // pick a pivot (we choose last element) - // - Pivot =3D ((UINT8*)BufferToSort+((Count-1)*ElementSize)); - - // - // Now get the pivot such that all on "left" are below it - // and everything "right" are above it - // - for ( LoopCount =3D 0 - ; LoopCount < Count -1 - ; LoopCount++ - ){ - // - // if the element is less than the pivot - // - if (CompareFunction((VOID*)((UINT8*)BufferToSort+((LoopCount)*ElementS= ize)),Pivot) <=3D 0){ - // - // swap - // - CopyMem (Buffer, (UINT8*)BufferToSort+(NextSwapLocation*ElementSize)= , ElementSize); - CopyMem ((UINT8*)BufferToSort+(NextSwapLocation*ElementSize), (UINT8= *)BufferToSort+((LoopCount)*ElementSize), ElementSize); - CopyMem ((UINT8*)BufferToSort+((LoopCount)*ElementSize), Buffer, Ele= mentSize); - - // - // increment NextSwapLocation - // - NextSwapLocation++; - } - } - // - // swap pivot to it's final position (NextSwapLocaiton) - // - CopyMem (Buffer, Pivot, ElementSize); - CopyMem (Pivot, (UINT8*)BufferToSort+(NextSwapLocation*ElementSize), Ele= mentSize); - CopyMem ((UINT8*)BufferToSort+(NextSwapLocation*ElementSize), Buffer, El= ementSize); - - // - // Now recurse on 2 paritial lists. neither of these will have the 'piv= ot' element - // IE list is sorted left half, pivot element, sorted right half... - // - if (NextSwapLocation >=3D 2) { - QuickSortWorker( - BufferToSort, - NextSwapLocation, - ElementSize, - CompareFunction, - Buffer); - } - - if ((Count - NextSwapLocation - 1) >=3D 2) { - QuickSortWorker( - (UINT8 *)BufferToSort + (NextSwapLocation+1) * ElementSize, - Count - NextSwapLocation - 1, - ElementSize, - CompareFunction, - Buffer); - } - - return; -} /** Function to perform a Quick Sort alogrithm on a buffer of comparable ele= ments. =20 @@ -173,12 +64,13 @@ PerformQuickSort ( Buffer =3D AllocateZeroPool(ElementSize); ASSERT(Buffer !=3D NULL); =20 - QuickSortWorker( + QuickSort ( BufferToSort, Count, ElementSize, - CompareFunction, - Buffer); + (SORT_COMPARE) CompareFunction, + Buffer + ); =20 FreePool(Buffer); return; --=20 2.30.0.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 (#81406): https://edk2.groups.io/g/devel/message/81406 Mute This Topic: https://groups.io/mt/86057882/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Sat May 18 21:26:57 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+81405+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+81405+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1633316899; cv=none; d=zohomail.com; s=zohoarc; b=ZFWspRawKlIdOL6P2Bm/p6uu4W4y8QILJzZf2l4pVOrm2WJmIy8T38X0M3i0SRInpUWh+XLaB8n1lg7Nv9GoDm/Ri4fZvfwk8asGJskbENfx919nPyb/2hq68Z6kP9/SYYYt8tDJHiQc+GHNcBT2hQYlDplcBYeetY8dnzMF8os= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1633316899; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=wL3KuGT26YKmJL8n5OTxcQ8iTVc7hcHiVT4yn4zLkZQ=; b=kHAahzfhcymlazpAafeEsx6L4uRoXoczJbatDL7umqzSn+rzlAUc7/k7QE9kHq0SAOlWCA9GzmzWQjoazODMWblY1glkx2/iZLq7ndkVXxZLCSxVRZSLbWf55b0reE1Cm5pr5lRxvIW//+yZWDbR1gM/9DsUy9xS4/OuMeaQ4I8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+81405+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1633316899457871.3790513527329; Sun, 3 Oct 2021 20:08:19 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id cZ3aYY1788612x14kUx66Qdu; Sun, 03 Oct 2021 20:08:19 -0700 X-Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mx.groups.io with SMTP id smtpd.web08.4343.1633316897238349669 for ; Sun, 03 Oct 2021 20:08:18 -0700 X-IronPort-AV: E=McAfee;i="6200,9189,10126"; a="248524011" X-IronPort-AV: E=Sophos;i="5.85,344,1624345200"; d="scan'208";a="248524011" X-Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Oct 2021 20:08:03 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,344,1624345200"; d="scan'208";a="710824567" X-Received: from ikuox-desk1.gar.corp.intel.com ([10.227.107.18]) by fmsmga006.fm.intel.com with ESMTP; 03 Oct 2021 20:08:01 -0700 From: "IanX Kuo" To: devel@edk2.groups.io Cc: amy.chan@intel.com, ray.ni@intel.com, IanX Kuo , Jiewen Yao , Jian J Wang , Xiaoyu Lu , Guomin Jiang Subject: [edk2-devel] [PATCH v3 3/4] CryptoPkg/CryptLib: Add QuickSort function on BaseLib Date: Mon, 4 Oct 2021 11:07:48 +0800 Message-Id: <20211004030749.1813-4-ianx.kuo@intel.com> In-Reply-To: <20211004030749.1813-1-ianx.kuo@intel.com> References: <20211004030749.1813-1-ianx.kuo@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: 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,ianx.kuo@intel.com X-Gm-Message-State: 3j4c4vAZJrVPDzJiWefUZB3Ux1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1633316899; bh=7vK/xP7lZMhD7FG19AQThKIaw0rWANgIJf1dZmI8fm0=; h=Cc:Date:From:Reply-To:Subject:To; b=ec98vBmJ1o3veMfNsmQXcAM5fVT+cie0XS2cWvthp4UkCGJuJLf0z1OPu3PcPZ8shH9 HSMmTNZ8BFd0pXKsyD7cxsobIh755p4K34DcP8+D4ACgfng3KZUbfn+9DduF17YNI41se Z0MSEQUl4ZCM10u7andv/5CWSLKD0lVT9s8= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1633316900744100009 Content-Type: text/plain; charset="utf-8" From: IanX Kuo REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D3675 Use QuickSort instead of QuickSortWorker Cc: Ray Ni Cc: Jiewen Yao Cc: Jian J Wang Cc: Xiaoyu Lu Cc: Guomin Jiang Signed-off-by: IanX Kuo --- .../Library/BaseCryptLib/SysCall/CrtWrapper.c | 92 +------------------ 1 file changed, 2 insertions(+), 90 deletions(-) diff --git a/CryptoPkg/Library/BaseCryptLib/SysCall/CrtWrapper.c b/CryptoPk= g/Library/BaseCryptLib/SysCall/CrtWrapper.c index 42235ab96a..bdcd8ec278 100644 --- a/CryptoPkg/Library/BaseCryptLib/SysCall/CrtWrapper.c +++ b/CryptoPkg/Library/BaseCryptLib/SysCall/CrtWrapper.c @@ -2,7 +2,7 @@ C Run-Time Libraries (CRT) Wrapper Implementation for OpenSSL-based Cryptographic Library. =20 -Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved.
+Copyright (c) 2009 - 2021, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent =20 **/ @@ -22,91 +22,6 @@ int IN VOID *Buffer2 ); =20 -// -// Duplicated from EDKII BaseSortLib for qsort() wrapper -// -STATIC -VOID -QuickSortWorker ( - IN OUT VOID *BufferToSort, - IN CONST UINTN Count, - IN CONST UINTN ElementSize, - IN SORT_COMPARE CompareFunction, - IN VOID *Buffer - ) -{ - VOID *Pivot; - UINTN LoopCount; - UINTN NextSwapLocation; - - ASSERT(BufferToSort !=3D NULL); - ASSERT(CompareFunction !=3D NULL); - ASSERT(Buffer !=3D NULL); - - if (Count < 2 || ElementSize < 1) { - return; - } - - NextSwapLocation =3D 0; - - // - // Pick a pivot (we choose last element) - // - Pivot =3D ((UINT8 *)BufferToSort + ((Count - 1) * ElementSize)); - - // - // Now get the pivot such that all on "left" are below it - // and everything "right" are above it - // - for (LoopCount =3D 0; LoopCount < Count - 1; LoopCount++) - { - // - // If the element is less than the pivot - // - if (CompareFunction ((VOID *)((UINT8 *)BufferToSort + ((LoopCount) * E= lementSize)), Pivot) <=3D 0) { - // - // Swap - // - CopyMem (Buffer, (UINT8 *)BufferToSort + (NextSwapLocation * Element= Size), ElementSize); - CopyMem ((UINT8 *)BufferToSort + (NextSwapLocation * ElementSize), (= UINT8 *)BufferToSort + ((LoopCount) * ElementSize), ElementSize); - CopyMem ((UINT8 *)BufferToSort + ((LoopCount) * ElementSize), Buffer= , ElementSize); - - // - // Increment NextSwapLocation - // - NextSwapLocation++; - } - } - // - // Swap pivot to its final position (NextSwapLocation) - // - CopyMem (Buffer, Pivot, ElementSize); - CopyMem (Pivot, (UINT8 *)BufferToSort + (NextSwapLocation * ElementSize)= , ElementSize); - CopyMem ((UINT8 *)BufferToSort + (NextSwapLocation * ElementSize), Buffe= r, ElementSize); - - // - // Now recurse on 2 partial lists. Neither of these will have the 'pivo= t' element. - // IE list is sorted left half, pivot element, sorted right half... - // - QuickSortWorker ( - BufferToSort, - NextSwapLocation, - ElementSize, - CompareFunction, - Buffer - ); - - QuickSortWorker ( - (UINT8 *)BufferToSort + (NextSwapLocation + 1) * ElementSize, - Count - NextSwapLocation - 1, - ElementSize, - CompareFunction, - Buffer - ); - - return; -} - //--------------------------------------------------------- // Standard C Run-time Library Interface Wrapper //--------------------------------------------------------- @@ -337,10 +252,7 @@ void qsort (void *base, size_t num, size_t width, int = (*compare)(const void *, c Buffer =3D malloc (width); ASSERT (Buffer !=3D NULL); =20 - // - // Re-use PerformQuickSort() function Implementation in EDKII BaseSortLi= b. - // - QuickSortWorker (base, (UINTN)num, (UINTN)width, (SORT_COMPARE)compare, = Buffer); + QuickSort (base, (UINTN)num, (UINTN)width, (SORT_COMPARE)compare, Buffer= ); =20 free (Buffer); return; --=20 2.30.0.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 (#81405): https://edk2.groups.io/g/devel/message/81405 Mute This Topic: https://groups.io/mt/86057881/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Sat May 18 21:26:57 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+81407+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+81407+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1633316899; cv=none; d=zohomail.com; s=zohoarc; b=hvZDn9t1BNCeWDgHN58pE4tofqQg/WPIc5sD16o7YMRi7NJ4jbSuhu8iNIkHaeHhCDJqx2sxAHOumSqJUbNV+hrULr9SvzpK4c5OuFNHJZ7L/NTcunKoiS1JW/5sRh5dmcjYzi3oPbHno5klFMRb/9+Su0l39hivEHpUSPAAzWc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1633316899; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=j6c9Pnfnbos9kyQ9DBeeQrJOtoRVfDjC69J3pJaPBf8=; b=FEUstt4RGYXNpFLEct7y1DpXJNcCVQv7GiHpGsomRjIm6hFRxYLDjHAwutIMLJM5OtYY1dguGEaDN9+t7J7176WEEhViX11scLrTCuVrLokosjRhzOc/pNlhAo0RiBAyDbKHR341FE9PaApIdG34Zrz1BULOOt00ImTadSxV2qo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+81407+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1633316899901692.5970274009452; Sun, 3 Oct 2021 20:08:19 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id w2KWYY1788612x3ls5I1IFUS; Sun, 03 Oct 2021 20:08:19 -0700 X-Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mx.groups.io with SMTP id smtpd.web08.4343.1633316897238349669 for ; Sun, 03 Oct 2021 20:08:18 -0700 X-IronPort-AV: E=McAfee;i="6200,9189,10126"; a="248524016" X-IronPort-AV: E=Sophos;i="5.85,344,1624345200"; d="scan'208";a="248524016" X-Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Oct 2021 20:08:04 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,344,1624345200"; d="scan'208";a="710824583" X-Received: from ikuox-desk1.gar.corp.intel.com ([10.227.107.18]) by fmsmga006.fm.intel.com with ESMTP; 03 Oct 2021 20:08:03 -0700 From: "IanX Kuo" To: devel@edk2.groups.io Cc: amy.chan@intel.com, ray.ni@intel.com, IanX Kuo , Eric Dong , Rahul Kumar Subject: [edk2-devel] [PATCH v3 4/4] UefiCpuPkg/CpuCacheInfoLib: Add QuickSort function on BaseLib Date: Mon, 4 Oct 2021 11:07:49 +0800 Message-Id: <20211004030749.1813-5-ianx.kuo@intel.com> In-Reply-To: <20211004030749.1813-1-ianx.kuo@intel.com> References: <20211004030749.1813-1-ianx.kuo@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: 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,ianx.kuo@intel.com X-Gm-Message-State: cERnQqNGEXNkXQJsnUqQd0Dgx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1633316899; bh=VUtEKvnPsWYbpDvdY5hEy55Im4p9glC5wQqLUZXdP+Q=; h=Cc:Date:From:Reply-To:Subject:To; b=DtkDuXA9/Qow33GaoSIpU31k8Iva+d/I82dPLU2Qy/oeL/0YbblhDfS/kswZlpRaboi fwCZCwcMvwPeJSkJboWEzm0utcwlb4Mi/GY9wig+jl7QQgIPKODeIOjsjnPADry6v7pZl Q7SXiXEMRO6I9jHJ7WCThmAnC+F5xi7q0RU= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1633316900743100008 Content-Type: text/plain; charset="utf-8" From: IanX Kuo REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D3675 Remove MdeModulePkg dependency Cc: Eric Dong Cc: Ray Ni Cc: Rahul Kumar Signed-off-by: IanX Kuo --- UefiCpuPkg/Library/CpuCacheInfoLib/CpuCacheInfoLib.c | 5 ++++- UefiCpuPkg/Library/CpuCacheInfoLib/DxeCpuCacheInfoLib.inf | 2 -- UefiCpuPkg/Library/CpuCacheInfoLib/InternalCpuCacheInfoLib.h | 2 -- UefiCpuPkg/Library/CpuCacheInfoLib/PeiCpuCacheInfoLib.inf | 2 -- 4 files changed, 4 insertions(+), 7 deletions(-) diff --git a/UefiCpuPkg/Library/CpuCacheInfoLib/CpuCacheInfoLib.c b/UefiCpu= Pkg/Library/CpuCacheInfoLib/CpuCacheInfoLib.c index c0077d6770..b5ed05bd43 100644 --- a/UefiCpuPkg/Library/CpuCacheInfoLib/CpuCacheInfoLib.c +++ b/UefiCpuPkg/Library/CpuCacheInfoLib/CpuCacheInfoLib.c @@ -282,6 +282,7 @@ CpuCacheInfoCollectCpuCacheInfoData ( UINTN LocalCacheInfoCount; UINTN Index; UINTN NextIndex; + VOID *QuickSortBuffer; =20 // // Get number of Packages and Package ID. @@ -369,7 +370,9 @@ CpuCacheInfoCollectCpuCacheInfoData ( // // Sort LocalCacheInfo array by CPU package ID, core type, cache level= and cache type. // - PerformQuickSort (LocalCacheInfo, LocalCacheInfoCount, sizeof (*LocalC= acheInfo), (SORT_COMPARE) CpuCacheInfoCompare); + QuickSortBuffer =3D AllocateZeroPool (sizeof (*LocalCacheInfo)); + ASSERT (QuickSortBuffer !=3D NULL); + QuickSort (LocalCacheInfo, LocalCacheInfoCount, sizeof (*LocalCacheInf= o), (BASE_SORT_COMPARE) CpuCacheInfoCompare, QuickSortBuffer); CopyMem (CacheInfo, LocalCacheInfo, sizeof (*CacheInfo) * LocalCacheIn= foCount); DEBUG_CODE ( CpuCacheInfoPrintCpuCacheInfoTable (CacheInfo, LocalCacheInfoCount); diff --git a/UefiCpuPkg/Library/CpuCacheInfoLib/DxeCpuCacheInfoLib.inf b/Ue= fiCpuPkg/Library/CpuCacheInfoLib/DxeCpuCacheInfoLib.inf index c3d3f1e799..fdd79970f9 100644 --- a/UefiCpuPkg/Library/CpuCacheInfoLib/DxeCpuCacheInfoLib.inf +++ b/UefiCpuPkg/Library/CpuCacheInfoLib/DxeCpuCacheInfoLib.inf @@ -25,7 +25,6 @@ =20 [Packages] MdePkg/MdePkg.dec - MdeModulePkg/MdeModulePkg.dec UefiCpuPkg/UefiCpuPkg.dec =20 [LibraryClasses] @@ -34,7 +33,6 @@ BaseMemoryLib MemoryAllocationLib UefiBootServicesTableLib - SortLib =20 [Protocols] gEfiMpServiceProtocolGuid diff --git a/UefiCpuPkg/Library/CpuCacheInfoLib/InternalCpuCacheInfoLib.h b= /UefiCpuPkg/Library/CpuCacheInfoLib/InternalCpuCacheInfoLib.h index 26e1f46516..af60588e34 100644 --- a/UefiCpuPkg/Library/CpuCacheInfoLib/InternalCpuCacheInfoLib.h +++ b/UefiCpuPkg/Library/CpuCacheInfoLib/InternalCpuCacheInfoLib.h @@ -13,11 +13,9 @@ #include #include #include -#include #include #include #include -#include #include =20 typedef union { diff --git a/UefiCpuPkg/Library/CpuCacheInfoLib/PeiCpuCacheInfoLib.inf b/Ue= fiCpuPkg/Library/CpuCacheInfoLib/PeiCpuCacheInfoLib.inf index 0864497849..c643fc89be 100644 --- a/UefiCpuPkg/Library/CpuCacheInfoLib/PeiCpuCacheInfoLib.inf +++ b/UefiCpuPkg/Library/CpuCacheInfoLib/PeiCpuCacheInfoLib.inf @@ -25,7 +25,6 @@ =20 [Packages] MdePkg/MdePkg.dec - MdeModulePkg/MdeModulePkg.dec UefiCpuPkg/UefiCpuPkg.dec =20 [LibraryClasses] @@ -34,7 +33,6 @@ BaseMemoryLib MemoryAllocationLib PeiServicesTablePointerLib - SortLib =20 [Ppis] gEdkiiPeiMpServices2PpiGuid --=20 2.30.0.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 (#81407): https://edk2.groups.io/g/devel/message/81407 Mute This Topic: https://groups.io/mt/86057883/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-