]> git.proxmox.com Git - mirror_edk2.git/blame - ArmPkg/Library/ArmLib/AArch64/AArch64Lib.c
ArmPkg: ArmLib: purge incorrect ArmDrainWriteBuffer () alias
[mirror_edk2.git] / ArmPkg / Library / ArmLib / AArch64 / AArch64Lib.c
CommitLineData
25402f5d
HL
1/** @file\r
2\r
3 Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
01674afd 4 Portions copyright (c) 2011 - 2014, ARM Ltd. All rights reserved.<BR>\r
25402f5d
HL
5\r
6 This program and the accompanying materials\r
7 are licensed and made available under the terms and conditions of the BSD License\r
8 which accompanies this distribution. The full text of the license may be found at\r
9 http://opensource.org/licenses/bsd-license.php\r
10\r
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
13\r
14**/\r
15\r
16#include <Uefi.h>\r
17#include <Chipset/AArch64.h>\r
18#include <Library/ArmLib.h>\r
19#include <Library/BaseLib.h>\r
20#include <Library/IoLib.h>\r
21#include "AArch64Lib.h"\r
22#include "ArmLibPrivate.h"\r
23\r
25402f5d
HL
24VOID\r
25AArch64DataCacheOperation (\r
26 IN AARCH64_CACHE_OPERATION DataCacheOperation\r
27 )\r
28{\r
29 UINTN SavedInterruptState;\r
30\r
31 SavedInterruptState = ArmGetInterruptState ();\r
32 ArmDisableInterrupts();\r
33\r
34 AArch64AllDataCachesOperation (DataCacheOperation);\r
35\r
3b149515 36 ArmDataSynchronizationBarrier ();\r
25402f5d
HL
37\r
38 if (SavedInterruptState) {\r
39 ArmEnableInterrupts ();\r
40 }\r
41}\r
42\r
25402f5d
HL
43VOID\r
44EFIAPI\r
45ArmInvalidateDataCache (\r
46 VOID\r
47 )\r
48{\r
3b149515 49 ArmDataSynchronizationBarrier ();\r
25402f5d
HL
50 AArch64DataCacheOperation (ArmInvalidateDataCacheEntryBySetWay);\r
51}\r
52\r
53VOID\r
54EFIAPI\r
55ArmCleanInvalidateDataCache (\r
56 VOID\r
57 )\r
58{\r
3b149515 59 ArmDataSynchronizationBarrier ();\r
25402f5d
HL
60 AArch64DataCacheOperation (ArmCleanInvalidateDataCacheEntryBySetWay);\r
61}\r
62\r
63VOID\r
64EFIAPI\r
65ArmCleanDataCache (\r
66 VOID\r
67 )\r
68{\r
3b149515 69 ArmDataSynchronizationBarrier ();\r
25402f5d
HL
70 AArch64DataCacheOperation (ArmCleanDataCacheEntryBySetWay);\r
71}\r