]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Include/Protocol/DebugPort.h
Updated headers to follow coding standard
[mirror_edk2.git] / MdePkg / Include / Protocol / DebugPort.h
1 /** @file
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
7
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.
10
11 **/
12
13 #ifndef __DEBUG_PORT_H__
14 #define __DEBUG_PORT_H__
15
16
17 //
18 // DebugPortIo protocol {EBA4E8D2-3858-41EC-A281-2647BA9660D0}
19 //
20 #define EFI_DEBUGPORT_PROTOCOL_GUID \
21 { \
22 0xEBA4E8D2, 0x3858, 0x41EC, {0xA2, 0x81, 0x26, 0x47, 0xBA, 0x96, 0x60, 0xD0 } \
23 }
24
25 extern EFI_GUID gEfiDebugPortProtocolGuid;
26
27 typedef struct _EFI_DEBUGPORT_PROTOCOL EFI_DEBUGPORT_PROTOCOL;
28
29 //
30 // DebugPort member functions
31 //
32
33 /**
34 Resets the debugport.
35
36 @param This A pointer to the EFI_DEBUGPORT_PROTOCOL instance.
37
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.
40
41 **/
42 typedef
43 EFI_STATUS
44 (EFIAPI *EFI_DEBUGPORT_RESET) (
45 IN EFI_DEBUGPORT_PROTOCOL *This
46 );
47
48 /**
49 Writes data to the debugport.
50
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.
56
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.
60
61 **/
62 typedef
63 EFI_STATUS
64 (EFIAPI *EFI_DEBUGPORT_WRITE) (
65 IN EFI_DEBUGPORT_PROTOCOL *This,
66 IN UINT32 Timeout,
67 IN OUT UINTN *BufferSize,
68 IN VOID *Buffer
69 );
70
71 /**
72 Reads data from the debugport.
73
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.
80
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.
84
85 **/
86 typedef
87 EFI_STATUS
88 (EFIAPI *EFI_DEBUGPORT_READ) (
89 IN EFI_DEBUGPORT_PROTOCOL *This,
90 IN UINT32 Timeout,
91 IN OUT UINTN *BufferSize,
92 OUT VOID *Buffer
93 );
94
95 /**
96 Checks to see if any data is available to be read from the debugport device.
97
98 @param This A pointer to the EFI_DEBUGPORT_PROTOCOL instance.
99
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.
103
104 **/
105 typedef
106 EFI_STATUS
107 (EFIAPI *EFI_DEBUGPORT_POLL) (
108 IN EFI_DEBUGPORT_PROTOCOL *This
109 );
110
111 //
112 // DebugPort protocol definition
113 //
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;
119 };
120
121 //
122 // DEBUGPORT variable definitions...
123 //
124 #define EFI_DEBUGPORT_VARIABLE_NAME L"DEBUGPORT"
125 #define EFI_DEBUGPORT_VARIABLE_GUID EFI_DEBUGPORT_PROTOCOL_GUID
126 #define gEfiDebugPortVariableGuid gEfiDebugPortProtocolGuid
127
128 //
129 // DebugPort device path definitions...
130 //
131 #define DEVICE_PATH_MESSAGING_DEBUGPORT EFI_DEBUGPORT_PROTOCOL_GUID
132 #define gEfiDebugPortDevicePathGuid gEfiDebugPortProtocolGuid
133
134 typedef struct {
135 EFI_DEVICE_PATH_PROTOCOL Header;
136 EFI_GUID Guid;
137 } DEBUGPORT_DEVICE_PATH;
138
139 #endif