summaryrefslogtreecommitdiff
path: root/MdePkg/Library/BasePrintLib
diff options
context:
space:
mode:
authorqhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524>2007-02-13 11:12:05 +0000
committerqhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524>2007-02-13 11:12:05 +0000
commit0d49d8f681f213415c8e756b488692c83bcab62f (patch)
tree0aa3376d488bde051a267a7a96d7939740766096 /MdePkg/Library/BasePrintLib
parentf1ad92e867a0b4f3299a88de4c1c7e0844f699f3 (diff)
downloadedk2-platforms-0d49d8f681f213415c8e756b488692c83bcab62f.tar.xz
1. Add two interfaces in PeCoffGetEntryPointLib.h
2. Fix the description of EfiTestChildHandle & EfiTestManagedDevice 3. Clean up BasePciLbPciCf8 & BasePciLibPciExpress to remove the dependency on DebugLib git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@2387 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdePkg/Library/BasePrintLib')
-rw-r--r--MdePkg/Library/BasePrintLib/PrintLib.c21
1 files changed, 18 insertions, 3 deletions
diff --git a/MdePkg/Library/BasePrintLib/PrintLib.c b/MdePkg/Library/BasePrintLib/PrintLib.c
index 5263dda288..02725586e5 100644
--- a/MdePkg/Library/BasePrintLib/PrintLib.c
+++ b/MdePkg/Library/BasePrintLib/PrintLib.c
@@ -16,8 +16,9 @@
#include "PrintLibInternal.h"
-#define WARNING_STATUS_NUMBER 4
-#define ERROR_STATUS_NUMBER 24
+#define WARNING_STATUS_NUMBER 4
+#define ERROR_STATUS_NUMBER 24
+#define ASSERT_UNICODE_BUFFER(Buffer) ASSERT ((((UINTN) (Buffer)) & 0x01) == 0)
GLOBAL_REMOVE_IF_UNREFERENCED CONST CHAR8 *StatusString [] = {
"Success", // RETURN_SUCCESS = 0
@@ -613,7 +614,9 @@ BasePrintLibSPrint (
If BufferSize is 0 or 1, then no output buffer is produced and 0 is returned.
If BufferSize > 1 and StartOfBuffer is NULL, then ASSERT().
+ If BufferSize > 1 and StartOfBuffer is not aligned on a 16-bit boundary, then ASSERT().
If BufferSize > 1 and FormatString is NULL, then ASSERT().
+ If BufferSize > 1 and FormatString is not aligned on a 16-bit boundary, then ASSERT().
If PcdMaximumUnicodeStringLength is not zero, and FormatString contains more than
PcdMaximumUnicodeStringLength Unicode characters not including the Null-terminator, then
ASSERT().
@@ -640,6 +643,8 @@ UnicodeVSPrint (
IN VA_LIST Marker
)
{
+ ASSERT_UNICODE_BUFFER(StartOfBuffer);
+ ASSERT_UNICODE_BUFFER(FormatString);
return BasePrintLibVSPrint ((CHAR8 *)StartOfBuffer, BufferSize >> 1, FORMAT_UNICODE | OUTPUT_UNICODE, (CHAR8 *)FormatString, Marker);
}
@@ -656,7 +661,9 @@ UnicodeVSPrint (
If BufferSize is 0 or 1, then no output buffer is produced and 0 is returned.
If BufferSize > 1 and StartOfBuffer is NULL, then ASSERT().
+ If BufferSize > 1 and StartOfBuffer is not aligned on a 16-bit boundary, then ASSERT().
If BufferSize > 1 and FormatString is NULL, then ASSERT().
+ If BufferSize > 1 and FormatString is not aligned on a 16-bit boundary, then ASSERT().
If PcdMaximumUnicodeStringLength is not zero, and FormatString contains more than
PcdMaximumUnicodeStringLength Unicode characters not including the Null-terminator, then
ASSERT().
@@ -702,6 +709,7 @@ UnicodeSPrint (
If BufferSize is 0 or 1, then no output buffer is produced and 0 is returned.
If BufferSize > 1 and StartOfBuffer is NULL, then ASSERT().
+ If BufferSize > 1 and StartOfBuffer is not aligned on a 16-bit boundary, then ASSERT().
If BufferSize > 1 and FormatString is NULL, then ASSERT().
If PcdMaximumAsciiStringLength is not zero, and FormatString contains more than
PcdMaximumAsciiStringLength ASCII characters not including the Null-terminator, then
@@ -729,6 +737,7 @@ UnicodeVSPrintAsciiFormat (
IN VA_LIST Marker
)
{
+ ASSERT_UNICODE_BUFFER(StartOfBuffer);
return BasePrintLibVSPrint ((CHAR8 *)StartOfBuffer, BufferSize >> 1, OUTPUT_UNICODE,FormatString, Marker);
}
@@ -746,6 +755,7 @@ UnicodeVSPrintAsciiFormat (
If BufferSize is 0 or 1, then no output buffer is produced and 0 is returned.
If BufferSize > 1 and StartOfBuffer is NULL, then ASSERT().
+ If BufferSize > 1 and StartOfBuffer is not aligned on a 16-bit boundary, then ASSERT().
If BufferSize > 1 and FormatString is NULL, then ASSERT().
If PcdMaximumAsciiStringLength is not zero, and FormatString contains more than
PcdMaximumAsciiStringLength ASCII characters not including the Null-terminator, then
@@ -804,6 +814,7 @@ UnicodeSPrintAsciiFormat (
add up to Width characters.
If both COMMA_TYPE and HEX_RADIX are set in Flags, then ASSERT().
If Buffer is NULL, then ASSERT().
+ If Buffer is not aligned on a 16-bit boundary, then ASSERT().
If unsupported bits are set in Flags, then ASSERT().
If both COMMA_TYPE and HEX_RADIX are set in Flags, then ASSERT().
If Width >= MAXIMUM_VALUE_CHARACTERS, then ASSERT()
@@ -827,6 +838,7 @@ UnicodeValueToString (
IN UINTN Width
)
{
+ ASSERT_UNICODE_BUFFER(Buffer);
return BasePrintLibConvertValueToString ((CHAR8 *)Buffer, Flags, Value, Width, 2);
}
@@ -935,6 +947,7 @@ AsciiSPrint (
If BufferSize > 0 and StartOfBuffer is NULL, then ASSERT().
If BufferSize > 0 and FormatString is NULL, then ASSERT().
+ If BufferSize > 0 and FormatString is not aligned on a 16-bit boundary, then ASSERT().
If PcdMaximumUnicodeStringLength is not zero, and FormatString contains more than
PcdMaximumUnicodeStringLength Unicode characters not including the Null-terminator, then
ASSERT().
@@ -961,6 +974,7 @@ AsciiVSPrintUnicodeFormat (
IN VA_LIST Marker
)
{
+ ASSERT_UNICODE_BUFFER (FormatString);
return BasePrintLibVSPrint (StartOfBuffer, BufferSize, FORMAT_UNICODE, (CHAR8 *)FormatString, Marker);
}
@@ -979,6 +993,7 @@ AsciiVSPrintUnicodeFormat (
If BufferSize > 0 and StartOfBuffer is NULL, then ASSERT().
If BufferSize > 0 and FormatString is NULL, then ASSERT().
+ If BufferSize > 0 and FormatString is not aligned on a 16-bit boundary, then ASSERT().
If PcdMaximumUnicodeStringLength is not zero, and FormatString contains more than
PcdMaximumUnicodeStringLength Unicode characters not including the Null-terminator, then
ASSERT().
@@ -1060,6 +1075,6 @@ AsciiValueToString (
IN UINTN Width
)
{
- return BasePrintLibConvertValueToString ((CHAR8 *)Buffer, Flags, Value, Width, 1);
+ return BasePrintLibConvertValueToString (Buffer, Flags, Value, Width, 1);
}