From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2a00:1450:400c:c09::242; helo=mail-wm0-x242.google.com; envelope-from=sigmaepsilon92@gmail.com; receiver=edk2-devel@lists.01.org Received: from mail-wm0-x242.google.com (mail-wm0-x242.google.com [IPv6:2a00:1450:400c:c09::242]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 0E5592220D204 for ; Tue, 9 Jan 2018 22:33:15 -0800 (PST) Received: by mail-wm0-x242.google.com with SMTP id a79so24771599wma.0 for ; Tue, 09 Jan 2018 22:38:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=mTrrCpXTlnS/iCYsBM69vkZymRnye+0NnA0A5jttI1I=; b=oyCLE4CLVP3vfgbvJTonx26XOHORzJsua8VYgy0Z2VlUpdoCi0a7eo1XpQFgtahVjD DNMf00mOMBX78IR3c/lTUw0HGqhOJZd32bWMurkHu4vffVmNxAv1+hvYJ9+qpgWxeXDN dxzqabRnvdTQ8WO+DWgzXFhER23PrYSCEkULfraSnQ46jhza/3Yy5dp4vIYVRHHLp2J9 UPct+GUSrQzN8/kL6D24fL4SOMWlRuOaj3ACRWNosZ73ZCq+J4ppiwe6qNtlgd0FLqaY VgThMjZIMswd6PO1HudIhh5grde/8yzRu0jKnj1SteFZ0hMcYabo1YDAVNcPbflsjYeO d7xA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=mTrrCpXTlnS/iCYsBM69vkZymRnye+0NnA0A5jttI1I=; b=FNB5H4SWbzNUqKnFuS4knehKSAhcSqpABOZMV4/s4jiwA7BoeJTw+1TDZsv4akw4m5 5u4opji+Vqnp5JQ7XG8E5Cdf5bnalUyEMTi/3dv/MB89RU8XHrQJ7s3yrV2Pnr0x0wM9 mbkqcL7rJUWiYHUUc0h0hlV893bPk2GFP1tudCn8hgzjDdb4LWwlJFfVbwAv0Q6v2lBi 4Tq2QCVUEHe1iEjKYQL1fkEWfaFGeOzgsHX7db8hEEbcLfcZzRPDsgEJx94DC3ou487W ug1PSAE7pX6OZjBzCw1ii8Asz9441V745sa4kcEywpcPuzOKaezCdhmqxQZQIOVGXEYy dv1A== X-Gm-Message-State: AKGB3mLbGmrb+pNALyvk7/RdMVTibG4Mb6szGkpcNA4gZVZ7wsqpUy+j X3gOjuCrQRgAPPBh7AWCXu6kUIGt X-Google-Smtp-Source: ACJfBotcTCmSQXFmAVF1Ie7EGE37IlNxyPBxYj7zoWrC3M9Twdzbn9EL7YAkcJFMsbkRo0m6vIdo+w== X-Received: by 10.28.19.210 with SMTP id 201mr14536370wmt.79.1515566305485; Tue, 09 Jan 2018 22:38:25 -0800 (PST) Received: from localhost.localdomain ([2a02:908:5a9:8400:5ec8:3210:9b68:c91c]) by smtp.gmail.com with ESMTPSA id r9sm15673299wrg.74.2018.01.09.22.38.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 09 Jan 2018 22:38:24 -0800 (PST) From: Michael Zimmermann To: edk2-devel@lists.01.org Cc: Leif Lindholm , Ard Biesheuvel Date: Wed, 10 Jan 2018 07:38:23 +0100 Message-Id: <20180110063823.19911-1-sigmaepsilon92@gmail.com> X-Mailer: git-send-email 2.15.1 Subject: [PATCH] ArmPkg/Library/ArmLib: add ArmWriteSctlr X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Jan 2018 06:33:16 -0000 This currently isn't needed by anything in the edk2 tree but it's useful for externally maintained platforms which have to set this register e.g. to disable alignment aborts. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Michael Zimmermann --- ArmPkg/Include/Library/ArmLib.h | 6 ++++++ ArmPkg/Library/ArmLib/Arm/ArmLibSupport.S | 4 ++++ ArmPkg/Library/ArmLib/Arm/ArmLibSupport.asm | 3 +++ 3 files changed, 13 insertions(+) diff --git a/ArmPkg/Include/Library/ArmLib.h b/ArmPkg/Include/Library/ArmLib.h index 24e84c7a1965..ffda50e9d767 100644 --- a/ArmPkg/Include/Library/ArmLib.h +++ b/ArmPkg/Include/Library/ArmLib.h @@ -558,6 +558,12 @@ ArmReadSctlr ( VOID ); +VOID +EFIAPI +ArmWriteSctlr ( + IN UINT32 Value + ); + UINTN EFIAPI ArmReadHVBar ( diff --git a/ArmPkg/Library/ArmLib/Arm/ArmLibSupport.S b/ArmPkg/Library/ArmLib/Arm/ArmLibSupport.S index a0b5ed500298..149b57e059ee 100644 --- a/ArmPkg/Library/ArmLib/Arm/ArmLibSupport.S +++ b/ArmPkg/Library/ArmLib/Arm/ArmLibSupport.S @@ -153,6 +153,10 @@ ASM_FUNC(ArmReadSctlr) mrc p15, 0, r0, c1, c0, 0 @ Read SCTLR into R0 (Read control register configuration data) bx lr +ASM_FUNC(ArmWriteSctlr) + mcr p15, 0, r0, c1, c0, 0 + bx lr + ASM_FUNC(ArmReadCpuActlr) mrc p15, 0, r0, c1, c0, 1 bx lr diff --git a/ArmPkg/Library/ArmLib/Arm/ArmLibSupport.asm b/ArmPkg/Library/ArmLib/Arm/ArmLibSupport.asm index 85b0feee20d4..219140c22b13 100644 --- a/ArmPkg/Library/ArmLib/Arm/ArmLibSupport.asm +++ b/ArmPkg/Library/ArmLib/Arm/ArmLibSupport.asm @@ -155,6 +155,9 @@ mrc p15, 0, r0, c1, c0, 0 // Read SCTLR into R0 (Read control register configuration data) bx lr + RVCT_ASM_EXPORT ArmWriteSctlr + mcr p15, 0, r0, c1, c0, 0 + bx lr RVCT_ASM_EXPORT ArmReadCpuActlr mrc p15, 0, r0, c1, c0, 1 -- 2.15.1