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__
17 /// DebugPortIo protocol {EBA4E8D2-3858-41EC-A281-2647BA9660D0}
19 #define EFI_DEBUGPORT_PROTOCOL_GUID \
21 0xEBA4E8D2, 0x3858, 0x41EC, {0xA2, 0x81, 0x26, 0x47, 0xBA, 0x96, 0x60, 0xD0 } \
24 extern EFI_GUID gEfiDebugPortProtocolGuid;
26 typedef struct _EFI_DEBUGPORT_PROTOCOL EFI_DEBUGPORT_PROTOCOL;
29 // DebugPort member functions
35 @param This A pointer to the EFI_DEBUGPORT_PROTOCOL instance.
37 @retval EFI_SUCCESS The debugport device was reset and is in usable state.
38 @retval EFI_DEVICE_ERROR The debugport device could not be reset and is unusable.
43 (EFIAPI *EFI_DEBUGPORT_RESET)(
44 IN EFI_DEBUGPORT_PROTOCOL *This
48 Writes data to the debugport.
50 @param This A pointer to the EFI_DEBUGPORT_PROTOCOL instance.
51 @param Timeout The number of microseconds to wait before timing out a write operation.
52 @param BufferSize On input, the requested number of bytes of data to write. On output, the
53 number of bytes of data actually written.
54 @param Buffer A pointer to a buffer containing the data to write.
56 @retval EFI_SUCCESS The data was written.
57 @retval EFI_DEVICE_ERROR The device reported an error.
58 @retval EFI_TIMEOUT The data write was stopped due to a timeout.
63 (EFIAPI *EFI_DEBUGPORT_WRITE)(
64 IN EFI_DEBUGPORT_PROTOCOL *This,
66 IN OUT UINTN *BufferSize,
71 Reads data from the debugport.
73 @param This A pointer to the EFI_DEBUGPORT_PROTOCOL instance.
74 @param Timeout The number of microseconds to wait before timing out a read operation.
75 @param BufferSize On input, the requested number of bytes of data to read. On output, the
76 number of bytes of data actually number of bytes
77 of data read and returned in Buffer.
78 @param Buffer A pointer to a buffer into which the data read will be saved.
80 @retval EFI_SUCCESS The data was read.
81 @retval EFI_DEVICE_ERROR The device reported an error.
82 @retval EFI_TIMEOUT The operation was stopped due to a timeout or overrun.
87 (EFIAPI *EFI_DEBUGPORT_READ)(
88 IN EFI_DEBUGPORT_PROTOCOL *This,
90 IN OUT UINTN *BufferSize,
95 Checks to see if any data is available to be read from the debugport device.
97 @param This A pointer to the EFI_DEBUGPORT_PROTOCOL instance.
99 @retval EFI_SUCCESS At least one byte of data is available to be read.
100 @retval EFI_DEVICE_ERROR The debugport device is not functioning correctly.
101 @retval EFI_NOT_READY No data is available to be read.
106 (EFIAPI *EFI_DEBUGPORT_POLL)(
107 IN EFI_DEBUGPORT_PROTOCOL *This
111 /// This protocol provides the communication link between the debug agent and the remote host.
113 struct _EFI_DEBUGPORT_PROTOCOL {
114 EFI_DEBUGPORT_RESET Reset;
115 EFI_DEBUGPORT_WRITE Write;
116 EFI_DEBUGPORT_READ Read;
117 EFI_DEBUGPORT_POLL Poll;
121 // DEBUGPORT variable definitions...
123 #define EFI_DEBUGPORT_VARIABLE_NAME L"DEBUGPORT"
124 #define EFI_DEBUGPORT_VARIABLE_GUID EFI_DEBUGPORT_PROTOCOL_GUID
126 extern EFI_GUID gEfiDebugPortVariableGuid;
129 // DebugPort device path definitions...
131 #define DEVICE_PATH_MESSAGING_DEBUGPORT EFI_DEBUGPORT_PROTOCOL_GUID
133 extern EFI_GUID gEfiDebugPortDevicePathGuid;
136 EFI_DEVICE_PATH_PROTOCOL Header;
138 } DEBUGPORT_DEVICE_PATH;