From 9aa08808da674b5a1ea613218605ba1a3a38afd3 Mon Sep 17 00:00:00 2001 From: klu2 Date: Wed, 30 Apr 2008 01:48:23 +0000 Subject: [PATCH] Fix the bugs for DatahubGen module git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@5151 6f19259b-4bc3-4df7-8a09-765794883524 --- DuetPkg/DataHubGenDxe/DataHubGen.c | 35 ++++++++-------------------- DuetPkg/DataHubGenDxe/DataHubGen.h | 1 + DuetPkg/DataHubGenDxe/DataHubGen.inf | 5 +++- 3 files changed, 15 insertions(+), 26 deletions(-) diff --git a/DuetPkg/DataHubGenDxe/DataHubGen.c b/DuetPkg/DataHubGenDxe/DataHubGen.c index 4ff92c4d1f..dcb42bb96b 100644 --- a/DuetPkg/DataHubGenDxe/DataHubGen.c +++ b/DuetPkg/DataHubGenDxe/DataHubGen.c @@ -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,26 +30,18 @@ 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)) { - return (VOID *)(UINTN)*Table; + 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; } diff --git a/DuetPkg/DataHubGenDxe/DataHubGen.h b/DuetPkg/DataHubGenDxe/DataHubGen.h index d45f212a7a..4d1eb61b35 100644 --- a/DuetPkg/DataHubGenDxe/DataHubGen.h +++ b/DuetPkg/DataHubGenDxe/DataHubGen.h @@ -30,6 +30,7 @@ Abstract: #include #include +#include #include #include diff --git a/DuetPkg/DataHubGenDxe/DataHubGen.inf b/DuetPkg/DataHubGenDxe/DataHubGen.inf index 58ff185b39..6a4056605b 100644 --- a/DuetPkg/DataHubGenDxe/DataHubGen.inf +++ b/DuetPkg/DataHubGenDxe/DataHubGen.inf @@ -59,5 +59,8 @@ gEfiMemoryProducerGuid gEfiHiiProtocolGuid +[Protocols] + gEfiHiiDatabaseProtocolGuid + [Depex] - gEfiDataHubProtocolGuid AND gEfiHiiProtocolGuid \ No newline at end of file + gEfiDataHubProtocolGuid AND gEfiHiiDatabaseProtocolGuid \ No newline at end of file