3 Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
4 Portions copyright (c) 2011 - 2014, ARM Ltd. All rights reserved.<BR>
6 This program and the accompanying materials
7 are licensed and made available under the terms and conditions of the BSD License
8 which accompanies this distribution. The full text of the license may be found at
9 http://opensource.org/licenses/bsd-license.php
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
17 #include <Chipset/AArch64.h>
18 #include <Library/ArmLib.h>
19 #include <Library/BaseLib.h>
20 #include <Library/IoLib.h>
21 #include "AArch64Lib.h"
22 #include "ArmLibPrivate.h"
25 AArch64DataCacheOperation (
26 IN AARCH64_CACHE_OPERATION DataCacheOperation
29 UINTN SavedInterruptState
;
31 SavedInterruptState
= ArmGetInterruptState ();
32 ArmDisableInterrupts();
34 AArch64AllDataCachesOperation (DataCacheOperation
);
36 ArmDataSynchronizationBarrier ();
38 if (SavedInterruptState
) {
39 ArmEnableInterrupts ();
45 ArmInvalidateDataCache (
49 ArmDataSynchronizationBarrier ();
50 AArch64DataCacheOperation (ArmInvalidateDataCacheEntryBySetWay
);
55 ArmCleanInvalidateDataCache (
59 ArmDataSynchronizationBarrier ();
60 AArch64DataCacheOperation (ArmCleanInvalidateDataCacheEntryBySetWay
);
69 ArmDataSynchronizationBarrier ();
70 AArch64DataCacheOperation (ArmCleanDataCacheEntryBySetWay
);