\r
#include <Protocol/DebugPort.h>\r
\r
-\r
EFI_DEBUGPORT_PROTOCOL *gDebugPort = NULL;\r
-UINTN gTimeOut = 0;\r
+UINTN gTimeOut = 0;\r
\r
/**\r
The constructor function initializes the UART.\r
IN EFI_SYSTEM_TABLE *SystemTable\r
)\r
{\r
- EFI_STATUS Status;\r
+ EFI_STATUS Status;\r
\r
Status = gBS->LocateProtocol (&gEfiDebugPortProtocolGuid, NULL, (VOID **)&gDebugPort);\r
if (!EFI_ERROR (Status)) {\r
return Status;\r
}\r
\r
-\r
-\r
/**\r
Sets the baud rate, receive FIFO depth, transmit/receive time out, parity,\r
data buts, and stop bits on a serial device. This call is optional as the serial\r
RETURN_STATUS\r
EFIAPI\r
GdbSerialInit (\r
- IN UINT64 BaudRate,\r
- IN UINT8 Parity,\r
- IN UINT8 DataBits,\r
- IN UINT8 StopBits\r
+ IN UINT64 BaudRate,\r
+ IN UINT8 Parity,\r
+ IN UINT8 DataBits,\r
+ IN UINT8 StopBits\r
)\r
{\r
EFI_STATUS Status;\r
return Status;\r
}\r
\r
-\r
/**\r
Check to see if a character is available from GDB. Do not read the character as that is\r
done via GdbGetChar().\r
return (Status == EFI_SUCCESS ? TRUE : FALSE);\r
}\r
\r
-\r
/**\r
Get a character from GDB. This function must be able to run in interrupt context.\r
\r
\r
do {\r
BufferSize = sizeof (Char);\r
- Status = gDebugPort->Read (gDebugPort, gTimeOut, &BufferSize, &Char);\r
+ Status = gDebugPort->Read (gDebugPort, gTimeOut, &BufferSize, &Char);\r
} while (EFI_ERROR (Status) || BufferSize != sizeof (Char));\r
\r
return Char;\r
}\r
\r
-\r
/**\r
Send a character to GDB. This function must be able to run in interrupt context.\r
\r
@param Char Send a character to GDB\r
\r
**/\r
-\r
VOID\r
EFIAPI\r
GdbPutChar (\r
- IN CHAR8 Char\r
+ IN CHAR8 Char\r
)\r
{\r
EFI_STATUS Status;\r
\r
do {\r
BufferSize = sizeof (Char);\r
- Status = gDebugPort->Write (gDebugPort, gTimeOut, &BufferSize, &Char);\r
+ Status = gDebugPort->Write (gDebugPort, gTimeOut, &BufferSize, &Char);\r
} while (EFI_ERROR (Status) || BufferSize != sizeof (Char));\r
\r
return;\r
@param String Send a string to GDB\r
\r
**/\r
-\r
VOID\r
GdbPutString (\r
IN CHAR8 *String\r
)\r
{\r
- // We could performance enhance this function by calling gDebugPort->Write ()\r
+ // We could performance enhance this function by calling gDebugPort->Write ()\r
while (*String != '\0') {\r
GdbPutChar (*String);\r
String++;\r
}\r
}\r
-\r
-\r
-\r
-\r