From nobody Mon Feb 9 23:38:17 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+100750+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+100750+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1678124008; cv=none; d=zohomail.com; s=zohoarc; b=dqmxE0EHCAhJK4ZXWgjObbHTVaB6EmvONMCsiq2yw0LUU7MUOzjm4xvnzRE1Mb/s2xF99AJvof314MjlJZBhV0/DM91t/XhOSKFGgGbxsDyNW1LMxkPPqeVyZTl1/OIX/NU/D73WvQQBqU7xMm56CwIn+t3uPjDSkuz8PVoIHUE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1678124008; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=8/BAh/i9vvG9DwSX/wD/iLUC/dwEqc2DQVpn7WcQz6w=; b=DYpFIB7cjEHQCaWjKHPtgyRtSa1LWvjoKwf/sUIXahsPf6CnU3955vQoUOJYHotASia5vawpBMmxvhSDqmKPAKcAFJ/V3XYHXVe26d5EWGNqDKTdVtJQFMOwINPmPo65dxCAyzCfk8OhedKUEW4n59liv7Ia5T8EHGczp2dWchM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+100750+1787277+3901457@groups.io Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1678124008783972.6643330277027; Mon, 6 Mar 2023 09:33:28 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id FDQVYY1788612xAOtWXHnZtX; Mon, 06 Mar 2023 09:33:28 -0800 X-Received: from mail-pf1-f177.google.com (mail-pf1-f177.google.com [209.85.210.177]) by mx.groups.io with SMTP id smtpd.web10.1077.1678124007835288108 for ; Mon, 06 Mar 2023 09:33:27 -0800 X-Received: by mail-pf1-f177.google.com with SMTP id cp12so6337267pfb.5 for ; Mon, 06 Mar 2023 09:33:27 -0800 (PST) X-Gm-Message-State: Zv8NRRi5dRzOKtenocdAXFiCx1787277AA= X-Google-Smtp-Source: AK7set+HFkI72Ysok/kul+miG8KZT6f+BBeQ2g7Ick8tzbCpt1iPkkyeNuFubb4MIVDsZf/aP5ZcYw== X-Received: by 2002:a62:6416:0:b0:593:ebc7:a6d2 with SMTP id y22-20020a626416000000b00593ebc7a6d2mr11743617pfb.21.1678124006923; Mon, 06 Mar 2023 09:33:26 -0800 (PST) X-Received: from localhost.localdomain (c-174-50-177-95.hsd1.ca.comcast.net. [174.50.177.95]) by smtp.gmail.com with ESMTPSA id v6-20020aa78506000000b005dd975176c3sm6579722pfn.53.2023.03.06.09.33.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Mar 2023 09:33:26 -0800 (PST) From: "Tuan Phan" To: devel@edk2.groups.io Cc: michael.d.kinney@intel.com, gaoliming@byosoft.com.cn, zhiguang.liu@intel.com, sunilvl@ventanamicro.com, git@danielschaefer.me, andrei.warkentin@intel.com, Tuan Phan Subject: [edk2-devel] [PATCH 1/7] MdePkg/BaseLib: RISC-V: Support getting satp register value Date: Mon, 6 Mar 2023 09:33:10 -0800 Message-Id: <20230306173316.10319-2-tphan@ventanamicro.com> In-Reply-To: <20230306173316.10319-1-tphan@ventanamicro.com> References: <20230306173316.10319-1-tphan@ventanamicro.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,tphan@ventanamicro.com Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1678124008; bh=BL/ICGmb9NoAn96hHcvtDcKKVwk6rZ3YSg7naYtdNJk=; h=Cc:Date:From:Reply-To:Subject:To; b=bpwV+Eq027M6AznhzelUkowQXG+dEE8ikiMCysulwxQauNL5AqIBM4bW4TFNBF8PTZ/ mLgTcoV3RZgX1kOR8r5uvnrdSGqU4WqEOfzuGu9LxFy063OsTu4QSksWkkeGQmkadSEBq IS3vRASTGFwDuoaymvfzksmcyg7ZmAebdBM= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1678124009644100003 Content-Type: text/plain; charset="utf-8" Add an API to retrieve satp register value. Signed-off-by: Tuan Phan --- MdePkg/Include/Library/BaseLib.h | 5 +++++ MdePkg/Library/BaseLib/RiscV64/RiscVMmu.S | 8 ++++++++ 2 files changed, 13 insertions(+) diff --git a/MdePkg/Include/Library/BaseLib.h b/MdePkg/Include/Library/Base= Lib.h index 8f2df76c29a3..5d7067ee854e 100644 --- a/MdePkg/Include/Library/BaseLib.h +++ b/MdePkg/Include/Library/BaseLib.h @@ -181,6 +181,11 @@ RiscVSetSupervisorAddressTranslationRegister ( IN UINT64 ); =20 +UINT64 +RiscVGetSupervisorAddressTranslationRegister ( + VOID + ); + UINT64 RiscVReadTimer ( VOID diff --git a/MdePkg/Library/BaseLib/RiscV64/RiscVMmu.S b/MdePkg/Library/Bas= eLib/RiscV64/RiscVMmu.S index ac8f92f38aed..c9cf60c1664b 100644 --- a/MdePkg/Library/BaseLib/RiscV64/RiscVMmu.S +++ b/MdePkg/Library/BaseLib/RiscV64/RiscVMmu.S @@ -21,3 +21,11 @@ ASM_FUNC (RiscVSetSupervisorAddressTranslationRegister) csrw CSR_SATP, a0 ret + +// +// Get the value of Supervisor Address Translation and +// Protection Register. +// +ASM_FUNC (RiscVGetSupervisorAddressTranslationRegister) + csrr a0, CSR_SATP + ret --=20 2.25.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#100750): https://edk2.groups.io/g/devel/message/100750 Mute This Topic: https://groups.io/mt/97430548/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-