From 9226efe5ebb83ad0d5882e3eb7a54f3d63f81e9d Mon Sep 17 00:00:00 2001 From: qwang12 Date: Sat, 2 Feb 2008 13:15:44 +0000 Subject: 1) Cleanup HiiLib, IfrSupportLib. 2) Add ExtendedHiiLib and ExtendedIfrSupportLib which implement APIs that require the OPcode and Device Path which is specific to Intel's implementation. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@4662 6f19259b-4bc3-4df7-8a09-765794883524 --- MdeModulePkg/Include/Library/ExtendedHiiLib.h | 57 +++++++++ .../Include/Library/ExtendedIfrSupportLib.h | 127 +++++++++++++++++++++ MdeModulePkg/Include/MdeModuleHii.h | 6 - 3 files changed, 184 insertions(+), 6 deletions(-) create mode 100644 MdeModulePkg/Include/Library/ExtendedHiiLib.h create mode 100644 MdeModulePkg/Include/Library/ExtendedIfrSupportLib.h (limited to 'MdeModulePkg/Include') diff --git a/MdeModulePkg/Include/Library/ExtendedHiiLib.h b/MdeModulePkg/Include/Library/ExtendedHiiLib.h new file mode 100644 index 0000000000..7396aef489 --- /dev/null +++ b/MdeModulePkg/Include/Library/ExtendedHiiLib.h @@ -0,0 +1,57 @@ +/** @file + This library includes the APIs that is specific to EDK II's implementation. + It extended the UEFI Specification to define GUIDed device path. + + Copyright (c) 2008, 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 __EXTENDED_HII_LIB_H__ +#define __EXTENDED_HII_LIB_H__ + +/** + The HII driver handle passed in for HiiDatabase.NewPackageList() requires + that there should be DevicePath Protocol installed on it. + This routine create a virtual Driver Handle by installing a vendor device + path on it, so as to use it to invoke HiiDatabase.NewPackageList(). + The Device Path created is a Vendor Device Path specific to Intel's implemenation. + + @param DriverHandle Handle to be returned + + @retval EFI_SUCCESS Handle destroy success. + @retval EFI_OUT_OF_RESOURCES Not enough memory. + +**/ +EFI_STATUS +EFIAPI +HiiLibCreateHiiDriverHandle ( + OUT EFI_HANDLE *DriverHandle + ) +; + +/** + Destroy the Driver Handle created by CreateHiiDriverHandle(). + + If no Device Path protocol is installed on the DriverHandle, then ASSERT. + If this Device Path protocol is failed to be uninstalled, then ASSERT. + + @param DriverHandle Handle returned by CreateHiiDriverHandle() + + +**/ +VOID +EFIAPI +HiiLibDestroyHiiDriverHandle ( + IN EFI_HANDLE DriverHandle + ) +; + + +#endif diff --git a/MdeModulePkg/Include/Library/ExtendedIfrSupportLib.h b/MdeModulePkg/Include/Library/ExtendedIfrSupportLib.h new file mode 100644 index 0000000000..e0e6233f0b --- /dev/null +++ b/MdeModulePkg/Include/Library/ExtendedIfrSupportLib.h @@ -0,0 +1,127 @@ +/** @file + Library header file defines APIs that is related to IFR operations but + specific to EDK II implementation. + + 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 __EXTENDED_IFR_SUPPORT_LIB_H__ +#define __EXTENDED_IFR_SUPPORT_LIB_H__ + +/** + Create GUIDed opcode for banner. Banner opcode + EFI_IFR_EXTEND_OP_BANNER is extended opcode specific + to Intel's implementation. + + @param Title String ID for title + @param LineNumber Line number for this banner + @param Alignment Alignment for this banner, left, center or right + @param Data Destination for the created opcode binary + + @retval EFI_SUCCESS Opcode create success + @retval EFI_BUFFER_TOO_SMALL The space reserved in Data field is too small. + +**/ +EFI_STATUS +CreateBannerOpCode ( + IN EFI_STRING_ID Title, + IN UINT16 LineNumber, + IN UINT8 Alignment, + IN OUT EFI_HII_UPDATE_DATA *Data + ) +; + +/** + This function allows the caller to update a form that has + previously been registered with the EFI HII database. + The update make use of a extended opcode EFI_IFR_EXTEND_OP_LABEL + specific to Intel's implementation to complete the operation. + + + @param Handle Hii Handle + @param FormSetGuid The formset should be updated. + @param FormId The form should be updated. + @param Label Update information starting immediately after this + label in the IFR + @param Insert If TRUE and Data is not NULL, insert data after + Label. If FALSE, replace opcodes between two + labels with Data. + @param Data The adding data; If NULL, remove opcodes between + two Label. + + @retval EFI_SUCCESS Update success. + @retval Other Update fail. + +**/ +EFI_STATUS +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 + ) +; + +/** + Extract formset class for given HII handle. + + If Handle is not a valid EFI_HII_HANDLE in the default HII database, then + ASSERT. + + If Class is NULL, then ASSERT. + IfFormSetTitle is NULL, then ASSERT. + If FormSetHelp is NULL, then ASSERT. + + @param HiiHandle Hii handle + @param Class On output, Class of the formset + @param FormSetTitle On output, Formset title string + @param FormSetHelp On output, Formset help string + + @retval EFI_SUCCESS Successfully extract Class for specified Hii + handle. + +**/ +EFI_STATUS +IfrLibExtractClassFromHiiHandle ( + IN EFI_HII_HANDLE Handle, + OUT UINT16 *Class, + OUT EFI_STRING_ID *FormSetTitle, + OUT EFI_STRING_ID *FormSetHelp + ) +; + +/** + Configure the buffer accrording to ConfigBody strings in the format of + , , , . + + @param Buffer the start address of buffer. + @param BufferSize the size of buffer. + @param Number the number of the strings. + + @retval EFI_BUFFER_TOO_SMALL the BufferSize is too small to operate. + @retval EFI_INVALID_PARAMETER Buffer is NULL or BufferSize is 0. + @retval EFI_SUCCESS Operation successful. + +**/ +EFI_STATUS +EFIAPI +IfrLibExtractDefault( + IN VOID *Buffer, + IN UINTN *BufferSize, + UINTN Number, + ... + ) +; + +#endif + diff --git a/MdeModulePkg/Include/MdeModuleHii.h b/MdeModulePkg/Include/MdeModuleHii.h index 7f99ccd47b..7296f0dfe0 100644 --- a/MdeModulePkg/Include/MdeModuleHii.h +++ b/MdeModulePkg/Include/MdeModuleHii.h @@ -44,12 +44,6 @@ typedef struct { } HII_VENDOR_DEVICE_PATH; -// -// References to string tokens must use this macro to enable scanning for -// token usages. -// -#define STRING_TOKEN(t) t - // // GUIDed opcodes defined for Tiano // -- cgit v1.2.3