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>
24 Reads registers in the EFI CPU I/O space.
26 Reads the I/O port specified by Port with registers width specified by Width.
27 The read value is returned.
29 This function must guarantee that all I/O read and write operations are serialized.
30 If such operations are not supported, then ASSERT().
32 @param Port The base address of the I/O operation.
33 The caller is responsible for aligning the Address if required.
34 @param Width The width of the I/O operation.
36 @return Data read from registers in the EFI CPU I/O space.
43 IN EFI_CPU_IO_PROTOCOL_WIDTH Width
47 Writes registers in the EFI CPU I/O space.
49 Writes the I/O port specified by Port with registers width and value specified by Width
50 and Data respectively. Data is returned.
52 This function must guarantee that all I/O read and write operations are serialized.
53 If such operations are not supported, then ASSERT().
55 @param Port The base address of the I/O operation.
56 The caller is responsible for aligning the Address if required.
57 @param Width The width of the I/O operation.
58 @param Data The value to write to the I/O port.
60 @return The parameter of Data.
67 IN EFI_CPU_IO_PROTOCOL_WIDTH Width
,
72 Reads registers in the EFI CPU I/O space.
74 Reads the I/O port specified by Port with registers width specified by Width.
75 The port is read Count times, and the read data is stored in the provided Buffer.
77 This function must guarantee that all I/O read and write operations are serialized.
78 If such operations are not supported, then ASSERT().
80 @param Port The base address of the I/O operation.
81 The caller is responsible for aligning the Address if required.
82 @param Width The width of the I/O operation.
83 @param Count The number of times to read I/O port.
84 @param Buffer The buffer to store the read data into.
91 IN EFI_CPU_IO_PROTOCOL_WIDTH Width
,
97 Writes registers in the EFI CPU I/O space.
99 Writes the I/O port specified by Port with registers width specified by Width.
100 The port is written Count times, and the write data is retrieved from the provided Buffer.
102 This function must guarantee that all I/O read and write operations are serialized.
103 If such operations are not supported, then ASSERT().
105 @param Port The base address of the I/O operation.
106 The caller is responsible for aligning the Address if required.
107 @param Width The width of the I/O operation.
108 @param Count The number of times to write I/O port.
109 @param Buffer The buffer to store the read data into.
116 IN EFI_CPU_IO_PROTOCOL_WIDTH Width
,
122 Reads memory-mapped registers in the EFI system memory space.
124 Reads the MMIO registers specified by Address with registers width specified by Width.
125 The read value is returned. If such operations are not supported, then ASSERT().
126 This function must guarantee that all MMIO read and write operations are serialized.
128 @param Address The MMIO register to read.
129 The caller is responsible for aligning the Address if required.
130 @param Width The width of the I/O operation.
132 @return Data read from registers in the EFI system memory space.
139 IN EFI_CPU_IO_PROTOCOL_WIDTH Width
143 Writes memory-mapped registers in the EFI system memory space.
145 Writes the MMIO registers specified by Address with registers width and value specified by Width
146 and Data respectively. Data is returned. If such operations are not supported, then ASSERT().
147 This function must guarantee that all MMIO read and write operations are serialized.
149 @param Address The MMIO register to read.
150 The caller is responsible for aligning the Address if required.
151 @param Width The width of the I/O operation.
152 @param Data The value to write to the I/O port.
154 @return Data read from registers in the EFI system memory space.
161 IN EFI_CPU_IO_PROTOCOL_WIDTH Width
,