#include <Uefi.h>\r
\r
#include <Library/DebugLib.h>\r
-#include <Library/UefiBootServicesTableLib.h>\r
#include <Library/PrintLib.h>\r
#include <Library/PcdLib.h>\r
#include <Library/BaseLib.h>\r
//\r
VA_LIST mVaListNull;\r
\r
+extern BOOLEAN mPostEBS;\r
+extern EFI_SYSTEM_TABLE *mDebugST;\r
\r
/**\r
Prints a debug message to the debug output device if the specified error level is enabled.\r
{\r
CHAR16 Buffer[MAX_DEBUG_MESSAGE_LENGTH];\r
\r
- //\r
- // If Format is NULL, then ASSERT().\r
- //\r
- ASSERT (Format != NULL);\r
-\r
- //\r
- // Check driver debug mask value and global mask\r
- //\r
- if ((ErrorLevel & GetDebugPrintErrorLevel ()) == 0) {\r
- return;\r
- }\r
-\r
- //\r
- // Convert the DEBUG() message to a Unicode String\r
- //\r
- if (BaseListMarker == NULL) {\r
- UnicodeVSPrintAsciiFormat (Buffer, MAX_DEBUG_MESSAGE_LENGTH, Format, VaListMarker);\r
- } else {\r
- UnicodeBSPrintAsciiFormat (Buffer, MAX_DEBUG_MESSAGE_LENGTH, Format, BaseListMarker);\r
- }\r
-\r
- //\r
- // Send the print string to the Standard Error device\r
- //\r
- if ((gST != NULL) && (gST->StdErr != NULL)) {\r
- gST->StdErr->OutputString (gST->StdErr, Buffer);\r
+ if (!mPostEBS) {\r
+ //\r
+ // If Format is NULL, then ASSERT().\r
+ //\r
+ ASSERT (Format != NULL);\r
+\r
+ //\r
+ // Check driver debug mask value and global mask\r
+ //\r
+ if ((ErrorLevel & GetDebugPrintErrorLevel ()) == 0) {\r
+ return;\r
+ }\r
+\r
+ //\r
+ // Convert the DEBUG() message to a Unicode String\r
+ //\r
+ if (BaseListMarker == NULL) {\r
+ UnicodeVSPrintAsciiFormat (Buffer, MAX_DEBUG_MESSAGE_LENGTH, Format, VaListMarker);\r
+ } else {\r
+ UnicodeBSPrintAsciiFormat (Buffer, MAX_DEBUG_MESSAGE_LENGTH, Format, BaseListMarker);\r
+ }\r
+\r
+ //\r
+ // Send the print string to the Standard Error device\r
+ //\r
+ if ((mDebugST != NULL) && (mDebugST->StdErr != NULL)) {\r
+ mDebugST->StdErr->OutputString (mDebugST->StdErr, Buffer);\r
+ }\r
}\r
}\r
\r
{\r
CHAR16 Buffer[MAX_DEBUG_MESSAGE_LENGTH];\r
\r
- //\r
- // Generate the ASSERT() message in Unicode format\r
- //\r
- UnicodeSPrintAsciiFormat (\r
- Buffer,\r
- sizeof (Buffer),\r
- "ASSERT [%a] %a(%d): %a\n",\r
- gEfiCallerBaseName,\r
- FileName,\r
- LineNumber,\r
- Description\r
- );\r
-\r
- //\r
- // Send the print string to the Standard Error device\r
- //\r
- if ((gST != NULL) && (gST->StdErr != NULL)) {\r
- gST->StdErr->OutputString (gST->StdErr, Buffer);\r
- }\r
-\r
- //\r
- // Generate a Breakpoint, DeadLoop, or NOP based on PCD settings\r
- //\r
- if ((PcdGet8(PcdDebugPropertyMask) & DEBUG_PROPERTY_ASSERT_BREAKPOINT_ENABLED) != 0) {\r
- CpuBreakpoint ();\r
- } else if ((PcdGet8(PcdDebugPropertyMask) & DEBUG_PROPERTY_ASSERT_DEADLOOP_ENABLED) != 0) {\r
- CpuDeadLoop ();\r
+ if (!mPostEBS) {\r
+ //\r
+ // Generate the ASSERT() message in Unicode format\r
+ //\r
+ UnicodeSPrintAsciiFormat (\r
+ Buffer,\r
+ sizeof (Buffer),\r
+ "ASSERT [%a] %a(%d): %a\n",\r
+ gEfiCallerBaseName,\r
+ FileName,\r
+ LineNumber,\r
+ Description\r
+ );\r
+\r
+ //\r
+ // Send the print string to the Standard Error device\r
+ //\r
+ if ((mDebugST != NULL) && (mDebugST->StdErr != NULL)) {\r
+ mDebugST->StdErr->OutputString (mDebugST->StdErr, Buffer);\r
+ }\r
+\r
+ //\r
+ // Generate a Breakpoint, DeadLoop, or NOP based on PCD settings\r
+ //\r
+ if ((PcdGet8(PcdDebugPropertyMask) & DEBUG_PROPERTY_ASSERT_BREAKPOINT_ENABLED) != 0) {\r
+ CpuBreakpoint ();\r
+ } else if ((PcdGet8(PcdDebugPropertyMask) & DEBUG_PROPERTY_ASSERT_DEADLOOP_ENABLED) != 0) {\r
+ CpuDeadLoop ();\r
+ }\r
}\r
}\r
\r