From nobody Tue Feb 10 01:35:30 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+93945+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+93945+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=arm.com ARC-Seal: i=1; a=rsa-sha256; t=1663615347; cv=none; d=zohomail.com; s=zohoarc; b=EIp3jhV9NfX9WO9phEENldSrypJw0gFjJr1T6kjBdvYgFFWnfqQ+gD+CJuhqiCTqR7/1SWLYaHznOG2aHMWFSzm4/+VjeIQ0mIRxGJowAObJl9m59ALt3jKVYCaytXgkHFOirZQPtIK9JZjVEyx4tBseJEfEHU/lEhIVIS8B0UM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1663615347; 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=Bl5iqdY+t0SyJRYp5/GyyS5BCkLuEj0+nrAMYZrijuc=; b=blNEPKVlYo42pXz7anlwUgD1UIDH6dlxOsaZENNkjP0dI+XkVICy280mkRtdfpq8e1zHHEqtGfH6KPaq4EaKaEb2HN61UPPqIpBDYqOWzy8OGgrHOLAeG6kGWB78EIWdqWPqyyllAiFdCFB/DCr9yeOjUU41XmA7/oRUWKgSyN8= 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+93945+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1663615347984109.39729011814347; Mon, 19 Sep 2022 12:22:27 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id EDmFYY1788612xPbT45a3UEn; Mon, 19 Sep 2022 12:22:26 -0700 X-Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web11.3342.1663615346066418150 for ; Mon, 19 Sep 2022 12:22:26 -0700 X-Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 4B9A21BF3; Mon, 19 Sep 2022 12:22:32 -0700 (PDT) X-Received: from pierre123.arm.com (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 9F08A3F73B; Mon, 19 Sep 2022 12:22:23 -0700 (PDT) From: "PierreGondois" To: devel@edk2.groups.io Cc: Sami Mujawar , Leif Lindholm , Ard Biesheuvel , Rebecca Cran , Michael D Kinney , Liming Gao , Jiewen Yao , Jian J Wang Subject: [edk2-devel] [PATCH v5 02/21] ArmPkg/ArmMonitorLib: Definition for ArmMonitorLib library class Date: Mon, 19 Sep 2022 21:21:48 +0200 Message-Id: <20220919192207.637786-3-Pierre.Gondois@arm.com> In-Reply-To: <20220919192207.637786-1-Pierre.Gondois@arm.com> References: <20220919192207.637786-1-Pierre.Gondois@arm.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,pierre.gondois@arm.com X-Gm-Message-State: HM8XezULAwlSJC2jctZedhTJx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1663615346; bh=NkI4+5FqnLMAWLBFCNFNoztPT0CGPAkhD709+i3HsuA=; h=Cc:Date:From:Reply-To:Subject:To; b=C3FGs+EfQwAUIon7C0kKAVgK1khBGuNC4t3wSJXkcoeRTUGFaB6RtnhjDTlc4E1bqjI JymCSWkdD3Hy1BaU4QtQy4SkMzExhK5oQ99cT+54g6qu3dtVAUW5OynYWulZsqV7RVAlC epU51rAp6sopIEP7vva6649gpgSvqtK4zfk= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1663615348823100010 Content-Type: text/plain; charset="utf-8" From: Pierre Gondois The ArmMonitorLib provides an abstract interface to issue an HyperVisor Call (HVC) or System Monitor Call (SMC) depending on the default conduit. The PcdMonitorConduitHvc PCD allows to select the default conduit. The new library relies on the ArmHvcLib and ArmSmcLib libraries. A Null instance of these libraries can be used for the unused conduit. Signed-off-by: Pierre Gondois --- ArmPkg/ArmPkg.dec | 5 +++ ArmPkg/Include/Library/ArmMonitorLib.h | 42 ++++++++++++++++++++++++++ 2 files changed, 47 insertions(+) create mode 100644 ArmPkg/Include/Library/ArmMonitorLib.h diff --git a/ArmPkg/ArmPkg.dec b/ArmPkg/ArmPkg.dec index bb5cbecbc228..653942ff63c3 100644 --- a/ArmPkg/ArmPkg.dec +++ b/ArmPkg/ArmPkg.dec @@ -71,6 +71,11 @@ [LibraryClasses.common] # ArmSvcLib|Include/Library/ArmSvcLib.h =20 + ## @libraryclass Provides a Monitor Call interface that will use the + # default conduit (HVC or SMC). + # + ArmMonitorLib|Include/Library/ArmMonitorLib.h + ## @libraryclass Provides a default exception handler. # DefaultExceptionHandlerLib|Include/Library/DefaultExceptionHandlerLib.h diff --git a/ArmPkg/Include/Library/ArmMonitorLib.h b/ArmPkg/Include/Librar= y/ArmMonitorLib.h new file mode 100644 index 000000000000..8bc430f92036 --- /dev/null +++ b/ArmPkg/Include/Library/ArmMonitorLib.h @@ -0,0 +1,42 @@ +/** @file + + Copyright (c) 2022, Arm Limited. All rights reserved.
+ + SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#ifndef ARM_MONITOR_LIB_H_ +#define ARM_MONITOR_LIB_H_ + +/** The size of the SMC arguments is different between AArch64 and AArch32. + + The native size is used for the arguments. + It will be casted to either HVC or SMC args. +*/ +typedef struct { + UINTN Arg0; + UINTN Arg1; + UINTN Arg2; + UINTN Arg3; + UINTN Arg4; + UINTN Arg5; + UINTN Arg6; + UINTN Arg7; +} ARM_MONITOR_ARGS; + +/** Monitor call. + + An HyperVisor Call (HVC) or System Monitor Call (SMC) will be issued + depending on the default conduit. PcdMonitorConduitHvc determines the ty= pe + of the call: if true, do an HVC. + + @param [in, out] Args Arguments for the HVC/SMC. +**/ +VOID +EFIAPI +ArmMonitorCall ( + IN OUT ARM_MONITOR_ARGS *Args + ); + +#endif // ARM_MONITOR_LIB_H_ --=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 (#93945): https://edk2.groups.io/g/devel/message/93945 Mute This Topic: https://groups.io/mt/93788864/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-