diff options
| author | Warner Losh <imp@FreeBSD.org> | 2024-11-30 19:36:15 +0000 |
|---|---|---|
| committer | Warner Losh <imp@FreeBSD.org> | 2024-11-30 19:38:23 +0000 |
| commit | 5d8674f2bdd536124b1dd026dfa729a1376b3cac (patch) | |
| tree | ade665e8d0ce42d3068d4b00dae9171f47f3cd06 /MdePkg/Library/UefiDebugLibConOut/DebugLib.c | |
| parent | 4a14dfcc1110b35118d5be8054fecf59ffb83032 (diff) | |
Diffstat (limited to 'MdePkg/Library/UefiDebugLibConOut/DebugLib.c')
| -rw-r--r-- | MdePkg/Library/UefiDebugLibConOut/DebugLib.c | 56 |
1 files changed, 23 insertions, 33 deletions
diff --git a/MdePkg/Library/UefiDebugLibConOut/DebugLib.c b/MdePkg/Library/UefiDebugLibConOut/DebugLib.c index d95d60eebe23..70ef2272db29 100644 --- a/MdePkg/Library/UefiDebugLibConOut/DebugLib.c +++ b/MdePkg/Library/UefiDebugLibConOut/DebugLib.c @@ -24,10 +24,10 @@ // VA_LIST can not initialize to NULL for all compiler, so we use this to // indicate a null VA_LIST // -VA_LIST mVaListNull; +VA_LIST mVaListNull; -extern BOOLEAN mPostEBS; -extern EFI_SYSTEM_TABLE *mDebugST; +extern BOOLEAN mPostEBS; +extern EFI_SYSTEM_TABLE *mDebugST; /** Prints a debug message to the debug output device if the specified error level is enabled. @@ -59,7 +59,6 @@ DebugPrint ( VA_END (Marker); } - /** Prints a debug message to the debug output device if the specified error level is enabled base on Null-terminated format string and a @@ -79,13 +78,13 @@ DebugPrint ( **/ VOID DebugPrintMarker ( - IN UINTN ErrorLevel, - IN CONST CHAR8 *Format, - IN VA_LIST VaListMarker, - IN BASE_LIST BaseListMarker + IN UINTN ErrorLevel, + IN CONST CHAR8 *Format, + IN VA_LIST VaListMarker, + IN BASE_LIST BaseListMarker ) { - CHAR16 Buffer[MAX_DEBUG_MESSAGE_LENGTH]; + CHAR16 Buffer[MAX_DEBUG_MESSAGE_LENGTH]; if (!mPostEBS) { // @@ -109,7 +108,6 @@ DebugPrintMarker ( UnicodeBSPrintAsciiFormat (Buffer, sizeof (Buffer), Format, BaseListMarker); } - // // Send the print string to the Console Output device // @@ -119,7 +117,6 @@ DebugPrintMarker ( } } - /** Prints a debug message to the debug output device if the specified error level is enabled. @@ -138,15 +135,14 @@ DebugPrintMarker ( VOID EFIAPI DebugVPrint ( - IN UINTN ErrorLevel, - IN CONST CHAR8 *Format, - IN VA_LIST VaListMarker + IN UINTN ErrorLevel, + IN CONST CHAR8 *Format, + IN VA_LIST VaListMarker ) { DebugPrintMarker (ErrorLevel, Format, VaListMarker, NULL); } - /** Prints a debug message to the debug output device if the specified error level is enabled. @@ -167,15 +163,14 @@ DebugVPrint ( VOID EFIAPI DebugBPrint ( - IN UINTN ErrorLevel, - IN CONST CHAR8 *Format, - IN BASE_LIST BaseListMarker + IN UINTN ErrorLevel, + IN CONST CHAR8 *Format, + IN BASE_LIST BaseListMarker ) { DebugPrintMarker (ErrorLevel, Format, mVaListNull, BaseListMarker); } - /** Prints an assert message containing a filename, line number, and description. This may be followed by a breakpoint or a dead loop. @@ -233,15 +228,14 @@ DebugAssert ( // // Generate a Breakpoint, DeadLoop, or NOP based on PCD settings // - if ((PcdGet8(PcdDebugPropertyMask) & DEBUG_PROPERTY_ASSERT_BREAKPOINT_ENABLED) != 0) { + if ((PcdGet8 (PcdDebugPropertyMask) & DEBUG_PROPERTY_ASSERT_BREAKPOINT_ENABLED) != 0) { CpuBreakpoint (); - } else if ((PcdGet8(PcdDebugPropertyMask) & DEBUG_PROPERTY_ASSERT_DEADLOOP_ENABLED) != 0) { + } else if ((PcdGet8 (PcdDebugPropertyMask) & DEBUG_PROPERTY_ASSERT_DEADLOOP_ENABLED) != 0) { CpuDeadLoop (); } } } - /** Fills a target buffer with PcdDebugClearMemoryValue, and returns the target buffer. @@ -272,10 +266,9 @@ DebugClearMemory ( // // SetMem() checks for the the ASSERT() condition on Length and returns Buffer // - return SetMem (Buffer, Length, PcdGet8(PcdDebugClearMemoryValue)); + return SetMem (Buffer, Length, PcdGet8 (PcdDebugClearMemoryValue)); } - /** Returns TRUE if ASSERT() macros are enabled. @@ -292,10 +285,9 @@ DebugAssertEnabled ( VOID ) { - return (BOOLEAN) ((PcdGet8(PcdDebugPropertyMask) & DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED) != 0); + return (BOOLEAN)((PcdGet8 (PcdDebugPropertyMask) & DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED) != 0); } - /** Returns TRUE if DEBUG() macros are enabled. @@ -312,10 +304,9 @@ DebugPrintEnabled ( VOID ) { - return (BOOLEAN) ((PcdGet8(PcdDebugPropertyMask) & DEBUG_PROPERTY_DEBUG_PRINT_ENABLED) != 0); + return (BOOLEAN)((PcdGet8 (PcdDebugPropertyMask) & DEBUG_PROPERTY_DEBUG_PRINT_ENABLED) != 0); } - /** Returns TRUE if DEBUG_CODE() macros are enabled. @@ -332,10 +323,9 @@ DebugCodeEnabled ( VOID ) { - return (BOOLEAN) ((PcdGet8(PcdDebugPropertyMask) & DEBUG_PROPERTY_DEBUG_CODE_ENABLED) != 0); + return (BOOLEAN)((PcdGet8 (PcdDebugPropertyMask) & DEBUG_PROPERTY_DEBUG_CODE_ENABLED) != 0); } - /** Returns TRUE if DEBUG_CLEAR_MEMORY() macro is enabled. @@ -352,7 +342,7 @@ DebugClearMemoryEnabled ( VOID ) { - return (BOOLEAN) ((PcdGet8(PcdDebugPropertyMask) & DEBUG_PROPERTY_CLEAR_MEMORY_ENABLED) != 0); + return (BOOLEAN)((PcdGet8 (PcdDebugPropertyMask) & DEBUG_PROPERTY_CLEAR_MEMORY_ENABLED) != 0); } /** @@ -367,8 +357,8 @@ DebugClearMemoryEnabled ( BOOLEAN EFIAPI DebugPrintLevelEnabled ( - IN CONST UINTN ErrorLevel + IN CONST UINTN ErrorLevel ) { - return (BOOLEAN) ((ErrorLevel & PcdGet32(PcdFixedDebugPrintErrorLevel)) != 0); + return (BOOLEAN)((ErrorLevel & PcdGet32 (PcdFixedDebugPrintErrorLevel)) != 0); } |
