diff options
author | lgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524> | 2009-06-16 01:16:27 +0000 |
---|---|---|
committer | lgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524> | 2009-06-16 01:16:27 +0000 |
commit | d2c315e686d792108d68bfe0ef5f0fece3fb8805 (patch) | |
tree | 7f32703add3f29221b25d42b42cf44beb9f19f24 /IntelFrameworkModulePkg/Universal | |
parent | b8b6faa05982cd365e626ec1e2e40374a1dad20e (diff) | |
download | edk2-platforms-d2c315e686d792108d68bfe0ef5f0fece3fb8805.tar.xz |
Retire the duplicate StatusCode PCD:
gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdStatusCodeUseEfiSerial, PcdStatusCodeUseHardSerial, PcdStatusCodeUseRuntimeMemory, PcdStatusCodeReplayInSerial, PcdStatusCodeReplayInRuntimeMemory, PcdStatusCodeReplayInDataHub, PcdStatusCodeReplayInOEM, PcdStatusCodeRuntimeMemorySize
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@8566 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'IntelFrameworkModulePkg/Universal')
5 files changed, 85 insertions, 147 deletions
diff --git a/IntelFrameworkModulePkg/Universal/StatusCode/Pei/StatusCodePei.inf b/IntelFrameworkModulePkg/Universal/StatusCode/Pei/StatusCodePei.inf index fade2dec25..6085cd0466 100644 --- a/IntelFrameworkModulePkg/Universal/StatusCode/Pei/StatusCodePei.inf +++ b/IntelFrameworkModulePkg/Universal/StatusCode/Pei/StatusCodePei.inf @@ -68,7 +68,7 @@ [Pcd.common]
- gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdStatusCodeMemorySize
+ gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdStatusCodeMemorySize|1|PcdStatusCodeUseMemory
[Depex]
TRUE
diff --git a/IntelFrameworkModulePkg/Universal/StatusCode/RuntimeDxe/RtMemoryStatusCodeWorker.c b/IntelFrameworkModulePkg/Universal/StatusCode/RuntimeDxe/RtMemoryStatusCodeWorker.c index e67c31d3e3..5949190ea9 100644 --- a/IntelFrameworkModulePkg/Universal/StatusCode/RuntimeDxe/RtMemoryStatusCodeWorker.c +++ b/IntelFrameworkModulePkg/Universal/StatusCode/RuntimeDxe/RtMemoryStatusCodeWorker.c @@ -32,15 +32,14 @@ RtMemoryStatusCodeInitializeWorker ( //
mRtMemoryStatusCodeTable = AllocateRuntimePool (
sizeof (RUNTIME_MEMORY_STATUSCODE_HEADER) +
- PcdGet16 (PcdStatusCodeRuntimeMemorySize) *
- 1024
+ PcdGet16 (PcdStatusCodeMemorySize) * 1024
);
ASSERT (mRtMemoryStatusCodeTable != NULL);
mRtMemoryStatusCodeTable->RecordIndex = 0;
mRtMemoryStatusCodeTable->NumberOfRecords = 0;
mRtMemoryStatusCodeTable->MaxRecordsNumber =
- (PcdGet16 (PcdStatusCodeRuntimeMemorySize) * 1024) / sizeof (MEMORY_STATUSCODE_RECORD);
+ (PcdGet16 (PcdStatusCodeMemorySize) * 1024) / sizeof (MEMORY_STATUSCODE_RECORD);
return EFI_SUCCESS;
}
diff --git a/IntelFrameworkModulePkg/Universal/StatusCode/RuntimeDxe/SerialStatusCodeWorker.c b/IntelFrameworkModulePkg/Universal/StatusCode/RuntimeDxe/SerialStatusCodeWorker.c index 1d5f53e479..c4e9e3340b 100644 --- a/IntelFrameworkModulePkg/Universal/StatusCode/RuntimeDxe/SerialStatusCodeWorker.c +++ b/IntelFrameworkModulePkg/Universal/StatusCode/RuntimeDxe/SerialStatusCodeWorker.c @@ -14,33 +14,6 @@ #include "StatusCodeRuntimeDxe.h"
-EFI_SERIAL_IO_PROTOCOL *mSerialIoProtocol;
-
-/**
- Locates Serial I/O Protocol as initialization for serial status code worker.
-
- @retval EFI_SUCCESS Serial I/O Protocol is successfully located.
-
-**/
-EFI_STATUS
-EfiSerialStatusCodeInitializeWorker (
- VOID
- )
-{
- EFI_STATUS Status;
-
- Status = gBS->LocateProtocol (
- &gEfiSerialIoProtocolGuid,
- NULL,
- (VOID **) &mSerialIoProtocol
- );
-
- ASSERT_EFI_ERROR (Status);
-
- return EFI_SUCCESS;
-}
-
-
/**
Convert status code value and extended data to readable ASCII string, send string to serial I/O device.
@@ -78,15 +51,6 @@ SerialStatusCodeReportWorker ( UINTN CharCount;
BASE_LIST Marker;
- if (FeaturePcdGet (PcdStatusCodeUseEfiSerial)) {
- if (EfiAtRuntime ()) {
- return EFI_DEVICE_ERROR;
- }
- if (EfiGetCurrentTpl () > TPL_CALLBACK ) {
- return EFI_DEVICE_ERROR;
- }
- }
-
Buffer[0] = '\0';
if (Data != NULL &&
@@ -174,20 +138,10 @@ SerialStatusCodeReportWorker ( );
}
-
- if (FeaturePcdGet (PcdStatusCodeUseHardSerial)) {
- //
- // Call SerialPort Lib function to do print.
- //
- SerialPortWrite ((UINT8 *) Buffer, CharCount);
- }
- if (FeaturePcdGet (PcdStatusCodeUseEfiSerial)) {
- mSerialIoProtocol->Write (
- mSerialIoProtocol,
- &CharCount,
- Buffer
- );
- }
+ //
+ // Call SerialPort Lib function to do print.
+ //
+ SerialPortWrite ((UINT8 *) Buffer, CharCount);
return EFI_SUCCESS;
}
diff --git a/IntelFrameworkModulePkg/Universal/StatusCode/RuntimeDxe/StatusCodeRuntimeDxe.c b/IntelFrameworkModulePkg/Universal/StatusCode/RuntimeDxe/StatusCodeRuntimeDxe.c index 12651153f5..eb193c8e6e 100644 --- a/IntelFrameworkModulePkg/Universal/StatusCode/RuntimeDxe/StatusCodeRuntimeDxe.c +++ b/IntelFrameworkModulePkg/Universal/StatusCode/RuntimeDxe/StatusCodeRuntimeDxe.c @@ -119,7 +119,7 @@ ReportDispatcher ( return EFI_DEVICE_ERROR;
}
- if (FeaturePcdGet (PcdStatusCodeUseEfiSerial) || FeaturePcdGet (PcdStatusCodeUseHardSerial)) {
+ if (FeaturePcdGet (PcdStatusCodeUseSerial)) {
SerialStatusCodeReportWorker (
CodeType,
Value,
@@ -128,7 +128,7 @@ ReportDispatcher ( Data
);
}
- if (FeaturePcdGet (PcdStatusCodeUseRuntimeMemory)) {
+ if (FeaturePcdGet (PcdStatusCodeUseMemory)) {
RtMemoryStatusCodeReportWorker (
CodeType,
Value,
@@ -214,18 +214,14 @@ InitializationDispatcherWorker ( // if enable UseRuntimeMemory, then initialize runtime memory status code worker.
// if enable UseDataHub, then initialize data hub status code worker.
//
- if (FeaturePcdGet (PcdStatusCodeUseEfiSerial)) {
- Status = EfiSerialStatusCodeInitializeWorker ();
- ASSERT_EFI_ERROR (Status);
- }
- if (FeaturePcdGet (PcdStatusCodeUseHardSerial)) {
+ if (FeaturePcdGet (PcdStatusCodeUseSerial)) {
//
// Call Serial Port Lib API to initialize serial port.
//
Status = SerialPortInitialize ();
ASSERT_EFI_ERROR (Status);
}
- if (FeaturePcdGet (PcdStatusCodeUseRuntimeMemory)) {
+ if (FeaturePcdGet (PcdStatusCodeUseMemory)) {
Status = RtMemoryStatusCodeInitializeWorker ();
ASSERT_EFI_ERROR (Status);
}
@@ -244,82 +240,78 @@ InitializationDispatcherWorker ( //
// Replay Status code which saved in GUID'ed HOB to all supported devices.
//
-
- //
- // 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) {
- 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 (PcdStatusCodeReplayInSerial) &&
- (FeaturePcdGet (PcdStatusCodeUseHardSerial) ||
- FeaturePcdGet (PcdStatusCodeUseEfiSerial))) {
- SerialStatusCodeReportWorker (
- Record[Index].CodeType,
- Record[Index].Value,
- Record[Index].Instance,
- NULL,
- NULL
- );
- }
- if (FeaturePcdGet (PcdStatusCodeReplayInRuntimeMemory) &&
- FeaturePcdGet (PcdStatusCodeUseRuntimeMemory)) {
- RtMemoryStatusCodeReportWorker (
- Record[Index].CodeType,
- Record[Index].Value,
- Record[Index].Instance
- );
- }
- if (FeaturePcdGet (PcdStatusCodeReplayInDataHub) &&
- FeaturePcdGet (PcdStatusCodeUseDataHub)) {
- DataHubStatusCodeReportWorker (
- Record[Index].CodeType,
- Record[Index].Value,
- Record[Index].Instance,
- NULL,
- NULL
- );
- }
- if (FeaturePcdGet (PcdStatusCodeReplayInOEM) &&
- FeaturePcdGet (PcdStatusCodeUseOEM)) {
+ if (FeaturePcdGet (PcdStatusCodeReplayIn)) {
+ //
+ // 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) {
+ 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++) {
//
- // Call OEM hook status code library API to report status code to OEM device
+ // Dispatch records to devices based on feature flag.
//
- OemHookStatusCodeReport (
- Record[Index].CodeType,
- Record[Index].Value,
- Record[Index].Instance,
- NULL,
- NULL
- );
+ 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
+ );
+ }
+ if (FeaturePcdGet (PcdStatusCodeUseDataHub)) {
+ DataHubStatusCodeReportWorker (
+ Record[Index].CodeType,
+ Record[Index].Value,
+ Record[Index].Instance,
+ NULL,
+ NULL
+ );
+ }
+ if (FeaturePcdGet (PcdStatusCodeUseOEM)) {
+ //
+ // Call OEM hook status code library API to report status code to OEM device
+ //
+ OemHookStatusCodeReport (
+ Record[Index].CodeType,
+ Record[Index].Value,
+ Record[Index].Instance,
+ NULL,
+ NULL
+ );
+ }
}
+ ExpectedPacketIndex++;
+
+ //
+ // See whether there is gap of packet or not
+ //
+ if (HobStart != NULL) {
+ HobStart = NULL;
+ Hob.Raw = HobStart;
+ continue;
+ }
+ } else if (HobStart != NULL) {
+ //
+ // Cache the found packet for improve the performance
+ //
+ HobStart = Hob.Raw;
}
- ExpectedPacketIndex++;
-
- //
- // See whether there is gap of packet or not
- //
- if (HobStart != NULL) {
- HobStart = NULL;
- Hob.Raw = HobStart;
- continue;
- }
- } else if (HobStart != NULL) {
- //
- // Cache the found packet for improve the performance
- //
- HobStart = Hob.Raw;
+
+ Hob.Raw = GetNextGuidHob (&gMemoryStatusCodeRecordGuid, Hob.Raw);
}
-
- Hob.Raw = GetNextGuidHob (&gMemoryStatusCodeRecordGuid, Hob.Raw);
}
}
diff --git a/IntelFrameworkModulePkg/Universal/StatusCode/RuntimeDxe/StatusCodeRuntimeDxe.inf b/IntelFrameworkModulePkg/Universal/StatusCode/RuntimeDxe/StatusCodeRuntimeDxe.inf index 1163ff75ae..69382aee01 100644 --- a/IntelFrameworkModulePkg/Universal/StatusCode/RuntimeDxe/StatusCodeRuntimeDxe.inf +++ b/IntelFrameworkModulePkg/Universal/StatusCode/RuntimeDxe/StatusCodeRuntimeDxe.inf @@ -71,23 +71,16 @@ [Protocols]
gEfiStatusCodeRuntimeProtocolGuid ## PRODUCES
gEfiDataHubProtocolGuid ## SOMETIMES_CONSUMES (Needed if Data Hub is supported for status code.)
- gEfiSerialIoProtocolGuid ## SOMETIMES_CONSUMES (Needed if Serial is supported for status code.)
-
-[FeaturePcd.common]
- gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdStatusCodeReplayInOEM
- gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdStatusCodeReplayInRuntimeMemory
- gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdStatusCodeReplayInDataHub
- gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdStatusCodeReplayInSerial
+[FeaturePcd]
+ gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdStatusCodeReplayIn
gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdStatusCodeUseOEM
gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdStatusCodeUseDataHub
- gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdStatusCodeUseRuntimeMemory
- gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdStatusCodeUseEfiSerial
- gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdStatusCodeUseHardSerial
-
+ gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdStatusCodeUseMemory
+ gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdStatusCodeUseSerial
-[Pcd.common]
- gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdStatusCodeRuntimeMemorySize
+[Pcd]
+ gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdStatusCodeMemorySize |128| PcdStatusCodeUseMemory
[Depex]
TRUE
\ No newline at end of file |