2 Internal include file of DXE CPU IO2 Library.
4 Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>
5 Copyright (c) 2017, AMD Incorporated. All rights reserved.<BR>
7 This program and the accompanying materials are licensed and made available
8 under the terms and conditions of the BSD License which accompanies this
9 distribution. The full text of the license may be found at
10 http://opensource.org/licenses/bsd-license.php.
12 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
13 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
17 #ifndef _DXE_CPUIO2_LIB_INTERNAL_H_
18 #define _DXE_CPUIO2_LIB_INTERNAL_H_
22 #include <Protocol/CpuIo2.h>
24 #include <Library/IoLib.h>
25 #include <Library/UefiBootServicesTableLib.h>
26 #include <Library/DebugLib.h>
27 #include <Library/BaseLib.h>
31 Reads registers in the EFI CPU I/O space.
33 Reads the I/O port specified by Port with registers width specified by Width.
34 The read value is returned.
36 This function must guarantee that all I/O read and write operations are serialized.
37 If such operations are not supported, then ASSERT().
39 @param Port The base address of the I/O operation.
40 The caller is responsible for aligning the Address if required.
41 @param Width The width of the I/O operation.
43 @return Data read from registers in the EFI CPU I/O space.
50 IN EFI_CPU_IO_PROTOCOL_WIDTH Width
54 Writes registers in the EFI CPU I/O space.
56 Writes the I/O port specified by Port with registers width and value specified by Width
57 and Data respectively. Data is returned.
59 This function must guarantee that all I/O read and write operations are serialized.
60 If such operations are not supported, then ASSERT().
62 @param Port The base address of the I/O operation.
63 The caller is responsible for aligning the Address if required.
64 @param Width The width of the I/O operation.
65 @param Data The value to write to the I/O port.
67 @return The parameter of Data.
74 IN EFI_CPU_IO_PROTOCOL_WIDTH Width
,
79 Reads registers in the EFI CPU I/O space.
81 Reads the I/O port specified by Port with registers width specified by Width.
82 The port is read Count times, and the read data is stored in the provided Buffer.
84 This function must guarantee that all I/O read and write operations are serialized.
85 If such operations are not supported, then ASSERT().
87 @param Port The base address of the I/O operation.
88 The caller is responsible for aligning the Address if required.
89 @param Width The width of the I/O operation.
90 @param Count The number of times to read I/O port.
91 @param Buffer The buffer to store the read data into.
98 IN EFI_CPU_IO_PROTOCOL_WIDTH Width
,
104 Writes registers in the EFI CPU I/O space.
106 Writes the I/O port specified by Port with registers width specified by Width.
107 The port is written Count times, and the write data is retrieved from the provided Buffer.
109 This function must guarantee that all I/O read and write operations are serialized.
110 If such operations are not supported, then ASSERT().
112 @param Port The base address of the I/O operation.
113 The caller is responsible for aligning the Address if required.
114 @param Width The width of the I/O operation.
115 @param Count The number of times to write I/O port.
116 @param Buffer The buffer to store the read data into.
123 IN EFI_CPU_IO_PROTOCOL_WIDTH Width
,
129 Reads memory-mapped registers in the EFI system memory space.
131 Reads the MMIO registers specified by Address with registers width specified by Width.
132 The read value is returned. If such operations are not supported, then ASSERT().
133 This function must guarantee that all MMIO read and write operations are serialized.
135 @param Address The MMIO register to read.
136 The caller is responsible for aligning the Address if required.
137 @param Width The width of the I/O operation.
139 @return Data read from registers in the EFI system memory space.
146 IN EFI_CPU_IO_PROTOCOL_WIDTH Width
150 Writes memory-mapped registers in the EFI system memory space.
152 Writes the MMIO registers specified by Address with registers width and value specified by Width
153 and Data respectively. Data is returned. If such operations are not supported, then ASSERT().
154 This function must guarantee that all MMIO read and write operations are serialized.
156 @param Address The MMIO register to read.
157 The caller is responsible for aligning the Address if required.
158 @param Width The width of the I/O operation.
159 @param Data The value to write to the I/O port.
161 @return Data read from registers in the EFI system memory space.
168 IN EFI_CPU_IO_PROTOCOL_WIDTH Width
,