2 * Copyright (c) 1999, 2000
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the
15 * documentation and/or other materials provided with the distribution.
17 * 3. All advertising materials mentioning features or use of this software
18 * must display the following acknowledgement:
20 * This product includes software developed by Intel Corporation and
23 * 4. Neither the name of Intel Corporation or its contributors may be
24 * used to endorse or promote products derived from this software
25 * without specific prior written permission.
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
29 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
30 * ARE DISCLAIMED. IN NO EVENT SHALL INTEL CORPORATION OR CONTRIBUTORS BE
31 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
32 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
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
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
37 * THE POSSIBILITY OF SUCH DAMAGE.
45 #include "eficontext.h"
48 typedef struct _DEBUGPORT_16550_CONFIG_DATA
{
51 UINT32 ReceiveFifoDepth
;
57 BOOLEAN RtsCtsEnable
; // RTS, CTS control
58 } DEBUGPORT_16550_CONFIG_DATA
;
60 typedef struct _DEBUGPORT_16550_DEVICE_PATH
{
61 EFI_DEVICE_PATH Header
;
62 DEBUGPORT_16550_CONFIG_DATA ConfigData
;
63 } DEBUGPORT_16550_DEVICE_PATH
;
66 EFI_DEVICE_PATH DevPath
;
67 DEBUGPORT_16550_DEVICE_PATH Uart
;
68 // add new types of debugport device paths to this union...
73 // Debug Support protocol {2755590C-6F3C-42FA-9EA4-A3BA543CDA25}
76 #define DEBUG_SUPPORT_PROTOCOL \
77 { 0x2755590C, 0x6F3C, 0x42fa, 0x9E, 0xA4, 0xA3, 0xBA, 0x54, 0x3C, 0xDA, 0x25 }
80 typedef UINTN EXCEPTION_TYPE
;
84 (*EXCEPTION_HANDLER
) (
85 IN EXCEPTION_TYPE ExceptionType
,
86 IN SYSTEM_CONTEXT
*SystemContext
91 (EFIAPI
*EFI_REGISTER_TIMER_TICK_CALLBACK
) (
92 IN
struct _EFI_DEBUG_SUPPORT_INTERFACE
*This
,
93 IN EXCEPTION_HANDLER TimerTickCallback
98 (EFIAPI
*EFI_REGISTER_EXCEPTION_HANDLER
) (
99 IN
struct _EFI_DEBUG_SUPPORT_INTERFACE
*This
,
100 IN EXCEPTION_HANDLER ExceptionHandler
,
101 IN EXCEPTION_TYPE ExceptionType
106 (EFIAPI
*EFI_IP_CALL_TRACE
) (
107 IN
struct _EFI_DEBUG_SUPPORT_INTERFACE
*This
111 #define EFI_DEBUG_SUPPORT_INTERFACE_REVISION 0x00010000
113 typedef struct _EFI_DEBUG_SUPPORT_INTERFACE
{
115 EFI_REGISTER_TIMER_TICK_CALLBACK RegisterTimerTickCallback
;
116 EFI_REGISTER_EXCEPTION_HANDLER RegisterExceptionHandler
;
117 EFI_IP_CALL_TRACE IpCallTrace
;
118 } EFI_DEBUG_SUPPORT_INTERFACE
;
122 // Debugport io protocol {EBA4E8D2-3858-41EC-A281-2647BA9660D0}
125 #define DEBUGPORT_IO_PROTOCOL \
126 { 0XEBA4E8D2, 0X3858, 0X41EC, 0XA2, 0X81, 0X26, 0X47, 0XBA, 0X96, 0X60, 0XD0 }
131 (EFIAPI
*EFI_DEBUGPORT_IO_RESET
) (
132 IN
struct _EFI_DEBUGPORT_IO_INTERFACE
*This
137 (EFIAPI
*EFI_DEBUGPORT_IO_READ
) (
138 IN
struct _EFI_DEBUGPORT_IO_INTERFACE
*This
,
139 IN OUT UINTN
*BufferSize
,
145 (EFIAPI
*EFI_DEBUGPORT_IO_WRITE
) (
146 IN
struct _EFI_DEBUGPORT_IO_INTERFACE
*This
,
147 IN OUT UINTN
*BufferSize
,
151 #define EFI_DEBUGPORT_IO_INTERFACE_REVISION 0x00010000
153 typedef struct _EFI_DEBUGPORT_IO_INTERFACE
{
155 EFI_DEBUGPORT_IO_READ Read
;
156 EFI_DEBUGPORT_IO_WRITE Write
;
157 EFI_DEBUGPORT_IO_RESET Reset
;
158 } EFI_DEBUGPORT_IO_INTERFACE
;
162 // Debugport UART16550 control protocol {628EA978-4C26-4605-BC02-A42A496917DD}
165 #define DEBUGPORT_UART16550_CONTROL_PROTOCOL \
166 { 0X628EA978, 0X4C26, 0X4605, 0XBC, 0X2, 0XA4, 0X2A, 0X49, 0X69, 0X17, 0XDD }
168 // Note: The definitions for EFI_PARITY_TYPE, EFI_STOP_BITS_TYPE, and
169 // SERIAL_IO_MODE are included from efiser.h
173 (EFIAPI
*EFI_UART16550_SET_ATTRIBUTES
) (
174 IN
struct _EFI_DEBUGPORT_UART16550_CONTROL_INTERFACE
*This
,
176 IN UINT32 ReceiveFifoDepth
,
178 IN EFI_PARITY_TYPE Parity
,
180 IN EFI_STOP_BITS_TYPE StopBits
185 (EFIAPI
*EFI_UART16550_SET_CONTROL_BITS
) (
186 IN
struct _EFI_DEBUGPORT_UART16550_CONTROL_INTERFACE
*This
,
192 (EFIAPI
*EFI_UART16550_GET_CONTROL_BITS
) (
193 IN
struct _EFI_DEBUGPORT_UART16550_CONTROL_INTERFACE
*This
,
197 #define EFI_DEBUGPORT_UART16550_CONTROL_INTERFACE_REVISION 0x00010000
199 typedef struct _EFI_DEBUGPORT_UART16550_CONTROL_INTERFACE
{
201 EFI_UART16550_SET_ATTRIBUTES SetAttributes
;
202 EFI_UART16550_SET_CONTROL_BITS SetControl
;
203 EFI_UART16550_GET_CONTROL_BITS GetControl
;
204 DEBUGPORT_16550_CONFIG_DATA
*Mode
;
205 } EFI_DEBUGPORT_UART16550_CONTROL_INTERFACE
;
208 #define DEVICE_PATH_DEBUGPORT DEBUGPORT_IO_PROTOCOL
210 #endif /* _EFIDBG_H_ */