]> git.proxmox.com Git - mirror_edk2.git/commitdiff
wrap ASSERT_LOCKED macro with MDEPKG_NDEBUG.
authorerictian <erictian@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 2 Feb 2010 03:21:46 +0000 (03:21 +0000)
committererictian <erictian@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 2 Feb 2010 03:21:46 +0000 (03:21 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9907 6f19259b-4bc3-4df7-8a09-765794883524

MdePkg/Include/Library/DebugLib.h
MdePkg/Include/Library/UefiLib.h

index 836d807dcfe1bc17d1393356412a9a0e0367b0f7..bf38fd8bf573506f905f368c2ef2e60611b6212b 100644 (file)
@@ -4,11 +4,11 @@
   The Debug library supports debug print and asserts based on a combination of macros and code.\r
   The debug library can be turned on and off so that the debug code does not increase the size of an image.\r
 \r
   The Debug library supports debug print and asserts based on a combination of macros and code.\r
   The debug library can be turned on and off so that the debug code does not increase the size of an image.\r
 \r
-  Note that a MDEPKG_NDEBUG macro is introduced to switch on/off debug and assert related macros.\r
-  1. If MDEPKG_NDEBUG is defined, then debug and assert related macros are NULL.\r
-  2. If MDEPKG_NDEBUG is not defined, then PcdDebugProperyMask is used to turn on/off these helper macros.\r
+  Note that a reserved macro named MDEPKG_NDEBUG is introduced for the intention\r
+  of size reduction when compiler optimization is disabled. If MDEPKG_NDEBUG is\r
+  defined, then debug and assert related macros wrapped by it are the NULL implementations.\r
 \r
 \r
-Copyright (c) 2006 - 2008, Intel Corporation<BR>\r
+Copyright (c) 2006 - 2010, Intel Corporation<BR>\r
 All rights reserved. This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
 All rights reserved. This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
index 56352dbf30bc5e68a0608c0d79bf174cb09d153d..60ba7ff1e77ff0e6d5f89700feb1c9033dca3ce7 100644 (file)
@@ -8,7 +8,11 @@
   EFI Driver Model related protocols, manage Unicode string tables for UEFI Drivers, \r
   and print messages on the console output and standard error devices.\r
 \r
   EFI Driver Model related protocols, manage Unicode string tables for UEFI Drivers, \r
   and print messages on the console output and standard error devices.\r
 \r
-Copyright (c) 2006 - 2008, Intel Corporation<BR>\r
+  Note that a reserved macro named MDEPKG_NDEBUG is introduced for the intention\r
+  of size reduction when compiler optimization is disabled. If MDEPKG_NDEBUG is\r
+  defined, then debug and assert related macros wrapped by it are the NULL implementations.\r
+\r
+Copyright (c) 2006 - 2010, Intel Corporation<BR>\r
 All rights reserved. This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
 All rights reserved. This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -280,24 +284,30 @@ EfiInitializeLock (
 /**\r
   Macro that calls DebugAssert() if an EFI_LOCK structure is not in the locked state.\r
 \r
 /**\r
   Macro that calls DebugAssert() if an EFI_LOCK structure is not in the locked state.\r
 \r
-  If the DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit of PcdDebugProperyMask is set, \r
-  then this macro evaluates the EFI_LOCK structure specified by Lock.  If Lock \r
-  is not in the locked state, then DebugAssert() is called passing in the source \r
-  filename, source line number, and Lock.\r
+  If MDEPKG_NDEBUG is not defined and the DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED \r
+  bit of PcdDebugProperyMask is set, then this macro evaluates the EFI_LOCK \r
+  structure specified by Lock.  If Lock is not in the locked state, then\r
+  DebugAssert() is called passing in the source filename, source line number, \r
+  and Lock.\r
+\r
   If Lock is NULL, then ASSERT().\r
 \r
   @param  LockParameter  A pointer to the lock to acquire.\r
 \r
 **/\r
   If Lock is NULL, then ASSERT().\r
 \r
   @param  LockParameter  A pointer to the lock to acquire.\r
 \r
 **/\r
-#define ASSERT_LOCKED(LockParameter)                  \\r
-  do {                                                \\r
-    if (DebugAssertEnabled ()) {                      \\r
-      ASSERT (LockParameter != NULL);                 \\r
-      if ((LockParameter)->Lock != EfiLockAcquired) { \\r
-        _ASSERT (LockParameter not locked);           \\r
-      }                                               \\r
-    }                                                 \\r
-  } while (FALSE)\r
+#if !defined(MDEPKG_NDEBUG)       \r
+  #define ASSERT_LOCKED(LockParameter)                  \\r
+    do {                                                \\r
+      if (DebugAssertEnabled ()) {                      \\r
+        ASSERT (LockParameter != NULL);                 \\r
+        if ((LockParameter)->Lock != EfiLockAcquired) { \\r
+          _ASSERT (LockParameter not locked);           \\r
+        }                                               \\r
+      }                                                 \\r
+    } while (FALSE)\r
+#else\r
+  #define ASSERT_LOCKED(LockParameter)\r
+#endif\r
 \r
 \r
 /**\r
 \r
 \r
 /**\r