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
This commit is contained in:
@ -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
|
||||
);
|
||||
|
Reference in New Issue
Block a user