MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf\r
HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf\r
ExtractGuidedSectionLib|MdePkg/Library/DxeExtractGuidedSectionLib/DxeExtractGuidedSectionLib.inf\r
+ SerialPortLib|PcAtChipsetPkg/Library/SerialIoLib/SerialIoLib.inf\r
\r
#\r
# To save size, use NULL library for DebugLib and ReportStatusCodeLib.\r
<LibraryClasses>\r
DebugLib|IntelFrameworkModulePkg/Library/PeiDxeDebugLibReportStatusCode/PeiDxeDebugLibReportStatusCode.inf\r
ReportStatusCodeLib|DuetPkg/Library/DxeCoreReportStatusCodeLibFromHob/DxeCoreReportStatusCodeLibFromHob.inf\r
- SerialPortLib|PcAtChipsetPkg/Library/SerialIoLib/SerialIoLib.inf\r
}\r
\r
MdeModulePkg/Universal/PCD/Dxe/Pcd.inf\r
MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf\r
HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf\r
ExtractGuidedSectionLib|MdePkg/Library/DxeExtractGuidedSectionLib/DxeExtractGuidedSectionLib.inf\r
+ SerialPortLib|PcAtChipsetPkg/Library/SerialIoLib/SerialIoLib.inf\r
\r
#\r
# To save size, use NULL library for DebugLib and ReportStatusCodeLib.\r
<LibraryClasses>\r
DebugLib|IntelFrameworkModulePkg/Library/PeiDxeDebugLibReportStatusCode/PeiDxeDebugLibReportStatusCode.inf\r
ReportStatusCodeLib|DuetPkg/Library/DxeCoreReportStatusCodeLibFromHob/DxeCoreReportStatusCodeLibFromHob.inf\r
- SerialPortLib|PcAtChipsetPkg/Library/SerialIoLib/SerialIoLib.inf\r
}\r
\r
MdeModulePkg/Universal/PCD/Dxe/Pcd.inf\r
--*/\r
#include "EfiLdr.h"\r
#include "Debug.h"\r
+#include <Library/SerialPortLib.h>\r
\r
UINT8 *mCursor;\r
UINT8 mHeaderIndex = 10;\r
mCursor = (UINT8 *)(UINTN)(0x000b8000 + 160);\r
}\r
\r
-VOID\r
-PrintValue64 (\r
- UINT64 Value\r
+\r
+VOID \r
+PrintU32Base10 (\r
+ UINT32 Value\r
)\r
{\r
- PrintValue ((UINT32) RShiftU64 (Value, 32));\r
- PrintValue ((UINT32) Value);\r
+ UINT32 Index;\r
+ CHAR8 Char;\r
+ CHAR8 String[11];\r
+ UINTN StringPos;\r
+ UINT32 B10Div;\r
+\r
+ B10Div = 1000000000;\r
+ for (Index = 0, StringPos = 0; Index < 10; Index++) {\r
+ Char = ((Value / B10Div) % 10) + '0';\r
+ if ((StringPos > 0) || (Char != '0')) {\r
+ String[StringPos] = Char;\r
+ StringPos++;\r
+ }\r
+ B10Div = B10Div / 10;\r
+ }\r
+\r
+ if (StringPos == 0) {\r
+ String[0] = '0';\r
+ StringPos++;\r
+ }\r
+\r
+ String[StringPos] = '\0';\r
+\r
+ PrintString (String);\r
}\r
\r
+\r
VOID\r
PrintValue (\r
UINT32 Value\r
)\r
{\r
UINT32 Index;\r
- UINT8 Char;\r
+ CHAR8 Char;\r
+ CHAR8 String[9];\r
\r
for (Index = 0; Index < 8; Index++) {\r
Char = (UINT8)(((Value >> ((7 - Index) * 4)) & 0x0f) + '0');\r
if (Char > '9') {\r
Char = (UINT8) (Char - '0' - 10 + 'A');\r
}\r
- *mCursor = Char;\r
- mCursor += 2;\r
+ String[Index] = Char;\r
}\r
+\r
+ String[sizeof (String) - 1] = '\0';\r
+\r
+ PrintString (String);\r
+}\r
+\r
+VOID\r
+PrintValue64 (\r
+ UINT64 Value\r
+ )\r
+{\r
+ PrintValue ((UINT32) RShiftU64 (Value, 32));\r
+ PrintValue ((UINT32) Value);\r
}\r
\r
VOID\r
mCursor += 2;\r
}\r
}\r
+\r
+ //\r
+ // All information also output to serial port.\r
+ //\r
+ SerialPortWrite ((UINT8*) String, Index);\r
}\r
\r