Fix the bugs for DatahubGen module

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@5151 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
klu2 2008-04-30 01:48:23 +00:00
parent eb16e24041
commit 9aa08808da
3 changed files with 15 additions and 26 deletions

View File

@ -18,8 +18,8 @@ Abstract:
**/
#include "DataHubGen.h"
EFI_HII_DATABASE_PROTOCOL *gHiiDatabase;
EFI_HII_PROTOCOL *gHii;
extern UINT8 DataHubGenDxeStrings[];
EFI_DATA_HUB_PROTOCOL *gDataHub;
@ -30,27 +30,19 @@ GetSmbiosTablesFromHob (
VOID
)
{
EFI_STATUS Status;
EFI_HOB_HANDOFF_INFO_TABLE *HobList;
EFI_PHYSICAL_ADDRESS *Table;
EFI_PEI_HOB_POINTERS GuidHob;
//
// Get Hob List
//
Status = EfiGetSystemConfigurationTable (&gEfiHobListGuid, (VOID *) &HobList);
if (EFI_ERROR (Status)) {
return NULL;
}
//
// If there is a SMBIOS table in the HOB add it to the EFI System table
//
Table = GetNextGuidHob (&gEfiSmbiosTableGuid, &HobList);
if (!EFI_ERROR (Status)) {
GuidHob.Raw = GetHobList ();
GuidHob.Raw = GetNextGuidHob (&gEfiSmbiosTableGuid, GuidHob.Raw);
if (GuidHob.Raw != NULL) {
Table = GET_GUID_HOB_DATA (GuidHob.Guid);
if (Table != NULL) {
return (VOID *)(UINTN)*Table;
}
}
return NULL;
}
@ -344,19 +336,12 @@ DataHubGenEntrypoint (
return Status;
}
#if (EFI_SPECIFICATION_VERSION >= 0x0002000A)
Status = gBS->LocateProtocol (
&gEfiHiiDatabaseProtocolGuid,
NULL,
&gHiiDatabase
);
#else
Status = gBS->LocateProtocol (
&gEfiHiiProtocolGuid,
NULL,
(VOID**)&gHii
);
#endif
if (EFI_ERROR (Status)) {
return Status;
}

View File

@ -30,6 +30,7 @@ Abstract:
#include <Protocol/Datahub.h>
#include <Protocol/FrameworkHii.h>
#include <Protocol/HiiDatabase.h>
#include <Library/BaseLib.h>
#include <Library/UefiLib.h>

View File

@ -59,5 +59,8 @@
gEfiMemoryProducerGuid
gEfiHiiProtocolGuid
[Protocols]
gEfiHiiDatabaseProtocolGuid
[Depex]
gEfiDataHubProtocolGuid AND gEfiHiiProtocolGuid
gEfiDataHubProtocolGuid AND gEfiHiiDatabaseProtocolGuid