TianoCore EDK2 master
|
#include <GdbStubInternal.h>
Go to the source code of this file.
Functions | |
VOID | GdbCtrlCBreakMessage (IN UINTN ErrNo) |
INTN | GdbParseFReplyPacket (IN CHAR8 *Packet, OUT UINTN *ErrNo) |
INTN | GdbRead (IN INTN FileDescriptor, OUT VOID *Buffer, IN UINTN Count) |
INTN | GdbWrite (IN INTN FileDescriptor, OUT CONST VOID *Buffer, IN UINTN Count) |
EFI_STATUS EFIAPI | GdbSerialReset (IN EFI_SERIAL_IO_PROTOCOL *This) |
EFI_STATUS EFIAPI | GdbSerialSetAttributes (IN EFI_SERIAL_IO_PROTOCOL *This, IN UINT64 BaudRate, IN UINT32 ReceiveFifoDepth, IN UINT32 Timeout, IN EFI_PARITY_TYPE Parity, IN UINT8 DataBits, IN EFI_STOP_BITS_TYPE StopBits) |
EFI_STATUS EFIAPI | GdbSerialSetControl (IN EFI_SERIAL_IO_PROTOCOL *This, IN UINT32 Control) |
EFI_STATUS EFIAPI | GdbSerialGetControl (IN EFI_SERIAL_IO_PROTOCOL *This, OUT UINT32 *Control) |
EFI_STATUS EFIAPI | GdbSerialWrite (IN EFI_SERIAL_IO_PROTOCOL *This, IN OUT UINTN *BufferSize, IN VOID *Buffer) |
EFI_STATUS EFIAPI | GdbSerialRead (IN EFI_SERIAL_IO_PROTOCOL *This, IN OUT UINTN *BufferSize, OUT VOID *Buffer) |
VOID | GdbInitializeSerialConsole (VOID) |
Variables | |
BOOLEAN | gCtrlCBreakFlag = FALSE |
BOOLEAN | gProcessingFPacket = FALSE |
GDB_SERIAL_DEV | gdbSerialDevTemplate |
Serial IO Abstraction for GDB stub. This allows an EFI consoles that shows up on the system running GDB. One console for error information and another console for user input/output.
Basic packet format is $packet-data::checksum. So every command has 4 bytes of overhead: $, #, 0, 0. The 0 and 0 are the ascii characters for the checksum.
Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file SerialIo.c.
Process a control-C break message.
Currently a place holder, remove the ASSERT when it gets implemented.
ErrNo | Error information from the F reply packet or other source |
Definition at line 39 of file SerialIo.c.
VOID GdbInitializeSerialConsole | ( | VOID | ) |
Make two serial consoles: 1) StdIn and StdOut via GDB. 2) StdErr via GDB.
These console show up on the remote system running GDB
Definition at line 498 of file SerialIo.c.
Parse the F reply packet and extract the return value and an ErrNo if it exists.
Packet | Packet to parse like an F reply packet |
ErrNo | Buffer to hold Count bytes that were read |
-1 | Error, not a valid F reply packet |
other | Return the return code from the F reply packet |
Definition at line 62 of file SerialIo.c.
Read data from a FileDescriptor. On success number of bytes read is returned. Zero indicates the end of a file. On error -1 is returned. If count is zero, GdbRead returns zero.
FileDescriptor | Device to talk to. |
Buffer | Buffer to hold Count bytes that were read |
Count | Number of bytes to transfer. |
-1 | Error |
{other} | Number of bytes read. |
Definition at line 115 of file SerialIo.c.
EFI_STATUS EFIAPI GdbSerialGetControl | ( | IN EFI_SERIAL_IO_PROTOCOL * | This, |
OUT UINT32 * | Control | ||
) |
Retrieves the status of the control bits on a serial device
This | Protocol instance pointer. |
Control | A pointer to return the current Control signals from the serial device. |
EFI_SUCCESS | The control bits were read from the serial device. |
EFI_DEVICE_ERROR | The serial device is not functioning correctly. |
Definition at line 355 of file SerialIo.c.
EFI_STATUS EFIAPI GdbSerialRead | ( | IN EFI_SERIAL_IO_PROTOCOL * | This, |
IN OUT UINTN * | BufferSize, | ||
OUT VOID * | Buffer | ||
) |
Writes data to a serial device.
This | Protocol instance pointer. |
BufferSize | On input, the size of the Buffer. On output, the amount of data returned in Buffer. |
Buffer | The buffer to return the data into. |
EFI_SUCCESS | The data was read. |
EFI_DEVICE_ERROR | The device reported an error. |
EFI_TIMEOUT | The data write was stopped due to a timeout. |
Definition at line 416 of file SerialIo.c.
EFI_STATUS EFIAPI GdbSerialReset | ( | IN EFI_SERIAL_IO_PROTOCOL * | This | ) |
Reset the serial device.
This | Protocol instance pointer. |
EFI_SUCCESS | The device was reset. |
EFI_DEVICE_ERROR | The serial device could not be reset. |
Definition at line 274 of file SerialIo.c.
EFI_STATUS EFIAPI GdbSerialSetAttributes | ( | IN EFI_SERIAL_IO_PROTOCOL * | This, |
IN UINT64 | BaudRate, | ||
IN UINT32 | ReceiveFifoDepth, | ||
IN UINT32 | Timeout, | ||
IN EFI_PARITY_TYPE | Parity, | ||
IN UINT8 | DataBits, | ||
IN EFI_STOP_BITS_TYPE | StopBits | ||
) |
Sets the baud rate, receive FIFO depth, transmit/receive time out, parity, data buts, and stop bits on a serial device.
This | Protocol instance pointer. |
BaudRate | The requested baud rate. A BaudRate value of 0 will use the device's default interface speed. |
ReceiveFifoDepth | The requested depth of the FIFO on the receive side of the serial interface. A ReceiveFifoDepth value of 0 will use the device's default FIFO depth. |
Timeout | The requested time out for a single character in microseconds. This timeout applies to both the transmit and receive side of the interface. A Timeout value of 0 will use the device's default time out value. |
Parity | The type of parity to use on this serial device. A Parity value of DefaultParity will use the device's default parity value. |
DataBits | The number of data bits to use on the serial device. A DataBits value of 0 will use the device's default data bit setting. |
StopBits | The number of stop bits to use on this serial device. A StopBits value of DefaultStopBits will use the device's default number of stop bits. |
EFI_SUCCESS | The device was reset. |
EFI_DEVICE_ERROR | The serial device could not be reset. |
Definition at line 309 of file SerialIo.c.
EFI_STATUS EFIAPI GdbSerialSetControl | ( | IN EFI_SERIAL_IO_PROTOCOL * | This, |
IN UINT32 | Control | ||
) |
Set the control bits on a serial device
This | Protocol instance pointer. |
Control | Set the bits of Control that are settable. |
EFI_SUCCESS | The new control bits were set on the serial device. |
EFI_UNSUPPORTED | The serial device does not support this operation. |
EFI_DEVICE_ERROR | The serial device is not functioning correctly. |
Definition at line 335 of file SerialIo.c.
EFI_STATUS EFIAPI GdbSerialWrite | ( | IN EFI_SERIAL_IO_PROTOCOL * | This, |
IN OUT UINTN * | BufferSize, | ||
IN VOID * | Buffer | ||
) |
Writes data to a serial device.
This | Protocol instance pointer. |
BufferSize | On input, the size of the Buffer. On output, the amount of data actually written. |
Buffer | The buffer of data to write |
EFI_SUCCESS | The data was written. |
EFI_DEVICE_ERROR | The device reported an error. |
EFI_TIMEOUT | The data write was stopped due to a timeout. |
Definition at line 378 of file SerialIo.c.
Write data to a FileDescriptor. On success number of bytes written is returned. Zero indicates nothing was written. On error -1 is returned.
FileDescriptor | Device to talk to. |
Buffer | Buffer to hold Count bytes that are to be written |
Count | Number of bytes to transfer. |
-1 | Error |
{other} | Number of bytes written. |
Definition at line 197 of file SerialIo.c.
BOOLEAN gCtrlCBreakFlag = FALSE |
Definition at line 21 of file SerialIo.c.
GDB_SERIAL_DEV gdbSerialDevTemplate |
Definition at line 442 of file SerialIo.c.
BOOLEAN gProcessingFPacket = FALSE |
Definition at line 28 of file SerialIo.c.