summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Brown2008-11-18 22:54:51 +0100
committerMichael Brown2008-11-18 22:54:51 +0100
commitab96932ab3ac715bf02b32b5e3089ac0b12e848e (patch)
tree7e649dd80dd8a7427ef8566e5da85c59ce8a0b54
parent[i386] Free allocated base memory on exit, if possible (diff)
downloadipxe-ab96932ab3ac715bf02b32b5e3089ac0b12e848e.tar.gz
ipxe-ab96932ab3ac715bf02b32b5e3089ac0b12e848e.tar.xz
ipxe-ab96932ab3ac715bf02b32b5e3089ac0b12e848e.zip
[efi] Update to latest UEFI headers
-rw-r--r--src/include/gpxe/efi/Base.h80
-rw-r--r--src/include/gpxe/efi/Ia32/ProcessorBind.h6
-rw-r--r--src/include/gpxe/efi/IndustryStandard/PeImage.h458
-rw-r--r--src/include/gpxe/efi/Pi/PiBootMode.h4
-rw-r--r--src/include/gpxe/efi/Pi/PiDependency.h2
-rw-r--r--src/include/gpxe/efi/Pi/PiDxeCis.h2
-rw-r--r--src/include/gpxe/efi/Pi/PiFirmwareFile.h6
-rw-r--r--src/include/gpxe/efi/Pi/PiFirmwareVolume.h4
-rw-r--r--src/include/gpxe/efi/Pi/PiHob.h8
-rw-r--r--src/include/gpxe/efi/Pi/PiMultiPhase.h6
-rw-r--r--src/include/gpxe/efi/Protocol/Cpu.h71
-rw-r--r--src/include/gpxe/efi/Protocol/DebugSupport.h84
-rw-r--r--src/include/gpxe/efi/Protocol/DevicePath.h77
-rw-r--r--src/include/gpxe/efi/Protocol/DriverBinding.h111
-rw-r--r--src/include/gpxe/efi/Protocol/PciIo.h140
-rw-r--r--src/include/gpxe/efi/Protocol/PciRootBridgeIo.h79
-rw-r--r--src/include/gpxe/efi/Protocol/SimpleNetwork.h86
-rw-r--r--src/include/gpxe/efi/Protocol/SimpleTextIn.h23
-rw-r--r--src/include/gpxe/efi/Protocol/SimpleTextOut.h51
-rw-r--r--src/include/gpxe/efi/Uefi/UefiBaseType.h68
-rw-r--r--src/include/gpxe/efi/Uefi/UefiGpt.h14
-rw-r--r--src/include/gpxe/efi/Uefi/UefiInternalFormRepresentation.h221
-rw-r--r--src/include/gpxe/efi/Uefi/UefiMultiPhase.h208
-rw-r--r--src/include/gpxe/efi/Uefi/UefiPxe.h1761
-rw-r--r--src/include/gpxe/efi/Uefi/UefiSpec.h286
-rw-r--r--src/include/gpxe/efi/efi.h6
26 files changed, 1889 insertions, 1973 deletions
diff --git a/src/include/gpxe/efi/Base.h b/src/include/gpxe/efi/Base.h
index cfb54a40..b2552d80 100644
--- a/src/include/gpxe/efi/Base.h
+++ b/src/include/gpxe/efi/Base.h
@@ -1,5 +1,4 @@
/** @file
-
Root include file for Mde Package Base type modules
This is the include file for any module of type base. Base modules only use
@@ -57,34 +56,18 @@ struct _LIST_ENTRY {
// Modifiers for Data Types used to self document code.
// This concept is borrowed for UEFI specification.
//
-#ifndef IN
-//
-// Some other envirnments use this construct, so #ifndef to prevent
-// mulitple definition.
-//
#define IN
#define OUT
#define OPTIONAL
-#endif
//
-// Constants. They may exist in other build structures, so #ifndef them.
-//
-#ifndef TRUE
-//
// UEFI specification claims 1 and 0. We are concerned about the
// complier portability so we did it this way.
//
#define TRUE ((BOOLEAN)(1==1))
-#endif
-
-#ifndef FALSE
#define FALSE ((BOOLEAN)(0==1))
-#endif
-#ifndef NULL
#define NULL ((VOID *) 0)
-#endif
#define BIT0 0x00000001
#define BIT1 0x00000002
@@ -196,15 +179,11 @@ struct _LIST_ENTRY {
//
// Also support coding convention rules for var arg macros
//
-#ifndef VA_START
-
typedef CHAR8 *VA_LIST;
#define VA_START(ap, v) (ap = (VA_LIST) & (v) + _INT_SIZE_OF (v))
#define VA_ARG(ap, t) (*(t *) ((ap += _INT_SIZE_OF (t)) - _INT_SIZE_OF (t)))
#define VA_END(ap) (ap = (VA_LIST) 0)
-#endif
-
//
// Macro that returns the byte offset of a field in a data structure.
//
@@ -217,19 +196,20 @@ typedef CHAR8 *VA_LIST;
#define _CR(Record, TYPE, Field) ((TYPE *) ((CHAR8 *) (Record) - (CHAR8 *) &(((TYPE *) 0)->Field)))
///
+/// ALIGN_VALUE - aligns a value up to the next boundary of the given alignment.
+///
+#define ALIGN_VALUE(Value, Alignment) ((Value) + (((Alignment) - (Value)) & ((Alignment) - 1)))
+
+///
/// ALIGN_POINTER - aligns a pointer to the lowest boundry
///
-#define ALIGN_POINTER(p, s) ((VOID *) ((UINTN)(p) + (((s) - ((UINTN) (p))) & ((s) - 1))))
+#define ALIGN_POINTER(Pointer, Alignment) ((VOID *) (ALIGN_VALUE ((UINTN)(Pointer), (Alignment))))
///
/// ALIGN_VARIABLE - aligns a variable up to the next natural boundry for int size of a processor
///
-#define ALIGN_VARIABLE(Value, Adjustment) \
- Adjustment = 0U; \
- if ((UINTN) (Value) % sizeof (UINTN)) { \
- (Adjustment) = (UINTN)(sizeof (UINTN) - ((UINTN) (Value) % sizeof (UINTN))); \
- } \
- (Value) = (UINTN)((UINTN) (Value) + (UINTN) (Adjustment))
+#define ALIGN_VARIABLE(Value) ALIGN_VALUE ((Value), sizeof (UINTN))
+
//
// Return the maximum of two operands.
@@ -301,5 +281,49 @@ typedef INTN RETURN_STATUS;
#define RETURN_WARN_WRITE_FAILURE ENCODE_WARNING (3)
#define RETURN_WARN_BUFFER_TOO_SMALL ENCODE_WARNING (4)
+/**
+ Returns a 16-bit signature built from 2 ASCII characters.
+
+ @param A The first ASCII character.
+ @param B The second ASCII character.
+
+ @return A 16-bit value built from the two ASCII characters specified by A and B.
+
+**/
+#define SIGNATURE_16(A, B) ((A) | (B << 8))
+
+/**
+ Returns a 32-bit signature built from 4 ASCII characters.
+
+ @param A The first ASCII character.
+ @param B The second ASCII character.
+ @param C The third ASCII character.
+ @param D The fourth ASCII character.
+
+ @return A 32-bit value built from the two ASCII characters specified by A, B,
+ C and D.
+
+**/
+#define SIGNATURE_32(A, B, C, D) (SIGNATURE_16 (A, B) | (SIGNATURE_16 (C, D) << 16))
+
+/**
+ Returns a 64-bit signature built from 8 ASCII characters.
+
+ @param A The first ASCII character.
+ @param B The second ASCII character.
+ @param C The third ASCII character.
+ @param D The fourth ASCII character.
+ @param E The fifth ASCII character.
+ @param F The sixth ASCII character.
+ @param G The seventh ASCII character.
+ @param H The eighth ASCII character.
+
+ @return A 64-bit value built from the two ASCII characters specified by A, B,
+ C, D, E, F, G and H.
+
+**/
+#define SIGNATURE_64(A, B, C, D, E, F, G, H) \
+ (SIGNATURE_32 (A, B, C, D) | ((UINT64) (SIGNATURE_32 (E, F, G, H)) << 32))
+
#endif
diff --git a/src/include/gpxe/efi/Ia32/ProcessorBind.h b/src/include/gpxe/efi/Ia32/ProcessorBind.h
index 512564ca..5a3a9182 100644
--- a/src/include/gpxe/efi/Ia32/ProcessorBind.h
+++ b/src/include/gpxe/efi/Ia32/ProcessorBind.h
@@ -29,12 +29,6 @@
#if __INTEL_COMPILER
//
-// Disable ICC's remark #593: "LocalVariable" was set but never used
-// This is legal ANSI C code so we disable the remark that is turned on with -Wall
-//
-#pragma warning ( disable : 593 )
-
-//
// Disable ICC's remark #869: "Parameter" was never referenced warning.
// This is legal ANSI C code so we disable the remark that is turned on with -Wall
//
diff --git a/src/include/gpxe/efi/IndustryStandard/PeImage.h b/src/include/gpxe/efi/IndustryStandard/PeImage.h
index 666d4ec3..73b3a5ad 100644
--- a/src/include/gpxe/efi/IndustryStandard/PeImage.h
+++ b/src/include/gpxe/efi/IndustryStandard/PeImage.h
@@ -1,12 +1,13 @@
/** @file
- EFI image format for PE32 and PE32+. Please note some data structures are
+ EFI image format for PE32, PE32+ and TE. Please note some data structures are
different for PE32 and PE32+. EFI_IMAGE_NT_HEADERS32 is for PE32 and
EFI_IMAGE_NT_HEADERS64 is for PE32+.
This file is coded to the Visual Studio, Microsoft Portable Executable and
Common Object File Format Specification, Revision 8.0 - May 16, 2006.
+ This file also includes some definitions in PI Specification, Revision 1.0.
- Copyright (c) 2006 - 2007, Intel Corporation
+ 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
@@ -17,23 +18,23 @@
**/
-#ifndef __EFI_IMAGE_H__
-#define __EFI_IMAGE_H__
+#ifndef __PE_IMAGE_H__
+#define __PE_IMAGE_H__
-//
-// PE32+ Subsystem type for EFI images
-//
+///
+/// PE32+ Subsystem type for EFI images
+///
#define EFI_IMAGE_SUBSYSTEM_EFI_APPLICATION 10
#define EFI_IMAGE_SUBSYSTEM_EFI_BOOT_SERVICE_DRIVER 11
#define EFI_IMAGE_SUBSYSTEM_EFI_RUNTIME_DRIVER 12
#define EFI_IMAGE_SUBSYSTEM_EFI_EFI_ROM 13
-#define EFI_IMAGE_SUBSYSTEM_SAL_RUNTIME_DRIVER 13
+#define EFI_IMAGE_SUBSYSTEM_SAL_RUNTIME_DRIVER 13 ///< defined PI Specification, 1.0
-//
-// PE32+ Machine type for EFI images
-//
+///
+/// PE32+ Machine type for EFI images
+///
#define IMAGE_FILE_MACHINE_I386 0x014c
#define IMAGE_FILE_MACHINE_IA64 0x0200
#define IMAGE_FILE_MACHINE_EBC 0x0EBC
@@ -47,39 +48,42 @@
#define EFI_IMAGE_MACHINE_EBC IMAGE_FILE_MACHINE_EBC
#define EFI_IMAGE_MACHINE_X64 IMAGE_FILE_MACHINE_X64
-#define EFI_IMAGE_DOS_SIGNATURE 0x5A4D // MZ
-#define EFI_IMAGE_OS2_SIGNATURE 0x454E // NE
-#define EFI_IMAGE_OS2_SIGNATURE_LE 0x454C // LE
-#define EFI_IMAGE_NT_SIGNATURE 0x00004550 // PE00
+///
+/// EXE file formats
+///
+#define EFI_IMAGE_DOS_SIGNATURE SIGNATURE_16('M', 'Z')
+#define EFI_IMAGE_OS2_SIGNATURE SIGNATURE_16('N', 'E')
+#define EFI_IMAGE_OS2_SIGNATURE_LE SIGNATURE_16('L', 'E')
+#define EFI_IMAGE_NT_SIGNATURE SIGNATURE_32('P', 'E', '\0', '\0')
///
/// PE images can start with an optional DOS header, so if an image is run
-/// under DOS it can print an error message.
+/// under DOS it can print an error message.
///
typedef struct {
- UINT16 e_magic; // Magic number
- UINT16 e_cblp; // Bytes on last page of file
- UINT16 e_cp; // Pages in file
- UINT16 e_crlc; // Relocations
- UINT16 e_cparhdr; // Size of header in paragraphs
- UINT16 e_minalloc; // Minimum extra paragraphs needed
- UINT16 e_maxalloc; // Maximum extra paragraphs needed
- UINT16 e_ss; // Initial (relative) SS value
- UINT16 e_sp; // Initial SP value
- UINT16 e_csum; // Checksum
- UINT16 e_ip; // Initial IP value
- UINT16 e_cs; // Initial (relative) CS value
- UINT16 e_lfarlc; // File address of relocation table
- UINT16 e_ovno; // Overlay number
- UINT16 e_res[4]; // Reserved words
- UINT16 e_oemid; // OEM identifier (for e_oeminfo)
- UINT16 e_oeminfo; // OEM information; e_oemid specific
- UINT16 e_res2[10]; // Reserved words
- UINT32 e_lfanew; // File address of new exe header
+ UINT16 e_magic; ///< Magic number
+ UINT16 e_cblp; ///< Bytes on last page of file
+ UINT16 e_cp; ///< Pages in file
+ UINT16 e_crlc; ///< Relocations
+ UINT16 e_cparhdr; ///< Size of header in paragraphs
+ UINT16 e_minalloc; ///< Minimum extra paragraphs needed
+ UINT16 e_maxalloc; ///< Maximum extra paragraphs needed
+ UINT16 e_ss; ///< Initial (relative) SS value
+ UINT16 e_sp; ///< Initial SP value
+ UINT16 e_csum; ///< Checksum
+ UINT16 e_ip; ///< Initial IP value
+ UINT16 e_cs; ///< Initial (relative) CS value
+ UINT16 e_lfarlc; ///< File address of relocation table
+ UINT16 e_ovno; ///< Overlay number
+ UINT16 e_res[4]; ///< Reserved words
+ UINT16 e_oemid; ///< OEM identifier (for e_oeminfo)
+ UINT16 e_oeminfo; ///< OEM information; e_oemid specific
+ UINT16 e_res2[10]; ///< Reserved words
+ UINT32 e_lfanew; ///< File address of new exe header
} EFI_IMAGE_DOS_HEADER;
///
-/// File header format.
+/// COFF File Header (Object and Image)
///
typedef struct {
UINT16 Machine;
@@ -91,62 +95,63 @@ typedef struct {
UINT16 Characteristics;
} EFI_IMAGE_FILE_HEADER;
+///
+/// Size of EFI_IMAGE_FILE_HEADER
+///
#define EFI_IMAGE_SIZEOF_FILE_HEADER 20
-#define EFI_IMAGE_FILE_RELOCS_STRIPPED 0x0001 // Relocation info stripped from file.
-#define EFI_IMAGE_FILE_EXECUTABLE_IMAGE 0x0002 // File is executable (i.e. no unresolved externel references).
-#define EFI_IMAGE_FILE_LINE_NUMS_STRIPPED 0x0004 // Line nunbers stripped from file.
-#define EFI_IMAGE_FILE_LOCAL_SYMS_STRIPPED 0x0008 // Local symbols stripped from file.
-#define EFI_IMAGE_FILE_BYTES_REVERSED_LO 0x0080 // Bytes of machine word are reversed.
-#define EFI_IMAGE_FILE_32BIT_MACHINE 0x0100 // 32 bit word machine.
-#define EFI_IMAGE_FILE_DEBUG_STRIPPED 0x0200 // Debugging info stripped from file in .DBG file
-#define EFI_IMAGE_FILE_SYSTEM 0x1000 // System File.
-#define EFI_IMAGE_FILE_DLL 0x2000 // File is a DLL.
-#define EFI_IMAGE_FILE_BYTES_REVERSED_HI 0x8000 // Bytes of machine word are reversed.
-#define EFI_IMAGE_FILE_MACHINE_UNKNOWN 0
-#define EFI_IMAGE_FILE_MACHINE_I386 0x14c // Intel 386.
-#define EFI_IMAGE_FILE_MACHINE_R3000 0x162 // MIPS* little-endian, 0540 big-endian
-#define EFI_IMAGE_FILE_MACHINE_R4000 0x166 // MIPS* little-endian
-#define EFI_IMAGE_FILE_MACHINE_ALPHA 0x184 // Alpha_AXP*
-#define EFI_IMAGE_FILE_MACHINE_POWERPC 0x1F0 // IBM* PowerPC Little-Endian
-#define EFI_IMAGE_FILE_MACHINE_TAHOE 0x7cc // Intel EM machine
+///
+/// Characteristics
+///
+#define EFI_IMAGE_FILE_RELOCS_STRIPPED BIT0 ///< 0x0001 Relocation info stripped from file.
+#define EFI_IMAGE_FILE_EXECUTABLE_IMAGE BIT1 ///< 0x0002 File is executable (i.e. no unresolved externel references).
+#define EFI_IMAGE_FILE_LINE_NUMS_STRIPPED BIT2 ///< 0x0004 Line nunbers stripped from file.
+#define EFI_IMAGE_FILE_LOCAL_SYMS_STRIPPED BIT3 ///< 0x0008 Local symbols stripped from file.
+#define EFI_IMAGE_FILE_BYTES_REVERSED_LO BIT7 ///< 0x0080 Bytes of machine word are reversed.
+#define EFI_IMAGE_FILE_32BIT_MACHINE BIT8 ///< 0x0100 32 bit word machine.
+#define EFI_IMAGE_FILE_DEBUG_STRIPPED BIT9 ///< 0x0200 Debugging info stripped from file in .DBG file
+#define EFI_IMAGE_FILE_SYSTEM BIT12 ///< 0x1000 System File.
+#define EFI_IMAGE_FILE_DLL BIT13 ///< 0x2000 File is a DLL.
+#define EFI_IMAGE_FILE_BYTES_REVERSED_HI BIT15 ///< 0x8000 Bytes of machine word are reversed.
+
+///
+/// Other Machine Types
+///
+#define EFI_IMAGE_FILE_MACHINE_UNKNOWN 0 ///< Any machine type
+#define EFI_IMAGE_FILE_MACHINE_I386 0x14c ///< Intel 386.
+#define EFI_IMAGE_FILE_MACHINE_R3000 0x162 ///< MIPS* little-endian, 0540 big-endian
+#define EFI_IMAGE_FILE_MACHINE_R4000 0x166 ///< MIPS* little-endian
+#define EFI_IMAGE_FILE_MACHINE_POWERPC 0x1F0 ///< IBM* PowerPC Little-Endian
//
// * Other names and brands may be claimed as the property of others.
//
///
-/// Directory format.
+/// Header Data Directories
///
typedef struct {
UINT32 VirtualAddress;
UINT32 Size;
} EFI_IMAGE_DATA_DIRECTORY;
-#define EFI_IMAGE_NUMBER_OF_DIRECTORY_ENTRIES 16
-
-typedef struct {
- UINT16 Magic;
- UINT8 MajorLinkerVersion;
- UINT8 MinorLinkerVersion;
- UINT32 SizeOfCode;
- UINT32 SizeOfInitializedData;
- UINT32 SizeOfUninitializedData;
- UINT32 AddressOfEntryPoint;
- UINT32 BaseOfCode;
- UINT32 BaseOfData;
- UINT32 BaseOfBss;
- UINT32 GprMask;
- UINT32 CprMask[4];
- UINT32 GpValue;
-} EFI_IMAGE_ROM_OPTIONAL_HEADER;
-
#define EFI_IMAGE_ROM_OPTIONAL_HDR_MAGIC 0x107
-#define EFI_IMAGE_SIZEOF_ROM_OPTIONAL_HEADER sizeof (EFI_IMAGE_ROM_OPTIONAL_HEADER)
-typedef struct {
- EFI_IMAGE_FILE_HEADER FileHeader;
- EFI_IMAGE_ROM_OPTIONAL_HEADER OptionalHeader;
-} EFI_IMAGE_ROM_HEADERS;
+///
+/// Directory Entries
+///
+#define EFI_IMAGE_DIRECTORY_ENTRY_EXPORT 0
+#define EFI_IMAGE_DIRECTORY_ENTRY_IMPORT 1
+#define EFI_IMAGE_DIRECTORY_ENTRY_RESOURCE 2
+#define EFI_IMAGE_DIRECTORY_ENTRY_EXCEPTION 3
+#define EFI_IMAGE_DIRECTORY_ENTRY_SECURITY 4
+#define EFI_IMAGE_DIRECTORY_ENTRY_BASERELOC 5
+#define EFI_IMAGE_DIRECTORY_ENTRY_DEBUG 6
+#define EFI_IMAGE_DIRECTORY_ENTRY_COPYRIGHT 7
+#define EFI_IMAGE_DIRECTORY_ENTRY_GLOBALPTR 8
+#define EFI_IMAGE_DIRECTORY_ENTRY_TLS 9
+#define EFI_IMAGE_DIRECTORY_ENTRY_LOAD_CONFIG 10
+
+#define EFI_IMAGE_NUMBER_OF_DIRECTORY_ENTRIES 16
///
/// @attention
@@ -168,7 +173,7 @@ typedef struct {
UINT32 SizeOfUninitializedData;
UINT32 AddressOfEntryPoint;
UINT32 BaseOfCode;
- UINT32 BaseOfData;
+ UINT32 BaseOfData; ///< PE32 contains this additional field, which is absent in PE32+
///
/// NT additional fields.
///
@@ -266,11 +271,11 @@ typedef struct {
#define EFI_IMAGE_SIZEOF_NT_OPTIONAL64_HEADER sizeof (EFI_IMAGE_NT_HEADERS64)
-//
-// Processor specific definition of EFI_IMAGE_OPTIONAL_HEADER so the
-// type name EFI_IMAGE_OPTIONAL_HEADER is appropriate to the build. Same for
-// EFI_IMAGE_NT_HEADERS. These definitions MUST be used by ALL EFI code.
-//
+///
+/// Processor specific definition of EFI_IMAGE_OPTIONAL_HEADER so the
+/// type name EFI_IMAGE_OPTIONAL_HEADER is appropriate to the build. Same for
+/// EFI_IMAGE_NT_HEADERS. These definitions MUST be used by ALL EFI code.
+///
#if defined (MDE_CPU_IA32)
#define EFI_IMAGE_MACHINE_TYPE_SUPPORTED(Machine) \
@@ -278,9 +283,6 @@ typedef struct {
#define EFI_IMAGE_MACHINE_CROSS_TYPE_SUPPORTED(Machine) ((Machine) == EFI_IMAGE_MACHINE_X64)
-//
-// @bug - Remove me when other package updated.
-//
typedef EFI_IMAGE_NT_HEADERS32 EFI_IMAGE_NT_HEADERS;
#elif defined (MDE_CPU_IPF)
@@ -290,9 +292,6 @@ typedef EFI_IMAGE_NT_HEADERS32 EFI_IMAGE_NT_HEADERS;
#define EFI_IMAGE_MACHINE_CROSS_TYPE_SUPPORTED(Machine) (FALSE)
-//
-// @bug - Remove me when other package updated.
-//
typedef EFI_IMAGE_NT_HEADERS64 EFI_IMAGE_NT_HEADERS;
#elif defined (MDE_CPU_X64)
@@ -302,9 +301,6 @@ typedef EFI_IMAGE_NT_HEADERS64 EFI_IMAGE_NT_HEADERS;
#define EFI_IMAGE_MACHINE_CROSS_TYPE_SUPPORTED(Machine) ((Machine) == EFI_IMAGE_MACHINE_IA32)
-//
-// @bug - Remove me when other package updated.
-//
typedef EFI_IMAGE_NT_HEADERS64 EFI_IMAGE_NT_HEADERS;
#elif defined (MDE_CPU_EBC)
@@ -318,9 +314,6 @@ typedef EFI_IMAGE_NT_HEADERS64 EFI_IMAGE_NT_HEADERS;
#define EFI_IMAGE_MACHINE_CROSS_TYPE_SUPPORTED(Machine) (FALSE)
-//
-// @bug - Remove me when other package updated.
-//
typedef EFI_IMAGE_NT_HEADERS64 EFI_IMAGE_NT_HEADERS;
#else
@@ -338,34 +331,19 @@ typedef EFI_IMAGE_NT_HEADERS64 EFI_IMAGE_NT_HEADERS;
) \
)
-//
-// Subsystem Values
-//
+///
+/// Other Windows Subsystem Values
+///
#define EFI_IMAGE_SUBSYSTEM_UNKNOWN 0
#define EFI_IMAGE_SUBSYSTEM_NATIVE 1
#define EFI_IMAGE_SUBSYSTEM_WINDOWS_GUI 2
-#define EFI_IMAGE_SUBSYSTEM_WINDOWS_CUI 3.
+#define EFI_IMAGE_SUBSYSTEM_WINDOWS_CUI 3
#define EFI_IMAGE_SUBSYSTEM_OS2_CUI 5
#define EFI_IMAGE_SUBSYSTEM_POSIX_CUI 7
-//
-// Directory Entries
-//
-#define EFI_IMAGE_DIRECTORY_ENTRY_EXPORT 0
-#define EFI_IMAGE_DIRECTORY_ENTRY_IMPORT 1
-#define EFI_IMAGE_DIRECTORY_ENTRY_RESOURCE 2
-#define EFI_IMAGE_DIRECTORY_ENTRY_EXCEPTION 3
-#define EFI_IMAGE_DIRECTORY_ENTRY_SECURITY 4
-#define EFI_IMAGE_DIRECTORY_ENTRY_BASERELOC 5
-#define EFI_IMAGE_DIRECTORY_ENTRY_DEBUG 6
-#define EFI_IMAGE_DIRECTORY_ENTRY_COPYRIGHT 7
-#define EFI_IMAGE_DIRECTORY_ENTRY_GLOBALPTR 8
-#define EFI_IMAGE_DIRECTORY_ENTRY_TLS 9
-#define EFI_IMAGE_DIRECTORY_ENTRY_LOAD_CONFIG 10
-
-//
-// Section header format.
-//
+///
+/// Section header format.
+///
#define EFI_IMAGE_SIZEOF_SHORT_NAME 8
typedef struct {
@@ -384,80 +362,85 @@ typedef struct {
UINT32 Characteristics;
} EFI_IMAGE_SECTION_HEADER;
+///
+/// Size of EFI_IMAGE_SECTION_HEADER
+///
#define EFI_IMAGE_SIZEOF_SECTION_HEADER 40
-#define EFI_IMAGE_SCN_TYPE_NO_PAD 0x00000008 // Reserved.
-#define EFI_IMAGE_SCN_CNT_CODE 0x00000020
-#define EFI_IMAGE_SCN_CNT_INITIALIZED_DATA 0x00000040
-#define EFI_IMAGE_SCN_CNT_UNINITIALIZED_DATA 0x00000080
+///
+/// Section Flags Values
+///
+#define EFI_IMAGE_SCN_TYPE_NO_PAD BIT3 ///< 0x00000008 ///< Reserved.
+#define EFI_IMAGE_SCN_CNT_CODE BIT5 ///< 0x00000020
+#define EFI_IMAGE_SCN_CNT_INITIALIZED_DATA BIT6 ///< 0x00000040
+#define EFI_IMAGE_SCN_CNT_UNINITIALIZED_DATA BIT7 ///< 0x00000080
-#define EFI_IMAGE_SCN_LNK_OTHER 0x00000100 // Reserved.
-#define EFI_IMAGE_SCN_LNK_INFO 0x00000200 // Section contains comments or some other type of information.
-#define EFI_IMAGE_SCN_LNK_REMOVE 0x00000800 // Section contents will not become part of image.
-#define EFI_IMAGE_SCN_LNK_COMDAT 0x00001000
+#define EFI_IMAGE_SCN_LNK_OTHER BIT8 ///< 0x00000100 ///< Reserved.
+#define EFI_IMAGE_SCN_LNK_INFO BIT9 ///< 0x00000200 ///< Section contains comments or some other type of information.
+#define EFI_IMAGE_SCN_LNK_REMOVE BIT10 ///< 0x00000800 ///< Section contents will not become part of image.
+#define EFI_IMAGE_SCN_LNK_COMDAT BIT12 ///< 0x00001000
-#define EFI_IMAGE_SCN_ALIGN_1BYTES 0x00100000
-#define EFI_IMAGE_SCN_ALIGN_2BYTES 0x00200000
-#define EFI_IMAGE_SCN_ALIGN_4BYTES 0x00300000
-#define EFI_IMAGE_SCN_ALIGN_8BYTES 0x00400000
-#define EFI_IMAGE_SCN_ALIGN_16BYTES 0x00500000
-#define EFI_IMAGE_SCN_ALIGN_32BYTES 0x00600000
-#define EFI_IMAGE_SCN_ALIGN_64BYTES 0x00700000
+#define EFI_IMAGE_SCN_ALIGN_1BYTES BIT20 ///< 0x00100000
+#define EFI_IMAGE_SCN_ALIGN_2BYTES BIT21 ///< 0x00200000
+#define EFI_IMAGE_SCN_ALIGN_4BYTES (BIT20|BIT21) ///< 0x00300000
+#define EFI_IMAGE_SCN_ALIGN_8BYTES BIT22 ///< 0x00400000
+#define EFI_IMAGE_SCN_ALIGN_16BYTES (BIT20|BIT22) ///< 0x00500000
+#define EFI_IMAGE_SCN_ALIGN_32BYTES (BIT21|BIT22) ///< 0x00600000
+#define EFI_IMAGE_SCN_ALIGN_64BYTES (BIT20|BIT21|BIT22) ///< 0x00700000
-#define EFI_IMAGE_SCN_MEM_DISCARDABLE 0x02000000
-#define EFI_IMAGE_SCN_MEM_NOT_CACHED 0x04000000
-#define EFI_IMAGE_SCN_MEM_NOT_PAGED 0x08000000
-#define EFI_IMAGE_SCN_MEM_SHARED 0x10000000
-#define EFI_IMAGE_SCN_MEM_EXECUTE 0x20000000
-#define EFI_IMAGE_SCN_MEM_READ 0x40000000
-#define EFI_IMAGE_SCN_MEM_WRITE 0x80000000
+#define EFI_IMAGE_SCN_MEM_DISCARDABLE BIT25 ///< 0x02000000
+#define EFI_IMAGE_SCN_MEM_NOT_CACHED BIT26 ///< 0x04000000
+#define EFI_IMAGE_SCN_MEM_NOT_PAGED BIT27 ///< 0x08000000
+#define EFI_IMAGE_SCN_MEM_SHARED BIT28 ///< 0x10000000
+#define EFI_IMAGE_SCN_MEM_EXECUTE BIT29 ///< 0x20000000
+#define EFI_IMAGE_SCN_MEM_READ BIT30 ///< 0x40000000
+#define EFI_IMAGE_SCN_MEM_WRITE BIT31 ///< 0x80000000
///
-/// Symbol format.
+/// Size of a Symbol Table Record
///
#define EFI_IMAGE_SIZEOF_SYMBOL 18
-//
-// Section values.
-//
-// Symbols have a section number of the section in which they are
-// defined. Otherwise, section numbers have the following meanings:
-//
-#define EFI_IMAGE_SYM_UNDEFINED (UINT16) 0 // Symbol is undefined or is common.
-#define EFI_IMAGE_SYM_ABSOLUTE (UINT16) -1 // Symbol is an absolute value.
-#define EFI_IMAGE_SYM_DEBUG (UINT16) -2 // Symbol is a special debug item.
-//
-// Type (fundamental) values.
-//
-#define EFI_IMAGE_SYM_TYPE_NULL 0 // no type.
-#define EFI_IMAGE_SYM_TYPE_VOID 1 //
-#define EFI_IMAGE_SYM_TYPE_CHAR 2 // type character.
-#define EFI_IMAGE_SYM_TYPE_SHORT 3 // type short integer.
+///
+/// Symbols have a section number of the section in which they are
+/// defined. Otherwise, section numbers have the following meanings:
+///
+#define EFI_IMAGE_SYM_UNDEFINED (UINT16) 0 ///< Symbol is undefined or is common.
+#define EFI_IMAGE_SYM_ABSOLUTE (UINT16) -1 ///< Symbol is an absolute value.
+#define EFI_IMAGE_SYM_DEBUG (UINT16) -2 ///< Symbol is a special debug item.
+
+///
+/// Symbol Type (fundamental) values.
+///
+#define EFI_IMAGE_SYM_TYPE_NULL 0 ///< no type.
+#define EFI_IMAGE_SYM_TYPE_VOID 1 ///< no valid type.
+#define EFI_IMAGE_SYM_TYPE_CHAR 2 ///< type character.
+#define EFI_IMAGE_SYM_TYPE_SHORT 3 ///< type short integer.
#define EFI_IMAGE_SYM_TYPE_INT 4
#define EFI_IMAGE_SYM_TYPE_LONG 5
#define EFI_IMAGE_SYM_TYPE_FLOAT 6
#define EFI_IMAGE_SYM_TYPE_DOUBLE 7
#define EFI_IMAGE_SYM_TYPE_STRUCT 8
#define EFI_IMAGE_SYM_TYPE_UNION 9
-#define EFI_IMAGE_SYM_TYPE_ENUM 10 // enumeration.
-#define EFI_IMAGE_SYM_TYPE_MOE 11 // member of enumeration.
+#define EFI_IMAGE_SYM_TYPE_ENUM 10 ///< enumeration.
+#define EFI_IMAGE_SYM_TYPE_MOE 11 ///< member of enumeration.
#define EFI_IMAGE_SYM_TYPE_BYTE 12
#define EFI_IMAGE_SYM_TYPE_WORD 13
#define EFI_IMAGE_SYM_TYPE_UINT 14
#define EFI_IMAGE_SYM_TYPE_DWORD 15
-//
-// Type (derived) values.
-//
-#define EFI_IMAGE_SYM_DTYPE_NULL 0 // no derived type.
+///
+/// Symbol Type (derived) values.
+///
+#define EFI_IMAGE_SYM_DTYPE_NULL 0 ///< no derived type.
#define EFI_IMAGE_SYM_DTYPE_POINTER 1
#define EFI_IMAGE_SYM_DTYPE_FUNCTION 2
#define EFI_IMAGE_SYM_DTYPE_ARRAY 3
-//
-// Storage classes.
-//
-#define EFI_IMAGE_SYM_CLASS_END_OF_FUNCTION (UINT8) -1
+///
+/// Storage classes.
+///
+#define EFI_IMAGE_SYM_CLASS_END_OF_FUNCTION ((UINT8) -1)
#define EFI_IMAGE_SYM_CLASS_NULL 0
#define EFI_IMAGE_SYM_CLASS_AUTOMATIC 1
#define EFI_IMAGE_SYM_CLASS_EXTERNAL 2
@@ -494,15 +477,18 @@ typedef struct {
#define EFI_IMAGE_N_BTSHFT 4
#define EFI_IMAGE_N_TSHIFT 2
-//
-// Communal selection types.
-//
+///
+/// Communal selection types.
+///
#define EFI_IMAGE_COMDAT_SELECT_NODUPLICATES 1
#define EFI_IMAGE_COMDAT_SELECT_ANY 2
#define EFI_IMAGE_COMDAT_SELECT_SAME_SIZE 3
#define EFI_IMAGE_COMDAT_SELECT_EXACT_MATCH 4
#define EFI_IMAGE_COMDAT_SELECT_ASSOCIATIVE 5
+///
+/// the following values only be referred in PeCoff, not defined in PECOFF.
+///
#define EFI_IMAGE_WEAK_EXTERN_SEARCH_NOLIBRARY 1
#define EFI_IMAGE_WEAK_EXTERN_SEARCH_LIBRARY 2
#define EFI_IMAGE_WEAK_EXTERN_SEARCH_ALIAS 3
@@ -516,24 +502,27 @@ typedef struct {
UINT16 Type;
} EFI_IMAGE_RELOCATION;
+///
+/// Size of EFI_IMAGE_RELOCATION
+///
#define EFI_IMAGE_SIZEOF_RELOCATION 10
-//
-// I386 relocation types.
-//
-#define EFI_IMAGE_REL_I386_ABSOLUTE 0x0000 // Reference is absolute, no relocation is necessary
-#define EFI_IMAGE_REL_I386_DIR16 0x0001 // Direct 16-bit reference to the symbols virtual address
-#define EFI_IMAGE_REL_I386_REL16 0x0002 // PC-relative 16-bit reference to the symbols virtual address
-#define EFI_IMAGE_REL_I386_DIR32 0x0006 // Direct 32-bit reference to the symbols virtual address
-#define EFI_IMAGE_REL_I386_DIR32NB 0x0007 // Direct 32-bit reference to the symbols virtual address, base not included
-#define EFI_IMAGE_REL_I386_SEG12 0x0009 // Direct 16-bit reference to the segment-selector bits of a 32-bit virtual address
-#define EFI_IMAGE_REL_I386_SECTION 0x001a
-#define EFI_IMAGE_REL_I386_SECREL 0x000b
-#define EFI_IMAGE_REL_I386_REL32 0x0014 // PC-relative 32-bit reference to the symbols virtual address
+///
+/// I386 relocation types.
+///
+#define EFI_IMAGE_REL_I386_ABSOLUTE 0x0000 ///< Reference is absolute, no relocation is necessary
+#define EFI_IMAGE_REL_I386_DIR16 0x0001 ///< Direct 16-bit reference to the symbols virtual address
+#define EFI_IMAGE_REL_I386_REL16 0x0002 ///< PC-relative 16-bit reference to the symbols virtual address
+#define EFI_IMAGE_REL_I386_DIR32 0x0006 ///< Direct 32-bit reference to the symbols virtual address
+#define EFI_IMAGE_REL_I386_DIR32NB 0x0007 ///< Direct 32-bit reference to the symbols virtual address, base not included
+#define EFI_IMAGE_REL_I386_SEG12 0x0009 ///< Direct 16-bit reference to the segment-selector bits of a 32-bit virtual address
+#define EFI_IMAGE_REL_I386_SECTION 0x000A
+#define EFI_IMAGE_REL_I386_SECREL 0x000B
+#define EFI_IMAGE_REL_I386_REL32 0x0014 ///< PC-relative 32-bit reference to the symbols virtual address
-//
-// x64 processor relocation types.
-//
+///
+/// x64 processor relocation types.
+///
#define IMAGE_REL_AMD64_ABSOLUTE 0x0000
#define IMAGE_REL_AMD64_ADDR64 0x0001
#define IMAGE_REL_AMD64_ADDR32 0x0002
@@ -560,11 +549,14 @@ typedef struct {
UINT32 SizeOfBlock;
} EFI_IMAGE_BASE_RELOCATION;
+///
+/// Size of EFI_IMAGE_BASE_RELOCATION
+///
#define EFI_IMAGE_SIZEOF_BASE_RELOCATION 8
-//
-// Based relocation types.
-//
+///
+/// Based relocation types.
+///
#define EFI_IMAGE_REL_BASED_ABSOLUTE 0
#define EFI_IMAGE_REL_BASED_HIGH 1
#define EFI_IMAGE_REL_BASED_LOW 2
@@ -572,6 +564,7 @@ typedef struct {
#define EFI_IMAGE_REL_BASED_HIGHADJ 4
#define EFI_IMAGE_REL_BASED_MIPS_JMPADDR 5
#define EFI_IMAGE_REL_BASED_IA64_IMM64 9
+#define IMAGE_REL_BASED_MIPS_JMPADDR16 9
#define EFI_IMAGE_REL_BASED_DIR64 10
///
@@ -585,11 +578,14 @@ typedef struct {
UINT16 Linenumber; // Line number.
} EFI_IMAGE_LINENUMBER;
+///
+/// Size of EFI_IMAGE_LINENUMBER
+///
#define EFI_IMAGE_SIZEOF_LINENUMBER 6
-//
-// Archive format.
-//
+///
+/// Archive format.
+///
#define EFI_IMAGE_ARCHIVE_START_SIZE 8
#define EFI_IMAGE_ARCHIVE_START "!<arch>\n"
#define EFI_IMAGE_ARCHIVE_END "`\n"
@@ -598,23 +594,27 @@ typedef struct {
#define EFI_IMAGE_ARCHIVE_LONGNAMES_MEMBER "// "
typedef struct {
- UINT8 Name[16]; // File member name - `/' terminated.
- UINT8 Date[12]; // File member date - decimal.
- UINT8 UserID[6]; // File member user id - decimal.
- UINT8 GroupID[6]; // File member group id - decimal.
- UINT8 Mode[8]; // File member mode - octal.
- UINT8 Size[10]; // File member size - decimal.
- UINT8 EndHeader[2]; // String to end header.
+ UINT8 Name[16]; ///< File member name - `/' terminated.
+ UINT8 Date[12]; ///< File member date - decimal.
+ UINT8 UserID[6]; ///< File member user id - decimal.
+ UINT8 GroupID[6]; ///< File member group id - decimal.
+ UINT8 Mode[8]; ///< File member mode - octal.
+ UINT8 Size[10]; ///< File member size - decimal.
+ UINT8 EndHeader[2]; ///< String to end header. (0x60 0x0A)
} EFI_IMAGE_ARCHIVE_MEMBER_HEADER;
+///
+/// Size of EFI_IMAGE_ARCHIVE_MEMBER_HEADER
+///
#define EFI_IMAGE_SIZEOF_ARCHIVE_MEMBER_HDR 60
-//
-// DLL support.
-//
///
-/// DLL Export Format
+/// DLL Support
+///
+
+///
+/// Export Directory Table
///
typedef struct {
UINT32 Characteristics;
@@ -631,8 +631,7 @@ typedef struct {
} EFI_IMAGE_EXPORT_DIRECTORY;
///
-/// DLL support.
-/// Import Format
+/// Hint/Name Table
///
typedef struct {
UINT16 Hint;
@@ -647,10 +646,13 @@ typedef struct {
} u1;
} EFI_IMAGE_THUNK_DATA;
-#define EFI_IMAGE_ORDINAL_FLAG 0x80000000
+#define EFI_IMAGE_ORDINAL_FLAG BIT31 ///< Flag for PE32
#define EFI_IMAGE_SNAP_BY_ORDINAL(Ordinal) ((Ordinal & EFI_IMAGE_ORDINAL_FLAG) != 0)
#define EFI_IMAGE_ORDINAL(Ordinal) (Ordinal & 0xffff)
+///
+/// Import Directory Table
+///
typedef struct {
UINT32 Characteristics;
UINT32 TimeDateStamp;
@@ -659,11 +661,10 @@ typedef struct {
EFI_IMAGE_THUNK_DATA *FirstThunk;
} EFI_IMAGE_IMPORT_DESCRIPTOR;
+
///
-/// Debug Format
+/// Debug Direcotry Format
///
-#define EFI_IMAGE_DEBUG_TYPE_CODEVIEW 2
-
typedef struct {
UINT32 Characteristics;
UINT32 TimeDateStamp;
@@ -671,13 +672,18 @@ typedef struct {
UINT16 MinorVersion;
UINT32 Type;
UINT32 SizeOfData;
- UINT32 RVA;
- UINT32 FileOffset;
+ UINT32 RVA; ///< The address of the debug data when loaded, relative to the image base
+ UINT32 FileOffset; ///< The file pointer to the debug data
} EFI_IMAGE_DEBUG_DIRECTORY_ENTRY;
-#define CODEVIEW_SIGNATURE_NB10 0x3031424E // "NB10"
+#define EFI_IMAGE_DEBUG_TYPE_CODEVIEW 2 ///< The Visual C++ debug information
+
+///
+/// Debug Data Structure defined in Microsoft C++
+///
+#define CODEVIEW_SIGNATURE_NB10 SIGNATURE_32('N', 'B', '1', '0')
typedef struct {
- UINT32 Signature; // "NB10"
+ UINT32 Signature; ///< "NB10"
UINT32 Unknown;
UINT32 Unknown2;
UINT32 Unknown3;
@@ -686,9 +692,12 @@ typedef struct {
//
} EFI_IMAGE_DEBUG_CODEVIEW_NB10_ENTRY;
-#define CODEVIEW_SIGNATURE_RSDS 0x53445352 // "RSDS"
+///
+/// Debug Data Structure defined in Microsoft C++
+///
+#define CODEVIEW_SIGNATURE_RSDS SIGNATURE_32('R', 'S', 'D', 'S')
typedef struct {
- UINT32 Signature; // "RSDS"
+ UINT32 Signature; ///< "RSDS"
UINT32 Unknown;
UINT32 Unknown2;
UINT32 Unknown3;
@@ -700,21 +709,22 @@ typedef struct {
} EFI_IMAGE_DEBUG_CODEVIEW_RSDS_ENTRY;
///
-/// Header format for TE images
+/// Header format for TE images, defined in PI Specification, 1.0
///
typedef struct {
- UINT16 Signature; // signature for TE format = "VZ"
- UINT16 Machine; // from the original file header
- UINT8 NumberOfSections; // from the original file header
- UINT8 Subsystem; // from original optional header
- UINT16 StrippedSize; // how many bytes we removed from the header
- UINT32 AddressOfEntryPoint; // offset to entry point -- from original optional header
- UINT32 BaseOfCode; // from original image -- required for ITP debug
- UINT64 ImageBase; // from original file header
- EFI_IMAGE_DATA_DIRECTORY DataDirectory[2]; // only base relocation and debug directory
+ UINT16 Signature; ///< signature for TE format = "VZ"
+ UINT16 Machine; ///< from the original file header
+ UINT8 NumberOfSections; ///< from the original file header
+ UINT8 Subsystem; ///< from original optional header
+ UINT16 StrippedSize; ///< how many bytes we removed from the header
+ UINT32 AddressOfEntryPoint; ///< offset to entry point -- from original optional header
+ UINT32 BaseOfCode; ///< from original image -- required for ITP debug
+ UINT64 ImageBase; ///< from original file header
+ EFI_IMAGE_DATA_DIRECTORY DataDirectory[2]; ///< only base relocation and debug directory
} EFI_TE_IMAGE_HEADER;
-#define EFI_TE_IMAGE_HEADER_SIGNATURE 0x5A56 // "VZ"
+
+#define EFI_TE_IMAGE_HEADER_SIGNATURE SIGNATURE_16('V', 'Z')
//
// Data directory indexes in our TE image header
diff --git a/src/include/gpxe/efi/Pi/PiBootMode.h b/src/include/gpxe/efi/Pi/PiBootMode.h
index bea69ff1..bebca227 100644
--- a/src/include/gpxe/efi/Pi/PiBootMode.h
+++ b/src/include/gpxe/efi/Pi/PiBootMode.h
@@ -1,7 +1,7 @@
/** @file
Present the boot mode values in PI.
- Copyright (c) 2006 - 2007, Intel Corporation
+ 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
@@ -11,7 +11,7 @@
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
@par Revision Reference:
- Version 1.0.
+ PI Version 1.0
**/
diff --git a/src/include/gpxe/efi/Pi/PiDependency.h b/src/include/gpxe/efi/Pi/PiDependency.h
index 1f96154d..73f6027e 100644
--- a/src/include/gpxe/efi/Pi/PiDependency.h
+++ b/src/include/gpxe/efi/Pi/PiDependency.h
@@ -11,7 +11,7 @@
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
@par Revision Reference:
- Version 1.0.
+ PI Version 1.0
**/
#ifndef __PI_DEPENDENCY_H__
diff --git a/src/include/gpxe/efi/Pi/PiDxeCis.h b/src/include/gpxe/efi/Pi/PiDxeCis.h
index b57f89d8..a9248883 100644
--- a/src/include/gpxe/efi/Pi/PiDxeCis.h
+++ b/src/include/gpxe/efi/Pi/PiDxeCis.h
@@ -11,7 +11,7 @@
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
@par Revision Reference:
- Version 1.0.
+ PI Version 1.0
**/
diff --git a/src/include/gpxe/efi/Pi/PiFirmwareFile.h b/src/include/gpxe/efi/Pi/PiFirmwareFile.h
index a25e98c5..be6f8bd2 100644
--- a/src/include/gpxe/efi/Pi/PiFirmwareFile.h
+++ b/src/include/gpxe/efi/Pi/PiFirmwareFile.h
@@ -11,7 +11,7 @@
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
@par Revision Reference:
- Version 1.0.
+ PI Version 1.0
**/
@@ -156,7 +156,7 @@ typedef struct {
typedef EFI_COMMON_SECTION_HEADER EFI_DXE_DEPEX_SECTION;
///
-/// Leaf section witch contains a PI FV.
+/// Leaf section which contains a PI FV.
///
typedef EFI_COMMON_SECTION_HEADER EFI_FIRMWARE_VOLUME_IMAGE_SECTION;
@@ -220,7 +220,7 @@ typedef struct {
///
/// Leaf section which contains a numeric build number and
-/// an optional unicode string that represent the file revision.
+/// an optional unicode string that represents the file revision.
///
typedef struct {
EFI_COMMON_SECTION_HEADER CommonHeader;
diff --git a/src/include/gpxe/efi/Pi/PiFirmwareVolume.h b/src/include/gpxe/efi/Pi/PiFirmwareVolume.h
index 39c81b19..277b7045 100644
--- a/src/include/gpxe/efi/Pi/PiFirmwareVolume.h
+++ b/src/include/gpxe/efi/Pi/PiFirmwareVolume.h
@@ -1,7 +1,7 @@
/** @file
The firmware volume related definitions in PI.
- Copyright (c) 2006 - 2007, Intel Corporation
+ 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
@@ -11,7 +11,7 @@
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
@par Revision Reference:
- Version 1.0.
+ PI Version 1.0
**/
diff --git a/src/include/gpxe/efi/Pi/PiHob.h b/src/include/gpxe/efi/Pi/PiHob.h
index 1a695d7e..0c8df1f2 100644
--- a/src/include/gpxe/efi/Pi/PiHob.h
+++ b/src/include/gpxe/efi/Pi/PiHob.h
@@ -11,7 +11,7 @@
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
@par Revision Reference:
- Version 1.0.
+ PI Version 1.0
**/
@@ -76,7 +76,7 @@ typedef struct {
///
typedef struct {
///
- /// A GUID that defines the memory allocation region¡¯s type and purpose, as well as
+ /// A GUID that defines the memory allocation region's type and purpose, as well as
/// other fields within the memory allocation HOB. This GUID is used to define the
/// additional data within the HOB that may be present for the memory allocation HOB.
/// Type EFI_GUID is defined in InstallProtocolInterface() in the UEFI 2.0
@@ -84,9 +84,11 @@ typedef struct {
///
EFI_GUID Name;
+ ///
/// The base address of memory allocated by this HOB. Type
/// EFI_PHYSICAL_ADDRESS is defined in AllocatePages() in the UEFI 2.0
/// specification.
+ ///
EFI_PHYSICAL_ADDRESS MemoryBaseAddress;
///
@@ -155,7 +157,7 @@ typedef struct {
} EFI_HOB_MEMORY_ALLOCATION_MODULE;
///
-/// type of Recount type
+/// Resource type
///
typedef UINT32 EFI_RESOURCE_TYPE;
diff --git a/src/include/gpxe/efi/Pi/PiMultiPhase.h b/src/include/gpxe/efi/Pi/PiMultiPhase.h
index 9ec013be..3ab6421f 100644
--- a/src/include/gpxe/efi/Pi/PiMultiPhase.h
+++ b/src/include/gpxe/efi/Pi/PiMultiPhase.h
@@ -1,7 +1,7 @@
/** @file
Include file matches things in PI for multiple module types.
- Copyright (c) 2006 - 2007, Intel Corporation
+ 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
@@ -11,7 +11,7 @@
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
@par Revision Reference:
- Version 1.0.
+ PI Version 1.0
**/
@@ -93,7 +93,7 @@ typedef struct {
//
-// Bit values for AuthenticationStatus
+// Bit values for Authentication Status
//
#define EFI_AUTH_STATUS_PLATFORM_OVERRIDE 0x01
#define EFI_AUTH_STATUS_IMAGE_SIGNED 0x02
diff --git a/src/include/gpxe/efi/Protocol/Cpu.h b/src/include/gpxe/efi/Protocol/Cpu.h
index 6052a34f..da3d0fda 100644
--- a/src/include/gpxe/efi/Protocol/Cpu.h
+++ b/src/include/gpxe/efi/Protocol/Cpu.h
@@ -255,59 +255,12 @@ EFI_STATUS
);
-/**
- @par Protocol Description:
- The EFI_CPU_ARCH_PROTOCOL is used to abstract processor-specific functions from the DXE
- Foundation. This includes flushing caches, enabling and disabling interrupts, hooking interrupt
- vectors and exception vectors, reading internal processor timers, resetting the processor, and
- determining the processor frequency.
-
- @param FlushDataCache
- Flushes a range of the processor's data cache. If the processor does
- not contain a data cache, or the data cache is fully coherent, then this
- function can just return EFI_SUCCESS. If the processor does not support
- flushing a range of addresses from the data cache, then the entire data
- cache must be flushed.
-
- @param EnableInterrupt
- Enables interrupt processing by the processor.
-
- @param DisableInterrupt
- Disables interrupt processing by the processor.
-
- @param GetInterruptState
- Retrieves the processor's current interrupt state.
-
- @param Init
- Generates an INIT on the processor. If a processor cannot programmatically
- generate an INIT without help from external hardware, then this function
- returns EFI_UNSUPPORTED.
-
- @param RegisterInterruptHandler
- Associates an interrupt service routine with one of the processor's interrupt
- vectors. This function is typically used by the EFI_TIMER_ARCH_PROTOCOL to
- hook the timer interrupt in a system. It can also be used by the debugger to
- hook exception vectors.
-
- @param GetTimerValue
- Returns the value of one of the processor's internal timers.
-
- @param SetMemoryAttributes
- Attempts to set the attributes of a memory region.
-
- @param NumberOfTimers
- The number of timers that are available in a processor. The value in this
- field is a constant that must not be modified after the CPU Architectural
- Protocol is installed. All consumers must treat this as a read-only field.
-
- @param DmaBufferAlignment
- The size, in bytes, of the alignment required for DMA buffer allocations.
- This is typically the size of the largest data cache line in the platform.
- The value in this field is a constant that must not be modified after the
- CPU Architectural Protocol is installed. All consumers must treat this as
- a read-only field.
-
-**/
+///
+/// The EFI_CPU_ARCH_PROTOCOL is used to abstract processor-specific functions from the DXE
+/// Foundation. This includes flushing caches, enabling and disabling interrupts, hooking interrupt
+/// vectors and exception vectors, reading internal processor timers, resetting the processor, and
+/// determining the processor frequency.
+///
struct _EFI_CPU_ARCH_PROTOCOL {
EFI_CPU_FLUSH_DATA_CACHE FlushDataCache;
EFI_CPU_ENABLE_INTERRUPT EnableInterrupt;
@@ -317,7 +270,19 @@ struct _EFI_CPU_ARCH_PROTOCOL {
EFI_CPU_REGISTER_INTERRUPT_HANDLER RegisterInterruptHandler;
EFI_CPU_GET_TIMER_VALUE GetTimerValue;
EFI_CPU_SET_MEMORY_ATTRIBUTES SetMemoryAttributes;
+ ///
+ /// The number of timers that are available in a processor. The value in this
+ /// field is a constant that must not be modified after the CPU Architectural
+ /// Protocol is installed. All consumers must treat this as a read-only field.
+ ///
UINT32 NumberOfTimers;
+ ///
+ /// The size, in bytes, of the alignment required for DMA buffer allocations.
+ /// This is typically the size of the largest data cache line in the platform.
+ /// The value in this field is a constant that must not be modified after the
+ /// CPU Architectural Protocol is installed. All consumers must treat this as
+ /// a read-only field.
+ ///
UINT32 DmaBufferAlignment;
};
diff --git a/src/include/gpxe/efi/Protocol/DebugSupport.h b/src/include/gpxe/efi/Protocol/DebugSupport.h
index 6f785a17..c8db2498 100644
--- a/src/include/gpxe/efi/Protocol/DebugSupport.h
+++ b/src/include/gpxe/efi/Protocol/DebugSupport.h
@@ -58,13 +58,13 @@ typedef INTN EFI_EXCEPTION_TYPE;
#define EXCEPT_IA32_MACHINE_CHECK 18
#define EXCEPT_IA32_SIMD 19
-//
-// IA-32 processor context definition
-//
-//
-// FXSAVE_STATE
-// FP / MMX / XMM registers (see fxrstor instruction definition)
-//
+///
+/// IA-32 processor context definition
+///
+///
+/// FXSAVE_STATE
+/// FP / MMX / XMM registers (see fxrstor instruction definition)
+///
typedef struct {
UINT16 Fcw;
UINT16 Fsw;
@@ -152,12 +152,12 @@ typedef struct {
#define EXCEPT_X64_MACHINE_CHECK 18
#define EXCEPT_X64_SIMD 19
-//
-// X64 processor context definition
-//
-// FXSAVE_STATE
-// FP / MMX / XMM registers (see fxrstor instruction definition)
-//
+///
+/// X64 processor context definition
+///
+/// FXSAVE_STATE
+/// FP / MMX / XMM registers (see fxrstor instruction definition)
+///
typedef struct {
UINT16 Fcw;
UINT16 Fsw;
@@ -278,9 +278,9 @@ typedef struct {
#define EXCEPT_IPF_IA32_INTERCEPT 46
#define EXCEPT_IPF_IA32_INTERRUPT 47
-//
-// IPF processor context definition
-//
+///
+/// IPF processor context definition
+///
typedef struct {
//
// The first reserved field is necessary to preserve alignment for the correct
@@ -510,14 +510,14 @@ VOID
IN OUT EFI_SYSTEM_CONTEXT SystemContext
);
-//
-// Machine type definition
-//
+///
+/// Machine type definition
+///
typedef enum {
- IsaIa32 = IMAGE_FILE_MACHINE_I386, // 0x014C
- IsaX64 = IMAGE_FILE_MACHINE_X64, // 0x8664
- IsaIpf = IMAGE_FILE_MACHINE_IA64, // 0x0200
- IsaEbc = IMAGE_FILE_MACHINE_EBC // 0x0EBC
+ IsaIa32 = IMAGE_FILE_MACHINE_I386, ///< 0x014C
+ IsaX64 = IMAGE_FILE_MACHINE_X64, ///< 0x8664
+ IsaIpf = IMAGE_FILE_MACHINE_IA64, ///< 0x0200
+ IsaEbc = IMAGE_FILE_MACHINE_EBC ///< 0x0EBC
} EFI_INSTRUCTION_SET_ARCHITECTURE;
@@ -613,37 +613,15 @@ EFI_STATUS
IN UINT64 Length
);
-//
-// DebugSupport protocol definition
-//
-/**
- @par Protocol Description:
- This protocol provides the services to allow the debug agent to register
- callback functions that are called either periodically or when specific
- processor exceptions occur.
-
- @param Isa
- Declares the processor architecture for this instance of the EFI
- Debug Support protocol.
-
- @param GetMaximumProcessorIndex
- Returns the maximum processor index value that may be used.
-
- @param RegisterPeriodicCallback
- Registers a callback function that will be invoked periodically
- and asynchronously to the execution of EFI.
-
- @param RegisterExceptionCallback
- Registers a callback function that will be called each time the
- specified processor exception occurs.
-
- @param InvalidateInstructionCache
- Invalidate the instruction cache of the processor. This is required
- by processor architectures where instruction and data caches are
- not coherent when instructions in the code under debug has been
- modified by the debug agent.
-**/
+///
+/// This protocol provides the services to allow the debug agent to register
+/// callback functions that are called either periodically or when specific
+/// processor exceptions occur.
+///
struct _EFI_DEBUG_SUPPORT_PROTOCOL {
+ ///
+ /// Declares the processor architecture for this instance of the EFI Debug Support protocol.
+ ///
EFI_INSTRUCTION_SET_ARCHITECTURE Isa;
EFI_GET_MAXIMUM_PROCESSOR_INDEX GetMaximumProcessorIndex;
EFI_REGISTER_PERIODIC_CALLBACK RegisterPeriodicCallback;
diff --git a/src/include/gpxe/efi/Protocol/DevicePath.h b/src/include/gpxe/efi/Protocol/DevicePath.h
index 5fb7bf66..e847668f 100644
--- a/src/include/gpxe/efi/Protocol/DevicePath.h
+++ b/src/include/gpxe/efi/Protocol/DevicePath.h
@@ -40,10 +40,30 @@
#pragma pack(1)
+/**
+ This protocol can be used on any device handle to obtain generic path/location
+ information concerning the physical device or logical device. If the handle does
+ not logically map to a physical device, the handle may not necessarily support
+ the device path protocol. The device path describes the location of the device
+ the handle is for. The size of the Device Path can be determined from the structures
+ that make up the Device Path.
+**/
typedef struct {
- UINT8 Type;
- UINT8 SubType;
- UINT8 Length[2];
+ UINT8 Type; ///< 0x01 Hardware Device Path
+ ///< 0x02 ACPI Device Path
+ ///< 0x03 Messaging Device Path
+ ///< 0x04 Media Device Path
+ ///< 0x05 BIOS Boot Specification Device Path
+ ///< 0x7F End of Hardware Device Path
+
+ UINT8 SubType; ///< Varies by Type
+ ///< 0xFF End Entire Device Path, or
+ ///< 0x01 End This Instance of a Device Path and start a new
+ ///< Device Path
+
+ UINT8 Length[2]; ///< Specific Device Path data. Type and Sub-Type define
+ ///< type of data. Size of data is included in Length.
+
} EFI_DEVICE_PATH_PROTOCOL;
///
@@ -110,6 +130,7 @@ typedef struct {
///
/// Optional variable length _HIDSTR
/// Optional variable length _UIDSTR
+ /// Optional variable length _CIDSTR
///
} ACPI_EXTENDED_HID_DEVICE_PATH;
@@ -505,55 +526,9 @@ typedef union {
#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; \
- }
+#define END_ENTIRE_DEVICE_PATH_SUBTYPE 0xFF
+#define END_INSTANCE_DEVICE_PATH_SUBTYPE 0x01
extern EFI_GUID gEfiDevicePathProtocolGuid;
diff --git a/src/include/gpxe/efi/Protocol/DriverBinding.h b/src/include/gpxe/efi/Protocol/DriverBinding.h
index 9072a288..510cb7ce 100644
--- a/src/include/gpxe/efi/Protocol/DriverBinding.h
+++ b/src/include/gpxe/efi/Protocol/DriverBinding.h
@@ -18,7 +18,6 @@
#ifndef __EFI_DRIVER_BINDING_H__
#define __EFI_DRIVER_BINDING_H__
-#include <gpxe/efi/PiDxe.h>
#include <gpxe/efi/Protocol/DevicePath.h>
///
/// Global ID for the ControllerHandle Driver Protocol
@@ -31,7 +30,12 @@
typedef struct _EFI_DRIVER_BINDING_PROTOCOL EFI_DRIVER_BINDING_PROTOCOL;
/**
- Test to see if this driver supports ControllerHandle.
+ Test to see if this driver supports ControllerHandle. This service
+ is called by the EFI boot service ConnectController(). In
+ order to make drivers as small as possible, there are a few calling
+ restrictions for this service. ConnectController() must
+ follow these calling restrictions. If any other agent wishes to call
+ Supported() it must also follow these calling restrictions.
@param This Protocol instance pointer.
@param ControllerHandle Handle of device to test
@@ -52,7 +56,12 @@ EFI_STATUS
);
/**
- Start this driver on ControllerHandle.
+ Start this driver on ControllerHandle. This service is called by the
+ EFI boot service ConnectController(). In order to make
+ drivers as small as possible, there are a few calling restrictions for
+ this service. ConnectController() must follow these
+ calling restrictions. If any other agent wishes to call Start() it
+ must also follow these calling restrictions.
@param This Protocol instance pointer.
@param ControllerHandle Handle of device to bind driver to
@@ -73,7 +82,12 @@ EFI_STATUS
);
/**
- Stop this driver on ControllerHandle.
+ Stop this driver on ControllerHandle. This service is called by the
+ EFI boot service DisconnectController(). In order to
+ make drivers as small as possible, there are a few calling
+ restrictions for this service. DisconnectController()
+ must follow these calling restrictions. If any other agent wishes
+ to call Stop() it must also follow these calling restrictions.
@param This Protocol instance pointer.
@param ControllerHandle Handle of device to stop driver on
@@ -94,70 +108,43 @@ EFI_STATUS
IN EFI_HANDLE *ChildHandleBuffer OPTIONAL
);
-//
-// Interface structure for the ControllerHandle Driver Protocol
-//
-/**
- @par Protocol Description:
- This protocol provides the services required to determine if a driver supports a given controller.
- If a controller is supported, then it also provides routines to start and stop the controller.
-
- @param Supported
- Tests to see if this driver supports a given controller. This service
- is called by the EFI boot service ConnectController(). In
- order to make drivers as small as possible, there are a few calling
- restrictions for this service. ConnectController() must
- follow these calling restrictions. If any other agent wishes to call
- Supported() it must also follow these calling restrictions.
-
-
- @param Start
- Starts a controller using this driver. This service is called by the
- EFI boot service ConnectController(). In order to make
- drivers as small as possible, there are a few calling restrictions for
- this service. ConnectController() must follow these
- calling restrictions. If any other agent wishes to call Start() it
- must also follow these calling restrictions.
-
- @param Stop
- Stops a controller using this driver. This service is called by the
- EFI boot service DisconnectController(). In order to
- make drivers as small as possible, there are a few calling
- restrictions for this service. DisconnectController()
- must follow these calling restrictions. If any other agent wishes
- to call Stop() it must also follow these calling restrictions.
-
- @param Version
- The version number of the UEFI driver that produced the
- EFI_DRIVER_BINDING_PROTOCOL. This field is used by
- the EFI boot service ConnectController() to determine
- the order that driver's Supported() service will be used when
- a controller needs to be started. EFI Driver Binding Protocol
- instances with higher Version values will be used before ones
- with lower Version values. The Version values of 0x0-
- 0x0f and 0xfffffff0-0xffffffff are reserved for
- platform/OEM specific drivers. The Version values of 0x10-
- 0xffffffef are reserved for IHV-developed drivers.
-
- @param ImageHandle
- The image handle of the UEFI driver that produced this instance
- of the EFI_DRIVER_BINDING_PROTOCOL.
-
- @param DriverBindingHandle
- The handle on which this instance of the
- EFI_DRIVER_BINDING_PROTOCOL is installed. In most
- cases, this is the same handle as ImageHandle. However, for
- UEFI drivers that produce more than one instance of the
- EFI_DRIVER_BINDING_PROTOCOL, this value may not be
- the same as ImageHandle.
-
-**/
+///
+/// This protocol provides the services required to determine if a driver supports a given controller.
+/// If a controller is supported, then it also provides routines to start and stop the controller.
+///
struct _EFI_DRIVER_BINDING_PROTOCOL {
EFI_DRIVER_BINDING_SUPPORTED Supported;
EFI_DRIVER_BINDING_START Start;
EFI_DRIVER_BINDING_STOP Stop;
+
+ ///
+ /// The version number of the UEFI driver that produced the
+ /// EFI_DRIVER_BINDING_PROTOCOL. This field is used by
+ /// the EFI boot service ConnectController() to determine
+ /// the order that driver's Supported() service will be used when
+ /// a controller needs to be started. EFI Driver Binding Protocol
+ /// instances with higher Version values will be used before ones
+ /// with lower Version values. The Version values of 0x0-
+ /// 0x0f and 0xfffffff0-0xffffffff are reserved for
+ /// platform/OEM specific drivers. The Version values of 0x10-
+ /// 0xffffffef are reserved for IHV-developed drivers.
+ ///
UINT32 Version;
+
+ ///
+ /// The image handle of the UEFI driver that produced this instance
+ /// of the EFI_DRIVER_BINDING_PROTOCOL.
+ ///
EFI_HANDLE ImageHandle;
+
+ ///
+ /// The handle on which this instance of the
+ /// EFI_DRIVER_BINDING_PROTOCOL is installed. In most
+ /// cases, this is the same handle as ImageHandle. However, for
+ /// UEFI drivers that produce more than one instance of the
+ /// EFI_DRIVER_BINDING_PROTOCOL, this value may not be
+ /// the same as ImageHandle.
+ ///
EFI_HANDLE DriverBindingHandle;
};
diff --git a/src/include/gpxe/efi/Protocol/PciIo.h b/src/include/gpxe/efi/Protocol/PciIo.h
index 5a241ffc..5aea5b4a 100644
--- a/src/include/gpxe/efi/Protocol/PciIo.h
+++ b/src/include/gpxe/efi/Protocol/PciIo.h
@@ -48,27 +48,27 @@ typedef enum {
//
// Complete PCI address generater
//
-#define EFI_PCI_IO_PASS_THROUGH_BAR 0xff // Special BAR that passes a memory or I/O cycle through unchanged
-#define EFI_PCI_IO_ATTRIBUTE_MASK 0x077f // All the following I/O and Memory cycles
-#define EFI_PCI_IO_ATTRIBUTE_ISA_MOTHERBOARD_IO 0x0001 // I/O cycles 0x0000-0x00FF (10 bit decode)
-#define EFI_PCI_IO_ATTRIBUTE_ISA_IO 0x0002 // I/O cycles 0x0100-0x03FF or greater (10 bit decode)
-#define EFI_PCI_IO_ATTRIBUTE_VGA_PALETTE_IO 0x0004 // I/O cycles 0x3C6, 0x3C8, 0x3C9 (10 bit decode)
-#define EFI_PCI_IO_ATTRIBUTE_VGA_MEMORY 0x0008 // MEM cycles 0xA0000-0xBFFFF (24 bit decode)
-#define EFI_PCI_IO_ATTRIBUTE_VGA_IO 0x0010 // I/O cycles 0x3B0-0x3BB and 0x3C0-0x3DF (10 bit decode)
-#define EFI_PCI_IO_ATTRIBUTE_IDE_PRIMARY_IO 0x0020 // I/O cycles 0x1F0-0x1F7, 0x3F6, 0x3F7 (10 bit decode)
-#define EFI_PCI_IO_ATTRIBUTE_IDE_SECONDARY_IO 0x0040 // I/O cycles 0x170-0x177, 0x376, 0x377 (10 bit decode)
-#define EFI_PCI_IO_ATTRIBUTE_MEMORY_WRITE_COMBINE 0x0080 // Map a memory range so write are combined
-#define EFI_PCI_IO_ATTRIBUTE_IO 0x0100 // Enable the I/O decode bit in the PCI Config Header
-#define EFI_PCI_IO_ATTRIBUTE_MEMORY 0x0200 // Enable the Memory decode bit in the PCI Config Header
-#define EFI_PCI_IO_ATTRIBUTE_BUS_MASTER 0x0400 // Enable the DMA bit in the PCI Config Header
-#define EFI_PCI_IO_ATTRIBUTE_MEMORY_CACHED 0x0800 // Map a memory range so all r/w accesses are cached
-#define EFI_PCI_IO_ATTRIBUTE_MEMORY_DISABLE 0x1000 // Disable a memory range
-#define EFI_PCI_IO_ATTRIBUTE_EMBEDDED_DEVICE 0x2000 // Clear for an add-in PCI Device
-#define EFI_PCI_IO_ATTRIBUTE_EMBEDDED_ROM 0x4000 // Clear for a physical PCI Option ROM accessed through ROM BAR
-#define EFI_PCI_IO_ATTRIBUTE_DUAL_ADDRESS_CYCLE 0x8000 // Clear for PCI controllers that can not genrate a DAC
-#define EFI_PCI_IO_ATTRIBUTE_ISA_IO_16 0x10000 // I/O cycles 0x0100-0x03FF or greater (16 bit decode)
-#define EFI_PCI_IO_ATTRIBUTE_VGA_PALETTE_IO_16 0x20000 // I/O cycles 0x3C6, 0x3C8, 0x3C9 (16 bit decode)
-#define EFI_PCI_IO_ATTRIBUTE_VGA_IO_16 0x30000 // I/O cycles 0x3B0-0x3BB and 0x3C0-0x3DF (16 bit decode)
+#define EFI_PCI_IO_PASS_THROUGH_BAR 0xff ///< Special BAR that passes a memory or I/O cycle through unchanged
+#define EFI_PCI_IO_ATTRIBUTE_MASK 0x077f ///< All the following I/O and Memory cycles
+#define EFI_PCI_IO_ATTRIBUTE_ISA_MOTHERBOARD_IO 0x0001 ///< I/O cycles 0x0000-0x00FF (10 bit decode)
+#define EFI_PCI_IO_ATTRIBUTE_ISA_IO 0x0002 ///< I/O cycles 0x0100-0x03FF or greater (10 bit decode)
+#define EFI_PCI_IO_ATTRIBUTE_VGA_PALETTE_IO 0x0004 ///< I/O cycles 0x3C6, 0x3C8, 0x3C9 (10 bit decode)
+#define EFI_PCI_IO_ATTRIBUTE_VGA_MEMORY 0x0008 ///< MEM cycles 0xA0000-0xBFFFF (24 bit decode)
+#define EFI_PCI_IO_ATTRIBUTE_VGA_IO 0x0010 ///< I/O cycles 0x3B0-0x3BB and 0x3C0-0x3DF (10 bit decode)
+#define EFI_PCI_IO_ATTRIBUTE_IDE_PRIMARY_IO 0x0020 ///< I/O cycles 0x1F0-0x1F7, 0x3F6, 0x3F7 (10 bit decode)
+#define EFI_PCI_IO_ATTRIBUTE_IDE_SECONDARY_IO 0x0040 ///< I/O cycles 0x170-0x177, 0x376, 0x377 (10 bit decode)
+#define EFI_PCI_IO_ATTRIBUTE_MEMORY_WRITE_COMBINE 0x0080 ///< Map a memory range so write are combined
+#define EFI_PCI_IO_ATTRIBUTE_IO 0x0100 ///< Enable the I/O decode bit in the PCI Config Header
+#define EFI_PCI_IO_ATTRIBUTE_MEMORY 0x0200 ///< Enable the Memory decode bit in the PCI Config Header
+#define EFI_PCI_IO_ATTRIBUTE_BUS_MASTER 0x0400 ///< Enable the DMA bit in the PCI Config Header
+#define EFI_PCI_IO_ATTRIBUTE_MEMORY_CACHED 0x0800 ///< Map a memory range so all r/w accesses are cached
+#define EFI_PCI_IO_ATTRIBUTE_MEMORY_DISABLE 0x1000 ///< Disable a memory range
+#define EFI_PCI_IO_ATTRIBUTE_EMBEDDED_DEVICE 0x2000 ///< Clear for an add-in PCI Device
+#define EFI_PCI_IO_ATTRIBUTE_EMBEDDED_ROM 0x4000 ///< Clear for a physical PCI Option ROM accessed through ROM BAR
+#define EFI_PCI_IO_ATTRIBUTE_DUAL_ADDRESS_CYCLE 0x8000 ///< Clear for PCI controllers that can not genrate a DAC
+#define EFI_PCI_IO_ATTRIBUTE_ISA_IO_16 0x10000 ///< I/O cycles 0x0100-0x03FF or greater (16 bit decode)
+#define EFI_PCI_IO_ATTRIBUTE_VGA_PALETTE_IO_16 0x20000 ///< I/O cycles 0x3C6, 0x3C8, 0x3C9 (16 bit decode)
+#define EFI_PCI_IO_ATTRIBUTE_VGA_IO_16 0x30000 ///< I/O cycles 0x3B0-0x3BB and 0x3C0-0x3DF (16 bit decode)
#define EFI_PCI_DEVICE_ENABLE (EFI_PCI_IO_ATTRIBUTE_IO | EFI_PCI_IO_ATTRIBUTE_MEMORY | EFI_PCI_IO_ATTRIBUTE_BUS_MASTER)
#define EFI_VGA_DEVICE_ENABLE (EFI_PCI_IO_ATTRIBUTE_VGA_PALETTE_IO | EFI_PCI_IO_ATTRIBUTE_VGA_MEMORY | EFI_PCI_IO_ATTRIBUTE_VGA_IO | EFI_PCI_IO_ATTRIBUTE_IO)
@@ -474,84 +474,13 @@ EFI_STATUS
IN OUT UINT64 *Length
);
-/**
- @par Protocol Description:
- The EFI_PCI_IO_PROTOCOL provides the basic Memory, I/O, PCI configuration,
- and DMA interfaces that are used to abstract accesses to PCI controllers.
- There is one EFI_PCI_IO_PROTOCOL instance for each PCI controller on a PCI bus.
- A device driver that wishes to manage a PCI controller in a system will have to
- retrieve the EFI_PCI_IO_PROTOCOL instance that is associated with the PCI controller.
-
- @param PollMem
- Polls an address in PCI memory space until an exit condition is met, or a timeout occurs.
-
- @param PollIo
- Polls an address in PCI I/O space until an exit condition is met, or a timeout occurs.
-
- @param Mem.Read
- Allows BAR relative reads to PCI memory space.
-
- @param Mem.Write
- Allows BAR relative writes to PCI memory space.
-
- @param Io.Read
- Allows BAR relative reads to PCI I/O space.
-
- @param Io.Write
- Allows BAR relative writes to PCI I/O space.
-
- @param Pci.Read
- Allows PCI controller relative reads to PCI configuration space.
-
- @param Pci.Write
- Allows PCI controller relative writes to PCI configuration space.
-
- @param CopyMem
- Allows one region of PCI memory space to be copied to another region of PCI memory space.
-
- @param Map
- Provides the PCI controller's specific address needed to access system memory for DMA.
-
- @param Unmap
- Releases any resources allocated by Map().
-
- @param AllocateBuffer
- Allocates pages that are suitable for a common buffer mapping.
-
- @param FreeBuffer
- Frees pages that were allocated with AllocateBuffer().
-
- @param Flush
- Flushes all PCI posted write transactions to system memory.
-
- @param GetLocation
- Retrieves this PCI controller's current PCI bus number, device number, and function number.
-
- @param Attributes
- Performs an operation on the attributes that this PCI controller supports.
- The operations include getting the set of supported attributes, retrieving
- the current attributes, setting the current
- attributes, enabling attributes, and disabling attributes.
-
- @param GetBarAttributes
- Gets the attributes that this PCI controller supports setting on a BAR using
- SetBarAttributes(), and retrieves the list of resource descriptors for a BAR.
-
- @param SetBarAttributes
- Sets the attributes for a range of a BAR on a PCI controller.
-
- @param RomSize
- The size, in bytes, of the ROM image.
-
- @param RomImage
- A pointer to the in memory copy of the ROM image. The PCI Bus Driver is responsible
- for allocating memory for the ROM image, and copying the contents of the ROM to memory.
- The contents of this buffer are either from the PCI option ROM that can be accessed
- through the ROM BAR of the PCI controller, or it is from a platform-specific location.
- The Attributes() function can be used to determine from which of these two sources
- the RomImage buffer was initialized.
-
-**/
+///
+/// The EFI_PCI_IO_PROTOCOL provides the basic Memory, I/O, PCI configuration,
+/// and DMA interfaces that are used to abstract accesses to PCI controllers.
+/// There is one EFI_PCI_IO_PROTOCOL instance for each PCI controller on a PCI bus.
+/// A device driver that wishes to manage a PCI controller in a system will have to
+/// retrieve the EFI_PCI_IO_PROTOCOL instance that is associated with the PCI controller.
+///
struct _EFI_PCI_IO_PROTOCOL {
EFI_PCI_IO_PROTOCOL_POLL_IO_MEM PollMem;
EFI_PCI_IO_PROTOCOL_POLL_IO_MEM PollIo;
@@ -568,7 +497,20 @@ struct _EFI_PCI_IO_PROTOCOL {
EFI_PCI_IO_PROTOCOL_ATTRIBUTES Attributes;
EFI_PCI_IO_PROTOCOL_GET_BAR_ATTRIBUTES GetBarAttributes;
EFI_PCI_IO_PROTOCOL_SET_BAR_ATTRIBUTES SetBarAttributes;
+
+ ///
+ /// The size, in bytes, of the ROM image.
+ ///
UINT64 RomSize;
+
+ ///
+ /// A pointer to the in memory copy of the ROM image. The PCI Bus Driver is responsible
+ /// for allocating memory for the ROM image, and copying the contents of the ROM to memory.
+ /// The contents of this buffer are either from the PCI option ROM that can be accessed
+ /// through the ROM BAR of the PCI controller, or it is from a platform-specific location.
+ /// The Attributes() function can be used to determine from which of these two sources
+ /// the RomImage buffer was initialized.
+ ///
VOID *RomImage;
};
diff --git a/src/include/gpxe/efi/Protocol/PciRootBridgeIo.h b/src/include/gpxe/efi/Protocol/PciRootBridgeIo.h
index c15c72f7..a1150f08 100644
--- a/src/include/gpxe/efi/Protocol/PciRootBridgeIo.h
+++ b/src/include/gpxe/efi/Protocol/PciRootBridgeIo.h
@@ -19,8 +19,6 @@
#ifndef __PCI_ROOT_BRIDGE_IO_H__
#define __PCI_ROOT_BRIDGE_IO_H__
-#include <gpxe/efi/PiDxe.h>
-
#define EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_GUID \
{ \
0x2f707ebb, 0x4a1a, 0x11d4, {0x9a, 0x38, 0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d } \
@@ -360,73 +358,14 @@ EFI_STATUS
OUT VOID **Resources
);
-/**
- @par Protocol Description:
- Provides the basic Memory, I/O, PCI configuration, and DMA interfaces that are
- used to abstract accesses to PCI controllers behind a PCI Root Bridge Controller.
-
- @param ParentHandle
- The EFI_HANDLE of the PCI Host Bridge of which this PCI Root Bridge is a member.
-
- @param PollMem
- Polls an address in memory mapped I/O space until an exit condition is met,
- or a timeout occurs.
-
- @param PollIo
- Polls an address in I/O space until an exit condition is met, or a timeout occurs.
-
- @param Mem.Read
- Allows reads from memory mapped I/O space.
-
- @param Mem.Write
- Allows writes to memory mapped I/O space.
-
- @param Io.Read
- Allows reads from I/O space.
-
- @param Io.Write
- Allows writes to I/O space.
-
- @param Pci.Read
- Allows reads from PCI configuration space.
-
- @param Pci.Write
- Allows writes to PCI configuration space.
-
- @param CopyMem
- Allows one region of PCI root bridge memory space to be copied to another
- region of PCI root bridge memory space.
-
- @param Map
- Provides the PCI controller's specific addresses needed to access system memory for DMA.
-
- @param Unmap
- Releases any resources allocated by Map().
-
- @param AllocateBuffer
- Allocates pages that are suitable for a common buffer mapping.
-
- @param FreeBuffer
- Free pages that were allocated with AllocateBuffer().
-
- @param Flush
- Flushes all PCI posted write transactions to system memory.
-
- @param GetAttributes
- Gets the attributes that a PCI root bridge supports setting with SetAttributes(),
- and the attributes that a PCI root bridge is currently using.
-
- @param SetAttributes
- Sets attributes for a resource range on a PCI root bridge.
-
- @param Configuration
- Gets the current resource settings for this PCI root bridge.
-
- @param SegmentNumber
- The segment number that this PCI root bridge resides.
-
-**/
+///
+/// Provides the basic Memory, I/O, PCI configuration, and DMA interfaces that are
+/// used to abstract accesses to PCI controllers behind a PCI Root Bridge Controller.
+///
struct _EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL {
+ ///
+ /// The EFI_HANDLE of the PCI Host Bridge of which this PCI Root Bridge is a member.
+ ///
EFI_HANDLE ParentHandle;
EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_POLL_IO_MEM PollMem;
EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_POLL_IO_MEM PollIo;
@@ -442,6 +381,10 @@ struct _EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL {
EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_GET_ATTRIBUTES GetAttributes;
EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_SET_ATTRIBUTES SetAttributes;
EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_CONFIGURATION Configuration;
+
+ ///
+ /// The segment number that this PCI root bridge resides.
+ ///
UINT32 SegmentNumber;
};
diff --git a/src/include/gpxe/efi/Protocol/SimpleNetwork.h b/src/include/gpxe/efi/Protocol/SimpleNetwork.h
index ed8c8ce6..d3d2afc7 100644
--- a/src/include/gpxe/efi/Protocol/SimpleNetwork.h
+++ b/src/include/gpxe/efi/Protocol/SimpleNetwork.h
@@ -552,76 +552,18 @@ EFI_STATUS
//
#define EFI_SIMPLE_NETWORK_INTERFACE_REVISION EFI_SIMPLE_NETWORK_PROTOCOL_REVISION
-/**
- @par Protocol Description:
- The EFI_SIMPLE_NETWORK_PROTOCOL protocol is used to initialize access
- to a network adapter. Once the network adapter initializes,
- the EFI_SIMPLE_NETWORK_PROTOCOL protocol provides services that
- allow packets to be transmitted and received.
-
- @param Revision
- Revision of the EFI_SIMPLE_NETWORK_PROTOCOL. All future revisions must
- be backwards compatible. If a future version is not backwards compatible
- it is not the same GUID.
-
- @param Start
- Prepares the network interface for further command operations.
- No other EFI_SIMPLE_NETWORK_PROTOCOL interface functions will operate
- until this call is made.
-
- @param Stop
- Stops further network interface command processing.
- No other EFI_SIMPLE_NETWORK_PROTOCOL interface functions will operate
- after this call is made until another Start() call is made.
-
- @param Initialize
- Resets the network adapter and allocates the transmit and receive buffers.
-
- @param Reset
- Resets the network adapter and reinitializes it with the parameters
- provided in the previous call to Initialize().
-
- @param Shutdown
- Resets the network adapter and leaves it in a state safe for another driver
- to initialize. The memory buffers assigned in the Initialize() call are released.
- After this call, only the Initialize() or Stop() calls may be used.
-
- @param ReceiveFilters
- Enables and disables the receive filters for the network interface and,
- if supported, manages the filtered multicast
- HW MAC (Hardware Media Access Control) address list.
-
- @param StationAddress
- Modifies or resets the current station address, if supported.
-
- @param Statistics
- Collects statistics from the network interface and allows the statistics to be reset.
-
- @param MCastIpToMac
- Maps a multicast IP address to a multicast HW MAC address.
-
- @param NvData
- Reads and writes the contents of the NVRAM devices attached to the network interface.
-
- @param GetStatus
- Reads the current interrupt status and the list of recycled transmit
- buffers from the network interface.
-
- @param Transmit
- Places a packet in the transmit queue.
-
- @param Receive
- Retrieves a packet from the receive queue, along with the status
- flags that describe the packet type.
-
- @param WaitForPacket
- Event used with WaitForEvent() to wait for a packet to be received.
-
- @param Mode
- Pointer to the EFI_SIMPLE_NETWORK_MODE data for the device.
-
-**/
+///
+/// The EFI_SIMPLE_NETWORK_PROTOCOL protocol is used to initialize access
+/// to a network adapter. Once the network adapter initializes,
+/// the EFI_SIMPLE_NETWORK_PROTOCOL protocol provides services that
+/// allow packets to be transmitted and received.
+///
struct _EFI_SIMPLE_NETWORK_PROTOCOL {
+ ///
+ /// Revision of the EFI_SIMPLE_NETWORK_PROTOCOL. All future revisions must
+ /// be backwards compatible. If a future version is not backwards compatible
+ /// it is not the same GUID.
+ ///
UINT64 Revision;
EFI_SIMPLE_NETWORK_START Start;
EFI_SIMPLE_NETWORK_STOP Stop;
@@ -636,7 +578,13 @@ struct _EFI_SIMPLE_NETWORK_PROTOCOL {
EFI_SIMPLE_NETWORK_GET_STATUS GetStatus;
EFI_SIMPLE_NETWORK_TRANSMIT Transmit;
EFI_SIMPLE_NETWORK_RECEIVE Receive;
+ ///
+ /// Event used with WaitForEvent() to wait for a packet to be received.
+ ///
EFI_EVENT WaitForPacket;
+ ///
+ /// Pointer to the EFI_SIMPLE_NETWORK_MODE data for the device.
+ ///
EFI_SIMPLE_NETWORK_MODE *Mode;
};
diff --git a/src/include/gpxe/efi/Protocol/SimpleTextIn.h b/src/include/gpxe/efi/Protocol/SimpleTextIn.h
index ca747dde..f14f62d5 100644
--- a/src/include/gpxe/efi/Protocol/SimpleTextIn.h
+++ b/src/include/gpxe/efi/Protocol/SimpleTextIn.h
@@ -118,25 +118,16 @@ EFI_STATUS
OUT EFI_INPUT_KEY *Key
);
-/**
- @par Protocol Description:
- The EFI_SIMPLE_TEXT_INPUT_PROTOCOL is used on the ConsoleIn device.
- It is the minimum required protocol for ConsoleIn.
-
- @param Reset
- Reset the ConsoleIn device.
-
- @param ReadKeyStroke
- Returns the next input character.
-
- @param WaitForKey
- Event to use with WaitForEvent() to wait for a key to be available.
-
-**/
-
+///
+/// The EFI_SIMPLE_TEXT_INPUT_PROTOCOL is used on the ConsoleIn device.
+/// It is the minimum required protocol for ConsoleIn.
+///
struct _EFI_SIMPLE_TEXT_INPUT_PROTOCOL {
EFI_INPUT_RESET Reset;
EFI_INPUT_READ_KEY ReadKeyStroke;
+ ///
+ /// Event to use with WaitForEvent() to wait for a key to be available
+ ///
EFI_EVENT WaitForKey;
};
diff --git a/src/include/gpxe/efi/Protocol/SimpleTextOut.h b/src/include/gpxe/efi/Protocol/SimpleTextOut.h
index cc772743..426ce819 100644
--- a/src/include/gpxe/efi/Protocol/SimpleTextOut.h
+++ b/src/include/gpxe/efi/Protocol/SimpleTextOut.h
@@ -20,8 +20,6 @@
#ifndef __SIMPLE_TEXT_OUT_H__
#define __SIMPLE_TEXT_OUT_H__
-#include <gpxe/efi/PiDxe.h>
-
#define EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL_GUID \
{ \
0x387477c2, 0x69c7, 0x11d2, {0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b } \
@@ -375,43 +373,12 @@ typedef struct {
BOOLEAN CursorVisible;
} EFI_SIMPLE_TEXT_OUTPUT_MODE;
-/**
- @par Protocol Description:
- The SIMPLE_TEXT_OUTPUT protocol is used to control text-based output devices.
- It is the minimum required protocol for any handle supplied as the ConsoleOut
- or StandardError device. In addition, the minimum supported text mode of such
- devices is at least 80 x 25 characters.
-
- @param Reset
- Reset the ConsoleOut device.
-
- @param OutputString
- Displays the Unicode string on the device at the current cursor location.
-
- @param TestString
- Tests to see if the ConsoleOut device supports this Unicode string.
-
- @param QueryMode
- Queries information concerning the output device's supported text mode.
-
- @param SetMode
- Sets the current mode of the output device.
-
- @param SetAttribute
- Sets the foreground and background color of the text that is output.
-
- @param ClearScreen
- Clears the screen with the currently set background color.
-
- @param SetCursorPosition
- Sets the current cursor position.
-
- @param EnableCursor
- Turns the visibility of the cursor on/off.
-
- @param Mode
- Pointer to SIMPLE_TEXT_OUTPUT_MODE data.
-**/
+///
+/// The SIMPLE_TEXT_OUTPUT protocol is used to control text-based output devices.
+/// It is the minimum required protocol for any handle supplied as the ConsoleOut
+/// or StandardError device. In addition, the minimum supported text mode of such
+/// devices is at least 80 x 25 characters.
+///
struct _EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL {
EFI_TEXT_RESET Reset;
@@ -426,9 +393,9 @@ struct _EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL {
EFI_TEXT_SET_CURSOR_POSITION SetCursorPosition;
EFI_TEXT_ENABLE_CURSOR EnableCursor;
- //
- // Current mode
- //
+ ///
+ /// Pointer to SIMPLE_TEXT_OUTPUT_MODE data.
+ ///
EFI_SIMPLE_TEXT_OUTPUT_MODE *Mode;
};
diff --git a/src/include/gpxe/efi/Uefi/UefiBaseType.h b/src/include/gpxe/efi/Uefi/UefiBaseType.h
index 1bda8982..475ac01e 100644
--- a/src/include/gpxe/efi/Uefi/UefiBaseType.h
+++ b/src/include/gpxe/efi/Uefi/UefiBaseType.h
@@ -1,5 +1,4 @@
/** @file
-
Defines data types and constants introduced in UEFI.
Copyright (c) 2006 - 2008, Intel Corporation
@@ -18,33 +17,40 @@
#include <gpxe/efi/Base.h>
+//
+// Basical data type definitions introduced in UEFI.
+//
+
///
-/// Basical data type definitions introduced in UEFI.
+/// 128-bit buffer containing a unique identifier value.
///
typedef GUID EFI_GUID;
-
///
/// Function return status for EFI API
///
typedef RETURN_STATUS EFI_STATUS;
+///
+/// A collection of related interfaces.
+///
typedef VOID *EFI_HANDLE;
-
+///
+/// Handle to an event structure.
+///
typedef VOID *EFI_EVENT;
-
+///
+/// Task priority level.
+///
typedef UINTN EFI_TPL;
-
-
+///
+/// Logical block address.
+///
typedef UINT64 EFI_LBA;
-
-
-typedef UINT16 STRING_REF;
-
typedef UINT64 EFI_PHYSICAL_ADDRESS;
typedef UINT64 EFI_VIRTUAL_ADDRESS;
///
/// EFI Time Abstraction:
-/// Year: 2000 - 20XX
+/// Year: 1998 - 20XX
/// Month: 1 - 12
/// Day: 1 - 31
/// Hour: 0 - 23
@@ -68,21 +74,31 @@ typedef struct {
} EFI_TIME;
-//
-// Networking Definitions
-//
+///
+/// 4-byte buffer. An IPv4 internet protocol address.
+///
typedef struct {
UINT8 Addr[4];
} EFI_IPv4_ADDRESS;
+///
+/// 16-byte buffer. An IPv6 internet protocol address
+///
typedef struct {
UINT8 Addr[16];
} EFI_IPv6_ADDRESS;
+///
+/// 32-byte buffer containing a network Media Access Control address.
+///
typedef struct {
UINT8 Addr[32];
} EFI_MAC_ADDRESS;
+///
+/// 16-byte buffer aligned on a 4-byte boundary.
+/// An IPv4 or IPv6 internet protocol address.
+///
typedef union {
UINT32 Addr[4];
EFI_IPv4_ADDRESS v4;
@@ -131,8 +147,6 @@ typedef union {
#define EFI_WARN_BUFFER_TOO_SMALL RETURN_WARN_BUFFER_TOO_SMALL
-#define NULL_HANDLE ((VOID *) 0)
-
//
// Define macro to encode the status code.
//
@@ -143,10 +157,9 @@ typedef union {
//
// Define macros to build data structure signatures from characters.
//
-#define EFI_SIGNATURE_16(A, B) ((A) | (B << 8))
-#define EFI_SIGNATURE_32(A, B, C, D) (EFI_SIGNATURE_16 (A, B) | (EFI_SIGNATURE_16 (C, D) << 16))
-#define EFI_SIGNATURE_64(A, B, C, D, E, F, G, H) \
- (EFI_SIGNATURE_32 (A, B, C, D) | ((UINT64) (EFI_SIGNATURE_32 (E, F, G, H)) << 32))
+#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)
///
@@ -171,4 +184,17 @@ typedef union {
#define EFI_MAX_BIT MAX_BIT
#define EFI_MAX_ADDRESS MAX_ADDRESS
+
+///
+/// Limited buffer size for a language code recommended by RFC3066
+/// (42 characters plus a NULL terminator)
+///
+#define RFC_3066_ENTRY_SIZE (42 + 1)
+
+///
+/// The size of a 3 character ISO639 language code.
+///
+#define ISO_639_2_ENTRY_SIZE 3
+
+
#endif
diff --git a/src/include/gpxe/efi/Uefi/UefiGpt.h b/src/include/gpxe/efi/Uefi/UefiGpt.h
index 70d62fca..92c3035e 100644
--- a/src/include/gpxe/efi/Uefi/UefiGpt.h
+++ b/src/include/gpxe/efi/Uefi/UefiGpt.h
@@ -1,7 +1,7 @@
/** @file
EFI Guid Partition Table Format Definition.
- Copyright (c) 2006 - 2007, Intel Corporation
+ 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
@@ -15,6 +15,10 @@
#ifndef __UEFI_GPT_H__
#define __UEFI_GPT_H__
+///
+/// The primary GUID Partition Table Header must be
+/// located in LBA 1 (i.e., the second logical block).
+///
#define PRIMARY_PART_HEADER_LBA 1
///
@@ -52,14 +56,6 @@ typedef struct {
CHAR16 PartitionName[36];
} EFI_PARTITION_ENTRY;
-///
-/// GPT Partition Entry Status
-///
-typedef struct {
- BOOLEAN OutOfRange;
- BOOLEAN Overlap;
-} EFI_PARTITION_ENTRY_STATUS;
-
#pragma pack()
#endif
diff --git a/src/include/gpxe/efi/Uefi/UefiInternalFormRepresentation.h b/src/include/gpxe/efi/Uefi/UefiInternalFormRepresentation.h
index 2a25c491..c6755173 100644
--- a/src/include/gpxe/efi/Uefi/UefiInternalFormRepresentation.h
+++ b/src/include/gpxe/efi/Uefi/UefiInternalFormRepresentation.h
@@ -23,8 +23,6 @@
///
/// The following types are currently defined:
///
-typedef UINT32 RELOFST;
-
typedef VOID* EFI_HII_HANDLE;
typedef CHAR16* EFI_STRING;
typedef UINT16 EFI_IMAGE_ID;
@@ -32,45 +30,31 @@ typedef UINT16 EFI_QUESTION_ID;
typedef UINT16 EFI_STRING_ID;
typedef UINT16 EFI_FORM_ID;
typedef UINT16 EFI_VARSTORE_ID;
+
typedef UINT16 EFI_DEFAULT_ID;
+
typedef UINT32 EFI_HII_FONT_STYLE;
#pragma pack(1)
+//
+// Definitions for Package Lists and Package Headers
+// Section 27.3.1
+//
///
-/// HII package list
+/// The header found at the start of each package list.
///
typedef struct {
EFI_GUID PackageListGuid;
UINT32 PackageLength;
} EFI_HII_PACKAGE_LIST_HEADER;
-/**
-
- Each package starts with a header, as defined above, which
- indicates the size and type of the package. When added to a
- pointer pointing to the start of the header, Length points at
- the next package. The package lists form a package list when
- concatenated together and terminated with an
- EFI_HII_PACKAGE_HEADER with a Type of EFI_HII_PACKAGE_END. The
- type EFI_HII_PACKAGE_TYPE_GUID is used for vendor-defined HII
- packages, whose contents are determined by the Guid. The range
- of package types starting with EFI_HII_PACKAGE_TYPE_SYSTEM_BEGIN
- through EFI_HII_PACKAGE_TYPE_SYSTEM_END are reserved for system
- firmware implementers.
-
- @param Length The size of the package in bytes.
-
- @param Type The package type. See EFI_HII_PACKAGE_TYPE_x,
- below.
-
- @param Data The package data, the format of which is
- determined by Type.
-
-**/
+///
+/// The header found at the start of each package.
+///
typedef struct {
UINT32 Length:24;
UINT32 Type:8;
@@ -78,32 +62,33 @@ typedef struct {
} EFI_HII_PACKAGE_HEADER;
//
-// EFI_HII_PACKAGE_TYPE_x.
+// Value of HII package type
//
#define EFI_HII_PACKAGE_TYPE_ALL 0x00
#define EFI_HII_PACKAGE_TYPE_GUID 0x01
-#define EFI_HII_PACKAGE_FORM 0x02
-#define EFI_HII_PACKAGE_KEYBOARD_LAYOUT 0x03
+#define EFI_HII_PACKAGE_FORMS 0x02
#define EFI_HII_PACKAGE_STRINGS 0x04
#define EFI_HII_PACKAGE_FONTS 0x05
#define EFI_HII_PACKAGE_IMAGES 0x06
#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_END 0xDF
#define EFI_HII_PACKAGE_TYPE_SYSTEM_BEGIN 0xE0
#define EFI_HII_PACKAGE_TYPE_SYSTEM_END 0xFF
//
-// Simplified Font Package
+// Definitions for Simplified Font Package
+// Section 27.3.2
//
-#define EFI_GLYPH_HEIGHT 19
-#define EFI_GLYPH_WIDTH 8
//
// 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
typedef struct {
CHAR16 UnicodeWeight;
@@ -119,7 +104,10 @@ typedef struct {
UINT8 Pad[3];
} EFI_WIDE_GLYPH;
-
+///
+/// A simplified font package consists of a font header
+/// followed by a series of glyph structures.
+///
typedef struct _EFI_HII_SIMPLE_FONT_PACKAGE_HDR {
EFI_HII_PACKAGE_HEADER Header;
UINT16 NumberOfNarrowGlyphs;
@@ -129,9 +117,13 @@ typedef struct _EFI_HII_SIMPLE_FONT_PACKAGE_HDR {
} EFI_HII_SIMPLE_FONT_PACKAGE_HDR;
//
-// Font Package
+// Definitions for Font Package
+// Section 27.3.3
//
+//
+// Value for font style
+//
#define EFI_HII_FONT_STYLE_NORMAL 0x00000000
#define EFI_HII_FONT_STYLE_BOLD 0x00000001
#define EFI_HII_FONT_STYLE_ITALIC 0x00000002
@@ -149,6 +141,12 @@ typedef struct _EFI_HII_GLYPH_INFO {
INT16 AdvanceX;
} EFI_HII_GLYPH_INFO;
+///
+/// The fixed header consists of a standard record header and
+/// 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.
+///
typedef struct _EFI_HII_FONT_PACKAGE_HDR {
EFI_HII_PACKAGE_HEADER Header;
UINT32 HdrSize;
@@ -158,6 +156,9 @@ typedef struct _EFI_HII_FONT_PACKAGE_HDR {
CHAR16 FontFamily[1];
} EFI_HII_FONT_PACKAGE_HDR;
+//
+// Value of different glyph info block types
+//
#define EFI_HII_GIBT_END 0x00
#define EFI_HII_GIBT_GLYPH 0x10
#define EFI_HII_GIBT_GLYPHS 0x11
@@ -175,6 +176,10 @@ typedef struct _EFI_HII_GLYPH_BLOCK {
UINT8 BlockType;
} EFI_HII_GLYPH_BLOCK;
+//
+// Definition of different glyph info block types
+//
+
typedef struct _EFI_HII_GIBT_DEFAULTS_BLOCK {
EFI_HII_GLYPH_BLOCK Header;
EFI_HII_GLYPH_INFO Cell;
@@ -210,25 +215,25 @@ typedef struct _EFI_HII_GIBT_EXT4_BLOCK {
typedef struct _EFI_HII_GIBT_GLYPH_BLOCK {
EFI_HII_GLYPH_BLOCK Header;
EFI_HII_GLYPH_INFO Cell;
- UINT8 BitmapData[1]; // the number of bytes per bitmap can be calculated by ((Cell.Width+7)/8)*Cell.Height
+ UINT8 BitmapData[1];
} EFI_HII_GIBT_GLYPH_BLOCK;
typedef struct _EFI_HII_GIBT_GLYPHS_BLOCK {
EFI_HII_GLYPH_BLOCK Header;
EFI_HII_GLYPH_INFO Cell;
UINT16 Count;
- UINT8 BitmapData[1]; // the number of bytes per bitmap can be calculated by ((Cell.Width+7)/8)*Cell.Height
+ UINT8 BitmapData[1];
} EFI_HII_GIBT_GLYPHS_BLOCK;
typedef struct _EFI_HII_GIBT_GLYPH_DEFAULT_BLOCK {
EFI_HII_GLYPH_BLOCK Header;
- UINT8 BitmapData[1]; // the number of bytes per bitmap can be calculated by ((Global.Cell.Width+7)/8)*Global.Cell.Height
+ UINT8 BitmapData[1];
} EFI_HII_GIBT_GLYPH_DEFAULT_BLOCK;
typedef struct _EFI_HII_GIBT_GLYPHS_DEFAULT_BLOCK {
EFI_HII_GLYPH_BLOCK Header;
UINT16 Count;
- UINT8 BitmapData[1]; // the number of bytes per bitmap can be calculated by ((Global.Cell.Width+7)/8)*Global.Cell.Height
+ UINT8 BitmapData[1];
} EFI_HII_GIBT_GLYPHS_DEFAULT_BLOCK;
typedef struct _EFI_HII_GIBT_SKIP1_BLOCK {
@@ -242,16 +247,27 @@ typedef struct _EFI_HII_GIBT_SKIP2_BLOCK {
} EFI_HII_GIBT_SKIP2_BLOCK;
//
-// Device Path Package
+// Definitions for Device Path Package
+// Section 27.3.4
//
+
+///
+/// The device path package is used to carry a device path
+/// associated with the package list.
+///
typedef struct _EFI_HII_DEVICE_PATH_PACKAGE {
EFI_HII_PACKAGE_HEADER Header;
// EFI_DEVICE_PATH_PROTOCOL DevicePath[];
} EFI_HII_DEVICE_PATH_PACKAGE;
//
-// GUID Package
+// Definitions for GUID Package
+// Section 27.3.5
//
+
+///
+/// The GUID package is used to carry data where the format is defined by a GUID.
+///
typedef struct _EFI_HII_GUID_PACKAGE_HDR {
EFI_HII_PACKAGE_HEADER Header;
EFI_GUID Guid;
@@ -259,12 +275,17 @@ typedef struct _EFI_HII_GUID_PACKAGE_HDR {
} EFI_HII_GUID_PACKAGE_HDR;
//
-// String Package
+// Definitions for String Package
+// Section 27.3.6
//
#define UEFI_CONFIG_LANG L"x-UEFI"
-#define UEFI_CONFIG_LANG2 L"x-i-UEFI" // BUGBUG, spec need to be updated.
+#define UEFI_CONFIG_LANG2 L"x-i-UEFI"
+///
+/// The fixed header consists of a standard record header and then the string identifiers
+/// contained in this section and the offsets of the string and language information.
+///
typedef struct _EFI_HII_STRING_PACKAGE_HDR {
EFI_HII_PACKAGE_HEADER Header;
UINT32 HdrSize;
@@ -278,6 +299,9 @@ typedef struct {
UINT8 BlockType;
} EFI_HII_STRING_BLOCK;
+//
+// Value of different string information block types
+//
#define EFI_HII_SIBT_END 0x00
#define EFI_HII_SIBT_STRING_SCSU 0x10
#define EFI_HII_SIBT_STRING_SCSU_FONT 0x11
@@ -295,6 +319,10 @@ typedef struct {
#define EFI_HII_SIBT_EXT4 0x32
#define EFI_HII_SIBT_FONT 0x40
+//
+// Definition of different string information block types
+//
+
typedef struct _EFI_HII_SIBT_DUPLICATE_BLOCK {
EFI_HII_STRING_BLOCK Header;
EFI_STRING_ID StringId;
@@ -389,7 +417,8 @@ typedef struct _EFI_HII_SIBT_STRINGS_UCS2_FONT_BLOCK {
} EFI_HII_SIBT_STRINGS_UCS2_FONT_BLOCK;
//
-// Image Packages
+// Definitions for Image Package
+// Section 27.3.7
//
typedef struct _EFI_HII_IMAGE_PACKAGE_HDR {
@@ -402,6 +431,9 @@ typedef struct _EFI_HII_IMAGE_BLOCK {
UINT8 BlockType;
} EFI_HII_IMAGE_BLOCK;
+//
+// Value of different image information block types
+//
#define EFI_HII_IIBT_END 0x00
#define EFI_HII_IIBT_IMAGE_1BIT 0x10
#define EFI_HII_IIBT_IMAGE_1BIT_TRANS 0x11
@@ -419,6 +451,10 @@ typedef struct _EFI_HII_IMAGE_BLOCK {
#define EFI_HII_IIBT_EXT2 0x31
#define EFI_HII_IIBT_EXT4 0x32
+//
+// Definition of different image information block types
+//
+
typedef struct _EFI_HII_IIBT_END_BLOCK {
EFI_HII_IMAGE_BLOCK Header;
} EFI_HII_IIBT_END_BLOCK;
@@ -538,6 +574,10 @@ typedef struct _EFI_HII_IIBT_SKIP2_BLOCK {
UINT16 SkipCount;
} EFI_HII_IIBT_SKIP2_BLOCK;
+//
+// Definitions for Palette Information
+//
+
typedef struct _EFI_HII_IMAGE_PALETTE_INFO_HEADER {
UINT16 PaletteCount;
} EFI_HII_IMAGE_PALETTE_INFO_HEADER;
@@ -548,9 +588,13 @@ typedef struct _EFI_HII_IMAGE_PALETTE_INFO {
} EFI_HII_IMAGE_PALETTE_INFO;
//
-// Forms Package
+// Definitions for Forms Package
+// Section 27.3.8
//
+///
+/// The Forms package is used to carry forms-based encoding data.
+///
typedef struct _EFI_HII_FORM_PACKAGE {
EFI_HII_PACKAGE_HEADER Header;
// EFI_IFR_OP_HEADER OpCodeHeader;
@@ -672,6 +716,10 @@ typedef union {
#define EFI_IFR_CATENATE_OP 0x5E
#define EFI_IFR_GUID_OP 0x5F
+//
+// Definitions of IFR Standard Headers
+// Section 27.3.8.2
+//
typedef struct _EFI_IFR_OP_HEADER {
UINT8 OpCode;
@@ -695,17 +743,27 @@ typedef struct _EFI_IFR_QUESTION_HEADER {
UINT8 Flags;
} EFI_IFR_QUESTION_HEADER;
+//
+// Flag values of EFI_IFR_QUESTION_HEADER
+//
#define EFI_IFR_FLAG_READ_ONLY 0x01
#define EFI_IFR_FLAG_CALLBACK 0x04
#define EFI_IFR_FLAG_RESET_REQUIRED 0x10
#define EFI_IFR_FLAG_OPTIONS_ONLY 0x80
+//
+// Definition for Opcode Reference
+// Section 27.3.8.3
+//
typedef struct _EFI_IFR_DEFAULTSTORE {
EFI_IFR_OP_HEADER Header;
EFI_STRING_ID DefaultName;
UINT16 DefaultId;
} EFI_IFR_DEFAULTSTORE;
+//
+// Default Identifier of default store
+//
#define EFI_HII_DEFAULT_CLASS_STANDARD 0x0000
#define EFI_HII_DEFAULT_CLASS_MANUFACTURING 0x0001
#define EFI_HII_DEFAULT_CLASS_SAFE 0x0002
@@ -855,6 +913,9 @@ typedef struct _EFI_IFR_DATE {
UINT8 Flags;
} EFI_IFR_DATE;
+//
+// Flags that describe the behavior of the question.
+//
#define EFI_QF_DATE_YEAR_SUPPRESS 0x01
#define EFI_QF_DATE_MONTH_SUPPRESS 0x02
#define EFI_QF_DATE_DAY_SUPPRESS 0x04
@@ -894,16 +955,19 @@ typedef struct _EFI_IFR_NUMERIC {
MINMAXSTEP_DATA data;
} EFI_IFR_NUMERIC;
+//
+// Flags related to the numeric question
+//
#define EFI_IFR_NUMERIC_SIZE 0x03
-#define EFI_IFR_NUMERIC_SIZE_1 0x00
-#define EFI_IFR_NUMERIC_SIZE_2 0x01
-#define EFI_IFR_NUMERIC_SIZE_4 0x02
-#define EFI_IFR_NUMERIC_SIZE_8 0x03
+#define EFI_IFR_NUMERIC_SIZE_1 0x00
+#define EFI_IFR_NUMERIC_SIZE_2 0x01
+#define EFI_IFR_NUMERIC_SIZE_4 0x02
+#define EFI_IFR_NUMERIC_SIZE_8 0x03
#define EFI_IFR_DISPLAY 0x30
-#define EFI_IFR_DISPLAY_INT_DEC 0x00
-#define EFI_IFR_DISPLAY_UINT_DEC 0x10
-#define EFI_IFR_DISPLAY_UINT_HEX 0x20
+#define EFI_IFR_DISPLAY_INT_DEC 0x00
+#define EFI_IFR_DISPLAY_UINT_DEC 0x10
+#define EFI_IFR_DISPLAY_UINT_HEX 0x20
typedef struct _EFI_IFR_ONE_OF {
EFI_IFR_OP_HEADER Header;
@@ -945,14 +1009,17 @@ typedef struct _EFI_IFR_TIME {
UINT8 Flags;
} EFI_IFR_TIME;
+//
+// A bit-mask that determines which unique settings are active for this opcode.
+//
#define QF_TIME_HOUR_SUPPRESS 0x01
#define QF_TIME_MINUTE_SUPPRESS 0x02
#define QF_TIME_SECOND_SUPPRESS 0x04
#define QF_TIME_STORAGE 0x30
-#define QF_TIME_STORAGE_NORMAL 0x00
-#define QF_TIME_STORAGE_TIME 0x10
-#define QF_TIME_STORAGE_WAKEUP 0x20
+#define QF_TIME_STORAGE_NORMAL 0x00
+#define QF_TIME_STORAGE_TIME 0x10
+#define QF_TIME_STORAGE_WAKEUP 0x20
typedef struct _EFI_IFR_DISABLE_IF {
EFI_IFR_OP_HEADER Header;
@@ -994,6 +1061,9 @@ typedef struct _EFI_IFR_ONE_OF_OPTION {
EFI_IFR_TYPE_VALUE Value;
} EFI_IFR_ONE_OF_OPTION;
+//
+// Types of the option's value.
+//
#define EFI_IFR_TYPE_NUM_SIZE_8 0x00
#define EFI_IFR_TYPE_NUM_SIZE_16 0x01
#define EFI_IFR_TYPE_NUM_SIZE_32 0x02
@@ -1036,11 +1106,6 @@ typedef struct _EFI_IFR_EQ_ID_LIST {
UINT16 ValueList[1];
} EFI_IFR_EQ_ID_LIST;
-typedef struct _EFI_IFR_QUESTION_REF1 {
- EFI_IFR_OP_HEADER Header;
- EFI_QUESTION_ID QuestionId;
-} EFI_IFR_QUESTION_REF1;
-
typedef struct _EFI_IFR_UINT8 {
EFI_IFR_OP_HEADER Header;
UINT8 Value;
@@ -1051,10 +1116,6 @@ typedef struct _EFI_IFR_UINT16 {
UINT16 Value;
} EFI_IFR_UINT16;
-typedef struct _EFI_IFR_QUESTION_REF2 {
- EFI_IFR_OP_HEADER Header;
-} EFI_IFR_QUESTION_REF2;
-
typedef struct _EFI_IFR_UINT32 {
EFI_IFR_OP_HEADER Header;
UINT32 Value;
@@ -1065,6 +1126,15 @@ typedef struct _EFI_IFR_UINT64 {
UINT64 Value;
} EFI_IFR_UINT64;
+typedef struct _EFI_IFR_QUESTION_REF1 {
+ EFI_IFR_OP_HEADER Header;
+ EFI_QUESTION_ID QuestionId;
+} EFI_IFR_QUESTION_REF1;
+
+typedef struct _EFI_IFR_QUESTION_REF2 {
+ EFI_IFR_OP_HEADER Header;
+} EFI_IFR_QUESTION_REF2;
+
typedef struct _EFI_IFR_QUESTION_REF3 {
EFI_IFR_OP_HEADER Header;
} EFI_IFR_QUESTION_REF3;
@@ -1142,11 +1212,23 @@ 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)
+//
#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
+//
#define EFI_IFR_STRING_ASCII 0
#define EFI_IFR_STRING_UNICODE 8
@@ -1247,6 +1329,9 @@ typedef struct _EFI_IFR_CONDITIONAL {
EFI_IFR_OP_HEADER Header;
} EFI_IFR_CONDITIONAL;
+//
+// Flags governing the matching criteria of EFI_IFR_FIND
+//
#define EFI_IFR_FF_CASE_SENSITIVE 0x00
#define EFI_IFR_FF_CASE_INSENSITIVE 0x01
@@ -1263,6 +1348,10 @@ typedef struct _EFI_IFR_TOKEN {
EFI_IFR_OP_HEADER Header;
} EFI_IFR_TOKEN;
+//
+// Flags specifying whether to find the first matching string
+// or the first non-matching string.
+//
#define EFI_IFR_FLAGS_FIRST_MATCHING 0x00
#define EFI_IFR_FLAGS_FIRST_NON_MATCHING 0x01
@@ -1272,7 +1361,9 @@ typedef struct _EFI_IFR_SPAN {
} EFI_IFR_SPAN;
//
-// Keyboard Package
+// Definitions for Keyboard Package
+// Section 27.3.9
+// Releated definitions are in Section of EFI_HII_DATABASE_PROTOCOL
//
typedef enum {
diff --git a/src/include/gpxe/efi/Uefi/UefiMultiPhase.h b/src/include/gpxe/efi/Uefi/UefiMultiPhase.h
index c72697a6..2d1af5ed 100644
--- a/src/include/gpxe/efi/Uefi/UefiMultiPhase.h
+++ b/src/include/gpxe/efi/Uefi/UefiMultiPhase.h
@@ -1,7 +1,7 @@
/** @file
This includes some definitions introduced in UEFI that will be used in both PEI and DXE phases.
- Copyright (c) 2006, Intel Corporation
+ 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
@@ -70,38 +70,32 @@ typedef struct {
#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 and has the following definition:
-
- @param dwLength The length of the entire certificate,
- including the length of the header, in
- bytes.
-
- @param wRevision The revision level of the WIN_CERTIFICATE
- structure. The current revision level is
- 0x0200.
-
- @param wCertificateType 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.
-
- @param bCertificate The actual certificate. The format of
- the certificate depends on
- wCertificateType. The format of the UEFI
- certificates is defined below.
-
-
-**/
+///
+/// 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;
- //UINT8 bCertificate[ANYSIZE_ARRAY];
+ ///
+ /// The following is the actual certificate. The format of
+ /// the certificate depends on wCertificateType.
+ ///
+ /// UINT8 bCertificate[ANYSIZE_ARRAY];
+ ///
} WIN_CERTIFICATE;
///
@@ -110,9 +104,9 @@ typedef struct _WIN_CERTIFICATE {
#define EFI_CERT_TYPE_RSA2048_SHA256_GUID \
{0xa7717414, 0xc616, 0x4977, {0x94, 0x20, 0x84, 0x47, 0x12, 0xa7, 0x35, 0xbf } }
-///
-/// WIN_CERTIFICATE_UEFI_GUID.CertData
-///
+//
+// WIN_CERTIFICATE_UEFI_GUID.CertData
+//
typedef struct _EFI_CERT_BLOCK_RSA_2048_SHA256 {
UINT32 HashType;
UINT8 PublicKey[256];
@@ -120,97 +114,95 @@ typedef struct _EFI_CERT_BLOCK_RSA_2048_SHA256 {
} EFI_CERT_BLOCK_RSA_2048_SHA256;
-/**
-
- @param Hdr This is the standard WIN_CERTIFICATE header, where
- wCertificateType is set to
- WIN_CERT_TYPE_UEFI_GUID.
-
- @param CertType This is the unique id which determines the
- format of the CertData. In this case, the
- value is EFI_CERT_TYPE_RSA2048_SHA256_GUID.
-
- @param CertData This 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.
-
-**/
+///
+/// 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;
- // UINT8 CertData[ANYSIZE_ARRAY];
+ ///
+ /// 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.
-
- @param Hdr This is the standard WIN_CERTIFICATE header, where
- wCertificateType is set to
- WIN_CERT_TYPE_UEFI_PKCS1_15.
-
- @param HashAlgorithm This is the hashing algorithm which was
- performed on the UEFI executable when
- creating the digital signature. It is
- one of the enumerated values pre-defined
- in Section 26.4.1. See
- EFI_HASH_ALGORITHM_x.
-
- @param Signature This 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.
-
-**/
+///
+/// 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;
- // UINT8 Signature[ANYSIZE_ARRAY];
+ ///
+ /// 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
- EFI_CERT_TYPE_RSA2048_SHA256. If the attribute specifies
- authenticated access, then the Data buffer should begin with an
- authentication descriptor prior to the data payload and DataSize
- should reflect the the data.and descriptor size. The caller
- shall digest the Monotonic Count value and the associated data
- for the variable update using the SHA-256 1-way hash algorithm.
- The ensuing the 32-byte digest will be signed using the private
- 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
-
- @param MonotonicCount Included in the signature of
- AuthInfo.Used to ensure freshness/no
- replay. Incremented during each
- "Write" access.
-
- @param AuthInfo Provides the authorization for the variable
- access. It is a signature across the
- variable data and the Monotonic Count
- value. Caller uses Private key that is
- associated with a public key that has been
- provisioned via the key exchange.
-**/
+///
+/// AuthInfo is a WIN_CERTIFICATE using the wCertificateType
+/// WIN_CERTIFICATE_UEFI_GUID and the CertType
+/// EFI_CERT_TYPE_RSA2048_SHA256. If the attribute specifies
+/// authenticated access, then the Data buffer should begin with an
+/// authentication descriptor prior to the data payload and DataSize
+/// should reflect the the data.and descriptor size. The caller
+/// shall digest the Monotonic Count value and the associated data
+/// for the variable update using the SHA-256 1-way hash algorithm.
+/// The ensuing the 32-byte digest will be signed using the private
+/// 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
+///
typedef struct {
+ ///
+ /// Included in the signature of
+ /// AuthInfo.Used to ensure freshness/no
+ /// replay. Incremented during each
+ /// "Write" access.
+ ///
UINT64 MonotonicCount;
+ ///
+ /// Provides the authorization for the variable
+ /// access. It is a signature across the
+ /// variable data and the Monotonic Count
+ /// value. Caller uses Private key that is
+ /// associated with a public key that has been
+ /// provisioned via the key exchange.
+ ///
WIN_CERTIFICATE_UEFI_GUID AuthInfo;
} EFI_VARIABLE_AUTHENTICATION;
diff --git a/src/include/gpxe/efi/Uefi/UefiPxe.h b/src/include/gpxe/efi/Uefi/UefiPxe.h
index bdc834fc..bb8ab410 100644
--- a/src/include/gpxe/efi/Uefi/UefiPxe.h
+++ b/src/include/gpxe/efi/Uefi/UefiPxe.h
@@ -3,7 +3,7 @@
structure prototypes, global variables and constants that
are needed for porting PXE to EFI.
- Copyright (c) 2006, Intel Corporation
+ 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
@@ -23,8 +23,6 @@
#pragma pack(1)
-
-
#define PXE_BUSTYPE(a, b, c, d) \
( \
(((PXE_UINT32) (d) & 0xFF) << 24) | (((PXE_UINT32) (c) & 0xFF) << 16) | (((PXE_UINT32) (b) & 0xFF) << 8) | \
@@ -63,11 +61,11 @@
(((PXE_UINT64)(n) & 0xFF00000000000000ULL) >> 56))
-#define PXE_CPBSIZE_NOT_USED 0 // zero
-#define PXE_DBSIZE_NOT_USED 0 // zero
-#define PXE_CPBADDR_NOT_USED (PXE_UINT64) 0 // zero
-#define PXE_DBADDR_NOT_USED (PXE_UINT64) 0 // zero
-#define PXE_CONST const
+#define PXE_CPBSIZE_NOT_USED 0 ///< zero
+#define PXE_DBSIZE_NOT_USED 0 ///< zero
+#define PXE_CPBADDR_NOT_USED (PXE_UINT64) 0 ///< zero
+#define PXE_DBADDR_NOT_USED (PXE_UINT64) 0 ///< zero
+#define PXE_CONST CONST
#define PXE_VOLATILE volatile
@@ -83,7 +81,7 @@ typedef UINTN PXE_UINTN;
typedef UINT64 PXE_UINT64;
typedef PXE_UINT8 PXE_BOOL;
-#define PXE_FALSE 0 // zero
+#define PXE_FALSE 0 ///< zero
#define PXE_TRUE (!PXE_FALSE)
typedef PXE_UINT16 PXE_OPCODE;
@@ -213,33 +211,32 @@ typedef PXE_UINT16 PXE_OPFLAGS;
//
// No Opflags
-////////////////////////////////////////
-// UNDI Initialize
-//
+///
+/// UNDI Initialize
+///
#define PXE_OPFLAGS_INITIALIZE_CABLE_DETECT_MASK 0x0001
#define PXE_OPFLAGS_INITIALIZE_DETECT_CABLE 0x0000
#define PXE_OPFLAGS_INITIALIZE_DO_NOT_DETECT_CABLE 0x0001
-//
-// //////////////////////////////////////
-// UNDI Reset
-//
+///
+///
+/// UNDI Reset
+///
#define PXE_OPFLAGS_RESET_DISABLE_INTERRUPTS 0x0001
#define PXE_OPFLAGS_RESET_DISABLE_FILTERS 0x0002
-//
-// //////////////////////////////////////
-// UNDI Shutdown
-//
-// No OpFlags
+///
+/// UNDI Shutdown
+///
+/// No OpFlags
-////////////////////////////////////////
-// UNDI Interrupt Enables
-//
-//
-// Select whether to enable or disable external interrupt signals.
-// Setting both enable and disable will return PXE_STATCODE_INVALID_OPFLAGS.
-//
+///
+/// UNDI Interrupt Enables
+///
+///
+/// Select whether to enable or disable external interrupt signals.
+/// Setting both enable and disable will return PXE_STATCODE_INVALID_OPFLAGS.
+///
#define PXE_OPFLAGS_INTERRUPT_OPMASK 0xC000
#define PXE_OPFLAGS_INTERRUPT_ENABLE 0x8000
#define PXE_OPFLAGS_INTERRUPT_DISABLE 0x4000
@@ -269,14 +266,13 @@ typedef PXE_UINT16 PXE_OPFLAGS;
///
#define PXE_OPFLAGS_INTERRUPT_SOFTWARE 0x0008
-//
-// //////////////////////////////////////
-// UNDI Receive Filters
-//
-//
-// Select whether to enable or disable receive filters.
-// Setting both enable and disable will return PXE_STATCODE_INVALID_OPCODE.
-//
+///
+/// UNDI Receive Filters
+///
+///
+/// Select whether to enable or disable receive filters.
+/// Setting both enable and disable will return PXE_STATCODE_INVALID_OPCODE.
+///
#define PXE_OPFLAGS_RECEIVE_FILTER_OPMASK 0xC000
#define PXE_OPFLAGS_RECEIVE_FILTER_ENABLE 0x8000
#define PXE_OPFLAGS_RECEIVE_FILTER_DISABLE 0x4000
@@ -318,293 +314,284 @@ 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
-//
-//
-// Identify the type of IP address in the CPB.
-//
+///
+/// UNDI MCast IP to MAC
+///
+///
+/// Identify the type of IP address in the CPB.
+///
#define PXE_OPFLAGS_MCAST_IP_TO_MAC_OPMASK 0x0003
#define PXE_OPFLAGS_MCAST_IPV4_TO_MAC 0x0000
#define PXE_OPFLAGS_MCAST_IPV6_TO_MAC 0x0001
-//
-// //////////////////////////////////////
-// UNDI NvData
-//
-//
-// Select the type of non-volatile data operation.
-//
+///
+/// UNDI NvData
+///
+///
+/// Select the type of non-volatile data operation.
+///
#define PXE_OPFLAGS_NVDATA_OPMASK 0x0001
#define PXE_OPFLAGS_NVDATA_READ 0x0000
#define PXE_OPFLAGS_NVDATA_WRITE 0x0001
-//
-// //////////////////////////////////////
-// UNDI Get Status
-//
-//
-// Return current interrupt status. This will also clear any interrupts
-// that are currently set. This can be used in a polling routine. The
-// interrupt flags are still set and cleared even when the interrupts
-// are disabled.
-//
+///
+/// UNDI Get Status
+///
+///
+/// Return current interrupt status. This will also clear any interrupts
+/// that are currently set. This can be used in a polling routine. The
+/// interrupt flags are still set and cleared even when the interrupts
+/// are disabled.
+///
#define PXE_OPFLAGS_GET_INTERRUPT_STATUS 0x0001
-//
-// Return list of transmitted buffers for recycling. Transmit buffers
-// must not be changed or unallocated until they have recycled. After
-// issuing a transmit command, wait for a transmit complete interrupt.
-// When a transmit complete interrupt is received, read the transmitted
-// buffers. Do not plan on getting one buffer per interrupt. Some
-// NICs and UNDIs may transmit multiple buffers per interrupt.
-//
+///
+/// Return list of transmitted buffers for recycling. Transmit buffers
+/// must not be changed or unallocated until they have recycled. After
+/// issuing a transmit command, wait for a transmit complete interrupt.
+/// When a transmit complete interrupt is received, read the transmitted
+/// buffers. Do not plan on getting one buffer per interrupt. Some
+/// NICs and UNDIs may transmit multiple buffers per interrupt.
+///
#define PXE_OPFLAGS_GET_TRANSMITTED_BUFFERS 0x0002
-//
-// //////////////////////////////////////
-// UNDI Fill Header
-//
+///
+/// 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
-//
-//
-// S/W UNDI only. Return after the packet has been transmitted. A
-// transmit complete interrupt will still be generated and the transmit
-// buffer will have to be recycled.
-//
+///
+/// UNDI Transmit
+///
+///
+/// S/W UNDI only. Return after the packet has been transmitted. A
+/// transmit complete interrupt will still be generated and the transmit
+/// buffer will have to be recycled.
+///
#define PXE_OPFLAGS_SWUNDI_TRANSMIT_OPMASK 0x0001
#define PXE_OPFLAGS_TRANSMIT_BLOCK 0x0001
#define PXE_OPFLAGS_TRANSMIT_DONT_BLOCK 0x0000
-//
-//
-//
#define PXE_OPFLAGS_TRANSMIT_OPMASK 0x0002
#define PXE_OPFLAGS_TRANSMIT_FRAGMENTED 0x0002
#define PXE_OPFLAGS_TRANSMIT_WHOLE 0x0000
-//
-// //////////////////////////////////////
-// UNDI Receive
-//
-// No OpFlags
-//
+///
+/// UNDI Receive
+///
+/// No OpFlags
+///
+
+///
+/// PXE STATFLAGS
+///
typedef PXE_UINT16 PXE_STATFLAGS;
#define PXE_STATFLAGS_INITIALIZE 0x0000
-//
-// //////////////////////////////////////
-// Common StatFlags that can be returned by all commands.
-//
-//
-// The COMMAND_COMPLETE and COMMAND_FAILED status flags must be
-// implemented by all UNDIs. COMMAND_QUEUED is only needed by UNDIs
-// that support command queuing.
-//
+///
+/// Common StatFlags that can be returned by all commands.
+///
+///
+/// The COMMAND_COMPLETE and COMMAND_FAILED status flags must be
+/// implemented by all UNDIs. COMMAND_QUEUED is only needed by UNDIs
+/// that support command queuing.
+///
#define PXE_STATFLAGS_STATUS_MASK 0xC000
#define PXE_STATFLAGS_COMMAND_COMPLETE 0xC000
#define PXE_STATFLAGS_COMMAND_FAILED 0x8000
#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
#define PXE_STATFLAGS_GET_STATE_STARTED 0x0001
#define PXE_STATFLAGS_GET_STATE_STOPPED 0x0000
-//
-// //////////////////////////////////////
-// UNDI Start
-//
-// No additional StatFlags
+///
+/// UNDI Start
+///
+/// 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
-//
-// //////////////////////////////////////
-// UNDI Initialize
-//
+///
+/// UNDI Initialize
+///
#define PXE_STATFLAGS_INITIALIZED_NO_MEDIA 0x0001
-//
-// //////////////////////////////////////
-// UNDI Reset
-//
+///
+/// UNDI Reset
+///
#define PXE_STATFLAGS_RESET_NO_MEDIA 0x0001
-//
-// //////////////////////////////////////
-// UNDI Shutdown
-//
-// No additional StatFlags
+///
+/// UNDI Shutdown
+///
+/// No additional StatFlags
-////////////////////////////////////////
-// UNDI Interrupt Enables
-//
-//
-// If set, receive interrupts are enabled.
-//
+///
+/// UNDI Interrupt Enables
+///
+///
+/// If set, receive interrupts are enabled.
+///
#define PXE_STATFLAGS_INTERRUPT_RECEIVE 0x0001
-//
-// If set, transmit interrupts are enabled.
-//
+///
+/// If set, transmit interrupts are enabled.
+///
#define PXE_STATFLAGS_INTERRUPT_TRANSMIT 0x0002
-//
-// If set, command interrupts are enabled.
-//
+///
+/// If set, command interrupts are enabled.
+///
#define PXE_STATFLAGS_INTERRUPT_COMMAND 0x0004
-//
-// //////////////////////////////////////
-// UNDI Receive Filters
-//
-//
-// If set, unicast packets will be received.
-//
+///
+/// UNDI Receive Filters
+///
+
+///
+/// If set, unicast packets will be received.
+///
#define PXE_STATFLAGS_RECEIVE_FILTER_UNICAST 0x0001
-//
-// If set, broadcast packets will be received.
-//
+///
+/// If set, broadcast packets will be received.
+///
#define PXE_STATFLAGS_RECEIVE_FILTER_BROADCAST 0x0002
-//
-// If set, multicast packets that match up with the multicast address
-// filter list will be received.
-//
+///
+/// If set, multicast packets that match up with the multicast address
+/// filter list will be received.
+///
#define PXE_STATFLAGS_RECEIVE_FILTER_FILTERED_MULTICAST 0x0004
-//
-// If set, all packets will be received.
-//
+///
+/// If set, all packets will be received.
+///
#define PXE_STATFLAGS_RECEIVE_FILTER_PROMISCUOUS 0x0008
-//
-// If set, all multicast packets will be received.
-//
+///
+/// If set, all multicast packets will be received.
+///
#define PXE_STATFLAGS_RECEIVE_FILTER_ALL_MULTICAST 0x0010
-//
-// //////////////////////////////////////
-// UNDI Station Address
-//
-// No additional StatFlags
+///
+/// UNDI Station Address
+///
+/// No additional StatFlags
+///
-////////////////////////////////////////
-// UNDI Statistics
-//
-// No additional StatFlags
+///
+/// UNDI Statistics
+///
+/// No additional StatFlags
+///
-////////////////////////////////////////
-// UNDI MCast IP to MAC
-//
-// No additional StatFlags
+///
+//// UNDI MCast IP to MAC
+////
+//// No additional StatFlags
-////////////////////////////////////////
-// UNDI NvData
-//
-// No additional StatFlags
+///
+/// UNDI NvData
+///
+/// No additional StatFlags
+///
+///
+/// UNDI Get Status
+///
-////////////////////////////////////////
-// UNDI Get Status
-//
-//
-// Use to determine if an interrupt has occurred.
-//
+///
+/// Use to determine if an interrupt has occurred.
+///
#define PXE_STATFLAGS_GET_STATUS_INTERRUPT_MASK 0x000F
#define PXE_STATFLAGS_GET_STATUS_NO_INTERRUPTS 0x0000
-//
-// If set, at least one receive interrupt occurred.
-//
+///
+/// If set, at least one receive interrupt occurred.
+///
#define PXE_STATFLAGS_GET_STATUS_RECEIVE 0x0001
-//
-// If set, at least one transmit interrupt occurred.
-//
+///
+/// If set, at least one transmit interrupt occurred.
+///
#define PXE_STATFLAGS_GET_STATUS_TRANSMIT 0x0002
-//
-// If set, at least one command interrupt occurred.
-//
+///
+/// If set, at least one command interrupt occurred.
+///
#define PXE_STATFLAGS_GET_STATUS_COMMAND 0x0004
-//
-// If set, at least one software interrupt occurred.
-//
+///
+/// If set, at least one software interrupt occurred.
+///
#define PXE_STATFLAGS_GET_STATUS_SOFTWARE 0x0008
-//
-// This flag is set if the transmitted buffer queue is empty. This flag
-// will be set if all transmitted buffer addresses get written into the DB.
-//
+///
+/// This flag is set if the transmitted buffer queue is empty. This flag
+/// will be set if all transmitted buffer addresses get written into the DB.
+///
#define PXE_STATFLAGS_GET_STATUS_TXBUF_QUEUE_EMPTY 0x0010
-//
-// This flag is set if no transmitted buffer addresses were written
-// into the DB. (This could be because DBsize was too small.)
-//
+///
+/// This flag is set if no transmitted buffer addresses were written
+/// into the DB. (This could be because DBsize was too small.)
+///
#define PXE_STATFLAGS_GET_STATUS_NO_TXBUFS_WRITTEN 0x0020
-//
-// //////////////////////////////////////
-// UNDI Fill Header
-//
-// No additional StatFlags
+///
+/// UNDI Fill Header
+///
+/// No additional StatFlags
+///
-////////////////////////////////////////
-// UNDI Transmit
-//
-// No additional StatFlags.
+///
+/// UNDI Transmit
+///
+/// No additional StatFlags.
-////////////////////////////////////////
-// UNDI Receive
-//
-// No additional StatFlags.
-//
+///
+/// UNDI Receive
+///
+
+///
+/// No additional StatFlags.
+///
typedef PXE_UINT16 PXE_STATCODE;
#define PXE_STATCODE_INITIALIZE 0x0000
-//
-// //////////////////////////////////////
-// Common StatCodes returned by all UNDI commands, UNDI protocol functions
-// and BC protocol functions.
-//
+///
+/// Common StatCodes returned by all UNDI commands, UNDI protocol functions
+/// and BC protocol functions.
+///
#define PXE_STATCODE_SUCCESS 0x0000
#define PXE_STATCODE_INVALID_CDB 0x0001
@@ -629,35 +616,35 @@ typedef PXE_UINT16 PXE_STATCODE;
typedef PXE_UINT16 PXE_IFNUM;
-//
-// This interface number must be passed to the S/W UNDI Start command.
-//
+///
+/// This interface number must be passed to the S/W UNDI Start command.
+///
#define PXE_IFNUM_START 0x0000
-//
-// This interface number is returned by the S/W UNDI Get State and
-// Start commands if information in the CDB, CPB or DB is invalid.
-//
+///
+/// This interface number is returned by the S/W UNDI Get State and
+/// Start commands if information in the CDB, CPB or DB is invalid.
+///
#define PXE_IFNUM_INVALID 0x0000
typedef PXE_UINT16 PXE_CONTROL;
-//
-// Setting this flag directs the UNDI to queue this command for later
-// execution if the UNDI is busy and it supports command queuing.
-// If queuing is not supported, a PXE_STATCODE_INVALID_CONTROL error
-// is returned. If the queue is full, a PXE_STATCODE_CDB_QUEUE_FULL
-// error is returned.
-//
+///
+/// Setting this flag directs the UNDI to queue this command for later
+/// execution if the UNDI is busy and it supports command queuing.
+/// If queuing is not supported, a PXE_STATCODE_INVALID_CONTROL error
+/// is returned. If the queue is full, a PXE_STATCODE_CDB_QUEUE_FULL
+/// error is returned.
+///
#define PXE_CONTROL_QUEUE_IF_BUSY 0x0002
-//
-// These two bit values are used to determine if there are more UNDI
-// CDB structures following this one. If the link bit is set, there
-// must be a CDB structure following this one. Execution will start
-// on the next CDB structure as soon as this one completes successfully.
-// If an error is generated by this command, execution will stop.
-//
+///
+/// These two bit values are used to determine if there are more UNDI
+/// CDB structures following this one. If the link bit is set, there
+/// must be a CDB structure following this one. Execution will start
+/// on the next CDB structure as soon as this one completes successfully.
+/// If an error is generated by this command, execution will stop.
+///
#define PXE_CONTROL_LINK 0x0001
#define PXE_CONTROL_LAST_CDB_IN_LIST 0x0000
@@ -682,145 +669,147 @@ typedef PXE_UINT8 PXE_MAC_ADDR[PXE_MAC_LENGTH];
typedef PXE_UINT8 PXE_IFTYPE;
typedef UINT16 PXE_MEDIA_PROTOCOL;
-//
-// This information is from the ARP section of RFC 1700.
-//
-// 1 Ethernet (10Mb) [JBP]
-// 2 Experimental Ethernet (3Mb) [JBP]
-// 3 Amateur Radio AX.25 [PXK]
-// 4 Proteon ProNET Token Ring [JBP]
-// 5 Chaos [GXP]
-// 6 IEEE 802 Networks [JBP]
-// 7 ARCNET [JBP]
-// 8 Hyperchannel [JBP]
-// 9 Lanstar [TU]
-// 10 Autonet Short Address [MXB1]
-// 11 LocalTalk [JKR1]
-// 12 LocalNet (IBM* PCNet or SYTEK* LocalNET) [JXM]
-// 13 Ultra link [RXD2]
-// 14 SMDS [GXC1]
-// 15 Frame Relay [AGM]
-// 16 Asynchronous Transmission Mode (ATM) [JXB2]
-// 17 HDLC [JBP]
-// 18 Fibre Channel [Yakov Rekhter]
-// 19 Asynchronous Transmission Mode (ATM) [Mark Laubach]
-// 20 Serial Line [JBP]
-// 21 Asynchronous Transmission Mode (ATM) [MXB1]
-//
-// * Other names and brands may be claimed as the property of others.
-//
+///
+/// This information is from the ARP section of RFC 1700.
+///
+/// 1 Ethernet (10Mb) [JBP]
+/// 2 Experimental Ethernet (3Mb) [JBP]
+/// 3 Amateur Radio AX.25 [PXK]
+/// 4 Proteon ProNET Token Ring [JBP]
+/// 5 Chaos [GXP]
+/// 6 IEEE 802 Networks [JBP]
+/// 7 ARCNET [JBP]
+/// 8 Hyperchannel [JBP]
+/// 9 Lanstar [TU]
+/// 10 Autonet Short Address [MXB1]
+/// 11 LocalTalk [JKR1]
+/// 12 LocalNet (IBM* PCNet or SYTEK* LocalNET) [JXM]
+/// 13 Ultra link [RXD2]
+/// 14 SMDS [GXC1]
+/// 15 Frame Relay [AGM]
+/// 16 Asynchronous Transmission Mode (ATM) [JXB2]
+/// 17 HDLC [JBP]
+/// 18 Fibre Channel [Yakov Rekhter]
+/// 19 Asynchronous Transmission Mode (ATM) [Mark Laubach]
+/// 20 Serial Line [JBP]
+/// 21 Asynchronous Transmission Mode (ATM) [MXB1]
+///
+/// * Other names and brands may be claimed as the property of others.
+///
#define PXE_IFTYPE_ETHERNET 0x01
#define PXE_IFTYPE_TOKENRING 0x04
#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
-//
-//
-// UNDI operation state
-//
+///
+/// Status port bit definitions
+///
+
+///
+/// UNDI operation state
+///
#define PXE_HWSTAT_STATE_MASK 0xC0000000
#define PXE_HWSTAT_BUSY 0xC0000000
#define PXE_HWSTAT_INITIALIZED 0x80000000
#define PXE_HWSTAT_STARTED 0x40000000
#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
#define PXE_HWSTAT_BROADCAST_RX_ENABLED 0x00000400
#define PXE_HWSTAT_MULTICAST_RX_ENABLED 0x00000200
#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
#define PXE_HWSTAT_PACKET_RX_INT_ENABLED 0x00000020
#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
#define PXE_HWSTAT_PACKET_RX_INT_PENDING 0x00000002
#define PXE_HWSTAT_CMD_COMPLETE_INT_PENDING 0x00000001
-//
-// Command port definitions
-//
-//
-// If set, CDB identified in CDBaddr port is given to UNDI.
-// If not set, other bits in this word will be processed.
-//
+///
+/// Command port definitions
+///
+
+///
+/// If set, CDB identified in CDBaddr port is given to UNDI.
+/// If not set, other bits in this word will be processed.
+///
#define PXE_HWCMD_ISSUE_COMMAND 0x80000000
#define PXE_HWCMD_INTS_AND_FILTS 0x00000000
-//
-// Use these to enable/disable receive filters.
-//
+///
+/// Use these to enable/disable receive filters.
+///
#define PXE_HWCMD_PROMISCUOUS_MULTICAST_RX_ENABLE 0x00001000
#define PXE_HWCMD_PROMISCUOUS_RX_ENABLE 0x00000800
#define PXE_HWCMD_BROADCAST_RX_ENABLE 0x00000400
#define PXE_HWCMD_MULTICAST_RX_ENABLE 0x00000200
#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
#define PXE_HWCMD_PACKET_RX_INT_ENABLE 0x00000020
#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
#define PXE_HWCMD_CLEAR_PACKET_RX_INT 0x00000002
#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 {
@@ -828,27 +817,27 @@ typedef union u_pxe_undi {
PXE_SW_UNDI sw;
} PXE_UNDI;
-//
-// Signature of !PXE structure
-//
+///
+/// Signature of !PXE structure
+///
#define PXE_ROMID_SIGNATURE PXE_BUSTYPE ('!', 'P', 'X', 'E')
-//
-// !PXE structure format revision
-//
+///
+/// !PXE structure format revision
+///
#define PXE_ROMID_REV 0x02
-//
-// UNDI command interface revision. These are the values that get sent
-// in option 94 (Client Network Interface Identifier) in the DHCP Discover
-// and PXE Boot Server Request packets.
-//
+///
+/// UNDI command interface revision. These are the values that get sent
+/// in option 94 (Client Network Interface Identifier) in the DHCP Discover
+/// and PXE Boot Server Request packets.
+///
#define PXE_ROMID_MAJORVER 0x03
#define PXE_ROMID_MINORVER 0x01
-//
-// Implementation flags
-//
+///
+/// Implementation flags
+///
#define PXE_ROMID_IMP_HW_UNDI 0x80000000
#define PXE_ROMID_IMP_SW_VIRT_ADDR 0x40000000
#define PXE_ROMID_IMP_64BIT_DEVICE 0x00010000
@@ -891,204 +880,194 @@ typedef union u_pxe_ip_addr {
} PXE_IP_ADDR;
typedef union pxe_device {
- //
- // PCI and PC Card NICs are both identified using bus, device
- // and function numbers. For PC Card, this may require PC
- // Card services to be loaded in the BIOS or preboot
- // environment.
- //
+ ///
+ /// PCI and PC Card NICs are both identified using bus, device
+ /// and function numbers. For PC Card, this may require PC
+ /// Card services to be loaded in the BIOS or preboot
+ /// environment.
+ ///
struct {
- //
- // See S/W UNDI ROMID structure definition for PCI and
- // PCC BusType definitions.
- //
+ ///
+ /// See S/W UNDI ROMID structure definition for PCI and
+ /// PCC BusType definitions.
+ ///
PXE_UINT32 BusType;
- //
- // Bus, device & function numbers that locate this device.
- //
+ ///
+ /// Bus, device & function numbers that locate this device.
+ ///
PXE_UINT16 Bus;
PXE_UINT8 Device;
PXE_UINT8 Function;
}
PCI, PCC;
- //
- // %%TBD - More information is needed about enumerating
- // USB and 1394 devices.
- //
- struct {
- PXE_UINT32 BusType;
- PXE_UINT32 tdb;
- }
- USB, _1394;
} 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
+///
+/// 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_MCAST_ADDRESS_CNT 8
typedef struct s_pxe_cpb_start_30 {
- //
- // PXE_VOID Delay(UINTN microseconds);
- //
- // UNDI will never request a delay smaller than 10 microseconds
- // and will always request delays in increments of 10 microseconds.
- // The Delay() CallBack routine must delay between n and n + 10
- // microseconds before returning control to the UNDI.
- //
- // This field cannot be set to zero.
- //
+ ///
+ /// PXE_VOID Delay(UINTN microseconds);
+ ///
+ /// UNDI will never request a delay smaller than 10 microseconds
+ /// and will always request delays in increments of 10 microseconds.
+ /// The Delay() CallBack routine must delay between n and n + 10
+ /// microseconds before returning control to the UNDI.
+ ///
+ /// This field cannot be set to zero.
+ ///
UINT64 Delay;
- //
- // PXE_VOID Block(UINT32 enable);
- //
- // UNDI may need to block multi-threaded/multi-processor access to
- // critical code sections when programming or accessing the network
- // device. To this end, a blocking service is needed by the UNDI.
- // When UNDI needs a block, it will call Block() passing a non-zero
- // value. When UNDI no longer needs a block, it will call Block()
- // with a zero value. When called, if the Block() is already enabled,
- // do not return control to the UNDI until the previous Block() is
- // disabled.
- //
- // This field cannot be set to zero.
- //
+ ///
+ /// PXE_VOID Block(UINT32 enable);
+ ///
+ /// UNDI may need to block multi-threaded/multi-processor access to
+ /// critical code sections when programming or accessing the network
+ /// device. To this end, a blocking service is needed by the UNDI.
+ /// When UNDI needs a block, it will call Block() passing a non-zero
+ /// value. When UNDI no longer needs a block, it will call Block()
+ /// with a zero value. When called, if the Block() is already enabled,
+ /// do not return control to the UNDI until the previous Block() is
+ /// disabled.
+ ///
+ /// This field cannot be set to zero.
+ ///
UINT64 Block;
- //
- // PXE_VOID Virt2Phys(UINT64 virtual, UINT64 physical_ptr);
- //
- // UNDI will pass the virtual address of a buffer and the virtual
- // address of a 64-bit physical buffer. Convert the virtual address
- // to a physical address and write the result to the physical address
- // buffer. If virtual and physical addresses are the same, just
- // copy the virtual address to the physical address buffer.
- //
- // This field can be set to zero if virtual and physical addresses
- // are equal.
- //
+ ///
+ /// PXE_VOID Virt2Phys(UINT64 virtual, UINT64 physical_ptr);
+ ///
+ /// UNDI will pass the virtual address of a buffer and the virtual
+ /// address of a 64-bit physical buffer. Convert the virtual address
+ /// to a physical address and write the result to the physical address
+ /// buffer. If virtual and physical addresses are the same, just
+ /// copy the virtual address to the physical address buffer.
+ ///
+ /// This field can be set to zero if virtual and physical addresses
+ /// are equal.
+ ///
UINT64 Virt2Phys;
- //
- // PXE_VOID Mem_IO(UINT8 read_write, UINT8 len, UINT64 port,
- // UINT64 buf_addr);
- //
- // UNDI will read or write the device io space using this call back
- // function. It passes the number of bytes as the len parameter and it
- // will be either 1,2,4 or 8.
- //
- // This field can not be set to zero.
- //
+ ///
+ /// PXE_VOID Mem_IO(UINT8 read_write, UINT8 len, UINT64 port,
+ /// UINT64 buf_addr);
+ ///
+ /// UNDI will read or write the device io space using this call back
+ /// function. It passes the number of bytes as the len parameter and it
+ /// will be either 1,2,4 or 8.
+ ///
+ /// This field can not be set to zero.
+ ///
UINT64 Mem_IO;
} PXE_CPB_START_30;
typedef struct s_pxe_cpb_start_31 {
- //
- // PXE_VOID Delay(UINT64 UnqId, UINTN microseconds);
- //
- // UNDI will never request a delay smaller than 10 microseconds
- // and will always request delays in increments of 10 microseconds.
- // The Delay() CallBack routine must delay between n and n + 10
- // microseconds before returning control to the UNDI.
- //
- // This field cannot be set to zero.
- //
+ ///
+ /// PXE_VOID Delay(UINT64 UnqId, UINTN microseconds);
+ ///
+ /// UNDI will never request a delay smaller than 10 microseconds
+ /// and will always request delays in increments of 10 microseconds.
+ /// The Delay() CallBack routine must delay between n and n + 10
+ /// microseconds before returning control to the UNDI.
+ ///
+ /// This field cannot be set to zero.
+ ///
UINT64 Delay;
- //
- // PXE_VOID Block(UINT64 unq_id, UINT32 enable);
- //
- // UNDI may need to block multi-threaded/multi-processor access to
- // critical code sections when programming or accessing the network
- // device. To this end, a blocking service is needed by the UNDI.
- // When UNDI needs a block, it will call Block() passing a non-zero
- // value. When UNDI no longer needs a block, it will call Block()
- // with a zero value. When called, if the Block() is already enabled,
- // do not return control to the UNDI until the previous Block() is
- // disabled.
- //
- // This field cannot be set to zero.
- //
+ ///
+ /// PXE_VOID Block(UINT64 unq_id, UINT32 enable);
+ ///
+ /// UNDI may need to block multi-threaded/multi-processor access to
+ /// critical code sections when programming or accessing the network
+ /// device. To this end, a blocking service is needed by the UNDI.
+ /// When UNDI needs a block, it will call Block() passing a non-zero
+ /// value. When UNDI no longer needs a block, it will call Block()
+ /// with a zero value. When called, if the Block() is already enabled,
+ /// do not return control to the UNDI until the previous Block() is
+ /// disabled.
+ ///
+ /// This field cannot be set to zero.
+ ///
UINT64 Block;
- //
- // PXE_VOID Virt2Phys(UINT64 UnqId, UINT64 virtual, UINT64 physical_ptr);
- //
- // UNDI will pass the virtual address of a buffer and the virtual
- // address of a 64-bit physical buffer. Convert the virtual address
- // to a physical address and write the result to the physical address
- // buffer. If virtual and physical addresses are the same, just
- // copy the virtual address to the physical address buffer.
- //
- // This field can be set to zero if virtual and physical addresses
- // are equal.
- //
+ ///
+ /// PXE_VOID Virt2Phys(UINT64 UnqId, UINT64 virtual, UINT64 physical_ptr);
+ ///
+ /// UNDI will pass the virtual address of a buffer and the virtual
+ /// address of a 64-bit physical buffer. Convert the virtual address
+ /// to a physical address and write the result to the physical address
+ /// buffer. If virtual and physical addresses are the same, just
+ /// copy the virtual address to the physical address buffer.
+ ///
+ /// This field can be set to zero if virtual and physical addresses
+ /// are equal.
+ ///
UINT64 Virt2Phys;
- //
- // PXE_VOID Mem_IO(UINT64 UnqId, UINT8 read_write, UINT8 len, UINT64 port,
- // UINT64 buf_addr);
- //
- // UNDI will read or write the device io space using this call back
- // function. It passes the number of bytes as the len parameter and it
- // will be either 1,2,4 or 8.
- //
- // This field can not be set to zero.
- //
+ ///
+ /// PXE_VOID Mem_IO(UINT64 UnqId, UINT8 read_write, UINT8 len, UINT64 port,
+ /// UINT64 buf_addr);
+ ///
+ /// UNDI will read or write the device io space using this call back
+ /// function. It passes the number of bytes as the len parameter and it
+ /// will be either 1,2,4 or 8.
+ ///
+ /// This field can not be set to zero.
+ ///
UINT64 Mem_IO;
- //
- // PXE_VOID Map_Mem(UINT64 unq_id, UINT64 virtual_addr, UINT32 size,
- // UINT32 Direction, UINT64 mapped_addr);
- //
- // UNDI will pass the virtual address of a buffer, direction of the data
- // flow from/to the mapped buffer (the constants are defined below)
- // and a place holder (pointer) for the mapped address.
- // This call will Map the given address to a physical DMA address and write
- // the result to the mapped_addr pointer. If there is no need to
- // map the given address to a lower address (i.e. the given address is
- // associated with a physical address that is already compatible to be
- // 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
- //
+ ///
+ /// PXE_VOID Map_Mem(UINT64 unq_id, UINT64 virtual_addr, UINT32 size,
+ /// UINT32 Direction, UINT64 mapped_addr);
+ ///
+ /// UNDI will pass the virtual address of a buffer, direction of the data
+ /// flow from/to the mapped buffer (the constants are defined below)
+ /// and a place holder (pointer) for the mapped address.
+ /// This call will Map the given address to a physical DMA address and write
+ /// the result to the mapped_addr pointer. If there is no need to
+ /// map the given address to a lower address (i.e. the given address is
+ /// associated with a physical address that is already compatible to be
+ /// 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
+ ///
UINT64 Map_Mem;
- //
- // 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
- //
- // This field can be set to zero if there is no unmapping service available
- //
+ ///
+ /// 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
+ ///
+ /// This field can be set to zero if there is no unmapping service available
+ ///
UINT64 UnMap_Mem;
- //
- // 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
- // buffers for the given Direction.
- //
- // This field can be set to zero if there is no service available
- //
+ ///
+ /// 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
+ /// buffers for the given Direction.
+ ///
+ /// This field can be set to zero if there is no service available
+ ///
UINT64 Sync_Mem;
- //
- // protocol driver can provide anything for this Unique_ID, UNDI remembers
- // that as just a 64bit value assocaited to the interface specified by
- // the ifnum and gives it back as a parameter to all the call-back routines
- // when calling for that interface!
- //
+ ///
+ /// protocol driver can provide anything for this Unique_ID, UNDI remembers
+ /// that as just a 64bit value assocaited to the interface specified by
+ /// the ifnum and gives it back as a parameter to all the call-back routines
+ /// when calling for that interface!
+ ///
UINT64 Unique_ID;
- //
} PXE_CPB_START_31;
#define TO_AND_FROM_DEVICE 0
@@ -1103,83 +1082,83 @@ typedef struct s_pxe_cpb_start_31 {
#define PXE_MEM_WRITE 4
typedef struct s_pxe_db_get_init_info {
- //
- // Minimum length of locked memory buffer that must be given to
- // the Initialize command. Giving UNDI more memory will generally
- // give better performance.
- //
- // If MemoryRequired is zero, the UNDI does not need and will not
- // use system memory to receive and transmit packets.
- //
+ ///
+ /// Minimum length of locked memory buffer that must be given to
+ /// the Initialize command. Giving UNDI more memory will generally
+ /// give better performance.
+ ///
+ /// If MemoryRequired is zero, the UNDI does not need and will not
+ /// use system memory to receive and transmit packets.
+ ///
PXE_UINT32 MemoryRequired;
- //
- // Maximum frame data length for Tx/Rx excluding the media header.
- //
+ ///
+ /// Maximum frame data length for Tx/Rx excluding the media header.
+ ///
PXE_UINT32 FrameDataLen;
- //
- // Supported link speeds are in units of mega bits. Common ethernet
- // values are 10, 100 and 1000. Unused LinkSpeeds[] entries are zero
- // filled.
- //
+ ///
+ /// Supported link speeds are in units of mega bits. Common ethernet
+ /// values are 10, 100 and 1000. Unused LinkSpeeds[] entries are zero
+ /// filled.
+ ///
PXE_UINT32 LinkSpeeds[4];
- //
- // Number of non-volatile storage items.
- //
+ ///
+ /// Number of non-volatile storage items.
+ ///
PXE_UINT32 NvCount;
- //
- // Width of non-volatile storage item in bytes. 0, 1, 2 or 4
- //
+ ///
+ /// Width of non-volatile storage item in bytes. 0, 1, 2 or 4
+ ///
PXE_UINT16 NvWidth;
- //
- // Media header length. This is the typical media header length for
- // this UNDI. This information is needed when allocating receive
- // and transmit buffers.
- //
+ ///
+ /// Media header length. This is the typical media header length for
+ /// this UNDI. This information is needed when allocating receive
+ /// and transmit buffers.
+ ///
PXE_UINT16 MediaHeaderLen;
- //
- // Number of bytes in the NIC hardware (MAC) address.
- //
+ ///
+ /// Number of bytes in the NIC hardware (MAC) address.
+ ///
PXE_UINT16 HWaddrLen;
- //
- // Maximum number of multicast MAC addresses in the multicast
- // MAC address filter list.
- //
+ ///
+ /// Maximum number of multicast MAC addresses in the multicast
+ /// MAC address filter list.
+ ///
PXE_UINT16 MCastFilterCnt;
- //
- // Default number and size of transmit and receive buffers that will
- // be allocated by the UNDI. If MemoryRequired is non-zero, this
- // allocation will come out of the memory buffer given to the Initialize
- // command. If MemoryRequired is zero, this allocation will come out of
- // memory on the NIC.
- //
+ ///
+ /// Default number and size of transmit and receive buffers that will
+ /// be allocated by the UNDI. If MemoryRequired is non-zero, this
+ /// allocation will come out of the memory buffer given to the Initialize
+ /// command. If MemoryRequired is zero, this allocation will come out of
+ /// memory on the NIC.
+ ///
PXE_UINT16 TxBufCnt;
PXE_UINT16 TxBufSize;
PXE_UINT16 RxBufCnt;
PXE_UINT16 RxBufSize;
- //
- // Hardware interface types defined in the Assigned Numbers RFC
- // and used in DHCP and ARP packets.
- // See the PXE_IFTYPE typedef and PXE_IFTYPE_xxx macros.
- //
+ ///
+ /// Hardware interface types defined in the Assigned Numbers RFC
+ /// and used in DHCP and ARP packets.
+ /// See the PXE_IFTYPE typedef and PXE_IFTYPE_xxx macros.
+ ///
PXE_UINT8 IFtype;
- //
- // Supported duplex. See PXE_DUPLEX_xxxxx #defines below.
- //
+ ///
+ /// Supported duplex. See PXE_DUPLEX_xxxxx #defines below.
+ ///
PXE_UINT8 SupportedDuplexModes;
- //
- // Supported loopback options. See PXE_LOOPBACK_xxxxx #defines below.
- //
+ ///
+ /// Supported loopback options. See PXE_LOOPBACK_xxxxx #defines below.
+ ///
PXE_UINT8 SupportedLoopBackModes;
} PXE_DB_GET_INIT_INFO;
@@ -1195,24 +1174,24 @@ typedef struct s_pxe_db_get_init_info {
#define PXE_LOOPBACK_EXTERNAL_SUPPORTED 2
typedef struct s_pxe_pci_config_info {
- //
- // This is the flag field for the PXE_DB_GET_CONFIG_INFO union.
- // For PCI bus devices, this field is set to PXE_BUSTYPE_PCI.
- //
+ ///
+ /// This is the flag field for the PXE_DB_GET_CONFIG_INFO union.
+ /// For PCI bus devices, this field is set to PXE_BUSTYPE_PCI.
+ ///
UINT32 BusType;
- //
- // This identifies the PCI network device that this UNDI interface
- // is bound to.
- //
+ ///
+ /// This identifies the PCI network device that this UNDI interface
+ /// is bound to.
+ ///
UINT16 Bus;
UINT8 Device;
UINT8 Function;
- //
- // This is a copy of the PCI configuration space for this
- // network device.
- //
+ ///
+ /// This is a copy of the PCI configuration space for this
+ /// network device.
+ ///
union {
UINT8 Byte[256];
UINT16 Word[128];
@@ -1221,24 +1200,24 @@ typedef struct s_pxe_pci_config_info {
} PXE_PCI_CONFIG_INFO;
typedef struct s_pxe_pcc_config_info {
- //
- // This is the flag field for the PXE_DB_GET_CONFIG_INFO union.
- // For PCC bus devices, this field is set to PXE_BUSTYPE_PCC.
- //
+ ///
+ /// This is the flag field for the PXE_DB_GET_CONFIG_INFO union.
+ /// For PCC bus devices, this field is set to PXE_BUSTYPE_PCC.
+ ///
PXE_UINT32 BusType;
- //
- // This identifies the PCC network device that this UNDI interface
- // is bound to.
- //
+ ///
+ /// This identifies the PCC network device that this UNDI interface
+ /// is bound to.
+ ///
PXE_UINT16 Bus;
PXE_UINT8 Device;
PXE_UINT8 Function;
- //
- // This is a copy of the PCC configuration space for this
- // network device.
- //
+ ///
+ /// This is a copy of the PCC configuration space for this
+ /// network device.
+ ///
union {
PXE_UINT8 Byte[256];
PXE_UINT16 Word[128];
@@ -1252,45 +1231,45 @@ typedef union u_pxe_db_get_config_info {
} PXE_DB_GET_CONFIG_INFO;
typedef struct s_pxe_cpb_initialize {
- //
- // Address of first (lowest) byte of the memory buffer. This buffer must
- // be in contiguous physical memory and cannot be swapped out. The UNDI
- // will be using this for transmit and receive buffering.
- //
+ ///
+ /// Address of first (lowest) byte of the memory buffer. This buffer must
+ /// be in contiguous physical memory and cannot be swapped out. The UNDI
+ /// will be using this for transmit and receive buffering.
+ ///
PXE_UINT64 MemoryAddr;
- //
- // MemoryLength must be greater than or equal to MemoryRequired
- // returned by the Get Init Info command.
- //
+ ///
+ /// MemoryLength must be greater than or equal to MemoryRequired
+ /// returned by the Get Init Info command.
+ ///
PXE_UINT32 MemoryLength;
- //
- // Desired link speed in Mbit/sec. Common ethernet values are 10, 100
- // and 1000. Setting a value of zero will auto-detect and/or use the
- // default link speed (operation depends on UNDI/NIC functionality).
- //
+ ///
+ /// Desired link speed in Mbit/sec. Common ethernet values are 10, 100
+ /// and 1000. Setting a value of zero will auto-detect and/or use the
+ /// default link speed (operation depends on UNDI/NIC functionality).
+ ///
PXE_UINT32 LinkSpeed;
- //
- // Suggested number and size of receive and transmit buffers to
- // allocate. If MemoryAddr and MemoryLength are non-zero, this
- // allocation comes out of the supplied memory buffer. If MemoryAddr
- // and MemoryLength are zero, this allocation comes out of memory
- // on the NIC.
- //
- // If these fields are set to zero, the UNDI will allocate buffer
- // counts and sizes as it sees fit.
- //
+ ///
+ /// Suggested number and size of receive and transmit buffers to
+ /// allocate. If MemoryAddr and MemoryLength are non-zero, this
+ /// allocation comes out of the supplied memory buffer. If MemoryAddr
+ /// and MemoryLength are zero, this allocation comes out of memory
+ /// on the NIC.
+ ///
+ /// If these fields are set to zero, the UNDI will allocate buffer
+ /// counts and sizes as it sees fit.
+ ///
PXE_UINT16 TxBufCnt;
PXE_UINT16 TxBufSize;
PXE_UINT16 RxBufCnt;
PXE_UINT16 RxBufSize;
- //
- // The following configuration parameters are optional and must be zero
- // to use the default values.
- //
+ ///
+ /// The following configuration parameters are optional and must be zero
+ /// to use the default values.
+ ///
PXE_UINT8 DuplexMode;
PXE_UINT8 LoopBackMode;
@@ -1307,20 +1286,20 @@ typedef struct s_pxe_cpb_initialize {
#define LOOPBACK_EXTERNAL 2
typedef struct s_pxe_db_initialize {
- //
- // Actual amount of memory used from the supplied memory buffer. This
- // may be less that the amount of memory suppllied and may be zero if
- // the UNDI and network device do not use external memory buffers.
- //
- // Memory used by the UNDI and network device is allocated from the
- // lowest memory buffer address.
- //
+ ///
+ /// Actual amount of memory used from the supplied memory buffer. This
+ /// may be less that the amount of memory suppllied and may be zero if
+ /// the UNDI and network device do not use external memory buffers.
+ ///
+ /// Memory used by the UNDI and network device is allocated from the
+ /// lowest memory buffer address.
+ ///
PXE_UINT32 MemoryUsed;
- //
- // Actual number and size of receive and transmit buffers that were
- // allocated.
- //
+ ///
+ /// Actual number and size of receive and transmit buffers that were
+ /// allocated.
+ ///
PXE_UINT16 TxBufCnt;
PXE_UINT16 TxBufSize;
PXE_UINT16 RxBufCnt;
@@ -1328,120 +1307,120 @@ typedef struct s_pxe_db_initialize {
} PXE_DB_INITIALIZE;
typedef struct s_pxe_cpb_receive_filters {
- //
- // List of multicast MAC addresses. This list, if present, will
- // replace the existing multicast MAC address filter list.
- //
+ ///
+ /// List of multicast MAC addresses. This list, if present, will
+ /// replace the existing multicast MAC address filter list.
+ ///
PXE_MAC_ADDR MCastList[MAX_MCAST_ADDRESS_CNT];
} PXE_CPB_RECEIVE_FILTERS;
typedef struct s_pxe_db_receive_filters {
- //
- // Filtered multicast MAC address list.
- //
+ ///
+ /// Filtered multicast MAC address list.
+ ///
PXE_MAC_ADDR MCastList[MAX_MCAST_ADDRESS_CNT];
} PXE_DB_RECEIVE_FILTERS;
typedef struct s_pxe_cpb_station_address {
- //
- // If supplied and supported, the current station MAC address
- // will be changed.
- //
+ ///
+ /// If supplied and supported, the current station MAC address
+ /// will be changed.
+ ///
PXE_MAC_ADDR StationAddr;
} PXE_CPB_STATION_ADDRESS;
typedef struct s_pxe_dpb_station_address {
- //
- // Current station MAC address.
- //
+ ///
+ /// Current station MAC address.
+ ///
PXE_MAC_ADDR StationAddr;
- //
- // Station broadcast MAC address.
- //
+ ///
+ /// Station broadcast MAC address.
+ ///
PXE_MAC_ADDR BroadcastAddr;
- //
- // Permanent station MAC address.
- //
+ ///
+ /// Permanent station MAC address.
+ ///
PXE_MAC_ADDR PermanentAddr;
} PXE_DB_STATION_ADDRESS;
typedef struct s_pxe_db_statistics {
- //
- // Bit field identifying what statistic data is collected by the
- // UNDI/NIC.
- // If bit 0x00 is set, Data[0x00] is collected.
- // If bit 0x01 is set, Data[0x01] is collected.
- // If bit 0x20 is set, Data[0x20] is collected.
- // If bit 0x21 is set, Data[0x21] is collected.
- // Etc.
- //
+ ///
+ /// Bit field identifying what statistic data is collected by the
+ /// UNDI/NIC.
+ /// If bit 0x00 is set, Data[0x00] is collected.
+ /// If bit 0x01 is set, Data[0x01] is collected.
+ /// If bit 0x20 is set, Data[0x20] is collected.
+ /// If bit 0x21 is set, Data[0x21] is collected.
+ /// Etc.
+ ///
PXE_UINT64 Supported;
- //
- // Statistic data.
- //
+ ///
+ /// Statistic data.
+ ///
PXE_UINT64 Data[64];
} PXE_DB_STATISTICS;
-//
-// Total number of frames received. Includes frames with errors and
-// dropped frames.
-//
+///
+/// Total number of frames received. Includes frames with errors and
+/// dropped frames.
+///
#define PXE_STATISTICS_RX_TOTAL_FRAMES 0x00
-//
-// Number of valid frames received and copied into receive buffers.
-//
+///
+/// Number of valid frames received and copied into receive buffers.
+///
#define PXE_STATISTICS_RX_GOOD_FRAMES 0x01
-//
-// Number of frames below the minimum length for the media.
-// This would be <64 for ethernet.
-//
+///
+/// Number of frames below the minimum length for the media.
+/// This would be <64 for ethernet.
+///
#define PXE_STATISTICS_RX_UNDERSIZE_FRAMES 0x02
-//
-// Number of frames longer than the maxminum length for the
-// media. This would be >1500 for ethernet.
-//
+///
+/// Number of frames longer than the maxminum length for the
+/// media. This would be >1500 for ethernet.
+///
#define PXE_STATISTICS_RX_OVERSIZE_FRAMES 0x03
-//
-// Valid frames that were dropped because receive buffers were full.
-//
+///
+/// Valid frames that were dropped because receive buffers were full.
+///
#define PXE_STATISTICS_RX_DROPPED_FRAMES 0x04
-//
-// Number of valid unicast frames received and not dropped.
-//
+///
+/// Number of valid unicast frames received and not dropped.
+///
#define PXE_STATISTICS_RX_UNICAST_FRAMES 0x05
-//
-// Number of valid broadcast frames received and not dropped.
-//
+///
+/// Number of valid broadcast frames received and not dropped.
+///
#define PXE_STATISTICS_RX_BROADCAST_FRAMES 0x06
-//
-// Number of valid mutlicast frames received and not dropped.
-//
+///
+/// Number of valid mutlicast frames received and not dropped.
+///
#define PXE_STATISTICS_RX_MULTICAST_FRAMES 0x07
-//
-// Number of frames w/ CRC or alignment errors.
-//
+///
+/// Number of frames w/ CRC or alignment errors.
+///
#define PXE_STATISTICS_RX_CRC_ERROR_FRAMES 0x08
-//
-// Total number of bytes received. Includes frames with errors
-// and dropped frames.
-//
+///
+/// Total number of bytes received. Includes frames with errors
+/// and dropped frames.
+///
#define PXE_STATISTICS_RX_TOTAL_BYTES 0x09
-//
-// Transmit statistics.
-//
+///
+/// Transmit statistics.
+///
#define PXE_STATISTICS_TX_TOTAL_FRAMES 0x0A
#define PXE_STATISTICS_TX_GOOD_FRAMES 0x0B
#define PXE_STATISTICS_TX_UNDERSIZE_FRAMES 0x0C
@@ -1453,142 +1432,141 @@ typedef struct s_pxe_db_statistics {
#define PXE_STATISTICS_TX_CRC_ERROR_FRAMES 0x12
#define PXE_STATISTICS_TX_TOTAL_BYTES 0x13
-//
-// Number of collisions detection on this subnet.
-//
+///
+/// Number of collisions detection on this subnet.
+///
#define PXE_STATISTICS_COLLISIONS 0x14
-//
-// Number of frames destined for unsupported protocol.
-//
+///
+/// Number of frames destined for unsupported protocol.
+///
#define PXE_STATISTICS_UNSUPPORTED_PROTOCOL 0x15
typedef struct s_pxe_cpb_mcast_ip_to_mac {
- //
- // Multicast IP address to be converted to multicast MAC address.
- //
+ ///
+ /// Multicast IP address to be converted to multicast MAC address.
+ ///
PXE_IP_ADDR IP;
} PXE_CPB_MCAST_IP_TO_MAC;
typedef struct s_pxe_db_mcast_ip_to_mac {
- //
- // Multicast MAC address.
- //
+ ///
+ /// Multicast MAC address.
+ ///
PXE_MAC_ADDR MAC;
} PXE_DB_MCAST_IP_TO_MAC;
typedef struct s_pxe_cpb_nvdata_sparse {
- //
- // NvData item list. Only items in this list will be updated.
- //
+ ///
+ /// NvData item list. Only items in this list will be updated.
+ ///
struct {
- //
- // Non-volatile storage address to be changed.
- //
+ ///
+ /// Non-volatile storage address to be changed.
+ ///
PXE_UINT32 Addr;
- //
- // Data item to write into above storage address.
- //
+ ///
+ /// Data item to write into above storage address.
+ ///
union {
PXE_UINT8 Byte;
PXE_UINT16 Word;
PXE_UINT32 Dword;
} Data;
} Item[MAX_EEPROM_LEN];
-}
-PXE_CPB_NVDATA_SPARSE;
+} PXE_CPB_NVDATA_SPARSE;
-//
-// When using bulk update, the size of the CPB structure must be
-// the same size as the non-volatile NIC storage.
-//
+///
+/// When using bulk update, the size of the CPB structure must be
+/// the same size as the non-volatile NIC storage.
+///
typedef union u_pxe_cpb_nvdata_bulk {
- //
- // Array of byte-wide data items.
- //
+ ///
+ /// Array of byte-wide data items.
+ ///
PXE_UINT8 Byte[MAX_EEPROM_LEN << 2];
- //
- // Array of word-wide data items.
- //
+ ///
+ /// Array of word-wide data items.
+ ///
PXE_UINT16 Word[MAX_EEPROM_LEN << 1];
- //
- // Array of dword-wide data items.
- //
+ ///
+ /// Array of dword-wide data items.
+ ///
PXE_UINT32 Dword[MAX_EEPROM_LEN];
} PXE_CPB_NVDATA_BULK;
typedef struct s_pxe_db_nvdata {
- //
- // Arrays of data items from non-volatile storage.
- //
+ ///
+ /// Arrays of data items from non-volatile storage.
+ ///
union {
- //
- // Array of byte-wide data items.
- //
+ ///
+ /// Array of byte-wide data items.
+ ///
PXE_UINT8 Byte[MAX_EEPROM_LEN << 2];
- //
- // Array of word-wide data items.
- //
+ ///
+ /// Array of word-wide data items.
+ ///
PXE_UINT16 Word[MAX_EEPROM_LEN << 1];
- //
- // Array of dword-wide data items.
- //
+ ///
+ /// Array of dword-wide data items.
+ ///
PXE_UINT32 Dword[MAX_EEPROM_LEN];
} Data;
} PXE_DB_NVDATA;
typedef struct s_pxe_db_get_status {
- //
- // Length of next receive frame (header + data). If this is zero,
- // there is no next receive frame available.
- //
+ ///
+ /// Length of next receive frame (header + data). If this is zero,
+ /// there is no next receive frame available.
+ ///
PXE_UINT32 RxFrameLen;
- //
- // Reserved, set to zero.
- //
+ ///
+ /// Reserved, set to zero.
+ ///
PXE_UINT32 reserved;
- //
- // Addresses of transmitted buffers that need to be recycled.
- //
+ ///
+ /// Addresses of transmitted buffers that need to be recycled.
+ ///
PXE_UINT64 TxBuffer[MAX_XMIT_BUFFERS];
} PXE_DB_GET_STATUS;
typedef struct s_pxe_cpb_fill_header {
- //
- // Source and destination MAC addresses. These will be copied into
- // the media header without doing byte swapping.
- //
+ ///
+ /// Source and destination MAC addresses. These will be copied into
+ /// the media header without doing byte swapping.
+ ///
PXE_MAC_ADDR SrcAddr;
PXE_MAC_ADDR DestAddr;
- //
- // Address of first byte of media header. The first byte of packet data
- // follows the last byte of the media header.
- //
+ ///
+ /// Address of first byte of media header. The first byte of packet data
+ /// follows the last byte of the media header.
+ ///
PXE_UINT64 MediaHeader;
- //
- // Length of packet data in bytes (not including the media header).
- //
+ ///
+ /// Length of packet data in bytes (not including the media header).
+ ///
PXE_UINT32 PacketLen;
- //
- // Protocol type. This will be copied into the media header without
- // doing byte swapping. Protocol type numbers can be obtained from
- // the Assigned Numbers RFC 1700.
- //
+ ///
+ /// Protocol type. This will be copied into the media header without
+ /// doing byte swapping. Protocol type numbers can be obtained from
+ /// the Assigned Numbers RFC 1700.
+ ///
PXE_UINT16 Protocol;
- //
- // Length of the media header in bytes.
- //
+ ///
+ /// Length of the media header in bytes.
+ ///
PXE_UINT16 MediaHeaderLen;
} PXE_CPB_FILL_HEADER;
@@ -1597,215 +1575,182 @@ typedef struct s_pxe_cpb_fill_header {
#define MAX_XMIT_FRAGMENTS 16
typedef struct s_pxe_cpb_fill_header_fragmented {
- //
- // Source and destination MAC addresses. These will be copied into
- // the media header without doing byte swapping.
- //
+ ///
+ /// Source and destination MAC addresses. These will be copied into
+ /// the media header without doing byte swapping.
+ ///
PXE_MAC_ADDR SrcAddr;
PXE_MAC_ADDR DestAddr;
- //
- // Length of packet data in bytes (not including the media header).
- //
+ ///
+ /// Length of packet data in bytes (not including the media header).
+ ///
PXE_UINT32 PacketLen;
- //
- // Protocol type. This will be copied into the media header without
- // doing byte swapping. Protocol type numbers can be obtained from
- // the Assigned Numbers RFC 1700.
- //
+ ///
+ /// Protocol type. This will be copied into the media header without
+ /// doing byte swapping. Protocol type numbers can be obtained from
+ /// the Assigned Numbers RFC 1700.
+ ///
PXE_MEDIA_PROTOCOL Protocol;
- //
- // Length of the media header in bytes.
- //
+ ///
+ /// Length of the media header in bytes.
+ ///
PXE_UINT16 MediaHeaderLen;
- //
- // Number of packet fragment descriptors.
- //
+ ///
+ /// Number of packet fragment descriptors.
+ ///
PXE_UINT16 FragCnt;
- //
- // Reserved, must be set to zero.
- //
+ ///
+ /// Reserved, must be set to zero.
+ ///
PXE_UINT16 reserved;
- //
- // Array of packet fragment descriptors. The first byte of the media
- // header is the first byte of the first fragment.
- //
+ ///
+ /// Array of packet fragment descriptors. The first byte of the media
+ /// header is the first byte of the first fragment.
+ ///
struct {
- //
- // Address of this packet fragment.
- //
+ ///
+ /// Address of this packet fragment.
+ ///
PXE_UINT64 FragAddr;
- //
- // Length of this packet fragment.
- //
+ ///
+ /// Length of this packet fragment.
+ ///
PXE_UINT32 FragLen;
- //
- // Reserved, must be set to zero.
- //
+ ///
+ /// Reserved, must be set to zero.
+ ///
PXE_UINT32 reserved;
} FragDesc[MAX_XMIT_FRAGMENTS];
}
PXE_CPB_FILL_HEADER_FRAGMENTED;
typedef struct s_pxe_cpb_transmit {
- //
- // Address of first byte of frame buffer. This is also the first byte
- // of the media header.
- //
+ ///
+ /// Address of first byte of frame buffer. This is also the first byte
+ /// of the media header.
+ ///
PXE_UINT64 FrameAddr;
- //
- // Length of the data portion of the frame buffer in bytes. Do not
- // include the length of the media header.
- //
+ ///
+ /// Length of the data portion of the frame buffer in bytes. Do not
+ /// include the length of the media header.
+ ///
PXE_UINT32 DataLen;
- //
- // Length of the media header in bytes.
- //
+ ///
+ /// Length of the media header in bytes.
+ ///
PXE_UINT16 MediaheaderLen;
- //
- // Reserved, must be zero.
- //
+ ///
+ /// Reserved, must be zero.
+ ///
PXE_UINT16 reserved;
} PXE_CPB_TRANSMIT;
typedef struct s_pxe_cpb_transmit_fragments {
- //
- // Length of packet data in bytes (not including the media header).
- //
+ ///
+ /// Length of packet data in bytes (not including the media header).
+ ///
PXE_UINT32 FrameLen;
- //
- // Length of the media header in bytes.
- //
+ ///
+ /// Length of the media header in bytes.
+ ///
PXE_UINT16 MediaheaderLen;
- //
- // Number of packet fragment descriptors.
- //
+ ///
+ /// Number of packet fragment descriptors.
+ ///
PXE_UINT16 FragCnt;
- //
- // Array of frame fragment descriptors. The first byte of the first
- // fragment is also the first byte of the media header.
- //
+ ///
+ /// Array of frame fragment descriptors. The first byte of the first
+ /// fragment is also the first byte of the media header.
+ ///
struct {
- //
- // Address of this frame fragment.
- //
+ ///
+ /// Address of this frame fragment.
+ ///
PXE_UINT64 FragAddr;
- //
- // Length of this frame fragment.
- //
+ ///
+ /// Length of this frame fragment.
+ ///
PXE_UINT32 FragLen;
- //
- // Reserved, must be set to zero.
- //
+ ///
+ /// Reserved, must be set to zero.
+ ///
PXE_UINT32 reserved;
} FragDesc[MAX_XMIT_FRAGMENTS];
}
PXE_CPB_TRANSMIT_FRAGMENTS;
typedef struct s_pxe_cpb_receive {
- //
- // Address of first byte of receive buffer. This is also the first byte
- // of the frame header.
- //
+ ///
+ /// Address of first byte of receive buffer. This is also the first byte
+ /// of the frame header.
+ ///
PXE_UINT64 BufferAddr;
- //
- // Length of receive buffer. This must be large enough to hold the
- // received frame (media header + data). If the length of smaller than
- // the received frame, data will be lost.
- //
+ ///
+ /// Length of receive buffer. This must be large enough to hold the
+ /// received frame (media header + data). If the length of smaller than
+ /// the received frame, data will be lost.
+ ///
PXE_UINT32 BufferLen;
- //
- // Reserved, must be set to zero.
- //
+ ///
+ /// Reserved, must be set to zero.
+ ///
PXE_UINT32 reserved;
} PXE_CPB_RECEIVE;
typedef struct s_pxe_db_receive {
- //
- // Source and destination MAC addresses from media header.
- //
+ ///
+ /// Source and destination MAC addresses from media header.
+ ///
PXE_MAC_ADDR SrcAddr;
PXE_MAC_ADDR DestAddr;
- //
- // Length of received frame. May be larger than receive buffer size.
- // The receive buffer will not be overwritten. This is how to tell
- // if data was lost because the receive buffer was too small.
- //
+ ///
+ /// Length of received frame. May be larger than receive buffer size.
+ /// The receive buffer will not be overwritten. This is how to tell
+ /// if data was lost because the receive buffer was too small.
+ ///
PXE_UINT32 FrameLen;
- //
- // Protocol type from media header.
- //
+ ///
+ /// Protocol type from media header.
+ ///
PXE_MEDIA_PROTOCOL Protocol;
- //
- // Length of media header in received frame.
- //
+ ///
+ /// Length of media header in received frame.
+ ///
PXE_UINT16 MediaHeaderLen;
- //
- // Type of receive frame.
- //
+ ///
+ /// Type of receive frame.
+ ///
PXE_FRAME_TYPE Type;
- //
- // Reserved, must be zero.
- //
+ ///
+ /// Reserved, must be zero.
+ ///
PXE_UINT8 reserved[7];
} PXE_DB_RECEIVE;
-//
-// Packet definitions
-//
-typedef struct {
- UINT8 BootpOpcode;
- UINT8 BootpHwType;
- UINT8 BootpHwAddrLen;
- UINT8 BootpGateHops;
- UINT32 BootpIdent;
- UINT16 BootpSeconds;
- UINT16 BootpFlags;
- UINT8 BootpCiAddr[4];
- UINT8 BootpYiAddr[4];
- UINT8 BootpSiAddr[4];
- UINT8 BootpGiAddr[4];
- UINT8 BootpHwAddr[16];
- UINT8 BootpSrvName[64];
- UINT8 BootpBootFile[128];
- UINT32 DhcpMagik;
- UINT8 DhcpOptions[56];
-} EFI_PXE_BASE_CODE_DHCPV4_PACKET;
-
-typedef union {
- UINT8 Raw[1472];
- EFI_PXE_BASE_CODE_DHCPV4_PACKET Dhcpv4;
-
- //
- // EFI_PXE_BASE_CODE_DHCPV6_PACKET Dhcpv6;
- //
-} EFI_PXE_BASE_CODE_PACKET;
-
-
-
#pragma pack()
#endif
diff --git a/src/include/gpxe/efi/Uefi/UefiSpec.h b/src/include/gpxe/efi/Uefi/UefiSpec.h
index 54c3ace7..03e7b6cc 100644
--- a/src/include/gpxe/efi/Uefi/UefiSpec.h
+++ b/src/include/gpxe/efi/Uefi/UefiSpec.h
@@ -1,11 +1,11 @@
/** @file
- Include file that supportes UEFI.
+ Include file that supports UEFI.
- This include file must only contain things defined in the UEFI 2.0 specification.
- If a code construct is defined in the UEFI 2.0 specification it must be included
+ This include file must only contain things defined in the UEFI 2.1 specification.
+ If a code construct is defined in the UEFI 2.1 specification it must be included
by this include file.
- Copyright (c) 2006 - 2007, Intel Corporation
+ 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
@@ -47,27 +47,32 @@ typedef enum {
#define EFI_UNSPECIFIED_TIMEZONE 0x07FF
//
-// possible caching types for the memory range
+// Memory cacheability attributes
//
#define EFI_MEMORY_UC 0x0000000000000001ULL
#define EFI_MEMORY_WC 0x0000000000000002ULL
#define EFI_MEMORY_WT 0x0000000000000004ULL
#define EFI_MEMORY_WB 0x0000000000000008ULL
#define EFI_MEMORY_UCE 0x0000000000000010ULL
-
//
-// physical memory protection on range
+// Physical memory protection attributes
//
#define EFI_MEMORY_WP 0x0000000000001000ULL
#define EFI_MEMORY_RP 0x0000000000002000ULL
#define EFI_MEMORY_XP 0x0000000000004000ULL
+//
+// Runtime memory attribute
+//
+#define EFI_MEMORY_RUNTIME 0x8000000000000000ULL
///
-/// range requires a runtime mapping
+/// Memory descriptor version number
///
-#define EFI_MEMORY_RUNTIME 0x8000000000000000ULL
-
#define EFI_MEMORY_DESCRIPTOR_VERSION 1
+
+///
+/// Definition of memory descriptor
+///
typedef struct {
UINT32 Type;
EFI_PHYSICAL_ADDRESS PhysicalStart;
@@ -79,8 +84,7 @@ typedef struct {
///
/// Build macros to find next EFI_MEMORY_DESCRIPTOR.
///
-#define NextMemoryDescriptor(_Ptr, _Size) ((EFI_MEMORY_DESCRIPTOR *) (((UINT8 *) (_Ptr)) + (_Size)))
-#define NEXT_MEMORY_DESCRIPTOR(_Ptr, _Size) NextMemoryDescriptor (_Ptr, _Size)
+#define NEXT_MEMORY_DESCRIPTOR(_Ptr, _Size) ((EFI_MEMORY_DESCRIPTOR *) (((UINT8 *) (_Ptr)) + (_Size)))
///
/// Declare forward referenced data structures
@@ -137,6 +141,10 @@ EFI_STATUS
Returns the current memory map.
@param MemoryMapSize A pointer to the size, in bytes, of the MemoryMap buffer.
+ On input, this is the size of the buffer allocated by the caller.
+ On output, it is the size of the buffer returned by the firmware if
+ the buffer was large enough, or the size of the buffer needed to contain
+ the map if the buffer was too small.
@param MemoryMap A pointer to the buffer in which firmware places the current memory
map.
@param MapKey A pointer to the location in which firmware returns the key for the
@@ -265,14 +273,20 @@ EFI_STATUS
@param ControllerHandle The handle of the controller from which driver(s) are to be disconnected.
@param DriverImageHandle The driver to disconnect from ControllerHandle.
+ If DriverImageHandle is NULL, then all the drivers currently managing
+ ControllerHandle are disconnected from ControllerHandle.
@param ChildHandle The handle of the child to destroy.
+ If ChildHandle is NULL, then all the children of ControllerHandle are
+ destroyed before the drivers are disconnected from ControllerHandle.
@retval EFI_SUCCESS 1) One or more drivers were disconnected from the controller.
2) On entry, no drivers are managing ControllerHandle.
3) DriverImageHandle is not NULL, and on entry
DriverImageHandle is not managing ControllerHandle.
-
- @retval EFI_INVALID_PARAMETER One ore more parameters are invalid.
+ @retval EFI_INVALID_PARAMETER 1) ControllerHandle is not a valid EFI_HANDLE.
+ 2) DriverImageHandle is not NULL, and it is not a valid EFI_HANDLE.
+ 3) ChildHandle is not NULL, and it is not a valid EFI_HANDLE.
+ 4) DriverImageHandle does not support the EFI_DRIVER_BINDING_PROTOCOL.
@retval EFI_OUT_OF_RESOURCES There are not enough resources available to disconnect any drivers from
ControllerHandle.
@retval EFI_DEVICE_ERROR The controller could not be disconnected because of a device error.
@@ -357,7 +371,7 @@ VOID
Creates an event.
@param Type The type of event to create and its mode and attributes.
- @param NotifyTpl Pointer to the notification function's context.
+ @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
Context in the notification function.
@@ -383,11 +397,13 @@ EFI_STATUS
Creates an event in a group.
@param Type The type of event to create and its mode and attributes.
- @param NotifyTpl Pointer to the notification function's context.
+ @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
Context in the notification function.
@param EventGroup 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
otherwise.
@@ -400,13 +416,16 @@ typedef
EFI_STATUS
(EFIAPI *EFI_CREATE_EVENT_EX)(
IN UINT32 Type,
- IN EFI_TPL NotifyTpl OPTIONAL,
+ IN EFI_TPL NotifyTpl,
IN EFI_EVENT_NOTIFY NotifyFunction OPTIONAL,
IN CONST VOID *NotifyContext OPTIONAL,
IN CONST EFI_GUID *EventGroup OPTIONAL,
OUT EFI_EVENT *Event
);
+///
+/// Timer delay types
+///
typedef enum {
TimerCancel,
TimerPeriodic,
@@ -419,6 +438,11 @@ typedef enum {
@param Event The timer event that is to be signaled at the specified time.
@param Type The type of time that is specified in TriggerTime.
@param TriggerTime The number of 100ns units until the timer expires.
+ A TriggerTime of 0 is legal.
+ If Type is TimerRelative and TriggerTime is 0, then the timer
+ event will be signaled on the next timer tick.
+ If Type is TimerPeriodic and TriggerTime is 0, then the timer
+ event will be signaled on every timer tick.
@retval EFI_SUCCESS The event has been set to be signaled at the requested time.
@retval EFI_INVALID_PARAMETER Event or Type is not valid.
@@ -500,7 +524,7 @@ EFI_STATUS
//
-// Task priority level (name defined in spec).
+// Task priority level
//
#define TPL_APPLICATION 4
#define TPL_CALLBACK 8
@@ -513,7 +537,7 @@ EFI_STATUS
@param NewTpl The new task priority level.
- @retval Previous task priority level
+ @return Previous task priority level
**/
typedef
@@ -525,7 +549,7 @@ EFI_TPL
/**
Restores a task's priority level to its previous value.
- @param OldTpl The previous task priority level to restore
+ @param OldTpl The previous task priority level to restore.
**/
typedef
@@ -546,11 +570,15 @@ VOID
On output the size of data returned in Data.
@param Data The buffer to return the contents of the variable.
- @retval EFI_SUCCESS The function completed successfully.
- @retval EFI_NOT_FOUND The variable was not found.
- @retval EFI_BUFFER_TOO_SMALL The DataSize is too small for the result.
- @retval EFI_INVALID_PARAMETER One or more parameters are invalid.
- @retval EFI_DEVICE_ERROR The variable could not be retrieved due to a hardware error.
+ @retval EFI_SUCCESS The function completed successfully.
+ @retval EFI_NOT_FOUND The variable was not found.
+ @retval EFI_BUFFER_TOO_SMALL The DataSize is too small for the result.
+ @retval EFI_INVALID_PARAMETER VariableName is NULL.
+ @retval EFI_INVALID_PARAMETER VendorGuid is NULL.
+ @retval EFI_INVALID_PARAMETER DataSize is NULL.
+ @retval EFI_INVALID_PARAMETER The DataSize is not too small and Data is NULL.
+ @retval EFI_DEVICE_ERROR The variable could not be retrieved due to a hardware error.
+ @retval EFI_SECURITY_VIOLATION The variable could not be retrieved due to an authentication failure.
**/
typedef
@@ -577,7 +605,9 @@ EFI_STATUS
@retval EFI_SUCCESS The function completed successfully.
@retval EFI_NOT_FOUND The next variable was not found.
@retval EFI_BUFFER_TOO_SMALL The VariableNameSize is too small for the result.
- @retval EFI_INVALID_PARAMETER One or more parameters are invalid.
+ @retval EFI_INVALID_PARAMETER VariableNameSize is NULL.
+ @retval EFI_INVALID_PARAMETER VariableName is NULL.
+ @retval EFI_INVALID_PARAMETER VendorGuid is NULL.
@retval EFI_DEVICE_ERROR The variable could not be retrieved due to a hardware error.
**/
@@ -599,12 +629,17 @@ EFI_STATUS
@param DataSize The size in bytes of the Data buffer.
@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_WRITE_PROTECTED The variable in question is read-only.
- @retval EFI_OUT_OF_RESOURCES Not enough storage is available to hold the variable and its data.
- @retval EFI_INVALID_PARAMETER One or more parameters are invalid.
- @retval EFI_DEVICE_ERROR The variable could not be retrieved due to a hardware error.
+ @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_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_NOT_FOUND The variable trying to be updated or deleted was not found.
**/
typedef
@@ -618,10 +653,10 @@ EFI_STATUS
);
-//
-// This provides the capabilities of the
-// real time clock device as exposed through the EFI interfaces.
-//
+///
+/// This provides the capabilities of the
+/// real time clock device as exposed through the EFI interfaces.
+///
typedef struct {
UINT32 Resolution;
UINT32 Accuracy;
@@ -672,8 +707,11 @@ EFI_STATUS
@param Time The current alarm setting.
@retval EFI_SUCCESS The alarm settings were returned.
- @retval EFI_INVALID_PARAMETER Any parameter is NULL.
+ @retval EFI_INVALID_PARAMETER Enabled is NULL.
+ @retval EFI_INVALID_PARAMETER Pending is NULL.
+ @retval EFI_INVALID_PARAMETER Time is NULL.
@retval EFI_DEVICE_ERROR The wakeup time could not be retrieved due to a hardware error.
+ @retval EFI_UNSUPPORTED A wakeup timer is not supported on this platform.
**/
typedef
@@ -689,6 +727,7 @@ EFI_STATUS
@param Enabled Enable or disable the wakeup alarm.
@param Time If Enable is TRUE, the time to set the wakeup alarm for.
+ If Enable is FALSE, then this parameter is optional, and may be NULL.
@retval EFI_SUCCESS If Enable is TRUE, then the wakeup alarm was enabled. If
Enable is FALSE, then the wakeup alarm was disabled.
@@ -705,13 +744,15 @@ EFI_STATUS
);
/**
- This is the declaration of an EFI image entry point. This can be the entry point to an application
- written to this specification, an EFI boot service driver, or an EFI runtime driver.
+ 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 Handle that identifies the loaded image.
- @param SystemTable System Table for this image.
+ @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
@@ -729,16 +770,16 @@ EFI_STATUS
FilePath as a boot selection. Ignored if SourceBuffer is
not NULL.
@param ParentImageHandle The caller's image handle.
- @param FilePath The DeviceHandle specific file path from which the image is
+ @param DevicePath The DeviceHandle specific file path from which the image is
loaded.
@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.
+ @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
image is successfully loaded.
@retval EFI_SUCCESS Image was loaded into memory correctly.
- @retval EFI_NOT_FOUND Both SourceBuffer and FilePath are NULL.
+ @retval EFI_NOT_FOUND Both SourceBuffer and DevicePath are NULL.
@retval EFI_INVALID_PARAMETER One or more parametes are invalid.
@retval EFI_UNSUPPORTED The image type is not supported.
@retval EFI_OUT_OF_RESOURCES Image was not loaded due to insufficient resources.
@@ -752,7 +793,7 @@ EFI_STATUS
(EFIAPI *EFI_IMAGE_LOAD)(
IN BOOLEAN BootPolicy,
IN EFI_HANDLE ParentImageHandle,
- IN EFI_DEVICE_PATH_PROTOCOL *FilePath,
+ IN EFI_DEVICE_PATH_PROTOCOL *DevicePath,
IN VOID *SourceBuffer OPTIONAL,
IN UINTN SourceSize,
OUT EFI_HANDLE *ImageHandle
@@ -768,7 +809,7 @@ EFI_STATUS
@retval EFI_INVALID_PARAMETER ImageHandle is either an invalid image handle or the image
has already been initialized with StartImage
- @retval Exit code from image Exit code from image
+ @return Exit code from image
**/
typedef
@@ -811,7 +852,7 @@ 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.
- @retval Exit code from the image's unload handler
+ @return Exit code from the image's unload handler
**/
typedef
@@ -877,9 +918,9 @@ EFI_STATUS
IN CHAR16 *WatchdogData OPTIONAL
);
-//
-// Enumeration of reset types.
-//
+///
+/// Enumeration of reset types.
+///
typedef enum {
EfiResetCold,
EfiResetWarm,
@@ -949,7 +990,9 @@ EFI_STATUS
@retval EFI_SUCCESS The 32-bit CRC was computed for the data buffer and returned in
Crc32.
- @retval EFI_INVALID_PARAMETER One or more parameters are invalid.
+ @retval EFI_INVALID_PARAMETER Data is NULL.
+ @retval EFI_INVALID_PARAMETER Crc32 is NULL.
+ @retval EFI_INVALID_PARAMETER DataSize is 0.
**/
typedef
@@ -1014,7 +1057,10 @@ typedef enum {
@retval EFI_SUCCESS The protocol interface was installed.
@retval EFI_OUT_OF_RESOURCES Space for a new handle could not be allocated.
- @retval EFI_INVALID_PARAMETER One or more parameters are invalid.
+ @retval EFI_INVALID_PARAMETER Handle is NULL.
+ @retval EFI_INVALID_PARAMETER Protocol is NULL.
+ @retval EFI_INVALID_PARAMETER InterfaceType is not EFI_NATIVE_INTERFACE.
+ @retval EFI_INVALID_PARAMETER Protocol is already installed on the handle specified by Handle.
**/
typedef
@@ -1061,7 +1107,8 @@ EFI_STATUS
@retval EFI_ACCESS_DENIED The protocol interface could not be reinstalled,
because OldInterface is still being used by a
driver that will not release it.
- @retval EFI_INVALID_PARAMETER One or more parameters are invalid.
+ @retval EFI_INVALID_PARAMETER Handle is not a valid EFI_HANDLE.
+ @retval EFI_INVALID_PARAMETER Protocol is NULL.
**/
typedef
@@ -1086,7 +1133,8 @@ EFI_STATUS
@retval EFI_NOT_FOUND The interface was not found.
@retval EFI_ACCESS_DENIED The interface was not removed because the interface
is still being used by a driver.
- @retval EFI_INVALID_PARAMETER One or more parameters are invalid.
+ @retval EFI_INVALID_PARAMETER Handle is not a valid EFI_HANDLE.
+ @retval EFI_INVALID_PARAMETER Protocol is NULL.
**/
typedef
@@ -1122,9 +1170,12 @@ EFI_STATUS
@param Protocol The published unique identifier of the protocol.
@param Interface Supplies the address where a pointer to the corresponding Protocol
Interface is returned.
+
@retval EFI_SUCCESS The interface information for the specified protocol was returned.
@retval EFI_UNSUPPORTED The device does not support the specified protocol.
- @retval EFI_INVALID_PARAMETER One of the protocol interfaces was not previously installed on Handle.
+ @retval EFI_INVALID_PARAMETER Handle is not a valid EFI_HANDLE.
+ @retval EFI_INVALID_PARAMETER Protocol is NULL.
+ @retval EFI_INVALID_PARAMETER Interface is NULL.
**/
typedef
@@ -1174,9 +1225,9 @@ EFI_STATUS
(EFIAPI *EFI_OPEN_PROTOCOL)(
IN EFI_HANDLE Handle,
IN EFI_GUID *Protocol,
- OUT VOID **Interface,
+ OUT VOID **Interface, OPTIONAL
IN EFI_HANDLE AgentHandle,
- IN EFI_HANDLE ControllerHandle, OPTIONAL
+ IN EFI_HANDLE ControllerHandle,
IN UINT32 Attributes
);
@@ -1187,15 +1238,16 @@ EFI_STATUS
@param Handle The handle for the protocol interface that was previously opened
with OpenProtocol(), and is now being closed.
@param Protocol The published unique identifier of the protocol.
- @param Interface Supplies the address where a pointer to the corresponding Protocol
- Interface is returned.
@param AgentHandle The handle of the agent that is closing the protocol interface.
@param ControllerHandle If the agent that opened a protocol is a driver that follows the
UEFI Driver Model, then this parameter is the controller handle
that required the protocol interface.
@retval EFI_SUCCESS The protocol instance was closed.
- @retval EFI_INVALID_PARAMETER One or more parameters are invalid.
+ @retval EFI_INVALID_PARAMETER 1) Handle is not a valid EFI_HANDLE.
+ 2) AgentHandle is not a valid EFI_HANDLE.
+ 3) ControllerHandle is not NULL and ControllerHandle is not a valid EFI_HANDLE.
+ 4) Protocol is NULL.
@retval EFI_NOT_FOUND 1) Handle does not support the protocol specified by Protocol.
2) The protocol interface specified by Handle and Protocol is not
currently open by AgentHandle and ControllerHandle.
@@ -1238,7 +1290,7 @@ EFI_STATUS
(EFIAPI *EFI_OPEN_PROTOCOL_INFORMATION)(
IN EFI_HANDLE Handle,
IN EFI_GUID *Protocol,
- IN EFI_OPEN_PROTOCOL_INFORMATION_ENTRY **EntryBuffer,
+ OUT EFI_OPEN_PROTOCOL_INFORMATION_ENTRY **EntryBuffer,
OUT UINTN *EntryCount
);
@@ -1257,7 +1309,10 @@ EFI_STATUS
ProtocolBuffer. The number of protocol interface GUIDs was
returned in ProtocolBufferCount.
@retval EFI_OUT_OF_RESOURCES There is not enough pool memory to store the results.
- @retval EFI_INVALID_PARAMETER One or more parameters are invalid.
+ @retval EFI_INVALID_PARAMETER Handle is NULL.
+ @retval EFI_INVALID_PARAMETER Handle is not a valid EFI_HANDLE.
+ @retval EFI_INVALID_PARAMETER ProtocolBuffer is NULL.
+ @retval EFI_INVALID_PARAMETER ProtocolBufferCount is NULL.
**/
typedef
@@ -1278,7 +1333,9 @@ EFI_STATUS
@retval EFI_SUCCESS The notification event has been registered.
@retval EFI_OUT_OF_RESOURCES Space for the notification event could not be allocated.
- @retval EFI_INVALID_PARAMETER One or more parameters are invalid.
+ @retval EFI_INVALID_PARAMETER Protocol is NULL.
+ @retval EFI_INVALID_PARAMETER Event is NULL.
+ @retval EFI_INVALID_PARAMETER Registration is NULL.
**/
typedef
@@ -1311,7 +1368,11 @@ typedef enum {
@retval EFI_SUCCESS The array of handles was returned.
@retval EFI_NOT_FOUND No handles match the search.
@retval EFI_BUFFER_TOO_SMALL The BufferSize is too small for the result.
- @retval EFI_INVALID_PARAMETER One or more parameters are invalid.
+ @retval EFI_INVALID_PARAMETER SearchType is not a member of EFI_LOCATE_SEARCH_TYPE.
+ @retval EFI_INVALID_PARAMETER SearchType is ByRegisterNotify and SearchKey is NULL.
+ @retval EFI_INVALID_PARAMETER SearchType is ByProtocol and Protocol is NULL.
+ @retval EFI_INVALID_PARAMETER One or more matches are found and BufferSize is NULL.
+ @retval EFI_INVALID_PARAMETER BufferSize is large enough for the result and Buffer is NULL.
**/
typedef
@@ -1335,7 +1396,9 @@ EFI_STATUS
@retval EFI_SUCCESS The resulting handle was returned.
@retval EFI_NOT_FOUND No handles match the search.
- @retval EFI_INVALID_PARAMETER One or more parameters are invalid.
+ @retval EFI_INVALID_PARAMETER Protocol is NULL.
+ @retval EFI_INVALID_PARAMETER DevicePath is NULL.
+ @retval EFI_INVALID_PARAMETER A handle matched the search and Device is NULL.
**/
typedef
@@ -1371,7 +1434,8 @@ EFI_STATUS
Returns an array of handles that support the requested protocol in a buffer allocated from pool.
@param SearchType Specifies which handle(s) are to be returned.
- @param Protocol Specifies the protocol to search by.
+ @param Protocol Provides the protocol to search by.
+ This parameter is only valid for a SearchType of ByProtocol.
@param SearchKey Supplies the search key depending on the SearchType.
@param NoHandles The number of handles returned in Buffer.
@param Buffer A pointer to the buffer to return the requested array of handles that
@@ -1381,7 +1445,8 @@ EFI_STATUS
handles in Buffer was returned in NoHandles.
@retval EFI_NOT_FOUND No handles match the search.
@retval EFI_OUT_OF_RESOURCES There is not enough pool memory to store the matching results.
- @retval EFI_INVALID_PARAMETER One or more parameters are invalid.
+ @retval EFI_INVALID_PARAMETER NoHandles is NULL.
+ @retval EFI_INVALID_PARAMETER Buffer is NULL.
**/
typedef
@@ -1433,6 +1498,11 @@ typedef struct {
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.
+//
typedef struct {
UINT32 CapsuleArrayNumber;
VOID* CapsulePtr[1];
@@ -1461,6 +1531,8 @@ typedef struct {
capsule has been successfully processed by the firmware.
@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.
**/
typedef
@@ -1487,6 +1559,7 @@ EFI_STATUS
@retval EFI_UNSUPPORTED The capsule type is not supported on this platform, and
MaximumCapsuleSize and ResetType are undefined.
@retval EFI_INVALID_PARAMETER MaximumCapsuleSize is NULL.
+ @retval EFI_OUT_OF_RESOURCES There were insufficient resources to process the query request.
**/
typedef
@@ -1543,7 +1616,13 @@ EFI_STATUS
#define EFI_RUNTIME_SERVICES_SIGNATURE 0x56524553544e5552ULL
#define EFI_RUNTIME_SERVICES_REVISION EFI_2_10_SYSTEM_TABLE_REVISION
+///
+/// EFI Runtime Services Table
+///
typedef struct {
+ ///
+ /// The table header for the EFI Runtime Services Table.
+ ///
EFI_TABLE_HEADER Hdr;
//
@@ -1589,7 +1668,13 @@ typedef struct {
#define EFI_BOOT_SERVICES_SIGNATURE 0x56524553544f4f42ULL
#define EFI_BOOT_SERVICES_REVISION EFI_2_10_SYSTEM_TABLE_REVISION
+///
+/// EFI Boot Services Table
+///
typedef struct {
+ ///
+ /// The table header for the EFI Boot Services Table.
+ ///
EFI_TABLE_HEADER Hdr;
//
@@ -1678,32 +1763,85 @@ typedef struct {
//
EFI_COPY_MEM CopyMem;
EFI_SET_MEM SetMem;
-
EFI_CREATE_EVENT_EX CreateEventEx;
} EFI_BOOT_SERVICES;
-//
-// Contains a set of GUID/pointer pairs comprised of the ConfigurationTable field in the
-// EFI System Table.
-//
+///
+/// Contains a set of GUID/pointer pairs comprised of the ConfigurationTable field in the
+/// EFI System Table.
+///
typedef struct{
+ ///
+ /// The 128-bit GUID value that uniquely identifies the system configuration table.
+ ///
EFI_GUID VendorGuid;
+ ///
+ /// A pointer to the table associated with VendorGuid.
+ ///
VOID *VendorTable;
} EFI_CONFIGURATION_TABLE;
+///
+/// EFI System Table
+///
struct _EFI_SYSTEM_TABLE {
+ ///
+ /// 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.
+ ///
CHAR16 *FirmwareVendor;
+ ///
+ /// A firmware vendor specific value that identifies the revision
+ /// of the system firmware for the platform.
+ ///
UINT32 FirmwareRevision;
+ ///
+ /// The handle for the active console input device.
+ ///
EFI_HANDLE ConsoleInHandle;
+ ///
+ /// A pointer to the SIMPLE_INPUT_PROTOCOL interface that is
+ /// associated with ConsoleInHandle.
+ ///
EFI_SIMPLE_TEXT_INPUT_PROTOCOL *ConIn;
+ ///
+ /// The handle for the active console output device.
+ ///
EFI_HANDLE ConsoleOutHandle;
+ ///
+ /// A pointer to the 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.
+ ///
EFI_HANDLE StandardErrorHandle;
+ ///
+ /// A pointer to the SIMPLE_TEXT_OUTPUT_PROTOCOL interface
+ /// that is associated with StandardErrorHandle.
+ ///
EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *StdErr;
+ ///
+ /// A pointer to the EFI Runtime Services Table.
+ ///
EFI_RUNTIME_SERVICES *RuntimeServices;
+ ///
+ /// A pointer to the EFI Boot Services Table.
+ ///
EFI_BOOT_SERVICES *BootServices;
+ ///
+ /// The number of system configuration tables in the buffer ConfigurationTable.
+ ///
UINTN NumberOfTableEntries;
+ ///
+ /// A pointer to the system configuration tables.
+ /// The number of entries in the table is NumberOfTableEntries.
+ ///
EFI_CONFIGURATION_TABLE *ConfigurationTable;
};
@@ -1733,7 +1871,7 @@ typedef union {
UINT32 SysReqPessed : 1;
UINT32 Reserved : 16;
UINT32 InputKeyCount : 2;
- } Options;
+ } Options;
UINT32 PackedValue;
} HOT_KEY_EFI_KEY_DATA;
@@ -1759,7 +1897,6 @@ typedef struct {
#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_EBC L"\\EFI\\BOOT\\BOOTEBC.EFI"
#if defined (MDE_CPU_IA32)
#define EFI_REMOVABLE_MEDIA_FILE_NAME EFI_REMOVABLE_MEDIA_FILE_NAME_IA32
@@ -1768,7 +1905,6 @@ typedef struct {
#elif defined (MDE_CPU_X64)
#define EFI_REMOVABLE_MEDIA_FILE_NAME EFI_REMOVABLE_MEDIA_FILE_NAME_X64
#elif defined (MDE_CPU_EBC)
- #define EFI_REMOVABLE_MEDIA_FILE_NAME EFI_REMOVABLE_MEDIA_FILE_NAME_EBC
#else
#error Unknown Processor Type
#endif
diff --git a/src/include/gpxe/efi/efi.h b/src/include/gpxe/efi/efi.h
index 0643066f..cd35f68a 100644
--- a/src/include/gpxe/efi/efi.h
+++ b/src/include/gpxe/efi/efi.h
@@ -28,8 +28,12 @@
* filesystems, compilation under -mrtd and -mregparm=3, etc.
*/
-/* Include the top-level EFI header file */
+/* EFI headers rudely redefine NULL */
+#undef NULL
+
+/* Include the top-level EFI header files */
#include <gpxe/efi/Uefi.h>
+#include <gpxe/efi/PiDxe.h>
/* Reset any trailing #pragma pack directives */
#pragma pack()