]> git.proxmox.com Git - mirror_edk2.git/blob - IntelFrameworkPkg/Library/DxeIoLibCpuIo/DxeCpuIoLibInternal.h
IntelFrameworkPkg/DxeIoLibCpuIo: Add new Fifo routines in IoLib class
[mirror_edk2.git] / IntelFrameworkPkg / Library / DxeIoLibCpuIo / DxeCpuIoLibInternal.h
1 /** @file
2 Internal include file of DXE CPU IO Library.
3 It includes all necessary protocol/library class's header file
4 for implementation of IoLib library instance. It is included
5 all source code of this library instance.
6
7 Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
8 Copyright (c) 2017, AMD Incorporated. All rights reserved.<BR>
9
10 This program and the accompanying materials
11 are licensed and made available under the terms and conditions of the BSD License
12 which accompanies this distribution. The full text of the license may be found at
13 http://opensource.org/licenses/bsd-license.php
14
15 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
16 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
17
18 Module Name: DxeCpuIoLibInternal.h
19
20 **/
21
22 #ifndef _DXE_CPUIO_LIB_INTERNAL_H_
23 #define _DXE_CPUIO_LIB_INTERNAL_H_
24
25
26 #include <FrameworkDxe.h>
27
28 #include <Protocol/CpuIo.h>
29
30 #include <Library/IoLib.h>
31 #include <Library/UefiBootServicesTableLib.h>
32 #include <Library/DebugLib.h>
33 #include <Library/BaseLib.h>
34
35
36 /**
37 Reads registers in the EFI CPU I/O space.
38
39 Reads the I/O port specified by Port with registers width specified by Width.
40 The read value is returned.
41
42 This function must guarantee that all I/O read and write operations are serialized.
43 If such operations are not supported, then ASSERT().
44
45 @param Port The base address of the I/O operation.
46 The caller is responsible for aligning the Address if required.
47 @param Width The width of the I/O operation.
48
49 @return Data read from registers in the EFI CPU I/O space.
50
51 **/
52 UINT64
53 EFIAPI
54 IoReadWorker (
55 IN UINTN Port,
56 IN EFI_CPU_IO_PROTOCOL_WIDTH Width
57 );
58
59 /**
60 Writes registers in the EFI CPU I/O space.
61
62 Writes the I/O port specified by Port with registers width and value specified by Width
63 and Data respectively. Data is returned.
64
65 This function must guarantee that all I/O read and write operations are serialized.
66 If such operations are not supported, then ASSERT().
67
68 @param Port The base address of the I/O operation.
69 The caller is responsible for aligning the Address if required.
70 @param Width The width of the I/O operation.
71 @param Data The value to write to the I/O port.
72
73 @return The parameter of Data.
74
75 **/
76 UINT64
77 EFIAPI
78 IoWriteWorker (
79 IN UINTN Port,
80 IN EFI_CPU_IO_PROTOCOL_WIDTH Width,
81 IN UINT64 Data
82 );
83
84 /**
85 Reads registers in the EFI CPU I/O space.
86
87 Reads the I/O port specified by Port with registers width specified by Width.
88 The port is read Count times, and the read data is stored in the provided Buffer.
89
90 This function must guarantee that all I/O read and write operations are serialized.
91 If such operations are not supported, then ASSERT().
92
93 @param Port The base address of the I/O operation.
94 The caller is responsible for aligning the Address if required.
95 @param Width The width of the I/O operation.
96 @param Count The number of times to read I/O port.
97 @param Buffer The buffer to store the read data into.
98
99 **/
100 VOID
101 EFIAPI
102 IoReadFifoWorker (
103 IN UINTN Port,
104 IN EFI_CPU_IO_PROTOCOL_WIDTH Width,
105 IN UINTN Count,
106 IN VOID *Buffer
107 );
108
109 /**
110 Writes registers in the EFI CPU I/O space.
111
112 Writes the I/O port specified by Port with registers width specified by Width.
113 The port is written Count times, and the write data is retrieved from the provided Buffer.
114
115 This function must guarantee that all I/O read and write operations are serialized.
116 If such operations are not supported, then ASSERT().
117
118 @param Port The base address of the I/O operation.
119 The caller is responsible for aligning the Address if required.
120 @param Width The width of the I/O operation.
121 @param Count The number of times to write I/O port.
122 @param Buffer The buffer to store the read data into.
123
124 **/
125 VOID
126 EFIAPI
127 IoWriteFifoWorker (
128 IN UINTN Port,
129 IN EFI_CPU_IO_PROTOCOL_WIDTH Width,
130 IN UINTN Count,
131 IN VOID *Buffer
132 );
133
134 /**
135 Reads memory-mapped registers in the EFI system memory space.
136
137 Reads the MMIO registers specified by Address with registers width specified by Width.
138 The read value is returned. If such operations are not supported, then ASSERT().
139 This function must guarantee that all MMIO read and write operations are serialized.
140
141 @param Address The MMIO register to read.
142 The caller is responsible for aligning the Address if required.
143 @param Width The width of the I/O operation.
144
145 @return Data read from registers in the EFI system memory space.
146
147 **/
148 UINT64
149 EFIAPI
150 MmioReadWorker (
151 IN UINTN Address,
152 IN EFI_CPU_IO_PROTOCOL_WIDTH Width
153 );
154
155 /**
156 Writes memory-mapped registers in the EFI system memory space.
157
158 Writes the MMIO registers specified by Address with registers width and value specified by Width
159 and Data respectively. Data is returned. If such operations are not supported, then ASSERT().
160 This function must guarantee that all MMIO read and write operations are serialized.
161
162 @param Address The MMIO register to read.
163 The caller is responsible for aligning the Address if required.
164 @param Width The width of the I/O operation.
165 @param Data The value to write to the I/O port.
166
167 @return Data read from registers in the EFI system memory space.
168
169 **/
170 UINT64
171 EFIAPI
172 MmioWriteWorker (
173 IN UINTN Address,
174 IN EFI_CPU_IO_PROTOCOL_WIDTH Width,
175 IN UINT64 Data
176 );
177
178 #endif