]> git.proxmox.com Git - mirror_edk2.git/blame - EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Include/Library/EdkIIGlueCacheMaintenanceLib.h
Update the copyright notice format
[mirror_edk2.git] / EdkCompatibilityPkg / Foundation / Library / EdkIIGlueLib / Include / Library / EdkIIGlueCacheMaintenanceLib.h
CommitLineData
3eb9473e 1/*++\r
2\r
2c7e5c2f
HT
3Copyright (c) 2004 - 2006, Intel Corporation. All rights reserved.<BR>\r
4This program and the accompanying materials \r
3eb9473e 5are licensed and made available under the terms and conditions of the BSD License \r
6which accompanies this distribution. The full text of the license may be found at \r
7http://opensource.org/licenses/bsd-license.php \r
8 \r
9THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
10WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
11\r
12\r
13Module Name:\r
14\r
15 EdkIIGlueCacheMaintenanceLib.h\r
16 \r
17Abstract: \r
18\r
19 Cache Maintenance Functions\r
20\r
21--*/\r
22\r
23#ifndef __EDKII_GLUE_CACHE_MAINTENANCE_LIB_H__\r
24#define __EDKII_GLUE_CACHE_MAINTENANCE_LIB_H__\r
25\r
26\r
27#define InvalidateInstructionCache() GlueInvalidateInstructionCache()\r
28\r
29\r
30/**\r
31 Invalidates the entire instruction cache in cache coherency domain of the\r
32 calling CPU.\r
33\r
34 Invalidates the entire instruction cache in cache coherency domain of the\r
35 calling CPU.\r
36\r
37**/\r
38VOID\r
39EFIAPI\r
40GlueInvalidateInstructionCache (\r
41 VOID\r
42 );\r
43\r
44/**\r
45 Invalidates a range of instruction cache lines in the cache coherency domain\r
46 of the calling CPU.\r
47\r
48 Invalidates the instruction cache lines specified by Address and Length. If\r
49 Address is not aligned on a cache line boundary, then entire instruction\r
50 cache line containing Address is invalidated. If Address + Length is not\r
51 aligned on a cache line boundary, then the entire instruction cache line\r
52 containing Address + Length -1 is invalidated. This function may choose to\r
53 invalidate the entire instruction cache if that is more efficient than\r
54 invalidating the specified range. If Length is 0, the no instruction cache\r
55 lines are invalidated. Address is returned.\r
56\r
57 If Length is greater than (MAX_ADDRESS - Address + 1), then ASSERT().\r
58\r
59 @param Address The base address of the instruction cache lines to\r
60 invalidate. If the CPU is in a physical addressing mode, then\r
61 Address is a physical address. If the CPU is in a virtual\r
62 addressing mode, then Address is a virtual address.\r
63\r
64 @param Length The number of bytes to invalidate from the instruction cache.\r
65\r
66 @return Address\r
67\r
68**/\r
69VOID *\r
70EFIAPI\r
71InvalidateInstructionCacheRange (\r
72 IN VOID *Address,\r
73 IN UINTN Length\r
74 );\r
75\r
76/**\r
77 Writes Back and Invalidates the entire data cache in cache coherency domain\r
78 of the calling CPU.\r
79\r
80 Writes Back and Invalidates the entire data cache in cache coherency domain\r
81 of the calling CPU. This function guarantees that all dirty cache lines are\r
82 written back to system memory, and also invalidates all the data cache lines\r
83 in the cache coherency domain of the calling CPU.\r
84\r
85**/\r
86VOID\r
87EFIAPI\r
88WriteBackInvalidateDataCache (\r
89 VOID\r
90 );\r
91\r
92/**\r
93 Writes Back and Invalidates a range of data cache lines in the cache\r
94 coherency domain of the calling CPU.\r
95\r
96 Writes Back and Invalidate the data cache lines specified by Address and\r
97 Length. If Address is not aligned on a cache line boundary, then entire data\r
98 cache line containing Address is written back and invalidated. If Address +\r
99 Length is not aligned on a cache line boundary, then the entire data cache\r
100 line containing Address + Length -1 is written back and invalidated. This\r
101 function may choose to write back and invalidate the entire data cache if\r
102 that is more efficient than writing back and invalidating the specified\r
103 range. If Length is 0, the no data cache lines are written back and\r
104 invalidated. Address is returned.\r
105\r
106 If Length is greater than (MAX_ADDRESS - Address + 1), then ASSERT().\r
107\r
108 @param Address The base address of the data cache lines to write back and\r
109 invalidate. If the CPU is in a physical addressing mode, then\r
110 Address is a physical address. If the CPU is in a virtual\r
111 addressing mode, then Address is a virtual address.\r
112 @param Length The number of bytes to write back and invalidate from the\r
113 data cache.\r
114\r
115 @return Address\r
116\r
117**/\r
118VOID *\r
119EFIAPI\r
120WriteBackInvalidateDataCacheRange (\r
121 IN VOID *Address,\r
122 IN UINTN Length\r
123 );\r
124\r
125/**\r
126 Writes Back the entire data cache in cache coherency domain of the calling\r
127 CPU.\r
128\r
129 Writes Back the entire data cache in cache coherency domain of the calling\r
130 CPU. This function guarantees that all dirty cache lines are written back to\r
131 system memory. This function may also invalidate all the data cache lines in\r
132 the cache coherency domain of the calling CPU.\r
133\r
134**/\r
135VOID\r
136EFIAPI\r
137WriteBackDataCache (\r
138 VOID\r
139 );\r
140\r
141/**\r
142 Writes Back a range of data cache lines in the cache coherency domain of the\r
143 calling CPU.\r
144\r
145 Writes Back the data cache lines specified by Address and Length. If Address\r
146 is not aligned on a cache line boundary, then entire data cache line\r
147 containing Address is written back. If Address + Length is not aligned on a\r
148 cache line boundary, then the entire data cache line containing Address +\r
149 Length -1 is written back. This function may choose to write back the entire\r
150 data cache if that is more efficient than writing back the specified range.\r
151 If Length is 0, the no data cache lines are written back. This function may\r
152 also invalidate all the data cache lines in the specified range of the cache\r
153 coherency domain of the calling CPU. Address is returned.\r
154\r
155 If Length is greater than (MAX_ADDRESS - Address + 1), then ASSERT().\r
156\r
157 @param Address The base address of the data cache lines to write back. If\r
158 the CPU is in a physical addressing mode, then Address is a\r
159 physical address. If the CPU is in a virtual addressing\r
160 mode, then Address is a virtual address.\r
161 @param Length The number of bytes to write back from the data cache.\r
162\r
163 @return Address\r
164\r
165**/\r
166VOID *\r
167EFIAPI\r
168WriteBackDataCacheRange (\r
169 IN VOID *Address,\r
170 IN UINTN Length\r
171 );\r
172\r
173/**\r
174 Invalidates the entire data cache in cache coherency domain of the calling\r
175 CPU.\r
176\r
177 Invalidates the entire data cache in cache coherency domain of the calling\r
178 CPU. This function must be used with care because dirty cache lines are not\r
179 written back to system memory. It is typically used for cache diagnostics. If\r
180 the CPU does not support invalidation of the entire data cache, then a write\r
181 back and invalidate operation should be performed on the entire data cache.\r
182\r
183**/\r
184VOID\r
185EFIAPI\r
186InvalidateDataCache (\r
187 VOID\r
188 );\r
189\r
190/**\r
191 Invalidates a range of data cache lines in the cache coherency domain of the\r
192 calling CPU.\r
193\r
194 Invalidates the data cache lines specified by Address and Length. If Address\r
195 is not aligned on a cache line boundary, then entire data cache line\r
196 containing Address is invalidated. If Address + Length is not aligned on a\r
197 cache line boundary, then the entire data cache line containing Address +\r
198 Length -1 is invalidated. This function must never invalidate any cache lines\r
199 outside the specified range. If Length is 0, the no data cache lines are\r
200 invalidated. Address is returned. This function must be used with care\r
201 because dirty cache lines are not written back to system memory. It is\r
202 typically used for cache diagnostics. If the CPU does not support\r
203 invalidation of a data cache range, then a write back and invalidate\r
204 operation should be performed on the data cache range.\r
205\r
206 If Length is greater than (MAX_ADDRESS - Address + 1), then ASSERT().\r
207\r
208 @param Address The base address of the data cache lines to invalidate. If\r
209 the CPU is in a physical addressing mode, then Address is a\r
210 physical address. If the CPU is in a virtual addressing mode,\r
211 then Address is a virtual address.\r
212 @param Length The number of bytes to invalidate from the data cache.\r
213\r
214 @return Address\r
215\r
216**/\r
217VOID *\r
218EFIAPI\r
219InvalidateDataCacheRange (\r
220 IN VOID *Address,\r
221 IN UINTN Length\r
222 );\r
223\r
224#endif\r