summaryrefslogtreecommitdiff
path: root/EmbeddedPkg/Library/GdbSerialDebugPortLib/GdbSerialDebugPortLib.c
diff options
context:
space:
mode:
Diffstat (limited to 'EmbeddedPkg/Library/GdbSerialDebugPortLib/GdbSerialDebugPortLib.c')
-rw-r--r--EmbeddedPkg/Library/GdbSerialDebugPortLib/GdbSerialDebugPortLib.c32
1 files changed, 10 insertions, 22 deletions
diff --git a/EmbeddedPkg/Library/GdbSerialDebugPortLib/GdbSerialDebugPortLib.c b/EmbeddedPkg/Library/GdbSerialDebugPortLib/GdbSerialDebugPortLib.c
index d2bafcf..d53a5fe 100644
--- a/EmbeddedPkg/Library/GdbSerialDebugPortLib/GdbSerialDebugPortLib.c
+++ b/EmbeddedPkg/Library/GdbSerialDebugPortLib/GdbSerialDebugPortLib.c
@@ -16,9 +16,8 @@
#include <Protocol/DebugPort.h>
-
EFI_DEBUGPORT_PROTOCOL *gDebugPort = NULL;
-UINTN gTimeOut = 0;
+UINTN gTimeOut = 0;
/**
The constructor function initializes the UART.
@@ -36,7 +35,7 @@ GdbSerialLibDebugPortConstructor (
IN EFI_SYSTEM_TABLE *SystemTable
)
{
- EFI_STATUS Status;
+ EFI_STATUS Status;
Status = gBS->LocateProtocol (&gEfiDebugPortProtocolGuid, NULL, (VOID **)&gDebugPort);
if (!EFI_ERROR (Status)) {
@@ -47,8 +46,6 @@ GdbSerialLibDebugPortConstructor (
return Status;
}
-
-
/**
Sets the baud rate, receive FIFO depth, transmit/receive time out, parity,
data buts, and stop bits on a serial device. This call is optional as the serial
@@ -71,10 +68,10 @@ GdbSerialLibDebugPortConstructor (
RETURN_STATUS
EFIAPI
GdbSerialInit (
- IN UINT64 BaudRate,
- IN UINT8 Parity,
- IN UINT8 DataBits,
- IN UINT8 StopBits
+ IN UINT64 BaudRate,
+ IN UINT8 Parity,
+ IN UINT8 DataBits,
+ IN UINT8 StopBits
)
{
EFI_STATUS Status;
@@ -83,7 +80,6 @@ GdbSerialInit (
return Status;
}
-
/**
Check to see if a character is available from GDB. Do not read the character as that is
done via GdbGetChar().
@@ -105,7 +101,6 @@ GdbIsCharAvailable (
return (Status == EFI_SUCCESS ? TRUE : FALSE);
}
-
/**
Get a character from GDB. This function must be able to run in interrupt context.
@@ -124,13 +119,12 @@ GdbGetChar (
do {
BufferSize = sizeof (Char);
- Status = gDebugPort->Read (gDebugPort, gTimeOut, &BufferSize, &Char);
+ Status = gDebugPort->Read (gDebugPort, gTimeOut, &BufferSize, &Char);
} while (EFI_ERROR (Status) || BufferSize != sizeof (Char));
return Char;
}
-
/**
Send a character to GDB. This function must be able to run in interrupt context.
@@ -138,11 +132,10 @@ GdbGetChar (
@param Char Send a character to GDB
**/
-
VOID
EFIAPI
GdbPutChar (
- IN CHAR8 Char
+ IN CHAR8 Char
)
{
EFI_STATUS Status;
@@ -150,7 +143,7 @@ GdbPutChar (
do {
BufferSize = sizeof (Char);
- Status = gDebugPort->Write (gDebugPort, gTimeOut, &BufferSize, &Char);
+ Status = gDebugPort->Write (gDebugPort, gTimeOut, &BufferSize, &Char);
} while (EFI_ERROR (Status) || BufferSize != sizeof (Char));
return;
@@ -163,19 +156,14 @@ GdbPutChar (
@param String Send a string to GDB
**/
-
VOID
GdbPutString (
IN CHAR8 *String
)
{
- // We could performance enhance this function by calling gDebugPort->Write ()
+ // We could performance enhance this function by calling gDebugPort->Write ()
while (*String != '\0') {
GdbPutChar (*String);
String++;
}
}
-
-
-
-