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