From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mout02.posteo.de (mout02.posteo.de [185.67.36.66]) by mx.groups.io with SMTP id smtpd.web09.28688.1632733770249898275 for ; Mon, 27 Sep 2021 02:09:31 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="body hash did not verify" header.i=@posteo.de header.s=2017 header.b=qNrwvbzO; spf=pass (domain: posteo.de, ip: 185.67.36.66, mailfrom: mhaeuser@posteo.de) Received: from submission (posteo.de [89.146.220.130]) by mout02.posteo.de (Postfix) with ESMTPS id A9175240108 for ; Mon, 27 Sep 2021 11:09:28 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.de; s=2017; t=1632733768; bh=VRgERkdn4W5+KaFbD3i+WRQMD3LG5KG1J3rKUTitIS0=; h=Subject:To:Cc:From:Date:From; b=qNrwvbzOd84wTvGZz7Xll9sLTnFdN8YGMrlbeCoE2Xm66bwJaDFCufdiuJ/uXXnFt iA+WkunZpqbT76vI/ueHkSYxbhIt+q2R5i3T6G+GLQ+gOuw3J0eB486rvhZD1sbB2g 1O3IOShVeJ9Bc1rpp0lO82jzBiyCIZ94giJz9HF+hScczV4EAjOtvZzL64aqAWb6CR l5bWtxUeouEiWMYYLFHIZOHwHhf6scrKRcoXoL9CSFV8zocJge/TtJTUs2jONADvYf uqaThs5xjTmRE0l5X125A3SM//k82aCWBEEUPVzLuXuN80iDVZ7idsKn75EH9a76k4 z4SlV6OW7WQfQ== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4HHxfG43ybz6tmQ; Mon, 27 Sep 2021 11:09:26 +0200 (CEST) Subject: Re: [edk2-devel] RFC: Add BaseLib/QuickSort in MdePkg To: "fanjianfeng@byosoft.com.cn" , "devel@edk2.groups.io" , "Ni, Ray" , 'gaoliming' , "Chan, Amy" , 'Andrew Fish' Cc: "Kinney, Michael D" , "'Gao, Liming'" , "Liu, Zhiguang" , "Wang, Jian J" , "Gao, Zhichao" References: <001a01d7aa99$d744af80$85ce0e80$@byosoft.com.cn> <003401d7aaa1$c7166830$55433890$@byosoft.com.cn> <16A70FAC1585C7C1.27516@groups.io> <00cf01d7b27a$59145d20$0b3d1760$@byosoft.com.cn> <2021092708451371303013@byosoft.com.cn> <7c260e5d-363e-8579-5a38-3cc5e2336bdb@posteo.de> <2021092716501903570820@byosoft.com.cn> From: =?UTF-8?B?TWFydmluIEjDpHVzZXI=?= Message-ID: <57dc418a-6620-629c-c448-777994c280d6@posteo.de> Date: Mon, 27 Sep 2021 09:09:26 +0000 MIME-Version: 1.0 In-Reply-To: <2021092716501903570820@byosoft.com.cn> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: quoted-printable On 27/09/2021 10:50, fanjianfeng@byosoft.com.cn wrote: > For former caller, they could still keep as is to call the old API in=20 > MdeModulePkg. I think Ray's design is compatible change for existing code= . > Only when the existing code wants to remove the dependency on=20 > MdeModuelPkg, they could migrate to the new API in baselib. > > I=C2=A0agree with=C2=A0one=C2=A0split-API desgin what you mentioned. > But my=C2=A0point=C2=A0is=C2=A0to define one API in baselib and=C2=A0to m= ake the baselib=20 > not depend on memory allocation. And another wrapper API could be=20 > designed to be placed in any other class. Oh sure, it could totally live in another class. I'd just like to have=20 those two models (caller- and callee-owned buffer) strictly separate, I=20 personally do not mind where exactly they are implemented. Thanks! Best regards, Marvin > > ------------------------------------------------------------------------ > Jeff > fanjianfeng@byosoft.com.cn > > *From:* Marvin H=C3=A4user > *Date:*=C2=A02021-09-27=C2=A016:14 > *To:* fanjianfeng@byosoft.com.cn > ; devel@edk2.groups.io > ; Ni, Ray ; > 'gaoliming' ; Chan, Amy > ; 'Andrew Fish' > *CC:* Kinney, Michael D ; 'Gao, > Liming' ; Liu, Zhiguang > ; Wang, Jian J > ; Gao, Zhichao > > *Subject:*=C2=A0Re: [edk2-devel] RFC: Add BaseLib/QuickSort in MdePkg > On 27/09/2021 02:45, fanjianfeng@byosoft.com.cn wrote: > > Making baselib implementation depend on MemoryAllocationLib > > (indirectly on Pei Service and gBS), it may prevent > > this=C2=A0base=C2=A0API=C2=A0using=C2=A0at some=C2=A0seneraio. i do= n't think it's better. > That is why I asked about a split-API scenario, one of which does not > depend on dynamic memory allocation (SetVariable-like) and one does > (wrapper-like). > > Add this parameter and make this parameter is optional, > > 1, when NULL, use the local 256 bytes stack > > 2, if 256 bytes stack is not enough, return RETURE_BUFFER_TOO_SAMLL= , > > 3, caller check the return status, to do nothing=C2=A0or to allocat= e > enough > > buffer for retry > > > > This is just like SetVariable()'s implementation. > Yes, and because that is SetVariable's implementation, we have > library > functions to make it less error-prone and more convenient [1]. As a > matter of fact, we have a (semi-lax) policy in our codebases to avoid > such functions like the plague and use those library wrappers > where-ever > it can make sense. The only super-rare exceptions I can think of are > when we know the size of the element ahead of time. Also > SetVariable has > no arbitrary constraint on when it may work the first time, and > there is > code that will fail when the first return is not EFI_BUFFER_TOO_SMALL= . > This solution honestly yields even more problems, because it > introduces > a Status return which was not there before. For common code safety > and > quality policy, this requires the value *must* be retrieved and > checked > in some fashion. So all callers, no matter the prior knowledge of the > element size, now need either a runtime check and handling for a > status > that they (may) know can never be returned, or ASSERTs if the > function > spec really imposes the arbitrary 256 Bytes constraint. Latter > doesn't > really work I think. What if someone wants to sort in SEC and noticed > they only have 64 Bytes on the stack to work with, realistically? Any > code depending on the 256 Byte constraint, passing NULL and not doing > additional handling, would seize to work. Former is too > complicated, see > wrappers. In my opinion, the memory must *either* be fully managed by > the caller *or* the callee (and you may have both in separate > functions, > as I suggested), but not sometimes here, sometimes there. > Best regards, > Marvin > [1] > https://github.com/tianocore/edk2/blob/46b4606ba23498d3d0e66b53e498eb= 3d5d592586/MdePkg/Library/UefiLib/UefiLib.c#L1309-L1360 > > > > > ---------------------------------------------------------------------= --- > > Jeff > > fanjianfeng@byosoft.com.cn > > > >=C2=A0=C2=A0=C2=A0=C2=A0 *From:* Marvin H=C3=A4user > >=C2=A0=C2=A0=C2=A0=C2=A0 *Date:*=C2=A02021-09-26=C2=A019:20 > >=C2=A0=C2=A0=C2=A0=C2=A0 *To:* devel ; = ray.ni > >=C2=A0=C2=A0=C2=A0=C2=A0 ; gaoliming > >=C2=A0=C2=A0=C2=A0=C2=A0 ; Chan, Am= y > >=C2=A0=C2=A0=C2=A0=C2=A0 ; 'Andrew Fish' > > >=C2=A0=C2=A0=C2=A0=C2=A0 *CC:* Kinney, Michael D ; > 'Gao, > >=C2=A0=C2=A0=C2=A0=C2=A0 Liming' ; Liu,= Zhiguang > >=C2=A0=C2=A0=C2=A0=C2=A0 ; Wang, Jian= J > >=C2=A0=C2=A0=C2=A0=C2=A0 ; Gao, Zhicha= o > >=C2=A0=C2=A0=C2=A0=C2=A0 > >=C2=A0=C2=A0=C2=A0=C2=A0 *Subject:*=C2=A0Re: [edk2-devel] RFC: Add B= aseLib/QuickSort in MdePkg > >=C2=A0=C2=A0=C2=A0=C2=A0 Hey Ray, > >=C2=A0=C2=A0=C2=A0=C2=A0 In my opinion that spec is too complicated.= For some cases it is > >=C2=A0=C2=A0=C2=A0=C2=A0 obvious, but I think the last anyone wants = to see is a > >=C2=A0=C2=A0=C2=A0=C2=A0 (STATIC_)ASSERT > >=C2=A0=C2=A0=C2=A0=C2=A0 before most QuickSort calls to ensure the e= lement size > *really* is <=3D > >=C2=A0=C2=A0=C2=A0=C2=A0 256 Bytes. In my opinion, there are two roa= ds: > >=C2=A0=C2=A0=C2=A0=C2=A0 1) Make the parameter required (I think thi= s is what Liming > >=C2=A0=C2=A0=C2=A0=C2=A0 suggested). > >=C2=A0=C2=A0=C2=A0=C2=A0 The caller would always need to provide sai= d buffer, and it > can do > >=C2=A0=C2=A0=C2=A0=C2=A0 as it > >=C2=A0=C2=A0=C2=A0=C2=A0 sees fit - on the stack, in a pool, in a pa= ge, who knows. > >=C2=A0=C2=A0=C2=A0=C2=A0 2) Remove the parameter entirely. The libra= ry would depend on > >=C2=A0=C2=A0=C2=A0=C2=A0 MemoryAllocationLib again, but also would h= ave an > optimisation by > >=C2=A0=C2=A0=C2=A0=C2=A0 choosing stack vs pool based on ElementSize= . > >=C2=A0=C2=A0=C2=A0=C2=A0 Usually I would prefer 2), as it is less pr= one to caller > errors, but > >=C2=A0=C2=A0=C2=A0=C2=A0 considering the low-level nature of edk2, I= can totally see the > >=C2=A0=C2=A0=C2=A0=C2=A0 point to > >=C2=A0=C2=A0=C2=A0=C2=A0 allow the caller to control whether there a= re dynamic memory > >=C2=A0=C2=A0=C2=A0=C2=A0 allocations > >=C2=A0=C2=A0=C2=A0=C2=A0 made or not as possible with 1). 2) could t= echnically also be a > >=C2=A0=C2=A0=C2=A0=C2=A0 wrapper > >=C2=A0=C2=A0=C2=A0=C2=A0 for 1) if you want granular control and con= venience/safety > (why not > >=C2=A0=C2=A0=C2=A0=C2=A0 actually?). > >=C2=A0=C2=A0=C2=A0=C2=A0 Both approaches have the advantage that it = is crystal-clear > what the > >=C2=A0=C2=A0=C2=A0=C2=A0 caller's job is - to always or to never all= ocate the buffer. > >=C2=A0=C2=A0=C2=A0=C2=A0 Best regards, > >=C2=A0=C2=A0=C2=A0=C2=A0 Marvin > >=C2=A0=C2=A0=C2=A0=C2=A0 On 26/09/2021 04:24, Ni, Ray wrote: > >=C2=A0=C2=A0=C2=A0=C2=A0 > > >=C2=A0=C2=A0=C2=A0=C2=A0 > Liming, > >=C2=A0=C2=A0=C2=A0=C2=A0 > > >=C2=A0=C2=A0=C2=A0=C2=A0 > The purpose of the optional BufferOneElem= ent is to ease > consumer=E2=80=99s > >=C2=A0=C2=A0=C2=A0=C2=A0 > life assuming most of the time the elemen= t size should be > >=C2=A0=C2=A0=C2=A0=C2=A0 smaller than > >=C2=A0=C2=A0=C2=A0=C2=A0 > 256. > >=C2=A0=C2=A0=C2=A0=C2=A0 > > >=C2=A0=C2=A0=C2=A0=C2=A0 > Are you saying that it=E2=80=99s a bit ha= rd to calculate the actual > >=C2=A0=C2=A0=C2=A0=C2=A0 value of > >=C2=A0=C2=A0=C2=A0=C2=A0 > sizeof (Element) when writing code? > >=C2=A0=C2=A0=C2=A0=C2=A0 > > >=C2=A0=C2=A0=C2=A0=C2=A0 > I recommend consumer always allocates mem= ory if it=E2=80=99s hard > to judge > >=C2=A0=C2=A0=C2=A0=C2=A0 > sizeof (Element) < 256. > >=C2=A0=C2=A0=C2=A0=C2=A0 > > >=C2=A0=C2=A0=C2=A0=C2=A0 > Searching edk2 code, I can find below cod= e using > PerformQuickSort(): > >=C2=A0=C2=A0=C2=A0=C2=A0 > > >=C2=A0=C2=A0=C2=A0=C2=A0 >=C2=A0 1. ShellPkg/UefiShellCommandLib: It= =E2=80=99s sorting array of > >=C2=A0=C2=A0=C2=A0=C2=A0 >=C2=A0=C2=A0=C2=A0=C2=A0 (EFI_DEVICE_PATH_= PROTOCOL *). > >=C2=A0=C2=A0=C2=A0=C2=A0 >=C2=A0 2. UefiCpuPkg/CpuCacheInfoLib: It= =E2=80=99s sorting array of > >=C2=A0=C2=A0=C2=A0=C2=A0 =C2=A0CPU_CACHE_INFO. > >=C2=A0=C2=A0=C2=A0=C2=A0 >=C2=A0 3. MinPlatformPkg/AcpiTables: It=E2= =80=99s sorting array of > >=C2=A0=C2=A0=C2=A0=C2=A0 EFI_CPU_ID_ORDER_MAP. > >=C2=A0=C2=A0=C2=A0=C2=A0 >=C2=A0 4. MdeModulePkg/UefiBootManagerLib:= It=E2=80=99s sorting array of > >=C2=A0=C2=A0=C2=A0=C2=A0 >=C2=A0=C2=A0=C2=A0=C2=A0 EFI_BOOT_MANAGER_= LOAD_OPTION. > >=C2=A0=C2=A0=C2=A0=C2=A0 >=C2=A0 5. MdeModulePkg/CapsuleApp: It=E2= =80=99s sorting array of > (EFI_FILE_INFO *) > >=C2=A0=C2=A0=C2=A0=C2=A0 >=C2=A0 6. CryptoPkg/CrtWrapper: It=E2=80= =99s sorting array of (unknown > type). > >=C2=A0=C2=A0=C2=A0=C2=A0 >=C2=A0 7. RedfishPkg/RedfishCrtLib: It=E2= =80=99s sorting array of > (unknown type). > >=C2=A0=C2=A0=C2=A0=C2=A0 > > >=C2=A0=C2=A0=C2=A0=C2=A0 > For 1~5, it=E2=80=99s easy to know that t= he size of the element is > smaller > >=C2=A0=C2=A0=C2=A0=C2=A0 > than 256. The AllocatePool() can be skipp= ed. > >=C2=A0=C2=A0=C2=A0=C2=A0 > > >=C2=A0=C2=A0=C2=A0=C2=A0 > Thanks, > >=C2=A0=C2=A0=C2=A0=C2=A0 > > >=C2=A0=C2=A0=C2=A0=C2=A0 > Ray > >=C2=A0=C2=A0=C2=A0=C2=A0 > > >=C2=A0=C2=A0=C2=A0=C2=A0 > *From:*gaoliming > >=C2=A0=C2=A0=C2=A0=C2=A0 > *Sent:* Sunday, September 26, 2021 10:01 = AM > >=C2=A0=C2=A0=C2=A0=C2=A0 > *To:* Ni, Ray ; devel@e= dk2.groups.io; > Chan, Amy > >=C2=A0=C2=A0=C2=A0=C2=A0 > ; 'Andrew Fish' > >=C2=A0=C2=A0=C2=A0=C2=A0 > *Cc:* Kinney, Michael D ; > 'Gao, Liming' > >=C2=A0=C2=A0=C2=A0=C2=A0 > ; Liu, Zhiguang > ; > >=C2=A0=C2=A0=C2=A0=C2=A0 Wang, > >=C2=A0=C2=A0=C2=A0=C2=A0 > Jian J ; Gao, Zhic= hao > > >=C2=A0=C2=A0=C2=A0=C2=A0 > *Subject:* =E5=9B=9E=E5=A4=8D: [edk2-deve= l] RFC: Add BaseLib/QuickSort in > MdePkg > >=C2=A0=C2=A0=C2=A0=C2=A0 > > >=C2=A0=C2=A0=C2=A0=C2=A0 > Ray: > >=C2=A0=C2=A0=C2=A0=C2=A0 > > >=C2=A0=C2=A0=C2=A0=C2=A0 > I may suggest to always require BufferOne= Element. The > consumer code > >=C2=A0=C2=A0=C2=A0=C2=A0 > may not know ElementSize. To avoid the er= ror, the consumer > must > >=C2=A0=C2=A0=C2=A0=C2=A0 > allocate buffer for BufferOneElement. If = so, > BufferOneElement is > >=C2=A0=C2=A0=C2=A0=C2=A0 the > >=C2=A0=C2=A0=C2=A0=C2=A0 > required parameter. > >=C2=A0=C2=A0=C2=A0=C2=A0 > > >=C2=A0=C2=A0=C2=A0=C2=A0 > Thanks > >=C2=A0=C2=A0=C2=A0=C2=A0 > > >=C2=A0=C2=A0=C2=A0=C2=A0 > Liming > >=C2=A0=C2=A0=C2=A0=C2=A0 > > >=C2=A0=C2=A0=C2=A0=C2=A0 > *=E5=8F=91=E4=BB=B6=E4=BA=BA**:*Ni, Ray <= ray.ni@intel.com > > > >=C2=A0=C2=A0=C2=A0=C2=A0 > *=E5=8F=91=E9=80=81=E6=97=B6=E9=97=B4:* 2= 021=E5=B9=B49=E6=9C=8824=E6=97=A5 11:53 > >=C2=A0=C2=A0=C2=A0=C2=A0 > *=E6=94=B6=E4=BB=B6=E4=BA=BA:* devel@edk2= .groups.io ; > Ni, > >=C2=A0=C2=A0=C2=A0=C2=A0 Ray > >=C2=A0=C2=A0=C2=A0=C2=A0 > >; Chan, Amy > >=C2=A0=C2=A0=C2=A0=C2=A0 > >; gaoliming > >=C2=A0=C2=A0=C2=A0=C2=A0 > >; > >=C2=A0=C2=A0=C2=A0=C2=A0 'Andrew > >=C2=A0=C2=A0=C2=A0=C2=A0 > Fish' > > >=C2=A0=C2=A0=C2=A0=C2=A0 > *=E6=8A=84=E9=80=81:* Kinney, Michael D <= michael.d.kinney@intel.com > >=C2=A0=C2=A0=C2=A0=C2=A0 > >; 'Ga= o, Liming' > >=C2=A0=C2=A0=C2=A0=C2=A0 > >; Liu, > Zhiguang > >=C2=A0=C2=A0=C2=A0=C2=A0 > >; > Wang, > >=C2=A0=C2=A0=C2=A0=C2=A0 Jian J > >=C2=A0=C2=A0=C2=A0=C2=A0 > >; Gao, > >=C2=A0=C2=A0=C2=A0=C2=A0 Zhichao > >=C2=A0=C2=A0=C2=A0=C2=A0 > > > >=C2=A0=C2=A0=C2=A0=C2=A0 > *=E4=B8=BB=E9=A2=98:* RE: [edk2-devel] RF= C: Add BaseLib/QuickSort in MdePkg > >=C2=A0=C2=A0=C2=A0=C2=A0 > > >=C2=A0=C2=A0=C2=A0=C2=A0 > More details on new QuickSort() API: > >=C2=A0=C2=A0=C2=A0=C2=A0 > > >=C2=A0=C2=A0=C2=A0=C2=A0 > The new API needs to carry additional par= ameter > =E2=80=9CBufferOneElement=E2=80=9D. > >=C2=A0=C2=A0=C2=A0=C2=A0 > > >=C2=A0=C2=A0=C2=A0=C2=A0 > This parameter gives QuickSort() the temp= orary buffer for > >=C2=A0=C2=A0=C2=A0=C2=A0 swapping in > >=C2=A0=C2=A0=C2=A0=C2=A0 > sorting. > >=C2=A0=C2=A0=C2=A0=C2=A0 > > >=C2=A0=C2=A0=C2=A0=C2=A0 > It=E2=80=99s to avoid BaseLib depends on = MemoryAllocationLib. > >=C2=A0=C2=A0=C2=A0=C2=A0 > > >=C2=A0=C2=A0=C2=A0=C2=A0 > =E2=80=A6 > >=C2=A0=C2=A0=C2=A0=C2=A0 > > >=C2=A0=C2=A0=C2=A0=C2=A0 > @param [in] BufferOneElement =C2=A0When E= lementSize > 256, caller > >=C2=A0=C2=A0=C2=A0=C2=A0 needs to > >=C2=A0=C2=A0=C2=A0=C2=A0 > provide a buffer whose size > >=C2=A0=C2=A0=C2=A0=C2=A0 > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 =C2=A0equals to Elem= entSize. It=E2=80=99s > used by > >=C2=A0=C2=A0=C2=A0=C2=A0 > QuickSort() for swapping in sorting. > >=C2=A0=C2=A0=C2=A0=C2=A0 > > >=C2=A0=C2=A0=C2=A0=C2=A0 > When ElementSize <=3D 256, QuickSort() us= es a local stack > 256-byte > >=C2=A0=C2=A0=C2=A0=C2=A0 buffer. > >=C2=A0=C2=A0=C2=A0=C2=A0 > > >=C2=A0=C2=A0=C2=A0=C2=A0 > @retval EFI_INVALID_PARAMETER When (Eleme= ntSize > 256) and > >=C2=A0=C2=A0=C2=A0=C2=A0 > (BufferOneElement =3D=3D NULL). > >=C2=A0=C2=A0=C2=A0=C2=A0 > > >=C2=A0=C2=A0=C2=A0=C2=A0 > =E2=80=A6 > >=C2=A0=C2=A0=C2=A0=C2=A0 > > >=C2=A0=C2=A0=C2=A0=C2=A0 > VOID > >=C2=A0=C2=A0=C2=A0=C2=A0 > > >=C2=A0=C2=A0=C2=A0=C2=A0 > EFIAPI > >=C2=A0=C2=A0=C2=A0=C2=A0 > > >=C2=A0=C2=A0=C2=A0=C2=A0 > QuickSort=C2=A0( > >=C2=A0=C2=A0=C2=A0=C2=A0 > > >=C2=A0=C2=A0=C2=A0=C2=A0 > =C2=A0=C2=A0IN=C2=A0OUT VOID=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0*BufferToSor= t, > >=C2=A0=C2=A0=C2=A0=C2=A0 > > >=C2=A0=C2=A0=C2=A0=C2=A0 > =C2=A0=C2=A0IN=C2=A0CONST=C2=A0UINTN Elem= entCount, > >=C2=A0=C2=A0=C2=A0=C2=A0 > > >=C2=A0=C2=A0=C2=A0=C2=A0 > =C2=A0=C2=A0IN=C2=A0CONST=C2=A0UINTN Elem= entSize, > >=C2=A0=C2=A0=C2=A0=C2=A0 > > >=C2=A0=C2=A0=C2=A0=C2=A0 > =C2=A0=C2=A0IN=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0SORT_COMPARE CompareFunction, > >=C2=A0=C2=A0=C2=A0=C2=A0 > > >=C2=A0=C2=A0=C2=A0=C2=A0 > IN VOID *BufferOneElement OPTIONAL > >=C2=A0=C2=A0=C2=A0=C2=A0 > > >=C2=A0=C2=A0=C2=A0=C2=A0 > ); > >=C2=A0=C2=A0=C2=A0=C2=A0 > > >=C2=A0=C2=A0=C2=A0=C2=A0 > Any comments? > >=C2=A0=C2=A0=C2=A0=C2=A0 > > >=C2=A0=C2=A0=C2=A0=C2=A0 > *From:*devel@edk2.groups.io > >=C2=A0=C2=A0=C2=A0=C2=A0 > > *On > Behalf Of > >=C2=A0=C2=A0=C2=A0=C2=A0 > *Ni, Ray > >=C2=A0=C2=A0=C2=A0=C2=A0 > *Sent:* Wednesday, September 22, 2021 2:0= 4 PM > >=C2=A0=C2=A0=C2=A0=C2=A0 > *To:* Chan, Amy >; > >=C2=A0=C2=A0=C2=A0=C2=A0 > gaoliming >=C2=A0=C2=A0=C2=A0=C2=A0 > >; 'Andr= ew Fish' > >=C2=A0=C2=A0=C2=A0=C2=A0 > >; 'edk2-devel-gr= oups-io' > >=C2=A0=C2=A0=C2=A0=C2=A0 > > > >=C2=A0=C2=A0=C2=A0=C2=A0 > *Cc:* Kinney, Michael D >=C2=A0=C2=A0=C2=A0=C2=A0 > >; 'Ga= o, Liming' > >=C2=A0=C2=A0=C2=A0=C2=A0 > >; Liu, > Zhiguang > >=C2=A0=C2=A0=C2=A0=C2=A0 > >; > Wang, > >=C2=A0=C2=A0=C2=A0=C2=A0 Jian J > >=C2=A0=C2=A0=C2=A0=C2=A0 > >; Gao, > >=C2=A0=C2=A0=C2=A0=C2=A0 Zhichao > >=C2=A0=C2=A0=C2=A0=C2=A0 > > > >=C2=A0=C2=A0=C2=A0=C2=A0 > *Subject:* Re: [edk2-devel] RFC: Add Base= Lib/QuickSort in > MdePkg > >=C2=A0=C2=A0=C2=A0=C2=A0 > > >=C2=A0=C2=A0=C2=A0=C2=A0 > I don=E2=80=99t see objection so far. > >=C2=A0=C2=A0=C2=A0=C2=A0 > > >=C2=A0=C2=A0=C2=A0=C2=A0 > So, the final solution is: > >=C2=A0=C2=A0=C2=A0=C2=A0 > > >=C2=A0=C2=A0=C2=A0=C2=A0 >=C2=A0 1. Add QuickSort() API to BaseLib i= n MdePkg. > >=C2=A0=C2=A0=C2=A0=C2=A0 >=C2=A0 2. Update existing=C2=A0MdeModulePk= g/SortLib to use > QuickSort() in the > >=C2=A0=C2=A0=C2=A0=C2=A0 >=C2=A0=C2=A0=C2=A0=C2=A0 implementation (p= roposed by Andrew Fish and Liming Gao) > >=C2=A0=C2=A0=C2=A0=C2=A0 >=C2=A0 3. Update UefiCpuPkg to use QuickSo= rtLib to remove improper > >=C2=A0=C2=A0=C2=A0=C2=A0 >=C2=A0=C2=A0=C2=A0=C2=A0 dependency on Mde= ModulePkg > >=C2=A0=C2=A0=C2=A0=C2=A0 > > >=C2=A0=C2=A0=C2=A0=C2=A0 > Thanks, > >=C2=A0=C2=A0=C2=A0=C2=A0 > > >=C2=A0=C2=A0=C2=A0=C2=A0 > Ray > >=C2=A0=C2=A0=C2=A0=C2=A0 > > >=C2=A0=C2=A0=C2=A0=C2=A0 > *From:*Ni, Ray > >=C2=A0=C2=A0=C2=A0=C2=A0 > *Sent:* Thursday, September 16, 2021 10:4= 8 AM > >=C2=A0=C2=A0=C2=A0=C2=A0 > *To:* Chan, Amy >; > >=C2=A0=C2=A0=C2=A0=C2=A0 > gaoliming >=C2=A0=C2=A0=C2=A0=C2=A0 > >; 'Andr= ew Fish' > >=C2=A0=C2=A0=C2=A0=C2=A0 > >; 'edk2-devel-gr= oups-io' > >=C2=A0=C2=A0=C2=A0=C2=A0 > > > >=C2=A0=C2=A0=C2=A0=C2=A0 > *Cc:* Kinney, Michael D >=C2=A0=C2=A0=C2=A0=C2=A0 > >; 'Ga= o, Liming' > >=C2=A0=C2=A0=C2=A0=C2=A0 > >; Liu, > Zhiguang > >=C2=A0=C2=A0=C2=A0=C2=A0 > >; > Wang, > >=C2=A0=C2=A0=C2=A0=C2=A0 Jian J > >=C2=A0=C2=A0=C2=A0=C2=A0 > >; Gao, > >=C2=A0=C2=A0=C2=A0=C2=A0 Zhichao > >=C2=A0=C2=A0=C2=A0=C2=A0 > > > >=C2=A0=C2=A0=C2=A0=C2=A0 > *Subject:* RE: [edk2-devel] RFC: Add Base= Lib/QuickSort in > MdePkg > >=C2=A0=C2=A0=C2=A0=C2=A0 > > >=C2=A0=C2=A0=C2=A0=C2=A0 > Amy, > >=C2=A0=C2=A0=C2=A0=C2=A0 > > >=C2=A0=C2=A0=C2=A0=C2=A0 > No. We only Add QuickSort() function API = into BaseLib.h. > >=C2=A0=C2=A0=C2=A0=C2=A0 > > >=C2=A0=C2=A0=C2=A0=C2=A0 > *From:*Chan, Amy > > >=C2=A0=C2=A0=C2=A0=C2=A0 > *Sent:* Thursday, September 16, 2021 10:4= 6 AM > >=C2=A0=C2=A0=C2=A0=C2=A0 > *To:* gaoliming >=C2=A0=C2=A0=C2=A0=C2=A0 > >; 'Andr= ew Fish' > >=C2=A0=C2=A0=C2=A0=C2=A0 > >; 'edk2-devel-gr= oups-io' > >=C2=A0=C2=A0=C2=A0=C2=A0 > > > >=C2=A0=C2=A0=C2=A0=C2=A0 > *Cc:* Ni, Ray >; Kinney, > >=C2=A0=C2=A0=C2=A0=C2=A0 > Michael D >=C2=A0=C2=A0=C2=A0=C2=A0 > >; 'Ga= o, Liming' > >=C2=A0=C2=A0=C2=A0=C2=A0 > >; Liu, > Zhiguang > >=C2=A0=C2=A0=C2=A0=C2=A0 > >; > Wang, > >=C2=A0=C2=A0=C2=A0=C2=A0 Jian J > >=C2=A0=C2=A0=C2=A0=C2=A0 > >; Gao, > >=C2=A0=C2=A0=C2=A0=C2=A0 Zhichao > >=C2=A0=C2=A0=C2=A0=C2=A0 > > > >=C2=A0=C2=A0=C2=A0=C2=A0 > *Subject:* RE: [edk2-devel] RFC: Add Base= Lib/QuickSort in > MdePkg > >=C2=A0=C2=A0=C2=A0=C2=A0 > > >=C2=A0=C2=A0=C2=A0=C2=A0 > Just to double confirm, will we have the = null instance of > >=C2=A0=C2=A0=C2=A0=C2=A0 QuickSort in > >=C2=A0=C2=A0=C2=A0=C2=A0 > MdePkg? > >=C2=A0=C2=A0=C2=A0=C2=A0 > > >=C2=A0=C2=A0=C2=A0=C2=A0 > Regards, > >=C2=A0=C2=A0=C2=A0=C2=A0 > > >=C2=A0=C2=A0=C2=A0=C2=A0 > Amy > >=C2=A0=C2=A0=C2=A0=C2=A0 > > >=C2=A0=C2=A0=C2=A0=C2=A0 > *From:*gaoliming >=C2=A0=C2=A0=C2=A0=C2=A0 > > > >=C2=A0=C2=A0=C2=A0=C2=A0 > *Sent:* Thursday, September 16, 2021 10:2= 3 AM > >=C2=A0=C2=A0=C2=A0=C2=A0 > *To:* 'Andrew Fish' >; > >=C2=A0=C2=A0=C2=A0=C2=A0 > 'edk2-devel-groups-io' >=C2=A0=C2=A0=C2=A0=C2=A0 > > > >=C2=A0=C2=A0=C2=A0=C2=A0 > *Cc:* Ni, Ray >; Kinney, > >=C2=A0=C2=A0=C2=A0=C2=A0 > Michael D >=C2=A0=C2=A0=C2=A0=C2=A0 > >; 'Ga= o, Liming' > >=C2=A0=C2=A0=C2=A0=C2=A0 > >; Liu, > Zhiguang > >=C2=A0=C2=A0=C2=A0=C2=A0 > >; > Wang, > >=C2=A0=C2=A0=C2=A0=C2=A0 Jian J > >=C2=A0=C2=A0=C2=A0=C2=A0 > >; Gao, > >=C2=A0=C2=A0=C2=A0=C2=A0 Zhichao > >=C2=A0=C2=A0=C2=A0=C2=A0 > >; > Chan, Amy > >=C2=A0=C2=A0=C2=A0=C2=A0 > > > >=C2=A0=C2=A0=C2=A0=C2=A0 > *Subject:* =E5=9B=9E=E5=A4=8D: [edk2-deve= l] RFC: Add BaseLib/QuickSort in > MdePkg > >=C2=A0=C2=A0=C2=A0=C2=A0 > > >=C2=A0=C2=A0=C2=A0=C2=A0 > Andrew: > >=C2=A0=C2=A0=C2=A0=C2=A0 > > >=C2=A0=C2=A0=C2=A0=C2=A0 > Thanks for your suggestion. I think your = idea is better. > We add new > >=C2=A0=C2=A0=C2=A0=C2=A0 > QuickSort() API to BaseLib, and update So= rtLib library > instance to > >=C2=A0=C2=A0=C2=A0=C2=A0 > consume BaseLib QuickSort() API. This way= has no change in > current > >=C2=A0=C2=A0=C2=A0=C2=A0 > SortLib library class. It is the compatib= le solution. > >=C2=A0=C2=A0=C2=A0=C2=A0 > > >=C2=A0=C2=A0=C2=A0=C2=A0 > Thanks > >=C2=A0=C2=A0=C2=A0=C2=A0 > > >=C2=A0=C2=A0=C2=A0=C2=A0 > Liming > >=C2=A0=C2=A0=C2=A0=C2=A0 > > >=C2=A0=C2=A0=C2=A0=C2=A0 > *=E5=8F=91=E4=BB=B6=E4=BA=BA**:*Andrew Fi= sh > > >=C2=A0=C2=A0=C2=A0=C2=A0 > *=E5=8F=91=E9=80=81=E6=97=B6=E9=97=B4:* 2= 021=E5=B9=B49=E6=9C=8816=E6=97=A5 10:13 > >=C2=A0=C2=A0=C2=A0=C2=A0 > *=E6=94=B6=E4=BB=B6=E4=BA=BA:* edk2-devel= -groups-io >=C2=A0=C2=A0=C2=A0=C2=A0 > >; Liming Ga= o > >=C2=A0=C2=A0=C2=A0=C2=A0 >=C2=A0=C2=A0=C2=A0=C2=A0 > > > >=C2=A0=C2=A0=C2=A0=C2=A0 > *=E6=8A=84=E9=80=81:* Ni, Ray >; Mike > >=C2=A0=C2=A0=C2=A0=C2=A0 > Kinney >=C2=A0=C2=A0=C2=A0=C2=A0 > >; Gao= , Liming > >=C2=A0=C2=A0=C2=A0=C2=A0 > >; Liu, > Zhiguang > >=C2=A0=C2=A0=C2=A0=C2=A0 > >; > Wang, > >=C2=A0=C2=A0=C2=A0=C2=A0 Jian J > >=C2=A0=C2=A0=C2=A0=C2=A0 > >; Gao, > >=C2=A0=C2=A0=C2=A0=C2=A0 Zhichao > >=C2=A0=C2=A0=C2=A0=C2=A0 > >; > Chan, Amy > >=C2=A0=C2=A0=C2=A0=C2=A0 > > > >=C2=A0=C2=A0=C2=A0=C2=A0 > *=E4=B8=BB=E9=A2=98:* Re: [edk2-devel] RF= C: Add BaseLib/QuickSort in MdePkg > >=C2=A0=C2=A0=C2=A0=C2=A0 > > >=C2=A0=C2=A0=C2=A0=C2=A0 >=C2=A0=C2=A0=C2=A0=C2=A0 On Sep 15, 2021, = at 6:26 PM, gaoliming > >=C2=A0=C2=A0=C2=A0=C2=A0 > > wrote: > >=C2=A0=C2=A0=C2=A0=C2=A0 > > >=C2=A0=C2=A0=C2=A0=C2=A0 >=C2=A0=C2=A0=C2=A0=C2=A0 Ray: > >=C2=A0=C2=A0=C2=A0=C2=A0 > > >=C2=A0=C2=A0=C2=A0=C2=A0 >=C2=A0=C2=A0=C2=A0=C2=A0 SortLib has been = added since 2015. I would suggest to > still keep > >=C2=A0=C2=A0=C2=A0=C2=A0 >=C2=A0=C2=A0=C2=A0=C2=A0 this library clas= s. To resolve the package dependency, my > >=C2=A0=C2=A0=C2=A0=C2=A0 proposal > >=C2=A0=C2=A0=C2=A0=C2=A0 >=C2=A0=C2=A0=C2=A0=C2=A0 is to move the li= brary class header file SortLib.h from > >=C2=A0=C2=A0=C2=A0=C2=A0 >=C2=A0=C2=A0=C2=A0=C2=A0 MdeModulePkg to M= dePkg, and still keep the library > instance in > >=C2=A0=C2=A0=C2=A0=C2=A0 >=C2=A0=C2=A0=C2=A0=C2=A0 MdeModulePkg. Thi= s proposal has no impact on the existing > >=C2=A0=C2=A0=C2=A0=C2=A0 platform. > >=C2=A0=C2=A0=C2=A0=C2=A0 > > >=C2=A0=C2=A0=C2=A0=C2=A0 > If we add QuickSort() API to the BaseLib = can we not just > port the > >=C2=A0=C2=A0=C2=A0=C2=A0 > existing=C2=A0MdeModulePkg/SortLib to use= QuickSort() in the > >=C2=A0=C2=A0=C2=A0=C2=A0 > implementation? Or is there some other wa= y to add the new > thing > >=C2=A0=C2=A0=C2=A0=C2=A0 in a > >=C2=A0=C2=A0=C2=A0=C2=A0 > backward compatible way. > >=C2=A0=C2=A0=C2=A0=C2=A0 > > >=C2=A0=C2=A0=C2=A0=C2=A0 > Thanks, > >=C2=A0=C2=A0=C2=A0=C2=A0 > > >=C2=A0=C2=A0=C2=A0=C2=A0 > Andrew Fish > >=C2=A0=C2=A0=C2=A0=C2=A0 > > >=C2=A0=C2=A0=C2=A0=C2=A0 >=C2=A0=C2=A0=C2=A0=C2=A0 Thanks > >=C2=A0=C2=A0=C2=A0=C2=A0 > > >=C2=A0=C2=A0=C2=A0=C2=A0 >=C2=A0=C2=A0=C2=A0=C2=A0 Liming > >=C2=A0=C2=A0=C2=A0=C2=A0 > > >=C2=A0=C2=A0=C2=A0=C2=A0 >=C2=A0=C2=A0=C2=A0=C2=A0 *=E5=8F=91=E4=BB= =B6=E4=BA=BA**:*devel@edk2.groups.io > >=C2=A0=C2=A0=C2=A0=C2=A0 > >=C2=A0=C2=A0=C2=A0=C2=A0 > >*=E4=BB=A3= =E8=A1=A8***Ni, Ray > >=C2=A0=C2=A0=C2=A0=C2=A0 >=C2=A0=C2=A0=C2=A0=C2=A0 *=E5=8F=91=E9=80= =81=E6=97=B6=E9=97=B4:*2021=E5=B9=B49=E6=9C=8814=E6=97=A514:15 > >=C2=A0=C2=A0=C2=A0=C2=A0 >=C2=A0=C2=A0=C2=A0=C2=A0 *=E6=94=B6=E4=BB= =B6=E4=BA=BA:*Kinney, Michael D >=C2=A0=C2=A0=C2=A0=C2=A0 > >; Gao= , Liming > >=C2=A0=C2=A0=C2=A0=C2=A0 >=C2=A0=C2=A0=C2=A0=C2=A0 >; Liu, > >=C2=A0=C2=A0=C2=A0=C2=A0 >=C2=A0=C2=A0=C2=A0=C2=A0 Zhiguang >=C2=A0=C2=A0=C2=A0=C2=A0 >; > >=C2=A0=C2=A0=C2=A0=C2=A0 >=C2=A0=C2=A0=C2=A0=C2=A0 Wang, Jian J >=C2=A0=C2=A0=C2=A0=C2=A0 > >; Gao, Zhi= chao > >=C2=A0=C2=A0=C2=A0=C2=A0 >=C2=A0=C2=A0=C2=A0=C2=A0 > > >=C2=A0=C2=A0=C2=A0=C2=A0 >=C2=A0=C2=A0=C2=A0=C2=A0 *=E6=8A=84=E9=80= =81:*devel@edk2.groups.io ; > >=C2=A0=C2=A0=C2=A0=C2=A0 Chan, Amy > >=C2=A0=C2=A0=C2=A0=C2=A0 >=C2=A0=C2=A0=C2=A0=C2=A0 > > >=C2=A0=C2=A0=C2=A0=C2=A0 >=C2=A0=C2=A0=C2=A0=C2=A0 *=E4=B8=BB=E9=A2= =98:*[edk2-devel] RFC: Add BaseLib/QuickSort in MdePkg > >=C2=A0=C2=A0=C2=A0=C2=A0 > > >=C2=A0=C2=A0=C2=A0=C2=A0 >=C2=A0=C2=A0=C2=A0=C2=A0 Hi package mainta= iners of MdePkg, MdeModulePkg and > ShellPkg, > >=C2=A0=C2=A0=C2=A0=C2=A0 >=C2=A0=C2=A0=C2=A0=C2=A0 community, > >=C2=A0=C2=A0=C2=A0=C2=A0 > > >=C2=A0=C2=A0=C2=A0=C2=A0 >=C2=A0=C2=A0=C2=A0=C2=A0 A commit (UefiCpu= Pkg/CpuCacheInfoLib: Sort > CpuCacheInfo array > >=C2=A0=C2=A0=C2=A0=C2=A0 > > > > ) > >=C2=A0=C2=A0=C2=A0=C2=A0 >=C2=A0=C2=A0=C2=A0=C2=A0 to UefiCpuPkg let > >=C2=A0=C2=A0=C2=A0=C2=A0 >=C2=A0=C2=A0=C2=A0=C2=A0 UefiCpuPkg depend= on MdeModulePkg because the SortLib > class and > >=C2=A0=C2=A0=C2=A0=C2=A0 >=C2=A0=C2=A0=C2=A0=C2=A0 instances are all= in MdeModulePkg. > >=C2=A0=C2=A0=C2=A0=C2=A0 > > >=C2=A0=C2=A0=C2=A0=C2=A0 >=C2=A0=C2=A0=C2=A0=C2=A0 UefiCpuPkg depend= ing on MdeModulePkg breaks the rule that > >=C2=A0=C2=A0=C2=A0=C2=A0 >=C2=A0=C2=A0=C2=A0=C2=A0 =E2=80=9CUefiCpuP= kg should ONLY depend on MdePkg=E2=80=9D. > >=C2=A0=C2=A0=C2=A0=C2=A0 > > >=C2=A0=C2=A0=C2=A0=C2=A0 >=C2=A0=C2=A0=C2=A0=C2=A0 To address this i= ssue, there are two approaches: > >=C2=A0=C2=A0=C2=A0=C2=A0 > > >=C2=A0=C2=A0=C2=A0=C2=A0 >=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 1. Duplicat= e the sort logic in UefiCpuPkg to not > depend on > >=C2=A0=C2=A0=C2=A0=C2=A0 >=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0 MdeModulePkg/SortLib > >=C2=A0=C2=A0=C2=A0=C2=A0 >=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 2. Add Quic= kSort() API to BaseLib in MdePkg. > >=C2=A0=C2=A0=C2=A0=C2=A0 > > >=C2=A0=C2=A0=C2=A0=C2=A0 >=C2=A0=C2=A0=C2=A0=C2=A0 Approach #2 (MdeP= kg/BaseLib/QuickSort) makes more > sense because > >=C2=A0=C2=A0=C2=A0=C2=A0 >=C2=A0=C2=A0=C2=A0=C2=A0 quick sort is a s= tandard algorithm. > >=C2=A0=C2=A0=C2=A0=C2=A0 > > >=C2=A0=C2=A0=C2=A0=C2=A0 >=C2=A0=C2=A0=C2=A0=C2=A0 We encourage cons= umers to update their code to use the > quick > >=C2=A0=C2=A0=C2=A0=C2=A0 sort > >=C2=A0=C2=A0=C2=A0=C2=A0 >=C2=A0=C2=A0=C2=A0=C2=A0 in MdePkg and gra= dually deprecate today=E2=80=99s > MdeModulePkg/SortLib. > >=C2=A0=C2=A0=C2=A0=C2=A0 > > >=C2=A0=C2=A0=C2=A0=C2=A0 >=C2=A0=C2=A0=C2=A0=C2=A0 If you don=E2=80= =99t have concerns, I plan to: > >=C2=A0=C2=A0=C2=A0=C2=A0 > > >=C2=A0=C2=A0=C2=A0=C2=A0 >=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 1. =E2=80= =9CAdd QuickSort() to BaseLib=E2=80=9D and update all existing > >=C2=A0=C2=A0=C2=A0=C2=A0 consumers > >=C2=A0=C2=A0=C2=A0=C2=A0 >=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0 to use this API instead. > >=C2=A0=C2=A0=C2=A0=C2=A0 > > >=C2=A0=C2=A0=C2=A0=C2=A0 >=C2=A0=C2=A0=C2=A0=C2=A0 VOID > >=C2=A0=C2=A0=C2=A0=C2=A0 > > >=C2=A0=C2=A0=C2=A0=C2=A0 >=C2=A0=C2=A0=C2=A0=C2=A0 EFIAPI > >=C2=A0=C2=A0=C2=A0=C2=A0 > > >=C2=A0=C2=A0=C2=A0=C2=A0 >=C2=A0=C2=A0=C2=A0=C2=A0 QuickSort=C2=A0( > >=C2=A0=C2=A0=C2=A0=C2=A0 > > >=C2=A0=C2=A0=C2=A0=C2=A0 > =C2=A0=C2=A0IN=C2=A0OUT=C2=A0VOID=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0*BufferToSort, > >=C2=A0=C2=A0=C2=A0=C2=A0 > > >=C2=A0=C2=A0=C2=A0=C2=A0 >=C2=A0=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0IN=C2= =A0CONST=C2=A0UINTN Count, > >=C2=A0=C2=A0=C2=A0=C2=A0 > > >=C2=A0=C2=A0=C2=A0=C2=A0 >=C2=A0=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0IN=C2= =A0CONST=C2=A0UINTN ElementSize, > >=C2=A0=C2=A0=C2=A0=C2=A0 > > >=C2=A0=C2=A0=C2=A0=C2=A0 > =C2=A0=C2=A0IN=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0SORT_COMPARE=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0CompareFunction > >=C2=A0=C2=A0=C2=A0=C2=A0 > > >=C2=A0=C2=A0=C2=A0=C2=A0 >=C2=A0=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0); > >=C2=A0=C2=A0=C2=A0=C2=A0 > > >=C2=A0=C2=A0=C2=A0=C2=A0 >=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 2. =E2=80= =9CAdd new ShellPkg/SortCompareLib=E2=80=9D > >=C2=A0=C2=A0=C2=A0=C2=A0 > > >=C2=A0=C2=A0=C2=A0=C2=A0 >=C2=A0=C2=A0=C2=A0=C2=A0 Background: Shell= Pkg requires to sort > devicepath/string so 3 > >=C2=A0=C2=A0=C2=A0=C2=A0 APIs > >=C2=A0=C2=A0=C2=A0=C2=A0 >=C2=A0=C2=A0=C2=A0=C2=A0 in UefiSortLib (D= evicePathCompare, StringNoCaseCompare, > >=C2=A0=C2=A0=C2=A0=C2=A0 >=C2=A0=C2=A0=C2=A0=C2=A0 StringCompare) ar= e provided for Shell usage. we can > move the 3 > >=C2=A0=C2=A0=C2=A0=C2=A0 >=C2=A0=C2=A0=C2=A0=C2=A0 APIs to the SortC= ompareLib and update Shell code to use > >=C2=A0=C2=A0=C2=A0=C2=A0 >=C2=A0=C2=A0=C2=A0=C2=A0 BaseLib/QuickSort= directly, with the sort compare > function from > >=C2=A0=C2=A0=C2=A0=C2=A0 >=C2=A0=C2=A0=C2=A0=C2=A0 SortCompareLib. > >=C2=A0=C2=A0=C2=A0=C2=A0 > > >=C2=A0=C2=A0=C2=A0=C2=A0 >=C2=A0=C2=A0=C2=A0=C2=A0 Any concerns? > >=C2=A0=C2=A0=C2=A0=C2=A0 > > >=C2=A0=C2=A0=C2=A0=C2=A0 >=C2=A0=C2=A0=C2=A0=C2=A0 Thanks, > >=C2=A0=C2=A0=C2=A0=C2=A0 > > >=C2=A0=C2=A0=C2=A0=C2=A0 >=C2=A0=C2=A0=C2=A0=C2=A0 Ray > >=C2=A0=C2=A0=C2=A0=C2=A0 > > >=C2=A0=C2=A0=C2=A0=C2=A0 > > > > > > =20 >