hii.h
来自「EFI BIOS是Intel提出的下一代的BIOS标准。这里上传的Edk源代码是」· C头文件 代码 · 共 614 行 · 第 1/2 页
H
614 行
/*++
Copyright (c) 2004 - 2006, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name:
Hii.h
Abstract:
This file defines the Human Interface Infrastructure protocol which will
be used by resources which want to publish IFR/Font/String data and have it
collected by the Configuration engine.
--*/
#ifndef _HII_H_
#define _HII_H_
#include "EfiInternalFormRepresentation.h"
#include EFI_PROTOCOL_DEFINITION (UgaDraw)
#include EFI_PROTOCOL_DEFINITION (GraphicsOutput)
#define EFI_HII_PROTOCOL_GUID \
{ \
0xea816d2c, 0xcee5, 0x4f02, 0x99, 0xb5, 0xd3, 0x90, 0x5c, 0xbb, 0xd0, 0x77 \
}
//
// Forward reference for pure ANSI compatability
//
EFI_FORWARD_DECLARATION (EFI_HII_PROTOCOL);
typedef struct _EFI_HII_PROTOCOL EFI_HII_PROTOCOL;
//
// Global definition
//
#define NARROW_CHAR 0xFFF0
#define WIDE_CHAR 0xFFF1
#define NON_BREAKING_CHAR 0xFFF2
#define GLYPH_WIDTH 8
#define GLYPH_HEIGHT 19
#define EFI_HII_FONT 1
#define EFI_HII_STRING 2
#define EFI_HII_IFR 3
#define EFI_HII_KEYBOARD 4
#define EFI_HII_HANDLES 5
#define EFI_HII_VARIABLE 6
#define EFI_HII_DEVICE_PATH 7
#define HANG(foo) { \
volatile INT32 __iii; \
__iii = foo; \
while (__iii) \
; \
}
//
// #define HANG(foo)
//
// References to string tokens must use this macro to enable scanning for
// token usages.
//
#define STRING_TOKEN(t) t
//
// The following types are currently defined:
//
typedef UINT16 EFI_FORM_ID;
typedef UINT16 EFI_FORM_LABEL;
typedef UINT16 EFI_HII_HANDLE;
#pragma pack(1)
typedef struct {
UINT32 Length;
UINT16 Type;
} EFI_HII_PACK_HEADER;
//
// A form list consists of a large variety of structure
// possibilities so to represent the binary blob of data
// associated with a package of forms, we will assume a
// pointer to a self-describing data buffer.
//
typedef struct {
EFI_HII_PACK_HEADER Header;
} EFI_HII_IFR_PACK;
typedef struct {
EFI_HII_PACK_HEADER Header; // Must be filled in
EFI_HANDLE ImageHandle; // Must be filled in
EFI_HANDLE DeviceHandle; // Optional
EFI_HANDLE ControllerHandle; // Optional
EFI_HANDLE CallbackHandle; // Optional
EFI_HANDLE COBExportHandle; // Optional
} EFI_HII_HANDLE_PACK;
//
// ********************************************************
// EFI_VARIABLE_CONTENTS
// ********************************************************
//
typedef struct {
EFI_HII_PACK_HEADER Header;
EFI_GUID VariableGuid;
UINT32 VariableNameLength;
UINT16 VariableId;
//
// CHAR16 VariableName[]; //Null-terminated
//
} EFI_HII_VARIABLE_PACK;
//
// ********************************************************
// EFI_DEVICE_PATH_PACK
// ********************************************************
//
typedef struct {
EFI_HII_PACK_HEADER Header;
//
// EFI_DEVICE_PATH DevicePath[];
//
} EFI_HII_DEVICE_PATH_PACK;
//
// ********************************************************
// EFI_HII_DATA_TABLE
// ********************************************************
//
typedef struct {
EFI_HII_HANDLE HiiHandle;
EFI_GUID PackageGuid;
UINT32 DataTableSize;
UINT32 IfrDataOffset;
UINT32 StringDataOffset;
UINT32 VariableDataOffset;
UINT32 DevicePathOffset;
UINT32 NumberOfVariableData;
UINT32 NumberOfLanguages;
//
// EFI_HII_DEVICE_PATH_PACK DevicePath[];
// EFI_HII_VARIABLE_PACK VariableData[];
// EFI_HII_IFR_PACK IfrData;
// EFI_HII_STRING_PACK StringData[];
//
} EFI_HII_DATA_TABLE;
//
// ********************************************************
// EFI_HII_EXPORT_TABLE
// ********************************************************
//
typedef struct {
UINT16 NumberOfHiiDataTables;
EFI_GUID Revision;
//
// EFI_HII_DATA_TABLE HiiDataTable[];
//
} EFI_HII_EXPORT_TABLE;
typedef struct {
BOOLEAN FormSetUpdate; // If TRUE, next variable is significant
EFI_PHYSICAL_ADDRESS FormCallbackHandle; // If not 0, will update Formset with this info
BOOLEAN FormUpdate; // If TRUE, next variable is significant
STRING_REF FormTitle; // If not 0, will update Form with this info
UINT16 DataCount; // The number of Data entries in this structure
UINT8 *Data; // An array of 1+ op-codes, specified by DataCount
} EFI_HII_UPDATE_DATA;
//
// String attributes
//
#define LANG_RIGHT_TO_LEFT 0x00000001
//
// A string package is used to localize strings to a particular
// language. The package is associated with a particular driver
// or set of drivers. Tools are used to associate tokens with
// string references in forms and in programs. These tokens are
// language agnostic. When paired with a language pack (directly
// or indirectly), the string token resolves into an actual
// UNICODE string. The NumStringPointers determines how many
// StringPointers (offset values) there are as well as the total
// number of Strings that are defined.
//
typedef struct {
EFI_HII_PACK_HEADER Header;
RELOFST LanguageNameString;
RELOFST PrintableLanguageName;
UINT32 NumStringPointers;
UINT32 Attributes;
//
// RELOFST StringPointers[];
// EFI_STRING Strings[];
//
} EFI_HII_STRING_PACK;
//
// We use this one to get the real size of the header
//
typedef struct {
EFI_HII_PACK_HEADER Header;
RELOFST LanguageNameString;
RELOFST PrintableLanguageName;
UINT32 NumStringPointers;
UINT32 Attributes;
} EFI_HII_STRING_PACK_HEADER;
//
// Glyph Attributes
//
#define GLYPH_NON_SPACING 1
#define GLYPH_NON_BREAKING 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
// of glyph structures. Note that fonts are not language specific.
//
typedef struct {
EFI_HII_PACK_HEADER Header;
UINT16 NumberOfNarrowGlyphs;
UINT16 NumberOfWideGlyphs;
} EFI_HII_FONT_PACK;
//
// The IfrData in the EFI_HII_IFR_PACK structure definition
// is variable length, and not really part of the header. To
// simplify from code the size of the header, define an
// identical structure that does not include the IfrData field.
// Then use sizeof() this new structure to determine the
// actual size of the header.
//
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,
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?