[gPXE git] mainline commit to master: [efi] Update UEFI header files with latest version from TianoCore

git at etherboot.org git at etherboot.org
Sun May 30 15:19:45 EDT 2010


In the Main gPXE repository, branch master has been updated.
      adds  19dfdc0 [efi] Update UEFI header files with latest version from TianoCore
      from  607e5f9 [iscsi] Allow base64 encoding in large binary values

Summary of changes:
 src/include/gpxe/efi/Base.h                        |  794 ++++++++++++--
 src/include/gpxe/efi/Guid/HiiFormMapMethodGuid.h   |   25 +
 src/include/gpxe/efi/Guid/PcAnsi.h                 |    6 +-
 src/include/gpxe/efi/Guid/SmBios.h                 |    8 +-
 src/include/gpxe/efi/Guid/WinCertificate.h         |  128 +++
 src/include/gpxe/efi/Ia32/ProcessorBind.h          |  257 +++--
 src/include/gpxe/efi/IndustryStandard/Pci22.h      |  304 +++++-
 src/include/gpxe/efi/IndustryStandard/PeImage.h    |  497 +++++-----
 src/include/gpxe/efi/Pi/PiBootMode.h               |    6 +-
 src/include/gpxe/efi/Pi/PiDependency.h             |    4 +-
 src/include/gpxe/efi/Pi/PiDxeCis.h                 |  101 ++-
 src/include/gpxe/efi/Pi/PiFirmwareFile.h           |  306 +++++-
 src/include/gpxe/efi/Pi/PiFirmwareVolume.h         |   78 ++-
 src/include/gpxe/efi/Pi/PiHob.h                    |  202 +++-
 src/include/gpxe/efi/Pi/PiMultiPhase.h             |  162 ++--
 src/include/gpxe/efi/Pi/PiS3BootScript.h           |   59 +
 src/include/gpxe/efi/Pi/PiStatusCode.h             | 1126 ++++++++++++++++++++
 src/include/gpxe/efi/PiDxe.h                       |   12 +-
 src/include/gpxe/efi/Protocol/ComponentName2.h     |   35 +-
 src/include/gpxe/efi/Protocol/Cpu.h                |   13 +-
 src/include/gpxe/efi/Protocol/CpuIo.h              |  120 +--
 src/include/gpxe/efi/Protocol/CpuIo2.h             |  142 +++
 src/include/gpxe/efi/Protocol/DebugSupport.h       |  143 ++-
 src/include/gpxe/efi/Protocol/DevicePath.h         |  663 +++++++++++--
 src/include/gpxe/efi/Protocol/DriverBinding.h      |  158 ++-
 .../gpxe/efi/Protocol/NetworkInterfaceIdentifier.h |   53 +-
 src/include/gpxe/efi/Protocol/PciIo.h              |   53 +-
 src/include/gpxe/efi/Protocol/PciRootBridgeIo.h    |   48 +-
 src/include/gpxe/efi/Protocol/SimpleNetwork.h      |  123 ++-
 src/include/gpxe/efi/Protocol/SimpleTextIn.h       |   31 +-
 src/include/gpxe/efi/Protocol/SimpleTextOut.h      |   98 +-
 src/include/gpxe/efi/Uefi.h                        |   10 +-
 src/include/gpxe/efi/Uefi/UefiBaseType.h           |  133 ++-
 src/include/gpxe/efi/Uefi/UefiGpt.h                |   98 ++-
 .../gpxe/efi/Uefi/UefiInternalFormRepresentation.h |  556 +++++++++-
 src/include/gpxe/efi/Uefi/UefiMultiPhase.h         |  197 ++--
 src/include/gpxe/efi/Uefi/UefiPxe.h                |  208 ++--
 src/include/gpxe/efi/Uefi/UefiSpec.h               |  449 ++++++---
 src/include/gpxe/efi/X64/ProcessorBind.h           |  267 +++--
 src/include/gpxe/efi/efi.h                         |   10 +
 src/interface/efi/efi_smbios.c                     |    2 +-
 41 files changed, 6072 insertions(+), 1613 deletions(-)
 create mode 100644 src/include/gpxe/efi/Guid/HiiFormMapMethodGuid.h
 create mode 100644 src/include/gpxe/efi/Guid/WinCertificate.h
 create mode 100644 src/include/gpxe/efi/Pi/PiS3BootScript.h
 create mode 100644 src/include/gpxe/efi/Pi/PiStatusCode.h
 create mode 100644 src/include/gpxe/efi/Protocol/CpuIo2.h


- Log -----------------------------------------------------------------
------
commit 19dfdc0e8c48e7d3c7971e98200b218ce78a5780
Author: Geoff Lywood <glywood at vmware.com>
Date: Fri May 28 15:06:24 2010 -0700
Committer: Joshua Oreman <oremanj at rwcr.net>

[efi] Update UEFI header files with latest version from TianoCore

Signed-off-by: Joshua Oreman <oremanj at rwcr.net>

diff --git a/src/include/gpxe/efi/Base.h b/src/include/gpxe/efi/Base.h
index b2552d8..d95a204 100644
--- a/src/include/gpxe/efi/Base.h
+++ b/src/include/gpxe/efi/Base.h
@@ -6,11 +6,12 @@
   environment. There are a set of base libraries in the Mde Package that can
   be used to implement base modules.
 
-Copyright (c) 2006 - 2008, Intel Corporation
-All rights reserved. This program and the accompanying materials
+Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
+Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
+This program and the accompanying materials
 are licensed and made available under the terms and conditions of the BSD License
 which accompanies this distribution.  The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
+http://opensource.org/licenses/bsd-license.php.
 
 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
@@ -26,6 +27,88 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 //
 #include <gpxe/efi/ProcessorBind.h>
 
+
+/**
+  Verifies the storage size of a given data type.
+
+  This macro generates a divide by zero error or a zero size array declaration in
+  the preprocessor if the size is incorrect.  These are declared as "extern" so
+  the space for these arrays will not be in the modules.
+
+  @param  TYPE  The date type to determine the size of.
+  @param  Size  The expected size for the TYPE.
+
+**/
+#define VERIFY_SIZE_OF(TYPE, Size) extern UINT8 _VerifySizeof##TYPE[(sizeof(TYPE) == (Size)) / (sizeof(TYPE) == (Size))]
+
+//
+// Verify that ProcessorBind.h produced UEFI Data Types that are compliant with
+// Section 2.3.1 of the UEFI 2.3 Specification.
+//
+VERIFY_SIZE_OF (BOOLEAN, 1);
+VERIFY_SIZE_OF (INT8, 1);
+VERIFY_SIZE_OF (UINT8, 1);
+VERIFY_SIZE_OF (INT16, 2);
+VERIFY_SIZE_OF (UINT16, 2);
+VERIFY_SIZE_OF (INT32, 4);
+VERIFY_SIZE_OF (UINT32, 4);
+VERIFY_SIZE_OF (INT64, 8);
+VERIFY_SIZE_OF (UINT64, 8);
+VERIFY_SIZE_OF (CHAR8, 1);
+VERIFY_SIZE_OF (CHAR16, 2);
+
+//
+// The Microsoft* C compiler can removed references to unreferenced data items
+//  if the /OPT:REF linker option is used. We defined a macro as this is a
+//  a non standard extension
+//
+#if defined(_MSC_EXTENSIONS) && !defined (MDE_CPU_EBC)
+  ///
+  /// Remove global variable from the linked image if there are no references to
+  /// it after all compiler and linker optimizations have been performed.
+  ///
+  ///
+  #define GLOBAL_REMOVE_IF_UNREFERENCED __declspec(selectany)
+#else
+  ///
+  /// Remove the global variable from the linked image if there are no references
+  ///  to it after all compiler and linker optimizations have been performed.
+  ///
+  ///
+  #define GLOBAL_REMOVE_IF_UNREFERENCED
+#endif
+
+//
+// For symbol name in GNU assembly code, an extra "_" is necessary
+//
+#if defined(__GNUC__)
+  ///
+  /// Private worker functions for ASM_PFX()
+  ///
+  #define _CONCATENATE(a, b)  __CONCATENATE(a, b)
+  #define __CONCATENATE(a, b) a ## b
+
+  ///
+  /// The __USER_LABEL_PREFIX__ macro predefined by GNUC represents the prefix
+  /// on symbols in assembly language.
+  ///
+  #define ASM_PFX(name) _CONCATENATE (__USER_LABEL_PREFIX__, name)
+#endif
+
+#if __APPLE__
+  //
+  // Apple extension that is used by the linker to optimize code size
+  // with assembly functions. Put at the end of your .S files
+  //
+  #define ASM_FUNCTION_REMOVE_IF_UNREFERENCED  .subsections_via_symbols
+#else
+  #define ASM_FUNCTION_REMOVE_IF_UNREFERENCED
+#endif
+
+///
+/// 128 bit buffer containing a unique identifier value.
+/// Unless otherwise specified, aligned on a 64 bit boundary.
+///
 typedef struct {
   UINT32  Data1;
   UINT16  Data2;
@@ -33,42 +116,87 @@ typedef struct {
   UINT8   Data4[8];
 } GUID;
 
+//
+// 8-bytes unsigned value that represents a physical system address.
+//
 typedef UINT64 PHYSICAL_ADDRESS;
 
 ///
-/// LIST_ENTRY definition
+/// LIST_ENTRY structure definition.
 ///
 typedef struct _LIST_ENTRY LIST_ENTRY;
 
+///
+/// _LIST_ENTRY structure definition.
+///
 struct _LIST_ENTRY {
   LIST_ENTRY  *ForwardLink;
   LIST_ENTRY  *BackLink;
 };
 
 //
-// Modifiers to absract standard types to aid in debug of problems
+// Modifiers to abstract standard types to aid in debug of problems
 //
+
+///
+/// Datum is read-only.
+///
 #define CONST     const
+
+///
+/// Datum is scoped to the current file or function.
+///
 #define STATIC    static
+
+///
+/// Undeclared type.
+///
 #define VOID      void
 
 //
 // Modifiers for Data Types used to self document code.
 // This concept is borrowed for UEFI specification.
 //
+
+///
+/// Datum is passed to the function.
+///
 #define IN
+
+///
+/// Datum is returned from the function.
+///
 #define OUT
+
+///
+/// Passing the datum to the function is optional, and a NULL
+/// is passed if the value is not supplied.
+///
 #define OPTIONAL
 
 //
 //  UEFI specification claims 1 and 0. We are concerned about the
 //  complier portability so we did it this way.
 //
+
+///
+/// Boolean true value.  UEFI Specification defines this value to be 1,
+/// but this form is more portable.
+///
 #define TRUE  ((BOOLEAN)(1==1))
+
+///
+/// Boolean false value.  UEFI Specification defines this value to be 0,
+/// but this form is more portable.
+///
 #define FALSE ((BOOLEAN)(0==1))
 
+///
+/// NULL pointer (VOID *)
+///
 #define NULL  ((VOID *) 0)
 
+
 #define  BIT0     0x00000001
 #define  BIT1     0x00000002
 #define  BIT2     0x00000004
@@ -101,49 +229,159 @@ struct _LIST_ENTRY {
 #define  BIT29    0x20000000
 #define  BIT30    0x40000000
 #define  BIT31    0x80000000
-#define  BIT32    0x0000000100000000UL
-#define  BIT33    0x0000000200000000UL
-#define  BIT34    0x0000000400000000UL
-#define  BIT35    0x0000000800000000UL
-#define  BIT36    0x0000001000000000UL
-#define  BIT37    0x0000002000000000UL
-#define  BIT38    0x0000004000000000UL
-#define  BIT39    0x0000008000000000UL
-#define  BIT40    0x0000010000000000UL
-#define  BIT41    0x0000020000000000UL
-#define  BIT42    0x0000040000000000UL
-#define  BIT43    0x0000080000000000UL
-#define  BIT44    0x0000100000000000UL
-#define  BIT45    0x0000200000000000UL
-#define  BIT46    0x0000400000000000UL
-#define  BIT47    0x0000800000000000UL
-#define  BIT48    0x0001000000000000UL
-#define  BIT49    0x0002000000000000UL
-#define  BIT50    0x0004000000000000UL
-#define  BIT51    0x0008000000000000UL
-#define  BIT52    0x0010000000000000UL
-#define  BIT53    0x0020000000000000UL
-#define  BIT54    0x0040000000000000UL
-#define  BIT55    0x0080000000000000UL
-#define  BIT56    0x0100000000000000UL
-#define  BIT57    0x0200000000000000UL
-#define  BIT58    0x0400000000000000UL
-#define  BIT59    0x0800000000000000UL
-#define  BIT60    0x1000000000000000UL
-#define  BIT61    0x2000000000000000UL
-#define  BIT62    0x4000000000000000UL
-#define  BIT63    0x8000000000000000UL
+#define  BIT32    0x0000000100000000ULL
+#define  BIT33    0x0000000200000000ULL
+#define  BIT34    0x0000000400000000ULL
+#define  BIT35    0x0000000800000000ULL
+#define  BIT36    0x0000001000000000ULL
+#define  BIT37    0x0000002000000000ULL
+#define  BIT38    0x0000004000000000ULL
+#define  BIT39    0x0000008000000000ULL
+#define  BIT40    0x0000010000000000ULL
+#define  BIT41    0x0000020000000000ULL
+#define  BIT42    0x0000040000000000ULL
+#define  BIT43    0x0000080000000000ULL
+#define  BIT44    0x0000100000000000ULL
+#define  BIT45    0x0000200000000000ULL
+#define  BIT46    0x0000400000000000ULL
+#define  BIT47    0x0000800000000000ULL
+#define  BIT48    0x0001000000000000ULL
+#define  BIT49    0x0002000000000000ULL
+#define  BIT50    0x0004000000000000ULL
+#define  BIT51    0x0008000000000000ULL
+#define  BIT52    0x0010000000000000ULL
+#define  BIT53    0x0020000000000000ULL
+#define  BIT54    0x0040000000000000ULL
+#define  BIT55    0x0080000000000000ULL
+#define  BIT56    0x0100000000000000ULL
+#define  BIT57    0x0200000000000000ULL
+#define  BIT58    0x0400000000000000ULL
+#define  BIT59    0x0800000000000000ULL
+#define  BIT60    0x1000000000000000ULL
+#define  BIT61    0x2000000000000000ULL
+#define  BIT62    0x4000000000000000ULL
+#define  BIT63    0x8000000000000000ULL
+
+#define  SIZE_1KB    0x00000400
+#define  SIZE_2KB    0x00000800
+#define  SIZE_4KB    0x00001000
+#define  SIZE_8KB    0x00002000
+#define  SIZE_16KB   0x00004000
+#define  SIZE_32KB   0x00008000
+#define  SIZE_64KB   0x00010000
+#define  SIZE_128KB  0x00020000
+#define  SIZE_256KB  0x00040000
+#define  SIZE_512KB  0x00080000
+#define  SIZE_1MB    0x00100000
+#define  SIZE_2MB    0x00200000
+#define  SIZE_4MB    0x00400000
+#define  SIZE_8MB    0x00800000
+#define  SIZE_16MB   0x01000000
+#define  SIZE_32MB   0x02000000
+#define  SIZE_64MB   0x04000000
+#define  SIZE_128MB  0x08000000
+#define  SIZE_256MB  0x10000000
+#define  SIZE_512MB  0x20000000
+#define  SIZE_1GB    0x40000000
+#define  SIZE_2GB    0x80000000
+#define  SIZE_4GB    0x0000000100000000ULL
+#define  SIZE_8GB    0x0000000200000000ULL
+#define  SIZE_16GB   0x0000000400000000ULL
+#define  SIZE_32GB   0x0000000800000000ULL
+#define  SIZE_64GB   0x0000001000000000ULL
+#define  SIZE_128GB  0x0000002000000000ULL
+#define  SIZE_256GB  0x0000004000000000ULL
+#define  SIZE_512GB  0x0000008000000000ULL
+#define  SIZE_1TB    0x0000010000000000ULL
+#define  SIZE_2TB    0x0000020000000000ULL
+#define  SIZE_4TB    0x0000040000000000ULL
+#define  SIZE_8TB    0x0000080000000000ULL
+#define  SIZE_16TB   0x0000100000000000ULL
+#define  SIZE_32TB   0x0000200000000000ULL
+#define  SIZE_64TB   0x0000400000000000ULL
+#define  SIZE_128TB  0x0000800000000000ULL
+#define  SIZE_256TB  0x0001000000000000ULL
+#define  SIZE_512TB  0x0002000000000000ULL
+#define  SIZE_1PB    0x0004000000000000ULL
+#define  SIZE_2PB    0x0008000000000000ULL
+#define  SIZE_4PB    0x0010000000000000ULL
+#define  SIZE_8PB    0x0020000000000000ULL
+#define  SIZE_16PB   0x0040000000000000ULL
+#define  SIZE_32PB   0x0080000000000000ULL
+#define  SIZE_64PB   0x0100000000000000ULL
+#define  SIZE_128PB  0x0200000000000000ULL
+#define  SIZE_256PB  0x0400000000000000ULL
+#define  SIZE_512PB  0x0800000000000000ULL
+#define  SIZE_1EB    0x1000000000000000ULL
+#define  SIZE_2EB    0x2000000000000000ULL
+#define  SIZE_4EB    0x4000000000000000ULL
+#define  SIZE_8EB    0x8000000000000000ULL
+
+#define  BASE_1KB    0x00000400
+#define  BASE_2KB    0x00000800
+#define  BASE_4KB    0x00001000
+#define  BASE_8KB    0x00002000
+#define  BASE_16KB   0x00004000
+#define  BASE_32KB   0x00008000
+#define  BASE_64KB   0x00010000
+#define  BASE_128KB  0x00020000
+#define  BASE_256KB  0x00040000
+#define  BASE_512KB  0x00080000
+#define  BASE_1MB    0x00100000
+#define  BASE_2MB    0x00200000
+#define  BASE_4MB    0x00400000
+#define  BASE_8MB    0x00800000
+#define  BASE_16MB   0x01000000
+#define  BASE_32MB   0x02000000
+#define  BASE_64MB   0x04000000
+#define  BASE_128MB  0x08000000
+#define  BASE_256MB  0x10000000
+#define  BASE_512MB  0x20000000
+#define  BASE_1GB    0x40000000
+#define  BASE_2GB    0x80000000
+#define  BASE_4GB    0x0000000100000000ULL
+#define  BASE_8GB    0x0000000200000000ULL
+#define  BASE_16GB   0x0000000400000000ULL
+#define  BASE_32GB   0x0000000800000000ULL
+#define  BASE_64GB   0x0000001000000000ULL
+#define  BASE_128GB  0x0000002000000000ULL
+#define  BASE_256GB  0x0000004000000000ULL
+#define  BASE_512GB  0x0000008000000000ULL
+#define  BASE_1TB    0x0000010000000000ULL
+#define  BASE_2TB    0x0000020000000000ULL
+#define  BASE_4TB    0x0000040000000000ULL
+#define  BASE_8TB    0x0000080000000000ULL
+#define  BASE_16TB   0x0000100000000000ULL
+#define  BASE_32TB   0x0000200000000000ULL
+#define  BASE_64TB   0x0000400000000000ULL
+#define  BASE_128TB  0x0000800000000000ULL
+#define  BASE_256TB  0x0001000000000000ULL
+#define  BASE_512TB  0x0002000000000000ULL
+#define  BASE_1PB    0x0004000000000000ULL
+#define  BASE_2PB    0x0008000000000000ULL
+#define  BASE_4PB    0x0010000000000000ULL
+#define  BASE_8PB    0x0020000000000000ULL
+#define  BASE_16PB   0x0040000000000000ULL
+#define  BASE_32PB   0x0080000000000000ULL
+#define  BASE_64PB   0x0100000000000000ULL
+#define  BASE_128PB  0x0200000000000000ULL
+#define  BASE_256PB  0x0400000000000000ULL
+#define  BASE_512PB  0x0800000000000000ULL
+#define  BASE_1EB    0x1000000000000000ULL
+#define  BASE_2EB    0x2000000000000000ULL
+#define  BASE_4EB    0x4000000000000000ULL
+#define  BASE_8EB    0x8000000000000000ULL
 
 //
 //  Support for variable length argument lists using the ANSI standard.
 //
-//  Since we are using the ANSI standard we used the standard nameing and
-//  did not folow the coding convention
+//  Since we are using the ANSI standard we used the standard naming and
+//  did not follow the coding convention
 //
 //  VA_LIST  - typedef for argument list.
 //  VA_START (VA_LIST Marker, argument before the ...) - Init Marker for use.
 //  VA_END (VA_LIST Marker) - Clear Marker
-//  VA_ARG (VA_LIST Marker, var arg size) - Use Marker to get an argumnet from
+//  VA_ARG (VA_LIST Marker, var arg size) - Use Marker to get an argument from
 //    the ... list. You must know the size and pass it in this macro.
 //
 //  example:
@@ -174,118 +412,490 @@ struct _LIST_ENTRY {
 //  }
 //
 
+/**
+  Return the size of argument that has been aligned to sizeof (UINTN).
+
+  @param  n    The parameter size to be aligned.
+
+  @return The aligned size.
+**/
 #define _INT_SIZE_OF(n) ((sizeof (n) + sizeof (UINTN) - 1) &~(sizeof (UINTN) - 1))
 
+#if defined(__CC_ARM)
 //
-// Also support coding convention rules for var arg macros
+// RVCT ARM variable argument list support.
 //
-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)
 
+///
+/// Variable used to traverse the list of arguments. This type can vary by
+/// implementation and could be an array or structure.
+///
+#ifdef __APCS_ADSABI
+  typedef int         *va_list[1];
+  #define VA_LIST     va_list
+#else
+  typedef struct __va_list { void *__ap; } va_list;
+  #define VA_LIST                          va_list
+#endif
+
+#define VA_START(Marker, Parameter)   __va_start(Marker, Parameter)
+
+#define VA_ARG(Marker, TYPE)          __va_arg(Marker, TYPE)
+
+#define VA_END(Marker)                ((void)0)
+
+#elif defined(__GNUC__) && !defined(NO_BUILTIN_VA_FUNCS)
 //
-// Macro that returns the byte offset of a field in a data structure.
+// Use GCC built-in macros for variable argument lists.
 //
-#define OFFSET_OF(TYPE, Field) ((UINTN) &(((TYPE *)0)->Field))
 
 ///
-///  CONTAINING_RECORD - returns a pointer to the structure
-///      from one of it's elements.
+/// Variable used to traverse the list of arguments. This type can vary by
+/// implementation and could be an array or structure.
 ///
-#define _CR(Record, TYPE, Field)  ((TYPE *) ((CHAR8 *) (Record) - (CHAR8 *) &(((TYPE *) 0)->Field)))
+typedef __builtin_va_list VA_LIST;
+
+#define VA_START(Marker, Parameter)  __builtin_va_start (Marker, Parameter)
 
+#define VA_ARG(Marker, TYPE)         ((sizeof (TYPE) < sizeof (UINTN)) ? (TYPE)(__builtin_va_arg (Marker, UINTN)) : (TYPE)(__builtin_va_arg (Marker, TYPE)))
+
+#define VA_END(Marker)               __builtin_va_end (Marker)
+
+#else
 ///
-///  ALIGN_VALUE - aligns a value up to the next boundary of the given alignment.
+/// Variable used to traverse the list of arguments. This type can vary by
+/// implementation and could be an array or structure.
 ///
-#define ALIGN_VALUE(Value, Alignment) ((Value) + (((Alignment) - (Value)) & ((Alignment) - 1)))
+typedef CHAR8 *VA_LIST;
+
+/**
+  Retrieves a pointer to the beginning of a variable argument list, based on
+  the name of the parameter that immediately precedes the variable argument list.
+
+  This function initializes Marker to point to the beginning of the variable
+  argument list that immediately follows Parameter.  The method for computing the
+  pointer to the next argument in the argument list is CPU-specific following the
+  EFIAPI ABI.
+
+  @param   Marker       The VA_LIST used to traverse the list of arguments.
+  @param   Parameter    The name of the parameter that immediately precedes
+                        the variable argument list.
+
+  @return  A pointer to the beginning of a variable argument list.
+
+**/
+#define VA_START(Marker, Parameter) (Marker = (VA_LIST) & (Parameter) + _INT_SIZE_OF (Parameter))
+
+/**
+  Returns an argument of a specified type from a variable argument list and updates
+  the pointer to the variable argument list to point to the next argument.
+
+  This function returns an argument of the type specified by TYPE from the beginning
+  of the variable argument list specified by Marker.  Marker is then updated to point
+  to the next argument in the variable argument list.  The method for computing the
+  pointer to the next argument in the argument list is CPU-specific following the EFIAPI ABI.
+
+  @param   Marker   VA_LIST used to traverse the list of arguments.
+  @param   TYPE     The type of argument to retrieve from the beginning
+                    of the variable argument list.
+
+  @return  An argument of the type specified by TYPE.
+
+**/
+#define VA_ARG(Marker, TYPE)   (*(TYPE *) ((Marker += _INT_SIZE_OF (TYPE)) - _INT_SIZE_OF (TYPE)))
+
+/**
+  Terminates the use of a variable argument list.
+
+  This function initializes Marker so it can no longer be used with VA_ARG().
+  After this macro is used, the only way to access the variable argument list is
+  by using VA_START() again.
+
+  @param   Marker   VA_LIST used to traverse the list of arguments.
+
+**/
+#define VA_END(Marker)      (Marker = (VA_LIST) 0)
+
+#endif
 
 ///
-///  ALIGN_POINTER - aligns a pointer to the lowest boundry
+/// Pointer to the start of a variable argument list stored in a memory buffer. Same as UINT8 *.
 ///
+typedef UINTN  *BASE_LIST;
+
+/**
+  Returns the size of a data type in sizeof(UINTN) units rounded up to the nearest UINTN boundary.
+
+  @param  TYPE  The date type to determine the size of.
+
+  @return The size of TYPE in sizeof (UINTN) units rounded up to the nearest UINTN boundary.
+**/
+#define _BASE_INT_SIZE_OF(TYPE) ((sizeof (TYPE) + sizeof (UINTN) - 1) / sizeof (UINTN))
+
+/**
+  Returns an argument of a specified type from a variable argument list and updates
+  the pointer to the variable argument list to point to the next argument.
+
+  This function returns an argument of the type specified by TYPE from the beginning
+  of the variable argument list specified by Marker.  Marker is then updated to point
+  to the next argument in the variable argument list.  The method for computing the
+  pointer to the next argument in the argument list is CPU specific following the EFIAPI ABI.
+
+  @param   Marker   The pointer to the beginning of a variable argument list.
+  @param   TYPE     The type of argument to retrieve from the beginning
+                    of the variable argument list.
+
+  @return  An argument of the type specified by TYPE.
+
+**/
+#define BASE_ARG(Marker, TYPE)   (*(TYPE *) ((Marker += _BASE_INT_SIZE_OF (TYPE)) - _BASE_INT_SIZE_OF (TYPE)))
+
+/**
+  The macro that returns the byte offset of a field in a data structure.
+
+  This function returns the offset, in bytes, of field specified by Field from the
+  beginning of the  data structure specified by TYPE. If TYPE does not contain Field,
+  the module will not compile.
+
+  @param   TYPE     The name of the data structure that contains the field specified by Field.
+  @param   Field    The name of the field in the data structure.
+
+  @return  Offset, in bytes, of field.
+
+**/
+#define OFFSET_OF(TYPE, Field) ((UINTN) &(((TYPE *)0)->Field))
+
+/**
+  Macro that returns a pointer to the data structure that contains a specified field of
+  that data structure.  This is a lightweight method to hide information by placing a
+  public data structure inside a larger private data structure and using a pointer to
+  the public data structure to retrieve a pointer to the private data structure.
+
+  This function computes the offset, in bytes, of field specified by Field from the beginning
+  of the  data structure specified by TYPE.  This offset is subtracted from Record, and is
+  used to return a pointer to a data structure of the type specified by TYPE. If the data type
+  specified by TYPE does not contain the field specified by Field, then the module will not compile.
+
+  @param   Record   Pointer to the field specified by Field within a data structure of type TYPE.
+  @param   TYPE     The name of the data structure type to return.  This data structure must
+                    contain the field specified by Field.
+  @param   Field    The name of the field in the data structure specified by TYPE to which Record points.
+
+  @return  A pointer to the structure from one of it's elements.
+
+**/
+#define BASE_CR(Record, TYPE, Field)  ((TYPE *) ((CHAR8 *) (Record) - (CHAR8 *) &(((TYPE *) 0)->Field)))
+
+/**
+  Rounds a value up to the next boundary using a specified alignment.
+
+  This function rounds Value up to the next boundary using the specified Alignment.
+  This aligned value is returned.
+
+  @param   Value      The value to round up.
+  @param   Alignment  The alignment boundary used to return the aligned value.
+
+  @return  A value up to the next boundary.
+
+**/
+#define ALIGN_VALUE(Value, Alignment) ((Value) + (((Alignment) - (Value)) & ((Alignment) - 1)))
+
+/**
+  Adjust a pointer by adding the minimum offset required for it to be aligned on
+  a specified alignment boundary.
+
+  This function rounds the pointer specified by Pointer to the next alignment boundary
+  specified by Alignment. The pointer to the aligned address is returned.
+
+  @param   Pointer    The pointer to round up.
+  @param   Alignment  The alignment boundary to use to return an aligned pointer.
+
+  @return  Pointer to the aligned address.
+
+**/
 #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
-///
+/**
+  Rounds a value up to the next natural boundary for the current CPU.
+  This is 4-bytes for 32-bit CPUs and 8-bytes for 64-bit CPUs.
+
+  This function rounds the value specified by Value up to the next natural boundary for the
+  current CPU. This rounded value is returned.
+
+  @param   Value      The value to round up.
+
+  @return  Rounded value specified by Value.
+
+**/
 #define ALIGN_VARIABLE(Value)  ALIGN_VALUE ((Value), sizeof (UINTN))
 
 
-//
-// Return the maximum of two operands.
-// This macro returns the maximum of two operand specified by a and b.
-// Both a and b must be the same numerical types, signed or unsigned.
-//
+/**
+  Return the maximum of two operands.
+
+  This macro returns the maximum of two operand specified by a and b.
+  Both a and b must be the same numerical types, signed or unsigned.
+
+  @param   a        The first operand with any numerical type.
+  @param   b        The second operand. Can be any numerical type as long as is
+                    the same type as a.
+
+  @return  Maximum of two operands.
+
+**/
 #define MAX(a, b)                       \
   (((a) > (b)) ? (a) : (b))
 
+/**
+  Return the minimum of two operands.
+
+  This macro returns the minimal of two operand specified by a and b.
+  Both a and b must be the same numerical types, signed or unsigned.
+
+  @param   a        The first operand with any numerical type.
+  @param   b        The second operand. It should be the same any numerical type with a.
+
+  @return  Minimum of two operands.
+
+**/
 
-//
-// Return the minimum of two operands.
-// This macro returns the minimal of two operand specified by a and b.
-// Both a and b must be the same numerical types, signed or unsigned.
-//
 #define MIN(a, b)                       \
   (((a) < (b)) ? (a) : (b))
 
-
 //
-// EFI Error Codes common to all execution phases
+// Status codes common to all execution phases
 //
+typedef UINTN RETURN_STATUS;
 
-typedef INTN RETURN_STATUS;
+/**
+  Produces a RETURN_STATUS code with the highest bit set.
 
-///
-/// Set the upper bit to indicate EFI Error.
-///
-#define ENCODE_ERROR(a)              (MAX_BIT | (a))
+  @param  StatusCode    The status code value to convert into a warning code.
+                        StatusCode must be in the range 0x00000000..0x7FFFFFFF.
+
+  @return The value specified by StatusCode with the highest bit set.
+
+**/
+#define ENCODE_ERROR(StatusCode)     ((RETURN_STATUS)(MAX_BIT | (StatusCode)))
+
+/**
+  Produces a RETURN_STATUS code with the highest bit clear.
+
+  @param  StatusCode    The status code value to convert into a warning code.
+                        StatusCode must be in the range 0x00000000..0x7FFFFFFF.
 
-#define ENCODE_WARNING(a)            (a)
-#define RETURN_ERROR(a)              ((INTN) (a) < 0)
+  @return The value specified by StatusCode with the highest bit clear.
+
+**/
+#define ENCODE_WARNING(StatusCode)   ((RETURN_STATUS)(StatusCode))
+
+/**
+  Returns TRUE if a specified RETURN_STATUS code is an error code.
+
+  This function returns TRUE if StatusCode has the high bit set.  Otherwise, FALSE is returned.
+
+  @param  StatusCode    The status code value to evaluate.
+
+  @retval TRUE          The high bit of StatusCode is set.
+  @retval FALSE         The high bit of StatusCode is clear.
+
+**/
+#define RETURN_ERROR(StatusCode)     (((INTN)(RETURN_STATUS)(StatusCode)) < 0)
 
+///
+/// The operation completed successfully.
+///
 #define RETURN_SUCCESS               0
+
+///
+/// The image failed to load.
+///
 #define RETURN_LOAD_ERROR            ENCODE_ERROR (1)
+
+///
+/// The parameter was incorrect.
+///
 #define RETURN_INVALID_PARAMETER     ENCODE_ERROR (2)
+
+///
+/// The operation is not supported.
+///
 #define RETURN_UNSUPPORTED           ENCODE_ERROR (3)
+
+///
+/// The buffer was not the proper size for the request.
+///
 #define RETURN_BAD_BUFFER_SIZE       ENCODE_ERROR (4)
+
+///
+/// The buffer was not large enough to hold the requested data.
+/// The required buffer size is returned in the appropriate
+/// parameter when this error occurs.
+///
 #define RETURN_BUFFER_TOO_SMALL      ENCODE_ERROR (5)
+
+///
+/// There is no data pending upon return.
+///
 #define RETURN_NOT_READY             ENCODE_ERROR (6)
+
+///
+/// The physical device reported an error while attempting the
+/// operation.
+///
 #define RETURN_DEVICE_ERROR          ENCODE_ERROR (7)
+
+///
+/// The device can not be written to.
+///
 #define RETURN_WRITE_PROTECTED       ENCODE_ERROR (8)
+
+///
+/// The resource has run out.
+///
 #define RETURN_OUT_OF_RESOURCES      ENCODE_ERROR (9)
+
+///
+/// An inconsistency was detected on the file system causing the
+/// operation to fail.
+///
 #define RETURN_VOLUME_CORRUPTED      ENCODE_ERROR (10)
+
+///
+/// There is no more space on the file system.
+///
 #define RETURN_VOLUME_FULL           ENCODE_ERROR (11)
+
+///
+/// The device does not contain any medium to perform the
+/// operation.
+///
 #define RETURN_NO_MEDIA              ENCODE_ERROR (12)
+
+///
+/// The medium in the device has changed since the last
+/// access.
+///
 #define RETURN_MEDIA_CHANGED         ENCODE_ERROR (13)
+
+///
+/// The item was not found.
+///
 #define RETURN_NOT_FOUND             ENCODE_ERROR (14)
+
+///
+/// Access was denied.
+///
 #define RETURN_ACCESS_DENIED         ENCODE_ERROR (15)
+
+///
+/// The server was not found or did not respond to the request.
+///
 #define RETURN_NO_RESPONSE           ENCODE_ERROR (16)
+
+///
+/// A mapping to the device does not exist.
+///
 #define RETURN_NO_MAPPING            ENCODE_ERROR (17)
+
+///
+/// A timeout time expired.
+///
 #define RETURN_TIMEOUT               ENCODE_ERROR (18)
+
+///
+/// The protocol has not been started.
+///
 #define RETURN_NOT_STARTED           ENCODE_ERROR (19)
+
+///
+/// The protocol has already been started.
+///
 #define RETURN_ALREADY_STARTED       ENCODE_ERROR (20)
+
+///
+/// The operation was aborted.
+///
 #define RETURN_ABORTED               ENCODE_ERROR (21)
+
+///
+/// An ICMP error occurred during the network operation.
+///
 #define RETURN_ICMP_ERROR            ENCODE_ERROR (22)
+
+///
+/// A TFTP error occurred during the network operation.
+///
 #define RETURN_TFTP_ERROR            ENCODE_ERROR (23)
+
+///
+/// A protocol error occurred during the network operation.
+///
 #define RETURN_PROTOCOL_ERROR        ENCODE_ERROR (24)
+
+///
+/// A function encountered an internal version that was
+/// incompatible with a version requested by the caller.
+///
 #define RETURN_INCOMPATIBLE_VERSION  ENCODE_ERROR (25)
+
+///
+/// The function was not performed due to a security violation.
+///
 #define RETURN_SECURITY_VIOLATION    ENCODE_ERROR (26)
+
+///
+/// A CRC error was detected.
+///
 #define RETURN_CRC_ERROR             ENCODE_ERROR (27)
+
+///
+/// The beginning or end of media was reached.
+///
 #define RETURN_END_OF_MEDIA          ENCODE_ERROR (28)
+
+///
+/// The end of the file was reached.
+///
 #define RETURN_END_OF_FILE           ENCODE_ERROR (31)
+
+///
+/// The language specified was invalid.
+///
 #define RETURN_INVALID_LANGUAGE      ENCODE_ERROR (32)
 
 
+///
+/// The string contained one or more characters that
+/// the device could not render and were skipped.
+///
 #define RETURN_WARN_UNKNOWN_GLYPH    ENCODE_WARNING (1)
+
+///
+/// The handle was closed, but the file was not deleted.
+///
 #define RETURN_WARN_DELETE_FAILURE   ENCODE_WARNING (2)
+
+///
+/// The handle was closed, but the data to the file was not
+/// flushed properly.
+///
 #define RETURN_WARN_WRITE_FAILURE    ENCODE_WARNING (3)
+
+///
+/// The resulting buffer was too small, and the data was
+/// truncated to the buffer size.
+///
 #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.
+  This macro returns a 16-bit value built from the two ASCII characters specified
+  by A and B.
+
+  @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.
 
@@ -295,10 +905,13 @@ typedef INTN RETURN_STATUS;
 /**
   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.
+  This macro returns a 32-bit value built from the four ASCII characters specified
+  by A, B, C, and D.
+
+  @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.
@@ -309,14 +922,17 @@ typedef INTN RETURN_STATUS;
 /**
   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.
+  This macro returns a 64-bit value built from the eight ASCII characters specified
+  by A, B, C, D, E, F, G,and H.
+
+  @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.
diff --git a/src/include/gpxe/efi/Guid/HiiFormMapMethodGuid.h b/src/include/gpxe/efi/Guid/HiiFormMapMethodGuid.h
new file mode 100644
index 0000000..ab508fd
--- /dev/null
+++ b/src/include/gpxe/efi/Guid/HiiFormMapMethodGuid.h
@@ -0,0 +1,25 @@
+/** @file
+  Guid used to identify HII FormMap configuration method.
+
+  Copyright (c) 2009, Intel Corporation. All rights reserved.<BR>
+  This program and the accompanying materials
+  are licensed and made available under the terms and conditions of the BSD License
+  which accompanies this distribution.  The full text of the license may be found at
+  http://opensource.org/licenses/bsd-license.php
+
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+  @par Revision Reference:
+  GUID defined in UEFI 2.2 spec.
+**/
+
+#ifndef __EFI_HII_FORMMAP_GUID_H__
+#define __EFI_HII_FORMMAP_GUID_H__
+
+#define EFI_HII_STANDARD_FORM_GUID \
+  { 0x3bd2f4ec, 0xe524, 0x46e4, { 0xa9, 0xd8, 0x51, 0x1, 0x17, 0x42, 0x55, 0x62 } }
+
+extern EFI_GUID gEfiHiiStandardFormGuid;
+
+#endif
diff --git a/src/include/gpxe/efi/Guid/PcAnsi.h b/src/include/gpxe/efi/Guid/PcAnsi.h
index 1dab310..8f31254 100644
--- a/src/include/gpxe/efi/Guid/PcAnsi.h
+++ b/src/include/gpxe/efi/Guid/PcAnsi.h
@@ -1,8 +1,8 @@
 /** @file
   Terminal Device Path Vendor Guid.
 
-  Copyright (c) 2006, Intel Corporation
-  All rights reserved. This program and the accompanying materials
+  Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>
+  This program and the accompanying materials
   are licensed and made available under the terms and conditions of the BSD License
   which accompanies this distribution.  The full text of the license may be found at
   http://opensource.org/licenses/bsd-license.php
@@ -38,7 +38,7 @@
     0xad15a0d6, 0x8bec, 0x4acf, {0xa0, 0x73, 0xd0, 0x1d, 0xe7, 0x7e, 0x2d, 0x88 } \
   }
 
-#define EFI_UART_DEVICE_PATH_GUID \
+#define DEVICE_PATH_MESSAGING_UART_FLOW_CONTROL \
   { \
     0x37499a9d, 0x542f, 0x4c89, {0xa0, 0x26, 0x35, 0xda, 0x14, 0x20, 0x94, 0xe4 } \
   }
diff --git a/src/include/gpxe/efi/Guid/SmBios.h b/src/include/gpxe/efi/Guid/SmBios.h
index c6c7f77..4bda1f3 100644
--- a/src/include/gpxe/efi/Guid/SmBios.h
+++ b/src/include/gpxe/efi/Guid/SmBios.h
@@ -5,8 +5,8 @@
   locate the SMBIOS tables. Do not search the 0xF0000 segment to find SMBIOS
   tables.
 
-  Copyright (c) 2006, Intel Corporation
-  All rights reserved. This program and the accompanying materials
+  Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>
+  This program and the accompanying materials
   are licensed and made available under the terms and conditions of the BSD License
   which accompanies this distribution.  The full text of the license may be found at
   http://opensource.org/licenses/bsd-license.php
@@ -22,13 +22,11 @@
 #ifndef __SMBIOS_GUID_H__
 #define __SMBIOS_GUID_H__
 
-#define EFI_SMBIOS_TABLE_GUID \
+#define SMBIOS_TABLE_GUID \
   { \
     0xeb9d2d31, 0x2d88, 0x11d3, {0x9a, 0x16, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d } \
   }
 
-#define SMBIOS_TABLE_GUID EFI_SMBIOS_TABLE_GUID
-
 extern EFI_GUID       gEfiSmbiosTableGuid;
 
 #endif
diff --git a/src/include/gpxe/efi/Guid/WinCertificate.h b/src/include/gpxe/efi/Guid/WinCertificate.h
new file mode 100644
index 0000000..3f91b12
--- /dev/null
+++ b/src/include/gpxe/efi/Guid/WinCertificate.h
@@ -0,0 +1,128 @@
+/** @file
+  GUID for UEFI WIN_CERTIFICATE structure.
+
+  Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
+  This program and the accompanying materials
+  are licensed and made available under the terms and conditions of the BSD License
+  which accompanies this distribution.  The full text of the license may be found at
+  http://opensource.org/licenses/bsd-license.php
+
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+  @par Revision Reference:
+  GUID defined in UEFI 2.0 spec.
+**/
+
+#ifndef __EFI_WIN_CERTIFICATE_H__
+#define __EFI_WIN_CERTIFICATE_H__
+
+//
+// _WIN_CERTIFICATE.wCertificateType
+//
+#define WIN_CERT_TYPE_PKCS_SIGNED_DATA 0x0002
+#define WIN_CERT_TYPE_EFI_PKCS115      0x0EF0
+#define WIN_CERT_TYPE_EFI_GUID         0x0EF1
+
+///
+/// The WIN_CERTIFICATE structure is part of the PE/COFF specification.
+///
+typedef struct {
+  ///
+  /// The length of the entire certificate,
+  /// including the length of the header, in bytes.
+  ///
+  UINT32  dwLength;
+  ///
+  /// The revision level of the WIN_CERTIFICATE
+  /// structure. The current revision level is 0x0200.
+  ///
+  UINT16  wRevision;
+  ///
+  /// The certificate type. See WIN_CERT_TYPE_xxx for the UEFI
+  /// certificate types. The UEFI specification reserves the range of
+  /// certificate type values from 0x0EF0 to 0x0EFF.
+  ///
+  UINT16  wCertificateType;
+  ///
+  /// The following is the actual certificate. The format of
+  /// the certificate depends on wCertificateType.
+  ///
+  /// UINT8 bCertificate[ANYSIZE_ARRAY];
+  ///
+} WIN_CERTIFICATE;
+
+///
+/// WIN_CERTIFICATE_UEFI_GUID.CertType
+///
+#define EFI_CERT_TYPE_RSA2048_SHA256_GUID \
+  {0xa7717414, 0xc616, 0x4977, {0x94, 0x20, 0x84, 0x47, 0x12, 0xa7, 0x35, 0xbf } }
+
+///
+/// WIN_CERTIFICATE_UEFI_GUID.CertData
+///
+typedef struct {
+  EFI_GUID  HashType;
+  UINT8     PublicKey[256];
+  UINT8     Signature[256];
+} EFI_CERT_BLOCK_RSA_2048_SHA256;
+
+
+///
+/// Certificate which encapsulates a GUID-specific digital signature
+///
+typedef struct {
+  ///
+  /// 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. .
+  ///
+  EFI_GUID          CertType;
+  ///
+  /// The following is the certificate data. The format of
+  /// the data is determined by the CertType.
+  /// If CertType is EFI_CERT_TYPE_RSA2048_SHA256_GUID,
+  /// the CertData will be EFI_CERT_BLOCK_RSA_2048_SHA256 structure.
+  ///
+  UINT8            CertData[1];
+} WIN_CERTIFICATE_UEFI_GUID;
+
+
+///
+/// Certificate which encapsulates the RSASSA_PKCS1-v1_5 digital signature.
+///
+/// The WIN_CERTIFICATE_UEFI_PKCS1_15 structure is derived from
+/// WIN_CERTIFICATE and encapsulate the information needed to
+/// implement the RSASSA-PKCS1-v1_5 digital signature algorithm as
+/// specified in RFC2437.
+///
+typedef struct {
+  ///
+  /// This is the standard WIN_CERTIFICATE header, where
+  /// wCertificateType is set to WIN_CERT_TYPE_UEFI_PKCS1_15.
+  ///
+  WIN_CERTIFICATE Hdr;
+  ///
+  /// This is the hashing algorithm which was performed on the
+  /// UEFI executable when creating the digital signature.
+  ///
+  EFI_GUID        HashAlgorithm;
+  ///
+  /// The following is the actual digital signature. The
+  /// size of the signature is the same size as the key
+  /// (1024-bit key is 128 bytes) and can be determined by
+  /// subtracting the length of the other parts of this header
+  /// from the total length of the certificate as found in
+  /// Hdr.dwLength.
+  ///
+  /// UINT8 Signature[];
+  ///
+} WIN_CERTIFICATE_EFI_PKCS1_15;
+
+extern EFI_GUID gEfiCertTypeRsa2048Sha256Guid;
+
+#endif
diff --git a/src/include/gpxe/efi/Ia32/ProcessorBind.h b/src/include/gpxe/efi/Ia32/ProcessorBind.h
index 5a3a918..38de245 100644
--- a/src/include/gpxe/efi/Ia32/ProcessorBind.h
+++ b/src/include/gpxe/efi/Ia32/ProcessorBind.h
@@ -1,14 +1,14 @@
 /** @file
-  Processor or Compiler specific defines and types for Ia32 architecture.
+  Processor or Compiler specific defines and types for IA-32 architecture.
 
-  Copyright (c) 2006, Intel Corporation
-  All rights reserved. This program and the accompanying materials
-  are licensed and made available under the terms and conditions of the BSD License
-  which accompanies this distribution.  The full text of the license may be found at
-  http://opensource.org/licenses/bsd-license.php
+Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
+This program and the accompanying materials are licensed and made available under
+the terms and conditions of the BSD License that accompanies this distribution.
+The full text of the license may be found at
+http://opensource.org/licenses/bsd-license.php.
 
-  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 
 **/
 
@@ -16,18 +16,18 @@
 #define __PROCESSOR_BIND_H__
 
 ///
-/// Define the processor type so other code can make processor based choices
+/// Define the processor type so other code can make processor based choices.
 ///
 #define MDE_CPU_IA32
 
 //
-// Make sure we are useing the correct packing rules per EFI specification
+// Make sure we are using the correct packing rules per EFI specification
 //
-#ifndef __GNUC__
+#if !defined(__GNUC__)
 #pragma pack()
 #endif
 
-#if __INTEL_COMPILER
+#if defined(__INTEL_COMPILER)
 //
 // 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
@@ -46,10 +46,16 @@
 //
 #pragma warning ( disable : 1419 )
 
+//
+// Disable ICC's remark #593: "Variable" was set but never used.
+// This is legal ANSI C code so we disable the remark that is turned on with /W4
+//
+#pragma warning ( disable : 593 )
+
 #endif
 
 
-#if _MSC_EXTENSIONS
+#if defined(_MSC_EXTENSIONS)
 
 //
 // Disable warning that make it impossible to compile at /W4
@@ -83,133 +89,190 @@
 #pragma warning ( disable : 4505 )
 
 //
-// This warning is caused by empty (after preprocessing) souce file. For precompiled header only.
+// This warning is caused by empty (after preprocessing) source file. For precompiled header only.
 //
 #pragma warning ( disable : 4206 )
 
 #endif
 
 
-#if !defined(__GNUC__) && (__STDC_VERSION__ < 199901L)
-  //
-  // No ANSI C 2000 stdint.h integer width declarations, so define equivalents
-  //
-
-  #if _MSC_EXTENSIONS
-
-    //
-    // use Microsoft* C complier dependent interger width types
-    //
-    typedef unsigned __int64    UINT64;
-    typedef __int64             INT64;
-    typedef unsigned __int32    UINT32;
-    typedef __int32             INT32;
-    typedef unsigned short      UINT16;
-    typedef unsigned short      CHAR16;
-    typedef short               INT16;
-    typedef unsigned char       BOOLEAN;
-    typedef unsigned char       UINT8;
-    typedef char                CHAR8;
-    typedef char                INT8;
-  #else
-
-    //
-    // Assume standard IA-32 alignment.
-    // Need to check portability of long long
-    //
-    typedef unsigned long long  UINT64;
-    typedef long long           INT64;
-    typedef unsigned int        UINT32;
-    typedef int                 INT32;
-    typedef unsigned short      UINT16;
-    typedef unsigned short      CHAR16;
-    typedef short               INT16;
-    typedef unsigned char       BOOLEAN;
-    typedef unsigned char       UINT8;
-    typedef char                CHAR8;
-    typedef char                INT8;
-  #endif
+#if defined(_MSC_EXTENSIONS)
 
-  #define UINT8_MAX 0xff
-
-#else
   //
-  // Use ANSI C 2000 stdint.h integer width declarations
+  // use Microsoft C complier dependent integer width types
   //
-  #include "stdint.h"
-  typedef uint8_t   BOOLEAN;
-  typedef int8_t    INT8;
-  typedef uint8_t   UINT8;
-  typedef int16_t   INT16;
-  typedef uint16_t  UINT16;
-  typedef int32_t   INT32;
-  typedef uint32_t  UINT32;
-  typedef int64_t   INT64;
-  typedef uint64_t  UINT64;
-  typedef char      CHAR8;
-  typedef uint16_t  CHAR16;
 
+  ///
+  /// 8-byte unsigned value.
+  ///
+  typedef unsigned __int64    UINT64;
+  ///
+  /// 8-byte signed value.
+  ///
+  typedef __int64             INT64;
+  ///
+  /// 4-byte unsigned value.
+  ///
+  typedef unsigned __int32    UINT32;
+  ///
+  /// 4-byte signed value.
+  ///
+  typedef __int32             INT32;
+  ///
+  /// 2-byte unsigned value.
+  ///
+  typedef unsigned short      UINT16;
+  ///
+  /// 2-byte Character.  Unless otherwise specified all strings are stored in the
+  /// UTF-16 encoding format as defined by Unicode 2.1 and ISO/IEC 10646 standards.
+  ///
+  typedef unsigned short      CHAR16;
+  ///
+  /// 2-byte signed value.
+  ///
+  typedef short               INT16;
+  ///
+  /// Logical Boolean.  1-byte value containing 0 for FALSE or a 1 for TRUE.  Other
+  /// values are undefined.
+  ///
+  typedef unsigned char       BOOLEAN;
+  ///
+  /// 1-byte unsigned value.
+  ///
+  typedef unsigned char       UINT8;
+  ///
+  /// 1-byte Character.
+  ///
+  typedef char                CHAR8;
+  ///
+  /// 1-byte signed value.
+  ///
+  typedef char                INT8;
+#else
+  ///
+  /// 8-byte unsigned value.
+  ///
+  typedef unsigned long long  UINT64;
+  ///
+  /// 8-byte signed value.
+  ///
+  typedef long long           INT64;
+  ///
+  /// 4-byte unsigned value.
+  ///
+  typedef unsigned int        UINT32;
+  ///
+  /// 4-byte signed value.
+  ///
+  typedef int                 INT32;
+  ///
+  /// 2-byte unsigned value.
+  ///
+  typedef unsigned short      UINT16;
+  ///
+  /// 2-byte Character.  Unless otherwise specified all strings are stored in the
+  /// UTF-16 encoding format as defined by Unicode 2.1 and ISO/IEC 10646 standards.
+  ///
+  typedef unsigned short      CHAR16;
+  ///
+  /// 2-byte signed value.
+  ///
+  typedef short               INT16;
+  ///
+  /// Logical Boolean.  1-byte value containing 0 for FALSE or a 1 for TRUE.  Other
+  /// values are undefined.
+  ///
+  typedef unsigned char       BOOLEAN;
+  ///
+  /// 1-byte unsigned value.
+  ///
+  typedef unsigned char       UINT8;
+  ///
+  /// 1-byte Character
+  ///
+  typedef char                CHAR8;
+  ///
+  /// 1-byte signed value
+  ///
+  typedef char                INT8;
 #endif
 
+///
+/// Unsigned value of native width.  (4 bytes on supported 32-bit processor instructions;
+/// 8 bytes on supported 64-bit processor instructions.)
+///
 typedef UINT32  UINTN;
+///
+/// Signed value of native width.  (4 bytes on supported 32-bit processor instructions;
+/// 8 bytes on supported 64-bit processor instructions.)
+///
 typedef INT32   INTN;
 
+//
+// Processor specific defines
+//
 
 ///
-/// Processor specific defines
+/// A value of native width with the highest bit set.
 ///
 #define MAX_BIT     0x80000000
+///
+/// A value of native width with the two highest bits set.
+///
 #define MAX_2_BITS  0xC0000000
 
 ///
-/// Maximum legal IA-32 address
+/// Maximum legal IA-32 address.
 ///
 #define MAX_ADDRESS   0xFFFFFFFF
 
 ///
-/// The stack alignment required for IA-32
+/// The stack alignment required for IA-32.
 ///
 #define CPU_STACK_ALIGNMENT   sizeof(UINTN)
 
 //
 // Modifier to ensure that all protocol member functions and EFI intrinsics
 // use the correct C calling convention. All protocol member functions and
-// EFI intrinsics are required to modify thier member functions with EFIAPI.
+// EFI intrinsics are required to modify their member functions with EFIAPI.
 //
-#if _MSC_EXTENSIONS
+#ifdef EFIAPI
   ///
-  /// Microsoft* compiler requires _EFIAPI useage, __cdecl is Microsoft* specific C.
+  /// If EFIAPI is already defined, then we use that definition.
+  ///
+#elif defined(_MSC_EXTENSIONS)
+  ///
+  /// Microsoft* compiler specific method for EFIAPI calling convention.
   ///
   #define EFIAPI __cdecl
 #else
-  #if __GNUC__
-    #define EFIAPI __attribute__((cdecl,regparm(0)))
+  #if defined(__GNUC__)
+    ///
+    /// GCC specific method for EFIAPI calling convention.
+    ///
+    #define EFIAPI __attribute__((cdecl))
   #endif
 #endif
 
-//
-// The Microsoft* C compiler can removed references to unreferenced data items
-//  if the /OPT:REF linker option is used. We defined a macro as this is a
-//  a non standard extension
-//
-#if _MSC_EXTENSIONS
-  #define GLOBAL_REMOVE_IF_UNREFERENCED __declspec(selectany)
-#else
-  #define GLOBAL_REMOVE_IF_UNREFERENCED
+#if defined(__GNUC__)
+  ///
+  /// For GNU assembly code, .global or .globl can declare global symbols.
+  /// Define this macro to unify the usage.
+  ///
+  #define ASM_GLOBAL .globl
 #endif
 
-//
-// For symbol name in GNU assembly code, an extra "_" is necessary
-//
-#if __GNUC__
-  #if defined(linux)
-    #define ASM_PFX(name) name
-  #else
-    #define ASM_PFX(name) _##name
-  #endif
-#endif
+/**
+  Return the pointer to the first instruction of a function given a function pointer.
+  On IA-32 CPU architectures, these two pointer values are the same,
+  so the implementation of this macro is very simple.
+
+  @param  FunctionPointer   A pointer to a function.
 
-#define FUNCTION_ENTRY_POINT(p) (p)
+  @return The pointer to the first instruction of a function given a function pointer.
+
+**/
+#define FUNCTION_ENTRY_POINT(FunctionPointer) (VOID *)(UINTN)(FunctionPointer)
 
 #endif
 
diff --git a/src/include/gpxe/efi/IndustryStandard/Pci22.h b/src/include/gpxe/efi/IndustryStandard/Pci22.h
index 5b96a56..62f0a26 100644
--- a/src/include/gpxe/efi/IndustryStandard/Pci22.h
+++ b/src/include/gpxe/efi/IndustryStandard/Pci22.h
@@ -2,12 +2,12 @@
   Support for PCI 2.2 standard.
 
   This file includes the definitions in the following specifications,
-    PCI Local Bus Specification, 2.0
-    PCI-to-PCI Bridge Architecture Specification,
+    PCI Local Bus Specification, 2.2
+    PCI-to-PCI Bridge Architecture Specification, Revision 1.2
     PC Card Standard, 8.0
 
-  Copyright (c) 2006 - 2008, Intel Corporation
-  All rights reserved. This program and the accompanying materials
+  Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>
+  This program and the accompanying materials
   are licensed and made available under the terms and conditions of the BSD License
   which accompanies this distribution.  The full text of the license may be found at
   http://opensource.org/licenses/bsd-license.php
@@ -20,13 +20,16 @@
 #ifndef _PCI22_H_
 #define _PCI22_H_
 
-#define PCI_MAX_SEGMENT 0
 #define PCI_MAX_BUS     255
 #define PCI_MAX_DEVICE  31
 #define PCI_MAX_FUNC    7
 
-
 #pragma pack(1)
+
+///
+/// Common header region in PCI Configuration Space
+/// Section 6.1, PCI Local Bus Specification, 2.2
+///
 typedef struct {
   UINT16  VendorId;
   UINT16  DeviceId;
@@ -40,6 +43,10 @@ typedef struct {
   UINT8   BIST;
 } PCI_DEVICE_INDEPENDENT_REGION;
 
+///
+/// PCI Device header region in PCI Configuration Space
+/// Section 6.1, PCI Local Bus Specification, 2.2
+///
 typedef struct {
   UINT32  Bar[6];
   UINT32  CISPtr;
@@ -55,13 +62,18 @@ typedef struct {
   UINT8   MaxLat;
 } PCI_DEVICE_HEADER_TYPE_REGION;
 
+///
+/// PCI Device Configuration Space
+/// Section 6.1, PCI Local Bus Specification, 2.2
+///
 typedef struct {
   PCI_DEVICE_INDEPENDENT_REGION Hdr;
   PCI_DEVICE_HEADER_TYPE_REGION Device;
 } PCI_TYPE00;
 
 ///
-/// defined in PCI-to-PCI Bridge Architecture Specification
+/// PCI-PCI Bridge header region in PCI Configuration Space
+/// Section 3.2, PCI-PCI Bridge Architecture, Version 1.2
 ///
 typedef struct {
   UINT32  Bar[2];
@@ -88,6 +100,10 @@ typedef struct {
   UINT16  BridgeControl;
 } PCI_BRIDGE_CONTROL_REGISTER;
 
+///
+/// PCI-to-PCI Bridge Configuration Space
+/// Section 3.2, PCI-PCI Bridge Architecture, Version 1.2
+///
 typedef struct {
   PCI_DEVICE_INDEPENDENT_REGION Hdr;
   PCI_BRIDGE_CONTROL_REGISTER   Bridge;
@@ -99,7 +115,8 @@ typedef union {
 } PCI_TYPE_GENERIC;
 
 ///
-/// CardBus Conroller Configuration Space, defined in PC Card Standard. 8.0
+/// CardBus Conroller Configuration Space,
+/// Section 4.5.1, PC Card Standard. 8.0
 ///
 typedef struct {
   UINT32  CardBusSocketReg;     ///< Cardus Socket/ExCA Base
@@ -123,9 +140,9 @@ typedef struct {
   UINT16  BridgeControl;        ///< Bridge Control
 } PCI_CARDBUS_CONTROL_REGISTER;
 
-///
-/// Definitions of PCI class bytes and manipulation macros.
-///
+//
+// Definitions of PCI class bytes and manipulation macros.
+//
 #define PCI_CLASS_OLD                 0x00
 #define   PCI_CLASS_OLD_OTHER           0x00
 #define   PCI_CLASS_OLD_VGA             0x01
@@ -153,7 +170,6 @@ typedef struct {
 #define   PCI_CLASS_DISPLAY_XGA         0x01
 #define   PCI_CLASS_DISPLAY_3D          0x02
 #define   PCI_CLASS_DISPLAY_OTHER       0x80
-#define   PCI_CLASS_DISPLAY_GFX         0x80
 
 #define PCI_CLASS_MEDIA               0x04
 #define   PCI_CLASS_MEDIA_VIDEO         0x00
@@ -284,23 +300,172 @@ typedef struct {
 #define   PCI_SUBCLASS_DPIO             0x00
 #define   PCI_SUBCLASS_DPIO_OTHER       0x80
 
+/**
+  Macro that checks whether the Base Class code of device matched.
+
+  @param  _p      Specified device.
+  @param  c       Base Class code needs matching.
+
+  @retval TRUE    Base Class code matches the specified device.
+  @retval FALSE   Base Class code doesn't match the specified device.
+
+**/
 #define IS_CLASS1(_p, c)              ((_p)->Hdr.ClassCode[2] == (c))
+/**
+  Macro that checks whether the Base Class code and Sub-Class code of device matched.
+
+  @param  _p      Specified device.
+  @param  c       Base Class code needs matching.
+  @param  s       Sub-Class code needs matching.
+
+  @retval TRUE    Base Class code and Sub-Class code match the specified device.
+  @retval FALSE   Base Class code and Sub-Class code don't match the specified device.
+
+**/
 #define IS_CLASS2(_p, c, s)           (IS_CLASS1 (_p, c) && ((_p)->Hdr.ClassCode[1] == (s)))
+/**
+  Macro that checks whether the Base Class code, Sub-Class code and Interface code of device matched.
+
+  @param  _p      Specified device.
+  @param  c       Base Class code needs matching.
+  @param  s       Sub-Class code needs matching.
+  @param  p       Interface code needs matching.
+
+  @retval TRUE    Base Class code, Sub-Class code and Interface code match the specified device.
+  @retval FALSE   Base Class code, Sub-Class code and Interface code don't match the specified device.
+
+**/
 #define IS_CLASS3(_p, c, s, p)        (IS_CLASS2 (_p, c, s) && ((_p)->Hdr.ClassCode[0] == (p)))
 
+/**
+  Macro that checks whether device is a display controller.
+
+  @param  _p      Specified device.
+
+  @retval TRUE    Device is a display controller.
+  @retval FALSE   Device is not a display controller.
+
+**/
 #define IS_PCI_DISPLAY(_p)            IS_CLASS1 (_p, PCI_CLASS_DISPLAY)
-#define IS_PCI_VGA(_p)                IS_CLASS3 (_p, PCI_CLASS_DISPLAY, PCI_CLASS_DISPLAY_VGA, 0)
-#define IS_PCI_8514(_p)               IS_CLASS3 (_p, PCI_CLASS_DISPLAY, PCI_CLASS_DISPLAY_VGA, 1)
-#define IS_PCI_GFX(_p)                IS_CLASS3 (_p, PCI_CLASS_DISPLAY, PCI_CLASS_DISPLAY_GFX, 0)
+/**
+  Macro that checks whether device is a VGA-compatible controller.
+
+  @param  _p      Specified device.
+
+  @retval TRUE    Device is a VGA-compatible controller.
+  @retval FALSE   Device is not a VGA-compatible controller.
+
+**/
+#define IS_PCI_VGA(_p)                IS_CLASS3 (_p, PCI_CLASS_DISPLAY, PCI_CLASS_DISPLAY_VGA, PCI_IF_VGA_VGA)
+/**
+  Macro that checks whether device is an 8514-compatible controller.
+
+  @param  _p      Specified device.
+
+  @retval TRUE    Device is an 8514-compatible controller.
+  @retval FALSE   Device is not an 8514-compatible controller.
+
+**/
+#define IS_PCI_8514(_p)               IS_CLASS3 (_p, PCI_CLASS_DISPLAY, PCI_CLASS_DISPLAY_VGA, PCI_IF_VGA_8514)
+/**
+  Macro that checks whether device is built before the Class Code field was defined.
+
+  @param  _p      Specified device.
+
+  @retval TRUE    Device is an old device.
+  @retval FALSE   Device is not an old device.
+
+**/
 #define IS_PCI_OLD(_p)                IS_CLASS1 (_p, PCI_CLASS_OLD)
+/**
+  Macro that checks whether device is a VGA-compatible device built before the Class Code field was defined.
+
+  @param  _p      Specified device.
+
+  @retval TRUE    Device is an old VGA-compatible device.
+  @retval FALSE   Device is not an old VGA-compatible device.
+
+**/
 #define IS_PCI_OLD_VGA(_p)            IS_CLASS2 (_p, PCI_CLASS_OLD, PCI_CLASS_OLD_VGA)
+/**
+  Macro that checks whether device is an IDE controller.
+
+  @param  _p      Specified device.
+
+  @retval TRUE    Device is an IDE controller.
+  @retval FALSE   Device is not an IDE controller.
+
+**/
 #define IS_PCI_IDE(_p)                IS_CLASS2 (_p, PCI_CLASS_MASS_STORAGE, PCI_CLASS_MASS_STORAGE_IDE)
-#define IS_PCI_SCSI(_p)               IS_CLASS3 (_p, PCI_CLASS_MASS_STORAGE, PCI_CLASS_MASS_STORAGE_SCSI, 0)
-#define IS_PCI_RAID(_p)               IS_CLASS3 (_p, PCI_CLASS_MASS_STORAGE, PCI_CLASS_MASS_STORAGE_RAID, 0)
-#define IS_PCI_LPC(_p)                IS_CLASS3 (_p, PCI_CLASS_BRIDGE, PCI_CLASS_BRIDGE_ISA, 0)
-#define IS_PCI_P2P(_p)                IS_CLASS3 (_p, PCI_CLASS_BRIDGE, PCI_CLASS_BRIDGE_P2P, 0)
-#define IS_PCI_P2P_SUB(_p)            IS_CLASS3 (_p, PCI_CLASS_BRIDGE, PCI_CLASS_BRIDGE_P2P, 1)
+/**
+  Macro that checks whether device is a SCSI bus controller.
+
+  @param  _p      Specified device.
+
+  @retval TRUE    Device is a SCSI bus controller.
+  @retval FALSE   Device is not a SCSI bus controller.
+
+**/
+#define IS_PCI_SCSI(_p)               IS_CLASS2 (_p, PCI_CLASS_MASS_STORAGE, PCI_CLASS_MASS_STORAGE_SCSI)
+/**
+  Macro that checks whether device is a RAID controller.
+
+  @param  _p      Specified device.
+
+  @retval TRUE    Device is a RAID controller.
+  @retval FALSE   Device is not a RAID controller.
+
+**/
+#define IS_PCI_RAID(_p)               IS_CLASS2 (_p, PCI_CLASS_MASS_STORAGE, PCI_CLASS_MASS_STORAGE_RAID)
+/**
+  Macro that checks whether device is an ISA bridge.
+
+  @param  _p      Specified device.
+
+  @retval TRUE    Device is an ISA bridge.
+  @retval FALSE   Device is not an ISA bridge.
+
+**/
+#define IS_PCI_LPC(_p)                IS_CLASS2 (_p, PCI_CLASS_BRIDGE, PCI_CLASS_BRIDGE_ISA)
+/**
+  Macro that checks whether device is a PCI-to-PCI bridge.
+
+  @param  _p      Specified device.
+
+  @retval TRUE    Device is a PCI-to-PCI bridge.
+  @retval FALSE   Device is not a PCI-to-PCI bridge.
+
+**/
+#define IS_PCI_P2P(_p)                IS_CLASS3 (_p, PCI_CLASS_BRIDGE, PCI_CLASS_BRIDGE_P2P, PCI_IF_BRIDGE_P2P)
+/**
+  Macro that checks whether device is a Subtractive Decode PCI-to-PCI bridge.
+
+  @param  _p      Specified device.
+
+  @retval TRUE    Device is a Subtractive Decode PCI-to-PCI bridge.
+  @retval FALSE   Device is not a Subtractive Decode PCI-to-PCI bridge.
+
+**/
+#define IS_PCI_P2P_SUB(_p)            IS_CLASS3 (_p, PCI_CLASS_BRIDGE, PCI_CLASS_BRIDGE_P2P, PCI_IF_BRIDGE_P2P_SUBTRACTIVE)
+/**
+  Macro that checks whether device is a 16550-compatible serial controller.
+
+  @param  _p      Specified device.
+
+  @retval TRUE    Device is a 16550-compatible serial controller.
+  @retval FALSE   Device is not a 16550-compatible serial controller.
+
+**/
 #define IS_PCI_16550_SERIAL(_p)       IS_CLASS3 (_p, PCI_CLASS_SCC, PCI_SUBCLASS_SERIAL, PCI_IF_16550)
+/**
+  Macro that checks whether device is a Universal Serial Bus controller.
+
+  @param  _p      Specified device.
+
+  @retval TRUE    Device is a Universal Serial Bus controller.
+  @retval FALSE   Device is not a Universal Serial Bus controller.
+
+**/
 #define IS_PCI_USB(_p)                IS_CLASS2 (_p, PCI_CLASS_SERIAL, PCI_CLASS_SERIAL_USB)
 
 //
@@ -314,9 +479,35 @@ typedef struct {
 // Mask of Header type
 //
 #define HEADER_LAYOUT_CODE            0x7f
+/**
+  Macro that checks whether device is a PCI-PCI bridge.
+
+  @param  _p      Specified device.
+
+  @retval TRUE    Device is a PCI-PCI bridge.
+  @retval FALSE   Device is not a PCI-PCI bridge.
 
+**/
 #define IS_PCI_BRIDGE(_p)             (((_p)->Hdr.HeaderType & HEADER_LAYOUT_CODE) == (HEADER_TYPE_PCI_TO_PCI_BRIDGE))
+/**
+  Macro that checks whether device is a CardBus bridge.
+
+  @param  _p      Specified device.
+
+  @retval TRUE    Device is a CardBus bridge.
+  @retval FALSE   Device is not a CardBus bridge.
+
+**/
 #define IS_CARDBUS_BRIDGE(_p)         (((_p)->Hdr.HeaderType & HEADER_LAYOUT_CODE) == (HEADER_TYPE_CARDBUS_BRIDGE))
+/**
+  Macro that checks whether device is a multiple functions device.
+
+  @param  _p      Specified device.
+
+  @retval TRUE    Device is a multiple functions device.
+  @retval FALSE   Device is not a multiple functions device.
+
+**/
 #define IS_PCI_MULTI_FUNC(_p)         ((_p)->Hdr.HeaderType & HEADER_TYPE_MULTI_FUNCTION)
 
 ///
@@ -350,9 +541,9 @@ typedef struct {
 #define PCI_MAXGNT_OFFSET                           0x3E ///< Max Grant Register
 #define PCI_MAXLAT_OFFSET                           0x3F ///< Max Latency Register
 
-///
-/// defined in PCI-to-PCI Bridge Architecture Specification
-///
+//
+// defined in PCI-to-PCI Bridge Architecture Specification
+//
 #define PCI_BRIDGE_PRIMARY_BUS_REGISTER_OFFSET      0x18
 #define PCI_BRIDGE_SECONDARY_BUS_REGISTER_OFFSET    0x19
 #define PCI_BRIDGE_SUBORDINATE_BUS_REGISTER_OFFSET  0x1a
@@ -364,6 +555,9 @@ typedef struct {
 ///
 #define PCI_INT_LINE_UNKNOWN                        0xFF
 
+///
+/// PCI Access Data Format
+///
 typedef union {
   struct {
     UINT32  Reg : 8;
@@ -389,9 +583,9 @@ typedef union {
 #define EFI_PCI_COMMAND_SERR                            BIT8   ///< 0x0100
 #define EFI_PCI_COMMAND_FAST_BACK_TO_BACK               BIT9   ///< 0x0200
 
-///
-/// defined in PCI-to-PCI Bridge Architecture Specification
-///
+//
+// defined in PCI-to-PCI Bridge Architecture Specification
+//
 #define EFI_PCI_BRIDGE_CONTROL_PARITY_ERROR_RESPONSE    BIT0   ///< 0x0001
 #define EFI_PCI_BRIDGE_CONTROL_SERR                     BIT1   ///< 0x0002
 #define EFI_PCI_BRIDGE_CONTROL_ISA                      BIT2   ///< 0x0004
@@ -405,9 +599,9 @@ typedef union {
 #define EFI_PCI_BRIDGE_CONTROL_TIMER_STATUS             BIT10  ///< 0x0400
 #define EFI_PCI_BRIDGE_CONTROL_DISCARD_TIMER_SERR       BIT11  ///< 0x0800
 
-///
-/// Following are the PCI-CARDBUS bridge control bit, defined in PC Card Standard
-///
+//
+// Following are the PCI-CARDBUS bridge control bit, defined in PC Card Standard
+//
 #define EFI_PCI_BRIDGE_CONTROL_IREQINT_ENABLE           BIT7   ///< 0x0080
 #define EFI_PCI_BRIDGE_CONTROL_RANGE0_MEMORY_TYPE       BIT8   ///< 0x0100
 #define EFI_PCI_BRIDGE_CONTROL_RANGE1_MEMORY_TYPE       BIT9   ///< 0x0200
@@ -436,13 +630,19 @@ typedef union {
 #define EFI_PCI_CAPABILITY_ID_SLOTID  0x04
 #define EFI_PCI_CAPABILITY_ID_MSI     0x05
 #define EFI_PCI_CAPABILITY_ID_HOTPLUG 0x06
+
+///
+/// Capabilities List Header
+/// Section 6.7, PCI Local Bus Specification, 2.2
+///
 typedef struct {
   UINT8 CapabilityID;
   UINT8 NextItemPtr;
 } EFI_PCI_CAPABILITY_HDR;
 
 ///
-/// Capability EFI_PCI_CAPABILITY_ID_PMI, defined in PCI Power Management Interface Specifiction
+/// Power Management Register Block Definition
+/// Section 3.2, PCI Power Management Interface Specifiction, Revision 1.2
 ///
 typedef struct {
   EFI_PCI_CAPABILITY_HDR  Hdr;
@@ -453,7 +653,8 @@ typedef struct {
 } EFI_PCI_CAPABILITY_PMI;
 
 ///
-/// Capability EFI_PCI_CAPABILITY_ID_AGP, defined in Accelerated Graphics Port Interface Specification
+/// A.G.P Capability
+/// Section 6.1.4, Accelerated Graphics Port Interface Specification, Revision 1.0
 ///
 typedef struct {
   EFI_PCI_CAPABILITY_HDR  Hdr;
@@ -464,7 +665,8 @@ typedef struct {
 } EFI_PCI_CAPABILITY_AGP;
 
 ///
-/// Capability EFI_PCI_CAPABILITY_ID_VPD, in PCI2.2 Spec.
+/// VPD Capability Structure
+/// Appendix I, PCI Local Bus Specification, 2.2
 ///
 typedef struct {
   EFI_PCI_CAPABILITY_HDR  Hdr;
@@ -473,7 +675,8 @@ typedef struct {
 } EFI_PCI_CAPABILITY_VPD;
 
 ///
-/// Capability EFI_PCI_CAPABILITY_ID_SLOTID, defined in PCI-to-PCI Bridge Architeture Specification
+/// Slot Numbering Capabilities Register
+/// Section 3.2.6, PCI-to-PCI Bridge Architeture Specification, Revision 1.2
 ///
 typedef struct {
   EFI_PCI_CAPABILITY_HDR  Hdr;
@@ -482,7 +685,8 @@ typedef struct {
 } EFI_PCI_CAPABILITY_SLOTID;
 
 ///
-/// Capability EFI_PCI_CAPABILITY_ID_MSI, defined in PCI2.2
+/// Message Capability Structure for 32-bit Message Address
+/// Section 6.8.1, PCI Local Bus Specification, 2.2
 ///
 typedef struct {
   EFI_PCI_CAPABILITY_HDR  Hdr;
@@ -491,6 +695,10 @@ typedef struct {
   UINT16                  MsgDataReg;
 } EFI_PCI_CAPABILITY_MSI32;
 
+///
+/// Message Capability Structure for 64-bit Message Address
+/// Section 6.8.1, PCI Local Bus Specification, 2.2
+///
 typedef struct {
   EFI_PCI_CAPABILITY_HDR  Hdr;
   UINT16                  MsgCtrlReg;
@@ -500,7 +708,8 @@ typedef struct {
 } EFI_PCI_CAPABILITY_MSI64;
 
 ///
-/// Capability EFI_PCI_CAPABILITY_ID_HOTPLUG, defined in CompactPCI Hot Swap Specification PICMG 2.1, R1.0
+/// Capability EFI_PCI_CAPABILITY_ID_HOTPLUG,
+/// CompactPCI Hot Swap Specification PICMG 2.1, R1.0
 ///
 typedef struct {
   EFI_PCI_CAPABILITY_HDR  Hdr;
@@ -532,25 +741,25 @@ typedef struct {
 #define EFI_ROOT_BRIDGE_LIST                            'eprb'
 #define EFI_PCI_EXPANSION_ROM_HEADER_EFISIGNATURE       0x0EF1  ///< defined in UEFI Spec.
 
-typedef struct {
-  UINT8 Register;
-  UINT8 Function;
-  UINT8 Device;
-  UINT8 Bus;
-  UINT8 Reserved[4];
-} DEFIO_PCI_ADDR;
-
 #define PCI_EXPANSION_ROM_HEADER_SIGNATURE              0xaa55
 #define PCI_DATA_STRUCTURE_SIGNATURE                    SIGNATURE_32 ('P', 'C', 'I', 'R')
 #define PCI_CODE_TYPE_PCAT_IMAGE                        0x00
-#define EFI_PCI_EXPANSION_ROM_HEADER_COMPRESSED         0x0001  ///<defined in UEFI spec.
+#define EFI_PCI_EXPANSION_ROM_HEADER_COMPRESSED         0x0001  ///< defined in UEFI spec.
 
+///
+/// Standard PCI Expansion ROM Header
+/// Section 13.4.2, Unified Extensible Firmware Interface Specification, Version 2.1
+///
 typedef struct {
   UINT16  Signature;    ///< 0xaa55
   UINT8   Reserved[0x16];
   UINT16  PcirOffset;
 } PCI_EXPANSION_ROM_HEADER;
 
+///
+/// Legacy ROM Header Extensions
+/// Section 6.3.3.1, PCI Local Bus Specification, 2.2
+///
 typedef struct {
   UINT16  Signature;    ///< 0xaa55
   UINT8   Size512;
@@ -559,6 +768,10 @@ typedef struct {
   UINT16  PcirOffset;
 } EFI_LEGACY_EXPANSION_ROM_HEADER;
 
+///
+/// PCI Data Structure Format
+/// Section 6.3.1.2, PCI Local Bus Specification, 2.2
+///
 typedef struct {
   UINT32  Signature;    ///< "PCIR"
   UINT16  VendorId;
@@ -575,7 +788,8 @@ typedef struct {
 } PCI_DATA_STRUCTURE;
 
 ///
-/// defined in EFI/UEFI Spec
+/// EFI PCI Expansion ROM Header
+/// Section 13.4.2, Unified Extensible Firmware Interface Specification, Version 2.1
 ///
 typedef struct {
   UINT16  Signature;    ///< 0xaa55
diff --git a/src/include/gpxe/efi/IndustryStandard/PeImage.h b/src/include/gpxe/efi/IndustryStandard/PeImage.h
index 73b3a5a..74941f5 100644
--- a/src/include/gpxe/efi/IndustryStandard/PeImage.h
+++ b/src/include/gpxe/efi/IndustryStandard/PeImage.h
@@ -7,50 +7,42 @@
   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 - 2008, Intel Corporation
-  All rights reserved. This program and the accompanying materials
-  are licensed and made available under the terms and conditions of the BSD License
-  which accompanies this distribution.  The full text of the license may be found at
-  http://opensource.org/licenses/bsd-license.php
+Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
+Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
+This program and the accompanying materials
+are licensed and made available under the terms and conditions of the BSD License
+which accompanies this distribution.  The full text of the license may be found at
+http://opensource.org/licenses/bsd-license.php.
 
-  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 
 **/
 
 #ifndef __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 ///< defined PI Specification, 1.0
 
 
-///
-/// PE32+ Machine type for EFI images
-///
-#define IMAGE_FILE_MACHINE_I386     0x014c
-#define IMAGE_FILE_MACHINE_IA64     0x0200
-#define IMAGE_FILE_MACHINE_EBC      0x0EBC
-#define IMAGE_FILE_MACHINE_X64      0x8664
 //
-// Support old names for backward compatible
+// PE32+ Machine type for EFI images
 //
-#define EFI_IMAGE_MACHINE_IA32      IMAGE_FILE_MACHINE_I386
-#define EFI_IMAGE_MACHINE_IA64      IMAGE_FILE_MACHINE_IA64
-#define EFI_IMAGE_MACHINE_IPF       IMAGE_FILE_MACHINE_IA64
-#define EFI_IMAGE_MACHINE_EBC       IMAGE_FILE_MACHINE_EBC
-#define EFI_IMAGE_MACHINE_X64       IMAGE_FILE_MACHINE_X64
+#define IMAGE_FILE_MACHINE_I386            0x014c
+#define IMAGE_FILE_MACHINE_IA64            0x0200
+#define IMAGE_FILE_MACHINE_EBC             0x0EBC
+#define IMAGE_FILE_MACHINE_X64             0x8664
+#define IMAGE_FILE_MACHINE_ARMTHUMB_MIXED  0x01c2
 
-///
-/// EXE file formats
-///
+//
+// 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')
@@ -61,29 +53,29 @@
 /// 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;
 
 ///
-/// COFF File Header (Object and Image)
+/// COFF File Header (Object and Image).
 ///
 typedef struct {
   UINT16  Machine;
@@ -96,49 +88,35 @@ typedef struct {
 } EFI_IMAGE_FILE_HEADER;
 
 ///
-/// Size of EFI_IMAGE_FILE_HEADER
+/// Size of EFI_IMAGE_FILE_HEADER.
 ///
 #define EFI_IMAGE_SIZEOF_FILE_HEADER        20
 
-///
-/// Characteristics
-///
+//
+// 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_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.
-//
-
-///
-/// Header Data Directories
+/// Header Data Directories.
 ///
 typedef struct {
   UINT32  VirtualAddress;
   UINT32  Size;
 } EFI_IMAGE_DATA_DIRECTORY;
 
-#define EFI_IMAGE_ROM_OPTIONAL_HDR_MAGIC      0x107
-
-///
-/// Directory Entries
-///
+//
+// Directory Entries
+//
 #define EFI_IMAGE_DIRECTORY_ENTRY_EXPORT      0
 #define EFI_IMAGE_DIRECTORY_ENTRY_IMPORT      1
 #define EFI_IMAGE_DIRECTORY_ENTRY_RESOURCE    2
@@ -161,6 +139,9 @@ typedef struct {
 ///
 #define EFI_IMAGE_NT_OPTIONAL_HDR32_MAGIC 0x10b
 
+///
+/// Optional Header Standard Fields for PE32.
+///
 typedef struct {
   ///
   /// Standard fields.
@@ -173,9 +154,9 @@ typedef struct {
   UINT32                    SizeOfUninitializedData;
   UINT32                    AddressOfEntryPoint;
   UINT32                    BaseOfCode;
-  UINT32                    BaseOfData;  ///< PE32 contains this additional field, which is absent in PE32+
+  UINT32                    BaseOfData;  ///< PE32 contains this additional field, which is absent in PE32+.
   ///
-  /// NT additional fields.
+  /// Optional Header Windows-Specific Fields.
   ///
   UINT32                    ImageBase;
   UINT32                    SectionAlignment;
@@ -209,10 +190,13 @@ typedef struct {
 ///
 #define EFI_IMAGE_NT_OPTIONAL_HDR64_MAGIC 0x20b
 
+///
+/// Optional Header Standard Fields for PE32+.
+///
 typedef struct {
-  //
-  // Standard fields.
-  //
+  ///
+  /// Standard fields.
+  ///
   UINT16                    Magic;
   UINT8                     MajorLinkerVersion;
   UINT8                     MinorLinkerVersion;
@@ -221,9 +205,9 @@ typedef struct {
   UINT32                    SizeOfUninitializedData;
   UINT32                    AddressOfEntryPoint;
   UINT32                    BaseOfCode;
-  //
-  // NT additional fields.
-  //
+  ///
+  /// Optional Header Windows-Specific Fields.
+  ///
   UINT64                    ImageBase;
   UINT32                    SectionAlignment;
   UINT32                    FileAlignment;
@@ -251,8 +235,7 @@ typedef struct {
 
 ///
 /// @attention
-/// EFI_IMAGE_NT_HEADERS32 and EFI_IMAGE_HEADERS64 are for use ONLY
-/// by tools.  All proper EFI code MUST use EFI_IMAGE_NT_HEADERS ONLY!!!
+/// EFI_IMAGE_NT_HEADERS32 is for use ONLY by tools.
 ///
 typedef struct {
   UINT32                      Signature;
@@ -262,6 +245,10 @@ typedef struct {
 
 #define EFI_IMAGE_SIZEOF_NT_OPTIONAL32_HEADER sizeof (EFI_IMAGE_NT_HEADERS32)
 
+///
+/// @attention
+/// EFI_IMAGE_HEADERS64 is for use ONLY by tools.
+///
 typedef struct {
   UINT32                      Signature;
   EFI_IMAGE_FILE_HEADER       FileHeader;
@@ -270,70 +257,9 @@ 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.
-///
-#if   defined (MDE_CPU_IA32)
-
-#define EFI_IMAGE_MACHINE_TYPE_SUPPORTED(Machine) \
-  (((Machine) == EFI_IMAGE_MACHINE_IA32) || ((Machine) == EFI_IMAGE_MACHINE_EBC))
-
-#define EFI_IMAGE_MACHINE_CROSS_TYPE_SUPPORTED(Machine) ((Machine) == EFI_IMAGE_MACHINE_X64)
-
-typedef EFI_IMAGE_NT_HEADERS32    EFI_IMAGE_NT_HEADERS;
-
-#elif defined (MDE_CPU_IPF)
-
-#define EFI_IMAGE_MACHINE_TYPE_SUPPORTED(Machine) \
-  (((Machine) == EFI_IMAGE_MACHINE_IPF) || ((Machine) == EFI_IMAGE_MACHINE_EBC))
-
-#define EFI_IMAGE_MACHINE_CROSS_TYPE_SUPPORTED(Machine) (FALSE)
-
-typedef EFI_IMAGE_NT_HEADERS64    EFI_IMAGE_NT_HEADERS;
-
-#elif defined (MDE_CPU_X64)
-
-#define EFI_IMAGE_MACHINE_TYPE_SUPPORTED(Machine) \
-  (((Machine) == EFI_IMAGE_MACHINE_X64) || ((Machine) == EFI_IMAGE_MACHINE_EBC))
-
-#define EFI_IMAGE_MACHINE_CROSS_TYPE_SUPPORTED(Machine) ((Machine) == EFI_IMAGE_MACHINE_IA32)
-
-typedef EFI_IMAGE_NT_HEADERS64    EFI_IMAGE_NT_HEADERS;
-
-#elif defined (MDE_CPU_EBC)
-
-///
-/// This is just to make sure you can cross compile with the EBC compiiler.
-/// It does not make sense to have a PE loader coded in EBC. You need to
-/// understand the basic
-///
-#define EFI_IMAGE_MACHINE_TYPE_SUPPORTED(Machine) ((Machine) == EFI_IMAGE_MACHINE_EBC)
-
-#define EFI_IMAGE_MACHINE_CROSS_TYPE_SUPPORTED(Machine) (FALSE)
-
-typedef EFI_IMAGE_NT_HEADERS64    EFI_IMAGE_NT_HEADERS;
-
-#else
-#error Unknown Processor Type
-#endif
-
-
-#define EFI_IMAGE_FIRST_SECTION(ntheader) \
-    ( \
-      (EFI_IMAGE_SECTION_HEADER *) \
-        ( \
-          (UINT32) ntheader + \
-          FIELD_OFFSET (EFI_IMAGE_NT_HEADERS, OptionalHeader) + \
-          ((EFI_IMAGE_NT_HEADERS *) (ntheader))->FileHeader.SizeOfOptionalHeader \
-        ) \
-    )
-
-///
-/// Other Windows 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
@@ -342,10 +268,13 @@ typedef EFI_IMAGE_NT_HEADERS64    EFI_IMAGE_NT_HEADERS;
 #define EFI_IMAGE_SUBSYSTEM_POSIX_CUI   7
 
 ///
-/// Section header format.
+/// Length of ShortName.
 ///
 #define EFI_IMAGE_SIZEOF_SHORT_NAME 8
 
+///
+/// Section Table. This table immediately follows the optional header.
+///
 typedef struct {
   UINT8 Name[EFI_IMAGE_SIZEOF_SHORT_NAME];
   union {
@@ -363,13 +292,13 @@ typedef struct {
 } EFI_IMAGE_SECTION_HEADER;
 
 ///
-/// Size of EFI_IMAGE_SECTION_HEADER
+/// Size of EFI_IMAGE_SECTION_HEADER.
 ///
 #define EFI_IMAGE_SIZEOF_SECTION_HEADER       40
 
-///
-/// Section Flags Values
-///
+//
+// 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
@@ -377,7 +306,7 @@ typedef struct {
 
 #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_REMOVE                   BIT11  ///< 0x00000800  ///< Section contents will not become part of image.
 #define EFI_IMAGE_SCN_LNK_COMDAT                   BIT12  ///< 0x00001000
 
 #define EFI_IMAGE_SCN_ALIGN_1BYTES                 BIT20  ///< 0x00100000
@@ -397,21 +326,21 @@ typedef struct {
 #define EFI_IMAGE_SCN_MEM_WRITE                    BIT31  ///< 0x80000000
 
 ///
-/// Size of a Symbol Table Record
+/// Size of a Symbol Table Record.
 ///
 #define EFI_IMAGE_SIZEOF_SYMBOL 18
 
-///
-/// Symbols have a section number of the section in which they are
-/// defined. Otherwise, section numbers have the following meanings:
-///
+//
+// 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.
-///
+//
+// 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.
@@ -429,17 +358,17 @@ typedef struct {
 #define EFI_IMAGE_SYM_TYPE_UINT   14
 #define EFI_IMAGE_SYM_TYPE_DWORD  15
 
-///
-/// Symbol Type (derived) values.
-///
+//
+// 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.
-///
+//
+// 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
@@ -477,18 +406,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.
-///
+//
+// 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
@@ -507,39 +436,39 @@ typedef struct {
 ///
 #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
+//
+// 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.
-///
-#define IMAGE_REL_AMD64_ABSOLUTE	0x0000
-#define IMAGE_REL_AMD64_ADDR64	  0x0001
-#define IMAGE_REL_AMD64_ADDR32	  0x0002
-#define IMAGE_REL_AMD64_ADDR32NB	0x0003
-#define IMAGE_REL_AMD64_REL32	    0x0004
-#define IMAGE_REL_AMD64_REL32_1	  0x0005
-#define IMAGE_REL_AMD64_REL32_2	  0x0006
-#define IMAGE_REL_AMD64_REL32_3	  0x0007
-#define IMAGE_REL_AMD64_REL32_4	  0x0008
-#define IMAGE_REL_AMD64_REL32_5	  0x0009
-#define IMAGE_REL_AMD64_SECTION	  0x000A
-#define IMAGE_REL_AMD64_SECREL	  0x000B
-#define IMAGE_REL_AMD64_SECREL7	  0x000C
-#define IMAGE_REL_AMD64_TOKEN	    0x000D
-#define IMAGE_REL_AMD64_SREL32	  0x000E
-#define IMAGE_REL_AMD64_PAIR	    0x000F
-#define IMAGE_REL_AMD64_SSPAN32	  0x0010
+#define EFI_IMAGE_REL_I386_REL32    0x0014  ///< PC-relative 32-bit reference to the symbols virtual address.
+
+//
+// x64 processor relocation types.
+//
+#define IMAGE_REL_AMD64_ABSOLUTE  0x0000
+#define IMAGE_REL_AMD64_ADDR64    0x0001
+#define IMAGE_REL_AMD64_ADDR32    0x0002
+#define IMAGE_REL_AMD64_ADDR32NB  0x0003
+#define IMAGE_REL_AMD64_REL32     0x0004
+#define IMAGE_REL_AMD64_REL32_1   0x0005
+#define IMAGE_REL_AMD64_REL32_2   0x0006
+#define IMAGE_REL_AMD64_REL32_3   0x0007
+#define IMAGE_REL_AMD64_REL32_4   0x0008
+#define IMAGE_REL_AMD64_REL32_5   0x0009
+#define IMAGE_REL_AMD64_SECTION   0x000A
+#define IMAGE_REL_AMD64_SECREL    0x000B
+#define IMAGE_REL_AMD64_SECREL7   0x000C
+#define IMAGE_REL_AMD64_TOKEN     0x000D
+#define IMAGE_REL_AMD64_SREL32    0x000E
+#define IMAGE_REL_AMD64_PAIR      0x000F
+#define IMAGE_REL_AMD64_SSPAN32   0x0010
 
 ///
 /// Based relocation format.
@@ -550,42 +479,42 @@ typedef struct {
 } EFI_IMAGE_BASE_RELOCATION;
 
 ///
-/// Size of EFI_IMAGE_BASE_RELOCATION
+/// Size of EFI_IMAGE_BASE_RELOCATION.
 ///
 #define EFI_IMAGE_SIZEOF_BASE_RELOCATION  8
 
-///
-/// Based relocation types.
-///
-#define EFI_IMAGE_REL_BASED_ABSOLUTE      0
-#define EFI_IMAGE_REL_BASED_HIGH          1
-#define EFI_IMAGE_REL_BASED_LOW           2
-#define EFI_IMAGE_REL_BASED_HIGHLOW       3
-#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
+//
+// Based relocation types.
+//
+#define EFI_IMAGE_REL_BASED_ABSOLUTE        0
+#define EFI_IMAGE_REL_BASED_HIGH            1
+#define EFI_IMAGE_REL_BASED_LOW             2
+#define EFI_IMAGE_REL_BASED_HIGHLOW         3
+#define EFI_IMAGE_REL_BASED_HIGHADJ         4
+#define EFI_IMAGE_REL_BASED_MIPS_JMPADDR    5
+#define EFI_IMAGE_REL_BASED_IA64_IMM64      9
+#define EFI_IMAGE_REL_BASED_MIPS_JMPADDR16  9
+#define EFI_IMAGE_REL_BASED_DIR64           10
 
 ///
 /// Line number format.
 ///
 typedef struct {
   union {
-    UINT32  SymbolTableIndex; // Symbol table index of function name if Linenumber is 0.
-    UINT32  VirtualAddress;   // Virtual address of line number.
+    UINT32  SymbolTableIndex; ///< Symbol table index of function name if Linenumber is 0.
+    UINT32  VirtualAddress;   ///< Virtual address of line number.
   } Type;
-  UINT16  Linenumber;         // Line number.
+  UINT16  Linenumber;         ///< Line number.
 } EFI_IMAGE_LINENUMBER;
 
 ///
-/// Size of 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"
@@ -593,6 +522,9 @@ typedef struct {
 #define EFI_IMAGE_ARCHIVE_LINKER_MEMBER     "/               "
 #define EFI_IMAGE_ARCHIVE_LONGNAMES_MEMBER  "//              "
 
+///
+/// Archive Member Headers
+///
 typedef struct {
   UINT8 Name[16];     ///< File member name - `/' terminated.
   UINT8 Date[12];     ///< File member date - decimal.
@@ -600,21 +532,21 @@ typedef struct {
   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)
+  UINT8 EndHeader[2]; ///< String to end header. (0x60 0x0A).
 } EFI_IMAGE_ARCHIVE_MEMBER_HEADER;
 
 ///
-/// Size of EFI_IMAGE_ARCHIVE_MEMBER_HEADER
+/// Size of EFI_IMAGE_ARCHIVE_MEMBER_HEADER.
 ///
 #define EFI_IMAGE_SIZEOF_ARCHIVE_MEMBER_HDR 60
 
 
-///
-/// DLL Support
-///
+//
+// DLL Support
+//
 
 ///
-/// Export Directory Table
+/// Export Directory Table.
 ///
 typedef struct {
   UINT32  Characteristics;
@@ -631,13 +563,16 @@ typedef struct {
 } EFI_IMAGE_EXPORT_DIRECTORY;
 
 ///
-/// Hint/Name Table
+/// Hint/Name Table.
 ///
 typedef struct {
   UINT16  Hint;
   UINT8   Name[1];
 } EFI_IMAGE_IMPORT_BY_NAME;
 
+///
+/// Import Address Table RVA (Thunk Table).
+///
 typedef struct {
   union {
     UINT32                    Function;
@@ -646,7 +581,7 @@ typedef struct {
   } u1;
 } EFI_IMAGE_THUNK_DATA;
 
-#define EFI_IMAGE_ORDINAL_FLAG              BIT31    ///< Flag for PE32
+#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)
 
@@ -663,7 +598,7 @@ typedef struct {
 
 
 ///
-/// Debug Direcotry Format
+/// Debug Directory Format.
 ///
 typedef struct {
   UINT32  Characteristics;
@@ -672,14 +607,14 @@ typedef struct {
   UINT16  MinorVersion;
   UINT32  Type;
   UINT32  SizeOfData;
-  UINT32  RVA;           ///< The address of the debug data when loaded, relative to the image base
-  UINT32  FileOffset;    ///< The file pointer to the debug data
+  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 EFI_IMAGE_DEBUG_TYPE_CODEVIEW 2     ///< The Visual C++ debug information
+#define EFI_IMAGE_DEBUG_TYPE_CODEVIEW 2     ///< The Visual C++ debug information.
 
 ///
-/// Debug Data Structure defined in Microsoft C++
+/// Debug Data Structure defined in Microsoft C++.
 ///
 #define CODEVIEW_SIGNATURE_NB10  SIGNATURE_32('N', 'B', '1', '0')
 typedef struct {
@@ -693,11 +628,11 @@ typedef struct {
 } EFI_IMAGE_DEBUG_CODEVIEW_NB10_ENTRY;
 
 ///
-/// Debug Data Structure defined in Microsoft C++
+/// 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;
@@ -708,19 +643,85 @@ typedef struct {
   //
 } EFI_IMAGE_DEBUG_CODEVIEW_RSDS_ENTRY;
 
+
+///
+/// Debug Data Structure defined by Apple Mach-O to Coff utility.
+///
+#define CODEVIEW_SIGNATURE_MTOC  SIGNATURE_32('M', 'T', 'O', 'C')
+typedef struct {
+  UINT32    Signature;                       ///< "MTOC".
+  GUID      MachOUuid;
+  //
+  //  Filename of .DLL (Mach-O with debug info) goes here
+  //
+} EFI_IMAGE_DEBUG_CODEVIEW_MTOC_ENTRY;
+
+///
+/// Resource format.
+///
+typedef struct {
+  UINT32  Characteristics;
+  UINT32  TimeDateStamp;
+  UINT16  MajorVersion;
+  UINT16  MinorVersion;
+  UINT16  NumberOfNamedEntries;
+  UINT16  NumberOfIdEntries;
+  //
+  // Array of EFI_IMAGE_RESOURCE_DIRECTORY_ENTRY entries goes here.
+  //
+} EFI_IMAGE_RESOURCE_DIRECTORY;
+
+///
+/// Resource directory entry format.
+///
+typedef struct {
+  union {
+    struct {
+      UINT32  NameOffset:31;
+      UINT32  NameIsString:1;
+    } s;
+    UINT32  Id;
+  } u1;
+  union {
+    UINT32  OffsetToData;
+    struct {
+      UINT32  OffsetToDirectory:31;
+      UINT32  DataIsDirectory:1;
+    } s;
+  } u2;
+} EFI_IMAGE_RESOURCE_DIRECTORY_ENTRY;
+
+///
+/// Resource directory entry for string.
+///
+typedef struct {
+  UINT16  Length;
+  CHAR16  String[1];
+} EFI_IMAGE_RESOURCE_DIRECTORY_STRING;
+
+///
+/// Resource directory entry for data array.
+///
+typedef struct {
+  UINT32  OffsetToData;
+  UINT32  Size;
+  UINT32  CodePage;
+  UINT32  Reserved;
+} EFI_IMAGE_RESOURCE_DATA_ENTRY;
+
 ///
-/// Header format for TE images, defined in PI Specification, 1.0
+/// Header format for TE images, defined in the 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;            ///< The 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;         ///< Number of 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;
 
 
@@ -734,7 +735,7 @@ typedef struct {
 
 
 ///
-/// Union of PE32, PE32+, and TE headers
+/// Union of PE32, PE32+, and TE headers.
 ///
 typedef union {
   EFI_IMAGE_NT_HEADERS32   Pe32;
diff --git a/src/include/gpxe/efi/Pi/PiBootMode.h b/src/include/gpxe/efi/Pi/PiBootMode.h
index bebca22..504a67f 100644
--- a/src/include/gpxe/efi/Pi/PiBootMode.h
+++ b/src/include/gpxe/efi/Pi/PiBootMode.h
@@ -1,8 +1,8 @@
 /** @file
   Present the boot mode values in PI.
 
-  Copyright (c) 2006 - 2008, Intel Corporation
-  All rights reserved. This program and the accompanying materials
+  Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>
+  This program and the accompanying materials
   are licensed and made available under the terms and conditions of the BSD License
   which accompanies this distribution.  The full text of the license may be found at
   http://opensource.org/licenses/bsd-license.php
@@ -18,8 +18,6 @@
 #ifndef __PI_BOOT_MODE_H__
 #define __PI_BOOT_MODE_H__
 
-#include <gpxe/efi/ProcessorBind.h>
-
 ///
 /// EFI boot mode
 ///
diff --git a/src/include/gpxe/efi/Pi/PiDependency.h b/src/include/gpxe/efi/Pi/PiDependency.h
index 73f6027..7d67da5 100644
--- a/src/include/gpxe/efi/Pi/PiDependency.h
+++ b/src/include/gpxe/efi/Pi/PiDependency.h
@@ -1,8 +1,8 @@
 /** @file
   Present the dependency expression values in PI.
 
-  Copyright (c) 2006 - 2008, Intel Corporation
-  All rights reserved. This program and the accompanying materials
+  Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
+  This program and the accompanying materials
   are licensed and made available under the terms and conditions of the BSD License
   which accompanies this distribution.  The full text of the license may be found at
   http://opensource.org/licenses/bsd-license.php
diff --git a/src/include/gpxe/efi/Pi/PiDxeCis.h b/src/include/gpxe/efi/Pi/PiDxeCis.h
index a924888..bca3011 100644
--- a/src/include/gpxe/efi/Pi/PiDxeCis.h
+++ b/src/include/gpxe/efi/Pi/PiDxeCis.h
@@ -1,14 +1,14 @@
 /** @file
   Include file matches things in PI.
 
-  Copyright (c) 2006 - 2008, Intel Corporation
-  All rights reserved. This program and the accompanying materials
-  are licensed and made available under the terms and conditions of the BSD License
-  which accompanies this distribution.  The full text of the license may be found at
-  http://opensource.org/licenses/bsd-license.php
+Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
+This program and the accompanying materials are licensed and made available under
+the terms and conditions of the BSD License that accompanies this distribution.
+The full text of the license may be found at
+http://opensource.org/licenses/bsd-license.php.
 
-  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 
   @par Revision Reference:
   PI Version 1.0
@@ -18,25 +18,57 @@
 #ifndef __PI_DXECIS_H__
 #define __PI_DXECIS_H__
 
+#include <gpxe/efi/Uefi/UefiMultiPhase.h>
 #include <gpxe/efi/Pi/PiMultiPhase.h>
 
 ///
-/// Global Coherencey Domain types - Memory type
+/// Global Coherencey Domain types - Memory type.
 ///
 typedef enum {
+  ///
+  /// A memory region that is visible to the boot processor. However, there are no system
+  /// components that are currently decoding this memory region.
+  ///
   EfiGcdMemoryTypeNonExistent,
+  ///
+  /// A memory region that is visible to the boot processor. This memory region is being
+  /// decoded by a system component, but the memory region is not considered to be either
+  /// system memory or memory-mapped I/O.
+  ///
   EfiGcdMemoryTypeReserved,
+  ///
+  /// A memory region that is visible to the boot processor. A memory controller is
+  /// currently decoding this memory region and the memory controller is producing a
+  /// tested system memory region that is available to the memory services.
+  ///
   EfiGcdMemoryTypeSystemMemory,
+  ///
+  /// A memory region that is visible to the boot processor. This memory region is
+  /// currently being decoded by a component as memory-mapped I/O that can be used to
+  /// access I/O devices in the platform.
+  ///
   EfiGcdMemoryTypeMemoryMappedIo,
   EfiGcdMemoryTypeMaximum
 } EFI_GCD_MEMORY_TYPE;
 
 ///
-/// Global Coherencey Domain types - IO type
+/// Global Coherencey Domain types - IO type.
 ///
 typedef enum {
+  ///
+  /// An I/O region that is visible to the boot processor. However, there are no system
+  /// components that are currently decoding this I/O region.
+  ///
   EfiGcdIoTypeNonExistent,
+  ///
+  /// An I/O region that is visible to the boot processor. This I/O region is currently being
+  /// decoded by a system component, but the I/O region cannot be used to access I/O devices.
+  ///
   EfiGcdIoTypeReserved,
+  ///
+  /// An I/O region that is visible to the boot processor. This I/O region is currently being
+  /// decoded by a system component that is producing I/O ports that can be used to access I/O devices.
+  ///
   EfiGcdIoTypeIo,
   EfiGcdIoTypeMaximum
 } EFI_GCD_IO_TYPE;
@@ -45,22 +77,42 @@ typedef enum {
 /// The type of allocation to perform.
 ///
 typedef enum {
+  ///
+  /// The GCD memory space map is searched from the lowest address up to the highest address
+  /// looking for unallocated memory ranges.
+  ///
   EfiGcdAllocateAnySearchBottomUp,
+  ///
+  /// The GCD memory space map is searched from the lowest address up
+  /// to the specified MaxAddress looking for unallocated memory ranges.
+  ///
   EfiGcdAllocateMaxAddressSearchBottomUp,
+  ///
+  /// The GCD memory space map is checked to see if the memory range starting
+  /// at the specified Address is available.
+  ///
   EfiGcdAllocateAddress,
+  ///
+  /// The GCD memory space map is searched from the highest address down to the lowest address
+  /// looking for unallocated memory ranges.
+  ///
   EfiGcdAllocateAnySearchTopDown,
+  ///
+  /// The GCD memory space map is searched from the specified MaxAddress
+  /// down to the lowest address looking for unallocated memory ranges.
+  ///
   EfiGcdAllocateMaxAddressSearchTopDown,
   EfiGcdMaxAllocateType
 } EFI_GCD_ALLOCATE_TYPE;
 
 ///
-/// EFI_GCD_MEMORY_SPACE_DESCRIPTOR
+/// EFI_GCD_MEMORY_SPACE_DESCRIPTOR.
 ///
 typedef struct {
   ///
   /// The physical address of the first byte in the memory region. Type
   /// EFI_PHYSICAL_ADDRESS is defined in the AllocatePages() function
-  /// description in the UEFI 2.0 specification
+  /// description in the UEFI 2.0 specification.
   ///
   EFI_PHYSICAL_ADDRESS  BaseAddress;
 
@@ -82,7 +134,7 @@ typedef struct {
   UINT64                Attributes;
   ///
   /// Type of the memory region. Type EFI_GCD_MEMORY_TYPE is defined in the
-  /// AddMemorySpace() function description
+  /// AddMemorySpace() function description.
   ///
   EFI_GCD_MEMORY_TYPE   GcdMemoryType;
 
@@ -105,7 +157,7 @@ typedef struct {
 } EFI_GCD_MEMORY_SPACE_DESCRIPTOR;
 
 ///
-/// EFI_GCD_IO_SPACE_DESCRIPTOR
+/// EFI_GCD_IO_SPACE_DESCRIPTOR.
 ///
 typedef struct {
   ///
@@ -173,7 +225,7 @@ typedef struct {
                                  added to the global coherency domain of the processor.
   @retval EFI_ACCESS_DENIED      One or more bytes of the memory resource range
                                  specified by BaseAddress and Length was allocated
-                                 in a prior call to AllocateMemorySpace()..
+                                 in a prior call to AllocateMemorySpace().
 
 **/
 typedef
@@ -528,7 +580,7 @@ EFI_STATUS
   @retval EFI_SUCCESS         One or more DXE driver were dispatched.
   @retval EFI_NOT_FOUND       No DXE drivers were dispatched.
   @retval EFI_ALREADY_STARTED An attempt is being made to start the DXE Dispatcher recursively.
-                              Thus no action was taken.
+                              Thus, no action was taken.
 
 **/
 typedef
@@ -606,6 +658,10 @@ EFI_STATUS
 #define DXE_SERVICES_REVISION   ((1<<16) | (00))
 
 typedef struct {
+  ///
+  /// The table header for the DXE Services Table.
+  /// This header contains the DXE_SERVICES_SIGNATURE and DXE_SERVICES_REVISION values.
+  ///
   EFI_TABLE_HEADER                Hdr;
 
   //
@@ -639,4 +695,19 @@ typedef struct {
 
 typedef DXE_SERVICES EFI_DXE_SERVICES;
 
+
+/**
+  The function prototype for invoking a function on an Application Processor.
+
+  This definition is used by the UEFI MP Serices Protocol, and the
+  PI SMM System Table.
+
+  @param[in,out] Buffer  The pointer to private data buffer.
+**/
+typedef
+VOID
+(EFIAPI *EFI_AP_PROCEDURE)(
+  IN OUT VOID  *Buffer
+  );
+
 #endif
diff --git a/src/include/gpxe/efi/Pi/PiFirmwareFile.h b/src/include/gpxe/efi/Pi/PiFirmwareFile.h
index be6f8bd..b0dea86 100644
--- a/src/include/gpxe/efi/Pi/PiFirmwareFile.h
+++ b/src/include/gpxe/efi/Pi/PiFirmwareFile.h
@@ -1,17 +1,17 @@
 /** @file
   The firmware file related definitions in PI.
 
-  Copyright (c) 2006 - 2008, Intel Corporation
-  All rights reserved. This program and the accompanying materials
-  are licensed and made available under the terms and conditions of the BSD License
-  which accompanies this distribution.  The full text of the license may be found at
-  http://opensource.org/licenses/bsd-license.php
+Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
+This program and the accompanying materials are licensed and made available under
+the terms and conditions of the BSD License that accompanies this distribution.
+The full text of the license may be found at
+http://opensource.org/licenses/bsd-license.php.
 
-  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 
   @par Revision Reference:
-  PI Version 1.0
+  PI Version 1.2.
 
 **/
 
@@ -19,20 +19,42 @@
 #ifndef __PI_FIRMWARE_FILE_H__
 #define __PI_FIRMWARE_FILE_H__
 
-#include <gpxe/efi/ProcessorBind.h>
-
 #pragma pack(1)
 ///
 /// Used to verify the integrity of the file.
 ///
 typedef union {
   struct {
+    ///
+    /// The IntegrityCheck.Checksum.Header field is an 8-bit checksum of the file
+    /// header. The State and IntegrityCheck.Checksum.File fields are assumed
+    /// to be zero and the checksum is calculated such that the entire header sums to zero.
+    ///
     UINT8   Header;
+    ///
+    /// If the FFS_ATTRIB_CHECKSUM (see definition below) bit of the Attributes
+    /// field is set to one, the IntegrityCheck.Checksum.File field is an 8-bit
+    /// checksum of the entire file The State field and the file tail are assumed to be zero
+    /// and the checksum is calculated such that the entire file sums to zero.
+    /// If the FFS_ATTRIB_CHECKSUM bit of the Attributes field is cleared to zero,
+    /// the IntegrityCheck.Checksum.File field must be initialized with a value of
+    /// 0xAA. The IntegrityCheck.Checksum.File field is valid any time the
+    /// EFI_FILE_DATA_VALID bit is set in the State field.
+    ///
     UINT8   File;
   } Checksum;
+  ///
+  /// This is the full 16 bits of the IntegrityCheck field.
+  ///
   UINT16    Checksum16;
 } EFI_FFS_INTEGRITY_CHECK;
 
+///
+/// FFS_FIXED_CHECKSUM is the checksum value used when the
+/// FFS_ATTRIB_CHECKSUM attribute bit is clear.
+///
+#define FFS_FIXED_CHECKSUM  0xAA
+
 typedef UINT8 EFI_FV_FILETYPE;
 typedef UINT8 EFI_FFS_FILE_ATTRIBUTES;
 typedef UINT8 EFI_FFS_FILE_STATE;
@@ -50,7 +72,10 @@ typedef UINT8 EFI_FFS_FILE_STATE;
 #define EFI_FV_FILETYPE_DRIVER                0x07
 #define EFI_FV_FILETYPE_COMBINED_PEIM_DRIVER  0x08
 #define EFI_FV_FILETYPE_APPLICATION           0x09
+#define EFI_FV_FILETYPE_SMM                   0x0A
 #define EFI_FV_FILETYPE_FIRMWARE_VOLUME_IMAGE 0x0B
+#define EFI_FV_FILETYPE_COMBINED_SMM_DXE      0x0C
+#define EFI_FV_FILETYPE_SMM_CORE              0x0D
 #define EFI_FV_FILETYPE_OEM_MIN               0xc0
 #define EFI_FV_FILETYPE_OEM_MAX               0xdf
 #define EFI_FV_FILETYPE_DEBUG_MIN             0xe0
@@ -61,6 +86,7 @@ typedef UINT8 EFI_FFS_FILE_STATE;
 ///
 /// FFS File Attributes.
 ///
+#define FFS_ATTRIB_LARGE_FILE         0x01
 #define FFS_ATTRIB_FIXED              0x04
 #define FFS_ATTRIB_DATA_ALIGNMENT     0x38
 #define FFS_ATTRIB_CHECKSUM           0x40
@@ -81,33 +107,95 @@ typedef UINT8 EFI_FFS_FILE_STATE;
 /// contents and state of the files.
 ///
 typedef struct {
+  ///
+  /// This GUID is the file name. It is used to uniquely identify the file.
+  ///
   EFI_GUID                Name;
+  ///
+  /// Used to verify the integrity of the file.
+  ///
   EFI_FFS_INTEGRITY_CHECK IntegrityCheck;
+  ///
+  /// Identifies the type of file.
+  ///
   EFI_FV_FILETYPE         Type;
+  ///
+  /// Declares various file attribute bits.
+  ///
   EFI_FFS_FILE_ATTRIBUTES Attributes;
+  ///
+  /// The length of the file in bytes, including the FFS header.
+  ///
   UINT8                   Size[3];
+  ///
+  /// Used to track the state of the file throughout the life of the file from creation to deletion.
+  ///
   EFI_FFS_FILE_STATE      State;
 } EFI_FFS_FILE_HEADER;
 
+typedef struct {
+  ///
+  /// This GUID is the file name. It is used to uniquely identify the file. There may be only
+  /// one instance of a file with the file name GUID of Name in any given firmware
+  /// volume, except if the file type is EFI_FV_FILETYPE_FFS_PAD.
+  ///
+  EFI_GUID                  Name;
+
+  ///
+  /// Used to verify the integrity of the file.
+  ///
+  EFI_FFS_INTEGRITY_CHECK   IntegrityCheck;
+
+  ///
+  /// Identifies the type of file.
+  ///
+  EFI_FV_FILETYPE           Type;
+
+  ///
+  /// Declares various file attribute bits.
+  ///
+  EFI_FFS_FILE_ATTRIBUTES   Attributes;
+
+  ///
+  /// The length of the file in bytes, including the FFS header.
+  /// The length of the file data is either (Size - sizeof(EFI_FFS_FILE_HEADER)). This calculation means a
+  /// zero-length file has a Size of 24 bytes, which is sizeof(EFI_FFS_FILE_HEADER).
+  /// Size is not required to be a multiple of 8 bytes. Given a file F, the next file header is
+  /// located at the next 8-byte aligned firmware volume offset following the last byte of the file F.
+  ///
+  UINT8                     Size[3];
+
+  ///
+  /// Used to track the state of the file throughout the life of the file from creation to deletion.
+  ///
+  EFI_FFS_FILE_STATE        State;
+
+  ///
+  /// If FFS_ATTRIB_LARGE_FILE is set in Attributes, then ExtendedSize exists and Size must be set to zero.
+  /// If FFS_ATTRIB_LARGE_FILE is not set then EFI_FFS_FILE_HEADER is used.
+  ///
+  EFI_FFS_FILE_STATE        ExtendedSize;
+} EFI_FFS_FILE_HEADER2;
 
 typedef UINT8 EFI_SECTION_TYPE;
 
 ///
-/// Pseudo type. It is
-/// used as a wild card when retrieving sections. The section
-/// type EFI_SECTION_ALL matches all section types.
+/// Pseudo type. It is used as a wild card when retrieving sections.
+///  The section type EFI_SECTION_ALL matches all section types.
 ///
 #define EFI_SECTION_ALL                   0x00
 
 ///
-/// Encapsulation section Type values
+/// Encapsulation section Type values.
 ///
 #define EFI_SECTION_COMPRESSION           0x01
 
 #define EFI_SECTION_GUID_DEFINED          0x02
 
+#define EFI_SECTION_DISPOSABLE            0x03
+
 ///
-/// Leaf section Type values
+/// Leaf section Type values.
 ///
 #define EFI_SECTION_PE32                  0x10
 #define EFI_SECTION_PIC                   0x11
@@ -120,20 +208,45 @@ typedef UINT8 EFI_SECTION_TYPE;
 #define EFI_SECTION_FREEFORM_SUBTYPE_GUID 0x18
 #define EFI_SECTION_RAW                   0x19
 #define EFI_SECTION_PEI_DEPEX             0x1B
+#define EFI_SECTION_SMM_DEPEX             0x1C
 
 ///
-/// Common section header
+/// Common section header.
 ///
 typedef struct {
+  ///
+  /// A 24-bit unsigned integer that contains the total size of the section in bytes,
+  /// including the EFI_COMMON_SECTION_HEADER.
+  ///
   UINT8             Size[3];
   EFI_SECTION_TYPE  Type;
+  ///
+  /// Declares the section type.
+  ///
 } EFI_COMMON_SECTION_HEADER;
 
+typedef struct {
+  ///
+  /// A 24-bit unsigned integer that contains the total size of the section in bytes,
+  /// including the EFI_COMMON_SECTION_HEADER.
+  ///
+  UINT8             Size[3];
+
+  EFI_SECTION_TYPE  Type;
+
+  ///
+  /// If Size is 0xFFFFFF, then ExtendedSize contains the size of the section. If
+  /// Size is not equal to 0xFFFFFF, then this field does not exist.
+  ///
+  UINT32            ExtendedSize;
+} EFI_COMMON_SECTION_HEADER2;
+
 ///
 /// Leaf section type that contains an
 /// IA-32 16-bit executable image.
 ///
-typedef EFI_COMMON_SECTION_HEADER EFI_COMPATIBILITY16_SECTION;
+typedef EFI_COMMON_SECTION_HEADER  EFI_COMPATIBILITY16_SECTION;
+typedef EFI_COMMON_SECTION_HEADER2 EFI_COMPATIBILITY16_SECTION2;
 
 ///
 /// CompressionType of EFI_COMPRESSION_SECTION.
@@ -145,67 +258,179 @@ typedef EFI_COMMON_SECTION_HEADER EFI_COMPATIBILITY16_SECTION;
 /// section data is compressed.
 ///
 typedef struct {
+  ///
+  /// Usual common section header. CommonHeader.Type = EFI_SECTION_COMPRESSION.
+  ///
   EFI_COMMON_SECTION_HEADER   CommonHeader;
+  ///
+  /// The UINT32 that indicates the size of the section data after decompression.
+  ///
   UINT32                      UncompressedLength;
+  ///
+  /// Indicates which compression algorithm is used.
+  ///
   UINT8                       CompressionType;
 } EFI_COMPRESSION_SECTION;
 
+typedef struct {
+  ///
+  /// Usual common section header. CommonHeader.Type = EFI_SECTION_COMPRESSION.
+  ///
+  EFI_COMMON_SECTION_HEADER2    CommonHeader;
+  ///
+  /// UINT32 that indicates the size of the section data after decompression.
+  ///
+  UINT32                        UncompressedLength;
+  ///
+  /// Indicates which compression algorithm is used.
+  ///
+  UINT8                         CompressionType;
+} EFI_COMPRESSION_SECTION2;
+
 ///
-/// Leaf section which could be used to determine the dispatch order of DXEs.
+/// An encapsulation section type in which the section data is disposable.
+/// A disposable section is an encapsulation section in which the section data may be disposed of during
+/// the process of creating or updating a firmware image without significant impact on the usefulness of
+/// the file. The Type field in the section header is set to EFI_SECTION_DISPOSABLE. This
+/// allows optional or descriptive data to be included with the firmware file which can be removed in
+/// order to conserve space. The contents of this section are implementation specific, but might contain
+/// debug data or detailed integration instructions.
 ///
-typedef EFI_COMMON_SECTION_HEADER EFI_DXE_DEPEX_SECTION;
+typedef EFI_COMMON_SECTION_HEADER   EFI_DISPOSABLE_SECTION;
+typedef EFI_COMMON_SECTION_HEADER2  EFI_DISPOSABLE_SECTION2;
 
 ///
-/// Leaf section which contains a PI FV.
+/// The leaf section which could be used to determine the dispatch order of DXEs.
 ///
-typedef EFI_COMMON_SECTION_HEADER EFI_FIRMWARE_VOLUME_IMAGE_SECTION;
+typedef EFI_COMMON_SECTION_HEADER   EFI_DXE_DEPEX_SECTION;
+typedef EFI_COMMON_SECTION_HEADER2  EFI_DXE_DEPEX_SECTION2;
 
 ///
-/// Leaf section which contains a single GUID.
+/// The leaf section which contains a PI FV.
+///
+typedef EFI_COMMON_SECTION_HEADER   EFI_FIRMWARE_VOLUME_IMAGE_SECTION;
+typedef EFI_COMMON_SECTION_HEADER2  EFI_FIRMWARE_VOLUME_IMAGE_SECTION2;
+
+///
+/// The leaf section which contains a single GUID.
 ///
 typedef struct {
+  ///
+  /// Common section header. CommonHeader.Type = EFI_SECTION_FREEFORM_SUBTYPE_GUID.
+  ///
   EFI_COMMON_SECTION_HEADER   CommonHeader;
+  ///
+  /// This GUID is defined by the creator of the file. It is a vendor-defined file type.
+  ///
   EFI_GUID                    SubTypeGuid;
 } EFI_FREEFORM_SUBTYPE_GUID_SECTION;
 
+typedef struct {
+  ///
+  /// The common section header. CommonHeader.Type = EFI_SECTION_FREEFORM_SUBTYPE_GUID.
+  ///
+  EFI_COMMON_SECTION_HEADER2    CommonHeader;
+  ///
+  /// This GUID is defined by the creator of the file. It is a vendor-defined file type.
+  ///
+  EFI_GUID                      SubTypeGuid;
+} EFI_FREEFORM_SUBTYPE_GUID_SECTION2;
+
 ///
-/// Attributes of EFI_GUID_DEFINED_SECTION
+/// Attributes of EFI_GUID_DEFINED_SECTION.
 ///
 #define EFI_GUIDED_SECTION_PROCESSING_REQUIRED  0x01
 #define EFI_GUIDED_SECTION_AUTH_STATUS_VALID    0x02
 ///
-/// Leaf section which is encapsulation defined by specific GUID
+/// The leaf section which is encapsulation defined by specific GUID.
 ///
 typedef struct {
+  ///
+  /// The common section header. CommonHeader.Type = EFI_SECTION_GUID_DEFINED.
+  ///
   EFI_COMMON_SECTION_HEADER   CommonHeader;
+  ///
+  /// The GUID that defines the format of the data that follows. It is a vendor-defined section type.
+  ///
   EFI_GUID                    SectionDefinitionGuid;
+  ///
+  /// Contains the offset in bytes from the beginning of the common header to the first byte of the data.
+  ///
   UINT16                      DataOffset;
+  ///
+  /// The bit field that declares some specific characteristics of the section contents.
+  ///
   UINT16                      Attributes;
 } EFI_GUID_DEFINED_SECTION;
 
+typedef struct {
+  ///
+  /// The common section header. CommonHeader.Type = EFI_SECTION_GUID_DEFINED.
+  ///
+  EFI_COMMON_SECTION_HEADER2    CommonHeader;
+  ///
+  /// The GUID that defines the format of the data that follows. It is a vendor-defined section type.
+  ///
+  EFI_GUID                      SectionDefinitionGuid;
+  ///
+  /// Contains the offset in bytes from the beginning of the common header to the first byte of the data.
+  ///
+  UINT16                        DataOffset;
+  ///
+  /// The bit field that declares some specific characteristics of the section contents.
+  ///
+  UINT16                        Attributes;
+} EFI_GUID_DEFINED_SECTION2;
+
 ///
-/// Leaf section which contains PE32+ image.
+/// The leaf section which contains PE32+ image.
 ///
-typedef EFI_COMMON_SECTION_HEADER EFI_PE32_SECTION;
+typedef EFI_COMMON_SECTION_HEADER   EFI_PE32_SECTION;
+typedef EFI_COMMON_SECTION_HEADER2  EFI_PE32_SECTION2;
 
+///
+/// The leaf section used to determine the dispatch order of PEIMs.
+///
+typedef EFI_COMMON_SECTION_HEADER   EFI_PEI_DEPEX_SECTION;
+typedef EFI_COMMON_SECTION_HEADER2  EFI_PEI_DEPEX_SECTION2;
 
 ///
-/// Leaf section which used to determine the dispatch order of PEIMs.
+/// A leaf section type that contains a position-independent-code (PIC) image.
+/// A PIC image section is a leaf section that contains a position-independent-code (PIC) image.
+/// In addition to normal PE32+ images that contain relocation information, PEIM executables may be
+/// PIC and are referred to as PIC images. A PIC image is the same as a PE32+ image except that all
+/// relocation information has been stripped from the image and the image can be moved and will
+/// execute correctly without performing any relocation or other fix-ups. EFI_PIC_SECTION2 must
+/// be used if the section is 16MB or larger.
 ///
-typedef EFI_COMMON_SECTION_HEADER EFI_PEI_DEPEX_SECTION;
+typedef EFI_COMMON_SECTION_HEADER   EFI_PIC_SECTION;
+typedef EFI_COMMON_SECTION_HEADER2  EFI_PIC_SECTION2;
 
 ///
-/// Leaf section which constains the position-independent-code image.
+/// The leaf section which constains the position-independent-code image.
 ///
-typedef EFI_COMMON_SECTION_HEADER EFI_TE_SECTION;
+typedef EFI_COMMON_SECTION_HEADER   EFI_TE_SECTION;
+typedef EFI_COMMON_SECTION_HEADER2  EFI_TE_SECTION2;
 
 ///
-/// Leaf section which contains an array of zero or more bytes.
+/// The leaf section which contains an array of zero or more bytes.
 ///
-typedef EFI_COMMON_SECTION_HEADER EFI_RAW_SECTION;
+typedef EFI_COMMON_SECTION_HEADER   EFI_RAW_SECTION;
+typedef EFI_COMMON_SECTION_HEADER2  EFI_RAW_SECTION2;
 
 ///
-/// Leaf section which contains a unicode string that
+/// The SMM dependency expression section is a leaf section that contains a dependency expression that
+/// is used to determine the dispatch order for SMM drivers. Before the SMRAM invocation of the
+/// SMM driver's entry point, this dependency expression must evaluate to TRUE. See the Platform
+/// Initialization Specification, Volume 2, for details regarding the format of the dependency expression.
+/// The dependency expression may refer to protocols installed in either the UEFI or the SMM protocol
+/// database. EFI_SMM_DEPEX_SECTION2 must be used if the section is 16MB or larger.
+///
+typedef EFI_COMMON_SECTION_HEADER EFI_SMM_DEPEX_SECTION;
+typedef EFI_COMMON_SECTION_HEADER2 EFI_SMM_DEPEX_SECTION2;
+
+///
+/// The leaf section which contains a unicode string that
 /// is human readable file name.
 ///
 typedef struct {
@@ -217,9 +442,13 @@ typedef struct {
   CHAR16                      FileNameString[1];
 } EFI_USER_INTERFACE_SECTION;
 
+typedef struct {
+  EFI_COMMON_SECTION_HEADER2    CommonHeader;
+  CHAR16                        FileNameString[1];
+} EFI_USER_INTERFACE_SECTION2;
 
 ///
-/// Leaf section which contains a numeric build number and
+/// The leaf section which contains a numeric build number and
 /// an optional unicode string that represents the file revision.
 ///
 typedef struct {
@@ -232,6 +461,15 @@ typedef struct {
   CHAR16                      VersionString[1];
 } EFI_VERSION_SECTION;
 
+typedef struct {
+  EFI_COMMON_SECTION_HEADER2    CommonHeader;
+  ///
+  /// A UINT16 that represents a particular build. Subsequent builds have monotonically
+  /// increasing build numbers relative to earlier builds.
+  ///
+  UINT16                        BuildNumber;
+  CHAR16                        VersionString[1];
+} EFI_VERSION_SECTION2;
 
 #define SECTION_SIZE(SectionHeaderPtr) \
     ((UINT32) (*((UINT32 *) ((EFI_COMMON_SECTION_HEADER *) SectionHeaderPtr)->Size) & 0x00ffffff))
diff --git a/src/include/gpxe/efi/Pi/PiFirmwareVolume.h b/src/include/gpxe/efi/Pi/PiFirmwareVolume.h
index 277b704..4d2ba88 100644
--- a/src/include/gpxe/efi/Pi/PiFirmwareVolume.h
+++ b/src/include/gpxe/efi/Pi/PiFirmwareVolume.h
@@ -1,8 +1,8 @@
 /** @file
   The firmware volume related definitions in PI.
 
-  Copyright (c) 2006 - 2008, Intel Corporation
-  All rights reserved. This program and the accompanying materials
+  Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>
+  This program and the accompanying materials
   are licensed and made available under the terms and conditions of the BSD License
   which accompanies this distribution.  The full text of the license may be found at
   http://opensource.org/licenses/bsd-license.php
@@ -18,8 +18,6 @@
 #ifndef __PI_FIRMWAREVOLUME_H__
 #define __PI_FIRMWAREVOLUME_H__
 
-#include <gpxe/efi/ProcessorBind.h>
-
 ///
 /// EFI_FV_FILE_ATTRIBUTES
 ///
@@ -91,7 +89,13 @@ typedef UINT32  EFI_FVB_ATTRIBUTES_2;
 
 
 typedef struct {
+  ///
+  /// The number of sequential blocks which are of the same size.
+  ///
   UINT32 NumBlocks;
+  ///
+  /// The size of the blocks.
+  ///
   UINT32 Length;
 } EFI_FV_BLOCK_MAP_ENTRY;
 
@@ -99,20 +103,57 @@ typedef struct {
 /// Describes the features and layout of the firmware volume.
 ///
 typedef struct {
+  ///
+  /// The first 16 bytes are reserved to allow for the reset vector of
+  /// processors whose reset vector is at address 0.
+  ///
   UINT8                     ZeroVector[16];
+  ///
+  /// Declares the file system with which the firmware volume is formatted.
+  ///
   EFI_GUID                  FileSystemGuid;
+  ///
+  /// Length in bytes of the complete firmware volume, including the header.
+  ///
   UINT64                    FvLength;
+  ///
+  /// Set to EFI_FVH_SIGNATURE
+  ///
   UINT32                    Signature;
+  ///
+  /// Declares capabilities and power-on defaults for the firmware volume.
+  ///
   EFI_FVB_ATTRIBUTES_2      Attributes;
+  ///
+  /// Length in bytes of the complete firmware volume header.
+  ///
   UINT16                    HeaderLength;
+  ///
+  /// A 16-bit checksum of the firmware volume header. A valid header sums to zero.
+  ///
   UINT16                    Checksum;
+  ///
+  /// Offset, relative to the start of the header, of the extended header
+  /// (EFI_FIRMWARE_VOLUME_EXT_HEADER) or zero if there is no extended header.
+  ///
   UINT16                    ExtHeaderOffset;
+  ///
+  /// This field must always be set to zero.
+  ///
   UINT8                     Reserved[1];
+  ///
+  /// Set to 2. Future versions of this specification may define new header fields and will
+  /// increment the Revision field accordingly.
+  ///
   UINT8                     Revision;
+  ///
+  /// An array of run-length encoded FvBlockMapEntry structures. The array is
+  /// terminated with an entry of {0,0}.
+  ///
   EFI_FV_BLOCK_MAP_ENTRY    BlockMap[1];
 } EFI_FIRMWARE_VOLUME_HEADER;
 
-#define EFI_FVH_SIGNATURE EFI_SIGNATURE_32 ('_', 'F', 'V', 'H')
+#define EFI_FVH_SIGNATURE SIGNATURE_32 ('_', 'F', 'V', 'H')
 
 ///
 /// Firmware Volume Header Revision definition
@@ -123,7 +164,13 @@ typedef struct {
 /// Extension header pointed by ExtHeaderOffset of volume header.
 ///
 typedef struct {
+  ///
+  /// Firmware volume name.
+  ///
   EFI_GUID  FvName;
+  ///
+  /// Size of the rest of the extension header, including this structure.
+  ///
   UINT32    ExtHeaderSize;
 } EFI_FIRMWARE_VOLUME_EXT_HEADER;
 
@@ -131,7 +178,13 @@ typedef struct {
 /// Entry struture for describing FV extension header
 ///
 typedef struct {
+  ///
+  /// Size of this header extension.
+  ///
   UINT16    ExtEntrySize;
+  ///
+  /// Type of the header.
+  ///
   UINT16    ExtEntryType;
 } EFI_FIRMWARE_VOLUME_EXT_ENTRY;
 
@@ -140,13 +193,18 @@ typedef struct {
 /// This extension header provides a mapping between a GUID and an OEM file type.
 ///
 typedef struct {
+  ///
+  /// Standard extension entry, with the type EFI_FV_EXT_TYPE_OEM_TYPE.
+  ///
   EFI_FIRMWARE_VOLUME_EXT_ENTRY Hdr;
+  ///
+  /// A bit mask, one bit for each file type between 0xC0 (bit 0) and 0xDF (bit 31). If a bit
+  /// is '1', then the GUID entry exists in Types. If a bit is '0' then no GUID entry exists in Types.
+  ///
   UINT32    TypeMask;
-
-  //
-  // Array of GUIDs.
-  // Each GUID represents an OEM file type.
-  //
+  ///
+  /// An array of GUIDs, each GUID representing an OEM file type.
+  ///
   EFI_GUID  Types[1];
 } EFI_FIRMWARE_VOLUME_EXT_ENTRY_OEM_TYPE;
 
diff --git a/src/include/gpxe/efi/Pi/PiHob.h b/src/include/gpxe/efi/Pi/PiHob.h
index 0c8df1f..4d09521 100644
--- a/src/include/gpxe/efi/Pi/PiHob.h
+++ b/src/include/gpxe/efi/Pi/PiHob.h
@@ -1,14 +1,14 @@
 /** @file
   HOB related definitions in PI.
 
-  Copyright (c) 2006 - 2008, Intel Corporation
-  All rights reserved. This program and the accompanying materials
-  are licensed and made available under the terms and conditions of the BSD License
-  which accompanies this distribution.  The full text of the license may be found at
-  http://opensource.org/licenses/bsd-license.php
+Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
+This program and the accompanying materials are licensed and made available under
+the terms and conditions of the BSD License that accompanies this distribution.
+The full text of the license may be found at
+http://opensource.org/licenses/bsd-license.php.
 
-  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 
   @par Revision Reference:
   PI Version 1.0
@@ -18,11 +18,6 @@
 #ifndef __PI_HOB_H__
 #define __PI_HOB_H__
 
-#include <gpxe/efi/ProcessorBind.h>
-#include <gpxe/efi/Pi/PiBootMode.h>
-#include <gpxe/efi/Uefi/UefiBaseType.h>
-#include <gpxe/efi/Uefi/UefiMultiPhase.h>
-
 //
 // HobType of EFI_HOB_GENERIC_HEADER.
 //
@@ -34,7 +29,8 @@
 #define EFI_HOB_TYPE_CPU                  0x0006
 #define EFI_HOB_TYPE_MEMORY_POOL          0x0007
 #define EFI_HOB_TYPE_FV2                  0x0009
-#define EFI_HOB_TYPE_LOAD_PEIM            0x000A
+#define EFI_HOB_TYPE_LOAD_PEIM_UNUSED     0x000A
+#define EFI_HOB_TYPE_UEFI_CAPSULE         0x000B
 #define EFI_HOB_TYPE_UNUSED               0xFFFE
 #define EFI_HOB_TYPE_END_OF_HOB_LIST      0xFFFF
 
@@ -43,14 +39,23 @@
 /// All HOBs must contain this generic HOB header.
 ///
 typedef struct {
+  ///
+  /// Identifies the HOB data structure type.
+  ///
   UINT16    HobType;
+  ///
+  /// The length in bytes of the HOB.
+  ///
   UINT16    HobLength;
+  ///
+  /// This field must always be set to zero.
+  ///
   UINT32    Reserved;
 } EFI_HOB_GENERIC_HEADER;
 
 
 ///
-/// Value of version ofinEFI_HOB_HANDOFF_INFO_TABLE.
+/// Value of version  in EFI_HOB_HANDOFF_INFO_TABLE.
 ///
 #define EFI_HOB_HANDOFF_TABLE_VERSION 0x0009
 
@@ -59,13 +64,41 @@ typedef struct {
 /// This HOB must be the first one in the HOB list.
 ///
 typedef struct {
+  ///
+  /// The HOB generic header. Header.HobType = EFI_HOB_TYPE_HANDOFF.
+  ///
   EFI_HOB_GENERIC_HEADER  Header;
+  ///
+  /// The version number pertaining to the PHIT HOB definition.
+  /// This value is four bytes in length to provide an 8-byte aligned entry
+  /// when it is combined with the 4-byte BootMode.
+  ///
   UINT32                  Version;
+  ///
+  /// The system boot mode as determined during the HOB producer phase.
+  ///
   EFI_BOOT_MODE           BootMode;
+  ///
+  /// The highest address location of memory that is allocated for use by the HOB producer
+  /// phase. This address must be 4-KB aligned to meet page restrictions of UEFI.
+  ///
   EFI_PHYSICAL_ADDRESS    EfiMemoryTop;
+  ///
+  /// The lowest address location of memory that is allocated for use by the HOB producer phase.
+  ///
   EFI_PHYSICAL_ADDRESS    EfiMemoryBottom;
+  ///
+  /// The highest address location of free memory that is currently available
+  /// for use by the HOB producer phase.
+  ///
   EFI_PHYSICAL_ADDRESS    EfiFreeMemoryTop;
+  ///
+  /// The lowest address location of free memory that is available for use by the HOB producer phase.
+  ///
   EFI_PHYSICAL_ADDRESS    EfiFreeMemoryBottom;
+  ///
+  /// The end of the HOB list.
+  ///
   EFI_PHYSICAL_ADDRESS    EfiEndOfHobList;
 } EFI_HOB_HANDOFF_INFO_TABLE;
 
@@ -112,11 +145,17 @@ typedef struct {
 ///
 /// Describes all memory ranges used during the HOB producer
 /// phase that exist outside the HOB list. This HOB type
-/// describes how memory is used,
-/// not the physical attributes of memory.
+/// describes how memory is used, not the physical attributes of memory.
 ///
 typedef struct {
+  ///
+  /// The HOB generic header. Header.HobType = EFI_HOB_TYPE_MEMORY_ALLOCATION.
+  ///
   EFI_HOB_GENERIC_HEADER            Header;
+  ///
+  /// An instance of the EFI_HOB_MEMORY_ALLOCATION_HEADER that describes the
+  /// various attributes of the logical memory allocation.
+  ///
   EFI_HOB_MEMORY_ALLOCATION_HEADER  AllocDescriptor;
   //
   // Additional data pertaining to the "Name" Guid memory
@@ -127,11 +166,18 @@ typedef struct {
 
 ///
 /// Describes the memory stack that is produced by the HOB producer
-/// phase and upon which all postmemory-installed executable
+/// phase and upon which all post-memory-installed executable
 /// content in the HOB producer phase is executing.
 ///
 typedef struct {
+  ///
+  /// The HOB generic header. Header.HobType = EFI_HOB_TYPE_MEMORY_ALLOCATION.
+  ///
   EFI_HOB_GENERIC_HEADER            Header;
+  ///
+  /// An instance of the EFI_HOB_MEMORY_ALLOCATION_HEADER that describes the
+  /// various attributes of the logical memory allocation.
+  ///
   EFI_HOB_MEMORY_ALLOCATION_HEADER  AllocDescriptor;
 } EFI_HOB_MEMORY_ALLOCATION_STACK;
 
@@ -142,7 +188,14 @@ typedef struct {
 /// register overflow store.
 ///
 typedef struct {
+  ///
+  /// The HOB generic header. Header.HobType = EFI_HOB_TYPE_MEMORY_ALLOCATION.
+  ///
   EFI_HOB_GENERIC_HEADER            Header;
+  ///
+  /// An instance of the EFI_HOB_MEMORY_ALLOCATION_HEADER that describes the
+  /// various attributes of the logical memory allocation.
+  ///
   EFI_HOB_MEMORY_ALLOCATION_HEADER  AllocDescriptor;
 } EFI_HOB_MEMORY_ALLOCATION_BSP_STORE;
 
@@ -150,14 +203,29 @@ typedef struct {
 /// Defines the location and entry point of the HOB consumer phase.
 ///
 typedef struct {
+  ///
+  /// The HOB generic header. Header.HobType = EFI_HOB_TYPE_MEMORY_ALLOCATION.
+  ///
   EFI_HOB_GENERIC_HEADER            Header;
+  ///
+  /// An instance of the EFI_HOB_MEMORY_ALLOCATION_HEADER that describes the
+  /// various attributes of the logical memory allocation.
+  ///
   EFI_HOB_MEMORY_ALLOCATION_HEADER  MemoryAllocationHeader;
+  ///
+  /// The GUID specifying the values of the firmware file system name
+  /// that contains the HOB consumer phase component.
+  ///
   EFI_GUID                          ModuleName;
+  ///
+  /// The address of the memory-mapped firmware volume
+  /// that contains the HOB consumer phase firmware file.
+  ///
   EFI_PHYSICAL_ADDRESS              EntryPoint;
 } EFI_HOB_MEMORY_ALLOCATION_MODULE;
 
 ///
-/// Resource type
+/// The resource type.
 ///
 typedef UINT32 EFI_RESOURCE_TYPE;
 
@@ -174,7 +242,7 @@ typedef UINT32 EFI_RESOURCE_TYPE;
 #define EFI_RESOURCE_MAX_MEMORY_TYPE        0x00000007
 
 ///
-/// type of recount attribute type
+/// A type of recount attribute type.
 ///
 typedef UINT32 EFI_RESOURCE_ATTRIBUTE_TYPE;
 
@@ -211,11 +279,30 @@ typedef UINT32 EFI_RESOURCE_ATTRIBUTE_TYPE;
 /// host bus during the HOB producer phase.
 ///
 typedef struct {
+  ///
+  /// The HOB generic header. Header.HobType = EFI_HOB_TYPE_RESOURCE_DESCRIPTOR.
+  ///
   EFI_HOB_GENERIC_HEADER      Header;
+  ///
+  /// A GUID representing the owner of the resource. This GUID is used by HOB
+  /// consumer phase components to correlate device ownership of a resource.
+  ///
   EFI_GUID                    Owner;
+  ///
+  /// The resource type enumeration as defined by EFI_RESOURCE_TYPE.
+  ///
   EFI_RESOURCE_TYPE           ResourceType;
+  ///
+  /// Resource attributes as defined by EFI_RESOURCE_ATTRIBUTE_TYPE.
+  ///
   EFI_RESOURCE_ATTRIBUTE_TYPE ResourceAttribute;
+  ///
+  /// The physical start address of the resource region.
+  ///
   EFI_PHYSICAL_ADDRESS        PhysicalStart;
+  ///
+  /// The number of bytes of the resource region.
+  ///
   UINT64                      ResourceLength;
 } EFI_HOB_RESOURCE_DESCRIPTOR;
 
@@ -224,32 +311,61 @@ typedef struct {
 /// maintain and manage HOBs with specific GUID.
 ///
 typedef struct {
+  ///
+  /// The HOB generic header. Header.HobType = EFI_HOB_TYPE_GUID_EXTENSION.
+  ///
   EFI_HOB_GENERIC_HEADER      Header;
-  EFI_GUID                    Name;
-
   ///
-  /// Guid specific data goes here
+  /// A GUID that defines the contents of this HOB.
   ///
+  EFI_GUID                    Name;
+  //
+  // Guid specific data goes here
+  //
 } EFI_HOB_GUID_TYPE;
 
 ///
 /// Details the location of firmware volumes that contain firmware files.
 ///
 typedef struct {
+  ///
+  /// The HOB generic header. Header.HobType = EFI_HOB_TYPE_FV.
+  ///
   EFI_HOB_GENERIC_HEADER Header;
+  ///
+  /// The physical memory-mapped base address of the firmware volume.
+  ///
   EFI_PHYSICAL_ADDRESS   BaseAddress;
+  ///
+  /// The length in bytes of the firmware volume.
+  ///
   UINT64                 Length;
 } EFI_HOB_FIRMWARE_VOLUME;
 
 ///
-/// Details the location of a firmware volume which was extracted
+/// Details the location of a firmware volume that was extracted
 /// from a file within another firmware volume.
 ///
 typedef struct {
+  ///
+  /// The HOB generic header. Header.HobType = EFI_HOB_TYPE_FV2.
+  ///
   EFI_HOB_GENERIC_HEADER  Header;
+  ///
+  /// The physical memory-mapped base address of the firmware volume.
+  ///
   EFI_PHYSICAL_ADDRESS    BaseAddress;
+  ///
+  /// The length in bytes of the firmware volume.
+  ///
   UINT64                  Length;
+  ///
+  /// The name of the firmware volume.
+  ///
   EFI_GUID                FvName;
+  ///
+  /// The name of the firmware file that contained this firmware volume.
+  ///
   EFI_GUID                FileName;
 } EFI_HOB_FIRMWARE_VOLUME2;
 
@@ -258,9 +374,21 @@ typedef struct {
 /// Describes processor information, such as address space and I/O space capabilities.
 ///
 typedef struct {
+  ///
+  /// The HOB generic header. Header.HobType = EFI_HOB_TYPE_CPU.
+  ///
   EFI_HOB_GENERIC_HEADER  Header;
+  ///
+  /// Identifies the maximum physical memory addressability of the processor.
+  ///
   UINT8                   SizeOfMemorySpace;
+  ///
+  /// Identifies the maximum physical I/O addressability of the processor.
+  ///
   UINT8                   SizeOfIoSpace;
+  ///
+  /// This field will always be set to zero.
+  ///
   UINT8                   Reserved[6];
 } EFI_HOB_CPU;
 
@@ -269,11 +397,36 @@ typedef struct {
 /// Describes pool memory allocations.
 ///
 typedef struct {
+  ///
+  /// The HOB generic header. Header.HobType = EFI_HOB_TYPE_MEMORY_POOL.
+  ///
   EFI_HOB_GENERIC_HEADER  Header;
 } EFI_HOB_MEMORY_POOL;
 
 ///
-/// Union of all the possible HOB Types
+/// Each UEFI capsule HOB details the location of a UEFI capsule. It includes a base address and length
+/// which is based upon memory blocks with a EFI_CAPSULE_HEADER and the associated
+/// CapsuleImageSize-based payloads. These HOB's shall be created by the PEI PI firmware
+/// sometime after the UEFI UpdateCapsule service invocation with the
+/// CAPSULE_FLAGS_POPULATE_SYSTEM_TABLE flag set in the EFI_CAPSULE_HEADER.
+///
+typedef struct {
+  ///
+  /// The HOB generic header where Header.HobType = EFI_HOB_TYPE_UEFI_CAPSULE.
+  ///
+  EFI_HOB_GENERIC_HEADER Header;
+
+  ///
+  /// The physical memory-mapped base address of an UEFI capsule. This value is set to
+  /// point to the base of the contiguous memory of the UEFI capsule.
+  /// The length of the contiguous memory in bytes.
+  ///
+  EFI_PHYSICAL_ADDRESS   BaseAddress;
+  UINT64                 Length;
+} EFI_HOB_UEFI_CAPSULE;
+
+///
+/// Union of all the possible HOB Types.
 ///
 typedef union {
   EFI_HOB_GENERIC_HEADER              *Header;
@@ -288,6 +441,7 @@ typedef union {
   EFI_HOB_FIRMWARE_VOLUME2            *FirmwareVolume2;
   EFI_HOB_CPU                         *Cpu;
   EFI_HOB_MEMORY_POOL                 *Pool;
+  EFI_HOB_UEFI_CAPSULE                *Capsule;
   UINT8                               *Raw;
 } EFI_PEI_HOB_POINTERS;
 
diff --git a/src/include/gpxe/efi/Pi/PiMultiPhase.h b/src/include/gpxe/efi/Pi/PiMultiPhase.h
index 3ab6421..9f32f2d 100644
--- a/src/include/gpxe/efi/Pi/PiMultiPhase.h
+++ b/src/include/gpxe/efi/Pi/PiMultiPhase.h
@@ -1,104 +1,136 @@
 /** @file
   Include file matches things in PI for multiple module types.
 
-  Copyright (c) 2006 - 2008, Intel Corporation
-  All rights reserved. This program and the accompanying materials
-  are licensed and made available under the terms and conditions of the BSD License
-  which accompanies this distribution.  The full text of the license may be found at
-  http://opensource.org/licenses/bsd-license.php
+Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
+This program and the accompanying materials are licensed and made available under
+the terms and conditions of the BSD License that accompanies this distribution.
+The full text of the license may be found at
+http://opensource.org/licenses/bsd-license.php.
 
-  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 
   @par Revision Reference:
-  PI Version 1.0
+  These elements are defined in UEFI Platform Initialization Specification 1.2.
 
 **/
 
 #ifndef __PI_MULTIPHASE_H__
 #define __PI_MULTIPHASE_H__
 
-#include <gpxe/efi/Uefi/UefiMultiPhase.h>
-
 #include <gpxe/efi/Pi/PiFirmwareVolume.h>
 #include <gpxe/efi/Pi/PiFirmwareFile.h>
 #include <gpxe/efi/Pi/PiBootMode.h>
-
 #include <gpxe/efi/Pi/PiHob.h>
 #include <gpxe/efi/Pi/PiDependency.h>
+#include <gpxe/efi/Pi/PiStatusCode.h>
+#include <gpxe/efi/Pi/PiS3BootScript.h>
 
+/**
+  Produces an error code in the range reserved for use by the Platform Initialization
+  Architecture Specification.
 
-#define EFI_NOT_AVAILABLE_YET   EFIERR (32)
+  The supported 32-bit range is 0xA0000000-0xBFFFFFFF
+  The supported 64-bit range is 0xA000000000000000-0xBFFFFFFFFFFFFFFF
 
-///
-/// Status Code Type Definition
-///
-typedef UINT32  EFI_STATUS_CODE_TYPE;
+  @param  StatusCode    The status code value to convert into a warning code.
+                        StatusCode must be in the range 0x00000000..0x1FFFFFFF.
 
-//
-// A Status Code Type is made up of the code type and severity
-// All values masked by EFI_STATUS_CODE_RESERVED_MASK are
-// reserved for use by this specification.
-//
-#define EFI_STATUS_CODE_TYPE_MASK     0x000000FF
-#define EFI_STATUS_CODE_SEVERITY_MASK 0xFF000000
-#define EFI_STATUS_CODE_RESERVED_MASK 0x00FFFF00
+  @return The value specified by StatusCode in the PI reserved range.
 
-//
-// Definition of code types, all other values masked by
-// EFI_STATUS_CODE_TYPE_MASK are reserved for use by
-// this specification.
-//
-#define EFI_PROGRESS_CODE             0x00000001
-#define EFI_ERROR_CODE                0x00000002
-#define EFI_DEBUG_CODE                0x00000003
+**/
+#define DXE_ERROR(StatusCode)  (MAX_BIT | (MAX_BIT >> 2) | StatusCode)
 
-//
-// Definitions of severities, all other values masked by
-// EFI_STATUS_CODE_SEVERITY_MASK are reserved for use by
-// this specification.
-// Uncontained errors are major errors that could not contained
-// to the specific component that is reporting the error
-// For example, if a memory error was not detected early enough,
-// the bad data could be consumed by other drivers.
-//
-#define EFI_ERROR_MINOR               0x40000000
-#define EFI_ERROR_MAJOR               0x80000000
-#define EFI_ERROR_UNRECOVERED         0x90000000
-#define EFI_ERROR_UNCONTAINED         0xa0000000
+///
+/// If this value is returned by an EFI image, then the image should be unloaded.
+///
+#define EFI_REQUEST_UNLOAD_IMAGE  DXE_ERROR (1)
 
 ///
-/// Status Code Value Definition
+/// If this value is returned by an API, it means the capability is not yet
+/// installed/available/ready to use.
 ///
-typedef UINT32 EFI_STATUS_CODE_VALUE;
+#define EFI_NOT_AVAILABLE_YET     DXE_ERROR (2)
 
-//
-// A Status Code Value is made up of the class, subclass, and
-// an operation.
-//
-#define EFI_STATUS_CODE_CLASS_MASK      0xFF000000
-#define EFI_STATUS_CODE_SUBCLASS_MASK   0x00FF0000
-#define EFI_STATUS_CODE_OPERATION_MASK  0x0000FFFF
+///
+/// Success and warning codes reserved for use by PI.
+/// Supported 32-bit range is 0x20000000-0x3fffffff.
+/// Supported 64-bit range is 0x2000000000000000-0x3fffffffffffffff.
+///
+#define PI_ENCODE_WARNING(a)                ((MAX_BIT >> 2) | (a))
 
 ///
-/// Definition of Status Code extended data header.
-/// The data will follow HeaderSize bytes from the beginning of
-/// the structure and is Size bytes long.
+/// Error codes reserved for use by PI.
+/// Supported 32-bit range is 0xa0000000-0xbfffffff.
+/// Supported 64-bit range is 0xa000000000000000-0xbfffffffffffffff.
 ///
-typedef struct {
-  UINT16    HeaderSize;
-  UINT16    Size;
-  EFI_GUID  Type;
-} EFI_STATUS_CODE_DATA;
+#define PI_ENCODE_ERROR(a)                  (MAX_BIT | (MAX_BIT >> 2) | (a))
 
+///
+/// Return status codes defined in SMM CIS.
+///
+#define EFI_INTERRUPT_PENDING               PI_ENCODE_ERROR (0)
 
-//
-// Bit values for Authentication Status
-//
+#define EFI_WARN_INTERRUPT_SOURCE_PENDING   PI_ENCODE_WARNING (0)
+#define EFI_WARN_INTERRUPT_SOURCE_QUIESCED  PI_ENCODE_WARNING (1)
+
+///
+/// Bitmask of values for Authentication Status.
+/// Authentication Status is returned from EFI_GUIDED_SECTION_EXTRACTION_PROTOCOL
+/// and the EFI_PEI_GUIDED_SECTION_EXTRACTION_PPI
+///
+/// xx00 Image was not signed.
+/// xxx1 Platform security policy override. Assumes the same meaning as 0010 (the image was signed, the
+///      signature was tested, and the signature passed authentication test).
+/// 0010 Image was signed, the signature was tested, and the signature passed authentication test.
+/// 0110 Image was signed and the signature was not tested.
+/// 1010 Image was signed, the signature was tested, and the signature failed the authentication test.
+///
+///@{
 #define EFI_AUTH_STATUS_PLATFORM_OVERRIDE   0x01
 #define EFI_AUTH_STATUS_IMAGE_SIGNED        0x02
 #define EFI_AUTH_STATUS_NOT_TESTED          0x04
 #define EFI_AUTH_STATUS_TEST_FAILED         0x08
 #define EFI_AUTH_STATUS_ALL                 0x0f
+///@}
+
+///
+/// SMRAM states and capabilities
+///
+#define EFI_SMRAM_OPEN                  0x00000001
+#define EFI_SMRAM_CLOSED                0x00000002
+#define EFI_SMRAM_LOCKED                0x00000004
+#define EFI_CACHEABLE                   0x00000008
+#define EFI_ALLOCATED                   0x00000010
+#define EFI_NEEDS_TESTING               0x00000020
+#define EFI_NEEDS_ECC_INITIALIZATION    0x00000040
+
+///
+/// Structure describing a SMRAM region and its accessibility attributes.
+///
+typedef struct {
+  ///
+  /// Designates the physical address of the SMRAM in memory. This view of memory is
+  /// the same as seen by I/O-based agents, for example, but it may not be the address seen
+  /// by the processors.
+  ///
+  EFI_PHYSICAL_ADDRESS  PhysicalStart;
+  ///
+  /// Designates the address of the SMRAM, as seen by software executing on the
+  /// processors. This address may or may not match PhysicalStart.
+  ///
+  EFI_PHYSICAL_ADDRESS  CpuStart;
+  ///
+  /// Describes the number of bytes in the SMRAM region.
+  ///
+  UINT64                PhysicalSize;
+  ///
+  /// Describes the accessibility attributes of the SMRAM.  These attributes include the
+  /// hardware state (e.g., Open/Closed/Locked), capability (e.g., cacheable), logical
+  /// allocation (e.g., allocated), and pre-use initialization (e.g., needs testing/ECC
+  /// initialization).
+  ///
+  UINT64                RegionState;
+} EFI_SMRAM_DESCRIPTOR;
 
 #endif
diff --git a/src/include/gpxe/efi/Pi/PiS3BootScript.h b/src/include/gpxe/efi/Pi/PiS3BootScript.h
new file mode 100644
index 0000000..e4ce688
--- /dev/null
+++ b/src/include/gpxe/efi/Pi/PiS3BootScript.h
@@ -0,0 +1,59 @@
+/** @file
+  This file contains the boot script defintions that are shared between the
+  Boot Script Executor PPI and the Boot Script Save Protocol.
+
+  Copyright (c) 2009, Intel Corporation. All rights reserved.<BR>
+  This program and the accompanying materials
+  are licensed and made available under the terms and conditions of the BSD License
+  which accompanies this distribution.  The full text of the license may be found at
+  http://opensource.org/licenses/bsd-license.php
+
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef _PI_S3_BOOT_SCRIPT_H_
+#define _PI_S3_BOOT_SCRIPT_H_
+
+//*******************************************
+// EFI Boot Script Opcode definitions
+//*******************************************
+#define EFI_BOOT_SCRIPT_IO_WRITE_OPCODE                 0x00
+#define EFI_BOOT_SCRIPT_IO_READ_WRITE_OPCODE            0x01
+#define EFI_BOOT_SCRIPT_MEM_WRITE_OPCODE                0x02
+#define EFI_BOOT_SCRIPT_MEM_READ_WRITE_OPCODE           0x03
+#define EFI_BOOT_SCRIPT_PCI_CONFIG_WRITE_OPCODE         0x04
+#define EFI_BOOT_SCRIPT_PCI_CONFIG_READ_WRITE_OPCODE    0x05
+#define EFI_BOOT_SCRIPT_SMBUS_EXECUTE_OPCODE            0x06
+#define EFI_BOOT_SCRIPT_STALL_OPCODE                    0x07
+#define EFI_BOOT_SCRIPT_DISPATCH_OPCODE                 0x08
+#define EFI_BOOT_SCRIPT_DISPATCH_2_OPCODE               0x09
+#define EFI_BOOT_SCRIPT_INFORMATION_OPCODE              0x0A
+#define EFI_BOOT_SCRIPT_PCI_CONFIG2_WRITE_OPCODE        0x0B
+#define EFI_BOOT_SCRIPT_PCI_CONFIG2_READ_WRITE_OPCODE   0x0C
+#define EFI_BOOT_SCRIPT_IO_POLL_OPCODE                  0x0D
+#define EFI_BOOT_SCRIPT_MEM_POLL_OPCODE                 0x0E
+#define EFI_BOOT_SCRIPT_PCI_CONFIG_POLL_OPCODE          0x0F
+#define EFI_BOOT_SCRIPT_PCI_CONFIG2_POLL_OPCODE         0x10
+
+//*******************************************
+// EFI_BOOT_SCRIPT_WIDTH
+//*******************************************
+typedef enum {
+  EfiBootScriptWidthUint8,
+  EfiBootScriptWidthUint16,
+  EfiBootScriptWidthUint32,
+  EfiBootScriptWidthUint64,
+  EfiBootScriptWidthFifoUint8,
+  EfiBootScriptWidthFifoUint16,
+  EfiBootScriptWidthFifoUint32,
+  EfiBootScriptWidthFifoUint64,
+  EfiBootScriptWidthFillUint8,
+  EfiBootScriptWidthFillUint16,
+  EfiBootScriptWidthFillUint32,
+  EfiBootScriptWidthFillUint64,
+  EfiBootScriptWidthMaximum
+} EFI_BOOT_SCRIPT_WIDTH;
+
+#endif
diff --git a/src/include/gpxe/efi/Pi/PiStatusCode.h b/src/include/gpxe/efi/Pi/PiStatusCode.h
new file mode 100644
index 0000000..40607b8
--- /dev/null
+++ b/src/include/gpxe/efi/Pi/PiStatusCode.h
@@ -0,0 +1,1126 @@
+/** @file
+  StatusCode related definitions in PI.
+
+Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>
+This program and the accompanying materials are licensed and made available under
+the terms and conditions of the BSD License that accompanies this distribution.
+The full text of the license may be found at
+http://opensource.org/licenses/bsd-license.php.
+
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+  @par Revision Reference:
+  These status codes are defined in UEFI Platform Initialization Specification 1.2,
+  Volume 3: Shared Architectural Elements.
+
+**/
+
+#ifndef __PI_STATUS_CODE_H__
+#define __PI_STATUS_CODE_H__
+
+//
+// Required for IA32 and IPF defines for CPU exception types
+//
+#include <gpxe/efi/Protocol/DebugSupport.h>
+
+///
+/// Status Code Type Definition.
+///
+typedef UINT32  EFI_STATUS_CODE_TYPE;
+
+///
+/// A Status Code Type is made up of the code type and severity.
+/// All values masked by EFI_STATUS_CODE_RESERVED_MASK are
+/// reserved for use by this specification.
+///
+///@{
+#define EFI_STATUS_CODE_TYPE_MASK     0x000000FF
+#define EFI_STATUS_CODE_SEVERITY_MASK 0xFF000000
+#define EFI_STATUS_CODE_RESERVED_MASK 0x00FFFF00
+///@}
+
+///
+/// Definition of code types. All other values masked by
+/// EFI_STATUS_CODE_TYPE_MASK are reserved for use by
+/// this specification.
+///
+///@{
+#define EFI_PROGRESS_CODE             0x00000001
+#define EFI_ERROR_CODE                0x00000002
+#define EFI_DEBUG_CODE                0x00000003
+///@}
+
+///
+/// Definitions of severities, all other values masked by
+/// EFI_STATUS_CODE_SEVERITY_MASK are reserved for use by
+/// this specification.
+/// Uncontained errors are major errors that could not contained
+/// to the specific component that is reporting the error.
+/// For example, if a memory error was not detected early enough,
+/// the bad data could be consumed by other drivers.
+///
+///@{
+#define EFI_ERROR_MINOR               0x40000000
+#define EFI_ERROR_MAJOR               0x80000000
+#define EFI_ERROR_UNRECOVERED         0x90000000
+#define EFI_ERROR_UNCONTAINED         0xa0000000
+///@}
+
+///
+/// Status Code Value Definition.
+///
+typedef UINT32 EFI_STATUS_CODE_VALUE;
+
+///
+/// A Status Code Value is made up of the class, subclass, and
+/// an operation.
+///
+///@{
+#define EFI_STATUS_CODE_CLASS_MASK      0xFF000000
+#define EFI_STATUS_CODE_SUBCLASS_MASK   0x00FF0000
+#define EFI_STATUS_CODE_OPERATION_MASK  0x0000FFFF
+///@}
+
+///
+/// Definition of Status Code extended data header.
+/// The data will follow HeaderSize bytes from the beginning of
+/// the structure and is Size bytes long.
+///
+typedef struct {
+  ///
+  /// The size of the structure. This is specified to enable future expansion.
+  ///
+  UINT16    HeaderSize;
+  ///
+  /// The size of the data in bytes. This does not include the size of the header structure.
+  ///
+  UINT16    Size;
+  ///
+  /// The GUID defining the type of the data.
+  ///
+  EFI_GUID  Type;
+} EFI_STATUS_CODE_DATA;
+
+///
+/// General partitioning scheme for Progress and Error Codes are:
+///   - 0x0000-0x0FFF    Shared by all sub-classes in a given class.
+///   - 0x1000-0x7FFF    Subclass Specific.
+///   - 0x8000-0xFFFF    OEM specific.
+///@{
+#define EFI_SUBCLASS_SPECIFIC 0x1000
+#define EFI_OEM_SPECIFIC      0x8000
+///@}
+
+///
+/// Debug Code definitions for all classes and subclass.
+/// Only one debug code is defined at this point and should
+/// be used for anything that is sent to the debug stream.
+///
+///@{
+#define EFI_DC_UNSPECIFIED  0x0
+///@}
+
+///
+/// Class definitions.
+/// Values of 4-127 are reserved for future use by this specification.
+/// Values in the range 127-255 are reserved for OEM use.
+///
+///@{
+#define EFI_COMPUTING_UNIT  0x00000000
+#define EFI_PERIPHERAL      0x01000000
+#define EFI_IO_BUS          0x02000000
+#define EFI_SOFTWARE        0x03000000
+///@}
+
+///
+/// Computing Unit Subclass definitions.
+/// Values of 8-127 are reserved for future use by this specification.
+/// Values of 128-255 are reserved for OEM use.
+///
+///@{
+#define EFI_COMPUTING_UNIT_UNSPECIFIED        (EFI_COMPUTING_UNIT | 0x00000000)
+#define EFI_COMPUTING_UNIT_HOST_PROCESSOR     (EFI_COMPUTING_UNIT | 0x00010000)
+#define EFI_COMPUTING_UNIT_FIRMWARE_PROCESSOR (EFI_COMPUTING_UNIT | 0x00020000)
+#define EFI_COMPUTING_UNIT_IO_PROCESSOR       (EFI_COMPUTING_UNIT | 0x00030000)
+#define EFI_COMPUTING_UNIT_CACHE              (EFI_COMPUTING_UNIT | 0x00040000)
+#define EFI_COMPUTING_UNIT_MEMORY             (EFI_COMPUTING_UNIT | 0x00050000)
+#define EFI_COMPUTING_UNIT_CHIPSET            (EFI_COMPUTING_UNIT | 0x00060000)
+///@}
+
+///
+/// Computing Unit Class Progress Code definitions.
+/// These are shared by all subclasses.
+///
+///@{
+#define EFI_CU_PC_INIT_BEGIN  0x00000000
+#define EFI_CU_PC_INIT_END    0x00000001
+///@}
+
+//
+// Computing Unit Unspecified Subclass Progress Code definitions.
+//
+
+///
+/// Computing Unit Host Processor Subclass Progress Code definitions.
+///@{
+#define EFI_CU_HP_PC_POWER_ON_INIT          (EFI_SUBCLASS_SPECIFIC | 0x00000000)
+#define EFI_CU_HP_PC_CACHE_INIT             (EFI_SUBCLASS_SPECIFIC | 0x00000001)
+#define EFI_CU_HP_PC_RAM_INIT               (EFI_SUBCLASS_SPECIFIC | 0x00000002)
+#define EFI_CU_HP_PC_MEMORY_CONTROLLER_INIT (EFI_SUBCLASS_SPECIFIC | 0x00000003)
+#define EFI_CU_HP_PC_IO_INIT                (EFI_SUBCLASS_SPECIFIC | 0x00000004)
+#define EFI_CU_HP_PC_BSP_SELECT             (EFI_SUBCLASS_SPECIFIC | 0x00000005)
+#define EFI_CU_HP_PC_BSP_RESELECT           (EFI_SUBCLASS_SPECIFIC | 0x00000006)
+#define EFI_CU_HP_PC_AP_INIT                (EFI_SUBCLASS_SPECIFIC | 0x00000007)
+#define EFI_CU_HP_PC_SMM_INIT               (EFI_SUBCLASS_SPECIFIC | 0x00000008)
+///@}
+
+//
+// Computing Unit Firmware Processor Subclass Progress Code definitions.
+//
+
+//
+// Computing Unit IO Processor Subclass Progress Code definitions.
+//
+
+///
+/// Computing Unit Cache Subclass Progress Code definitions.
+///
+///@{
+#define EFI_CU_CACHE_PC_PRESENCE_DETECT (EFI_SUBCLASS_SPECIFIC | 0x00000000)
+#define EFI_CU_CACHE_PC_CONFIGURATION   (EFI_SUBCLASS_SPECIFIC | 0x00000001)
+///@}
+
+///
+/// Computing Unit Memory Subclass Progress Code definitions.
+///
+///@{
+#define EFI_CU_MEMORY_PC_SPD_READ         (EFI_SUBCLASS_SPECIFIC | 0x00000000)
+#define EFI_CU_MEMORY_PC_PRESENCE_DETECT  (EFI_SUBCLASS_SPECIFIC | 0x00000001)
+#define EFI_CU_MEMORY_PC_TIMING           (EFI_SUBCLASS_SPECIFIC | 0x00000002)
+#define EFI_CU_MEMORY_PC_CONFIGURING      (EFI_SUBCLASS_SPECIFIC | 0x00000003)
+#define EFI_CU_MEMORY_PC_OPTIMIZING       (EFI_SUBCLASS_SPECIFIC | 0x00000004)
+#define EFI_CU_MEMORY_PC_INIT             (EFI_SUBCLASS_SPECIFIC | 0x00000005)
+#define EFI_CU_MEMORY_PC_TEST             (EFI_SUBCLASS_SPECIFIC | 0x00000006)
+///@}
+
+//
+// Computing Unit Chipset Subclass Progress Code definitions.
+//
+
+///
+/// South Bridge initialization prior to memory detection.
+///
+#define EFI_CHIPSET_PC_PEI_CAR_SB_INIT      (EFI_SUBCLASS_SPECIFIC|0x00000000)
+
+///
+/// North Bridge initialization prior to memory detection.
+///
+#define EFI_CHIPSET_PC_PEI_CAR_NB_INIT      (EFI_SUBCLASS_SPECIFIC|0x00000001)
+
+///
+/// South Bridge initialization after memory detection.
+///
+#define EFI_CHIPSET_PC_PEI_MEM_SB_INIT      (EFI_SUBCLASS_SPECIFIC|0x00000002)
+
+///
+/// North Bridge initialization after memory detection.
+///
+#define EFI_CHIPSET_PC_PEI_MEM_NB_INIT      (EFI_SUBCLASS_SPECIFIC|0x00000003)
+
+///
+/// PCI Host Bridge DXE initialization.
+///
+#define EFI_CHIPSET_PC_DXE_HB_INIT          (EFI_SUBCLASS_SPECIFIC|0x00000004)
+
+///
+/// North Bridge DXE initialization.
+///
+#define EFI_CHIPSET_PC_DXE_NB_INIT          (EFI_SUBCLASS_SPECIFIC|0x00000005)
+
+///
+/// North Bridge specific SMM initialization in DXE.
+///
+#define EFI_CHIPSET_PC_DXE_NB_SMM_INIT      (EFI_SUBCLASS_SPECIFIC|0x00000006)
+
+///
+/// Initialization of the South Bridge specific UEFI Runtime Services.
+///
+#define EFI_CHIPSET_PC_DXE_SB_RT_INIT       (EFI_SUBCLASS_SPECIFIC|0x00000007)
+
+///
+/// South Bridge DXE initialization
+///
+#define EFI_CHIPSET_PC_DXE_SB_INIT          (EFI_SUBCLASS_SPECIFIC|0x00000008)
+
+///
+/// South Bridge specific SMM initialization in DXE.
+///
+#define EFI_CHIPSET_PC_DXE_SB_SMM_INIT      (EFI_SUBCLASS_SPECIFIC|0x00000009)
+
+///
+/// Initialization of the South Bridge devices.
+///
+#define EFI_CHIPSET_PC_DXE_SB_DEVICES_INIT  (EFI_SUBCLASS_SPECIFIC|0x0000000a)
+
+///
+/// Computing Unit Class Error Code definitions.
+/// These are shared by all subclasses.
+///
+///@{
+#define EFI_CU_EC_NON_SPECIFIC    0x00000000
+#define EFI_CU_EC_DISABLED        0x00000001
+#define EFI_CU_EC_NOT_SUPPORTED   0x00000002
+#define EFI_CU_EC_NOT_DETECTED    0x00000003
+#define EFI_CU_EC_NOT_CONFIGURED  0x00000004
+///@}
+
+//
+// Computing Unit Unspecified Subclass Error Code definitions.
+//
+
+///
+/// Computing Unit Host Processor Subclass Error Code definitions.
+///
+///@{
+#define EFI_CU_HP_EC_INVALID_TYPE         (EFI_SUBCLASS_SPECIFIC | 0x00000000)
+#define EFI_CU_HP_EC_INVALID_SPEED        (EFI_SUBCLASS_SPECIFIC | 0x00000001)
+#define EFI_CU_HP_EC_MISMATCH             (EFI_SUBCLASS_SPECIFIC | 0x00000002)
+#define EFI_CU_HP_EC_TIMER_EXPIRED        (EFI_SUBCLASS_SPECIFIC | 0x00000003)
+#define EFI_CU_HP_EC_SELF_TEST            (EFI_SUBCLASS_SPECIFIC | 0x00000004)
+#define EFI_CU_HP_EC_INTERNAL             (EFI_SUBCLASS_SPECIFIC | 0x00000005)
+#define EFI_CU_HP_EC_THERMAL              (EFI_SUBCLASS_SPECIFIC | 0x00000006)
+#define EFI_CU_HP_EC_LOW_VOLTAGE          (EFI_SUBCLASS_SPECIFIC | 0x00000007)
+#define EFI_CU_HP_EC_HIGH_VOLTAGE         (EFI_SUBCLASS_SPECIFIC | 0x00000008)
+#define EFI_CU_HP_EC_CACHE                (EFI_SUBCLASS_SPECIFIC | 0x00000009)
+#define EFI_CU_HP_EC_MICROCODE_UPDATE     (EFI_SUBCLASS_SPECIFIC | 0x0000000A)
+#define EFI_CU_HP_EC_CORRECTABLE          (EFI_SUBCLASS_SPECIFIC | 0x0000000B)
+#define EFI_CU_HP_EC_UNCORRECTABLE        (EFI_SUBCLASS_SPECIFIC | 0x0000000C)
+#define EFI_CU_HP_EC_NO_MICROCODE_UPDATE  (EFI_SUBCLASS_SPECIFIC | 0x0000000D)
+///@}
+
+///
+/// Computing Unit Firmware Processor Subclass Error Code definitions.
+///
+///@{
+#define EFI_CU_FP_EC_HARD_FAIL  (EFI_SUBCLASS_SPECIFIC | 0x00000000)
+#define EFI_CU_FP_EC_SOFT_FAIL  (EFI_SUBCLASS_SPECIFIC | 0x00000001)
+#define EFI_CU_FP_EC_COMM_ERROR (EFI_SUBCLASS_SPECIFIC | 0x00000002)
+///@}
+
+//
+// Computing Unit IO Processor Subclass Error Code definitions.
+//
+
+///
+/// Computing Unit Cache Subclass Error Code definitions.
+///
+///@{
+#define EFI_CU_CACHE_EC_INVALID_TYPE  (EFI_SUBCLASS_SPECIFIC | 0x00000000)
+#define EFI_CU_CACHE_EC_INVALID_SPEED (EFI_SUBCLASS_SPECIFIC | 0x00000001)
+#define EFI_CU_CACHE_EC_INVALID_SIZE  (EFI_SUBCLASS_SPECIFIC | 0x00000002)
+#define EFI_CU_CACHE_EC_MISMATCH      (EFI_SUBCLASS_SPECIFIC | 0x00000003)
+///@}
+
+///
+/// Computing Unit Memory Subclass Error Code definitions.
+///
+///@{
+#define EFI_CU_MEMORY_EC_INVALID_TYPE   (EFI_SUBCLASS_SPECIFIC | 0x00000000)
+#define EFI_CU_MEMORY_EC_INVALID_SPEED  (EFI_SUBCLASS_SPECIFIC | 0x00000001)
+#define EFI_CU_MEMORY_EC_CORRECTABLE    (EFI_SUBCLASS_SPECIFIC | 0x00000002)
+#define EFI_CU_MEMORY_EC_UNCORRECTABLE  (EFI_SUBCLASS_SPECIFIC | 0x00000003)
+#define EFI_CU_MEMORY_EC_SPD_FAIL       (EFI_SUBCLASS_SPECIFIC | 0x00000004)
+#define EFI_CU_MEMORY_EC_INVALID_SIZE   (EFI_SUBCLASS_SPECIFIC | 0x00000005)
+#define EFI_CU_MEMORY_EC_MISMATCH       (EFI_SUBCLASS_SPECIFIC | 0x00000006)
+#define EFI_CU_MEMORY_EC_S3_RESUME_FAIL (EFI_SUBCLASS_SPECIFIC | 0x00000007)
+#define EFI_CU_MEMORY_EC_UPDATE_FAIL    (EFI_SUBCLASS_SPECIFIC | 0x00000008)
+#define EFI_CU_MEMORY_EC_NONE_DETECTED  (EFI_SUBCLASS_SPECIFIC | 0x00000009)
+#define EFI_CU_MEMORY_EC_NONE_USEFUL    (EFI_SUBCLASS_SPECIFIC | 0x0000000A)
+///@}
+
+///
+/// Computing Unit Chipset Subclass Error Code definitions.
+///
+///@{
+#define EFI_CHIPSET_EC_BAD_BATTERY      (EFI_SUBCLASS_SPECIFIC | 0x00000000)
+#define EFI_CHIPSET_EC_DXE_NB_ERROR     (EFI_SUBCLASS_SPECIFIC | 0x00000001)
+#define EFI_CHIPSET_EC_DXE_SB_ERROR     (EFI_SUBCLASS_SPECIFIC | 0x00000002)
+///@}
+
+///
+/// Peripheral Subclass definitions.
+/// Values of 12-127 are reserved for future use by this specification.
+/// Values of 128-255 are reserved for OEM use.
+///
+///@{
+#define EFI_PERIPHERAL_UNSPECIFIED      (EFI_PERIPHERAL | 0x00000000)
+#define EFI_PERIPHERAL_KEYBOARD         (EFI_PERIPHERAL | 0x00010000)
+#define EFI_PERIPHERAL_MOUSE            (EFI_PERIPHERAL | 0x00020000)
+#define EFI_PERIPHERAL_LOCAL_CONSOLE    (EFI_PERIPHERAL | 0x00030000)
+#define EFI_PERIPHERAL_REMOTE_CONSOLE   (EFI_PERIPHERAL | 0x00040000)
+#define EFI_PERIPHERAL_SERIAL_PORT      (EFI_PERIPHERAL | 0x00050000)
+#define EFI_PERIPHERAL_PARALLEL_PORT    (EFI_PERIPHERAL | 0x00060000)
+#define EFI_PERIPHERAL_FIXED_MEDIA      (EFI_PERIPHERAL | 0x00070000)
+#define EFI_PERIPHERAL_REMOVABLE_MEDIA  (EFI_PERIPHERAL | 0x00080000)
+#define EFI_PERIPHERAL_AUDIO_INPUT      (EFI_PERIPHERAL | 0x00090000)
+#define EFI_PERIPHERAL_AUDIO_OUTPUT     (EFI_PERIPHERAL | 0x000A0000)
+#define EFI_PERIPHERAL_LCD_DEVICE       (EFI_PERIPHERAL | 0x000B0000)
+#define EFI_PERIPHERAL_NETWORK          (EFI_PERIPHERAL | 0x000C0000)
+///@}
+
+///
+/// Peripheral Class Progress Code definitions.
+/// These are shared by all subclasses.
+///
+///@{
+#define EFI_P_PC_INIT             0x00000000
+#define EFI_P_PC_RESET            0x00000001
+#define EFI_P_PC_DISABLE          0x00000002
+#define EFI_P_PC_PRESENCE_DETECT  0x00000003
+#define EFI_P_PC_ENABLE           0x00000004
+#define EFI_P_PC_RECONFIG         0x00000005
+#define EFI_P_PC_DETECTED         0x00000006
+///@}
+
+//
+// Peripheral Class Unspecified Subclass Progress Code definitions.
+//
+
+///
+/// Peripheral Class Keyboard Subclass Progress Code definitions.
+///
+///@{
+#define EFI_P_KEYBOARD_PC_CLEAR_BUFFER  (EFI_SUBCLASS_SPECIFIC | 0x00000000)
+#define EFI_P_KEYBOARD_PC_SELF_TEST     (EFI_SUBCLASS_SPECIFIC | 0x00000001)
+///@}
+
+///
+/// Peripheral Class Mouse Subclass Progress Code definitions.
+///
+///@{
+#define EFI_P_MOUSE_PC_SELF_TEST  (EFI_SUBCLASS_SPECIFIC | 0x00000000)
+///@}
+
+//
+// Peripheral Class Local Console Subclass Progress Code definitions.
+//
+
+//
+// Peripheral Class Remote Console Subclass Progress Code definitions.
+//
+
+///
+/// Peripheral Class Serial Port Subclass Progress Code definitions.
+///
+///@{
+#define EFI_P_SERIAL_PORT_PC_CLEAR_BUFFER (EFI_SUBCLASS_SPECIFIC | 0x00000000)
+///@}
+
+//
+// Peripheral Class Parallel Port Subclass Progress Code definitions.
+//
+
+//
+// Peripheral Class Fixed Media Subclass Progress Code definitions.
+//
+
+//
+// Peripheral Class Removable Media Subclass Progress Code definitions.
+//
+
+//
+// Peripheral Class Audio Input Subclass Progress Code definitions.
+//
+
+//
+// Peripheral Class Audio Output Subclass Progress Code definitions.
+//
+
+//
+// Peripheral Class LCD Device Subclass Progress Code definitions.
+//
+
+//
+// Peripheral Class Network Subclass Progress Code definitions.
+//
+
+///
+/// Peripheral Class Error Code definitions.
+/// These are shared by all subclasses.
+///
+///@{
+#define EFI_P_EC_NON_SPECIFIC       0x00000000
+#define EFI_P_EC_DISABLED           0x00000001
+#define EFI_P_EC_NOT_SUPPORTED      0x00000002
+#define EFI_P_EC_NOT_DETECTED       0x00000003
+#define EFI_P_EC_NOT_CONFIGURED     0x00000004
+#define EFI_P_EC_INTERFACE_ERROR    0x00000005
+#define EFI_P_EC_CONTROLLER_ERROR   0x00000006
+#define EFI_P_EC_INPUT_ERROR        0x00000007
+#define EFI_P_EC_OUTPUT_ERROR       0x00000008
+#define EFI_P_EC_RESOURCE_CONFLICT  0x00000009
+///@}
+
+//
+// Peripheral Class Unspecified Subclass Error Code definitions.
+//
+
+///
+/// Peripheral Class Keyboard Subclass Error Code definitions.
+///
+///@{
+#define EFI_P_KEYBOARD_EC_LOCKED    (EFI_SUBCLASS_SPECIFIC | 0x00000000)
+#define EFI_P_KEYBOARD_EC_STUCK_KEY (EFI_SUBCLASS_SPECIFIC | 0x00000001)
+///@}
+
+///
+/// Peripheral Class Mouse Subclass Error Code definitions.
+///
+///@{
+#define EFI_P_MOUSE_EC_LOCKED (EFI_SUBCLASS_SPECIFIC | 0x00000000)
+///@}
+
+//
+// Peripheral Class Local Console Subclass Error Code definitions.
+//
+
+//
+// Peripheral Class Remote Console Subclass Error Code definitions.
+//
+
+//
+// Peripheral Class Serial Port Subclass Error Code definitions.
+//
+
+//
+// Peripheral Class Parallel Port Subclass Error Code definitions.
+//
+
+//
+// Peripheral Class Fixed Media Subclass Error Code definitions.
+//
+
+//
+// Peripheral Class Removable Media Subclass Error Code definitions.
+//
+
+//
+// Peripheral Class Audio Input Subclass Error Code definitions.
+//
+
+//
+// Peripheral Class Audio Output Subclass Error Code definitions.
+//
+
+//
+// Peripheral Class LCD Device Subclass Error Code definitions.
+//
+
+//
+// Peripheral Class Network Subclass Error Code definitions.
+//
+
+///
+/// IO Bus Subclass definitions.
+/// Values of 14-127 are reserved for future use by this specification.
+/// Values of 128-255 are reserved for OEM use.
+///
+///@{
+#define EFI_IO_BUS_UNSPECIFIED  (EFI_IO_BUS | 0x00000000)
+#define EFI_IO_BUS_PCI          (EFI_IO_BUS | 0x00010000)
+#define EFI_IO_BUS_USB          (EFI_IO_BUS | 0x00020000)
+#define EFI_IO_BUS_IBA          (EFI_IO_BUS | 0x00030000)
+#define EFI_IO_BUS_AGP          (EFI_IO_BUS | 0x00040000)
+#define EFI_IO_BUS_PC_CARD      (EFI_IO_BUS | 0x00050000)
+#define EFI_IO_BUS_LPC          (EFI_IO_BUS | 0x00060000)
+#define EFI_IO_BUS_SCSI         (EFI_IO_BUS | 0x00070000)
+#define EFI_IO_BUS_ATA_ATAPI    (EFI_IO_BUS | 0x00080000)
+#define EFI_IO_BUS_FC           (EFI_IO_BUS | 0x00090000)
+#define EFI_IO_BUS_IP_NETWORK   (EFI_IO_BUS | 0x000A0000)
+#define EFI_IO_BUS_SMBUS        (EFI_IO_BUS | 0x000B0000)
+#define EFI_IO_BUS_I2C          (EFI_IO_BUS | 0x000C0000)
+///@}
+
+///
+/// IO Bus Class Progress Code definitions.
+/// These are shared by all subclasses.
+///
+///@{
+#define EFI_IOB_PC_INIT     0x00000000
+#define EFI_IOB_PC_RESET    0x00000001
+#define EFI_IOB_PC_DISABLE  0x00000002
+#define EFI_IOB_PC_DETECT   0x00000003
+#define EFI_IOB_PC_ENABLE   0x00000004
+#define EFI_IOB_PC_RECONFIG 0x00000005
+#define EFI_IOB_PC_HOTPLUG  0x00000006
+///@}
+
+//
+// IO Bus Class Unspecified Subclass Progress Code definitions.
+//
+
+///
+/// IO Bus Class PCI Subclass Progress Code definitions.
+///
+///@{
+#define EFI_IOB_PCI_PC_BUS_ENUM   (EFI_SUBCLASS_SPECIFIC | 0x00000000)
+#define EFI_IOB_PCI_PC_RES_ALLOC  (EFI_SUBCLASS_SPECIFIC | 0x00000001)
+#define EFI_IOB_PCI_PC_HPC_INIT   (EFI_SUBCLASS_SPECIFIC | 0x00000002)
+///@}
+
+//
+// IO Bus Class USB Subclass Progress Code definitions.
+//
+
+//
+// IO Bus Class IBA Subclass Progress Code definitions.
+//
+
+//
+// IO Bus Class AGP Subclass Progress Code definitions.
+//
+
+//
+// IO Bus Class PC Card Subclass Progress Code definitions.
+//
+
+//
+// IO Bus Class LPC Subclass Progress Code definitions.
+//
+
+//
+// IO Bus Class SCSI Subclass Progress Code definitions.
+//
+
+//
+// IO Bus Class ATA/ATAPI Subclass Progress Code definitions.
+//
+
+//
+// IO Bus Class FC Subclass Progress Code definitions.
+//
+
+//
+// IO Bus Class IP Network Subclass Progress Code definitions.
+//
+
+//
+// IO Bus Class SMBUS Subclass Progress Code definitions.
+//
+
+//
+// IO Bus Class I2C Subclass Progress Code definitions.
+//
+
+///
+/// IO Bus Class Error Code definitions.
+/// These are shared by all subclasses.
+///
+///@{
+#define EFI_IOB_EC_NON_SPECIFIC       0x00000000
+#define EFI_IOB_EC_DISABLED           0x00000001
+#define EFI_IOB_EC_NOT_SUPPORTED      0x00000002
+#define EFI_IOB_EC_NOT_DETECTED       0x00000003
+#define EFI_IOB_EC_NOT_CONFIGURED     0x00000004
+#define EFI_IOB_EC_INTERFACE_ERROR    0x00000005
+#define EFI_IOB_EC_CONTROLLER_ERROR   0x00000006
+#define EFI_IOB_EC_READ_ERROR         0x00000007
+#define EFI_IOB_EC_WRITE_ERROR        0x00000008
+#define EFI_IOB_EC_RESOURCE_CONFLICT  0x00000009
+///@}
+
+//
+// IO Bus Class Unspecified Subclass Error Code definitions.
+//
+
+///
+/// IO Bus Class PCI Subclass Error Code definitions.
+///
+///@{
+#define EFI_IOB_PCI_EC_PERR (EFI_SUBCLASS_SPECIFIC | 0x00000000)
+#define EFI_IOB_PCI_EC_SERR (EFI_SUBCLASS_SPECIFIC | 0x00000001)
+///@}
+
+//
+// IO Bus Class USB Subclass Error Code definitions.
+//
+
+//
+// IO Bus Class IBA Subclass Error Code definitions.
+//
+
+//
+// IO Bus Class AGP Subclass Error Code definitions.
+//
+
+//
+// IO Bus Class PC Card Subclass Error Code definitions.
+//
+
+//
+// IO Bus Class LPC Subclass Error Code definitions.
+//
+
+//
+// IO Bus Class SCSI Subclass Error Code definitions.
+//
+
+//
+// IO Bus Class ATA/ATAPI Subclass Error Code definitions.
+//
+
+//
+// IO Bus Class FC Subclass Error Code definitions.
+//
+
+//
+// IO Bus Class IP Network Subclass Error Code definitions.
+//
+
+//
+// IO Bus Class SMBUS Subclass Error Code definitions.
+//
+
+//
+// IO Bus Class I2C Subclass Error Code definitions.
+//
+
+///
+/// Software Subclass definitions.
+/// Values of 14-127 are reserved for future use by this specification.
+/// Values of 128-255 are reserved for OEM use.
+///
+///@{
+#define EFI_SOFTWARE_UNSPECIFIED          (EFI_SOFTWARE | 0x00000000)
+#define EFI_SOFTWARE_SEC                  (EFI_SOFTWARE | 0x00010000)
+#define EFI_SOFTWARE_PEI_CORE             (EFI_SOFTWARE | 0x00020000)
+#define EFI_SOFTWARE_PEI_MODULE           (EFI_SOFTWARE | 0x00030000)
+#define EFI_SOFTWARE_DXE_CORE             (EFI_SOFTWARE | 0x00040000)
+#define EFI_SOFTWARE_DXE_BS_DRIVER        (EFI_SOFTWARE | 0x00050000)
+#define EFI_SOFTWARE_DXE_RT_DRIVER        (EFI_SOFTWARE | 0x00060000)
+#define EFI_SOFTWARE_SMM_DRIVER           (EFI_SOFTWARE | 0x00070000)
+#define EFI_SOFTWARE_EFI_APPLICATION      (EFI_SOFTWARE | 0x00080000)
+#define EFI_SOFTWARE_EFI_OS_LOADER        (EFI_SOFTWARE | 0x00090000)
+#define EFI_SOFTWARE_RT                   (EFI_SOFTWARE | 0x000A0000)
+#define EFI_SOFTWARE_AL                   (EFI_SOFTWARE | 0x000B0000)
+#define EFI_SOFTWARE_EBC_EXCEPTION        (EFI_SOFTWARE | 0x000C0000)
+#define EFI_SOFTWARE_IA32_EXCEPTION       (EFI_SOFTWARE | 0x000D0000)
+#define EFI_SOFTWARE_IPF_EXCEPTION        (EFI_SOFTWARE | 0x000E0000)
+#define EFI_SOFTWARE_PEI_SERVICE          (EFI_SOFTWARE | 0x000F0000)
+#define EFI_SOFTWARE_EFI_BOOT_SERVICE     (EFI_SOFTWARE | 0x00100000)
+#define EFI_SOFTWARE_EFI_RUNTIME_SERVICE  (EFI_SOFTWARE | 0x00110000)
+#define EFI_SOFTWARE_EFI_DXE_SERVICE      (EFI_SOFTWARE | 0x00120000)
+///@}
+
+///
+/// Software Class Progress Code definitions.
+/// These are shared by all subclasses.
+///
+///@{
+#define EFI_SW_PC_INIT                0x00000000
+#define EFI_SW_PC_LOAD                0x00000001
+#define EFI_SW_PC_INIT_BEGIN          0x00000002
+#define EFI_SW_PC_INIT_END            0x00000003
+#define EFI_SW_PC_AUTHENTICATE_BEGIN  0x00000004
+#define EFI_SW_PC_AUTHENTICATE_END    0x00000005
+#define EFI_SW_PC_INPUT_WAIT          0x00000006
+#define EFI_SW_PC_USER_SETUP          0x00000007
+///@}
+
+//
+// Software Class Unspecified Subclass Progress Code definitions.
+//
+
+///
+/// Software Class SEC Subclass Progress Code definitions.
+///
+///@{
+#define EFI_SW_SEC_PC_ENTRY_POINT     (EFI_SUBCLASS_SPECIFIC | 0x00000000)
+#define EFI_SW_SEC_PC_HANDOFF_TO_NEXT (EFI_SUBCLASS_SPECIFIC | 0x00000001)
+///@}
+
+///
+/// Software Class PEI Core Subclass Progress Code definitions.
+///
+///@{
+#define EFI_SW_PEI_CORE_PC_ENTRY_POINT      (EFI_SUBCLASS_SPECIFIC | 0x00000000)
+#define EFI_SW_PEI_CORE_PC_HANDOFF_TO_NEXT  (EFI_SUBCLASS_SPECIFIC | 0x00000001)
+#define EFI_SW_PEI_CORE_PC_RETURN_TO_LAST   (EFI_SUBCLASS_SPECIFIC | 0x00000002)
+///@}
+
+///
+/// Software Class PEI Module Subclass Progress Code definitions.
+///
+///@{
+#define EFI_SW_PEIM_PC_RECOVERY_BEGIN (EFI_SUBCLASS_SPECIFIC | 0x00000000)
+#define EFI_SW_PEIM_PC_CAPSULE_LOAD   (EFI_SUBCLASS_SPECIFIC | 0x00000001)
+#define EFI_SW_PEIM_PC_CAPSULE_START  (EFI_SUBCLASS_SPECIFIC | 0x00000002)
+#define EFI_SW_PEIM_PC_RECOVERY_USER  (EFI_SUBCLASS_SPECIFIC | 0x00000003)
+#define EFI_SW_PEIM_PC_RECOVERY_AUTO  (EFI_SUBCLASS_SPECIFIC | 0x00000004)
+#define EFI_SW_PEI_PC_S3_BOOT_SCRIPT  (EFI_SUBCLASS_SPECIFIC | 0x00000005)
+#define EFI_SW_PEI_PC_OS_WAKE         (EFI_SUBCLASS_SPECIFIC | 0x00000006)
+///@}
+
+///
+/// Software Class DXE Core Subclass Progress Code definitions.
+///
+///@{
+#define EFI_SW_DXE_CORE_PC_ENTRY_POINT      (EFI_SUBCLASS_SPECIFIC | 0x00000000)
+#define EFI_SW_DXE_CORE_PC_HANDOFF_TO_NEXT  (EFI_SUBCLASS_SPECIFIC | 0x00000001)
+#define EFI_SW_DXE_CORE_PC_RETURN_TO_LAST   (EFI_SUBCLASS_SPECIFIC | 0x00000002)
+#define EFI_SW_DXE_CORE_PC_START_DRIVER     (EFI_SUBCLASS_SPECIFIC | 0x00000003)
+#define EFI_SW_DXE_CORE_PC_ARCH_READY       (EFI_SUBCLASS_SPECIFIC | 0x00000004)
+///@}
+
+///
+/// Software Class DXE BS Driver Subclass Progress Code definitions.
+///
+///@{
+#define EFI_SW_DXE_BS_PC_LEGACY_OPROM_INIT            (EFI_SUBCLASS_SPECIFIC | 0x00000000)
+#define EFI_SW_DXE_BS_PC_READY_TO_BOOT_EVENT          (EFI_SUBCLASS_SPECIFIC | 0x00000001)
+#define EFI_SW_DXE_BS_PC_LEGACY_BOOT_EVENT            (EFI_SUBCLASS_SPECIFIC | 0x00000002)
+#define EFI_SW_DXE_BS_PC_EXIT_BOOT_SERVICES_EVENT     (EFI_SUBCLASS_SPECIFIC | 0x00000003)
+#define EFI_SW_DXE_BS_PC_VIRTUAL_ADDRESS_CHANGE_EVENT (EFI_SUBCLASS_SPECIFIC | 0x00000004)
+///@}
+
+//
+// Software Class SMM Driver Subclass Progress Code definitions.
+//
+
+//
+// Software Class EFI Application Subclass Progress Code definitions.
+//
+
+//
+// Software Class EFI OS Loader Subclass Progress Code definitions.
+//
+
+///
+/// Software Class EFI RT Subclass Progress Code definitions.
+///
+///@{
+#define EFI_SW_RT_PC_ENTRY_POINT      (EFI_SUBCLASS_SPECIFIC | 0x00000000)
+#define EFI_SW_RT_PC_HANDOFF_TO_NEXT  (EFI_SUBCLASS_SPECIFIC | 0x00000001)
+#define EFI_SW_RT_PC_RETURN_TO_LAST   (EFI_SUBCLASS_SPECIFIC | 0x00000002)
+///@}
+
+//
+// Software Class EBC Exception Subclass Progress Code definitions.
+//
+
+//
+// Software Class IA32 Exception Subclass Progress Code definitions.
+//
+
+//
+// Software Class X64 Exception Subclass Progress Code definitions.
+//
+
+//
+// Software Class IPF Exception Subclass Progress Code definitions.
+//
+
+///
+/// Software Class PEI Services Subclass Progress Code definitions.
+///
+///@{
+#define EFI_SW_PS_PC_INSTALL_PPI              (EFI_SUBCLASS_SPECIFIC | 0x00000000)
+#define EFI_SW_PS_PC_REINSTALL_PPI            (EFI_SUBCLASS_SPECIFIC | 0x00000001)
+#define EFI_SW_PS_PC_LOCATE_PPI               (EFI_SUBCLASS_SPECIFIC | 0x00000002)
+#define EFI_SW_PS_PC_NOTIFY_PPI               (EFI_SUBCLASS_SPECIFIC | 0x00000003)
+#define EFI_SW_PS_PC_GET_BOOT_MODE            (EFI_SUBCLASS_SPECIFIC | 0x00000004)
+#define EFI_SW_PS_PC_SET_BOOT_MODE            (EFI_SUBCLASS_SPECIFIC | 0x00000005)
+#define EFI_SW_PS_PC_GET_HOB_LIST             (EFI_SUBCLASS_SPECIFIC | 0x00000006)
+#define EFI_SW_PS_PC_CREATE_HOB               (EFI_SUBCLASS_SPECIFIC | 0x00000007)
+#define EFI_SW_PS_PC_FFS_FIND_NEXT_VOLUME     (EFI_SUBCLASS_SPECIFIC | 0x00000008)
+#define EFI_SW_PS_PC_FFS_FIND_NEXT_FILE       (EFI_SUBCLASS_SPECIFIC | 0x00000009)
+#define EFI_SW_PS_PC_FFS_FIND_SECTION_DATA    (EFI_SUBCLASS_SPECIFIC | 0x0000000A)
+#define EFI_SW_PS_PC_INSTALL_PEI_MEMORY       (EFI_SUBCLASS_SPECIFIC | 0x0000000B)
+#define EFI_SW_PS_PC_ALLOCATE_PAGES           (EFI_SUBCLASS_SPECIFIC | 0x0000000C)
+#define EFI_SW_PS_PC_ALLOCATE_POOL            (EFI_SUBCLASS_SPECIFIC | 0x0000000D)
+#define EFI_SW_PS_PC_COPY_MEM                 (EFI_SUBCLASS_SPECIFIC | 0x0000000E)
+#define EFI_SW_PS_PC_SET_MEM                  (EFI_SUBCLASS_SPECIFIC | 0x0000000F)
+#define EFI_SW_PS_PC_RESET_SYSTEM             (EFI_SUBCLASS_SPECIFIC | 0x00000010)
+#define EFI_SW_PS_PC_FFS_FIND_FILE_BY_NAME    (EFI_SUBCLASS_SPECIFIC | 0x00000013)
+#define EFI_SW_PS_PC_FFS_GET_FILE_INFO        (EFI_SUBCLASS_SPECIFIC | 0x00000014)
+#define EFI_SW_PS_PC_FFS_GET_VOLUME_INFO      (EFI_SUBCLASS_SPECIFIC | 0x00000015)
+#define EFI_SW_PS_PC_FFS_REGISTER_FOR_SHADOW  (EFI_SUBCLASS_SPECIFIC | 0x00000016)
+///@}
+
+///
+/// Software Class EFI Boot Services Subclass Progress Code definitions.
+///
+///@{
+#define EFI_SW_BS_PC_RAISE_TPL                      (EFI_SUBCLASS_SPECIFIC | 0x00000000)
+#define EFI_SW_BS_PC_RESTORE_TPL                    (EFI_SUBCLASS_SPECIFIC | 0x00000001)
+#define EFI_SW_BS_PC_ALLOCATE_PAGES                 (EFI_SUBCLASS_SPECIFIC | 0x00000002)
+#define EFI_SW_BS_PC_FREE_PAGES                     (EFI_SUBCLASS_SPECIFIC | 0x00000003)
+#define EFI_SW_BS_PC_GET_MEMORY_MAP                 (EFI_SUBCLASS_SPECIFIC | 0x00000004)
+#define EFI_SW_BS_PC_ALLOCATE_POOL                  (EFI_SUBCLASS_SPECIFIC | 0x00000005)
+#define EFI_SW_BS_PC_FREE_POOL                      (EFI_SUBCLASS_SPECIFIC | 0x00000006)
+#define EFI_SW_BS_PC_CREATE_EVENT                   (EFI_SUBCLASS_SPECIFIC | 0x00000007)
+#define EFI_SW_BS_PC_SET_TIMER                      (EFI_SUBCLASS_SPECIFIC | 0x00000008)
+#define EFI_SW_BS_PC_WAIT_FOR_EVENT                 (EFI_SUBCLASS_SPECIFIC | 0x00000009)
+#define EFI_SW_BS_PC_SIGNAL_EVENT                   (EFI_SUBCLASS_SPECIFIC | 0x0000000A)
+#define EFI_SW_BS_PC_CLOSE_EVENT                    (EFI_SUBCLASS_SPECIFIC | 0x0000000B)
+#define EFI_SW_BS_PC_CHECK_EVENT                    (EFI_SUBCLASS_SPECIFIC | 0x0000000C)
+#define EFI_SW_BS_PC_INSTALL_PROTOCOL_INTERFACE     (EFI_SUBCLASS_SPECIFIC | 0x0000000D)
+#define EFI_SW_BS_PC_REINSTALL_PROTOCOL_INTERFACE   (EFI_SUBCLASS_SPECIFIC | 0x0000000E)
+#define EFI_SW_BS_PC_UNINSTALL_PROTOCOL_INTERFACE   (EFI_SUBCLASS_SPECIFIC | 0x0000000F)
+#define EFI_SW_BS_PC_HANDLE_PROTOCOL                (EFI_SUBCLASS_SPECIFIC | 0x00000010)
+#define EFI_SW_BS_PC_PC_HANDLE_PROTOCOL             (EFI_SUBCLASS_SPECIFIC | 0x00000011)
+#define EFI_SW_BS_PC_REGISTER_PROTOCOL_NOTIFY       (EFI_SUBCLASS_SPECIFIC | 0x00000012)
+#define EFI_SW_BS_PC_LOCATE_HANDLE                  (EFI_SUBCLASS_SPECIFIC | 0x00000013)
+#define EFI_SW_BS_PC_INSTALL_CONFIGURATION_TABLE    (EFI_SUBCLASS_SPECIFIC | 0x00000014)
+#define EFI_SW_BS_PC_LOAD_IMAGE                     (EFI_SUBCLASS_SPECIFIC | 0x00000015)
+#define EFI_SW_BS_PC_START_IMAGE                    (EFI_SUBCLASS_SPECIFIC | 0x00000016)
+#define EFI_SW_BS_PC_EXIT                           (EFI_SUBCLASS_SPECIFIC | 0x00000017)
+#define EFI_SW_BS_PC_UNLOAD_IMAGE                   (EFI_SUBCLASS_SPECIFIC | 0x00000018)
+#define EFI_SW_BS_PC_EXIT_BOOT_SERVICES             (EFI_SUBCLASS_SPECIFIC | 0x00000019)
+#define EFI_SW_BS_PC_GET_NEXT_MONOTONIC_COUNT       (EFI_SUBCLASS_SPECIFIC | 0x0000001A)
+#define EFI_SW_BS_PC_STALL                          (EFI_SUBCLASS_SPECIFIC | 0x0000001B)
+#define EFI_SW_BS_PC_SET_WATCHDOG_TIMER             (EFI_SUBCLASS_SPECIFIC | 0x0000001C)
+#define EFI_SW_BS_PC_CONNECT_CONTROLLER             (EFI_SUBCLASS_SPECIFIC | 0x0000001D)
+#define EFI_SW_BS_PC_DISCONNECT_CONTROLLER          (EFI_SUBCLASS_SPECIFIC | 0x0000001E)
+#define EFI_SW_BS_PC_OPEN_PROTOCOL                  (EFI_SUBCLASS_SPECIFIC | 0x0000001F)
+#define EFI_SW_BS_PC_CLOSE_PROTOCOL                 (EFI_SUBCLASS_SPECIFIC | 0x00000020)
+#define EFI_SW_BS_PC_OPEN_PROTOCOL_INFORMATION      (EFI_SUBCLASS_SPECIFIC | 0x00000021)
+#define EFI_SW_BS_PC_PROTOCOLS_PER_HANDLE           (EFI_SUBCLASS_SPECIFIC | 0x00000022)
+#define EFI_SW_BS_PC_LOCATE_HANDLE_BUFFER           (EFI_SUBCLASS_SPECIFIC | 0x00000023)
+#define EFI_SW_BS_PC_LOCATE_PROTOCOL                (EFI_SUBCLASS_SPECIFIC | 0x00000024)
+#define EFI_SW_BS_PC_INSTALL_MULTIPLE_INTERFACES    (EFI_SUBCLASS_SPECIFIC | 0x00000025)
+#define EFI_SW_BS_PC_UNINSTALL_MULTIPLE_INTERFACES  (EFI_SUBCLASS_SPECIFIC | 0x00000026)
+#define EFI_SW_BS_PC_CALCULATE_CRC_32               (EFI_SUBCLASS_SPECIFIC | 0x00000027)
+#define EFI_SW_BS_PC_COPY_MEM                       (EFI_SUBCLASS_SPECIFIC | 0x00000028)
+#define EFI_SW_BS_PC_SET_MEM                        (EFI_SUBCLASS_SPECIFIC | 0x00000029)
+#define EFI_SW_BS_PC_CREATE_EVENT_EX                (EFI_SUBCLASS_SPECIFIC | 0x0000002A)
+///@}
+
+///
+/// Software Class EFI Runtime Services Subclass Progress Code definitions.
+///
+///@{
+#define EFI_SW_RS_PC_GET_TIME                       (EFI_SUBCLASS_SPECIFIC | 0x00000000)
+#define EFI_SW_RS_PC_SET_TIME                       (EFI_SUBCLASS_SPECIFIC | 0x00000001)
+#define EFI_SW_RS_PC_GET_WAKEUP_TIME                (EFI_SUBCLASS_SPECIFIC | 0x00000002)
+#define EFI_SW_RS_PC_SET_WAKEUP_TIME                (EFI_SUBCLASS_SPECIFIC | 0x00000003)
+#define EFI_SW_RS_PC_SET_VIRTUAL_ADDRESS_MAP        (EFI_SUBCLASS_SPECIFIC | 0x00000004)
+#define EFI_SW_RS_PC_CONVERT_POINTER                (EFI_SUBCLASS_SPECIFIC | 0x00000005)
+#define EFI_SW_RS_PC_GET_VARIABLE                   (EFI_SUBCLASS_SPECIFIC | 0x00000006)
+#define EFI_SW_RS_PC_GET_NEXT_VARIABLE_NAME         (EFI_SUBCLASS_SPECIFIC | 0x00000007)
+#define EFI_SW_RS_PC_SET_VARIABLE                   (EFI_SUBCLASS_SPECIFIC | 0x00000008)
+#define EFI_SW_RS_PC_GET_NEXT_HIGH_MONOTONIC_COUNT  (EFI_SUBCLASS_SPECIFIC | 0x00000009)
+#define EFI_SW_RS_PC_RESET_SYSTEM                   (EFI_SUBCLASS_SPECIFIC | 0x0000000A)
+#define EFI_SW_RS_PC_UPDATE_CAPSULE                 (EFI_SUBCLASS_SPECIFIC | 0x0000000B)
+#define EFI_SW_RS_PC_QUERY_CAPSULE_CAPABILITIES     (EFI_SUBCLASS_SPECIFIC | 0x0000000C)
+#define EFI_SW_RS_PC_QUERY_VARIABLE_INFO            (EFI_SUBCLASS_SPECIFIC | 0x0000000D)
+///@}
+
+///
+/// Software Class EFI DXE Services Subclass Progress Code definitions
+///
+///@{
+#define EFI_SW_DS_PC_ADD_MEMORY_SPACE             (EFI_SUBCLASS_SPECIFIC | 0x00000000)
+#define EFI_SW_DS_PC_ALLOCATE_MEMORY_SPACE        (EFI_SUBCLASS_SPECIFIC | 0x00000001)
+#define EFI_SW_DS_PC_FREE_MEMORY_SPACE            (EFI_SUBCLASS_SPECIFIC | 0x00000002)
+#define EFI_SW_DS_PC_REMOVE_MEMORY_SPACE          (EFI_SUBCLASS_SPECIFIC | 0x00000003)
+#define EFI_SW_DS_PC_GET_MEMORY_SPACE_DESCRIPTOR  (EFI_SUBCLASS_SPECIFIC | 0x00000004)
+#define EFI_SW_DS_PC_SET_MEMORY_SPACE_ATTRIBUTES  (EFI_SUBCLASS_SPECIFIC | 0x00000005)
+#define EFI_SW_DS_PC_GET_MEMORY_SPACE_MAP         (EFI_SUBCLASS_SPECIFIC | 0x00000006)
+#define EFI_SW_DS_PC_ADD_IO_SPACE                 (EFI_SUBCLASS_SPECIFIC | 0x00000007)
+#define EFI_SW_DS_PC_ALLOCATE_IO_SPACE            (EFI_SUBCLASS_SPECIFIC | 0x00000008)
+#define EFI_SW_DS_PC_FREE_IO_SPACE                (EFI_SUBCLASS_SPECIFIC | 0x00000009)
+#define EFI_SW_DS_PC_REMOVE_IO_SPACE              (EFI_SUBCLASS_SPECIFIC | 0x0000000A)
+#define EFI_SW_DS_PC_GET_IO_SPACE_DESCRIPTOR      (EFI_SUBCLASS_SPECIFIC | 0x0000000B)
+#define EFI_SW_DS_PC_GET_IO_SPACE_MAP             (EFI_SUBCLASS_SPECIFIC | 0x0000000C)
+#define EFI_SW_DS_PC_DISPATCH                     (EFI_SUBCLASS_SPECIFIC | 0x0000000D)
+#define EFI_SW_DS_PC_SCHEDULE                     (EFI_SUBCLASS_SPECIFIC | 0x0000000E)
+#define EFI_SW_DS_PC_TRUST                        (EFI_SUBCLASS_SPECIFIC | 0x0000000F)
+#define EFI_SW_DS_PC_PROCESS_FIRMWARE_VOLUME      (EFI_SUBCLASS_SPECIFIC | 0x00000010)
+///@}
+
+///
+/// Software Class Error Code definitions.
+/// These are shared by all subclasses.
+///
+///@{
+#define EFI_SW_EC_NON_SPECIFIC            0x00000000
+#define EFI_SW_EC_LOAD_ERROR              0x00000001
+#define EFI_SW_EC_INVALID_PARAMETER       0x00000002
+#define EFI_SW_EC_UNSUPPORTED             0x00000003
+#define EFI_SW_EC_INVALID_BUFFER          0x00000004
+#define EFI_SW_EC_OUT_OF_RESOURCES        0x00000005
+#define EFI_SW_EC_ABORTED                 0x00000006
+#define EFI_SW_EC_ILLEGAL_SOFTWARE_STATE  0x00000007
+#define EFI_SW_EC_ILLEGAL_HARDWARE_STATE  0x00000008
+#define EFI_SW_EC_START_ERROR             0x00000009
+#define EFI_SW_EC_BAD_DATE_TIME           0x0000000A
+#define EFI_SW_EC_CFG_INVALID             0x0000000B
+#define EFI_SW_EC_CFG_CLR_REQUEST         0x0000000C
+#define EFI_SW_EC_CFG_DEFAULT             0x0000000D
+#define EFI_SW_EC_PWD_INVALID             0x0000000E
+#define EFI_SW_EC_PWD_CLR_REQUEST         0x0000000F
+#define EFI_SW_EC_PWD_CLEARED             0x00000010
+#define EFI_SW_EC_EVENT_LOG_FULL          0x00000011
+///@}
+
+//
+// Software Class Unspecified Subclass Error Code definitions.
+//
+
+//
+// Software Class SEC Subclass Error Code definitions.
+//
+
+///
+/// Software Class PEI Core Subclass Error Code definitions.
+///
+///@{
+#define EFI_SW_PEI_CORE_EC_DXE_CORRUPT           (EFI_SUBCLASS_SPECIFIC | 0x00000000)
+#define EFI_SW_PEI_CORE_EC_DXEIPL_NOT_FOUND      (EFI_SUBCLASS_SPECIFIC | 0x00000001)
+#define EFI_SW_PEI_CORE_EC_MEMORY_NOT_INSTALLED  (EFI_SUBCLASS_SPECIFIC | 0x00000002)
+///@}
+
+///
+/// Software Class PEI Module Subclass Error Code definitions.
+///
+///@{
+#define EFI_SW_PEIM_EC_NO_RECOVERY_CAPSULE         (EFI_SUBCLASS_SPECIFIC | 0x00000000)
+#define EFI_SW_PEIM_EC_INVALID_CAPSULE_DESCRIPTOR  (EFI_SUBCLASS_SPECIFIC | 0x00000001)
+#define EFI_SW_PEI_EC_S3_RESUME_PPI_NOT_FOUND      (EFI_SUBCLASS_SPECIFIC | 0x00000002)
+#define EFI_SW_PEI_EC_S3_BOOT_SCRIPT_ERROR         (EFI_SUBCLASS_SPECIFIC | 0x00000003)
+#define EFI_SW_PEI_EC_S3_OS_WAKE_ERROR             (EFI_SUBCLASS_SPECIFIC | 0x00000004)
+#define EFI_SW_PEI_EC_S3_RESUME_FAILED             (EFI_SUBCLASS_SPECIFIC | 0x00000005)
+#define EFI_SW_PEI_EC_RECOVERY_PPI_NOT_FOUND       (EFI_SUBCLASS_SPECIFIC | 0x00000006)
+#define EFI_SW_PEI_EC_RECOVERY_FAILED              (EFI_SUBCLASS_SPECIFIC | 0x00000007)
+///@}
+
+///
+/// Software Class DXE Foundation Subclass Error Code definitions.
+///
+///@{
+#define EFI_SW_DXE_CORE_EC_NO_ARCH                (EFI_SUBCLASS_SPECIFIC | 0x00000000)
+///@}
+
+
+///
+/// Software Class DXE Boot Service Driver Subclass Error Code definitions.
+///
+///@{
+#define EFI_SW_DXE_BS_EC_LEGACY_OPROM_NO_SPACE   (EFI_SUBCLASS_SPECIFIC | 0x00000000)
+#define EFI_SW_DXE_BS_EC_INVALID_PASSWORD        (EFI_SUBCLASS_SPECIFIC | 0x00000001)
+#define EFI_SW_DXE_BS_EC_BOOT_OPTION_LOAD_ERROR  (EFI_SUBCLASS_SPECIFIC | 0x00000002)
+#define EFI_SW_DXE_BS_EC_BOOT_OPTION_FAILED      (EFI_SUBCLASS_SPECIFIC | 0x00000003)
+#define EFI_SW_DXE_BS_EC_INVALID_IDE_PASSWORD    (EFI_SUBCLASS_SPECIFIC | 0x00000004)
+///@}
+
+//
+// Software Class DXE Runtime Service Driver Subclass Error Code definitions.
+//
+
+//
+// Software Class SMM Driver Subclass Error Code definitions.
+//
+
+//
+// Software Class EFI Application Subclass Error Code definitions.
+//
+
+//
+// Software Class EFI OS Loader Subclass Error Code definitions.
+//
+
+//
+// Software Class EFI RT Subclass Error Code definitions.
+//
+
+//
+// Software Class EFI AL Subclass Error Code definitions.
+//
+
+///
+/// Software Class EBC Exception Subclass Error Code definitions.
+/// These exceptions are derived from the debug protocol definitions in the EFI
+/// specification.
+///
+///@{
+#define EFI_SW_EC_EBC_UNDEFINED             0x00000000
+#define EFI_SW_EC_EBC_DIVIDE_ERROR          EXCEPT_EBC_DIVIDE_ERROR
+#define EFI_SW_EC_EBC_DEBUG                 EXCEPT_EBC_DEBUG
+#define EFI_SW_EC_EBC_BREAKPOINT            EXCEPT_EBC_BREAKPOINT
+#define EFI_SW_EC_EBC_OVERFLOW              EXCEPT_EBC_OVERFLOW
+#define EFI_SW_EC_EBC_INVALID_OPCODE        EXCEPT_EBC_INVALID_OPCODE
+#define EFI_SW_EC_EBC_STACK_FAULT           EXCEPT_EBC_STACK_FAULT
+#define EFI_SW_EC_EBC_ALIGNMENT_CHECK       EXCEPT_EBC_ALIGNMENT_CHECK
+#define EFI_SW_EC_EBC_INSTRUCTION_ENCODING  EXCEPT_EBC_INSTRUCTION_ENCODING
+#define EFI_SW_EC_EBC_BAD_BREAK             EXCEPT_EBC_BAD_BREAK
+#define EFI_SW_EC_EBC_STEP                  EXCEPT_EBC_STEP
+///@}
+
+///
+/// Software Class IA32 Exception Subclass Error Code definitions.
+/// These exceptions are derived from the debug protocol definitions in the EFI
+/// specification.
+///
+///@{
+#define EFI_SW_EC_IA32_DIVIDE_ERROR     EXCEPT_IA32_DIVIDE_ERROR
+#define EFI_SW_EC_IA32_DEBUG            EXCEPT_IA32_DEBUG
+#define EFI_SW_EC_IA32_NMI              EXCEPT_IA32_NMI
+#define EFI_SW_EC_IA32_BREAKPOINT       EXCEPT_IA32_BREAKPOINT
+#define EFI_SW_EC_IA32_OVERFLOW         EXCEPT_IA32_OVERFLOW
+#define EFI_SW_EC_IA32_BOUND            EXCEPT_IA32_BOUND
+#define EFI_SW_EC_IA32_INVALID_OPCODE   EXCEPT_IA32_INVALID_OPCODE
+#define EFI_SW_EC_IA32_DOUBLE_FAULT     EXCEPT_IA32_DOUBLE_FAULT
+#define EFI_SW_EC_IA32_INVALID_TSS      EXCEPT_IA32_INVALID_TSS
+#define EFI_SW_EC_IA32_SEG_NOT_PRESENT  EXCEPT_IA32_SEG_NOT_PRESENT
+#define EFI_SW_EC_IA32_STACK_FAULT      EXCEPT_IA32_STACK_FAULT
+#define EFI_SW_EC_IA32_GP_FAULT         EXCEPT_IA32_GP_FAULT
+#define EFI_SW_EC_IA32_PAGE_FAULT       EXCEPT_IA32_PAGE_FAULT
+#define EFI_SW_EC_IA32_FP_ERROR         EXCEPT_IA32_FP_ERROR
+#define EFI_SW_EC_IA32_ALIGNMENT_CHECK  EXCEPT_IA32_ALIGNMENT_CHECK
+#define EFI_SW_EC_IA32_MACHINE_CHECK    EXCEPT_IA32_MACHINE_CHECK
+#define EFI_SW_EC_IA32_SIMD             EXCEPT_IA32_SIMD
+///@}
+
+///
+/// Software Class IPF Exception Subclass Error Code definitions.
+/// These exceptions are derived from the debug protocol definitions in the EFI
+/// specification.
+///
+///@{
+#define EFI_SW_EC_IPF_ALT_DTLB            EXCEPT_IPF_ALT_DTLB
+#define EFI_SW_EC_IPF_DNESTED_TLB         EXCEPT_IPF_DNESTED_TLB
+#define EFI_SW_EC_IPF_BREAKPOINT          EXCEPT_IPF_BREAKPOINT
+#define EFI_SW_EC_IPF_EXTERNAL_INTERRUPT  EXCEPT_IPF_EXTERNAL_INTERRUPT
+#define EFI_SW_EC_IPF_GEN_EXCEPT          EXCEPT_IPF_GEN_EXCEPT
+#define EFI_SW_EC_IPF_NAT_CONSUMPTION     EXCEPT_IPF_NAT_CONSUMPTION
+#define EFI_SW_EC_IPF_DEBUG_EXCEPT        EXCEPT_IPF_DEBUG_EXCEPT
+#define EFI_SW_EC_IPF_UNALIGNED_ACCESS    EXCEPT_IPF_UNALIGNED_ACCESS
+#define EFI_SW_EC_IPF_FP_FAULT            EXCEPT_IPF_FP_FAULT
+#define EFI_SW_EC_IPF_FP_TRAP             EXCEPT_IPF_FP_TRAP
+#define EFI_SW_EC_IPF_TAKEN_BRANCH        EXCEPT_IPF_TAKEN_BRANCH
+#define EFI_SW_EC_IPF_SINGLE_STEP         EXCEPT_IPF_SINGLE_STEP
+///@}
+
+///
+/// Software Class PEI Service Subclass Error Code definitions.
+///
+///@{
+#define EFI_SW_PS_EC_RESET_NOT_AVAILABLE     (EFI_SUBCLASS_SPECIFIC | 0x00000000)
+#define EFI_SW_PS_EC_MEMORY_INSTALLED_TWICE  (EFI_SUBCLASS_SPECIFIC | 0x00000001)
+///@}
+
+//
+// Software Class EFI Boot Service Subclass Error Code definitions.
+//
+
+//
+// Software Class EFI Runtime Service Subclass Error Code definitions.
+//
+
+//
+// Software Class EFI DXE Service Subclass Error Code definitions.
+//
+
+#endif
diff --git a/src/include/gpxe/efi/PiDxe.h b/src/include/gpxe/efi/PiDxe.h
index c326302..526ea06 100644
--- a/src/include/gpxe/efi/PiDxe.h
+++ b/src/include/gpxe/efi/PiDxe.h
@@ -1,12 +1,12 @@
 /** @file
 
-  Root include file for Mde Package DXE_CORE, DXE, SMM, SAL type modules.
+  Root include file for Mde Package DXE_CORE, DXE, RUNTIME, SMM, SAL type modules.
 
-Copyright (c) 2006 - 2007, Intel Corporation
-All rights reserved. This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution.  The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
+Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
+This program and the accompanying materials are licensed and made available under
+the terms and conditions of the BSD License that accompanies this distribution.
+The full text of the license may be found at
+http://opensource.org/licenses/bsd-license.php.
 
 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
diff --git a/src/include/gpxe/efi/Protocol/ComponentName2.h b/src/include/gpxe/efi/Protocol/ComponentName2.h
index 0f01014..3c5ec07 100644
--- a/src/include/gpxe/efi/Protocol/ComponentName2.h
+++ b/src/include/gpxe/efi/Protocol/ComponentName2.h
@@ -3,8 +3,8 @@
   This protocol is used to retrieve user readable names of drivers
   and controllers managed by UEFI Drivers.
 
-  Copyright (c) 2006 - 2008, Intel Corporation
-  All rights reserved. This program and the accompanying materials
+  Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
+  This program and the accompanying materials
   are licensed and made available under the terms and conditions of the BSD License
   which accompanies this distribution.  The full text of the license may be found at
   http://opensource.org/licenses/bsd-license.php
@@ -27,7 +27,7 @@ typedef struct _EFI_COMPONENT_NAME2_PROTOCOL  EFI_COMPONENT_NAME2_PROTOCOL;
 
 
 /**
-  Retrieves a Unicode string that is the user readable name of
+  Retrieves a string that is the user readable name of
   the EFI Driver.
 
   @param  This       A pointer to the
@@ -40,15 +40,15 @@ typedef struct _EFI_COMPONENT_NAME2_PROTOCOL  EFI_COMPONENT_NAME2_PROTOCOL;
                      languages specified in SupportedLanguages.
                      The number of languages supported by a
                      driver is up to the driver writer. Language
-                     is specified in RFC 3066 language code
+                     is specified in RFC 4646 language code
                      format.
 
-  @param  DriverName A pointer to the Unicode string to return.
-                     This Unicode string is the name of the
+  @param  DriverName A pointer to the string to return.
+                     This string is the name of the
                      driver specified by This in the language
                      specified by Language.
 
-  @retval EFI_SUCCESS           The Unicode string for the
+  @retval EFI_SUCCESS           The string for the
                                 Driver specified by This and the
                                 language specified by Language
                                 was returned in DriverName.
@@ -72,7 +72,7 @@ EFI_STATUS
 
 
 /**
-  Retrieves a Unicode string that is the user readable name of
+  Retrieves a string that is the user readable name of
   the controller that is being managed by an EFI Driver.
 
   @param  This             A pointer to the
@@ -83,11 +83,11 @@ EFI_STATUS
                            This handle specifies the controller
                            whose name is to be returned.
 
-  @param ChildHandle      The handle of the child controller to
+  @param  ChildHandle      The handle of the child controller to
                            retrieve the name of.  This is an
                            optional parameter that may be NULL.
                            It will be NULL for device drivers.
-                           It will also be NULL for a bus
+                           It will also be NULL for bus
                            drivers that wish to retrieve the
                            name of the bus controller.  It will
                            not be NULL for a bus driver that
@@ -103,18 +103,17 @@ EFI_STATUS
                            SupportedLanguages. The number of
                            languages supported by a driver is up
                            to the driver writer. Language is
-                           specified in RFC 3066 language code
+                           specified in RFC 4646 language code
                            format.
 
-  @param  ControllerName   A pointer to the Unicode string to
-                           return.  This Unicode string is the
-                           name of the controller specified by
-                           ControllerHandle and ChildHandle in
-                           the language specified by Language
+  @param  ControllerName   A pointer to the string to return.
+                           This string is the name of the controller
+                           specified by ControllerHandle and ChildHandle
+                           in the language specified by Language
                            from the point of view of the driver
                            specified by This.
 
-  @retval EFI_SUCCESS           The Unicode string for the user
+  @retval EFI_SUCCESS           The string for the user
                                 readable name in the language
                                 specified by Language for the
                                 driver specified by This was
@@ -164,7 +163,7 @@ struct _EFI_COMPONENT_NAME2_PROTOCOL {
   /// supported language codes. This is the list of language codes that
   /// this protocol supports. The number of languages supported by a
   /// driver is up to the driver writer. SupportedLanguages is
-  /// specified in RFC 3066 format.
+  /// specified in RFC 4646 format.
   ///
   CHAR8                                    *SupportedLanguages;
 };
diff --git a/src/include/gpxe/efi/Protocol/Cpu.h b/src/include/gpxe/efi/Protocol/Cpu.h
index da3d0fd..80e135a 100644
--- a/src/include/gpxe/efi/Protocol/Cpu.h
+++ b/src/include/gpxe/efi/Protocol/Cpu.h
@@ -3,8 +3,8 @@
 
   This code abstracts the DXE core from processor implementation details.
 
-  Copyright (c) 2006 - 2008, Intel Corporation
-  All rights reserved. This program and the accompanying materials
+  Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
+  This program and the accompanying materials
   are licensed and made available under the terms and conditions of the BSD License
   which accompanies this distribution.  The full text of the license may be found at
   http://opensource.org/licenses/bsd-license.php
@@ -24,6 +24,9 @@
 
 typedef struct _EFI_CPU_ARCH_PROTOCOL   EFI_CPU_ARCH_PROTOCOL;
 
+///
+/// The type of flush operation
+///
 typedef enum {
   EfiCpuFlushTypeWriteBackInvalidate,
   EfiCpuFlushTypeWriteBack,
@@ -31,6 +34,9 @@ typedef enum {
   EfiCpuMaxFlushType
 } EFI_CPU_FLUSH_TYPE;
 
+///
+/// The type of processor INIT.
+///
 typedef enum {
   EfiCpuInit,
   EfiCpuMaxInitType
@@ -206,7 +212,8 @@ EFI_STATUS
                            must be between 0 and NumberOfTimers-1.
   @param  TimerValue       Pointer to the returned timer value.
   @param  TimerPeriod      A pointer to the amount of time that passes in femtoseconds for each increment
-                           of TimerValue.
+                           of TimerValue. If TimerValue does not increment at a predictable rate, then 0 is
+                           returned. This parameter is optional and may be NULL.
 
   @retval EFI_SUCCESS           The processor timer value specified by TimerIndex was returned in TimerValue.
   @retval EFI_DEVICE_ERROR      An error occurred attempting to read one of the processor's timers.
diff --git a/src/include/gpxe/efi/Protocol/CpuIo.h b/src/include/gpxe/efi/Protocol/CpuIo.h
index 8d35c6c..76974d7 100644
--- a/src/include/gpxe/efi/Protocol/CpuIo.h
+++ b/src/include/gpxe/efi/Protocol/CpuIo.h
@@ -2,126 +2,44 @@
   This code abstracts the CPU IO Protocol which installed by some platform or chipset-specific
   PEIM that abstracts the processor-visible I/O operations.
 
-  Copyright (c) 2007, Intel Corporation
-  All rights reserved. This program and the accompanying materials
-  are licensed and made available under the terms and conditions of the BSD License
-  which accompanies this distribution.  The full text of the license may be found at
-  http://opensource.org/licenses/bsd-license.php
+  Note: This is a runtime protocol and can be used by runtime drivers after ExitBootServices().
+  It is different from the PI 1.2 CPU I/O 2 Protocol, which is a boot services only protocol
+  and may not be used by runtime drivers after ExitBootServices().
 
-  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
+This program and the accompanying materials are licensed and made available under
+the terms and conditions of the BSD License that accompanies this distribution.
+The full text of the license may be found at
+http://opensource.org/licenses/bsd-license.php.
 
-  Module Name:  CpuIO.h
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 
   @par Revision Reference:
   CPU IO Protocol is defined in Framework of EFI CPU IO Protocol Spec
-  Version 0.9
+  Version 0.9.
 
 **/
 
 #ifndef _CPUIO_H_
 #define _CPUIO_H_
 
-#include <gpxe/efi/PiDxe.h>
+#include <gpxe/efi/Protocol/CpuIo2.h>
 
 #define EFI_CPU_IO_PROTOCOL_GUID \
   { \
     0xB0732526, 0x38C8, 0x4b40, {0x88, 0x77, 0x61, 0xC7, 0xB0, 0x6A, 0xAC, 0x45 } \
   }
 
-typedef struct _EFI_CPU_IO_PROTOCOL EFI_CPU_IO_PROTOCOL;
-
-//
-// *******************************************************
-// EFI_CPU_IO_PROTOCOL_WIDTH
-// *******************************************************
-//
-typedef enum {
-  EfiCpuIoWidthUint8,
-  EfiCpuIoWidthUint16,
-  EfiCpuIoWidthUint32,
-  EfiCpuIoWidthUint64,
-  EfiCpuIoWidthFifoUint8,
-  EfiCpuIoWidthFifoUint16,
-  EfiCpuIoWidthFifoUint32,
-  EfiCpuIoWidthFifoUint64,
-  EfiCpuIoWidthFillUint8,
-  EfiCpuIoWidthFillUint16,
-  EfiCpuIoWidthFillUint32,
-  EfiCpuIoWidthFillUint64,
-  EfiCpuIoWidthMaximum
-} EFI_CPU_IO_PROTOCOL_WIDTH;
-
-//
-// *******************************************************
-// EFI_CPU_IO_PROTOCOL_IO_MEM
-// *******************************************************
-//
-/**
-  Enables a driver to access memory-mapped registers in the EFI system memory space.
-  Or, Enables a driver to access registers in the EFI CPU I/O space.
-
-  @param  This                  A pointer to the EFI_CPU_IO_PROTOCOL instance.
-  @param  Width                 Signifies the width of the I/O or Memory operation.
-  @param  Address               The base address of the I/O or Memoryoperation.
-  @param  Count                 The number of I/O or Memory operations to perform.
-                                The number of bytes moved is Width size * Count, starting at Address.
-  @param  Buffer                For read operations, the destination buffer to store the results.
-                                For write operations, the source buffer from which to write data.
-
-  @retval EFI_SUCCESS           The data was read from or written to the EFI system.
-  @retval EFI_INVALID_PARAMETER Width is invalid for this EFI system.Or Buffer is NULL.
-  @retval EFI_UNSUPPORTED       The Buffer is not aligned for the given Width.
-                                Or,The address range specified by Address, Width, and Count is not valid for this EFI system.
-
-**/
-typedef
-EFI_STATUS
-(EFIAPI *EFI_CPU_IO_PROTOCOL_IO_MEM)(
-  IN EFI_CPU_IO_PROTOCOL                *This,
-  IN  EFI_CPU_IO_PROTOCOL_WIDTH         Width,
-  IN  UINT64                            Address,
-  IN  UINTN                             Count,
-  IN  OUT VOID                          *Buffer
-  );
-
-//
-// *******************************************************
-// EFI_CPU_IO_PROTOCOL_ACCESS
-// *******************************************************
 //
-typedef struct {
-  EFI_CPU_IO_PROTOCOL_IO_MEM  Read;
-  EFI_CPU_IO_PROTOCOL_IO_MEM  Write;
-} EFI_CPU_IO_PROTOCOL_ACCESS;
-
+// Framework CPU IO protocol structure is the same as CPU IO 2 protocol defined in PI 1.2 spec.
+// However, there is a significant different between the Framework CPU I/O
+// Protocol and the PI 1.2 CPU I/O 2 Protocol.  The Framework one is a runtime
+// protocol, which means it can be used by runtime drivers after ExitBootServices().
+// The PI one is not runtime safe, so it is a boot services only protocol and may
+// not be used by runtime drivers after ExitBootServices().
 //
-// *******************************************************
-// EFI_CPU_IO_PROTOCOL
-// *******************************************************
-//
-/**
-  @par Protocol Description:
-  Provides the basic memory and I/O interfaces that are used to abstract
-  accesses to devices in a system.
-
-  @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.
-
-**/
-struct _EFI_CPU_IO_PROTOCOL {
-  EFI_CPU_IO_PROTOCOL_ACCESS  Mem;
-  EFI_CPU_IO_PROTOCOL_ACCESS  Io;
-};
+typedef EFI_CPU_IO2_PROTOCOL EFI_CPU_IO_PROTOCOL;
 
 extern EFI_GUID gEfiCpuIoProtocolGuid;
 
diff --git a/src/include/gpxe/efi/Protocol/CpuIo2.h b/src/include/gpxe/efi/Protocol/CpuIo2.h
new file mode 100644
index 0000000..e6fd0f2
--- /dev/null
+++ b/src/include/gpxe/efi/Protocol/CpuIo2.h
@@ -0,0 +1,142 @@
+/** @file
+  This files describes the CPU I/O 2 Protocol.
+
+  This protocol provides an I/O abstraction for a system processor. This protocol
+  is used by a PCI root bridge I/O driver to perform memory-mapped I/O and I/O transactions.
+  The I/O or memory primitives can be used by the consumer of the protocol to materialize
+  bus-specific configuration cycles, such as the transitional configuration address and data
+  ports for PCI. Only drivers that require direct access to the entire system should use this
+  protocol.
+
+  Note: This is a boot-services only protocol and it may not be used by runtime drivers after
+  ExitBootServices(). It is different from the Framework CPU I/O Protocol, which is a runtime
+  protocol and can be used by runtime drivers after ExitBootServices().
+
+  Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
+  This program and the accompanying materials
+  are licensed and made available under the terms and conditions of the BSD License
+  which accompanies this distribution.  The full text of the license may be found at
+  http://opensource.org/licenses/bsd-license.php
+
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+  @par Revision Reference:
+  This Protocol is defined in UEFI Platform Initialization Specification 1.2
+  Volume 5: Standards
+
+**/
+
+#ifndef __CPU_IO2_H__
+#define __CPU_IO2_H__
+
+#define EFI_CPU_IO2_PROTOCOL_GUID \
+  { \
+    0xad61f191, 0xae5f, 0x4c0e, {0xb9, 0xfa, 0xe8, 0x69, 0xd2, 0x88, 0xc6, 0x4f} \
+  }
+
+typedef struct _EFI_CPU_IO2_PROTOCOL EFI_CPU_IO2_PROTOCOL;
+
+///
+/// Enumeration that defines the width of the I/O operation.
+///
+typedef enum {
+  EfiCpuIoWidthUint8,
+  EfiCpuIoWidthUint16,
+  EfiCpuIoWidthUint32,
+  EfiCpuIoWidthUint64,
+  EfiCpuIoWidthFifoUint8,
+  EfiCpuIoWidthFifoUint16,
+  EfiCpuIoWidthFifoUint32,
+  EfiCpuIoWidthFifoUint64,
+  EfiCpuIoWidthFillUint8,
+  EfiCpuIoWidthFillUint16,
+  EfiCpuIoWidthFillUint32,
+  EfiCpuIoWidthFillUint64,
+  EfiCpuIoWidthMaximum
+} EFI_CPU_IO_PROTOCOL_WIDTH;
+
+/**
+  Enables a driver to access registers in the PI CPU I/O space.
+
+  The Io.Read() and Io.Write() functions enable a driver to access PCI controller
+  registers in the PI CPU I/O space.
+
+  The I/O operations are carried out exactly as requested. The caller is responsible
+  for satisfying any alignment and I/O width restrictions that a PI System on a
+  platform might require. For example on some platforms, width requests of
+  EfiCpuIoWidthUint64 do not work. Misaligned buffers, on the other hand, will
+  be handled by the driver.
+
+  If Width is EfiCpuIoWidthUint8, EfiCpuIoWidthUint16, EfiCpuIoWidthUint32,
+  or EfiCpuIoWidthUint64, then both Address and Buffer are incremented for
+  each of the Count operations that is performed.
+
+  If Width is EfiCpuIoWidthFifoUint8, EfiCpuIoWidthFifoUint16,
+  EfiCpuIoWidthFifoUint32, or EfiCpuIoWidthFifoUint64, then only Buffer is
+  incremented for each of the Count operations that is performed. The read or
+  write operation is performed Count times on the same Address.
+
+  If Width is EfiCpuIoWidthFillUint8, EfiCpuIoWidthFillUint16,
+  EfiCpuIoWidthFillUint32, or EfiCpuIoWidthFillUint64, then only Address is
+  incremented for each of the Count operations that is performed. The read or
+  write operation is performed Count times from the first element of Buffer.
+
+  @param[in]       This     A pointer to the EFI_CPU_IO2_PROTOCOL instance.
+  @param[in]       Width    Signifies the width of the I/O or Memory operation.
+  @param[in]       Address  The base address of the I/O operation.
+  @param[in]       Count    The number of I/O operations to perform. The number
+                            of bytes moved is Width size * Count, starting at Address.
+  @param[in, out]  Buffer   For read operations, the destination buffer to store the results.
+                            For write operations, the source buffer from which to write data.
+
+  @retval EFI_SUCCESS            The data was read from or written to the PI system.
+  @retval EFI_INVALID_PARAMETER  Width is invalid for this PI system.
+  @retval EFI_INVALID_PARAMETER  Buffer is NULL.
+  @retval EFI_UNSUPPORTED        The Buffer is not aligned for the given Width.
+  @retval EFI_UNSUPPORTED        The address range specified by Address, Width,
+                                 and Count is not valid for this PI system.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_CPU_IO_PROTOCOL_IO_MEM)(
+  IN     EFI_CPU_IO2_PROTOCOL              *This,
+  IN     EFI_CPU_IO_PROTOCOL_WIDTH         Width,
+  IN     UINT64                            Address,
+  IN     UINTN                             Count,
+  IN OUT VOID                              *Buffer
+  );
+
+///
+/// Service for read and write accesses.
+///
+typedef struct {
+  ///
+  /// This service provides the various modalities of memory and I/O read.
+  ///
+  EFI_CPU_IO_PROTOCOL_IO_MEM  Read;
+  ///
+  /// This service provides the various modalities of memory and I/O write.
+  ///
+  EFI_CPU_IO_PROTOCOL_IO_MEM  Write;
+} EFI_CPU_IO_PROTOCOL_ACCESS;
+
+///
+/// Provides the basic memory and I/O interfaces that are used to abstract
+/// accesses to devices in a system.
+///
+struct _EFI_CPU_IO2_PROTOCOL {
+  ///
+  /// Enables a driver to access memory-mapped registers in the EFI system memory space.
+  ///
+  EFI_CPU_IO_PROTOCOL_ACCESS  Mem;
+  ///
+  /// Enables a driver to access registers in the EFI CPU I/O space.
+  ///
+  EFI_CPU_IO_PROTOCOL_ACCESS  Io;
+};
+
+extern EFI_GUID gEfiCpuIo2ProtocolGuid;
+
+#endif
diff --git a/src/include/gpxe/efi/Protocol/DebugSupport.h b/src/include/gpxe/efi/Protocol/DebugSupport.h
index c8db249..9ddb0b5 100644
--- a/src/include/gpxe/efi/Protocol/DebugSupport.h
+++ b/src/include/gpxe/efi/Protocol/DebugSupport.h
@@ -5,27 +5,26 @@
   The DebugSupport protocol is used by source level debuggers to abstract the
   processor and handle context save and restore operations.
 
-  Copyright (c) 2006 - 2008, Intel Corporation
-  All rights reserved. This program and the accompanying materials
-  are licensed and made available under the terms and conditions of the BSD License
-  which accompanies this distribution.  The full text of the license may be found at
-  http://opensource.org/licenses/bsd-license.php
+Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
+This program and the accompanying materials are licensed and made available under
+the terms and conditions of the BSD License that accompanies this distribution.
+The full text of the license may be found at
+http://opensource.org/licenses/bsd-license.php.
 
-  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 
 **/
 
 #ifndef __DEBUG_SUPPORT_H__
 #define __DEBUG_SUPPORT_H__
 
-#include <gpxe/efi/ProcessorBind.h>
 #include <gpxe/efi/IndustryStandard/PeImage.h>
 
 typedef struct _EFI_DEBUG_SUPPORT_PROTOCOL EFI_DEBUG_SUPPORT_PROTOCOL;
 
 ///
-/// Debug Support protocol {2755590C-6F3C-42FA-9EA4-A3BA543CDA25}
+/// Debug Support protocol {2755590C-6F3C-42FA-9EA4-A3BA543CDA25}.
 ///
 #define EFI_DEBUG_SUPPORT_PROTOCOL_GUID \
   { \
@@ -33,13 +32,14 @@ typedef struct _EFI_DEBUG_SUPPORT_PROTOCOL EFI_DEBUG_SUPPORT_PROTOCOL;
   }
 
 ///
-/// Debug Support definitions
+/// Processor exception to be hooked.
+/// All exception types for IA32, X64, Itanium and EBC processors are defined.
 ///
 typedef INTN  EFI_EXCEPTION_TYPE;
 
-//
-//  IA-32 processor exception types
-//
+///
+///  IA-32 processor exception types.
+///
 #define EXCEPT_IA32_DIVIDE_ERROR    0
 #define EXCEPT_IA32_DEBUG           1
 #define EXCEPT_IA32_NMI             2
@@ -59,11 +59,8 @@ typedef INTN  EFI_EXCEPTION_TYPE;
 #define EXCEPT_IA32_SIMD            19
 
 ///
-///  IA-32 processor context definition
-///
-///
-/// FXSAVE_STATE
-/// FP / MMX / XMM registers (see fxrstor instruction definition)
+/// FXSAVE_STATE.
+/// FP / MMX / XMM registers (see fxrstor instruction definition).
 ///
 typedef struct {
   UINT16  Fcw;
@@ -95,6 +92,9 @@ typedef struct {
   UINT8   Reserved11[14 * 16];
 } EFI_FX_SAVE_STATE_IA32;
 
+///
+///  IA-32 processor context definition.
+///
 typedef struct {
   UINT32                 ExceptionData;
   EFI_FX_SAVE_STATE_IA32 FxSaveState;
@@ -131,9 +131,9 @@ typedef struct {
   UINT32                 Eax;
 } EFI_SYSTEM_CONTEXT_IA32;
 
-//
-//  X64 processor exception types
-//
+///
+///  x64 processor exception types.
+///
 #define EXCEPT_X64_DIVIDE_ERROR    0
 #define EXCEPT_X64_DEBUG           1
 #define EXCEPT_X64_NMI             2
@@ -153,10 +153,8 @@ typedef struct {
 #define EXCEPT_X64_SIMD            19
 
 ///
-///  X64 processor context definition
-///
-/// FXSAVE_STATE
-/// FP / MMX / XMM registers (see fxrstor instruction definition)
+/// FXSAVE_STATE.
+/// FP / MMX / XMM registers (see fxrstor instruction definition).
 ///
 typedef struct {
   UINT16  Fcw;
@@ -188,6 +186,9 @@ typedef struct {
   UINT8   Reserved11[14 * 16];
 } EFI_FX_SAVE_STATE_X64;
 
+///
+///  x64 processor context definition.
+///
 typedef struct {
   UINT64                ExceptionData;
   EFI_FX_SAVE_STATE_X64 FxSaveState;
@@ -233,9 +234,9 @@ typedef struct {
   UINT64                R15;
 } EFI_SYSTEM_CONTEXT_X64;
 
-//
-//  IPF processor exception types
-//
+///
+///  Itanium Processor Family Exception types.
+///
 #define EXCEPT_IPF_VHTP_TRANSLATION       0
 #define EXCEPT_IPF_INSTRUCTION_TLB        1
 #define EXCEPT_IPF_DATA_TLB               2
@@ -279,12 +280,12 @@ typedef struct {
 #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
-  // bits in UNAT and to insure F2 is 16 byte aligned..
+  // bits in UNAT and to insure F2 is 16 byte aligned.
   //
   UINT64  Reserved;
   UINT64  R1;
@@ -434,27 +435,27 @@ typedef struct {
 
 } EFI_SYSTEM_CONTEXT_IPF;
 
-//
-//  EBC processor exception types
-//
+///
+///  EBC processor exception types.
+///
 #define EXCEPT_EBC_UNDEFINED            0
 #define EXCEPT_EBC_DIVIDE_ERROR         1
 #define EXCEPT_EBC_DEBUG                2
 #define EXCEPT_EBC_BREAKPOINT           3
 #define EXCEPT_EBC_OVERFLOW             4
-#define EXCEPT_EBC_INVALID_OPCODE       5   // opcode out of range
+#define EXCEPT_EBC_INVALID_OPCODE       5   ///< Opcode out of range.
 #define EXCEPT_EBC_STACK_FAULT          6
 #define EXCEPT_EBC_ALIGNMENT_CHECK      7
-#define EXCEPT_EBC_INSTRUCTION_ENCODING 8   // malformed instruction
-#define EXCEPT_EBC_BAD_BREAK            9   // BREAK 0 or undefined BREAK
-#define EXCEPT_EBC_STEP                 10  // to support debug stepping
+#define EXCEPT_EBC_INSTRUCTION_ENCODING 8   ///< Malformed instruction.
+#define EXCEPT_EBC_BAD_BREAK            9   ///< BREAK 0 or undefined BREAK.
+#define EXCEPT_EBC_STEP                 10  ///< To support debug stepping.
 ///
 /// For coding convenience, define the maximum valid EBC exception.
 ///
 #define MAX_EBC_EXCEPTION EXCEPT_EBC_STEP
 
 ///
-///  EBC processor context definition
+///  EBC processor context definition.
 ///
 typedef struct {
   UINT64  R0;
@@ -470,14 +471,61 @@ typedef struct {
   UINT64  Ip;
 } EFI_SYSTEM_CONTEXT_EBC;
 
+
+
+///
+///  ARM processor exception types.
+///
+#define EXCEPT_ARM_RESET                    0
+#define EXCEPT_ARM_UNDEFINED_INSTRUCTION    1
+#define EXCEPT_ARM_SOFTWARE_INTERRUPT       2
+#define EXCEPT_ARM_PREFETCH_ABORT           3
+#define EXCEPT_ARM_DATA_ABORT               4
+#define EXCEPT_ARM_RESERVED                 5
+#define EXCEPT_ARM_IRQ                      6
+#define EXCEPT_ARM_FIQ                      7
+
+///
+/// For coding convenience, define the maximum valid ARM exception.
+///
+#define MAX_ARM_EXCEPTION EXCEPT_ARM_FIQ
+
+///
+///  ARM processor context definition.
+///
+typedef struct {
+  UINT32  R0;
+  UINT32  R1;
+  UINT32  R2;
+  UINT32  R3;
+  UINT32  R4;
+  UINT32  R5;
+  UINT32  R6;
+  UINT32  R7;
+  UINT32  R8;
+  UINT32  R9;
+  UINT32  R10;
+  UINT32  R11;
+  UINT32  R12;
+  UINT32  SP;
+  UINT32  LR;
+  UINT32  PC;
+  UINT32  CPSR;
+  UINT32  DFSR;
+  UINT32  DFAR;
+  UINT32  IFSR;
+  UINT32  IFAR;
+} EFI_SYSTEM_CONTEXT_ARM;
+
 ///
-/// Universal EFI_SYSTEM_CONTEXT definition
+/// Universal EFI_SYSTEM_CONTEXT definition.
 ///
 typedef union {
   EFI_SYSTEM_CONTEXT_EBC  *SystemContextEbc;
   EFI_SYSTEM_CONTEXT_IA32 *SystemContextIa32;
   EFI_SYSTEM_CONTEXT_X64  *SystemContextX64;
   EFI_SYSTEM_CONTEXT_IPF  *SystemContextIpf;
+  EFI_SYSTEM_CONTEXT_ARM  *SystemContextArm;
 } EFI_SYSTEM_CONTEXT;
 
 //
@@ -487,13 +535,13 @@ typedef union {
 /**
   Registers and enables an exception callback function for the specified exception.
 
-  @param  ExceptionType         Exception types in EBC, IA-32, X64, or IPF
+  @param  ExceptionType         Exception types in EBC, IA-32, x64, or IPF.
   @param  SystemContext         Exception content.
 
 **/
 typedef
 VOID
-(*EFI_EXCEPTION_CALLBACK)(
+(EFIAPI *EFI_EXCEPTION_CALLBACK)(
   IN     EFI_EXCEPTION_TYPE               ExceptionType,
   IN OUT EFI_SYSTEM_CONTEXT               SystemContext
   );
@@ -506,7 +554,7 @@ VOID
 **/
 typedef
 VOID
-(*EFI_PERIODIC_CALLBACK)(
+(EFIAPI *EFI_PERIODIC_CALLBACK)(
   IN OUT EFI_SYSTEM_CONTEXT               SystemContext
   );
 
@@ -514,10 +562,11 @@ VOID
 /// 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
+  IsaArm  = IMAGE_FILE_MACHINE_ARMTHUMB_MIXED  ///< 0x01c2
 } EFI_INSTRUCTION_SET_ARCHITECTURE;
 
 
@@ -571,7 +620,7 @@ EFI_STATUS
 
   @param  This                  A pointer to the EFI_DEBUG_SUPPORT_PROTOCOL instance.
   @param  ProcessorIndex        Specifies which processor the callback function applies to.
-  @param  PeriodicCallback      A pointer to a function of type EXCEPTION_CALLBACK that is called
+  @param  ExceptionCallback     A pointer to a function of type EXCEPTION_CALLBACK that is called
                                 when the processor exception specified by ExceptionType occurs.
   @param  ExceptionType         Specifies which processor exception to hook.
 
diff --git a/src/include/gpxe/efi/Protocol/DevicePath.h b/src/include/gpxe/efi/Protocol/DevicePath.h
index e847668..75ceff2 100644
--- a/src/include/gpxe/efi/Protocol/DevicePath.h
+++ b/src/include/gpxe/efi/Protocol/DevicePath.h
@@ -1,18 +1,18 @@
 /** @file
   The device path protocol as defined in UEFI 2.0.
 
-  The device path represents a programatic path to a device. It's the view
-  from a software point of view. It also must persist from boot to boot, so
+  The device path represents a programmatic path to a device,
+  from a software point of view. The path must persist from boot to boot, so
   it can not contain things like PCI bus numbers that change from boot to boot.
 
-  Copyright (c) 2006 - 2008, Intel Corporation
-  All rights reserved. This program and the accompanying materials
-  are licensed and made available under the terms and conditions of the BSD License
-  which accompanies this distribution.  The full text of the license may be found at
-  http://opensource.org/licenses/bsd-license.php
+Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
+This program and the accompanying materials are licensed and made available under
+the terms and conditions of the BSD License that accompanies this distribution.
+The full text of the license may be found at
+http://opensource.org/licenses/bsd-license.php.
 
-  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 
 **/
 
@@ -22,19 +22,15 @@
 #include <gpxe/efi/Guid/PcAnsi.h>
 
 ///
-/// Device Path protocol
+/// Device Path protocol.
 ///
 #define EFI_DEVICE_PATH_PROTOCOL_GUID \
   { \
     0x9576e91, 0x6d3f, 0x11d2, {0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b } \
   }
 
-//
-// Protocol GUID defined in EFI1.1.
-//
-
 ///
-/// Device Path information
+/// Device Path guid definition for backward-compatible with EFI1.1.
 ///
 #define DEVICE_PATH_PROTOCOL  EFI_DEVICE_PATH_PROTOCOL_GUID
 
@@ -49,17 +45,17 @@
   that make up the Device Path.
 **/
 typedef struct {
-  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 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
+                    ///< Device Path.
 
   UINT8 Length[2];  ///< Specific Device Path data. Type and Sub-Type define
                     ///< type of data. Size of data is included in Length.
@@ -67,70 +63,168 @@ typedef struct {
 } EFI_DEVICE_PATH_PROTOCOL;
 
 ///
-/// For backward-compatible with EFI1.1.
+/// Device Path protocol definition for backward-compatible with EFI1.1.
 ///
 typedef EFI_DEVICE_PATH_PROTOCOL  EFI_DEVICE_PATH;
 
 ///
-/// Hardware Device Paths
+/// Hardware Device Paths.
 ///
 #define HARDWARE_DEVICE_PATH      0x01
 
+///
+/// PCI Device Path SubType.
+///
 #define HW_PCI_DP                 0x01
+
+///
+/// PCI Device Path.
+///
 typedef struct {
   EFI_DEVICE_PATH_PROTOCOL        Header;
+  ///
+  /// PCI Function Number.
+  ///
   UINT8                           Function;
+  ///
+  /// PCI Device Number.
+  ///
   UINT8                           Device;
 } PCI_DEVICE_PATH;
 
+///
+/// PCCARD Device Path SubType.
+///
 #define HW_PCCARD_DP              0x02
+
+///
+/// PCCARD Device Path.
+///
 typedef struct {
   EFI_DEVICE_PATH_PROTOCOL        Header;
+  ///
+  /// Function Number (0 = First Function).
+  ///
   UINT8                           FunctionNumber;
 } PCCARD_DEVICE_PATH;
 
+///
+/// Memory Mapped Device Path SubType.
+///
 #define HW_MEMMAP_DP              0x03
+
+///
+/// Memory Mapped Device Path.
+///
 typedef struct {
   EFI_DEVICE_PATH_PROTOCOL        Header;
+  ///
+  /// EFI_MEMORY_TYPE
+  ///
   UINT32                          MemoryType;
+  ///
+  /// Starting Memory Address.
+  ///
   EFI_PHYSICAL_ADDRESS            StartingAddress;
+  ///
+  /// Ending Memory Address.
+  ///
   EFI_PHYSICAL_ADDRESS            EndingAddress;
 } MEMMAP_DEVICE_PATH;
 
+///
+/// Hardware Vendor Device Path SubType.
+///
 #define HW_VENDOR_DP              0x04
+
+///
+/// The Vendor Device Path allows the creation of vendor-defined Device Paths. A vendor must
+/// allocate a Vendor GUID for a Device Path. The Vendor GUID can then be used to define the
+/// contents on the n bytes that follow in the Vendor Device Path node.
+///
 typedef struct {
   EFI_DEVICE_PATH_PROTOCOL        Header;
+  ///
+  /// Vendor-assigned GUID that defines the data that follows.
+  ///
   EFI_GUID                        Guid;
+  ///
+  /// Vendor-defined variable size data.
+  ///
 } VENDOR_DEVICE_PATH;
 
+///
+/// Controller Device Path SubType.
+///
 #define HW_CONTROLLER_DP          0x05
+
+///
+/// Controller Device Path.
+///
 typedef struct {
   EFI_DEVICE_PATH_PROTOCOL        Header;
+  ///
+  /// Controller number.
+  ///
   UINT32                          ControllerNumber;
 } CONTROLLER_DEVICE_PATH;
 
 ///
-/// ACPI Device Paths
+/// ACPI Device Paths.
 ///
 #define ACPI_DEVICE_PATH          0x02
 
+///
+/// ACPI Device Path SubType.
+///
 #define ACPI_DP                   0x01
 typedef struct {
   EFI_DEVICE_PATH_PROTOCOL        Header;
+  ///
+  /// Device's PnP hardware ID stored in a numeric 32-bit
+  /// compressed EISA-type ID. This value must match the
+  /// corresponding _HID in the ACPI name space.
+  ///
   UINT32                          HID;
+  ///
+  /// Unique ID that is required by ACPI if two devices have the
+  /// same _HID. This value must also match the corresponding
+  /// _UID/_HID pair in the ACPI name space. Only the 32-bit
+  /// numeric value type of _UID is supported. Thus, strings must
+  /// not be used for the _UID in the ACPI name space.
+  ///
   UINT32                          UID;
 } ACPI_HID_DEVICE_PATH;
 
+///
+/// Expanded ACPI Device Path SubType.
+///
 #define ACPI_EXTENDED_DP          0x02
 typedef struct {
   EFI_DEVICE_PATH_PROTOCOL        Header;
+  ///
+  /// Device's PnP hardware ID stored in a numeric 32-bit
+  /// compressed EISA-type ID. This value must match the
+  /// corresponding _HID in the ACPI name space.
+  ///
   UINT32                          HID;
+  ///
+  /// Unique ID that is required by ACPI if two devices have the
+  /// same _HID. This value must also match the corresponding
+  /// _UID/_HID pair in the ACPI name space.
+  ///
   UINT32                          UID;
+  ///
+  /// Device's compatible PnP hardware ID stored in a numeric
+  /// 32-bit compressed EISA-type ID. This value must match at
+  /// least one of the compatible device IDs returned by the
+  /// corresponding _CID in the ACPI name space.
+  ///
   UINT32                          CID;
   ///
-  /// Optional variable length _HIDSTR
-  /// Optional variable length _UIDSTR
-  /// Optional variable length _CIDSTR
+  /// Optional variable length _HIDSTR.
+  /// Optional variable length _UIDSTR.
+  /// Optional variable length _CIDSTR.
   ///
 } ACPI_EXTENDED_HID_DEVICE_PATH;
 
@@ -149,11 +243,27 @@ typedef struct {
 #define PNP_EISA_ID_MASK          0xffff
 #define EISA_ID_TO_NUM(_Id)       ((_Id) >> 16)
 
-
+///
+/// ACPI _ADR Device Path SubType.
+///
 #define ACPI_ADR_DP               0x03
+
+///
+/// The _ADR device path is used to contain video output device attributes to support the Graphics
+/// Output Protocol. The device path can contain multiple _ADR entries if multiple video output
+/// devices are displaying the same output.
+///
 typedef struct {
   EFI_DEVICE_PATH_PROTOCOL        Header;
+  ///
+  /// _ADR value. For video output devices the value of this
+  /// field comes from Table B-2 of the ACPI 3.0 specification. At
+  /// least one _ADR value is required.
+  ///
   UINT32                          ADR;
+  //
+  // This device path may optionally contain more than one _ADR entry.
+  //
 } ACPI_ADR_DEVICE_PATH;
 
 #define ACPI_ADR_DISPLAY_TYPE_OTHER             0
@@ -173,123 +283,331 @@ typedef struct {
                        ((_Index)          & 0xf) ))
 
 ///
-/// Messaging Device Paths
+/// Messaging Device Paths.
+/// This Device Path is used to describe the connection of devices outside the resource domain of the
+/// system. This Device Path can describe physical messaging information like SCSI ID, or abstract
+/// information like networking protocol IP addresses.
 ///
 #define MESSAGING_DEVICE_PATH     0x03
 
+///
+/// ATAPI Device Path SubType
+///
 #define MSG_ATAPI_DP              0x01
 typedef struct {
   EFI_DEVICE_PATH_PROTOCOL        Header;
+  ///
+  /// Set to zero for primary, or one for secondary.
+  ///
   UINT8                           PrimarySecondary;
+  ///
+  /// Set to zero for master, or one for slave mode.
+  ///
   UINT8                           SlaveMaster;
+  ///
+  /// Logical Unit Number.
+  ///
   UINT16                          Lun;
 } ATAPI_DEVICE_PATH;
 
+///
+/// SCSI Device Path SubType.
+///
 #define MSG_SCSI_DP               0x02
 typedef struct {
   EFI_DEVICE_PATH_PROTOCOL        Header;
+  ///
+  /// Target ID on the SCSI bus (PUN).
+  ///
   UINT16                          Pun;
+  ///
+  /// Logical Unit Number (LUN).
+  ///
   UINT16                          Lun;
 } SCSI_DEVICE_PATH;
 
+///
+/// Fibre Channel SubType.
+///
 #define MSG_FIBRECHANNEL_DP       0x03
 typedef struct {
   EFI_DEVICE_PATH_PROTOCOL        Header;
+  ///
+  /// Reserved for the future.
+  ///
   UINT32                          Reserved;
+  ///
+  /// Fibre Channel World Wide Number.
+  ///
   UINT64                          WWN;
+  ///
+  /// Fibre Channel Logical Unit Number.
+  ///
   UINT64                          Lun;
 } FIBRECHANNEL_DEVICE_PATH;
 
+///
+/// 1394 Device Path SubType
+///
 #define MSG_1394_DP               0x04
 typedef struct {
   EFI_DEVICE_PATH_PROTOCOL        Header;
+  ///
+  /// Reserved for the future.
+  ///
   UINT32                          Reserved;
+  ///
+  /// 1394 Global Unique ID (GUID).
+  ///
   UINT64                          Guid;
 } F1394_DEVICE_PATH;
 
+///
+/// USB Device Path SubType.
+///
 #define MSG_USB_DP                0x05
 typedef struct {
-    EFI_DEVICE_PATH_PROTOCOL      Header;
-    UINT8                         ParentPortNumber;
-    UINT8                         InterfaceNumber;
+  EFI_DEVICE_PATH_PROTOCOL      Header;
+  ///
+  /// USB Parent Port Number.
+  ///
+  UINT8                         ParentPortNumber;
+  ///
+  /// USB Interface Number.
+  ///
+  UINT8                         InterfaceNumber;
 } USB_DEVICE_PATH;
 
+///
+/// USB Class Device Path SubType.
+///
 #define MSG_USB_CLASS_DP          0x0f
 typedef struct {
-    EFI_DEVICE_PATH_PROTOCOL      Header;
-    UINT16                        VendorId;
-    UINT16                        ProductId;
-    UINT8                         DeviceClass;
-    UINT8                         DeviceSubClass;
-    UINT8                         DeviceProtocol;
+  EFI_DEVICE_PATH_PROTOCOL      Header;
+  ///
+  /// Vendor ID assigned by USB-IF. A value of 0xFFFF will
+  /// match any Vendor ID.
+  ///
+  UINT16                        VendorId;
+  ///
+  /// Product ID assigned by USB-IF. A value of 0xFFFF will
+  /// match any Product ID.
+  ///
+  UINT16                        ProductId;
+  ///
+  /// The class code assigned by the USB-IF. A value of 0xFF
+  /// will match any class code.
+  ///
+  UINT8                         DeviceClass;
+  ///
+  /// The subclass code assigned by the USB-IF. A value of
+  /// 0xFF will match any subclass code.
+  ///
+  UINT8                         DeviceSubClass;
+  ///
+  /// The protocol code assigned by the USB-IF. A value of
+  /// 0xFF will match any protocol code.
+  ///
+  UINT8                         DeviceProtocol;
 } USB_CLASS_DEVICE_PATH;
 
+///
+/// USB WWID Device Path SubType.
+///
 #define MSG_USB_WWID_DP           0x10
+
+///
+/// This device path describes a USB device using its serial number.
+///
 typedef struct {
-    EFI_DEVICE_PATH_PROTOCOL      Header;
-    UINT16                        InterfaceNumber;
-    UINT16                        VendorId;
-    UINT16                        ProductId;
-    // CHAR16                     SerialNumber[...];
+  EFI_DEVICE_PATH_PROTOCOL      Header;
+  ///
+  /// USB interface number.
+  ///
+  UINT16                        InterfaceNumber;
+  ///
+  /// USB vendor id of the device.
+  ///
+  UINT16                        VendorId;
+  ///
+  /// USB product id of the device.
+  ///
+  UINT16                        ProductId;
+  ///
+  /// Last 64-or-fewer UTF-16 characters of the USB
+  /// serial number. The length of the string is
+  /// determined by the Length field less the offset of the
+  /// Serial Number field (10)
+  ///
+  /// CHAR16                     SerialNumber[...];
 } USB_WWID_DEVICE_PATH;
 
-
+///
+/// Device Logical Unit SubType.
+///
 #define MSG_DEVICE_LOGICAL_UNIT_DP  0x11
 typedef struct {
-    EFI_DEVICE_PATH_PROTOCOL      Header;
-    UINT8                         Lun;
+  EFI_DEVICE_PATH_PROTOCOL      Header;
+  ///
+  /// Logical Unit Number for the interface.
+  ///
+  UINT8                         Lun;
 } DEVICE_LOGICAL_UNIT_DEVICE_PATH;
 
+///
+/// SATA Device Path SubType.
+///
 #define MSG_SATA_DP               0x12
 typedef struct {
   EFI_DEVICE_PATH_PROTOCOL        Header;
+  ///
+  /// The HBA port number that facilitates the connection to the
+  /// device or a port multiplier. The value 0xFFFF is reserved.
+  ///
   UINT16                          HBAPortNumber;
+  ///
+  /// The Port multiplier port number that facilitates the connection
+  /// to the device. Bit 15 should be set if the device is directly
+  /// connected to the HBA.
+  ///
   UINT16                          PortMultiplierPortNumber;
+  ///
+  /// Logical Unit Number.
+  ///
   UINT16                          Lun;
 } SATA_DEVICE_PATH;
 
+///
+/// Flag for if the device is directly connected to the HBA.
+///
+#define SATA_HBA_DIRECT_CONNECT_FLAG 0x8000
+
+///
+/// I2O Device Path SubType.
+///
 #define MSG_I2O_DP                0x06
 typedef struct {
   EFI_DEVICE_PATH_PROTOCOL        Header;
+  ///
+  /// Target ID (TID) for a device.
+  ///
   UINT32                          Tid;
 } I2O_DEVICE_PATH;
 
+///
+/// MAC Address Device Path SubType.
+///
 #define MSG_MAC_ADDR_DP           0x0b
 typedef struct {
   EFI_DEVICE_PATH_PROTOCOL        Header;
+  ///
+  /// The MAC address for a network interface padded with 0s.
+  ///
   EFI_MAC_ADDRESS                 MacAddress;
+  ///
+  /// Network interface type(i.e. 802.3, FDDI).
+  ///
   UINT8                           IfType;
 } MAC_ADDR_DEVICE_PATH;
 
+///
+/// IPv4 Device Path SubType
+///
 #define MSG_IPv4_DP               0x0c
 typedef struct {
   EFI_DEVICE_PATH_PROTOCOL        Header;
+  ///
+  /// The local IPv4 address.
+  ///
   EFI_IPv4_ADDRESS                LocalIpAddress;
+  ///
+  /// The remote IPv4 address.
+  ///
   EFI_IPv4_ADDRESS                RemoteIpAddress;
+  ///
+  /// The local port number.
+  ///
   UINT16                          LocalPort;
+  ///
+  /// The remote port number.
+  ///
   UINT16                          RemotePort;
+  ///
+  /// The network protocol(i.e. UDP, TCP).
+  ///
   UINT16                          Protocol;
+  ///
+  /// 0x00 - The Source IP Address was assigned though DHCP.
+  /// 0x01 - The Source IP Address is statically bound.
+  ///
   BOOLEAN                         StaticIpAddress;
 } IPv4_DEVICE_PATH;
 
+///
+/// IPv6 Device Path SubType.
+///
 #define MSG_IPv6_DP               0x0d
 typedef struct {
   EFI_DEVICE_PATH_PROTOCOL        Header;
+  ///
+  /// The local IPv6 address.
+  ///
   EFI_IPv6_ADDRESS                LocalIpAddress;
+  ///
+  /// The remote IPv6 address.
+  ///
   EFI_IPv6_ADDRESS                RemoteIpAddress;
+  ///
+  /// The local port number.
+  ///
   UINT16                          LocalPort;
+  ///
+  /// The remote port number.
+  ///
   UINT16                          RemotePort;
+  ///
+  /// The network protocol(i.e. UDP, TCP).
+  ///
   UINT16                          Protocol;
+  ///
+  /// 0x00 - The Source IP Address was assigned though DHCP.
+  /// 0x01 - The Source IP Address is statically bound.
+  ///
   BOOLEAN                         StaticIpAddress;
 } IPv6_DEVICE_PATH;
 
+///
+/// InfiniBand Device Path SubType.
+///
 #define MSG_INFINIBAND_DP         0x09
 typedef struct {
   EFI_DEVICE_PATH_PROTOCOL        Header;
+  ///
+  /// Flags to help identify/manage InfiniBand device path elements:
+  /// Bit 0 - IOC/Service (0b = IOC, 1b = Service).
+  /// Bit 1 - Extend Boot Environment.
+  /// Bit 2 - Console Protocol.
+  /// Bit 3 - Storage Protocol.
+  /// Bit 4 - Network Protocol.
+  /// All other bits are reserved.
+  ///
   UINT32                          ResourceFlags;
+  ///
+  /// 128-bit Global Identifier for remote fabric port.
+  ///
   UINT8                           PortGid[16];
+  ///
+  /// 64-bit unique identifier to remote IOC or server process.
+  /// Interpretation of field specified by Resource Flags (bit 0).
+  ///
   UINT64                          ServiceId;
+  ///
+  /// 64-bit persistent ID of remote IOC port.
+  ///
   UINT64                          TargetPortId;
+  ///
+  /// 64-bit persistent ID of remote device.
+  ///
   UINT64                          DeviceId;
 } INFINIBAND_DEVICE_PATH;
 
@@ -299,13 +617,43 @@ typedef struct {
 #define INFINIBAND_RESOURCE_FLAG_STORAGE_PROTOCOL           0x08
 #define INFINIBAND_RESOURCE_FLAG_NETWORK_PROTOCOL           0x10
 
+///
+/// UART Device Path SubType.
+///
 #define MSG_UART_DP               0x0e
 typedef struct {
   EFI_DEVICE_PATH_PROTOCOL        Header;
+  ///
+  /// Reserved.
+  ///
   UINT32                          Reserved;
+  ///
+  /// The baud rate setting for the UART style device. A value of 0
+  /// means that the device's default baud rate will be used.
+  ///
   UINT64                          BaudRate;
+  ///
+  /// The number of data bits for the UART style device. A value
+  /// of 0 means that the device's default number of data bits will be used.
+  ///
   UINT8                           DataBits;
+  ///
+  /// The parity setting for the UART style device.
+  /// Parity 0x00 - Default Parity.
+  /// Parity 0x01 - No Parity.
+  /// Parity 0x02 - Even Parity.
+  /// Parity 0x03 - Odd Parity.
+  /// Parity 0x04 - Mark Parity.
+  /// Parity 0x05 - Space Parity.
+  ///
   UINT8                           Parity;
+  ///
+  /// The number of stop bits for the UART style device.
+  /// Stop Bits 0x00 - Default Stop Bits.
+  /// Stop Bits 0x01 - 1 Stop Bit.
+  /// Stop Bits 0x02 - 1.5 Stop Bits.
+  /// Stop Bits 0x03 - 2 Stop Bits.
+  ///
   UINT8                           StopBits;
 } UART_DEVICE_PATH;
 
@@ -320,34 +668,88 @@ typedef VENDOR_DEVICE_PATH        VENDOR_DEFINED_DEVICE_PATH;
 #define DEVICE_PATH_MESSAGING_VT_100_PLUS EFI_VT_100_PLUS_GUID
 #define DEVICE_PATH_MESSAGING_VT_UTF8     EFI_VT_UTF8_GUID
 
-#define DEVICE_PATH_MESSAGING_UART_FLOW_CONTROL   EFI_UART_DEVICE_PATH_GUID
-
+///
+/// A new device path node is defined to declare flow control characteristics.
+/// UART Flow Control Messaging Device Path
+///
 typedef struct {
   EFI_DEVICE_PATH_PROTOCOL        Header;
+  ///
+  /// DEVICE_PATH_MESSAGING_UART_FLOW_CONTROL GUID.
+  ///
   EFI_GUID                        Guid;
+  ///
+  /// Bitmap of supported flow control types.
+  /// Bit 0 set indicates hardware flow control.
+  /// Bit 1 set indicates Xon/Xoff flow control.
+  /// All other bits are reserved and are clear.
+  ///
   UINT32                          FlowControlMap;
 } UART_FLOW_CONTROL_DEVICE_PATH;
 
-#define DEVICE_PATH_MESSAGING_SAS                 EFI_SAS_DEVICE_PATH_GUID
+#define UART_FLOW_CONTROL_HARDWARE         0x00000001
+#define UART_FLOW_CONTROL_XON_XOFF         0x00000010
 
+#define DEVICE_PATH_MESSAGING_SAS                 EFI_SAS_DEVICE_PATH_GUID
+///
+/// Serial Attached SCSI (SAS) devices.
+///
 typedef struct {
   EFI_DEVICE_PATH_PROTOCOL        Header;
+  ///
+  /// DEVICE_PATH_MESSAGING_SAS GUID.
+  ///
   EFI_GUID                        Guid;
+  ///
+  /// Reserved for future use.
+  ///
   UINT32                          Reserved;
+  ///
+  /// SAS Address for Serial Attached SCSI Target.
+  ///
   UINT64                          SasAddress;
+  ///
+  /// SAS Logical Unit Number.
+  ///
   UINT64                          Lun;
+  ///
+  /// More Information about the device and its interconnect.
+  ///
   UINT16                          DeviceTopology;
+  ///
+  /// Relative Target Port (RTP).
+  ///
   UINT16                          RelativeTargetPort;
 } SAS_DEVICE_PATH;
 
+///
+/// iSCSI Device Path SubType
+///
 #define MSG_ISCSI_DP              0x13
 typedef struct {
   EFI_DEVICE_PATH_PROTOCOL        Header;
+  ///
+  /// Network Protocol (0 = TCP, 1+ = reserved).
+  ///
   UINT16                          NetworkProtocol;
+  ///
+  /// iSCSI Login Options.
+  ///
   UINT16                          LoginOption;
+  ///
+  /// iSCSI Logical Unit Number.
+  ///
   UINT64                          Lun;
+  ///
+  /// iSCSI Target Portal group tag the initiator intends
+  /// to establish a session with.
+  ///
   UINT16                          TargetPortalGroupTag;
-  // CHAR8                        iSCSI Target Name
+  ///
+  /// iSCSI NodeTarget Name. The length of the name
+  /// is determined by subtracting the offset of this field from Length.
+  ///
+  /// CHAR8                        iSCSI Target Name.
 } ISCSI_DEVICE_PATH;
 
 #define ISCSI_LOGIN_OPTION_NO_HEADER_DIGEST             0x0000
@@ -359,78 +761,212 @@ typedef struct {
 #define ISCSI_LOGIN_OPTION_CHAP_BI                      0x0000
 #define ISCSI_LOGIN_OPTION_CHAP_UNI                     0x2000
 
+///
+/// VLAN Device Path SubType.
+///
+#define MSG_VLAN_DP               0x14
+typedef struct {
+  EFI_DEVICE_PATH_PROTOCOL        Header;
+  ///
+  /// VLAN identifier (0-4094).
+  ///
+  UINT16                          VlanId;
+} VLAN_DEVICE_PATH;
+
 //
 // Media Device Path
 //
 #define MEDIA_DEVICE_PATH         0x04
 
+///
+/// Hard Drive Media Device Path SubType.
+///
 #define MEDIA_HARDDRIVE_DP        0x01
+
+///
+/// The Hard Drive Media Device Path is used to represent a partition on a hard drive.
+///
 typedef struct {
   EFI_DEVICE_PATH_PROTOCOL        Header;
+  ///
+  /// Describes the entry in a partition table, starting with entry 1.
+  /// Partition number zero represents the entire device. Valid
+  /// partition numbers for a MBR partition are [1, 4]. Valid
+  /// partition numbers for a GPT partition are [1, NumberOfPartitionEntries].
+  ///
   UINT32                          PartitionNumber;
+  ///
+  /// Starting LBA of the partition on the hard drive.
+  ///
   UINT64                          PartitionStart;
+  ///
+  /// Size of the partition in units of Logical Blocks.
+  ///
   UINT64                          PartitionSize;
+  ///
+  /// Signature unique to this partition:
+  /// If SignatureType is 0, this field has to be initialized with 16 zeros.
+  /// If SignatureType is 1, the MBR signature is stored in the first 4 bytes of this field.
+  /// The other 12 bytes are initialized with zeros.
+  /// If SignatureType is 2, this field contains a 16 byte signature.
+  ///
   UINT8                           Signature[16];
+  ///
+  /// Partition Format: (Unused values reserved).
+  /// 0x01 - PC-AT compatible legacy MBR.
+  /// 0x02 - GUID Partition Table.
+  ///
   UINT8                           MBRType;
+  ///
+  /// Type of Disk Signature: (Unused values reserved).
+  /// 0x00 - No Disk Signature.
+  /// 0x01 - 32-bit signature from address 0x1b8 of the type 0x01 MBR.
+  /// 0x02 - GUID signature.
+  ///
   UINT8                           SignatureType;
 } HARDDRIVE_DEVICE_PATH;
 
 #define MBR_TYPE_PCAT             0x01
 #define MBR_TYPE_EFI_PARTITION_TABLE_HEADER 0x02
 
+#define NO_DISK_SIGNATURE         0x00
 #define SIGNATURE_TYPE_MBR        0x01
 #define SIGNATURE_TYPE_GUID       0x02
 
+///
+/// CD-ROM Media Device Path SubType.
+///
 #define MEDIA_CDROM_DP            0x02
+
+///
+/// The CD-ROM Media Device Path is used to define a system partition that exists on a CD-ROM.
+///
 typedef struct {
   EFI_DEVICE_PATH_PROTOCOL        Header;
+  ///
+  /// Boot Entry number from the Boot Catalog. The Initial/Default entry is defined as zero.
+  ///
   UINT32                          BootEntry;
+  ///
+  /// Starting RBA of the partition on the medium. CD-ROMs use Relative logical Block Addressing.
+  ///
   UINT64                          PartitionStart;
+  ///
+  /// Size of the partition in units of Blocks, also called Sectors.
+  ///
   UINT64                          PartitionSize;
 } CDROM_DEVICE_PATH;
 
 //
 // Use VENDOR_DEVICE_PATH struct
 //
-#define MEDIA_VENDOR_DP           0x03
+#define MEDIA_VENDOR_DP           0x03  ///< Media vendor device path subtype.
 
+///
+/// File Path Media Device Path SubType
+///
 #define MEDIA_FILEPATH_DP         0x04
 typedef struct {
   EFI_DEVICE_PATH_PROTOCOL        Header;
+  ///
+  /// A NULL-terminated Path string including directory and file names.
+  ///
   CHAR16                          PathName[1];
 } FILEPATH_DEVICE_PATH;
 
-#define SIZE_OF_FILEPATH_DEVICE_PATH  EFI_FIELD_OFFSET(FILEPATH_DEVICE_PATH,PathName)
+#define SIZE_OF_FILEPATH_DEVICE_PATH  OFFSET_OF(FILEPATH_DEVICE_PATH,PathName)
 
+///
+/// Media Protocol Device Path SubType.
+///
 #define MEDIA_PROTOCOL_DP         0x05
+
+///
+/// The Media Protocol Device Path is used to denote the protocol that is being
+/// used in a device path at the location of the path specified.
+/// Many protocols are inherent to the style of device path.
+///
 typedef struct {
   EFI_DEVICE_PATH_PROTOCOL        Header;
+  ///
+  /// The ID of the protocol.
+  ///
   EFI_GUID                        Protocol;
 } MEDIA_PROTOCOL_DEVICE_PATH;
 
+///
+/// PIWG Firmware Volume Device Path SubType.
+///
+#define MEDIA_PIWG_FW_FILE_DP     0x06
+
+///
+/// This device path is used by systems implementing the UEFI PI Specification 1.0 to describe a firmware file.
+///
+typedef struct {
+  EFI_DEVICE_PATH_PROTOCOL        Header;
+  ///
+  /// Firmware file name
+  ///
+  EFI_GUID                        FvFileName;
+} MEDIA_FW_VOL_FILEPATH_DEVICE_PATH;
 
-#define MEDIA_PIWG_FW_VOL_DP      0x7
+///
+/// PIWG Firmware Volume Device Path SubType.
+///
+#define MEDIA_PIWG_FW_VOL_DP      0x07
+
+///
+/// This device path is used by systems implementing the UEFI PI Specification 1.0 to describe a firmware volume.
+///
 typedef struct {
   EFI_DEVICE_PATH_PROTOCOL        Header;
+  ///
+  /// Firmware volume name.
+  ///
   EFI_GUID                        FvName;
 } MEDIA_FW_VOL_DEVICE_PATH;
 
+///
+/// Media relative offset range device path.
+///
+#define MEDIA_RELATIVE_OFFSET_RANGE_DP 0x08
 
-#define MEDIA_PIWG_FW_FILE_DP     0x6
+///
+/// Used to describe the offset range of media relative.
+///
 typedef struct {
-  EFI_DEVICE_PATH_PROTOCOL        Header;
-  EFI_GUID                        FvFileName;
-} MEDIA_FW_VOL_FILEPATH_DEVICE_PATH;
+  EFI_DEVICE_PATH_PROTOCOL  Header;
+  UINT32                    Reserved;
+  UINT64                    StartingOffset;
+  UINT64                    EndingOffset;
+} MEDIA_RELATIVE_OFFSET_RANGE_DEVICE_PATH;
 
-//
-// BBS Device Path
-//
+///
+/// BIOS Boot Specification Device Path.
+///
 #define BBS_DEVICE_PATH           0x05
+
+///
+/// BIOS Boot Specification Device Path SubType.
+///
 #define BBS_BBS_DP                0x01
+
+///
+/// This Device Path is used to describe the booting of non-EFI-aware operating systems.
+///
 typedef struct {
   EFI_DEVICE_PATH_PROTOCOL        Header;
+  ///
+  /// Device Type as defined by the BIOS Boot Specification.
+  ///
   UINT16                          DeviceType;
+  ///
+  /// Status Flags as defined by the BIOS Boot Specification.
+  ///
   UINT16                          StatusFlag;
+  ///
+  /// ASCIIZ string that describes the boot device to a user.
+  ///
   CHAR8                           String[1];
 } BBS_BBS_DEVICE_PATH;
 
@@ -448,9 +984,8 @@ typedef struct {
 
 
 ///
-/// Union of all possible Device Paths and pointers to Device Paths
+/// Union of all possible Device Paths and pointers to Device Paths.
 ///
-
 typedef union {
   EFI_DEVICE_PATH_PROTOCOL             DevPath;
   PCI_DEVICE_PATH                      Pci;
@@ -482,6 +1017,7 @@ typedef union {
 
   FILEPATH_DEVICE_PATH                 FilePath;
   MEDIA_PROTOCOL_DEVICE_PATH           MediaProtocol;
+  MEDIA_RELATIVE_OFFSET_RANGE_DEVICE_PATH Offset;
 
   BBS_BBS_DEVICE_PATH                  Bbs;
 } EFI_DEV_PATH;
@@ -519,6 +1055,7 @@ typedef union {
 
   FILEPATH_DEVICE_PATH                 *FilePath;
   MEDIA_PROTOCOL_DEVICE_PATH           *MediaProtocol;
+  MEDIA_RELATIVE_OFFSET_RANGE_DEVICE_PATH *Offset;
 
   BBS_BBS_DEVICE_PATH                  *Bbs;
   UINT8                                *Raw;
diff --git a/src/include/gpxe/efi/Protocol/DriverBinding.h b/src/include/gpxe/efi/Protocol/DriverBinding.h
index 510cb7c..94fe36f 100644
--- a/src/include/gpxe/efi/Protocol/DriverBinding.h
+++ b/src/include/gpxe/efi/Protocol/DriverBinding.h
@@ -4,23 +4,22 @@
   This protocol is produced by every driver that follows the UEFI Driver Model,
   and it is the central component that allows drivers and controllers to be managed.
 
-  Copyright (c) 2006 - 2008, Intel Corporation
-  All rights reserved. This program and the accompanying materials
-  are licensed and made available under the terms and conditions of the BSD License
-  which accompanies this distribution.  The full text of the license may be found at
-  http://opensource.org/licenses/bsd-license.php
+Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
+This program and the accompanying materials are licensed and made available under
+the terms and conditions of the BSD License that accompanies this distribution.
+The full text of the license may be found at
+http://opensource.org/licenses/bsd-license.php.
 
-  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 
 **/
 
 #ifndef __EFI_DRIVER_BINDING_H__
 #define __EFI_DRIVER_BINDING_H__
 
-#include <gpxe/efi/Protocol/DevicePath.h>
 ///
-/// Global ID for the ControllerHandle Driver Protocol
+/// The global ID for the ControllerHandle Driver Protocol.
 ///
 #define EFI_DRIVER_BINDING_PROTOCOL_GUID \
   { \
@@ -30,22 +29,46 @@
 typedef struct _EFI_DRIVER_BINDING_PROTOCOL  EFI_DRIVER_BINDING_PROTOCOL;
 
 /**
-  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
-  @param  RemainingDevicePath Optional parameter use to pick a specific child
-                              device to start.
-
-  @retval EFI_SUCCESS         This driver supports this device
-  @retval EFI_ALREADY_STARTED This driver is already running on this device
-  @retval other               This driver does not support this device
-
+  Tests to see if this driver supports a given controller. If a child device is provided,
+  it further tests to see if this driver supports creating a handle for the specified child device.
+
+  This function checks to see if the driver specified by This supports the device specified by
+  ControllerHandle. Drivers will typically use the device path attached to
+  ControllerHandle and/or the services from the bus I/O abstraction attached to
+  ControllerHandle to determine if the driver supports ControllerHandle. This function
+  may be called many times during platform initialization. In order to reduce boot times, the tests
+  performed by this function must be very small, and take as little time as possible to execute. This
+  function must not change the state of any hardware devices, and this function must be aware that the
+  device specified by ControllerHandle may already be managed by the same driver or a
+  different driver. This function must match its calls to AllocatePages() with FreePages(),
+  AllocatePool() with FreePool(), and OpenProtocol() with CloseProtocol().
+  Because ControllerHandle may have been previously started by the same driver, if a protocol is
+  already in the opened state, then it must not be closed with CloseProtocol(). This is required
+  to guarantee the state of ControllerHandle is not modified by this function.
+
+  @param[in]  This                 A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
+  @param[in]  ControllerHandle     The handle of the controller to test. This handle
+                                   must support a protocol interface that supplies
+                                   an I/O abstraction to the driver.
+  @param[in]  RemainingDevicePath  A pointer to the remaining portion of a device path.  This
+                                   parameter is ignored by device drivers, and is optional for bus
+                                   drivers. For bus drivers, if this parameter is not NULL, then
+                                   the bus driver must determine if the bus controller specified
+                                   by ControllerHandle and the child controller specified
+                                   by RemainingDevicePath are both supported by this
+                                   bus driver.
+
+  @retval EFI_SUCCESS              The device specified by ControllerHandle and
+                                   RemainingDevicePath is supported by the driver specified by This.
+  @retval EFI_ALREADY_STARTED      The device specified by ControllerHandle and
+                                   RemainingDevicePath is already being managed by the driver
+                                   specified by This.
+  @retval EFI_ACCESS_DENIED        The device specified by ControllerHandle and
+                                   RemainingDevicePath is already being managed by a different
+                                   driver or an application that requires exclusive access.
+                                   Currently not implemented.
+  @retval EFI_UNSUPPORTED          The device specified by ControllerHandle and
+                                   RemainingDevicePath is not supported by the driver specified by This.
 **/
 typedef
 EFI_STATUS
@@ -56,21 +79,38 @@ EFI_STATUS
   );
 
 /**
-  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
-  @param  RemainingDevicePath  Optional parameter use to pick a specific child
-                               device to start.
-
-  @retval EFI_SUCCESS          This driver is added to ControllerHandle
-  @retval EFI_ALREADY_STARTED  This driver is already running on ControllerHandle
-  @retval other                This driver does not support this device
+  Starts a device controller or a bus controller.
+
+  The Start() function is designed to be invoked from the EFI boot service ConnectController().
+  As a result, much of the error checking on the parameters to Start() has been moved into this
+  common boot service. It is legal to call Start() from other locations,
+  but the following calling restrictions must be followed, or the system behavior will not be deterministic.
+  1. ControllerHandle must be a valid EFI_HANDLE.
+  2. If RemainingDevicePath is not NULL, then it must be a pointer to a naturally aligned
+     EFI_DEVICE_PATH_PROTOCOL.
+  3. Prior to calling Start(), the Supported() function for the driver specified by This must
+     have been called with the same calling parameters, and Supported() must have returned EFI_SUCCESS.
+
+  @param[in]  This                 A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
+  @param[in]  ControllerHandle     The handle of the controller to start. This handle
+                                   must support a protocol interface that supplies
+                                   an I/O abstraction to the driver.
+  @param[in]  RemainingDevicePath  A pointer to the remaining portion of a device path.  This
+                                   parameter is ignored by device drivers, and is optional for bus
+                                   drivers. For a bus driver, if this parameter is NULL, then handles
+                                   for all the children of Controller are created by this driver.
+                                   If this parameter is not NULL and the first Device Path Node is
+                                   not the End of Device Path Node, then only the handle for the
+                                   child device specified by the first Device Path Node of
+                                   RemainingDevicePath is created by this driver.
+                                   If the first Device Path Node of RemainingDevicePath is
+                                   the End of Device Path Node, no child handle is created by this
+                                   driver.
+
+  @retval EFI_SUCCESS              The device was started.
+  @retval EFI_DEVICE_ERROR         The device could not be started due to a device error.Currently not implemented.
+  @retval EFI_OUT_OF_RESOURCES     The request could not be completed due to a lack of resources.
+  @retval Others                   The driver failded to start the device.
 
 **/
 typedef
@@ -82,21 +122,29 @@ EFI_STATUS
   );
 
 /**
-  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
-  @param  NumberOfChildren  Number of Handles in ChildHandleBuffer. If number of
-                            children is zero stop the entire bus driver.
-  @param  ChildHandleBuffer List of Child Handles to Stop.
-
-  @retval EFI_SUCCESS       This driver is removed ControllerHandle
-  @retval other             This driver was not removed from this device
+  Stops a device controller or a bus controller.
+
+  The Stop() function is designed to be invoked from the EFI boot service DisconnectController().
+  As a result, much of the error checking on the parameters to Stop() has been moved
+  into this common boot service. It is legal to call Stop() from other locations,
+  but the following calling restrictions must be followed, or the system behavior will not be deterministic.
+  1. ControllerHandle must be a valid EFI_HANDLE that was used on a previous call to this
+     same driver's Start() function.
+  2. The first NumberOfChildren handles of ChildHandleBuffer must all be a valid
+     EFI_HANDLE. In addition, all of these handles must have been created in this driver's
+     Start() function, and the Start() function must have called OpenProtocol() on
+     ControllerHandle with an Attribute of EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER.
+
+  @param[in]  This              A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
+  @param[in]  ControllerHandle  A handle to the device being stopped. The handle must
+                                support a bus specific I/O protocol for the driver
+                                to use to stop the device.
+  @param[in]  NumberOfChildren  The number of child device handles in ChildHandleBuffer.
+  @param[in]  ChildHandleBuffer An array of child handles to be freed. May be NULL
+                                if NumberOfChildren is 0.
+
+  @retval EFI_SUCCESS           The device was stopped.
+  @retval EFI_DEVICE_ERROR      The device could not be stopped due to a device error.
 
 **/
 typedef
diff --git a/src/include/gpxe/efi/Protocol/NetworkInterfaceIdentifier.h b/src/include/gpxe/efi/Protocol/NetworkInterfaceIdentifier.h
index e99ec38..dc0c709 100644
--- a/src/include/gpxe/efi/Protocol/NetworkInterfaceIdentifier.h
+++ b/src/include/gpxe/efi/Protocol/NetworkInterfaceIdentifier.h
@@ -1,27 +1,39 @@
 /** @file
-  EFI Network Interface Identifier Protocol
+  EFI Network Interface Identifier Protocol.
 
-  Copyright (c) 2006 - 2008, Intel Corporation
-  All rights reserved. This program and the accompanying materials
-  are licensed and made available under the terms and conditions of the BSD License
-  which accompanies this distribution.  The full text of the license may be found at
-  http://opensource.org/licenses/bsd-license.php
+Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
+This program and the accompanying materials are licensed and made available under
+the terms and conditions of the BSD License that accompanies this distribution.
+The full text of the license may be found at
+http://opensource.org/licenses/bsd-license.php.
 
-  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 
+  @par Revision Reference:
+  This Protocol is introduced in EFI Specification 1.10.
 
 **/
 
 #ifndef __EFI_NETWORK_INTERFACE_IDENTIFER_H__
 #define __EFI_NETWORK_INTERFACE_IDENTIFER_H__
 
-
+//
+// GUID retired from UEFI Specification 2.1b
+//
 #define EFI_NETWORK_INTERFACE_IDENTIFIER_PROTOCOL_GUID \
   { \
     0xE18541CD, 0xF755, 0x4f73, {0x92, 0x8D, 0x64, 0x3C, 0x8A, 0x79, 0xB2, 0x29 } \
   }
 
+//
+// GUID intruduced in UEFI Specification 2.1b
+//
+#define EFI_NETWORK_INTERFACE_IDENTIFIER_PROTOCOL_GUID_31 \
+  { \
+    0x1ACED566, 0x76ED, 0x4218, {0xBC, 0x81, 0x76, 0x7F, 0x1F, 0x97, 0x7A, 0x89 } \
+  }
+
 #define EFI_NETWORK_INTERFACE_IDENTIFIER_PROTOCOL_REVISION    0x00010000
 
 ///
@@ -30,7 +42,7 @@
 #define EFI_NETWORK_INTERFACE_IDENTIFIER_INTERFACE_REVISION   EFI_NETWORK_INTERFACE_IDENTIFIER_PROTOCOL_REVISION
 
 ///
-/// Forward reference for pure ANSI compatability
+/// Forward reference for pure ANSI compatability.
 ///
 typedef struct _EFI_NETWORK_INTERFACE_IDENTIFIER_PROTOCOL  EFI_NETWORK_INTERFACE_IDENTIFIER_PROTOCOL;
 
@@ -39,22 +51,18 @@ typedef struct _EFI_NETWORK_INTERFACE_IDENTIFIER_PROTOCOL  EFI_NETWORK_INTERFACE
 ///
 typedef EFI_NETWORK_INTERFACE_IDENTIFIER_PROTOCOL   EFI_NETWORK_INTERFACE_IDENTIFIER_INTERFACE;
 
-typedef enum {
-  EfiNetworkInterfaceUndi = 1
-} EFI_NETWORK_PROTOCOL_TYPE;
-
 ///
 /// An optional protocol that is used to describe details about the software
 /// layer that is used to produce the Simple Network Protocol.
 ///
 struct _EFI_NETWORK_INTERFACE_IDENTIFIER_PROTOCOL {
   UINT64    Revision;   ///< The revision of the EFI_NETWORK_INTERFACE_IDENTIFIER protocol.
-  UINT64    ID;         ///< Address of the first byte of the identifying structure for this network
+  UINT64    Id;         ///< The address of the first byte of the identifying structure for this network
                         ///< interface. This is only valid when the network interface is started
                         ///< (see Start()). When the network interface is not started, this field is set to zero.
-  UINT64    ImageAddr;  ///< Address of the first byte of the identifying structure for this
+  UINT64    ImageAddr;  ///< The address of the first byte of the identifying structure for this
                         ///< network interface.  This is set to zero if there is no structure.
-  UINT32    ImageSize;  ///< Size of unrelocated network interface image.
+  UINT32    ImageSize;  ///< The size of unrelocated network interface image.
   CHAR8     StringId[4];///< A four-character ASCII string that is sent in the class identifier field of
                         ///< option 60 in DHCP. For a Type of EfiNetworkInterfaceUndi, this field is UNDI.
   UINT8     Type;       ///< Network interface type. This will be set to one of the values
@@ -68,7 +76,16 @@ struct _EFI_NETWORK_INTERFACE_IDENTIFIER_PROTOCOL {
 
 };
 
+///
+///*******************************************************
+/// EFI_NETWORK_INTERFACE_TYPE
+///*******************************************************
+///
+typedef enum {
+  EfiNetworkInterfaceUndi = 1
+} EFI_NETWORK_INTERFACE_TYPE;
+
 extern EFI_GUID gEfiNetworkInterfaceIdentifierProtocolGuid;
 extern EFI_GUID gEfiNetworkInterfaceIdentifierProtocolGuid_31;
 
-#endif // _EFI_NII_H
+#endif
diff --git a/src/include/gpxe/efi/Protocol/PciIo.h b/src/include/gpxe/efi/Protocol/PciIo.h
index 5aea5b4..3ec9a42 100644
--- a/src/include/gpxe/efi/Protocol/PciIo.h
+++ b/src/include/gpxe/efi/Protocol/PciIo.h
@@ -2,8 +2,8 @@
   EFI PCI I/O Protocol provides the basic Memory, I/O, PCI configuration,
   and DMA interfaces that a driver uses to access its PCI controller.
 
-  Copyright (c) 2006 - 2008, Intel Corporation
-  All rights reserved. This program and the accompanying materials
+  Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
+  This program and the accompanying materials
   are licensed and made available under the terms and conditions of the BSD License
   which accompanies this distribution.  The full text of the license may be found at
   http://opensource.org/licenses/bsd-license.php
@@ -27,7 +27,9 @@
 typedef struct _EFI_PCI_IO_PROTOCOL  EFI_PCI_IO_PROTOCOL;
 
 ///
-/// Prototypes for the PCI I/O Protocol
+/// *******************************************************
+/// EFI_PCI_IO_PROTOCOL_WIDTH
+/// *******************************************************
 ///
 typedef enum {
   EfiPciIoWidthUint8      = 0,
@@ -57,7 +59,7 @@ typedef enum {
 #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_MEMORY_WRITE_COMBINE 0x0080  ///< Map a memory range so writes 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
@@ -79,8 +81,18 @@ typedef enum {
 /// *******************************************************
 ///
 typedef enum {
+  ///
+  /// A read operation from system memory by a bus master.
+  ///
   EfiPciIoOperationBusMasterRead,
+  ///
+  /// A write operation from system memory by a bus master.
+  ///
   EfiPciIoOperationBusMasterWrite,
+  ///
+  /// Provides both read and write access to system memory by both the processor and a
+  /// bus master. The buffer is coherent from both the processor's and the bus master's point of view.
+  ///
   EfiPciIoOperationBusMasterCommonBuffer,
   EfiPciIoOperationMaximum
 } EFI_PCI_IO_PROTOCOL_OPERATION;
@@ -91,16 +103,31 @@ typedef enum {
 /// *******************************************************
 ///
 typedef enum {
+  ///
+  /// Retrieve the PCI controller's current attributes, and return them in Result.
+  ///
   EfiPciIoAttributeOperationGet,
+  ///
+  /// Set the PCI controller's current attributes to Attributes.
+  ///
   EfiPciIoAttributeOperationSet,
+  ///
+  /// Enable the attributes specified by the bits that are set in Attributes for this PCI controller.
+  ///
   EfiPciIoAttributeOperationEnable,
+  ///
+  /// Disable the attributes specified by the bits that are set in Attributes for this PCI controller.
+  ///
   EfiPciIoAttributeOperationDisable,
+  ///
+  /// Retrieve the PCI controller's supported attributes, and return them in Result.
+  ///
   EfiPciIoAttributeOperationSupported,
   EfiPciIoAttributeOperationMaximum
 } EFI_PCI_IO_PROTOCOL_ATTRIBUTE_OPERATION;
 
 /**
-  Reads from the memory space of a PCI controller. Returns when either the polling exit criteria is
+  Reads from the memory space of a PCI controller. Returns either when the polling exit criteria is
   satisfied or after a defined duration.
 
   @param  This                  A pointer to the EFI_PCI_IO_PROTOCOL instance.
@@ -166,7 +193,13 @@ EFI_STATUS
   );
 
 typedef struct {
+  ///
+  /// Read PCI controller registers in the PCI memory or I/O space.
+  ///
   EFI_PCI_IO_PROTOCOL_IO_MEM  Read;
+  ///
+  /// Write PCI controller registers in the PCI memory or I/O space.
+  ///
   EFI_PCI_IO_PROTOCOL_IO_MEM  Write;
 } EFI_PCI_IO_PROTOCOL_ACCESS;
 
@@ -199,7 +232,13 @@ EFI_STATUS
   );
 
 typedef struct {
+  ///
+  /// Read PCI controller registers in PCI configuration space.
+  ///
   EFI_PCI_IO_PROTOCOL_CONFIG  Read;
+  ///
+  /// Write PCI controller registers in PCI configuration space.
+  ///
   EFI_PCI_IO_PROTOCOL_CONFIG  Write;
 } EFI_PCI_IO_PROTOCOL_CONFIG_ACCESS;
 
@@ -244,7 +283,7 @@ EFI_STATUS
   );
 
 /**
-  Provides the PCI controller-Cspecific addresses needed to access system memory.
+  Provides the PCI controller-specific addresses needed to access system memory.
 
   @param  This                  A pointer to the EFI_PCI_IO_PROTOCOL instance.
   @param  Operation             Indicates if the bus master is going to read or write to system memory.
@@ -476,7 +515,7 @@ EFI_STATUS
 
 ///
 /// 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.
+/// and DMA interfaces 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.
diff --git a/src/include/gpxe/efi/Protocol/PciRootBridgeIo.h b/src/include/gpxe/efi/Protocol/PciRootBridgeIo.h
index a1150f0..482c438 100644
--- a/src/include/gpxe/efi/Protocol/PciRootBridgeIo.h
+++ b/src/include/gpxe/efi/Protocol/PciRootBridgeIo.h
@@ -3,10 +3,10 @@
 
   PCI Root Bridge I/O protocol is used by PCI Bus Driver to perform PCI Memory, PCI I/O,
   and PCI Configuration cycles on a PCI Root Bridge. It also provides services to perform
-  defferent types of bus mastering DMA
+  defferent types of bus mastering DMA.
 
-  Copyright (c) 2006 - 2008, Intel Corporation
-  All rights reserved. This program and the accompanying materials
+  Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
+  This program and the accompanying materials
   are licensed and made available under the terms and conditions of the BSD License
   which accompanies this distribution.  The full text of the license may be found at
   http://opensource.org/licenses/bsd-license.php
@@ -26,6 +26,11 @@
 
 typedef struct _EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL  EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL;
 
+///
+/// *******************************************************
+/// EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH
+/// *******************************************************
+///
 typedef enum {
   EfiPciWidthUint8,
   EfiPciWidthUint16,
@@ -42,12 +47,41 @@ typedef enum {
   EfiPciWidthMaximum
 } EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH;
 
+///
+/// *******************************************************
+/// EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_OPERATION
+/// *******************************************************
+///
 typedef enum {
+  ///
+  /// A read operation from system memory by a bus master that is not capable of producing
+  /// PCI dual address cycles.
+  ///
   EfiPciOperationBusMasterRead,
+  ///
+  /// A write operation from system memory by a bus master that is not capable of producing
+  /// PCI dual address cycles.
+  ///
   EfiPciOperationBusMasterWrite,
+  ///
+  /// Provides both read and write access to system memory by both the processor and a bus
+  /// master that is not capable of producing PCI dual address cycles.
+  ///
   EfiPciOperationBusMasterCommonBuffer,
+  ///
+  /// A read operation from system memory by a bus master that is capable of producing PCI
+  /// dual address cycles.
+  ///
   EfiPciOperationBusMasterRead64,
+  ///
+  /// A write operation to system memory by a bus master that is capable of producing PCI
+  /// dual address cycles.
+  ///
   EfiPciOperationBusMasterWrite64,
+  ///
+  /// Provides both read and write access to system memory by both the processor and a bus
+  /// master that is capable of producing PCI dual address cycles.
+  ///
   EfiPciOperationBusMasterCommonBuffer64,
   EfiPciOperationMaximum
 } EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_OPERATION;
@@ -135,7 +169,13 @@ EFI_STATUS
   );
 
 typedef struct {
+  ///
+  /// Read PCI controller registers in the PCI root bridge memory space.
+  ///
   EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_IO_MEM  Read;
+  ///
+  /// Write PCI controller registers in the PCI root bridge memory space.
+  ///
   EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_IO_MEM  Write;
 } EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_ACCESS;
 
@@ -165,7 +205,7 @@ EFI_STATUS
   );
 
 /**
-  Provides the PCI controller-Cspecific addresses required to access system memory from a
+  Provides the PCI controller-specific addresses required to access system memory from a
   DMA bus master.
 
   @param  This                  A pointer to the EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL.
diff --git a/src/include/gpxe/efi/Protocol/SimpleNetwork.h b/src/include/gpxe/efi/Protocol/SimpleNetwork.h
index d3d2afc..3057590 100644
--- a/src/include/gpxe/efi/Protocol/SimpleNetwork.h
+++ b/src/include/gpxe/efi/Protocol/SimpleNetwork.h
@@ -1,5 +1,6 @@
 /** @file
-  Simple Network protocol as defined in the UEFI 2.0 specification.
+  The EFI_SIMPLE_NETWORK_PROTOCOL provides services to initialize a network interface,
+  transmit packets, receive packets, and close a network interface.
 
   Basic network device abstraction.
 
@@ -8,14 +9,17 @@
   MCast - MultiCast
   ...
 
-  Copyright (c) 2006 - 2008, Intel Corporation
-  All rights reserved. This program and the accompanying materials
-  are licensed and made available under the terms and conditions of the BSD License
-  which accompanies this distribution.  The full text of the license may be found at
-  http://opensource.org/licenses/bsd-license.php
+Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
+This program and the accompanying materials are licensed and made available under
+the terms and conditions of the BSD License that accompanies this distribution.
+The full text of the license may be found at
+http://opensource.org/licenses/bsd-license.php.
 
-  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+  @par Revision Reference:
+  This Protocol is introduced in EFI Specification 1.10.
 
 **/
 
@@ -36,7 +40,7 @@ typedef struct _EFI_SIMPLE_NETWORK_PROTOCOL  EFI_SIMPLE_NETWORK_PROTOCOL;
 typedef EFI_SIMPLE_NETWORK_PROTOCOL   EFI_SIMPLE_NETWORK;
 
 ///
-/// Simple Network Protocol data structures
+/// Simple Network Protocol data structures.
 ///
 typedef struct {
   ///
@@ -119,6 +123,11 @@ typedef struct {
 
 } EFI_NETWORK_STATISTICS;
 
+///
+/// The state of the network interface.
+/// When an EFI_SIMPLE_NETWORK_PROTOCOL driver initializes a
+/// network interface, the network interface is left in the EfiSimpleNetworkStopped state.
+///
 typedef enum {
   EfiSimpleNetworkStopped,
   EfiSimpleNetworkStarted,
@@ -139,24 +148,84 @@ typedef enum {
 
 #define MAX_MCAST_FILTER_CNT                              16
 typedef struct {
+  ///
+  /// Reports the current state of the network interface.
+  ///
   UINT32          State;
+  ///
+  /// The size, in bytes, of the network interface's HW address.
+  ///
   UINT32          HwAddressSize;
+  ///
+  /// The size, in bytes, of the network interface's media header.
+  ///
   UINT32          MediaHeaderSize;
+  ///
+  /// The maximum size, in bytes, of the packets supported by the network interface.
+  ///
   UINT32          MaxPacketSize;
+  ///
+  /// The size, in bytes, of the NVRAM device attached to the network interface.
+  ///
   UINT32          NvRamSize;
+  ///
+  /// The size that must be used for all NVRAM reads and writes. The
+  /// start address for NVRAM read and write operations and the total
+  /// length of those operations, must be a multiple of this value. The
+  /// legal values for this field are 0, 1, 2, 4, and 8.
+  ///
   UINT32          NvRamAccessSize;
+  ///
+  /// The multicast receive filter settings supported by the network interface.
+  ///
   UINT32          ReceiveFilterMask;
+  ///
+  /// The current multicast receive filter settings.
+  ///
   UINT32          ReceiveFilterSetting;
+  ///
+  /// The maximum number of multicast address receive filters supported by the driver.
+  ///
   UINT32          MaxMCastFilterCount;
+  ///
+  /// The current number of multicast address receive filters.
+  ///
   UINT32          MCastFilterCount;
+  ///
+  /// Array containing the addresses of the current multicast address receive filters.
+  ///
   EFI_MAC_ADDRESS MCastFilter[MAX_MCAST_FILTER_CNT];
+  ///
+  /// The current HW MAC address for the network interface.
+  ///
   EFI_MAC_ADDRESS CurrentAddress;
+  ///
+  /// The current HW MAC address for broadcast packets.
+  ///
   EFI_MAC_ADDRESS BroadcastAddress;
+  ///
+  /// The permanent HW MAC address for the network interface.
+  ///
   EFI_MAC_ADDRESS PermanentAddress;
+  ///
+  /// The interface type of the network interface.
+  ///
   UINT8           IfType;
+  ///
+  /// TRUE if the HW MAC address can be changed.
+  ///
   BOOLEAN         MacAddressChangeable;
+  ///
+  /// TRUE if the network interface can transmit more than one packet at a time.
+  ///
   BOOLEAN         MultipleTxSupported;
+  ///
+  /// TRUE if the presence of media can be determined; otherwise FALSE.
+  ///
   BOOLEAN         MediaPresentSupported;
+  ///
+  /// TRUE if media are connected to the network interface; otherwise FALSE.
+  ///
   BOOLEAN         MediaPresent;
 } EFI_SIMPLE_NETWORK_MODE;
 
@@ -204,7 +273,7 @@ EFI_STATUS
   required by the network interface; optionally, also requests allocation
   of additional transmit and receive buffers.
 
-  @param  This              Protocol instance pointer.
+  @param  This              The protocol instance pointer.
   @param  ExtraRxBufferSize The size, in bytes, of the extra receive buffer space
                             that the driver should allocate for the network interface.
                             Some network interfaces will not be able to use the extra
@@ -217,9 +286,9 @@ EFI_STATUS
                             being used.
 
   @retval EFI_SUCCESS           The network interface was initialized.
-  @retval EFI_NOT_STARTED       The network interface has not been started
+  @retval EFI_NOT_STARTED       The network interface has not been started.
   @retval EFI_OUT_OF_RESOURCES  There was not enough memory for the transmit and
-                                receive buffers.   .
+                                receive buffers.
   @retval EFI_INVALID_PARAMETER One or more of the parameters has an unsupported value.
   @retval EFI_DEVICE_ERROR      The command could not be sent to the network interface.
   @retval EFI_UNSUPPORTED       This function is not supported by the network interface.
@@ -237,13 +306,13 @@ EFI_STATUS
   Resets a network adapter and re-initializes it with the parameters that were
   provided in the previous call to Initialize().
 
-  @param  This                 Protocol instance pointer.
+  @param  This                 The protocol instance pointer.
   @param  ExtendedVerification Indicates that the driver may perform a more
                                exhaustive verification operation of the device
                                during reset.
 
   @retval EFI_SUCCESS           The network interface was reset.
-  @retval EFI_NOT_STARTED       The network interface has not been started
+  @retval EFI_NOT_STARTED       The network interface has not been started.
   @retval EFI_INVALID_PARAMETER One or more of the parameters has an unsupported value.
   @retval EFI_DEVICE_ERROR      The command could not be sent to the network interface.
   @retval EFI_UNSUPPORTED       This function is not supported by the network interface.
@@ -263,7 +332,7 @@ EFI_STATUS
   @param  This Protocol instance pointer.
 
   @retval EFI_SUCCESS           The network interface was shutdown.
-  @retval EFI_NOT_STARTED       The network interface has not been started
+  @retval EFI_NOT_STARTED       The network interface has not been started.
   @retval EFI_INVALID_PARAMETER One or more of the parameters has an unsupported value.
   @retval EFI_DEVICE_ERROR      The command could not be sent to the network interface.
   @retval EFI_UNSUPPORTED       This function is not supported by the network interface.
@@ -278,7 +347,7 @@ EFI_STATUS
 /**
   Manages the multicast receive filters of a network interface.
 
-  @param  This             Protocol instance pointer.
+  @param  This             The protocol instance pointer.
   @param  Enable           A bit mask of receive filters to enable on the network interface.
   @param  Disable          A bit mask of receive filters to disable on the network interface.
   @param  ResetMCastFilter Set to TRUE to reset the contents of the multicast receive
@@ -293,7 +362,7 @@ EFI_STATUS
                            ResetMCastFilter is TRUE.
 
   @retval EFI_SUCCESS           The multicast receive filter list was updated.
-  @retval EFI_NOT_STARTED       The network interface has not been started
+  @retval EFI_NOT_STARTED       The network interface has not been started.
   @retval EFI_INVALID_PARAMETER One or more of the parameters has an unsupported value.
   @retval EFI_DEVICE_ERROR      The command could not be sent to the network interface.
   @retval EFI_UNSUPPORTED       This function is not supported by the network interface.
@@ -313,13 +382,13 @@ EFI_STATUS
 /**
   Modifies or resets the current station address, if supported.
 
-  @param  This  Protocol instance pointer.
+  @param  This  The protocol instance pointer.
   @param  Reset Flag used to reset the station address to the network interfaces
                 permanent address.
-  @param  New   New station address to be used for the network interface.
+  @param  New   The new station address to be used for the network interface.
 
   @retval EFI_SUCCESS           The network interfaces station address was updated.
-  @retval EFI_NOT_STARTED       The network interface has not been started
+  @retval EFI_NOT_STARTED       The network interface has not been started.
   @retval EFI_INVALID_PARAMETER One or more of the parameters has an unsupported value.
   @retval EFI_DEVICE_ERROR      The command could not be sent to the network interface.
   @retval EFI_UNSUPPORTED       This function is not supported by the network interface.
@@ -366,7 +435,7 @@ EFI_STATUS
 /**
   Converts a multicast IP address to a multicast HW MAC address.
 
-  @param  This Protocol instance pointer.
+  @param  This The protocol instance pointer.
   @param  IPv6 Set to TRUE if the multicast IP address is IPv6 [RFC 2460]. Set
                to FALSE if the multicast IP address is IPv4 [RFC 791].
   @param  IP   The multicast IP address that is to be converted to a multicast
@@ -397,7 +466,7 @@ EFI_STATUS
   Performs read and write operations on the NVRAM device attached to a
   network interface.
 
-  @param  This       Protocol instance pointer.
+  @param  This       The protocol instance pointer.
   @param  ReadWrite  TRUE for read operations, FALSE for write operations.
   @param  Offset     Byte offset in the NVRAM device at which to start the read or
                      write operation. This must be a multiple of NvRamAccessSize and
@@ -427,7 +496,7 @@ EFI_STATUS
   Reads the current interrupt status and recycled transmit buffer status from
   a network interface.
 
-  @param  This            Protocol instance pointer.
+  @param  This            The protocol instance pointer.
   @param  InterruptStatus A pointer to the bit mask of the currently active interrupts
                           If this is NULL, the interrupt status will not be read from
                           the device. If this is not NULL, the interrupt status will
@@ -459,7 +528,7 @@ EFI_STATUS
 /**
   Places a packet in the transmit queue of a network interface.
 
-  @param  This       Protocol instance pointer.
+  @param  This       The protocol instance pointer.
   @param  HeaderSize The size, in bytes, of the media header to be filled in by
                      the Transmit() function. If HeaderSize is non-zero, then it
                      must be equal to This->Mode->MediaHeaderSize and the DestAddr
@@ -474,7 +543,7 @@ EFI_STATUS
   @param  SrcAddr    The source HW MAC address. If HeaderSize is zero, then this parameter
                      is ignored. If HeaderSize is non-zero and SrcAddr is NULL, then
                      This->Mode->CurrentAddress is used for the source HW MAC address.
-  @param  DsetAddr   The destination HW MAC address. If HeaderSize is zero, then this
+  @param  DestAddr   The destination HW MAC address. If HeaderSize is zero, then this
                      parameter is ignored.
   @param  Protocol   The type of header to build. If HeaderSize is zero, then this
                      parameter is ignored. See RFC 1700, section "Ether Types", for
@@ -504,7 +573,7 @@ EFI_STATUS
 /**
   Receives a packet from a network interface.
 
-  @param  This       Protocol instance pointer.
+  @param  This       The protocol instance pointer.
   @param  HeaderSize The size, in bytes, of the media header received on the network
                      interface. If this parameter is NULL, then the media header size
                      will not be returned.
@@ -515,7 +584,7 @@ EFI_STATUS
   @param  SrcAddr    The source HW MAC address. If this parameter is NULL, the
                      HW MAC source address will not be extracted from the media
                      header.
-  @param  DsetAddr   The destination HW MAC address. If this parameter is NULL,
+  @param  DestAddr   The destination HW MAC address. If this parameter is NULL,
                      the HW MAC destination address will not be extracted from the
                      media header.
   @param  Protocol   The media header type. If this parameter is NULL, then the
diff --git a/src/include/gpxe/efi/Protocol/SimpleTextIn.h b/src/include/gpxe/efi/Protocol/SimpleTextIn.h
index f14f62d..83ba9e7 100644
--- a/src/include/gpxe/efi/Protocol/SimpleTextIn.h
+++ b/src/include/gpxe/efi/Protocol/SimpleTextIn.h
@@ -1,11 +1,11 @@
 /** @file
-  Simple Text In protocol from the UEFI 2.0 specification.
+  Simple Text Input protocol from the UEFI 2.0 specification.
 
   Abstraction of a very simple input device like a keyboard or serial
   terminal.
 
-  Copyright (c) 2006 - 2008, Intel Corporation
-  All rights reserved. This program and the accompanying materials
+  Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>
+  This program and the accompanying materials
   are licensed and made available under the terms and conditions of the BSD License
   which accompanies this distribution.  The full text of the license may be found at
   http://opensource.org/licenses/bsd-license.php
@@ -18,27 +18,26 @@
 #ifndef __SIMPLE_TEXT_IN_PROTOCOL_H__
 #define __SIMPLE_TEXT_IN_PROTOCOL_H__
 
-#include <gpxe/efi/ProcessorBind.h>
-
 #define EFI_SIMPLE_TEXT_INPUT_PROTOCOL_GUID \
   { \
     0x387477c1, 0x69c7, 0x11d2, {0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b } \
   }
 
+typedef struct _EFI_SIMPLE_TEXT_INPUT_PROTOCOL  EFI_SIMPLE_TEXT_INPUT_PROTOCOL;
+
 ///
-/// Protocol GUID defined in EFI1.1.
+/// Protocol GUID name defined in EFI1.1.
 ///
 #define SIMPLE_INPUT_PROTOCOL   EFI_SIMPLE_TEXT_INPUT_PROTOCOL_GUID
 
-typedef struct _EFI_SIMPLE_TEXT_INPUT_PROTOCOL  EFI_SIMPLE_TEXT_INPUT_PROTOCOL;
-
 ///
-/// Backward-compatible with EFI1.1.
+/// Protocol name in EFI1.1 for backward-compatible.
 ///
 typedef struct _EFI_SIMPLE_TEXT_INPUT_PROTOCOL  SIMPLE_INPUT_INTERFACE;
-//
-// Data structures
-//
+
+///
+/// The keystroke information for the key that was pressed.
+///
 typedef struct {
   UINT16  ScanCode;
   CHAR16  UnicodeChar;
@@ -82,7 +81,7 @@ typedef struct {
 #define SCAN_ESC        0x0017
 
 /**
-  Reset the input device and optionaly run diagnostics
+  Reset the input device and optionally run diagnostics
 
   @param  This                 Protocol instance pointer.
   @param  ExtendedVerification Driver may perform diagnostics on reset.
@@ -100,14 +99,14 @@ EFI_STATUS
 
 /**
   Reads the next keystroke from the input device. The WaitForKey Event can
-  be used to test for existance of a keystroke via WaitForEvent () call.
+  be used to test for existence of a keystroke via WaitForEvent () call.
 
   @param  This Protocol instance pointer.
   @param  Key  Driver may perform diagnostics on reset.
 
   @retval EFI_SUCCESS      The keystroke information was returned.
-  @retval EFI_NOT_READY    There was no keystroke data availiable.
-  @retval EFI_DEVICE_ERROR The keydtroke information was not returned due to
+  @retval EFI_NOT_READY    There was no keystroke data available.
+  @retval EFI_DEVICE_ERROR The keystroke information was not returned due to
                            hardware errors.
 
 **/
diff --git a/src/include/gpxe/efi/Protocol/SimpleTextOut.h b/src/include/gpxe/efi/Protocol/SimpleTextOut.h
index 426ce81..7e1c70c 100644
--- a/src/include/gpxe/efi/Protocol/SimpleTextOut.h
+++ b/src/include/gpxe/efi/Protocol/SimpleTextOut.h
@@ -3,17 +3,17 @@
 
   Abstraction of a very simple text based output device like VGA text mode or
   a serial terminal. The Simple Text Out protocol instance can represent
-  a single hardware device or a virtual device that is an agregation
+  a single hardware device or a virtual device that is an aggregation
   of multiple physical devices.
 
-  Copyright (c) 2006 - 2008, Intel Corporation
-  All rights reserved. This program and the accompanying materials
-  are licensed and made available under the terms and conditions of the BSD License
-  which accompanies this distribution.  The full text of the license may be found at
-  http://opensource.org/licenses/bsd-license.php
+Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
+This program and the accompanying materials are licensed and made available under
+the terms and conditions of the BSD License that accompanies this distribution.
+The full text of the license may be found at
+http://opensource.org/licenses/bsd-license.php.
 
-  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 
 **/
 
@@ -137,18 +137,18 @@ typedef EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL   SIMPLE_TEXT_OUTPUT_INTERFACE;
 
 //
 // We currently define attributes from 0 - 7F for color manipulations
-// To internally handle the local display characteristics for a particular character, we are defining
-// Bit 7 to signify the local glyph representation for a character.  If turned on, glyphs will be
+// To internally handle the local display characteristics for a particular character,
+// Bit 7 signifies the local glyph representation for a character.  If turned on, glyphs will be
 // pulled from the wide glyph database and will display locally as a wide character (16 X 19 versus 8 X 19)
 // If bit 7 is off, the narrow glyph database will be used.  This does NOT affect information that is sent to
-// non-local displays (e.g. serial or LAN consoles).
+// non-local displays, such as serial or LAN consoles.
 //
 #define EFI_WIDE_ATTRIBUTE  0x80
 
 /**
   Reset the text output device hardware and optionaly run diagnostics
 
-  @param  This                 Protocol instance pointer.
+  @param  This                 The protocol instance pointer.
   @param  ExtendedVerification Driver may perform more exhaustive verfication
                                operation of the device during reset.
 
@@ -165,12 +165,12 @@ EFI_STATUS
   );
 
 /**
-  Write a Unicode string to the output device.
+  Write a string to the output device.
 
-  @param  This   Protocol instance pointer.
-  @param  String The NULL-terminated Unicode string to be displayed on the output
+  @param  This   The protocol instance pointer.
+  @param  String The NULL-terminated string to be displayed on the output
                  device(s). All output devices must also support the Unicode
-                 drawing defined in this file.
+                 drawing character codes defined in this file.
 
   @retval EFI_SUCCESS             The string was output to the device.
   @retval EFI_DEVICE_ERROR        The device reported an error while attempting to output
@@ -178,7 +178,7 @@ EFI_STATUS
   @retval EFI_UNSUPPORTED         The output device's mode is not currently in a
                                   defined text mode.
   @retval EFI_WARN_UNKNOWN_GLYPH  This warning code indicates that some of the
-                                  characters in the Unicode string could not be
+                                  characters in the string could not be
                                   rendered and were skipped.
 
 **/
@@ -190,15 +190,15 @@ EFI_STATUS
   );
 
 /**
-  Verifies that all characters in a Unicode string can be output to the
+  Verifies that all characters in a string can be output to the
   target device.
 
-  @param  This   Protocol instance pointer.
-  @param  String The NULL-terminated Unicode string to be examined for the output
+  @param  This   The protocol instance pointer.
+  @param  String The NULL-terminated string to be examined for the output
                  device(s).
 
   @retval EFI_SUCCESS      The device(s) are capable of rendering the output string.
-  @retval EFI_UNSUPPORTED  Some of the characters in the Unicode string cannot be
+  @retval EFI_UNSUPPORTED  Some of the characters in the string cannot be
                            rendered by one or more of the output devices mapped
                            by the EFI handle.
 
@@ -214,7 +214,7 @@ EFI_STATUS
   Returns information for an available text mode that the output device(s)
   supports.
 
-  @param  This       Protocol instance pointer.
+  @param  This       The protocol instance pointer.
   @param  ModeNumber The mode number to return information on.
   @param  Columns    Returns the geometry of the text output device for the
                      requested ModeNumber.
@@ -238,7 +238,7 @@ EFI_STATUS
 /**
   Sets the output device(s) to a specified mode.
 
-  @param  This       Protocol instance pointer.
+  @param  This       The protocol instance pointer.
   @param  ModeNumber The mode number to set.
 
   @retval EFI_SUCCESS      The requested text mode was set.
@@ -257,14 +257,14 @@ EFI_STATUS
   Sets the background and foreground colors for the OutputString () and
   ClearScreen () functions.
 
-  @param  This      Protocol instance pointer.
+  @param  This      The protocol instance pointer.
   @param  Attribute The attribute to set. Bits 0..3 are the foreground color, and
                     bits 4..6 are the background color. All other bits are undefined
                     and must be zero. The valid Attributes are defined in this file.
 
-  @retval EFI_SUCCESS     The attribute was set.
-  @retval EFI_DEVICE_     ERROR The device had an error and could not complete the request.
-  @retval EFI_UNSUPPORTED The attribute requested is not defined.
+  @retval EFI_SUCCESS       The attribute was set.
+  @retval EFI_DEVICE_ERROR  The device had an error and could not complete the request.
+  @retval EFI_UNSUPPORTED   The attribute requested is not defined.
 
 **/
 typedef
@@ -278,7 +278,7 @@ EFI_STATUS
   Clears the output device(s) display to the currently selected background
   color.
 
-  @param  This              Protocol instance pointer.
+  @param  This              The protocol instance pointer.
 
   @retval  EFI_SUCCESS      The operation completed successfully.
   @retval  EFI_DEVICE_ERROR The device had an error and could not complete the request.
@@ -294,7 +294,7 @@ EFI_STATUS
 /**
   Sets the current coordinates of the cursor position
 
-  @param  This        Protocol instance pointer.
+  @param  This        The protocol instance pointer.
   @param  Column      The position to set the cursor to. Must be greater than or
                       equal to zero and less than the number of columns and rows
                       by QueryMode ().
@@ -319,7 +319,7 @@ EFI_STATUS
 /**
   Makes the cursor visible or invisible
 
-  @param  This    Protocol instance pointer.
+  @param  This    The protocol instance pointer.
   @param  Visible If TRUE, the cursor is set to be visible. If FALSE, the cursor is
                   set to be invisible.
 
@@ -340,36 +340,36 @@ EFI_STATUS
 /**
   @par Data Structure Description:
   Mode Structure pointed to by Simple Text Out protocol.
-
-  @param MaxMode
-  The number of modes supported by QueryMode () and SetMode ().
-
-  @param Mode
-  The text mode of the output device(s).
-
-  @param Attribute
-  The current character output attribute
-
-  @param CursorColumn
-  The cursor's column.
-
-  @param CursorRow
-  The cursor's row.
-
-  @param CursorVisible
-  The cursor is currently visbile or not.
-
 **/
 typedef struct {
+  ///
+  /// The number of modes supported by QueryMode () and SetMode ().
+  ///
   INT32   MaxMode;
 
   //
   // current settings
   //
+
+  ///
+  /// The text mode of the output device(s).
+  ///
   INT32   Mode;
+  ///
+  /// The current character output attribute.
+  ///
   INT32   Attribute;
+  ///
+  /// The cursor's column.
+  ///
   INT32   CursorColumn;
+  ///
+  /// The cursor's row.
+  ///
   INT32   CursorRow;
+  ///
+  /// The cursor is currently visbile or not.
+  ///
   BOOLEAN CursorVisible;
 } EFI_SIMPLE_TEXT_OUTPUT_MODE;
 
diff --git a/src/include/gpxe/efi/Uefi.h b/src/include/gpxe/efi/Uefi.h
index 58ddb11..1b07af7 100644
--- a/src/include/gpxe/efi/Uefi.h
+++ b/src/include/gpxe/efi/Uefi.h
@@ -6,11 +6,11 @@
   types defined via this include file and can be ported easily to any
   environment.
 
-Copyright (c) 2006 - 2007, Intel Corporation
-All rights reserved. This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution.  The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
+Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
+This program and the accompanying materials are licensed and made available under
+the terms and conditions of the BSD License that accompanies this distribution.
+The full text of the license may be found at
+http://opensource.org/licenses/bsd-license.php.
 
 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
diff --git a/src/include/gpxe/efi/Uefi/UefiBaseType.h b/src/include/gpxe/efi/Uefi/UefiBaseType.h
index 475ac01..54e3558 100644
--- a/src/include/gpxe/efi/Uefi/UefiBaseType.h
+++ b/src/include/gpxe/efi/Uefi/UefiBaseType.h
@@ -1,14 +1,14 @@
 /** @file
   Defines data types and constants introduced in UEFI.
 
-  Copyright (c) 2006 - 2008, Intel Corporation
-  All rights reserved. This program and the accompanying materials
-  are licensed and made available under the terms and conditions of the BSD License
-  which accompanies this distribution.  The full text of the license may be found at
-  http://opensource.org/licenses/bsd-license.php
+Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
+This program and the accompanying materials are licensed and made available under
+the terms and conditions of the BSD License that accompanies this distribution.
+The full text of the license may be found at
+http://opensource.org/licenses/bsd-license.php.
 
-  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 
 **/
 
@@ -18,7 +18,7 @@
 #include <gpxe/efi/Base.h>
 
 //
-// Basical data type definitions introduced in UEFI.
+// Basic data type definitions introduced in UEFI.
 //
 
 ///
@@ -26,7 +26,7 @@
 ///
 typedef GUID                      EFI_GUID;
 ///
-/// Function return status for EFI API
+/// Function return status for EFI API.
 ///
 typedef RETURN_STATUS             EFI_STATUS;
 ///
@@ -45,12 +45,20 @@ typedef UINTN                     EFI_TPL;
 /// Logical block address.
 ///
 typedef UINT64                    EFI_LBA;
+
+///
+/// 64-bit physical memory address.
+///
 typedef UINT64                    EFI_PHYSICAL_ADDRESS;
+
+///
+/// 64-bit virtual memory address.
+///
 typedef UINT64                    EFI_VIRTUAL_ADDRESS;
 
 ///
 /// EFI Time Abstraction:
-///  Year:       1998 - 20XX
+///  Year:       1900 - 9999
 ///  Month:      1 - 12
 ///  Day:        1 - 31
 ///  Hour:       0 - 23
@@ -82,7 +90,7 @@ typedef struct {
 } EFI_IPv4_ADDRESS;
 
 ///
-/// 16-byte buffer. An IPv6 internet protocol address
+/// 16-byte buffer. An IPv6 internet protocol address.
 ///
 typedef struct {
   UINT8 Addr[16];
@@ -106,9 +114,9 @@ typedef union {
 } EFI_IP_ADDRESS;
 
 
-//
-// Enumeration of EFI_STATUS.
-//
+///
+/// Enumeration of EFI_STATUS.
+///@{
 #define EFI_SUCCESS               RETURN_SUCCESS
 #define EFI_LOAD_ERROR            RETURN_LOAD_ERROR
 #define EFI_INVALID_PARAMETER     RETURN_INVALID_PARAMETER
@@ -145,27 +153,31 @@ typedef union {
 #define EFI_WARN_DELETE_FAILURE   RETURN_WARN_DELETE_FAILURE
 #define EFI_WARN_WRITE_FAILURE    RETURN_WARN_WRITE_FAILURE
 #define EFI_WARN_BUFFER_TOO_SMALL RETURN_WARN_BUFFER_TOO_SMALL
+///@}
 
-
-//
-// Define macro to encode the status code.
-//
+///
+/// Define macro to encode the status code.
+///
 #define EFIERR(_a)                ENCODE_ERROR(_a)
 
 #define EFI_ERROR(A)              RETURN_ERROR(A)
 
-//
-// Define macros to build data structure signatures from characters.
-//
-#define EFI_SIGNATURE_16(A, B)                    SIGNATURE_16 (A, B)
-#define EFI_SIGNATURE_32(A, B, C, D)              SIGNATURE_32 (A, B, C, D)
-#define EFI_SIGNATURE_64(A, B, C, D, E, F, G, H)  SIGNATURE_64 (A, B, C, D, E, F, G, H)
-
-
 ///
-///  Returns the byte offset to a field within a structure
+/// ICMP error definitions
+///@{
+#define EFI_NETWORK_UNREACHABLE   EFIERR(100)
+#define EFI_HOST_UNREACHABLE      EFIERR(101)
+#define EFI_PROTOCOL_UNREACHABLE  EFIERR(102)
+#define EFI_PORT_UNREACHABLE      EFIERR(103)
+///@}
+
 ///
-#define EFI_FIELD_OFFSET(TYPE,Field) ((UINTN)(&(((TYPE *) 0)->Field)))
+/// Tcp connection status definitions
+///@{
+#define EFI_CONNECTION_FIN        EFIERR(104)
+#define EFI_CONNECTION_RESET      EFIERR(105)
+#define EFI_CONNECTION_REFUSED    EFIERR(106)
+///@}
 
 //
 // The EFI memory allocation functions work in units of EFI_PAGEs that are
@@ -180,21 +192,72 @@ typedef union {
 
 #define EFI_PAGES_TO_SIZE(a)   ( (a) << EFI_PAGE_SHIFT)
 
+///
+/// PE32+ Machine type for IA32 UEFI images.
+///
+#define EFI_IMAGE_MACHINE_IA32            0x014C
+
+///
+/// PE32+ Machine type for IA64 UEFI images.
+///
+#define EFI_IMAGE_MACHINE_IA64            0x0200
 
-#define EFI_MAX_BIT               MAX_BIT
-#define EFI_MAX_ADDRESS           MAX_ADDRESS
+///
+/// PE32+ Machine type for EBC UEFI images.
+///
+#define EFI_IMAGE_MACHINE_EBC             0x0EBC
 
+///
+/// PE32+ Machine type for X64 UEFI images.
+///
+#define EFI_IMAGE_MACHINE_X64             0x8664
 
 ///
-/// Limited buffer size for a language code recommended by RFC3066
-/// (42 characters plus a NULL terminator)
+/// PE32+ Machine type for ARM mixed ARM and Thumb/Thumb2 images.
 ///
-#define RFC_3066_ENTRY_SIZE             (42 + 1)
+#define EFI_IMAGE_MACHINE_ARMTHUMB_MIXED  0x01C2
+
+
+#if   defined (MDE_CPU_IA32)
+
+#define EFI_IMAGE_MACHINE_TYPE_SUPPORTED(Machine) \
+  (((Machine) == EFI_IMAGE_MACHINE_IA32) || ((Machine) == EFI_IMAGE_MACHINE_EBC))
+
+#define EFI_IMAGE_MACHINE_CROSS_TYPE_SUPPORTED(Machine) ((Machine) == EFI_IMAGE_MACHINE_X64)
+
+#elif defined (MDE_CPU_IPF)
+
+#define EFI_IMAGE_MACHINE_TYPE_SUPPORTED(Machine) \
+  (((Machine) == EFI_IMAGE_MACHINE_IA64) || ((Machine) == EFI_IMAGE_MACHINE_EBC))
+
+#define EFI_IMAGE_MACHINE_CROSS_TYPE_SUPPORTED(Machine) (FALSE)
+
+#elif defined (MDE_CPU_X64)
+
+#define EFI_IMAGE_MACHINE_TYPE_SUPPORTED(Machine) \
+  (((Machine) == EFI_IMAGE_MACHINE_X64) || ((Machine) == EFI_IMAGE_MACHINE_EBC))
+
+#define EFI_IMAGE_MACHINE_CROSS_TYPE_SUPPORTED(Machine) ((Machine) == EFI_IMAGE_MACHINE_IA32)
+
+#elif defined (MDE_CPU_ARM)
+
+#define EFI_IMAGE_MACHINE_TYPE_SUPPORTED(Machine) \
+  (((Machine) == EFI_IMAGE_MACHINE_ARMTHUMB_MIXED) || ((Machine) == EFI_IMAGE_MACHINE_EBC))
+
+#define EFI_IMAGE_MACHINE_CROSS_TYPE_SUPPORTED(Machine) ((Machine) == EFI_IMAGE_MACHINE_ARMTHUMB_MIXED)
+
+#elif defined (MDE_CPU_EBC)
 
 ///
-/// The size of a 3 character ISO639 language code.
+/// This is just to make sure you can cross compile with the EBC compiler.
+/// It does not make sense to have a PE loader coded in EBC.
 ///
-#define ISO_639_2_ENTRY_SIZE            3
+#define EFI_IMAGE_MACHINE_TYPE_SUPPORTED(Machine) ((Machine) == EFI_IMAGE_MACHINE_EBC)
 
+#define EFI_IMAGE_MACHINE_CROSS_TYPE_SUPPORTED(Machine) (FALSE)
+
+#else
+#error Unknown Processor Type
+#endif
 
 #endif
diff --git a/src/include/gpxe/efi/Uefi/UefiGpt.h b/src/include/gpxe/efi/Uefi/UefiGpt.h
index 92c3035..9f56338 100644
--- a/src/include/gpxe/efi/Uefi/UefiGpt.h
+++ b/src/include/gpxe/efi/Uefi/UefiGpt.h
@@ -1,14 +1,14 @@
 /** @file
   EFI Guid Partition Table Format Definition.
 
-  Copyright (c) 2006 - 2008, Intel Corporation
-  All rights reserved. This program and the accompanying materials
-  are licensed and made available under the terms and conditions of the BSD License
-  which accompanies this distribution.  The full text of the license may be found at
-  http://opensource.org/licenses/bsd-license.php
+Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
+This program and the accompanying materials are licensed and made available under
+the terms and conditions of the BSD License that accompanies this distribution.
+The full text of the license may be found at
+http://opensource.org/licenses/bsd-license.php.
 
-  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 
 **/
 
@@ -20,39 +20,113 @@
 /// located in LBA 1 (i.e., the second logical block).
 ///
 #define PRIMARY_PART_HEADER_LBA 1
-
 ///
-/// EFI Partition Table Signature: "EFI PART"
+/// EFI Partition Table Signature: "EFI PART".
 ///
-#define EFI_PTAB_HEADER_ID      0x5452415020494645ULL
+#define EFI_PTAB_HEADER_ID      SIGNATURE_64 ('E','F','I',' ','P','A','R','T')
 
 #pragma pack(1)
 
 ///
-/// GPT Partition Table Header
+/// GPT Partition Table Header.
 ///
 typedef struct {
+  ///
+  /// The table header for the GPT partition Table.
+  /// This header contains EFI_PTAB_HEADER_ID.
+  ///
   EFI_TABLE_HEADER  Header;
+  ///
+  /// The LBA that contains this data structure.
+  ///
   EFI_LBA           MyLBA;
+  ///
+  /// LBA address of the alternate GUID Partition Table Header.
+  ///
   EFI_LBA           AlternateLBA;
+  ///
+  /// The first usable logical block that may be used
+  /// by a partition described by a GUID Partition Entry.
+  ///
   EFI_LBA           FirstUsableLBA;
+  ///
+  /// The last usable logical block that may be used
+  /// by a partition described by a GUID Partition Entry.
+  ///
   EFI_LBA           LastUsableLBA;
+  ///
+  /// GUID that can be used to uniquely identify the disk.
+  ///
   EFI_GUID          DiskGUID;
+  ///
+  /// The starting LBA of the GUID Partition Entry array.
+  ///
   EFI_LBA           PartitionEntryLBA;
+  ///
+  /// The number of Partition Entries in the GUID Partition Entry array.
+  ///
   UINT32            NumberOfPartitionEntries;
+  ///
+  /// The size, in bytes, of each the GUID Partition
+  /// Entry structures in the GUID Partition Entry
+  /// array. Must be a multiple of 8.
+  ///
   UINT32            SizeOfPartitionEntry;
+  ///
+  /// The CRC32 of the GUID Partition Entry array.
+  /// Starts at PartitionEntryLBA and is
+  /// computed over a byte length of
+  /// NumberOfPartitionEntries * SizeOfPartitionEntry.
+  ///
   UINT32            PartitionEntryArrayCRC32;
 } EFI_PARTITION_TABLE_HEADER;
 
 ///
-/// GPT Partition Entry
+/// GPT Partition Entry.
 ///
 typedef struct {
+  ///
+  /// Unique ID that defines the purpose and type of this Partition. A value of
+  /// zero defines that this partition entry is not being used.
+  ///
   EFI_GUID  PartitionTypeGUID;
+  ///
+  /// GUID that is unique for every partition entry. Every partition ever
+  /// created will have a unique GUID.
+  /// This GUID must be assigned when the GUID Partition Entry is created.
+  ///
   EFI_GUID  UniquePartitionGUID;
+  ///
+  /// Starting LBA of the partition defined by this entry
+  ///
   EFI_LBA   StartingLBA;
+  ///
+  /// Ending LBA of the partition defined by this entry.
+  ///
   EFI_LBA   EndingLBA;
+  ///
+  /// Attribute bits, all bits reserved by UEFI
+  /// Bit 0:      If this bit is set, the partition is required for the platform to function. The owner/creator of the
+  ///             partition indicates that deletion or modification of the contents can result in loss of platform
+  ///             features or failure for the platform to boot or operate. The system cannot function normally if
+  ///             this partition is removed, and it should be considered part of the hardware of the system.
+  ///             Actions such as running diagnostics, system recovery, or even OS install or boot, could
+  ///             potentially stop working if this partition is removed. Unless OS software or firmware
+  ///             recognizes this partition, it should never be removed or modified as the UEFI firmware or
+  ///             platform hardware may become non-functional.
+  /// Bit 1:      If this bit is set firmware must not produce an EFI_BLOCK_IO_PROTOCOL device for
+  ///             this partition. By not producing EFI_BLOCK_IO_PROTOCOL partition, file system
+  ///             mappings will not be created for this partition in UEFI.
+  /// Bits 2-47:  Undefined and must be zero. Reserved for expansion by future versions of the UEFI
+  ///             specification.
+  /// Bits 48-63: Reserved for GUID specific use. The use of these bits will vary depending on the
+  ///             PartitionTypeGUID. Only the owner of the PartitionTypeGUID is allowed
+  ///             to modify these bits. They must be preserved if Bits 0-47 are modified..
+  ///
   UINT64    Attributes;
+  ///
+  /// Null-terminated name of the partition.
+  ///
   CHAR16    PartitionName[36];
 } EFI_PARTITION_ENTRY;
 
diff --git a/src/include/gpxe/efi/Uefi/UefiInternalFormRepresentation.h b/src/include/gpxe/efi/Uefi/UefiInternalFormRepresentation.h
index c675517..096986d 100644
--- a/src/include/gpxe/efi/Uefi/UefiInternalFormRepresentation.h
+++ b/src/include/gpxe/efi/Uefi/UefiInternalFormRepresentation.h
@@ -3,23 +3,25 @@
   IFR is primarily consumed by the EFI presentation engine, and produced by EFI
   internal application and drivers as well as all add-in card option-ROM drivers
 
-  Copyright (c) 2006 - 2008, Intel Corporation
-  All rights reserved. This program and the accompanying materials
-  are licensed and made available under the terms and conditions of the BSD License
-  which accompanies this distribution.  The full text of the license may be found at
-  http://opensource.org/licenses/bsd-license.php
+Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
+This program and the accompanying materials are licensed and made available under
+the terms and conditions of the BSD License that accompanies this distribution.
+The full text of the license may be found at
+http://opensource.org/licenses/bsd-license.php.
 
-  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 
   @par Revision Reference:
-  These definitions are from UEFI2.1.
+  These definitions are from UEFI 2.1 and 2.2.
 
 **/
 
 #ifndef __UEFI_INTERNAL_FORMREPRESENTATION_H__
 #define __UEFI_INTERNAL_FORMREPRESENTATION_H__
 
+#include <gpxe/efi/Guid/HiiFormMapMethodGuid.h>
+
 ///
 /// The following types are currently defined:
 ///
@@ -30,6 +32,7 @@ typedef UINT16  EFI_QUESTION_ID;
 typedef UINT16  EFI_STRING_ID;
 typedef UINT16  EFI_FORM_ID;
 typedef UINT16  EFI_VARSTORE_ID;
+typedef UINT16  EFI_ANIMATION_ID;
 
 typedef UINT16  EFI_DEFAULT_ID;
 
@@ -73,34 +76,76 @@ typedef struct {
 #define EFI_HII_PACKAGE_SIMPLE_FONTS         0x07
 #define EFI_HII_PACKAGE_DEVICE_PATH          0x08
 #define EFI_HII_PACKAGE_KEYBOARD_LAYOUT      0x09
+#define EFI_HII_PACKAGE_ANIMATIONS           0x0A
 #define EFI_HII_PACKAGE_END                  0xDF
 #define EFI_HII_PACKAGE_TYPE_SYSTEM_BEGIN    0xE0
 #define EFI_HII_PACKAGE_TYPE_SYSTEM_END      0xFF
 
 //
 // Definitions for Simplified Font Package
-// Section 27.3.2
 //
 
-//
-// Contents of EFI_NARROW_GLYPH.Attributes
-//
+///
+/// Contents of EFI_NARROW_GLYPH.Attributes.
+///@{
 #define EFI_GLYPH_NON_SPACING                0x01
 #define EFI_GLYPH_WIDE                       0x02
 #define EFI_GLYPH_HEIGHT                     19
 #define EFI_GLYPH_WIDTH                      8
+///@}
 
+///
+/// The EFI_NARROW_GLYPH has a preferred dimension (w x h) of 8 x 19 pixels.
+///
 typedef struct {
+  ///
+  /// The Unicode representation of the glyph. The term weight is the
+  /// technical term for a character code.
+  ///
   CHAR16                 UnicodeWeight;
+  ///
+  /// The data element containing the glyph definitions.
+  ///
   UINT8                  Attributes;
+  ///
+  /// The column major glyph representation of the character. Bits
+  /// with values of one indicate that the corresponding pixel is to be
+  /// on when normally displayed; those with zero are off.
+  ///
   UINT8                  GlyphCol1[EFI_GLYPH_HEIGHT];
 } EFI_NARROW_GLYPH;
 
+///
+/// The EFI_WIDE_GLYPH has a preferred dimension (w x h) of 16 x 19 pixels, which is large enough
+/// to accommodate logographic characters.
+///
 typedef struct {
+  ///
+  /// The Unicode representation of the glyph. The term weight is the
+  /// technical term for a character code.
+  ///
   CHAR16                 UnicodeWeight;
+  ///
+  /// The data element containing the glyph definitions.
+  ///
   UINT8                  Attributes;
+  ///
+  /// The column major glyph representation of the character. Bits
+  /// with values of one indicate that the corresponding pixel is to be
+  /// on when normally displayed; those with zero are off.
+  ///
   UINT8                  GlyphCol1[EFI_GLYPH_HEIGHT];
+  ///
+  /// The column major glyph representation of the character. Bits
+  /// with values of one indicate that the corresponding pixel is to be
+  /// on when normally displayed; those with zero are off.
+  ///
   UINT8                  GlyphCol2[EFI_GLYPH_HEIGHT];
+  ///
+  /// Ensures that sizeof (EFI_WIDE_GLYPH) is twice the
+  /// sizeof (EFI_NARROW_GLYPH). The contents of Pad must
+  /// be zero.
+  ///
   UINT8                  Pad[3];
 } EFI_WIDE_GLYPH;
 
@@ -142,7 +187,7 @@ typedef struct _EFI_HII_GLYPH_INFO {
 } EFI_HII_GLYPH_INFO;
 
 ///
-/// The fixed header consists of a standard record header and
+/// The fixed header consists of a standard record header,
 /// then the character values in this section, the flags
 /// (including the encoding method) and the offsets of the glyph
 /// information, the glyph bitmaps and the character map.
@@ -255,10 +300,10 @@ typedef struct _EFI_HII_GIBT_SKIP2_BLOCK {
 /// The device path package is used to carry a device path
 /// associated with the package list.
 ///
-typedef struct _EFI_HII_DEVICE_PATH_PACKAGE {
+typedef struct _EFI_HII_DEVICE_PATH_PACKAGE_HDR {
   EFI_HII_PACKAGE_HEADER   Header;
   // EFI_DEVICE_PATH_PROTOCOL DevicePath[];
-} EFI_HII_DEVICE_PATH_PACKAGE;
+} EFI_HII_DEVICE_PATH_PACKAGE_HDR;
 
 //
 // Definitions for GUID Package
@@ -279,8 +324,8 @@ typedef struct _EFI_HII_GUID_PACKAGE_HDR {
 // Section 27.3.6
 //
 
-#define UEFI_CONFIG_LANG  L"x-UEFI"
-#define UEFI_CONFIG_LANG2 L"x-i-UEFI"
+#define UEFI_CONFIG_LANG   "x-UEFI"
+#define UEFI_CONFIG_LANG_2 "x-i-UEFI"
 
 ///
 /// The fixed header consists of a standard record header and then the string identifiers
@@ -593,13 +638,13 @@ typedef struct _EFI_HII_IMAGE_PALETTE_INFO {
 //
 
 ///
-/// The Forms package is used to carry forms-based encoding data.
+/// The Form package is used to carry form-based encoding data.
 ///
-typedef struct _EFI_HII_FORM_PACKAGE {
+typedef struct _EFI_HII_FORM_PACKAGE_HDR {
   EFI_HII_PACKAGE_HEADER       Header;
   // EFI_IFR_OP_HEADER         OpCodeHeader;
   // More op-codes follow
-} EFI_HII_FORM_PACKAGE;
+} EFI_HII_FORM_PACKAGE_HDR;
 
 typedef struct {
   UINT8 Hour;
@@ -621,7 +666,8 @@ typedef union {
   BOOLEAN         b;
   EFI_HII_TIME    time;
   EFI_HII_DATE    date;
-  EFI_STRING_ID   string;
+  EFI_STRING_ID   string; ///< EFI_IFR_TYPE_STRING, EFI_IFR_TYPE_ACTION
+  // UINT8 buffer[];      ///< EFI_IFR_TYPE_ORDERED_LIST
 } EFI_IFR_TYPE_VALUE;
 
 //
@@ -657,8 +703,10 @@ typedef union {
 #define EFI_IFR_STRING_OP              0x1C
 #define EFI_IFR_REFRESH_OP             0x1D
 #define EFI_IFR_DISABLE_IF_OP          0x1E
+#define EFI_IFR_ANIMATION_OP           0x1F
 #define EFI_IFR_TO_LOWER_OP            0x20
 #define EFI_IFR_TO_UPPER_OP            0x21
+#define EFI_IFR_MAP_OP                 0x22
 #define EFI_IFR_ORDERED_LIST_OP        0x23
 #define EFI_IFR_VARSTORE_OP            0x24
 #define EFI_IFR_VARSTORE_NAME_VALUE_OP 0x25
@@ -667,6 +715,10 @@ typedef union {
 #define EFI_IFR_VERSION_OP             0x28
 #define EFI_IFR_END_OP                 0x29
 #define EFI_IFR_MATCH_OP               0x2A
+#define EFI_IFR_GET_OP                 0x2B
+#define EFI_IFR_SET_OP                 0x2C
+#define EFI_IFR_READ_OP                0x2D
+#define EFI_IFR_WRITE_OP               0x2E
 #define EFI_IFR_EQUAL_OP               0x2F
 #define EFI_IFR_NOT_EQUAL_OP           0x30
 #define EFI_IFR_GREATER_THAN_OP        0x31
@@ -713,8 +765,10 @@ typedef union {
 #define EFI_IFR_VALUE_OP               0x5A
 #define EFI_IFR_DEFAULT_OP             0x5B
 #define EFI_IFR_DEFAULTSTORE_OP        0x5C
+#define EFI_IFR_FORM_MAP_OP            0x5D
 #define EFI_IFR_CATENATE_OP            0x5E
 #define EFI_IFR_GUID_OP                0x5F
+#define EFI_IFR_SECURITY_OP            0x60
 
 //
 // Definitions of IFR Standard Headers
@@ -800,6 +854,8 @@ typedef struct _EFI_IFR_FORM_SET {
   EFI_GUID                 Guid;
   EFI_STRING_ID            FormSetTitle;
   EFI_STRING_ID            Help;
+  UINT8                    Flags;
+  // EFI_GUID              ClassGuid[];
 } EFI_IFR_FORM_SET;
 
 typedef struct _EFI_IFR_END {
@@ -892,7 +948,7 @@ typedef struct _EFI_IFR_REF4 {
 
 typedef struct _EFI_IFR_RESET_BUTTON {
   EFI_IFR_OP_HEADER        Header;
-  EFI_IFR_QUESTION_HEADER  Question;
+  EFI_IFR_STATEMENT_HEADER Statement;
   EFI_DEFAULT_ID           DefaultId;
 } EFI_IFR_RESET_BUTTON;
 
@@ -1073,6 +1129,9 @@ typedef struct _EFI_IFR_ONE_OF_OPTION {
 #define EFI_IFR_TYPE_DATE              0x06
 #define EFI_IFR_TYPE_STRING            0x07
 #define EFI_IFR_TYPE_OTHER             0x08
+#define EFI_IFR_TYPE_UNDEFINED         0x09
+#define EFI_IFR_TYPE_ACTION            0x0A
+#define EFI_IFR_TYPE_BUFFER            0x0B
 
 #define EFI_IFR_OPTION_DEFAULT         0x10
 #define EFI_IFR_OPTION_DEFAULT_MFG     0x20
@@ -1099,12 +1158,12 @@ typedef struct _EFI_IFR_EQ_ID_VAL {
   UINT16                   Value;
 } EFI_IFR_EQ_ID_VAL;
 
-typedef struct _EFI_IFR_EQ_ID_LIST {
+typedef struct _EFI_IFR_EQ_ID_VAL_LIST {
   EFI_IFR_OP_HEADER        Header;
   EFI_QUESTION_ID          QuestionId;
   UINT16                   ListLength;
   UINT16                   ValueList[1];
-} EFI_IFR_EQ_ID_LIST;
+} EFI_IFR_EQ_ID_VAL_LIST;
 
 typedef struct _EFI_IFR_UINT8 {
   EFI_IFR_OP_HEADER        Header;
@@ -1212,25 +1271,28 @@ typedef struct _EFI_IFR_TO_BOOLEAN {
   EFI_IFR_OP_HEADER        Header;
 } EFI_IFR_TO_BOOLEAN;
 
-//
-// For EFI_IFR_TO_STRING, when converting from
-// unsigned integers, these flags control the format:
-// 0 = unsigned decimal
-// 1 = signed decimal
-// 2 = hexadecimal (lower-case alpha)
-// 3 = hexadecimal (upper-case alpha)
-//
+///
+/// For EFI_IFR_TO_STRING, when converting from
+/// unsigned integers, these flags control the format:
+/// 0 = unsigned decimal.
+/// 1 = signed decimal.
+/// 2 = hexadecimal (lower-case alpha).
+/// 3 = hexadecimal (upper-case alpha).
+///@{
 #define EFI_IFR_STRING_UNSIGNED_DEC      0
 #define EFI_IFR_STRING_SIGNED_DEC        1
 #define EFI_IFR_STRING_LOWERCASE_HEX     2
 #define EFI_IFR_STRING_UPPERCASE_HEX     3
-//
-// When converting from a buffer, these flags control the format:
-// 0 = ASCII
-// 8 = Unicode
-//
+///@}
+
+///
+/// When converting from a buffer, these flags control the format:
+/// 0 = ASCII.
+/// 8 = Unicode.
+///@{
 #define EFI_IFR_STRING_ASCII             0
 #define EFI_IFR_STRING_UNICODE           8
+///@}
 
 typedef struct _EFI_IFR_TO_STRING {
   EFI_IFR_OP_HEADER        Header;
@@ -1360,12 +1422,119 @@ typedef struct _EFI_IFR_SPAN {
   UINT8                    Flags;
 } EFI_IFR_SPAN;
 
+typedef struct _EFI_IFR_SECURITY {
+  ///
+  /// Standard opcode header, where Header.Op = EFI_IFR_SECURITY_OP.
+  ///
+  EFI_IFR_OP_HEADER        Header;
+  ///
+  /// Security permission level.
+  ///
+  EFI_GUID                 Permissions;
+} EFI_IFR_SECURITY;
+
+typedef struct _EFI_IFR_FORM_MAP_METHOD {
+  ///
+  /// The string identifier which provides the human-readable name of
+  /// the configuration method for this standards map form.
+  ///
+  EFI_STRING_ID            MethodTitle;
+  ///
+  /// Identifier which uniquely specifies the configuration methods
+  /// associated with this standards map form.
+  ///
+  EFI_GUID                 MethodIdentifier;
+} EFI_IFR_FORM_MAP_METHOD;
+
+typedef struct _EFI_IFR_FORM_MAP {
+  ///
+  /// The sequence that defines the type of opcode as well as the length
+  /// of the opcode being defined. Header.OpCode = EFI_IFR_FORM_MAP_OP.
+  ///
+  EFI_IFR_OP_HEADER        Header;
+  ///
+  /// The unique identifier for this particular form.
+  ///
+  EFI_FORM_ID              FormId;
+  ///
+  /// One or more configuration method's name and unique identifier.
+  ///
+  // EFI_IFR_FORM_MAP_METHOD  Methods[];
+} EFI_IFR_FORM_MAP;
+
+typedef struct _EFI_IFR_SET {
+  ///
+  /// The sequence that defines the type of opcode as well as the length
+  /// of the opcode being defined. Header.OpCode = EFI_IFR_SET_OP.
+  ///
+  EFI_IFR_OP_HEADER  Header;
+  ///
+  /// Specifies the identifier of a previously declared variable store to
+  /// use when storing the question's value.
+  ///
+  EFI_VARSTORE_ID    VarStoreId;
+  union {
+    ///
+    /// A 16-bit Buffer Storage offset.
+    ///
+    EFI_STRING_ID    VarName;
+    ///
+    /// A Name Value or EFI Variable name (VarName).
+    ///
+    UINT16           VarOffset;
+  }                  VarStoreInfo;
+  ///
+  /// Specifies the type used for storage.
+  ///
+  UINT8              VarStoreType;
+} EFI_IFR_SET;
+
+typedef struct _EFI_IFR_GET {
+  ///
+  /// The sequence that defines the type of opcode as well as the length
+  /// of the opcode being defined. Header.OpCode = EFI_IFR_GET_OP.
+  ///
+  EFI_IFR_OP_HEADER  Header;
+  ///
+  /// Specifies the identifier of a previously declared variable store to
+  /// use when retrieving the value.
+  ///
+  EFI_VARSTORE_ID    VarStoreId;
+  union {
+    ///
+    /// A 16-bit Buffer Storage offset.
+    ///
+    EFI_STRING_ID    VarName;
+    ///
+    /// A Name Value or EFI Variable name (VarName).
+    ///
+    UINT16           VarOffset;
+  }                  VarStoreInfo;
+  ///
+  /// Specifies the type used for storage.
+  ///
+  UINT8              VarStoreType;
+} EFI_IFR_GET;
+
+typedef struct _EFI_IFR_READ {
+  EFI_IFR_OP_HEADER       Header;
+} EFI_IFR_READ;
+
+typedef struct _EFI_IFR_WRITE {
+  EFI_IFR_OP_HEADER      Header;
+} EFI_IFR_WRITE;
+
+typedef struct _EFI_IFR_MAP {
+  EFI_IFR_OP_HEADER      Header;
+} EFI_IFR_MAP;
 //
 // Definitions for Keyboard Package
-// Section 27.3.9
 // Releated definitions are in Section of EFI_HII_DATABASE_PROTOCOL
 //
 
+///
+/// Each enumeration values maps a physical key on a keyboard.
+///
 typedef enum {
   EfiKeyLCtrl,
   EfiKeyA0,
@@ -1475,11 +1644,31 @@ typedef enum {
 } EFI_KEY;
 
 typedef struct {
+  ///
+  /// Used to describe a physical key on a keyboard.
+  ///
   EFI_KEY                 Key;
+  ///
+  /// Unicode character code for the Key.
+  ///
   CHAR16                  Unicode;
+  ///
+  /// Unicode character code for the key with the shift key being held down.
+  ///
   CHAR16                  ShiftedUnicode;
+  ///
+  /// Unicode character code for the key with the Alt-GR being held down.
+  ///
   CHAR16                  AltGrUnicode;
+  ///
+  /// Unicode character code for the key with the Alt-GR and shift keys being held down.
+  ///
   CHAR16                  ShiftedAltGrUnicode;
+  ///
+  /// Modifier keys are defined to allow for special functionality that is not necessarily
+  /// accomplished by a printable character. Many of these modifier keys are flags to toggle
+  /// certain state bits on and off inside of a keyboard driver.
+  ///
   UINT16                  Modifier;
   UINT16                  AffectedAttribute;
 } EFI_KEY_DESCRIPTOR;
@@ -1493,7 +1682,7 @@ typedef struct {
 ///
 /// This key is affected by the caps lock so that if a keyboard driver
 /// would need to disambiguate between a key which had a "1" defined
-/// versus a "a" character.  Having this bit turned on would tell
+/// versus an "a" character.  Having this bit turned on would tell
 /// the keyboard driver to use the appropriate shifted state or not.
 ///
 #define EFI_AFFECTED_BY_CAPS_LOCK            0x0002
@@ -1559,7 +1748,7 @@ typedef struct {
 //
 // Keys that have multiple control functions based on modifier
 // settings are handled in the keyboard driver implementation.
-// For instance PRINT_KEY might have a modifier held down and
+// For instance, PRINT_KEY might have a modifier held down and
 // is still a nonprinting character, but might have an alternate
 // control function like SYSREQUEST
 //
@@ -1573,6 +1762,293 @@ typedef struct {
 #define EFI_RIGHT_LOGO_MODIFIER          0x0028
 #define EFI_MENU_MODIFIER                0x0029
 
+///
+/// Animation IFR opcode
+///
+typedef struct _EFI_IFR_ANIMATION {
+  ///
+  /// Standard opcode header, where Header.OpCode is
+  /// EFI_IFR_ANIMATION_OP.
+  ///
+  EFI_IFR_OP_HEADER        Header;
+  ///
+  /// Animation identifier in the HII database.
+  ///
+  EFI_ANIMATION_ID         Id;
+} EFI_IFR_ANIMATION;
+
+///
+/// HII animation package header.
+///
+typedef struct _EFI_HII_ANIMATION_PACKAGE_HDR {
+  ///
+  /// Standard package header, where Header.Type = EFI_HII_PACKAGE_ANIMATIONS.
+  ///
+  EFI_HII_PACKAGE_HEADER  Header;
+  ///
+  /// Offset, relative to this header, of the animation information. If
+  /// this is zero, then there are no animation sequences in the package.
+  ///
+  UINT32                  AnimationInfoOffset;
+} EFI_HII_ANIMATION_PACKAGE_HDR;
+
+///
+/// Animation information is encoded as a series of blocks,
+/// with each block prefixed by a single byte header EFI_HII_ANIMATION_BLOCK.
+///
+typedef struct _EFI_HII_ANIMATION_BLOCK {
+  UINT8  BlockType;
+  //UINT8  BlockBody[];
+} EFI_HII_ANIMATION_BLOCK;
+
+///
+/// Animation block types.
+///
+#define EFI_HII_AIBT_END                 0x00
+#define EFI_HII_AIBT_OVERLAY_IMAGES      0x10
+#define EFI_HII_AIBT_CLEAR_IMAGES        0x11
+#define EFI_HII_AIBT_RESTORE_SCRN        0x12
+#define EFI_HII_AIBT_OVERLAY_IMAGES_LOOP 0x18
+#define EFI_HII_AIBT_CLEAR_IMAGES_LOOP   0x19
+#define EFI_HII_AIBT_RESTORE_SCRN_LOOP   0x1A
+#define EFI_HII_AIBT_DUPLICATE           0x20
+#define EFI_HII_AIBT_SKIP2               0x21
+#define EFI_HII_AIBT_SKIP1               0x22
+#define EFI_HII_AIBT_EXT1                0x30
+#define EFI_HII_AIBT_EXT2                0x31
+#define EFI_HII_AIBT_EXT4                0x32
+
+///
+/// Extended block headers used for variable sized animation records
+/// which need an explicit length.
+///
+
+typedef struct _EFI_HII_AIBT_EXT1_BLOCK  {
+  ///
+  /// Standard animation header, where Header.BlockType = EFI_HII_AIBT_EXT1.
+  ///
+  EFI_HII_ANIMATION_BLOCK  Header;
+  ///
+  /// The block type.
+  ///
+  UINT8                    BlockType2;
+  ///
+  /// Size of the animation block, in bytes, including the animation block header.
+  ///
+  UINT8                    Length;
+} EFI_HII_AIBT_EXT1_BLOCK;
+
+typedef struct _EFI_HII_AIBT_EXT2_BLOCK {
+  ///
+  /// Standard animation header, where Header.BlockType = EFI_HII_AIBT_EXT2.
+  ///
+  EFI_HII_ANIMATION_BLOCK  Header;
+  ///
+  /// The block type
+  ///
+  UINT8                    BlockType2;
+  ///
+  /// Size of the animation block, in bytes, including the animation block header.
+  ///
+  UINT16                   Length;
+} EFI_HII_AIBT_EXT2_BLOCK;
+
+typedef struct _EFI_HII_AIBT_EXT4_BLOCK {
+  ///
+  /// Standard animation header, where Header.BlockType = EFI_HII_AIBT_EXT4.
+  ///
+  EFI_HII_ANIMATION_BLOCK  Header;
+  ///
+  /// The block type
+  ///
+  UINT8                    BlockType2;
+  ///
+  /// Size of the animation block, in bytes, including the animation block header.
+  ///
+  UINT32                   Length;
+} EFI_HII_AIBT_EXT4_BLOCK;
+
+typedef struct _EFI_HII_ANIMATION_CELL {
+  ///
+  /// The X offset from the upper left hand corner of the logical
+  /// window to position the indexed image.
+  ///
+  UINT16                    OffsetX;
+  ///
+  /// The Y offset from the upper left hand corner of the logical
+  /// window to position the indexed image.
+  ///
+  UINT16                    OffsetY;
+  ///
+  /// The image to display at the specified offset from the upper left
+  /// hand corner of the logical window.
+  ///
+  EFI_IMAGE_ID              ImageId;
+  ///
+  /// The number of milliseconds to delay after displaying the indexed
+  /// image and before continuing on to the next linked image.  If value
+  /// is zero, no delay.
+  ///
+  UINT16                    Delay;
+} EFI_HII_ANIMATION_CELL;
+
+///
+/// An animation block to describe an animation sequence that does not cycle, and
+/// where one image is simply displayed over the previous image.
+///
+typedef struct _EFI_HII_AIBT_OVERLAY_IMAGES_BLOCK {
+  ///
+  /// This is image that is to be reference by the image protocols, if the
+  /// animation function is not supported or disabled. This image can
+  /// be one particular image from the animation sequence (if any one
+  /// of the animation frames has a complete image) or an alternate
+  /// image that can be displayed alone. If the value is zero, no image
+  /// is displayed.
+  ///
+  EFI_IMAGE_ID            DftImageId;
+  ///
+  /// The overall width of the set of images (logical window width).
+  ///
+  UINT16                  Width;
+  ///
+  /// The overall height of the set of images (logical window height).
+  ///
+  UINT16                  Height;
+  ///
+  /// The number of EFI_HII_ANIMATION_CELL contained in the
+  /// animation sequence.
+  ///
+  UINT16                  CellCount;
+  ///
+  /// An array of CellCount animation cells.
+  ///
+  EFI_HII_ANIMATION_CELL  AnimationCell[1];
+} EFI_HII_AIBT_OVERLAY_IMAGES_BLOCK;
+
+///
+/// An animation block to describe an animation sequence that does not cycle,
+/// and where the logical window is cleared to the specified color before
+/// the next image is displayed.
+///
+typedef struct _EFI_HII_AIBT_CLEAR_IMAGES_BLOCK {
+  ///
+  /// This is image that is to be reference by the image protocols, if the
+  /// animation function is not supported or disabled. This image can
+  /// be one particular image from the animation sequence (if any one
+  /// of the animation frames has a complete image) or an alternate
+  /// image that can be displayed alone. If the value is zero, no image
+  /// is displayed.
+  ///
+  EFI_IMAGE_ID       DftImageId;
+  ///
+  /// The overall width of the set of images (logical window width).
+  ///
+  UINT16             Width;
+  ///
+  /// The overall height of the set of images (logical window height).
+  ///
+  UINT16             Height;
+  ///
+  /// The number of EFI_HII_ANIMATION_CELL contained in the
+  /// animation sequence.
+  ///
+  UINT16             CellCount;
+  ///
+  /// The color to clear the logical window to before displaying the
+  /// indexed image.
+  ///
+  EFI_HII_RGB_PIXEL  BackgndColor;
+  ///
+  /// An array of CellCount animation cells.
+  ///
+  EFI_HII_ANIMATION_CELL AnimationCell[1];
+} EFI_HII_AIBT_CLEAR_IMAGES_BLOCK;
+
+///
+/// An animation block to describe an animation sequence that does not cycle,
+/// and where the screen is restored to the original state before the next
+/// image is displayed.
+///
+typedef struct _EFI_HII_AIBT_RESTORE_SCRN_BLOCK {
+  ///
+  /// This is image that is to be reference by the image protocols, if the
+  /// animation function is not supported or disabled. This image can
+  /// be one particular image from the animation sequence (if any one
+  /// of the animation frames has a complete image) or an alternate
+  /// image that can be displayed alone. If the value is zero, no image
+  /// is displayed.
+  ///
+  EFI_IMAGE_ID            DftImageId;
+  ///
+  /// The overall width of the set of images (logical window width).
+  ///
+  UINT16                  Width;
+  ///
+  /// The overall height of the set of images (logical window height).
+  ///
+  UINT16                  Height;
+  ///
+  /// The number of EFI_HII_ANIMATION_CELL contained in the
+  /// animation sequence.
+  ///
+  UINT16                  CellCount;
+  ///
+  /// An array of CellCount animation cells.
+  ///
+  EFI_HII_ANIMATION_CELL  AnimationCell[1];
+} EFI_HII_AIBT_RESTORE_SCRN_BLOCK;
+
+///
+/// An animation block to describe an animation sequence that continuously cycles,
+/// and where one image is simply displayed over the previous image.
+///
+typedef EFI_HII_AIBT_OVERLAY_IMAGES_BLOCK  EFI_HII_AIBT_OVERLAY_IMAGES_LOOP_BLOCK;
+
+///
+/// An animation block to describe an animation sequence that continuously cycles,
+/// and where the logical window is cleared to the specified color before
+/// the next image is displayed.
+///
+typedef EFI_HII_AIBT_CLEAR_IMAGES_BLOCK    EFI_HII_AIBT_CLEAR_IMAGES_LOOP_BLOCK;
+
+///
+/// An animation block to describe an animation sequence that continuously cycles,
+/// and where the screen is restored to the original state before
+/// the next image is displayed.
+///
+typedef EFI_HII_AIBT_RESTORE_SCRN_BLOCK    EFI_HII_AIBT_RESTORE_SCRN_LOOP_BLOCK;
+
+///
+/// Assigns a new character value to a previously defined animation sequence.
+///
+typedef struct _EFI_HII_AIBT_DUPLICATE_BLOCK {
+  ///
+  /// The previously defined animation ID with the exact same
+  /// animation information.
+  ///
+  EFI_ANIMATION_ID  AnimationId;
+} EFI_HII_AIBT_DUPLICATE_BLOCK;
+
+///
+/// Skips animation IDs.
+///
+typedef struct _EFI_HII_AIBT_SKIP1_BLOCK {
+  ///
+  /// The unsigned 8-bit value to add to AnimationIdCurrent.
+  ///
+  UINT8  SkipCount;
+} EFI_HII_AIBT_SKIP1_BLOCK;
+
+///
+/// Skips animation IDs.
+///
+typedef struct _EFI_HII_AIBT_SKIP2_BLOCK {
+  ///
+  /// The unsigned 16-bit value to add to AnimationIdCurrent.
+  ///
+  UINT16  SkipCount;
+} EFI_HII_AIBT_SKIP2_BLOCK;
+
 #pragma pack()
 
 
diff --git a/src/include/gpxe/efi/Uefi/UefiMultiPhase.h b/src/include/gpxe/efi/Uefi/UefiMultiPhase.h
index 2d1af5e..e0bbfdd 100644
--- a/src/include/gpxe/efi/Uefi/UefiMultiPhase.h
+++ b/src/include/gpxe/efi/Uefi/UefiMultiPhase.h
@@ -1,52 +1,119 @@
 /** @file
   This includes some definitions introduced in UEFI that will be used in both PEI and DXE phases.
 
-  Copyright (c) 2006 - 2008, Intel Corporation
-  All rights reserved. This program and the accompanying materials
-  are licensed and made available under the terms and conditions of the BSD License
-  which accompanies this distribution.  The full text of the license may be found at
-  http://opensource.org/licenses/bsd-license.php
+Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
+This program and the accompanying materials are licensed and made available under
+the terms and conditions of the BSD License that accompanies this distribution.
+The full text of the license may be found at
+http://opensource.org/licenses/bsd-license.php.
 
-  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 
 **/
 
 #ifndef __UEFI_MULTIPHASE_H__
 #define __UEFI_MULTIPHASE_H__
 
-#include <gpxe/efi/ProcessorBind.h>
-
+#include <gpxe/efi/Guid/WinCertificate.h>
 ///
 /// Enumeration of memory types introduced in UEFI.
 ///
 typedef enum {
+  ///
+  /// Not used.
+  ///
   EfiReservedMemoryType,
+  ///
+  /// The code portions of a loaded application.
+  /// (Note that UEFI OS loaders are UEFI applications.)
+  ///
   EfiLoaderCode,
+  ///
+  /// The data portions of a loaded application and the default data allocation
+  /// type used by an application to allocate pool memory.
+  ///
   EfiLoaderData,
+  ///
+  /// The code portions of a loaded Boot Services Driver.
+  ///
   EfiBootServicesCode,
+  ///
+  /// The data portions of a loaded Boot Serves Driver, and the default data
+  /// allocation type used by a Boot Services Driver to allocate pool memory.
+  ///
   EfiBootServicesData,
+  ///
+  /// The code portions of a loaded Runtime Services Driver.
+  ///
   EfiRuntimeServicesCode,
+  ///
+  /// The data portions of a loaded Runtime Services Driver and the default
+  /// data allocation type used by a Runtime Services Driver to allocate pool memory.
+  ///
   EfiRuntimeServicesData,
+  ///
+  /// Free (unallocated) memory.
+  ///
   EfiConventionalMemory,
+  ///
+  /// Memory in which errors have been detected.
+  ///
   EfiUnusableMemory,
+  ///
+  /// Memory that holds the ACPI tables.
+  ///
   EfiACPIReclaimMemory,
+  ///
+  /// Address space reserved for use by the firmware.
+  ///
   EfiACPIMemoryNVS,
+  ///
+  /// Used by system firmware to request that a memory-mapped IO region
+  /// be mapped by the OS to a virtual address so it can be accessed by EFI runtime services.
+  ///
   EfiMemoryMappedIO,
+  ///
+  /// System memory-mapped IO region that is used to translate memory
+  /// cycles to IO cycles by the processor.
+  ///
   EfiMemoryMappedIOPortSpace,
+  ///
+  /// Address space reserved by the firmware for code that is part of the processor.
+  ///
   EfiPalCode,
   EfiMaxMemoryType
 } EFI_MEMORY_TYPE;
 
-
 ///
 /// Data structure that precedes all of the standard EFI table types.
 ///
 typedef struct {
+  ///
+  /// A 64-bit signature that identifies the type of table that follows.
+  /// Unique signatures have been generated for the EFI System Table,
+  /// the EFI Boot Services Table, and the EFI Runtime Services Table.
+  ///
   UINT64  Signature;
+  ///
+  /// The revision of the EFI Specification to which this table
+  /// conforms. The upper 16 bits of this field contain the major
+  /// revision value, and the lower 16 bits contain the minor revision
+  /// value. The minor revision values are limited to the range of 00..99.
+  ///
   UINT32  Revision;
+  ///
+  /// The size, in bytes, of the entire table including the EFI_TABLE_HEADER.
+  ///
   UINT32  HeaderSize;
+  ///
+  /// The 32-bit CRC for the entire table. This value is computed by
+  /// setting this field to 0, and computing the 32-bit CRC for HeaderSize bytes.
+  ///
   UINT32  CRC32;
+  ///
+  /// Reserved field that must be set to 0.
+  ///
   UINT32  Reserved;
 } EFI_TABLE_HEADER;
 
@@ -64,114 +131,6 @@ typedef struct {
 ///
 #define EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS   0x00000010
 
-//
-// _WIN_CERTIFICATE.wCertificateType
-//
-#define WIN_CERT_TYPE_EFI_PKCS115   0x0EF0
-#define WIN_CERT_TYPE_EFI_GUID      0x0EF1
-
-///
-/// The WIN_CERTIFICATE structure is part of the PE/COFF specification.
-///
-typedef struct _WIN_CERTIFICATE {
-  ///
-  /// The length of the entire certificate,
-  /// including the length of the header, in bytes.
-  ///
-  UINT32  dwLength;
-  ///
-  /// The revision level of the WIN_CERTIFICATE
-  /// structure. The current revision level is 0x0200.
-  ///
-  UINT16  wRevision;
-  ///
-  /// The certificate type. See WIN_CERT_TYPE_xxx for the UEFI
-  /// certificate types. The UEFI specification reserves the range of
-  /// certificate type values from 0x0EF0 to 0x0EFF.
-  ///
-  UINT16  wCertificateType;
-  ///
-  /// The following is the actual certificate. The format of
-  /// the certificate depends on wCertificateType.
-  ///
-  /// UINT8 bCertificate[ANYSIZE_ARRAY];
-  ///
-} WIN_CERTIFICATE;
-
-///
-/// WIN_CERTIFICATE_UEFI_GUID.CertType
-///
-#define EFI_CERT_TYPE_RSA2048_SHA256_GUID \
-  {0xa7717414, 0xc616, 0x4977, {0x94, 0x20, 0x84, 0x47, 0x12, 0xa7, 0x35, 0xbf } }
-
-//
-// WIN_CERTIFICATE_UEFI_GUID.CertData
-//
-typedef struct _EFI_CERT_BLOCK_RSA_2048_SHA256 {
-  UINT32  HashType;
-  UINT8   PublicKey[256];
-  UINT8   Signature[256];
-} EFI_CERT_BLOCK_RSA_2048_SHA256;
-
-
-///
-/// Certificate which encapsulates a GUID-specific digital signature
-///
-typedef struct _WIN_CERTIFICATE_UEFI_GUID {
-  ///
-  /// This is the standard WIN_CERTIFICATE header, where
-  /// wCertificateType is set to WIN_CERT_TYPE_UEFI_GUID.
-  ///
-  WIN_CERTIFICATE   Hdr;
-  ///
-  /// This is the unique id which determines the
-  /// format of the CertData. In this case, the
-  /// value is EFI_CERT_TYPE_RSA2048_SHA256_GUID.
-  ///
-  EFI_GUID          CertType;
-  ///
-  /// The following is the certificate data. The format of
-  /// the data is determined by the CertType. In this case the value is
-  /// EFI_CERT_BLOCK_RSA_2048_SHA256.
-  ///
-  /// UINT8            CertData[ANYSIZE_ARRAY];
-  ///
-} WIN_CERTIFICATE_UEFI_GUID;
-
-
-///
-/// Certificate which encapsulates the RSASSA_PKCS1-v1_5 digital signature.
-///
-/// The WIN_CERTIFICATE_UEFI_PKCS1_15 structure is derived from
-/// WIN_CERTIFICATE and encapsulate the information needed to
-/// implement the RSASSA-PKCS1-v1_5 digital signature algorithm as
-/// specified in RFC2437.
-///
-typedef struct _WIN_CERTIFICATE_EFI_PKCS1_15 {
-  ///
-  /// This is the standard WIN_CERTIFICATE header, where
-  /// wCertificateType is set to WIN_CERT_TYPE_UEFI_PKCS1_15.
-  ///
-  WIN_CERTIFICATE Hdr;
-  ///
-  /// This is the hashing algorithm which was performed on the
-  /// UEFI executable when creating the digital signature.
-  ///
-  EFI_GUID        HashAlgorithm;
-  ///
-  /// The following is the actual digital signature. The
-  /// size of the signature is the same size as the key
-  /// (1024-bit key is 128 bytes) and can be determined by
-  /// subtracting the length of the other parts of this header
-  /// from the total length of the certificate as found in
-  /// Hdr.dwLength.
-  ///
-  /// UINT8 Signature[ANYSIZE_ARRAY];
-  ///
-} WIN_CERTIFICATE_EFI_PKCS1_15;
-
-
-
 ///
 /// AuthInfo is a WIN_CERTIFICATE using the wCertificateType
 /// WIN_CERTIFICATE_UEFI_GUID and the CertType
@@ -185,7 +144,7 @@ typedef struct _WIN_CERTIFICATE_EFI_PKCS1_15 {
 /// key associated w/ the public/private 2048-bit RSA key-pair. The
 /// WIN_CERTIFICATE shall be used to describe the signature of the
 /// Variable data *Data. In addition, the signature will also
-/// include the MonotonicCount value to guard against replay attacks
+/// include the MonotonicCount value to guard against replay attacks.
 ///
 typedef struct {
   ///
diff --git a/src/include/gpxe/efi/Uefi/UefiPxe.h b/src/include/gpxe/efi/Uefi/UefiPxe.h
index bb8ab41..582d0f8 100644
--- a/src/include/gpxe/efi/Uefi/UefiPxe.h
+++ b/src/include/gpxe/efi/Uefi/UefiPxe.h
@@ -3,18 +3,18 @@
   structure prototypes, global variables and constants that
   are needed for porting PXE to EFI.
 
-  Copyright (c) 2006 - 2008, Intel Corporation
-  All rights reserved. This program and the accompanying materials
-  are licensed and made available under the terms and conditions of the BSD License
-  which accompanies this distribution.  The full text of the license may be found at
-  http://opensource.org/licenses/bsd-license.php
+Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
+This program and the accompanying materials are licensed and made available under
+the terms and conditions of the BSD License that accompanies this distribution.
+The full text of the license may be found at
+http://opensource.org/licenses/bsd-license.php.
 
-  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 
   @par Revision Reference:
   32/64-bit PXE specification:
-  alpha-4, 99-Dec-17
+  alpha-4, 99-Dec-17.
 
 **/
 
@@ -30,12 +30,12 @@
     )
 
 ///
-/// UNDI ROM ID and devive ID signature
+/// UNDI ROM ID and devive ID signature.
 ///
 #define PXE_BUSTYPE_PXE PXE_BUSTYPE ('!', 'P', 'X', 'E')
 
 ///
-/// BUS ROM ID signatures
+/// BUS ROM ID signatures.
 ///
 #define PXE_BUSTYPE_PCI     PXE_BUSTYPE ('P', 'C', 'I', 'R')
 #define PXE_BUSTYPE_PC_CARD PXE_BUSTYPE ('P', 'C', 'C', 'R')
@@ -76,7 +76,7 @@ typedef UINT32         PXE_UINT32;
 typedef UINTN          PXE_UINTN;
 
 ///
-/// typedef unsigned long PXE_UINT64;
+/// Typedef unsigned long PXE_UINT64.
 ///
 typedef UINT64      PXE_UINT64;
 
@@ -226,12 +226,12 @@ typedef PXE_UINT16  PXE_OPFLAGS;
 #define PXE_OPFLAGS_RESET_DISABLE_FILTERS     0x0002
 
 ///
-/// UNDI Shutdown
+/// UNDI Shutdown.
 ///
-/// No OpFlags
+/// No OpFlags.
 
 ///
-/// UNDI Interrupt Enables
+/// UNDI Interrupt Enables.
 ///
 ///
 /// Select whether to enable or disable external interrupt signals.
@@ -267,7 +267,7 @@ typedef PXE_UINT16  PXE_OPFLAGS;
 #define PXE_OPFLAGS_INTERRUPT_SOFTWARE  0x0008
 
 ///
-/// UNDI Receive Filters
+/// UNDI Receive Filters.
 ///
 ///
 /// Select whether to enable or disable receive filters.
@@ -315,20 +315,20 @@ typedef PXE_UINT16  PXE_OPFLAGS;
 #define PXE_OPFLAGS_RECEIVE_FILTER_ALL_MULTICAST  0x0010
 
 ///
-/// UNDI Station Address
+/// UNDI Station Address.
 ///
 #define PXE_OPFLAGS_STATION_ADDRESS_READ   0x0000
 #define PXE_OPFLAGS_STATION_ADDRESS_WRITE  0x0000
 #define PXE_OPFLAGS_STATION_ADDRESS_RESET  0x0001
 
 ///
-/// UNDI Statistics
+/// UNDI Statistics.
 ///
 #define PXE_OPFLAGS_STATISTICS_READ   0x0000
 #define PXE_OPFLAGS_STATISTICS_RESET  0x0001
 
 ///
-/// UNDI MCast IP to MAC
+/// UNDI MCast IP to MAC.
 ///
 ///
 /// Identify the type of IP address in the CPB.
@@ -338,7 +338,7 @@ typedef PXE_UINT16  PXE_OPFLAGS;
 #define PXE_OPFLAGS_MCAST_IPV6_TO_MAC       0x0001
 
 ///
-/// UNDI NvData
+/// UNDI NvData.
 ///
 ///
 /// Select the type of non-volatile data operation.
@@ -348,7 +348,7 @@ typedef PXE_UINT16  PXE_OPFLAGS;
 #define PXE_OPFLAGS_NVDATA_WRITE  0x0001
 
 ///
-/// UNDI Get Status
+/// UNDI Get Status.
 ///
 ///
 /// Return current interrupt status.  This will also clear any interrupts
@@ -369,14 +369,19 @@ typedef PXE_UINT16  PXE_OPFLAGS;
 #define PXE_OPFLAGS_GET_TRANSMITTED_BUFFERS 0x0002
 
 ///
-/// UNDI Fill Header
+/// Return current media status.
+///
+#define PXE_OPFLAGS_GET_MEDIA_STATUS    0x0004
+
+///
+/// UNDI Fill Header.
 ///
 #define PXE_OPFLAGS_FILL_HEADER_OPMASK      0x0001
 #define PXE_OPFLAGS_FILL_HEADER_FRAGMENTED  0x0001
 #define PXE_OPFLAGS_FILL_HEADER_WHOLE       0x0000
 
 ///
-/// UNDI Transmit
+/// UNDI Transmit.
 ///
 ///
 /// S/W UNDI only.  Return after the packet has been transmitted.  A
@@ -392,13 +397,13 @@ typedef PXE_UINT16  PXE_OPFLAGS;
 #define PXE_OPFLAGS_TRANSMIT_WHOLE      0x0000
 
 ///
-/// UNDI Receive
+/// UNDI Receive.
 ///
-/// No OpFlags
+/// No OpFlags.
 ///
 
 ///
-/// PXE STATFLAGS
+/// PXE STATFLAGS.
 ///
 typedef PXE_UINT16  PXE_STATFLAGS;
 
@@ -418,7 +423,7 @@ typedef PXE_UINT16  PXE_STATFLAGS;
 #define PXE_STATFLAGS_COMMAND_QUEUED    0x4000
 
 ///
-/// UNDI Get State
+/// UNDI Get State.
 ///
 #define PXE_STATFLAGS_GET_STATE_MASK        0x0003
 #define PXE_STATFLAGS_GET_STATE_INITIALIZED 0x0002
@@ -426,35 +431,39 @@ typedef PXE_UINT16  PXE_STATFLAGS;
 #define PXE_STATFLAGS_GET_STATE_STOPPED     0x0000
 
 ///
-/// UNDI Start
+/// UNDI Start.
 ///
-/// No additional StatFlags
+/// No additional StatFlags.
 ///
 
 ///
-/// UNDI Get Init Info
+/// UNDI Get Init Info.
 ///
 #define PXE_STATFLAGS_CABLE_DETECT_MASK           0x0001
 #define PXE_STATFLAGS_CABLE_DETECT_NOT_SUPPORTED  0x0000
 #define PXE_STATFLAGS_CABLE_DETECT_SUPPORTED      0x0001
 
+#define PXE_STATFLAGS_GET_STATUS_NO_MEDIA_MASK           0x0002
+#define PXE_STATFLAGS_GET_STATUS_NO_MEDIA_NOT_SUPPORTED  0x0000
+#define PXE_STATFLAGS_GET_STATUS_NO_MEDIA_SUPPORTED      0x0002
+
 ///
-/// UNDI Initialize
+/// UNDI Initialize.
 ///
 #define PXE_STATFLAGS_INITIALIZED_NO_MEDIA  0x0001
 
 ///
-/// UNDI Reset
+/// UNDI Reset.
 ///
 #define PXE_STATFLAGS_RESET_NO_MEDIA  0x0001
 
 ///
-/// UNDI Shutdown
+/// UNDI Shutdown.
 ///
-/// No additional StatFlags
+/// No additional StatFlags.
 
 ///
-/// UNDI Interrupt Enables
+/// UNDI Interrupt Enables.
 ///
 ///
 /// If set, receive interrupts are enabled.
@@ -472,7 +481,7 @@ typedef PXE_UINT16  PXE_STATFLAGS;
 #define PXE_STATFLAGS_INTERRUPT_COMMAND 0x0004
 
 ///
-/// UNDI Receive Filters
+/// UNDI Receive Filters.
 ///
 
 ///
@@ -502,30 +511,30 @@ typedef PXE_UINT16  PXE_STATFLAGS;
 #define PXE_STATFLAGS_RECEIVE_FILTER_ALL_MULTICAST  0x0010
 
 ///
-/// UNDI Station Address
+/// UNDI Station Address.
 ///
-/// No additional StatFlags
+/// No additional StatFlags.
 ///
 
 ///
-/// UNDI Statistics
+/// UNDI Statistics.
 ///
-/// No additional StatFlags
+/// No additional StatFlags.
 ///
 
 ///
-//// UNDI MCast IP to MAC
+//// UNDI MCast IP to MAC.
 ////
-//// No additional StatFlags
+//// No additional StatFlags.
 
 ///
-/// UNDI NvData
+/// UNDI NvData.
 ///
-/// No additional StatFlags
+/// No additional StatFlags.
 ///
 
 ///
-/// UNDI Get Status
+/// UNDI Get Status.
 ///
 
 ///
@@ -567,19 +576,24 @@ typedef PXE_UINT16  PXE_STATFLAGS;
 #define PXE_STATFLAGS_GET_STATUS_NO_TXBUFS_WRITTEN  0x0020
 
 ///
-/// UNDI Fill Header
+/// This flag is set if there is no media detected.
+///
+#define PXE_STATFLAGS_GET_STATUS_NO_MEDIA  0x0040
+
 ///
-/// No additional StatFlags
+/// UNDI Fill Header.
+///
+/// No additional StatFlags.
 ///
 
 ///
-/// UNDI Transmit
+/// UNDI Transmit.
 ///
 /// No additional StatFlags.
 
 ///
 /// UNDI Receive
-///
+///.
 
 ///
 /// No additional StatFlags.
@@ -701,28 +715,28 @@ typedef UINT16      PXE_MEDIA_PROTOCOL;
 #define PXE_IFTYPE_FIBRE_CHANNEL  0x12
 
 typedef struct s_pxe_hw_undi {
-  PXE_UINT32  Signature;      ///< PXE_ROMID_SIGNATURE
-  PXE_UINT8   Len;            ///< sizeof(PXE_HW_UNDI)
-  PXE_UINT8   Fudge;          ///< makes 8-bit cksum equal zero
-  PXE_UINT8   Rev;            ///< PXE_ROMID_REV
-  PXE_UINT8   IFcnt;          ///< physical connector count
-  PXE_UINT8   MajorVer;       ///< PXE_ROMID_MAJORVER
-  PXE_UINT8   MinorVer;       ///< PXE_ROMID_MINORVER
-  PXE_UINT16  reserved;       ///< zero, not used
-  PXE_UINT32  Implementation; ///< implementation flags
-  ///< reserved             ///< vendor use
-  ///< UINT32 Status;       ///< status port
-  ///< UINT32 Command;      ///< command port
-  ///< UINT64 CDBaddr;      ///< CDB address port
+  PXE_UINT32  Signature;      ///< PXE_ROMID_SIGNATURE.
+  PXE_UINT8   Len;            ///< sizeof(PXE_HW_UNDI).
+  PXE_UINT8   Fudge;          ///< makes 8-bit cksum equal zero.
+  PXE_UINT8   Rev;            ///< PXE_ROMID_REV.
+  PXE_UINT8   IFcnt;          ///< physical connector count.
+  PXE_UINT8   MajorVer;       ///< PXE_ROMID_MAJORVER.
+  PXE_UINT8   MinorVer;       ///< PXE_ROMID_MINORVER.
+  PXE_UINT16  reserved;       ///< zero, not used.
+  PXE_UINT32  Implementation; ///< implementation flags.
+  ///< reserved             ///< vendor use.
+  ///< UINT32 Status;       ///< status port.
+  ///< UINT32 Command;      ///< command port.
+  ///< UINT64 CDBaddr;      ///< CDB address port.
   ///<
 } PXE_HW_UNDI;
 
 ///
-/// Status port bit definitions
+/// Status port bit definitions.
 ///
 
 ///
-/// UNDI operation state
+/// UNDI operation state.
 ///
 #define PXE_HWSTAT_STATE_MASK   0xC0000000
 #define PXE_HWSTAT_BUSY         0xC0000000
@@ -731,12 +745,12 @@ typedef struct s_pxe_hw_undi {
 #define PXE_HWSTAT_STOPPED      0x00000000
 
 ///
-/// If set, last command failed
+/// If set, last command failed.
 ///
 #define PXE_HWSTAT_COMMAND_FAILED 0x20000000
 
 ///
-/// If set, identifies enabled receive filters
+/// If set, identifies enabled receive filters.
 ///
 #define PXE_HWSTAT_PROMISCUOUS_MULTICAST_RX_ENABLED 0x00001000
 #define PXE_HWSTAT_PROMISCUOUS_RX_ENABLED           0x00000800
@@ -745,7 +759,7 @@ typedef struct s_pxe_hw_undi {
 #define PXE_HWSTAT_UNICAST_RX_ENABLED               0x00000100
 
 ///
-/// If set, identifies enabled external interrupts
+/// If set, identifies enabled external interrupts.
 ///
 #define PXE_HWSTAT_SOFTWARE_INT_ENABLED     0x00000080
 #define PXE_HWSTAT_TX_COMPLETE_INT_ENABLED  0x00000040
@@ -753,7 +767,7 @@ typedef struct s_pxe_hw_undi {
 #define PXE_HWSTAT_CMD_COMPLETE_INT_ENABLED 0x00000010
 
 ///
-/// If set, identifies pending interrupts
+/// If set, identifies pending interrupts.
 ///
 #define PXE_HWSTAT_SOFTWARE_INT_PENDING     0x00000008
 #define PXE_HWSTAT_TX_COMPLETE_INT_PENDING  0x00000004
@@ -761,7 +775,7 @@ typedef struct s_pxe_hw_undi {
 #define PXE_HWSTAT_CMD_COMPLETE_INT_PENDING 0x00000001
 
 ///
-/// Command port definitions
+/// Command port definitions.
 ///
 
 ///
@@ -781,7 +795,7 @@ typedef struct s_pxe_hw_undi {
 #define PXE_HWCMD_UNICAST_RX_ENABLE               0x00000100
 
 ///
-/// Use these to enable/disable external interrupts
+/// Use these to enable/disable external interrupts.
 ///
 #define PXE_HWCMD_SOFTWARE_INT_ENABLE     0x00000080
 #define PXE_HWCMD_TX_COMPLETE_INT_ENABLE  0x00000040
@@ -789,7 +803,7 @@ typedef struct s_pxe_hw_undi {
 #define PXE_HWCMD_CMD_COMPLETE_INT_ENABLE 0x00000010
 
 ///
-/// Use these to clear pending external interrupts
+/// Use these to clear pending external interrupts.
 ///
 #define PXE_HWCMD_CLEAR_SOFTWARE_INT      0x00000008
 #define PXE_HWCMD_CLEAR_TX_COMPLETE_INT   0x00000004
@@ -797,19 +811,19 @@ typedef struct s_pxe_hw_undi {
 #define PXE_HWCMD_CLEAR_CMD_COMPLETE_INT  0x00000001
 
 typedef struct s_pxe_sw_undi {
-  PXE_UINT32  Signature;      ///< PXE_ROMID_SIGNATURE
-  PXE_UINT8   Len;            ///< sizeof(PXE_SW_UNDI)
-  PXE_UINT8   Fudge;          ///< makes 8-bit cksum zero
-  PXE_UINT8   Rev;            ///< PXE_ROMID_REV
-  PXE_UINT8   IFcnt;          ///< physical connector count
-  PXE_UINT8   MajorVer;       ///< PXE_ROMID_MAJORVER
-  PXE_UINT8   MinorVer;       ///< PXE_ROMID_MINORVER
-  PXE_UINT16  reserved1;      ///< zero, not used
-  PXE_UINT32  Implementation; ///< Implementation flags
-  PXE_UINT64  EntryPoint;     ///< API entry point
-  PXE_UINT8   reserved2[3];   ///< zero, not used
-  PXE_UINT8   BusCnt;         ///< number of bustypes supported
-  PXE_UINT32  BusType[1];     ///< list of supported bustypes
+  PXE_UINT32  Signature;      ///< PXE_ROMID_SIGNATURE.
+  PXE_UINT8   Len;            ///< sizeof(PXE_SW_UNDI).
+  PXE_UINT8   Fudge;          ///< makes 8-bit cksum zero.
+  PXE_UINT8   Rev;            ///< PXE_ROMID_REV.
+  PXE_UINT8   IFcnt;          ///< physical connector count.
+  PXE_UINT8   MajorVer;       ///< PXE_ROMID_MAJORVER.
+  PXE_UINT8   MinorVer;       ///< PXE_ROMID_MINORVER.
+  PXE_UINT16  reserved1;      ///< zero, not used.
+  PXE_UINT32  Implementation; ///< Implementation flags.
+  PXE_UINT64  EntryPoint;     ///< API entry point.
+  PXE_UINT8   reserved2[3];   ///< zero, not used.
+  PXE_UINT8   BusCnt;         ///< number of bustypes supported.
+  PXE_UINT32  BusType[1];     ///< list of supported bustypes.
 } PXE_SW_UNDI;
 
 typedef union u_pxe_undi {
@@ -818,13 +832,13 @@ typedef union u_pxe_undi {
 } PXE_UNDI;
 
 ///
-/// Signature of !PXE structure
+/// Signature of !PXE structure.
 ///
 #define PXE_ROMID_SIGNATURE PXE_BUSTYPE ('!', 'P', 'X', 'E')
 
 ///
 /// !PXE structure format revision
-///
+///.
 #define PXE_ROMID_REV 0x02
 
 ///
@@ -836,7 +850,7 @@ typedef union u_pxe_undi {
 #define PXE_ROMID_MINORVER    0x01
 
 ///
-/// Implementation flags
+/// Implementation flags.
 ///
 #define PXE_ROMID_IMP_HW_UNDI                             0x80000000
 #define PXE_ROMID_IMP_SW_VIRT_ADDR                        0x40000000
@@ -907,9 +921,9 @@ typedef union pxe_device {
 ///
 /// cpb and db definitions
 ///
-#define MAX_PCI_CONFIG_LEN    64  ///< # of dwords
-#define MAX_EEPROM_LEN        128 ///< # of dwords
-#define MAX_XMIT_BUFFERS      32  ///< recycling Q length for xmit_done
+#define MAX_PCI_CONFIG_LEN    64  ///< # of dwords.
+#define MAX_EEPROM_LEN        128 ///< # of dwords.
+#define MAX_XMIT_BUFFERS      32  ///< recycling Q length for xmit_done.
 #define MAX_MCAST_ADDRESS_CNT 8
 
 typedef struct s_pxe_cpb_start_30 {
@@ -1034,7 +1048,7 @@ typedef struct s_pxe_cpb_start_31 {
   /// used with the DMA, it converts the given virtual address to it's
   /// physical address and write that in the mapped address pointer.
   ///
-  /// This field can be set to zero if there is no mapping service available
+  /// This field can be set to zero if there is no mapping service available.
   ///
   UINT64  Map_Mem;
 
@@ -1042,10 +1056,10 @@ typedef struct s_pxe_cpb_start_31 {
   /// PXE_VOID UnMap_Mem(UINT64 unq_id, UINT64 virtual_addr, UINT32 size,
   ///            UINT32 Direction, UINT64 mapped_addr);
   ///
-  /// UNDI will pass the virtual and mapped addresses of a buffer
-  /// This call will un map the given address
+  /// UNDI will pass the virtual and mapped addresses of a buffer.
+  /// This call will un map the given address.
   ///
-  /// This field can be set to zero if there is no unmapping service available
+  /// This field can be set to zero if there is no unmapping service available.
   ///
   UINT64  UnMap_Mem;
 
@@ -1053,11 +1067,11 @@ typedef struct s_pxe_cpb_start_31 {
   /// PXE_VOID Sync_Mem(UINT64 unq_id, UINT64 virtual,
   ///            UINT32 size, UINT32 Direction, UINT64 mapped_addr);
   ///
-  /// UNDI will pass the virtual and mapped addresses of a buffer
-  /// This call will synchronize the contents of both the virtual and mapped
+  /// UNDI will pass the virtual and mapped addresses of a buffer.
+  /// This call will synchronize the contents of both the virtual and mapped.
   /// buffers for the given Direction.
   ///
-  /// This field can be set to zero if there is no service available
+  /// This field can be set to zero if there is no service available.
   ///
   UINT64  Sync_Mem;
 
@@ -1181,7 +1195,7 @@ typedef struct s_pxe_pci_config_info {
   UINT32  BusType;
 
   ///
-  /// This identifies the PCI network device that this UNDI interface
+  /// This identifies the PCI network device that this UNDI interface.
   /// is bound to.
   ///
   UINT16  Bus;
diff --git a/src/include/gpxe/efi/Uefi/UefiSpec.h b/src/include/gpxe/efi/Uefi/UefiSpec.h
index 03e7b6c..92d0c25 100644
--- a/src/include/gpxe/efi/Uefi/UefiSpec.h
+++ b/src/include/gpxe/efi/Uefi/UefiSpec.h
@@ -5,14 +5,14 @@
   If a code construct is defined in the UEFI 2.1 specification it must be included
   by this include file.
 
-  Copyright (c) 2006 - 2008, Intel Corporation
-  All rights reserved. This program and the accompanying materials
-  are licensed and made available under the terms and conditions of the BSD License
-  which accompanies this distribution.  The full text of the license may be found at
-  http://opensource.org/licenses/bsd-license.php
+Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
+This program and the accompanying materials are licensed and made available under
+the terms and conditions of the BSD License that accompanies this distribution.
+The full text of the license may be found at
+http://opensource.org/licenses/bsd-license.php.
 
-  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 
 **/
 
@@ -26,12 +26,25 @@
 #include <gpxe/efi/Protocol/SimpleTextOut.h>
 
 ///
-/// Enumeration of memory allocation.
+/// Enumeration of EFI memory allocation types.
 ///
 typedef enum {
+  ///
+  /// Allocate any available range of pages that satisfies the request.
+  ///
   AllocateAnyPages,
+  ///
+  /// Allocate any available range of pages whose uppermost address is less than
+  /// or equal to a specified maximum address.
+  ///
   AllocateMaxAddress,
+  ///
+  /// Allocate pages at a specified address.
+  ///
   AllocateAddress,
+  ///
+  /// Maximum enumeration value that may be used for bounds checking.
+  ///
   MaxAllocateType
 } EFI_ALLOCATE_TYPE;
 
@@ -42,7 +55,7 @@ typedef enum {
 #define EFI_TIME_IN_DAYLIGHT      0x02
 
 ///
-/// Value definition for EFI_TIME.TimeZone
+/// Value definition for EFI_TIME.TimeZone.
 ///
 #define EFI_UNSPECIFIED_TIMEZONE  0x07FF
 
@@ -66,38 +79,47 @@ typedef enum {
 #define EFI_MEMORY_RUNTIME  0x8000000000000000ULL
 
 ///
-/// Memory descriptor version number
+/// Memory descriptor version number.
 ///
 #define EFI_MEMORY_DESCRIPTOR_VERSION 1
 
 ///
-/// Definition of memory descriptor
+/// Definition of an EFI memory descriptor.
 ///
 typedef struct {
+  ///
+  /// Type of the memory region.  See EFI_MEMORY_TYPE.
+  ///
   UINT32                Type;
+  ///
+  /// Physical address of the first byte of the memory region.  Must aligned
+  /// on a 4 KB boundary.
+  ///
   EFI_PHYSICAL_ADDRESS  PhysicalStart;
+  ///
+  /// Virtual address of the first byte of the memory region.  Must aligned
+  /// on a 4 KB boundary.
+  ///
   EFI_VIRTUAL_ADDRESS   VirtualStart;
+  ///
+  /// Number of 4KB pages in the memory region.
+  ///
   UINT64                NumberOfPages;
+  ///
+  /// Attributes of the memory region that describe the bit mask of capabilities
+  /// for that memory region, and not necessarily the current settings for that
+  /// memory region.
+  ///
   UINT64                Attribute;
 } EFI_MEMORY_DESCRIPTOR;
 
-///
-/// Build macros to find next EFI_MEMORY_DESCRIPTOR.
-///
-#define NEXT_MEMORY_DESCRIPTOR(_Ptr, _Size)   ((EFI_MEMORY_DESCRIPTOR *) (((UINT8 *) (_Ptr)) + (_Size)))
-
-///
-/// Declare forward referenced data structures
-///
-typedef struct _EFI_SYSTEM_TABLE   EFI_SYSTEM_TABLE;
-
 /**
   Allocates memory pages from the system.
 
   @param  Type        The type of allocation to perform.
   @param  MemoryType  The type of memory to allocate.
   @param  Pages       The number of contiguous 4 KB pages to allocate.
-  @param  Memory      Pointer to a physical address. On input, the way in which the address is
+  @param  Memory      The pointer to a physical address. On input, the way in which the address is
                       used depends on the value of Type.
 
   @retval EFI_SUCCESS           The requested pages were allocated.
@@ -196,7 +218,7 @@ EFI_STATUS
 /**
   Returns pool memory to the system.
 
-  @param  Buffer                Pointer to the buffer to free.
+  @param  Buffer                The pointer to the buffer to free.
 
   @retval EFI_SUCCESS           The memory was returned to the system.
   @retval EFI_INVALID_PARAMETER Buffer was invalid.
@@ -306,7 +328,6 @@ EFI_STATUS
 // ConvertPointer DebugDisposition type.
 //
 #define EFI_OPTIONAL_PTR     0x00000001
-#define EFI_OPTIONAL_POINTER EFI_OPTIONAL_PTR
 
 /**
   Determines the new virtual address that is to be used on subsequent memory accesses.
@@ -356,7 +377,7 @@ EFI_STATUS
   Invoke a notification event
 
   @param  Event                 Event whose notification function is being invoked.
-  @param  Context               Pointer to the notification function's context,
+  @param  Context               The pointer to the notification function's context,
                                 which is implementation-dependent.
 
 **/
@@ -372,10 +393,10 @@ VOID
 
   @param  Type                  The type of event to create and its mode and attributes.
   @param  NotifyTpl             The task priority level of event notifications, if needed.
-  @param  NotifyFunction        Pointer to the event's notification function, if any.
-  @param  NotifyContext         Pointer to the notification function's context; corresponds to parameter
+  @param  NotifyFunction        The pointer to the event's notification function, if any.
+  @param  NotifyContext         The pointer to the notification function's context; corresponds to parameter
                                 Context in the notification function.
-  @param  Event                 Pointer to the newly created event if the call succeeds; undefined
+  @param  Event                 The pointer to the newly created event if the call succeeds; undefined
                                 otherwise.
 
   @retval EFI_SUCCESS           The event structure was created.
@@ -398,13 +419,13 @@ EFI_STATUS
 
   @param  Type                  The type of event to create and its mode and attributes.
   @param  NotifyTpl             The task priority level of event notifications,if needed.
-  @param  NotifyFunction        Pointer to the event's notification function, if any.
-  @param  NotifyContext         Pointer to the notification function's context; corresponds to parameter
+  @param  NotifyFunction        The pointer to the event's notification function, if any.
+  @param  NotifyContext         The pointer to the notification function's context; corresponds to parameter
                                 Context in the notification function.
-  @param  EventGroup            Pointer to the unique identifier of the group to which this event belongs.
+  @param  EventGroup            The pointer to the unique identifier of the group to which this event belongs.
                                 If this is NULL, then the function behaves as if the parameters were passed
                                 to CreateEvent.
-  @param  Event                 Pointer to the newly created event if the call succeeds; undefined
+  @param  Event                 The pointer to the newly created event if the call succeeds; undefined
                                 otherwise.
 
   @retval EFI_SUCCESS           The event structure was created.
@@ -427,8 +448,17 @@ EFI_STATUS
 /// Timer delay types
 ///
 typedef enum {
+  ///
+  /// An event's timer settings is to be cancelled and not trigger time is to be set/
+  ///
   TimerCancel,
+  ///
+  /// An event is to be signalled periodically at a specified interval from the current time.
+  ///
   TimerPeriodic,
+  ///
+  /// An event is to be signalled once at a specified interval from the current time.
+  ///
   TimerRelative
 } EFI_TIMER_DELAY;
 
@@ -475,7 +505,7 @@ EFI_STATUS
 
   @param  NumberOfEvents        The number of events in the Event array.
   @param  Event                 An array of EFI_EVENT.
-  @param  Index                 Pointer to the index of the event which satisfied the wait condition.
+  @param  Index                 The pointer to the index of the event which satisfied the wait condition.
 
   @retval EFI_SUCCESS           The event indicated by Index was signaled.
   @retval EFI_INVALID_PARAMETER 1) NumberOfEvents is 0.
@@ -561,8 +591,8 @@ VOID
 /**
   Returns the value of a variable.
 
-  @param  VariableName          A Null-terminated Unicode string that is the name of the
-                                vendor's variable.
+  @param  VariableName          A Null-terminated string that is the name of the vendor's
+                                variable.
   @param  VendorGuid            A unique identifier for the vendor.
   @param  Attributes            If not NULL, a pointer to the memory location to return the
                                 attributes bitmask for the variable.
@@ -597,7 +627,7 @@ EFI_STATUS
   @param  VariableNameSize      The size of the VariableName buffer.
   @param  VariableName          On input, supplies the last VariableName that was returned
                                 by GetNextVariableName(). On output, returns the Nullterminated
-                                Unicode string of the current variable.
+                                string of the current variable.
   @param  VendorGuid            On input, supplies the last VendorGuid that was returned by
                                 GetNextVariableName(). On output, returns the
                                 VendorGuid of the current variable.
@@ -622,23 +652,28 @@ EFI_STATUS
 /**
   Sets the value of a variable.
 
-  @param  VariableName          A Null-terminated Unicode string that is the name of the
-                                vendor's variable.
-  @param  VendorGuid            A unique identifier for the vendor.
-  @param  Attributes            Attributes bitmask to set for the variable.
-  @param  DataSize              The size in bytes of the Data buffer.
-  @param  Data                  The contents for the variable.
+  @param  VariableName           A Null-terminated string that is the name of the vendor's variable.
+                                 Each VariableName is unique for each VendorGuid. VariableName must
+                                 contain 1 or more characters. If VariableName is an empty string,
+                                 then EFI_INVALID_PARAMETER is returned.
+  @param  VendorGuid             A unique identifier for the vendor.
+  @param  Attributes             Attributes bitmask to set for the variable.
+  @param  DataSize               The size in bytes of the Data buffer. A size of zero causes the
+                                 variable to be deleted.
+  @param  Data                   The contents for the variable.
 
   @retval EFI_SUCCESS            The firmware has successfully stored the variable and its data as
                                  defined by the Attributes.
   @retval EFI_INVALID_PARAMETER  An invalid combination of attribute bits was supplied, or the
                                  DataSize exceeds the maximum allowed.
-  @retval EFI_INVALID_PARAMETER  VariableName is an empty Unicode string.
+  @retval EFI_INVALID_PARAMETER  VariableName is an empty string.
   @retval EFI_OUT_OF_RESOURCES   Not enough storage is available to hold the variable and its data.
   @retval EFI_DEVICE_ERROR       The variable could not be retrieved due to a hardware error.
   @retval EFI_WRITE_PROTECTED    The variable in question is read-only.
   @retval EFI_WRITE_PROTECTED    The variable in question cannot be deleted.
-  @retval EFI_SECURITY_VIOLATION The variable could not be retrieved due to an authentication failure.
+  @retval EFI_SECURITY_VIOLATION The variable could not be written due to EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS
+                                 set but the AuthInfo does NOT pass the validation check carried out
+                                 by the firmware.
   @retval EFI_NOT_FOUND          The variable trying to be updated or deleted was not found.
 
 **/
@@ -658,8 +693,27 @@ EFI_STATUS
 /// real time clock device as exposed through the EFI interfaces.
 ///
 typedef struct {
+  ///
+  /// Provides the reporting resolution of the real-time clock device in
+  /// counts per second. For a normal PC-AT CMOS RTC device, this
+  /// value would be 1 Hz, or 1, to indicate that the device only reports
+  /// the time to the resolution of 1 second.
+  ///
   UINT32    Resolution;
+  ///
+  /// Provides the timekeeping accuracy of the real-time clock in an
+  /// error rate of 1E-6 parts per million. For a clock with an accuracy
+  /// of 50 parts per million, the value in this field would be
+  /// 50,000,000.
+  ///
   UINT32    Accuracy;
+  ///
+  /// A TRUE indicates that a time set operation clears the device's
+  /// time below the Resolution reporting level. A FALSE
+  /// indicates that the state below the Resolution level of the
+  /// device is not cleared when the time is set. Normal PC-AT CMOS
+  /// RTC devices set this value to FALSE.
+  ///
   BOOLEAN   SetsToZero;
 } EFI_TIME_CAPABILITIES;
 
@@ -744,25 +798,6 @@ EFI_STATUS
   );
 
 /**
-  This is the declaration of an EFI image entry point. This entry point is
-  the same for UEFI Applications, UEFI OS Loaders, and UEFI Drivers including
-  both device drivers and bus drivers.
-
-  @param  ImageHandle           The firmware allocated handle for the UEFI image.
-  @param  SystemTable           A pointer to the EFI System Table.
-
-  @retval EFI_SUCCESS           The operation completed successfully.
-  @retval EFI_OUT_OF_RESOURCES  The request could not be completed due to a lack of resources.
-
-**/
-typedef
-EFI_STATUS
-(EFIAPI *EFI_IMAGE_ENTRY_POINT)(
-  IN  EFI_HANDLE                   ImageHandle,
-  IN  EFI_SYSTEM_TABLE             *SystemTable
-  );
-
-/**
   Loads an EFI image into memory.
 
   @param  BootPolicy            If TRUE, indicates that the request originates from the boot
@@ -775,7 +810,7 @@ EFI_STATUS
   @param  SourceBuffer          If not NULL, a pointer to the memory location containing a copy
                                 of the image to be loaded.
   @param  SourceSize            The size in bytes of SourceBuffer. Ignored if SourceBuffer is NULL.
-  @param  ImageHandle           Pointer to the returned image handle that is created when the
+  @param  ImageHandle           The pointer to the returned image handle that is created when the
                                 image is successfully loaded.
 
   @retval EFI_SUCCESS           Image was loaded into memory correctly.
@@ -803,12 +838,12 @@ EFI_STATUS
   Transfers control to a loaded image's entry point.
 
   @param  ImageHandle           Handle of image to be started.
-  @param  ExitDataSize          Pointer to the size, in bytes, of ExitData.
-  @param  ExitData              Pointer to a pointer to a data buffer that includes a Null-terminated
-                                Unicode string, optionally followed by additional binary data.
+  @param  ExitDataSize          The pointer to the size, in bytes, of ExitData.
+  @param  ExitData              The pointer to a pointer to a data buffer that includes a Null-terminated
+                                string, optionally followed by additional binary data.
 
   @retval EFI_INVALID_PARAMETER ImageHandle is either an invalid image handle or the image
-                                has already been initialized with StartImage
+                                has already been initialized with StartImage.
   @return Exit code from image
 
 **/
@@ -823,11 +858,16 @@ EFI_STATUS
 /**
   Terminates a loaded EFI image and returns control to boot services.
 
-  @param  ImageHandle           Handle that identifies the image.
+  @param  ImageHandle           Handle that identifies the image. This parameter is passed to the
+                                image on entry.
   @param  ExitStatus            The image's exit code.
-  @param  ExitDataSize          The size, in bytes, of ExitData.
-  @param  ExitData              Pointer to a data buffer that includes a Null-terminated Unicode string,
-                                optionally followed by additional binary data.
+  @param  ExitDataSize          The size, in bytes, of ExitData. Ignored if ExitStatus is EFI_SUCCESS.
+  @param  ExitData              The pointer to a data buffer that includes a Null-terminated string,
+                                optionally followed by additional binary data. The string is a
+                                description that the caller may use to further indicate the reason
+                                for the image's exit. ExitData is only valid if ExitStatus
+                                is something other than EFI_SUCCESS. The ExitData buffer
+                                must be allocated by calling AllocatePool().
 
   @retval EFI_SUCCESS           The image specified by ImageHandle was unloaded.
   @retval EFI_INVALID_PARAMETER The image specified by ImageHandle has been loaded and
@@ -851,8 +891,6 @@ EFI_STATUS
 
   @retval EFI_SUCCESS           The image has been unloaded.
   @retval EFI_INVALID_PARAMETER ImageHandle is not a valid image handle.
-  @retval EFI_UNSUPPORTED       The image has been started, and does not support unload.
-  @return Exit code from the image's unload handler
 
 **/
 typedef
@@ -899,13 +937,13 @@ EFI_STATUS
   @param  Timeout               The number of seconds to set the watchdog timer to.
   @param  WatchdogCode          The numeric code to log on a watchdog timer timeout event.
   @param  DataSize              The size, in bytes, of WatchdogData.
-  @param  WatchdogData          A data buffer that includes a Null-terminated Unicode string, optionally
+  @param  WatchdogData          A data buffer that includes a Null-terminated string, optionally
                                 followed by additional binary data.
 
   @retval EFI_SUCCESS           The timeout has been set.
   @retval EFI_INVALID_PARAMETER The supplied WatchdogCode is invalid.
   @retval EFI_UNSUPPORTED       The system does not have a watchdog timer.
-  @retval EFI_DEVICE_ERROR      The watch dog timer could not be programmed due to a hardware
+  @retval EFI_DEVICE_ERROR      The watchdog timer could not be programmed due to a hardware
                                 error.
 
 **/
@@ -922,10 +960,25 @@ EFI_STATUS
 /// Enumeration of reset types.
 ///
 typedef enum {
+  ///
+  /// Used to induce a system-wide reset. This sets all circuitry within the
+  /// system to its initial state.  This type of reset is asynchronous to system
+  /// operation and operates withgout regard to cycle boundaries.  EfiColdReset
+  /// is tantamount to a system power cycle.
+  ///
   EfiResetCold,
+  ///
+  /// Used to induce a system-wide initialization. The processors are set to their
+  /// initial state, and pending cycles are not corrupted.  If the system does
+  /// not support this reset type, then an EfiResetCold must be performed.
+  ///
   EfiResetWarm,
-  EfiResetShutdown,
-  EfiResetUpdate
+  ///
+  /// Used to induce an entry into a power state equivalent to the ACPI G2/S5 or G3
+  /// state.  If the system does not support this reset type, then when the system
+  /// is rebooted, it should exhibit the EfiResetCold attributes.
+  ///
+  EfiResetShutdown
 } EFI_RESET_TYPE;
 
 /**
@@ -936,7 +989,7 @@ typedef enum {
   @param  DataSize              The size, in bytes, of WatchdogData.
   @param  ResetData             For a ResetType of EfiResetCold, EfiResetWarm, or
                                 EfiResetShutdown the data buffer starts with a Null-terminated
-                                Unicode string, optionally followed by additional binary data.
+                                string, optionally followed by additional binary data.
 
 **/
 typedef
@@ -945,13 +998,13 @@ VOID
   IN EFI_RESET_TYPE           ResetType,
   IN EFI_STATUS               ResetStatus,
   IN UINTN                    DataSize,
-  IN CHAR16                   *ResetData OPTIONAL
+  IN VOID                     *ResetData OPTIONAL
   );
 
 /**
   Returns a monotonically increasing count for the platform.
 
-  @param  Count                 Pointer to returned value.
+  @param  Count                 The pointer to returned value.
 
   @retval EFI_SUCCESS           The next monotonic count was returned.
   @retval EFI_INVALID_PARAMETER Count is NULL.
@@ -967,7 +1020,7 @@ EFI_STATUS
 /**
   Returns the next high 32 bits of the platform's monotonic counter.
 
-  @param  HighCount             Pointer to returned value.
+  @param  HighCount             The pointer to returned value.
 
   @retval EFI_SUCCESS           The next high monotonic count was returned.
   @retval EFI_INVALID_PARAMETER HighCount is NULL.
@@ -1006,8 +1059,8 @@ EFI_STATUS
 /**
   Copies the contents of one buffer to another buffer.
 
-  @param  Destination           Pointer to the destination buffer of the memory copy.
-  @param  Source                Pointer to the source buffer of the memory copy.
+  @param  Destination           The pointer to the destination buffer of the memory copy.
+  @param  Source                The pointer to the source buffer of the memory copy.
   @param  Length                Number of bytes to copy from Source to Destination.
 
 **/
@@ -1022,7 +1075,7 @@ VOID
 /**
   The SetMem() function fills a buffer with a specified value.
 
-  @param  Buffer                Pointer to the buffer to fill.
+  @param  Buffer                The pointer to the buffer to fill.
   @param  Size                  Number of bytes in Buffer to fill.
   @param  Value                 Value to fill Buffer with.
 
@@ -1035,11 +1088,13 @@ VOID
   IN UINT8    Value
   );
 
-
-//
-// Protocol handler functions
-//
+///
+/// Enumeration of EFI Interface Types
+///
 typedef enum {
+  ///
+  /// Indicates that the supplied protocol interface is supplied in native form.
+  ///
   EFI_NATIVE_INTERFACE
 } EFI_INTERFACE_TYPE;
 
@@ -1262,7 +1317,9 @@ EFI_STATUS
   IN EFI_HANDLE               ControllerHandle
   );
 
-
+///
+/// EFI Oprn Protocol Information Entry
+///
 typedef struct {
   EFI_HANDLE  AgentHandle;
   EFI_HANDLE  ControllerHandle;
@@ -1346,10 +1403,22 @@ EFI_STATUS
   OUT VOID                     **Registration
   );
 
-
+///
+/// Enumeration of EFI Locate Search Types
+///
 typedef enum {
+  ///
+  /// Retrieve all the handles in the handle database.
+  ///
   AllHandles,
+  ///
+  /// Retrieve the next handle fron a RegisterProtocolNotify() event.
+  ///
   ByRegisterNotify,
+  ///
+  /// Retrieve the set of handles from the handle database that support a
+  /// specified protocol.
+  ///
   ByProtocol
 } EFI_LOCATE_SEARCH_TYPE;
 
@@ -1429,7 +1498,6 @@ EFI_STATUS
   IN VOID                     *Table
   );
 
-
 /**
   Returns an array of handles that support the requested protocol in a buffer allocated from pool.
 
@@ -1483,33 +1551,75 @@ EFI_STATUS
   OUT VOID      **Interface
   );
 
+///
+/// EFI Capsule Block Descriptor
+///
 typedef struct {
-  UINT64                            Length;
+  ///
+  /// Length in bytes of the data pointed to by DataBlock/ContinuationPointer.
+  ///
+  UINT64                  Length;
   union {
+    ///
+    /// Physical address of the data block. This member of the union is
+    /// used if Length is not equal to zero.
+    ///
     EFI_PHYSICAL_ADDRESS  DataBlock;
+    ///
+    /// Physical address of another block of
+    /// EFI_CAPSULE_BLOCK_DESCRIPTOR structures. This
+    /// member of the union is used if Length is equal to zero. If
+    /// ContinuationPointer is zero this entry represents the end of the list.
+    ///
     EFI_PHYSICAL_ADDRESS  ContinuationPointer;
   } Union;
 } EFI_CAPSULE_BLOCK_DESCRIPTOR;
 
+///
+/// EFI Capsule Header.
+///
 typedef struct {
+  ///
+  /// A GUID that defines the contents of a capsule.
+  ///
   EFI_GUID          CapsuleGuid;
+  ///
+  /// The size of the capsule header. This may be larger than the size of
+  /// the EFI_CAPSULE_HEADER since CapsuleGuid may imply
+  /// extended header entries
+  ///
   UINT32            HeaderSize;
+  ///
+  /// Bit-mapped list describing the capsule attributes. The Flag values
+  /// of 0x0000 - 0xFFFF are defined by CapsuleGuid. Flag values
+  /// of 0x10000 - 0xFFFFFFFF are defined by this specification
+  ///
   UINT32            Flags;
+  ///
+  /// Size in bytes of the capsule.
+  ///
   UINT32            CapsuleImageSize;
 } EFI_CAPSULE_HEADER;
 
-//
-// The EFI System Table entry must point to an array of capsules
-// that contain the same CapsuleGuid value. The array must be
-// prefixed by a UINT32 that represents the size of the array of capsules.
-//
+///
+/// The EFI System Table entry must point to an array of capsules
+/// that contain the same CapsuleGuid value. The array must be
+/// prefixed by a UINT32 that represents the size of the array of capsules.
+///
 typedef struct {
+  ///
+  /// the size of the array of capsules.
+  ///
   UINT32   CapsuleArrayNumber;
+  ///
+  /// Point to an array of capsules that contain the same CapsuleGuid value.
+  ///
   VOID*    CapsulePtr[1];
 } EFI_CAPSULE_TABLE;
 
 #define CAPSULE_FLAGS_PERSIST_ACROSS_RESET          0x00010000
 #define CAPSULE_FLAGS_POPULATE_SYSTEM_TABLE         0x00020000
+#define CAPSULE_FLAGS_INITIATE_RESET                0x00040000
 
 /**
   Passes capsules to the firmware with both virtual and physical mapping. Depending on the intended
@@ -1529,8 +1639,10 @@ typedef struct {
   @retval EFI_SUCCESS           Valid capsule was passed. If
                                 CAPSULE_FLAGS_PERSIT_ACROSS_RESET is not set, the
                                 capsule has been successfully processed by the firmware.
+  @retval EFI_INVALID_PARAMETER CapsuleSize is NULL, or an incompatible set of flags were
+                                set in the capsule header.
+  @retval EFI_INVALID_PARAMETER CapsuleCount is 0.
   @retval EFI_DEVICE_ERROR      The capsule update was started, but failed due to a device error.
-  @retval EFI_INVALID_PARAMETER CapsuleSize is NULL.
   @retval EFI_UNSUPPORTED       The capsule type is not supported on this platform.
   @retval EFI_OUT_OF_RESOURCES  There were insufficient resources to process the capsule.
 
@@ -1606,18 +1718,20 @@ EFI_STATUS
 //
 // EFI Runtime Services Table
 //
-#define EFI_SYSTEM_TABLE_SIGNATURE      0x5453595320494249ULL
-#define EFI_SYSTEM_TABLE_REVISION       ((2<<16) | (10))
-#define EFI_2_10_SYSTEM_TABLE_REVISION  ((2<<16) | (10))
-#define EFI_2_00_SYSTEM_TABLE_REVISION  ((2<<16) | (00))
-#define EFI_1_10_SYSTEM_TABLE_REVISION  ((1<<16) | (10))
-#define EFI_1_02_SYSTEM_TABLE_REVISION  ((1<<16) | (02))
-
-#define EFI_RUNTIME_SERVICES_SIGNATURE  0x56524553544e5552ULL
-#define EFI_RUNTIME_SERVICES_REVISION   EFI_2_10_SYSTEM_TABLE_REVISION
+#define EFI_SYSTEM_TABLE_SIGNATURE      SIGNATURE_64 ('I','B','I',' ','S','Y','S','T')
+#define EFI_2_30_SYSTEM_TABLE_REVISION  ((2 << 16) | (30))
+#define EFI_2_20_SYSTEM_TABLE_REVISION  ((2 << 16) | (20))
+#define EFI_2_10_SYSTEM_TABLE_REVISION  ((2 << 16) | (10))
+#define EFI_2_00_SYSTEM_TABLE_REVISION  ((2 << 16) | (00))
+#define EFI_1_10_SYSTEM_TABLE_REVISION  ((1 << 16) | (10))
+#define EFI_1_02_SYSTEM_TABLE_REVISION  ((1 << 16) | (02))
+#define EFI_SYSTEM_TABLE_REVISION       EFI_2_30_SYSTEM_TABLE_REVISION
+
+#define EFI_RUNTIME_SERVICES_SIGNATURE  SIGNATURE_64 ('R','U','N','T','S','E','R','V')
+#define EFI_RUNTIME_SERVICES_REVISION   EFI_2_30_SYSTEM_TABLE_REVISION
 
 ///
-/// EFI Runtime Services Table
+/// EFI Runtime Services Table.
 ///
 typedef struct {
   ///
@@ -1665,11 +1779,11 @@ typedef struct {
 } EFI_RUNTIME_SERVICES;
 
 
-#define EFI_BOOT_SERVICES_SIGNATURE   0x56524553544f4f42ULL
-#define EFI_BOOT_SERVICES_REVISION    EFI_2_10_SYSTEM_TABLE_REVISION
+#define EFI_BOOT_SERVICES_SIGNATURE   SIGNATURE_64 ('B','O','O','T','S','E','R','V')
+#define EFI_BOOT_SERVICES_REVISION    EFI_2_30_SYSTEM_TABLE_REVISION
 
 ///
-/// EFI Boot Services Table
+/// EFI Boot Services Table.
 ///
 typedef struct {
   ///
@@ -1770,7 +1884,7 @@ typedef struct {
 /// Contains a set of GUID/pointer pairs comprised of the ConfigurationTable field in the
 /// EFI System Table.
 ///
-typedef struct{
+typedef struct {
   ///
   /// The 128-bit GUID value that uniquely identifies the system configuration table.
   ///
@@ -1784,14 +1898,14 @@ typedef struct{
 ///
 /// EFI System Table
 ///
-struct _EFI_SYSTEM_TABLE {
+typedef struct {
   ///
   /// The table header for the EFI System Table.
   ///
   EFI_TABLE_HEADER                  Hdr;
   ///
-  /// A pointer to a null terminated Unicode string that identifies
-  /// the vendor that produces the system firmware for the platform.
+  /// A pointer to a null terminated string that identifies the vendor
+  /// that produces the system firmware for the platform.
   ///
   CHAR16                            *FirmwareVendor;
   ///
@@ -1800,11 +1914,12 @@ struct _EFI_SYSTEM_TABLE {
   ///
   UINT32                            FirmwareRevision;
   ///
-  /// The handle for the active console input device.
+  /// The handle for the active console input device. This handle must support
+  /// EFI_SIMPLE_TEXT_INPUT_PROTOCOL and EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL.
   ///
   EFI_HANDLE                        ConsoleInHandle;
   ///
-  /// A pointer to the SIMPLE_INPUT_PROTOCOL interface that is
+  /// A pointer to the EFI_SIMPLE_TEXT_INPUT_PROTOCOL interface that is
   /// associated with ConsoleInHandle.
   ///
   EFI_SIMPLE_TEXT_INPUT_PROTOCOL    *ConIn;
@@ -1813,16 +1928,17 @@ struct _EFI_SYSTEM_TABLE {
   ///
   EFI_HANDLE                        ConsoleOutHandle;
   ///
-  /// A pointer to the SIMPLE_TEXT_OUTPUT_PROTOCOL interface
+  /// A pointer to the EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL interface
   /// that is associated with ConsoleOutHandle.
   ///
   EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL   *ConOut;
   ///
   /// The handle for the active standard error console device.
+  /// This handle must support the EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL.
   ///
   EFI_HANDLE                        StandardErrorHandle;
   ///
-  /// A pointer to the SIMPLE_TEXT_OUTPUT_PROTOCOL interface
+  /// A pointer to the EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL interface
   /// that is associated with StandardErrorHandle.
   ///
   EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL   *StdErr;
@@ -1843,7 +1959,25 @@ struct _EFI_SYSTEM_TABLE {
   /// The number of entries in the table is NumberOfTableEntries.
   ///
   EFI_CONFIGURATION_TABLE           *ConfigurationTable;
-};
+} EFI_SYSTEM_TABLE;
+
+/**
+  This is the declaration of an EFI image entry point. This entry point is
+  the same for UEFI Applications, UEFI OS Loaders, and UEFI Drivers including
+  both device drivers and bus drivers.
+
+  @param  ImageHandle           The firmware allocated handle for the UEFI image.
+  @param  SystemTable           A pointer to the EFI System Table.
+
+  @retval EFI_SUCCESS           The operation completed successfully.
+  @retval Others                An unexpected error occurred.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_IMAGE_ENTRY_POINT)(
+  IN  EFI_HANDLE                   ImageHandle,
+  IN  EFI_SYSTEM_TABLE             *SystemTable
+  );
 
 //
 // EFI Load Options Attributes
@@ -1860,43 +1994,84 @@ struct _EFI_SYSTEM_TABLE {
 #define EFI_BOOT_OPTION_SUPPORT_APP   0x00000002
 #define EFI_BOOT_OPTION_SUPPORT_COUNT 0x00000300
 
+///
+/// EFI Boot Key Data
+///
 typedef union {
   struct {
+    ///
+    /// Indicates the revision of the EFI_KEY_OPTION structure. This revision level should be 0.
+    ///
     UINT32  Revision        : 8;
+    ///
+    /// Either the left or right Shift keys must be pressed (1) or must not be pressed (0).
+    ///
     UINT32  ShiftPressed    : 1;
+    ///
+    /// Either the left or right Control keys must be pressed (1) or must not be pressed (0).
+    ///
     UINT32  ControlPressed  : 1;
+    ///
+    /// Either the left or right Alt keys must be pressed (1) or must not be pressed (0).
+    ///
     UINT32  AltPressed      : 1;
+    ///
+    /// Either the left or right Logo keys must be pressed (1) or must not be pressed (0).
+    ///
     UINT32  LogoPressed     : 1;
+    ///
+    /// The Menu key must be pressed (1) or must not be pressed (0).
+    ///
     UINT32  MenuPressed     : 1;
-    UINT32  SysReqPessed    : 1;
+    ///
+    /// The SysReq key must be pressed (1) or must not be pressed (0).
+    ///
+    UINT32  SysReqPressed    : 1;
     UINT32  Reserved        : 16;
+    ///
+    /// Specifies the actual number of entries in EFI_KEY_OPTION.Keys, from 0-3. If
+    /// zero, then only the shift state is considered. If more than one, then the boot option will
+    /// only be launched if all of the specified keys are pressed with the same shift state.
+    ///
     UINT32  InputKeyCount   : 2;
   } Options;
   UINT32  PackedValue;
-} HOT_KEY_EFI_KEY_DATA;
+} EFI_BOOT_KEY_DATA;
 
+///
+/// EFI Key Option.
+///
 typedef struct {
-  HOT_KEY_EFI_KEY_DATA  KeyOptions;
-  UINT32                BootOptionCrc;
-  UINT16                BootOption;
-//EFI_INPUT_KEY         Keys[];
+  ///
+  /// Specifies options about how the key will be processed.
+  ///
+  EFI_BOOT_KEY_DATA  KeyData;
+  ///
+  /// The CRC-32 which should match the CRC-32 of the entire EFI_LOAD_OPTION to
+  /// which BootOption refers. If the CRC-32s do not match this value, then this key
+  /// option is ignored.
+  ///
+  UINT32             BootOptionCrc;
+  ///
+  /// The Boot#### option which will be invoked if this key is pressed and the boot option
+  /// is active (LOAD_OPTION_ACTIVE is set).
+  ///
+  UINT16             BootOption;
+  ///
+  /// The key codes to compare against those returned by the
+  /// EFI_SIMPLE_TEXT_INPUT and EFI_SIMPLE_TEXT_INPUT_EX protocols.
+  /// The number of key codes (0-3) is specified by the EFI_KEY_CODE_COUNT field in KeyOptions.
+  ///
+  //EFI_INPUT_KEY      Keys[];
 } EFI_KEY_OPTION;
 
-#define EFI_KEY_OPTION_SHIFT     0x00000001
-#define EFI_KEY_OPTION_CONTROL   0x00000002
-#define EFI_KEY_OPTION_ALT       0x00000004
-#define EFI_KEY_OPTION_LOGO      0x00000008
-#define EFI_KEY_OPTION_MENU      0x00000010
-#define EFI_KEY_OPTION_SYSREQ    0x00000020
-#define EFI_KEY_CODE_COUNT       0x00000300
-
-
 //
 // EFI File location to boot from on removable media devices
 //
 #define EFI_REMOVABLE_MEDIA_FILE_NAME_IA32    L"\\EFI\\BOOT\\BOOTIA32.EFI"
 #define EFI_REMOVABLE_MEDIA_FILE_NAME_IA64    L"\\EFI\\BOOT\\BOOTIA64.EFI"
 #define EFI_REMOVABLE_MEDIA_FILE_NAME_X64     L"\\EFI\\BOOT\\BOOTX64.EFI"
+#define EFI_REMOVABLE_MEDIA_FILE_NAME_ARM     L"\\EFI\\BOOT\\BOOTARM.EFI"
 
 #if   defined (MDE_CPU_IA32)
   #define EFI_REMOVABLE_MEDIA_FILE_NAME   EFI_REMOVABLE_MEDIA_FILE_NAME_IA32
@@ -1905,6 +2080,8 @@ typedef struct {
 #elif defined (MDE_CPU_X64)
   #define EFI_REMOVABLE_MEDIA_FILE_NAME   EFI_REMOVABLE_MEDIA_FILE_NAME_X64
 #elif defined (MDE_CPU_EBC)
+#elif defined (MDE_CPU_ARM)
+  #define EFI_REMOVABLE_MEDIA_FILE_NAME   EFI_REMOVABLE_MEDIA_FILE_NAME_ARM
 #else
   #error Unknown Processor Type
 #endif
diff --git a/src/include/gpxe/efi/X64/ProcessorBind.h b/src/include/gpxe/efi/X64/ProcessorBind.h
index fe6c413..b026859 100644
--- a/src/include/gpxe/efi/X64/ProcessorBind.h
+++ b/src/include/gpxe/efi/X64/ProcessorBind.h
@@ -1,8 +1,8 @@
 /** @file
-  Processor or Compiler specific defines and types x64 (Intel(r) EM64T, AMD64).
+  Processor or Compiler specific defines and types x64 (Intel 64, AMD64).
 
-  Copyright (c) 2006, Intel Corporation
-  All rights reserved. This program and the accompanying materials
+  Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
+  This program and the accompanying materials
   are licensed and made available under the terms and conditions of the BSD License
   which accompanies this distribution.  The full text of the license may be found at
   http://opensource.org/licenses/bsd-license.php
@@ -20,16 +20,15 @@
 ///
 #define MDE_CPU_X64
 
-
 //
-// Make sure we are useing the correct packing rules per EFI specification
+// Make sure we are using the correct packing rules per EFI specification
 //
-#ifndef __GNUC__
+#if !defined(__GNUC__)
 #pragma pack()
 #endif
 
 
-#if __INTEL_COMPILER
+#if defined(__INTEL_COMPILER)
 //
 // 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
@@ -48,10 +47,16 @@
 //
 #pragma warning ( disable : 1419 )
 
+//
+// Disable ICC's remark #593: "Variable" was set but never used.
+// This is legal ANSI C code so we disable the remark that is turned on with /W4
+//
+#pragma warning ( disable : 593 )
+
 #endif
 
 
-#if _MSC_EXTENSIONS
+#if defined(_MSC_EXTENSIONS)
 
 //
 // Disable warning that make it impossible to compile at /W4
@@ -85,123 +90,163 @@
 #pragma warning ( disable : 4505 )
 
 //
-// This warning is caused by empty (after preprocessing) souce file. For precompiled header only.
+// This warning is caused by empty (after preprocessing) source file. For precompiled header only.
 //
 #pragma warning ( disable : 4206 )
 
 #endif
 
 
-#if !defined(__GNUC__) && (__STDC_VERSION__ < 199901L)
+#if defined(_MSC_EXTENSIONS)
   //
-  // No ANSI C 2000 stdint.h integer width declarations, so define equivalents
+  // use Microsoft C complier dependent integer width types
   //
 
-  #if _MSC_EXTENSIONS
-
-
-    //
-    // use Microsoft C complier dependent interger width types
-    //
-    typedef unsigned __int64    UINT64;
-    typedef __int64             INT64;
-    typedef unsigned __int32    UINT32;
-    typedef __int32             INT32;
-    typedef unsigned short      UINT16;
-    typedef unsigned short      CHAR16;
-    typedef short               INT16;
-    typedef unsigned char       BOOLEAN;
-    typedef unsigned char       UINT8;
-    typedef char                CHAR8;
-    typedef char                INT8;
-  #else
-    #ifdef _EFI_P64
-      //
-      // P64 - is Intel Itanium(TM) speak for pointers being 64-bit and longs and ints
-      //  are 32-bits
-      //
-      typedef unsigned long long  UINT64;
-      typedef long long           INT64;
-      typedef unsigned int        UINT32;
-      typedef int                 INT32;
-      typedef unsigned short      CHAR16;
-      typedef unsigned short      UINT16;
-      typedef short               INT16;
-      typedef unsigned char       BOOLEAN;
-      typedef unsigned char       UINT8;
-      typedef char                CHAR8;
-      typedef char                INT8;
-    #else
-      //
-      // Assume LP64 - longs and pointers are 64-bit. Ints are 32-bit.
-      //
-      typedef unsigned long   UINT64;
-      typedef long            INT64;
-      typedef unsigned int    UINT32;
-      typedef int             INT32;
-      typedef unsigned short  UINT16;
-      typedef unsigned short  CHAR16;
-      typedef short           INT16;
-      typedef unsigned char   BOOLEAN;
-      typedef unsigned char   UINT8;
-      typedef char            CHAR8;
-      typedef char            INT8;
-    #endif
-  #endif
-
-  #define UINT8_MAX 0xff
-
+  ///
+  /// 8-byte unsigned value
+  ///
+  typedef unsigned __int64    UINT64;
+  ///
+  /// 8-byte signed value
+  ///
+  typedef __int64             INT64;
+  ///
+  /// 4-byte unsigned value
+  ///
+  typedef unsigned __int32    UINT32;
+  ///
+  /// 4-byte signed value
+  ///
+  typedef __int32             INT32;
+  ///
+  /// 2-byte unsigned value
+  ///
+  typedef unsigned short      UINT16;
+  ///
+  /// 2-byte Character.  Unless otherwise specified all strings are stored in the
+  /// UTF-16 encoding format as defined by Unicode 2.1 and ISO/IEC 10646 standards.
+  ///
+  typedef unsigned short      CHAR16;
+  ///
+  /// 2-byte signed value
+  ///
+  typedef short               INT16;
+  ///
+  /// Logical Boolean.  1-byte value containing 0 for FALSE or a 1 for TRUE.  Other
+  /// values are undefined.
+  ///
+  typedef unsigned char       BOOLEAN;
+  ///
+  /// 1-byte unsigned value
+  ///
+  typedef unsigned char       UINT8;
+  ///
+  /// 1-byte Character
+  ///
+  typedef char                CHAR8;
+  ///
+  /// 1-byte signed value
+  ///
+  typedef char                INT8;
 #else
-  //
-  // Use ANSI C 2000 stdint.h integer width declarations
-  //
-  #include <stdint.h>
-  typedef uint8_t   BOOLEAN;
-  typedef int8_t    INT8;
-  typedef uint8_t   UINT8;
-  typedef int16_t   INT16;
-  typedef uint16_t  UINT16;
-  typedef int32_t   INT32;
-  typedef uint32_t  UINT32;
-  typedef int64_t   INT64;
-  typedef uint64_t  UINT64;
-  typedef char      CHAR8;
-  typedef uint16_t  CHAR16;
-
+  ///
+  /// 8-byte unsigned value
+  ///
+  typedef unsigned long long  UINT64;
+  ///
+  /// 8-byte signed value
+  ///
+  typedef long long           INT64;
+  ///
+  /// 4-byte unsigned value
+  ///
+  typedef unsigned int        UINT32;
+  ///
+  /// 4-byte signed value
+  ///
+  typedef int                 INT32;
+  ///
+  /// 2-byte unsigned value
+  ///
+  typedef unsigned short      UINT16;
+  ///
+  /// 2-byte Character.  Unless otherwise specified all strings are stored in the
+  /// UTF-16 encoding format as defined by Unicode 2.1 and ISO/IEC 10646 standards.
+  ///
+  typedef unsigned short      CHAR16;
+  ///
+  /// 2-byte signed value
+  ///
+  typedef short               INT16;
+  ///
+  /// Logical Boolean.  1-byte value containing 0 for FALSE or a 1 for TRUE.  Other
+  /// values are undefined.
+  ///
+  typedef unsigned char       BOOLEAN;
+  ///
+  /// 1-byte unsigned value
+  ///
+  typedef unsigned char       UINT8;
+  ///
+  /// 1-byte Character
+  ///
+  typedef char                CHAR8;
+  ///
+  /// 1-byte signed value
+  ///
+  typedef char                INT8;
 #endif
 
+///
+/// Unsigned value of native width.  (4 bytes on supported 32-bit processor instructions,
+/// 8 bytes on supported 64-bit processor instructions)
+///
 typedef UINT64  UINTN;
+///
+/// Signed value of native width.  (4 bytes on supported 32-bit processor instructions,
+/// 8 bytes on supported 64-bit processor instructions)
+///
 typedef INT64   INTN;
 
 
 //
 // Processor specific defines
 //
+
+///
+/// A value of native width with the highest bit set.
+///
 #define MAX_BIT     0x8000000000000000ULL
+///
+/// A value of native width with the two highest bits set.
+///
 #define MAX_2_BITS  0xC000000000000000ULL
 
-//
-// Maximum legal X64 address
-//
+///
+/// Maximum legal x64 address
+///
 #define MAX_ADDRESS   0xFFFFFFFFFFFFFFFFULL
 
-//
-// The stack alignment required for X64
-//
+///
+/// The stack alignment required for x64
+///
 #define CPU_STACK_ALIGNMENT   16
 
 //
 // Modifier to ensure that all protocol member functions and EFI intrinsics
 // use the correct C calling convention. All protocol member functions and
-// EFI intrinsics are required to modify thier member functions with EFIAPI.
+// EFI intrinsics are required to modify their member functions with EFIAPI.
 //
-#if _MSC_EXTENSIONS
+#ifdef EFIAPI
   ///
-  /// Define the standard calling convention reguardless of optimization level.
-  /// __cdecl is Microsoft* specific C extension.
+  /// If EFIAPI is already defined, then we use that definition.
+  ///
+#elif defined(_MSC_EXTENSIONS)
+  ///
+  /// Microsoft* compiler specific method for EFIAPI calling convension
   ///
   #define EFIAPI __cdecl
-#elif __GNUC__
+#elif defined(__GNUC__)
   ///
   /// Define the standard calling convention reguardless of optimization level.
   /// The GCC support assumes a GCC compiler that supports the EFI ABI. The EFI
@@ -210,7 +255,7 @@ typedef INT64   INTN;
   /// x64. Warning the assembly code in the MDE x64 does not follow the correct
   /// ABI for the standard x64 (x86-64) GCC.
   ///
-  #define EFIAPI __attribute__((ms_abi))
+  #define EFIAPI
 #else
   ///
   /// The default for a non Microsoft* or GCC compiler is to assume the EFI ABI
@@ -219,29 +264,25 @@ typedef INT64   INTN;
   #define EFIAPI
 #endif
 
-//
-// The Microsoft* C compiler can removed references to unreferenced data items
-//  if the /OPT:REF linker option is used. We defined a macro as this is a
-//  a non standard extension
-//
-#if _MSC_EXTENSIONS
-  #define GLOBAL_REMOVE_IF_UNREFERENCED __declspec(selectany)
-#else
-  #define GLOBAL_REMOVE_IF_UNREFERENCED
+#if defined(__GNUC__)
+  ///
+  /// For GNU assembly code, .global or .globl can declare global symbols.
+  /// Define this macro to unify the usage.
+  ///
+  #define ASM_GLOBAL .globl
 #endif
 
-//
-// For symbol name in GNU assembly code, an extra "_" is necessary
-//
-#if __GNUC__
-  #if defined(linux)
-    #define ASM_PFX(name) name
-  #else
-    #define ASM_PFX(name) _##name
-  #endif
-#endif
+/**
+  Return the pointer to the first instruction of a function given a function pointer.
+  On x64 CPU architectures, these two pointer values are the same,
+  so the implementation of this macro is very simple.
+
+  @param  FunctionPointer   A pointer to a function.
 
-#define FUNCTION_ENTRY_POINT(p) (p)
+  @return The pointer to the first instruction of a function given a function pointer.
+
+**/
+#define FUNCTION_ENTRY_POINT(FunctionPointer) (VOID *)(UINTN)(FunctionPointer)
 
 #endif
 
diff --git a/src/include/gpxe/efi/efi.h b/src/include/gpxe/efi/efi.h
index f4459b7..c796bdd 100644
--- a/src/include/gpxe/efi/efi.h
+++ b/src/include/gpxe/efi/efi.h
@@ -36,6 +36,16 @@
 #define __GNUC__ 1
 #endif
 
+/* EFI headers think your compiler uses the MS ABI by default on X64 */
+#if __x86_64__
+#define EFIAPI __attribute__((ms_abi))
+#endif
+
+/* EFI headers assume regparm(0) on i386, but that is not the case for gPXE */
+#if __i386__
+#define EFIAPI __attribute__((cdecl,regparm(0)))
+#endif
+
 /* Include the top-level EFI header files */
 #include <gpxe/efi/Uefi.h>
 #include <gpxe/efi/PiDxe.h>
diff --git a/src/interface/efi/efi_smbios.c b/src/interface/efi/efi_smbios.c
index 8caf624..f2ecd7f 100644
--- a/src/interface/efi/efi_smbios.c
+++ b/src/interface/efi/efi_smbios.c
@@ -31,7 +31,7 @@ FILE_LICENCE ( GPL2_OR_LATER );
 
 /** SMBIOS configuration table */
 static struct smbios_entry *smbios_entry;
-EFI_USE_TABLE ( EFI_SMBIOS_TABLE, &smbios_entry, 0 );
+EFI_USE_TABLE ( SMBIOS_TABLE, &smbios_entry, 0 );
 
 /**
  * Find SMBIOS
-----------------------------------------------------------------------


-- 
Main gPXE repository


More information about the gPXE-commits mailing list