Revision: 15397
http://sourceforge.net/p/edk2/code/15397
Author: oliviermartin
Date: 2014-03-26 19:32:48 +0000 (Wed, 26 Mar 2014)
Log Message:
-----------
ArmPkg/ArmCortexA5x: Declared the helper functions to access the CPU Extended
Control Register
This register is A5x specific. It is the reason why the code moved from ArmLib
to ArmCpuLib/ArmCortexA5xLib.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Olivier Martin <[email protected]>
Modified Paths:
--------------
trunk/edk2/ArmPkg/Drivers/ArmCpuLib/ArmCortexA5xLib/ArmCortexA5xLib.c
trunk/edk2/ArmPkg/Drivers/ArmCpuLib/ArmCortexA5xLib/ArmCortexA5xLib.inf
trunk/edk2/ArmPkg/Include/Chipset/ArmCortexA5x.h
trunk/edk2/ArmPkg/Library/ArmLib/Common/AArch64/ArmLibSupport.S
Added Paths:
-----------
trunk/edk2/ArmPkg/Drivers/ArmCpuLib/ArmCortexA5xLib/AArch64/
trunk/edk2/ArmPkg/Drivers/ArmCpuLib/ArmCortexA5xLib/AArch64/ArmCortexA5xHelper.S
Added:
trunk/edk2/ArmPkg/Drivers/ArmCpuLib/ArmCortexA5xLib/AArch64/ArmCortexA5xHelper.S
===================================================================
---
trunk/edk2/ArmPkg/Drivers/ArmCpuLib/ArmCortexA5xLib/AArch64/ArmCortexA5xHelper.S
(rev 0)
+++
trunk/edk2/ArmPkg/Drivers/ArmCpuLib/ArmCortexA5xLib/AArch64/ArmCortexA5xHelper.S
2014-03-26 19:32:48 UTC (rev 15397)
@@ -0,0 +1,32 @@
+#------------------------------------------------------------------------------
+#
+# Copyright (c) 2013 - 2014, ARM Limited. All rights reserved.
+#
+# 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 <AsmMacroIoLibV8.h>
+
+.text
+.align 3
+GCC_ASM_EXPORT (ArmReadCpuExCr)
+GCC_ASM_EXPORT (ArmWriteCpuExCr)
+
+ASM_PFX(ArmReadCpuExCr):
+ mrs x0, S3_1_c15_c2_1
+ ret
+
+ASM_PFX(ArmWriteCpuExCr):
+ msr S3_1_c15_c2_1, x0
+ dsb sy
+ isb
+ ret
+
+ASM_FUNCTION_REMOVE_IF_UNREFERENCED
Modified: trunk/edk2/ArmPkg/Drivers/ArmCpuLib/ArmCortexA5xLib/ArmCortexA5xLib.c
===================================================================
--- trunk/edk2/ArmPkg/Drivers/ArmCpuLib/ArmCortexA5xLib/ArmCortexA5xLib.c
2014-03-26 19:31:01 UTC (rev 15396)
+++ trunk/edk2/ArmPkg/Drivers/ArmCpuLib/ArmCortexA5xLib/ArmCortexA5xLib.c
2014-03-26 19:32:48 UTC (rev 15397)
@@ -48,3 +48,27 @@
)
{
}
+
+VOID
+EFIAPI
+ArmSetCpuExCrBit (
+ IN UINT64 Bits
+ )
+{
+ UINT64 Value;
+ Value = ArmReadCpuExCr ();
+ Value |= Bits;
+ ArmWriteCpuExCr (Value);
+}
+
+VOID
+EFIAPI
+ArmUnsetCpuExCrBit (
+ IN UINT64 Bits
+ )
+{
+ UINT64 Value;
+ Value = ArmReadCpuExCr ();
+ Value &= ~Bits;
+ ArmWriteCpuExCr (Value);
+}
Modified:
trunk/edk2/ArmPkg/Drivers/ArmCpuLib/ArmCortexA5xLib/ArmCortexA5xLib.inf
===================================================================
--- trunk/edk2/ArmPkg/Drivers/ArmCpuLib/ArmCortexA5xLib/ArmCortexA5xLib.inf
2014-03-26 19:31:01 UTC (rev 15396)
+++ trunk/edk2/ArmPkg/Drivers/ArmCpuLib/ArmCortexA5xLib/ArmCortexA5xLib.inf
2014-03-26 19:32:48 UTC (rev 15397)
@@ -1,5 +1,5 @@
#/* @file
-# Copyright (c) 2011-2013, ARM Limited. All rights reserved.
+# Copyright (c) 2011-2014, ARM Limited. All rights reserved.
#
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD
License
@@ -31,5 +31,8 @@
[Sources.common]
ArmCortexA5xLib.c
+[Sources.AARCH64]
+ AArch64/ArmCortexA5xHelper.S | GCC
+
[FixedPcd]
gArmTokenSpaceGuid.PcdArmArchTimerFreqInHz
Modified: trunk/edk2/ArmPkg/Include/Chipset/ArmCortexA5x.h
===================================================================
--- trunk/edk2/ArmPkg/Include/Chipset/ArmCortexA5x.h 2014-03-26 19:31:01 UTC
(rev 15396)
+++ trunk/edk2/ArmPkg/Include/Chipset/ArmCortexA5x.h 2014-03-26 19:32:48 UTC
(rev 15397)
@@ -1,6 +1,6 @@
/** @file
- Copyright (c) 2012-2013, ARM Limited. All rights reserved.
+ Copyright (c) 2012-2014, ARM Limited. All rights reserved.
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD
License
@@ -20,4 +20,31 @@
//
#define A5X_FEATURE_SMP (1 << 6)
+//
+// Helper functions to access CPU Extended Control Register
+//
+UINT64
+EFIAPI
+ArmReadCpuExCr (
+ VOID
+ );
+
+VOID
+EFIAPI
+ArmWriteCpuExCr (
+ IN UINT64 Val
+ );
+
+VOID
+EFIAPI
+ArmSetCpuExCrBit (
+ IN UINT64 Bits
+ );
+
+VOID
+EFIAPI
+ArmUnsetCpuExCrBit (
+ IN UINT64 Bits
+ );
+
#endif
Modified: trunk/edk2/ArmPkg/Library/ArmLib/Common/AArch64/ArmLibSupport.S
===================================================================
--- trunk/edk2/ArmPkg/Library/ArmLib/Common/AArch64/ArmLibSupport.S
2014-03-26 19:31:01 UTC (rev 15396)
+++ trunk/edk2/ArmPkg/Library/ArmLib/Common/AArch64/ArmLibSupport.S
2014-03-26 19:32:48 UTC (rev 15397)
@@ -37,8 +37,6 @@
GCC_ASM_EXPORT (ArmWriteMVBar)
GCC_ASM_EXPORT (ArmCallWFE)
GCC_ASM_EXPORT (ArmCallSEV)
-GCC_ASM_EXPORT (ArmReadCpuExCr)
-GCC_ASM_EXPORT (ArmWriteCpuExCr)
GCC_ASM_EXPORT (ArmReadCpuActlr)
GCC_ASM_EXPORT (ArmWriteCpuActlr)
@@ -200,16 +198,6 @@
sev
ret
-ASM_PFX(ArmReadCpuExCr):
- mrs x0, S3_1_c15_c2_1
- ret
-
-ASM_PFX(ArmWriteCpuExCr):
- msr S3_1_c15_c2_1, x0
- dsb sy
- isb
- ret
-
ASM_PFX(ArmReadCpuActlr):
mrs x0, S3_1_c15_c2_0
ret
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/13534_NeoTech
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits