X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=MdeModulePkg%2FUniversal%2FHiiDatabaseDxe%2FHiiDatabase.h;h=d90bc0290dba5d7e6077bffce09d41b9a5e77c23;hp=bbd366edece9c1f84654e514d9d14142b02311ef;hb=8a45f80edad4e2e1e23118833f92df4320b123ab;hpb=813acf3a9a99e97ab200c7e222ee96810a9aa3fd diff --git a/MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabase.h b/MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabase.h index bbd366edec..d90bc0290d 100644 --- a/MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabase.h +++ b/MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabase.h @@ -1,7 +1,8 @@ /** @file +Private structures definitions in HiiDatabase. -Copyright (c) 2007 - 2008, Intel Corporation -All rights reserved. This program and the accompanying materials +Copyright (c) 2007 - 2016, Intel Corporation. All rights reserved.
+This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php @@ -9,25 +10,13 @@ http://opensource.org/licenses/bsd-license.php THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -Module Name: - - HiiDatabase.h - -Abstract: - - Private structures definitions in HiiDatabase. - -Revision History - - **/ #ifndef __HII_DATABASE_PRIVATE_H__ #define __HII_DATABASE_PRIVATE_H__ -#include +#include -#include #include #include #include @@ -35,9 +24,11 @@ Revision History #include #include #include +#include #include #include +#include #include @@ -47,13 +38,10 @@ Revision History #include #include #include -#include -#include - -#define HII_DATABASE_NOTIFY_GUID \ - { \ - 0xc1c76, 0xd79e, 0x42fe, {0x86, 0xb, 0x8b, 0xe8, 0x7b, 0x3e, 0x7a, 0x78} \ - } +#include +#include +#include +#include #define MAX_STRING_LENGTH 1024 #define MAX_FONT_NAME_LEN 256 @@ -69,14 +57,72 @@ Revision History #define BITMAP_LEN_8_BIT(Width, Height) ((Width) * (Height)) #define BITMAP_LEN_24_BIT(Width, Height) ((Width) * (Height) * 3) +// +// IFR data structure +// +// BASE_CR (a, IFR_DEFAULT_VALUE_DATA, Entry) to get the whole structure. + +typedef struct { + LIST_ENTRY Entry; // Link to VarStorage + EFI_GUID Guid; + CHAR16 *Name; + UINT16 Size; + UINT8 Type; + LIST_ENTRY BlockEntry; // Link to its Block array +} IFR_VARSTORAGE_DATA; + +typedef struct { + LIST_ENTRY Entry; // Link to Block array + UINT16 Offset; + UINT16 Width; + EFI_QUESTION_ID QuestionId; + UINT8 OpCode; + UINT8 Scope; + LIST_ENTRY DefaultValueEntry; // Link to its default value array + CHAR16 *Name; +} IFR_BLOCK_DATA; + +// +// Get default value from IFR data. +// +typedef enum { + DefaultValueFromDefault = 0, // Get from the minimum or first one when not set default value. + DefaultValueFromFlag, // Get default value from the defalut flag. + DefaultValueFromOpcode // Get default value from default opcode, highest priority. +} DEFAULT_VALUE_TYPE; + +typedef struct { + LIST_ENTRY Entry; + DEFAULT_VALUE_TYPE Type; + BOOLEAN Cleaned; // Whether this value is cleaned + // TRUE Cleaned, the value can't be used + // FALSE Not cleaned, the value can be used. + UINT16 DefaultId; + EFI_IFR_TYPE_VALUE Value; +} IFR_DEFAULT_DATA; + // // Storage types // -#define EFI_HII_VARSTORE_BUFFER 0 -#define EFI_HII_VARSTORE_NAME_VALUE 1 -#define EFI_HII_VARSTORE_EFI_VARIABLE 2 +#define EFI_HII_VARSTORE_BUFFER 0 +#define EFI_HII_VARSTORE_NAME_VALUE 1 +#define EFI_HII_VARSTORE_EFI_VARIABLE 2 +#define EFI_HII_VARSTORE_EFI_VARIABLE_BUFFER 3 + +// +// Keyword handler protocol filter type. +// +#define EFI_KEYWORD_FILTER_READONY 0x01 +#define EFI_KEYWORD_FILTER_REAWRITE 0x02 +#define EFI_KEYWORD_FILTER_BUFFER 0x10 +#define EFI_KEYWORD_FILTER_NUMERIC 0x20 +#define EFI_KEYWORD_FILTER_NUMERIC_1 0x30 +#define EFI_KEYWORD_FILTER_NUMERIC_2 0x40 +#define EFI_KEYWORD_FILTER_NUMERIC_4 0x50 +#define EFI_KEYWORD_FILTER_NUMERIC_8 0x60 + -#define HII_FORMSET_STORAGE_SIGNATURE EFI_SIGNATURE_32 ('H', 'S', 'T', 'G') +#define HII_FORMSET_STORAGE_SIGNATURE SIGNATURE_32 ('H', 'S', 'T', 'G') typedef struct { UINTN Signature; LIST_ENTRY Entry; @@ -90,13 +136,11 @@ typedef struct { UINT16 Size; } HII_FORMSET_STORAGE; -#define HII_FORMSET_STORAGE_FROM_LINK(a) CR (a, HII_FORMSET_STORAGE, Link, HII_FORMSET_STORAGE_SIGNATURE) - // // String Package definitions // -#define HII_STRING_PACKAGE_SIGNATURE EFI_SIGNATURE_32 ('h','i','s','p') +#define HII_STRING_PACKAGE_SIGNATURE SIGNATURE_32 ('h','i','s','p') typedef struct _HII_STRING_PACKAGE_INSTANCE { UINTN Signature; EFI_HII_STRING_PACKAGE_HDR *StringPkgHdr; @@ -104,12 +148,13 @@ typedef struct _HII_STRING_PACKAGE_INSTANCE { LIST_ENTRY StringEntry; LIST_ENTRY FontInfoList; // local font info list UINT8 FontId; + EFI_STRING_ID MaxStringId; // record StringId } HII_STRING_PACKAGE_INSTANCE; // // Form Package definitions // -#define HII_IFR_PACKAGE_SIGNATURE EFI_SIGNATURE_32 ('h','f','r','p') +#define HII_IFR_PACKAGE_SIGNATURE SIGNATURE_32 ('h','f','r','p') typedef struct _HII_IFR_PACKAGE_INSTANCE { UINTN Signature; EFI_HII_PACKAGE_HEADER FormPkgHdr; @@ -120,7 +165,7 @@ typedef struct _HII_IFR_PACKAGE_INSTANCE { // // Simple Font Package definitions // -#define HII_S_FONT_PACKAGE_SIGNATURE EFI_SIGNATURE_32 ('h','s','f','p') +#define HII_S_FONT_PACKAGE_SIGNATURE SIGNATURE_32 ('h','s','f','p') typedef struct _HII_SIMPLE_FONT_PACKAGE_INSTANCE { UINTN Signature; EFI_HII_SIMPLE_FONT_PACKAGE_HDR *SimpleFontPkgHdr; @@ -130,16 +175,18 @@ typedef struct _HII_SIMPLE_FONT_PACKAGE_INSTANCE { // // Font Package definitions // -#define HII_FONT_PACKAGE_SIGNATURE EFI_SIGNATURE_32 ('h','i','f','p') +#define HII_FONT_PACKAGE_SIGNATURE SIGNATURE_32 ('h','i','f','p') typedef struct _HII_FONT_PACKAGE_INSTANCE { UINTN Signature; EFI_HII_FONT_PACKAGE_HDR *FontPkgHdr; + UINT16 Height; + UINT16 BaseLine; UINT8 *GlyphBlock; LIST_ENTRY FontEntry; LIST_ENTRY GlyphInfoList; } HII_FONT_PACKAGE_INSTANCE; -#define HII_GLYPH_INFO_SIGNATURE EFI_SIGNATURE_32 ('h','g','i','s') +#define HII_GLYPH_INFO_SIGNATURE SIGNATURE_32 ('h','g','i','s') typedef struct _HII_GLYPH_INFO { UINTN Signature; LIST_ENTRY Entry; @@ -147,7 +194,7 @@ typedef struct _HII_GLYPH_INFO { EFI_HII_GLYPH_INFO Cell; } HII_GLYPH_INFO; -#define HII_FONT_INFO_SIGNATURE EFI_SIGNATURE_32 ('h','l','f','i') +#define HII_FONT_INFO_SIGNATURE SIGNATURE_32 ('h','l','f','i') typedef struct _HII_FONT_INFO { UINTN Signature; LIST_ENTRY Entry; @@ -155,7 +202,7 @@ typedef struct _HII_FONT_INFO { UINT8 FontId; } HII_FONT_INFO; -#define HII_GLOBAL_FONT_INFO_SIGNATURE EFI_SIGNATURE_32 ('h','g','f','i') +#define HII_GLOBAL_FONT_INFO_SIGNATURE SIGNATURE_32 ('h','g','f','i') typedef struct _HII_GLOBAL_FONT_INFO { UINTN Signature; LIST_ENTRY Entry; @@ -181,7 +228,7 @@ typedef struct _HII_IMAGE_PACKAGE_INSTANCE { // // Keyboard Layout Pacakge definitions // -#define HII_KB_LAYOUT_PACKAGE_SIGNATURE EFI_SIGNATURE_32 ('h','k','l','p') +#define HII_KB_LAYOUT_PACKAGE_SIGNATURE SIGNATURE_32 ('h','k','l','p') typedef struct _HII_KEYBOARD_LAYOUT_PACKAGE_INSTANCE { UINTN Signature; UINT8 *KeyboardPkg; @@ -191,7 +238,7 @@ typedef struct _HII_KEYBOARD_LAYOUT_PACKAGE_INSTANCE { // // Guid Package definitions // -#define HII_GUID_PACKAGE_SIGNATURE EFI_SIGNATURE_32 ('h','i','g','p') +#define HII_GUID_PACKAGE_SIGNATURE SIGNATURE_32 ('h','i','g','p') typedef struct _HII_GUID_PACKAGE_INSTANCE { UINTN Signature; UINT8 *GuidPkg; @@ -214,7 +261,7 @@ typedef struct _HII_DATABASE_PACKAGE_LIST_INSTANCE { UINT8 *DevicePathPkg; } HII_DATABASE_PACKAGE_LIST_INSTANCE; -#define HII_HANDLE_SIGNATURE EFI_SIGNATURE_32 ('h','i','h','l') +#define HII_HANDLE_SIGNATURE SIGNATURE_32 ('h','i','h','l') typedef struct { UINTN Signature; @@ -222,7 +269,7 @@ typedef struct { UINTN Key; } HII_HANDLE; -#define HII_DATABASE_RECORD_SIGNATURE EFI_SIGNATURE_32 ('h','i','d','r') +#define HII_DATABASE_RECORD_SIGNATURE SIGNATURE_32 ('h','i','d','r') typedef struct _HII_DATABASE_RECORD { UINTN Signature; @@ -232,7 +279,7 @@ typedef struct _HII_DATABASE_RECORD { LIST_ENTRY DatabaseEntry; } HII_DATABASE_RECORD; -#define HII_DATABASE_NOTIFY_SIGNATURE EFI_SIGNATURE_32 ('h','i','d','n') +#define HII_DATABASE_NOTIFY_SIGNATURE SIGNATURE_32 ('h','i','d','n') typedef struct _HII_DATABASE_NOTIFY { UINTN Signature; @@ -244,19 +291,18 @@ typedef struct _HII_DATABASE_NOTIFY { LIST_ENTRY DatabaseNotifyEntry; } HII_DATABASE_NOTIFY; -#define HII_DATABASE_PRIVATE_DATA_SIGNATURE EFI_SIGNATURE_32 ('H', 'i', 'D', 'p') +#define HII_DATABASE_PRIVATE_DATA_SIGNATURE SIGNATURE_32 ('H', 'i', 'D', 'p') typedef struct _HII_DATABASE_PRIVATE_DATA { UINTN Signature; LIST_ENTRY DatabaseList; LIST_ENTRY DatabaseNotifyList; EFI_HII_FONT_PROTOCOL HiiFont; -#ifndef DISABLE_UNUSED_HII_PROTOCOLS EFI_HII_IMAGE_PROTOCOL HiiImage; -#endif EFI_HII_STRING_PROTOCOL HiiString; EFI_HII_DATABASE_PROTOCOL HiiDatabase; EFI_HII_CONFIG_ROUTING_PROTOCOL ConfigRouting; + EFI_CONFIG_KEYWORD_HANDLER_PROTOCOL ConfigKeywordHandler; LIST_ENTRY HiiHandleList; INTN HiiHandleCount; LIST_ENTRY FontInfoList; // global font info list @@ -300,12 +346,50 @@ typedef struct _HII_DATABASE_PRIVATE_DATA { HII_DATABASE_PRIVATE_DATA_SIGNATURE \ ) +#define CONFIG_KEYWORD_HANDLER_DATABASE_PRIVATE_DATA_FROM_THIS(a) \ + CR (a, \ + HII_DATABASE_PRIVATE_DATA, \ + ConfigKeywordHandler, \ + HII_DATABASE_PRIVATE_DATA_SIGNATURE \ + ) + // // Internal function prototypes. // /** - This function checks whether a handle is a valid EFI_HII_HANDLE + Generate a sub string then output it. + + This is a internal function. + + @param String A constant string which is the prefix of the to be + generated string, e.g. GUID= + + @param BufferLen The length of the Buffer in bytes. + + @param Buffer Points to a buffer which will be converted to be the + content of the generated string. + + @param Flag If 1, the buffer contains data for the value of GUID or PATH stored in + UINT8 *; if 2, the buffer contains unicode string for the value of NAME; + if 3, the buffer contains other data. + + @param SubStr Points to the output string. It's caller's + responsibility to free this buffer. + + +**/ +VOID +GenerateSubStr ( + IN CONST EFI_STRING String, + IN UINTN BufferLen, + IN VOID *Buffer, + IN UINT8 Flag, + OUT EFI_STRING *SubStr + ); + +/** + This function checks whether a handle is a valid EFI_HII_HANDLE. @param Handle Pointer to a EFI_HII_HANDLE @@ -316,8 +400,7 @@ typedef struct _HII_DATABASE_PRIVATE_DATA { BOOLEAN IsHiiHandleValid ( EFI_HII_HANDLE Handle - ) -; + ); /** @@ -349,10 +432,33 @@ IsFontInfoExisted ( IN EFI_FONT_INFO_MASK *FontInfoMask, OPTIONAL IN EFI_FONT_HANDLE FontHandle, OPTIONAL OUT HII_GLOBAL_FONT_INFO **GlobalFontInfo OPTIONAL + ); + +/** + + This function invokes the matching registered function. + + @param Private HII Database driver private structure. + @param NotifyType The type of change concerning the database. + @param PackageInstance Points to the package referred to by the notification. + @param PackageType Package type + @param Handle The handle of the package list which contains the specified package. + + @retval EFI_SUCCESS Already checked all registered function and invoked + if matched. + @retval EFI_INVALID_PARAMETER Any input parameter is not valid. + +**/ +EFI_STATUS +InvokeRegisteredFunction ( + IN HII_DATABASE_PRIVATE_DATA *Private, + IN EFI_HII_DATABASE_NOTIFY_TYPE NotifyType, + IN VOID *PackageInstance, + IN UINT8 PackageType, + IN EFI_HII_HANDLE Handle ) ; - /** Retrieve system default font and color. @@ -373,15 +479,15 @@ GetSystemFont ( IN HII_DATABASE_PRIVATE_DATA *Private, OUT EFI_FONT_DISPLAY_INFO **FontInfo, OUT UINTN *FontInfoSize OPTIONAL - ) -; + ); /** Parse all string blocks to find a String block specified by StringId. If StringId = (EFI_STRING_ID) (-1), find out all EFI_HII_SIBT_FONT blocks - within this string package and backup its information. - If StringId = 0, output the string id of last string block (EFI_HII_SIBT_END). + within this string package and backup its information. If LastStringId is + specified, the string id of last string block will also be output. + If StringId = 0, output the string id of last string block (EFI_HII_SIBT_STRING). @param Private Hii database private structure. @param StringPackage Hii string package instance. @@ -391,7 +497,8 @@ GetSystemFont ( @param StringBlockAddr Output the block address of found string block. @param StringTextOffset Offset, relative to the found block address, of the string text information. - @param LastStringId Output the last string id when StringId = 0. + @param LastStringId Output the last string id when StringId = 0 or StringId = -1. + @param StartStringId The first id in the skip block which StringId in the block. @retval EFI_SUCCESS The string text and font is retrieved successfully. @@ -409,9 +516,9 @@ FindStringBlock ( OUT UINT8 *BlockType, OPTIONAL OUT UINT8 **StringBlockAddr, OPTIONAL OUT UINTN *StringTextOffset, OPTIONAL - OUT EFI_STRING_ID *LastStringId OPTIONAL - ) -; + OUT EFI_STRING_ID *LastStringId, OPTIONAL + OUT EFI_STRING_ID *StartStringId OPTIONAL + ); /** @@ -442,8 +549,35 @@ FindGlyphBlock ( OUT UINT8 **GlyphBuffer, OPTIONAL OUT EFI_HII_GLYPH_INFO *Cell, OPTIONAL OUT UINTN *GlyphBufferLen OPTIONAL - ) -; + ); + +/** + This function exports Form packages to a buffer. + This is a internal function. + + @param Private Hii database private structure. + @param Handle Identification of a package list. + @param PackageList Pointer to a package list which will be exported. + @param UsedSize The length of buffer be used. + @param BufferSize Length of the Buffer. + @param Buffer Allocated space for storing exported data. + @param ResultSize The size of the already exported content of this + package list. + + @retval EFI_SUCCESS Form Packages are exported successfully. + @retval EFI_INVALID_PARAMETER Any input parameter is invalid. + +**/ +EFI_STATUS +ExportFormPackages ( + IN HII_DATABASE_PRIVATE_DATA *Private, + IN EFI_HII_HANDLE Handle, + IN HII_DATABASE_PACKAGE_LIST_INSTANCE *PackageList, + IN UINTN UsedSize, + IN UINTN BufferSize, + IN OUT VOID *Buffer, + IN OUT UINTN *ResultSize + ); // // EFI_HII_FONT_PROTOCOL protocol interfaces @@ -470,7 +604,10 @@ FindGlyphBlock ( will be allocated to hold the generated image and the pointer updated on exit. It is the caller's responsibility to free this buffer. - @param BltX,BLTY Specifies the offset from the left and top edge + @param BltX Together with BltX, Specifies the offset from the left and top edge + of the image of the first character cell in the + image. + @param BltY Together with BltY, Specifies the offset from the left and top edge of the image of the first character cell in the image. @param RowInfoArray If this is non-NULL on entry, then on exit, this @@ -514,8 +651,7 @@ HiiStringToImage ( OUT EFI_HII_ROW_INFO **RowInfoArray OPTIONAL, OUT UINTN *RowInfoArraySize OPTIONAL, OUT UINTN *ColumnInfoArray OPTIONAL - ) -; + ); /** @@ -543,7 +679,10 @@ HiiStringToImage ( will be allocated to hold the generated image and the pointer updated on exit. It is the caller's responsibility to free this buffer. - @param BltX,BLTY Specifies the offset from the left and top edge + @param BltX Together with BltX, Specifies the offset from the left and top edge + of the image of the first character cell in the + image. + @param BltY Together with BltY, Specifies the offset from the left and top edge of the image of the first character cell in the image. @param RowInfoArray If this is non-NULL on entry, then on exit, this @@ -591,8 +730,7 @@ HiiStringIdToImage ( OUT EFI_HII_ROW_INFO **RowInfoArray OPTIONAL, OUT UINTN *RowInfoArraySize OPTIONAL, OUT UINTN *ColumnInfoArray OPTIONAL - ) -; + ); /** @@ -622,11 +760,10 @@ EFIAPI HiiGetGlyph ( IN CONST EFI_HII_FONT_PROTOCOL *This, IN CHAR16 Char, - IN CONST EFI_FONT_DISPLAY_INFO *StringInfo, OPTIONAL + IN CONST EFI_FONT_DISPLAY_INFO *StringInfo, OUT EFI_IMAGE_OUTPUT **Blt, OUT UINTN *Baseline OPTIONAL - ) -; + ); /** @@ -640,13 +777,15 @@ HiiGetGlyph ( with the first font. On return, points to the returned font handle or points to NULL if there are no more matching fonts. - @param StringInfoIn Upon entry, points to the font to return - information about. If NULL, then the information about the system default - font will be returned. - @param StringInfoOut Upon return, contains the matching font's - information. If NULL, then no information is - returned. It's caller's responsibility to free - this buffer. + @param StringInfoIn Upon entry, points to the font to return information + about. If NULL, then the information about the system + default font will be returned. + @param StringInfoOut Upon return, contains the matching font's information. + If NULL, then no information is returned. This buffer + is allocated with a call to the Boot Service AllocatePool(). + It is the caller's responsibility to call the Boot + Service FreePool() when the caller no longer requires + the contents of StringInfoOut. @param String Points to the string which will be tested to determine if all characters are available. If NULL, then any font is acceptable. @@ -654,7 +793,7 @@ HiiGetGlyph ( @retval EFI_SUCCESS Matching font returned successfully. @retval EFI_NOT_FOUND No matching font was found. @retval EFI_INVALID_PARAMETER StringInfoIn is NULL. - @retval EFI_INVALID_PARAMETER StringInfoIn->FontInfoMask is an invalid combination. + @retval EFI_INVALID_PARAMETER StringInfoIn->FontInfoMask is an invalid combination. @retval EFI_OUT_OF_RESOURCES There were insufficient resources to complete the request. **/ @@ -663,11 +802,10 @@ EFIAPI HiiGetFontInfo ( IN CONST EFI_HII_FONT_PROTOCOL *This, IN OUT EFI_FONT_HANDLE *FontHandle, - IN CONST EFI_FONT_DISPLAY_INFO *StringInfoIn, + IN CONST EFI_FONT_DISPLAY_INFO *StringInfoIn, OPTIONAL OUT EFI_FONT_DISPLAY_INFO **StringInfoOut, IN CONST EFI_STRING String OPTIONAL - ) -; + ); // // EFI_HII_IMAGE_PROTOCOL interfaces @@ -699,8 +837,7 @@ HiiNewImage ( IN EFI_HII_HANDLE PackageList, OUT EFI_IMAGE_ID *ImageId, IN CONST EFI_IMAGE_INPUT *Image - ) -; + ); /** @@ -731,8 +868,7 @@ HiiGetImage ( IN EFI_HII_HANDLE PackageList, IN EFI_IMAGE_ID ImageId, OUT EFI_IMAGE_INPUT *Image - ) -; + ); /** @@ -758,8 +894,7 @@ HiiSetImage ( IN EFI_HII_HANDLE PackageList, IN EFI_IMAGE_ID ImageId, IN CONST EFI_IMAGE_INPUT *Image - ) -; + ); /** @@ -778,6 +913,9 @@ HiiSetImage ( a buffer will be allocated to hold the generated image and the pointer updated on exit. It is the caller's responsibility to free this buffer. + @param BltX Specifies the offset from the left and top edge + of the output image of the first pixel in the + image. @param BltY Specifies the offset from the left and top edge of the output image of the first pixel in the image. @@ -797,8 +935,7 @@ HiiDrawImage ( IN OUT EFI_IMAGE_OUTPUT **Blt, IN UINTN BltX, IN UINTN BltY - ) -; + ); /** @@ -821,6 +958,9 @@ HiiDrawImage ( allocated to hold the generated image and the pointer updated on exit. It is the caller's responsibility to free this buffer. + @param BltX Specifies the offset from the left and top edge + of the output image of the first pixel in the + image. @param BltY Specifies the offset from the left and top edge of the output image of the first pixel in the image. @@ -892,8 +1032,7 @@ HiiNewString ( IN CONST CHAR16 *LanguageName, OPTIONAL IN CONST EFI_STRING String, IN CONST EFI_FONT_INFO *StringFontInfo OPTIONAL - ) -; + ); /** @@ -919,13 +1058,14 @@ HiiNewString ( @retval EFI_SUCCESS The string was returned successfully. @retval EFI_NOT_FOUND The string specified by StringId is not available. - @retval EFI_NOT_FOUND The string specified by StringId is available but - not in the specified language. - The specified PackageList is not in the database. - @retval EFI_INVALID_LANGUAGE - The string specified by StringId is available but + The specified PackageList is not in the database. + @retval EFI_INVALID_LANGUAGE The string specified by StringId is available but + not in the specified language. @retval EFI_BUFFER_TOO_SMALL The buffer specified by StringSize is too small to hold the string. - @retval EFI_INVALID_PARAMETER The String or Language or StringSize was NULL. + @retval EFI_INVALID_PARAMETER The Language or StringSize was NULL. + @retval EFI_INVALID_PARAMETER The value referenced by StringSize was not zero + and String was NULL. @retval EFI_OUT_OF_RESOURCES There were insufficient resources to complete the request. @@ -940,8 +1080,7 @@ HiiGetString ( OUT EFI_STRING String, IN OUT UINTN *StringSize, OUT EFI_FONT_INFO **StringFontInfo OPTIONAL - ) -; + ); /** @@ -975,8 +1114,7 @@ HiiSetString ( IN CONST CHAR8 *Language, IN CONST EFI_STRING String, IN CONST EFI_FONT_INFO *StringFontInfo OPTIONAL - ) -; + ); /** @@ -986,13 +1124,15 @@ HiiSetString ( @param This A pointer to the EFI_HII_STRING_PROTOCOL instance. @param PackageList The package list to examine. - @param Languages Points to the buffer to hold the returned string. + @param Languages Points to the buffer to hold the returned + null-terminated ASCII string. @param LanguagesSize On entry, points to the size of the buffer pointed to by Languages, in bytes. On return, points to the length of Languages, in bytes. @retval EFI_SUCCESS The languages were returned successfully. - @retval EFI_INVALID_PARAMETER The Languages or LanguagesSize was NULL. + @retval EFI_INVALID_PARAMETER The LanguagesSize was NULL. + @retval EFI_INVALID_PARAMETER The value referenced by LanguagesSize is not zero and Languages is NULL. @retval EFI_BUFFER_TOO_SMALL The LanguagesSize is too small to hold the list of supported languages. LanguageSize is updated to contain the required size. @@ -1007,8 +1147,7 @@ HiiGetLanguages ( IN EFI_HII_HANDLE PackageList, IN OUT CHAR8 *Languages, IN OUT UINTN *LanguagesSize - ) -; + ); /** @@ -1019,27 +1158,31 @@ HiiGetLanguages ( @param This A pointer to the EFI_HII_STRING_PROTOCOL instance. @param PackageList The package list to examine. - @param FirstLanguage Points to the primary language. - @param SecondaryLanguages Points to the buffer to hold the returned list of - secondary languages for the specified - FirstLanguage. If there are no secondary - languages, the function returns successfully, + @param PrimaryLanguage Points to the null-terminated ASCII string that specifies + the primary language. Languages are specified in the + format specified in Appendix M of the UEFI 2.0 specification. + @param SecondaryLanguages Points to the buffer to hold the returned null-terminated + ASCII string that describes the list of + secondary languages for the specified + PrimaryLanguage. If there are no secondary + languages, the function returns successfully, but this is set to NULL. - @param SecondaryLanguageSize On entry, points to the size of the buffer - pointed to by SecondLanguages, in bytes. On - return, points to the length of SecondLanguages + @param SecondaryLanguagesSize On entry, points to the size of the buffer + pointed to by SecondaryLanguages, in bytes. On + return, points to the length of SecondaryLanguages in bytes. @retval EFI_SUCCESS Secondary languages were correctly returned. - @retval EFI_INVALID_PARAMETER FirstLanguage or SecondLanguages or - SecondLanguagesSize was NULL. - @retval EFI_BUFFER_TOO_SMALL The buffer specified by SecondLanguagesSize is + @retval EFI_INVALID_PARAMETER PrimaryLanguage or SecondaryLanguagesSize was NULL. + @retval EFI_INVALID_PARAMETER The value referenced by SecondaryLanguagesSize is not + zero and SecondaryLanguages is NULL. + @retval EFI_BUFFER_TOO_SMALL The buffer specified by SecondaryLanguagesSize is too small to hold the returned information. - SecondLanguageSize is updated to hold the size of + SecondaryLanguageSize is updated to hold the size of the buffer required. - @retval EFI_INVALID_LANGUAGE The language specified by FirstLanguage is not + @retval EFI_INVALID_LANGUAGE The language specified by PrimaryLanguage is not present in the specified package list. - @retval EFI_NOT_FOUND The specified PackageList is not in the Database. + @retval EFI_NOT_FOUND The specified PackageList is not in the Database. **/ EFI_STATUS @@ -1047,11 +1190,10 @@ EFIAPI HiiGetSecondaryLanguages ( IN CONST EFI_HII_STRING_PROTOCOL *This, IN EFI_HII_HANDLE PackageList, - IN CONST CHAR8 *FirstLanguage, - IN OUT CHAR8 *SecondLanguages, - IN OUT UINTN *SecondLanguagesSize - ) -; + IN CONST CHAR8 *PrimaryLanguage, + IN OUT CHAR8 *SecondaryLanguages, + IN OUT UINTN *SecondaryLanguagesSize + ); // // EFI_HII_DATABASE_PROTOCOL protocol interfaces @@ -1068,6 +1210,8 @@ HiiGetSecondaryLanguages ( @param PackageList A pointer to an EFI_HII_PACKAGE_LIST_HEADER structure. @param DriverHandle Associate the package list with this EFI handle. + If a NULL is specified, this data will not be associate + with any drivers and cannot have a callback induced. @param Handle A pointer to the EFI_HII_HANDLE instance. @retval EFI_SUCCESS The package list associated with the Handle was @@ -1082,10 +1226,9 @@ EFIAPI HiiNewPackageList ( IN CONST EFI_HII_DATABASE_PROTOCOL *This, IN CONST EFI_HII_PACKAGE_LIST_HEADER *PackageList, - IN CONST EFI_HANDLE DriverHandle, + IN CONST EFI_HANDLE DriverHandle, OPTIONAL OUT EFI_HII_HANDLE *Handle - ) -; + ); /** @@ -1108,8 +1251,7 @@ EFIAPI HiiRemovePackageList ( IN CONST EFI_HII_DATABASE_PROTOCOL *This, IN EFI_HII_HANDLE Handle - ) -; + ); /** @@ -1136,8 +1278,7 @@ HiiUpdatePackageList ( IN CONST EFI_HII_DATABASE_PROTOCOL *This, IN EFI_HII_HANDLE Handle, IN CONST EFI_HII_PACKAGE_LIST_HEADER *PackageList - ) -; + ); /** @@ -1160,18 +1301,19 @@ HiiUpdatePackageList ( @param Handle An array of EFI_HII_HANDLE instances returned. @retval EFI_SUCCESS The matching handles are outputed successfully. - HandleBufferLength is updated with the actual length. + HandleBufferLength is updated with the actual length. @retval EFI_BUFFER_TO_SMALL The HandleBufferLength parameter indicates that Handle is too small to support the number of handles. HandleBufferLength is updated with a value that will enable the data to fit. @retval EFI_NOT_FOUND No matching handle could not be found in database. - @retval EFI_INVALID_PARAMETER Handle or HandleBufferLength was NULL. - @retval EFI_INVALID_PARAMETER PackageType is not a EFI_HII_PACKAGE_TYPE_GUID but - PackageGuid is not NULL, PackageType is a EFI_HII_ - PACKAGE_TYPE_GUID but PackageGuid is NULL. - + @retval EFI_INVALID_PARAMETER HandleBufferLength was NULL. + @retval EFI_INVALID_PARAMETER The value referenced by HandleBufferLength was not + zero and Handle was NULL. + @retval EFI_INVALID_PARAMETER PackageType is not a EFI_HII_PACKAGE_TYPE_GUID but + PackageGuid is not NULL, PackageType is a EFI_HII_ + PACKAGE_TYPE_GUID but PackageGuid is NULL. **/ EFI_STATUS @@ -1182,8 +1324,7 @@ HiiListPackageLists ( IN CONST EFI_GUID *PackageGuid, IN OUT UINTN *HandleBufferLength, OUT EFI_HII_HANDLE *Handle - ) -; + ); /** @@ -1210,7 +1351,9 @@ HiiListPackageLists ( a value that will enable the data to fit. @retval EFI_NOT_FOUND The specifiecd Handle could not be found in the current database. - @retval EFI_INVALID_PARAMETER Handle or Buffer or BufferSize was NULL. + @retval EFI_INVALID_PARAMETER BufferSize was NULL. + @retval EFI_INVALID_PARAMETER The value referenced by BufferSize was not zero + and Buffer was NULL. **/ EFI_STATUS @@ -1220,8 +1363,7 @@ HiiExportPackageLists ( IN EFI_HII_HANDLE Handle, IN OUT UINTN *BufferSize, OUT EFI_HII_PACKAGE_LIST_HEADER *Buffer - ) -; + ); /** @@ -1269,8 +1411,7 @@ HiiRegisterPackageNotify ( IN CONST EFI_HII_DATABASE_NOTIFY PackageNotifyFn, IN EFI_HII_DATABASE_NOTIFY_TYPE NotifyType, OUT EFI_HANDLE *NotifyHandle - ) -; + ); /** @@ -1278,7 +1419,7 @@ HiiRegisterPackageNotify ( @param This A pointer to the EFI_HII_DATABASE_PROTOCOL instance. - @param NotifyHandle The handle of the notification function being + @param NotificationHandle The handle of the notification function being unregistered. @retval EFI_SUCCESS Notification is unregistered successfully. @@ -1291,8 +1432,7 @@ EFIAPI HiiUnregisterPackageNotify ( IN CONST EFI_HII_DATABASE_PROTOCOL *This, IN EFI_HANDLE NotificationHandle - ) -; + ); /** @@ -1313,8 +1453,9 @@ HiiUnregisterPackageNotify ( number of GUIDs. KeyGuidBufferLength is updated with a value that will enable the data to fit. - @retval EFI_INVALID_PARAMETER The KeyGuidBuffer or KeyGuidBufferLength was - NULL. + @retval EFI_INVALID_PARAMETER The KeyGuidBufferLength is NULL. + @retval EFI_INVALID_PARAMETER The value referenced by KeyGuidBufferLength is not + zero and KeyGuidBuffer is NULL. @retval EFI_NOT_FOUND There was no keyboard layout. **/ @@ -1324,8 +1465,7 @@ HiiFindKeyboardLayouts ( IN CONST EFI_HII_DATABASE_PROTOCOL *This, IN OUT UINT16 *KeyGuidBufferLength, OUT EFI_GUID *KeyGuidBuffer - ) -; + ); /** @@ -1356,8 +1496,7 @@ HiiGetKeyboardLayout ( IN CONST EFI_GUID *KeyGuid, IN OUT UINT16 *KeyboardLayoutLength, OUT EFI_HII_KEYBOARD_LAYOUT *KeyboardLayout - ) -; + ); /** @@ -1382,8 +1521,7 @@ EFIAPI HiiSetKeyboardLayout ( IN CONST EFI_HII_DATABASE_PROTOCOL *This, IN CONST EFI_GUID *KeyGuid - ) -; + ); /** @@ -1408,8 +1546,7 @@ HiiGetPackageListHandle ( IN CONST EFI_HII_DATABASE_PROTOCOL *This, IN EFI_HII_HANDLE PackageListHandle, OUT EFI_HANDLE *DriverHandle - ) -; + ); // // EFI_HII_CONFIG_ROUTING_PROTOCOL interfaces @@ -1462,8 +1599,7 @@ HiiConfigRoutingExtractConfig ( IN CONST EFI_STRING Request, OUT EFI_STRING *Progress, OUT EFI_STRING *Results - ) -; + ); /** @@ -1474,9 +1610,9 @@ HiiConfigRoutingExtractConfig ( instance. @param Results Null-terminated Unicode string in format which has all values - filled in for the names in the Request string. - String to be allocated by the called function. - De-allocation is up to the caller. + filled in for the entirety of the current HII + database. String to be allocated by the called + function. De-allocation is up to the caller. @retval EFI_SUCCESS The Results string is filled with the values corresponding to all requested names. @@ -1492,8 +1628,7 @@ EFIAPI HiiConfigRoutingExportConfig ( IN CONST EFI_HII_CONFIG_ROUTING_PROTOCOL *This, OUT EFI_STRING *Results - ) -; + ); /** @@ -1527,8 +1662,7 @@ HiiConfigRoutingRouteConfig ( IN CONST EFI_HII_CONFIG_ROUTING_PROTOCOL *This, IN CONST EFI_STRING Configuration, OUT EFI_STRING *Progress - ) -; + ); @@ -1580,8 +1714,7 @@ HiiBlockToConfig ( IN CONST UINTN BlockSize, OUT EFI_STRING *Config, OUT EFI_STRING *Progress - ) -; + ); /** @@ -1602,8 +1735,9 @@ HiiBlockToConfig ( (see below) is returned. @param BlockSize The length of the Block in units of UINT8. On input, this is the size of the Block. On output, - if successful, contains the index of the last - modified byte in the Block. + if successful, contains the largest index of the + modified byte in the Block, or the required buffer + size if the Block is not large enough. @param Progress On return, points to an element of the ConfigResp string filled in with the offset of the most recent '&' before the first failing name / value @@ -1628,6 +1762,8 @@ HiiBlockToConfig ( value pair. Block is left updated and Progress points at the '&' preceding the first non-. + @retval EFI_BUFFER_TOO_SMALL Block not large enough. Progress undefined. + BlockSize is updated with the required buffer size. **/ EFI_STATUS @@ -1638,8 +1774,7 @@ HiiConfigToBlock ( IN OUT UINT8 *Block, IN OUT UINTN *BlockSize, OUT EFI_STRING *Progress - ) -; + ); /** @@ -1692,15 +1827,228 @@ HiiGetAltCfg ( IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath, IN CONST UINT16 *AltCfgId, OUT EFI_STRING *AltCfgResp + ); + +/** + + This function accepts a formatted string, finds the associated + keyword owners, creates a string from it and forwards it to the + EFI_HII_ROUTING_PROTOCOL.RouteConfig function. + + If there is an issue in resolving the contents of the KeywordString, then the + function returns an error and also sets the Progress and ProgressErr with the + appropriate information about where the issue occurred and additional data about + the nature of the issue. + + In the case when KeywordString containing multiple keywords, when an EFI_NOT_FOUND + error is generated during processing the second or later keyword element, the system + storage associated with earlier keywords is not modified. All elements of the + KeywordString must successfully pass all tests for format and access prior to making + any modifications to storage. + + In the case when EFI_DEVICE_ERROR is returned from the processing of a KeywordString + containing multiple keywords, the state of storage associated with earlier keywords + is undefined. + + + @param This Pointer to the EFI_KEYWORD_HANDLER _PROTOCOL instance. + + @param KeywordString A null-terminated string in format. + + @param Progress On return, points to a character in the KeywordString. + Points to the string's NULL terminator if the request + was successful. Points to the most recent '&' before + the first failing name / value pair (or the beginning + of the string if the failure is in the first name / value + pair) if the request was not successful. + + @param ProgressErr If during the processing of the KeywordString there was + a failure, this parameter gives additional information + about the possible source of the problem. The various + errors are defined in "Related Definitions" below. + + + @retval EFI_SUCCESS The specified action was completed successfully. + + @retval EFI_INVALID_PARAMETER One or more of the following are TRUE: + 1. KeywordString is NULL. + 2. Parsing of the KeywordString resulted in an + error. See Progress and ProgressErr for more data. + + @retval EFI_NOT_FOUND An element of the KeywordString was not found. + See ProgressErr for more data. + + @retval EFI_OUT_OF_RESOURCES Required system resources could not be allocated. + See ProgressErr for more data. + + @retval EFI_ACCESS_DENIED The action violated system policy. See ProgressErr + for more data. + + @retval EFI_DEVICE_ERROR An unexpected system error occurred. See ProgressErr + for more data. + +**/ +EFI_STATUS +EFIAPI +EfiConfigKeywordHandlerSetData ( + IN EFI_CONFIG_KEYWORD_HANDLER_PROTOCOL *This, + IN CONST EFI_STRING KeywordString, + OUT EFI_STRING *Progress, + OUT UINT32 *ProgressErr + ); + +/** + + This function accepts a formatted string, finds the underlying + keyword owners, creates a string from it and forwards it to the + EFI_HII_ROUTING_PROTOCOL.ExtractConfig function. + + If there is an issue in resolving the contents of the KeywordString, then the function + returns an EFI_INVALID_PARAMETER and also set the Progress and ProgressErr with the + appropriate information about where the issue occurred and additional data about the + nature of the issue. + + In the case when KeywordString is NULL, or contains multiple keywords, or when + EFI_NOT_FOUND is generated while processing the keyword elements, the Results string + contains values returned for all keywords processed prior to the keyword generating the + error but no values for the keyword with error or any following keywords. + + + @param This Pointer to the EFI_KEYWORD_HANDLER _PROTOCOL instance. + + @param NameSpaceId A null-terminated string containing the platform configuration + language to search through in the system. If a NULL is passed + in, then it is assumed that any platform configuration language + with the prefix of "x-UEFI-" are searched. + + @param KeywordString A null-terminated string in format. If a + NULL is passed in the KeywordString field, all of the known + keywords in the system for the NameSpaceId specified are + returned in the Results field. + + @param Progress On return, points to a character in the KeywordString. Points + to the string's NULL terminator if the request was successful. + Points to the most recent '&' before the first failing name / value + pair (or the beginning of the string if the failure is in the first + name / value pair) if the request was not successful. + + @param ProgressErr If during the processing of the KeywordString there was a + failure, this parameter gives additional information about the + possible source of the problem. See the definitions in SetData() + for valid value definitions. + + @param Results A null-terminated string in format is returned + which has all the values filled in for the keywords in the + KeywordString. This is a callee-allocated field, and must be freed + by the caller after being used. + + @retval EFI_SUCCESS The specified action was completed successfully. + + @retval EFI_INVALID_PARAMETER One or more of the following are TRUE: + 1.Progress, ProgressErr, or Resuts is NULL. + 2.Parsing of the KeywordString resulted in an error. See + Progress and ProgressErr for more data. + + + @retval EFI_NOT_FOUND An element of the KeywordString was not found. See + ProgressErr for more data. + + @retval EFI_NOT_FOUND The NamespaceId specified was not found. See ProgressErr + for more data. + + @retval EFI_OUT_OF_RESOURCES Required system resources could not be allocated. See + ProgressErr for more data. + + @retval EFI_ACCESS_DENIED The action violated system policy. See ProgressErr for + more data. + + @retval EFI_DEVICE_ERROR An unexpected system error occurred. See ProgressErr + for more data. + +**/ +EFI_STATUS +EFIAPI +EfiConfigKeywordHandlerGetData ( + IN EFI_CONFIG_KEYWORD_HANDLER_PROTOCOL *This, + IN CONST EFI_STRING NameSpaceId, OPTIONAL + IN CONST EFI_STRING KeywordString, OPTIONAL + OUT EFI_STRING *Progress, + OUT UINT32 *ProgressErr, + OUT EFI_STRING *Results + ); + +/** + Compare whether two names of languages are identical. + + @param Language1 Name of language 1 from StringPackage + @param Language2 Name of language 2 to be compared with language 1. + + @retval TRUE same + @retval FALSE not same + +**/ +BOOLEAN +HiiCompareLanguage ( + IN CHAR8 *Language1, + IN CHAR8 *Language2 ) ; +/** + Retrieves a pointer to the a Null-terminated ASCII string containing the list + of languages that an HII handle in the HII Database supports. The returned + string is allocated using AllocatePool(). The caller is responsible for freeing + the returned string using FreePool(). The format of the returned string follows + the language format assumed the HII Database. + + If HiiHandle is NULL, then ASSERT(). + + @param[in] HiiHandle A handle that was previously registered in the HII Database. + + @retval NULL HiiHandle is not registered in the HII database + @retval NULL There are not enough resources available to retrieve the suported + languages. + @retval NULL The list of suported languages could not be retrieved. + @retval Other A pointer to the Null-terminated ASCII string of supported languages. + +**/ +CHAR8 * +GetSupportedLanguages ( + IN EFI_HII_HANDLE HiiHandle + ); + +/** +This function mainly use to get HiiDatabase information. + +@param This A pointer to the EFI_HII_DATABASE_PROTOCOL instance. + +@retval EFI_SUCCESS Get the information successfully. +@retval EFI_OUT_OF_RESOURCES Not enough memory to store the Hiidatabase data. + +**/ +EFI_STATUS +HiiGetDatabaseInfo( + IN CONST EFI_HII_DATABASE_PROTOCOL *This + ); + +/** +This is an internal function,mainly use to get and update configuration settings information. + +@param This A pointer to the EFI_HII_DATABASE_PROTOCOL instance. + +@retval EFI_SUCCESS Get the information successfully. +@retval EFI_OUT_OF_RESOURCES Not enough memory to store the Configuration Setting data. + +**/ +EFI_STATUS +HiiGetConfigurationSetting( + IN CONST EFI_HII_DATABASE_PROTOCOL *This + ); // // Global variables // extern EFI_EVENT gHiiKeyboardLayoutChanged; - -#include "R8Lib.h" +extern BOOLEAN gExportAfterReadyToBoot; #endif