Initial import.
[mirror_edk2.git] / MdePkg / Library / BaseCacheMaintenanceLib / x86Cache.c
1 /** @file
2 Cache Maintenance Functions.
3
4 Copyright (c) 2006, Intel Corporation<BR>
5 All rights reserved. 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
9
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.
12
13 Module Name: x86Cache.c
14
15 **/
16
17 VOID
18 EFIAPI
19 InvalidateInstructionCache (
20 VOID
21 )
22 {
23 return;
24 }
25
26 VOID *
27 EFIAPI
28 InvalidateInstructionCacheRange (
29 IN VOID *Address,
30 IN UINTN Length
31 )
32 {
33 return Address;
34 }
35
36 VOID
37 EFIAPI
38 WriteBackInvalidateDataCache (
39 VOID
40 )
41 {
42 AsmWbinvd ();
43 }
44
45 VOID *
46 EFIAPI
47 WriteBackInvalidateDataCacheRange (
48 IN VOID *Address,
49 IN UINTN Length
50 )
51 {
52 if (Length != 0) {
53 AsmWbinvd ();
54 }
55 return Address;
56 }
57
58 VOID
59 EFIAPI
60 WriteBackDataCache (
61 VOID
62 )
63 {
64 AsmWbinvd ();
65 }
66
67 VOID *
68 EFIAPI
69 WriteBackDataCacheRange (
70 IN VOID *Address,
71 IN UINTN Length
72 )
73 {
74 AsmWbinvd ();
75 return Address;
76 }
77
78 VOID
79 EFIAPI
80 InvalidateDataCache (
81 VOID
82 )
83 {
84 AsmInvd ();
85 }
86
87 VOID *
88 EFIAPI
89 InvalidateDataCacheRange (
90 IN VOID *Address,
91 IN UINTN Length
92 )
93 {
94 return Address;
95 }