diff options
author | yshang1 <yshang1@6f19259b-4bc3-4df7-8a09-765794883524> | 2006-09-01 05:37:49 +0000 |
---|---|---|
committer | yshang1 <yshang1@6f19259b-4bc3-4df7-8a09-765794883524> | 2006-09-01 05:37:49 +0000 |
commit | a93763b74df753b3e8de6a49eea5cbd1116b2535 (patch) | |
tree | 129b53452c0d5e8cdfa215315af590cf70947b04 /EdkModulePkg | |
parent | 5f4eb6b6d5eb39012da23c16fdf3f9d988f9db06 (diff) | |
download | edk2-a93763b74df753b3e8de6a49eea5cbd1116b2535.tar.gz edk2-a93763b74df753b3e8de6a49eea5cbd1116b2535.tar.bz2 edk2-a93763b74df753b3e8de6a49eea5cbd1116b2535.zip |
Follow up tracker:
EDKT236, EDKT237, EDKT232, EDKT229 , EDKT233
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1418 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'EdkModulePkg')
13 files changed, 116 insertions, 36 deletions
diff --git a/EdkModulePkg/Include/Library/OemHookStatusCodeLib.h b/EdkModulePkg/Include/Library/OemHookStatusCodeLib.h index 2d172259f5..3de7551ceb 100644 --- a/EdkModulePkg/Include/Library/OemHookStatusCodeLib.h +++ b/EdkModulePkg/Include/Library/OemHookStatusCodeLib.h @@ -22,8 +22,11 @@ Initialize OEM status code device .
+
+ @return Status of initialization of OEM status code device.
+
**/
-VOID
+EFI_STATUS
EFIAPI
OemHookStatusCodeInitialize (
VOID
diff --git a/EdkModulePkg/Include/Library/SerialPortLib.h b/EdkModulePkg/Include/Library/SerialPortLib.h index 8fe04e9a7d..cda5ad17db 100644 --- a/EdkModulePkg/Include/Library/SerialPortLib.h +++ b/EdkModulePkg/Include/Library/SerialPortLib.h @@ -22,6 +22,8 @@ Programmed hardware of Serial port.
+ @return Status of Serial Port Device initialization.
+
**/
EFI_STATUS
EFIAPI
diff --git a/EdkModulePkg/Library/EdkOemHookStatusCodeLibNull/OemHookStatusCodeLibNull.c b/EdkModulePkg/Library/EdkOemHookStatusCodeLibNull/OemHookStatusCodeLibNull.c index 12988d01ba..98c98cc9d0 100644 --- a/EdkModulePkg/Library/EdkOemHookStatusCodeLibNull/OemHookStatusCodeLibNull.c +++ b/EdkModulePkg/Library/EdkOemHookStatusCodeLibNull/OemHookStatusCodeLibNull.c @@ -18,14 +18,16 @@ Initialize OEM status code device .
+ @return Always return EFI_SUCCESS.
+
**/
-VOID
+EFI_STATUS
EFIAPI
OemHookStatusCodeInitialize (
VOID
)
{
- return;
+ return EFI_SUCCESS;
}
/**
@@ -53,7 +55,7 @@ OemHookStatusCodeInitialize ( @param Data This optional parameter may be used to pass additional data
- @return The function always return EFI_SUCCESS.
+ @return The function always return EFI_UNSUPPORTED.
**/
EFI_STATUS
diff --git a/EdkModulePkg/Universal/StatusCode/Dxe/Common/DxeStatusCodeCommon.c b/EdkModulePkg/Universal/StatusCode/Dxe/Common/DxeStatusCodeCommon.c index 1249284d5d..06a4814375 100644 --- a/EdkModulePkg/Universal/StatusCode/Dxe/Common/DxeStatusCodeCommon.c +++ b/EdkModulePkg/Universal/StatusCode/Dxe/Common/DxeStatusCodeCommon.c @@ -52,7 +52,8 @@ ReportDispatcher ( //
// Declaration of status code protocol.
-//
+//
+STATIC
EFI_STATUS_CODE_PROTOCOL mEfiStatusCodeProtocol = {
ReportDispatcher
};
diff --git a/EdkModulePkg/Universal/StatusCode/Dxe/DataHubStatusCodeWorker.c b/EdkModulePkg/Universal/StatusCode/Dxe/DataHubStatusCodeWorker.c index 03095c3819..11793b52ae 100644 --- a/EdkModulePkg/Universal/StatusCode/Dxe/DataHubStatusCodeWorker.c +++ b/EdkModulePkg/Universal/StatusCode/Dxe/DataHubStatusCodeWorker.c @@ -18,14 +18,18 @@ //
// Initialize FIFO to cache records.
//
+STATIC
EFI_LOCK mFifoLock = EFI_INITIALIZE_LOCK_VARIABLE (EFI_TPL_HIGH_LEVEL);
+STATIC
LIST_ENTRY mRecordsFifo = INITIALIZE_LIST_HEAD_VARIABLE (mRecordsFifo);
+STATIC
UINTN mNumberOfRecords = 0;
-
+STATIC
EFI_EVENT mLogDataHubEvent;
//
// Cache data hub protocol.
//
+STATIC
EFI_DATA_HUB_PROTOCOL *mDataHubProtocol;
diff --git a/EdkModulePkg/Universal/StatusCode/Dxe/DxeStatusCode.c b/EdkModulePkg/Universal/StatusCode/Dxe/DxeStatusCode.c index e0acb1fd43..c119cf751b 100644 --- a/EdkModulePkg/Universal/StatusCode/Dxe/DxeStatusCode.c +++ b/EdkModulePkg/Universal/StatusCode/Dxe/DxeStatusCode.c @@ -40,6 +40,7 @@ InitializationDispatcherWorker ( )
{
EFI_PEI_HOB_POINTERS Hob;
+ EFI_STATUS Status;
MEMORY_STATUSCODE_PACKET_HEADER *PacketHeader;
MEMORY_STATUSCODE_RECORD *Record;
UINTN ExpectedPacketIndex = 0;
@@ -52,19 +53,24 @@ InitializationDispatcherWorker ( // if enable UseDataHub, then initialize data hub status code worker.
//
if (FeaturePcdGet (PcdStatusCodeUseEfiSerial)) {
- EfiSerialStatusCodeInitializeWorker ();
+ Status = EfiSerialStatusCodeInitializeWorker ();
+ ASSERT_EFI_ERROR (Status);
}
if (FeaturePcdGet (PcdStatusCodeUseHardSerial)) {
- SerialPortInitialize ();
+ Status = SerialPortInitialize ();
+ ASSERT_EFI_ERROR (Status);
}
if (FeaturePcdGet (PcdStatusCodeUseRuntimeMemory)) {
- RtMemoryStatusCodeInitializeWorker ();
+ Status = RtMemoryStatusCodeInitializeWorker ();
+ ASSERT_EFI_ERROR (Status);
}
if (FeaturePcdGet (PcdStatusCodeUseDataHub)) {
- DataHubStatusCodeInitializeWorker ();
+ Status = DataHubStatusCodeInitializeWorker ();
+ ASSERT_EFI_ERROR (Status);
}
if (FeaturePcdGet (PcdStatusCodeUseOEM)) {
- OemHookStatusCodeInitialize ();
+ Status = OemHookStatusCodeInitialize ();
+ ASSERT_EFI_ERROR (Status);
}
//
diff --git a/EdkModulePkg/Universal/StatusCode/Dxe/DxeStatusCode.msa b/EdkModulePkg/Universal/StatusCode/Dxe/DxeStatusCode.msa index 0443847c11..3eb28b19b9 100644 --- a/EdkModulePkg/Universal/StatusCode/Dxe/DxeStatusCode.msa +++ b/EdkModulePkg/Universal/StatusCode/Dxe/DxeStatusCode.msa @@ -120,6 +120,9 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. <GuidCName>gEfiStatusCodeDataTypeStringGuid</GuidCName>
</GuidCNames>
<GuidCNames Usage="SOMETIMES_CONSUMED">
+ <GuidCName>gEfiStatusCodeSpecificDataGuid</GuidCName>
+ </GuidCNames>
+ <GuidCNames Usage="SOMETIMES_CONSUMED">
<GuidCName>gEfiStatusCodeGuid</GuidCName>
</GuidCNames>
</Guids>
diff --git a/EdkModulePkg/Universal/StatusCode/Dxe/RtMemoryStatusCodeWorker.c b/EdkModulePkg/Universal/StatusCode/Dxe/RtMemoryStatusCodeWorker.c index 01cc172a46..c0c9edd939 100644 --- a/EdkModulePkg/Universal/StatusCode/Dxe/RtMemoryStatusCodeWorker.c +++ b/EdkModulePkg/Universal/StatusCode/Dxe/RtMemoryStatusCodeWorker.c @@ -34,7 +34,9 @@ RtMemoryStatusCodeInitializeWorker ( //
RtMemoryStatusCodeTable =
(RUNTIME_MEMORY_STATUSCODE_HEADER *) AllocatePool (
- sizeof (RUNTIME_MEMORY_STATUSCODE_HEADER) + PcdGet16 (PcdStatusCodeRuntimeMemorySize) * 1024
+ sizeof (RUNTIME_MEMORY_STATUSCODE_HEADER) +
+ PcdGet16 (PcdStatusCodeRuntimeMemorySize) *
+ 1024
);
ASSERT (NULL != RtMemoryStatusCodeTable);
@@ -111,7 +113,6 @@ RtMemoryStatusCodeReportWorker ( RtMemoryStatusCodeTable->RecordIndex = 0;
}
-
return EFI_SUCCESS;
}
diff --git a/EdkModulePkg/Universal/StatusCode/Dxe/SerialStatusCodeWorker.c b/EdkModulePkg/Universal/StatusCode/Dxe/SerialStatusCodeWorker.c index 256ff03b7a..a5fbf23678 100644 --- a/EdkModulePkg/Universal/StatusCode/Dxe/SerialStatusCodeWorker.c +++ b/EdkModulePkg/Universal/StatusCode/Dxe/SerialStatusCodeWorker.c @@ -15,7 +15,8 @@ **/
-EFI_SERIAL_IO_PROTOCOL *SerialIoProtocol;
+STATIC
+EFI_SERIAL_IO_PROTOCOL *mSerialIoProtocol;
/**
Initialize serial status code worker.
@@ -33,7 +34,7 @@ EfiSerialStatusCodeInitializeWorker ( Status = gBS->LocateProtocol (
&gEfiSerialIoProtocolGuid,
NULL,
- (VOID **) &SerialIoProtocol
+ (VOID **) &mSerialIoProtocol
);
ASSERT_EFI_ERROR (Status);
@@ -67,7 +68,8 @@ EfiSerialStatusCodeInitializeWorker ( @param Data This optional parameter may be used to pass additional data
- @return The function always return EFI_SUCCESS.
+ @retval EFI_SUCCESS Success to report status code to serial I/O.
+ @retval EFI_DEVICE_ERROR EFI serial device can not work after ExitBootService() is called .
**/
EFI_STATUS
@@ -89,6 +91,11 @@ SerialStatusCodeReportWorker ( VA_LIST Marker;
EFI_DEBUG_INFO *DebugInfo;
+
+ if (FeaturePcdGet (PcdStatusCodeUseEfiSerial) && EfiAtRuntime ()) {
+ return EFI_DEVICE_ERROR;
+ }
+
Buffer[0] = '\0';
if (Data != NULL &&
@@ -130,10 +137,18 @@ SerialStatusCodeReportWorker ( //
// Print ERROR information into output buffer.
//
- CharCount = AsciiSPrint (Buffer, EFI_STATUS_CODE_DATA_MAX_SIZE, "ERROR: C%x:V%x I%x", CodeType, Value, Instance);
+ CharCount = AsciiSPrint (
+ Buffer,
+ EFI_STATUS_CODE_DATA_MAX_SIZE,
+ "ERROR: C%x:V%x I%x",
+ CodeType,
+ Value,
+ Instance
+ );
//
- // Make sure we don't try to print values that weren't intended to be printed, especially NULL GUID pointers.
+ // Make sure we don't try to print values that weren't
+ // intended to be printed, especially NULL GUID pointers.
//
if (CallerId != NULL) {
@@ -145,7 +160,7 @@ SerialStatusCodeReportWorker ( );
}
- if (Data) {
+ if (Data != NULL) {
CharCount += AsciiSPrint (
&Buffer[CharCount - 1],
(EFI_STATUS_CODE_DATA_MAX_SIZE - (sizeof (Buffer[0]) * CharCount)),
@@ -160,9 +175,22 @@ SerialStatusCodeReportWorker ( "\n\r"
);
} else if ((CodeType & EFI_STATUS_CODE_TYPE_MASK) == EFI_PROGRESS_CODE) {
- CharCount = AsciiSPrint (Buffer, EFI_STATUS_CODE_DATA_MAX_SIZE, "PROGRESS CODE: V%x I%x\n\r", Value, Instance);
+ CharCount = AsciiSPrint (
+ Buffer,
+ EFI_STATUS_CODE_DATA_MAX_SIZE,
+ "PROGRESS CODE: V%x I%x\n\r",
+ Value,
+ Instance
+ );
} else {
- CharCount = AsciiSPrint (Buffer, EFI_STATUS_CODE_DATA_MAX_SIZE, "Undefined: C%x:V%x I%x\n\r", CodeType, Value, Instance);
+ CharCount = AsciiSPrint (
+ Buffer,
+ EFI_STATUS_CODE_DATA_MAX_SIZE,
+ "Undefined: C%x:V%x I%x\n\r",
+ CodeType,
+ Value,
+ Instance
+ );
}
@@ -173,8 +201,8 @@ SerialStatusCodeReportWorker ( SerialPortWrite ((UINT8 *) Buffer, CharCount);
}
if (FeaturePcdGet (PcdStatusCodeUseEfiSerial)) {
- SerialIoProtocol->Write (
- SerialIoProtocol,
+ mSerialIoProtocol->Write (
+ mSerialIoProtocol,
&CharCount,
Buffer
);
diff --git a/EdkModulePkg/Universal/StatusCode/Pei/MemoryStausCodeWorker.c b/EdkModulePkg/Universal/StatusCode/Pei/MemoryStausCodeWorker.c index bffcd3d71f..5614d80c6a 100644 --- a/EdkModulePkg/Universal/StatusCode/Pei/MemoryStausCodeWorker.c +++ b/EdkModulePkg/Universal/StatusCode/Pei/MemoryStausCodeWorker.c @@ -20,7 +20,7 @@ @param PacketIndex Index of records packet.
- @return The function always return EFI_SUCCESS
+ @return Always return pointer of memory status code packet.
**/
MEMORY_STATUSCODE_PACKET_HEADER *
@@ -36,7 +36,10 @@ CreateMemoryStatusCodePacket ( PacketHeader =
(MEMORY_STATUSCODE_PACKET_HEADER *) BuildGuidHob (
&gMemoryStatusCodeRecordGuid,
- (PcdGet16 (PcdStatusCodeMemorySize) * 1024) + sizeof (MEMORY_STATUSCODE_PACKET_HEADER));
+ PcdGet16 (PcdStatusCodeMemorySize) *
+ 1024 +
+ sizeof (MEMORY_STATUSCODE_PACKET_HEADER)
+ );
ASSERT (PacketHeader != NULL);
PacketHeader->MaxRecordsNumber = (PcdGet16 (PcdStatusCodeMemorySize) * 1024)/ sizeof (MEMORY_STATUSCODE_RECORD);
diff --git a/EdkModulePkg/Universal/StatusCode/Pei/PeiStatusCode.c b/EdkModulePkg/Universal/StatusCode/Pei/PeiStatusCode.c index 3de5f58cf3..bbe16c70cb 100644 --- a/EdkModulePkg/Universal/StatusCode/Pei/PeiStatusCode.c +++ b/EdkModulePkg/Universal/StatusCode/Pei/PeiStatusCode.c @@ -19,8 +19,8 @@ /**
Report status code to all supported device.
- *
- *
+
+
@param PeiServices
@param Type Indicates the type of status code being reported.
@@ -53,11 +53,12 @@ ReportDispatcher ( IN EFI_STATUS_CODE_DATA *Data OPTIONAL
);
-
+STATIC
EFI_PEI_PROGRESS_CODE_PPI mStatusCodePpi = {
ReportDispatcher
};
+STATIC
EFI_PEI_PPI_DESCRIPTOR mStatusCodePpiDescriptor = {
EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST,
&gEfiPeiStatusCodePpiGuid,
@@ -66,8 +67,8 @@ EFI_PEI_PPI_DESCRIPTOR mStatusCodePpiDescriptor = { /**
Report status code to all supported device.
- *
- *
+
+
@param PeiServices
@param CodeType Indicates the type of status code being reported.
@@ -154,13 +155,16 @@ PeiStatusCodeDriverEntry ( // if enable UseOEM, then initialize Oem status code.
//
if (FeaturePcdGet (PcdStatusCodeUseSerial)) {
- SerialPortInitialize();
+ Status = SerialPortInitialize();
+ ASSERT_EFI_ERROR (Status);
}
if (FeaturePcdGet (PcdStatusCodeUseMemory)) {
- MemoryStatusCodeInitializeWorker ();
+ Status = MemoryStatusCodeInitializeWorker ();
+ ASSERT_EFI_ERROR (Status);
}
if (FeaturePcdGet (PcdStatusCodeUseOEM)) {
- OemHookStatusCodeInitialize ();
+ Status = OemHookStatusCodeInitialize ();
+ ASSERT_EFI_ERROR (Status);
}
//
diff --git a/EdkModulePkg/Universal/StatusCode/Pei/PeiStatusCode.msa b/EdkModulePkg/Universal/StatusCode/Pei/PeiStatusCode.msa index 91579b8c9a..100b52a74d 100644 --- a/EdkModulePkg/Universal/StatusCode/Pei/PeiStatusCode.msa +++ b/EdkModulePkg/Universal/StatusCode/Pei/PeiStatusCode.msa @@ -75,6 +75,9 @@ <GuidCNames Usage="SOMETIMES_CONSUMED">
<GuidCName>gMemoryStatusCodeRecordGuid</GuidCName>
</GuidCNames>
+ <GuidCNames Usage="SOMETIMES_CONSUMED">
+ <GuidCName>gEfiStatusCodeSpecificDataGuid</GuidCName>
+ </GuidCNames>
</Guids>
<Externs>
<Specification>EFI_SPECIFICATION_VERSION 0x00020000</Specification>
diff --git a/EdkModulePkg/Universal/StatusCode/Pei/SerialStatusCodeWorker.c b/EdkModulePkg/Universal/StatusCode/Pei/SerialStatusCodeWorker.c index 3f4ed2ecaf..a5dbfa404b 100644 --- a/EdkModulePkg/Universal/StatusCode/Pei/SerialStatusCodeWorker.c +++ b/EdkModulePkg/Universal/StatusCode/Pei/SerialStatusCodeWorker.c @@ -103,7 +103,14 @@ SerialStatusCodeReportWorker ( //
// Print ERROR information into output buffer.
//
- CharCount = AsciiSPrint (Buffer, EFI_STATUS_CODE_DATA_MAX_SIZE, "ERROR: C%x:V%x I%x", CodeType, Value, Instance);
+ CharCount = AsciiSPrint (
+ Buffer,
+ EFI_STATUS_CODE_DATA_MAX_SIZE,
+ "ERROR: C%x:V%x I%x",
+ CodeType,
+ Value,
+ Instance
+ );
//
// Make sure we don't try to print values that weren't intended to be printed, especially NULL GUID pointers.
@@ -133,9 +140,22 @@ SerialStatusCodeReportWorker ( "\n\r"
);
} else if ((CodeType & EFI_STATUS_CODE_TYPE_MASK) == EFI_PROGRESS_CODE) {
- CharCount = AsciiSPrint (Buffer, EFI_STATUS_CODE_DATA_MAX_SIZE, "PROGRESS CODE: V%x I%x\n\r", Value, Instance);
+ CharCount = AsciiSPrint (
+ Buffer,
+ EFI_STATUS_CODE_DATA_MAX_SIZE,
+ "PROGRESS CODE: V%x I%x\n\r",
+ Value,
+ Instance
+ );
} else {
- CharCount = AsciiSPrint (Buffer, EFI_STATUS_CODE_DATA_MAX_SIZE, "Undefined: C%x:V%x I%x\n\r", CodeType, Value, Instance);
+ CharCount = AsciiSPrint (
+ Buffer,
+ EFI_STATUS_CODE_DATA_MAX_SIZE,
+ "Undefined: C%x:V%x I%x\n\r",
+ CodeType,
+ Value,
+ Instance
+ );
}
//
|