Add new interface GetVariable2 and GetEfiGlobalVariable2 to return more info. Also replace old interface with new one.
Signed-off-by: Eric Dong <eric.dong@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13375 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
@ -1,7 +1,7 @@
|
|||||||
/** @file
|
/** @file
|
||||||
This file implements the protocol functions related to string package.
|
This file implements the protocol functions related to string package.
|
||||||
|
|
||||||
Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
|
Copyright (c) 2006 - 2012, 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
|
||||||
@ -349,7 +349,7 @@ HiiThunkGetString (
|
|||||||
//
|
//
|
||||||
// Get the current platform language setting
|
// Get the current platform language setting
|
||||||
//
|
//
|
||||||
PlatformLanguage = GetEfiGlobalVariable (L"PlatformLang");
|
GetEfiGlobalVariable2 (L"PlatformLang", &PlatformLanguage, NULL);
|
||||||
|
|
||||||
//
|
//
|
||||||
// Get the best matching language from SupportedLanguages
|
// Get the best matching language from SupportedLanguages
|
||||||
|
@ -1513,8 +1513,8 @@ BdsLibEnumerateAllBootOption (
|
|||||||
// device from the boot order variable
|
// device from the boot order variable
|
||||||
//
|
//
|
||||||
if (mEnumBootDevice) {
|
if (mEnumBootDevice) {
|
||||||
LastLang = GetVariable (LAST_ENUM_LANGUAGE_VARIABLE_NAME, &gLastEnumLangGuid);
|
GetVariable2 (LAST_ENUM_LANGUAGE_VARIABLE_NAME, &gLastEnumLangGuid, &LastLang, NULL);
|
||||||
PlatLang = GetEfiGlobalVariable (L"PlatformLang");
|
GetEfiGlobalVariable2 (L"PlatformLang", &PlatLang, NULL);
|
||||||
ASSERT (PlatLang != NULL);
|
ASSERT (PlatLang != NULL);
|
||||||
if ((LastLang != NULL) && (AsciiStrCmp (LastLang, PlatLang) == 0)) {
|
if ((LastLang != NULL) && (AsciiStrCmp (LastLang, PlatLang) == 0)) {
|
||||||
Status = BdsLibBuildOptionFromVar (BdsBootOptionList, L"BootOrder");
|
Status = BdsLibBuildOptionFromVar (BdsBootOptionList, L"BootOrder");
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/** @file
|
/** @file
|
||||||
The platform device manager reference implementation
|
The platform device manager reference implementation
|
||||||
|
|
||||||
Copyright (c) 2004 - 2011, Intel Corporation. All rights reserved.<BR>
|
Copyright (c) 2004 - 2012, 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
|
||||||
@ -2167,7 +2167,7 @@ DriverHealthSelectBestLanguage (
|
|||||||
CHAR8 *LanguageVariable;
|
CHAR8 *LanguageVariable;
|
||||||
CHAR8 *BestLanguage;
|
CHAR8 *BestLanguage;
|
||||||
|
|
||||||
LanguageVariable = GetEfiGlobalVariable (Iso639Language ? L"Lang" : L"PlatformLang");
|
GetEfiGlobalVariable2 (Iso639Language ? L"Lang" : L"PlatformLang", &LanguageVariable, NULL);
|
||||||
|
|
||||||
BestLanguage = GetBestLanguage(
|
BestLanguage = GetBestLanguage(
|
||||||
SupportedLanguages,
|
SupportedLanguages,
|
||||||
|
@ -232,7 +232,7 @@ FrontPageCallback (
|
|||||||
Index++;
|
Index++;
|
||||||
}
|
}
|
||||||
|
|
||||||
PlatformSupportedLanguages = GetEfiGlobalVariable (L"PlatformLangCodes");
|
GetEfiGlobalVariable2 (L"PlatformLangCodes", &PlatformSupportedLanguages, NULL);
|
||||||
if (PlatformSupportedLanguages == NULL) {
|
if (PlatformSupportedLanguages == NULL) {
|
||||||
PlatformSupportedLanguages = AllocateCopyPool (
|
PlatformSupportedLanguages = AllocateCopyPool (
|
||||||
AsciiStrSize ((CHAR8 *) PcdGetPtr (PcdUefiVariableDefaultPlatformLangCodes)),
|
AsciiStrSize ((CHAR8 *) PcdGetPtr (PcdUefiVariableDefaultPlatformLangCodes)),
|
||||||
@ -430,7 +430,7 @@ InitializeFrontPage (
|
|||||||
Lang = AllocatePool (AsciiStrSize (LanguageString));
|
Lang = AllocatePool (AsciiStrSize (LanguageString));
|
||||||
ASSERT (Lang != NULL);
|
ASSERT (Lang != NULL);
|
||||||
|
|
||||||
CurrentLang = GetEfiGlobalVariable (L"PlatformLang");
|
GetEfiGlobalVariable2 (L"PlatformLang", &CurrentLang, NULL);
|
||||||
//
|
//
|
||||||
// Select the best language in LanguageString as the default one.
|
// Select the best language in LanguageString as the default one.
|
||||||
//
|
//
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/** @file
|
/** @file
|
||||||
HII Library implementation that uses DXE protocols and services.
|
HII Library implementation that uses DXE protocols and services.
|
||||||
|
|
||||||
Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
|
Copyright (c) 2006 - 2012, 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
|
||||||
@ -250,7 +250,7 @@ HiiGetString (
|
|||||||
//
|
//
|
||||||
// Get the current platform language setting
|
// Get the current platform language setting
|
||||||
//
|
//
|
||||||
PlatformLanguage = GetEfiGlobalVariable (L"PlatformLang");
|
GetEfiGlobalVariable2 (L"PlatformLang", &PlatformLanguage, NULL);
|
||||||
|
|
||||||
//
|
//
|
||||||
// If Languag is NULL, then set it to an empty string, so it will be
|
// If Languag is NULL, then set it to an empty string, so it will be
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
Produces Simple Text Input Protocol, Simple Text Input Extended Protocol and
|
Produces Simple Text Input Protocol, Simple Text Input Extended Protocol and
|
||||||
Simple Text Output Protocol upon Serial IO Protocol.
|
Simple Text Output Protocol upon Serial IO Protocol.
|
||||||
|
|
||||||
Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>
|
Copyright (c) 2006 - 2012, 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
|
||||||
@ -358,7 +358,7 @@ IsTerminalInConsoleVariable (
|
|||||||
//
|
//
|
||||||
// Get global variable and its size according to the name given.
|
// Get global variable and its size according to the name given.
|
||||||
//
|
//
|
||||||
Variable = GetEfiGlobalVariable (VariableName);
|
GetEfiGlobalVariable2 (VariableName, &Variable, NULL);
|
||||||
if (Variable == NULL) {
|
if (Variable == NULL) {
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
@ -1431,7 +1431,7 @@ TerminalUpdateConsoleDevVariable (
|
|||||||
//
|
//
|
||||||
// Get global variable and its size according to the name given.
|
// Get global variable and its size according to the name given.
|
||||||
//
|
//
|
||||||
Variable = GetEfiGlobalVariable (VariableName);
|
GetEfiGlobalVariable2 (VariableName, &Variable, NULL);
|
||||||
if (Variable == NULL) {
|
if (Variable == NULL) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -1500,7 +1500,7 @@ TerminalRemoveConsoleDevVariable (
|
|||||||
//
|
//
|
||||||
// Get global variable and its size according to the name given.
|
// Get global variable and its size according to the name given.
|
||||||
//
|
//
|
||||||
Variable = GetEfiGlobalVariable (VariableName);
|
GetEfiGlobalVariable2 (VariableName, &Variable, NULL);
|
||||||
if (Variable == NULL) {
|
if (Variable == NULL) {
|
||||||
return ;
|
return ;
|
||||||
}
|
}
|
||||||
|
@ -2368,7 +2368,7 @@ HiiStringIdToImage (
|
|||||||
if (Language == NULL) {
|
if (Language == NULL) {
|
||||||
Language = "";
|
Language = "";
|
||||||
}
|
}
|
||||||
CurrentLanguage = GetEfiGlobalVariable (L"PlatformLang");
|
GetEfiGlobalVariable2 (L"PlatformLang", &CurrentLanguage, NULL);
|
||||||
BestLanguage = GetBestLanguage (
|
BestLanguage = GetBestLanguage (
|
||||||
SupportedLanguages,
|
SupportedLanguages,
|
||||||
FALSE,
|
FALSE,
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/** @file
|
/** @file
|
||||||
Routines used to operate the Ip4 configure variable.
|
Routines used to operate the Ip4 configure variable.
|
||||||
|
|
||||||
Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
|
Copyright (c) 2006 - 2012, 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<BR>
|
which accompanies this distribution. The full text of the license may be found at<BR>
|
||||||
@ -91,7 +91,7 @@ Ip4ConfigReadVariable (
|
|||||||
{
|
{
|
||||||
NIC_IP4_CONFIG_INFO *NicConfig;
|
NIC_IP4_CONFIG_INFO *NicConfig;
|
||||||
|
|
||||||
NicConfig = GetVariable (Instance->MacString, &gEfiNicIp4ConfigVariableGuid);
|
GetVariable2 (Instance->MacString, &gEfiNicIp4ConfigVariableGuid, &NicConfig, NULL);
|
||||||
if (NicConfig != NULL) {
|
if (NicConfig != NULL) {
|
||||||
Ip4ConfigFixRouteTablePointer (&NicConfig->Ip4Info);
|
Ip4ConfigFixRouteTablePointer (&NicConfig->Ip4Info);
|
||||||
}
|
}
|
||||||
@ -255,7 +255,7 @@ Check:
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
NicConfig = GetVariable (VariableName, &gEfiNicIp4ConfigVariableGuid);
|
GetVariable2 (VariableName, &gEfiNicIp4ConfigVariableGuid, &NicConfig, NULL);
|
||||||
if (NicConfig == NULL) {
|
if (NicConfig == NULL) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
4. It save all the mapping info in NV variables which will be consumed
|
4. It save all the mapping info in NV variables which will be consumed
|
||||||
by platform override protocol driver to publish the platform override protocol.
|
by platform override protocol driver to publish the platform override protocol.
|
||||||
|
|
||||||
Copyright (c) 2007 - 2011, Intel Corporation. All rights reserved.<BR>
|
Copyright (c) 2007 - 2012, 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
|
||||||
@ -185,7 +185,7 @@ GetComponentNameWorker (
|
|||||||
//
|
//
|
||||||
// Find the best matching language.
|
// Find the best matching language.
|
||||||
//
|
//
|
||||||
Language = GetEfiGlobalVariable (VariableName);
|
GetEfiGlobalVariable2 (VariableName, &Language, NULL);
|
||||||
BestLanguage = GetBestLanguage (
|
BestLanguage = GetBestLanguage (
|
||||||
ComponentName->SupportedLanguages,
|
ComponentName->SupportedLanguages,
|
||||||
(BOOLEAN) (ProtocolGuid == &gEfiComponentNameProtocolGuid),
|
(BOOLEAN) (ProtocolGuid == &gEfiComponentNameProtocolGuid),
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
of size reduction when compiler optimization is disabled. If MDEPKG_NDEBUG is
|
of size reduction when compiler optimization is disabled. If MDEPKG_NDEBUG is
|
||||||
defined, then debug and assert related macros wrapped by it are the NULL implementations.
|
defined, then debug and assert related macros wrapped by it are the NULL implementations.
|
||||||
|
|
||||||
Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>
|
Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>
|
||||||
This program and the accompanying materials are licensed and made available under
|
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 terms and conditions of the BSD License that accompanies this distribution.
|
||||||
The full text of the license may be found at
|
The full text of the license may be found at
|
||||||
@ -629,8 +629,11 @@ FreeUnicodeStringTable (
|
|||||||
IN EFI_UNICODE_STRING_TABLE *UnicodeStringTable
|
IN EFI_UNICODE_STRING_TABLE *UnicodeStringTable
|
||||||
);
|
);
|
||||||
|
|
||||||
|
#ifndef DISABLE_NEW_DEPRECATED_INTERFACES
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
[ATTENTION] This function will be deprecated for security reason.
|
||||||
|
|
||||||
Returns a pointer to an allocated buffer that contains the contents of a
|
Returns a pointer to an allocated buffer that contains the contents of a
|
||||||
variable retrieved through the UEFI Runtime Service GetVariable(). The
|
variable retrieved through the UEFI Runtime Service GetVariable(). The
|
||||||
returned buffer is allocated using AllocatePool(). The caller is responsible
|
returned buffer is allocated using AllocatePool(). The caller is responsible
|
||||||
@ -655,6 +658,8 @@ GetVariable (
|
|||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
[ATTENTION] This function will be deprecated for security reason.
|
||||||
|
|
||||||
Returns a pointer to an allocated buffer that contains the contents of a
|
Returns a pointer to an allocated buffer that contains the contents of a
|
||||||
variable retrieved through the UEFI Runtime Service GetVariable(). This
|
variable retrieved through the UEFI Runtime Service GetVariable(). This
|
||||||
function always uses the EFI_GLOBAL_VARIABLE GUID to retrieve variables.
|
function always uses the EFI_GLOBAL_VARIABLE GUID to retrieve variables.
|
||||||
@ -675,8 +680,65 @@ EFIAPI
|
|||||||
GetEfiGlobalVariable (
|
GetEfiGlobalVariable (
|
||||||
IN CONST CHAR16 *Name
|
IN CONST CHAR16 *Name
|
||||||
);
|
);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
Returns the status whether get the variable success. The function retrieves
|
||||||
|
variable through the UEFI Runtime Service GetVariable(). The
|
||||||
|
returned buffer is allocated using AllocatePool(). The caller is responsible
|
||||||
|
for freeing this buffer with FreePool().
|
||||||
|
|
||||||
|
If Name is NULL, then ASSERT().
|
||||||
|
If Guid is NULL, then ASSERT().
|
||||||
|
If Value is NULL, then ASSERT().
|
||||||
|
|
||||||
|
@param[in] Name The pointer to a Null-terminated Unicode string.
|
||||||
|
@param[in] Guid The pointer to an EFI_GUID structure
|
||||||
|
@param[out] Value The buffer point saved the variable info.
|
||||||
|
@param[out] Size The buffer size of the variable.
|
||||||
|
|
||||||
|
@return EFI_OUT_OF_RESOURCES Allocate buffer failed.
|
||||||
|
@return EFI_SUCCESS Find the specified variable.
|
||||||
|
@return Others Errors Return errors from call to gRT->GetVariable.
|
||||||
|
|
||||||
|
**/
|
||||||
|
EFI_STATUS
|
||||||
|
EFIAPI
|
||||||
|
GetVariable2 (
|
||||||
|
IN CONST CHAR16 *Name,
|
||||||
|
IN CONST EFI_GUID *Guid,
|
||||||
|
OUT VOID **Value,
|
||||||
|
OUT UINTN *Size OPTIONAL
|
||||||
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
Returns a pointer to an allocated buffer that contains the contents of a
|
||||||
|
variable retrieved through the UEFI Runtime Service GetVariable(). This
|
||||||
|
function always uses the EFI_GLOBAL_VARIABLE GUID to retrieve variables.
|
||||||
|
The returned buffer is allocated using AllocatePool(). The caller is
|
||||||
|
responsible for freeing this buffer with FreePool().
|
||||||
|
|
||||||
|
If Name is NULL, then ASSERT().
|
||||||
|
If Value is NULL, then ASSERT().
|
||||||
|
|
||||||
|
@param[in] Name The pointer to a Null-terminated Unicode string.
|
||||||
|
@param[out] Value The buffer point saved the variable info.
|
||||||
|
@param[out] Size The buffer size of the variable.
|
||||||
|
|
||||||
|
@return EFI_OUT_OF_RESOURCES Allocate buffer failed.
|
||||||
|
@return EFI_SUCCESS Find the specified variable.
|
||||||
|
@return Others Errors Return errors from call to gRT->GetVariable.
|
||||||
|
|
||||||
|
**/
|
||||||
|
EFI_STATUS
|
||||||
|
EFIAPI
|
||||||
|
GetEfiGlobalVariable2 (
|
||||||
|
IN CONST CHAR16 *Name,
|
||||||
|
OUT VOID **Value,
|
||||||
|
OUT UINTN *Size OPTIONAL
|
||||||
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Returns a pointer to an allocated buffer that contains the best matching language
|
Returns a pointer to an allocated buffer that contains the best matching language
|
||||||
from a set of supported languages.
|
from a set of supported languages.
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
EFI Driver Model related protocols, manage Unicode string tables for UEFI Drivers,
|
EFI Driver Model related protocols, manage Unicode string tables for UEFI Drivers,
|
||||||
and print messages on the console output and standard error devices.
|
and print messages on the console output and standard error devices.
|
||||||
|
|
||||||
Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
|
Copyright (c) 2006 - 2012, 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
|
||||||
@ -1212,7 +1212,11 @@ FreeUnicodeStringTable (
|
|||||||
return EFI_SUCCESS;
|
return EFI_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef DISABLE_NEW_DEPRECATED_INTERFACES
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
[ATTENTION] This function will be deprecated for security reason.
|
||||||
|
|
||||||
Returns a pointer to an allocated buffer that contains the contents of a
|
Returns a pointer to an allocated buffer that contains the contents of a
|
||||||
variable retrieved through the UEFI Runtime Service GetVariable(). The
|
variable retrieved through the UEFI Runtime Service GetVariable(). The
|
||||||
returned buffer is allocated using AllocatePool(). The caller is responsible
|
returned buffer is allocated using AllocatePool(). The caller is responsible
|
||||||
@ -1273,8 +1277,9 @@ GetVariable (
|
|||||||
return Value;
|
return Value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
[ATTENTION] This function will be deprecated for security reason.
|
||||||
|
|
||||||
Returns a pointer to an allocated buffer that contains the contents of a
|
Returns a pointer to an allocated buffer that contains the contents of a
|
||||||
variable retrieved through the UEFI Runtime Service GetVariable(). This
|
variable retrieved through the UEFI Runtime Service GetVariable(). This
|
||||||
function always uses the EFI_GLOBAL_VARIABLE GUID to retrieve variables.
|
function always uses the EFI_GLOBAL_VARIABLE GUID to retrieve variables.
|
||||||
@ -1298,7 +1303,110 @@ GetEfiGlobalVariable (
|
|||||||
{
|
{
|
||||||
return GetVariable (Name, &gEfiGlobalVariableGuid);
|
return GetVariable (Name, &gEfiGlobalVariableGuid);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/**
|
||||||
|
Returns the status whether get the variable success. The function retrieves
|
||||||
|
variable through the UEFI Runtime Service GetVariable(). The
|
||||||
|
returned buffer is allocated using AllocatePool(). The caller is responsible
|
||||||
|
for freeing this buffer with FreePool().
|
||||||
|
|
||||||
|
If Name is NULL, then ASSERT().
|
||||||
|
If Guid is NULL, then ASSERT().
|
||||||
|
If Value is NULL, then ASSERT().
|
||||||
|
|
||||||
|
@param[in] Name The pointer to a Null-terminated Unicode string.
|
||||||
|
@param[in] Guid The pointer to an EFI_GUID structure
|
||||||
|
@param[out] Value The buffer point saved the variable info.
|
||||||
|
@param[out] Size The buffer size of the variable.
|
||||||
|
|
||||||
|
@return EFI_OUT_OF_RESOURCES Allocate buffer failed.
|
||||||
|
@return EFI_SUCCESS Find the specified variable.
|
||||||
|
@return Others Errors Return errors from call to gRT->GetVariable.
|
||||||
|
|
||||||
|
**/
|
||||||
|
EFI_STATUS
|
||||||
|
EFIAPI
|
||||||
|
GetVariable2 (
|
||||||
|
IN CONST CHAR16 *Name,
|
||||||
|
IN CONST EFI_GUID *Guid,
|
||||||
|
OUT VOID **Value,
|
||||||
|
OUT UINTN *Size OPTIONAL
|
||||||
|
)
|
||||||
|
{
|
||||||
|
EFI_STATUS Status;
|
||||||
|
UINTN BufferSize;
|
||||||
|
|
||||||
|
ASSERT (Name != NULL && Guid != NULL && Value != NULL);
|
||||||
|
|
||||||
|
//
|
||||||
|
// Try to get the variable size.
|
||||||
|
//
|
||||||
|
BufferSize = 0;
|
||||||
|
*Value = NULL;
|
||||||
|
if (Size != NULL) {
|
||||||
|
*Size = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
Status = gRT->GetVariable ((CHAR16 *) Name, (EFI_GUID *) Guid, NULL, &BufferSize, *Value);
|
||||||
|
if (Status != EFI_BUFFER_TOO_SMALL) {
|
||||||
|
return Status;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Allocate buffer to get the variable.
|
||||||
|
//
|
||||||
|
*Value = AllocatePool (BufferSize);
|
||||||
|
ASSERT (*Value != NULL);
|
||||||
|
if (*Value == NULL) {
|
||||||
|
return EFI_OUT_OF_RESOURCES;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Get the variable data.
|
||||||
|
//
|
||||||
|
Status = gRT->GetVariable ((CHAR16 *) Name, (EFI_GUID *) Guid, NULL, &BufferSize, *Value);
|
||||||
|
if (EFI_ERROR (Status)) {
|
||||||
|
FreePool(*Value);
|
||||||
|
*Value = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Size != NULL) {
|
||||||
|
*Size = BufferSize;
|
||||||
|
}
|
||||||
|
|
||||||
|
return Status;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
Returns a pointer to an allocated buffer that contains the contents of a
|
||||||
|
variable retrieved through the UEFI Runtime Service GetVariable(). This
|
||||||
|
function always uses the EFI_GLOBAL_VARIABLE GUID to retrieve variables.
|
||||||
|
The returned buffer is allocated using AllocatePool(). The caller is
|
||||||
|
responsible for freeing this buffer with FreePool().
|
||||||
|
|
||||||
|
If Name is NULL, then ASSERT().
|
||||||
|
If Value is NULL, then ASSERT().
|
||||||
|
|
||||||
|
@param[in] Name The pointer to a Null-terminated Unicode string.
|
||||||
|
@param[out] Value The buffer point saved the variable info.
|
||||||
|
@param[out] Size The buffer size of the variable.
|
||||||
|
|
||||||
|
@return EFI_OUT_OF_RESOURCES Allocate buffer failed.
|
||||||
|
@return EFI_SUCCESS Find the specified variable.
|
||||||
|
@return Others Errors Return errors from call to gRT->GetVariable.
|
||||||
|
|
||||||
|
**/
|
||||||
|
EFI_STATUS
|
||||||
|
EFIAPI
|
||||||
|
GetEfiGlobalVariable2 (
|
||||||
|
IN CONST CHAR16 *Name,
|
||||||
|
OUT VOID **Value,
|
||||||
|
OUT UINTN *Size OPTIONAL
|
||||||
|
)
|
||||||
|
{
|
||||||
|
return GetVariable2 (Name, &gEfiGlobalVariableGuid, Value, Size);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Returns a pointer to an allocated buffer that contains the best matching language
|
Returns a pointer to an allocated buffer that contains the best matching language
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/** @file
|
/** @file
|
||||||
Dhcp6 support functions implementation.
|
Dhcp6 support functions implementation.
|
||||||
|
|
||||||
Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>
|
Copyright (c) 2009 - 2012, 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
|
||||||
@ -41,7 +41,7 @@ Dhcp6GenerateClientId (
|
|||||||
// Attempt to get client Id from variable to keep it constant.
|
// Attempt to get client Id from variable to keep it constant.
|
||||||
// See details in section-9 of rfc-3315.
|
// See details in section-9 of rfc-3315.
|
||||||
//
|
//
|
||||||
Duid = GetVariable (L"ClientId", &gEfiDhcp6ServiceBindingProtocolGuid);
|
GetVariable2 (L"ClientId", &gEfiDhcp6ServiceBindingProtocolGuid, &Duid, NULL);
|
||||||
if (Duid != NULL) {
|
if (Duid != NULL) {
|
||||||
return Duid;
|
return Duid;
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/** @file
|
/** @file
|
||||||
Miscellaneous routines for iSCSI driver.
|
Miscellaneous routines for iSCSI driver.
|
||||||
|
|
||||||
Copyright (c) 2004 - 2011, Intel Corporation. All rights reserved.<BR>
|
Copyright (c) 2004 - 2012, 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
|
||||||
@ -1076,10 +1076,12 @@ IScsiGetConfigData (
|
|||||||
(UINTN) AttemptConfigOrder[Index]
|
(UINTN) AttemptConfigOrder[Index]
|
||||||
);
|
);
|
||||||
|
|
||||||
AttemptConfigData = (ISCSI_ATTEMPT_CONFIG_NVDATA *) GetVariable (
|
GetVariable2 (
|
||||||
mPrivate->PortString,
|
mPrivate->PortString,
|
||||||
&gEfiIScsiInitiatorNameProtocolGuid
|
&gEfiIScsiInitiatorNameProtocolGuid,
|
||||||
);
|
&AttemptConfigData,
|
||||||
|
NULL
|
||||||
|
);
|
||||||
|
|
||||||
if (AttemptConfigData == NULL) {
|
if (AttemptConfigData == NULL) {
|
||||||
continue;
|
continue;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/** @file
|
/** @file
|
||||||
|
|
||||||
Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>
|
Copyright (c) 2009 - 2012, 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
|
||||||
@ -43,7 +43,7 @@ CurrentLanguageMatch (
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
CurrentLang = GetEfiGlobalVariable (L"PlatformLang");
|
GetEfiGlobalVariable2 (L"PlatformLang", &CurrentLang, NULL);
|
||||||
DefaultLang = (CHAR8 *) PcdGetPtr (PcdUefiVariableDefaultPlatformLang);
|
DefaultLang = (CHAR8 *) PcdGetPtr (PcdUefiVariableDefaultPlatformLang);
|
||||||
BestLanguage = GetBestLanguage (
|
BestLanguage = GetBestLanguage (
|
||||||
Languages,
|
Languages,
|
||||||
|
@ -270,7 +270,7 @@ GetNameFromHandle (
|
|||||||
//
|
//
|
||||||
// Get the current platform language setting
|
// Get the current platform language setting
|
||||||
//
|
//
|
||||||
PlatformLanguage = GetEfiGlobalVariable (L"PlatformLang");
|
GetEfiGlobalVariable2 (L"PlatformLang", &PlatformLanguage, NULL);
|
||||||
Status = ComponentName2->GetDriverName (
|
Status = ComponentName2->GetDriverName (
|
||||||
ComponentName2,
|
ComponentName2,
|
||||||
PlatformLanguage != NULL ? PlatformLanguage : "en-US",
|
PlatformLanguage != NULL ? PlatformLanguage : "en-US",
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/** @file
|
/** @file
|
||||||
Implement defer image load services for user identification in UEFI2.2.
|
Implement defer image load services for user identification in UEFI2.2.
|
||||||
|
|
||||||
Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>
|
Copyright (c) 2009 - 2012, 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
|
||||||
@ -532,7 +532,7 @@ IsBootOption (
|
|||||||
// Try to find the DevicePath in BootOption
|
// Try to find the DevicePath in BootOption
|
||||||
//
|
//
|
||||||
UnicodeSPrint (StrTemp, sizeof (StrTemp), L"Boot%04x", Index);
|
UnicodeSPrint (StrTemp, sizeof (StrTemp), L"Boot%04x", Index);
|
||||||
OptionBuffer = GetEfiGlobalVariable (StrTemp);
|
GetEfiGlobalVariable2 (StrTemp, &OptionBuffer, NULL);
|
||||||
if (OptionBuffer == NULL) {
|
if (OptionBuffer == NULL) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -1065,7 +1065,7 @@ VerifyCertUefiGuid (
|
|||||||
//
|
//
|
||||||
// Get KEK database variable.
|
// Get KEK database variable.
|
||||||
//
|
//
|
||||||
KekList = GetEfiGlobalVariable (EFI_KEY_EXCHANGE_KEY_NAME);
|
GetEfiGlobalVariable2 (EFI_KEY_EXCHANGE_KEY_NAME, &KekList, NULL);
|
||||||
if (KekList == NULL) {
|
if (KekList == NULL) {
|
||||||
return EFI_SECURITY_VIOLATION;
|
return EFI_SECURITY_VIOLATION;
|
||||||
}
|
}
|
||||||
@ -1260,7 +1260,7 @@ DxeImageVerificationHandler (
|
|||||||
return EFI_ACCESS_DENIED;
|
return EFI_ACCESS_DENIED;
|
||||||
}
|
}
|
||||||
|
|
||||||
SecureBootEnable = GetVariable (EFI_SECURE_BOOT_ENABLE_NAME, &gEfiSecureBootEnableDisableGuid);
|
GetVariable2 (EFI_SECURE_BOOT_ENABLE_NAME, &gEfiSecureBootEnableDisableGuid, &SecureBootEnable, NULL);
|
||||||
//
|
//
|
||||||
// Skip verification if SecureBootEnable variable doesn't exist.
|
// Skip verification if SecureBootEnable variable doesn't exist.
|
||||||
//
|
//
|
||||||
@ -1278,7 +1278,7 @@ DxeImageVerificationHandler (
|
|||||||
|
|
||||||
FreePool (SecureBootEnable);
|
FreePool (SecureBootEnable);
|
||||||
|
|
||||||
SetupMode = GetEfiGlobalVariable (EFI_SETUP_MODE_NAME);
|
GetEfiGlobalVariable2 (EFI_SETUP_MODE_NAME, &SetupMode, NULL);
|
||||||
|
|
||||||
//
|
//
|
||||||
// SetupMode doesn't exist means no AuthVar driver is dispatched,
|
// SetupMode doesn't exist means no AuthVar driver is dispatched,
|
||||||
@ -1544,7 +1544,7 @@ VariableWriteCallBack (
|
|||||||
// If this library is built-in, it means firmware has capability to perform
|
// If this library is built-in, it means firmware has capability to perform
|
||||||
// driver signing verification.
|
// driver signing verification.
|
||||||
//
|
//
|
||||||
SecureBootModePtr = GetEfiGlobalVariable (EFI_SECURE_BOOT_MODE_NAME);
|
GetEfiGlobalVariable2 (EFI_SECURE_BOOT_MODE_NAME, &SecureBootModePtr, NULL);
|
||||||
if (SecureBootModePtr == NULL) {
|
if (SecureBootModePtr == NULL) {
|
||||||
SecureBootMode = SECURE_BOOT_MODE_DISABLE;
|
SecureBootMode = SECURE_BOOT_MODE_DISABLE;
|
||||||
//
|
//
|
||||||
|
@ -410,7 +410,7 @@ DisplayLoadPermit(
|
|||||||
// Get driver device path.
|
// Get driver device path.
|
||||||
//
|
//
|
||||||
UnicodeSPrint (VarName, sizeof (VarName), L"Driver%04x", Order[Index]);
|
UnicodeSPrint (VarName, sizeof (VarName), L"Driver%04x", Order[Index]);
|
||||||
Var = GetEfiGlobalVariable (VarName);
|
GetEfiGlobalVariable2 (VarName, &Var, NULL);
|
||||||
if (Var == NULL) {
|
if (Var == NULL) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -655,7 +655,7 @@ AddToForbidLoad (
|
|||||||
// Get loadable driver device path.
|
// Get loadable driver device path.
|
||||||
//
|
//
|
||||||
UnicodeSPrint (VarName, sizeof (VarName), L"Driver%04x", DriverIndex);
|
UnicodeSPrint (VarName, sizeof (VarName), L"Driver%04x", DriverIndex);
|
||||||
Var = GetEfiGlobalVariable (VarName);
|
GetEfiGlobalVariable2 (VarName, &Var, NULL);
|
||||||
if (Var == NULL) {
|
if (Var == NULL) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -215,7 +215,7 @@ DeleteVariable (
|
|||||||
UINTN DataSize;
|
UINTN DataSize;
|
||||||
UINT32 Attr;
|
UINT32 Attr;
|
||||||
|
|
||||||
Variable = GetVariable (VariableName, VendorGuid);
|
GetVariable2 (VariableName, VendorGuid, &Variable, NULL);
|
||||||
if (Variable == NULL) {
|
if (Variable == NULL) {
|
||||||
return EFI_SUCCESS;
|
return EFI_SUCCESS;
|
||||||
}
|
}
|
||||||
@ -2064,7 +2064,7 @@ SecureBootExtractConfigFromVariable (
|
|||||||
//
|
//
|
||||||
// Get the SecureBootEnable Variable
|
// Get the SecureBootEnable Variable
|
||||||
//
|
//
|
||||||
SecureBootEnable = GetVariable (EFI_SECURE_BOOT_ENABLE_NAME, &gEfiSecureBootEnableDisableGuid);
|
GetVariable2 (EFI_SECURE_BOOT_ENABLE_NAME, &gEfiSecureBootEnableDisableGuid, &SecureBootEnable, NULL);
|
||||||
|
|
||||||
//
|
//
|
||||||
// If the SecureBootEnable Variable doesn't exist, hide the SecureBoot Enable/Disable
|
// If the SecureBootEnable Variable doesn't exist, hide the SecureBoot Enable/Disable
|
||||||
@ -2088,7 +2088,7 @@ SecureBootExtractConfigFromVariable (
|
|||||||
//
|
//
|
||||||
// If there is no PK then the Delete Pk button will be gray.
|
// If there is no PK then the Delete Pk button will be gray.
|
||||||
//
|
//
|
||||||
SetupMode = GetVariable (EFI_SETUP_MODE_NAME, &gEfiGlobalVariableGuid);
|
GetVariable2 (EFI_SETUP_MODE_NAME, &gEfiGlobalVariableGuid, &SetupMode, NULL);
|
||||||
if (SetupMode == NULL || (*SetupMode) == 1) {
|
if (SetupMode == NULL || (*SetupMode) == 1) {
|
||||||
ConfigData->HasPk = FALSE;
|
ConfigData->HasPk = FALSE;
|
||||||
} else {
|
} else {
|
||||||
@ -2098,7 +2098,7 @@ SecureBootExtractConfigFromVariable (
|
|||||||
//
|
//
|
||||||
// Get the SecureBootMode from CustomMode variable.
|
// Get the SecureBootMode from CustomMode variable.
|
||||||
//
|
//
|
||||||
SecureBootMode = GetVariable (EFI_CUSTOM_MODE_NAME, &gEfiCustomModeEnableGuid);
|
GetVariable2 (EFI_CUSTOM_MODE_NAME, &gEfiCustomModeEnableGuid, &SecureBootMode, NULL);
|
||||||
if (SecureBootMode == NULL) {
|
if (SecureBootMode == NULL) {
|
||||||
ConfigData->SecureBootMode = STANDARD_SECURE_BOOT_MODE;
|
ConfigData->SecureBootMode = STANDARD_SECURE_BOOT_MODE;
|
||||||
} else {
|
} else {
|
||||||
@ -2298,6 +2298,9 @@ SecureBootCallback (
|
|||||||
UINTN BufferSize;
|
UINTN BufferSize;
|
||||||
SECUREBOOT_CONFIGURATION *IfrNvData;
|
SECUREBOOT_CONFIGURATION *IfrNvData;
|
||||||
UINT16 LabelId;
|
UINT16 LabelId;
|
||||||
|
UINT8 *SecureBootEnable;
|
||||||
|
|
||||||
|
SecureBootEnable = NULL;
|
||||||
|
|
||||||
if ((This == NULL) || (Value == NULL) || (ActionRequest == NULL)) {
|
if ((This == NULL) || (Value == NULL) || (ActionRequest == NULL)) {
|
||||||
return EFI_INVALID_PARAMETER;
|
return EFI_INVALID_PARAMETER;
|
||||||
@ -2326,7 +2329,8 @@ SecureBootCallback (
|
|||||||
|
|
||||||
switch (QuestionId) {
|
switch (QuestionId) {
|
||||||
case KEY_SECURE_BOOT_ENABLE:
|
case KEY_SECURE_BOOT_ENABLE:
|
||||||
if (NULL != GetVariable (EFI_SECURE_BOOT_ENABLE_NAME, &gEfiSecureBootEnableDisableGuid)) {
|
GetVariable2 (EFI_SECURE_BOOT_ENABLE_NAME, &gEfiSecureBootEnableDisableGuid, &SecureBootEnable, NULL);
|
||||||
|
if (NULL != SecureBootEnable) {
|
||||||
if (EFI_ERROR (SaveSecureBootVariable (Value->u8))) {
|
if (EFI_ERROR (SaveSecureBootVariable (Value->u8))) {
|
||||||
CreatePopUp (
|
CreatePopUp (
|
||||||
EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE,
|
EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE,
|
||||||
@ -2513,7 +2517,8 @@ SecureBootCallback (
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case KEY_SECURE_BOOT_MODE:
|
case KEY_SECURE_BOOT_MODE:
|
||||||
if (NULL != GetVariable (EFI_CUSTOM_MODE_NAME, &gEfiCustomModeEnableGuid)) {
|
GetVariable2 (EFI_CUSTOM_MODE_NAME, &gEfiCustomModeEnableGuid, &SecureBootEnable, NULL);
|
||||||
|
if (NULL != SecureBootEnable) {
|
||||||
Status = gRT->SetVariable (
|
Status = gRT->SetVariable (
|
||||||
EFI_CUSTOM_MODE_NAME,
|
EFI_CUSTOM_MODE_NAME,
|
||||||
&gEfiCustomModeEnableGuid,
|
&gEfiCustomModeEnableGuid,
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
This driver parses the mSmbiosMiscDataTable structure and reports
|
This driver parses the mSmbiosMiscDataTable structure and reports
|
||||||
any generated data.
|
any generated data.
|
||||||
|
|
||||||
Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>
|
Copyright (c) 2009 - 2012, 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
|
||||||
@ -45,7 +45,7 @@ CurrentLanguageMatch (
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
CurrentLang = GetEfiGlobalVariable (L"PlatformLang");
|
GetEfiGlobalVariable2 (L"PlatformLang", &CurrentLang, NULL);
|
||||||
DefaultLang = (CHAR8 *) PcdGetPtr (PcdUefiVariableDefaultPlatformLang);
|
DefaultLang = (CHAR8 *) PcdGetPtr (PcdUefiVariableDefaultPlatformLang);
|
||||||
BestLanguage = GetBestLanguage (
|
BestLanguage = GetBestLanguage (
|
||||||
Languages,
|
Languages,
|
||||||
|
Reference in New Issue
Block a user