summaryrefslogtreecommitdiffstats
path: root/MdePkg/Library/DxeRuntimeDebugLibSerialPort/DebugLib.c
diff options
context:
space:
mode:
Diffstat (limited to 'MdePkg/Library/DxeRuntimeDebugLibSerialPort/DebugLib.c')
-rw-r--r--MdePkg/Library/DxeRuntimeDebugLibSerialPort/DebugLib.c84
1 files changed, 43 insertions, 41 deletions
diff --git a/MdePkg/Library/DxeRuntimeDebugLibSerialPort/DebugLib.c b/MdePkg/Library/DxeRuntimeDebugLibSerialPort/DebugLib.c
index cc79843b1c..11d188d07f 100644
--- a/MdePkg/Library/DxeRuntimeDebugLibSerialPort/DebugLib.c
+++ b/MdePkg/Library/DxeRuntimeDebugLibSerialPort/DebugLib.c
@@ -20,8 +20,8 @@
#include <Library/BaseMemoryLib.h>
#include <Library/SerialPortLib.h>
-STATIC EFI_EVENT mEfiExitBootServicesEvent;
-STATIC BOOLEAN mEfiAtRuntime = FALSE;
+STATIC EFI_EVENT mEfiExitBootServicesEvent;
+STATIC BOOLEAN mEfiAtRuntime = FALSE;
//
// Define the maximum debug and assert message length that this library supports
@@ -32,7 +32,7 @@ STATIC BOOLEAN mEfiAtRuntime = FALSE;
// 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;
/**
Set AtRuntime flag as TRUE after ExitBootServices.
@@ -45,8 +45,8 @@ STATIC
VOID
EFIAPI
ExitBootServicesEvent (
- IN EFI_EVENT Event,
- IN VOID *Context
+ IN EFI_EVENT Event,
+ IN VOID *Context
)
{
mEfiAtRuntime = TRUE;
@@ -70,16 +70,20 @@ DxeRuntimeDebugLibSerialPortConstructor (
IN EFI_SYSTEM_TABLE *SystemTable
)
{
- EFI_STATUS Status;
+ EFI_STATUS Status;
Status = SerialPortInitialize ();
if (EFI_ERROR (Status)) {
return Status;
}
- return SystemTable->BootServices->CreateEvent (EVT_SIGNAL_EXIT_BOOT_SERVICES,
- TPL_NOTIFY, ExitBootServicesEvent, NULL,
- &mEfiExitBootServicesEvent);
+ return SystemTable->BootServices->CreateEvent (
+ EVT_SIGNAL_EXIT_BOOT_SERVICES,
+ TPL_NOTIFY,
+ ExitBootServicesEvent,
+ NULL,
+ &mEfiExitBootServicesEvent
+ );
}
/**
@@ -125,14 +129,13 @@ DebugPrint (
...
)
{
- VA_LIST Marker;
+ VA_LIST Marker;
VA_START (Marker, Format);
DebugVPrint (ErrorLevel, Format, Marker);
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
@@ -152,13 +155,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
)
{
- CHAR8 Buffer[MAX_DEBUG_MESSAGE_LENGTH];
+ CHAR8 Buffer[MAX_DEBUG_MESSAGE_LENGTH];
if (mEfiAtRuntime) {
return;
@@ -191,7 +194,6 @@ DebugPrintMarker (
SerialPortWrite ((UINT8 *)Buffer, AsciiStrLen (Buffer));
}
-
/**
Prints a debug message to the debug output device if the specified
error level is enabled.
@@ -210,15 +212,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.
@@ -239,15 +240,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.
@@ -282,8 +282,15 @@ DebugAssert (
//
// Generate the ASSERT() message in Ascii format
//
- AsciiSPrint (Buffer, sizeof (Buffer), "ASSERT [%a] %a(%d): %a\n",
- gEfiCallerBaseName, FileName, LineNumber, Description);
+ AsciiSPrint (
+ Buffer,
+ sizeof (Buffer),
+ "ASSERT [%a] %a(%d): %a\n",
+ gEfiCallerBaseName,
+ FileName,
+ LineNumber,
+ Description
+ );
if (!mEfiAtRuntime) {
//
@@ -295,14 +302,13 @@ 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.
@@ -333,10 +339,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.
@@ -353,10 +358,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.
@@ -373,10 +377,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.
@@ -393,10 +396,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.
@@ -413,7 +415,7 @@ DebugClearMemoryEnabled (
VOID
)
{
- return (BOOLEAN) ((PcdGet8(PcdDebugPropertyMask) & DEBUG_PROPERTY_CLEAR_MEMORY_ENABLED) != 0);
+ return (BOOLEAN)((PcdGet8 (PcdDebugPropertyMask) & DEBUG_PROPERTY_CLEAR_MEMORY_ENABLED) != 0);
}
/**
@@ -428,8 +430,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);
}