3 Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
4 Copyright (c) 2011 - 2014, ARM Limited. All rights reserved.
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.
16 #include <Chipset/ArmV7.h>
17 #include <Library/ArmLib.h>
18 #include <Library/BaseLib.h>
19 #include <Library/IoLib.h>
21 #include "ArmLibPrivate.h"
24 ArmV7DataCacheOperation (
25 IN ARM_V7_CACHE_OPERATION DataCacheOperation
28 UINTN SavedInterruptState
;
30 SavedInterruptState
= ArmGetInterruptState ();
31 ArmDisableInterrupts ();
33 ArmV7AllDataCachesOperation (DataCacheOperation
);
35 ArmDrainWriteBuffer ();
37 if (SavedInterruptState
) {
38 ArmEnableInterrupts ();
44 ArmInvalidateDataCache (
48 ArmDrainWriteBuffer ();
49 ArmV7DataCacheOperation (ArmInvalidateDataCacheEntryBySetWay
);
54 ArmCleanInvalidateDataCache (
58 ArmDrainWriteBuffer ();
59 ArmV7DataCacheOperation (ArmCleanInvalidateDataCacheEntryBySetWay
);
68 ArmDrainWriteBuffer ();
69 ArmV7DataCacheOperation (ArmCleanDataCacheEntryBySetWay
);