]> git.proxmox.com Git - mirror_edk2.git/commitdiff
BaseMemoryLib (BaseMemoryLibRepStr):
authorqhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 13 Jun 2006 06:31:11 +0000 (06:31 +0000)
committerqhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 13 Jun 2006 06:31:11 +0000 (06:31 +0000)
Fix a logic error in SetMem64 (); The correct stride should be 8 instead of 4.
BasePrintLib:
Fix Printf(ā€œ%\nā€) passer error.
Fix BufferSize = 0, 1 issue
Fix some missing ASSERT ()s
Move MAXIMUM_VALUE_CHARACTERS from PrintLibInternal.h to PrintLib.h
ReportStatusCodeLib:
Add CONST modifier to some interfaces
Modify
DebugLib:
Replace some Unicode in comments.
PeiServicesTablePointerLib
Add ASSERT()s
PciLib:
Remove unnecessary ASSERT()s in PciRead/WriteBuffer()

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@496 6f19259b-4bc3-4df7-8a09-765794883524

21 files changed:
MdePkg/Include/Library/DebugLib.h
MdePkg/Include/Library/PrintLib.h
MdePkg/Include/Library/ReportStatusCodeLib.h
MdePkg/Library/BaseDebugLibNull/DebugLib.c
MdePkg/Library/BaseDebugLibReportStatusCode/DebugLib.c
MdePkg/Library/BaseMemoryLibRepStr/Ia32/SetMem64.asm
MdePkg/Library/BaseMemoryLibRepStr/Ia32/SetMem64.s
MdePkg/Library/BasePciCf8Lib/PciLib.c
MdePkg/Library/BasePciExpressLib/PciLib.c
MdePkg/Library/BasePrintLib/PrintLib.c
MdePkg/Library/BasePrintLib/PrintLibInternal.c
MdePkg/Library/BasePrintLib/PrintLibInternal.h
MdePkg/Library/BaseReportStatusCodeLibNull/ReportStatusCodeLib.c
MdePkg/Library/DxeReportStatusCodeLib/ReportStatusCodeLib.c
MdePkg/Library/PeiReportStatusCodeLib/ReportStatusCodeLib.c
MdePkg/Library/PeiServicesTablePointerLib/PeiServicesTablePointer.c
MdePkg/Library/PeiServicesTablePointerLib/PeiServicesTablePointerLib.msa
MdePkg/Library/PeiServicesTablePointerLibMm7/PeiServicesTablePointer.c
MdePkg/Library/PeiServicesTablePointerLibMm7/PeiServicesTablePointerLibMm7.msa
MdePkg/Library/UefiDebugLibConOut/DebugLib.c
MdePkg/Library/UefiDebugLibStdErr/DebugLib.c

index 5efb30401649fb55903ec0a3997cf02ebacd8d32..b1d320057fa2eb623523ba90bd7f360ae905aa3c 100644 (file)
@@ -72,7 +72,7 @@ DebugPrint (
   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
   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 \93ASSERT <FileName>(<LineNumber>): <Description>\n?\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
   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
@@ -411,7 +411,7 @@ DebugClearMemoryEnabled (
   by TYPE is compared to TestSignature.  If the signatures match, then a pointer \r
   to the pointer to a data structure of the type specified by TYPE is returned.  \r
   If the signatures do not match, then DebugAssert() is called with a description \r
   by TYPE is compared to TestSignature.  If the signatures match, then a pointer \r
   to the pointer to a data structure of the type specified by TYPE is returned.  \r
   If the signatures do not match, then DebugAssert() is called with a description \r
-  of \93CR has a bad signature?and Record is returned.  \r
+  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
   then the module will not compile.\r
 \r
   If the data type specified by TYPE does not contain the field specified by Field, \r
   then the module will not compile.\r
index 9c65459a59ec3cc415a4fd104bca2b22938c9657..22df74c65a575a44431c480b9db3db727f05d41c 100644 (file)
 #ifndef __PRINT_LIB_H__\r
 #define __PRINT_LIB_H__\r
 \r
 #ifndef __PRINT_LIB_H__\r
 #define __PRINT_LIB_H__\r
 \r
-//\r
-// Print primitives\r
-//\r
+///\r
+/// Define the maximum number of characters that are required to\r
+/// encode a decimal, hexidecimal, GUID, or TIME value with a NULL \r
+/// terminator.\r
+///  \r
+///  Maximum Length Decimal String     = 28\r
+///    "-9,223,372,036,854,775,808"\r
+///  Maximum Length Hexidecimal String = 17\r
+///    "FFFFFFFFFFFFFFFF"\r
+///  Maximum Length GUID               = 37\r
+///    "00000000-0000-0000-0000-000000000000"\r
+///  Maximum Length TIME               = 18\r
+///    "12/12/2006  12:12"\r
+///\r
+#define MAXIMUM_VALUE_CHARACTERS  38\r
+\r
+///\r
+/// Flags bitmask values use in UnicodeValueToString() and \r
+/// AcsiiValueToString()\r
+///\r
 #define LEFT_JUSTIFY      0x01\r
 #define COMMA_TYPE        0x08\r
 #define PREFIX_ZERO       0x20\r
 #define LEFT_JUSTIFY      0x01\r
 #define COMMA_TYPE        0x08\r
 #define PREFIX_ZERO       0x20\r
index 9a3d4daabdbe8892f9eaed1e4f59f53b404e6e9a..6b32ddb1379623d522c3b322b2511f4035f539aa 100644 (file)
@@ -241,12 +241,12 @@ CodeTypeToPostCode (
 BOOLEAN\r
 EFIAPI\r
 ReportStatusCodeExtractAssertInfo (\r
 BOOLEAN\r
 EFIAPI\r
 ReportStatusCodeExtractAssertInfo (\r
-  IN  EFI_STATUS_CODE_TYPE   CodeType,\r
-  IN  EFI_STATUS_CODE_VALUE  Value,  \r
-  IN  EFI_STATUS_CODE_DATA   *Data, \r
-  OUT CHAR8                  **Filename,\r
-  OUT CHAR8                  **Description,\r
-  OUT UINT32                 *LineNumber\r
+  IN EFI_STATUS_CODE_TYPE        CodeType,\r
+  IN EFI_STATUS_CODE_VALUE       Value,  \r
+  IN CONST EFI_STATUS_CODE_DATA  *Data, \r
+  OUT CHAR8                      **Filename,\r
+  OUT CHAR8                      **Description,\r
+  OUT UINT32                     *LineNumber\r
   );\r
 \r
 \r
   );\r
 \r
 \r
@@ -282,10 +282,10 @@ ReportStatusCodeExtractAssertInfo (
 BOOLEAN\r
 EFIAPI\r
 ReportStatusCodeExtractDebugInfo (\r
 BOOLEAN\r
 EFIAPI\r
 ReportStatusCodeExtractDebugInfo (\r
-  IN  EFI_STATUS_CODE_DATA  *Data,\r
-  OUT UINT32                *ErrorLevel,\r
-  OUT VA_LIST               *Marker,\r
-  OUT CHAR8                 **Format\r
+  IN CONST EFI_STATUS_CODE_DATA  *Data, \r
+  OUT UINT32                     *ErrorLevel,\r
+  OUT VA_LIST                    *Marker,\r
+  OUT CHAR8                      **Format\r
   );\r
 \r
 \r
   );\r
 \r
 \r
@@ -349,9 +349,9 @@ ReportStatusCode (
 EFI_STATUS\r
 EFIAPI\r
 ReportStatusCodeWithDevicePath (\r
 EFI_STATUS\r
 EFIAPI\r
 ReportStatusCodeWithDevicePath (\r
-  IN EFI_STATUS_CODE_TYPE      Type,\r
-  IN EFI_STATUS_CODE_VALUE     Value,\r
-  IN EFI_DEVICE_PATH_PROTOCOL  *DevicePath\r
+  IN EFI_STATUS_CODE_TYPE            Type,\r
+  IN EFI_STATUS_CODE_VALUE           Value,\r
+  IN CONST EFI_DEVICE_PATH_PROTOCOL  *DevicePath\r
   );\r
 \r
 \r
   );\r
 \r
 \r
@@ -393,7 +393,7 @@ EFIAPI
 ReportStatusCodeWithExtendedData (\r
   IN EFI_STATUS_CODE_TYPE   Type,\r
   IN EFI_STATUS_CODE_VALUE  Value,\r
 ReportStatusCodeWithExtendedData (\r
   IN EFI_STATUS_CODE_TYPE   Type,\r
   IN EFI_STATUS_CODE_VALUE  Value,\r
-  IN VOID                   *ExtendedData,\r
+  IN CONST VOID             *ExtendedData,\r
   IN UINTN                  ExtendedDataSize\r
   );\r
 \r
   IN UINTN                  ExtendedDataSize\r
   );\r
 \r
@@ -445,9 +445,9 @@ ReportStatusCodeEx (
   IN EFI_STATUS_CODE_TYPE   Type,\r
   IN EFI_STATUS_CODE_VALUE  Value,\r
   IN UINT32                 Instance,\r
   IN EFI_STATUS_CODE_TYPE   Type,\r
   IN EFI_STATUS_CODE_VALUE  Value,\r
   IN UINT32                 Instance,\r
-  IN EFI_GUID               *CallerId           OPTIONAL,\r
-  IN EFI_GUID               *ExtendedDataGuid   OPTIONAL,\r
-  IN VOID                   *ExtendedData       OPTIONAL,\r
+  IN CONST EFI_GUID         *CallerId          OPTIONAL,\r
+  IN CONST EFI_GUID         *ExtendedDataGuid  OPTIONAL,\r
+  IN CONST VOID             *ExtendedData      OPTIONAL,\r
   IN UINTN                  ExtendedDataSize\r
   );\r
 \r
   IN UINTN                  ExtendedDataSize\r
   );\r
 \r
index 35aea32259d4e5e020859a73e8cc2888a6dfbde0..9081b632d886bcb0e227795f8f4fbc6b071dd082 100644 (file)
@@ -61,7 +61,7 @@ DebugPrint (
   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
   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 \93ASSERT <FileName>(<LineNumber>): <Description>\n\94 \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
   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
@@ -70,9 +70,9 @@ DebugPrint (
   DebugAssert() must actively prevent recusrsion.  If DebugAssert() is called while\r
   processing another DebugAssert(), then DebugAssert() must return immediately.\r
 \r
   DebugAssert() must actively prevent recusrsion.  If DebugAssert() is called while\r
   processing another DebugAssert(), then DebugAssert() must return immediately.\r
 \r
-  If FileName is NULL, then a <FileName> string of \93(NULL) Filename\94 is printed.\r
+  If FileName is NULL, then a <FileName> string of "(NULL) Filename" is printed.\r
 \r
 \r
-  If Description is NULL, then a <Description> string of \93(NULL) Description\94 is printed.\r
+  If Description is NULL, then a <Description> string of "(NULL) Description" is printed.\r
 \r
   @param  FileName     Pointer to the name of the source file that generated the assert condition.\r
   @param  LineNumber   The line number in the source file that generated the assert condition\r
 \r
   @param  FileName     Pointer to the name of the source file that generated the assert condition.\r
   @param  LineNumber   The line number in the source file that generated the assert condition\r
index d330c0f989e4ab2ee21f7db6550ebd57941b79af..a239e91d9d1cc897d1e6e533b12edb273018a851 100644 (file)
@@ -92,7 +92,7 @@ DebugPrint (
   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
   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 \93ASSERT <FileName>(<LineNumber>): <Description>\n\94 \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
   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
@@ -101,9 +101,9 @@ DebugPrint (
   DebugAssert() must actively prevent recusrsion.  If DebugAssert() is called while\r
   processing another DebugAssert(), then DebugAssert() must return immediately.\r
 \r
   DebugAssert() must actively prevent recusrsion.  If DebugAssert() is called while\r
   processing another DebugAssert(), then DebugAssert() must return immediately.\r
 \r
-  If FileName is NULL, then a <FileName> string of \93(NULL) Filename\94 is printed.\r
+  If FileName is NULL, then a <FileName> string of "(NULL) Filename" is printed.\r
 \r
 \r
-  If Description is NULL, then a <Description> string of \93(NULL) Description\94 is printed.\r
+  If Description is NULL, then a <Description> string of "(NULL) Description" is printed.\r
 \r
   @param  FileName     Pointer to the name of the source file that generated the assert condition.\r
   @param  LineNumber   The line number in the source file that generated the assert condition\r
 \r
   @param  FileName     Pointer to the name of the source file that generated the assert condition.\r
   @param  LineNumber   The line number in the source file that generated the assert condition\r
index 3f6f3ecf9df63efcf149246295563f49bc040994..4679a384c603f2900731d6e0a27da1601455a08a 100644 (file)
@@ -31,8 +31,8 @@ InternalMemSetMem64 PROC    USES    edi
     mov     edx, [esp + 20]\r
     mov     edi, [esp + 8]\r
 @@:\r
     mov     edx, [esp + 20]\r
     mov     edi, [esp + 8]\r
 @@:\r
-    mov     [edi + ecx*4 - 8], eax\r
-    mov     [edi + ecx*4 - 4], edx\r
+    mov     [edi + ecx*8 - 8], eax\r
+    mov     [edi + ecx*8 - 4], edx\r
     loop    @B\r
     mov     eax, edi\r
     ret\r
     loop    @B\r
     mov     eax, edi\r
     ret\r
index 81f706841f091e5e0858c5c92c660312e2857b1f..1a12bc6ee5c31d7822c128c131d86e7709bb8ea6 100644 (file)
@@ -32,8 +32,8 @@ InternalMemSetMem64:
     movl    20(%esp),%edx
     movl    8(%esp),%edi
 L0: 
     movl    20(%esp),%edx
     movl    8(%esp),%edi
 L0: 
-    mov     %eax,-8(%edi,%ecx,4)
-    mov     %edx,-4(%edi,%ecx,4)
+    mov     %eax,-8(%edi,%ecx,8)
+    mov     %edx,-4(%edi,%ecx,8)
     loop    L0
     movl    %edi,%eax
     pop     %edi
     loop    L0
     movl    %edi,%eax
     pop     %edi
index 108c95291c0da95863c34c73c030741f43573f4c..2f82fbe2c8a6ece88bab53a0007ff6425547ad7f 100644 (file)
@@ -1299,8 +1299,6 @@ PciCf8ReadBuffer (
   UINTN                             EndAddress;\r
 \r
   ASSERT_INVALID_PCI_ADDRESS (StartAddress, 0);\r
   UINTN                             EndAddress;\r
 \r
   ASSERT_INVALID_PCI_ADDRESS (StartAddress, 0);\r
-  ASSERT (((StartAddress & 0xFFF) + Size) <= 0x1000);\r
-  ASSERT ((StartAddress + Size - 1) <= 0x0FFFFFFF);\r
   ASSERT (Buffer != NULL);\r
 \r
   EndAddress = StartAddress + Size;\r
   ASSERT (Buffer != NULL);\r
 \r
   EndAddress = StartAddress + Size;\r
@@ -1388,8 +1386,6 @@ PciCf8WriteBuffer (
   UINTN                             EndAddress;\r
 \r
   ASSERT_INVALID_PCI_ADDRESS (StartAddress, 0);\r
   UINTN                             EndAddress;\r
 \r
   ASSERT_INVALID_PCI_ADDRESS (StartAddress, 0);\r
-  ASSERT (((StartAddress & 0xFFF) + Size) <= 0x1000);\r
-  ASSERT ((StartAddress + Size - 1) <= 0x0FFFFFFF);\r
   ASSERT (Buffer != NULL);\r
 \r
   EndAddress = StartAddress + Size;\r
   ASSERT (Buffer != NULL);\r
 \r
   EndAddress = StartAddress + Size;\r
index de33bf30555a5b4d89623b3d63777e26706a90ec..125da5793b0e10b2ec0e7bae0004314bae680558 100644 (file)
@@ -1196,8 +1196,6 @@ PciExpressReadBuffer (
   UINTN                             EndAddress;\r
 \r
   ASSERT_INVALID_PCI_ADDRESS (StartAddress);\r
   UINTN                             EndAddress;\r
 \r
   ASSERT_INVALID_PCI_ADDRESS (StartAddress);\r
-  ASSERT (((StartAddress & 0xFFF) + Size) <= 0x1000);\r
-  ASSERT ((StartAddress + Size - 1) <= 0x0FFFFFFF);\r
   ASSERT (Buffer != NULL);\r
 \r
   EndAddress = StartAddress + Size;\r
   ASSERT (Buffer != NULL);\r
 \r
   EndAddress = StartAddress + Size;\r
@@ -1284,8 +1282,6 @@ PciExpressWriteBuffer (
   UINTN                             EndAddress;\r
 \r
   ASSERT_INVALID_PCI_ADDRESS (StartAddress);\r
   UINTN                             EndAddress;\r
 \r
   ASSERT_INVALID_PCI_ADDRESS (StartAddress);\r
-  ASSERT (((StartAddress & 0xFFF) + Size) <= 0x1000);\r
-  ASSERT ((StartAddress + Size - 1) <= 0x0FFFFFFF);\r
   ASSERT (Buffer != NULL);\r
 \r
   EndAddress = StartAddress + Size;\r
   ASSERT (Buffer != NULL);\r
 \r
   EndAddress = StartAddress + Size;\r
index 24e01755451352ad7af165cd77b0047abe63f8f6..e940bedb3497aec3b32b83c5fa29b49f7008609e 100644 (file)
@@ -66,7 +66,6 @@ static CONST STATUS_LOOKUP_TABLE_ENTRY  StatusString[] = {
   @param  Buffer      Character buffer to print the results of the parsing\r
                       of Format into.\r
   @param  BufferSize  Maximum number of characters to put into buffer.\r
   @param  Buffer      Character buffer to print the results of the parsing\r
                       of Format into.\r
   @param  BufferSize  Maximum number of characters to put into buffer.\r
-                      Zero means no limit.\r
   @param  Flags       Intial flags value.\r
                       Can only have FORMAT_UNICODE and OUTPUT_UNICODE set\r
   @param  Format      Null-terminated format string.\r
   @param  Flags       Intial flags value.\r
                       Can only have FORMAT_UNICODE and OUTPUT_UNICODE set\r
   @param  Format      Null-terminated format string.\r
@@ -110,6 +109,9 @@ BasePrintLibVSPrint (
   UINTN           Radix;\r
   RETURN_STATUS   Status;\r
 \r
   UINTN           Radix;\r
   RETURN_STATUS   Status;\r
 \r
+  if (BufferSize == 0) {\r
+    return 0;\r
+  }\r
   ASSERT (Buffer != NULL);\r
   ASSERT (Format != NULL);\r
 \r
   ASSERT (Buffer != NULL);\r
   ASSERT (Format != NULL);\r
 \r
@@ -130,7 +132,6 @@ BasePrintLibVSPrint (
 \r
   //\r
   // Reserve space for the Null terminator.\r
 \r
   //\r
   // Reserve space for the Null terminator.\r
-  // If BufferSize is 0, this will set BufferSize to the max unsigned value\r
   //\r
   BufferSize--;\r
 \r
   //\r
   BufferSize--;\r
 \r
@@ -338,7 +339,7 @@ BasePrintLibVSPrint (
         } else {\r
           BasePrintLibSPrint (\r
             ValueBuffer,\r
         } else {\r
           BasePrintLibSPrint (\r
             ValueBuffer,\r
-            0\r
+            MAXIMUM_VALUE_CHARACTERS\r
             0,\r
             "%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x",\r
             TmpGuid->Data1,\r
             0,\r
             "%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x",\r
             TmpGuid->Data1,\r
@@ -364,7 +365,7 @@ BasePrintLibVSPrint (
         } else {\r
           BasePrintLibSPrint (\r
             ValueBuffer,\r
         } else {\r
           BasePrintLibSPrint (\r
             ValueBuffer,\r
-            0,\r
+            MAXIMUM_VALUE_CHARACTERS,\r
             0,\r
             "%02d/%02d/%04d  %02d:%02d",\r
             TmpTime->Month,\r
             0,\r
             "%02d/%02d/%04d  %02d:%02d",\r
             TmpTime->Month,\r
@@ -386,10 +387,14 @@ BasePrintLibVSPrint (
           }\r
         }\r
         if (ArgumentString == ValueBuffer) {\r
           }\r
         }\r
         if (ArgumentString == ValueBuffer) {\r
-          BasePrintLibSPrint ((CHAR8 *) ValueBuffer, 0, 0, "%08X", Status);\r
+          BasePrintLibSPrint ((CHAR8 *) ValueBuffer, MAXIMUM_VALUE_CHARACTERS, 0, "%08X", Status);\r
         }\r
         break;\r
 \r
         }\r
         break;\r
 \r
+      case '\n':\r
+        ArgumentString = "\r\n";\r
+        break;\r
+\r
       case '%':\r
       default:\r
         //\r
       case '%':\r
       default:\r
         //\r
@@ -400,9 +405,6 @@ BasePrintLibVSPrint (
         break;\r
       }\r
       break;\r
         break;\r
       }\r
       break;\r
-    case '\n':\r
-      ArgumentString = "\r\n";\r
-      break;\r
     default:\r
       ArgumentString = (CHAR8 *)&FormatCharacter;\r
       Flags |= ARGUMENT_UNICODE;\r
     default:\r
       ArgumentString = (CHAR8 *)&FormatCharacter;\r
       Flags |= ARGUMENT_UNICODE;\r
@@ -717,7 +719,7 @@ UnicodeSPrintAsciiFormat (
   VA_LIST Marker;\r
 \r
   VA_START (Marker, FormatString);\r
   VA_LIST Marker;\r
 \r
   VA_START (Marker, FormatString);\r
-  return UnicodeVSPrintAsciiFormat (StartOfBuffer, BufferSize >> 1, FormatString, Marker);\r
+  return UnicodeVSPrintAsciiFormat (StartOfBuffer, BufferSize, FormatString, Marker);\r
 }\r
 \r
 /**\r
 }\r
 \r
 /**\r
index 89d18b09a2c5ffeadcbf622403ea06f8979ccfd9..06c220692e1ea6d88b147352a6128abca1948987 100644 (file)
@@ -138,13 +138,20 @@ BasePrintLibConvertValueToString (
   UINTN  Digits;\r
   UINTN  Index;\r
 \r
   UINTN  Digits;\r
   UINTN  Index;\r
 \r
+  ASSERT (Buffer != NULL);\r
+  ASSERT (Width < MAXIMUM_VALUE_CHARACTERS);\r
+  //\r
+  // Make sure Flags can only contain supported bits.\r
+  //\r
+  ASSERT ((Flags & ~(LEFT_JUSTIFY | COMMA_TYPE | PREFIX_ZERO)) == 0);\r
+\r
   OriginalBuffer = Buffer;\r
 \r
   if (Width == 0 || (Flags & COMMA_TYPE) != 0) {\r
     Flags &= (~PREFIX_ZERO);\r
   }\r
 \r
   OriginalBuffer = Buffer;\r
 \r
   if (Width == 0 || (Flags & COMMA_TYPE) != 0) {\r
     Flags &= (~PREFIX_ZERO);\r
   }\r
 \r
-  if (Width == 0 || Width > (MAXIMUM_VALUE_CHARACTERS - 1)) {\r
+  if (Width == 0) {\r
     Width = MAXIMUM_VALUE_CHARACTERS - 1;\r
   }\r
 \r
     Width = MAXIMUM_VALUE_CHARACTERS - 1;\r
   }\r
 \r
index 0f7bebff454fdc9b0823d239302c6e15be048f91..f395bb795622d97ee02df45275404703d0bffe2d 100644 (file)
 #define PRECISION         0x800\r
 #define ARGUMENT_REVERSED 0x1000\r
 \r
 #define PRECISION         0x800\r
 #define ARGUMENT_REVERSED 0x1000\r
 \r
-///\r
-/// Define the maximum number of characters that are required to encode\r
-/// a decimal, hexidecimal, GUID, or TIME value with a Nll terminator.\r
-///   Maximum Length Decimal String     = 28    "-9,223,372,036,854,775,808"\r
-///   Maximum Length Hexidecimal String = 17    "FFFFFFFFFFFFFFFF"\r
-///   Maximum Length GUID               = 37    "00000000-0000-0000-0000-000000000000"\r
-///   Maximum Length TIME               = 18    "12/12/2006  12:12"\r
-///\r
-#define MAXIMUM_VALUE_CHARACTERS  38\r
-\r
 //\r
 // Record date and time information\r
 //\r
 //\r
 // Record date and time information\r
 //\r
index 752dc72c7926a090bac4776e7367ec9da1be41c3..4459c0350e6f8964c1a890207dd75750edda5f46 100644 (file)
@@ -95,12 +95,12 @@ CodeTypeToPostCode (
 BOOLEAN\r
 EFIAPI\r
 ReportStatusCodeExtractAssertInfo (\r
 BOOLEAN\r
 EFIAPI\r
 ReportStatusCodeExtractAssertInfo (\r
-  IN  EFI_STATUS_CODE_TYPE   CodeType,\r
-  IN  EFI_STATUS_CODE_VALUE  Value,  \r
-  IN  EFI_STATUS_CODE_DATA   *Data, \r
-  OUT CHAR8                  **Filename,\r
-  OUT CHAR8                  **Description,\r
-  OUT UINT32                 *LineNumber\r
+  IN EFI_STATUS_CODE_TYPE        CodeType,\r
+  IN EFI_STATUS_CODE_VALUE       Value,  \r
+  IN CONST EFI_STATUS_CODE_DATA  *Data, \r
+  OUT CHAR8                      **Filename,\r
+  OUT CHAR8                      **Description,\r
+  OUT UINT32                     *LineNumber\r
   )\r
 {\r
   EFI_DEBUG_ASSERT_DATA  *AssertData;\r
   )\r
 {\r
   EFI_DEBUG_ASSERT_DATA  *AssertData;\r
@@ -155,10 +155,10 @@ ReportStatusCodeExtractAssertInfo (
 BOOLEAN\r
 EFIAPI\r
 ReportStatusCodeExtractDebugInfo (\r
 BOOLEAN\r
 EFIAPI\r
 ReportStatusCodeExtractDebugInfo (\r
-  IN  EFI_STATUS_CODE_DATA  *Data,\r
-  OUT UINT32                *ErrorLevel,\r
-  OUT VA_LIST               *Marker,\r
-  OUT CHAR8                 **Format\r
+  IN CONST EFI_STATUS_CODE_DATA  *Data, \r
+  OUT UINT32                     *ErrorLevel,\r
+  OUT VA_LIST                    *Marker,\r
+  OUT CHAR8                      **Format\r
   )\r
 {\r
   EFI_DEBUG_INFO  *DebugInfo;\r
   )\r
 {\r
   EFI_DEBUG_INFO  *DebugInfo;\r
@@ -256,9 +256,9 @@ ReportStatusCode (
 EFI_STATUS\r
 EFIAPI\r
 ReportStatusCodeWithDevicePath (\r
 EFI_STATUS\r
 EFIAPI\r
 ReportStatusCodeWithDevicePath (\r
-  IN EFI_STATUS_CODE_TYPE      Type,\r
-  IN EFI_STATUS_CODE_VALUE     Value,\r
-  IN EFI_DEVICE_PATH_PROTOCOL  *DevicePath\r
+  IN EFI_STATUS_CODE_TYPE            Type,\r
+  IN EFI_STATUS_CODE_VALUE           Value,\r
+  IN CONST EFI_DEVICE_PATH_PROTOCOL  *DevicePath\r
   )\r
 {\r
   ASSERT (DevicePath != NULL);\r
   )\r
 {\r
   ASSERT (DevicePath != NULL);\r
@@ -304,7 +304,7 @@ EFIAPI
 ReportStatusCodeWithExtendedData (\r
   IN EFI_STATUS_CODE_TYPE   Type,\r
   IN EFI_STATUS_CODE_VALUE  Value,\r
 ReportStatusCodeWithExtendedData (\r
   IN EFI_STATUS_CODE_TYPE   Type,\r
   IN EFI_STATUS_CODE_VALUE  Value,\r
-  IN VOID                   *ExtendedData,\r
+  IN CONST VOID             *ExtendedData,\r
   IN UINTN                  ExtendedDataSize\r
   )\r
 {\r
   IN UINTN                  ExtendedDataSize\r
   )\r
 {\r
@@ -361,9 +361,9 @@ ReportStatusCodeEx (
   IN EFI_STATUS_CODE_TYPE   Type,\r
   IN EFI_STATUS_CODE_VALUE  Value,\r
   IN UINT32                 Instance,\r
   IN EFI_STATUS_CODE_TYPE   Type,\r
   IN EFI_STATUS_CODE_VALUE  Value,\r
   IN UINT32                 Instance,\r
-  IN EFI_GUID               *CallerId           OPTIONAL,\r
-  IN EFI_GUID               *ExtendedDataGuid   OPTIONAL,\r
-  IN VOID                   *ExtendedData       OPTIONAL,\r
+  IN CONST EFI_GUID         *CallerId          OPTIONAL,\r
+  IN CONST EFI_GUID         *ExtendedDataGuid  OPTIONAL,\r
+  IN CONST VOID             *ExtendedData      OPTIONAL,\r
   IN UINTN                  ExtendedDataSize\r
   )\r
 {\r
   IN UINTN                  ExtendedDataSize\r
   )\r
 {\r
index 9edb75313765e36d1aca05ba8c650817efaecd4d..616c237dade6a2c86a3294e285c4ecc766563cb0 100644 (file)
@@ -45,7 +45,7 @@ InternalReportStatusCode (
   IN EFI_STATUS_CODE_TYPE     Type,\r
   IN EFI_STATUS_CODE_VALUE    Value,\r
   IN UINT32                   Instance,\r
   IN EFI_STATUS_CODE_TYPE     Type,\r
   IN EFI_STATUS_CODE_VALUE    Value,\r
   IN UINT32                   Instance,\r
-  IN EFI_GUID                 *CallerId OPTIONAL,\r
+  IN CONST EFI_GUID           *CallerId OPTIONAL,\r
   IN EFI_STATUS_CODE_DATA     *Data     OPTIONAL  \r
   )\r
 {\r
   IN EFI_STATUS_CODE_DATA     *Data     OPTIONAL  \r
   )\r
 {\r
@@ -66,7 +66,7 @@ InternalReportStatusCode (
   // A Status Code Protocol is present in the handle database, so pass in all the  \r
   // parameters to the ReportStatusCode() service of the Status Code Protocol\r
   //\r
   // A Status Code Protocol is present in the handle database, so pass in all the  \r
   // parameters to the ReportStatusCode() service of the Status Code Protocol\r
   //\r
-  return gStatusCode->ReportStatusCode (Type, Value, Instance, CallerId, Data);\r
+  return gStatusCode->ReportStatusCode (Type, Value, Instance, (EFI_GUID *)CallerId, Data);\r
 }\r
 \r
 \r
 }\r
 \r
 \r
@@ -80,14 +80,10 @@ InternalReportStatusCode (
 **/\r
 UINTN\r
 InternalReportStatusCodeDevicePathSize (\r
 **/\r
 UINTN\r
 InternalReportStatusCodeDevicePathSize (\r
-  IN EFI_DEVICE_PATH_PROTOCOL  *DevicePath\r
+  IN CONST EFI_DEVICE_PATH_PROTOCOL  *DevicePath\r
   )\r
 {\r
   )\r
 {\r
-  EFI_DEVICE_PATH_PROTOCOL  *Start;\r
-\r
-  if (DevicePath == NULL) {\r
-    return 0;\r
-  }\r
+  CONST EFI_DEVICE_PATH_PROTOCOL  *Start;\r
 \r
   //\r
   // Search for the end of the device path structure\r
 \r
   //\r
   // Search for the end of the device path structure\r
@@ -187,12 +183,12 @@ CodeTypeToPostCode (
 BOOLEAN\r
 EFIAPI\r
 ReportStatusCodeExtractAssertInfo (\r
 BOOLEAN\r
 EFIAPI\r
 ReportStatusCodeExtractAssertInfo (\r
-  IN  EFI_STATUS_CODE_TYPE   CodeType,\r
-  IN  EFI_STATUS_CODE_VALUE  Value,  \r
-  IN  EFI_STATUS_CODE_DATA   *Data, \r
-  OUT CHAR8                  **Filename,\r
-  OUT CHAR8                  **Description,\r
-  OUT UINT32                 *LineNumber\r
+  IN EFI_STATUS_CODE_TYPE        CodeType,\r
+  IN EFI_STATUS_CODE_VALUE       Value,  \r
+  IN CONST EFI_STATUS_CODE_DATA  *Data, \r
+  OUT CHAR8                      **Filename,\r
+  OUT CHAR8                      **Description,\r
+  OUT UINT32                     *LineNumber\r
   )\r
 {\r
   EFI_DEBUG_ASSERT_DATA  *AssertData;\r
   )\r
 {\r
   EFI_DEBUG_ASSERT_DATA  *AssertData;\r
@@ -247,10 +243,10 @@ ReportStatusCodeExtractAssertInfo (
 BOOLEAN\r
 EFIAPI\r
 ReportStatusCodeExtractDebugInfo (\r
 BOOLEAN\r
 EFIAPI\r
 ReportStatusCodeExtractDebugInfo (\r
-  IN  EFI_STATUS_CODE_DATA  *Data,\r
-  OUT UINT32                *ErrorLevel,\r
-  OUT VA_LIST               *Marker,\r
-  OUT CHAR8                 **Format\r
+  IN CONST EFI_STATUS_CODE_DATA  *Data, \r
+  OUT UINT32                     *ErrorLevel,\r
+  OUT VA_LIST                    *Marker,\r
+  OUT CHAR8                      **Format\r
   )\r
 {\r
   EFI_DEBUG_INFO  *DebugInfo;\r
   )\r
 {\r
   EFI_DEBUG_INFO  *DebugInfo;\r
@@ -348,9 +344,9 @@ ReportStatusCode (
 EFI_STATUS\r
 EFIAPI\r
 ReportStatusCodeWithDevicePath (\r
 EFI_STATUS\r
 EFIAPI\r
 ReportStatusCodeWithDevicePath (\r
-  IN EFI_STATUS_CODE_TYPE      Type,\r
-  IN EFI_STATUS_CODE_VALUE     Value,\r
-  IN EFI_DEVICE_PATH_PROTOCOL  *DevicePath\r
+  IN EFI_STATUS_CODE_TYPE            Type,\r
+  IN EFI_STATUS_CODE_VALUE           Value,\r
+  IN CONST EFI_DEVICE_PATH_PROTOCOL  *DevicePath\r
   )\r
 {\r
   ASSERT (DevicePath != NULL);\r
   )\r
 {\r
   ASSERT (DevicePath != NULL);\r
@@ -401,7 +397,7 @@ EFIAPI
 ReportStatusCodeWithExtendedData (\r
   IN EFI_STATUS_CODE_TYPE   Type,\r
   IN EFI_STATUS_CODE_VALUE  Value,\r
 ReportStatusCodeWithExtendedData (\r
   IN EFI_STATUS_CODE_TYPE   Type,\r
   IN EFI_STATUS_CODE_VALUE  Value,\r
-  IN VOID                   *ExtendedData,\r
+  IN CONST VOID             *ExtendedData,\r
   IN UINTN                  ExtendedDataSize\r
   )\r
 {\r
   IN UINTN                  ExtendedDataSize\r
   )\r
 {\r
@@ -466,9 +462,9 @@ ReportStatusCodeEx (
   IN EFI_STATUS_CODE_TYPE   Type,\r
   IN EFI_STATUS_CODE_VALUE  Value,\r
   IN UINT32                 Instance,\r
   IN EFI_STATUS_CODE_TYPE   Type,\r
   IN EFI_STATUS_CODE_VALUE  Value,\r
   IN UINT32                 Instance,\r
-  IN EFI_GUID               *CallerId           OPTIONAL,\r
-  IN EFI_GUID               *ExtendedDataGuid   OPTIONAL,\r
-  IN VOID                   *ExtendedData       OPTIONAL,\r
+  IN CONST EFI_GUID         *CallerId          OPTIONAL,\r
+  IN CONST EFI_GUID         *ExtendedDataGuid  OPTIONAL,\r
+  IN CONST VOID             *ExtendedData      OPTIONAL,\r
   IN UINTN                  ExtendedDataSize\r
   )\r
 {\r
   IN UINTN                  ExtendedDataSize\r
   )\r
 {\r
index 5c022d6adcbaa1e9664124a69825dd4f453a31e9..dda3d717e8057b6fe627f0417109cd53f8b64495 100644 (file)
@@ -45,48 +45,21 @@ InternalReportStatusCode (
   IN EFI_STATUS_CODE_TYPE     Type,\r
   IN EFI_STATUS_CODE_VALUE    Value,\r
   IN UINT32                   Instance,\r
   IN EFI_STATUS_CODE_TYPE     Type,\r
   IN EFI_STATUS_CODE_VALUE    Value,\r
   IN UINT32                   Instance,\r
-  IN EFI_GUID                 *CallerId OPTIONAL,\r
+  IN CONST EFI_GUID           *CallerId OPTIONAL,\r
   IN EFI_STATUS_CODE_DATA     *Data     OPTIONAL  \r
   )\r
 {\r
   EFI_PEI_SERVICES  **PeiServices;\r
   \r
   PeiServices = GetPeiServicesTablePointer ();\r
   IN EFI_STATUS_CODE_DATA     *Data     OPTIONAL  \r
   )\r
 {\r
   EFI_PEI_SERVICES  **PeiServices;\r
   \r
   PeiServices = GetPeiServicesTablePointer ();\r
-  return (*PeiServices)->PeiReportStatusCode (PeiServices, Type, Value, Instance, CallerId, Data);\r
-}\r
-\r
-\r
-/**\r
-  Computes and returns the size, in bytes, of a device path.\r
-\r
-  @param  DevicePath  A pointer to a device path.\r
-\r
-  @return  The size, in bytes, of DevicePath.\r
-\r
-**/\r
-UINTN\r
-InternalReportStatusCodeDevicePathSize (\r
-  IN EFI_DEVICE_PATH_PROTOCOL  *DevicePath\r
-  )\r
-{\r
-  EFI_DEVICE_PATH_PROTOCOL  *Start;\r
-\r
-  if (DevicePath == NULL) {\r
-    return 0;\r
-  }\r
-\r
-  //\r
-  // Search for the end of the device path structure\r
-  //\r
-  Start = DevicePath;\r
-  while (!EfiIsDevicePathEnd (DevicePath)) {\r
-    DevicePath = EfiNextDevicePathNode (DevicePath);\r
-  }\r
-\r
-  //\r
-  // Subtract the start node from the end node and add in the size of the end node\r
-  //\r
-  return ((UINTN) DevicePath - (UINTN) Start) + DevicePathNodeLength (DevicePath);\r
+  return (*PeiServices)->PeiReportStatusCode (\r
+                           PeiServices,\r
+                           Type,\r
+                           Value,\r
+                           Instance,\r
+                           (EFI_GUID *)CallerId,\r
+                           Data\r
+                           );\r
 }\r
 \r
 \r
 }\r
 \r
 \r
@@ -173,12 +146,12 @@ CodeTypeToPostCode (
 BOOLEAN\r
 EFIAPI\r
 ReportStatusCodeExtractAssertInfo (\r
 BOOLEAN\r
 EFIAPI\r
 ReportStatusCodeExtractAssertInfo (\r
-  IN  EFI_STATUS_CODE_TYPE   CodeType,\r
-  IN  EFI_STATUS_CODE_VALUE  Value,  \r
-  IN  EFI_STATUS_CODE_DATA   *Data, \r
-  OUT CHAR8                  **Filename,\r
-  OUT CHAR8                  **Description,\r
-  OUT UINT32                 *LineNumber\r
+  IN EFI_STATUS_CODE_TYPE        CodeType,\r
+  IN EFI_STATUS_CODE_VALUE       Value,  \r
+  IN CONST EFI_STATUS_CODE_DATA  *Data, \r
+  OUT CHAR8                      **Filename,\r
+  OUT CHAR8                      **Description,\r
+  OUT UINT32                     *LineNumber\r
   )\r
 {\r
   EFI_DEBUG_ASSERT_DATA  *AssertData;\r
   )\r
 {\r
   EFI_DEBUG_ASSERT_DATA  *AssertData;\r
@@ -233,10 +206,10 @@ ReportStatusCodeExtractAssertInfo (
 BOOLEAN\r
 EFIAPI\r
 ReportStatusCodeExtractDebugInfo (\r
 BOOLEAN\r
 EFIAPI\r
 ReportStatusCodeExtractDebugInfo (\r
-  IN  EFI_STATUS_CODE_DATA  *Data,\r
-  OUT UINT32                *ErrorLevel,\r
-  OUT VA_LIST               *Marker,\r
-  OUT CHAR8                 **Format\r
+  IN CONST EFI_STATUS_CODE_DATA  *Data, \r
+  OUT UINT32                     *ErrorLevel,\r
+  OUT VA_LIST                    *Marker,\r
+  OUT CHAR8                      **Format\r
   )\r
 {\r
   EFI_DEBUG_INFO  *DebugInfo;\r
   )\r
 {\r
   EFI_DEBUG_INFO  *DebugInfo;\r
@@ -334,18 +307,13 @@ ReportStatusCode (
 EFI_STATUS\r
 EFIAPI\r
 ReportStatusCodeWithDevicePath (\r
 EFI_STATUS\r
 EFIAPI\r
 ReportStatusCodeWithDevicePath (\r
-  IN EFI_STATUS_CODE_TYPE      Type,\r
-  IN EFI_STATUS_CODE_VALUE     Value,\r
-  IN EFI_DEVICE_PATH_PROTOCOL  *DevicePath\r
+  IN EFI_STATUS_CODE_TYPE            Type,\r
+  IN EFI_STATUS_CODE_VALUE           Value,\r
+  IN CONST EFI_DEVICE_PATH_PROTOCOL  *DevicePath\r
   )\r
 {\r
   ASSERT (DevicePath != NULL);\r
   )\r
 {\r
   ASSERT (DevicePath != NULL);\r
-  return ReportStatusCodeWithExtendedData (\r
-           Type, \r
-           Value, \r
-           (VOID *)DevicePath, \r
-           InternalReportStatusCodeDevicePathSize (DevicePath)\r
-           );\r
+  return EFI_UNSUPPORTED;\r
 }\r
 \r
 \r
 }\r
 \r
 \r
@@ -387,7 +355,7 @@ EFIAPI
 ReportStatusCodeWithExtendedData (\r
   IN EFI_STATUS_CODE_TYPE   Type,\r
   IN EFI_STATUS_CODE_VALUE  Value,\r
 ReportStatusCodeWithExtendedData (\r
   IN EFI_STATUS_CODE_TYPE   Type,\r
   IN EFI_STATUS_CODE_VALUE  Value,\r
-  IN VOID                   *ExtendedData,\r
+  IN CONST VOID             *ExtendedData,\r
   IN UINTN                  ExtendedDataSize\r
   )\r
 {\r
   IN UINTN                  ExtendedDataSize\r
   )\r
 {\r
@@ -452,9 +420,9 @@ ReportStatusCodeEx (
   IN EFI_STATUS_CODE_TYPE   Type,\r
   IN EFI_STATUS_CODE_VALUE  Value,\r
   IN UINT32                 Instance,\r
   IN EFI_STATUS_CODE_TYPE   Type,\r
   IN EFI_STATUS_CODE_VALUE  Value,\r
   IN UINT32                 Instance,\r
-  IN EFI_GUID               *CallerId           OPTIONAL,\r
-  IN EFI_GUID               *ExtendedDataGuid   OPTIONAL,\r
-  IN VOID                   *ExtendedData       OPTIONAL,\r
+  IN CONST EFI_GUID         *CallerId          OPTIONAL,\r
+  IN CONST EFI_GUID         *ExtendedDataGuid  OPTIONAL,\r
+  IN CONST VOID             *ExtendedData      OPTIONAL,\r
   IN UINTN                  ExtendedDataSize\r
   )\r
 {\r
   IN UINTN                  ExtendedDataSize\r
   )\r
 {\r
index 0240c38dbc0f603eb1cd5a8aca62b7409fece069..b4c13c850b346154c308593ef3b9a984c8e0d260 100644 (file)
@@ -23,6 +23,7 @@ GetPeiServicesTablePointer (
   VOID\r
   )\r
 {\r
   VOID\r
   )\r
 {\r
+  ASSERT (gPeiServices != NULL);\r
   return gPeiServices;\r
 }\r
 \r
   return gPeiServices;\r
 }\r
 \r
index 4578872a33757d3fca0f10d5f43880e935a39ea3..3b895013a7c36e6ba9efdee541341c0fa6b4b080 100644 (file)
@@ -33,6 +33,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
   </MsaLibHeader>\r
   <LibraryClassDefinitions>\r
     <LibraryClass Usage="ALWAYS_PRODUCED">PeiServicesTablePointerLib</LibraryClass>\r
   </MsaLibHeader>\r
   <LibraryClassDefinitions>\r
     <LibraryClass Usage="ALWAYS_PRODUCED">PeiServicesTablePointerLib</LibraryClass>\r
+    <LibraryClass Usage="ALWAYS_CONSUMED">DebugLib</LibraryClass>\r
   </LibraryClassDefinitions>\r
   <SourceFiles>\r
     <Filename>PeiServicesTablePointer.c</Filename>\r
   </LibraryClassDefinitions>\r
   <SourceFiles>\r
     <Filename>PeiServicesTablePointer.c</Filename>\r
index 285a5a05ad4ce74938a99a9e1705280d38beba84..f5faf63086bb1c4fd290de04d747deaab7214864 100644 (file)
@@ -21,7 +21,11 @@ GetPeiServicesTablePointer (
   VOID\r
   )\r
 {\r
   VOID\r
   )\r
 {\r
-  return (EFI_PEI_SERVICES **)(UINTN)AsmReadMm7 ();\r
+  EFI_PEI_SERVICES  **PeiServices;\r
+\r
+  PeiServices = (EFI_PEI_SERVICES **)(UINTN)AsmReadMm7 ();\r
+  ASSERT (PeiServices != NULL);\r
+  return PeiServices;\r
 }\r
 \r
 /**\r
 }\r
 \r
 /**\r
index 7a6d8ba45aa4ed91282fcf4d11c8a6df9ae6f8e1..e9aac1d2cdc51283daf338edf9ac6f17b0dc17ae 100644 (file)
@@ -34,6 +34,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
   <LibraryClassDefinitions>\r
     <LibraryClass Usage="ALWAYS_PRODUCED">PeiServicesTablePointerLib</LibraryClass>\r
     <LibraryClass Usage="ALWAYS_CONSUMED">BaseLib</LibraryClass>\r
   <LibraryClassDefinitions>\r
     <LibraryClass Usage="ALWAYS_PRODUCED">PeiServicesTablePointerLib</LibraryClass>\r
     <LibraryClass Usage="ALWAYS_CONSUMED">BaseLib</LibraryClass>\r
+    <LibraryClass Usage="ALWAYS_CONSUMED">DebugLib</LibraryClass>\r
   </LibraryClassDefinitions>\r
   <SourceFiles>\r
     <Filename>PeiServicesTablePointer.c</Filename>\r
   </LibraryClassDefinitions>\r
   <SourceFiles>\r
     <Filename>PeiServicesTablePointer.c</Filename>\r
index 27d82b3feb3097bed725c04f736299274a22c593..97db1f41babb08d5d5ef2e614f50da1f7f279072 100644 (file)
@@ -76,7 +76,7 @@ DebugPrint (
   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
   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 \93ASSERT <FileName>(<LineNumber>): <Description>\n\94 \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
   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
@@ -85,9 +85,9 @@ DebugPrint (
   DebugAssert() must actively prevent recusrsion.  If DebugAssert() is called while\r
   processing another DebugAssert(), then DebugAssert() must return immediately.\r
 \r
   DebugAssert() must actively prevent recusrsion.  If DebugAssert() is called while\r
   processing another DebugAssert(), then DebugAssert() must return immediately.\r
 \r
-  If FileName is NULL, then a <FileName> string of \93(NULL) Filename\94 is printed.\r
+  If FileName is NULL, then a <FileName> string of "(NULL) Filename" is printed.\r
 \r
 \r
-  If Description is NULL, then a <Description> string of \93(NULL) Description\94 is printed.\r
+  If Description is NULL, then a <Description> string of "(NULL) Description" is printed.\r
 \r
   @param  FileName     Pointer to the name of the source file that generated the assert condition.\r
   @param  LineNumber   The line number in the source file that generated the assert condition\r
 \r
   @param  FileName     Pointer to the name of the source file that generated the assert condition.\r
   @param  LineNumber   The line number in the source file that generated the assert condition\r
index 18f651c194520e2bc3b3eb54c69b4da4b744bb90..986c5234cc1e5177e3efd986b8c3a6770f1cf11f 100644 (file)
@@ -76,7 +76,7 @@ DebugPrint (
   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
   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 \93ASSERT <FileName>(<LineNumber>): <Description>\n\94 \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
   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
@@ -85,9 +85,9 @@ DebugPrint (
   DebugAssert() must actively prevent recusrsion.  If DebugAssert() is called while\r
   processing another DebugAssert(), then DebugAssert() must return immediately.\r
 \r
   DebugAssert() must actively prevent recusrsion.  If DebugAssert() is called while\r
   processing another DebugAssert(), then DebugAssert() must return immediately.\r
 \r
-  If FileName is NULL, then a <FileName> string of \93(NULL) Filename\94 is printed.\r
+  If FileName is NULL, then a <FileName> string of "(NULL) Filename" is printed.\r
 \r
 \r
-  If Description is NULL, then a <Description> string of \93(NULL) Description\94 is printed.\r
+  If Description is NULL, then a <Description> string of "(NULL) Description" is printed.\r
 \r
   @param  FileName     Pointer to the name of the source file that generated the assert condition.\r
   @param  LineNumber   The line number in the source file that generated the assert condition\r
 \r
   @param  FileName     Pointer to the name of the source file that generated the assert condition.\r
   @param  LineNumber   The line number in the source file that generated the assert condition\r