mirror of
https://github.com/acidanthera/audk.git
synced 2025-07-29 16:44:10 +02:00
Fix K8 and Sct failure.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@8337 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
08654acba5
commit
6e3f5b2aa9
@ -591,6 +591,10 @@ MergeDefaultString (
|
|||||||
SizeAltCfgResp + StrSize (StringPtrDefault),
|
SizeAltCfgResp + StrSize (StringPtrDefault),
|
||||||
(VOID *) (*AltCfgResp)
|
(VOID *) (*AltCfgResp)
|
||||||
);
|
);
|
||||||
|
if (*AltCfgResp == NULL) {
|
||||||
|
FreePool (AltConfigHdr);
|
||||||
|
return EFI_OUT_OF_RESOURCES;
|
||||||
|
}
|
||||||
StrCat (*AltCfgResp, StringPtrDefault);
|
StrCat (*AltCfgResp, StringPtrDefault);
|
||||||
*StringPtrEnd = TempChar;
|
*StringPtrEnd = TempChar;
|
||||||
}
|
}
|
||||||
@ -657,10 +661,17 @@ InsertDefaultValue (
|
|||||||
for (Link = BlockData->DefaultValueEntry.ForwardLink; Link != &BlockData->DefaultValueEntry; Link = Link->ForwardLink) {
|
for (Link = BlockData->DefaultValueEntry.ForwardLink; Link != &BlockData->DefaultValueEntry; Link = Link->ForwardLink) {
|
||||||
DefaultValueArray = BASE_CR (Link, IFR_DEFAULT_DATA, Entry);
|
DefaultValueArray = BASE_CR (Link, IFR_DEFAULT_DATA, Entry);
|
||||||
if (DefaultValueArray->DefaultId == DefaultValueData->DefaultId) {
|
if (DefaultValueArray->DefaultId == DefaultValueData->DefaultId) {
|
||||||
//
|
if (DefaultValueData->OpCode == EFI_IFR_DEFAULT_OP) {
|
||||||
// Update the default value array in BlockData.
|
//
|
||||||
//
|
// Update the default value array in BlockData.
|
||||||
DefaultValueArray->Value = DefaultValueData->Value;
|
//
|
||||||
|
DefaultValueArray->Value = DefaultValueData->Value;
|
||||||
|
} else if (DefaultValueArray->OpCode != EFI_IFR_DEFAULT_OP) {
|
||||||
|
//
|
||||||
|
// Update the default value array in BlockData.
|
||||||
|
//
|
||||||
|
DefaultValueArray->Value = DefaultValueData->Value;
|
||||||
|
}
|
||||||
FreePool (DefaultValueData);
|
FreePool (DefaultValueData);
|
||||||
return;
|
return;
|
||||||
} else if (DefaultValueArray->DefaultId > DefaultValueData->DefaultId) {
|
} else if (DefaultValueArray->DefaultId > DefaultValueData->DefaultId) {
|
||||||
@ -1144,6 +1155,7 @@ ParseIfrData (
|
|||||||
Status = EFI_OUT_OF_RESOURCES;
|
Status = EFI_OUT_OF_RESOURCES;
|
||||||
goto Done;
|
goto Done;
|
||||||
}
|
}
|
||||||
|
DefaultData->OpCode = IfrOpHdr->OpCode;
|
||||||
DefaultData->DefaultId = VarDefaultId;
|
DefaultData->DefaultId = VarDefaultId;
|
||||||
DefaultData->DefaultName = VarDefaultName;
|
DefaultData->DefaultName = VarDefaultName;
|
||||||
DefaultData->Value = 1;
|
DefaultData->Value = 1;
|
||||||
@ -1170,6 +1182,7 @@ ParseIfrData (
|
|||||||
Status = EFI_OUT_OF_RESOURCES;
|
Status = EFI_OUT_OF_RESOURCES;
|
||||||
goto Done;
|
goto Done;
|
||||||
}
|
}
|
||||||
|
DefaultData->OpCode = IfrOpHdr->OpCode;
|
||||||
DefaultData->DefaultId = VarDefaultId;
|
DefaultData->DefaultId = VarDefaultId;
|
||||||
DefaultData->DefaultName = VarDefaultName;
|
DefaultData->DefaultName = VarDefaultName;
|
||||||
DefaultData->Value = 1;
|
DefaultData->Value = 1;
|
||||||
@ -1375,6 +1388,7 @@ ParseIfrData (
|
|||||||
Status = EFI_OUT_OF_RESOURCES;
|
Status = EFI_OUT_OF_RESOURCES;
|
||||||
goto Done;
|
goto Done;
|
||||||
}
|
}
|
||||||
|
DefaultData->OpCode = IfrOpHdr->OpCode;
|
||||||
DefaultData->DefaultId = VarDefaultId;
|
DefaultData->DefaultId = VarDefaultId;
|
||||||
DefaultData->DefaultName = VarDefaultName;
|
DefaultData->DefaultName = VarDefaultName;
|
||||||
DefaultData->Value = IfrOneOfOption->Value.u64;
|
DefaultData->Value = IfrOneOfOption->Value.u64;
|
||||||
@ -1401,6 +1415,7 @@ ParseIfrData (
|
|||||||
Status = EFI_OUT_OF_RESOURCES;
|
Status = EFI_OUT_OF_RESOURCES;
|
||||||
goto Done;
|
goto Done;
|
||||||
}
|
}
|
||||||
|
DefaultData->OpCode = IfrOpHdr->OpCode;
|
||||||
DefaultData->DefaultId = VarDefaultId;
|
DefaultData->DefaultId = VarDefaultId;
|
||||||
DefaultData->DefaultName = VarDefaultName;
|
DefaultData->DefaultName = VarDefaultName;
|
||||||
DefaultData->Value = IfrOneOfOption->Value.u64;
|
DefaultData->Value = IfrOneOfOption->Value.u64;
|
||||||
@ -1445,6 +1460,7 @@ ParseIfrData (
|
|||||||
Status = EFI_OUT_OF_RESOURCES;
|
Status = EFI_OUT_OF_RESOURCES;
|
||||||
goto Done;
|
goto Done;
|
||||||
}
|
}
|
||||||
|
DefaultData->OpCode = IfrOpHdr->OpCode;
|
||||||
DefaultData->DefaultId = VarDefaultId;
|
DefaultData->DefaultId = VarDefaultId;
|
||||||
DefaultData->DefaultName = VarDefaultName;
|
DefaultData->DefaultName = VarDefaultName;
|
||||||
DefaultData->Value = IfrDefault->Value.u64;
|
DefaultData->Value = IfrDefault->Value.u64;
|
||||||
@ -1543,6 +1559,7 @@ GetFullStringFromHiiFormPackages (
|
|||||||
LIST_ENTRY *Link;
|
LIST_ENTRY *Link;
|
||||||
LIST_ENTRY *LinkData;
|
LIST_ENTRY *LinkData;
|
||||||
LIST_ENTRY *LinkDefault;
|
LIST_ENTRY *LinkDefault;
|
||||||
|
BOOLEAN DataExist;
|
||||||
|
|
||||||
//
|
//
|
||||||
// Initialize the local variables.
|
// Initialize the local variables.
|
||||||
@ -1559,6 +1576,7 @@ GetFullStringFromHiiFormPackages (
|
|||||||
HiiFormPackage = NULL;
|
HiiFormPackage = NULL;
|
||||||
ResultSize = 0;
|
ResultSize = 0;
|
||||||
PackageSize = 0;
|
PackageSize = 0;
|
||||||
|
DataExist = FALSE;
|
||||||
|
|
||||||
//
|
//
|
||||||
// 0. Get Hii Form Package by HiiHandle
|
// 0. Get Hii Form Package by HiiHandle
|
||||||
@ -1688,6 +1706,27 @@ GetFullStringFromHiiFormPackages (
|
|||||||
BlockData->Width = Width;
|
BlockData->Width = Width;
|
||||||
InsertBlockData (&RequestBlockArray->Entry, &BlockData);
|
InsertBlockData (&RequestBlockArray->Entry, &BlockData);
|
||||||
|
|
||||||
|
//
|
||||||
|
// Skip &VALUE string if &VALUE does exists.
|
||||||
|
//
|
||||||
|
if (StrnCmp (StringPtr, L"&VALUE=", StrLen (L"&VALUE=")) == 0) {
|
||||||
|
StringPtr += StrLen (L"&VALUE=");
|
||||||
|
|
||||||
|
//
|
||||||
|
// Get Value
|
||||||
|
//
|
||||||
|
Status = GetValueOfNumber (StringPtr, &TmpBuffer, &Length);
|
||||||
|
if (EFI_ERROR (Status)) {
|
||||||
|
Status = EFI_INVALID_PARAMETER;
|
||||||
|
goto Done;
|
||||||
|
}
|
||||||
|
|
||||||
|
StringPtr += Length;
|
||||||
|
if (*StringPtr != 0 && *StringPtr != L'&') {
|
||||||
|
Status = EFI_INVALID_PARAMETER;
|
||||||
|
goto Done;
|
||||||
|
}
|
||||||
|
}
|
||||||
//
|
//
|
||||||
// If '\0', parsing is finished.
|
// If '\0', parsing is finished.
|
||||||
//
|
//
|
||||||
@ -1752,6 +1791,7 @@ GetFullStringFromHiiFormPackages (
|
|||||||
// No requested varstore in IFR data and directly return
|
// No requested varstore in IFR data and directly return
|
||||||
//
|
//
|
||||||
if (VarStorageData->Size == 0) {
|
if (VarStorageData->Size == 0) {
|
||||||
|
Status = EFI_SUCCESS;
|
||||||
goto Done;
|
goto Done;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1803,6 +1843,7 @@ GetFullStringFromHiiFormPackages (
|
|||||||
// Compute the length of the entire request starting with <ConfigHdr> and a
|
// Compute the length of the entire request starting with <ConfigHdr> and a
|
||||||
// Null-terminator
|
// Null-terminator
|
||||||
//
|
//
|
||||||
|
DataExist = FALSE;
|
||||||
Length = StrLen (ConfigHdr) + 1;
|
Length = StrLen (ConfigHdr) + 1;
|
||||||
|
|
||||||
for (Link = VarStorageData->BlockEntry.ForwardLink; Link != &VarStorageData->BlockEntry; Link = Link->ForwardLink) {
|
for (Link = VarStorageData->BlockEntry.ForwardLink; Link != &VarStorageData->BlockEntry; Link = Link->ForwardLink) {
|
||||||
@ -1812,14 +1853,24 @@ GetFullStringFromHiiFormPackages (
|
|||||||
// <BlockName> ::= &OFFSET=1234&WIDTH=1234
|
// <BlockName> ::= &OFFSET=1234&WIDTH=1234
|
||||||
// | 8 | 4 | 7 | 4 |
|
// | 8 | 4 | 7 | 4 |
|
||||||
//
|
//
|
||||||
|
DataExist = TRUE;
|
||||||
Length = Length + (8 + 4 + 7 + 4);
|
Length = Length + (8 + 4 + 7 + 4);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// No any request block data is found. The request string can't be constructed.
|
||||||
|
//
|
||||||
|
if (!DataExist) {
|
||||||
|
Status = EFI_SUCCESS;
|
||||||
|
goto Done;
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Allocate buffer for the entire <ConfigRequest>
|
// Allocate buffer for the entire <ConfigRequest>
|
||||||
//
|
//
|
||||||
FullConfigRequest = AllocateZeroPool (Length * sizeof (CHAR16));
|
FullConfigRequest = AllocateZeroPool (Length * sizeof (CHAR16));
|
||||||
if (FullConfigRequest == NULL) {
|
if (FullConfigRequest == NULL) {
|
||||||
|
Status = EFI_OUT_OF_RESOURCES;
|
||||||
goto Done;
|
goto Done;
|
||||||
}
|
}
|
||||||
StringPtr = FullConfigRequest;
|
StringPtr = FullConfigRequest;
|
||||||
@ -1862,7 +1913,7 @@ GetFullStringFromHiiFormPackages (
|
|||||||
// Go through all VarStorageData Entry and get the DefaultId array for each one
|
// Go through all VarStorageData Entry and get the DefaultId array for each one
|
||||||
// Then construct them all to : ConfigHdr AltConfigHdr ConfigBody AltConfigHdr ConfigBody
|
// Then construct them all to : ConfigHdr AltConfigHdr ConfigBody AltConfigHdr ConfigBody
|
||||||
//
|
//
|
||||||
|
DataExist = FALSE;
|
||||||
//
|
//
|
||||||
// Add length for <ConfigHdr> + '\0'
|
// Add length for <ConfigHdr> + '\0'
|
||||||
//
|
//
|
||||||
@ -1886,16 +1937,26 @@ GetFullStringFromHiiFormPackages (
|
|||||||
// | 8 | 4 | 7 | 4 | 7 | Width * 2 |
|
// | 8 | 4 | 7 | 4 | 7 | Width * 2 |
|
||||||
//
|
//
|
||||||
Length += (8 + 4 + 7 + 4 + 7 + BlockData->Width * 2);
|
Length += (8 + 4 + 7 + 4 + 7 + BlockData->Width * 2);
|
||||||
|
DataExist = TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// No default value is found. The default string doesn't exist.
|
||||||
|
//
|
||||||
|
if (!DataExist) {
|
||||||
|
Status = EFI_SUCCESS;
|
||||||
|
goto Done;
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Allocate buffer for the entire <DefaultAltCfgResp>
|
// Allocate buffer for the entire <DefaultAltCfgResp>
|
||||||
//
|
//
|
||||||
DefaultAltCfgResp = AllocateZeroPool (Length * sizeof (CHAR16));
|
DefaultAltCfgResp = AllocateZeroPool (Length * sizeof (CHAR16));
|
||||||
if (DefaultAltCfgResp == NULL) {
|
if (DefaultAltCfgResp == NULL) {
|
||||||
|
Status = EFI_OUT_OF_RESOURCES;
|
||||||
goto Done;
|
goto Done;
|
||||||
}
|
}
|
||||||
StringPtr = DefaultAltCfgResp;
|
StringPtr = DefaultAltCfgResp;
|
||||||
@ -1957,11 +2018,11 @@ GetFullStringFromHiiFormPackages (
|
|||||||
//
|
//
|
||||||
// 5. Merge string into the input AltCfgResp if the iput *AltCfgResp is not NULL.
|
// 5. Merge string into the input AltCfgResp if the iput *AltCfgResp is not NULL.
|
||||||
//
|
//
|
||||||
if (*AltCfgResp != NULL) {
|
if (*AltCfgResp != NULL && DefaultAltCfgResp != NULL) {
|
||||||
Status = MergeDefaultString (AltCfgResp, DefaultAltCfgResp);
|
Status = MergeDefaultString (AltCfgResp, DefaultAltCfgResp);
|
||||||
FreePool (DefaultAltCfgResp);
|
FreePool (DefaultAltCfgResp);
|
||||||
} else {
|
} else if (*AltCfgResp == NULL) {
|
||||||
*AltCfgResp = DefaultAltCfgResp;
|
*AltCfgResp = DefaultAltCfgResp;
|
||||||
}
|
}
|
||||||
|
|
||||||
Done:
|
Done:
|
||||||
@ -2102,7 +2163,7 @@ HiiConfigRoutingExtractConfig (
|
|||||||
EFI_STRING AccessResults;
|
EFI_STRING AccessResults;
|
||||||
EFI_STRING DefaultResults;
|
EFI_STRING DefaultResults;
|
||||||
BOOLEAN FirstElement;
|
BOOLEAN FirstElement;
|
||||||
UINTN DevicePathLength;
|
BOOLEAN IfrDataParsedFlag;
|
||||||
|
|
||||||
if (This == NULL || Progress == NULL || Results == NULL) {
|
if (This == NULL || Progress == NULL || Results == NULL) {
|
||||||
return EFI_INVALID_PARAMETER;
|
return EFI_INVALID_PARAMETER;
|
||||||
@ -2121,6 +2182,7 @@ HiiConfigRoutingExtractConfig (
|
|||||||
Status = EFI_SUCCESS;
|
Status = EFI_SUCCESS;
|
||||||
AccessResults = NULL;
|
AccessResults = NULL;
|
||||||
DevicePath = NULL;
|
DevicePath = NULL;
|
||||||
|
IfrDataParsedFlag = FALSE;
|
||||||
|
|
||||||
//
|
//
|
||||||
// The first element of <MultiConfigRequest> should be
|
// The first element of <MultiConfigRequest> should be
|
||||||
@ -2177,7 +2239,6 @@ HiiConfigRoutingExtractConfig (
|
|||||||
DriverHandle = NULL;
|
DriverHandle = NULL;
|
||||||
HiiHandle = NULL;
|
HiiHandle = NULL;
|
||||||
Database = NULL;
|
Database = NULL;
|
||||||
DevicePathLength = GetDevicePathSize (DevicePath);
|
|
||||||
for (Link = Private->DatabaseList.ForwardLink;
|
for (Link = Private->DatabaseList.ForwardLink;
|
||||||
Link != &Private->DatabaseList;
|
Link != &Private->DatabaseList;
|
||||||
Link = Link->ForwardLink
|
Link = Link->ForwardLink
|
||||||
@ -2186,12 +2247,11 @@ HiiConfigRoutingExtractConfig (
|
|||||||
|
|
||||||
if ((DevicePathPkg = Database->PackageList->DevicePathPkg) != NULL) {
|
if ((DevicePathPkg = Database->PackageList->DevicePathPkg) != NULL) {
|
||||||
CurrentDevicePath = DevicePathPkg + sizeof (EFI_HII_PACKAGE_HEADER);
|
CurrentDevicePath = DevicePathPkg + sizeof (EFI_HII_PACKAGE_HEADER);
|
||||||
if ((DevicePathLength == GetDevicePathSize ((EFI_DEVICE_PATH_PROTOCOL *) CurrentDevicePath)) &&
|
if (CompareMem (
|
||||||
(CompareMem (
|
|
||||||
DevicePath,
|
DevicePath,
|
||||||
CurrentDevicePath,
|
CurrentDevicePath,
|
||||||
DevicePathLength
|
GetDevicePathSize ((EFI_DEVICE_PATH_PROTOCOL *) CurrentDevicePath)
|
||||||
) == 0)) {
|
) == 0) {
|
||||||
DriverHandle = Database->DriverHandle;
|
DriverHandle = Database->DriverHandle;
|
||||||
HiiHandle = Database->Handle;
|
HiiHandle = Database->Handle;
|
||||||
break;
|
break;
|
||||||
@ -2223,10 +2283,12 @@ HiiConfigRoutingExtractConfig (
|
|||||||
//
|
//
|
||||||
// Check whether ConfigRequest contains request string OFFSET/WIDTH
|
// Check whether ConfigRequest contains request string OFFSET/WIDTH
|
||||||
//
|
//
|
||||||
|
IfrDataParsedFlag = FALSE;
|
||||||
if ((HiiHandle != NULL) && (StrStr (ConfigRequest, L"&OFFSET=") == NULL)) {
|
if ((HiiHandle != NULL) && (StrStr (ConfigRequest, L"&OFFSET=") == NULL)) {
|
||||||
//
|
//
|
||||||
// Get the full request string from IFR when HiiPackage is registered to HiiHandle
|
// Get the full request string from IFR when HiiPackage is registered to HiiHandle
|
||||||
//
|
//
|
||||||
|
IfrDataParsedFlag = TRUE;
|
||||||
Status = GetFullStringFromHiiFormPackages (Database, DevicePath, &ConfigRequest, &DefaultResults);
|
Status = GetFullStringFromHiiFormPackages (Database, DevicePath, &ConfigRequest, &DefaultResults);
|
||||||
if (EFI_ERROR (Status)) {
|
if (EFI_ERROR (Status)) {
|
||||||
goto Done;
|
goto Done;
|
||||||
@ -2275,10 +2337,12 @@ HiiConfigRoutingExtractConfig (
|
|||||||
// Update AccessResults by getting default setting from IFR when HiiPackage is registered to HiiHandle
|
// Update AccessResults by getting default setting from IFR when HiiPackage is registered to HiiHandle
|
||||||
//
|
//
|
||||||
if (HiiHandle != NULL) {
|
if (HiiHandle != NULL) {
|
||||||
if (DefaultResults == NULL) {
|
if (!IfrDataParsedFlag) {
|
||||||
Status = GetFullStringFromHiiFormPackages (Database, DevicePath, &ConfigRequest, &AccessResults);
|
Status = GetFullStringFromHiiFormPackages (Database, DevicePath, &ConfigRequest, &AccessResults);
|
||||||
} else {
|
} else if (DefaultResults != NULL) {
|
||||||
Status = MergeDefaultString (&AccessResults, DefaultResults);
|
Status = MergeDefaultString (&AccessResults, DefaultResults);
|
||||||
|
FreePool (DefaultResults);
|
||||||
|
DefaultResults = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
FreePool (DevicePath);
|
FreePool (DevicePath);
|
||||||
@ -2288,14 +2352,6 @@ HiiConfigRoutingExtractConfig (
|
|||||||
goto Done;
|
goto Done;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
|
||||||
// Free the allocated memory.
|
|
||||||
//
|
|
||||||
if (DefaultResults != NULL) {
|
|
||||||
FreePool (DefaultResults);
|
|
||||||
DefaultResults = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
NextConfigString:
|
NextConfigString:
|
||||||
if (!FirstElement) {
|
if (!FirstElement) {
|
||||||
Status = AppendToMultiString (Results, L"&");
|
Status = AppendToMultiString (Results, L"&");
|
||||||
@ -2327,7 +2383,7 @@ NextConfigString:
|
|||||||
Done:
|
Done:
|
||||||
if (EFI_ERROR (Status)) {
|
if (EFI_ERROR (Status)) {
|
||||||
FreePool (*Results);
|
FreePool (*Results);
|
||||||
*Results = NULL;
|
*Results = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ConfigRequest != NULL) {
|
if (ConfigRequest != NULL) {
|
||||||
@ -2383,7 +2439,7 @@ HiiConfigRoutingExportConfig (
|
|||||||
EFI_HII_CONFIG_ACCESS_PROTOCOL *ConfigAccess;
|
EFI_HII_CONFIG_ACCESS_PROTOCOL *ConfigAccess;
|
||||||
EFI_STRING AccessResults;
|
EFI_STRING AccessResults;
|
||||||
EFI_STRING Progress;
|
EFI_STRING Progress;
|
||||||
EFI_STRING ConfigRequest;
|
EFI_STRING StringPtr;
|
||||||
UINTN Index;
|
UINTN Index;
|
||||||
EFI_HANDLE *ConfigAccessHandles;
|
EFI_HANDLE *ConfigAccessHandles;
|
||||||
UINTN NumberConfigAccessHandles;
|
UINTN NumberConfigAccessHandles;
|
||||||
@ -2396,7 +2452,6 @@ HiiConfigRoutingExportConfig (
|
|||||||
HII_DATABASE_RECORD *Database;
|
HII_DATABASE_RECORD *Database;
|
||||||
UINT8 *DevicePathPkg;
|
UINT8 *DevicePathPkg;
|
||||||
UINT8 *CurrentDevicePath;
|
UINT8 *CurrentDevicePath;
|
||||||
UINTN DevicePathLength;
|
|
||||||
|
|
||||||
if (This == NULL || Results == NULL) {
|
if (This == NULL || Results == NULL) {
|
||||||
return EFI_INVALID_PARAMETER;
|
return EFI_INVALID_PARAMETER;
|
||||||
@ -2442,11 +2497,9 @@ HiiConfigRoutingExportConfig (
|
|||||||
//
|
//
|
||||||
Progress = NULL;
|
Progress = NULL;
|
||||||
HiiHandle = NULL;
|
HiiHandle = NULL;
|
||||||
ConfigRequest = NULL;
|
|
||||||
DefaultResults = NULL;
|
DefaultResults = NULL;
|
||||||
Database = NULL;
|
Database = NULL;
|
||||||
DevicePath = DevicePathFromHandle (ConfigAccessHandles[Index]);
|
DevicePath = DevicePathFromHandle (ConfigAccessHandles[Index]);
|
||||||
DevicePathLength = GetDevicePathSize (DevicePath);
|
|
||||||
if (DevicePath != NULL) {
|
if (DevicePath != NULL) {
|
||||||
for (Link = Private->DatabaseList.ForwardLink;
|
for (Link = Private->DatabaseList.ForwardLink;
|
||||||
Link != &Private->DatabaseList;
|
Link != &Private->DatabaseList;
|
||||||
@ -2455,12 +2508,11 @@ HiiConfigRoutingExportConfig (
|
|||||||
Database = CR (Link, HII_DATABASE_RECORD, DatabaseEntry, HII_DATABASE_RECORD_SIGNATURE);
|
Database = CR (Link, HII_DATABASE_RECORD, DatabaseEntry, HII_DATABASE_RECORD_SIGNATURE);
|
||||||
if ((DevicePathPkg = Database->PackageList->DevicePathPkg) != NULL) {
|
if ((DevicePathPkg = Database->PackageList->DevicePathPkg) != NULL) {
|
||||||
CurrentDevicePath = DevicePathPkg + sizeof (EFI_HII_PACKAGE_HEADER);
|
CurrentDevicePath = DevicePathPkg + sizeof (EFI_HII_PACKAGE_HEADER);
|
||||||
if ((DevicePathLength == GetDevicePathSize ((EFI_DEVICE_PATH_PROTOCOL *) CurrentDevicePath)) &&
|
if (CompareMem (
|
||||||
(CompareMem (
|
|
||||||
DevicePath,
|
DevicePath,
|
||||||
CurrentDevicePath,
|
CurrentDevicePath,
|
||||||
DevicePathLength
|
GetDevicePathSize ((EFI_DEVICE_PATH_PROTOCOL *) CurrentDevicePath)
|
||||||
) == 0)) {
|
) == 0) {
|
||||||
HiiHandle = Database->Handle;
|
HiiHandle = Database->Handle;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -2468,27 +2520,28 @@ HiiConfigRoutingExportConfig (
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
|
||||||
// Update AccessResults by getting default setting from IFR when HiiPackage is registered to HiiHandle
|
|
||||||
//
|
|
||||||
if (HiiHandle != NULL && DevicePath != NULL) {
|
|
||||||
Status = GetFullStringFromHiiFormPackages (Database, DevicePath, &ConfigRequest, &DefaultResults);
|
|
||||||
}
|
|
||||||
//
|
|
||||||
// Can't parse IFR data to get the request string and default string.
|
|
||||||
//
|
|
||||||
if (EFI_ERROR (Status)) {
|
|
||||||
ConfigRequest = NULL;
|
|
||||||
DefaultResults = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
Status = ConfigAccess->ExtractConfig (
|
Status = ConfigAccess->ExtractConfig (
|
||||||
ConfigAccess,
|
ConfigAccess,
|
||||||
ConfigRequest,
|
NULL,
|
||||||
&Progress,
|
&Progress,
|
||||||
&AccessResults
|
&AccessResults
|
||||||
);
|
);
|
||||||
if (!EFI_ERROR (Status)) {
|
if (!EFI_ERROR (Status)) {
|
||||||
|
//
|
||||||
|
// Update AccessResults by getting default setting from IFR when HiiPackage is registered to HiiHandle
|
||||||
|
//
|
||||||
|
if (HiiHandle != NULL && DevicePath != NULL) {
|
||||||
|
StringPtr = StrStr (AccessResults, L"&GUID=");
|
||||||
|
if (StringPtr != NULL) {
|
||||||
|
*StringPtr = 0;
|
||||||
|
}
|
||||||
|
if (StrStr (AccessResults, L"&OFFSET=") != NULL) {
|
||||||
|
Status = GetFullStringFromHiiFormPackages (Database, DevicePath, &AccessResults, &DefaultResults);
|
||||||
|
}
|
||||||
|
if (StringPtr != NULL) {
|
||||||
|
*StringPtr = L'&';
|
||||||
|
}
|
||||||
|
}
|
||||||
//
|
//
|
||||||
// Merge the default sting from IFR code into the got setting from driver.
|
// Merge the default sting from IFR code into the got setting from driver.
|
||||||
//
|
//
|
||||||
@ -2570,7 +2623,6 @@ HiiConfigRoutingRouteConfig (
|
|||||||
EFI_HANDLE DriverHandle;
|
EFI_HANDLE DriverHandle;
|
||||||
EFI_HII_CONFIG_ACCESS_PROTOCOL *ConfigAccess;
|
EFI_HII_CONFIG_ACCESS_PROTOCOL *ConfigAccess;
|
||||||
EFI_STRING AccessProgress;
|
EFI_STRING AccessProgress;
|
||||||
UINTN DevicePathLength;
|
|
||||||
|
|
||||||
if (This == NULL || Progress == NULL) {
|
if (This == NULL || Progress == NULL) {
|
||||||
return EFI_INVALID_PARAMETER;
|
return EFI_INVALID_PARAMETER;
|
||||||
@ -2630,7 +2682,6 @@ HiiConfigRoutingRouteConfig (
|
|||||||
// Find driver which matches the routing data.
|
// Find driver which matches the routing data.
|
||||||
//
|
//
|
||||||
DriverHandle = NULL;
|
DriverHandle = NULL;
|
||||||
DevicePathLength = GetDevicePathSize (DevicePath);
|
|
||||||
for (Link = Private->DatabaseList.ForwardLink;
|
for (Link = Private->DatabaseList.ForwardLink;
|
||||||
Link != &Private->DatabaseList;
|
Link != &Private->DatabaseList;
|
||||||
Link = Link->ForwardLink
|
Link = Link->ForwardLink
|
||||||
@ -2639,12 +2690,11 @@ HiiConfigRoutingRouteConfig (
|
|||||||
|
|
||||||
if ((DevicePathPkg = Database->PackageList->DevicePathPkg) != NULL) {
|
if ((DevicePathPkg = Database->PackageList->DevicePathPkg) != NULL) {
|
||||||
CurrentDevicePath = DevicePathPkg + sizeof (EFI_HII_PACKAGE_HEADER);
|
CurrentDevicePath = DevicePathPkg + sizeof (EFI_HII_PACKAGE_HEADER);
|
||||||
if ((DevicePathLength == GetDevicePathSize ((EFI_DEVICE_PATH_PROTOCOL *) CurrentDevicePath)) &&
|
if (CompareMem (
|
||||||
(CompareMem (
|
|
||||||
DevicePath,
|
DevicePath,
|
||||||
CurrentDevicePath,
|
CurrentDevicePath,
|
||||||
DevicePathLength
|
GetDevicePathSize ((EFI_DEVICE_PATH_PROTOCOL *) CurrentDevicePath)
|
||||||
) == 0)) {
|
) == 0) {
|
||||||
DriverHandle = Database->DriverHandle;
|
DriverHandle = Database->DriverHandle;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -3216,7 +3266,7 @@ HiiConfigToBlock (
|
|||||||
goto Exit;
|
goto Exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
*Progress = StringPtr;
|
*Progress = StringPtr + StrLen (StringPtr);
|
||||||
return EFI_SUCCESS;
|
return EFI_SUCCESS;
|
||||||
|
|
||||||
Exit:
|
Exit:
|
||||||
|
@ -659,7 +659,7 @@ ExportFormPackages (
|
|||||||
for (Link = PackageList->FormPkgHdr.ForwardLink; Link != &PackageList->FormPkgHdr; Link = Link->ForwardLink) {
|
for (Link = PackageList->FormPkgHdr.ForwardLink; Link != &PackageList->FormPkgHdr; Link = Link->ForwardLink) {
|
||||||
FormPackage = CR (Link, HII_IFR_PACKAGE_INSTANCE, IfrEntry, HII_IFR_PACKAGE_SIGNATURE);
|
FormPackage = CR (Link, HII_IFR_PACKAGE_INSTANCE, IfrEntry, HII_IFR_PACKAGE_SIGNATURE);
|
||||||
PackageLength += FormPackage->FormPkgHdr.Length;
|
PackageLength += FormPackage->FormPkgHdr.Length;
|
||||||
if (PackageLength + *ResultSize + UsedSize <= BufferSize) {
|
if ((Buffer != NULL) && (PackageLength + *ResultSize + UsedSize <= BufferSize)) {
|
||||||
//
|
//
|
||||||
// Invoke registered notification if exists
|
// Invoke registered notification if exists
|
||||||
//
|
//
|
||||||
|
@ -88,6 +88,7 @@ typedef struct {
|
|||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
LIST_ENTRY Entry;
|
LIST_ENTRY Entry;
|
||||||
|
UINT8 OpCode;
|
||||||
EFI_STRING_ID DefaultName;
|
EFI_STRING_ID DefaultName;
|
||||||
UINT16 DefaultId;
|
UINT16 DefaultId;
|
||||||
UINT64 Value;
|
UINT64 Value;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user