From nobody Wed May 15 07:12:36 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+81414+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+81414+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1633323836; cv=none; d=zohomail.com; s=zohoarc; b=Y4D2lKQt1yxgJaXNigMM2ixkEsBtt4saLNDVz2w0T9yo7iEjx0s7O/TXkE5/bCAjnYKEtf1smykbqd/BVOU7EZWtArWsIPZW5hH9qucBxlNs4Qix1pFMSvBKlmjjYzWXgW9440MgpF9KY1WqeLH9xVgzlKGAHfphHwAL4ruRg5g= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1633323836; 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=wVq47tny1acvfxo8xYmBncSAYYt1azJv0BL20TlgYE0=; b=II+o1bU1Gwttzl7s6FCd9AMSvLbbCsseVeOT537ZCuxWxzYmDs6h18EuSjYBTB9VFLWxRGhuZxA2WjMUq8EBoQOwC8cfVkv5Pd0tZRiYNlZjUWIAXJyqR0OZqGVbw6ypXzVo1HnKmvn7RffAED3nUZxv81ub+i+Qz2ET2F2v3yI= 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+81414+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 1633323836116699.2527834961504; Sun, 3 Oct 2021 22:03:56 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id yLWVYY1788612xQiGPcFkC10; Sun, 03 Oct 2021 22:03:55 -0700 X-Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by mx.groups.io with SMTP id smtpd.web10.5200.1633323834847053953 for ; Sun, 03 Oct 2021 22:03:55 -0700 X-IronPort-AV: E=McAfee;i="6200,9189,10126"; a="311484646" X-IronPort-AV: E=Sophos;i="5.85,344,1624345200"; d="scan'208";a="311484646" X-Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Oct 2021 22:03:24 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,344,1624345200"; d="scan'208";a="710938497" X-Received: from ikuox-desk1.gar.corp.intel.com ([10.227.107.18]) by fmsmga006.fm.intel.com with ESMTP; 03 Oct 2021 22:03:22 -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 v5 1/4] MdePkg/BaseLib: Add QuickSort function on BaseLib Date: Mon, 4 Oct 2021 13:03:15 +0800 Message-Id: <20211004050318.1816-2-ianx.kuo@intel.com> In-Reply-To: <20211004050318.1816-1-ianx.kuo@intel.com> References: <20211004050318.1816-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: SqIaxy8oOfZMEdRWD2hIsG2Kx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1633323835; bh=6e39BGeo7hceZ1985WmKZVMfCzeCft2vqyLnZbI/wNM=; h=Cc:Date:From:Reply-To:Subject:To; b=jb0HPdvMeaI0TjR+jDLkeK40/CMfKw+0kwObXW8tbmwRXmLxzNBmMOzTpmEGU46BZWA 4f9fTgxKiEwl+Jaolh1xRJUV3czWT52YA9THmMFDZ+n42DtRaXX23UAMO6AyJV8SivCGP U/Jlc9zj9sQHkPOj+/6YDCbu9IxDAWxjLdg= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1633323836997100002 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 (#81414): https://edk2.groups.io/g/devel/message/81414 Mute This Topic: https://groups.io/mt/86059847/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 Wed May 15 07:12:36 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+81416+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+81416+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1633323840; cv=none; d=zohomail.com; s=zohoarc; b=de8w+jQjlP1Eqsn0lEZtZ0qoLJDkw9Th7hVjVt4s5k6kFVyDmDJjxGbDbEH/LLHunNEXwnn7dLI8yHgEZpGDvSxWQFricrh4IY2NGo+5mKNfuPG0jJUEbvVTggo2YKskV35M94Q45pOEPyP+l/R8tV8Q4GLPQ+KyOxFX4PqN3kQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1633323840; 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=i3SvzUH86PUcC56DtYRhLfK0li+sd5r6SkUHQlFl1Ok=; b=EVuUkoqqCpo9mPKt//wfUHEcX2KMy49ItkM3lhR6rBsBKL9Bg8PmnpeZXFSQiB1tHnztmXNxgFgP54E6hviVRRKCxB/VV0x+SLRamG2yObEL6WLB4sb2gYEPulAulLRE4DtyQ2XF5TLfg3A3qrO3dHEHn16bgrYzKZMLEPfSnBc= 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+81416+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 1633323840973999.7668698855497; Sun, 3 Oct 2021 22:04:00 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id 6zWFYY1788612xgjCHDAcaOR; Sun, 03 Oct 2021 22:04:00 -0700 X-Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by mx.groups.io with SMTP id smtpd.web10.5202.1633323839899153166 for ; Sun, 03 Oct 2021 22:04:00 -0700 X-IronPort-AV: E=McAfee;i="6200,9189,10126"; a="311484670" X-IronPort-AV: E=Sophos;i="5.85,344,1624345200"; d="scan'208";a="311484670" X-Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Oct 2021 22:03:26 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,344,1624345200"; d="scan'208";a="710938513" X-Received: from ikuox-desk1.gar.corp.intel.com ([10.227.107.18]) by fmsmga006.fm.intel.com with ESMTP; 03 Oct 2021 22:03:24 -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 v5 2/4] MdeModulePkg/SortLib: Add QuickSort function on BaseLib Date: Mon, 4 Oct 2021 13:03:16 +0800 Message-Id: <20211004050318.1816-3-ianx.kuo@intel.com> In-Reply-To: <20211004050318.1816-1-ianx.kuo@intel.com> References: <20211004050318.1816-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: AuJIwiuy9yvUD3ZIlTOWoo3Mx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1633323840; bh=B8mJKJYaB2mGwadjP1/zjFa7slOF9fCTkOkZauyBoC8=; h=Cc:Date:From:Reply-To:Subject:To; b=Gm5D2vvNpvuWEpNJovueED1W2Pqi8PYqUiu/iIccKVygyjyJfk5bjuLHW+9nz2PyhW4 Kqms71NS8vTx37eaqKG99AdYMXfqEpqj9alnZEvDz8Oo7a/2GjwCzZsZgURQ6H2tMIu/f HOm8da30QEtv2TAEVh02HZQT+viphI3+oc8= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1633323841333100002 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 (#81416): https://edk2.groups.io/g/devel/message/81416 Mute This Topic: https://groups.io/mt/86059872/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 Wed May 15 07:12:36 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+81415+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+81415+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1633323840; cv=none; d=zohomail.com; s=zohoarc; b=KlcFXwRC9CtGs+MXOfh4jZnxaeZizkPcxQRwHo8NI7ym7++gEquV5iZBxSDvSubO2hCu3KI+NTj6mG8dG8iFvoPk4qlosukL9p+0OGiotAcQTxs1IHYUAzhrUTvl/erHoJWlAynHmHw5hOuQ6/xbXxtRG5zcacMVNjy8O936BLU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1633323840; 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=shu8zR6o42Tcn7EbPrGITe6jVynQgmND08Mf5wYMLa8=; b=R5Szm3SytDy26tC+FjR5ASqexsdt4oKn1iF19o5w/bWGMuX0Ba/1mCZxIpiR0gqRMd1Xs3FCScGnZYz5Sza/CHdSGQJpWaHLD37V7nXK8NLImVs/5pQFNdRMSZnoHUm3AoHkgd+NmGzZUACFwZJRThLKqQFKW5qGJq5rLCnRerQ= 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+81415+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 1633323840549799.7300301665863; Sun, 3 Oct 2021 22:04:00 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id EBiiYY1788612xT7rxPSJKpn; Sun, 03 Oct 2021 22:04:00 -0700 X-Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by mx.groups.io with SMTP id smtpd.web10.5200.1633323834847053953 for ; Sun, 03 Oct 2021 22:03:59 -0700 X-IronPort-AV: E=McAfee;i="6200,9189,10126"; a="311484679" X-IronPort-AV: E=Sophos;i="5.85,344,1624345200"; d="scan'208";a="311484679" X-Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Oct 2021 22:03:28 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,344,1624345200"; d="scan'208";a="710938539" X-Received: from ikuox-desk1.gar.corp.intel.com ([10.227.107.18]) by fmsmga006.fm.intel.com with ESMTP; 03 Oct 2021 22:03:26 -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 v5 3/4] CryptoPkg/CryptLib: Add QuickSort function on BaseLib Date: Mon, 4 Oct 2021 13:03:17 +0800 Message-Id: <20211004050318.1816-4-ianx.kuo@intel.com> In-Reply-To: <20211004050318.1816-1-ianx.kuo@intel.com> References: <20211004050318.1816-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: Z83HissTQzfxZ1L3iEifv9Xcx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1633323840; bh=nB40/7UX4SVe2xXRrAjF1xndVsFBcf/AU5kx8yJ+79I=; h=Cc:Date:From:Reply-To:Subject:To; b=om9BsZDgDfjTsCHIm/1dJTrRcpUKxGC7i4j12P0BeOEHf4hMisHwSLbkSK2e3gMv/nn fIsMwNqyrtUY2ge8txlmpT0NB3ZyKtLG9GwMBz8YJe8mLf/bpBrxwX8PvppNIHttGDoHH +RCKVTyPM5VUcupL7DPSCEdnTM6dsLmQL60= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1633323841290100001 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..b10edaae5b 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, (BASE_SORT_COMPARE)compare, B= uffer); =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 (#81415): https://edk2.groups.io/g/devel/message/81415 Mute This Topic: https://groups.io/mt/86059871/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 Wed May 15 07:12:36 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+81417+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+81417+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1633323841; cv=none; d=zohomail.com; s=zohoarc; b=A7mBekIwcQIXRg2eD370REQ0LCvgzfAbEu7/ggV6PUtk0cNqsJA5fSnPI+MTLE+0N607368mzbzSFX+T8rnKska23PSS1zoxxs9T63Kd29hE6tlzqBMTl6dDbfzhqCORkx7HZr8u/n22eQIt62NuSU/QCrFyD0mUAwgF1ZxPU3I= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1633323841; 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=eQmVthLyC3tAkDcUbp+KewcREuwCZJvlExO4NTBtKjY=; b=iSkSAqFyU2KdAsQxKixpMNtf/f18UrQ/8BuKrh7+KXyTiS+0VCLBQVMvNqrXBVS+emqjieesXxVstGDYKGiMrtAAVTA42Nz3ePnasYIKV1ga9Q9/oxGOhOJNW86uZaA/YGOSsjBEAck0Je3ssvV3IzqwBnNBA8ym3+79vPX3/6s= 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+81417+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 1633323841558178.9981243393554; Sun, 3 Oct 2021 22:04:01 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id CEuIYY1788612xZ3bBsNmMCa; Sun, 03 Oct 2021 22:04:01 -0700 X-Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by mx.groups.io with SMTP id smtpd.web10.5200.1633323834847053953 for ; Sun, 03 Oct 2021 22:04:00 -0700 X-IronPort-AV: E=McAfee;i="6200,9189,10126"; a="311484685" X-IronPort-AV: E=Sophos;i="5.85,344,1624345200"; d="scan'208";a="311484685" X-Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Oct 2021 22:03:30 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,344,1624345200"; d="scan'208";a="710938565" X-Received: from ikuox-desk1.gar.corp.intel.com ([10.227.107.18]) by fmsmga006.fm.intel.com with ESMTP; 03 Oct 2021 22:03:28 -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 v5 4/4] UefiCpuPkg/CpuCacheInfoLib: Add QuickSort function on BaseLib Date: Mon, 4 Oct 2021 13:03:18 +0800 Message-Id: <20211004050318.1816-5-ianx.kuo@intel.com> In-Reply-To: <20211004050318.1816-1-ianx.kuo@intel.com> References: <20211004050318.1816-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: LsL4Pr15ZQ14LoKnMovcNgVSx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1633323841; bh=tCoCXXybn3InIFKPgzfNvBesAuwuvhInpjiNcnB91HI=; h=Cc:Date:From:Reply-To:Subject:To; b=oL4PYH82WzeYmEowZrWwpBYMnO+2nD7m2E6/n2pxVek2wPu06/2LfhCb18uvFj23L+/ qHdHM8nkMsF9u/M9BIekFDKM5bAGvbBQR3i9YEB6PfCLHU1KXGOA0a7fGJkmlVr8Q3wqV HGLDIrywDHjpM+hW+ipSi28BCoOl0/Q81sw= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1633323843429100009 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 (#81417): https://edk2.groups.io/g/devel/message/81417 Mute This Topic: https://groups.io/mt/86059873/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-