From nobody Sat Nov 2 14:35:24 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Authentication-Results: mx.zoho.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org; Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1488999929981357.45237444146244; Wed, 8 Mar 2017 11:05:29 -0800 (PST) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id E391C80378; Wed, 8 Mar 2017 11:05:25 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 79F0280378 for ; Wed, 8 Mar 2017 11:05:24 -0800 (PST) Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0EC65C04BD29; Wed, 8 Mar 2017 19:05:25 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-117-47.phx2.redhat.com [10.3.117.47]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v28J5GPM014080; Wed, 8 Mar 2017 14:05:24 -0500 X-Original-To: edk2-devel@ml01.01.org From: Laszlo Ersek To: edk2-devel-01 Date: Wed, 8 Mar 2017 20:05:07 +0100 Message-Id: <20170308190511.31195-3-lersek@redhat.com> In-Reply-To: <20170308190511.31195-1-lersek@redhat.com> References: <20170308190511.31195-1-lersek@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Wed, 08 Mar 2017 19:05:25 +0000 (UTC) Subject: [edk2] [PATCH 2/6] ArmVirtPkg: introduce FDT_CLIENT_PROTOCOL.GetOsExposure() member function X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Ard Biesheuvel MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Introduce a protocol member function that allows consumers of the protocol to determine whether the FDT is exposed to the guest OS. The initial implementation simply reflects !PcdPureAcpiBoot. Cc: Ard Biesheuvel Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek --- ArmVirtPkg/Include/Protocol/FdtClient.h | 26 ++++++++++++++++++++ ArmVirtPkg/FdtClientDxe/FdtClientDxe.c | 11 +++++++++ 2 files changed, 37 insertions(+) diff --git a/ArmVirtPkg/Include/Protocol/FdtClient.h b/ArmVirtPkg/Include/P= rotocol/FdtClient.h index aad76db388be..4e189c2a3d2a 100644 --- a/ArmVirtPkg/Include/Protocol/FdtClient.h +++ b/ArmVirtPkg/Include/Protocol/FdtClient.h @@ -115,6 +115,30 @@ EFI_STATUS OUT INT32 *Node ); =20 +/* + @param[out] FdtExposedToOs Whether the firmware exposes the FDT to the = guest + OS as an EFI system configuration table. + + @retval EFI_NOT_STARTED The protocol instance is in the process of + determining whether it should expose the FDT to= the + guest OS as an EFI system configuration table. + + This status code is never returned to modules t= hat + depend on the protocol with a DEPEX, or wait fo= r it + with a TPL_CALLBACK protocol notify. Protocol + notifies registered at higher task priority lev= els + may see this return value (but such protocol + notifies should not be used in the first place,= in + general). + + @retval EFI_SUCCESS FdtExposedToOs has been set. +*/ +typedef +EFI_STATUS +(EFIAPI *FDT_CLIENT_GET_OS_EXPOSURE) ( + OUT BOOLEAN *FdtExposedToOs + ); + struct _FDT_CLIENT_PROTOCOL { FDT_CLIENT_GET_NODE_PROPERTY GetNodeProperty; FDT_CLIENT_SET_NODE_PROPERTY SetNodeProperty; @@ -128,6 +152,8 @@ struct _FDT_CLIENT_PROTOCOL { FDT_CLIENT_FIND_NEXT_MEMORY_NODE_REG FindNextMemoryNodeReg; =20 FDT_CLIENT_GET_OR_INSERT_CHOSEN_NODE GetOrInsertChosenNode; + + FDT_CLIENT_GET_OS_EXPOSURE GetOsExposure; }; =20 extern EFI_GUID gFdtClientProtocolGuid; diff --git a/ArmVirtPkg/FdtClientDxe/FdtClientDxe.c b/ArmVirtPkg/FdtClientD= xe/FdtClientDxe.c index 547a29fce62c..6082b22d35c1 100644 --- a/ArmVirtPkg/FdtClientDxe/FdtClientDxe.c +++ b/ArmVirtPkg/FdtClientDxe/FdtClientDxe.c @@ -294,6 +294,16 @@ GetOrInsertChosenNode ( return EFI_SUCCESS; } =20 +STATIC +EFI_STATUS +GetOsExposure ( + OUT BOOLEAN *FdtExposedToOs + ) +{ + *FdtExposedToOs =3D !FeaturePcdGet (PcdPureAcpiBoot); + return EFI_SUCCESS; +} + STATIC FDT_CLIENT_PROTOCOL mFdtClientProtocol =3D { GetNodeProperty, SetNodeProperty, @@ -304,6 +314,7 @@ STATIC FDT_CLIENT_PROTOCOL mFdtClientProtocol =3D { FindMemoryNodeReg, FindNextMemoryNodeReg, GetOrInsertChosenNode, + GetOsExposure }; =20 EFI_STATUS --=20 2.9.3 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel