From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mx.groups.io with SMTP id smtpd.web08.32103.1634529404004087854 for ; Sun, 17 Oct 2021 20:56:48 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 192.55.52.88, mailfrom: ianx.kuo@intel.com) X-IronPort-AV: E=McAfee;i="6200,9189,10140"; a="251618080" X-IronPort-AV: E=Sophos;i="5.85,381,1624345200"; d="scan'208";a="251618080" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Oct 2021 20:56:48 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,381,1624345200"; d="scan'208";a="719161163" Received: from ikuox-desk1.gar.corp.intel.com ([10.227.107.18]) by fmsmga005.fm.intel.com with ESMTP; 17 Oct 2021 20:56:46 -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: [PATCH v5 3/3] UefiCpuPkg/CpuCacheInfoLib: Add QuickSort function on BaseLib Date: Mon, 18 Oct 2021 11:56:38 +0800 Message-Id: <20211018035638.565-4-ianx.kuo@intel.com> X-Mailer: git-send-email 2.30.0.windows.1 In-Reply-To: <20211018035638.565-1-ianx.kuo@intel.com> References: <20211018035638.565-1-ianx.kuo@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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 | 3 ++- UefiCpuPkg/Library/CpuCacheInfoLib/DxeCpuCacheInfoLib.inf | 2 -- UefiCpuPkg/Library/CpuCacheInfoLib/InternalCpuCacheInfoLib.h | 1 - UefiCpuPkg/Library/CpuCacheInfoLib/PeiCpuCacheInfoLib.inf | 2 -- 4 files changed, 2 insertions(+), 6 deletions(-) diff --git a/UefiCpuPkg/Library/CpuCacheInfoLib/CpuCacheInfoLib.c b/UefiCpu= Pkg/Library/CpuCacheInfoLib/CpuCacheInfoLib.c index c0077d6770..7aea735381 100644 --- a/UefiCpuPkg/Library/CpuCacheInfoLib/CpuCacheInfoLib.c +++ b/UefiCpuPkg/Library/CpuCacheInfoLib/CpuCacheInfoLib.c @@ -282,6 +282,7 @@ CpuCacheInfoCollectCpuCacheInfoData ( UINTN LocalCacheInfoCount;=0D UINTN Index;=0D UINTN NextIndex;=0D + CPU_CACHE_INFO SortBuffer;=0D =0D //=0D // Get number of Packages and Package ID.=0D @@ -369,7 +370,7 @@ CpuCacheInfoCollectCpuCacheInfoData ( //=0D // Sort LocalCacheInfo array by CPU package ID, core type, cache level= and cache type.=0D //=0D - PerformQuickSort (LocalCacheInfo, LocalCacheInfoCount, sizeof (*LocalC= acheInfo), (SORT_COMPARE) CpuCacheInfoCompare);=0D + QuickSort (LocalCacheInfo, LocalCacheInfoCount, sizeof (*LocalCacheInf= o), CpuCacheInfoCompare, &SortBuffer);=0D CopyMem (CacheInfo, LocalCacheInfo, sizeof (*CacheInfo) * LocalCacheIn= foCount);=0D DEBUG_CODE (=0D CpuCacheInfoPrintCpuCacheInfoTable (CacheInfo, LocalCacheInfoCount);= =0D 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 @@ =0D [Packages]=0D MdePkg/MdePkg.dec=0D - MdeModulePkg/MdeModulePkg.dec=0D UefiCpuPkg/UefiCpuPkg.dec=0D =0D [LibraryClasses]=0D @@ -34,7 +33,6 @@ BaseMemoryLib=0D MemoryAllocationLib=0D UefiBootServicesTableLib=0D - SortLib=0D =0D [Protocols]=0D gEfiMpServiceProtocolGuid=0D diff --git a/UefiCpuPkg/Library/CpuCacheInfoLib/InternalCpuCacheInfoLib.h b= /UefiCpuPkg/Library/CpuCacheInfoLib/InternalCpuCacheInfoLib.h index 26e1f46516..829a9f43ce 100644 --- a/UefiCpuPkg/Library/CpuCacheInfoLib/InternalCpuCacheInfoLib.h +++ b/UefiCpuPkg/Library/CpuCacheInfoLib/InternalCpuCacheInfoLib.h @@ -17,7 +17,6 @@ #include =0D #include =0D #include =0D -#include =0D #include =0D =0D typedef union {=0D 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 @@ =0D [Packages]=0D MdePkg/MdePkg.dec=0D - MdeModulePkg/MdeModulePkg.dec=0D UefiCpuPkg/UefiCpuPkg.dec=0D =0D [LibraryClasses]=0D @@ -34,7 +33,6 @@ BaseMemoryLib=0D MemoryAllocationLib=0D PeiServicesTablePointerLib=0D - SortLib=0D =0D [Ppis]=0D gEdkiiPeiMpServices2PpiGuid=0D --=20 2.30.0.windows.1