From 8a6da01b9b29e8caa11ff41bad498d29bf5a80ff Mon Sep 17 00:00:00 2001 From: Mikhail Krichanov Date: Wed, 1 Mar 2023 12:51:09 +0300 Subject: [PATCH] MdePkg: Moved DEBUG_RAISE() to DebugLib.h. --- MdePkg/Include/Base.h | 15 --------------- MdePkg/Include/Library/DebugLib.h | 15 +++++++++++++++ 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/MdePkg/Include/Base.h b/MdePkg/Include/Base.h index 88cefd0ab4..eef3dac121 100644 --- a/MdePkg/Include/Base.h +++ b/MdePkg/Include/Base.h @@ -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. diff --git a/MdePkg/Include/Library/DebugLib.h b/MdePkg/Include/Library/DebugLib.h index 554b7290d3..5b9a258176 100644 --- a/MdePkg/Include/Library/DebugLib.h +++ b/MdePkg/Include/Library/DebugLib.h @@ -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