diff options
author | erictian <erictian@6f19259b-4bc3-4df7-8a09-765794883524> | 2010-02-02 03:21:46 +0000 |
---|---|---|
committer | erictian <erictian@6f19259b-4bc3-4df7-8a09-765794883524> | 2010-02-02 03:21:46 +0000 |
commit | 5ee9264acc861940b79497f17d7e49b5c8af3731 (patch) | |
tree | 432dd2d9f1f4ec3d8a62e850c33677909f2f1916 /MdePkg/Include/Library/UefiLib.h | |
parent | d228526f931a51694919a65867310606e64611a5 (diff) | |
download | edk2-platforms-5ee9264acc861940b79497f17d7e49b5c8af3731.tar.xz |
wrap ASSERT_LOCKED macro with MDEPKG_NDEBUG.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9907 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdePkg/Include/Library/UefiLib.h')
-rw-r--r-- | MdePkg/Include/Library/UefiLib.h | 38 |
1 files changed, 24 insertions, 14 deletions
diff --git a/MdePkg/Include/Library/UefiLib.h b/MdePkg/Include/Library/UefiLib.h index 56352dbf30..60ba7ff1e7 100644 --- a/MdePkg/Include/Library/UefiLib.h +++ b/MdePkg/Include/Library/UefiLib.h @@ -8,7 +8,11 @@ EFI Driver Model related protocols, manage Unicode string tables for UEFI Drivers,
and print messages on the console output and standard error devices.
-Copyright (c) 2006 - 2008, Intel Corporation<BR>
+ Note that a reserved macro named MDEPKG_NDEBUG is introduced for the intention
+ 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<BR>
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -280,24 +284,30 @@ EfiInitializeLock ( /**
Macro that calls DebugAssert() if an EFI_LOCK structure is not in the locked state.
- If the DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit of PcdDebugProperyMask is set,
- then this macro evaluates the EFI_LOCK structure specified by Lock. If Lock
- is not in the locked state, then DebugAssert() is called passing in the source
- filename, source line number, and Lock.
+ If MDEPKG_NDEBUG is not defined and the DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED
+ bit of PcdDebugProperyMask is set, then this macro evaluates the EFI_LOCK
+ structure specified by Lock. If Lock is not in the locked state, then
+ DebugAssert() is called passing in the source filename, source line number,
+ and Lock.
+
If Lock is NULL, then ASSERT().
@param LockParameter A pointer to the lock to acquire.
**/
-#define ASSERT_LOCKED(LockParameter) \
- do { \
- if (DebugAssertEnabled ()) { \
- ASSERT (LockParameter != NULL); \
- if ((LockParameter)->Lock != EfiLockAcquired) { \
- _ASSERT (LockParameter not locked); \
- } \
- } \
- } while (FALSE)
+#if !defined(MDEPKG_NDEBUG)
+ #define ASSERT_LOCKED(LockParameter) \
+ do { \
+ if (DebugAssertEnabled ()) { \
+ ASSERT (LockParameter != NULL); \
+ if ((LockParameter)->Lock != EfiLockAcquired) { \
+ _ASSERT (LockParameter not locked); \
+ } \
+ } \
+ } while (FALSE)
+#else
+ #define ASSERT_LOCKED(LockParameter)
+#endif
/**
|