MdePkg: Expand BaseIoLibIntrinsic (IoLib class) library
[mirror_edk2.git] / UefiCpuPkg / CpuIo2Dxe / IoFifo.h
1 /** @file
2 I/O FIFO routines
3
4 Copyright (c) 2008 - 2012, Intel Corporation. All rights reserved.<BR>
5
6 This program and the accompanying materials are licensed and made available
7 under the terms and conditions of the BSD License which accompanies this
8 distribution. The full text of the license may be found at
9 http://opensource.org/licenses/bsd-license.php
10
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
13
14 **/
15
16 #ifndef _IO_FIFO_H_INCLUDED_
17 #define _IO_FIFO_H_INCLUDED_
18
19 /**
20 Reads an 8-bit I/O port fifo into a block of memory.
21
22 Reads the 8-bit I/O fifo port specified by Port.
23
24 The port is read Count times, and the read data is
25 stored in the provided Buffer.
26
27 This function must guarantee that all I/O read and write operations are
28 serialized.
29
30 If 8-bit I/O port operations are not supported, then ASSERT().
31
32 @param Port The I/O port to read.
33 @param Count The number of times to read I/O port.
34 @param Buffer The buffer to store the read data into.
35
36 **/
37 VOID
38 EFIAPI
39 IoReadFifo8 (
40 IN UINTN Port,
41 IN UINTN Count,
42 OUT VOID *Buffer
43 );
44
45 /**
46 Reads a 16-bit I/O port fifo into a block of memory.
47
48 Reads the 16-bit I/O fifo port specified by Port.
49
50 The port is read Count times, and the read data is
51 stored in the provided Buffer.
52
53 This function must guarantee that all I/O read and write operations are
54 serialized.
55
56 If 16-bit I/O port operations are not supported, then ASSERT().
57
58 @param Port The I/O port to read.
59 @param Count The number of times to read I/O port.
60 @param Buffer The buffer to store the read data into.
61
62 **/
63 VOID
64 EFIAPI
65 IoReadFifo16 (
66 IN UINTN Port,
67 IN UINTN Count,
68 OUT VOID *Buffer
69 );
70
71 /**
72 Reads a 32-bit I/O port fifo into a block of memory.
73
74 Reads the 32-bit I/O fifo port specified by Port.
75
76 The port is read Count times, and the read data is
77 stored in the provided Buffer.
78
79 This function must guarantee that all I/O read and write operations are
80 serialized.
81
82 If 32-bit I/O port operations are not supported, then ASSERT().
83
84 @param Port The I/O port to read.
85 @param Count The number of times to read I/O port.
86 @param Buffer The buffer to store the read data into.
87
88 **/
89 VOID
90 EFIAPI
91 IoReadFifo32 (
92 IN UINTN Port,
93 IN UINTN Count,
94 OUT VOID *Buffer
95 );
96
97 /**
98 Writes a block of memory into an 8-bit I/O port fifo.
99
100 Writes the 8-bit I/O fifo port specified by Port.
101
102 The port is written Count times, and the write data is
103 retrieved from the provided Buffer.
104
105 This function must guarantee that all I/O write and write operations are
106 serialized.
107
108 If 8-bit I/O port operations are not supported, then ASSERT().
109
110 @param Port The I/O port to write.
111 @param Count The number of times to write I/O port.
112 @param Buffer The buffer to store the write data into.
113
114 **/
115 VOID
116 EFIAPI
117 IoWriteFifo8 (
118 IN UINTN Port,
119 IN UINTN Count,
120 OUT VOID *Buffer
121 );
122
123 /**
124 Writes a block of memory into a 16-bit I/O port fifo.
125
126 Writes the 16-bit I/O fifo port specified by Port.
127
128 The port is written Count times, and the write data is
129 retrieved from the provided Buffer.
130
131 This function must guarantee that all I/O write and write operations are
132 serialized.
133
134 If 16-bit I/O port operations are not supported, then ASSERT().
135
136 @param Port The I/O port to write.
137 @param Count The number of times to write I/O port.
138 @param Buffer The buffer to store the write data into.
139
140 **/
141 VOID
142 EFIAPI
143 IoWriteFifo16 (
144 IN UINTN Port,
145 IN UINTN Count,
146 OUT VOID *Buffer
147 );
148
149 /**
150 Writes a block of memory into a 32-bit I/O port fifo.
151
152 Writes the 32-bit I/O fifo port specified by Port.
153
154 The port is written Count times, and the write data is
155 retrieved from the provided Buffer.
156
157 This function must guarantee that all I/O write and write operations are
158 serialized.
159
160 If 32-bit I/O port operations are not supported, then ASSERT().
161
162 @param Port The I/O port to write.
163 @param Count The number of times to write I/O port.
164 @param Buffer The buffer to store the write data into.
165
166 **/
167 VOID
168 EFIAPI
169 IoWriteFifo32 (
170 IN UINTN Port,
171 IN UINTN Count,
172 OUT VOID *Buffer
173 );
174
175 #endif
176