X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=MdePkg%2FLibrary%2FUefiDebugLibStdErr%2FDebugLib.c;h=ca4e56e98dced3b793d20c5ac9dfc2baf73e8455;hb=479b520d551323a41f4a59b47949e285a7a007ce;hp=7acbee59008c771f8911e513631f91ff958f5995;hpb=878ddf1fc3540a715f63594ed22b6929e881afb4;p=mirror_edk2.git
diff --git a/MdePkg/Library/UefiDebugLibStdErr/DebugLib.c b/MdePkg/Library/UefiDebugLibStdErr/DebugLib.c
index 7acbee5900..ca4e56e98d 100644
--- a/MdePkg/Library/UefiDebugLibStdErr/DebugLib.c
+++ b/MdePkg/Library/UefiDebugLibStdErr/DebugLib.c
@@ -1,7 +1,7 @@
/** @file
UEFI Debug Library that uses PrintLib to send messages to STDERR.
- Copyright (c) 2006, Intel Corporation
+ Copyright (c) 2006 - 2007, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -12,6 +12,23 @@
**/
+//
+// The package level header files this module uses
+//
+#include
+//
+// The protocols, PPI and GUID defintions for this module
+//
+//
+// The Library classes this module consumes
+//
+#include
+#include
+#include
+#include
+#include
+#include
+
//
// Define the maximum debug and assert message length that this library supports
//
@@ -35,8 +52,8 @@
VOID
EFIAPI
DebugPrint (
- IN UINTN ErrorLevel,
- IN CHAR8 *Format,
+ IN UINTN ErrorLevel,
+ IN CONST CHAR8 *Format,
...
)
{
@@ -65,7 +82,7 @@ DebugPrint (
//
// Send the print string to the Standard Error device
//
- if (gST->StdErr != NULL) {
+ if ((gST != NULL) && (gST->StdErr != NULL)) {
gST->StdErr->OutputString (gST->StdErr, Buffer);
}
}
@@ -76,7 +93,7 @@ DebugPrint (
Prints an assert message containing a filename, line number, and description.
This may be followed by a breakpoint or a dead loop.
- Print a message of the form ASSERT (): \n
+ Print a message of the form "ASSERT (): \n"
to the debug output device. If DEBUG_PROPERTY_ASSERT_BREAKPOINT_ENABLED bit of
PcdDebugProperyMask is set then CpuBreakpoint() is called. Otherwise, if
DEBUG_PROPERTY_ASSERT_DEADLOOP_ENABLED bit of PcdDebugProperyMask is set then
@@ -85,9 +102,9 @@ DebugPrint (
DebugAssert() must actively prevent recusrsion. If DebugAssert() is called while
processing another DebugAssert(), then DebugAssert() must return immediately.
- If FileName is NULL, then a string of (NULL) Filename is printed.
+ If FileName is NULL, then a string of "(NULL) Filename" is printed.
- If Description is NULL, then a string of (NULL) Description is printed.
+ If Description is NULL, then a string of "(NULL) Description" is printed.
@param FileName Pointer to the name of the source file that generated the assert condition.
@param LineNumber The line number in the source file that generated the assert condition
@@ -97,9 +114,9 @@ DebugPrint (
VOID
EFIAPI
DebugAssert (
- IN CHAR8 *FileName,
- IN INTN LineNumber,
- IN CHAR8 *Description
+ IN CONST CHAR8 *FileName,
+ IN UINTN LineNumber,
+ IN CONST CHAR8 *Description
)
{
CHAR16 Buffer[MAX_DEBUG_MESSAGE_LENGTH];
@@ -112,7 +129,7 @@ DebugAssert (
//
// Send the print string to the Standard Error device
//
- if (gST->StdErr != NULL) {
+ if ((gST != NULL) && (gST->StdErr != NULL)) {
gST->StdErr->OutputString (gST->StdErr, Buffer);
}
@@ -136,7 +153,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.
@@ -180,7 +197,7 @@ DebugAssertEnabled (
VOID
)
{
- return ((PcdGet8(PcdDebugPropertyMask) & DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED) != 0);
+ return (BOOLEAN) ((PcdGet8(PcdDebugPropertyMask) & DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED) != 0);
}
@@ -201,7 +218,7 @@ DebugPrintEnabled (
VOID
)
{
- return ((PcdGet8(PcdDebugPropertyMask) & DEBUG_PROPERTY_DEBUG_PRINT_ENABLED) != 0);
+ return (BOOLEAN) ((PcdGet8(PcdDebugPropertyMask) & DEBUG_PROPERTY_DEBUG_PRINT_ENABLED) != 0);
}
@@ -222,7 +239,7 @@ DebugCodeEnabled (
VOID
)
{
- return ((PcdGet8(PcdDebugPropertyMask) & DEBUG_PROPERTY_DEBUG_CODE_ENABLED) != 0);
+ return (BOOLEAN) ((PcdGet8(PcdDebugPropertyMask) & DEBUG_PROPERTY_DEBUG_CODE_ENABLED) != 0);
}
@@ -243,5 +260,5 @@ DebugClearMemoryEnabled (
VOID
)
{
- return ((PcdGet8(PcdDebugPropertyMask) & DEBUG_PROPERTY_CLEAR_MEMORY_ENABLED) != 0);
+ return (BOOLEAN) ((PcdGet8(PcdDebugPropertyMask) & DEBUG_PROPERTY_CLEAR_MEMORY_ENABLED) != 0);
}