]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Library/RegisterFilterLibNull/RegisterFilterLibNull.c
MdePkg: Apply uncrustify changes
[mirror_edk2.git] / MdePkg / Library / RegisterFilterLibNull / RegisterFilterLibNull.c
1 /** @file
2 Null instance of RegisterFilterLib.
3
4 Copyright (c) 2021 Intel Corporation. All rights reserved.<BR>
5
6 SPDX-License-Identifier: BSD-2-Clause-Patent
7
8 **/
9
10 #include <Library/RegisterFilterLib.h>
11
12 /**
13 Filter IO read operation before read IO port.
14 It is used to filter IO read operation.
15
16 It will return the flag to decide whether require read real IO port.
17 It can be used for emulation environment.
18
19 @param[in] Width Signifies the width of the I/O operation.
20 @param[in] Address The base address of the I/O operation.
21 @param[in,out] Buffer The destination buffer to store the results.
22
23 @retval TRUE Need to excute the IO read.
24 @retval FALSE Skip the IO read.
25
26 **/
27 BOOLEAN
28 EFIAPI
29 FilterBeforeIoRead (
30 IN FILTER_IO_WIDTH Width,
31 IN UINTN Address,
32 IN OUT VOID *Buffer
33 )
34 {
35 return TRUE;
36 }
37
38 /**
39 Trace IO read operation after read IO port.
40 It is used to trace IO operation.
41
42 @param[in] Width Signifies the width of the I/O operation.
43 @param[in] Address The base address of the I/O operation.
44 @param[in] Buffer The destination buffer to store the results.
45
46 **/
47 VOID
48 EFIAPI
49 FilterAfterIoRead (
50 IN FILTER_IO_WIDTH Width,
51 IN UINTN Address,
52 IN VOID *Buffer
53 )
54 {
55 return;
56 }
57
58 /**
59 Filter IO Write operation before wirte IO port.
60 It is used to filter IO operation.
61
62 It will return the flag to decide whether require read write IO port.
63 It can be used for emulation environment.
64
65 @param[in] Width Signifies the width of the I/O operation.
66 @param[in] Address The base address of the I/O operation.
67 @param[in] Buffer The source buffer from which to write data.
68
69 @retval TRUE Need to excute the IO write.
70 @retval FALSE Skip the IO write.
71
72 **/
73 BOOLEAN
74 EFIAPI
75 FilterBeforeIoWrite (
76 IN FILTER_IO_WIDTH Width,
77 IN UINTN Address,
78 IN VOID *Buffer
79 )
80 {
81 return TRUE;
82 }
83
84 /**
85 Trace IO Write operation after wirte IO port.
86 It is used to trace IO operation.
87
88 @param[in] Width Signifies the width of the I/O operation.
89 @param[in] Address The base address of the I/O operation.
90 @param[in] Buffer The source buffer from which to Write data.
91
92 **/
93 VOID
94 EFIAPI
95 FilterAfterIoWrite (
96 IN FILTER_IO_WIDTH Width,
97 IN UINTN Address,
98 IN VOID *Buffer
99 )
100 {
101 return;
102 }
103
104 /**
105 Filter memory IO before Read operation.
106
107 It will return the flag to decide whether require read real MMIO.
108 It can be used for emulation environment.
109
110 @param[in] Width Signifies the width of the memory I/O operation.
111 @param[in] Address The base address of the memory I/O operation.
112 @param[in,out] Buffer The destination buffer to store the results.
113
114 @retval TRUE Need to excute the MMIO read.
115 @retval FALSE Skip the MMIO read.
116
117 **/
118 BOOLEAN
119 EFIAPI
120 FilterBeforeMmIoRead (
121 IN FILTER_IO_WIDTH Width,
122 IN UINTN Address,
123 IN OUT VOID *Buffer
124 )
125 {
126 return TRUE;
127 }
128
129 /**
130 Tracer memory IO after read operation.
131
132 @param[in] Width Signifies the width of the memory I/O operation.
133 @param[in] Address The base address of the memory I/O operation.
134 @param[in] Buffer The destination buffer to store the results.
135
136 **/
137 VOID
138 EFIAPI
139 FilterAfterMmIoRead (
140 IN FILTER_IO_WIDTH Width,
141 IN UINTN Address,
142 IN VOID *Buffer
143 )
144 {
145 return;
146 }
147
148 /**
149 Filter memory IO before write operation.
150
151 It will return the flag to decide whether require wirte real MMIO.
152 It can be used for emulation environment.
153
154 @param[in] Width Signifies the width of the memory I/O operation.
155 @param[in] Address The base address of the memory I/O operation.
156 @param[in] Buffer The source buffer from which to write data.
157
158 @retval TRUE Need to excute the MMIO write.
159 @retval FALSE Skip the MMIO write.
160
161 **/
162 BOOLEAN
163 EFIAPI
164 FilterBeforeMmIoWrite (
165 IN FILTER_IO_WIDTH Width,
166 IN UINTN Address,
167 IN VOID *Buffer
168 )
169 {
170 return TRUE;
171 }
172
173 /**
174 Tracer memory IO after write operation.
175
176 @param[in] Width Signifies the width of the memory I/O operation.
177 @param[in] Address The base address of the memory I/O operation.
178 @param[in] Buffer The source buffer from which to write data.
179
180 **/
181 VOID
182 EFIAPI
183 FilterAfterMmIoWrite (
184 IN FILTER_IO_WIDTH Width,
185 IN UINTN Address,
186 IN VOID *Buffer
187 )
188 {
189 return;
190 }
191
192 /**
193 Filter MSR before read operation.
194
195 It will return the flag to decide whether require read real MSR.
196 It can be used for emulation environment.
197
198 @param Index The Register index of the MSR.
199 @param Value Point to the data will be read from the MSR.
200
201 @retval TRUE Need to excute the MSR read.
202 @retval FALSE Skip the MSR read.
203
204 **/
205 BOOLEAN
206 EFIAPI
207 FilterBeforeMsrRead (
208 IN UINT32 Index,
209 IN OUT UINT64 *Value
210 )
211 {
212 return TRUE;
213 }
214
215 /**
216 Trace MSR after read operation.
217
218 @param Index The Register index of the MSR.
219 @param Value Point to the data has been be read from the MSR.
220
221 **/
222 VOID
223 EFIAPI
224 FilterAfterMsrRead (
225 IN UINT32 Index,
226 IN UINT64 *Value
227 )
228 {
229 return;
230 }
231
232 /**
233 Filter MSR before write operation.
234
235 It will return the flag to decide whether require write real MSR.
236 It can be used for emulation environment.
237
238 @param Index The Register index of the MSR.
239 @param Value Point to the data want to be written to the MSR.
240
241 @retval TRUE Need to excute the MSR write.
242 @retval FALSE Skip the MSR write.
243
244 **/
245 BOOLEAN
246 EFIAPI
247 FilterBeforeMsrWrite (
248 IN UINT32 Index,
249 IN UINT64 *Value
250 )
251 {
252 return TRUE;
253 }
254
255 /**
256 Trace MSR after write operation.
257
258 @param Index The Register index of the MSR.
259 @param Value Point to the data has been be written to the MSR.
260
261 **/
262 VOID
263 EFIAPI
264 FilterAfterMsrWrite (
265 IN UINT32 Index,
266 IN UINT64 *Value
267 )
268 {
269 return;
270 }