X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=MdePkg%2FLibrary%2FBaseDebugLibNull%2FDebugLib.c;h=1d3e719b0d15b7f9d892e4e53dd4e47422eb04ae;hb=e1f414b6a7d8a0424e0e01f655b09a4612b4d0e8;hp=9081b632d886bcb0e227795f8f4fbc6b071dd082;hpb=8960cdebac8c75f13f1cb6afa932f0ae323a138b;p=mirror_edk2.git diff --git a/MdePkg/Library/BaseDebugLibNull/DebugLib.c b/MdePkg/Library/BaseDebugLibNull/DebugLib.c index 9081b632d8..1d3e719b0d 100644 --- a/MdePkg/Library/BaseDebugLibNull/DebugLib.c +++ b/MdePkg/Library/BaseDebugLibNull/DebugLib.c @@ -13,9 +13,9 @@ **/ // -// Define the maximum debug and assert message length that this library supports +// Include common header file for this module. // -#define MAX_DEBUG_MESSAGE_LENGTH 0x100 +#include "CommonHeader.h" /** @@ -39,20 +39,6 @@ DebugPrint ( ... ) { - CHAR8 Buffer[MAX_DEBUG_MESSAGE_LENGTH]; - VA_LIST Marker; - - // - // If Format is NULL, then ASSERT(). - // - ASSERT (Format != NULL); - - // - // Print the assert message to a buffer - // - VA_START (Marker, Format); - AsciiVSPrint (Buffer, sizeof (Buffer), Format, Marker); - VA_END (Marker); } @@ -83,25 +69,10 @@ VOID EFIAPI DebugAssert ( IN CONST CHAR8 *FileName, - IN INTN LineNumber, + IN UINTN LineNumber, IN CONST CHAR8 *Description ) { - CHAR8 Buffer[MAX_DEBUG_MESSAGE_LENGTH]; - - // - // Print the assert message to a buffer - // - AsciiSPrint (Buffer, sizeof (Buffer), "ASSERT %s(%d): %s\n", FileName, LineNumber, Description); - - // - // Generate a Breakpoint, DeadLoop, or NOP based on PCD settings - // - if ((PcdGet8(PcdDebugPropertyMask) & DEBUG_PROPERTY_ASSERT_BREAKPOINT_ENABLED) != 0) { - CpuBreakpoint (); - } else if ((PcdGet8(PcdDebugPropertyMask) & DEBUG_PROPERTY_ASSERT_DEADLOOP_ENABLED) != 0) { - CpuDeadLoop (); - } } @@ -114,7 +85,7 @@ DebugAssert ( If Buffer is NULL, then ASSERT(). - If Length is greater than (MAX_ADDRESS – Buffer + 1), then ASSERT(). + If Length is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT(). @param Buffer Pointer to the target buffer to fill with PcdDebugClearMemoryValue. @param Length Number of bytes in Buffer to fill with zeros PcdDebugClearMemoryValue. @@ -129,15 +100,7 @@ DebugClearMemory ( IN UINTN Length ) { - // - // If Buffer is NULL, then ASSERT(). - // - ASSERT (Buffer != NULL); - - // - // SetMem() checks for the the ASSERT() condition on Length and returns Buffer - // - return SetMem (Buffer, Length, PcdGet8(PcdDebugClearMemoryValue)); + return Buffer; } @@ -158,7 +121,7 @@ DebugAssertEnabled ( VOID ) { - return ((PcdGet8(PcdDebugPropertyMask) & DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED) != 0); + return FALSE; } @@ -179,7 +142,7 @@ DebugPrintEnabled ( VOID ) { - return ((PcdGet8(PcdDebugPropertyMask) & DEBUG_PROPERTY_DEBUG_PRINT_ENABLED) != 0); + return FALSE; } @@ -200,7 +163,7 @@ DebugCodeEnabled ( VOID ) { - return ((PcdGet8(PcdDebugPropertyMask) & DEBUG_PROPERTY_DEBUG_CODE_ENABLED) != 0); + return FALSE; } @@ -221,5 +184,5 @@ DebugClearMemoryEnabled ( VOID ) { - return ((PcdGet8(PcdDebugPropertyMask) & DEBUG_PROPERTY_CLEAR_MEMORY_ENABLED) != 0); + return FALSE; }