2 Internal include file for the SMM CPU I/O Protocol.
4 Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>
5 This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
15 #ifndef _CPU_IO2_SMM_H_
16 #define _CPU_IO2_SMM_H_
20 #include <Protocol/SmmCpuIo2.h>
22 #include <Library/BaseLib.h>
23 #include <Library/DebugLib.h>
24 #include <Library/IoLib.h>
25 #include <Library/SmmServicesTableLib.h>
26 #include <Library/BaseMemoryLib.h>
28 #define MAX_IO_PORT_ADDRESS 0xFFFF
31 Reads memory-mapped registers.
33 The I/O operations are carried out exactly as requested. The caller is
34 responsible for any alignment and I/O width issues that the bus, device,
35 platform, or type of I/O might require.
37 @param[in] This The EFI_SMM_CPU_IO2_PROTOCOL instance.
38 @param[in] Width Signifies the width of the I/O operations.
39 @param[in] Address The base address of the I/O operations. The caller is
40 responsible for aligning the Address if required.
41 @param[in] Count The number of I/O operations to perform.
42 @param[out] Buffer For read operations, the destination buffer to store
43 the results. For write operations, the source buffer
44 from which to write data.
46 @retval EFI_SUCCESS The data was read from or written to the device.
47 @retval EFI_UNSUPPORTED The Address is not valid for this system.
48 @retval EFI_INVALID_PARAMETER Width or Count, or both, were invalid.
49 @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a
55 CpuMemoryServiceRead (
56 IN CONST EFI_SMM_CPU_IO2_PROTOCOL
*This
,
57 IN EFI_SMM_IO_WIDTH Width
,
64 Writes memory-mapped registers.
66 The I/O operations are carried out exactly as requested. The caller is
67 responsible for any alignment and I/O width issues that the bus, device,
68 platform, or type of I/O might require.
70 @param[in] This The EFI_SMM_CPU_IO2_PROTOCOL instance.
71 @param[in] Width Signifies the width of the I/O operations.
72 @param[in] Address The base address of the I/O operations. The caller is
73 responsible for aligning the Address if required.
74 @param[in] Count The number of I/O operations to perform.
75 @param[in] Buffer For read operations, the destination buffer to store
76 the results. For write operations, the source buffer
77 from which to write data.
79 @retval EFI_SUCCESS The data was read from or written to the device.
80 @retval EFI_UNSUPPORTED The Address is not valid for this system.
81 @retval EFI_INVALID_PARAMETER Width or Count, or both, were invalid.
82 @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a
88 CpuMemoryServiceWrite (
89 IN CONST EFI_SMM_CPU_IO2_PROTOCOL
*This
,
90 IN EFI_SMM_IO_WIDTH Width
,
99 The I/O operations are carried out exactly as requested. The caller is
100 responsible for any alignment and I/O width issues that the bus, device,
101 platform, or type of I/O might require.
103 @param[in] This The EFI_SMM_CPU_IO2_PROTOCOL instance.
104 @param[in] Width Signifies the width of the I/O operations.
105 @param[in] Address The base address of the I/O operations. The caller is
106 responsible for aligning the Address if required.
107 @param[in] Count The number of I/O operations to perform.
108 @param[out] Buffer For read operations, the destination buffer to store
109 the results. For write operations, the source buffer
110 from which to write data.
112 @retval EFI_SUCCESS The data was read from or written to the device.
113 @retval EFI_UNSUPPORTED The Address is not valid for this system.
114 @retval EFI_INVALID_PARAMETER Width or Count, or both, were invalid.
115 @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a
122 IN CONST EFI_SMM_CPU_IO2_PROTOCOL
*This
,
123 IN EFI_SMM_IO_WIDTH Width
,
132 The I/O operations are carried out exactly as requested. The caller is
133 responsible for any alignment and I/O width issues that the bus, device,
134 platform, or type of I/O might require.
136 @param[in] This The EFI_SMM_CPU_IO2_PROTOCOL instance.
137 @param[in] Width Signifies the width of the I/O operations.
138 @param[in] Address The base address of the I/O operations. The caller is
139 responsible for aligning the Address if required.
140 @param[in] Count The number of I/O operations to perform.
141 @param[in] Buffer For read operations, the destination buffer to store
142 the results. For write operations, the source buffer
143 from which to write data.
145 @retval EFI_SUCCESS The data was read from or written to the device.
146 @retval EFI_UNSUPPORTED The Address is not valid for this system.
147 @retval EFI_INVALID_PARAMETER Width or Count, or both, were invalid.
148 @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a
155 IN CONST EFI_SMM_CPU_IO2_PROTOCOL
*This
,
156 IN EFI_SMM_IO_WIDTH Width
,