1) Add in support to get only VarStoreId = 1 from Multiple VarStores.

2) Remove ThunkIfrSupportLib.h
3) Update some comments.
4) Add GetAttributesOfFirstFormSet to scan form package to read formset title, class info.
5) Clean up function related to package registration code.
6) Clean up RemovePackNotify

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@5705 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
qwang12
2008-08-21 07:56:01 +00:00
parent 2a00326e8e
commit a3318eaf7a
13 changed files with 132 additions and 154 deletions

View File

@ -398,6 +398,31 @@ GetUefiVariable (
return Status;
}
BUFFER_STORAGE_ENTRY *
GetBufferStorageEntry (
IN CONFIG_ACCESS_PRIVATE *ConfigAccess,
IN UINT16 VarStoreId
)
{
LIST_ENTRY *Link;
BUFFER_STORAGE_ENTRY *BufferStorage;
Link = GetFirstNode (&ConfigAccess->BufferStorageListHead);
while (!IsNull (&ConfigAccess->BufferStorageListHead, Link)) {
BufferStorage = BUFFER_STORAGE_ENTRY_FROM_LINK (Link);
if (BufferStorage->VarStoreId == VarStoreId) {
return BufferStorage;
}
Link = GetNextNode (&ConfigAccess->BufferStorageListHead, Link);
}
return NULL;
}
/**
This function implement the EFI_HII_CONFIG_ACCESS_PROTOCOL.ExtractConfig
@ -432,7 +457,6 @@ ThunkExtractConfig (
{
EFI_STATUS Status;
CONFIG_ACCESS_PRIVATE *ConfigAccess;
LIST_ENTRY *Link;
BUFFER_STORAGE_ENTRY *BufferStorage;
VOID *Data;
UINTN DataSize;
@ -443,13 +467,7 @@ ThunkExtractConfig (
//
// For now, only one var varstore is supported so that we don't need to parse the Configuration string.
//
Link = GetFirstNode (&ConfigAccess->BufferStorageListHead);
if (Link == NULL) {
ASSERT (FALSE);
return EFI_INVALID_PARAMETER;
}
BufferStorage = BUFFER_STORAGE_ENTRY_FROM_LINK (Link);
BufferStorage = GetBufferStorageEntry (ConfigAccess, (UINT16) RESERVED_VARSTORE_ID);
if (ConfigAccess->ThunkContext->NvMapOverride == NULL) {
if (ConfigAccess->FormCallbackProtocol == NULL ||
@ -519,7 +537,6 @@ ThunkRouteConfig (
{
EFI_STATUS Status;
CONFIG_ACCESS_PRIVATE *ConfigAccess;
LIST_ENTRY *Link;
BUFFER_STORAGE_ENTRY *BufferStorage;
UINT8 *Data;
UINTN DataSize;
@ -534,13 +551,8 @@ ThunkRouteConfig (
//
// For now, only one var varstore is supported so that we don't need to parse the Configuration string.
//
Link = GetFirstNode (&ConfigAccess->BufferStorageListHead);
if (Link == NULL) {
ASSERT (FALSE);
return EFI_INVALID_PARAMETER;
}
BufferStorage = GetBufferStorageEntry (ConfigAccess, (UINT16) RESERVED_VARSTORE_ID);
BufferStorage = BUFFER_STORAGE_ENTRY_FROM_LINK (Link);
DataSize2 = BufferStorage->Size;
if (ConfigAccess->ThunkContext->NvMapOverride == NULL) {
DataAllocated = TRUE;
@ -901,17 +913,10 @@ ThunkCallback (
//
if (EFI_ERROR (Status)) {
if (Packet != NULL) {
//
// BUGBUG: need to restore the changing question to default value
//
do {
IfrLibCreatePopUp (1, &Key, Packet->String);
} while (Key.UnicodeChar != CHAR_CARRIAGE_RETURN);
}
//
// Error Code in Status is discarded.
//
@ -943,7 +948,7 @@ ThunkCallback (
NotifyHandle
);
//
// UEFI SetupBrowser handles scenario differently with Framework SetupBrowser when call back function
// UEFI SetupBrowser behaves differently with Framework SetupBrowser when call back function
// update any forms in HII database. UEFI SetupBrowser will re-parse the displaying form package and load
// the values from variable storages. Framework SetupBrowser will only re-parse the displaying form packages.
// To make sure customer's previous changes is saved and the changing question behaves as expected, we

View File

@ -1,5 +1,4 @@
/**@file
This file contains the Glyph related function.
Copyright (c) 2006 - 2008, Intel Corporation

View File

@ -38,8 +38,7 @@ FW_HII_FORMSET_TEMPLATE FormSetTemplate = {
FRAMEWORK_EFI_IFR_FORM_SET_OP,
sizeof (FRAMEWORK_EFI_IFR_FORM_SET)
},
//Guid
{0, 0, 0, {0, 0, 0, 0, 0, 0, 0, 0}},
{0, 0, 0, {0, 0, 0, 0, 0, 0, 0, 0}}, //Guid
0,
0,
0,

View File

@ -45,7 +45,10 @@ HII_THUNK_PRIVATE_DATA mHiiThunkPrivateDataTempate = {
},
{
NULL, NULL //HiiHandleLinkList
///
/// HiiHandleLinkList
///
NULL, NULL
},
};

View File

@ -1,7 +1,7 @@
/**@file
This file contains global defines and prototype definitions
for the HII database.
for the Framework HII to Uefi HII Thunk Module.
Copyright (c) 2006 - 2008, Intel Corporation
All rights reserved. This program and the accompanying materials
@ -51,6 +51,17 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#include <MdeModuleHii.h>
//
// VARSTORE ID of 0 for Buffer Storage Type Storage is reserved in UEFI IFR form. But VARSTORE ID
// 0 in Framework IFR is the default VarStore ID for storage without explicit declaration. So we have
// to reseved 0x0001 in UEFI VARSTORE ID to represetn default storage id in Framework IFR.
// Framework VFR has to be ported or pre-processed to change the default VARSTORE to a VARSTORE
// with ID equal to 0x0001.
//
#define RESERVED_VARSTORE_ID 0x0001
#pragma pack (push, 1)
typedef struct {
UINT32 BinaryLength;
@ -220,21 +231,6 @@ extern HII_THUNK_PRIVATE_DATA *mHiiThunkPrivateData;
extern BOOLEAN mInFrameworkUpdatePakcage;
//
// Prototypes
//
//
// Public Interface Prototypes
//
EFI_STATUS
EFIAPI
InitializeHiiDatabase (
IN EFI_HANDLE ImageHandle,
IN EFI_SYSTEM_TABLE *SystemTable
)
;
EFI_STATUS
EFIAPI
HiiNewPack (
@ -413,15 +409,6 @@ HiiGetKeyboardLayout (
)
;
EFI_STATUS
HiiCompareLanguage (
IN CHAR16 *LanguageStringLocation,
IN CHAR16 *Language
)
;
EFI_STATUS
EFIAPI
ThunkSendForm (
@ -434,7 +421,8 @@ ThunkSendForm (
IN UINT8 *NvMapOverride, OPTIONAL
IN FRAMEWORK_EFI_SCREEN_DESCRIPTOR *ScreenDimensions, OPTIONAL
OUT BOOLEAN *ResetRequired OPTIONAL
);
)
;
EFI_STATUS
EFIAPI
@ -446,7 +434,8 @@ ThunkCreatePopUp (
OUT EFI_INPUT_KEY *KeyValue,
IN CHAR16 *String,
...
);
)
;
EFI_STATUS
EFIAPI

View File

@ -1,5 +1,5 @@
/**@file
Framework HII handle database allocation and deallocation functins.
This file is for functins related to assign and free Framework HII handle number.
Copyright (c) 2008, Intel Corporation
All rights reserved. This program and the accompanying materials

View File

@ -1,6 +1,5 @@
/**@file
This file contains utility functions by HII Thunk Modules.
This file is for functins related to assign and free Framework HII handle number.
Copyright (c) 2006 - 2008, Intel Corporation
All rights reserved. This program and the accompanying materials

View File

@ -755,10 +755,7 @@ F2UCreateNumericOpCode (
UOpcode.Question.Header.Help = FwOpcode->Help;
UOpcode.Question.QuestionId = FwOpcode->Key;
//
// BUGBUG RESERVED_VARSTORE_ID should be passed in.
//
UOpcode.Question.VarStoreId = RESERVED_VARSTORE_ID;
UOpcode.Question.VarStoreId = VarStoreId;
UOpcode.Question.VarStoreInfo.VarOffset = FwOpcode->QuestionId;
UOpcode.Question.Flags = (FwOpcode->Flags & (FRAMEWORK_EFI_IFR_FLAG_INTERACTIVE | FRAMEWORK_EFI_IFR_FLAG_RESET_REQUIRED));

View File

@ -43,7 +43,7 @@ GetPackageCount (
for (Index = 0; Index < Packages->NumberOfPackages; Index++) {
//
// BugBug: The current UEFI HII build tool generate a binary in the format defined in:
// The current UEFI HII build tool generate a binary in the format defined by
// TIANO_AUTOGEN_PACKAGES_HEADER. We assume that all packages generated in
// this binary is with same package type. So the returned IfrPackageCount and StringPackageCount
// may not be the exact number of valid package number in the binary generated

View File

@ -37,7 +37,7 @@ ThunkSendForm (
if (!UseDatabase) {
//
// Packet, CallbackHandle.
// ThunkSendForm only support displays forms registered into the HII database.
//
return EFI_UNSUPPORTED;
}

View File

@ -132,10 +132,6 @@ Returns:
BOOLEAN Found;
CHAR8 *Rfc3066AsciiLanguage;
//
// BugBug: Conver the language to 3066.
//
LastStringId = (EFI_STRING_ID) 0;
StringId = (EFI_STRING_ID) 0;
Found = FALSE;

View File

@ -26,6 +26,7 @@
#include "UefiIfrParser.h"
#include "UefiIfrDefault.h"
#include "HiiDatabase.h"
//
// Extern Variables

View File

@ -15,16 +15,6 @@
#ifndef _HII_THUNK_UEFI_IFR_DEFAULT_
#define _HII_THUNK_UEFI_IFR_DEFAULT_
//
// VARSTORE ID of 0 for Buffer Storage Type Storage is reserved in UEFI IFR form. But VARSTORE ID
// 0 in Framework IFR is the default VarStore ID for storage without explicit declaration. So we have
// to reseved 0x0001 in UEFI VARSTORE ID to represetn default storage id in Framework IFR.
// Framework VFR has to be ported or pre-processed to change the default VARSTORE to a VARSTORE
// with ID equal to 0x0001.
//
#define RESERVED_VARSTORE_ID 0x0001
#define RESERVED_QUESTION_ID 0xf000
#define UEFI_IFR_BUFFER_STORAGE_NODE_FROM_LIST(a) CR(a, UEFI_IFR_BUFFER_STORAGE_NODE, List, UEFI_IFR_BUFFER_STORAGE_NODE_SIGNATURE)
#define UEFI_IFR_BUFFER_STORAGE_NODE_SIGNATURE EFI_SIGNATURE_32 ('I', 'b', 'S', 'n')
typedef struct {