From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from foss.arm.com (foss.arm.com [217.140.101.70]) by ml01.01.org (Postfix) with ESMTP id 6A42F1A1E2C for ; Fri, 29 Jul 2016 16:12:00 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 91805447; Fri, 29 Jul 2016 16:13:18 -0700 (PDT) Received: from u201365.usa.Arm.com (u201365.usa.arm.com [10.118.28.78]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 0715B3F215; Fri, 29 Jul 2016 16:11:59 -0700 (PDT) From: Supreeth Venkatesh To: edk2-devel@lists.01.org Cc: leif.lindholm@linaro.org, john.powell@arm.com, ard.biesheuvel@linaro.org, Supreeth Venkatesh Date: Fri, 29 Jul 2016 18:11:52 -0500 Message-Id: <1469833912-25743-1-git-send-email-supreeth.venkatesh@arm.com> X-Mailer: git-send-email 2.8.0 Subject: [PATCH] ArmPkg/Library: Add ArmReadSctlr for aarch64 X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jul 2016 23:12:00 -0000 One of the UEFI Self Certification tests (UEFI-SCT) need to read the current exception level SCTLR Register. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: John Powell Signed-off-by: Supreeth Venkatesh --- ArmPkg/Library/ArmLib/Common/AArch64/ArmLibSupport.S | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/ArmPkg/Library/ArmLib/Common/AArch64/ArmLibSupport.S b/ArmPkg/Library/ArmLib/Common/AArch64/ArmLibSupport.S index a6fd5e3..c9f3bd1 100644 --- a/ArmPkg/Library/ArmLib/Common/AArch64/ArmLibSupport.S +++ b/ArmPkg/Library/ArmLib/Common/AArch64/ArmLibSupport.S @@ -1,7 +1,7 @@ #------------------------------------------------------------------------------ # # Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
-# Copyright (c) 2011 - 2014, ARM Limited. All rights reserved. +# Copyright (c) 2011 - 2016, 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 @@ -39,6 +39,7 @@ GCC_ASM_EXPORT (ArmCallWFE) GCC_ASM_EXPORT (ArmCallSEV) GCC_ASM_EXPORT (ArmReadCpuActlr) GCC_ASM_EXPORT (ArmWriteCpuActlr) +GCC_ASM_EXPORT (ArmReadSctlr) #------------------------------------------------------------------------------ @@ -205,4 +206,13 @@ ASM_PFX(ArmWriteCpuActlr): isb ret +ASM_PFX(ArmReadSctlr): + EL1_OR_EL2_OR_EL3(x1) +1:mrs x0, sctlr_el1 + ret +2:mrs x0, sctlr_el2 + ret +3:mrs x0, sctlr_el3 +4:ret + ASM_FUNCTION_REMOVE_IF_UNREFERENCED -- 2.8.0