]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Include/Protocol/DebugPort.h
1. Add defines for MAX values for UEFI data types.
[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
068a82fc 7 Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>\r
9df063a0 8 This program and the accompanying materials \r
d1f95000 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
99e8ed21 22///\r
23/// DebugPortIo protocol {EBA4E8D2-3858-41EC-A281-2647BA9660D0}\r
24///\r
d1f95000 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
44717a39 116///\r
117/// This protocol provides the communication link between the debug agent and the remote host.\r
118///\r
d1f95000 119struct _EFI_DEBUGPORT_PROTOCOL {\r
120 EFI_DEBUGPORT_RESET Reset;\r
121 EFI_DEBUGPORT_WRITE Write;\r
122 EFI_DEBUGPORT_READ Read;\r
123 EFI_DEBUGPORT_POLL Poll;\r
124};\r
125\r
126//\r
127// DEBUGPORT variable definitions...\r
128//\r
129#define EFI_DEBUGPORT_VARIABLE_NAME L"DEBUGPORT"\r
130#define EFI_DEBUGPORT_VARIABLE_GUID EFI_DEBUGPORT_PROTOCOL_GUID\r
068a82fc
LG
131\r
132extern EFI_GUID gEfiDebugPortVariableGuid;\r
d1f95000 133\r
134//\r
135// DebugPort device path definitions...\r
136//\r
137#define DEVICE_PATH_MESSAGING_DEBUGPORT EFI_DEBUGPORT_PROTOCOL_GUID\r
068a82fc
LG
138\r
139extern EFI_GUID gEfiDebugPortDevicePathGuid;\r
d1f95000 140\r
141typedef struct {\r
142 EFI_DEVICE_PATH_PROTOCOL Header;\r
143 EFI_GUID Guid;\r
144} DEBUGPORT_DEVICE_PATH;\r
145\r
146#endif\r