diff options
author | lgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524> | 2010-03-01 03:26:19 +0000 |
---|---|---|
committer | lgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524> | 2010-03-01 03:26:19 +0000 |
commit | 26a76fbcb2762826523bba325400e302bf346859 (patch) | |
tree | 52a63d084937f331c0553e2b17319d947596148e /EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk | |
parent | a111b843ea3cf9b48f3f06f73c6ed9b346ff16ba (diff) | |
download | edk2-platforms-26a76fbcb2762826523bba325400e302bf346859.tar.xz |
Update code to match EDKII coding style.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10130 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk')
23 files changed, 854 insertions, 391 deletions
diff --git a/EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk/ConfigAccess.c b/EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk/ConfigAccess.c index 4701a31457..c49ffe66c6 100644 --- a/EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk/ConfigAccess.c +++ b/EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk/ConfigAccess.c @@ -1,4 +1,4 @@ -/**@file
+/** @file
This file implements functions related to Config Access Protocols installed by
by HII Thunk Modules. These Config access Protocols are used to thunk UEFI Config
Access Callback to Framework HII Callback and EFI Variable Set/Get operations.
@@ -128,38 +128,6 @@ GetStorageFromQuestionId ( }
/**
- Get the EFI_IFR_VARSTORE based the ID.
-
- @param FormSet The Form Set.
-
- @retval FORMSET_STORAGE * The EFI_IFR_VARSTORE with the ID.
- @retval NULL If the Form Set does not have EFI_IFR_VARSTORE with such ID.
-**/
-FORMSET_STORAGE *
-GetStorageFromVarStoreId (
- IN CONST FORM_BROWSER_FORMSET * FormSet,
- IN EFI_VARSTORE_ID VarStoreId
- )
-{
- LIST_ENTRY *StorageList;
- FORMSET_STORAGE *Storage;
-
- StorageList = GetFirstNode (&FormSet->StorageListHead);
-
- while (!IsNull (&FormSet->StorageListHead, StorageList)) {
- Storage = FORMSET_STORAGE_FROM_LINK (StorageList);
-
- if (VarStoreId == Storage->VarStoreId) {
- return Storage;
- }
-
- StorageList = GetNextNode (&FormSet->StorageListHead, StorageList);
- }
-
- return NULL;
-}
-
-/**
Get the EFI_IFR_VARSTORE based the <ConfigHdr> string in a <ConfigRequest>
or a <ConfigResp> string.
@@ -377,7 +345,6 @@ CallFormCallBack ( @retval EFI_INVALID_PARAMETER If the UEFI Variable Get Service return the size information of the data
does not match what has been recorded early in he BUFFER_STORAGE_ENTRY.
**/
-
EFI_STATUS
GetUefiVariable (
IN FORMSET_STORAGE *BufferStorage,
@@ -651,7 +618,7 @@ Done: ASSERT if the Question Type is not EFI_IFR_TYPE_NUM_SIZE_* or EFI_IFR_TYPE_STRING.
- @param This Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL
+ @param ConfigAccess Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL
@param QuestionId The Question ID.
@param Type The Question Type.
@param Value The Question Value.
diff --git a/EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk/ConfigAccess.h b/EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk/ConfigAccess.h index c26f456620..27f17eb984 100644 --- a/EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk/ConfigAccess.h +++ b/EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk/ConfigAccess.h @@ -1,9 +1,9 @@ -/**@file
+/** @file
This file contains functions related to Config Access Protocols installed by
by HII Thunk Modules which is used to thunk UEFI Config Access Callback to
Framework HII Callback.
-Copyright (c) 2008, Intel Corporation
+Copyright (c) 2008 - 2010, 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
@@ -14,29 +14,38 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. **/
-#ifndef _HII_THUNK_CONFIG_ACCESS_H
-#define _HII_THUNK_CONFIG_ACCESS_H
+#ifndef _HII_THUNK_CONFIG_ACCESS_H_
+#define _HII_THUNK_CONFIG_ACCESS_H_
/**
This function installs a EFI_CONFIG_ACCESS_PROTOCOL instance for a form package registered
by a module using Framework HII Protocol Interfaces.
- UEFI HII require EFI_HII_CONFIG_ACCESS_PROTOCOL to be installed on a EFI_HANDLE, so
- that Setup Utility can load the Buffer Storage using this protocol.
+ UEFI HII require EFI_HII_CONFIG_ACCESS_PROTOCOL to be installed on a EFI_HANDLE, so
+ that Setup Utility can load the Buffer Storage using this protocol.
- @param Packages The framework package list.
- @param ThunkContext The Thunk Layer Handle Mapping Database Entry.
+ @param Packages The Package List.
+ @param ThunkContext The Thunk Context.
- @retval EFI_SUCCESS The Config Access Protocol is installed successfully.
- @retval EFI_OUT_RESOURCE There is not enough memory.
+ @retval EFI_SUCCESS The Config Access Protocol is installed successfully.
+ @retval EFI_OUT_RESOURCE There is not enough memory.
**/
EFI_STATUS
InstallDefaultConfigAccessProtocol (
- IN CONST EFI_HII_PACKAGES *Packages,
- IN OUT HII_THUNK_CONTEXT *ThunkContext
+ IN CONST EFI_HII_PACKAGES *Packages,
+ IN OUT HII_THUNK_CONTEXT *ThunkContext
);
+/**
+ This function un-installs the EFI_CONFIG_ACCESS_PROTOCOL instance for a form package registered
+ by a module using Framework HII Protocol Interfaces.
+
+ ASSERT if no Config Access is found for such pakcage list or failed to uninstall the protocol.
+
+ @param ThunkContext The Thunk Context.
+
+**/
VOID
UninstallDefaultConfigAccessProtocol (
IN HII_THUNK_CONTEXT *ThunkContext
@@ -76,21 +85,20 @@ ThunkExtractConfig ( /**
-
This function implement the EFI_HII_CONFIG_ACCESS_PROTOCOL.RouteConfig
so that data can be written to the data storage such as UEFI Variable or module's
customized storage exposed by EFI_FRAMEWORK_CALLBACK.
- @param This Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL
- @param Configuration A null-terminated Unicode string in <ConfigResp> format.
- @param Progress A pointer to a string filled in with the offset of the most recent '&' before the first
- failing name / value pair (or the beginning of the string if the failure is in the first
- name / value pair) or the terminating NULL if all was successful.
+ @param This Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL
+ @param Configuration A null-terminated Unicode string in <ConfigResp> format.
+ @param Progress A pointer to a string filled in with the offset of the most recent '&' before the first
+ failing name / value pair (or the beginning of the string if the failure is in the first
+ name / value pair) or the terminating NULL if all was successful.
@retval EFI_INVALID_PARAMETER If there is no Buffer Storage for this Config Access instance.
@retval EFI_SUCCESS The setting is saved successfully.
@retval !EFI_SUCCESS The error returned by UEFI Set Variable or Framework Form Callback Nvwrite.
-**/
+**/
EFI_STATUS
EFIAPI
ThunkRouteConfig (
@@ -101,27 +109,26 @@ ThunkRouteConfig ( /**
Wrap the EFI_HII_CONFIG_ACCESS_PROTOCOL.CallBack to EFI_FORM_CALLBACK_PROTOCOL.Callback. Therefor,
- the framework HII module willl do no porting (except some porting works needed for callback for EFI_ONE_OF_OPTION opcode)
- and still work with a UEFI HII SetupBrowser.
+ the framework HII module willl do no porting and work with a UEFI HII SetupBrowser.
- @param This Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.
- @param Action Specifies the type of action taken by the browser. See EFI_BROWSER_ACTION_x.
- @param QuestionId A unique value which is sent to the original exporting driver so that it can identify the
- type of data to expect. The format of the data tends to vary based on the opcode that
- generated the callback.
- @param Type The type of value for the question. See EFI_IFR_TYPE_x in
- EFI_IFR_ONE_OF_OPTION.
- @param Value A pointer to the data being sent to the original exporting driver. The type is specified
- by Type. Type EFI_IFR_TYPE_VALUE is defined in
- EFI_IFR_ONE_OF_OPTION.
- @param ActionRequest On return, points to the action requested by the callback function. Type
- EFI_BROWSER_ACTION_REQUEST is specified in SendForm() in the Form
- Browser Protocol.
+ @param This Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.
+ @param Action Specifies the type of action taken by the browser. See EFI_BROWSER_ACTION_x.
+ @param QuestionId A unique value which is sent to the original exporting driver so that it can identify the
+ type of data to expect. The format of the data tends to vary based on the opcode that
+ generated the callback.
+ @param Type The type of value for the question. See EFI_IFR_TYPE_x in
+ EFI_IFR_ONE_OF_OPTION.
+ @param Value A pointer to the data being sent to the original exporting driver. The type is specified
+ by Type. Type EFI_IFR_TYPE_VALUE is defined in
+ EFI_IFR_ONE_OF_OPTION.
+ @param ActionRequest On return, points to the action requested by the callback function. Type
+ EFI_BROWSER_ACTION_REQUEST is specified in SendForm() in the Form
+ Browser Protocol.
- @retval EFI_UNSUPPORTED If the Framework HII module does not register Callback although it specify the opcode under
- focuse to be INTERRACTIVE.
- @retval EFI_SUCCESS The callback complete successfully.
- @retval !EFI_SUCCESS The error code returned by EFI_FORM_CALLBACK_PROTOCOL.Callback.
+ @retval EFI_UNSUPPORTED If the Framework HII module does not register Callback although it specify the opcode under
+ focuse to be INTERRACTIVE.
+ @retval EFI_SUCCESS The callback complete successfully.
+ @retval !EFI_SUCCESS The error code returned by EFI_FORM_CALLBACK_PROTOCOL.Callback.
**/
EFI_STATUS
diff --git a/EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk/Fonts.c b/EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk/Fonts.c index 27b5d95fbd..808b1e9705 100644 --- a/EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk/Fonts.c +++ b/EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk/Fonts.c @@ -1,7 +1,7 @@ -/**@file
+/** @file
This file contains the Glyph related function.
-Copyright (c) 2006 - 2008, Intel Corporation
+Copyright (c) 2006 - 2010, 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
@@ -167,18 +167,18 @@ HiiGlyphToBlt ( IN OUT EFI_GRAPHICS_OUTPUT_BLT_PIXEL *BltBuffer
)
{
- UINTN X;
- UINTN Y;
+ UINTN Xpos;
+ UINTN Ypos;
//
// Convert Monochrome bitmap of the Glyph to BltBuffer structure
//
- for (Y = 0; Y < Height; Y++) {
- for (X = 0; X < Width; X++) {
- if ((((EFI_NARROW_GLYPH *) GlyphBuffer)->GlyphCol1[Y] & (1 << X)) != 0) {
- BltBuffer[Y * Width * Count + (Width - X - 1)] = Foreground;
+ for (Ypos = 0; Ypos < Height; Ypos++) {
+ for (Xpos = 0; Xpos < Width; Xpos++) {
+ if ((((EFI_NARROW_GLYPH *) GlyphBuffer)->GlyphCol1[Ypos] & (1 << Xpos)) != 0) {
+ BltBuffer[Ypos * Width * Count + (Width - Xpos - 1)] = Foreground;
} else {
- BltBuffer[Y * Width * Count + (Width - X - 1)] = Background;
+ BltBuffer[Ypos * Width * Count + (Width - Xpos - 1)] = Background;
}
}
}
diff --git a/EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk/Forms.c b/EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk/Forms.c index 3ee4dd4f76..bf05852647 100644 --- a/EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk/Forms.c +++ b/EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk/Forms.c @@ -1,7 +1,7 @@ -/**@file
+/** @file
This file contains the form processing code to the HII database.
-Copyright (c) 2006 - 2008 Intel Corporation. <BR>
+Copyright (c) 2006 - 2010, Intel Corporation. <BR>
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
@@ -289,7 +289,7 @@ GetPackageData ( EFI_HII_PACKAGE_HEADER *Package;
UINT32 Offset;
UINT32 PackageListLength;
- EFI_HII_PACKAGE_HEADER PackageHeader = {0, 0};
+ EFI_HII_PACKAGE_HEADER PackageHeader;
ASSERT(HiiPackageList != NULL);
@@ -297,6 +297,7 @@ GetPackageData ( return EFI_INVALID_PARAMETER;
}
+ ZeroMem (&PackageHeader, sizeof (PackageHeader));
Package = NULL;
Index = 0;
Offset = sizeof (EFI_HII_PACKAGE_LIST_HEADER);
@@ -407,13 +408,15 @@ LocateLabel ( with value as the same as the input Label in the Formset registered with UefiHiiHandle. The FormSet GUID
and Form ID is returned if such Label is found.
+ @param Handle Uefi Hii Handle to be searched.
+ @param Label The first Label ID to be found.
+ @param FormsetGuid The matched FormSet GUID.
+ @param FormId The matched Form ID.
@retval EFI_INVALID_PARAMETER If UefiHiiHandle is not a valid handle.
- @retval EFI_NOT_FOUND The package list identified by UefiHiiHandle deos not contain FormSet or
- There is no Form ID with value Label found in all Form Sets in the pacakge
- list.
-
- @retval EFI_SUCCESS The first found Form ID is returned in FormId.
+ @retval EFI_NOT_FOUND The package list identified by UefiHiiHandle deos not contain FormSet or
+ Form ID with value Label found in all Form Sets in the pacakge list.
+ @retval EFI_SUCCESS The first found Form ID is returned in FormId.
**/
EFI_STATUS
LocateFormId (
diff --git a/EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk/FrameworkHiiOnUefiHiiThunk.inf b/EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk/FrameworkHiiOnUefiHiiThunk.inf index 7113d6f154..3b3a54a104 100644 --- a/EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk/FrameworkHiiOnUefiHiiThunk.inf +++ b/EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk/FrameworkHiiOnUefiHiiThunk.inf @@ -36,6 +36,7 @@ [Sources]
SetupBrowser.c
+ SetupBrowser.h
HiiHandle.c
HiiHandle.h
ConfigAccess.c
diff --git a/EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk/HiiDatabase.c b/EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk/HiiDatabase.c index 48f2ff29bd..6f547fa2c3 100644 --- a/EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk/HiiDatabase.c +++ b/EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk/HiiDatabase.c @@ -1,8 +1,8 @@ -/**@file
+/** @file
Framework to UEFI 2.1 HII Thunk. The driver consume UEFI HII protocols
to produce a Framework HII protocol.
-Copyright (c) 2008, Intel Corporation
+Copyright (c) 2008 - 2010, 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
@@ -318,9 +318,9 @@ HiiFindHandles ( registered on the handle. The routine will not return the three-spaces language identifier used in
other functions to indicate non-language-specific strings.
- @reval EFI_SUCCESS LanguageString was correctly returned.
+ @retval EFI_SUCCESS LanguageString was correctly returned.
- @reval EFI_INVALID_PARAMETER The Handle was unknown.
+ @retval EFI_INVALID_PARAMETER The Handle was unknown.
**/
EFI_STATUS
EFIAPI
@@ -451,8 +451,8 @@ HiiGetSupportedSecondaryLanguages ( but returns a NULL LanguageString if there are no secondary languages associated with the input Handle and
PrimaryLanguage pair. Type EFI_STRING is defined in String.
- @reval EFI_SUCCESS LanguageString was correctly returned.
- @reval EFI_INVALID_PARAMETER The Handle was unknown.
+ @retval EFI_SUCCESS LanguageString was correctly returned.
+ @retval EFI_INVALID_PARAMETER The Handle was unknown.
**/
EFI_STATUS
EFIAPI
diff --git a/EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk/HiiDatabase.h b/EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk/HiiDatabase.h index 7a905c0dd3..7d78029808 100644 --- a/EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk/HiiDatabase.h +++ b/EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk/HiiDatabase.h @@ -1,9 +1,9 @@ -/**@file
+/** @file
This file contains global defines and prototype definitions
for the Framework HII to Uefi HII Thunk Module.
-Copyright (c) 2006 - 2008, Intel Corporation
+Copyright (c) 2006 - 2010, 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
@@ -14,8 +14,8 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. **/
-#ifndef _HIIDATABASE_H
-#define _HIIDATABASE_H
+#ifndef _HIIDATABASE_H_
+#define _HIIDATABASE_H_
#include <FrameworkDxe.h>
@@ -239,14 +239,37 @@ extern HII_THUNK_PRIVATE_DATA *mHiiThunkPrivateData; extern BOOLEAN mInFrameworkUpdatePakcage;
+/**
+
+ Registers the various packages that are passed in a Package List.
+
+ @param This Pointer of Frameowk HII protocol instance.
+ @param Packages Pointer of HII packages.
+ @param Handle Handle value to be returned.
+
+ @retval EFI_SUCCESS Pacakges has added to HII database successfully.
+ @retval EFI_INVALID_PARAMETER If Handle or Packages is NULL.
+
+**/
EFI_STATUS
EFIAPI
HiiNewPack (
- IN EFI_HII_PROTOCOL *This,
- IN EFI_HII_PACKAGES *PackageList,
- OUT FRAMEWORK_EFI_HII_HANDLE *Handle
+ IN EFI_HII_PROTOCOL *This,
+ IN EFI_HII_PACKAGES *Packages,
+ OUT FRAMEWORK_EFI_HII_HANDLE *Handle
);
+/**
+
+ Remove a package from the HII database.
+
+ @param This Pointer of Frameowk HII protocol instance.
+ @param Handle Handle value to be removed.
+
+ @retval EFI_SUCCESS Pacakges has added to HII database successfully.
+ @retval EFI_INVALID_PARAMETER If Handle or Packages is NULL.
+
+**/
EFI_STATUS
EFIAPI
HiiRemovePack (
@@ -254,34 +277,119 @@ HiiRemovePack ( IN FRAMEWORK_EFI_HII_HANDLE Handle
);
+/**
+ Determines the handles that are currently active in the database.
+
+ This function determines the handles that are currently active in the database.
+ For example, a program wishing to create a Setup-like configuration utility would use this call
+ to determine the handles that are available. It would then use calls defined in the forms section
+ below to extract forms and then interpret them.
+
+ @param This A pointer to the EFI_HII_PROTOCOL instance.
+ @param 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.
+ @param Handle Pointer to an array of EFI_HII_HANDLE instances returned.
+ Type EFI_HII_HANDLE is defined in EFI_HII_PROTOCOL.NewPack() in the Packages section.
+
+ @retval EFI_SUCCESS Handle was updated successfully.
+
+ @retval EFI_BUFFER_TOO_SMALL The HandleBufferLength parameter indicates that Handle is too small
+ to support the number of handles. HandleBufferLength is updated with a value that
+ will enable the data to fit.
+**/
EFI_STATUS
EFIAPI
HiiFindHandles (
- IN EFI_HII_PROTOCOL *This,
- IN OUT UINT16 *HandleBufferLength,
- OUT FRAMEWORK_EFI_HII_HANDLE *Handle
+ IN EFI_HII_PROTOCOL *This,
+ IN OUT UINT16 *HandleBufferLength,
+ OUT FRAMEWORK_EFI_HII_HANDLE *Handle
);
+/**
+
+ This thunk module only handles UEFI HII packages. The caller of this function
+ won't be able to parse the content. Therefore, it is not supported.
+
+ This function will ASSERT and return EFI_UNSUPPORTED.
+
+ @param This N.A.
+ @param Handle N.A.
+ @param BufferSize N.A.
+ @param Buffer N.A.
+
+ @retval EFI_UNSUPPORTED
+
+**/
EFI_STATUS
EFIAPI
HiiExportDatabase (
- IN EFI_HII_PROTOCOL *This,
- IN FRAMEWORK_EFI_HII_HANDLE Handle,
- IN OUT UINTN *BufferSize,
- OUT VOID *Buffer
+ IN EFI_HII_PROTOCOL *This,
+ IN FRAMEWORK_EFI_HII_HANDLE Handle,
+ IN OUT UINTN *BufferSize,
+ OUT VOID *Buffer
);
+/**
+ Translates a Unicode character into the corresponding font glyph.
+
+ Notes:
+ This function is only called by Graphics Console module and GraphicsLib.
+ Wrap the Framework HII GetGlyph function to UEFI Font Protocol.
+
+ EDK II provides a UEFI Graphics Console module. ECP provides a GraphicsLib
+ complying to UEFI HII.
+
+ @param This A pointer to the EFI_HII_PROTOCOL instance.
+ @param Source A pointer to a Unicode string.
+ @param Index On input, the offset into the string from which to fetch the character. On successful completion, the
+ index is updated to the first character past the character(s) making up the just extracted glyph.
+ @param GlyphBuffer Pointer to an array where the glyphs corresponding to the characters in the source may be stored.
+ GlyphBuffer is assumed to be wide enough to accept a wide glyph character.
+ @param BitWidth If EFI_SUCCESS was returned, the UINT16 pointed to by this value is filled with the length of the glyph in pixels.
+ It is unchanged if the call was unsuccessful.
+ @param InternalStatus To save the time required to read the string from the beginning on each glyph extraction
+ (for example, to ensure that the narrow versus wide glyph mode is correct), this value is
+ updated each time the function is called with the status that is local to the call. The cell pointed
+ to by this parameter must be initialized to zero prior to invoking the call the first time for any string.
+
+ @retval EFI_SUCCESS It worked.
+ @retval EFI_NOT_FOUND A glyph for a character was not found.
+
+
+**/
EFI_STATUS
EFIAPI
HiiGetGlyph (
- IN EFI_HII_PROTOCOL *This,
- IN CHAR16 *Source,
- IN OUT UINT16 *Index,
- OUT UINT8 **GlyphBuffer,
- OUT UINT16 *BitWidth,
- IN OUT UINT32 *InternalStatus
+ IN EFI_HII_PROTOCOL *This,
+ IN CHAR16 *Source,
+ IN OUT UINT16 *Index,
+ OUT UINT8 **GlyphBuffer,
+ OUT UINT16 *BitWidth,
+ IN OUT UINT32 *InternalStatus
);
+/**
+ Translates a glyph into the format required for input to the Universal Graphics Adapter (UGA) Block Transfer (BLT) routines.
+
+ Notes:
+ This function is only called by Graphics Console module and GraphicsLib.
+ EDK II provides a UEFI Graphics Console module. ECP provides a GraphicsLib
+ complying to UEFI HII.
+
+ @param This A pointer to the EFI_HII_PROTOCOL instance.
+ @param GlyphBuffer A pointer to the buffer that contains glyph data.
+ @param Foreground The foreground setting requested to be used for the generated BltBuffer data. Type EFI_UGA_PIXEL is defined in "Related Definitions" below.
+ @param Background The background setting requested to be used for the generated BltBuffer data.
+ @param Count The entry in the BltBuffer upon which to act.
+ @param Width The width in bits of the glyph being converted.
+ @param Height The height in bits of the glyph being converted
+ @param BltBuffer A pointer to the buffer that contains the data that is ready to be used by the UGA BLT routines.
+
+ @retval EFI_SUCCESS It worked.
+ @retval EFI_NOT_FOUND A glyph for a character was not found.
+
+
+**/
EFI_STATUS
EFIAPI
HiiGlyphToBlt (
@@ -295,16 +403,56 @@ HiiGlyphToBlt ( IN OUT EFI_GRAPHICS_OUTPUT_BLT_PIXEL *BltBuffer
);
+/**
+ Create or update a String Token in a String Package.
+
+ If *Reference == 0, a new String Token is created.
+
+ @param This A pointer to the EFI_HII_PROTOCOL instance.
+ @param Language Pointer to a NULL-terminated string containing a single ISO 639-2 language
+ identifier, indicating the language to print. A string consisting of
+ all spaces indicates that the string is applicable to all languages.
+ @param Handle The handle of the language pack to which the string is to be added.
+ @param Reference The string token assigned to the string.
+ @param NewString The string to be added.
+
+
+ @retval EFI_SUCCESS The string was effectively registered.
+ @retval EFI_INVALID_PARAMETER The Handle was unknown. The string is not created or updated in the
+ the string package.
+**/
EFI_STATUS
EFIAPI
HiiNewString (
- IN EFI_HII_PROTOCOL *This,
- IN CHAR16 *Language,
- IN FRAMEWORK_EFI_HII_HANDLE Handle,
- IN OUT STRING_REF *Reference,
- IN CHAR16 *NewString
+ IN EFI_HII_PROTOCOL *This,
+ IN CHAR16 *Language,
+ IN FRAMEWORK_EFI_HII_HANDLE Handle,
+ IN OUT STRING_REF *Reference,
+ IN CHAR16 *NewString
);
+/**
+ This function extracts a string from a package already registered with the EFI HII database.
+
+ @param This A pointer to the EFI_HII_PROTOCOL instance.
+ @param Handle The HII handle on which the string resides.
+ @param Token The string token assigned to the string.
+ @param Raw If TRUE, the string is returned unedited in the internal storage format described
+ above. If false, the string returned is edited by replacing <cr> with <space>
+ and by removing special characters such as the <wide> prefix.
+ @param LanguageString Pointer to a NULL-terminated string containing a single ISO 639-2 language
+ identifier, indicating the language to print. If the LanguageString is empty (starts
+ with a NULL), the default system language will be used to determine the language.
+ @param BufferLength Length of the StringBuffer. If the status reports that the buffer width is too
+ small, this parameter is filled with the length of the buffer needed.
+ @param StringBuffer The buffer designed to receive the characters in the string. Type EFI_STRING is
+ defined in String.
+
+ @retval EFI_INVALID_PARAMETER If input parameter is invalid.
+ @retval EFI_BUFFER_TOO_SMALL If the *BufferLength is too small.
+ @retval EFI_SUCCESS Operation is successful.
+
+**/
EFI_STATUS
EFIAPI
HiiThunkGetString (
@@ -317,103 +465,312 @@ HiiThunkGetString ( OUT EFI_STRING StringBuffer
);
+/**
+ This function removes any new strings that were added after the initial string export for this handle.
+ UEFI HII String Protocol does not have Reset String function. This function perform nothing.
+
+ @param This A pointer to the EFI_HII_PROTOCOL instance.
+ @param Handle The HII handle on which the string resides.
+
+ @retval EFI_SUCCESS This function is a NOP and always return EFI_SUCCESS.
+
+**/
EFI_STATUS
EFIAPI
HiiResetStrings (
- IN EFI_HII_PROTOCOL *This,
- IN FRAMEWORK_EFI_HII_HANDLE Handle
+ IN EFI_HII_PROTOCOL *This,
+ IN FRAMEWORK_EFI_HII_HANDLE Handle
);
+/**
+ Test if all of the characters in a string have corresponding font characters.
+
+ This is a deprecated API. No Framework HII module is calling it. This function will ASSERT and
+ return EFI_UNSUPPORTED.
+
+ @param This A pointer to the EFI_HII_PROTOCOL instance.
+ @param StringToTest A pointer to a Unicode string.
+ @param FirstMissing A pointer to an index into the string. On input, the index of
+ the first character in the StringToTest to examine. On exit, the index
+ of the first character encountered for which a glyph is unavailable.
+ If all glyphs in the string are available, the index is the index of the terminator
+ of the string.
+ @param GlyphBufferSize A pointer to a value. On output, if the function returns EFI_SUCCESS,
+ it contains the amount of memory that is required to store the string? glyph equivalent.
+
+ @retval EFI_UNSUPPORTED The function performs nothing and return EFI_UNSUPPORTED.
+**/
EFI_STATUS
EFIAPI
HiiTestString (
- IN EFI_HII_PROTOCOL *This,
- IN CHAR16 *StringToTest,
- IN OUT UINT32 *FirstMissing,
- OUT UINT32 *GlyphBufferSize
+ IN EFI_HII_PROTOCOL *This,
+ IN CHAR16 *StringToTest,
+ IN OUT UINT32 *FirstMissing,
+ OUT UINT32 *GlyphBufferSize
);
+/**
+ Allows a program to determine the primary languages that are supported on a given handle.
+
+ This routine is intended to be used by drivers to query the interface database for supported languages.
+ This routine returns a string of concatenated 3-byte language identifiers, one per string package associated with the handle.
+
+ @param This A pointer to the EFI_HII_PROTOCOL instance.
+ @param Handle The handle on which the strings reside. Type EFI_HII_HANDLE is defined in EFI_HII_PROTOCOL.NewPack()
+ in the Packages section.
+ @param LanguageString A string allocated by GetPrimaryLanguages() that contains a list of all primary languages
+ registered on the handle. The routine will not return the three-spaces language identifier used in
+ other functions to indicate non-language-specific strings.
+
+ @retval EFI_SUCCESS LanguageString was correctly returned.
+
+ @retval EFI_INVALID_PARAMETER The Handle was unknown.
+**/
EFI_STATUS
EFIAPI
HiiGetPrimaryLanguages (
- IN EFI_HII_PROTOCOL *This,
- IN FRAMEWORK_EFI_HII_HANDLE Handle,
- OUT EFI_STRING *LanguageString
+ IN EFI_HII_PROTOCOL *This,
+ IN FRAMEWORK_EFI_HII_HANDLE Handle,
+ OUT EFI_STRING *LanguageString
);
+/**
+ Allows a program to determine which secondary languages are supported on a given handle for a given primary language
+
+ This routine is intended to be used by drivers to query the interface database for supported languages.
+ This routine returns a string of concatenated 3-byte language identifiers, one per string package associated with the handle.
+
+ @param This A pointer to the EFI_HII_PROTOCOL instance.
+ @param Handle The handle on which the strings reside. Type EFI_HII_HANDLE is defined in EFI_HII_PROTOCOL.NewPack()
+ in the Packages section.
+ @param PrimaryLanguage Pointer to a NULL-terminated string containing a single ISO 639-2 language identifier, indicating
+ the primary language.
+ @param LanguageString A string allocated by GetSecondaryLanguages() containing a list of all secondary languages registered
+ on the handle. The routine will not return the three-spaces language identifier used in other functions
+ to indicate non-language-specific strings, nor will it return the primary language. This function succeeds
+ but returns a NULL LanguageString if there are no secondary languages associated with the input Handle and
+ PrimaryLanguage pair. Type EFI_STRING is defined in String.
+
+ @retval EFI_SUCCESS LanguageString was correctly returned.
+ @retval EFI_INVALID_PARAMETER The Handle was unknown.
+**/
EFI_STATUS
EFIAPI
HiiGetSecondaryLanguages (
- IN EFI_HII_PROTOCOL *This,
- IN FRAMEWORK_EFI_HII_HANDLE Handle,
- IN CHAR16 *PrimaryLanguage,
- OUT EFI_STRING *LanguageString
+ IN EFI_HII_PROTOCOL *This,
+ IN FRAMEWORK_EFI_HII_HANDLE Handle,
+ IN CHAR16 *PrimaryLanguage,
+ OUT EFI_STRING *LanguageString
);
+/**
+
+ This function allows a program to extract a part of a string of not more than a given width.
+ With repeated calls, this allows a calling program to extract "lines" of text that fit inside
+ columns. The effort of measuring the fit of strings inside columns is localized to this call.
+
+ This is a deprecated API. No Framework HII module is calling it. This function will ASSERT and
+ return EFI_UNSUPPORTED.
+
+ @param This A pointer to the EFI_HII_PROTOCOL instance.
+ @param Handle The HII handle on which the string resides.
+ @param Token The string token assigned to the string.
+ @param Index On input, the offset into the string where the line is to start.
+ On output, the index is updated to point to beyond the last character returned
+ in the call.
+ @param LineWidth The maximum width of the line in units of narrow glyphs.
+ @param LanguageString Pointer to a NULL-terminated string containing a single ISO 639-2 language
+ identifier, indicating the language to print. If the LanguageString is empty (starts
+ with a NULL), the default system language will be used to determine the language.
+ @param BufferLength Length of the StringBuffer. If the status reports that the buffer width is too
+ small, this parameter is filled with the length of the buffer needed.
+ @param StringBuffer The buffer designed to receive the characters in the string. Type EFI_STRING is
+ defined in String.
+
+ @retval EFI_UNSUPPORTED.
+**/
EFI_STATUS
EFIAPI
HiiGetLine (
- IN EFI_HII_PROTOCOL *This,
- IN FRAMEWORK_EFI_HII_HANDLE Handle,
- IN STRING_REF Token,
- IN OUT UINT16 *Index,
- IN UINT16 LineWidth,
- IN CHAR16 *LanguageString,
- IN OUT UINT16 *BufferLength,
- OUT EFI_STRING StringBuffer
+ IN EFI_HII_PROTOCOL *This,
+ IN FRAMEWORK_EFI_HII_HANDLE Handle,
+ IN STRING_REF Token,
+ IN OUT UINT16 *Index,
+ IN UINT16 LineWidth,
+ IN CHAR16 *LanguageString,
+ IN OUT UINT16 *BufferLength,
+ OUT EFI_STRING StringBuffer
);
+/**
+ This function allows a program to extract a form or form package that has
+ previously been registered with the EFI HII database.
+
+ In this thunk module, this function will create a IFR Package with only
+ one Formset. Effectively, only the GUID of the Formset is updated and return
+ in this IFR package to caller. This is enable the Framework modules which call
+ a API named GetStringFromToken. GetStringFromToken retieves a String based on
+ a String Token from a Package List known only by the Formset GUID.
+
+
+
+ @param This A pointer to the EFI_HII_PROTOCOL instance.
+ @param Handle Handle on which the form resides. Type FRAMEWORK_EFI_HII_HANDLE is defined in
+ EFI_HII_PROTOCOL.NewPack() in the Packages section.
+ @param FormId Ignored by this implementation.
+ @param BufferLengthTemp On input, the size of input buffer. On output, it
+ is the size of FW_HII_FORMSET_TEMPLATE.
+ @param Buffer The buffer designed to receive the form(s).
+
+ @retval EFI_SUCCESS Buffer filled with the requested forms. BufferLength
+ was updated.
+ @retval EFI_INVALID_PARAMETER The handle is unknown.
+ @retval EFI_NOT_FOUND A form on the requested handle cannot be found with the
+ requested FormId.
+ @retval EFI_BUFFER_TOO_SMALL The buffer provided was not large enough to allow the form to be stored.
+
+**/
EFI_STATUS
EFIAPI
HiiGetForms (
- IN EFI_HII_PROTOCOL *This,
- IN FRAMEWORK_EFI_HII_HANDLE Handle,
- IN EFI_FORM_ID FormId,
- IN OUT UINTN *BufferLength,
- OUT UINT8 *Buffer
+ IN EFI_HII_PROTOCOL *This,
+ IN FRAMEWORK_EFI_HII_HANDLE Handle,
+ IN EFI_FORM_ID FormId,
+ IN OUT UINTN *BufferLengthTemp,
+ OUT UINT8 *Buffer
);
+/**
+
+ This function allows a program to extract the NV Image
+ that represents the default storage image
+
+
+ @param This A pointer to the EFI_HII_PROTOCOL instance.
+ @param Handle The HII handle from which will have default data retrieved.
+ UINTN - Mask used to retrieve the default image.
+ @param DefaultMask EDES_TODO: Add parameter description
+ @param VariablePackList Callee allocated, tightly-packed, link list data
+ structure that contain all default varaible packs
+ from the Hii Database.
+
+ @retval EFI_NOT_FOUND If Hii database does not contain any default images.
+ @retval EFI_INVALID_PARAMETER Invalid input parameter.
+ @retval EFI_SUCCESS Operation successful.
+
+**/
EFI_STATUS
EFIAPI
HiiGetDefaultImage (
- IN EFI_HII_PROTOCOL *This,
- IN FRAMEWORK_EFI_HII_HANDLE Handle,
- IN UINTN DefaultMask,
- OUT EFI_HII_VARIABLE_PACK_LIST **VariablePackList
+ IN EFI_HII_PROTOCOL *This,
+ IN FRAMEWORK_EFI_HII_HANDLE Handle,
+ IN UINTN DefaultMask,
+ OUT EFI_HII_VARIABLE_PACK_LIST **VariablePackList
);
+/**
+ This function allows the caller to update a form that has
+ previously been registered with the EFI HII database.
+
+
+ @param This EDES_TODO: Add parameter description
+ @param Handle Hii Handle associated with the Formset to modify
+ @param Label Update information starting immediately after this label in the IFR
+ @param AddData If TRUE, add data. If FALSE, remove data
+ @param Data If adding data, this is the pointer to the data to add
+
+ @retval EFI_SUCCESS Update success.
+ @retval Other Update fail.
+
+**/
EFI_STATUS
EFIAPI
HiiThunkUpdateForm (
- IN EFI_HII_PROTOCOL *This,
- IN FRAMEWORK_EFI_HII_HANDLE Handle,
- IN EFI_FORM_LABEL Label,
- IN BOOLEAN AddData,
- IN EFI_HII_UPDATE_DATA *Data
+ IN EFI_HII_PROTOCOL *This,
+ IN FRAMEWORK_EFI_HII_HANDLE Handle,
+ IN EFI_FORM_LABEL Label,
+ IN BOOLEAN AddData,
+ IN EFI_HII_UPDATE_DATA *Data
);
+/**
+ Retrieves the current keyboard layout.
+ This function is not implemented by HII Thunk Module.
+
+ @param This A pointer to the EFI_HII_PROTOCOL instance.
+ @param DescriptorCount A pointer to the number of Descriptor entries being described in the keyboard layout being retrieved.
+ @param Descriptor A pointer to a buffer containing an array of EFI_KEY_DESCRIPTOR entries. Each entry will reflect the
+ definition of a specific physical key. Type EFI_KEY_DESCRIPTOR is defined in "Related Definitions" below.
+
+ @retval EFI_SUCCESS The keyboard layout was retrieved successfully.
+
+**/
EFI_STATUS
EFIAPI
HiiGetKeyboardLayout (
- IN EFI_HII_PROTOCOL *This,
- OUT UINT16 *DescriptorCount,
- OUT FRAMEWORK_EFI_KEY_DESCRIPTOR *Descriptor
+ IN EFI_HII_PROTOCOL *This,
+ OUT UINT16 *DescriptorCount,
+ OUT FRAMEWORK_EFI_KEY_DESCRIPTOR *Descriptor
);
+/**
+ This is the Framework Setup Browser interface which displays a FormSet.
+
+ @param This The EFI_FORM_BROWSER_PROTOCOL context.
+ @param UseDatabase TRUE if the FormSet is from HII database. The Thunk implementation
+ only support UseDatabase is TRUE.
+ @param Handle The Handle buffer.
+ @param HandleCount The number of Handle in the Handle Buffer. It must be 1 for this implementation.
+ @param Packet The pointer to data buffer containing IFR and String package. Not supported.
+ @param CallbackHandle Not supported.
+ @param NvMapOverride The buffer is used only when there is no NV variable to define the
+ current settings and the caller needs to provide to the browser the
+ current settings for the the "fake" NV variable. If used, no saving of
+ an NV variable is possbile. This parameter is also ignored if Handle is NULL.
+ @param ScreenDimensions
+ Allows the browser to be called so that it occupies a portion of the physical
+ screen instead of dynamically determining the screen dimensions.
+ @param ResetRequired This BOOLEAN value denotes whether a reset is required based on the data that
+ might have been changed. The ResetRequired parameter is primarily applicable
+ for configuration applications, and is an optional parameter.
+
+ @retval EFI_SUCCESS If the Formset is displayed correctly.
+ @retval EFI_UNSUPPORTED If UseDatabase is FALSE or HandleCount is not 1.
+ @retval EFI_INVALID_PARAMETER If the *Handle passed in is not found in the database.
+**/
EFI_STATUS
EFIAPI
ThunkSendForm (
- IN EFI_FORM_BROWSER_PROTOCOL *This,
- IN BOOLEAN UseDatabase,
- IN FRAMEWORK_EFI_HII_HANDLE *Handle,
- IN UINTN HandleCount,
- IN EFI_IFR_PACKET *Packet, OPTIONAL
- IN EFI_HANDLE CallbackHandle, OPTIONAL
- IN UINT8 *NvMapOverride, OPTIONAL
- IN FRAMEWORK_EFI_SCREEN_DESCRIPTOR *ScreenDimensions, OPTIONAL
- OUT BOOLEAN *ResetRequired OPTIONAL
+ IN EFI_FORM_BROWSER_PROTOCOL *This,
+ IN BOOLEAN UseDatabase,
+ IN FRAMEWORK_EFI_HII_HANDLE *Handle,
+ IN UINTN HandleCount,
+ IN EFI_IFR_PACKET *Packet, OPTIONAL
+ IN EFI_HANDLE CallbackHandle, OPTIONAL
+ IN UINT8 *NvMapOverride, OPTIONAL
+ IN FRAMEWORK_EFI_SCREEN_DESCRIPTOR *ScreenDimensions, OPTIONAL
+ OUT BOOLEAN *ResetRequired OPTIONAL
);
+/**
+
+ Rountine used to display a generic dialog interface and return
+ the Key or Input from user input.
+
+ @param LinesNumber The number of lines for the dialog box.
+ @param HotKey Defines if a single character is parsed (TRUE) and returned in KeyValue
+ or if a string is returned in StringBuffer.
+ @param MaximumStringSize The maximum size in bytes of a typed-in string.
+ @param StringBuffer On return contains the typed-in string if HotKey is FALSE.
+ @param Key The EFI_INPUT_KEY value returned if HotKey is TRUE.
+ @param FirstString The pointer to the first string in the list of strings
+ that comprise the dialog box.
+ @param ... A series of NumberOfLines text strings that will be used
+ to construct the dialog box.
+ @retval EFI_SUCCESS The dialog is created successfully and user interaction was received.
+ @retval EFI_DEVICE_ERROR The user typed in an ESC.
+ @retval EFI_INVALID_PARAMETER One of the parameters was invalid.(StringBuffer == NULL && HotKey == FALSE).
+**/
EFI_STATUS
EFIAPI
ThunkCreatePopUp (
@@ -426,6 +783,24 @@ ThunkCreatePopUp ( ...
);
+/**
+ This notification function will be called when a Package List is removed
+ using UEFI HII interface. The Package List removed need to be removed from
+ Framework Thunk module too.
+
+ If the Package List registered is not Sting Package,
+ then ASSERT. If the NotifyType is not REMOVE_PACK, then ASSERT.
+ Both cases means UEFI HII Database itself is buggy.
+
+ @param PackageType The Package Type.
+ @param PackageGuid The Package GUID.
+ @param Package The Package Header.
+ @param Handle The HII Handle of this Package List.
+ @param NotifyType The reason of the notification.
+
+ @retval EFI_SUCCESS The notification function is successful.
+
+**/
EFI_STATUS
EFIAPI
RemovePackNotify (
@@ -436,6 +811,25 @@ RemovePackNotify ( IN EFI_HII_DATABASE_NOTIFY_TYPE NotifyType
);
+/**
+ This notification function will be called when a Package List is registered
+ using UEFI HII interface. The Package List registered need to be recorded in
+ Framework Thunk module as Thunk Module may need to look for String Package in
+ the package registered.
+
+ If the Package List registered is not either Sting Package or IFR package,
+ then ASSERT. If the NotifyType is not ADD_PACK or NEW_PACK, then ASSERT.
+ Both cases means UEFI HII Database itself is buggy.
+
+ @param PackageType The Package Type.
+ @param PackageGuid The Package GUID.
+ @param Package The Package Header.
+ @param Handle The HII Handle of this Package List.
+ @param NotifyType The reason of the notification.
+
+ @retval EFI_SUCCESS The notification function is successful.
+
+**/
EFI_STATUS
EFIAPI
NewOrAddPackNotify (
diff --git a/EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk/HiiHandle.c b/EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk/HiiHandle.c index 35db52932a..d666002ec0 100644 --- a/EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk/HiiHandle.c +++ b/EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk/HiiHandle.c @@ -1,7 +1,7 @@ -/**@file
+/** @file
This file is for functins related to assign and free Framework HII handle number.
-Copyright (c) 2008, Intel Corporation
+Copyright (c) 2008 - 2010, 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
diff --git a/EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk/HiiHandle.h b/EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk/HiiHandle.h index ed2b186b7d..6f4be2feb6 100644 --- a/EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk/HiiHandle.h +++ b/EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk/HiiHandle.h @@ -1,7 +1,7 @@ -/**@file
+/** @file
This file is for functins related to assign and free Framework HII handle number.
-Copyright (c) 2006 - 2008, Intel Corporation
+Copyright (c) 2006 - 2010, 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
@@ -12,28 +12,48 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. **/
-#ifndef _HII_HANDLE_H
-#define _HII_HANDLE_H
+#ifndef _HII_HANDLE_H_
+#define _HII_HANDLE_H_
#include <FrameworkDxe.h>
#include <Protocol/FrameworkHii.h>
#include <Library/DebugLib.h>
+/**
+
+ Initialize the Framework Hii Handle database.
+
+**/
VOID
InitHiiHandleDatabase (
VOID
);
+/**
+ Allocate a new Framework HII handle.
+
+ @param Handle Returns the new Framework HII Handle assigned.
+
+ @retval EFI_SUCCESS A new Framework HII Handle is assigned.
+ @retval EFI_OUT_OF_RESOURCE The Framework HII Handle database is depleted.
+
+**/
EFI_STATUS
AllocateHiiHandle (
- FRAMEWORK_EFI_HII_HANDLE *Handle
-);
+ OUT FRAMEWORK_EFI_HII_HANDLE *Handle
+ );
+/**
+ Free Framework HII handle.
+
+ @param Handle The Framework HII Handle to be freed.
+
+**/
VOID
FreeHiiHandle (
- FRAMEWORK_EFI_HII_HANDLE Handle
-);
+ IN FRAMEWORK_EFI_HII_HANDLE Handle
+ );
#endif
diff --git a/EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk/Keyboard.c b/EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk/Keyboard.c index 32e4f93345..dad25cc425 100644 --- a/EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk/Keyboard.c +++ b/EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk/Keyboard.c @@ -1,8 +1,8 @@ -/**@file
+/** @file
This file contains the keyboard processing code to the HII database.
-Copyright (c) 2006 - 2008, Intel Corporation
+Copyright (c) 2006 - 2010, 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
diff --git a/EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk/OpcodeCreation.c b/EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk/OpcodeCreation.c index 7a14b9c68a..1f3e61e475 100644 --- a/EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk/OpcodeCreation.c +++ b/EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk/OpcodeCreation.c @@ -2,7 +2,7 @@ Implement Functions to convert IFR Opcode in format defined in Framework HII specification to
format defined in UEFI HII Specification.
-Copyright (c) 2007, Intel Corporation
+Copyright (c) 2007 - 2010, 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
@@ -26,7 +26,7 @@ typedef struct { UINT8 UefiIfrOp;
} IFR_OPCODE_MAP;
-IFR_OPCODE_MAP mQuestionOpcodeMap [] = {
+IFR_OPCODE_MAP QuestionOpcodeMap[] = {
{ FRAMEWORK_EFI_IFR_ONE_OF_OP, EFI_IFR_ONE_OF_OP},
{ FRAMEWORK_EFI_IFR_CHECKBOX_OP, EFI_IFR_CHECKBOX_OP},
{ FRAMEWORK_EFI_IFR_NUMERIC_OP, EFI_IFR_NUMERIC_OP},
@@ -51,9 +51,9 @@ QuestionOpFwToUefi ( {
UINTN Index;
- for (Index = 0; Index < sizeof (mQuestionOpcodeMap) / sizeof (mQuestionOpcodeMap[0]); Index++) {
- if (FwOp == mQuestionOpcodeMap[Index].FrameworkIfrOp) {
- *UefiOp = mQuestionOpcodeMap[Index].UefiIfrOp;
+ for (Index = 0; Index < sizeof (QuestionOpcodeMap) / sizeof (QuestionOpcodeMap[0]); Index++) {
+ if (FwOp == QuestionOpcodeMap[Index].FrameworkIfrOp) {
+ *UefiOp = QuestionOpcodeMap[Index].UefiIfrOp;
return EFI_SUCCESS;
}
}
@@ -63,13 +63,15 @@ QuestionOpFwToUefi ( }
/**
- Translate a Framework Question Opcode to UEFI Question Opcode.
+ Translate a Framework Question ID to UEFI Question ID.
- @param FwOp Framework Opcode.
- @param UefiOp UEFI Opcode.
+ @param FormSet FormSet context
+ @param FwOpCode Framework Opcode
+ @param FwQId Framework Question Id
+ @param UefiQId UEFI Question ID.
- @retval EFI_SUCCESS The UEFI opcode is found and returned.
- @retval EFI_NOT_FOUND The UEFI opcode is not found.
+ @retval EFI_SUCCESS The UEFI Question Id is found and returned.
+ @retval EFI_NOT_FOUND The UEFI Question Id is not found.
**/
EFI_STATUS
FwQIdToUefiQId (
@@ -150,6 +152,9 @@ FwQIdToUefiQId ( If FwQuestionId is not 0, then it is used as the Framework Question ID.
+ @param FwQuestionId
+ @param FormSet
+
@return The Framework Question ID.
**/
EFI_QUESTION_ID
@@ -169,8 +174,8 @@ AssignQuestionId ( /**
Create UEFI HII Text Opcode from a Framework HII Text Opcode.
- @param FwOpcode The input Framework Opcode.
@param UefiUpdateDataHandle The newly created UEFI HII opcode is appended to UefiUpdateDataHandle.
+ @param FwOpcode The input Framework Opcode.
@retval NULL There is not enough space left in Buffer to add the opcode.
@retval Other A pointer to the created opcode.
@@ -207,8 +212,8 @@ F2UCreateTextOpCode ( /**
Create UEFI HII Reference Opcode from a Framework HII Reference Opcode.
- @param FwOpcode The input Framework Opcode.
@param UefiUpdateDataHandle The newly created UEFI HII opcode is appended to UefiUpdateDataHandle.
+ @param FwOpcode The input Framework Opcode.
@retval NULL There is not enough space left in Buffer to add the opcode.
@retval Other A pointer to the created opcode.
@@ -245,9 +250,9 @@ F2UCreateReferenceOpCode ( /**
Create UEFI HII "One Of Option" Opcode from a Framework HII "One Of Option" Opcode.
+ @param UefiUpdateDataHandle The newly created UEFI HII opcode is appended to UefiUpdateDataHandle.
@param FwOpcode The input Framework Opcode.
@param Width The size of the One Of Option. 1 bytes or 2 bytes.
- @param UefiUpdateDataHandle The newly created UEFI HII opcode is appended to UefiUpdateDataHandle.
@retval NULL There is not enough space left in Buffer to add the opcode.
@retval Other A pointer to the created opcode.
@@ -300,10 +305,10 @@ F2UCreateOneOfOptionOpCode ( to a UEFI Question ID. This information is used to invoke the Framework HII Browser Callback
function. The opcode is appened to UefiUpdateDataHandle.
+ @param UefiUpdateDataHandle The UEFI Update Data buffer.
@param QuestionId The UEFI Question ID.
@param OptionValue The value of the "One Of Option".
@param KeyValue The Framework "One Of Option" callback key.
- @param UefiUpdateDataHandle The UEFI Update Data buffer.
@retval NULL There is not enough space left in Buffer to add the opcode.
@retval Other A pointer to the created opcode.
@@ -336,9 +341,9 @@ CreateGuidOptionKeyOpCode ( /**
Create UEFI HII "One Of" Opcode from a Framework HII "One Of" Opcode.
+ @param UefiUpdateDataHandle The newly created UEFI HII opcode is appended to UefiUpdateDataHandle.
@param ThunkContext The HII Thunk Context.
@param FwOpcode The input Framework Opcode.
- @param UefiUpdateDataHandle The newly created UEFI HII opcode is appended to UefiUpdateDataHandle.
@param NextFwOpcode Returns the position of the next Framework Opcode after EFI_IFR_END_ONE_OF_OP of
the "One Of Option".
@param OpcodeCount The number of Opcode for the complete Framework "One Of" Opcode.
@@ -456,9 +461,9 @@ F2UCreateOneOfOpCode ( /**
Create UEFI HII "Ordered List" Opcode from a Framework HII "Ordered List" Opcode.
+ @param UefiUpdateDataHandle The newly created UEFI HII opcode is appended to UefiUpdateDataHandle.
@param ThunkContext The HII Thunk Context.
@param FwOpcode The input Framework Opcode.
- @param UefiUpdateDataHandle The newly created UEFI HII opcode is appended to UefiUpdateDataHandle.
@param NextFwOpcode Returns the position of the next Framework Opcode after EFI_IFR_END_ONE_OF_OP of
the "Ordered List".
@param OpcodeCount The number of Opcode for the complete Framework "Ordered List" Opcode.
@@ -562,9 +567,9 @@ F2UCreateOrderedListOpCode ( /**
Create UEFI HII CheckBox Opcode from a Framework HII Checkbox Opcode.
+ @param UefiUpdateDataHandle The newly created UEFI HII opcode is appended to UefiUpdateDataHandle.
@param ThunkContext The HII Thunk Context.
@param FwOpcode The input Framework Opcode.
- @param UefiUpdateDataHandle The newly created UEFI HII opcode is appended to UefiUpdateDataHandle.
@retval NULL There is not enough space left in Buffer to add the opcode.
@retval Other A pointer to the created opcode.
@@ -627,9 +632,9 @@ F2UCreateCheckBoxOpCode ( /**
Create UEFI HII Numeric Opcode from a Framework HII Numeric Opcode.
+ @param UefiUpdateDataHandle The newly created UEFI HII opcode is appended to UefiUpdateDataHandle.
@param ThunkContext The HII Thunk Context.
@param FwOpcode The input Framework Opcode.
- @param UefiUpdateDataHandle The newly created UEFI HII opcode is appended to UefiUpdateDataHandle.
@retval NULL There is not enough space left in Buffer to add the opcode.
@retval Other A pointer to the created opcode.
@@ -749,9 +754,9 @@ F2UCreateNumericOpCode ( /**
Create UEFI HII String Opcode from a Framework HII String Opcode.
+ @param UefiUpdateDataHandle The newly created UEFI HII opcode is appended to UefiUpdateDataHandle.
@param ThunkContext The HII Thunk Context.
@param FwOpcode The input Framework Opcode.
- @param UefiUpdateDataHandle The newly created UEFI HII opcode is appended to UefiUpdateDataHandle.
@retval NULL There is not enough space left in Buffer to add the opcode.
@retval Other A pointer to the created opcode.
@@ -802,8 +807,8 @@ F2UCreateStringOpCode ( /**
Create UEFI HII Banner Opcode from a Framework HII Banner Opcode.
- @param FwOpcode The input Framework Opcode.
@param UefiUpdateDataHandle The newly created UEFI HII opcode is appended to UefiUpdateDataHandle.
+ @param FwOpcode The input Framework Opcode.
@retval NULL There is not enough space left in Buffer to add the opcode.
@retval Other A pointer to the created opcode.
@@ -837,7 +842,7 @@ F2UCreateBannerOpCode ( @param ThunkContext The HII Thunk Context.
@param FwUpdateData The Framework Update Data.
- @param UefiUpdateData The UEFI Update Data.
+ @param UefiOpCodeHandle The UEFI opcode hanlde.
@retval EFI_SUCCESS The UEFI Update Data is created successfully.
@retval EFI_UNSUPPORTED There is unsupported opcode in FwUpdateData.
diff --git a/EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk/Package.c b/EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk/Package.c index fb664a2928..8891dcf39c 100644 --- a/EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk/Package.c +++ b/EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk/Package.c @@ -1,7 +1,7 @@ -/**@file
+/** @file
Implement protocol interface related to package registrations.
-Copyright (c) 2006 - 2008, Intel Corporation
+Copyright (c) 2006 - 2010, 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
@@ -27,15 +27,16 @@ EFI_GUID mGuidBase = { 0x14f95e01, 0xd562, 0x432e, { 0x84, 0x4a, 0x95, 0xa4, 0x3 /**
- Get the number of package IFR and STRING packages in the package list passed in.
+ Get the number of Form, STRING and Font packages in the package list passed in.
@param Packages Package List.
@param IfrPackageCount Number of IFR Packages.
@param StringPackageCount Number of String Packages.
+ @param FontPackageCount Number of Font Packages.
@retval EFI_INVALID_PARAMETER If the Package List has package with type of
EFI_HII_PACKAGE_KEYBOARD_LAYOUT, EFI_HII_PACKAGE_FONTS, EFI_HII_PACKAGE_IMAGES.
- @reval EFI_SUCCESS Successfully get the number of IFR and STRING package.
+ @retval EFI_SUCCESS Successfully get the number of IFR and STRING package.
**/
@@ -159,7 +160,7 @@ UpdatePackListWithOnlyIfrPack ( If the Package Header is not of EFI_HII_FONT type, then ASSERT.
- @param The Package header of the Framework Font Package.
+ @param PackHeader Pointer to Framework Font Package.
@return The size of the UEFI Simple Font Package.
@@ -191,9 +192,9 @@ GetUefiSimpleFontPackSize ( If memory allocation fails, then ASSERT.
- @param FwFontPack Framework Font Package.
+ @param PackHeader Pointer to Framework Font Package header.
- @reture UEFI Simple Font Package.
+ @return UEFI Simple Font Package.
**/
EFI_HII_SIMPLE_FONT_PACKAGE_HDR *
FrameworkFontPackToUefiSimpliedFont (
@@ -450,7 +451,7 @@ FindStringPackAndUpdatePackListWithOnlyIfrPack ( @param This The EFI_HII_PROTOCOL context data. Only used
to call HiiRemovePack.
@param Private The HII THUNK driver context data.
- @param Package Package List.
+ @param Packages Package List.
@param Handle On output, a FRAMEWORK_EFI_HII_HANDLE number is
returned.
diff --git a/EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk/SetupBrowser.c b/EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk/SetupBrowser.c index 3503bc0715..3e5875f401 100644 --- a/EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk/SetupBrowser.c +++ b/EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk/SetupBrowser.c @@ -1,8 +1,8 @@ -/**@file
+/** @file
Framework to UEFI 2.1 Setup Browser Thunk. The file consume EFI_FORM_BROWSER2_PROTOCOL
to produce a EFI_FORM_BROWSER_PROTOCOL.
-Copyright (c) 2008, Intel Corporation
+Copyright (c) 2008 - 2010, 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
@@ -399,12 +399,17 @@ GetTimeout ( current settings and the caller needs to provide to the browser the
current settings for the the "fake" NV variable. If used, no saving of
an NV variable is possbile. This parameter is also ignored if Handle is NULL.
+ @param ScreenDimensions
+ Allows the browser to be called so that it occupies a portion of the physical
+ screen instead of dynamically determining the screen dimensions.
+ @param ResetRequired This BOOLEAN value denotes whether a reset is required based on the data that
+ might have been changed. The ResetRequired parameter is primarily applicable
+ for configuration applications, and is an optional parameter.
@retval EFI_SUCCESS If the Formset is displayed correctly.
@retval EFI_UNSUPPORTED If UseDatabase is FALSE or HandleCount is not 1.
@retval EFI_INVALID_PARAMETER If the *Handle passed in is not found in the database.
**/
-
EFI_STATUS
EFIAPI
ThunkSendForm (
diff --git a/EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk/SetupBrowser.h b/EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk/SetupBrowser.h index 9fd033878e..68100ded54 100644 --- a/EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk/SetupBrowser.h +++ b/EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk/SetupBrowser.h @@ -1,7 +1,7 @@ -/**@file
+/** @file
This file contains macros to be included by SetupBrowser.c.
-Copyright (c) 2008, Intel Corporation
+Copyright (c) 2008 - 2010, 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
diff --git a/EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk/Strings.c b/EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk/Strings.c index 3165f62676..6995be05b8 100644 --- a/EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk/Strings.c +++ b/EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk/Strings.c @@ -1,7 +1,7 @@ -/**@file
+/** @file
This file implements the protocol functions related to string package.
-Copyright (c) 2006 - 2008, Intel Corporation
+Copyright (c) 2006 - 2010, 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
@@ -135,7 +135,7 @@ UpdateString ( identifier, indicating the language to print. A string consisting of
all spaces indicates that the string is applicable to all languages.
@param Handle The handle of the language pack to which the string is to be added.
- @param Token The string token assigned to the string.
+ @param Reference The string token assigned to the string.
@param NewString The string to be added.
@@ -143,7 +143,6 @@ UpdateString ( @retval EFI_INVALID_PARAMETER The Handle was unknown. The string is not created or updated in the
the string package.
**/
-
EFI_STATUS
EFIAPI
HiiNewString (
@@ -292,7 +291,7 @@ HiiThunkGetString ( IN STRING_REF Token,
IN BOOLEAN Raw,
IN CHAR16 *LanguageString,
- IN OUT UINTN *BufferLengthTemp,
+ IN OUT UINTN *BufferLength,
OUT EFI_STRING StringBuffer
)
{
@@ -370,7 +369,7 @@ HiiThunkGetString ( UefiHiiHandle,
Token,
StringBuffer,
- BufferLengthTemp,
+ BufferLength,
NULL
);
FreePool (BestLanguage);
@@ -405,9 +404,10 @@ Done: @param This A pointer to the EFI_HII_PROTOCOL instance.
@param Handle The HII handle on which the string resides.
@param Token The string token assigned to the string.
- @param Raw If TRUE, the string is returned unedited in the internal storage format described
- above. If false, the string returned is edited by replacing <cr> with <space>
- and by removing special characters such as the <wide> prefix.
+ @param Index On input, the offset into the string where the line is to start.
+ On output, the index is updated to point to beyond the last character returned
+ in the call.
+ @param LineWidth The maximum width of the line in units of narrow glyphs.
@param LanguageString Pointer to a NULL-terminated string containing a single ISO 639-2 language
identifier, indicating the language to print. If the LanguageString is empty (starts
with a NULL), the default system language will be used to determine the language.
diff --git a/EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk/UefiIfrDefault.c b/EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk/UefiIfrDefault.c index 9dc7d2eb6d..b82b02e018 100644 --- a/EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk/UefiIfrDefault.c +++ b/EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk/UefiIfrDefault.c @@ -1,7 +1,7 @@ /** @file
Function and Macro defintions for to extract default values from UEFI Form package.
- Copyright (c) 2008, Intel Corporation
+ Copyright (c) 2008 - 2010, 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
@@ -32,8 +32,6 @@ extern CONST EFI_HII_CONFIG_ROUTING_PROTOCOL *mHiiConfigRoutingProtocol; @param Value The input value.
@param Offset The offset in Node->Buffer for the update.
@param Width The length of the Value.
-
- @retval VOID
**/
VOID
@@ -52,27 +50,27 @@ SetNodeBuffer ( /**
- Reset Question to its default value.
+ Get question default value, and set it into the match var storage.
Note Framework 0.92's HII Implementation does not support for default value for these opcodes:
EFI_IFR_ORDERED_LIST_OP:
EFI_IFR_PASSWORD_OP:
EFI_IFR_STRING_OP:
- @param FormSet FormSet data structure.
+ @param Question Question to be set to its default value.
@param DefaultId The Class of the default.
+ @param VarStoreId Id of var storage.
+ @param Node Var storage buffer to store the got default value.
@retval EFI_SUCCESS Question is reset to default value.
**/
EFI_STATUS
GetQuestionDefault (
- IN FORM_BROWSER_FORMSET *FormSet,
- IN FORM_BROWSER_FORM *Form,
IN FORM_BROWSER_STATEMENT *Question,
IN UINT16 DefaultId,
IN UINT16 VarStoreId,
- OUT UEFI_IFR_BUFFER_STORAGE_NODE *Node
+ OUT UEFI_IFR_BUFFER_STORAGE_NODE *Node
)
{
EFI_STATUS Status;
@@ -138,8 +136,8 @@ GetQuestionDefault ( while (!IsNull (&Question->OptionListHead, Link)) {
Option = QUESTION_OPTION_FROM_LINK (Link);
- if (((DefaultId == EFI_HII_DEFAULT_CLASS_STANDARD) && (Option->Flags & EFI_IFR_OPTION_DEFAULT)) ||
- ((DefaultId == EFI_HII_DEFAULT_CLASS_MANUFACTURING) && (Option->Flags & EFI_IFR_OPTION_DEFAULT_MFG))
+ if (((DefaultId == EFI_HII_DEFAULT_CLASS_STANDARD) && ((Option->Flags & EFI_IFR_OPTION_DEFAULT) == EFI_IFR_OPTION_DEFAULT)) ||
+ ((DefaultId == EFI_HII_DEFAULT_CLASS_MANUFACTURING) && ((Option->Flags & EFI_IFR_OPTION_DEFAULT_MFG) == EFI_IFR_OPTION_DEFAULT_MFG))
) {
CopyMem (HiiValue, &Option->Value, sizeof (EFI_HII_VALUE));
@@ -160,8 +158,8 @@ GetQuestionDefault ( //
// Checkbox could only provide Standard and Manufacturing default
//
- if (((DefaultId == EFI_HII_DEFAULT_CLASS_STANDARD) && (Question->Flags & EFI_IFR_CHECKBOX_DEFAULT)) ||
- ((DefaultId == EFI_HII_DEFAULT_CLASS_MANUFACTURING) && (Question->Flags & EFI_IFR_CHECKBOX_DEFAULT_MFG))
+ if (((DefaultId == EFI_HII_DEFAULT_CLASS_STANDARD) && ((Question->Flags & EFI_IFR_CHECKBOX_DEFAULT) == EFI_IFR_CHECKBOX_DEFAULT)) ||
+ ((DefaultId == EFI_HII_DEFAULT_CLASS_MANUFACTURING) && ((Question->Flags & EFI_IFR_CHECKBOX_DEFAULT_MFG) == EFI_IFR_CHECKBOX_DEFAULT_MFG))
) {
HiiValue->Value.b = TRUE;
} else {
@@ -178,22 +176,23 @@ GetQuestionDefault ( /**
- Reset Questions in a Form to their default value.
+ Extract the default values from all questions in the input Form,
+ and set default value into the matched var storage.
- @param FormSet FormSet data structure.
@param Form The Form which to be reset.
@param DefaultId The Class of the default.
+ @param VarStoreId Id of var storage.
+ @param Node Var storage buffer to store the got default value.
@retval EFI_SUCCESS The function completed successfully.
**/
EFI_STATUS
ExtractFormDefault (
- IN FORM_BROWSER_FORMSET *FormSet,
IN FORM_BROWSER_FORM *Form,
IN UINT16 DefaultId,
IN UINT16 VarStoreId,
- OUT UEFI_IFR_BUFFER_STORAGE_NODE *Node
+ OUT UEFI_IFR_BUFFER_STORAGE_NODE *Node
)
{
EFI_STATUS Status;
@@ -206,7 +205,7 @@ ExtractFormDefault ( //
// Reset Question to its default value
//
- Status = GetQuestionDefault (FormSet, Form, Question, DefaultId, VarStoreId, Node);
+ Status = GetQuestionDefault (Question, DefaultId, VarStoreId, Node);
if (EFI_ERROR (Status)) {
continue;
}
@@ -222,10 +221,7 @@ ExtractFormDefault ( UEFI_IFR_BUFFER_STORAGE_NODE. The Node itself
will be freed too.
- @param FormSet FormSet data structure.
- @param DefaultId The Class of the default.
-
- @retval VOID
+ @param Node Var storage buffer.
**/
VOID
@@ -245,10 +241,10 @@ DestroyDefaultNode ( The result is in the a instance of UEFI_IFR_BUFFER_STORAGE_NODE
allocated by this function. It is inserted to the link list.
- @param DefaultStore The Default Store.
- @param Storage The Storage.
- @param FormSet The Form Set.
- @param UefiDefaultsListHead The head of link list for the output.
+ @param DefaultStore The Default Store.
+ @param Storage The Storage.
+ @param FormSet The Form Set.
+ @param UefiDefaultsListHead The head of link list for the output.
@retval EFI_SUCCESS Successful.
@@ -283,7 +279,7 @@ GetBufferTypeDefaultIdAndStorageId ( while (!IsNull (&FormSet->FormListHead, Link)) {
Form = FORM_BROWSER_FORM_FROM_LINK (Link);
- Status = ExtractFormDefault (FormSet, Form, DefaultStore->DefaultId, Storage->VarStoreId, Node);
+ Status = ExtractFormDefault (Form, DefaultStore->DefaultId, Storage->VarStoreId, Node);
ASSERT_EFI_ERROR (Status);
Link = GetNextNode (&FormSet->FormListHead, Link);
@@ -338,14 +334,13 @@ GetBufferTypeDefaultId ( /**
- Get the default value for Buffer Type storage from the first FormSet
- in the Package List specified by a EFI_HII_HANDLE.
+ Get the default value for Buffer Type storage from the FormSet in ThunkContext.
The results can be multiple instances of UEFI_IFR_BUFFER_STORAGE_NODE.
They are inserted to the link list.
- @param UefiHiiHandle The handle for the package list.
- @param UefiDefaultsListHead The head of link list for the output.
+ @param ThunkContext Hii thunk context.
+ @param UefiDefaults The head of link list for the output.
@retval EFI_SUCCESS Successful.
@@ -384,20 +379,19 @@ UefiIfrGetBufferTypeDefaults ( Convert the UEFI Buffer Type default values to a Framework HII default
values specified by a EFI_HII_VARIABLE_PACK_LIST structure.
- @param ListHead The link list of UEFI_IFR_BUFFER_STORAGE_NODE
- which contains the default values retrived from
- a UEFI form set.
- @param DefaultMask The default mask.
- The valid values are EFI_IFR_FLAG_DEFAULT
- and EFI_IFR_FLAG_MANUFACTURING.
- UEFI spec only map EFI_IFR_FLAG_DEFAULT and EFI_IFR_FLAG_MANUFACTURING
- from specification to valid default class.
+ @param ListHead The link list of UEFI_IFR_BUFFER_STORAGE_NODE
+ which contains the default values retrived from a UEFI form set.
+ @param DefaultMask The default mask.
+ The valid values are EFI_IFR_FLAG_DEFAULT and EFI_IFR_FLAG_MANUFACTURING.
+ UEFI spec only map EFI_IFR_FLAG_DEFAULT and EFI_IFR_FLAG_MANUFACTURING
+ from specification to valid default class.
+ @param UefiFormSetDefaultVarStoreId
+ ID of the default varstore in FormSet.
@param VariablePackList The output default value in a format defined in Framework.
-
- @retval EFI_SUCCESS Successful.
+ @retval EFI_SUCCESS Successful.
@retval EFI_INVALID_PARAMETER The default mask is not EFI_IFR_FLAG_DEFAULT or
- EFI_IFR_FLAG_MANUFACTURING.
+ EFI_IFR_FLAG_MANUFACTURING.
**/
EFI_STATUS
UefiDefaultsToFwDefaults (
@@ -522,11 +516,9 @@ UefiDefaultsToFwDefaults ( Free up all buffer allocated for the link list of UEFI_IFR_BUFFER_STORAGE_NODE.
@param ListHead The link list of UEFI_IFR_BUFFER_STORAGE_NODE
- which contains the default values retrived from
- a UEFI form set.
-
+ which contains the default values retrived from
+ a UEFI form set.
- @retval VOID
**/
VOID
FreeDefaultList (
diff --git a/EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk/UefiIfrDefault.h b/EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk/UefiIfrDefault.h index e06b2829c3..ae55ece846 100644 --- a/EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk/UefiIfrDefault.h +++ b/EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk/UefiIfrDefault.h @@ -1,7 +1,7 @@ /** @file
Header file for Function and Macro defintions for to extract default values from UEFI Form package.
- Copyright (c) 2008, Intel Corporation
+ Copyright (c) 2008 - 2010, 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
@@ -31,14 +31,13 @@ typedef struct { } UEFI_IFR_BUFFER_STORAGE_NODE;
/**
- Get the default value for Buffer Type storage from the first FormSet
- in the Package List specified by a EFI_HII_HANDLE.
+ Get the default value for Buffer Type storage from the FormSet in ThunkContext.
The results can be multiple instances of UEFI_IFR_BUFFER_STORAGE_NODE.
They are inserted to the link list.
- @param UefiHiiHandle The handle for the package list.
- @param UefiDefaultsListHead The head of link list for the output.
+ @param ThunkContext Hii thunk context.
+ @param UefiDefaults The head of link list for the output.
@retval EFI_SUCCESS Successful.
@@ -47,31 +46,29 @@ EFI_STATUS UefiIfrGetBufferTypeDefaults (
IN HII_THUNK_CONTEXT *ThunkContext,
OUT LIST_ENTRY **UefiDefaults
-);
+ );
/**
Convert the UEFI Buffer Type default values to a Framework HII default
values specified by a EFI_HII_VARIABLE_PACK_LIST structure.
- @param ListHead The link list of UEFI_IFR_BUFFER_STORAGE_NODE
- which contains the default values retrived from
- a UEFI form set.
- @param DefaultMask The default mask.
- The valid values are FRAMEWORK_EFI_IFR_FLAG_DEFAULT
- and FRAMEWORK_EFI_IFR_FLAG_MANUFACTURING.
- UEFI spec only map FRAMEWORK_EFI_IFR_FLAG_DEFAULT and FRAMEWORK_EFI_IFR_FLAG_MANUFACTURING
- from specification to valid default class.
+ @param ListHead The link list of UEFI_IFR_BUFFER_STORAGE_NODE
+ which contains the default values retrived from a UEFI form set.
+ @param DefaultMask The default mask.
+ The valid values are EFI_IFR_FLAG_DEFAULT and EFI_IFR_FLAG_MANUFACTURING.
+ UEFI spec only map EFI_IFR_FLAG_DEFAULT and EFI_IFR_FLAG_MANUFACTURING
+ from specification to valid default class.
+ @param UefiFormSetDefaultVarStoreId
+ ID of the default varstore in FormSet.
@param VariablePackList The output default value in a format defined in Framework.
-
- @retval EFI_SUCCESS Successful.
- @retval EFI_INVALID_PARAMETER The default mask is not FRAMEWORK_EFI_IFR_FLAG_DEFAULT or
- FRAMEWORK_EFI_IFR_FLAG_MANUFACTURING.
+ @retval EFI_SUCCESS Successful.
+ @retval EFI_INVALID_PARAMETER The default mask is not EFI_IFR_FLAG_DEFAULT or
+ EFI_IFR_FLAG_MANUFACTURING.
**/
-
EFI_STATUS
UefiDefaultsToFwDefaults (
- IN LIST_ENTRY *UefiIfrDefaults,
+ IN LIST_ENTRY *ListHead,
IN UINTN DefaultMask,
IN EFI_VARSTORE_ID UefiFormSetDefaultVarStoreId,
OUT EFI_HII_VARIABLE_PACK_LIST **VariablePackList
@@ -81,17 +78,13 @@ UefiDefaultsToFwDefaults ( Free up all buffer allocated for the link list of UEFI_IFR_BUFFER_STORAGE_NODE.
@param ListHead The link list of UEFI_IFR_BUFFER_STORAGE_NODE
- which contains the default values retrived from
- a UEFI form set.
-
+ which contains the default values retrived from
+ a UEFI form set.
- @retval EFI_SUCCESS Successful.
- @retval EFI_INVALID_PARAMETER The default mask is not FRAMEWORK_EFI_IFR_FLAG_DEFAULT or
- FRAMEWORK_EFI_IFR_FLAG_MANUFACTURING.
**/
VOID
FreeDefaultList (
- IN LIST_ENTRY *UefiIfrDefaults
+ IN LIST_ENTRY *ListHead
);
#endif
diff --git a/EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk/UefiIfrParser.c b/EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk/UefiIfrParser.c index f5480d2cb6..a25854377e 100644 --- a/EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk/UefiIfrParser.c +++ b/EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk/UefiIfrParser.c @@ -25,6 +25,15 @@ BOOLEAN mInScopeGrayOut; EFI_GUID mFrameworkHiiCompatibilityGuid = EFI_IFR_FRAMEWORK_GUID;
extern EFI_GUID mTianoHiiIfrGuid;
+/**
+ Find the question's OneOfOptionMap list in FormSet
+ based on the input question Id.
+
+ @param FormSet FormSet context.
+ @param QuestionId Unique ID to specicy the question in FormSet.
+
+ @return the found OneOfOptionMap list. If not found, NULL will return.
+**/
LIST_ENTRY *
GetOneOfOptionMapEntryListHead (
IN CONST FORM_BROWSER_FORMSET *FormSet,
@@ -47,6 +56,12 @@ GetOneOfOptionMapEntryListHead ( return NULL;
}
+/**
+ Free OneOfOption map list.
+
+ @param OneOfOptionMapListHead Pointer to list header of OneOfOptionMap list.
+
+**/
VOID
DestoryOneOfOptionMap (
IN LIST_ENTRY *OneOfOptionMapListHead
diff --git a/EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk/UefiIfrParser.h b/EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk/UefiIfrParser.h index 327101be7d..edcc6b028c 100644 --- a/EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk/UefiIfrParser.h +++ b/EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk/UefiIfrParser.h @@ -8,7 +8,7 @@ 2) Ignore the IFR opcode which is invalid for Form Package
generated using Framework VFR file.
- Copyright (c) 2008 - 2009, Intel Corporation
+ Copyright (c) 2008 - 2010, 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
@@ -170,13 +170,15 @@ typedef struct { EFI_HII_VALUE Value;
EFI_IMAGE_ID ImageId;
-#if 0
- FORM_EXPRESSION *SuppressExpression; // Non-NULL indicates nested inside of SuppressIf
-#endif
} QUESTION_OPTION;
#define QUESTION_OPTION_FROM_LINK(a) CR (a, QUESTION_OPTION, Link, QUESTION_OPTION_SIGNATURE)
+typedef union {
+ EFI_STRING_ID VarName;
+ UINT16 VarOffset;
+} VAR_STORE_INFO;
+
#define FORM_BROWSER_STATEMENT_SIGNATURE SIGNATURE_32 ('F', 'S', 'T', 'A')
typedef struct {
UINTN Signature;
@@ -197,22 +199,11 @@ typedef struct { EFI_QUESTION_ID QuestionId; // The value of zero is reserved
EFI_VARSTORE_ID VarStoreId; // A value of zero indicates no variable storage
FORMSET_STORAGE *Storage;
- union {
- EFI_STRING_ID VarName;
- UINT16 VarOffset;
- } VarStoreInfo;
-#if 0
- CHAR16 *UnicodeVarName;
-#endif
+ VAR_STORE_INFO VarStoreInfo;
UINT16 StorageWidth;
UINT8 QuestionFlags;
-#if 0
- CHAR16 *VariableName; // Name/Value or EFI Variable name
- CHAR16 *BlockName; // Buffer storage block name: "OFFSET=...WIDTH=..."
-#endif
-
EFI_HII_VALUE HiiValue; // Edit copy for checkbox, numberic, oneof
UINT8 *BufferValue; // Edit copy for string, password, orderedlist
@@ -239,9 +230,6 @@ typedef struct { //
// Get from IFR parsing
//
-#if 0
- FORM_EXPRESSION *ValueExpression; // nested EFI_IFR_VALUE, provide Question value and indicate Question is ReadOnly
-#endif
LIST_ENTRY DefaultListHead; // nested EFI_IFR_DEFAULT list (QUESTION_DEFAULT), provide default values
LIST_ENTRY OptionListHead; // nested EFI_IFR_ONE_OF_OPTION list (QUESTION_OPTION)
@@ -249,13 +237,6 @@ typedef struct { UINT8 RefreshInterval; // nested EFI_IFR_REFRESH, refresh interval(in seconds) for Question value, 0 means no refresh
BOOLEAN InSubtitle; // nesting inside of EFI_IFR_SUBTITLE
-#if 0
- LIST_ENTRY InconsistentListHead;// nested inconsistent expression list (FORM_EXPRESSION)
- LIST_ENTRY NoSubmitListHead; // nested nosubmit expression list (FORM_EXPRESSION)
- FORM_EXPRESSION *GrayOutExpression; // nesting inside of GrayOutIf
- FORM_EXPRESSION *SuppressExpression; // nesting inside of SuppressIf
-#endif
-
} FORM_BROWSER_STATEMENT;
#define FORM_BROWSER_STATEMENT_FROM_LINK(a) CR (a, FORM_BROWSER_STATEMENT, Link, FORM_BROWSER_STATEMENT_SIGNATURE)
@@ -330,11 +311,28 @@ typedef struct { } FORM_BROWSER_FORMSET;
+/**
+ Parse opcodes in the formset IFR binary.
+
+ @param FormSet Pointer of the FormSet data structure.
+
+ @retval EFI_SUCCESS Opcode parse success.
+ @retval Other Opcode parse fail.
+
+**/
EFI_STATUS
ParseOpCodes (
IN FORM_BROWSER_FORMSET *FormSet
);
+/**
+ Free resources allocated for a FormSet
+
+ @param FormSet Pointer of the FormSet
+
+ @return None.
+
+**/
VOID
DestroyFormSet (
IN OUT FORM_BROWSER_FORMSET *FormSet
diff --git a/EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk/UefiIfrParserExpression.c b/EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk/UefiIfrParserExpression.c index 9d2cab5595..a9a0bd6ed5 100644 --- a/EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk/UefiIfrParserExpression.c +++ b/EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk/UefiIfrParserExpression.c @@ -1,6 +1,6 @@ /** @file
-Copyright (c) 2007, Intel Corporation
+Copyright (c) 2007 - 2010, 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
@@ -50,13 +50,12 @@ EFI_HII_VALUE *mExpressionEvaluationStackPointer = NULL; @param Stack On input: old stack; On output: new stack
@param StackPtr On input: old stack pointer; On output: new stack
pointer
- @param StackPtr On input: old stack end; On output: new stack end
+ @param StackEnd On input: old stack end; On output: new stack end
@retval EFI_SUCCESS Grow stack success.
@retval EFI_OUT_OF_RESOURCES No enough memory for stack space.
**/
-STATIC
EFI_STATUS
GrowStack (
IN OUT EFI_HII_VALUE **Stack,
@@ -110,7 +109,7 @@ GrowStack ( @param Stack On input: old stack; On output: new stack
@param StackPtr On input: old stack pointer; On output: new stack
pointer
- @param StackPtr On input: old stack end; On output: new stack end
+ @param StackEnd On input: old stack end; On output: new stack end
@param Data Data to push.
@retval EFI_SUCCESS Push stack success.
@@ -155,7 +154,7 @@ PushStack ( @param Stack On input: old stack; On output: new stack
@param StackPtr On input: old stack pointer; On output: new stack
pointer
- @param StackPtr On input: old stack end; On output: new stack end
+ @param StackEnd On input: old stack end; On output: new stack end
@param Data Data to pop.
@retval EFI_SUCCESS The value was popped onto the stack.
@@ -188,10 +187,6 @@ PopStack ( /**
Reset stack pointer to begin of the stack.
- None.
-
- @return None.
-
**/
VOID
ResetScopeStack (
@@ -265,10 +260,6 @@ PopScope ( /**
Reset stack pointer to begin of the stack.
- None.
-
- @return None.
-
**/
VOID
ResetExpressionStack (
diff --git a/EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk/UefiIfrParserExpression.h b/EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk/UefiIfrParserExpression.h index c55277ff13..7444f40792 100644 --- a/EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk/UefiIfrParserExpression.h +++ b/EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk/UefiIfrParserExpression.h @@ -2,7 +2,7 @@ Internal Function and Macro defintions for IFR Expression evaluation used in Ifr Parsing. This header file should only
be included by UefiIfrParserExpression.c and UefiIfrParser.c
- Copyright (c) 2008, Intel Corporation
+ Copyright (c) 2008 - 2010, 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
@@ -19,10 +19,6 @@ /**
Reset stack pointer to begin of the stack.
- None.
-
- @return None.
-
**/
VOID
ResetScopeStack (
diff --git a/EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk/Utility.c b/EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk/Utility.c index d1d5d4d398..5eac46da2a 100644 --- a/EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk/Utility.c +++ b/EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk/Utility.c @@ -1,8 +1,8 @@ -/**@file
+/** @file
This file contains the keyboard processing code to the HII database.
-Copyright (c) 2006 - 2008, Intel Corporation
+Copyright (c) 2006 - 2010, 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
@@ -303,8 +303,8 @@ FwHiiHandleToThunkContext ( /**
Find the corressponding HII Thunk Context from a UEFI HII Handle given.
- @param Private The HII Thunk Module Private context.
- @param UEFIHiiHandle The UEFI HII Handle.
+ @param Private The HII Thunk Module Private context.
+ @param UefiHiiHandle The UEFI HII Handle.
@return NULL If UEFI HII Handle is invalid.
@return The corresponding HII Thunk Context.
@@ -369,15 +369,15 @@ TagGuidToIfrPackThunkContext ( /**
Clean up the HII Thunk Context for a UEFI HII Handle.
- @param Private The HII Thunk Module Private context.
- @param UEFIHiiHandle The UEFI HII Handle.
+ @param Private The HII Thunk Module Private context.
+ @param UefiHiiHandle The UEFI HII Handle.
**/
VOID
DestroyThunkContextForUefiHiiHandle (
IN HII_THUNK_PRIVATE_DATA *Private,
IN EFI_HII_HANDLE UefiHiiHandle
- )
+ )
{
HII_THUNK_CONTEXT *ThunkContext;
@@ -389,16 +389,21 @@ DestroyThunkContextForUefiHiiHandle ( /**
- This function create a HII_THUNK_CONTEXT for a package list registered
- by a module calling EFI_HII_DATABASE_PROTOCOL.NewPackageList. It records
- the PackageListGuid in EFI_HII_PACKAGE_LIST_HEADER in the TagGuid in
- HII_THUNK_CONTEXT created. This TagGuid will be used as a key to s
+ This function create a HII_THUNK_CONTEXT for the input UEFI HiiHandle
+ that is created when a package list registered by a module calling
+ EFI_HII_DATABASE_PROTOCOL.NewPackageList.
+ This function records the PackageListGuid of EFI_HII_PACKAGE_LIST_HEADER
+ into the TagGuid of the created HII_THUNK_CONTEXT.
+
+ @param UefiHiiHandle The UEFI HII Handle.
+
+ @return the new created Hii thunk context.
**/
HII_THUNK_CONTEXT *
CreateThunkContextForUefiHiiHandle (
IN EFI_HII_HANDLE UefiHiiHandle
- )
+ )
{
EFI_STATUS Status;
EFI_GUID PackageGuid;
@@ -551,7 +556,7 @@ GetFormSetGuid ( @param Private The HII Thunk Private Context.
@param StringPackageCount The String package count.
- @param FormSetGuid The IFR Package count.
+ @param IfrPackageCount The IFR Package count.
@return A newly created Thunk Context.
@retval NULL No resource to create a new Thunk Context.
diff --git a/EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk/Utility.h b/EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk/Utility.h index 087eafaaa8..ebf44126f1 100644 --- a/EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk/Utility.h +++ b/EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk/Utility.h @@ -1,8 +1,8 @@ -/**@file
+/** @file
This file contains utility functions by HII Thunk Modules.
-Copyright (c) 2006 - 2008, Intel Corporation
+Copyright (c) 2006 - 2010, 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
@@ -13,8 +13,8 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. **/
-#ifndef _HII_THUNK_UTILITY_H
-#define _HII_THUNK_UTILITY_H
+#ifndef _HII_THUNK_UTILITY_H_
+#define _HII_THUNK_UTILITY_H_
/**
@@ -111,73 +111,121 @@ ExtractGuidFromHiiHandle ( ;
/**
- Find the UefiHiiHandle based on a Framework HII Handle returned by
- the HII Thunk to Framework HII code.
+ Find the corressponding UEFI HII Handle from a Framework HII Handle given.
- @param Private The pointer to the private data of Hii Thunk.
- @param FwHiiHandle Framework HII Handle returned by the HII Thunk to Framework HII code.
+ @param Private The HII Thunk Module Private context.
+ @param FwHiiHandle The Framemwork HII Handle.
- @retval NULL If Framework HII Handle passed in does not have matching UEFI HII handle.
- @retval !NULL If the match is found.
-
+ @return NULL If Framework HII Handle is invalid.
+ @return The corresponding UEFI HII Handle.
**/
EFI_HII_HANDLE
FwHiiHandleToUefiHiiHandle (
- IN CONST HII_THUNK_PRIVATE_DATA *Private,
+ IN CONST HII_THUNK_PRIVATE_DATA *Private,
IN FRAMEWORK_EFI_HII_HANDLE FwHiiHandle
);
+/**
+ Find the corressponding HII Thunk Context from a Framework HII Handle given.
+
+ @param Private The HII Thunk Module Private context.
+ @param FwHiiHandle The Framemwork HII Handle.
+
+ @return NULL If Framework HII Handle is invalid.
+ @return The corresponding HII Thunk Context.
+**/
HII_THUNK_CONTEXT *
FwHiiHandleToThunkContext (
- IN CONST HII_THUNK_PRIVATE_DATA *Private,
+ IN CONST HII_THUNK_PRIVATE_DATA *Private,
IN FRAMEWORK_EFI_HII_HANDLE FwHiiHandle
);
+/**
+ Find the corressponding HII Thunk Context from a UEFI HII Handle given.
+
+ @param Private The HII Thunk Module Private context.
+ @param UefiHiiHandle The UEFI HII Handle.
+
+ @return NULL If UEFI HII Handle is invalid.
+ @return The corresponding HII Thunk Context.
+**/
HII_THUNK_CONTEXT *
UefiHiiHandleToThunkContext (
- IN CONST HII_THUNK_PRIVATE_DATA *Private,
+ IN CONST HII_THUNK_PRIVATE_DATA *Private,
IN EFI_HII_HANDLE UefiHiiHandle
);
+/**
+ Find the corressponding HII Thunk Context from a Tag GUID.
+
+ @param Private The HII Thunk Module Private context.
+ @param Guid The Tag GUID.
+
+ @return NULL No HII Thunk Context matched the Tag GUID.
+ @return The corresponding HII Thunk Context.
+**/
HII_THUNK_CONTEXT *
TagGuidToIfrPackThunkContext (
IN CONST HII_THUNK_PRIVATE_DATA *Private,
IN CONST EFI_GUID *Guid
);
+/**
+ This function create a HII_THUNK_CONTEXT for the input UEFI HiiHandle
+ that is created when a package list registered by a module calling
+ EFI_HII_DATABASE_PROTOCOL.NewPackageList.
+ This function records the PackageListGuid of EFI_HII_PACKAGE_LIST_HEADER
+ into the TagGuid of the created HII_THUNK_CONTEXT.
+
+ @param UefiHiiHandle The UEFI HII Handle.
+
+ @return the new created Hii thunk context.
+
+**/
HII_THUNK_CONTEXT *
CreateThunkContextForUefiHiiHandle (
IN EFI_HII_HANDLE UefiHiiHandle
- );
+ );
+
+/**
+ Clean up the HII Thunk Context for a UEFI HII Handle.
+
+ @param Private The HII Thunk Module Private context.
+ @param UefiHiiHandle The UEFI HII Handle.
+**/
VOID
DestroyThunkContextForUefiHiiHandle (
IN HII_THUNK_PRIVATE_DATA *Private,
IN EFI_HII_HANDLE UefiHiiHandle
- );
+ );
+
+/**
+ Get the number of HII Package for a Package type.
+ @param PackageListHeader The Package List.
+ @param PackageType The Package Type.
+
+ @return The number of Package for given type.
+**/
UINTN
GetPackageCountByType (
IN CONST EFI_HII_PACKAGE_LIST_HEADER *PackageListHeader,
IN UINT8 PackageType
);
-EFI_STATUS
-CreateQuestionIdMap (
- IN OUT HII_THUNK_CONTEXT *ThunkContext
- );
+/**
+ Creat a Thunk Context.
-VOID
-GetAttributesOfFirstFormSet (
- IN OUT HII_THUNK_CONTEXT *ThunkContext
- );
+ ASSERT if no FormSet Opcode is found.
-LIST_ENTRY *
-GetMapEntryListHead (
- IN CONST HII_THUNK_CONTEXT *ThunkContext,
- IN UINT16 VarStoreId
- );
+ @param Private The HII Thunk Private Context.
+ @param StringPackageCount The String package count.
+ @param IfrPackageCount The IFR Package count.
+ @return A newly created Thunk Context.
+ @retval NULL No resource to create a new Thunk Context.
+**/
HII_THUNK_CONTEXT *
CreateThunkContext (
IN HII_THUNK_PRIVATE_DATA *Private,
@@ -185,33 +233,55 @@ CreateThunkContext ( IN UINTN IfrPackageCount
);
+/**
+ Destroy the Thunk Context and free up all resource.
+
+ @param ThunkContext The HII Thunk Private Context to be freed.
+
+**/
VOID
DestroyThunkContext (
IN HII_THUNK_CONTEXT *ThunkContext
);
-VOID
-DestoryOneOfOptionMap (
- IN LIST_ENTRY *OneOfOptionMapListHead
- );
+/**
+ Get FormSet GUID.
+
+ ASSERT if no FormSet Opcode is found.
+ @param Packages Form Framework Package.
+ @param FormSetGuid Return the FormSet Guid.
+
+**/
VOID
GetFormSetGuid (
IN EFI_HII_PACKAGE_HEADER *Package,
OUT EFI_GUID *FormSetGuid
- )
-;
+ );
+
+/**
+ Get the Form Package from a Framework Package List.
+
+ @param Packages Framework Package List.
+ @return The Form Package Header found.
+**/
EFI_HII_PACKAGE_HEADER *
GetIfrPackage (
IN CONST EFI_HII_PACKAGES *Packages
- )
-;
+ );
+/**
+ Parse the Form Package and build a FORM_BROWSER_FORMSET structure.
+
+ @param UefiHiiHandle PackageList Handle
+
+ @return A pointer to FORM_BROWSER_FORMSET.
+
+**/
FORM_BROWSER_FORMSET *
ParseFormSet (
IN EFI_HII_HANDLE UefiHiiHandle
- )
-;
+ );
#endif
|