UEFI HII: Merge UEFI HII support changes from branch.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@4597 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
qwang12
2008-01-21 14:33:26 +00:00
parent c03fbe30c1
commit dc7b4a5c43
15 changed files with 521 additions and 383 deletions

View File

@@ -24,4 +24,6 @@
#include <Framework/DxeCis.h>
#include <Framework/FrameworkInternalFormRepresentation.h>
#endif

View File

@@ -24,6 +24,7 @@
#include <Framework/StatusCode.h>
#include <Framework/DataHubRecords.h>
#include <Protocol/DebugSupport.h>
#include <Protocol/FrameworkHii.h>
//////////////////////////////////////////////////////////////////////////////////////////
// String Data Type defintion. This is part of Status Code Specification
@@ -40,7 +41,7 @@ typedef enum {
} EFI_STRING_TYPE;
typedef struct {
EFI_HII_HANDLE Handle;
FRAMEWORK_EFI_HII_HANDLE Handle;
STRING_REF Token;
} EFI_STATUS_CODE_STRING_TOKEN;

View File

@@ -14,10 +14,16 @@
**/
#ifndef __HII_LIB_H__
#define __HII_LIB_H__
#ifndef __FRAMEWORK_HII_LIB_H__
#define __FRAMEWORK_HII_LIB_H__
#include <FrameworkDxe.h>
#include <Protocol/FrameworkHii.h>
//
// FrameworkHiiLib will produce HiiLib library class too.
//
#include <Library/HiiLib.h>
/**
This function allocates pool for an EFI_HII_PACKAGES structure
@@ -41,6 +47,4 @@ PreparePackages (
)
;
#endif

View File

@@ -513,7 +513,7 @@ Returns:
EFI_STATUS
ExtractDataFromHiiHandle (
IN EFI_HII_HANDLE HiiHandle,
IN FRAMEWORK_EFI_HII_HANDLE HiiHandle,
IN OUT UINT16 *ImageLength,
OUT UINT8 *DefaultImage,
OUT EFI_GUID *Guid
@@ -547,7 +547,7 @@ Returns:
--*/
;
EFI_HII_HANDLE
FRAMEWORK_EFI_HII_HANDLE
FindHiiHandle (
IN OUT EFI_HII_PROTOCOL **HiiProtocol, OPTIONAL
IN EFI_GUID *Guid
@@ -917,7 +917,7 @@ Returns:
EFI_STATUS
ValidateDataFromHiiHandle (
IN EFI_HII_HANDLE HiiHandle,
IN FRAMEWORK_EFI_HII_HANDLE HiiHandle,
OUT BOOLEAN *Results
)
/*++

View File

@@ -43,7 +43,7 @@ typedef struct {
typedef struct {
EFI_HII_IFR_PACK *IfrData;
EFI_HII_STRING_PACK *StringData;
} EFI_IFR_PACKET;
} FRAMEWORK_EFI_IFR_PACKET;
typedef struct {
UINTN LeftColumn;
@@ -94,9 +94,9 @@ EFI_STATUS
(EFIAPI *EFI_SEND_FORM) (
IN EFI_FORM_BROWSER_PROTOCOL *This,
IN BOOLEAN UseDatabase,
IN EFI_HII_HANDLE *Handle,
IN FRAMEWORK_EFI_HII_HANDLE *Handle,
IN UINTN HandleCount,
IN EFI_IFR_PACKET *Packet, OPTIONAL
IN FRAMEWORK_EFI_IFR_PACKET *Packet, OPTIONAL
IN EFI_HANDLE CallbackHandle, OPTIONAL
IN UINT8 *NvMapOverride, OPTIONAL
IN EFI_SCREEN_DESCRIPTOR *ScreenDimensions, OPTIONAL

View File

@@ -24,7 +24,7 @@
#ifndef __FORM_CALLBACK_H__
#define __FORM_CALLBACK_H__
#include <PiDxe.h>
#include <FrameworkDxe.h>
#include <Protocol/FrameworkHii.h>
#include <Protocol/FrameworkFormBrowser.h>
@@ -50,41 +50,41 @@ typedef struct _EFI_FORM_CALLBACK_PROTOCOL EFI_FORM_CALLBACK_PROTOCOL;
#pragma pack(1)
typedef struct {
UINT8 OpCode; // Likely a string, numeric, or one-of
UINT8 Length; // Length of the EFI_IFR_DATA_ENTRY packet
UINT8 Length; // Length of the FRAMEWORK_EFI_IFR_DATA_ENTRY packet
UINT16 Flags; // Flags settings to determine what behavior is desired from the browser after the callback
VOID *Data; // The data in the form based on the op-code type - this is not a pointer to the data, the data follows immediately
// If the OpCode is a OneOf or Numeric type - Data is a UINT16 value
// If the OpCode is a String type - Data is a CHAR16[x] type
// If the OpCode is a Checkbox type - Data is a UINT8 value
// If the OpCode is a NV Access type - Data is a EFI_IFR_NV_DATA structure
// If the OpCode is a NV Access type - Data is a FRAMEWORK_EFI_IFR_NV_DATA structure
//
} EFI_IFR_DATA_ENTRY;
} FRAMEWORK_EFI_IFR_DATA_ENTRY;
typedef struct {
VOID *NvRamMap; // If the flag of the op-code specified retrieval of a copy of the NVRAM map,
// this is a pointer to a buffer copy
//
UINT32 EntryCount; // How many EFI_IFR_DATA_ENTRY entries
UINT32 EntryCount; // How many FRAMEWORK_EFI_IFR_DATA_ENTRY entries
//
// EFI_IFR_DATA_ENTRY Data[1]; // The in-line Data entries.
// FRAMEWORK_EFI_IFR_DATA_ENTRY Data[1]; // The in-line Data entries.
//
} EFI_IFR_DATA_ARRAY;
} FRAMEWORK_EFI_IFR_DATA_ARRAY;
typedef union {
EFI_IFR_DATA_ARRAY DataArray; // Primarily used by those who call back to their drivers and use HII as a repository
EFI_IFR_PACKET DataPacket; // Primarily used by those which do not use HII as a repository
CHAR16 *String; // If returning an error - fill the string with null-terminated contents
FRAMEWORK_EFI_IFR_DATA_ARRAY DataArray; // Primarily used by those who call back to their drivers and use HII as a repository
FRAMEWORK_EFI_IFR_PACKET DataPacket; // Primarily used by those which do not use HII as a repository
CHAR16 String[1]; // If returning an error - fill the string with null-terminated contents
} EFI_HII_CALLBACK_PACKET;
typedef struct {
EFI_IFR_OP_HEADER Header;
FRAMEWORK_EFI_IFR_OP_HEADER Header;
UINT16 QuestionId; // Offset into the map
UINT8 StorageWidth; // Width of the value
//
// CHAR8 Data[1]; // The Data itself
//
} EFI_IFR_NV_DATA;
} FRAMEWORK_EFI_IFR_NV_DATA;
#pragma pack()
//
@@ -178,7 +178,7 @@ EFI_STATUS
(EFIAPI *EFI_FORM_CALLBACK) (
IN EFI_FORM_CALLBACK_PROTOCOL *This,
IN UINT16 KeyValue,
IN EFI_IFR_DATA_ARRAY *Data,
IN FRAMEWORK_EFI_IFR_DATA_ARRAY *Data,
OUT EFI_HII_CALLBACK_PACKET **Packet
);

View File

@@ -51,6 +51,8 @@
typedef struct _EFI_HII_PROTOCOL EFI_HII_PROTOCOL;
typedef UINT16 FRAMEWORK_EFI_HII_HANDLE;
//
// Global definition
//
@@ -139,7 +141,7 @@ typedef struct {
// ********************************************************
//
typedef struct {
EFI_HII_HANDLE HiiHandle;
FRAMEWORK_EFI_HII_HANDLE HiiHandle;
EFI_GUID PackageGuid;
UINT32 DataTableSize;
UINT32 IfrDataOffset;
@@ -207,25 +209,6 @@ typedef struct {
//
} EFI_HII_STRING_PACK;
//
// Glyph Attributes
//
#define EFI_GLYPH_NON_SPACING 1
#define EFI_GLYPH_WIDE 2
typedef struct {
CHAR16 UnicodeWeight;
UINT8 Attributes;
UINT8 GlyphCol1[GLYPH_HEIGHT];
} EFI_NARROW_GLYPH;
typedef struct {
CHAR16 UnicodeWeight;
UINT8 Attributes;
UINT8 GlyphCol1[GLYPH_HEIGHT];
UINT8 GlyphCol2[GLYPH_HEIGHT];
UINT8 Pad[3];
} EFI_WIDE_GLYPH;
//
// A font list consists of a font header followed by a series
@@ -249,117 +232,6 @@ typedef struct {
EFI_HII_PACK_HEADER Header;
} EFI_HII_IFR_PACK_HEADER;
//
// pedef EFI_HII_PACK_HEADER EFI_HII_IFR_PACK_HEADER;
//
typedef enum {
EfiKeyLCtrl,
EfiKeyA0,
EfiKeyLAlt,
EfiKeySpaceBar,
EfiKeyA2,
EfiKeyA3,
EfiKeyA4,
EfiKeyRCtrl,
EfiKeyLeftArrow,
EfiKeyDownArrow,
EfiKeyRightArrow,
EfiKeyZero,
EfiKeyPeriod,
EfiKeyEnter,
EfiKeyLShift,
EfiKeyB0,
EfiKeyB1,
EfiKeyB2,
EfiKeyB3,
EfiKeyB4,
EfiKeyB5,
EfiKeyB6,
EfiKeyB7,
EfiKeyB8,
EfiKeyB9,
EfiKeyB10,
EfiKeyRshift,
EfiKeyUpArrow,
EfiKeyOne,
EfiKeyTwo,
EfiKeyThree,
EfiKeyCapsLock,
EfiKeyC1,
EfiKeyC2,
EfiKeyC3,
EfiKeyC4,
EfiKeyC5,
EfiKeyC6,
EfiKeyC7,
EfiKeyC8,
EfiKeyC9,
EfiKeyC10,
EfiKeyC11,
EfiKeyC12,
EfiKeyFour,
EfiKeyFive,
EfiKeySix,
EfiKeyPlus,
EfiKeyTab,
EfiKeyD1,
EfiKeyD2,
EfiKeyD3,
EfiKeyD4,
EfiKeyD5,
EfiKeyD6,
EfiKeyD7,
EfiKeyD8,
EfiKeyD9,
EfiKeyD10,
EfiKeyD11,
EfiKeyD12,
EfiKeyD13,
EfiKeyDel,
EfiKeyEnd,
EfiKeyPgDn,
EfiKeySeven,
EfiKeyEight,
EfiKeyNine,
EfiKeyE0,
EfiKeyE1,
EfiKeyE2,
EfiKeyE3,
EfiKeyE4,
EfiKeyE5,
EfiKeyE6,
EfiKeyE7,
EfiKeyE8,
EfiKeyE9,
EfiKeyE10,
EfiKeyE11,
EfiKeyE12,
EfiKeyBackSpace,
EfiKeyIns,
EfiKeyHome,
EfiKeyPgUp,
EfiKeyNLck,
EfiKeySlash,
EfiKeyAsterisk,
EfiKeyMinus,
EfiKeyEsc,
EfiKeyF1,
EfiKeyF2,
EfiKeyF3,
EfiKeyF4,
EfiKeyF5,
EfiKeyF6,
EfiKeyF7,
EfiKeyF8,
EfiKeyF9,
EfiKeyF10,
EfiKeyF11,
EfiKeyF12,
EfiKeyPrint,
EfiKeySLck,
EfiKeyPause
} EFI_KEY;
typedef struct {
EFI_KEY Key;
CHAR16 Unicode;
@@ -367,7 +239,7 @@ typedef struct {
CHAR16 AltGrUnicode;
CHAR16 ShiftedAltGrUnicode;
UINT16 Modifier;
} EFI_KEY_DESCRIPTOR;
} FRAMEWORK_EFI_KEY_DESCRIPTOR;
//
// This structure allows a sparse set of keys to be redefined
@@ -389,7 +261,7 @@ typedef struct {
//
typedef struct {
EFI_HII_PACK_HEADER Header;
EFI_KEY_DESCRIPTOR *Descriptor;
FRAMEWORK_EFI_KEY_DESCRIPTOR *Descriptor;
UINT8 DescriptorCount;
} EFI_HII_KEYBOARD_PACK;
@@ -422,7 +294,7 @@ typedef struct _EFI_HII_VARIABLE_PACK_LIST {
@param This A pointer to the EFI_HII_PROTOCOL instance.
@param Packages A pointer to an EFI_HII_PACKAGES package instance.
@param Handle A pointer to the EFI_HII_HANDLE instance.
@param Handle A pointer to the FRAMEWORK_EFI_HII_HANDLE instance.
@retval EFI_SUCCESS Data was extracted from Packages, the database
was updated with the data, and Handle returned successfully.
@@ -434,7 +306,7 @@ EFI_STATUS
(EFIAPI *EFI_HII_NEW_PACK) (
IN EFI_HII_PROTOCOL *This,
IN EFI_HII_PACKAGES *Packages,
OUT EFI_HII_HANDLE *Handle
OUT FRAMEWORK_EFI_HII_HANDLE *Handle
);
/**
@@ -453,7 +325,7 @@ typedef
EFI_STATUS
(EFIAPI *EFI_HII_REMOVE_PACK) (
IN EFI_HII_PROTOCOL *This,
IN EFI_HII_HANDLE Handle
IN FRAMEWORK_EFI_HII_HANDLE Handle
);
/**
@@ -463,7 +335,7 @@ EFI_STATUS
@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 An array of EFI_HII_HANDLE instances returned.
@param Handle An array of FRAMEWORK_EFI_HII_HANDLE instances returned.
@retval EFI_SUCCESS Handle was updated successfully.
@retval EFI_BUFFER_TOO_SMALL The HandleBufferLength parameter indicates
@@ -475,14 +347,14 @@ EFI_STATUS
(EFIAPI *EFI_HII_FIND_HANDLES) (
IN EFI_HII_PROTOCOL *This,
IN OUT UINT16 *HandleBufferLength,
OUT EFI_HII_HANDLE *Handle
OUT FRAMEWORK_EFI_HII_HANDLE *Handle
);
/**
Exports the contents of the database into a buffer.
@param This A pointer to the EFI_HII_PROTOCOL instance.
@param Handle An EFI_HII_HANDLE that corresponds to the desired
@param Handle An FRAMEWORK_EFI_HII_HANDLE that corresponds to the desired
handle to export. If the value is 0, the entire database will be exported.
In either case, the data will be exported in a format described by the
structure definition of EFI_HII_EXPORT_TABLE.
@@ -499,7 +371,7 @@ typedef
EFI_STATUS
(EFIAPI *EFI_HII_EXPORT) (
IN EFI_HII_PROTOCOL *This,
IN EFI_HII_HANDLE Handle,
IN FRAMEWORK_EFI_HII_HANDLE Handle,
IN OUT UINTN *BufferSize,
OUT VOID *Buffer
);
@@ -519,7 +391,7 @@ typedef
EFI_STATUS
(EFIAPI *EFI_HII_RESET_STRINGS) (
IN EFI_HII_PROTOCOL *This,
IN EFI_HII_HANDLE Handle
IN FRAMEWORK_EFI_HII_HANDLE Handle
);
/**
@@ -637,7 +509,7 @@ EFI_STATUS
(EFIAPI *EFI_HII_NEW_STRING) (
IN EFI_HII_PROTOCOL *This,
IN CHAR16 *Language,
IN EFI_HII_HANDLE Handle,
IN FRAMEWORK_EFI_HII_HANDLE Handle,
IN OUT STRING_REF *Reference,
IN CHAR16 *NewString
);
@@ -659,7 +531,7 @@ typedef
EFI_STATUS
(EFIAPI *EFI_HII_GET_PRI_LANGUAGES) (
IN EFI_HII_PROTOCOL *This,
IN EFI_HII_HANDLE Handle,
IN FRAMEWORK_EFI_HII_HANDLE Handle,
OUT EFI_STRING *LanguageString
);
@@ -682,7 +554,7 @@ typedef
EFI_STATUS
(EFIAPI *EFI_HII_GET_SEC_LANGUAGES) (
IN EFI_HII_PROTOCOL *This,
IN EFI_HII_HANDLE Handle,
IN FRAMEWORK_EFI_HII_HANDLE Handle,
IN CHAR16 *PrimaryLanguage,
OUT EFI_STRING *LanguageString
);
@@ -714,7 +586,7 @@ typedef
EFI_STATUS
(EFIAPI *EFI_HII_GET_STRING) (
IN EFI_HII_PROTOCOL *This,
IN EFI_HII_HANDLE Handle,
IN FRAMEWORK_EFI_HII_HANDLE Handle,
IN STRING_REF Token,
IN BOOLEAN Raw,
IN CHAR16 *LanguageString,
@@ -748,7 +620,7 @@ typedef
EFI_STATUS
(EFIAPI *EFI_HII_GET_LINE) (
IN EFI_HII_PROTOCOL *This,
IN EFI_HII_HANDLE Handle,
IN FRAMEWORK_EFI_HII_HANDLE Handle,
IN STRING_REF Token,
IN OUT UINT16 *Index,
IN UINT16 LineWidth,
@@ -782,7 +654,7 @@ typedef
EFI_STATUS
(EFIAPI *EFI_HII_GET_FORMS) (
IN EFI_HII_PROTOCOL *This,
IN EFI_HII_HANDLE Handle,
IN FRAMEWORK_EFI_HII_HANDLE Handle,
IN EFI_FORM_ID FormId,
IN OUT UINTN *BufferLength,
OUT UINT8 *Buffer
@@ -809,7 +681,7 @@ typedef
EFI_STATUS
(EFIAPI *EFI_HII_GET_DEFAULT_IMAGE) (
IN EFI_HII_PROTOCOL *This,
IN EFI_HII_HANDLE Handle,
IN FRAMEWORK_EFI_HII_HANDLE Handle,
IN UINTN DefaultMask,
OUT EFI_HII_VARIABLE_PACK_LIST **VariablePackList
);
@@ -835,7 +707,7 @@ typedef
EFI_STATUS
(EFIAPI *EFI_HII_UPDATE_FORM) (
IN EFI_HII_PROTOCOL *This,
IN EFI_HII_HANDLE Handle,
IN FRAMEWORK_EFI_HII_HANDLE Handle,
IN EFI_FORM_LABEL Label,
IN BOOLEAN AddData,
IN EFI_HII_UPDATE_DATA *Data
@@ -847,7 +719,7 @@ EFI_STATUS
@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
@param Descriptor A pointer to a buffer containing an array of FRAMEWORK_EFI_KEY_DESCRIPTOR
entries. Each entry will reflect the definition of a specific physical key.
@retval EFI_SUCCESS The keyboard layout was retrieved successfully.
@@ -858,7 +730,7 @@ EFI_STATUS
(EFIAPI *EFI_HII_GET_KEYBOARD_LAYOUT) (
IN EFI_HII_PROTOCOL *This,
OUT UINT16 *DescriptorCount,
OUT EFI_KEY_DESCRIPTOR *Descriptor
OUT FRAMEWORK_EFI_KEY_DESCRIPTOR *Descriptor
);
/**