From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 From: Laszlo Ersek To: edk2-devel-01 Cc: Ard Biesheuvel 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: [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: , X-List-Received-Date: Wed, 08 Mar 2017 19:05:24 -0000 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/Protocol/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 ); +/* + @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 that + depend on the protocol with a DEPEX, or wait for it + with a TPL_CALLBACK protocol notify. Protocol + notifies registered at higher task priority levels + 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; FDT_CLIENT_GET_OR_INSERT_CHOSEN_NODE GetOrInsertChosenNode; + + FDT_CLIENT_GET_OS_EXPOSURE GetOsExposure; }; extern EFI_GUID gFdtClientProtocolGuid; diff --git a/ArmVirtPkg/FdtClientDxe/FdtClientDxe.c b/ArmVirtPkg/FdtClientDxe/FdtClientDxe.c index 547a29fce62c..6082b22d35c1 100644 --- a/ArmVirtPkg/FdtClientDxe/FdtClientDxe.c +++ b/ArmVirtPkg/FdtClientDxe/FdtClientDxe.c @@ -294,6 +294,16 @@ GetOrInsertChosenNode ( return EFI_SUCCESS; } +STATIC +EFI_STATUS +GetOsExposure ( + OUT BOOLEAN *FdtExposedToOs + ) +{ + *FdtExposedToOs = !FeaturePcdGet (PcdPureAcpiBoot); + return EFI_SUCCESS; +} + STATIC FDT_CLIENT_PROTOCOL mFdtClientProtocol = { GetNodeProperty, SetNodeProperty, @@ -304,6 +314,7 @@ STATIC FDT_CLIENT_PROTOCOL mFdtClientProtocol = { FindMemoryNodeReg, FindNextMemoryNodeReg, GetOrInsertChosenNode, + GetOsExposure }; EFI_STATUS -- 2.9.3