mirror of https://github.com/acidanthera/audk.git
follow up the comments from code review.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@5892 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
1349236994
commit
55f298c3a3
|
@ -16,7 +16,7 @@
|
||||||
#define __HII_LIB_H__
|
#define __HII_LIB_H__
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Limited buffer size recommended by RFC4646 (4.3. Length Considerations)
|
/// Limited buffer size recommended by RFC3066
|
||||||
/// (42 characters plus a NULL terminator)
|
/// (42 characters plus a NULL terminator)
|
||||||
///
|
///
|
||||||
#define RFC_3066_ENTRY_SIZE (42 + 1)
|
#define RFC_3066_ENTRY_SIZE (42 + 1)
|
||||||
|
@ -30,8 +30,8 @@
|
||||||
If not enough resource to complete the operation, then ASSERT.
|
If not enough resource to complete the operation, then ASSERT.
|
||||||
|
|
||||||
@param NumberOfPackages Number of packages.
|
@param NumberOfPackages Number of packages.
|
||||||
@param GuidId Package GUID.
|
@param GuidId Package GUID.
|
||||||
@param ... Variable argument list for packages to be assembled.
|
@param ... Variable argument list for packages to be assembled.
|
||||||
|
|
||||||
@return Pointer of EFI_HII_PACKAGE_LIST_HEADER.
|
@return Pointer of EFI_HII_PACKAGE_LIST_HEADER.
|
||||||
|
|
||||||
|
|
|
@ -373,15 +373,34 @@ BuildMemoryAllocationHob (
|
||||||
IN EFI_MEMORY_TYPE MemoryType
|
IN EFI_MEMORY_TYPE MemoryType
|
||||||
);
|
);
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Get a HOB's type from HOB header
|
||||||
|
///
|
||||||
#define GET_HOB_TYPE(Hob) ((Hob).Header->HobType)
|
#define GET_HOB_TYPE(Hob) ((Hob).Header->HobType)
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Get a HOB's length from HOB header
|
||||||
|
///
|
||||||
#define GET_HOB_LENGTH(Hob) ((Hob).Header->HobLength)
|
#define GET_HOB_LENGTH(Hob) ((Hob).Header->HobLength)
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Get the pointer to next HOB in HOB List
|
||||||
|
///
|
||||||
#define GET_NEXT_HOB(Hob) ((Hob).Raw + GET_HOB_LENGTH (Hob))
|
#define GET_NEXT_HOB(Hob) ((Hob).Raw + GET_HOB_LENGTH (Hob))
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Judge if the HOB is the end of HOB List
|
||||||
|
///
|
||||||
#define END_OF_HOB_LIST(Hob) (GET_HOB_TYPE (Hob) == (UINT16)EFI_HOB_TYPE_END_OF_HOB_LIST)
|
#define END_OF_HOB_LIST(Hob) (GET_HOB_TYPE (Hob) == (UINT16)EFI_HOB_TYPE_END_OF_HOB_LIST)
|
||||||
|
|
||||||
//
|
///
|
||||||
// Get the data and data size field of GUID
|
/// Get the pointer to data field of GUID HOB
|
||||||
//
|
///
|
||||||
#define GET_GUID_HOB_DATA(GuidHob) ((VOID *) (((UINT8 *) &((GuidHob)->Name)) + sizeof (EFI_GUID)))
|
#define GET_GUID_HOB_DATA(GuidHob) ((VOID *) (((UINT8 *) &((GuidHob)->Name)) + sizeof (EFI_GUID)))
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Get the data size of GUID HOB
|
||||||
|
///
|
||||||
#define GET_GUID_HOB_DATA_SIZE(GuidHob) (((GuidHob)->Header).HobLength - sizeof (EFI_HOB_GUID_TYPE))
|
#define GET_GUID_HOB_DATA_SIZE(GuidHob) (((GuidHob)->Header).HobLength - sizeof (EFI_HOB_GUID_TYPE))
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -39,10 +39,10 @@
|
||||||
#define UEFI_LANGUAGE_VARIABLE L"PlatformLang"
|
#define UEFI_LANGUAGE_VARIABLE L"PlatformLang"
|
||||||
#define UEFI_LANGUAGE_CODES_VARIABLE L"PlatformLangCodes"
|
#define UEFI_LANGUAGE_CODES_VARIABLE L"PlatformLangCodes"
|
||||||
|
|
||||||
//
|
///
|
||||||
// Limited buffer size recommended by RFC4646 (4.3. Length Considerations)
|
/// Limited buffer size recommended by RFC3066
|
||||||
// (42 characters plus a NULL terminator)
|
/// (42 characters plus a NULL terminator)
|
||||||
//
|
///
|
||||||
#define RFC_3066_ENTRY_SIZE (42 + 1)
|
#define RFC_3066_ENTRY_SIZE (42 + 1)
|
||||||
#define ISO_639_2_ENTRY_SIZE 3
|
#define ISO_639_2_ENTRY_SIZE 3
|
||||||
|
|
||||||
|
@ -51,9 +51,6 @@
|
||||||
#define QUESTION_FLAGS (EFI_IFR_FLAG_READ_ONLY | EFI_IFR_FLAG_CALLBACK | EFI_IFR_FLAG_RESET_REQUIRED | EFI_IFR_FLAG_OPTIONS_ONLY)
|
#define QUESTION_FLAGS (EFI_IFR_FLAG_READ_ONLY | EFI_IFR_FLAG_CALLBACK | EFI_IFR_FLAG_RESET_REQUIRED | EFI_IFR_FLAG_OPTIONS_ONLY)
|
||||||
#define QUESTION_FLAGS_MASK (~QUESTION_FLAGS)
|
#define QUESTION_FLAGS_MASK (~QUESTION_FLAGS)
|
||||||
|
|
||||||
extern EFI_HII_DATABASE_PROTOCOL *gIfrLibHiiDatabase;
|
|
||||||
extern EFI_HII_STRING_PROTOCOL *gIfrLibHiiString;
|
|
||||||
|
|
||||||
#pragma pack(1)
|
#pragma pack(1)
|
||||||
typedef struct {
|
typedef struct {
|
||||||
EFI_STRING_ID StringToken;
|
EFI_STRING_ID StringToken;
|
||||||
|
@ -312,8 +309,8 @@ CreateOrderedListOpCode (
|
||||||
IN UINT8 DataType,
|
IN UINT8 DataType,
|
||||||
IN UINT8 MaxContainers,
|
IN UINT8 MaxContainers,
|
||||||
IN IFR_OPTION *OptionsList,
|
IN IFR_OPTION *OptionsList,
|
||||||
IN UINTN OptionCount,
|
IN UINTN OptionCount,
|
||||||
IN OUT EFI_HII_UPDATE_DATA *Data
|
IN OUT EFI_HII_UPDATE_DATA *Data
|
||||||
)
|
)
|
||||||
;
|
;
|
||||||
|
|
||||||
|
@ -554,7 +551,7 @@ EFIAPI
|
||||||
ConstructConfigHdr (
|
ConstructConfigHdr (
|
||||||
IN OUT CHAR16 *ConfigHdr,
|
IN OUT CHAR16 *ConfigHdr,
|
||||||
IN OUT UINTN *StrBufferLen,
|
IN OUT UINTN *StrBufferLen,
|
||||||
IN EFI_GUID *Guid,
|
IN CONST EFI_GUID *Guid,
|
||||||
IN CHAR16 *Name, OPTIONAL
|
IN CHAR16 *Name, OPTIONAL
|
||||||
IN EFI_HANDLE *DriverHandle
|
IN EFI_HANDLE *DriverHandle
|
||||||
)
|
)
|
||||||
|
@ -576,8 +573,8 @@ BOOLEAN
|
||||||
EFIAPI
|
EFIAPI
|
||||||
FindBlockName (
|
FindBlockName (
|
||||||
IN OUT CHAR16 *String,
|
IN OUT CHAR16 *String,
|
||||||
UINTN Offset,
|
IN UINTN Offset,
|
||||||
UINTN Width
|
IN UINTN Width
|
||||||
)
|
)
|
||||||
;
|
;
|
||||||
|
|
||||||
|
@ -601,10 +598,10 @@ FindBlockName (
|
||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
EFIAPI
|
EFIAPI
|
||||||
GetBrowserData (
|
GetBrowserData (
|
||||||
EFI_GUID *VariableGuid, OPTIONAL
|
IN CONST EFI_GUID *VariableGuid, OPTIONAL
|
||||||
CHAR16 *VariableName, OPTIONAL
|
IN CONST CHAR16 *VariableName, OPTIONAL
|
||||||
UINTN *BufferSize,
|
IN OUT UINTN *BufferSize,
|
||||||
UINT8 *Buffer
|
IN OUT UINT8 *Buffer
|
||||||
)
|
)
|
||||||
;
|
;
|
||||||
|
|
||||||
|
@ -630,11 +627,11 @@ GetBrowserData (
|
||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
EFIAPI
|
EFIAPI
|
||||||
SetBrowserData (
|
SetBrowserData (
|
||||||
EFI_GUID *VariableGuid, OPTIONAL
|
IN CONST EFI_GUID *VariableGuid, OPTIONAL
|
||||||
CHAR16 *VariableName, OPTIONAL
|
IN CONST CHAR16 *VariableName, OPTIONAL
|
||||||
UINTN BufferSize,
|
IN UINTN BufferSize,
|
||||||
UINT8 *Buffer,
|
IN CONST UINT8 *Buffer,
|
||||||
CHAR16 *RequestElement OPTIONAL
|
IN CONST CHAR16 *RequestElement OPTIONAL
|
||||||
)
|
)
|
||||||
;
|
;
|
||||||
|
|
||||||
|
|
|
@ -18,15 +18,15 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||||
STATIC CONST EFI_FORM_BROWSER2_PROTOCOL *mFormBrowser2 = NULL;
|
STATIC CONST EFI_FORM_BROWSER2_PROTOCOL *mFormBrowser2 = NULL;
|
||||||
STATIC CONST EFI_HII_CONFIG_ROUTING_PROTOCOL *mHiiConfigRouting = NULL;
|
STATIC CONST EFI_HII_CONFIG_ROUTING_PROTOCOL *mHiiConfigRouting = NULL;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
This function locate FormBrowser2 protocols for later usage.
|
This function locate FormBrowser2 protocols for later usage.
|
||||||
|
|
||||||
@return Status the status to locate protocol.
|
@return Status the status to locate protocol.
|
||||||
**/
|
**/
|
||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
LocateFormBrowser2Protocols (
|
LocateFormBrowser2Protocols (
|
||||||
VOID
|
VOID
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
EFI_STATUS Status;
|
EFI_STATUS Status;
|
||||||
//
|
//
|
||||||
|
@ -566,7 +566,7 @@ EFIAPI
|
||||||
ConstructConfigHdr (
|
ConstructConfigHdr (
|
||||||
IN OUT CHAR16 *ConfigHdr,
|
IN OUT CHAR16 *ConfigHdr,
|
||||||
IN OUT UINTN *StrBufferLen,
|
IN OUT UINTN *StrBufferLen,
|
||||||
IN EFI_GUID *Guid,
|
IN CONST EFI_GUID *Guid,
|
||||||
IN CHAR16 *Name, OPTIONAL
|
IN CHAR16 *Name, OPTIONAL
|
||||||
IN EFI_HANDLE *DriverHandle
|
IN EFI_HANDLE *DriverHandle
|
||||||
)
|
)
|
||||||
|
@ -657,8 +657,8 @@ BOOLEAN
|
||||||
EFIAPI
|
EFIAPI
|
||||||
FindBlockName (
|
FindBlockName (
|
||||||
IN OUT CHAR16 *String,
|
IN OUT CHAR16 *String,
|
||||||
UINTN Offset,
|
IN UINTN Offset,
|
||||||
UINTN Width
|
IN UINTN Width
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
EFI_STATUS Status;
|
EFI_STATUS Status;
|
||||||
|
@ -727,10 +727,10 @@ FindBlockName (
|
||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
EFIAPI
|
EFIAPI
|
||||||
GetBrowserData (
|
GetBrowserData (
|
||||||
EFI_GUID *VariableGuid, OPTIONAL
|
IN CONST EFI_GUID *VariableGuid, OPTIONAL
|
||||||
CHAR16 *VariableName, OPTIONAL
|
IN CONST CHAR16 *VariableName, OPTIONAL
|
||||||
UINTN *BufferSize,
|
IN OUT UINTN *BufferSize,
|
||||||
UINT8 *Buffer
|
IN OUT UINT8 *Buffer
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
EFI_STATUS Status;
|
EFI_STATUS Status;
|
||||||
|
@ -844,11 +844,11 @@ GetBrowserData (
|
||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
EFIAPI
|
EFIAPI
|
||||||
SetBrowserData (
|
SetBrowserData (
|
||||||
EFI_GUID *VariableGuid, OPTIONAL
|
IN CONST EFI_GUID *VariableGuid, OPTIONAL
|
||||||
CHAR16 *VariableName, OPTIONAL
|
IN CONST CHAR16 *VariableName, OPTIONAL
|
||||||
UINTN BufferSize,
|
IN UINTN BufferSize,
|
||||||
UINT8 *Buffer,
|
IN CONST UINT8 *Buffer,
|
||||||
CHAR16 *RequestElement OPTIONAL
|
IN CONST CHAR16 *RequestElement OPTIONAL
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
EFI_STATUS Status;
|
EFI_STATUS Status;
|
||||||
|
@ -860,7 +860,7 @@ SetBrowserData (
|
||||||
CHAR16 *Progress;
|
CHAR16 *Progress;
|
||||||
CHAR16 BlockName[33];
|
CHAR16 BlockName[33];
|
||||||
CHAR16 *ConfigRequest;
|
CHAR16 *ConfigRequest;
|
||||||
CHAR16 *Request;
|
CONST CHAR16 *Request;
|
||||||
|
|
||||||
//
|
//
|
||||||
// Locate protocols for use
|
// Locate protocols for use
|
||||||
|
|
Loading…
Reference in New Issue