3 The file defines the EFI Debugport protocol.
4 This protocol is used by debug agent to communicate with the
7 Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
8 SPDX-License-Identifier: BSD-2-Clause-Patent
12 #ifndef __DEBUG_PORT_H__
13 #define __DEBUG_PORT_H__
16 /// DebugPortIo protocol {EBA4E8D2-3858-41EC-A281-2647BA9660D0}
18 #define EFI_DEBUGPORT_PROTOCOL_GUID \
20 0xEBA4E8D2, 0x3858, 0x41EC, {0xA2, 0x81, 0x26, 0x47, 0xBA, 0x96, 0x60, 0xD0 } \
23 extern EFI_GUID gEfiDebugPortProtocolGuid
;
25 typedef struct _EFI_DEBUGPORT_PROTOCOL EFI_DEBUGPORT_PROTOCOL
;
28 // DebugPort member functions
34 @param This A pointer to the EFI_DEBUGPORT_PROTOCOL instance.
36 @retval EFI_SUCCESS The debugport device was reset and is in usable state.
37 @retval EFI_DEVICE_ERROR The debugport device could not be reset and is unusable.
42 (EFIAPI
*EFI_DEBUGPORT_RESET
)(
43 IN EFI_DEBUGPORT_PROTOCOL
*This
47 Writes data to the debugport.
49 @param This A pointer to the EFI_DEBUGPORT_PROTOCOL instance.
50 @param Timeout The number of microseconds to wait before timing out a write operation.
51 @param BufferSize On input, the requested number of bytes of data to write. On output, the
52 number of bytes of data actually written.
53 @param Buffer A pointer to a buffer containing the data to write.
55 @retval EFI_SUCCESS The data was written.
56 @retval EFI_DEVICE_ERROR The device reported an error.
57 @retval EFI_TIMEOUT The data write was stopped due to a timeout.
62 (EFIAPI
*EFI_DEBUGPORT_WRITE
)(
63 IN EFI_DEBUGPORT_PROTOCOL
*This
,
65 IN OUT UINTN
*BufferSize
,
70 Reads data from the debugport.
72 @param This A pointer to the EFI_DEBUGPORT_PROTOCOL instance.
73 @param Timeout The number of microseconds to wait before timing out a read operation.
74 @param BufferSize On input, the requested number of bytes of data to read. On output, the
75 number of bytes of data actually number of bytes
76 of data read and returned in Buffer.
77 @param Buffer A pointer to a buffer into which the data read will be saved.
79 @retval EFI_SUCCESS The data was read.
80 @retval EFI_DEVICE_ERROR The device reported an error.
81 @retval EFI_TIMEOUT The operation was stopped due to a timeout or overrun.
86 (EFIAPI
*EFI_DEBUGPORT_READ
)(
87 IN EFI_DEBUGPORT_PROTOCOL
*This
,
89 IN OUT UINTN
*BufferSize
,
94 Checks to see if any data is available to be read from the debugport device.
96 @param This A pointer to the EFI_DEBUGPORT_PROTOCOL instance.
98 @retval EFI_SUCCESS At least one byte of data is available to be read.
99 @retval EFI_DEVICE_ERROR The debugport device is not functioning correctly.
100 @retval EFI_NOT_READY No data is available to be read.
105 (EFIAPI
*EFI_DEBUGPORT_POLL
)(
106 IN EFI_DEBUGPORT_PROTOCOL
*This
110 /// This protocol provides the communication link between the debug agent and the remote host.
112 struct _EFI_DEBUGPORT_PROTOCOL
{
113 EFI_DEBUGPORT_RESET Reset
;
114 EFI_DEBUGPORT_WRITE Write
;
115 EFI_DEBUGPORT_READ Read
;
116 EFI_DEBUGPORT_POLL Poll
;
120 // DEBUGPORT variable definitions...
122 #define EFI_DEBUGPORT_VARIABLE_NAME L"DEBUGPORT"
123 #define EFI_DEBUGPORT_VARIABLE_GUID EFI_DEBUGPORT_PROTOCOL_GUID
125 extern EFI_GUID gEfiDebugPortVariableGuid
;
128 // DebugPort device path definitions...
130 #define DEVICE_PATH_MESSAGING_DEBUGPORT EFI_DEBUGPORT_PROTOCOL_GUID
132 extern EFI_GUID gEfiDebugPortDevicePathGuid
;
135 EFI_DEVICE_PATH_PROTOCOL Header
;
137 } DEBUGPORT_DEVICE_PATH
;