From nobody Tue Feb 10 04:16:36 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+95687+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+95687+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=arm.com ARC-Seal: i=1; a=rsa-sha256; t=1666971207; cv=none; d=zohomail.com; s=zohoarc; b=EpT/l1PEyxJHF2CIGeqeJCrQ3/Xh3Wqt7wh95DMn67+S+FiFGs793mxDJd0DHqygJZ/1djekTaVFBKbN65vvoK11tO/46yBshGl5A2O04ERPz3bDmwiDXryJpxT9oQHZw9wgzdfZRLEHfEtolB4dcXGRle0vIny3oW6D9LHLmDY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1666971207; 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=4QpdD7MRvdiM6TLvQ0XpOna95bdFQKVw1d1CbThNPo4=; b=WECfGs60qOVRtMOvpWYwa3ZGAe9317HudmW8xnWRfnJM/r6BJjdVEQG2V1Dm2/sViYMBcr2fV3jTO60MTBOPXWIanPPgnirLqP0gTqdgBZUW2hfEIonngsCtiaDmCgylq+4/KtF5iVVC4tPflX2/nBzrwYw/RWfJROQivql32Ik= 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+95687+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 1666971207933897.5160582095466; Fri, 28 Oct 2022 08:33:27 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id mfq4YY1788612xWGWjtKTnNC; Fri, 28 Oct 2022 08:33:27 -0700 X-Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web09.896.1666971206916640105 for ; Fri, 28 Oct 2022 08:33:27 -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 DA4B7D6E; Fri, 28 Oct 2022 08:33:32 -0700 (PDT) X-Received: from pierre123.arm.com (unknown [10.57.3.128]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 464B63F534; Fri, 28 Oct 2022 08:33:24 -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 v9 02/19] ArmPkg/ArmMonitorLib: Definition for ArmMonitorLib library class Date: Fri, 28 Oct 2022 17:32:42 +0200 Message-Id: <20221028153259.397445-3-Pierre.Gondois@arm.com> In-Reply-To: <20221028153259.397445-1-Pierre.Gondois@arm.com> References: <20221028153259.397445-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: 7AEE187WardGEYtYVUlp4N04x1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1666971207; bh=GfZpoAylqW1ZSy813n50ukFQVxoMAdqBEUjApy655X4=; h=Cc:Date:From:Reply-To:Subject:To; b=ngG34a090QCW4C7fLeokcnH0aiF4pWzLynoAWxKuz5XcA9Zyvwe77dYYWCFXYJj5ju5 9VezQRCaQgpQGqVINhNBXdNV1rMv4E0qlxUA9yKVzwaNemglSx6ruFWivD8HXxkjX0fqU skjh/sAndfeMxZNn8QXWCIk3EK7jhDqSgQw= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1666971208782100010 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. Reviewed-by: Leif Lindholm 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 99cb024d0f93..f17ba913e6de 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..d6e13b61d63d --- /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 (#95687): https://edk2.groups.io/g/devel/message/95687 Mute This Topic: https://groups.io/mt/94629236/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-