mirror of https://github.com/acidanthera/audk.git
Update BdsDxe to use new designed HiiLib, remove the referrence to the original IfrSupportLib.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@8115 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
d91c7bf9e4
commit
75bf9d0ecc
|
@ -51,8 +51,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||||
#include <Library/MemoryAllocationLib.h>
|
#include <Library/MemoryAllocationLib.h>
|
||||||
#include <Library/PerformanceLib.h>
|
#include <Library/PerformanceLib.h>
|
||||||
#include <Library/ReportStatusCodeLib.h>
|
#include <Library/ReportStatusCodeLib.h>
|
||||||
#include <Library/IfrSupportLib.h>
|
|
||||||
#include <Library/ExtendedIfrSupportLib.h>
|
|
||||||
#include <Library/UefiRuntimeServicesTableLib.h>
|
#include <Library/UefiRuntimeServicesTableLib.h>
|
||||||
#include <Library/HobLib.h>
|
#include <Library/HobLib.h>
|
||||||
#include <Library/BaseLib.h>
|
#include <Library/BaseLib.h>
|
||||||
|
|
|
@ -95,8 +95,6 @@
|
||||||
BaseLib
|
BaseLib
|
||||||
HobLib
|
HobLib
|
||||||
UefiRuntimeServicesTableLib
|
UefiRuntimeServicesTableLib
|
||||||
IfrSupportLib
|
|
||||||
ExtendedIfrSupportLib
|
|
||||||
GenericBdsLib
|
GenericBdsLib
|
||||||
ReportStatusCodeLib
|
ReportStatusCodeLib
|
||||||
PerformanceLib
|
PerformanceLib
|
||||||
|
@ -135,6 +133,8 @@
|
||||||
gEfiMemorySubClassGuid ## CONSUMES ## GUID (Indicate the datahub for holding memory record)
|
gEfiMemorySubClassGuid ## CONSUMES ## GUID (Indicate the datahub for holding memory record)
|
||||||
gEfiProcessorSubClassGuid ## CONSUMES ## GUID (Indicate the datahub for holding processor record)
|
gEfiProcessorSubClassGuid ## CONSUMES ## GUID (Indicate the datahub for holding processor record)
|
||||||
gEfiCapsuleVendorGuid ## CONSUMES ## GUID (Indicate the hob for holding capsule update image)
|
gEfiCapsuleVendorGuid ## CONSUMES ## GUID (Indicate the hob for holding capsule update image)
|
||||||
|
gEfiHiiPlatformSetupFormsetGuid ## CONSUMES ## GUID (Indicate the formset class guid to be displayed)
|
||||||
|
gEfiIfrTianoGuid ## CONSUMES ## GUID (Extended IFR Guid Opcode)
|
||||||
|
|
||||||
[Protocols]
|
[Protocols]
|
||||||
gEfiHiiStringProtocolGuid # PROTOCOL ALWAYS_CONSUMES
|
gEfiHiiStringProtocolGuid # PROTOCOL ALWAYS_CONSUMES
|
||||||
|
|
|
@ -15,12 +15,11 @@
|
||||||
|
|
||||||
#include "FormGuid.h"
|
#include "FormGuid.h"
|
||||||
|
|
||||||
#define LABEL_END 0xffff
|
|
||||||
|
|
||||||
formset
|
formset
|
||||||
guid = BOOT_MAINT_FORMSET_GUID,
|
guid = BOOT_MAINT_FORMSET_GUID,
|
||||||
title = STRING_TOKEN(STR_FORM_MAIN_TITLE),
|
title = STRING_TOKEN(STR_FORM_MAIN_TITLE),
|
||||||
help = STRING_TOKEN(STR_NULL_STRING),
|
help = STRING_TOKEN(STR_NULL_STRING),
|
||||||
|
classguid = BOOT_MAINT_FORMSET_GUID,
|
||||||
class = 0,
|
class = 0,
|
||||||
subclass = 0,
|
subclass = 0,
|
||||||
|
|
||||||
|
|
|
@ -82,7 +82,7 @@ EFI_GUID EfiLegacyDevOrderGuid = EFI_LEGACY_DEV_ORDER_VARIABLE_GUID;
|
||||||
EFI_GUID mBootMaintGuid = BOOT_MAINT_FORMSET_GUID;
|
EFI_GUID mBootMaintGuid = BOOT_MAINT_FORMSET_GUID;
|
||||||
EFI_GUID mFileExplorerGuid = FILE_EXPLORE_FORMSET_GUID;
|
EFI_GUID mFileExplorerGuid = FILE_EXPLORE_FORMSET_GUID;
|
||||||
|
|
||||||
CHAR16 mBootMaintStorageName[] = L"BmData";
|
CHAR16 mBootMaintStorageName[] = L"BmmData";
|
||||||
CHAR16 mFileExplorerStorageName[] = L"FeData";
|
CHAR16 mFileExplorerStorageName[] = L"FeData";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -251,8 +251,7 @@ BootMaintCallback (
|
||||||
UINT8 *NewLegacyDev;
|
UINT8 *NewLegacyDev;
|
||||||
UINT8 *DisMap;
|
UINT8 *DisMap;
|
||||||
EFI_FORM_ID FormId;
|
EFI_FORM_ID FormId;
|
||||||
UINTN BufferSize;
|
|
||||||
|
|
||||||
if ((Value == NULL) || (ActionRequest == NULL)) {
|
if ((Value == NULL) || (ActionRequest == NULL)) {
|
||||||
return EFI_INVALID_PARAMETER;
|
return EFI_INVALID_PARAMETER;
|
||||||
}
|
}
|
||||||
|
@ -272,11 +271,9 @@ BootMaintCallback (
|
||||||
//
|
//
|
||||||
// Retrive uncommitted data from Form Browser
|
// Retrive uncommitted data from Form Browser
|
||||||
//
|
//
|
||||||
CurrentFakeNVMap = &Private->BmmFakeNvData;
|
CurrentFakeNVMap = (BMM_FAKE_NV_DATA *) HiiGetBrowserData (&mBootMaintGuid, mBootMaintStorageName, sizeof (BMM_FAKE_NV_DATA));
|
||||||
BufferSize = sizeof (BMM_FAKE_NV_DATA);
|
if (CurrentFakeNVMap == NULL) {
|
||||||
Status = GetBrowserData (NULL, NULL, &BufferSize, (UINT8 *) CurrentFakeNVMap);
|
CurrentFakeNVMap = &Private->BmmFakeNvData;
|
||||||
if (EFI_ERROR (Status)) {
|
|
||||||
return Status;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
|
@ -588,8 +585,15 @@ BootMaintCallback (
|
||||||
//
|
//
|
||||||
// Pass changed uncommitted data back to Form Browser
|
// Pass changed uncommitted data back to Form Browser
|
||||||
//
|
//
|
||||||
BufferSize = sizeof (BMM_FAKE_NV_DATA);
|
Status = HiiSetBrowserData (&mBootMaintGuid, mBootMaintStorageName, sizeof (BMM_FAKE_NV_DATA), (UINT8 *) CurrentFakeNVMap, NULL);
|
||||||
Status = SetBrowserData (NULL, NULL, BufferSize, (UINT8 *) CurrentFakeNVMap, NULL);
|
|
||||||
|
//
|
||||||
|
// Update local settting.
|
||||||
|
//
|
||||||
|
if ((UINTN) CurrentFakeNVMap != (UINTN) &Private->BmmFakeNvData) {
|
||||||
|
CopyMem (&Private->BmmFakeNvData, CurrentFakeNVMap, sizeof (BMM_FAKE_NV_DATA));
|
||||||
|
FreePool (CurrentFakeNVMap);
|
||||||
|
}
|
||||||
|
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
@ -954,15 +958,33 @@ InitializeBM (
|
||||||
ASSERT (BmmCallbackInfo->FeHiiHandle != NULL);
|
ASSERT (BmmCallbackInfo->FeHiiHandle != NULL);
|
||||||
|
|
||||||
//
|
//
|
||||||
// Allocate space for creation of Buffer
|
// Init OpCode Handle and Allocate space for creation of Buffer
|
||||||
//
|
//
|
||||||
gUpdateData.BufferSize = UPDATE_DATA_SIZE;
|
mStartOpCodeHandle = HiiAllocateOpCodeHandle ();
|
||||||
gUpdateData.Data = AllocateZeroPool (UPDATE_DATA_SIZE);
|
if (mStartOpCodeHandle == NULL) {
|
||||||
if (gUpdateData.Data == NULL) {
|
|
||||||
Status = EFI_OUT_OF_RESOURCES;
|
Status = EFI_OUT_OF_RESOURCES;
|
||||||
goto Exit;
|
goto Exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mEndOpCodeHandle = HiiAllocateOpCodeHandle ();
|
||||||
|
if (mEndOpCodeHandle == NULL) {
|
||||||
|
Status = EFI_OUT_OF_RESOURCES;
|
||||||
|
goto Exit;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Create Hii Extend Label OpCode as the start opcode
|
||||||
|
//
|
||||||
|
mStartLabel = (EFI_IFR_GUID_LABEL *) HiiCreateGuidOpCode (mStartOpCodeHandle, &gEfiIfrTianoGuid, NULL, sizeof (EFI_IFR_GUID_LABEL));
|
||||||
|
mStartLabel->ExtendOpCode = EFI_IFR_EXTEND_OP_LABEL;
|
||||||
|
|
||||||
|
//
|
||||||
|
// Create Hii Extend Label OpCode as the end opcode
|
||||||
|
//
|
||||||
|
mEndLabel = (EFI_IFR_GUID_LABEL *) HiiCreateGuidOpCode (mEndOpCodeHandle, &gEfiIfrTianoGuid, NULL, sizeof (EFI_IFR_GUID_LABEL));
|
||||||
|
mEndLabel->ExtendOpCode = EFI_IFR_EXTEND_OP_LABEL;
|
||||||
|
mEndLabel->Number = LABEL_END;
|
||||||
|
|
||||||
InitializeStringDepository ();
|
InitializeStringDepository ();
|
||||||
|
|
||||||
InitAllMenu (BmmCallbackInfo);
|
InitAllMenu (BmmCallbackInfo);
|
||||||
|
@ -986,63 +1008,63 @@ InitializeBM (
|
||||||
Status = EfiLibLocateProtocol (&gEfiLegacyBiosProtocolGuid, (VOID **) &LegacyBios);
|
Status = EfiLibLocateProtocol (&gEfiLegacyBiosProtocolGuid, (VOID **) &LegacyBios);
|
||||||
if (!EFI_ERROR (Status)) {
|
if (!EFI_ERROR (Status)) {
|
||||||
RefreshUpdateData ();
|
RefreshUpdateData ();
|
||||||
|
mStartLabel->Number = FORM_BOOT_LEGACY_DEVICE_ID;
|
||||||
|
|
||||||
//
|
//
|
||||||
// If LegacyBios Protocol is installed, add 3 tags about legacy boot option
|
// If LegacyBios Protocol is installed, add 3 tags about legacy boot option
|
||||||
// in BootOption form: legacy FD/HD/CD/NET/BEV
|
// in BootOption form: legacy FD/HD/CD/NET/BEV
|
||||||
//
|
//
|
||||||
CreateGotoOpCode (
|
HiiCreateGotoOpCode (
|
||||||
|
mStartOpCodeHandle,
|
||||||
FORM_SET_FD_ORDER_ID,
|
FORM_SET_FD_ORDER_ID,
|
||||||
STRING_TOKEN (STR_FORM_SET_FD_ORDER_TITLE),
|
STRING_TOKEN (STR_FORM_SET_FD_ORDER_TITLE),
|
||||||
STRING_TOKEN (STR_FORM_SET_FD_ORDER_TITLE),
|
STRING_TOKEN (STR_FORM_SET_FD_ORDER_TITLE),
|
||||||
EFI_IFR_FLAG_CALLBACK,
|
EFI_IFR_FLAG_CALLBACK,
|
||||||
FORM_SET_FD_ORDER_ID,
|
FORM_SET_FD_ORDER_ID
|
||||||
&gUpdateData
|
|
||||||
);
|
);
|
||||||
|
|
||||||
CreateGotoOpCode (
|
HiiCreateGotoOpCode (
|
||||||
|
mStartOpCodeHandle,
|
||||||
FORM_SET_HD_ORDER_ID,
|
FORM_SET_HD_ORDER_ID,
|
||||||
STRING_TOKEN (STR_FORM_SET_HD_ORDER_TITLE),
|
STRING_TOKEN (STR_FORM_SET_HD_ORDER_TITLE),
|
||||||
STRING_TOKEN (STR_FORM_SET_HD_ORDER_TITLE),
|
STRING_TOKEN (STR_FORM_SET_HD_ORDER_TITLE),
|
||||||
EFI_IFR_FLAG_CALLBACK,
|
EFI_IFR_FLAG_CALLBACK,
|
||||||
FORM_SET_HD_ORDER_ID,
|
FORM_SET_HD_ORDER_ID
|
||||||
&gUpdateData
|
|
||||||
);
|
);
|
||||||
|
|
||||||
CreateGotoOpCode (
|
HiiCreateGotoOpCode (
|
||||||
|
mStartOpCodeHandle,
|
||||||
FORM_SET_CD_ORDER_ID,
|
FORM_SET_CD_ORDER_ID,
|
||||||
STRING_TOKEN (STR_FORM_SET_CD_ORDER_TITLE),
|
STRING_TOKEN (STR_FORM_SET_CD_ORDER_TITLE),
|
||||||
STRING_TOKEN (STR_FORM_SET_CD_ORDER_TITLE),
|
STRING_TOKEN (STR_FORM_SET_CD_ORDER_TITLE),
|
||||||
EFI_IFR_FLAG_CALLBACK,
|
EFI_IFR_FLAG_CALLBACK,
|
||||||
FORM_SET_CD_ORDER_ID,
|
FORM_SET_CD_ORDER_ID
|
||||||
&gUpdateData
|
|
||||||
);
|
);
|
||||||
|
|
||||||
CreateGotoOpCode (
|
HiiCreateGotoOpCode (
|
||||||
|
mStartOpCodeHandle,
|
||||||
FORM_SET_NET_ORDER_ID,
|
FORM_SET_NET_ORDER_ID,
|
||||||
STRING_TOKEN (STR_FORM_SET_NET_ORDER_TITLE),
|
STRING_TOKEN (STR_FORM_SET_NET_ORDER_TITLE),
|
||||||
STRING_TOKEN (STR_FORM_SET_NET_ORDER_TITLE),
|
STRING_TOKEN (STR_FORM_SET_NET_ORDER_TITLE),
|
||||||
EFI_IFR_FLAG_CALLBACK,
|
EFI_IFR_FLAG_CALLBACK,
|
||||||
FORM_SET_NET_ORDER_ID,
|
FORM_SET_NET_ORDER_ID
|
||||||
&gUpdateData
|
|
||||||
);
|
);
|
||||||
|
|
||||||
CreateGotoOpCode (
|
HiiCreateGotoOpCode (
|
||||||
|
mStartOpCodeHandle,
|
||||||
FORM_SET_BEV_ORDER_ID,
|
FORM_SET_BEV_ORDER_ID,
|
||||||
STRING_TOKEN (STR_FORM_SET_BEV_ORDER_TITLE),
|
STRING_TOKEN (STR_FORM_SET_BEV_ORDER_TITLE),
|
||||||
STRING_TOKEN (STR_FORM_SET_BEV_ORDER_TITLE),
|
STRING_TOKEN (STR_FORM_SET_BEV_ORDER_TITLE),
|
||||||
EFI_IFR_FLAG_CALLBACK,
|
EFI_IFR_FLAG_CALLBACK,
|
||||||
FORM_SET_BEV_ORDER_ID,
|
FORM_SET_BEV_ORDER_ID
|
||||||
&gUpdateData
|
|
||||||
);
|
);
|
||||||
|
|
||||||
IfrLibUpdateForm (
|
HiiUpdateForm (
|
||||||
BmmCallbackInfo->BmmHiiHandle,
|
BmmCallbackInfo->BmmHiiHandle,
|
||||||
&mBootMaintGuid,
|
&mBootMaintGuid,
|
||||||
FORM_BOOT_SETUP_ID,
|
FORM_BOOT_SETUP_ID,
|
||||||
FORM_BOOT_LEGACY_DEVICE_ID,
|
mStartOpCodeHandle, // Label FORM_BOOT_LEGACY_DEVICE_ID
|
||||||
FALSE,
|
mEndOpCodeHandle // LABEL_END
|
||||||
&gUpdateData
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1061,10 +1083,15 @@ InitializeBM (
|
||||||
|
|
||||||
FreeAllMenu ();
|
FreeAllMenu ();
|
||||||
|
|
||||||
FreePool (gUpdateData.Data);
|
|
||||||
gUpdateData.Data = NULL;
|
|
||||||
|
|
||||||
Exit:
|
Exit:
|
||||||
|
if (mStartOpCodeHandle != NULL) {
|
||||||
|
HiiFreeOpCodeHandle (mStartOpCodeHandle);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (mEndOpCodeHandle != NULL) {
|
||||||
|
HiiFreeOpCodeHandle (mEndOpCodeHandle);
|
||||||
|
}
|
||||||
|
|
||||||
if (BmmCallbackInfo->FeDriverHandle != NULL) {
|
if (BmmCallbackInfo->FeDriverHandle != NULL) {
|
||||||
gBS->UninstallMultipleProtocolInterfaces (
|
gBS->UninstallMultipleProtocolInterfaces (
|
||||||
BmmCallbackInfo->FeDriverHandle,
|
BmmCallbackInfo->FeDriverHandle,
|
||||||
|
@ -1324,7 +1351,7 @@ FormSetDispatcher (
|
||||||
gFormBrowser2,
|
gFormBrowser2,
|
||||||
&CallbackData->BmmHiiHandle,
|
&CallbackData->BmmHiiHandle,
|
||||||
1,
|
1,
|
||||||
NULL,
|
&mBootMaintGuid,
|
||||||
0,
|
0,
|
||||||
NULL,
|
NULL,
|
||||||
&ActionRequest
|
&ActionRequest
|
||||||
|
@ -1346,7 +1373,7 @@ FormSetDispatcher (
|
||||||
gFormBrowser2,
|
gFormBrowser2,
|
||||||
&CallbackData->FeHiiHandle,
|
&CallbackData->FeHiiHandle,
|
||||||
1,
|
1,
|
||||||
NULL,
|
&mFileExplorerGuid,
|
||||||
0,
|
0,
|
||||||
NULL,
|
NULL,
|
||||||
&ActionRequest
|
&ActionRequest
|
||||||
|
|
|
@ -63,7 +63,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||||
|
|
||||||
extern EFI_GUID mBootMaintGuid;
|
extern EFI_GUID mBootMaintGuid;
|
||||||
extern EFI_GUID mFileExplorerGuid;
|
extern EFI_GUID mFileExplorerGuid;
|
||||||
|
extern CHAR16 mFileExplorerStorageName[];
|
||||||
//
|
//
|
||||||
// These are the VFR compiler generated data representing our VFR data.
|
// These are the VFR compiler generated data representing our VFR data.
|
||||||
//
|
//
|
||||||
|
@ -1565,7 +1565,6 @@ extern COM_ATTR DataBitsList[4];
|
||||||
extern COM_ATTR ParityList[5];
|
extern COM_ATTR ParityList[5];
|
||||||
extern COM_ATTR StopBitsList[3];
|
extern COM_ATTR StopBitsList[3];
|
||||||
extern EFI_GUID TerminalTypeGuid[4];
|
extern EFI_GUID TerminalTypeGuid[4];
|
||||||
extern EFI_HII_UPDATE_DATA gUpdateData;
|
|
||||||
extern STRING_DEPOSITORY *FileOptionStrDepository;
|
extern STRING_DEPOSITORY *FileOptionStrDepository;
|
||||||
extern STRING_DEPOSITORY *ConsoleOptionStrDepository;
|
extern STRING_DEPOSITORY *ConsoleOptionStrDepository;
|
||||||
extern STRING_DEPOSITORY *BootOptionStrDepository;
|
extern STRING_DEPOSITORY *BootOptionStrDepository;
|
||||||
|
@ -1576,4 +1575,12 @@ extern STRING_DEPOSITORY *TerminalStrDepository;
|
||||||
extern EFI_DEVICE_PATH_PROTOCOL EndDevicePath[];
|
extern EFI_DEVICE_PATH_PROTOCOL EndDevicePath[];
|
||||||
extern EFI_GUID EfiLegacyDevOrderGuid;
|
extern EFI_GUID EfiLegacyDevOrderGuid;
|
||||||
|
|
||||||
|
//
|
||||||
|
// Shared IFR form update data
|
||||||
|
//
|
||||||
|
extern VOID *mStartOpCodeHandle;
|
||||||
|
extern VOID *mEndOpCodeHandle;
|
||||||
|
extern EFI_IFR_GUID_LABEL *mStartLabel;
|
||||||
|
extern EFI_IFR_GUID_LABEL *mEndLabel;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -14,7 +14,11 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||||
|
|
||||||
#include "BootMaint.h"
|
#include "BootMaint.h"
|
||||||
|
|
||||||
EFI_HII_UPDATE_DATA gUpdateData;
|
VOID *mStartOpCodeHandle = NULL;
|
||||||
|
VOID *mEndOpCodeHandle = NULL;
|
||||||
|
EFI_IFR_GUID_LABEL *mStartLabel = NULL;
|
||||||
|
EFI_IFR_GUID_LABEL *mEndLabel = NULL;
|
||||||
|
|
||||||
STRING_DEPOSITORY *FileOptionStrDepository;
|
STRING_DEPOSITORY *FileOptionStrDepository;
|
||||||
STRING_DEPOSITORY *ConsoleOptionStrDepository;
|
STRING_DEPOSITORY *ConsoleOptionStrDepository;
|
||||||
STRING_DEPOSITORY *BootOptionStrDepository;
|
STRING_DEPOSITORY *BootOptionStrDepository;
|
||||||
|
|
|
@ -15,12 +15,11 @@
|
||||||
|
|
||||||
#include "FormGuid.h"
|
#include "FormGuid.h"
|
||||||
|
|
||||||
#define LABEL_END 0xffff
|
|
||||||
|
|
||||||
formset
|
formset
|
||||||
guid = FILE_EXPLORE_FORMSET_GUID,
|
guid = FILE_EXPLORE_FORMSET_GUID,
|
||||||
title = STRING_TOKEN(STR_FILE_EXPLORER_TITLE),
|
title = STRING_TOKEN(STR_FILE_EXPLORER_TITLE),
|
||||||
help = STRING_TOKEN(STR_NULL_STRING),
|
help = STRING_TOKEN(STR_NULL_STRING),
|
||||||
|
classguid = FILE_EXPLORE_FORMSET_GUID,
|
||||||
class = 0,
|
class = 0,
|
||||||
subclass = 0,
|
subclass = 0,
|
||||||
|
|
||||||
|
|
|
@ -37,6 +37,7 @@ UpdateFileExplorePage (
|
||||||
FormId = 0;
|
FormId = 0;
|
||||||
|
|
||||||
RefreshUpdateData ();
|
RefreshUpdateData ();
|
||||||
|
mStartLabel->Number = FORM_FILE_EXPLORER_ID;
|
||||||
|
|
||||||
for (Index = 0; Index < MenuOption->MenuNumber; Index++) {
|
for (Index = 0; Index < MenuOption->MenuNumber; Index++) {
|
||||||
NewMenuEntry = BOpt_GetMenuEntry (MenuOption, Index);
|
NewMenuEntry = BOpt_GetMenuEntry (MenuOption, Index);
|
||||||
|
@ -50,13 +51,13 @@ UpdateFileExplorePage (
|
||||||
//
|
//
|
||||||
// Create Text opcode for directory, also create Text opcode for file in BOOT_FROM_FILE_STATE.
|
// Create Text opcode for directory, also create Text opcode for file in BOOT_FROM_FILE_STATE.
|
||||||
//
|
//
|
||||||
CreateActionOpCode (
|
HiiCreateActionOpCode (
|
||||||
|
mStartOpCodeHandle,
|
||||||
(UINT16) (FILE_OPTION_OFFSET + Index),
|
(UINT16) (FILE_OPTION_OFFSET + Index),
|
||||||
NewMenuEntry->DisplayStringToken,
|
NewMenuEntry->DisplayStringToken,
|
||||||
STRING_TOKEN (STR_NULL_STRING),
|
STRING_TOKEN (STR_NULL_STRING),
|
||||||
EFI_IFR_FLAG_CALLBACK,
|
EFI_IFR_FLAG_CALLBACK,
|
||||||
0,
|
0
|
||||||
&gUpdateData
|
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
//
|
//
|
||||||
|
@ -68,24 +69,23 @@ UpdateFileExplorePage (
|
||||||
FormId = FORM_DRIVER_ADD_FILE_DESCRIPTION_ID;
|
FormId = FORM_DRIVER_ADD_FILE_DESCRIPTION_ID;
|
||||||
}
|
}
|
||||||
|
|
||||||
CreateGotoOpCode (
|
HiiCreateGotoOpCode (
|
||||||
|
mStartOpCodeHandle,
|
||||||
FormId,
|
FormId,
|
||||||
NewMenuEntry->DisplayStringToken,
|
NewMenuEntry->DisplayStringToken,
|
||||||
STRING_TOKEN (STR_NULL_STRING),
|
STRING_TOKEN (STR_NULL_STRING),
|
||||||
EFI_IFR_FLAG_CALLBACK,
|
EFI_IFR_FLAG_CALLBACK,
|
||||||
(UINT16) (FILE_OPTION_OFFSET + Index),
|
(UINT16) (FILE_OPTION_OFFSET + Index)
|
||||||
&gUpdateData
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
IfrLibUpdateForm (
|
HiiUpdateForm (
|
||||||
CallbackData->FeHiiHandle,
|
CallbackData->FeHiiHandle,
|
||||||
&mFileExplorerGuid,
|
&mFileExplorerGuid,
|
||||||
FORM_FILE_EXPLORER_ID,
|
FORM_FILE_EXPLORER_ID,
|
||||||
FORM_FILE_EXPLORER_ID,
|
mStartOpCodeHandle, // Label FORM_FILE_EXPLORER_ID
|
||||||
FALSE,
|
mEndOpCodeHandle // LABEL_END
|
||||||
&gUpdateData
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -179,22 +179,22 @@ UpdateFileExplorer (
|
||||||
// Create Subtitle op-code for the display string of the option.
|
// Create Subtitle op-code for the display string of the option.
|
||||||
//
|
//
|
||||||
RefreshUpdateData ();
|
RefreshUpdateData ();
|
||||||
|
mStartLabel->Number = FormId;
|
||||||
|
|
||||||
CreateSubTitleOpCode (
|
HiiCreateSubTitleOpCode (
|
||||||
|
mStartOpCodeHandle,
|
||||||
NewMenuEntry->DisplayStringToken,
|
NewMenuEntry->DisplayStringToken,
|
||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
0,
|
0
|
||||||
&gUpdateData
|
|
||||||
);
|
);
|
||||||
|
|
||||||
IfrLibUpdateForm (
|
HiiUpdateForm (
|
||||||
CallbackData->FeHiiHandle,
|
CallbackData->FeHiiHandle,
|
||||||
&mFileExplorerGuid,
|
&mFileExplorerGuid,
|
||||||
FormId,
|
FormId,
|
||||||
FormId,
|
mStartOpCodeHandle, // Label FormId
|
||||||
FALSE,
|
mEndOpCodeHandle // LABEL_END
|
||||||
&gUpdateData
|
|
||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -248,7 +248,6 @@ FileExplorerCallback (
|
||||||
BMM_CALLBACK_DATA *Private;
|
BMM_CALLBACK_DATA *Private;
|
||||||
FILE_EXPLORER_NV_DATA *NvRamMap;
|
FILE_EXPLORER_NV_DATA *NvRamMap;
|
||||||
EFI_STATUS Status;
|
EFI_STATUS Status;
|
||||||
UINTN BufferSize;
|
|
||||||
|
|
||||||
if ((Value == NULL) || (ActionRequest == NULL)) {
|
if ((Value == NULL) || (ActionRequest == NULL)) {
|
||||||
return EFI_INVALID_PARAMETER;
|
return EFI_INVALID_PARAMETER;
|
||||||
|
@ -261,12 +260,13 @@ FileExplorerCallback (
|
||||||
//
|
//
|
||||||
// Retrieve uncommitted data from Form Browser
|
// Retrieve uncommitted data from Form Browser
|
||||||
//
|
//
|
||||||
NvRamMap = &Private->FeFakeNvData;
|
NvRamMap = (FILE_EXPLORER_NV_DATA *) HiiGetBrowserData (&mFileExplorerGuid, mFileExplorerStorageName, sizeof (FILE_EXPLORER_NV_DATA));
|
||||||
BufferSize = sizeof (FILE_EXPLORER_NV_DATA);
|
if (NvRamMap == NULL) {
|
||||||
Status = GetBrowserData (NULL, NULL, &BufferSize, (UINT8 *) NvRamMap);
|
return EFI_NOT_FOUND;
|
||||||
if (EFI_ERROR (Status)) {
|
|
||||||
return Status;
|
|
||||||
}
|
}
|
||||||
|
CopyMem (&Private->FeFakeNvData, NvRamMap, sizeof (FILE_EXPLORER_NV_DATA));
|
||||||
|
FreePool (NvRamMap);
|
||||||
|
NvRamMap = &Private->FeFakeNvData;
|
||||||
|
|
||||||
if (QuestionId == KEY_VALUE_SAVE_AND_EXIT_BOOT || QuestionId == KEY_VALUE_SAVE_AND_EXIT_DRIVER) {
|
if (QuestionId == KEY_VALUE_SAVE_AND_EXIT_BOOT || QuestionId == KEY_VALUE_SAVE_AND_EXIT_DRIVER) {
|
||||||
//
|
//
|
||||||
|
|
|
@ -82,6 +82,11 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||||
#define VARSTORE_ID_BOOT_MAINT 0x1000
|
#define VARSTORE_ID_BOOT_MAINT 0x1000
|
||||||
#define VARSTORE_ID_FILE_EXPLORER 0x1001
|
#define VARSTORE_ID_FILE_EXPLORER 0x1001
|
||||||
|
|
||||||
|
//
|
||||||
|
// End Label
|
||||||
|
//
|
||||||
|
#define LABEL_END 0xffff
|
||||||
|
|
||||||
///
|
///
|
||||||
/// This is the structure that will be used to store the
|
/// This is the structure that will be used to store the
|
||||||
/// question's current value. Use it at initialize time to
|
/// question's current value. Use it at initialize time to
|
||||||
|
|
|
@ -23,7 +23,24 @@ RefreshUpdateData (
|
||||||
VOID
|
VOID
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
gUpdateData.Offset = 0;
|
//
|
||||||
|
// Free current updated date
|
||||||
|
//
|
||||||
|
if (mStartOpCodeHandle != NULL) {
|
||||||
|
HiiFreeOpCodeHandle (mStartOpCodeHandle);
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Create new OpCode Handle
|
||||||
|
//
|
||||||
|
mStartOpCodeHandle = HiiAllocateOpCodeHandle ();
|
||||||
|
|
||||||
|
//
|
||||||
|
// Create Hii Extend Label OpCode as the start opcode
|
||||||
|
//
|
||||||
|
mStartLabel = (EFI_IFR_GUID_LABEL *) HiiCreateGuidOpCode (mStartOpCodeHandle, &gEfiIfrTianoGuid, NULL, sizeof (EFI_IFR_GUID_LABEL));
|
||||||
|
mStartLabel->ExtendOpCode = EFI_IFR_EXTEND_OP_LABEL;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -39,19 +56,20 @@ UpdatePageStart (
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
RefreshUpdateData ();
|
RefreshUpdateData ();
|
||||||
|
mStartLabel->Number = CallbackData->BmmCurrentPageId;
|
||||||
|
|
||||||
if (!(CallbackData->BmmAskSaveOrNot)) {
|
if (!(CallbackData->BmmAskSaveOrNot)) {
|
||||||
//
|
//
|
||||||
// Add a "Go back to main page" tag in front of the form when there are no
|
// Add a "Go back to main page" tag in front of the form when there are no
|
||||||
// "Apply changes" and "Discard changes" tags in the end of the form.
|
// "Apply changes" and "Discard changes" tags in the end of the form.
|
||||||
//
|
//
|
||||||
CreateGotoOpCode (
|
HiiCreateGotoOpCode (
|
||||||
|
mStartOpCodeHandle,
|
||||||
FORM_MAIN_ID,
|
FORM_MAIN_ID,
|
||||||
STRING_TOKEN (STR_FORM_GOTO_MAIN),
|
STRING_TOKEN (STR_FORM_GOTO_MAIN),
|
||||||
STRING_TOKEN (STR_FORM_GOTO_MAIN),
|
STRING_TOKEN (STR_FORM_GOTO_MAIN),
|
||||||
0,
|
0,
|
||||||
FORM_MAIN_ID,
|
FORM_MAIN_ID
|
||||||
&gUpdateData
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -73,43 +91,42 @@ UpdatePageEnd (
|
||||||
// Create the "Apply changes" and "Discard changes" tags.
|
// Create the "Apply changes" and "Discard changes" tags.
|
||||||
//
|
//
|
||||||
if (CallbackData->BmmAskSaveOrNot) {
|
if (CallbackData->BmmAskSaveOrNot) {
|
||||||
CreateSubTitleOpCode (
|
HiiCreateSubTitleOpCode (
|
||||||
|
mStartOpCodeHandle,
|
||||||
STRING_TOKEN (STR_NULL_STRING),
|
STRING_TOKEN (STR_NULL_STRING),
|
||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
0,
|
0
|
||||||
&gUpdateData
|
|
||||||
);
|
);
|
||||||
|
|
||||||
CreateGotoOpCode (
|
HiiCreateGotoOpCode (
|
||||||
|
mStartOpCodeHandle,
|
||||||
FORM_MAIN_ID,
|
FORM_MAIN_ID,
|
||||||
STRING_TOKEN (STR_SAVE_AND_EXIT),
|
STRING_TOKEN (STR_SAVE_AND_EXIT),
|
||||||
STRING_TOKEN (STR_NULL_STRING),
|
STRING_TOKEN (STR_NULL_STRING),
|
||||||
EFI_IFR_FLAG_CALLBACK,
|
EFI_IFR_FLAG_CALLBACK,
|
||||||
KEY_VALUE_SAVE_AND_EXIT,
|
KEY_VALUE_SAVE_AND_EXIT
|
||||||
&gUpdateData
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Ensure user can return to the main page.
|
// Ensure user can return to the main page.
|
||||||
//
|
//
|
||||||
CreateGotoOpCode (
|
HiiCreateGotoOpCode (
|
||||||
|
mStartOpCodeHandle,
|
||||||
FORM_MAIN_ID,
|
FORM_MAIN_ID,
|
||||||
STRING_TOKEN (STR_NO_SAVE_AND_EXIT),
|
STRING_TOKEN (STR_NO_SAVE_AND_EXIT),
|
||||||
STRING_TOKEN (STR_NULL_STRING),
|
STRING_TOKEN (STR_NULL_STRING),
|
||||||
EFI_IFR_FLAG_CALLBACK,
|
EFI_IFR_FLAG_CALLBACK,
|
||||||
KEY_VALUE_NO_SAVE_AND_EXIT,
|
KEY_VALUE_NO_SAVE_AND_EXIT
|
||||||
&gUpdateData
|
|
||||||
);
|
);
|
||||||
|
|
||||||
IfrLibUpdateForm (
|
HiiUpdateForm (
|
||||||
CallbackData->BmmHiiHandle,
|
CallbackData->BmmHiiHandle,
|
||||||
&mBootMaintGuid,
|
&mBootMaintGuid,
|
||||||
CallbackData->BmmCurrentPageId,
|
CallbackData->BmmCurrentPageId,
|
||||||
CallbackData->BmmCurrentPageId,
|
mStartOpCodeHandle, // Label CallbackData->BmmCurrentPageId
|
||||||
FALSE,
|
mEndOpCodeHandle // LABEL_END
|
||||||
&gUpdateData
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -131,13 +148,13 @@ CleanUpPage (
|
||||||
//
|
//
|
||||||
// Remove all op-codes from dynamic page
|
// Remove all op-codes from dynamic page
|
||||||
//
|
//
|
||||||
IfrLibUpdateForm (
|
mStartLabel->Number = LabelId;
|
||||||
|
HiiUpdateForm (
|
||||||
CallbackData->BmmHiiHandle,
|
CallbackData->BmmHiiHandle,
|
||||||
&mBootMaintGuid,
|
&mBootMaintGuid,
|
||||||
LabelId,
|
LabelId,
|
||||||
LabelId,
|
mStartOpCodeHandle, // Label LabelId
|
||||||
FALSE,
|
mEndOpCodeHandle // LABEL_END
|
||||||
&gUpdateData
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -203,13 +220,13 @@ UpdateConCOMPage (
|
||||||
for (Index = 0; Index < TerminalMenu.MenuNumber; Index++) {
|
for (Index = 0; Index < TerminalMenu.MenuNumber; Index++) {
|
||||||
NewMenuEntry = BOpt_GetMenuEntry (&TerminalMenu, Index);
|
NewMenuEntry = BOpt_GetMenuEntry (&TerminalMenu, Index);
|
||||||
|
|
||||||
CreateGotoOpCode (
|
HiiCreateGotoOpCode (
|
||||||
|
mStartOpCodeHandle,
|
||||||
FORM_CON_COM_SETUP_ID,
|
FORM_CON_COM_SETUP_ID,
|
||||||
NewMenuEntry->DisplayStringToken,
|
NewMenuEntry->DisplayStringToken,
|
||||||
STRING_TOKEN (STR_NULL_STRING),
|
STRING_TOKEN (STR_NULL_STRING),
|
||||||
EFI_IFR_FLAG_CALLBACK,
|
EFI_IFR_FLAG_CALLBACK,
|
||||||
(UINT16) (TERMINAL_OPTION_OFFSET + Index),
|
(UINT16) (TERMINAL_OPTION_OFFSET + Index)
|
||||||
&gUpdateData
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -248,7 +265,8 @@ UpdateBootDelPage (
|
||||||
NewLoadContext->Deleted = FALSE;
|
NewLoadContext->Deleted = FALSE;
|
||||||
CallbackData->BmmFakeNvData.BootOptionDel[Index] = 0x00;
|
CallbackData->BmmFakeNvData.BootOptionDel[Index] = 0x00;
|
||||||
|
|
||||||
CreateCheckBoxOpCode (
|
HiiCreateCheckBoxOpCode (
|
||||||
|
mStartOpCodeHandle,
|
||||||
(EFI_QUESTION_ID) (BOOT_OPTION_DEL_QUESTION_ID + Index),
|
(EFI_QUESTION_ID) (BOOT_OPTION_DEL_QUESTION_ID + Index),
|
||||||
VARSTORE_ID_BOOT_MAINT,
|
VARSTORE_ID_BOOT_MAINT,
|
||||||
(UINT16) (BOOT_OPTION_DEL_VAR_OFFSET + Index),
|
(UINT16) (BOOT_OPTION_DEL_VAR_OFFSET + Index),
|
||||||
|
@ -256,7 +274,7 @@ UpdateBootDelPage (
|
||||||
NewMenuEntry->HelpStringToken,
|
NewMenuEntry->HelpStringToken,
|
||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
&gUpdateData
|
NULL
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -284,13 +302,13 @@ UpdateDrvAddHandlePage (
|
||||||
for (Index = 0; Index < DriverMenu.MenuNumber; Index++) {
|
for (Index = 0; Index < DriverMenu.MenuNumber; Index++) {
|
||||||
NewMenuEntry = BOpt_GetMenuEntry (&DriverMenu, Index);
|
NewMenuEntry = BOpt_GetMenuEntry (&DriverMenu, Index);
|
||||||
|
|
||||||
CreateGotoOpCode (
|
HiiCreateGotoOpCode (
|
||||||
|
mStartOpCodeHandle,
|
||||||
FORM_DRV_ADD_HANDLE_DESC_ID,
|
FORM_DRV_ADD_HANDLE_DESC_ID,
|
||||||
NewMenuEntry->DisplayStringToken,
|
NewMenuEntry->DisplayStringToken,
|
||||||
STRING_TOKEN (STR_NULL_STRING),
|
STRING_TOKEN (STR_NULL_STRING),
|
||||||
EFI_IFR_FLAG_CALLBACK,
|
EFI_IFR_FLAG_CALLBACK,
|
||||||
(UINT16) (HANDLE_OPTION_OFFSET + Index),
|
(UINT16) (HANDLE_OPTION_OFFSET + Index)
|
||||||
&gUpdateData
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -327,7 +345,8 @@ UpdateDrvDelPage (
|
||||||
NewLoadContext->Deleted = FALSE;
|
NewLoadContext->Deleted = FALSE;
|
||||||
CallbackData->BmmFakeNvData.DriverOptionDel[Index] = 0x00;
|
CallbackData->BmmFakeNvData.DriverOptionDel[Index] = 0x00;
|
||||||
|
|
||||||
CreateCheckBoxOpCode (
|
HiiCreateCheckBoxOpCode (
|
||||||
|
mStartOpCodeHandle,
|
||||||
(EFI_QUESTION_ID) (DRIVER_OPTION_DEL_QUESTION_ID + Index),
|
(EFI_QUESTION_ID) (DRIVER_OPTION_DEL_QUESTION_ID + Index),
|
||||||
VARSTORE_ID_BOOT_MAINT,
|
VARSTORE_ID_BOOT_MAINT,
|
||||||
(UINT16) (DRIVER_OPTION_DEL_VAR_OFFSET + Index),
|
(UINT16) (DRIVER_OPTION_DEL_VAR_OFFSET + Index),
|
||||||
|
@ -335,7 +354,7 @@ UpdateDrvDelPage (
|
||||||
NewMenuEntry->HelpStringToken,
|
NewMenuEntry->HelpStringToken,
|
||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
&gUpdateData
|
NULL
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -363,15 +382,16 @@ UpdateDriverAddHandleDescPage (
|
||||||
|
|
||||||
UpdatePageStart (CallbackData);
|
UpdatePageStart (CallbackData);
|
||||||
|
|
||||||
CreateSubTitleOpCode (
|
HiiCreateSubTitleOpCode (
|
||||||
|
mStartOpCodeHandle,
|
||||||
NewMenuEntry->DisplayStringToken,
|
NewMenuEntry->DisplayStringToken,
|
||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
0,
|
0
|
||||||
&gUpdateData
|
|
||||||
);
|
);
|
||||||
|
|
||||||
CreateStringOpCode (
|
HiiCreateStringOpCode (
|
||||||
|
mStartOpCodeHandle,
|
||||||
(EFI_QUESTION_ID) DRV_ADD_HANDLE_DESC_QUESTION_ID,
|
(EFI_QUESTION_ID) DRV_ADD_HANDLE_DESC_QUESTION_ID,
|
||||||
VARSTORE_ID_BOOT_MAINT,
|
VARSTORE_ID_BOOT_MAINT,
|
||||||
DRV_ADD_HANDLE_DESC_VAR_OFFSET,
|
DRV_ADD_HANDLE_DESC_VAR_OFFSET,
|
||||||
|
@ -381,10 +401,11 @@ UpdateDriverAddHandleDescPage (
|
||||||
0,
|
0,
|
||||||
6,
|
6,
|
||||||
75,
|
75,
|
||||||
&gUpdateData
|
NULL
|
||||||
);
|
);
|
||||||
|
|
||||||
CreateCheckBoxOpCode (
|
HiiCreateCheckBoxOpCode (
|
||||||
|
mStartOpCodeHandle,
|
||||||
(EFI_QUESTION_ID) DRV_ADD_RECON_QUESTION_ID,
|
(EFI_QUESTION_ID) DRV_ADD_RECON_QUESTION_ID,
|
||||||
VARSTORE_ID_BOOT_MAINT,
|
VARSTORE_ID_BOOT_MAINT,
|
||||||
DRV_ADD_RECON_VAR_OFFSET,
|
DRV_ADD_RECON_VAR_OFFSET,
|
||||||
|
@ -392,10 +413,11 @@ UpdateDriverAddHandleDescPage (
|
||||||
STRING_TOKEN (STR_LOAD_OPTION_FORCE_RECON),
|
STRING_TOKEN (STR_LOAD_OPTION_FORCE_RECON),
|
||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
&gUpdateData
|
NULL
|
||||||
);
|
);
|
||||||
|
|
||||||
CreateStringOpCode (
|
HiiCreateStringOpCode (
|
||||||
|
mStartOpCodeHandle,
|
||||||
(EFI_QUESTION_ID) DRIVER_ADD_OPTION_QUESTION_ID,
|
(EFI_QUESTION_ID) DRIVER_ADD_OPTION_QUESTION_ID,
|
||||||
VARSTORE_ID_BOOT_MAINT,
|
VARSTORE_ID_BOOT_MAINT,
|
||||||
DRIVER_ADD_OPTION_VAR_OFFSET,
|
DRIVER_ADD_OPTION_VAR_OFFSET,
|
||||||
|
@ -405,7 +427,7 @@ UpdateDriverAddHandleDescPage (
|
||||||
0,
|
0,
|
||||||
6,
|
6,
|
||||||
75,
|
75,
|
||||||
&gUpdateData
|
NULL
|
||||||
);
|
);
|
||||||
|
|
||||||
UpdatePageEnd (CallbackData);
|
UpdatePageEnd (CallbackData);
|
||||||
|
@ -449,7 +471,8 @@ UpdateConsolePage (
|
||||||
CallbackData->BmmFakeNvData.ConsoleCheck[Index] = FALSE;
|
CallbackData->BmmFakeNvData.ConsoleCheck[Index] = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
CreateCheckBoxOpCode (
|
HiiCreateCheckBoxOpCode (
|
||||||
|
mStartOpCodeHandle,
|
||||||
(EFI_QUESTION_ID) (CON_DEVICE_QUESTION_ID + Index),
|
(EFI_QUESTION_ID) (CON_DEVICE_QUESTION_ID + Index),
|
||||||
VARSTORE_ID_BOOT_MAINT,
|
VARSTORE_ID_BOOT_MAINT,
|
||||||
(UINT16) (CON_DEVICE_VAR_OFFSET + Index),
|
(UINT16) (CON_DEVICE_VAR_OFFSET + Index),
|
||||||
|
@ -457,7 +480,7 @@ UpdateConsolePage (
|
||||||
NewMenuEntry->HelpStringToken,
|
NewMenuEntry->HelpStringToken,
|
||||||
0,
|
0,
|
||||||
CheckFlags,
|
CheckFlags,
|
||||||
&gUpdateData
|
NULL
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -476,7 +499,8 @@ UpdateConsolePage (
|
||||||
CallbackData->BmmFakeNvData.ConsoleCheck[Index] = FALSE;
|
CallbackData->BmmFakeNvData.ConsoleCheck[Index] = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
CreateCheckBoxOpCode (
|
HiiCreateCheckBoxOpCode (
|
||||||
|
mStartOpCodeHandle,
|
||||||
(EFI_QUESTION_ID) (CON_DEVICE_QUESTION_ID + Index),
|
(EFI_QUESTION_ID) (CON_DEVICE_QUESTION_ID + Index),
|
||||||
VARSTORE_ID_BOOT_MAINT,
|
VARSTORE_ID_BOOT_MAINT,
|
||||||
(UINT16) (CON_DEVICE_VAR_OFFSET + Index),
|
(UINT16) (CON_DEVICE_VAR_OFFSET + Index),
|
||||||
|
@ -484,7 +508,7 @@ UpdateConsolePage (
|
||||||
NewMenuEntry->HelpStringToken,
|
NewMenuEntry->HelpStringToken,
|
||||||
0,
|
0,
|
||||||
CheckFlags,
|
CheckFlags,
|
||||||
&gUpdateData
|
NULL
|
||||||
);
|
);
|
||||||
|
|
||||||
Index++;
|
Index++;
|
||||||
|
@ -511,7 +535,7 @@ UpdateOrderPage (
|
||||||
{
|
{
|
||||||
BM_MENU_ENTRY *NewMenuEntry;
|
BM_MENU_ENTRY *NewMenuEntry;
|
||||||
UINT16 Index;
|
UINT16 Index;
|
||||||
IFR_OPTION *IfrOptionList;
|
VOID *OptionsOpCodeHandle;
|
||||||
|
|
||||||
CallbackData->BmmAskSaveOrNot = TRUE;
|
CallbackData->BmmAskSaveOrNot = TRUE;
|
||||||
|
|
||||||
|
@ -521,37 +545,39 @@ UpdateOrderPage (
|
||||||
|
|
||||||
ZeroMem (CallbackData->BmmFakeNvData.OptionOrder, 100);
|
ZeroMem (CallbackData->BmmFakeNvData.OptionOrder, 100);
|
||||||
|
|
||||||
IfrOptionList = AllocateZeroPool (sizeof (IFR_OPTION) * OptionMenu->MenuNumber);
|
OptionsOpCodeHandle = HiiAllocateOpCodeHandle ();
|
||||||
if (IfrOptionList == NULL) {
|
ASSERT (OptionsOpCodeHandle != NULL);
|
||||||
return ;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (Index = 0; Index < OptionMenu->MenuNumber; Index++) {
|
for (Index = 0; Index < OptionMenu->MenuNumber; Index++) {
|
||||||
NewMenuEntry = BOpt_GetMenuEntry (OptionMenu, Index);
|
NewMenuEntry = BOpt_GetMenuEntry (OptionMenu, Index);
|
||||||
IfrOptionList[Index].StringToken = NewMenuEntry->DisplayStringToken;
|
HiiCreateOneOfOptionOpCode (
|
||||||
IfrOptionList[Index].Value.u8 = (UINT8) (NewMenuEntry->OptionNumber + 1);
|
OptionsOpCodeHandle,
|
||||||
IfrOptionList[Index].Flags = 0;
|
NewMenuEntry->DisplayStringToken,
|
||||||
CallbackData->BmmFakeNvData.OptionOrder[Index] = IfrOptionList[Index].Value.u8;
|
0,
|
||||||
|
EFI_IFR_NUMERIC_SIZE_1,
|
||||||
|
(UINT8) (NewMenuEntry->OptionNumber + 1)
|
||||||
|
);
|
||||||
|
CallbackData->BmmFakeNvData.OptionOrder[Index] = (UINT8) (NewMenuEntry->OptionNumber + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (OptionMenu->MenuNumber > 0) {
|
if (OptionMenu->MenuNumber > 0) {
|
||||||
CreateOrderedListOpCode (
|
HiiCreateOrderedListOpCode (
|
||||||
(EFI_QUESTION_ID) OPTION_ORDER_QUESTION_ID,
|
mStartOpCodeHandle, // Container for dynamic created opcodes
|
||||||
VARSTORE_ID_BOOT_MAINT,
|
(EFI_QUESTION_ID) OPTION_ORDER_QUESTION_ID, // Question ID
|
||||||
OPTION_ORDER_VAR_OFFSET,
|
VARSTORE_ID_BOOT_MAINT, // VarStore ID
|
||||||
STRING_TOKEN (STR_CHANGE_ORDER),
|
OPTION_ORDER_VAR_OFFSET, // Offset in Buffer Storage
|
||||||
STRING_TOKEN (STR_CHANGE_ORDER),
|
STRING_TOKEN (STR_CHANGE_ORDER), // Question prompt text
|
||||||
0,
|
STRING_TOKEN (STR_CHANGE_ORDER), // Question help text
|
||||||
0,
|
0, // Question flag
|
||||||
EFI_IFR_NUMERIC_SIZE_1,
|
0, // Ordered list flag, e.g. EFI_IFR_UNIQUE_SET
|
||||||
100,
|
EFI_IFR_NUMERIC_SIZE_1, // Data type of Question value
|
||||||
IfrOptionList,
|
100, // Maximum container
|
||||||
OptionMenu->MenuNumber,
|
OptionsOpCodeHandle, // Option Opcode list
|
||||||
&gUpdateData
|
NULL // Default Opcode is NULL
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
FreePool (IfrOptionList);
|
HiiFreeOpCodeHandle (OptionsOpCodeHandle);
|
||||||
|
|
||||||
UpdatePageEnd (CallbackData);
|
UpdatePageEnd (CallbackData);
|
||||||
|
|
||||||
|
@ -576,11 +602,10 @@ UpdateBootNextPage (
|
||||||
{
|
{
|
||||||
BM_MENU_ENTRY *NewMenuEntry;
|
BM_MENU_ENTRY *NewMenuEntry;
|
||||||
BM_LOAD_CONTEXT *NewLoadContext;
|
BM_LOAD_CONTEXT *NewLoadContext;
|
||||||
IFR_OPTION *IfrOptionList;
|
|
||||||
UINTN NumberOfOptions;
|
UINTN NumberOfOptions;
|
||||||
UINT16 Index;
|
UINT16 Index;
|
||||||
|
VOID *OptionsOpCodeHandle;
|
||||||
|
|
||||||
IfrOptionList = NULL;
|
|
||||||
NumberOfOptions = BootOptionMenu.MenuNumber;
|
NumberOfOptions = BootOptionMenu.MenuNumber;
|
||||||
CallbackData->BmmAskSaveOrNot = TRUE;
|
CallbackData->BmmAskSaveOrNot = TRUE;
|
||||||
|
|
||||||
|
@ -588,34 +613,55 @@ UpdateBootNextPage (
|
||||||
CreateMenuStringToken (CallbackData, CallbackData->BmmHiiHandle, &BootOptionMenu);
|
CreateMenuStringToken (CallbackData, CallbackData->BmmHiiHandle, &BootOptionMenu);
|
||||||
|
|
||||||
if (NumberOfOptions > 0) {
|
if (NumberOfOptions > 0) {
|
||||||
IfrOptionList = AllocateZeroPool ((NumberOfOptions + 1) * sizeof (IFR_OPTION));
|
OptionsOpCodeHandle = HiiAllocateOpCodeHandle ();
|
||||||
|
ASSERT (OptionsOpCodeHandle != NULL);
|
||||||
ASSERT (IfrOptionList);
|
|
||||||
|
|
||||||
CallbackData->BmmFakeNvData.BootNext = (UINT16) (BootOptionMenu.MenuNumber);
|
CallbackData->BmmFakeNvData.BootNext = (UINT16) (BootOptionMenu.MenuNumber);
|
||||||
|
|
||||||
for (Index = 0; Index < BootOptionMenu.MenuNumber; Index++) {
|
for (Index = 0; Index < BootOptionMenu.MenuNumber; Index++) {
|
||||||
NewMenuEntry = BOpt_GetMenuEntry (&BootOptionMenu, Index);
|
NewMenuEntry = BOpt_GetMenuEntry (&BootOptionMenu, Index);
|
||||||
NewLoadContext = (BM_LOAD_CONTEXT *) NewMenuEntry->VariableContext;
|
NewLoadContext = (BM_LOAD_CONTEXT *) NewMenuEntry->VariableContext;
|
||||||
|
|
||||||
if (NewLoadContext->IsBootNext) {
|
if (NewLoadContext->IsBootNext) {
|
||||||
IfrOptionList[Index].Flags = EFI_IFR_OPTION_DEFAULT;
|
HiiCreateOneOfOptionOpCode (
|
||||||
|
OptionsOpCodeHandle,
|
||||||
|
NewMenuEntry->DisplayStringToken,
|
||||||
|
EFI_IFR_OPTION_DEFAULT,
|
||||||
|
EFI_IFR_NUMERIC_SIZE_2,
|
||||||
|
Index
|
||||||
|
);
|
||||||
CallbackData->BmmFakeNvData.BootNext = Index;
|
CallbackData->BmmFakeNvData.BootNext = Index;
|
||||||
} else {
|
} else {
|
||||||
IfrOptionList[Index].Flags = 0;
|
HiiCreateOneOfOptionOpCode (
|
||||||
|
OptionsOpCodeHandle,
|
||||||
|
NewMenuEntry->DisplayStringToken,
|
||||||
|
0,
|
||||||
|
EFI_IFR_NUMERIC_SIZE_2,
|
||||||
|
Index
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
IfrOptionList[Index].Value.u16 = Index;
|
|
||||||
IfrOptionList[Index].StringToken = NewMenuEntry->DisplayStringToken;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
IfrOptionList[Index].Value.u16 = Index;
|
|
||||||
IfrOptionList[Index].StringToken = STRING_TOKEN (STR_NONE);
|
|
||||||
IfrOptionList[Index].Flags = 0;
|
|
||||||
if (CallbackData->BmmFakeNvData.BootNext == Index) {
|
if (CallbackData->BmmFakeNvData.BootNext == Index) {
|
||||||
IfrOptionList[Index].Flags |= EFI_IFR_OPTION_DEFAULT;
|
HiiCreateOneOfOptionOpCode (
|
||||||
}
|
OptionsOpCodeHandle,
|
||||||
|
STRING_TOKEN (STR_NONE),
|
||||||
|
EFI_IFR_OPTION_DEFAULT,
|
||||||
|
EFI_IFR_NUMERIC_SIZE_2,
|
||||||
|
Index
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
HiiCreateOneOfOptionOpCode (
|
||||||
|
OptionsOpCodeHandle,
|
||||||
|
STRING_TOKEN (STR_NONE),
|
||||||
|
0,
|
||||||
|
EFI_IFR_NUMERIC_SIZE_2,
|
||||||
|
Index
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
CreateOneOfOpCode (
|
HiiCreateOneOfOpCode (
|
||||||
|
mStartOpCodeHandle,
|
||||||
(EFI_QUESTION_ID) BOOT_NEXT_QUESTION_ID,
|
(EFI_QUESTION_ID) BOOT_NEXT_QUESTION_ID,
|
||||||
VARSTORE_ID_BOOT_MAINT,
|
VARSTORE_ID_BOOT_MAINT,
|
||||||
BOOT_NEXT_VAR_OFFSET,
|
BOOT_NEXT_VAR_OFFSET,
|
||||||
|
@ -623,12 +669,11 @@ UpdateBootNextPage (
|
||||||
STRING_TOKEN (STR_BOOT_NEXT_HELP),
|
STRING_TOKEN (STR_BOOT_NEXT_HELP),
|
||||||
0,
|
0,
|
||||||
EFI_IFR_NUMERIC_SIZE_2,
|
EFI_IFR_NUMERIC_SIZE_2,
|
||||||
IfrOptionList,
|
OptionsOpCodeHandle,
|
||||||
(UINTN) (NumberOfOptions + 1),
|
NULL
|
||||||
&gUpdateData
|
|
||||||
);
|
);
|
||||||
|
|
||||||
FreePool (IfrOptionList);
|
HiiFreeOpCodeHandle (OptionsOpCodeHandle);
|
||||||
}
|
}
|
||||||
|
|
||||||
UpdatePageEnd (CallbackData);
|
UpdatePageEnd (CallbackData);
|
||||||
|
@ -646,6 +691,7 @@ UpdateTimeOutPage (
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
UINT16 BootTimeOut;
|
UINT16 BootTimeOut;
|
||||||
|
VOID *DefaultOpCodeHandle;
|
||||||
|
|
||||||
CallbackData->BmmAskSaveOrNot = TRUE;
|
CallbackData->BmmAskSaveOrNot = TRUE;
|
||||||
|
|
||||||
|
@ -653,7 +699,12 @@ UpdateTimeOutPage (
|
||||||
|
|
||||||
BootTimeOut = PcdGet16 (PcdPlatformBootTimeOut);
|
BootTimeOut = PcdGet16 (PcdPlatformBootTimeOut);
|
||||||
|
|
||||||
CreateNumericOpCode (
|
DefaultOpCodeHandle = HiiAllocateOpCodeHandle ();
|
||||||
|
ASSERT (DefaultOpCodeHandle != NULL);
|
||||||
|
HiiCreateDefaultOpCode (DefaultOpCodeHandle, EFI_HII_DEFAULT_CLASS_STANDARD, EFI_IFR_NUMERIC_SIZE_2, BootTimeOut);
|
||||||
|
|
||||||
|
HiiCreateNumericOpCode (
|
||||||
|
mStartOpCodeHandle,
|
||||||
(EFI_QUESTION_ID) BOOT_TIME_OUT_QUESTION_ID,
|
(EFI_QUESTION_ID) BOOT_TIME_OUT_QUESTION_ID,
|
||||||
VARSTORE_ID_BOOT_MAINT,
|
VARSTORE_ID_BOOT_MAINT,
|
||||||
BOOT_TIME_OUT_VAR_OFFSET,
|
BOOT_TIME_OUT_VAR_OFFSET,
|
||||||
|
@ -664,9 +715,10 @@ UpdateTimeOutPage (
|
||||||
0,
|
0,
|
||||||
65535,
|
65535,
|
||||||
0,
|
0,
|
||||||
BootTimeOut,
|
DefaultOpCodeHandle
|
||||||
&gUpdateData
|
|
||||||
);
|
);
|
||||||
|
|
||||||
|
HiiFreeOpCodeHandle (DefaultOpCodeHandle);
|
||||||
|
|
||||||
CallbackData->BmmFakeNvData.BootTimeOut = BootTimeOut;
|
CallbackData->BmmFakeNvData.BootTimeOut = BootTimeOut;
|
||||||
|
|
||||||
|
@ -694,8 +746,8 @@ UpdateConModePage (
|
||||||
UINTN MaxMode;
|
UINTN MaxMode;
|
||||||
UINTN ValidMode;
|
UINTN ValidMode;
|
||||||
EFI_STRING_ID *ModeToken;
|
EFI_STRING_ID *ModeToken;
|
||||||
IFR_OPTION *IfrOptionList;
|
|
||||||
EFI_STATUS Status;
|
EFI_STATUS Status;
|
||||||
|
VOID *OptionsOpCodeHandle;
|
||||||
EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *ConOut;
|
EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *ConOut;
|
||||||
|
|
||||||
ConOut = gST->ConOut;
|
ConOut = gST->ConOut;
|
||||||
|
@ -722,8 +774,8 @@ UpdateConModePage (
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
IfrOptionList = AllocateZeroPool (sizeof (IFR_OPTION) * ValidMode);
|
OptionsOpCodeHandle = HiiAllocateOpCodeHandle ();
|
||||||
ASSERT(IfrOptionList != NULL);
|
ASSERT (OptionsOpCodeHandle != NULL);
|
||||||
|
|
||||||
ModeToken = AllocateZeroPool (sizeof (EFI_STRING_ID) * ValidMode);
|
ModeToken = AllocateZeroPool (sizeof (EFI_STRING_ID) * ValidMode);
|
||||||
ASSERT(ModeToken != NULL);
|
ASSERT(ModeToken != NULL);
|
||||||
|
@ -754,17 +806,28 @@ UpdateConModePage (
|
||||||
|
|
||||||
ModeToken[Index] = HiiSetString (CallbackData->BmmHiiHandle, 0, ModeString, NULL);
|
ModeToken[Index] = HiiSetString (CallbackData->BmmHiiHandle, 0, ModeString, NULL);
|
||||||
|
|
||||||
IfrOptionList[Index].StringToken = ModeToken[Index];
|
|
||||||
IfrOptionList[Index].Value.u16 = (UINT16) Mode;
|
|
||||||
if (Mode == CallbackData->BmmFakeNvData.ConsoleOutMode) {
|
if (Mode == CallbackData->BmmFakeNvData.ConsoleOutMode) {
|
||||||
IfrOptionList[Index].Flags = EFI_IFR_OPTION_DEFAULT;
|
HiiCreateOneOfOptionOpCode (
|
||||||
|
OptionsOpCodeHandle,
|
||||||
|
ModeToken[Index],
|
||||||
|
EFI_IFR_OPTION_DEFAULT,
|
||||||
|
EFI_IFR_NUMERIC_SIZE_2,
|
||||||
|
(UINT16) Mode
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
IfrOptionList[Index].Flags = 0;
|
HiiCreateOneOfOptionOpCode (
|
||||||
|
OptionsOpCodeHandle,
|
||||||
|
ModeToken[Index],
|
||||||
|
0,
|
||||||
|
EFI_IFR_NUMERIC_SIZE_2,
|
||||||
|
(UINT16) Mode
|
||||||
|
);
|
||||||
}
|
}
|
||||||
Index++;
|
Index++;
|
||||||
}
|
}
|
||||||
|
|
||||||
CreateOneOfOpCode (
|
HiiCreateOneOfOpCode (
|
||||||
|
mStartOpCodeHandle,
|
||||||
(EFI_QUESTION_ID) CON_MODE_QUESTION_ID,
|
(EFI_QUESTION_ID) CON_MODE_QUESTION_ID,
|
||||||
VARSTORE_ID_BOOT_MAINT,
|
VARSTORE_ID_BOOT_MAINT,
|
||||||
CON_MODE_VAR_OFFSET,
|
CON_MODE_VAR_OFFSET,
|
||||||
|
@ -772,11 +835,11 @@ UpdateConModePage (
|
||||||
STRING_TOKEN (STR_CON_MODE_SETUP),
|
STRING_TOKEN (STR_CON_MODE_SETUP),
|
||||||
EFI_IFR_FLAG_RESET_REQUIRED,
|
EFI_IFR_FLAG_RESET_REQUIRED,
|
||||||
EFI_IFR_NUMERIC_SIZE_2,
|
EFI_IFR_NUMERIC_SIZE_2,
|
||||||
IfrOptionList,
|
OptionsOpCodeHandle,
|
||||||
ValidMode,
|
NULL
|
||||||
&gUpdateData
|
|
||||||
);
|
);
|
||||||
FreePool (IfrOptionList);
|
|
||||||
|
HiiFreeOpCodeHandle (OptionsOpCodeHandle);
|
||||||
FreePool (ModeToken);
|
FreePool (ModeToken);
|
||||||
|
|
||||||
UpdatePageEnd (CallbackData);
|
UpdatePageEnd (CallbackData);
|
||||||
|
@ -796,9 +859,9 @@ UpdateTerminalPage (
|
||||||
{
|
{
|
||||||
UINT8 Index;
|
UINT8 Index;
|
||||||
UINT8 CheckFlags;
|
UINT8 CheckFlags;
|
||||||
IFR_OPTION *IfrOptionList;
|
|
||||||
BM_MENU_ENTRY *NewMenuEntry;
|
BM_MENU_ENTRY *NewMenuEntry;
|
||||||
BM_TERMINAL_CONTEXT *NewTerminalContext;
|
BM_TERMINAL_CONTEXT *NewTerminalContext;
|
||||||
|
VOID *OptionsOpCodeHandle;
|
||||||
|
|
||||||
CallbackData->BmmAskSaveOrNot = TRUE;
|
CallbackData->BmmAskSaveOrNot = TRUE;
|
||||||
|
|
||||||
|
@ -815,10 +878,8 @@ UpdateTerminalPage (
|
||||||
|
|
||||||
NewTerminalContext = (BM_TERMINAL_CONTEXT *) NewMenuEntry->VariableContext;
|
NewTerminalContext = (BM_TERMINAL_CONTEXT *) NewMenuEntry->VariableContext;
|
||||||
|
|
||||||
IfrOptionList = AllocateZeroPool (sizeof (IFR_OPTION) * 19);
|
OptionsOpCodeHandle = HiiAllocateOpCodeHandle ();
|
||||||
if (IfrOptionList == NULL) {
|
ASSERT (OptionsOpCodeHandle != NULL);
|
||||||
return ;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (Index = 0; Index < sizeof (BaudRateList) / sizeof (BaudRateList [0]); Index++) {
|
for (Index = 0; Index < sizeof (BaudRateList) / sizeof (BaudRateList [0]); Index++) {
|
||||||
CheckFlags = 0;
|
CheckFlags = 0;
|
||||||
|
@ -828,12 +889,17 @@ UpdateTerminalPage (
|
||||||
CallbackData->BmmFakeNvData.COMBaudRate = NewTerminalContext->BaudRateIndex;
|
CallbackData->BmmFakeNvData.COMBaudRate = NewTerminalContext->BaudRateIndex;
|
||||||
}
|
}
|
||||||
|
|
||||||
IfrOptionList[Index].Flags = CheckFlags;
|
HiiCreateOneOfOptionOpCode (
|
||||||
IfrOptionList[Index].StringToken = BaudRateList[Index].StringToken;
|
OptionsOpCodeHandle,
|
||||||
IfrOptionList[Index].Value.u8 = Index;
|
BaudRateList[Index].StringToken,
|
||||||
|
CheckFlags,
|
||||||
|
EFI_IFR_NUMERIC_SIZE_1,
|
||||||
|
Index
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
CreateOneOfOpCode (
|
HiiCreateOneOfOpCode (
|
||||||
|
mStartOpCodeHandle,
|
||||||
(EFI_QUESTION_ID) COM_BAUD_RATE_QUESTION_ID,
|
(EFI_QUESTION_ID) COM_BAUD_RATE_QUESTION_ID,
|
||||||
VARSTORE_ID_BOOT_MAINT,
|
VARSTORE_ID_BOOT_MAINT,
|
||||||
COM_BAUD_RATE_VAR_OFFSET,
|
COM_BAUD_RATE_VAR_OFFSET,
|
||||||
|
@ -841,10 +907,13 @@ UpdateTerminalPage (
|
||||||
STRING_TOKEN (STR_COM_BAUD_RATE),
|
STRING_TOKEN (STR_COM_BAUD_RATE),
|
||||||
0,
|
0,
|
||||||
EFI_IFR_NUMERIC_SIZE_1,
|
EFI_IFR_NUMERIC_SIZE_1,
|
||||||
IfrOptionList,
|
OptionsOpCodeHandle,
|
||||||
19,
|
NULL
|
||||||
&gUpdateData
|
|
||||||
);
|
);
|
||||||
|
|
||||||
|
HiiFreeOpCodeHandle (OptionsOpCodeHandle);
|
||||||
|
OptionsOpCodeHandle = HiiAllocateOpCodeHandle ();
|
||||||
|
ASSERT (OptionsOpCodeHandle != NULL);
|
||||||
|
|
||||||
for (Index = 0; Index < sizeof (DataBitsList) / sizeof (DataBitsList[0]); Index++) {
|
for (Index = 0; Index < sizeof (DataBitsList) / sizeof (DataBitsList[0]); Index++) {
|
||||||
CheckFlags = 0;
|
CheckFlags = 0;
|
||||||
|
@ -855,12 +924,17 @@ UpdateTerminalPage (
|
||||||
CheckFlags |= EFI_IFR_OPTION_DEFAULT;
|
CheckFlags |= EFI_IFR_OPTION_DEFAULT;
|
||||||
}
|
}
|
||||||
|
|
||||||
IfrOptionList[Index].Flags = CheckFlags;
|
HiiCreateOneOfOptionOpCode (
|
||||||
IfrOptionList[Index].StringToken = DataBitsList[Index].StringToken;
|
OptionsOpCodeHandle,
|
||||||
IfrOptionList[Index].Value.u8 = Index;
|
DataBitsList[Index].StringToken,
|
||||||
|
CheckFlags,
|
||||||
|
EFI_IFR_NUMERIC_SIZE_1,
|
||||||
|
Index
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
CreateOneOfOpCode (
|
HiiCreateOneOfOpCode (
|
||||||
|
mStartOpCodeHandle,
|
||||||
(EFI_QUESTION_ID) COM_DATA_RATE_QUESTION_ID,
|
(EFI_QUESTION_ID) COM_DATA_RATE_QUESTION_ID,
|
||||||
VARSTORE_ID_BOOT_MAINT,
|
VARSTORE_ID_BOOT_MAINT,
|
||||||
COM_DATA_RATE_VAR_OFFSET,
|
COM_DATA_RATE_VAR_OFFSET,
|
||||||
|
@ -868,11 +942,14 @@ UpdateTerminalPage (
|
||||||
STRING_TOKEN (STR_COM_DATA_BITS),
|
STRING_TOKEN (STR_COM_DATA_BITS),
|
||||||
0,
|
0,
|
||||||
EFI_IFR_NUMERIC_SIZE_1,
|
EFI_IFR_NUMERIC_SIZE_1,
|
||||||
IfrOptionList,
|
OptionsOpCodeHandle,
|
||||||
4,
|
NULL
|
||||||
&gUpdateData
|
|
||||||
);
|
);
|
||||||
|
|
||||||
|
HiiFreeOpCodeHandle (OptionsOpCodeHandle);
|
||||||
|
OptionsOpCodeHandle = HiiAllocateOpCodeHandle ();
|
||||||
|
ASSERT (OptionsOpCodeHandle != NULL);
|
||||||
|
|
||||||
for (Index = 0; Index < sizeof (ParityList) / sizeof (ParityList[0]); Index++) {
|
for (Index = 0; Index < sizeof (ParityList) / sizeof (ParityList[0]); Index++) {
|
||||||
CheckFlags = 0;
|
CheckFlags = 0;
|
||||||
if (NewTerminalContext->Parity == ParityList[Index].Value) {
|
if (NewTerminalContext->Parity == ParityList[Index].Value) {
|
||||||
|
@ -881,12 +958,17 @@ UpdateTerminalPage (
|
||||||
CallbackData->BmmFakeNvData.COMParity = NewTerminalContext->ParityIndex;
|
CallbackData->BmmFakeNvData.COMParity = NewTerminalContext->ParityIndex;
|
||||||
}
|
}
|
||||||
|
|
||||||
IfrOptionList[Index].Flags = CheckFlags;
|
HiiCreateOneOfOptionOpCode (
|
||||||
IfrOptionList[Index].StringToken = ParityList[Index].StringToken;
|
OptionsOpCodeHandle,
|
||||||
IfrOptionList[Index].Value.u8 = Index;
|
ParityList[Index].StringToken,
|
||||||
|
CheckFlags,
|
||||||
|
EFI_IFR_NUMERIC_SIZE_1,
|
||||||
|
Index
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
CreateOneOfOpCode (
|
HiiCreateOneOfOpCode (
|
||||||
|
mStartOpCodeHandle,
|
||||||
(EFI_QUESTION_ID) COM_PARITY_QUESTION_ID,
|
(EFI_QUESTION_ID) COM_PARITY_QUESTION_ID,
|
||||||
VARSTORE_ID_BOOT_MAINT,
|
VARSTORE_ID_BOOT_MAINT,
|
||||||
COM_PARITY_VAR_OFFSET,
|
COM_PARITY_VAR_OFFSET,
|
||||||
|
@ -894,11 +976,14 @@ UpdateTerminalPage (
|
||||||
STRING_TOKEN (STR_COM_PARITY),
|
STRING_TOKEN (STR_COM_PARITY),
|
||||||
0,
|
0,
|
||||||
EFI_IFR_NUMERIC_SIZE_1,
|
EFI_IFR_NUMERIC_SIZE_1,
|
||||||
IfrOptionList,
|
OptionsOpCodeHandle,
|
||||||
5,
|
NULL
|
||||||
&gUpdateData
|
|
||||||
);
|
);
|
||||||
|
|
||||||
|
HiiFreeOpCodeHandle (OptionsOpCodeHandle);
|
||||||
|
OptionsOpCodeHandle = HiiAllocateOpCodeHandle ();
|
||||||
|
ASSERT (OptionsOpCodeHandle != NULL);
|
||||||
|
|
||||||
for (Index = 0; Index < sizeof (StopBitsList) / sizeof (StopBitsList[0]); Index++) {
|
for (Index = 0; Index < sizeof (StopBitsList) / sizeof (StopBitsList[0]); Index++) {
|
||||||
CheckFlags = 0;
|
CheckFlags = 0;
|
||||||
if (NewTerminalContext->StopBits == StopBitsList[Index].Value) {
|
if (NewTerminalContext->StopBits == StopBitsList[Index].Value) {
|
||||||
|
@ -907,12 +992,17 @@ UpdateTerminalPage (
|
||||||
CallbackData->BmmFakeNvData.COMStopBits = NewTerminalContext->StopBitsIndex;
|
CallbackData->BmmFakeNvData.COMStopBits = NewTerminalContext->StopBitsIndex;
|
||||||
}
|
}
|
||||||
|
|
||||||
IfrOptionList[Index].Flags = CheckFlags;
|
HiiCreateOneOfOptionOpCode (
|
||||||
IfrOptionList[Index].StringToken = StopBitsList[Index].StringToken;
|
OptionsOpCodeHandle,
|
||||||
IfrOptionList[Index].Value.u8 = Index;
|
StopBitsList[Index].StringToken,
|
||||||
|
CheckFlags,
|
||||||
|
EFI_IFR_NUMERIC_SIZE_1,
|
||||||
|
Index
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
CreateOneOfOpCode (
|
HiiCreateOneOfOpCode (
|
||||||
|
mStartOpCodeHandle,
|
||||||
(EFI_QUESTION_ID) COM_STOP_BITS_QUESTION_ID,
|
(EFI_QUESTION_ID) COM_STOP_BITS_QUESTION_ID,
|
||||||
VARSTORE_ID_BOOT_MAINT,
|
VARSTORE_ID_BOOT_MAINT,
|
||||||
COM_STOP_BITS_VAR_OFFSET,
|
COM_STOP_BITS_VAR_OFFSET,
|
||||||
|
@ -920,11 +1010,14 @@ UpdateTerminalPage (
|
||||||
STRING_TOKEN (STR_COM_STOP_BITS),
|
STRING_TOKEN (STR_COM_STOP_BITS),
|
||||||
0,
|
0,
|
||||||
EFI_IFR_NUMERIC_SIZE_1,
|
EFI_IFR_NUMERIC_SIZE_1,
|
||||||
IfrOptionList,
|
OptionsOpCodeHandle,
|
||||||
3,
|
NULL
|
||||||
&gUpdateData
|
|
||||||
);
|
);
|
||||||
|
|
||||||
|
HiiFreeOpCodeHandle (OptionsOpCodeHandle);
|
||||||
|
OptionsOpCodeHandle = HiiAllocateOpCodeHandle ();
|
||||||
|
ASSERT (OptionsOpCodeHandle != NULL);
|
||||||
|
|
||||||
for (Index = 0; Index < 4; Index++) {
|
for (Index = 0; Index < 4; Index++) {
|
||||||
CheckFlags = 0;
|
CheckFlags = 0;
|
||||||
if (NewTerminalContext->TerminalType == Index) {
|
if (NewTerminalContext->TerminalType == Index) {
|
||||||
|
@ -932,12 +1025,17 @@ UpdateTerminalPage (
|
||||||
CallbackData->BmmFakeNvData.COMTerminalType = NewTerminalContext->TerminalType;
|
CallbackData->BmmFakeNvData.COMTerminalType = NewTerminalContext->TerminalType;
|
||||||
}
|
}
|
||||||
|
|
||||||
IfrOptionList[Index].Flags = CheckFlags;
|
HiiCreateOneOfOptionOpCode (
|
||||||
IfrOptionList[Index].StringToken = (EFI_STRING_ID) TerminalType[Index];
|
OptionsOpCodeHandle,
|
||||||
IfrOptionList[Index].Value.u8 = Index;
|
(EFI_STRING_ID) TerminalType[Index],
|
||||||
|
CheckFlags,
|
||||||
|
EFI_IFR_NUMERIC_SIZE_1,
|
||||||
|
Index
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
CreateOneOfOpCode (
|
HiiCreateOneOfOpCode (
|
||||||
|
mStartOpCodeHandle,
|
||||||
(EFI_QUESTION_ID) COM_TERMINAL_QUESTION_ID,
|
(EFI_QUESTION_ID) COM_TERMINAL_QUESTION_ID,
|
||||||
VARSTORE_ID_BOOT_MAINT,
|
VARSTORE_ID_BOOT_MAINT,
|
||||||
COM_TERMINAL_VAR_OFFSET,
|
COM_TERMINAL_VAR_OFFSET,
|
||||||
|
@ -945,12 +1043,11 @@ UpdateTerminalPage (
|
||||||
STRING_TOKEN (STR_COM_TERMI_TYPE),
|
STRING_TOKEN (STR_COM_TERMI_TYPE),
|
||||||
0,
|
0,
|
||||||
EFI_IFR_NUMERIC_SIZE_1,
|
EFI_IFR_NUMERIC_SIZE_1,
|
||||||
IfrOptionList,
|
OptionsOpCodeHandle,
|
||||||
4,
|
NULL
|
||||||
&gUpdateData
|
|
||||||
);
|
);
|
||||||
|
|
||||||
FreePool (IfrOptionList);
|
HiiFreeOpCodeHandle (OptionsOpCodeHandle);
|
||||||
|
|
||||||
UpdatePageEnd (CallbackData);
|
UpdatePageEnd (CallbackData);
|
||||||
}
|
}
|
||||||
|
@ -1100,7 +1197,6 @@ UpdateSetLegacyDeviceOrderPage (
|
||||||
BM_LEGACY_DEV_ORDER_CONTEXT *DevOrder;
|
BM_LEGACY_DEV_ORDER_CONTEXT *DevOrder;
|
||||||
BM_MENU_OPTION *OptionMenu;
|
BM_MENU_OPTION *OptionMenu;
|
||||||
BM_MENU_ENTRY *NewMenuEntry;
|
BM_MENU_ENTRY *NewMenuEntry;
|
||||||
IFR_OPTION *IfrOptionList;
|
|
||||||
EFI_STRING_ID StrRef;
|
EFI_STRING_ID StrRef;
|
||||||
EFI_STRING_ID StrRefHelp;
|
EFI_STRING_ID StrRefHelp;
|
||||||
BBS_TYPE BbsType;
|
BBS_TYPE BbsType;
|
||||||
|
@ -1117,6 +1213,7 @@ UpdateSetLegacyDeviceOrderPage (
|
||||||
UINT8 *LegacyOrder;
|
UINT8 *LegacyOrder;
|
||||||
UINT8 *OldData;
|
UINT8 *OldData;
|
||||||
UINT8 *DisMap;
|
UINT8 *DisMap;
|
||||||
|
VOID *OptionsOpCodeHandle;
|
||||||
|
|
||||||
OptionMenu = NULL;
|
OptionMenu = NULL;
|
||||||
Key = 0;
|
Key = 0;
|
||||||
|
@ -1196,27 +1293,41 @@ UpdateSetLegacyDeviceOrderPage (
|
||||||
|
|
||||||
CreateMenuStringToken (CallbackData, CallbackData->BmmHiiHandle, OptionMenu);
|
CreateMenuStringToken (CallbackData, CallbackData->BmmHiiHandle, OptionMenu);
|
||||||
|
|
||||||
IfrOptionList = AllocateZeroPool (sizeof (IFR_OPTION) * (OptionMenu->MenuNumber + 1));
|
OptionsOpCodeHandle = HiiAllocateOpCodeHandle ();
|
||||||
if (NULL == IfrOptionList) {
|
ASSERT (OptionsOpCodeHandle != NULL);
|
||||||
return ;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (Index = 0; Index < OptionMenu->MenuNumber; Index++) {
|
for (Index = 0; Index < OptionMenu->MenuNumber; Index++) {
|
||||||
NewMenuEntry = BOpt_GetMenuEntry (OptionMenu, Index);
|
NewMenuEntry = BOpt_GetMenuEntry (OptionMenu, Index);
|
||||||
IfrOptionList[Index].Flags = 0;
|
|
||||||
if (0 == Index) {
|
if (Index == 0) {
|
||||||
IfrOptionList[Index].Flags |= EFI_IFR_OPTION_DEFAULT;
|
HiiCreateOneOfOptionOpCode (
|
||||||
|
OptionsOpCodeHandle,
|
||||||
|
NewMenuEntry->DisplayStringToken,
|
||||||
|
EFI_IFR_OPTION_DEFAULT,
|
||||||
|
EFI_IFR_NUMERIC_SIZE_1,
|
||||||
|
(UINT8) ((BM_LEGACY_DEVICE_CONTEXT *) NewMenuEntry->VariableContext)->Index
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
IfrOptionList[Index].StringToken = NewMenuEntry->DisplayStringToken;
|
HiiCreateOneOfOptionOpCode (
|
||||||
IfrOptionList[Index].Value.u8 = (UINT8) ((BM_LEGACY_DEVICE_CONTEXT *) NewMenuEntry->VariableContext)->Index;
|
OptionsOpCodeHandle,
|
||||||
|
NewMenuEntry->DisplayStringToken,
|
||||||
|
0,
|
||||||
|
EFI_IFR_NUMERIC_SIZE_1,
|
||||||
|
(UINT8) ((BM_LEGACY_DEVICE_CONTEXT *) NewMenuEntry->VariableContext)->Index
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// for item "Disabled"
|
// for item "Disabled"
|
||||||
//
|
//
|
||||||
IfrOptionList[Index].Flags = 0;
|
HiiCreateOneOfOptionOpCode (
|
||||||
IfrOptionList[Index].StringToken = STRING_TOKEN (STR_DISABLE_LEGACY_DEVICE);
|
OptionsOpCodeHandle,
|
||||||
IfrOptionList[Index].Value.u8 = 0xFF;
|
STRING_TOKEN (STR_DISABLE_LEGACY_DEVICE),
|
||||||
|
0,
|
||||||
|
EFI_IFR_NUMERIC_SIZE_1,
|
||||||
|
0xFF
|
||||||
|
);
|
||||||
|
|
||||||
//
|
//
|
||||||
// Get Device Order from variable
|
// Get Device Order from variable
|
||||||
|
@ -1251,7 +1362,8 @@ UpdateSetLegacyDeviceOrderPage (
|
||||||
UnicodeSPrint (String, sizeof (String), TypeStrHelp, Index);
|
UnicodeSPrint (String, sizeof (String), TypeStrHelp, Index);
|
||||||
StrRefHelp = HiiSetString (CallbackData->BmmHiiHandle, 0, String, NULL);
|
StrRefHelp = HiiSetString (CallbackData->BmmHiiHandle, 0, String, NULL);
|
||||||
|
|
||||||
CreateOneOfOpCode (
|
HiiCreateOneOfOpCode (
|
||||||
|
mStartOpCodeHandle,
|
||||||
(EFI_QUESTION_ID) (Key + Index),
|
(EFI_QUESTION_ID) (Key + Index),
|
||||||
VARSTORE_ID_BOOT_MAINT,
|
VARSTORE_ID_BOOT_MAINT,
|
||||||
(UINT16) (Key + Index - CONFIG_OPTION_OFFSET),
|
(UINT16) (Key + Index - CONFIG_OPTION_OFFSET),
|
||||||
|
@ -1259,9 +1371,8 @@ UpdateSetLegacyDeviceOrderPage (
|
||||||
StrRefHelp,
|
StrRefHelp,
|
||||||
EFI_IFR_FLAG_CALLBACK,
|
EFI_IFR_FLAG_CALLBACK,
|
||||||
EFI_IFR_NUMERIC_SIZE_1,
|
EFI_IFR_NUMERIC_SIZE_1,
|
||||||
IfrOptionList,
|
OptionsOpCodeHandle,
|
||||||
OptionMenu->MenuNumber + 1,
|
NULL
|
||||||
&gUpdateData
|
|
||||||
);
|
);
|
||||||
|
|
||||||
VarDevOrder = *(UINT16 *) ((UINT8 *) DevOrder + sizeof (BBS_TYPE) + sizeof (UINT16) + Index * sizeof (UINT16));
|
VarDevOrder = *(UINT16 *) ((UINT8 *) DevOrder + sizeof (BBS_TYPE) + sizeof (UINT16) + Index * sizeof (UINT16));
|
||||||
|
@ -1279,10 +1390,7 @@ UpdateSetLegacyDeviceOrderPage (
|
||||||
|
|
||||||
CopyMem (OldData, LegacyOrder, 100);
|
CopyMem (OldData, LegacyOrder, 100);
|
||||||
|
|
||||||
if (IfrOptionList != NULL) {
|
HiiFreeOpCodeHandle (OptionsOpCodeHandle);
|
||||||
FreePool (IfrOptionList);
|
|
||||||
IfrOptionList = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
UpdatePageEnd (CallbackData);
|
UpdatePageEnd (CallbackData);
|
||||||
}
|
}
|
||||||
|
|
|
@ -186,7 +186,6 @@ CallBootManager (
|
||||||
EFI_STATUS Status;
|
EFI_STATUS Status;
|
||||||
BDS_COMMON_OPTION *Option;
|
BDS_COMMON_OPTION *Option;
|
||||||
LIST_ENTRY *Link;
|
LIST_ENTRY *Link;
|
||||||
EFI_HII_UPDATE_DATA UpdateData;
|
|
||||||
CHAR16 *ExitData;
|
CHAR16 *ExitData;
|
||||||
UINTN ExitDataSize;
|
UINTN ExitDataSize;
|
||||||
EFI_STRING_ID Token;
|
EFI_STRING_ID Token;
|
||||||
|
@ -198,6 +197,10 @@ CallBootManager (
|
||||||
EFI_HII_HANDLE HiiHandle;
|
EFI_HII_HANDLE HiiHandle;
|
||||||
EFI_BROWSER_ACTION_REQUEST ActionRequest;
|
EFI_BROWSER_ACTION_REQUEST ActionRequest;
|
||||||
UINTN TempSize;
|
UINTN TempSize;
|
||||||
|
VOID *StartOpCodeHandle;
|
||||||
|
VOID *EndOpCodeHandle;
|
||||||
|
EFI_IFR_GUID_LABEL *StartLabel;
|
||||||
|
EFI_IFR_GUID_LABEL *EndLabel;
|
||||||
|
|
||||||
gOption = NULL;
|
gOption = NULL;
|
||||||
InitializeListHead (&BdsBootOptionList);
|
InitializeListHead (&BdsBootOptionList);
|
||||||
|
@ -223,10 +226,25 @@ CallBootManager (
|
||||||
//
|
//
|
||||||
// Allocate space for creation of UpdateData Buffer
|
// Allocate space for creation of UpdateData Buffer
|
||||||
//
|
//
|
||||||
UpdateData.BufferSize = 0x1000;
|
StartOpCodeHandle = HiiAllocateOpCodeHandle ();
|
||||||
UpdateData.Offset = 0;
|
ASSERT (StartOpCodeHandle != NULL);
|
||||||
UpdateData.Data = AllocateZeroPool (0x1000);
|
|
||||||
ASSERT (UpdateData.Data != NULL);
|
EndOpCodeHandle = HiiAllocateOpCodeHandle ();
|
||||||
|
ASSERT (EndOpCodeHandle != NULL);
|
||||||
|
|
||||||
|
//
|
||||||
|
// Create Hii Extend Label OpCode as the start opcode
|
||||||
|
//
|
||||||
|
StartLabel = (EFI_IFR_GUID_LABEL *) HiiCreateGuidOpCode (StartOpCodeHandle, &gEfiIfrTianoGuid, NULL, sizeof (EFI_IFR_GUID_LABEL));
|
||||||
|
StartLabel->ExtendOpCode = EFI_IFR_EXTEND_OP_LABEL;
|
||||||
|
StartLabel->Number = LABEL_BOOT_OPTION;
|
||||||
|
|
||||||
|
//
|
||||||
|
// Create Hii Extend Label OpCode as the end opcode
|
||||||
|
//
|
||||||
|
EndLabel = (EFI_IFR_GUID_LABEL *) HiiCreateGuidOpCode (EndOpCodeHandle, &gEfiIfrTianoGuid, NULL, sizeof (EFI_IFR_GUID_LABEL));
|
||||||
|
EndLabel->ExtendOpCode = EFI_IFR_EXTEND_OP_LABEL;
|
||||||
|
EndLabel->Number = LABEL_BOOT_OPTION_END;
|
||||||
|
|
||||||
mKeyInput = 0;
|
mKeyInput = 0;
|
||||||
|
|
||||||
|
@ -256,32 +274,33 @@ CallBootManager (
|
||||||
|
|
||||||
HelpToken = HiiSetString (HiiHandle, 0, HelpString, NULL);
|
HelpToken = HiiSetString (HiiHandle, 0, HelpString, NULL);
|
||||||
|
|
||||||
CreateActionOpCode (
|
HiiCreateActionOpCode (
|
||||||
|
StartOpCodeHandle,
|
||||||
mKeyInput,
|
mKeyInput,
|
||||||
Token,
|
Token,
|
||||||
HelpToken,
|
HelpToken,
|
||||||
EFI_IFR_FLAG_CALLBACK,
|
EFI_IFR_FLAG_CALLBACK,
|
||||||
0,
|
0
|
||||||
&UpdateData
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
IfrLibUpdateForm (
|
HiiUpdateForm (
|
||||||
HiiHandle,
|
HiiHandle,
|
||||||
&mBootManagerGuid,
|
&mBootManagerGuid,
|
||||||
BOOT_MANAGER_FORM_ID,
|
BOOT_MANAGER_FORM_ID,
|
||||||
LABEL_BOOT_OPTION,
|
StartOpCodeHandle,
|
||||||
FALSE,
|
EndOpCodeHandle
|
||||||
&UpdateData
|
|
||||||
);
|
);
|
||||||
FreePool (UpdateData.Data);
|
|
||||||
|
HiiFreeOpCodeHandle (StartOpCodeHandle);
|
||||||
|
HiiFreeOpCodeHandle (EndOpCodeHandle);
|
||||||
|
|
||||||
ActionRequest = EFI_BROWSER_ACTION_REQUEST_NONE;
|
ActionRequest = EFI_BROWSER_ACTION_REQUEST_NONE;
|
||||||
Status = gFormBrowser2->SendForm (
|
Status = gFormBrowser2->SendForm (
|
||||||
gFormBrowser2,
|
gFormBrowser2,
|
||||||
&HiiHandle,
|
&HiiHandle,
|
||||||
1,
|
1,
|
||||||
NULL,
|
&mBootManagerGuid,
|
||||||
0,
|
0,
|
||||||
NULL,
|
NULL,
|
||||||
&ActionRequest
|
&ActionRequest
|
||||||
|
|
|
@ -29,6 +29,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||||
#define BOOT_MANAGER_FORM_ID 0x1000
|
#define BOOT_MANAGER_FORM_ID 0x1000
|
||||||
|
|
||||||
#define LABEL_BOOT_OPTION 0x00
|
#define LABEL_BOOT_OPTION 0x00
|
||||||
|
#define LABEL_BOOT_OPTION_END 0x01
|
||||||
|
|
||||||
//
|
//
|
||||||
// These are the VFR compiler generated data representing our VFR data.
|
// These are the VFR compiler generated data representing our VFR data.
|
||||||
|
|
|
@ -24,11 +24,12 @@
|
||||||
#define BOOT_MANAGER_SUBCLASS 0x00
|
#define BOOT_MANAGER_SUBCLASS 0x00
|
||||||
|
|
||||||
formset
|
formset
|
||||||
guid = FORMSET_GUID,
|
guid = FORMSET_GUID,
|
||||||
title = STRING_TOKEN(STR_BM_BANNER),
|
title = STRING_TOKEN(STR_BM_BANNER),
|
||||||
help = STRING_TOKEN(STR_LAST_STRING),
|
help = STRING_TOKEN(STR_LAST_STRING),
|
||||||
class = BOOT_MANAGER_CLASS,
|
classguid = FORMSET_GUID,
|
||||||
subclass = BOOT_MANAGER_SUBCLASS,
|
class = BOOT_MANAGER_CLASS,
|
||||||
|
subclass = BOOT_MANAGER_SUBCLASS,
|
||||||
|
|
||||||
form formid = BOOT_MANAGER_FORM_ID,
|
form formid = BOOT_MANAGER_FORM_ID,
|
||||||
title = STRING_TOKEN(STR_BM_BANNER);
|
title = STRING_TOKEN(STR_BM_BANNER);
|
||||||
|
|
|
@ -13,6 +13,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||||
**/
|
**/
|
||||||
|
|
||||||
#include "DeviceManager.h"
|
#include "DeviceManager.h"
|
||||||
|
#include <Guid/HiiPlatformSetupFormset.h>
|
||||||
|
|
||||||
DEVICE_MANAGER_CALLBACK_DATA gDeviceManagerPrivate = {
|
DEVICE_MANAGER_CALLBACK_DATA gDeviceManagerPrivate = {
|
||||||
DEVICE_MANAGER_CALLBACK_DATA_SIGNATURE,
|
DEVICE_MANAGER_CALLBACK_DATA_SIGNATURE,
|
||||||
|
@ -61,9 +62,6 @@ HII_VENDOR_DEVICE_PATH mDeviceManagerHiiVendorDevicePath = {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
#define MENU_ITEM_NUM \
|
|
||||||
(sizeof (mDeviceManagerMenuItemTable) / sizeof (DEVICE_MANAGER_MENU_ITEM))
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
This function is invoked if user selected a iteractive opcode from Device Manager's
|
This function is invoked if user selected a iteractive opcode from Device Manager's
|
||||||
Formset. The decision by user is saved to gCallbackKey for later processing. If
|
Formset. The decision by user is saved to gCallbackKey for later processing. If
|
||||||
|
@ -154,6 +152,124 @@ InitializeDeviceManager (
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
Extract the displayed formset for given HII handle and class guid.
|
||||||
|
|
||||||
|
@param Handle The HII handle.
|
||||||
|
@param SetupClassGuid The class guid specifies which form set will be displayed.
|
||||||
|
@param FormSetTitle Formset title string.
|
||||||
|
@param FormSetHelp Formset help string.
|
||||||
|
|
||||||
|
@retval TRUE The formset for given HII handle will be displayed.
|
||||||
|
@return FALSE The formset for given HII handle will not be displayed.
|
||||||
|
|
||||||
|
**/
|
||||||
|
BOOLEAN
|
||||||
|
ExtractDisplayedHiiFormFromHiiHandle (
|
||||||
|
IN EFI_HII_HANDLE Handle,
|
||||||
|
IN EFI_GUID *SetupClassGuid,
|
||||||
|
OUT EFI_STRING_ID *FormSetTitle,
|
||||||
|
OUT EFI_STRING_ID *FormSetHelp
|
||||||
|
)
|
||||||
|
{
|
||||||
|
EFI_STATUS Status;
|
||||||
|
UINTN BufferSize;
|
||||||
|
EFI_HII_PACKAGE_LIST_HEADER *HiiPackageList;
|
||||||
|
UINT8 *Package;
|
||||||
|
UINT8 *OpCodeData;
|
||||||
|
UINT32 Offset;
|
||||||
|
UINT32 Offset2;
|
||||||
|
UINT32 PackageListLength;
|
||||||
|
EFI_HII_PACKAGE_HEADER PackageHeader;
|
||||||
|
EFI_GUID *ClassGuid;
|
||||||
|
UINT8 ClassGuidNum;
|
||||||
|
|
||||||
|
ASSERT (Handle != NULL);
|
||||||
|
ASSERT (SetupClassGuid != NULL);
|
||||||
|
ASSERT (FormSetTitle != NULL);
|
||||||
|
ASSERT (FormSetHelp != NULL);
|
||||||
|
|
||||||
|
*FormSetTitle = 0;
|
||||||
|
*FormSetHelp = 0;
|
||||||
|
ClassGuidNum = 0;
|
||||||
|
ClassGuid = NULL;
|
||||||
|
|
||||||
|
//
|
||||||
|
// Get HII PackageList
|
||||||
|
//
|
||||||
|
BufferSize = 0;
|
||||||
|
HiiPackageList = NULL;
|
||||||
|
Status = gHiiDatabase->ExportPackageLists (gHiiDatabase, Handle, &BufferSize, HiiPackageList);
|
||||||
|
//
|
||||||
|
// Handle is a invalid handle. Check if Handle is corrupted.
|
||||||
|
//
|
||||||
|
ASSERT (Status != EFI_NOT_FOUND);
|
||||||
|
//
|
||||||
|
// The return status should always be EFI_BUFFER_TOO_SMALL as input buffer's size is 0.
|
||||||
|
//
|
||||||
|
ASSERT (Status == EFI_BUFFER_TOO_SMALL);
|
||||||
|
|
||||||
|
HiiPackageList = AllocatePool (BufferSize);
|
||||||
|
ASSERT (HiiPackageList != NULL);
|
||||||
|
|
||||||
|
Status = gHiiDatabase->ExportPackageLists (gHiiDatabase, Handle, &BufferSize, HiiPackageList);
|
||||||
|
if (EFI_ERROR (Status)) {
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Get Form package from this HII package List
|
||||||
|
//
|
||||||
|
Offset = sizeof (EFI_HII_PACKAGE_LIST_HEADER);
|
||||||
|
Offset2 = 0;
|
||||||
|
PackageListLength = ReadUnaligned32 (&HiiPackageList->PackageLength);
|
||||||
|
|
||||||
|
while (Offset < PackageListLength) {
|
||||||
|
Package = ((UINT8 *) HiiPackageList) + Offset;
|
||||||
|
CopyMem (&PackageHeader, Package, sizeof (EFI_HII_PACKAGE_HEADER));
|
||||||
|
|
||||||
|
if (PackageHeader.Type == EFI_HII_PACKAGE_FORMS) {
|
||||||
|
//
|
||||||
|
// Search FormSet Opcode in this Form Package
|
||||||
|
//
|
||||||
|
Offset2 = sizeof (EFI_HII_PACKAGE_HEADER);
|
||||||
|
while (Offset2 < PackageHeader.Length) {
|
||||||
|
OpCodeData = Package + Offset2;
|
||||||
|
|
||||||
|
if (((EFI_IFR_OP_HEADER *) OpCodeData)->OpCode == EFI_IFR_FORM_SET_OP) {
|
||||||
|
//
|
||||||
|
// Find FormSet OpCode
|
||||||
|
//
|
||||||
|
ClassGuidNum = ((EFI_IFR_FORM_SET *) OpCodeData)->Flags;
|
||||||
|
ClassGuid = (EFI_GUID *) (VOID *)(OpCodeData + sizeof (EFI_IFR_FORM_SET));
|
||||||
|
while (ClassGuidNum-- > 0) {
|
||||||
|
if (CompareGuid (SetupClassGuid, ClassGuid)) {
|
||||||
|
CopyMem (FormSetTitle, &((EFI_IFR_FORM_SET *) OpCodeData)->FormSetTitle, sizeof (EFI_STRING_ID));
|
||||||
|
CopyMem (FormSetHelp, &((EFI_IFR_FORM_SET *) OpCodeData)->Help, sizeof (EFI_STRING_ID));
|
||||||
|
FreePool (HiiPackageList);
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Go to next opcode
|
||||||
|
//
|
||||||
|
Offset2 += ((EFI_IFR_OP_HEADER *) OpCodeData)->Length;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Go to next package
|
||||||
|
//
|
||||||
|
Offset += PackageHeader.Length;
|
||||||
|
}
|
||||||
|
|
||||||
|
FreePool (HiiPackageList);
|
||||||
|
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Call the browser and display the device manager to allow user
|
Call the browser and display the device manager to allow user
|
||||||
to configure the platform.
|
to configure the platform.
|
||||||
|
@ -172,21 +288,21 @@ CallDeviceManager (
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
EFI_STATUS Status;
|
EFI_STATUS Status;
|
||||||
UINTN Count;
|
|
||||||
UINTN Index;
|
UINTN Index;
|
||||||
EFI_STRING String;
|
EFI_STRING String;
|
||||||
EFI_HII_UPDATE_DATA UpdateData[MENU_ITEM_NUM];
|
|
||||||
EFI_STRING_ID Token;
|
EFI_STRING_ID Token;
|
||||||
EFI_STRING_ID TokenHelp;
|
EFI_STRING_ID TokenHelp;
|
||||||
EFI_HII_HANDLE *HiiHandles;
|
EFI_HII_HANDLE *HiiHandles;
|
||||||
EFI_HII_HANDLE HiiHandle;
|
EFI_HII_HANDLE HiiHandle;
|
||||||
UINT16 FormSetClass;
|
|
||||||
EFI_STRING_ID FormSetTitle;
|
EFI_STRING_ID FormSetTitle;
|
||||||
EFI_STRING_ID FormSetHelp;
|
EFI_STRING_ID FormSetHelp;
|
||||||
EFI_BROWSER_ACTION_REQUEST ActionRequest;
|
EFI_BROWSER_ACTION_REQUEST ActionRequest;
|
||||||
|
VOID *StartOpCodeHandle;
|
||||||
|
VOID *EndOpCodeHandle;
|
||||||
|
EFI_IFR_GUID_LABEL *StartLabel;
|
||||||
|
EFI_IFR_GUID_LABEL *EndLabel;
|
||||||
|
|
||||||
HiiHandles = NULL;
|
HiiHandles = NULL;
|
||||||
|
|
||||||
Status = EFI_SUCCESS;
|
Status = EFI_SUCCESS;
|
||||||
gCallbackKey = 0;
|
gCallbackKey = 0;
|
||||||
|
|
||||||
|
@ -201,17 +317,30 @@ CallDeviceManager (
|
||||||
//
|
//
|
||||||
// Create Subtitle OpCodes
|
// Create Subtitle OpCodes
|
||||||
//
|
//
|
||||||
for (Index = 0; Index < MENU_ITEM_NUM; Index++) {
|
//
|
||||||
//
|
// Allocate space for creation of UpdateData Buffer
|
||||||
// Allocate space for creation of UpdateData Buffer
|
//
|
||||||
//
|
StartOpCodeHandle = HiiAllocateOpCodeHandle ();
|
||||||
UpdateData[Index].BufferSize = 0x1000;
|
ASSERT (StartOpCodeHandle != NULL);
|
||||||
UpdateData[Index].Offset = 0;
|
|
||||||
UpdateData[Index].Data = AllocatePool (0x1000);
|
|
||||||
ASSERT (UpdateData[Index].Data != NULL);
|
|
||||||
|
|
||||||
CreateSubTitleOpCode (mDeviceManagerMenuItemTable[Index].StringId, 0, 0, 1, &UpdateData[Index]);
|
EndOpCodeHandle = HiiAllocateOpCodeHandle ();
|
||||||
}
|
ASSERT (EndOpCodeHandle != NULL);
|
||||||
|
|
||||||
|
//
|
||||||
|
// Create Hii Extend Label OpCode as the start opcode
|
||||||
|
//
|
||||||
|
StartLabel = (EFI_IFR_GUID_LABEL *) HiiCreateGuidOpCode (StartOpCodeHandle, &gEfiIfrTianoGuid, NULL, sizeof (EFI_IFR_GUID_LABEL));
|
||||||
|
StartLabel->ExtendOpCode = EFI_IFR_EXTEND_OP_LABEL;
|
||||||
|
StartLabel->Number = LABEL_DEVICES_LIST;
|
||||||
|
|
||||||
|
//
|
||||||
|
// Create Hii Extend Label OpCode as the end opcode
|
||||||
|
//
|
||||||
|
EndLabel = (EFI_IFR_GUID_LABEL *) HiiCreateGuidOpCode (EndOpCodeHandle, &gEfiIfrTianoGuid, NULL, sizeof (EFI_IFR_GUID_LABEL));
|
||||||
|
EndLabel->ExtendOpCode = EFI_IFR_EXTEND_OP_LABEL;
|
||||||
|
EndLabel->Number = LABEL_END;
|
||||||
|
|
||||||
|
HiiCreateSubTitleOpCode (StartOpCodeHandle, STRING_TOKEN (STR_DEVICES_LIST), 0, 0, 1);
|
||||||
|
|
||||||
//
|
//
|
||||||
// Get all the Hii handles
|
// Get all the Hii handles
|
||||||
|
@ -225,9 +354,7 @@ CallDeviceManager (
|
||||||
// Search for formset of each class type
|
// Search for formset of each class type
|
||||||
//
|
//
|
||||||
for (Index = 0; HiiHandles[Index] != NULL; Index++) {
|
for (Index = 0; HiiHandles[Index] != NULL; Index++) {
|
||||||
IfrLibExtractClassFromHiiHandle (HiiHandles[Index], &FormSetClass, &FormSetTitle, &FormSetHelp);
|
if (!ExtractDisplayedHiiFormFromHiiHandle (HiiHandles[Index], &gEfiHiiPlatformSetupFormsetGuid, &FormSetTitle, &FormSetHelp)) {
|
||||||
|
|
||||||
if (FormSetClass == EFI_NON_DEVICE_CLASS) {
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -241,42 +368,35 @@ CallDeviceManager (
|
||||||
TokenHelp = HiiSetString (HiiHandle, 0, String, NULL);
|
TokenHelp = HiiSetString (HiiHandle, 0, String, NULL);
|
||||||
FreePool (String);
|
FreePool (String);
|
||||||
|
|
||||||
for (Count = 0; Count < MENU_ITEM_NUM; Count++) {
|
HiiCreateActionOpCode (
|
||||||
if (FormSetClass & mDeviceManagerMenuItemTable[Count].Class) {
|
StartOpCodeHandle,
|
||||||
CreateActionOpCode (
|
(EFI_QUESTION_ID) (Index + DEVICE_KEY_OFFSET),
|
||||||
(EFI_QUESTION_ID) (Index + DEVICE_KEY_OFFSET),
|
Token,
|
||||||
Token,
|
TokenHelp,
|
||||||
TokenHelp,
|
EFI_IFR_FLAG_CALLBACK,
|
||||||
EFI_IFR_FLAG_CALLBACK,
|
0
|
||||||
0,
|
|
||||||
&UpdateData[Count]
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for (Index = 0; Index < MENU_ITEM_NUM; Index++) {
|
|
||||||
//
|
|
||||||
// Add End Opcode for Subtitle
|
|
||||||
//
|
|
||||||
CreateEndOpCode (&UpdateData[Index]);
|
|
||||||
|
|
||||||
IfrLibUpdateForm (
|
|
||||||
HiiHandle,
|
|
||||||
&mDeviceManagerGuid,
|
|
||||||
DEVICE_MANAGER_FORM_ID,
|
|
||||||
mDeviceManagerMenuItemTable[Index].Class,
|
|
||||||
FALSE,
|
|
||||||
&UpdateData[Index]
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Add End Opcode for Subtitle
|
||||||
|
//
|
||||||
|
HiiCreateEndOpCode (StartOpCodeHandle);
|
||||||
|
|
||||||
|
HiiUpdateForm (
|
||||||
|
HiiHandle,
|
||||||
|
&mDeviceManagerGuid,
|
||||||
|
DEVICE_MANAGER_FORM_ID,
|
||||||
|
StartOpCodeHandle,
|
||||||
|
EndOpCodeHandle
|
||||||
|
);
|
||||||
|
|
||||||
ActionRequest = EFI_BROWSER_ACTION_REQUEST_NONE;
|
ActionRequest = EFI_BROWSER_ACTION_REQUEST_NONE;
|
||||||
Status = gFormBrowser2->SendForm (
|
Status = gFormBrowser2->SendForm (
|
||||||
gFormBrowser2,
|
gFormBrowser2,
|
||||||
&HiiHandle,
|
&HiiHandle,
|
||||||
1,
|
1,
|
||||||
NULL,
|
&mDeviceManagerGuid,
|
||||||
0,
|
0,
|
||||||
NULL,
|
NULL,
|
||||||
&ActionRequest
|
&ActionRequest
|
||||||
|
@ -329,9 +449,8 @@ CallDeviceManager (
|
||||||
Status = EFI_SUCCESS;
|
Status = EFI_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (Index = 0; Index < MENU_ITEM_NUM; Index++) {
|
HiiFreeOpCodeHandle (StartOpCodeHandle);
|
||||||
FreePool (UpdateData[Index].Data);
|
HiiFreeOpCodeHandle (EndOpCodeHandle);
|
||||||
}
|
|
||||||
FreePool (HiiHandles);
|
FreePool (HiiHandles);
|
||||||
|
|
||||||
return Status;
|
return Status;
|
||||||
|
|
|
@ -26,6 +26,9 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||||
0x3ebfa8e6, 0x511d, 0x4b5b, {0xa9, 0x5f, 0xfb, 0x38, 0x26, 0xf, 0x1c, 0x27} \
|
0x3ebfa8e6, 0x511d, 0x4b5b, {0xa9, 0x5f, 0xfb, 0x38, 0x26, 0xf, 0x1c, 0x27} \
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#define LABEL_DEVICES_LIST 0x0080
|
||||||
|
#define LABEL_END 0xffff
|
||||||
|
|
||||||
#define LABEL_VBIOS 0x0040
|
#define LABEL_VBIOS 0x0040
|
||||||
|
|
||||||
#define DEVICE_MANAGER_FORM_ID 0x1000
|
#define DEVICE_MANAGER_FORM_ID 0x1000
|
||||||
|
|
Binary file not shown.
|
@ -23,6 +23,7 @@
|
||||||
#define EFI_OTHER_DEVICE_CLASS 0x0020
|
#define EFI_OTHER_DEVICE_CLASS 0x0020
|
||||||
#define LABEL_VBIOS 0x0040
|
#define LABEL_VBIOS 0x0040
|
||||||
|
|
||||||
|
#define LABEL_DEVICES_LIST 0x0080
|
||||||
#define LABEL_END 0xffff
|
#define LABEL_END 0xffff
|
||||||
|
|
||||||
#define DEVICE_MANAGER_CLASS 0x0000
|
#define DEVICE_MANAGER_CLASS 0x0000
|
||||||
|
@ -31,11 +32,12 @@
|
||||||
#define DEVICE_MANAGER_FORM_ID 0x1000
|
#define DEVICE_MANAGER_FORM_ID 0x1000
|
||||||
|
|
||||||
formset
|
formset
|
||||||
guid = FORMSET_GUID,
|
guid = FORMSET_GUID,
|
||||||
title = STRING_TOKEN(STR_DEVICE_MANAGER_TITLE),
|
title = STRING_TOKEN(STR_DEVICE_MANAGER_TITLE),
|
||||||
help = STRING_TOKEN(STR_EMPTY_STRING),
|
help = STRING_TOKEN(STR_EMPTY_STRING),
|
||||||
class = DEVICE_MANAGER_CLASS,
|
classguid = FORMSET_GUID,
|
||||||
subclass = FRONT_PAGE_SUBCLASS,
|
class = DEVICE_MANAGER_CLASS,
|
||||||
|
subclass = FRONT_PAGE_SUBCLASS,
|
||||||
|
|
||||||
form formid = DEVICE_MANAGER_FORM_ID,
|
form formid = DEVICE_MANAGER_FORM_ID,
|
||||||
title = STRING_TOKEN(STR_DEVICE_MANAGER_TITLE);
|
title = STRING_TOKEN(STR_DEVICE_MANAGER_TITLE);
|
||||||
|
@ -58,7 +60,9 @@ formset
|
||||||
label EFI_ON_BOARD_DEVICE_CLASS;
|
label EFI_ON_BOARD_DEVICE_CLASS;
|
||||||
// label LABEL_END;
|
// label LABEL_END;
|
||||||
|
|
||||||
label EFI_OTHER_DEVICE_CLASS;
|
// label EFI_OTHER_DEVICE_CLASS;
|
||||||
|
|
||||||
|
label LABEL_DEVICES_LIST;
|
||||||
label LABEL_END;
|
label LABEL_END;
|
||||||
|
|
||||||
subtitle text = STRING_TOKEN(STR_EMPTY_STRING);
|
subtitle text = STRING_TOKEN(STR_EMPTY_STRING);
|
||||||
|
|
|
@ -298,19 +298,21 @@ InitializeFrontPage (
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
EFI_STATUS Status;
|
EFI_STATUS Status;
|
||||||
EFI_HII_UPDATE_DATA UpdateData;
|
|
||||||
IFR_OPTION *OptionList;
|
|
||||||
CHAR8 *LanguageString;
|
CHAR8 *LanguageString;
|
||||||
CHAR8 *LangCode;
|
CHAR8 *LangCode;
|
||||||
CHAR8 *Lang;
|
CHAR8 *Lang;
|
||||||
CHAR8 *CurrentLang;
|
CHAR8 *CurrentLang;
|
||||||
CHAR8 *BestLanguage;
|
CHAR8 *BestLanguage;
|
||||||
UINTN OptionCount;
|
UINTN OptionCount;
|
||||||
EFI_STRING_ID Token;
|
|
||||||
CHAR16 *StringBuffer;
|
CHAR16 *StringBuffer;
|
||||||
UINTN BufferSize;
|
UINTN BufferSize;
|
||||||
UINTN Index;
|
|
||||||
EFI_HII_HANDLE HiiHandle;
|
EFI_HII_HANDLE HiiHandle;
|
||||||
|
VOID *OptionsOpCodeHandle;
|
||||||
|
VOID *StartOpCodeHandle;
|
||||||
|
VOID *EndOpCodeHandle;
|
||||||
|
EFI_IFR_GUID_LABEL *StartLabel;
|
||||||
|
EFI_IFR_GUID_LABEL *EndLabel;
|
||||||
|
BOOLEAN FirstFlag;
|
||||||
|
|
||||||
if (InitializeHiiData) {
|
if (InitializeHiiData) {
|
||||||
//
|
//
|
||||||
|
@ -378,14 +380,29 @@ InitializeFrontPage (
|
||||||
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Allocate space for creation of UpdateData Buffer
|
// Init OpCode Handle and Allocate space for creation of UpdateData Buffer
|
||||||
//
|
//
|
||||||
UpdateData.BufferSize = 0x1000;
|
StartOpCodeHandle = HiiAllocateOpCodeHandle ();
|
||||||
UpdateData.Data = AllocateZeroPool (0x1000);
|
ASSERT (StartOpCodeHandle != NULL);
|
||||||
ASSERT (UpdateData.Data != NULL);
|
|
||||||
|
|
||||||
OptionList = AllocateZeroPool (0x1000);
|
EndOpCodeHandle = HiiAllocateOpCodeHandle ();
|
||||||
ASSERT (OptionList != NULL);
|
ASSERT (EndOpCodeHandle != NULL);
|
||||||
|
|
||||||
|
OptionsOpCodeHandle = HiiAllocateOpCodeHandle ();
|
||||||
|
ASSERT (OptionsOpCodeHandle != NULL);
|
||||||
|
//
|
||||||
|
// Create Hii Extend Label OpCode as the start opcode
|
||||||
|
//
|
||||||
|
StartLabel = (EFI_IFR_GUID_LABEL *) HiiCreateGuidOpCode (StartOpCodeHandle, &gEfiIfrTianoGuid, NULL, sizeof (EFI_IFR_GUID_LABEL));
|
||||||
|
StartLabel->ExtendOpCode = EFI_IFR_EXTEND_OP_LABEL;
|
||||||
|
StartLabel->Number = LABEL_SELECT_LANGUAGE;
|
||||||
|
|
||||||
|
//
|
||||||
|
// Create Hii Extend Label OpCode as the end opcode
|
||||||
|
//
|
||||||
|
EndLabel = (EFI_IFR_GUID_LABEL *) HiiCreateGuidOpCode (EndOpCodeHandle, &gEfiIfrTianoGuid, NULL, sizeof (EFI_IFR_GUID_LABEL));
|
||||||
|
EndLabel->ExtendOpCode = EFI_IFR_EXTEND_OP_LABEL;
|
||||||
|
EndLabel->Number = LABEL_END;
|
||||||
|
|
||||||
//
|
//
|
||||||
// Collect the languages from what our current Language support is based on our VFR
|
// Collect the languages from what our current Language support is based on our VFR
|
||||||
|
@ -416,12 +433,26 @@ InitializeFrontPage (
|
||||||
//
|
//
|
||||||
ASSERT (BestLanguage != NULL);
|
ASSERT (BestLanguage != NULL);
|
||||||
|
|
||||||
|
OptionCount = 0;
|
||||||
|
LangCode = LanguageString;
|
||||||
|
FirstFlag = FALSE;
|
||||||
|
|
||||||
|
if (gFrontPagePrivate.LanguageToken == NULL) {
|
||||||
|
while (*LangCode != 0) {
|
||||||
|
HiiLibGetNextLanguage (&LangCode, Lang);
|
||||||
|
OptionCount ++;
|
||||||
|
}
|
||||||
|
gFrontPagePrivate.LanguageToken = AllocatePool (OptionCount * sizeof (EFI_STRING_ID));
|
||||||
|
ASSERT (gFrontPagePrivate.LanguageToken != NULL);
|
||||||
|
FirstFlag = TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
OptionCount = 0;
|
OptionCount = 0;
|
||||||
LangCode = LanguageString;
|
LangCode = LanguageString;
|
||||||
while (*LangCode != 0) {
|
while (*LangCode != 0) {
|
||||||
GetNextLanguage (&LangCode, Lang);
|
GetNextLanguage (&LangCode, Lang);
|
||||||
|
|
||||||
if (gFrontPagePrivate.LanguageToken == NULL) {
|
if (FirstFlag) {
|
||||||
//
|
//
|
||||||
// Get Language Name from String Package. The StringId of Printable Language
|
// Get Language Name from String Package. The StringId of Printable Language
|
||||||
// Name is always 1 which is generated by StringGather Tool.
|
// Name is always 1 which is generated by StringGather Tool.
|
||||||
|
@ -452,19 +483,30 @@ InitializeFrontPage (
|
||||||
}
|
}
|
||||||
ASSERT_EFI_ERROR (Status);
|
ASSERT_EFI_ERROR (Status);
|
||||||
|
|
||||||
Token = HiiSetString (HiiHandle, 0, StringBuffer, NULL);
|
//
|
||||||
|
// Save the string Id for each language
|
||||||
|
//
|
||||||
|
gFrontPagePrivate.LanguageToken[OptionCount] = HiiSetString (HiiHandle, 0, StringBuffer, NULL);
|
||||||
FreePool (StringBuffer);
|
FreePool (StringBuffer);
|
||||||
} else {
|
|
||||||
Token = gFrontPagePrivate.LanguageToken[OptionCount];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (AsciiStrCmp (Lang, BestLanguage) == 0) {
|
if (AsciiStrCmp (Lang, BestLanguage) == 0) {
|
||||||
OptionList[OptionCount].Flags = EFI_IFR_OPTION_DEFAULT;
|
HiiCreateOneOfOptionOpCode (
|
||||||
|
OptionsOpCodeHandle,
|
||||||
|
gFrontPagePrivate.LanguageToken[OptionCount],
|
||||||
|
EFI_IFR_OPTION_DEFAULT,
|
||||||
|
EFI_IFR_NUMERIC_SIZE_1,
|
||||||
|
(UINT8) OptionCount
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
OptionList[OptionCount].Flags = 0;
|
HiiCreateOneOfOptionOpCode (
|
||||||
|
OptionsOpCodeHandle,
|
||||||
|
gFrontPagePrivate.LanguageToken[OptionCount],
|
||||||
|
0,
|
||||||
|
EFI_IFR_NUMERIC_SIZE_1,
|
||||||
|
(UINT8) OptionCount
|
||||||
|
);
|
||||||
}
|
}
|
||||||
OptionList[OptionCount].StringToken = Token;
|
|
||||||
OptionList[OptionCount].Value.u8 = (UINT8) OptionCount;
|
|
||||||
|
|
||||||
OptionCount++;
|
OptionCount++;
|
||||||
}
|
}
|
||||||
|
@ -476,8 +518,8 @@ InitializeFrontPage (
|
||||||
FreePool (Lang);
|
FreePool (Lang);
|
||||||
FreePool (LanguageString);
|
FreePool (LanguageString);
|
||||||
|
|
||||||
UpdateData.Offset = 0;
|
HiiCreateOneOfOpCode (
|
||||||
CreateOneOfOpCode (
|
StartOpCodeHandle,
|
||||||
FRONT_PAGE_KEY_LANGUAGE,
|
FRONT_PAGE_KEY_LANGUAGE,
|
||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
|
@ -485,31 +527,21 @@ InitializeFrontPage (
|
||||||
STRING_TOKEN (STR_LANGUAGE_SELECT_HELP),
|
STRING_TOKEN (STR_LANGUAGE_SELECT_HELP),
|
||||||
EFI_IFR_FLAG_CALLBACK,
|
EFI_IFR_FLAG_CALLBACK,
|
||||||
EFI_IFR_NUMERIC_SIZE_1,
|
EFI_IFR_NUMERIC_SIZE_1,
|
||||||
OptionList,
|
OptionsOpCodeHandle,
|
||||||
OptionCount,
|
NULL
|
||||||
&UpdateData
|
|
||||||
);
|
);
|
||||||
|
|
||||||
Status = IfrLibUpdateForm (
|
Status = HiiUpdateForm (
|
||||||
HiiHandle,
|
HiiHandle,
|
||||||
&mFrontPageGuid,
|
&mFrontPageGuid,
|
||||||
FRONT_PAGE_FORM_ID,
|
FRONT_PAGE_FORM_ID,
|
||||||
LABEL_SELECT_LANGUAGE,
|
StartOpCodeHandle, // LABEL_SELECT_LANGUAGE
|
||||||
FALSE,
|
EndOpCodeHandle // LABEL_END
|
||||||
&UpdateData
|
|
||||||
);
|
);
|
||||||
|
|
||||||
//
|
HiiFreeOpCodeHandle (StartOpCodeHandle);
|
||||||
// Save the string Id for each language
|
HiiFreeOpCodeHandle (EndOpCodeHandle);
|
||||||
//
|
HiiFreeOpCodeHandle (OptionsOpCodeHandle);
|
||||||
gFrontPagePrivate.LanguageToken = AllocatePool (OptionCount * sizeof (EFI_STRING_ID));
|
|
||||||
ASSERT (gFrontPagePrivate.LanguageToken != NULL);
|
|
||||||
for (Index = 0; Index < OptionCount; Index++) {
|
|
||||||
gFrontPagePrivate.LanguageToken[Index] = OptionList[Index].StringToken;
|
|
||||||
}
|
|
||||||
|
|
||||||
FreePool (UpdateData.Data);
|
|
||||||
FreePool (OptionList);
|
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -45,6 +45,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||||
#define FRONT_PAGE_KEY_BOOT_MAINTAIN 0x9876
|
#define FRONT_PAGE_KEY_BOOT_MAINTAIN 0x9876
|
||||||
|
|
||||||
#define LABEL_SELECT_LANGUAGE 0x1000
|
#define LABEL_SELECT_LANGUAGE 0x1000
|
||||||
|
#define LABEL_END 0xffff
|
||||||
|
|
||||||
#define FRONT_PAGE_FORMSET_GUID \
|
#define FRONT_PAGE_FORMSET_GUID \
|
||||||
{ \
|
{ \
|
||||||
|
|
|
@ -40,6 +40,7 @@ formset
|
||||||
guid = FORMSET_GUID,
|
guid = FORMSET_GUID,
|
||||||
title = STRING_TOKEN(STR_FRONT_PAGE_TITLE),
|
title = STRING_TOKEN(STR_FRONT_PAGE_TITLE),
|
||||||
help = STRING_TOKEN(STR_NULL_STRING),
|
help = STRING_TOKEN(STR_NULL_STRING),
|
||||||
|
classguid = FORMSET_GUID,
|
||||||
class = FRONT_PAGE_CLASS,
|
class = FRONT_PAGE_CLASS,
|
||||||
subclass = FRONT_PAGE_SUBCLASS,
|
subclass = FRONT_PAGE_SUBCLASS,
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue