]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Include/Protocol/DebugPort.h
Code Scrub for Protocol and Ppi Definition
[mirror_edk2.git] / MdePkg / Include / Protocol / DebugPort.h
CommitLineData
d1f95000 1/** @file\r
c311f86b 2 \r
3 The file defines the EFI Debugport protocol.\r
4 This protocol is used by debug agent to communicate with the\r
5 remote debug host.\r
6 \r
4ca9b6c4 7 Copyright (c) 2006 - 2008, Intel Corporation \r
d1f95000 8 All rights reserved. This program and the accompanying materials \r
9 are licensed and made available under the terms and conditions of the BSD License \r
10 which accompanies this distribution. The full text of the license may be found at \r
11 http://opensource.org/licenses/bsd-license.php \r
12\r
13 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
14 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
15\r
d1f95000 16**/\r
17\r
18#ifndef __DEBUG_PORT_H__\r
19#define __DEBUG_PORT_H__\r
20\r
21\r
22//\r
23// DebugPortIo protocol {EBA4E8D2-3858-41EC-A281-2647BA9660D0}\r
24//\r
25#define EFI_DEBUGPORT_PROTOCOL_GUID \\r
26 { \\r
27 0xEBA4E8D2, 0x3858, 0x41EC, {0xA2, 0x81, 0x26, 0x47, 0xBA, 0x96, 0x60, 0xD0 } \\r
28 }\r
29\r
30extern EFI_GUID gEfiDebugPortProtocolGuid;\r
31\r
32typedef struct _EFI_DEBUGPORT_PROTOCOL EFI_DEBUGPORT_PROTOCOL;\r
33\r
34//\r
35// DebugPort member functions\r
36//\r
37\r
38/** \r
39 Resets the debugport.\r
40 \r
41 @param This A pointer to the EFI_DEBUGPORT_PROTOCOL instance.\r
42 \r
43 @retval EFI_SUCCESS The debugport device was reset and is in usable state.\r
44 @retval EFI_DEVICE_ERROR The debugport device could not be reset and is unusable.\r
45 \r
46**/\r
47typedef\r
48EFI_STATUS\r
8b13229b 49(EFIAPI *EFI_DEBUGPORT_RESET)(\r
d1f95000 50 IN EFI_DEBUGPORT_PROTOCOL *This\r
51 );\r
52\r
53/** \r
54 Writes data to the debugport.\r
55 \r
56 @param This A pointer to the EFI_DEBUGPORT_PROTOCOL instance.\r
57 @param Timeout The number of microseconds to wait before timing out a write operation.\r
58 @param BufferSize On input, the requested number of bytes of data to write. On output, the\r
59 number of bytes of data actually written.\r
60 @param Buffer A pointer to a buffer containing the data to write. \r
61 \r
62 @retval EFI_SUCCESS The data was written.\r
63 @retval EFI_DEVICE_ERROR The device reported an error.\r
64 @retval EFI_TIMEOUT The data write was stopped due to a timeout.\r
65 \r
66**/\r
67typedef\r
68EFI_STATUS\r
8b13229b 69(EFIAPI *EFI_DEBUGPORT_WRITE)(\r
d1f95000 70 IN EFI_DEBUGPORT_PROTOCOL *This,\r
71 IN UINT32 Timeout,\r
72 IN OUT UINTN *BufferSize,\r
73 IN VOID *Buffer\r
74 );\r
75\r
76/** \r
77 Reads data from the debugport.\r
78 \r
79 @param This A pointer to the EFI_DEBUGPORT_PROTOCOL instance.\r
80 @param Timeout The number of microseconds to wait before timing out a read operation.\r
81 @param BufferSize On input, the requested number of bytes of data to read. On output, the\r
82 number of bytes of data actually number of bytes\r
83 of data read and returned in Buffer.\r
84 @param Buffer A pointer to a buffer into which the data read will be saved.\r
85 \r
86 @retval EFI_SUCCESS The data was read.\r
87 @retval EFI_DEVICE_ERROR The device reported an error.\r
88 @retval EFI_TIMEOUT The operation was stopped due to a timeout or overrun.\r
89 \r
90**/\r
91typedef\r
92EFI_STATUS\r
8b13229b 93(EFIAPI *EFI_DEBUGPORT_READ)(\r
d1f95000 94 IN EFI_DEBUGPORT_PROTOCOL *This,\r
95 IN UINT32 Timeout,\r
96 IN OUT UINTN *BufferSize,\r
97 OUT VOID *Buffer\r
98 );\r
99\r
100/** \r
101 Checks to see if any data is available to be read from the debugport device.\r
102 \r
103 @param This A pointer to the EFI_DEBUGPORT_PROTOCOL instance.\r
104 \r
105 @retval EFI_SUCCESS At least one byte of data is available to be read.\r
106 @retval EFI_DEVICE_ERROR The debugport device is not functioning correctly.\r
107 @retval EFI_NOT_READY No data is available to be read.\r
108 \r
109**/\r
110typedef\r
111EFI_STATUS\r
8b13229b 112(EFIAPI *EFI_DEBUGPORT_POLL)(\r
d1f95000 113 IN EFI_DEBUGPORT_PROTOCOL *This\r
114 );\r
115\r
116//\r
117// DebugPort protocol definition\r
118//\r
4ca9b6c4
LG
119/**\r
120 @par Protocol Description:\r
121 This protocol provides the communication link between the debug agent and the remote host.\r
122\r
123 @param Reset\r
124 Resets the debugport hardware.\r
125 \r
126 @param Write\r
127 Send a buffer of characters to the debugport device.\r
128\r
129 @param Read \r
130 Receive a buffer of characters from the debugport device.\r
131\r
132 @param Poll \r
133 Determine if there is any data available to be read from the debugport device.\r
134**/ \r
d1f95000 135struct _EFI_DEBUGPORT_PROTOCOL {\r
136 EFI_DEBUGPORT_RESET Reset;\r
137 EFI_DEBUGPORT_WRITE Write;\r
138 EFI_DEBUGPORT_READ Read;\r
139 EFI_DEBUGPORT_POLL Poll;\r
140};\r
141\r
142//\r
143// DEBUGPORT variable definitions...\r
144//\r
145#define EFI_DEBUGPORT_VARIABLE_NAME L"DEBUGPORT"\r
146#define EFI_DEBUGPORT_VARIABLE_GUID EFI_DEBUGPORT_PROTOCOL_GUID\r
147#define gEfiDebugPortVariableGuid gEfiDebugPortProtocolGuid\r
148\r
149//\r
150// DebugPort device path definitions...\r
151//\r
152#define DEVICE_PATH_MESSAGING_DEBUGPORT EFI_DEBUGPORT_PROTOCOL_GUID\r
153#define gEfiDebugPortDevicePathGuid gEfiDebugPortProtocolGuid\r
154\r
155typedef struct {\r
156 EFI_DEVICE_PATH_PROTOCOL Header;\r
157 EFI_GUID Guid;\r
158} DEBUGPORT_DEVICE_PATH;\r
159\r
160#endif\r