1) Add in fix to handle the case when a form is not related to a buffer storage.

2) Allocate Hii Handle from a bitfield array so Framework Hii Handle can be recycled.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@5700 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
qwang12
2008-08-20 14:17:24 +00:00
parent 1a8802f763
commit d4775f2a4c
9 changed files with 285 additions and 202 deletions

View File

@@ -14,6 +14,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
#include "HiiDatabase.h"
#include "HiiHandle.h"
HII_THUNK_PRIVATE_DATA *mHiiThunkPrivateData;
@@ -43,20 +44,6 @@ HII_THUNK_PRIVATE_DATA mHiiThunkPrivateDataTempate = {
HiiGetKeyboardLayout
},
//
//StaticHiiHandle
//The FRAMEWORK_EFI_HII_HANDLE starts from 1
// and increase upwords untill reach the value of StaticPureUefiHiiHandle.
// The code will assert to prevent overflow.
(FRAMEWORK_EFI_HII_HANDLE) 1,
//
//StaticPureUefiHiiHandle
//The Static FRAMEWORK_EFI_HII_HANDLE starts from 0xFFFF
// and decrease downwords untill reach the value of StaticHiiHandle.
// The code will assert to prevent overflow.
//
(FRAMEWORK_EFI_HII_HANDLE) 0xFFFF,
{
NULL, NULL //HiiHandleLinkList
},
@@ -111,6 +98,7 @@ Returns:
UINTN BufferLength;
EFI_HII_HANDLE *Buffer;
UINTN Index;
HII_THUNK_CONTEXT *ThunkContext;
ASSERT_PROTOCOL_ALREADY_INSTALLED (NULL, &gEfiHiiProtocolGuid);
@@ -119,6 +107,8 @@ Returns:
ASSERT (Private != NULL);
InitializeListHead (&Private->ThunkContextListHead);
InitHiiHandleDatabase ();
mHiiThunkPrivateData = Private;
Status = gBS->LocateProtocol (
@@ -174,8 +164,10 @@ Returns:
Status = HiiLibListPackageLists (EFI_HII_PACKAGE_STRINGS, NULL, &BufferLength, &Buffer);
if (Status == EFI_SUCCESS) {
for (Index = 0; Index < BufferLength / sizeof (EFI_HII_HANDLE); Index++) {
CreateThunkContextForUefiHiiHandle (Private, Buffer[Index]);
ASSERT_EFI_ERROR (Status);
ThunkContext = CreateThunkContextForUefiHiiHandle (Buffer[Index]);
ASSERT (ThunkContext!= NULL);
InsertTailList (&Private->ThunkContextListHead, &ThunkContext->Link);
}
FreePool (Buffer);