X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=MdePkg%2FInclude%2FLibrary%2FDebugLib.h;h=93b6f8df34aeef08fb4c3d626f26c251dfe10aad;hb=772fb7cb13de5e18f04e8a19b97d2949f9dc7054;hp=bbc974a3755782f2d41ac4e9fe6d2697ef1ec6e8;hpb=af2dc6a70b9380d702bd0720cdb029d630c505e3;p=mirror_edk2.git diff --git a/MdePkg/Include/Library/DebugLib.h b/MdePkg/Include/Library/DebugLib.h index bbc974a375..93b6f8df34 100644 --- a/MdePkg/Include/Library/DebugLib.h +++ b/MdePkg/Include/Library/DebugLib.h @@ -8,7 +8,7 @@ of size reduction when compiler optimization is disabled. If MDEPKG_NDEBUG is defined, then debug and assert related macros wrapped by it are the NULL implementations. -Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved
+Copyright (c) 2006 - 2015, 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 that accompanies this distribution. The full text of the license may be found at @@ -39,17 +39,21 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. #define DEBUG_WARN 0x00000002 // Warnings #define DEBUG_LOAD 0x00000004 // Load events #define DEBUG_FS 0x00000008 // EFI File system -#define DEBUG_POOL 0x00000010 // Alloc & Free's -#define DEBUG_PAGE 0x00000020 // Alloc & Free's -#define DEBUG_INFO 0x00000040 // Verbose -#define DEBUG_DISPATCH 0x00000080 // PEI/DXE Dispatchers +#define DEBUG_POOL 0x00000010 // Alloc & Free (pool) +#define DEBUG_PAGE 0x00000020 // Alloc & Free (page) +#define DEBUG_INFO 0x00000040 // Informational debug messages +#define DEBUG_DISPATCH 0x00000080 // PEI/DXE/SMM Dispatchers #define DEBUG_VARIABLE 0x00000100 // Variable #define DEBUG_BM 0x00000400 // Boot Manager #define DEBUG_BLKIO 0x00001000 // BlkIo Driver -#define DEBUG_NET 0x00004000 // SNI Driver +#define DEBUG_NET 0x00004000 // SNP Driver #define DEBUG_UNDI 0x00010000 // UNDI Driver -#define DEBUG_LOADFILE 0x00020000 // UNDI Driver +#define DEBUG_LOADFILE 0x00020000 // LoadFile #define DEBUG_EVENT 0x00080000 // Event messages +#define DEBUG_GCD 0x00100000 // Global Coherency Database changes +#define DEBUG_CACHE 0x00200000 // Memory range cachability changes +#define DEBUG_VERBOSE 0x00400000 // Detailed debug messages that may + // significantly impact boot performance #define DEBUG_ERROR 0x80000000 // Error // @@ -70,14 +74,15 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. #define EFI_D_UNDI DEBUG_UNDI #define EFI_D_LOADFILE DEBUG_LOADFILE #define EFI_D_EVENT DEBUG_EVENT +#define EFI_D_VERBOSE DEBUG_VERBOSE #define EFI_D_ERROR DEBUG_ERROR /** Prints a debug message to the debug output device if the specified error level is enabled. - If any bit in ErrorLevel is also set in PcdDebugPrintErrorLevel, then print - the message specified by Format and the associated variable argument list to - the debug output device. + If any bit in ErrorLevel is also set in DebugPrintErrorLevelLib function + GetDebugPrintErrorLevel (), then print the message specified by Format and the + associated variable argument list to the debug output device. If Format is NULL, then ASSERT(). @@ -216,6 +221,20 @@ DebugClearMemoryEnabled ( VOID ); +/** + Returns TRUE if any one of the bit is set both in ErrorLevel and PcdFixedDebugPrintErrorLevel. + + This function compares the bit mask of ErrorLevel and PcdFixedDebugPrintErrorLevel. + + @retval TRUE Current ErrorLevel is supported. + @retval FALSE Current ErrorLevel is not supported. + +**/ +BOOLEAN +EFIAPI +DebugPrintLevelEnabled ( + IN CONST UINTN ErrorLevel + ); /** Internal worker macro that calls DebugAssert(). @@ -234,13 +253,25 @@ DebugClearMemoryEnabled ( This macro calls DebugPrint() passing in the debug error level, a format string, and a variable argument list. + __VA_ARGS__ is not supported by EBC compiler, Microsoft Visual Studio .NET 2003 + and Microsoft Windows Server 2003 Driver Development Kit (Microsoft WINDDK) version 3790.1830. @param Expression Expression containing an error level, a format string, and a variable argument list based on the format string. **/ -#define _DEBUG(Expression) DebugPrint Expression +#if !defined(MDE_CPU_EBC) && (!defined (_MSC_VER) || _MSC_VER > 1400) + #define _DEBUG_PRINT(PrintLevel, ...) \ + do { \ + if (DebugPrintLevelEnabled (PrintLevel)) { \ + DebugPrint (PrintLevel, ##__VA_ARGS__); \ + } \ + } while (FALSE) + #define _DEBUG(Expression) _DEBUG_PRINT Expression +#else +#define _DEBUG(Expression) DebugPrint Expression +#endif /** Macro that calls DebugAssert() if an expression evaluates to FALSE.