]> git.proxmox.com Git - mirror_edk2.git/commitdiff
ArmPkg/Library: Add ArmReadSctlr for AArch64
authorSupreeth Venkatesh <supreeth.venkatesh@arm.com>
Fri, 29 Jul 2016 23:06:32 +0000 (18:06 -0500)
committerArd Biesheuvel <ard.biesheuvel@linaro.org>
Mon, 1 Aug 2016 12:07:17 +0000 (14:07 +0200)
ArmLib defines a prototype for the ArmReadSctlr() function, but the
AArch64 implementation is missing. So add it.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: John Powell <john.powell@arm.com>
Signed-off-by: Supreeth Venkatesh <supreeth.venkatesh@arm.com>
[ardb: update commit log]
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
ArmPkg/Library/ArmLib/Common/AArch64/ArmLibSupport.S

index a6fd5e34454f4018f59f18733cf8ac3d1de8c4fb..c9f3bd1e8810e10fbd2f01a27130fdd683525816 100644 (file)
@@ -1,7 +1,7 @@
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
 #------------------------------------------------------------------------------\r
 #\r
 # Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
-# Copyright (c) 2011 - 2014, ARM Limited. All rights reserved.\r
+# Copyright (c) 2011 - 2016, ARM Limited. All rights reserved.\r
 #\r
 # This program and the accompanying materials\r
 # are licensed and made available under the terms and conditions of the BSD License\r
 #\r
 # This program and the accompanying materials\r
 # are licensed and made available under the terms and conditions of the BSD License\r
@@ -39,6 +39,7 @@ GCC_ASM_EXPORT (ArmCallWFE)
 GCC_ASM_EXPORT (ArmCallSEV)\r
 GCC_ASM_EXPORT (ArmReadCpuActlr)\r
 GCC_ASM_EXPORT (ArmWriteCpuActlr)\r
 GCC_ASM_EXPORT (ArmCallSEV)\r
 GCC_ASM_EXPORT (ArmReadCpuActlr)\r
 GCC_ASM_EXPORT (ArmWriteCpuActlr)\r
+GCC_ASM_EXPORT (ArmReadSctlr)\r
 \r
 #------------------------------------------------------------------------------\r
 \r
 \r
 #------------------------------------------------------------------------------\r
 \r
@@ -205,4 +206,13 @@ ASM_PFX(ArmWriteCpuActlr):
   isb\r
   ret\r
 \r
   isb\r
   ret\r
 \r
+ASM_PFX(ArmReadSctlr):\r
+  EL1_OR_EL2_OR_EL3(x1)\r
+1:mrs   x0, sctlr_el1\r
+  ret\r
+2:mrs   x0, sctlr_el2\r
+  ret\r
+3:mrs   x0, sctlr_el3\r
+4:ret\r
+\r
 ASM_FUNCTION_REMOVE_IF_UNREFERENCED\r
 ASM_FUNCTION_REMOVE_IF_UNREFERENCED\r