2013-07-18 20:07:46 +02:00
|
|
|
/** @file
|
|
|
|
|
|
|
|
Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
|
2014-06-03 18:37:29 +02:00
|
|
|
Portions copyright (c) 2011 - 2014, ARM Ltd. All rights reserved.<BR>
|
2013-07-18 20:07:46 +02:00
|
|
|
|
|
|
|
This program and the accompanying materials
|
|
|
|
are licensed and made available under the terms and conditions of the BSD License
|
|
|
|
which accompanies this distribution. The full text of the license may be found at
|
|
|
|
http://opensource.org/licenses/bsd-license.php
|
|
|
|
|
|
|
|
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
|
|
|
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|
|
|
|
|
|
|
**/
|
|
|
|
|
|
|
|
#include <Uefi.h>
|
|
|
|
#include <Chipset/AArch64.h>
|
|
|
|
#include <Library/ArmLib.h>
|
|
|
|
#include <Library/BaseLib.h>
|
|
|
|
#include <Library/IoLib.h>
|
|
|
|
#include "AArch64Lib.h"
|
|
|
|
#include "ArmLibPrivate.h"
|
|
|
|
|
|
|
|
VOID
|
|
|
|
AArch64DataCacheOperation (
|
|
|
|
IN AARCH64_CACHE_OPERATION DataCacheOperation
|
|
|
|
)
|
|
|
|
{
|
|
|
|
UINTN SavedInterruptState;
|
|
|
|
|
|
|
|
SavedInterruptState = ArmGetInterruptState ();
|
|
|
|
ArmDisableInterrupts();
|
|
|
|
|
|
|
|
AArch64AllDataCachesOperation (DataCacheOperation);
|
|
|
|
|
2015-11-20 14:14:59 +01:00
|
|
|
ArmDataSynchronizationBarrier ();
|
2013-07-18 20:07:46 +02:00
|
|
|
|
|
|
|
if (SavedInterruptState) {
|
|
|
|
ArmEnableInterrupts ();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
VOID
|
|
|
|
EFIAPI
|
|
|
|
ArmInvalidateDataCache (
|
|
|
|
VOID
|
|
|
|
)
|
|
|
|
{
|
2015-11-20 14:14:59 +01:00
|
|
|
ArmDataSynchronizationBarrier ();
|
2013-07-18 20:07:46 +02:00
|
|
|
AArch64DataCacheOperation (ArmInvalidateDataCacheEntryBySetWay);
|
|
|
|
}
|
|
|
|
|
|
|
|
VOID
|
|
|
|
EFIAPI
|
|
|
|
ArmCleanInvalidateDataCache (
|
|
|
|
VOID
|
|
|
|
)
|
|
|
|
{
|
2015-11-20 14:14:59 +01:00
|
|
|
ArmDataSynchronizationBarrier ();
|
2013-07-18 20:07:46 +02:00
|
|
|
AArch64DataCacheOperation (ArmCleanInvalidateDataCacheEntryBySetWay);
|
|
|
|
}
|
|
|
|
|
|
|
|
VOID
|
|
|
|
EFIAPI
|
|
|
|
ArmCleanDataCache (
|
|
|
|
VOID
|
|
|
|
)
|
|
|
|
{
|
2015-11-20 14:14:59 +01:00
|
|
|
ArmDataSynchronizationBarrier ();
|
2013-07-18 20:07:46 +02:00
|
|
|
AArch64DataCacheOperation (ArmCleanDataCacheEntryBySetWay);
|
|
|
|
}
|