Check In tool source code based on Build tool project revision r1655.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@8964 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
548
BaseTools/Source/C/Include/Protocol/DevicePath.h
Normal file
548
BaseTools/Source/C/Include/Protocol/DevicePath.h
Normal file
@@ -0,0 +1,548 @@
|
||||
/** @file
|
||||
The device path protocol as defined in UEFI 2.0.
|
||||
|
||||
The device path represents a programatic path to a device. It's the view
|
||||
from a software point of view. It also must persist from boot to boot, so
|
||||
it can not contain things like PCI bus numbers that change from boot to boot.
|
||||
|
||||
Copyright (c) 2006 - 2008, Intel Corporation All rights reserved.
|
||||
|
||||
This program and the accompanying materials are licensed and made available
|
||||
under the terms and conditions of the BSD License which accompanies this
|
||||
distribution. The full text of the license may be found at:
|
||||
http://opensource.org/licenses/bsd-license.php
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
File Name: DevicePath.h
|
||||
|
||||
**/
|
||||
|
||||
#ifndef __EFI_DEVICE_PATH_PROTOCOL_H__
|
||||
#define __EFI_DEVICE_PATH_PROTOCOL_H__
|
||||
|
||||
#include <Guid/PcAnsi.h>
|
||||
|
||||
//
|
||||
// Device Path protocol
|
||||
//
|
||||
#define EFI_DEVICE_PATH_PROTOCOL_GUID \
|
||||
{ \
|
||||
0x9576e91, 0x6d3f, 0x11d2, {0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b } \
|
||||
}
|
||||
|
||||
//
|
||||
// Protocol GUID defined in EFI1.1.
|
||||
//
|
||||
|
||||
//
|
||||
// Device Path information
|
||||
//
|
||||
#define DEVICE_PATH_PROTOCOL EFI_DEVICE_PATH_PROTOCOL_GUID
|
||||
|
||||
#pragma pack(1)
|
||||
|
||||
typedef struct {
|
||||
UINT8 Type;
|
||||
UINT8 SubType;
|
||||
UINT8 Length[2];
|
||||
} EFI_DEVICE_PATH_PROTOCOL;
|
||||
|
||||
//
|
||||
// For backward-compatible with EFI1.1.
|
||||
//
|
||||
typedef EFI_DEVICE_PATH_PROTOCOL EFI_DEVICE_PATH;
|
||||
|
||||
//
|
||||
// Hardware Device Paths
|
||||
//
|
||||
#define HARDWARE_DEVICE_PATH 0x01
|
||||
|
||||
#define HW_PCI_DP 0x01
|
||||
typedef struct {
|
||||
EFI_DEVICE_PATH_PROTOCOL Header;
|
||||
UINT8 Function;
|
||||
UINT8 Device;
|
||||
} PCI_DEVICE_PATH;
|
||||
|
||||
#define HW_PCCARD_DP 0x02
|
||||
typedef struct {
|
||||
EFI_DEVICE_PATH_PROTOCOL Header;
|
||||
UINT8 FunctionNumber;
|
||||
} PCCARD_DEVICE_PATH;
|
||||
|
||||
#define HW_MEMMAP_DP 0x03
|
||||
typedef struct {
|
||||
EFI_DEVICE_PATH_PROTOCOL Header;
|
||||
UINT32 MemoryType;
|
||||
EFI_PHYSICAL_ADDRESS StartingAddress;
|
||||
EFI_PHYSICAL_ADDRESS EndingAddress;
|
||||
} MEMMAP_DEVICE_PATH;
|
||||
|
||||
#define HW_VENDOR_DP 0x04
|
||||
typedef struct {
|
||||
EFI_DEVICE_PATH_PROTOCOL Header;
|
||||
EFI_GUID Guid;
|
||||
} VENDOR_DEVICE_PATH;
|
||||
|
||||
#define HW_CONTROLLER_DP 0x05
|
||||
typedef struct {
|
||||
EFI_DEVICE_PATH_PROTOCOL Header;
|
||||
UINT32 ControllerNumber;
|
||||
} CONTROLLER_DEVICE_PATH;
|
||||
|
||||
//
|
||||
// ACPI Device Paths
|
||||
//
|
||||
#define ACPI_DEVICE_PATH 0x02
|
||||
|
||||
#define ACPI_DP 0x01
|
||||
typedef struct {
|
||||
EFI_DEVICE_PATH_PROTOCOL Header;
|
||||
UINT32 HID;
|
||||
UINT32 UID;
|
||||
} ACPI_HID_DEVICE_PATH;
|
||||
|
||||
#define ACPI_EXTENDED_DP 0x02
|
||||
typedef struct {
|
||||
EFI_DEVICE_PATH_PROTOCOL Header;
|
||||
UINT32 HID;
|
||||
UINT32 UID;
|
||||
UINT32 CID;
|
||||
//
|
||||
// Optional variable length _HIDSTR
|
||||
// Optional variable length _UIDSTR
|
||||
//
|
||||
} ACPI_EXTENDED_HID_DEVICE_PATH;
|
||||
|
||||
//
|
||||
// EISA ID Macro
|
||||
// EISA ID Definition 32-bits
|
||||
// bits[15:0] - three character compressed ASCII EISA ID.
|
||||
// bits[31:16] - binary number
|
||||
// Compressed ASCII is 5 bits per character 0b00001 = 'A' 0b11010 = 'Z'
|
||||
//
|
||||
#define PNP_EISA_ID_CONST 0x41d0
|
||||
#define EISA_ID(_Name, _Num) ((UINT32) ((_Name) | (_Num) << 16))
|
||||
#define EISA_PNP_ID(_PNPId) (EISA_ID(PNP_EISA_ID_CONST, (_PNPId)))
|
||||
#define EFI_PNP_ID(_PNPId) (EISA_ID(PNP_EISA_ID_CONST, (_PNPId)))
|
||||
|
||||
#define PNP_EISA_ID_MASK 0xffff
|
||||
#define EISA_ID_TO_NUM(_Id) ((_Id) >> 16)
|
||||
|
||||
|
||||
#define ACPI_ADR_DP 0x03
|
||||
typedef struct {
|
||||
EFI_DEVICE_PATH_PROTOCOL Header;
|
||||
UINT32 ADR;
|
||||
} ACPI_ADR_DEVICE_PATH;
|
||||
|
||||
|
||||
//
|
||||
// Messaging Device Paths
|
||||
//
|
||||
#define MESSAGING_DEVICE_PATH 0x03
|
||||
|
||||
#define MSG_ATAPI_DP 0x01
|
||||
typedef struct {
|
||||
EFI_DEVICE_PATH_PROTOCOL Header;
|
||||
UINT8 PrimarySecondary;
|
||||
UINT8 SlaveMaster;
|
||||
UINT16 Lun;
|
||||
} ATAPI_DEVICE_PATH;
|
||||
|
||||
#define MSG_SCSI_DP 0x02
|
||||
typedef struct {
|
||||
EFI_DEVICE_PATH_PROTOCOL Header;
|
||||
UINT16 Pun;
|
||||
UINT16 Lun;
|
||||
} SCSI_DEVICE_PATH;
|
||||
|
||||
#define MSG_FIBRECHANNEL_DP 0x03
|
||||
typedef struct {
|
||||
EFI_DEVICE_PATH_PROTOCOL Header;
|
||||
UINT32 Reserved;
|
||||
UINT64 WWN;
|
||||
UINT64 Lun;
|
||||
} FIBRECHANNEL_DEVICE_PATH;
|
||||
|
||||
#define MSG_1394_DP 0x04
|
||||
typedef struct {
|
||||
EFI_DEVICE_PATH_PROTOCOL Header;
|
||||
UINT32 Reserved;
|
||||
UINT64 Guid;
|
||||
} F1394_DEVICE_PATH;
|
||||
|
||||
#define MSG_USB_DP 0x05
|
||||
typedef struct {
|
||||
EFI_DEVICE_PATH_PROTOCOL Header;
|
||||
UINT8 ParentPortNumber;
|
||||
UINT8 InterfaceNumber;
|
||||
} USB_DEVICE_PATH;
|
||||
|
||||
#define MSG_USB_CLASS_DP 0x0f
|
||||
typedef struct {
|
||||
EFI_DEVICE_PATH_PROTOCOL Header;
|
||||
UINT16 VendorId;
|
||||
UINT16 ProductId;
|
||||
UINT8 DeviceClass;
|
||||
UINT8 DeviceSubClass;
|
||||
UINT8 DeviceProtocol;
|
||||
} USB_CLASS_DEVICE_PATH;
|
||||
|
||||
#define MSG_USB_WWID_DP 0x10
|
||||
typedef struct {
|
||||
EFI_DEVICE_PATH_PROTOCOL Header;
|
||||
UINT16 InterfaceNumber;
|
||||
UINT16 VendorId;
|
||||
UINT16 ProductId;
|
||||
// CHAR16 SerialNumber[...];
|
||||
} USB_WWID_DEVICE_PATH;
|
||||
|
||||
|
||||
#define MSG_DEVICE_LOGICAL_UNIT_DP 0x11
|
||||
typedef struct {
|
||||
EFI_DEVICE_PATH_PROTOCOL Header;
|
||||
UINT8 Lun;
|
||||
} DEVICE_LOGICAL_UNIT_DEVICE_PATH;
|
||||
|
||||
#define MSG_SATA_DP 0x12
|
||||
typedef struct {
|
||||
EFI_DEVICE_PATH_PROTOCOL Header;
|
||||
UINT16 HBAPortNumber;
|
||||
UINT16 PortMultiplierPortNumber;
|
||||
UINT16 Lun;
|
||||
} SATA_DEVICE_PATH;
|
||||
|
||||
#define MSG_I2O_DP 0x06
|
||||
typedef struct {
|
||||
EFI_DEVICE_PATH_PROTOCOL Header;
|
||||
UINT32 Tid;
|
||||
} I2O_DEVICE_PATH;
|
||||
|
||||
#define MSG_MAC_ADDR_DP 0x0b
|
||||
typedef struct {
|
||||
EFI_DEVICE_PATH_PROTOCOL Header;
|
||||
EFI_MAC_ADDRESS MacAddress;
|
||||
UINT8 IfType;
|
||||
} MAC_ADDR_DEVICE_PATH;
|
||||
|
||||
#define MSG_IPv4_DP 0x0c
|
||||
typedef struct {
|
||||
EFI_DEVICE_PATH_PROTOCOL Header;
|
||||
EFI_IPv4_ADDRESS LocalIpAddress;
|
||||
EFI_IPv4_ADDRESS RemoteIpAddress;
|
||||
UINT16 LocalPort;
|
||||
UINT16 RemotePort;
|
||||
UINT16 Protocol;
|
||||
BOOLEAN StaticIpAddress;
|
||||
} IPv4_DEVICE_PATH;
|
||||
|
||||
#define MSG_IPv6_DP 0x0d
|
||||
typedef struct {
|
||||
EFI_DEVICE_PATH_PROTOCOL Header;
|
||||
EFI_IPv6_ADDRESS LocalIpAddress;
|
||||
EFI_IPv6_ADDRESS RemoteIpAddress;
|
||||
UINT16 LocalPort;
|
||||
UINT16 RemotePort;
|
||||
UINT16 Protocol;
|
||||
BOOLEAN StaticIpAddress;
|
||||
} IPv6_DEVICE_PATH;
|
||||
|
||||
#define MSG_INFINIBAND_DP 0x09
|
||||
typedef struct {
|
||||
EFI_DEVICE_PATH_PROTOCOL Header;
|
||||
UINT32 ResourceFlags;
|
||||
UINT8 PortGid[16];
|
||||
UINT64 ServiceId;
|
||||
UINT64 TargetPortId;
|
||||
UINT64 DeviceId;
|
||||
} INFINIBAND_DEVICE_PATH;
|
||||
|
||||
#define INFINIBAND_RESOURCE_FLAG_IOC_SERVICE 0x01
|
||||
#define INFINIBAND_RESOURCE_FLAG_EXTENDED_BOOT_ENVIRONMENT 0x02
|
||||
#define INFINIBAND_RESOURCE_FLAG_CONSOLE_PROTOCOL 0x04
|
||||
#define INFINIBAND_RESOURCE_FLAG_STORAGE_PROTOCOL 0x08
|
||||
#define INFINIBAND_RESOURCE_FLAG_NETWORK_PROTOCOL 0x10
|
||||
|
||||
#define MSG_UART_DP 0x0e
|
||||
typedef struct {
|
||||
EFI_DEVICE_PATH_PROTOCOL Header;
|
||||
UINT32 Reserved;
|
||||
UINT64 BaudRate;
|
||||
UINT8 DataBits;
|
||||
UINT8 Parity;
|
||||
UINT8 StopBits;
|
||||
} UART_DEVICE_PATH;
|
||||
|
||||
//
|
||||
// Use VENDOR_DEVICE_PATH struct
|
||||
//
|
||||
#define MSG_VENDOR_DP 0x0a
|
||||
typedef VENDOR_DEVICE_PATH VENDOR_DEFINED_DEVICE_PATH;
|
||||
|
||||
#define DEVICE_PATH_MESSAGING_PC_ANSI EFI_PC_ANSI_GUID
|
||||
#define DEVICE_PATH_MESSAGING_VT_100 EFI_VT_100_GUID
|
||||
#define DEVICE_PATH_MESSAGING_VT_100_PLUS EFI_VT_100_PLUS_GUID
|
||||
#define DEVICE_PATH_MESSAGING_VT_UTF8 EFI_VT_UTF8_GUID
|
||||
|
||||
#define DEVICE_PATH_MESSAGING_UART_FLOW_CONTROL EFI_UART_DEVICE_PATH_GUID
|
||||
|
||||
typedef struct {
|
||||
EFI_DEVICE_PATH_PROTOCOL Header;
|
||||
EFI_GUID Guid;
|
||||
UINT32 FlowControlMap;
|
||||
} UART_FLOW_CONTROL_DEVICE_PATH;
|
||||
|
||||
#define DEVICE_PATH_MESSAGING_SAS EFI_SAS_DEVICE_PATH_GUID
|
||||
|
||||
typedef struct {
|
||||
EFI_DEVICE_PATH_PROTOCOL Header;
|
||||
EFI_GUID Guid;
|
||||
UINT32 Reserved;
|
||||
UINT64 SasAddress;
|
||||
UINT64 Lun;
|
||||
UINT16 DeviceTopology;
|
||||
UINT16 RelativeTargetPort;
|
||||
} SAS_DEVICE_PATH;
|
||||
|
||||
#define MSG_ISCSI_DP 0x13
|
||||
typedef struct {
|
||||
EFI_DEVICE_PATH_PROTOCOL Header;
|
||||
UINT16 NetworkProtocol;
|
||||
UINT16 LoginOption;
|
||||
UINT64 Lun;
|
||||
UINT16 TargetPortalGroupTag;
|
||||
// CHAR8 iSCSI Target Name
|
||||
} ISCSI_DEVICE_PATH;
|
||||
|
||||
#define ISCSI_LOGIN_OPTION_NO_HEADER_DIGEST 0x0000
|
||||
#define ISCSI_LOGIN_OPTION_HEADER_DIGEST_USING_CRC32C 0x0002
|
||||
#define ISCSI_LOGIN_OPTION_NO_DATA_DIGEST 0x0000
|
||||
#define ISCSI_LOGIN_OPTION_DATA_DIGEST_USING_CRC32C 0x0008
|
||||
#define ISCSI_LOGIN_OPTION_AUTHMETHOD_CHAP 0x0000
|
||||
#define ISCSI_LOGIN_OPTION_AUTHMETHOD_NON 0x1000
|
||||
#define ISCSI_LOGIN_OPTION_CHAP_BI 0x0000
|
||||
#define ISCSI_LOGIN_OPTION_CHAP_UNI 0x2000
|
||||
|
||||
//
|
||||
// Media Device Path
|
||||
//
|
||||
#define MEDIA_DEVICE_PATH 0x04
|
||||
|
||||
#define MEDIA_HARDDRIVE_DP 0x01
|
||||
typedef struct {
|
||||
EFI_DEVICE_PATH_PROTOCOL Header;
|
||||
UINT32 PartitionNumber;
|
||||
UINT64 PartitionStart;
|
||||
UINT64 PartitionSize;
|
||||
UINT8 Signature[16];
|
||||
UINT8 MBRType;
|
||||
UINT8 SignatureType;
|
||||
} HARDDRIVE_DEVICE_PATH;
|
||||
|
||||
#define MBR_TYPE_PCAT 0x01
|
||||
#define MBR_TYPE_EFI_PARTITION_TABLE_HEADER 0x02
|
||||
|
||||
#define SIGNATURE_TYPE_MBR 0x01
|
||||
#define SIGNATURE_TYPE_GUID 0x02
|
||||
|
||||
#define MEDIA_CDROM_DP 0x02
|
||||
typedef struct {
|
||||
EFI_DEVICE_PATH_PROTOCOL Header;
|
||||
UINT32 BootEntry;
|
||||
UINT64 PartitionStart;
|
||||
UINT64 PartitionSize;
|
||||
} CDROM_DEVICE_PATH;
|
||||
|
||||
//
|
||||
// Use VENDOR_DEVICE_PATH struct
|
||||
//
|
||||
#define MEDIA_VENDOR_DP 0x03
|
||||
|
||||
#define MEDIA_FILEPATH_DP 0x04
|
||||
typedef struct {
|
||||
EFI_DEVICE_PATH_PROTOCOL Header;
|
||||
CHAR16 PathName[1];
|
||||
} FILEPATH_DEVICE_PATH;
|
||||
|
||||
#define SIZE_OF_FILEPATH_DEVICE_PATH EFI_FIELD_OFFSET(FILEPATH_DEVICE_PATH,PathName)
|
||||
|
||||
#define MEDIA_PROTOCOL_DP 0x05
|
||||
typedef struct {
|
||||
EFI_DEVICE_PATH_PROTOCOL Header;
|
||||
EFI_GUID Protocol;
|
||||
} MEDIA_PROTOCOL_DEVICE_PATH;
|
||||
|
||||
|
||||
#define MEDIA_PIWG_FW_VOL_DP 0x7
|
||||
typedef struct {
|
||||
EFI_DEVICE_PATH_PROTOCOL Header;
|
||||
EFI_GUID FvName;
|
||||
} MEDIA_FW_VOL_DEVICE_PATH;
|
||||
|
||||
|
||||
#define MEDIA_PIWG_FW_FILE_DP 0x6
|
||||
typedef struct {
|
||||
EFI_DEVICE_PATH_PROTOCOL Header;
|
||||
EFI_GUID FvFileName;
|
||||
} MEDIA_FW_VOL_FILEPATH_DEVICE_PATH;
|
||||
|
||||
//
|
||||
// BBS Device Path
|
||||
//
|
||||
#define BBS_DEVICE_PATH 0x05
|
||||
#define BBS_BBS_DP 0x01
|
||||
typedef struct {
|
||||
EFI_DEVICE_PATH_PROTOCOL Header;
|
||||
UINT16 DeviceType;
|
||||
UINT16 StatusFlag;
|
||||
CHAR8 String[1];
|
||||
} BBS_BBS_DEVICE_PATH;
|
||||
|
||||
//
|
||||
// DeviceType definitions - from BBS specification
|
||||
//
|
||||
#define BBS_TYPE_FLOPPY 0x01
|
||||
#define BBS_TYPE_HARDDRIVE 0x02
|
||||
#define BBS_TYPE_CDROM 0x03
|
||||
#define BBS_TYPE_PCMCIA 0x04
|
||||
#define BBS_TYPE_USB 0x05
|
||||
#define BBS_TYPE_EMBEDDED_NETWORK 0x06
|
||||
#define BBS_TYPE_BEV 0x80
|
||||
#define BBS_TYPE_UNKNOWN 0xFF
|
||||
|
||||
|
||||
//
|
||||
// Union of all possible Device Paths and pointers to Device Paths
|
||||
//
|
||||
|
||||
typedef union {
|
||||
EFI_DEVICE_PATH_PROTOCOL DevPath;
|
||||
PCI_DEVICE_PATH Pci;
|
||||
PCCARD_DEVICE_PATH PcCard;
|
||||
MEMMAP_DEVICE_PATH MemMap;
|
||||
VENDOR_DEVICE_PATH Vendor;
|
||||
|
||||
CONTROLLER_DEVICE_PATH Controller;
|
||||
ACPI_HID_DEVICE_PATH Acpi;
|
||||
|
||||
ATAPI_DEVICE_PATH Atapi;
|
||||
SCSI_DEVICE_PATH Scsi;
|
||||
ISCSI_DEVICE_PATH Iscsi;
|
||||
FIBRECHANNEL_DEVICE_PATH FibreChannel;
|
||||
|
||||
F1394_DEVICE_PATH F1394;
|
||||
USB_DEVICE_PATH Usb;
|
||||
SATA_DEVICE_PATH Sata;
|
||||
USB_CLASS_DEVICE_PATH UsbClass;
|
||||
I2O_DEVICE_PATH I2O;
|
||||
MAC_ADDR_DEVICE_PATH MacAddr;
|
||||
IPv4_DEVICE_PATH Ipv4;
|
||||
IPv6_DEVICE_PATH Ipv6;
|
||||
INFINIBAND_DEVICE_PATH InfiniBand;
|
||||
UART_DEVICE_PATH Uart;
|
||||
|
||||
HARDDRIVE_DEVICE_PATH HardDrive;
|
||||
CDROM_DEVICE_PATH CD;
|
||||
|
||||
FILEPATH_DEVICE_PATH FilePath;
|
||||
MEDIA_PROTOCOL_DEVICE_PATH MediaProtocol;
|
||||
|
||||
BBS_BBS_DEVICE_PATH Bbs;
|
||||
} EFI_DEV_PATH;
|
||||
|
||||
|
||||
|
||||
typedef union {
|
||||
EFI_DEVICE_PATH_PROTOCOL *DevPath;
|
||||
PCI_DEVICE_PATH *Pci;
|
||||
PCCARD_DEVICE_PATH *PcCard;
|
||||
MEMMAP_DEVICE_PATH *MemMap;
|
||||
VENDOR_DEVICE_PATH *Vendor;
|
||||
|
||||
CONTROLLER_DEVICE_PATH *Controller;
|
||||
ACPI_HID_DEVICE_PATH *Acpi;
|
||||
ACPI_EXTENDED_HID_DEVICE_PATH *ExtendedAcpi;
|
||||
|
||||
ATAPI_DEVICE_PATH *Atapi;
|
||||
SCSI_DEVICE_PATH *Scsi;
|
||||
FIBRECHANNEL_DEVICE_PATH *FibreChannel;
|
||||
|
||||
F1394_DEVICE_PATH *F1394;
|
||||
USB_DEVICE_PATH *Usb;
|
||||
SATA_DEVICE_PATH *Sata;
|
||||
USB_CLASS_DEVICE_PATH *UsbClass;
|
||||
I2O_DEVICE_PATH *I2O;
|
||||
MAC_ADDR_DEVICE_PATH *MacAddr;
|
||||
IPv4_DEVICE_PATH *Ipv4;
|
||||
IPv6_DEVICE_PATH *Ipv6;
|
||||
INFINIBAND_DEVICE_PATH *InfiniBand;
|
||||
UART_DEVICE_PATH *Uart;
|
||||
|
||||
HARDDRIVE_DEVICE_PATH *HardDrive;
|
||||
CDROM_DEVICE_PATH *CD;
|
||||
|
||||
FILEPATH_DEVICE_PATH *FilePath;
|
||||
MEDIA_PROTOCOL_DEVICE_PATH *MediaProtocol;
|
||||
|
||||
BBS_BBS_DEVICE_PATH *Bbs;
|
||||
UINT8 *Raw;
|
||||
} EFI_DEV_PATH_PTR;
|
||||
|
||||
#pragma pack()
|
||||
|
||||
#define EFI_DP_TYPE_MASK 0x7F
|
||||
#define EFI_DP_TYPE_UNPACKED 0x80
|
||||
#define END_DEVICE_PATH_TYPE 0x7f
|
||||
|
||||
#define EFI_END_ENTIRE_DEVICE_PATH 0xff
|
||||
#define EFI_END_ENTIRE_DEVICE_PATH_SUBTYPE 0xff
|
||||
#define EFI_END_INSTANCE_DEVICE_PATH 0x01
|
||||
#define END_ENTIRE_DEVICE_PATH_SUBTYPE EFI_END_ENTIRE_DEVICE_PATH_SUBTYPE
|
||||
#define END_INSTANCE_DEVICE_PATH_SUBTYPE EFI_END_INSTANCE_DEVICE_PATH
|
||||
|
||||
#define EFI_END_DEVICE_PATH_LENGTH (sizeof (EFI_DEVICE_PATH_PROTOCOL))
|
||||
#define END_DEVICE_PATH_LENGTH EFI_END_DEVICE_PATH_LENGTH
|
||||
|
||||
#define DP_IS_END_TYPE(a)
|
||||
#define DP_IS_END_SUBTYPE(a) (((a)->SubType == END_ENTIRE_DEVICE_PATH_SUBTYPE)
|
||||
#define DevicePathSubType(a) ((a)->SubType)
|
||||
#define IsDevicePathUnpacked(a) ((a)->Type & EFI_DP_TYPE_UNPACKED)
|
||||
|
||||
#define EfiDevicePathNodeLength(a) (((a)->Length[0]) | ((a)->Length[1] << 8))
|
||||
#define DevicePathNodeLength(a) (EfiDevicePathNodeLength(a))
|
||||
#define EfiNextDevicePathNode(a) ((EFI_DEVICE_PATH_PROTOCOL *) (((UINT8 *) (a)) + EfiDevicePathNodeLength (a)))
|
||||
#define NextDevicePathNode(a) (EfiNextDevicePathNode(a))
|
||||
|
||||
#define EfiDevicePathType(a) (((a)->Type) & EFI_DP_TYPE_MASK)
|
||||
#define DevicePathType(a) (EfiDevicePathType(a))
|
||||
#define EfiIsDevicePathEndType(a) (EfiDevicePathType (a) == END_DEVICE_PATH_TYPE)
|
||||
#define IsDevicePathEndType(a) (EfiIsDevicePathEndType(a))
|
||||
|
||||
|
||||
#define EfiIsDevicePathEndSubType(a) ((a)->SubType == EFI_END_ENTIRE_DEVICE_PATH_SUBTYPE)
|
||||
#define IsDevicePathEndSubType(a) (EfiIsDevicePathEndSubType(a))
|
||||
#define EfiIsDevicePathEndInstanceSubType(a) ((a)->SubType == EFI_END_INSTANCE_DEVICE_PATH)
|
||||
|
||||
#define EfiIsDevicePathEnd(a) (EfiIsDevicePathEndType (a) && EfiIsDevicePathEndSubType (a))
|
||||
#define IsDevicePathEnd(a) (EfiIsDevicePathEnd(a))
|
||||
#define EfiIsDevicePathEndInstance(a) (EfiIsDevicePathEndType (a) && EfiIsDevicePathEndInstanceSubType (a))
|
||||
|
||||
|
||||
#define SetDevicePathNodeLength(a,l) { \
|
||||
(a)->Length[0] = (UINT8) (l); \
|
||||
(a)->Length[1] = (UINT8) ((l) >> 8); \
|
||||
}
|
||||
|
||||
#define SetDevicePathEndNode(a) { \
|
||||
(a)->Type = END_DEVICE_PATH_TYPE; \
|
||||
(a)->SubType = END_ENTIRE_DEVICE_PATH_SUBTYPE; \
|
||||
(a)->Length[0] = sizeof(EFI_DEVICE_PATH_PROTOCOL); \
|
||||
(a)->Length[1] = 0; \
|
||||
}
|
||||
|
||||
extern EFI_GUID gEfiDevicePathProtocolGuid;
|
||||
|
||||
#endif
|
195
BaseTools/Source/C/Include/Protocol/GraphicsOutput.h
Normal file
195
BaseTools/Source/C/Include/Protocol/GraphicsOutput.h
Normal file
@@ -0,0 +1,195 @@
|
||||
/** @file
|
||||
Graphics Output Protocol from the UEFI 2.0 specification.
|
||||
|
||||
Abstraction of a very simple graphics device.
|
||||
|
||||
Copyright (c) 2006 - 2008, Intel Corporation All rights reserved.
|
||||
|
||||
This program and the accompanying materials are licensed and made available
|
||||
under the terms and conditions of the BSD License which accompanies this
|
||||
distribution. The full text of the license may be found at:
|
||||
http://opensource.org/licenses/bsd-license.php
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
File Name: GraphicsOutput.h
|
||||
|
||||
**/
|
||||
|
||||
#ifndef __GRAPHICS_OUTPUT_H__
|
||||
#define __GRAPHICS_OUTPUT_H__
|
||||
|
||||
#define EFI_GRAPHICS_OUTPUT_PROTOCOL_GUID \
|
||||
{ \
|
||||
0x9042a9de, 0x23dc, 0x4a38, {0x96, 0xfb, 0x7a, 0xde, 0xd0, 0x80, 0x51, 0x6a } \
|
||||
}
|
||||
|
||||
typedef struct _EFI_GRAPHICS_OUTPUT_PROTOCOL EFI_GRAPHICS_OUTPUT_PROTOCOL;
|
||||
|
||||
typedef struct {
|
||||
UINT32 RedMask;
|
||||
UINT32 GreenMask;
|
||||
UINT32 BlueMask;
|
||||
UINT32 ReservedMask;
|
||||
} EFI_PIXEL_BITMASK;
|
||||
|
||||
typedef enum {
|
||||
PixelRedGreenBlueReserved8BitPerColor,
|
||||
PixelBlueGreenRedReserved8BitPerColor,
|
||||
PixelBitMask,
|
||||
PixelBltOnly,
|
||||
PixelFormatMax
|
||||
} EFI_GRAPHICS_PIXEL_FORMAT;
|
||||
|
||||
typedef struct {
|
||||
UINT32 Version;
|
||||
UINT32 HorizontalResolution;
|
||||
UINT32 VerticalResolution;
|
||||
EFI_GRAPHICS_PIXEL_FORMAT PixelFormat;
|
||||
EFI_PIXEL_BITMASK PixelInformation;
|
||||
UINT32 PixelsPerScanLine;
|
||||
} EFI_GRAPHICS_OUTPUT_MODE_INFORMATION;
|
||||
|
||||
/**
|
||||
Return the current video mode information.
|
||||
|
||||
@param This Protocol instance pointer.
|
||||
@param ModeNumber The mode number to return information on.
|
||||
@param SizeOfInfo A pointer to the size, in bytes, of the Info buffer.
|
||||
@param Info A pointer to callee allocated buffer that returns information about ModeNumber.
|
||||
|
||||
@retval EFI_SUCCESS Mode information returned.
|
||||
@retval EFI_BUFFER_TOO_SMALL The Info buffer was too small.
|
||||
@retval EFI_DEVICE_ERROR A hardware error occurred trying to retrieve the video mode.
|
||||
@retval EFI_NOT_STARTED Video display is not initialized. Call SetMode ()
|
||||
@retval EFI_INVALID_PARAMETER One of the input args was NULL.
|
||||
|
||||
**/
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_GRAPHICS_OUTPUT_PROTOCOL_QUERY_MODE) (
|
||||
IN EFI_GRAPHICS_OUTPUT_PROTOCOL *This,
|
||||
IN UINT32 ModeNumber,
|
||||
OUT UINTN *SizeOfInfo,
|
||||
OUT EFI_GRAPHICS_OUTPUT_MODE_INFORMATION **Info
|
||||
)
|
||||
;
|
||||
|
||||
/**
|
||||
Return the current video mode information.
|
||||
|
||||
@param This Protocol instance pointer.
|
||||
@param ModeNumber The mode number to be set.
|
||||
|
||||
@retval EFI_SUCCESS Graphics mode was changed.
|
||||
@retval EFI_DEVICE_ERROR The device had an error and could not complete the request.
|
||||
@retval EFI_UNSUPPORTED ModeNumber is not supported by this device.
|
||||
|
||||
**/
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_GRAPHICS_OUTPUT_PROTOCOL_SET_MODE) (
|
||||
IN EFI_GRAPHICS_OUTPUT_PROTOCOL *This,
|
||||
IN UINT32 ModeNumber
|
||||
)
|
||||
;
|
||||
|
||||
typedef struct {
|
||||
UINT8 Blue;
|
||||
UINT8 Green;
|
||||
UINT8 Red;
|
||||
UINT8 Reserved;
|
||||
} EFI_GRAPHICS_OUTPUT_BLT_PIXEL;
|
||||
|
||||
typedef union {
|
||||
EFI_GRAPHICS_OUTPUT_BLT_PIXEL Pixel;
|
||||
UINT32 Raw;
|
||||
} EFI_GRAPHICS_OUTPUT_BLT_PIXEL_UNION;
|
||||
|
||||
typedef enum {
|
||||
EfiBltVideoFill,
|
||||
EfiBltVideoToBltBuffer,
|
||||
EfiBltBufferToVideo,
|
||||
EfiBltVideoToVideo,
|
||||
EfiGraphicsOutputBltOperationMax
|
||||
} EFI_GRAPHICS_OUTPUT_BLT_OPERATION;
|
||||
|
||||
/**
|
||||
The following table defines actions for BltOperations:
|
||||
|
||||
<B>EfiBltVideoFill</B> - Write data from the BltBuffer pixel (SourceX, SourceY)
|
||||
directly to every pixel of the video display rectangle
|
||||
(DestinationX, DestinationY) (DestinationX + Width, DestinationY + Height).
|
||||
Only one pixel will be used from the BltBuffer. Delta is NOT used.
|
||||
|
||||
<B>EfiBltVideoToBltBuffer</B> - Read data from the video display rectangle
|
||||
(SourceX, SourceY) (SourceX + Width, SourceY + Height) and place it in
|
||||
the BltBuffer rectangle (DestinationX, DestinationY )
|
||||
(DestinationX + Width, DestinationY + Height). If DestinationX or
|
||||
DestinationY is not zero then Delta must be set to the length in bytes
|
||||
of a row in the BltBuffer.
|
||||
|
||||
<B>EfiBltBufferToVideo</B> - Write data from the BltBuffer rectangle
|
||||
(SourceX, SourceY) (SourceX + Width, SourceY + Height) directly to the
|
||||
video display rectangle (DestinationX, DestinationY)
|
||||
(DestinationX + Width, DestinationY + Height). If SourceX or SourceY is
|
||||
not zero then Delta must be set to the length in bytes of a row in the
|
||||
BltBuffer.
|
||||
|
||||
<B>EfiBltVideoToVideo</B> - Copy from the video display rectangle (SourceX, SourceY)
|
||||
(SourceX + Width, SourceY + Height) .to the video display rectangle
|
||||
(DestinationX, DestinationY) (DestinationX + Width, DestinationY + Height).
|
||||
The BltBuffer and Delta are not used in this mode.
|
||||
|
||||
@param This Protocol instance pointer.
|
||||
@param BltBuffer Buffer containing data to blit into video buffer. This
|
||||
buffer has a size of Width*Height*sizeof(EFI_GRAPHICS_OUTPUT_BLT_PIXEL)
|
||||
@param BltOperation Operation to perform on BlitBuffer and video memory
|
||||
@param SourceX X coordinate of source for the BltBuffer.
|
||||
@param SourceY Y coordinate of source for the BltBuffer.
|
||||
@param DestinationX X coordinate of destination for the BltBuffer.
|
||||
@param DestinationY Y coordinate of destination for the BltBuffer.
|
||||
@param Width Width of rectangle in BltBuffer in pixels.
|
||||
@param Height Hight of rectangle in BltBuffer in pixels.
|
||||
@param Delta OPTIONAL
|
||||
|
||||
@retval EFI_SUCCESS The Blt operation completed.
|
||||
@retval EFI_INVALID_PARAMETER BltOperation is not valid.
|
||||
@retval EFI_DEVICE_ERROR A hardware error occured writting to the video buffer.
|
||||
|
||||
**/
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_GRAPHICS_OUTPUT_PROTOCOL_BLT) (
|
||||
IN EFI_GRAPHICS_OUTPUT_PROTOCOL *This,
|
||||
IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL *BltBuffer, OPTIONAL
|
||||
IN EFI_GRAPHICS_OUTPUT_BLT_OPERATION BltOperation,
|
||||
IN UINTN SourceX,
|
||||
IN UINTN SourceY,
|
||||
IN UINTN DestinationX,
|
||||
IN UINTN DestinationY,
|
||||
IN UINTN Width,
|
||||
IN UINTN Height,
|
||||
IN UINTN Delta OPTIONAL
|
||||
);
|
||||
|
||||
typedef struct {
|
||||
UINT32 MaxMode;
|
||||
UINT32 Mode;
|
||||
EFI_GRAPHICS_OUTPUT_MODE_INFORMATION *Info;
|
||||
UINTN SizeOfInfo;
|
||||
EFI_PHYSICAL_ADDRESS FrameBufferBase;
|
||||
UINTN FrameBufferSize;
|
||||
} EFI_GRAPHICS_OUTPUT_PROTOCOL_MODE;
|
||||
|
||||
struct _EFI_GRAPHICS_OUTPUT_PROTOCOL {
|
||||
EFI_GRAPHICS_OUTPUT_PROTOCOL_QUERY_MODE QueryMode;
|
||||
EFI_GRAPHICS_OUTPUT_PROTOCOL_SET_MODE SetMode;
|
||||
EFI_GRAPHICS_OUTPUT_PROTOCOL_BLT Blt;
|
||||
EFI_GRAPHICS_OUTPUT_PROTOCOL_MODE *Mode;
|
||||
};
|
||||
|
||||
extern EFI_GUID gEfiGraphicsOutputProtocolGuid;
|
||||
|
||||
#endif
|
153
BaseTools/Source/C/Include/Protocol/GuidedSectionExtraction.h
Normal file
153
BaseTools/Source/C/Include/Protocol/GuidedSectionExtraction.h
Normal file
@@ -0,0 +1,153 @@
|
||||
/** @file
|
||||
This file declares GUIDed section extraction protocol.
|
||||
|
||||
This interface provides a means of decoding a GUID defined encapsulation
|
||||
section. There may be multiple different GUIDs associated with the GUIDed
|
||||
section extraction protocol. That is, all instances of the GUIDed section
|
||||
extraction protocol must have the same interface structure.
|
||||
|
||||
Copyright (c) 2006 - 2008, Intel Corporation All rights reserved.
|
||||
|
||||
This program and the accompanying materials are licensed and made available
|
||||
under the terms and conditions of the BSD License which accompanies this
|
||||
distribution. The full text of the license may be found at:
|
||||
http://opensource.org/licenses/bsd-license.php
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
File Name: EfiGuidedSectionExtraction.h
|
||||
|
||||
@par Revision Reference: PI
|
||||
Version 1.00.
|
||||
|
||||
**/
|
||||
|
||||
#ifndef __EFI_GUIDED_SECTION_EXTRACTION_PROTOCOL_H__
|
||||
#define __EFI_GUIDED_SECTION_EXTRACTION_PROTOCOL_H__
|
||||
|
||||
//
|
||||
// Forward reference for pure ANSI compatability
|
||||
|
||||
typedef struct _EFI_GUIDED_SECTION_EXTRACTION_PROTOCOL EFI_GUIDED_SECTION_EXTRACTION_PROTOCOL;
|
||||
|
||||
|
||||
/**
|
||||
The ExtractSection() function processes the input section and
|
||||
allocates a buffer from the pool in which it returns the section
|
||||
contents. If the section being extracted contains
|
||||
authentication information (the section's
|
||||
GuidedSectionHeader.Attributes field has the
|
||||
EFI_GUIDED_SECTION_AUTH_STATUS_VALID bit set), the values
|
||||
returned in AuthenticationStatus must reflect the results of
|
||||
the authentication operation. Depending on the algorithm and
|
||||
size of the encapsulated data, the time that is required to do
|
||||
a full authentication may be prohibitively long for some
|
||||
classes of systems. To indicate this, use
|
||||
EFI_SECURITY_POLICY_PROTOCOL_GUID, which may be published by
|
||||
the security policy driver (see the Platform Initialization
|
||||
Driver Execution Environment Core Interface Specification for
|
||||
more details and the GUID definition). If the
|
||||
EFI_SECURITY_POLICY_PROTOCOL_GUID exists in the handle
|
||||
database, then, if possible, full authentication should be
|
||||
skipped and the section contents simply returned in the
|
||||
OutputBuffer. In this case, the
|
||||
EFI_AUTH_STATUS_PLATFORM_OVERRIDE bit AuthenticationStatus
|
||||
must be set on return. ExtractSection() is callable only from
|
||||
TPL_NOTIFY and below. Behavior of ExtractSection() at any
|
||||
EFI_TPL above TPL_NOTIFY is undefined. Type EFI_TPL is
|
||||
defined in RaiseTPL() in the UEFI 2.0 specification.
|
||||
|
||||
|
||||
@param This Indicates the
|
||||
EFI_GUIDED_SECTION_EXTRACTION_PROTOCOL instance.
|
||||
|
||||
@param InputSection Buffer containing the input GUIDed section
|
||||
to be processed. OutputBuffer OutputBuffer
|
||||
is allocated from boot services pool
|
||||
memory and contains the new section
|
||||
stream. The caller is responsible for
|
||||
freeing this buffer.
|
||||
|
||||
@param OutputSize A pointer to a caller-allocated UINTN in
|
||||
which the size of OutputBuffer allocation
|
||||
is stored. If the function returns
|
||||
anything other than EFI_SUCCESS, the value
|
||||
of OutputSize is undefined.
|
||||
|
||||
@param AuthenticationStatus A pointer to a caller-allocated
|
||||
UINT32 that indicates the
|
||||
authentication status of the
|
||||
output buffer. If the input
|
||||
section's
|
||||
GuidedSectionHeader.Attributes
|
||||
field has the
|
||||
EFI_GUIDED_SECTION_AUTH_STATUS_VAL
|
||||
bit as clear, AuthenticationStatus
|
||||
must return zero. Both local bits
|
||||
(19:16) and aggregate bits (3:0)
|
||||
in AuthenticationStatus are
|
||||
returned by ExtractSection().
|
||||
These bits reflect the status of
|
||||
the extraction operation. The bit
|
||||
pattern in both regions must be
|
||||
the same, as the local and
|
||||
aggregate authentication statuses
|
||||
have equivalent meaning at this
|
||||
level. If the function returns
|
||||
anything other than EFI_SUCCESS,
|
||||
the value of AuthenticationStatus
|
||||
is undefined.
|
||||
|
||||
|
||||
@retval EFI_SUCCESS The InputSection was successfully
|
||||
processed and the section contents were
|
||||
returned.
|
||||
|
||||
@retval EFI_OUT_OF_RESOURCES The system has insufficient
|
||||
resources to process the
|
||||
request.
|
||||
|
||||
@retval EFI_INVALID_PARAMETER The GUID in InputSection does
|
||||
not match this instance of the
|
||||
GUIDed Section Extraction
|
||||
Protocol.
|
||||
|
||||
**/
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_EXTRACT_GUIDED_SECTION)(
|
||||
IN CONST EFI_GUIDED_SECTION_EXTRACTION_PROTOCOL *This,
|
||||
IN CONST VOID *InputSection,
|
||||
OUT VOID **OutputBuffer,
|
||||
OUT UINTN *OutputSize,
|
||||
OUT UINT32 *AuthenticationStatus
|
||||
);
|
||||
|
||||
|
||||
/**
|
||||
|
||||
Takes the GUIDed section as input and produces the section
|
||||
stream data. See the ExtractSection() function description.
|
||||
|
||||
**/
|
||||
struct _EFI_GUIDED_SECTION_EXTRACTION_PROTOCOL {
|
||||
EFI_EXTRACT_GUIDED_SECTION ExtractSection;
|
||||
};
|
||||
|
||||
//
|
||||
// Protocol GUID definition. Each GUIDed section extraction protocol has the
|
||||
// same interface but with different GUID. All the GUIDs is defined here.
|
||||
// May add multiple GUIDs here.
|
||||
//
|
||||
#define EFI_CRC32_GUIDED_SECTION_EXTRACTION_PROTOCOL_GUID \
|
||||
{ \
|
||||
0xFC1BCDB0, 0x7D31, 0x49aa, {0x93, 0x6A, 0xA4, 0x60, 0x0D, 0x9D, 0xD0, 0x83 } \
|
||||
}
|
||||
|
||||
//
|
||||
// may add other GUID here
|
||||
//
|
||||
extern EFI_GUID gEfiCrc32GuidedSectionExtractionProtocolGuid;
|
||||
|
||||
#endif
|
952
BaseTools/Source/C/Include/Protocol/HiiFramework.h
Normal file
952
BaseTools/Source/C/Include/Protocol/HiiFramework.h
Normal file
@@ -0,0 +1,952 @@
|
||||
/** @file
|
||||
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.
|
||||
|
||||
Copyright (c) 2007, Intel Corporation All rights reserved.
|
||||
|
||||
This program and the accompanying materials are licensed and made available
|
||||
under the terms and conditions of the BSD License which accompanies this
|
||||
distribution. The full text of the license may be found at:
|
||||
http://opensource.org/licenses/bsd-license.php
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
File Name: HiiFramework.h
|
||||
|
||||
@par Revision Reference:
|
||||
This protocol is defined in HII spec 0.92.
|
||||
|
||||
**/
|
||||
|
||||
#ifndef _FRAMEWORK_HII_H_
|
||||
#define _FRAMEWORK_HII_H_
|
||||
|
||||
//#include <PiDxe.h>
|
||||
|
||||
//
|
||||
// To get EFI_GRAPHICS_OUTPUT_BLT_PIXEL,
|
||||
// is defined in MdePkg/Protocol/GraphicsOutput.h
|
||||
//
|
||||
#include <Protocol/GraphicsOutput.h>
|
||||
|
||||
#define EFI_HII_PROTOCOL_GUID \
|
||||
{ \
|
||||
0xd7ad636e, 0xb997, 0x459b, {0xbf, 0x3f, 0x88, 0x46, 0x89, 0x79, 0x80, 0xe1} \
|
||||
}
|
||||
|
||||
// BugBug:
|
||||
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
// If UGA goes away we need to put this some place. I'm not sure where?
|
||||
//
|
||||
//typedef struct {
|
||||
// UINT8 Blue;
|
||||
// UINT8 Green;
|
||||
// UINT8 Red;
|
||||
// UINT8 Reserved;
|
||||
//} EFI_UGA_PIXEL;
|
||||
|
||||
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
//
|
||||
|
||||
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
|
||||
|
||||
|
||||
// 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:
|
||||
// EFI_FROM_ID has been defined in UEFI spec.
|
||||
//
|
||||
typedef UINT16 EFI_FORM_LABEL;
|
||||
|
||||
#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 {
|
||||
UINT32 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
|
||||
UINT16 FormValue; // specify which form is to be updated if FormUpdate value is TRUE.
|
||||
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;
|
||||
|
||||
//
|
||||
// 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
|
||||
// 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,
|
||||
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;
|
||||
CHAR16 ShiftedUnicode;
|
||||
CHAR16 AltGrUnicode;
|
||||
CHAR16 ShiftedAltGrUnicode;
|
||||
UINT16 Modifier;
|
||||
} EFI_KEY_DESCRIPTOR;
|
||||
|
||||
//
|
||||
// This structure allows a sparse set of keys to be redefined
|
||||
// or a complete redefinition of the keyboard layout. Most
|
||||
// keyboards have a lot of commonality in their layouts, therefore
|
||||
// only defining those keys that need to change from the default
|
||||
// minimizes the passed in information.
|
||||
//
|
||||
// Additionally, when an update occurs, the active keyboard layout
|
||||
// will be switched to the newly updated keyboard layout. This
|
||||
// allows for situations that when a keyboard layout driver is
|
||||
// loaded as part of system initialization, the system will default
|
||||
// the keyboard behavior to the new layout.
|
||||
//
|
||||
// Each call to update the keyboard mapping should contain the
|
||||
// complete set of key descriptors to be updated, since every
|
||||
// call to the HII which contains an EFI_HII_KEYBOARD_PACK will
|
||||
// wipe the previous set of overrides. A call to
|
||||
//
|
||||
typedef struct {
|
||||
EFI_HII_PACK_HEADER Header;
|
||||
EFI_KEY_DESCRIPTOR *Descriptor;
|
||||
UINT8 DescriptorCount;
|
||||
} EFI_HII_KEYBOARD_PACK;
|
||||
|
||||
//
|
||||
// The EFI_HII_PACKAGES can contain different types of packages just
|
||||
// after the structure as inline data.
|
||||
//
|
||||
typedef struct {
|
||||
UINTN NumberOfPackages;
|
||||
EFI_GUID *GuidId;
|
||||
//
|
||||
// EFI_HII_HANDLE_PACK *HandlePack; // Only one pack.
|
||||
// EFI_HII_IFR_PACK *IfrPack; // Only one pack.
|
||||
// EFI_HII_FONT_PACK *FontPack[]; // Multiple packs ok
|
||||
// EFI_HII_STRING_PACK *StringPack[]; // Multiple packs ok
|
||||
// EFI_HII_KEYBOARD_PACK *KeyboardPack[]; // Multiple packs ok
|
||||
//
|
||||
} EFI_HII_PACKAGES;
|
||||
|
||||
typedef struct _EFI_HII_VARIABLE_PACK_LIST {
|
||||
struct _EFI_HII_VARIABLE_PACK_LIST *NextVariablePack;
|
||||
EFI_HII_VARIABLE_PACK *VariablePack;
|
||||
} EFI_HII_VARIABLE_PACK_LIST;
|
||||
|
||||
|
||||
#pragma pack()
|
||||
|
||||
/**
|
||||
Registers the various packs that are passed in via the Packages parameter.
|
||||
|
||||
@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.
|
||||
|
||||
@retval EFI_SUCCESS Data was extracted from Packages, the database
|
||||
was updated with the data, and Handle returned successfully.
|
||||
@retval EFI_INVALID_PARAMETER The content of Packages was invalid.
|
||||
|
||||
**/
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_HII_NEW_PACK) (
|
||||
IN EFI_HII_PROTOCOL *This,
|
||||
IN EFI_HII_PACKAGES *Packages,
|
||||
OUT EFI_HII_HANDLE *Handle
|
||||
);
|
||||
|
||||
/**
|
||||
Removes a package from the HII database.
|
||||
|
||||
@param This A pointer to the EFI_HII_PROTOCOL instance.
|
||||
@param Handle The handle that was registered to the data that is requested
|
||||
for removal.
|
||||
|
||||
@retval EFI_SUCCESS The data associated with the Handle was removed
|
||||
from the HII database.
|
||||
@retval EFI_INVALID_PARAMETER The Handle was not valid.
|
||||
|
||||
**/
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_HII_REMOVE_PACK) (
|
||||
IN EFI_HII_PROTOCOL *This,
|
||||
IN EFI_HII_HANDLE Handle
|
||||
);
|
||||
|
||||
/**
|
||||
Determines the handles that are currently active in the database.
|
||||
|
||||
@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 An array of EFI_HII_HANDLE instances returned.
|
||||
|
||||
@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.
|
||||
|
||||
**/
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_HII_FIND_HANDLES) (
|
||||
IN EFI_HII_PROTOCOL *This,
|
||||
IN OUT UINT16 *HandleBufferLength,
|
||||
OUT 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
|
||||
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.
|
||||
@param BufferSize
|
||||
On input, a pointer to the length of the buffer. On output, the length
|
||||
of the buffer that is required for the export data.
|
||||
@param Buffer A pointer to a buffer that will contain the results of the export function.
|
||||
|
||||
@retval EFI_SUCCESS The buffer was successfully filled with BufferSize amount of data.
|
||||
@retval EFI_BUFFER_TOO_SMALL The value in BufferSize was too small to contain the export data.
|
||||
|
||||
**/
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_HII_EXPORT) (
|
||||
IN EFI_HII_PROTOCOL *This,
|
||||
IN EFI_HII_HANDLE Handle,
|
||||
IN OUT UINTN *BufferSize,
|
||||
OUT VOID *Buffer
|
||||
);
|
||||
|
||||
/**
|
||||
Remove any new strings that were added after the initial string export
|
||||
for this handle.
|
||||
|
||||
@param This A pointer to the EFI_HII_PROTOCOL instance.
|
||||
@param Handle The handle on which the string resides.
|
||||
|
||||
@retval EFI_SUCCESS Remove strings from the handle successfully.
|
||||
@retval EFI_INVALID_PARAMETER The Handle was unknown.
|
||||
|
||||
**/
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_HII_RESET_STRINGS) (
|
||||
IN EFI_HII_PROTOCOL *This,
|
||||
IN EFI_HII_HANDLE Handle
|
||||
);
|
||||
|
||||
/**
|
||||
Tests if all of the characters in a string have corresponding font characters.
|
||||
|
||||
@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's glyph equivalent.
|
||||
|
||||
@retval EFI_SUCCESS All glyphs are available. Note that an empty string
|
||||
always returns this value.
|
||||
@retval EFI_NOT_FOUND A glyph was not found for a character.
|
||||
|
||||
**/
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_HII_TEST_STRING) (
|
||||
IN EFI_HII_PROTOCOL *This,
|
||||
IN CHAR16 *StringToTest,
|
||||
IN OUT UINT32 *FirstMissing,
|
||||
OUT UINT32 *GlyphBufferSize
|
||||
);
|
||||
|
||||
/**
|
||||
Translates a Unicode character into the corresponding font glyph.
|
||||
|
||||
@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 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.
|
||||
|
||||
**/
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_HII_GET_GLYPH) (
|
||||
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.
|
||||
|
||||
@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.
|
||||
@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.
|
||||
|
||||
**/
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_HII_GLYPH_TO_BLT) (
|
||||
IN EFI_HII_PROTOCOL *This,
|
||||
IN UINT8 *GlyphBuffer,
|
||||
IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL Foreground,
|
||||
IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL Background,
|
||||
IN UINTN Count,
|
||||
IN UINTN Width,
|
||||
IN UINTN Height,
|
||||
IN OUT EFI_GRAPHICS_OUTPUT_BLT_PIXEL *BltBuffer
|
||||
);
|
||||
|
||||
/**
|
||||
Allows a new string to be added to an already existing string package.
|
||||
|
||||
@param This A pointer to the EFI_HII_PROTOCOL instance.
|
||||
@param Pointer to a NULL-terminated string containing a single ISO 639-2
|
||||
language identifier, indicating the language in which the string is translated.
|
||||
@param Handle The handle of the language pack to which the string is to be added.
|
||||
@param Reference The identifier of the string to be added. If the reference
|
||||
value is zero, then the string will be assigned a new identifier on that
|
||||
handle for the language specified. Otherwise, the string will be updated
|
||||
with the NewString Value.
|
||||
@param NewString The string to be added.
|
||||
|
||||
@retval EFI_SUCCESS The string was effectively registered.
|
||||
@retval EFI_INVALID_PARAMETER The Handle was unknown.
|
||||
|
||||
**/
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_HII_NEW_STRING) (
|
||||
IN EFI_HII_PROTOCOL *This,
|
||||
IN CHAR16 *Language,
|
||||
IN EFI_HII_HANDLE Handle,
|
||||
IN OUT STRING_REF *Reference,
|
||||
IN CHAR16 *NewString
|
||||
);
|
||||
|
||||
/**
|
||||
Allows a program to determine the primary languages that are supported
|
||||
on a given handle.
|
||||
|
||||
@param This A pointer to the EFI_HII_PROTOCOL instance.
|
||||
@param Handle The handle on which the strings reside.
|
||||
@param LanguageString A string allocated by GetPrimaryLanguages() that
|
||||
contains a list of all primary languages registered on the handle.
|
||||
|
||||
@retval EFI_SUCCESS LanguageString was correctly returned.
|
||||
@retval EFI_INVALID_PARAMETER The Handle was unknown.
|
||||
|
||||
**/
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_HII_GET_PRI_LANGUAGES) (
|
||||
IN EFI_HII_PROTOCOL *This,
|
||||
IN 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.
|
||||
|
||||
@param This A pointer to the EFI_HII_PROTOCOL instance.
|
||||
@param Handle The handle on which the strings reside.
|
||||
@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.
|
||||
|
||||
@retval EFI_SUCCESS LanguageString was correctly returned.
|
||||
@retval EFI_INVALID_PARAMETER The Handle was unknown.
|
||||
|
||||
**/
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_HII_GET_SEC_LANGUAGES) (
|
||||
IN EFI_HII_PROTOCOL *This,
|
||||
IN EFI_HII_HANDLE Handle,
|
||||
IN CHAR16 *PrimaryLanguage,
|
||||
OUT EFI_STRING *LanguageString
|
||||
);
|
||||
|
||||
/**
|
||||
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 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.
|
||||
@param StringBuffer The buffer designed to receive the characters in the string.
|
||||
|
||||
@retval EFI_SUCCESS StringBuffer is filled with a NULL-terminated string.
|
||||
@retval EFI_INVALID_PARAMETER The handle or string token is unknown.
|
||||
@retval EFI_BUFFER_TOO_SMALL The buffer provided was not large enough to
|
||||
allow the entire string to be stored.
|
||||
|
||||
**/
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_HII_GET_STRING) (
|
||||
IN EFI_HII_PROTOCOL *This,
|
||||
IN EFI_HII_HANDLE Handle,
|
||||
IN STRING_REF Token,
|
||||
IN BOOLEAN Raw,
|
||||
IN CHAR16 *LanguageString,
|
||||
IN OUT UINTN *BufferLength,
|
||||
OUT EFI_STRING StringBuffer
|
||||
);
|
||||
|
||||
/**
|
||||
Allows a program to extract a part of a string of not more than a given width.
|
||||
|
||||
@param This A pointer to the EFI_HII_PROTOCOL instance.
|
||||
@param Handle The 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.
|
||||
@param BufferLength Pointer to the length of the StringBuffer.
|
||||
@param StringBuffer The buffer designed to receive the characters in the string.
|
||||
|
||||
@retval EFI_SUCCESS StringBuffer filled with characters that will fit on the line.
|
||||
@retval EFI_NOT_FOUND The font glyph for at least one of the characters in
|
||||
the string is not in the font database.
|
||||
@retval EFI_BUFFER_TOO_SMALL The buffer provided was not large enough
|
||||
to allow the entire string to be stored.
|
||||
|
||||
**/
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_HII_GET_LINE) (
|
||||
IN EFI_HII_PROTOCOL *This,
|
||||
IN 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
|
||||
);
|
||||
|
||||
/**
|
||||
Allows a program to extract a form or form package that has previously
|
||||
been registered with the HII database.
|
||||
|
||||
@param This A pointer to the EFI_HII_PROTOCOL instance.
|
||||
@param Handle Handle on which the form resides.
|
||||
@param FormId The ID of the form to return. If the ID is zero,
|
||||
the entire form package is returned.
|
||||
@param BufferLength On input, the length of the Buffer. On output,
|
||||
the length of the returned buffer,
|
||||
@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.
|
||||
|
||||
**/
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_HII_GET_FORMS) (
|
||||
IN EFI_HII_PROTOCOL *This,
|
||||
IN EFI_HII_HANDLE Handle,
|
||||
IN EFI_FORM_ID FormId,
|
||||
IN OUT UINTN *BufferLength,
|
||||
OUT UINT8 *Buffer
|
||||
);
|
||||
|
||||
/**
|
||||
Extracts the defaults that are associated with a given handle in the HII database.
|
||||
|
||||
@param This A pointer to the EFI_HII_PROTOCOL instance.
|
||||
@param Handle The HII handle from which will have default data retrieved.
|
||||
@param DefaultMask The mask used to specify some type of default override when extracting
|
||||
the default image data.
|
||||
@param VariablePackList A indirect pointer to the first entry of a link list with
|
||||
type EFI_HII_VARIABLE_PACK_LIST.
|
||||
|
||||
@retval EFI_SUCCESS The VariablePackList was populated with the appropriate
|
||||
default setting data.
|
||||
@retval EFI_NOT_FOUND The IFR does not have any explicit or default map(s).
|
||||
@retval EFI_INVALID_PARAMETER The HII database entry associated with Handle
|
||||
contain invalid data.
|
||||
|
||||
**/
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_HII_GET_DEFAULT_IMAGE) (
|
||||
IN EFI_HII_PROTOCOL *This,
|
||||
IN EFI_HII_HANDLE Handle,
|
||||
IN UINTN DefaultMask,
|
||||
OUT EFI_HII_VARIABLE_PACK_LIST **VariablePackList
|
||||
);
|
||||
|
||||
/**
|
||||
Allows the caller to update a form or form package that has previously been
|
||||
registered with the EFI HII database.
|
||||
|
||||
@param This A pointer to the EFI_HII_PROTOCOL instance.
|
||||
@param Handle Handle of the package where the form to be updated resides.
|
||||
@param Label The label inside the form package where the update is to take place.
|
||||
@param AddData If TRUE, adding data at a given Label; otherwise,
|
||||
if FALSE, removing data at a given Label.
|
||||
@param Data The buffer containing the new tags to insert after the Label
|
||||
|
||||
@retval EFI_SUCCESS The form was updated with the new tags.
|
||||
@retval EFI_INVALID_PARAMETER The buffer for the buffer length does not
|
||||
contain an integral number of tags.
|
||||
@retval EFI_NOT_FOUND The Handle, Label, or FormId was not found.
|
||||
|
||||
**/
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_HII_UPDATE_FORM) (
|
||||
IN EFI_HII_PROTOCOL *This,
|
||||
IN EFI_HII_HANDLE Handle,
|
||||
IN EFI_FORM_LABEL Label,
|
||||
IN BOOLEAN AddData,
|
||||
IN EFI_HII_UPDATE_DATA *Data
|
||||
);
|
||||
|
||||
/**
|
||||
Retrieves the current keyboard layout.
|
||||
|
||||
@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.
|
||||
|
||||
@retval EFI_SUCCESS The keyboard layout was retrieved successfully.
|
||||
|
||||
**/
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_HII_GET_KEYBOARD_LAYOUT) (
|
||||
IN EFI_HII_PROTOCOL *This,
|
||||
OUT UINT16 *DescriptorCount,
|
||||
OUT EFI_KEY_DESCRIPTOR *Descriptor
|
||||
);
|
||||
|
||||
/**
|
||||
@par Protocol Description:
|
||||
The HII Protocol manages the HII database, which is a repository for data
|
||||
having to do with fonts, strings, forms, keyboards, and other future human
|
||||
interface items.
|
||||
|
||||
@param NewPack
|
||||
Extracts the various packs from a package list.
|
||||
|
||||
@param RemovePack
|
||||
Removes a package from the HII database.
|
||||
|
||||
@param FindHandles
|
||||
Determines the handles that are currently active in the database.
|
||||
|
||||
@param ExportDatabase
|
||||
Export the entire contents of the database to a buffer.
|
||||
|
||||
@param TestString
|
||||
Tests if all of the characters in a string have corresponding font characters.
|
||||
|
||||
@param GetGlyph
|
||||
Translates a Unicode character into the corresponding font glyph.
|
||||
|
||||
@param GlyphToBlt
|
||||
Converts a glyph value into a format that is ready for a UGA BLT command.
|
||||
|
||||
@param NewString
|
||||
Allows a new string to be added to an already existing string package.
|
||||
|
||||
@param GetPrimaryLanguages
|
||||
Allows a program to determine the primary languages that are supported
|
||||
on a given handle.
|
||||
|
||||
@param GetSecondaryLanguages
|
||||
Allows a program to determine which secondary languages are supported
|
||||
on a given handle for a given primary language.
|
||||
|
||||
@param GetString
|
||||
Extracts a string from a package that is already registered with the
|
||||
EFI HII database.
|
||||
|
||||
@param ResetString
|
||||
Remove any new strings that were added after the initial string export
|
||||
for this handle.
|
||||
|
||||
@param GetLine
|
||||
Allows a program to extract a part of a string of not more than a given width.
|
||||
|
||||
@param GetForms
|
||||
Allows a program to extract a form or form package that has been previously registered.
|
||||
|
||||
@param GetDefaultImage
|
||||
Allows a program to extract the nonvolatile image that represents the default storage image.
|
||||
|
||||
@param UpdateForm
|
||||
Allows a program to update a previously registered form.
|
||||
|
||||
@param GetKeyboardLayout
|
||||
Allows a program to extract the current keyboard layout.
|
||||
|
||||
**/
|
||||
struct _EFI_HII_PROTOCOL {
|
||||
EFI_HII_NEW_PACK NewPack;
|
||||
EFI_HII_REMOVE_PACK RemovePack;
|
||||
EFI_HII_FIND_HANDLES FindHandles;
|
||||
EFI_HII_EXPORT ExportDatabase;
|
||||
|
||||
EFI_HII_TEST_STRING TestString;
|
||||
EFI_HII_GET_GLYPH GetGlyph;
|
||||
EFI_HII_GLYPH_TO_BLT GlyphToBlt;
|
||||
|
||||
EFI_HII_NEW_STRING NewString;
|
||||
EFI_HII_GET_PRI_LANGUAGES GetPrimaryLanguages;
|
||||
EFI_HII_GET_SEC_LANGUAGES GetSecondaryLanguages;
|
||||
EFI_HII_GET_STRING GetString;
|
||||
EFI_HII_RESET_STRINGS ResetStrings;
|
||||
EFI_HII_GET_LINE GetLine;
|
||||
EFI_HII_GET_FORMS GetForms;
|
||||
EFI_HII_GET_DEFAULT_IMAGE GetDefaultImage;
|
||||
EFI_HII_UPDATE_FORM UpdateForm;
|
||||
|
||||
EFI_HII_GET_KEYBOARD_LAYOUT GetKeyboardLayout;
|
||||
};
|
||||
|
||||
extern EFI_GUID gEfiHiiProtocolGuid;
|
||||
|
||||
#endif
|
169
BaseTools/Source/C/Include/Protocol/UgaDraw.h
Normal file
169
BaseTools/Source/C/Include/Protocol/UgaDraw.h
Normal file
@@ -0,0 +1,169 @@
|
||||
/** @file
|
||||
UGA Draw protocol from the EFI 1.1 specification.
|
||||
|
||||
Abstraction of a very simple graphics device.
|
||||
|
||||
Copyright (c) 2006 - 2008, Intel Corporation All rights reserved.
|
||||
|
||||
This program and the accompanying materials are licensed and made available
|
||||
under the terms and conditions of the BSD License which accompanies this
|
||||
distribution. The full text of the license may be found at:
|
||||
http://opensource.org/licenses/bsd-license.php
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
File name: UgaDraw.h
|
||||
|
||||
**/
|
||||
|
||||
#ifndef __UGA_DRAW_H__
|
||||
#define __UGA_DRAW_H__
|
||||
|
||||
#define EFI_UGA_DRAW_PROTOCOL_GUID \
|
||||
{ \
|
||||
0x982c298b, 0xf4fa, 0x41cb, {0xb8, 0x38, 0x77, 0xaa, 0x68, 0x8f, 0xb8, 0x39 } \
|
||||
}
|
||||
|
||||
typedef struct _EFI_UGA_DRAW_PROTOCOL EFI_UGA_DRAW_PROTOCOL;
|
||||
|
||||
/**
|
||||
Return the current video mode information.
|
||||
|
||||
@param This Protocol instance pointer.
|
||||
@param HorizontalResolution Current video horizontal resolution in pixels
|
||||
@param VerticalResolution Current video vertical resolution in pixels
|
||||
@param ColorDepth Current video color depth in bits per pixel
|
||||
@param RefreshRate Current video refresh rate in Hz.
|
||||
|
||||
@retval EFI_SUCCESS Mode information returned.
|
||||
@retval EFI_NOT_STARTED Video display is not initialized. Call SetMode ()
|
||||
@retval EFI_INVALID_PARAMETER One of the input args was NULL.
|
||||
|
||||
**/
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_UGA_DRAW_PROTOCOL_GET_MODE) (
|
||||
IN EFI_UGA_DRAW_PROTOCOL *This,
|
||||
OUT UINT32 *HorizontalResolution,
|
||||
OUT UINT32 *VerticalResolution,
|
||||
OUT UINT32 *ColorDepth,
|
||||
OUT UINT32 *RefreshRate
|
||||
)
|
||||
;
|
||||
|
||||
/**
|
||||
Return the current video mode information.
|
||||
|
||||
@param This Protocol instance pointer.
|
||||
@param HorizontalResolution Current video horizontal resolution in pixels
|
||||
@param VerticalResolution Current video vertical resolution in pixels
|
||||
@param ColorDepth Current video color depth in bits per pixel
|
||||
@param RefreshRate Current video refresh rate in Hz.
|
||||
|
||||
@retval EFI_SUCCESS Mode information returned.
|
||||
@retval EFI_NOT_STARTED Video display is not initialized. Call SetMode ()
|
||||
|
||||
**/
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_UGA_DRAW_PROTOCOL_SET_MODE) (
|
||||
IN EFI_UGA_DRAW_PROTOCOL *This,
|
||||
IN UINT32 HorizontalResolution,
|
||||
IN UINT32 VerticalResolution,
|
||||
IN UINT32 ColorDepth,
|
||||
IN UINT32 RefreshRate
|
||||
)
|
||||
;
|
||||
|
||||
typedef struct {
|
||||
UINT8 Blue;
|
||||
UINT8 Green;
|
||||
UINT8 Red;
|
||||
UINT8 Reserved;
|
||||
} EFI_UGA_PIXEL;
|
||||
|
||||
typedef union {
|
||||
EFI_UGA_PIXEL Pixel;
|
||||
UINT32 Raw;
|
||||
} EFI_UGA_PIXEL_UNION;
|
||||
|
||||
typedef enum {
|
||||
EfiUgaVideoFill,
|
||||
EfiUgaVideoToBltBuffer,
|
||||
EfiUgaBltBufferToVideo,
|
||||
EfiUgaVideoToVideo,
|
||||
EfiUgaBltMax
|
||||
} EFI_UGA_BLT_OPERATION;
|
||||
|
||||
/**
|
||||
Type specifying a pointer to a function to perform an UGA Blt operation.
|
||||
|
||||
The following table defines actions for BltOperations:
|
||||
|
||||
<B>EfiUgaVideoFill</B> - Write data from the BltBuffer pixel (SourceX, SourceY)
|
||||
directly to every pixel of the video display rectangle
|
||||
(DestinationX, DestinationY) (DestinationX + Width, DestinationY + Height).
|
||||
Only one pixel will be used from the BltBuffer. Delta is NOT used.
|
||||
|
||||
<B>EfiUgaVideoToBltBuffer</B> - Read data from the video display rectangle
|
||||
(SourceX, SourceY) (SourceX + Width, SourceY + Height) and place it in
|
||||
the BltBuffer rectangle (DestinationX, DestinationY )
|
||||
(DestinationX + Width, DestinationY + Height). If DestinationX or
|
||||
DestinationY is not zero then Delta must be set to the length in bytes
|
||||
of a row in the BltBuffer.
|
||||
|
||||
<B>EfiUgaBltBufferToVideo</B> - Write data from the BltBuffer rectangle
|
||||
(SourceX, SourceY) (SourceX + Width, SourceY + Height) directly to the
|
||||
video display rectangle (DestinationX, DestinationY)
|
||||
(DestinationX + Width, DestinationY + Height). If SourceX or SourceY is
|
||||
not zero then Delta must be set to the length in bytes of a row in the
|
||||
BltBuffer.
|
||||
|
||||
<B>EfiUgaVideoToVideo</B> - Copy from the video display rectangle (SourceX, SourceY)
|
||||
(SourceX + Width, SourceY + Height) .to the video display rectangle
|
||||
(DestinationX, DestinationY) (DestinationX + Width, DestinationY + Height).
|
||||
The BltBuffer and Delta are not used in this mode.
|
||||
|
||||
|
||||
@param[in] This - Protocol instance pointer.
|
||||
@param[in] BltBuffer - Buffer containing data to blit into video buffer. This
|
||||
buffer has a size of Width*Height*sizeof(EFI_UGA_PIXEL)
|
||||
@param[in] BltOperation - Operation to perform on BlitBuffer and video memory
|
||||
@param[in] SourceX - X coordinate of source for the BltBuffer.
|
||||
@param[in] SourceY - Y coordinate of source for the BltBuffer.
|
||||
@param[in] DestinationX - X coordinate of destination for the BltBuffer.
|
||||
@param[in] DestinationY - Y coordinate of destination for the BltBuffer.
|
||||
@param[in] Width - Width of rectangle in BltBuffer in pixels.
|
||||
@param[in] Height - Hight of rectangle in BltBuffer in pixels.
|
||||
@param[in] Delta - OPTIONAL
|
||||
|
||||
@retval EFI_SUCCESS - The Blt operation completed.
|
||||
@retval EFI_INVALID_PARAMETER - BltOperation is not valid.
|
||||
@retval EFI_DEVICE_ERROR - A hardware error occured writting to the video buffer.
|
||||
|
||||
--*/
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_UGA_DRAW_PROTOCOL_BLT) (
|
||||
IN EFI_UGA_DRAW_PROTOCOL * This,
|
||||
IN EFI_UGA_PIXEL * BltBuffer, OPTIONAL
|
||||
IN EFI_UGA_BLT_OPERATION BltOperation,
|
||||
IN UINTN SourceX,
|
||||
IN UINTN SourceY,
|
||||
IN UINTN DestinationX,
|
||||
IN UINTN DestinationY,
|
||||
IN UINTN Width,
|
||||
IN UINTN Height,
|
||||
IN UINTN Delta OPTIONAL
|
||||
);
|
||||
|
||||
struct _EFI_UGA_DRAW_PROTOCOL {
|
||||
EFI_UGA_DRAW_PROTOCOL_GET_MODE GetMode;
|
||||
EFI_UGA_DRAW_PROTOCOL_SET_MODE SetMode;
|
||||
EFI_UGA_DRAW_PROTOCOL_BLT Blt;
|
||||
};
|
||||
|
||||
extern EFI_GUID gEfiUgaDrawProtocolGuid;
|
||||
|
||||
#endif
|
Reference in New Issue
Block a user