2 Internal include file for the SMM CPU I/O Protocol.
4 Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>
5 SPDX-License-Identifier: BSD-2-Clause-Patent
9 #ifndef _CPU_IO2_SMM_H_
10 #define _CPU_IO2_SMM_H_
14 #include <Protocol/SmmCpuIo2.h>
16 #include <Library/BaseLib.h>
17 #include <Library/DebugLib.h>
18 #include <Library/IoLib.h>
19 #include <Library/SmmServicesTableLib.h>
20 #include <Library/BaseMemoryLib.h>
22 #define MAX_IO_PORT_ADDRESS 0xFFFF
25 Reads memory-mapped registers.
27 The I/O operations are carried out exactly as requested. The caller is
28 responsible for any alignment and I/O width issues that the bus, device,
29 platform, or type of I/O might require.
31 @param[in] This The EFI_SMM_CPU_IO2_PROTOCOL instance.
32 @param[in] Width Signifies the width of the I/O operations.
33 @param[in] Address The base address of the I/O operations. The caller is
34 responsible for aligning the Address if required.
35 @param[in] Count The number of I/O operations to perform.
36 @param[out] Buffer For read operations, the destination buffer to store
37 the results. For write operations, the source buffer
38 from which to write data.
40 @retval EFI_SUCCESS The data was read from or written to the device.
41 @retval EFI_UNSUPPORTED The Address is not valid for this system.
42 @retval EFI_INVALID_PARAMETER Width or Count, or both, were invalid.
43 @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a
49 CpuMemoryServiceRead (
50 IN CONST EFI_SMM_CPU_IO2_PROTOCOL
*This
,
51 IN EFI_SMM_IO_WIDTH Width
,
58 Writes memory-mapped registers.
60 The I/O operations are carried out exactly as requested. The caller is
61 responsible for any alignment and I/O width issues that the bus, device,
62 platform, or type of I/O might require.
64 @param[in] This The EFI_SMM_CPU_IO2_PROTOCOL instance.
65 @param[in] Width Signifies the width of the I/O operations.
66 @param[in] Address The base address of the I/O operations. The caller is
67 responsible for aligning the Address if required.
68 @param[in] Count The number of I/O operations to perform.
69 @param[in] Buffer For read operations, the destination buffer to store
70 the results. For write operations, the source buffer
71 from which to write data.
73 @retval EFI_SUCCESS The data was read from or written to the device.
74 @retval EFI_UNSUPPORTED The Address is not valid for this system.
75 @retval EFI_INVALID_PARAMETER Width or Count, or both, were invalid.
76 @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a
82 CpuMemoryServiceWrite (
83 IN CONST EFI_SMM_CPU_IO2_PROTOCOL
*This
,
84 IN EFI_SMM_IO_WIDTH Width
,
93 The I/O operations are carried out exactly as requested. The caller is
94 responsible for any alignment and I/O width issues that the bus, device,
95 platform, or type of I/O might require.
97 @param[in] This The EFI_SMM_CPU_IO2_PROTOCOL instance.
98 @param[in] Width Signifies the width of the I/O operations.
99 @param[in] Address The base address of the I/O operations. The caller is
100 responsible for aligning the Address if required.
101 @param[in] Count The number of I/O operations to perform.
102 @param[out] Buffer For read operations, the destination buffer to store
103 the results. For write operations, the source buffer
104 from which to write data.
106 @retval EFI_SUCCESS The data was read from or written to the device.
107 @retval EFI_UNSUPPORTED The Address is not valid for this system.
108 @retval EFI_INVALID_PARAMETER Width or Count, or both, were invalid.
109 @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a
116 IN CONST EFI_SMM_CPU_IO2_PROTOCOL
*This
,
117 IN EFI_SMM_IO_WIDTH Width
,
126 The I/O operations are carried out exactly as requested. The caller is
127 responsible for any alignment and I/O width issues that the bus, device,
128 platform, or type of I/O might require.
130 @param[in] This The EFI_SMM_CPU_IO2_PROTOCOL instance.
131 @param[in] Width Signifies the width of the I/O operations.
132 @param[in] Address The base address of the I/O operations. The caller is
133 responsible for aligning the Address if required.
134 @param[in] Count The number of I/O operations to perform.
135 @param[in] Buffer For read operations, the destination buffer to store
136 the results. For write operations, the source buffer
137 from which to write data.
139 @retval EFI_SUCCESS The data was read from or written to the device.
140 @retval EFI_UNSUPPORTED The Address is not valid for this system.
141 @retval EFI_INVALID_PARAMETER Width or Count, or both, were invalid.
142 @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a
149 IN CONST EFI_SMM_CPU_IO2_PROTOCOL
*This
,
150 IN EFI_SMM_IO_WIDTH Width
,