]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdePkg/Include/Library/DebugLib.h
MdePkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / MdePkg / Include / Library / DebugLib.h
index b38a84724c95f12e80b6291155b0f32fa510ea1f..f1d55cf62b0e111bfbcace5a2aba8b48ffe90fed 100644 (file)
@@ -1,6 +1,6 @@
 /** @file\r
   Provides services to print debug and assert messages to a debug output device.\r
-  \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
@@ -8,14 +8,8 @@
   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 - 2015, Intel Corporation. All rights reserved.<BR>\r
-This program and the accompanying materials are licensed and made available under \r
-the terms and conditions of the BSD License that accompanies this distribution.  \r
-The full text of the license may be found at\r
-http://opensource.org/licenses/bsd-license.php.\r
-\r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.<BR>\r
+SPDX-License-Identifier: BSD-2-Clause-Patent\r
 \r
 **/\r
 \r
@@ -39,20 +33,21 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #define DEBUG_WARN      0x00000002  // Warnings\r
 #define DEBUG_LOAD      0x00000004  // Load events\r
 #define DEBUG_FS        0x00000008  // EFI File system\r
-#define DEBUG_POOL      0x00000010  // Alloc & Free's\r
-#define DEBUG_PAGE      0x00000020  // Alloc & Free's\r
+#define DEBUG_POOL      0x00000010  // Alloc & Free (pool)\r
+#define DEBUG_PAGE      0x00000020  // Alloc & Free (page)\r
 #define DEBUG_INFO      0x00000040  // Informational debug messages\r
 #define DEBUG_DISPATCH  0x00000080  // PEI/DXE/SMM Dispatchers\r
 #define DEBUG_VARIABLE  0x00000100  // Variable\r
 #define DEBUG_BM        0x00000400  // Boot Manager\r
 #define DEBUG_BLKIO     0x00001000  // BlkIo Driver\r
-#define DEBUG_NET       0x00004000  // SNI Driver\r
+#define DEBUG_NET       0x00004000  // Network Io Driver\r
 #define DEBUG_UNDI      0x00010000  // UNDI Driver\r
-#define DEBUG_LOADFILE  0x00020000  // UNDI Driver\r
+#define DEBUG_LOADFILE  0x00020000  // LoadFile\r
 #define DEBUG_EVENT     0x00080000  // Event messages\r
 #define DEBUG_GCD       0x00100000  // Global Coherency Database changes\r
 #define DEBUG_CACHE     0x00200000  // Memory range cachability changes\r
-#define DEBUG_VERBOSE   0x00400000  // Detailed debug messages that may significantly impact boot performance\r
+#define DEBUG_VERBOSE   0x00400000  // Detailed debug messages that may\r
+                                    // significantly impact boot performance\r
 #define DEBUG_ERROR     0x80000000  // Error\r
 \r
 //\r
@@ -79,15 +74,15 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 /**\r
   Prints a debug message to the debug output device if the specified error level is enabled.\r
 \r
-  If any bit in ErrorLevel is also set in DebugPrintErrorLevelLib function \r
-  GetDebugPrintErrorLevel (), then print the message specified by Format and the \r
+  If any bit in ErrorLevel is also set in DebugPrintErrorLevelLib function\r
+  GetDebugPrintErrorLevel (), then print the message specified by Format and the\r
   associated variable argument list to the debug output device.\r
 \r
   If Format is NULL, then ASSERT().\r
 \r
   @param  ErrorLevel  The error level of the debug message.\r
   @param  Format      The format string for the debug message to print.\r
-  @param  ...         The variable argument list whose contents are accessed \r
+  @param  ...         The variable argument list whose contents are accessed\r
                       based on the format string specified by Format.\r
 \r
 **/\r
@@ -101,14 +96,64 @@ DebugPrint (
 \r
 \r
 /**\r
-  Prints an assert message containing a filename, line number, and description.  \r
+  Prints a debug message to the debug output device if the specified\r
+  error level is enabled.\r
+\r
+  If any bit in ErrorLevel is also set in DebugPrintErrorLevelLib function\r
+  GetDebugPrintErrorLevel (), then print the message specified by Format and\r
+  the associated variable argument list to the debug output device.\r
+\r
+  If Format is NULL, then ASSERT().\r
+\r
+  @param  ErrorLevel    The error level of the debug message.\r
+  @param  Format        Format string for the debug message to print.\r
+  @param  VaListMarker  VA_LIST marker for the variable argument list.\r
+\r
+**/\r
+VOID\r
+EFIAPI\r
+DebugVPrint (\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
+  This function use BASE_LIST which would provide a more compatible\r
+  service than VA_LIST.\r
+\r
+  If any bit in ErrorLevel is also set in DebugPrintErrorLevelLib function\r
+  GetDebugPrintErrorLevel (), then print the message specified by Format and\r
+  the associated variable argument list to the debug output device.\r
+\r
+  If Format is NULL, then ASSERT().\r
+\r
+  @param  ErrorLevel      The error level of the debug message.\r
+  @param  Format          Format string for the debug message to print.\r
+  @param  BaseListMarker  BASE_LIST marker for the variable argument list.\r
+\r
+**/\r
+VOID\r
+EFIAPI\r
+DebugBPrint (\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
 \r
   Print a message of the form "ASSERT <FileName>(<LineNumber>): <Description>\n"\r
-  to the debug output device.  If DEBUG_PROPERTY_ASSERT_BREAKPOINT_ENABLED bit of \r
-  PcdDebugProperyMask is set then CpuBreakpoint() is called. Otherwise, if \r
-  DEBUG_PROPERTY_ASSERT_DEADLOOP_ENABLED bit of PcdDebugProperyMask is set then \r
-  CpuDeadLoop() is called.  If neither of these bits are set, then this function \r
+  to the debug output device.  If DEBUG_PROPERTY_ASSERT_BREAKPOINT_ENABLED bit of\r
+  PcdDebugProperyMask is set then CpuBreakpoint() is called. Otherwise, if\r
+  DEBUG_PROPERTY_ASSERT_DEADLOOP_ENABLED bit of PcdDebugProperyMask is set then\r
+  CpuDeadLoop() is called.  If neither of these bits are set, then this function\r
   returns immediately after the message is printed to the debug output device.\r
   DebugAssert() must actively prevent recursion.  If DebugAssert() is called while\r
   processing another DebugAssert(), then DebugAssert() must return immediately.\r
@@ -133,14 +178,14 @@ DebugAssert (
 /**\r
   Fills a target buffer with PcdDebugClearMemoryValue, and returns the target buffer.\r
 \r
-  This function fills Length bytes of Buffer with the value specified by \r
+  This function fills Length bytes of Buffer with the value specified by\r
   PcdDebugClearMemoryValue, and returns Buffer.\r
 \r
   If Buffer is NULL, then ASSERT().\r
-  If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). \r
+  If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().\r
 \r
   @param   Buffer  The pointer to the target buffer to be filled with PcdDebugClearMemoryValue.\r
-  @param   Length  The number of bytes in Buffer to fill with zeros PcdDebugClearMemoryValue. \r
+  @param   Length  The number of bytes in Buffer to fill with zeros PcdDebugClearMemoryValue.\r
 \r
   @return  Buffer  The pointer to the target buffer filled with PcdDebugClearMemoryValue.\r
 \r
@@ -156,7 +201,7 @@ DebugClearMemory (
 /**\r
   Returns TRUE if ASSERT() macros are enabled.\r
 \r
-  This function returns TRUE if the DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit of \r
+  This function returns TRUE if the DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit of\r
   PcdDebugProperyMask is set.  Otherwise, FALSE is returned.\r
 \r
   @retval  TRUE    The DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit of PcdDebugProperyMask is set.\r
@@ -170,10 +215,10 @@ DebugAssertEnabled (
   );\r
 \r
 \r
-/**  \r
+/**\r
   Returns TRUE if DEBUG() macros are enabled.\r
 \r
-  This function returns TRUE if the DEBUG_PROPERTY_DEBUG_PRINT_ENABLED bit of \r
+  This function returns TRUE if the DEBUG_PROPERTY_DEBUG_PRINT_ENABLED bit of\r
   PcdDebugProperyMask is set.  Otherwise, FALSE is returned.\r
 \r
   @retval  TRUE    The DEBUG_PROPERTY_DEBUG_PRINT_ENABLED bit of PcdDebugProperyMask is set.\r
@@ -187,10 +232,10 @@ DebugPrintEnabled (
   );\r
 \r
 \r
-/**  \r
+/**\r
   Returns TRUE if DEBUG_CODE() macros are enabled.\r
 \r
-  This function returns TRUE if the DEBUG_PROPERTY_DEBUG_CODE_ENABLED bit of \r
+  This function returns TRUE if the DEBUG_PROPERTY_DEBUG_CODE_ENABLED bit of\r
   PcdDebugProperyMask is set.  Otherwise, FALSE is returned.\r
 \r
   @retval  TRUE    The DEBUG_PROPERTY_DEBUG_CODE_ENABLED bit of PcdDebugProperyMask is set.\r
@@ -204,10 +249,10 @@ DebugCodeEnabled (
   );\r
 \r
 \r
-/**  \r
+/**\r
   Returns TRUE if DEBUG_CLEAR_MEMORY() macro is enabled.\r
 \r
-  This function returns TRUE if the DEBUG_PROPERTY_CLEAR_MEMORY_ENABLED bit of \r
+  This function returns TRUE if the DEBUG_PROPERTY_CLEAR_MEMORY_ENABLED bit of\r
   PcdDebugProperyMask is set.  Otherwise, FALSE is returned.\r
 \r
   @retval  TRUE    The DEBUG_PROPERTY_CLEAR_MEMORY_ENABLED bit of PcdDebugProperyMask is set.\r
@@ -235,7 +280,7 @@ DebugPrintLevelEnabled (
   IN  CONST UINTN        ErrorLevel\r
   );\r
 \r
-/**  \r
+/**\r
   Internal worker macro that calls DebugAssert().\r
 \r
   This macro calls DebugAssert(), passing in the filename, line number, and an\r
@@ -247,15 +292,15 @@ DebugPrintLevelEnabled (
 #define _ASSERT(Expression)  DebugAssert (__FILE__, __LINE__, #Expression)\r
 \r
 \r
-/**  \r
+/**\r
   Internal worker macro that calls DebugPrint().\r
 \r
-  This macro calls DebugPrint() passing in the debug error level, a format \r
+  This macro calls DebugPrint() passing in the debug error level, a format\r
   string, and a variable argument list.\r
-  __VA_ARGS__ is not supported by ECB compiler, Microsoft Visual Studio .NET 2003\r
+  __VA_ARGS__ is not supported by EBC compiler, Microsoft Visual Studio .NET 2003\r
   and Microsoft Windows Server 2003 Driver Development Kit (Microsoft WINDDK) version 3790.1830.\r
 \r
-  @param  Expression  Expression containing an error level, a format string, \r
+  @param  Expression  Expression containing an error level, a format string,\r
                       and a variable argument list based on the format string.\r
 \r
 **/\r
@@ -272,24 +317,25 @@ DebugPrintLevelEnabled (
 #define _DEBUG(Expression)   DebugPrint Expression\r
 #endif\r
 \r
-/**  \r
+/**\r
   Macro that calls DebugAssert() if an expression evaluates to FALSE.\r
 \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 Boolean \r
-  expression specified by Expression.  If Expression evaluates to FALSE, then \r
-  DebugAssert() is called passing in the source filename, source line number, \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 Boolean\r
+  expression specified by Expression.  If Expression evaluates to FALSE, then\r
+  DebugAssert() is called passing in the source filename, source line number,\r
   and Expression.\r
 \r
   @param  Expression  Boolean expression.\r
 \r
 **/\r
-#if !defined(MDEPKG_NDEBUG)       \r
+#if !defined(MDEPKG_NDEBUG)\r
   #define ASSERT(Expression)        \\r
     do {                            \\r
       if (DebugAssertEnabled ()) {  \\r
         if (!(Expression)) {        \\r
           _ASSERT (Expression);     \\r
+          ANALYZER_UNREACHABLE ();  \\r
         }                           \\r
       }                             \\r
     } while (FALSE)\r
@@ -297,19 +343,19 @@ DebugPrintLevelEnabled (
   #define ASSERT(Expression)\r
 #endif\r
 \r
-/**  \r
+/**\r
   Macro that calls DebugPrint().\r
 \r
-  If MDEPKG_NDEBUG is not defined and the DEBUG_PROPERTY_DEBUG_PRINT_ENABLED \r
-  bit of PcdDebugProperyMask is set, then this macro passes Expression to \r
+  If MDEPKG_NDEBUG is not defined and the DEBUG_PROPERTY_DEBUG_PRINT_ENABLED\r
+  bit of PcdDebugProperyMask is set, then this macro passes Expression to\r
   DebugPrint().\r
 \r
-  @param  Expression  Expression containing an error level, a format string, \r
+  @param  Expression  Expression containing an error level, a format string,\r
                       and a variable argument list based on the format string.\r
-  \r
+\r
 \r
 **/\r
-#if !defined(MDEPKG_NDEBUG)      \r
+#if !defined(MDEPKG_NDEBUG)\r
   #define DEBUG(Expression)        \\r
     do {                           \\r
       if (DebugPrintEnabled ()) {  \\r
@@ -320,13 +366,13 @@ DebugPrintLevelEnabled (
   #define DEBUG(Expression)\r
 #endif\r
 \r
-/**  \r
+/**\r
   Macro that calls DebugAssert() if an EFI_STATUS evaluates to an error code.\r
 \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_STATUS \r
-  value specified by StatusParameter.  If StatusParameter is an error code, \r
-  then DebugAssert() is called passing in the source filename, source line \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_STATUS\r
+  value specified by StatusParameter.  If StatusParameter is an error code,\r
+  then DebugAssert() is called passing in the source filename, source line\r
   number, and StatusParameter.\r
 \r
   @param  StatusParameter  EFI_STATUS value to evaluate.\r
@@ -346,23 +392,50 @@ DebugPrintLevelEnabled (
   #define ASSERT_EFI_ERROR(StatusParameter)\r
 #endif\r
 \r
-/**  \r
-  Macro that calls DebugAssert() if a protocol is already installed in the \r
+/**\r
+  Macro that calls DebugAssert() if a RETURN_STATUS evaluates to an error code.\r
+\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\r
+  RETURN_STATUS value specified by StatusParameter.  If StatusParameter is an\r
+  error code, then DebugAssert() is called passing in the source filename,\r
+  source line number, and StatusParameter.\r
+\r
+  @param  StatusParameter  RETURN_STATUS value to evaluate.\r
+\r
+**/\r
+#if !defined(MDEPKG_NDEBUG)\r
+  #define ASSERT_RETURN_ERROR(StatusParameter)                          \\r
+    do {                                                                \\r
+      if (DebugAssertEnabled ()) {                                      \\r
+        if (RETURN_ERROR (StatusParameter)) {                           \\r
+          DEBUG ((DEBUG_ERROR, "\nASSERT_RETURN_ERROR (Status = %r)\n", \\r
+            StatusParameter));                                          \\r
+          _ASSERT (!RETURN_ERROR (StatusParameter));                    \\r
+        }                                                               \\r
+      }                                                                 \\r
+    } while (FALSE)\r
+#else\r
+  #define ASSERT_RETURN_ERROR(StatusParameter)\r
+#endif\r
+\r
+/**\r
+  Macro that calls DebugAssert() if a protocol is already installed in the\r
   handle database.\r
 \r
-  If MDEPKG_NDEBUG is defined or the DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit \r
+  If MDEPKG_NDEBUG is defined or the DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit\r
   of PcdDebugProperyMask is clear, then return.\r
 \r
-  If Handle is NULL, then a check is made to see if the protocol specified by Guid \r
-  is present on any handle in the handle database.  If Handle is not NULL, then \r
-  a check is made to see if the protocol specified by Guid is present on the \r
-  handle specified by Handle.  If the check finds the protocol, then DebugAssert() \r
+  If Handle is NULL, then a check is made to see if the protocol specified by Guid\r
+  is present on any handle in the handle database.  If Handle is not NULL, then\r
+  a check is made to see if the protocol specified by Guid is present on the\r
+  handle specified by Handle.  If the check finds the protocol, then DebugAssert()\r
   is called passing in the source filename, source line number, and Guid.\r
 \r
   If Guid is NULL, then ASSERT().\r
 \r
-  @param  Handle  The handle to check for the protocol.  This is an optional \r
-                  parameter that may be NULL.  If it is NULL, then the entire \r
+  @param  Handle  The handle to check for the protocol.  This is an optional\r
+                  parameter that may be NULL.  If it is NULL, then the entire\r
                   handle database is searched.\r
 \r
   @param  Guid    The pointer to a protocol GUID.\r
@@ -392,32 +465,32 @@ DebugPrintLevelEnabled (
 /**\r
   Macro that marks the beginning of debug source code.\r
 \r
-  If the DEBUG_PROPERTY_DEBUG_CODE_ENABLED bit of PcdDebugProperyMask is set, \r
+  If the DEBUG_PROPERTY_DEBUG_CODE_ENABLED bit of PcdDebugProperyMask is set,\r
   then this macro marks the beginning of source code that is included in a module.\r
-  Otherwise, the source lines between DEBUG_CODE_BEGIN() and DEBUG_CODE_END() \r
+  Otherwise, the source lines between DEBUG_CODE_BEGIN() and DEBUG_CODE_END()\r
   are not included in a module.\r
 \r
 **/\r
 #define DEBUG_CODE_BEGIN()  do { if (DebugCodeEnabled ()) { UINT8  __DebugCodeLocal\r
 \r
 \r
-/**  \r
+/**\r
   The macro that marks the end of debug source code.\r
 \r
-  If the DEBUG_PROPERTY_DEBUG_CODE_ENABLED bit of PcdDebugProperyMask is set, \r
-  then this macro marks the end of source code that is included in a module.  \r
-  Otherwise, the source lines between DEBUG_CODE_BEGIN() and DEBUG_CODE_END() \r
+  If the DEBUG_PROPERTY_DEBUG_CODE_ENABLED bit of PcdDebugProperyMask is set,\r
+  then this macro marks the end of source code that is included in a module.\r
+  Otherwise, the source lines between DEBUG_CODE_BEGIN() and DEBUG_CODE_END()\r
   are not included in a module.\r
 \r
 **/\r
 #define DEBUG_CODE_END()    __DebugCodeLocal = 0; __DebugCodeLocal++; } } while (FALSE)\r
 \r
 \r
-/**  \r
+/**\r
   The macro that declares a section of debug source code.\r
 \r
-  If the DEBUG_PROPERTY_DEBUG_CODE_ENABLED bit of PcdDebugProperyMask is set, \r
-  then the source code specified by Expression is included in a module.  \r
+  If the DEBUG_PROPERTY_DEBUG_CODE_ENABLED bit of PcdDebugProperyMask is set,\r
+  then the source code specified by Expression is included in a module.\r
   Otherwise, the source specified by Expression is not included in a module.\r
 \r
 **/\r
@@ -427,10 +500,10 @@ DebugPrintLevelEnabled (
   DEBUG_CODE_END ()\r
 \r
 \r
-/**  \r
+/**\r
   The macro that calls DebugClearMemory() to clear a buffer to a default value.\r
 \r
-  If the DEBUG_PROPERTY_CLEAR_MEMORY_ENABLED bit of PcdDebugProperyMask is set, \r
+  If the DEBUG_PROPERTY_CLEAR_MEMORY_ENABLED bit of PcdDebugProperyMask is set,\r
   then this macro calls DebugClearMemory() passing in Address and Length.\r
 \r
   @param  Address  The pointer to a buffer.\r
@@ -446,42 +519,42 @@ DebugPrintLevelEnabled (
 \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
-  structure that contains a specified field of that data structure is returned.  \r
-  This is a lightweight method hide information by placing a public data \r
-  structure inside a larger private data structure and using a pointer to the \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
+  structure that contains a specified field of that data structure is returned.\r
+  This is a lightweight method hide information by placing a public data\r
+  structure inside a larger private data structure and using a pointer to the\r
   public data structure to retrieve a pointer to the private data structure.\r
 \r
-  If MDEPKG_NDEBUG is defined or the DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit \r
+  If MDEPKG_NDEBUG is defined or the DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit\r
   of PcdDebugProperyMask is clear, then this macro computes the offset, in bytes,\r
-  of the field specified by Field from the beginning of the data structure specified \r
-  by TYPE.  This offset is subtracted from Record, and is used to return a pointer \r
+  of the field specified by Field from the beginning of the data structure specified\r
+  by TYPE.  This offset is subtracted from Record, and is used to return a pointer\r
   to a data structure of the type specified by TYPE.\r
 \r
   If MDEPKG_NDEBUG is not defined and the DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit\r
-  of PcdDebugProperyMask is set, then this macro computes the offset, in bytes, \r
-  of field specified by Field from the beginning of the data structure specified \r
+  of PcdDebugProperyMask is set, then this macro computes the offset, in bytes,\r
+  of field specified by Field from the beginning of the data structure specified\r
   by TYPE.  This offset is subtracted from Record, and is used to compute a pointer\r
-  to a data structure of the type specified by TYPE.  The Signature field of the \r
-  data structure specified by TYPE is compared to TestSignature.  If the signatures \r
-  match, then a pointer to the pointer to a data structure of the type specified by \r
-  TYPE is returned.  If the signatures do not match, then DebugAssert() is called \r
-  with a description of "CR has a bad signature" and Record is returned.  \r
+  to a data structure of the type specified by TYPE.  The Signature field of the\r
+  data structure specified by TYPE is compared to TestSignature.  If the signatures\r
+  match, then a pointer to the pointer to a data structure of the type specified by\r
+  TYPE is returned.  If the signatures do not match, then DebugAssert() is called\r
+  with a description of "CR has a bad signature" and Record is returned.\r
 \r
-  If the data type specified by TYPE does not contain the field specified by Field, \r
+  If the data type specified by TYPE does not contain the field specified by Field,\r
   then the module will not compile.\r
 \r
-  If TYPE does not contain a field called Signature, then the module will not \r
+  If TYPE does not contain a field called Signature, then the module will not\r
   compile.\r
 \r
-  @param  Record         The pointer to the field specified by Field within a data \r
+  @param  Record         The pointer to the field specified by Field within a data\r
                          structure of type TYPE.\r
 \r
-  @param  TYPE           The name of the data structure type to return  This \r
-                         data structure must contain the field specified by Field. \r
+  @param  TYPE           The name of the data structure type to return  This\r
+                         data structure must contain the field specified by Field.\r
 \r
-  @param  Field          The name of the field in the data structure specified \r
+  @param  Field          The name of the field in the data structure specified\r
                          by TYPE to which Record points.\r
 \r
   @param  TestSignature  The 32-bit signature value to match.\r
@@ -496,5 +569,5 @@ DebugPrintLevelEnabled (
   #define CR(Record, TYPE, Field, TestSignature)                                              \\r
     BASE_CR (Record, TYPE, Field)\r
 #endif\r
-    \r
+\r
 #endif\r