From: Laszlo Ersek <lersek@redhat.com>
To: edk2-devel-01 <edk2-devel@ml01.01.org>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Subject: [PATCH 2/6] ArmVirtPkg: introduce FDT_CLIENT_PROTOCOL.GetOsExposure() member function
Date: Wed, 8 Mar 2017 20:05:07 +0100 [thread overview]
Message-ID: <20170308190511.31195-3-lersek@redhat.com> (raw)
In-Reply-To: <20170308190511.31195-1-lersek@redhat.com>
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 <ard.biesheuvel@linaro.org>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
---
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
next prev parent reply other threads:[~2017-03-08 19:05 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-08 19:05 [PATCH 0/6] ArmVirtPkg: don't forward the DT to the OS if QEMU provides ACPI Laszlo Ersek
2017-03-08 19:05 ` [PATCH 1/6] ArmVirtPkg/FdtClientDxe: supplement missing EFIAPI calling conv specifiers Laszlo Ersek
2017-03-08 19:05 ` Laszlo Ersek [this message]
2017-03-08 19:05 ` [PATCH 3/6] ArmVirtPkg/ArmVirtPL031FdtClientLib: get rid of PcdPureAcpiBoot dependency Laszlo Ersek
2017-03-08 19:05 ` [PATCH 4/6] ArmVirtPkg/QemuFwCfgLib: add explicitly initialized instance Laszlo Ersek
2017-03-08 19:11 ` Laszlo Ersek
2017-03-08 19:05 ` [PATCH 5/6] ArmVirtPkg/FdtClientDxe: don't forward DT to OS if QEMU provides ACPI Laszlo Ersek
2017-03-08 19:05 ` [PATCH 6/6] ArmVirtPkg: remove PURE_ACPI_BOOT_ENABLE and PcdPureAcpiBoot Laszlo Ersek
2017-03-09 8:16 ` [PATCH 0/6] ArmVirtPkg: don't forward the DT to the OS if QEMU provides ACPI Ard Biesheuvel
2017-03-09 11:01 ` Laszlo Ersek
2017-03-09 12:26 ` Ard Biesheuvel
2017-03-09 15:30 ` Laszlo Ersek
2017-03-09 17:00 ` Leif Lindholm
2017-03-09 17:19 ` Laszlo Ersek
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170308190511.31195-3-lersek@redhat.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox