diff options
Diffstat (limited to 'MdeModulePkg/Library/SmmCorePerformanceLib')
-rw-r--r-- | MdeModulePkg/Library/SmmCorePerformanceLib/SmmCorePerformanceLib.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/MdeModulePkg/Library/SmmCorePerformanceLib/SmmCorePerformanceLib.c b/MdeModulePkg/Library/SmmCorePerformanceLib/SmmCorePerformanceLib.c index ca953df932..214d044bcb 100644 --- a/MdeModulePkg/Library/SmmCorePerformanceLib/SmmCorePerformanceLib.c +++ b/MdeModulePkg/Library/SmmCorePerformanceLib/SmmCorePerformanceLib.c @@ -93,6 +93,7 @@ SmmSearchForGaugeEntry ( )
{
UINT32 Index;
+ UINT32 Index2;
UINT32 NumberOfEntries;
GAUGE_DATA_ENTRY_EX *GaugeEntryExArray;
@@ -106,12 +107,16 @@ SmmSearchForGaugeEntry ( NumberOfEntries = mGaugeData->NumberOfEntries;
GaugeEntryExArray = (GAUGE_DATA_ENTRY_EX *) (mGaugeData + 1);
+ Index2 = 0;
+
for (Index = 0; Index < NumberOfEntries; Index++) {
- if ((GaugeEntryExArray[Index].Handle == (EFI_PHYSICAL_ADDRESS) (UINTN) Handle) &&
- AsciiStrnCmp (GaugeEntryExArray[Index].Token, Token, SMM_PERFORMANCE_STRING_LENGTH) == 0 &&
- AsciiStrnCmp (GaugeEntryExArray[Index].Module, Module, SMM_PERFORMANCE_STRING_LENGTH) == 0 &&
- (GaugeEntryExArray[Index].Identifier == Identifier) &&
- GaugeEntryExArray[Index].EndTimeStamp == 0) {
+ Index2 = NumberOfEntries - 1 - Index;
+ if (GaugeEntryExArray[Index2].EndTimeStamp == 0 &&
+ (GaugeEntryExArray[Index2].Handle == (EFI_PHYSICAL_ADDRESS) (UINTN) Handle) &&
+ AsciiStrnCmp (GaugeEntryExArray[Index2].Token, Token, SMM_PERFORMANCE_STRING_LENGTH) == 0 &&
+ AsciiStrnCmp (GaugeEntryExArray[Index2].Module, Module, SMM_PERFORMANCE_STRING_LENGTH) == 0 &&
+ (GaugeEntryExArray[Index2].Identifier == Identifier)) {
+ Index = Index2;
break;
}
}
|