2 Copyright (c) 2006, Intel Corporation
3 All rights reserved. This program and the accompanying materials
4 are licensed and made available under the terms and conditions of the BSD License
5 which accompanies this distribution. The full text of the license may be found at
6 http://opensource.org/licenses/bsd-license.php
8 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
9 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
13 #ifndef __DEBUG_PORT_H__
14 #define __DEBUG_PORT_H__
18 // DebugPortIo protocol {EBA4E8D2-3858-41EC-A281-2647BA9660D0}
20 #define EFI_DEBUGPORT_PROTOCOL_GUID \
22 0xEBA4E8D2, 0x3858, 0x41EC, {0xA2, 0x81, 0x26, 0x47, 0xBA, 0x96, 0x60, 0xD0 } \
25 extern EFI_GUID gEfiDebugPortProtocolGuid
;
27 typedef struct _EFI_DEBUGPORT_PROTOCOL EFI_DEBUGPORT_PROTOCOL
;
30 // DebugPort member functions
36 @param This A pointer to the EFI_DEBUGPORT_PROTOCOL instance.
38 @retval EFI_SUCCESS The debugport device was reset and is in usable state.
39 @retval EFI_DEVICE_ERROR The debugport device could not be reset and is unusable.
44 (EFIAPI
*EFI_DEBUGPORT_RESET
) (
45 IN EFI_DEBUGPORT_PROTOCOL
*This
49 Writes data to the debugport.
51 @param This A pointer to the EFI_DEBUGPORT_PROTOCOL instance.
52 @param Timeout The number of microseconds to wait before timing out a write operation.
53 @param BufferSize On input, the requested number of bytes of data to write. On output, the
54 number of bytes of data actually written.
55 @param Buffer A pointer to a buffer containing the data to write.
57 @retval EFI_SUCCESS The data was written.
58 @retval EFI_DEVICE_ERROR The device reported an error.
59 @retval EFI_TIMEOUT The data write was stopped due to a timeout.
64 (EFIAPI
*EFI_DEBUGPORT_WRITE
) (
65 IN EFI_DEBUGPORT_PROTOCOL
*This
,
67 IN OUT UINTN
*BufferSize
,
72 Reads data from the debugport.
74 @param This A pointer to the EFI_DEBUGPORT_PROTOCOL instance.
75 @param Timeout The number of microseconds to wait before timing out a read operation.
76 @param BufferSize On input, the requested number of bytes of data to read. On output, the
77 number of bytes of data actually number of bytes
78 of data read and returned in Buffer.
79 @param Buffer A pointer to a buffer into which the data read will be saved.
81 @retval EFI_SUCCESS The data was read.
82 @retval EFI_DEVICE_ERROR The device reported an error.
83 @retval EFI_TIMEOUT The operation was stopped due to a timeout or overrun.
88 (EFIAPI
*EFI_DEBUGPORT_READ
) (
89 IN EFI_DEBUGPORT_PROTOCOL
*This
,
91 IN OUT UINTN
*BufferSize
,
96 Checks to see if any data is available to be read from the debugport device.
98 @param This A pointer to the EFI_DEBUGPORT_PROTOCOL instance.
100 @retval EFI_SUCCESS At least one byte of data is available to be read.
101 @retval EFI_DEVICE_ERROR The debugport device is not functioning correctly.
102 @retval EFI_NOT_READY No data is available to be read.
107 (EFIAPI
*EFI_DEBUGPORT_POLL
) (
108 IN EFI_DEBUGPORT_PROTOCOL
*This
112 // DebugPort protocol definition
114 struct _EFI_DEBUGPORT_PROTOCOL
{
115 EFI_DEBUGPORT_RESET Reset
;
116 EFI_DEBUGPORT_WRITE Write
;
117 EFI_DEBUGPORT_READ Read
;
118 EFI_DEBUGPORT_POLL Poll
;
122 // DEBUGPORT variable definitions...
124 #define EFI_DEBUGPORT_VARIABLE_NAME L"DEBUGPORT"
125 #define EFI_DEBUGPORT_VARIABLE_GUID EFI_DEBUGPORT_PROTOCOL_GUID
126 #define gEfiDebugPortVariableGuid gEfiDebugPortProtocolGuid
129 // DebugPort device path definitions...
131 #define DEVICE_PATH_MESSAGING_DEBUGPORT EFI_DEBUGPORT_PROTOCOL_GUID
132 #define gEfiDebugPortDevicePathGuid gEfiDebugPortProtocolGuid
135 EFI_DEVICE_PATH_PROTOCOL Header
;
137 } DEBUGPORT_DEVICE_PATH
;