]> git.proxmox.com Git - mirror_edk2.git/blobdiff - SourceLevelDebugPkg/Library/DebugAgent/DxeDebugAgent/SerialIo.c
SourceLevelDebugPkg: Clean up source files
[mirror_edk2.git] / SourceLevelDebugPkg / Library / DebugAgent / DxeDebugAgent / SerialIo.c
index cb3b623038b90e0f72c4a3f367a83935984ac761..32ff007a9a2b0e40090a766d2077c7485e670480 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Install Serial IO Protocol that layers on top of a Debug Communication Library instance.\r
 \r
-  Copyright (c) 2012 - 2015, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2012 - 2018, Intel Corporation. All rights reserved.<BR>\r
   This program and the accompanying materials\r
   are licensed and made available under the terms and conditions of the BSD License\r
   which accompanies this distribution.  The full text of the license may be found at\r
@@ -31,7 +31,7 @@ EFIAPI
 SerialReset (\r
   IN EFI_SERIAL_IO_PROTOCOL  *This\r
   );\r
-  \r
+\r
 /**\r
   Set new attributes to a serial device.\r
 \r
@@ -246,7 +246,7 @@ DEBUG_SERIAL_FIFO            mSerialFifoForDebug    = {0, 0, DEBGU_SERIAL_IO_FIF
 \r
 /**\r
   Detect whether specific FIFO is empty or not.\r
\r
+\r
   @param[in]  Fifo    A pointer to the Data Structure DEBUG_SERIAL_FIFO.\r
 \r
   @return whether specific FIFO is empty or not.\r
@@ -357,7 +357,7 @@ DebugTerminalFifoRemove (
 }\r
 \r
 /**\r
-  Install EFI Serial IO protocol based on Debug Communication Library. \r
+  Install EFI Serial IO protocol based on Debug Communication Library.\r
 \r
 **/\r
 VOID\r
@@ -431,12 +431,12 @@ SerialSetAttributes (
   //\r
   // The Debug Communication Library CAN NOT change communications parameters (if it has)\r
   // actually. Because it also has no any idea on what parameters are based on, we cannot\r
-  // check the input parameters (like BaudRate, Parity, DataBits and StopBits). \r
+  // check the input parameters (like BaudRate, Parity, DataBits and StopBits).\r
   //\r
-  \r
+\r
   //\r
   // Update the Timeout value in the mode structure based on the request.\r
-  // The Debug Communication Library can not support a timeout on writes, but the timeout on \r
+  // The Debug Communication Library can not support a timeout on writes, but the timeout on\r
   // reads can be provided by this module.\r
   //\r
   if (Timeout == 0) {\r
@@ -444,11 +444,11 @@ SerialSetAttributes (
   } else {\r
     mSerialIoMode.Timeout = Timeout;\r
   }\r
-  \r
+\r
   //\r
   // Update the ReceiveFifoDepth value in the mode structure based on the request.\r
-  // This module assumes that the Debug Communication Library uses a FIFO depth of \r
-  // SERIAL_PORT_DEFAULT_RECEIVE_FIFO_DEPTH.  The Debug Communication Library may actually be \r
+  // This module assumes that the Debug Communication Library uses a FIFO depth of\r
+  // SERIAL_PORT_DEFAULT_RECEIVE_FIFO_DEPTH.  The Debug Communication Library may actually be\r
   // using a larger FIFO, but there is no way to tell.\r
   //\r
   if (ReceiveFifoDepth == 0 || ReceiveFifoDepth >= SERIAL_PORT_DEFAULT_RECEIVE_FIFO_DEPTH) {\r
@@ -512,21 +512,21 @@ SerialGetControl (
   // Raise TPL to prevent recursion from EFI timer interrupts\r
   //\r
   Tpl = gBS->RaiseTPL (TPL_NOTIFY);\r
-  \r
+\r
   //\r
   // Save and disable Debug Timer interrupt to avoid it to access Debug Port\r
   //\r
   DebugTimerInterruptState = SaveAndSetDebugTimerInterrupt (FALSE);\r
   Handle = GetDebugPortHandle ();\r
-  \r
+\r
   //\r
   // Always assume the output buffer is empty and the Debug Communication Library can process\r
   // more write requests.\r
   //\r
   *Control = mSerialIoMode.ControlMask | EFI_SERIAL_OUTPUT_BUFFER_EMPTY;\r
-  \r
+\r
   //\r
-  // Check to see if the Terminal FIFO is empty and \r
+  // Check to see if the Terminal FIFO is empty and\r
   // check to see if the input buffer in the Debug Communication Library is empty\r
   //\r
   if (!IsDebugTermianlFifoEmpty (&mSerialFifoForTerminal) || DebugPortPollBuffer (Handle)) {\r
@@ -535,14 +535,14 @@ SerialGetControl (
 \r
   //\r
   // Restore Debug Timer interrupt\r
-  //  \r
+  //\r
   SaveAndSetDebugTimerInterrupt (DebugTimerInterruptState);\r
-  \r
+\r
   //\r
   // Restore to original TPL\r
   //\r
   gBS->RestoreTPL (Tpl);\r
-  \r
+\r
   return EFI_SUCCESS;\r
 }\r
 \r
@@ -575,13 +575,13 @@ SerialWrite (
   // Raise TPL to prevent recursion from EFI timer interrupts\r
   //\r
   Tpl = gBS->RaiseTPL (TPL_NOTIFY);\r
-  \r
+\r
   //\r
   // Save and disable Debug Timer interrupt to avoid it to access Debug Port\r
   //\r
   DebugTimerInterruptState = SaveAndSetDebugTimerInterrupt (FALSE);\r
   Handle = GetDebugPortHandle ();\r
-  \r
+\r
   if ((mSerialIoMode.ControlMask & EFI_SERIAL_SOFTWARE_LOOPBACK_ENABLE) != 0)  {\r
     if (*BufferSize == 0) {\r
       return EFI_SUCCESS;\r
@@ -598,14 +598,14 @@ SerialWrite (
 \r
   //\r
   // Restore Debug Timer interrupt\r
-  //  \r
+  //\r
   SaveAndSetDebugTimerInterrupt (DebugTimerInterruptState);\r
-  \r
+\r
   //\r
   // Restore to original TPL\r
   //\r
   gBS->RestoreTPL (Tpl);\r
-  \r
+\r
   return EFI_SUCCESS;\r
 }\r
 \r
@@ -643,13 +643,13 @@ SerialRead (
   // Raise TPL to prevent recursion from EFI timer interrupts\r
   //\r
   Tpl = gBS->RaiseTPL (TPL_NOTIFY);\r
-  \r
+\r
   //\r
   // Save and disable Debug Timer interrupt to avoid it to access Debug Port\r
   //\r
   DebugTimerInterruptState = SaveAndSetDebugTimerInterrupt (FALSE);\r
   Handle = GetDebugPortHandle ();\r
\r
+\r
   Data8 = (UINT8 *) &DebugHeader;\r
   Uint8Buffer = (UINT8 *)Buffer;\r
   if ((mSerialIoMode.ControlMask & EFI_SERIAL_SOFTWARE_LOOPBACK_ENABLE) != 0)  {\r
@@ -671,7 +671,7 @@ SerialRead (
         continue;\r
       }\r
       //\r
-      // Read the input character from Debug Port \r
+      // Read the input character from Debug Port\r
       //\r
       if (!DebugPortPollBuffer (Handle)) {\r
         break;\r
@@ -703,14 +703,14 @@ SerialRead (
 \r
   //\r
   // Restore Debug Timer interrupt\r
-  //  \r
+  //\r
   SaveAndSetDebugTimerInterrupt (DebugTimerInterruptState);\r
-  \r
+\r
   //\r
   // Restore to original TPL\r
   //\r
   gBS->RestoreTPL (Tpl);\r
-  \r
+\r
   return EFI_SUCCESS;\r
 }\r
 \r
@@ -757,7 +757,7 @@ DebugReadBreakFromDebugPort (
       DebugAgentMsgPrint (DEBUG_AGENT_INFO, "Debug Timer attach symbol received %x", *Data8);\r
       *BreakSymbol = *Data8;\r
       return EFI_SUCCESS;\r
-    } \r
+    }\r
     if (*Data8 == DEBUG_STARTING_SYMBOL_NORMAL) {\r
       Status = ReadRemainingBreakPacket (Handle, &DebugHeader);\r
       if (Status == EFI_SUCCESS) {\r
@@ -775,7 +775,7 @@ DebugReadBreakFromDebugPort (
       DebugTerminalFifoAdd (&mSerialFifoForTerminal, *Data8);\r
     }\r
   }\r
-  \r
+\r
   return EFI_NOT_FOUND;\r
 }\r
 \r