]> git.proxmox.com Git - mirror_edk2.git/blobdiff - OvmfPkg/Library/PlatformDebugLibIoPort/DebugLib.c
OvmfPkg/PlatformDebugLibIoPort: write messages with IoWriteFifo8()
[mirror_edk2.git] / OvmfPkg / Library / PlatformDebugLibIoPort / DebugLib.c
index 44850a9dbad06117840a703666930f949fdb847a..5435767c1c69a8c0bef1fdf60500a013980a49b6 100644 (file)
@@ -69,7 +69,7 @@ DebugPrint (
 {\r
   CHAR8    Buffer[MAX_DEBUG_MESSAGE_LENGTH];\r
   VA_LIST  Marker;\r
-  UINT8    *Ptr;\r
+  UINTN    Length;\r
 \r
   //\r
   // If Format is NULL, then ASSERT().\r
@@ -87,15 +87,13 @@ DebugPrint (
   // Convert the DEBUG() message to an ASCII String\r
   //\r
   VA_START (Marker, Format);\r
-  AsciiVSPrint (Buffer, sizeof (Buffer), Format, Marker);\r
+  Length = AsciiVSPrint (Buffer, sizeof (Buffer), Format, Marker);\r
   VA_END (Marker);\r
 \r
   //\r
   // Send the print string to the debug I/O port\r
   //\r
-  for (Ptr = (UINT8 *) Buffer; *Ptr; Ptr++) {\r
-    IoWrite8 (PcdGet16(PcdDebugIoPort), *Ptr);\r
-  }\r
+  IoWriteFifo8 (PcdGet16 (PcdDebugIoPort), Length, Buffer);\r
 }\r
 \r
 \r
@@ -129,20 +127,18 @@ DebugAssert (
   )\r
 {\r
   CHAR8  Buffer[MAX_DEBUG_MESSAGE_LENGTH];\r
-  UINT8 *Ptr;\r
+  UINTN  Length;\r
 \r
   //\r
   // Generate the ASSERT() message in Ascii format\r
   //\r
-  AsciiSPrint (Buffer, sizeof Buffer, "ASSERT %a(%Lu): %a\n", FileName,\r
-    (UINT64)LineNumber, Description);\r
+  Length = AsciiSPrint (Buffer, sizeof Buffer, "ASSERT %a(%Lu): %a\n",\r
+             FileName, (UINT64)LineNumber, Description);\r
 \r
   //\r
-  // Send the print string to the Console Output device\r
+  // Send the print string to the debug I/O port\r
   //\r
-  for (Ptr = (UINT8 *) Buffer; *Ptr; Ptr++) {\r
-    IoWrite8 (PcdGet16(PcdDebugIoPort), *Ptr);\r
-  }\r
+  IoWriteFifo8 (PcdGet16 (PcdDebugIoPort), Length, Buffer);\r
 \r
   //\r
   // Generate a Breakpoint, DeadLoop, or NOP based on PCD settings\r