diff options
author | lgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524> | 2009-04-17 05:31:38 +0000 |
---|---|---|
committer | lgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524> | 2009-04-17 05:31:38 +0000 |
commit | 75bf9d0ecca38dfec9b645a6eb1119c025892304 (patch) | |
tree | 924fa418342708f8bc5cf14be1a1e622c5b9dd79 | |
parent | d91c7bf9e42e8be23bb67bf7c189348b4ec11797 (diff) | |
download | edk2-platforms-75bf9d0ecca38dfec9b645a6eb1119c025892304.tar.xz |
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
20 files changed, 680 insertions, 352 deletions
diff --git a/IntelFrameworkModulePkg/Universal/BdsDxe/Bds.h b/IntelFrameworkModulePkg/Universal/BdsDxe/Bds.h index 34327ce77e..499f32ffc8 100644 --- a/IntelFrameworkModulePkg/Universal/BdsDxe/Bds.h +++ b/IntelFrameworkModulePkg/Universal/BdsDxe/Bds.h @@ -51,8 +51,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. #include <Library/MemoryAllocationLib.h>
#include <Library/PerformanceLib.h>
#include <Library/ReportStatusCodeLib.h>
-#include <Library/IfrSupportLib.h>
-#include <Library/ExtendedIfrSupportLib.h>
#include <Library/UefiRuntimeServicesTableLib.h>
#include <Library/HobLib.h>
#include <Library/BaseLib.h>
diff --git a/IntelFrameworkModulePkg/Universal/BdsDxe/BdsDxe.inf b/IntelFrameworkModulePkg/Universal/BdsDxe/BdsDxe.inf index 08f36f247c..f0d97b755b 100644 --- a/IntelFrameworkModulePkg/Universal/BdsDxe/BdsDxe.inf +++ b/IntelFrameworkModulePkg/Universal/BdsDxe/BdsDxe.inf @@ -95,8 +95,6 @@ BaseLib
HobLib
UefiRuntimeServicesTableLib
- IfrSupportLib
- ExtendedIfrSupportLib
GenericBdsLib
ReportStatusCodeLib
PerformanceLib
@@ -135,6 +133,8 @@ gEfiMemorySubClassGuid ## CONSUMES ## GUID (Indicate the datahub for holding memory record)
gEfiProcessorSubClassGuid ## CONSUMES ## GUID (Indicate the datahub for holding processor record)
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]
gEfiHiiStringProtocolGuid # PROTOCOL ALWAYS_CONSUMES
diff --git a/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/Bm.vfr b/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/Bm.vfr index 4f38a34bba..6a67450417 100644 --- a/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/Bm.vfr +++ b/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/Bm.vfr @@ -15,12 +15,11 @@ #include "FormGuid.h"
-#define LABEL_END 0xffff
-
formset
guid = BOOT_MAINT_FORMSET_GUID,
title = STRING_TOKEN(STR_FORM_MAIN_TITLE),
help = STRING_TOKEN(STR_NULL_STRING),
+ classguid = BOOT_MAINT_FORMSET_GUID,
class = 0,
subclass = 0,
diff --git a/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/BootMaint.c b/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/BootMaint.c index 57dd2db9c5..2b175a5904 100644 --- a/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/BootMaint.c +++ b/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/BootMaint.c @@ -82,7 +82,7 @@ EFI_GUID EfiLegacyDevOrderGuid = EFI_LEGACY_DEV_ORDER_VARIABLE_GUID; EFI_GUID mBootMaintGuid = BOOT_MAINT_FORMSET_GUID;
EFI_GUID mFileExplorerGuid = FILE_EXPLORE_FORMSET_GUID;
-CHAR16 mBootMaintStorageName[] = L"BmData";
+CHAR16 mBootMaintStorageName[] = L"BmmData";
CHAR16 mFileExplorerStorageName[] = L"FeData";
/**
@@ -251,8 +251,7 @@ BootMaintCallback ( UINT8 *NewLegacyDev;
UINT8 *DisMap;
EFI_FORM_ID FormId;
- UINTN BufferSize;
-
+
if ((Value == NULL) || (ActionRequest == NULL)) {
return EFI_INVALID_PARAMETER;
}
@@ -272,11 +271,9 @@ BootMaintCallback ( //
// Retrive uncommitted data from Form Browser
//
- CurrentFakeNVMap = &Private->BmmFakeNvData;
- BufferSize = sizeof (BMM_FAKE_NV_DATA);
- Status = GetBrowserData (NULL, NULL, &BufferSize, (UINT8 *) CurrentFakeNVMap);
- if (EFI_ERROR (Status)) {
- return Status;
+ CurrentFakeNVMap = (BMM_FAKE_NV_DATA *) HiiGetBrowserData (&mBootMaintGuid, mBootMaintStorageName, sizeof (BMM_FAKE_NV_DATA));
+ if (CurrentFakeNVMap == NULL) {
+ CurrentFakeNVMap = &Private->BmmFakeNvData;
}
//
@@ -588,8 +585,15 @@ BootMaintCallback ( //
// Pass changed uncommitted data back to Form Browser
//
- BufferSize = sizeof (BMM_FAKE_NV_DATA);
- Status = SetBrowserData (NULL, NULL, BufferSize, (UINT8 *) CurrentFakeNVMap, NULL);
+ Status = HiiSetBrowserData (&mBootMaintGuid, mBootMaintStorageName, sizeof (BMM_FAKE_NV_DATA), (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;
}
@@ -954,15 +958,33 @@ InitializeBM ( 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;
- gUpdateData.Data = AllocateZeroPool (UPDATE_DATA_SIZE);
- if (gUpdateData.Data == NULL) {
+ mStartOpCodeHandle = HiiAllocateOpCodeHandle ();
+ if (mStartOpCodeHandle == NULL) {
+ Status = EFI_OUT_OF_RESOURCES;
+ 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 ();
InitAllMenu (BmmCallbackInfo);
@@ -986,63 +1008,63 @@ InitializeBM ( Status = EfiLibLocateProtocol (&gEfiLegacyBiosProtocolGuid, (VOID **) &LegacyBios);
if (!EFI_ERROR (Status)) {
RefreshUpdateData ();
+ mStartLabel->Number = FORM_BOOT_LEGACY_DEVICE_ID;
//
// If LegacyBios Protocol is installed, add 3 tags about legacy boot option
// in BootOption form: legacy FD/HD/CD/NET/BEV
//
- CreateGotoOpCode (
+ HiiCreateGotoOpCode (
+ mStartOpCodeHandle,
FORM_SET_FD_ORDER_ID,
STRING_TOKEN (STR_FORM_SET_FD_ORDER_TITLE),
STRING_TOKEN (STR_FORM_SET_FD_ORDER_TITLE),
EFI_IFR_FLAG_CALLBACK,
- FORM_SET_FD_ORDER_ID,
- &gUpdateData
+ FORM_SET_FD_ORDER_ID
);
- CreateGotoOpCode (
+ HiiCreateGotoOpCode (
+ mStartOpCodeHandle,
FORM_SET_HD_ORDER_ID,
STRING_TOKEN (STR_FORM_SET_HD_ORDER_TITLE),
STRING_TOKEN (STR_FORM_SET_HD_ORDER_TITLE),
EFI_IFR_FLAG_CALLBACK,
- FORM_SET_HD_ORDER_ID,
- &gUpdateData
+ FORM_SET_HD_ORDER_ID
);
- CreateGotoOpCode (
+ HiiCreateGotoOpCode (
+ mStartOpCodeHandle,
FORM_SET_CD_ORDER_ID,
STRING_TOKEN (STR_FORM_SET_CD_ORDER_TITLE),
STRING_TOKEN (STR_FORM_SET_CD_ORDER_TITLE),
EFI_IFR_FLAG_CALLBACK,
- FORM_SET_CD_ORDER_ID,
- &gUpdateData
+ FORM_SET_CD_ORDER_ID
);
- CreateGotoOpCode (
+ HiiCreateGotoOpCode (
+ mStartOpCodeHandle,
FORM_SET_NET_ORDER_ID,
STRING_TOKEN (STR_FORM_SET_NET_ORDER_TITLE),
STRING_TOKEN (STR_FORM_SET_NET_ORDER_TITLE),
EFI_IFR_FLAG_CALLBACK,
- FORM_SET_NET_ORDER_ID,
- &gUpdateData
+ FORM_SET_NET_ORDER_ID
);
- CreateGotoOpCode (
+ HiiCreateGotoOpCode (
+ mStartOpCodeHandle,
FORM_SET_BEV_ORDER_ID,
STRING_TOKEN (STR_FORM_SET_BEV_ORDER_TITLE),
STRING_TOKEN (STR_FORM_SET_BEV_ORDER_TITLE),
EFI_IFR_FLAG_CALLBACK,
- FORM_SET_BEV_ORDER_ID,
- &gUpdateData
+ FORM_SET_BEV_ORDER_ID
);
-
- IfrLibUpdateForm (
+
+ HiiUpdateForm (
BmmCallbackInfo->BmmHiiHandle,
&mBootMaintGuid,
FORM_BOOT_SETUP_ID,
- FORM_BOOT_LEGACY_DEVICE_ID,
- FALSE,
- &gUpdateData
+ mStartOpCodeHandle, // Label FORM_BOOT_LEGACY_DEVICE_ID
+ mEndOpCodeHandle // LABEL_END
);
}
@@ -1061,10 +1083,15 @@ InitializeBM ( FreeAllMenu ();
- FreePool (gUpdateData.Data);
- gUpdateData.Data = NULL;
-
Exit:
+ if (mStartOpCodeHandle != NULL) {
+ HiiFreeOpCodeHandle (mStartOpCodeHandle);
+ }
+
+ if (mEndOpCodeHandle != NULL) {
+ HiiFreeOpCodeHandle (mEndOpCodeHandle);
+ }
+
if (BmmCallbackInfo->FeDriverHandle != NULL) {
gBS->UninstallMultipleProtocolInterfaces (
BmmCallbackInfo->FeDriverHandle,
@@ -1324,7 +1351,7 @@ FormSetDispatcher ( gFormBrowser2,
&CallbackData->BmmHiiHandle,
1,
- NULL,
+ &mBootMaintGuid,
0,
NULL,
&ActionRequest
@@ -1346,7 +1373,7 @@ FormSetDispatcher ( gFormBrowser2,
&CallbackData->FeHiiHandle,
1,
- NULL,
+ &mFileExplorerGuid,
0,
NULL,
&ActionRequest
diff --git a/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/BootMaint.h b/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/BootMaint.h index 49a279342f..e30e989686 100644 --- a/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/BootMaint.h +++ b/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/BootMaint.h @@ -63,7 +63,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. extern EFI_GUID mBootMaintGuid;
extern EFI_GUID mFileExplorerGuid;
-
+extern CHAR16 mFileExplorerStorageName[];
//
// 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 StopBitsList[3];
extern EFI_GUID TerminalTypeGuid[4];
-extern EFI_HII_UPDATE_DATA gUpdateData;
extern STRING_DEPOSITORY *FileOptionStrDepository;
extern STRING_DEPOSITORY *ConsoleOptionStrDepository;
extern STRING_DEPOSITORY *BootOptionStrDepository;
@@ -1576,4 +1575,12 @@ extern STRING_DEPOSITORY *TerminalStrDepository; extern EFI_DEVICE_PATH_PROTOCOL EndDevicePath[];
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
diff --git a/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/Data.c b/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/Data.c index 5a22e77a9a..94c8fb6b92 100644 --- a/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/Data.c +++ b/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/Data.c @@ -14,7 +14,11 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. #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 *ConsoleOptionStrDepository;
STRING_DEPOSITORY *BootOptionStrDepository;
diff --git a/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/FE.vfr b/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/FE.vfr index b89cf114cd..981a804368 100644 --- a/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/FE.vfr +++ b/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/FE.vfr @@ -15,12 +15,11 @@ #include "FormGuid.h"
-#define LABEL_END 0xffff
-
formset
guid = FILE_EXPLORE_FORMSET_GUID,
title = STRING_TOKEN(STR_FILE_EXPLORER_TITLE),
help = STRING_TOKEN(STR_NULL_STRING),
+ classguid = FILE_EXPLORE_FORMSET_GUID,
class = 0,
subclass = 0,
diff --git a/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/FileExplorer.c b/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/FileExplorer.c index 8253ded988..366aceda18 100644 --- a/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/FileExplorer.c +++ b/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/FileExplorer.c @@ -37,6 +37,7 @@ UpdateFileExplorePage ( FormId = 0;
RefreshUpdateData ();
+ mStartLabel->Number = FORM_FILE_EXPLORER_ID;
for (Index = 0; Index < MenuOption->MenuNumber; 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.
//
- CreateActionOpCode (
+ HiiCreateActionOpCode (
+ mStartOpCodeHandle,
(UINT16) (FILE_OPTION_OFFSET + Index),
NewMenuEntry->DisplayStringToken,
STRING_TOKEN (STR_NULL_STRING),
EFI_IFR_FLAG_CALLBACK,
- 0,
- &gUpdateData
+ 0
);
} else {
//
@@ -68,24 +69,23 @@ UpdateFileExplorePage ( FormId = FORM_DRIVER_ADD_FILE_DESCRIPTION_ID;
}
- CreateGotoOpCode (
+ HiiCreateGotoOpCode (
+ mStartOpCodeHandle,
FormId,
NewMenuEntry->DisplayStringToken,
STRING_TOKEN (STR_NULL_STRING),
EFI_IFR_FLAG_CALLBACK,
- (UINT16) (FILE_OPTION_OFFSET + Index),
- &gUpdateData
+ (UINT16) (FILE_OPTION_OFFSET + Index)
);
}
}
- IfrLibUpdateForm (
+ HiiUpdateForm (
CallbackData->FeHiiHandle,
&mFileExplorerGuid,
FORM_FILE_EXPLORER_ID,
- FORM_FILE_EXPLORER_ID,
- FALSE,
- &gUpdateData
+ mStartOpCodeHandle, // Label FORM_FILE_EXPLORER_ID
+ mEndOpCodeHandle // LABEL_END
);
}
@@ -179,22 +179,22 @@ UpdateFileExplorer ( // Create Subtitle op-code for the display string of the option.
//
RefreshUpdateData ();
+ mStartLabel->Number = FormId;
- CreateSubTitleOpCode (
+ HiiCreateSubTitleOpCode (
+ mStartOpCodeHandle,
NewMenuEntry->DisplayStringToken,
0,
0,
- 0,
- &gUpdateData
+ 0
);
- IfrLibUpdateForm (
+ HiiUpdateForm (
CallbackData->FeHiiHandle,
&mFileExplorerGuid,
FormId,
- FormId,
- FALSE,
- &gUpdateData
+ mStartOpCodeHandle, // Label FormId
+ mEndOpCodeHandle // LABEL_END
);
break;
@@ -248,7 +248,6 @@ FileExplorerCallback ( BMM_CALLBACK_DATA *Private;
FILE_EXPLORER_NV_DATA *NvRamMap;
EFI_STATUS Status;
- UINTN BufferSize;
if ((Value == NULL) || (ActionRequest == NULL)) {
return EFI_INVALID_PARAMETER;
@@ -261,12 +260,13 @@ FileExplorerCallback ( //
// Retrieve uncommitted data from Form Browser
//
- NvRamMap = &Private->FeFakeNvData;
- BufferSize = sizeof (FILE_EXPLORER_NV_DATA);
- Status = GetBrowserData (NULL, NULL, &BufferSize, (UINT8 *) NvRamMap);
- if (EFI_ERROR (Status)) {
- return Status;
+ NvRamMap = (FILE_EXPLORER_NV_DATA *) HiiGetBrowserData (&mFileExplorerGuid, mFileExplorerStorageName, sizeof (FILE_EXPLORER_NV_DATA));
+ if (NvRamMap == NULL) {
+ return EFI_NOT_FOUND;
}
+ 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) {
//
diff --git a/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/FormGuid.h b/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/FormGuid.h index 2523d64c66..e67ae2c628 100644 --- a/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/FormGuid.h +++ b/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/FormGuid.h @@ -82,6 +82,11 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. #define VARSTORE_ID_BOOT_MAINT 0x1000
#define VARSTORE_ID_FILE_EXPLORER 0x1001
+//
+// End Label
+//
+#define LABEL_END 0xffff
+
///
/// This is the structure that will be used to store the
/// question's current value. Use it at initialize time to
diff --git a/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/UpdatePage.c b/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/UpdatePage.c index 3d23da1ac3..dcc1fe2a13 100644 --- a/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/UpdatePage.c +++ b/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/UpdatePage.c @@ -23,7 +23,24 @@ RefreshUpdateData ( 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 ();
+ mStartLabel->Number = CallbackData->BmmCurrentPageId;
if (!(CallbackData->BmmAskSaveOrNot)) {
//
// 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.
//
- CreateGotoOpCode (
+ HiiCreateGotoOpCode (
+ mStartOpCodeHandle,
FORM_MAIN_ID,
STRING_TOKEN (STR_FORM_GOTO_MAIN),
STRING_TOKEN (STR_FORM_GOTO_MAIN),
0,
- FORM_MAIN_ID,
- &gUpdateData
+ FORM_MAIN_ID
);
}
@@ -73,43 +91,42 @@ UpdatePageEnd ( // Create the "Apply changes" and "Discard changes" tags.
//
if (CallbackData->BmmAskSaveOrNot) {
- CreateSubTitleOpCode (
+ HiiCreateSubTitleOpCode (
+ mStartOpCodeHandle,
STRING_TOKEN (STR_NULL_STRING),
0,
0,
- 0,
- &gUpdateData
+ 0
);
- CreateGotoOpCode (
+ HiiCreateGotoOpCode (
+ mStartOpCodeHandle,
FORM_MAIN_ID,
STRING_TOKEN (STR_SAVE_AND_EXIT),
STRING_TOKEN (STR_NULL_STRING),
EFI_IFR_FLAG_CALLBACK,
- KEY_VALUE_SAVE_AND_EXIT,
- &gUpdateData
+ KEY_VALUE_SAVE_AND_EXIT
);
}
//
// Ensure user can return to the main page.
//
- CreateGotoOpCode (
+ HiiCreateGotoOpCode (
+ mStartOpCodeHandle,
FORM_MAIN_ID,
STRING_TOKEN (STR_NO_SAVE_AND_EXIT),
STRING_TOKEN (STR_NULL_STRING),
EFI_IFR_FLAG_CALLBACK,
- KEY_VALUE_NO_SAVE_AND_EXIT,
- &gUpdateData
+ KEY_VALUE_NO_SAVE_AND_EXIT
);
- IfrLibUpdateForm (
+ HiiUpdateForm (
CallbackData->BmmHiiHandle,
&mBootMaintGuid,
CallbackData->BmmCurrentPageId,
- CallbackData->BmmCurrentPageId,
- FALSE,
- &gUpdateData
+ mStartOpCodeHandle, // Label CallbackData->BmmCurrentPageId
+ mEndOpCodeHandle // LABEL_END
);
}
@@ -131,13 +148,13 @@ CleanUpPage ( //
// Remove all op-codes from dynamic page
//
- IfrLibUpdateForm (
+ mStartLabel->Number = LabelId;
+ HiiUpdateForm (
CallbackData->BmmHiiHandle,
&mBootMaintGuid,
LabelId,
- LabelId,
- FALSE,
- &gUpdateData
+ mStartOpCodeHandle, // Label LabelId
+ mEndOpCodeHandle // LABEL_END
);
}
@@ -203,13 +220,13 @@ UpdateConCOMPage ( for (Index = 0; Index < TerminalMenu.MenuNumber; Index++) {
NewMenuEntry = BOpt_GetMenuEntry (&TerminalMenu, Index);
- CreateGotoOpCode (
+ HiiCreateGotoOpCode (
+ mStartOpCodeHandle,
FORM_CON_COM_SETUP_ID,
NewMenuEntry->DisplayStringToken,
STRING_TOKEN (STR_NULL_STRING),
EFI_IFR_FLAG_CALLBACK,
- (UINT16) (TERMINAL_OPTION_OFFSET + Index),
- &gUpdateData
+ (UINT16) (TERMINAL_OPTION_OFFSET + Index)
);
}
@@ -248,7 +265,8 @@ UpdateBootDelPage ( NewLoadContext->Deleted = FALSE;
CallbackData->BmmFakeNvData.BootOptionDel[Index] = 0x00;
- CreateCheckBoxOpCode (
+ HiiCreateCheckBoxOpCode (
+ mStartOpCodeHandle,
(EFI_QUESTION_ID) (BOOT_OPTION_DEL_QUESTION_ID + Index),
VARSTORE_ID_BOOT_MAINT,
(UINT16) (BOOT_OPTION_DEL_VAR_OFFSET + Index),
@@ -256,7 +274,7 @@ UpdateBootDelPage ( NewMenuEntry->HelpStringToken,
0,
0,
- &gUpdateData
+ NULL
);
}
@@ -284,13 +302,13 @@ UpdateDrvAddHandlePage ( for (Index = 0; Index < DriverMenu.MenuNumber; Index++) {
NewMenuEntry = BOpt_GetMenuEntry (&DriverMenu, Index);
- CreateGotoOpCode (
+ HiiCreateGotoOpCode (
+ mStartOpCodeHandle,
FORM_DRV_ADD_HANDLE_DESC_ID,
NewMenuEntry->DisplayStringToken,
STRING_TOKEN (STR_NULL_STRING),
EFI_IFR_FLAG_CALLBACK,
- (UINT16) (HANDLE_OPTION_OFFSET + Index),
- &gUpdateData
+ (UINT16) (HANDLE_OPTION_OFFSET + Index)
);
}
@@ -327,7 +345,8 @@ UpdateDrvDelPage ( NewLoadContext->Deleted = FALSE;
CallbackData->BmmFakeNvData.DriverOptionDel[Index] = 0x00;
- CreateCheckBoxOpCode (
+ HiiCreateCheckBoxOpCode (
+ mStartOpCodeHandle,
(EFI_QUESTION_ID) (DRIVER_OPTION_DEL_QUESTION_ID + Index),
VARSTORE_ID_BOOT_MAINT,
(UINT16) (DRIVER_OPTION_DEL_VAR_OFFSET + Index),
@@ -335,7 +354,7 @@ UpdateDrvDelPage ( NewMenuEntry->HelpStringToken,
0,
0,
- &gUpdateData
+ NULL
);
}
@@ -363,15 +382,16 @@ UpdateDriverAddHandleDescPage ( UpdatePageStart (CallbackData);
- CreateSubTitleOpCode (
+ HiiCreateSubTitleOpCode (
+ mStartOpCodeHandle,
NewMenuEntry->DisplayStringToken,
0,
0,
- 0,
- &gUpdateData
+ 0
);
- CreateStringOpCode (
+ HiiCreateStringOpCode (
+ mStartOpCodeHandle,
(EFI_QUESTION_ID) DRV_ADD_HANDLE_DESC_QUESTION_ID,
VARSTORE_ID_BOOT_MAINT,
DRV_ADD_HANDLE_DESC_VAR_OFFSET,
@@ -381,10 +401,11 @@ UpdateDriverAddHandleDescPage ( 0,
6,
75,
- &gUpdateData
+ NULL
);
- CreateCheckBoxOpCode (
+ HiiCreateCheckBoxOpCode (
+ mStartOpCodeHandle,
(EFI_QUESTION_ID) DRV_ADD_RECON_QUESTION_ID,
VARSTORE_ID_BOOT_MAINT,
DRV_ADD_RECON_VAR_OFFSET,
@@ -392,10 +413,11 @@ UpdateDriverAddHandleDescPage ( STRING_TOKEN (STR_LOAD_OPTION_FORCE_RECON),
0,
0,
- &gUpdateData
+ NULL
);
- CreateStringOpCode (
+ HiiCreateStringOpCode (
+ mStartOpCodeHandle,
(EFI_QUESTION_ID) DRIVER_ADD_OPTION_QUESTION_ID,
VARSTORE_ID_BOOT_MAINT,
DRIVER_ADD_OPTION_VAR_OFFSET,
@@ -405,7 +427,7 @@ UpdateDriverAddHandleDescPage ( 0,
6,
75,
- &gUpdateData
+ NULL
);
UpdatePageEnd (CallbackData);
@@ -449,7 +471,8 @@ UpdateConsolePage ( CallbackData->BmmFakeNvData.ConsoleCheck[Index] = FALSE;
}
- CreateCheckBoxOpCode (
+ HiiCreateCheckBoxOpCode (
+ mStartOpCodeHandle,
(EFI_QUESTION_ID) (CON_DEVICE_QUESTION_ID + Index),
VARSTORE_ID_BOOT_MAINT,
(UINT16) (CON_DEVICE_VAR_OFFSET + Index),
@@ -457,7 +480,7 @@ UpdateConsolePage ( NewMenuEntry->HelpStringToken,
0,
CheckFlags,
- &gUpdateData
+ NULL
);
}
@@ -476,7 +499,8 @@ UpdateConsolePage ( CallbackData->BmmFakeNvData.ConsoleCheck[Index] = FALSE;
}
- CreateCheckBoxOpCode (
+ HiiCreateCheckBoxOpCode (
+ mStartOpCodeHandle,
(EFI_QUESTION_ID) (CON_DEVICE_QUESTION_ID + Index),
VARSTORE_ID_BOOT_MAINT,
(UINT16) (CON_DEVICE_VAR_OFFSET + Index),
@@ -484,7 +508,7 @@ UpdateConsolePage ( NewMenuEntry->HelpStringToken,
0,
CheckFlags,
- &gUpdateData
+ NULL
);
Index++;
@@ -511,7 +535,7 @@ UpdateOrderPage ( {
BM_MENU_ENTRY *NewMenuEntry;
UINT16 Index;
- IFR_OPTION *IfrOptionList;
+ VOID *OptionsOpCodeHandle;
CallbackData->BmmAskSaveOrNot = TRUE;
@@ -521,37 +545,39 @@ UpdateOrderPage ( ZeroMem (CallbackData->BmmFakeNvData.OptionOrder, 100);
- IfrOptionList = AllocateZeroPool (sizeof (IFR_OPTION) * OptionMenu->MenuNumber);
- if (IfrOptionList == NULL) {
- return ;
- }
+ OptionsOpCodeHandle = HiiAllocateOpCodeHandle ();
+ ASSERT (OptionsOpCodeHandle != NULL);
for (Index = 0; Index < OptionMenu->MenuNumber; Index++) {
NewMenuEntry = BOpt_GetMenuEntry (OptionMenu, Index);
- IfrOptionList[Index].StringToken = NewMenuEntry->DisplayStringToken;
- IfrOptionList[Index].Value.u8 = (UINT8) (NewMenuEntry->OptionNumber + 1);
- IfrOptionList[Index].Flags = 0;
- CallbackData->BmmFakeNvData.OptionOrder[Index] = IfrOptionList[Index].Value.u8;
+ HiiCreateOneOfOptionOpCode (
+ OptionsOpCodeHandle,
+ NewMenuEntry->DisplayStringToken,
+ 0,
+ EFI_IFR_NUMERIC_SIZE_1,
+ (UINT8) (NewMenuEntry->OptionNumber + 1)
+ );
+ CallbackData->BmmFakeNvData.OptionOrder[Index] = (UINT8) (NewMenuEntry->OptionNumber + 1);
}
if (OptionMenu->MenuNumber > 0) {
- CreateOrderedListOpCode (
- (EFI_QUESTION_ID) OPTION_ORDER_QUESTION_ID,
- VARSTORE_ID_BOOT_MAINT,
- OPTION_ORDER_VAR_OFFSET,
- STRING_TOKEN (STR_CHANGE_ORDER),
- STRING_TOKEN (STR_CHANGE_ORDER),
- 0,
- 0,
- EFI_IFR_NUMERIC_SIZE_1,
- 100,
- IfrOptionList,
- OptionMenu->MenuNumber,
- &gUpdateData
+ HiiCreateOrderedListOpCode (
+ mStartOpCodeHandle, // Container for dynamic created opcodes
+ (EFI_QUESTION_ID) OPTION_ORDER_QUESTION_ID, // Question ID
+ VARSTORE_ID_BOOT_MAINT, // VarStore ID
+ OPTION_ORDER_VAR_OFFSET, // Offset in Buffer Storage
+ STRING_TOKEN (STR_CHANGE_ORDER), // Question prompt text
+ STRING_TOKEN (STR_CHANGE_ORDER), // Question help text
+ 0, // Question flag
+ 0, // Ordered list flag, e.g. EFI_IFR_UNIQUE_SET
+ EFI_IFR_NUMERIC_SIZE_1, // Data type of Question value
+ 100, // Maximum container
+ OptionsOpCodeHandle, // Option Opcode list
+ NULL // Default Opcode is NULL
);
}
- FreePool (IfrOptionList);
+ HiiFreeOpCodeHandle (OptionsOpCodeHandle);
UpdatePageEnd (CallbackData);
@@ -576,11 +602,10 @@ UpdateBootNextPage ( {
BM_MENU_ENTRY *NewMenuEntry;
BM_LOAD_CONTEXT *NewLoadContext;
- IFR_OPTION *IfrOptionList;
UINTN NumberOfOptions;
UINT16 Index;
+ VOID *OptionsOpCodeHandle;
- IfrOptionList = NULL;
NumberOfOptions = BootOptionMenu.MenuNumber;
CallbackData->BmmAskSaveOrNot = TRUE;
@@ -588,34 +613,55 @@ UpdateBootNextPage ( CreateMenuStringToken (CallbackData, CallbackData->BmmHiiHandle, &BootOptionMenu);
if (NumberOfOptions > 0) {
- IfrOptionList = AllocateZeroPool ((NumberOfOptions + 1) * sizeof (IFR_OPTION));
-
- ASSERT (IfrOptionList);
+ OptionsOpCodeHandle = HiiAllocateOpCodeHandle ();
+ ASSERT (OptionsOpCodeHandle != NULL);
CallbackData->BmmFakeNvData.BootNext = (UINT16) (BootOptionMenu.MenuNumber);
for (Index = 0; Index < BootOptionMenu.MenuNumber; Index++) {
NewMenuEntry = BOpt_GetMenuEntry (&BootOptionMenu, Index);
NewLoadContext = (BM_LOAD_CONTEXT *) NewMenuEntry->VariableContext;
+
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;
} 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) {
- 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,
VARSTORE_ID_BOOT_MAINT,
BOOT_NEXT_VAR_OFFSET,
@@ -623,12 +669,11 @@ UpdateBootNextPage ( STRING_TOKEN (STR_BOOT_NEXT_HELP),
0,
EFI_IFR_NUMERIC_SIZE_2,
- IfrOptionList,
- (UINTN) (NumberOfOptions + 1),
- &gUpdateData
+ OptionsOpCodeHandle,
+ NULL
);
- FreePool (IfrOptionList);
+ HiiFreeOpCodeHandle (OptionsOpCodeHandle);
}
UpdatePageEnd (CallbackData);
@@ -646,6 +691,7 @@ UpdateTimeOutPage ( )
{
UINT16 BootTimeOut;
+ VOID *DefaultOpCodeHandle;
CallbackData->BmmAskSaveOrNot = TRUE;
@@ -653,7 +699,12 @@ UpdateTimeOutPage ( 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,
VARSTORE_ID_BOOT_MAINT,
BOOT_TIME_OUT_VAR_OFFSET,
@@ -664,9 +715,10 @@ UpdateTimeOutPage ( 0,
65535,
0,
- BootTimeOut,
- &gUpdateData
+ DefaultOpCodeHandle
);
+
+ HiiFreeOpCodeHandle (DefaultOpCodeHandle);
CallbackData->BmmFakeNvData.BootTimeOut = BootTimeOut;
@@ -694,8 +746,8 @@ UpdateConModePage ( UINTN MaxMode;
UINTN ValidMode;
EFI_STRING_ID *ModeToken;
- IFR_OPTION *IfrOptionList;
EFI_STATUS Status;
+ VOID *OptionsOpCodeHandle;
EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *ConOut;
ConOut = gST->ConOut;
@@ -722,8 +774,8 @@ UpdateConModePage ( return;
}
- IfrOptionList = AllocateZeroPool (sizeof (IFR_OPTION) * ValidMode);
- ASSERT(IfrOptionList != NULL);
+ OptionsOpCodeHandle = HiiAllocateOpCodeHandle ();
+ ASSERT (OptionsOpCodeHandle != NULL);
ModeToken = AllocateZeroPool (sizeof (EFI_STRING_ID) * ValidMode);
ASSERT(ModeToken != NULL);
@@ -754,17 +806,28 @@ UpdateConModePage ( ModeToken[Index] = HiiSetString (CallbackData->BmmHiiHandle, 0, ModeString, NULL);
- IfrOptionList[Index].StringToken = ModeToken[Index];
- IfrOptionList[Index].Value.u16 = (UINT16) Mode;
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 {
- IfrOptionList[Index].Flags = 0;
+ HiiCreateOneOfOptionOpCode (
+ OptionsOpCodeHandle,
+ ModeToken[Index],
+ 0,
+ EFI_IFR_NUMERIC_SIZE_2,
+ (UINT16) Mode
+ );
}
Index++;
}
- CreateOneOfOpCode (
+ HiiCreateOneOfOpCode (
+ mStartOpCodeHandle,
(EFI_QUESTION_ID) CON_MODE_QUESTION_ID,
VARSTORE_ID_BOOT_MAINT,
CON_MODE_VAR_OFFSET,
@@ -772,11 +835,11 @@ UpdateConModePage ( STRING_TOKEN (STR_CON_MODE_SETUP),
EFI_IFR_FLAG_RESET_REQUIRED,
EFI_IFR_NUMERIC_SIZE_2,
- IfrOptionList,
- ValidMode,
- &gUpdateData
+ OptionsOpCodeHandle,
+ NULL
);
- FreePool (IfrOptionList);
+
+ HiiFreeOpCodeHandle (OptionsOpCodeHandle);
FreePool (ModeToken);
UpdatePageEnd (CallbackData);
@@ -796,9 +859,9 @@ UpdateTerminalPage ( {
UINT8 Index;
UINT8 CheckFlags;
- IFR_OPTION *IfrOptionList;
BM_MENU_ENTRY *NewMenuEntry;
BM_TERMINAL_CONTEXT *NewTerminalContext;
+ VOID *OptionsOpCodeHandle;
CallbackData->BmmAskSaveOrNot = TRUE;
@@ -815,10 +878,8 @@ UpdateTerminalPage ( NewTerminalContext = (BM_TERMINAL_CONTEXT *) NewMenuEntry->VariableContext;
- IfrOptionList = AllocateZeroPool (sizeof (IFR_OPTION) * 19);
- if (IfrOptionList == NULL) {
- return ;
- }
+ OptionsOpCodeHandle = HiiAllocateOpCodeHandle ();
+ ASSERT (OptionsOpCodeHandle != NULL);
for (Index = 0; Index < sizeof (BaudRateList) / sizeof (BaudRateList [0]); Index++) {
CheckFlags = 0;
@@ -828,12 +889,17 @@ UpdateTerminalPage ( CallbackData->BmmFakeNvData.COMBaudRate = NewTerminalContext->BaudRateIndex;
}
- IfrOptionList[Index].Flags = CheckFlags;
- IfrOptionList[Index].StringToken = BaudRateList[Index].StringToken;
- IfrOptionList[Index].Value.u8 = Index;
+ HiiCreateOneOfOptionOpCode (
+ OptionsOpCodeHandle,
+ BaudRateList[Index].StringToken,
+ CheckFlags,
+ EFI_IFR_NUMERIC_SIZE_1,
+ Index
+ );
}
- CreateOneOfOpCode (
+ HiiCreateOneOfOpCode (
+ mStartOpCodeHandle,
(EFI_QUESTION_ID) COM_BAUD_RATE_QUESTION_ID,
VARSTORE_ID_BOOT_MAINT,
COM_BAUD_RATE_VAR_OFFSET,
@@ -841,10 +907,13 @@ UpdateTerminalPage ( STRING_TOKEN (STR_COM_BAUD_RATE),
0,
EFI_IFR_NUMERIC_SIZE_1,
- IfrOptionList,
- 19,
- &gUpdateData
+ OptionsOpCodeHandle,
+ NULL
);
+
+ HiiFreeOpCodeHandle (OptionsOpCodeHandle);
+ OptionsOpCodeHandle = HiiAllocateOpCodeHandle ();
+ ASSERT (OptionsOpCodeHandle != NULL);
for (Index = 0; Index < sizeof (DataBitsList) / sizeof (DataBitsList[0]); Index++) {
CheckFlags = 0;
@@ -855,12 +924,17 @@ UpdateTerminalPage ( CheckFlags |= EFI_IFR_OPTION_DEFAULT;
}
- IfrOptionList[Index].Flags = CheckFlags;
- IfrOptionList[Index].StringToken = DataBitsList[Index].StringToken;
- IfrOptionList[Index].Value.u8 = Index;
+ HiiCreateOneOfOptionOpCode (
+ OptionsOpCodeHandle,
+ DataBitsList[Index].StringToken,
+ CheckFlags,
+ EFI_IFR_NUMERIC_SIZE_1,
+ Index
+ );
}
- CreateOneOfOpCode (
+ HiiCreateOneOfOpCode (
+ mStartOpCodeHandle,
(EFI_QUESTION_ID) COM_DATA_RATE_QUESTION_ID,
VARSTORE_ID_BOOT_MAINT,
COM_DATA_RATE_VAR_OFFSET,
@@ -868,11 +942,14 @@ UpdateTerminalPage ( STRING_TOKEN (STR_COM_DATA_BITS),
0,
EFI_IFR_NUMERIC_SIZE_1,
- IfrOptionList,
- 4,
- &gUpdateData
+ OptionsOpCodeHandle,
+ NULL
);
+ HiiFreeOpCodeHandle (OptionsOpCodeHandle);
+ OptionsOpCodeHandle = HiiAllocateOpCodeHandle ();
+ ASSERT (OptionsOpCodeHandle != NULL);
+
for (Index = 0; Index < sizeof (ParityList) / sizeof (ParityList[0]); Index++) {
CheckFlags = 0;
if (NewTerminalContext->Parity == ParityList[Index].Value) {
@@ -881,12 +958,17 @@ UpdateTerminalPage ( CallbackData->BmmFakeNvData.COMParity = NewTerminalContext->ParityIndex;
}
- IfrOptionList[Index].Flags = CheckFlags;
- IfrOptionList[Index].StringToken = ParityList[Index].StringToken;
- IfrOptionList[Index].Value.u8 = Index;
+ HiiCreateOneOfOptionOpCode (
+ OptionsOpCodeHandle,
+ ParityList[Index].StringToken,
+ CheckFlags,
+ EFI_IFR_NUMERIC_SIZE_1,
+ Index
+ );
}
- CreateOneOfOpCode (
+ HiiCreateOneOfOpCode (
+ mStartOpCodeHandle,
(EFI_QUESTION_ID) COM_PARITY_QUESTION_ID,
VARSTORE_ID_BOOT_MAINT,
COM_PARITY_VAR_OFFSET,
@@ -894,11 +976,14 @@ UpdateTerminalPage ( STRING_TOKEN (STR_COM_PARITY),
0,
EFI_IFR_NUMERIC_SIZE_1,
- IfrOptionList,
- 5,
- &gUpdateData
+ OptionsOpCodeHandle,
+ NULL
);
+ HiiFreeOpCodeHandle (OptionsOpCodeHandle);
+ OptionsOpCodeHandle = HiiAllocateOpCodeHandle ();
+ ASSERT (OptionsOpCodeHandle != NULL);
+
for (Index = 0; Index < sizeof (StopBitsList) / sizeof (StopBitsList[0]); Index++) {
CheckFlags = 0;
if (NewTerminalContext->StopBits == StopBitsList[Index].Value) {
@@ -907,12 +992,17 @@ UpdateTerminalPage ( CallbackData->BmmFakeNvData.COMStopBits = NewTerminalContext->StopBitsIndex;
}
- IfrOptionList[Index].Flags = CheckFlags;
- IfrOptionList[Index].StringToken = StopBitsList[Index].StringToken;
- IfrOptionList[Index].Value.u8 = Index;
+ HiiCreateOneOfOptionOpCode (
+ OptionsOpCodeHandle,
+ StopBitsList[Index].StringToken,
+ CheckFlags,
+ EFI_IFR_NUMERIC_SIZE_1,
+ Index
+ );
}
- CreateOneOfOpCode (
+ HiiCreateOneOfOpCode (
+ mStartOpCodeHandle,
(EFI_QUESTION_ID) COM_STOP_BITS_QUESTION_ID,
VARSTORE_ID_BOOT_MAINT,
COM_STOP_BITS_VAR_OFFSET,
@@ -920,11 +1010,14 @@ UpdateTerminalPage ( STRING_TOKEN (STR_COM_STOP_BITS),
0,
EFI_IFR_NUMERIC_SIZE_1,
- IfrOptionList,
- 3,
- &gUpdateData
+ OptionsOpCodeHandle,
+ NULL
);
+ HiiFreeOpCodeHandle (OptionsOpCodeHandle);
+ OptionsOpCodeHandle = HiiAllocateOpCodeHandle ();
+ ASSERT (OptionsOpCodeHandle != NULL);
+
for (Index = 0; Index < 4; Index++) {
CheckFlags = 0;
if (NewTerminalContext->TerminalType == Index) {
@@ -932,12 +1025,17 @@ UpdateTerminalPage ( CallbackData->BmmFakeNvData.COMTerminalType = NewTerminalContext->TerminalType;
}
- IfrOptionList[Index].Flags = CheckFlags;
- IfrOptionList[Index].StringToken = (EFI_STRING_ID) TerminalType[Index];
- IfrOptionList[Index].Value.u8 = Index;
+ HiiCreateOneOfOptionOpCode (
+ OptionsOpCodeHandle,
+ (EFI_STRING_ID) TerminalType[Index],
+ CheckFlags,
+ EFI_IFR_NUMERIC_SIZE_1,
+ Index
+ );
}
- CreateOneOfOpCode (
+ HiiCreateOneOfOpCode (
+ mStartOpCodeHandle,
(EFI_QUESTION_ID) COM_TERMINAL_QUESTION_ID,
VARSTORE_ID_BOOT_MAINT,
COM_TERMINAL_VAR_OFFSET,
@@ -945,12 +1043,11 @@ UpdateTerminalPage ( STRING_TOKEN (STR_COM_TERMI_TYPE),
0,
EFI_IFR_NUMERIC_SIZE_1,
- IfrOptionList,
- 4,
- &gUpdateData
+ OptionsOpCodeHandle,
+ NULL
);
- FreePool (IfrOptionList);
+ HiiFreeOpCodeHandle (OptionsOpCodeHandle);
UpdatePageEnd (CallbackData);
}
@@ -1100,7 +1197,6 @@ UpdateSetLegacyDeviceOrderPage ( BM_LEGACY_DEV_ORDER_CONTEXT *DevOrder;
BM_MENU_OPTION *OptionMenu;
BM_MENU_ENTRY *NewMenuEntry;
- IFR_OPTION *IfrOptionList;
EFI_STRING_ID StrRef;
EFI_STRING_ID StrRefHelp;
BBS_TYPE BbsType;
@@ -1117,6 +1213,7 @@ UpdateSetLegacyDeviceOrderPage ( UINT8 *LegacyOrder;
UINT8 *OldData;
UINT8 *DisMap;
+ VOID *OptionsOpCodeHandle;
OptionMenu = NULL;
Key = 0;
@@ -1196,27 +1293,41 @@ UpdateSetLegacyDeviceOrderPage ( CreateMenuStringToken (CallbackData, CallbackData->BmmHiiHandle, OptionMenu);
- IfrOptionList = AllocateZeroPool (sizeof (IFR_OPTION) * (OptionMenu->MenuNumber + 1));
- if (NULL == IfrOptionList) {
- return ;
- }
+ OptionsOpCodeHandle = HiiAllocateOpCodeHandle ();
+ ASSERT (OptionsOpCodeHandle != NULL);
for (Index = 0; Index < OptionMenu->MenuNumber; Index++) {
NewMenuEntry = BOpt_GetMenuEntry (OptionMenu, Index);
- IfrOptionList[Index].Flags = 0;
- if (0 == Index) {
- IfrOptionList[Index].Flags |= EFI_IFR_OPTION_DEFAULT;
+
+ if (Index == 0) {
+ 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;
- IfrOptionList[Index].Value.u8 = (UINT8) ((BM_LEGACY_DEVICE_CONTEXT *) NewMenuEntry->VariableContext)->Index;
+ HiiCreateOneOfOptionOpCode (
+ OptionsOpCodeHandle,
+ NewMenuEntry->DisplayStringToken,
+ 0,
+ EFI_IFR_NUMERIC_SIZE_1,
+ (UINT8) ((BM_LEGACY_DEVICE_CONTEXT *) NewMenuEntry->VariableContext)->Index
+ );
}
+
//
// for item "Disabled"
//
- IfrOptionList[Index].Flags = 0;
- IfrOptionList[Index].StringToken = STRING_TOKEN (STR_DISABLE_LEGACY_DEVICE);
- IfrOptionList[Index].Value.u8 = 0xFF;
+ HiiCreateOneOfOptionOpCode (
+ OptionsOpCodeHandle,
+ STRING_TOKEN (STR_DISABLE_LEGACY_DEVICE),
+ 0,
+ EFI_IFR_NUMERIC_SIZE_1,
+ 0xFF
+ );
//
// Get Device Order from variable
@@ -1251,7 +1362,8 @@ UpdateSetLegacyDeviceOrderPage ( UnicodeSPrint (String, sizeof (String), TypeStrHelp, Index);
StrRefHelp = HiiSetString (CallbackData->BmmHiiHandle, 0, String, NULL);
- CreateOneOfOpCode (
+ HiiCreateOneOfOpCode (
+ mStartOpCodeHandle,
(EFI_QUESTION_ID) (Key + Index),
VARSTORE_ID_BOOT_MAINT,
(UINT16) (Key + Index - CONFIG_OPTION_OFFSET),
@@ -1259,9 +1371,8 @@ UpdateSetLegacyDeviceOrderPage ( StrRefHelp,
EFI_IFR_FLAG_CALLBACK,
EFI_IFR_NUMERIC_SIZE_1,
- IfrOptionList,
- OptionMenu->MenuNumber + 1,
- &gUpdateData
+ OptionsOpCodeHandle,
+ NULL
);
VarDevOrder = *(UINT16 *) ((UINT8 *) DevOrder + sizeof (BBS_TYPE) + sizeof (UINT16) + Index * sizeof (UINT16));
@@ -1279,10 +1390,7 @@ UpdateSetLegacyDeviceOrderPage ( CopyMem (OldData, LegacyOrder, 100);
- if (IfrOptionList != NULL) {
- FreePool (IfrOptionList);
- IfrOptionList = NULL;
- }
+ HiiFreeOpCodeHandle (OptionsOpCodeHandle);
UpdatePageEnd (CallbackData);
}
diff --git a/IntelFrameworkModulePkg/Universal/BdsDxe/BootMngr/BootManager.c b/IntelFrameworkModulePkg/Universal/BdsDxe/BootMngr/BootManager.c index 4918b25b13..7a727b8675 100644 --- a/IntelFrameworkModulePkg/Universal/BdsDxe/BootMngr/BootManager.c +++ b/IntelFrameworkModulePkg/Universal/BdsDxe/BootMngr/BootManager.c @@ -186,7 +186,6 @@ CallBootManager ( EFI_STATUS Status;
BDS_COMMON_OPTION *Option;
LIST_ENTRY *Link;
- EFI_HII_UPDATE_DATA UpdateData;
CHAR16 *ExitData;
UINTN ExitDataSize;
EFI_STRING_ID Token;
@@ -198,6 +197,10 @@ CallBootManager ( EFI_HII_HANDLE HiiHandle;
EFI_BROWSER_ACTION_REQUEST ActionRequest;
UINTN TempSize;
+ VOID *StartOpCodeHandle;
+ VOID *EndOpCodeHandle;
+ EFI_IFR_GUID_LABEL *StartLabel;
+ EFI_IFR_GUID_LABEL *EndLabel;
gOption = NULL;
InitializeListHead (&BdsBootOptionList);
@@ -223,10 +226,25 @@ CallBootManager ( //
// Allocate space for creation of UpdateData Buffer
//
- UpdateData.BufferSize = 0x1000;
- UpdateData.Offset = 0;
- UpdateData.Data = AllocateZeroPool (0x1000);
- ASSERT (UpdateData.Data != NULL);
+ StartOpCodeHandle = HiiAllocateOpCodeHandle ();
+ ASSERT (StartOpCodeHandle != 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;
@@ -256,32 +274,33 @@ CallBootManager ( HelpToken = HiiSetString (HiiHandle, 0, HelpString, NULL);
- CreateActionOpCode (
+ HiiCreateActionOpCode (
+ StartOpCodeHandle,
mKeyInput,
Token,
HelpToken,
EFI_IFR_FLAG_CALLBACK,
- 0,
- &UpdateData
+ 0
);
}
- IfrLibUpdateForm (
+ HiiUpdateForm (
HiiHandle,
&mBootManagerGuid,
BOOT_MANAGER_FORM_ID,
- LABEL_BOOT_OPTION,
- FALSE,
- &UpdateData
+ StartOpCodeHandle,
+ EndOpCodeHandle
);
- FreePool (UpdateData.Data);
+
+ HiiFreeOpCodeHandle (StartOpCodeHandle);
+ HiiFreeOpCodeHandle (EndOpCodeHandle);
ActionRequest = EFI_BROWSER_ACTION_REQUEST_NONE;
Status = gFormBrowser2->SendForm (
gFormBrowser2,
&HiiHandle,
1,
- NULL,
+ &mBootManagerGuid,
0,
NULL,
&ActionRequest
diff --git a/IntelFrameworkModulePkg/Universal/BdsDxe/BootMngr/BootManager.h b/IntelFrameworkModulePkg/Universal/BdsDxe/BootMngr/BootManager.h index 90b7b2850d..00307b6ba3 100644 --- a/IntelFrameworkModulePkg/Universal/BdsDxe/BootMngr/BootManager.h +++ b/IntelFrameworkModulePkg/Universal/BdsDxe/BootMngr/BootManager.h @@ -29,6 +29,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. #define BOOT_MANAGER_FORM_ID 0x1000
#define LABEL_BOOT_OPTION 0x00
+#define LABEL_BOOT_OPTION_END 0x01
//
// These are the VFR compiler generated data representing our VFR data.
diff --git a/IntelFrameworkModulePkg/Universal/BdsDxe/BootMngr/BootManagerVfr.Vfr b/IntelFrameworkModulePkg/Universal/BdsDxe/BootMngr/BootManagerVfr.Vfr index a70966cf3c..c23c84fcf3 100644 --- a/IntelFrameworkModulePkg/Universal/BdsDxe/BootMngr/BootManagerVfr.Vfr +++ b/IntelFrameworkModulePkg/Universal/BdsDxe/BootMngr/BootManagerVfr.Vfr @@ -24,11 +24,12 @@ #define BOOT_MANAGER_SUBCLASS 0x00
formset
- guid = FORMSET_GUID,
- title = STRING_TOKEN(STR_BM_BANNER),
- help = STRING_TOKEN(STR_LAST_STRING),
- class = BOOT_MANAGER_CLASS,
- subclass = BOOT_MANAGER_SUBCLASS,
+ guid = FORMSET_GUID,
+ title = STRING_TOKEN(STR_BM_BANNER),
+ help = STRING_TOKEN(STR_LAST_STRING),
+ classguid = FORMSET_GUID,
+ class = BOOT_MANAGER_CLASS,
+ subclass = BOOT_MANAGER_SUBCLASS,
form formid = BOOT_MANAGER_FORM_ID,
title = STRING_TOKEN(STR_BM_BANNER);
diff --git a/IntelFrameworkModulePkg/Universal/BdsDxe/DeviceMngr/DeviceManager.c b/IntelFrameworkModulePkg/Universal/BdsDxe/DeviceMngr/DeviceManager.c index 920a050630..86046081fe 100644 --- a/IntelFrameworkModulePkg/Universal/BdsDxe/DeviceMngr/DeviceManager.c +++ b/IntelFrameworkModulePkg/Universal/BdsDxe/DeviceMngr/DeviceManager.c @@ -13,6 +13,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. **/
#include "DeviceManager.h"
+#include <Guid/HiiPlatformSetupFormset.h>
DEVICE_MANAGER_CALLBACK_DATA gDeviceManagerPrivate = {
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
Formset. The decision by user is saved to gCallbackKey for later processing. If
@@ -155,6 +153,124 @@ InitializeDeviceManager ( }
/**
+ 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
to configure the platform.
@@ -172,21 +288,21 @@ CallDeviceManager ( )
{
EFI_STATUS Status;
- UINTN Count;
UINTN Index;
EFI_STRING String;
- EFI_HII_UPDATE_DATA UpdateData[MENU_ITEM_NUM];
EFI_STRING_ID Token;
EFI_STRING_ID TokenHelp;
EFI_HII_HANDLE *HiiHandles;
EFI_HII_HANDLE HiiHandle;
- UINT16 FormSetClass;
EFI_STRING_ID FormSetTitle;
EFI_STRING_ID FormSetHelp;
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;
gCallbackKey = 0;
@@ -201,17 +317,30 @@ CallDeviceManager ( //
// Create Subtitle OpCodes
//
- for (Index = 0; Index < MENU_ITEM_NUM; Index++) {
- //
- // Allocate space for creation of UpdateData Buffer
- //
- UpdateData[Index].BufferSize = 0x1000;
- UpdateData[Index].Offset = 0;
- UpdateData[Index].Data = AllocatePool (0x1000);
- ASSERT (UpdateData[Index].Data != NULL);
+ //
+ // Allocate space for creation of UpdateData Buffer
+ //
+ StartOpCodeHandle = HiiAllocateOpCodeHandle ();
+ ASSERT (StartOpCodeHandle != 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
@@ -225,9 +354,7 @@ CallDeviceManager ( // Search for formset of each class type
//
for (Index = 0; HiiHandles[Index] != NULL; Index++) {
- IfrLibExtractClassFromHiiHandle (HiiHandles[Index], &FormSetClass, &FormSetTitle, &FormSetHelp);
-
- if (FormSetClass == EFI_NON_DEVICE_CLASS) {
+ if (!ExtractDisplayedHiiFormFromHiiHandle (HiiHandles[Index], &gEfiHiiPlatformSetupFormsetGuid, &FormSetTitle, &FormSetHelp)) {
continue;
}
@@ -241,42 +368,35 @@ CallDeviceManager ( TokenHelp = HiiSetString (HiiHandle, 0, String, NULL);
FreePool (String);
- for (Count = 0; Count < MENU_ITEM_NUM; Count++) {
- if (FormSetClass & mDeviceManagerMenuItemTable[Count].Class) {
- CreateActionOpCode (
- (EFI_QUESTION_ID) (Index + DEVICE_KEY_OFFSET),
- Token,
- TokenHelp,
- EFI_IFR_FLAG_CALLBACK,
- 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]
+ HiiCreateActionOpCode (
+ StartOpCodeHandle,
+ (EFI_QUESTION_ID) (Index + DEVICE_KEY_OFFSET),
+ Token,
+ TokenHelp,
+ EFI_IFR_FLAG_CALLBACK,
+ 0
);
}
+ //
+ // Add End Opcode for Subtitle
+ //
+ HiiCreateEndOpCode (StartOpCodeHandle);
+
+ HiiUpdateForm (
+ HiiHandle,
+ &mDeviceManagerGuid,
+ DEVICE_MANAGER_FORM_ID,
+ StartOpCodeHandle,
+ EndOpCodeHandle
+ );
+
ActionRequest = EFI_BROWSER_ACTION_REQUEST_NONE;
Status = gFormBrowser2->SendForm (
gFormBrowser2,
&HiiHandle,
1,
- NULL,
+ &mDeviceManagerGuid,
0,
NULL,
&ActionRequest
@@ -329,9 +449,8 @@ CallDeviceManager ( Status = EFI_SUCCESS;
}
- for (Index = 0; Index < MENU_ITEM_NUM; Index++) {
- FreePool (UpdateData[Index].Data);
- }
+ HiiFreeOpCodeHandle (StartOpCodeHandle);
+ HiiFreeOpCodeHandle (EndOpCodeHandle);
FreePool (HiiHandles);
return Status;
diff --git a/IntelFrameworkModulePkg/Universal/BdsDxe/DeviceMngr/DeviceManager.h b/IntelFrameworkModulePkg/Universal/BdsDxe/DeviceMngr/DeviceManager.h index ef39ca142e..4bcd09a1b0 100644 --- a/IntelFrameworkModulePkg/Universal/BdsDxe/DeviceMngr/DeviceManager.h +++ b/IntelFrameworkModulePkg/Universal/BdsDxe/DeviceMngr/DeviceManager.h @@ -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} \
}
+#define LABEL_DEVICES_LIST 0x0080
+#define LABEL_END 0xffff
+
#define LABEL_VBIOS 0x0040
#define DEVICE_MANAGER_FORM_ID 0x1000
diff --git a/IntelFrameworkModulePkg/Universal/BdsDxe/DeviceMngr/DeviceManagerStrings.uni b/IntelFrameworkModulePkg/Universal/BdsDxe/DeviceMngr/DeviceManagerStrings.uni Binary files differindex cf614c5b00..5a595d18d6 100644 --- a/IntelFrameworkModulePkg/Universal/BdsDxe/DeviceMngr/DeviceManagerStrings.uni +++ b/IntelFrameworkModulePkg/Universal/BdsDxe/DeviceMngr/DeviceManagerStrings.uni diff --git a/IntelFrameworkModulePkg/Universal/BdsDxe/DeviceMngr/DeviceManagerVfr.Vfr b/IntelFrameworkModulePkg/Universal/BdsDxe/DeviceMngr/DeviceManagerVfr.Vfr index d0b65b84be..55ee419bc5 100644 --- a/IntelFrameworkModulePkg/Universal/BdsDxe/DeviceMngr/DeviceManagerVfr.Vfr +++ b/IntelFrameworkModulePkg/Universal/BdsDxe/DeviceMngr/DeviceManagerVfr.Vfr @@ -23,6 +23,7 @@ #define EFI_OTHER_DEVICE_CLASS 0x0020
#define LABEL_VBIOS 0x0040
+#define LABEL_DEVICES_LIST 0x0080
#define LABEL_END 0xffff
#define DEVICE_MANAGER_CLASS 0x0000
@@ -31,11 +32,12 @@ #define DEVICE_MANAGER_FORM_ID 0x1000
formset
- guid = FORMSET_GUID,
- title = STRING_TOKEN(STR_DEVICE_MANAGER_TITLE),
- help = STRING_TOKEN(STR_EMPTY_STRING),
- class = DEVICE_MANAGER_CLASS,
- subclass = FRONT_PAGE_SUBCLASS,
+ guid = FORMSET_GUID,
+ title = STRING_TOKEN(STR_DEVICE_MANAGER_TITLE),
+ help = STRING_TOKEN(STR_EMPTY_STRING),
+ classguid = FORMSET_GUID,
+ class = DEVICE_MANAGER_CLASS,
+ subclass = FRONT_PAGE_SUBCLASS,
form formid = DEVICE_MANAGER_FORM_ID,
title = STRING_TOKEN(STR_DEVICE_MANAGER_TITLE);
@@ -58,7 +60,9 @@ formset label EFI_ON_BOARD_DEVICE_CLASS;
// label LABEL_END;
- label EFI_OTHER_DEVICE_CLASS;
+// label EFI_OTHER_DEVICE_CLASS;
+
+ label LABEL_DEVICES_LIST;
label LABEL_END;
subtitle text = STRING_TOKEN(STR_EMPTY_STRING);
diff --git a/IntelFrameworkModulePkg/Universal/BdsDxe/FrontPage.c b/IntelFrameworkModulePkg/Universal/BdsDxe/FrontPage.c index 2719a723fb..bca0555b12 100644 --- a/IntelFrameworkModulePkg/Universal/BdsDxe/FrontPage.c +++ b/IntelFrameworkModulePkg/Universal/BdsDxe/FrontPage.c @@ -298,19 +298,21 @@ InitializeFrontPage ( )
{
EFI_STATUS Status;
- EFI_HII_UPDATE_DATA UpdateData;
- IFR_OPTION *OptionList;
CHAR8 *LanguageString;
CHAR8 *LangCode;
CHAR8 *Lang;
CHAR8 *CurrentLang;
CHAR8 *BestLanguage;
UINTN OptionCount;
- EFI_STRING_ID Token;
CHAR16 *StringBuffer;
UINTN BufferSize;
- UINTN Index;
EFI_HII_HANDLE HiiHandle;
+ VOID *OptionsOpCodeHandle;
+ VOID *StartOpCodeHandle;
+ VOID *EndOpCodeHandle;
+ EFI_IFR_GUID_LABEL *StartLabel;
+ EFI_IFR_GUID_LABEL *EndLabel;
+ BOOLEAN FirstFlag;
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;
- UpdateData.Data = AllocateZeroPool (0x1000);
- ASSERT (UpdateData.Data != NULL);
+ StartOpCodeHandle = HiiAllocateOpCodeHandle ();
+ ASSERT (StartOpCodeHandle != NULL);
- OptionList = AllocateZeroPool (0x1000);
- ASSERT (OptionList != NULL);
+ EndOpCodeHandle = HiiAllocateOpCodeHandle ();
+ 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
@@ -417,11 +434,25 @@ InitializeFrontPage ( 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;
LangCode = LanguageString;
while (*LangCode != 0) {
GetNextLanguage (&LangCode, Lang);
- if (gFrontPagePrivate.LanguageToken == NULL) {
+ if (FirstFlag) {
//
// Get Language Name from String Package. The StringId of Printable Language
// Name is always 1 which is generated by StringGather Tool.
@@ -452,19 +483,30 @@ InitializeFrontPage ( }
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);
- } else {
- Token = gFrontPagePrivate.LanguageToken[OptionCount];
}
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 {
- 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++;
}
@@ -476,8 +518,8 @@ InitializeFrontPage ( FreePool (Lang);
FreePool (LanguageString);
- UpdateData.Offset = 0;
- CreateOneOfOpCode (
+ HiiCreateOneOfOpCode (
+ StartOpCodeHandle,
FRONT_PAGE_KEY_LANGUAGE,
0,
0,
@@ -485,31 +527,21 @@ InitializeFrontPage ( STRING_TOKEN (STR_LANGUAGE_SELECT_HELP),
EFI_IFR_FLAG_CALLBACK,
EFI_IFR_NUMERIC_SIZE_1,
- OptionList,
- OptionCount,
- &UpdateData
+ OptionsOpCodeHandle,
+ NULL
);
- Status = IfrLibUpdateForm (
+ Status = HiiUpdateForm (
HiiHandle,
&mFrontPageGuid,
FRONT_PAGE_FORM_ID,
- LABEL_SELECT_LANGUAGE,
- FALSE,
- &UpdateData
+ StartOpCodeHandle, // LABEL_SELECT_LANGUAGE
+ EndOpCodeHandle // LABEL_END
);
- //
- // Save the string Id for each language
- //
- 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);
+ HiiFreeOpCodeHandle (StartOpCodeHandle);
+ HiiFreeOpCodeHandle (EndOpCodeHandle);
+ HiiFreeOpCodeHandle (OptionsOpCodeHandle);
return Status;
}
diff --git a/IntelFrameworkModulePkg/Universal/BdsDxe/FrontPage.h b/IntelFrameworkModulePkg/Universal/BdsDxe/FrontPage.h index 420a474e35..998ad1ff33 100644 --- a/IntelFrameworkModulePkg/Universal/BdsDxe/FrontPage.h +++ b/IntelFrameworkModulePkg/Universal/BdsDxe/FrontPage.h @@ -45,6 +45,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. #define FRONT_PAGE_KEY_BOOT_MAINTAIN 0x9876
#define LABEL_SELECT_LANGUAGE 0x1000
+#define LABEL_END 0xffff
#define FRONT_PAGE_FORMSET_GUID \
{ \
diff --git a/IntelFrameworkModulePkg/Universal/BdsDxe/FrontPageVfr.Vfr b/IntelFrameworkModulePkg/Universal/BdsDxe/FrontPageVfr.Vfr index 4bf657dc72..b9f000e3ff 100644 --- a/IntelFrameworkModulePkg/Universal/BdsDxe/FrontPageVfr.Vfr +++ b/IntelFrameworkModulePkg/Universal/BdsDxe/FrontPageVfr.Vfr @@ -40,6 +40,7 @@ formset guid = FORMSET_GUID,
title = STRING_TOKEN(STR_FRONT_PAGE_TITLE),
help = STRING_TOKEN(STR_NULL_STRING),
+ classguid = FORMSET_GUID,
class = FRONT_PAGE_CLASS,
subclass = FRONT_PAGE_SUBCLASS,
|