summaryrefslogtreecommitdiffstats
path: root/MdeModulePkg/Universal/StatusCodeHandler/RuntimeDxe
diff options
context:
space:
mode:
authorlgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524>2010-07-05 08:59:57 +0000
committerlgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524>2010-07-05 08:59:57 +0000
commitbe63a20a025d5a7b792bf6ff33b91d22323e19d8 (patch)
tree78e9f2d681acce56ad9e925eaaf460d52c593557 /MdeModulePkg/Universal/StatusCodeHandler/RuntimeDxe
parentb24633c74e55c0a6a9c1c84796f00c3552c66ee3 (diff)
downloadedk2-be63a20a025d5a7b792bf6ff33b91d22323e19d8.tar.gz
edk2-be63a20a025d5a7b792bf6ff33b91d22323e19d8.tar.bz2
edk2-be63a20a025d5a7b792bf6ff33b91d22323e19d8.zip
Fix the issues that StatusCode can't work when PcdStatusCodeUseMemory is set to TRUE.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10630 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg/Universal/StatusCodeHandler/RuntimeDxe')
-rw-r--r--MdeModulePkg/Universal/StatusCodeHandler/RuntimeDxe/StatusCodeHandlerRuntimeDxe.c71
1 files changed, 28 insertions, 43 deletions
diff --git a/MdeModulePkg/Universal/StatusCodeHandler/RuntimeDxe/StatusCodeHandlerRuntimeDxe.c b/MdeModulePkg/Universal/StatusCodeHandler/RuntimeDxe/StatusCodeHandlerRuntimeDxe.c
index 81a9e3c4ca..9149ca4efa 100644
--- a/MdeModulePkg/Universal/StatusCodeHandler/RuntimeDxe/StatusCodeHandlerRuntimeDxe.c
+++ b/MdeModulePkg/Universal/StatusCodeHandler/RuntimeDxe/StatusCodeHandlerRuntimeDxe.c
@@ -79,9 +79,8 @@ InitializationDispatcherWorker (
EFI_STATUS Status;
MEMORY_STATUSCODE_PACKET_HEADER *PacketHeader;
MEMORY_STATUSCODE_RECORD *Record;
- UINTN ExpectedPacketIndex;
UINTN Index;
- VOID *HobStart;
+ UINTN MaxRecordNumber;
//
// If enable UseSerial, then initialize serial port.
@@ -107,54 +106,40 @@ InitializationDispatcherWorker (
// Journal GUID'ed HOBs to find all record entry, if found,
// then output record to support replay device.
//
- ExpectedPacketIndex = 0;
Hob.Raw = GetFirstGuidHob (&gMemoryStatusCodeRecordGuid);
- HobStart = Hob.Raw;
- while (Hob.Raw != NULL) {
+ if (Hob.Raw != NULL) {
PacketHeader = (MEMORY_STATUSCODE_PACKET_HEADER *) GET_GUID_HOB_DATA (Hob.Guid);
- if (PacketHeader->PacketIndex == ExpectedPacketIndex) {
- Record = (MEMORY_STATUSCODE_RECORD *) (PacketHeader + 1);
- for (Index = 0; Index < PacketHeader->RecordIndex; Index++) {
- //
- // Dispatch records to devices based on feature flag.
- //
- if (FeaturePcdGet (PcdStatusCodeUseSerial)) {
- SerialStatusCodeReportWorker (
- Record[Index].CodeType,
- Record[Index].Value,
- Record[Index].Instance,
- NULL,
- NULL
- );
- }
- if (FeaturePcdGet (PcdStatusCodeUseMemory)) {
- RtMemoryStatusCodeReportWorker (
- Record[Index].CodeType,
- Record[Index].Value,
- Record[Index].Instance,
- NULL,
- NULL
- );
- }
- }
- ExpectedPacketIndex++;
-
+ Record = (MEMORY_STATUSCODE_RECORD *) (PacketHeader + 1);
+ MaxRecordNumber = (UINTN) PacketHeader->RecordIndex;
+ if (PacketHeader->PacketIndex > 0) {
//
- // See whether there is gap of packet or not
+ // Record has been wrapped around. So, record number has arrived at max number.
//
- if (HobStart != NULL) {
- HobStart = NULL;
- Hob.Raw = HobStart;
- continue;
- }
- } else if (HobStart != NULL) {
+ MaxRecordNumber = (UINTN) PacketHeader->MaxRecordsNumber;
+ }
+ for (Index = 0; Index < MaxRecordNumber; Index++) {
//
- // Cache the found packet for improve the performance
+ // Dispatch records to devices based on feature flag.
//
- HobStart = Hob.Raw;
+ if (FeaturePcdGet (PcdStatusCodeUseSerial)) {
+ SerialStatusCodeReportWorker (
+ Record[Index].CodeType,
+ Record[Index].Value,
+ Record[Index].Instance,
+ NULL,
+ NULL
+ );
+ }
+ if (FeaturePcdGet (PcdStatusCodeUseMemory)) {
+ RtMemoryStatusCodeReportWorker (
+ Record[Index].CodeType,
+ Record[Index].Value,
+ Record[Index].Instance,
+ NULL,
+ NULL
+ );
+ }
}
-
- Hob.Raw = GetNextGuidHob (&gMemoryStatusCodeRecordGuid, Hob.Raw);
}
}
}