]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ArmPkg/Library/ArmLib/Common/AArch64/ArmLibSupport.S
ArmPkg/Library: Add ArmReadSctlr for AArch64
[mirror_edk2.git] / 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
-# 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
@@ -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 (ArmReadSctlr)\r
 \r
 #------------------------------------------------------------------------------\r
 \r
@@ -205,4 +206,13 @@ ASM_PFX(ArmWriteCpuActlr):
   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