/** @file
Serial I/O status code reporting worker.
Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
#include "StatusCodeHandlerPei.h"
/**
Convert status code value and extended data to readable ASCII string, send string to serial I/O device.
@param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
@param CodeType Indicates the type of status code being reported.
@param Value Describes the current status of a hardware or
software entity. This includes information about the class and
subclass that is used to classify the entity as well as an operation.
For progress codes, the operation is the current activity.
For error codes, it is the exception.For debug codes,it is not defined at this time.
@param Instance The enumeration of a hardware or software entity within
pairing. The instance differentiates between them. An instance of 0 indicates
that instance information is unavailable, not meaningful, or not relevant.
Valid instance numbers start with 1.
@param CallerId This optional parameter may be used to identify the caller.
This parameter allows the status code driver to apply different rules to
different callers.
@param Data This optional parameter may be used to pass additional data.
@retval EFI_SUCCESS Status code reported to serial I/O successfully.
**/
)
{
Buffer[0] = '\0';
//
// Print ASSERT() information into output buffer.
//
CharCount = AsciiSPrint (
sizeof (Buffer),
"\n\rPEI_ASSERT!: %a (%d): %a\n\r",
);
//
// Print DEBUG() information into output buffer.
//
sizeof (Buffer),
);
//
// Print ERROR information into output buffer.
//
CharCount = AsciiSPrint (
sizeof (Buffer),
"ERROR: C%x:V%x I%x",
);
CharCount += AsciiSPrint (
" %g",
);
}
CharCount += AsciiSPrint (
" %x",
);
}
CharCount += AsciiSPrint (
"\n\r"
);
//
// Print PROGRESS information into output buffer.
//
CharCount = AsciiSPrint (
sizeof (Buffer),
"PROGRESS CODE: V%x I%x\n\r",
);
//
// EFI_STATUS_CODE_STRING_DATA
//
CharCount = AsciiSPrint (
sizeof (Buffer),
"%a\n\r",
);
} else {
//
// Code type is not defined.
//
CharCount = AsciiSPrint (
sizeof (Buffer),
"Undefined: C%x:V%x I%x\n\r",
);
}
//
// Call SerialPort Lib function to do print.
//
return EFI_SUCCESS;
}