diff options
Diffstat (limited to 'ArmPkg')
-rw-r--r-- | ArmPkg/Include/Library/ArmLib.h | 6 | ||||
-rw-r--r-- | ArmPkg/Library/ArmLib/Common/ArmLib.c | 17 |
2 files changed, 23 insertions, 0 deletions
diff --git a/ArmPkg/Include/Library/ArmLib.h b/ArmPkg/Include/Library/ArmLib.h index 2059a67bbf..a328146b69 100644 --- a/ArmPkg/Include/Library/ArmLib.h +++ b/ArmPkg/Include/Library/ArmLib.h @@ -116,6 +116,12 @@ ArmInstructionCacheLineLength ( UINTN
EFIAPI
+ArmCacheWritebackGranule (
+ VOID
+ );
+
+UINTN
+EFIAPI
ArmIsArchTimerImplemented (
VOID
);
diff --git a/ArmPkg/Library/ArmLib/Common/ArmLib.c b/ArmPkg/Library/ArmLib/Common/ArmLib.c index ad0a265e9f..7e227936fa 100644 --- a/ArmPkg/Library/ArmLib/Common/ArmLib.c +++ b/ArmPkg/Library/ArmLib/Common/ArmLib.c @@ -88,3 +88,20 @@ ArmInstructionCacheLineLength ( {
return 4 << (ArmCacheInfo () & 0xf); // CTR_EL0.IminLine
}
+
+UINTN
+EFIAPI
+ArmCacheWritebackGranule (
+ VOID
+ )
+{
+ UINTN CWG;
+
+ CWG = (ArmCacheInfo () >> 24) & 0xf; // CTR_EL0.CWG
+
+ if (CWG == 0) {
+ return SIZE_2KB;
+ }
+
+ return 4 << CWG;
+}
|