Rev 2726 | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2726 | Rev 4605 | ||
---|---|---|---|
1 | /* |
1 | /* |
2 | * Copyright (c) 1999, 2000 |
2 | * Copyright (c) 1999, 2000 |
3 | * Intel Corporation. |
3 | * Intel Corporation. |
4 | * All rights reserved. |
4 | * All rights reserved. |
5 | * |
5 | * |
6 | * Redistribution and use in source and binary forms, with or without |
6 | * Redistribution and use in source and binary forms, with or without |
7 | * modification, are permitted provided that the following conditions |
7 | * modification, are permitted provided that the following conditions |
8 | * are met: |
8 | * are met: |
9 | * |
9 | * |
10 | * 1. Redistributions of source code must retain the above copyright |
10 | * 1. Redistributions of source code must retain the above copyright |
11 | * notice, this list of conditions and the following disclaimer. |
11 | * notice, this list of conditions and the following disclaimer. |
12 | * |
12 | * |
13 | * 2. Redistributions in binary form must reproduce the above copyright |
13 | * 2. Redistributions in binary form must reproduce the above copyright |
14 | * notice, this list of conditions and the following disclaimer in the |
14 | * notice, this list of conditions and the following disclaimer in the |
15 | * documentation and/or other materials provided with the distribution. |
15 | * documentation and/or other materials provided with the distribution. |
16 | * |
16 | * |
17 | * 3. All advertising materials mentioning features or use of this software |
17 | * 3. All advertising materials mentioning features or use of this software |
18 | * must display the following acknowledgement: |
18 | * must display the following acknowledgement: |
19 | * |
19 | * |
20 | * This product includes software developed by Intel Corporation and |
20 | * This product includes software developed by Intel Corporation and |
21 | * its contributors. |
21 | * its contributors. |
22 | * |
22 | * |
23 | * 4. Neither the name of Intel Corporation or its contributors may be |
23 | * 4. Neither the name of Intel Corporation or its contributors may be |
24 | * used to endorse or promote products derived from this software |
24 | * used to endorse or promote products derived from this software |
25 | * without specific prior written permission. |
25 | * without specific prior written permission. |
26 | * |
26 | * |
27 | * THIS SOFTWARE IS PROVIDED BY INTEL CORPORATION AND CONTRIBUTORS ``AS IS'' |
27 | * THIS SOFTWARE IS PROVIDED BY INTEL CORPORATION AND CONTRIBUTORS ``AS IS'' |
28 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
28 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
29 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
29 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
30 | * ARE DISCLAIMED. IN NO EVENT SHALL INTEL CORPORATION OR CONTRIBUTORS BE |
30 | * ARE DISCLAIMED. IN NO EVENT SHALL INTEL CORPORATION OR CONTRIBUTORS BE |
31 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
31 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
32 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
32 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
33 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
33 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
34 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
34 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
35 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
35 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
36 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF |
36 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF |
37 | * THE POSSIBILITY OF SUCH DAMAGE. |
37 | * THE POSSIBILITY OF SUCH DAMAGE. |
38 | * |
38 | * |
39 | */ |
39 | */ |
40 | 40 | ||
41 | 41 | ||
42 | #ifndef _EFIDBG_H_ |
42 | #ifndef _EFIDBG_H_ |
43 | #define _EFIDBG_H_ |
43 | #define _EFIDBG_H_ |
44 | 44 | ||
45 | #include "eficontext.h" |
45 | #include "eficontext.h" |
46 | #include "efiser.h" |
46 | #include "efiser.h" |
47 | 47 | ||
48 | typedef struct _DEBUGPORT_16550_CONFIG_DATA { |
48 | typedef struct _DEBUGPORT_16550_CONFIG_DATA { |
49 | UINT32 PortAddress; |
49 | UINT32 PortAddress; |
50 | UINT64 BaudRate; |
50 | UINT64 BaudRate; |
51 | UINT32 ReceiveFifoDepth; |
51 | UINT32 ReceiveFifoDepth; |
52 | UINT32 Timeout; |
52 | UINT32 Timeout; |
53 | UINT8 Parity; |
53 | UINT8 Parity; |
54 | UINT8 DataBits; |
54 | UINT8 DataBits; |
55 | UINT8 StopBits; |
55 | UINT8 StopBits; |
56 | UINT32 ControlMask; |
56 | UINT32 ControlMask; |
57 | BOOLEAN RtsCtsEnable; // RTS, CTS control |
57 | BOOLEAN RtsCtsEnable; // RTS, CTS control |
58 | } DEBUGPORT_16550_CONFIG_DATA; |
58 | } DEBUGPORT_16550_CONFIG_DATA; |
59 | 59 | ||
60 | typedef struct _DEBUGPORT_16550_DEVICE_PATH { |
60 | typedef struct _DEBUGPORT_16550_DEVICE_PATH { |
61 | EFI_DEVICE_PATH Header; |
61 | EFI_DEVICE_PATH Header; |
62 | DEBUGPORT_16550_CONFIG_DATA ConfigData; |
62 | DEBUGPORT_16550_CONFIG_DATA ConfigData; |
63 | } DEBUGPORT_16550_DEVICE_PATH; |
63 | } DEBUGPORT_16550_DEVICE_PATH; |
64 | 64 | ||
65 | typedef union { |
65 | typedef union { |
66 | EFI_DEVICE_PATH DevPath; |
66 | EFI_DEVICE_PATH DevPath; |
67 | DEBUGPORT_16550_DEVICE_PATH Uart; |
67 | DEBUGPORT_16550_DEVICE_PATH Uart; |
68 | // add new types of debugport device paths to this union... |
68 | // add new types of debugport device paths to this union... |
69 | } DEBUGPORT_DEV_PATH; |
69 | } DEBUGPORT_DEV_PATH; |
70 | 70 | ||
71 | 71 | ||
72 | // |
72 | // |
73 | // Debug Support protocol {2755590C-6F3C-42FA-9EA4-A3BA543CDA25} |
73 | // Debug Support protocol {2755590C-6F3C-42FA-9EA4-A3BA543CDA25} |
74 | // |
74 | // |
75 | 75 | ||
76 | #define DEBUG_SUPPORT_PROTOCOL \ |
76 | #define DEBUG_SUPPORT_PROTOCOL \ |
77 | { 0x2755590C, 0x6F3C, 0x42fa, 0x9E, 0xA4, 0xA3, 0xBA, 0x54, 0x3C, 0xDA, 0x25 } |
77 | { 0x2755590C, 0x6F3C, 0x42fa, 0x9E, 0xA4, 0xA3, 0xBA, 0x54, 0x3C, 0xDA, 0x25 } |
78 | 78 | ||
79 | 79 | ||
80 | typedef UINTN EXCEPTION_TYPE; |
80 | typedef UINTN EXCEPTION_TYPE; |
81 | 81 | ||
82 | typedef |
82 | typedef |
83 | VOID |
83 | VOID |
84 | (*EXCEPTION_HANDLER) ( |
84 | (*EXCEPTION_HANDLER) ( |
85 | IN EXCEPTION_TYPE ExceptionType, |
85 | IN EXCEPTION_TYPE ExceptionType, |
86 | IN SYSTEM_CONTEXT *SystemContext |
86 | IN SYSTEM_CONTEXT *SystemContext |
87 | ); |
87 | ); |
88 | 88 | ||
89 | typedef |
89 | typedef |
90 | EFI_STATUS |
90 | EFI_STATUS |
91 | (EFIAPI *EFI_REGISTER_TIMER_TICK_CALLBACK) ( |
91 | (EFIAPI *EFI_REGISTER_TIMER_TICK_CALLBACK) ( |
92 | IN struct _EFI_DEBUG_SUPPORT_INTERFACE *This, |
92 | IN struct _EFI_DEBUG_SUPPORT_INTERFACE *This, |
93 | IN EXCEPTION_HANDLER TimerTickCallback |
93 | IN EXCEPTION_HANDLER TimerTickCallback |
94 | ); |
94 | ); |
95 | 95 | ||
96 | typedef |
96 | typedef |
97 | EFI_STATUS |
97 | EFI_STATUS |
98 | (EFIAPI *EFI_REGISTER_EXCEPTION_HANDLER) ( |
98 | (EFIAPI *EFI_REGISTER_EXCEPTION_HANDLER) ( |
99 | IN struct _EFI_DEBUG_SUPPORT_INTERFACE *This, |
99 | IN struct _EFI_DEBUG_SUPPORT_INTERFACE *This, |
100 | IN EXCEPTION_HANDLER ExceptionHandler, |
100 | IN EXCEPTION_HANDLER ExceptionHandler, |
101 | IN EXCEPTION_TYPE ExceptionType |
101 | IN EXCEPTION_TYPE ExceptionType |
102 | ); |
102 | ); |
103 | 103 | ||
104 | typedef |
104 | typedef |
105 | EFI_STATUS |
105 | EFI_STATUS |
106 | (EFIAPI *EFI_IP_CALL_TRACE) ( |
106 | (EFIAPI *EFI_IP_CALL_TRACE) ( |
107 | IN struct _EFI_DEBUG_SUPPORT_INTERFACE *This |
107 | IN struct _EFI_DEBUG_SUPPORT_INTERFACE *This |
108 | ); |
108 | ); |
109 | 109 | ||
110 | 110 | ||
111 | #define EFI_DEBUG_SUPPORT_INTERFACE_REVISION 0x00010000 |
111 | #define EFI_DEBUG_SUPPORT_INTERFACE_REVISION 0x00010000 |
112 | 112 | ||
113 | typedef struct _EFI_DEBUG_SUPPORT_INTERFACE { |
113 | typedef struct _EFI_DEBUG_SUPPORT_INTERFACE { |
114 | UINT32 Revision; |
114 | UINT32 Revision; |
115 | EFI_REGISTER_TIMER_TICK_CALLBACK RegisterTimerTickCallback; |
115 | EFI_REGISTER_TIMER_TICK_CALLBACK RegisterTimerTickCallback; |
116 | EFI_REGISTER_EXCEPTION_HANDLER RegisterExceptionHandler; |
116 | EFI_REGISTER_EXCEPTION_HANDLER RegisterExceptionHandler; |
117 | EFI_IP_CALL_TRACE IpCallTrace; |
117 | EFI_IP_CALL_TRACE IpCallTrace; |
118 | } EFI_DEBUG_SUPPORT_INTERFACE; |
118 | } EFI_DEBUG_SUPPORT_INTERFACE; |
119 | 119 | ||
120 | 120 | ||
121 | // |
121 | // |
122 | // Debugport io protocol {EBA4E8D2-3858-41EC-A281-2647BA9660D0} |
122 | // Debugport io protocol {EBA4E8D2-3858-41EC-A281-2647BA9660D0} |
123 | // |
123 | // |
124 | 124 | ||
125 | #define DEBUGPORT_IO_PROTOCOL \ |
125 | #define DEBUGPORT_IO_PROTOCOL \ |
126 | { 0XEBA4E8D2, 0X3858, 0X41EC, 0XA2, 0X81, 0X26, 0X47, 0XBA, 0X96, 0X60, 0XD0 } |
126 | { 0XEBA4E8D2, 0X3858, 0X41EC, 0XA2, 0X81, 0X26, 0X47, 0XBA, 0X96, 0X60, 0XD0 } |
127 | 127 | ||
128 | 128 | ||
129 | typedef |
129 | typedef |
130 | EFI_STATUS |
130 | EFI_STATUS |
131 | (EFIAPI *EFI_DEBUGPORT_IO_RESET) ( |
131 | (EFIAPI *EFI_DEBUGPORT_IO_RESET) ( |
132 | IN struct _EFI_DEBUGPORT_IO_INTERFACE *This |
132 | IN struct _EFI_DEBUGPORT_IO_INTERFACE *This |
133 | ); |
133 | ); |
134 | 134 | ||
135 | typedef |
135 | typedef |
136 | EFI_STATUS |
136 | EFI_STATUS |
137 | (EFIAPI *EFI_DEBUGPORT_IO_READ) ( |
137 | (EFIAPI *EFI_DEBUGPORT_IO_READ) ( |
138 | IN struct _EFI_DEBUGPORT_IO_INTERFACE *This, |
138 | IN struct _EFI_DEBUGPORT_IO_INTERFACE *This, |
139 | IN OUT UINTN *BufferSize, |
139 | IN OUT UINTN *BufferSize, |
140 | OUT VOID *Buffer |
140 | OUT VOID *Buffer |
141 | ); |
141 | ); |
142 | 142 | ||
143 | typedef |
143 | typedef |
144 | EFI_STATUS |
144 | EFI_STATUS |
145 | (EFIAPI *EFI_DEBUGPORT_IO_WRITE) ( |
145 | (EFIAPI *EFI_DEBUGPORT_IO_WRITE) ( |
146 | IN struct _EFI_DEBUGPORT_IO_INTERFACE *This, |
146 | IN struct _EFI_DEBUGPORT_IO_INTERFACE *This, |
147 | IN OUT UINTN *BufferSize, |
147 | IN OUT UINTN *BufferSize, |
148 | IN VOID *Buffer |
148 | IN VOID *Buffer |
149 | ); |
149 | ); |
150 | 150 | ||
151 | #define EFI_DEBUGPORT_IO_INTERFACE_REVISION 0x00010000 |
151 | #define EFI_DEBUGPORT_IO_INTERFACE_REVISION 0x00010000 |
152 | 152 | ||
153 | typedef struct _EFI_DEBUGPORT_IO_INTERFACE { |
153 | typedef struct _EFI_DEBUGPORT_IO_INTERFACE { |
154 | UINT32 Revision; |
154 | UINT32 Revision; |
155 | EFI_DEBUGPORT_IO_READ Read; |
155 | EFI_DEBUGPORT_IO_READ Read; |
156 | EFI_DEBUGPORT_IO_WRITE Write; |
156 | EFI_DEBUGPORT_IO_WRITE Write; |
157 | EFI_DEBUGPORT_IO_RESET Reset; |
157 | EFI_DEBUGPORT_IO_RESET Reset; |
158 | } EFI_DEBUGPORT_IO_INTERFACE; |
158 | } EFI_DEBUGPORT_IO_INTERFACE; |
159 | 159 | ||
160 | 160 | ||
161 | // |
161 | // |
162 | // Debugport UART16550 control protocol {628EA978-4C26-4605-BC02-A42A496917DD} |
162 | // Debugport UART16550 control protocol {628EA978-4C26-4605-BC02-A42A496917DD} |
163 | // |
163 | // |
164 | 164 | ||
165 | #define DEBUGPORT_UART16550_CONTROL_PROTOCOL \ |
165 | #define DEBUGPORT_UART16550_CONTROL_PROTOCOL \ |
166 | { 0X628EA978, 0X4C26, 0X4605, 0XBC, 0X2, 0XA4, 0X2A, 0X49, 0X69, 0X17, 0XDD } |
166 | { 0X628EA978, 0X4C26, 0X4605, 0XBC, 0X2, 0XA4, 0X2A, 0X49, 0X69, 0X17, 0XDD } |
167 | 167 | ||
168 | // Note: The definitions for EFI_PARITY_TYPE, EFI_STOP_BITS_TYPE, and |
168 | // Note: The definitions for EFI_PARITY_TYPE, EFI_STOP_BITS_TYPE, and |
169 | // SERIAL_IO_MODE are included from efiser.h |
169 | // SERIAL_IO_MODE are included from efiser.h |
170 | 170 | ||
171 | typedef |
171 | typedef |
172 | EFI_STATUS |
172 | EFI_STATUS |
173 | (EFIAPI *EFI_UART16550_SET_ATTRIBUTES) ( |
173 | (EFIAPI *EFI_UART16550_SET_ATTRIBUTES) ( |
174 | IN struct _EFI_DEBUGPORT_UART16550_CONTROL_INTERFACE *This, |
174 | IN struct _EFI_DEBUGPORT_UART16550_CONTROL_INTERFACE *This, |
175 | IN UINT64 BaudRate, |
175 | IN UINT64 BaudRate, |
176 | IN UINT32 ReceiveFifoDepth, |
176 | IN UINT32 ReceiveFifoDepth, |
177 | IN UINT32 Timeout, |
177 | IN UINT32 Timeout, |
178 | IN EFI_PARITY_TYPE Parity, |
178 | IN EFI_PARITY_TYPE Parity, |
179 | IN UINT8 DataBits, |
179 | IN UINT8 DataBits, |
180 | IN EFI_STOP_BITS_TYPE StopBits |
180 | IN EFI_STOP_BITS_TYPE StopBits |
181 | ); |
181 | ); |
182 | 182 | ||
183 | typedef |
183 | typedef |
184 | EFI_STATUS |
184 | EFI_STATUS |
185 | (EFIAPI *EFI_UART16550_SET_CONTROL_BITS) ( |
185 | (EFIAPI *EFI_UART16550_SET_CONTROL_BITS) ( |
186 | IN struct _EFI_DEBUGPORT_UART16550_CONTROL_INTERFACE *This, |
186 | IN struct _EFI_DEBUGPORT_UART16550_CONTROL_INTERFACE *This, |
187 | IN UINT32 Control |
187 | IN UINT32 Control |
188 | ); |
188 | ); |
189 | 189 | ||
190 | typedef |
190 | typedef |
191 | EFI_STATUS |
191 | EFI_STATUS |
192 | (EFIAPI *EFI_UART16550_GET_CONTROL_BITS) ( |
192 | (EFIAPI *EFI_UART16550_GET_CONTROL_BITS) ( |
193 | IN struct _EFI_DEBUGPORT_UART16550_CONTROL_INTERFACE *This, |
193 | IN struct _EFI_DEBUGPORT_UART16550_CONTROL_INTERFACE *This, |
194 | OUT UINT32 *Control |
194 | OUT UINT32 *Control |
195 | ); |
195 | ); |
196 | 196 | ||
197 | #define EFI_DEBUGPORT_UART16550_CONTROL_INTERFACE_REVISION 0x00010000 |
197 | #define EFI_DEBUGPORT_UART16550_CONTROL_INTERFACE_REVISION 0x00010000 |
198 | 198 | ||
199 | typedef struct _EFI_DEBUGPORT_UART16550_CONTROL_INTERFACE { |
199 | typedef struct _EFI_DEBUGPORT_UART16550_CONTROL_INTERFACE { |
200 | UINT32 Revision; |
200 | UINT32 Revision; |
201 | EFI_UART16550_SET_ATTRIBUTES SetAttributes; |
201 | EFI_UART16550_SET_ATTRIBUTES SetAttributes; |
202 | EFI_UART16550_SET_CONTROL_BITS SetControl; |
202 | EFI_UART16550_SET_CONTROL_BITS SetControl; |
203 | EFI_UART16550_GET_CONTROL_BITS GetControl; |
203 | EFI_UART16550_GET_CONTROL_BITS GetControl; |
204 | DEBUGPORT_16550_CONFIG_DATA *Mode; |
204 | DEBUGPORT_16550_CONFIG_DATA *Mode; |
205 | } EFI_DEBUGPORT_UART16550_CONTROL_INTERFACE; |
205 | } EFI_DEBUGPORT_UART16550_CONTROL_INTERFACE; |
206 | 206 | ||
207 | 207 | ||
208 | #define DEVICE_PATH_DEBUGPORT DEBUGPORT_IO_PROTOCOL |
208 | #define DEVICE_PATH_DEBUGPORT DEBUGPORT_IO_PROTOCOL |
209 | 209 | ||
210 | #endif /* _EFIDBG_H_ */ |
210 | #endif /* _EFIDBG_H_ */ |
211 | 211 |