TianoCore EDK2 master
|
#include "Bds.h"
#include "Language.h"
#include "HwErrRecSupport.h"
#include <Library/VariablePolicyHelperLib.h>
Go to the source code of this file.
Macros | |
#define | SET_BOOT_OPTION_SUPPORT_KEY_COUNT(a, c) |
Variables | |
EFI_BDS_ARCH_PROTOCOL | gBds |
EFI_EVENT | gConnectConInEvent = NULL |
CHAR16 * | mReadOnlyVariables [] |
CHAR16 * | mBdsLoadOptionName [] |
This module produce main entry for BDS phase - BdsEntry. When this module was dispatched by DxeCore, gEfiBdsArchProtocolGuid will be installed which contains interface of BdsEntry. After DxeCore finish DXE phase, gEfiBdsArchProtocolGuid->BdsEntry will be invoked to enter BDS phase.
Copyright (c) 2004 - 2019, Intel Corporation. All rights reserved.
(C) Copyright 2016-2019 Hewlett Packard Enterprise Development LP
(C) Copyright 2015 Hewlett-Packard Development Company, L.P.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file BdsEntry.c.
#define SET_BOOT_OPTION_SUPPORT_KEY_COUNT | ( | a, | |
c | |||
) |
Definition at line 20 of file BdsEntry.c.
Event to Connect ConIn.
Event | Event whose notification function is being invoked. |
Context | Pointer to the notification function's context, which is implementation-dependent. |
Definition at line 64 of file BdsEntry.c.
EFI_STATUS BdsDxeSetVariableAndReportStatusCodeOnError | ( | IN CHAR16 * | VariableName, |
IN EFI_GUID * | VendorGuid, | ||
IN UINT32 | Attributes, | ||
IN UINTN | DataSize, | ||
IN VOID * | Data | ||
) |
Set the variable and report the error through status code upon failure.
VariableName | A Null-terminated string that is the name of the vendor's variable. Each VariableName is unique for each VendorGuid. VariableName must contain 1 or more characters. If VariableName is an empty string, then EFI_INVALID_PARAMETER is returned. |
VendorGuid | A unique identifier for the vendor. |
Attributes | Attributes bitmask to set for the variable. |
DataSize | The size in bytes of the Data buffer. Unless the EFI_VARIABLE_APPEND_WRITE, or EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS attribute is set, a size of zero causes the variable to be deleted. When the EFI_VARIABLE_APPEND_WRITE attribute is set, then a SetVariable() call with a DataSize of zero will not cause any change to the variable value (the timestamp associated with the variable may be updated however even if no new data value is provided,see the description of the EFI_VARIABLE_AUTHENTICATION_2 descriptor below. In this case the DataSize will not be zero since the EFI_VARIABLE_AUTHENTICATION_2 descriptor will be populated). |
Data | The contents for the variable. |
EFI_SUCCESS | The firmware has successfully stored the variable and its data as defined by the Attributes. |
EFI_INVALID_PARAMETER | An invalid combination of attribute bits, name, and GUID was supplied, or the DataSize exceeds the maximum allowed. |
EFI_INVALID_PARAMETER | VariableName is an empty string. |
EFI_OUT_OF_RESOURCES | Not enough storage is available to hold the variable and its data. |
EFI_DEVICE_ERROR | The variable could not be retrieved due to a hardware error. |
EFI_WRITE_PROTECTED | The variable in question is read-only. |
EFI_WRITE_PROTECTED | The variable in question cannot be deleted. |
EFI_SECURITY_VIOLATION | The variable could not be written due to EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACESS being set, but the AuthInfo does NOT pass the validation check carried out by the firmware. |
EFI_NOT_FOUND | The variable trying to be updated or deleted was not found. |
Definition at line 1159 of file BdsEntry.c.
VOID EFIAPI BdsEntry | ( | IN EFI_BDS_ARCH_PROTOCOL * | This | ) |
Service routine for BdsInstance->Entry(). Devices are connected, the consoles are initialized, and the boot options are tried.
This | Protocol Instance structure. |
Definition at line 669 of file BdsEntry.c.
VOID BdsFormalizeConsoleVariable | ( | IN CHAR16 * | VariableName | ) |
Validate input console variable data.
If found the device path is not a valid device path, remove the variable.
VariableName | Input console variable name. |
Definition at line 513 of file BdsEntry.c.
VOID BdsFormalizeEfiGlobalVariable | ( | VOID | ) |
Validate variables.
Definition at line 642 of file BdsEntry.c.
VOID BdsFormalizeOSIndicationVariable | ( | VOID | ) |
Formalize OsIndication related variables.
For OsIndicationsSupported, Create a BS/RT/UINT64 variable to report caps Delete OsIndications variable if it is not NV/BS/RT UINT64.
Item 3 is used to solve case when OS corrupts OsIndications. Here simply delete this NV variable.
Create a boot option for BootManagerMenu if it hasn't been created yet
Definition at line 553 of file BdsEntry.c.
EFI_STATUS EFIAPI BdsInitialize | ( | IN EFI_HANDLE | ImageHandle, |
IN EFI_SYSTEM_TABLE * | SystemTable | ||
) |
Install Boot Device Selection Protocol
ImageHandle | The image handle. |
SystemTable | The system table. |
EFI_SUCEESS | BDS has finished initializing. Return the dispatcher and recall BDS.Entry |
Other | Return status from AllocatePool() or gBS->InstallProtocolInterface |
Definition at line 177 of file BdsEntry.c.
VOID BdsReadKeys | ( | VOID | ) |
The function reads user inputs.
Definition at line 284 of file BdsEntry.c.
The function waits for the boot manager timeout expires or hotkey is pressed.
It calls PlatformBootManagerWaitCallback each second.
HotkeyTriggered | Input hotkey event. |
Definition at line 315 of file BdsEntry.c.
EFI_STATUS BdsWaitForSingleEvent | ( | IN EFI_EVENT | Event, |
IN UINT64 Timeout | OPTIONAL | ||
) |
Function waits for a given event to fire, or for an optional timeout to expire.
Event | The event to wait for |
Timeout | An optional timeout value in 100 ns units. |
EFI_SUCCESS | Event fired before Timeout expired. |
EFI_TIME_OUT | Timout expired before Event fired.. |
Definition at line 226 of file BdsEntry.c.
BOOLEAN BootBootOptions | ( | IN EFI_BOOT_MANAGER_LOAD_OPTION * | BootOptions, |
IN UINTN | BootOptionCount, | ||
IN EFI_BOOT_MANAGER_LOAD_OPTION *BootManagerMenu | OPTIONAL | ||
) |
Attempt to boot each boot option in the BootOptions array.
BootOptions | Input boot option array. |
BootOptionCount | Input boot option count. |
BootManagerMenu | Input boot manager menu. |
TRUE | Successfully boot one of the boot options. |
FALSE | Failed boot any of the boot options. |
Definition at line 375 of file BdsEntry.c.
Notify function for event group EFI_EVENT_GROUP_READY_TO_BOOT. This is used to check whether there is remaining deferred load images.
[in] | Event | The Event that is being processed. |
[in] | Context | The Event Context. |
Definition at line 95 of file BdsEntry.c.
VOID ProcessLoadOptions | ( | IN EFI_BOOT_MANAGER_LOAD_OPTION * | LoadOptions, |
IN UINTN | LoadOptionCount | ||
) |
The function will load and start every Driver####, SysPrep#### or PlatformRecovery####.
LoadOptions | Load option array. |
LoadOptionCount | Load option count. |
Definition at line 438 of file BdsEntry.c.
BDS arch protocol instance initial value.
Definition at line 27 of file BdsEntry.c.
Definition at line 34 of file BdsEntry.c.
CHAR16* mBdsLoadOptionName[] |
Definition at line 47 of file BdsEntry.c.
CHAR16* mReadOnlyVariables[] |
The read-only variables defined in UEFI Spec.
Definition at line 39 of file BdsEntry.c.