public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Ni, Ray" <ray.ni@intel.com>
To: Ashish Singhal <ashishsingha@nvidia.com>,
	"devel@edk2.groups.io" <devel@edk2.groups.io>,
	"Wang, Jian J" <jian.j.wang@intel.com>,
	"Wu, Hao A" <hao.a.wu@intel.com>,
	"Gao, Zhichao" <zhichao.gao@intel.com>
Subject: Re: [PATCH v3] MdeModulePkg: Add Platform Boot Options Protocol
Date: Wed, 18 Dec 2019 00:55:03 +0000	[thread overview]
Message-ID: <734D49CCEBEEF84792F5B80ED585239D5C3A114B@SHSMSX104.ccr.corp.intel.com> (raw)
In-Reply-To: <6f24dc6e1495eded1c77fa35aff40b574a75d7be.1576614938.git.ashishsingha@nvidia.com>

Ashish,
I prefer EDKII_PLATFORM_BOOT_MANAGER_PROTOCOL and could have two fields for this protocol for now:
Revision and RefreshAllBootOption (IN Options, IN OptionCount, OUT UpdatedOptions, OUT UpdatedOptionCount)
Usually EDKII puts Count in second and buffer in first.

The reason of using EDKII_PLATFORM_BOOT_MANAGER_PROTOCOL as the new protocol name is in future
we could increase the revision and put more platform hook API in this protocol.

The reason of combining two APIs to one RefreshAllBootOption() is when I checked the code change below, I see
no need to separate them.

What do you think?

Thanks,
Ray

>    //
> +  // Locate Platform Boot Options Protocol
> +  //
> +  PlatformBootOptions = NULL;
> +  Status = gBS->LocateProtocol (&gEdkiiPlatformBootOptionsProtocolGuid,
> +                                NULL,
> +                                (VOID **)&PlatformBootOptions);
> +  if (!EFI_ERROR (Status)) {
> +    //
> +    // If found, call platform specific overrides to auto enumerated
> +    // boot options.
> +    //
> +    Status = PlatformBootOptions->OverridePlatformBootOptions ((CONST UINTN)BootOptionCount,
> +                                                               (CONST EFI_BOOT_MANAGER_LOAD_OPTION *)BootOptions,
> +                                                               &UpdatedBootOptionCount,
> +                                                               &UpdatedBootOptions);
> +    if (!EFI_ERROR (Status)) {
> +      EfiBootManagerFreeLoadOptions (BootOptions, BootOptionCount);
> +      BootOptions = UpdatedBootOptions;
> +      BootOptionCount = UpdatedBootOptionCount;
> +    }
> +
> +    //
> +    // Call platform specific override to remove invalid boot options from NV
> +    //
> +    Status = PlatformBootOptions->RemoveInvalidPlatformNvBootOptions ((CONST UINTN)NvBootOptionCount,
> +                                                                      (CONST EFI_BOOT_MANAGER_LOAD_OPTION *)NvBootOptions,
> +                                                                      &UpdatedBootOptionCount,
> +                                                                      &UpdatedBootOptions);
> +    if (!EFI_ERROR (Status)) {
> +      EfiBootManagerFreeLoadOptions (NvBootOptions, NvBootOptionCount);
> +      NvBootOptions = UpdatedBootOptions;
> +      NvBootOptionCount = UpdatedBootOptionCount;
> +    }
> +  }
> +


  reply	other threads:[~2019-12-18  0:55 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-17 20:36 [PATCH v3] MdeModulePkg: Add Platform Boot Options Protocol Ashish Singhal
2019-12-18  0:55 ` Ni, Ray [this message]
2019-12-18  4:21   ` Ashish Singhal
2019-12-18  8:42     ` Ni, Ray
2019-12-18 19:14       ` Ashish Singhal

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=734D49CCEBEEF84792F5B80ED585239D5C3A114B@SHSMSX104.ccr.corp.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