summaryrefslogtreecommitdiffstats
path: root/src/include/ipxe/efi/Uefi
diff options
context:
space:
mode:
Diffstat (limited to 'src/include/ipxe/efi/Uefi')
-rw-r--r--src/include/ipxe/efi/Uefi/UefiBaseType.h133
-rw-r--r--src/include/ipxe/efi/Uefi/UefiGpt.h98
-rw-r--r--src/include/ipxe/efi/Uefi/UefiInternalFormRepresentation.h556
-rw-r--r--src/include/ipxe/efi/Uefi/UefiMultiPhase.h197
-rw-r--r--src/include/ipxe/efi/Uefi/UefiPxe.h208
-rw-r--r--src/include/ipxe/efi/Uefi/UefiSpec.h449
6 files changed, 1202 insertions, 439 deletions
diff --git a/src/include/ipxe/efi/Uefi/UefiBaseType.h b/src/include/ipxe/efi/Uefi/UefiBaseType.h
index e7d964de..4fdca578 100644
--- a/src/include/ipxe/efi/Uefi/UefiBaseType.h
+++ b/src/include/ipxe/efi/Uefi/UefiBaseType.h
@@ -1,14 +1,14 @@
/** @file
Defines data types and constants introduced in UEFI.
- 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
+Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
+This program and the accompanying materials are licensed and made available under
+the terms and conditions of the BSD License that 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.
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
@@ -18,7 +18,7 @@
#include <ipxe/efi/Base.h>
//
-// Basical data type definitions introduced in UEFI.
+// Basic data type definitions introduced in UEFI.
//
///
@@ -26,7 +26,7 @@
///
typedef GUID EFI_GUID;
///
-/// Function return status for EFI API
+/// Function return status for EFI API.
///
typedef RETURN_STATUS EFI_STATUS;
///
@@ -45,12 +45,20 @@ typedef UINTN EFI_TPL;
/// Logical block address.
///
typedef UINT64 EFI_LBA;
+
+///
+/// 64-bit physical memory address.
+///
typedef UINT64 EFI_PHYSICAL_ADDRESS;
+
+///
+/// 64-bit virtual memory address.
+///
typedef UINT64 EFI_VIRTUAL_ADDRESS;
///
/// EFI Time Abstraction:
-/// Year: 1998 - 20XX
+/// Year: 1900 - 9999
/// Month: 1 - 12
/// Day: 1 - 31
/// Hour: 0 - 23
@@ -82,7 +90,7 @@ typedef struct {
} EFI_IPv4_ADDRESS;
///
-/// 16-byte buffer. An IPv6 internet protocol address
+/// 16-byte buffer. An IPv6 internet protocol address.
///
typedef struct {
UINT8 Addr[16];
@@ -106,9 +114,9 @@ typedef union {
} EFI_IP_ADDRESS;
-//
-// Enumeration of EFI_STATUS.
-//
+///
+/// Enumeration of EFI_STATUS.
+///@{
#define EFI_SUCCESS RETURN_SUCCESS
#define EFI_LOAD_ERROR RETURN_LOAD_ERROR
#define EFI_INVALID_PARAMETER RETURN_INVALID_PARAMETER
@@ -145,27 +153,31 @@ typedef union {
#define EFI_WARN_DELETE_FAILURE RETURN_WARN_DELETE_FAILURE
#define EFI_WARN_WRITE_FAILURE RETURN_WARN_WRITE_FAILURE
#define EFI_WARN_BUFFER_TOO_SMALL RETURN_WARN_BUFFER_TOO_SMALL
+///@}
-
-//
-// Define macro to encode the status code.
-//
+///
+/// Define macro to encode the status code.
+///
#define EFIERR(_a) ENCODE_ERROR(_a)
#define EFI_ERROR(A) RETURN_ERROR(A)
-//
-// Define macros to build data structure signatures from characters.
-//
-#define EFI_SIGNATURE_16(A, B) SIGNATURE_16 (A, B)
-#define EFI_SIGNATURE_32(A, B, C, D) SIGNATURE_32 (A, B, C, D)
-#define EFI_SIGNATURE_64(A, B, C, D, E, F, G, H) SIGNATURE_64 (A, B, C, D, E, F, G, H)
-
-
///
-/// Returns the byte offset to a field within a structure
+/// ICMP error definitions
+///@{
+#define EFI_NETWORK_UNREACHABLE EFIERR(100)
+#define EFI_HOST_UNREACHABLE EFIERR(101)
+#define EFI_PROTOCOL_UNREACHABLE EFIERR(102)
+#define EFI_PORT_UNREACHABLE EFIERR(103)
+///@}
+
///
-#define EFI_FIELD_OFFSET(TYPE,Field) ((UINTN)(&(((TYPE *) 0)->Field)))
+/// Tcp connection status definitions
+///@{
+#define EFI_CONNECTION_FIN EFIERR(104)
+#define EFI_CONNECTION_RESET EFIERR(105)
+#define EFI_CONNECTION_REFUSED EFIERR(106)
+///@}
//
// The EFI memory allocation functions work in units of EFI_PAGEs that are
@@ -180,21 +192,72 @@ typedef union {
#define EFI_PAGES_TO_SIZE(a) ( (a) << EFI_PAGE_SHIFT)
+///
+/// PE32+ Machine type for IA32 UEFI images.
+///
+#define EFI_IMAGE_MACHINE_IA32 0x014C
+
+///
+/// PE32+ Machine type for IA64 UEFI images.
+///
+#define EFI_IMAGE_MACHINE_IA64 0x0200
-#define EFI_MAX_BIT MAX_BIT
-#define EFI_MAX_ADDRESS MAX_ADDRESS
+///
+/// PE32+ Machine type for EBC UEFI images.
+///
+#define EFI_IMAGE_MACHINE_EBC 0x0EBC
+///
+/// PE32+ Machine type for X64 UEFI images.
+///
+#define EFI_IMAGE_MACHINE_X64 0x8664
///
-/// Limited buffer size for a language code recommended by RFC3066
-/// (42 characters plus a NULL terminator)
+/// PE32+ Machine type for ARM mixed ARM and Thumb/Thumb2 images.
///
-#define RFC_3066_ENTRY_SIZE (42 + 1)
+#define EFI_IMAGE_MACHINE_ARMTHUMB_MIXED 0x01C2
+
+
+#if defined (MDE_CPU_IA32)
+
+#define EFI_IMAGE_MACHINE_TYPE_SUPPORTED(Machine) \
+ (((Machine) == EFI_IMAGE_MACHINE_IA32) || ((Machine) == EFI_IMAGE_MACHINE_EBC))
+
+#define EFI_IMAGE_MACHINE_CROSS_TYPE_SUPPORTED(Machine) ((Machine) == EFI_IMAGE_MACHINE_X64)
+
+#elif defined (MDE_CPU_IPF)
+
+#define EFI_IMAGE_MACHINE_TYPE_SUPPORTED(Machine) \
+ (((Machine) == EFI_IMAGE_MACHINE_IA64) || ((Machine) == EFI_IMAGE_MACHINE_EBC))
+
+#define EFI_IMAGE_MACHINE_CROSS_TYPE_SUPPORTED(Machine) (FALSE)
+
+#elif defined (MDE_CPU_X64)
+
+#define EFI_IMAGE_MACHINE_TYPE_SUPPORTED(Machine) \
+ (((Machine) == EFI_IMAGE_MACHINE_X64) || ((Machine) == EFI_IMAGE_MACHINE_EBC))
+
+#define EFI_IMAGE_MACHINE_CROSS_TYPE_SUPPORTED(Machine) ((Machine) == EFI_IMAGE_MACHINE_IA32)
+
+#elif defined (MDE_CPU_ARM)
+
+#define EFI_IMAGE_MACHINE_TYPE_SUPPORTED(Machine) \
+ (((Machine) == EFI_IMAGE_MACHINE_ARMTHUMB_MIXED) || ((Machine) == EFI_IMAGE_MACHINE_EBC))
+
+#define EFI_IMAGE_MACHINE_CROSS_TYPE_SUPPORTED(Machine) ((Machine) == EFI_IMAGE_MACHINE_ARMTHUMB_MIXED)
+
+#elif defined (MDE_CPU_EBC)
///
-/// The size of a 3 character ISO639 language code.
+/// This is just to make sure you can cross compile with the EBC compiler.
+/// It does not make sense to have a PE loader coded in EBC.
///
-#define ISO_639_2_ENTRY_SIZE 3
+#define EFI_IMAGE_MACHINE_TYPE_SUPPORTED(Machine) ((Machine) == EFI_IMAGE_MACHINE_EBC)
+#define EFI_IMAGE_MACHINE_CROSS_TYPE_SUPPORTED(Machine) (FALSE)
+
+#else
+#error Unknown Processor Type
+#endif
#endif
diff --git a/src/include/ipxe/efi/Uefi/UefiGpt.h b/src/include/ipxe/efi/Uefi/UefiGpt.h
index 92c3035e..9f563382 100644
--- a/src/include/ipxe/efi/Uefi/UefiGpt.h
+++ b/src/include/ipxe/efi/Uefi/UefiGpt.h
@@ -1,14 +1,14 @@
/** @file
EFI Guid Partition Table Format Definition.
- 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
+Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
+This program and the accompanying materials are licensed and made available under
+the terms and conditions of the BSD License that 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.
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
@@ -20,39 +20,113 @@
/// located in LBA 1 (i.e., the second logical block).
///
#define PRIMARY_PART_HEADER_LBA 1
-
///
-/// EFI Partition Table Signature: "EFI PART"
+/// EFI Partition Table Signature: "EFI PART".
///
-#define EFI_PTAB_HEADER_ID 0x5452415020494645ULL
+#define EFI_PTAB_HEADER_ID SIGNATURE_64 ('E','F','I',' ','P','A','R','T')
#pragma pack(1)
///
-/// GPT Partition Table Header
+/// GPT Partition Table Header.
///
typedef struct {
+ ///
+ /// The table header for the GPT partition Table.
+ /// This header contains EFI_PTAB_HEADER_ID.
+ ///
EFI_TABLE_HEADER Header;
+ ///
+ /// The LBA that contains this data structure.
+ ///
EFI_LBA MyLBA;
+ ///
+ /// LBA address of the alternate GUID Partition Table Header.
+ ///
EFI_LBA AlternateLBA;
+ ///
+ /// The first usable logical block that may be used
+ /// by a partition described by a GUID Partition Entry.
+ ///
EFI_LBA FirstUsableLBA;
+ ///
+ /// The last usable logical block that may be used
+ /// by a partition described by a GUID Partition Entry.
+ ///
EFI_LBA LastUsableLBA;
+ ///
+ /// GUID that can be used to uniquely identify the disk.
+ ///
EFI_GUID DiskGUID;
+ ///
+ /// The starting LBA of the GUID Partition Entry array.
+ ///
EFI_LBA PartitionEntryLBA;
+ ///
+ /// The number of Partition Entries in the GUID Partition Entry array.
+ ///
UINT32 NumberOfPartitionEntries;
+ ///
+ /// The size, in bytes, of each the GUID Partition
+ /// Entry structures in the GUID Partition Entry
+ /// array. Must be a multiple of 8.
+ ///
UINT32 SizeOfPartitionEntry;
+ ///
+ /// The CRC32 of the GUID Partition Entry array.
+ /// Starts at PartitionEntryLBA and is
+ /// computed over a byte length of
+ /// NumberOfPartitionEntries * SizeOfPartitionEntry.
+ ///
UINT32 PartitionEntryArrayCRC32;
} EFI_PARTITION_TABLE_HEADER;
///
-/// GPT Partition Entry
+/// GPT Partition Entry.
///
typedef struct {
+ ///
+ /// Unique ID that defines the purpose and type of this Partition. A value of
+ /// zero defines that this partition entry is not being used.
+ ///
EFI_GUID PartitionTypeGUID;
+ ///
+ /// GUID that is unique for every partition entry. Every partition ever
+ /// created will have a unique GUID.
+ /// This GUID must be assigned when the GUID Partition Entry is created.
+ ///
EFI_GUID UniquePartitionGUID;
+ ///
+ /// Starting LBA of the partition defined by this entry
+ ///
EFI_LBA StartingLBA;
+ ///
+ /// Ending LBA of the partition defined by this entry.
+ ///
EFI_LBA EndingLBA;
+ ///
+ /// Attribute bits, all bits reserved by UEFI
+ /// Bit 0: If this bit is set, the partition is required for the platform to function. The owner/creator of the
+ /// partition indicates that deletion or modification of the contents can result in loss of platform
+ /// features or failure for the platform to boot or operate. The system cannot function normally if
+ /// this partition is removed, and it should be considered part of the hardware of the system.
+ /// Actions such as running diagnostics, system recovery, or even OS install or boot, could
+ /// potentially stop working if this partition is removed. Unless OS software or firmware
+ /// recognizes this partition, it should never be removed or modified as the UEFI firmware or
+ /// platform hardware may become non-functional.
+ /// Bit 1: If this bit is set firmware must not produce an EFI_BLOCK_IO_PROTOCOL device for
+ /// this partition. By not producing EFI_BLOCK_IO_PROTOCOL partition, file system
+ /// mappings will not be created for this partition in UEFI.
+ /// Bits 2-47: Undefined and must be zero. Reserved for expansion by future versions of the UEFI
+ /// specification.
+ /// Bits 48-63: Reserved for GUID specific use. The use of these bits will vary depending on the
+ /// PartitionTypeGUID. Only the owner of the PartitionTypeGUID is allowed
+ /// to modify these bits. They must be preserved if Bits 0-47 are modified..
+ ///
UINT64 Attributes;
+ ///
+ /// Null-terminated name of the partition.
+ ///
CHAR16 PartitionName[36];
} EFI_PARTITION_ENTRY;
diff --git a/src/include/ipxe/efi/Uefi/UefiInternalFormRepresentation.h b/src/include/ipxe/efi/Uefi/UefiInternalFormRepresentation.h
index c6755173..d9ddff55 100644
--- a/src/include/ipxe/efi/Uefi/UefiInternalFormRepresentation.h
+++ b/src/include/ipxe/efi/Uefi/UefiInternalFormRepresentation.h
@@ -3,23 +3,25 @@
IFR is primarily consumed by the EFI presentation engine, and produced by EFI
internal application and drivers as well as all add-in card option-ROM drivers
- 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
+Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
+This program and the accompanying materials are licensed and made available under
+the terms and conditions of the BSD License that 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.
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
@par Revision Reference:
- These definitions are from UEFI2.1.
+ These definitions are from UEFI 2.1 and 2.2.
**/
#ifndef __UEFI_INTERNAL_FORMREPRESENTATION_H__
#define __UEFI_INTERNAL_FORMREPRESENTATION_H__
+#include <ipxe/efi/Guid/HiiFormMapMethodGuid.h>
+
///
/// The following types are currently defined:
///
@@ -30,6 +32,7 @@ typedef UINT16 EFI_QUESTION_ID;
typedef UINT16 EFI_STRING_ID;
typedef UINT16 EFI_FORM_ID;
typedef UINT16 EFI_VARSTORE_ID;
+typedef UINT16 EFI_ANIMATION_ID;
typedef UINT16 EFI_DEFAULT_ID;
@@ -73,34 +76,76 @@ typedef struct {
#define EFI_HII_PACKAGE_SIMPLE_FONTS 0x07
#define EFI_HII_PACKAGE_DEVICE_PATH 0x08
#define EFI_HII_PACKAGE_KEYBOARD_LAYOUT 0x09
+#define EFI_HII_PACKAGE_ANIMATIONS 0x0A
#define EFI_HII_PACKAGE_END 0xDF
#define EFI_HII_PACKAGE_TYPE_SYSTEM_BEGIN 0xE0
#define EFI_HII_PACKAGE_TYPE_SYSTEM_END 0xFF
//
// Definitions for Simplified Font Package
-// Section 27.3.2
//
-//
-// Contents of EFI_NARROW_GLYPH.Attributes
-//
+///
+/// Contents of EFI_NARROW_GLYPH.Attributes.
+///@{
#define EFI_GLYPH_NON_SPACING 0x01
#define EFI_GLYPH_WIDE 0x02
#define EFI_GLYPH_HEIGHT 19
#define EFI_GLYPH_WIDTH 8
+///@}
+///
+/// The EFI_NARROW_GLYPH has a preferred dimension (w x h) of 8 x 19 pixels.
+///
typedef struct {
+ ///
+ /// The Unicode representation of the glyph. The term weight is the
+ /// technical term for a character code.
+ ///
CHAR16 UnicodeWeight;
+ ///
+ /// The data element containing the glyph definitions.
+ ///
UINT8 Attributes;
+ ///
+ /// The column major glyph representation of the character. Bits
+ /// with values of one indicate that the corresponding pixel is to be
+ /// on when normally displayed; those with zero are off.
+ ///
UINT8 GlyphCol1[EFI_GLYPH_HEIGHT];
} EFI_NARROW_GLYPH;
+///
+/// The EFI_WIDE_GLYPH has a preferred dimension (w x h) of 16 x 19 pixels, which is large enough
+/// to accommodate logographic characters.
+///
typedef struct {
+ ///
+ /// The Unicode representation of the glyph. The term weight is the
+ /// technical term for a character code.
+ ///
CHAR16 UnicodeWeight;
+ ///
+ /// The data element containing the glyph definitions.
+ ///
UINT8 Attributes;
+ ///
+ /// The column major glyph representation of the character. Bits
+ /// with values of one indicate that the corresponding pixel is to be
+ /// on when normally displayed; those with zero are off.
+ ///
UINT8 GlyphCol1[EFI_GLYPH_HEIGHT];
+ ///
+ /// The column major glyph representation of the character. Bits
+ /// with values of one indicate that the corresponding pixel is to be
+ /// on when normally displayed; those with zero are off.
+ ///
UINT8 GlyphCol2[EFI_GLYPH_HEIGHT];
+ ///
+ /// Ensures that sizeof (EFI_WIDE_GLYPH) is twice the
+ /// sizeof (EFI_NARROW_GLYPH). The contents of Pad must
+ /// be zero.
+ ///
UINT8 Pad[3];
} EFI_WIDE_GLYPH;
@@ -142,7 +187,7 @@ typedef struct _EFI_HII_GLYPH_INFO {
} EFI_HII_GLYPH_INFO;
///
-/// The fixed header consists of a standard record header and
+/// The fixed header consists of a standard record header,
/// then the character values in this section, the flags
/// (including the encoding method) and the offsets of the glyph
/// information, the glyph bitmaps and the character map.
@@ -255,10 +300,10 @@ typedef struct _EFI_HII_GIBT_SKIP2_BLOCK {
/// The device path package is used to carry a device path
/// associated with the package list.
///
-typedef struct _EFI_HII_DEVICE_PATH_PACKAGE {
+typedef struct _EFI_HII_DEVICE_PATH_PACKAGE_HDR {
EFI_HII_PACKAGE_HEADER Header;
// EFI_DEVICE_PATH_PROTOCOL DevicePath[];
-} EFI_HII_DEVICE_PATH_PACKAGE;
+} EFI_HII_DEVICE_PATH_PACKAGE_HDR;
//
// Definitions for GUID Package
@@ -279,8 +324,8 @@ typedef struct _EFI_HII_GUID_PACKAGE_HDR {
// Section 27.3.6
//
-#define UEFI_CONFIG_LANG L"x-UEFI"
-#define UEFI_CONFIG_LANG2 L"x-i-UEFI"
+#define UEFI_CONFIG_LANG "x-UEFI"
+#define UEFI_CONFIG_LANG_2 "x-i-UEFI"
///
/// The fixed header consists of a standard record header and then the string identifiers
@@ -593,13 +638,13 @@ typedef struct _EFI_HII_IMAGE_PALETTE_INFO {
//
///
-/// The Forms package is used to carry forms-based encoding data.
+/// The Form package is used to carry form-based encoding data.
///
-typedef struct _EFI_HII_FORM_PACKAGE {
+typedef struct _EFI_HII_FORM_PACKAGE_HDR {
EFI_HII_PACKAGE_HEADER Header;
// EFI_IFR_OP_HEADER OpCodeHeader;
// More op-codes follow
-} EFI_HII_FORM_PACKAGE;
+} EFI_HII_FORM_PACKAGE_HDR;
typedef struct {
UINT8 Hour;
@@ -621,7 +666,8 @@ typedef union {
BOOLEAN b;
EFI_HII_TIME time;
EFI_HII_DATE date;
- EFI_STRING_ID string;
+ EFI_STRING_ID string; ///< EFI_IFR_TYPE_STRING, EFI_IFR_TYPE_ACTION
+ // UINT8 buffer[]; ///< EFI_IFR_TYPE_ORDERED_LIST
} EFI_IFR_TYPE_VALUE;
//
@@ -657,8 +703,10 @@ typedef union {
#define EFI_IFR_STRING_OP 0x1C
#define EFI_IFR_REFRESH_OP 0x1D
#define EFI_IFR_DISABLE_IF_OP 0x1E
+#define EFI_IFR_ANIMATION_OP 0x1F
#define EFI_IFR_TO_LOWER_OP 0x20
#define EFI_IFR_TO_UPPER_OP 0x21
+#define EFI_IFR_MAP_OP 0x22
#define EFI_IFR_ORDERED_LIST_OP 0x23
#define EFI_IFR_VARSTORE_OP 0x24
#define EFI_IFR_VARSTORE_NAME_VALUE_OP 0x25
@@ -667,6 +715,10 @@ typedef union {
#define EFI_IFR_VERSION_OP 0x28
#define EFI_IFR_END_OP 0x29
#define EFI_IFR_MATCH_OP 0x2A
+#define EFI_IFR_GET_OP 0x2B
+#define EFI_IFR_SET_OP 0x2C
+#define EFI_IFR_READ_OP 0x2D
+#define EFI_IFR_WRITE_OP 0x2E
#define EFI_IFR_EQUAL_OP 0x2F
#define EFI_IFR_NOT_EQUAL_OP 0x30
#define EFI_IFR_GREATER_THAN_OP 0x31
@@ -713,8 +765,10 @@ typedef union {
#define EFI_IFR_VALUE_OP 0x5A
#define EFI_IFR_DEFAULT_OP 0x5B
#define EFI_IFR_DEFAULTSTORE_OP 0x5C
+#define EFI_IFR_FORM_MAP_OP 0x5D
#define EFI_IFR_CATENATE_OP 0x5E
#define EFI_IFR_GUID_OP 0x5F
+#define EFI_IFR_SECURITY_OP 0x60
//
// Definitions of IFR Standard Headers
@@ -800,6 +854,8 @@ typedef struct _EFI_IFR_FORM_SET {
EFI_GUID Guid;
EFI_STRING_ID FormSetTitle;
EFI_STRING_ID Help;
+ UINT8 Flags;
+ // EFI_GUID ClassGuid[];
} EFI_IFR_FORM_SET;
typedef struct _EFI_IFR_END {
@@ -892,7 +948,7 @@ typedef struct _EFI_IFR_REF4 {
typedef struct _EFI_IFR_RESET_BUTTON {
EFI_IFR_OP_HEADER Header;
- EFI_IFR_QUESTION_HEADER Question;
+ EFI_IFR_STATEMENT_HEADER Statement;
EFI_DEFAULT_ID DefaultId;
} EFI_IFR_RESET_BUTTON;
@@ -1073,6 +1129,9 @@ typedef struct _EFI_IFR_ONE_OF_OPTION {
#define EFI_IFR_TYPE_DATE 0x06
#define EFI_IFR_TYPE_STRING 0x07
#define EFI_IFR_TYPE_OTHER 0x08
+#define EFI_IFR_TYPE_UNDEFINED 0x09
+#define EFI_IFR_TYPE_ACTION 0x0A
+#define EFI_IFR_TYPE_BUFFER 0x0B
#define EFI_IFR_OPTION_DEFAULT 0x10
#define EFI_IFR_OPTION_DEFAULT_MFG 0x20
@@ -1099,12 +1158,12 @@ typedef struct _EFI_IFR_EQ_ID_VAL {
UINT16 Value;
} EFI_IFR_EQ_ID_VAL;
-typedef struct _EFI_IFR_EQ_ID_LIST {
+typedef struct _EFI_IFR_EQ_ID_VAL_LIST {
EFI_IFR_OP_HEADER Header;
EFI_QUESTION_ID QuestionId;
UINT16 ListLength;
UINT16 ValueList[1];
-} EFI_IFR_EQ_ID_LIST;
+} EFI_IFR_EQ_ID_VAL_LIST;
typedef struct _EFI_IFR_UINT8 {
EFI_IFR_OP_HEADER Header;
@@ -1212,25 +1271,28 @@ typedef struct _EFI_IFR_TO_BOOLEAN {
EFI_IFR_OP_HEADER Header;
} EFI_IFR_TO_BOOLEAN;
-//
-// For EFI_IFR_TO_STRING, when converting from
-// unsigned integers, these flags control the format:
-// 0 = unsigned decimal
-// 1 = signed decimal
-// 2 = hexadecimal (lower-case alpha)
-// 3 = hexadecimal (upper-case alpha)
-//
+///
+/// For EFI_IFR_TO_STRING, when converting from
+/// unsigned integers, these flags control the format:
+/// 0 = unsigned decimal.
+/// 1 = signed decimal.
+/// 2 = hexadecimal (lower-case alpha).
+/// 3 = hexadecimal (upper-case alpha).
+///@{
#define EFI_IFR_STRING_UNSIGNED_DEC 0
#define EFI_IFR_STRING_SIGNED_DEC 1
#define EFI_IFR_STRING_LOWERCASE_HEX 2
#define EFI_IFR_STRING_UPPERCASE_HEX 3
-//
-// When converting from a buffer, these flags control the format:
-// 0 = ASCII
-// 8 = Unicode
-//
+///@}
+
+///
+/// When converting from a buffer, these flags control the format:
+/// 0 = ASCII.
+/// 8 = Unicode.
+///@{
#define EFI_IFR_STRING_ASCII 0
#define EFI_IFR_STRING_UNICODE 8
+///@}
typedef struct _EFI_IFR_TO_STRING {
EFI_IFR_OP_HEADER Header;
@@ -1360,12 +1422,119 @@ typedef struct _EFI_IFR_SPAN {
UINT8 Flags;
} EFI_IFR_SPAN;
+typedef struct _EFI_IFR_SECURITY {
+ ///
+ /// Standard opcode header, where Header.Op = EFI_IFR_SECURITY_OP.
+ ///
+ EFI_IFR_OP_HEADER Header;
+ ///
+ /// Security permission level.
+ ///
+ EFI_GUID Permissions;
+} EFI_IFR_SECURITY;
+
+typedef struct _EFI_IFR_FORM_MAP_METHOD {
+ ///
+ /// The string identifier which provides the human-readable name of
+ /// the configuration method for this standards map form.
+ ///
+ EFI_STRING_ID MethodTitle;
+ ///
+ /// Identifier which uniquely specifies the configuration methods
+ /// associated with this standards map form.
+ ///
+ EFI_GUID MethodIdentifier;
+} EFI_IFR_FORM_MAP_METHOD;
+
+typedef struct _EFI_IFR_FORM_MAP {
+ ///
+ /// The sequence that defines the type of opcode as well as the length
+ /// of the opcode being defined. Header.OpCode = EFI_IFR_FORM_MAP_OP.
+ ///
+ EFI_IFR_OP_HEADER Header;
+ ///
+ /// The unique identifier for this particular form.
+ ///
+ EFI_FORM_ID FormId;
+ ///
+ /// One or more configuration method's name and unique identifier.
+ ///
+ // EFI_IFR_FORM_MAP_METHOD Methods[];
+} EFI_IFR_FORM_MAP;
+
+typedef struct _EFI_IFR_SET {
+ ///
+ /// The sequence that defines the type of opcode as well as the length
+ /// of the opcode being defined. Header.OpCode = EFI_IFR_SET_OP.
+ ///
+ EFI_IFR_OP_HEADER Header;
+ ///
+ /// Specifies the identifier of a previously declared variable store to
+ /// use when storing the question's value.
+ ///
+ EFI_VARSTORE_ID VarStoreId;
+ union {
+ ///
+ /// A 16-bit Buffer Storage offset.
+ ///
+ EFI_STRING_ID VarName;
+ ///
+ /// A Name Value or EFI Variable name (VarName).
+ ///
+ UINT16 VarOffset;
+ } VarStoreInfo;
+ ///
+ /// Specifies the type used for storage.
+ ///
+ UINT8 VarStoreType;
+} EFI_IFR_SET;
+
+typedef struct _EFI_IFR_GET {
+ ///
+ /// The sequence that defines the type of opcode as well as the length
+ /// of the opcode being defined. Header.OpCode = EFI_IFR_GET_OP.
+ ///
+ EFI_IFR_OP_HEADER Header;
+ ///
+ /// Specifies the identifier of a previously declared variable store to
+ /// use when retrieving the value.
+ ///
+ EFI_VARSTORE_ID VarStoreId;
+ union {
+ ///
+ /// A 16-bit Buffer Storage offset.
+ ///
+ EFI_STRING_ID VarName;
+ ///
+ /// A Name Value or EFI Variable name (VarName).
+ ///
+ UINT16 VarOffset;
+ } VarStoreInfo;
+ ///
+ /// Specifies the type used for storage.
+ ///
+ UINT8 VarStoreType;
+} EFI_IFR_GET;
+
+typedef struct _EFI_IFR_READ {
+ EFI_IFR_OP_HEADER Header;
+} EFI_IFR_READ;
+
+typedef struct _EFI_IFR_WRITE {
+ EFI_IFR_OP_HEADER Header;
+} EFI_IFR_WRITE;
+
+typedef struct _EFI_IFR_MAP {
+ EFI_IFR_OP_HEADER Header;
+} EFI_IFR_MAP;
//
// Definitions for Keyboard Package
-// Section 27.3.9
// Releated definitions are in Section of EFI_HII_DATABASE_PROTOCOL
//
+///
+/// Each enumeration values maps a physical key on a keyboard.
+///
typedef enum {
EfiKeyLCtrl,
EfiKeyA0,
@@ -1475,11 +1644,31 @@ typedef enum {
} EFI_KEY;
typedef struct {
+ ///
+ /// Used to describe a physical key on a keyboard.
+ ///
EFI_KEY Key;
+ ///
+ /// Unicode character code for the Key.
+ ///
CHAR16 Unicode;
+ ///
+ /// Unicode character code for the key with the shift key being held down.
+ ///
CHAR16 ShiftedUnicode;
+ ///
+ /// Unicode character code for the key with the Alt-GR being held down.
+ ///
CHAR16 AltGrUnicode;
+ ///
+ /// Unicode character code for the key with the Alt-GR and shift keys being held down.
+ ///
CHAR16 ShiftedAltGrUnicode;
+ ///
+ /// Modifier keys are defined to allow for special functionality that is not necessarily
+ /// accomplished by a printable character. Many of these modifier keys are flags to toggle
+ /// certain state bits on and off inside of a keyboard driver.
+ ///
UINT16 Modifier;
UINT16 AffectedAttribute;
} EFI_KEY_DESCRIPTOR;
@@ -1493,7 +1682,7 @@ typedef struct {
///
/// This key is affected by the caps lock so that if a keyboard driver
/// would need to disambiguate between a key which had a "1" defined
-/// versus a "a" character. Having this bit turned on would tell
+/// versus an "a" character. Having this bit turned on would tell
/// the keyboard driver to use the appropriate shifted state or not.
///
#define EFI_AFFECTED_BY_CAPS_LOCK 0x0002
@@ -1559,7 +1748,7 @@ typedef struct {
//
// Keys that have multiple control functions based on modifier
// settings are handled in the keyboard driver implementation.
-// For instance PRINT_KEY might have a modifier held down and
+// For instance, PRINT_KEY might have a modifier held down and
// is still a nonprinting character, but might have an alternate
// control function like SYSREQUEST
//
@@ -1573,6 +1762,293 @@ typedef struct {
#define EFI_RIGHT_LOGO_MODIFIER 0x0028
#define EFI_MENU_MODIFIER 0x0029
+///
+/// Animation IFR opcode
+///
+typedef struct _EFI_IFR_ANIMATION {
+ ///
+ /// Standard opcode header, where Header.OpCode is
+ /// EFI_IFR_ANIMATION_OP.
+ ///
+ EFI_IFR_OP_HEADER Header;
+ ///
+ /// Animation identifier in the HII database.
+ ///
+ EFI_ANIMATION_ID Id;
+} EFI_IFR_ANIMATION;
+
+///
+/// HII animation package header.
+///
+typedef struct _EFI_HII_ANIMATION_PACKAGE_HDR {
+ ///
+ /// Standard package header, where Header.Type = EFI_HII_PACKAGE_ANIMATIONS.
+ ///
+ EFI_HII_PACKAGE_HEADER Header;
+ ///
+ /// Offset, relative to this header, of the animation information. If
+ /// this is zero, then there are no animation sequences in the package.
+ ///
+ UINT32 AnimationInfoOffset;
+} EFI_HII_ANIMATION_PACKAGE_HDR;
+
+///
+/// Animation information is encoded as a series of blocks,
+/// with each block prefixed by a single byte header EFI_HII_ANIMATION_BLOCK.
+///
+typedef struct _EFI_HII_ANIMATION_BLOCK {
+ UINT8 BlockType;
+ //UINT8 BlockBody[];
+} EFI_HII_ANIMATION_BLOCK;
+
+///
+/// Animation block types.
+///
+#define EFI_HII_AIBT_END 0x00
+#define EFI_HII_AIBT_OVERLAY_IMAGES 0x10
+#define EFI_HII_AIBT_CLEAR_IMAGES 0x11
+#define EFI_HII_AIBT_RESTORE_SCRN 0x12
+#define EFI_HII_AIBT_OVERLAY_IMAGES_LOOP 0x18
+#define EFI_HII_AIBT_CLEAR_IMAGES_LOOP 0x19
+#define EFI_HII_AIBT_RESTORE_SCRN_LOOP 0x1A
+#define EFI_HII_AIBT_DUPLICATE 0x20
+#define EFI_HII_AIBT_SKIP2 0x21
+#define EFI_HII_AIBT_SKIP1 0x22
+#define EFI_HII_AIBT_EXT1 0x30
+#define EFI_HII_AIBT_EXT2 0x31
+#define EFI_HII_AIBT_EXT4 0x32
+
+///
+/// Extended block headers used for variable sized animation records
+/// which need an explicit length.
+///
+
+typedef struct _EFI_HII_AIBT_EXT1_BLOCK {
+ ///
+ /// Standard animation header, where Header.BlockType = EFI_HII_AIBT_EXT1.
+ ///
+ EFI_HII_ANIMATION_BLOCK Header;
+ ///
+ /// The block type.
+ ///
+ UINT8 BlockType2;
+ ///
+ /// Size of the animation block, in bytes, including the animation block header.
+ ///
+ UINT8 Length;
+} EFI_HII_AIBT_EXT1_BLOCK;
+
+typedef struct _EFI_HII_AIBT_EXT2_BLOCK {
+ ///
+ /// Standard animation header, where Header.BlockType = EFI_HII_AIBT_EXT2.
+ ///
+ EFI_HII_ANIMATION_BLOCK Header;
+ ///
+ /// The block type
+ ///
+ UINT8 BlockType2;
+ ///
+ /// Size of the animation block, in bytes, including the animation block header.
+ ///
+ UINT16 Length;
+} EFI_HII_AIBT_EXT2_BLOCK;
+
+typedef struct _EFI_HII_AIBT_EXT4_BLOCK {
+ ///
+ /// Standard animation header, where Header.BlockType = EFI_HII_AIBT_EXT4.
+ ///
+ EFI_HII_ANIMATION_BLOCK Header;
+ ///
+ /// The block type
+ ///
+ UINT8 BlockType2;
+ ///
+ /// Size of the animation block, in bytes, including the animation block header.
+ ///
+ UINT32 Length;
+} EFI_HII_AIBT_EXT4_BLOCK;
+
+typedef struct _EFI_HII_ANIMATION_CELL {
+ ///
+ /// The X offset from the upper left hand corner of the logical
+ /// window to position the indexed image.
+ ///
+ UINT16 OffsetX;
+ ///
+ /// The Y offset from the upper left hand corner of the logical
+ /// window to position the indexed image.
+ ///
+ UINT16 OffsetY;
+ ///
+ /// The image to display at the specified offset from the upper left
+ /// hand corner of the logical window.
+ ///
+ EFI_IMAGE_ID ImageId;
+ ///
+ /// The number of milliseconds to delay after displaying the indexed
+ /// image and before continuing on to the next linked image. If value
+ /// is zero, no delay.
+ ///
+ UINT16 Delay;
+} EFI_HII_ANIMATION_CELL;
+
+///
+/// An animation block to describe an animation sequence that does not cycle, and
+/// where one image is simply displayed over the previous image.
+///
+typedef struct _EFI_HII_AIBT_OVERLAY_IMAGES_BLOCK {
+ ///
+ /// This is image that is to be reference by the image protocols, if the
+ /// animation function is not supported or disabled. This image can
+ /// be one particular image from the animation sequence (if any one
+ /// of the animation frames has a complete image) or an alternate
+ /// image that can be displayed alone. If the value is zero, no image
+ /// is displayed.
+ ///
+ EFI_IMAGE_ID DftImageId;
+ ///
+ /// The overall width of the set of images (logical window width).
+ ///
+ UINT16 Width;
+ ///
+ /// The overall height of the set of images (logical window height).
+ ///
+ UINT16 Height;
+ ///
+ /// The number of EFI_HII_ANIMATION_CELL contained in the
+ /// animation sequence.
+ ///
+ UINT16 CellCount;
+ ///
+ /// An array of CellCount animation cells.
+ ///
+ EFI_HII_ANIMATION_CELL AnimationCell[1];
+} EFI_HII_AIBT_OVERLAY_IMAGES_BLOCK;
+
+///
+/// An animation block to describe an animation sequence that does not cycle,
+/// and where the logical window is cleared to the specified color before
+/// the next image is displayed.
+///
+typedef struct _EFI_HII_AIBT_CLEAR_IMAGES_BLOCK {
+ ///
+ /// This is image that is to be reference by the image protocols, if the
+ /// animation function is not supported or disabled. This image can
+ /// be one particular image from the animation sequence (if any one
+ /// of the animation frames has a complete image) or an alternate
+ /// image that can be displayed alone. If the value is zero, no image
+ /// is displayed.
+ ///
+ EFI_IMAGE_ID DftImageId;
+ ///
+ /// The overall width of the set of images (logical window width).
+ ///
+ UINT16 Width;
+ ///
+ /// The overall height of the set of images (logical window height).
+ ///
+ UINT16 Height;
+ ///
+ /// The number of EFI_HII_ANIMATION_CELL contained in the
+ /// animation sequence.
+ ///
+ UINT16 CellCount;
+ ///
+ /// The color to clear the logical window to before displaying the
+ /// indexed image.
+ ///
+ EFI_HII_RGB_PIXEL BackgndColor;
+ ///
+ /// An array of CellCount animation cells.
+ ///
+ EFI_HII_ANIMATION_CELL AnimationCell[1];
+} EFI_HII_AIBT_CLEAR_IMAGES_BLOCK;
+
+///
+/// An animation block to describe an animation sequence that does not cycle,
+/// and where the screen is restored to the original state before the next
+/// image is displayed.
+///
+typedef struct _EFI_HII_AIBT_RESTORE_SCRN_BLOCK {
+ ///
+ /// This is image that is to be reference by the image protocols, if the
+ /// animation function is not supported or disabled. This image can
+ /// be one particular image from the animation sequence (if any one
+ /// of the animation frames has a complete image) or an alternate
+ /// image that can be displayed alone. If the value is zero, no image
+ /// is displayed.
+ ///
+ EFI_IMAGE_ID DftImageId;
+ ///
+ /// The overall width of the set of images (logical window width).
+ ///
+ UINT16 Width;
+ ///
+ /// The overall height of the set of images (logical window height).
+ ///
+ UINT16 Height;
+ ///
+ /// The number of EFI_HII_ANIMATION_CELL contained in the
+ /// animation sequence.
+ ///
+ UINT16 CellCount;
+ ///
+ /// An array of CellCount animation cells.
+ ///
+ EFI_HII_ANIMATION_CELL AnimationCell[1];
+} EFI_HII_AIBT_RESTORE_SCRN_BLOCK;
+
+///
+/// An animation block to describe an animation sequence that continuously cycles,
+/// and where one image is simply displayed over the previous image.
+///
+typedef EFI_HII_AIBT_OVERLAY_IMAGES_BLOCK EFI_HII_AIBT_OVERLAY_IMAGES_LOOP_BLOCK;
+
+///
+/// An animation block to describe an animation sequence that continuously cycles,
+/// and where the logical window is cleared to the specified color before
+/// the next image is displayed.
+///
+typedef EFI_HII_AIBT_CLEAR_IMAGES_BLOCK EFI_HII_AIBT_CLEAR_IMAGES_LOOP_BLOCK;
+
+///
+/// An animation block to describe an animation sequence that continuously cycles,
+/// and where the screen is restored to the original state before
+/// the next image is displayed.
+///
+typedef EFI_HII_AIBT_RESTORE_SCRN_BLOCK EFI_HII_AIBT_RESTORE_SCRN_LOOP_BLOCK;
+
+///
+/// Assigns a new character value to a previously defined animation sequence.
+///
+typedef struct _EFI_HII_AIBT_DUPLICATE_BLOCK {
+ ///
+ /// The previously defined animation ID with the exact same
+ /// animation information.
+ ///
+ EFI_ANIMATION_ID AnimationId;
+} EFI_HII_AIBT_DUPLICATE_BLOCK;
+
+///
+/// Skips animation IDs.
+///
+typedef struct _EFI_HII_AIBT_SKIP1_BLOCK {
+ ///
+ /// The unsigned 8-bit value to add to AnimationIdCurrent.
+ ///
+ UINT8 SkipCount;
+} EFI_HII_AIBT_SKIP1_BLOCK;
+
+///
+/// Skips animation IDs.
+///
+typedef struct _EFI_HII_AIBT_SKIP2_BLOCK {
+ ///
+ /// The unsigned 16-bit value to add to AnimationIdCurrent.
+ ///
+ UINT16 SkipCount;
+} EFI_HII_AIBT_SKIP2_BLOCK;
+
#pragma pack()
diff --git a/src/include/ipxe/efi/Uefi/UefiMultiPhase.h b/src/include/ipxe/efi/Uefi/UefiMultiPhase.h
index 24cf48eb..d1fe6165 100644
--- a/src/include/ipxe/efi/Uefi/UefiMultiPhase.h
+++ b/src/include/ipxe/efi/Uefi/UefiMultiPhase.h
@@ -1,52 +1,119 @@
/** @file
This includes some definitions introduced in UEFI that will be used in both PEI and DXE phases.
- 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
+Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
+This program and the accompanying materials are licensed and made available under
+the terms and conditions of the BSD License that 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.
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
#ifndef __UEFI_MULTIPHASE_H__
#define __UEFI_MULTIPHASE_H__
-#include <ipxe/efi/ProcessorBind.h>
-
+#include <ipxe/efi/Guid/WinCertificate.h>
///
/// Enumeration of memory types introduced in UEFI.
///
typedef enum {
+ ///
+ /// Not used.
+ ///
EfiReservedMemoryType,
+ ///
+ /// The code portions of a loaded application.
+ /// (Note that UEFI OS loaders are UEFI applications.)
+ ///
EfiLoaderCode,
+ ///
+ /// The data portions of a loaded application and the default data allocation
+ /// type used by an application to allocate pool memory.
+ ///
EfiLoaderData,
+ ///
+ /// The code portions of a loaded Boot Services Driver.
+ ///
EfiBootServicesCode,
+ ///
+ /// The data portions of a loaded Boot Serves Driver, and the default data
+ /// allocation type used by a Boot Services Driver to allocate pool memory.
+ ///
EfiBootServicesData,
+ ///
+ /// The code portions of a loaded Runtime Services Driver.
+ ///
EfiRuntimeServicesCode,
+ ///
+ /// The data portions of a loaded Runtime Services Driver and the default
+ /// data allocation type used by a Runtime Services Driver to allocate pool memory.
+ ///
EfiRuntimeServicesData,
+ ///
+ /// Free (unallocated) memory.
+ ///
EfiConventionalMemory,
+ ///
+ /// Memory in which errors have been detected.
+ ///
EfiUnusableMemory,
+ ///
+ /// Memory that holds the ACPI tables.
+ ///
EfiACPIReclaimMemory,
+ ///
+ /// Address space reserved for use by the firmware.
+ ///
EfiACPIMemoryNVS,
+ ///
+ /// Used by system firmware to request that a memory-mapped IO region
+ /// be mapped by the OS to a virtual address so it can be accessed by EFI runtime services.
+ ///
EfiMemoryMappedIO,
+ ///
+ /// System memory-mapped IO region that is used to translate memory
+ /// cycles to IO cycles by the processor.
+ ///
EfiMemoryMappedIOPortSpace,
+ ///
+ /// Address space reserved by the firmware for code that is part of the processor.
+ ///
EfiPalCode,
EfiMaxMemoryType
} EFI_MEMORY_TYPE;
-
///
/// Data structure that precedes all of the standard EFI table types.
///
typedef struct {
+ ///
+ /// A 64-bit signature that identifies the type of table that follows.
+ /// Unique signatures have been generated for the EFI System Table,
+ /// the EFI Boot Services Table, and the EFI Runtime Services Table.
+ ///
UINT64 Signature;
+ ///
+ /// The revision of the EFI Specification to which this table
+ /// conforms. The upper 16 bits of this field contain the major
+ /// revision value, and the lower 16 bits contain the minor revision
+ /// value. The minor revision values are limited to the range of 00..99.
+ ///
UINT32 Revision;
+ ///
+ /// The size, in bytes, of the entire table including the EFI_TABLE_HEADER.
+ ///
UINT32 HeaderSize;
+ ///
+ /// The 32-bit CRC for the entire table. This value is computed by
+ /// setting this field to 0, and computing the 32-bit CRC for HeaderSize bytes.
+ ///
UINT32 CRC32;
+ ///
+ /// Reserved field that must be set to 0.
+ ///
UINT32 Reserved;
} EFI_TABLE_HEADER;
@@ -64,114 +131,6 @@ typedef struct {
///
#define EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS 0x00000010
-//
-// _WIN_CERTIFICATE.wCertificateType
-//
-#define WIN_CERT_TYPE_EFI_PKCS115 0x0EF0
-#define WIN_CERT_TYPE_EFI_GUID 0x0EF1
-
-///
-/// The WIN_CERTIFICATE structure is part of the PE/COFF specification.
-///
-typedef struct _WIN_CERTIFICATE {
- ///
- /// The length of the entire certificate,
- /// including the length of the header, in bytes.
- ///
- UINT32 dwLength;
- ///
- /// The revision level of the WIN_CERTIFICATE
- /// structure. The current revision level is 0x0200.
- ///
- UINT16 wRevision;
- ///
- /// The certificate type. See WIN_CERT_TYPE_xxx for the UEFI
- /// certificate types. The UEFI specification reserves the range of
- /// certificate type values from 0x0EF0 to 0x0EFF.
- ///
- UINT16 wCertificateType;
- ///
- /// The following is the actual certificate. The format of
- /// the certificate depends on wCertificateType.
- ///
- /// UINT8 bCertificate[ANYSIZE_ARRAY];
- ///
-} WIN_CERTIFICATE;
-
-///
-/// WIN_CERTIFICATE_UEFI_GUID.CertType
-///
-#define EFI_CERT_TYPE_RSA2048_SHA256_GUID \
- {0xa7717414, 0xc616, 0x4977, {0x94, 0x20, 0x84, 0x47, 0x12, 0xa7, 0x35, 0xbf } }
-
-//
-// WIN_CERTIFICATE_UEFI_GUID.CertData
-//
-typedef struct _EFI_CERT_BLOCK_RSA_2048_SHA256 {
- UINT32 HashType;
- UINT8 PublicKey[256];
- UINT8 Signature[256];
-} EFI_CERT_BLOCK_RSA_2048_SHA256;
-
-
-///
-/// Certificate which encapsulates a GUID-specific digital signature
-///
-typedef struct _WIN_CERTIFICATE_UEFI_GUID {
- ///
- /// This is the standard WIN_CERTIFICATE header, where
- /// wCertificateType is set to WIN_CERT_TYPE_UEFI_GUID.
- ///
- WIN_CERTIFICATE Hdr;
- ///
- /// This is the unique id which determines the
- /// format of the CertData. In this case, the
- /// value is EFI_CERT_TYPE_RSA2048_SHA256_GUID.
- ///
- EFI_GUID CertType;
- ///
- /// The following is the certificate data. The format of
- /// the data is determined by the CertType. In this case the value is
- /// EFI_CERT_BLOCK_RSA_2048_SHA256.
- ///
- /// UINT8 CertData[ANYSIZE_ARRAY];
- ///
-} WIN_CERTIFICATE_UEFI_GUID;
-
-
-///
-/// Certificate which encapsulates the RSASSA_PKCS1-v1_5 digital signature.
-///
-/// The WIN_CERTIFICATE_UEFI_PKCS1_15 structure is derived from
-/// WIN_CERTIFICATE and encapsulate the information needed to
-/// implement the RSASSA-PKCS1-v1_5 digital signature algorithm as
-/// specified in RFC2437.
-///
-typedef struct _WIN_CERTIFICATE_EFI_PKCS1_15 {
- ///
- /// This is the standard WIN_CERTIFICATE header, where
- /// wCertificateType is set to WIN_CERT_TYPE_UEFI_PKCS1_15.
- ///
- WIN_CERTIFICATE Hdr;
- ///
- /// This is the hashing algorithm which was performed on the
- /// UEFI executable when creating the digital signature.
- ///
- EFI_GUID HashAlgorithm;
- ///
- /// The following is the actual digital signature. The
- /// size of the signature is the same size as the key
- /// (1024-bit key is 128 bytes) and can be determined by
- /// subtracting the length of the other parts of this header
- /// from the total length of the certificate as found in
- /// Hdr.dwLength.
- ///
- /// UINT8 Signature[ANYSIZE_ARRAY];
- ///
-} WIN_CERTIFICATE_EFI_PKCS1_15;
-
-
-
///
/// AuthInfo is a WIN_CERTIFICATE using the wCertificateType
/// WIN_CERTIFICATE_UEFI_GUID and the CertType
@@ -185,7 +144,7 @@ typedef struct _WIN_CERTIFICATE_EFI_PKCS1_15 {
/// key associated w/ the public/private 2048-bit RSA key-pair. The
/// WIN_CERTIFICATE shall be used to describe the signature of the
/// Variable data *Data. In addition, the signature will also
-/// include the MonotonicCount value to guard against replay attacks
+/// include the MonotonicCount value to guard against replay attacks.
///
typedef struct {
///
diff --git a/src/include/ipxe/efi/Uefi/UefiPxe.h b/src/include/ipxe/efi/Uefi/UefiPxe.h
index bb8ab410..582d0f8d 100644
--- a/src/include/ipxe/efi/Uefi/UefiPxe.h
+++ b/src/include/ipxe/efi/Uefi/UefiPxe.h
@@ -3,18 +3,18 @@
structure prototypes, global variables and constants that
are needed for porting PXE to EFI.
- 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
+Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
+This program and the accompanying materials are licensed and made available under
+the terms and conditions of the BSD License that 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.
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
@par Revision Reference:
32/64-bit PXE specification:
- alpha-4, 99-Dec-17
+ alpha-4, 99-Dec-17.
**/
@@ -30,12 +30,12 @@
)
///
-/// UNDI ROM ID and devive ID signature
+/// UNDI ROM ID and devive ID signature.
///
#define PXE_BUSTYPE_PXE PXE_BUSTYPE ('!', 'P', 'X', 'E')
///
-/// BUS ROM ID signatures
+/// BUS ROM ID signatures.
///
#define PXE_BUSTYPE_PCI PXE_BUSTYPE ('P', 'C', 'I', 'R')
#define PXE_BUSTYPE_PC_CARD PXE_BUSTYPE ('P', 'C', 'C', 'R')
@@ -76,7 +76,7 @@ typedef UINT32 PXE_UINT32;
typedef UINTN PXE_UINTN;
///
-/// typedef unsigned long PXE_UINT64;
+/// Typedef unsigned long PXE_UINT64.
///
typedef UINT64 PXE_UINT64;
@@ -226,12 +226,12 @@ typedef PXE_UINT16 PXE_OPFLAGS;
#define PXE_OPFLAGS_RESET_DISABLE_FILTERS 0x0002
///
-/// UNDI Shutdown
+/// UNDI Shutdown.
///
-/// No OpFlags
+/// No OpFlags.
///
-/// UNDI Interrupt Enables
+/// UNDI Interrupt Enables.
///
///
/// Select whether to enable or disable external interrupt signals.
@@ -267,7 +267,7 @@ typedef PXE_UINT16 PXE_OPFLAGS;
#define PXE_OPFLAGS_INTERRUPT_SOFTWARE 0x0008
///
-/// UNDI Receive Filters
+/// UNDI Receive Filters.
///
///
/// Select whether to enable or disable receive filters.
@@ -315,20 +315,20 @@ typedef PXE_UINT16 PXE_OPFLAGS;
#define PXE_OPFLAGS_RECEIVE_FILTER_ALL_MULTICAST 0x0010
///
-/// UNDI Station Address
+/// UNDI Station Address.
///
#define PXE_OPFLAGS_STATION_ADDRESS_READ 0x0000
#define PXE_OPFLAGS_STATION_ADDRESS_WRITE 0x0000
#define PXE_OPFLAGS_STATION_ADDRESS_RESET 0x0001
///
-/// UNDI Statistics
+/// UNDI Statistics.
///
#define PXE_OPFLAGS_STATISTICS_READ 0x0000
#define PXE_OPFLAGS_STATISTICS_RESET 0x0001
///
-/// UNDI MCast IP to MAC
+/// UNDI MCast IP to MAC.
///
///
/// Identify the type of IP address in the CPB.
@@ -338,7 +338,7 @@ typedef PXE_UINT16 PXE_OPFLAGS;
#define PXE_OPFLAGS_MCAST_IPV6_TO_MAC 0x0001
///
-/// UNDI NvData
+/// UNDI NvData.
///
///
/// Select the type of non-volatile data operation.
@@ -348,7 +348,7 @@ typedef PXE_UINT16 PXE_OPFLAGS;
#define PXE_OPFLAGS_NVDATA_WRITE 0x0001
///
-/// UNDI Get Status
+/// UNDI Get Status.
///
///
/// Return current interrupt status. This will also clear any interrupts
@@ -369,14 +369,19 @@ typedef PXE_UINT16 PXE_OPFLAGS;
#define PXE_OPFLAGS_GET_TRANSMITTED_BUFFERS 0x0002
///
-/// UNDI Fill Header
+/// Return current media status.
+///
+#define PXE_OPFLAGS_GET_MEDIA_STATUS 0x0004
+
+///
+/// UNDI Fill Header.
///
#define PXE_OPFLAGS_FILL_HEADER_OPMASK 0x0001
#define PXE_OPFLAGS_FILL_HEADER_FRAGMENTED 0x0001
#define PXE_OPFLAGS_FILL_HEADER_WHOLE 0x0000
///
-/// UNDI Transmit
+/// UNDI Transmit.
///
///
/// S/W UNDI only. Return after the packet has been transmitted. A
@@ -392,13 +397,13 @@ typedef PXE_UINT16 PXE_OPFLAGS;
#define PXE_OPFLAGS_TRANSMIT_WHOLE 0x0000
///
-/// UNDI Receive
+/// UNDI Receive.
///
-/// No OpFlags
+/// No OpFlags.
///
///
-/// PXE STATFLAGS
+/// PXE STATFLAGS.
///
typedef PXE_UINT16 PXE_STATFLAGS;
@@ -418,7 +423,7 @@ typedef PXE_UINT16 PXE_STATFLAGS;
#define PXE_STATFLAGS_COMMAND_QUEUED 0x4000
///
-/// UNDI Get State
+/// UNDI Get State.
///
#define PXE_STATFLAGS_GET_STATE_MASK 0x0003
#define PXE_STATFLAGS_GET_STATE_INITIALIZED 0x0002
@@ -426,35 +431,39 @@ typedef PXE_UINT16 PXE_STATFLAGS;
#define PXE_STATFLAGS_GET_STATE_STOPPED 0x0000
///
-/// UNDI Start
+/// UNDI Start.
///
-/// No additional StatFlags
+/// No additional StatFlags.
///
///
-/// UNDI Get Init Info
+/// UNDI Get Init Info.
///
#define PXE_STATFLAGS_CABLE_DETECT_MASK 0x0001
#define PXE_STATFLAGS_CABLE_DETECT_NOT_SUPPORTED 0x0000
#define PXE_STATFLAGS_CABLE_DETECT_SUPPORTED 0x0001
+#define PXE_STATFLAGS_GET_STATUS_NO_MEDIA_MASK 0x0002
+#define PXE_STATFLAGS_GET_STATUS_NO_MEDIA_NOT_SUPPORTED 0x0000
+#define PXE_STATFLAGS_GET_STATUS_NO_MEDIA_SUPPORTED 0x0002
+
///
-/// UNDI Initialize
+/// UNDI Initialize.
///
#define PXE_STATFLAGS_INITIALIZED_NO_MEDIA 0x0001
///
-/// UNDI Reset
+/// UNDI Reset.
///
#define PXE_STATFLAGS_RESET_NO_MEDIA 0x0001
///
-/// UNDI Shutdown
+/// UNDI Shutdown.
///
-/// No additional StatFlags
+/// No additional StatFlags.
///
-/// UNDI Interrupt Enables
+/// UNDI Interrupt Enables.
///
///
/// If set, receive interrupts are enabled.
@@ -472,7 +481,7 @@ typedef PXE_UINT16 PXE_STATFLAGS;
#define PXE_STATFLAGS_INTERRUPT_COMMAND 0x0004
///
-/// UNDI Receive Filters
+/// UNDI Receive Filters.
///
///
@@ -502,30 +511,30 @@ typedef PXE_UINT16 PXE_STATFLAGS;
#define PXE_STATFLAGS_RECEIVE_FILTER_ALL_MULTICAST 0x0010
///
-/// UNDI Station Address
+/// UNDI Station Address.
///
-/// No additional StatFlags
+/// No additional StatFlags.
///
///
-/// UNDI Statistics
+/// UNDI Statistics.
///
-/// No additional StatFlags
+/// No additional StatFlags.
///
///
-//// UNDI MCast IP to MAC
+//// UNDI MCast IP to MAC.
////
-//// No additional StatFlags
+//// No additional StatFlags.
///
-/// UNDI NvData
+/// UNDI NvData.
///
-/// No additional StatFlags
+/// No additional StatFlags.
///
///
-/// UNDI Get Status
+/// UNDI Get Status.
///
///
@@ -567,19 +576,24 @@ typedef PXE_UINT16 PXE_STATFLAGS;
#define PXE_STATFLAGS_GET_STATUS_NO_TXBUFS_WRITTEN 0x0020
///
-/// UNDI Fill Header
+/// This flag is set if there is no media detected.
+///
+#define PXE_STATFLAGS_GET_STATUS_NO_MEDIA 0x0040
+
///
-/// No additional StatFlags
+/// UNDI Fill Header.
+///
+/// No additional StatFlags.
///
///
-/// UNDI Transmit
+/// UNDI Transmit.
///
/// No additional StatFlags.
///
/// UNDI Receive
-///
+///.
///
/// No additional StatFlags.
@@ -701,28 +715,28 @@ typedef UINT16 PXE_MEDIA_PROTOCOL;
#define PXE_IFTYPE_FIBRE_CHANNEL 0x12
typedef struct s_pxe_hw_undi {
- PXE_UINT32 Signature; ///< PXE_ROMID_SIGNATURE
- PXE_UINT8 Len; ///< sizeof(PXE_HW_UNDI)
- PXE_UINT8 Fudge; ///< makes 8-bit cksum equal zero
- PXE_UINT8 Rev; ///< PXE_ROMID_REV
- PXE_UINT8 IFcnt; ///< physical connector count
- PXE_UINT8 MajorVer; ///< PXE_ROMID_MAJORVER
- PXE_UINT8 MinorVer; ///< PXE_ROMID_MINORVER
- PXE_UINT16 reserved; ///< zero, not used
- PXE_UINT32 Implementation; ///< implementation flags
- ///< reserved ///< vendor use
- ///< UINT32 Status; ///< status port
- ///< UINT32 Command; ///< command port
- ///< UINT64 CDBaddr; ///< CDB address port
+ PXE_UINT32 Signature; ///< PXE_ROMID_SIGNATURE.
+ PXE_UINT8 Len; ///< sizeof(PXE_HW_UNDI).
+ PXE_UINT8 Fudge; ///< makes 8-bit cksum equal zero.
+ PXE_UINT8 Rev; ///< PXE_ROMID_REV.
+ PXE_UINT8 IFcnt; ///< physical connector count.
+ PXE_UINT8 MajorVer; ///< PXE_ROMID_MAJORVER.
+ PXE_UINT8 MinorVer; ///< PXE_ROMID_MINORVER.
+ PXE_UINT16 reserved; ///< zero, not used.
+ PXE_UINT32 Implementation; ///< implementation flags.
+ ///< reserved ///< vendor use.
+ ///< UINT32 Status; ///< status port.
+ ///< UINT32 Command; ///< command port.
+ ///< UINT64 CDBaddr; ///< CDB address port.
///<
} PXE_HW_UNDI;
///
-/// Status port bit definitions
+/// Status port bit definitions.
///
///
-/// UNDI operation state
+/// UNDI operation state.
///
#define PXE_HWSTAT_STATE_MASK 0xC0000000
#define PXE_HWSTAT_BUSY 0xC0000000
@@ -731,12 +745,12 @@ typedef struct s_pxe_hw_undi {
#define PXE_HWSTAT_STOPPED 0x00000000
///
-/// If set, last command failed
+/// If set, last command failed.
///
#define PXE_HWSTAT_COMMAND_FAILED 0x20000000
///
-/// If set, identifies enabled receive filters
+/// If set, identifies enabled receive filters.
///
#define PXE_HWSTAT_PROMISCUOUS_MULTICAST_RX_ENABLED 0x00001000
#define PXE_HWSTAT_PROMISCUOUS_RX_ENABLED 0x00000800
@@ -745,7 +759,7 @@ typedef struct s_pxe_hw_undi {
#define PXE_HWSTAT_UNICAST_RX_ENABLED 0x00000100
///
-/// If set, identifies enabled external interrupts
+/// If set, identifies enabled external interrupts.
///
#define PXE_HWSTAT_SOFTWARE_INT_ENABLED 0x00000080
#define PXE_HWSTAT_TX_COMPLETE_INT_ENABLED 0x00000040
@@ -753,7 +767,7 @@ typedef struct s_pxe_hw_undi {
#define PXE_HWSTAT_CMD_COMPLETE_INT_ENABLED 0x00000010
///
-/// If set, identifies pending interrupts
+/// If set, identifies pending interrupts.
///
#define PXE_HWSTAT_SOFTWARE_INT_PENDING 0x00000008
#define PXE_HWSTAT_TX_COMPLETE_INT_PENDING 0x00000004
@@ -761,7 +775,7 @@ typedef struct s_pxe_hw_undi {
#define PXE_HWSTAT_CMD_COMPLETE_INT_PENDING 0x00000001
///
-/// Command port definitions
+/// Command port definitions.
///
///
@@ -781,7 +795,7 @@ typedef struct s_pxe_hw_undi {
#define PXE_HWCMD_UNICAST_RX_ENABLE 0x00000100
///
-/// Use these to enable/disable external interrupts
+/// Use these to enable/disable external interrupts.
///
#define PXE_HWCMD_SOFTWARE_INT_ENABLE 0x00000080
#define PXE_HWCMD_TX_COMPLETE_INT_ENABLE 0x00000040
@@ -789,7 +803,7 @@ typedef struct s_pxe_hw_undi {
#define PXE_HWCMD_CMD_COMPLETE_INT_ENABLE 0x00000010
///
-/// Use these to clear pending external interrupts
+/// Use these to clear pending external interrupts.
///
#define PXE_HWCMD_CLEAR_SOFTWARE_INT 0x00000008
#define PXE_HWCMD_CLEAR_TX_COMPLETE_INT 0x00000004
@@ -797,19 +811,19 @@ typedef struct s_pxe_hw_undi {
#define PXE_HWCMD_CLEAR_CMD_COMPLETE_INT 0x00000001
typedef struct s_pxe_sw_undi {
- PXE_UINT32 Signature; ///< PXE_ROMID_SIGNATURE
- PXE_UINT8 Len; ///< sizeof(PXE_SW_UNDI)
- PXE_UINT8 Fudge; ///< makes 8-bit cksum zero
- PXE_UINT8 Rev; ///< PXE_ROMID_REV
- PXE_UINT8 IFcnt; ///< physical connector count
- PXE_UINT8 MajorVer; ///< PXE_ROMID_MAJORVER
- PXE_UINT8 MinorVer; ///< PXE_ROMID_MINORVER
- PXE_UINT16 reserved1; ///< zero, not used
- PXE_UINT32 Implementation; ///< Implementation flags
- PXE_UINT64 EntryPoint; ///< API entry point
- PXE_UINT8 reserved2[3]; ///< zero, not used
- PXE_UINT8 BusCnt; ///< number of bustypes supported
- PXE_UINT32 BusType[1]; ///< list of supported bustypes
+ PXE_UINT32 Signature; ///< PXE_ROMID_SIGNATURE.
+ PXE_UINT8 Len; ///< sizeof(PXE_SW_UNDI).
+ PXE_UINT8 Fudge; ///< makes 8-bit cksum zero.
+ PXE_UINT8 Rev; ///< PXE_ROMID_REV.
+ PXE_UINT8 IFcnt; ///< physical connector count.
+ PXE_UINT8 MajorVer; ///< PXE_ROMID_MAJORVER.
+ PXE_UINT8 MinorVer; ///< PXE_ROMID_MINORVER.
+ PXE_UINT16 reserved1; ///< zero, not used.
+ PXE_UINT32 Implementation; ///< Implementation flags.
+ PXE_UINT64 EntryPoint; ///< API entry point.
+ PXE_UINT8 reserved2[3]; ///< zero, not used.
+ PXE_UINT8 BusCnt; ///< number of bustypes supported.
+ PXE_UINT32 BusType[1]; ///< list of supported bustypes.
} PXE_SW_UNDI;
typedef union u_pxe_undi {
@@ -818,13 +832,13 @@ typedef union u_pxe_undi {
} PXE_UNDI;
///
-/// Signature of !PXE structure
+/// Signature of !PXE structure.
///
#define PXE_ROMID_SIGNATURE PXE_BUSTYPE ('!', 'P', 'X', 'E')
///
/// !PXE structure format revision
-///
+///.
#define PXE_ROMID_REV 0x02
///
@@ -836,7 +850,7 @@ typedef union u_pxe_undi {
#define PXE_ROMID_MINORVER 0x01
///
-/// Implementation flags
+/// Implementation flags.
///
#define PXE_ROMID_IMP_HW_UNDI 0x80000000
#define PXE_ROMID_IMP_SW_VIRT_ADDR 0x40000000
@@ -907,9 +921,9 @@ typedef union pxe_device {
///
/// cpb and db definitions
///
-#define MAX_PCI_CONFIG_LEN 64 ///< # of dwords
-#define MAX_EEPROM_LEN 128 ///< # of dwords
-#define MAX_XMIT_BUFFERS 32 ///< recycling Q length for xmit_done
+#define MAX_PCI_CONFIG_LEN 64 ///< # of dwords.
+#define MAX_EEPROM_LEN 128 ///< # of dwords.
+#define MAX_XMIT_BUFFERS 32 ///< recycling Q length for xmit_done.
#define MAX_MCAST_ADDRESS_CNT 8
typedef struct s_pxe_cpb_start_30 {
@@ -1034,7 +1048,7 @@ typedef struct s_pxe_cpb_start_31 {
/// used with the DMA, it converts the given virtual address to it's
/// physical address and write that in the mapped address pointer.
///
- /// This field can be set to zero if there is no mapping service available
+ /// This field can be set to zero if there is no mapping service available.
///
UINT64 Map_Mem;
@@ -1042,10 +1056,10 @@ typedef struct s_pxe_cpb_start_31 {
/// PXE_VOID UnMap_Mem(UINT64 unq_id, UINT64 virtual_addr, UINT32 size,
/// UINT32 Direction, UINT64 mapped_addr);
///
- /// UNDI will pass the virtual and mapped addresses of a buffer
- /// This call will un map the given address
+ /// UNDI will pass the virtual and mapped addresses of a buffer.
+ /// This call will un map the given address.
///
- /// This field can be set to zero if there is no unmapping service available
+ /// This field can be set to zero if there is no unmapping service available.
///
UINT64 UnMap_Mem;
@@ -1053,11 +1067,11 @@ typedef struct s_pxe_cpb_start_31 {
/// PXE_VOID Sync_Mem(UINT64 unq_id, UINT64 virtual,
/// UINT32 size, UINT32 Direction, UINT64 mapped_addr);
///
- /// UNDI will pass the virtual and mapped addresses of a buffer
- /// This call will synchronize the contents of both the virtual and mapped
+ /// UNDI will pass the virtual and mapped addresses of a buffer.
+ /// This call will synchronize the contents of both the virtual and mapped.
/// buffers for the given Direction.
///
- /// This field can be set to zero if there is no service available
+ /// This field can be set to zero if there is no service available.
///
UINT64 Sync_Mem;
@@ -1181,7 +1195,7 @@ typedef struct s_pxe_pci_config_info {
UINT32 BusType;
///
- /// This identifies the PCI network device that this UNDI interface
+ /// This identifies the PCI network device that this UNDI interface.
/// is bound to.
///
UINT16 Bus;
diff --git a/src/include/ipxe/efi/Uefi/UefiSpec.h b/src/include/ipxe/efi/Uefi/UefiSpec.h
index 4d34b19d..6e2f26b1 100644
--- a/src/include/ipxe/efi/Uefi/UefiSpec.h
+++ b/src/include/ipxe/efi/Uefi/UefiSpec.h
@@ -5,14 +5,14 @@
If a code construct is defined in the UEFI 2.1 specification it must be included
by this include file.
- 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
+Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
+This program and the accompanying materials are licensed and made available under
+the terms and conditions of the BSD License that 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.
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
@@ -26,12 +26,25 @@
#include <ipxe/efi/Protocol/SimpleTextOut.h>
///
-/// Enumeration of memory allocation.
+/// Enumeration of EFI memory allocation types.
///
typedef enum {
+ ///
+ /// Allocate any available range of pages that satisfies the request.
+ ///
AllocateAnyPages,
+ ///
+ /// Allocate any available range of pages whose uppermost address is less than
+ /// or equal to a specified maximum address.
+ ///
AllocateMaxAddress,
+ ///
+ /// Allocate pages at a specified address.
+ ///
AllocateAddress,
+ ///
+ /// Maximum enumeration value that may be used for bounds checking.
+ ///
MaxAllocateType
} EFI_ALLOCATE_TYPE;
@@ -42,7 +55,7 @@ typedef enum {
#define EFI_TIME_IN_DAYLIGHT 0x02
///
-/// Value definition for EFI_TIME.TimeZone
+/// Value definition for EFI_TIME.TimeZone.
///
#define EFI_UNSPECIFIED_TIMEZONE 0x07FF
@@ -66,38 +79,47 @@ typedef enum {
#define EFI_MEMORY_RUNTIME 0x8000000000000000ULL
///
-/// Memory descriptor version number
+/// Memory descriptor version number.
///
#define EFI_MEMORY_DESCRIPTOR_VERSION 1
///
-/// Definition of memory descriptor
+/// Definition of an EFI memory descriptor.
///
typedef struct {
+ ///
+ /// Type of the memory region. See EFI_MEMORY_TYPE.
+ ///
UINT32 Type;
+ ///
+ /// Physical address of the first byte of the memory region. Must aligned
+ /// on a 4 KB boundary.
+ ///
EFI_PHYSICAL_ADDRESS PhysicalStart;
+ ///
+ /// Virtual address of the first byte of the memory region. Must aligned
+ /// on a 4 KB boundary.
+ ///
EFI_VIRTUAL_ADDRESS VirtualStart;
+ ///
+ /// Number of 4KB pages in the memory region.
+ ///
UINT64 NumberOfPages;
+ ///
+ /// Attributes of the memory region that describe the bit mask of capabilities
+ /// for that memory region, and not necessarily the current settings for that
+ /// memory region.
+ ///
UINT64 Attribute;
} EFI_MEMORY_DESCRIPTOR;
-///
-/// Build macros to find next EFI_MEMORY_DESCRIPTOR.
-///
-#define NEXT_MEMORY_DESCRIPTOR(_Ptr, _Size) ((EFI_MEMORY_DESCRIPTOR *) (((UINT8 *) (_Ptr)) + (_Size)))
-
-///
-/// Declare forward referenced data structures
-///
-typedef struct _EFI_SYSTEM_TABLE EFI_SYSTEM_TABLE;
-
/**
Allocates memory pages from the system.
@param Type The type of allocation to perform.
@param MemoryType The type of memory to allocate.
@param Pages The number of contiguous 4 KB pages to allocate.
- @param Memory Pointer to a physical address. On input, the way in which the address is
+ @param Memory The pointer to a physical address. On input, the way in which the address is
used depends on the value of Type.
@retval EFI_SUCCESS The requested pages were allocated.
@@ -196,7 +218,7 @@ EFI_STATUS
/**
Returns pool memory to the system.
- @param Buffer Pointer to the buffer to free.
+ @param Buffer The pointer to the buffer to free.
@retval EFI_SUCCESS The memory was returned to the system.
@retval EFI_INVALID_PARAMETER Buffer was invalid.
@@ -306,7 +328,6 @@ EFI_STATUS
// ConvertPointer DebugDisposition type.
//
#define EFI_OPTIONAL_PTR 0x00000001
-#define EFI_OPTIONAL_POINTER EFI_OPTIONAL_PTR
/**
Determines the new virtual address that is to be used on subsequent memory accesses.
@@ -356,7 +377,7 @@ EFI_STATUS
Invoke a notification event
@param Event Event whose notification function is being invoked.
- @param Context Pointer to the notification function's context,
+ @param Context The pointer to the notification function's context,
which is implementation-dependent.
**/
@@ -372,10 +393,10 @@ VOID
@param Type The type of event to create and its mode and attributes.
@param NotifyTpl The task priority level of event notifications, if needed.
- @param NotifyFunction Pointer to the event's notification function, if any.
- @param NotifyContext Pointer to the notification function's context; corresponds to parameter
+ @param NotifyFunction The pointer to the event's notification function, if any.
+ @param NotifyContext The pointer to the notification function's context; corresponds to parameter
Context in the notification function.
- @param Event Pointer to the newly created event if the call succeeds; undefined
+ @param Event The pointer to the newly created event if the call succeeds; undefined
otherwise.
@retval EFI_SUCCESS The event structure was created.
@@ -398,13 +419,13 @@ EFI_STATUS
@param Type The type of event to create and its mode and attributes.
@param NotifyTpl The task priority level of event notifications,if needed.
- @param NotifyFunction Pointer to the event's notification function, if any.
- @param NotifyContext Pointer to the notification function's context; corresponds to parameter
+ @param NotifyFunction The pointer to the event's notification function, if any.
+ @param NotifyContext The pointer to the notification function's context; corresponds to parameter
Context in the notification function.
- @param EventGroup Pointer to the unique identifier of the group to which this event belongs.
+ @param EventGroup The pointer to the unique identifier of the group to which this event belongs.
If this is NULL, then the function behaves as if the parameters were passed
to CreateEvent.
- @param Event Pointer to the newly created event if the call succeeds; undefined
+ @param Event The pointer to the newly created event if the call succeeds; undefined
otherwise.
@retval EFI_SUCCESS The event structure was created.
@@ -427,8 +448,17 @@ EFI_STATUS
/// Timer delay types
///
typedef enum {
+ ///
+ /// An event's timer settings is to be cancelled and not trigger time is to be set/
+ ///
TimerCancel,
+ ///
+ /// An event is to be signalled periodically at a specified interval from the current time.
+ ///
TimerPeriodic,
+ ///
+ /// An event is to be signalled once at a specified interval from the current time.
+ ///
TimerRelative
} EFI_TIMER_DELAY;
@@ -475,7 +505,7 @@ EFI_STATUS
@param NumberOfEvents The number of events in the Event array.
@param Event An array of EFI_EVENT.
- @param Index Pointer to the index of the event which satisfied the wait condition.
+ @param Index The pointer to the index of the event which satisfied the wait condition.
@retval EFI_SUCCESS The event indicated by Index was signaled.
@retval EFI_INVALID_PARAMETER 1) NumberOfEvents is 0.
@@ -561,8 +591,8 @@ VOID
/**
Returns the value of a variable.
- @param VariableName A Null-terminated Unicode string that is the name of the
- vendor's variable.
+ @param VariableName A Null-terminated string that is the name of the vendor's
+ variable.
@param VendorGuid A unique identifier for the vendor.
@param Attributes If not NULL, a pointer to the memory location to return the
attributes bitmask for the variable.
@@ -597,7 +627,7 @@ EFI_STATUS
@param VariableNameSize The size of the VariableName buffer.
@param VariableName On input, supplies the last VariableName that was returned
by GetNextVariableName(). On output, returns the Nullterminated
- Unicode string of the current variable.
+ string of the current variable.
@param VendorGuid On input, supplies the last VendorGuid that was returned by
GetNextVariableName(). On output, returns the
VendorGuid of the current variable.
@@ -622,23 +652,28 @@ EFI_STATUS
/**
Sets the value of a variable.
- @param VariableName A Null-terminated Unicode string that is the name of the
- vendor's variable.
- @param VendorGuid A unique identifier for the vendor.
- @param Attributes Attributes bitmask to set for the variable.
- @param DataSize The size in bytes of the Data buffer.
- @param Data The contents for the variable.
+ @param VariableName A Null-terminated string that is the name of the vendor's variable.
+ Each VariableName is unique for each VendorGuid. VariableName must
+ contain 1 or more characters. If VariableName is an empty string,
+ then EFI_INVALID_PARAMETER is returned.
+ @param VendorGuid A unique identifier for the vendor.
+ @param Attributes Attributes bitmask to set for the variable.
+ @param DataSize The size in bytes of the Data buffer. A size of zero causes the
+ variable to be deleted.
+ @param Data The contents for the variable.
@retval EFI_SUCCESS The firmware has successfully stored the variable and its data as
defined by the Attributes.
@retval EFI_INVALID_PARAMETER An invalid combination of attribute bits was supplied, or the
DataSize exceeds the maximum allowed.
- @retval EFI_INVALID_PARAMETER VariableName is an empty Unicode string.
+ @retval EFI_INVALID_PARAMETER VariableName is an empty string.
@retval EFI_OUT_OF_RESOURCES Not enough storage is available to hold the variable and its data.
@retval EFI_DEVICE_ERROR The variable could not be retrieved due to a hardware error.
@retval EFI_WRITE_PROTECTED The variable in question is read-only.
@retval EFI_WRITE_PROTECTED The variable in question cannot be deleted.
- @retval EFI_SECURITY_VIOLATION The variable could not be retrieved due to an authentication failure.
+ @retval EFI_SECURITY_VIOLATION The variable could not be written due to EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS
+ set but the AuthInfo does NOT pass the validation check carried out
+ by the firmware.
@retval EFI_NOT_FOUND The variable trying to be updated or deleted was not found.
**/
@@ -658,8 +693,27 @@ EFI_STATUS
/// real time clock device as exposed through the EFI interfaces.
///
typedef struct {
+ ///
+ /// Provides the reporting resolution of the real-time clock device in
+ /// counts per second. For a normal PC-AT CMOS RTC device, this
+ /// value would be 1 Hz, or 1, to indicate that the device only reports
+ /// the time to the resolution of 1 second.
+ ///
UINT32 Resolution;
+ ///
+ /// Provides the timekeeping accuracy of the real-time clock in an
+ /// error rate of 1E-6 parts per million. For a clock with an accuracy
+ /// of 50 parts per million, the value in this field would be
+ /// 50,000,000.
+ ///
UINT32 Accuracy;
+ ///
+ /// A TRUE indicates that a time set operation clears the device's
+ /// time below the Resolution reporting level. A FALSE
+ /// indicates that the state below the Resolution level of the
+ /// device is not cleared when the time is set. Normal PC-AT CMOS
+ /// RTC devices set this value to FALSE.
+ ///
BOOLEAN SetsToZero;
} EFI_TIME_CAPABILITIES;
@@ -744,25 +798,6 @@ EFI_STATUS
);
/**
- This is the declaration of an EFI image entry point. This entry point is
- the same for UEFI Applications, UEFI OS Loaders, and UEFI Drivers including
- both device drivers and bus drivers.
-
- @param ImageHandle The firmware allocated handle for the UEFI image.
- @param SystemTable A pointer to the EFI System Table.
-
- @retval EFI_SUCCESS The operation completed successfully.
- @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources.
-
-**/
-typedef
-EFI_STATUS
-(EFIAPI *EFI_IMAGE_ENTRY_POINT)(
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- );
-
-/**
Loads an EFI image into memory.
@param BootPolicy If TRUE, indicates that the request originates from the boot
@@ -775,7 +810,7 @@ EFI_STATUS
@param SourceBuffer If not NULL, a pointer to the memory location containing a copy
of the image to be loaded.
@param SourceSize The size in bytes of SourceBuffer. Ignored if SourceBuffer is NULL.
- @param ImageHandle Pointer to the returned image handle that is created when the
+ @param ImageHandle The pointer to the returned image handle that is created when the
image is successfully loaded.
@retval EFI_SUCCESS Image was loaded into memory correctly.
@@ -803,12 +838,12 @@ EFI_STATUS
Transfers control to a loaded image's entry point.
@param ImageHandle Handle of image to be started.
- @param ExitDataSize Pointer to the size, in bytes, of ExitData.
- @param ExitData Pointer to a pointer to a data buffer that includes a Null-terminated
- Unicode string, optionally followed by additional binary data.
+ @param ExitDataSize The pointer to the size, in bytes, of ExitData.
+ @param ExitData The pointer to a pointer to a data buffer that includes a Null-terminated
+ string, optionally followed by additional binary data.
@retval EFI_INVALID_PARAMETER ImageHandle is either an invalid image handle or the image
- has already been initialized with StartImage
+ has already been initialized with StartImage.
@return Exit code from image
**/
@@ -823,11 +858,16 @@ EFI_STATUS
/**
Terminates a loaded EFI image and returns control to boot services.
- @param ImageHandle Handle that identifies the image.
+ @param ImageHandle Handle that identifies the image. This parameter is passed to the
+ image on entry.
@param ExitStatus The image's exit code.
- @param ExitDataSize The size, in bytes, of ExitData.
- @param ExitData Pointer to a data buffer that includes a Null-terminated Unicode string,
- optionally followed by additional binary data.
+ @param ExitDataSize The size, in bytes, of ExitData. Ignored if ExitStatus is EFI_SUCCESS.
+ @param ExitData The pointer to a data buffer that includes a Null-terminated string,
+ optionally followed by additional binary data. The string is a
+ description that the caller may use to further indicate the reason
+ for the image's exit. ExitData is only valid if ExitStatus
+ is something other than EFI_SUCCESS. The ExitData buffer
+ must be allocated by calling AllocatePool().
@retval EFI_SUCCESS The image specified by ImageHandle was unloaded.
@retval EFI_INVALID_PARAMETER The image specified by ImageHandle has been loaded and
@@ -851,8 +891,6 @@ EFI_STATUS
@retval EFI_SUCCESS The image has been unloaded.
@retval EFI_INVALID_PARAMETER ImageHandle is not a valid image handle.
- @retval EFI_UNSUPPORTED The image has been started, and does not support unload.
- @return Exit code from the image's unload handler
**/
typedef
@@ -899,13 +937,13 @@ EFI_STATUS
@param Timeout The number of seconds to set the watchdog timer to.
@param WatchdogCode The numeric code to log on a watchdog timer timeout event.
@param DataSize The size, in bytes, of WatchdogData.
- @param WatchdogData A data buffer that includes a Null-terminated Unicode string, optionally
+ @param WatchdogData A data buffer that includes a Null-terminated string, optionally
followed by additional binary data.
@retval EFI_SUCCESS The timeout has been set.
@retval EFI_INVALID_PARAMETER The supplied WatchdogCode is invalid.
@retval EFI_UNSUPPORTED The system does not have a watchdog timer.
- @retval EFI_DEVICE_ERROR The watch dog timer could not be programmed due to a hardware
+ @retval EFI_DEVICE_ERROR The watchdog timer could not be programmed due to a hardware
error.
**/
@@ -922,10 +960,25 @@ EFI_STATUS
/// Enumeration of reset types.
///
typedef enum {
+ ///
+ /// Used to induce a system-wide reset. This sets all circuitry within the
+ /// system to its initial state. This type of reset is asynchronous to system
+ /// operation and operates withgout regard to cycle boundaries. EfiColdReset
+ /// is tantamount to a system power cycle.
+ ///
EfiResetCold,
+ ///
+ /// Used to induce a system-wide initialization. The processors are set to their
+ /// initial state, and pending cycles are not corrupted. If the system does
+ /// not support this reset type, then an EfiResetCold must be performed.
+ ///
EfiResetWarm,
- EfiResetShutdown,
- EfiResetUpdate
+ ///
+ /// Used to induce an entry into a power state equivalent to the ACPI G2/S5 or G3
+ /// state. If the system does not support this reset type, then when the system
+ /// is rebooted, it should exhibit the EfiResetCold attributes.
+ ///
+ EfiResetShutdown
} EFI_RESET_TYPE;
/**
@@ -936,7 +989,7 @@ typedef enum {
@param DataSize The size, in bytes, of WatchdogData.
@param ResetData For a ResetType of EfiResetCold, EfiResetWarm, or
EfiResetShutdown the data buffer starts with a Null-terminated
- Unicode string, optionally followed by additional binary data.
+ string, optionally followed by additional binary data.
**/
typedef
@@ -945,13 +998,13 @@ VOID
IN EFI_RESET_TYPE ResetType,
IN EFI_STATUS ResetStatus,
IN UINTN DataSize,
- IN CHAR16 *ResetData OPTIONAL
+ IN VOID *ResetData OPTIONAL
);
/**
Returns a monotonically increasing count for the platform.
- @param Count Pointer to returned value.
+ @param Count The pointer to returned value.
@retval EFI_SUCCESS The next monotonic count was returned.
@retval EFI_INVALID_PARAMETER Count is NULL.
@@ -967,7 +1020,7 @@ EFI_STATUS
/**
Returns the next high 32 bits of the platform's monotonic counter.
- @param HighCount Pointer to returned value.
+ @param HighCount The pointer to returned value.
@retval EFI_SUCCESS The next high monotonic count was returned.
@retval EFI_INVALID_PARAMETER HighCount is NULL.
@@ -1006,8 +1059,8 @@ EFI_STATUS
/**
Copies the contents of one buffer to another buffer.
- @param Destination Pointer to the destination buffer of the memory copy.
- @param Source Pointer to the source buffer of the memory copy.
+ @param Destination The pointer to the destination buffer of the memory copy.
+ @param Source The pointer to the source buffer of the memory copy.
@param Length Number of bytes to copy from Source to Destination.
**/
@@ -1022,7 +1075,7 @@ VOID
/**
The SetMem() function fills a buffer with a specified value.
- @param Buffer Pointer to the buffer to fill.
+ @param Buffer The pointer to the buffer to fill.
@param Size Number of bytes in Buffer to fill.
@param Value Value to fill Buffer with.
@@ -1035,11 +1088,13 @@ VOID
IN UINT8 Value
);
-
-//
-// Protocol handler functions
-//
+///
+/// Enumeration of EFI Interface Types
+///
typedef enum {
+ ///
+ /// Indicates that the supplied protocol interface is supplied in native form.
+ ///
EFI_NATIVE_INTERFACE
} EFI_INTERFACE_TYPE;
@@ -1262,7 +1317,9 @@ EFI_STATUS
IN EFI_HANDLE ControllerHandle
);
-
+///
+/// EFI Oprn Protocol Information Entry
+///
typedef struct {
EFI_HANDLE AgentHandle;
EFI_HANDLE ControllerHandle;
@@ -1346,10 +1403,22 @@ EFI_STATUS
OUT VOID **Registration
);
-
+///
+/// Enumeration of EFI Locate Search Types
+///
typedef enum {
+ ///
+ /// Retrieve all the handles in the handle database.
+ ///
AllHandles,
+ ///
+ /// Retrieve the next handle fron a RegisterProtocolNotify() event.
+ ///
ByRegisterNotify,
+ ///
+ /// Retrieve the set of handles from the handle database that support a
+ /// specified protocol.
+ ///
ByProtocol
} EFI_LOCATE_SEARCH_TYPE;
@@ -1429,7 +1498,6 @@ EFI_STATUS
IN VOID *Table
);
-
/**
Returns an array of handles that support the requested protocol in a buffer allocated from pool.
@@ -1483,33 +1551,75 @@ EFI_STATUS
OUT VOID **Interface
);
+///
+/// EFI Capsule Block Descriptor
+///
typedef struct {
- UINT64 Length;
+ ///
+ /// Length in bytes of the data pointed to by DataBlock/ContinuationPointer.
+ ///
+ UINT64 Length;
union {
+ ///
+ /// Physical address of the data block. This member of the union is
+ /// used if Length is not equal to zero.
+ ///
EFI_PHYSICAL_ADDRESS DataBlock;
+ ///
+ /// Physical address of another block of
+ /// EFI_CAPSULE_BLOCK_DESCRIPTOR structures. This
+ /// member of the union is used if Length is equal to zero. If
+ /// ContinuationPointer is zero this entry represents the end of the list.
+ ///
EFI_PHYSICAL_ADDRESS ContinuationPointer;
} Union;
} EFI_CAPSULE_BLOCK_DESCRIPTOR;
+///
+/// EFI Capsule Header.
+///
typedef struct {
+ ///
+ /// A GUID that defines the contents of a capsule.
+ ///
EFI_GUID CapsuleGuid;
+ ///
+ /// The size of the capsule header. This may be larger than the size of
+ /// the EFI_CAPSULE_HEADER since CapsuleGuid may imply
+ /// extended header entries
+ ///
UINT32 HeaderSize;
+ ///
+ /// Bit-mapped list describing the capsule attributes. The Flag values
+ /// of 0x0000 - 0xFFFF are defined by CapsuleGuid. Flag values
+ /// of 0x10000 - 0xFFFFFFFF are defined by this specification
+ ///
UINT32 Flags;
+ ///
+ /// Size in bytes of the capsule.
+ ///
UINT32 CapsuleImageSize;
} EFI_CAPSULE_HEADER;
-//
-// The EFI System Table entry must point to an array of capsules
-// that contain the same CapsuleGuid value. The array must be
-// prefixed by a UINT32 that represents the size of the array of capsules.
-//
+///
+/// The EFI System Table entry must point to an array of capsules
+/// that contain the same CapsuleGuid value. The array must be
+/// prefixed by a UINT32 that represents the size of the array of capsules.
+///
typedef struct {
+ ///
+ /// the size of the array of capsules.
+ ///
UINT32 CapsuleArrayNumber;
+ ///
+ /// Point to an array of capsules that contain the same CapsuleGuid value.
+ ///
VOID* CapsulePtr[1];
} EFI_CAPSULE_TABLE;
#define CAPSULE_FLAGS_PERSIST_ACROSS_RESET 0x00010000
#define CAPSULE_FLAGS_POPULATE_SYSTEM_TABLE 0x00020000
+#define CAPSULE_FLAGS_INITIATE_RESET 0x00040000
/**
Passes capsules to the firmware with both virtual and physical mapping. Depending on the intended
@@ -1529,8 +1639,10 @@ typedef struct {
@retval EFI_SUCCESS Valid capsule was passed. If
CAPSULE_FLAGS_PERSIT_ACROSS_RESET is not set, the
capsule has been successfully processed by the firmware.
+ @retval EFI_INVALID_PARAMETER CapsuleSize is NULL, or an incompatible set of flags were
+ set in the capsule header.
+ @retval EFI_INVALID_PARAMETER CapsuleCount is 0.
@retval EFI_DEVICE_ERROR The capsule update was started, but failed due to a device error.
- @retval EFI_INVALID_PARAMETER CapsuleSize is NULL.
@retval EFI_UNSUPPORTED The capsule type is not supported on this platform.
@retval EFI_OUT_OF_RESOURCES There were insufficient resources to process the capsule.
@@ -1606,18 +1718,20 @@ EFI_STATUS
//
// EFI Runtime Services Table
//
-#define EFI_SYSTEM_TABLE_SIGNATURE 0x5453595320494249ULL
-#define EFI_SYSTEM_TABLE_REVISION ((2<<16) | (10))
-#define EFI_2_10_SYSTEM_TABLE_REVISION ((2<<16) | (10))
-#define EFI_2_00_SYSTEM_TABLE_REVISION ((2<<16) | (00))
-#define EFI_1_10_SYSTEM_TABLE_REVISION ((1<<16) | (10))
-#define EFI_1_02_SYSTEM_TABLE_REVISION ((1<<16) | (02))
-
-#define EFI_RUNTIME_SERVICES_SIGNATURE 0x56524553544e5552ULL
-#define EFI_RUNTIME_SERVICES_REVISION EFI_2_10_SYSTEM_TABLE_REVISION
+#define EFI_SYSTEM_TABLE_SIGNATURE SIGNATURE_64 ('I','B','I',' ','S','Y','S','T')
+#define EFI_2_30_SYSTEM_TABLE_REVISION ((2 << 16) | (30))
+#define EFI_2_20_SYSTEM_TABLE_REVISION ((2 << 16) | (20))
+#define EFI_2_10_SYSTEM_TABLE_REVISION ((2 << 16) | (10))
+#define EFI_2_00_SYSTEM_TABLE_REVISION ((2 << 16) | (00))
+#define EFI_1_10_SYSTEM_TABLE_REVISION ((1 << 16) | (10))
+#define EFI_1_02_SYSTEM_TABLE_REVISION ((1 << 16) | (02))
+#define EFI_SYSTEM_TABLE_REVISION EFI_2_30_SYSTEM_TABLE_REVISION
+
+#define EFI_RUNTIME_SERVICES_SIGNATURE SIGNATURE_64 ('R','U','N','T','S','E','R','V')
+#define EFI_RUNTIME_SERVICES_REVISION EFI_2_30_SYSTEM_TABLE_REVISION
///
-/// EFI Runtime Services Table
+/// EFI Runtime Services Table.
///
typedef struct {
///
@@ -1665,11 +1779,11 @@ typedef struct {
} EFI_RUNTIME_SERVICES;
-#define EFI_BOOT_SERVICES_SIGNATURE 0x56524553544f4f42ULL
-#define EFI_BOOT_SERVICES_REVISION EFI_2_10_SYSTEM_TABLE_REVISION
+#define EFI_BOOT_SERVICES_SIGNATURE SIGNATURE_64 ('B','O','O','T','S','E','R','V')
+#define EFI_BOOT_SERVICES_REVISION EFI_2_30_SYSTEM_TABLE_REVISION
///
-/// EFI Boot Services Table
+/// EFI Boot Services Table.
///
typedef struct {
///
@@ -1770,7 +1884,7 @@ typedef struct {
/// Contains a set of GUID/pointer pairs comprised of the ConfigurationTable field in the
/// EFI System Table.
///
-typedef struct{
+typedef struct {
///
/// The 128-bit GUID value that uniquely identifies the system configuration table.
///
@@ -1784,14 +1898,14 @@ typedef struct{
///
/// EFI System Table
///
-struct _EFI_SYSTEM_TABLE {
+typedef struct {
///
/// The table header for the EFI System Table.
///
EFI_TABLE_HEADER Hdr;
///
- /// A pointer to a null terminated Unicode string that identifies
- /// the vendor that produces the system firmware for the platform.
+ /// A pointer to a null terminated string that identifies the vendor
+ /// that produces the system firmware for the platform.
///
CHAR16 *FirmwareVendor;
///
@@ -1800,11 +1914,12 @@ struct _EFI_SYSTEM_TABLE {
///
UINT32 FirmwareRevision;
///
- /// The handle for the active console input device.
+ /// The handle for the active console input device. This handle must support
+ /// EFI_SIMPLE_TEXT_INPUT_PROTOCOL and EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL.
///
EFI_HANDLE ConsoleInHandle;
///
- /// A pointer to the SIMPLE_INPUT_PROTOCOL interface that is
+ /// A pointer to the EFI_SIMPLE_TEXT_INPUT_PROTOCOL interface that is
/// associated with ConsoleInHandle.
///
EFI_SIMPLE_TEXT_INPUT_PROTOCOL *ConIn;
@@ -1813,16 +1928,17 @@ struct _EFI_SYSTEM_TABLE {
///
EFI_HANDLE ConsoleOutHandle;
///
- /// A pointer to the SIMPLE_TEXT_OUTPUT_PROTOCOL interface
+ /// A pointer to the EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL interface
/// that is associated with ConsoleOutHandle.
///
EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *ConOut;
///
/// The handle for the active standard error console device.
+ /// This handle must support the EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL.
///
EFI_HANDLE StandardErrorHandle;
///
- /// A pointer to the SIMPLE_TEXT_OUTPUT_PROTOCOL interface
+ /// A pointer to the EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL interface
/// that is associated with StandardErrorHandle.
///
EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *StdErr;
@@ -1843,7 +1959,25 @@ struct _EFI_SYSTEM_TABLE {
/// The number of entries in the table is NumberOfTableEntries.
///
EFI_CONFIGURATION_TABLE *ConfigurationTable;
-};
+} EFI_SYSTEM_TABLE;
+
+/**
+ This is the declaration of an EFI image entry point. This entry point is
+ the same for UEFI Applications, UEFI OS Loaders, and UEFI Drivers including
+ both device drivers and bus drivers.
+
+ @param ImageHandle The firmware allocated handle for the UEFI image.
+ @param SystemTable A pointer to the EFI System Table.
+
+ @retval EFI_SUCCESS The operation completed successfully.
+ @retval Others An unexpected error occurred.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_IMAGE_ENTRY_POINT)(
+ IN EFI_HANDLE ImageHandle,
+ IN EFI_SYSTEM_TABLE *SystemTable
+ );
//
// EFI Load Options Attributes
@@ -1860,43 +1994,84 @@ struct _EFI_SYSTEM_TABLE {
#define EFI_BOOT_OPTION_SUPPORT_APP 0x00000002
#define EFI_BOOT_OPTION_SUPPORT_COUNT 0x00000300
+///
+/// EFI Boot Key Data
+///
typedef union {
struct {
+ ///
+ /// Indicates the revision of the EFI_KEY_OPTION structure. This revision level should be 0.
+ ///
UINT32 Revision : 8;
+ ///
+ /// Either the left or right Shift keys must be pressed (1) or must not be pressed (0).
+ ///
UINT32 ShiftPressed : 1;
+ ///
+ /// Either the left or right Control keys must be pressed (1) or must not be pressed (0).
+ ///
UINT32 ControlPressed : 1;
+ ///
+ /// Either the left or right Alt keys must be pressed (1) or must not be pressed (0).
+ ///
UINT32 AltPressed : 1;
+ ///
+ /// Either the left or right Logo keys must be pressed (1) or must not be pressed (0).
+ ///
UINT32 LogoPressed : 1;
+ ///
+ /// The Menu key must be pressed (1) or must not be pressed (0).
+ ///
UINT32 MenuPressed : 1;
- UINT32 SysReqPessed : 1;
+ ///
+ /// The SysReq key must be pressed (1) or must not be pressed (0).
+ ///
+ UINT32 SysReqPressed : 1;
UINT32 Reserved : 16;
+ ///
+ /// Specifies the actual number of entries in EFI_KEY_OPTION.Keys, from 0-3. If
+ /// zero, then only the shift state is considered. If more than one, then the boot option will
+ /// only be launched if all of the specified keys are pressed with the same shift state.
+ ///
UINT32 InputKeyCount : 2;
} Options;
UINT32 PackedValue;
-} HOT_KEY_EFI_KEY_DATA;
+} EFI_BOOT_KEY_DATA;
+///
+/// EFI Key Option.
+///
typedef struct {
- HOT_KEY_EFI_KEY_DATA KeyOptions;
- UINT32 BootOptionCrc;
- UINT16 BootOption;
-//EFI_INPUT_KEY Keys[];
+ ///
+ /// Specifies options about how the key will be processed.
+ ///
+ EFI_BOOT_KEY_DATA KeyData;
+ ///
+ /// The CRC-32 which should match the CRC-32 of the entire EFI_LOAD_OPTION to
+ /// which BootOption refers. If the CRC-32s do not match this value, then this key
+ /// option is ignored.
+ ///
+ UINT32 BootOptionCrc;
+ ///
+ /// The Boot#### option which will be invoked if this key is pressed and the boot option
+ /// is active (LOAD_OPTION_ACTIVE is set).
+ ///
+ UINT16 BootOption;
+ ///
+ /// The key codes to compare against those returned by the
+ /// EFI_SIMPLE_TEXT_INPUT and EFI_SIMPLE_TEXT_INPUT_EX protocols.
+ /// The number of key codes (0-3) is specified by the EFI_KEY_CODE_COUNT field in KeyOptions.
+ ///
+ //EFI_INPUT_KEY Keys[];
} EFI_KEY_OPTION;
-#define EFI_KEY_OPTION_SHIFT 0x00000001
-#define EFI_KEY_OPTION_CONTROL 0x00000002
-#define EFI_KEY_OPTION_ALT 0x00000004
-#define EFI_KEY_OPTION_LOGO 0x00000008
-#define EFI_KEY_OPTION_MENU 0x00000010
-#define EFI_KEY_OPTION_SYSREQ 0x00000020
-#define EFI_KEY_CODE_COUNT 0x00000300
-
-
//
// EFI File location to boot from on removable media devices
//
#define EFI_REMOVABLE_MEDIA_FILE_NAME_IA32 L"\\EFI\\BOOT\\BOOTIA32.EFI"
#define EFI_REMOVABLE_MEDIA_FILE_NAME_IA64 L"\\EFI\\BOOT\\BOOTIA64.EFI"
#define EFI_REMOVABLE_MEDIA_FILE_NAME_X64 L"\\EFI\\BOOT\\BOOTX64.EFI"
+#define EFI_REMOVABLE_MEDIA_FILE_NAME_ARM L"\\EFI\\BOOT\\BOOTARM.EFI"
#if defined (MDE_CPU_IA32)
#define EFI_REMOVABLE_MEDIA_FILE_NAME EFI_REMOVABLE_MEDIA_FILE_NAME_IA32
@@ -1905,6 +2080,8 @@ typedef struct {
#elif defined (MDE_CPU_X64)
#define EFI_REMOVABLE_MEDIA_FILE_NAME EFI_REMOVABLE_MEDIA_FILE_NAME_X64
#elif defined (MDE_CPU_EBC)
+#elif defined (MDE_CPU_ARM)
+ #define EFI_REMOVABLE_MEDIA_FILE_NAME EFI_REMOVABLE_MEDIA_FILE_NAME_ARM
#else
#error Unknown Processor Type
#endif