mirror of
https://github.com/acidanthera/audk.git
synced 2025-07-28 08:04:07 +02:00
Use two PCDs to replace _DISABLE_UNUSED_HII_PROTOCOLS_ macro.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@5498 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
63e4dba96a
commit
e94358a3fe
@ -25,8 +25,6 @@ Revision History
|
|||||||
|
|
||||||
#include "HiiDatabase.h"
|
#include "HiiDatabase.h"
|
||||||
|
|
||||||
#ifndef _DISABLE_UNUSED_HII_PROTOCOLS_
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Calculate the number of Unicode characters of the incoming Configuration string,
|
Calculate the number of Unicode characters of the incoming Configuration string,
|
||||||
not including NULL terminator.
|
not including NULL terminator.
|
||||||
@ -447,8 +445,6 @@ OutputConfigBody (
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Adjusts the size of a previously allocated buffer.
|
Adjusts the size of a previously allocated buffer.
|
||||||
|
|
||||||
@ -660,8 +656,6 @@ HiiConfigRoutingExtractConfig (
|
|||||||
OUT EFI_STRING *Results
|
OUT EFI_STRING *Results
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
#ifndef _DISABLE_UNUSED_HII_PROTOCOLS_
|
|
||||||
|
|
||||||
HII_DATABASE_PRIVATE_DATA *Private;
|
HII_DATABASE_PRIVATE_DATA *Private;
|
||||||
EFI_STRING StringPtr;
|
EFI_STRING StringPtr;
|
||||||
EFI_STRING ConfigRequest;
|
EFI_STRING ConfigRequest;
|
||||||
@ -678,6 +672,15 @@ HiiConfigRoutingExtractConfig (
|
|||||||
UINTN RemainSize;
|
UINTN RemainSize;
|
||||||
EFI_STRING TmpPtr;
|
EFI_STRING TmpPtr;
|
||||||
|
|
||||||
|
//
|
||||||
|
// For size reduction, please define PcdSupportFullConfigRoutingProtocol
|
||||||
|
// as FALSE. But this renders the system to not 100% compliant with
|
||||||
|
// UEFI 2.1. Use this with caution.
|
||||||
|
//
|
||||||
|
if (!FeaturePcdGet (PcdSupportFullConfigRoutingProtocol)) {
|
||||||
|
return EFI_UNSUPPORTED;
|
||||||
|
}
|
||||||
|
|
||||||
if (This == NULL || Progress == NULL || Results == NULL) {
|
if (This == NULL || Progress == NULL || Results == NULL) {
|
||||||
return EFI_INVALID_PARAMETER;
|
return EFI_INVALID_PARAMETER;
|
||||||
}
|
}
|
||||||
@ -826,9 +829,6 @@ HiiConfigRoutingExtractConfig (
|
|||||||
}
|
}
|
||||||
|
|
||||||
return EFI_SUCCESS;
|
return EFI_SUCCESS;
|
||||||
#else
|
|
||||||
return EFI_UNSUPPORTED;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -862,8 +862,6 @@ HiiConfigRoutingExportConfig (
|
|||||||
OUT EFI_STRING *Results
|
OUT EFI_STRING *Results
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
#ifndef _DISABLE_UNUSED_HII_PROTOCOLS_
|
|
||||||
|
|
||||||
EFI_STATUS Status;
|
EFI_STATUS Status;
|
||||||
HII_DATABASE_PRIVATE_DATA *Private;
|
HII_DATABASE_PRIVATE_DATA *Private;
|
||||||
LIST_ENTRY StorageListHdr;
|
LIST_ENTRY StorageListHdr;
|
||||||
@ -881,6 +879,15 @@ HiiConfigRoutingExportConfig (
|
|||||||
EFI_STRING AccessResults;
|
EFI_STRING AccessResults;
|
||||||
UINTN TmpSize;
|
UINTN TmpSize;
|
||||||
|
|
||||||
|
//
|
||||||
|
// For size reduction, please define PcdSupportFullConfigRoutingProtocol
|
||||||
|
// as FALSE. But this renders the system to not 100% compliant with
|
||||||
|
// UEFI 2.1. Use this with caution.
|
||||||
|
//
|
||||||
|
if (!FeaturePcdGet (PcdSupportFullConfigRoutingProtocol)) {
|
||||||
|
return EFI_UNSUPPORTED;
|
||||||
|
}
|
||||||
|
|
||||||
if (This == NULL || Results == NULL) {
|
if (This == NULL || Results == NULL) {
|
||||||
return EFI_INVALID_PARAMETER;
|
return EFI_INVALID_PARAMETER;
|
||||||
}
|
}
|
||||||
@ -1050,9 +1057,6 @@ HiiConfigRoutingExportConfig (
|
|||||||
}
|
}
|
||||||
|
|
||||||
return EFI_SUCCESS;
|
return EFI_SUCCESS;
|
||||||
#else
|
|
||||||
return EFI_UNSUPPORTED;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1089,8 +1093,6 @@ HiiConfigRoutingRouteConfig (
|
|||||||
OUT EFI_STRING *Progress
|
OUT EFI_STRING *Progress
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
#ifndef _DISABLE_UNUSED_HII_PROTOCOLS_
|
|
||||||
|
|
||||||
HII_DATABASE_PRIVATE_DATA *Private;
|
HII_DATABASE_PRIVATE_DATA *Private;
|
||||||
EFI_STRING StringPtr;
|
EFI_STRING StringPtr;
|
||||||
EFI_STRING ConfigResp;
|
EFI_STRING ConfigResp;
|
||||||
@ -1106,6 +1108,15 @@ HiiConfigRoutingRouteConfig (
|
|||||||
UINTN RemainSize;
|
UINTN RemainSize;
|
||||||
EFI_STRING TmpPtr;
|
EFI_STRING TmpPtr;
|
||||||
|
|
||||||
|
//
|
||||||
|
// For size reduction, please define PcdSupportFullConfigRoutingProtocol
|
||||||
|
// as FALSE. But this renders the system to not 100% compliant with
|
||||||
|
// UEFI 2.1. Use this with caution.
|
||||||
|
//
|
||||||
|
if (!FeaturePcdGet (PcdSupportFullConfigRoutingProtocol)) {
|
||||||
|
return EFI_UNSUPPORTED;
|
||||||
|
}
|
||||||
|
|
||||||
if (This == NULL || Progress == NULL) {
|
if (This == NULL || Progress == NULL) {
|
||||||
return EFI_INVALID_PARAMETER;
|
return EFI_INVALID_PARAMETER;
|
||||||
}
|
}
|
||||||
@ -1240,9 +1251,6 @@ HiiConfigRoutingRouteConfig (
|
|||||||
}
|
}
|
||||||
|
|
||||||
return EFI_SUCCESS;
|
return EFI_SUCCESS;
|
||||||
#else
|
|
||||||
return EFI_UNSUPPORTED;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1761,8 +1769,6 @@ HiiGetAltCfg (
|
|||||||
OUT EFI_STRING *AltCfgResp
|
OUT EFI_STRING *AltCfgResp
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
#ifndef _DISABLE_UNUSED_HII_PROTOCOLS_
|
|
||||||
|
|
||||||
EFI_STATUS Status;
|
EFI_STATUS Status;
|
||||||
EFI_STRING StringPtr;
|
EFI_STRING StringPtr;
|
||||||
EFI_STRING HdrStart;
|
EFI_STRING HdrStart;
|
||||||
@ -1778,6 +1784,15 @@ HiiGetAltCfg (
|
|||||||
BOOLEAN NameFlag;
|
BOOLEAN NameFlag;
|
||||||
BOOLEAN PathFlag;
|
BOOLEAN PathFlag;
|
||||||
|
|
||||||
|
//
|
||||||
|
// For size reduction, please define PcdSupportFullConfigRoutingProtocol
|
||||||
|
// as FALSE. But this renders the system to not 100% compliant with
|
||||||
|
// UEFI 2.1. Use this with caution.
|
||||||
|
//
|
||||||
|
if (!FeaturePcdGet (PcdSupportFullConfigRoutingProtocol)) {
|
||||||
|
return EFI_UNSUPPORTED;
|
||||||
|
}
|
||||||
|
|
||||||
HdrStart = NULL;
|
HdrStart = NULL;
|
||||||
HdrEnd = NULL;
|
HdrEnd = NULL;
|
||||||
GuidStr = NULL;
|
GuidStr = NULL;
|
||||||
@ -1945,10 +1960,6 @@ Exit:
|
|||||||
|
|
||||||
return Status;
|
return Status;
|
||||||
|
|
||||||
#else
|
|
||||||
return EFI_UNSUPPORTED;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -39,6 +39,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|||||||
#include <Library/MemoryAllocationLib.h>
|
#include <Library/MemoryAllocationLib.h>
|
||||||
#include <Library/IfrSupportLib.h>
|
#include <Library/IfrSupportLib.h>
|
||||||
#include <Library/HiiLib.h>
|
#include <Library/HiiLib.h>
|
||||||
|
#include <Library/PcdLib.h>
|
||||||
|
|
||||||
#define HII_DATABASE_NOTIFY_GUID \
|
#define HII_DATABASE_NOTIFY_GUID \
|
||||||
{ \
|
{ \
|
||||||
@ -241,9 +242,7 @@ typedef struct _HII_DATABASE_PRIVATE_DATA {
|
|||||||
LIST_ENTRY DatabaseList;
|
LIST_ENTRY DatabaseList;
|
||||||
LIST_ENTRY DatabaseNotifyList;
|
LIST_ENTRY DatabaseNotifyList;
|
||||||
EFI_HII_FONT_PROTOCOL HiiFont;
|
EFI_HII_FONT_PROTOCOL HiiFont;
|
||||||
#ifndef _DISABLE_UNUSED_HII_PROTOCOLS_
|
|
||||||
EFI_HII_IMAGE_PROTOCOL HiiImage;
|
EFI_HII_IMAGE_PROTOCOL HiiImage;
|
||||||
#endif
|
|
||||||
EFI_HII_STRING_PROTOCOL HiiString;
|
EFI_HII_STRING_PROTOCOL HiiString;
|
||||||
EFI_HII_DATABASE_PROTOCOL HiiDatabase;
|
EFI_HII_DATABASE_PROTOCOL HiiDatabase;
|
||||||
EFI_HII_CONFIG_ROUTING_PROTOCOL ConfigRouting;
|
EFI_HII_CONFIG_ROUTING_PROTOCOL ConfigRouting;
|
||||||
|
@ -70,6 +70,9 @@
|
|||||||
gEfiHiiFontProtocolGuid
|
gEfiHiiFontProtocolGuid
|
||||||
gEfiHiiConfigAccessProtocolGuid
|
gEfiHiiConfigAccessProtocolGuid
|
||||||
|
|
||||||
|
[FeaturePcd.common]
|
||||||
|
gEfiMdeModulePkgTokenSpaceGuid.PcdSupportHiiImageProtocol
|
||||||
|
gEfiMdeModulePkgTokenSpaceGuid.PcdSupportFullConfigRoutingProtocol
|
||||||
|
|
||||||
[Depex]
|
[Depex]
|
||||||
TRUE
|
TRUE
|
||||||
|
@ -48,15 +48,13 @@ STATIC HII_DATABASE_PRIVATE_DATA mPrivate = {
|
|||||||
HiiGetGlyph,
|
HiiGetGlyph,
|
||||||
HiiGetFontInfo
|
HiiGetFontInfo
|
||||||
},
|
},
|
||||||
#ifndef _DISABLE_UNUSED_HII_PROTOCOLS_
|
|
||||||
{
|
{
|
||||||
HiiNewImage,
|
NULL,
|
||||||
HiiGetImage,
|
NULL,
|
||||||
HiiSetImage,
|
NULL,
|
||||||
HiiDrawImage,
|
NULL,
|
||||||
HiiDrawImageId
|
NULL
|
||||||
},
|
},
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
HiiNewString,
|
HiiNewString,
|
||||||
HiiGetString,
|
HiiGetString,
|
||||||
@ -104,6 +102,14 @@ STATIC HII_DATABASE_PRIVATE_DATA mPrivate = {
|
|||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
|
|
||||||
|
GLOBAL_REMOVE_IF_UNREFERENCED CONST EFI_HII_IMAGE_PROTOCOL mImageProtocol = {
|
||||||
|
HiiNewImage,
|
||||||
|
HiiGetImage,
|
||||||
|
HiiSetImage,
|
||||||
|
HiiDrawImage,
|
||||||
|
HiiDrawImageId
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
The default event handler for gHiiKeyboardLayoutChanged
|
The default event handler for gHiiKeyboardLayoutChanged
|
||||||
event group.
|
event group.
|
||||||
@ -180,14 +186,10 @@ InitializeHiiDatabase (
|
|||||||
}
|
}
|
||||||
|
|
||||||
Handle = NULL;
|
Handle = NULL;
|
||||||
return gBS->InstallMultipleProtocolInterfaces (
|
Status = gBS->InstallMultipleProtocolInterfaces (
|
||||||
&Handle,
|
&Handle,
|
||||||
&gEfiHiiFontProtocolGuid,
|
&gEfiHiiFontProtocolGuid,
|
||||||
&mPrivate.HiiFont,
|
&mPrivate.HiiFont,
|
||||||
#ifndef _DISABLE_UNUSED_HII_PROTOCOLS_
|
|
||||||
&gEfiHiiImageProtocolGuid,
|
|
||||||
&mPrivate.HiiImage,
|
|
||||||
#endif
|
|
||||||
&gEfiHiiStringProtocolGuid,
|
&gEfiHiiStringProtocolGuid,
|
||||||
&mPrivate.HiiString,
|
&mPrivate.HiiString,
|
||||||
&gEfiHiiDatabaseProtocolGuid,
|
&gEfiHiiDatabaseProtocolGuid,
|
||||||
@ -196,5 +198,23 @@ InitializeHiiDatabase (
|
|||||||
&mPrivate.ConfigRouting,
|
&mPrivate.ConfigRouting,
|
||||||
NULL
|
NULL
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if (EFI_ERROR (Status)) {
|
||||||
|
return Status;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (FeaturePcdGet (PcdSupportHiiImageProtocol)) {
|
||||||
|
CopyMem (&mPrivate.HiiImage, &mImageProtocol, sizeof (mImageProtocol));
|
||||||
|
|
||||||
|
Status = gBS->InstallMultipleProtocolInterfaces (
|
||||||
|
&Handle,
|
||||||
|
&gEfiHiiImageProtocolGuid,
|
||||||
|
&mPrivate.HiiImage,
|
||||||
|
NULL
|
||||||
|
);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -16,7 +16,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|||||||
|
|
||||||
#include "HiiDatabase.h"
|
#include "HiiDatabase.h"
|
||||||
|
|
||||||
#ifndef _DISABLE_UNUSED_HII_PROTOCOLS_
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Get the imageid of last image block: EFI_HII_IIBT_END_BLOCK when input
|
Get the imageid of last image block: EFI_HII_IIBT_END_BLOCK when input
|
||||||
@ -1499,5 +1498,3 @@ HiiDrawImageId (
|
|||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user