From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mx.groups.io with SMTP id smtpd.web11.73.1571158536006785050 for ; Tue, 15 Oct 2019 09:55:36 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=f96iC0x3; spf=pass (domain: intel.com, ip: 192.55.52.88, mailfrom: michael.a.kubacki@intel.com) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 15 Oct 2019 09:55:35 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.67,300,1566889200"; d="scan'208";a="395595929" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by fmsmga005.fm.intel.com with ESMTP; 15 Oct 2019 09:55:35 -0700 Received: from FMSMSX110.amr.corp.intel.com (10.18.116.10) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 15 Oct 2019 09:55:35 -0700 Received: from FMSEDG001.ED.cps.intel.com (10.1.192.133) by fmsmsx110.amr.corp.intel.com (10.18.116.10) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 15 Oct 2019 09:55:35 -0700 Received: from NAM04-SN1-obe.outbound.protection.outlook.com (104.47.44.55) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 15 Oct 2019 09:55:35 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Ja1vpdd1qOuiAcgTFlHRvs4sZL/7FxaHaHs6YfNx46iE/9c0zb7vZiIGZuudG6LUdIoKaC0wwlAC9KXRpzrjpnRa4P8vsXBgbbsFf0IRAq8xVhjvnbjJS0hwDMLa1tj9Cr20643r+ffpPf3aazsWXCysutFKsiUeuyF9WLGdlutdfPuHmqWqmW49qdj5Bz58rmhe3hzJpmzdb9bdJ593VywwzG/0wVFH2TG7HkF7708zxofni8OQF0508DizZJuXldKGHbd/uJ00yoa9Tjemzojgg2HIggXef/LCiyoCDHnOGtvmOPg075d9d1xVWMEYCUuI96lYojWL/X/Ib8VLmA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ODE+JsK2ZloHod1yf0HA0apfscZApS+2ObLpwtD0V0w=; b=XxkxnS3FsTn1WWi/ZDGop/zms3LakVP+y9tXiO9atPQZBWbFv6Z5S7PDkAsVovLOpa65i/pGdHKUWY3GFJjYAP7Q/txF63XczbNT/Fauyqy6/1UoH8j+ZnBf8ELGBEK6EfELkFAtpghXqr0Bf9TxeNKF7Or/Vh2V0EAcdGpgPzoqciOFXcg3g26ScLJ6UH4VREnvAh5804LCALYttD8vwL9NsX4htyobQOQiEYgmb4gHjsLgOPqRH48iVjtXAqYBKizKdvUGrogbFs+cgOd5jpRXsbeQZ/HyBC7W35WM5xD8TpAI+1K4SffA1kfqH4RKNHgrKjAfyST2yRXtXm18mg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ODE+JsK2ZloHod1yf0HA0apfscZApS+2ObLpwtD0V0w=; b=f96iC0x3mMBvx6/PD2bLljRlCORjo/7jPOOZ1WOXvMWFEG9D8VRlcXMjf++OuJEjE7/+RdXXXfIntHap1Rz+rYL/CvXmP8wrWc2BP+jdtMQ9E3pcTgGmVIgL+ByTRRn4iAg2J6zFQb+VOqb7Fmq5fRxg+Y8BS8kpPXmj/2Wwy6k= Received: from DM6PR11MB3834.namprd11.prod.outlook.com (20.179.17.87) by DM6PR11MB2811.namprd11.prod.outlook.com (20.176.100.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2347.19; Tue, 15 Oct 2019 16:55:32 +0000 Received: from DM6PR11MB3834.namprd11.prod.outlook.com ([fe80::21f7:6d8d:919b:d755]) by DM6PR11MB3834.namprd11.prod.outlook.com ([fe80::21f7:6d8d:919b:d755%6]) with mapi id 15.20.2347.023; Tue, 15 Oct 2019 16:55:32 +0000 From: "Kubacki, Michael A" To: "Ni, Ray" , "devel@edk2.groups.io" CC: "Chaganty, Rangasai V" Subject: Re: [edk2-platforms][PATCH V1 1/1] IntelSiliconPkg/BootMediaLib: Reduce library API Thread-Topic: [edk2-platforms][PATCH V1 1/1] IntelSiliconPkg/BootMediaLib: Reduce library API Thread-Index: AQHVgtYIOTkrtkYpnka2pkFh7v6JB6da6TAggAALuWCAAC6TEIAAv33w Date: Tue, 15 Oct 2019 16:55:32 +0000 Message-ID: References: <20191014212616.18376-1-michael.a.kubacki@intel.com> <734D49CCEBEEF84792F5B80ED585239D5C322E81@SHSMSX104.ccr.corp.intel.com> <734D49CCEBEEF84792F5B80ED585239D5C32317E@SHSMSX104.ccr.corp.intel.com> In-Reply-To: <734D49CCEBEEF84792F5B80ED585239D5C32317E@SHSMSX104.ccr.corp.intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows x-ctpclassification: CTP_NT x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNjA4MWFlODItZGNhNC00YjkzLTk4YzktYjIwOWVkNDNhM2IxIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiNzNJclJmNmNBOTVjcTVRZmVhSG1GU0tRVVZPbEl1ZGhUdTM5S20zU3RMamxwN2lIZHpNNGNuV0plMzI2OXBlRCJ9 dlp-reaction: no-action dlp-version: 11.2.0.6 authentication-results: spf=none (sender IP is ) smtp.mailfrom=michael.a.kubacki@intel.com; x-originating-ip: [134.134.136.217] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: e845af0d-0bb9-4ace-c38c-08d751907de5 x-ms-traffictypediagnostic: DM6PR11MB2811: x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:9508; x-forefront-prvs: 01917B1794 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(366004)(13464003)(199004)(189003)(305945005)(6506007)(53546011)(3846002)(6246003)(7736002)(76176011)(7696005)(6116002)(99286004)(5660300002)(55016002)(11346002)(74316002)(9686003)(6436002)(446003)(2501003)(52536014)(102836004)(2906002)(186003)(107886003)(4326008)(26005)(66066001)(229853002)(86362001)(30864003)(256004)(14444005)(110136005)(33656002)(486006)(498600001)(76116006)(66946007)(476003)(66556008)(64756008)(66446008)(66476007)(81156014)(81166006)(25786009)(71190400001)(71200400001)(8936002)(14454004)(8676002);DIR:OUT;SFP:1102;SCL:1;SRVR:DM6PR11MB2811;H:DM6PR11MB3834.namprd11.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: wpdjPaWCjCW24raqhPGqrURvqDj8KWwIVPc8JuJpQ5vvOJpwYY4Zc1CN0r04LMbaPsf7ta78jxRJCWSozlwijqP6lDHRoGutenbsEMz4hU9eOarvIH+fI2k2Z0rrhF6MKBz3h5rlSOLe/TC9VbiUlVOEHRI5DOZKIDYxjLOleyhppiQsXt6tdKLHWQYPfHB2QmceJ9igmGibyeI/8s1lcW9MJInrUvuAf5otHOqTwGm0ORBV5AUlNUVilHe6awHTg+4795y+gN+dpBAS5WVP5ToHBGOoBXi4s8/TvPeWdZ7j5ZH0vw82/UprxL94xZkeRVhWlOZ2olsrq4sQWQssdfq27ZL8M9Dl41eN80YgAmRHbVIg8vd4b19EklXeq9QvfvHKXHMzfInSG2t3PnvObQ15ZH7osXabrU9DdpqBooc= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: e845af0d-0bb9-4ace-c38c-08d751907de5 X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Oct 2019 16:55:32.3655 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: W2XUDGBRuZxmhK7GCe8PdX9jrSqlIqhaGKM1fSisEpzvb1l7PR6d3YOEl1Nj04Zm0wdi/YeTIKdxjG1XJsH+ve7y9RrjwZJjqdL7UcbFUK0= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR11MB2811 Return-Path: michael.a.kubacki@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable My concerns with that approach: 1. In general, I believe it is better if the library reads the value once a= nd caches it. The firmware boot media is fixed after power-on by nature and in some platforms, boot me= dia information=20 may be provided to the IBB in a temporary SRAM (or other volatile memory) e= arly in the boot flow that is temporary (e.g. not accessible after main memory initializatio= n). Here the HOB to global variable transition in DXE, Runtime DXE, SMM is a transparent mechan= ism to the library consumers to get the boot media information regardless of early boot memory= properties. 2. Forcing library consumers to cache puts unnecessary burden on a large nu= mber of library consumers to: 1.a. Understand the library implementation (lack of encapsulation). 1.b. Understand the nuances of their driver type in relation to the libra= ry implementation. 1.c. Perform this evaluation every time the library is used. 1.d. Implement overhead to manage the data in a global variable when this= could automatically be linked by the library. 3. If the HOB is used, it blurs the implementation between the HOB producer= phase (PEI) and HOB consumer phase (DXE). We have many libraries with phase-specific instances. When it reduces progr= amming mistakes and eases integration I believe this is beneficial. In this case, I feel th= e net result for library consumers is better if they simply manage the instance in the DSC as oppose= d to modifying source in drivers on a case-by-case basis dependent on the library implemen= tation. Thanks, Michael > -----Original Message----- > From: Ni, Ray > Sent: Monday, October 14, 2019 9:59 PM > To: Kubacki, Michael A ; > devel@edk2.groups.io > Cc: Chaganty, Rangasai V > Subject: RE: [edk2-platforms][PATCH V1 1/1] IntelSiliconPkg/BootMediaLib: > Reduce library API >=20 > Mike, > I don't think the library needs to cache the boot media type for RT and S= MM. > RT and SMM modules can have a module local variable to cache the boot > media type. > It simplifies the implementation of this library and also the platform DS= C > because there is no need to choose different library instances for differ= ent > modules. >=20 > In another word, I think you can keep the PEI version as a base library > instances and all modules can use that instance. >=20 > Thanks, > Ray >=20 > > -----Original Message----- > > From: Kubacki, Michael A > > Sent: Tuesday, October 15, 2019 10:22 AM > > To: Ni, Ray ; devel@edk2.groups.io > > Cc: Chaganty, Rangasai V > > Subject: RE: [edk2-platforms][PATCH V1 1/1] IntelSiliconPkg/BootMediaLi= b: > > Reduce library API > > > > The two library instances work within the constraints of PEI, DXE, > > Runtime DXE, and SMM. > > > > I cannot find how a single instance can support all these environments > > (in as clean a manner) as is done with the two instances. > > > > Relevant constraints: > > * PEI: Cannot write to global variable > > * Runtime DXE / SMM: Boot Services are not available outside module > > entry point > > > > Solution: > > * PEI instance: Always retrieve the value from a HOB (use heap for R/W)= . > > * DXE, Runtime DXE, SMM instance: Retrieve the value from the HOB in > > the entry point > > (constructor) when the driver is dispatched and Boot Services are > > available and store the value in a global variable so it can be > > accessed in Runtime DXE and SMM. > > > > Two separate instances resolve these requirements quite naturally. > > > > How would you propose meeting the same level of support with one > > instance? > > > > Thanks, > > Michael > > > > > -----Original Message----- > > > From: Ni, Ray > > > Sent: Monday, October 14, 2019 6:30 PM > > > To: Kubacki, Michael A ; > > > devel@edk2.groups.io > > > Cc: Chaganty, Rangasai V > > > Subject: RE: [edk2-platforms][PATCH V1 1/1] > IntelSiliconPkg/BootMediaLib: > > > Reduce library API > > > > > > Reviewed-by: Ray Ni > > > > > > Mike, > > > Thanks for reducing the API. > > > > > > For the other comments I raised (single library instance usable for > > > PEI and DXE), do you have any comments? > > > > > > > > > > -----Original Message----- > > > > From: Kubacki, Michael A > > > > Sent: Tuesday, October 15, 2019 5:26 AM > > > > To: devel@edk2.groups.io > > > > Cc: Chaganty, Rangasai V ; Ni, Ray > > > > > > > > Subject: [edk2-platforms][PATCH V1 1/1] IntelSiliconPkg/BootMediaLi= b: > > > > Reduce library API > > > > > > > > Removes the following functions from FirmwareBootMediaLib.h: > > > > * FirmwareBootMediaIsSpi () > > > > * FirmwareBootMediaIsUfs () > > > > * FirmwareBootMediaIsEmmc () > > > > * FirmwareBootMediaIsNvme () > > > > > > > > It is preferred to have a single method to retrieve the firmware > > > > boot > > > media. > > > > To reduce overall maintenance effort over time, the > > > > FirmwareBootMediaIsXxx () pattern is removed in favor of returning > > > > the firmware boot media type via GetFirmwareBootMediaType (). > > > > > > > > Cc: Sai Chaganty > > > > Cc: Ray Ni > > > > Signed-off-by: Michael Kubacki > > > > --- > > > > > > > > > > > > > > Silicon/Intel/IntelSiliconPkg/Library/PeiDxeSmmBootMediaLib/DxeSmmFirm > > > > wareBootMediaLib.inf | 1 - > > > > > > > > > > > Silicon/Intel/IntelSiliconPkg/Library/PeiDxeSmmBootMediaLib/PeiFirmw > > > ar > > > eB > > > > ootMediaLib.inf | 1 - > > > > > > > > Silicon/Intel/IntelSiliconPkg/Include/Library/FirmwareBootMediaLib > > > > .h > > > > | 48 --------- > > > > > > > > > > > Silicon/Intel/IntelSiliconPkg/Library/PeiDxeSmmBootMediaLib/Firmware > > > Bo > > > o > > > > tMediaLib.c | 109 -------------------- > > > > 4 files changed, 159 deletions(-) > > > > > > > > diff --git > > > > > > > > > > a/Silicon/Intel/IntelSiliconPkg/Library/PeiDxeSmmBootMediaLib/DxeSmmFi > > > > r > > > > mwareBootMediaLib.inf > > > > > > > > > > b/Silicon/Intel/IntelSiliconPkg/Library/PeiDxeSmmBootMediaLib/DxeSmmFi > > > > r > > > > mwareBootMediaLib.inf > > > > index 83ed5f04af..7e10b5f7a7 100644 > > > > --- > > > > > > > > > > a/Silicon/Intel/IntelSiliconPkg/Library/PeiDxeSmmBootMediaLib/DxeSmmFi > > > > r > > > > mwareBootMediaLib.inf > > > > +++ > > > > > > b/Silicon/Intel/IntelSiliconPkg/Library/PeiDxeSmmBootMediaLib/DxeSmm > > > > +++ FirmwareBootMediaLib.inf > > > > @@ -27,7 +27,6 @@ > > > > # > > > > > > > > [Sources] > > > > - FirmwareBootMediaLib.c > > > > DxeSmmFirmwareBootMediaLib.c > > > > > > > > [Packages] > > > > diff --git > > > > a/Silicon/Intel/IntelSiliconPkg/Library/PeiDxeSmmBootMediaLib/PeiF > > > > ir > > > > mw > > > > ar > > > > eBootMediaLib.inf > > > > b/Silicon/Intel/IntelSiliconPkg/Library/PeiDxeSmmBootMediaLib/PeiF > > > > ir > > > > mw > > > > ar > > > > eBootMediaLib.inf > > > > index 063c4027d3..ff1da31387 100644 > > > > --- > > > > a/Silicon/Intel/IntelSiliconPkg/Library/PeiDxeSmmBootMediaLib/PeiF > > > > ir > > > > mw > > > > ar > > > > eBootMediaLib.inf > > > > +++ b/Silicon/Intel/IntelSiliconPkg/Library/PeiDxeSmmBootMediaLib/ > > > > +++ Pe > > > > +++ iF > > > > +++ ir > > > > +++ mwareBootMediaLib.inf > > > > @@ -22,7 +22,6 @@ > > > > LIBRARY_CLASS =3D FirmwareBootMediaLib > > > > > > > > [Sources] > > > > - FirmwareBootMediaLib.c > > > > PeiFirmwareBootMediaLib.c > > > > > > > > [Packages] > > > > diff --git > > > > a/Silicon/Intel/IntelSiliconPkg/Include/Library/FirmwareBootMediaL > > > > ib > > > > .h > > > > b/Silicon/Intel/IntelSiliconPkg/Include/Library/FirmwareBootMediaL > > > > ib > > > > .h > > > > index aca9593a84..b36ebacf30 100644 > > > > --- > > > > a/Silicon/Intel/IntelSiliconPkg/Include/Library/FirmwareBootMediaL > > > > ib > > > > .h > > > > +++ b/Silicon/Intel/IntelSiliconPkg/Include/Library/FirmwareBootMe > > > > +++ di > > > > +++ aL > > > > +++ ib > > > > +++ .h > > > > @@ -55,52 +55,4 @@ 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/Firm > > > > wa > > > > re > > > > B > > > > ootMediaLib.c > > > > b/Silicon/Intel/IntelSiliconPkg/Library/PeiDxeSmmBootMediaLib/Firm > > > > wa > > > > re > > > > B > > > > ootMediaLib.c > > > > deleted file mode 100644 > > > > index 11a14d172d..0000000000 > > > > --- > > > > a/Silicon/Intel/IntelSiliconPkg/Library/PeiDxeSmmBootMediaLib/Firm > > > > wa > > > > re > > > > B > > > > ootMediaLib.c > > > > +++ /dev/null > > > > @@ -1,109 +0,0 @@ > > > > -/** @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 pha= ses. > > > > - > > > > -Copyright (c) 2019, Intel Corporation. All rights reserved.
> > > > -SPDX-License-Identifier: BSD-2-Clause-Patent > > > > - > > > > -**/ > > > > - > > > > -#include > > > > -#include > > > > -#include > > > > - > > > > -/** > > > > - 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 =3D GetFirmwareBootMediaType (&BootMedia); > > > > - if (EFI_ERROR (Status) || BootMedia !=3D 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 =3D GetFirmwareBootMediaType (&BootMedia); > > > > - if (EFI_ERROR (Status) || BootMedia !=3D 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 =3D GetFirmwareBootMediaType (&BootMedia); > > > > - if (EFI_ERROR (Status) || BootMedia !=3D 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 =3D GetFirmwareBootMediaType (&BootMedia); > > > > - if (EFI_ERROR (Status) || BootMedia !=3D FwBootMediaNvme) { > > > > - return FALSE; > > > > - } else { > > > > - return TRUE; > > > > - } > > > > -} > > > > -- > > > > 2.16.2.windows.1 > > > > > >=20