From: "Kubacki, Michael A" <michael.a.kubacki@intel.com>
To: devel@edk2.groups.io
Cc: Sai Chaganty <rangasai.v.chaganty@intel.com>, Ray Ni <ray.ni@intel.com>
Subject: [edk2-platforms][PATCH V1 1/3] IntelSiliconPkg/FirmwareBootMediaLib: Add library
Date: Mon, 30 Sep 2019 18:15:45 -0700 [thread overview]
Message-ID: <20191001011547.14588-2-michael.a.kubacki@intel.com> (raw)
In-Reply-To: <20191001011547.14588-1-michael.a.kubacki@intel.com>
REF:https://bugzilla.tianocore.org/show_bug.cgi?id=2229
Adds a new library that is used to make system initialization
decisions in the boot flow dependent upon firmware boot media.
Note that the firmware boot media is the storage media that
the boot firmware is stored on. It is not the OS storage media
which may be stored upon a different non-volatile storage device.
Any Intel board, platform, or silicon code that must take action
conditionally based on the firmware boot media must use this
library API.
Cc: Sai Chaganty <rangasai.v.chaganty@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Signed-off-by: Michael Kubacki <michael.a.kubacki@intel.com>
---
Silicon/Intel/IntelSiliconPkg/IntelSiliconPkg.dec | 4 +-
Silicon/Intel/IntelSiliconPkg/IntelSiliconPkg.dsc | 4 +-
Silicon/Intel/IntelSiliconPkg/Library/PeiDxeSmmBootMediaLib/DxeSmmFirmwareBootMediaLib.inf | 43 ++++++++
Silicon/Intel/IntelSiliconPkg/Library/PeiDxeSmmBootMediaLib/PeiFirmwareBootMediaLib.inf | 38 +++++++
Silicon/Intel/IntelSiliconPkg/Include/Library/FirmwareBootMediaLib.h | 106 +++++++++++++++++++
Silicon/Intel/IntelSiliconPkg/Library/PeiDxeSmmBootMediaLib/DxeSmmFirmwareBootMediaLib.c | 107 +++++++++++++++++++
Silicon/Intel/IntelSiliconPkg/Library/PeiDxeSmmBootMediaLib/FirmwareBootMediaLib.c | 109 ++++++++++++++++++++
Silicon/Intel/IntelSiliconPkg/Library/PeiDxeSmmBootMediaLib/PeiFirmwareBootMediaLib.c | 82 +++++++++++++++
8 files changed, 491 insertions(+), 2 deletions(-)
diff --git a/Silicon/Intel/IntelSiliconPkg/IntelSiliconPkg.dec b/Silicon/Intel/IntelSiliconPkg/IntelSiliconPkg.dec
index fe5bfa0dc6..8ae0223f35 100644
--- a/Silicon/Intel/IntelSiliconPkg/IntelSiliconPkg.dec
+++ b/Silicon/Intel/IntelSiliconPkg/IntelSiliconPkg.dec
@@ -3,7 +3,7 @@
#
# This package provides common open source Intel silicon modules.
#
-# Copyright (c) 2016 - 2018, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2016 - 2019, Intel Corporation. All rights reserved.<BR>
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
##
@@ -35,6 +35,8 @@
## Include/Guid/MicrocodeFmp.h
gMicrocodeFmpImageTypeIdGuid = { 0x96d4fdcd, 0x1502, 0x424d, { 0x9d, 0x4c, 0x9b, 0x12, 0xd2, 0xdc, 0xae, 0x5c } }
+ gFirmwareBootMediaHobGuid = { 0x8c7340ea, 0xde8b, 0x4e06, {0xa4, 0x78, 0xec, 0x8b, 0x62, 0xd7, 0xa, 0x8b } }
+
[Ppis]
gEdkiiVTdInfoPpiGuid = { 0x8a59fcb3, 0xf191, 0x400c, { 0x97, 0x67, 0x67, 0xaf, 0x2b, 0x25, 0x68, 0x4a } }
diff --git a/Silicon/Intel/IntelSiliconPkg/IntelSiliconPkg.dsc b/Silicon/Intel/IntelSiliconPkg/IntelSiliconPkg.dsc
index 58b5b656ef..2b4a525404 100644
--- a/Silicon/Intel/IntelSiliconPkg/IntelSiliconPkg.dsc
+++ b/Silicon/Intel/IntelSiliconPkg/IntelSiliconPkg.dsc
@@ -1,7 +1,7 @@
## @file
# This package provides common open source Intel silicon modules.
#
-# Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2017 - 2019, Intel Corporation. All rights reserved.<BR>
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
@@ -42,6 +42,7 @@
MemoryAllocationLib|MdePkg/Library/PeiMemoryAllocationLib/PeiMemoryAllocationLib.inf
HobLib|MdePkg/Library/PeiHobLib/PeiHobLib.inf
+ FirmwareBootMediaLib|IntelSiliconPkg/Library/PeiDxeSmmBootMediaLib/PeiFirmwareBootMediaLib.inf
[LibraryClasses.common.DXE_DRIVER]
UefiDriverEntryPoint|MdePkg/Library/UefiDriverEntryPoint/UefiDriverEntryPoint.inf
@@ -52,6 +53,7 @@
HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf
MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf
+ FirmwareBootMediaLib|IntelSiliconPkg/Library/PeiDxeSmmBootMediaLib/DxeSmmFirmwareBootMediaLib.inf
###################################################################################################
#
diff --git a/Silicon/Intel/IntelSiliconPkg/Library/PeiDxeSmmBootMediaLib/DxeSmmFirmwareBootMediaLib.inf b/Silicon/Intel/IntelSiliconPkg/Library/PeiDxeSmmBootMediaLib/DxeSmmFirmwareBootMediaLib.inf
new file mode 100644
index 0000000000..83ed5f04af
--- /dev/null
+++ b/Silicon/Intel/IntelSiliconPkg/Library/PeiDxeSmmBootMediaLib/DxeSmmFirmwareBootMediaLib.inf
@@ -0,0 +1,43 @@
+## @file
+# Firmware Boot Media Library
+#
+# The firmware boot media device is used to make system initialization decisions in the boot flow dependent
+# upon firmware boot media. Note that the firmware boot media is the storage media that the boot firmware is stored on.
+# It is not the OS storage media which may be stored upon a different non-volatile storage device.
+#
+# This library contains an implementation for the DXE and SMM boot phases.
+#
+# Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>
+#
+# SPDX-License-Identifier: BSD-2-Clause-Patent
+#
+##
+
+[Defines]
+ INF_VERSION = 0x00010005
+ BASE_NAME = DxeSmmFirmwareBootMediaLib
+ FILE_GUID = 72F07B0B-54F5-47FD-9EDB-D796BE2B87E9
+ MODULE_TYPE = DXE_DRIVER
+ VERSION_STRING = 1.0
+ PI_SPECIFICATION_VERSION = 0x0001000A
+ LIBRARY_CLASS = FirmwareBootMediaLib|DXE_DRIVER DXE_SMM_DRIVER DXE_RUNTIME_DRIVER UEFI_APPLICATION UEFI_DRIVER
+ CONSTRUCTOR = DxeSmmFirmwareBootMediaLibInit
+#
+# VALID_ARCHITECTURES = IA32 X64 IPF EBC
+#
+
+[Sources]
+ FirmwareBootMediaLib.c
+ DxeSmmFirmwareBootMediaLib.c
+
+[Packages]
+ MdePkg/MdePkg.dec
+ IntelSiliconPkg/IntelSiliconPkg.dec
+
+[LibraryClasses]
+ BaseLib
+ DebugLib
+ HobLib
+
+[Guids]
+ gFirmwareBootMediaHobGuid ## CONSUMES
diff --git a/Silicon/Intel/IntelSiliconPkg/Library/PeiDxeSmmBootMediaLib/PeiFirmwareBootMediaLib.inf b/Silicon/Intel/IntelSiliconPkg/Library/PeiDxeSmmBootMediaLib/PeiFirmwareBootMediaLib.inf
new file mode 100644
index 0000000000..063c4027d3
--- /dev/null
+++ b/Silicon/Intel/IntelSiliconPkg/Library/PeiDxeSmmBootMediaLib/PeiFirmwareBootMediaLib.inf
@@ -0,0 +1,38 @@
+## @file
+# Firmware Boot Media Library
+#
+# The firmware boot media device is used to make system initialization decisions in the boot flow dependent
+# upon firmware boot media. Note that the firmware boot media is the storage media that the boot firmware is stored on.
+# It is not the OS storage media which may be stored upon a different non-volatile storage device.
+#
+# This library contains an implementation for the PEI boot phase.
+#
+# Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>
+#
+# SPDX-License-Identifier: BSD-2-Clause-Patent
+#
+##
+
+[Defines]
+ INF_VERSION = 0x00010005
+ BASE_NAME = PeiFirmwareBootMediaLib
+ FILE_GUID = D3F7BD0B-3539-4F2D-AF98-EE32DBE7971F
+ MODULE_TYPE = PEIM
+ VERSION_STRING = 1.0
+ LIBRARY_CLASS = FirmwareBootMediaLib
+
+[Sources]
+ FirmwareBootMediaLib.c
+ PeiFirmwareBootMediaLib.c
+
+[Packages]
+ MdePkg/MdePkg.dec
+ IntelSiliconPkg/IntelSiliconPkg.dec
+
+[LibraryClasses]
+ BaseLib
+ DebugLib
+ HobLib
+
+[Guids]
+ gFirmwareBootMediaHobGuid ## PRODUCES CONSUMES
diff --git a/Silicon/Intel/IntelSiliconPkg/Include/Library/FirmwareBootMediaLib.h b/Silicon/Intel/IntelSiliconPkg/Include/Library/FirmwareBootMediaLib.h
new file mode 100644
index 0000000000..aca9593a84
--- /dev/null
+++ b/Silicon/Intel/IntelSiliconPkg/Include/Library/FirmwareBootMediaLib.h
@@ -0,0 +1,106 @@
+/** @file
+ This library identifies the firmware boot media device.
+
+ The firmware boot media device is used to make system initialization decisions in the boot flow dependent
+ upon firmware boot media. Note that the firmware boot media is the storage media that the boot firmware is stored on.
+ It is not the OS storage media which may be stored upon a different non-volatile storage device.
+
+Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>
+SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#ifndef _FIRMWARE_BOOT_MEDIA_LIB_H_
+#define _FIRMWARE_BOOT_MEDIA_LIB_H_
+
+#include <Uefi.h>
+
+typedef enum {
+ FwBootMediaSpi,
+ FwBootMediaUfs,
+ FwBootMediaEmmc,
+ FwBootMediaNvme,
+ FwBootMediaMax
+} FW_BOOT_MEDIA_TYPE;
+
+typedef struct {
+ FW_BOOT_MEDIA_TYPE BootMedia;
+} FW_BOOT_MEDIA_HOB_DATA;
+
+/**
+ Determines the current platform firmware boot media device.
+
+ @param[out] FwBootMediaType The current platform Boot Media type.
+
+ @retval EFI_SUCCESS The operation completed successfully.
+ @retval EFI_NOT_FOUND The boot media type could not be found.
+**/
+EFI_STATUS
+EFIAPI
+GetFirmwareBootMediaType (
+ OUT FW_BOOT_MEDIA_TYPE *FwBootMediaType
+ );
+
+/**
+ Indicates whether the boot media is presently known.
+
+ Note: Very early in boot this data may not be available.
+
+ @retval TRUE Boot media is known
+ @retval FALSE Boot media is not known
+**/
+BOOLEAN
+EFIAPI
+FirmwareBootMediaIsKnown (
+ VOID
+ );
+
+/**
+ Determines if the platform firmware is booting from SPI.
+
+ @retval TRUE Platform firmware is booting from SPI
+ @retval FALSE Platform firmware is booting from a non-SPI device or the boot media is unknown
+**/
+BOOLEAN
+EFIAPI
+FirmwareBootMediaIsSpi (
+ VOID
+ );
+
+/**
+ Determines if the platform firmware is booting from UFS.
+
+ @retval TRUE Platform firmware is booting from UFS
+ @retval FALSE Platform firmware is booting from a non-UFS device or the boot media is unknown
+**/
+BOOLEAN
+EFIAPI
+FirmwareBootMediaIsUfs (
+ VOID
+ );
+
+/**
+ Determines if the platform firmware is booting from eMMC.
+
+ @retval TRUE Platform firmware is booting from eMMC
+ @retval FALSE Platform firmware is booting from a non-eMMC device or the boot media is unknown
+**/
+BOOLEAN
+EFIAPI
+FirmwareBootMediaIsEmmc (
+ VOID
+ );
+
+/**
+ Determines if the platform firmware is booting from NVMe.
+
+ @retval TRUE Platform firmware is booting from NVMe.
+ @retval FALSE Platform firmware is booting from a non-NVMe device or the boot media is unknown
+**/
+BOOLEAN
+EFIAPI
+FirmwareBootMediaIsNvme (
+ VOID
+ );
+
+#endif
diff --git a/Silicon/Intel/IntelSiliconPkg/Library/PeiDxeSmmBootMediaLib/DxeSmmFirmwareBootMediaLib.c b/Silicon/Intel/IntelSiliconPkg/Library/PeiDxeSmmBootMediaLib/DxeSmmFirmwareBootMediaLib.c
new file mode 100644
index 0000000000..1e3876afb3
--- /dev/null
+++ b/Silicon/Intel/IntelSiliconPkg/Library/PeiDxeSmmBootMediaLib/DxeSmmFirmwareBootMediaLib.c
@@ -0,0 +1,107 @@
+/** @file
+ This library identifies the firmware boot media device.
+
+ The firmware boot media device is used to make system initialization decisions in the boot flow dependent
+ upon firmware boot media. Note that the firmware boot media is the storage media that the boot firmware is stored on.
+ It is not the OS storage media which may be stored upon a different non-volatile storage device.
+
+ This file contains implementation specific to the DXE and SMM boot phases.
+
+Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>
+SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#include <Library/BaseLib.h>
+#include <Library/DebugLib.h>
+#include <Library/FirmwareBootMediaLib.h>
+#include <Library/HobLib.h>
+
+STATIC FW_BOOT_MEDIA_TYPE mFwBootMedia = FwBootMediaMax;
+
+/**
+ Determines the current platform firmware boot media device.
+
+ @param[out] FwBootMediaType The current platform Boot Media type.
+
+ @retval EFI_SUCCESS The operation completed successfully.
+ @retval EFI_NOT_FOUND The boot media type could not be found.
+**/
+EFI_STATUS
+EFIAPI
+GetFirmwareBootMediaType (
+ OUT FW_BOOT_MEDIA_TYPE *FwBootMediaType
+ )
+{
+ if (mFwBootMedia == FwBootMediaMax) {
+ return EFI_NOT_FOUND;
+ }
+
+ *FwBootMediaType = mFwBootMedia;
+ return EFI_SUCCESS;
+}
+
+/**
+ Determines if the boot media is presently known.
+
+ Note: Very early in boot this data may not be available.
+
+ @retval TRUE Boot media is known
+ @retval FALSE Boot media is not known
+**/
+BOOLEAN
+EFIAPI
+FirmwareBootMediaIsKnown (
+ VOID
+ )
+{
+ return mFwBootMedia != FwBootMediaMax;
+}
+
+/**
+ The library constructor.
+
+ This constructor depends upon gFirmwareBootMediaHobGuid.
+ It should be produced by the platform in the HOB producer phase.
+
+ @param[in] ImageHandle The firmware allocated handle for the UEFI image.
+ @param[in] SystemTable A pointer to the EFI system table.
+
+ @retval EFI_SUCCESS The constructor executed successfully.
+ @retval EFI_NOT_FOUND The gFirmwareBootMediaHobGuid HOB could not be located
+ or the boot media type is invalid.
+**/
+EFI_STATUS
+EFIAPI
+DxeSmmFirmwareBootMediaLibInit (
+ IN EFI_HANDLE ImageHandle,
+ IN EFI_SYSTEM_TABLE *SystemTable
+ )
+{
+ FW_BOOT_MEDIA_HOB_DATA *BootMediaHobData;
+ FW_BOOT_MEDIA_TYPE BootMediaType;
+ EFI_HOB_GUID_TYPE *GuidHobPtr;
+
+ GuidHobPtr = GetFirstGuidHob (&gFirmwareBootMediaHobGuid);
+ if (GuidHobPtr == NULL) {
+ DEBUG ((DEBUG_ERROR, "The firmware boot media HOB does not exist!\n"));
+ ASSERT (GuidHobPtr != NULL);
+ return EFI_NOT_FOUND;
+ }
+
+ BootMediaHobData = (FW_BOOT_MEDIA_HOB_DATA *) GET_GUID_HOB_DATA (GuidHobPtr);
+ if (BootMediaHobData == NULL) {
+ return EFI_NOT_FOUND;
+ }
+
+ BootMediaType = BootMediaHobData->BootMedia;
+
+ if (BootMediaType >= FwBootMediaMax) {
+ DEBUG ((DEBUG_ERROR, "The firmware boot media HOB specifies an invalid media type.\n"));
+ return EFI_NOT_FOUND;
+ }
+
+ mFwBootMedia = BootMediaType;
+
+ return EFI_SUCCESS;
+}
diff --git a/Silicon/Intel/IntelSiliconPkg/Library/PeiDxeSmmBootMediaLib/FirmwareBootMediaLib.c b/Silicon/Intel/IntelSiliconPkg/Library/PeiDxeSmmBootMediaLib/FirmwareBootMediaLib.c
new file mode 100644
index 0000000000..11a14d172d
--- /dev/null
+++ b/Silicon/Intel/IntelSiliconPkg/Library/PeiDxeSmmBootMediaLib/FirmwareBootMediaLib.c
@@ -0,0 +1,109 @@
+/** @file
+ This library identifies the firmware boot media device.
+
+ The firmware boot media device is used to make system initialization decisions in the boot flow dependent
+ upon firmware boot media. Note that the firmware boot media is the storage media that the boot firmware is stored on.
+ It is not the OS storage media which may be stored upon a different non-volatile storage device.
+
+ This file contains library implementation common to all boot phases.
+
+Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>
+SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#include <Library/BaseLib.h>
+#include <Library/DebugLib.h>
+#include <Library/FirmwareBootMediaLib.h>
+
+/**
+ Determines if the platform firmware is booting from SPI.
+
+ @retval TRUE Platform firmware is booting from SPI
+ @retval FALSE Platform firmware is booting from a non-SPI device or the boot media is unknown
+**/
+BOOLEAN
+EFIAPI
+FirmwareBootMediaIsSpi (
+ VOID
+ )
+{
+ EFI_STATUS Status;
+ FW_BOOT_MEDIA_TYPE BootMedia;
+
+ Status = GetFirmwareBootMediaType (&BootMedia);
+ if (EFI_ERROR (Status) || BootMedia != FwBootMediaSpi) {
+ return FALSE;
+ } else {
+ return TRUE;
+ }
+}
+
+/**
+ Determines if the platform firmware is booting from UFS.
+
+ @retval TRUE Platform firmware is booting from UFS
+ @retval FALSE Platform firmware is booting from a non-UFS device or the boot media is unknown
+**/
+BOOLEAN
+EFIAPI
+FirmwareBootMediaIsUfs (
+ VOID
+ )
+{
+ EFI_STATUS Status;
+ FW_BOOT_MEDIA_TYPE BootMedia;
+
+ Status = GetFirmwareBootMediaType (&BootMedia);
+ if (EFI_ERROR (Status) || BootMedia != FwBootMediaUfs) {
+ return FALSE;
+ } else {
+ return TRUE;
+ }
+}
+
+/**
+ Determines if the platform firmware is booting from eMMC.
+
+ @retval TRUE Platform firmware is booting from eMMC
+ @retval FALSE Platform firmware is booting from a non-eMMC device or the boot media is unknown
+**/
+BOOLEAN
+EFIAPI
+FirmwareBootMediaIsEmmc (
+ VOID
+ )
+{
+ EFI_STATUS Status;
+ FW_BOOT_MEDIA_TYPE BootMedia;
+
+ Status = GetFirmwareBootMediaType (&BootMedia);
+ if (EFI_ERROR (Status) || BootMedia != FwBootMediaEmmc) {
+ return FALSE;
+ } else {
+ return TRUE;
+ }
+}
+
+/**
+ Determines if the platform firmware is booting from NVMe.
+
+ @retval TRUE Platform firmware is booting from NVMe.
+ @retval FALSE Platform firmware is booting from a non-NVMe device or the boot media is unknown
+**/
+BOOLEAN
+EFIAPI
+FirmwareBootMediaIsNvme (
+ VOID
+ )
+{
+ EFI_STATUS Status;
+ FW_BOOT_MEDIA_TYPE BootMedia;
+
+ Status = GetFirmwareBootMediaType (&BootMedia);
+ if (EFI_ERROR (Status) || BootMedia != FwBootMediaNvme) {
+ return FALSE;
+ } else {
+ return TRUE;
+ }
+}
diff --git a/Silicon/Intel/IntelSiliconPkg/Library/PeiDxeSmmBootMediaLib/PeiFirmwareBootMediaLib.c b/Silicon/Intel/IntelSiliconPkg/Library/PeiDxeSmmBootMediaLib/PeiFirmwareBootMediaLib.c
new file mode 100644
index 0000000000..14478e0dbe
--- /dev/null
+++ b/Silicon/Intel/IntelSiliconPkg/Library/PeiDxeSmmBootMediaLib/PeiFirmwareBootMediaLib.c
@@ -0,0 +1,82 @@
+/** @file
+ This library identifies the firmware boot media device.
+
+ The firmware boot media device is used to make system initialization decisions in the boot flow dependent
+ upon firmware boot media. Note that the firmware boot media is the storage media that the boot firmware is stored on.
+ It is not the OS storage media which may be stored upon a different non-volatile storage device.
+
+ This file contains implementation specific to the PEI boot phase.
+
+Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>
+SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#include <Library/BaseLib.h>
+#include <Library/DebugLib.h>
+#include <Library/FirmwareBootMediaLib.h>
+#include <Library/HobLib.h>
+
+/**
+ Determines the current platform firmware boot media device.
+
+ @param[out] FwBootMediaType The current platform Boot Media type.
+
+ @retval EFI_SUCCESS The operation completed successfully.
+ @retval EFI_NOT_FOUND The boot media type could not be found.
+**/
+EFI_STATUS
+EFIAPI
+GetFirmwareBootMediaType (
+ OUT FW_BOOT_MEDIA_TYPE *FwBootMediaType
+ )
+{
+ FW_BOOT_MEDIA_HOB_DATA *BootMediaHobData;
+ EFI_HOB_GUID_TYPE *GuidHobPtr;
+
+ GuidHobPtr = GetFirstGuidHob (&gFirmwareBootMediaHobGuid);
+ if (GuidHobPtr == NULL) {
+ DEBUG ((DEBUG_ERROR, "The firmware boot media HOB does not exist!\n"));
+ ASSERT (GuidHobPtr != NULL);
+ return EFI_NOT_FOUND;
+ }
+
+ BootMediaHobData = (FW_BOOT_MEDIA_HOB_DATA *) GET_GUID_HOB_DATA (GuidHobPtr);
+ if (BootMediaHobData == NULL) {
+ return EFI_NOT_FOUND;
+ }
+
+ if (BootMediaHobData->BootMedia >= FwBootMediaMax) {
+ DEBUG ((DEBUG_ERROR, "The firmware boot media HOB specifies an invalid media type.\n"));
+ return EFI_NOT_FOUND;
+ }
+ *FwBootMediaType = BootMediaHobData->BootMedia;
+
+ return EFI_SUCCESS;
+}
+
+/**
+ Determines if the boot media is presently known.
+
+ Note: Very early in boot this data may not be available.
+
+ @retval TRUE Boot media is known
+ @retval FALSE Boot media is not known
+**/
+BOOLEAN
+EFIAPI
+FirmwareBootMediaIsKnown (
+ VOID
+ )
+{
+ EFI_STATUS Status;
+ FW_BOOT_MEDIA_TYPE BootMedia;
+
+ BootMedia = FwBootMediaMax;
+ Status = GetFirmwareBootMediaType (&BootMedia);
+ if (EFI_ERROR (Status) || BootMedia == FwBootMediaMax) {
+ return FALSE;
+ } else {
+ return TRUE;
+ }
+}
--
2.16.2.windows.1
next prev parent reply other threads:[~2019-10-01 1:15 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-01 1:15 [edk2-platforms][PATCH V1 0/3] Add FW Boot Media Device Indicator Kubacki, Michael A
2019-10-01 1:15 ` Kubacki, Michael A [this message]
2019-10-01 1:15 ` [edk2-platforms][PATCH V1 2/3] BoardModulePkg/FirmwareBootMediaInfoLib: Add library Kubacki, Michael A
2019-10-08 7:01 ` Dong, Eric
2019-10-01 1:15 ` [edk2-platforms][PATCH V1 3/3] BoardModulePkg/FirmwareBootMediaInfoPei: Add module Kubacki, Michael A
2019-10-02 23:03 ` [edk2-platforms][PATCH V1 0/3] Add FW Boot Media Device Indicator Chaganty, Rangasai V
2019-10-03 1:02 ` Kubacki, Michael A
2019-10-03 4:20 ` [edk2-devel] " Andrew Fish
2019-10-03 7:54 ` Kubacki, Michael A
2019-10-07 1:34 ` Chaganty, Rangasai V
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=20191001011547.14588-2-michael.a.kubacki@intel.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