23#define MAX_DEBUG_MESSAGE_LENGTH 0x100
28#define WRITE_TIMEOUT 1000
38extern BOOLEAN mPostEBS;
64 if (mDebugPort ==
NULL) {
65 Status = mDebugBS->LocateProtocol (&gEfiDebugPortProtocolGuid,
NULL, (VOID **)&mDebugPort);
66 if (EFI_ERROR (Status)) {
70 mDebugPort->Reset (mDebugPort);
76 while (BufferLength > 0) {
77 Length = BufferLength;
79 Status = mDebugPort->Write (mDebugPort, WRITE_TIMEOUT, &Length, (VOID *)Buffer);
80 if (EFI_ERROR (Status) || (BufferLength < Length)) {
85 BufferLength -= Length;
145 CHAR8 Buffer[MAX_DEBUG_MESSAGE_LENGTH];
151 ASSERT (Format !=
NULL);
163 if (BaseListMarker ==
NULL) {
164 AsciiVSPrint (Buffer,
sizeof (Buffer), Format, VaListMarker);
166 AsciiBSPrint (Buffer,
sizeof (Buffer), Format, BaseListMarker);
261 CHAR8 Buffer[MAX_DEBUG_MESSAGE_LENGTH];
270 "ASSERT [%a] %a(%d): %a\n",
285 if ((
PcdGet8 (PcdDebugPropertyMask) & DEBUG_PROPERTY_ASSERT_BREAKPOINT_ENABLED) != 0) {
287 }
else if ((
PcdGet8 (PcdDebugPropertyMask) & DEBUG_PROPERTY_ASSERT_DEADLOOP_ENABLED) != 0) {
318 ASSERT (Buffer !=
NULL);
323 return SetMem (Buffer, Length,
PcdGet8 (PcdDebugClearMemoryValue));
342 return (BOOLEAN)((
PcdGet8 (PcdDebugPropertyMask) & DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED) != 0);
361 return (BOOLEAN)((
PcdGet8 (PcdDebugPropertyMask) & DEBUG_PROPERTY_DEBUG_PRINT_ENABLED) != 0);
380 return (BOOLEAN)((
PcdGet8 (PcdDebugPropertyMask) & DEBUG_PROPERTY_DEBUG_CODE_ENABLED) != 0);
399 return (BOOLEAN)((
PcdGet8 (PcdDebugPropertyMask) & DEBUG_PROPERTY_CLEAR_MEMORY_ENABLED) != 0);
417 return (BOOLEAN)((ErrorLevel &
PcdGet32 (PcdFixedDebugPrintErrorLevel)) != 0);
VOID EFIAPI DebugAssert(IN CONST CHAR8 *FileName, IN UINTN LineNumber, IN CONST CHAR8 *Description)
VOID EFIAPI DebugVPrint(IN UINTN ErrorLevel, IN CONST CHAR8 *Format, IN VA_LIST VaListMarker)
VOID DebugPrintMarker(IN UINTN ErrorLevel, IN CONST CHAR8 *Format, IN VA_LIST VaListMarker, IN BASE_LIST BaseListMarker)
VOID EFIAPI DebugBPrint(IN UINTN ErrorLevel, IN CONST CHAR8 *Format, IN BASE_LIST BaseListMarker)
VOID *EFIAPI DebugClearMemory(OUT VOID *Buffer, IN UINTN Length)
VOID EFIAPI DebugPrint(IN UINTN ErrorLevel, IN CONST CHAR8 *Format,...)
BOOLEAN EFIAPI DebugCodeEnabled(VOID)
BOOLEAN EFIAPI DebugClearMemoryEnabled(VOID)
BOOLEAN EFIAPI DebugPrintEnabled(VOID)
BOOLEAN EFIAPI DebugAssertEnabled(VOID)
BOOLEAN EFIAPI DebugPrintLevelEnabled(IN CONST UINTN ErrorLevel)
UINTN EFIAPI AsciiStrLen(IN CONST CHAR8 *String)
VOID EFIAPI CpuDeadLoop(VOID)
VOID EFIAPI CpuBreakpoint(VOID)
VOID *EFIAPI SetMem(OUT VOID *Buffer, IN UINTN Length, IN UINT8 Value)
UINT32 EFIAPI GetDebugPrintErrorLevel(VOID)
UINTN EFIAPI AsciiBSPrint(OUT CHAR8 *StartOfBuffer, IN UINTN BufferSize, IN CONST CHAR8 *FormatString, IN BASE_LIST Marker)
UINTN EFIAPI AsciiVSPrint(OUT CHAR8 *StartOfBuffer, IN UINTN BufferSize, IN CONST CHAR8 *FormatString, IN VA_LIST Marker)
UINTN EFIAPI AsciiSPrint(OUT CHAR8 *StartOfBuffer, IN UINTN BufferSize, IN CONST CHAR8 *FormatString,...)
#define VA_START(Marker, Parameter)
VOID UefiDebugLibDebugPortProtocolWrite(IN CONST CHAR8 *Buffer, IN UINTN BufferLength)
#define PcdGet8(TokenName)
#define PcdGet32(TokenName)