2 Internal include file of DXE CPU IO2 Library.
4 Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.<BR>
5 Copyright (c) 2017, AMD Incorporated. All rights reserved.<BR>
7 SPDX-License-Identifier: BSD-2-Clause-Patent
11 #ifndef _DXE_CPUIO2_LIB_INTERNAL_H_
12 #define _DXE_CPUIO2_LIB_INTERNAL_H_
16 #include <Protocol/CpuIo2.h>
18 #include <Library/IoLib.h>
19 #include <Library/UefiBootServicesTableLib.h>
20 #include <Library/DebugLib.h>
21 #include <Library/BaseLib.h>
25 Reads registers in the EFI CPU I/O space.
27 Reads the I/O port specified by Port with registers width specified by Width.
28 The read value is returned.
30 This function must guarantee that all I/O read and write operations are serialized.
31 If such operations are not supported, then ASSERT().
33 @param Port The base address of the I/O operation.
34 The caller is responsible for aligning the Address if required.
35 @param Width The width of the I/O operation.
37 @return Data read from registers in the EFI CPU I/O space.
44 IN EFI_CPU_IO_PROTOCOL_WIDTH Width
48 Writes registers in the EFI CPU I/O space.
50 Writes the I/O port specified by Port with registers width and value specified by Width
51 and Data respectively. Data is returned.
53 This function must guarantee that all I/O read and write operations are serialized.
54 If such operations are not supported, then ASSERT().
56 @param Port The base address of the I/O operation.
57 The caller is responsible for aligning the Address if required.
58 @param Width The width of the I/O operation.
59 @param Data The value to write to the I/O port.
61 @return The parameter of Data.
68 IN EFI_CPU_IO_PROTOCOL_WIDTH Width
,
73 Reads registers in the EFI CPU I/O space.
75 Reads the I/O port specified by Port with registers width specified by Width.
76 The port is read Count times, and the read data is stored in the provided Buffer.
78 This function must guarantee that all I/O read and write operations are serialized.
79 If such operations are not supported, then ASSERT().
81 @param Port The base address of the I/O operation.
82 The caller is responsible for aligning the Address if required.
83 @param Width The width of the I/O operation.
84 @param Count The number of times to read I/O port.
85 @param Buffer The buffer to store the read data into.
92 IN EFI_CPU_IO_PROTOCOL_WIDTH Width
,
98 Writes registers in the EFI CPU I/O space.
100 Writes the I/O port specified by Port with registers width specified by Width.
101 The port is written Count times, and the write data is retrieved from the provided Buffer.
103 This function must guarantee that all I/O read and write operations are serialized.
104 If such operations are not supported, then ASSERT().
106 @param Port The base address of the I/O operation.
107 The caller is responsible for aligning the Address if required.
108 @param Width The width of the I/O operation.
109 @param Count The number of times to write I/O port.
110 @param Buffer The buffer to store the read data into.
117 IN EFI_CPU_IO_PROTOCOL_WIDTH Width
,
123 Reads memory-mapped registers in the EFI system memory space.
125 Reads the MMIO registers specified by Address with registers width specified by Width.
126 The read value is returned. If such operations are not supported, then ASSERT().
127 This function must guarantee that all MMIO read and write operations are serialized.
129 @param Address The MMIO register to read.
130 The caller is responsible for aligning the Address if required.
131 @param Width The width of the I/O operation.
133 @return Data read from registers in the EFI system memory space.
140 IN EFI_CPU_IO_PROTOCOL_WIDTH Width
144 Writes memory-mapped registers in the EFI system memory space.
146 Writes the MMIO registers specified by Address with registers width and value specified by Width
147 and Data respectively. Data is returned. If such operations are not supported, then ASSERT().
148 This function must guarantee that all MMIO read and write operations are serialized.
150 @param Address The MMIO register to read.
151 The caller is responsible for aligning the Address if required.
152 @param Width The width of the I/O operation.
153 @param Data The value to write to the I/O port.
155 @return Data read from registers in the EFI system memory space.
162 IN EFI_CPU_IO_PROTOCOL_WIDTH Width
,