#define DEBUG_CACHE 0x00200000 // Memory range cachability changes\r
#define DEBUG_VERBOSE 0x00400000 // Detailed debug messages that may\r
// significantly impact boot performance\r
-#define DEBUG_ERROR 0x80000000 // Error\r
+#define DEBUG_ERROR 0x80000000 // Error\r
\r
//\r
// Aliases of debug message mask bits\r
...\r
);\r
\r
-\r
/**\r
Prints a debug message to the debug output device if the specified\r
error level is enabled.\r
VOID\r
EFIAPI\r
DebugVPrint (\r
- IN UINTN ErrorLevel,\r
- IN CONST CHAR8 *Format,\r
- IN VA_LIST VaListMarker\r
+ IN UINTN ErrorLevel,\r
+ IN CONST CHAR8 *Format,\r
+ IN VA_LIST VaListMarker\r
);\r
\r
-\r
/**\r
Prints a debug message to the debug output device if the specified\r
error level is enabled.\r
VOID\r
EFIAPI\r
DebugBPrint (\r
- IN UINTN ErrorLevel,\r
- IN CONST CHAR8 *Format,\r
- IN BASE_LIST BaseListMarker\r
+ IN UINTN ErrorLevel,\r
+ IN CONST CHAR8 *Format,\r
+ IN BASE_LIST BaseListMarker\r
);\r
\r
-\r
/**\r
Prints an assert message containing a filename, line number, and description.\r
This may be followed by a breakpoint or a dead loop.\r
IN CONST CHAR8 *Description\r
);\r
\r
-\r
/**\r
Fills a target buffer with PcdDebugClearMemoryValue, and returns the target buffer.\r
\r
IN UINTN Length\r
);\r
\r
-\r
/**\r
Returns TRUE if ASSERT() macros are enabled.\r
\r
VOID\r
);\r
\r
-\r
/**\r
Returns TRUE if DEBUG() macros are enabled.\r
\r
VOID\r
);\r
\r
-\r
/**\r
Returns TRUE if DEBUG_CODE() macros are enabled.\r
\r
VOID\r
);\r
\r
-\r
/**\r
Returns TRUE if DEBUG_CLEAR_MEMORY() macro is enabled.\r
\r
BOOLEAN\r
EFIAPI\r
DebugPrintLevelEnabled (\r
- IN CONST UINTN ErrorLevel\r
+ IN CONST UINTN ErrorLevel\r
);\r
\r
/**\r
\r
**/\r
#if defined (EDKII_UNIT_TEST_FRAMEWORK_ENABLED)\r
+\r
/**\r
Unit test library replacement for DebugAssert() in DebugLib.\r
\r
IN CONST CHAR8 *Description\r
);\r
\r
-#if defined(__clang__) && defined(__FILE_NAME__)\r
+ #if defined (_ASSERT)\r
+ #undef _ASSERT\r
+ #endif\r
+ #if defined (__clang__) && defined (__FILE_NAME__)\r
#define _ASSERT(Expression) UnitTestDebugAssert (__FILE_NAME__, DEBUG_LINE_NUMBER, DEBUG_EXPRESSION_STRING (Expression))\r
-#else\r
+ #else\r
#define _ASSERT(Expression) UnitTestDebugAssert (__FILE__, DEBUG_LINE_NUMBER, DEBUG_EXPRESSION_STRING (Expression))\r
-#endif\r
+ #endif\r
#else\r
-#if defined(__clang__) && defined(__FILE_NAME__)\r
+ #if defined (__clang__) && defined (__FILE_NAME__)\r
#define _ASSERT(Expression) DebugAssert (__FILE_NAME__, DEBUG_LINE_NUMBER, DEBUG_EXPRESSION_STRING (Expression))\r
-#else\r
+ #else\r
#define _ASSERT(Expression) DebugAssert (__FILE__, DEBUG_LINE_NUMBER, DEBUG_EXPRESSION_STRING (Expression))\r
-#endif\r
+ #endif\r
#endif\r
\r
/**\r
\r
**/\r
\r
-#if !defined(MDE_CPU_EBC) && (!defined (_MSC_VER) || _MSC_VER > 1400)\r
- #define _DEBUG_PRINT(PrintLevel, ...) \\r
+#if !defined (MDE_CPU_EBC) && (!defined (_MSC_VER) || _MSC_VER > 1400)\r
+#define _DEBUG_PRINT(PrintLevel, ...) \\r
do { \\r
if (DebugPrintLevelEnabled (PrintLevel)) { \\r
DebugPrint (PrintLevel, ##__VA_ARGS__); \\r
} \\r
} while (FALSE)\r
- #define _DEBUG(Expression) _DEBUG_PRINT Expression\r
+#define _DEBUG(Expression) _DEBUG_PRINT Expression\r
#else\r
-#define _DEBUG(Expression) DebugPrint Expression\r
+#define _DEBUG(Expression) DebugPrint Expression\r
#endif\r
\r
/**\r
@param Expression Boolean expression.\r
\r
**/\r
-#if !defined(MDEPKG_NDEBUG)\r
- #define ASSERT(Expression) \\r
+#if !defined (MDEPKG_NDEBUG)\r
+#define ASSERT(Expression) \\r
do { \\r
if (DebugAssertEnabled ()) { \\r
if (!(Expression)) { \\r
} \\r
} while (FALSE)\r
#else\r
- #define ASSERT(Expression)\r
+#define ASSERT(Expression)\r
#endif\r
\r
/**\r
\r
\r
**/\r
-#if !defined(MDEPKG_NDEBUG)\r
- #define DEBUG(Expression) \\r
+#if !defined (MDEPKG_NDEBUG)\r
+#define DEBUG(Expression) \\r
do { \\r
if (DebugPrintEnabled ()) { \\r
_DEBUG (Expression); \\r
} \\r
} while (FALSE)\r
#else\r
- #define DEBUG(Expression)\r
+#define DEBUG(Expression)\r
#endif\r
\r
/**\r
@param StatusParameter EFI_STATUS value to evaluate.\r
\r
**/\r
-#if !defined(MDEPKG_NDEBUG)\r
- #define ASSERT_EFI_ERROR(StatusParameter) \\r
+#if !defined (MDEPKG_NDEBUG)\r
+#define ASSERT_EFI_ERROR(StatusParameter) \\r
do { \\r
if (DebugAssertEnabled ()) { \\r
if (EFI_ERROR (StatusParameter)) { \\r
- DEBUG ((EFI_D_ERROR, "\nASSERT_EFI_ERROR (Status = %r)\n", StatusParameter)); \\r
+ DEBUG ((DEBUG_ERROR, "\nASSERT_EFI_ERROR (Status = %r)\n", StatusParameter)); \\r
_ASSERT (!EFI_ERROR (StatusParameter)); \\r
} \\r
} \\r
} while (FALSE)\r
#else\r
- #define ASSERT_EFI_ERROR(StatusParameter)\r
+#define ASSERT_EFI_ERROR(StatusParameter)\r
#endif\r
\r
/**\r
@param StatusParameter RETURN_STATUS value to evaluate.\r
\r
**/\r
-#if !defined(MDEPKG_NDEBUG)\r
- #define ASSERT_RETURN_ERROR(StatusParameter) \\r
+#if !defined (MDEPKG_NDEBUG)\r
+#define ASSERT_RETURN_ERROR(StatusParameter) \\r
do { \\r
if (DebugAssertEnabled ()) { \\r
if (RETURN_ERROR (StatusParameter)) { \\r
} \\r
} while (FALSE)\r
#else\r
- #define ASSERT_RETURN_ERROR(StatusParameter)\r
+#define ASSERT_RETURN_ERROR(StatusParameter)\r
#endif\r
\r
/**\r
@param Guid The pointer to a protocol GUID.\r
\r
**/\r
-#if !defined(MDEPKG_NDEBUG)\r
- #define ASSERT_PROTOCOL_ALREADY_INSTALLED(Handle, Guid) \\r
+#if !defined (MDEPKG_NDEBUG)\r
+#define ASSERT_PROTOCOL_ALREADY_INSTALLED(Handle, Guid) \\r
do { \\r
if (DebugAssertEnabled ()) { \\r
VOID *Instance; \\r
} \\r
} while (FALSE)\r
#else\r
- #define ASSERT_PROTOCOL_ALREADY_INSTALLED(Handle, Guid)\r
+#define ASSERT_PROTOCOL_ALREADY_INSTALLED(Handle, Guid)\r
#endif\r
\r
/**\r
**/\r
#define DEBUG_CODE_BEGIN() do { if (DebugCodeEnabled ()) { UINT8 __DebugCodeLocal\r
\r
-\r
/**\r
The macro that marks the end of debug source code.\r
\r
are not included in a module.\r
\r
**/\r
-#define DEBUG_CODE_END() __DebugCodeLocal = 0; __DebugCodeLocal++; } } while (FALSE)\r
-\r
+#define DEBUG_CODE_END() __DebugCodeLocal = 0; __DebugCodeLocal++; } } while (FALSE)\r
\r
/**\r
The macro that declares a section of debug source code.\r
Expression \\r
DEBUG_CODE_END ()\r
\r
-\r
/**\r
The macro that calls DebugClearMemory() to clear a buffer to a default value.\r
\r
} \\r
} while (FALSE)\r
\r
-\r
/**\r
Macro that calls DebugAssert() if the containing record does not have a\r
matching signature. If the signatures matches, then a pointer to the data\r
@param TestSignature The 32-bit signature value to match.\r
\r
**/\r
-#if !defined(MDEPKG_NDEBUG)\r
- #define CR(Record, TYPE, Field, TestSignature) \\r
+#if !defined (MDEPKG_NDEBUG)\r
+#define CR(Record, TYPE, Field, TestSignature) \\r
(DebugAssertEnabled () && (BASE_CR (Record, TYPE, Field)->Signature != TestSignature)) ? \\r
(TYPE *) (_ASSERT (CR has Bad Signature), Record) : \\r
BASE_CR (Record, TYPE, Field)\r
#else\r
- #define CR(Record, TYPE, Field, TestSignature) \\r
+#define CR(Record, TYPE, Field, TestSignature) \\r
BASE_CR (Record, TYPE, Field)\r
#endif\r
\r