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