]>
Commit | Line | Data |
---|---|---|
430fbbe0 | 1 | /** @file\r |
2 | Internal include file for the SMM CPU I/O Protocol.\r | |
3 | \r | |
7367cc6c | 4 | Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>\r |
0acd8697 | 5 | SPDX-License-Identifier: BSD-2-Clause-Patent\r |
430fbbe0 | 6 | \r |
7 | **/\r | |
8 | \r | |
9 | #ifndef _CPU_IO2_SMM_H_\r | |
10 | #define _CPU_IO2_SMM_H_\r | |
11 | \r | |
12 | #include <PiSmm.h>\r | |
13 | \r | |
14 | #include <Protocol/SmmCpuIo2.h>\r | |
15 | \r | |
16 | #include <Library/BaseLib.h>\r | |
17 | #include <Library/DebugLib.h>\r | |
18 | #include <Library/IoLib.h>\r | |
19 | #include <Library/SmmServicesTableLib.h>\r | |
20 | #include <Library/BaseMemoryLib.h>\r | |
21 | \r | |
22 | #define MAX_IO_PORT_ADDRESS 0xFFFF\r | |
23 | \r | |
24 | /**\r | |
25 | Reads memory-mapped registers.\r | |
26 | \r | |
7367cc6c LG |
27 | The I/O operations are carried out exactly as requested. The caller is\r |
28 | responsible for any alignment and I/O width issues that the bus, device,\r | |
430fbbe0 | 29 | platform, or type of I/O might require.\r |
30 | \r | |
31 | @param[in] This The EFI_SMM_CPU_IO2_PROTOCOL instance.\r | |
32 | @param[in] Width Signifies the width of the I/O operations.\r | |
7367cc6c LG |
33 | @param[in] Address The base address of the I/O operations. The caller is\r |
34 | responsible for aligning the Address if required.\r | |
430fbbe0 | 35 | @param[in] Count The number of I/O operations to perform.\r |
7367cc6c LG |
36 | @param[out] Buffer For read operations, the destination buffer to store\r |
37 | the results. For write operations, the source buffer\r | |
430fbbe0 | 38 | from which to write data.\r |
39 | \r | |
40 | @retval EFI_SUCCESS The data was read from or written to the device.\r | |
41 | @retval EFI_UNSUPPORTED The Address is not valid for this system.\r | |
42 | @retval EFI_INVALID_PARAMETER Width or Count, or both, were invalid.\r | |
7367cc6c | 43 | @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a\r |
430fbbe0 | 44 | lack of resources\r |
45 | \r | |
46 | **/\r | |
47 | EFI_STATUS\r | |
48 | EFIAPI\r | |
49 | CpuMemoryServiceRead (\r | |
50 | IN CONST EFI_SMM_CPU_IO2_PROTOCOL *This,\r | |
51 | IN EFI_SMM_IO_WIDTH Width,\r | |
52 | IN UINT64 Address,\r | |
53 | IN UINTN Count,\r | |
54 | OUT VOID *Buffer\r | |
55 | );\r | |
56 | \r | |
57 | /**\r | |
58 | Writes memory-mapped registers.\r | |
59 | \r | |
7367cc6c LG |
60 | The I/O operations are carried out exactly as requested. The caller is\r |
61 | responsible for any alignment and I/O width issues that the bus, device,\r | |
430fbbe0 | 62 | platform, or type of I/O might require.\r |
63 | \r | |
64 | @param[in] This The EFI_SMM_CPU_IO2_PROTOCOL instance.\r | |
65 | @param[in] Width Signifies the width of the I/O operations.\r | |
7367cc6c LG |
66 | @param[in] Address The base address of the I/O operations. The caller is\r |
67 | responsible for aligning the Address if required.\r | |
430fbbe0 | 68 | @param[in] Count The number of I/O operations to perform.\r |
7367cc6c LG |
69 | @param[in] Buffer For read operations, the destination buffer to store\r |
70 | the results. For write operations, the source buffer\r | |
430fbbe0 | 71 | from which to write data.\r |
72 | \r | |
73 | @retval EFI_SUCCESS The data was read from or written to the device.\r | |
74 | @retval EFI_UNSUPPORTED The Address is not valid for this system.\r | |
75 | @retval EFI_INVALID_PARAMETER Width or Count, or both, were invalid.\r | |
7367cc6c | 76 | @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a\r |
430fbbe0 | 77 | lack of resources\r |
78 | \r | |
79 | **/\r | |
80 | EFI_STATUS\r | |
81 | EFIAPI\r | |
82 | CpuMemoryServiceWrite (\r | |
83 | IN CONST EFI_SMM_CPU_IO2_PROTOCOL *This,\r | |
84 | IN EFI_SMM_IO_WIDTH Width,\r | |
85 | IN UINT64 Address,\r | |
86 | IN UINTN Count,\r | |
87 | IN VOID *Buffer\r | |
88 | );\r | |
89 | \r | |
90 | /**\r | |
91 | Reads I/O registers.\r | |
92 | \r | |
7367cc6c LG |
93 | The I/O operations are carried out exactly as requested. The caller is\r |
94 | responsible for any alignment and I/O width issues that the bus, device,\r | |
430fbbe0 | 95 | platform, or type of I/O might require.\r |
96 | \r | |
97 | @param[in] This The EFI_SMM_CPU_IO2_PROTOCOL instance.\r | |
98 | @param[in] Width Signifies the width of the I/O operations.\r | |
7367cc6c LG |
99 | @param[in] Address The base address of the I/O operations. The caller is\r |
100 | responsible for aligning the Address if required.\r | |
430fbbe0 | 101 | @param[in] Count The number of I/O operations to perform.\r |
7367cc6c LG |
102 | @param[out] Buffer For read operations, the destination buffer to store\r |
103 | the results. For write operations, the source buffer\r | |
430fbbe0 | 104 | from which to write data.\r |
105 | \r | |
106 | @retval EFI_SUCCESS The data was read from or written to the device.\r | |
107 | @retval EFI_UNSUPPORTED The Address is not valid for this system.\r | |
108 | @retval EFI_INVALID_PARAMETER Width or Count, or both, were invalid.\r | |
7367cc6c | 109 | @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a\r |
430fbbe0 | 110 | lack of resources\r |
111 | \r | |
112 | **/\r | |
113 | EFI_STATUS\r | |
114 | EFIAPI\r | |
115 | CpuIoServiceRead (\r | |
116 | IN CONST EFI_SMM_CPU_IO2_PROTOCOL *This,\r | |
117 | IN EFI_SMM_IO_WIDTH Width,\r | |
118 | IN UINT64 Address,\r | |
119 | IN UINTN Count,\r | |
120 | OUT VOID *Buffer\r | |
121 | );\r | |
122 | \r | |
123 | /**\r | |
124 | Write I/O registers.\r | |
125 | \r | |
7367cc6c LG |
126 | The I/O operations are carried out exactly as requested. The caller is\r |
127 | responsible for any alignment and I/O width issues that the bus, device,\r | |
430fbbe0 | 128 | platform, or type of I/O might require.\r |
129 | \r | |
130 | @param[in] This The EFI_SMM_CPU_IO2_PROTOCOL instance.\r | |
131 | @param[in] Width Signifies the width of the I/O operations.\r | |
7367cc6c LG |
132 | @param[in] Address The base address of the I/O operations. The caller is\r |
133 | responsible for aligning the Address if required.\r | |
430fbbe0 | 134 | @param[in] Count The number of I/O operations to perform.\r |
7367cc6c LG |
135 | @param[in] Buffer For read operations, the destination buffer to store\r |
136 | the results. For write operations, the source buffer\r | |
430fbbe0 | 137 | from which to write data.\r |
138 | \r | |
139 | @retval EFI_SUCCESS The data was read from or written to the device.\r | |
140 | @retval EFI_UNSUPPORTED The Address is not valid for this system.\r | |
141 | @retval EFI_INVALID_PARAMETER Width or Count, or both, were invalid.\r | |
7367cc6c | 142 | @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a\r |
430fbbe0 | 143 | lack of resources\r |
144 | \r | |
145 | **/\r | |
146 | EFI_STATUS\r | |
147 | EFIAPI\r | |
148 | CpuIoServiceWrite (\r | |
149 | IN CONST EFI_SMM_CPU_IO2_PROTOCOL *This,\r | |
150 | IN EFI_SMM_IO_WIDTH Width,\r | |
151 | IN UINT64 Address,\r | |
152 | IN UINTN Count,\r | |
153 | IN VOID *Buffer\r | |
154 | );\r | |
155 | \r | |
156 | #endif\r |