]> git.proxmox.com Git - mirror_edk2.git/blame - ArmPkg/Library/ArmLib/ArmV7/ArmV7Lib.c
ArmPkg/ArmBaseLib: remove MemoryAllocationLib.h includes
[mirror_edk2.git] / ArmPkg / Library / ArmLib / ArmV7 / ArmV7Lib.c
CommitLineData
1e57a462 1/** @file\r
2\r
3 Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
01674afd 4 Copyright (c) 2011 - 2014, ARM Limited. All rights reserved.\r
3402aac7 5\r
1e57a462 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#include <Uefi.h>\r
16#include <Chipset/ArmV7.h>\r
17#include <Library/ArmLib.h>\r
18#include <Library/BaseLib.h>\r
19#include <Library/IoLib.h>\r
20#include "ArmV7Lib.h"\r
21#include "ArmLibPrivate.h"\r
22\r
1e57a462 23VOID\r
24ArmV7DataCacheOperation (\r
25 IN ARM_V7_CACHE_OPERATION DataCacheOperation\r
26 )\r
27{\r
28 UINTN SavedInterruptState;\r
29\r
30 SavedInterruptState = ArmGetInterruptState ();\r
31 ArmDisableInterrupts ();\r
3402aac7 32\r
1e57a462 33 ArmV7AllDataCachesOperation (DataCacheOperation);\r
3402aac7 34\r
3b149515 35 ArmDataSynchronizationBarrier ();\r
3402aac7 36\r
1e57a462 37 if (SavedInterruptState) {\r
38 ArmEnableInterrupts ();\r
39 }\r
40}\r
41\r
1e57a462 42VOID\r
43EFIAPI\r
44ArmInvalidateDataCache (\r
45 VOID\r
46 )\r
47{\r
3b149515 48 ArmDataSynchronizationBarrier ();\r
1e57a462 49 ArmV7DataCacheOperation (ArmInvalidateDataCacheEntryBySetWay);\r
50}\r
51\r
52VOID\r
53EFIAPI\r
54ArmCleanInvalidateDataCache (\r
55 VOID\r
56 )\r
57{\r
3b149515 58 ArmDataSynchronizationBarrier ();\r
1e57a462 59 ArmV7DataCacheOperation (ArmCleanInvalidateDataCacheEntryBySetWay);\r
60}\r
61\r
62VOID\r
63EFIAPI\r
64ArmCleanDataCache (\r
65 VOID\r
66 )\r
67{\r
3b149515 68 ArmDataSynchronizationBarrier ();\r
1e57a462 69 ArmV7DataCacheOperation (ArmCleanDataCacheEntryBySetWay);\r
70}\r