diff options
author | eric_tian <eric_tian@6f19259b-4bc3-4df7-8a09-765794883524> | 2008-09-16 05:22:09 +0000 |
---|---|---|
committer | eric_tian <eric_tian@6f19259b-4bc3-4df7-8a09-765794883524> | 2008-09-16 05:22:09 +0000 |
commit | 55f298c3a371fc7c04fda5d120a601cda68c140d (patch) | |
tree | 98cd902b00196239b747f7d3b577828d856a1f4e /MdePkg | |
parent | 1349236994106e461f82b2df1df5ebbf1bd80898 (diff) | |
download | edk2-55f298c3a371fc7c04fda5d120a601cda68c140d.zip edk2-55f298c3a371fc7c04fda5d120a601cda68c140d.tar.gz edk2-55f298c3a371fc7c04fda5d120a601cda68c140d.tar.bz2 |
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
Diffstat (limited to 'MdePkg')
-rw-r--r-- | MdePkg/Include/Library/HiiLib.h | 6 | ||||
-rw-r--r-- | MdePkg/Include/Library/HobLib.h | 25 | ||||
-rw-r--r-- | MdePkg/Include/Library/IfrSupportLib.h | 39 | ||||
-rw-r--r-- | MdePkg/Library/IfrSupportLib/UefiIfrForm.c | 44 |
4 files changed, 65 insertions, 49 deletions
diff --git a/MdePkg/Include/Library/HiiLib.h b/MdePkg/Include/Library/HiiLib.h index ea73100..59e1780 100644 --- a/MdePkg/Include/Library/HiiLib.h +++ b/MdePkg/Include/Library/HiiLib.h @@ -16,7 +16,7 @@ #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)
///
#define RFC_3066_ENTRY_SIZE (42 + 1)
@@ -30,8 +30,8 @@ If not enough resource to complete the operation, then ASSERT.
@param NumberOfPackages Number of packages.
- @param GuidId Package GUID.
- @param ... Variable argument list for packages to be assembled.
+ @param GuidId Package GUID.
+ @param ... Variable argument list for packages to be assembled.
@return Pointer of EFI_HII_PACKAGE_LIST_HEADER.
diff --git a/MdePkg/Include/Library/HobLib.h b/MdePkg/Include/Library/HobLib.h index a02246f..02f364c 100644 --- a/MdePkg/Include/Library/HobLib.h +++ b/MdePkg/Include/Library/HobLib.h @@ -373,15 +373,34 @@ BuildMemoryAllocationHob ( IN EFI_MEMORY_TYPE MemoryType
);
+///
+/// Get a HOB's type from HOB header
+///
#define GET_HOB_TYPE(Hob) ((Hob).Header->HobType)
+
+///
+/// Get a HOB's length from HOB header
+///
#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))
+
+///
+/// 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)
-//
-// 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)))
+
+///
+/// Get the data size of GUID HOB
+///
#define GET_GUID_HOB_DATA_SIZE(GuidHob) (((GuidHob)->Header).HobLength - sizeof (EFI_HOB_GUID_TYPE))
#endif
diff --git a/MdePkg/Include/Library/IfrSupportLib.h b/MdePkg/Include/Library/IfrSupportLib.h index 447ab73..d8cdcf4 100644 --- a/MdePkg/Include/Library/IfrSupportLib.h +++ b/MdePkg/Include/Library/IfrSupportLib.h @@ -39,10 +39,10 @@ #define UEFI_LANGUAGE_VARIABLE L"PlatformLang" #define UEFI_LANGUAGE_CODES_VARIABLE L"PlatformLangCodes" -// -// Limited buffer size recommended by RFC4646 (4.3. Length Considerations) -// (42 characters plus a NULL terminator) -// +/// +/// Limited buffer size recommended by RFC3066 +/// (42 characters plus a NULL terminator) +/// #define RFC_3066_ENTRY_SIZE (42 + 1) #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_MASK (~QUESTION_FLAGS) -extern EFI_HII_DATABASE_PROTOCOL *gIfrLibHiiDatabase; -extern EFI_HII_STRING_PROTOCOL *gIfrLibHiiString; - #pragma pack(1) typedef struct { EFI_STRING_ID StringToken; @@ -312,8 +309,8 @@ CreateOrderedListOpCode ( IN UINT8 DataType, IN UINT8 MaxContainers, IN IFR_OPTION *OptionsList, - IN UINTN OptionCount, - IN OUT EFI_HII_UPDATE_DATA *Data + IN UINTN OptionCount, + IN OUT EFI_HII_UPDATE_DATA *Data ) ; @@ -554,7 +551,7 @@ EFIAPI ConstructConfigHdr ( IN OUT CHAR16 *ConfigHdr, IN OUT UINTN *StrBufferLen, - IN EFI_GUID *Guid, + IN CONST EFI_GUID *Guid, IN CHAR16 *Name, OPTIONAL IN EFI_HANDLE *DriverHandle ) @@ -576,8 +573,8 @@ BOOLEAN EFIAPI FindBlockName ( IN OUT CHAR16 *String, - UINTN Offset, - UINTN Width + IN UINTN Offset, + IN UINTN Width ) ; @@ -601,10 +598,10 @@ FindBlockName ( EFI_STATUS EFIAPI GetBrowserData ( - EFI_GUID *VariableGuid, OPTIONAL - CHAR16 *VariableName, OPTIONAL - UINTN *BufferSize, - UINT8 *Buffer + IN CONST EFI_GUID *VariableGuid, OPTIONAL + IN CONST CHAR16 *VariableName, OPTIONAL + IN OUT UINTN *BufferSize, + IN OUT UINT8 *Buffer ) ; @@ -630,11 +627,11 @@ GetBrowserData ( EFI_STATUS EFIAPI SetBrowserData ( - EFI_GUID *VariableGuid, OPTIONAL - CHAR16 *VariableName, OPTIONAL - UINTN BufferSize, - UINT8 *Buffer, - CHAR16 *RequestElement OPTIONAL + IN CONST EFI_GUID *VariableGuid, OPTIONAL + IN CONST CHAR16 *VariableName, OPTIONAL + IN UINTN BufferSize, + IN CONST UINT8 *Buffer, + IN CONST CHAR16 *RequestElement OPTIONAL ) ; diff --git a/MdePkg/Library/IfrSupportLib/UefiIfrForm.c b/MdePkg/Library/IfrSupportLib/UefiIfrForm.c index 3ae15f4..2f31ed2 100644 --- a/MdePkg/Library/IfrSupportLib/UefiIfrForm.c +++ b/MdePkg/Library/IfrSupportLib/UefiIfrForm.c @@ -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_HII_CONFIG_ROUTING_PROTOCOL *mHiiConfigRouting = NULL; -/**
- This function locate FormBrowser2 protocols for later usage.
- - @return Status the status to locate protocol.
-**/
-EFI_STATUS
-LocateFormBrowser2Protocols (
- VOID
- )
+/** + This function locate FormBrowser2 protocols for later usage. + + @return Status the status to locate protocol. +**/ +EFI_STATUS +LocateFormBrowser2Protocols ( + VOID + ) { EFI_STATUS Status; // @@ -566,7 +566,7 @@ EFIAPI ConstructConfigHdr ( IN OUT CHAR16 *ConfigHdr, IN OUT UINTN *StrBufferLen, - IN EFI_GUID *Guid, + IN CONST EFI_GUID *Guid, IN CHAR16 *Name, OPTIONAL IN EFI_HANDLE *DriverHandle ) @@ -657,8 +657,8 @@ BOOLEAN EFIAPI FindBlockName ( IN OUT CHAR16 *String, - UINTN Offset, - UINTN Width + IN UINTN Offset, + IN UINTN Width ) { EFI_STATUS Status; @@ -727,10 +727,10 @@ FindBlockName ( EFI_STATUS EFIAPI GetBrowserData ( - EFI_GUID *VariableGuid, OPTIONAL - CHAR16 *VariableName, OPTIONAL - UINTN *BufferSize, - UINT8 *Buffer + IN CONST EFI_GUID *VariableGuid, OPTIONAL + IN CONST CHAR16 *VariableName, OPTIONAL + IN OUT UINTN *BufferSize, + IN OUT UINT8 *Buffer ) { EFI_STATUS Status; @@ -844,11 +844,11 @@ GetBrowserData ( EFI_STATUS EFIAPI SetBrowserData ( - EFI_GUID *VariableGuid, OPTIONAL - CHAR16 *VariableName, OPTIONAL - UINTN BufferSize, - UINT8 *Buffer, - CHAR16 *RequestElement OPTIONAL + IN CONST EFI_GUID *VariableGuid, OPTIONAL + IN CONST CHAR16 *VariableName, OPTIONAL + IN UINTN BufferSize, + IN CONST UINT8 *Buffer, + IN CONST CHAR16 *RequestElement OPTIONAL ) { EFI_STATUS Status; @@ -860,7 +860,7 @@ SetBrowserData ( CHAR16 *Progress; CHAR16 BlockName[33]; CHAR16 *ConfigRequest; - CHAR16 *Request; + CONST CHAR16 *Request; // // Locate protocols for use |