mirror of
https://github.com/acidanthera/audk.git
synced 2025-07-29 16:44:10 +02:00
OvmfPkg: QemuBootOrder: mark UEFI boot options selected by fw_cfg
This will allow us to identify those UEFI boot options (while keeping their relative order) that have *not* been selected by fw_cfg. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Tested-by: Michael Chang <mchang@suse.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14667 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
32a22f09d7
commit
e13be08edc
@ -244,20 +244,22 @@ typedef struct {
|
|||||||
**/
|
**/
|
||||||
typedef struct {
|
typedef struct {
|
||||||
CONST BDS_COMMON_OPTION *BootOption; // reference only, no ownership
|
CONST BDS_COMMON_OPTION *BootOption; // reference only, no ownership
|
||||||
|
BOOLEAN Appended; // has been added to a BOOT_ORDER?
|
||||||
} ACTIVE_OPTION;
|
} ACTIVE_OPTION;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
||||||
Append BootOptionId to BootOrder, reallocating the latter if needed.
|
Append an active boot option to BootOrder, reallocating the latter if needed.
|
||||||
|
|
||||||
@param[in out] BootOrder The structure pointing to the array and holding
|
@param[in out] BootOrder The structure pointing to the array and holding
|
||||||
allocation and usage counters.
|
allocation and usage counters.
|
||||||
|
|
||||||
@param[in] BootOptionId The value to append to the array.
|
@param[in] ActiveOption The active boot option whose ID should be
|
||||||
|
appended to the array.
|
||||||
|
|
||||||
|
|
||||||
@retval RETURN_SUCCESS BootOptionId appended.
|
@retval RETURN_SUCCESS ID of ActiveOption appended.
|
||||||
|
|
||||||
@retval RETURN_OUT_OF_RESOURCES Memory reallocation failed.
|
@retval RETURN_OUT_OF_RESOURCES Memory reallocation failed.
|
||||||
|
|
||||||
@ -265,8 +267,8 @@ typedef struct {
|
|||||||
STATIC
|
STATIC
|
||||||
RETURN_STATUS
|
RETURN_STATUS
|
||||||
BootOrderAppend (
|
BootOrderAppend (
|
||||||
IN OUT BOOT_ORDER *BootOrder,
|
IN OUT BOOT_ORDER *BootOrder,
|
||||||
IN UINT16 BootOptionId
|
IN OUT ACTIVE_OPTION *ActiveOption
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
if (BootOrder->Produced == BootOrder->Allocated) {
|
if (BootOrder->Produced == BootOrder->Allocated) {
|
||||||
@ -287,7 +289,9 @@ BootOrderAppend (
|
|||||||
BootOrder->Data = DataNew;
|
BootOrder->Data = DataNew;
|
||||||
}
|
}
|
||||||
|
|
||||||
BootOrder->Data[BootOrder->Produced++] = BootOptionId;
|
BootOrder->Data[BootOrder->Produced++] =
|
||||||
|
ActiveOption->BootOption->BootCurrent;
|
||||||
|
ActiveOption->Appended = TRUE;
|
||||||
return RETURN_SUCCESS;
|
return RETURN_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -343,6 +347,7 @@ CollectActiveOptions (
|
|||||||
if (IS_LOAD_OPTION_TYPE (Current->Attribute, LOAD_OPTION_ACTIVE)) {
|
if (IS_LOAD_OPTION_TYPE (Current->Attribute, LOAD_OPTION_ACTIVE)) {
|
||||||
if (ScanMode == 1) {
|
if (ScanMode == 1) {
|
||||||
(*ActiveOption)[*Count].BootOption = Current;
|
(*ActiveOption)[*Count].BootOption = Current;
|
||||||
|
(*ActiveOption)[*Count].Appended = FALSE;
|
||||||
}
|
}
|
||||||
++*Count;
|
++*Count;
|
||||||
}
|
}
|
||||||
@ -1119,8 +1124,7 @@ SetBootOrderFromQemu (
|
|||||||
//
|
//
|
||||||
// match found, store ID and continue with next OpenFirmware path
|
// match found, store ID and continue with next OpenFirmware path
|
||||||
//
|
//
|
||||||
Status = BootOrderAppend (&BootOrder,
|
Status = BootOrderAppend (&BootOrder, &ActiveOption[Idx]);
|
||||||
ActiveOption[Idx].BootOption->BootCurrent);
|
|
||||||
if (Status != RETURN_SUCCESS) {
|
if (Status != RETURN_SUCCESS) {
|
||||||
goto ErrorFreeActiveOption;
|
goto ErrorFreeActiveOption;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user