From nobody Wed Feb 11 06:14:11 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+94637+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+94637+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=arm.com ARC-Seal: i=1; a=rsa-sha256; t=1664782520; cv=none; d=zohomail.com; s=zohoarc; b=V8CR7YGacZuXg6d0EDUpSSJVQOuousCimKnIGh6ha+GRzjJnKD9xTkYSeiLmJe9pPNFoIH6Pom9Er9tXRiUnd1+nml/7iPezb2Kg5qxrVT31zjM9505MMF5AfWvSwvzyirf67sVEo+LJ1ufIP0TDlB0tsBMmMuqCw6k4InsBUTc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1664782520; 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=7BXx0JbHAGJJQ1Ojw/QhI2FVxeQyDUExBrQf9VgeoKk=; b=V9gccfzm3DNiEdmE1fErnMOE/f3oWC6mz4RBa2LQ2jwhb3/46AHj+U3v4rnbXV28uJ5o7oLxzh+DtTOlJdehMgHgPqNtr3QUkvF//BeViTONuKFK+Xaa3SzAn0W1AqStiGYwJHhrVLENQLjwrCpVl61KkbCD1LhaCKRVYgq5mrk= 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+94637+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 1664782520713330.5485195231711; Mon, 3 Oct 2022 00:35:20 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id U6tXYY1788612xzqYbFg7wHa; Mon, 03 Oct 2022 00:35:20 -0700 X-Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web11.16214.1664782519091432482 for ; Mon, 03 Oct 2022 00:35:19 -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 5C6AE1E8D; Mon, 3 Oct 2022 00:35:25 -0700 (PDT) X-Received: from pierre123.home (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 750D03F73B; Mon, 3 Oct 2022 00:35:16 -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 v7 02/19] ArmPkg/ArmMonitorLib: Definition for ArmMonitorLib library class Date: Mon, 3 Oct 2022 09:34:46 +0200 Message-Id: <20221003073503.2937059-3-Pierre.Gondois@arm.com> In-Reply-To: <20221003073503.2937059-1-Pierre.Gondois@arm.com> References: <20221003073503.2937059-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: paPoXshz6YKb9DjI4Quwfr7Ex1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1664782520; bh=uHiEoHWKxRV/Op/q7Z0xk6RpKN5uXfmv08bwlrMUs9c=; h=Cc:Date:From:Reply-To:Subject:To; b=fEaODjXF3KFamsHCvdmEpuGYn3/TJUT2Az6CBR/SuV9gYW1YiIno0ue9j7lrT3s5l4i Zn58xTQ2/90AikfB6dvokbgmcFEroWSWxXmUwa4vezM8ylL2u4gH60pobsmwsptFUnD8j Dri3LAKrDszbmvbIUsO78JhAjIDjufPjAfc= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1664782521466100005 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..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 (#94637): https://edk2.groups.io/g/devel/message/94637 Mute This Topic: https://groups.io/mt/94085846/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-