UefiCpuPkg/RegisterCpuFeaturesLib: Support combo CPU feature style.

Current code assume only one dependence (before or after) for one
feature. Enhance code logic to support feature has two dependence
(before and after) type.

Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
This commit is contained in:
Eric Dong
2018-10-25 14:50:22 +08:00
parent 901ae29dfe
commit 1475b83f06
3 changed files with 45 additions and 67 deletions

View File

@ -671,10 +671,11 @@ AnalysisProcessorFeatures (
// If feature has dependence with the next feature (ONLY care core/package dependency).
// and feature initialize succeed, add sync semaphere here.
//
BeforeDep = DetectFeatureScope (CpuFeatureInOrder, TRUE);
if (NextCpuFeatureInOrder != NULL) {
AfterDep = DetectFeatureScope (NextCpuFeatureInOrder, FALSE);
BeforeDep = DetectFeatureScope (CpuFeatureInOrder, TRUE, NextCpuFeatureInOrder->FeatureMask);
AfterDep = DetectFeatureScope (NextCpuFeatureInOrder, FALSE, CpuFeatureInOrder->FeatureMask);
} else {
BeforeDep = DetectFeatureScope (CpuFeatureInOrder, TRUE, NULL);
AfterDep = NoneDepType;
}
//