Report the setting variable failure to platform through the status code when core cannot handle the error.
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15385 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
@ -1,7 +1,7 @@
|
|||||||
/** @file
|
/** @file
|
||||||
BDS Lib functions which relate with create or process the boot option.
|
BDS Lib functions which relate with create or process the boot option.
|
||||||
|
|
||||||
Copyright (c) 2004 - 2013, Intel Corporation. All rights reserved.<BR>
|
Copyright (c) 2004 - 2014, Intel Corporation. All rights reserved.<BR>
|
||||||
This program and the accompanying materials
|
This program and the accompanying materials
|
||||||
are licensed and made available under the terms and conditions of the BSD License
|
are licensed and made available under the terms and conditions of the BSD License
|
||||||
which accompanies this distribution. The full text of the license may be found at
|
which accompanies this distribution. The full text of the license may be found at
|
||||||
@ -82,6 +82,10 @@ BdsDeleteBootOption (
|
|||||||
0,
|
0,
|
||||||
NULL
|
NULL
|
||||||
);
|
);
|
||||||
|
//
|
||||||
|
// Deleting variable with existing variable implementation shouldn't fail.
|
||||||
|
//
|
||||||
|
ASSERT_EFI_ERROR (Status);
|
||||||
|
|
||||||
//
|
//
|
||||||
// adjust boot order array
|
// adjust boot order array
|
||||||
@ -626,6 +630,10 @@ BdsDeleteAllInvalidLegacyBootOptions (
|
|||||||
BootOrderSize,
|
BootOrderSize,
|
||||||
BootOrder
|
BootOrder
|
||||||
);
|
);
|
||||||
|
//
|
||||||
|
// Shrinking variable with existing variable implementation shouldn't fail.
|
||||||
|
//
|
||||||
|
ASSERT_EFI_ERROR (Status);
|
||||||
if (BootOrder != NULL) {
|
if (BootOrder != NULL) {
|
||||||
FreePool (BootOrder);
|
FreePool (BootOrder);
|
||||||
}
|
}
|
||||||
@ -857,12 +865,11 @@ BdsAddNonExistingLegacyBootOptions (
|
|||||||
&BootOrder,
|
&BootOrder,
|
||||||
&BootOrderSize
|
&BootOrderSize
|
||||||
);
|
);
|
||||||
if (EFI_ERROR (Status)) {
|
if (!EFI_ERROR (Status)) {
|
||||||
break;
|
|
||||||
}
|
|
||||||
BbsIndex = Index;
|
BbsIndex = Index;
|
||||||
OptionNumber = BootOrder[BootOrderSize / sizeof (UINT16) - 1];
|
OptionNumber = BootOrder[BootOrderSize / sizeof (UINT16) - 1];
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ASSERT (BbsIndex == Index);
|
ASSERT (BbsIndex == Index);
|
||||||
}
|
}
|
||||||
@ -2265,7 +2272,7 @@ BdsLibBootViaBootOption (
|
|||||||
// In this case, "BootCurrent" is not created.
|
// In this case, "BootCurrent" is not created.
|
||||||
// Only create the BootCurrent variable when it points to a valid Boot#### variable.
|
// Only create the BootCurrent variable when it points to a valid Boot#### variable.
|
||||||
//
|
//
|
||||||
gRT->SetVariable (
|
SetVariableAndReportStatusCodeOnError (
|
||||||
L"BootCurrent",
|
L"BootCurrent",
|
||||||
&gEfiGlobalVariableGuid,
|
&gEfiGlobalVariableGuid,
|
||||||
EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,
|
EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,
|
||||||
@ -2463,13 +2470,14 @@ Done:
|
|||||||
|
|
||||||
//
|
//
|
||||||
// Clear Boot Current
|
// Clear Boot Current
|
||||||
|
// Deleting variable with current implementation shouldn't fail.
|
||||||
//
|
//
|
||||||
gRT->SetVariable (
|
gRT->SetVariable (
|
||||||
L"BootCurrent",
|
L"BootCurrent",
|
||||||
&gEfiGlobalVariableGuid,
|
&gEfiGlobalVariableGuid,
|
||||||
EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,
|
EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,
|
||||||
0,
|
0,
|
||||||
&Option->BootCurrent
|
NULL
|
||||||
);
|
);
|
||||||
|
|
||||||
return Status;
|
return Status;
|
||||||
@ -2580,6 +2588,7 @@ BdsExpandPartitionPartialDevicePathToFull (
|
|||||||
FreePool (TempNewDevicePath);
|
FreePool (TempNewDevicePath);
|
||||||
//
|
//
|
||||||
// Save the matching Device Path so we don't need to do a connect all next time
|
// Save the matching Device Path so we don't need to do a connect all next time
|
||||||
|
// Failure to set the variable only impacts the performance when next time expanding the short-form device path.
|
||||||
//
|
//
|
||||||
Status = gRT->SetVariable (
|
Status = gRT->SetVariable (
|
||||||
HD_BOOT_DEVICE_PATH_VARIABLE_NAME,
|
HD_BOOT_DEVICE_PATH_VARIABLE_NAME,
|
||||||
@ -2678,6 +2687,7 @@ BdsExpandPartitionPartialDevicePathToFull (
|
|||||||
|
|
||||||
//
|
//
|
||||||
// Save the matching Device Path so we don't need to do a connect all next time
|
// Save the matching Device Path so we don't need to do a connect all next time
|
||||||
|
// Failure to set the variable only impacts the performance when next time expanding the short-form device path.
|
||||||
//
|
//
|
||||||
Status = gRT->SetVariable (
|
Status = gRT->SetVariable (
|
||||||
HD_BOOT_DEVICE_PATH_VARIABLE_NAME,
|
HD_BOOT_DEVICE_PATH_VARIABLE_NAME,
|
||||||
@ -2887,6 +2897,10 @@ BdsLibDeleteOptionFromHandle (
|
|||||||
BootOrderSize,
|
BootOrderSize,
|
||||||
BootOrder
|
BootOrder
|
||||||
);
|
);
|
||||||
|
//
|
||||||
|
// Shrinking variable with existing variable implementation shouldn't fail.
|
||||||
|
//
|
||||||
|
ASSERT_EFI_ERROR (Status);
|
||||||
|
|
||||||
FreePool (BootOrder);
|
FreePool (BootOrder);
|
||||||
|
|
||||||
@ -2985,6 +2999,10 @@ BdsDeleteAllInvalidEfiBootOption (
|
|||||||
NULL
|
NULL
|
||||||
);
|
);
|
||||||
//
|
//
|
||||||
|
// Deleting variable with current variable implementation shouldn't fail.
|
||||||
|
//
|
||||||
|
ASSERT_EFI_ERROR (Status);
|
||||||
|
//
|
||||||
// Mark this boot option in boot order as deleted
|
// Mark this boot option in boot order as deleted
|
||||||
//
|
//
|
||||||
BootOrder[Index] = 0xffff;
|
BootOrder[Index] = 0xffff;
|
||||||
@ -3012,6 +3030,10 @@ BdsDeleteAllInvalidEfiBootOption (
|
|||||||
Index2 * sizeof (UINT16),
|
Index2 * sizeof (UINT16),
|
||||||
BootOrder
|
BootOrder
|
||||||
);
|
);
|
||||||
|
//
|
||||||
|
// Shrinking variable with current variable implementation shouldn't fail.
|
||||||
|
//
|
||||||
|
ASSERT_EFI_ERROR (Status);
|
||||||
|
|
||||||
FreePool (BootOrder);
|
FreePool (BootOrder);
|
||||||
|
|
||||||
@ -3135,7 +3157,9 @@ BdsLibEnumerateAllBootOption (
|
|||||||
AsciiStrSize (PlatLang),
|
AsciiStrSize (PlatLang),
|
||||||
PlatLang
|
PlatLang
|
||||||
);
|
);
|
||||||
ASSERT_EFI_ERROR (Status);
|
//
|
||||||
|
// Failure to set the variable only impacts the performance next time enumerating the boot options.
|
||||||
|
//
|
||||||
|
|
||||||
if (LastLang != NULL) {
|
if (LastLang != NULL) {
|
||||||
FreePool (LastLang);
|
FreePool (LastLang);
|
||||||
@ -3478,6 +3502,7 @@ BdsLibBootNext (
|
|||||||
VOID
|
VOID
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
EFI_STATUS Status;
|
||||||
UINT16 *BootNext;
|
UINT16 *BootNext;
|
||||||
UINTN BootNextSize;
|
UINTN BootNextSize;
|
||||||
CHAR16 Buffer[20];
|
CHAR16 Buffer[20];
|
||||||
@ -3502,13 +3527,17 @@ BdsLibBootNext (
|
|||||||
// Clear the boot next variable first
|
// Clear the boot next variable first
|
||||||
//
|
//
|
||||||
if (BootNext != NULL) {
|
if (BootNext != NULL) {
|
||||||
gRT->SetVariable (
|
Status = gRT->SetVariable (
|
||||||
L"BootNext",
|
L"BootNext",
|
||||||
&gEfiGlobalVariableGuid,
|
&gEfiGlobalVariableGuid,
|
||||||
EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_NON_VOLATILE,
|
EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_NON_VOLATILE,
|
||||||
0,
|
0,
|
||||||
BootNext
|
NULL
|
||||||
);
|
);
|
||||||
|
//
|
||||||
|
// Deleting variable with current variable implementation shouldn't fail.
|
||||||
|
//
|
||||||
|
ASSERT_EFI_ERROR (Status);
|
||||||
|
|
||||||
//
|
//
|
||||||
// Start to build the boot option and try to boot
|
// Start to build the boot option and try to boot
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/** @file
|
/** @file
|
||||||
BDS Lib functions which contain all the code to connect console device
|
BDS Lib functions which contain all the code to connect console device
|
||||||
|
|
||||||
Copyright (c) 2004 - 2013, Intel Corporation. All rights reserved.<BR>
|
Copyright (c) 2004 - 2014, Intel Corporation. All rights reserved.<BR>
|
||||||
This program and the accompanying materials
|
This program and the accompanying materials
|
||||||
are licensed and made available under the terms and conditions of the BSD License
|
are licensed and made available under the terms and conditions of the BSD License
|
||||||
which accompanies this distribution. The full text of the license may be found at
|
which accompanies this distribution. The full text of the license may be found at
|
||||||
@ -285,7 +285,7 @@ BdsLibUpdateConsoleVariable (
|
|||||||
// Finally, Update the variable of the default console by NewDevicePath
|
// Finally, Update the variable of the default console by NewDevicePath
|
||||||
//
|
//
|
||||||
DevicePathSize = GetDevicePathSize (NewDevicePath);
|
DevicePathSize = GetDevicePathSize (NewDevicePath);
|
||||||
Status = gRT->SetVariable (
|
Status = SetVariableAndReportStatusCodeOnError (
|
||||||
ConVarName,
|
ConVarName,
|
||||||
&gEfiGlobalVariableGuid,
|
&gEfiGlobalVariableGuid,
|
||||||
Attributes,
|
Attributes,
|
||||||
@ -295,7 +295,6 @@ BdsLibUpdateConsoleVariable (
|
|||||||
if ((DevicePathSize == 0) && (Status == EFI_NOT_FOUND)) {
|
if ((DevicePathSize == 0) && (Status == EFI_NOT_FOUND)) {
|
||||||
Status = EFI_SUCCESS;
|
Status = EFI_SUCCESS;
|
||||||
}
|
}
|
||||||
ASSERT_EFI_ERROR (Status);
|
|
||||||
|
|
||||||
if (VarConsole == NewDevicePath) {
|
if (VarConsole == NewDevicePath) {
|
||||||
if (VarConsole != NULL) {
|
if (VarConsole != NULL) {
|
||||||
|
@ -1419,7 +1419,7 @@ BdsSetMemoryTypeInformationVariable (
|
|||||||
// Or create the variable in first boot.
|
// Or create the variable in first boot.
|
||||||
//
|
//
|
||||||
if (MemoryTypeInformationModified || !MemoryTypeInformationVariableExists) {
|
if (MemoryTypeInformationModified || !MemoryTypeInformationVariableExists) {
|
||||||
Status = gRT->SetVariable (
|
Status = SetVariableAndReportStatusCodeOnError (
|
||||||
EFI_MEMORY_TYPE_INFORMATION_VARIABLE_NAME,
|
EFI_MEMORY_TYPE_INFORMATION_VARIABLE_NAME,
|
||||||
&gEfiMemoryTypeInformationGuid,
|
&gEfiMemoryTypeInformationGuid,
|
||||||
EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS,
|
EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS,
|
||||||
@ -1486,3 +1486,87 @@ BdsLibUserIdentify (
|
|||||||
return Manager->Identify (Manager, User);
|
return Manager->Identify (Manager, User);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
Set the variable and report the error through status code upon failure.
|
||||||
|
|
||||||
|
@param 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.
|
||||||
|
@param VendorGuid A unique identifier for the vendor.
|
||||||
|
@param Attributes Attributes bitmask to set for the variable.
|
||||||
|
@param DataSize The size in bytes of the Data buffer. Unless the EFI_VARIABLE_APPEND_WRITE,
|
||||||
|
EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS, 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).
|
||||||
|
@param Data The contents for the variable.
|
||||||
|
|
||||||
|
@retval EFI_SUCCESS The firmware has successfully stored the variable and its data as
|
||||||
|
defined by the Attributes.
|
||||||
|
@retval EFI_INVALID_PARAMETER An invalid combination of attribute bits, name, and GUID was supplied, or the
|
||||||
|
DataSize exceeds the maximum allowed.
|
||||||
|
@retval EFI_INVALID_PARAMETER VariableName is an empty string.
|
||||||
|
@retval EFI_OUT_OF_RESOURCES Not enough storage is available to hold the variable and its data.
|
||||||
|
@retval EFI_DEVICE_ERROR The variable could not be retrieved due to a hardware error.
|
||||||
|
@retval EFI_WRITE_PROTECTED The variable in question is read-only.
|
||||||
|
@retval EFI_WRITE_PROTECTED The variable in question cannot be deleted.
|
||||||
|
@retval EFI_SECURITY_VIOLATION The variable could not be written due to EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS
|
||||||
|
or EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACESS being set, but the AuthInfo
|
||||||
|
does NOT pass the validation check carried out by the firmware.
|
||||||
|
|
||||||
|
@retval EFI_NOT_FOUND The variable trying to be updated or deleted was not found.
|
||||||
|
**/
|
||||||
|
EFI_STATUS
|
||||||
|
SetVariableAndReportStatusCodeOnError (
|
||||||
|
IN CHAR16 *VariableName,
|
||||||
|
IN EFI_GUID *VendorGuid,
|
||||||
|
IN UINT32 Attributes,
|
||||||
|
IN UINTN DataSize,
|
||||||
|
IN VOID *Data
|
||||||
|
)
|
||||||
|
{
|
||||||
|
EFI_STATUS Status;
|
||||||
|
EDKII_SET_VARIABLE_STATUS *SetVariableStatus;
|
||||||
|
UINTN NameSize;
|
||||||
|
|
||||||
|
Status = gRT->SetVariable (
|
||||||
|
VariableName,
|
||||||
|
VendorGuid,
|
||||||
|
Attributes,
|
||||||
|
DataSize,
|
||||||
|
Data
|
||||||
|
);
|
||||||
|
if (EFI_ERROR (Status)) {
|
||||||
|
NameSize = StrSize (VariableName);
|
||||||
|
SetVariableStatus = AllocatePool (sizeof (EDKII_SET_VARIABLE_STATUS) + NameSize + DataSize);
|
||||||
|
if (SetVariableStatus != NULL) {
|
||||||
|
CopyGuid (&SetVariableStatus->Guid, VendorGuid);
|
||||||
|
SetVariableStatus->NameSize = NameSize;
|
||||||
|
SetVariableStatus->DataSize = DataSize;
|
||||||
|
SetVariableStatus->SetStatus = Status;
|
||||||
|
SetVariableStatus->Attributes = Attributes;
|
||||||
|
CopyMem (SetVariableStatus + 1, VariableName, NameSize);
|
||||||
|
CopyMem (((UINT8 *) (SetVariableStatus + 1)) + NameSize, Data, DataSize);
|
||||||
|
|
||||||
|
REPORT_STATUS_CODE_EX (
|
||||||
|
EFI_ERROR_CODE,
|
||||||
|
PcdGet32 (PcdErrorCodeSetVariable),
|
||||||
|
0,
|
||||||
|
NULL,
|
||||||
|
&gEdkiiStatusCodeDataTypeVariableGuid,
|
||||||
|
SetVariableStatus,
|
||||||
|
sizeof (EDKII_SET_VARIABLE_STATUS) + NameSize + DataSize
|
||||||
|
);
|
||||||
|
|
||||||
|
FreePool (SetVariableStatus);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return Status;
|
||||||
|
}
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
# 2) BDS boot device connect interface;
|
# 2) BDS boot device connect interface;
|
||||||
# 3) BDS Misc interfaces for mainting boot variable, ouput string, etc.
|
# 3) BDS Misc interfaces for mainting boot variable, ouput string, etc.
|
||||||
#
|
#
|
||||||
# Copyright (c) 2007 - 2013, Intel Corporation. All rights reserved.<BR>
|
# Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR>
|
||||||
# This program and the accompanying materials
|
# This program and the accompanying materials
|
||||||
# are licensed and made available under the terms and conditions of the BSD License
|
# are licensed and made available under the terms and conditions of the BSD License
|
||||||
# which accompanies this distribution. The full text of the license may be found at
|
# which accompanies this distribution. The full text of the license may be found at
|
||||||
@ -79,6 +79,7 @@
|
|||||||
gHdBootDevicePathVariablGuid ## SOMETIMES_PRODUCES ## Variable:L"HDDP" (The device path of Boot file on Hard device.)
|
gHdBootDevicePathVariablGuid ## SOMETIMES_PRODUCES ## Variable:L"HDDP" (The device path of Boot file on Hard device.)
|
||||||
gBdsLibStringPackageGuid ## PRODUCES ## GUID (HII String PackageList Guid)
|
gBdsLibStringPackageGuid ## PRODUCES ## GUID (HII String PackageList Guid)
|
||||||
gEfiLegacyDevOrderVariableGuid ## CONSUMES ## GUID
|
gEfiLegacyDevOrderVariableGuid ## CONSUMES ## GUID
|
||||||
|
gEdkiiStatusCodeDataTypeVariableGuid ## SOMETIMES_CONSUMES
|
||||||
|
|
||||||
[Protocols]
|
[Protocols]
|
||||||
gEfiSimpleFileSystemProtocolGuid # PROTOCOL CONSUMES
|
gEfiSimpleFileSystemProtocolGuid # PROTOCOL CONSUMES
|
||||||
@ -111,4 +112,5 @@
|
|||||||
gEfiMdeModulePkgTokenSpaceGuid.PcdResetOnMemoryTypeInformationChange
|
gEfiMdeModulePkgTokenSpaceGuid.PcdResetOnMemoryTypeInformationChange
|
||||||
gEfiMdeModulePkgTokenSpaceGuid.PcdProgressCodeOsLoaderLoad
|
gEfiMdeModulePkgTokenSpaceGuid.PcdProgressCodeOsLoaderLoad
|
||||||
gEfiMdeModulePkgTokenSpaceGuid.PcdProgressCodeOsLoaderStart
|
gEfiMdeModulePkgTokenSpaceGuid.PcdProgressCodeOsLoaderStart
|
||||||
|
gEfiMdeModulePkgTokenSpaceGuid.PcdErrorCodeSetVariable
|
||||||
gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdShellFile
|
gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdShellFile
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/** @file
|
/** @file
|
||||||
BDS library definition, include the file and data structure
|
BDS library definition, include the file and data structure
|
||||||
|
|
||||||
Copyright (c) 2004 - 2013, Intel Corporation. All rights reserved.<BR>
|
Copyright (c) 2004 - 2014, Intel Corporation. All rights reserved.<BR>
|
||||||
This program and the accompanying materials
|
This program and the accompanying materials
|
||||||
are licensed and made available under the terms and conditions of the BSD License
|
are licensed and made available under the terms and conditions of the BSD License
|
||||||
which accompanies this distribution. The full text of the license may be found at
|
which accompanies this distribution. The full text of the license may be found at
|
||||||
@ -51,6 +51,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|||||||
#include <Guid/HdBootVariable.h>
|
#include <Guid/HdBootVariable.h>
|
||||||
#include <Guid/LastEnumLang.h>
|
#include <Guid/LastEnumLang.h>
|
||||||
#include <Guid/LegacyDevOrder.h>
|
#include <Guid/LegacyDevOrder.h>
|
||||||
|
#include <Guid/StatusCodeDataTypeVariable.h>
|
||||||
|
|
||||||
#include <Library/PrintLib.h>
|
#include <Library/PrintLib.h>
|
||||||
#include <Library/DebugLib.h>
|
#include <Library/DebugLib.h>
|
||||||
@ -147,4 +148,48 @@ ValidateOption (
|
|||||||
UINTN VariableSize
|
UINTN VariableSize
|
||||||
);
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
Set the variable and report the error through status code upon failure.
|
||||||
|
|
||||||
|
@param 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.
|
||||||
|
@param VendorGuid A unique identifier for the vendor.
|
||||||
|
@param Attributes Attributes bitmask to set for the variable.
|
||||||
|
@param DataSize The size in bytes of the Data buffer. Unless the EFI_VARIABLE_APPEND_WRITE,
|
||||||
|
EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS, 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).
|
||||||
|
@param Data The contents for the variable.
|
||||||
|
|
||||||
|
@retval EFI_SUCCESS The firmware has successfully stored the variable and its data as
|
||||||
|
defined by the Attributes.
|
||||||
|
@retval EFI_INVALID_PARAMETER An invalid combination of attribute bits, name, and GUID was supplied, or the
|
||||||
|
DataSize exceeds the maximum allowed.
|
||||||
|
@retval EFI_INVALID_PARAMETER VariableName is an empty string.
|
||||||
|
@retval EFI_OUT_OF_RESOURCES Not enough storage is available to hold the variable and its data.
|
||||||
|
@retval EFI_DEVICE_ERROR The variable could not be retrieved due to a hardware error.
|
||||||
|
@retval EFI_WRITE_PROTECTED The variable in question is read-only.
|
||||||
|
@retval EFI_WRITE_PROTECTED The variable in question cannot be deleted.
|
||||||
|
@retval EFI_SECURITY_VIOLATION The variable could not be written due to EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS
|
||||||
|
or EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACESS being set, but the AuthInfo
|
||||||
|
does NOT pass the validation check carried out by the firmware.
|
||||||
|
|
||||||
|
@retval EFI_NOT_FOUND The variable trying to be updated or deleted was not found.
|
||||||
|
**/
|
||||||
|
EFI_STATUS
|
||||||
|
SetVariableAndReportStatusCodeOnError (
|
||||||
|
IN CHAR16 *VariableName,
|
||||||
|
IN EFI_GUID *VendorGuid,
|
||||||
|
IN UINT32 Attributes,
|
||||||
|
IN UINTN DataSize,
|
||||||
|
IN VOID *Data
|
||||||
|
);
|
||||||
|
|
||||||
#endif // _BDS_LIB_H_
|
#endif // _BDS_LIB_H_
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/** @file
|
/** @file
|
||||||
Head file for BDS Architectural Protocol implementation
|
Head file for BDS Architectural Protocol implementation
|
||||||
|
|
||||||
Copyright (c) 2004 - 2013, Intel Corporation. All rights reserved.<BR>
|
Copyright (c) 2004 - 2014, Intel Corporation. All rights reserved.<BR>
|
||||||
This program and the accompanying materials
|
This program and the accompanying materials
|
||||||
are licensed and made available under the terms and conditions of the BSD License
|
are licensed and made available under the terms and conditions of the BSD License
|
||||||
which accompanies this distribution. The full text of the license may be found at
|
which accompanies this distribution. The full text of the license may be found at
|
||||||
@ -20,6 +20,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|||||||
#include <Guid/MdeModuleHii.h>
|
#include <Guid/MdeModuleHii.h>
|
||||||
#include <Guid/FileSystemVolumeLabelInfo.h>
|
#include <Guid/FileSystemVolumeLabelInfo.h>
|
||||||
#include <Guid/HiiPlatformSetupFormset.h>
|
#include <Guid/HiiPlatformSetupFormset.h>
|
||||||
|
#include <Guid/StatusCodeDataTypeVariable.h>
|
||||||
#include <Protocol/DevicePath.h>
|
#include <Protocol/DevicePath.h>
|
||||||
#include <IndustryStandard/SmBios.h>
|
#include <IndustryStandard/SmBios.h>
|
||||||
#include <Protocol/LoadFile.h>
|
#include <Protocol/LoadFile.h>
|
||||||
@ -189,4 +190,48 @@ BdsProcessCapsules (
|
|||||||
EFI_BOOT_MODE BootMode
|
EFI_BOOT_MODE BootMode
|
||||||
);
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
Set the variable and report the error through status code upon failure.
|
||||||
|
|
||||||
|
@param 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.
|
||||||
|
@param VendorGuid A unique identifier for the vendor.
|
||||||
|
@param Attributes Attributes bitmask to set for the variable.
|
||||||
|
@param DataSize The size in bytes of the Data buffer. Unless the EFI_VARIABLE_APPEND_WRITE,
|
||||||
|
EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS, 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).
|
||||||
|
@param Data The contents for the variable.
|
||||||
|
|
||||||
|
@retval EFI_SUCCESS The firmware has successfully stored the variable and its data as
|
||||||
|
defined by the Attributes.
|
||||||
|
@retval EFI_INVALID_PARAMETER An invalid combination of attribute bits, name, and GUID was supplied, or the
|
||||||
|
DataSize exceeds the maximum allowed.
|
||||||
|
@retval EFI_INVALID_PARAMETER VariableName is an empty string.
|
||||||
|
@retval EFI_OUT_OF_RESOURCES Not enough storage is available to hold the variable and its data.
|
||||||
|
@retval EFI_DEVICE_ERROR The variable could not be retrieved due to a hardware error.
|
||||||
|
@retval EFI_WRITE_PROTECTED The variable in question is read-only.
|
||||||
|
@retval EFI_WRITE_PROTECTED The variable in question cannot be deleted.
|
||||||
|
@retval EFI_SECURITY_VIOLATION The variable could not be written due to EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS
|
||||||
|
or EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACESS being set, but the AuthInfo
|
||||||
|
does NOT pass the validation check carried out by the firmware.
|
||||||
|
|
||||||
|
@retval EFI_NOT_FOUND The variable trying to be updated or deleted was not found.
|
||||||
|
**/
|
||||||
|
EFI_STATUS
|
||||||
|
BdsDxeSetVariableAndReportStatusCodeOnError (
|
||||||
|
IN CHAR16 *VariableName,
|
||||||
|
IN EFI_GUID *VendorGuid,
|
||||||
|
IN UINT32 Attributes,
|
||||||
|
IN UINTN DataSize,
|
||||||
|
IN VOID *Data
|
||||||
|
);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
# BDSDxe also maintain the UI for "Boot Manager, Boot Maintaince Manager, Device Manager" which
|
# BDSDxe also maintain the UI for "Boot Manager, Boot Maintaince Manager, Device Manager" which
|
||||||
# is used for user to configure boot option or maintain hardware device.
|
# is used for user to configure boot option or maintain hardware device.
|
||||||
#
|
#
|
||||||
# Copyright (c) 2008 - 2013, Intel Corporation. All rights reserved.<BR>
|
# Copyright (c) 2008 - 2014, Intel Corporation. All rights reserved.<BR>
|
||||||
# This program and the accompanying materials
|
# This program and the accompanying materials
|
||||||
# are licensed and made available under the terms and conditions of the BSD License
|
# are licensed and made available under the terms and conditions of the BSD License
|
||||||
# which accompanies this distribution. The full text of the license may be found at
|
# which accompanies this distribution. The full text of the license may be found at
|
||||||
@ -142,6 +142,7 @@
|
|||||||
gDriverHealthFormSetGuid ## SOMETIMES_PRODUCES ## DriverHealth HII Package
|
gDriverHealthFormSetGuid ## SOMETIMES_PRODUCES ## DriverHealth HII Package
|
||||||
gConnectConInEventGuid ## CONSUMES ## GUID (Connect ConIn Event)
|
gConnectConInEventGuid ## CONSUMES ## GUID (Connect ConIn Event)
|
||||||
gEfiFmpCapsuleGuid ## CONSUMES ## GUID (FMP Capsule)
|
gEfiFmpCapsuleGuid ## CONSUMES ## GUID (FMP Capsule)
|
||||||
|
gEdkiiStatusCodeDataTypeVariableGuid ## SOMETIMES_CONSUMES
|
||||||
|
|
||||||
[Protocols]
|
[Protocols]
|
||||||
gEfiSimpleFileSystemProtocolGuid ## PROTOCOL CONSUMES
|
gEfiSimpleFileSystemProtocolGuid ## PROTOCOL CONSUMES
|
||||||
@ -188,6 +189,7 @@
|
|||||||
gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdSetupVideoHorizontalResolution
|
gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdSetupVideoHorizontalResolution
|
||||||
gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdSetupVideoVerticalResolution
|
gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdSetupVideoVerticalResolution
|
||||||
gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdShellFile
|
gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdShellFile
|
||||||
|
gEfiMdeModulePkgTokenSpaceGuid.PcdErrorCodeSetVariable
|
||||||
|
|
||||||
[Depex]
|
[Depex]
|
||||||
TRUE
|
TRUE
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
After DxeCore finish DXE phase, gEfiBdsArchProtocolGuid->BdsEntry will be invoked
|
After DxeCore finish DXE phase, gEfiBdsArchProtocolGuid->BdsEntry will be invoked
|
||||||
to enter BDS phase.
|
to enter BDS phase.
|
||||||
|
|
||||||
Copyright (c) 2004 - 2013, Intel Corporation. All rights reserved.<BR>
|
Copyright (c) 2004 - 2014, Intel Corporation. All rights reserved.<BR>
|
||||||
This program and the accompanying materials
|
This program and the accompanying materials
|
||||||
are licensed and made available under the terms and conditions of the BSD License
|
are licensed and made available under the terms and conditions of the BSD License
|
||||||
which accompanies this distribution. The full text of the license may be found at
|
which accompanies this distribution. The full text of the license may be found at
|
||||||
@ -164,13 +164,17 @@ BdsBootDeviceSelect (
|
|||||||
//
|
//
|
||||||
// Clear the this variable so it's only exist in this time boot
|
// Clear the this variable so it's only exist in this time boot
|
||||||
//
|
//
|
||||||
gRT->SetVariable (
|
Status = gRT->SetVariable (
|
||||||
L"BootNext",
|
L"BootNext",
|
||||||
&gEfiGlobalVariableGuid,
|
&gEfiGlobalVariableGuid,
|
||||||
EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_NON_VOLATILE,
|
EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_NON_VOLATILE,
|
||||||
0,
|
0,
|
||||||
mBootNext
|
NULL
|
||||||
);
|
);
|
||||||
|
//
|
||||||
|
// Deleting variable with current variable implementation shouldn't fail.
|
||||||
|
//
|
||||||
|
ASSERT_EFI_ERROR (Status);
|
||||||
|
|
||||||
//
|
//
|
||||||
// Add the boot next boot option
|
// Add the boot next boot option
|
||||||
@ -368,6 +372,9 @@ BdsFormalizeConsoleVariable (
|
|||||||
0,
|
0,
|
||||||
NULL
|
NULL
|
||||||
);
|
);
|
||||||
|
//
|
||||||
|
// Deleting variable with current variable implementation shouldn't fail.
|
||||||
|
//
|
||||||
ASSERT_EFI_ERROR (Status);
|
ASSERT_EFI_ERROR (Status);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -406,14 +413,13 @@ BdsFormalizeEfiGlobalVariable (
|
|||||||
OsIndicationSupport = EFI_OS_INDICATIONS_BOOT_TO_FW_UI \
|
OsIndicationSupport = EFI_OS_INDICATIONS_BOOT_TO_FW_UI \
|
||||||
| EFI_OS_INDICATIONS_FMP_CAPSULE_SUPPORTED;
|
| EFI_OS_INDICATIONS_FMP_CAPSULE_SUPPORTED;
|
||||||
|
|
||||||
Status = gRT->SetVariable (
|
BdsDxeSetVariableAndReportStatusCodeOnError (
|
||||||
L"OsIndicationsSupported",
|
L"OsIndicationsSupported",
|
||||||
&gEfiGlobalVariableGuid,
|
&gEfiGlobalVariableGuid,
|
||||||
EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,
|
EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,
|
||||||
sizeof(UINT64),
|
sizeof(UINT64),
|
||||||
&OsIndicationSupport
|
&OsIndicationSupport
|
||||||
);
|
);
|
||||||
ASSERT_EFI_ERROR (Status);
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// If OsIndications is invalid, remove it.
|
// If OsIndications is invalid, remove it.
|
||||||
@ -442,10 +448,13 @@ BdsFormalizeEfiGlobalVariable (
|
|||||||
Status = gRT->SetVariable (
|
Status = gRT->SetVariable (
|
||||||
L"OsIndications",
|
L"OsIndications",
|
||||||
&gEfiGlobalVariableGuid,
|
&gEfiGlobalVariableGuid,
|
||||||
Attributes,
|
|
||||||
0,
|
0,
|
||||||
&OsIndication
|
0,
|
||||||
|
NULL
|
||||||
);
|
);
|
||||||
|
//
|
||||||
|
// Deleting variable with current variable implementation shouldn't fail.
|
||||||
|
//
|
||||||
ASSERT_EFI_ERROR (Status);
|
ASSERT_EFI_ERROR (Status);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -481,16 +490,19 @@ BdsAllocateMemoryForPerformanceData (
|
|||||||
//
|
//
|
||||||
// Save the pointer to variable for use in S3 resume.
|
// Save the pointer to variable for use in S3 resume.
|
||||||
//
|
//
|
||||||
Status = gRT->SetVariable (
|
BdsDxeSetVariableAndReportStatusCodeOnError (
|
||||||
L"PerfDataMemAddr",
|
L"PerfDataMemAddr",
|
||||||
&gPerformanceProtocolGuid,
|
&gPerformanceProtocolGuid,
|
||||||
EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,
|
EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,
|
||||||
sizeof (EFI_PHYSICAL_ADDRESS),
|
sizeof (EFI_PHYSICAL_ADDRESS),
|
||||||
&AcpiLowMemoryBase
|
&AcpiLowMemoryBase
|
||||||
);
|
);
|
||||||
ASSERT_EFI_ERROR (Status);
|
if (EFI_ERROR (Status)) {
|
||||||
|
DEBUG ((EFI_D_ERROR, "[Bds] PerfDataMemAddr (%08x) cannot be saved to NV storage.\n", AcpiLowMemoryBase));
|
||||||
|
}
|
||||||
//
|
//
|
||||||
// Mark L"PerfDataMemAddr" variable to read-only if the Variable Lock protocol exists
|
// Mark L"PerfDataMemAddr" variable to read-only if the Variable Lock protocol exists
|
||||||
|
// Still lock it even the variable cannot be saved to prevent it's set by 3rd party code.
|
||||||
//
|
//
|
||||||
Status = gBS->LocateProtocol (&gEdkiiVariableLockProtocolGuid, NULL, (VOID **) &VariableLock);
|
Status = gBS->LocateProtocol (&gEdkiiVariableLockProtocolGuid, NULL, (VOID **) &VariableLock);
|
||||||
if (!EFI_ERROR (Status)) {
|
if (!EFI_ERROR (Status)) {
|
||||||
@ -594,14 +606,13 @@ BdsEntry (
|
|||||||
// If time out value equal 0xFFFF, no need set to 0xFFFF to variable area because UEFI specification
|
// If time out value equal 0xFFFF, no need set to 0xFFFF to variable area because UEFI specification
|
||||||
// define same behavior between no value or 0xFFFF value for L"Timeout".
|
// define same behavior between no value or 0xFFFF value for L"Timeout".
|
||||||
//
|
//
|
||||||
Status = gRT->SetVariable (
|
BdsDxeSetVariableAndReportStatusCodeOnError (
|
||||||
L"Timeout",
|
L"Timeout",
|
||||||
&gEfiGlobalVariableGuid,
|
&gEfiGlobalVariableGuid,
|
||||||
EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_NON_VOLATILE,
|
EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_NON_VOLATILE,
|
||||||
sizeof (UINT16),
|
sizeof (UINT16),
|
||||||
&BootTimeOut
|
&BootTimeOut
|
||||||
);
|
);
|
||||||
ASSERT_EFI_ERROR(Status);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
@ -655,3 +666,89 @@ BdsEntry (
|
|||||||
|
|
||||||
return ;
|
return ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
Set the variable and report the error through status code upon failure.
|
||||||
|
|
||||||
|
@param 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.
|
||||||
|
@param VendorGuid A unique identifier for the vendor.
|
||||||
|
@param Attributes Attributes bitmask to set for the variable.
|
||||||
|
@param DataSize The size in bytes of the Data buffer. Unless the EFI_VARIABLE_APPEND_WRITE,
|
||||||
|
EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS, 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).
|
||||||
|
@param Data The contents for the variable.
|
||||||
|
|
||||||
|
@retval EFI_SUCCESS The firmware has successfully stored the variable and its data as
|
||||||
|
defined by the Attributes.
|
||||||
|
@retval EFI_INVALID_PARAMETER An invalid combination of attribute bits, name, and GUID was supplied, or the
|
||||||
|
DataSize exceeds the maximum allowed.
|
||||||
|
@retval EFI_INVALID_PARAMETER VariableName is an empty string.
|
||||||
|
@retval EFI_OUT_OF_RESOURCES Not enough storage is available to hold the variable and its data.
|
||||||
|
@retval EFI_DEVICE_ERROR The variable could not be retrieved due to a hardware error.
|
||||||
|
@retval EFI_WRITE_PROTECTED The variable in question is read-only.
|
||||||
|
@retval EFI_WRITE_PROTECTED The variable in question cannot be deleted.
|
||||||
|
@retval EFI_SECURITY_VIOLATION The variable could not be written due to EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS
|
||||||
|
or EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACESS being set, but the AuthInfo
|
||||||
|
does NOT pass the validation check carried out by the firmware.
|
||||||
|
|
||||||
|
@retval EFI_NOT_FOUND The variable trying to be updated or deleted was not found.
|
||||||
|
**/
|
||||||
|
EFI_STATUS
|
||||||
|
BdsDxeSetVariableAndReportStatusCodeOnError (
|
||||||
|
IN CHAR16 *VariableName,
|
||||||
|
IN EFI_GUID *VendorGuid,
|
||||||
|
IN UINT32 Attributes,
|
||||||
|
IN UINTN DataSize,
|
||||||
|
IN VOID *Data
|
||||||
|
)
|
||||||
|
{
|
||||||
|
EFI_STATUS Status;
|
||||||
|
EDKII_SET_VARIABLE_STATUS *SetVariableStatus;
|
||||||
|
UINTN NameSize;
|
||||||
|
|
||||||
|
Status = gRT->SetVariable (
|
||||||
|
VariableName,
|
||||||
|
VendorGuid,
|
||||||
|
Attributes,
|
||||||
|
DataSize,
|
||||||
|
Data
|
||||||
|
);
|
||||||
|
if (EFI_ERROR (Status)) {
|
||||||
|
NameSize = StrSize (VariableName);
|
||||||
|
SetVariableStatus = AllocatePool (sizeof (EDKII_SET_VARIABLE_STATUS) + NameSize + DataSize);
|
||||||
|
if (SetVariableStatus != NULL) {
|
||||||
|
CopyGuid (&SetVariableStatus->Guid, VendorGuid);
|
||||||
|
SetVariableStatus->NameSize = NameSize;
|
||||||
|
SetVariableStatus->DataSize = DataSize;
|
||||||
|
SetVariableStatus->SetStatus = Status;
|
||||||
|
SetVariableStatus->Attributes = Attributes;
|
||||||
|
CopyMem (SetVariableStatus + 1, VariableName, NameSize);
|
||||||
|
CopyMem (((UINT8 *) (SetVariableStatus + 1)) + NameSize, Data, DataSize);
|
||||||
|
|
||||||
|
REPORT_STATUS_CODE_EX (
|
||||||
|
EFI_ERROR_CODE,
|
||||||
|
PcdGet32 (PcdErrorCodeSetVariable),
|
||||||
|
0,
|
||||||
|
NULL,
|
||||||
|
&gEdkiiStatusCodeDataTypeVariableGuid,
|
||||||
|
SetVariableStatus,
|
||||||
|
sizeof (EDKII_SET_VARIABLE_STATUS) + NameSize + DataSize
|
||||||
|
);
|
||||||
|
|
||||||
|
FreePool (SetVariableStatus);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return Status;
|
||||||
|
}
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
and manage the legacy boot option, all legacy boot option is getting from
|
and manage the legacy boot option, all legacy boot option is getting from
|
||||||
the legacy BBS table.
|
the legacy BBS table.
|
||||||
|
|
||||||
Copyright (c) 2004 - 2012, Intel Corporation. All rights reserved.<BR>
|
Copyright (c) 2004 - 2014, Intel Corporation. All rights reserved.<BR>
|
||||||
This program and the accompanying materials
|
This program and the accompanying materials
|
||||||
are licensed and made available under the terms and conditions of the BSD License
|
are licensed and made available under the terms and conditions of the BSD License
|
||||||
which accompanies this distribution. The full text of the license may be found at
|
which accompanies this distribution. The full text of the license may be found at
|
||||||
@ -143,6 +143,9 @@ OrderLegacyBootOption4SameType (
|
|||||||
BootOrderSize,
|
BootOrderSize,
|
||||||
BootOrder
|
BootOrder
|
||||||
);
|
);
|
||||||
|
//
|
||||||
|
// Changing content without increasing its size with current variable implementation shouldn't fail.
|
||||||
|
//
|
||||||
ASSERT_EFI_ERROR (Status);
|
ASSERT_EFI_ERROR (Status);
|
||||||
|
|
||||||
FreePool (NewBootOption);
|
FreePool (NewBootOption);
|
||||||
@ -171,6 +174,7 @@ GroupMultipleLegacyBootOption4SameType (
|
|||||||
VOID
|
VOID
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
EFI_STATUS Status;
|
||||||
UINTN Index;
|
UINTN Index;
|
||||||
UINTN DeviceIndex;
|
UINTN DeviceIndex;
|
||||||
UINTN DeviceTypeIndex[7];
|
UINTN DeviceTypeIndex[7];
|
||||||
@ -233,13 +237,17 @@ GroupMultipleLegacyBootOption4SameType (
|
|||||||
FreePool (BootOption);
|
FreePool (BootOption);
|
||||||
}
|
}
|
||||||
|
|
||||||
gRT->SetVariable (
|
Status = gRT->SetVariable (
|
||||||
L"BootOrder",
|
L"BootOrder",
|
||||||
&gEfiGlobalVariableGuid,
|
&gEfiGlobalVariableGuid,
|
||||||
EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_NON_VOLATILE,
|
EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_NON_VOLATILE,
|
||||||
BootOrderSize,
|
BootOrderSize,
|
||||||
BootOrder
|
BootOrder
|
||||||
);
|
);
|
||||||
|
//
|
||||||
|
// Changing content without increasing its size with current variable implementation shouldn't fail.
|
||||||
|
//
|
||||||
|
ASSERT_EFI_ERROR (Status);
|
||||||
FreePool (BootOrder);
|
FreePool (BootOrder);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/** @file
|
/** @file
|
||||||
Utility routines used by boot maintenance modules.
|
Utility routines used by boot maintenance modules.
|
||||||
|
|
||||||
Copyright (c) 2004 - 2012, Intel Corporation. All rights reserved.<BR>
|
Copyright (c) 2004 - 2014, Intel Corporation. All rights reserved.<BR>
|
||||||
This program and the accompanying materials
|
This program and the accompanying materials
|
||||||
are licensed and made available under the terms and conditions of the BSD License
|
are licensed and made available under the terms and conditions of the BSD License
|
||||||
which accompanies this distribution. The full text of the license may be found at
|
which accompanies this distribution. The full text of the license may be found at
|
||||||
@ -178,7 +178,10 @@ EfiLibDeleteVariable (
|
|||||||
0,
|
0,
|
||||||
NULL
|
NULL
|
||||||
);
|
);
|
||||||
ASSERT (!EFI_ERROR (Status));
|
//
|
||||||
|
// Deleting variable with current variable implementation shouldn't fail.
|
||||||
|
//
|
||||||
|
ASSERT_EFI_ERROR (Status);
|
||||||
FreePool (VarBuf);
|
FreePool (VarBuf);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/** @file
|
/** @file
|
||||||
The functions for Boot Maintainence Main menu.
|
The functions for Boot Maintainence Main menu.
|
||||||
|
|
||||||
Copyright (c) 2004 - 2013, Intel Corporation. All rights reserved.<BR>
|
Copyright (c) 2004 - 2014, Intel Corporation. All rights reserved.<BR>
|
||||||
This program and the accompanying materials
|
This program and the accompanying materials
|
||||||
are licensed and made available under the terms and conditions of the BSD License
|
are licensed and made available under the terms and conditions of the BSD License
|
||||||
which accompanies this distribution. The full text of the license may be found at
|
which accompanies this distribution. The full text of the license may be found at
|
||||||
@ -672,14 +672,13 @@ ApplyChangeHandler (
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case FORM_TIME_OUT_ID:
|
case FORM_TIME_OUT_ID:
|
||||||
Status = gRT->SetVariable (
|
BdsDxeSetVariableAndReportStatusCodeOnError (
|
||||||
L"Timeout",
|
L"Timeout",
|
||||||
&gEfiGlobalVariableGuid,
|
&gEfiGlobalVariableGuid,
|
||||||
EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_NON_VOLATILE,
|
EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_NON_VOLATILE,
|
||||||
sizeof (UINT16),
|
sizeof (UINT16),
|
||||||
&(CurrentFakeNVMap->BootTimeOut)
|
&(CurrentFakeNVMap->BootTimeOut)
|
||||||
);
|
);
|
||||||
ASSERT_EFI_ERROR(Status);
|
|
||||||
|
|
||||||
Private->BmmOldFakeNVData.BootTimeOut = CurrentFakeNVMap->BootTimeOut;
|
Private->BmmOldFakeNVData.BootTimeOut = CurrentFakeNVMap->BootTimeOut;
|
||||||
break;
|
break;
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/** @file
|
/** @file
|
||||||
Variable operation that will be used by bootmaint
|
Variable operation that will be used by bootmaint
|
||||||
|
|
||||||
Copyright (c) 2004 - 2012, Intel Corporation. All rights reserved.<BR>
|
Copyright (c) 2004 - 2014, Intel Corporation. All rights reserved.<BR>
|
||||||
This program and the accompanying materials
|
This program and the accompanying materials
|
||||||
are licensed and made available under the terms and conditions of the BSD License
|
are licensed and made available under the terms and conditions of the BSD License
|
||||||
which accompanies this distribution. The full text of the license may be found at
|
which accompanies this distribution. The full text of the license may be found at
|
||||||
@ -165,9 +165,10 @@ Var_ChangeBootOrder (
|
|||||||
BootOrderListSize * sizeof (UINT16),
|
BootOrderListSize * sizeof (UINT16),
|
||||||
BootOrderList
|
BootOrderList
|
||||||
);
|
);
|
||||||
if (EFI_ERROR (Status)) {
|
//
|
||||||
return Status;
|
// Changing variable without increasing its size with current variable implementation shouldn't fail.
|
||||||
}
|
//
|
||||||
|
ASSERT_EFI_ERROR (Status);
|
||||||
}
|
}
|
||||||
return EFI_SUCCESS;
|
return EFI_SUCCESS;
|
||||||
}
|
}
|
||||||
@ -303,9 +304,10 @@ Var_ChangeDriverOrder (
|
|||||||
DriverOrderListSize * sizeof (UINT16),
|
DriverOrderListSize * sizeof (UINT16),
|
||||||
DriverOrderList
|
DriverOrderList
|
||||||
);
|
);
|
||||||
if (EFI_ERROR (Status)) {
|
//
|
||||||
return Status;
|
// Changing variable without increasing its size with current variable implementation shouldn't fail.
|
||||||
}
|
//
|
||||||
|
ASSERT_EFI_ERROR (Status);
|
||||||
}
|
}
|
||||||
return EFI_SUCCESS;
|
return EFI_SUCCESS;
|
||||||
}
|
}
|
||||||
@ -338,7 +340,10 @@ Var_UpdateAllConsoleOption (
|
|||||||
GetDevicePathSize (OutDevicePath),
|
GetDevicePathSize (OutDevicePath),
|
||||||
OutDevicePath
|
OutDevicePath
|
||||||
);
|
);
|
||||||
ASSERT (!EFI_ERROR (Status));
|
//
|
||||||
|
// Changing variable without increasing its size with current variable implementation shouldn't fail.
|
||||||
|
//
|
||||||
|
ASSERT_EFI_ERROR (Status);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (InpDevicePath != NULL) {
|
if (InpDevicePath != NULL) {
|
||||||
@ -350,7 +355,10 @@ Var_UpdateAllConsoleOption (
|
|||||||
GetDevicePathSize (InpDevicePath),
|
GetDevicePathSize (InpDevicePath),
|
||||||
InpDevicePath
|
InpDevicePath
|
||||||
);
|
);
|
||||||
ASSERT (!EFI_ERROR (Status));
|
//
|
||||||
|
// Changing variable without increasing its size with current variable implementation shouldn't fail.
|
||||||
|
//
|
||||||
|
ASSERT_EFI_ERROR (Status);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ErrDevicePath != NULL) {
|
if (ErrDevicePath != NULL) {
|
||||||
@ -362,7 +370,10 @@ Var_UpdateAllConsoleOption (
|
|||||||
GetDevicePathSize (ErrDevicePath),
|
GetDevicePathSize (ErrDevicePath),
|
||||||
ErrDevicePath
|
ErrDevicePath
|
||||||
);
|
);
|
||||||
ASSERT (!EFI_ERROR (Status));
|
//
|
||||||
|
// Changing variable without increasing its size with current variable implementation shouldn't fail.
|
||||||
|
//
|
||||||
|
ASSERT_EFI_ERROR (Status);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -667,7 +678,7 @@ Var_UpdateDriverOption (
|
|||||||
BufferSize,
|
BufferSize,
|
||||||
Buffer
|
Buffer
|
||||||
);
|
);
|
||||||
ASSERT_EFI_ERROR (Status);
|
if (!EFI_ERROR (Status)) {
|
||||||
DriverOrderList = BdsLibGetVariableAndSize (
|
DriverOrderList = BdsLibGetVariableAndSize (
|
||||||
L"DriverOrder",
|
L"DriverOrder",
|
||||||
&gEfiGlobalVariableGuid,
|
&gEfiGlobalVariableGuid,
|
||||||
@ -688,17 +699,19 @@ Var_UpdateDriverOption (
|
|||||||
DriverOrderListSize + sizeof (UINT16),
|
DriverOrderListSize + sizeof (UINT16),
|
||||||
NewDriverOrderList
|
NewDriverOrderList
|
||||||
);
|
);
|
||||||
ASSERT_EFI_ERROR (Status);
|
|
||||||
if (DriverOrderList != NULL) {
|
if (DriverOrderList != NULL) {
|
||||||
FreePool (DriverOrderList);
|
FreePool (DriverOrderList);
|
||||||
}
|
}
|
||||||
DriverOrderList = NULL;
|
DriverOrderList = NULL;
|
||||||
FreePool (NewDriverOrderList);
|
FreePool (NewDriverOrderList);
|
||||||
|
if (!EFI_ERROR (Status)) {
|
||||||
InsertTailList (&DriverOptionMenu.Head, &NewMenuEntry->Link);
|
InsertTailList (&DriverOptionMenu.Head, &NewMenuEntry->Link);
|
||||||
DriverOptionMenu.MenuNumber++;
|
DriverOptionMenu.MenuNumber++;
|
||||||
|
|
||||||
*DescriptionData = 0x0000;
|
*DescriptionData = 0x0000;
|
||||||
*OptionalData = 0x0000;
|
*OptionalData = 0x0000;
|
||||||
|
}
|
||||||
|
}
|
||||||
return EFI_SUCCESS;
|
return EFI_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -835,7 +848,7 @@ Var_UpdateBootOption (
|
|||||||
BufferSize,
|
BufferSize,
|
||||||
Buffer
|
Buffer
|
||||||
);
|
);
|
||||||
ASSERT_EFI_ERROR (Status);
|
if (!EFI_ERROR (Status)) {
|
||||||
|
|
||||||
BootOrderList = BdsLibGetVariableAndSize (
|
BootOrderList = BdsLibGetVariableAndSize (
|
||||||
L"BootOrder",
|
L"BootOrder",
|
||||||
@ -859,7 +872,7 @@ Var_UpdateBootOption (
|
|||||||
BootOrderListSize + sizeof (UINT16),
|
BootOrderListSize + sizeof (UINT16),
|
||||||
NewBootOrderList
|
NewBootOrderList
|
||||||
);
|
);
|
||||||
ASSERT_EFI_ERROR (Status);
|
if (!EFI_ERROR (Status)) {
|
||||||
|
|
||||||
FreePool (NewBootOrderList);
|
FreePool (NewBootOrderList);
|
||||||
NewBootOrderList = NULL;
|
NewBootOrderList = NULL;
|
||||||
@ -868,6 +881,8 @@ Var_UpdateBootOption (
|
|||||||
|
|
||||||
NvRamMap->DescriptionData[0] = 0x0000;
|
NvRamMap->DescriptionData[0] = 0x0000;
|
||||||
NvRamMap->OptionalData[0] = 0x0000;
|
NvRamMap->OptionalData[0] = 0x0000;
|
||||||
|
}
|
||||||
|
}
|
||||||
return EFI_SUCCESS;
|
return EFI_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -987,6 +1002,10 @@ Var_UpdateBootOrder (
|
|||||||
BootOrderListSize,
|
BootOrderListSize,
|
||||||
BootOrderList
|
BootOrderList
|
||||||
);
|
);
|
||||||
|
//
|
||||||
|
// Changing the content without increasing its size with current variable implementation shouldn't fail.
|
||||||
|
//
|
||||||
|
ASSERT_EFI_ERROR (Status);
|
||||||
FreePool (BootOrderList);
|
FreePool (BootOrderList);
|
||||||
|
|
||||||
GroupMultipleLegacyBootOption4SameType ();
|
GroupMultipleLegacyBootOption4SameType ();
|
||||||
@ -1058,9 +1077,10 @@ Var_UpdateDriverOrder (
|
|||||||
DriverOrderListSize,
|
DriverOrderListSize,
|
||||||
NewDriverOrderList
|
NewDriverOrderList
|
||||||
);
|
);
|
||||||
if (EFI_ERROR (Status)) {
|
//
|
||||||
return Status;
|
// Changing the content without increasing its size with current variable implementation shouldn't fail.
|
||||||
}
|
//
|
||||||
|
ASSERT_EFI_ERROR (Status);
|
||||||
|
|
||||||
BOpt_FreeMenu (&DriverOptionMenu);
|
BOpt_FreeMenu (&DriverOptionMenu);
|
||||||
BOpt_GetDriverOptions (CallbackData);
|
BOpt_GetDriverOptions (CallbackData);
|
||||||
@ -1258,6 +1278,10 @@ Var_UpdateBBSOption (
|
|||||||
OptionSize,
|
OptionSize,
|
||||||
BootOptionVar
|
BootOptionVar
|
||||||
);
|
);
|
||||||
|
//
|
||||||
|
// Changing the content without increasing its size with current variable implementation shouldn't fail.
|
||||||
|
//
|
||||||
|
ASSERT_EFI_ERROR (Status);
|
||||||
|
|
||||||
FreePool (BootOptionVar);
|
FreePool (BootOptionVar);
|
||||||
}
|
}
|
||||||
@ -1281,6 +1305,10 @@ Var_UpdateBBSOption (
|
|||||||
OptionSize,
|
OptionSize,
|
||||||
BootOptionVar
|
BootOptionVar
|
||||||
);
|
);
|
||||||
|
//
|
||||||
|
// Changing the content without increasing its size with current variable implementation shouldn't fail.
|
||||||
|
//
|
||||||
|
ASSERT_EFI_ERROR (Status);
|
||||||
|
|
||||||
FreePool (BootOptionVar);
|
FreePool (BootOptionVar);
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/** @file
|
/** @file
|
||||||
FrontPage routines to handle the callbacks and browser calls
|
FrontPage routines to handle the callbacks and browser calls
|
||||||
|
|
||||||
Copyright (c) 2004 - 2013, Intel Corporation. All rights reserved.<BR>
|
Copyright (c) 2004 - 2014, Intel Corporation. All rights reserved.<BR>
|
||||||
This program and the accompanying materials
|
This program and the accompanying materials
|
||||||
are licensed and made available under the terms and conditions of the BSD License
|
are licensed and made available under the terms and conditions of the BSD License
|
||||||
which accompanies this distribution. The full text of the license may be found at
|
which accompanies this distribution. The full text of the license may be found at
|
||||||
@ -182,7 +182,6 @@ FrontPageCallback (
|
|||||||
CHAR8 *LangCode;
|
CHAR8 *LangCode;
|
||||||
CHAR8 *Lang;
|
CHAR8 *Lang;
|
||||||
UINTN Index;
|
UINTN Index;
|
||||||
EFI_STATUS Status;
|
|
||||||
|
|
||||||
if (Action != EFI_BROWSER_ACTION_CHANGING && Action != EFI_BROWSER_ACTION_CHANGED) {
|
if (Action != EFI_BROWSER_ACTION_CHANGING && Action != EFI_BROWSER_ACTION_CHANGED) {
|
||||||
//
|
//
|
||||||
@ -226,14 +225,13 @@ FrontPageCallback (
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (Index == Value->u8) {
|
if (Index == Value->u8) {
|
||||||
Status = gRT->SetVariable (
|
BdsDxeSetVariableAndReportStatusCodeOnError (
|
||||||
L"PlatformLang",
|
L"PlatformLang",
|
||||||
&gEfiGlobalVariableGuid,
|
&gEfiGlobalVariableGuid,
|
||||||
EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,
|
EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,
|
||||||
AsciiStrSize (Lang),
|
AsciiStrSize (Lang),
|
||||||
Lang
|
Lang
|
||||||
);
|
);
|
||||||
ASSERT_EFI_ERROR(Status);
|
|
||||||
} else {
|
} else {
|
||||||
ASSERT (FALSE);
|
ASSERT (FALSE);
|
||||||
}
|
}
|
||||||
@ -1095,6 +1093,9 @@ PlatformBdsEnterFrontPage (
|
|||||||
sizeof(UINT64),
|
sizeof(UINT64),
|
||||||
&OsIndication
|
&OsIndication
|
||||||
);
|
);
|
||||||
|
//
|
||||||
|
// Changing the content without increasing its size with current variable implementation shouldn't fail.
|
||||||
|
//
|
||||||
ASSERT_EFI_ERROR (Status);
|
ASSERT_EFI_ERROR (Status);
|
||||||
|
|
||||||
//
|
//
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
Provides a way for 3rd party applications to register themselves for launch by the
|
Provides a way for 3rd party applications to register themselves for launch by the
|
||||||
Boot Manager based on hot key
|
Boot Manager based on hot key
|
||||||
|
|
||||||
Copyright (c) 2007 - 2013, Intel Corporation. All rights reserved.<BR>
|
Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR>
|
||||||
This program and the accompanying materials
|
This program and the accompanying materials
|
||||||
are licensed and made available under the terms and conditions of the BSD License
|
are licensed and made available under the terms and conditions of the BSD License
|
||||||
which accompanies this distribution. The full text of the license may be found at
|
which accompanies this distribution. The full text of the license may be found at
|
||||||
@ -550,6 +550,9 @@ InitializeHotkeyService (
|
|||||||
sizeof (UINT32),
|
sizeof (UINT32),
|
||||||
&BootOptionSupport
|
&BootOptionSupport
|
||||||
);
|
);
|
||||||
|
//
|
||||||
|
// Platform needs to make sure setting volatile variable before calling 3rd party code shouldn't fail.
|
||||||
|
//
|
||||||
ASSERT_EFI_ERROR (Status);
|
ASSERT_EFI_ERROR (Status);
|
||||||
|
|
||||||
KeyOptionNumbers = HotkeyGetOptionNumbers (&KeyOptionCount);
|
KeyOptionNumbers = HotkeyGetOptionNumbers (&KeyOptionCount);
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/** @file
|
/** @file
|
||||||
Language settings
|
Language settings
|
||||||
|
|
||||||
Copyright (c) 2004 - 2013, Intel Corporation. All rights reserved.<BR>
|
Copyright (c) 2004 - 2014, Intel Corporation. All rights reserved.<BR>
|
||||||
This program and the accompanying materials
|
This program and the accompanying materials
|
||||||
are licensed and made available under the terms and conditions of the BSD License
|
are licensed and made available under the terms and conditions of the BSD License
|
||||||
which accompanies this distribution. The full text of the license may be found at
|
which accompanies this distribution. The full text of the license may be found at
|
||||||
@ -425,7 +425,7 @@ InitializeLangVariable (
|
|||||||
// The default language code should be one of the supported language codes.
|
// The default language code should be one of the supported language codes.
|
||||||
//
|
//
|
||||||
ASSERT (IsLangInSupportedLangCodes (SupportedLang, DefaultLang, Iso639Language));
|
ASSERT (IsLangInSupportedLangCodes (SupportedLang, DefaultLang, Iso639Language));
|
||||||
Status = gRT->SetVariable (
|
BdsDxeSetVariableAndReportStatusCodeOnError (
|
||||||
LangName,
|
LangName,
|
||||||
&gEfiGlobalVariableGuid,
|
&gEfiGlobalVariableGuid,
|
||||||
EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,
|
EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,
|
||||||
@ -471,6 +471,10 @@ InitializeLanguage (
|
|||||||
AsciiStrSize (LangCodes),
|
AsciiStrSize (LangCodes),
|
||||||
LangCodes
|
LangCodes
|
||||||
);
|
);
|
||||||
|
//
|
||||||
|
// Platform needs to make sure setting volatile variable before calling 3rd party code shouldn't fail.
|
||||||
|
//
|
||||||
|
ASSERT_EFI_ERROR (Status);
|
||||||
}
|
}
|
||||||
|
|
||||||
Status = gRT->SetVariable (
|
Status = gRT->SetVariable (
|
||||||
@ -480,6 +484,10 @@ InitializeLanguage (
|
|||||||
AsciiStrSize (PlatformLangCodes),
|
AsciiStrSize (PlatformLangCodes),
|
||||||
PlatformLangCodes
|
PlatformLangCodes
|
||||||
);
|
);
|
||||||
|
//
|
||||||
|
// Platform needs to make sure setting volatile variable before calling 3rd party code shouldn't fail.
|
||||||
|
//
|
||||||
|
ASSERT_EFI_ERROR (Status);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!FeaturePcdGet (PcdUefiVariableDefaultLangDeprecate)) {
|
if (!FeaturePcdGet (PcdUefiVariableDefaultLangDeprecate)) {
|
||||||
|
40
MdeModulePkg/Include/Guid/StatusCodeDataTypeVariable.h
Normal file
40
MdeModulePkg/Include/Guid/StatusCodeDataTypeVariable.h
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
/** @file
|
||||||
|
This file defines the GUID and data structure used to pass variable setting
|
||||||
|
failure information to the Status Code Protocol.
|
||||||
|
|
||||||
|
Copyright (c) 2014, Intel Corporation. All rights reserved.<BR>
|
||||||
|
This program and the accompanying materials are licensed and made available under
|
||||||
|
the terms and conditions of the BSD License that accompanies this distribution.
|
||||||
|
The full text of the license may be found at
|
||||||
|
http://opensource.org/licenses/bsd-license.php.
|
||||||
|
|
||||||
|
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||||
|
|
||||||
|
**/
|
||||||
|
|
||||||
|
#ifndef _STATUS_CODE_DATA_TYPE_VARIABLE_H_
|
||||||
|
#define _STATUS_CODE_DATA_TYPE_VARIABLE_H_
|
||||||
|
|
||||||
|
///
|
||||||
|
/// The Global ID used to identify a structure of type EDKII_SET_VARIABLE_STATUS.
|
||||||
|
/// The status code value is PcdGet32 (PcdErrorCodeSetVariable).
|
||||||
|
///
|
||||||
|
#define EDKII_STATUS_CODE_DATA_TYPE_VARIABLE_GUID \
|
||||||
|
{ \
|
||||||
|
0xf6ee6dbb, 0xd67f, 0x4ea0, { 0x8b, 0x96, 0x6a, 0x71, 0xb1, 0x9d, 0x84, 0xad } \
|
||||||
|
}
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
EFI_GUID Guid;
|
||||||
|
UINTN NameSize;
|
||||||
|
UINTN DataSize;
|
||||||
|
EFI_STATUS SetStatus;
|
||||||
|
UINT32 Attributes;
|
||||||
|
// CHAR16 Name[];
|
||||||
|
// UINT8 Data[];
|
||||||
|
} EDKII_SET_VARIABLE_STATUS;
|
||||||
|
|
||||||
|
extern EFI_GUID gEdkiiStatusCodeDataTypeVariableGuid;
|
||||||
|
|
||||||
|
#endif // _STATUS_CODE_DATA_TYPE_VARIABLE_H_
|
@ -270,6 +270,9 @@
|
|||||||
## Include/Guid/ConnectConInEvent.h
|
## Include/Guid/ConnectConInEvent.h
|
||||||
gConnectConInEventGuid = { 0xdb4e8151, 0x57ed, 0x4bed, { 0x88, 0x33, 0x67, 0x51, 0xb5, 0xd1, 0xa8, 0xd7 }}
|
gConnectConInEventGuid = { 0xdb4e8151, 0x57ed, 0x4bed, { 0x88, 0x33, 0x67, 0x51, 0xb5, 0xd1, 0xa8, 0xd7 }}
|
||||||
|
|
||||||
|
## Include/Guid/StatusCodeDataTypeVariable.h
|
||||||
|
gEdkiiStatusCodeDataTypeVariableGuid = { 0xf6ee6dbb, 0xd67f, 0x4ea0, { 0x8b, 0x96, 0x6a, 0x71, 0xb1, 0x9d, 0x84, 0xad }}
|
||||||
|
|
||||||
[Ppis]
|
[Ppis]
|
||||||
## Include/Ppi/AtaController.h
|
## Include/Ppi/AtaController.h
|
||||||
gPeiAtaControllerPpiGuid = { 0xa45e60d1, 0xc719, 0x44aa, { 0xb0, 0x7a, 0xaa, 0x77, 0x7f, 0x85, 0x90, 0x6d }}
|
gPeiAtaControllerPpiGuid = { 0xa45e60d1, 0xc719, 0x44aa, { 0xb0, 0x7a, 0xaa, 0x77, 0x7f, 0x85, 0x90, 0x6d }}
|
||||||
@ -603,6 +606,10 @@
|
|||||||
# PROGRESS_CODE_S3_SUSPEND_END = (EFI_SOFTWARE_SMM_DRIVER | (EFI_OEM_SPECIFIC | 0x00000001)) = 0x03078001
|
# PROGRESS_CODE_S3_SUSPEND_END = (EFI_SOFTWARE_SMM_DRIVER | (EFI_OEM_SPECIFIC | 0x00000001)) = 0x03078001
|
||||||
gEfiMdeModulePkgTokenSpaceGuid.PcdProgressCodeS3SuspendEnd|0x03078001|UINT32|0x30001033
|
gEfiMdeModulePkgTokenSpaceGuid.PcdProgressCodeS3SuspendEnd|0x03078001|UINT32|0x30001033
|
||||||
|
|
||||||
|
## Error Code for SetVariable failure.
|
||||||
|
# EDKII_ERROR_CODE_SET_VARIABLE = (EFI_SOFTWARE_DXE_BS_DRIVER | (EFI_OEM_SPECIFIC | 0x00000002)) = 0x03058002
|
||||||
|
gEfiMdeModulePkgTokenSpaceGuid.PcdErrorCodeSetVariable|0x03058002|UINT32|0x30001040
|
||||||
|
|
||||||
[PcdsFixedAtBuild,PcdsPatchableInModule]
|
[PcdsFixedAtBuild,PcdsPatchableInModule]
|
||||||
## VPD type PCD allow developer point an absoluted physical address PcdVpdBaseAddress
|
## VPD type PCD allow developer point an absoluted physical address PcdVpdBaseAddress
|
||||||
# to store PCD value.
|
# to store PCD value.
|
||||||
|
Reference in New Issue
Block a user