From: "Tinh Nguyen" <tinhnguyen@os.amperecomputing.com>
To: devel@edk2.groups.io, tinhnguyen@os.amperecomputing.com
Cc: patches@amperecomputing.com, nhi@os.amperecomputing.com,
chuong@os.amperecomputing.com, minhnguyen@os.amperecomputing.com,
jian.j.wang@intel.com, gaoliming@byosoft.com.cn,
zhichao.gao@intel.com, ray.ni@intel.com, rebecca@bsdio.com
Subject: Re: [edk2-devel] [edk2][PATCH v2 1/1] MdeModulePkg: Add EDKII Platform Boot Manager Protocol v2
Date: Tue, 11 Apr 2023 00:34:45 +0700 [thread overview]
Message-ID: <efd27730-39d8-6530-742b-8e1db1f224a4@amperemail.onmicrosoft.com> (raw)
In-Reply-To: <17534AB488BFDAF9.3977@groups.io>
Gentle ping, I’m looking for some feedback on this patch. Could someone
please help me to review it?
On 4/6/2023 3:19 PM, Tinh Nguyen via groups.io wrote:
> This introduces the EDKII_PLATFORM_BOOT_MANAGER_PROTOCOL_REVISION2,
> which adds a new UpdateBootOrder() function to support customizing
> the boot options order according to the platform-specific policy.
>
> Signed-off-by: Tinh Nguyen <tinhnguyen@os.amperecomputing.com>
> ---
>
> Changes since v1: Correct the format of the email.
>
> MdeModulePkg/Include/Protocol/PlatformBootManager.h | 24 +++++++++++++++++++-
> MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c | 9 ++++++++
> 2 files changed, 32 insertions(+), 1 deletion(-)
>
> diff --git a/MdeModulePkg/Include/Protocol/PlatformBootManager.h b/MdeModulePkg/Include/Protocol/PlatformBootManager.h
> index e527b0ee0eaf..758bc2deb774 100644
> --- a/MdeModulePkg/Include/Protocol/PlatformBootManager.h
> +++ b/MdeModulePkg/Include/Protocol/PlatformBootManager.h
> @@ -1,6 +1,7 @@
> /** @file
>
> Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved.
> + Copyright (c) 2023, Ampere Computing LLC. All rights reserved.<BR>
>
> SPDX-License-Identifier: BSD-2-Clause-Patent
>
> @@ -29,7 +30,8 @@ typedef struct _EDKII_PLATFORM_BOOT_MANAGER_PROTOCOL EDKII_PLATFORM_BOOT_MANAGER
> // All future revisions must be backwards compatible.
> // If a future version is not back wards compatible it is not the same GUID.
> //
> -#define EDKII_PLATFORM_BOOT_MANAGER_PROTOCOL_REVISION 0x00000001
> +#define EDKII_PLATFORM_BOOT_MANAGER_PROTOCOL_REVISION 0x00000001
> +#define EDKII_PLATFORM_BOOT_MANAGER_PROTOCOL_REVISION2 0x00000002
>
> //
> // Function Prototypes
> @@ -72,9 +74,29 @@ EFI_STATUS
> OUT UINTN *UpdatedBootOptionsCount
> );
>
> +/**
> + This function allows platform to update the DriverOrder/BootOrder variables.
> + And it is available from version 2 of the EDKII Platform Boot Manager protocol.
> +
> + @retval EFI_SUCCESS Platform successfully modifies
> + the DriverOrder/BootOrder variables as wanted.
> + @retval Others There are some errors that happen. Check the status code
> + for details.
> +
> +**/
> +typedef
> +EFI_STATUS
> +(EFIAPI *PLATFORM_BOOT_MANAGER_UPDATE_BOOT_ORDER)(
> + IN VOID
> + );
> +
> struct _EDKII_PLATFORM_BOOT_MANAGER_PROTOCOL {
> UINT64 Revision;
> PLATFORM_BOOT_MANAGER_REFRESH_ALL_BOOT_OPTIONS RefreshAllBootOptions;
> + //
> + // EDKII_PLATFORM_BOOT_MANAGER_PROTOCOL_REVISION2
> + //
> + PLATFORM_BOOT_MANAGER_UPDATE_BOOT_ORDER UpdateBootOrder;
> };
>
> extern EFI_GUID gEdkiiPlatformBootManagerProtocolGuid;
> diff --git a/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c b/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c
> index bde22fa6590e..67d1d54b3c24 100644
> --- a/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c
> +++ b/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c
> @@ -4,6 +4,7 @@
> Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved.
> Copyright (c) 2011 - 2021, Intel Corporation. All rights reserved.<BR>
> (C) Copyright 2015-2021 Hewlett Packard Enterprise Development LP<BR>
> +Copyright (c) 2023, Ampere Computing LLC. All rights reserved.<BR>
> SPDX-License-Identifier: BSD-2-Clause-Patent
>
> **/
> @@ -2412,6 +2413,8 @@ EfiBootManagerRefreshAllBootOption (
> BootOptions = UpdatedBootOptions;
> BootOptionCount = UpdatedBootOptionCount;
> }
> + } else {
> + PlatformBootManager = NULL;
> }
>
> NvBootOptions = EfiBootManagerGetLoadOptions (&NvBootOptionCount, LoadOptionTypeBoot);
> @@ -2453,6 +2456,12 @@ EfiBootManagerRefreshAllBootOption (
>
> EfiBootManagerFreeLoadOptions (BootOptions, BootOptionCount);
> EfiBootManagerFreeLoadOptions (NvBootOptions, NvBootOptionCount);
> +
> + if ((PlatformBootManager != NULL) &&
> + (PlatformBootManager->Revision >= EDKII_PLATFORM_BOOT_MANAGER_PROTOCOL_REVISION2))
> + {
> + PlatformBootManager->UpdateBootOrder ();
> + }
> }
>
> /**
> --
> 2.40.0
>
>
>
>
>
next parent reply other threads:[~2023-04-10 17:34 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <17534AB488BFDAF9.3977@groups.io>
2023-04-10 17:34 ` Tinh Nguyen [this message]
2023-04-18 1:24 ` [edk2-devel] [edk2][PATCH v2 1/1] MdeModulePkg: Add EDKII Platform Boot Manager Protocol v2 Ni, Ray
2023-04-18 4:25 ` Tinh Nguyen
2023-04-19 3:25 ` 回复: [ ** SPAMMAIL ** ]Re: " gaoliming
2023-04-19 9:49 ` Tinh Nguyen
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=efd27730-39d8-6530-742b-8e1db1f224a4@amperemail.onmicrosoft.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