Path: blob/main/sys/contrib/edk2/Include/Protocol/DebugPort.h
48383 views
/** @file12The file defines the EFI Debugport protocol.3This protocol is used by debug agent to communicate with the4remote debug host.56Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>7SPDX-License-Identifier: BSD-2-Clause-Patent89**/1011#ifndef __DEBUG_PORT_H__12#define __DEBUG_PORT_H__1314///15/// DebugPortIo protocol {EBA4E8D2-3858-41EC-A281-2647BA9660D0}16///17#define EFI_DEBUGPORT_PROTOCOL_GUID \18{ \190xEBA4E8D2, 0x3858, 0x41EC, {0xA2, 0x81, 0x26, 0x47, 0xBA, 0x96, 0x60, 0xD0 } \20}2122extern EFI_GUID gEfiDebugPortProtocolGuid;2324typedef struct _EFI_DEBUGPORT_PROTOCOL EFI_DEBUGPORT_PROTOCOL;2526//27// DebugPort member functions28//2930/**31Resets the debugport.3233@param This A pointer to the EFI_DEBUGPORT_PROTOCOL instance.3435@retval EFI_SUCCESS The debugport device was reset and is in usable state.36@retval EFI_DEVICE_ERROR The debugport device could not be reset and is unusable.3738**/39typedef40EFI_STATUS41(EFIAPI *EFI_DEBUGPORT_RESET)(42IN EFI_DEBUGPORT_PROTOCOL *This43);4445/**46Writes data to the debugport.4748@param This A pointer to the EFI_DEBUGPORT_PROTOCOL instance.49@param Timeout The number of microseconds to wait before timing out a write operation.50@param BufferSize On input, the requested number of bytes of data to write. On output, the51number of bytes of data actually written.52@param Buffer A pointer to a buffer containing the data to write.5354@retval EFI_SUCCESS The data was written.55@retval EFI_DEVICE_ERROR The device reported an error.56@retval EFI_TIMEOUT The data write was stopped due to a timeout.5758**/59typedef60EFI_STATUS61(EFIAPI *EFI_DEBUGPORT_WRITE)(62IN EFI_DEBUGPORT_PROTOCOL *This,63IN UINT32 Timeout,64IN OUT UINTN *BufferSize,65IN VOID *Buffer66);6768/**69Reads data from the debugport.7071@param This A pointer to the EFI_DEBUGPORT_PROTOCOL instance.72@param Timeout The number of microseconds to wait before timing out a read operation.73@param BufferSize On input, the requested number of bytes of data to read. On output, the74number of bytes of data actually number of bytes75of data read and returned in Buffer.76@param Buffer A pointer to a buffer into which the data read will be saved.7778@retval EFI_SUCCESS The data was read.79@retval EFI_DEVICE_ERROR The device reported an error.80@retval EFI_TIMEOUT The operation was stopped due to a timeout or overrun.8182**/83typedef84EFI_STATUS85(EFIAPI *EFI_DEBUGPORT_READ)(86IN EFI_DEBUGPORT_PROTOCOL *This,87IN UINT32 Timeout,88IN OUT UINTN *BufferSize,89OUT VOID *Buffer90);9192/**93Checks to see if any data is available to be read from the debugport device.9495@param This A pointer to the EFI_DEBUGPORT_PROTOCOL instance.9697@retval EFI_SUCCESS At least one byte of data is available to be read.98@retval EFI_DEVICE_ERROR The debugport device is not functioning correctly.99@retval EFI_NOT_READY No data is available to be read.100101**/102typedef103EFI_STATUS104(EFIAPI *EFI_DEBUGPORT_POLL)(105IN EFI_DEBUGPORT_PROTOCOL *This106);107108///109/// This protocol provides the communication link between the debug agent and the remote host.110///111struct _EFI_DEBUGPORT_PROTOCOL {112EFI_DEBUGPORT_RESET Reset;113EFI_DEBUGPORT_WRITE Write;114EFI_DEBUGPORT_READ Read;115EFI_DEBUGPORT_POLL Poll;116};117118//119// DEBUGPORT variable definitions...120//121#define EFI_DEBUGPORT_VARIABLE_NAME L"DEBUGPORT"122#define EFI_DEBUGPORT_VARIABLE_GUID EFI_DEBUGPORT_PROTOCOL_GUID123124extern EFI_GUID gEfiDebugPortVariableGuid;125126//127// DebugPort device path definitions...128//129#define DEVICE_PATH_MESSAGING_DEBUGPORT EFI_DEBUGPORT_PROTOCOL_GUID130131extern EFI_GUID gEfiDebugPortDevicePathGuid;132133typedef struct {134EFI_DEVICE_PATH_PROTOCOL Header;135EFI_GUID Guid;136} DEBUGPORT_DEVICE_PATH;137138#endif139140141