MdePkg: Moved DEBUG_RAISE() to DebugLib.h.

This commit is contained in:
Mikhail Krichanov 2023-03-01 12:51:09 +03:00 committed by MikhailKrichanov
parent 526c4b13ab
commit 8a6da01b9b
2 changed files with 15 additions and 15 deletions

View File

@ -885,21 +885,6 @@ STATIC_ASSERT (ALIGNOF (__VERIFY_UINT32_ENUM_SIZE) == sizeof (__VERIFY_UINT32_EN
**/
#define BASE_CR(Record, TYPE, Field) ((TYPE *) ((CHAR8 *) (Record) - OFFSET_OF (TYPE, Field)))
#define DEBUG_RAISE() \
do { \
if ((PcdGet8 (PcdDebugRaisePropertyMask) & DEBUG_PROPERTY_DEBUG_PRINT_ENABLED) != 0) { \
DEBUG ((DEBUG_WARN, "DEBUG RAISE: Constraint violation in %a:%a:%u\n", __FILE__, __func__, __LINE__));\
} \
\
if ((PcdGet8 (PcdDebugRaisePropertyMask) & DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED) != 0) { \
ASSERT (FALSE); \
} \
\
if ((PcdGet8 (PcdDebugRaisePropertyMask) & DEBUG_PROPERTY_ASSERT_BREAKPOINT_ENABLED) != 0) { \
CpuBreakpoint (); \
} \
} while (FALSE)
/**
Checks whether a value is a power of two.

View File

@ -608,6 +608,21 @@ UnitTestDebugAssert (
} \
} while (FALSE)
#define DEBUG_RAISE() \
do { \
if ((PcdGet8 (PcdDebugRaisePropertyMask) & DEBUG_PROPERTY_DEBUG_PRINT_ENABLED) != 0) { \
DEBUG ((DEBUG_WARN, "DEBUG RAISE: Constraint violation in %a:%a:%u\n", __FILE__, __func__, __LINE__));\
} \
\
if ((PcdGet8 (PcdDebugRaisePropertyMask) & DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED) != 0) { \
ASSERT (FALSE); \
} \
\
if ((PcdGet8 (PcdDebugRaisePropertyMask) & DEBUG_PROPERTY_ASSERT_BREAKPOINT_ENABLED) != 0) { \
CpuBreakpoint (); \
} \
} while (FALSE)
/**
Macro that calls DebugAssert() if the containing record does not have a
matching signature. If the signatures matches, then a pointer to the data