Revision: 18758
          http://sourceforge.net/p/edk2/code/18758
Author:   abiesheuvel
Date:     2015-11-09 13:28:17 +0000 (Mon, 09 Nov 2015)
Log Message:
-----------
ArmPkg/ArmLib: add accessor function for Cache Writeback Granule

Add a function to ArmLib that provides access to the Cache Writeback
Granule (CWG) field in CTR_EL0. This information is required when
performing non-coherent DMA.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <[email protected]>
Reviewed-by: Mark Rutland <[email protected]>
Reviewed-by: Leif Lindholm <[email protected]>

Modified Paths:
--------------
    trunk/edk2/ArmPkg/Include/Library/ArmLib.h
    trunk/edk2/ArmPkg/Library/ArmLib/Common/ArmLib.c

Modified: trunk/edk2/ArmPkg/Include/Library/ArmLib.h
===================================================================
--- trunk/edk2/ArmPkg/Include/Library/ArmLib.h  2015-11-09 13:27:56 UTC (rev 
18757)
+++ trunk/edk2/ArmPkg/Include/Library/ArmLib.h  2015-11-09 13:28:17 UTC (rev 
18758)
@@ -116,6 +116,12 @@
 
 UINTN
 EFIAPI
+ArmCacheWritebackGranule (
+  VOID
+  );
+
+UINTN
+EFIAPI
 ArmIsArchTimerImplemented (
   VOID
   );

Modified: trunk/edk2/ArmPkg/Library/ArmLib/Common/ArmLib.c
===================================================================
--- trunk/edk2/ArmPkg/Library/ArmLib/Common/ArmLib.c    2015-11-09 13:27:56 UTC 
(rev 18757)
+++ trunk/edk2/ArmPkg/Library/ArmLib/Common/ArmLib.c    2015-11-09 13:28:17 UTC 
(rev 18758)
@@ -88,3 +88,20 @@
 {
   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;
+}


------------------------------------------------------------------------------
Presto, an open source distributed SQL query engine for big data, initially
developed by Facebook, enables you to easily query your data on Hadoop in a 
more interactive manner. Teradata is also now providing full enterprise
support for Presto. Download a free open source copy now.
http://pubads.g.doubleclick.net/gampad/clk?id=250295911&iu=/4140
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits

Reply via email to