From 7d582d6b499ed30268da033cc17fbde6e7b02a9d Mon Sep 17 00:00:00 2001 From: qwang12 Date: Mon, 21 Jan 2008 14:41:31 +0000 Subject: [PATCH] UEFI HII: Merge UEFI HII support changes from branch. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@4600 6f19259b-4bc3-4df7-8a09-765794883524 --- MdePkg/Include/Library/GraphicsLib.h | 110 +- MdePkg/Include/Library/HiiLib.h | 162 +- MdePkg/Include/Library/IfrSupportLib.h | 1468 ++++++-------- MdePkg/Include/Library/MemoryAllocationLib.h | 6 + MdePkg/Include/Protocol/DevicePath.h | 6 +- MdePkg/Include/Protocol/FormBrowser2.h | 30 +- MdePkg/Include/Protocol/HiiConfigAccess.h | 8 +- MdePkg/Include/Protocol/HiiConfigRouting.h | 61 +- MdePkg/Include/Protocol/HiiDatabase.h | 1731 +---------------- MdePkg/Include/Protocol/HiiFont.h | 18 +- MdePkg/Include/Protocol/HiiImage.h | 41 +- MdePkg/Include/Protocol/HiiString.h | 43 +- MdePkg/Include/Uefi/UefiBaseType.h | 1 - .../Uefi/UefiInternalFormRepresentation.h | 1693 +++++++++++++--- .../MemoryAllocationLib.c | 14 + MdePkg/Library/HiiLib/HiiLib.c | 780 +++++++- MdePkg/Library/HiiLib/HiiLib.inf | 25 +- MdePkg/Library/HiiLib/InternalHiiLib.h | 20 + .../MemoryAllocationLib.c | 13 + MdePkg/MdePkg.dec | 26 +- MdePkg/MdePkg.dsc | 3 +- 21 files changed, 3252 insertions(+), 3007 deletions(-) create mode 100644 MdePkg/Library/HiiLib/InternalHiiLib.h diff --git a/MdePkg/Include/Library/GraphicsLib.h b/MdePkg/Include/Library/GraphicsLib.h index f503561708..c9fa564a8c 100644 --- a/MdePkg/Include/Library/GraphicsLib.h +++ b/MdePkg/Include/Library/GraphicsLib.h @@ -22,18 +22,18 @@ Return the graphics image file named FileNameGuid into Image and return it's size in ImageSize. All Firmware Volumes (FV) in the system are searched for the file name. - - @param[in] FileNameGuid File Name of graphics file in the FV(s). + + @param[in] FileNameGuid File Name of graphics file in the FV(s). @param[out] Image Pointer to pointer to return graphics image. If NULL, a - buffer will be allocated. + buffer will be allocated. @param[out] ImageSize Size of the graphics Image in bytes. Zero if no image found. - - @retval EFI_INVALID_PARAMETER invalid parameter + + @retval EFI_INVALID_PARAMETER invalid parameter @retval EFI_UNSUPPORTED Range can not be erased @retval EFI_SUCCESS Image and ImageSize are valid. @retval EFI_BUFFER_TOO_SMALL Image not big enough. ImageSize has required size @retval EFI_NOT_FOUND FileNameGuid not found - + **/ EFI_STATUS GetGraphicsBitMapFromFV ( @@ -42,23 +42,50 @@ GetGraphicsBitMapFromFV ( OUT UINTN *ImageSize ); +/** + Return the graphics image file named FileNameGuid into Image and return it's + size in ImageSize. All Firmware Volumes (FV) in the system are searched for the + file name. + + @param[in] ImageHandle The driver image handle of the caller. The parameter is used to + optimize the loading of the image file so that the FV from which + the driver image is loaded will be tried first. + @param[in] FileNameGuid File Name of graphics file in the FV(s). + @param[out] Image Pointer to pointer to return graphics image. If NULL, a + buffer will be allocated. + @param[out] ImageSize Size of the graphics Image in bytes. Zero if no image found. + + @retval EFI_INVALID_PARAMETER invalid parameter + @retval EFI_UNSUPPORTED Range can not be erased + @retval EFI_SUCCESS Image and ImageSize are valid. + @retval EFI_BUFFER_TOO_SMALL Image not big enough. ImageSize has required size + @retval EFI_NOT_FOUND FileNameGuid not found + +**/ +EFI_STATUS +GetGraphicsBitMapFromFVEx ( + IN EFI_HANDLE ImageHandle, + IN EFI_GUID *FileNameGuid, + OUT VOID **Image, + OUT UINTN *ImageSize + ); /** Convert a *.BMP graphics image to a UGA blt buffer. If a NULL UgaBlt buffer is passed in a UgaBlt buffer will be allocated by this routine. If a UgaBlt buffer is passed in it will be used if it is big enough. - - @param[in] BmpImage Pointer to BMP file - @param[in] BmpImageSize Number of bytes in BmpImage - @param[in,out] UgaBlt Buffer containing UGA version of BmpImage. - @param[in,out] UgaBltSize Size of UgaBlt in bytes. - @param[out] PixelHeight Height of UgaBlt/BmpImage in pixels - @param[out] PixelWidth Width of UgaBlt/BmpImage in pixels - + + @param[in] BmpImage Pointer to BMP file + @param[in] BmpImageSize Number of bytes in BmpImage + @param[in,out] UgaBlt Buffer containing UGA version of BmpImage. + @param[in,out] UgaBltSize Size of UgaBlt in bytes. + @param[out] PixelHeight Height of UgaBlt/BmpImage in pixels + @param[out] PixelWidth Width of UgaBlt/BmpImage in pixels + @retval EFI_SUCCESS UgaBlt and UgaBltSize are returned. @retval EFI_UNSUPPORTED BmpImage is not a valid *.BMP image @retval EFI_BUFFER_TOO_SMALL The passed in UgaBlt buffer is not big enough. - UgaBltSize will contain the required size. + UgaBltSize will contain the required size. **/ EFI_STATUS ConvertBmpToUgaBlt ( @@ -74,9 +101,9 @@ ConvertBmpToUgaBlt ( /** Use Console Control to turn off UGA based Simple Text Out consoles from going to the UGA device. Put up LogoFile on every UGA device that is a console - - @param[in] LogoFile File name of logo to display on the center of the screen. - + + @param[in] LogoFile File name of logo to display on the center of the screen. + @retval EFI_SUCCESS ConsoleControl has been flipped to graphics and logo displayed. @retval EFI_UNSUPPORTED Logo not found @@ -86,11 +113,30 @@ EnableQuietBoot ( IN EFI_GUID *LogoFile ); +/** + Use Console Control to turn off GOP/UGA based Simple Text Out consoles from going + to the UGA device. Put up LogoFile on every UGA device that is a console + + @param LogoFile File name of logo to display on the center of the screen. + @param ImageHandle The driver image handle of the caller. The parameter is used to + optimize the loading of the logo file so that the FV from which + the driver image is loaded will be tried first. + + @retval EFI_SUCCESS ConsoleControl has been flipped to graphics and logo displayed. + @retval EFI_UNSUPPORTED Logo not found + +**/ +EFI_STATUS +EnableQuietBootEx ( + IN EFI_GUID *LogoFile, + IN EFI_HANDLE ImageHandle + ); + /** Use Console Control to turn on UGA based Simple Text Out consoles. The UGA Simple Text Out screens will now be synced up with all non UGA output devices - + @retval EFI_SUCCESS UGA devices are back in text mode and synced up. **/ @@ -105,9 +151,9 @@ DisableQuietBoot ( This is the ConInHandle and ConIn handle in the EFI system table. All key presses will be ignored until the Password is typed in. The only way to disable the password is to type it in to a ConIn device. - - @param[in] Password Password used to lock ConIn device. - + + @param[in] Password Password used to lock ConIn device. + @retval EFI_SUCCESS ConsoleControl has been flipped to graphics and logo displayed. @retval EFI_UNSUPPORTED Password not found @@ -120,16 +166,16 @@ LockKeyboards ( /** - Print to graphics screen at the given X,Y coordinates of the graphics screen. - see definition of Print to find rules for constructing Fmt. - - @param[in] X Row to start printing at - @param[in] Y Column to start printing at - @param[in] Foreground Foreground color - @param[in] Background background color - @param[in] Fmt Print format sting. See definition of Print - @param[in] ... Argumnet stream defined by Fmt string - + Print to graphics screen at the given X,Y coordinates of the graphics screen. + see definition of Print to find rules for constructing Fmt. + + @param[in] X Row to start printing at + @param[in] Y Column to start printing at + @param[in] Foreground Foreground color + @param[in] Background background color + @param[in] Fmt Print format sting. See definition of Print + @param[in] ... Argumnet stream defined by Fmt string + @retval UINTN Number of Characters printed **/ diff --git a/MdePkg/Include/Library/HiiLib.h b/MdePkg/Include/Library/HiiLib.h index c32ad6d64d..dc557af31b 100644 --- a/MdePkg/Include/Library/HiiLib.h +++ b/MdePkg/Include/Library/HiiLib.h @@ -15,29 +15,165 @@ #ifndef __HII_LIB_H__ #define __HII_LIB_H__ -#error "UEFI 2.1 HII is not fully implemented for now, Please don't include this file now." +//#include -#include +// +// Limited buffer size recommended by RFC4646 (4.3. Length Considerations) +// (42 characters plus a NULL terminator) +// +#define RFC_3066_ENTRY_SIZE (42 + 1) /** - This function allocates pool for an EFI_HII_PACKAGES structure - with enough space for the variable argument list of package pointers. - The allocated structure is initialized using NumberOfPackages, Guid, - and the variable length argument list of package pointers. + This function allocates pool for an EFI_HII_PACKAGE_LIST structure + with additional space that is big enough to host all packages described by the variable + argument list of package pointers. The allocated structure is initialized using NumberOfPackages, + GuidId, and the variable length argument list of package pointers. - @param NumberOfPackages The number of HII packages to prepare. - @param Guid Package GUID. + Then, EFI_HII_PACKAGE_LIST will be register to the default System HII Database. The + Handle to the newly registered Package List is returned throught HiiHandle. + + @param NumberOfPackages The number of HII packages to register. + @param GuidId Package List GUID ID. + @param HiiHandle The ID used to retrieve the Package List later. + @param ... The variable argument list describing all HII Package. @return The allocated and initialized packages. **/ -EFI_HII_PACKAGE_LIST_HEADER * + +EFI_STATUS EFIAPI -PreparePackages ( - IN CONST UINTN NumberOfPackages, - IN CONST EFI_GUID *Guid OPTIONAL, +HiiLibAddPackagesToHiiDatabase ( + IN UINTN NumberOfPackages, + IN CONST EFI_GUID *GuidId, + IN EFI_HANDLE DriverHandle, OPTIONAL + OUT EFI_HII_HANDLE *HiiHandle, OPTIONAL ... - ); + ) +; + +EFI_STATUS +EFIAPI +HiiLibAddFontPackageToHiiDatabase ( + IN UINTN FontSize, + IN CONST UINT8 *FontBinary, + IN CONST EFI_GUID *GuidId, + OUT EFI_HII_HANDLE *HiiHandle OPTIONAL + ) +; + +EFI_STATUS +EFIAPI +HiiLibRemovePackagesFromHiiDatabase ( + IN EFI_HII_HANDLE HiiHandle + ) +; + +/** + This function adds the string into String Package of each language. + + @param PackageList Handle of the package list where this string will + be added. + @param StringId On return, contains the new strings id, which is + unique within PackageList. + @param String Points to the new null-terminated string. + + @retval EFI_SUCCESS The new string was added successfully. + @retval EFI_NOT_FOUND The specified PackageList could not be found in + database. + @retval EFI_OUT_OF_RESOURCES Could not add the string due to lack of resources. + @retval EFI_INVALID_PARAMETER String is NULL or StringId is NULL is NULL. + +**/ +EFI_STATUS +EFIAPI +HiiLibCreateString ( + IN EFI_HII_HANDLE PackageList, + OUT EFI_STRING_ID *StringId, + IN CONST EFI_STRING String + ) +; + +/** + This function update the specified string in String Package of each language. + + @param PackageList Handle of the package list where this string will + be added. + @param StringId Ths String Id to be updated. + @param String Points to the new null-terminated string. + + @retval EFI_SUCCESS The new string was added successfully. + @retval EFI_NOT_FOUND The specified PackageList could not be found in + database. + @retval EFI_OUT_OF_RESOURCES Could not add the string due to lack of resources. + @retval EFI_INVALID_PARAMETER String is NULL or StringId is NULL is NULL. + +**/ +EFI_STATUS +EFIAPI +HiiLibUpdateString ( + IN EFI_HII_HANDLE PackageList, + IN EFI_STRING_ID StringId, + IN CONST EFI_STRING String + ) +; + + + +// +// Just use the UEFI prototype +// +EFI_STATUS +EFIAPI +HiiLibGetStringFromGuidId ( + IN EFI_GUID *ProducerGuid, + IN EFI_STRING_ID StringId, + OUT EFI_STRING *String + ) +; + +// +// This function is Implementation Specifc. HII_VENDOR_DEVICE_PATH +// This should be moved to MdeModulepkg. +// +EFI_STATUS +EFIAPI +HiiLibCreateHiiDriverHandle ( + OUT EFI_HANDLE *DriverHandle + ) +; + +EFI_STATUS +EFIAPI +HiiLibDestroyHiiDriverHandle ( + IN EFI_HANDLE DriverHandle + ) +; + + +EFI_STATUS +HiiLibExtractClassFromHiiHandle ( + IN EFI_HII_HANDLE Handle, + OUT UINT16 *Class, + OUT EFI_STRING_ID *FormSetTitle, + OUT EFI_STRING_ID *FormSetHelp + ) +/*++ + +Routine Description: + Extract formset class for given HII handle. + +Arguments: + HiiHandle - Hii handle + Class - Class of the formset + FormSetTitle - Formset title string + FormSetHelp - Formset help string + +Returns: + EFI_SUCCESS - Successfully extract Class for specified Hii handle. + +--*/ +; #endif diff --git a/MdePkg/Include/Library/IfrSupportLib.h b/MdePkg/Include/Library/IfrSupportLib.h index 4ef638a954..0b54a8eb9b 100644 --- a/MdePkg/Include/Library/IfrSupportLib.h +++ b/MdePkg/Include/Library/IfrSupportLib.h @@ -1,1265 +1,1031 @@ -/** @file +/*++ + +Copyright (c) 2007, 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 + +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: + + UefiIfrLibrary.h + +Abstract: + The file contain all library function for Ifr Operations. - - Copyright (c) 2006 - 2007, 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 - THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, - WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +--*/ + +#ifndef _IFRLIBRARY_H +#define _IFRLIBRARY_H + + +#include +#include +#include +#include +#include +#include +#include +#include -**/ +#include -#ifndef __IFRSUPPORTLIBRARY_H__ -#define __IFRSUPPORTLIBRARY_H__ +#define IFR_LIB_DEFAULT_STRING_SIZE 0x200 -#error "UEFI 2.1 HII is not fully implemented for now, Please don't include this file now." +// +// The architectural variable "Lang" and "LangCodes" are deprecated in UEFI +// specification. While, UEFI specification also states that these deprecated +// variables may be provided for backwards compatibility. +// If "LANG_SUPPORT" is defined, "Lang" and "LangCodes" will be produced; +// If "LANG_SUPPORT" is undefined, "Lang" and "LangCodes" will not be produced. +// +#define LANG_SUPPORT -#define DEFAULT_FORM_BUFFER_SIZE 0xFFFF -#define DEFAULT_STRING_BUFFER_SIZE 0xFFFF +#define EFI_LANGUAGE_VARIABLE L"Lang" +#define EFI_LANGUAGE_CODES_VARIABLE L"LangCodes" + +#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) +// +#define RFC_3066_ENTRY_SIZE (42 + 1) +#define ISO_639_2_ENTRY_SIZE 3 + +#define INVALID_VARSTORE_ID 0 + +#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 { - CHAR16 *OptionString; // Passed in string to generate a token for in a truly dynamic form creation - STRING_REF StringToken; // This is used when creating a single op-code without generating a StringToken (have one already) - UINT16 Value; - UINT8 Flags; - UINT16 Key; + EFI_STRING_ID StringToken; + EFI_IFR_TYPE_VALUE Value; + UINT8 Flags; } IFR_OPTION; #pragma pack() +typedef struct { + // + // Buffer size allocated for Data. + // + UINT32 BufferSize; + + // + // Offset in Data to append the newly created opcode binary. + // It will be adjusted automatically in Create***OpCode(), and should be + // initialized to 0 before invocation of a serial of Create***OpCode() + // + UINT32 Offset; + + // + // The destination buffer for created op-codes + // + UINT8 *Data; +} EFI_HII_UPDATE_DATA; + + +// +// Exported Library functions +// EFI_STATUS -GetCurrentLanguage ( - OUT CHAR16 *Lang +CreateEndOpCode ( + IN OUT EFI_HII_UPDATE_DATA *Data ) /*++ Routine Description: + Create EFI_IFR_END_OP opcode. - Determine what is the current language setting - Arguments: + Data - Destination for the created opcode binary - Lang - Pointer of system language - -Returns: - - Status code +Returns: + EFI_SUCCESS - Opcode create success --*/ ; EFI_STATUS -AddString ( - IN VOID *StringBuffer, - IN CHAR16 *Language, - IN CHAR16 *String, - IN OUT STRING_REF *StringToken +CreateDefaultOpCode ( + IN EFI_IFR_TYPE_VALUE *Value, + IN UINT8 Type, + IN OUT EFI_HII_UPDATE_DATA *Data ) /*++ Routine Description: + Create EFI_IFR_DEFAULT_OP opcode. - Add a string to the incoming buffer and return the token and offset data - Arguments: + Value - Value for the default + Type - Type for the default + Data - Destination for the created opcode binary - StringBuffer - The incoming buffer - - Language - Currrent language - - String - The string to be added - - StringToken - The index where the string placed - -Returns: - - EFI_OUT_OF_RESOURCES - No enough buffer to allocate - - EFI_SUCCESS - String successfully added to the incoming buffer +Returns: + EFI_SUCCESS - Opcode create success --*/ ; EFI_STATUS -AddOpCode ( - IN VOID *FormBuffer, - IN OUT VOID *OpCodeData +CreateActionOpCode ( + IN EFI_QUESTION_ID QuestionId, + IN EFI_STRING_ID Prompt, + IN EFI_STRING_ID Help, + IN UINT8 QuestionFlags, + IN EFI_STRING_ID QuestionConfig, + IN OUT EFI_HII_UPDATE_DATA *Data ) /*++ Routine Description: + Create EFI_IFR_ACTION_OP opcode. - Add op-code data to the FormBuffer - Arguments: + QuestionId - Question ID + Prompt - String ID for Prompt + Help - String ID for Help + QuestionFlags - Flags in Question Header + QuestionConfig - String ID for configuration + Data - Destination for the created opcode binary - FormBuffer - Form buffer to be inserted to - - OpCodeData - Op-code data to be inserted - -Returns: - - EFI_OUT_OF_RESOURCES - No enough buffer to allocate - - EFI_SUCCESS - Op-code data successfully inserted +Returns: + EFI_SUCCESS - Opcode create success --*/ ; EFI_STATUS -CreateFormSet ( - IN CHAR16 *FormSetTitle, - IN EFI_GUID *Guid, - IN UINT8 Class, - IN UINT8 SubClass, - IN OUT VOID **FormBuffer, - IN OUT VOID **StringBuffer +CreateSubTitleOpCode ( + IN EFI_STRING_ID Prompt, + IN EFI_STRING_ID Help, + IN UINT8 Flags, + IN UINT8 Scope, + IN OUT EFI_HII_UPDATE_DATA *Data ) /*++ Routine Description: + Create EFI_IFR_SUBTITLE_OP opcode. - Create a formset - Arguments: + Prompt - String ID for Prompt + Help - String ID for Help + Flags - Subtitle opcode flags + Scope - Subtitle Scope bit + Data - Destination for the created opcode binary - FormSetTitle - Title of formset - - Guid - Guid of formset - - Class - Class of formset - - SubClass - Sub class of formset - - FormBuffer - Pointer of the formset created - - StringBuffer - Pointer of FormSetTitile string created - -Returns: - - EFI_OUT_OF_RESOURCES - No enough buffer to allocate - - EFI_SUCCESS - Formset successfully created +Returns: + EFI_SUCCESS - Opcode create success --*/ ; EFI_STATUS -CreateForm ( - IN CHAR16 *FormTitle, - IN UINT16 FormId, - IN OUT VOID *FormBuffer, - IN OUT VOID *StringBuffer +CreateTextOpCode ( + IN EFI_STRING_ID Prompt, + IN EFI_STRING_ID Help, + IN EFI_STRING_ID TextTwo, + IN OUT EFI_HII_UPDATE_DATA *Data ) /*++ Routine Description: + Create EFI_IFR_TEXT_OP opcode. - Create a form - Arguments: + Prompt - String ID for Prompt + Help - String ID for Help + TextTwo - String ID for text two + Data - Destination for the created opcode binary - FormTitle - Title of the form - - FormId - Id of the form - - FormBuffer - Pointer of the form created - - StringBuffer - Pointer of FormTitil string created - -Returns: - - EFI_SUCCESS - Form successfully created +Returns: + EFI_SUCCESS - Opcode create success --*/ ; EFI_STATUS -CreateSubTitle ( - IN CHAR16 *SubTitle, - IN OUT VOID *FormBuffer, - IN OUT VOID *StringBuffer +CreateGotoOpCode ( + IN EFI_FORM_ID FormId, + IN EFI_STRING_ID Prompt, + IN EFI_STRING_ID Help, + IN UINT8 QuestionFlags, + IN EFI_QUESTION_ID QuestionId, + IN OUT EFI_HII_UPDATE_DATA *Data ) /*++ Routine Description: + Create EFI_IFR_REF_OP opcode. - Create a SubTitle - Arguments: + FormId - Destination Form ID + Prompt - String ID for Prompt + Help - String ID for Help + QuestionFlags - Flags in Question Header + QuestionId - Question ID + Data - Destination for the created opcode binary - SubTitle - Sub title to be created - - FormBuffer - Where this subtitle to add to - - StringBuffer - String buffer created for subtitle - -Returns: - - EFI_SUCCESS - Subtitle successfully created +Returns: + EFI_SUCCESS - Opcode create success --*/ ; EFI_STATUS -CreateText ( - IN CHAR16 *String, - IN CHAR16 *String2, - IN CHAR16 *String3, - IN UINT8 Flags, - IN UINT16 Key, - IN OUT VOID *FormBuffer, - IN OUT VOID *StringBuffer +CreateOneOfOptionOpCode ( + IN UINTN OptionCount, + IN IFR_OPTION *OptionsList, + IN UINT8 Type, + IN OUT EFI_HII_UPDATE_DATA *Data + ) +; + +EFI_STATUS +CreateOneOfOpCode ( + IN EFI_QUESTION_ID QuestionId, + IN EFI_VARSTORE_ID VarStoreId, + IN UINT16 VarOffset, + IN EFI_STRING_ID Prompt, + IN EFI_STRING_ID Help, + IN UINT8 QuestionFlags, + IN UINT8 OneOfFlags, + IN IFR_OPTION *OptionsList, + IN UINTN OptionCount, + IN OUT EFI_HII_UPDATE_DATA *Data ) /*++ Routine Description: + Create EFI_IFR_ONE_OF_OP opcode. - Create a line of text - Arguments: + QuestionId - Question ID + VarStoreId - Storage ID + VarOffset - Offset in Storage + Prompt - String ID for Prompt + Help - String ID for Help + QuestionFlags - Flags in Question Header + OneOfFlags - Flags for oneof opcode + OptionsList - List of options + OptionCount - Number of options in option list + Data - Destination for the created opcode binary - String - First string of the text - - String2 - Second string of the text - - String3 - Help string of the text - - Flags - Flag of the text - - Key - Key of the text - - FormBuffer - The form where this text adds to - - StringBuffer - String buffer created for String, String2 and String3 - -Returns: - - EFI_SUCCESS - Text successfully created +Returns: + EFI_SUCCESS - Opcode create success --*/ ; EFI_STATUS -CreateGoto ( - IN UINT16 FormId, - IN CHAR16 *Prompt, - IN OUT VOID *FormBuffer, - IN OUT VOID *StringBuffer +CreateOrderedListOpCode ( + IN EFI_QUESTION_ID QuestionId, + IN EFI_VARSTORE_ID VarStoreId, + IN UINT16 VarOffset, + IN EFI_STRING_ID Prompt, + IN EFI_STRING_ID Help, + IN UINT8 QuestionFlags, + IN UINT8 Flags, + IN UINT8 DataType, + IN UINT8 MaxContainers, + IN IFR_OPTION *OptionsList, + IN UINTN OptionCount, + IN OUT EFI_HII_UPDATE_DATA *Data ) /*++ Routine Description: + Create EFI_IFR_ORDERED_LIST_OP opcode. - Create a hyperlink - Arguments: + QuestionId - Question ID + VarStoreId - Storage ID + VarOffset - Offset in Storage + Prompt - String ID for Prompt + Help - String ID for Help + QuestionFlags - Flags in Question Header + Flags - Flags for ordered list opcode + DataType - Type for option value + MaxContainers - Maximum count for options in this ordered list + OptionsList - List of options + OptionCount - Number of options in option list + Data - Destination for the created opcode binary - FormId - Form ID of the hyperlink - - Prompt - Prompt of the hyperlink - - FormBuffer - The form where this hyperlink adds to - - StringBuffer - String buffer created for Prompt - -Returns: - - EFI_SUCCESS - Hyperlink successfully created +Returns: + EFI_SUCCESS - Opcode create success --*/ ; EFI_STATUS -CreateOneOf ( - IN UINT16 QuestionId, - IN UINT8 DataWidth, - IN CHAR16 *Prompt, - IN CHAR16 *Help, - IN IFR_OPTION *OptionsList, - IN UINTN OptionCount, - IN OUT VOID *FormBuffer, - IN OUT VOID *StringBuffer +CreateCheckBoxOpCode ( + IN EFI_QUESTION_ID QuestionId, + IN EFI_VARSTORE_ID VarStoreId, + IN UINT16 VarOffset, + IN EFI_STRING_ID Prompt, + IN EFI_STRING_ID Help, + IN UINT8 QuestionFlags, + IN UINT8 CheckBoxFlags, + IN OUT EFI_HII_UPDATE_DATA *Data ) /*++ Routine Description: + Create EFI_IFR_CHECKBOX_OP opcode. - Create a one-of question with a set of options to choose from. The - OptionsList is a pointer to a null-terminated list of option descriptions. - Arguments: + QuestionId - Question ID + VarStoreId - Storage ID + VarOffset - Offset in Storage + Prompt - String ID for Prompt + Help - String ID for Help + QuestionFlags - Flags in Question Header + CheckBoxFlags - Flags for checkbox opcode + Data - Destination for the created opcode binary - QuestionId - Question ID of the one-of box - - DataWidth - DataWidth of the one-of box - - Prompt - Prompt of the one-of box - - Help - Help of the one-of box - - OptionsList - Each string in it is an option of the one-of box - - OptionCount - Option string count - - FormBuffer - The form where this one-of box adds to - - StringBuffer - String buffer created for Prompt, Help and Option strings - -Returns: - - EFI_DEVICE_ERROR - DataWidth > 2 - - EFI_SUCCESS - One-Of box successfully created. +Returns: + EFI_SUCCESS - Opcode create success --*/ ; EFI_STATUS -CreateOrderedList ( - IN UINT16 QuestionId, - IN UINT8 MaxEntries, - IN CHAR16 *Prompt, - IN CHAR16 *Help, - IN IFR_OPTION *OptionsList, - IN UINTN OptionCount, - IN OUT VOID *FormBuffer, - IN OUT VOID *StringBuffer +CreateNumericOpCode ( + IN EFI_QUESTION_ID QuestionId, + IN EFI_VARSTORE_ID VarStoreId, + IN UINT16 VarOffset, + IN EFI_STRING_ID Prompt, + IN EFI_STRING_ID Help, + IN UINT8 QuestionFlags, + IN UINT8 NumericFlags, + IN UINT64 Minimum, + IN UINT64 Maximum, + IN UINT64 Step, + IN UINT64 Default, + IN OUT EFI_HII_UPDATE_DATA *Data ) /*++ Routine Description: + Create EFI_IFR_NUMERIC_OP opcode. - Create a one-of question with a set of options to choose from. The - OptionsList is a pointer to a null-terminated list of option descriptions. - Arguments: + QuestionId - Question ID + VarStoreId - Storage ID + VarOffset - Offset in Storage + Prompt - String ID for Prompt + Help - String ID for Help + QuestionFlags - Flags in Question Header + NumericFlags - Flags for numeric opcode + Minimum - Numeric minimum value + Maximum - Numeric maximum value + Step - Numeric step for edit + Default - Numeric default value + Data - Destination for the created opcode binary - QuestionId - Question ID of the ordered list - - MaxEntries - MaxEntries of the ordered list - - Prompt - Prompt of the ordered list - - Help - Help of the ordered list - - OptionsList - Each string in it is an option of the ordered list - - OptionCount - Option string count - - FormBuffer - The form where this ordered list adds to - - StringBuffer - String buffer created for Prompt, Help and Option strings - -Returns: - - EFI_SUCCESS - Ordered list successfully created. +Returns: + EFI_SUCCESS - Opcode create success --*/ ; EFI_STATUS -CreateCheckBox ( - IN UINT16 QuestionId, - IN UINT8 DataWidth, - IN CHAR16 *Prompt, - IN CHAR16 *Help, - IN UINT8 Flags, - IN OUT VOID *FormBuffer, - IN OUT VOID *StringBuffer +CreateStringOpCode ( + IN EFI_QUESTION_ID QuestionId, + IN EFI_VARSTORE_ID VarStoreId, + IN UINT16 VarOffset, + IN EFI_STRING_ID Prompt, + IN EFI_STRING_ID Help, + IN UINT8 QuestionFlags, + IN UINT8 StringFlags, + IN UINT8 MinSize, + IN UINT8 MaxSize, + IN OUT EFI_HII_UPDATE_DATA *Data ) /*++ Routine Description: + Create EFI_IFR_STRING_OP opcode. - Create a checkbox - Arguments: + QuestionId - Question ID + VarStoreId - Storage ID + VarOffset - Offset in Storage + Prompt - String ID for Prompt + Help - String ID for Help + QuestionFlags - Flags in Question Header + StringFlags - Flags for string opcode + MinSize - String minimum length + MaxSize - String maximum length + Data - Destination for the created opcode binary - QuestionId - Question ID of the check box - - DataWidth - DataWidth of the check box - - Prompt - Prompt of the check box - - Help - Help of the check box - - Flags - Flags of the check box - - FormBuffer - The form where this check box adds to - - StringBuffer - String buffer created for Prompt and Help. - -Returns: - - EFI_DEVICE_ERROR - DataWidth > 1 - - EFI_SUCCESS - Check box successfully created +Returns: + EFI_SUCCESS - Opcode create success --*/ ; EFI_STATUS -CreateNumeric ( - IN UINT16 QuestionId, - IN UINT8 DataWidth, - IN CHAR16 *Prompt, - IN CHAR16 *Help, - IN UINT16 Minimum, - IN UINT16 Maximum, - IN UINT16 Step, - IN UINT16 Default, - IN UINT8 Flags, - IN UINT16 Key, - IN OUT VOID *FormBuffer, - IN OUT VOID *StringBuffer +CreateBannerOpCode ( + IN EFI_STRING_ID Title, + IN UINT16 LineNumber, + IN UINT8 Alignment, + IN OUT EFI_HII_UPDATE_DATA *Data ) /*++ Routine Description: + Create GUIDed opcode for banner. - Create a numeric - Arguments: + Title - String ID for title + LineNumber - Line number for this banner + Alignment - Alignment for this banner, left, center or right + Data - Destination for the created opcode binary - QuestionId - Question ID of the numeric - - DataWidth - DataWidth of the numeric - - Prompt - Prompt of the numeric - - Help - Help of the numeric - - Minimum - Minumun boundary of the numeric - - Maximum - Maximum boundary of the numeric - - Step - Step of the numeric - - Default - Default value - - Flags - Flags of the numeric - - Key - Key of the numeric - - FormBuffer - The form where this numeric adds to - - StringBuffer - String buffer created for Prompt and Help. - -Returns: - - EFI_DEVICE_ERROR - DataWidth > 2 - - EFI_SUCCESS - Numeric is successfully created +Returns: + EFI_SUCCESS - Opcode create success --*/ ; -EFI_STATUS -CreateString ( - IN UINT16 QuestionId, - IN UINT8 DataWidth, - IN CHAR16 *Prompt, - IN CHAR16 *Help, - IN UINT8 MinSize, - IN UINT8 MaxSize, - IN UINT8 Flags, - IN UINT16 Key, - IN OUT VOID *FormBuffer, - IN OUT VOID *StringBuffer +EFI_HII_PACKAGE_LIST_HEADER * +PreparePackageList ( + IN UINTN NumberOfPackages, + IN EFI_GUID *GuidId, + ... ) /*++ Routine Description: + Assemble EFI_HII_PACKAGE_LIST according to the passed in packages. - Create a string - Arguments: + NumberOfPackages - Number of packages. + GuidId - Package GUID. - QuestionId - Question ID of the string - - DataWidth - DataWidth of the string - - Prompt - Prompt of the string - - Help - Help of the string - - MinSize - Min size boundary of the string - - MaxSize - Max size boundary of the string - - Flags - Flags of the string - - Key - Key of the string - - FormBuffer - The form where this string adds to - - StringBuffer - String buffer created for Prompt and Help. - -Returns: - - EFI_SUCCESS - String successfully created. +Returns: + Pointer of EFI_HII_PACKAGE_LIST_HEADER. --*/ ; -EFI_STATUS -ExtractDataFromHiiHandle ( - IN EFI_HII_HANDLE HiiHandle, - IN OUT UINT16 *ImageLength, - OUT UINT8 *DefaultImage, - OUT EFI_GUID *Guid +EFI_HII_HANDLE +DevicePathToHiiHandle ( + IN EFI_HII_DATABASE_PROTOCOL *HiiDatabase, + IN EFI_DEVICE_PATH_PROTOCOL *DevicePath ) /*++ Routine Description: + Find HII Handle associated with given Device Path. - Extract information pertaining to the HiiHandle - Arguments: + HiiDatabase - Point to EFI_HII_DATABASE_PROTOCOL instance. + DevicePath - Device Path associated with the HII package list handle. + +Returns: + Handle - HII package list Handle associated with the Device Path. + NULL - Hii Package list handle is not found. - HiiHandle - Hii handle - - ImageLength - For input, length of DefaultImage; - For output, length of actually required - - DefaultImage - Image buffer prepared by caller - - Guid - Guid information about the form - -Returns: - - EFI_OUT_OF_RESOURCES - No enough buffer to allocate - - EFI_BUFFER_TOO_SMALL - DefualtImage has no enough ImageLength - - EFI_SUCCESS - Successfully extract data from Hii database. - - --*/ ; -EFI_HII_HANDLE -FindHiiHandle ( - IN OUT EFI_HII_PROTOCOL **HiiProtocol, OPTIONAL - IN EFI_GUID *Guid +EFI_STATUS +ExtractDefault( + IN VOID *Buffer, + IN UINTN *BufferSize, + UINTN Number, + ... ) /*++ -Routine Description: - Finds HII handle for given pack GUID previously registered with the HII. + Routine Description: + Configure the buffer accrording to ConfigBody strings. -Arguments: - HiiProtocol - pointer to pointer to HII protocol interface. - If NULL, the interface will be found but not returned. - If it points to NULL, the interface will be found and - written back to the pointer that is pointed to. - Guid - The GUID of the pack that registered with the HII. + Arguments: + DefaultId - the ID of default. + Buffer - the start address of buffer. + BufferSize - the size of buffer. + Number - the number of the strings. -Returns: - Handle to the HII pack previously registered by the memory driver. + Returns: + EFI_BUFFER_TOO_SMALL - the BufferSize is too small to operate. + EFI_INVALID_PARAMETER - Buffer is NULL or BufferSize is 0. + EFI_SUCCESS - Operation successful. --*/ ; EFI_STATUS -CreateSubTitleOpCode ( - IN STRING_REF StringToken, - IN OUT VOID *FormBuffer +ExtractGuidFromHiiHandle ( + IN EFI_HII_HANDLE Handle, + OUT EFI_GUID *Guid ) /*++ Routine Description: + Extract Hii package list GUID for given HII handle. - Create a SubTitle opcode independent of string creation - This is used primarily by users who need to create just one particular valid op-code and the string - data will be assumed to exist in the HiiDatabase already. (Useful when exporting op-codes at a label - location to pre-defined forms in HII) - Arguments: + HiiHandle - Hii handle + Guid - Package list GUID - StringToken - StringToken of the subtitle - - FormBuffer - Output of subtitle as a form - -Returns: - - EFI_SUCCESS - Subtitle created to be a form +Returns: + EFI_SUCCESS - Successfully extract GUID from Hii database. --*/ ; EFI_STATUS -CreateTextOpCode ( - IN STRING_REF StringToken, - IN STRING_REF StringTokenTwo, - IN STRING_REF StringTokenThree, - IN UINT8 Flags, - IN UINT16 Key, - IN OUT VOID *FormBuffer +BufferToHexString ( + IN OUT CHAR16 *Str, + IN UINT8 *Buffer, + IN UINTN BufferSize ) /*++ Routine Description: + Converts binary buffer to Unicode string in reversed byte order to BufToHexString(). - Create a Text opcode independent of string creation - This is used primarily by users who need to create just one particular valid op-code and the string - data will be assumed to exist in the HiiDatabase already. (Useful when exporting op-codes at a label - location to pre-defined forms in HII) - Arguments: + Str - String for output + Buffer - Binary buffer. + BufferSize - Size of the buffer in bytes. - StringToken - First string token of the text - - StringTokenTwo - Second string token of the text - - StringTokenThree - Help string token of the text - - Flags - Flag of the text - - Key - Key of the text - - FormBuffer - Output of text as a form - -Returns: - - EFI_SUCCESS - Text created to be a form +Returns: + EFI_SUCCESS - The function completed successfully. --*/ ; EFI_STATUS -CreateGotoOpCode ( - IN UINT16 FormId, - IN STRING_REF StringToken, - IN STRING_REF StringTokenTwo, - IN UINT8 Flags, - IN UINT16 Key, - IN OUT VOID *FormBuffer +HexStringToBuffer ( + IN OUT UINT8 *Buffer, + IN OUT UINTN *BufferSize, + IN CHAR16 *Str ) /*++ Routine Description: + Converts Hex String to binary buffer in reversed byte order to HexStringToBuf(). - Create a hyperlink opcode independent of string creation - This is used primarily by users who need to create just one particular valid op-code and the string - data will be assumed to exist in the HiiDatabase already. (Useful when exporting op-codes at a label - location to pre-defined forms in HII) - Arguments: + Buffer - Pointer to buffer that receives the data. + BufferSize - Length in bytes of the buffer to hold converted data. + If routine return with EFI_SUCCESS, containing length of converted data. + If routine return with EFI_BUFFER_TOO_SMALL, containg length of buffer desired. + Str - String to be converted from. - FormId - Form ID of the hyperlink - - StringToken - Prompt string token of the hyperlink - - StringTokenTwo - Help string token of the hyperlink - - Flags - Flags of the hyperlink - - Key - Key of the hyperlink - - FormBuffer - Output of hyperlink as a form - -Returns: - - EFI_SUCCESS - Hyperlink created to be a form +Returns: + EFI_SUCCESS - The function completed successfully. --*/ ; EFI_STATUS -CreateOneOfOpCode ( - IN UINT16 QuestionId, - IN UINT8 DataWidth, - IN STRING_REF PromptToken, - IN STRING_REF HelpToken, - IN IFR_OPTION *OptionsList, - IN UINTN OptionCount, - IN OUT VOID *FormBuffer +ConstructConfigHdr ( + IN OUT CHAR16 *ConfigHdr, + IN OUT UINTN *StrBufferLen, + IN EFI_GUID *Guid, + IN CHAR16 *Name, OPTIONAL + IN EFI_HANDLE *DriverHandle ) /*++ Routine Description: + Construct using routing information GUID/NAME/PATH. - Create a one-of opcode with a set of option op-codes to choose from independent of string creation. - This is used primarily by users who need to create just one particular valid op-code and the string - data will be assumed to exist in the HiiDatabase already. (Useful when exporting op-codes at a label - location to pre-defined forms in HII) - - OptionsList is a pointer to a null-terminated list of option descriptions. Ensure that OptionsList[x].StringToken - has been filled in since this routine will not generate StringToken values. - Arguments: + ConfigHdr - Pointer to the ConfigHdr string. + StrBufferLen - On input: Length in bytes of buffer to hold the ConfigHdr string. Includes tailing '\0' character. + On output: + If return EFI_SUCCESS, containing length of ConfigHdr string buffer. + If return EFI_BUFFER_TOO_SMALL, containg length of string buffer desired. + Guid - Routing information: GUID. + Name - Routing information: NAME. + DriverHandle - Driver handle which contains the routing information: PATH. - QuestionId - Question ID of the one-of box - - DataWidth - DataWidth of the one-of box - - PromptToken - Prompt string token of the one-of box - - HelpToken - Help string token of the one-of box - - OptionsList - Each string in it is an option of the one-of box - - OptionCount - Option string count - - FormBuffer - Output of One-Of box as a form - -Returns: - - EFI_SUCCESS - One-Of box created to be a form - - EFI_DEVICE_ERROR - DataWidth > 2 +Returns: + EFI_SUCCESS - Routine success. + EFI_BUFFER_TOO_SMALL - The ConfigHdr string buffer is too small. --*/ ; -EFI_STATUS -CreateOrderedListOpCode ( - IN UINT16 QuestionId, - IN UINT8 MaxEntries, - IN STRING_REF PromptToken, - IN STRING_REF HelpToken, - IN IFR_OPTION *OptionsList, - IN UINTN OptionCount, - IN OUT VOID *FormBuffer +BOOLEAN +FindBlockName ( + IN OUT CHAR16 *String, + UINTN Offset, + UINTN Width ) /*++ Routine Description: + Search BlockName "&OFFSET=Offset&WIDTH=Width" in a string. - Create a ordered list opcode with a set of option op-codes to choose from independent of string creation. - This is used primarily by users who need to create just one particular valid op-code and the string - data will be assumed to exist in the HiiDatabase already. (Useful when exporting op-codes at a label - location to pre-defined forms in HII) - - OptionsList is a pointer to a null-terminated list of option descriptions. Ensure that OptionsList[x].StringToken - has been filled in since this routine will not generate StringToken values. - Arguments: + String - The string to be searched in. + Offset - Offset in BlockName. + Width - Width in BlockName. - QuestionId - Question ID of the ordered list - - MaxEntries - MaxEntries of the ordered list - - PromptToken - Prompt string token of the ordered list - - HelpToken - Help string token of the ordered list - - OptionsList - Each string in it is an option of the ordered list - - OptionCount - Option string count - - FormBuffer - Output of ordered list as a form - -Returns: - - EFI_SUCCESS - Ordered list created to be a form +Returns: + TRUE - Block name found. + FALSE - Block name not found. --*/ ; EFI_STATUS -CreateCheckBoxOpCode ( - IN UINT16 QuestionId, - IN UINT8 DataWidth, - IN STRING_REF PromptToken, - IN STRING_REF HelpToken, - IN UINT8 Flags, - IN UINT16 Key, - IN OUT VOID *FormBuffer +GetBrowserData ( + EFI_GUID *VariableGuid, OPTIONAL + CHAR16 *VariableName, OPTIONAL + UINTN *BufferSize, + UINT8 *Buffer ) /*++ Routine Description: + This routine is invoked by ConfigAccess.Callback() to retrived uncommitted data from Form Browser. - Create a checkbox opcode independent of string creation - This is used primarily by users who need to create just one particular valid op-code and the string - data will be assumed to exist in the HiiDatabase already. (Useful when exporting op-codes at a label - location to pre-defined forms in HII) - Arguments: + VariableGuid - An optional field to indicate the target variable GUID name to use. + VariableName - An optional field to indicate the target human-readable variable name. + BufferSize - On input: Length in bytes of buffer to hold retrived data. + On output: + If return EFI_BUFFER_TOO_SMALL, containg length of buffer desired. + Buffer - Buffer to hold retrived data. - QuestionId - Question ID of the check box - - DataWidth - DataWidth of the check box - - PromptToken - Prompt string token of the check box - - HelpToken - Help string token of the check box - - Flags - Flags of the check box - - Key - Key of the check box - - FormBuffer - Output of the check box as a form - -Returns: - - EFI_SUCCESS - Checkbox created to be a form - - EFI_DEVICE_ERROR - DataWidth > 1 +Returns: + EFI_SUCCESS - Routine success. + EFI_BUFFER_TOO_SMALL - The intput buffer is too small. --*/ ; EFI_STATUS -CreateNumericOpCode ( - IN UINT16 QuestionId, - IN UINT8 DataWidth, - IN STRING_REF PromptToken, - IN STRING_REF HelpToken, - IN UINT16 Minimum, - IN UINT16 Maximum, - IN UINT16 Step, - IN UINT16 Default, - IN UINT8 Flags, - IN UINT16 Key, - IN OUT VOID *FormBuffer +GetHiiHandles ( + IN OUT UINTN *HandleBufferLength, + OUT EFI_HII_HANDLE **HiiHandleBuffer ) /*++ Routine Description: + Determines the handles that are currently active in the database. + It's the caller's responsibility to free handle buffer. - Create a numeric opcode independent of string creation - This is used primarily by users who need to create just one particular valid op-code and the string - data will be assumed to exist in the HiiDatabase already. (Useful when exporting op-codes at a label - location to pre-defined forms in HII) - Arguments: + HiiDatabase - A pointer to the EFI_HII_DATABASE_PROTOCOL instance. + HandleBufferLength - On input, a pointer to the length of the handle buffer. On output, + the length of the handle buffer that is required for the handles found. + HiiHandleBuffer - Pointer to an array of Hii Handles returned. - QuestionId - Question ID of the numeric - - DataWidth - DataWidth of the numeric - - PromptToken - Prompt string token of the numeric - - HelpToken - Help string token of the numeric - - Minimum - Minumun boundary of the numeric - - Maximum - Maximum boundary of the numeric - - Step - Step of the numeric - - Default - Default value of the numeric - - Flags - Flags of the numeric - - Key - Key of the numeric - - FormBuffer - Output of the numeric as a form - -Returns: - - EFI_SUCCESS - The numeric created to be a form. - - EFI_DEVICE_ERROR - DataWidth > 2 +Returns: + EFI_SUCCESS - Get an array of Hii Handles successfully. + EFI_INVALID_PARAMETER - Hii is NULL. + EFI_NOT_FOUND - Database not found. --*/ ; EFI_STATUS -CreateStringOpCode ( - IN UINT16 QuestionId, - IN UINT8 DataWidth, - IN STRING_REF PromptToken, - IN STRING_REF HelpToken, - IN UINT8 MinSize, - IN UINT8 MaxSize, - IN UINT8 Flags, - IN UINT16 Key, - IN OUT VOID *FormBuffer +SetBrowserData ( + EFI_GUID *VariableGuid, OPTIONAL + CHAR16 *VariableName, OPTIONAL + UINTN BufferSize, + UINT8 *Buffer, + CHAR16 *RequestElement OPTIONAL ) /*++ Routine Description: + This routine is invoked by ConfigAccess.Callback() to update uncommitted data of Form Browser. - Create a numeric opcode independent of string creation - This is used primarily by users who need to create just one particular valid op-code and the string - data will be assumed to exist in the HiiDatabase already. (Useful when exporting op-codes at a label - location to pre-defined forms in HII) - Arguments: + VariableGuid - An optional field to indicate the target variable GUID name to use. + VariableName - An optional field to indicate the target human-readable variable name. + BufferSize - Length in bytes of buffer to hold retrived data. + Buffer - Buffer to hold retrived data. + RequestElement - An optional field to specify which part of the buffer data + will be send back to Browser. If NULL, the whole buffer of + data will be committed to Browser. + ::= &OFFSET=&WIDTH=* - QuestionId - Question ID of the string - - DataWidth - DataWidth of the string - - PromptToken - Prompt token of the string - - HelpToken - Help token of the string - - MinSize - Min size boundary of the string - - MaxSize - Max size boundary of the string - - Flags - Flags of the string - - Key - Key of the string - - FormBuffer - Output of the string as a form - -Returns: - - EFI_SUCCESS - String created to be a form. +Returns: + EFI_SUCCESS - Routine success. + Other - Updating Browser uncommitted data failed. --*/ ; EFI_STATUS -ValidateDataFromHiiHandle ( - IN EFI_HII_HANDLE HiiHandle, - OUT BOOLEAN *Results +ConvertRfc3066LanguageToIso639Language ( + CHAR8 *LanguageRfc3066, + CHAR8 *LanguageIso639 ) /*++ Routine Description: + Convert language code from RFC3066 to ISO639-2. - Validate that the data associated with the HiiHandle in NVRAM is within - the reasonable parameters for that FormSet. Values for strings and passwords - are not verified due to their not having the equivalent of valid range settings. - Arguments: + LanguageRfc3066 - RFC3066 language code. + LanguageIso639 - ISO639-2 language code. - HiiHandle - Handle of the HII database entry to query - - Results - If return Status is EFI_SUCCESS, Results provides valid data - TRUE = NVRAM Data is within parameters - FALSE = NVRAM Data is NOT within parameters - -Returns: +Returns: + EFI_SUCCESS - Language code converted. + EFI_NOT_FOUND - Language code not found. - EFI_OUT_OF_RESOURCES - No enough buffer to allocate - - EFI_SUCCESS - Data successfully validated --*/ ; -EFI_STATUS -CreateBannerOpCode ( - IN UINT16 Title, - IN UINT16 LineNumber, - IN UINT8 Alignment, - IN OUT VOID *FormBuffer +CHAR8 * +Rfc3066ToIso639 ( + CHAR8 *SupportedLanguages ) /*++ Routine Description: + Convert language code list from RFC3066 to ISO639-2, e.g. "en-US;fr-FR" will + be converted to "engfra". - Create a banner opcode. This is primarily used by the FrontPage implementation from BDS. - Arguments: + SupportedLanguages - The RFC3066 language list. - Title - Title of the banner - - LineNumber - LineNumber of the banner - - Alignment - Alignment of the banner - - FormBuffer - Output of banner as a form - -Returns: - - EFI_SUCCESS - Banner created to be a form. +Returns: + The ISO639-2 language list. --*/ ; -VOID -EfiLibHiiVariablePackGetMap ( - IN EFI_HII_VARIABLE_PACK *Pack, - OUT CHAR16 **Name, OPTIONAL - OUT EFI_GUID **Guid, OPTIONAL - OUT UINT16 *Id, OPTIONAL - OUT VOID **Var, OPTIONAL - OUT UINTN *Size OPTIONAL - ) +EFI_STATUS +GetCurrentLanguage ( + OUT CHAR8 *Lang + ) /*++ Routine Description: - - Extracts a variable form a Pack. + Determine what is the current language setting Arguments: + Lang - Pointer of system language - Pack - List of variables - Name - Name of the variable/map - Guid - GUID of the variable/map - Var - Pointer to the variable/map - Size - Size of the variable/map in bytes - -Returns: - - VOID. +Returns: + Status code --*/ ; -UINTN -EfiLibHiiVariablePackListGetMapCnt ( - IN EFI_HII_VARIABLE_PACK_LIST *List +VOID +GetNextLanguage ( + IN OUT CHAR8 **LangCode, + OUT CHAR8 *Lang ) /*++ Routine Description: - - Finds a count of the variables/maps in the List. + Get next language from language code list. Arguments: + LangCode - The language code. + Lang - Returned language. - List - List of variables - -Returns: - - Number of Map in the variable pack list. +Returns: + None. --*/ ; -typedef VOID (EFI_LIB_HII_VARIABLE_PACK_LIST_CALLBACK) ( - IN CHAR16 *Name, - IN EFI_GUID *Guid, - IN UINT16 Id, - IN VOID *Var, - IN UINTN Size - ) +CHAR8 * +GetSupportedLanguages ( + IN EFI_HII_HANDLE HiiHandle + ) /*++ Routine Description: - - type definition for the callback to be - used with EfiLibHiiVariablePackListForEachVar(). + This function returns the list of supported languages, in the format specified + in UEFI specification Appendix M. Arguments: + HiiHandle - The HII package list handle. - Id - Variable/Map ID - Name - Name of the variable/map - Guid - GUID of the variable/map - Var - Pointer to the variable/map - Size - Size of the variable/map in bytes - -Returns: - - VOID +Returns: + The supported languages. --*/ ; -VOID -EfiLibHiiVariablePackListForEachVar ( - IN EFI_HII_VARIABLE_PACK_LIST *List, - IN EFI_LIB_HII_VARIABLE_PACK_LIST_CALLBACK *Callback +UINT16 +GetSupportedLanguageNumber ( + IN EFI_HII_HANDLE HiiHandle ) /*++ Routine Description: - - Will iterate all variable/maps as appearing - in List and for each, it will call the Callback. + This function returns the number of supported languages Arguments: + HiiHandle - The HII package list handle. - List - List of variables - Callback - Routine to be called for each iterated variable. - -Returns: - - VOID +Returns: + The number of supported languages. --*/ ; EFI_STATUS -EfiLibHiiVariablePackListGetMapByIdx ( - IN UINTN Idx, - IN EFI_HII_VARIABLE_PACK_LIST *List, - OUT CHAR16 **Name, OPTIONAL - OUT EFI_GUID **Guid, OPTIONAL - OUT UINT16 *Id, OPTIONAL - OUT VOID **Var, - OUT UINTN *Size - ) +GetStringFromHandle ( + IN EFI_HII_HANDLE HiiHandle, + IN EFI_STRING_ID StringId, + OUT EFI_STRING *String + ) /*++ Routine Description: - - Finds a variable form List given - the order number as appears in the List. + Get string specified by StringId form the HiiHandle. Arguments: - - Idx - The index of the variable/map to retrieve - List - List of variables - Name - Name of the variable/map - Guid - GUID of the variable/map - Var - Pointer to the variable/map - Size - Size of the variable/map in bytes + HiiHandle - The HII handle of package list. + StringId - The String ID. + String - The output string. Returns: - - EFI_SUCCESS - Variable is found, OUT parameters are valid - EFI_NOT_FOUND - Variable is not found, OUT parameters are not valid + EFI_NOT_FOUND - String is not found. + EFI_SUCCESS - Operation is successful. + EFI_OUT_OF_RESOURCES - There is not enought memory in the system. + EFI_INVALID_PARAMETER - The String is NULL. --*/ ; EFI_STATUS -EfiLibHiiVariablePackListGetMapById ( - IN UINT16 Id, - IN EFI_HII_VARIABLE_PACK_LIST *List, - OUT CHAR16 **Name, OPTIONAL - OUT EFI_GUID **Guid, OPTIONAL - OUT VOID **Var, - OUT UINTN *Size - ) +GetStringFromToken ( + IN EFI_GUID *ProducerGuid, + IN EFI_STRING_ID StringId, + OUT EFI_STRING *String + ) /*++ Routine Description: - - Finds a variable form List given the - order number as appears in the List. + Get the string given the StringId and String package Producer's Guid. Arguments: - - Id - The ID of the variable/map to retrieve - List - List of variables - Name - Name of the variable/map - Guid - GUID of the variable/map - Var - Pointer to the variable/map - Size - Size of the variable/map in bytes + ProducerGuid - The Guid of String package list. + StringId - The String ID. + String - The output string. Returns: - - EFI_SUCCESS - Variable is found, OUT parameters are valid - EFI_NOT_FOUND - Variable is not found, OUT parameters are not valid + EFI_NOT_FOUND - String is not found. + EFI_SUCCESS - Operation is successful. + EFI_OUT_OF_RESOURCES - There is not enought memory in the system. --*/ ; EFI_STATUS -EfiLibHiiVariablePackListGetMap ( - IN EFI_HII_VARIABLE_PACK_LIST *List, - IN CHAR16 *Name, - IN EFI_GUID *Guid, - OUT UINT16 *Id, - OUT VOID **Var, - OUT UINTN *Size - ) +IfrLibNewString ( + IN EFI_HII_HANDLE PackageList, + OUT EFI_STRING_ID *StringId, + IN CONST EFI_STRING String + ) /*++ -Routine Description: + Routine Description: + This function adds the string into String Package of each language. - Finds a variable form EFI_HII_VARIABLE_PACK_LIST given name and GUID. + Arguments: + PackageList - Handle of the package list where this string will be added. + StringId - On return, contains the new strings id, which is unique within PackageList. + String - Points to the new null-terminated string. -Arguments: + Returns: + EFI_SUCCESS - The new string was added successfully. + EFI_NOT_FOUND - The specified PackageList could not be found in database. + EFI_OUT_OF_RESOURCES - Could not add the string due to lack of resources. + EFI_INVALID_PARAMETER - String is NULL or StringId is NULL is NULL. - List - List of variables - Name - Name of the variable/map to be found - Guid - GUID of the variable/map to be found - Var - Pointer to the variable/map found - Size - Size of the variable/map in bytes found +--*/ +; -Returns: +EFI_STATUS +IfrLibGetString ( + IN EFI_HII_HANDLE PackageList, + IN EFI_STRING_ID StringId, + OUT EFI_STRING String, + IN OUT UINTN *StringSize + ) +/*++ + + Routine Description: + This function try to retrieve string from String package of current language. + If fail, it try to retrieve string from String package of first language it support. - EFI_SUCCESS - variable is found, OUT parameters are valid - EFI_NOT_FOUND - variable is not found, OUT parameters are not valid + Arguments: + PackageList - The package list in the HII database to search for the specified string. + StringId - The string's id, which is unique within PackageList. + String - Points to the new null-terminated string. + StringSize - On entry, points to the size of the buffer pointed to by String, in bytes. On return, + points to the length of the string, in bytes. + + Returns: + EFI_SUCCESS - The string was returned successfully. + EFI_NOT_FOUND - The string specified by StringId is not available. + EFI_BUFFER_TOO_SMALL - The buffer specified by StringLength is too small to hold the string. + EFI_INVALID_PARAMETER - The String or StringSize was NULL. --*/ ; EFI_STATUS -EfiLibHiiVariableRetrieveFromNv ( - IN CHAR16 *Name, - IN EFI_GUID *Guid, - IN UINTN Size, - OUT VOID **Var +IfrLibSetString ( + IN EFI_HII_HANDLE PackageList, + IN EFI_STRING_ID StringId, + IN CONST EFI_STRING String ) /*++ -Routine Description: - Finds out if a variable of specific Name/Guid/Size exists in NV. - If it does, it will retrieve it into the Var. + Routine Description: + This function updates the string in String package of current language. -Arguments: - Name, Guid, Size - Parameters of the variable to retrieve. Must match exactly. - Var - Variable will be retrieved into buffer pointed by this pointer. - If pointing to NULL, the buffer will be allocated. Caller is responsible for releasing the buffer. -Returns: - EFI_SUCCESS - The variable of exact Name/Guid/Size parameters was retrieved and written to Var. - EFI_NOT_FOUND - The variable of this Name/Guid was not found in the NV. - EFI_LOAD_ERROR - The variable in the NV was of different size, or NV API returned error. + Arguments: + PackageList - The package list containing the strings. + StringId - The string's id, which is unique within PackageList. + String - Points to the new null-terminated string. + + Returns: + EFI_SUCCESS - The string was updated successfully. + EFI_NOT_FOUND - The string specified by StringId is not in the database. + EFI_INVALID_PARAMETER - The String was NULL. + EFI_OUT_OF_RESOURCES - The system is out of resources to accomplish the task. --*/ ; -//// -//// Variable override support. -//// - EFI_STATUS -EfiLibHiiVariableOverrideIfSuffix ( - IN CHAR16 *Suffix, - IN CHAR16 *Name, - IN EFI_GUID *Guid, - IN UINTN Size, - OUT VOID *Var - ) +IfrLibCreatePopUp ( + IN UINTN NumberOfLines, + OUT EFI_INPUT_KEY *KeyValue, + IN CHAR16 *String, + ... + ) /*++ Routine Description: - Overrrides the variable with NV data if found. - But it only does it if the Name ends with specified Suffix. - For example, if Suffix="MyOverride" and the Name="XyzSetupMyOverride", - the Suffix matches the end of Name, so the variable will be loaded from NV - provided the variable exists and the GUID and Size matches. + Draw a dialog and return the selected key. Arguments: - Suffix - Suffix the Name should end with. - Name, Guid, Size - Parameters of the variable to retrieve. Must match exactly. - Var - Variable will be retrieved into this buffer. - Caller is responsible for providing storage of exactly Size size in bytes. + NumberOfLines - The number of lines for the dialog box + KeyValue - The EFI_KEY value returned if HotKey is TRUE.. + String - Pointer to the first string in the list + ... - A series of (quantity == NumberOfLines) text strings which + will be used to construct the dialog box + Returns: - EFI_SUCCESS - The variable was overriden with NV variable of same Name/Guid/Size. - EFI_INVALID_PARAMETER - The name of the variable does not end with . - EFI_NOT_FOUND - The variable of this Name/Guid was not found in the NV. - EFI_LOAD_ERROR - The variable in the NV was of different size, or NV API returned error. + EFI_SUCCESS - Displayed dialog and received user interaction + EFI_INVALID_PARAMETER - One of the parameters was invalid. --*/ ; EFI_STATUS -EfiLibHiiVariableOverrideBySuffix ( - IN CHAR16 *Suffix, - IN CHAR16 *Name, - IN EFI_GUID *Guid, - IN UINTN Size, - OUT VOID *Var - ) +IfrLibUpdateForm ( + IN EFI_HII_HANDLE Handle, + IN EFI_GUID *FormSetGuid, OPTIONAL + IN EFI_FORM_ID FormId, + IN UINT16 Label, + IN BOOLEAN Insert, + IN EFI_HII_UPDATE_DATA *Data + ) /*++ Routine Description: - Overrrides the variable with NV data if found. - But it only does it if the NV contains the same variable with Name is appended with Suffix. - For example, if Suffix="MyOverride" and the Name="XyzSetup", - the Suffix will be appended to the end of Name, and the variable with Name="XyzSetupMyOverride" - will be loaded from NV provided the variable exists and the GUID and Size matches. + This function allows the caller to update a form that has + previously been registered with the EFI HII database. Arguments: - Suffix - Suffix the variable will be appended with. - Name, Guid, Size - Parameters of the variable to retrieve. Must match exactly. - Var - Variable will be retrieved into this buffer. - Caller is responsible for providing storage of exactly Size size in bytes. + Handle - Hii Handle + FormSetGuid - The formset should be updated. + FormId - The form should be updated. + Label - Update information starting immediately after this label in the IFR + Insert - If TRUE and Data is not NULL, insert data after Label. + If FALSE, replace opcodes between two labels with Data. + Data - The adding data; If NULL, remove opcodes between two Label. Returns: - EFI_SUCCESS - The variable was overriden with NV variable of same Name/Guid/Size. - EFI_NOT_FOUND - The variable of this Name/Guid was not found in the NV. - EFI_LOAD_ERROR - The variable in the NV was of different size, or NV API returned error. + EFI_SUCCESS - Update success. + Other - Update fail. --*/ ; - #endif diff --git a/MdePkg/Include/Library/MemoryAllocationLib.h b/MdePkg/Include/Library/MemoryAllocationLib.h index 8606fc5fd7..8f6d1ec16a 100644 --- a/MdePkg/Include/Library/MemoryAllocationLib.h +++ b/MdePkg/Include/Library/MemoryAllocationLib.h @@ -617,4 +617,10 @@ FreeAlignedPool ( IN VOID *Buffer ); +VOID +EFIAPI +SafeFreePool ( + IN VOID *Buffer + ); + #endif diff --git a/MdePkg/Include/Protocol/DevicePath.h b/MdePkg/Include/Protocol/DevicePath.h index 5957b0ed79..cabad21436 100644 --- a/MdePkg/Include/Protocol/DevicePath.h +++ b/MdePkg/Include/Protocol/DevicePath.h @@ -207,9 +207,9 @@ typedef struct { #define MSG_SATA_DP 0x12 typedef struct { EFI_DEVICE_PATH_PROTOCOL Header; - UINT16 HbaPortNumber; - UINT16 PortMultiplierPort; - UINT16 LogicalUnitNumber; + UINT16 HBAPortNumber; + UINT16 PortMultiplierPortNumber; + UINT16 Lun; } SATA_DEVICE_PATH; #define MSG_I2O_DP 0x06 diff --git a/MdePkg/Include/Protocol/FormBrowser2.h b/MdePkg/Include/Protocol/FormBrowser2.h index 36e47e150c..34fd9b71a7 100644 --- a/MdePkg/Include/Protocol/FormBrowser2.h +++ b/MdePkg/Include/Protocol/FormBrowser2.h @@ -17,11 +17,8 @@ #ifndef __EFI_FORM_BROWSER_H__ #define __EFI_FORM_BROWSER_H__ -#error "UEFI 2.1 HII is not fully implemented for now, Please don't include this file now." - - #define EFI_FORM_BROWSER2_PROTOCOL_GUID \ - { 0xe5a1333e, 0xe1b4, 0x4e55, { 0xce, 0xeb, 0x35, 0xc3, 0xef, 0x13, 0x34, 0x43 } } + {0xb9d4c360, 0xbcfb, 0x4f9b, {0x92, 0x98, 0x53, 0xc1, 0x36, 0x98, 0x22, 0x58 }} typedef struct _EFI_FORM_BROWSER2_PROTOCOL EFI_FORM_BROWSER2_PROTOCOL; @@ -54,10 +51,10 @@ typedef struct { typedef UINTN EFI_BROWSER_ACTION_REQUEST; -#define EFI_BROWSER_ACTION_NONE 0 -#define EFI_BROWSER_ACTION_RESET 1 -#define EFI_BROWSER_ACTION_SUMBIT 2 -#define EFI_BROWSER_ACTION_EXIT 3 +#define EFI_BROWSER_ACTION_REQUEST_NONE 0 +#define EFI_BROWSER_ACTION_REQUEST_RESET 1 +#define EFI_BROWSER_ACTION_REQUEST_SUBMIT 2 +#define EFI_BROWSER_ACTION_REQUEST_EXIT 3 /** @@ -67,7 +64,7 @@ typedef UINTN EFI_BROWSER_ACTION_REQUEST; the browser to use a variety of passed-in information or primarily use the HII database as the source of information. - @param This A pointer to the EFI_FORM_BROWSER_PROTOCOL + @param This A pointer to the EFI_FORM_BROWSER2_PROTOCOL instance. @param Handle A pointer to an array of HII handles to @@ -121,12 +118,12 @@ typedef UINTN EFI_BROWSER_ACTION_REQUEST; typedef EFI_STATUS (EFIAPI *EFI_SEND_FORM2) ( - IN CONST EFI_FORM_BROWSER_PROTOCOL *This, - IN CONST EFI_HII_HANDLE *Handle, - IN CONST UINTN HandleCount, - IN CONST BOOLEAN SingleUse, + IN CONST EFI_FORM_BROWSER2_PROTOCOL *This, + IN EFI_HII_HANDLE *Handle, + IN UINTN HandleCount, + IN EFI_GUID *FormSetGuid, OPTIONAL + IN EFI_FORM_ID FormId, OPTIONAL IN CONST EFI_SCREEN_DESCRIPTOR *ScreenDimensions, OPTIONAL - OUT BOOLEAN *ResetRequired OPTIONAL OUT EFI_BROWSER_ACTION_REQUEST *ActionRequest OPTIONAL ); @@ -137,7 +134,7 @@ EFI_STATUS browser. This routine called this service in the browser to retrieve or set certain uncommitted state information. - @param This A pointer to the EFI_FORM_BROWSER_PROTOCOL + @param This A pointer to the EFI_FORM_BROWSER2_PROTOCOL instance. @param ResultsDataSize A pointer to the size of the buffer @@ -172,7 +169,7 @@ EFI_STATUS typedef EFI_STATUS (EFIAPI *EFI_BROWSER_CALLBACK2 ) ( - IN CONST EFI_FORM_BROWSER_PROTOCOL *This, + IN CONST EFI_FORM_BROWSER2_PROTOCOL *This, IN OUT UINTN *ResultsDataSize, IN OUT EFI_STRING ResultsData, IN CONST BOOLEAN RetrieveData, @@ -213,4 +210,3 @@ extern EFI_GUID gEfiFormBrowser2ProtocolGuid; #endif - diff --git a/MdePkg/Include/Protocol/HiiConfigAccess.h b/MdePkg/Include/Protocol/HiiConfigAccess.h index b253a7b047..25dd7f1642 100644 --- a/MdePkg/Include/Protocol/HiiConfigAccess.h +++ b/MdePkg/Include/Protocol/HiiConfigAccess.h @@ -19,13 +19,18 @@ #ifndef __EFI_HII_CONFIG_ACCESS_H__ #define __EFI_HII_CONFIG_ACCESS_H__ -#error "UEFI 2.1 HII is not fully implemented for now, Please don't include this file now." +#include #define EFI_HII_CONFIG_ACCESS_PROTOCOL_GUID \ { 0x330d4706, 0xf2a0, 0x4e4f, { 0xa3, 0x69, 0xb6, 0x6f, 0xa8, 0xd5, 0x43, 0x85 } } typedef struct _EFI_HII_CONFIG_ACCESS_PROTOCOL EFI_HII_CONFIG_ACCESS_PROTOCOL; +typedef UINTN EFI_BROWSER_ACTION; + +#define EFI_BROWSER_ACTION_CHANGING 0 +#define EFI_BROWSER_ACTION_CHANGED 1 + /** This function allows the caller to request the current @@ -235,3 +240,4 @@ extern EFI_GUID gEfiHiiConfigAccessProtocolGuid; #endif + diff --git a/MdePkg/Include/Protocol/HiiConfigRouting.h b/MdePkg/Include/Protocol/HiiConfigRouting.h index 9c592645d0..ad7154d601 100644 --- a/MdePkg/Include/Protocol/HiiConfigRouting.h +++ b/MdePkg/Include/Protocol/HiiConfigRouting.h @@ -19,8 +19,6 @@ #ifndef __HII_CONFIG_ROUTING_H__ #define __HII_CONFIG_ROUTING_H__ -#error "UEFI 2.1 HII is not fully implemented for now, Please don't include this file now." - #define EFI_HII_CONFIG_ROUTING_PROTOCOL_GUID \ { 0x587e72d7, 0xcc50, 0x4f79, { 0x82, 0x09, 0xca, 0x29, 0x1f, 0xc1, 0xa1, 0x0f } } @@ -112,7 +110,7 @@ typedef EFI_STATUS (EFIAPI * EFI_HII_ROUTING_EXTRACT_CONFIG ) ( IN CONST EFI_HII_CONFIG_ROUTING_PROTOCOL *This, - IN CONST EFI_STRING *Request, + IN CONST EFI_STRING Request, OUT EFI_STRING *Progress, OUT EFI_STRING *Results ); @@ -278,7 +276,7 @@ EFI_STATUS IN CONST EFI_STRING ConfigRequest, IN CONST UINT8 *Block, IN CONST UINTN BlockSize, - OUT EFI_STRING **Config, + OUT EFI_STRING *Config, OUT EFI_STRING *Progress ); @@ -334,12 +332,62 @@ typedef EFI_STATUS (EFIAPI * EFI_HII_ROUTING_CONFIG_TO_BLOCK ) ( IN CONST EFI_HII_CONFIG_ROUTING_PROTOCOL *This, - IN CONST EFI_STRING *ConfigResp, - IN CONST UINT8 *Block, + IN CONST EFI_STRING ConfigResp, + IN OUT UINT8 *Block, IN OUT UINTN *BlockSize, OUT EFI_STRING *Progress ); +typedef +EFI_STATUS +(EFIAPI * EFI_HII_GET_ALT_CFG) ( + IN CONST EFI_HII_CONFIG_ROUTING_PROTOCOL *This, + IN CONST EFI_STRING Configuration, + IN CONST EFI_GUID *Guid, + IN CONST EFI_STRING Name, + IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath, + IN CONST UINT16 *AltCfgId, + OUT EFI_STRING *AltCfgResp + ) +/*++ + + Routine Description: + This helper function is to be called by drivers to extract portions of + a larger configuration string. + + Arguments: + This - A pointer to the EFI_HII_CONFIG_ROUTING_PROTOCOL instance. + Configuration - A null-terminated Unicode string in format. + Guid - A pointer to the GUID value to search for in the + routing portion of the ConfigResp string when retrieving + the requested data. If Guid is NULL, then all GUID + values will be searched for. + Name - A pointer to the NAME value to search for in the + routing portion of the ConfigResp string when retrieving + the requested data. If Name is NULL, then all Name + values will be searched for. + DevicePath - A pointer to the PATH value to search for in the + routing portion of the ConfigResp string when retrieving + the requested data. If DevicePath is NULL, then all + DevicePath values will be searched for. + AltCfgId - A pointer to the ALTCFG value to search for in the + routing portion of the ConfigResp string when retrieving + the requested data. If this parameter is NULL, + then the current setting will be retrieved. + AltCfgResp - A pointer to a buffer which will be allocated by the + function which contains the retrieved string as requested. + This buffer is only allocated if the call was successful. + + Returns: + EFI_SUCCESS - The request succeeded. The requested data was extracted + and placed in the newly allocated AltCfgResp buffer. + EFI_OUT_OF_RESOURCES - Not enough memory to allocate AltCfgResp. + EFI_INVALID_PARAMETER - Any parameter is invalid. + EFI_NOT_FOUND - Target for the specified routing data was not found. + +--*/ +; + /** @@ -354,6 +402,7 @@ struct _EFI_HII_CONFIG_ROUTING_PROTOCOL { EFI_HII_ROUTING_ROUTE_CONFIG RouteConfig; EFI_HII_ROUTING_BLOCK_TO_CONFIG BlockToConfig; EFI_HII_ROUTING_CONFIG_TO_BLOCK ConfigToBlock; + EFI_HII_GET_ALT_CFG GetAltConfig; }; extern EFI_GUID gEfiHiiConfigRoutingProtocolGuid; diff --git a/MdePkg/Include/Protocol/HiiDatabase.h b/MdePkg/Include/Protocol/HiiDatabase.h index a100a6bba8..75245c11cd 100644 --- a/MdePkg/Include/Protocol/HiiDatabase.h +++ b/MdePkg/Include/Protocol/HiiDatabase.h @@ -16,1456 +16,12 @@ #ifndef __HII_DATABASE_H__ #define __HII_DATABASE_H__ -#error "UEFI 2.1 HII is not fully implemented for now, Please don't include this file now." - #define EFI_HII_DATABASE_PROTOCOL_GUID \ { 0xef9fc172, 0xa1b2, 0x4693, { 0xb3, 0x27, 0x6d, 0x32, 0xfc, 0x41, 0x60, 0x42 } } typedef struct _EFI_HII_DATABASE_PROTOCOL EFI_HII_DATABASE_PROTOCOL; -// -// ConfigurationS of HII. -// -#define GLYPH_WIDTH 8 -#define GLYPH_HEIGHT 19 - -/** - - Each package starts with a header, as defined above, which - indicates the size and type of the package. When added to a - pointer pointing to the start of the header, Length points at - the next package. The package lists form a package list when - concatenated together and terminated with an - EFI_HII_PACKAGE_HEADER with a Type of EFI_HII_PACKAGE_END. The - type EFI_HII_PACKAGE_TYPE_GUID is used for vendor-defined HII - packages, whose contents are determined by the Guid. The range - of package types starting with EFI_HII_PACKAGE_TYPE_SYSTEM_BEGIN - through EFI_HII_PACKAGE_TYPE_SYSTEM_END are reserved for system - firmware implementers. - - @param Length The size of the package in bytes. - - @param Type The package type. See EFI_HII_PACKAGE_TYPE_x, - below. - - @param Data The package data, the format of which is - determined by Type. - -**/ -typedef struct { - UINT32 Length:24; - UINT32 Type:8; - // UINT8 Data[...]; -} EFI_HII_PACKAGE_HEADER; - -// -// EFI_HII_PACKAGE_TYPE_x. -// -#define EFI_HII_PACKAGE_TYPE_ALL 0x00 -#define EFI_HII_PACKAGE_TYPE_GUID 0x01 -#define EFI_HII_PACKAGE_FORM_CONFIG 0x02 -#define EFI_HII_PACKAGE_FORM_APP 0x03 -#define EFI_HII_PACKAGE_STRINGS 0x04 -#define EFI_HII_PACKAGE_FONTS 0x05 -#define EFI_HII_PACKAGE_IMAGES 0x06 -#define EFI_HII_PACKAGE_SIMPLE_FONTS 0x07 -#define EFI_HII_PACKAGE_DEVICE_PATH 0x08 -#define EFI_HII_PACKAGE_END 0x09 -#define EFI_HII_PACKAGE_TYPE_SYSTEM_BEGIN 0xE0 -#define EFI_HII_PACKAGE_TYPE_SYSTEM_END 0xFF - - -/** - - This header uniquely identifies the package list.and is placed - in front of a list of packages. Package lists with the same - PackageListGuid value should contain the same data set. Updated - versions should have updated GUIDs. - - @param PackageListGuid The unique identifier applied to the - list of packages which follows. - - - @param PackageLength The size of the package list (in - bytes), including the header. - -**/ -typedef struct { - EFI_GUID PackageListGuid; - UINT32 PackagLength; -} EFI_HII_PACKAGE_LIST_HEADER; - -/** - - The fonts must be presented in Unicode sort order. That is, - the primary sort key is the UnicodeWeight and the secondary - sort key is the SurrogateWeight. It is up to developers who - manage fonts to choose efficient mechanisms for accessing - fonts. The contiguous presentation can easily be used because - narrow and wide glyphs are not intermixed, so a binary search - is possible (hence the requirement that the glyphs be sorted - by weight). - - @param Header The header contains a Length and Type field. - In the case of a font package, the type will - be EFI_HII_PACKAGE_SIMPLE_FONTS and the length - will be the total size of the font package - including the size of the narrow and wide - glyphs. See EFI_HII_PACKAGE_HEADER. - - @param NumberOfNarrowGlyphs The number of NarrowGlyphs that - are included in the font package. - - @param NumberOfWideGlyphs The number of WideGlyphs that are - included in the font package. - - @param NarrowGlyphs An array of EFI_NARROW_GLYPH entries. - The number of entries is specified by - NumberOfNarrowGlyphs. - - @param WideGlyphs An array of EFI_WIDE_GLYPH entries. The - number of entries is specified by - NumberOfWideGlyphs. To calculate the - offset of WideGlyphs, use the offset of - NarrowGlyphs and add the size of - EFI_NARROW_GLYPH multiplied by the - NumberOfNarrowGlyphs. - -*/ -typedef struct _EFI_HII_SIMPLE_FONT_PACKAGE_HDR { - EFI_HII_PACKAGE_HEADER Header; - UINT16 NumberOfNarrowGlyphs; - UINT16 NumberOfWideGlyphs; - // EFI_NARROW_GLYPH NarrowGlyphs[]; - // EFI_WIDE_GLYPH WideGlyphs[]; -} EFI_HII_SIMPLE_FONT_PACKAGE_HDR; - -// -// Contents of EFI_NARROW_GLYPH.Attributes -// -#define EFI_GLYPH_NON_SPACING 0x01 -#define EFI_GLYPH_WIDE 0x02 - -/** - - Glyphs are represented by two structures, one each for the two - sizes of glyphs. The narrow glyph (EFI_NARROW_GLYPH) is the - normal glyph used for text display. - - @param UnicodeWeight The Unicode representation of the glyph. - The term weight is the technical term - for a character value. - - @param Attributes The data element containing the glyph - definitions; see Related Definitions - below. - - @param GlyphCol1 The column major glyph representation of the - character. Bits with values of one - indicate that the corresponding pixel is to - be on when normally displayed; those with - zero are off. - -**/ -typedef struct { - CHAR16 UnicodeWeight; - UINT8 Attributes; - UINT8 GlyphCol1[19]; -} EFI_NARROW_GLYPH; - -/** - - Glyphs are represented via the two structures, one each for the - two sizes of glyphs. The wide glyph (EFI_WIDE_GLYPH) is large - enough to display logographic characters. - - @param UnicodeWeight The Unicode representation of the glyph. - The term weight is the technical term - for a character value. - - @param Attributes The data element containing the glyph - definitions; see Related Definitions in - EFI_NARROW_GLYPH for attribute values. - - @param GlyphCol1, GlyphCol2 The column major glyph - representation of the character. - Bits with values of one indicate - that the corresponding pixel is - to be on when normally - displayed; those with zero are - off. - - @param Pad Ensures that sizeof(EFI_WIDE_GLYPH) is twice the - sizeof(EFI_NARROW_GLYPH). The contents of Pad must - bezero. - - -**/ -typedef struct { - CHAR16 UnicodeWeight; - UINT8 Attributes; - UINT8 GlyphCol1[GLYPH_HEIGHT]; - UINT8 GlyphCol2[GLYPH_HEIGHT]; - UINT8 Pad[3]; -} EFI_WIDE_GLYPH; - - -// -// EFI_HII_FONT_STYLE -// -typedef UINT32 EFI_HII_FONT_STYLE; -#define EFI_HII_FONT_STYLE_BOLD 0x00000001 -#define EFI_HII_FONT_STYLE_ITALIC 0x00000002 -#define EFI_HII_FONT_STYLE_EMBOSS 0x00010000 -#define EFI_HII_FONT_STYLE_OUTLINE 0x00020000 -#define EFI_HII_FONT_STYLE_SHADOW 0x00040000 -#define EFI_HII_FONT_STYLE_UNDERLINE 0x00080000 -#define EFI_HII_FONT_STYLE_DBL_UNDER 0x00100000 - -// -// EFI_HII_GLYPH_BLOCK.BlockType -// -#define EFI_HII_GIBT_END 0x00 -#define EFI_HII_GIBT_GLYPH 0x10 -#define EFI_HII_GIBT_GLYPHS 0x11 -#define EFI_HII_GIBT_GLYPH_DEFAULT 0x12 -#define EFI_HII_GIBT_GLYPHS_DEFAULT 0x13 -#define EFI_HII_GIBT_DUPLICATE 0x20 -#define EFI_HII_GIBT_SKIP2 0x21 -#define EFI_HII_GIBT_SKIP1 0x22 -#define EFI_HII_GIBT_DEFAULTS 0x23 -#define EFI_HII_GIBT_EXT1 0x30 -#define EFI_HII_GIBT_EXT2 0x31 -#define EFI_HII_GIBT_EXT4 0x32 - -/** - - EFI_HII_GIBT_END block is found. When processing the glyph - blocks, each block refers to the current character value - (CharValueCurrent), which is initially set to one (1). Glyph - blocks of an unknown type should be skipped. If they cannot be - skipped, then processing halts. - -**/ -typedef struct _EFI_HII_GLYPH_BLOCK { - UINT8 BlockType; - UINT8 BlockBody[1]; -} EFI_HII_GLYPH_BLOCK; - - -/** - - @param Width Width of the character or character cell, in - pixels. For fixed-pitch fonts, this is the same - as the advance. - - @param Height Height of the character or character cell, in - pixels. - - @param OffsetX Offset to the horizontal edge of the character - cell. - - @param OffsetY Offset to the vertical edge of the character - cell. - - @param AdvanceX Number of pixels to advance to the right - when moving from the origin of the current - glyph to the origin of the next glyph. - -**/ -typedef struct _EFI_HII_GLYPH_INFO { - UINT16 Width; - UINT16 Height; - INT16 OffsetX; - INT16 OffsetY; - INT16 AdvanceX; -} EFI_HII_GLYPH_INFO; - - -/** - - Changes the default cell information used for subsequent - EFI_HII_GIBT_GLYPH_DEFAULT and EFI_HII_GIBT_GLYPHS_DEFAULT glyph - blocks. The cell information described by Cell remains in effect - until the next EFI_HII_GIBT_DEFAULTS is found. Prior to the - first EFI_HII_GIBT_DEFAULTS block, the cell information in the - fixed header are used. - - @param Header Standard glyph block header, where - Header.BlockType = EFI_HII_GIBT_DEFAULTS. - - @param Cell The new default cell information which will be - applied to all subsequent GLYPH_DEFAULT and - GLYPHS_DEFAULT blocks. - -**/ -typedef struct _EFI_HII_GIBT_DEFAULTS_BLOCK { - EFI_HII_GLYPH_BLOCK Header; - EFI_HII_GLYPH_INFO Cell; -} EFI_HII_GIBT_DEFAULTS_BLOCK; - - -/** - - Indicates that the glyph with character value CharValueCurrent - has the same glyph as a previously defined character value and - increments CharValueCurrent by one. - - @param Header Standard glyph block header, where - Header.BlockType = EFI_HII_GIBT_DUPLICATE. - - @param CharValue The previously defined character value with - the exact same glyph. - -**/ -typedef struct _EFI_HII_GIBT_DUPLICATE_BLOCK { - EFI_HII_GLYPH_BLOCK Header; - CHAR16 CharValue; -} EFI_HII_GIBT_DUPLICATE_BLOCK; - - -/** - - Any glyphs with a character value greater than or equal to - CharValueCurrent are empty. - - @param Header Standard glyph block header, where - Header.BlockType = EFI_HII_GIBT_END. - -**/ -typedef struct _EFI_GLYPH_GIBT_END_BLOCK { - EFI_HII_GLYPH_BLOCK Header; -} EFI_GLYPH_GIBT_END_BLOCK; - -/** - - These are reserved for future expansion, with length bytes - included so that they can be easily skipped. - - @param Header Standard glyph block header, where - Header.BlockType = EFI_HII_GIBT_EXT1, - EFI_HII_GIBT_EXT2 or EFI_HII_GIBT_EXT4. - - @param Length Size of the glyph block, in bytes. - -**/ -typedef struct _EFI_HII_GIBT_EXT1_BLOCK { - EFI_HII_GLYPH_BLOCK Header; - UINT8 BlockType2; - UINT8 Length; -} EFI_HII_GIBT_EXT1_BLOCK; - - -/** - - These are reserved for future expansion, with length bytes - included so that they can be easily skipped. - - @param Header Standard glyph block header, where - Header.BlockType = EFI_HII_GIBT_EXT1, - EFI_HII_GIBT_EXT2 or EFI_HII_GIBT_EXT4. - - @param Length Size of the glyph block, in bytes. - -**/ -typedef struct _EFI_HII_GIBT_EXT2_BLOCK { - EFI_HII_GLYPH_BLOCK Header; - UINT8 BlockType2; - UINT16 Length; -} EFI_HII_GIBT_EXT2_BLOCK; - -/** - - These are reserved for future expansion, with length bytes - included so that they can be easily skipped. - - @param Header Standard glyph block header, where - Header.BlockType = EFI_HII_GIBT_EXT1, - EFI_HII_GIBT_EXT2 or EFI_HII_GIBT_EXT4. - - @param Length Size of the glyph block, in bytes. - -**/ -typedef struct _EFI_HII_GIBT_EXT4_BLOCK { - EFI_HII_GLYPH_BLOCK Header; - UINT8 BlockType2; - UINT32 Length; -} EFI_HII_GIBT_EXT4_BLOCK; - - -/** - - This block provides the bitmap for the character with the value - CharValueCurrent and increments CharValueCurrent by one. Each - glyph contains a glyph width and height, a drawing offset, - number of pixels to advance after drawing and then the encoded - bitmap. - - @param Header Standard glyph block header, where - Header.BlockType = EFI_HII_GIBT_GLYPH. - - @param Cell Contains the width and height of the encoded - bitmap (Cell.Width and Cell.Height), the number - of pixels (signed) right of the character cell - origin where the left edge of the bitmap should - be placed (Cell.OffsetX), the number of pixels - above the character cell origin where the top - edge of the bitmap should be placed - (Cell.OffsetY) and the number of pixels (signed) - to move right to find the origin for the next - charactercell (Cell.AdvanceX). - - @param GlyphCount The number of glyph bitmaps. - - @param BitmapData The bitmap data specifies a series of - pixels, one bit per pixel, left-to-right, - top-tobottom. Each glyph bitmap only - encodes the portion of the bitmap enclosed - by its character-bounding box, but the - entire glyph is padded out to the nearest - byte. The number of bytes per bitmap can - be calculated as: ((Cell.Width + 7)/8) * - Cell.Height. - - -**/ -typedef struct _EFI_HII_GIBT_GLYPH_BLOCK { - EFI_HII_GLYPH_BLOCK Header; - EFI_HII_GLYPH_INFO Cell; - UINT16 GlyphCount; - UINT8 BitmapData[1]; -} EFI_HII_GIBT_GLYPH_BLOCK; - -/** - - Provides the bitmaps for the characters with the values - CharValueCurrent through CharValueCurrent + Count -1 and - increments CharValueCurrent by Count. These glyphs have - identical cell information and the encoded bitmaps are exactly - the same number of byes. - - @param Header Standard glyph block header, where - Header.BlockType = EFI_HII_GIBT_GLYPHS. - - @param Cell Contains the width and height of the encoded - bitmap (Cell.Width and Cell.Height), the - number of pixels (signed) right of the - character cell origin where the left edge of - the bitmap should be placed (Cell.OffsetX), - the number of pixels above the character cell - origin where the top edge of the bitmap should - be placed (Cell.OffsetY) and the number of - pixels(signed) to move right to find the - origin for the next character cell - (Cell.AdvanceX). - - @param BitmapData The bitmap data specifies a series of - pixels, one bit per pixel, left-to-right, - top-tobottom, for each glyph. Each glyph - bitmap only encodes the portion of the - bitmap enclosed by its character-bounding - box. The number of bytes per bitmap can be - calculated as: ((Cell.Width + 7)/8) * - Cell.Height. - -**/ -typedef struct _EFI_HII_GIBT_GLYPHS_BLOCK { - EFI_HII_GLYPH_BLOCK Header; - EFI_HII_GLYPH_INFO Cell; - UINT8 BitmapData[1]; -} EFI_HII_GIBT_GLYPHS_BLOCK; - -/** - - Provides the bitmap for the character with the value - CharValueCurrent and increments CharValueCurrent by 1. This - glyph uses the default cell information. The default cell - information is found in the font header or the most recently - processed EFI_HII_GIBT_DEFAULTS. - - @param Header Standard glyph block header, where - Header.BlockType = EFI_HII_GIBT_GLYPH_DEFAULT. - - @param BitmapData The bitmap data specifies a series of - pixels, one bit per pixel, left-to-right, - top-tobottom. Each glyph bitmap only - encodes the portion of the bitmap enclosed - by its character-bounding box. The number - of bytes per bitmap can be calculated as: - ((Global.Cell.Width + 7)/8) * - Global.Cell.Height. - -**/ -typedef struct _EFI_HII_GIBT_GLYPH_DEFAULT_BLOCK { - EFI_HII_GLYPH_BLOCK Header; - UINT8 BitmapData[1]; -} EFI_HII_GIBT_GLYPH_DEFAULT_BLOCK; - - - - -/** - - Provides the bitmaps for the characters with the values - CharValueCurrent through CharValueCurrent + Count -1 and - increments CharValueCurrent by Count. These glyphs use the - default cell information and the encoded bitmaps have exactly - the same number of byes. - - @param Header Standard glyph block header, where - Header.BlockType = - EFI_HII_GIBT_GLYPHS_DEFAULT. - - @param Count Number of glyphs in the glyph block. - - @param BitmapData The bitmap data specifies a series of - pixels, one bit per pixel, left-to-right, - top-tobottom, for each glyph. Each glyph - bitmap only encodes the portion of the - bitmap enclosed by its character-bounding - box. The number of bytes per bitmap can be - calculated as: ((Global.Cell.Width + 7)/8) - Global.Cell.Height. - -**/ -typedef struct _EFI_HII_GIBT_GLYPHS_DEFAULT_BLOCK { - EFI_HII_GLYPH_BLOCK Header; - UINT16 Count; - UINT8 BitmapData[1]; -} EFI_HII_GIBT_GLYPHS_DEFAULT_BLOCK; - -/** - - Increments the current character value CharValueCurrent by the - number specified. - - @param Header Standard glyph block header, where BlockType = - EFI_HII_GIBT_SKIP1 or EFI_HII_GIBT_SKIP2. - - @param SkipCount The unsigned 8- or 16-bit value to add to - CharValueCurrent. - -**/ -typedef struct _EFI_HII_GIBT_SKIP2_BLOCK { - EFI_HII_GLYPH_BLOCK Header; - UINT16 SkipCount; -} EFI_HII_GIBT_SKIP2_BLOCK; - - -/** - - Increments the current character value CharValueCurrent by the - number specified. - - @param Header Standard glyph block header, where BlockType = - EFI_HII_GIBT_SKIP1 or EFI_HII_GIBT_SKIP2. - - @param SkipCount The unsigned 8- or 16-bit value to add to - CharValueCurrent. - -**/ -typedef struct _EFI_HII_GIBT_SKIP1_BLOCK { - EFI_HII_GLYPH_BLOCK Header; - UINT8 SkipCount; -} EFI_HII_GIBT_SKIP1_BLOCK; - - -/** - - This package is created by NewPackageList() when the package - list is first added to the HII database by locating the - EFI_DEVICE_PATH_PROTOCOL attached to the driver handle passed in - to that function. - -**/ -typedef EFI_DEVICE_PATH_PROTOCOL EFI_HII_DEVICE_PATH_PACKAGE_HDR; - - -/** - - This is a free-form package type designed to allow extensibility - by allowing the format to be specified using Guid. - - @param Guid Identifier which describes the remaining data - within the package. - -**/ -typedef struct _EFI_HII_GUID_PACKAGE_HDR { - EFI_GUID Guid; -} EFI_HII_GUID_PACKAGE_HDR; - - -/** - - The Strings package record describes the mapping between string - identifiers and the actual text of the strings themselves. The - package consists of three parts: a fixed header, the string - information and the font information. - - @param Header The standard package header, where Header.Type - = EFI_HII_PACKAGE_STRINGS. - - @param HdrSize Size of this header. - - @param StringInfoOffset Offset, relative to the start of - this header, of the string information. - - @param LanguageWindow Specifies the default values placed in - the static and dynamic windows before - processing each SCSU-encoded strings. - - - @param LanguageName String identifier within the current - string package of the full name of the - language specified by Language. Language - Language of the strings, as specified by - RFC 3066. - -**/ -typedef struct _EFI_HII_STRING_PACKAGE_HDR { - EFI_HII_PACKAGE_HEADER Header; - UINT32 HdrSize; - UINT32 StringInfoOffset; - CHAR16 LanguageWindow[16]; - EFI_STRING_ID LanguageName; - CHAR8 Language[1]; -} EFI_HII_STRING_PACKAGE_HDR; - - - -/** - - The fixed header consists of a standard record header and then - the character values in this section, the flags (including the - encoding method) and the offsets of the glyph information, the - glyph bitmaps and the character map. - - @param Header The standard package header, where Header.Size - EFI_HII_PACKAGE_FONTS. - - @param HdrSize Size of this header. - - @param GlyphInfoOffset The offset, relative to the start of - this header, of a series of - variable-length glyph blocks, each - describing information about the - bitmap associated with a glyph. - - @param Cell This contains the measurement of the widest and - tallest characters in the font (Cell.Width and - Cell.Height). It also contains the offset to the - horizontal and vertical origin point of the - character cell (Cell.OffsetX and Cell.OffsetY). - Finally, it contains the default AdvanceX. The - individual glyph's OffsetX and OffsetY value is - added to this position to determine where to - draw the top-left pixel of the character's - glyph. The character glyph's AdvanceX is added - to this position to determine the origin point - for the next character. - - @param FontStyle The design style of the font, 1 bit per - style. See EFI_HII_FONT_STYLE. - - @param FontFamily The null-terminated string with the name - of the font family to which the font - belongs. - -**/ -typedef struct _EFI_HII_FONT_PACKAGE_HDR { - EFI_HII_PACKAGE_HEADER Header; - UINT32 HdrSize; - UINT32 GlyphBlockOffset; - EFI_HII_GLYPH_INFO Cell; - EFI_HII_FONT_STYLE FontStyle; - CHAR16 FontFamily[1]; -} EFI_HII_FONT_PACKAGE_HDR; - - -// -// EFI_HII_STRING_BLOCK.BlockType -// -#define FI_HII_SIBT_END 0x00 -#define EFI_HII_SIBT_STRING_SCSU 0x10 -#define EFI_HII_SIBT_STRING_SCSU_FONT 0x11 -#define EFI_HII_SIBT_STRINGS_SCSU 0x12 -#define EFI_HII_SIBT_STRINGS_SCSU_FONT 0x13 -#define EFI_HII_SIBT_STRING_UCS2 0x14 -#define EFI_HII_SIBT_STRING_UCS2_FONT 0x15 -#define EFI_HII_SIBT_STRINGS_UCS2 0x16 -#define EFI_HII_SIBT_STRINGS_UCS2_FONT 0x17 -#define EFI_HII_SIBT_DUPLICATE 0x20 -#define EFI_HII_SIBT_SKIP2 0x21 -#define EFI_HII_SIBT_SKIP1 0x22 -#define EFI_HII_SIBT_EXT1 0x30 -#define EFI_HII_SIBT_EXT2 0x31 -#define EFI_HII_SIBT_EXT4 0x32 -#define EFI_HII_SIBT_FONT 0x40 - -/** - - String blocks specify the text and font for the current string - identifier and increment to the next string identifier. -**/ -typedef struct { - UINT8 BlockType; - UINT8 BlockBody[1]; -} EFI_HII_STRING_BLOCK; - - -/** - - Indicates that the string with string identifier - StringIdCurrent is the same as a previously defined string and - increments StringIdCurrent by one. - - @param Header Standard string block header, where - Header.BlockType = EFI_HII_SIBT_DUPLICATE. - - @param StringId The string identifier of a previously - defined string with the exact same string - text. Description - - -**/ -typedef struct _EFI_HII_SIBT_DUPLICATE_BLOCK { - EFI_HII_STRING_BLOCK Header; - EFI_STRING_ID StringId; -} EFI_HII_SIBT_DUPLICATE_BLOCK; - -/** - - Any strings with a string identifier greater than or equal to - StringIdCurrent are empty. - - @param Header Standard string block header, where - Header.BlockType = EFI_HII_SIBT_END. - -**/ -typedef struct _EFI_HII_SIBT_END_BLOCK { - EFI_HII_STRING_BLOCK Header; -} EFI_HII_SIBT_END_BLOCK; - - -/** - - These are reserved for future expansion, with length bytes - included so that they can be easily skip - - @param Header Standard string block header, where - Header.BlockType = EFI_HII_SIBT_EXT1, - EFI_HII_SIBT_EXT2 or EFI_HII_SIBT_EXT4. - - @param Length Size of the string block, in bytes. - -**/ -typedef struct _EFI_HII_SIBT_EXT1_BLOCK { - EFI_HII_STRING_BLOCK Header; - UINT8 BlockType2; - UINT8 Length; -} EFI_HII_SIBT_EXT1_BLOCK; - -/** - - These are reserved for future expansion, with length bytes - included so that they can be easily skip - - @param Header Standard string block header, where - Header.BlockType = EFI_HII_SIBT_EXT1, - EFI_HII_SIBT_EXT2 or EFI_HII_SIBT_EXT4. - - @param Length Size of the string block, in bytes. - -**/ -typedef struct _EFI_HII_SIBT_EXT2_BLOCK { - EFI_HII_STRING_BLOCK Header; - UINT8 BlockType2; - UINT16 Length; -} EFI_HII_SIBT_EXT2_BLOCK; - -/** - - These are reserved for future expansion, with length bytes - included so that they can be easily skip - - @param Header Standard string block header, where - Header.BlockType = EFI_HII_SIBT_EXT1, - EFI_HII_SIBT_EXT2 or EFI_HII_SIBT_EXT4. - - @param Length Size of the string block, in bytes. - -**/ -typedef struct _EFI_HII_SIBT_EXT4_BLOCK { - EFI_HII_STRING_BLOCK Header; - UINT8 BlockType2; - UINT32 Length; -} EFI_HII_SIBT_EXT4_BLOCK; - -/** - - Associates a font identifier FontId with a font name FontName, - size FontSize and style FontStyle. This font identifier may be - used with the string blocks. The font identifier 0 is the - default font for those string blocks which do not specify a font - identifier. - - @param Header Standard extended header, where - Header.BlockType = EFI_HII_SIBT_FONT. - - @param FontId Font identifier, which must be unique within - the font package. - - @param FontSize Character cell size, in pixels, of the font. - - @param FontStyle Font style. - - @param FontName Null-terminated font family name. - -**/ -typedef struct _EFI_HII_SIBT_FONT_BLOCK { - EFI_HII_SIBT_EXT2_BLOCK Header; - UINT8 FontId; - UINT16 FontSize; - EFI_HII_FONT_STYLE FontStyle; - CHAR16 FontName[1]; -} EFI_HII_SIBT_FONT_BLOCK; - -/** - - Increments the current string identifier StringIdCurrent by the - number specified. - - @param Header Standard string block header, where - Header.BlockType = EFI_HII_SIBT_SKIP1. - - @param SkipCount The unsigned 8-bit value to add to - StringIdCurrent. - -**/ -typedef struct _EFI_HII_SIBT_SKIP1_BLOCK { - EFI_HII_STRING_BLOCK Header; - UINT8 SkipCount; -} EFI_HII_SIBT_SKIP1_BLOCK; - -/** - - Increments the current string identifier StringIdCurrent by - the number specified. - - @param Header Standard string block header, where - Header.BlockType = EFI_HII_SIBT_SKIP2. - - @param SkipCount The unsigned 16-bit value to add to - StringIdCurrent. - -**/ -typedef struct _EFI_HII_SIBT_SKIP2_BLOCK { - EFI_HII_STRING_BLOCK Header; - UINT16 SkipCount; -} EFI_HII_SIBT_SKIP2_BLOCK; - -/** - - This string block provides the SCSU-encoded text for the string - in the default font with string identifier StringIdCurrent and - increments StringIdCurrent by one. - - @param Header Standard header where Header.BlockType = - EFI_HII_SIBT_STRING_SCSU. - - @param StringText The string text is a null-terminated - string, which is assigned to the string - identifier StringIdCurrent. - -**/ -typedef struct _EFI_HII_SIBT_STRING_SCSU_BLOCK { - EFI_HII_STRING_BLOCK Header; - UINT8 StringText[1]; -} EFI_HII_SIBT_STRING_SCSU_BLOCK; - - -/** - - This string block provides the SCSU-encoded text for the string - in the font specified by FontIdentifier with string identifier - StringIdCurrent and increments StringIdCurrent by one. - - @param Header Standard string block header, where - Header.BlockType = EFI_HII_SIBT_STRING_SCSU_FONT. - - @param FontIdentifier The identifier of the font to be used - as the starting font for the entire - string. The identifier must either be - 0 for the default font or an - identifier previously specified by an - EFI_HII_SIBT_FONT block. Any string - characters that deviates from this - font family, size or style must - provide an explicit control character. - - @param StringText The string text is a null-terminated - encoded string, which is assigned to the - string identifier StringIdCurrent. - - -**/ -typedef struct _EFI_HII_SIBT_STRING_SCSU_FONT_BLOCK { - EFI_HII_STRING_BLOCK Header; - UINT8 FontIdentifier; - UINT8 StringText[1]; -} EFI_HII_SIBT_STRING_SCSU_FONT_BLOCK; - - -/** - - This string block provides the SCSU-encoded text for StringCount - strings which have the default font and which have sequential - string identifiers. The strings are assigned the identifiers, - starting with StringIdCurrent and continuing through - StringIdCurrent + StringCount ??C 1. StringIdCurrent is - incremented by StringCount. - - @param Header Standard header where Header.BlockType = - EFI_HII_SIBT_STRINGS_SCSU. - - @param StringCount Number of strings in StringText. - - @param StringText The strings, where each string is a - null-terminated encoded string. - -**/ -typedef struct _EFI_HII_SIBT_STRINGS_SCSU_BLOCK { - EFI_HII_STRING_BLOCK Header; - UINT16 StringCount; - UINT8 StringText[1]; -} EFI_HII_SIBT_STRINGS_SCSU_BLOCK; - - -/** - - This string block provides the SCSU-encoded text for StringCount - strings which have the font specified by FontIdentifier and - which have sequential string identifiers. The strings are - assigned the identifiers, starting with StringIdCurrent and - continuing through StringIdCurrent + StringCount ??C 1. - StringIdCurrent is incremented by StringCount. - - @param Header Standard header where Header.BlockType = - EFI_HII_SIBT_STRINGS_SCSU_FONT. - - @param StringCount Number of strings in StringText. - - @param FontIdentifier The identifier of the font to be used - as the starting font for the entire - string. The identifier must either be - 0 for the default font or an - identifier previously specified by an - EFI_HII_SIBT_FONT block. Any string - characters that deviates from this - font family, size or style must - provide an explicit control character. - - @param StringText The strings, where each string is a - null-terminated encoded string. - -**/ -typedef struct _EFI_HII_SIBT_STRINGS_SCSU_FONT_BLOCK { - EFI_HII_STRING_BLOCK Header; - UINT16 StringCount; - UINT8 FontIdentifier; - UINT8 StringText[1]; -} EFI_HII_SIBT_STRINGS_SCSU_FONT_BLOCK; - - -/** - - This string block provides the UCS-2 encoded text for the string - in the default font with string identifier StringIdCurrent and - increments StringIdCurrent by one. - - @param Header Standard header where Header.BlockType = - EFI_HII_SIBT_STRING_UCS2. - - @param StringText The string text is a null-terminated UCS-2 - string, which is assigned to the string - identifier StringIdCurrent. - -**/ -typedef struct _EFI_HII_SIBT_STRING_UCS2_BLOCK { - EFI_HII_STRING_BLOCK Header; - CHAR16 StringText[1]; -} EFI_HII_SIBT_STRING_UCS2_BLOCK; - - -/** - - This string block provides the UCS-2 encoded text for the string - in the font specified by FontIdentifier with string identifier - StringIdCurrent and increments StringIdCurrent by one - - @param Header Standard header where Header.BlockType = - EFI_HII_SIBT_STRING_UCS2_FONT. - - @param FontIdentifier The identifier of the font to be used - as the starting font for the entire - string. The identifier must either be - 0 for the default font or an - identifier previously specified by an - EFI_HII_SIBT_FONT block. Any string - characters that deviates from this - font family, size or style must - provide an explicit control character. - - @param StringText The string text is a null-terminated UCS-2 - string, which is assigned to the string - identifier StringIdCurrent. - -**/ -typedef struct _EFI_HII_SIBT_STRING_UCS2_FONT_BLOCK { - EFI_HII_STRING_BLOCK Header; - UINT8 FontIdentifier; - CHAR16 StringText[1]; -} EFI_HII_SIBT_STRING_UCS2_FONT_BLOCK; - - -/** - - This string block provides the UCS-2 encoded text for the - strings in the default font with string identifiers - StringIdCurrent to StringIdCurrent + StringCount - 1 and - increments StringIdCurrent by StringCount. - - @param Header Standard header where Header.BlockType = - EFI_HII_SIBT_STRINGS_UCS2. - - @param StringCount Number of strings in StringText. - - @param StringText The string text is a series of - null-terminated UCS-2 strings, which are - assigned to the string identifiers - StringIdCurrent.to StringIdCurrent + - StringCount - 1. - -**/ -typedef struct _EFI_HII_SIBT_STRINGS_UCS2_BLOCK { - EFI_HII_STRING_BLOCK Header; - UINT16 StringCount; - CHAR16 StringText[1]; -} EFI_HII_SIBT_STRINGS_UCS2_BLOCK; - - -/** - - The fixed header consists of a standard record header and the - offsets of the image and palette information. - - @param Header Standard package header, where Header.Type = - EFI_HII_PACKAGE_IMAGES. ImageInfoOffset - Offset, relative to this header, of the image - information. If this is zero, then there are - no images in the package. - - @param PaletteInfoOffset Offset, relative to this header, of - the palette information. If this is - zero, then there are no palettes in - the image package. - -**/ -typedef struct _EFI_HII_IMAGE_PACKAGE_HDR { - EFI_HII_PACKAGE_HEADER Header; - UINT32 ImageInfoOffset; - UINT32 PaletteInfoOffset; -} EFI_HII_IMAGE_PACKAGE_HDR; - - -// -// EFI_HII_IMAGE_BLOCK -// -typedef struct _EFI_HII_IMAGE_BLOCK { - UINT8 BlockType; - UINT8 BlockBody[1]; -} EFI_HII_IMAGE_BLOCK; - -// -// EFI_HII_IMAGE_BLOCK.BlockType. -// -#define EFI_HII_IIBT_END 0x00 -#define EFI_HII_IIBT_IMAGE_1BIT 0x10 -#define EFI_HII_IIBT_IMAGE_1BIT_TRANS 0x11 -#define EFI_HII_IIBT_IMAGE_4BIT 0x12 -#define EFI_HII_IIBT_IMAGE_4BIT_TRANS 0x13 -#define EFI_HII_IIBT_IMAGE_8BIT 0x14 -#define EFI_HII_IIBT_IMAGE_8BIT_TRANS 0x15 -#define EFI_HII_IIBT_IMAGE_24BIT 0x16 -#define EFI_HII_IIBT_IMAGE_24BIT_TRANS 0x17 -#define EFI_HII_IIBT_IMAGE_JPEG 0x18 -#define EFI_HII_IIBT_DUPLICATE 0x20 -#define EFI_HII_IIBT_SKIP2 0x21 -#define EFI_HII_IIBT_SKIP1 0x22 -#define EFI_HII_IIBT_EXT1 0x30 -#define EFI_HII_IIBT_EXT2 0x31 -#define EFI_HII_IIBT_EXT4 0x32 - - -/** - - Any images with an image identifier greater than or equal to - ImageIdCurrent are empty. - - @param Header Standard image block header, where - Header.BlockType = EFI_HII_IIBT_END. - -**/ -typedef struct _EFI_HII_IIBT_END_BLOCK { - EFI_HII_IMAGE_BLOCK Header; -} EFI_HII_IIBT_END_BLOCK; - - -/** - - Future extensions for image records which need a length-byte - length use this prefix. - - @param Header Standard image block header, where - Header.BlockType = EFI_HII_IIBT_EXT1, - EFI_HII_IIBT_EXT2 or EFI_HII_IIBT_EXT4. - - @param Length Size of the image block, in bytes, including - the image block header. - -**/ -typedef struct _EFI_HII_IIBT_EXT1_BLOCK { - EFI_HII_IMAGE_BLOCK Header; - UINT8 BlockType2; - UINT8 Length; -} EFI_HII_IIBT_EXT1_BLOCK; - -/** - - Future extensions for image records which need a length-byte - length use this prefix. - - @param Header Standard image block header, where - Header.BlockType = EFI_HII_IIBT_EXT1, - EFI_HII_IIBT_EXT2 or EFI_HII_IIBT_EXT4. - - @param Length Size of the image block, in bytes, including - the image block header. - -**/ -typedef struct _EFI_HII_IIBT_EXT2_BLOCK { - EFI_HII_IMAGE_BLOCK Header; - UINT8 BlockType2; - UINT16 Length; -} EFI_HII_IIBT_EXT2_BLOCK; - -/** - - Future extensions for image records which need a length-byte - length use this prefix. - - @param Header Standard image block header, where - Header.BlockType = EFI_HII_IIBT_EXT1, - EFI_HII_IIBT_EXT2 or EFI_HII_IIBT_EXT4. - - @param Length Size of the image block, in bytes, including - the image block header. - -**/ -typedef struct _EFI_HII_IIBT_EXT4_BLOCK { - EFI_HII_IMAGE_BLOCK Header; - UINT8 BlockType2; - UINT32 Length; -} EFI_HII_IIBT_EXT4_BL0CK; - -// -// EFI_HII_IIBT_IMAGE_1BIT_BASE -// -typedef struct _EFI_HII_IIBT_IMAGE_1BIT_BASE { - UINT16 Width; - UINT16 Height; - // UINT8 Data[...]; -} EFI_HII_IIBT_IMAGE_1BIT_BASE; - -/** - - This record assigns the 1-bit-per-pixel bitmap data to the - ImageIdCurrent identifier and increment ImageIdCurrent by one. - The data in the EFI_HII_IMAGE_1BIT_TRANS structure is exactly - the same as the EFI_HII_IMAGE_1BIT structure, the difference is - how the data is treated. The bitmap pixel value 0 is the - transparency value and will not be written to the - screen. The bitmap pixel value 1 will be translated to the color - specified by Palette. - - @param Header Standard image header, where Header.BlockType - = EFI_HII_IIBT_IMAGE_1BIT_TRANS. - - @param PaletteIndex Index of the palette in the palette - information. - - @param Bitmap The bitmap specifies a series of pixels, one - bit per pixel, left-to-right, top-to-bottom, - and is padded out to the nearest byte. The - number of bytes per bitmap can be calculated - as: ((Width + 7)/8) * Height. - -**/ -typedef struct _EFI_HII_IBIT_IMAGE_1BIT_BLOCK { - EFI_HII_IMAGE_BLOCK Header; - UINT8 PaletteIndex; - EFI_HII_IIBT_IMAGE_1BIT_BASE Bitmap; -} EFI_HII_IIBT_IMAGE_1BIT_BLOCK; - -typedef EFI_HII_IIBT_IMAGE_1BIT_BLOCK EFI_HII_IIBT_IMAGE_1BIT_TRANS_BLOCK; - - -// -// EFI_HII_RGB_PIXEL -// -typedef struct _EFI_HII_RGB_PIXEL { - UINT8 b; - UINT8 g; - UINT8 r; -} EFI_HII_RGB_PIXEL; - -// -// FI_HII_IIBT_IMAGE_24BIT_BASE -// -typedef struct _EFI_HII_IIBT_IMAGE_24BIT_BASE { - UINT16 Width; - UINT16 Height; - // EFI_HII_RGB_PIXEL Bitmap[...]; -} EFI_HII_IIBT_IMAGE_24BIT_BASE; - -/** - - This record assigns the 24-bit-per-pixel bitmap data to the - ImageIdCurrent identifier and increment ImageIdCurrent by one. - The image's upper left hand corner pixel is composed of the - first three bitmap bytes. The first byte is the pixel????s blue - component value, the next byte is the pixel????s green component - value, and the third byte is the pixel's red component value - (B,G,R). Each color component value can vary from 0x00 (color - off) to 0xFF (color full on), allowing 16.8 millions colors that - can be specified. - - @param Header Standard image header, where Header.BlockType - = EFI_HII_IIBT_IMAGE_24BIT. Bitmap The bitmap - specifies a series of pixels, 24 bits per - pixel, left-to-right, top-to-bottom. The - number of bytes per bitmap can be calculated - as: (Width * 3) * Height. - - @param Type See EFI_HII_RGB_PIXEL definition. - -**/ -typedef struct { - EFI_HII_IMAGE_BLOCK Header; - EFI_HII_IIBT_IMAGE_24BIT_BASE Bitmap; -} EFI_HII_IIBT_IMAGE_24BIT_BLOCK; - -typedef EFI_HII_IIBT_IMAGE_24BIT_BLOCK EFI_HII_IIBT_IMAGE_24BIT_TRANS_BLOCK; - - - -// -// EFI_HII_IIBT_IMAGE_4BIT_BASE -// -typedef struct _EFI_HII_IIBT_IMAGE_4BIT_BASE { - UINT16 Width; - UINT16 Height; - // UINT8 Data[...]; -} EFI_HII_IIBT_IMAGE_4BIT_BASE; - -/** - - This record assigns the 4-bit-per-pixel bitmap data to the - ImageIdCurrent identifier using the specified palette and - increment ImageIdCurrent by one. The image????s upper left hand - corner pixel is the most significant nibble of the first bitmap - byte. - - @param Header Standard image header, where Header.BlockType - = EFI_HII_IIBT_IMAGE_4BIT. - - @param PaletteIndex Index of the palette in the palette - information. - - @param Bitmap The bitmap specifies a series of pixels, four - bits per pixel, left-to-right, top-to-bottom, - and is padded out to the nearest byte. The - number of bytes per bitmap can be calculated - as: ((Width + 1)/2) Height. - -**/ -typedef struct _EFI_HII_IIBT_IMAGE_4BIT_BLOCK { - EFI_HII_IMAGE_BLOCK Header; - UINT8 PaletteIndex; - EFI_HII_IIBT_IMAGE_4BIT_BASE Bitmap; -} EFI_HII_IIBT_IMAGE_4BIT_BLOCK; - -typedef EFI_HII_IIBT_IMAGE_4BIT_BLOCK EFI_HII_IIBT_IMAGE_4BIT_TRANS_BLOCK; - - - -// -// EFI_HII_IIBT_IMAGE_8BIT_BASE -// -typedef struct _EFI_HII_IIBT_IMAGE_8BIT_BASE { - UINT16 Width; - UINT16 Height; - // UINT8 Data[...]; -} EFI_HII_IIBT_IMAGE_8BIT_BASE; - -/** - - This record assigns the 8-bit-per-pixel bitmap data to the - ImageIdCurrent identifier using the specified palette and - increment ImageIdCurrent by one. The image????s upper left hand - corner pixel is the first bitmap byte. - - @param Header Standard image header, where Header.BlockType - = EFI_HII_IIBT_IMAGE_8BIT. - - @param PaletteIndex Index of the palette in the palette - information. - - @param Bitmap The bitmap specifies a series of pixels, eight - bits per pixel, left-to-right, top-to-bottom. - The number of bytes per bitmap can be - calculated as: Width * Height. - -**/ -typedef struct _EFI_HII_IIBT_IMAGE_8BIT_PALETTE { - EFI_HII_IMAGE_BLOCK Header; - UINT8 PaletteIndex; - EFI_HII_IIBT_IMAGE_8BIT_BASE Bitmap; -} EFI_HII_IIBT_IMAGE_8BIT_PALETTE; - -typedef EFI_HII_IIBT_IMAGE_8BIT_PALETTE EFI_HII_IIBT_IMAGE_8BIT_TRANS_BLOCK; - - -/** - - Indicates that the image with image ID ImageValueCurrent has the - same image as a previously defined image ID and increments - ImageValueCurrent by one - - @param Header Standard image header, where Header.BlockType - = EFI_HII_IIBT_DUPLICATE. - - @param ImageId The previously defined image ID with the exact - same image. - - -**/ -typedef struct _EFI_HII_IIBT_DUPLICATE_BLOCK { - EFI_HII_IMAGE_BLOCK Header; - EFI_IMAGE_ID ImageId; -} EFI_HII_IIBT_DUPLICATE_BLOCK; - - -/** - - This record assigns the JPEG image data to the ImageIdCurrent - identifier and increment ImageIdCurrent by one. The JPEG decoder - is only required to cover the basic JPEG encoding types, which - are produced by standard available paint packages (for example: - MSPaint under Windows from Microsoft). This would include JPEG - encoding of high (1:1:1) and medium (4:1:1) quality with only - three components (R,G,B) ??C no support for the special gray - component encoding. - - @param Header Standard image header, where Header.BlockType - = EFI_HII_IIBT_IMAGE_JPEG. - - @param Size Specifies the size of the JPEG encoded data. - - @param Data JPEG encoded data with ????JFIF???? signature at - offset 6 in the data block. The JPEG encoded - data, specifies type of encoding and final size - of true-color image. - -**/ -typedef struct _EFI_HII_IIBT_JPEG { - EFI_HII_IMAGE_BLOCK Header; - UINT32 Size; - //UINT8 Data[ ¡­ ]; -} EFI_HII_IIBT_JPEG; - - -/** - - Increments the current image ID ImageIdCurrent by the number - specified. - - @param Header Standard image header, where Header.BlockType - = EFI_HII_IIBT_SKIP1. - - @param SkipCount The unsigned 8-bit value to add to - ImageIdCurrent. - -**/ -typedef struct _EFI_HII_IIBT_SKIP1_BLOCK { - EFI_HII_IMAGE_BLOCK Header; - UINT8 SkipCount; -} EFI_HII_IIBT_SKIP1_BLOCK; - -/** - - Increments the current image ID ImageIdCurrent by the number - specified. - - @param Header Standard image header, where Header.BlockType - = EFI_HII_IIBT_SKIP2. - - @param SkipCount The unsigned 16-bit value to add to - ImageIdCurrent. - -**/ -typedef struct _EFI_HII_IIBT_SKIP2_BLOCK { - EFI_HII_IMAGE_BLOCK Header; - UINT16 SkipCount; -} EFI_HII_IIBT_SKIP2_BLOCK; - - -/** - - This fixed header is followed by zero or more variable-length - palette information records. The structures are assigned a - number 1 to n. - - @param PaletteCount Number of palettes. - -**/ -typedef struct _EFI_HII_IMAGE_PALETTE_INFO_HEADER { - UINT16 PaletteCount; -} EFI_HII_IMAGE_PALETTE_INFO_HEADER; - -/** - - Each palette information record is an array of 24-bit color - structures. The first entry (PaletteValue[0]) corresponds to - color 0 in the source image; the second entry (PaletteValue[1]) - corresponds to color 1, etc. Each palette entry is a three byte - entry, with the first byte equal to the blue component of the - color, followed by green, and finally red (B,G,R). Each color - component value can vary from 0x00 (color off) to 0xFF (color - full on), allowing 16.8 millions colors that can be specified. - - @param PaletteSize Size of the palette information. - - @param PaletteValue Array of color values. - -**/ -typedef struct _EFI_HII_IMAGE_PALETTE_INFO { - UINT16 PaletteSize; - // EFI_HII_RGB_PIXEL PaletteValue[...]; -} EFI_HII_IMAGE_PALETTE_INFO; - - // // EFI_HII_DATABASE_NOTIFY_TYPE @@ -1503,11 +59,11 @@ typedef UINTN EFI_HII_DATABASE_NOTIFY_TYPE; typedef EFI_STATUS (EFIAPI *EFI_HII_DATABASE_NOTIFY) ( - IN CONST UINT8 PackageType, + IN UINT8 PackageType, IN CONST EFI_GUID *PackageGuid, IN CONST EFI_HII_PACKAGE_HEADER *Package, - IN CONST EFI_HII_HANDLE Handle, - IN CONST EFI_HII_DATABASE_NOTIFY_TYPE NotifyType + IN EFI_HII_HANDLE Handle, + IN EFI_HII_DATABASE_NOTIFY_TYPE NotifyType ); /** @@ -1531,7 +87,7 @@ EFI_STATUS @param DriverHandle Associate the package list with this EFI handle Handle A pointer to the - EFI_HII_HANDLE instance. + EFI_HII_HANDLE instance. @retval EFI_SUCCESS The package list associated with the Handle was added to the HII database. @@ -1546,11 +102,11 @@ EFI_STATUS **/ typedef EFI_STATUS -(EFIAPI *EFI_HII_NEW_PACK) ( +(EFIAPI *EFI_HII_DATABASE_NEW_PACK) ( IN CONST EFI_HII_DATABASE_PROTOCOL *This, IN CONST EFI_HII_PACKAGE_LIST_HEADER *PackageList, - IN CONST EFI_HANDLE DriverHandle, - OUT EFI_HII_HANDLE *Handle + IN EFI_HANDLE DriverHandle, + OUT EFI_HII_HANDLE *Handle ); @@ -1577,9 +133,9 @@ EFI_STATUS **/ typedef EFI_STATUS -(EFIAPI *EFI_HII_REMOVE_PACK) ( +(EFIAPI *EFI_HII_DATABASE_REMOVE_PACK) ( IN CONST EFI_HII_DATABASE_PROTOCOL *This, - IN CONST EFI_HII_HANDLE Handle + IN EFI_HII_HANDLE Handle ); @@ -1626,9 +182,9 @@ EFI_STATUS **/ typedef EFI_STATUS -(EFIAPI *EFI_HII_UPDATE_PACK) ( +(EFIAPI *EFI_HII_DATABASE_UPDATE_PACK) ( IN CONST EFI_HII_DATABASE_PROTOCOL *This, - IN CONST EFI_HII_HANDLE Handle, + IN EFI_HII_HANDLE Handle, IN CONST EFI_HII_PACKAGE_LIST_HEADER *PackageList ); @@ -1660,7 +216,7 @@ EFI_STATUS that is required for the handles found. - @param Handle An array of EFI_HII_HANDLE instances returned. + @param Handle An array of EFI_HII_HANDLE instances returned. @retval EFI_SUCCESS Handle was updated successfully. @@ -1676,12 +232,12 @@ EFI_STATUS **/ typedef EFI_STATUS -(EFIAPI *EFI_HII_LIST_PACKS) ( +(EFIAPI *EFI_HII_DATABASE_LIST_PACKS) ( IN CONST EFI_HII_DATABASE_PROTOCOL *This, - IN CONST UINT8 PackageType, + IN UINT8 PackageType, IN CONST EFI_GUID *PackageGuid, IN OUT UINTN *HandleBufferLength, - OUT EFI_HII_HANDLE *Handle + OUT EFI_HII_HANDLE *Handle ); @@ -1704,7 +260,7 @@ EFI_STATUS @param This A pointer to the EFI_HII_DATABASE_PROTOCOL instance. - @param Handle An EFI_HII_HANDLE that corresponds to the + @param Handle An EFI_HII_HANDLE that corresponds to the desired package list in the HII database to export or NULL to indicate all package lists should be exported. @@ -1726,11 +282,11 @@ EFI_STATUS **/ typedef EFI_STATUS -(EFIAPI *EFI_HII_EXPORT_PACKS) ( - IN CONST EFI_HII_DATABASE_PROTOCOL *This, - IN CONST EFI_HII_HANDLE Handle, - IN OUT UINTN *BufferSize, - OUT EFI_HII_PACKAGE_HEADER *Buffer +(EFIAPI *EFI_HII_DATABASE_EXPORT_PACKS) ( + IN CONST EFI_HII_DATABASE_PROTOCOL *This, + IN EFI_HII_HANDLE Handle, + IN OUT UINTN *BufferSize, + OUT EFI_HII_PACKAGE_LIST_HEADER *Buffer ); @@ -1789,12 +345,12 @@ EFI_STATUS **/ typedef EFI_STATUS -(EFIAPI *EFI_HII_REGISTER_NOTIFY) ( +(EFIAPI *EFI_HII_DATABASE_REGISTER_NOTIFY) ( IN CONST EFI_HII_DATABASE_PROTOCOL *This, - IN CONST UINT8 PackageType, + IN UINT8 PackageType, IN CONST EFI_GUID *PackageGuid, - IN CONST EFI_HII_DATABASE_NOTIFY PackageNotifyFn, - IN CONST EFI_HII_DATABASE_NOTIFY_TYPE NotifyType, + IN EFI_HII_DATABASE_NOTIFY PackageNotifyFn, + IN EFI_HII_DATABASE_NOTIFY_TYPE NotifyType, OUT EFI_HANDLE *NotifyHandle ); @@ -1817,215 +373,12 @@ EFI_STATUS **/ typedef EFI_STATUS -(EFIAPI *EFI_HII_UNREGISTER_NOTIFY) ( +(EFIAPI *EFI_HII_DATABASE_UNREGISTER_NOTIFY) ( IN CONST EFI_HII_DATABASE_PROTOCOL *This, - IN CONST EFI_HANDLE NotificationHandle + IN EFI_HANDLE NotificationHandle ); -/** - - @param Header The general pack header which defines both the - type of pack and the length of the entire - pack. - - @param LayoutCount The number of keyboard layouts contained - in the entire keyboard pack. - - @param Layout An array of LayoutCount number of keyboard - layouts. - -**/ -typedef struct { - EFI_HII_PACKAGE_HEADER Header; - UINT16 LayoutCount; - // EFI_HII_KEYBOARD_LAYOUT Layout[...]; -} EFI_HII_KEYBOARD_PACK; - -/** - - @param LayoutLength The length of the current keyboard - layout. - - @param Guid The unique ID associated with this keyboard - layout. - - @param LayoutDescriptorString An offset location (0 is the - beginning of the - EFI_KEYBOARD_LAYOUT instance) - of the string which describes - this keyboard layout. The data - that is being referenced is in - EFI_DESCRIPTION_STRING_BUNDLE - format. - - @param DescriptorCount The number of Descriptor entries in - this layout. - - @param Descriptors An array of key descriptors. - -**/ -typedef struct { - UINT16 LayoutLength; - EFI_GUID Guid; - RELOFST LayoutDescriptorString; - UINT8 DescriptorCount; - // EFI_KEY_DESCRIPTOR Descriptors[...]; -} EFI_HII_KEYBOARD_LAYOUT; - - -/** - - @param Language The language to associate with - DescriptionString. - - @param Space A space (U-0x0020) character to force as a - separator between the Language field and the - formal description string. - - @param DescriptionString A null-terminated description - string. - -**/ -typedef struct { - CHAR16 Language[3]; - CHAR16 Space; - CHAR16 DescriptionString[1]; -} EFI_DESCRIPTION_STRING; - -/** - - @param DescriptionCount The number of description strings. - - @param DescriptionString An array of language-specific - description strings. - -**/ -typedef struct { - UINT16 DescriptionCount; - // EFI_DESCRIPTION_STRING DescriptionString[]; -} EFI_DESCRIPTION_STRING_BUNDLE; - -/** - - See the figure below for which key corresponds to the values in - the enumeration above. For example, EfiKeyLCtrl corresponds to - the left control key in the lower-left corner of the keyboard, - EfiKeyFour corresponds to the 4 key on the numeric keypad, and - EfiKeySLck corresponds to the Scroll Lock key in the upper-right - corner of the keyboard. - -**/ -typedef enum { - EfiKeyLCtrl, EfiKeyA0, EfiKeyLAlt, EfiKeySpaceBar, - EfiKeyA2, EfiKeyA3, EfiKeyA4, EfiKeyRCtrl, EfiKeyLeftArrow, - EfiKeyDownArrow, EfiKeyRightArrow, EfiKeyZero, - EfiKeyPeriod, EfiKeyEnter, EfiKeyLShift, EfiKeyB0, - EfiKeyB1, EfiKeyB2, EfiKeyB3, EfiKeyB4, EfiKeyB5, EfiKeyB6, - EfiKeyB7, EfiKeyB8, EfiKeyB9, EfiKeyB10, EfiKeyRshift, - EfiKeyUpArrow, EfiKeyOne, EfiKeyTwo, EfiKeyThree, - EfiKeyCapsLock, EfiKeyC1, EfiKeyC2, EfiKeyC3, EfiKeyC4, - EfiKeyC5, EfiKeyC6, EfiKeyC7, EfiKeyC8, EfiKeyC9, - EfiKeyC10, EfiKeyC11, EfiKeyC12, EfiKeyFour, EfiKeyFive, - EfiKeySix, EfiKeyPlus, EfiKeyTab, EfiKeyD1, EfiKeyD2, - EfiKeyD3, EfiKeyD4, EfiKeyD5, EfiKeyD6, EfiKeyD7, EfiKeyD8, - EfiKeyD9, EfiKeyD10, EfiKeyD11, EfiKeyD12, EfiKeyD13, - EfiKeyDel, EfiKeyEnd, EfiKeyPgDn, EfiKeySeven, EfiKeyEight, - EfiKeyNine, EfiKeyE0, EfiKeyE1, EfiKeyE2, EfiKeyE3, - EfiKeyE4, EfiKeyE5, EfiKeyE6, EfiKeyE7, EfiKeyE8, EfiKeyE9, - EfiKeyE10, EfiKeyE11, EfiKeyE12, EfiKeyBackSpace, - EfiKeyIns, EfiKeyHome, EfiKeyPgUp, EfiKeyNLck, EfiKeySlash, - EfiKeyAsterisk, EfiKeyMinus, EfiKeyEsc, EfiKeyF1, EfiKeyF2, - EfiKeyF3, EfiKeyF4, EfiKeyF5, EfiKeyF6, EfiKeyF7, EfiKeyF8, - EfiKeyF9, EfiKeyF10, EfiKeyF11, EfiKeyF12, EfiKeyPrint, - EfiKeySLck, EfiKeyPause -} EFI_KEY; - -/** - - @param Key Used to describe a physical key on a keyboard. - - @param Unicode Unicode value for the Key. - - @param ShiftedUnicode Unicode value for the key with the - shift key being held down. - - @param AltGrUnicode Unicode value for the key with the - Alt-GR being held down. - - @param ShiftedAltGrUnicode Unicode value for the key with the - Alt-GR and shift keys being held down. - - @param Modifier Modifier keys are defined to allow for - special functionality that is not - necessarily accomplished by a printable - character. Many of these modifier keys are - flags to toggle certain state bits on and - off inside of a keyboard driver. - -**/ -typedef struct { - EFI_KEY Key; - CHAR16 Unicode; - CHAR16 ShiftedUnicode; - CHAR16 AltGrUnicode; - CHAR16 ShiftedAltGrUnicode; - UINT16 Modifier; -} EFI_KEY_DESCRIPTOR; - - -// -// Modifier values -// -#define EFI_NULL_MODIFIER 0x0000 -#define EFI_LEFT_CONTROL_MODIFIER 0x0001 -#define EFI_RIGHT_CONTROL_MODIFIER 0x0002 -#define EFI_LEFT_ALT_MODIFIER 0x0003 -#define EFI_RIGHT_ALT_MODIFIER 0x0004 -#define EFI_ALT_GR_MODIFIER 0x0005 -#define EFI_INSERT_MODIFIER 0x0006 -#define EFI_DELETE_MODIFIER 0x0007 -#define EFI_PAGE_DOWN_MODIFIER 0x0008 -#define EFI_PAGE_UP_MODIFIER 0x0009 -#define EFI_HOME_MODIFIER 0x000A -#define EFI_END_MODIFIER 0x000B -#define EFI_LEFT_SHIFT_MODIFIER 0x000C -#define EFI_RIGHT_SHIFT_MODIFIER 0x000D -#define EFI_CAPS_LOCK_MODIFIER 0x000E -#define EFI_NUM_LOCK _MODIFIER 0x000F -#define EFI_LEFT_ARROW_MODIFIER 0x0010 -#define EFI_RIGHT_ARROW_MODIFIER 0x0011 -#define EFI_DOWN_ARROW_MODIFIER 0x0012 -#define EFI_UP_ARROW_MODIFIER 0X0013 -#define EFI_NS_KEY_MODIFIER 0x0014 -#define EFI_NS_KEY_DEPENDENCY_MODIFIER 0x0015 -#define EFI_FUNCTION_KEY_ONE_MODIFIER 0x0016 -#define EFI_FUNCTION_KEY_TWO_MODIFIER 0x0017 -#define EFI_FUNCTION_KEY_THREE_MODIFIER 0x0018 -#define EFI_FUNCTION_KEY_FOUR_MODIFIER 0x0019 -#define EFI_FUNCTION_KEY_FIVE_MODIFIER 0x001A -#define EFI_FUNCTION_KEY_SIX_MODIFIER 0x001B -#define EFI_FUNCTION_KEY_SEVEN_MODIFIER 0x001C -#define EFI_FUNCTION_KEY_EIGHT_MODIFIER 0x001D -#define EFI_FUNCTION_KEY_NINE_MODIFIER 0x001E -#define EFI_FUNCTION_KEY_TEN_MODIFIER 0x001F -#define EFI_FUNCTION_KEY_ELEVEN_MODIFIER 0x0020 -#define EFI_FUNCTION_KEY_TWELVE_MODIFIER 0x0021 -// -// Keys that have multiple control functions based on modifier -// settings are handled in the keyboard driver implementation. -// For instance PRINT_KEY might have a modifier held down and -// is still a nonprinting character, but might have an alternate -// control function like SYSREQUEST -// -#define EFI_PRINT_MODIFIER 0x0022 -#define EFI_SYS_REQUEST_MODIFIER 0x0023 -#define EFI_SCROLL_LOCK_MODIFIER 0x0024 -#define EFI_PAUSE_MODIFIER 0x0025 -#define EFI_BREAK_MODIFIER 0x0026 - - - /** This routine retrieves an array of GUID values for each keyboard @@ -2089,6 +442,7 @@ EFI_STATUS (EFIAPI *EFI_HII_GET_KEYBOARD_LAYOUT) ( IN CONST EFI_HII_DATABASE_PROTOCOL *This, IN CONST EFI_GUID *KeyGuid, + IN OUT UINT16 *KeyboardLayoutLength, OUT EFI_HII_KEYBOARD_LAYOUT *KeyboardLayout ); @@ -2129,7 +483,7 @@ EFI_STATUS @param This A pointer to the EFI_HII_DATABASE_PROTOCOL instance. - @param PackageListHandle An EFI_HII_HANDLE that corresponds + @param PackageListHandle An EFI_HII_HANDLE that corresponds to the desired package list in the HIIdatabase. @@ -2146,9 +500,9 @@ EFI_STATUS **/ typedef EFI_STATUS -(EFIAPI *EFI_HII_GET_PACK_HANDLE) ( +(EFIAPI *EFI_HII_DATABASE_GET_PACK_HANDLE) ( IN CONST EFI_HII_DATABASE_PROTOCOL *This, - IN CONST EFI_HII_HANDLE PackageListHandle, + IN EFI_HII_HANDLE PackageListHandle, OUT EFI_HANDLE *DriverHandle ); @@ -2190,20 +544,21 @@ EFI_STATUS **/ struct _EFI_HII_DATABASE_PROTOCOL { - EFI_HII_NEW_PACK NewPackageList; - EFI_HII_REMOVE_PACK RemovePackageList; - EFI_HII_UPDATE_PACK UpdatePackageList; - EFI_HII_LIST_PACKS ListPackageLists; - EFI_HII_EXPORT_PACKS ExportPackageLists; - EFI_HII_REGISTER_NOTIFY RegisterPackageNotify; - EFI_HII_UNREGISTER_NOTIFY UnregisterPackageNotify; - EFI_HII_FIND_KEYBOARD_LAYOUTS FindKeyboardLayouts; - EFI_HII_GET_KEYBOARD_LAYOUT GetKeyboardLayout; - EFI_HII_SET_KEYBOARD_LAYOUT SetKeyboardLayout; - EFI_HII_GET_PACK_HANDLE GetPackageHandle; + EFI_HII_DATABASE_NEW_PACK NewPackageList; + EFI_HII_DATABASE_REMOVE_PACK RemovePackageList; + EFI_HII_DATABASE_UPDATE_PACK UpdatePackageList; + EFI_HII_DATABASE_LIST_PACKS ListPackageLists; + EFI_HII_DATABASE_EXPORT_PACKS ExportPackageLists; + EFI_HII_DATABASE_REGISTER_NOTIFY RegisterPackageNotify; + EFI_HII_DATABASE_UNREGISTER_NOTIFY UnregisterPackageNotify; + EFI_HII_FIND_KEYBOARD_LAYOUTS FindKeyboardLayouts; + EFI_HII_GET_KEYBOARD_LAYOUT GetKeyboardLayout; + EFI_HII_SET_KEYBOARD_LAYOUT SetKeyboardLayout; + EFI_HII_DATABASE_GET_PACK_HANDLE GetPackageListHandle; }; extern EFI_GUID gEfiHiiDatabaseProtocolGuid; #endif + diff --git a/MdePkg/Include/Protocol/HiiFont.h b/MdePkg/Include/Protocol/HiiFont.h index c9568aac5a..644416f6e5 100644 --- a/MdePkg/Include/Protocol/HiiFont.h +++ b/MdePkg/Include/Protocol/HiiFont.h @@ -18,8 +18,6 @@ #include #include -#error "UEFI 2.1 HII is not fully implemented for now, Please don't include this file now." - #define EFI_HII_FONT_PROTOCOL_GUID \ { 0xe9ca4775, 0x8657, 0x47fc, { 0x97, 0xe7, 0x7e, 0xd6, 0x5a, 0x8, 0x43, 0x24 } } @@ -264,12 +262,12 @@ typedef EFI_STATUS (EFIAPI *EFI_HII_STRING_TO_IMAGE) ( IN CONST EFI_HII_FONT_PROTOCOL *This, - IN CONST EFI_HII_OUT_FLAGS Flags, + IN EFI_HII_OUT_FLAGS Flags, IN CONST EFI_STRING String, IN CONST EFI_FONT_DISPLAY_INFO *StringInfo, IN OUT EFI_IMAGE_OUTPUT **Blt, - IN CONST UINTN BltX, - IN CONST UINTN BltY, + IN UINTN BltX, + IN UINTN BltY, OUT EFI_HII_ROW_INFO **RowInfoArray OPTIONAL, OUT UINTN *RowInfoArraySize OPTIONAL, OUT UINTN *ColumnInfoArray OPTIONAL @@ -396,14 +394,14 @@ typedef EFI_STATUS (EFIAPI *EFI_HII_STRING_ID_TO_IMAGE) ( IN CONST EFI_HII_FONT_PROTOCOL *This, - IN CONST EFI_HII_OUT_FLAGS Flags, - IN CONST EFI_HII_HANDLE PackageList, - IN CONST EFI_STRING_ID StringId, + IN EFI_HII_OUT_FLAGS Flags, + IN EFI_HII_HANDLE PackageList, + IN EFI_STRING_ID StringId, IN CONST CHAR8 *Language, IN CONST EFI_FONT_DISPLAY_INFO *StringInfo OPTIONAL, IN OUT EFI_IMAGE_OUTPUT **Blt, - IN CONST UINTN BltX, - IN CONST UINTN BltY, + IN UINTN BltX, + IN UINTN BltY, OUT EFI_HII_ROW_INFO **RowInfoArray OPTIONAL, OUT UINTN *RowInfoArraySize OPTIONAL, OUT UINTN *ColumnInfoArray OPTIONAL diff --git a/MdePkg/Include/Protocol/HiiImage.h b/MdePkg/Include/Protocol/HiiImage.h index 4958687e83..5bd84905c2 100644 --- a/MdePkg/Include/Protocol/HiiImage.h +++ b/MdePkg/Include/Protocol/HiiImage.h @@ -15,8 +15,6 @@ #ifndef __HII_IMAGE_H__ #define __HII_IMAGE_H__ -#error "UEFI 2.1 HII is not fully implemented for now, Please don't include this file now." - #define EFI_HII_IMAGE_PROTOCOL_GUID \ { 0x31a6406a, 0x6bdf, 0x4e46, { 0xb2, 0xa2, 0xeb, 0xaa, 0x89, 0xc4, 0x9, 0x20 } } @@ -47,10 +45,10 @@ typedef struct _EFI_HII_IMAGE_PROTOCOL EFI_HII_IMAGE_PROTOCOL; **/ typedef struct _EFI_IMAGE_INPUT { - UINT32 Flags; - UINT16 Width; - UINT16 Height; - EFI_GRAPHICS_OUTPUT_BLT_PIXEL *Bitmap; + UINT32 Flags; + UINT16 Width; + UINT16 Height; + EFI_GRAPHICS_OUTPUT_BLT_PIXEL Bitmap[1]; } EFI_IMAGE_INPUT; @@ -83,7 +81,7 @@ typedef EFI_STATUS (EFIAPI *EFI_HII_NEW_IMAGE) ( IN CONST EFI_HII_IMAGE_PROTOCOL *This, - IN CONST EFI_HII_HANDLE PackageList, + IN EFI_HII_HANDLE PackageList, OUT EFI_IMAGE_ID *ImageId, IN CONST EFI_IMAGE_INPUT *Image ); @@ -133,8 +131,8 @@ typedef EFI_STATUS (EFIAPI *EFI_HII_GET_IMAGE) ( IN CONST EFI_HII_IMAGE_PROTOCOL *This, - IN CONST EFI_HII_HANDLE PackageList, - IN CONST EFI_IMAGE_ID ImageId, + IN EFI_HII_HANDLE PackageList, + IN EFI_IMAGE_ID ImageId, OUT EFI_IMAGE_INPUT *Image, OUT UINTN *ImageSize ); @@ -168,9 +166,9 @@ typedef EFI_STATUS (EFIAPI *EFI_HII_SET_IMAGE) ( IN CONST EFI_HII_IMAGE_PROTOCOL *This, - IN CONST EFI_HII_HANDLE PackageList, - IN CONST EFI_IMAGE_ID ImageId, - IN CONST EFI_IMAGE_INPUT Image + IN EFI_HII_HANDLE PackageList, + IN EFI_IMAGE_ID ImageId, + IN CONST EFI_IMAGE_INPUT *Image ); @@ -264,11 +262,11 @@ typedef EFI_STATUS (EFIAPI *EFI_HII_DRAW_IMAGE) ( IN CONST EFI_HII_IMAGE_PROTOCOL *This, - IN CONST EFI_HII_DRAW_FLAGS Flags, - IN CONST EFI_IMAGE_INPUT Image, + IN EFI_HII_DRAW_FLAGS Flags, + IN CONST EFI_IMAGE_INPUT *Image, IN OUT EFI_IMAGE_OUTPUT **Blt, - IN CONST UINTN BltX, - IN CONST UINTN BltY + IN UINTN BltX, + IN UINTN BltY ); /** @@ -342,12 +340,12 @@ typedef EFI_STATUS (EFIAPI *EFI_HII_DRAW_IMAGE_ID) ( IN CONST EFI_HII_IMAGE_PROTOCOL *This, -IN CONST EFI_HII_DRAW_FLAGS Flags, -IN CONST EFI_HII_HANDLE PackageList, -IN CONST EFI_IMAGE_ID ImageId, +IN EFI_HII_DRAW_FLAGS Flags, +IN EFI_HII_HANDLE PackageList, +IN EFI_IMAGE_ID ImageId, IN OUT EFI_IMAGE_OUTPUT **Blt, -IN CONST UINTN BltX, -IN CONST UINTN BltY +IN UINTN BltX, +IN UINTN BltY ); @@ -379,3 +377,4 @@ extern EFI_GUID gEfiHiiImageProtocolGuid; #endif + diff --git a/MdePkg/Include/Protocol/HiiString.h b/MdePkg/Include/Protocol/HiiString.h index eafe5de6fe..e120e9e470 100644 --- a/MdePkg/Include/Protocol/HiiString.h +++ b/MdePkg/Include/Protocol/HiiString.h @@ -15,11 +15,12 @@ #ifndef __HII_STRING_H__ #define __HII_STRING_H__ -#error "UEFI 2.1 HII is not fully implemented for now, Please don't include this file now." - #define EFI_HII_STRING_PROTOCOL_GUID \ { 0xfd96974, 0x23aa, 0x4cdc, { 0xb9, 0xcb, 0x98, 0xd1, 0x77, 0x50, 0x32, 0x2a } } +#include +#include + typedef struct _EFI_HII_STRING_PROTOCOL EFI_HII_STRING_PROTOCOL; @@ -59,11 +60,12 @@ typedef EFI_STATUS (EFIAPI *EFI_HII_NEW_STRING) ( IN CONST EFI_HII_STRING_PROTOCOL *This, - IN CONST EFI_HII_HANDLE PackageList, - OUT EFI_STRING_ID *StringId + IN EFI_HII_HANDLE PackageList, + OUT EFI_STRING_ID *StringId, IN CONST CHAR8 *Language, + IN CONST CHAR16 *LanguageName, OPTIONAL IN CONST EFI_STRING String, - IN CONST EFI_FONT_INFO *StringFontInfo OPTIONAL, + IN CONST EFI_FONT_INFO *StringFontInfo OPTIONAL ); @@ -124,11 +126,11 @@ EFI_STATUS (EFIAPI *EFI_HII_GET_STRING) ( IN CONST EFI_HII_STRING_PROTOCOL *This, IN CONST CHAR8 *Language, - IN CONST EFI_HII_HANDLE PackageList, - IN CONST EFI_STRING_ID StringId, + IN EFI_HII_HANDLE PackageList, + IN EFI_STRING_ID StringId, OUT EFI_STRING String, - IN OUT UINTN StringSize, - OUT EFI_FONT_INFO *StringFontInfo OPTIONAL + IN OUT UINTN *StringSize, + OUT EFI_FONT_INFO **StringFontInfo OPTIONAL ); /** @@ -168,10 +170,10 @@ typedef EFI_STATUS (EFIAPI *EFI_HII_SET_STRING) ( IN CONST EFI_HII_STRING_PROTOCOL *This, - IN CONST EFI_HII_HANDLE PackageList, - IN CONST EFI_STRING_ID StringId, + IN EFI_HII_HANDLE PackageList, + IN EFI_STRING_ID StringId, IN CONST CHAR8 *Language, - IN CONST EFI_STRING String, + IN EFI_STRING String, IN CONST EFI_FONT_INFO *StringFontInfo OPTIONAL ); @@ -208,10 +210,10 @@ EFI_STATUS typedef EFI_STATUS (EFIAPI *EFI_HII_GET_LANGUAGES) ( - IN CONST EFI_HII_DATABASE_PROTOCOL *This, - IN CONST EFI_HII_HANDLE PackageList, + IN CONST EFI_HII_STRING_PROTOCOL *This, + IN EFI_HII_HANDLE PackageList, IN OUT CHAR8 *Languages, - IN OUT UINTN LanguagesSize + IN OUT UINTN *LanguagesSize ); @@ -263,12 +265,12 @@ EFI_STATUS **/ typedef EFI_STATUS -(EFIAPI *EFI_GET_2ND_LANGUAGES) ( - IN CONST EFI_HII_DATABASE_PROTOCOL *This, - IN CONST EFI_HII_HANDLE PackageList, - IN CONST CHAR8 *FirstLanguage; +(EFIAPI *EFI_HII_GET_2ND_LANGUAGES) ( + 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 OUT UINTN *SecondLanguagesSize ); @@ -301,3 +303,4 @@ extern EFI_GUID gEfiHiiStringProtocolGuid; #endif + diff --git a/MdePkg/Include/Uefi/UefiBaseType.h b/MdePkg/Include/Uefi/UefiBaseType.h index a31a40b234..f4119c1c7e 100644 --- a/MdePkg/Include/Uefi/UefiBaseType.h +++ b/MdePkg/Include/Uefi/UefiBaseType.h @@ -34,7 +34,6 @@ typedef UINTN EFI_TPL; typedef UINT64 EFI_LBA; -typedef UINT16 EFI_HII_HANDLE; typedef UINT16 STRING_REF; typedef UINT64 EFI_PHYSICAL_ADDRESS; diff --git a/MdePkg/Include/Uefi/UefiInternalFormRepresentation.h b/MdePkg/Include/Uefi/UefiInternalFormRepresentation.h index 8c08dfa35b..d13421d0db 100644 --- a/MdePkg/Include/Uefi/UefiInternalFormRepresentation.h +++ b/MdePkg/Include/Uefi/UefiInternalFormRepresentation.h @@ -26,402 +26,1463 @@ // typedef UINT32 RELOFST; -typedef CHAR16 *EFI_STRING; +typedef VOID* EFI_HII_HANDLE; +typedef CHAR16* EFI_STRING; typedef UINT16 EFI_IMAGE_ID; typedef UINT16 EFI_QUESTION_ID; typedef UINT16 EFI_STRING_ID; typedef UINT16 EFI_FORM_ID; typedef UINT16 EFI_VARSTORE_ID; +typedef UINT16 EFI_DEFAULT_ID; +typedef UINT32 EFI_HII_FONT_STYLE; -// -// IFR Op codes -// -#define EFI_IFR_FORM_OP 0x01 -#define EFI_IFR_SUBTITLE_OP 0x02 -#define EFI_IFR_TEXT_OP 0x03 -#define EFI_IFR_GRAPHIC_OP 0x04 -#define EFI_IFR_ONE_OF_OP 0x05 -#define EFI_IFR_CHECKBOX_OP 0x06 -#define EFI_IFR_NUMERIC_OP 0x07 -#define EFI_IFR_PASSWORD_OP 0x08 -#define EFI_IFR_ONE_OF_OPTION_OP 0x09 // ONEOF OPTION field -#define EFI_IFR_SUPPRESS_IF_OP 0x0A -#define EFI_IFR_END_FORM_OP 0x0B -#define EFI_IFR_HIDDEN_OP 0x0C -#define EFI_IFR_END_FORM_SET_OP 0x0D -#define EFI_IFR_FORM_SET_OP 0x0E -#define EFI_IFR_REF_OP 0x0F -#define EFI_IFR_END_ONE_OF_OP 0x10 -#define EFI_IFR_END_OP EFI_IFR_END_ONE_OF_OP -#define EFI_IFR_INCONSISTENT_IF_OP 0x11 -#define EFI_IFR_EQ_ID_VAL_OP 0x12 -#define EFI_IFR_EQ_ID_ID_OP 0x13 -#define EFI_IFR_EQ_ID_LIST_OP 0x14 -#define EFI_IFR_AND_OP 0x15 -#define EFI_IFR_OR_OP 0x16 -#define EFI_IFR_NOT_OP 0x17 -#define EFI_IFR_END_IF_OP 0x18 // for endif of inconsistentif, suppressif, grayoutif -#define EFI_IFR_GRAYOUT_IF_OP 0x19 -#define EFI_IFR_DATE_OP 0x1A -#define EFI_IFR_TIME_OP 0x1B -#define EFI_IFR_STRING_OP 0x1C -#define EFI_IFR_LABEL_OP 0x1D -#define EFI_IFR_SAVE_DEFAULTS_OP 0x1E -#define EFI_IFR_RESTORE_DEFAULTS_OP 0x1F -#define EFI_IFR_BANNER_OP 0x20 -#define EFI_IFR_INVENTORY_OP 0x21 -#define EFI_IFR_EQ_VAR_VAL_OP 0x22 -#define EFI_IFR_ORDERED_LIST_OP 0x23 -#define EFI_IFR_VARSTORE_OP 0x24 -#define EFI_IFR_VARSTORE_SELECT_OP 0x25 -#define EFI_IFR_VARSTORE_SELECT_PAIR_OP 0x26 -#define EFI_IFR_TRUE_OP 0x27 -#define EFI_IFR_FALSE_OP 0x28 -#define EFI_IFR_GT_OP 0x29 -#define EFI_IFR_GE_OP 0x2A -#define EFI_IFR_OEM_DEFINED_OP 0x2B -#define EFI_IFR_LAST_OPCODE EFI_IFR_OEM_DEFINED_OP -#define EFI_IFR_OEM_OP 0xFE -#define EFI_IFR_NV_ACCESS_COMMAND 0xFF - -// -// Define values for the flags fields in some VFR opcodes. These are -// bitmasks. -// -#define EFI_IFR_FLAG_DEFAULT 0x01 -#define EFI_IFR_FLAG_MANUFACTURING 0x02 -#define EFI_IFR_FLAG_INTERACTIVE 0x04 -#define EFI_IFR_FLAG_NV_ACCESS 0x08 -#define EFI_IFR_FLAG_RESET_REQUIRED 0x10 -#define EFI_IFR_FLAG_LATE_CHECK 0x20 - -#define EFI_NON_DEVICE_CLASS 0x00 // Useful when you do not want something in the Device Manager -#define EFI_DISK_DEVICE_CLASS 0x01 -#define EFI_VIDEO_DEVICE_CLASS 0x02 -#define EFI_NETWORK_DEVICE_CLASS 0x04 -#define EFI_INPUT_DEVICE_CLASS 0x08 -#define EFI_ON_BOARD_DEVICE_CLASS 0x10 -#define EFI_OTHER_DEVICE_CLASS 0x20 - -#define EFI_SETUP_APPLICATION_SUBCLASS 0x00 -#define EFI_GENERAL_APPLICATION_SUBCLASS 0x01 -#define EFI_FRONT_PAGE_SUBCLASS 0x02 -#define EFI_SINGLE_USE_SUBCLASS 0x03 // Used to display a single entity and then exit - -// -// Used to flag dynamically created op-codes. This is meaningful to the IFR Library set -// and the browser since we need to distinguish between compiled NV map data and created data. -// We do not allow new entries to be created in the NV map dynamically however we still need -// to display this information correctly. To dynamically create op-codes and assume that their -// data will be saved, ensure that the NV starting location they refer to is pre-defined in the -// NV map. -// -#define EFI_IFR_FLAG_CREATED 128 #pragma pack(1) + + // -// IFR Structure definitions +// HII package list // typedef struct { - UINT8 OpCode; - UINT8 Length; -} EFI_IFR_OP_HEADER; + EFI_GUID PackageListGuid; + UINT32 PackageLength; +} EFI_HII_PACKAGE_LIST_HEADER; +/** + + Each package starts with a header, as defined above, which + indicates the size and type of the package. When added to a + pointer pointing to the start of the header, Length points at + the next package. The package lists form a package list when + concatenated together and terminated with an + EFI_HII_PACKAGE_HEADER with a Type of EFI_HII_PACKAGE_END. The + type EFI_HII_PACKAGE_TYPE_GUID is used for vendor-defined HII + packages, whose contents are determined by the Guid. The range + of package types starting with EFI_HII_PACKAGE_TYPE_SYSTEM_BEGIN + through EFI_HII_PACKAGE_TYPE_SYSTEM_END are reserved for system + firmware implementers. + + @param Length The size of the package in bytes. + + @param Type The package type. See EFI_HII_PACKAGE_TYPE_x, + below. + + @param Data The package data, the format of which is + determined by Type. + +**/ typedef struct { - EFI_IFR_OP_HEADER Header; - EFI_GUID Guid; - STRING_REF FormSetTitle; - STRING_REF Help; - EFI_PHYSICAL_ADDRESS CallbackHandle; - UINT16 Class; - UINT16 SubClass; - UINT16 NvDataSize; // set once, size of the NV data as defined in the script -} EFI_IFR_FORM_SET; + UINT32 Length:24; + UINT32 Type:8; + // UINT8 Data[...]; +} EFI_HII_PACKAGE_HEADER; -typedef struct { - EFI_IFR_OP_HEADER Header; - UINT16 FormId; - STRING_REF FormTitle; -} EFI_IFR_FORM; +// +// EFI_HII_PACKAGE_TYPE_x. +// +#define EFI_HII_PACKAGE_TYPE_ALL 0x00 +#define EFI_HII_PACKAGE_TYPE_GUID 0x01 +#define EFI_HII_PACKAGE_FORM 0x02 +#define EFI_HII_PACKAGE_KEYBOARD_LAYOUT 0x03 +#define EFI_HII_PACKAGE_STRINGS 0x04 +#define EFI_HII_PACKAGE_FONTS 0x05 +#define EFI_HII_PACKAGE_IMAGES 0x06 +#define EFI_HII_PACKAGE_SIMPLE_FONTS 0x07 +#define EFI_HII_PACKAGE_DEVICE_PATH 0x08 +#define EFI_HII_PACKAGE_END 0xDF +#define EFI_HII_PACKAGE_TYPE_SYSTEM_BEGIN 0xE0 +#define EFI_HII_PACKAGE_TYPE_SYSTEM_END 0xFF -typedef struct { - EFI_IFR_OP_HEADER Header; - UINT16 LabelId; -} EFI_IFR_LABEL; +// +// Simplified Font Package +// + +#define EFI_GLYPH_HEIGHT 19 +#define EFI_GLYPH_WIDTH 8 +// +// Contents of EFI_NARROW_GLYPH.Attributes +// +#define EFI_GLYPH_NON_SPACING 0x01 +#define EFI_GLYPH_WIDE 0x02 typedef struct { - EFI_IFR_OP_HEADER Header; - STRING_REF SubTitle; -} EFI_IFR_SUBTITLE; + CHAR16 UnicodeWeight; + UINT8 Attributes; + UINT8 GlyphCol1[EFI_GLYPH_HEIGHT]; +} EFI_NARROW_GLYPH; typedef struct { - EFI_IFR_OP_HEADER Header; - STRING_REF Help; - STRING_REF Text; - STRING_REF TextTwo; - UINT8 Flags; // This is included solely for purposes of interactive/dynamic support. - UINT16 Key; // Value to be passed to caller to identify this particular op-code -} EFI_IFR_TEXT; + CHAR16 UnicodeWeight; + UINT8 Attributes; + UINT8 GlyphCol1[EFI_GLYPH_HEIGHT]; + UINT8 GlyphCol2[EFI_GLYPH_HEIGHT]; + UINT8 Pad[3]; +} EFI_WIDE_GLYPH; + + +typedef struct _EFI_HII_SIMPLE_FONT_PACKAGE_HDR { + EFI_HII_PACKAGE_HEADER Header; + UINT16 NumberOfNarrowGlyphs; + UINT16 NumberOfWideGlyphs; + // EFI_NARROW_GLYPH NarrowGlyphs[]; + // EFI_WIDE_GLYPH WideGlyphs[]; +} EFI_HII_SIMPLE_FONT_PACKAGE_HDR; // -// goto +// Font Package // -typedef struct { - EFI_IFR_OP_HEADER Header; - UINT16 FormId; - STRING_REF Prompt; - STRING_REF Help; // The string Token for the context-help - UINT8 Flags; // This is included solely for purposes of interactive/dynamic support. - UINT16 Key; // Value to be passed to caller to identify this particular op-code -} EFI_IFR_REF; -typedef struct { - EFI_IFR_OP_HEADER Header; -} EFI_IFR_END_FORM; +#define EFI_HII_FONT_STYLE_BOLD 0x00000001 +#define EFI_HII_FONT_STYLE_ITALIC 0x00000002 +#define EFI_HII_FONT_STYLE_EMBOSS 0x00010000 +#define EFI_HII_FONT_STYLE_OUTLINE 0x00020000 +#define EFI_HII_FONT_STYLE_SHADOW 0x00040000 +#define EFI_HII_FONT_STYLE_UNDERLINE 0x00080000 +#define EFI_HII_FONT_STYLE_DBL_UNDER 0x00100000 -typedef struct { - EFI_IFR_OP_HEADER Header; -} EFI_IFR_END_FORM_SET; +typedef struct _EFI_HII_GLYPH_INFO { + UINT16 Width; + UINT16 Height; + INT16 OffsetX; + INT16 OffsetY; + INT16 AdvanceX; +} EFI_HII_GLYPH_INFO; + +typedef struct _EFI_HII_FONT_PACKAGE_HDR { + EFI_HII_PACKAGE_HEADER Header; + UINT32 HdrSize; + UINT32 GlyphBlockOffset; + EFI_HII_GLYPH_INFO Cell; + EFI_HII_FONT_STYLE FontStyle; + CHAR16 FontFamily[1]; +} EFI_HII_FONT_PACKAGE_HDR; + +#define EFI_HII_GIBT_END 0x00 +#define EFI_HII_GIBT_GLYPH 0x10 +#define EFI_HII_GIBT_GLYPHS 0x11 +#define EFI_HII_GIBT_GLYPH_DEFAULT 0x12 +#define EFI_HII_GIBT_GLYPHS_DEFAULT 0x13 +#define EFI_HII_GIBT_DUPLICATE 0x20 +#define EFI_HII_GIBT_SKIP2 0x21 +#define EFI_HII_GIBT_SKIP1 0x22 +#define EFI_HII_GIBT_DEFAULTS 0x23 +#define EFI_HII_GIBT_EXT1 0x30 +#define EFI_HII_GIBT_EXT2 0x31 +#define EFI_HII_GIBT_EXT4 0x32 + +typedef struct _EFI_HII_GLYPH_BLOCK { + UINT8 BlockType; +} EFI_HII_GLYPH_BLOCK; + +typedef struct _EFI_HII_GIBT_DEFAULTS_BLOCK { + EFI_HII_GLYPH_BLOCK Header; + EFI_HII_GLYPH_INFO Cell; +} EFI_HII_GIBT_DEFAULTS_BLOCK; + +typedef struct _EFI_HII_GIBT_DUPLICATE_BLOCK { + EFI_HII_GLYPH_BLOCK Header; + CHAR16 CharValue; +} EFI_HII_GIBT_DUPLICATE_BLOCK; + +typedef struct _EFI_GLYPH_GIBT_END_BLOCK { + EFI_HII_GLYPH_BLOCK Header; +} EFI_GLYPH_GIBT_END_BLOCK; + +typedef struct _EFI_HII_GIBT_EXT1_BLOCK { + EFI_HII_GLYPH_BLOCK Header; + UINT8 BlockType2; + UINT8 Length; +} EFI_HII_GIBT_EXT1_BLOCK; + +typedef struct _EFI_HII_GIBT_EXT2_BLOCK { + EFI_HII_GLYPH_BLOCK Header; + UINT8 BlockType2; + UINT16 Length; +} EFI_HII_GIBT_EXT2_BLOCK; + +typedef struct _EFI_HII_GIBT_EXT4_BLOCK { + EFI_HII_GLYPH_BLOCK Header; + UINT8 BlockType2; + UINT32 Length; +} EFI_HII_GIBT_EXT4_BLOCK; + +typedef struct _EFI_HII_GIBT_GLYPH_BLOCK { + EFI_HII_GLYPH_BLOCK Header; + EFI_HII_GLYPH_INFO Cell; + UINT8 BitmapData[1]; // the number of bytes per bitmap can be calculated by ((Cell.Width+7)/8)*Cell.Height +} EFI_HII_GIBT_GLYPH_BLOCK; + +typedef struct _EFI_HII_GIBT_GLYPHS_BLOCK { + EFI_HII_GLYPH_BLOCK Header; + EFI_HII_GLYPH_INFO Cell; + UINT16 Count; + UINT8 BitmapData[1]; // the number of bytes per bitmap can be calculated by ((Cell.Width+7)/8)*Cell.Height +} EFI_HII_GIBT_GLYPHS_BLOCK; + +typedef struct _EFI_HII_GIBT_GLYPH_DEFAULT_BLOCK { + EFI_HII_GLYPH_BLOCK Header; + UINT8 BitmapData[1]; // the number of bytes per bitmap can be calculated by ((Global.Cell.Width+7)/8)*Global.Cell.Height +} EFI_HII_GIBT_GLYPH_DEFAULT_BLOCK; + +typedef struct _EFI_HII_GIBT_GLYPHS_DEFAULT_BLOCK { + EFI_HII_GLYPH_BLOCK Header; + UINT16 Count; + UINT8 BitmapData[1]; // the number of bytes per bitmap can be calculated by ((Global.Cell.Width+7)/8)*Global.Cell.Height +} EFI_HII_GIBT_GLYPHS_DEFAULT_BLOCK; + +typedef struct _EFI_HII_GIBT_SKIP1_BLOCK { + EFI_HII_GLYPH_BLOCK Header; + UINT8 SkipCount; +} EFI_HII_GIBT_SKIP1_BLOCK; + +typedef struct _EFI_HII_GIBT_SKIP2_BLOCK { + EFI_HII_GLYPH_BLOCK Header; + UINT16 SkipCount; +} EFI_HII_GIBT_SKIP2_BLOCK; // -// Also notice that the IFR_ONE_OF and IFR_CHECK_BOX are identical in structure......code assumes this to be true, if this ever -// changes we need to revisit the InitializeTagStructures code +// Device Path Package // -typedef struct { - EFI_IFR_OP_HEADER Header; - UINT16 QuestionId; // The ID designating what the question is about...sucked in from a #define, likely in the form of a variable name - UINT8 Width; // The Size of the Data being saved - STRING_REF Prompt; // The String Token for the Prompt - STRING_REF Help; // The string Token for the context-help -} EFI_IFR_ONE_OF; +typedef struct _EFI_HII_DEVICE_PATH_PACKAGE { + EFI_HII_PACKAGE_HEADER Header; + // EFI_DEVICE_PATH_PROTOCOL DevicePath[]; +} EFI_HII_DEVICE_PATH_PACKAGE; -typedef struct { - EFI_IFR_OP_HEADER Header; - UINT16 QuestionId; // The offset in NV for storage of the data - UINT8 MaxEntries; // The maximum number of options in the ordered list (=size of NVStore) - STRING_REF Prompt; // The string token for the prompt - STRING_REF Help; // The string token for the context-help -} EFI_IFR_ORDERED_LIST; +// +// GUID Package +// +typedef struct _EFI_HII_GUID_PACKAGE_HDR { + EFI_HII_PACKAGE_HEADER Header; + EFI_GUID Guid; + // Data per GUID definition may follow +} EFI_HII_GUID_PACKAGE_HDR; -typedef struct { - EFI_IFR_OP_HEADER Header; - UINT16 QuestionId; // The ID designating what the question is about...sucked in from a #define, likely in the form of a variable name - UINT8 Width; // The Size of the Data being saved - STRING_REF Prompt; // The String Token for the Prompt - STRING_REF Help; // The string Token for the context-help - UINT8 Flags; // For now, if non-zero, means that it is the default option, - further definition likely - UINT16 Key; // Value to be passed to caller to identify this particular op-code -} EFI_IFR_CHECKBOX, EFI_IFR_CHECK_BOX; +// +// String Package +// -typedef struct { - EFI_IFR_OP_HEADER Header; - STRING_REF Option; // The string token describing the option - UINT16 Value; // The value associated with this option that is stored in the NVRAM if chosen - UINT8 Flags; // For now, if non-zero, means that it is the default option, - further definition likely above - UINT16 Key; // Value to be passed to caller to identify this particular op-code -} EFI_IFR_ONE_OF_OPTION; +#define UEFI_CONFIG_LANG L"x-UEFI" +#define UEFI_CONFIG_LANG2 L"x-i-UEFI" // BUGBUG, spec need to be updated. + +typedef struct _EFI_HII_STRING_PACKAGE_HDR { + EFI_HII_PACKAGE_HEADER Header; + UINT32 HdrSize; + UINT32 StringInfoOffset; + CHAR16 LanguageWindow[16]; + EFI_STRING_ID LanguageName; + CHAR8 Language[1]; +} EFI_HII_STRING_PACKAGE_HDR; typedef struct { - EFI_IFR_OP_HEADER Header; - UINT16 QuestionId; // The ID designating what the question is about...sucked in from a #define, likely in the form of a variable name - UINT8 Width; // The Size of the Data being saved - STRING_REF Prompt; // The String Token for the Prompt - STRING_REF Help; // The string Token for the context-help - UINT8 Flags; // This is included solely for purposes of interactive/dynamic support. - UINT16 Key; // Value to be passed to caller to identify this particular op-code - UINT16 Minimum; - UINT16 Maximum; - UINT16 Step; // If step is 0, then manual input is specified, otherwise, left/right arrow selection is called for - UINT16 Default; -} EFI_IFR_NUMERIC; + UINT8 BlockType; +} EFI_HII_STRING_BLOCK; + +#define EFI_HII_SIBT_END 0x00 +#define EFI_HII_SIBT_STRING_SCSU 0x10 +#define EFI_HII_SIBT_STRING_SCSU_FONT 0x11 +#define EFI_HII_SIBT_STRINGS_SCSU 0x12 +#define EFI_HII_SIBT_STRINGS_SCSU_FONT 0x13 +#define EFI_HII_SIBT_STRING_UCS2 0x14 +#define EFI_HII_SIBT_STRING_UCS2_FONT 0x15 +#define EFI_HII_SIBT_STRINGS_UCS2 0x16 +#define EFI_HII_SIBT_STRINGS_UCS2_FONT 0x17 +#define EFI_HII_SIBT_DUPLICATE 0x20 +#define EFI_HII_SIBT_SKIP2 0x21 +#define EFI_HII_SIBT_SKIP1 0x22 +#define EFI_HII_SIBT_EXT1 0x30 +#define EFI_HII_SIBT_EXT2 0x31 +#define EFI_HII_SIBT_EXT4 0x32 +#define EFI_HII_SIBT_FONT 0x40 + +typedef struct _EFI_HII_SIBT_DUPLICATE_BLOCK { + EFI_HII_STRING_BLOCK Header; + EFI_STRING_ID StringId; +} EFI_HII_SIBT_DUPLICATE_BLOCK; + +typedef struct _EFI_HII_SIBT_END_BLOCK { + EFI_HII_STRING_BLOCK Header; +} EFI_HII_SIBT_END_BLOCK; + +typedef struct _EFI_HII_SIBT_EXT1_BLOCK { + EFI_HII_STRING_BLOCK Header; + UINT8 BlockType2; + UINT8 Length; +} EFI_HII_SIBT_EXT1_BLOCK; + +typedef struct _EFI_HII_SIBT_EXT2_BLOCK { + EFI_HII_STRING_BLOCK Header; + UINT8 BlockType2; + UINT16 Length; +} EFI_HII_SIBT_EXT2_BLOCK; + +typedef struct _EFI_HII_SIBT_EXT4_BLOCK { + EFI_HII_STRING_BLOCK Header; + UINT8 BlockType2; + UINT32 Length; +} EFI_HII_SIBT_EXT4_BLOCK; + +typedef struct _EFI_HII_SIBT_FONT_BLOCK { + EFI_HII_SIBT_EXT2_BLOCK Header; + UINT8 FontId; + UINT16 FontSize; + EFI_HII_FONT_STYLE FontStyle; + CHAR16 FontName[1]; +} EFI_HII_SIBT_FONT_BLOCK; + +typedef struct _EFI_HII_SIBT_SKIP1_BLOCK { + EFI_HII_STRING_BLOCK Header; + UINT8 SkipCount; +} EFI_HII_SIBT_SKIP1_BLOCK; + +typedef struct _EFI_HII_SIBT_SKIP2_BLOCK { + EFI_HII_STRING_BLOCK Header; + UINT16 SkipCount; +} EFI_HII_SIBT_SKIP2_BLOCK; + +typedef struct _EFI_HII_SIBT_STRING_SCSU_BLOCK { + EFI_HII_STRING_BLOCK Header; + UINT8 StringText[1]; +} EFI_HII_SIBT_STRING_SCSU_BLOCK; + +typedef struct _EFI_HII_SIBT_STRING_SCSU_FONT_BLOCK { + EFI_HII_STRING_BLOCK Header; + UINT8 FontIdentifier; + UINT8 StringText[1]; +} EFI_HII_SIBT_STRING_SCSU_FONT_BLOCK; + +typedef struct _EFI_HII_SIBT_STRINGS_SCSU_BLOCK { + EFI_HII_STRING_BLOCK Header; + UINT16 StringCount; + UINT8 StringText[1]; +} EFI_HII_SIBT_STRINGS_SCSU_BLOCK; + +typedef struct _EFI_HII_SIBT_STRINGS_SCSU_FONT_BLOCK { + EFI_HII_STRING_BLOCK Header; + UINT8 FontIdentifier; + UINT16 StringCount; + UINT8 StringText[1]; +} EFI_HII_SIBT_STRINGS_SCSU_FONT_BLOCK; + +typedef struct _EFI_HII_SIBT_STRING_UCS2_BLOCK { + EFI_HII_STRING_BLOCK Header; + CHAR16 StringText[1]; +} EFI_HII_SIBT_STRING_UCS2_BLOCK; + +typedef struct _EFI_HII_SIBT_STRING_UCS2_FONT_BLOCK { + EFI_HII_STRING_BLOCK Header; + UINT8 FontIdentifier; + CHAR16 StringText[1]; +} EFI_HII_SIBT_STRING_UCS2_FONT_BLOCK; + +typedef struct _EFI_HII_SIBT_STRINGS_UCS2_BLOCK { + EFI_HII_STRING_BLOCK Header; + UINT16 StringCount; + CHAR16 StringText[1]; +} EFI_HII_SIBT_STRINGS_UCS2_BLOCK; + +typedef struct _EFI_HII_SIBT_STRINGS_UCS2_FONT_BLOCK { + EFI_HII_STRING_BLOCK Header; + UINT8 FontIdentifier; + UINT16 StringCount; + CHAR16 StringText[1]; +} EFI_HII_SIBT_STRINGS_UCS2_FONT_BLOCK; // -// There is an interesting twist with regards to Time and Date. This is one of the few items which can accept input from -// a user, however may or may not need to use storage in the NVRAM space. The decided method for determining if NVRAM space -// will be used (only for a TimeOp or DateOp) is: If .QuestionId == 0 && .Width == 0 (normally an impossibility) then use system -// resources to store the data away and not NV resources. In other words, the setup engine will call gRT->SetTime, and gRT->SetDate -// for the saving of data, and the values displayed will be from the gRT->GetXXXX series of calls. +// Image Packages +// + +typedef struct _EFI_HII_IMAGE_PACKAGE_HDR { + EFI_HII_PACKAGE_HEADER Header; + UINT32 ImageInfoOffset; + UINT32 PaletteInfoOffset; +} EFI_HII_IMAGE_PACKAGE_HDR; + +typedef struct _EFI_HII_IMAGE_BLOCK { + UINT8 BlockType; +} EFI_HII_IMAGE_BLOCK; + +#define EFI_HII_IIBT_END 0x00 +#define EFI_HII_IIBT_IMAGE_1BIT 0x10 +#define EFI_HII_IIBT_IMAGE_1BIT_TRANS 0x11 +#define EFI_HII_IIBT_IMAGE_4BIT 0x12 +#define EFI_HII_IIBT_IMAGE_4BIT_TRANS 0x13 +#define EFI_HII_IIBT_IMAGE_8BIT 0x14 +#define EFI_HII_IIBT_IMAGE_8BIT_TRANS 0x15 +#define EFI_HII_IIBT_IMAGE_24BIT 0x16 +#define EFI_HII_IIBT_IMAGE_24BIT_TRANS 0x17 +#define EFI_HII_IIBT_IMAGE_JPEG 0x18 +#define EFI_HII_IIBT_DUPLICATE 0x20 +#define EFI_HII_IIBT_SKIP2 0x21 +#define EFI_HII_IIBT_SKIP1 0x22 +#define EFI_HII_IIBT_EXT1 0x30 +#define EFI_HII_IIBT_EXT2 0x31 +#define EFI_HII_IIBT_EXT4 0x32 + +typedef struct _EFI_HII_IIBT_END_BLOCK { + EFI_HII_IMAGE_BLOCK Header; +} EFI_HII_IIBT_END_BLOCK; + +typedef struct _EFI_HII_IIBT_EXT1_BLOCK { + EFI_HII_IMAGE_BLOCK Header; + UINT8 BlockType2; + UINT8 Length; +} EFI_HII_IIBT_EXT1_BLOCK; + +typedef struct _EFI_HII_IIBT_EXT2_BLOCK { + EFI_HII_IMAGE_BLOCK Header; + UINT8 BlockType2; + UINT16 Length; +} EFI_HII_IIBT_EXT2_BLOCK; + +typedef struct _EFI_HII_IIBT_EXT4_BLOCK { + EFI_HII_IMAGE_BLOCK Header; + UINT8 BlockType2; + UINT32 Length; +} EFI_HII_IIBT_EXT4_BLOCK; + +typedef struct _EFI_HII_IIBT_IMAGE_1BIT_BASE { + UINT16 Width; + UINT16 Height; + UINT8 Data[1]; +} EFI_HII_IIBT_IMAGE_1BIT_BASE; + +typedef struct _EFI_HII_IIBT_IMAGE_1BIT_BLOCK { + EFI_HII_IMAGE_BLOCK Header; + UINT8 PaletteIndex; + EFI_HII_IIBT_IMAGE_1BIT_BASE Bitmap; +} EFI_HII_IIBT_IMAGE_1BIT_BLOCK; + +typedef struct _EFI_HII_IIBT_IMAGE_1BIT_TRANS_BLOCK { + EFI_HII_IMAGE_BLOCK Header; + UINT8 PaletteIndex; + EFI_HII_IIBT_IMAGE_1BIT_BASE Bitmap; +} EFI_HII_IIBT_IMAGE_1BIT_TRANS_BLOCK; + +typedef struct _EFI_HII_RGB_PIXEL { + UINT8 b; + UINT8 g; + UINT8 r; +} EFI_HII_RGB_PIXEL; + +typedef struct _EFI_HII_IIBT_IMAGE_24BIT_BASE { + UINT16 Width; + UINT16 Height; + EFI_HII_RGB_PIXEL Bitmap[1]; +} EFI_HII_IIBT_IMAGE_24BIT_BASE; + +typedef struct _EFI_HII_IIBT_IMAGE_24BIT_BLOCK { + EFI_HII_IMAGE_BLOCK Header; + EFI_HII_IIBT_IMAGE_24BIT_BASE Bitmap; +} EFI_HII_IIBT_IMAGE_24BIT_BLOCK; + +typedef struct _EFI_HII_IIBT_IMAGE_24BIT_TRANS_BLOCK { + EFI_HII_IMAGE_BLOCK Header; + EFI_HII_IIBT_IMAGE_24BIT_BASE Bitmap; +} EFI_HII_IIBT_IMAGE_24BIT_TRANS_BLOCK; + +typedef struct _EFI_HII_IIBT_IMAGE_4BIT_BASE { + UINT16 Width; + UINT16 Height; + UINT8 Data[1]; +} EFI_HII_IIBT_IMAGE_4BIT_BASE; + +typedef struct _EFI_HII_IIBT_IMAGE_4BIT_BLOCK { + EFI_HII_IMAGE_BLOCK Header; + UINT8 PaletteIndex; + EFI_HII_IIBT_IMAGE_4BIT_BASE Bitmap; +} EFI_HII_IIBT_IMAGE_4BIT_BLOCK; + +typedef struct _EFI_HII_IIBT_IMAGE_4BIT_TRANS_BLOCK { + EFI_HII_IMAGE_BLOCK Header; + UINT8 PaletteIndex; + EFI_HII_IIBT_IMAGE_4BIT_BASE Bitmap; +} EFI_HII_IIBT_IMAGE_4BIT_TRANS_BLOCK; + +typedef struct _EFI_HII_IIBT_IMAGE_8BIT_BASE { + UINT16 Width; + UINT16 Height; + UINT8 Data[1]; +} EFI_HII_IIBT_IMAGE_8BIT_BASE; + +typedef struct _EFI_HII_IIBT_IMAGE_8BIT_PALETTE_BLOCK { + EFI_HII_IMAGE_BLOCK Header; + UINT8 PaletteIndex; + EFI_HII_IIBT_IMAGE_8BIT_BASE Bitmap; +} EFI_HII_IIBT_IMAGE_8BIT_BLOCK; + +typedef struct _EFI_HII_IIBT_IMAGE_8BIT_TRANS_BLOCK { + EFI_HII_IMAGE_BLOCK Header; + UINT8 PaletteIndex; + EFI_HII_IIBT_IMAGE_8BIT_BASE Bitmap; +} EFI_HII_IIBT_IMAGE_8BIT_TRAN_BLOCK; + +typedef struct _EFI_HII_IIBT_DUPLICATE_BLOCK { + EFI_HII_IMAGE_BLOCK Header; + EFI_IMAGE_ID ImageId; +} EFI_HII_IIBT_DUPLICATE_BLOCK; + +typedef struct _EFI_HII_IIBT_JPEG_BLOCK { + EFI_HII_IMAGE_BLOCK Header; + UINT32 Size; + UINT8 Data[1]; +} EFI_HII_IIBT_JPEG_BLOCK; + +typedef struct _EFI_HII_IIBT_SKIP1_BLOCK { + EFI_HII_IMAGE_BLOCK Header; + UINT8 SkipCount; +} EFI_HII_IIBT_SKIP1_BLOCK; + +typedef struct _EFI_HII_IIBT_SKIP2_BLOCK { + EFI_HII_IMAGE_BLOCK Header; + UINT16 SkipCount; +} EFI_HII_IIBT_SKIP2_BLOCK; + +typedef struct _EFI_HII_IMAGE_PALETTE_INFO_HEADER { + UINT16 PaletteCount; +} EFI_HII_IMAGE_PALETTE_INFO_HEADER; + +typedef struct _EFI_HII_IMAGE_PALETTE_INFO { + UINT16 PaletteSize; + EFI_HII_RGB_PIXEL PaletteValue[1]; +} EFI_HII_IMAGE_PALETTE_INFO; + // +// Forms Package +// + +typedef struct _EFI_HII_FORM_PACKAGE { + EFI_HII_PACKAGE_HEADER Header; + // EFI_IFR_OP_HEADER OpCodeHeader; + // More op-codes follow +} EFI_HII_FORM_PACKAGE; + typedef struct { - EFI_IFR_NUMERIC Hour; - EFI_IFR_NUMERIC Minute; - EFI_IFR_NUMERIC Second; -} EFI_IFR_TIME; + UINT8 Hour; + UINT8 Minute; + UINT8 Second; +} EFI_HII_TIME; typedef struct { - EFI_IFR_NUMERIC Year; - EFI_IFR_NUMERIC Month; - EFI_IFR_NUMERIC Day; + UINT16 Year; + UINT8 Month; + UINT8 Day; +} EFI_HII_DATE; + +typedef union { + UINT8 u8; + UINT16 u16; + UINT32 u32; + UINT64 u64; + BOOLEAN b; + EFI_HII_TIME time; + EFI_HII_DATE date; + EFI_STRING_ID string; +} EFI_IFR_TYPE_VALUE; + +#define EFI_IFR_FORM_OP 0x01 +#define EFI_IFR_SUBTITLE_OP 0x02 +#define EFI_IFR_TEXT_OP 0x03 +#define EFI_IFR_IMAGE_OP 0x04 +#define EFI_IFR_ONE_OF_OP 0x05 +#define EFI_IFR_CHECKBOX_OP 0x06 +#define EFI_IFR_NUMERIC_OP 0x07 +#define EFI_IFR_PASSWORD_OP 0x08 +#define EFI_IFR_ONE_OF_OPTION_OP 0x09 +#define EFI_IFR_SUPPRESS_IF_OP 0x0A +#define EFI_IFR_LOCKED_OP 0x0B +#define EFI_IFR_ACTION_OP 0x0C +#define EFI_IFR_RESET_BUTTON_OP 0x0D +#define EFI_IFR_FORM_SET_OP 0x0E +#define EFI_IFR_REF_OP 0x0F +#define EFI_IFR_NO_SUBMIT_IF_OP 0x10 +#define EFI_IFR_INCONSISTENT_IF_OP 0x11 +#define EFI_IFR_EQ_ID_VAL_OP 0x12 +#define EFI_IFR_EQ_ID_ID_OP 0x13 +#define EFI_IFR_EQ_ID_LIST_OP 0x14 +#define EFI_IFR_AND_OP 0x15 +#define EFI_IFR_OR_OP 0x16 +#define EFI_IFR_NOT_OP 0x17 +#define EFI_IFR_RULE_OP 0x18 +#define EFI_IFR_GRAY_OUT_IF_OP 0x19 +#define EFI_IFR_DATE_OP 0x1A +#define EFI_IFR_TIME_OP 0x1B +#define EFI_IFR_STRING_OP 0x1C +#define EFI_IFR_REFRESH_OP 0x1D +#define EFI_IFR_DISABLE_IF_OP 0x1E +#define EFI_IFR_TO_LOWER_OP 0x20 +#define EFI_IFR_TO_UPPER_OP 0x21 +#define EFI_IFR_ORDERED_LIST_OP 0x23 +#define EFI_IFR_VARSTORE_OP 0x24 +#define EFI_IFR_VARSTORE_NAME_VALUE_OP 0x25 +#define EFI_IFR_VARSTORE_EFI_OP 0x26 +#define EFI_IFR_VARSTORE_DEVICE_OP 0x27 +#define EFI_IFR_VERSION_OP 0x28 +#define EFI_IFR_END_OP 0x29 +#define EFI_IFR_MATCH_OP 0x2A +#define EFI_IFR_EQUAL_OP 0x2F +#define EFI_IFR_NOT_EQUAL_OP 0x30 +#define EFI_IFR_GREATER_THAN_OP 0x31 +#define EFI_IFR_GREATER_EQUAL_OP 0x32 +#define EFI_IFR_LESS_THAN_OP 0x33 +#define EFI_IFR_LESS_EQUAL_OP 0x34 +#define EFI_IFR_BITWISE_AND_OP 0x35 +#define EFI_IFR_BITWISE_OR_OP 0x36 +#define EFI_IFR_BITWISE_NOT_OP 0x37 +#define EFI_IFR_SHIFT_LEFT_OP 0x38 +#define EFI_IFR_SHIFT_RIGHT_OP 0x39 +#define EFI_IFR_ADD_OP 0x3A +#define EFI_IFR_SUBTRACT_OP 0x3B +#define EFI_IFR_MULTIPLY_OP 0x3C +#define EFI_IFR_DIVIDE_OP 0x3D +#define EFI_IFR_MODULO_OP 0x3E +#define EFI_IFR_RULE_REF_OP 0x3F +#define EFI_IFR_QUESTION_REF1_OP 0x40 +#define EFI_IFR_QUESTION_REF2_OP 0x41 +#define EFI_IFR_UINT8_OP 0x42 +#define EFI_IFR_UINT16_OP 0x43 +#define EFI_IFR_UINT32_OP 0x44 +#define EFI_IFR_UINT64_OP 0x45 +#define EFI_IFR_TRUE_OP 0x46 +#define EFI_IFR_FALSE_OP 0x47 +#define EFI_IFR_TO_UINT_OP 0x48 +#define EFI_IFR_TO_STRING_OP 0x49 +#define EFI_IFR_TO_BOOLEAN_OP 0x4A +#define EFI_IFR_MID_OP 0x4B +#define EFI_IFR_FIND_OP 0x4C +#define EFI_IFR_TOKEN_OP 0x4D +#define EFI_IFR_STRING_REF1_OP 0x4E +#define EFI_IFR_STRING_REF2_OP 0x4F +#define EFI_IFR_CONDITIONAL_OP 0x50 +#define EFI_IFR_QUESTION_REF3_OP 0x51 +#define EFI_IFR_ZERO_OP 0x52 +#define EFI_IFR_ONE_OP 0x53 +#define EFI_IFR_ONES_OP 0x54 +#define EFI_IFR_UNDEFINED_OP 0x55 +#define EFI_IFR_LENGTH_OP 0x56 +#define EFI_IFR_DUP_OP 0x57 +#define EFI_IFR_THIS_OP 0x58 +#define EFI_IFR_SPAN_OP 0x59 +#define EFI_IFR_VALUE_OP 0x5A +#define EFI_IFR_DEFAULT_OP 0x5B +#define EFI_IFR_DEFAULTSTORE_OP 0x5C +#define EFI_IFR_CATENATE_OP 0x5E +#define EFI_IFR_GUID_OP 0x5F + + +typedef struct _EFI_IFR_OP_HEADER { + UINT8 OpCode; + UINT8 Length:7; + UINT8 Scope:1; +} EFI_IFR_OP_HEADER; + +typedef struct _EFI_IFR_STATEMENT_HEADER { + EFI_STRING_ID Prompt; + EFI_STRING_ID Help; +} EFI_IFR_STATEMENT_HEADER; + +typedef struct _EFI_IFR_QUESTION_HEADER { + EFI_IFR_STATEMENT_HEADER Header; + EFI_QUESTION_ID QuestionId; + EFI_VARSTORE_ID VarStoreId; + union { + EFI_STRING_ID VarName; + UINT16 VarOffset; + } VarStoreInfo; + UINT8 Flags; +} EFI_IFR_QUESTION_HEADER; + +#define EFI_IFR_FLAG_READ_ONLY 0x01 +#define EFI_IFR_FLAG_CALLBACK 0x04 +#define EFI_IFR_FLAG_RESET_REQUIRED 0x10 +#define EFI_IFR_FLAG_OPTIONS_ONLY 0x80 + +typedef struct _EFI_IFR_DEFAULTSTORE { + EFI_IFR_OP_HEADER Header; + EFI_STRING_ID DefaultName; + UINT16 DefaultId; +} EFI_IFR_DEFAULTSTORE; + +#define EFI_HII_DEFAULT_CLASS_STANDARD 0x0000 +#define EFI_HII_DEFAULT_CLASS_MANUFACTURING 0x0001 +#define EFI_HII_DEFAULT_CLASS_SAFE 0x0002 +#define EFI_HII_DEFAULT_CLASS_PLATFORM_BEGIN 0x4000 +#define EFI_HII_DEFAULT_CLASS_PLATFORM_END 0x7fff +#define EFI_HII_DEFAULT_CLASS_HARDWARE_BEGIN 0x8000 +#define EFI_HII_DEFAULT_CLASS_HARDWARE_END 0xbfff +#define EFI_HII_DEFAULT_CLASS_FIRMWARE_BEGIN 0xc000 +#define EFI_HII_DEFAULT_CLASS_FIRMWARE_END 0xffff + +typedef struct _EFI_IFR_VARSTORE { + EFI_IFR_OP_HEADER Header; + EFI_GUID Guid; + EFI_VARSTORE_ID VarStoreId; + UINT16 Size; + UINT8 Name[1]; +} EFI_IFR_VARSTORE; + +typedef struct _EFI_IFR_VARSTORE_EFI { + EFI_IFR_OP_HEADER Header; + UINT16 VarStoreId; + EFI_GUID Guid; + UINT32 Attributes; +} EFI_IFR_VARSTORE_EFI; + +typedef struct _EFI_IFR_VARSTORE_NAME_VALUE { + EFI_IFR_OP_HEADER Header; + UINT16 VarStoreId; + EFI_GUID Guid; +} EFI_IFR_VARSTORE_NAME_VALUE; + +typedef struct _EFI_IFR_FORM_SET { + EFI_IFR_OP_HEADER Header; + EFI_GUID Guid; + EFI_STRING_ID FormSetTitle; + EFI_STRING_ID Help; +} EFI_IFR_FORM_SET; + +typedef struct _EFI_IFR_END { + EFI_IFR_OP_HEADER Header; +} EFI_IFR_END; + +typedef struct _EFI_IFR_FORM { + EFI_IFR_OP_HEADER Header; + UINT16 FormId; + EFI_STRING_ID FormTitle; +} EFI_IFR_FORM; + +typedef struct _EFI_IFR_IMAGE { + EFI_IFR_OP_HEADER Header; + EFI_IMAGE_ID Id; +} EFI_IFR_IMAGE; + +typedef struct _EFI_IFR_LOCKED { + EFI_IFR_OP_HEADER Header; +} EFI_IFR_LOCKED; + +typedef struct _EFI_IFR_RULE { + EFI_IFR_OP_HEADER Header; + UINT8 RuleId; +} EFI_IFR_RULE; + +typedef struct _EFI_IFR_DEFAULT { + EFI_IFR_OP_HEADER Header; + UINT16 DefaultId; + UINT8 Type; + EFI_IFR_TYPE_VALUE Value; +} EFI_IFR_DEFAULT; + +typedef struct _EFI_IFR_VALUE { + EFI_IFR_OP_HEADER Header; +} EFI_IFR_VALUE; + +typedef struct _EFI_IFR_SUBTITLE { + EFI_IFR_OP_HEADER Header; + EFI_IFR_STATEMENT_HEADER Statement; + UINT8 Flags; +} EFI_IFR_SUBTITLE; + +#define EFI_IFR_FLAGS_HORIZONTAL 0x01 + +typedef struct _EFI_IFR_CHECKBOX { + EFI_IFR_OP_HEADER Header; + EFI_IFR_QUESTION_HEADER Question; + UINT8 Flags; +} EFI_IFR_CHECKBOX; + +#define EFI_IFR_CHECKBOX_DEFAULT 0x01 +#define EFI_IFR_CHECKBOX_DEFAULT_MFG 0x02 + +typedef struct _EFI_IFR_TEXT { + EFI_IFR_OP_HEADER Header; + EFI_IFR_STATEMENT_HEADER Statement; + EFI_STRING_ID TextTwo; +} EFI_IFR_TEXT; + +typedef struct _EFI_IFR_REF { + EFI_IFR_OP_HEADER Header; + EFI_IFR_QUESTION_HEADER Question; + EFI_FORM_ID FormId; +} EFI_IFR_REF; + +typedef struct _EFI_IFR_REF2 { + EFI_IFR_OP_HEADER Header; + EFI_IFR_QUESTION_HEADER Question; + EFI_FORM_ID FormId; + EFI_QUESTION_ID QuestionId; +} EFI_IFR_REF2; + +typedef struct _EFI_IFR_REF3 { + EFI_IFR_OP_HEADER Header; + EFI_IFR_QUESTION_HEADER Question; + EFI_FORM_ID FormId; + EFI_QUESTION_ID QuestionId; + EFI_GUID FormSetId; +} EFI_IFR_REF3; + +typedef struct _EFI_IFR_REF4 { + EFI_IFR_OP_HEADER Header; + EFI_IFR_QUESTION_HEADER Question; + EFI_FORM_ID FormId; + EFI_QUESTION_ID QuestionId; + EFI_GUID FormSetId; + EFI_STRING_ID DevicePath; +} EFI_IFR_REF4; + +typedef struct _EFI_IFR_RESET_BUTTON { + EFI_IFR_OP_HEADER Header; + EFI_IFR_QUESTION_HEADER Question; + EFI_DEFAULT_ID DefaultId; +} EFI_IFR_RESET_BUTTON; + +typedef struct _EFI_IFR_ACTION { + EFI_IFR_OP_HEADER Header; + EFI_IFR_QUESTION_HEADER Question; + EFI_STRING_ID QuestionConfig; +} EFI_IFR_ACTION; + +typedef struct _EFI_IFR_ACTION_1 { + EFI_IFR_OP_HEADER Header; + EFI_IFR_QUESTION_HEADER Question; +} EFI_IFR_ACTION_1; + +typedef struct _EFI_IFR_DATE { + EFI_IFR_OP_HEADER Header; + EFI_IFR_QUESTION_HEADER Question; + UINT8 Flags; } EFI_IFR_DATE; -typedef struct { - EFI_IFR_OP_HEADER Header; - UINT16 QuestionId; // The ID designating what the question is about...sucked in from a #define, likely in the form of a variable name - UINT8 Width; // The Size of the Data being saved -- BUGBUG -- remove someday - STRING_REF Prompt; // The String Token for the Prompt - STRING_REF Help; // The string Token for the context-help - UINT8 Flags; // This is included solely for purposes of interactive/dynamic support. - UINT16 Key; // Value to be passed to caller to identify this particular op-code - UINT8 MinSize; // Minimum allowable sized password - UINT8 MaxSize; // Maximum allowable sized password - UINT16 Encoding; -} EFI_IFR_PASSWORD; +#define EFI_QF_DATE_YEAR_SUPPRESS 0x01 +#define EFI_QF_DATE_MONTH_SUPPRESS 0x02 +#define EFI_QF_DATE_DAY_SUPPRESS 0x04 -typedef struct { - EFI_IFR_OP_HEADER Header; - UINT16 QuestionId; // The ID designating what the question is about...sucked in from a #define, likely in the form of a variable name - UINT8 Width; // The Size of the Data being saved -- BUGBUG -- remove someday - STRING_REF Prompt; // The String Token for the Prompt - STRING_REF Help; // The string Token for the context-help - UINT8 Flags; // This is included solely for purposes of interactive/dynamic support. - UINT16 Key; // Value to be passed to caller to identify this particular op-code - UINT8 MinSize; // Minimum allowable sized password - UINT8 MaxSize; // Maximum allowable sized password +#define EFI_QF_DATE_STORAGE 0x30 +#define QF_DATE_STORAGE_NORMAL 0x00 +#define QF_DATE_STORAGE_TIME 0x10 +#define QF_DATE_STORAGE_WAKEUP 0x20 + +typedef union { + struct { + UINT8 MinValue; + UINT8 MaxValue; + UINT8 Step; + } u8; + struct { + UINT16 MinValue; + UINT16 MaxValue; + UINT16 Step; + } u16; + struct { + UINT32 MinValue; + UINT32 MaxValue; + UINT32 Step; + } u32; + struct { + UINT64 MinValue; + UINT64 MaxValue; + UINT64 Step; + } u64; +} MINMAXSTEP_DATA; + +typedef struct _EFI_IFR_NUMERIC { + EFI_IFR_OP_HEADER Header; + EFI_IFR_QUESTION_HEADER Question; + UINT8 Flags; + MINMAXSTEP_DATA data; +} EFI_IFR_NUMERIC; + +#define EFI_IFR_NUMERIC_SIZE 0x03 +#define EFI_IFR_NUMERIC_SIZE_1 0x00 +#define EFI_IFR_NUMERIC_SIZE_2 0x01 +#define EFI_IFR_NUMERIC_SIZE_4 0x02 +#define EFI_IFR_NUMERIC_SIZE_8 0x03 + +#define EFI_IFR_DISPLAY 0x30 +#define EFI_IFR_DISPLAY_INT_DEC 0x00 +#define EFI_IFR_DISPLAY_UINT_DEC 0x10 +#define EFI_IFR_DISPLAY_UINT_HEX 0x20 + +typedef struct _EFI_IFR_ONE_OF { + EFI_IFR_OP_HEADER Header; + EFI_IFR_QUESTION_HEADER Question; + UINT8 Flags; + MINMAXSTEP_DATA data; +} EFI_IFR_ONE_OF; + +typedef struct _EFI_IFR_STRING { + EFI_IFR_OP_HEADER Header; + EFI_IFR_QUESTION_HEADER Question; + UINT8 MinSize; + UINT8 MaxSize; + UINT8 Flags; } EFI_IFR_STRING; -typedef struct { - EFI_IFR_OP_HEADER Header; -} EFI_IFR_END_ONE_OF; +#define EFI_IFR_STRING_MULTI_LINE 0x01 -typedef struct { - EFI_IFR_OP_HEADER Header; - UINT16 Value; - UINT16 Key; -} EFI_IFR_HIDDEN; +typedef struct _EFI_IFR_PASSWORD { + EFI_IFR_OP_HEADER Header; + EFI_IFR_QUESTION_HEADER Question; + UINT16 MinSize; + UINT16 MaxSize; +} EFI_IFR_PASSWORD; -typedef struct { - EFI_IFR_OP_HEADER Header; - UINT8 Flags; -} EFI_IFR_SUPPRESS; +typedef struct _EFI_IFR_ORDERED_LIST { + EFI_IFR_OP_HEADER Header; + EFI_IFR_QUESTION_HEADER Question; + UINT8 MaxContainers; + UINT8 Flags; +} EFI_IFR_ORDERED_LIST; -typedef struct { - EFI_IFR_OP_HEADER Header; - UINT8 Flags; -} EFI_IFR_GRAY_OUT; +#define EFI_IFR_UNIQUE_SET 0x01 +#define EFI_IFR_NO_EMPTY_SET 0x02 -typedef struct { - EFI_IFR_OP_HEADER Header; - STRING_REF Popup; - UINT8 Flags; -} EFI_IFR_INCONSISTENT; +typedef struct _EFI_IFR_TIME { + EFI_IFR_OP_HEADER Header; + EFI_IFR_QUESTION_HEADER Question; + UINT8 Flags; +} EFI_IFR_TIME; -typedef struct { - EFI_IFR_OP_HEADER Header; - UINT16 QuestionId; // offset into variable storage - UINT8 Width; // size of variable storage - UINT16 Value; // value to compare against +#define QF_TIME_HOUR_SUPPRESS 0x01 +#define QF_TIME_MINUTE_SUPPRESS 0x02 +#define QF_TIME_SECOND_SUPPRESS 0x04 + +#define QF_TIME_STORAGE 0x30 +#define QF_TIME_STORAGE_NORMAL 0x00 +#define QF_TIME_STORAGE_TIME 0x10 +#define QF_TIME_STORAGE_WAKEUP 0x20 + +typedef struct _EFI_IFR_DISABLE_IF { + EFI_IFR_OP_HEADER Header; +} EFI_IFR_DISABLE_IF; + +typedef struct _EFI_IFR_SUPPRESS_IF { + EFI_IFR_OP_HEADER Header; +} EFI_IFR_SUPPRESS_IF; + +typedef struct _EFI_IFR_GRAY_OUT_IF { + EFI_IFR_OP_HEADER Header; +} EFI_IFR_GRAY_OUT_IF; + +typedef struct _EFI_IFR_INCONSISTENT_IF { + EFI_IFR_OP_HEADER Header; + EFI_STRING_ID Error; +} EFI_IFR_INCONSISTENT_IF; + +typedef struct _EFI_IFR_NO_SUBMIT_IF { + EFI_IFR_OP_HEADER Header; + EFI_STRING_ID Error; +} EFI_IFR_NO_SUBMIT_IF; + +typedef struct _EFI_IFR_REFRESH { + EFI_IFR_OP_HEADER Header; + UINT8 RefreshInterval; +} EFI_IFR_REFRESH; + +typedef struct _EFI_IFR_VARSTORE_DEVICE { + EFI_IFR_OP_HEADER Header; + EFI_STRING_ID DevicePath; +} EFI_IFR_VARSTORE_DEVICE; + +typedef struct _EFI_IFR_ONE_OF_OPTION { + EFI_IFR_OP_HEADER Header; + EFI_STRING_ID Option; + UINT8 Flags; + UINT8 Type; + EFI_IFR_TYPE_VALUE Value; +} EFI_IFR_ONE_OF_OPTION; + +#define EFI_IFR_TYPE_NUM_SIZE_8 0x00 +#define EFI_IFR_TYPE_NUM_SIZE_16 0x01 +#define EFI_IFR_TYPE_NUM_SIZE_32 0x02 +#define EFI_IFR_TYPE_NUM_SIZE_64 0x03 +#define EFI_IFR_TYPE_BOOLEAN 0x04 +#define EFI_IFR_TYPE_TIME 0x05 +#define EFI_IFR_TYPE_DATE 0x06 +#define EFI_IFR_TYPE_STRING 0x07 +#define EFI_IFR_TYPE_OTHER 0x08 + +#define EFI_IFR_OPTION_DEFAULT 0x10 +#define EFI_IFR_OPTION_DEFAULT_MFG 0x20 + +typedef struct _EFI_IFR_GUID { + EFI_IFR_OP_HEADER Header; + EFI_GUID Guid; + //Optional Data Follows +} EFI_IFR_GUID; + +typedef struct _EFI_IFR_DUP { + EFI_IFR_OP_HEADER Header; +} EFI_IFR_DUP; + +typedef struct _EFI_IFR_EQ_ID_ID { + EFI_IFR_OP_HEADER Header; + EFI_QUESTION_ID QuestionId1; + EFI_QUESTION_ID QuestionId2; +} EFI_IFR_EQ_ID_ID; + +typedef struct _EFI_IFR_EQ_ID_VAL { + EFI_IFR_OP_HEADER Header; + EFI_QUESTION_ID QuestionId; + UINT16 Value; } EFI_IFR_EQ_ID_VAL; -typedef struct { - EFI_IFR_OP_HEADER Header; - UINT16 QuestionId; // offset into variable storage - UINT8 Width; // size of variable storage - UINT16 ListLength; - UINT16 ValueList[1]; +typedef struct _EFI_IFR_EQ_ID_LIST { + EFI_IFR_OP_HEADER Header; + EFI_QUESTION_ID QuestionId; + UINT16 ListLength; + UINT16 ValueList[1]; } EFI_IFR_EQ_ID_LIST; -typedef struct { - EFI_IFR_OP_HEADER Header; - UINT16 QuestionId1; // offset into variable storage for first value to compare - UINT8 Width; // size of variable storage (must be same for both) - UINT16 QuestionId2; // offset into variable storage for second value to compare -} EFI_IFR_EQ_ID_ID; +typedef struct _EFI_IFR_QUESTION_REF1 { + EFI_IFR_OP_HEADER Header; + EFI_QUESTION_ID QuestionId; +} EFI_IFR_QUESTION_REF1; -typedef struct { - EFI_IFR_OP_HEADER Header; - UINT16 VariableId; // offset into variable storage - UINT16 Value; // value to compare against -} EFI_IFR_EQ_VAR_VAL; +typedef struct _EFI_IFR_UINT8 { + EFI_IFR_OP_HEADER Header; + UINT8 Value; +} EFI_IFR_UINT8; -typedef struct { - EFI_IFR_OP_HEADER Header; +typedef struct _EFI_IFR_UINT16 { + EFI_IFR_OP_HEADER Header; + UINT16 Value; +} EFI_IFR_UINT16; + +typedef struct _EFI_IFR_QUESTION_REF2 { + EFI_IFR_OP_HEADER Header; +} EFI_IFR_QUESTION_REF2; + +typedef struct _EFI_IFR_UINT32 { + EFI_IFR_OP_HEADER Header; + UINT32 Value; +} EFI_IFR_UINT32; + +typedef struct _EFI_IFR_UINT64 { + EFI_IFR_OP_HEADER Header; + UINT64 Value; +} EFI_IFR_UINT64; + +typedef struct _EFI_IFR_QUESTION_REF3 { + EFI_IFR_OP_HEADER Header; +} EFI_IFR_QUESTION_REF3; + +typedef struct _EFI_IFR_QUESTION_REF3_2 { + EFI_IFR_OP_HEADER Header; + EFI_STRING_ID DevicePath; +} EFI_IFR_QUESTION_REF3_2; + +typedef struct _EFI_IFR_QUESTION_REF3_3 { + EFI_IFR_OP_HEADER Header; + EFI_STRING_ID DevicePath; + EFI_GUID Guid; +} EFI_IFR_QUESTION_REF3_3; + +typedef struct _EFI_IFR_RULE_REF { + EFI_IFR_OP_HEADER Header; + UINT8 RuleId; +} EFI_IFR_RULE_REF; + +typedef struct _EFI_IFR_STRING_REF1 { + EFI_IFR_OP_HEADER Header; + EFI_STRING_ID StringId; +} EFI_IFR_STRING_REF1; + +typedef struct _EFI_IFR_STRING_REF2 { + EFI_IFR_OP_HEADER Header; +} EFI_IFR_STRING_REF2; + +typedef struct _EFI_IFR_THIS { + EFI_IFR_OP_HEADER Header; +} EFI_IFR_THIS; + +typedef struct _EFI_IFR_TRUE { + EFI_IFR_OP_HEADER Header; +} EFI_IFR_TRUE; + +typedef struct _EFI_IFR_FALSE { + EFI_IFR_OP_HEADER Header; +} EFI_IFR_FALSE; + +typedef struct _EFI_IFR_ONE { + EFI_IFR_OP_HEADER Header; +} EFI_IFR_ONE; + +typedef struct _EFI_IFR_ONES { + EFI_IFR_OP_HEADER Header; +} EFI_IFR_ONES; + +typedef struct _EFI_IFR_ZERO { + EFI_IFR_OP_HEADER Header; +} EFI_IFR_ZERO; + +typedef struct _EFI_IFR_UNDEFINED { + EFI_IFR_OP_HEADER Header; +} EFI_IFR_UNDEFINED; + +typedef struct _EFI_IFR_VERSION { + EFI_IFR_OP_HEADER Header; +} EFI_IFR_VERSION; + +typedef struct _EFI_IFR_LENGTH { + EFI_IFR_OP_HEADER Header; +} EFI_IFR_LENGTH; + +typedef struct _EFI_IFR_NOT { + EFI_IFR_OP_HEADER Header; +} EFI_IFR_NOT; + +typedef struct _EFI_IFR_BITWISE_NOT { + EFI_IFR_OP_HEADER Header; +} EFI_IFR_BITWISE_NOT; + +typedef struct _EFI_IFR_TO_BOOLEAN { + EFI_IFR_OP_HEADER Header; +} EFI_IFR_TO_BOOLEAN; + +#define EFI_IFR_STRING_UNSIGNED_DEC 0 +#define EFI_IFR_STRING_SIGNED_DEC 1 +#define EFI_IFR_STRING_LOWERCASE_HEX 2 +#define EFI_IFR_STRING_UPPERCASE_HEX 3 + +#define EFI_IFR_STRING_ASCII 0 +#define EFI_IFR_STRING_UNICODE 8 + +typedef struct _EFI_IFR_TO_STRING { + EFI_IFR_OP_HEADER Header; + UINT8 Format; +} EFI_IFR_TO_STRING; + +typedef struct _EFI_IFR_TO_UINT { + EFI_IFR_OP_HEADER Header; +} EFI_IFR_TO_UINT; + +typedef struct _EFI_IFR_TO_UPPER { + EFI_IFR_OP_HEADER Header; +} EFI_IFR_TO_UPPER; + +typedef struct _EFI_IFR_TO_LOWER { + EFI_IFR_OP_HEADER Header; +} EFI_IFR_TO_LOWER; + +typedef struct _EFI_IFR_ADD { + EFI_IFR_OP_HEADER Header; +} EFI_IFR_ADD; + +typedef struct _EFI_IFR_AND { + EFI_IFR_OP_HEADER Header; } EFI_IFR_AND; -typedef struct { - EFI_IFR_OP_HEADER Header; +typedef struct _EFI_IFR_BITWISE_AND { + EFI_IFR_OP_HEADER Header; +} EFI_IFR_BITWISE_AND; + +typedef struct _EFI_IFR_BITWISE_OR { + EFI_IFR_OP_HEADER Header; +} EFI_IFR_BITWISE_OR; + +typedef struct _EFI_IFR_CATENATE { + EFI_IFR_OP_HEADER Header; +} EFI_IFR_CATENATE; + +typedef struct _EFI_IFR_DIVIDE { + EFI_IFR_OP_HEADER Header; +} EFI_IFR_DIVIDE; + +typedef struct _EFI_IFR_EQUAL { + EFI_IFR_OP_HEADER Header; +} EFI_IFR_EQUAL; + +typedef struct _EFI_IFR_GREATER_EQUAL { + EFI_IFR_OP_HEADER Header; +} EFI_IFR_GREATER_EQUAL; + +typedef struct _EFI_IFR_GREATER_THAN { + EFI_IFR_OP_HEADER Header; +} EFI_IFR_GREATER_THAN; + +typedef struct _EFI_IFR_LESS_EQUAL { + EFI_IFR_OP_HEADER Header; +} EFI_IFR_LESS_EQUAL; + +typedef struct _EFI_IFR_LESS_THAN { + EFI_IFR_OP_HEADER Header; +} EFI_IFR_LESS_THAN; + +typedef struct _EFI_IFR_MATCH { + EFI_IFR_OP_HEADER Header; +} EFI_IFR_MATCH; + +typedef struct _EFI_IFR_MULTIPLY { + EFI_IFR_OP_HEADER Header; +} EFI_IFR_MULTIPLY; + +typedef struct _EFI_IFR_MODULO { + EFI_IFR_OP_HEADER Header; +} EFI_IFR_MODULO; + +typedef struct _EFI_IFR_NOT_EQUAL { + EFI_IFR_OP_HEADER Header; +} EFI_IFR_NOT_EQUAL; + +typedef struct _EFI_IFR_OR { + EFI_IFR_OP_HEADER Header; } EFI_IFR_OR; -typedef struct { - EFI_IFR_OP_HEADER Header; -} EFI_IFR_NOT; +typedef struct _EFI_IFR_SHIFT_LEFT { + EFI_IFR_OP_HEADER Header; +} EFI_IFR_SHIFT_LEFT; -typedef struct { - EFI_IFR_OP_HEADER Header; -} EFI_IFR_END_EXPR, EFI_IFR_END_IF; +typedef struct _EFI_IFR_SHIFT_RIGHT { + EFI_IFR_OP_HEADER Header; +} EFI_IFR_SHIFT_RIGHT; -typedef struct { - EFI_IFR_OP_HEADER Header; - UINT16 FormId; - STRING_REF Prompt; - STRING_REF Help; - UINT8 Flags; - UINT16 Key; -} EFI_IFR_SAVE_DEFAULTS; +typedef struct _EFI_IFR_SUBTRACT { + EFI_IFR_OP_HEADER Header; +} EFI_IFR_SUBTRACT; -typedef struct { - EFI_IFR_OP_HEADER Header; - STRING_REF Help; - STRING_REF Text; - STRING_REF TextTwo; // optional text -} EFI_IFR_INVENTORY; +typedef struct _EFI_IFR_CONDITIONAL { + EFI_IFR_OP_HEADER Header; +} EFI_IFR_CONDITIONAL; -typedef struct { - EFI_IFR_OP_HEADER Header; - EFI_GUID Guid; // GUID for the variable - UINT16 VarId; // variable store ID, as referenced elsewhere in the form - UINT16 Size; // size of the variable storage -} EFI_IFR_VARSTORE; +#define EFI_IFR_FF_CASE_SENSITIVE 0x00 +#define EFI_IFR_FF_CASE_INSENSITIVE 0x01 -typedef struct { - EFI_IFR_OP_HEADER Header; - UINT16 VarId; // variable store ID, as referenced elsewhere in the form -} EFI_IFR_VARSTORE_SELECT; +typedef struct _EFI_IFR_FIND { + EFI_IFR_OP_HEADER Header; + UINT8 Format; +} EFI_IFR_FIND; + +typedef struct _EFI_IFR_MID { + EFI_IFR_OP_HEADER Header; +} EFI_IFR_MID; + +typedef struct _EFI_IFR_TOKEN { + EFI_IFR_OP_HEADER Header; +} EFI_IFR_TOKEN; + +#define EFI_IFR_FLAGS_FIRST_MATCHING 0x00 +#define EFI_IFR_FLAGS_FIRST_NON_MATCHING 0x01 + +typedef struct _EFI_IFR_SPAN { + EFI_IFR_OP_HEADER Header; + UINT8 Flags; +} EFI_IFR_SPAN; // -// Used for the ideqid VFR statement where two variable stores may be referenced in the -// same VFR statement. -// A browser should treat this as an EFI_IFR_VARSTORE_SELECT statement and assume that all following -// IFR opcodes use the VarId as defined here. +// Keyboard Package // + +typedef enum { + EfiKeyLCtrl, + EfiKeyA0, + EfiKeyLAlt, + EfiKeySpaceBar, + EfiKeyA2, + EfiKeyA3, + EfiKeyA4, + EfiKeyRCtrl, + EfiKeyLeftArrow, + EfiKeyDownArrow, + EfiKeyRightArrow, + EfiKeyZero, + EfiKeyPeriod, + EfiKeyEnter, + EfiKeyLShift, + EfiKeyB0, + EfiKeyB1, + EfiKeyB2, + EfiKeyB3, + EfiKeyB4, + EfiKeyB5, + EfiKeyB6, + EfiKeyB7, + EfiKeyB8, + EfiKeyB9, + EfiKeyB10, + EfiKeyRshift, + EfiKeyUpArrow, + EfiKeyOne, + EfiKeyTwo, + EfiKeyThree, + EfiKeyCapsLock, + EfiKeyC1, + EfiKeyC2, + EfiKeyC3, + EfiKeyC4, + EfiKeyC5, + EfiKeyC6, + EfiKeyC7, + EfiKeyC8, + EfiKeyC9, + EfiKeyC10, + EfiKeyC11, + EfiKeyC12, + EfiKeyFour, + EfiKeyFive, + EfiKeySix, + EfiKeyPlus, + EfiKeyTab, + EfiKeyD1, + EfiKeyD2, + EfiKeyD3, + EfiKeyD4, + EfiKeyD5, + EfiKeyD6, + EfiKeyD7, + EfiKeyD8, + EfiKeyD9, + EfiKeyD10, + EfiKeyD11, + EfiKeyD12, + EfiKeyD13, + EfiKeyDel, + EfiKeyEnd, + EfiKeyPgDn, + EfiKeySeven, + EfiKeyEight, + EfiKeyNine, + EfiKeyE0, + EfiKeyE1, + EfiKeyE2, + EfiKeyE3, + EfiKeyE4, + EfiKeyE5, + EfiKeyE6, + EfiKeyE7, + EfiKeyE8, + EfiKeyE9, + EfiKeyE10, + EfiKeyE11, + EfiKeyE12, + EfiKeyBackSpace, + EfiKeyIns, + EfiKeyHome, + EfiKeyPgUp, + EfiKeyNLck, + EfiKeySlash, + EfiKeyAsterisk, + EfiKeyMinus, + EfiKeyEsc, + EfiKeyF1, + EfiKeyF2, + EfiKeyF3, + EfiKeyF4, + EfiKeyF5, + EfiKeyF6, + EfiKeyF7, + EfiKeyF8, + EfiKeyF9, + EfiKeyF10, + EfiKeyF11, + EfiKeyF12, + EfiKeyPrint, + EfiKeySLck, + EfiKeyPause +} EFI_KEY; + typedef struct { - EFI_IFR_OP_HEADER Header; - UINT16 VarId; // variable store ID, as referenced elsewhere in the form - UINT16 SecondaryVarId; // variable store ID, as referenced elsewhere in the form -} EFI_IFR_VARSTORE_SELECT_PAIR; + EFI_KEY Key; + CHAR16 Unicode; + CHAR16 ShiftedUnicode; + CHAR16 AltGrUnicode; + CHAR16 ShiftedAltGrUnicode; + UINT16 Modifier; + UINT16 AffectedAttribute; +} EFI_KEY_DESCRIPTOR; + +// +// A key which is affected by all the standard shift modifiers. +// Most keys would be expected to have this bit active. +// +#define EFI_AFFECTED_BY_STANDARD_SHIFT 0x0001 +// +// This key is affected by the caps lock so that if a keyboard driver +// would need to disambiguate between a key which had a ¡°1¡± defined +// versus a ¡°a¡± character. Having this bit turned on would tell +// the keyboard driver to use the appropriate shifted state or not. +// +#define EFI_AFFECTED_BY_CAPS_LOCK 0x0002 +// +// Similar to the case of CAPS lock, if this bit is active, the key +// is affected by the num lock being turned on. +// +#define EFI_AFFECTED_BY_NUM_LOCK 0x0004 typedef struct { - EFI_IFR_OP_HEADER Header; -} EFI_IFR_TRUE; + UINT16 LayoutLength; + EFI_GUID Guid; + UINT32 LayoutDescriptorStringOffset; + UINT8 DescriptorCount; + // EFI_KEY_DESCRIPTOR Descriptors[]; +} EFI_HII_KEYBOARD_LAYOUT; typedef struct { - EFI_IFR_OP_HEADER Header; -} EFI_IFR_FALSE; + EFI_HII_PACKAGE_HEADER Header; + UINT16 LayoutCount; + // EFI_HII_KEYBOARD_LAYOUT Layout[]; +} EFI_HII_KEYBOARD_PACKAGE_HDR; typedef struct { - EFI_IFR_OP_HEADER Header; -} EFI_IFR_GT; + CHAR16 Language[3]; + CHAR16 Space; + CHAR16 DescriptionString[1]; +} EFI_DESCRIPTION_STRING; typedef struct { - EFI_IFR_OP_HEADER Header; -} EFI_IFR_GE; + UINT16 DescriptionCount; + EFI_DESCRIPTION_STRING DescriptionString[1]; +} EFI_DESCRIPTION_STRING_BUNDLE; // -// Save defaults and restore defaults have same structure +// Modifier values // -#define EFI_IFR_RESTORE_DEFAULTS EFI_IFR_SAVE_DEFAULTS +#define EFI_NULL_MODIFIER 0x0000 +#define EFI_LEFT_CONTROL_MODIFIER 0x0001 +#define EFI_RIGHT_CONTROL_MODIFIER 0x0002 +#define EFI_LEFT_ALT_MODIFIER 0x0003 +#define EFI_RIGHT_ALT_MODIFIER 0x0004 +#define EFI_ALT_GR_MODIFIER 0x0005 +#define EFI_INSERT_MODIFIER 0x0006 +#define EFI_DELETE_MODIFIER 0x0007 +#define EFI_PAGE_DOWN_MODIFIER 0x0008 +#define EFI_PAGE_UP_MODIFIER 0x0009 +#define EFI_HOME_MODIFIER 0x000A +#define EFI_END_MODIFIER 0x000B +#define EFI_LEFT_SHIFT_MODIFIER 0x000C +#define EFI_RIGHT_SHIFT_MODIFIER 0x000D +#define EFI_CAPS_LOCK_MODIFIER 0x000E +#define EFI_NUM_LOCK _MODIFIER 0x000F +#define EFI_LEFT_ARROW_MODIFIER 0x0010 +#define EFI_RIGHT_ARROW_MODIFIER 0x0011 +#define EFI_DOWN_ARROW_MODIFIER 0x0012 +#define EFI_UP_ARROW_MODIFIER 0x0013 +#define EFI_NS_KEY_MODIFIER 0x0014 +#define EFI_NS_KEY_DEPENDENCY_MODIFIER 0x0015 +#define EFI_FUNCTION_KEY_ONE_MODIFIER 0x0016 +#define EFI_FUNCTION_KEY_TWO_MODIFIER 0x0017 +#define EFI_FUNCTION_KEY_THREE_MODIFIER 0x0018 +#define EFI_FUNCTION_KEY_FOUR_MODIFIER 0x0019 +#define EFI_FUNCTION_KEY_FIVE_MODIFIER 0x001A +#define EFI_FUNCTION_KEY_SIX_MODIFIER 0x001B +#define EFI_FUNCTION_KEY_SEVEN_MODIFIER 0x001C +#define EFI_FUNCTION_KEY_EIGHT_MODIFIER 0x001D +#define EFI_FUNCTION_KEY_NINE_MODIFIER 0x001E +#define EFI_FUNCTION_KEY_TEN_MODIFIER 0x001F +#define EFI_FUNCTION_KEY_ELEVEN_MODIFIER 0x0020 +#define EFI_FUNCTION_KEY_TWELVE_MODIFIER 0x0021 -typedef struct { - EFI_IFR_OP_HEADER Header; - STRING_REF Title; // The string token for the banner title - UINT16 LineNumber; // 1-based line number - UINT8 Alignment; // left, center, or right-aligned -} EFI_IFR_BANNER; - -#define EFI_IFR_BANNER_ALIGN_LEFT 0 -#define EFI_IFR_BANNER_ALIGN_CENTER 1 -#define EFI_IFR_BANNER_ALIGN_RIGHT 2 -#define EFI_IFR_BANNER_TIMEOUT 0xFF +// +// Keys that have multiple control functions based on modifier +// settings are handled in the keyboard driver implementation. +// For instance PRINT_KEY might have a modifier held down and +// is still a nonprinting character, but might have an alternate +// control function like SYSREQUEST +// +#define EFI_PRINT_MODIFIER 0x0022 +#define EFI_SYS_REQUEST_MODIFIER 0x0023 +#define EFI_SCROLL_LOCK_MODIFIER 0x0024 +#define EFI_PAUSE_MODIFIER 0x0025 +#define EFI_BREAK_MODIFIER 0x0026 #pragma pack() diff --git a/MdePkg/Library/DxeMemoryAllocationLib/MemoryAllocationLib.c b/MdePkg/Library/DxeMemoryAllocationLib/MemoryAllocationLib.c index 3e04bb1cba..773797a291 100644 --- a/MdePkg/Library/DxeMemoryAllocationLib/MemoryAllocationLib.c +++ b/MdePkg/Library/DxeMemoryAllocationLib/MemoryAllocationLib.c @@ -1077,3 +1077,17 @@ FreeAlignedPool ( Status = gBS->FreePool (RawAddress); ASSERT_EFI_ERROR (Status); } + + +VOID +EFIAPI +SafeFreePool ( + IN VOID *Buffer + ) +{ + if (Buffer != NULL) { + FreePool (Buffer); + Buffer = NULL; + } +} + diff --git a/MdePkg/Library/HiiLib/HiiLib.c b/MdePkg/Library/HiiLib/HiiLib.c index 6cc5e764e9..ef86f5da24 100644 --- a/MdePkg/Library/HiiLib/HiiLib.c +++ b/MdePkg/Library/HiiLib/HiiLib.c @@ -15,33 +15,785 @@ #include +#include +#include +#include + +#include + +#include +#include #include #include #include +#include +#include +#include + +#include + +#include "InternalHiiLib.h" + + +EFI_HII_DATABASE_PROTOCOL *mHiiDatabaseProt; +EFI_HII_STRING_PROTOCOL *mHiiStringProt; + +// +// Hii vendor device path template +// +HII_VENDOR_DEVICE_PATH mHiiVendorDevicePathTemplate = { + { + { + { + HARDWARE_DEVICE_PATH, + HW_VENDOR_DP, + { + (UINT8) (sizeof (HII_VENDOR_DEVICE_PATH_NODE)), + (UINT8) ((sizeof (HII_VENDOR_DEVICE_PATH_NODE)) >> 8) + } + }, + EFI_IFR_TIANO_GUID + }, + 0 + }, + { + END_DEVICE_PATH_TYPE, + END_ENTIRE_DEVICE_PATH_SUBTYPE, + { + END_DEVICE_PATH_LENGTH + } + } +}; + +EFI_STATUS +EFIAPI +UefiHiiLibConstructor ( + IN EFI_HANDLE ImageHandle, + IN EFI_SYSTEM_TABLE *SystemTable + ) +{ + EFI_STATUS Status; + + Status = gBS->LocateProtocol ( + &gEfiHiiDatabaseProtocolGuid, + NULL, + (VOID **) &mHiiDatabaseProt + ); + ASSERT_EFI_ERROR (Status); + ASSERT (mHiiDatabaseProt != NULL); + + Status = gBS->LocateProtocol ( + &gEfiHiiStringProtocolGuid, + NULL, + (VOID **) &mHiiStringProt + ); + ASSERT_EFI_ERROR (Status); + ASSERT (mHiiStringProt != NULL); + + return EFI_SUCCESS; +} + +EFI_STATUS +HiiLibGetCurrentLanguage ( + OUT CHAR8 *Lang + ) +/*++ + +Routine Description: + Determine what is the current language setting + +Arguments: + Lang - Pointer of system language + +Returns: + Status code + +--*/ +{ + EFI_STATUS Status; + UINTN Size; + + // + // Get current language setting + // + Size = RFC_3066_ENTRY_SIZE; + Status = gRT->GetVariable ( + L"PlatformLang", + &gEfiGlobalVariableGuid, + NULL, + &Size, + Lang + ); + + if (EFI_ERROR (Status)) { + AsciiStrCpy (Lang, (CHAR8 *) PcdGetPtr (PcdUefiVariableDefaultPlatformLang)); + } + + return Status; +} + +VOID +HiiLibGetNextLanguage ( + IN OUT CHAR8 **LangCode, + OUT CHAR8 *Lang + ) +/*++ + +Routine Description: + Get next language from language code list (with separator ';'). + +Arguments: + LangCode - On input: point to first language in the list. On output: point to + next language in the list, or NULL if no more language in the list. + Lang - The first language in the list. + +Returns: + None. + +--*/ +{ + UINTN Index; + CHAR8 *StringPtr; + + if (LangCode == NULL || *LangCode == NULL) { + *Lang = 0; + return; + } + + Index = 0; + StringPtr = *LangCode; + while (StringPtr[Index] != 0 && StringPtr[Index] != ';') { + Index++; + } + + CopyMem (Lang, StringPtr, Index); + Lang[Index] = 0; + + if (StringPtr[Index] == ';') { + Index++; + } + *LangCode = StringPtr + Index; +} + +CHAR8 * +HiiLibGetSupportedLanguages ( + IN EFI_HII_HANDLE HiiHandle + ) +/*++ + +Routine Description: + This function returns the list of supported languages, in the format specified + in UEFI specification Appendix M. + +Arguments: + HiiHandle - The HII package list handle. + +Returns: + The supported languages. + +--*/ +{ + EFI_STATUS Status; + UINTN BufferSize; + CHAR8 *LanguageString; + + // + // Collect current supported Languages for given HII handle + // + BufferSize = 0x1000; + LanguageString = AllocatePool (BufferSize); + Status = mHiiStringProt->GetLanguages (mHiiStringProt, HiiHandle, LanguageString, &BufferSize); + if (Status == EFI_BUFFER_TOO_SMALL) { + gBS->FreePool (LanguageString); + LanguageString = AllocatePool (BufferSize); + Status = mHiiStringProt->GetLanguages (mHiiStringProt, HiiHandle, LanguageString, &BufferSize); + } + + if (EFI_ERROR (Status)) { + LanguageString = NULL; + } + + return LanguageString; +} + +UINT16 +HiiLibGetSupportedLanguageNumber ( + IN EFI_HII_HANDLE HiiHandle + ) +/*++ + +Routine Description: + This function returns the number of supported languages + +Arguments: + HiiHandle - The HII package list handle. + +Returns: + The number of supported languages. + +--*/ +{ + CHAR8 *Languages; + CHAR8 *LanguageString; + UINT16 LangNumber; + CHAR8 Lang[RFC_3066_ENTRY_SIZE]; + + Languages = HiiLibGetSupportedLanguages (HiiHandle); + if (Languages == NULL) { + return 0; + } + + LangNumber = 0; + LanguageString = Languages; + while (*LanguageString != 0) { + HiiLibGetNextLanguage (&LanguageString, Lang); + LangNumber++; + } + gBS->FreePool (Languages); + + return LangNumber; +} + + +EFI_HII_PACKAGE_LIST_HEADER * +InternalHiiLibPreparePackages ( + IN UINTN NumberOfPackages, + IN CONST EFI_GUID *GuidId, OPTIONAL + VA_LIST Marker + ) +{ + EFI_HII_PACKAGE_LIST_HEADER *PackageListHeader; + UINT8 *PackageListData; + UINT32 PackageListLength; + UINT32 PackageLength; + EFI_HII_PACKAGE_HEADER PackageHeader; + UINT8 *PackageArray; + UINTN Index; + VA_LIST MarkerBackup; + + PackageListLength = sizeof (EFI_HII_PACKAGE_LIST_HEADER); + + MarkerBackup = Marker; + + for (Index = 0; Index < NumberOfPackages; Index++) { + CopyMem (&PackageLength, VA_ARG (Marker, VOID *), sizeof (UINT32)); + PackageListLength += (PackageLength - sizeof (UINT32)); + } + + // + // Include the lenght of EFI_HII_PACKAGE_END + // + PackageListLength += sizeof (EFI_HII_PACKAGE_HEADER); + PackageListHeader = AllocateZeroPool (PackageListLength); + ASSERT (PackageListHeader != NULL); + CopyMem (&PackageListHeader->PackageListGuid, GuidId, sizeof (EFI_GUID)); + PackageListHeader->PackageLength = PackageListLength; + + PackageListData = ((UINT8 *) PackageListHeader) + sizeof (EFI_HII_PACKAGE_LIST_HEADER); + + Marker = MarkerBackup; + for (Index = 0; Index < NumberOfPackages; Index++) { + PackageArray = (UINT8 *) VA_ARG (Marker, VOID *); + CopyMem (&PackageLength, PackageArray, sizeof (UINT32)); + PackageLength -= sizeof (UINT32); + PackageArray += sizeof (UINT32); + CopyMem (PackageListData, PackageArray, PackageLength); + PackageListData += PackageLength; + } + + // + // Append EFI_HII_PACKAGE_END + // + PackageHeader.Type = EFI_HII_PACKAGE_END; + PackageHeader.Length = sizeof (EFI_HII_PACKAGE_HEADER); + CopyMem (PackageListData, &PackageHeader, PackageHeader.Length); + + return PackageListHeader; +} + +EFI_HII_PACKAGE_LIST_HEADER * +EFIAPI +HiiLibPreparePackageList ( + IN UINTN NumberOfPackages, + IN CONST EFI_GUID *GuidId, + ... + ) +/*++ + +Routine Description: + Assemble EFI_HII_PACKAGE_LIST according to the passed in packages. + +Arguments: + NumberOfPackages - Number of packages. + GuidId - Package GUID. + +Returns: + Pointer of EFI_HII_PACKAGE_LIST_HEADER. + +--*/ +{ + EFI_HII_PACKAGE_LIST_HEADER *PackageListHeader; + VA_LIST Marker; + + VA_START (Marker, GuidId); + PackageListHeader = InternalHiiLibPreparePackages (NumberOfPackages, GuidId, Marker); + VA_END (Marker); + + return PackageListHeader; +} + /** - This function allocates pool for an EFI_HII_PACKAGES structure - with enough space for the variable argument list of package pointers. - The allocated structure is initialized using NumberOfPackages, Guid, - and the variable length argument list of package pointers. + This function allocates pool for an EFI_HII_PACKAGE_LIST structure + with additional space that is big enough to host all packages described by the variable + argument list of package pointers. The allocated structure is initialized using NumberOfPackages, + GuidId, and the variable length argument list of package pointers. - @param NumberOfPackages The number of HII packages to prepare. - @param Guid Package GUID. + Then, EFI_HII_PACKAGE_LIST will be register to the default System HII Database. The + Handle to the newly registered Package List is returned throught HiiHandle. - @return The allocated and initialized packages. + @param NumberOfPackages The number of HII packages to register. + @param GuidId Package List GUID ID. + @param HiiHandle The ID used to retrieve the Package List later. + @param ... The variable argument list describing all HII Package. + + @return + The allocated and initialized packages. **/ -EFI_HII_PACKAGE_LIST_HEADER * + +EFI_STATUS +EFIAPI +HiiLibAddPackagesToHiiDatabase ( + IN UINTN NumberOfPackages, + IN CONST EFI_GUID *GuidId, + IN EFI_HANDLE DriverHandle, OPTIONAL + OUT EFI_HII_HANDLE *HiiHandle, OPTIONAL + ... + ) +{ + VA_LIST Args; + EFI_HII_PACKAGE_LIST_HEADER *PackageListHeader; + EFI_STATUS Status; + + + VA_START (Args, HiiHandle); + PackageListHeader = InternalHiiLibPreparePackages (NumberOfPackages, GuidId, Args); + + Status = mHiiDatabaseProt->NewPackageList (mHiiDatabaseProt, PackageListHeader, DriverHandle, HiiHandle); + if (HiiHandle != NULL) { + if (EFI_ERROR (Status)) { + *HiiHandle = NULL; + } + } + + FreePool (PackageListHeader); + VA_END (Args); + + return Status; +} + +EFI_STATUS +EFIAPI +HiiLibAddFontPackageToHiiDatabase ( + IN UINTN FontSize, + IN CONST UINT8 *FontBinary, + IN CONST EFI_GUID *GuidId, + OUT EFI_HII_HANDLE *HiiHandle OPTIONAL + ) +{ + EFI_STATUS Status; + UINT8 *Location; + EFI_HII_SIMPLE_FONT_PACKAGE_HDR *SimplifiedFont; + UINTN PackageLength; + EFI_HII_PACKAGE_LIST_HEADER *PackageList; + UINT8 *Package; + + // + // Add 4 bytes to the header for entire length for PreparePackageList use only. + // Looks ugly. Might be updated when font tool is ready. + // + PackageLength = sizeof (EFI_HII_SIMPLE_FONT_PACKAGE_HDR) + FontSize + 4; + Package = AllocateZeroPool (PackageLength); + if (Package == NULL) { + return EFI_OUT_OF_RESOURCES; + } + CopyMem (Package, &PackageLength, 4); + SimplifiedFont = (EFI_HII_SIMPLE_FONT_PACKAGE_HDR*) (Package + 4); + SimplifiedFont->Header.Length = (UINT32) (PackageLength - 4); + SimplifiedFont->Header.Type = EFI_HII_PACKAGE_SIMPLE_FONTS; + SimplifiedFont->NumberOfNarrowGlyphs = (UINT16) (FontSize / sizeof (EFI_NARROW_GLYPH)); + + Location = (UINT8 *) (&SimplifiedFont->NumberOfWideGlyphs + 1); + CopyMem (Location, FontBinary, FontSize); + + // + // Add this simplified font package to a package list then install it. + // + PackageList = HiiLibPreparePackageList (1, GuidId, Package); + Status = mHiiDatabaseProt->NewPackageList (mHiiDatabaseProt, PackageList, NULL, HiiHandle); + ASSERT_EFI_ERROR (Status); + SafeFreePool (PackageList); + SafeFreePool (Package); + + return EFI_SUCCESS; +} + +EFI_STATUS +EFIAPI +HiiLibRemovePackagesFromHiiDatabase ( + IN EFI_HII_HANDLE HiiHandle + ) +{ + return mHiiDatabaseProt->RemovePackageList (mHiiDatabaseProt, HiiHandle); +} + +EFI_STATUS +EFIAPI +HiiLibCreateString ( + IN EFI_HII_HANDLE PackageList, + OUT EFI_STRING_ID *StringId, + IN CONST EFI_STRING String + ) +{ + EFI_STATUS Status; + CHAR8 *Languages; + CHAR8 *LangStrings; + CHAR8 Lang[RFC_3066_ENTRY_SIZE]; + + Status = EFI_SUCCESS; + + Languages = HiiLibGetSupportedLanguages (PackageList); + + LangStrings = Languages; + while (*LangStrings != 0) { + HiiLibGetNextLanguage (&LangStrings, Lang); + + Status = mHiiStringProt->NewString ( + mHiiStringProt, + PackageList, + StringId, + Lang, + NULL, + String, + NULL + ); + if (EFI_ERROR (Status)) { + break; + } + } + + FreePool (Languages); + + return Status; + +} + +EFI_STATUS +EFIAPI +HiiLibUpdateString ( + IN EFI_HII_HANDLE PackageList, + IN EFI_STRING_ID StringId, + IN CONST EFI_STRING String + ) +{ + EFI_STATUS Status; + CHAR8 *Languages; + CHAR8 *LangStrings; + CHAR8 Lang[RFC_3066_ENTRY_SIZE]; + + Status = EFI_SUCCESS; + + Languages = HiiLibGetSupportedLanguages (PackageList); + + LangStrings = Languages; + while (*LangStrings != 0) { + HiiLibGetNextLanguage (&LangStrings, Lang); + + Status = mHiiStringProt->SetString ( + mHiiStringProt, + PackageList, + StringId, + Lang, + String, + NULL + ); + if (EFI_ERROR (Status)) { + break; + } + } + + FreePool (Languages); + + return Status; +} + +// // +// ////////////////////////////////////////////////// +// // + +// +// This function is Implementation Specifc. HII_VENDOR_DEVICE_PATH +// This should be moved to MdeModulepkg. +// +EFI_STATUS EFIAPI -PreparePackages ( - IN CONST UINTN NumberOfPackages, - IN CONST EFI_GUID *Guid OPTIONAL, +HiiLibCreateHiiDriverHandle ( + OUT EFI_HANDLE *DriverHandle + ) +{ + EFI_STATUS Status; + HII_VENDOR_DEVICE_PATH_NODE *VendorDevicePath; + UINT64 MonotonicCount; + + VendorDevicePath = AllocateCopyPool (sizeof (HII_VENDOR_DEVICE_PATH), &mHiiVendorDevicePathTemplate); + if (VendorDevicePath == NULL) { + return EFI_OUT_OF_RESOURCES; + } + + gBS->GetNextMonotonicCount (&MonotonicCount); + VendorDevicePath->MonotonicCount = (UINT32) MonotonicCount; + + *DriverHandle = NULL; + Status = gBS->InstallProtocolInterface ( + DriverHandle, + &gEfiDevicePathProtocolGuid, + EFI_NATIVE_INTERFACE, + VendorDevicePath + ); + if (EFI_ERROR (Status)) { + return Status; + } + + return EFI_SUCCESS; +} + + +EFI_STATUS +EFIAPI +HiiLibDestroyHiiDriverHandle ( + IN EFI_HANDLE DriverHandle + ) +{ + EFI_STATUS Status; + EFI_DEVICE_PATH_PROTOCOL *DevicePath; + + Status = gBS->HandleProtocol ( + DriverHandle, + &gEfiDevicePathProtocolGuid, + (VOID **) &DevicePath + ); + if (EFI_ERROR (Status)) { + return Status; + } + + Status = gBS->UninstallProtocolInterface ( + DriverHandle, + &gEfiDevicePathProtocolGuid, + DevicePath + ); + + return Status; +} + +EFI_STATUS +HiiLibExtractDefault( + IN VOID *Buffer, + IN UINTN *BufferSize, + UINTN Number, ... ) +/*++ + + Routine Description: + + Configure the buffer accrording to ConfigBody strings. + + Arguments: + DefaultId - the ID of default. + Buffer - the start address of buffer. + BufferSize - the size of buffer. + Number - the number of the strings. + + Returns: + EFI_BUFFER_TOO_SMALL - the BufferSize is too small to operate. + EFI_INVALID_PARAMETER - Buffer is NULL or BufferSize is 0. + EFI_SUCCESS - Operation successful. + +--*/ { + VA_LIST Args; + UINTN Index; + UINT32 TotalLen; + UINT8 *BufCfgArray; + UINT8 *BufferPos; + UINT16 Offset; + UINT16 Width; + UINT8 *Value; + + if ((Buffer == NULL) || (BufferSize == NULL)) { + return EFI_INVALID_PARAMETER; + } + + Offset = 0; + Width = 0; + Value = NULL; + + VA_START (Args, Number); + for (Index = 0; Index < Number; Index++) { + BufCfgArray = (UINT8 *) VA_ARG (Args, VOID *); + CopyMem (&TotalLen, BufCfgArray, sizeof (UINT32)); + BufferPos = BufCfgArray + sizeof (UINT32); + + while ((UINT32)(BufferPos - BufCfgArray) < TotalLen) { + CopyMem (&Offset, BufferPos, sizeof (UINT16)); + BufferPos += sizeof (UINT16); + CopyMem (&Width, BufferPos, sizeof (UINT16)); + BufferPos += sizeof (UINT16); + Value = BufferPos; + BufferPos += Width; + + if ((UINTN)(Offset + Width) > *BufferSize) { + return EFI_BUFFER_TOO_SMALL; + } + + CopyMem ((UINT8 *)Buffer + Offset, Value, Width); + } + } + VA_END (Args); + + *BufferSize = (UINTN)Offset; + + return EFI_SUCCESS; +} + + +STATIC EFI_GUID mIfrVendorGuid = EFI_IFR_TIANO_GUID; + +EFI_STATUS +HiiLibExtractClassFromHiiHandle ( + IN EFI_HII_HANDLE Handle, + OUT UINT16 *Class, + OUT EFI_STRING_ID *FormSetTitle, + OUT EFI_STRING_ID *FormSetHelp + ) +/*++ + +Routine Description: + Extract formset class for given HII handle. + +Arguments: + HiiHandle - Hii handle + Class - Class of the formset + FormSetTitle - Formset title string + FormSetHelp - Formset help string + +Returns: + EFI_SUCCESS - Successfully extract Class for specified Hii handle. + +--*/ +{ + EFI_STATUS Status; + UINTN BufferSize; + EFI_HII_DATABASE_PROTOCOL *HiiDatabase; + EFI_HII_PACKAGE_LIST_HEADER *HiiPackageList; + UINT8 *Package; + UINT8 *OpCodeData; + UINT32 Offset; + UINT32 Offset2; + UINT32 PackageListLength; + EFI_HII_PACKAGE_HEADER PackageHeader; + + *Class = EFI_NON_DEVICE_CLASS; + *FormSetTitle = 0; + *FormSetHelp = 0; + // - // BugBug: Need more detail on UEFI spec. + // Locate HII Database protocol + // + Status = gBS->LocateProtocol ( + &gEfiHiiDatabaseProtocolGuid, + NULL, + (VOID **) &HiiDatabase + ); + if (EFI_ERROR (Status)) { + return Status; + } + + // + // Get HII PackageList + // + BufferSize = 0; + HiiPackageList = NULL; + Status = HiiDatabase->ExportPackageLists (HiiDatabase, Handle, &BufferSize, HiiPackageList); + if (Status == EFI_BUFFER_TOO_SMALL) { + HiiPackageList = AllocatePool (BufferSize); + ASSERT (HiiPackageList != NULL); + + Status = HiiDatabase->ExportPackageLists (HiiDatabase, Handle, &BufferSize, HiiPackageList); + } + if (EFI_ERROR (Status)) { + return Status; + } + // - ASSERT (FALSE); - return NULL; + // Get Form package from this HII package List + // + Offset = sizeof (EFI_HII_PACKAGE_LIST_HEADER); + Offset2 = 0; + CopyMem (&PackageListLength, &HiiPackageList->PackageLength, sizeof (UINT32)); + + while (Offset < PackageListLength) { + Package = ((UINT8 *) HiiPackageList) + Offset; + CopyMem (&PackageHeader, Package, sizeof (EFI_HII_PACKAGE_HEADER)); + + if (PackageHeader.Type == EFI_HII_PACKAGE_FORM) { + // + // Search Class Opcode in this Form Package + // + Offset2 = sizeof (EFI_HII_PACKAGE_HEADER); + while (Offset2 < PackageHeader.Length) { + OpCodeData = Package + Offset2; + + if (((EFI_IFR_OP_HEADER *) OpCodeData)->OpCode == EFI_IFR_FORM_SET_OP) { + // + // Find FormSet OpCode + // + CopyMem (FormSetTitle, &((EFI_IFR_FORM_SET *) OpCodeData)->FormSetTitle, sizeof (EFI_STRING_ID)); + CopyMem (FormSetHelp, &((EFI_IFR_FORM_SET *) OpCodeData)->Help, sizeof (EFI_STRING_ID)); + } + + if ((((EFI_IFR_OP_HEADER *) OpCodeData)->OpCode == EFI_IFR_GUID_OP) && + CompareGuid (&mIfrVendorGuid, (EFI_GUID *)(OpCodeData + sizeof (EFI_IFR_OP_HEADER))) && + (((EFI_IFR_GUID_CLASS *) OpCodeData)->ExtendOpCode == EFI_IFR_EXTEND_OP_CLASS) + ) { + // + // Find GUIDed Class OpCode + // + CopyMem (Class, &((EFI_IFR_GUID_CLASS *) OpCodeData)->Class, sizeof (UINT16)); + + // + // Till now, we ought to have found the formset Opcode + // + break; + } + + Offset2 += ((EFI_IFR_OP_HEADER *) OpCodeData)->Length; + } + + if (Offset2 < PackageHeader.Length) { + // + // Target formset found + // + break; + } + } + + Offset += PackageHeader.Length; + } + + gBS->FreePool (HiiPackageList); + + return EFI_SUCCESS; } + diff --git a/MdePkg/Library/HiiLib/HiiLib.inf b/MdePkg/Library/HiiLib/HiiLib.inf index feaa95649a..ddff1c8004 100644 --- a/MdePkg/Library/HiiLib/HiiLib.inf +++ b/MdePkg/Library/HiiLib/HiiLib.inf @@ -22,8 +22,9 @@ VERSION_STRING = 1.0 LIBRARY_CLASS = HiiLib|DXE_DRIVER DXE_RUNTIME_DRIVER DXE_SAL_DRIVER DXE_SMM_DRIVER UEFI_APPLICATION UEFI_DRIVER EDK_RELEASE_VERSION = 0x00020000 - EFI_SPECIFICATION_VERSION = 0x00020000 + EFI_SPECIFICATION_VERSION = 0x0002000A + CONSTRUCTOR = UefiHiiLibConstructor # # VALID_ARCHITECTURES = IA32 X64 IPF EBC @@ -35,9 +36,27 @@ [Packages] MdePkg/MdePkg.dec - + #BugBug: This package dependency will be re-evaluated when the code become functional and stable. + # : HiiLibCreateHiiDriverHandle depends on HII_VENDOR_DEVICE_PATH which is defined by this + # : specification only. + MdeModulePkg/MdeModulePkg.dec [LibraryClasses] MemoryAllocationLib DebugLib - + PcdLib + UefiRuntimeServicesTableLib + +[Protocols] + gEfiHiiDatabaseProtocolGuid # ALWAYS_CONSUMED + gEfiHiiStringProtocolGuid # ALWAYS_CONSUMED + gEfiDevicePathProtocolGuid + +[Guids] + gEfiGlobalVariableGuid + +[Depex] + gEfiHiiDatabaseProtocolGuid AND gEfiHiiStringProtocolGuid + +[Pcd] + gEfiMdePkgTokenSpaceGuid.PcdUefiVariableDefaultPlatformLang \ No newline at end of file diff --git a/MdePkg/Library/HiiLib/InternalHiiLib.h b/MdePkg/Library/HiiLib/InternalHiiLib.h new file mode 100644 index 0000000000..78540a4431 --- /dev/null +++ b/MdePkg/Library/HiiLib/InternalHiiLib.h @@ -0,0 +1,20 @@ +/** @file + Internal include file for the HII Library instance. + + Copyright (c) 2007, 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 + + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, + WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. + +**/ + +#ifndef __INTERNAL_HII_LIB_H__ +#define __INTERNAL_HII_LIB_H__ + + + +#endif diff --git a/MdePkg/Library/PeiMemoryAllocationLib/MemoryAllocationLib.c b/MdePkg/Library/PeiMemoryAllocationLib/MemoryAllocationLib.c index b1f6157bf5..80a01aac7b 100644 --- a/MdePkg/Library/PeiMemoryAllocationLib/MemoryAllocationLib.c +++ b/MdePkg/Library/PeiMemoryAllocationLib/MemoryAllocationLib.c @@ -1075,3 +1075,16 @@ FreeAlignedPool ( // PEI phase does not support to free pool, so leave it as NOP. // } + + +VOID +EFIAPI +SafeFreePool ( + IN VOID *Buffer + ) +{ + // + // PEI phase does not support to free pool, so leave it as NOP. + // +} + diff --git a/MdePkg/MdePkg.dec b/MdePkg/MdePkg.dec index e5d34a87d0..02d1c943f6 100644 --- a/MdePkg/MdePkg.dec +++ b/MdePkg/MdePkg.dec @@ -83,7 +83,8 @@ BasePeCoffLib|Include/Library/PeCoffLib.h GraphicsLib|Include/Library/GraphicsLib.h ExtractGuidedSectionLib|Include/Library/ExtractGuidedSectionLib.h - + IfrSupportLib|Include/Library/IfrSupportLib.h + [LibraryClasses.IPF] SalLib|Include/Library/SalLib.h PalCallLib|Include/Library/PalCallLib.h @@ -271,9 +272,14 @@ gPcdProtocolGuid = { 0x11B34006, 0xD85B, 0x4D0A, { 0xA2, 0x90, 0xD5, 0xA5, 0x71, 0x31, 0x0E, 0xF7 }} gEfiTcgProtocolGuid = { 0xf541796d, 0xa62e, 0x4954, { 0xa7, 0x75, 0x95, 0x84, 0xf6, 0x1b, 0x9c, 0xdd }} -## BugBug: HII related protocols should be defined. - gEfiFormBrowser2ProtocolGuid = { 0xE5A1333E, 0xE1B4, 0x4D55, { 0xCE, 0xEB, 0x35, 0xC3, 0xEF, 0x13, 0x34, 0x43 }} - + gEfiFormBrowserProtocolGuid = {0xE5A1333E, 0xE1B4, 0x4D55, {0xCE, 0xEB, 0x35, 0xC3, 0xEF, 0x13, 0x34, 0x43}} + gEfiFormBrowser2ProtocolGuid = {0xb9d4c360, 0xbcfb, 0x4f9b, {0x92, 0x98, 0x53, 0xc1, 0x36, 0x98, 0x22, 0x58}} + gEfiHiiStringProtocolGuid = {0x0fd96974, 0x23aa, 0x4cdc, {0xb9, 0xcb, 0x98, 0xd1, 0x77, 0x50, 0x32, 0x2a}} + gEfiHiiImageProtocolGuid = {0x31a6406a, 0x6bdf, 0x4e46, {0xb2, 0xa2, 0xeb, 0xaa, 0x89, 0xc4, 0x09, 0x20}} + gEfiHiiConfigRoutingProtocolGuid = {0x587e72d7, 0xcc50, 0x4f79, {0x82, 0x09, 0xca, 0x29, 0x1f, 0xc1, 0xa1, 0x0f}} + gEfiHiiDatabaseProtocolGuid = {0xef9fc172, 0xa1b2, 0x4693, {0xb3, 0x27, 0x6d, 0x32, 0xfc, 0x41, 0x60, 0x42}} + gEfiHiiFontProtocolGuid = {0xe9ca4775, 0x8657, 0x47fc, {0x97, 0xe7, 0x7e, 0xd6, 0x5a, 0x08, 0x43, 0x24}} + gEfiHiiConfigAccessProtocolGuid = {0x330d4706, 0xf2a0, 0x4e4f, {0xa3, 0x69, 0xb6, 0x6f, 0xa8, 0xd5, 0x43, 0x85}} [PcdsFeatureFlag.common] gEfiMdePkgTokenSpaceGuid.PcdComponentNameDisable|FALSE|BOOLEAN|0x0000000d @@ -321,8 +327,8 @@ gEfiMdePkgTokenSpaceGuid.PcdUefiVariableDefaultTimeout|0x0008|UINT16|0x0000001b gEfiMdePkgTokenSpaceGuid.PcdUefiVariableDefaultLangCodes|"engfra"|VOID*|0x0000001c gEfiMdePkgTokenSpaceGuid.PcdUefiVariableDefaultLang|"eng"|VOID*|0x0000001d - gEfiMdePkgTokenSpaceGuid.PcdUefiVariableDefaultPlatformLangCodes|"en;fr"|VOID*|0x0000001e - gEfiMdePkgTokenSpaceGuid.PcdUefiVariableDefaultPlatformLang|"en"|VOID*|0x0000001f + gEfiMdePkgTokenSpaceGuid.PcdUefiVariableDefaultPlatformLangCodes|"en-US;fr-FR"|VOID*|0x0000001e + gEfiMdePkgTokenSpaceGuid.PcdUefiVariableDefaultPlatformLang|"en-US"|VOID*|0x0000001f gEfiMdePkgTokenSpaceGuid.PcdUartDefaultBaudRate|115200|UINT64|0x00000020 gEfiMdePkgTokenSpaceGuid.PcdUartDefaultDataBits|8|UINT8|0x00000021 gEfiMdePkgTokenSpaceGuid.PcdUartDefaultParity|1|UINT8|0x00000022 @@ -359,8 +365,8 @@ gEfiMdePkgTokenSpaceGuid.PcdUefiVariableDefaultTimeout|0x0008|UINT16|0x0000001b gEfiMdePkgTokenSpaceGuid.PcdUefiVariableDefaultLangCodes|"engfra"|VOID*|0x0000001c gEfiMdePkgTokenSpaceGuid.PcdUefiVariableDefaultLang|"eng"|VOID*|0x0000001d - gEfiMdePkgTokenSpaceGuid.PcdUefiVariableDefaultPlatformLangCodes|"en;fr"|VOID*|0x0000001e - gEfiMdePkgTokenSpaceGuid.PcdUefiVariableDefaultPlatformLang|"en"|VOID*|0x0000001f + gEfiMdePkgTokenSpaceGuid.PcdUefiVariableDefaultPlatformLangCodes|"en-US;fr-FR"|VOID*|0x0000001e + gEfiMdePkgTokenSpaceGuid.PcdUefiVariableDefaultPlatformLang|"en-US"|VOID*|0x0000001f gEfiMdePkgTokenSpaceGuid.PcdUartDefaultBaudRate|115200|UINT64|0x00000020 gEfiMdePkgTokenSpaceGuid.PcdUartDefaultDataBits|8|UINT8|0x00000021 gEfiMdePkgTokenSpaceGuid.PcdUartDefaultParity|1|UINT8|0x00000022 @@ -371,8 +377,8 @@ gEfiMdePkgTokenSpaceGuid.PcdUefiVariableDefaultTimeout|0x0008|UINT16|0x0000001b gEfiMdePkgTokenSpaceGuid.PcdUefiVariableDefaultLangCodes|"engfra"|VOID*|0x0000001c gEfiMdePkgTokenSpaceGuid.PcdUefiVariableDefaultLang|"eng"|VOID*|0x0000001d - gEfiMdePkgTokenSpaceGuid.PcdUefiVariableDefaultPlatformLangCodes|"en;fr"|VOID*|0x0000001e - gEfiMdePkgTokenSpaceGuid.PcdUefiVariableDefaultPlatformLang|"en"|VOID*|0x0000001f + gEfiMdePkgTokenSpaceGuid.PcdUefiVariableDefaultPlatformLangCodes|"en-US;fr-FR"|VOID*|0x0000001e + gEfiMdePkgTokenSpaceGuid.PcdUefiVariableDefaultPlatformLang|"en-US"|VOID*|0x0000001f gEfiMdePkgTokenSpaceGuid.PcdUartDefaultBaudRate|115200|UINT64|0x00000020 gEfiMdePkgTokenSpaceGuid.PcdUartDefaultDataBits|8|UINT8|0x00000021 gEfiMdePkgTokenSpaceGuid.PcdUartDefaultParity|1|UINT8|0x00000022 diff --git a/MdePkg/MdePkg.dsc b/MdePkg/MdePkg.dsc index e232efb7f9..1a6f16270a 100644 --- a/MdePkg/MdePkg.dsc +++ b/MdePkg/MdePkg.dsc @@ -23,7 +23,6 @@ BUILD_TARGETS = DEBUG|RELEASE SKUID_IDENTIFIER = DEFAULT - [PcdsFeatureFlag.common] gEfiMdePkgTokenSpaceGuid.PcdComponentNameDisable|FALSE gEfiMdePkgTokenSpaceGuid.PcdDriverDiagnosticsDisable|FALSE @@ -77,6 +76,7 @@ MdePkg/Library/DxePiLib/DxePiLib.inf MdePkg/Library/DxeServicesTableLib/DxeServicesTableLib.inf MdePkg/Library/DxeSmbusLib/DxeSmbusLib.inf + MdePkg/Library/HiiLib/HiiLib.inf MdePkg/Library/PeiCoreEntryPoint/PeiCoreEntryPoint.inf MdePkg/Library/PeiDxePostCodeLibReportStatusCode/PeiDxePostCodeLibReportStatusCode.inf MdePkg/Library/PeiMemoryAllocationLib/PeiMemoryAllocationLib.inf @@ -105,6 +105,7 @@ MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf MdePkg/Library/PeiExtractGuidedSectionLib/PeiExtractGuidedSectionLib.inf MdePkg/Library/DxeExtractGuidedSectionLib/DxeExtractGuidedSectionLib.inf + [Components.IA32] MdePkg/Library/BaseMemoryLibOptPei/BaseMemoryLibOptPei.inf -- 2.39.2