[edk2-devel] [PATCH] UefiCpuPkg/CpuFeature: reduce time complexty to calc CpuInfo.First

Ni, Ray ray.ni at intel.com
Fri Dec 11 10:39:30 UTC 2020


> > +  FirstPackage = MAX_UINT32;
> >
> > +  for (PackageIndex = 0; PackageIndex < CpuStatus->PackageCount;
> > PackageIndex++) {
> >
> > +    FirstCore[PackageIndex] = MAX_UINT32;
> >
> > +    for (CoreIndex = 0; CoreIndex < CpuStatus->MaxCoreCount; CoreIndex++)
> > {
> >
> > +      FirstThread[PackageIndex * CpuStatus->MaxCoreCount + CoreIndex] =
> > MAX_UINT32;
> >
> > +    }
> >
> > +  }
> 
> Could this code block be replaced by a SetMem32(xxx, xxx, MAX_UINT32) call?
> 
Yes. it could. I thought the for loop is more readable. Maybe it doesn't help a lot
on the code readability. Let me send an updated version to use SetMem32.


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#68713): https://edk2.groups.io/g/devel/message/68713
Mute This Topic: https://groups.io/mt/78804897/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-






More information about the edk2-devel-archive mailing list