Cleanups in PlatformBds.c. BDS will get rewritten, but his makes it easier to look at the current BDS

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@3187 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
AJFISH 2007-07-11 03:08:05 +00:00
parent a8498707b9
commit d1477e4d0d
8 changed files with 63 additions and 369 deletions

View File

@ -33,7 +33,7 @@ Revision History
} }
EFI_HII_HANDLE gStringPackHandle; EFI_HII_HANDLE gStringPackHandle;
EFI_HII_PROTOCOL *Hii; EFI_HII_PROTOCOL *gHii;
CHAR16 * CHAR16 *
GetStringById ( GetStringById (

View File

@ -33,7 +33,6 @@ Abstract:
// //
extern UINT8 bmBin[]; extern UINT8 bmBin[];
extern UINT8 FEBin[]; extern UINT8 FEBin[];
extern EFI_GUID gBdsStringPackGuid;
extern BOOLEAN gConnectAllHappened; extern BOOLEAN gConnectAllHappened;
EFI_GUID EfiLegacyDevOrderGuid = EFI_LEGACY_DEV_ORDER_VARIABLE_GUID; EFI_GUID EfiLegacyDevOrderGuid = EFI_LEGACY_DEV_ORDER_VARIABLE_GUID;
@ -851,13 +850,13 @@ Returns:
// //
// Post our VFR to the HII database. // Post our VFR to the HII database.
// //
PackageList = PreparePackages (1, &gBdsStringPackGuid, bmBin); PackageList = PreparePackages (1, &gEfiCallerIdGuid, bmBin);
Status = Hii->NewPack (Hii, PackageList, &HiiHandle); Status = Hii->NewPack (Hii, PackageList, &HiiHandle);
FreePool (PackageList); FreePool (PackageList);
BmmCallbackInfo->BmmHiiHandle = HiiHandle; BmmCallbackInfo->BmmHiiHandle = HiiHandle;
PackageList = PreparePackages (1, &gBdsStringPackGuid, FEBin); PackageList = PreparePackages (1, &gEfiCallerIdGuid, FEBin);
Status = Hii->NewPack (Hii, PackageList, &HiiHandle); Status = Hii->NewPack (Hii, PackageList, &HiiHandle);
FreePool (PackageList); FreePool (PackageList);

View File

@ -173,7 +173,7 @@ Returns:
// Post our VFR to the HII database // Post our VFR to the HII database
// //
PackageList = PreparePackages (2, &BmGuid, BootManagerVfrBin, PlatformBdsStrings); PackageList = PreparePackages (2, &BmGuid, BootManagerVfrBin, PlatformBdsStrings);
Status = Hii->NewPack (Hii, PackageList, &gBootManagerHandle); Status = gHii->NewPack (gHii, PackageList, &gBootManagerHandle);
FreePool (PackageList); FreePool (PackageList);
// //
@ -197,7 +197,7 @@ Returns:
ASSERT_EFI_ERROR (Status); ASSERT_EFI_ERROR (Status);
LastToken = 0; LastToken = 0;
Hii->NewString (Hii, NULL, gBootManagerHandle, &LastToken, L" "); gHii->NewString (gHii, NULL, gBootManagerHandle, &LastToken, L" ");
// //
// Allocate space for creation of UpdateData Buffer // Allocate space for creation of UpdateData Buffer
@ -227,7 +227,7 @@ Returns:
&UpdateData->Data // Buffer containing created op-code &UpdateData->Data // Buffer containing created op-code
); );
Hii->UpdateForm (Hii, gBootManagerHandle, (EFI_FORM_LABEL) 0x0000, TRUE, UpdateData); gHii->UpdateForm (gHii, gBootManagerHandle, (EFI_FORM_LABEL) 0x0000, TRUE, UpdateData);
// //
// Create "Boot Option Menu" title // Create "Boot Option Menu" title
@ -237,7 +237,7 @@ Returns:
&UpdateData->Data // Buffer containing created op-code &UpdateData->Data // Buffer containing created op-code
); );
Hii->UpdateForm (Hii, gBootManagerHandle, (EFI_FORM_LABEL) 0x0000, TRUE, UpdateData); gHii->UpdateForm (gHii, gBootManagerHandle, (EFI_FORM_LABEL) 0x0000, TRUE, UpdateData);
Token = LastToken; Token = LastToken;
mKeyInput = 0; mKeyInput = 0;
@ -254,7 +254,7 @@ Returns:
mKeyInput++; mKeyInput++;
Token++; Token++;
Status = Hii->NewString (Hii, NULL, gBootManagerHandle, &Token, Option->Description); Status = gHii->NewString (gHii, NULL, gBootManagerHandle, &Token, Option->Description);
// //
// If we got an error it is almost certainly due to the token value being invalid. // If we got an error it is almost certainly due to the token value being invalid.
@ -262,7 +262,7 @@ Returns:
// //
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
Token = 0; Token = 0;
Status = Hii->NewString (Hii, NULL, gBootManagerHandle, &Token, Option->Description); Status = gHii->NewString (gHii, NULL, gBootManagerHandle, &Token, Option->Description);
} }
Status = CreateGotoOpCode ( Status = CreateGotoOpCode (
@ -279,7 +279,7 @@ Returns:
} }
Hii->UpdateForm (Hii, gBootManagerHandle, (EFI_FORM_LABEL) 0x0001, TRUE, UpdateData); gHii->UpdateForm (gHii, gBootManagerHandle, (EFI_FORM_LABEL) 0x0001, TRUE, UpdateData);
UpdateData->DataCount = 1; UpdateData->DataCount = 1;
@ -291,14 +291,14 @@ Returns:
&UpdateData->Data // Buffer containing created op-code &UpdateData->Data // Buffer containing created op-code
); );
Hii->UpdateForm (Hii, gBootManagerHandle, (EFI_FORM_LABEL) 0x0002, TRUE, UpdateData); gHii->UpdateForm (gHii, gBootManagerHandle, (EFI_FORM_LABEL) 0x0002, TRUE, UpdateData);
Status = CreateSubTitleOpCode ( Status = CreateSubTitleOpCode (
LastToken, // Token Value for the string LastToken, // Token Value for the string
&UpdateData->Data // Buffer containing created op-code &UpdateData->Data // Buffer containing created op-code
); );
Hii->UpdateForm (Hii, gBootManagerHandle, (EFI_FORM_LABEL) 0x0002, TRUE, UpdateData); gHii->UpdateForm (gHii, gBootManagerHandle, (EFI_FORM_LABEL) 0x0002, TRUE, UpdateData);
FreePool (UpdateData); FreePool (UpdateData);
@ -321,7 +321,7 @@ Returns:
EnableResetRequired (); EnableResetRequired ();
} }
Hii->ResetStrings (Hii, gBootManagerHandle); gHii->ResetStrings (gHii, gBootManagerHandle);
if (gOption == NULL) { if (gOption == NULL) {
return ; return ;

View File

@ -28,7 +28,6 @@ STATIC UINT16 mTokenCount;
EFI_FRONTPAGE_CALLBACK_INFO FPCallbackInfo; EFI_FRONTPAGE_CALLBACK_INFO FPCallbackInfo;
extern UINTN gCallbackKey; extern UINTN gCallbackKey;
extern EFI_FORM_BROWSER_PROTOCOL *gBrowser; extern EFI_FORM_BROWSER_PROTOCOL *gBrowser;
extern EFI_GUID gBdsStringPackGuid;
extern BOOLEAN gConnectAllHappened; extern BOOLEAN gConnectAllHappened;
STRING_REF gStringTokenTable[] = { STRING_REF gStringTokenTable[] = {
@ -122,8 +121,8 @@ Returns:
UpdateData = AllocateZeroPool (0x1000); UpdateData = AllocateZeroPool (0x1000);
ASSERT (UpdateData != NULL); ASSERT (UpdateData != NULL);
PackageList = PreparePackages (1, &gBdsStringPackGuid, DeviceManagerVfrBin); PackageList = PreparePackages (1, &gEfiCallerIdGuid, DeviceManagerVfrBin);
Status = Hii->NewPack (Hii, PackageList, &FPCallbackInfo.DevMgrHiiHandle); Status = gHii->NewPack (gHii, PackageList, &FPCallbackInfo.DevMgrHiiHandle);
FreePool (PackageList); FreePool (PackageList);
// //
@ -159,7 +158,7 @@ Returns:
// //
// Simply registering the callback handle // Simply registering the callback handle
// //
Hii->UpdateForm (Hii, FPCallbackInfo.DevMgrHiiHandle, (EFI_FORM_LABEL) 0x0000, TRUE, UpdateData); gHii->UpdateForm (gHii, FPCallbackInfo.DevMgrHiiHandle, (EFI_FORM_LABEL) 0x0000, TRUE, UpdateData);
FreePool (UpdateData); FreePool (UpdateData);
return Status; return Status;
@ -226,7 +225,7 @@ Returns:
FormSetData = NULL; FormSetData = NULL;
gCallbackKey = 0; gCallbackKey = 0;
if (mTokenCount == 0) { if (mTokenCount == 0) {
Hii->NewString (Hii, NULL, FPCallbackInfo.DevMgrHiiHandle, &mTokenCount, L" "); gHii->NewString (gHii, NULL, FPCallbackInfo.DevMgrHiiHandle, &mTokenCount, L" ");
} }
Token = mTokenCount; Token = mTokenCount;
@ -244,7 +243,7 @@ Returns:
// //
// Erase entries on this label // Erase entries on this label
// //
Hii->UpdateForm (Hii, FPCallbackInfo.DevMgrHiiHandle, (EFI_FORM_LABEL) Count, FALSE, UpdateData); gHii->UpdateForm (gHii, FPCallbackInfo.DevMgrHiiHandle, (EFI_FORM_LABEL) Count, FALSE, UpdateData);
// //
// Did we reach the end of the Token Table? // Did we reach the end of the Token Table?
@ -262,21 +261,21 @@ Returns:
// //
// Add default title for this label // Add default title for this label
// //
Hii->UpdateForm (Hii, FPCallbackInfo.DevMgrHiiHandle, (EFI_FORM_LABEL) Count, TRUE, UpdateData); gHii->UpdateForm (gHii, FPCallbackInfo.DevMgrHiiHandle, (EFI_FORM_LABEL) Count, TRUE, UpdateData);
} }
// //
// Add a space and an exit string. Remember since we add things at the label and push other things beyond the // Add a space and an exit string. Remember since we add things at the label and push other things beyond the
// label down, we add this in reverse order // label down, we add this in reverse order
// //
CreateSubTitleOpCode (STRING_TOKEN (STR_EXIT_STRING), &UpdateData->Data); CreateSubTitleOpCode (STRING_TOKEN (STR_EXIT_STRING), &UpdateData->Data);
Hii->UpdateForm (Hii, FPCallbackInfo.DevMgrHiiHandle, (EFI_FORM_LABEL) Count, TRUE, UpdateData); gHii->UpdateForm (gHii, FPCallbackInfo.DevMgrHiiHandle, (EFI_FORM_LABEL) Count, TRUE, UpdateData);
CreateSubTitleOpCode (STR_EMPTY_STRING, &UpdateData->Data); CreateSubTitleOpCode (STR_EMPTY_STRING, &UpdateData->Data);
Hii->UpdateForm (Hii, FPCallbackInfo.DevMgrHiiHandle, (EFI_FORM_LABEL) Count, TRUE, UpdateData); gHii->UpdateForm (gHii, FPCallbackInfo.DevMgrHiiHandle, (EFI_FORM_LABEL) Count, TRUE, UpdateData);
// //
// Get all the Hii handles // Get all the gHii handles
// //
Status = BdsLibGetHiiHandles (Hii, &HandleBufferLength, &HiiHandles); Status = BdsLibGetHiiHandles (gHii, &HandleBufferLength, &HiiHandles);
ASSERT_EFI_ERROR (Status); ASSERT_EFI_ERROR (Status);
for (Index = 1, BufferSize = 0; Index < HandleBufferLength; Index++) { for (Index = 1, BufferSize = 0; Index < HandleBufferLength; Index++) {
@ -284,7 +283,7 @@ Returns:
// Am not initializing Buffer since the first thing checked is the size // Am not initializing Buffer since the first thing checked is the size
// this way I can get the real buffersize in the smallest code size // this way I can get the real buffersize in the smallest code size
// //
Status = Hii->GetForms (Hii, Index, 0, &BufferSize, Buffer); Status = gHii->GetForms (gHii, Index, 0, &BufferSize, Buffer);
if (Status != EFI_NOT_FOUND) { if (Status != EFI_NOT_FOUND) {
// //
@ -297,7 +296,7 @@ Returns:
// Am not initializing Buffer since the first thing checked is the size // Am not initializing Buffer since the first thing checked is the size
// this way I can get the real buffersize in the smallest code size // this way I can get the real buffersize in the smallest code size
// //
Status = Hii->GetForms (Hii, Index, 0, &BufferSize, Buffer); Status = gHii->GetForms (gHii, Index, 0, &BufferSize, Buffer);
// //
// Skip EFI_HII_PACK_HEADER, advance to EFI_IFR_FORM_SET data. // Skip EFI_HII_PACK_HEADER, advance to EFI_IFR_FORM_SET data.
@ -313,8 +312,8 @@ Returns:
String = AllocateZeroPool (StringLength); String = AllocateZeroPool (StringLength);
ASSERT (String != NULL); ASSERT (String != NULL);
Status = Hii->GetString (Hii, Index, FormSetData->FormSetTitle, TRUE, NULL, &StringLength, String); Status = gHii->GetString (gHii, Index, FormSetData->FormSetTitle, TRUE, NULL, &StringLength, String);
Status = Hii->NewString (Hii, NULL, FPCallbackInfo.DevMgrHiiHandle, &Token, String); Status = gHii->NewString (gHii, NULL, FPCallbackInfo.DevMgrHiiHandle, &Token, String);
// //
// If token value exceeded real token value - we need to add a new token values // If token value exceeded real token value - we need to add a new token values
@ -322,21 +321,21 @@ Returns:
if (Status == EFI_INVALID_PARAMETER) { if (Status == EFI_INVALID_PARAMETER) {
Token = 0; Token = 0;
TokenHelp = 0; TokenHelp = 0;
Status = Hii->NewString (Hii, NULL, FPCallbackInfo.DevMgrHiiHandle, &Token, String); Status = gHii->NewString (gHii, NULL, FPCallbackInfo.DevMgrHiiHandle, &Token, String);
} }
StringLength = 0x1000; StringLength = 0x1000;
if (FormSetData->Help == 0) { if (FormSetData->Help == 0) {
TokenHelp = 0; TokenHelp = 0;
} else { } else {
Status = Hii->GetString (Hii, Index, FormSetData->Help, TRUE, NULL, &StringLength, String); Status = gHii->GetString (gHii, Index, FormSetData->Help, TRUE, NULL, &StringLength, String);
if (StringLength == 0x02) { if (StringLength == 0x02) {
TokenHelp = 0; TokenHelp = 0;
} else { } else {
Status = Hii->NewString (Hii, NULL, FPCallbackInfo.DevMgrHiiHandle, &TokenHelp, String); Status = gHii->NewString (gHii, NULL, FPCallbackInfo.DevMgrHiiHandle, &TokenHelp, String);
if (Status == EFI_INVALID_PARAMETER) { if (Status == EFI_INVALID_PARAMETER) {
TokenHelp = 0; TokenHelp = 0;
Status = Hii->NewString (Hii, NULL, FPCallbackInfo.DevMgrHiiHandle, &TokenHelp, String); Status = gHii->NewString (gHii, NULL, FPCallbackInfo.DevMgrHiiHandle, &TokenHelp, String);
} }
} }
} }
@ -380,8 +379,8 @@ Returns:
// This is an active bit, so update the form // This is an active bit, so update the form
// //
if (FormSetData->Class & Count) { if (FormSetData->Class & Count) {
Hii->UpdateForm ( gHii->UpdateForm (
Hii, gHii,
FPCallbackInfo.DevMgrHiiHandle, FPCallbackInfo.DevMgrHiiHandle,
(EFI_FORM_LABEL) (FormSetData->Class & Count), (EFI_FORM_LABEL) (FormSetData->Class & Count),
TRUE, TRUE,
@ -440,7 +439,7 @@ Returns:
); );
UpdateData->DataCount = 4; UpdateData->DataCount = 4;
Hii->UpdateForm (Hii, FPCallbackInfo.DevMgrHiiHandle, (EFI_FORM_LABEL) EFI_VBIOS_CLASS, TRUE, UpdateData); gHii->UpdateForm (gHii, FPCallbackInfo.DevMgrHiiHandle, (EFI_FORM_LABEL) EFI_VBIOS_CLASS, TRUE, UpdateData);
FreePool (IfrOptionList); FreePool (IfrOptionList);
} }
@ -461,7 +460,7 @@ Returns:
EnableResetRequired (); EnableResetRequired ();
} }
Hii->ResetStrings (Hii, FPCallbackInfo.DevMgrHiiHandle); gHii->ResetStrings (gHii, FPCallbackInfo.DevMgrHiiHandle);
// //
// We will have returned from processing a callback - user either hit ESC to exit, or selected // We will have returned from processing a callback - user either hit ESC to exit, or selected

View File

@ -42,7 +42,6 @@ UINTN gCallbackKey;
BOOLEAN gConnectAllHappened = FALSE; BOOLEAN gConnectAllHappened = FALSE;
extern EFI_HII_HANDLE gFrontPageHandle; extern EFI_HII_HANDLE gFrontPageHandle;
extern EFI_GUID gBdsStringPackGuid;
EFI_STATUS EFI_STATUS
EFIAPI EFIAPI
@ -106,7 +105,7 @@ Returns:
// //
// 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
// //
Hii->GetPrimaryLanguages (Hii, gFrontPageHandle, &LanguageString); gHii->GetPrimaryLanguages (gHii, gFrontPageHandle, &LanguageString);
// //
// Based on the DataArray->Data->Data value, we can determine // Based on the DataArray->Data->Data value, we can determine
@ -255,9 +254,9 @@ Returns:
gCallbackKey = 0; gCallbackKey = 0;
PackageList = PreparePackages (1, &gBdsStringPackGuid, FrontPageVfrBin); PackageList = PreparePackages (1, &gEfiCallerIdGuid, FrontPageVfrBin);
Status = Hii->NewPack (Hii, PackageList, &gFrontPageHandle); Status = gHii->NewPack (gHii, PackageList, &gFrontPageHandle);
FreePool (PackageList); FreePool (PackageList);
@ -335,7 +334,7 @@ ReInitStrings:
// //
// 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
// //
Hii->GetPrimaryLanguages (Hii, gFrontPageHandle, &LanguageString); gHii->GetPrimaryLanguages (gHii, gFrontPageHandle, &LanguageString);
OptionCount = 0; OptionCount = 0;
@ -359,8 +358,8 @@ ReInitStrings:
mLastSelection = (UINT16) OptionCount; mLastSelection = (UINT16) OptionCount;
} }
Status = Hii->GetString (Hii, gStringPackHandle, 1, TRUE, Lang, &BufferSize, StringBuffer); Status = gHii->GetString (gHii, gStringPackHandle, 1, TRUE, Lang, &BufferSize, StringBuffer);
Hii->NewString (Hii, NULL, gStringPackHandle, &Token, StringBuffer); gHii->NewString (gHii, NULL, gStringPackHandle, &Token, StringBuffer);
CopyMem (&OptionList[OptionCount].StringToken, &Token, sizeof (UINT16)); CopyMem (&OptionList[OptionCount].StringToken, &Token, sizeof (UINT16));
CopyMem (&OptionList[OptionCount].Value, &OptionCount, sizeof (UINT16)); CopyMem (&OptionList[OptionCount].Value, &OptionCount, sizeof (UINT16));
Key = 0x1234; Key = 0x1234;
@ -392,7 +391,7 @@ ReInitStrings:
// //
UpdateData->DataCount = (UINT8) (OptionCount + 2); UpdateData->DataCount = (UINT8) (OptionCount + 2);
Hii->UpdateForm (Hii, gFrontPageHandle, (EFI_FORM_LABEL) 0x0002, TRUE, UpdateData); gHii->UpdateForm (gHii, gFrontPageHandle, (EFI_FORM_LABEL) 0x0002, TRUE, UpdateData);
FreePool (UpdateData); FreePool (UpdateData);
// //
@ -452,7 +451,7 @@ Returns:
EnableResetRequired (); EnableResetRequired ();
} }
Hii->ResetStrings (Hii, gFrontPageHandle); gHii->ResetStrings (gHii, gFrontPageHandle);
return Status; return Status;
} }
@ -499,11 +498,11 @@ Returns:
// //
// Get all the Hii handles // Get all the Hii handles
// //
Status = BdsLibGetHiiHandles (Hii, &HandleBufferLength, &HiiHandleBuffer); Status = BdsLibGetHiiHandles (gHii, &HandleBufferLength, &HiiHandleBuffer);
ASSERT_EFI_ERROR (Status); ASSERT_EFI_ERROR (Status);
// //
// Get the Hii Handle that matches the StructureNode->ProducerName // Get the gHii Handle that matches the StructureNode->ProducerName
// //
NumberOfHiiHandles = HandleBufferLength / sizeof (EFI_HII_HANDLE); NumberOfHiiHandles = HandleBufferLength / sizeof (EFI_HII_HANDLE);
for (Index = 0; Index < NumberOfHiiHandles; Index++) { for (Index = 0; Index < NumberOfHiiHandles; Index++) {
@ -523,8 +522,8 @@ Returns:
// //
StringBufferLength = 0x100; StringBufferLength = 0x100;
*String = AllocateZeroPool (0x100); *String = AllocateZeroPool (0x100);
Status = Hii->GetString ( Status = gHii->GetString (
Hii, gHii,
HiiHandleBuffer[Index], HiiHandleBuffer[Index],
Token, Token,
FALSE, FALSE,
@ -693,7 +692,7 @@ Returns:
BiosVendor = (EFI_MISC_BIOS_VENDOR_DATA *) (DataHeader + 1); BiosVendor = (EFI_MISC_BIOS_VENDOR_DATA *) (DataHeader + 1);
GetStringFromToken (&Record->ProducerName, BiosVendor->BiosVersion, &NewString); GetStringFromToken (&Record->ProducerName, BiosVendor->BiosVersion, &NewString);
TokenToUpdate = (STRING_REF) STR_FRONT_PAGE_BIOS_VERSION; TokenToUpdate = (STRING_REF) STR_FRONT_PAGE_BIOS_VERSION;
Hii->NewString (Hii, Lang, gFrontPageHandle, &TokenToUpdate, NewString); gHii->NewString (gHii, Lang, gFrontPageHandle, &TokenToUpdate, NewString);
FreePool (NewString); FreePool (NewString);
Find[0] = TRUE; Find[0] = TRUE;
} }
@ -704,7 +703,7 @@ Returns:
SystemManufacturer = (EFI_MISC_SYSTEM_MANUFACTURER_DATA *) (DataHeader + 1); SystemManufacturer = (EFI_MISC_SYSTEM_MANUFACTURER_DATA *) (DataHeader + 1);
GetStringFromToken (&Record->ProducerName, SystemManufacturer->SystemProductName, &NewString); GetStringFromToken (&Record->ProducerName, SystemManufacturer->SystemProductName, &NewString);
TokenToUpdate = (STRING_REF) STR_FRONT_PAGE_COMPUTER_MODEL; TokenToUpdate = (STRING_REF) STR_FRONT_PAGE_COMPUTER_MODEL;
Hii->NewString (Hii, Lang, gFrontPageHandle, &TokenToUpdate, NewString); gHii->NewString (gHii, Lang, gFrontPageHandle, &TokenToUpdate, NewString);
FreePool (NewString); FreePool (NewString);
Find[1] = TRUE; Find[1] = TRUE;
} }
@ -715,7 +714,7 @@ Returns:
ProcessorVersion = (EFI_PROCESSOR_VERSION_DATA *) (DataHeader + 1); ProcessorVersion = (EFI_PROCESSOR_VERSION_DATA *) (DataHeader + 1);
GetStringFromToken (&Record->ProducerName, *ProcessorVersion, &NewString); GetStringFromToken (&Record->ProducerName, *ProcessorVersion, &NewString);
TokenToUpdate = (STRING_REF) STR_FRONT_PAGE_CPU_MODEL; TokenToUpdate = (STRING_REF) STR_FRONT_PAGE_CPU_MODEL;
Hii->NewString (Hii, Lang, gFrontPageHandle, &TokenToUpdate, NewString); gHii->NewString (gHii, Lang, gFrontPageHandle, &TokenToUpdate, NewString);
FreePool (NewString); FreePool (NewString);
Find[2] = TRUE; Find[2] = TRUE;
} }
@ -726,7 +725,7 @@ Returns:
ProcessorFrequency = (EFI_PROCESSOR_CORE_FREQUENCY_DATA *) (DataHeader + 1); ProcessorFrequency = (EFI_PROCESSOR_CORE_FREQUENCY_DATA *) (DataHeader + 1);
ConvertProcessorToString (ProcessorFrequency, &NewString); ConvertProcessorToString (ProcessorFrequency, &NewString);
TokenToUpdate = (STRING_REF) STR_FRONT_PAGE_CPU_SPEED; TokenToUpdate = (STRING_REF) STR_FRONT_PAGE_CPU_SPEED;
Hii->NewString (Hii, Lang, gFrontPageHandle, &TokenToUpdate, NewString); gHii->NewString (gHii, Lang, gFrontPageHandle, &TokenToUpdate, NewString);
FreePool (NewString); FreePool (NewString);
Find[3] = TRUE; Find[3] = TRUE;
} }
@ -739,7 +738,7 @@ Returns:
MemoryArray->MemoryArrayStartAddress + 1), 20)), MemoryArray->MemoryArrayStartAddress + 1), 20)),
&NewString); &NewString);
TokenToUpdate = (STRING_REF) STR_FRONT_PAGE_MEMORY_SIZE; TokenToUpdate = (STRING_REF) STR_FRONT_PAGE_MEMORY_SIZE;
Hii->NewString (Hii, Lang, gFrontPageHandle, &TokenToUpdate, NewString); gHii->NewString (gHii, Lang, gFrontPageHandle, &TokenToUpdate, NewString);
FreePool (NewString); FreePool (NewString);
Find[4] = TRUE; Find[4] = TRUE;
} }
@ -797,7 +796,7 @@ Returns:
// //
// Remove Banner Op-code if any at this label // Remove Banner Op-code if any at this label
// //
Hii->UpdateForm (Hii, gFrontPageHandle, (EFI_FORM_LABEL) 0xFFFF, FALSE, UpdateData); gHii->UpdateForm (gHii, gFrontPageHandle, (EFI_FORM_LABEL) 0xFFFF, FALSE, UpdateData);
// //
// Create Banner Op-code which reflects correct timeout value // Create Banner Op-code which reflects correct timeout value
@ -812,7 +811,7 @@ Returns:
// //
// Add Banner Op-code at this label // Add Banner Op-code at this label
// //
Hii->UpdateForm (Hii, gFrontPageHandle, (EFI_FORM_LABEL) 0xFFFF, TRUE, UpdateData); gHii->UpdateForm (gHii, gFrontPageHandle, (EFI_FORM_LABEL) 0xFFFF, TRUE, UpdateData);
do { do {

View File

@ -29,310 +29,11 @@ Revision History
#include "BdsString.h" #include "BdsString.h"
#include "Language.h" #include "Language.h"
#define NARROW_GLYPH_NUMBER 8
#define WIDE_GLYPH_NUMBER 75
// //
// Default language code, currently is English // Default language code, currently is English
// //
CHAR8 *mDefaultLangCode = "eng"; CHAR8 *mDefaultLangCode = "eng";
typedef struct {
EFI_HII_FONT_PACK FixedLength;
EFI_NARROW_GLYPH NarrowArray[NARROW_GLYPH_NUMBER];
EFI_WIDE_GLYPH WideArray[WIDE_GLYPH_NUMBER];
} FONT_PACK;
FONT_PACK mFontPack = {
sizeof (EFI_HII_FONT_PACK) + (NARROW_GLYPH_NUMBER * sizeof (EFI_NARROW_GLYPH)) + (WIDE_GLYPH_NUMBER * sizeof (EFI_WIDE_GLYPH)),
EFI_HII_FONT,
NARROW_GLYPH_NUMBER,
WIDE_GLYPH_NUMBER,
{ // Narrow Glyphs
{
0x05d0,
0x00,
{
0x00,
0x00,
0x00,
0x4E,
0x6E,
0x62,
0x32,
0x32,
0x3C,
0x68,
0x4C,
0x4C,
0x46,
0x76,
0x72,
0x00,
0x00,
0x00,
0x00
}
},
{
0x05d1,
0x00,
{
0x00,
0x00,
0x00,
0x78,
0x7C,
0x0C,
0x0C,
0x0C,
0x0C,
0x0C,
0x0C,
0x0C,
0x0C,
0x7E,
0x7E,
0x00,
0x00,
0x00,
0x00
}
},
{
0x05d2,
0x00,
{
0x00,
0x00,
0x00,
0x78,
0x7C,
0x0C,
0x0C,
0x0C,
0x0C,
0x0C,
0x0C,
0x1C,
0x3E,
0x66,
0x66,
0x00,
0x00,
0x00,
0x00
}
},
{
0x05d3,
0x00,
{
0x00,
0x00,
0x00,
0x7E,
0x7E,
0x0C,
0x0C,
0x0C,
0x0C,
0x0C,
0x0C,
0x0C,
0x0C,
0x0C,
0x0C,
0x00,
0x00,
0x00,
0x00
}
},
{
0x05d4,
0x00,
{
0x00,
0x00,
0x00,
0x7C,
0x7E,
0x06,
0x06,
0x06,
0x06,
0x66,
0x66,
0x66,
0x66,
0x66,
0x66,
0x00,
0x00,
0x00,
0x00
}
},
{
0x05d5,
0x00,
{
0x00,
0x00,
0x00,
0x3C,
0x3C,
0x0C,
0x0C,
0x0C,
0x0C,
0x0C,
0x0C,
0x0C,
0x0C,
0x0C,
0x0C,
0x00,
0x00,
0x00,
0x00
}
},
{
0x05d6,
0x00,
{
0x00,
0x00,
0x00,
0x38,
0x38,
0x1E,
0x1E,
0x18,
0x18,
0x18,
0x18,
0x18,
0x18,
0x18,
0x18,
0x00,
0x00,
0x00,
0x00
}
},
{
0x0000,
0x00,
{
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00
}
}
},
{ // Wide Glyphs
{
0x0020,
0x00,
{
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00
},
{
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00
},
{
0x00,
0x00,
0x00
}
}, //
}
};
VOID
ExportFonts (
VOID
)
/*++
Routine Description:
Routine to export glyphs to the HII database. This is in addition to whatever is defined in the Graphics Console driver.
Arguments:
None
Returns:
--*/
{
EFI_HII_HANDLE HiiHandle;
EFI_HII_PACKAGES *PackageList;
PackageList = PreparePackages (1, NULL, &mFontPack);
//
// Register our Fonts into the global database
//
HiiHandle = 0;
Hii->NewPack (Hii, PackageList, &HiiHandle);
FreePool (PackageList);
}
VOID VOID
InitializeLanguage ( InitializeLanguage (
@ -361,12 +62,10 @@ Returns:
LanguageString = NULL; LanguageString = NULL;
LangCodes = NULL; LangCodes = NULL;
ExportFonts ();
// //
// 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
// //
Hii->GetPrimaryLanguages (Hii, gStringPackHandle, &LanguageString); gHii->GetPrimaryLanguages (gHii, gStringPackHandle, &LanguageString);
LangCodes = AllocatePool (StrLen (LanguageString)); LangCodes = AllocatePool (StrLen (LanguageString));
ASSERT (LangCodes); ASSERT (LangCodes);

View File

@ -30,9 +30,6 @@ Revision History
#include "BdsString.h" #include "BdsString.h"
#include "Language.h" #include "Language.h"
EFI_GUID gBdsStringPackGuid = { 0x7bac95d3, 0xddf, 0x42f3, 0x9e, 0x24, 0x7c, 0x64, 0x49, 0x40, 0x37, 0x9a };
extern UINT8 PlatformBdsStrings[];
EFI_STATUS EFI_STATUS
InitializeStringSupport ( InitializeStringSupport (
VOID VOID
@ -40,7 +37,7 @@ InitializeStringSupport (
/*++ /*++
Routine Description: Routine Description:
reset
Initialize HII global accessor for string support Initialize HII global accessor for string support
Arguments: Arguments:
@ -59,11 +56,11 @@ Returns:
Status = gBS->LocateProtocol ( Status = gBS->LocateProtocol (
&gEfiHiiProtocolGuid, &gEfiHiiProtocolGuid,
NULL, NULL,
&Hii &gHii
); );
if (!EFI_ERROR (Status)) { if (!EFI_ERROR (Status)) {
PackageList = PreparePackages (1, &gBdsStringPackGuid, PlatformBdsStrings); PackageList = PreparePackages (1, &gEfiCallerIdGuid, PlatformBdsStrings);
Status = Hii->NewPack (Hii, PackageList, &gStringPackHandle); Status = gHii->NewPack (gHii, PackageList, &gStringPackHandle);
FreePool (PackageList); FreePool (PackageList);
} }
@ -110,7 +107,7 @@ Returns:
// //
// Get the current string for the current Language // Get the current string for the current Language
// //
Status = Hii->GetString (Hii, gStringPackHandle, Id, FALSE, NULL, &StringLength, String); Status = gHii->GetString (gHii, gStringPackHandle, Id, FALSE, NULL, &StringLength, String);
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
if (Status == EFI_BUFFER_TOO_SMALL) { if (Status == EFI_BUFFER_TOO_SMALL) {
// //
@ -124,7 +121,7 @@ Returns:
String = AllocatePool (StringLength); String = AllocatePool (StringLength);
ASSERT (String != NULL); ASSERT (String != NULL);
Status = Hii->GetString (Hii, gStringPackHandle, Id, FALSE, NULL, &StringLength, String); Status = gHii->GetString (gHii, gStringPackHandle, Id, FALSE, NULL, &StringLength, String);
if (!EFI_ERROR (Status)) { if (!EFI_ERROR (Status)) {
return String; return String;
} }

View File

@ -174,3 +174,4 @@
[depex] [depex]
gEfiHiiProtocolGuid gEfiHiiProtocolGuid