]>
Commit | Line | Data |
---|---|---|
878ddf1f | 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 | |
11 | Module Name: DebugPort.h\r | |
12 | \r | |
13 | **/\r | |
14 | \r | |
15 | #ifndef __DEBUG_PORT_H__\r | |
16 | #define __DEBUG_PORT_H__\r | |
17 | \r | |
18 | \r | |
19 | //\r | |
20 | // DebugPortIo protocol {EBA4E8D2-3858-41EC-A281-2647BA9660D0}\r | |
21 | //\r | |
22 | #define EFI_DEBUGPORT_PROTOCOL_GUID \\r | |
23 | { \\r | |
24 | 0xEBA4E8D2, 0x3858, 0x41EC, {0xA2, 0x81, 0x26, 0x47, 0xBA, 0x96, 0x60, 0xD0 } \\r | |
25 | }\r | |
26 | \r | |
27 | extern EFI_GUID gEfiDebugPortProtocolGuid;\r | |
28 | \r | |
29 | typedef struct _EFI_DEBUGPORT_PROTOCOL EFI_DEBUGPORT_PROTOCOL;\r | |
30 | \r | |
31 | //\r | |
32 | // DebugPort member functions\r | |
33 | //\r | |
34 | \r | |
35 | /** \r | |
36 | Resets the debugport.\r | |
37 | \r | |
38 | @param This A pointer to the EFI_DEBUGPORT_PROTOCOL instance.\r | |
39 | \r | |
40 | @retval EFI_SUCCESS The debugport device was reset and is in usable state.\r | |
41 | @retval EFI_DEVICE_ERROR The debugport device could not be reset and is unusable.\r | |
42 | \r | |
43 | **/\r | |
44 | typedef\r | |
45 | EFI_STATUS\r | |
46 | (EFIAPI *EFI_DEBUGPORT_RESET) (\r | |
47 | IN EFI_DEBUGPORT_PROTOCOL *This\r | |
48 | );\r | |
49 | \r | |
50 | /** \r | |
51 | Writes data to the debugport.\r | |
52 | \r | |
53 | @param This A pointer to the EFI_DEBUGPORT_PROTOCOL instance.\r | |
54 | @param Timeout The number of microseconds to wait before timing out a write operation.\r | |
55 | @param BufferSize On input, the requested number of bytes of data to write. On output, the\r | |
56 | number of bytes of data actually written.\r | |
57 | @param Buffer A pointer to a buffer containing the data to write. \r | |
58 | \r | |
59 | @retval EFI_SUCCESS The data was written.\r | |
60 | @retval EFI_DEVICE_ERROR The device reported an error.\r | |
61 | @retval EFI_TIMEOUT The data write was stopped due to a timeout.\r | |
62 | \r | |
63 | **/\r | |
64 | typedef\r | |
65 | EFI_STATUS\r | |
66 | (EFIAPI *EFI_DEBUGPORT_WRITE) (\r | |
67 | IN EFI_DEBUGPORT_PROTOCOL *This,\r | |
68 | IN UINT32 Timeout,\r | |
69 | IN OUT UINTN *BufferSize,\r | |
70 | IN VOID *Buffer\r | |
71 | );\r | |
72 | \r | |
73 | /** \r | |
74 | Reads data from the debugport.\r | |
75 | \r | |
76 | @param This A pointer to the EFI_DEBUGPORT_PROTOCOL instance.\r | |
77 | @param Timeout The number of microseconds to wait before timing out a read operation.\r | |
78 | @param BufferSize On input, the requested number of bytes of data to read. On output, the\r | |
79 | number of bytes of data actually number of bytes\r | |
80 | of data read and returned in Buffer.\r | |
81 | @param Buffer A pointer to a buffer into which the data read will be saved.\r | |
82 | \r | |
83 | @retval EFI_SUCCESS The data was read.\r | |
84 | @retval EFI_DEVICE_ERROR The device reported an error.\r | |
85 | @retval EFI_TIMEOUT The operation was stopped due to a timeout or overrun.\r | |
86 | \r | |
87 | **/\r | |
88 | typedef\r | |
89 | EFI_STATUS\r | |
90 | (EFIAPI *EFI_DEBUGPORT_READ) (\r | |
91 | IN EFI_DEBUGPORT_PROTOCOL *This,\r | |
92 | IN UINT32 Timeout,\r | |
93 | IN OUT UINTN *BufferSize,\r | |
94 | OUT VOID *Buffer\r | |
95 | );\r | |
96 | \r | |
97 | /** \r | |
98 | Checks to see if any data is available to be read from the debugport device.\r | |
99 | \r | |
100 | @param This A pointer to the EFI_DEBUGPORT_PROTOCOL instance.\r | |
101 | \r | |
102 | @retval EFI_SUCCESS At least one byte of data is available to be read.\r | |
103 | @retval EFI_DEVICE_ERROR The debugport device is not functioning correctly.\r | |
104 | @retval EFI_NOT_READY No data is available to be read.\r | |
105 | \r | |
106 | **/\r | |
107 | typedef\r | |
108 | EFI_STATUS\r | |
109 | (EFIAPI *EFI_DEBUGPORT_POLL) (\r | |
110 | IN EFI_DEBUGPORT_PROTOCOL *This\r | |
111 | );\r | |
112 | \r | |
113 | //\r | |
114 | // DebugPort protocol definition\r | |
115 | //\r | |
116 | struct _EFI_DEBUGPORT_PROTOCOL {\r | |
117 | EFI_DEBUGPORT_RESET Reset;\r | |
118 | EFI_DEBUGPORT_WRITE Write;\r | |
119 | EFI_DEBUGPORT_READ Read;\r | |
120 | EFI_DEBUGPORT_POLL Poll;\r | |
121 | };\r | |
122 | \r | |
123 | //\r | |
124 | // DEBUGPORT variable definitions...\r | |
125 | //\r | |
126 | #define EFI_DEBUGPORT_VARIABLE_NAME L"DEBUGPORT"\r | |
127 | #define EFI_DEBUGPORT_VARIABLE_GUID EFI_DEBUGPORT_PROTOCOL_GUID\r | |
128 | #define gEfiDebugPortVariableGuid gEfiDebugPortProtocolGuid\r | |
129 | \r | |
130 | //\r | |
131 | // DebugPort device path definitions...\r | |
132 | //\r | |
133 | #define DEVICE_PATH_MESSAGING_DEBUGPORT EFI_DEBUGPORT_PROTOCOL_GUID\r | |
134 | #define gEfiDebugPortDevicePathGuid gEfiDebugPortProtocolGuid\r | |
135 | \r | |
136 | typedef struct {\r | |
137 | EFI_DEVICE_PATH_PROTOCOL Header;\r | |
138 | EFI_GUID Guid;\r | |
139 | } DEBUGPORT_DEVICE_PATH;\r | |
140 | \r | |
141 | #endif\r |