]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Initial directory structure of IntelFrameworkPkg.
authorbxing <bxing@6f19259b-4bc3-4df7-8a09-765794883524>
Fri, 15 Jun 2007 10:02:42 +0000 (10:02 +0000)
committerbxing <bxing@6f19259b-4bc3-4df7-8a09-765794883524>
Fri, 15 Jun 2007 10:02:42 +0000 (10:02 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@2657 6f19259b-4bc3-4df7-8a09-765794883524

67 files changed:
IntelFrameworkPkg/Include/Common/DataHubRecords.h [new file with mode: 0644]
IntelFrameworkPkg/Include/Common/FrameworkDxeCis.h [new file with mode: 0644]
IntelFrameworkPkg/Include/Common/FrameworkFirmwareFileSystem.h [new file with mode: 0644]
IntelFrameworkPkg/Include/Common/FrameworkHob.h [new file with mode: 0644]
IntelFrameworkPkg/Include/Common/FrameworkLegacy16.h [new file with mode: 0644]
IntelFrameworkPkg/Include/Common/FrameworkSmmCis.h [new file with mode: 0644]
IntelFrameworkPkg/Include/Common/FrameworkStatusCode.h [new file with mode: 0644]
IntelFrameworkPkg/Include/FrameworkBase.h [new file with mode: 0644]
IntelFrameworkPkg/Include/FrameworkDxe.h [new file with mode: 0644]
IntelFrameworkPkg/Include/FrameworkPei.h [new file with mode: 0644]
IntelFrameworkPkg/Include/FrameworkSmm.h [new file with mode: 0644]
IntelFrameworkPkg/Include/Guid/AcpiTableStorage.h [new file with mode: 0644]
IntelFrameworkPkg/Include/Guid/Capsule.h [new file with mode: 0644]
IntelFrameworkPkg/Include/Guid/DataHubRecords.h [new file with mode: 0644]
IntelFrameworkPkg/Include/Guid/FrameworkDevicePath.h [new file with mode: 0644]
IntelFrameworkPkg/Include/Guid/SmmCommunicate.h [new file with mode: 0644]
IntelFrameworkPkg/Include/Guid/SmramMemoryReserve.h [new file with mode: 0644]
IntelFrameworkPkg/Include/Ppi/BlockIo.h [new file with mode: 0644]
IntelFrameworkPkg/Include/Ppi/BootScriptExecuter.h [new file with mode: 0644]
IntelFrameworkPkg/Include/Ppi/RecoveryModule.h [new file with mode: 0644]
IntelFrameworkPkg/Include/Ppi/S3Resume.h [new file with mode: 0644]
IntelFrameworkPkg/Include/Ppi/Smbus.h [new file with mode: 0644]
IntelFrameworkPkg/Include/Protocol/AcpiSupport.h [new file with mode: 0644]
IntelFrameworkPkg/Include/Protocol/BootScriptSave.h [new file with mode: 0644]
IntelFrameworkPkg/Include/Protocol/CpuIo.h [new file with mode: 0644]
IntelFrameworkPkg/Include/Protocol/DataHub.h [new file with mode: 0644]
IntelFrameworkPkg/Include/Protocol/FirmwareVolume.h [new file with mode: 0644]
IntelFrameworkPkg/Include/Protocol/FirmwareVolumeBlock.h [new file with mode: 0644]
IntelFrameworkPkg/Include/Protocol/Hii.h [new file with mode: 0644]
IntelFrameworkPkg/Include/Protocol/IdeControllerInit.h [new file with mode: 0644]
IntelFrameworkPkg/Include/Protocol/IncompatiblePciDeviceSupport.h [new file with mode: 0644]
IntelFrameworkPkg/Include/Protocol/Legacy8259.h [new file with mode: 0644]
IntelFrameworkPkg/Include/Protocol/LegacyBios.h [new file with mode: 0644]
IntelFrameworkPkg/Include/Protocol/LegacyBiosPlatform.h [new file with mode: 0644]
IntelFrameworkPkg/Include/Protocol/LegacyInterrupt.h [new file with mode: 0644]
IntelFrameworkPkg/Include/Protocol/LegacyRegion.h [new file with mode: 0644]
IntelFrameworkPkg/Include/Protocol/PciHostBridgeResourceAllocation.h [new file with mode: 0644]
IntelFrameworkPkg/Include/Protocol/PciHotPlugInit.h [new file with mode: 0644]
IntelFrameworkPkg/Include/Protocol/PciPlatform.h [new file with mode: 0644]
IntelFrameworkPkg/Include/Protocol/SectionExtraction.h [new file with mode: 0644]
IntelFrameworkPkg/Include/Protocol/SmmAccess.h [new file with mode: 0644]
IntelFrameworkPkg/Include/Protocol/SmmBase.h [new file with mode: 0644]
IntelFrameworkPkg/Include/Protocol/SmmControl.h [new file with mode: 0644]
IntelFrameworkPkg/Include/Protocol/SmmGpiDispatch.h [new file with mode: 0644]
IntelFrameworkPkg/Include/Protocol/SmmIchnDispatch.h [new file with mode: 0644]
IntelFrameworkPkg/Include/Protocol/SmmPeriodicTimerDispatch.h [new file with mode: 0644]
IntelFrameworkPkg/Include/Protocol/SmmPowerButtonDispatch.h [new file with mode: 0644]
IntelFrameworkPkg/Include/Protocol/SmmStandbyButtonDispatch.h [new file with mode: 0644]
IntelFrameworkPkg/Include/Protocol/SmmSwDispatch.h [new file with mode: 0644]
IntelFrameworkPkg/Include/Protocol/SmmSxDispatch.h [new file with mode: 0644]
IntelFrameworkPkg/Include/Protocol/SmmUsbDispatch.h [new file with mode: 0644]
IntelFrameworkPkg/IntelFrameworkPkg.spd [new file with mode: 0644]
IntelFrameworkPkg/Library/DxeIoLibCpuIo/DxeCpuIoLibInternal.h [new file with mode: 0644]
IntelFrameworkPkg/Library/DxeIoLibCpuIo/DxeIoLibCpuIo.msa [new file with mode: 0644]
IntelFrameworkPkg/Library/DxeIoLibCpuIo/IoHighLevel.c [new file with mode: 0644]
IntelFrameworkPkg/Library/DxeIoLibCpuIo/IoLib.c [new file with mode: 0644]
IntelFrameworkPkg/Library/DxeIoLibCpuIo/IoLibMmioBuffer.c [new file with mode: 0644]
IntelFrameworkPkg/Library/DxeReportStatusCodeLibFramework/DxeReportStatusCodeLib.msa [new file with mode: 0644]
IntelFrameworkPkg/Library/DxeReportStatusCodeLibFramework/ReportStatusCodeLib.c [new file with mode: 0644]
IntelFrameworkPkg/Library/DxeSmmDriverEntryPoint/DriverEntryPoint.c [new file with mode: 0644]
IntelFrameworkPkg/Library/DxeSmmDriverEntryPoint/DxeSmmDriverEntryPoint.msa [new file with mode: 0644]
IntelFrameworkPkg/Library/UefiLibFramework/Console.c [new file with mode: 0644]
IntelFrameworkPkg/Library/UefiLibFramework/UefiLib.c [new file with mode: 0644]
IntelFrameworkPkg/Library/UefiLibFramework/UefiLib.msa [new file with mode: 0644]
IntelFrameworkPkg/Library/UefiLibFramework/UefiLibFramework.h [new file with mode: 0644]
IntelFrameworkPkg/Library/UefiLibFramework/UefiLibPrint.c [new file with mode: 0644]
IntelFrameworkPkg/Library/UefiLibFramework/UefiNotTiano.c [new file with mode: 0644]

diff --git a/IntelFrameworkPkg/Include/Common/DataHubRecords.h b/IntelFrameworkPkg/Include/Common/DataHubRecords.h
new file mode 100644 (file)
index 0000000..29bc8a7
--- /dev/null
@@ -0,0 +1,1908 @@
+/** @file\r
+  This file defines GUIDs and associated data structures for records posted to the Data Hub.\r
+  The producers of these records use these definitions to construct records.\r
+  The consumers of these records use these definitions to retrieve, filter and parse records.\r
+\r
+  Copyright (c) 2007, Intel Corporation\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+  Module Name:  DataHubRecords.h\r
+\r
+  @par Revision Reference:\r
+  DataHubRecord.h include all data hub sub class defitions from Cache subclass\r
+  spec 0.9, DataHub SubClass spec 0.9, Memory SubClass Spec 0.9, Processor\r
+  Subclass spec 0.9,Misc SubClass spec 0.9.\r
+\r
+**/\r
+\r
+#ifndef _DATAHUB_RECORDS_H_\r
+#define _DATAHUB_RECORDS_H_\r
+\r
+#define EFI_PROCESSOR_SUBCLASS_VERSION    0x00010000\r
+\r
+\r
+#pragma pack(1)\r
+\r
+typedef struct _USB_PORT_DEVICE_PATH {\r
+  ACPI_HID_DEVICE_PATH      PciRootBridgeDevicePath;\r
+  PCI_DEVICE_PATH           PciBusDevicePath;\r
+  EFI_DEVICE_PATH_PROTOCOL  EndDevicePath;\r
+} USB_PORT_DEVICE_PATH;\r
+\r
+//\r
+// IDE\r
+//\r
+typedef struct _IDE_DEVICE_PATH {\r
+  ACPI_HID_DEVICE_PATH      PciRootBridgeDevicePath;\r
+  PCI_DEVICE_PATH           PciBusDevicePath;\r
+  EFI_DEVICE_PATH_PROTOCOL  EndDevicePath;\r
+} IDE_DEVICE_PATH;\r
+\r
+//\r
+// RMC Connector\r
+//\r
+typedef struct _RMC_CONN_DEVICE_PATH {\r
+  ACPI_HID_DEVICE_PATH      PciRootBridgeDevicePath;\r
+  PCI_DEVICE_PATH           PciBridgeDevicePath;\r
+  PCI_DEVICE_PATH           PciBusDevicePath;\r
+  EFI_DEVICE_PATH_PROTOCOL  EndDevicePath;\r
+} RMC_CONN_DEVICE_PATH;\r
+\r
+//\r
+// RIDE\r
+//\r
+typedef struct _RIDE_DEVICE_PATH {\r
+  ACPI_HID_DEVICE_PATH      PciRootBridgeDevicePath;\r
+  PCI_DEVICE_PATH           PciBridgeDevicePath;\r
+  PCI_DEVICE_PATH           PciBusDevicePath;\r
+  EFI_DEVICE_PATH_PROTOCOL  EndDevicePath;\r
+} RIDE_DEVICE_PATH;\r
+\r
+//\r
+// Gigabit NIC\r
+//\r
+typedef struct _GB_NIC_DEVICE_PATH {\r
+  ACPI_HID_DEVICE_PATH      PciRootBridgeDevicePath;\r
+  PCI_DEVICE_PATH           PciBridgeDevicePath;\r
+  PCI_DEVICE_PATH           PciXBridgeDevicePath;\r
+  PCI_DEVICE_PATH           PciXBusDevicePath;\r
+  EFI_DEVICE_PATH_PROTOCOL  EndDevicePath;\r
+} GB_NIC_DEVICE_PATH;\r
+\r
+//\r
+// P/S2 Connector\r
+//\r
+typedef struct _PS2_CONN_DEVICE_PATH {\r
+  ACPI_HID_DEVICE_PATH      PciRootBridgeDevicePath;\r
+  PCI_DEVICE_PATH           LpcBridgeDevicePath;\r
+  ACPI_HID_DEVICE_PATH      LpcBusDevicePath;\r
+  EFI_DEVICE_PATH_PROTOCOL  EndDevicePath;\r
+} PS2_CONN_DEVICE_PATH;\r
+\r
+//\r
+// Serial Port Connector\r
+//\r
+typedef struct _SERIAL_CONN_DEVICE_PATH {\r
+  ACPI_HID_DEVICE_PATH      PciRootBridgeDevicePath;\r
+  PCI_DEVICE_PATH           LpcBridgeDevicePath;\r
+  ACPI_HID_DEVICE_PATH      LpcBusDevicePath;\r
+  EFI_DEVICE_PATH_PROTOCOL  EndDevicePath;\r
+} SERIAL_CONN_DEVICE_PATH;\r
+\r
+//\r
+// Parallel Port Connector\r
+//\r
+typedef struct _PARALLEL_CONN_DEVICE_PATH {\r
+  ACPI_HID_DEVICE_PATH      PciRootBridgeDevicePath;\r
+  PCI_DEVICE_PATH           LpcBridgeDevicePath;\r
+  ACPI_HID_DEVICE_PATH      LpcBusDevicePath;\r
+  EFI_DEVICE_PATH_PROTOCOL  EndDevicePath;\r
+} PARALLEL_CONN_DEVICE_PATH;\r
+\r
+//\r
+// Floopy Connector\r
+//\r
+typedef struct _FLOOPY_CONN_DEVICE_PATH {\r
+  ACPI_HID_DEVICE_PATH      PciRootBridgeDevicePath;\r
+  PCI_DEVICE_PATH           LpcBridgeDevicePath;\r
+  ACPI_HID_DEVICE_PATH      LpcBusDevicePath;\r
+  EFI_DEVICE_PATH_PROTOCOL  EndDevicePath;\r
+} FLOOPY_CONN_DEVICE_PATH;\r
+\r
+typedef union _EFI_MISC_PORT_DEVICE_PATH {\r
+  USB_PORT_DEVICE_PATH      UsbDevicePath;\r
+  IDE_DEVICE_PATH           IdeDevicePath;\r
+  RMC_CONN_DEVICE_PATH      RmcConnDevicePath;\r
+  RIDE_DEVICE_PATH          RideDevicePath;\r
+  GB_NIC_DEVICE_PATH        GbNicDevicePath;\r
+  PS2_CONN_DEVICE_PATH      Ps2ConnDevicePath;\r
+  SERIAL_CONN_DEVICE_PATH   SerialConnDevicePath;\r
+  PARALLEL_CONN_DEVICE_PATH ParallelConnDevicePath;\r
+  FLOOPY_CONN_DEVICE_PATH   FloppyConnDevicePath;\r
+} EFI_MISC_PORT_DEVICE_PATH;\r
+\r
+#pragma pack()\r
+\r
+//\r
+// String Token Definition\r
+//\r
+#define EFI_STRING_TOKEN    UINT16\r
+\r
+typedef struct {\r
+  UINT32    Version;\r
+  UINT32    HeaderSize;\r
+  UINT16    Instance;\r
+  UINT16    SubInstance;\r
+  UINT32    RecordType;\r
+} EFI_SUBCLASS_TYPE1_HEADER;\r
+\r
+typedef struct {\r
+  EFI_GUID    ProducerName;\r
+  UINT16      Instance;\r
+  UINT16      SubInstance;\r
+} EFI_INTER_LINK_DATA;\r
+\r
+\r
+//\r
+// EXP data\r
+//\r
+\r
+typedef struct {\r
+  UINT16    Value;\r
+  UINT16    Exponent;\r
+} EFI_EXP_BASE2_DATA;\r
+\r
+\r
+typedef EFI_EXP_BASE10_DATA   EFI_PROCESSOR_MAX_CORE_FREQUENCY_DATA;\r
+\r
+typedef EFI_EXP_BASE10_DATA   EFI_PROCESSOR_MAX_FSB_FREQUENCY_DATA;\r
+\r
+typedef EFI_EXP_BASE10_DATA   EFI_PROCESSOR_CORE_FREQUENCY_DATA;\r
+\r
+typedef EFI_EXP_BASE10_DATA  *EFI_PROCESSOR_CORE_FREQUENCY_LIST_DATA;\r
+\r
+typedef EFI_EXP_BASE10_DATA  *EFI_PROCESSOR_FSB_FREQUENCY_LIST_DATA;\r
+\r
+typedef EFI_EXP_BASE10_DATA   EFI_PROCESSOR_FSB_FREQUENCY_DATA;\r
+\r
+typedef STRING_REF            EFI_PROCESSOR_VERSION_DATA;\r
+\r
+typedef STRING_REF            EFI_PROCESSOR_MANUFACTURER_DATA;\r
+\r
+typedef STRING_REF            EFI_PROCESSOR_SERIAL_NUMBER_DATA;\r
+\r
+typedef STRING_REF            EFI_PROCESSOR_ASSET_TAG_DATA;\r
+\r
+typedef struct {\r
+  UINT32  ProcessorSteppingId:4;\r
+  UINT32  ProcessorModel:     4;\r
+  UINT32  ProcessorFamily:    4;\r
+  UINT32  ProcessorType:      2;\r
+  UINT32  ProcessorReserved1: 2;\r
+  UINT32  ProcessorXModel:    4;\r
+  UINT32  ProcessorXFamily:   8;\r
+  UINT32  ProcessorReserved2: 4;\r
+} EFI_PROCESSOR_SIGNATURE;\r
+\r
+typedef struct {\r
+  UINT32  ProcessorBrandIndex :8;\r
+  UINT32  ProcessorClflush    :8;\r
+  UINT32  ProcessorReserved   :8;\r
+  UINT32  ProcessorDfltApicId :8;\r
+} EFI_PROCESSOR_MISC_INFO;\r
+\r
+typedef struct {\r
+  UINT32  ProcessorFpu:       1;\r
+  UINT32  ProcessorVme:       1;\r
+  UINT32  ProcessorDe:        1;\r
+  UINT32  ProcessorPse:       1;\r
+  UINT32  ProcessorTsc:       1;\r
+  UINT32  ProcessorMsr:       1;\r
+  UINT32  ProcessorPae:       1;\r
+  UINT32  ProcessorMce:       1;\r
+  UINT32  ProcessorCx8:       1;\r
+  UINT32  ProcessorApic:      1;\r
+  UINT32  ProcessorReserved1: 1;\r
+  UINT32  ProcessorSep:       1;\r
+  UINT32  ProcessorMtrr:      1;\r
+  UINT32  ProcessorPge:       1;\r
+  UINT32  ProcessorMca:       1;\r
+  UINT32  ProcessorCmov:      1;\r
+  UINT32  ProcessorPat:       1;\r
+  UINT32  ProcessorPse36:     1;\r
+  UINT32  ProcessorPsn:       1;\r
+  UINT32  ProcessorClfsh:     1;\r
+  UINT32  ProcessorReserved2: 1;\r
+  UINT32  ProcessorDs:        1;\r
+  UINT32  ProcessorAcpi:      1;\r
+  UINT32  ProcessorMmx:       1;\r
+  UINT32  ProcessorFxsr:      1;\r
+  UINT32  ProcessorSse:       1;\r
+  UINT32  ProcessorSse2:      1;\r
+  UINT32  ProcessorSs:        1;\r
+  UINT32  ProcessorReserved3: 1;\r
+  UINT32  ProcessorTm:        1;\r
+  UINT32  ProcessorReserved4: 2;\r
+} EFI_PROCESSOR_FEATURE_FLAGS;\r
+\r
+typedef struct {\r
+  EFI_PROCESSOR_SIGNATURE     Signature;\r
+  EFI_PROCESSOR_MISC_INFO     MiscInfo;\r
+  UINT32                      Reserved;\r
+  EFI_PROCESSOR_FEATURE_FLAGS FeatureFlags;\r
+} EFI_PROCESSOR_ID_DATA;\r
+\r
+typedef enum {\r
+  EfiProcessorOther    = 1,\r
+  EfiProcessorUnknown  = 2,\r
+  EfiCentralProcessor  = 3,\r
+  EfiMathProcessor     = 4,\r
+  EfiDspProcessor      = 5,\r
+  EfiVideoProcessor    = 6\r
+} EFI_PROCESSOR_TYPE_DATA;\r
+\r
+typedef enum {\r
+  EfiProcessorFamilyOther               = 1,\r
+  EfiProcessorFamilyUnknown             = 2,\r
+  EfiProcessorFamily8086                = 3,\r
+  EfiProcessorFamily80286               = 4,\r
+  EfiProcessorFamilyIntel386            = 5,\r
+  EfiProcessorFamilyIntel486            = 6,\r
+  EfiProcessorFamily8087                = 7,\r
+  EfiProcessorFamily80287               = 8,\r
+  EfiProcessorFamily80387               = 9,\r
+  EfiProcessorFamily80487               = 0x0A,\r
+  EfiProcessorFamilyPentium             = 0x0B,\r
+  EfiProcessorFamilyPentiumPro          = 0x0C,\r
+  EfiProcessorFamilyPentiumII           = 0x0D,\r
+  EfiProcessorFamilyPentiumMMX          = 0x0E,\r
+  EfiProcessorFamilyCeleron             = 0x0F,\r
+  EfiProcessorFamilyPentiumIIXeon       = 0x10,\r
+  EfiProcessorFamilyPentiumIII          = 0x11,\r
+  EfiProcessorFamilyM1                  = 0x12,\r
+  EfiProcessorFamilyM1Reserved1         = 0x13,\r
+  EfiProcessorFamilyM1Reserved2         = 0x14,\r
+  EfiProcessorFamilyM1Reserved3         = 0x15,\r
+  EfiProcessorFamilyM1Reserved4         = 0x16,\r
+  EfiProcessorFamilyM1Reserved5         = 0x17,\r
+  EfiProcessorFamilyM1Reserved6         = 0x18,\r
+  EfiProcessorFamilyK5                  = 0x19,\r
+  EfiProcessorFamilyK5Reserved1         = 0x1A,\r
+  EfiProcessorFamilyK5Reserved2         = 0x1B,\r
+  EfiProcessorFamilyK5Reserved3         = 0x1C,\r
+  EfiProcessorFamilyK5Reserved4         = 0x1D,\r
+  EfiProcessorFamilyK5Reserved5         = 0x1E,\r
+  EfiProcessorFamilyK5Reserved6         = 0x1F,\r
+  EfiProcessorFamilyPowerPC             = 0x20,\r
+  EfiProcessorFamilyPowerPC601          = 0x21,\r
+  EfiProcessorFamilyPowerPC603          = 0x22,\r
+  EfiProcessorFamilyPowerPC603Plus      = 0x23,\r
+  EfiProcessorFamilyPowerPC604          = 0x24,\r
+  EfiProcessorFamilyAlpha2              = 0x30,\r
+  EfiProcessorFamilyMips                = 0x40,\r
+  EfiProcessorFamilySparc               = 0x50,\r
+  EfiProcessorFamily68040               = 0x60,\r
+  EfiProcessorFamily68xxx               = 0x61,\r
+  EfiProcessorFamily68000               = 0x62,\r
+  EfiProcessorFamily68010               = 0x63,\r
+  EfiProcessorFamily68020               = 0x64,\r
+  EfiProcessorFamily68030               = 0x65,\r
+  EfiProcessorFamilyHobbit              = 0x70,\r
+  EfiProcessorFamilyWeitek              = 0x80,\r
+  EfiProcessorFamilyPARISC              = 0x90,\r
+  EfiProcessorFamilyV30                 = 0xA0,\r
+  EfiProcessorFamilyPentiumIIIXeon      = 0xB0,\r
+  EfiProcessorFamilyPentiumIIISpeedStep = 0xB1,\r
+  EfiProcessorFamilyPentium4            = 0xB2,\r
+  EfiProcessorFamilyIntelXeon           = 0xB3,\r
+  EfiProcessorFamilyAS400               = 0xB4,\r
+  EfiProcessorFamilyIntelXeonMP         = 0xB5,\r
+  EfiProcessorFamilyAMDAthlonXP         = 0xB6,\r
+  EfiProcessorFamilyAMDAthlonMP         = 0xB7,\r
+  EfiProcessorFamilyIntelPentiumM       = 0xB9,\r
+  EfiProcessorFamilyIntelCeleronD       = 0xBA,\r
+  EfiProcessorFamilyIntelPentiumD       = 0xBB,\r
+  EfiProcessorFamilyIntelPentiumEx      = 0xBC,\r
+  EfiProcessorFamilyIBM390              = 0xC8,\r
+  EfiProcessorFamilyG4                  = 0xC9,\r
+  EfiProcessorFamilyG5                  = 0xCA,\r
+  EfiProcessorFamilyi860                = 0xFA,\r
+  EfiProcessorFamilyi960                = 0xFB\r
+} EFI_PROCESSOR_FAMILY_DATA;\r
+\r
+typedef EFI_EXP_BASE10_DATA EFI_PROCESSOR_VOLTAGE_DATA;\r
+\r
+typedef EFI_PHYSICAL_ADDRESS EFI_PROCESSOR_APIC_BASE_ADDRESS_DATA;\r
+\r
+typedef UINT32 EFI_PROCESSOR_APIC_ID_DATA;\r
+\r
+typedef UINT32 EFI_PROCESSOR_APIC_VERSION_NUMBER_DATA;\r
+\r
+typedef enum {\r
+  EfiProcessorIa32Microcode    = 1,\r
+  EfiProcessorIpfPalAMicrocode = 2,\r
+  EfiProcessorIpfPalBMicrocode = 3\r
+} EFI_PROCESSOR_MICROCODE_TYPE;\r
+\r
+typedef struct {\r
+  EFI_PROCESSOR_MICROCODE_TYPE  ProcessorMicrocodeType;\r
+  UINT32                        ProcessorMicrocodeRevisionNumber;\r
+} EFI_PROCESSOR_MICROCODE_REVISION_DATA;\r
+\r
+typedef struct {\r
+  UINT32      CpuStatus                 :3;\r
+  UINT32      Reserved1                 :3;\r
+  UINT32      SocketPopulated           :1;\r
+  UINT32      Reserved2                 :1;\r
+  UINT32      ApicEnable                :1;\r
+  UINT32      BootApplicationProcessor  :1;\r
+  UINT32      Reserved3                 :22;\r
+} EFI_PROCESSOR_STATUS_DATA;\r
+\r
+typedef enum {\r
+  EfiCpuStatusUnknown        = 0,\r
+  EfiCpuStatusEnabled        = 1,\r
+  EfiCpuStatusDisabledByUser = 2,\r
+  EfiCpuStatusDisabledbyBios = 3,\r
+  EfiCpuStatusIdle           = 4,\r
+  EfiCpuStatusOther          = 7\r
+} EFI_CPU_STATUS;\r
+\r
+typedef enum {\r
+  EfiProcessorSocketOther            = 1,\r
+  EfiProcessorSocketUnknown          = 2,\r
+  EfiProcessorSocketDaughterBoard    = 3,\r
+  EfiProcessorSocketZIF              = 4,\r
+  EfiProcessorSocketReplacePiggyBack = 5,\r
+  EfiProcessorSocketNone             = 6,\r
+  EfiProcessorSocketLIF              = 7,\r
+  EfiProcessorSocketSlot1            = 8,\r
+  EfiProcessorSocketSlot2            = 9,\r
+  EfiProcessorSocket370Pin           = 0xA,\r
+  EfiProcessorSocketSlotA            = 0xB,\r
+  EfiProcessorSocketSlotM            = 0xC,\r
+  EfiProcessorSocket423              = 0xD,\r
+  EfiProcessorSocketA462             = 0xE,\r
+  EfiProcessorSocket478              = 0xF,\r
+  EfiProcessorSocket754              = 0x10,\r
+  EfiProcessorSocket940              = 0x11,\r
+  EfiProcessorSocket939              = 0x12,\r
+  EfiProcessorSocketmPGA604          = 0x13,\r
+  EfiProcessorSocketLGA771           = 0x14,\r
+  EfiProcessorSocketLGA775           = 0x15\r
+\r
+} EFI_PROCESSOR_SOCKET_TYPE_DATA;\r
+\r
+typedef STRING_REF EFI_PROCESSOR_SOCKET_NAME_DATA;\r
+\r
+typedef EFI_INTER_LINK_DATA EFI_CACHE_ASSOCIATION_DATA;\r
+\r
+typedef enum {\r
+  EfiProcessorHealthy        = 1,\r
+  EfiProcessorPerfRestricted = 2,\r
+  EfiProcessorFuncRestricted = 3\r
+} EFI_PROCESSOR_HEALTH_STATUS;\r
+\r
+typedef UINTN   EFI_PROCESSOR_PACKAGE_NUMBER_DATA;\r
+\r
+\r
+typedef enum {\r
+  ProcessorCoreFrequencyRecordType     = 1,\r
+  ProcessorFsbFrequencyRecordType      = 2,\r
+  ProcessorVersionRecordType           = 3,\r
+  ProcessorManufacturerRecordType      = 4,\r
+  ProcessorSerialNumberRecordType      = 5,\r
+  ProcessorIdRecordType                = 6,\r
+  ProcessorTypeRecordType              = 7,\r
+  ProcessorFamilyRecordType            = 8,\r
+  ProcessorVoltageRecordType           = 9,\r
+  ProcessorApicBaseAddressRecordType   = 10,\r
+  ProcessorApicIdRecordType            = 11,\r
+  ProcessorApicVersionNumberRecordType = 12,\r
+  CpuUcodeRevisionDataRecordType       = 13,\r
+  ProcessorStatusRecordType            = 14,\r
+  ProcessorSocketTypeRecordType        = 15,\r
+  ProcessorSocketNameRecordType        = 16,\r
+  CacheAssociationRecordType           = 17,\r
+  ProcessorMaxCoreFrequencyRecordType  = 18,\r
+  ProcessorAssetTagRecordType          = 19,\r
+  ProcessorMaxFsbFrequencyRecordType   = 20,\r
+  ProcessorPackageNumberRecordType     = 21,\r
+  ProcessorCoreFrequencyListRecordType = 22,\r
+  ProcessorFsbFrequencyListRecordType  = 23,\r
+  ProcessorHealthStatusRecordType      = 24\r
+} EFI_CPU_VARIABLE_RECORD_TYPE;\r
+\r
+typedef union {\r
+  EFI_PROCESSOR_CORE_FREQUENCY_LIST_DATA  ProcessorCoreFrequencyList;\r
+  EFI_PROCESSOR_FSB_FREQUENCY_LIST_DATA   ProcessorFsbFrequencyList;\r
+  EFI_PROCESSOR_SERIAL_NUMBER_DATA        ProcessorSerialNumber;\r
+  EFI_PROCESSOR_CORE_FREQUENCY_DATA       ProcessorCoreFrequency;\r
+  EFI_PROCESSOR_FSB_FREQUENCY_DATA        ProcessorFsbFrequency;\r
+  EFI_PROCESSOR_MAX_CORE_FREQUENCY_DATA   ProcessorMaxCoreFrequency;\r
+  EFI_PROCESSOR_MAX_FSB_FREQUENCY_DATA    ProcessorMaxFsbFrequency;\r
+  EFI_PROCESSOR_VERSION_DATA              ProcessorVersion;\r
+  EFI_PROCESSOR_MANUFACTURER_DATA         ProcessorManufacturer;\r
+  EFI_PROCESSOR_ID_DATA                   ProcessorId;\r
+  EFI_PROCESSOR_TYPE_DATA                 ProcessorType;\r
+  EFI_PROCESSOR_FAMILY_DATA               ProcessorFamily;\r
+  EFI_PROCESSOR_VOLTAGE_DATA              ProcessorVoltage;\r
+  EFI_PROCESSOR_APIC_BASE_ADDRESS_DATA    ProcessorApicBase;\r
+  EFI_PROCESSOR_APIC_ID_DATA              ProcessorApicId;\r
+  EFI_PROCESSOR_APIC_VERSION_NUMBER_DATA  ProcessorApicVersionNumber;\r
+  EFI_PROCESSOR_MICROCODE_REVISION_DATA   CpuUcodeRevisionData;\r
+  EFI_PROCESSOR_STATUS_DATA               ProcessorStatus;\r
+  EFI_PROCESSOR_SOCKET_TYPE_DATA          ProcessorSocketType;\r
+  EFI_PROCESSOR_SOCKET_NAME_DATA          ProcessorSocketName;\r
+  EFI_PROCESSOR_ASSET_TAG_DATA            ProcessorAssetTag;\r
+  EFI_PROCESSOR_HEALTH_STATUS             ProcessorHealthStatus;\r
+  EFI_PROCESSOR_PACKAGE_NUMBER_DATA       ProcessorPackageNumber;\r
+} EFI_CPU_VARIABLE_RECORD;\r
+\r
+typedef struct {\r
+  EFI_SUBCLASS_TYPE1_HEADER      DataRecordHeader;\r
+  EFI_CPU_VARIABLE_RECORD        VariableRecord;\r
+} EFI_CPU_DATA_RECORD;\r
+\r
+#define EFI_CACHE_SUBCLASS_VERSION    0x00010000\r
+\r
+\r
+typedef EFI_EXP_BASE2_DATA  EFI_CACHE_SIZE_DATA;\r
+\r
+typedef EFI_EXP_BASE2_DATA  EFI_MAXIMUM_CACHE_SIZE_DATA;\r
+\r
+typedef EFI_EXP_BASE10_DATA EFI_CACHE_SPEED_DATA;\r
+\r
+typedef STRING_REF          EFI_CACHE_SOCKET_DATA;\r
+\r
+typedef struct {\r
+  UINT32  Other         :1;\r
+  UINT32  Unknown       :1;\r
+  UINT32  NonBurst      :1;\r
+  UINT32  Burst         :1;\r
+  UINT32  PipelineBurst :1;\r
+  UINT32  Asynchronous  :1;\r
+  UINT32  Synchronous   :1;\r
+  UINT32  Reserved      :25;\r
+} EFI_CACHE_SRAM_TYPE_DATA;\r
+\r
+typedef enum {\r
+  EfiCacheErrorOther     = 1,\r
+  EfiCacheErrorUnknown   = 2,\r
+  EfiCacheErrorNone      = 3,\r
+  EfiCacheErrorParity    = 4,\r
+  EfiCacheErrorSingleBit = 5,\r
+  EfiCacheErrorMultiBit  = 6\r
+} EFI_CACHE_ERROR_TYPE_DATA;\r
+\r
+typedef enum {\r
+  EfiCacheTypeOther       = 1,\r
+  EfiCacheTypeUnknown     = 2,\r
+  EfiCacheTypeInstruction = 3,\r
+  EfiCacheTypeData        = 4,\r
+  EfiCacheTypeUnified     = 5\r
+} EFI_CACHE_TYPE_DATA;\r
+\r
+typedef enum {\r
+  EfiCacheAssociativityOther        = 1,\r
+  EfiCacheAssociativityUnknown      = 2,\r
+  EfiCacheAssociativityDirectMapped = 3,\r
+  EfiCacheAssociativity2Way         = 4,\r
+  EfiCacheAssociativity4Way         = 5,\r
+  EfiCacheAssociativityFully        = 6,\r
+  EfiCacheAssociativity8Way         = 7,\r
+  EfiCacheAssociativity16Way        = 8\r
+} EFI_CACHE_ASSOCIATIVITY_DATA;\r
+\r
+typedef struct {\r
+  UINT32    Level           :3;\r
+  UINT32    Socketed        :1;\r
+  UINT32    Reserved2       :1;\r
+  UINT32    Location        :2;\r
+  UINT32    Enable          :1;\r
+  UINT32    OperationalMode :2;\r
+  UINT32    Reserved1       :22;\r
+} EFI_CACHE_CONFIGURATION_DATA;\r
+\r
+#define EFI_CACHE_L1      1\r
+#define EFI_CACHE_L2      2\r
+#define EFI_CACHE_L3      3\r
+#define EFI_CACHE_L4      4\r
+#define EFI_CACHE_LMAX    EFI_CACHE_L4\r
+\r
+#define EFI_CACHE_SOCKETED      1\r
+#define EFI_CACHE_NOT_SOCKETED  0\r
+\r
+typedef enum {\r
+  EfiCacheInternal = 0,\r
+  EfiCacheExternal = 1,\r
+  EfiCacheReserved = 2,\r
+  EfiCacheUnknown  = 3\r
+} EFI_CACHE_LOCATION;\r
+\r
+#define EFI_CACHE_ENABLED    1\r
+#define EFI_CACHE_DISABLED   0\r
+\r
+typedef enum {\r
+  EfiCacheWriteThrough = 0,\r
+  EfiCacheWriteBack    = 1,\r
+  EfiCacheDynamicMode  = 2,\r
+  EfiCacheUnknownMode  = 3\r
+} EFI_CACHE_OPERATIONAL_MODE;\r
+\r
+\r
+\r
+typedef enum {\r
+  CacheSizeRecordType              = 1,\r
+  MaximumSizeCacheRecordType       = 2,\r
+  CacheSpeedRecordType             = 3,\r
+  CacheSocketRecordType            = 4,\r
+  CacheSramTypeRecordType          = 5,\r
+  CacheInstalledSramTypeRecordType = 6,\r
+  CacheErrorTypeRecordType         = 7,\r
+  CacheTypeRecordType              = 8,\r
+  CacheAssociativityRecordType     = 9,\r
+  CacheConfigRecordType            = 10\r
+} EFI_CACHE_VARIABLE_RECORD_TYPE;\r
+\r
+\r
+typedef union {\r
+  EFI_CACHE_SIZE_DATA             CacheSize;\r
+  EFI_MAXIMUM_CACHE_SIZE_DATA     MaximumCacheSize;\r
+  EFI_CACHE_SPEED_DATA            CacheSpeed;\r
+  EFI_CACHE_SOCKET_DATA           CacheSocket;\r
+  EFI_CACHE_SRAM_TYPE_DATA        CacheSramType;\r
+  EFI_CACHE_SRAM_TYPE_DATA        CacheInstalledSramType;\r
+  EFI_CACHE_ERROR_TYPE_DATA       CacheErrorType;\r
+  EFI_CACHE_TYPE_DATA             CacheType;\r
+  EFI_CACHE_ASSOCIATIVITY_DATA    CacheAssociativity;\r
+  EFI_CACHE_CONFIGURATION_DATA    CacheConfig;\r
+  EFI_CACHE_ASSOCIATION_DATA      CacheAssociation;\r
+} EFI_CACHE_VARIABLE_RECORD;\r
+\r
+typedef struct {\r
+   EFI_SUBCLASS_TYPE1_HEADER      DataRecordHeader;\r
+   EFI_CACHE_VARIABLE_RECORD      VariableRecord;\r
+} EFI_CACHE_DATA_RECORD;\r
+\r
+#define EFI_MEMORY_SUBCLASS_VERSION     0x0100\r
+\r
+\r
+#define EFI_MEMORY_SIZE_RECORD_NUMBER                 0x00000001\r
+\r
+typedef enum _EFI_MEMORY_REGION_TYPE {\r
+  EfiMemoryRegionMemory                       = 0x01,\r
+  EfiMemoryRegionReserved                     = 0x02,\r
+  EfiMemoryRegionAcpi                         = 0x03,\r
+  EfiMemoryRegionNvs                          = 0x04\r
+} EFI_MEMORY_REGION_TYPE;\r
+\r
+typedef struct {\r
+  UINT32                      ProcessorNumber;\r
+  UINT16                      StartBusNumber;\r
+  UINT16                      EndBusNumber;\r
+  EFI_MEMORY_REGION_TYPE      MemoryRegionType;\r
+  EFI_EXP_BASE2_DATA          MemorySize;\r
+  EFI_PHYSICAL_ADDRESS        MemoryStartAddress;\r
+} EFI_MEMORY_SIZE_DATA;\r
+\r
+\r
+#define EFI_MEMORY_ARRAY_LOCATION_RECORD_NUMBER       0x00000002\r
+\r
+typedef enum _EFI_MEMORY_ARRAY_LOCATION {\r
+  EfiMemoryArrayLocationOther                 = 0x01,\r
+  EfiMemoryArrayLocationUnknown               = 0x02,\r
+  EfiMemoryArrayLocationSystemBoard           = 0x03,\r
+  EfiMemoryArrayLocationIsaAddonCard          = 0x04,\r
+  EfiMemoryArrayLocationEisaAddonCard         = 0x05,\r
+  EfiMemoryArrayLocationPciAddonCard          = 0x06,\r
+  EfiMemoryArrayLocationMcaAddonCard          = 0x07,\r
+  EfiMemoryArrayLocationPcmciaAddonCard       = 0x08,\r
+  EfiMemoryArrayLocationProprietaryAddonCard  = 0x09,\r
+  EfiMemoryArrayLocationNuBus                 = 0x0A,\r
+  EfiMemoryArrayLocationPc98C20AddonCard      = 0xA0,\r
+  EfiMemoryArrayLocationPc98C24AddonCard      = 0xA1,\r
+  EfiMemoryArrayLocationPc98EAddonCard        = 0xA2,\r
+  EfiMemoryArrayLocationPc98LocalBusAddonCard = 0xA3\r
+} EFI_MEMORY_ARRAY_LOCATION;\r
+\r
+typedef enum _EFI_MEMORY_ARRAY_USE {\r
+  EfiMemoryArrayUseOther                      = 0x01,\r
+  EfiMemoryArrayUseUnknown                    = 0x02,\r
+  EfiMemoryArrayUseSystemMemory               = 0x03,\r
+  EfiMemoryArrayUseVideoMemory                = 0x04,\r
+  EfiMemoryArrayUseFlashMemory                = 0x05,\r
+  EfiMemoryArrayUseNonVolatileRam             = 0x06,\r
+  EfiMemoryArrayUseCacheMemory                = 0x07,\r
+} EFI_MEMORY_ARRAY_USE;\r
+\r
+typedef enum _EFI_MEMORY_ERROR_CORRECTION {\r
+  EfiMemoryErrorCorrectionOther               = 0x01,\r
+  EfiMemoryErrorCorrectionUnknown             = 0x02,\r
+  EfiMemoryErrorCorrectionNone                = 0x03,\r
+  EfiMemoryErrorCorrectionParity              = 0x04,\r
+  EfiMemoryErrorCorrectionSingleBitEcc        = 0x05,\r
+  EfiMemoryErrorCorrectionMultiBitEcc         = 0x06,\r
+  EfiMemoryErrorCorrectionCrc                 = 0x07,\r
+} EFI_MEMORY_ERROR_CORRECTION;\r
+\r
+typedef struct {\r
+  EFI_MEMORY_ARRAY_LOCATION   MemoryArrayLocation;\r
+  EFI_MEMORY_ARRAY_USE        MemoryArrayUse;\r
+  EFI_MEMORY_ERROR_CORRECTION MemoryErrorCorrection;\r
+  EFI_EXP_BASE2_DATA          MaximumMemoryCapacity;\r
+  UINT16                      NumberMemoryDevices;\r
+} EFI_MEMORY_ARRAY_LOCATION_DATA;\r
+\r
+\r
+#define EFI_MEMORY_ARRAY_LINK_RECORD_NUMBER           0x00000003\r
+\r
+typedef enum _EFI_MEMORY_FORM_FACTOR {\r
+  EfiMemoryFormFactorOther                    = 0x01,\r
+  EfiMemoryFormFactorUnknown                  = 0x02,\r
+  EfiMemoryFormFactorSimm                     = 0x03,\r
+  EfiMemoryFormFactorSip                      = 0x04,\r
+  EfiMemoryFormFactorChip                     = 0x05,\r
+  EfiMemoryFormFactorDip                      = 0x06,\r
+  EfiMemoryFormFactorZip                      = 0x07,\r
+  EfiMemoryFormFactorProprietaryCard          = 0x08,\r
+  EfiMemoryFormFactorDimm                     = 0x09,\r
+  EfiMemoryFormFactorTsop                     = 0x0A,\r
+  EfiMemoryFormFactorRowOfChips               = 0x0B,\r
+  EfiMemoryFormFactorRimm                     = 0x0C,\r
+  EfiMemoryFormFactorSodimm                   = 0x0D,\r
+  EfiMemoryFormFactorSrimm                    = 0x0E,\r
+  EfiMemoryFormFactorFbDimm                   = 0x0F\r
+} EFI_MEMORY_FORM_FACTOR;\r
+\r
+typedef enum _EFI_MEMORY_ARRAY_TYPE {\r
+  EfiMemoryTypeOther                          = 0x01,\r
+  EfiMemoryTypeUnknown                        = 0x02,\r
+  EfiMemoryTypeDram                           = 0x03,\r
+  EfiMemoryTypeEdram                          = 0x04,\r
+  EfiMemoryTypeVram                           = 0x05,\r
+  EfiMemoryTypeSram                           = 0x06,\r
+  EfiMemoryTypeRam                            = 0x07,\r
+  EfiMemoryTypeRom                            = 0x08,\r
+  EfiMemoryTypeFlash                          = 0x09,\r
+  EfiMemoryTypeEeprom                         = 0x0A,\r
+  EfiMemoryTypeFeprom                         = 0x0B,\r
+  EfiMemoryTypeEprom                          = 0x0C,\r
+  EfiMemoryTypeCdram                          = 0x0D,\r
+  EfiMemoryType3Dram                          = 0x0E,\r
+  EfiMemoryTypeSdram                          = 0x0F,\r
+  EfiMemoryTypeSgram                          = 0x10,\r
+  EfiMemoryTypeRdram                          = 0x11,\r
+  EfiMemoryTypeDdr                            = 0x12,\r
+  EfiMemoryTypeDdr2                           = 0x13,\r
+  EfiMemoryTypeDdr2FbDimm                     = 0x14\r
+} EFI_MEMORY_ARRAY_TYPE;\r
+\r
+typedef struct {\r
+  UINT32                      Reserved        :1;\r
+  UINT32                      Other           :1;\r
+  UINT32                      Unknown         :1;\r
+  UINT32                      FastPaged       :1;\r
+  UINT32                      StaticColumn    :1;\r
+  UINT32                      PseudoStatic    :1;\r
+  UINT32                      Rambus          :1;\r
+  UINT32                      Synchronous     :1;\r
+  UINT32                      Cmos            :1;\r
+  UINT32                      Edo             :1;\r
+  UINT32                      WindowDram      :1;\r
+  UINT32                      CacheDram       :1;\r
+  UINT32                      Nonvolatile     :1;\r
+  UINT32                      Reserved1       :19;\r
+} EFI_MEMORY_TYPE_DETAIL;\r
+\r
+typedef enum {\r
+  EfiMemoryStateEnabled      = 0,\r
+  EfiMemoryStateUnknown      = 1,\r
+  EfiMemoryStateUnsupported  = 2,\r
+  EfiMemoryStateError        = 3,\r
+  EfiMemoryStateAbsent       = 4,\r
+  EfiMemoryStateDisabled     = 5,\r
+  EfiMemoryStatePartial      = 6\r
+} EFI_MEMORY_STATE;\r
+\r
+typedef struct {\r
+  STRING_REF                  MemoryDeviceLocator;\r
+  STRING_REF                  MemoryBankLocator;\r
+  STRING_REF                  MemoryManufacturer;\r
+  STRING_REF                  MemorySerialNumber;\r
+  STRING_REF                  MemoryAssetTag;\r
+  STRING_REF                  MemoryPartNumber;\r
+  EFI_INTER_LINK_DATA         MemoryArrayLink;\r
+  EFI_INTER_LINK_DATA         MemorySubArrayLink;\r
+  UINT16                      MemoryTotalWidth;\r
+  UINT16                      MemoryDataWidth;\r
+  EFI_EXP_BASE2_DATA          MemoryDeviceSize;\r
+  EFI_MEMORY_FORM_FACTOR      MemoryFormFactor;\r
+  UINT8                       MemoryDeviceSet;\r
+  EFI_MEMORY_ARRAY_TYPE       MemoryType;\r
+  EFI_MEMORY_TYPE_DETAIL      MemoryTypeDetail;\r
+  EFI_EXP_BASE10_DATA         MemorySpeed;\r
+  EFI_MEMORY_STATE            MemoryState;\r
+} EFI_MEMORY_ARRAY_LINK_DATA;\r
+\r
+\r
+#define EFI_MEMORY_ARRAY_START_ADDRESS_RECORD_NUMBER  0x00000004\r
+\r
+typedef struct {\r
+  EFI_PHYSICAL_ADDRESS        MemoryArrayStartAddress;\r
+  EFI_PHYSICAL_ADDRESS        MemoryArrayEndAddress;\r
+  EFI_INTER_LINK_DATA         PhysicalMemoryArrayLink;\r
+  UINT16                      MemoryArrayPartitionWidth;\r
+} EFI_MEMORY_ARRAY_START_ADDRESS_DATA;\r
+\r
+\r
+#define EFI_MEMORY_DEVICE_START_ADDRESS_RECORD_NUMBER 0x00000005\r
+\r
+typedef struct {\r
+  EFI_PHYSICAL_ADDRESS        MemoryDeviceStartAddress;\r
+  EFI_PHYSICAL_ADDRESS        MemoryDeviceEndAddress;\r
+  EFI_INTER_LINK_DATA         PhysicalMemoryDeviceLink;\r
+  EFI_INTER_LINK_DATA         PhysicalMemoryArrayLink;\r
+  UINT8                       MemoryDevicePartitionRowPosition;\r
+  UINT8                       MemoryDeviceInterleavePosition;\r
+  UINT8                       MemoryDeviceInterleaveDataDepth;\r
+} EFI_MEMORY_DEVICE_START_ADDRESS_DATA;\r
+\r
+\r
+//\r
+//  Memory. Channel Device Type -  SMBIOS Type 37\r
+//\r
+\r
+#define EFI_MEMORY_CHANNEL_TYPE_RECORD_NUMBER         0x00000006\r
+\r
+typedef enum _EFI_MEMORY_CHANNEL_TYPE {\r
+  EfiMemoryChannelTypeOther                   = 1,\r
+  EfiMemoryChannelTypeUnknown                 = 2,\r
+  EfiMemoryChannelTypeRambus                  = 3,\r
+  EfiMemoryChannelTypeSyncLink                = 4\r
+} EFI_MEMORY_CHANNEL_TYPE;\r
+\r
+typedef struct {\r
+  EFI_MEMORY_CHANNEL_TYPE     MemoryChannelType;\r
+  UINT8                       MemoryChannelMaximumLoad;\r
+  UINT8                       MemoryChannelDeviceCount;\r
+} EFI_MEMORY_CHANNEL_TYPE_DATA;\r
+\r
+#define EFI_MEMORY_CHANNEL_DEVICE_RECORD_NUMBER       0x00000007\r
+\r
+typedef struct {\r
+  UINT8                       DeviceId;\r
+  EFI_INTER_LINK_DATA         DeviceLink;\r
+  UINT8                       MemoryChannelDeviceLoad;\r
+} EFI_MEMORY_CHANNEL_DEVICE_DATA;\r
+\r
+\r
+\r
+typedef union _EFI_MEMORY_SUBCLASS_RECORDS {\r
+  EFI_MEMORY_SIZE_DATA                  SizeData;\r
+  EFI_MEMORY_ARRAY_LOCATION_DATA        ArrayLocationData;\r
+  EFI_MEMORY_ARRAY_LINK_DATA            ArrayLink;\r
+  EFI_MEMORY_ARRAY_START_ADDRESS_DATA   ArrayStartAddress;\r
+  EFI_MEMORY_DEVICE_START_ADDRESS_DATA  DeviceStartAddress;\r
+  EFI_MEMORY_CHANNEL_TYPE_DATA          ChannelTypeData;\r
+  EFI_MEMORY_CHANNEL_DEVICE_DATA        ChannelDeviceData;\r
+} EFI_MEMORY_SUBCLASS_RECORDS;\r
+\r
+typedef struct {\r
+  EFI_SUBCLASS_TYPE1_HEADER             Header;\r
+  EFI_MEMORY_SUBCLASS_RECORDS           Record;\r
+} EFI_MEMORY_SUBCLASS_DRIVER_DATA;\r
+\r
+#define EFI_MISC_SUBCLASS_VERSION     0x0100\r
+\r
+#pragma pack(1)\r
+//\r
+//////////////////////////////////////////////////////////////////////////////\r
+//\r
+// Last PCI Bus Number\r
+//\r
+#define EFI_MISC_LAST_PCI_BUS_RECORD_NUMBER  0x00000001\r
+\r
+typedef struct {\r
+  UINT8   LastPciBus;\r
+} EFI_MISC_LAST_PCI_BUS_DATA;\r
+\r
+//\r
+//////////////////////////////////////////////////////////////////////////////\r
+//\r
+// Misc. BIOS Vendor - SMBIOS Type 0\r
+//\r
+#define EFI_MISC_BIOS_VENDOR_RECORD_NUMBER  0x00000002\r
+\r
+typedef struct {\r
+  UINT64  Reserved1                         :2;\r
+  UINT64  Unknown                           :1;\r
+  UINT64  BiosCharacteristicsNotSupported   :1;\r
+  UINT64  IsaIsSupported                    :1;\r
+  UINT64  McaIsSupported                    :1;\r
+  UINT64  EisaIsSupported                   :1;\r
+  UINT64  PciIsSupported                    :1;\r
+  UINT64  PcmciaIsSupported                 :1;\r
+  UINT64  PlugAndPlayIsSupported            :1;\r
+  UINT64  ApmIsSupported                    :1;\r
+  UINT64  BiosIsUpgradable                  :1;\r
+  UINT64  BiosShadowingAllowed              :1;\r
+  UINT64  VlVesaIsSupported                 :1;\r
+  UINT64  EscdSupportIsAvailable            :1;\r
+  UINT64  BootFromCdIsSupported             :1;\r
+  UINT64  SelectableBootIsSupported         :1;\r
+  UINT64  RomBiosIsSocketed                 :1;\r
+  UINT64  BootFromPcmciaIsSupported         :1;\r
+  UINT64  EDDSpecificationIsSupported       :1;\r
+  UINT64  JapaneseNecFloppyIsSupported      :1;\r
+  UINT64  JapaneseToshibaFloppyIsSupported  :1;\r
+  UINT64  Floppy525_360IsSupported          :1;\r
+  UINT64  Floppy525_12IsSupported           :1;\r
+  UINT64  Floppy35_720IsSupported           :1;\r
+  UINT64  Floppy35_288IsSupported           :1;\r
+  UINT64  PrintScreenIsSupported            :1;\r
+  UINT64  Keyboard8042IsSupported           :1;\r
+  UINT64  SerialIsSupported                 :1;\r
+  UINT64  PrinterIsSupported                :1;\r
+  UINT64  CgaMonoIsSupported                :1;\r
+  UINT64  NecPc98                           :1;\r
+  UINT64  AcpiIsSupported                   :1;\r
+  UINT64  UsbLegacyIsSupported              :1;\r
+  UINT64  AgpIsSupported                    :1;\r
+  UINT64  I20BootIsSupported                :1;\r
+  UINT64  Ls120BootIsSupported              :1;\r
+  UINT64  AtapiZipDriveBootIsSupported      :1;\r
+  UINT64  Boot1394IsSupported               :1;\r
+  UINT64  SmartBatteryIsSupported           :1;\r
+  UINT64  BiosBootSpecIsSupported           :1;\r
+  UINT64  FunctionKeyNetworkBootIsSupported :1;\r
+  UINT64  Reserved                          :22;\r
+} EFI_MISC_BIOS_CHARACTERISTICS;\r
+\r
+typedef struct {\r
+  UINT64  BiosReserved                      :16;\r
+  UINT64  SystemReserved                    :16;\r
+  UINT64  Reserved                          :32;\r
+} EFI_MISC_BIOS_CHARACTERISTICS_EXTENSION;\r
+\r
+typedef struct {\r
+  STRING_REF                      BiosVendor;\r
+  STRING_REF                      BiosVersion;\r
+  STRING_REF                      BiosReleaseDate;\r
+  EFI_PHYSICAL_ADDRESS            BiosStartingAddress;\r
+  EFI_EXP_BASE2_DATA              BiosPhysicalDeviceSize;\r
+  EFI_MISC_BIOS_CHARACTERISTICS   BiosCharacteristics1;\r
+  EFI_MISC_BIOS_CHARACTERISTICS_EXTENSION  BiosCharacteristics2;\r
+  UINT8                           BiosMajorRelease;\r
+  UINT8                           BiosMinorRelease;\r
+  UINT8                           BiosEmbeddedFirmwareMajorRelease;\r
+  UINT8                           BiosEmbeddedFirmwareMinorRelease;\r
+} EFI_MISC_BIOS_VENDOR_DATA;\r
+\r
+//\r
+//////////////////////////////////////////////////////////////////////////////\r
+//\r
+// Misc. System Manufacturer - SMBIOS Type 1\r
+//\r
+#define EFI_MISC_SYSTEM_MANUFACTURER_RECORD_NUMBER 0x00000003\r
+\r
+typedef enum {\r
+  EfiSystemWakeupTypeReserved        = 0,\r
+  EfiSystemWakeupTypeOther           = 1,\r
+  EfiSystemWakeupTypeUnknown         = 2,\r
+  EfiSystemWakeupTypeApmTimer        = 3,\r
+  EfiSystemWakeupTypeModemRing       = 4,\r
+  EfiSystemWakeupTypeLanRemote       = 5,\r
+  EfiSystemWakeupTypePowerSwitch     = 6,\r
+  EfiSystemWakeupTypePciPme          = 7,\r
+  EfiSystemWakeupTypeAcPowerRestored = 8,\r
+} EFI_MISC_SYSTEM_WAKEUP_TYPE;\r
+\r
+typedef struct {\r
+  STRING_REF                      SystemManufacturer;\r
+  STRING_REF                      SystemProductName;\r
+  STRING_REF                      SystemVersion;\r
+  STRING_REF                      SystemSerialNumber;\r
+  EFI_GUID                        SystemUuid;\r
+  EFI_MISC_SYSTEM_WAKEUP_TYPE     SystemWakeupType;\r
+  STRING_REF                      SystemSKUNumber;\r
+  STRING_REF                      SystemFamily;\r
+} EFI_MISC_SYSTEM_MANUFACTURER_DATA;\r
+\r
+//\r
+//////////////////////////////////////////////////////////////////////////////\r
+//\r
+// Misc. Base Board Manufacturer - SMBIOS Type 2\r
+//\r
+#define EFI_MISC_BASE_BOARD_MANUFACTURER_RECORD_NUMBER 0x00000004\r
+\r
+typedef struct {\r
+  UINT32  Motherboard           :1;\r
+  UINT32  RequiresDaughterCard  :1;\r
+  UINT32  Removable             :1;\r
+  UINT32  Replaceable           :1;\r
+  UINT32  HotSwappable          :1;\r
+  UINT32  Reserved              :27;\r
+} EFI_BASE_BOARD_FEATURE_FLAGS;\r
+\r
+typedef enum {\r
+  EfiBaseBoardTypeUnknown                = 1,\r
+  EfiBaseBoardTypeOther                  = 2,\r
+  EfiBaseBoardTypeServerBlade            = 3,\r
+  EfiBaseBoardTypeConnectivitySwitch     = 4,\r
+  EfiBaseBoardTypeSystemManagementModule = 5,\r
+  EfiBaseBoardTypeProcessorModule        = 6,\r
+  EfiBaseBoardTypeIOModule               = 7,\r
+  EfiBaseBoardTypeMemoryModule           = 8,\r
+  EfiBaseBoardTypeDaughterBoard          = 9,\r
+  EfiBaseBoardTypeMotherBoard            = 0xA,\r
+  EfiBaseBoardTypeProcessorMemoryModule  = 0xB,\r
+  EfiBaseBoardTypeProcessorIOModule      = 0xC,\r
+  EfiBaseBoardTypeInterconnectBoard      = 0xD,\r
+} EFI_BASE_BOARD_TYPE;\r
+\r
+typedef struct {\r
+  STRING_REF                      BaseBoardManufacturer;\r
+  STRING_REF                      BaseBoardProductName;\r
+  STRING_REF                      BaseBoardVersion;\r
+  STRING_REF                      BaseBoardSerialNumber;\r
+  STRING_REF                      BaseBoardAssetTag;\r
+  STRING_REF                      BaseBoardChassisLocation;\r
+  EFI_BASE_BOARD_FEATURE_FLAGS    BaseBoardFeatureFlags;\r
+  EFI_BASE_BOARD_TYPE             BaseBoardType;\r
+  EFI_INTER_LINK_DATA             BaseBoardChassisLink;\r
+  UINT32                          BaseBoardNumberLinks;\r
+  EFI_INTER_LINK_DATA             LinkN;\r
+} EFI_MISC_BASE_BOARD_MANUFACTURER_DATA;\r
+\r
+//\r
+//////////////////////////////////////////////////////////////////////////////\r
+//\r
+// Misc. System/Chassis Enclosure - SMBIOS Type 3\r
+//\r
+#define EFI_MISC_CHASSIS_MANUFACTURER_RECORD_NUMBER  0x00000005\r
+\r
+typedef enum {\r
+  EfiMiscChassisTypeOther               = 0x1,\r
+  EfiMiscChassisTypeUnknown             = 0x2,\r
+  EfiMiscChassisTypeDeskTop             = 0x3,\r
+  EfiMiscChassisTypeLowProfileDesktop   = 0x4,\r
+  EfiMiscChassisTypePizzaBox            = 0x5,\r
+  EfiMiscChassisTypeMiniTower           = 0x6,\r
+  EfiMiscChassisTypeTower               = 0x7,\r
+  EfiMiscChassisTypePortable            = 0x8,\r
+  EfiMiscChassisTypeLapTop              = 0x9,\r
+  EfiMiscChassisTypeNotebook            = 0xA,\r
+  EfiMiscChassisTypeHandHeld            = 0xB,\r
+  EfiMiscChassisTypeDockingStation      = 0xC,\r
+  EfiMiscChassisTypeAllInOne            = 0xD,\r
+  EfiMiscChassisTypeSubNotebook         = 0xE,\r
+  EfiMiscChassisTypeSpaceSaving         = 0xF,\r
+  EfiMiscChassisTypeLunchBox            = 0x10,\r
+  EfiMiscChassisTypeMainServerChassis   = 0x11,\r
+  EfiMiscChassisTypeExpansionChassis    = 0x12,\r
+  EfiMiscChassisTypeSubChassis          = 0x13,\r
+  EfiMiscChassisTypeBusExpansionChassis = 0x14,\r
+  EfiMiscChassisTypePeripheralChassis   = 0x15,\r
+  EfiMiscChassisTypeRaidChassis         = 0x16,\r
+  EfiMiscChassisTypeRackMountChassis    = 0x17,\r
+  EfiMiscChassisTypeSealedCasePc        = 0x18,\r
+  EfiMiscChassisMultiSystemChassis      = 0x19,\r
+} EFI_MISC_CHASSIS_TYPE;\r
+\r
+typedef struct {\r
+  UINT32  ChassisType       :16;\r
+  UINT32  ChassisLockPresent:1;\r
+  UINT32  Reserved          :15;\r
+} EFI_MISC_CHASSIS_STATUS;\r
+\r
+typedef enum {\r
+  EfiChassisStateOther           = 0x01,\r
+  EfiChassisStateUnknown         = 0x02,\r
+  EfiChassisStateSafe            = 0x03,\r
+  EfiChassisStateWarning         = 0x04,\r
+  EfiChassisStateCritical        = 0x05,\r
+  EfiChassisStateNonRecoverable  = 0x06,\r
+} EFI_MISC_CHASSIS_STATE;\r
+\r
+typedef enum {\r
+  EfiChassisSecurityStatusOther                          = 0x01,\r
+  EfiChassisSecurityStatusUnknown                        = 0x02,\r
+  EfiChassisSecurityStatusNone                           = 0x03,\r
+  EfiChassisSecurityStatusExternalInterfaceLockedOut     = 0x04,\r
+  EfiChassisSecurityStatusExternalInterfaceLockedEnabled = 0x05,\r
+} EFI_MISC_CHASSIS_SECURITY_STATE;\r
+\r
+typedef struct {\r
+  UINT32  RecordType  :1;\r
+  UINT32  Reserved    :24;\r
+} EFI_MISC_ELEMENT_TYPE;\r
+\r
+typedef struct {\r
+  EFI_MISC_ELEMENT_TYPE   ChassisElementType;\r
+  EFI_INTER_LINK_DATA     ChassisElementStructure;\r
+  EFI_BASE_BOARD_TYPE     ChassisBaseBoard;\r
+  UINT32                  ChassisElementMinimum;\r
+  UINT32                  ChassisElementMaximum;\r
+} EFI_MISC_ELEMENTS;\r
+\r
+typedef struct {\r
+  STRING_REF                      ChassisManufacturer;\r
+  STRING_REF                      ChassisVersion;\r
+  STRING_REF                      ChassisSerialNumber;\r
+  STRING_REF                      ChassisAssetTag;\r
+  EFI_MISC_CHASSIS_STATUS         ChassisType;\r
+  EFI_MISC_CHASSIS_STATE          ChassisBootupState;\r
+  EFI_MISC_CHASSIS_STATE          ChassisPowerSupplyState;\r
+  EFI_MISC_CHASSIS_STATE          ChassisThermalState;\r
+  EFI_MISC_CHASSIS_SECURITY_STATE ChassisSecurityState;\r
+  UINT32                          ChassisOemDefined;\r
+  UINT32                          ChassisHeight;\r
+  UINT32                          ChassisNumberPowerCords;\r
+  UINT32                          ChassisElementCount;\r
+  UINT32                          ChassisElementRecordLength;//\r
+  EFI_MISC_ELEMENTS               ChassisElements;\r
+} EFI_MISC_CHASSIS_MANUFACTURER_DATA;\r
+\r
+//\r
+//////////////////////////////////////////////////////////////////////////////\r
+//\r
+// Misc. Port Connector Information - SMBIOS Type 8\r
+//\r
+#define EFI_MISC_PORT_INTERNAL_CONNECTOR_DESIGNATOR_RECORD_NUMBER 0x00000006\r
+\r
+typedef enum {\r
+  EfiPortConnectorTypeNone                   = 0x00,\r
+  EfiPortConnectorTypeCentronics             = 0x01,\r
+  EfiPortConnectorTypeMiniCentronics         = 0x02,\r
+  EfiPortConnectorTypeProprietary            = 0x03,\r
+  EfiPortConnectorTypeDB25Male               = 0x04,\r
+  EfiPortConnectorTypeDB25Female             = 0x05,\r
+  EfiPortConnectorTypeDB15Male               = 0x06,\r
+  EfiPortConnectorTypeDB15Female             = 0x07,\r
+  EfiPortConnectorTypeDB9Male                = 0x08,\r
+  EfiPortConnectorTypeDB9Female              = 0x09,\r
+  EfiPortConnectorTypeRJ11                   = 0x0A,\r
+  EfiPortConnectorTypeRJ45                   = 0x0B,\r
+  EfiPortConnectorType50PinMiniScsi          = 0x0C,\r
+  EfiPortConnectorTypeMiniDin                = 0x0D,\r
+  EfiPortConnectorTypeMicriDin               = 0x0E,\r
+  EfiPortConnectorTypePS2                    = 0x0F,\r
+  EfiPortConnectorTypeInfrared               = 0x10,\r
+  EfiPortConnectorTypeHpHil                  = 0x11,\r
+  EfiPortConnectorTypeUsb                    = 0x12,\r
+  EfiPortConnectorTypeSsaScsi                = 0x13,\r
+  EfiPortConnectorTypeCircularDin8Male       = 0x14,\r
+  EfiPortConnectorTypeCircularDin8Female     = 0x15,\r
+  EfiPortConnectorTypeOnboardIde             = 0x16,\r
+  EfiPortConnectorTypeOnboardFloppy          = 0x17,\r
+  EfiPortConnectorType9PinDualInline         = 0x18,\r
+  EfiPortConnectorType25PinDualInline        = 0x19,\r
+  EfiPortConnectorType50PinDualInline        = 0x1A,\r
+  EfiPortConnectorType68PinDualInline        = 0x1B,\r
+  EfiPortConnectorTypeOnboardSoundInput      = 0x1C,\r
+  EfiPortConnectorTypeMiniCentronicsType14   = 0x1D,\r
+  EfiPortConnectorTypeMiniCentronicsType26   = 0x1E,\r
+  EfiPortConnectorTypeHeadPhoneMiniJack      = 0x1F,\r
+  EfiPortConnectorTypeBNC                    = 0x20,\r
+  EfiPortConnectorType1394                   = 0x21,\r
+  EfiPortConnectorTypePC98                   = 0xA0,\r
+  EfiPortConnectorTypePC98Hireso             = 0xA1,\r
+  EfiPortConnectorTypePCH98                  = 0xA2,\r
+  EfiPortConnectorTypePC98Note               = 0xA3,\r
+  EfiPortConnectorTypePC98Full               = 0xA4,\r
+  EfiPortConnectorTypeOther                  = 0xFF,\r
+} EFI_MISC_PORT_CONNECTOR_TYPE;\r
+\r
+typedef enum {\r
+  EfiPortTypeNone                      = 0x00,\r
+  EfiPortTypeParallelXtAtCompatible    = 0x01,\r
+  EfiPortTypeParallelPortPs2           = 0x02,\r
+  EfiPortTypeParallelPortEcp           = 0x03,\r
+  EfiPortTypeParallelPortEpp           = 0x04,\r
+  EfiPortTypeParallelPortEcpEpp        = 0x05,\r
+  EfiPortTypeSerialXtAtCompatible      = 0x06,\r
+  EfiPortTypeSerial16450Compatible     = 0x07,\r
+  EfiPortTypeSerial16550Compatible     = 0x08,\r
+  EfiPortTypeSerial16550ACompatible    = 0x09,\r
+  EfiPortTypeScsi                      = 0x0A,\r
+  EfiPortTypeMidi                      = 0x0B,\r
+  EfiPortTypeJoyStick                  = 0x0C,\r
+  EfiPortTypeKeyboard                  = 0x0D,\r
+  EfiPortTypeMouse                     = 0x0E,\r
+  EfiPortTypeSsaScsi                   = 0x0F,\r
+  EfiPortTypeUsb                       = 0x10,\r
+  EfiPortTypeFireWire                  = 0x11,\r
+  EfiPortTypePcmciaTypeI               = 0x12,\r
+  EfiPortTypePcmciaTypeII              = 0x13,\r
+  EfiPortTypePcmciaTypeIII             = 0x14,\r
+  EfiPortTypeCardBus                   = 0x15,\r
+  EfiPortTypeAccessBusPort             = 0x16,\r
+  EfiPortTypeScsiII                    = 0x17,\r
+  EfiPortTypeScsiWide                  = 0x18,\r
+  EfiPortTypePC98                      = 0x19,\r
+  EfiPortTypePC98Hireso                = 0x1A,\r
+  EfiPortTypePCH98                     = 0x1B,\r
+  EfiPortTypeVideoPort                 = 0x1C,\r
+  EfiPortTypeAudioPort                 = 0x1D,\r
+  EfiPortTypeModemPort                 = 0x1E,\r
+  EfiPortTypeNetworkPort               = 0x1F,\r
+  EfiPortType8251Compatible            = 0xA0,\r
+  EfiPortType8251FifoCompatible        = 0xA1,\r
+  EfiPortTypeOther                     = 0xFF,\r
+} EFI_MISC_PORT_TYPE;\r
+\r
+typedef struct {\r
+  STRING_REF                    PortInternalConnectorDesignator;\r
+  STRING_REF                    PortExternalConnectorDesignator;\r
+  EFI_MISC_PORT_CONNECTOR_TYPE  PortInternalConnectorType;\r
+  EFI_MISC_PORT_CONNECTOR_TYPE  PortExternalConnectorType;\r
+  EFI_MISC_PORT_TYPE            PortType;\r
+  EFI_MISC_PORT_DEVICE_PATH     PortPath;\r
+} EFI_MISC_PORT_INTERNAL_CONNECTOR_DESIGNATOR_DATA;\r
+\r
+//\r
+//////////////////////////////////////////////////////////////////////////////\r
+//\r
+// Misc. System Slots - SMBIOS Type 9\r
+//\r
+#define EFI_MISC_SYSTEM_SLOT_DESIGNATION_RECORD_NUMBER 0x00000007\r
+\r
+typedef enum {\r
+  EfiSlotTypeOther                        = 0x01,\r
+  EfiSlotTypeUnknown                      = 0x02,\r
+  EfiSlotTypeIsa                          = 0x03,\r
+  EfiSlotTypeMca                          = 0x04,\r
+  EfiSlotTypeEisa                         = 0x05,\r
+  EfiSlotTypePci                          = 0x06,\r
+  EfiSlotTypePcmcia                       = 0x07,\r
+  EfiSlotTypeVlVesa                       = 0x08,\r
+  EfiSlotTypeProprietary                  = 0x09,\r
+  EfiSlotTypeProcessorCardSlot            = 0x0A,\r
+  EfiSlotTypeProprietaryMemoryCardSlot    = 0x0B,\r
+  EfiSlotTypeIORiserCardSlot              = 0x0C,\r
+  EfiSlotTypeNuBus                        = 0x0D,\r
+  EfiSlotTypePci66MhzCapable              = 0x0E,\r
+  EfiSlotTypeAgp                          = 0x0F,\r
+  EfiSlotTypeApg2X                        = 0x10,\r
+  EfiSlotTypeAgp4X                        = 0x11,\r
+  EfiSlotTypePciX                         = 0x12,\r
+  EfiSlotTypeAgp4x                        = 0x13,\r
+  EfiSlotTypePC98C20                      = 0xA0,\r
+  EfiSlotTypePC98C24                      = 0xA1,\r
+  EfiSlotTypePC98E                        = 0xA2,\r
+  EfiSlotTypePC98LocalBus                 = 0xA3,\r
+  EfiSlotTypePC98Card                     = 0xA4,\r
+  EfiSlotTypePciExpress                   = 0xA5\r
+} EFI_MISC_SLOT_TYPE;\r
+\r
+typedef enum {\r
+  EfiSlotDataBusWidthOther      = 0x01,\r
+  EfiSlotDataBusWidthUnknown    = 0x02,\r
+  EfiSlotDataBusWidth8Bit       = 0x03,\r
+  EfiSlotDataBusWidth16Bit      = 0x04,\r
+  EfiSlotDataBusWidth32Bit      = 0x05,\r
+  EfiSlotDataBusWidth64Bit      = 0x06,\r
+  EfiSlotDataBusWidth128Bit     = 0x07,\r
+} EFI_MISC_SLOT_DATA_BUS_WIDTH;\r
+\r
+typedef enum {\r
+  EfiSlotUsageOther     = 1,\r
+  EfiSlotUsageUnknown   = 2,\r
+  EfiSlotUsageAvailable = 3,\r
+  EfiSlotUsageInUse     = 4,\r
+} EFI_MISC_SLOT_USAGE;\r
+\r
+typedef enum {\r
+  EfiSlotLengthOther   = 1,\r
+  EfiSlotLengthUnknown = 2,\r
+  EfiSlotLengthShort   = 3,\r
+  EfiSlotLengthLong    = 4\r
+} EFI_MISC_SLOT_LENGTH;\r
+\r
+typedef struct {\r
+  UINT32  CharacteristicsUnknown  :1;\r
+  UINT32  Provides50Volts         :1;\r
+  UINT32  Provides33Volts         :1;\r
+  UINT32  SharedSlot              :1;\r
+  UINT32  PcCard16Supported       :1;\r
+  UINT32  CardBusSupported        :1;\r
+  UINT32  ZoomVideoSupported      :1;\r
+  UINT32  ModemRingResumeSupported:1;\r
+  UINT32  PmeSignalSupported      :1;\r
+  UINT32  HotPlugDevicesSupported :1;\r
+  UINT32  SmbusSignalSupported    :1;\r
+  UINT32  Reserved                :21;\r
+} EFI_MISC_SLOT_CHARACTERISTICS;\r
+\r
+typedef struct {\r
+  STRING_REF                    SlotDesignation;\r
+  EFI_MISC_SLOT_TYPE            SlotType;\r
+  EFI_MISC_SLOT_DATA_BUS_WIDTH  SlotDataBusWidth;\r
+  EFI_MISC_SLOT_USAGE           SlotUsage;\r
+  EFI_MISC_SLOT_LENGTH          SlotLength;\r
+  UINT16                        SlotId;\r
+  EFI_MISC_SLOT_CHARACTERISTICS SlotCharacteristics;\r
+  EFI_DEVICE_PATH_PROTOCOL      SlotDevicePath;\r
+} EFI_MISC_SYSTEM_SLOT_DESIGNATION_DATA;\r
+\r
+//\r
+//////////////////////////////////////////////////////////////////////////////\r
+//\r
+// Misc. Onboard Device - SMBIOS Type 10\r
+//\r
+#define EFI_MISC_ONBOARD_DEVICE_RECORD_NUMBER 0x00000008\r
+\r
+typedef enum {\r
+  EfiOnBoardDeviceTypeOther          = 1,\r
+  EfiOnBoardDeviceTypeUnknown        = 2,\r
+  EfiOnBoardDeviceTypeVideo          = 3,\r
+  EfiOnBoardDeviceTypeScsiController = 4,\r
+  EfiOnBoardDeviceTypeEthernet       = 5,\r
+  EfiOnBoardDeviceTypeTokenRing      = 6,\r
+  EfiOnBoardDeviceTypeSound          = 7,\r
+} EFI_MISC_ONBOARD_DEVICE_TYPE;\r
+\r
+typedef struct {\r
+  UINT32  DeviceType    :16;\r
+  UINT32  DeviceEnabled :1;\r
+  UINT32  Reserved      :15;\r
+} EFI_MISC_ONBOARD_DEVICE_STATUS;\r
+\r
+typedef struct {\r
+  STRING_REF                           OnBoardDeviceDescription;\r
+  EFI_MISC_ONBOARD_DEVICE_STATUS       OnBoardDeviceStatus;\r
+  EFI_DEVICE_PATH_PROTOCOL             OnBoardDevicePath;\r
+} EFI_MISC_ONBOARD_DEVICE_DATA;\r
+\r
+//\r
+//////////////////////////////////////////////////////////////////////////////\r
+//\r
+// Misc. BIOS Language Information - SMBIOS Type 11\r
+//\r
+#define EFI_MISC_OEM_STRING_RECORD_NUMBER 0x00000009\r
+\r
+typedef struct {\r
+  STRING_REF                          OemStringRef[1];\r
+} EFI_MISC_OEM_STRING_DATA;\r
+\r
+//\r
+//////////////////////////////////////////////////////////////////////////////\r
+//\r
+// Misc. System Options - SMBIOS Type 12\r
+//\r
+typedef struct {\r
+  STRING_REF                          SystemOptionStringRef[1];\r
+} EFI_MISC_SYSTEM_OPTION_STRING_DATA;\r
+\r
+#define EFI_MISC_SYSTEM_OPTION_STRING_RECORD_NUMBER 0x0000000A\r
+\r
+//\r
+//////////////////////////////////////////////////////////////////////////////\r
+//\r
+// Misc. Number of Installable Languages - SMBIOS Type 13\r
+//\r
+#define EFI_MISC_NUMBER_OF_INSTALLABLE_LANGUAGES_RECORD_NUMBER 0x0000000B\r
+\r
+typedef struct {\r
+  UINT32                              AbbreviatedLanguageFormat :1;\r
+  UINT32                              Reserved                  :31;\r
+} EFI_MISC_LANGUAGE_FLAGS;\r
+\r
+typedef struct {\r
+  UINT16                              NumberOfInstallableLanguages;\r
+  EFI_MISC_LANGUAGE_FLAGS             LanguageFlags;\r
+  UINT16                              CurrentLanguageNumber;\r
+} EFI_MISC_NUMBER_OF_INSTALLABLE_LANGUAGES_DATA;\r
+\r
+//\r
+//////////////////////////////////////////////////////////////////////////////\r
+//\r
+// Misc. System Language String\r
+//\r
+#define EFI_MISC_SYSTEM_LANGUAGE_STRING_RECORD_NUMBER 0x0000000C\r
+\r
+typedef struct {\r
+  UINT16                              LanguageId;\r
+  STRING_REF                          SystemLanguageString;\r
+} EFI_MISC_SYSTEM_LANGUAGE_STRING_DATA;\r
+\r
+//\r
+//////////////////////////////////////////////////////////////////////////////\r
+//\r
+// Group Associations - SMBIOS Type 14\r
+//\r
+#define EFI_MISC_GROUP_NAME_RECORD_NUMBER          0x0000000D\r
+\r
+typedef struct {\r
+  STRING_REF               GroupName;\r
+  UINT16                   NumberGroupItems;\r
+  UINT16                   GroupId;\r
+} EFI_MISC_GROUP_NAME_DATA;\r
+\r
+//\r
+//////////////////////////////////////////////////////////////////////////////\r
+//\r
+// Group Item Set Element\r
+//\r
+#define EFI_MISC_GROUP_ITEM_SET_RECORD_NUMBER      0x0000000E\r
+\r
+typedef struct {\r
+  EFI_GUID                 SubClass;\r
+  EFI_INTER_LINK_DATA      GroupLink;\r
+  UINT16                   GroupId;\r
+  UINT16                   GroupElementId;\r
+} EFI_MISC_GROUP_ITEM_SET_DATA;\r
+\r
+//  Misc. System Event Log  - SMBIOS Type 15\r
+//\r
+#define EFI_MISC_SYSTEM_EVENT_LOG_RECORD_NUMBER 0x0000000D\r
+typedef struct {\r
+  UINT16                LogAreaLength;\r
+  UINT16                LogHeaderStartOffset;\r
+  UINT16                LogDataStartOffset;\r
+  UINT8                 AccessMethod;\r
+  UINT8                 LogStatus;\r
+  UINT32                LogChangeToken;\r
+  UINT32                AccessMethodAddress;\r
+  UINT8                 LogHeaderFormat;\r
+  UINT8                 NumberOfSupportedLogType;\r
+  UINT8                 LengthOfLogDescriptor;\r
+} EFI_MISC_SYSTEM_EVENT_LOG_DATA;\r
+\r
+//\r
+// Access Method.\r
+//  0x00~0x04:  as following definition\r
+//  0x05~0x7f:  Available for future assignment.\r
+//  0x80~0xff:  BIOS Vendor/OEM-specific.\r
+//\r
+#define ACCESS_INDEXIO_1INDEX8BIT_DATA8BIT    0x00\r
+#define ACCESS_INDEXIO_2INDEX8BIT_DATA8BIT    0X01\r
+#define ACCESS_INDEXIO_1INDEX16BIT_DATA8BIT   0X02\r
+#define ACCESS_MEMORY_MAPPED                  0x03\r
+#define ACCESS_GPNV                           0x04\r
+\r
+//\r
+//////////////////////////////////////////////////////////////////////////////\r
+//\r
+//  Misc. Pointing Device Type - SMBIOS Type 21\r
+//\r
+#define EFI_MISC_POINTING_DEVICE_TYPE_RECORD_NUMBER 0x0000000F\r
+\r
+typedef enum {\r
+  EfiPointingDeviceTypeOther         = 0x01,\r
+  EfiPointingDeviceTypeUnknown       = 0x02,\r
+  EfiPointingDeviceTypeMouse         = 0x03,\r
+  EfiPointingDeviceTypeTrackBall     = 0x04,\r
+  EfiPointingDeviceTypeTrackPoint    = 0x05,\r
+  EfiPointingDeviceTypeGlidePoint    = 0x06,\r
+  EfiPointingDeviceTouchPad          = 0x07,\r
+  EfiPointingDeviceTouchScreen       = 0x08,\r
+  EfiPointingDeviceOpticalSensor     = 0x09,\r
+} EFI_MISC_POINTING_DEVICE_TYPE;\r
+\r
+typedef enum {\r
+  EfiPointingDeviceInterfaceOther              = 0x01,\r
+  EfiPointingDeviceInterfaceUnknown            = 0x02,\r
+  EfiPointingDeviceInterfaceSerial             = 0x03,\r
+  EfiPointingDeviceInterfacePs2                = 0x04,\r
+  EfiPointingDeviceInterfaceInfrared           = 0x05,\r
+  EfiPointingDeviceInterfaceHpHil              = 0x06,\r
+  EfiPointingDeviceInterfaceBusMouse           = 0x07,\r
+  EfiPointingDeviceInterfaceADB                = 0x08,\r
+  EfiPointingDeviceInterfaceBusMouseDB9        = 0xA0,\r
+  EfiPointingDeviceInterfaceBusMouseMicroDin   = 0xA1,\r
+  EfiPointingDeviceInterfaceUsb                = 0xA2,\r
+} EFI_MISC_POINTING_DEVICE_INTERFACE;\r
+\r
+typedef struct {\r
+  EFI_MISC_POINTING_DEVICE_TYPE       PointingDeviceType;\r
+  EFI_MISC_POINTING_DEVICE_INTERFACE  PointingDeviceInterface;\r
+  UINT16                              NumberPointingDeviceButtons;\r
+  EFI_DEVICE_PATH_PROTOCOL            PointingDevicePath;\r
+} EFI_MISC_PORTING_DEVICE_TYPE_DATA;\r
+\r
+//\r
+//////////////////////////////////////////////////////////////////////////////\r
+//\r
+// Portable Battery - SMBIOS Type 22\r
+//\r
+#define EFI_MISC_BATTERY_LOCATION_RECORD_NUMBER  0x00000010\r
+\r
+typedef enum {\r
+  EfiBatteryDeviceChemistryTypeOther               = 0x01,\r
+  EfiBatteryDeviceChemistryTypeUnknown             = 0x02,\r
+  EfiBatteryDeviceChemistryTypeLeadAcid            = 0x03,\r
+  EfiBatteryDeviceChemistryTypeNickelCadmium       = 0x04,\r
+  EfiBatteryDeviceChemistryTypeNickelMetalHydride  = 0x05,\r
+  EfiBatteryDeviceChemistryTypeLithiumIon          = 0x06,\r
+  EfiBatteryDeviceChemistryTypeZincAir             = 0x07,\r
+  EfiBatteryDeviceChemistryTypeLithiumPolymer      = 0x08,\r
+} EFI_MISC_BATTERY_DEVICE_CHEMISTRY;\r
+\r
+typedef struct  {\r
+  UINT32 Date              :5;\r
+  UINT32 Month             :4;\r
+  UINT32 Year              :7;\r
+  UINT32 Reserved          :16;\r
+} EFI_MISC_BATTERY_SBDS_MANUFACTURE_DATE;\r
+\r
+typedef struct {\r
+  STRING_REF                         BatteryLocation;\r
+  STRING_REF                         BatteryManufacturer;\r
+  STRING_REF                         BatteryManufactureDate;\r
+  STRING_REF                         BatterySerialNumber;\r
+  STRING_REF                         BatteryDeviceName;\r
+  STRING_REF                         BatterySbdsVersionNumber;\r
+  STRING_REF                         BatterySbdsDeviceChemistry;\r
+  EFI_MISC_BATTERY_DEVICE_CHEMISTRY  BatteryDeviceChemistry;\r
+  EFI_EXP_BASE10_DATA                BatteryDesignCapacity;\r
+  EFI_EXP_BASE10_DATA                BatteryDesignVoltage;\r
+  UINT16                             BatteryMaximumError;\r
+  UINT16                             BatterySbdsSerialNumber;\r
+  EFI_MISC_BATTERY_SBDS_MANUFACTURE_DATE\r
+                                     BatterySbdsManufacturingDate;\r
+  UINT32                             BatteryOemSpecific;\r
+} EFI_MISC_BATTERY_LOCATION_DATA;\r
+\r
+//\r
+//////////////////////////////////////////////////////////////////////////////\r
+//\r
+// Misc. Reset Capabilities - SMBIOS Type 23\r
+//\r
+#define EFI_MISC_RESET_CAPABILITIES_RECORD_NUMBER 0x00000011\r
+\r
+typedef struct {\r
+  UINT32  Status              :1;\r
+  UINT32  BootOption          :2;\r
+  UINT32  BootOptionOnLimit   :2;\r
+  UINT32  WatchdogTimerPresent:1;\r
+  UINT32  Reserved            :26;\r
+} EFI_MISC_RESET_CAPABILITIES_TYPE;\r
+\r
+typedef struct {\r
+  EFI_MISC_RESET_CAPABILITIES_TYPE  ResetCapabilities;\r
+  UINT16                            ResetCount;\r
+  UINT16                            ResetLimit;\r
+  UINT16                            ResetTimerInterval;\r
+  UINT16                            ResetTimeout;\r
+} EFI_MISC_RESET_CAPABILITIES;\r
+\r
+typedef struct {\r
+    EFI_MISC_RESET_CAPABILITIES   ResetCapabilities;\r
+    UINT16                        ResetCount;\r
+    UINT16                        ResetLimit;\r
+    UINT16                        ResetTimerInterval;\r
+    UINT16                        ResetTimeout;\r
+} EFI_MISC_RESET_CAPABILITIES_DATA;\r
+\r
+//\r
+//////////////////////////////////////////////////////////////////////////////\r
+//\r
+// Misc. Hardware Security - SMBIOS Type 24\r
+//\r
+#define EFI_MISC_HARDWARE_SECURITY_RECORD_NUMBER 0x00000012\r
+\r
+typedef enum {\r
+  EfiHardwareSecurityStatusDisabled       = 0,\r
+  EfiHardwareSecurityStatusEnabled        = 1,\r
+  EfiHardwareSecurityStatusNotImplemented = 2,\r
+  EfiHardwareSecurityStatusUnknown        = 3\r
+} EFI_MISC_HARDWARE_SECURITY_STATUS;\r
+\r
+typedef struct {\r
+  EFI_MISC_HARDWARE_SECURITY_STATUS   FrontPanelResetStatus       :2;\r
+  EFI_MISC_HARDWARE_SECURITY_STATUS   AdministratorPasswordStatus :2;\r
+  EFI_MISC_HARDWARE_SECURITY_STATUS   KeyboardPasswordStatus      :2;\r
+  EFI_MISC_HARDWARE_SECURITY_STATUS   PowerOnPasswordStatus       :2;\r
+  EFI_MISC_HARDWARE_SECURITY_STATUS   Reserved                    :24;\r
+} EFI_MISC_HARDWARE_SECURITY_SETTINGS;\r
+\r
+typedef struct {\r
+  EFI_MISC_HARDWARE_SECURITY_SETTINGS HardwareSecuritySettings;\r
+} EFI_MISC_HARDWARE_SECURITY_SETTINGS_DATA;\r
+\r
+//\r
+//////////////////////////////////////////////////////////////////////////////\r
+//\r
+// System Power Controls - SMBIOS Type 25\r
+//\r
+#define EFI_MISC_SCHEDULED_POWER_ON_MONTH_RECORD_NUMBER  0x00000013\r
+\r
+typedef struct {\r
+  UINT16             ScheduledPoweronMonth;\r
+  UINT16             ScheduledPoweronDayOfMonth;\r
+  UINT16             ScheduledPoweronHour;\r
+  UINT16             ScheduledPoweronMinute;\r
+  UINT16             ScheduledPoweronSecond;\r
+} EFI_MISC_SCHEDULED_POWER_ON_MONTH_DATA;\r
+\r
+//\r
+//////////////////////////////////////////////////////////////////////////////\r
+//\r
+// Voltage Probe - SMBIOS Type 26\r
+//\r
+#define EFI_MISC_VOLTAGE_PROBE_DESCRIPTION_RECORD_NUMBER  0x00000014\r
+\r
+typedef struct {\r
+  UINT32 VoltageProbeSite        :5;\r
+  UINT32 VoltageProbeStatus      :3;\r
+  UINT32 Reserved                :24;\r
+} EFI_MISC_VOLTAGE_PROBE_LOCATION;\r
+\r
+typedef struct {\r
+  STRING_REF                      VoltageProbeDescription;\r
+  EFI_MISC_VOLTAGE_PROBE_LOCATION VoltageProbeLocation;\r
+  EFI_EXP_BASE10_DATA             VoltageProbeMaximumValue;\r
+  EFI_EXP_BASE10_DATA             VoltageProbeMinimumValue;\r
+  EFI_EXP_BASE10_DATA             VoltageProbeResolution;\r
+  EFI_EXP_BASE10_DATA             VoltageProbeTolerance;\r
+  EFI_EXP_BASE10_DATA             VoltageProbeAccuracy;\r
+  EFI_EXP_BASE10_DATA             VoltageProbeNominalValue;\r
+  EFI_EXP_BASE10_DATA             MDLowerNoncriticalThreshold;\r
+  EFI_EXP_BASE10_DATA             MDUpperNoncriticalThreshold;\r
+  EFI_EXP_BASE10_DATA             MDLowerCriticalThreshold;\r
+  EFI_EXP_BASE10_DATA             MDUpperCriticalThreshold;\r
+  EFI_EXP_BASE10_DATA             MDLowerNonrecoverableThreshold;\r
+  EFI_EXP_BASE10_DATA             MDUpperNonrecoverableThreshold;\r
+  UINT32                          VoltageProbeOemDefined;\r
+} EFI_MISC_VOLTAGE_PROBE_DESCRIPTION_DATA;\r
+\r
+//\r
+//////////////////////////////////////////////////////////////////////////////\r
+//\r
+// Cooling Device - SMBIOS Type 27\r
+//\r
+#define EFI_MISC_COOLING_DEVICE_TEMP_LINK_RECORD_NUMBER   0x00000015\r
+\r
+typedef struct {\r
+  UINT32 CoolingDevice                 :5;\r
+  UINT32 CoolingDeviceStatus           :3;\r
+  UINT32 Reserved                      :24;\r
+} EFI_MISC_COOLING_DEVICE_TYPE;\r
+\r
+typedef struct {\r
+  EFI_MISC_COOLING_DEVICE_TYPE   CoolingDeviceType;\r
+  EFI_INTER_LINK_DATA            CoolingDeviceTemperatureLink;\r
+  UINT16                         CoolingDeviceUnitGroup;\r
+  EFI_EXP_BASE10_DATA            CoolingDeviceNominalSpeed;\r
+  UINT32                         CoolingDeviceOemDefined;\r
+} EFI_MISC_COOLING_DEVICE_TEMP_LINK_DATA;\r
+\r
+//\r
+//////////////////////////////////////////////////////////////////////////////\r
+//\r
+// Temperature Probe - SMBIOS Type 28\r
+//\r
+#define EFI_MISC_TEMPERATURE_PROBE_DESCRIPTION_RECORD_NUMBER   0x00000016\r
+\r
+typedef struct {\r
+  UINT32 TemperatureProbeSite          :5;\r
+  UINT32 TemperatureProbeStatus        :3;\r
+  UINT32 Reserved                      :24;\r
+} EFI_MISC_TEMPERATURE_PROBE_LOCATION;\r
+\r
+typedef struct {\r
+  STRING_REF               TemperatureProbeDescription;\r
+  EFI_MISC_TEMPERATURE_PROBE_LOCATION\r
+                           TemperatureProbeLocation;\r
+  EFI_EXP_BASE10_DATA      TemperatureProbeMaximumValue;\r
+  EFI_EXP_BASE10_DATA      TemperatureProbeMinimumValue;\r
+  EFI_EXP_BASE10_DATA      TemperatureProbeResolution;\r
+  EFI_EXP_BASE10_DATA      TemperatureProbeTolerance;\r
+  EFI_EXP_BASE10_DATA      TemperatureProbeAccuracy;\r
+  EFI_EXP_BASE10_DATA      TemperatureProbeNominalValue;\r
+  EFI_EXP_BASE10_DATA      MDLowerNoncriticalThreshold;\r
+  EFI_EXP_BASE10_DATA      MDUpperNoncriticalThreshold;\r
+  EFI_EXP_BASE10_DATA      MDLowerCriticalThreshold;\r
+  EFI_EXP_BASE10_DATA      MDUpperCriticalThreshold;\r
+  EFI_EXP_BASE10_DATA      MDLowerNonrecoverableThreshold;\r
+  EFI_EXP_BASE10_DATA      MDUpperNonrecoverableThreshold;\r
+  UINT32                   TemperatureProbeOemDefined;\r
+} EFI_MISC_TEMPERATURE_PROBE_DESCRIPTION_DATA;\r
+\r
+//\r
+//////////////////////////////////////////////////////////////////////////////\r
+//\r
+// Electrical Current Probe - SMBIOS Type 29\r
+//\r
+\r
+#define EFI_MISC_ELECTRICAL_CURRENT_PROBE_DESCRIPTION_RECORD_NUMBER  0x00000017\r
+\r
+typedef struct {\r
+  UINT32 ElectricalCurrentProbeSite    :5;\r
+  UINT32 ElectricalCurrentProbeStatus  :3;\r
+  UINT32 Reserved                      :24;\r
+} EFI_MISC_ELECTRICAL_CURRENT_PROBE_LOCATION;\r
+\r
+typedef struct {\r
+  STRING_REF               ElectricalCurrentProbeDescription;\r
+  EFI_MISC_ELECTRICAL_CURRENT_PROBE_LOCATION\r
+                           ElectricalCurrentProbeLocation;\r
+  EFI_EXP_BASE10_DATA      ElectricalCurrentProbeMaximumValue;\r
+  EFI_EXP_BASE10_DATA      ElectricalCurrentProbeMinimumValue;\r
+  EFI_EXP_BASE10_DATA      ElectricalCurrentProbeResolution;\r
+  EFI_EXP_BASE10_DATA      ElectricalCurrentProbeTolerance;\r
+  EFI_EXP_BASE10_DATA      ElectricalCurrentProbeAccuracy;\r
+  EFI_EXP_BASE10_DATA      ElectricalCurrentProbeNominalValue;\r
+  EFI_EXP_BASE10_DATA      MDLowerNoncriticalThreshold;\r
+  EFI_EXP_BASE10_DATA      MDUpperNoncriticalThreshold;\r
+  EFI_EXP_BASE10_DATA      MDLowerCriticalThreshold;\r
+  EFI_EXP_BASE10_DATA      MDUpperCriticalThreshold;\r
+  EFI_EXP_BASE10_DATA      MDLowerNonrecoverableThreshold;\r
+  EFI_EXP_BASE10_DATA      MDUpperNonrecoverableThreshold;\r
+  UINT32                   ElectricalCurrentProbeOemDefined;\r
+} EFI_MISC_ELECTRICAL_CURRENT_PROBE_DESCRIPTION_DATA;\r
+\r
+//\r
+//////////////////////////////////////////////////////////////////////////////\r
+//\r
+// Out-of-Band Remote Access - SMBIOS Type 30\r
+//\r
+\r
+#define EFI_MISC_REMOTE_ACCESS_MANUFACTURER_DESCRIPTION_RECORD_NUMBER  0x00000018\r
+\r
+typedef struct  {\r
+  UINT32 InboundConnectionEnabled            :1;\r
+  UINT32 OutboundConnectionEnabled           :1;\r
+  UINT32 Reserved                            :30;\r
+} EFI_MISC_REMOTE_ACCESS_CONNECTIONS;\r
+\r
+typedef struct {\r
+  STRING_REF                             RemoteAccessManufacturerNameDescription;\r
+  EFI_MISC_REMOTE_ACCESS_CONNECTIONS     RemoteAccessConnections;\r
+} EFI_MISC_REMOTE_ACCESS_MANUFACTURER_DESCRIPTION_DATA;\r
+\r
+//\r
+//////////////////////////////////////////////////////////////////////////////\r
+//\r
+// Misc. BIS Entry Point - SMBIOS Type 31\r
+//\r
+#define EFI_MISC_BIS_ENTRY_POINT_RECORD_NUMBER          0x00000019\r
+\r
+typedef struct {\r
+  EFI_PHYSICAL_ADDRESS       BisEntryPoint;\r
+} EFI_MISC_BIS_ENTRY_POINT_DATA;\r
+\r
+//\r
+//////////////////////////////////////////////////////////////////////////////\r
+//\r
+// Misc. Boot Information - SMBIOS Type 32\r
+//\r
+#define EFI_MISC_BOOT_INFORMATION_STATUS_RECORD_NUMBER  0x0000001A\r
+\r
+typedef enum {\r
+  EfiBootInformationStatusNoError                  = 0x00,\r
+  EfiBootInformationStatusNoBootableMedia          = 0x01,\r
+  EfiBootInformationStatusNormalOSFailedLoading    = 0x02,\r
+  EfiBootInformationStatusFirmwareDetectedFailure  = 0x03,\r
+  EfiBootInformationStatusOSDetectedFailure        = 0x04,\r
+  EfiBootInformationStatusUserRequestedBoot        = 0x05,\r
+  EfiBootInformationStatusSystemSecurityViolation  = 0x06,\r
+  EfiBootInformationStatusPreviousRequestedImage   = 0x07,\r
+  EfiBootInformationStatusWatchdogTimerExpired     = 0x08,\r
+  EfiBootInformationStatusStartReserved            = 0x09,\r
+  EfiBootInformationStatusStartOemSpecific         = 0x80,\r
+  EfiBootInformationStatusStartProductSpecific     = 0xC0,\r
+} EFI_MISC_BOOT_INFORMATION_STATUS_DATA_TYPE;\r
+\r
+typedef struct {\r
+  EFI_MISC_BOOT_INFORMATION_STATUS_DATA_TYPE BootInformationStatus;\r
+  UINT8                                      BootInformationData[9];\r
+} EFI_MISC_BOOT_INFORMATION_STATUS_DATA;\r
+\r
+//\r
+//////////////////////////////////////////////////////////////////////////////\r
+//\r
+// Management Device - SMBIOS Type 34\r
+//\r
+#define EFI_MISC_MANAGEMENT_DEVICE_DESCRIPTION_RECORD_NUMBER   0x0000001B\r
+\r
+typedef enum {\r
+  EfiManagementDeviceTypeOther      = 0x01,\r
+  EfiManagementDeviceTypeUnknown    = 0x02,\r
+  EfiManagementDeviceTypeLm75       = 0x03,\r
+  EfiManagementDeviceTypeLm78       = 0x04,\r
+  EfiManagementDeviceTypeLm79       = 0x05,\r
+  EfiManagementDeviceTypeLm80       = 0x06,\r
+  EfiManagementDeviceTypeLm81       = 0x07,\r
+  EfiManagementDeviceTypeAdm9240    = 0x08,\r
+  EfiManagementDeviceTypeDs1780     = 0x09,\r
+  EfiManagementDeviceTypeMaxim1617  = 0x0A,\r
+  EfiManagementDeviceTypeGl518Sm    = 0x0B,\r
+  EfiManagementDeviceTypeW83781D    = 0x0C,\r
+  EfiManagementDeviceTypeHt82H791   = 0x0D,\r
+} EFI_MISC_MANAGEMENT_DEVICE_TYPE;\r
+\r
+typedef enum {\r
+  EfiManagementDeviceAddressTypeOther   = 1,\r
+  EfiManagementDeviceAddressTypeUnknown = 2,\r
+  EfiManagementDeviceAddressTypeIOPort  = 3,\r
+  EfiManagementDeviceAddressTypeMemory  = 4,\r
+  EfiManagementDeviceAddressTypeSmbus   = 5\r
+} EFI_MISC_MANAGEMENT_DEVICE_ADDRESS_TYPE;\r
+\r
+typedef struct {\r
+  STRING_REF                       ManagementDeviceDescription;\r
+  EFI_MISC_MANAGEMENT_DEVICE_TYPE  ManagementDeviceType;\r
+  UINTN                            ManagementDeviceAddress;\r
+  EFI_MISC_MANAGEMENT_DEVICE_ADDRESS_TYPE\r
+                                   ManagementDeviceAddressType;\r
+} EFI_MISC_MANAGEMENT_DEVICE_DESCRIPTION_DATA;\r
+\r
+//\r
+//////////////////////////////////////////////////////////////////////////////\r
+//\r
+// Management Device Component - SMBIOS Type 35\r
+//\r
+\r
+#define EFI_MISC_MANAGEMENT_DEVICE_COMPONENT_DESCRIPTION_RECORD_NUMBER  0x0000001C\r
+\r
+typedef struct {\r
+  STRING_REF               ManagementDeviceComponentDescription;\r
+  EFI_INTER_LINK_DATA      ManagementDeviceLink;\r
+  EFI_INTER_LINK_DATA      ManagementDeviceComponentLink;\r
+} EFI_MISC_MANAGEMENT_DEVICE_COMPONENT_DESCRIPTION_DATA;\r
+\r
+//\r
+//////////////////////////////////////////////////////////////////////////////\r
+//\r
+// IPMI Data Record - SMBIOS Type 38\r
+//\r
+typedef enum {\r
+  EfiIpmiOther = 0,\r
+  EfiIpmiKcs   = 1,\r
+  EfiIpmiSmic  = 2,\r
+  EfiIpmiBt    = 3,\r
+} EFI_MISC_IPMI_INTERFACE_TYPE;\r
+\r
+typedef struct {\r
+  UINT16  IpmiSpecLeastSignificantDigit:4;\r
+  UINT16  IpmiSpecMostSignificantDigit: 4;\r
+  UINT16  Reserved:                     8;\r
+} EFI_MISC_IPMI_SPECIFICATION_REVISION;\r
+\r
+typedef struct {\r
+  EFI_MISC_IPMI_INTERFACE_TYPE          IpmiInterfaceType;\r
+  EFI_MISC_IPMI_SPECIFICATION_REVISION  IpmiSpecificationRevision;\r
+  UINT16                                IpmiI2CSlaveAddress;\r
+  UINT16                                IpmiNvDeviceAddress;\r
+  UINT64                                IpmiBaseAddress;\r
+  EFI_DEVICE_PATH_PROTOCOL              IpmiDevicePath;\r
+} EFI_MISC_IPMI_INTERFACE_TYPE_DATA;\r
+\r
+#define EFI_MISC_IPMI_INTERFACE_TYPE_RECORD_NUMBER  0x0000001D\r
+\r
+//\r
+//////////////////////////////////////////////////////////////////////////////\r
+//\r
+//System Power supply Record - SMBIOS Type 39\r
+//\r
+typedef struct {\r
+  UINT16  PowerSupplyHotReplaceable  :1;\r
+  UINT16  PowerSupplyPresent         :1;\r
+  UINT16  PowerSupplyUnplugged       :1;\r
+  UINT16  InputVoltageRangeSwitch    :4;\r
+  UINT16  PowerSupplyStatus          :3;\r
+  UINT16  PowerSupplyType            :4;\r
+  UINT16  Reserved                   :2;\r
+} POWER_SUPPLY_CHARACTERISTICS;\r
+\r
+typedef struct {\r
+  UINT16                          PowerUnitGroup;\r
+  STRING_REF                      PowerSupplyLocation;\r
+  STRING_REF                      PowerSupplyDeviceName;\r
+  STRING_REF                      PowerSupplyManufacturer;\r
+  STRING_REF                      PowerSupplySerialNumber;\r
+  STRING_REF                      PowerSupplyAssetTagNumber;\r
+  STRING_REF                      PowerSupplyModelPartNumber;\r
+  STRING_REF                      PowerSupplyRevisionLevel;\r
+  UINT16                          PowerSupplyMaxPowerCapacity;\r
+  POWER_SUPPLY_CHARACTERISTICS    PowerSupplyCharacteristics;\r
+  EFI_INTER_LINK_DATA             PowerSupplyInputVoltageProbeLink;\r
+  EFI_INTER_LINK_DATA             PowerSupplyCoolingDeviceLink;\r
+  EFI_INTER_LINK_DATA             PowerSupplyInputCurrentProbeLink;\r
+} EFI_MISC_SYSTEM_POWER_SUPPLY_DATA;\r
+\r
+#define EFI_MISC_SYSTEM_POWER_SUPPLY_RECORD_NUMBER 0x0000001E\r
+\r
+//\r
+//////////////////////////////////////////////////////////////////////////////\r
+//\r
+// OEM Data Record - SMBIOS Type 0x80-0xFF\r
+//\r
+typedef struct {\r
+  UINT8       Type;\r
+  UINT8       Length;\r
+  UINT16      Handle;\r
+} SMBIOS_STRUCTURE_HDR;\r
+\r
+typedef struct {\r
+  SMBIOS_STRUCTURE_HDR          Header;\r
+  UINT8                         RawData[1];\r
+} EFI_MISC_SMBIOS_STRUCT_ENCAPSULATION_DATA;\r
+\r
+#define EFI_MISC_SMBIOS_STRUCT_ENCAP_RECORD_NUMBER  0x0000001F\r
+\r
+//\r
+// Declare the following strutures alias to use them more conviniently.\r
+//\r
+typedef EFI_MISC_LAST_PCI_BUS_DATA                        EFI_MISC_LAST_PCI_BUS;\r
+typedef EFI_MISC_BIOS_VENDOR_DATA                         EFI_MISC_BIOS_VENDOR;\r
+typedef EFI_MISC_SYSTEM_MANUFACTURER_DATA                 EFI_MISC_SYSTEM_MANUFACTURER;\r
+typedef EFI_MISC_BASE_BOARD_MANUFACTURER_DATA             EFI_MISC_BASE_BOARD_MANUFACTURER;\r
+typedef EFI_MISC_CHASSIS_MANUFACTURER_DATA                EFI_MISC_CHASSIS_MANUFACTURER;\r
+typedef EFI_MISC_PORT_INTERNAL_CONNECTOR_DESIGNATOR_DATA  EFI_MISC_PORT_INTERNAL_CONNECTOR_DESIGNATOR;\r
+typedef EFI_MISC_SYSTEM_SLOT_DESIGNATION_DATA             EFI_MISC_SYSTEM_SLOT_DESIGNATION;\r
+typedef EFI_MISC_ONBOARD_DEVICE_DATA                      EFI_MISC_ONBOARD_DEVICE;\r
+typedef EFI_MISC_PORTING_DEVICE_TYPE_DATA                 EFI_MISC_ONBOARD_DEVICE_TYPE_DATA;\r
+typedef EFI_MISC_OEM_STRING_DATA                          EFI_MISC_OEM_STRING;\r
+typedef EFI_MISC_SYSTEM_OPTION_STRING_DATA                EFI_MISC_SYSTEM_OPTION_STRING;\r
+typedef EFI_MISC_NUMBER_OF_INSTALLABLE_LANGUAGES_DATA     EFI_MISC_NUMBER_OF_INSTALLABLE_LANGUAGES;\r
+typedef EFI_MISC_SYSTEM_LANGUAGE_STRING_DATA              EFI_MISC_SYSTEM_LANGUAGE_STRING;\r
+typedef EFI_MISC_SYSTEM_EVENT_LOG_DATA                    EFI_MISC_SYSTEM_EVENT_LOG;\r
+typedef EFI_MISC_BIS_ENTRY_POINT_DATA                     EFI_MISC_BIS_ENTRY_POINT;\r
+typedef EFI_MISC_BOOT_INFORMATION_STATUS_DATA             EFI_MISC_BOOT_INFORMATION_STATUS;\r
+typedef EFI_MISC_SYSTEM_POWER_SUPPLY_DATA                 EFI_MISC_SYSTEM_POWER_SUPPLY;\r
+typedef EFI_MISC_SMBIOS_STRUCT_ENCAPSULATION_DATA         EFI_MISC_SMBIOS_STRUCT_ENCAPSULATION;\r
+\r
+typedef union {\r
+  EFI_MISC_LAST_PCI_BUS_DATA                         LastPciBus;\r
+  EFI_MISC_BIOS_VENDOR_DATA                          MiscBiosVendor;\r
+  EFI_MISC_SYSTEM_MANUFACTURER_DATA                  MiscSystemManufacturer;\r
+  EFI_MISC_BASE_BOARD_MANUFACTURER_DATA              MiscBaseBoardManufacturer;\r
+  EFI_MISC_CHASSIS_MANUFACTURER_DATA                 MiscChassisManufacturer;\r
+  EFI_MISC_PORT_INTERNAL_CONNECTOR_DESIGNATOR_DATA   MiscPortInternalConnectorDesignator;\r
+  EFI_MISC_SYSTEM_SLOT_DESIGNATION_DATA              MiscSystemSlotDesignation;\r
+  EFI_MISC_ONBOARD_DEVICE_DATA                       MiscOnboardDevice;\r
+  EFI_MISC_OEM_STRING_DATA                           MiscOemString;\r
+  EFI_MISC_SYSTEM_OPTION_STRING_DATA                 MiscOptionString;\r
+  EFI_MISC_NUMBER_OF_INSTALLABLE_LANGUAGES_DATA      NumberOfInstallableLanguages;\r
+  EFI_MISC_SYSTEM_LANGUAGE_STRING_DATA               MiscSystemLanguageString;\r
+  EFI_MISC_SYSTEM_EVENT_LOG_DATA                     MiscSystemEventLog;\r
+  EFI_MISC_GROUP_NAME_DATA                           MiscGroupNameData;\r
+  EFI_MISC_GROUP_ITEM_SET_DATA                       MiscGroupItemSetData;\r
+  EFI_MISC_PORTING_DEVICE_TYPE_DATA                  MiscPortingDeviceTypeData;\r
+  EFI_MISC_RESET_CAPABILITIES_DATA                   MiscResetCapablilitiesData;\r
+  EFI_MISC_HARDWARE_SECURITY_SETTINGS_DATA           MiscHardwareSecuritySettingsData;\r
+  EFI_MISC_SCHEDULED_POWER_ON_MONTH_DATA             MiscScheduledPowerOnMonthData;\r
+  EFI_MISC_VOLTAGE_PROBE_DESCRIPTION_DATA            MiscVoltagePorbeDescriptionData;\r
+  EFI_MISC_COOLING_DEVICE_TEMP_LINK_DATA             MiscCoolingDeviceTempLinkData;\r
+  EFI_MISC_TEMPERATURE_PROBE_DESCRIPTION_DATA        MiscTemperatureProbeDescriptionData;\r
+  EFI_MISC_ELECTRICAL_CURRENT_PROBE_DESCRIPTION_DATA MiscElectricalCurrentProbeDescriptionData;\r
+  EFI_MISC_REMOTE_ACCESS_MANUFACTURER_DESCRIPTION_DATA\r
+                                                     MiscRemoteAccessManufacturerDescriptionData;\r
+  EFI_MISC_BIS_ENTRY_POINT_DATA                      MiscBisEntryPoint;\r
+  EFI_MISC_BOOT_INFORMATION_STATUS_DATA              MiscBootInformationStatus;\r
+  EFI_MISC_MANAGEMENT_DEVICE_DESCRIPTION_DATA        MiscMangementDeviceDescriptionData;\r
+  EFI_MISC_MANAGEMENT_DEVICE_COMPONENT_DESCRIPTION_DATA\r
+                                                     MiscmangementDeviceComponentDescriptionData;\r
+  EFI_MISC_IPMI_INTERFACE_TYPE_DATA                  MiscIpmiInterfaceTypeData;\r
+  EFI_MISC_SYSTEM_POWER_SUPPLY_DATA                  MiscPowerSupplyInfo;\r
+  EFI_MISC_SMBIOS_STRUCT_ENCAPSULATION_DATA          MiscSmbiosStructEncapsulation;\r
+} EFI_MISC_SUBCLASS_RECORDS;\r
+\r
+//\r
+//\r
+//\r
+typedef struct {\r
+  EFI_SUBCLASS_TYPE1_HEADER       Header;\r
+  EFI_MISC_SUBCLASS_RECORDS       Record;\r
+} EFI_MISC_SUBCLASS_DRIVER_DATA;\r
+\r
+#pragma pack()\r
+\r
+//\r
+// Sub Class Header type1\r
+//\r
+\r
+#define EFI_SUBCLASS_INSTANCE_RESERVED       0\r
+#define EFI_SUBCLASS_INSTANCE_NON_APPLICABLE 0xFFFF  //16 bit\r
+\r
+#endif\r
diff --git a/IntelFrameworkPkg/Include/Common/FrameworkDxeCis.h b/IntelFrameworkPkg/Include/Common/FrameworkDxeCis.h
new file mode 100644 (file)
index 0000000..93e3639
--- /dev/null
@@ -0,0 +1,68 @@
+/** @file\r
+  Include file that supportes Framework extension to the EFI 1.10 spec.\r
+\r
+  This include file must only contain things defined in the Framework\r
+  specifications. If a code construct is defined in the Framework specification\r
+  it must be included by this include file.\r
+\r
+  Copyright (c) 2007, Intel Corporation\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+  Module Name:    FrameworkDxeCis.h\r
+\r
+**/\r
+\r
+#ifndef _FRAMEWORK_DXE_CIS_H_\r
+#define _FRAMEWORK_DXE_CIS_H_\r
+\r
+#include <PiDxe.h>\r
+\r
+typedef struct {\r
+  EFI_TABLE_HEADER              Hdr;\r
+\r
+  //\r
+  // Time services\r
+  //\r
+  EFI_GET_TIME                  GetTime;\r
+  EFI_SET_TIME                  SetTime;\r
+  EFI_GET_WAKEUP_TIME           GetWakeupTime;\r
+  EFI_SET_WAKEUP_TIME           SetWakeupTime;\r
+\r
+  //\r
+  // Virtual memory services\r
+  //\r
+  EFI_SET_VIRTUAL_ADDRESS_MAP   SetVirtualAddressMap;\r
+  EFI_CONVERT_POINTER           ConvertPointer;\r
+\r
+  //\r
+  // Variable services\r
+  //\r
+  EFI_GET_VARIABLE              GetVariable;\r
+  EFI_GET_NEXT_VARIABLE_NAME    GetNextVariableName;\r
+  EFI_SET_VARIABLE              SetVariable;\r
+\r
+  //\r
+  // Misc\r
+  //\r
+  EFI_GET_NEXT_HIGH_MONO_COUNT  GetNextHighMonotonicCount;\r
+  EFI_RESET_SYSTEM              ResetSystem;\r
+\r
+  //\r
+  // Framework extension to EFI 1.10 runtime table\r
+  // It was moved to a protocol to not conflict with UEFI 2.0\r
+  //\r
+  EFI_REPORT_STATUS_CODE        ReportStatusCode;\r
+} FRAMEWORK_EFI_RUNTIME_SERVICES;\r
+\r
+#define EFI_EVENT_RUNTIME_CONTEXT       0x20000000\r
+#define EFI_EVENT_NOTIFY_SIGNAL_ALL     0x00000400\r
+#define EFI_EVENT_SIGNAL_READY_TO_BOOT  0x00000203\r
+#define EFI_EVENT_SIGNAL_LEGACY_BOOT    0x00000204\r
+\r
+#endif\r
diff --git a/IntelFrameworkPkg/Include/Common/FrameworkFirmwareFileSystem.h b/IntelFrameworkPkg/Include/Common/FrameworkFirmwareFileSystem.h
new file mode 100644 (file)
index 0000000..c5868e0
--- /dev/null
@@ -0,0 +1,31 @@
+/** @file\r
+  This file defines the data structures that comprise the FFS file system.\r
+\r
+  Copyright (c) 2007, Intel Corporation\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+  Module Name:  FrameworkFirmwareFileSystem.h\r
+\r
+  @par Revision Reference:\r
+  These definitions are from Firmware File System Spec 0.9 but not in PI specs.\r
+\r
+**/\r
+\r
+#ifndef _FRAMEWORK_FIRMWARE_FILE_SYSTEM_H_\r
+#define _FRAMEWORK_FIRMWARE_FILE_SYSTEM_H_\r
+\r
+#include <PiFirmwareFileSystem.h>\r
+\r
+typedef UINT16                      EFI_FFS_FILE_TAIL;\r
+\r
+#define FFS_ATTRIB_TAIL_PRESENT     0x01\r
+#define FFS_ATTRIB_RECOVERY         0x02\r
+#define FFS_ATTRIB_HEADER_EXTENSION 0x04\r
+\r
+#endif\r
diff --git a/IntelFrameworkPkg/Include/Common/FrameworkHob.h b/IntelFrameworkPkg/Include/Common/FrameworkHob.h
new file mode 100644 (file)
index 0000000..346c954
--- /dev/null
@@ -0,0 +1,36 @@
+/** @file\r
+  This file defines the data structures per HOB specification v0.9.\r
+\r
+  Copyright (c) 2007, Intel Corporation\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+  Module Name:  FrameworkFirmwareFileSystem.h\r
+\r
+  @par Revision Reference:\r
+  These definitions are from HOB Spec 0.9 but not adopted by PI specs.\r
+\r
+**/\r
+\r
+#ifndef _FRAMEWORK_HOB_H_\r
+#define _FRAMEWORK_HOB_H_\r
+\r
+#include <PiHob.h>\r
+\r
+//\r
+// Capsule volume HOB -- identical to a firmware volume\r
+//\r
+#define EFI_HOB_TYPE_CV 0x0008\r
+\r
+typedef struct {\r
+  EFI_HOB_GENERIC_HEADER  Header;\r
+  EFI_PHYSICAL_ADDRESS    BaseAddress;\r
+  UINT64                  Length;\r
+} EFI_HOB_CAPSULE_VOLUME;\r
+\r
+#endif\r
diff --git a/IntelFrameworkPkg/Include/Common/FrameworkLegacy16.h b/IntelFrameworkPkg/Include/Common/FrameworkLegacy16.h
new file mode 100644 (file)
index 0000000..ff7f2c0
--- /dev/null
@@ -0,0 +1,425 @@
+/** @file\r
+  API between 16-bit Legacy BIOS and EFI\r
+\r
+  We need to figure out what the 16-bit code is going to use to\r
+  represent these data structures. Is a pointer SEG:OFF or 32-bit...\r
+\r
+  Copyright (c) 2007, Intel Corporation\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+  Module Name:  FrameworkLegacy16.h\r
+\r
+  @par Revision Reference:\r
+  These definitions are from Compatibility Support Module Spec Version 0.96.\r
+\r
+**/\r
+\r
+#ifndef _FRAMEWORK_LEGACY_16_H_\r
+#define _FRAMEWORK_LEGACY_16_H_\r
+\r
+#include <Base.h>\r
+\r
+//\r
+// All structures defined in this header file are packed on byte boundary\r
+//\r
+#pragma pack(1)\r
+\r
+///////////////////////////////////////////////////////////////////////////////\r
+// EFI_COMPATIBILITY16_TABLE is located at a 16-byte boundary starting with the\r
+// signature "$EFI"\r
+///////////////////////////////////////////////////////////////////////////////\r
+\r
+#define EFI_COMPATIBILITY16_TABLE_SIGNATURE EFI_SIGNATURE_32('$', 'E', 'F', 'I')\r
+\r
+typedef struct {\r
+  UINT32  Signature;      // "$EFI"\r
+  UINT8   TableChecksum;\r
+  UINT8   TableLength;\r
+  UINT8   EfiMajorRevision;\r
+  UINT8   EfiMinorRevision;\r
+  UINT8   TableMajorRevision;\r
+  UINT8   TableMinorRevision;\r
+  UINT16  Reserved;\r
+  UINT16  Compatibility16CallSegment;\r
+  UINT16  Compatibility16CallOffset;\r
+  UINT16  PnPInstallationCheckSegment;\r
+  UINT16  PnPInstallationCheckOffset;\r
+  UINT32  EfiSystemTable; // The physical address of EFI_SYSTEM_TABLE\r
+  UINT32  OemIdStringPointer;\r
+  UINT32  AcpiRsdPtrPointer;\r
+  UINT16  OemRevision;\r
+  UINT32  E820Pointer;\r
+  UINT32  E820Length;\r
+  UINT32  IrqRoutingTablePointer;\r
+  UINT32  IrqRoutingTableLength;\r
+  UINT32  MpTablePtr;\r
+  UINT32  MpTableLength;\r
+  UINT16  OemIntSegment;\r
+  UINT16  OemIntOffset;\r
+  UINT16  Oem32Segment;\r
+  UINT16  Oem32Offset;\r
+  UINT16  Oem16Segment;\r
+  UINT16  Oem16Offset;\r
+  UINT16  TpmSegment;\r
+  UINT16  TpmOffset;\r
+  UINT32  IbvPointer;\r
+  UINT32  PciExpressBase;\r
+  UINT8   LastPciBus;\r
+} EFI_COMPATIBILITY16_TABLE;\r
+\r
+///////////////////////////////////////////////////////////////////////////////\r
+// Functions provided by the CSM binary\r
+///////////////////////////////////////////////////////////////////////////////\r
+typedef enum {\r
+  Legacy16InitializeYourself    = 0x0000,\r
+  Legacy16UpdateBbs             = 0x0001,\r
+  Legacy16PrepareToBoot         = 0x0002,\r
+  Legacy16Boot                  = 0x0003,\r
+  Legacy16RetrieveLastBootDevice= 0x0004,\r
+  Legacy16DispatchOprom         = 0x0005,\r
+  Legacy16GetTableAddress       = 0x0006,\r
+  Legacy16SetKeyboardLeds       = 0x0007,\r
+  Legacy16InstallPciHandler     = 0x0008\r
+} EFI_COMPATIBILITY_FUNCTIONS;\r
+\r
+///////////////////////////////////////////////////////////////////////////////\r
+// EFI_TO_COMPATIBILITY16_INIT_TABLE\r
+///////////////////////////////////////////////////////////////////////////////\r
+typedef struct {\r
+  UINT32  BiosLessThan1MB;\r
+  UINT32  HiPmmMemory;\r
+  UINT32  HiPmmMemorySizeInBytes;\r
+  UINT16  ReverseThunkCallSegment;\r
+  UINT16  ReverseThunkCallOffset;\r
+  UINT32  NumberE820Entries;\r
+  UINT32  OsMemoryAbove1Mb;\r
+  UINT32  ThunkStart;\r
+  UINT32  ThunkSizeInBytes;\r
+  UINT32  LowPmmMemory;\r
+  UINT32  LowPmmMemorySizeInBytes;\r
+} EFI_TO_COMPATIBILITY16_INIT_TABLE;\r
+\r
+///////////////////////////////////////////////////////////////////////////////\r
+// EFI_TO_COMPATIBILITY16_BOOT_TABLE\r
+///////////////////////////////////////////////////////////////////////////////\r
+\r
+//\r
+// DEVICE_PRODUCER_SERIAL & its modes\r
+//\r
+typedef struct {\r
+  UINT16      Address;\r
+  UINT8       Irq;\r
+  SERIAL_MODE Mode;\r
+} DEVICE_PRODUCER_SERIAL;\r
+\r
+#define DEVICE_SERIAL_MODE_NORMAL               0x00\r
+#define DEVICE_SERIAL_MODE_IRDA                 0x01\r
+#define DEVICE_SERIAL_MODE_ASK_IR               0x02\r
+#define DEVICE_SERIAL_MODE_DUPLEX_HALF          0x00\r
+#define DEVICE_SERIAL_MODE_DUPLEX_FULL          0x10\r
+\r
+//\r
+// DEVICE_PRODUCER_PARALLEL & its modes\r
+//\r
+typedef struct {\r
+  UINT16        Address;\r
+  UINT8         Irq;\r
+  UINT8         Dma;\r
+  PARALLEL_MODE Mode;\r
+} DEVICE_PRODUCER_PARALLEL;\r
+\r
+#define DEVICE_PARALLEL_MODE_MODE_OUTPUT_ONLY   0x00\r
+#define DEVICE_PARALLEL_MODE_MODE_BIDIRECTIONAL 0x01\r
+#define DEVICE_PARALLEL_MODE_MODE_EPP           0x02\r
+#define DEVICE_PARALLEL_MODE_MODE_ECP           0x03\r
+\r
+//\r
+// DEVICE_PRODUCER_FLOPPY\r
+//\r
+typedef struct {\r
+  UINT16  Address;\r
+  UINT8   Irq;\r
+  UINT8   Dma;\r
+  UINT8   NumberOfFloppy;\r
+} DEVICE_PRODUCER_FLOPPY;\r
+\r
+//\r
+// LEGACY_DEVICE_FLAGS\r
+//\r
+typedef struct {\r
+  UINT32  A20Kybd : 1;\r
+  UINT32  A20Port90 : 1;\r
+  UINT32  Reserved : 30;\r
+} LEGACY_DEVICE_FLAGS;\r
+\r
+//\r
+// DEVICE_PRODUCER_DATA_HEADER\r
+//\r
+typedef struct {\r
+  DEVICE_PRODUCER_SERIAL    Serial[4];\r
+  DEVICE_PRODUCER_PARALLEL  Parallel[3];\r
+  DEVICE_PRODUCER_FLOPPY    Floppy;\r
+  UINT8                     MousePresent;\r
+  LEGACY_DEVICE_FLAGS       Flags;\r
+} DEVICE_PRODUCER_DATA_HEADER;\r
+\r
+//\r
+// ATAPI_IDENTIFY\r
+//\r
+typedef struct {\r
+  UINT16  Raw[256];\r
+} ATAPI_IDENTIFY;\r
+\r
+//\r
+// HDD_INFO & its status\r
+//\r
+typedef struct {\r
+  UINT16          Status;\r
+  UINT32          Bus;\r
+  UINT32          Device;\r
+  UINT32          Function;\r
+  UINT16          CommandBaseAddress;\r
+  UINT16          ControlBaseAddress;\r
+  UINT16          BusMasterAddress;\r
+  UINT8           HddIrq;\r
+  ATAPI_IDENTIFY  IdentifyDrive[2];\r
+} HDD_INFO;\r
+\r
+#define HDD_PRIMARY               0x01\r
+#define HDD_SECONDARY             0x02\r
+#define HDD_MASTER_ATAPI_CDROM    0x04\r
+#define HDD_SLAVE_ATAPI_CDROM     0x08\r
+#define HDD_MASTER_IDE            0x20\r
+#define HDD_SLAVE_IDE             0x40\r
+#define HDD_MASTER_ATAPI_ZIPDISK  0x10\r
+#define HDD_SLAVE_ATAPI_ZIPDISK   0x80\r
+\r
+//\r
+// BBS_STATUS_FLAGS\r
+//\r
+typedef struct {\r
+  UINT16  OldPosition : 4;\r
+  UINT16  Reserved1 : 4;\r
+  UINT16  Enabled : 1;\r
+  UINT16  Failed : 1;\r
+  UINT16  MediaPresent : 2;\r
+  UINT16  Reserved2 : 4;\r
+} BBS_STATUS_FLAGS;\r
+\r
+//\r
+// BBS_TABLE, device type values & boot priority values\r
+//\r
+typedef struct {\r
+  UINT16            BootPriority;\r
+  UINT32            Bus;\r
+  UINT32            Device;\r
+  UINT32            Function;\r
+  UINT8             Class;\r
+  UINT8             SubClass;\r
+  UINT16            MfgStringOffset;\r
+  UINT16            MfgStringSegment;\r
+  UINT16            DeviceType;\r
+  BBS_STATUS_FLAGS  StatusFlags;\r
+  UINT16            BootHandlerOffset;\r
+  UINT16            BootHandlerSegment;\r
+  UINT16            DescStringOffset;\r
+  UINT16            DescStringSegment;\r
+  UINT32            InitPerReserved;\r
+  UINT32            AdditionalIrq13Handler;\r
+  UINT32            AdditionalIrq18Handler;\r
+  UINT32            AdditionalIrq19Handler;\r
+  UINT32            AdditionalIrq40Handler;\r
+  UINT8             AssignedDriveNumber;\r
+  UINT32            AdditionalIrq41Handler;\r
+  UINT32            AdditionalIrq46Handler;\r
+  UINT32            IBV1;\r
+  UINT32            IBV2;\r
+} BBS_TABLE;\r
+\r
+#define BBS_FLOPPY        0x01\r
+#define BBS_HARDDISK      0x02\r
+#define BBS_CDROM         0x03\r
+#define BBS_PCMCIA        0x04\r
+#define BBS_USB           0x05\r
+#define BBS_EMBED_NETWORK 0x06\r
+#define BBS_BEV_DEVICE    0x80\r
+#define BBS_UNKNOWN       0xff\r
+\r
+#define BBS_DO_NOT_BOOT_FROM    0xFFFC\r
+#define BBS_LOWEST_PRIORITY     0xFFFD\r
+#define BBS_UNPRIORITIZED_ENTRY 0xFFFE\r
+#define BBS_IGNORE_ENTRY        0xFFFF\r
+\r
+//\r
+// SMM_ATTRIBUTES & relating type, port and data size constants\r
+//\r
+typedef struct {\r
+  UINT16  Type : 3;\r
+  UINT16  PortGranularity : 3;\r
+  UINT16  DataGranularity : 3;\r
+  UINT16  Reserved : 7;\r
+} SMM_ATTRIBUTES;\r
+\r
+#define STANDARD_IO       0x00\r
+#define STANDARD_MEMORY   0x01\r
+\r
+#define PORT_SIZE_8       0x00\r
+#define PORT_SIZE_16      0x01\r
+#define PORT_SIZE_32      0x02\r
+#define PORT_SIZE_64      0x03\r
+\r
+#define DATA_SIZE_8       0x00\r
+#define DATA_SIZE_16      0x01\r
+#define DATA_SIZE_32      0x02\r
+#define DATA_SIZE_64      0x03\r
+\r
+//\r
+// SMM_FUNCTION & relating constants\r
+//\r
+typedef struct {\r
+  UINT16  Function : 15;\r
+  UINT16  Owner : 1;\r
+} SMM_FUNCTION;\r
+\r
+#define INT15_D042        0x0000\r
+#define GET_USB_BOOT_INFO 0x0001\r
+#define DMI_PNP_50_57     0x0002\r
+\r
+#define STANDARD_OWNER    0x0\r
+#define OEM_OWNER         0x1\r
+\r
+//\r
+// SMM_ENTRY\r
+//\r
+// This structure assumes both port and data sizes are 1. SmmAttribute must be\r
+// properly to reflect that assumption.\r
+//\r
+typedef struct {\r
+  SMM_ATTRIBUTES  SmmAttributes;\r
+  SMM_FUNCTION    SmmFunction;\r
+  UINT8           SmmPort;\r
+  UINT8           SmmData;\r
+} SMM_ENTRY;\r
+\r
+//\r
+// SMM_TABLE\r
+//\r
+typedef struct {\r
+  UINT16    NumSmmEntries;\r
+  SMM_ENTRY SmmEntry;\r
+} SMM_TABLE;\r
+\r
+//\r
+// UDC_ATTRIBUTES\r
+//\r
+typedef struct {\r
+  UINT8 DirectoryServiceValidity : 1;\r
+  UINT8 RabcaUsedFlag : 1;\r
+  UINT8 ExecuteHddDiagnosticsFlag : 1;\r
+  UINT8 Reserved : 5;\r
+} UDC_ATTRIBUTES;\r
+\r
+//\r
+// UD_TABLE\r
+//\r
+typedef struct {\r
+  UDC_ATTRIBUTES  Attributes;\r
+  UINT8           DeviceNumber;\r
+  UINT8           BbsTableEntryNumberForParentDevice;\r
+  UINT8           BbsTableEntryNumberForBoot;\r
+  UINT8           BbsTableEntryNumberForHddDiag;\r
+  UINT8           BeerData[128];\r
+  UINT8           ServiceAreaData[64];\r
+} UD_TABLE;\r
+\r
+//\r
+// EFI_TO_COMPATIBILITY16_BOOT_TABLE\r
+//\r
+#define EFI_TO_LEGACY_MAJOR_VERSION 0x02\r
+#define EFI_TO_LEGACY_MINOR_VERSION 0x00\r
+#define MAX_IDE_CONTROLLER          8\r
+\r
+typedef struct {\r
+  UINT16                      MajorVersion;\r
+  UINT16                      MinorVersion;\r
+  UINT32                      AcpiTable;   // 4 GB range\r
+  UINT32                      SmbiosTable; // 4 GB range\r
+  UINT32                      SmbiosTableLength;\r
+\r
+  //\r
+  // Legacy SIO state\r
+  //\r
+  DEVICE_PRODUCER_DATA_HEADER SioData;\r
+\r
+  UINT16                      DevicePathType;\r
+  UINT16                      PciIrqMask;\r
+  UINT32                      NumberE820Entries;\r
+\r
+  //\r
+  // Controller & Drive Identify[2] per controller information\r
+  //\r
+  HDD_INFO                    HddInfo[MAX_IDE_CONTROLLER];\r
+\r
+  UINT32                      NumberBbsEntries;\r
+  UINT32                      BbsTable;\r
+  UINT32                      SmmTable;\r
+  UINT32                      OsMemoryAbove1Mb;\r
+  UINT32                      UnconventionalDeviceTable;\r
+} EFI_TO_COMPATIBILITY16_BOOT_TABLE;\r
+\r
+///////////////////////////////////////////////////////////////////////////////\r
+// EFI_DISPATCH_OPROM_TABLE\r
+///////////////////////////////////////////////////////////////////////////////\r
+\r
+typedef struct {\r
+  UINT16  PnPInstallationCheckSegment;\r
+  UINT16  PnPInstallationCheckOffset;\r
+  UINT16  OpromSegment;\r
+  UINT8   PciBus;\r
+  UINT8   PciDeviceFunction;\r
+  UINT8   NumberBbsEntries;\r
+  VOID    *BbsTablePointer; /// @bug: variable size on 32/64-bit systems.\r
+} EFI_DISPATCH_OPROM_TABLE;\r
+\r
+///////////////////////////////////////////////////////////////////////////////\r
+// EFI_LEGACY_INSTALL_PCI_HANDLER\r
+///////////////////////////////////////////////////////////////////////////////\r
+typedef struct {\r
+  UINT8   PciBus;\r
+  UINT8   PciDeviceFun;\r
+  UINT8   PciSegment;\r
+  UINT8   PciClass;\r
+  UINT8   PciSubclass;\r
+  UINT8   PciInterface;\r
+\r
+  //\r
+  // Primary section\r
+  //\r
+  UINT8   PrimaryIrq;\r
+  UINT8   PrimaryReserved;\r
+  UINT16  PrimaryControl;\r
+  UINT16  PrimaryBase;\r
+  UINT16  PrimaryBusMaster;\r
+\r
+  //\r
+  // Secondary Section\r
+  //\r
+  UINT8   SecondaryIrq;\r
+  UINT8   SecondaryReserved;\r
+  UINT16  SecondaryControl;\r
+  UINT16  SecondaryBase;\r
+  UINT16  SecondaryBusMaster;\r
+} EFI_LEGACY_INSTALL_PCI_HANDLER;\r
+\r
+//\r
+// Restore default pack value\r
+//\r
+#pragma pack()\r
+\r
+#endif\r
diff --git a/IntelFrameworkPkg/Include/Common/FrameworkSmmCis.h b/IntelFrameworkPkg/Include/Common/FrameworkSmmCis.h
new file mode 100644 (file)
index 0000000..695a6a1
--- /dev/null
@@ -0,0 +1,480 @@
+/** @file\r
+  Include file matches things in the Smm CIS spec.\r
+\r
+  Copyright (c) 2007, Intel Corporation\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+  Module Name:  FrameworkSmmCis.h\r
+\r
+  @par Revision Reference:\r
+  Version 0.9.\r
+\r
+**/\r
+\r
+#ifndef _FRAMEWORK_SMM_CIS_H_\r
+#define _FRAMEWORK_SMM_CIS_H_\r
+\r
+#include <PiDxe.h>\r
+\r
+#define EFI_SMM_CPU_IO_GUID \\r
+  { \\r
+    0x5f439a0b, 0x45d8, 0x4682, {0xa4, 0xf4, 0xf0, 0x57, 0x6b, 0x51, 0x34, 0x41 } \\r
+  }\r
+\r
+typedef struct _EFI_SMM_SYSTEM_TABLE      EFI_SMM_SYSTEM_TABLE;\r
+typedef struct _EFI_SMM_CPU_IO_INTERFACE  EFI_SMM_CPU_IO_INTERFACE;\r
+\r
+\r
+//\r
+// SMM Base specification constant and types\r
+//\r
+#define SMM_SMST_SIGNATURE            EFI_SIGNATURE_32 ('S', 'M', 'S', 'T')\r
+#define EFI_SMM_SYSTEM_TABLE_REVISION (0 << 16) | (0x09)\r
+\r
+//\r
+// *******************************************************\r
+// EFI_SMM_IO_WIDTH\r
+// *******************************************************\r
+//\r
+typedef enum {\r
+  SMM_IO_UINT8  = 0,\r
+  SMM_IO_UINT16 = 1,\r
+  SMM_IO_UINT32 = 2,\r
+  SMM_IO_UINT64 = 3\r
+} EFI_SMM_IO_WIDTH;\r
+\r
+/**\r
+  Provides the basic memory and I/O interfaces that are used to\r
+  abstract accesses to devices.\r
+\r
+  @param  This             The EFI_SMM_CPU_IO_INTERFACE instance.\r
+  @param  Width            Signifies the width of the I/O operations.\r
+  @param  Address          The base address of the I/O operations.\r
+  @param  Count            The number of I/O operations to perform.\r
+  @param  Buffer           For read operations, the destination buffer to store the results.\r
+                           For write operations, the source buffer from which to write data.\r
+\r
+  @retval EFI_SUCCESS           The data was read from or written to the device.\r
+  @retval EFI_UNSUPPORTED       The Address is not valid for this system.\r
+  @retval EFI_INVALID_PARAMETER Width or Count, or both, were invalid.\r
+  @retval EFI_OUT_OF_RESOURCES  The request could not be completed due to a lack of resources.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_SMM_CPU_IO) (\r
+  IN EFI_SMM_CPU_IO_INTERFACE         *This,\r
+  IN EFI_SMM_IO_WIDTH                 Width,\r
+  IN UINT64                           Address,\r
+  IN UINTN                            Count,\r
+  IN OUT VOID                         *Buffer\r
+  );\r
+\r
+typedef struct {\r
+  EFI_SMM_CPU_IO  Read;\r
+  EFI_SMM_CPU_IO  Write;\r
+} EFI_SMM_IO_ACCESS;\r
+\r
+struct _EFI_SMM_CPU_IO_INTERFACE {\r
+  EFI_SMM_IO_ACCESS Mem;\r
+  EFI_SMM_IO_ACCESS Io;\r
+};\r
+\r
+/**\r
+  Allocates pool memory from SMRAM for IA-32 or runtime memory for\r
+  the Itanium processor family.\r
+\r
+  @param  PoolType         The type of pool to allocate.The only supported type is EfiRuntimeServicesData\r
+  @param  Size             The number of bytes to allocate from the pool.\r
+  @param  Buffer           A pointer to a pointer to the allocated buffer if the call\r
+                           succeeds; undefined otherwise.\r
+\r
+  @retval EFI_SUCCESS           The requested number of bytes was allocated.\r
+  @retval EFI_OUT_OF_RESOURCES  The pool requested could not be allocated.\r
+  @retval EFI_UNSUPPORTED       In runtime.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_SMMCORE_ALLOCATE_POOL) (\r
+  IN EFI_MEMORY_TYPE                PoolType,\r
+  IN UINTN                          Size,\r
+  OUT VOID                          **Buffer\r
+  );\r
+\r
+/**\r
+  Returns pool memory to the system.\r
+\r
+  @param  Buffer           Pointer to the buffer to free.\r
+\r
+  @retval EFI_SUCCESS           The memory was returned to the system.\r
+  @retval EFI_INVALID_PARAMETER Buffer was invalid.\r
+  @retval EFI_UNSUPPORTED       In runtime.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_SMMCORE_FREE_POOL) (\r
+  IN VOID                   *Buffer\r
+  );\r
+\r
+/**\r
+  Allocates memory pages from the system.\r
+\r
+  @param  Type             The type of allocation to perform.\r
+  @param  MemoryType       The only supported type is EfiRuntimeServicesData\r
+  @param  NumberofPages    The number of contiguous 4 KB pages to allocate\r
+  @param  Memory           Pointer to a physical address. On input, the way in which\r
+                           the address is used depends on the value of Type. On output, the address\r
+                           is set to the base of the page range that was allocated.\r
+\r
+  @retval EFI_SUCCESS           The requested pages were allocated.\r
+  @retval EFI_OUT_OF_RESOURCES  The pages requested could not be allocated.\r
+  @retval EFI_NOT_FOUND         The requested pages could not be found.\r
+  @retval EFI_INVALID_PARAMETER Type is not AllocateAnyPages or AllocateMaxAddress\r
+                                or AllocateAddress. Or MemoryType is in the range EfiMaxMemoryType..0x7FFFFFFF.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_SMMCORE_ALLOCATE_PAGES) (\r
+  IN EFI_ALLOCATE_TYPE      Type,\r
+  IN EFI_MEMORY_TYPE        MemoryType,\r
+  IN UINTN                  NumberOfPages,\r
+  OUT EFI_PHYSICAL_ADDRESS  *Memory\r
+  );\r
+\r
+/**\r
+  Frees memory pages for the system.\r
+\r
+  @param  Memory           The base physical address of the pages to be freed\r
+  @param  NumberOfPages    The number of contiguous 4 KB pages to free.\r
+\r
+  @retval EFI_SUCCESS           The requested memory pages were freed.\r
+  @retval EFI_INVALID_PARAMETER Memory is not a page-aligned address or NumberOfPages is invalid.\r
+  @retval EFI_NOT_FOUND         The requested memory pages were not allocated with SmmAllocatePages().\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_SMMCORE_FREE_PAGES) (\r
+  IN EFI_PHYSICAL_ADDRESS   Memory,\r
+  IN UINTN                  NumberOfPages\r
+  );\r
+\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_SMM_STARTUP_THIS_AP) (\r
+  IN  EFI_AP_PROCEDURE                    Procedure,\r
+  IN  UINTN                               CpuNumber,\r
+  IN  OUT VOID                            *ProcArguments OPTIONAL\r
+  );\r
+\r
+typedef struct {\r
+  UINT8                 Reserved1[248];\r
+  UINT32                SMBASE;\r
+  UINT32                SMMRevId;\r
+  UINT16                IORestart;\r
+  UINT16                AutoHALTRestart;\r
+  UINT8                 Reserved2[164];\r
+  UINT32                ES;\r
+  UINT32                CS;\r
+  UINT32                SS;\r
+  UINT32                DS;\r
+  UINT32                FS;\r
+  UINT32                GS;\r
+  UINT32                LDTBase;\r
+  UINT32                TR;\r
+  UINT32                DR7;\r
+  UINT32                DR6;\r
+  UINT32                EAX;\r
+  UINT32                ECX;\r
+  UINT32                EDX;\r
+  UINT32                EBX;\r
+  UINT32                ESP;\r
+  UINT32                EBP;\r
+  UINT32                ESI;\r
+  UINT32                EDI;\r
+  UINT32                EIP;\r
+  UINT32                EFLAGS;\r
+  UINT32                CR3;\r
+  UINT32                CR0;\r
+} EFI_SMI_CPU_SAVE_STATE;\r
+\r
+typedef struct {\r
+  UINT64   reserved;\r
+  UINT64   r1;\r
+  UINT64   r2;\r
+  UINT64   r3;\r
+  UINT64   r4;\r
+  UINT64   r5;\r
+  UINT64   r6;\r
+  UINT64   r7;\r
+  UINT64   r8;\r
+  UINT64   r9;\r
+  UINT64   r10;\r
+  UINT64   r11;\r
+  UINT64   r12;\r
+  UINT64   r13;\r
+  UINT64   r14;\r
+  UINT64   r15;\r
+  UINT64   r16;\r
+  UINT64   r17;\r
+  UINT64   r18;\r
+  UINT64   r19;\r
+  UINT64   r20;\r
+  UINT64   r21;\r
+  UINT64   r22;\r
+  UINT64   r23;\r
+  UINT64   r24;\r
+  UINT64   r25;\r
+  UINT64   r26;\r
+  UINT64   r27;\r
+  UINT64   r28;\r
+  UINT64   r29;\r
+  UINT64   r30;\r
+  UINT64   r31;\r
+\r
+  UINT64   pr;\r
+\r
+  UINT64   b0;\r
+  UINT64   b1;\r
+  UINT64   b2;\r
+  UINT64   b3;\r
+  UINT64   b4;\r
+  UINT64   b5;\r
+  UINT64   b6;\r
+  UINT64   b7;\r
+\r
+  // application registers\r
+  UINT64   ar_rsc;\r
+  UINT64   ar_bsp;\r
+  UINT64   ar_bspstore;\r
+  UINT64   ar_rnat;\r
+\r
+  UINT64   ar_fcr;\r
+\r
+  UINT64   ar_eflag;\r
+  UINT64   ar_csd;\r
+  UINT64   ar_ssd;\r
+  UINT64   ar_cflg;\r
+  UINT64   ar_fsr;\r
+  UINT64   ar_fir;\r
+  UINT64   ar_fdr;\r
+\r
+  UINT64   ar_ccv;\r
+\r
+  UINT64   ar_unat;\r
+\r
+  UINT64   ar_fpsr;\r
+\r
+  UINT64   ar_pfs;\r
+  UINT64   ar_lc;\r
+  UINT64   ar_ec;\r
+\r
+  // control registers\r
+  UINT64   cr_dcr;\r
+  UINT64   cr_itm;\r
+  UINT64   cr_iva;\r
+  UINT64   cr_pta;\r
+  UINT64   cr_ipsr;\r
+  UINT64   cr_isr;\r
+  UINT64   cr_iip;\r
+  UINT64   cr_ifa;\r
+  UINT64   cr_itir;\r
+  UINT64   cr_iipa;\r
+  UINT64   cr_ifs;\r
+  UINT64   cr_iim;\r
+  UINT64   cr_iha;\r
+\r
+  // debug registers\r
+  UINT64   dbr0;\r
+  UINT64   dbr1;\r
+  UINT64   dbr2;\r
+  UINT64   dbr3;\r
+  UINT64   dbr4;\r
+  UINT64   dbr5;\r
+  UINT64   dbr6;\r
+  UINT64   dbr7;\r
+\r
+  UINT64   ibr0;\r
+  UINT64   ibr1;\r
+  UINT64   ibr2;\r
+  UINT64   ibr3;\r
+  UINT64   ibr4;\r
+  UINT64   ibr5;\r
+  UINT64   ibr6;\r
+  UINT64   ibr7;\r
+\r
+  // virtual registers\r
+  UINT64   int_nat;         // nat bits for R1-R31\r
+\r
+} EFI_PMI_SYSTEM_CONTEXT;\r
+\r
+typedef union {\r
+  EFI_SMI_CPU_SAVE_STATE     Ia32SaveState;\r
+  EFI_PMI_SYSTEM_CONTEXT     ItaniumSaveState;\r
+} EFI_SMM_CPU_SAVE_STATE;\r
+\r
+typedef struct {\r
+  UINT16                Fcw;\r
+  UINT16                Fsw;\r
+  UINT16                Ftw;\r
+  UINT16                Opcode;\r
+  UINT32                Eip;\r
+  UINT16                Cs;\r
+  UINT16                Rsvd1;\r
+  UINT32                DataOffset;\r
+  UINT16                Ds;\r
+  UINT8                 Rsvd2[10];\r
+  UINT8                 St0Mm0[10], Rsvd3[6];\r
+  UINT8                 St0Mm1[10], Rsvd4[6];\r
+  UINT8                 St0Mm2[10], Rsvd5[6];\r
+  UINT8                 St0Mm3[10], Rsvd6[6];\r
+  UINT8                 St0Mm4[10], Rsvd7[6];\r
+  UINT8                 St0Mm5[10], Rsvd8[6];\r
+  UINT8                 St0Mm6[10], Rsvd9[6];\r
+  UINT8                 St0Mm7[10], Rsvd10[6];\r
+  UINT8                 Rsvd11[22*16];\r
+} EFI_SMI_OPTIONAL_FPSAVE_STATE;\r
+\r
+typedef struct {\r
+  UINT64   f2[2];\r
+  UINT64   f3[2];\r
+  UINT64   f4[2];\r
+  UINT64   f5[2];\r
+  UINT64   f6[2];\r
+  UINT64   f7[2];\r
+  UINT64   f8[2];\r
+  UINT64   f9[2];\r
+  UINT64   f10[2];\r
+  UINT64   f11[2];\r
+  UINT64   f12[2];\r
+  UINT64   f13[2];\r
+  UINT64   f14[2];\r
+  UINT64   f15[2];\r
+  UINT64   f16[2];\r
+  UINT64   f17[2];\r
+  UINT64   f18[2];\r
+  UINT64   f19[2];\r
+  UINT64   f20[2];\r
+  UINT64   f21[2];\r
+  UINT64   f22[2];\r
+  UINT64   f23[2];\r
+  UINT64   f24[2];\r
+  UINT64   f25[2];\r
+  UINT64   f26[2];\r
+  UINT64   f27[2];\r
+  UINT64   f28[2];\r
+  UINT64   f29[2];\r
+  UINT64   f30[2];\r
+  UINT64   f31[2];\r
+} EFI_PMI_OPTIONAL_FLOATING_POINT_CONTEXT;\r
+\r
+typedef union {\r
+  EFI_SMI_OPTIONAL_FPSAVE_STATE             Ia32FpSave;\r
+  EFI_PMI_OPTIONAL_FLOATING_POINT_CONTEXT   ItaniumFpSave;\r
+} EFI_SMM_FLOATING_POINT_SAVE_STATE;\r
+\r
+/**\r
+  This function is the main entry point for an SMM handler dispatch\r
+  or communicate-based callback.\r
+\r
+  @param  SmmImageHandle   A unique value returned by the SMM infrastructure\r
+                           in response to registration for a communicate-based callback or dispatch.\r
+  @param  CommunicationBuffer\r
+                           An optional buffer that will be populated\r
+                           by the SMM infrastructure in response to a non-SMM agent (preboot or runtime)\r
+                           invoking the EFI_SMM_BASE_PROTOCOL.Communicate() service.\r
+  @param  SourceSize       If CommunicationBuffer is non-NULL, this field\r
+                           indicates the size of the data payload in this buffer.\r
+\r
+  @return Status Code\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_SMM_HANDLER_ENTRY_POINT) (\r
+  IN EFI_HANDLE             SmmImageHandle,\r
+  IN OUT VOID               *CommunicationBuffer OPTIONAL,\r
+  IN OUT UINTN              *SourceSize OPTIONAL\r
+  );\r
+\r
+/**\r
+  The SmmInstallConfigurationTable() function is used to maintain the list\r
+  of configuration tables that are stored in the System Management System\r
+  Table.  The list is stored as an array of (GUID, Pointer) pairs.  The list\r
+  must be allocated from pool memory with PoolType set to EfiRuntimeServicesData.\r
+\r
+  @param  SystemTable      A pointer to the SMM System Table.\r
+  @param  Guid             A pointer to the GUID for the entry to add, update, or remove.\r
+  @param  Table            A pointer to the buffer of the table to add.\r
+  @param  TableSize        The size of the table to install.\r
+\r
+  @retval EFI_SUCCESS           The (Guid, Table) pair was added, updated, or removed.\r
+  @retval EFI_INVALID_PARAMETER Guid is not valid.\r
+  @retval EFI_NOT_FOUND         An attempt was made to delete a non-existent entry.\r
+  @retval EFI_OUT_OF_RESOURCES  There is not enough memory available to complete the operation.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_SMM_INSTALL_CONFIGURATION_TABLE) (\r
+  IN EFI_SMM_SYSTEM_TABLE         *SystemTable,\r
+  IN EFI_GUID                     *Guid,\r
+  IN VOID                         *Table,\r
+  IN UINTN                        TableSize\r
+  );\r
+\r
+//\r
+// System Management System Table (SMST)\r
+//\r
+struct _EFI_SMM_SYSTEM_TABLE {\r
+  EFI_TABLE_HEADER                    Hdr;\r
+\r
+  CHAR16                              *SmmFirmwareVendor;\r
+  UINT32                              SmmFirmwareRevision;\r
+\r
+  EFI_SMM_INSTALL_CONFIGURATION_TABLE SmmInstallConfigurationTable;\r
+\r
+  //\r
+  // I/O Services\r
+  //\r
+  EFI_GUID                            EfiSmmCpuIoGuid;\r
+  EFI_SMM_CPU_IO_INTERFACE            SmmIo;\r
+\r
+  //\r
+  // Runtime memory service\r
+  //\r
+  EFI_SMMCORE_ALLOCATE_POOL           SmmAllocatePool;\r
+  EFI_SMMCORE_FREE_POOL               SmmFreePool;\r
+  EFI_SMMCORE_ALLOCATE_PAGES          SmmAllocatePages;\r
+  EFI_SMMCORE_FREE_PAGES              SmmFreePages;\r
+\r
+  //\r
+  // MP service\r
+  //\r
+  EFI_SMM_STARTUP_THIS_AP             SmmStartupThisAp;\r
+\r
+  //\r
+  // CPU information records\r
+  //\r
+  UINTN                               CurrentlyExecutingCpu;\r
+  UINTN                               NumberOfCpus;\r
+  EFI_SMM_CPU_SAVE_STATE              *CpuSaveState;\r
+  EFI_SMM_FLOATING_POINT_SAVE_STATE   *CpuOptionalFloatingPointState;\r
+\r
+  //\r
+  // Extensibility table\r
+  //\r
+  UINTN                               NumberOfTableEntries;\r
+  EFI_CONFIGURATION_TABLE             *SmmConfigurationTable;\r
+};\r
+\r
+#endif\r
diff --git a/IntelFrameworkPkg/Include/Common/FrameworkStatusCode.h b/IntelFrameworkPkg/Include/Common/FrameworkStatusCode.h
new file mode 100644 (file)
index 0000000..dccb951
--- /dev/null
@@ -0,0 +1,904 @@
+/** @file\r
+  Status Code Definitions, according to Intel Platform Innovation Framework\r
+  for EFI Status Codes Specification\r
+\r
+  The file is divided into sections for ease of use.\r
+\r
+<pre>\r
+  Section:    Contents:\r
+  1           General Status Code Definitions\r
+  2           Class definitions\r
+  3           Computing Unit Subclasses, Progress and Error Codes\r
+  4           Peripheral Subclasses, Progress and Error Codes.\r
+  5           IO Bus Subclasses, Progress and Error Codes.\r
+  6           Software Subclasses, Progress and Error Codes.\r
+  7           Debug Codes\r
+</pre>\r
+\r
+  Copyright (c) 2007, Intel Corporation\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+  Module Name:  StatusCode.h\r
+\r
+  @par Revision Reference:\r
+  Version 0.92.\r
+\r
+**/\r
+\r
+#ifndef _FRAMEWORK_STATUS_CODE_H_\r
+#define _FRAMEWORK_STATUS_CODE_H_\r
+\r
+\r
+//\r
+// /////////////////////////////////////////////////////////////////////////////\r
+// Section 1\r
+////////////////////////////////////////////////////////////////////////////////\r
+\r
+//\r
+// Data Hub Status Code class record definition\r
+// This structure isn't adopted by PI, so is defined here.\r
+//\r
+typedef struct {\r
+  EFI_STATUS_CODE_TYPE  CodeType;\r
+  EFI_STATUS_CODE_VALUE Value;\r
+  UINT32                Instance;\r
+  EFI_GUID              CallerId;\r
+  EFI_STATUS_CODE_DATA  Data;\r
+} DATA_HUB_STATUS_CODE_DATA_RECORD;\r
+\r
+//\r
+// /////////////////////////////////////////////////////////////////////////////\r
+// Section 2\r
+///////////////////////////////////////////////////////////////////////////////\r
+//\r
+// Class definitions\r
+// Values of 4-127 are reserved for future use by this\r
+// specification.\r
+// Values in the range 127-255 are reserved for OEM use.\r
+//\r
+#define EFI_COMPUTING_UNIT  0x00000000\r
+#define EFI_PERIPHERAL      0x01000000\r
+#define EFI_IO_BUS          0x02000000\r
+#define EFI_SOFTWARE        0x03000000\r
+\r
+//\r
+// General partitioning scheme for Progress and Error Codes are\r
+// 0x0000-0x0FFF  - Shared by all sub-classes in a given class\r
+// 0x1000-0x7FFF  - Subclass Specific\r
+// 0x8000-0xFFFF  - OEM specific\r
+//\r
+#define EFI_SUBCLASS_SPECIFIC 0x1000\r
+#define EFI_OEM_SPECIFIC      0x8000\r
+\r
+//\r
+// /////////////////////////////////////////////////////////////////////////////\r
+// Section 3\r
+///////////////////////////////////////////////////////////////////////////////\r
+//\r
+// Computing Unit Subclass definitions.\r
+// Values of 8-127 are reserved for future use by this\r
+// specification.\r
+// Values of 128-255 are reserved for OEM use.\r
+//\r
+#define EFI_COMPUTING_UNIT_UNSPECIFIED        (EFI_COMPUTING_UNIT | 0x00000000)\r
+#define EFI_COMPUTING_UNIT_HOST_PROCESSOR     (EFI_COMPUTING_UNIT | 0x00010000)\r
+#define EFI_COMPUTING_UNIT_FIRMWARE_PROCESSOR (EFI_COMPUTING_UNIT | 0x00020000)\r
+#define EFI_COMPUTING_UNIT_IO_PROCESSOR       (EFI_COMPUTING_UNIT | 0x00030000)\r
+#define EFI_COMPUTING_UNIT_CACHE              (EFI_COMPUTING_UNIT | 0x00040000)\r
+#define EFI_COMPUTING_UNIT_MEMORY             (EFI_COMPUTING_UNIT | 0x00050000)\r
+#define EFI_COMPUTING_UNIT_CHIPSET            (EFI_COMPUTING_UNIT | 0x00060000)\r
+\r
+//\r
+// Computing Unit Class Progress Code definitions.\r
+// These are shared by all subclasses.\r
+//\r
+#define EFI_CU_PC_INIT_BEGIN  0x00000000\r
+#define EFI_CU_PC_INIT_END    0x00000001\r
+\r
+//\r
+// Computing Unit Unspecified Subclass Progress Code definitions.\r
+//\r
+//\r
+// Computing Unit Host Processor Subclass Progress Code definitions.\r
+//\r
+#define EFI_CU_HP_PC_POWER_ON_INIT          (EFI_SUBCLASS_SPECIFIC | 0x00000000)\r
+#define EFI_CU_HP_PC_CACHE_INIT             (EFI_SUBCLASS_SPECIFIC | 0x00000001)\r
+#define EFI_CU_HP_PC_RAM_INIT               (EFI_SUBCLASS_SPECIFIC | 0x00000002)\r
+#define EFI_CU_HP_PC_MEMORY_CONTROLLER_INIT (EFI_SUBCLASS_SPECIFIC | 0x00000003)\r
+#define EFI_CU_HP_PC_IO_INIT                (EFI_SUBCLASS_SPECIFIC | 0x00000004)\r
+#define EFI_CU_HP_PC_BSP_SELECT             (EFI_SUBCLASS_SPECIFIC | 0x00000005)\r
+#define EFI_CU_HP_PC_BSP_RESELECT           (EFI_SUBCLASS_SPECIFIC | 0x00000006)\r
+#define EFI_CU_HP_PC_AP_INIT                (EFI_SUBCLASS_SPECIFIC | 0x00000007)\r
+#define EFI_CU_HP_PC_SMM_INIT               (EFI_SUBCLASS_SPECIFIC | 0x00000008)\r
+\r
+//\r
+// Computing Unit Firmware Processor Subclass Progress Code definitions.\r
+//\r
+//\r
+// Computing Unit IO Processor Subclass Progress Code definitions.\r
+//\r
+//\r
+// Computing Unit Cache Subclass Progress Code definitions.\r
+//\r
+#define EFI_CU_CACHE_PC_PRESENCE_DETECT (EFI_SUBCLASS_SPECIFIC | 0x00000000)\r
+#define EFI_CU_CACHE_PC_CONFIGURATION   (EFI_SUBCLASS_SPECIFIC | 0x00000001)\r
+\r
+//\r
+// Computing Unit Memory Subclass Progress Code definitions.\r
+//\r
+#define EFI_CU_MEMORY_PC_SPD_READ         (EFI_SUBCLASS_SPECIFIC | 0x00000000)\r
+#define EFI_CU_MEMORY_PC_PRESENCE_DETECT  (EFI_SUBCLASS_SPECIFIC | 0x00000001)\r
+#define EFI_CU_MEMORY_PC_TIMING           (EFI_SUBCLASS_SPECIFIC | 0x00000002)\r
+#define EFI_CU_MEMORY_PC_CONFIGURING      (EFI_SUBCLASS_SPECIFIC | 0x00000003)\r
+#define EFI_CU_MEMORY_PC_OPTIMIZING       (EFI_SUBCLASS_SPECIFIC | 0x00000004)\r
+#define EFI_CU_MEMORY_PC_INIT             (EFI_SUBCLASS_SPECIFIC | 0x00000005)\r
+#define EFI_CU_MEMORY_PC_TEST             (EFI_SUBCLASS_SPECIFIC | 0x00000006)\r
+\r
+//\r
+// Computing Unit Chipset Subclass Progress Code definitions.\r
+//\r
+//\r
+// Computing Unit Class Error Code definitions.\r
+// These are shared by all subclasses.\r
+//\r
+#define EFI_CU_EC_NON_SPECIFIC    0x00000000\r
+#define EFI_CU_EC_DISABLED        0x00000001\r
+#define EFI_CU_EC_NOT_SUPPORTED   0x00000002\r
+#define EFI_CU_EC_NOT_DETECTED    0x00000003\r
+#define EFI_CU_EC_NOT_CONFIGURED  0x00000004\r
+\r
+//\r
+// Computing Unit Unspecified Subclass Error Code definitions.\r
+//\r
+//\r
+// Computing Unit Host Processor Subclass Error Code definitions.\r
+//\r
+#define EFI_CU_HP_EC_INVALID_TYPE         (EFI_SUBCLASS_SPECIFIC | 0x00000000)\r
+#define EFI_CU_HP_EC_INVALID_SPEED        (EFI_SUBCLASS_SPECIFIC | 0x00000001)\r
+#define EFI_CU_HP_EC_MISMATCH             (EFI_SUBCLASS_SPECIFIC | 0x00000002)\r
+#define EFI_CU_HP_EC_TIMER_EXPIRED        (EFI_SUBCLASS_SPECIFIC | 0x00000003)\r
+#define EFI_CU_HP_EC_SELF_TEST            (EFI_SUBCLASS_SPECIFIC | 0x00000004)\r
+#define EFI_CU_HP_EC_INTERNAL             (EFI_SUBCLASS_SPECIFIC | 0x00000005)\r
+#define EFI_CU_HP_EC_THERMAL              (EFI_SUBCLASS_SPECIFIC | 0x00000006)\r
+#define EFI_CU_HP_EC_LOW_VOLTAGE          (EFI_SUBCLASS_SPECIFIC | 0x00000007)\r
+#define EFI_CU_HP_EC_HIGH_VOLTAGE         (EFI_SUBCLASS_SPECIFIC | 0x00000008)\r
+#define EFI_CU_HP_EC_CACHE                (EFI_SUBCLASS_SPECIFIC | 0x00000009)\r
+#define EFI_CU_HP_EC_MICROCODE_UPDATE     (EFI_SUBCLASS_SPECIFIC | 0x0000000A)\r
+#define EFI_CU_HP_EC_CORRECTABLE          (EFI_SUBCLASS_SPECIFIC | 0x0000000B)\r
+#define EFI_CU_HP_EC_UNCORRECTABLE        (EFI_SUBCLASS_SPECIFIC | 0x0000000C)\r
+#define EFI_CU_HP_EC_NO_MICROCODE_UPDATE  (EFI_SUBCLASS_SPECIFIC | 0x0000000D)\r
+\r
+//\r
+// Computing Unit Firmware Processor Subclass Error Code definitions.\r
+//\r
+#define EFI_CU_FP_EC_HARD_FAIL  (EFI_SUBCLASS_SPECIFIC | 0x00000000)\r
+#define EFI_CU_FP_EC_SOFT_FAIL  (EFI_SUBCLASS_SPECIFIC | 0x00000001)\r
+#define EFI_CU_FP_EC_COMM_ERROR (EFI_SUBCLASS_SPECIFIC | 0x00000002)\r
+\r
+//\r
+// Computing Unit IO Processor Subclass Error Code definitions.\r
+//\r
+//\r
+// Computing Unit Cache Subclass Error Code definitions.\r
+//\r
+#define EFI_CU_CACHE_EC_INVALID_TYPE  (EFI_SUBCLASS_SPECIFIC | 0x00000000)\r
+#define EFI_CU_CACHE_EC_INVALID_SPEED (EFI_SUBCLASS_SPECIFIC | 0x00000001)\r
+#define EFI_CU_CACHE_EC_INVALID_SIZE  (EFI_SUBCLASS_SPECIFIC | 0x00000002)\r
+#define EFI_CU_CACHE_EC_MISMATCH      (EFI_SUBCLASS_SPECIFIC | 0x00000003)\r
+\r
+//\r
+// Computing Unit Memory Subclass Error Code definitions.\r
+//\r
+#define EFI_CU_MEMORY_EC_INVALID_TYPE   (EFI_SUBCLASS_SPECIFIC | 0x00000000)\r
+#define EFI_CU_MEMORY_EC_INVALID_SPEED  (EFI_SUBCLASS_SPECIFIC | 0x00000001)\r
+#define EFI_CU_MEMORY_EC_CORRECTABLE    (EFI_SUBCLASS_SPECIFIC | 0x00000002)\r
+#define EFI_CU_MEMORY_EC_UNCORRECTABLE  (EFI_SUBCLASS_SPECIFIC | 0x00000003)\r
+#define EFI_CU_MEMORY_EC_SPD_FAIL       (EFI_SUBCLASS_SPECIFIC | 0x00000004)\r
+#define EFI_CU_MEMORY_EC_INVALID_SIZE   (EFI_SUBCLASS_SPECIFIC | 0x00000005)\r
+#define EFI_CU_MEMORY_EC_MISMATCH       (EFI_SUBCLASS_SPECIFIC | 0x00000006)\r
+#define EFI_CU_MEMORY_EC_S3_RESUME_FAIL (EFI_SUBCLASS_SPECIFIC | 0x00000007)\r
+#define EFI_CU_MEMORY_EC_UPDATE_FAIL    (EFI_SUBCLASS_SPECIFIC | 0x00000008)\r
+#define EFI_CU_MEMORY_EC_NONE_DETECTED  (EFI_SUBCLASS_SPECIFIC | 0x00000009)\r
+#define EFI_CU_MEMORY_EC_NONE_USEFUL    (EFI_SUBCLASS_SPECIFIC | 0x0000000A)\r
+\r
+//\r
+// Computing Unit Chipset Subclass Error Code definitions.\r
+//\r
+\r
+///////////////////////////////////////////////////////////////////////////////\r
+// Section 4\r
+///////////////////////////////////////////////////////////////////////////////\r
+//\r
+// Peripheral Subclass definitions.\r
+// Values of 12-127 are reserved for future use by this\r
+// specification.\r
+// Values of 128-255 are reserved for OEM use.\r
+//\r
+#define EFI_PERIPHERAL_UNSPECIFIED      (EFI_PERIPHERAL | 0x00000000)\r
+#define EFI_PERIPHERAL_KEYBOARD         (EFI_PERIPHERAL | 0x00010000)\r
+#define EFI_PERIPHERAL_MOUSE            (EFI_PERIPHERAL | 0x00020000)\r
+#define EFI_PERIPHERAL_LOCAL_CONSOLE    (EFI_PERIPHERAL | 0x00030000)\r
+#define EFI_PERIPHERAL_REMOTE_CONSOLE   (EFI_PERIPHERAL | 0x00040000)\r
+#define EFI_PERIPHERAL_SERIAL_PORT      (EFI_PERIPHERAL | 0x00050000)\r
+#define EFI_PERIPHERAL_PARALLEL_PORT    (EFI_PERIPHERAL | 0x00060000)\r
+#define EFI_PERIPHERAL_FIXED_MEDIA      (EFI_PERIPHERAL | 0x00070000)\r
+#define EFI_PERIPHERAL_REMOVABLE_MEDIA  (EFI_PERIPHERAL | 0x00080000)\r
+#define EFI_PERIPHERAL_AUDIO_INPUT      (EFI_PERIPHERAL | 0x00090000)\r
+#define EFI_PERIPHERAL_AUDIO_OUTPUT     (EFI_PERIPHERAL | 0x000A0000)\r
+#define EFI_PERIPHERAL_LCD_DEVICE       (EFI_PERIPHERAL | 0x000B0000)\r
+#define EFI_PERIPHERAL_NETWORK          (EFI_PERIPHERAL | 0x000C0000)\r
+\r
+//\r
+// Peripheral Class Progress Code definitions.\r
+// These are shared by all subclasses.\r
+//\r
+#define EFI_P_PC_INIT             0x00000000\r
+#define EFI_P_PC_RESET            0x00000001\r
+#define EFI_P_PC_DISABLE          0x00000002\r
+#define EFI_P_PC_PRESENCE_DETECT  0x00000003\r
+#define EFI_P_PC_ENABLE           0x00000004\r
+#define EFI_P_PC_RECONFIG         0x00000005\r
+#define EFI_P_PC_DETECTED         0x00000006\r
+\r
+//\r
+// Peripheral Class Unspecified Subclass Progress Code definitions.\r
+//\r
+//\r
+// Peripheral Class Keyboard Subclass Progress Code definitions.\r
+//\r
+#define EFI_P_KEYBOARD_PC_CLEAR_BUFFER  (EFI_SUBCLASS_SPECIFIC | 0x00000000)\r
+#define EFI_P_KEYBOARD_PC_SELF_TEST     (EFI_SUBCLASS_SPECIFIC | 0x00000001)\r
+\r
+//\r
+// Peripheral Class Mouse Subclass Progress Code definitions.\r
+//\r
+#define EFI_P_MOUSE_PC_SELF_TEST  (EFI_SUBCLASS_SPECIFIC | 0x00000000)\r
+\r
+//\r
+// Peripheral Class Local Console Subclass Progress Code definitions.\r
+//\r
+//\r
+// Peripheral Class Remote Console Subclass Progress Code definitions.\r
+//\r
+//\r
+// Peripheral Class Serial Port Subclass Progress Code definitions.\r
+//\r
+#define EFI_P_SERIAL_PORT_PC_CLEAR_BUFFER (EFI_SUBCLASS_SPECIFIC | 0x00000000)\r
+\r
+//\r
+// Peripheral Class Parallel Port Subclass Progress Code definitions.\r
+//\r
+//\r
+// Peripheral Class Fixed Media Subclass Progress Code definitions.\r
+//\r
+//\r
+// Peripheral Class Removable Media Subclass Progress Code definitions.\r
+//\r
+//\r
+// Peripheral Class Audio Input Subclass Progress Code definitions.\r
+//\r
+//\r
+// Peripheral Class Audio Output Subclass Progress Code definitions.\r
+//\r
+//\r
+// Peripheral Class LCD Device Subclass Progress Code definitions.\r
+//\r
+//\r
+// Peripheral Class Network Subclass Progress Code definitions.\r
+//\r
+//\r
+// Peripheral Class Error Code definitions.\r
+// These are shared by all subclasses.\r
+//\r
+#define EFI_P_EC_NON_SPECIFIC       0x00000000\r
+#define EFI_P_EC_DISABLED           0x00000001\r
+#define EFI_P_EC_NOT_SUPPORTED      0x00000002\r
+#define EFI_P_EC_NOT_DETECTED       0x00000003\r
+#define EFI_P_EC_NOT_CONFIGURED     0x00000004\r
+#define EFI_P_EC_INTERFACE_ERROR    0x00000005\r
+#define EFI_P_EC_CONTROLLER_ERROR   0x00000006\r
+#define EFI_P_EC_INPUT_ERROR        0x00000007\r
+#define EFI_P_EC_OUTPUT_ERROR       0x00000008\r
+#define EFI_P_EC_RESOURCE_CONFLICT  0x00000009\r
+\r
+//\r
+// Peripheral Class Unspecified Subclass Error Code definitions.\r
+//\r
+//\r
+// Peripheral Class Keyboard Subclass Error Code definitions.\r
+//\r
+#define EFI_P_KEYBOARD_EC_LOCKED    (EFI_SUBCLASS_SPECIFIC | 0x00000000)\r
+#define EFI_P_KEYBOARD_EC_STUCK_KEY (EFI_SUBCLASS_SPECIFIC | 0x00000001)\r
+\r
+//\r
+// Peripheral Class Mouse Subclass Error Code definitions.\r
+//\r
+#define EFI_P_MOUSE_EC_LOCKED (EFI_SUBCLASS_SPECIFIC | 0x00000000)\r
+\r
+//\r
+// Peripheral Class Local Console Subclass Error Code definitions.\r
+//\r
+//\r
+// Peripheral Class Remote Console Subclass Error Code definitions.\r
+//\r
+//\r
+// Peripheral Class Serial Port Subclass Error Code definitions.\r
+//\r
+//\r
+// Peripheral Class Parallel Port Subclass Error Code definitions.\r
+//\r
+//\r
+// Peripheral Class Fixed Media Subclass Error Code definitions.\r
+//\r
+//\r
+// Peripheral Class Removable Media Subclass Error Code definitions.\r
+//\r
+//\r
+// Peripheral Class Audio Input Subclass Error Code definitions.\r
+//\r
+//\r
+// Peripheral Class Audio Output Subclass Error Code definitions.\r
+//\r
+//\r
+// Peripheral Class LCD Device Subclass Error Code definitions.\r
+//\r
+//\r
+// Peripheral Class Network Subclass Error Code definitions.\r
+//\r
+\r
+///////////////////////////////////////////////////////////////////////////////\r
+// Section 5\r
+///////////////////////////////////////////////////////////////////////////////\r
+//\r
+// IO Bus Subclass definitions.\r
+// Values of 14-127 are reserved for future use by this\r
+// specification.\r
+// Values of 128-255 are reserved for OEM use.\r
+//\r
+#define EFI_IO_BUS_UNSPECIFIED  (EFI_IO_BUS | 0x00000000)\r
+#define EFI_IO_BUS_PCI          (EFI_IO_BUS | 0x00010000)\r
+#define EFI_IO_BUS_USB          (EFI_IO_BUS | 0x00020000)\r
+#define EFI_IO_BUS_IBA          (EFI_IO_BUS | 0x00030000)\r
+#define EFI_IO_BUS_AGP          (EFI_IO_BUS | 0x00040000)\r
+#define EFI_IO_BUS_PC_CARD      (EFI_IO_BUS | 0x00050000)\r
+#define EFI_IO_BUS_LPC          (EFI_IO_BUS | 0x00060000)\r
+#define EFI_IO_BUS_SCSI         (EFI_IO_BUS | 0x00070000)\r
+#define EFI_IO_BUS_ATA_ATAPI    (EFI_IO_BUS | 0x00080000)\r
+#define EFI_IO_BUS_FC           (EFI_IO_BUS | 0x00090000)\r
+#define EFI_IO_BUS_IP_NETWORK   (EFI_IO_BUS | 0x000A0000)\r
+#define EFI_IO_BUS_SMBUS        (EFI_IO_BUS | 0x000B0000)\r
+#define EFI_IO_BUS_I2C          (EFI_IO_BUS | 0x000C0000)\r
+\r
+//\r
+// IO Bus Class Progress Code definitions.\r
+// These are shared by all subclasses.\r
+//\r
+#define EFI_IOB_PC_INIT     0x00000000\r
+#define EFI_IOB_PC_RESET    0x00000001\r
+#define EFI_IOB_PC_DISABLE  0x00000002\r
+#define EFI_IOB_PC_DETECT   0x00000003\r
+#define EFI_IOB_PC_ENABLE   0x00000004\r
+#define EFI_IOB_PC_RECONFIG 0x00000005\r
+#define EFI_IOB_PC_HOTPLUG  0x00000006\r
+\r
+//\r
+// IO Bus Class Unspecified Subclass Progress Code definitions.\r
+//\r
+//\r
+// IO Bus Class PCI Subclass Progress Code definitions.\r
+//\r
+#define EFI_IOB_PCI_PC_BUS_ENUM   (EFI_SUBCLASS_SPECIFIC | 0x00000000)\r
+#define EFI_IOB_PCI_PC_RES_ALLOC  (EFI_SUBCLASS_SPECIFIC | 0x00000001)\r
+#define EFI_IOB_PCI_PC_HPC_INIT   (EFI_SUBCLASS_SPECIFIC | 0x00000002)\r
+\r
+//\r
+// IO Bus Class USB Subclass Progress Code definitions.\r
+//\r
+//\r
+// IO Bus Class IBA Subclass Progress Code definitions.\r
+//\r
+//\r
+// IO Bus Class AGP Subclass Progress Code definitions.\r
+//\r
+//\r
+// IO Bus Class PC Card Subclass Progress Code definitions.\r
+//\r
+//\r
+// IO Bus Class LPC Subclass Progress Code definitions.\r
+//\r
+//\r
+// IO Bus Class SCSI Subclass Progress Code definitions.\r
+//\r
+//\r
+// IO Bus Class ATA/ATAPI Subclass Progress Code definitions.\r
+//\r
+#define EFI_IOB_ATA_BUS_SMART_ENABLE          (EFI_SUBCLASS_SPECIFIC | 0x00000000)\r
+#define EFI_IOB_ATA_BUS_SMART_DISABLE         (EFI_SUBCLASS_SPECIFIC | 0x00000001)\r
+#define EFI_IOB_ATA_BUS_SMART_OVERTHRESHOLD   (EFI_SUBCLASS_SPECIFIC | 0x00000002)\r
+#define EFI_IOB_ATA_BUS_SMART_UNDERTHRESHOLD  (EFI_SUBCLASS_SPECIFIC | 0x00000003)\r
+\r
+//\r
+// IO Bus Class FC Subclass Progress Code definitions.\r
+//\r
+//\r
+// IO Bus Class IP Network Subclass Progress Code definitions.\r
+//\r
+//\r
+// IO Bus Class SMBUS Subclass Progress Code definitions.\r
+//\r
+//\r
+// IO Bus Class I2C Subclass Progress Code definitions.\r
+//\r
+//\r
+// IO Bus Class Error Code definitions.\r
+// These are shared by all subclasses.\r
+//\r
+#define EFI_IOB_EC_NON_SPECIFIC       0x00000000\r
+#define EFI_IOB_EC_DISABLED           0x00000001\r
+#define EFI_IOB_EC_NOT_SUPPORTED      0x00000002\r
+#define EFI_IOB_EC_NOT_DETECTED       0x00000003\r
+#define EFI_IOB_EC_NOT_CONFIGURED     0x00000004\r
+#define EFI_IOB_EC_INTERFACE_ERROR    0x00000005\r
+#define EFI_IOB_EC_CONTROLLER_ERROR   0x00000006\r
+#define EFI_IOB_EC_READ_ERROR         0x00000007\r
+#define EFI_IOB_EC_WRITE_ERROR        0x00000008\r
+#define EFI_IOB_EC_RESOURCE_CONFLICT  0x00000009\r
+\r
+//\r
+// IO Bus Class Unspecified Subclass Error Code definitions.\r
+//\r
+//\r
+// IO Bus Class PCI Subclass Error Code definitions.\r
+//\r
+#define EFI_IOB_PCI_EC_PERR (EFI_SUBCLASS_SPECIFIC | 0x00000000)\r
+#define EFI_IOB_PCI_EC_SERR (EFI_SUBCLASS_SPECIFIC | 0x00000001)\r
+\r
+//\r
+// IO Bus Class USB Subclass Error Code definitions.\r
+//\r
+//\r
+// IO Bus Class IBA Subclass Error Code definitions.\r
+//\r
+//\r
+// IO Bus Class AGP Subclass Error Code definitions.\r
+//\r
+//\r
+// IO Bus Class PC Card Subclass Error Code definitions.\r
+//\r
+//\r
+// IO Bus Class LPC Subclass Error Code definitions.\r
+//\r
+//\r
+// IO Bus Class SCSI Subclass Error Code definitions.\r
+//\r
+//\r
+// IO Bus Class ATA/ATAPI Subclass Error Code definitions.\r
+//\r
+#define EFI_IOB_ATA_BUS_SMART_NOTSUPPORTED  (EFI_SUBCLASS_SPECIFIC | 0x00000000)\r
+#define EFI_IOB_ATA_BUS_SMART_DISABLED      (EFI_SUBCLASS_SPECIFIC | 0x00000001)\r
+\r
+//\r
+// IO Bus Class FC Subclass Error Code definitions.\r
+//\r
+//\r
+// IO Bus Class IP Network Subclass Error Code definitions.\r
+//\r
+//\r
+// IO Bus Class SMBUS Subclass Error Code definitions.\r
+//\r
+//\r
+// IO Bus Class I2C Subclass Error Code definitions.\r
+//\r
+\r
+///////////////////////////////////////////////////////////////////////////////\r
+// Section 6\r
+///////////////////////////////////////////////////////////////////////////////\r
+//\r
+// Software Subclass definitions.\r
+// Values of 14-127 are reserved for future use by this\r
+// specification.\r
+// Values of 128-255 are reserved for OEM use.\r
+//\r
+#define EFI_SOFTWARE_UNSPECIFIED          (EFI_SOFTWARE | 0x00000000)\r
+#define EFI_SOFTWARE_SEC                  (EFI_SOFTWARE | 0x00010000)\r
+#define EFI_SOFTWARE_PEI_CORE             (EFI_SOFTWARE | 0x00020000)\r
+#define EFI_SOFTWARE_PEI_MODULE           (EFI_SOFTWARE | 0x00030000)\r
+#define EFI_SOFTWARE_DXE_CORE             (EFI_SOFTWARE | 0x00040000)\r
+#define EFI_SOFTWARE_DXE_BS_DRIVER        (EFI_SOFTWARE | 0x00050000)\r
+#define EFI_SOFTWARE_DXE_RT_DRIVER        (EFI_SOFTWARE | 0x00060000)\r
+#define EFI_SOFTWARE_SMM_DRIVER           (EFI_SOFTWARE | 0x00070000)\r
+#define EFI_SOFTWARE_EFI_APPLICATION      (EFI_SOFTWARE | 0x00080000)\r
+#define EFI_SOFTWARE_EFI_OS_LOADER        (EFI_SOFTWARE | 0x00090000)\r
+#define EFI_SOFTWARE_RT                   (EFI_SOFTWARE | 0x000A0000)\r
+#define EFI_SOFTWARE_AL                   (EFI_SOFTWARE | 0x000B0000)\r
+#define EFI_SOFTWARE_EBC_EXCEPTION        (EFI_SOFTWARE | 0x000C0000)\r
+#define EFI_SOFTWARE_IA32_EXCEPTION       (EFI_SOFTWARE | 0x000D0000)\r
+#define EFI_SOFTWARE_IPF_EXCEPTION        (EFI_SOFTWARE | 0x000E0000)\r
+#define EFI_SOFTWARE_PEI_SERVICE          (EFI_SOFTWARE | 0x000F0000)\r
+#define EFI_SOFTWARE_EFI_BOOT_SERVICE     (EFI_SOFTWARE | 0x00100000)\r
+#define EFI_SOFTWARE_EFI_RUNTIME_SERVICE  (EFI_SOFTWARE | 0x00110000)\r
+#define EFI_SOFTWARE_EFI_DXE_SERVICE      (EFI_SOFTWARE | 0x00120000)\r
+#define EFI_SOFTWARE_X64_EXCEPTION        (EFI_SOFTWARE | 0x00130000)\r
+\r
+//\r
+// Software Class Progress Code definitions.\r
+// These are shared by all subclasses.\r
+//\r
+#define EFI_SW_PC_INIT                0x00000000\r
+#define EFI_SW_PC_LOAD                0x00000001\r
+#define EFI_SW_PC_INIT_BEGIN          0x00000002\r
+#define EFI_SW_PC_INIT_END            0x00000003\r
+#define EFI_SW_PC_AUTHENTICATE_BEGIN  0x00000004\r
+#define EFI_SW_PC_AUTHENTICATE_END    0x00000005\r
+#define EFI_SW_PC_INPUT_WAIT          0x00000006\r
+#define EFI_SW_PC_USER_SETUP          0x00000007\r
+\r
+//\r
+// Software Class Unspecified Subclass Progress Code definitions.\r
+//\r
+//\r
+// Software Class SEC Subclass Progress Code definitions.\r
+//\r
+#define EFI_SW_SEC_PC_ENTRY_POINT     (EFI_SUBCLASS_SPECIFIC | 0x00000000)\r
+#define EFI_SW_SEC_PC_HANDOFF_TO_NEXT (EFI_SUBCLASS_SPECIFIC | 0x00000001)\r
+\r
+//\r
+// Software Class PEI Core Subclass Progress Code definitions.\r
+//\r
+#define EFI_SW_PEI_CORE_PC_ENTRY_POINT      (EFI_SUBCLASS_SPECIFIC | 0x00000000)\r
+#define EFI_SW_PEI_CORE_PC_HANDOFF_TO_NEXT  (EFI_SUBCLASS_SPECIFIC | 0x00000001)\r
+#define EFI_SW_PEI_CORE_PC_RETURN_TO_LAST   (EFI_SUBCLASS_SPECIFIC | 0x00000002)\r
+\r
+//\r
+// Software Class PEI Module Subclass Progress Code definitions.\r
+//\r
+#define EFI_SW_PEIM_PC_RECOVERY_BEGIN (EFI_SUBCLASS_SPECIFIC | 0x00000000)\r
+#define EFI_SW_PEIM_PC_CAPSULE_LOAD   (EFI_SUBCLASS_SPECIFIC | 0x00000001)\r
+#define EFI_SW_PEIM_PC_CAPSULE_START  (EFI_SUBCLASS_SPECIFIC | 0x00000002)\r
+#define EFI_SW_PEIM_PC_RECOVERY_USER  (EFI_SUBCLASS_SPECIFIC | 0x00000003)\r
+#define EFI_SW_PEIM_PC_RECOVERY_AUTO  (EFI_SUBCLASS_SPECIFIC | 0x00000004)\r
+\r
+//\r
+// Software Class DXE Core Subclass Progress Code definitions.\r
+//\r
+#define EFI_SW_DXE_CORE_PC_ENTRY_POINT      (EFI_SUBCLASS_SPECIFIC | 0x00000000)\r
+#define EFI_SW_DXE_CORE_PC_HANDOFF_TO_NEXT  (EFI_SUBCLASS_SPECIFIC | 0x00000001)\r
+#define EFI_SW_DXE_CORE_PC_RETURN_TO_LAST   (EFI_SUBCLASS_SPECIFIC | 0x00000002)\r
+#define EFI_SW_DXE_CORE_PC_START_DRIVER     (EFI_SUBCLASS_SPECIFIC | 0x00000003)\r
+\r
+//\r
+// Software Class DXE BS Driver Subclass Progress Code definitions.\r
+//\r
+#define EFI_SW_DXE_BS_PC_LEGACY_OPROM_INIT            (EFI_SUBCLASS_SPECIFIC | 0x00000000)\r
+#define EFI_SW_DXE_BS_PC_READY_TO_BOOT_EVENT          (EFI_SUBCLASS_SPECIFIC | 0x00000001)\r
+#define EFI_SW_DXE_BS_PC_LEGACY_BOOT_EVENT            (EFI_SUBCLASS_SPECIFIC | 0x00000002)\r
+#define EFI_SW_DXE_BS_PC_EXIT_BOOT_SERVICES_EVENT     (EFI_SUBCLASS_SPECIFIC | 0x00000003)\r
+#define EFI_SW_DXE_BS_PC_VIRTUAL_ADDRESS_CHANGE_EVENT (EFI_SUBCLASS_SPECIFIC | 0x00000004)\r
+#define EFI_SW_DXE_BS_PC_BEGIN_CONNECTING_DRIVERS     (EFI_SUBCLASS_SPECIFIC | 0x00000005)\r
+#define EFI_SW_DXE_BS_PC_VERIFYING_PASSWORD           (EFI_SUBCLASS_SPECIFIC | 0x00000006)\r
+\r
+//\r
+// Software Class DXE RT Driver Subclass Progress Code definitions.\r
+//\r
+#define EFI_SW_DXE_RT_PC_S0 (EFI_SUBCLASS_SPECIFIC | 0x00000000)\r
+#define EFI_SW_DXE_RT_PC_S1 (EFI_SUBCLASS_SPECIFIC | 0x00000001)\r
+#define EFI_SW_DXE_RT_PC_S2 (EFI_SUBCLASS_SPECIFIC | 0x00000002)\r
+#define EFI_SW_DXE_RT_PC_S3 (EFI_SUBCLASS_SPECIFIC | 0x00000003)\r
+#define EFI_SW_DXE_RT_PC_S4 (EFI_SUBCLASS_SPECIFIC | 0x00000004)\r
+#define EFI_SW_DXE_RT_PC_S5 (EFI_SUBCLASS_SPECIFIC | 0x00000005)\r
+\r
+//\r
+// Software Class SMM Driver Subclass Progress Code definitions.\r
+//\r
+//\r
+// Software Class EFI Application Subclass Progress Code definitions.\r
+//\r
+//\r
+// Software Class EFI OS Loader Subclass Progress Code definitions.\r
+//\r
+//\r
+// Software Class EFI RT Subclass Progress Code definitions.\r
+//\r
+#define EFI_SW_RT_PC_ENTRY_POINT      (EFI_SUBCLASS_SPECIFIC | 0x00000000)\r
+#define EFI_SW_RT_PC_HANDOFF_TO_NEXT  (EFI_SUBCLASS_SPECIFIC | 0x00000001)\r
+#define EFI_SW_RT_PC_RETURN_TO_LAST   (EFI_SUBCLASS_SPECIFIC | 0x00000002)\r
+\r
+//\r
+// Software Class EFI AL Subclass Progress Code definitions.\r
+//\r
+#define EFI_SW_AL_PC_ENTRY_POINT    (EFI_SUBCLASS_SPECIFIC | 0x00000000)\r
+#define EFI_SW_AL_PC_RETURN_TO_LAST (EFI_SUBCLASS_SPECIFIC | 0x00000001)\r
+\r
+//\r
+// Software Class EBC Exception Subclass Progress Code definitions.\r
+//\r
+//\r
+// Software Class IA32 Exception Subclass Progress Code definitions.\r
+//\r
+//\r
+// Software Class X64 Exception Subclass Progress Code definitions.\r
+//\r
+//\r
+// Software Class IPF Exception Subclass Progress Code definitions.\r
+//\r
+//\r
+// Software Class PEI Services Subclass Progress Code definitions.\r
+//\r
+#define EFI_SW_PS_PC_INSTALL_PPI            (EFI_SUBCLASS_SPECIFIC | 0x00000000)\r
+#define EFI_SW_PS_PC_REINSTALL_PPI          (EFI_SUBCLASS_SPECIFIC | 0x00000001)\r
+#define EFI_SW_PS_PC_LOCATE_PPI             (EFI_SUBCLASS_SPECIFIC | 0x00000002)\r
+#define EFI_SW_PS_PC_NOTIFY_PPI             (EFI_SUBCLASS_SPECIFIC | 0x00000003)\r
+#define EFI_SW_PS_PC_GET_BOOT_MODE          (EFI_SUBCLASS_SPECIFIC | 0x00000004)\r
+#define EFI_SW_PS_PC_SET_BOOT_MODE          (EFI_SUBCLASS_SPECIFIC | 0x00000005)\r
+#define EFI_SW_PS_PC_GET_HOB_LIST           (EFI_SUBCLASS_SPECIFIC | 0x00000006)\r
+#define EFI_SW_PS_PC_CREATE_HOB             (EFI_SUBCLASS_SPECIFIC | 0x00000007)\r
+#define EFI_SW_PS_PC_FFS_FIND_NEXT_VOLUME   (EFI_SUBCLASS_SPECIFIC | 0x00000008)\r
+#define EFI_SW_PS_PC_FFS_FIND_NEXT_FILE     (EFI_SUBCLASS_SPECIFIC | 0x00000009)\r
+#define EFI_SW_PS_PC_FFS_FIND_SECTION_DATA  (EFI_SUBCLASS_SPECIFIC | 0x0000000A)\r
+#define EFI_SW_PS_PC_INSTALL_PEI_MEMORY     (EFI_SUBCLASS_SPECIFIC | 0x0000000B)\r
+#define EFI_SW_PS_PC_ALLOCATE_PAGES         (EFI_SUBCLASS_SPECIFIC | 0x0000000C)\r
+#define EFI_SW_PS_PC_ALLOCATE_POOL          (EFI_SUBCLASS_SPECIFIC | 0x0000000D)\r
+#define EFI_SW_PS_PC_COPY_MEM               (EFI_SUBCLASS_SPECIFIC | 0x0000000E)\r
+#define EFI_SW_PS_PC_SET_MEM                (EFI_SUBCLASS_SPECIFIC | 0x0000000F)\r
+\r
+//\r
+// Software Class EFI Boot Services Subclass Progress Code definitions.\r
+//\r
+#define EFI_SW_BS_PC_RAISE_TPL                      (EFI_SUBCLASS_SPECIFIC | 0x00000000)\r
+#define EFI_SW_BS_PC_RESTORE_TPL                    (EFI_SUBCLASS_SPECIFIC | 0x00000001)\r
+#define EFI_SW_BS_PC_ALLOCATE_PAGES                 (EFI_SUBCLASS_SPECIFIC | 0x00000002)\r
+#define EFI_SW_BS_PC_FREE_PAGES                     (EFI_SUBCLASS_SPECIFIC | 0x00000003)\r
+#define EFI_SW_BS_PC_GET_MEMORY_MAP                 (EFI_SUBCLASS_SPECIFIC | 0x00000004)\r
+#define EFI_SW_BS_PC_ALLOCATE_POOL                  (EFI_SUBCLASS_SPECIFIC | 0x00000005)\r
+#define EFI_SW_BS_PC_FREE_POOL                      (EFI_SUBCLASS_SPECIFIC | 0x00000006)\r
+#define EFI_SW_BS_PC_CREATE_EVENT                   (EFI_SUBCLASS_SPECIFIC | 0x00000007)\r
+#define EFI_SW_BS_PC_SET_TIMER                      (EFI_SUBCLASS_SPECIFIC | 0x00000008)\r
+#define EFI_SW_BS_PC_WAIT_FOR_EVENT                 (EFI_SUBCLASS_SPECIFIC | 0x00000009)\r
+#define EFI_SW_BS_PC_SIGNAL_EVENT                   (EFI_SUBCLASS_SPECIFIC | 0x0000000A)\r
+#define EFI_SW_BS_PC_CLOSE_EVENT                    (EFI_SUBCLASS_SPECIFIC | 0x0000000B)\r
+#define EFI_SW_BS_PC_CHECK_EVENT                    (EFI_SUBCLASS_SPECIFIC | 0x0000000C)\r
+#define EFI_SW_BS_PC_INSTALL_PROTOCOL_INTERFACE     (EFI_SUBCLASS_SPECIFIC | 0x0000000D)\r
+#define EFI_SW_BS_PC_REINSTALL_PROTOCOL_INTERFACE   (EFI_SUBCLASS_SPECIFIC | 0x0000000E)\r
+#define EFI_SW_BS_PC_UNINSTALL_PROTOCOL_INTERFACE   (EFI_SUBCLASS_SPECIFIC | 0x0000000F)\r
+#define EFI_SW_BS_PC_HANDLE_PROTOCOL                (EFI_SUBCLASS_SPECIFIC | 0x00000010)\r
+#define EFI_SW_BS_PC_PC_HANDLE_PROTOCOL             (EFI_SUBCLASS_SPECIFIC | 0x00000011)\r
+#define EFI_SW_BS_PC_REGISTER_PROTOCOL_NOTIFY       (EFI_SUBCLASS_SPECIFIC | 0x00000012)\r
+#define EFI_SW_BS_PC_LOCATE_HANDLE                  (EFI_SUBCLASS_SPECIFIC | 0x00000013)\r
+#define EFI_SW_BS_PC_INSTALL_CONFIGURATION_TABLE    (EFI_SUBCLASS_SPECIFIC | 0x00000014)\r
+#define EFI_SW_BS_PC_LOAD_IMAGE                     (EFI_SUBCLASS_SPECIFIC | 0x00000015)\r
+#define EFI_SW_BS_PC_START_IMAGE                    (EFI_SUBCLASS_SPECIFIC | 0x00000016)\r
+#define EFI_SW_BS_PC_EXIT                           (EFI_SUBCLASS_SPECIFIC | 0x00000017)\r
+#define EFI_SW_BS_PC_UNLOAD_IMAGE                   (EFI_SUBCLASS_SPECIFIC | 0x00000018)\r
+#define EFI_SW_BS_PC_EXIT_BOOT_SERVICES             (EFI_SUBCLASS_SPECIFIC | 0x00000019)\r
+#define EFI_SW_BS_PC_GET_NEXT_MONOTONIC_COUNT       (EFI_SUBCLASS_SPECIFIC | 0x0000001A)\r
+#define EFI_SW_BS_PC_STALL                          (EFI_SUBCLASS_SPECIFIC | 0x0000001B)\r
+#define EFI_SW_BS_PC_SET_WATCHDOG_TIMER             (EFI_SUBCLASS_SPECIFIC | 0x0000001C)\r
+#define EFI_SW_BS_PC_CONNECT_CONTROLLER             (EFI_SUBCLASS_SPECIFIC | 0x0000001D)\r
+#define EFI_SW_BS_PC_DISCONNECT_CONTROLLER          (EFI_SUBCLASS_SPECIFIC | 0x0000001E)\r
+#define EFI_SW_BS_PC_OPEN_PROTOCOL                  (EFI_SUBCLASS_SPECIFIC | 0x0000001F)\r
+#define EFI_SW_BS_PC_CLOSE_PROTOCOL                 (EFI_SUBCLASS_SPECIFIC | 0x00000020)\r
+#define EFI_SW_BS_PC_OPEN_PROTOCOL_INFORMATION      (EFI_SUBCLASS_SPECIFIC | 0x00000021)\r
+#define EFI_SW_BS_PC_PROTOCOLS_PER_HANDLE           (EFI_SUBCLASS_SPECIFIC | 0x00000022)\r
+#define EFI_SW_BS_PC_LOCATE_HANDLE_BUFFER           (EFI_SUBCLASS_SPECIFIC | 0x00000023)\r
+#define EFI_SW_BS_PC_LOCATE_PROTOCOL                (EFI_SUBCLASS_SPECIFIC | 0x00000024)\r
+#define EFI_SW_BS_PC_INSTALL_MULTIPLE_INTERFACES    (EFI_SUBCLASS_SPECIFIC | 0x00000025)\r
+#define EFI_SW_BS_PC_UNINSTALL_MULTIPLE_INTERFACES  (EFI_SUBCLASS_SPECIFIC | 0x00000026)\r
+#define EFI_SW_BS_PC_CALCULATE_CRC_32               (EFI_SUBCLASS_SPECIFIC | 0x00000027)\r
+#define EFI_SW_BS_PC_COPY_MEM                       (EFI_SUBCLASS_SPECIFIC | 0x00000028)\r
+#define EFI_SW_BS_PC_SET_MEM                        (EFI_SUBCLASS_SPECIFIC | 0x00000029)\r
+\r
+//\r
+// Software Class EFI Runtime Services Subclass Progress Code definitions.\r
+//\r
+#define EFI_SW_RS_PC_GET_TIME                       (EFI_SUBCLASS_SPECIFIC | 0x00000000)\r
+#define EFI_SW_RS_PC_SET_TIME                       (EFI_SUBCLASS_SPECIFIC | 0x00000001)\r
+#define EFI_SW_RS_PC_GET_WAKEUP_TIME                (EFI_SUBCLASS_SPECIFIC | 0x00000002)\r
+#define EFI_SW_RS_PC_SET_WAKEUP_TIME                (EFI_SUBCLASS_SPECIFIC | 0x00000003)\r
+#define EFI_SW_RS_PC_SET_VIRTUAL_ADDRESS_MAP        (EFI_SUBCLASS_SPECIFIC | 0x00000004)\r
+#define EFI_SW_RS_PC_CONVERT_POINTER                (EFI_SUBCLASS_SPECIFIC | 0x00000005)\r
+#define EFI_SW_RS_PC_GET_VARIABLE                   (EFI_SUBCLASS_SPECIFIC | 0x00000006)\r
+#define EFI_SW_RS_PC_GET_NEXT_VARIABLE_NAME         (EFI_SUBCLASS_SPECIFIC | 0x00000007)\r
+#define EFI_SW_RS_PC_SET_VARIABLE                   (EFI_SUBCLASS_SPECIFIC | 0x00000008)\r
+#define EFI_SW_RS_PC_GET_NEXT_HIGH_MONOTONIC_COUNT  (EFI_SUBCLASS_SPECIFIC | 0x00000009)\r
+#define EFI_SW_RS_PC_RESET_SYSTEM                   (EFI_SUBCLASS_SPECIFIC | 0x0000000A)\r
+\r
+//\r
+// Software Class EFI DXE Services Subclass Progress Code definitions\r
+//\r
+#define EFI_SW_DS_PC_ADD_MEMORY_SPACE             (EFI_SUBCLASS_SPECIFIC | 0x00000000)\r
+#define EFI_SW_DS_PC_ALLOCATE_MEMORY_SPACE        (EFI_SUBCLASS_SPECIFIC | 0x00000001)\r
+#define EFI_SW_DS_PC_FREE_MEMORY_SPACE            (EFI_SUBCLASS_SPECIFIC | 0x00000002)\r
+#define EFI_SW_DS_PC_REMOVE_MEMORY_SPACE          (EFI_SUBCLASS_SPECIFIC | 0x00000003)\r
+#define EFI_SW_DS_PC_GET_MEMORY_SPACE_DESCRIPTOR  (EFI_SUBCLASS_SPECIFIC | 0x00000004)\r
+#define EFI_SW_DS_PC_SET_MEMORY_SPACE_ATTRIBUTES  (EFI_SUBCLASS_SPECIFIC | 0x00000005)\r
+#define EFI_SW_DS_PC_GET_MEMORY_SPACE_MAP         (EFI_SUBCLASS_SPECIFIC | 0x00000006)\r
+#define EFI_SW_DS_PC_ADD_IO_SPACE                 (EFI_SUBCLASS_SPECIFIC | 0x00000007)\r
+#define EFI_SW_DS_PC_ALLOCATE_IO_SPACE            (EFI_SUBCLASS_SPECIFIC | 0x00000008)\r
+#define EFI_SW_DS_PC_FREE_IO_SPACE                (EFI_SUBCLASS_SPECIFIC | 0x00000009)\r
+#define EFI_SW_DS_PC_REMOVE_IO_SPACE              (EFI_SUBCLASS_SPECIFIC | 0x0000000A)\r
+#define EFI_SW_DS_PC_GET_IO_SPACE_DESCRIPTOR      (EFI_SUBCLASS_SPECIFIC | 0x0000000B)\r
+#define EFI_SW_DS_PC_GET_IO_SPACE_MAP             (EFI_SUBCLASS_SPECIFIC | 0x0000000C)\r
+#define EFI_SW_DS_PC_DISPATCH                     (EFI_SUBCLASS_SPECIFIC | 0x0000000D)\r
+#define EFI_SW_DS_PC_SCHEDULE                     (EFI_SUBCLASS_SPECIFIC | 0x0000000E)\r
+#define EFI_SW_DS_PC_TRUST                        (EFI_SUBCLASS_SPECIFIC | 0x0000000F)\r
+#define EFI_SW_DS_PC_PROCESS_FIRMWARE_VOLUME      (EFI_SUBCLASS_SPECIFIC | 0x00000010)\r
+\r
+//\r
+// Software Class Error Code definitions.\r
+// These are shared by all subclasses.\r
+//\r
+#define EFI_SW_EC_NON_SPECIFIC            0x00000000\r
+#define EFI_SW_EC_LOAD_ERROR              0x00000001\r
+#define EFI_SW_EC_INVALID_PARAMETER       0x00000002\r
+#define EFI_SW_EC_UNSUPPORTED             0x00000003\r
+#define EFI_SW_EC_INVALID_BUFFER          0x00000004\r
+#define EFI_SW_EC_OUT_OF_RESOURCES        0x00000005\r
+#define EFI_SW_EC_ABORTED                 0x00000006\r
+#define EFI_SW_EC_ILLEGAL_SOFTWARE_STATE  0x00000007\r
+#define EFI_SW_EC_ILLEGAL_HARDWARE_STATE  0x00000008\r
+#define EFI_SW_EC_START_ERROR             0x00000009\r
+#define EFI_SW_EC_BAD_DATE_TIME           0x0000000A\r
+#define EFI_SW_EC_CFG_INVALID             0x0000000B\r
+#define EFI_SW_EC_CFG_CLR_REQUEST         0x0000000C\r
+#define EFI_SW_EC_CFG_DEFAULT             0x0000000D\r
+#define EFI_SW_EC_PWD_INVALID             0x0000000E\r
+#define EFI_SW_EC_PWD_CLR_REQUEST         0x0000000F\r
+#define EFI_SW_EC_PWD_CLEARED             0x00000010\r
+#define EFI_SW_EC_EVENT_LOG_FULL          0x00000011\r
+\r
+//\r
+// Software Class Unspecified Subclass Error Code definitions.\r
+//\r
+//\r
+// Software Class SEC Subclass Error Code definitions.\r
+//\r
+//\r
+// Software Class PEI Core Subclass Error Code definitions.\r
+//\r
+#define EFI_SW_PEI_CORE_EC_DXE_CORRUPT  (EFI_SUBCLASS_SPECIFIC | 0x00000000)\r
+\r
+//\r
+// Software Class PEI Module Subclass Error Code definitions.\r
+//\r
+#define EFI_SW_PEIM_EC_NO_RECOVERY_CAPSULE        (EFI_SUBCLASS_SPECIFIC | 0x00000000)\r
+#define EFI_SW_PEIM_EC_INVALID_CAPSULE_DESCRIPTOR (EFI_SUBCLASS_SPECIFIC | 0x00000001)\r
+\r
+//\r
+// Software Class DXE Core Subclass Error Code definitions.\r
+//\r
+#define EFI_SW_CSM_LEGACY_ROM_INIT  (EFI_SUBCLASS_SPECIFIC | 0x00000000)\r
+//\r
+// Software Class DXE Boot Service Driver Subclass Error Code definitions.\r
+//\r
+#define EFI_SW_DXE_BS_EC_LEGACY_OPROM_NO_SPACE  (EFI_SUBCLASS_SPECIFIC | 0x00000000)\r
+\r
+//\r
+// Software Class DXE Runtime Service Driver Subclass Error Code definitions.\r
+//\r
+//\r
+// Software Class SMM Driver Subclass Error Code definitions.\r
+//\r
+//\r
+// Software Class EFI Application Subclass Error Code definitions.\r
+//\r
+//\r
+// Software Class EFI OS Loader Subclass Error Code definitions.\r
+//\r
+//\r
+// Software Class EFI RT Subclass Error Code definitions.\r
+//\r
+//\r
+// Software Class EFI AL Subclass Error Code definitions.\r
+//\r
+//\r
+// Software Class EBC Exception Subclass Error Code definitions.\r
+// These exceptions are derived from the debug protocol definitions in the EFI\r
+// specification.\r
+//\r
+#define EFI_SW_EC_EBC_UNDEFINED             (EFI_SUBCLASS_SPECIFIC | EXCEPT_EBC_UNDEFINED)\r
+#define EFI_SW_EC_EBC_DIVIDE_ERROR          (EFI_SUBCLASS_SPECIFIC | EXCEPT_EBC_DIVIDE_ERROR)\r
+#define EFI_SW_EC_EBC_DEBUG                 (EFI_SUBCLASS_SPECIFIC | EXCEPT_EBC_DEBUG)\r
+#define EFI_SW_EC_EBC_BREAKPOINT            (EFI_SUBCLASS_SPECIFIC | EXCEPT_EBC_BREAKPOINT)\r
+#define EFI_SW_EC_EBC_OVERFLOW              (EFI_SUBCLASS_SPECIFIC | EXCEPT_EBC_OVERFLOW)\r
+#define EFI_SW_EC_EBC_INVALID_OPCODE        (EFI_SUBCLASS_SPECIFIC | EXCEPT_EBC_INVALID_OPCODE)\r
+#define EFI_SW_EC_EBC_STACK_FAULT           (EFI_SUBCLASS_SPECIFIC | EXCEPT_EBC_STACK_FAULT)\r
+#define EFI_SW_EC_EBC_ALIGNMENT_CHECK       (EFI_SUBCLASS_SPECIFIC | EXCEPT_EBC_ALIGNMENT_CHECK)\r
+#define EFI_SW_EC_EBC_INSTRUCTION_ENCODING  (EFI_SUBCLASS_SPECIFIC | EXCEPT_EBC_INSTRUCTION_ENCODING)\r
+#define EFI_SW_EC_EBC_BAD_BREAK             (EFI_SUBCLASS_SPECIFIC | EXCEPT_EBC_BAD_BREAK)\r
+#define EFI_SW_EC_EBC_STEP                  (EFI_SUBCLASS_SPECIFIC | EXCEPT_EBC_STEP)\r
+\r
+//\r
+// Software Class IA32 Exception Subclass Error Code definitions.\r
+// These exceptions are derived from the debug protocol definitions in the EFI\r
+// specification.\r
+//\r
+#define EFI_SW_EC_IA32_DIVIDE_ERROR     (EFI_SUBCLASS_SPECIFIC | EXCEPT_IA32_DIVIDE_ERROR)\r
+#define EFI_SW_EC_IA32_DEBUG            (EFI_SUBCLASS_SPECIFIC | EXCEPT_IA32_DEBUG)\r
+#define EFI_SW_EC_IA32_NMI              (EFI_SUBCLASS_SPECIFIC | EXCEPT_IA32_NMI)\r
+#define EFI_SW_EC_IA32_BREAKPOINT       (EFI_SUBCLASS_SPECIFIC | EXCEPT_IA32_BREAKPOINT)\r
+#define EFI_SW_EC_IA32_OVERFLOW         (EFI_SUBCLASS_SPECIFIC | EXCEPT_IA32_OVERFLOW)\r
+#define EFI_SW_EC_IA32_BOUND            (EFI_SUBCLASS_SPECIFIC | EXCEPT_IA32_BOUND)\r
+#define EFI_SW_EC_IA32_INVALID_OPCODE   (EFI_SUBCLASS_SPECIFIC | EXCEPT_IA32_INVALID_OPCODE)\r
+#define EFI_SW_EC_IA32_DOUBLE_FAULT     (EFI_SUBCLASS_SPECIFIC | EXCEPT_IA32_DOUBLE_FAULT)\r
+#define EFI_SW_EC_IA32_INVALID_TSS      (EFI_SUBCLASS_SPECIFIC | EXCEPT_IA32_INVALID_TSS)\r
+#define EFI_SW_EC_IA32_SEG_NOT_PRESENT  (EFI_SUBCLASS_SPECIFIC | EXCEPT_IA32_SEG_NOT_PRESENT)\r
+#define EFI_SW_EC_IA32_STACK_FAULT      (EFI_SUBCLASS_SPECIFIC | EXCEPT_IA32_STACK_FAULT)\r
+#define EFI_SW_EC_IA32_GP_FAULT         (EFI_SUBCLASS_SPECIFIC | EXCEPT_IA32_GP_FAULT)\r
+#define EFI_SW_EC_IA32_PAGE_FAULT       (EFI_SUBCLASS_SPECIFIC | EXCEPT_IA32_PAGE_FAULT)\r
+#define EFI_SW_EC_IA32_FP_ERROR         (EFI_SUBCLASS_SPECIFIC | EXCEPT_IA32_FP_ERROR)\r
+#define EFI_SW_EC_IA32_ALIGNMENT_CHECK  (EFI_SUBCLASS_SPECIFIC | EXCEPT_IA32_ALIGNMENT_CHECK)\r
+#define EFI_SW_EC_IA32_MACHINE_CHECK    (EFI_SUBCLASS_SPECIFIC | EXCEPT_IA32_MACHINE_CHECK)\r
+#define EFI_SW_EC_IA32_SIMD             (EFI_SUBCLASS_SPECIFIC | EXCEPT_IA32_SIMD)\r
+\r
+//\r
+// Software Class X64 Exception Subclass Error Code definitions.\r
+// These exceptions are derived from the debug protocol definitions in the EFI\r
+// specification.\r
+//\r
+#define EFI_SW_EC_X64_DIVIDE_ERROR      (EFI_SUBCLASS_SPECIFIC | EXCEPT_X64_DIVIDE_ERROR)\r
+#define EFI_SW_EC_X64_DEBUG             (EFI_SUBCLASS_SPECIFIC | EXCEPT_X64_DEBUG)\r
+#define EFI_SW_EC_X64_NMI               (EFI_SUBCLASS_SPECIFIC | EXCEPT_X64_NMI)\r
+#define EFI_SW_EC_X64_BREAKPOINT        (EFI_SUBCLASS_SPECIFIC | EXCEPT_X64_BREAKPOINT)\r
+#define EFI_SW_EC_X64_OVERFLOW          (EFI_SUBCLASS_SPECIFIC | EXCEPT_X64_OVERFLOW)\r
+#define EFI_SW_EC_X64_BOUND             (EFI_SUBCLASS_SPECIFIC | EXCEPT_X64_BOUND)\r
+#define EFI_SW_EC_X64_INVALID_OPCODE    (EFI_SUBCLASS_SPECIFIC | EXCEPT_X64_INVALID_OPCODE)\r
+#define EFI_SW_EC_X64_DOUBLE_FAULT      (EFI_SUBCLASS_SPECIFIC | EXCEPT_X64_DOUBLE_FAULT)\r
+#define EFI_SW_EC_X64_INVALID_TSS       (EFI_SUBCLASS_SPECIFIC | EXCEPT_X64_INVALID_TSS)\r
+#define EFI_SW_EC_X64_SEG_NOT_PRESENT   (EFI_SUBCLASS_SPECIFIC | EXCEPT_X64_SEG_NOT_PRESENT)\r
+#define EFI_SW_EC_X64_STACK_FAULT       (EFI_SUBCLASS_SPECIFIC | EXCEPT_X64_STACK_FAULT)\r
+#define EFI_SW_EC_X64_GP_FAULT          (EFI_SUBCLASS_SPECIFIC | EXCEPT_X64_GP_FAULT)\r
+#define EFI_SW_EC_X64_PAGE_FAULT        (EFI_SUBCLASS_SPECIFIC | EXCEPT_X64_PAGE_FAULT)\r
+#define EFI_SW_EC_X64_FP_ERROR          (EFI_SUBCLASS_SPECIFIC | EXCEPT_X64_FP_ERROR)\r
+#define EFI_SW_EC_X64_ALIGNMENT_CHECK   (EFI_SUBCLASS_SPECIFIC | EXCEPT_X64_ALIGNMENT_CHECK)\r
+#define EFI_SW_EC_X64_MACHINE_CHECK     (EFI_SUBCLASS_SPECIFIC | EXCEPT_X64_MACHINE_CHECK)\r
+#define EFI_SW_EC_X64_SIMD              (EFI_SUBCLASS_SPECIFIC | EXCEPT_X64_SIMD)\r
+\r
+//\r
+// Software Class IPF Exception Subclass Error Code definitions.\r
+// These exceptions are derived from the debug protocol definitions in the EFI\r
+// specification.\r
+//\r
+#define EFI_SW_EC_IPF_ALT_DTLB            (EFI_SUBCLASS_SPECIFIC | EXCEPT_IPF_ALT_DTLB)\r
+#define EFI_SW_EC_IPF_DNESTED_TLB         (EFI_SUBCLASS_SPECIFIC | EXCEPT_IPF_DNESTED_TLB)\r
+#define EFI_SW_EC_IPF_BREAKPOINT          (EFI_SUBCLASS_SPECIFIC | EXCEPT_IPF_BREAKPOINT)\r
+#define EFI_SW_EC_IPF_EXTERNAL_INTERRUPT  (EFI_SUBCLASS_SPECIFIC | EXCEPT_IPF_EXTERNAL_INTERRUPT)\r
+#define EFI_SW_EC_IPF_GEN_EXCEPT          (EFI_SUBCLASS_SPECIFIC | EXCEPT_IPF_GEN_EXCEPT)\r
+#define EFI_SW_EC_IPF_NAT_CONSUMPTION     (EFI_SUBCLASS_SPECIFIC | EXCEPT_IPF_NAT_CONSUMPTION)\r
+#define EFI_SW_EC_IPF_DEBUG_EXCEPT        (EFI_SUBCLASS_SPECIFIC | EXCEPT_IPF_DEBUG_EXCEPT)\r
+#define EFI_SW_EC_IPF_UNALIGNED_ACCESS    (EFI_SUBCLASS_SPECIFIC | EXCEPT_IPF_UNALIGNED_ACCESS)\r
+#define EFI_SW_EC_IPF_FP_FAULT            (EFI_SUBCLASS_SPECIFIC | EXCEPT_IPF_FP_FAULT)\r
+#define EFI_SW_EC_IPF_FP_TRAP             (EFI_SUBCLASS_SPECIFIC | EXCEPT_IPF_FP_TRAP)\r
+#define EFI_SW_EC_IPF_TAKEN_BRANCH        (EFI_SUBCLASS_SPECIFIC | EXCEPT_IPF_TAKEN_BRANCH)\r
+#define EFI_SW_EC_IPF_SINGLE_STEP         (EFI_SUBCLASS_SPECIFIC | EXCEPT_IPF_SINGLE_STEP)\r
+\r
+\r
+//\r
+// Software Class PEI Service Subclass Error Code definitions.\r
+//\r
+//\r
+// Software Class EFI Boot Service Subclass Error Code definitions.\r
+//\r
+//\r
+// Software Class EFI Runtime Service Subclass Error Code definitions.\r
+//\r
+//\r
+// Software Class EFI DXE Service Subclass Error Code definitions.\r
+//\r
+\r
+///////////////////////////////////////////////////////////////////////////////\r
+// Section 7\r
+///////////////////////////////////////////////////////////////////////////////\r
+//\r
+// Debug Code definitions for all classes and subclass\r
+// Only one debug code is defined at this point and should\r
+// be used for anything that gets sent to debug stream.\r
+//\r
+#define EFI_DC_UNSPECIFIED  0x0\r
+\r
+#endif\r
diff --git a/IntelFrameworkPkg/Include/FrameworkBase.h b/IntelFrameworkPkg/Include/FrameworkBase.h
new file mode 100644 (file)
index 0000000..fb99890
--- /dev/null
@@ -0,0 +1,29 @@
+/** @file\r
+  Header file that supports Framework extension to UEFI for all types of\r
+  modules.\r
+\r
+  This header file must include Framework extension definitions common to all\r
+  types of modules.\r
+\r
+  Copyright (c) 2007, Intel Corporation\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+  Module Name:    FrameworkBase.h\r
+\r
+**/\r
+\r
+#ifndef _FRAMEWORK_BASE_H_\r
+#define _FRAMEWORK_BASE_H_\r
+\r
+#include <Common/FrameworkFirmwareFileSystem.h>\r
+#include <Common/FrameworkHob.h>\r
+#include <Common/FrameworkLegacy16.h>\r
+#include <Common/DataHubRecords.h>\r
+\r
+#endif\r
diff --git a/IntelFrameworkPkg/Include/FrameworkDxe.h b/IntelFrameworkPkg/Include/FrameworkDxe.h
new file mode 100644 (file)
index 0000000..6fb767e
--- /dev/null
@@ -0,0 +1,27 @@
+/** @file\r
+  Header file that supports Framework extension to UEFI/PI for DXE modules.\r
+\r
+  This header file must include Framework extension definitions common to DXE\r
+  modules.\r
+\r
+  Copyright (c) 2007, Intel Corporation\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+  Module Name:    FrameworkDxe.h\r
+\r
+**/\r
+\r
+#ifndef _FRAMEWORK_DXE_H_\r
+#define _FRAMEWORK_DXE_H_\r
+\r
+#include <FrameworkBase.h>\r
+#include <Common/FrameworkDxeCis.h>\r
+#include <Common/FrameworkStatusCode.h>\r
+\r
+#endif\r
diff --git a/IntelFrameworkPkg/Include/FrameworkPei.h b/IntelFrameworkPkg/Include/FrameworkPei.h
new file mode 100644 (file)
index 0000000..fdcbbcf
--- /dev/null
@@ -0,0 +1,27 @@
+/** @file\r
+  Header file that supports Framework extension to UEFI/PI for PEI modules.\r
+\r
+  This header file must include Framework extension definitions common to PEI\r
+  modules.\r
+\r
+  Copyright (c) 2007, Intel Corporation\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+  Module Name:    FrameworkPei.h\r
+\r
+**/\r
+\r
+#ifndef _FRAMEWORK_PEI_H_\r
+#define _FRAMEWORK_PEI_H_\r
+\r
+#include <FrameworkBase.h>\r
+#include <PiPei.h>\r
+#include <Common/FrameworkStatusCode.h>\r
+\r
+#endif\r
diff --git a/IntelFrameworkPkg/Include/FrameworkSmm.h b/IntelFrameworkPkg/Include/FrameworkSmm.h
new file mode 100644 (file)
index 0000000..0226b9a
--- /dev/null
@@ -0,0 +1,26 @@
+/** @file\r
+  Header file that supports Framework extension to UEFI/PI for DXE modules.\r
+\r
+  This header file must include Framework extension definitions common to DXE\r
+  modules.\r
+\r
+  Copyright (c) 2007, Intel Corporation\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+  Module Name:    FrameworkSmm.h\r
+\r
+**/\r
+\r
+#ifndef _FRAMEWORK_SMM_H_\r
+#define _FRAMEWORK_SMM_H_\r
+\r
+#include <FrameworkDxe.h>\r
+#include <Common/FrameworkSmmCis.h>\r
+\r
+#endif\r
diff --git a/IntelFrameworkPkg/Include/Guid/AcpiTableStorage.h b/IntelFrameworkPkg/Include/Guid/AcpiTableStorage.h
new file mode 100644 (file)
index 0000000..69a8bc0
--- /dev/null
@@ -0,0 +1,30 @@
+/** @file\r
+  The ACPI table storage file is fully FFS compliant.\r
+  The file is a number of sections of type EFI_SECTION_RAW.\r
+  This GUID is used to identify the file as an ACPI table storage file.\r
+\r
+  Copyright (c) 2007, Intel Corporation\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+  Module Name:  AcpiTableStorage.h\r
+\r
+  @par Revision Reference:\r
+  GUID defined in ACPI Table Storage Spec Version 0.9.\r
+\r
+**/\r
+\r
+#ifndef _ACPI_TABLE_STORAGE_H_\r
+#define _ACPI_TABLE_STORAGE_H_\r
+\r
+#define EFI_ACPI_TABLE_STORAGE_GUID \\r
+  { 0x7e374e25, 0x8e01, 0x4fee, {0x87, 0xf2, 0x39, 0xc, 0x23, 0xc6, 0x6, 0xcd } }\r
+\r
+extern EFI_GUID gEfiAcpiTableStorageGuid;\r
+\r
+#endif\r
diff --git a/IntelFrameworkPkg/Include/Guid/Capsule.h b/IntelFrameworkPkg/Include/Guid/Capsule.h
new file mode 100644 (file)
index 0000000..6449666
--- /dev/null
@@ -0,0 +1,43 @@
+/** @file\r
+  GUIDs used for EFI Capsule\r
+\r
+  Copyright (c) 2007, Intel Corporation\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+  Module Name:  Capsule.h\r
+\r
+  @par Revision Reference:\r
+  GUIDs defined in Capsule Spec Version 0.9\r
+\r
+**/\r
+\r
+#ifndef _CAPSULE_GUID_H__\r
+#define _CAPSULE_GUID_H__\r
+\r
+//\r
+// This is the GUID of the capsule header of the image on disk.\r
+//\r
+#define EFI_CAPSULE_GUID \\r
+  { \\r
+    0x3B6686BD, 0x0D76, 0x4030, {0xB7, 0x0E, 0xB5, 0x51, 0x9E, 0x2F, 0xC5, 0xA0 } \\r
+  }\r
+\r
+//\r
+// This is the GUID of the configuration results file created by the capsule\r
+// application.\r
+//\r
+#define EFI_CONFIG_FILE_NAME_GUID \\r
+  { \\r
+    0x98B8D59B, 0xE8BA, 0x48EE, {0x98, 0xDD, 0xC2, 0x95, 0x39, 0x2F, 0x1E, 0xDB } \\r
+  }\r
+\r
+extern EFI_GUID gEfiCapsuleGuid;\r
+extern EFI_GUID gEfiConfigFileNameGuid;\r
+\r
+#endif\r
diff --git a/IntelFrameworkPkg/Include/Guid/DataHubRecords.h b/IntelFrameworkPkg/Include/Guid/DataHubRecords.h
new file mode 100644 (file)
index 0000000..f50a6d3
--- /dev/null
@@ -0,0 +1,63 @@
+/** @file\r
+  DataHubRecord.h include all data hub sub class GUID defitions.\r
+\r
+  Copyright (c) 2007, Intel Corporation\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+  Module Name:\r
+\r
+  @par Revision Reference:\r
+  These GUID are from Cache subclass spec 0.9, DataHub SubClass spec 0.9, Memory SubClass Spec 0.9,\r
+  Processor Subclass spec 0.9, Misc SubClass spec 0.9.\r
+\r
+**/\r
+#ifndef _DATAHUB_RECORDS_GUID_H_\r
+#define _DATAHUB_RECORDS_GUID_H_\r
+\r
+#define EFI_PROCESSOR_PRODUCER_GUID \\r
+  { 0x1bf06aea, 0x5bec, 0x4a8d, {0x95, 0x76, 0x74, 0x9b, 0x09, 0x56, 0x2d, 0x30 } }\r
+\r
+extern  EFI_GUID gEfiProcessorProducerGuid;\r
+\r
+\r
+#define EFI_PROCESSOR_SUBCLASS_GUID \\r
+  { 0x26fdeb7e, 0xb8af, 0x4ccf, {0xaa, 0x97, 0x02, 0x63, 0x3c, 0xe4, 0x8c, 0xa7 } }\r
+\r
+extern  EFI_GUID gEfiProcessorSubClassGuid;\r
+\r
+\r
+#define EFI_CACHE_SUBCLASS_GUID \\r
+  { 0x7f0013a7, 0xdc79, 0x4b22, {0x80, 0x99, 0x11, 0xf7, 0x5f, 0xdc, 0x82, 0x9d } }\r
+\r
+extern  EFI_GUID gEfiCacheSubClassGuid;\r
+\r
+\r
+#define EFI_MEMORY_PRODUCER_GUID \\r
+  { 0x1d7add6e, 0xb2da, 0x4b0b, {0xb2, 0x9f, 0x49, 0xcb, 0x42, 0xf4, 0x63, 0x56 } }\r
+\r
+extern  EFI_GUID gEfiMemoryProducerGuid;\r
+\r
+\r
+#define EFI_MEMORY_SUBCLASS_GUID \\r
+  {0x4E8F4EBB, 0x64B9, 0x4e05, {0x9B, 0x18, 0x4C, 0xFE, 0x49, 0x23, 0x50, 0x97} }\r
+\r
+extern  EFI_GUID  gEfiMemorySubClassGuid;\r
+\r
+\r
+#define EFI_MISC_PRODUCER_GUID \\r
+  { 0x62512c92, 0x63c4, 0x4d80, {0x82, 0xb1, 0xc1, 0xa4, 0xdc, 0x44, 0x80, 0xe5 } }\r
+\r
+extern  EFI_GUID gEfiMiscProducerGuid;\r
+\r
+#define EFI_MISC_SUBCLASS_GUID \\r
+  { 0x772484B2, 0x7482, 0x4b91, {0x9F, 0x9A, 0xAD, 0x43, 0xF8, 0x1C, 0x58, 0x81 } }\r
+\r
+extern  EFI_GUID  gEfiMiscSubClassGuid;\r
+\r
+#endif\r
diff --git a/IntelFrameworkPkg/Include/Guid/FrameworkDevicePath.h b/IntelFrameworkPkg/Include/Guid/FrameworkDevicePath.h
new file mode 100644 (file)
index 0000000..81f8ff0
--- /dev/null
@@ -0,0 +1,29 @@
+/** @file\r
+  This GUID is used to define a vendor specific device path being owned by the\r
+  Framework specificaitons.\r
+\r
+  Copyright (c) 2007, Intel Corporation\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+  Module Name:  FrameworkDevicePath.h\r
+\r
+  @par Revision Reference:\r
+  Spec Version 0.9\r
+\r
+**/\r
+\r
+#ifndef _FRAMEWORK_DEVICE_PATH_GUID_H_\r
+#define _FRAMEWORK_DEVICE_PATH_GUID_H_\r
+\r
+#define EFI_FRAMEWORK_DEVICE_PATH_GUID  \\r
+  { 0xb7084e63, 0x46b7, 0x4d1a, { 0x86, 0x77, 0xe3, 0x0b, 0x53, 0xdb, 0xf0, 0x50 } }\r
+\r
+extern EFI_GUID gEfiFrameworkDevicePathGuid;\r
+\r
+#endif\r
diff --git a/IntelFrameworkPkg/Include/Guid/SmmCommunicate.h b/IntelFrameworkPkg/Include/Guid/SmmCommunicate.h
new file mode 100644 (file)
index 0000000..8d36fe9
--- /dev/null
@@ -0,0 +1,40 @@
+/** @file\r
+  Definitions EFI_SMM_COMMUNICATE_HEADER used by EFI_SMM_BASE_PROTOCOL.Communicate()\r
+  functions\r
+\r
+  Copyright (c) 2007, Intel Corporation\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+  Module Name:  SmmCommunicate.h\r
+\r
+  @par Revision Reference:\r
+  GUIDs defined in SmmCis spec version 0.9\r
+\r
+**/\r
+\r
+#ifndef _SMM_COMMUNICATE_GUID_H_\r
+#define _SMM_COMMUNICATE_GUID_H_\r
+\r
+//******************************************************\r
+// EFI_SMM_COMMUNICATE_HEADER\r
+//******************************************************\r
+#define SMM_COMMUNICATE_HEADER_GUID \\r
+  { \\r
+    0xf328e36c, 0x23b6, 0x4a95, {0x85, 0x4b, 0x32, 0xe1, 0x95, 0x34, 0xcd, 0x75 } \\r
+  }\r
+\r
+typedef struct {\r
+  EFI_GUID                         HeaderGuid;\r
+  UINTN                            MessageLength;\r
+  UINT8                            Data[1];\r
+} EFI_SMM_COMMUNICATE_HEADER;\r
+\r
+extern EFI_GUID gSmmCommunicateHeaderGuid;\r
+\r
+#endif\r
diff --git a/IntelFrameworkPkg/Include/Guid/SmramMemoryReserve.h b/IntelFrameworkPkg/Include/Guid/SmramMemoryReserve.h
new file mode 100644 (file)
index 0000000..680f0b9
--- /dev/null
@@ -0,0 +1,67 @@
+/** @file\r
+  GUID for use in reserving SMRAM regions.\r
+\r
+  Copyright (c) 2007, Intel Corporation\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+  Module Name:  SmramMemoryReserve.h\r
+\r
+  @par Revision Reference:\r
+  GUIDs defined in SmmCis spec version 0.9\r
+\r
+**/\r
+\r
+#ifndef _EFI_SMM_PEI_SMRAM_MEMORY_RESERVE_H_\r
+#define _EFI_SMM_PEI_SMRAM_MEMORY_RESERVE_H_\r
+\r
+#define EFI_SMM_PEI_SMRAM_MEMORY_RESERVE \\r
+  { \\r
+    0x6dadf1d1, 0xd4cc, 0x4910, {0xbb, 0x6e, 0x82, 0xb1, 0xfd, 0x80, 0xff, 0x3d } \\r
+  }\r
+\r
+//\r
+// *******************************************************\r
+//  EFI_SMRAM_DESCRIPTOR\r
+// *******************************************************\r
+//\r
+typedef struct {\r
+  EFI_PHYSICAL_ADDRESS  PhysicalStart;  // Phsyical location in DRAM\r
+  EFI_PHYSICAL_ADDRESS  CpuStart;       // Address CPU uses to access the SMI handler\r
+  // May or may not match PhysicalStart\r
+  //\r
+  UINT64                PhysicalSize;\r
+  UINT64                RegionState;\r
+} EFI_SMRAM_DESCRIPTOR;\r
+\r
+//\r
+// *******************************************************\r
+//  EFI_SMRAM_STATE\r
+// *******************************************************\r
+//\r
+#define EFI_SMRAM_OPEN                0x00000001\r
+#define EFI_SMRAM_CLOSED              0x00000002\r
+#define EFI_SMRAM_LOCKED              0x00000004\r
+#define EFI_CACHEABLE                 0x00000008\r
+#define EFI_ALLOCATED                 0x00000010\r
+#define EFI_NEEDS_TESTING             0x00000020\r
+#define EFI_NEEDS_ECC_INITIALIZATION  0x00000040\r
+\r
+//\r
+// *******************************************************\r
+//  EFI_SMRAM_HOB_DESCRIPTOR_BLOCK\r
+// *******************************************************\r
+//\r
+typedef struct {\r
+  UINTN                 NumberOfSmmReservedRegions;\r
+  EFI_SMRAM_DESCRIPTOR  Descriptor[1];\r
+} EFI_SMRAM_HOB_DESCRIPTOR_BLOCK;\r
+\r
+extern EFI_GUID gEfiSmmPeiSmramMemoryReserveGuid;\r
+\r
+#endif\r
diff --git a/IntelFrameworkPkg/Include/Ppi/BlockIo.h b/IntelFrameworkPkg/Include/Ppi/BlockIo.h
new file mode 100644 (file)
index 0000000..df209f5
--- /dev/null
@@ -0,0 +1,158 @@
+/** @file\r
+  This file declares BlockIo PPI used to access block-oriented storage devices\r
+\r
+  Copyright (c) 2007, Intel Corporation\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+  Module Name:  BlockIo.h\r
+\r
+  @par Revision Reference:\r
+  This PPI is defined in Framework of EFI Recovery Spec\r
+  Version 0.9\r
+\r
+**/\r
+\r
+#ifndef _PEI_BLOCK_IO_H_\r
+#define _PEI_BLOCK_IO_H_\r
+\r
+#define EFI_PEI_IDE_BLOCK_IO_PPI \\r
+  { \\r
+    0x0964e5b22, 0x6459, 0x11d2, { 0x8e, 0x39, 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b }  \\r
+  }\r
+\r
+#define EFI_PEI_144_FLOPPY_BLOCK_IO_PPI \\r
+  { \\r
+    0xda6855bd, 0x07b7, 0x4c05, { 0x9e, 0xd8, 0xe2, 0x59, 0xfd, 0x36, 0x0e, 0x22 }  \\r
+  }\r
+\r
+#define EFI_PEI_VIRTUAL_BLOCK_IO_PPI \\r
+  { \\r
+    0x695d8aa1, 0x42ee, 0x4c46, { 0x80, 0x5c, 0x6e, 0xa6, 0xbc, 0xe7, 0x99, 0xe3 } \\r
+  }\r
+\r
+typedef struct _EFI_PEI_RECOVERY_BLOCK_IO_PPI EFI_PEI_RECOVERY_BLOCK_IO_PPI;\r
+\r
+typedef UINT64  EFI_PEI_LBA;\r
+\r
+typedef enum {\r
+  LegacyFloppy  = 0,\r
+  IdeCDROM      = 1,\r
+  IdeLS120      = 2,\r
+  UsbMassStorage= 3,\r
+  MaxDeviceType\r
+} EFI_PEI_BLOCK_DEVICE_TYPE;\r
+\r
+typedef struct {\r
+  EFI_PEI_BLOCK_DEVICE_TYPE  DeviceType;\r
+  BOOLEAN                    MediaPresent;\r
+  UINTN                      LastBlock;\r
+  UINTN                      BlockSize;\r
+} EFI_PEI_BLOCK_IO_MEDIA;\r
+\r
+/**\r
+  Gets the count of block I/O devices that one specific block driver detects.\r
+\r
+  @param  PeiServices        General-purpose services that are available to every PEIM.\r
+  @param  This               Indicates the EFI_PEI_RECOVERY_BLOCK_IO_PPI instance.\r
+  @param  NumberBlockDevices The number of block I/O devices discovered.\r
+\r
+  @return Status code\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_PEI_GET_NUMBER_BLOCK_DEVICES) (\r
+  IN  EFI_PEI_SERVICES                         **PeiServices,\r
+  IN  EFI_PEI_RECOVERY_BLOCK_IO_PPI            *This,\r
+  OUT UINTN                                    *NumberBlockDevices\r
+  );\r
+\r
+/**\r
+  Gets a block device's media information.\r
+\r
+  @param  PeiServices    General-purpose services that are available to every PEIM\r
+  @param  This           Indicates the EFI_PEI_RECOVERY_BLOCK_IO_PPI instance.\r
+  @param  DeviceIndex    Specifies the block device to which the function\r
+                         wants to talk. Because the driver that implements Block I/O PPIs\r
+                         will manage multiple block devices, the PPIs that want to talk to a single\r
+                         device must specify the device index that was assigned during the enumeration\r
+                         process. This index is a number from one to NumberBlockDevices.\r
+  @param  MediaInfo      The media information of the specified block media.\r
+\r
+  @retval EFI_SUCCESS           Media information about the specified block device was obtained successfully.\r
+  @retval EFI_DEVICE_ERROR      Cannot get the media information due to a hardware error.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_PEI_GET_DEVICE_MEDIA_INFORMATION) (\r
+  IN  EFI_PEI_SERVICES                         **PeiServices,\r
+  IN  EFI_PEI_RECOVERY_BLOCK_IO_PPI            *This,\r
+  IN  UINTN                                    DeviceIndex,\r
+  OUT EFI_PEI_BLOCK_IO_MEDIA                   *MediaInfo\r
+  );\r
+\r
+/**\r
+  Reads the requested number of blocks from the specified block device.\r
+\r
+  @param  PeiServices    General-purpose services that are available to every PEIM.\r
+  @param  This           Indicates the EFI_PEI_RECOVERY_BLOCK_IO_PPI instance.\r
+  @param  DeviceIndex    Specifies the block device to which the function wants to talk.\r
+  @param  StartLBA       The starting logical block address (LBA) to read from on the device\r
+  @param  BufferSize     The size of the Buffer in bytes. This number must\r
+                         be a multiple of the intrinsic block size of the device.\r
+  @param  Buffer         A pointer to the destination buffer for the data.\r
+                         The caller is responsible for the ownership of the buffer.\r
+\r
+  @retval EFI_SUCCESS           The data was read correctly from the device.\r
+  @retval EFI_DEVICE_ERROR      The device reported an error while attempting to perform the read operation.\r
+  @retval EFI_INVALID_PARAMETER The read request contains LBAs that are not valid,\r
+                                or the buffer is not properly aligned.\r
+  @retval EFI_BAD_BUFFER_SIZE   The BufferSize parameter is not a multiple of\r
+                                the intrinsic block size of the device.\r
+  @retval EFI_NO_MEDIA          There is no media in the device.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_PEI_READ_BLOCKS) (\r
+  IN  EFI_PEI_SERVICES                         **PeiServices,\r
+  IN  EFI_PEI_RECOVERY_BLOCK_IO_PPI            *This,\r
+  IN  UINTN                                    DeviceIndex,\r
+  IN  EFI_PEI_LBA                              StartLBA,\r
+  IN  UINTN                                    BufferSize,\r
+  OUT VOID                                     *Buffer\r
+  );\r
+\r
+/**\r
+  @par Ppi Description:\r
+  EFI_PEI_RECOVERY_BLOCK_IO_PPI provides the services that are required\r
+  to access a block I/O device during PEI recovery boot mode.\r
+\r
+  @param GetNumberOfBlockDevices\r
+  Gets the number of block I/O devices that the specific block driver manages.\r
+\r
+  @param GetBlockDeviceMediaInfo\r
+  Gets the specified media information.\r
+\r
+  @param ReadBlocks\r
+  Reads the requested number of blocks from the specified block device.\r
+\r
+**/\r
+struct _EFI_PEI_RECOVERY_BLOCK_IO_PPI {\r
+  EFI_PEI_GET_NUMBER_BLOCK_DEVICES      GetNumberOfBlockDevices;\r
+  EFI_PEI_GET_DEVICE_MEDIA_INFORMATION  GetBlockDeviceMediaInfo;\r
+  EFI_PEI_READ_BLOCKS                   ReadBlocks;\r
+};\r
+\r
+extern EFI_GUID gEfiPeiIdeBlockIoPpiGuid;\r
+extern EFI_GUID gEfiPei144FloppyBlockIoPpiGuid;\r
+extern EFI_GUID gEfiPeiVirtualBlockIoPpiGuid;\r
+\r
+#endif\r
diff --git a/IntelFrameworkPkg/Include/Ppi/BootScriptExecuter.h b/IntelFrameworkPkg/Include/Ppi/BootScriptExecuter.h
new file mode 100644 (file)
index 0000000..1d249f0
--- /dev/null
@@ -0,0 +1,72 @@
+/** @file\r
+  This file declares Boot Script Executer PPI.\r
+\r
+  Copyright (c) 2007, Intel Corporation\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+  Module Name:  BootScriptExecuter.h\r
+\r
+  @par Revision Reference:\r
+  This PPI is defined in Framework of EFI BootScript spec.\r
+  Version 0.91.\r
+\r
+**/\r
+\r
+#ifndef _PEI_BOOT_SCRIPT_EXECUTER_PPI_H\r
+#define _PEI_BOOT_SCRIPT_EXECUTER_PPI_H\r
+\r
+#define EFI_PEI_BOOT_SCRIPT_EXECUTER_PPI_GUID \\r
+  { \\r
+    0xabd42895, 0x78cf, 0x4872, {0x84, 0x44, 0x1b, 0x5c, 0x18, 0x0b, 0xfb, 0xff } \\r
+  }\r
+\r
+typedef struct _EFI_PEI_BOOT_SCRIPT_EXECUTER_PPI EFI_PEI_BOOT_SCRIPT_EXECUTER_PPI;\r
+\r
+/**\r
+  Executes the Framework boot script table.\r
+\r
+  @param  PeiServices    A pointer to the system PEI Services Table.\r
+  @param  This           A pointer to the EFI_PEI_BOOT_SCRIPT_EXECUTER_PPI instance.\r
+  @param  Address        The physical memory address where the table is stored.\r
+                         It must be zero if the table to be executed is stored in a firmware volume file.\r
+  @param  FvFile         The firmware volume file name that contains the table to\r
+                         be executed. It must be NULL if the table to be executed is stored in physical memory.\r
+\r
+  @retval EFI_SUCCESS           The boot script table was executed successfully.\r
+  @retval EFI_INVALID_PARAMETER Address is zero and FvFile is NULL.\r
+  @retval EFI_NOT_FOUND         The file name specified in FvFile cannot be found.\r
+  @retval EFI_UNSUPPORTED       The format of the boot script table is invalid.\r
+                                Or An unsupported opcode occurred in the table.\r
+                                Or There were opcode execution errors, such as an insufficient dependency.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_PEI_BOOT_SCRIPT_EXECUTE) (\r
+  IN     EFI_PEI_SERVICES                        **PeiServices,\r
+  IN     EFI_PEI_BOOT_SCRIPT_EXECUTER_PPI        *This,\r
+  IN     EFI_PHYSICAL_ADDRESS                    Address,\r
+  IN     EFI_GUID                                *FvFile OPTIONAL\r
+  );\r
+\r
+/**\r
+  @par Ppi Description:\r
+  This PPI produces functions to interpret and execute the Framework boot script table.\r
+\r
+  @param Execute\r
+  Executes a boot script table.\r
+\r
+**/\r
+struct _EFI_PEI_BOOT_SCRIPT_EXECUTER_PPI {\r
+  EFI_PEI_BOOT_SCRIPT_EXECUTE Execute;\r
+};\r
+\r
+extern EFI_GUID gEfiPeiBootScriptExecuterPpiGuid;\r
+\r
+#endif\r
diff --git a/IntelFrameworkPkg/Include/Ppi/RecoveryModule.h b/IntelFrameworkPkg/Include/Ppi/RecoveryModule.h
new file mode 100644 (file)
index 0000000..8136271
--- /dev/null
@@ -0,0 +1,64 @@
+/** @file\r
+  This file declares Recovery Module PPI.\r
+\r
+  Copyright (c) 2007, Intel Corporation\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+  Module Name:  RecoveryModule.h\r
+\r
+  @par Revision Reference:\r
+  This PPI is defined in Framework of EFI Recovery Spec.\r
+  Version 0.9\r
+\r
+**/\r
+\r
+#ifndef __PEI_RECOVERY_MODULE_PPI_H__\r
+#define __PEI_RECOVERY_MODULE_PPI_H__\r
+\r
+#define EFI_PEI_RECOVERY_MODULE_PPI_GUID \\r
+  { \\r
+    0xFB6D9542, 0x612D, 0x4f45, {0x87, 0x2F, 0x5C, 0xFF, 0x52, 0xE9, 0x3D, 0xCF } \\r
+  }\r
+\r
+typedef struct _EFI_PEI_RECOVERY_MODULE_PPI EFI_PEI_RECOVERY_MODULE_PPI;\r
+\r
+/**\r
+  Loads a DXE capsule from some media into memory and updates the HOB table\r
+  with the DXE firmware volume information.\r
+\r
+  @param  PeiServices    General-purpose services that are available to every PEIM.\r
+  @param  This           Indicates the EFI_PEI_RECOVERY_MODULE_PPI instance.\r
+\r
+  @retval EFI_SUCCESS           The capsule was loaded correctly.\r
+  @retval EFI_DEVICE_ERROR      A device error occurred.\r
+  @retval EFI_NOT_FOUND         A recovery DXE capsule cannot be found.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_PEI_LOAD_RECOVERY_CAPSULE) (\r
+  IN EFI_PEI_SERVICES                     **PeiServices,\r
+  IN EFI_PEI_RECOVERY_MODULE_PPI          *This\r
+  );\r
+\r
+/**\r
+  @par Ppi Description:\r
+  Finds and loads the recovery files.\r
+\r
+  @param LoadRecoveryCapsule\r
+  Loads a DXE binary capsule into memory.\r
+\r
+**/\r
+struct _EFI_PEI_RECOVERY_MODULE_PPI {\r
+  EFI_PEI_LOAD_RECOVERY_CAPSULE LoadRecoveryCapsule;\r
+};\r
+\r
+extern EFI_GUID gEfiPeiRecoveryModulePpiGuid;\r
+\r
+#endif\r
diff --git a/IntelFrameworkPkg/Include/Ppi/S3Resume.h b/IntelFrameworkPkg/Include/Ppi/S3Resume.h
new file mode 100644 (file)
index 0000000..d031018
--- /dev/null
@@ -0,0 +1,64 @@
+/** @file\r
+  This file declares S3 Resume PPI.\r
+\r
+  Copyright (c) 2007, Intel Corporation\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+  Module Name:  S3Resume.h\r
+\r
+  @par Revision Reference:\r
+  This PPI is defined in Framework of EFI S3 Resume Boot Path spec.\r
+  Version 0.9\r
+\r
+**/\r
+\r
+#ifndef __PEI_S3_RESUME_PPI_H__\r
+#define __PEI_S3_RESUME_PPI_H__\r
+\r
+#define EFI_PEI_S3_RESUME_PPI_GUID \\r
+  { \\r
+    0x4426CCB2, 0xE684, 0x4a8a, {0xAE, 0x40, 0x20, 0xD4, 0xB0, 0x25, 0xB7, 0x10 } \\r
+  }\r
+\r
+typedef struct _EFI_PEI_S3_RESUME_PPI   EFI_PEI_S3_RESUME_PPI;\r
+\r
+/**\r
+  Restores the platform to its preboot configuration for an S3 resume and\r
+  jumps to the OS waking vector.\r
+\r
+  @param  PeiServices    Pointer to the PEI Services Table\r
+\r
+  @retval EFI_ABORTED           Execution of the S3 resume boot script table failed.\r
+  @retval EFI_NOT_FOUND         Some necessary information that is used for\r
+                                the S3 resume boot path could not be located.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_PEI_S3_RESUME_PPI_RESTORE_CONFIG) (\r
+  IN EFI_PEI_SERVICES   **PeiServices\r
+  );\r
+\r
+/**\r
+  @par Ppi Description:\r
+  EFI_PEI_S3_RESUME_PPI accomplishes the firmware S3 resume boot\r
+  path and transfers control to OS.\r
+\r
+  @param S3RestoreConfig\r
+  Restores the platform to its preboot configuration for an S3 resume and\r
+  jumps to the OS waking vector.\r
+\r
+**/\r
+struct _EFI_PEI_S3_RESUME_PPI {\r
+  EFI_PEI_S3_RESUME_PPI_RESTORE_CONFIG  S3RestoreConfig;\r
+};\r
+\r
+extern EFI_GUID gEfiPeiS3ResumePpiGuid;\r
+\r
+#endif\r
diff --git a/IntelFrameworkPkg/Include/Ppi/Smbus.h b/IntelFrameworkPkg/Include/Ppi/Smbus.h
new file mode 100644 (file)
index 0000000..54e6f58
--- /dev/null
@@ -0,0 +1,228 @@
+/** @file\r
+  This file declares Smbus PPI.\r
+\r
+  Copyright (c) 2007, Intel Corporation\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+  Module Name:  Smbus.h\r
+\r
+  @par Revision Reference:\r
+  This PPI is defined in Framework of EFI SmBus PPI spec.\r
+  Version 0.9\r
+\r
+**/\r
+\r
+#ifndef _PEI_SMBUS_PPI_H\r
+#define _PEI_SMBUS_PPI_H\r
+\r
+#include <IndustryStandard/SmBus.h>\r
+\r
+#define EFI_PEI_SMBUS_PPI_GUID \\r
+  { \\r
+    0xabd42895, 0x78cf, 0x4872, {0x84, 0x44, 0x1b, 0x5c, 0x18, 0xb, 0xfb, 0xda } \\r
+  }\r
+\r
+typedef struct _EFI_PEI_SMBUS_PPI EFI_PEI_SMBUS_PPI;\r
+\r
+/**\r
+  Executes an SMBus operation to an SMBus controller.\r
+\r
+  @param  PeiServices    A pointer to the system PEI Services Table.\r
+  @param  This           A pointer to the EFI_PEI_SMBUS_PPI instance.\r
+  @param  SlaveAddress   The SMBUS hardware address to which the SMBUS\r
+                         device is preassigned or allocated.\r
+  @param  Command        This command is transmitted by the SMBus host\r
+                         controller to the SMBus slave device and the interpretation is\r
+                         SMBus slave device specific.\r
+  @param  Operation      Signifies which particular SMBus hardware protocol\r
+                         instance that it will use to execute the SMBus transactions.\r
+  @param  PecCheck       Defines if Packet Error Code (PEC) checking is required\r
+                         for this operation.\r
+  @param  Length         Signifies the number of bytes that this operation will do.\r
+  @param  Buffer         Contains the value of data to execute to the SMBus slave device.\r
+\r
+  @retval EFI_SUCCESS           The last data that was returned from the access\r
+                                matched the poll exit criteria.\r
+  @retval EFI_CRC_ERROR         The checksum is not correct (PEC is incorrect)\r
+  @retval EFI_TIMEOUT           Timeout expired before the operation was completed.\r
+                                Timeout is determined by the SMBus host controller device.\r
+  @retval EFI_OUT_OF_RESOURCES  The request could not be completed\r
+                                due to a lack of resources.\r
+  @retval EFI_DEVICE_ERROR      The request was not completed because\r
+                                a failure reflected in the Host Status Register bit.\r
+  @retval EFI_INVALID_PARAMETER Operation is not defined in EFI_SMBUS_OPERATION.\r
+                                Or Length/Buffer is NULL for operations except for EfiSmbusQuickRead and\r
+                                EfiSmbusQuickWrite. Length is outside the range of valid values.\r
+  @retval EFI_UNSUPPORTED       The SMBus operation or PEC is not supported.\r
+  @retval EFI_BUFFER_TOO_SMALL  Buffer is not sufficient for this operation.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_PEI_SMBUS_PPI_EXECUTE_OPERATION) (\r
+  IN      EFI_PEI_SERVICES          **PeiServices,\r
+  IN EFI_PEI_SMBUS_PPI              *This,\r
+  IN      EFI_SMBUS_DEVICE_ADDRESS  SlaveAddress,\r
+  IN      EFI_SMBUS_DEVICE_COMMAND  Command,\r
+  IN      EFI_SMBUS_OPERATION       Operation,\r
+  IN      BOOLEAN                   PecCheck,\r
+  IN OUT  UINTN                     *Length,\r
+  IN OUT  VOID                      *Buffer\r
+  );\r
+\r
+typedef struct {\r
+  UINT32  VendorSpecificId;\r
+  UINT16  SubsystemDeviceId;\r
+  UINT16  SubsystemVendorId;\r
+  UINT16  Interface;\r
+  UINT16  DeviceId;\r
+  UINT16  VendorId;\r
+  UINT8   VendorRevision;\r
+  UINT8   DeviceCapabilities;\r
+} EFI_SMBUS_UDID;\r
+\r
+/**\r
+  CallBack function can be registered in EFI_PEI_SMBUS_PPI_NOTIFY.\r
+\r
+  @param  PeiServices    A pointer to the system PEI Services Table.\r
+  @param  This           A pointer to the EFI_PEI_SMBUS_PPI instance.\r
+  @param  SlaveAddress   The SMBUS hardware address to which the SMBUS\r
+                         device is preassigned or allocated.\r
+  @param  Data           Data of the SMBus host notify command that\r
+                         the caller wants to be called.\r
+\r
+  @return Status Code\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_PEI_SMBUS_NOTIFY_FUNCTION) (\r
+  IN      EFI_PEI_SERVICES              **PeiServices,\r
+  IN EFI_PEI_SMBUS_PPI                  *SmbusPpi,\r
+  IN      EFI_SMBUS_DEVICE_ADDRESS      SlaveAddress,\r
+  IN      UINTN                         Data\r
+  );\r
+\r
+/**\r
+  The ArpDevice() function enumerates the entire bus or enumerates a specific\r
+  device that is identified by SmbusUdid.\r
+\r
+  @param  PeiServices    A pointer to the system PEI Services Table.\r
+  @param  This           A pointer to the EFI_PEI_SMBUS_PPI instance.\r
+  @param  ArpAll         A Boolean expression that indicates if the host drivers need\r
+                         to enumerate all the devices or enumerate only the device that is identified\r
+                         by SmbusUdid. If ArpAll is TRUE, SmbusUdid and SlaveAddress are optional.\r
+                         If ArpAll is FALSE, ArpDevice will enumerate SmbusUdid and the address\r
+                         will be at SlaveAddress.\r
+  @param  SmbusUdid      The targeted SMBus Unique Device Identifier (UDID).\r
+                         The UDID may not exist for SMBus devices with fixed addresses.\r
+  @param  SlaveAddress   The new SMBus address for the slave device for\r
+                         which the operation is targeted.\r
+\r
+  @retval EFI_SUCCESS           The SMBus slave device address was set.\r
+  @retval EFI_INVALID_PARAMETER SlaveAddress is NULL.\r
+  @retval EFI_OUT_OF_RESOURCES  The request could not be completed\r
+                                due to a lack of resources.\r
+  @retval EFI_TIMEOUT           The SMBus slave device did not respond.\r
+  @retval EFI_DEVICE_ERROR      The request was not completed because the transaction failed.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_PEI_SMBUS_PPI_ARP_DEVICE) (\r
+  IN      EFI_PEI_SERVICES          **PeiServices,\r
+  IN EFI_PEI_SMBUS_PPI              *This,\r
+  IN      BOOLEAN                   ArpAll,\r
+  IN      EFI_SMBUS_UDID            *SmbusUdid, OPTIONAL\r
+  IN OUT  EFI_SMBUS_DEVICE_ADDRESS  *SlaveAddress OPTIONAL\r
+  );\r
+\r
+typedef struct {\r
+  EFI_SMBUS_DEVICE_ADDRESS  SmbusDeviceAddress;\r
+  EFI_SMBUS_UDID            SmbusDeviceUdid;\r
+} EFI_SMBUS_DEVICE_MAP;\r
+\r
+/**\r
+  The GetArpMap() function returns the mapping of all the SMBus devices\r
+  that are enumerated by the SMBus host driver.\r
+\r
+  @param  PeiServices    A pointer to the system PEI Services Table.\r
+  @param  This           A pointer to the EFI_PEI_SMBUS_PPI instance.\r
+  @param  Length         Size of the buffer that contains the SMBus device map.\r
+  @param  SmbusDeviceMap The pointer to the device map as enumerated\r
+                         by the SMBus controller driver.\r
+\r
+  @retval EFI_SUCCESS           The device map was returned correctly in the buffer.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_PEI_SMBUS_PPI_GET_ARP_MAP) (\r
+  IN      EFI_PEI_SERVICES          **PeiServices,\r
+  IN EFI_PEI_SMBUS_PPI              *This,\r
+  IN OUT  UINTN                     *Length,\r
+  IN OUT  EFI_SMBUS_DEVICE_MAP      **SmbusDeviceMap\r
+  );\r
+\r
+/**\r
+  The Notify() function registers all the callback functions to allow the\r
+  bus driver to call these functions when the SlaveAddress/Data pair happens.\r
+\r
+  @param  PeiServices    A pointer to the system PEI Services Table.\r
+  @param  This           A pointer to the EFI_PEI_SMBUS_PPI instance.\r
+  @param  SlaveAddress   Address that the host controller detects as\r
+                         sending a message and calls all the registered functions.\r
+  @param  Data           Data that the host controller detects as sending a message\r
+                         and calls all the registered functions.\r
+  @param  NotifyFunction The function to call when the bus driver\r
+                         detects the SlaveAddress and Data pair.\r
+\r
+  @retval EFI_SUCCESS           NotifyFunction has been registered.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_PEI_SMBUS_PPI_NOTIFY) (\r
+  IN      EFI_PEI_SERVICES          **PeiServices,\r
+  IN EFI_PEI_SMBUS_PPI              *This,\r
+  IN      EFI_SMBUS_DEVICE_ADDRESS  SlaveAddress,\r
+  IN      UINTN                     Data,\r
+  IN  EFI_PEI_SMBUS_NOTIFY_FUNCTION NotifyFunction\r
+  );\r
+\r
+/**\r
+  @par Ppi Description:\r
+  Provides the basic I/O interfaces that a PEIM uses to access\r
+  its SMBus controller and the slave devices attached to it.\r
+\r
+  @param Execute\r
+  Executes the SMBus operation to an SMBus slave device.\r
+\r
+  @param ArpDevice\r
+  Allows an SMBus 2.0 device(s) to be Address Resolution Protocol (ARP)\r
+\r
+  @param GetArpMap\r
+  Allows a PEIM to retrieve the address that was allocated by the SMBus\r
+  host controller during enumeration/ARP.\r
+\r
+  @param Notify\r
+  Allows a driver to register for a callback to the SMBus host\r
+  controller driver when the bus issues a notification to the bus controller PEIM.\r
+\r
+**/\r
+struct _EFI_PEI_SMBUS_PPI {\r
+  EFI_PEI_SMBUS_PPI_EXECUTE_OPERATION Execute;\r
+  EFI_PEI_SMBUS_PPI_ARP_DEVICE        ArpDevice;\r
+  EFI_PEI_SMBUS_PPI_GET_ARP_MAP       GetArpMap;\r
+  EFI_PEI_SMBUS_PPI_NOTIFY            Notify;\r
+};\r
+\r
+extern EFI_GUID gEfiPeiSmbusPpiGuid;\r
+\r
+#endif\r
diff --git a/IntelFrameworkPkg/Include/Protocol/AcpiSupport.h b/IntelFrameworkPkg/Include/Protocol/AcpiSupport.h
new file mode 100644 (file)
index 0000000..b0fa68e
--- /dev/null
@@ -0,0 +1,161 @@
+/** @file\r
+  Definition of the ACPI Support protocol.\r
+\r
+  Copyright (c) 2007, Intel Corporation\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+  Module Name:  AcpiSupport.h\r
+\r
+  @par Revision Reference:\r
+  This is defined in the ACPI Specification 0.9.\r
+\r
+**/\r
+\r
+#ifndef _ACPI_SUPPORT_PROTOCOL_H_\r
+#define _ACPI_SUPPORT_PROTOCOL_H_\r
+\r
+typedef struct _EFI_ACPI_SUPPORT_PROTOCOL EFI_ACPI_SUPPORT_PROTOCOL;\r
+\r
+//\r
+// ACPI Support Protocol GUID\r
+//\r
+#define EFI_ACPI_SUPPORT_GUID \\r
+  { \\r
+    0xdbff9d55, 0x89b7, 0x46da, {0xbd, 0xdf, 0x67, 0x7d, 0x3d, 0xc0, 0x24, 0x1d } \\r
+  }\r
+\r
+//\r
+// Protocol Data Definitions\r
+//\r
+//\r
+// ACPI Version bitmap definition:\r
+//\r
+// EFI_ACPI_TABLE_VERSION_1_0B - ACPI Version 1.0b\r
+// EFI_ACPI_TABLE_VERSION_2_0 - ACPI Version 2.0\r
+// EFI_ACPI_TABLE_VERSION_3_0 - ACPI Version 3.0\r
+// EFI_ACPI_TABLE_VERSION_NONE - No ACPI Versions.  This might be used\r
+//  to create memory-based operation regions or other information\r
+//  that is not part of the ACPI "tree" but must still be found\r
+//  in ACPI memory space and/or managed by the core ACPI driver.\r
+//\r
+// Note that EFI provides discrete GUIDs for each version of ACPI\r
+// that is supported.  It is expected that each EFI GUIDed\r
+// version of ACPI will also have a corresponding bitmap\r
+// definition.  This allows maintenance of separate ACPI trees\r
+// for each distinctly different version of ACPI.\r
+//\r
+#define EFI_ACPI_TABLE_VERSION      UINT32\r
+\r
+#define EFI_ACPI_TABLE_VERSION_NONE (1 << 0)\r
+#define EFI_ACPI_TABLE_VERSION_1_0B (1 << 1)\r
+#define EFI_ACPI_TABLE_VERSION_2_0  (1 << 2)\r
+#define EFI_ACPI_TABLE_VERSION_3_0  (1 << 3)\r
+\r
+//\r
+// Protocol Member Functions\r
+//\r
+\r
+/**\r
+  Returns a requested ACPI table.\r
+\r
+  @param  This                  A pointer to the EFI_ACPI_SUPPORT_PROTOCOL instance.\r
+  @param  Index                 The zero-based index of the table to retrieve.\r
+  @param  Table                 Pointer for returning the table buffer.\r
+  @param  Version               Updated with the ACPI versions to which this table belongs.\r
+  @param  Handle                Pointer for identifying the table.\r
+\r
+  @retval EFI_SUCCESS           The function completed successfully.\r
+  @retval EFI_NOT_FOUND         The requested index is too large and a table was not found.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_ACPI_GET_ACPI_TABLE) (\r
+  IN EFI_ACPI_SUPPORT_PROTOCOL            *This,\r
+  IN INTN                                 Index,\r
+  OUT VOID                                **Table,\r
+  OUT EFI_ACPI_TABLE_VERSION              *Version,\r
+  OUT UINTN                               *Handle\r
+  );\r
+\r
+/**\r
+  Used to add, remove, or update ACPI tables.\r
+\r
+  @param  This                  A pointer to the EFI_ACPI_SUPPORT_PROTOCOL instance.\r
+  @param  Table                 Pointer to the new table to add or update.\r
+  @param  Checksum              If TRUE, indicates that the checksum should be\r
+                                calculated for this table.\r
+  @param  Version               Indicates to which version(s) of ACPI the table should be added.\r
+  @param  Pointer               to the handle of the table to remove or update.\r
+\r
+  @retval EFI_SUCCESS           The function completed successfully.\r
+  @retval EFI_INVALID_PARAMETER *Handle was zero and Table was NULL.\r
+  @retval EFI_ABORTED           Could not complete the desired action.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_ACPI_SET_ACPI_TABLE) (\r
+  IN EFI_ACPI_SUPPORT_PROTOCOL            *This,\r
+  IN VOID                                 *Table OPTIONAL,\r
+  IN BOOLEAN                              Checksum,\r
+  IN EFI_ACPI_TABLE_VERSION               Version,\r
+  IN OUT UINTN                            *Handle\r
+  );\r
+\r
+/**\r
+  Causes one or more versions of the ACPI tables to be published in\r
+  the EFI system configuration tables.\r
+\r
+  @param  This                  A pointer to the EFI_ACPI_SUPPORT_PROTOCOL instance.\r
+  @param  Version               Indicates to which version(s) of ACPI that the table should be published.\r
+\r
+  @retval EFI_SUCCESS           The function completed successfully.\r
+  @retval EFI_ABORTED           An error occurred and the function could not complete successfully.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_ACPI_PUBLISH_TABLES) (\r
+  IN EFI_ACPI_SUPPORT_PROTOCOL            *This,\r
+  IN EFI_ACPI_TABLE_VERSION               Version\r
+  );\r
+\r
+//\r
+// ACPI Support Protocol\r
+//\r
+/**\r
+  @par Protocol Description:\r
+  This protocol provides some basic services to support publishing ACPI system\r
+  tables. The services handle many of the more mundane tasks that are required\r
+  to publish a set of tables.\r
+\r
+  @param GetAcpiTable\r
+  Returns a table specified by an index if it exists.\r
+\r
+  @param SetAcpiTable\r
+  Adds, removes, or updates ACPI tables\r
+\r
+  @param PublishTables\r
+  Publishes the ACPI tables.\r
+\r
+**/\r
+struct _EFI_ACPI_SUPPORT_PROTOCOL {\r
+  EFI_ACPI_GET_ACPI_TABLE GetAcpiTable;\r
+  EFI_ACPI_SET_ACPI_TABLE SetAcpiTable;\r
+  EFI_ACPI_PUBLISH_TABLES PublishTables;\r
+};\r
+\r
+//\r
+// Extern the GUID for protocol users.\r
+//\r
+extern EFI_GUID gEfiAcpiSupportProtocolGuid;\r
+\r
+#endif\r
+\r
diff --git a/IntelFrameworkPkg/Include/Protocol/BootScriptSave.h b/IntelFrameworkPkg/Include/Protocol/BootScriptSave.h
new file mode 100644 (file)
index 0000000..fc34723
--- /dev/null
@@ -0,0 +1,102 @@
+/** @file\r
+  Definition of the Boot Script Save protocol.\r
+\r
+  Copyright (c) 2007, Intel Corporation\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+  Module Name:  BootScriptSave.h\r
+\r
+  @par Revision Reference:\r
+  This protocol defined in the Boot Script Specification, Version 0.91.\r
+\r
+**/\r
+\r
+#ifndef _BOOT_SCRIPT_SAVE_PROTOCOL_H\r
+#define _BOOT_SCRIPT_SAVE_PROTOCOL_H\r
+\r
+//\r
+// S3 Save Protocol GUID\r
+//\r
+#define EFI_BOOT_SCRIPT_SAVE_PROTOCOL_GUID \\r
+  { \\r
+    0x470e1529, 0xb79e, 0x4e32, {0xa0, 0xfe, 0x6a, 0x15, 0x6d, 0x29, 0xf9, 0xb2 } \\r
+  }\r
+\r
+typedef struct _EFI_BOOT_SCRIPT_SAVE_PROTOCOL EFI_BOOT_SCRIPT_SAVE_PROTOCOL;\r
+\r
+//\r
+// Protocol Member_Function\r
+//\r
+/**\r
+  Adds a record into a specified Framework boot script table.\r
+\r
+  @param  This                  A pointer to the EFI_BOOT_SCRIPT_SAVE_PROTOCOL instance.\r
+  @param  TableName             Name of the script table.Currently, the only meaningful\r
+                                value is EFI_ACPI_S3_RESUME_SCRIPT_TABLE.\r
+  @param  OpCode                The operation code (opcode) number.\r
+  @param  ...                   Argument list that is specific to each opcode.\r
+\r
+  @retval EFI_SUCCESS           The operation succeeded. A record was added into the specified script table.\r
+  @retval EFI_INVALID_PARAMETER The parameter is illegal or the given boot script is not supported.\r
+  @retval EFI_OUT_OF_RESOURCES  There is insufficient memory to store the boot script.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_BOOT_SCRIPT_WRITE) (\r
+  IN EFI_BOOT_SCRIPT_SAVE_PROTOCOL            *This,\r
+  IN UINT16                                   TableName,\r
+  IN UINT16                                   OpCode,\r
+  ...\r
+  );\r
+\r
+/**\r
+  Closes the specified script table.\r
+\r
+  @param  This                  A pointer to the EFI_BOOT_SCRIPT_SAVE_PROTOCOL instance.\r
+  @param  TableName             Name of the script table.\r
+  @param  Address               A pointer to the physical address where the table begins.\r
+\r
+  @retval EFI_SUCCESS           The table was successfully returned.\r
+  @retval EFI_NOT_FOUND         The specified table was not created previously.\r
+  @retval EFI_OUT_OF_RESOURCES  Memory is insufficient to hold the reorganized boot script table.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_BOOT_SCRIPT_CLOSE_TABLE) (\r
+  IN EFI_BOOT_SCRIPT_SAVE_PROTOCOL            *This,\r
+  IN UINT16                                   TableName,\r
+  OUT EFI_PHYSICAL_ADDRESS                    *Address\r
+  );\r
+\r
+//\r
+// S3 Save Protocol data structure\r
+//\r
+/**\r
+  @par Protocol Description:\r
+  The EFI_BOOT_SCRIPT_SAVE_PROTOCOL publishes the Framework boot script abstractions\r
+  to store or record various boot scripts into boot script tables.\r
+\r
+  @param Write\r
+  Writes various boot scripts to a boot script table.\r
+\r
+  @param CloseTable\r
+  Retrieves and closes a script table.\r
+\r
+**/\r
+struct _EFI_BOOT_SCRIPT_SAVE_PROTOCOL {\r
+  EFI_BOOT_SCRIPT_WRITE       Write;\r
+  EFI_BOOT_SCRIPT_CLOSE_TABLE CloseTable;\r
+};\r
+\r
+extern EFI_GUID gEfiBootScriptSaveProtocolGuid;\r
+\r
+#endif\r
+\r
diff --git a/IntelFrameworkPkg/Include/Protocol/CpuIo.h b/IntelFrameworkPkg/Include/Protocol/CpuIo.h
new file mode 100644 (file)
index 0000000..38f910e
--- /dev/null
@@ -0,0 +1,125 @@
+/** @file\r
+  This code abstracts the CPU IO Protocol\r
+\r
+  Copyright (c) 2007, Intel Corporation\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+  Module Name:  CpuIO.h\r
+\r
+  @par Revision Reference:\r
+  CPU IO Protocol is defined in Framework of EFI CPU IO Protocol Spec\r
+  Version 0.9\r
+\r
+**/\r
+\r
+#ifndef _CPUIO_H_\r
+#define _CPUIO_H_\r
+\r
+#define EFI_CPU_IO_PROTOCOL_GUID \\r
+  { \\r
+    0xB0732526, 0x38C8, 0x4b40, {0x88, 0x77, 0x61, 0xC7, 0xB0, 0x6A, 0xAC, 0x45 } \\r
+  }\r
+\r
+typedef struct _EFI_CPU_IO_PROTOCOL EFI_CPU_IO_PROTOCOL;\r
+\r
+//\r
+// *******************************************************\r
+// EFI_CPU_IO_PROTOCOL_WIDTH\r
+// *******************************************************\r
+//\r
+typedef enum {\r
+  EfiCpuIoWidthUint8,\r
+  EfiCpuIoWidthUint16,\r
+  EfiCpuIoWidthUint32,\r
+  EfiCpuIoWidthUint64,\r
+  EfiCpuIoWidthFifoUint8,\r
+  EfiCpuIoWidthFifoUint16,\r
+  EfiCpuIoWidthFifoUint32,\r
+  EfiCpuIoWidthFifoUint64,\r
+  EfiCpuIoWidthFillUint8,\r
+  EfiCpuIoWidthFillUint16,\r
+  EfiCpuIoWidthFillUint32,\r
+  EfiCpuIoWidthFillUint64,\r
+  EfiCpuIoWidthMaximum\r
+} EFI_CPU_IO_PROTOCOL_WIDTH;\r
+\r
+//\r
+// *******************************************************\r
+// EFI_CPU_IO_PROTOCOL_IO_MEM\r
+// *******************************************************\r
+//\r
+/**\r
+  Enables a driver to access memory-mapped registers in the EFI system memory space.\r
+  Or, Enables a driver to access registers in the EFI CPU I/O space.\r
+\r
+  @param  This                  A pointer to the EFI_CPU_IO_PROTOCOL instance.\r
+  @param  Width                 Signifies the width of the I/O or Memory operation.\r
+  @param  Address               The base address of the I/O or Memoryoperation.\r
+  @param  Count                 The number of I/O or Memory operations to perform.\r
+                                The number of bytes moved is Width size * Count, starting at Address.\r
+  @param  Buffer                For read operations, the destination buffer to store the results.\r
+                                For write operations, the source buffer from which to write data.\r
+\r
+  @retval EFI_SUCCESS           The data was read from or written to the EFI system.\r
+  @retval EFI_INVALID_PARAMETER Width is invalid for this EFI system.Or Buffer is NULL.\r
+  @retval EFI_UNSUPPORTED       The Buffer is not aligned for the given Width.\r
+                                Or,The address range specified by Address, Width, and Count is not valid for this EFI system.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_CPU_IO_PROTOCOL_IO_MEM) (\r
+  IN EFI_CPU_IO_PROTOCOL                *This,\r
+  IN  EFI_CPU_IO_PROTOCOL_WIDTH         Width,\r
+  IN  UINT64                            Address,\r
+  IN  UINTN                             Count,\r
+  IN  OUT VOID                          *Buffer\r
+  );\r
+\r
+//\r
+// *******************************************************\r
+// EFI_CPU_IO_PROTOCOL_ACCESS\r
+// *******************************************************\r
+//\r
+typedef struct {\r
+  EFI_CPU_IO_PROTOCOL_IO_MEM  Read;\r
+  EFI_CPU_IO_PROTOCOL_IO_MEM  Write;\r
+} EFI_CPU_IO_PROTOCOL_ACCESS;\r
+\r
+//\r
+// *******************************************************\r
+// EFI_CPU_IO_PROTOCOL\r
+// *******************************************************\r
+//\r
+/**\r
+  @par Protocol Description:\r
+  Provides the basic memory and I/O interfaces that are used to abstract\r
+  accesses to devices in a system.\r
+\r
+  @param Mem.Read\r
+  Allows reads from memory-mapped I/O space.\r
+\r
+  @param Mem.Write\r
+  Allows writes to memory-mapped I/O space.\r
+\r
+  @param Io.Read\r
+  Allows reads from I/O space.\r
+\r
+  @param Io.Write\r
+  Allows writes to I/O space.\r
+\r
+**/\r
+struct _EFI_CPU_IO_PROTOCOL {\r
+  EFI_CPU_IO_PROTOCOL_ACCESS  Mem;\r
+  EFI_CPU_IO_PROTOCOL_ACCESS  Io;\r
+};\r
+\r
+extern EFI_GUID gEfiCpuIoProtocolGuid;\r
+\r
+#endif\r
diff --git a/IntelFrameworkPkg/Include/Protocol/DataHub.h b/IntelFrameworkPkg/Include/Protocol/DataHub.h
new file mode 100644 (file)
index 0000000..8af0964
--- /dev/null
@@ -0,0 +1,212 @@
+/** @file\r
+  The data hub protocol is used both by agents wishing to log\r
+  data and those wishing to be made aware of all information that\r
+  has been logged.\r
+\r
+  For more information please look at Intel Platform Innovation\r
+  Framework for EFI Data Hub Specification.\r
+\r
+  Copyright (c) 2007, Intel Corporation\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+  Module Name:  DataHub.h\r
+\r
+  @par Revision Reference:\r
+  This protocol is defined in Framework for EFI Data Hub Specification.\r
+  Version 0.9.\r
+\r
+**/\r
+\r
+#ifndef _DATA_HUB_H_\r
+#define _DATA_HUB_H_\r
+\r
+#define EFI_DATA_HUB_PROTOCOL_GUID \\r
+  { \\r
+    0xae80d021, 0x618e, 0x11d4, {0xbc, 0xd7, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81 } \\r
+  }\r
+\r
+//\r
+// EFI generic Data Hub Header\r
+//\r
+// A Data Record is an EFI_DATA_RECORD_HEADER followed by RecordSize bytes of\r
+//  data. The format of the data is defined by the DataRecordGuid.\r
+//\r
+// If EFI_DATA_RECORD_HEADER is extended in the future the Version number must\r
+//  change and the HeaderSize will change if the definition of\r
+//  EFI_DATA_RECORD_HEADER is extended.\r
+//\r
+// The logger is responcible for initializing:\r
+//  Version, HeaderSize, RecordSize, DataRecordGuid, DataRecordClass\r
+//\r
+// The Data Hub driver is responcible for initializing:\r
+//   LogTime and LogMonotonicCount.\r
+//\r
+#define EFI_DATA_RECORD_HEADER_VERSION  0x0100\r
+typedef struct {\r
+  UINT16    Version;\r
+  UINT16    HeaderSize;\r
+  UINT32    RecordSize;\r
+  EFI_GUID  DataRecordGuid;\r
+  EFI_GUID  ProducerName;\r
+  UINT64    DataRecordClass;\r
+  EFI_TIME  LogTime;\r
+  UINT64    LogMonotonicCount;\r
+} EFI_DATA_RECORD_HEADER;\r
+\r
+//\r
+// Definition of DataRecordClass. These are used to filter out class types\r
+// at a very high level. The DataRecordGuid still defines the format of\r
+// the data. See DateHub.doc for rules on what can and can not be a\r
+// new DataRecordClass\r
+//\r
+#define EFI_DATA_RECORD_CLASS_DEBUG         0x0000000000000001\r
+#define EFI_DATA_RECORD_CLASS_ERROR         0x0000000000000002\r
+#define EFI_DATA_RECORD_CLASS_DATA          0x0000000000000004\r
+#define EFI_DATA_RECORD_CLASS_PROGRESS_CODE 0x0000000000000008\r
+\r
+//\r
+// Forward reference for pure ANSI compatability\r
+//\r
+typedef struct _EFI_DATA_HUB_PROTOCOL EFI_DATA_HUB_PROTOCOL;\r
+\r
+/**\r
+  Logs a data record to the system event log.\r
+\r
+  @param  This                  The EFI_DATA_HUB_PROTOCOL instance.\r
+  @param  description\r
+  @param  DataRecordGuid        A GUID that indicates the format of the data passed into RawData.\r
+  @param  ProducerName          A GUID that indicates the identity of the caller to this API.\r
+  @param  DataRecordClass       This class indicates the generic type of the data record.\r
+  @param  RawData               The DataRecordGuid-defined data to be logged.\r
+  @param  RawDataSize           The size in bytes of RawData.\r
+\r
+  @retval EFI_SUCCESS           Data was logged.\r
+  @retval EFI_OUT_OF_RESOURCES  Data was not logged due to lack of system resources.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_DATA_HUB_LOG_DATA) (\r
+  IN  EFI_DATA_HUB_PROTOCOL   *This,\r
+  IN  EFI_GUID                *DataRecordGuid,\r
+  IN  EFI_GUID                *ProducerName,\r
+  IN  UINT64                  DataRecordClass,\r
+  IN  VOID                    *RawData,\r
+  IN  UINT32                  RawDataSize\r
+  );\r
+\r
+/**\r
+  Allows the system data log to be searched.\r
+\r
+  @param  This                  The EFI_DATA_HUB_PROTOCOL instance.\r
+  @param  MonotonicCount        On input, it specifies the Record to return.\r
+                                An input of zero means to return the first record.\r
+  @param  FilterDriver          If FilterDriver is not passed in a MonotonicCount of zero,\r
+                                it means to return the first data record. If FilterDriver is passed in,\r
+                                then a MonotonicCount of zero means to return the first data not yet read\r
+                                by FilterDriver.\r
+  @param  Record                Returns a dynamically allocated memory buffer with a data\r
+                                record that matches MonotonicCount.\r
+\r
+  @retval EFI_SUCCESS           Data was returned in Record.\r
+  @retval EFI_INVALID_PARAMETER FilterDriver was passed in but does not exist.\r
+  @retval EFI_NOT_FOUND         MonotonicCount does not match any data record\r
+                                in the system. If a MonotonicCount of zero was passed in, then no\r
+                                data records exist in the system.\r
+  @retval EFI_OUT_OF_RESOURCES  Record was not returned due to lack\r
+                                of system resources.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_DATA_HUB_GET_NEXT_RECORD) (\r
+  IN EFI_DATA_HUB_PROTOCOL    *This,\r
+  IN OUT  UINT64              *MonotonicCount,\r
+  IN  EFI_EVENT               *FilterDriver OPTIONAL,\r
+  OUT EFI_DATA_RECORD_HEADER  **Record\r
+  );\r
+\r
+/**\r
+  Registers an event to be signaled every time a data record is logged in the system.\r
+\r
+  @param  This                  The EFI_DATA_HUB_PROTOCOL instance.\r
+  @param  FilterEvent           The EFI_EVENT to signal whenever data that matches\r
+                                FilterClass is logged in the system.\r
+  @param  FilterTpl             The maximum EFI_TPL at which FilterEvent can be signaled.\r
+                                It is strongly recommended that you use the lowest EFI_TPL possible.\r
+  @param  FilterClass           FilterEvent will be signaled whenever a bit\r
+                                in EFI_DATA_RECORD_HEADER.DataRecordClass is also set in FilterClass.\r
+                                If FilterClass is zero, no class-based filtering will be performed.\r
+  @param  FilterDataRecordGuid  FilterEvent will be signaled whenever\r
+                                FilterDataRecordGuid matches EFI_DATA_RECORD_HEADER.DataRecordGuid.\r
+                                If FilterDataRecordGuid is NULL, then no GUID-based filtering will be performed.\r
+\r
+  @retval EFI_SUCCESS           The filter driver event was registered\r
+  @retval EFI_ALREADY_STARTED   FilterEvent was previously registered and cannot be registered again.\r
+  @retval EFI_OUT_OF_RESOURCES  The filter driver event was not registered\r
+                                due to lack of system resources.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_DATA_HUB_REGISTER_FILTER_DRIVER) (\r
+  IN EFI_DATA_HUB_PROTOCOL    *This,\r
+  IN EFI_EVENT                FilterEvent,\r
+  IN EFI_TPL                  FilterTpl,\r
+  IN UINT64                   FilterClass,\r
+  IN EFI_GUID                 *FilterDataRecordGuid OPTIONAL\r
+  );\r
+\r
+/**\r
+  Stops a filter driver from being notified when data records are logged.\r
+\r
+  @param  This                  The EFI_DATA_HUB_PROTOCOL instance.\r
+  @param  FilterEvent           The EFI_EVENT to remove from the list of events to be\r
+                                signaled every time errors are logged.\r
+\r
+  @retval EFI_SUCCESS           The filter driver represented by FilterEvent was shut off.\r
+  @retval EFI_NOT_FOUND         FilterEvent did not exist.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_DATA_HUB_UNREGISTER_FILTER_DRIVER) (\r
+  IN EFI_DATA_HUB_PROTOCOL    *This,\r
+  IN EFI_EVENT                FilterEvent\r
+  );\r
+\r
+/**\r
+  @par Protocol Description:\r
+  This protocol is used to log information and register filter drivers\r
+  to receive data records.\r
+\r
+  @param LogData\r
+  Logs a data record.\r
+\r
+  @param GetNextDataRecord\r
+  Gets a data record. Used both to view the memory-based log and to\r
+  get information about which data records have been consumed by a filter driver.\r
+\r
+  @param RegisterFilterDriver\r
+  Allows the registration of an EFI event to act as a filter driver for all data records that are logged.\r
+\r
+  @param UnregisterFilterDriver\r
+  Used to remove a filter driver that was added with RegisterFilterDriver().\r
+\r
+**/\r
+struct _EFI_DATA_HUB_PROTOCOL {\r
+  EFI_DATA_HUB_LOG_DATA                 LogData;\r
+  EFI_DATA_HUB_GET_NEXT_RECORD          GetNextRecord;\r
+  EFI_DATA_HUB_REGISTER_FILTER_DRIVER   RegisterFilterDriver;\r
+  EFI_DATA_HUB_UNREGISTER_FILTER_DRIVER UnregisterFilterDriver;\r
+};\r
+\r
+extern EFI_GUID gEfiDataHubProtocolGuid;\r
+\r
+#endif\r
diff --git a/IntelFrameworkPkg/Include/Protocol/FirmwareVolume.h b/IntelFrameworkPkg/Include/Protocol/FirmwareVolume.h
new file mode 100644 (file)
index 0000000..50c53d5
--- /dev/null
@@ -0,0 +1,319 @@
+/** @file\r
+  This file declares Firmware Volume protocol.\r
+\r
+  Copyright (c) 2007, Intel Corporation\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+  Module Name:  FirmwareVolume.h\r
+\r
+  @par Revision Reference:\r
+  This protocol is defined in Firmware Volume specification.\r
+  Version 0.9\r
+\r
+**/\r
+\r
+#ifndef _FIRMWARE_VOLUME_H_\r
+#define _FIRMWARE_VOLUME_H_\r
+\r
+\r
+//\r
+// Firmware Volume Protocol GUID definition\r
+//\r
+#define EFI_FIRMWARE_VOLUME_PROTOCOL_GUID \\r
+  { \\r
+    0x389F751F, 0x1838, 0x4388, {0x83, 0x90, 0xCD, 0x81, 0x54, 0xBD, 0x27, 0xF8 } \\r
+  }\r
+\r
+#define FV_DEVICE_SIGNATURE EFI_SIGNATURE_32 ('_', 'F', 'V', '_')\r
+\r
+typedef struct _EFI_FIRMWARE_VOLUME_PROTOCOL  EFI_FIRMWARE_VOLUME_PROTOCOL;\r
+\r
+//\r
+// EFI_FV_ATTRIBUTES bit definitions\r
+//\r
+typedef UINT64  EFI_FV_ATTRIBUTES;\r
+\r
+//\r
+// ************************************************************\r
+// EFI_FV_ATTRIBUTES bit definitions\r
+// ************************************************************\r
+//\r
+#define EFI_FV_READ_DISABLE_CAP       0x0000000000000001ULL\r
+#define EFI_FV_READ_ENABLE_CAP        0x0000000000000002ULL\r
+#define EFI_FV_READ_STATUS            0x0000000000000004ULL\r
+\r
+#define EFI_FV_WRITE_DISABLE_CAP      0x0000000000000008ULL\r
+#define EFI_FV_WRITE_ENABLE_CAP       0x0000000000000010ULL\r
+#define EFI_FV_WRITE_STATUS           0x0000000000000020ULL\r
+\r
+#define EFI_FV_LOCK_CAP               0x0000000000000040ULL\r
+#define EFI_FV_LOCK_STATUS            0x0000000000000080ULL\r
+#define EFI_FV_WRITE_POLICY_RELIABLE  0x0000000000000100ULL\r
+\r
+#define EFI_FV_ALIGNMENT_CAP          0x0000000000008000ULL\r
+#define EFI_FV_ALIGNMENT_2            0x0000000000010000ULL\r
+#define EFI_FV_ALIGNMENT_4            0x0000000000020000ULL\r
+#define EFI_FV_ALIGNMENT_8            0x0000000000040000ULL\r
+#define EFI_FV_ALIGNMENT_16           0x0000000000080000ULL\r
+#define EFI_FV_ALIGNMENT_32           0x0000000000100000ULL\r
+#define EFI_FV_ALIGNMENT_64           0x0000000000200000ULL\r
+#define EFI_FV_ALIGNMENT_128          0x0000000000400000ULL\r
+#define EFI_FV_ALIGNMENT_256          0x0000000000800000ULL\r
+#define EFI_FV_ALIGNMENT_512          0x0000000001000000ULL\r
+#define EFI_FV_ALIGNMENT_1K           0x0000000002000000ULL\r
+#define EFI_FV_ALIGNMENT_2K           0x0000000004000000ULL\r
+#define EFI_FV_ALIGNMENT_4K           0x0000000008000000ULL\r
+#define EFI_FV_ALIGNMENT_8K           0x0000000010000000ULL\r
+#define EFI_FV_ALIGNMENT_16K          0x0000000020000000ULL\r
+#define EFI_FV_ALIGNMENT_32K          0x0000000040000000ULL\r
+#define EFI_FV_ALIGNMENT_64K          0x0000000080000000ULL\r
+\r
+//\r
+// Protocol API definitions\r
+//\r
+\r
+/**\r
+  Retrieves attributes, insures positive polarity of attribute bits, returns\r
+  resulting attributes in output parameter\r
+\r
+  @param  This                  Calling context\r
+  @param  Attributes            output buffer which contains attributes\r
+\r
+  @retval EFI_INVALID_PARAMETER\r
+  @retval EFI_SUCCESS\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_FV_GET_ATTRIBUTES) (\r
+  IN  EFI_FIRMWARE_VOLUME_PROTOCOL  *This,\r
+  OUT EFI_FV_ATTRIBUTES             *Attributes\r
+  );\r
+\r
+/**\r
+  Sets volume attributes\r
+\r
+  @param  This                  Calling context\r
+  @param  Attributes            Buffer which contains attributes\r
+\r
+  @retval EFI_INVALID_PARAMETER\r
+  @retval EFI_DEVICE_ERROR\r
+  @retval EFI_SUCCESS\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_FV_SET_ATTRIBUTES) (\r
+  IN EFI_FIRMWARE_VOLUME_PROTOCOL   *This,\r
+  IN OUT EFI_FV_ATTRIBUTES          *Attributes\r
+  );\r
+\r
+typedef UINT32  EFI_FV_FILE_ATTRIBUTES;\r
+\r
+#define EFI_FV_FILE_ATTRIB_ALIGNMENT  0x0000001F\r
+\r
+/**\r
+  Read the requested file (NameGuid) and returns data in Buffer.\r
+\r
+  @param  This                  Calling context\r
+  @param  NameGuid              Filename identifying which file to read\r
+  @param  Buffer                Pointer to pointer to buffer in which contents of file are returned.\r
+                                <br>\r
+                                If Buffer is NULL, only type, attributes, and size are returned as\r
+                                there is no output buffer.\r
+                                <br>\r
+                                If Buffer != NULL and *Buffer == NULL, the output buffer is allocated\r
+                                from BS pool by ReadFile\r
+                                <br>\r
+                                If Buffer != NULL and *Buffer != NULL, the output buffer has been\r
+                                allocated by the caller and is being passed in.\r
+  @param  BufferSize            Indicates the buffer size passed in, and on output the size\r
+                                required to complete the read\r
+  @param  FoundType             Indicates the type of the file who's data is returned\r
+  @param  FileAttributes        Indicates the attributes of the file who's data is resturned\r
+  @param  AuthenticationStatus  Indicates the authentication status of the data\r
+\r
+  @retval EFI_SUCCESS\r
+  @retval EFI_WARN_BUFFER_TOO_SMALL\r
+  @retval EFI_NOT_FOUND\r
+  @retval EFI_DEVICE_ERROR\r
+  @retval EFI_ACCESS_DENIED\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_FV_READ_FILE) (\r
+  IN EFI_FIRMWARE_VOLUME_PROTOCOL   *This,\r
+  IN EFI_GUID                       *NameGuid,\r
+  IN OUT VOID                       **Buffer,\r
+  IN OUT UINTN                      *BufferSize,\r
+  OUT EFI_FV_FILETYPE               *FoundType,\r
+  OUT EFI_FV_FILE_ATTRIBUTES        *FileAttributes,\r
+  OUT UINT32                        *AuthenticationStatus\r
+  );\r
+\r
+/**\r
+  Read the requested section from the specified file and returns data in Buffer.\r
+\r
+  @param  This                  Calling context\r
+  @param  NameGuid              Filename identifying the file from which to read\r
+  @param  SectionType           Indicates what section type to retrieve\r
+  @param  SectionInstance       Indicates which instance of SectionType to retrieve\r
+  @param  Buffer                Pointer to pointer to buffer in which contents of file are returned.\r
+                                <br>\r
+                                If Buffer is NULL, only type, attributes, and size are returned as\r
+                                there is no output buffer.\r
+                                <br>\r
+                                If Buffer != NULL and *Buffer == NULL, the output buffer is allocated\r
+                                from BS pool by ReadFile\r
+                                <br>\r
+                                If Buffer != NULL and *Buffer != NULL, the output buffer has been\r
+                                allocated by the caller and is being passed in.\r
+  @param  BufferSize            Indicates the buffer size passed in, and on output the size\r
+                                required to complete the read\r
+  @param  AuthenticationStatus  Indicates the authentication status of the data\r
+\r
+  @retval EFI_SUCCESS\r
+  @retval EFI_WARN_BUFFER_TOO_SMALL\r
+  @retval EFI_OUT_OF_RESOURCES\r
+  @retval EFI_NOT_FOUND\r
+  @retval EFI_DEVICE_ERROR\r
+  @retval EFI_ACCESS_DENIED\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_FV_READ_SECTION) (\r
+  IN EFI_FIRMWARE_VOLUME_PROTOCOL   *This,\r
+  IN EFI_GUID                       *NameGuid,\r
+  IN EFI_SECTION_TYPE               SectionType,\r
+  IN UINTN                          SectionInstance,\r
+  IN OUT VOID                       **Buffer,\r
+  IN OUT UINTN                      *BufferSize,\r
+  OUT UINT32                        *AuthenticationStatus\r
+  );\r
+\r
+typedef UINT32  EFI_FV_WRITE_POLICY;\r
+\r
+#define EFI_FV_UNRELIABLE_WRITE 0x00000000\r
+#define EFI_FV_RELIABLE_WRITE   0x00000001\r
+\r
+typedef struct {\r
+  EFI_GUID                *NameGuid;\r
+  EFI_FV_FILETYPE         Type;\r
+  EFI_FV_FILE_ATTRIBUTES  FileAttributes;\r
+  VOID                    *Buffer;\r
+  UINT32                  BufferSize;\r
+} EFI_FV_WRITE_FILE_DATA;\r
+\r
+/**\r
+  Write the supplied file (NameGuid) to the FV.\r
+\r
+  @param  This                  Calling context\r
+  @param  NumberOfFiles         Indicates the number of file records pointed to by FileData\r
+  @param  WritePolicy           Indicates the level of reliability of the write with respect to\r
+                                things like power failure events.\r
+  @param  FileData              A pointer to an array of EFI_FV_WRITE_FILE_DATA structures. Each\r
+                                element in the array indicates a file to write, and there are\r
+                                NumberOfFiles elements in the input array.\r
+\r
+  @retval EFI_SUCCESS\r
+  @retval EFI_OUT_OF_RESOURCES\r
+  @retval EFI_DEVICE_ERROR\r
+  @retval EFI_WRITE_PROTECTED\r
+  @retval EFI_NOT_FOUND\r
+  @retval EFI_INVALID_PARAMETER\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_FV_WRITE_FILE) (\r
+  IN EFI_FIRMWARE_VOLUME_PROTOCOL   *This,\r
+  IN UINT32                         NumberOfFiles,\r
+  IN EFI_FV_WRITE_POLICY            WritePolicy,\r
+  IN EFI_FV_WRITE_FILE_DATA         *FileData\r
+  );\r
+\r
+/**\r
+  Given the input key, search for the next matching file in the volume.\r
+\r
+  @param  This                  Calling context\r
+  @param  Key                   Pointer to a caller allocated buffer that contains an implementation\r
+                                specific key that is used to track where to begin searching on\r
+                                successive calls.\r
+  @param  FileType              Indicates the file type to filter for\r
+  @param  NameGuid              Guid filename of the file found\r
+  @param  Attributes            Attributes of the file found\r
+  @param  Size                  Size in bytes of the file found\r
+\r
+  @retval EFI_SUCCESS\r
+  @retval EFI_NOT_FOUND\r
+  @retval EFI_DEVICE_ERROR\r
+  @retval EFI_ACCESS_DENIED\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_FV_GET_NEXT_FILE) (\r
+  IN EFI_FIRMWARE_VOLUME_PROTOCOL   *This,\r
+  IN OUT VOID                       *Key,\r
+  IN OUT EFI_FV_FILETYPE            *FileType,\r
+  OUT EFI_GUID                      *NameGuid,\r
+  OUT EFI_FV_FILE_ATTRIBUTES        *Attributes,\r
+  OUT UINTN                         *Size\r
+  );\r
+\r
+/**\r
+  @par Protocol Description:\r
+  The Firmware Volume Protocol provides file-level access to the firmware volume.\r
+  Each firmware volume driver must produce an instance of the Firmware Volume\r
+  Protocol if the firmware volume is to be visible to the system. The Firmware\r
+  Volume Protocol also provides mechanisms for determining and modifying some\r
+  attributes of the firmware volume.\r
+\r
+  @param GetVolumeAttributes\r
+  Retrieves volume capabilities and current settings.\r
+\r
+  @param SetVolumeAttributes\r
+  Modifies the current settings of the firmware volume.\r
+\r
+  @param ReadFile\r
+  Reads an entire file from the firmware volume.\r
+\r
+  @param ReadSection\r
+  Reads a single section from a file into a buffer.\r
+\r
+  @param WriteFile\r
+  Writes an entire file into the firmware volume.\r
+\r
+  @param GetNextFile\r
+  Provides service to allow searching the firmware volume.\r
+\r
+  @param KeySize\r
+  Data field that indicates the size in bytes of the Key input buffer for\r
+  the GetNextFile() API.\r
+\r
+  @param ParentHandle\r
+  Handle of the parent firmware volume.\r
+\r
+**/\r
+struct _EFI_FIRMWARE_VOLUME_PROTOCOL {\r
+  EFI_FV_GET_ATTRIBUTES GetVolumeAttributes;\r
+  EFI_FV_SET_ATTRIBUTES SetVolumeAttributes;\r
+  EFI_FV_READ_FILE      ReadFile;\r
+  EFI_FV_READ_SECTION   ReadSection;\r
+  EFI_FV_WRITE_FILE     WriteFile;\r
+  EFI_FV_GET_NEXT_FILE  GetNextFile;\r
+  UINT32                KeySize;\r
+  EFI_HANDLE            ParentHandle;\r
+};\r
+\r
+extern EFI_GUID gEfiFirmwareVolumeProtocolGuid;\r
+\r
+#endif\r
diff --git a/IntelFrameworkPkg/Include/Protocol/FirmwareVolumeBlock.h b/IntelFrameworkPkg/Include/Protocol/FirmwareVolumeBlock.h
new file mode 100644 (file)
index 0000000..f397f59
--- /dev/null
@@ -0,0 +1,251 @@
+/** @file\r
+  This file declares Firmware Volume Block protocol.\r
+\r
+  Low level firmware device access routines to abstract firmware device\r
+  hardware.\r
+\r
+  Copyright (c) 2007, Intel Corporation\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+  Module Name:  FirmwareVolumeBlock.h\r
+\r
+  @par Revision Reference:\r
+  This protocol is defined in Framework of EFI Firmware Volume Block specification.\r
+  Version 0.9\r
+\r
+**/\r
+\r
+#ifndef _FIRMWARE_VOLUME_BLOCK_H_\r
+#define _FIRMWARE_VOLUME_BLOCK_H_\r
+\r
+\r
+#define EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL_GUID \\r
+  { \\r
+    0xDE28BC59, 0x6228, 0x41BD, {0xBD, 0xF6, 0xA3, 0xB9, 0xAD, 0xB5, 0x8D, 0xA1 } \\r
+  }\r
+\r
+typedef struct _EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL  EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL;\r
+\r
+/**\r
+  Retrieves Volume attributes.  No polarity translations are done.\r
+\r
+  @param  This                  Calling context\r
+  @param  Attributes            output buffer which contains attributes\r
+\r
+  @retval EFI_INVALID_PARAMETER\r
+  @retval EFI_SUCCESS\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_FVB_GET_ATTRIBUTES) (\r
+  IN EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL           *This,\r
+  OUT EFI_FVB_ATTRIBUTES                          *Attributes\r
+  )\r
+;\r
+\r
+/**\r
+  Sets Volume attributes.  No polarity translations are done.\r
+\r
+  @param  This                  Calling context\r
+  @param  Attributes            On input: contains new attributes\r
+                                On output: contains current attributes of FV\r
+\r
+  @retval EFI_INVALID_PARAMETER\r
+  @retval EFI_SUCCESS\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_FVB_SET_ATTRIBUTES) (\r
+  IN EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL           *This,\r
+  IN OUT EFI_FVB_ATTRIBUTES                       *Attributes\r
+  )\r
+;\r
+\r
+/**\r
+  Retrieves the physical address of a memory mapped FV.\r
+\r
+  @param  This                  Calling context\r
+  @param  Attributes            Address is a pointer to a caller allocated EFI_PHYSICAL_ADDRESS\r
+                                that on successful return from GetPhysicalAddress() contains the\r
+                                base address of the firmware volume.\r
+\r
+  @retval EFI_UNSUPPORTED\r
+  @retval EFI_SUCCESS\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_FVB_GET_PHYSICAL_ADDRESS) (\r
+  IN EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL           *This,\r
+  OUT EFI_PHYSICAL_ADDRESS                        *Address\r
+  )\r
+;\r
+\r
+/**\r
+  Retrieves the size in bytes of a specific block within an FV.\r
+\r
+  @param  This                  Calling context.\r
+  @param  Lba                   Indicates which block to return the size for.\r
+  @param  BlockSize             BlockSize is a pointer to a caller allocated\r
+                                UINTN in which the size of the block is returned.\r
+  @param  NumberOfBlocks        NumberOfBlocks is a pointer to a caller allocated\r
+                                UINTN in which the number of consecutive blocks\r
+                                starting with Lba is returned. All blocks in this\r
+                                range have a size of BlockSize.\r
+\r
+  @retval EFI_INVALID_PARAMETER\r
+  @retval EFI_SUCCESS\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_FVB_GET_BLOCK_SIZE) (\r
+  IN EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL           *This,\r
+  IN EFI_LBA                                      Lba,\r
+  OUT UINTN                                       *BlockSize,\r
+  OUT UINTN                                       *NumberOfBlocks\r
+  )\r
+;\r
+\r
+/**\r
+  Reads data beginning at Lba:Offset from FV and places the data in Buffer.\r
+  The read terminates either when *NumBytes of data have been read, or when\r
+  a block boundary is reached.  *NumBytes is updated to reflect the actual\r
+  number of bytes read.\r
+\r
+  @param  This                  Calling context\r
+  @param  Lba                   Block in which to begin read\r
+  @param  Offset                Offset in the block at which to begin read\r
+  @param  NumBytes              At input, indicates the requested read size. At output, indicates\r
+                                the actual number of bytes read.\r
+  @param  Buffer                Data buffer in which to place data read.\r
+\r
+  @retval EFI_INVALID_PARAMETER\r
+  @retval EFI_NOT_FOUND\r
+  @retval EFI_DEVICE_ERROR\r
+  @retval EFI_SUCCESS\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_FVB_READ) (\r
+  IN EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL           *This,\r
+  IN EFI_LBA                                      Lba,\r
+  IN UINTN                                        Offset,\r
+  IN OUT UINTN                                    *NumBytes,\r
+  OUT UINT8                                       *Buffer\r
+  )\r
+;\r
+\r
+/**\r
+  Writes data beginning at Lba:Offset from FV. The write terminates either\r
+  when *NumBytes of data have been written, or when a block boundary is\r
+  reached.  *NumBytes is updated to reflect the actual number of bytes\r
+  written.\r
+\r
+  @param  This                  Calling context\r
+  @param  Lba                   Block in which to begin write\r
+  @param  Offset                Offset in the block at which to begin write\r
+  @param  NumBytes              At input, indicates the requested write size. At output, indicates\r
+                                the actual number of bytes written.\r
+  @param  Buffer                Buffer containing source data for the write.\r
+\r
+  @retval EFI_INVALID_PARAMETER\r
+  @retval EFI_NOT_FOUND\r
+  @retval EFI_DEVICE_ERROR\r
+  @retval EFI_SUCCESS\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_FVB_WRITE) (\r
+  IN EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL           *This,\r
+  IN EFI_LBA                                      Lba,\r
+  IN UINTN                                        Offset,\r
+  IN OUT UINTN                                    *NumBytes,\r
+  IN UINT8                                        *Buffer\r
+  )\r
+;\r
+\r
+#define EFI_LBA_LIST_TERMINATOR 0xFFFFFFFFFFFFFFFFULL\r
+\r
+/**\r
+  The EraseBlock() function erases one or more blocks as denoted by the\r
+  variable argument list. The entire parameter list of blocks must be verified\r
+  prior to erasing any blocks.  If a block is requested that does not exist\r
+  within the associated firmware volume (it has a larger index than the last\r
+  block of the firmware volume), the EraseBlock() function must return\r
+  EFI_INVALID_PARAMETER without modifying the contents of the firmware volume.\r
+\r
+  @param  This                  Calling context\r
+  @param  ...                   Starting LBA followed by Number of Lba to erase. a -1 to terminate\r
+                                the list.\r
+\r
+  @retval EFI_INVALID_PARAMETER\r
+  @retval EFI_DEVICE_ERROR\r
+  @retval EFI_SUCCESS\r
+  @retval EFI_ACCESS_DENIED\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_FVB_ERASE_BLOCKS) (\r
+  IN EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL           *This,\r
+  ...\r
+  )\r
+;\r
+\r
+/**\r
+  @par Protocol Description:\r
+  This protocol provides control over block-oriented firmware devices.\r
+  Typically, the FFS (or an alternate file system) driver consumes the\r
+  Firmware Volume Block Protocol and produces the Firmware Volume Protocol.\r
+\r
+  @param GetAttributes\r
+  Retrieves the current volume attributes.\r
+\r
+  @param SetAttributes\r
+  Sets the current volume attributes.\r
+\r
+  @param GetPhysicalAddress\r
+  Retrieves the memory-mapped address of the firmware volume.\r
+\r
+  @param GetBlockSize\r
+  Retrieves the size for a specific block.\r
+\r
+  @param Read\r
+  Reads n bytes into a buffer from the firmware volume hardware.\r
+\r
+  @param Write\r
+  Writes n bytes from a buffer into the firmware volume hardware.\r
+\r
+  @param EraseBlocks\r
+  Erases specified block(s) and sets all values as indicated by\r
+  the EFI_FVB_ERASE_POLARITY bit.\r
+\r
+  @param ParentHandle\r
+  Handle of the parent firmware volume.\r
+\r
+**/\r
+struct _EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL {\r
+  EFI_FVB_GET_ATTRIBUTES        GetVolumeAttributes;\r
+  EFI_FVB_SET_ATTRIBUTES        SetVolumeAttributes;\r
+  EFI_FVB_GET_PHYSICAL_ADDRESS  GetPhysicalAddress;\r
+  EFI_FVB_GET_BLOCK_SIZE        GetBlockSize;\r
+  EFI_FVB_READ                  Read;\r
+  EFI_FVB_WRITE                 Write;\r
+  EFI_FVB_ERASE_BLOCKS          EraseBlocks;\r
+  EFI_HANDLE                    ParentHandle;\r
+};\r
+\r
+extern EFI_GUID gEfiFirmwareVolumeBlockProtocolGuid;\r
+\r
+#endif\r
diff --git a/IntelFrameworkPkg/Include/Protocol/Hii.h b/IntelFrameworkPkg/Include/Protocol/Hii.h
new file mode 100644 (file)
index 0000000..fbecbef
--- /dev/null
@@ -0,0 +1,942 @@
+/** @file\r
+  This file defines the Human Interface Infrastructure protocol which will\r
+  be used by resources which want to publish IFR/Font/String data and have it\r
+  collected by the Configuration engine.\r
+\r
+  Copyright (c) 2007, Intel Corporation\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+  Module Name:  Hii.h\r
+\r
+  @par Revision Reference:\r
+  This protocol is defined in HII spec 0.92.\r
+\r
+**/\r
+\r
+#ifndef _HII_H_\r
+#define _HII_H_\r
+\r
+#define EFI_HII_PROTOCOL_GUID \\r
+  { \\r
+    0xd7ad636e, 0xb997, 0x459b, {0xbf, 0x3f, 0x88, 0x46, 0x89, 0x79, 0x80, 0xe1} \\r
+  }\r
+\r
+// BugBug:\r
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\r
+// If UGA goes away we need to put this some place. I'm not sure where?\r
+//\r
+//typedef struct {\r
+//  UINT8 Blue;\r
+//  UINT8 Green;\r
+//  UINT8 Red;\r
+//  UINT8 Reserved;\r
+//} EFI_UGA_PIXEL;\r
+\r
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\r
+//\r
+\r
+typedef struct _EFI_HII_PROTOCOL  EFI_HII_PROTOCOL;\r
+\r
+//\r
+// Global definition\r
+//\r
+#define NARROW_CHAR         0xFFF0\r
+#define WIDE_CHAR           0xFFF1\r
+#define NON_BREAKING_CHAR   0xFFF2\r
+#define GLYPH_WIDTH         8\r
+#define GLYPH_HEIGHT        19\r
+\r
+#define EFI_HII_FONT        1\r
+#define EFI_HII_STRING      2\r
+#define EFI_HII_IFR         3\r
+#define EFI_HII_KEYBOARD    4\r
+#define EFI_HII_HANDLES     5\r
+#define EFI_HII_VARIABLE    6\r
+#define EFI_HII_DEVICE_PATH 7\r
+\r
+\r
+// References to string tokens must use this macro to enable scanning for\r
+// token usages.\r
+//\r
+#define STRING_TOKEN(t) t\r
+\r
+//\r
+// The following types are currently defined:\r
+//\r
+typedef UINT16  EFI_FORM_ID;\r
+typedef UINT16  EFI_FORM_LABEL;\r
+\r
+#pragma pack(1)\r
+\r
+typedef struct {\r
+  UINT32  Length;\r
+  UINT16  Type;\r
+} EFI_HII_PACK_HEADER;\r
+\r
+//\r
+// A form list consists of a large variety of structure\r
+// possibilities so to represent the binary blob of data\r
+// associated with a package of forms, we will assume a\r
+// pointer to a self-describing data buffer.\r
+//\r
+typedef struct {\r
+  EFI_HII_PACK_HEADER Header;\r
+} EFI_HII_IFR_PACK;\r
+\r
+typedef struct {\r
+  EFI_HII_PACK_HEADER Header;           // Must be filled in\r
+  EFI_HANDLE          ImageHandle;      // Must be filled in\r
+  EFI_HANDLE          DeviceHandle;     // Optional\r
+  EFI_HANDLE          ControllerHandle; // Optional\r
+  EFI_HANDLE          CallbackHandle;   // Optional\r
+  EFI_HANDLE          COBExportHandle;  // Optional\r
+} EFI_HII_HANDLE_PACK;\r
+\r
+//\r
+// ********************************************************\r
+// EFI_VARIABLE_CONTENTS\r
+// ********************************************************\r
+//\r
+typedef struct {\r
+  EFI_HII_PACK_HEADER Header;\r
+  EFI_GUID            VariableGuid;\r
+  UINT32              VariableNameLength;\r
+  UINT16              VariableId;\r
+  //\r
+  //  CHAR16                VariableName[]; //Null-terminated\r
+  //\r
+} EFI_HII_VARIABLE_PACK;\r
+\r
+//\r
+// ********************************************************\r
+// EFI_DEVICE_PATH_PACK\r
+// ********************************************************\r
+//\r
+typedef struct {\r
+  EFI_HII_PACK_HEADER Header;\r
+  //\r
+  //  EFI_DEVICE_PATH       DevicePath[];\r
+  //\r
+} EFI_HII_DEVICE_PATH_PACK;\r
+\r
+//\r
+// ********************************************************\r
+// EFI_HII_DATA_TABLE\r
+// ********************************************************\r
+//\r
+typedef struct {\r
+  EFI_HII_HANDLE  HiiHandle;\r
+  EFI_GUID        PackageGuid;\r
+  UINT32          DataTableSize;\r
+  UINT32          IfrDataOffset;\r
+  UINT32          StringDataOffset;\r
+  UINT32          VariableDataOffset;\r
+  UINT32          DevicePathOffset;\r
+  UINT32          NumberOfVariableData;\r
+  UINT32          NumberOfLanguages;\r
+  //\r
+  // EFI_HII_DEVICE_PATH_PACK DevicePath[];\r
+  // EFI_HII_VARIABLE_PACK VariableData[];\r
+  // EFI_HII_IFR_PACK IfrData;\r
+  // EFI_HII_STRING_PACK StringData[];\r
+  //\r
+} EFI_HII_DATA_TABLE;\r
+\r
+//\r
+// ********************************************************\r
+// EFI_HII_EXPORT_TABLE\r
+// ********************************************************\r
+//\r
+typedef struct {\r
+  UINT32    NumberOfHiiDataTables;\r
+  EFI_GUID  Revision;\r
+  //\r
+  // EFI_HII_DATA_TABLE HiiDataTable[];\r
+  //\r
+} EFI_HII_EXPORT_TABLE;\r
+\r
+typedef struct {\r
+  BOOLEAN               FormSetUpdate;      // If TRUE, next variable is significant\r
+  EFI_PHYSICAL_ADDRESS  FormCallbackHandle; // If not 0, will update Formset with this info\r
+  BOOLEAN               FormUpdate;         // If TRUE, next variable is significant\r
+  UINT16                FormValue;          // specify which form is to be updated if FormUpdate value is TRUE.\r
+  STRING_REF            FormTitle;          // If not 0, will update Form with this info\r
+  UINT16                DataCount;          // The number of Data entries in this structure\r
+  UINT8                 *Data;              // An array of 1+ op-codes, specified by DataCount\r
+} EFI_HII_UPDATE_DATA;\r
+\r
+//\r
+// String attributes\r
+//\r
+#define LANG_RIGHT_TO_LEFT  0x00000001\r
+\r
+//\r
+// A string package is used to localize strings to a particular\r
+// language.  The package is associated with a particular driver\r
+// or set of drivers.  Tools are used to associate tokens with\r
+// string references in forms and in programs.  These tokens are\r
+// language agnostic.  When paired with a language pack (directly\r
+// or indirectly), the string token resolves into an actual\r
+// UNICODE string.  The NumStringPointers determines how many\r
+// StringPointers (offset values) there are as well as the total\r
+// number of Strings that are defined.\r
+//\r
+typedef struct {\r
+  EFI_HII_PACK_HEADER Header;\r
+  RELOFST             LanguageNameString;\r
+  RELOFST             PrintableLanguageName;\r
+  UINT32              NumStringPointers;\r
+  UINT32              Attributes;\r
+  //\r
+  //  RELOFST               StringPointers[];\r
+  //  EFI_STRING            Strings[];\r
+  //\r
+} EFI_HII_STRING_PACK;\r
+\r
+//\r
+// Glyph Attributes\r
+//\r
+#define EFI_GLYPH_NON_SPACING   1\r
+#define EFI_GLYPH_WIDE          2\r
+\r
+typedef struct {\r
+  CHAR16  UnicodeWeight;\r
+  UINT8   Attributes;\r
+  UINT8   GlyphCol1[GLYPH_HEIGHT];\r
+} EFI_NARROW_GLYPH;\r
+\r
+typedef struct {\r
+  CHAR16  UnicodeWeight;\r
+  UINT8   Attributes;\r
+  UINT8   GlyphCol1[GLYPH_HEIGHT];\r
+  UINT8   GlyphCol2[GLYPH_HEIGHT];\r
+  UINT8   Pad[3];\r
+} EFI_WIDE_GLYPH;\r
+\r
+//\r
+// A font list consists of a font header followed by a series\r
+// of glyph structures.  Note that fonts are not language specific.\r
+//\r
+typedef struct {\r
+  EFI_HII_PACK_HEADER Header;\r
+  UINT16              NumberOfNarrowGlyphs;\r
+  UINT16              NumberOfWideGlyphs;\r
+} EFI_HII_FONT_PACK;\r
+\r
+//\r
+// The IfrData in the EFI_HII_IFR_PACK structure definition\r
+// is variable length, and not really part of the header. To\r
+// simplify from code the size of the header, define an\r
+// identical structure that does not include the IfrData field.\r
+// Then use sizeof() this new structure to determine the\r
+// actual size of the header.\r
+//\r
+typedef struct {\r
+  EFI_HII_PACK_HEADER Header;\r
+} EFI_HII_IFR_PACK_HEADER;\r
+\r
+//\r
+// pedef EFI_HII_PACK_HEADER EFI_HII_IFR_PACK_HEADER;\r
+//\r
+typedef enum {\r
+  EfiKeyLCtrl,\r
+  EfiKeyA0,\r
+  EfiKeyLAlt,\r
+  EfiKeySpaceBar,\r
+  EfiKeyA2,\r
+  EfiKeyA3,\r
+  EfiKeyA4,\r
+  EfiKeyRCtrl,\r
+  EfiKeyLeftArrow,\r
+  EfiKeyDownArrow,\r
+  EfiKeyRightArrow,\r
+  EfiKeyZero,\r
+  EfiKeyPeriod,\r
+  EfiKeyEnter,\r
+  EfiKeyLShift,\r
+  EfiKeyB0,\r
+  EfiKeyB1,\r
+  EfiKeyB2,\r
+  EfiKeyB3,\r
+  EfiKeyB4,\r
+  EfiKeyB5,\r
+  EfiKeyB6,\r
+  EfiKeyB7,\r
+  EfiKeyB8,\r
+  EfiKeyB9,\r
+  EfiKeyB10,\r
+  EfiKeyRshift,\r
+  EfiKeyUpArrow,\r
+  EfiKeyOne,\r
+  EfiKeyTwo,\r
+  EfiKeyThree,\r
+  EfiKeyCapsLock,\r
+  EfiKeyC1,\r
+  EfiKeyC2,\r
+  EfiKeyC3,\r
+  EfiKeyC4,\r
+  EfiKeyC5,\r
+  EfiKeyC6,\r
+  EfiKeyC7,\r
+  EfiKeyC8,\r
+  EfiKeyC9,\r
+  EfiKeyC10,\r
+  EfiKeyC11,\r
+  EfiKeyC12,\r
+  EfiKeyFour,\r
+  EfiKeyFive,\r
+  EfiKeySix,\r
+  EfiKeyPlus,\r
+  EfiKeyTab,\r
+  EfiKeyD1,\r
+  EfiKeyD2,\r
+  EfiKeyD3,\r
+  EfiKeyD4,\r
+  EfiKeyD5,\r
+  EfiKeyD6,\r
+  EfiKeyD7,\r
+  EfiKeyD8,\r
+  EfiKeyD9,\r
+  EfiKeyD10,\r
+  EfiKeyD11,\r
+  EfiKeyD12,\r
+  EfiKeyD13,\r
+  EfiKeyDel,\r
+  EfiKeyEnd,\r
+  EfiKeyPgDn,\r
+  EfiKeySeven,\r
+  EfiKeyEight,\r
+  EfiKeyNine,\r
+  EfiKeyE0,\r
+  EfiKeyE1,\r
+  EfiKeyE2,\r
+  EfiKeyE3,\r
+  EfiKeyE4,\r
+  EfiKeyE5,\r
+  EfiKeyE6,\r
+  EfiKeyE7,\r
+  EfiKeyE8,\r
+  EfiKeyE9,\r
+  EfiKeyE10,\r
+  EfiKeyE11,\r
+  EfiKeyE12,\r
+  EfiKeyBackSpace,\r
+  EfiKeyIns,\r
+  EfiKeyHome,\r
+  EfiKeyPgUp,\r
+  EfiKeyNLck,\r
+  EfiKeySlash,\r
+  EfiKeyAsterisk,\r
+  EfiKeyMinus,\r
+  EfiKeyEsc,\r
+  EfiKeyF1,\r
+  EfiKeyF2,\r
+  EfiKeyF3,\r
+  EfiKeyF4,\r
+  EfiKeyF5,\r
+  EfiKeyF6,\r
+  EfiKeyF7,\r
+  EfiKeyF8,\r
+  EfiKeyF9,\r
+  EfiKeyF10,\r
+  EfiKeyF11,\r
+  EfiKeyF12,\r
+  EfiKeyPrint,\r
+  EfiKeySLck,\r
+  EfiKeyPause\r
+} EFI_KEY;\r
+\r
+typedef struct {\r
+  EFI_KEY Key;\r
+  CHAR16  Unicode;\r
+  CHAR16  ShiftedUnicode;\r
+  CHAR16  AltGrUnicode;\r
+  CHAR16  ShiftedAltGrUnicode;\r
+  UINT16  Modifier;\r
+} EFI_KEY_DESCRIPTOR;\r
+\r
+//\r
+// This structure allows a sparse set of keys to be redefined\r
+// or a complete redefinition of the keyboard layout.  Most\r
+// keyboards have a lot of commonality in their layouts, therefore\r
+// only defining those keys that need to change from the default\r
+// minimizes the passed in information.\r
+//\r
+// Additionally, when an update occurs, the active keyboard layout\r
+// will be switched to the newly updated keyboard layout.  This\r
+// allows for situations that when a keyboard layout driver is\r
+// loaded as part of system initialization, the system will default\r
+// the keyboard behavior to the new layout.\r
+//\r
+// Each call to update the keyboard mapping should contain the\r
+// complete set of key descriptors to be updated, since every\r
+// call to the HII which contains an EFI_HII_KEYBOARD_PACK will\r
+// wipe the previous set of overrides.  A call to\r
+//\r
+typedef struct {\r
+  EFI_HII_PACK_HEADER Header;\r
+  EFI_KEY_DESCRIPTOR  *Descriptor;\r
+  UINT8               DescriptorCount;\r
+} EFI_HII_KEYBOARD_PACK;\r
+\r
+//\r
+// The EFI_HII_PACKAGES can contain different types of packages just\r
+// after the structure as inline data.\r
+//\r
+typedef struct {\r
+  UINTN     NumberOfPackages;\r
+  EFI_GUID  *GuidId;\r
+  //\r
+  // EFI_HII_HANDLE_PACK    *HandlePack;        // Only one pack.\r
+  // EFI_HII_IFR_PACK       *IfrPack;           // Only one pack.\r
+  // EFI_HII_FONT_PACK      *FontPack[];        // Multiple packs ok\r
+  // EFI_HII_STRING_PACK    *StringPack[];      // Multiple packs ok\r
+  // EFI_HII_KEYBOARD_PACK  *KeyboardPack[];    // Multiple packs ok\r
+  //\r
+} EFI_HII_PACKAGES;\r
+\r
+typedef struct _EFI_HII_VARIABLE_PACK_LIST {\r
+  struct _EFI_HII_VARIABLE_PACK_LIST   *NextVariablePack;\r
+  EFI_HII_VARIABLE_PACK                *VariablePack;\r
+} EFI_HII_VARIABLE_PACK_LIST;\r
+\r
+#pragma pack()\r
+\r
+/**\r
+  Registers the various packs that are passed in via the Packages parameter.\r
+\r
+  @param  This                  A pointer to the EFI_HII_PROTOCOL instance.\r
+  @param  Packages              A pointer to an EFI_HII_PACKAGES package instance.\r
+  @param  Handle                A pointer to the EFI_HII_HANDLE instance.\r
+\r
+  @retval EFI_SUCCESS           Data was extracted from Packages, the database\r
+                                was updated with the data, and Handle returned successfully.\r
+  @retval EFI_INVALID_PARAMETER The content of Packages was invalid.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_HII_NEW_PACK) (\r
+  IN  EFI_HII_PROTOCOL    *This,\r
+  IN  EFI_HII_PACKAGES    *Packages,\r
+  OUT EFI_HII_HANDLE      *Handle\r
+  );\r
+\r
+/**\r
+  Removes a package from the HII database.\r
+\r
+  @param  This                  A pointer to the EFI_HII_PROTOCOL instance.\r
+  @param  Handle                The handle that was registered to the data that is requested\r
+                                for removal.\r
+\r
+  @retval EFI_SUCCESS           The data associated with the Handle was removed\r
+                                from the HII database.\r
+  @retval EFI_INVALID_PARAMETER The Handle was not valid.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_HII_REMOVE_PACK) (\r
+  IN EFI_HII_PROTOCOL    *This,\r
+  IN EFI_HII_HANDLE      Handle\r
+  );\r
+\r
+/**\r
+  Determines the handles that are currently active in the database.\r
+\r
+  @param  This                  A pointer to the EFI_HII_PROTOCOL instance.\r
+  @param  HandleBufferLength    On input, a pointer to the length of the handle\r
+                                buffer. On output, the length of the handle buffer that is required\r
+                                for the handles found.\r
+  @param  Handle                An array of EFI_HII_HANDLE instances returned.\r
+\r
+  @retval EFI_SUCCESS           Handle was updated successfully.\r
+  @retval EFI_BUFFER_TOO_SMALL  The HandleBufferLength parameter indicates\r
+                                that Handle is too small to support the number of handles.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_HII_FIND_HANDLES) (\r
+  IN     EFI_HII_PROTOCOL *This,\r
+  IN OUT UINT16           *HandleBufferLength,\r
+  OUT    EFI_HII_HANDLE   *Handle\r
+  );\r
+\r
+/**\r
+  Exports the contents of the database into a buffer.\r
+\r
+  @param  This                  A pointer to the EFI_HII_PROTOCOL instance.\r
+  @param  Handle                An EFI_HII_HANDLE that corresponds to the desired\r
+                                handle to export. If the value is 0, the entire database will be exported.\r
+                                In either case, the data will be exported in a format described by the\r
+                                structure definition of EFI_HII_EXPORT_TABLE.\r
+  @param  BufferSize\r
+  On input, a pointer to the length of the buffer. On output, the length\r
+  of the buffer that is required for the export data.\r
+  @param  Buffer                A pointer to a buffer that will contain the results of the export function.\r
+\r
+  @retval EFI_SUCCESS           The buffer was successfully filled with BufferSize amount of data.\r
+  @retval EFI_BUFFER_TOO_SMALL  The value in BufferSize was too small to contain the export data.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_HII_EXPORT) (\r
+  IN     EFI_HII_PROTOCOL *This,\r
+  IN     EFI_HII_HANDLE   Handle,\r
+  IN OUT UINTN            *BufferSize,\r
+  OUT    VOID             *Buffer\r
+  );\r
+\r
+/**\r
+  Remove any new strings that were added after the initial string export\r
+  for this handle.\r
+\r
+  @param  This                  A pointer to the EFI_HII_PROTOCOL instance.\r
+  @param  Handle                The handle on which the string resides.\r
+\r
+  @retval EFI_SUCCESS           Remove strings from the handle successfully.\r
+  @retval EFI_INVALID_PARAMETER The Handle was unknown.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_HII_RESET_STRINGS) (\r
+  IN     EFI_HII_PROTOCOL   *This,\r
+  IN     EFI_HII_HANDLE     Handle\r
+  );\r
+\r
+/**\r
+  Tests if all of the characters in a string have corresponding font characters.\r
+\r
+  @param  This                  A pointer to the EFI_HII_PROTOCOL instance.\r
+  @param  StringToTest          A pointer to a Unicode string.\r
+  @param  FirstMissing          A pointer to an index into the string. On input,\r
+                                the index of the first character in the StringToTest to examine. On exit,\r
+                                the index of the first character encountered for which a glyph is unavailable.\r
+                                If all glyphs in the string are available, the index is the index of the\r
+                                terminator of the string.\r
+  @param  GlyphBufferSize       A pointer to a value. On output, if the function\r
+                                returns EFI_SUCCESS, it contains the amount of memory that is required to\r
+                                store the string's glyph equivalent.\r
+\r
+  @retval EFI_SUCCESS           All glyphs are available. Note that an empty string\r
+                                always returns this value.\r
+  @retval EFI_NOT_FOUND         A glyph was not found for a character.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_HII_TEST_STRING) (\r
+  IN     EFI_HII_PROTOCOL  *This,\r
+  IN     CHAR16            *StringToTest,\r
+  IN OUT UINT32            *FirstMissing,\r
+  OUT    UINT32            *GlyphBufferSize\r
+  );\r
+\r
+/**\r
+  Translates a Unicode character into the corresponding font glyph.\r
+\r
+  @param  This                  A pointer to the EFI_HII_PROTOCOL instance.\r
+  @param  Source                A pointer to a Unicode string.\r
+  @param  Index                 On input, the offset into the string from which to fetch\r
+                                the character.On successful completion, the index is updated to the first\r
+                                character past the character(s) making up the just extracted glyph.\r
+  @param  GlyphBuffer           Pointer to an array where the glyphs corresponding\r
+                                to the characters in the source may be stored. GlyphBuffer is assumed\r
+                                to be wide enough to accept a wide glyph character.\r
+  @param  BitWidth              If EFI_SUCCESS was returned, the UINT16 pointed to by\r
+                                this value is filled with the length of the glyph in pixels. It is unchanged\r
+                                if the call was unsuccessful.\r
+  @param  InternalStatus        The cell pointed to by this parameter must be\r
+                                initialized to zero prior to invoking the call the first time for any string.\r
+\r
+  @retval EFI_SUCCESS           It worked.\r
+  @retval EFI_NOT_FOUND         A glyph for a character was not found.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_HII_GET_GLYPH) (\r
+  IN     EFI_HII_PROTOCOL  *This,\r
+  IN     CHAR16            *Source,\r
+  IN OUT UINT16            *Index,\r
+  OUT    UINT8             **GlyphBuffer,\r
+  OUT    UINT16            *BitWidth,\r
+  IN OUT UINT32            *InternalStatus\r
+  );\r
+\r
+/**\r
+  Translates a glyph into the format required for input to the Universal\r
+  Graphics Adapter (UGA) Block Transfer (BLT) routines.\r
+\r
+  @param  This                  A pointer to the EFI_HII_PROTOCOL instance.\r
+  @param  GlyphBuffer           A pointer to the buffer that contains glyph data.\r
+  @param  Foreground            The foreground setting requested to be used for the\r
+                                generated BltBuffer data.\r
+  @param  Background            The background setting requested to be used for the\r
+                                generated BltBuffer data.\r
+  @param  Count                 The entry in the BltBuffer upon which to act.\r
+  @param  Width                 The width in bits of the glyph being converted.\r
+  @param  Height                The height in bits of the glyph being converted\r
+  @param  BltBuffer             A pointer to the buffer that contains the data that is\r
+                                ready to be used by the UGA BLT routines.\r
+\r
+  @retval EFI_SUCCESS           It worked.\r
+  @retval EFI_NOT_FOUND         A glyph for a character was not found.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_HII_GLYPH_TO_BLT) (\r
+  IN     EFI_HII_PROTOCOL             *This,\r
+  IN     UINT8                        *GlyphBuffer,\r
+  IN     EFI_GRAPHICS_OUTPUT_BLT_PIXEL Foreground,\r
+  IN     EFI_GRAPHICS_OUTPUT_BLT_PIXEL Background,\r
+  IN     UINTN                         Count,\r
+  IN     UINTN                         Width,\r
+  IN     UINTN                         Height,\r
+  IN OUT EFI_GRAPHICS_OUTPUT_BLT_PIXEL *BltBuffer\r
+  );\r
+\r
+/**\r
+  Allows a new string to be added to an already existing string package.\r
+\r
+  @param  This                  A pointer to the EFI_HII_PROTOCOL instance.\r
+  @param  Pointer               to a NULL-terminated string containing a single ISO 639-2\r
+                                language identifier, indicating the language in which the string is translated.\r
+  @param  Handle                The handle of the language pack to which the string is to be added.\r
+  @param  Reference             The identifier of the string to be added. If the reference\r
+                                value is zero, then the string will be assigned a new identifier on that\r
+                                handle for the language specified. Otherwise, the string will be updated\r
+                                with the NewString Value.\r
+  @param  NewString             The string to be added.\r
+\r
+  @retval EFI_SUCCESS           The string was effectively registered.\r
+  @retval EFI_INVALID_PARAMETER The Handle was unknown.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_HII_NEW_STRING) (\r
+  IN     EFI_HII_PROTOCOL      *This,\r
+  IN     CHAR16                *Language,\r
+  IN     EFI_HII_HANDLE        Handle,\r
+  IN OUT STRING_REF            *Reference,\r
+  IN     CHAR16                *NewString\r
+  );\r
+\r
+/**\r
+  Allows a program to determine the primary languages that are supported\r
+  on a given handle.\r
+\r
+  @param  This                  A pointer to the EFI_HII_PROTOCOL instance.\r
+  @param  Handle                The handle on which the strings reside.\r
+  @param  LanguageString        A string allocated by GetPrimaryLanguages() that\r
+                                contains a list of all primary languages registered on the handle.\r
+\r
+  @retval EFI_SUCCESS           LanguageString was correctly returned.\r
+  @retval EFI_INVALID_PARAMETER The Handle was unknown.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_HII_GET_PRI_LANGUAGES) (\r
+  IN  EFI_HII_PROTOCOL    *This,\r
+  IN  EFI_HII_HANDLE      Handle,\r
+  OUT EFI_STRING          *LanguageString\r
+  );\r
+\r
+/**\r
+  Allows a program to determine which secondary languages are supported\r
+  on a given handle for a given primary language.\r
+\r
+  @param  This                  A pointer to the EFI_HII_PROTOCOL instance.\r
+  @param  Handle                The handle on which the strings reside.\r
+  @param  PrimaryLanguage       Pointer to a NULL-terminated string containing a single\r
+                                ISO 639-2 language identifier, indicating the primary language.\r
+  @param  LanguageString        A string allocated by GetSecondaryLanguages()\r
+                                containing a list of all secondary languages registered on the handle.\r
+\r
+  @retval EFI_SUCCESS           LanguageString was correctly returned.\r
+  @retval EFI_INVALID_PARAMETER The Handle was unknown.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_HII_GET_SEC_LANGUAGES) (\r
+  IN  EFI_HII_PROTOCOL    *This,\r
+  IN  EFI_HII_HANDLE      Handle,\r
+  IN  CHAR16              *PrimaryLanguage,\r
+  OUT EFI_STRING          *LanguageString\r
+  );\r
+\r
+/**\r
+  Extracts a string from a package already registered with the EFI HII database.\r
+\r
+  @param  This                  A pointer to the EFI_HII_PROTOCOL instance.\r
+  @param  Handle                The handle on which the string resides.\r
+  @param  Token                 The string token assigned to the string.\r
+  @param  Raw                   If TRUE, the string is returned unedited in the internal\r
+                                storage format described above. If false, the string returned is edited\r
+                                by replacing <cr> with <space> and by removing special characters such\r
+                                as the <wide> prefix.\r
+  @param  LanguageString        Pointer to a NULL-terminated string containing a\r
+                                single ISO 639-2 language identifier, indicating the language to print.\r
+                                If the LanguageString is empty (starts with a NULL), the default system\r
+                                language will be used to determine the language.\r
+  @param  BufferLength          Length of the StringBuffer.\r
+  @param  StringBuffer          The buffer designed to receive the characters in the string.\r
+\r
+  @retval EFI_SUCCESS           StringBuffer is filled with a NULL-terminated string.\r
+  @retval EFI_INVALID_PARAMETER The handle or string token is unknown.\r
+  @retval EFI_BUFFER_TOO_SMALL  The buffer provided was not large enough to\r
+                                allow the entire string to be stored.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_HII_GET_STRING) (\r
+  IN     EFI_HII_PROTOCOL  *This,\r
+  IN     EFI_HII_HANDLE    Handle,\r
+  IN     STRING_REF        Token,\r
+  IN     BOOLEAN           Raw,\r
+  IN     CHAR16            *LanguageString,\r
+  IN OUT UINTN             *BufferLength,\r
+  OUT    EFI_STRING        StringBuffer\r
+  );\r
+\r
+/**\r
+  Allows a program to extract a part of a string of not more than a given width.\r
+\r
+  @param  This                  A pointer to the EFI_HII_PROTOCOL instance.\r
+  @param  Handle                The handle on which the string resides.\r
+  @param  Token                 The string token assigned to the string.\r
+  @param  Index                 On input, the offset into the string where the line is to start.\r
+                                On output, the index is updated to point to beyond the last character returned\r
+                                in the call.\r
+  @param  LineWidth             The maximum width of the line in units of narrow glyphs.\r
+  @param  LanguageString        Pointer to a NULL-terminated string containing a\r
+                                single ISO 639-2 language identifier, indicating the language to print.\r
+  @param  BufferLength          Pointer to the length of the StringBuffer.\r
+  @param  StringBuffer          The buffer designed to receive the characters in the string.\r
+\r
+  @retval EFI_SUCCESS           StringBuffer filled with characters that will fit on the line.\r
+  @retval EFI_NOT_FOUND         The font glyph for at least one of the characters in\r
+                                the string is not in the font database.\r
+  @retval EFI_BUFFER_TOO_SMALL  The buffer provided was not large enough\r
+                                to allow the entire string to be stored.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_HII_GET_LINE) (\r
+  IN     EFI_HII_PROTOCOL  *This,\r
+  IN     EFI_HII_HANDLE    Handle,\r
+  IN     STRING_REF        Token,\r
+  IN OUT UINT16            *Index,\r
+  IN     UINT16            LineWidth,\r
+  IN     CHAR16            *LanguageString,\r
+  IN OUT UINT16            *BufferLength,\r
+  OUT    EFI_STRING        StringBuffer\r
+  );\r
+\r
+/**\r
+  Allows a program to extract a form or form package that has previously\r
+  been registered with the HII database.\r
+\r
+  @param  This                  A pointer to the EFI_HII_PROTOCOL instance.\r
+  @param  Handle                Handle on which the form resides.\r
+  @param  FormId                The ID of the form to return. If the ID is zero,\r
+                                the entire form package is returned.\r
+  @param  BufferLength          On input, the length of the Buffer. On output,\r
+                                the length of the returned buffer,\r
+  @param  Buffer                The buffer designed to receive the form(s).\r
+\r
+  @retval EFI_SUCCESS           Buffer filled with the requested forms. BufferLength\r
+                                was updated.\r
+  @retval EFI_INVALID_PARAMETER The handle is unknown.\r
+  @retval EFI_NOT_FOUND         A form on the requested handle cannot be found with\r
+                                the requested FormId.\r
+  @retval EFI_BUFFER_TOO_SMALL  The buffer provided was not large enough\r
+                                to allow the form to be stored.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_HII_GET_FORMS) (\r
+  IN     EFI_HII_PROTOCOL  *This,\r
+  IN     EFI_HII_HANDLE    Handle,\r
+  IN     EFI_FORM_ID       FormId,\r
+  IN OUT UINTN             *BufferLength,\r
+  OUT    UINT8             *Buffer\r
+  );\r
+\r
+/**\r
+  Extracts the defaults that are associated with a given handle in the HII database.\r
+\r
+  @param  This                  A pointer to the EFI_HII_PROTOCOL instance.\r
+  @param  Handle                The HII handle from which will have default data retrieved.\r
+  @param  DefaultMask           The mask used to specify some type of default override when extracting\r
+                                the default image data.\r
+  @param  VariablePackList      A indirect pointer to the first entry of a link list with\r
+                                type EFI_HII_VARIABLE_PACK_LIST.\r
+\r
+  @retval EFI_SUCCESS           The VariablePackList was populated with the appropriate\r
+                                default setting data.\r
+  @retval EFI_NOT_FOUND         The IFR does not have any explicit or default map(s).\r
+  @retval EFI_INVALID_PARAMETER The HII database entry associated with Handle\r
+                                contain invalid data.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_HII_GET_DEFAULT_IMAGE) (\r
+  IN     EFI_HII_PROTOCOL           *This,\r
+  IN     EFI_HII_HANDLE             Handle,\r
+  IN     UINTN                      DefaultMask,\r
+  OUT    EFI_HII_VARIABLE_PACK_LIST **VariablePackList\r
+  );\r
+\r
+/**\r
+  Allows the caller to update a form or form package that has previously been\r
+  registered with the EFI HII database.\r
+\r
+  @param  This                  A pointer to the EFI_HII_PROTOCOL instance.\r
+  @param  Handle                Handle of the package where the form to be updated resides.\r
+  @param  Label                 The label inside the form package where the update is to take place.\r
+  @param  AddData               If TRUE, adding data at a given Label; otherwise,\r
+                                if FALSE, removing data at a given Label.\r
+  @param  Data                  The buffer containing the new tags to insert after the Label\r
+\r
+  @retval EFI_SUCCESS           The form was updated with the new tags.\r
+  @retval EFI_INVALID_PARAMETER The buffer for the buffer length does not\r
+                                contain an integral number of tags.\r
+  @retval EFI_NOT_FOUND         The Handle, Label, or FormId was not found.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_HII_UPDATE_FORM) (\r
+  IN EFI_HII_PROTOCOL     *This,\r
+  IN EFI_HII_HANDLE       Handle,\r
+  IN EFI_FORM_LABEL       Label,\r
+  IN BOOLEAN              AddData,\r
+  IN EFI_HII_UPDATE_DATA  *Data\r
+  );\r
+\r
+/**\r
+  Retrieves the current keyboard layout.\r
+\r
+  @param  This                  A pointer to the EFI_HII_PROTOCOL instance.\r
+  @param  DescriptorCount       A pointer to the number of Descriptor entries being\r
+                                described in the keyboard layout being retrieved.\r
+  @param  Descriptor            A pointer to a buffer containing an array of EFI_KEY_DESCRIPTOR\r
+                                entries. Each entry will reflect the definition of a specific physical key.\r
+\r
+  @retval EFI_SUCCESS           The keyboard layout was retrieved successfully.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_HII_GET_KEYBOARD_LAYOUT) (\r
+  IN     EFI_HII_PROTOCOL    *This,\r
+  OUT    UINT16              *DescriptorCount,\r
+  OUT    EFI_KEY_DESCRIPTOR  *Descriptor\r
+  );\r
+\r
+/**\r
+  @par Protocol Description:\r
+  The HII Protocol manages the HII database, which is a repository for data\r
+  having to do with fonts, strings, forms, keyboards, and other future human\r
+  interface items.\r
+\r
+  @param NewPack\r
+  Extracts the various packs from a package list.\r
+\r
+  @param RemovePack\r
+  Removes a package from the HII database.\r
+\r
+  @param FindHandles\r
+  Determines the handles that are currently active in the database.\r
+\r
+  @param ExportDatabase\r
+  Export the entire contents of the database to a buffer.\r
+\r
+  @param TestString\r
+  Tests if all of the characters in a string have corresponding font characters.\r
+\r
+  @param GetGlyph\r
+  Translates a Unicode character into the corresponding font glyph.\r
+\r
+  @param GlyphToBlt\r
+  Converts a glyph value into a format that is ready for a UGA BLT command.\r
+\r
+  @param NewString\r
+  Allows a new string to be added to an already existing string package.\r
+\r
+  @param GetPrimaryLanguages\r
+  Allows a program to determine the primary languages that are supported\r
+  on a given handle.\r
+\r
+  @param GetSecondaryLanguages\r
+  Allows a program to determine which secondary languages are supported\r
+  on a given handle for a given primary language.\r
+\r
+  @param GetString\r
+  Extracts a string from a package that is already registered with the\r
+  EFI HII database.\r
+\r
+  @param ResetString\r
+  Remove any new strings that were added after the initial string export\r
+  for this handle.\r
+\r
+  @param GetLine\r
+  Allows a program to extract a part of a string of not more than a given width.\r
+\r
+  @param GetForms\r
+  Allows a program to extract a form or form package that has been previously registered.\r
+\r
+  @param GetDefaultImage\r
+  Allows a program to extract the nonvolatile image that represents the default storage image.\r
+\r
+  @param UpdateForm\r
+  Allows a program to update a previously registered form.\r
+\r
+  @param GetKeyboardLayout\r
+  Allows a program to extract the current keyboard layout.\r
+\r
+**/\r
+struct _EFI_HII_PROTOCOL {\r
+  EFI_HII_NEW_PACK            NewPack;\r
+  EFI_HII_REMOVE_PACK         RemovePack;\r
+  EFI_HII_FIND_HANDLES        FindHandles;\r
+  EFI_HII_EXPORT              ExportDatabase;\r
+\r
+  EFI_HII_TEST_STRING         TestString;\r
+  EFI_HII_GET_GLYPH           GetGlyph;\r
+  EFI_HII_GLYPH_TO_BLT        GlyphToBlt;\r
+\r
+  EFI_HII_NEW_STRING          NewString;\r
+  EFI_HII_GET_PRI_LANGUAGES   GetPrimaryLanguages;\r
+  EFI_HII_GET_SEC_LANGUAGES   GetSecondaryLanguages;\r
+  EFI_HII_GET_STRING          GetString;\r
+  EFI_HII_RESET_STRINGS       ResetStrings;\r
+  EFI_HII_GET_LINE            GetLine;\r
+  EFI_HII_GET_FORMS           GetForms;\r
+  EFI_HII_GET_DEFAULT_IMAGE   GetDefaultImage;\r
+  EFI_HII_UPDATE_FORM         UpdateForm;\r
+\r
+  EFI_HII_GET_KEYBOARD_LAYOUT GetKeyboardLayout;\r
+};\r
+\r
+extern EFI_GUID gEfiHiiProtocolGuid;\r
+\r
+#endif\r
diff --git a/IntelFrameworkPkg/Include/Protocol/IdeControllerInit.h b/IntelFrameworkPkg/Include/Protocol/IdeControllerInit.h
new file mode 100644 (file)
index 0000000..1f8b515
--- /dev/null
@@ -0,0 +1,455 @@
+/** @file\r
+  This file declares EFI IDE Controller Init Protocol\r
+\r
+  Copyright (c) 2007, Intel Corporation\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+  Module Name:  IdeControllerInit.h\r
+\r
+  @par Revision Reference:\r
+  This Protocol is defined in IDE Controller Initialization Protocol Specification\r
+  Version 0.9\r
+\r
+**/\r
+\r
+#ifndef _EFI_IDE_CONTROLLER_INIT_PROTOCOL_H_\r
+#define _EFI_IDE_CONTROLLER_INIT_PROTOCOL_H_\r
+\r
+//\r
+// Global ID for the EFI Platform IDE Protocol GUID\r
+//\r
+#define EFI_IDE_CONTROLLER_INIT_PROTOCOL_GUID \\r
+  { 0xa1e37052, 0x80d9, 0x4e65, {0xa3, 0x17, 0x3e, 0x9a, 0x55, 0xc4, 0x3e, 0xc9 } }\r
+\r
+//\r
+// Forward reference for pure ANSI compatability\r
+//\r
+typedef struct _EFI_IDE_CONTROLLER_INIT_PROTOCOL  EFI_IDE_CONTROLLER_INIT_PROTOCOL;\r
+\r
+//\r
+//////////////////////////////////////////////////////////////////////////////////////////\r
+// EFI_IDE_BUS_ENUMERATION_PHASE\r
+// EFI_IDE_CONTROLLER_ENUM_PHASE\r
+//\r
+typedef enum{\r
+  EfiIdeBeforeChannelEnumeration,\r
+  EfiIdeAfterChannelEnumeration,\r
+  EfiIdeBeforeChannelReset,\r
+  EfiIdeAfterChannelReset,\r
+  EfiIdeBusBeforeDevicePresenceDetection,\r
+  EfiIdeBusAfterDevicePresenceDetection,\r
+  EfiIdeResetMode,\r
+  EfiIdeBusPhaseMaximum\r
+} EFI_IDE_CONTROLLER_ENUM_PHASE;\r
+\r
+//\r
+//******************************************************\r
+// EFI_ATA_EXT_TRANSFER_PROTOCOL\r
+//******************************************************\r
+//\r
+// This extended mode describes the SATA physical protocol.\r
+// SATA physical layers can operate at different speeds.\r
+// These speeds are defined below. Various PATA protocols\r
+// and associated modes are not applicable to SATA devices.\r
+//\r
+\r
+typedef enum {\r
+  EfiAtaSataTransferProtocol\r
+} EFI_ATA_EXT_TRANSFER_PROTOCOL;\r
+\r
+#define  EFI_SATA_AUTO_SPEED  0\r
+#define  EFI_SATA_GEN1_SPEED  1\r
+#define  EFI_SATA_GEN2_SPEED  2\r
+\r
+//\r
+//*******************************************************\r
+// EFI_IDE_CABLE_TYPE\r
+//*******************************************************\r
+//\r
+typedef enum {\r
+  EfiIdeCableTypeUnknown,\r
+  EfiIdeCableType40pin,\r
+  EfiIdeCableType80Pin,\r
+  EfiIdeCableTypeSerial,\r
+  EfiIdeCableTypeMaximum\r
+} EFI_IDE_CABLE_TYPE;\r
+\r
+//\r
+//******************************************************\r
+// EFI_ATA_MODE\r
+//******************************************************\r
+//\r
+typedef struct {\r
+  BOOLEAN      Valid;\r
+  UINT32       Mode;\r
+} EFI_ATA_MODE;\r
+\r
+//\r
+//******************************************************\r
+// EFI_ATA_EXTENDED_MODE\r
+//******************************************************\r
+//\r
+typedef struct {\r
+  EFI_ATA_EXT_TRANSFER_PROTOCOL  TransferProtocol;\r
+  UINT32                         Mode;\r
+} EFI_ATA_EXTENDED_MODE;\r
+\r
+//\r
+//******************************************************\r
+// EFI_ATA_COLLECTIVE_MODE\r
+//******************************************************\r
+//\r
+typedef struct {\r
+  EFI_ATA_MODE           PioMode;\r
+  EFI_ATA_MODE           SingleWordDmaMode;\r
+  EFI_ATA_MODE           MultiWordDmaMode;\r
+  EFI_ATA_MODE           UdmaMode;\r
+  UINT32                 ExtModeCount;\r
+  EFI_ATA_EXTENDED_MODE  ExtMode[1];\r
+} EFI_ATA_COLLECTIVE_MODE;\r
+\r
+//\r
+//*******************************************************\r
+// EFI_ATA_IDENTIFY_DATA\r
+//*******************************************************\r
+//\r
+\r
+#pragma pack(1)\r
+\r
+typedef struct {\r
+  UINT16  config;             // General Configuration\r
+  UINT16  cylinders;          // Number of Cylinders\r
+  UINT16  reserved_2;\r
+  UINT16  heads;              //Number of logical heads\r
+  UINT16  vendor_data1;\r
+  UINT16  vendor_data2;\r
+  UINT16  sectors_per_track;\r
+  UINT16  vendor_specific_7_9[3];\r
+  CHAR8   SerialNo[20];       // ASCII\r
+  UINT16  vendor_specific_20_21[2];\r
+  UINT16  ecc_bytes_available;\r
+  CHAR8   FirmwareVer[8];     // ASCII\r
+  CHAR8   ModelName[40];      // ASCII\r
+  UINT16  multi_sector_cmd_max_sct_cnt;\r
+  UINT16  reserved_48;\r
+  UINT16  capabilities;\r
+  UINT16  reserved_50;\r
+  UINT16  pio_cycle_timing;\r
+  UINT16  reserved_52;\r
+  UINT16  field_validity;\r
+  UINT16  current_cylinders;\r
+  UINT16  current_heads;\r
+  UINT16  current_sectors;\r
+  UINT16  CurrentCapacityLsb;\r
+  UINT16  CurrentCapacityMsb;\r
+  UINT16  reserved_59;\r
+  UINT16  user_addressable_sectors_lo;\r
+  UINT16  user_addressable_sectors_hi;\r
+  UINT16  reserved_62;\r
+  UINT16  multi_word_dma_mode;\r
+  UINT16  advanced_pio_modes;\r
+  UINT16  min_multi_word_dma_cycle_time;\r
+  UINT16  rec_multi_word_dma_cycle_time;\r
+  UINT16  min_pio_cycle_time_without_flow_control;\r
+  UINT16  min_pio_cycle_time_with_flow_control;\r
+  UINT16  reserved_69_79[11];\r
+  UINT16  major_version_no;\r
+  UINT16  minor_version_no;\r
+  UINT16  command_set_supported_82; // word 82\r
+  UINT16  command_set_supported_83; // word 83\r
+  UINT16  command_set_feature_extn; // word 84\r
+  UINT16  command_set_feature_enb_85; // word 85\r
+  UINT16  command_set_feature_enb_86; // word 86\r
+  UINT16  command_set_feature_default; // word 87\r
+  UINT16  ultra_dma_mode; // word 88\r
+  UINT16  reserved_89_127[39];\r
+  UINT16  security_status;\r
+  UINT16  vendor_data_129_159[31];\r
+  UINT16  reserved_160_255[96];\r
+} EFI_ATA_IDENTIFY_DATA;\r
+\r
+#pragma pack()\r
+//\r
+//*******************************************************\r
+// EFI_ATAPI_IDENTIFY_DATA\r
+//*******************************************************\r
+//\r
+#pragma pack(1)\r
+typedef struct {\r
+    UINT16  config;             // General Configuration\r
+    UINT16  obsolete_1;\r
+    UINT16  specific_config;\r
+    UINT16  obsolete_3;\r
+    UINT16  retired_4_5[2];\r
+    UINT16  obsolete_6;\r
+    UINT16  cfa_reserved_7_8[2];\r
+    UINT16  retired_9;\r
+    CHAR8   SerialNo[20];       // ASCII\r
+    UINT16  retired_20_21[2];\r
+    UINT16  obsolete_22;\r
+    CHAR8   FirmwareVer[8];     // ASCII\r
+    CHAR8   ModelName[40];      // ASCII\r
+    UINT16  multi_sector_cmd_max_sct_cnt;\r
+    UINT16  reserved_48;\r
+    UINT16  capabilities_49;\r
+    UINT16  capabilities_50;\r
+    UINT16  obsolete_51_52[2];\r
+    UINT16  field_validity;\r
+    UINT16  obsolete_54_58[5];\r
+    UINT16  mutil_sector_setting;\r
+    UINT16  user_addressable_sectors_lo;\r
+    UINT16  user_addressable_sectors_hi;\r
+    UINT16  obsolete_62;\r
+    UINT16  multi_word_dma_mode;\r
+    UINT16  advanced_pio_modes;\r
+    UINT16  min_multi_word_dma_cycle_time;\r
+    UINT16  rec_multi_word_dma_cycle_time;\r
+    UINT16  min_pio_cycle_time_without_flow_control;\r
+    UINT16  min_pio_cycle_time_with_flow_control;\r
+    UINT16  reserved_69_74[6];\r
+    UINT16  queue_depth;\r
+    UINT16  reserved_76_79[4];\r
+    UINT16  major_version_no;\r
+    UINT16  minor_version_no;\r
+    UINT16  cmd_set_support_82;\r
+    UINT16  cmd_set_support_83;\r
+    UINT16  cmd_feature_support;\r
+    UINT16  cmd_feature_enable_85;\r
+    UINT16  cmd_feature_enable_86;\r
+    UINT16  cmd_feature_default;\r
+    UINT16  ultra_dma_select;\r
+    UINT16  time_required_for_sec_erase;\r
+    UINT16  time_required_for_enhanced_sec_erase;\r
+    UINT16  current_advanced_power_mgmt_value;\r
+    UINT16  master_pwd_revison_code;\r
+    UINT16  hardware_reset_result;\r
+    UINT16  current_auto_acoustic_mgmt_value;\r
+    UINT16  reserved_95_99[5];\r
+    UINT16  max_user_lba_for_48bit_addr[4];\r
+    UINT16  reserved_104_126[23];\r
+    UINT16  removable_media_status_notification_support;\r
+    UINT16  security_status;\r
+    UINT16  vendor_data_129_159[31];\r
+    UINT16  cfa_power_mode;\r
+    UINT16  cfa_reserved_161_175[15];\r
+    UINT16  current_media_serial_no[30];\r
+    UINT16  reserved_206_254[49];\r
+    UINT16  integrity_word;\r
+} EFI_ATAPI_IDENTIFY_DATA;\r
+\r
+#pragma pack()\r
+//\r
+//*******************************************************\r
+// EFI_IDENTIFY_DATA\r
+//*******************************************************\r
+//\r
+typedef union {\r
+  EFI_ATA_IDENTIFY_DATA       AtaData;\r
+  EFI_ATAPI_IDENTIFY_DATA     AtapiData;\r
+} EFI_IDENTIFY_DATA;\r
+\r
+#define   EFI_ATAPI_DEVICE_IDENTIFY_DATA  0x8000\r
+\r
+//\r
+/////////////////////////////////////////////////////////////////////////////////////////\r
+// Function prototype declaration, for ANSI compatability\r
+//\r
+/**\r
+  Returns the information about the specified IDE channel.\r
+\r
+  @param  This                  Pointer to the EFI_IDE_CONTROLLER_INIT_PROTOCOL instance.\r
+  @param  Channel               Zero-based channel number.\r
+  @param  Enabled               TRUE if this channel is enabled. Disabled channels are not scanned\r
+                                to see if any devices are present.\r
+  @param  MaxDevices            The maximum number of IDE devices that the bus driver\r
+                                can expect on this channel.\r
+\r
+  @retval EFI_SUCCESS           Information was returned without any errors.\r
+  @retval EFI_INVALID_PARAMETER Channel is invalid (Channel >= ChannelCount).\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_IDE_CONTROLLER_GET_CHANNEL_INFO) (\r
+  IN EFI_IDE_CONTROLLER_INIT_PROTOCOL *This,\r
+  IN  UINT8                           Channel,\r
+  OUT BOOLEAN                         *Enabled,\r
+  OUT UINT8                           *MaxDevices\r
+);\r
+\r
+/**\r
+  The notifications from the IDE bus driver that it is about to enter a certain\r
+  phase of the IDE channel enumeration process.\r
+\r
+  @param  This                  Pointer to the EFI_IDE_CONTROLLER_INIT_PROTOCOL instance.\r
+  @param  Phase                 The phase during enumeration.\r
+  @param  Channel               Zero-based channel number.\r
+\r
+  @retval EFI_SUCCESS           The notification was accepted without any errors.\r
+  @retval EFI_NOT_SUPPORTED     Phase is not supported.\r
+  @retval EFI_INVALID_PARAMETER Channel is invalid (Channel >= ChannelCount).\r
+  @retval EFI_NOT_READY         This phase cannot be entered at this time.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_IDE_CONTROLLER_NOTIFY_PHASE) (\r
+  IN EFI_IDE_CONTROLLER_INIT_PROTOCOL  *This,\r
+  IN EFI_IDE_CONTROLLER_ENUM_PHASE     Phase,\r
+  IN UINT8                             Channel\r
+);\r
+\r
+/**\r
+  Submits the device information to the IDE controller driver.\r
+\r
+  @param  This                  Pointer to the EFI_IDE_CONTROLLER_INIT_PROTOCOL instance.\r
+  @param  Channel               Zero-based channel number.\r
+  @param  Device                Zero-based device number on the Channel.\r
+  @param  IdentifyData          The device's response to the ATA IDENTIFY_DEVICE command.\r
+\r
+  @retval EFI_SUCCESS           The information was accepted without any errors.\r
+  @retval EFI_INVALID_PARAMETER Channel is invalid (Channel >= ChannelCount).\r
+                                Or Device is invalid.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_IDE_CONTROLLER_SUBMIT_DATA) (\r
+  IN EFI_IDE_CONTROLLER_INIT_PROTOCOL *This,\r
+  IN  UINT8                           Channel,\r
+  IN  UINT8                           Device,\r
+  IN  EFI_IDENTIFY_DATA               *IdentifyData\r
+);\r
+\r
+/**\r
+  Disqualifies specific modes for an IDE device.\r
+\r
+  @param  This                  Pointer to the EFI_IDE_CONTROLLER_INIT_PROTOCOL instance.\r
+  @param  Channel               Zero-based channel number.\r
+  @param  Device                Zero-based device number on the Channel.\r
+  @param  BadModes              The modes that the device does not support and that\r
+                                should be disqualified.\r
+\r
+  @retval EFI_SUCCESS           The modes were accepted without any errors.\r
+  @retval EFI_INVALID_PARAMETER Channel is invalid (Channel >= ChannelCount).\r
+                                Or Device is invalid.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_IDE_CONTROLLER_DISQUALIFY_MODE) (\r
+  IN EFI_IDE_CONTROLLER_INIT_PROTOCOL *This,\r
+  IN  UINT8                           Channel,\r
+  IN  UINT8                           Device,\r
+  IN  EFI_ATA_COLLECTIVE_MODE         *BadModes\r
+);\r
+\r
+/**\r
+  Returns the information about the optimum modes for the specified IDE device.\r
+\r
+  @param  This                  Pointer to the EFI_IDE_CONTROLLER_INIT_PROTOCOL instance.\r
+  @param  Channel               Zero-based channel number.\r
+  @param  Device                Zero-based device number on the Channel.\r
+  @param  SupportedModes        The optimum modes for the device.\r
+\r
+  @retval EFI_SUCCESS           SupportedModes was returned.\r
+  @retval EFI_INVALID_PARAMETER Channel is invalid (Channel >= ChannelCount).\r
+                                Or Device is invalid. Or SupportedModes is NULL.\r
+  @retval EFI_NOT_READY         Modes cannot be calculated due to a lack of data.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_IDE_CONTROLLER_CALCULATE_MODE) (\r
+  IN EFI_IDE_CONTROLLER_INIT_PROTOCOL *This,\r
+  IN  UINT8                           Channel,\r
+  IN  UINT8                           Device,\r
+  OUT EFI_ATA_COLLECTIVE_MODE         **SupportedModes\r
+);\r
+\r
+/**\r
+  Commands the IDE controller driver to program the IDE controller hardware\r
+  so that the specified device can operate at the specified mode.\r
+\r
+  @param  This                  Pointer to the EFI_IDE_CONTROLLER_INIT_PROTOCOL instance.\r
+  @param  Channel               Zero-based channel number.\r
+  @param  Device                Zero-based device number on the Channel.\r
+  @param  Modes                 The modes to set.\r
+\r
+  @retval EFI_SUCCESS           The command was accepted without any errors.\r
+  @retval EFI_INVALID_PARAMETER Channel is invalid (Channel >= ChannelCount).\r
+                                Or Device is invalid.\r
+  @retval EFI_NOT_READY         Modes cannot be set at this time due to lack of data.\r
+  @retval EFI_DEVICE_ERROR      Modes cannot be set due to hardware failure.\r
+                                The IDE bus driver should not use this device.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_IDE_CONTROLLER_SET_TIMING) (\r
+  IN EFI_IDE_CONTROLLER_INIT_PROTOCOL *This,\r
+  IN  UINT8                           Channel,\r
+  IN  UINT8                           Device,\r
+  IN  EFI_ATA_COLLECTIVE_MODE         *Modes\r
+);\r
+\r
+//\r
+////////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Interface structure\r
+// EFI_IDE_CONTROLLER_INIT_PROTOCOL protocol provides the chipset specific information to the IDE bus driver.\r
+// An IDE Bus driver wants to manage an IDE bus and possible IDE devices will have to retrieve the\r
+// EFI_IDE_CONTROLLER_INIT_PROTOCOL instances.\r
+//\r
+/**\r
+  @par Protocol Description:\r
+  Provides the basic interfaces to abstract an IDE controller.\r
+\r
+  @param GetChannelInfo\r
+  Returns the information about a specific channel.\r
+\r
+  @param NotifyPhase\r
+  The notification that the IDE bus driver is about to enter the\r
+  specified phase during the enumeration process.\r
+\r
+  @param SubmitData\r
+  Submits the Drive Identify data that was returned by the device.\r
+\r
+  @param DisqualifyMode\r
+  Submits information about modes that should be disqualified.\r
+\r
+  @param CalculateMode\r
+  Calculates and returns the optimum mode for a particular IDE device.\r
+\r
+  @param SetTiming\r
+  Programs the IDE controller hardware to the default timing or per the modes\r
+  that were returned by the last call to CalculateMode().\r
+\r
+  @param EnumAll\r
+  Set to TRUE if the enumeration group includes all the channels that are\r
+  produced by this controller. FALSE if an enumeration group consists of\r
+  only one channel.\r
+\r
+  @param ChannelCount\r
+  The number of channels that are produced by this controller.\r
+\r
+**/\r
+struct _EFI_IDE_CONTROLLER_INIT_PROTOCOL {\r
+  EFI_IDE_CONTROLLER_GET_CHANNEL_INFO    GetChannelInfo;\r
+  EFI_IDE_CONTROLLER_NOTIFY_PHASE        NotifyPhase;\r
+  EFI_IDE_CONTROLLER_SUBMIT_DATA         SubmitData;\r
+  EFI_IDE_CONTROLLER_DISQUALIFY_MODE     DisqualifyMode;\r
+  EFI_IDE_CONTROLLER_CALCULATE_MODE      CalculateMode;\r
+  EFI_IDE_CONTROLLER_SET_TIMING          SetTiming;\r
+  BOOLEAN                                EnumAll;\r
+  UINT8                                  ChannelCount;\r
+};\r
+\r
+extern EFI_GUID gEfiIdeControllerInitProtocolGuid;\r
+\r
+#endif\r
diff --git a/IntelFrameworkPkg/Include/Protocol/IncompatiblePciDeviceSupport.h b/IntelFrameworkPkg/Include/Protocol/IncompatiblePciDeviceSupport.h
new file mode 100644 (file)
index 0000000..c684f15
--- /dev/null
@@ -0,0 +1,78 @@
+/** @file\r
+  This file declares EFI Incompatible PCI Device Support Protocol\r
+\r
+  Copyright (c) 2007, Intel Corporation\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+  Module Name:  IncompatiblePciDeviceSupport.h\r
+\r
+  @par Revision Reference:\r
+  This protocol is defined in Framework of EFI PCI Platform Support Specification.\r
+  Version0.9\r
+\r
+**/\r
+\r
+#ifndef _INCOMPATIBLE_PCI_DEVICE_SUPPORT_H_\r
+#define _INCOMPATIBLE_PCI_DEVICE_SUPPORT_H_\r
+\r
+#define EFI_INCOMPATIBLE_PCI_DEVICE_SUPPORT_PROTOCOL_GUID \\r
+        {0xeb23f55a, 0x7863, 0x4ac2, {0x8d, 0x3d, 0x95, 0x65, 0x35, 0xde, 0x03, 0x75} }\r
+\r
+typedef struct _EFI_INCOMPATIBLE_PCI_DEVICE_SUPPORT_PROTOCOL EFI_INCOMPATIBLE_PCI_DEVICE_SUPPORT_PROTOCOL;\r
+\r
+/**\r
+  Returns a list of ACPI resource descriptors that detail the special\r
+  resource configuration requirements for an incompatible PCI device.\r
+\r
+  @param  This                  Pointer to the EFI_INCOMPATIBLE_PCI_DEVICE_SUPPORT_PROTOCOL instance.\r
+  @param  VendorID              A unique ID to identify the manufacturer of the PCI device.\r
+  @param  DeviceID              A unique ID to identify the particular PCI device.\r
+  @param  RevisionID            A PCI device-specific revision identifier.\r
+  @param  SubsystemVendorId     Specifies the subsystem vendor ID.\r
+  @param  SubsystemDeviceId     Specifies the subsystem device ID.\r
+  @param  Configuration         A list of ACPI resource descriptors that detail\r
+                                the configuration requirement.\r
+\r
+  @retval EFI_SUCCESS           The function always returns EFI_SUCCESS.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_INCOMPATIBLE_PCI_DEVICE_SUPPORT_CHECK_DEVICE) (\r
+  IN EFI_INCOMPATIBLE_PCI_DEVICE_SUPPORT_PROTOCOL   *This,\r
+  IN  UINTN                                         VendorId,\r
+  IN  UINTN                                         DeviceId,\r
+  IN  UINTN                                         Revision,\r
+  IN  UINTN                                         SubVendorId,OPTIONAL\r
+  IN  UINTN                                         SubDeviceId,OPTIONAL\r
+  OUT VOID                                          **Configuration\r
+);\r
+\r
+\r
+//\r
+// Interface structure for the Incompatible PCI Device Support Protocol\r
+//\r
+/**\r
+  @par Protocol Description:\r
+  This protocol can find some incompatible PCI devices and report their\r
+  special resource requirements to the PCI bus driver.\r
+\r
+  @param CheckDevice\r
+  Returns a list of ACPI resource descriptors that detail any special\r
+  resource configuration requirements if the specified device is a recognized\r
+  incompatible PCI device.\r
+\r
+**/\r
+struct _EFI_INCOMPATIBLE_PCI_DEVICE_SUPPORT_PROTOCOL {\r
+  EFI_INCOMPATIBLE_PCI_DEVICE_SUPPORT_CHECK_DEVICE      CheckDevice;\r
+};\r
+\r
+extern EFI_GUID gEfiIncompatiblePciDeviceSupportProtocolGuid;\r
+\r
+#endif\r
diff --git a/IntelFrameworkPkg/Include/Protocol/Legacy8259.h b/IntelFrameworkPkg/Include/Protocol/Legacy8259.h
new file mode 100644 (file)
index 0000000..e9f9173
--- /dev/null
@@ -0,0 +1,298 @@
+/** @file\r
+  This protocol abstracts the 8259 interrupt controller. This includes\r
+  PCI IRQ routing need to program the PCI Interrupt Line register.\r
+\r
+  Copyright (c) 2007, Intel Corporation\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+  Module Name:  Legacy8259.h\r
+\r
+  @par Revision Reference:\r
+  This protocol is defined in Framework for EFI Compatibility Support Module spec\r
+  Version 0.96\r
+\r
+**/\r
+\r
+#ifndef _EFI_LEGACY_8259_H_\r
+#define _EFI_LEGACY_8259_H_\r
+\r
+#define EFI_LEGACY_8259_PROTOCOL_GUID \\r
+  { \\r
+    0x38321dba, 0x4fe0, 0x4e17, {0x8a, 0xec, 0x41, 0x30, 0x55, 0xea, 0xed, 0xc1 } \\r
+  }\r
+\r
+typedef struct _EFI_LEGACY_8259_PROTOCOL EFI_LEGACY_8259_PROTOCOL;\r
+\r
+typedef enum {\r
+  Efi8259Irq0,\r
+  Efi8259Irq1,\r
+  Efi8259Irq2,\r
+  Efi8259Irq3,\r
+  Efi8259Irq4,\r
+  Efi8259Irq5,\r
+  Efi8259Irq6,\r
+  Efi8259Irq7,\r
+  Efi8259Irq8,\r
+  Efi8259Irq9,\r
+  Efi8259Irq10,\r
+  Efi8259Irq11,\r
+  Efi8259Irq12,\r
+  Efi8259Irq13,\r
+  Efi8259Irq14,\r
+  Efi8259Irq15,\r
+  Efi8259IrqMax\r
+} EFI_8259_IRQ;\r
+\r
+typedef enum {\r
+  Efi8259LegacyMode,\r
+  Efi8259ProtectedMode,\r
+  Efi8259MaxMode\r
+} EFI_8259_MODE;\r
+\r
+/**\r
+  Get the 8259 interrupt masks for Irq0 - Irq15. A different mask exists for\r
+  the legacy mode mask and the protected mode mask. The base address for the 8259\r
+  is different for legacy and protected mode, so two masks are required.\r
+\r
+  @param  This                  Protocol instance pointer.\r
+  @param  MasterBase            The base vector for the Master PIC in the 8259 controller\r
+  @param  Slavebase             The base vector for the Master PIC in the 8259 controller\r
+\r
+  @retval EFI_SUCCESS           The new bases were programmed\r
+  @retval EFI_DEVICE_ERROR      A device erro occured programming the vector bases\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_LEGACY_8259_SET_VECTOR_BASE) (\r
+  IN EFI_LEGACY_8259_PROTOCOL           *This,\r
+  IN  UINT8                             MasterBase,\r
+  IN  UINT8                             SlaveBase\r
+  );\r
+\r
+/**\r
+  Get the 8259 interrupt masks for Irq0 - Irq15. A different mask exists for\r
+  the legacy mode mask and the protected mode mask. The base address for the 8259\r
+  is different for legacy and protected mode, so two masks are required.\r
+\r
+  @param  This                  Protocol instance pointer.\r
+  @param  LegacyMask            Bit 0 is Irq0 - Bit 15 is Irq15\r
+  @param  LegacyEdgeLevel       Bit 0 is Irq0 - Bit 15 is Irq15\r
+  @param  ProtectedMask         Bit 0 is Irq0 - Bit 15 is Irq15\r
+  @param  ProtectedEdgeLevel    Bit 0 is Irq0 - Bit 15 is Irq15\r
+\r
+  @retval EFI_SUCCESS           8259 status returned\r
+  @retval EFI_DEVICE_ERROR      Error reading 8259\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_LEGACY_8259_GET_MASK) (\r
+  IN EFI_LEGACY_8259_PROTOCOL           *This,\r
+  OUT UINT16                            *LegacyMask, OPTIONAL\r
+  OUT UINT16                            *LegacyEdgeLevel, OPTIONAL\r
+  OUT UINT16                            *ProtectedMask, OPTIONAL\r
+  OUT UINT16                            *ProtectedEdgeLevel OPTIONAL\r
+  );\r
+\r
+/**\r
+  Set the 8259 interrupt masks for Irq0 - Irq15. A different mask exists for\r
+  the legacy mode mask and the protected mode mask. The base address for the 8259\r
+  is different for legacy and protected mode, so two masks are required.\r
+  Also set the edge/level masks.\r
+\r
+  @param  This                  Protocol instance pointer.\r
+  @param  LegacyMask            Bit 0 is Irq0 - Bit 15 is Irq15\r
+  @param  LegacyEdgeLevel       Bit 0 is Irq0 - Bit 15 is Irq15\r
+  @param  ProtectedMask         Bit 0 is Irq0 - Bit 15 is Irq15\r
+  @param  ProtectedEdgeLevel    Bit 0 is Irq0 - Bit 15 is Irq15\r
+\r
+  @retval EFI_SUCCESS           8259 status returned\r
+  @retval EFI_DEVICE_ERROR      Error reading 8259\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_LEGACY_8259_SET_MASK) (\r
+  IN EFI_LEGACY_8259_PROTOCOL           *This,\r
+  IN  UINT16                            *LegacyMask, OPTIONAL\r
+  IN  UINT16                            *LegacyEdgeLevel, OPTIONAL\r
+  IN  UINT16                            *ProtectedMask, OPTIONAL\r
+  IN  UINT16                            *ProtectedEdgeLevel OPTIONAL\r
+  );\r
+\r
+/**\r
+  Set the 8259 mode of operation. The base address for the 8259 is different for\r
+  legacy and protected mode. The legacy mode requires the master 8259 to have a\r
+  master base of 0x08 and the slave base of 0x70. The protected mode base locations\r
+  are not defined. Interrupts must be masked by the caller before this function\r
+  is called. The interrupt mask from the current mode is saved. The interrupt\r
+  mask for the new mode is Mask, or if Mask does not exist the previously saved\r
+  mask is used.\r
+\r
+  @param  This                  Protocol instance pointer.\r
+  @param  Mode                  Mode of operation. i.e. real mode or protected mode\r
+  @param  Mask                  Optional interupt mask for the new mode.\r
+  @param  EdgeLevel             Optional trigger mask for the new mode.\r
+\r
+  @retval EFI_SUCCESS           8259 programmed\r
+  @retval EFI_DEVICE_ERROR      Error writting to 8259\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_LEGACY_8259_SET_MODE) (\r
+  IN EFI_LEGACY_8259_PROTOCOL         *This,\r
+  IN  EFI_8259_MODE                   Mode,\r
+  IN  UINT16                          *Mask, OPTIONAL\r
+  IN  UINT16                          *EdgeLevel OPTIONAL\r
+  );\r
+\r
+/**\r
+  Convert from IRQ to processor interrupt vector number.\r
+\r
+  @param  This                  Protocol instance pointer.\r
+  @param  Irq                   8259 IRQ0 - IRQ15\r
+  @param  Vector                Processor vector number that matches Irq\r
+\r
+  @retval EFI_SUCCESS           The Vector matching Irq is returned\r
+  @retval EFI_INVALID_PARAMETER Irq not valid\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_LEGACY_8259_GET_VECTOR) (\r
+  IN EFI_LEGACY_8259_PROTOCOL           *This,\r
+  IN  EFI_8259_IRQ                      Irq,\r
+  OUT UINT8                             *Vector\r
+  );\r
+\r
+/**\r
+  Enable Irq by unmasking interrupt in 8259\r
+\r
+  @param  This                  Protocol instance pointer.\r
+  @param  Irq                   8259 IRQ0 - IRQ15\r
+  @param  LevelTriggered        TRUE if level triggered. FALSE if edge triggered.\r
+\r
+  @retval EFI_SUCCESS           Irq enabled on 8259\r
+  @retval EFI_INVALID_PARAMETER Irq not valid\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_LEGACY_8259_ENABLE_IRQ) (\r
+  IN EFI_LEGACY_8259_PROTOCOL           *This,\r
+  IN  EFI_8259_IRQ                      Irq,\r
+  IN  BOOLEAN                           LevelTriggered\r
+  );\r
+\r
+/**\r
+  Disable Irq by masking interrupt in 8259\r
+\r
+  @param  This                  Protocol instance pointer.\r
+  @param  Irq                   8259 IRQ0 - IRQ15\r
+\r
+  @retval EFI_SUCCESS           Irq disabled on 8259\r
+  @retval EFI_INVALID_PARAMETER Irq not valid\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_LEGACY_8259_DISABLE_IRQ) (\r
+  IN EFI_LEGACY_8259_PROTOCOL           *This,\r
+  IN  EFI_8259_IRQ                      Irq\r
+  );\r
+\r
+/**\r
+  PciHandle represents a PCI config space of a PCI function. Vector\r
+  represents Interrupt Pin (from PCI config space) and it is the data\r
+  that is programmed into the Interrupt Line (from the PCI config space)\r
+  register.\r
+\r
+  @param  This                  Protocol instance pointer.\r
+  @param  PciHandle             PCI function to return vector for\r
+  @param  Vector                Vector for fucntion that matches\r
+\r
+  @retval EFI_SUCCESS           A valid Vector is returned\r
+  @retval EFI_INVALID_PARAMETER PciHandle not valid\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_LEGACY_8259_GET_INTERRUPT_LINE) (\r
+  IN EFI_LEGACY_8259_PROTOCOL           *This,\r
+  IN  EFI_HANDLE                        PciHandle,\r
+  OUT UINT8                             *Vector\r
+  );\r
+\r
+/**\r
+  Send an EOI to 8259\r
+\r
+  @param  This                  Protocol instance pointer.\r
+  @param  Irq                   8259 IRQ0 - IRQ15\r
+\r
+  @retval EFI_SUCCESS           EOI successfully sent to 8259\r
+  @retval EFI_INVALID_PARAMETER Irq not valid\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_LEGACY_8259_END_OF_INTERRUPT) (\r
+  IN EFI_LEGACY_8259_PROTOCOL           *This,\r
+  IN  EFI_8259_IRQ                      Irq\r
+  );\r
+\r
+/**\r
+  @par Protocol Description:\r
+  Abstracts the 8259 and APIC hardware control between EFI usage and\r
+  Compatibility16 usage.\r
+\r
+  @param SetVectorBase\r
+  Sets the vector bases for master and slave PICs.\r
+\r
+  @param GetMask\r
+  Gets IRQ and edge/level masks for 16-bit real mode and 32-bit protected mode.\r
+\r
+  @param SetMask\r
+  Sets the IRQ and edge\level masks for 16-bit real mode and 32-bit protected mode.\r
+\r
+  @param SetMode\r
+  Sets PIC mode to 16-bit real mode or 32-bit protected mode.\r
+\r
+  @param GetVector\r
+  Gets the base vector assigned to an IRQ.\r
+\r
+  @param EnableIrq\r
+  Enables an IRQ.\r
+\r
+  @param DisableIrq\r
+  Disables an IRQ.\r
+\r
+  @param GetInterruptLine\r
+  Gets an IRQ that is assigned to a PCI device.\r
+\r
+  @param EndOfInterrupt\r
+  Issues the end of interrupt command.\r
+\r
+**/\r
+struct _EFI_LEGACY_8259_PROTOCOL {\r
+  EFI_LEGACY_8259_SET_VECTOR_BASE     SetVectorBase;\r
+  EFI_LEGACY_8259_GET_MASK            GetMask;\r
+  EFI_LEGACY_8259_SET_MASK            SetMask;\r
+  EFI_LEGACY_8259_SET_MODE            SetMode;\r
+  EFI_LEGACY_8259_GET_VECTOR          GetVector;\r
+  EFI_LEGACY_8259_ENABLE_IRQ          EnableIrq;\r
+  EFI_LEGACY_8259_DISABLE_IRQ         DisableIrq;\r
+  EFI_LEGACY_8259_GET_INTERRUPT_LINE  GetInterruptLine;\r
+  EFI_LEGACY_8259_END_OF_INTERRUPT    EndOfInterrupt;\r
+};\r
+\r
+extern EFI_GUID gEfiLegacy8259ProtocolGuid;\r
+\r
+#endif\r
diff --git a/IntelFrameworkPkg/Include/Protocol/LegacyBios.h b/IntelFrameworkPkg/Include/Protocol/LegacyBios.h
new file mode 100644 (file)
index 0000000..1d11d95
--- /dev/null
@@ -0,0 +1,524 @@
+/** @file\r
+  The EFI Legacy BIOS Protocol is used to abstract legacy Option ROM usage\r
+  under EFI and Legacy OS boot.\r
+\r
+  Note: The names for EFI_IA32_REGISTER_SET elements were picked to follow\r
+  well known naming conventions.\r
+\r
+  Thunk - A thunk is a transition from one processor mode to another. A Thunk\r
+  is a transition from native EFI mode to 16-bit mode. A reverse thunk\r
+  would be a transition from 16-bit mode to native EFI mode.\r
+\r
+  You most likely should not use this protocol! Find the EFI way to solve the\r
+  problem to make your code portable\r
+\r
+  Copyright (c) 2007, Intel Corporation\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+  Module Name:  LegacyBios.h\r
+\r
+  @par Revision Reference:\r
+  This protocol is defined in Framework for EFI Compatibility Support Module spec\r
+  Version 0.96\r
+\r
+**/\r
+\r
+#ifndef _EFI_LEGACY_BIOS_H_\r
+#define _EFI_LEGACY_BIOS_H_\r
+\r
+#define EFI_LEGACY_BIOS_PROTOCOL_GUID \\r
+  { \\r
+    0xdb9a1e3d, 0x45cb, 0x4abb, {0x85, 0x3b, 0xe5, 0x38, 0x7f, 0xdb, 0x2e, 0x2d } \\r
+  }\r
+\r
+typedef struct _EFI_LEGACY_BIOS_PROTOCOL EFI_LEGACY_BIOS_PROTOCOL;\r
+\r
+//\r
+/// @bug: These macros appear in no specifications and are kept for backward\r
+//        compatibility only.\r
+// Convert from 32-bit address (_Adr) to Segment:Offset 16-bit form\r
+//\r
+#define EFI_SEGMENT(_Adr)     (UINT16) ((UINT16) (((UINTN) (_Adr)) >> 4) & 0xf000)\r
+#define EFI_OFFSET(_Adr)      (UINT16) (((UINT16) ((UINTN) (_Adr))) & 0xffff)\r
+#define BYTE_GRANULARITY      0x01\r
+#define WORD_GRANULARITY      0x02\r
+#define DWORD_GRANULARITY     0x04\r
+#define QWORD_GRANULARITY     0x08\r
+#define PARAGRAPH_GRANULARITY 0x10\r
+\r
+#define CARRY_FLAG            0x01\r
+\r
+//*********************************************************\r
+// EFI_EFLAGS_REG\r
+//*********************************************************\r
+typedef struct {\r
+  UINT32 CF:1;\r
+  UINT32 Reserved1:1;\r
+  UINT32 PF:1;\r
+  UINT32 Reserved2:1;\r
+  UINT32 AF:1;\r
+  UINT32 Reserved3:1;\r
+  UINT32 ZF:1;\r
+  UINT32 SF:1;\r
+  UINT32 TF:1;\r
+  UINT32 IF:1;\r
+  UINT32 DF:1;\r
+  UINT32 OF:1;\r
+  UINT32 IOPL:2;\r
+  UINT32 NT:1;\r
+  UINT32 Reserved4:2;\r
+  UINT32 VM:1;\r
+  UINT32 Reserved5:14;\r
+} EFI_EFLAGS_REG;\r
+\r
+//*********************************************************\r
+// EFI_DWORD_REGS\r
+//*********************************************************\r
+\r
+typedef struct {\r
+    UINT32           EAX;\r
+    UINT32           EBX;\r
+    UINT32           ECX;\r
+    UINT32           EDX;\r
+    UINT32           ESI;\r
+    UINT32           EDI;\r
+    EFI_EFLAGS_REG   EFlags;\r
+    UINT16           ES;\r
+    UINT16           CS;\r
+    UINT16           SS;\r
+    UINT16           DS;\r
+    UINT16           FS;\r
+    UINT16           GS;\r
+    UINT32           EBP;\r
+    UINT32           ESP;\r
+} EFI_DWORD_REGS;\r
+\r
+//*******************************************\r
+// EFI_FLAGS_REG\r
+//*******************************************\r
+typedef struct {\r
+  UINT16     CF:1;\r
+  UINT16     Reserved1:1;\r
+  UINT16     PF:1;\r
+  UINT16     Reserved2:1;\r
+  UINT16     AF:1;\r
+  UINT16     Reserved3:1;\r
+  UINT16     ZF:1;\r
+  UINT16     SF:1;\r
+  UINT16     TF:1;\r
+  UINT16     IF:1;\r
+  UINT16     DF:1;\r
+  UINT16     OF:1;\r
+  UINT16     IOPL:2;\r
+  UINT16     NT:1;\r
+  UINT16     Reserved4:1;\r
+} EFI_FLAGS_REG;\r
+\r
+\r
+//*********************************************************\r
+// EFI_WORD_REGS\r
+//*********************************************************\r
+\r
+typedef struct {\r
+    UINT16           AX;\r
+    UINT16           ReservedAX;\r
+    UINT16           BX;\r
+    UINT16           ReservedBX;\r
+    UINT16           CX;\r
+    UINT16           ReservedCX;\r
+    UINT16           DX;\r
+    UINT16           ReservedDX;\r
+    UINT16           SI;\r
+    UINT16           ReservedSI;\r
+    UINT16           DI;\r
+    UINT16           ReservedDI;\r
+    EFI_FLAGS_REG    Flags;\r
+    UINT16           ReservedFlags;\r
+    UINT16           ES;\r
+    UINT16           CS;\r
+    UINT16           SS;\r
+    UINT16           DS;\r
+    UINT16           FS;\r
+    UINT16           GS;\r
+    UINT16           BP;\r
+    UINT16           ReservedBP;\r
+    UINT16           SP;\r
+    UINT16           ReservedSP;\r
+} EFI_WORD_REGS;\r
+\r
+//*********************************************************\r
+// EFI_BYTE_REGS\r
+//*********************************************************\r
+\r
+typedef struct {\r
+    UINT8   AL, AH;\r
+    UINT16  ReservedAX;\r
+    UINT8   BL, BH;\r
+    UINT16  ReservedBX;\r
+    UINT8   CL, CH;\r
+    UINT16  ReservedCX;\r
+    UINT8   DL, DH;\r
+    UINT16  ReservedDX;\r
+} EFI_BYTE_REGS;\r
+\r
+typedef union {\r
+  EFI_DWORD_REGS  E;\r
+  EFI_WORD_REGS   X;\r
+  EFI_BYTE_REGS   H;\r
+} EFI_IA32_REGISTER_SET;\r
+\r
+/**\r
+  Thunk to 16-bit real mode and execute a software interrupt with a vector\r
+  of BiosInt. Regs will contain the 16-bit register context on entry and\r
+  exit.\r
+\r
+  @param  This                  Protocol instance pointer.\r
+  @param  BiosInt               Processor interrupt vector to invoke\r
+  @param  Reg                   Register contexted passed into (and returned) from thunk to\r
+                                16-bit mode\r
+\r
+  @retval FALSE                 Thunk completed, and there were no BIOS errors in the target code.\r
+                                See Regs for status.\r
+  @retval TRUE                  There was a BIOS erro in the target code.\r
+\r
+**/\r
+typedef\r
+BOOLEAN\r
+(EFIAPI *EFI_LEGACY_BIOS_INT86) (\r
+  IN EFI_LEGACY_BIOS_PROTOCOL         *This,\r
+  IN  UINT8                           BiosInt,\r
+  IN OUT  EFI_IA32_REGISTER_SET       *Regs\r
+  );\r
+\r
+/**\r
+  Thunk to 16-bit real mode and call Segment:Offset. Regs will contain the\r
+  16-bit register context on entry and exit. Arguments can be passed on\r
+  the Stack argument\r
+\r
+  @param  This                  Protocol instance pointer.\r
+  @param  Segment               Segemnt of 16-bit mode call\r
+  @param  Offset                Offset of 16-bit mdoe call\r
+  @param  Reg                   Register contexted passed into (and returned) from thunk to\r
+                                16-bit mode\r
+  @param  Stack                 Caller allocated stack used to pass arguments\r
+  @param  StackSize             Size of Stack in bytes\r
+\r
+  @retval FALSE                 Thunk completed, and there were no BIOS errors in the target code.\r
+                                See Regs for status.\r
+  @retval TRUE                  There was a BIOS erro in the target code.\r
+\r
+**/\r
+typedef\r
+BOOLEAN\r
+(EFIAPI *EFI_LEGACY_BIOS_FARCALL86) (\r
+  IN EFI_LEGACY_BIOS_PROTOCOL         *This,\r
+  IN  UINT16                          Segment,\r
+  IN  UINT16                          Offset,\r
+  IN  EFI_IA32_REGISTER_SET           *Regs,\r
+  IN  VOID                            *Stack,\r
+  IN  UINTN                           StackSize\r
+  );\r
+\r
+/**\r
+  Test to see if a legacy PCI ROM exists for this device. Optionally return\r
+  the Legacy ROM instance for this PCI device.\r
+\r
+  @param  This                  Protocol instance pointer.\r
+  @param  PciHandle             The PCI PC-AT OPROM from this devices ROM BAR will be loaded\r
+  @param  RomImage              Return the legacy PCI ROM for this device\r
+  @param  RomSize               Size of ROM Image\r
+  @param  Flags                 Indicates if ROM found and if PC-AT.\r
+\r
+  @retval EFI_SUCCESS           Legacy Option ROM availible for this device\r
+  @retval EFI_UNSUPPORTED       Legacy Option ROM not supported.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_LEGACY_BIOS_CHECK_ROM) (\r
+  IN EFI_LEGACY_BIOS_PROTOCOL         *This,\r
+  IN  EFI_HANDLE                      PciHandle,\r
+  OUT VOID                            **RomImage, OPTIONAL\r
+  OUT UINTN                           *RomSize, OPTIONAL\r
+  OUT UINTN                           *Flags\r
+  );\r
+\r
+/**\r
+  Load a legacy PC-AT OPROM on the PciHandle device. Return information\r
+  about how many disks were added by the OPROM and the shadow address and\r
+  size. DiskStart & DiskEnd are INT 13h drive letters. Thus 0x80 is C:\r
+\r
+  @param  This                  Protocol instance pointer.\r
+  @param  PciHandle             The PCI PC-AT OPROM from this devices ROM BAR will be loaded.\r
+                                This value is NULL if RomImage is non-NULL. This is the normal\r
+                                case.\r
+  @param  RomImage              A PCI PC-AT ROM image. This argument is non-NULL if there is\r
+                                no hardware associated with the ROM and thus no PciHandle,\r
+                                otherwise is must be NULL.\r
+                                Example is PXE base code.\r
+  @param  Flags                 Return Status if ROM was found and if was Legacy OPROM.\r
+  @param  DiskStart             Disk number of first device hooked by the ROM. If DiskStart\r
+                                is the same as DiskEnd no disked were hooked.\r
+  @param  DiskEnd               Disk number of the last device hooked by the ROM.\r
+  @param  RomShadowAddress      Shadow address of PC-AT ROM\r
+  @param  RomShadowSize         Size of RomShadowAddress in bytes\r
+\r
+  @retval EFI_SUCCESS           Thunk completed, see Regs for status.\r
+  @retval EFI_INVALID_PARAMETER PciHandle not found\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_LEGACY_BIOS_INSTALL_ROM) (\r
+  IN EFI_LEGACY_BIOS_PROTOCOL         *This,\r
+  IN  EFI_HANDLE                      PciHandle,\r
+  IN  VOID                            **RomImage,\r
+  OUT UINTN                           *Flags,\r
+  OUT UINT8                           *DiskStart, OPTIONAL\r
+  OUT UINT8                           *DiskEnd, OPTIONAL\r
+  OUT VOID                            **RomShadowAddress, OPTIONAL\r
+  OUT UINT32                          *ShadowedRomSize OPTIONAL\r
+  );\r
+\r
+/**\r
+  Attempt to legacy boot the BootOption. If the EFI contexted has been\r
+  compromised this function will not return.\r
+\r
+  @param  This                  Protocol instance pointer.\r
+  @param  BootOption            EFI Device Path from BootXXXX variable.\r
+  @param  LoadOptionSize        Size of LoadOption in size.\r
+  @param  LoadOption            LoadOption from BootXXXX variable\r
+\r
+  @retval EFI_SUCCESS           Removable media not present\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_LEGACY_BIOS_BOOT) (\r
+  IN EFI_LEGACY_BIOS_PROTOCOL         *This,\r
+  IN  BBS_BBS_DEVICE_PATH             *BootOption,\r
+  IN  UINT32                          LoadOptionsSize,\r
+  IN  VOID                            *LoadOptions\r
+  );\r
+\r
+/**\r
+  Update BDA with current Scroll, Num & Cap lock LEDS\r
+\r
+  @param  This                  Protocol instance pointer.\r
+  @param  Leds                  Status of current Scroll, Num & Cap lock LEDS\r
+                                Bit 0 is Scroll Lock 0 = Not locked\r
+                                Bit 1 is Num Lock\r
+                                Bit 2 is Caps Lock\r
+\r
+  @retval EFI_SUCCESS           Removable media not present\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_LEGACY_BIOS_UPDATE_KEYBOARD_LED_STATUS) (\r
+  IN EFI_LEGACY_BIOS_PROTOCOL         *This,\r
+  IN  UINT8                           Leds\r
+  );\r
+\r
+/**\r
+  Retrieve legacy BBS info and assign boot priority.\r
+\r
+  @param  This                  Protocol instance pointer.\r
+  @param  HddCount              Number of HDD_INFO structures\r
+  @param  HddInfo               Onboard IDE controller information\r
+  @param  BbsCount              Number of BBS_TABLE structures\r
+  @param  BbsTable              List BBS entries\r
+\r
+  @retval EFI_SUCCESS           Tables returned\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_LEGACY_BIOS_GET_BBS_INFO) (\r
+  IN EFI_LEGACY_BIOS_PROTOCOL         *This,\r
+  OUT UINT16                          *HddCount,\r
+  OUT HDD_INFO                        **HddInfo,\r
+  OUT UINT16                          *BbsCount,\r
+  IN OUT BBS_TABLE                    **BbsTable\r
+  );\r
+\r
+/**\r
+  Assign drive number to legacy HDD drives prior to booting an EFI\r
+  aware OS so the OS can access drives without an EFI driver.\r
+\r
+  @param  This                  Protocol instance pointer.\r
+  @param  BbsCount              Number of BBS_TABLE structures\r
+  @param  BbsTable              List BBS entries\r
+\r
+  @retval EFI_SUCCESS           Drive numbers assigned\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_LEGACY_BIOS_PREPARE_TO_BOOT_EFI) (\r
+  IN EFI_LEGACY_BIOS_PROTOCOL         *This,\r
+  OUT UINT16                          *BbsCount,\r
+  OUT BBS_TABLE                       **BbsTable\r
+  );\r
+\r
+/**\r
+  To boot from an unconventional device like parties and/or execute\r
+  HDD diagnostics.\r
+\r
+  @param  This                  Protocol instance pointer.\r
+  @param  Attributes            How to interpret the other input parameters\r
+  @param  BbsEntry              The 0-based index into the BbsTable for the parent\r
+                                device.\r
+  @param  BeerData              Pointer to the 128 bytes of ram BEER data.\r
+  @param  ServiceAreaData       Pointer to the 64 bytes of raw Service Area data. The\r
+                                caller must provide a pointer to the specific Service\r
+                                Area and not the start all Service Areas.\r
+\r
+  EFI_INVALID_PARAMETER if error. Does NOT return if no error.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_LEGACY_BIOS_BOOT_UNCONVENTIONAL_DEVICE) (\r
+  IN EFI_LEGACY_BIOS_PROTOCOL         *This,\r
+  IN UDC_ATTRIBUTES                   Attributes,\r
+  IN UINTN                            BbsEntry,\r
+  IN VOID                             *BeerData,\r
+  IN VOID                             *ServiceAreaData\r
+  );\r
+\r
+/**\r
+  Shadow all legacy16 OPROMs that haven't been shadowed.\r
+  Warning: Use this with caution. This routine disconnects all EFI\r
+  drivers. If used externally then caller must re-connect EFI\r
+  drivers.\r
+\r
+  @retval EFI_SUCCESS           OPROMs shadowed\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_LEGACY_BIOS_SHADOW_ALL_LEGACY_OPROMS) (\r
+  IN EFI_LEGACY_BIOS_PROTOCOL *This\r
+  );\r
+\r
+/**\r
+  Get a region from the LegacyBios for S3 usage.\r
+\r
+  @param  This                  Protocol instance pointer.\r
+  @param  LegacyMemorySize      Size of required region\r
+  @param  Region                Region to use.\r
+                                00 = Either 0xE0000 or 0xF0000 block\r
+                                Bit0 = 1 0xF0000 block\r
+                                Bit1 = 1 0xE0000 block\r
+  @param  Alignment             Address alignment. Bit mapped. First non-zero\r
+                                bit from right is alignment.\r
+  @param  LegacyMemoryAddress   Region Assigned\r
+\r
+  @retval EFI_SUCCESS           Region assigned\r
+  @retval Other                 Region not assigned\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_LEGACY_BIOS_GET_LEGACY_REGION) (\r
+  IN EFI_LEGACY_BIOS_PROTOCOL *This,\r
+  IN    UINTN                 LegacyMemorySize,\r
+  IN    UINTN                 Region,\r
+  IN    UINTN                 Alignment,\r
+  OUT   VOID                  **LegacyMemoryAddress\r
+  );\r
+\r
+/**\r
+  Get a region from the LegacyBios for Tiano usage. Can only be invoked once.\r
+\r
+  @param  This                  Protocol instance pointer.\r
+  @param  LegacyMemorySize      Size of data to copy\r
+  @param  LegacyMemoryAddress   Legacy Region destination address\r
+                                Note: must be in region assigned by\r
+                                LegacyBiosGetLegacyRegion\r
+  @param  LegacyMemorySourceAddress\r
+                                Source of data\r
+\r
+  @retval EFI_SUCCESS           Region assigned\r
+  @retval EFI_ACCESS_DENIED     Destination outside assigned region\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_LEGACY_BIOS_COPY_LEGACY_REGION) (\r
+  IN EFI_LEGACY_BIOS_PROTOCOL *This,\r
+  IN    UINTN                 LegacyMemorySize,\r
+  IN    VOID                  *LegacyMemoryAddress,\r
+  IN    VOID                  *LegacyMemorySourceAddress\r
+  );\r
+\r
+/**\r
+  @par Protocol Description:\r
+  Abstracts the traditional BIOS from the rest of EFI. The LegacyBoot()\r
+  member function allows the BDS to support booting a traditional OS.\r
+  EFI thunks drivers that make EFI bindings for BIOS INT services use\r
+  all the other member functions.\r
+\r
+  @param Int86\r
+  Performs traditional software INT. See the Int86() function description.\r
+\r
+  @param FarCall86\r
+  Performs a far call into Compatibility16 or traditional OpROM code.\r
+\r
+  @param CheckPciRom\r
+  Checks if a traditional OpROM exists for this device.\r
+\r
+  @param InstallPciRom\r
+  Loads a traditional OpROM in traditional OpROM address space.\r
+\r
+  @param LegacyBoot\r
+  Boots a traditional OS.\r
+\r
+  @param UpdateKeyboardLedStatus\r
+  Updates BDA to reflect the current EFI keyboard LED status.\r
+\r
+  @param GetBbsInfo\r
+  Allows an external agent, such as BIOS Setup, to get the BBS data.\r
+\r
+  @param ShadowAllLegacyOproms\r
+  Causes all legacy OpROMs to be shadowed.\r
+\r
+  @param PrepareToBootEfi\r
+  Performs all actions prior to boot. Used when booting an EFI-aware OS\r
+  rather than a legacy OS.\r
+\r
+  @param GetLegacyRegion\r
+  Allows EFI to reserve an area in the 0xE0000 or 0xF0000 block.\r
+\r
+  @param CopyLegacyRegion\r
+  Allows EFI to copy data to the area specified by GetLegacyRegion.\r
+\r
+  @param BootUnconventionalDevice\r
+  Allows the user to boot off an unconventional device such as a PARTIES partition.\r
+\r
+**/\r
+struct _EFI_LEGACY_BIOS_PROTOCOL {\r
+  EFI_LEGACY_BIOS_INT86                       Int86;\r
+  EFI_LEGACY_BIOS_FARCALL86                   FarCall86;\r
+  EFI_LEGACY_BIOS_CHECK_ROM                   CheckPciRom;\r
+  EFI_LEGACY_BIOS_INSTALL_ROM                 InstallPciRom;\r
+  EFI_LEGACY_BIOS_BOOT                        LegacyBoot;\r
+  EFI_LEGACY_BIOS_UPDATE_KEYBOARD_LED_STATUS  UpdateKeyboardLedStatus;\r
+  EFI_LEGACY_BIOS_GET_BBS_INFO                GetBbsInfo;\r
+  EFI_LEGACY_BIOS_SHADOW_ALL_LEGACY_OPROMS    ShadowAllLegacyOproms;\r
+  EFI_LEGACY_BIOS_PREPARE_TO_BOOT_EFI         PrepareToBootEfi;\r
+  EFI_LEGACY_BIOS_GET_LEGACY_REGION           GetLegacyRegion;\r
+  EFI_LEGACY_BIOS_COPY_LEGACY_REGION          CopyLegacyRegion;\r
+  EFI_LEGACY_BIOS_BOOT_UNCONVENTIONAL_DEVICE  BootUnconventionalDevice;\r
+};\r
+\r
+extern EFI_GUID gEfiLegacyBiosProtocolGuid;\r
+\r
+#endif\r
diff --git a/IntelFrameworkPkg/Include/Protocol/LegacyBiosPlatform.h b/IntelFrameworkPkg/Include/Protocol/LegacyBiosPlatform.h
new file mode 100644 (file)
index 0000000..4eaa3da
--- /dev/null
@@ -0,0 +1,281 @@
+/** @file\r
+  The EFI Legacy BIOS Patform Protocol is used to mate a Legacy16\r
+  implementation with this EFI code. The EFI driver that produces\r
+  the Legacy BIOS protocol is generic and consumes this protocol.\r
+  A driver that matches the Legacy16 produces this protocol\r
+\r
+  Copyright (c) 2007, Intel Corporation\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+  Module Name:  LegacyBiosPlatform.h\r
+\r
+  @par Revision Reference:\r
+  This protocol is defined in Framework for EFI Compatibility Support Module spec\r
+  Version 0.96\r
+\r
+**/\r
+\r
+#ifndef _EFI_LEGACY_BIOS_PLATFORM_H_\r
+#define _EFI_LEGACY_BIOS_PLATFORM_H_\r
+\r
+#define EFI_LEGACY_BIOS_PLATFORM_PROTOCOL_GUID \\r
+  { \\r
+    0x783658a3, 0x4172, 0x4421, {0xa2, 0x99, 0xe0, 0x9, 0x7, 0x9c, 0xc, 0xb4 } \\r
+  }\r
+\r
+typedef struct _EFI_LEGACY_BIOS_PLATFORM_PROTOCOL EFI_LEGACY_BIOS_PLATFORM_PROTOCOL;\r
+\r
+typedef enum {\r
+  EfiGetPlatformBinaryMpTable      = 0,\r
+  EfiGetPlatformBinaryOemIntData   = 1,\r
+  EfiGetPlatformBinaryOem16Data    = 2,\r
+  EfiGetPlatformBinaryOem32Data    = 3,\r
+  EfiGetPlatformBinaryTpmBinary    = 4,\r
+  EfiGetPlatformBinarySystemRom    = 5,\r
+  EfiGetPlatformPciExpressBase     = 6,\r
+  EfiGetPlatformPmmSize            = 7,\r
+  EfiGetPlatformEndOpromShadowAddr = 8,\r
+\r
+} EFI_GET_PLATFORM_INFO_MODE;\r
+\r
+typedef enum {\r
+  EfiGetPlatformVgaHandle       = 0,\r
+  EfiGetPlatformIdeHandle       = 1,\r
+  EfiGetPlatformIsaBusHandle    = 2,\r
+  EfiGetPlatformUsbHandle       = 3\r
+} EFI_GET_PLATFORM_HANDLE_MODE;\r
+\r
+typedef enum {\r
+  EfiPlatformHookPrepareToScanRom = 0,\r
+  EfiPlatformHookShadowServiceRoms= 1,\r
+  EfiPlatformHookAfterRomInit     = 2\r
+} EFI_GET_PLATFORM_HOOK_MODE;\r
+\r
+/**\r
+  Finds the binary data or other platform information.\r
+\r
+  @param  This                  Protocol instance pointer.\r
+  @param  Mode                  Specifies what data to return\r
+  @param  Table                 Pointer to MP table.\r
+  @param  TableSize             Size in bytes of table.\r
+  @param  Location              Legacy region requested\r
+                                0x00 = Any location\r
+                                Bit 0 = 0xF0000 region\r
+                                Bit 1 = 0xE0000 region\r
+                                Multiple bits can be set\r
+  @param  Alignment             Address alignment for allocation.\r
+                                Bit mapped. First non-zero bit from right\r
+                                is alignment.\r
+  @param  LegacySegment         Segment in LegacyBios where Table is stored\r
+  @param  LegacyOffset          Offset in LegacyBios where Table is stored\r
+\r
+  @retval EFI_SUCCESS           Data was returned successfully.\r
+  @retval EFI_UNSUPPORTED       Mode is not supported on the platform.\r
+  @retval EFI_NOT_FOUND         Binary image or table not found.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_LEGACY_BIOS_PLATFORM_GET_PLATFORM_INFO) (\r
+  IN EFI_LEGACY_BIOS_PLATFORM_PROTOCOL   *This,\r
+  IN EFI_GET_PLATFORM_INFO_MODE          Mode,\r
+  OUT VOID                               **Table,\r
+  OUT UINTN                              *TableSize,\r
+  OUT UINTN                              *Location,\r
+  OUT UINTN                              *Alignment,\r
+  IN  UINT16                             LegacySegment,\r
+  IN  UINT16                             LegacyOffset\r
+  );\r
+\r
+/**\r
+  Returns a buffer of handles for the requested sub-function.\r
+\r
+  @param  This                  Protocol instance pointer.\r
+  @param  Mode                  Specifies what handle to return.\r
+  @param  Type                  Type from Device Path for Handle to represent.\r
+  @param  HandleBuffer          Handles of the device/controller in priority order\r
+                                with HandleBuffer[0] highest priority.\r
+  @param  HandleCount           Number of handles in the buffer.\r
+  @param  AdditionalData        Mode specific.\r
+\r
+  @retval EFI_SUCCESS           Handle is valid\r
+  @retval EFI_UNSUPPORTED       Mode is not supported on the platform.\r
+  @retval EFI_NOT_FOUND         Handle is not known\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_LEGACY_BIOS_PLATFORM_GET_PLATFORM_HANDLE) (\r
+  IN EFI_LEGACY_BIOS_PLATFORM_PROTOCOL   *This,\r
+  IN EFI_GET_PLATFORM_HANDLE_MODE        Mode,\r
+  IN UINT16                              Type,\r
+  OUT EFI_HANDLE                         **HandleBuffer,\r
+  OUT UINTN                              *HandleCount,\r
+  IN  VOID                               **AdditionalData OPTIONAL\r
+  );\r
+\r
+/**\r
+  Load and initialize the Legacy BIOS SMM handler.\r
+\r
+  @param  This                   Protocol instance pointer.\r
+  @param  EfiToLegacy16BootTable Pointer to Legacy16 boot table.\r
+\r
+  @retval EFI_SUCCESS           SMM code loaded.\r
+  @retval EFI_DEVICE_ERROR      SMM code failed to load\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_LEGACY_BIOS_PLATFORM_SMM_INIT) (\r
+  IN EFI_LEGACY_BIOS_PLATFORM_PROTOCOL   *This,\r
+  IN  VOID                               *EfiToLegacy16BootTable\r
+  );\r
+\r
+/**\r
+  Allows platform to perform any required action after a LegacyBios operation.\r
+\r
+  @param  This                  Protocol instance pointer.\r
+  @param  Mode                  Specifies what handle to return.\r
+  @param  Type                  Mode specific.\r
+  @param  DeviceHandle          List of PCI devices in the system.\r
+  @param  ShadowAddress         First free OpROM area, after other OpROMs have been dispatched.\r
+  @param  Compatibility16Table  Pointer to Compatibility16Table.\r
+  @param  AdditionalData        Mode specific Pointer to additional data returned - mode specific.\r
+\r
+  @retval EFI_SUCCESS           RomImage is valid\r
+  @retval EFI_UNSUPPORTED       Mode is not supported on the platform.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_LEGACY_BIOS_PLATFORM_HOOKS) (\r
+  IN EFI_LEGACY_BIOS_PLATFORM_PROTOCOL   *This,\r
+  IN EFI_GET_PLATFORM_HOOK_MODE          Mode,\r
+  IN UINT16                              Type,\r
+  IN  EFI_HANDLE                         DeviceHandle,\r
+  IN  OUT UINTN                          *ShadowAddress,\r
+  IN  EFI_COMPATIBILITY16_TABLE          *Compatibility16Table,\r
+  IN  VOID                               **AdditionalData OPTIONAL\r
+  );\r
+\r
+/**\r
+  Returns information associated with PCI IRQ routing.\r
+\r
+  @param  This                    Protocol instance pointer.\r
+  @param  RoutingTable            Pointer to PCI IRQ Routing table.\r
+  @param  RoutingTableEntries     Number of entries in table.\r
+  @param  LocalPirqTable          $PIR table\r
+  @param  PirqTableSize           $PIR table size\r
+  @param  LocalIrqPriorityTable   List of interrupts in priority order to assign\r
+  @param  IrqPriorityTableEntries Number of entries in priority table\r
+\r
+  @retval EFI_SUCCESS           Data was successfully returned.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_LEGACY_BIOS_PLATFORM_GET_ROUTING_TABLE) (\r
+  IN EFI_LEGACY_BIOS_PLATFORM_PROTOCOL   *This,\r
+  OUT VOID                               **RoutingTable,\r
+  OUT UINTN                              *RoutingTableEntries,\r
+  OUT VOID                               **LocalPirqTable, OPTIONAL\r
+  OUT UINTN                              *PirqTableSize, OPTIONAL\r
+  OUT VOID                               **LocalIrqPriorityTable, OPTIONAL\r
+  OUT UINTN                              *IrqPriorityTableEntries OPTIONAL\r
+  );\r
+\r
+/**\r
+  Translates the given PIRQ accounting for bridge\r
+\r
+  @param  This                  Protocol instance pointer.\r
+  @param  PciBus                PCI bus number for this device.\r
+  @param  PciDevice             PCI device number for this device.\r
+  @param  PciFunction           PCI function number for this device.\r
+  @param  Pirq                  Input is PIRQ reported by device, output is true PIRQ.\r
+  @param  PciIrq                The IRQ already assigned to the PIRQ or the IRQ to be\r
+                                assigned to the PIRQ.\r
+\r
+  @retval EFI_SUCCESS           The PIRQ was translated.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_LEGACY_BIOS_PLATFORM_TRANSLATE_PIRQ) (\r
+  IN EFI_LEGACY_BIOS_PLATFORM_PROTOCOL   *This,\r
+  IN  UINTN                              PciBus,\r
+  IN  UINTN                              PciDevice,\r
+  IN  UINTN                              PciFunction,\r
+  IN  OUT UINT8                          *Pirq,\r
+  OUT UINT8                              *PciIrq\r
+  );\r
+\r
+/**\r
+  Attempt to legacy boot the BootOption. If the EFI contexted has been\r
+  compromised this function will not return.\r
+\r
+  @param  This                   Protocol instance pointer.\r
+  @param  BbsDevicePath          EFI Device Path from BootXXXX variable.\r
+  @param  BbsTable               Internal BBS table.\r
+  @param  LoadOptionSize         Size of LoadOption in size.\r
+  @param  LoadOption             LoadOption from BootXXXX variable\r
+  @param  EfiToLegacy16BootTable Pointer to BootTable structure\r
+\r
+  @retval EFI_SUCCESS           Ready to boot.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_LEGACY_BIOS_PLATFORM_PREPARE_TO_BOOT) (\r
+  IN EFI_LEGACY_BIOS_PLATFORM_PROTOCOL   *This,\r
+  IN  BBS_BBS_DEVICE_PATH                *BbsDevicePath,\r
+  IN  VOID                               *BbsTable,\r
+  IN  UINT32                             LoadOptionsSize,\r
+  IN  VOID                               *LoadOptions,\r
+  IN  VOID                               *EfiToLegacy16BootTable\r
+  );\r
+\r
+/**\r
+  @par Protocol Description:\r
+  Abstracts the platform portion of the traditional BIOS.\r
+\r
+  @param GetPlatformInfo\r
+  Gets binary data or other platform information.\r
+\r
+  @param GetPlatformHandle\r
+  Returns a buffer of all handles matching the requested subfunction.\r
+\r
+  @param SmmInit\r
+  Loads and initializes the traditional BIOS SMM handler.\r
+\r
+  @param PlatformHooks\r
+  Allows platform to perform any required actions after a LegacyBios operation.\r
+\r
+  @param GetRoutingTable\r
+  Gets $PIR table.\r
+\r
+  @param TranslatePirq\r
+  Translates the given PIRQ to the final value after traversing any PCI bridges.\r
+\r
+  @param PrepareToBoot\r
+  Final platform function before the system attempts to boot to a traditional OS.\r
+\r
+**/\r
+struct _EFI_LEGACY_BIOS_PLATFORM_PROTOCOL {\r
+  EFI_LEGACY_BIOS_PLATFORM_GET_PLATFORM_INFO    GetPlatformInfo;\r
+  EFI_LEGACY_BIOS_PLATFORM_GET_PLATFORM_HANDLE  GetPlatformHandle;\r
+  EFI_LEGACY_BIOS_PLATFORM_SMM_INIT             SmmInit;\r
+  EFI_LEGACY_BIOS_PLATFORM_HOOKS                PlatformHooks;\r
+  EFI_LEGACY_BIOS_PLATFORM_GET_ROUTING_TABLE    GetRoutingTable;\r
+  EFI_LEGACY_BIOS_PLATFORM_TRANSLATE_PIRQ       TranslatePirq;\r
+  EFI_LEGACY_BIOS_PLATFORM_PREPARE_TO_BOOT      PrepareToBoot;\r
+};\r
+\r
+extern EFI_GUID gEfiLegacyBiosPlatformProtocolGuid;\r
+\r
+#endif\r
diff --git a/IntelFrameworkPkg/Include/Protocol/LegacyInterrupt.h b/IntelFrameworkPkg/Include/Protocol/LegacyInterrupt.h
new file mode 100644 (file)
index 0000000..13ac36f
--- /dev/null
@@ -0,0 +1,131 @@
+/** @file\r
+  This protocol manages the legacy memory regions between 0xc0000 - 0xfffff\r
+\r
+  Copyright (c) 2007, Intel Corporation\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+  Module Name:  LegacyInterrupt.h\r
+\r
+  @par Revision Reference:\r
+  This protocol is defined in Framework for EFI Compatibility Support Module spec\r
+  Version 0.96\r
+\r
+**/\r
+\r
+#ifndef _EFI_LEGACY_INTERRUPT_H_\r
+#define _EFI_LEGACY_INTERRUPT_H_\r
+\r
+#define EFI_LEGACY_INTERRUPT_PROTOCOL_GUID \\r
+  { \\r
+    0x31ce593d, 0x108a, 0x485d, {0xad, 0xb2, 0x78, 0xf2, 0x1f, 0x29, 0x66, 0xbe } \\r
+  }\r
+\r
+typedef struct _EFI_LEGACY_INTERRUPT_PROTOCOL EFI_LEGACY_INTERRUPT_PROTOCOL;\r
+\r
+/**\r
+  Get the number of PIRQs this hardware supports.\r
+\r
+  @param  This                  Protocol instance pointer.\r
+  @param  NumberPirsq           Number of PIRQs.\r
+\r
+  @retval EFI_SUCCESS           Number of PIRQs returned.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_LEGACY_INTERRUPT_GET_NUMBER_PIRQS) (\r
+  IN EFI_LEGACY_INTERRUPT_PROTOCOL            *This,\r
+  OUT UINT8                                   *NumberPirqs\r
+  );\r
+\r
+/**\r
+  Gets the PCI location associated with this protocol.\r
+\r
+  @param  This                  Protocol instance pointer.\r
+  @param  Bus                   PCI Bus\r
+  @param  Device                PCI Device\r
+  @param  Function              PCI Function\r
+\r
+  @retval EFI_SUCCESS           Bus/Device/Function returned\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_LEGACY_INTERRUPT_GET_LOCATION) (\r
+  IN EFI_LEGACY_INTERRUPT_PROTOCOL            *This,\r
+  OUT UINT8                                   *Bus,\r
+  OUT UINT8                                   *Device,\r
+  OUT UINT8                                   *Function\r
+  );\r
+\r
+/**\r
+  Read the PIRQ register and return the data\r
+\r
+  @param  This                  Protocol instance pointer.\r
+  @param  PirqNumber            PIRQ register to read\r
+  @param  PirqData              Data read\r
+\r
+  @retval EFI_SUCCESS           Data was read\r
+  @retval EFI_INVALID_PARAMETER Invalid PIRQ number\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_LEGACY_INTERRUPT_READ_PIRQ) (\r
+  IN EFI_LEGACY_INTERRUPT_PROTOCOL           *This,\r
+  IN  UINT8                                  PirqNumber,\r
+  OUT UINT8                                  *PirqData\r
+  );\r
+\r
+/**\r
+  Write the specified PIRQ register with the given data.\r
+\r
+  @param  This                  Protocol instance pointer.\r
+  @param  PirqNumber            PIRQ register to read.\r
+  @param  PirqData              Data written.\r
+\r
+  @retval EFI_SUCCESS           Table pointer returned\r
+  @retval EFI_INVALID_PARAMETER Invalid PIRQ number\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_LEGACY_INTERRUPT_WRITE_PIRQ) (\r
+  IN EFI_LEGACY_INTERRUPT_PROTOCOL           *This,\r
+  IN  UINT8                                  PirqNumber,\r
+  IN UINT8                                   PirqData\r
+  );\r
+\r
+/**\r
+  @par Protocol Description:\r
+  Abstracts the PIRQ programming from the generic EFI Compatibility Support Modules\r
+\r
+  @param GetNumberPirqs\r
+  Gets the number of PIRQs supported.\r
+\r
+  @param GetLocation\r
+  Gets the PCI bus, device, and function that associated with this protocol.\r
+\r
+  @param ReadPirq\r
+  Reads the indicated PIRQ register.\r
+\r
+  @param WritePirq\r
+  Writes to the indicated PIRQ register.\r
+\r
+**/\r
+struct _EFI_LEGACY_INTERRUPT_PROTOCOL {\r
+  EFI_LEGACY_INTERRUPT_GET_NUMBER_PIRQS GetNumberPirqs;\r
+  EFI_LEGACY_INTERRUPT_GET_LOCATION     GetLocation;\r
+  EFI_LEGACY_INTERRUPT_READ_PIRQ        ReadPirq;\r
+  EFI_LEGACY_INTERRUPT_WRITE_PIRQ       WritePirq;\r
+};\r
+\r
+extern EFI_GUID gEfiLegacyInterruptProtocolGuid;\r
+\r
+#endif\r
diff --git a/IntelFrameworkPkg/Include/Protocol/LegacyRegion.h b/IntelFrameworkPkg/Include/Protocol/LegacyRegion.h
new file mode 100644 (file)
index 0000000..ede3a6c
--- /dev/null
@@ -0,0 +1,140 @@
+/** @file\r
+  This protocol manages the legacy memory regions between 0xc0000 - 0xfffff\r
+\r
+  Copyright (c) 2007, Intel Corporation\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+  Module Name:  LegacyRegion.h\r
+\r
+  @par Revision Reference:\r
+  This protocol is defined in Framework for EFI Compatibility Support Module spec\r
+  Version 0.96\r
+\r
+**/\r
+\r
+#ifndef _EFI_LEGACY_REGION_H_\r
+#define _EFI_LEGACY_REGION_H_\r
+\r
+#define EFI_LEGACY_REGION_PROTOCOL_GUID \\r
+  { \\r
+    0xfc9013a, 0x568, 0x4ba9, {0x9b, 0x7e, 0xc9, 0xc3, 0x90, 0xa6, 0x60, 0x9b } \\r
+  }\r
+\r
+typedef struct _EFI_LEGACY_REGION_PROTOCOL EFI_LEGACY_REGION_PROTOCOL;\r
+\r
+/**\r
+  Sets hardware to decode or not decode a region.\r
+\r
+  @param  This                  Indicates the EFI_LEGACY_REGION_PROTOCOL instance\r
+  @param  Start                 Start of region to decode.\r
+  @param  Length                Size in bytes of the region.\r
+  @param  On                    Decode/nondecode flag.\r
+\r
+  @retval EFI_SUCCESS           Decode range successfully changed.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_LEGACY_REGION_DECODE) (\r
+  IN EFI_LEGACY_REGION_PROTOCOL           *This,\r
+  IN  UINT32                              Start,\r
+  IN  UINT32                              Length,\r
+  IN  BOOLEAN                             *On\r
+  );\r
+\r
+/**\r
+  Sets a region to read only.\r
+\r
+  @param  This                  Indicates the EFI_LEGACY_REGION_PROTOCOL instance\r
+  @param  Start                 Start of region to lock.\r
+  @param  Length                Size in bytes of the region.\r
+  @param  Granularity           Lock attribute affects this granularity in bytes.\r
+\r
+  @retval EFI_SUCCESS           The region was made read only.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_LEGACY_REGION_LOCK) (\r
+  IN EFI_LEGACY_REGION_PROTOCOL           *This,\r
+  IN  UINT32                              Start,\r
+  IN  UINT32                              Length,\r
+  OUT UINT32                              *Granularity OPTIONAL\r
+  );\r
+\r
+/**\r
+  Sets a region to read only and ensures that flash is locked from being\r
+  inadvertently modified.\r
+\r
+  @param  This                  Indicates the EFI_LEGACY_REGION_PROTOCOL instance\r
+  @param  Start                 Start of region to lock.\r
+  @param  Length                Size in bytes of the region.\r
+  @param  Granularity           Lock attribute affects this granularity in bytes.\r
+\r
+  @retval EFI_SUCCESS           The region was made read only and flash is locked.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_LEGACY_REGION_BOOT_LOCK) (\r
+  IN EFI_LEGACY_REGION_PROTOCOL           *This,\r
+  IN  UINT32                              Start,\r
+  IN  UINT32                              Length,\r
+  OUT UINT32                              *Granularity OPTIONAL\r
+  );\r
+\r
+/**\r
+  Sets a region to read-write.\r
+\r
+  @param  This                  Indicates the EFI_LEGACY_REGION_PROTOCOL instance\r
+  @param  Start                 Start of region to lock.\r
+  @param  Length                Size in bytes of the region.\r
+  @param  Granularity           Lock attribute affects this granularity in bytes.\r
+\r
+  @retval EFI_SUCCESS           The region was successfully made read-write.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_LEGACY_REGION_UNLOCK) (\r
+  IN EFI_LEGACY_REGION_PROTOCOL           *This,\r
+  IN  UINT32                              Start,\r
+  IN  UINT32                              Length,\r
+  OUT UINT32                              *Granularity OPTIONAL\r
+  );\r
+\r
+/**\r
+  @par Protocol Description:\r
+  Abstracts the hardware control of the physical address region 0xC0000-C0xFFFFF\r
+  for the traditional BIOS.\r
+\r
+  @param Decode\r
+  Specifies a region for the chipset to decode\r
+\r
+  @param Lock\r
+  Makes the specified OpROM region read only or locked.\r
+\r
+  @param BootLock\r
+  Sets a region to read only and ensures tat flash is locked from\r
+  inadvertent modification.\r
+\r
+  @param Unlock\r
+  Makes the specified OpROM region read-write or unlocked.\r
+\r
+**/\r
+struct _EFI_LEGACY_REGION_PROTOCOL {\r
+  EFI_LEGACY_REGION_DECODE    Decode;\r
+  EFI_LEGACY_REGION_LOCK      Lock;\r
+  EFI_LEGACY_REGION_BOOT_LOCK BootLock;\r
+  EFI_LEGACY_REGION_UNLOCK    UnLock;\r
+};\r
+\r
+extern EFI_GUID gEfiLegacyRegionProtocolGuid;\r
+\r
+#endif\r
diff --git a/IntelFrameworkPkg/Include/Protocol/PciHostBridgeResourceAllocation.h b/IntelFrameworkPkg/Include/Protocol/PciHostBridgeResourceAllocation.h
new file mode 100644 (file)
index 0000000..9e8d078
--- /dev/null
@@ -0,0 +1,363 @@
+/** @file\r
+  This file declares Pci Host Bridge Resource Allocation Protocol\r
+\r
+  Copyright (c) 2007, Intel Corporation\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+  Module Name:  PciHostBridgeResourceAllocation.h\r
+\r
+  @par Revision Reference:\r
+  This protocol is defined in Framework of EFI Pci Host Bridge Resource Allocation Protocol Spec\r
+  Version 0.9\r
+\r
+**/\r
+\r
+#ifndef _PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_H_\r
+#define _PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_H_\r
+\r
+#define EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL_GUID \\r
+  { 0xCF8034BE, 0x6768, 0x4d8b, {0xB7,0x39,0x7C,0xCE,0x68,0x3A,0x9F,0xBE }}\r
+\r
+\r
+typedef struct _EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL;\r
+\r
+\r
+//\r
+// EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_ATTRIBUTES\r
+//\r
+\r
+// If this bit is set, then the PCI Root Bridge does not\r
+// support separate windows for Non-prefetchable and Prefetchable\r
+// memory. A PCI bus driver needs to include requests for Prefetchable\r
+// memory in the Non-prefetchable memory pool.\r
+//\r
+#define EFI_PCI_HOST_BRIDGE_COMBINE_MEM_PMEM  1\r
+\r
+//\r
+// If this bit is set, then the PCI Root Bridge supports\r
+// 64 bit memory windows.  If this bit is not set,\r
+// the PCI bus driver needs to include requests for 64 bit\r
+// memory address in the corresponding 32 bit memory pool.\r
+//\r
+#define EFI_PCI_HOST_BRIDGE_MEM64_DECODE   2\r
+\r
+\r
+//\r
+// EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PHASE\r
+//\r
+typedef enum {\r
+  EfiPciHostBridgeBeginEnumeration,\r
+  EfiPciHostBridgeBeginBusAllocation,\r
+  EfiPciHostBridgeEndBusAllocation,\r
+  EfiPciHostBridgeBeginResourceAllocation,\r
+  EfiPciHostBridgeAllocateResources,\r
+  EfiPciHostBridgeSetResources,\r
+  EfiPciHostBridgeFreeResources,\r
+  EfiPciHostBridgeEndResourceAllocation\r
+} EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PHASE;\r
+\r
+//\r
+// EfiPciHostBridgeBeginEnumeration\r
+// Reset the host bridge PCI apertures and internal data structures.\r
+// PCI enumerator should issue this notification before starting fresh\r
+// enumeration process. Enumeration cannot be restarted after sending\r
+// any other notification such as EfiPciHostBridgeBeginBusAllocation.\r
+//\r
+// EfiPciHostBridgeBeginBusAllocation\r
+// The bus allocation phase is about to begin. No specific action\r
+// is required here. This notification can be used to perform any\r
+// chipset specific programming.\r
+//\r
+// EfiPciHostBridgeEndBusAllocation\r
+// The bus allocation and bus programming phase is complete. No specific\r
+// action is required here. This notification can be used to perform any\r
+// chipset specific programming.\r
+//\r
+// EfiPciHostBridgeBeginResourceAllocation\r
+// The resource allocation phase is about to begin.No specific action is\r
+// required here. This notification can be used to perform any chipset specific programming.\r
+//\r
+// EfiPciHostBridgeAllocateResources\r
+// Allocate resources per previously submitted requests for all the PCI Root\r
+// Bridges. These resource settings are returned on the next call to\r
+// GetProposedResources().\r
+//\r
+// EfiPciHostBridgeSetResources\r
+// Program the Host Bridge hardware to decode previously allocated resources\r
+// (proposed resources) for all the PCI Root Bridges.\r
+//\r
+// EfiPciHostBridgeFreeResources\r
+// De-allocate previously allocated resources previously for all the PCI\r
+// Root Bridges and reset the I/O and memory apertures to initial state.\r
+//\r
+// EfiPciHostBridgeEndResourceAllocation\r
+// The resource allocation phase is completed.  No specific action is required\r
+// here. This notification can be used to perform any chipset specific programming.\r
+\r
+\r
+\r
+//\r
+// EFI_PCI_CONTROLLER_RESOURCE_ALLOCATION_PHASE\r
+//\r
+typedef enum {\r
+  EfiPciBeforeChildBusEnumeration,\r
+  EfiPciBeforeResourceCollection\r
+} EFI_PCI_CONTROLLER_RESOURCE_ALLOCATION_PHASE;\r
+\r
+//\r
+// EfiPciBeforeChildBusEnumeration\r
+// This notification is only applicable to PCI-PCI bridges and\r
+// indicates that the PCI enumerator is about to begin enumerating\r
+// the bus behind the PCI-PCI Bridge. This notification is sent after\r
+// the primary bus number, the secondary bus number and the subordinate\r
+// bus number registers in the PCI-PCI Bridge are programmed to valid\r
+// (not necessary final) values\r
+//\r
+// EfiPciBeforeResourceCollection\r
+// This notification is sent before the PCI enumerator probes BAR registers\r
+// for every valid PCI function.\r
+//\r
+\r
+\r
+/**\r
+  Enter a certain phase of the PCI enumeration process\r
+\r
+  @param  This                  The EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL instance\r
+  @param  Phase                 The phase during enumeration\r
+\r
+  @retval EFI_SUCCESS           Success\r
+  @retval EFI_OUT_OF_RESOURCES  If SubmitResources ( ) could not allocate resources\r
+  @retval EFI_NOT_READY         This phase cannot be entered at this time\r
+  @retval EFI_DEVICE_ERROR      SetResources failed due to HW error.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL_NOTIFY_PHASE) (\r
+  IN EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL         *This,\r
+  IN EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PHASE            Phase\r
+  );\r
+\r
+\r
+/**\r
+  Return the device handle of the next PCI root bridge that is associated with\r
+  this Host Bridge\r
+\r
+  @param  This                  The EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_ PROTOCOL instance\r
+  @param  RootBridgeHandle      Returns the device handle of the next PCI Root Bridge.\r
+                                On input, it holds the RootBridgeHandle returned by the most\r
+                                recent call to GetNextRootBridge().The handle for the first\r
+                                PCI Root Bridge is returned if RootBridgeHandle is NULL on input\r
+\r
+  @retval EFI_SUCCESS           Success\r
+  @retval EFI_INVALID_PARAMETER RootBridgeHandle is invalid\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL_GET_NEXT_ROOT_BRIDGE) (\r
+  IN EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL     *This,\r
+  IN OUT EFI_HANDLE                                       *RootBridgeHandle\r
+  );\r
+\r
+\r
+/**\r
+  Returns the attributes of a PCI Root Bridge.\r
+\r
+  @param  This                  The EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_ PROTOCOL instance\r
+  @param  RootBridgeHandle      The device handle of the PCI Root Bridge\r
+                                that the caller is interested in\r
+  @param  Attribute             The pointer to attributes of the PCI Root Bridge\r
+\r
+  @retval EFI_SUCCESS           Success\r
+  @retval EFI_INVALID_PARAMETER RootBridgeHandle is invalid\r
+  @retval EFI_INVALID_PARAMETER Attributes is NULL\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL_GET_ATTRIBUTES) (\r
+  IN EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL           *This,\r
+  IN  EFI_HANDLE                                                RootBridgeHandle,\r
+  OUT UINT64                                                    *Attributes\r
+  );\r
+\r
+\r
+/**\r
+  This is the request from the PCI enumerator to set up\r
+  the specified PCI Root Bridge for bus enumeration process.\r
+\r
+  @param  This                  The EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_ PROTOCOL instance\r
+  @param  RootBridgeHandle      The PCI Root Bridge to be set up\r
+  @param  Configuration         Pointer to the pointer to the PCI bus resource descriptor\r
+\r
+  @retval EFI_SUCCESS           Success\r
+  @retval EFI_INVALID_PARAMETER RootBridgeHandle is invalid\r
+  @retval EFI_DEVICE_ERROR      Request failed due to hardware error\r
+  @retval EFI_OUT_OF_RESOURCES  Request failed due to lack of resources\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL_START_BUS_ENUMERATION) (\r
+  IN EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL           *This,\r
+  IN  EFI_HANDLE                                                RootBridgeHandle,\r
+  OUT VOID                                                      **Configuration\r
+  );\r
+\r
+\r
+/**\r
+  This function programs the PCI Root Bridge hardware so that\r
+  it decodes the specified PCI bus range\r
+\r
+  @param  This                  The EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_ PROTOCOL instance\r
+  @param  RootBridgeHandle      The PCI Root Bridge whose bus range is to be programmed\r
+  @param  Configuration         The pointer to the PCI bus resource descriptor\r
+\r
+  @retval EFI_SUCCESS           Success\r
+  @retval EFI_INVALID_PARAMETER RootBridgeHandle is invalid\r
+  @retval EFI_INVALID_PARAMETER Configuration is NULL\r
+  @retval EFI_INVALID_PARAMETER Configuration does not point to a valid ACPI resource descriptor\r
+  @retval EFI_INVALID_PARAMETER Configuration contains one or more memory or IO ACPI resource descriptor\r
+  @retval EFI_INVALID_PARAMETER Address Range Minimum or Address Range Length fields in Configuration\r
+                                are invalid for this Root Bridge.\r
+  @retval EFI_INVALID_PARAMETER Configuration contains one or more invalid ACPI resource descriptor\r
+  @retval EFI_DEVICE_ERROR      Request failed due to hardware error\r
+  @retval EFI_OUT_OF_RESOURCES  Request failed due to lack of resources\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL_SET_BUS_NUMBERS) (\r
+  IN EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL          *This,\r
+  IN EFI_HANDLE                                                RootBridgeHandle,\r
+  IN VOID                                                      *Configuration\r
+  );\r
+\r
+\r
+/**\r
+  Submits the I/O and memory resource requirements for the specified PCI Root Bridge\r
+\r
+  @param  This                  The EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_ PROTOCOL instance\r
+  @param  RootBridgeHandle      The PCI Root Bridge whose I/O and memory resource requirements\r
+                                are being submitted\r
+  @param  Configuration         The pointer to the PCI I/O and PCI memory resource descriptor\r
+\r
+  @retval EFI_SUCCESS           Success\r
+  @retval EFI_INVALID_PARAMETER RootBridgeHandle is invalid\r
+  @retval EFI_INVALID_PARAMETER Configuration is NULL\r
+  @retval EFI_INVALID_PARAMETER Configuration does not point to a valid ACPI resource descriptor\r
+  @retval EFI_INVALID_PARAMETER Configuration includes a resource descriptor of unsupported type\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL_SUBMIT_RESOURCES) (\r
+  IN EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL          *This,\r
+  IN EFI_HANDLE                                                RootBridgeHandle,\r
+  IN VOID                                                      *Configuration\r
+  );\r
+\r
+\r
+/**\r
+  This function returns the proposed resource settings for the specified\r
+  PCI Root Bridge\r
+\r
+  @param  This                  The EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_ PROTOCOL instance\r
+  @param  RootBridgeHandle      The PCI Root Bridge handle\r
+  @param  Configuration         The pointer to the pointer to the PCI I/O\r
+                                and memory resource descriptor\r
+\r
+  @retval EFI_SUCCESS           Success\r
+  @retval EFI_INVALID_PARAMETER RootBridgeHandle is invalid\r
+  @retval EFI_DEVICE_ERROR      Request failed due to hardware error\r
+  @retval EFI_OUT_OF_RESOURCES  Request failed due to lack of resources\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL_GET_PROPOSED_RESOURCES) (\r
+  IN EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL           *This,\r
+  IN  EFI_HANDLE                                                RootBridgeHandle,\r
+  OUT VOID                                                      **Configuration\r
+  );\r
+\r
+\r
+\r
+/**\r
+  This function is called for all the PCI controllers that the PCI\r
+  bus driver finds. Can be used to Preprogram the controller.\r
+\r
+  @param  This                  The EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_ PROTOCOL instance\r
+  @param  RootBridgeHandle      The PCI Root Bridge handle\r
+  @param  PciBusAddress         Address of the controller on the PCI bus\r
+  @param  Phase                 The Phase during resource allocation\r
+\r
+  @retval EFI_SUCCESS           Success\r
+  @retval EFI_INVALID_PARAMETER RootBridgeHandle is invalid\r
+  @retval EFI_DEVICE_ERROR      Device pre-initialization failed due to hardware error.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL_PREPROCESS_CONTROLLER) (\r
+  IN EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL            *This,\r
+  IN  EFI_HANDLE                                                 RootBridgeHandle,\r
+  IN  EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_PCI_ADDRESS                PciAddress,\r
+  IN  EFI_PCI_CONTROLLER_RESOURCE_ALLOCATION_PHASE               Phase\r
+  );\r
+\r
+/**\r
+  @par Protocol Description:\r
+  Provides the basic interfaces to abstract a PCI host bridge resource allocation.\r
+\r
+  @param NotifyPhase\r
+  The notification from the PCI bus enumerator that it is about to enter\r
+  a certain phase during the enumeration process.\r
+\r
+  @param GetNextRootBridge\r
+  Retrieves the device handle for the next PCI root bridge that is produced by the\r
+  host bridge to which this instance of the EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL is attached.\r
+\r
+  @param GetAllocAttributes\r
+  Retrieves the allocation-related attributes of a PCI root bridge.\r
+\r
+  @param StartBusEnumeration\r
+  Sets up a PCI root bridge for bus enumeration.\r
+\r
+  @param SetBusNumbers\r
+  Sets up the PCI root bridge so that it decodes a specific range of bus numbers.\r
+\r
+  @param SubmitResources\r
+  Submits the resource requirements for the specified PCI root bridge.\r
+\r
+  @param GetProposedResources\r
+  Returns the proposed resource assignment for the specified PCI root bridges.\r
+\r
+  @param PreprocessController\r
+  Provides hooks from the PCI bus driver to every PCI controller\r
+  (device/function) at various stages of the PCI enumeration process that\r
+  allow the host bridge driver to preinitialize individual PCI controllers\r
+  before enumeration.\r
+\r
+**/\r
+struct _EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL {\r
+  EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL_NOTIFY_PHASE           NotifyPhase;\r
+  EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL_GET_NEXT_ROOT_BRIDGE   GetNextRootBridge;\r
+  EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL_GET_ATTRIBUTES         GetAllocAttributes;\r
+  EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL_START_BUS_ENUMERATION  StartBusEnumeration;\r
+  EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL_SET_BUS_NUMBERS        SetBusNumbers;\r
+  EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL_SUBMIT_RESOURCES       SubmitResources;\r
+  EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL_GET_PROPOSED_RESOURCES GetProposedResources;\r
+  EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL_PREPROCESS_CONTROLLER  PreprocessController;\r
+};\r
+\r
+extern EFI_GUID gEfiPciHostBridgeResourceAllocationProtocolGuid;\r
+\r
+#endif\r
diff --git a/IntelFrameworkPkg/Include/Protocol/PciHotPlugInit.h b/IntelFrameworkPkg/Include/Protocol/PciHotPlugInit.h
new file mode 100644 (file)
index 0000000..577a4dd
--- /dev/null
@@ -0,0 +1,165 @@
+/** @file\r
+  This file declares EFI PCI Hot Plug Init Protocol\r
+\r
+  Copyright (c) 2007, Intel Corporation\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+  Module Name:  PciHotPlugInit.h\r
+\r
+  @par Revision Reference:\r
+  This protocol is defined in Framework of EFI Hot Plug Pci Initialization Protocol Spec\r
+  Version 0.9\r
+\r
+**/\r
+\r
+#ifndef _EFI_PCI_HOT_PLUG_INIT_H_\r
+#define _EFI_PCI_HOT_PLUG_INIT_H_\r
+\r
+//\r
+// Global ID for the PCI Hot Plug Protocol\r
+//\r
+#define EFI_PCI_HOT_PLUG_INIT_PROTOCOL_GUID \\r
+  { 0xaa0e8bc1, 0xdabc, 0x46b0, {0xa8, 0x44, 0x37, 0xb8, 0x16, 0x9b, 0x2b, 0xea } }\r
+\r
+\r
+typedef struct _EFI_PCI_HOT_PLUG_INIT_PROTOCOL EFI_PCI_HOT_PLUG_INIT_PROTOCOL;\r
+\r
+#define  EFI_HPC_STATE_INITIALIZED    0x01\r
+#define  EFI_HPC_STATE_ENABLED        0x02\r
+\r
+typedef UINT16 EFI_HPC_STATE;\r
+\r
+\r
+typedef struct{\r
+  EFI_DEVICE_PATH_PROTOCOL  *HpcDevicePath;\r
+  EFI_DEVICE_PATH_PROTOCOL  *HpbDevicePath;\r
+} EFI_HPC_LOCATION;\r
+\r
+\r
+typedef enum{\r
+  EfiPaddingPciBus,\r
+  EfiPaddingPciRootBridge\r
+} EFI_HPC_PADDING_ATTRIBUTES;\r
+\r
+/**\r
+  Returns a list of root Hot Plug Controllers (HPCs) that require initialization\r
+  during the boot process.\r
+\r
+  @param  This                  Pointer to the EFI_PCI_HOT_PLUG_INIT_PROTOCOL instance.\r
+  @param  HpcCount              The number of root HPCs that were returned.\r
+  @param  HpcList               The list of root HPCs. HpcCount defines the number of\r
+                                elements in this list.\r
+\r
+  @retval EFI_SUCCESS           HpcList was returned.\r
+  @retval EFI_OUT_OF_RESOURCES  HpcList was not returned due to insufficient resources.\r
+  @retval EFI_INVALID_PARAMETER HpcCount is NULL or HpcList is NULL.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_GET_ROOT_HPC_LIST) (\r
+  IN EFI_PCI_HOT_PLUG_INIT_PROTOCOL   *This,\r
+  OUT UINTN                           *HpcCount,\r
+  OUT EFI_HPC_LOCATION                **HpcList\r
+);\r
+\r
+/**\r
+  Initializes one root Hot Plug Controller (HPC). This process may causes\r
+  initialization of its subordinate buses.\r
+\r
+  @param  This                  Pointer to the EFI_PCI_HOT_PLUG_INIT_PROTOCOL instance.\r
+  @param  HpcDevicePath         The device path to the HPC that is being initialized.\r
+  @param  HpcPciAddress         The address of the HPC function on the PCI bus.\r
+  @param  Event                 The event that should be signaled when the HPC initialization\r
+                                is complete.\r
+  @param  HpcState              The state of the HPC hardware.\r
+\r
+  @retval EFI_SUCCESS           If Event is NULL, the specific HPC was successfully\r
+                                initialized. If Event is not NULL, Event will be signaled at a later time\r
+                                when initialization is complete.\r
+  @retval EFI_UNSUPPORTED       This instance of EFI_PCI_HOT_PLUG_INIT_PROTOCOL\r
+                                does not support the specified HPC.\r
+  @retval EFI_OUT_OF_RESOURCES  Initialization failed due to insufficient\r
+                                resources.\r
+  @retval EFI_INVALID_PARAMETER HpcState is NULL.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_INITIALIZE_ROOT_HPC) (\r
+  IN EFI_PCI_HOT_PLUG_INIT_PROTOCOL     *This,\r
+  IN  EFI_DEVICE_PATH_PROTOCOL          *HpcDevicePath,\r
+  IN  UINT64                            HpcPciAddress,\r
+  IN  EFI_EVENT                         Event, OPTIONAL\r
+  OUT EFI_HPC_STATE                     *HpcState\r
+);\r
+\r
+/**\r
+  Returns the resource padding that is required by the PCI bus that is controlled\r
+  by the specified Hot Plug Controller (HPC).\r
+\r
+  @param  This                  Pointer to the EFI_PCI_HOT_PLUG_INIT_PROTOCOL instance.\r
+  @param  HpcDevicePath         The device path to the HPC.\r
+  @param  HpcPciAddress         The address of the HPC function on the PCI bus.\r
+  @param  HpcState              The state of the HPC hardware.\r
+  @param  Padding               The amount of resource padding that is required by the\r
+                                PCI bus under the control of the specified HPC.\r
+  @param  Attributes            Describes how padding is accounted for. The padding\r
+                                is returned in the form of ACPI 2.0 resource descriptors.\r
+\r
+  @retval EFI_SUCCESS           The resource padding was successfully returned.\r
+  @retval EFI_UNSUPPORTED       This instance of the EFI_PCI_HOT_PLUG_INIT_PROTOCOL\r
+                                does not support the specified HPC.\r
+  @retval EFI_NOT_READY         This function was called before HPC initialization is complete.\r
+  @retval EFI_INVALID_PARAMETER HpcState or Padding or Attributes is NULL.\r
+  @retval EFI_OUT_OF_RESOURCES  ACPI 2.0 resource descriptors for Padding\r
+                                cannot be allocated due to insufficient resources.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_GET_PCI_HOT_PLUG_PADDING) (\r
+  IN EFI_PCI_HOT_PLUG_INIT_PROTOCOL     *This,\r
+  IN  EFI_DEVICE_PATH_PROTOCOL          *HpcDevicePath,\r
+  IN  UINT64                            HpcPciAddress,\r
+  OUT EFI_HPC_STATE                     *HpcState,\r
+  OUT VOID                              **Padding,\r
+  OUT EFI_HPC_PADDING_ATTRIBUTES        *Attributes\r
+);\r
+\r
+\r
+//\r
+// Prototypes for the PCI Hot Plug Init Protocol\r
+//\r
+\r
+/**\r
+  @par Protocol Description:\r
+  This protocol provides the necessary functionality to initialize the\r
+  Hot Plug Controllers (HPCs) and the buses that they control. This protocol\r
+  also provides information regarding resource padding.\r
+\r
+  @param GetRootHpcList\r
+  Returns a list of root HPCs and the buses that they control.\r
+\r
+  @param InitializeRootHpc\r
+  Initializes the specified root HPC.\r
+\r
+  @param GetResourcePadding\r
+  Returns the resource padding that is required by the HPC.\r
+\r
+**/\r
+struct _EFI_PCI_HOT_PLUG_INIT_PROTOCOL {\r
+  EFI_GET_ROOT_HPC_LIST                                  GetRootHpcList;\r
+  EFI_INITIALIZE_ROOT_HPC                                InitializeRootHpc;\r
+  EFI_GET_PCI_HOT_PLUG_PADDING                           GetResourcePadding;\r
+};\r
+\r
+extern EFI_GUID gEfiPciHotPlugInitProtocolGuid;\r
+\r
+#endif\r
diff --git a/IntelFrameworkPkg/Include/Protocol/PciPlatform.h b/IntelFrameworkPkg/Include/Protocol/PciPlatform.h
new file mode 100644 (file)
index 0000000..f86ea51
--- /dev/null
@@ -0,0 +1,206 @@
+/** @file\r
+  This file declares PlatfromOpRom protocols.\r
+\r
+  Copyright (c) 2007, Intel Corporation\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+  Module Name:  PciPlatform.h\r
+\r
+  @par Revision Reference:\r
+  This protocol is defined in PCI Platform Support Specification\r
+  Version 0.9\r
+\r
+**/\r
+\r
+#ifndef _PCI_PLATFORM_H_\r
+#define _PCI_PLATFORM_H_\r
+\r
+//\r
+// Protocol for GUID.\r
+//\r
+\r
+#define EFI_PCI_PLATFORM_PROTOCOL_GUID \\r
+{ 0x7d75280, 0x27d4, 0x4d69, {0x90, 0xd0, 0x56, 0x43, 0xe2, 0x38, 0xb3, 0x41} }\r
+\r
+typedef struct _EFI_PCI_PLATFORM_PROTOCOL EFI_PCI_PLATFORM_PROTOCOL;\r
+\r
+typedef    UINT32   EFI_PCI_PLATFORM_POLICY;\r
+\r
+\r
+#define     EFI_RESERVE_NONE_IO_ALIAS        0x0000\r
+#define     EFI_RESERVE_ISA_IO_ALIAS         0x0001\r
+#define     EFI_RESERVE_ISA_IO_NO_ALIAS      0x0002\r
+#define     EFI_RESERVE_VGA_IO_ALIAS         0x0004\r
+#define     EFI_RESERVE_VGA_IO_NO_ALIAS      0x0008\r
+\r
+\r
+typedef enum {\r
+  ChipsetEntry,\r
+  ChipsetExit,\r
+  MaximumChipsetPhase\r
+} EFI_PCI_CHIPSET_EXECUTION_PHASE;\r
+\r
+\r
+/**\r
+  The PlatformNotify() function can be used to notify the platform driver so that\r
+  it can perform platform-specific actions. No specific actions are required.\r
+  Eight notification points are defined at this time. More synchronization points\r
+  may be added as required in the future. The PCI bus driver calls the platform driver\r
+  twice for every Phase-once before the PCI Host Bridge Resource Allocation Protocol\r
+  driver is notified, and once after the PCI Host Bridge Resource Allocation Protocol\r
+  driver has been notified.\r
+  This member function may not perform any error checking on the input parameters. It\r
+  also does not return any error codes. If this member function detects any error condition,\r
+  it needs to handle those errors on its own because there is no way to surface any\r
+  errors to the caller.\r
+\r
+  @param  This                  Pointer to the EFI_PCI_PLATFORM_PROTOCOL instance.\r
+  @param  HostBridge            The handle of the host bridge controller.\r
+  @param  Phase                 The phase of the PCI bus enumeration.\r
+  @param  ChipsetPhase          Defines the execution phase of the PCI chipset driver.\r
+\r
+  @retval EFI_SUCCESS           The function completed successfully.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_PCI_PLATFORM_PHASE_NOTIFY) (\r
+  IN EFI_PCI_PLATFORM_PROTOCOL                       *This,\r
+  IN  EFI_HANDLE                                     HostBridge,\r
+  IN  EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PHASE  Phase,\r
+  IN  EFI_PCI_CHIPSET_EXECUTION_PHASE                ChipsetPhase\r
+)\r
+;\r
+\r
+\r
+/**\r
+  The PlatformPrepController() function can be used to notify the platform driver so that\r
+  it can perform platform-specific actions. No specific actions are required.\r
+  Several notification points are defined at this time. More synchronization points may be\r
+  added as required in the future. The PCI bus driver calls the platform driver twice for\r
+  every PCI controller-once before the PCI Host Bridge Resource Allocation Protocol driver\r
+  is notified, and once after the PCI Host Bridge Resource Allocation Protocol driver has\r
+  been notified.\r
+  This member function may not perform any error checking on the input parameters. It also\r
+  does not return any error codes. If this member function detects any error condition, it\r
+  needs to handle those errors on its own because there is no way to surface any errors to\r
+  the caller.\r
+\r
+  @param  This                  Pointer to the EFI_PCI_PLATFORM_PROTOCOL instance.\r
+  @param  HostBridge            The associated PCI host bridge handle.\r
+  @param  RootBridge            The associated PCI root bridge handle.\r
+  @param  PciAddress            The address of the PCI device on the PCI bus.\r
+  @param  Phase                 The phase of the PCI controller enumeration.\r
+  @param  ChipsetPhase          Defines the execution phase of the PCI chipset driver.\r
+\r
+  @retval EFI_SUCCESS           The function completed successfully.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_PCI_PLATFORM_PREPROCESS_CONTROLLER) (\r
+  IN  EFI_PCI_PLATFORM_PROTOCOL                      *This,\r
+  IN  EFI_HANDLE                                     HostBridge,\r
+  IN  EFI_HANDLE                                     RootBridge,\r
+  IN  EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_PCI_ADDRESS    PciAddress,\r
+  IN  EFI_PCI_CONTROLLER_RESOURCE_ALLOCATION_PHASE   Phase,\r
+  IN  EFI_PCI_CHIPSET_EXECUTION_PHASE                ChipsetPhase\r
+)\r
+;\r
+\r
+\r
+/**\r
+  The GetPlatformPolicy() function retrieves the platform policy regarding PCI\r
+  enumeration. The PCI bus driver and the PCI Host Bridge Resource Allocation Protocol\r
+  driver can call this member function to retrieve the policy.\r
+\r
+  @param  This                  Pointer to the EFI_PCI_PLATFORM_PROTOCOL instance.\r
+  @param  PciPolicy             The platform policy with respect to VGA and ISA aliasing.\r
+\r
+  @retval EFI_SUCCESS           The function completed successfully.\r
+  @retval EFI_INVALID_PARAMETER PciPolicy is NULL.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_PCI_PLATFORM_GET_PLATFORM_POLICY) (\r
+  IN  EFI_PCI_PLATFORM_PROTOCOL           *This,\r
+  OUT EFI_PCI_PLATFORM_POLICY             *PciPolicy\r
+)\r
+;\r
+\r
+\r
+/**\r
+  The GetPciRom() function gets the PCI device's option ROM from a platform-specific location.\r
+  The option ROM will be loaded into memory. This member function is used to return an image\r
+  that is packaged as a PCI 2.2 option ROM. The image may contain both legacy and EFI option\r
+  ROMs. See the EFI 1.10 Specification for details. This member function can be used to return\r
+  option ROM images for embedded controllers. Option ROMs for embedded controllers are typically\r
+  stored in platform-specific storage, and this member function can retrieve it from that storage\r
+  and return it to the PCI bus driver. The PCI bus driver will call this member function before\r
+  scanning the ROM that is attached to any controller, which allows a platform to specify a ROM\r
+  image that is different from the ROM image on a PCI card.\r
+\r
+  @param  This                  Pointer to the EFI_PCI_PLATFORM_PROTOCOL instance.\r
+  @param  PciHandle             The handle of the PCI device.\r
+  @param  RomImage              If the call succeeds, the pointer to the pointer to the option ROM image.\r
+                                Otherwise, this field is undefined. The memory for RomImage is allocated\r
+                                by EFI_PCI_PLATFORM_PROTOCOL.GetPciRom() using the EFI Boot Service AllocatePool().\r
+                                It is the caller's responsibility to free the memory using the EFI Boot Service\r
+                                FreePool(), when the caller is done with the option ROM.\r
+  @param  RomSize               If the call succeeds, a pointer to the size of the option ROM size. Otherwise,\r
+                                this field is undefined.\r
+\r
+  @retval EFI_SUCCESS           The option ROM was available for this device and loaded into memory.\r
+  @retval EFI_NOT_FOUND         No option ROM was available for this device.\r
+  @retval EFI_OUT_OF_RESOURCES  No memory was available to load the option ROM.\r
+  @retval EFI_DEVICE_ERROR      An error occurred in getting the option ROM.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_PCI_PLATFORM_GET_PCI_ROM) (\r
+  IN   EFI_PCI_PLATFORM_PROTOCOL    *This,\r
+  IN   EFI_HANDLE                   PciHandle,\r
+  OUT  VOID                         **RomImage,\r
+  OUT  UINTN                        *RomSize\r
+)\r
+;\r
+\r
+/**\r
+  @par Protocol Description:\r
+  This protocol provides the interface between the PCI bus driver/PCI Host\r
+  Bridge Resource Allocation driver and a platform-specific driver to describe\r
+  the unique features of a platform.\r
+\r
+  @param PlatformNotify\r
+  The notification from the PCI bus enumerator to the platform that it is\r
+  about to enter a certain phase during the enumeration process.\r
+\r
+  @param PlatformPrepController\r
+  The notification from the PCI bus enumerator to the platform for each PCI\r
+  controller at several predefined points during PCI controller initialization.\r
+\r
+  @param GetPlatformPolicy\r
+  Retrieves the platform policy regarding enumeration.\r
+\r
+  @param GetPciRom\r
+  Gets the PCI device's option ROM from a platform-specific location.\r
+\r
+**/\r
+struct _EFI_PCI_PLATFORM_PROTOCOL {\r
+  EFI_PCI_PLATFORM_PHASE_NOTIFY          PhaseNotify;\r
+  EFI_PCI_PLATFORM_PREPROCESS_CONTROLLER PlatformPrepController;\r
+  EFI_PCI_PLATFORM_GET_PLATFORM_POLICY   GetPlatformPolicy;\r
+  EFI_PCI_PLATFORM_GET_PCI_ROM           GetPciRom;\r
+};\r
+\r
+extern EFI_GUID   gEfiPciPlatformProtocolGuid;\r
+\r
+#endif\r
diff --git a/IntelFrameworkPkg/Include/Protocol/SectionExtraction.h b/IntelFrameworkPkg/Include/Protocol/SectionExtraction.h
new file mode 100644 (file)
index 0000000..964cf4b
--- /dev/null
@@ -0,0 +1,160 @@
+/** @file\r
+  This file declares Section Extraction protocols.\r
+\r
+  This interface provides a means of decoding a set of sections into a linked list of\r
+  leaf sections.  This provides for an extensible and flexible file format.\r
+\r
+  Copyright (c) 2007, Intel Corporation\r
+  All rights reserved. This program and the materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+  Module Name:  SectionExtraction.h\r
+\r
+  @par Revision Reference:\r
+  This protocol is defined in Firmware Volume Specification.\r
+  Version 0.9\r
+\r
+**/\r
+\r
+#ifndef _SECTION_EXTRACTION_PROTOCOL_H_\r
+#define _SECTION_EXTRACTION_PROTOCOL_H_\r
+\r
+\r
+//\r
+// Protocol GUID definition\r
+//\r
+#define EFI_SECTION_EXTRACTION_PROTOCOL_GUID \\r
+  { \\r
+    0x448F5DA4, 0x6DD7, 0x4FE1, {0x93, 0x07, 0x69, 0x22, 0x41, 0x92, 0x21, 0x5D } \\r
+  }\r
+\r
+typedef struct _EFI_SECTION_EXTRACTION_PROTOCOL EFI_SECTION_EXTRACTION_PROTOCOL;\r
+\r
+//\r
+// Protocol member functions\r
+//\r
+/**\r
+  Creates and returns a new section stream handle to represent the new section stream.\r
+\r
+  @param  This                  Indicates the EFI_SECTION_EXTRACTION_PROTOCOL instance.\r
+  @param  SectionStreamLength   Size in bytes of the section stream.\r
+  @param  SectionStream         Buffer containing the new section stream.\r
+  @param  SectionStreamHandle   A pointer to a caller-allocated UINTN that,\r
+                                on output, contains the new section stream handle.\r
+\r
+  @retval EFI_SUCCESS           The SectionStream was successfully processed and\r
+                                the section stream handle was returned.\r
+  @retval EFI_OUT_OF_RESOURCES  The system has insufficient resources to\r
+                                process the request.\r
+  @retval EFI_INVALID_PARAMETER The section stream may be corrupt or the value\r
+                                of SectionStreamLength may be incorrect.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_OPEN_SECTION_STREAM) (\r
+  IN  EFI_SECTION_EXTRACTION_PROTOCOL                   *This,\r
+  IN  UINTN                                             SectionStreamLength,\r
+  IN  VOID                                              *SectionStream,\r
+  OUT UINTN                                             *SectionStreamHandle\r
+  );\r
+\r
+/**\r
+  Reads and returns a single section from a section stream.\r
+\r
+  @param  This                  Indicates the EFI_SECTION_EXTRACTION_PROTOCOL instance.\r
+  @param  SectionStreamHandle   Indicates from which section stream to read.\r
+  @param  SectionType           Pointer to an EFI_SECTION_TYPE.\r
+  @param  SectionDefinitionGuid Pointer to an EFI_GUID.If SectionType ==\r
+                                EFI_SECTION_GUID_DEFINED, SectionDefinitionGuid indicates what section GUID\r
+                                to search for.If SectionType !=EFI_SECTION_GUID_DEFINED, then\r
+                                SectionDefinitionGuid is unused and is ignored.\r
+  @param  SectionInstance       Indicates which instance of the requested section\r
+                                type to return when SectionType is not NULL.\r
+  @param  SectionStreamHandle   A pointer to a caller-allocated UINTN that, on output,\r
+                                contains the new section stream handle.\r
+  @param  Buffer                Pointer to a pointer to a buffer in which the section\r
+                                contents are returned.\r
+  @param  BufferSize            Pointer to a caller-allocated UINTN.\r
+  @param  AuthenticationStatus  Pointer to a caller-allocated UINT32 in\r
+                                which any meta-data from encapsulation GUID-defined sections is returned.\r
+\r
+  @retval EFI_SUCCESS           The SectionStream was successfully processed and\r
+                                the section contents were returned in Buffer.\r
+  @retval EFI_PROTOCOL_ERROR    A GUID-defined section was encountered in\r
+                                the section stream with its EFI_GUIDED_SECTION_PROCESSING_REQUIRED bit set,\r
+                                but there was no corresponding GUIDed Section Extraction Protocol in\r
+                                the handle database.\r
+  @retval EFI_NOT_FOUND         An error was encountered when parsing the SectionStream,\r
+                                which indicates that the SectionStream is not correctly formatted.\r
+                                Or The requested section does not exist.\r
+  @retval EFI_OUT_OF_RESOURCES  The system has insufficient resources to process\r
+                                the request.\r
+  @retval EFI_INVALID_PARAMETER The SectionStreamHandle does not exist.\r
+  @retval EFI_BUFFER_TOO_SMALL  The size of the input buffer is insufficient to\r
+                                contain the requested section.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_GET_SECTION) (\r
+  IN EFI_SECTION_EXTRACTION_PROTOCOL                    *This,\r
+  IN UINTN                                              SectionStreamHandle,\r
+  IN EFI_SECTION_TYPE                                   *SectionType,\r
+  IN EFI_GUID                                           *SectionDefinitionGuid,\r
+  IN UINTN                                              SectionInstance,\r
+  IN VOID                                               **Buffer,\r
+  IN OUT UINTN                                          *BufferSize,\r
+  OUT UINT32                                            *AuthenticationStatus\r
+  );\r
+\r
+/**\r
+  Deletes a section stream handle and returns all associated resources to the system.\r
+\r
+  @param  This                  Indicates the EFI_SECTION_EXTRACTION_PROTOCOL instance.\r
+  @param  SectionStreamHandle   Indicates the section stream to close.\r
+  @retval EFI_SUCCESS           The SectionStream was successfully processed and\r
+                                the section stream handle was returned.\r
+  @retval EFI_INVALID_PARAMETER The SectionStreamHandle does not exist.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_CLOSE_SECTION_STREAM) (\r
+  IN EFI_SECTION_EXTRACTION_PROTOCOL                    *This,\r
+  IN UINTN                                              SectionStreamHandle\r
+  );\r
+\r
+//\r
+// Protocol definition\r
+//\r
+/**\r
+  @par Protocol Description:\r
+  The Section Extraction Protocol provides a simple method of extracting\r
+  sections from arbitrarily complex files.\r
+\r
+  @param OpenSectionStream\r
+  Takes a bounded stream of sections and returns a section stream handle.\r
+\r
+  @param GetSection\r
+  Given a section stream handle, retrieves the requested section and\r
+  meta-data from the section stream.\r
+\r
+  @param CloseSectionStream\r
+  Given a section stream handle, closes the section stream.\r
+\r
+**/\r
+struct _EFI_SECTION_EXTRACTION_PROTOCOL {\r
+  EFI_OPEN_SECTION_STREAM   OpenSectionStream;\r
+  EFI_GET_SECTION           GetSection;\r
+  EFI_CLOSE_SECTION_STREAM  CloseSectionStream;\r
+};\r
+\r
+extern EFI_GUID gEfiSectionExtractionProtocolGuid;\r
+\r
+#endif\r
diff --git a/IntelFrameworkPkg/Include/Protocol/SmmAccess.h b/IntelFrameworkPkg/Include/Protocol/SmmAccess.h
new file mode 100644 (file)
index 0000000..700eb25
--- /dev/null
@@ -0,0 +1,159 @@
+/** @file\r
+  This file declares SMM SMRAM Access abstraction protocol\r
+\r
+  Copyright (c) 2007, Intel Corporation\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+  Module Name:  SmmAccess.h\r
+\r
+  @par Revision Reference:\r
+  This Protocol is defined in Framework of EFI SMM Core Interface Spec\r
+  Version 0.9.\r
+**/\r
+\r
+#ifndef _SMM_ACCESS_H_\r
+#define _SMM_ACCESS_H_\r
+\r
+#include <SmramMemoryReserve.h>\r
+\r
+typedef struct _EFI_SMM_ACCESS_PROTOCOL  EFI_SMM_ACCESS_PROTOCOL;\r
+\r
+#define EFI_SMM_ACCESS_PROTOCOL_GUID \\r
+  { \\r
+    0x3792095a, 0xe309, 0x4c1e, {0xaa, 0x01, 0x85, 0xf5, 0x65, 0x5a, 0x17, 0xf1 } \\r
+  }\r
+\r
+//\r
+// SMM Access specification constant and types\r
+//\r
+// *******************************************************\r
+//  EFI_SMRAM_STATE\r
+// *******************************************************\r
+//\r
+#define EFI_SMRAM_OPEN    0x00000001\r
+#define EFI_SMRAM_CLOSED  0x00000002\r
+#define EFI_SMRAM_LOCKED  0x00000004\r
+#define EFI_CACHEABLE     0x00000008\r
+#define EFI_ALLOCATED     0x00000010\r
+\r
+//\r
+// SMM Access specification Member Function\r
+//\r
+/**\r
+  Opens the SMRAM area to be accessible by a boot-service driver.\r
+\r
+  @param  This                  The EFI_SMM_ACCESS_PROTOCOL instance.\r
+  @param  DescriptorIndex       Indicates that the driver wishes to open\r
+                                the memory tagged by this index.\r
+\r
+  @retval EFI_SUCCESS           The operation was successful.\r
+  @retval EFI_INVALID_PARAMETER The given DescriptorIndex is not supported.\r
+  @retval EFI_NOT_STARTED       The SMM base service has not been initialized.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_SMM_OPEN) (\r
+  IN EFI_SMM_ACCESS_PROTOCOL         *This,\r
+  UINTN                              DescriptorIndex\r
+  );\r
+\r
+/**\r
+  Inhibits access to the SMRAM.\r
+\r
+  @param  This                  The EFI_SMM_ACCESS_PROTOCOL instance.\r
+  @param  DescriptorIndex       Indicates that the driver wishes to open\r
+                                the memory tagged by this index.\r
+\r
+  @retval EFI_SUCCESS           The operation was successful.\r
+  @retval EFI_DEVICE_ERROR      The given DescriptorIndex is not open.\r
+  @retval EFI_INVALID_PARAMETER The given DescriptorIndex is not supported.\r
+  @retval EFI_NOT_STARTED       The SMM base service has not been initialized.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_SMM_CLOSE) (\r
+  IN EFI_SMM_ACCESS_PROTOCOL          *This,\r
+  UINTN                               DescriptorIndex\r
+  );\r
+\r
+/**\r
+  Inhibits access to the SMRAM.\r
+  @param  This                  The EFI_SMM_ACCESS_PROTOCOL instance.\r
+  @param  DescriptorIndex       Indicates that the driver wishes to open\r
+                                the memory tagged by this index.\r
+\r
+  @retval EFI_SUCCESS           The operation was successful.\r
+  @retval EFI_DEVICE_ERROR      The given DescriptorIndex is not open.\r
+  @retval EFI_INVALID_PARAMETER The given DescriptorIndex is not supported.\r
+  @retval EFI_NOT_STARTED       The SMM base service has not been initialized.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_SMM_LOCK) (\r
+  IN EFI_SMM_ACCESS_PROTOCOL         *This,\r
+  UINTN                              DescriptorIndex\r
+  );\r
+\r
+/**\r
+  Queries the memory controller for the possible regions that will support SMRAM.\r
+\r
+  @param  This                  The EFI_SMM_ACCESS_PROTOCOL instance.\r
+  @param  SmramMapSize          A pointer to the size, in bytes, of the SmramMemoryMap buffer.\r
+  @param  SmramMap              A pointer to the buffer in which firmware places the current memory map.\r
+\r
+  @retval EFI_SUCCESS           The chipset supported the given resource.\r
+  @retval EFI_BUFFER_TOO_SMALL  The SmramMap parameter was too small.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_SMM_CAPABILITIES) (\r
+  IN EFI_SMM_ACCESS_PROTOCOL             *This,\r
+  IN OUT UINTN                           *SmramMapSize,\r
+  IN OUT EFI_SMRAM_DESCRIPTOR            *SmramMap\r
+  );\r
+\r
+/**\r
+  @par Protocol Description:\r
+  This protocol is used to control the visibility of the SMRAM on the platform.\r
+\r
+  @param Open\r
+  Opens the SMRAM.\r
+\r
+  @param Close\r
+  Closes the SMRAM.\r
+\r
+  @param Lock\r
+  Locks the SMRAM.\r
+\r
+  @param GetCapabilities\r
+  Gets information on possible SMRAM regions.\r
+\r
+  @param LockState\r
+Indicates the current state of the SMRAM. Set to TRUE if any region is locked.\r
+\r
+  @param OpenState\r
+Indicates the current state of the SMRAM. Set to TRUE if any region is open.\r
+\r
+**/\r
+struct _EFI_SMM_ACCESS_PROTOCOL {\r
+  EFI_SMM_OPEN          Open;\r
+  EFI_SMM_CLOSE         Close;\r
+  EFI_SMM_LOCK          Lock;\r
+  EFI_SMM_CAPABILITIES  GetCapabilities;\r
+  BOOLEAN               LockState;\r
+  BOOLEAN               OpenState;\r
+};\r
+\r
+extern EFI_GUID gEfiSmmAccessProtocolGuid;\r
+\r
+#endif\r
diff --git a/IntelFrameworkPkg/Include/Protocol/SmmBase.h b/IntelFrameworkPkg/Include/Protocol/SmmBase.h
new file mode 100644 (file)
index 0000000..be21473
--- /dev/null
@@ -0,0 +1,308 @@
+/** @file\r
+  This file declares SMM Base abstraction protocol.\r
+  This is the base level of compatiblity for SMM drivers.\r
+\r
+  Copyright (c) 2007, Intel Corporation\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+  Module Name:  SmmBase.h\r
+\r
+  @par Revision Reference:\r
+  This Protocol is defined in Framework of EFI SMM Core Interface Spec\r
+  Version 0.9.\r
+\r
+**/\r
+\r
+#ifndef _SMM_BASE_H_\r
+#define _SMM_BASE_H_\r
+\r
+#define EFI_SMM_BASE_PROTOCOL_GUID \\r
+  { \\r
+    0x1390954D, 0xda95, 0x4227, {0x93, 0x28, 0x72, 0x82, 0xc2, 0x17, 0xda, 0xa8 } \\r
+  }\r
+\r
+typedef struct _EFI_SMM_BASE_PROTOCOL             EFI_SMM_BASE_PROTOCOL;\r
+\r
+//\r
+// SMM Handler Definition\r
+//\r
+#define EFI_HANDLER_SUCCESS         0x0000\r
+#define EFI_HANDLER_CRITICAL_EXIT   0x0001\r
+#define EFI_HANDLER_SOURCE_QUIESCED 0x0002\r
+#define EFI_HANDLER_SOURCE_PENDING  0x0003\r
+\r
+/**\r
+  Entry Point to Callback service\r
+\r
+  @param  SmmImageHandle        A handle allocated by the SMM infrastructure code\r
+                                to uniquely designate a specific DXE SMM driver.\r
+  @param  CommunicationBuffer   A pointer to a collection of data in memory\r
+                                that will be conveyed from a non-SMM environment into an SMM environment.\r
+                                The buffer must be contiguous, physically mapped, and be a physical address.\r
+  @param  SourceSize            The size of the CommunicationBuffer.\r
+\r
+  @return Status code\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_SMM_CALLBACK_ENTRY_POINT) (\r
+  IN EFI_HANDLE             SmmImageHandle,\r
+  IN OUT VOID               *CommunicationBuffer OPTIONAL,\r
+  IN OUT UINTN              *SourceSize OPTIONAL\r
+  );\r
+\r
+//\r
+// SMM Base Protocol Definition\r
+//\r
+/**\r
+  Register a given driver into SMRAM.This is the equivalent of performing\r
+  the LoadImage/StartImage into System Management Mode.\r
+\r
+  @param  This                  Protocol instance pointer.\r
+  @param  FilePath              Location of the image to be installed as the handler.\r
+  @param  SourceBuffer          Optional source buffer in case of the image file\r
+                                being in memory.\r
+  @param  SourceSize            Size of the source image file, if in memory.\r
+  @param  ImageHandle           Pointer to the handle that reflects the driver\r
+                                loaded into SMM.\r
+  @param  LegacyIA32Binary      The binary image to load is legacy 16 bit code.\r
+\r
+  @retval EFI_SUCCESS           The operation was successful.\r
+  @retval EFI_OUT_OF_RESOURCES  There were no additional SMRAM resources to load the handler\r
+  @retval EFI_UNSUPPORTED       This platform does not support 16-bit handlers.\r
+  @retval EFI_UNSUPPORTED       In runtime.\r
+  @retval EFI_INVALID_PARAMETER The handlers was not the correct image type\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_SMM_REGISTER_HANDLER) (\r
+  IN EFI_SMM_BASE_PROTOCOL                           *This,\r
+  IN  EFI_DEVICE_PATH_PROTOCOL                       *FilePath,\r
+  IN  VOID                                           *SourceBuffer OPTIONAL,\r
+  IN  UINTN                                          SourceSize,\r
+  OUT EFI_HANDLE                                     *ImageHandle,\r
+  IN  BOOLEAN                                        LegacyIA32Binary OPTIONAL\r
+  )\r
+;\r
+\r
+/**\r
+  Remove a given driver SMRAM.  This is the equivalent of performing\r
+  the UnloadImage System Management Mode.\r
+\r
+  @param  This                  Protocol instance pointer.\r
+  @param  ImageHandle           Pointer to the handle that reflects the driver\r
+                                loaded into SMM.\r
+\r
+  @retval EFI_SUCCESS           The operation was successful\r
+  @retval EFI_INVALID_PARAMETER The handler did not exist\r
+  @retval EFI_UNSUPPORTED       In runtime.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_SMM_UNREGISTER_HANDLER) (\r
+  IN EFI_SMM_BASE_PROTOCOL          *This,\r
+  IN EFI_HANDLE                     ImageHandle\r
+  )\r
+;\r
+\r
+/**\r
+  The SMM Inter-module Communicate Service Communicate() function\r
+  provides a services to send/received messages from a registered\r
+  EFI service.  The BASE protocol driver is responsible for doing\r
+  any of the copies such that the data lives in boot-service accessible RAM.\r
+\r
+  @param  This                  Protocol instance pointer.\r
+  @param  ImageHandle           Pointer to the handle that reflects the driver\r
+                                loaded into SMM.\r
+  @param  CommunicationBuffer   Pointer to the buffer to convey into SMRAM.\r
+  @param  SourceSize            Size of the contents of buffer..\r
+\r
+  @retval EFI_SUCCESS           The message was successfully posted\r
+  @retval EFI_INVALID_PARAMETER The buffer was NULL\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_SMM_COMMUNICATE) (\r
+  IN EFI_SMM_BASE_PROTOCOL          *This,\r
+  IN EFI_HANDLE                     ImageHandle,\r
+  IN OUT VOID                       *CommunicationBuffer,\r
+  IN OUT UINTN                      *SourceSize\r
+  )\r
+;\r
+\r
+/**\r
+  Register a callback to execute within SMM.\r
+  This allows receipt of messages created with the Boot Service COMMUNICATE.\r
+\r
+  @param  This                  Protocol instance pointer.\r
+  @param  CallbackAddress       Address of the callback service\r
+  @param  MakeFirst             If present, will stipulate that the handler is posted\r
+                                to be the first module executed in the dispatch table.\r
+  @param  MakeLast              If present, will stipulate that the handler is posted\r
+                                to be last executed in the dispatch table.\r
+  @param  FloatingPointSave     This is an optional parameter which informs the\r
+                                EFI_SMM_ACCESS_PROTOCOL Driver core if it needs to save\r
+                                the floating point register state. If any of the handlers\r
+                                require this, then the state will be saved for all of the handlers.\r
+\r
+  @retval EFI_SUCCESS           The operation was successful\r
+  @retval EFI_OUT_OF_RESOURCES  Not enough space in the dispatch queue\r
+  @retval EFI_UNSUPPORTED       In runtime.\r
+  @retval EFI_UNSUPPORTED       Not in SMM.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_SMM_CALLBACK_SERVICE) (\r
+  IN EFI_SMM_BASE_PROTOCOL                            *This,\r
+  IN EFI_HANDLE                                       SmmImageHandle,\r
+  IN EFI_SMM_CALLBACK_ENTRY_POINT                     CallbackAddress,\r
+  IN BOOLEAN                                          MakeLast OPTIONAL,\r
+  IN BOOLEAN                                          FloatingPointSave OPTIONAL\r
+  )\r
+;\r
+\r
+/**\r
+  The SmmAllocatePool() function allocates a memory region of Size bytes from memory of\r
+  type PoolType and returns the address of the allocated memory in the location referenced\r
+  by Buffer.  This function allocates pages from EFI SMRAM Memory as needed to grow the\r
+  requested pool type.  All allocations are eight-byte aligned.\r
+\r
+  @param  This                  Protocol instance pointer.\r
+  @param  PoolType              The type of pool to allocate.\r
+                                The only supported type is EfiRuntimeServicesData;\r
+                                the interface will internally map this runtime request to SMRAM.\r
+  @param  Size                  The number of bytes to allocate from the pool.\r
+  @param  Buffer                A pointer to a pointer to the allocated buffer if the call\r
+                                succeeds; undefined otherwise.\r
+\r
+  @retval EFI_SUCCESS           The requested number of bytes was allocated.\r
+  @retval EFI_OUT_OF_RESOURCES  The pool requested could not be allocated.\r
+  @retval EFI_INVALID_PARAMETER PoolType was invalid.\r
+  @retval EFI_UNSUPPORTED       In runtime.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_SMM_ALLOCATE_POOL) (\r
+  IN EFI_SMM_BASE_PROTOCOL          *This,\r
+  IN EFI_MEMORY_TYPE                PoolType,\r
+  IN UINTN                          Size,\r
+  OUT VOID                          **Buffer\r
+  )\r
+;\r
+\r
+/**\r
+  The SmmFreePool() function returns the memory specified by Buffer to the system.\r
+  On return, the memory's type is EFI SMRAM Memory.  The Buffer that is freed must\r
+  have been allocated by SmmAllocatePool().\r
+\r
+  @param  This                  Protocol instance pointer.\r
+  @param  Buffer                Pointer to the buffer allocation.\r
+\r
+  @retval EFI_SUCCESS           The memory was returned to the system.\r
+  @retval EFI_INVALID_PARAMETER Buffer was invalid.\r
+  @retval EFI_UNSUPPORTED       In runtime.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_SMM_FREE_POOL) (\r
+  IN EFI_SMM_BASE_PROTOCOL          *This,\r
+  IN VOID                           *Buffer\r
+  )\r
+;\r
+\r
+/**\r
+  This routine tells caller if execution context is SMM or not.\r
+\r
+  @param  This                  Protocol instance pointer.\r
+  @param  InSmm                 Whether the caller is inside SMM for IA-32 or servicing a PMI for the Itanium processor family.\r
+\r
+  @retval EFI_SUCCESS           The operation was successful\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_SMM_INSIDE_OUT) (\r
+  IN EFI_SMM_BASE_PROTOCOL          *This,\r
+  OUT BOOLEAN                       *InSmm\r
+  )\r
+;\r
+\r
+/**\r
+  The GetSmstLocation() function returns the locatin of the System Management\r
+  Service Table.  The use of the API is such that a driver can discover the\r
+  location of the SMST in its entry point and then cache it in some driver\r
+  global variable so that the SMST can be invoked in subsequent callbacks.\r
+\r
+  @param  This                  Protocol instance pointer.\r
+  @param  Smst                  Pointer to the SMST.\r
+\r
+  @retval EFI_SUCCESS           The operation was successful\r
+  @retval EFI_INVALID_PARAMETER Smst was invalid.\r
+  @retval EFI_UNSUPPORTED       Not in SMM.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_SMM_GET_SMST_LOCATION) (\r
+  IN EFI_SMM_BASE_PROTOCOL          *This,\r
+  IN OUT EFI_SMM_SYSTEM_TABLE       **Smst\r
+  )\r
+;\r
+\r
+/**\r
+  @par Protocol Description:\r
+  This protocol is used to install SMM handlers for support of subsequent SMI/PMI\r
+  activations. This protocol is available on both IA-32 and Itanium-based systems.\r
+\r
+  @param Register\r
+  Registers a handler to run in System Management RAM (SMRAM).\r
+\r
+  @param UnRegister\r
+  Removes a handler from execution in SMRAM.\r
+\r
+  @param Communicate\r
+  Sends/receives a message for a registered handler.\r
+\r
+  @param RegisterCallback\r
+  Registers a callback from the constructor.\r
+\r
+  @param InSmm\r
+  Detects whether the caller is inside or outside of SMM. SName\r
+\r
+  @param SmmAllocatePool\r
+  Allocates SMRAM.\r
+\r
+  @param SmmFreePool\r
+  Deallocates SMRAM.\r
+\r
+  @param GetSmstLocation\r
+  Retrieves the location of the System Management System Table (SMST).\r
+\r
+**/\r
+struct _EFI_SMM_BASE_PROTOCOL {\r
+  EFI_SMM_REGISTER_HANDLER    Register;\r
+  EFI_SMM_UNREGISTER_HANDLER  UnRegister;\r
+  EFI_SMM_COMMUNICATE         Communicate;\r
+  EFI_SMM_CALLBACK_SERVICE    RegisterCallback;\r
+  EFI_SMM_INSIDE_OUT          InSmm;\r
+  EFI_SMM_ALLOCATE_POOL       SmmAllocatePool;\r
+  EFI_SMM_FREE_POOL           SmmFreePool;\r
+  EFI_SMM_GET_SMST_LOCATION   GetSmstLocation;\r
+};\r
+\r
+extern EFI_GUID gEfiSmmBaseProtocolGuid;\r
+\r
+#endif\r
diff --git a/IntelFrameworkPkg/Include/Protocol/SmmControl.h b/IntelFrameworkPkg/Include/Protocol/SmmControl.h
new file mode 100644 (file)
index 0000000..51bc5bf
--- /dev/null
@@ -0,0 +1,128 @@
+/** @file\r
+  This file declares SMM Control abstraction protocol.\r
+\r
+  Copyright (c) 2007, Intel Corporation\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+  Module Name:  SmmControl.h\r
+\r
+  @par Revision Reference:\r
+  This Protocol is defined in Framework of EFI SMM Core Interface Spec\r
+  Version 0.9.\r
+\r
+**/\r
+\r
+#ifndef _SMM_CONTROL_H_\r
+#define _SMM_CONTROL_H_\r
+\r
+typedef struct _EFI_SMM_CONTROL_PROTOCOL              EFI_SMM_CONTROL_PROTOCOL;\r
+\r
+#define EFI_SMM_CONTROL_PROTOCOL_GUID \\r
+  { \\r
+    0x8d12e231, 0xc667, 0x4fd1, {0x98, 0xf2, 0x24, 0x49, 0xa7, 0xe7, 0xb2, 0xe5 } \\r
+  }\r
+\r
+// SMM Access specification Data Structures\r
+//\r
+typedef struct {\r
+  UINT8 SmiTriggerRegister;\r
+  UINT8 SmiDataRegister;\r
+} EFI_SMM_CONTROL_REGISTER;\r
+\r
+//\r
+// SMM Control specification member function\r
+//\r
+/**\r
+  Invokes SMI activation from either the preboot or runtime environment.\r
+\r
+  @param  This                  The EFI_SMM_CONTROL_PROTOCOL instance.\r
+  @param  ArgumentBuffer        Optional sized data to pass into the protocol activation.\r
+  @param  ArgumentBufferSize    Optional size of the data.\r
+  @param  Periodic              Optional mechanism to engender a periodic stream.\r
+  @param  ActivationInterval    Optional parameter to repeat at this period one\r
+                                time or, if the Periodic Boolean is set, periodically.\r
+\r
+  @retval EFI_SUCCESS           The SMI/PMI has been engendered.\r
+  @retval EFI_DEVICE_ERROR      The timing is unsupported.\r
+  @retval EFI_INVALID_PARAMETER The activation period is unsupported.\r
+  @retval EFI_NOT_STARTED       The SMM base service has not been initialized.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_SMM_ACTIVATE) (\r
+  IN EFI_SMM_CONTROL_PROTOCOL                             *This,\r
+  IN OUT INT8                                             *ArgumentBuffer OPTIONAL,\r
+  IN OUT UINTN                                            *ArgumentBufferSize OPTIONAL,\r
+  IN BOOLEAN                                              Periodic OPTIONAL,\r
+  IN UINTN                                                ActivationInterval OPTIONAL\r
+  );\r
+\r
+/**\r
+  Clears any system state that was created in response to the Active call.\r
+\r
+  @param  This                  The EFI_SMM_CONTROL_PROTOCOL instance.\r
+  @param  Periodic              Optional parameter to repeat at this period one time\r
+\r
+  @retval EFI_SUCCESS           The SMI/PMI has been engendered.\r
+  @retval EFI_DEVICE_ERROR      The source could not be cleared.\r
+  @retval EFI_INVALID_PARAMETER The service did not support the Periodic input argument.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_SMM_DEACTIVATE) (\r
+  IN EFI_SMM_CONTROL_PROTOCOL                   *This,\r
+  IN BOOLEAN                                    Periodic OPTIONAL\r
+  );\r
+\r
+/**\r
+  Provides information on the source register used to generate the SMI.\r
+\r
+  @param  This                  The EFI_SMM_CONTROL_PROTOCOL instance.\r
+  @param  SmiRegister           Pointer to the SMI register description structure\r
+\r
+  @retval EFI_SUCCESS           The register structure has been returned.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_SMM_GET_REGISTER_INFO) (\r
+  IN EFI_SMM_CONTROL_PROTOCOL           *This,\r
+  IN OUT EFI_SMM_CONTROL_REGISTER       *SmiRegister\r
+  );\r
+\r
+/**\r
+  @par Protocol Description:\r
+  This protocol is used initiate SMI/PMI activations.\r
+\r
+  @param Trigger\r
+  Initiates the SMI/PMI activation.\r
+\r
+  @param Clear\r
+  Quiesces the SMI/PMI activation.\r
+\r
+  @param GetRegisterInfo\r
+  Provides data on the register used as the source of the SMI.\r
+\r
+  @param MinimumTriggerPeriod\r
+  Minimum interval at which the platform can set the period.\r
+\r
+**/\r
+\r
+struct _EFI_SMM_CONTROL_PROTOCOL {\r
+  EFI_SMM_ACTIVATE          Trigger;\r
+  EFI_SMM_DEACTIVATE        Clear;\r
+  EFI_SMM_GET_REGISTER_INFO GetRegisterInfo;\r
+  UINTN                     MinimumTriggerPeriod;\r
+};\r
+\r
+extern EFI_GUID gEfiSmmControlProtocolGuid;\r
+\r
+#endif\r
diff --git a/IntelFrameworkPkg/Include/Protocol/SmmGpiDispatch.h b/IntelFrameworkPkg/Include/Protocol/SmmGpiDispatch.h
new file mode 100644 (file)
index 0000000..7454bcc
--- /dev/null
@@ -0,0 +1,149 @@
+/** @file\r
+  This file declares Smm Gpi Smi Child Protocol\r
+\r
+  Copyright (c) 2007, Intel Corporation\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+  Module Name:  SmmGpiDispatch.h\r
+\r
+  @par Revision Reference:\r
+  This Protocol is defined in Framework of EFI SMM Core Interface Spec\r
+  Version 0.9.\r
+\r
+**/\r
+\r
+#ifndef _EFI_SMM_GPI_DISPATCH_H_\r
+#define _EFI_SMM_GPI_DISPATCH_H_\r
+\r
+//\r
+// Global ID for the GPI SMI Protocol\r
+//\r
+#define EFI_SMM_GPI_DISPATCH_PROTOCOL_GUID \\r
+  { \\r
+    0xe0744b81, 0x9513, 0x49cd, {0x8c, 0xea, 0xe9, 0x24, 0x5e, 0x70, 0x39, 0xda } \\r
+  }\r
+\r
+typedef struct _EFI_SMM_GPI_DISPATCH_PROTOCOL  EFI_SMM_GPI_DISPATCH_PROTOCOL;\r
+\r
+//\r
+// Related Definitions\r
+//\r
+//\r
+// GpiMask is a bit mask of 32 possible general purpose inputs that can generate a\r
+// a SMI.  Bit 0 corresponds to logical GPI[0], 1 corresponds to logical GPI[1], etc.\r
+//\r
+// The logical GPI index to physical pin on device is described by the GPI device name\r
+// found on the same handle as the GpiSmi child dispatch protocol.  The GPI device name\r
+// is defined as protocol with a GUID name and NULL protocol pointer.\r
+//\r
+typedef struct {\r
+  UINTN GpiNum;\r
+} EFI_SMM_GPI_DISPATCH_CONTEXT;\r
+\r
+//\r
+// Member functions\r
+//\r
+/**\r
+  Dispatch function for a GPI SMI handler.\r
+\r
+  @param  DispatchHandle        Handle of this dispatch function.\r
+  @param  DispatchContext       Pointer to the dispatch function's context.\r
+                                The DispatchContext fields are filled in by the dispatching driver prior to\r
+                                invoking this dispatch function.\r
+\r
+  @return None\r
+\r
+**/\r
+typedef\r
+VOID\r
+(EFIAPI *EFI_SMM_GPI_DISPATCH) (\r
+  IN  EFI_HANDLE                    DispatchHandle,\r
+  IN  EFI_SMM_GPI_DISPATCH_CONTEXT  *DispatchContext\r
+  );\r
+\r
+/**\r
+  Register a child SMI source dispatch function with a parent SMM driver\r
+\r
+  @param  This                  Protocol instance pointer.\r
+  @param  DispatchFunction      Pointer to dispatch function to be invoked for\r
+                                this SMI source\r
+  @param  DispatchContext       Pointer to the dispatch function's context.\r
+                                The caller fills this context in before calling\r
+                                the register function to indicate to the register\r
+                                function the GPI(s) for which the dispatch function\r
+                                should be invoked.\r
+  @param  DispatchHandle        Handle of dispatch function, for when interfacing\r
+                                with the parent Sx state SMM driver.\r
+\r
+  @retval EFI_SUCCESS           The dispatch function has been successfully\r
+                                registered and the SMI source has been enabled.\r
+  @retval EFI_DEVICE_ERROR      The driver was unable to enable the SMI source.\r
+  @retval EFI_OUT_OF_RESOURCES  Not enough memory (system or SMM) to manage this\r
+                                child.\r
+  @retval EFI_INVALID_PARAMETER DispatchContext is invalid. The GPI input value\r
+                                is not within valid range.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_SMM_GPI_REGISTER) (\r
+  IN EFI_SMM_GPI_DISPATCH_PROTOCOL            *This,\r
+  IN  EFI_SMM_GPI_DISPATCH                    DispatchFunction,\r
+  IN  EFI_SMM_GPI_DISPATCH_CONTEXT            *DispatchContext,\r
+  OUT EFI_HANDLE                              *DispatchHandle\r
+  );\r
+\r
+/**\r
+  Unregister a child SMI source dispatch function with a parent SMM driver\r
+\r
+  @param  This                  Protocol instance pointer.\r
+  @param  DispatchHandle        Handle of dispatch function to deregister.\r
+\r
+  @retval EFI_SUCCESS           The dispatch function has been successfully\r
+                                unregistered and the SMI source has been disabled\r
+                                if there are no other registered child dispatch\r
+                                functions for this SMI source.\r
+  @retval EFI_INVALID_PARAMETER Handle is invalid.\r
+  @retval other                 TBD\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_SMM_GPI_UNREGISTER) (\r
+  IN EFI_SMM_GPI_DISPATCH_PROTOCOL            *This,\r
+  IN  EFI_HANDLE                              DispatchHandle\r
+  );\r
+\r
+//\r
+// Interface structure for the SMM GPI SMI Dispatch Protocol\r
+//\r
+/**\r
+  @par Protocol Description:\r
+  Provides the parent dispatch service for the General Purpose Input\r
+  (GPI) SMI source generator.\r
+\r
+  @param Register\r
+  Installs a child service to be dispatched by this protocol.\r
+\r
+  @param UnRegister\r
+  Removes a child service dispatched by this protocol.\r
+\r
+  @param NumSupportedGpis\r
+  Denotes the maximum value of inputs that can have handlers attached.\r
+\r
+**/\r
+struct _EFI_SMM_GPI_DISPATCH_PROTOCOL {\r
+  EFI_SMM_GPI_REGISTER    Register;\r
+  EFI_SMM_GPI_UNREGISTER  UnRegister;\r
+  UINTN                   NumSupportedGpis;\r
+};\r
+\r
+extern EFI_GUID gEfiSmmGpiDispatchProtocolGuid;\r
+\r
+#endif\r
diff --git a/IntelFrameworkPkg/Include/Protocol/SmmIchnDispatch.h b/IntelFrameworkPkg/Include/Protocol/SmmIchnDispatch.h
new file mode 100644 (file)
index 0000000..34185e8
--- /dev/null
@@ -0,0 +1,193 @@
+/** @file\r
+  This file declares EFI Smm ICH [N] Specific Smi Child Protocol\r
+\r
+  Copyright (c) 2007, Intel Corporation\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+  Module Name:  SmmIchnDispatch.h\r
+\r
+  @par Revision Reference:\r
+  This Protocol is defined in Framework of EFI SMM Core Interface Spec\r
+  Version 0.9.\r
+\r
+**/\r
+\r
+#ifndef _EFI_SMM_ICHN_DISPATCH_H_\r
+#define _EFI_SMM_ICHN_DISPATCH_H_\r
+\r
+//\r
+// Global ID for the ICH SMI Protocol\r
+//\r
+#define EFI_SMM_ICHN_DISPATCH_PROTOCOL_GUID \\r
+  { \\r
+    0xc50b323e, 0x9075, 0x4f2a, {0xac, 0x8e, 0xd2, 0x59, 0x6a, 0x10, 0x85, 0xcc } \\r
+  }\r
+\r
+typedef struct _EFI_SMM_ICHN_DISPATCH_PROTOCOL  EFI_SMM_ICHN_DISPATCH_PROTOCOL;\r
+\r
+//\r
+// Related Definitions\r
+//\r
+//\r
+// ICHN Specific SMIs.  These are miscellaneous SMI sources that are supported by the\r
+// ICHN specific SMI implementation.  These may change over time.  TrapNumber is only\r
+// valid if the Type is Trap.\r
+//\r
+typedef enum {\r
+  //\r
+  // NOTE: NEVER delete items from this list/enumeration!  Doing so will prevent other versions\r
+  // of the code from compiling.  If the ICH version your driver is written for doesn't support\r
+  // some of these SMIs, then simply return EFI_UNSUPPORTED when a child/client tries to register\r
+  // for them.\r
+  //\r
+  IchnMch,\r
+  IchnPme,\r
+  IchnRtcAlarm,\r
+  IchnRingIndicate,\r
+  IchnAc97Wake,\r
+  IchnSerialIrq,\r
+  IchnY2KRollover,\r
+  IchnTcoTimeout,\r
+  IchnOsTco,\r
+  IchnNmi,\r
+  IchnIntruderDetect,\r
+  IchnBiosWp,\r
+  IchnMcSmi,\r
+  IchnPmeB0,\r
+  IchnThrmSts,\r
+  IchnSmBus,\r
+  IchnIntelUsb2,\r
+  IchnMonSmi7,\r
+  IchnMonSmi6,\r
+  IchnMonSmi5,\r
+  IchnMonSmi4,\r
+  IchnDevTrap13,\r
+  IchnDevTrap12,\r
+  IchnDevTrap11,\r
+  IchnDevTrap10,\r
+  IchnDevTrap9,\r
+  IchnDevTrap8,\r
+  IchnDevTrap7,\r
+  IchnDevTrap6,\r
+  IchnDevTrap5,\r
+  IchnDevTrap3,\r
+  IchnDevTrap2,\r
+  IchnDevTrap1,\r
+  IchnDevTrap0,\r
+  IchnIoTrap3,\r
+  IchnIoTrap2,\r
+  IchnIoTrap1,\r
+  IchnIoTrap0,\r
+  //\r
+  // INSERT NEW ITEMS JUST BEFORE THIS LINE\r
+  //\r
+  NUM_ICHN_TYPES  // the number of items in this enumeration\r
+} EFI_SMM_ICHN_SMI_TYPE;\r
+\r
+typedef struct {\r
+  EFI_SMM_ICHN_SMI_TYPE Type;\r
+} EFI_SMM_ICHN_DISPATCH_CONTEXT;\r
+\r
+//\r
+// Member functions\r
+//\r
+/**\r
+  Dispatch function for a ICH n specific SMI handler.\r
+\r
+  @param  DispatchHandle        Handle of this dispatch function.\r
+  @param  DispatchContext       Pointer to the dispatch function's context.\r
+                                The DispatchContext fields are filled in\r
+                                by the dispatching driver prior to\r
+                                invoking this dispatch function.\r
+\r
+  Nothing\r
+\r
+**/\r
+typedef\r
+VOID\r
+(EFIAPI *EFI_SMM_ICHN_DISPATCH) (\r
+  IN  EFI_HANDLE                      DispatchHandle,\r
+  IN  EFI_SMM_ICHN_DISPATCH_CONTEXT   *DispatchContext\r
+  );\r
+\r
+/**\r
+  Register a child SMI source dispatch function with a parent SMM driver\r
+\r
+  @param  This                  Protocol instance pointer.\r
+  @param  DispatchFunction      Pointer to dispatch function to be invoked for\r
+                                this SMI source\r
+  @param  DispatchContext       Pointer to the dispatch function's context.\r
+                                The caller fills this context in before calling\r
+                                the register function to indicate to the register\r
+                                function the ICHN SMI source for which the dispatch\r
+                                function should be invoked.\r
+  @param  DispatchHandle        Handle of dispatch function, for when interfacing\r
+                                with the parent Sx state SMM driver.\r
+\r
+  @retval EFI_SUCCESS           The dispatch function has been successfully\r
+                                registered and the SMI source has been enabled.\r
+  @retval EFI_DEVICE_ERROR      The driver was unable to enable the SMI source.\r
+  @retval EFI_OUT_OF_RESOURCES  Not enough memory (system or SMM) to manage this\r
+                                child.\r
+  @retval EFI_INVALID_PARAMETER DispatchContext is invalid. The ICHN input value\r
+                                is not within valid range.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_SMM_ICHN_REGISTER) (\r
+  IN EFI_SMM_ICHN_DISPATCH_PROTOCOL             *This,\r
+  IN  EFI_SMM_ICHN_DISPATCH                     DispatchFunction,\r
+  IN  EFI_SMM_ICHN_DISPATCH_CONTEXT             *DispatchContext,\r
+  OUT EFI_HANDLE                                *DispatchHandle\r
+  );\r
+\r
+/**\r
+  Unregister a child SMI source dispatch function with a parent SMM driver\r
+\r
+  @param  This                  Protocol instance pointer.\r
+  @param  DispatchHandle        Handle of dispatch function to deregister.\r
+\r
+  @retval EFI_SUCCESS           The dispatch function has been successfully\r
+                                unregistered and the SMI source has been disabled\r
+                                if there are no other registered child dispatch\r
+                                functions for this SMI source.\r
+  @retval EFI_INVALID_PARAMETER Handle is invalid.\r
+  @retval other                 TBD\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_SMM_ICHN_UNREGISTER) (\r
+  IN EFI_SMM_ICHN_DISPATCH_PROTOCOL             *This,\r
+  IN  EFI_HANDLE                                DispatchHandle\r
+  );\r
+\r
+//\r
+// Interface structure for the SMM Ich n specific SMI Dispatch Protocol\r
+//\r
+/**\r
+  @par Protocol Description:\r
+  Provides the parent dispatch service for a given SMI source generator.\r
+\r
+  @param Register\r
+  Installs a child service to be dispatched by this protocol.\r
+\r
+  @param UnRegister\r
+  Removes a child service dispatched by this protocol.\r
+\r
+**/\r
+struct _EFI_SMM_ICHN_DISPATCH_PROTOCOL {\r
+  EFI_SMM_ICHN_REGISTER   Register;\r
+  EFI_SMM_ICHN_UNREGISTER UnRegister;\r
+};\r
+\r
+extern EFI_GUID gEfiSmmIchnDispatchProtocolGuid;\r
+\r
+#endif\r
diff --git a/IntelFrameworkPkg/Include/Protocol/SmmPeriodicTimerDispatch.h b/IntelFrameworkPkg/Include/Protocol/SmmPeriodicTimerDispatch.h
new file mode 100644 (file)
index 0000000..1f343a8
--- /dev/null
@@ -0,0 +1,194 @@
+/** @file\r
+  This file declares EFI Smm Periodic Timer Smi Child Protocol\r
+\r
+  Copyright (c) 2007, Intel Corporation\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+  Module Name:  SmmPeriodicTimerDispatch.h\r
+\r
+  @par Revision Reference:\r
+  This Protocol is defined in Framework of EFI SMM Core Interface Spec\r
+  Version 0.9.\r
+\r
+**/\r
+\r
+#ifndef _EFI_SMM_PERIODIC_TIMER_DISPATCH_H_\r
+#define _EFI_SMM_PERIODIC_TIMER_DISPATCH_H_\r
+\r
+//\r
+// Global ID for the Periodic Timer SMI Protocol\r
+//\r
+#define EFI_SMM_PERIODIC_TIMER_DISPATCH_PROTOCOL_GUID \\r
+  { \\r
+    0x9cca03fc, 0x4c9e, 0x4a19, {0x9b, 0x6, 0xed, 0x7b, 0x47, 0x9b, 0xde, 0x55 } \\r
+  }\r
+\r
+typedef struct _EFI_SMM_PERIODIC_TIMER_DISPATCH_PROTOCOL  EFI_SMM_PERIODIC_TIMER_DISPATCH_PROTOCOL;\r
+\r
+//\r
+// Related Definitions\r
+//\r
+//\r
+// Period is the minimum period of time in 100 nanosecond units that child gets called.\r
+// The child will be called back after a time greater than the time Period.\r
+//\r
+// SmiTickInterval is the period of time interval between SMIs.  Children of this interface\r
+// should use this field when registering for periodic timer intervals when a finer\r
+// granularity periodic SMI is desired.  Valid values for this field are those returned\r
+// by GetNextInterval.  A value of 0 indicates the parent is allowed to use any SMI\r
+// interval period to satisfy the requested period.\r
+//    Example: A chipset supports periodic SMIs on every 64ms or 2 seconds.\r
+//      A child wishes schedule a period SMI to fire on a period of 3 seconds, there\r
+//      are several ways to approach the problem:\r
+//      1. The child may accept a 4 second periodic rate, in which case it registers with\r
+//           Period = 40000\r
+//           SmiTickInterval = 20000\r
+//         The resulting SMI will occur every 2 seconds with the child called back on\r
+//         every 2nd SMI.\r
+//         NOTE: the same result would occur if the child set SmiTickInterval = 0.\r
+//      2. The child may choose the finer granularity SMI (64ms):\r
+//           Period = 30000\r
+//           SmiTickInterval = 640\r
+//         The resulting SMI will occur every 64ms with the child called back on\r
+//         every 47th SMI.\r
+//         NOTE: the child driver should be aware that this will result in more\r
+//           SMIs occuring during system runtime which can negatively impact system\r
+//           performance.\r
+//\r
+// ElapsedTime is the actual time in 100 nanosecond units elapsed since last called, a\r
+// value of 0 indicates an unknown amount of time.\r
+//\r
+typedef struct {\r
+  UINT64  Period;\r
+  UINT64  SmiTickInterval;\r
+  UINT64  ElapsedTime;\r
+} EFI_SMM_PERIODIC_TIMER_DISPATCH_CONTEXT;\r
+\r
+//\r
+// Member functions\r
+//\r
+/**\r
+  Dispatch function for a Periodic Timer SMI handler.\r
+\r
+  @param  DispatchHandle        Handle of this dispatch function.\r
+  @param  DispatchContext       Pointer to the dispatch function's context.\r
+                                The DispatchContext fields are filled in\r
+                                by the dispatching driver prior to\r
+                                invoking this dispatch function.\r
+\r
+  Nothing\r
+\r
+**/\r
+typedef\r
+VOID\r
+(EFIAPI *EFI_SMM_PERIODIC_TIMER_DISPATCH) (\r
+  IN  EFI_HANDLE                                DispatchHandle,\r
+  IN  EFI_SMM_PERIODIC_TIMER_DISPATCH_CONTEXT   *DispatchContext\r
+  );\r
+\r
+/**\r
+  Returns the next SMI tick period supported by the chipset.  The order\r
+  returned is from longest to shortest interval period.\r
+\r
+  @param  This                  Protocol instance pointer.\r
+  @param  SmiTickInterval       Pointer to pointer of next shorter SMI interval\r
+                                period supported by the child. This parameter works as a get-first,\r
+                                get-next field.The first time this function is called, *SmiTickInterval\r
+                                should be set to NULL to get the longest SMI interval.The returned\r
+                                *SmiTickInterval should be passed in on subsequent calls to get the\r
+                                next shorter interval period until *SmiTickInterval = NULL.\r
+\r
+  @retval EFI_SUCCESS           The service returned successfully.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_SMM_PERIODIC_TIMER_INTERVAL) (\r
+  IN EFI_SMM_PERIODIC_TIMER_DISPATCH_PROTOCOL           *This,\r
+  IN OUT UINT64                                         **SmiTickInterval\r
+  );\r
+\r
+/**\r
+  Register a child SMI source dispatch function with a parent SMM driver\r
+\r
+  @param  This                  Protocol instance pointer.\r
+  @param  DispatchFunction      Pointer to dispatch function to be invoked for\r
+                                this SMI source\r
+  @param  DispatchContext       Pointer to the dispatch function's context.\r
+                                The caller fills this context in before calling\r
+                                the register function to indicate to the register\r
+                                function the period at which the dispatch function\r
+                                should be invoked.\r
+  @param  DispatchHandle        Handle of dispatch function, for when interfacing\r
+                                with the parent Sx state SMM driver.\r
+\r
+  @retval EFI_SUCCESS           The dispatch function has been successfully\r
+                                registered and the SMI source has been enabled.\r
+  @retval EFI_DEVICE_ERROR      The driver was unable to enable the SMI source.\r
+  @retval EFI_OUT_OF_RESOURCES  Not enough memory (system or SMM) to manage this\r
+                                child.\r
+  @retval EFI_INVALID_PARAMETER DispatchContext is invalid. The period input value\r
+                                is not within valid range.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_SMM_PERIODIC_TIMER_REGISTER) (\r
+  IN EFI_SMM_PERIODIC_TIMER_DISPATCH_PROTOCOL           *This,\r
+  IN  EFI_SMM_PERIODIC_TIMER_DISPATCH                   DispatchFunction,\r
+  IN  EFI_SMM_PERIODIC_TIMER_DISPATCH_CONTEXT           *DispatchContext,\r
+  OUT EFI_HANDLE                                        *DispatchHandle\r
+  );\r
+\r
+/**\r
+  Unregister a child SMI source dispatch function with a parent SMM driver\r
+\r
+  @param  This                  Protocol instance pointer.\r
+  @param  DispatchHandle        Handle of dispatch function to deregister.\r
+\r
+  @retval EFI_SUCCESS           The dispatch function has been successfully\r
+                                unregistered and the SMI source has been disabled\r
+                                if there are no other registered child dispatch\r
+                                functions for this SMI source.\r
+  @retval EFI_INVALID_PARAMETER Handle is invalid.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_SMM_PERIODIC_TIMER_UNREGISTER) (\r
+  IN EFI_SMM_PERIODIC_TIMER_DISPATCH_PROTOCOL           *This,\r
+  IN  EFI_HANDLE                                        DispatchHandle\r
+  );\r
+\r
+//\r
+// Interface structure for the SMM Periodic Timer Dispatch Protocol\r
+//\r
+/**\r
+  @par Protocol Description:\r
+  Provides the parent dispatch service for the periodical timer SMI source generator.\r
+\r
+  @param Register\r
+  Installs a child service to be dispatched by this protocol.\r
+\r
+  @param UnRegister\r
+  Removes a child service dispatched by this protocol.\r
+\r
+  @param GetNextShorterInterval\r
+  Returns the next SMI tick period that is supported by the chipset.\r
+\r
+**/\r
+struct _EFI_SMM_PERIODIC_TIMER_DISPATCH_PROTOCOL {\r
+  EFI_SMM_PERIODIC_TIMER_REGISTER   Register;\r
+  EFI_SMM_PERIODIC_TIMER_UNREGISTER UnRegister;\r
+  EFI_SMM_PERIODIC_TIMER_INTERVAL   GetNextShorterInterval;\r
+};\r
+\r
+extern EFI_GUID gEfiSmmPeriodicTimerDispatchProtocolGuid;\r
+\r
+#endif\r
diff --git a/IntelFrameworkPkg/Include/Protocol/SmmPowerButtonDispatch.h b/IntelFrameworkPkg/Include/Protocol/SmmPowerButtonDispatch.h
new file mode 100644 (file)
index 0000000..c2c7b28
--- /dev/null
@@ -0,0 +1,147 @@
+/** @file\r
+  This file declares EFI Smm Power Button Smi Child Protocol\r
+\r
+  Copyright (c) 2007, Intel Corporation\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+  Module Name:  SmmPowerButtonDispatch.h\r
+\r
+  @par Revision Reference:\r
+  This Protocol is defined in Framework of EFI SMM Core Interface Spec\r
+  Version 0.9.\r
+\r
+**/\r
+\r
+#ifndef _EFI_SMM_POWER_BUTTON_DISPATCH_H_\r
+#define _EFI_SMM_POWER_BUTTON_DISPATCH_H_\r
+\r
+//\r
+// Global ID for the Power Button SMI Protocol\r
+//\r
+#define EFI_SMM_POWER_BUTTON_DISPATCH_PROTOCOL_GUID \\r
+  { \\r
+    0xb709efa0, 0x47a6, 0x4b41, {0xb9, 0x31, 0x12, 0xec, 0xe7, 0xa8, 0xee, 0x56 } \\r
+  }\r
+\r
+typedef struct _EFI_SMM_POWER_BUTTON_DISPATCH_PROTOCOL  EFI_SMM_POWER_BUTTON_DISPATCH_PROTOCOL;\r
+\r
+//\r
+// Related Definitions\r
+//\r
+//\r
+// Power Button. Example, Use for changing LEDs before ACPI OS is on.\r
+//    - DXE/BDS Phase\r
+//    - OS Install Phase\r
+//\r
+typedef enum {\r
+  PowerButtonEntry,\r
+  PowerButtonExit\r
+} EFI_POWER_BUTTON_PHASE;\r
+\r
+typedef struct {\r
+  EFI_POWER_BUTTON_PHASE  Phase;\r
+} EFI_SMM_POWER_BUTTON_DISPATCH_CONTEXT;\r
+\r
+//\r
+// Member functions\r
+//\r
+/**\r
+  Dispatch function for a Power Button SMI handler.\r
+\r
+  @param  DispatchHandle        Handle of this dispatch function.\r
+  @param  DispatchContext       Pointer to the dispatch function's context.\r
+                                The DispatchContext fields are filled in\r
+                                by the dispatching driver prior to\r
+                                invoking this dispatch function.\r
+\r
+  Nothing\r
+\r
+**/\r
+typedef\r
+VOID\r
+(EFIAPI *EFI_SMM_POWER_BUTTON_DISPATCH) (\r
+  IN  EFI_HANDLE                             DispatchHandle,\r
+  IN  EFI_SMM_POWER_BUTTON_DISPATCH_CONTEXT  *DispatchContext\r
+  );\r
+\r
+/**\r
+  Register a child SMI source dispatch function with a parent SMM driver\r
+\r
+  @param  This                  Protocol instance pointer.\r
+  @param  DispatchFunction      Pointer to dispatch function to be invoked for\r
+                                this SMI source\r
+  @param  DispatchContext       Pointer to the dispatch function's context.\r
+                                The caller fills this context in before calling\r
+                                the register function to indicate to the register\r
+                                function the Power Button SMI phase for which the dispatch\r
+                                function should be invoked.\r
+  @param  DispatchHandle        Handle of dispatch function, for when interfacing\r
+                                with the parent Sx state SMM driver.\r
+\r
+  @retval EFI_SUCCESS           The dispatch function has been successfully\r
+                                registered and the SMI source has been enabled.\r
+  @retval EFI_DEVICE_ERROR      The driver was unable to enable the SMI source.\r
+  @retval EFI_OUT_OF_RESOURCES  Not enough memory (system or SMM) to manage this\r
+                                child.\r
+  @retval EFI_INVALID_PARAMETER DispatchContext is invalid. The Power Button SMI\r
+                                phase is not within valid range.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_SMM_POWER_BUTTON_REGISTER) (\r
+  IN EFI_SMM_POWER_BUTTON_DISPATCH_PROTOCOL            *This,\r
+  IN  EFI_SMM_POWER_BUTTON_DISPATCH                    DispatchFunction,\r
+  IN  EFI_SMM_POWER_BUTTON_DISPATCH_CONTEXT            *DispatchContext,\r
+  OUT EFI_HANDLE                                       *DispatchHandle\r
+  );\r
+\r
+/**\r
+  Unregister a child SMI source dispatch function with a parent SMM driver\r
+\r
+  @param  This                  Protocol instance pointer.\r
+  @param  DispatchHandle        Handle of dispatch function to deregister.\r
+\r
+  @retval EFI_SUCCESS           The dispatch function has been successfully\r
+                                unregistered and the SMI source has been disabled\r
+                                if there are no other registered child dispatch\r
+                                functions for this SMI source.\r
+  @retval EFI_INVALID_PARAMETER Handle is invalid.\r
+  @retval other                 TBD\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_SMM_POWER_BUTTON_UNREGISTER) (\r
+  IN EFI_SMM_POWER_BUTTON_DISPATCH_PROTOCOL             *This,\r
+  IN  EFI_HANDLE                                        DispatchHandle\r
+  );\r
+\r
+//\r
+// Interface structure for the SMM Power Button SMI Dispatch Protocol\r
+//\r
+/**\r
+  @par Protocol Description:\r
+  Provides the parent dispatch service for the SMM power button SMI source generator.\r
+\r
+  @param Register\r
+  Installs a child service to be dispatched by this protocol.\r
+\r
+  @param UnRegister\r
+  Removes a child service dispatched by this protocol.\r
+\r
+**/\r
+struct _EFI_SMM_POWER_BUTTON_DISPATCH_PROTOCOL {\r
+  EFI_SMM_POWER_BUTTON_REGISTER   Register;\r
+  EFI_SMM_POWER_BUTTON_UNREGISTER UnRegister;\r
+};\r
+\r
+extern EFI_GUID gEfiSmmPowerButtonDispatchProtocolGuid;\r
+\r
+#endif\r
diff --git a/IntelFrameworkPkg/Include/Protocol/SmmStandbyButtonDispatch.h b/IntelFrameworkPkg/Include/Protocol/SmmStandbyButtonDispatch.h
new file mode 100644 (file)
index 0000000..8753808
--- /dev/null
@@ -0,0 +1,148 @@
+/** @file\r
+  This file declares EFI Smm Standby Button Smi Child Protocol\r
+\r
+  Copyright (c) 2007, Intel Corporation\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+  Module Name:  SmmStandbyButtonDispatch.h\r
+\r
+  @par Revision Reference:\r
+  This Protocol is defined in Framework of EFI SMM Core Interface Spec\r
+  Version 0.9.\r
+\r
+**/\r
+\r
+#ifndef _EFI_SMM_STANDBY_BUTTON_DISPATCH_H_\r
+#define _EFI_SMM_STANDBY_BUTTON_DISPATCH_H_\r
+\r
+//\r
+// Global ID for the Standby Button SMI Protocol\r
+//\r
+#define EFI_SMM_STANDBY_BUTTON_DISPATCH_PROTOCOL_GUID \\r
+  { \\r
+    0x78965b98, 0xb0bf, 0x449e, {0x8b, 0x22, 0xd2, 0x91, 0x4e, 0x49, 0x8a, 0x98 } \\r
+  }\r
+\r
+typedef struct _EFI_SMM_STANDBY_BUTTON_DISPATCH_PROTOCOL  EFI_SMM_STANDBY_BUTTON_DISPATCH_PROTOCOL;\r
+\r
+//\r
+// Related Definitions\r
+//\r
+//\r
+// Standby Button. Example, Use for changing LEDs before ACPI OS is on.\r
+//    - DXE/BDS Phase\r
+//    - OS Install Phase\r
+//\r
+typedef enum {\r
+  EfiStandbyButtonEntry,\r
+  EfiStandbyButtonExit,\r
+  EfiStandbyButtonMax\r
+} EFI_STANDBY_BUTTON_PHASE;\r
+\r
+typedef struct {\r
+  EFI_STANDBY_BUTTON_PHASE  Phase;\r
+} EFI_SMM_STANDBY_BUTTON_DISPATCH_CONTEXT;\r
+\r
+//\r
+// Member functions\r
+//\r
+/**\r
+  Dispatch function for a Standby Button SMI handler.\r
+\r
+  @param  DispatchHandle        Handle of this dispatch function.\r
+  @param  DispatchContext       Pointer to the dispatch function's context.\r
+                                The DispatchContext fields are filled in\r
+                                by the dispatching driver prior to\r
+                                invoking this dispatch function.\r
+\r
+  @return Nothing\r
+\r
+**/\r
+typedef\r
+VOID\r
+(EFIAPI *EFI_SMM_STANDBY_BUTTON_DISPATCH) (\r
+  IN  EFI_HANDLE                                DispatchHandle,\r
+  IN  EFI_SMM_STANDBY_BUTTON_DISPATCH_CONTEXT   *DispatchContext\r
+  );\r
+\r
+/**\r
+  Register a child SMI source dispatch function with a parent SMM driver\r
+\r
+  @param  This                  Protocol instance pointer.\r
+  @param  DispatchFunction      Pointer to dispatch function to be invoked for\r
+                                this SMI source\r
+  @param  DispatchContext       Pointer to the dispatch function's context.\r
+                                The caller fills this context in before calling\r
+                                the register function to indicate to the register\r
+                                function the Standby Button SMI phase for which the dispatch\r
+                                function should be invoked.\r
+  @param  DispatchHandle        Handle of dispatch function, for when interfacing\r
+                                with the parent Sx state SMM driver.\r
+\r
+  @retval EFI_SUCCESS           The dispatch function has been successfully\r
+                                registered and the SMI source has been enabled.\r
+  @retval EFI_DEVICE_ERROR      The driver was unable to enable the SMI source.\r
+  @retval EFI_OUT_OF_RESOURCES  Not enough memory (system or SMM) to manage this\r
+                                child.\r
+  @retval EFI_INVALID_PARAMETER DispatchContext is invalid. The Standby Button SMI\r
+                                phase is not within valid range.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_SMM_STANDBY_BUTTON_REGISTER) (\r
+  IN EFI_SMM_STANDBY_BUTTON_DISPATCH_PROTOCOL           *This,\r
+  IN  EFI_SMM_STANDBY_BUTTON_DISPATCH                   DispatchFunction,\r
+  IN  EFI_SMM_STANDBY_BUTTON_DISPATCH_CONTEXT           *DispatchContext,\r
+  OUT EFI_HANDLE                                        *DispatchHandle\r
+  );\r
+\r
+/**\r
+  Unregister a child SMI source dispatch function with a parent SMM driver\r
+\r
+  @param  This                  Protocol instance pointer.\r
+  @param  DispatchHandle        Handle of dispatch function to deregister.\r
+\r
+  @retval EFI_SUCCESS           The dispatch function has been successfully\r
+                                unregistered and the SMI source has been disabled\r
+                                if there are no other registered child dispatch\r
+                                functions for this SMI source.\r
+  @retval EFI_INVALID_PARAMETER Handle is invalid.\r
+  @retval other                 TBD\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_SMM_STANDBY_BUTTON_UNREGISTER) (\r
+  IN EFI_SMM_STANDBY_BUTTON_DISPATCH_PROTOCOL           *This,\r
+  IN  EFI_HANDLE                                        DispatchHandle\r
+  );\r
+\r
+//\r
+// Interface structure for the SMM Standby Button SMI Dispatch Protocol\r
+//\r
+/**\r
+  @par Protocol Description:\r
+  Provides the parent dispatch service for the standby button SMI source generator.\r
+\r
+  @param Register\r
+  Installs a child service to be dispatched by this protocol.\r
+\r
+  @param UnRegister\r
+  Removes a child service dispatched by this protocol.\r
+\r
+**/\r
+struct _EFI_SMM_STANDBY_BUTTON_DISPATCH_PROTOCOL {\r
+  EFI_SMM_STANDBY_BUTTON_REGISTER   Register;\r
+  EFI_SMM_STANDBY_BUTTON_UNREGISTER UnRegister;\r
+};\r
+\r
+extern EFI_GUID gEfiSmmStandbyButtonDispatchProtocolGuid;\r
+\r
+#endif\r
diff --git a/IntelFrameworkPkg/Include/Protocol/SmmSwDispatch.h b/IntelFrameworkPkg/Include/Protocol/SmmSwDispatch.h
new file mode 100644 (file)
index 0000000..e003fb7
--- /dev/null
@@ -0,0 +1,149 @@
+/** @file\r
+  This file declares EFI Smm Software Smi Child Protocol\r
+\r
+  Copyright (c) 2007, Intel Corporation\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+  Module Name:  SmmSwDispatch.h\r
+\r
+  @par Revision Reference:\r
+  This Protocol is defined in Framework of EFI SMM Core Interface Spec\r
+  Version 0.9.\r
+\r
+**/\r
+\r
+#ifndef _EFI_SMM_SW_DISPATCH_H_\r
+#define _EFI_SMM_SW_DISPATCH_H_\r
+\r
+//\r
+// Global ID for the SW SMI Protocol\r
+//\r
+#define EFI_SMM_SW_DISPATCH_PROTOCOL_GUID \\r
+  { \\r
+    0xe541b773, 0xdd11, 0x420c, {0xb0, 0x26, 0xdf, 0x99, 0x36, 0x53, 0xf8, 0xbf } \\r
+  }\r
+\r
+typedef struct _EFI_SMM_SW_DISPATCH_PROTOCOL  EFI_SMM_SW_DISPATCH_PROTOCOL;\r
+\r
+//\r
+// Related Definitions\r
+//\r
+//\r
+// A particular chipset may not support all possible software SMI input values.\r
+// For example, the ICH supports only values 00h to 0FFh.  The parent only allows a single\r
+// child registration for each SwSmiInputValue.\r
+//\r
+typedef struct {\r
+  UINTN SwSmiInputValue;\r
+} EFI_SMM_SW_DISPATCH_CONTEXT;\r
+\r
+//\r
+// Member functions\r
+//\r
+/**\r
+  Dispatch function for a Software SMI handler.\r
+\r
+  @param  DispatchHandle        Handle of this dispatch function.\r
+  @param  DispatchContext       Pointer to the dispatch function's context.\r
+                                The SwSmiInputValue field is filled in\r
+                                by the software dispatch driver prior to\r
+                                invoking this dispatch function.\r
+                                The dispatch function will only be called\r
+                                for input values for which it is registered.\r
+\r
+  Nothing\r
+\r
+**/\r
+typedef\r
+VOID\r
+(EFIAPI *EFI_SMM_SW_DISPATCH) (\r
+  IN  EFI_HANDLE                    DispatchHandle,\r
+  IN  EFI_SMM_SW_DISPATCH_CONTEXT   *DispatchContext\r
+  );\r
+\r
+/**\r
+  Register a child SMI source dispatch function with a parent SMM driver\r
+\r
+  @param  This                  Protocol instance pointer.\r
+  @param  DispatchFunction      Pointer to dispatch function to be invoked for\r
+                                this SMI source\r
+  @param  DispatchContext       Pointer to the dispatch function's context.\r
+                                The caller fills this context in before calling\r
+                                the register function to indicate to the register\r
+                                function which Software SMI input value the\r
+                                dispatch function should be invoked for.\r
+  @param  DispatchHandle        Handle of dispatch function, for when interfacing\r
+                                with the parent Sx state SMM driver.\r
+\r
+  @retval EFI_SUCCESS           The dispatch function has been successfully\r
+                                registered and the SMI source has been enabled.\r
+  @retval EFI_DEVICE_ERROR      The SW driver was unable to enable the SMI source.\r
+  @retval EFI_OUT_OF_RESOURCES  Not enough memory (system or SMM) to manage this\r
+                                child.\r
+  @retval EFI_INVALID_PARAMETER DispatchContext is invalid. The SW SMI input value\r
+                                is not within valid range.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_SMM_SW_REGISTER) (\r
+  IN EFI_SMM_SW_DISPATCH_PROTOCOL           *This,\r
+  IN  EFI_SMM_SW_DISPATCH                   DispatchFunction,\r
+  IN  EFI_SMM_SW_DISPATCH_CONTEXT           *DispatchContext,\r
+  OUT EFI_HANDLE                            *DispatchHandle\r
+  );\r
+\r
+/**\r
+  Unregister a child SMI source dispatch function with a parent SMM driver\r
+\r
+  @param  This                  Protocol instance pointer.\r
+  @param  DispatchHandle        Handle of dispatch function to deregister.\r
+\r
+  @retval EFI_SUCCESS           The dispatch function has been successfully\r
+                                unregistered and the SMI source has been disabled\r
+                                if there are no other registered child dispatch\r
+                                functions for this SMI source.\r
+  @retval EFI_INVALID_PARAMETER Handle is invalid.\r
+  @retval other                 TBD\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_SMM_SW_UNREGISTER) (\r
+  IN EFI_SMM_SW_DISPATCH_PROTOCOL           *This,\r
+  IN  EFI_HANDLE                            DispatchHandle\r
+  );\r
+\r
+//\r
+// Interface structure for the SMM Software SMI Dispatch Protocol\r
+//\r
+/**\r
+  @par Protocol Description:\r
+  Provides the parent dispatch service for a given SMI source generator.\r
+\r
+  @param Register\r
+  Installs a child service to be dispatched by this protocol.\r
+\r
+  @param UnRegister\r
+  Removes a child service dispatched by this protocol.\r
+\r
+  @param MaximumSwiValue\r
+  A read-only field that describes the maximum value that can be used\r
+  in the EFI_SMM_SW_DISPATCH_PROTOCOL.Register() service.\r
+\r
+**/\r
+struct _EFI_SMM_SW_DISPATCH_PROTOCOL {\r
+  EFI_SMM_SW_REGISTER   Register;\r
+  EFI_SMM_SW_UNREGISTER UnRegister;\r
+  UINTN                 MaximumSwiValue;\r
+};\r
+\r
+extern EFI_GUID gEfiSmmSwDispatchProtocolGuid;\r
+\r
+#endif\r
diff --git a/IntelFrameworkPkg/Include/Protocol/SmmSxDispatch.h b/IntelFrameworkPkg/Include/Protocol/SmmSxDispatch.h
new file mode 100644 (file)
index 0000000..e7621cd
--- /dev/null
@@ -0,0 +1,160 @@
+/** @file\r
+  This file declares EFI Smm Sx Smi Child Protocol\r
+\r
+  Copyright (c) 2007, Intel Corporation\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+  Module Name:  SmmSxDispatch.h\r
+\r
+  @par Revision Reference:\r
+  This Protocol is defined in Framework of EFI SMM Core Interface Spec\r
+  Version 0.9.\r
+\r
+**/\r
+\r
+#ifndef _EFI_SMM_SX_DISPATCH_H_\r
+#define _EFI_SMM_SX_DISPATCH_H_\r
+\r
+//\r
+// Global ID for the Sx SMI Protocol\r
+//\r
+#define EFI_SMM_SX_DISPATCH_PROTOCOL_GUID \\r
+  { \\r
+    0x14fc52be, 0x1dc, 0x426c, {0x91, 0xae, 0xa2, 0x3c, 0x3e, 0x22, 0xa, 0xe8 } \\r
+  }\r
+\r
+typedef struct _EFI_SMM_SX_DISPATCH_PROTOCOL  EFI_SMM_SX_DISPATCH_PROTOCOL;\r
+//\r
+// Related Definitions\r
+//\r
+typedef enum {\r
+  SxS0,\r
+  SxS1,\r
+  SxS2,\r
+  SxS3,\r
+  SxS4,\r
+  SxS5,\r
+  EfiMaximumSleepType\r
+} EFI_SLEEP_TYPE;\r
+\r
+typedef enum {\r
+  SxEntry,\r
+  SxExit,\r
+  EfiMaximumPhase\r
+} EFI_SLEEP_PHASE;\r
+\r
+typedef struct {\r
+  EFI_SLEEP_TYPE  Type;\r
+  EFI_SLEEP_PHASE Phase;\r
+} EFI_SMM_SX_DISPATCH_CONTEXT;\r
+\r
+//\r
+// Member functions\r
+//\r
+/**\r
+  Dispatch function for a Sx state SMI handler.\r
+\r
+  @param  DispatchHandle        Handle of this dispatch function.\r
+  @param  DispatchContext       Pointer to the dispatch function's context.\r
+                                The Type and Phase fields are filled in by the Sx dispatch driver\r
+                                prior to invoking this dispatch function. For this interface,\r
+                                the Sx driver will call the dispatch function for all Sx type\r
+                                and phases, so the Sx state handler(s) must check the Type and\r
+                                Phase field of EFI_SMM_SX_DISPATCH_CONTEXT and act accordingly.\r
+\r
+  Nothing\r
+\r
+**/\r
+typedef\r
+VOID\r
+(EFIAPI *EFI_SMM_SX_DISPATCH) (\r
+  IN  EFI_HANDLE                    DispatchHandle,\r
+  IN  EFI_SMM_SX_DISPATCH_CONTEXT   *DispatchContext\r
+  );\r
+\r
+/**\r
+  Register a child SMI source dispatch function with a parent SMM driver\r
+\r
+  @param  This                  Protocol instance pointer.\r
+  @param  DispatchFunction      Pointer to dispatch function to be invoked for\r
+                                this SMI source\r
+  @param  DispatchContext       Pointer to the dispatch function's context.\r
+                                The caller fills this context in before calling\r
+                                the register function to indicate to the register\r
+                                function which Sx state type and phase the caller\r
+                                wishes to be called back on. For this intertace,\r
+                                the Sx driver will call the registered handlers for\r
+                                all Sx type and phases, so the Sx state handler(s)\r
+                                must check the Type and Phase field of the Dispatch\r
+                                context and act accordingly.\r
+  @param  DispatchHandle        Handle of dispatch function, for when interfacing\r
+                                with the parent Sx state SMM driver.\r
+\r
+  @retval EFI_SUCCESS           The dispatch function has been successfully\r
+                                registered and the SMI source has been enabled.\r
+  @retval EFI_UNSUPPORTED       The Sx driver or hardware does not support that\r
+                                Sx Type/Phase.\r
+  @retval EFI_DEVICE_ERROR      The Sx driver was unable to enable the SMI source.\r
+  @retval EFI_OUT_OF_RESOURCES  Not enough memory (system or SMM) to manage this\r
+                                child.\r
+  @retval EFI_INVALID_PARAMETER DispatchContext is invalid. Type & Phase are not\r
+                                within valid range.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_SMM_SX_REGISTER) (\r
+  IN EFI_SMM_SX_DISPATCH_PROTOCOL           *This,\r
+  IN  EFI_SMM_SX_DISPATCH                   DispatchFunction,\r
+  IN  EFI_SMM_SX_DISPATCH_CONTEXT           *DispatchContext,\r
+  OUT EFI_HANDLE                            *DispatchHandle\r
+  );\r
+\r
+/**\r
+  Unregister a child SMI source dispatch function with a parent SMM driver\r
+\r
+  @param  This                  Protocol instance pointer.\r
+  @param  DispatchHandle        Handle of dispatch function to deregister.\r
+\r
+  @retval EFI_SUCCESS           The dispatch function has been successfully unregistered and the\r
+                                SMI source has been disabled if there are no other registered child\r
+                                dispatch functions for this SMI source.\r
+  @retval EFI_INVALID_PARAMETER Handle is invalid.\r
+  @retval other                 TBD\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_SMM_SX_UNREGISTER) (\r
+  IN EFI_SMM_SX_DISPATCH_PROTOCOL           *This,\r
+  IN  EFI_HANDLE                            DispatchHandle\r
+  );\r
+\r
+//\r
+// Interface structure for the SMM Child Dispatch Protocol\r
+//\r
+/**\r
+  @par Protocol Description:\r
+  Provides the parent dispatch service for a given Sx-state source generator.\r
+\r
+  @param Register\r
+  Installs a child service to be dispatched by this protocol.\r
+\r
+  @param UnRegister\r
+  Removes a child service dispatched by this protocol.\r
+\r
+**/\r
+struct _EFI_SMM_SX_DISPATCH_PROTOCOL {\r
+  EFI_SMM_SX_REGISTER   Register;\r
+  EFI_SMM_SX_UNREGISTER UnRegister;\r
+};\r
+\r
+extern EFI_GUID gEfiSmmSxDispatchProtocolGuid;\r
+\r
+#endif\r
diff --git a/IntelFrameworkPkg/Include/Protocol/SmmUsbDispatch.h b/IntelFrameworkPkg/Include/Protocol/SmmUsbDispatch.h
new file mode 100644 (file)
index 0000000..e87619d
--- /dev/null
@@ -0,0 +1,141 @@
+/** @file\r
+  This file declares EFI Smm USB Smi Child Protocol.\r
+\r
+  Copyright (c) 2007, Intel Corporation\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+  Module Name:  SmmUsbDispatch.h\r
+\r
+  @par Revision Reference:\r
+  This Protocol is defined in Framework of EFI SMM Core Interface Spec\r
+  Version 0.9.\r
+**/\r
+\r
+#ifndef _EFI_SMM_USB_DISPATCH_H_\r
+#define _EFI_SMM_USB_DISPATCH_H_\r
+\r
+//\r
+// Global ID for the USB Protocol\r
+//\r
+#define EFI_SMM_USB_DISPATCH_PROTOCOL_GUID \\r
+  { \\r
+    0xa05b6ffd, 0x87af, 0x4e42, {0x95, 0xc9, 0x62, 0x28, 0xb6, 0x3c, 0xf3, 0xf3 } \\r
+  }\r
+\r
+typedef struct _EFI_SMM_USB_DISPATCH_PROTOCOL  EFI_SMM_USB_DISPATCH_PROTOCOL;\r
+\r
+//\r
+// Related Definitions\r
+//\r
+typedef enum {\r
+  UsbLegacy,\r
+  UsbWake\r
+} EFI_USB_SMI_TYPE;\r
+\r
+typedef struct {\r
+  EFI_USB_SMI_TYPE          Type;\r
+  EFI_DEVICE_PATH_PROTOCOL  *Device;\r
+} EFI_SMM_USB_DISPATCH_CONTEXT;\r
+\r
+//\r
+// Member functions\r
+//\r
+/**\r
+  Dispatch function for a USB SMI handler.\r
+\r
+  @param  DispatchHandle        Handle of this dispatch function.\r
+  @param  DispatchContext       Pointer to the dispatch function's context.\r
+                                The DispatchContext fields are filled in\r
+                                by the dispatching driver prior to\r
+                                invoking this dispatch function.\r
+\r
+  Nothing\r
+\r
+**/\r
+typedef\r
+VOID\r
+(EFIAPI *EFI_SMM_USB_DISPATCH) (\r
+  IN  EFI_HANDLE                    DispatchHandle,\r
+  IN  EFI_SMM_USB_DISPATCH_CONTEXT  *DispatchContext\r
+  );\r
+\r
+/**\r
+  Register a child SMI source dispatch function with a parent SMM driver\r
+\r
+  @param  This                  Protocol instance pointer.\r
+  @param  DispatchFunction      Pointer to dispatch function to be invoked for\r
+                                this SMI source\r
+  @param  DispatchContext       Pointer to the dispatch function's context.\r
+                                The caller fills this context in before calling\r
+                                the register function to indicate to the register\r
+                                function the USB SMI types for which the dispatch\r
+                                function should be invoked.\r
+  @param  DispatchHandle        Handle of dispatch function, for when interfacing\r
+                                with the parent Sx state SMM driver.\r
+\r
+  @retval EFI_SUCCESS           The dispatch function has been successfully\r
+                                registered and the SMI source has been enabled.\r
+  @retval EFI_DEVICE_ERROR      The driver was unable to enable the SMI source.\r
+  @retval EFI_OUT_OF_RESOURCES  Not enough memory (system or SMM) to manage this\r
+                                child.\r
+  @retval EFI_INVALID_PARAMETER DispatchContext is invalid. The USB SMI type\r
+                                is not within valid range.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_SMM_USB_REGISTER) (\r
+  IN EFI_SMM_USB_DISPATCH_PROTOCOL            *This,\r
+  IN  EFI_SMM_USB_DISPATCH                    DispatchFunction,\r
+  IN  EFI_SMM_USB_DISPATCH_CONTEXT            *DispatchContext,\r
+  OUT EFI_HANDLE                              *DispatchHandle\r
+  );\r
+\r
+/**\r
+  Unregister a child SMI source dispatch function with a parent SMM driver\r
+\r
+  @param  This                  Protocol instance pointer.\r
+  @param  DispatchHandle        Handle of dispatch function to deregister.\r
+\r
+  @retval EFI_SUCCESS           The dispatch function has been successfully\r
+                                unregistered and the SMI source has been disabled\r
+                                if there are no other registered child dispatch\r
+                                functions for this SMI source.\r
+  @retval EFI_INVALID_PARAMETER Handle is invalid.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_SMM_USB_UNREGISTER) (\r
+  IN EFI_SMM_USB_DISPATCH_PROTOCOL            *This,\r
+  IN  EFI_HANDLE                              DispatchHandle\r
+  );\r
+\r
+//\r
+// Interface structure for the SMM USB SMI Dispatch Protocol\r
+//\r
+/**\r
+  @par Protocol Description:\r
+  Provides the parent dispatch service for the USB SMI source generator.\r
+\r
+  @param Register\r
+  Installs a child service to be dispatched by this protocol.\r
+\r
+  @param UnRegister\r
+  Removes a child service dispatched by this protocol.\r
+\r
+**/\r
+struct _EFI_SMM_USB_DISPATCH_PROTOCOL {\r
+  EFI_SMM_USB_REGISTER    Register;\r
+  EFI_SMM_USB_UNREGISTER  UnRegister;\r
+};\r
+\r
+extern EFI_GUID gEfiSmmUsbDispatchProtocolGuid;\r
+\r
+#endif\r
diff --git a/IntelFrameworkPkg/IntelFrameworkPkg.spd b/IntelFrameworkPkg/IntelFrameworkPkg.spd
new file mode 100644 (file)
index 0000000..f39d828
--- /dev/null
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>\r
+<PackageSurfaceArea xmlns="http://www.TianoCore.org/2006/Edk2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">\r
+  <SpdHeader>\r
+    <PackageName>IntelFrameworkPkg</PackageName>\r
+    <GuidValue>2759ded5-bb57-4b06-af4f-c398fa552719</GuidValue>\r
+    <Version>1.0</Version>\r
+    <Specification>FRAMEWORK_BUILD_PACKAGING_SPECIFICATION   0x00000052</Specification>\r
+  </SpdHeader>\r
+  <PackageDefinitions>\r
+    <ReadOnly>false</ReadOnly>\r
+    <RePackage>false</RePackage>\r
+  </PackageDefinitions>\r
+  <MsaFiles>\r
+    <Filename>Library/DxeIoLibCpuIo/DxeIoLibCpuIo.msa</Filename>\r
+    <Filename>Library/DxeReportStatusCodeLibFramework/DxeReportStatusCodeLib.msa</Filename>\r
+    <Filename>Library/DxeSmmDriverEntryPoint/DxeSmmDriverEntryPoint.msa</Filename>\r
+    <Filename>Library/UefiLibFramework/UefiLib.msa</Filename>\r
+  </MsaFiles>\r
+  <PackageHeaders>\r
+    <IncludePkgHeader ModuleType="BASE">Include/FrameworkBase.h</IncludePkgHeader>\r
+    <IncludePkgHeader ModuleType="PEIM">Include/FrameworkPei.h</IncludePkgHeader>\r
+    <IncludePkgHeader ModuleType="DXE_DRIVER">Include/FrameworkDxe.h</IncludePkgHeader>\r
+    <IncludePkgHeader ModuleType="DXE_RUNTIME_DRIVER">Include/FrameworkDxe.h</IncludePkgHeader>\r
+    <IncludePkgHeader ModuleType="DXE_SMM_DRIVER">Include/FrameworkSmm.h</IncludePkgHeader>\r
+  </PackageHeaders>\r
+</PackageSurfaceArea>
\ No newline at end of file
diff --git a/IntelFrameworkPkg/Library/DxeIoLibCpuIo/DxeCpuIoLibInternal.h b/IntelFrameworkPkg/Library/DxeIoLibCpuIo/DxeCpuIoLibInternal.h
new file mode 100644 (file)
index 0000000..ef3dc10
--- /dev/null
@@ -0,0 +1,116 @@
+/** @file\r
+  Internal include file of DXE CPU IO Library.\r
+\r
+  Copyright (c) 2006, Intel Corporation\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+  Module Name:  DxeCpuIoLibInternal.h\r
+\r
+**/\r
+\r
+#ifndef _DXE_CPUIO_LIB_INTERNAL_H_\r
+#define _DXE_CPUIO_LIB_INTERNAL_H_\r
+\r
+#include <FrameworkDxe.h>\r
+#include <Library/IoLib.h>\r
+#include <Library/UefiBootServicesTableLib.h>\r
+#include <Library/DebugLib.h>\r
+#include <Library/BaseLib.h>\r
+\r
+#include <Protocol/PciRootBridgeIo.h>\r
+#include <Protocol/CpuIo.h>\r
+\r
+/**\r
+  Reads registers in the EFI CPU I/O space.\r
+\r
+  Reads the I/O port specified by Port with registers width specified by Width.\r
+  The read value is returned. If such operations are not supported, then ASSERT().\r
+  This function must guarantee that all I/O read and write operations are serialized.\r
+\r
+  @param  Port          The base address of the I/O operation.\r
+                        The caller is responsible for aligning the Address if required.\r
+  @param  Width         The width of the I/O operation.\r
+\r
+  @return Data read from registers in the EFI CPU I/O space.\r
+\r
+**/\r
+UINT64\r
+EFIAPI\r
+IoReadWorker (\r
+  IN      UINTN                     Port,\r
+  IN      EFI_CPU_IO_PROTOCOL_WIDTH Width\r
+  );\r
+\r
+/**\r
+  Writes registers in the EFI CPU I/O space.\r
+\r
+  Writes the I/O port specified by Port with registers width and value specified by Width\r
+  and Data respectively.  Data is returned. If such operations are not supported, then ASSERT().\r
+  This function must guarantee that all I/O read and write operations are serialized.\r
+\r
+  @param  Port          The base address of the I/O operation.\r
+                        The caller is responsible for aligning the Address if required.\r
+  @param  Width         The width of the I/O operation.\r
+  @param  Data          The value to write to the I/O port.\r
+\r
+  @return The paramter of Data.\r
+\r
+**/\r
+UINT64\r
+EFIAPI\r
+IoWriteWorker (\r
+  IN      UINTN                     Port,\r
+  IN      EFI_CPU_IO_PROTOCOL_WIDTH Width,\r
+  IN      UINT64                    Data\r
+  );\r
+\r
+/**\r
+  Reads memory-mapped registers in the EFI system memory space.\r
+\r
+  Reads the MMIO registers specified by Address with registers width specified by Width.\r
+  The read value is returned. If such operations are not supported, then ASSERT().\r
+  This function must guarantee that all MMIO read and write operations are serialized.\r
+\r
+  @param  Address       The MMIO register to read.\r
+                        The caller is responsible for aligning the Address if required.\r
+  @param  Width         The width of the I/O operation.\r
+\r
+  @return Data read from registers in the EFI system memory space.\r
+\r
+**/\r
+UINT64\r
+EFIAPI\r
+MmioReadWorker (\r
+  IN      UINTN                     Address,\r
+  IN      EFI_CPU_IO_PROTOCOL_WIDTH Width\r
+  );\r
+\r
+/**\r
+  Writes memory-mapped registers in the EFI system memory space.\r
+\r
+  Writes the MMIO registers specified by Address with registers width and value specified by Width\r
+  and Data respectively. Data is returned. If such operations are not supported, then ASSERT().\r
+  This function must guarantee that all MMIO read and write operations are serialized.\r
+\r
+  @param  Address       The MMIO register to read.\r
+                        The caller is responsible for aligning the Address if required.\r
+  @param  Width         The width of the I/O operation.\r
+\r
+  @return Data read from registers in the EFI system memory space.\r
+\r
+**/\r
+UINT64\r
+EFIAPI\r
+MmioWriteWorker (\r
+  IN      UINTN                     Address,\r
+  IN      EFI_CPU_IO_PROTOCOL_WIDTH Width,\r
+  IN      UINT64                    Data\r
+  );\r
+\r
+#endif\r
diff --git a/IntelFrameworkPkg/Library/DxeIoLibCpuIo/DxeIoLibCpuIo.msa b/IntelFrameworkPkg/Library/DxeIoLibCpuIo/DxeIoLibCpuIo.msa
new file mode 100644 (file)
index 0000000..0ee234e
--- /dev/null
@@ -0,0 +1,60 @@
+<?xml version="1.0" encoding="UTF-8"?>\r
+<ModuleSurfaceArea xmlns="http://www.TianoCore.org/2006/Edk2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">\r
+  <MsaHeader>\r
+    <ModuleName>DxeIoLibCpuIo</ModuleName>\r
+    <ModuleType>DXE_DRIVER</ModuleType>\r
+    <GuidValue>e94cd42a-3aad-4ea0-9b09-945891c60ccd</GuidValue>\r
+    <Version>1.0</Version>\r
+    <Abstract>Component description file for Cpu Io Dxe Io Library.</Abstract>\r
+    <Description>I/O Library implementation that uses the CPU I/O Protocol for I/O\r
+      and MMIO operations.</Description>\r
+    <Copyright>Copyright (c) 2006, Intel Corporation.</Copyright>\r
+    <License>All rights reserved. This program and the accompanying materials\r
+      are licensed and made available under the terms and conditions of the BSD License\r
+      which accompanies this distribution.  The full text of the license may be found at\r
+      http://opensource.org/licenses/bsd-license.php\r
+      THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+      WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.</License>\r
+    <Specification>FRAMEWORK_BUILD_PACKAGING_SPECIFICATION   0x00000052</Specification>\r
+  </MsaHeader>\r
+  <ModuleDefinitions>\r
+    <SupportedArchitectures>IA32 X64 IPF EBC</SupportedArchitectures>\r
+    <BinaryModule>false</BinaryModule>\r
+    <OutputFileBasename>DxeIoLibCpuIo</OutputFileBasename>\r
+  </ModuleDefinitions>\r
+  <LibraryClassDefinitions>\r
+    <LibraryClass Usage="ALWAYS_PRODUCED" SupModuleList="DXE_DRIVER DXE_RUNTIME_DRIVER DXE_SAL_DRIVER DXE_SMM_DRIVER UEFI_APPLICATION UEFI_DRIVER">\r
+      <Keyword>IoLib</Keyword>\r
+    </LibraryClass>\r
+    <LibraryClass Usage="ALWAYS_CONSUMED">\r
+      <Keyword>UefiBootServicesTableLib</Keyword>\r
+    </LibraryClass>\r
+    <LibraryClass Usage="ALWAYS_CONSUMED">\r
+      <Keyword>DebugLib</Keyword>\r
+    </LibraryClass>\r
+    <LibraryClass Usage="ALWAYS_CONSUMED">\r
+      <Keyword>BaseLib</Keyword>\r
+    </LibraryClass>\r
+  </LibraryClassDefinitions>\r
+  <SourceFiles>\r
+    <Filename>IoLib.c</Filename>\r
+    <Filename>IoHighLevel.c</Filename>\r
+    <Filename>DxeCpuIoLibInternal.h</Filename>\r
+    <Filename>IoLibMmioBuffer.c</Filename>\r
+  </SourceFiles>\r
+  <PackageDependencies>\r
+    <Package PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/>\r
+  </PackageDependencies>\r
+  <Protocols>\r
+    <Protocol Usage="ALWAYS_CONSUMED">\r
+      <ProtocolCName>gEfiCpuIoProtocolGuid</ProtocolCName>\r
+    </Protocol>\r
+  </Protocols>\r
+  <Externs>\r
+    <Specification>EFI_SPECIFICATION_VERSION 0x00020000</Specification>\r
+    <Specification>EDK_RELEASE_VERSION 0x00020000</Specification>\r
+    <Extern>\r
+      <Constructor>IoLibConstructor</Constructor>\r
+    </Extern>\r
+  </Externs>\r
+</ModuleSurfaceArea>
\ No newline at end of file
diff --git a/IntelFrameworkPkg/Library/DxeIoLibCpuIo/IoHighLevel.c b/IntelFrameworkPkg/Library/DxeIoLibCpuIo/IoHighLevel.c
new file mode 100644 (file)
index 0000000..719fe13
--- /dev/null
@@ -0,0 +1,2274 @@
+/** @file\r
+  High-level Io/Mmio functions.\r
+\r
+  All assertions for bit field operations are handled bit field functions in the\r
+  Base Library.\r
+\r
+  Copyright (c) 2006, Intel Corporation<BR>\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+  Module Name:  IoHighLevel.c\r
+\r
+  The following IoLib instances share the same version of this file:\r
+\r
+    BaseIoLibIntrinsic\r
+    DxeIoLibCpuIo\r
+    PeiIoLibCpuIo\r
+\r
+**/\r
+\r
+#include "DxeCpuIoLibInternal.h"\r
+\r
+/**\r
+  Reads an 8-bit I/O port, performs a bitwise inclusive OR, and writes the\r
+  result back to the 8-bit I/O port.\r
+\r
+  Reads the 8-bit I/O port specified by Port, performs a bitwise inclusive OR\r
+  between the read result and the value specified by OrData, and writes the\r
+  result to the 8-bit I/O port specified by Port. The value written to the I/O\r
+  port is returned. This function must guarantee that all I/O read and write\r
+  operations are serialized.\r
+\r
+  If 8-bit I/O port operations are not supported, then ASSERT().\r
+\r
+  @param  Port    The I/O port to write.\r
+  @param  OrData  The value to OR with the read value from the I/O port.\r
+\r
+  @return The value written back to the I/O port.\r
+\r
+**/\r
+UINT8\r
+EFIAPI\r
+IoOr8 (\r
+  IN      UINTN                     Port,\r
+  IN      UINT8                     OrData\r
+  )\r
+{\r
+  return IoWrite8 (Port, (UINT8) (IoRead8 (Port) | OrData));\r
+}\r
+\r
+/**\r
+  Reads an 8-bit I/O port, performs a bitwise AND, and writes the result back\r
+  to the 8-bit I/O port.\r
+\r
+  Reads the 8-bit I/O port specified by Port, performs a bitwise AND between\r
+  the read result and the value specified by AndData, and writes the result to\r
+  the 8-bit I/O port specified by Port. The value written to the I/O port is\r
+  returned. This function must guarantee that all I/O read and write operations\r
+  are serialized.\r
+\r
+  If 8-bit I/O port operations are not supported, then ASSERT().\r
+\r
+  @param  Port    The I/O port to write.\r
+  @param  AndData The value to AND with the read value from the I/O port.\r
+\r
+  @return The value written back to the I/O port.\r
+\r
+**/\r
+UINT8\r
+EFIAPI\r
+IoAnd8 (\r
+  IN      UINTN                     Port,\r
+  IN      UINT8                     AndData\r
+  )\r
+{\r
+  return IoWrite8 (Port, (UINT8) (IoRead8 (Port) & AndData));\r
+}\r
+\r
+/**\r
+  Reads an 8-bit I/O port, performs a bitwise AND followed by a bitwise\r
+  inclusive OR, and writes the result back to the 8-bit I/O port.\r
+\r
+  Reads the 8-bit I/O port specified by Port, performs a bitwise AND between\r
+  the read result and the value specified by AndData, performs a bitwise OR\r
+  between the result of the AND operation and the value specified by OrData,\r
+  and writes the result to the 8-bit I/O port specified by Port. The value\r
+  written to the I/O port is returned. This function must guarantee that all\r
+  I/O read and write operations are serialized.\r
+\r
+  If 8-bit I/O port operations are not supported, then ASSERT().\r
+\r
+  @param  Port    The I/O port to write.\r
+  @param  AndData The value to AND with the read value from the I/O port.\r
+  @param  OrData  The value to OR with the result of the AND operation.\r
+\r
+  @return The value written back to the I/O port.\r
+\r
+**/\r
+UINT8\r
+EFIAPI\r
+IoAndThenOr8 (\r
+  IN      UINTN                     Port,\r
+  IN      UINT8                     AndData,\r
+  IN      UINT8                     OrData\r
+  )\r
+{\r
+  return IoWrite8 (Port, (UINT8) ((IoRead8 (Port) & AndData) | OrData));\r
+}\r
+\r
+/**\r
+  Reads a bit field of an I/O register.\r
+\r
+  Reads the bit field in an 8-bit I/O register. The bit field is specified by\r
+  the StartBit and the EndBit. The value of the bit field is returned.\r
+\r
+  If 8-bit I/O port operations are not supported, then ASSERT().\r
+  If StartBit is greater than 7, then ASSERT().\r
+  If EndBit is greater than 7, then ASSERT().\r
+  If EndBit is less than StartBit, then ASSERT().\r
+\r
+  @param  Port      The I/O port to read.\r
+  @param  StartBit  The ordinal of the least significant bit in the bit field.\r
+                    Range 0..7.\r
+  @param  EndBit    The ordinal of the most significant bit in the bit field.\r
+                    Range 0..7.\r
+\r
+  @return The value read.\r
+\r
+**/\r
+UINT8\r
+EFIAPI\r
+IoBitFieldRead8 (\r
+  IN      UINTN                     Port,\r
+  IN      UINTN                     StartBit,\r
+  IN      UINTN                     EndBit\r
+  )\r
+{\r
+  return BitFieldRead8 (IoRead8 (Port), StartBit, EndBit);\r
+}\r
+\r
+/**\r
+  Writes a bit field to an I/O register.\r
+\r
+  Writes Value to the bit field of the I/O register. The bit field is specified\r
+  by the StartBit and the EndBit. All other bits in the destination I/O\r
+  register are preserved. The value written to the I/O port is returned. Extra\r
+  left bits in Value are stripped.\r
+\r
+  If 8-bit I/O port operations are not supported, then ASSERT().\r
+  If StartBit is greater than 7, then ASSERT().\r
+  If EndBit is greater than 7, then ASSERT().\r
+  If EndBit is less than StartBit, then ASSERT().\r
+\r
+  @param  Port      The I/O port to write.\r
+  @param  StartBit  The ordinal of the least significant bit in the bit field.\r
+                    Range 0..7.\r
+  @param  EndBit    The ordinal of the most significant bit in the bit field.\r
+                    Range 0..7.\r
+  @param  Value     New value of the bit field.\r
+\r
+  @return The value written back to the I/O port.\r
+\r
+**/\r
+UINT8\r
+EFIAPI\r
+IoBitFieldWrite8 (\r
+  IN      UINTN                     Port,\r
+  IN      UINTN                     StartBit,\r
+  IN      UINTN                     EndBit,\r
+  IN      UINT8                     Value\r
+  )\r
+{\r
+  return IoWrite8 (\r
+           Port,\r
+           BitFieldWrite8 (IoRead8 (Port), StartBit, EndBit, Value)\r
+           );\r
+}\r
+\r
+/**\r
+  Reads a bit field in an 8-bit port, performs a bitwise OR, and writes the\r
+  result back to the bit field in the 8-bit port.\r
+\r
+  Reads the 8-bit I/O port specified by Port, performs a bitwise inclusive OR\r
+  between the read result and the value specified by OrData, and writes the\r
+  result to the 8-bit I/O port specified by Port. The value written to the I/O\r
+  port is returned. This function must guarantee that all I/O read and write\r
+  operations are serialized. Extra left bits in OrData are stripped.\r
+\r
+  If 8-bit I/O port operations are not supported, then ASSERT().\r
+  If StartBit is greater than 7, then ASSERT().\r
+  If EndBit is greater than 7, then ASSERT().\r
+  If EndBit is less than StartBit, then ASSERT().\r
+\r
+  @param  Port      The I/O port to write.\r
+  @param  StartBit  The ordinal of the least significant bit in the bit field.\r
+                    Range 0..7.\r
+  @param  EndBit    The ordinal of the most significant bit in the bit field.\r
+                    Range 0..7.\r
+  @param  OrData    The value to OR with the read value from the I/O port.\r
+\r
+  @return The value written back to the I/O port.\r
+\r
+**/\r
+UINT8\r
+EFIAPI\r
+IoBitFieldOr8 (\r
+  IN      UINTN                     Port,\r
+  IN      UINTN                     StartBit,\r
+  IN      UINTN                     EndBit,\r
+  IN      UINT8                     OrData\r
+  )\r
+{\r
+  return IoWrite8 (\r
+           Port,\r
+           BitFieldOr8 (IoRead8 (Port), StartBit, EndBit, OrData)\r
+           );\r
+}\r
+\r
+/**\r
+  Reads a bit field in an 8-bit port, performs a bitwise AND, and writes the\r
+  result back to the bit field in the 8-bit port.\r
+\r
+  Reads the 8-bit I/O port specified by Port, performs a bitwise AND between\r
+  the read result and the value specified by AndData, and writes the result to\r
+  the 8-bit I/O port specified by Port. The value written to the I/O port is\r
+  returned. This function must guarantee that all I/O read and write operations\r
+  are serialized. Extra left bits in AndData are stripped.\r
+\r
+  If 8-bit I/O port operations are not supported, then ASSERT().\r
+  If StartBit is greater than 7, then ASSERT().\r
+  If EndBit is greater than 7, then ASSERT().\r
+  If EndBit is less than StartBit, then ASSERT().\r
+\r
+  @param  Port      The I/O port to write.\r
+  @param  StartBit  The ordinal of the least significant bit in the bit field.\r
+                    Range 0..7.\r
+  @param  EndBit    The ordinal of the most significant bit in the bit field.\r
+                    Range 0..7.\r
+  @param  AndData   The value to AND with the read value from the I/O port.\r
+\r
+  @return The value written back to the I/O port.\r
+\r
+**/\r
+UINT8\r
+EFIAPI\r
+IoBitFieldAnd8 (\r
+  IN      UINTN                     Port,\r
+  IN      UINTN                     StartBit,\r
+  IN      UINTN                     EndBit,\r
+  IN      UINT8                     AndData\r
+  )\r
+{\r
+  return IoWrite8 (\r
+           Port,\r
+           BitFieldAnd8 (IoRead8 (Port), StartBit, EndBit, AndData)\r
+           );\r
+}\r
+\r
+/**\r
+  Reads a bit field in an 8-bit port, performs a bitwise AND followed by a\r
+  bitwise inclusive OR, and writes the result back to the bit field in the\r
+  8-bit port.\r
+\r
+  Reads the 8-bit I/O port specified by Port, performs a bitwise AND followed\r
+  by a bitwise inclusive OR between the read result and the value specified by\r
+  AndData, and writes the result to the 8-bit I/O port specified by Port. The\r
+  value written to the I/O port is returned. This function must guarantee that\r
+  all I/O read and write operations are serialized. Extra left bits in both\r
+  AndData and OrData are stripped.\r
+\r
+  If 8-bit I/O port operations are not supported, then ASSERT().\r
+  If StartBit is greater than 7, then ASSERT().\r
+  If EndBit is greater than 7, then ASSERT().\r
+  If EndBit is less than StartBit, then ASSERT().\r
+\r
+  @param  Port      The I/O port to write.\r
+  @param  StartBit  The ordinal of the least significant bit in the bit field.\r
+                    Range 0..7.\r
+  @param  EndBit    The ordinal of the most significant bit in the bit field.\r
+                    Range 0..7.\r
+  @param  AndData   The value to AND with the read value from the I/O port.\r
+  @param  OrData    The value to OR with the result of the AND operation.\r
+\r
+  @return The value written back to the I/O port.\r
+\r
+**/\r
+UINT8\r
+EFIAPI\r
+IoBitFieldAndThenOr8 (\r
+  IN      UINTN                     Port,\r
+  IN      UINTN                     StartBit,\r
+  IN      UINTN                     EndBit,\r
+  IN      UINT8                     AndData,\r
+  IN      UINT8                     OrData\r
+  )\r
+{\r
+  return IoWrite8 (\r
+           Port,\r
+           BitFieldAndThenOr8 (IoRead8 (Port), StartBit, EndBit, AndData, OrData)\r
+           );\r
+}\r
+\r
+/**\r
+  Reads a 16-bit I/O port, performs a bitwise inclusive OR, and writes the\r
+  result back to the 16-bit I/O port.\r
+\r
+  Reads the 16-bit I/O port specified by Port, performs a bitwise inclusive OR\r
+  between the read result and the value specified by OrData, and writes the\r
+  result to the 16-bit I/O port specified by Port. The value written to the I/O\r
+  port is returned. This function must guarantee that all I/O read and write\r
+  operations are serialized.\r
+\r
+  If 16-bit I/O port operations are not supported, then ASSERT().\r
+\r
+  @param  Port    The I/O port to write.\r
+  @param  OrData  The value to OR with the read value from the I/O port.\r
+\r
+  @return The value written back to the I/O port.\r
+\r
+**/\r
+UINT16\r
+EFIAPI\r
+IoOr16 (\r
+  IN      UINTN                     Port,\r
+  IN      UINT16                    OrData\r
+  )\r
+{\r
+  return IoWrite16 (Port, (UINT16) (IoRead16 (Port) | OrData));\r
+}\r
+\r
+/**\r
+  Reads a 16-bit I/O port, performs a bitwise AND, and writes the result back\r
+  to the 16-bit I/O port.\r
+\r
+  Reads the 16-bit I/O port specified by Port, performs a bitwise AND between\r
+  the read result and the value specified by AndData, and writes the result to\r
+  the 16-bit I/O port specified by Port. The value written to the I/O port is\r
+  returned. This function must guarantee that all I/O read and write operations\r
+  are serialized.\r
+\r
+  If 16-bit I/O port operations are not supported, then ASSERT().\r
+\r
+  @param  Port    The I/O port to write.\r
+  @param  AndData The value to AND with the read value from the I/O port.\r
+\r
+  @return The value written back to the I/O port.\r
+\r
+**/\r
+UINT16\r
+EFIAPI\r
+IoAnd16 (\r
+  IN      UINTN                     Port,\r
+  IN      UINT16                    AndData\r
+  )\r
+{\r
+  return IoWrite16 (Port, (UINT16) (IoRead16 (Port) & AndData));\r
+}\r
+\r
+/**\r
+  Reads a 16-bit I/O port, performs a bitwise AND followed by a bitwise\r
+  inclusive OR, and writes the result back to the 16-bit I/O port.\r
+\r
+  Reads the 16-bit I/O port specified by Port, performs a bitwise AND between\r
+  the read result and the value specified by AndData, performs a bitwise OR\r
+  between the result of the AND operation and the value specified by OrData,\r
+  and writes the result to the 16-bit I/O port specified by Port. The value\r
+  written to the I/O port is returned. This function must guarantee that all\r
+  I/O read and write operations are serialized.\r
+\r
+  If 16-bit I/O port operations are not supported, then ASSERT().\r
+\r
+  @param  Port    The I/O port to write.\r
+  @param  AndData The value to AND with the read value from the I/O port.\r
+  @param  OrData  The value to OR with the result of the AND operation.\r
+\r
+  @return The value written back to the I/O port.\r
+\r
+**/\r
+UINT16\r
+EFIAPI\r
+IoAndThenOr16 (\r
+  IN      UINTN                     Port,\r
+  IN      UINT16                    AndData,\r
+  IN      UINT16                    OrData\r
+  )\r
+{\r
+  return IoWrite16 (Port, (UINT16) ((IoRead16 (Port) & AndData) | OrData));\r
+}\r
+\r
+/**\r
+  Reads a bit field of an I/O register.\r
+\r
+  Reads the bit field in a 16-bit I/O register. The bit field is specified by\r
+  the StartBit and the EndBit. The value of the bit field is returned.\r
+\r
+  If 16-bit I/O port operations are not supported, then ASSERT().\r
+  If StartBit is greater than 15, then ASSERT().\r
+  If EndBit is greater than 15, then ASSERT().\r
+  If EndBit is less than StartBit, then ASSERT().\r
+\r
+  @param  Port      The I/O port to read.\r
+  @param  StartBit  The ordinal of the least significant bit in the bit field.\r
+                    Range 0..15.\r
+  @param  EndBit    The ordinal of the most significant bit in the bit field.\r
+                    Range 0..15.\r
+\r
+  @return The value read.\r
+\r
+**/\r
+UINT16\r
+EFIAPI\r
+IoBitFieldRead16 (\r
+  IN      UINTN                     Port,\r
+  IN      UINTN                     StartBit,\r
+  IN      UINTN                     EndBit\r
+  )\r
+{\r
+  return BitFieldRead16 (IoRead16 (Port), StartBit, EndBit);\r
+}\r
+\r
+/**\r
+  Writes a bit field to an I/O register.\r
+\r
+  Writes Value to the bit field of the I/O register. The bit field is specified\r
+  by the StartBit and the EndBit. All other bits in the destination I/O\r
+  register are preserved. The value written to the I/O port is returned. Extra\r
+  left bits in Value are stripped.\r
+\r
+  If 16-bit I/O port operations are not supported, then ASSERT().\r
+  If StartBit is greater than 15, then ASSERT().\r
+  If EndBit is greater than 15, then ASSERT().\r
+  If EndBit is less than StartBit, then ASSERT().\r
+\r
+  @param  Port      The I/O port to write.\r
+  @param  StartBit  The ordinal of the least significant bit in the bit field.\r
+                    Range 0..15.\r
+  @param  EndBit    The ordinal of the most significant bit in the bit field.\r
+                    Range 0..15.\r
+  @param  Value     New value of the bit field.\r
+\r
+  @return The value written back to the I/O port.\r
+\r
+**/\r
+UINT16\r
+EFIAPI\r
+IoBitFieldWrite16 (\r
+  IN      UINTN                     Port,\r
+  IN      UINTN                     StartBit,\r
+  IN      UINTN                     EndBit,\r
+  IN      UINT16                    Value\r
+  )\r
+{\r
+  return IoWrite16 (\r
+           Port,\r
+           BitFieldWrite16 (IoRead16 (Port), StartBit, EndBit, Value)\r
+           );\r
+}\r
+\r
+/**\r
+  Reads a bit field in a 16-bit port, performs a bitwise OR, and writes the\r
+  result back to the bit field in the 16-bit port.\r
+\r
+  Reads the 16-bit I/O port specified by Port, performs a bitwise inclusive OR\r
+  between the read result and the value specified by OrData, and writes the\r
+  result to the 16-bit I/O port specified by Port. The value written to the I/O\r
+  port is returned. This function must guarantee that all I/O read and write\r
+  operations are serialized. Extra left bits in OrData are stripped.\r
+\r
+  If 16-bit I/O port operations are not supported, then ASSERT().\r
+  If StartBit is greater than 15, then ASSERT().\r
+  If EndBit is greater than 15, then ASSERT().\r
+  If EndBit is less than StartBit, then ASSERT().\r
+\r
+  @param  Port      The I/O port to write.\r
+  @param  StartBit  The ordinal of the least significant bit in the bit field.\r
+                    Range 0..15.\r
+  @param  EndBit    The ordinal of the most significant bit in the bit field.\r
+                    Range 0..15.\r
+  @param  OrData    The value to OR with the read value from the I/O port.\r
+\r
+  @return The value written back to the I/O port.\r
+\r
+**/\r
+UINT16\r
+EFIAPI\r
+IoBitFieldOr16 (\r
+  IN      UINTN                     Port,\r
+  IN      UINTN                     StartBit,\r
+  IN      UINTN                     EndBit,\r
+  IN      UINT16                    OrData\r
+  )\r
+{\r
+  return IoWrite16 (\r
+           Port,\r
+           BitFieldOr16 (IoRead16 (Port), StartBit, EndBit, OrData)\r
+           );\r
+}\r
+\r
+/**\r
+  Reads a bit field in a 16-bit port, performs a bitwise AND, and writes the\r
+  result back to the bit field in the 16-bit port.\r
+\r
+  Reads the 16-bit I/O port specified by Port, performs a bitwise AND between\r
+  the read result and the value specified by AndData, and writes the result to\r
+  the 16-bit I/O port specified by Port. The value written to the I/O port is\r
+  returned. This function must guarantee that all I/O read and write operations\r
+  are serialized. Extra left bits in AndData are stripped.\r
+\r
+  If 16-bit I/O port operations are not supported, then ASSERT().\r
+  If StartBit is greater than 15, then ASSERT().\r
+  If EndBit is greater than 15, then ASSERT().\r
+  If EndBit is less than StartBit, then ASSERT().\r
+\r
+  @param  Port      The I/O port to write.\r
+  @param  StartBit  The ordinal of the least significant bit in the bit field.\r
+                    Range 0..15.\r
+  @param  EndBit    The ordinal of the most significant bit in the bit field.\r
+                    Range 0..15.\r
+  @param  AndData   The value to AND with the read value from the I/O port.\r
+\r
+  @return The value written back to the I/O port.\r
+\r
+**/\r
+UINT16\r
+EFIAPI\r
+IoBitFieldAnd16 (\r
+  IN      UINTN                     Port,\r
+  IN      UINTN                     StartBit,\r
+  IN      UINTN                     EndBit,\r
+  IN      UINT16                    AndData\r
+  )\r
+{\r
+  return IoWrite16 (\r
+           Port,\r
+           BitFieldAnd16 (IoRead16 (Port), StartBit, EndBit, AndData)\r
+           );\r
+}\r
+\r
+/**\r
+  Reads a bit field in a 16-bit port, performs a bitwise AND followed by a\r
+  bitwise inclusive OR, and writes the result back to the bit field in the\r
+  16-bit port.\r
+\r
+  Reads the 16-bit I/O port specified by Port, performs a bitwise AND followed\r
+  by a bitwise inclusive OR between the read result and the value specified by\r
+  AndData, and writes the result to the 16-bit I/O port specified by Port. The\r
+  value written to the I/O port is returned. This function must guarantee that\r
+  all I/O read and write operations are serialized. Extra left bits in both\r
+  AndData and OrData are stripped.\r
+\r
+  If 16-bit I/O port operations are not supported, then ASSERT().\r
+  If StartBit is greater than 15, then ASSERT().\r
+  If EndBit is greater than 15, then ASSERT().\r
+  If EndBit is less than StartBit, then ASSERT().\r
+\r
+  @param  Port      The I/O port to write.\r
+  @param  StartBit  The ordinal of the least significant bit in the bit field.\r
+                    Range 0..15.\r
+  @param  EndBit    The ordinal of the most significant bit in the bit field.\r
+                    Range 0..15.\r
+  @param  AndData   The value to AND with the read value from the I/O port.\r
+  @param  OrData    The value to OR with the result of the AND operation.\r
+\r
+  @return The value written back to the I/O port.\r
+\r
+**/\r
+UINT16\r
+EFIAPI\r
+IoBitFieldAndThenOr16 (\r
+  IN      UINTN                     Port,\r
+  IN      UINTN                     StartBit,\r
+  IN      UINTN                     EndBit,\r
+  IN      UINT16                    AndData,\r
+  IN      UINT16                    OrData\r
+  )\r
+{\r
+  return IoWrite16 (\r
+           Port,\r
+           BitFieldAndThenOr16 (IoRead16 (Port), StartBit, EndBit, AndData, OrData)\r
+           );\r
+}\r
+\r
+/**\r
+  Reads a 32-bit I/O port, performs a bitwise inclusive OR, and writes the\r
+  result back to the 32-bit I/O port.\r
+\r
+  Reads the 32-bit I/O port specified by Port, performs a bitwise inclusive OR\r
+  between the read result and the value specified by OrData, and writes the\r
+  result to the 32-bit I/O port specified by Port. The value written to the I/O\r
+  port is returned. This function must guarantee that all I/O read and write\r
+  operations are serialized.\r
+\r
+  If 32-bit I/O port operations are not supported, then ASSERT().\r
+\r
+  @param  Port    The I/O port to write.\r
+  @param  OrData  The value to OR with the read value from the I/O port.\r
+\r
+  @return The value written back to the I/O port.\r
+\r
+**/\r
+UINT32\r
+EFIAPI\r
+IoOr32 (\r
+  IN      UINTN                     Port,\r
+  IN      UINT32                    OrData\r
+  )\r
+{\r
+  return IoWrite32 (Port, IoRead32 (Port) | OrData);\r
+}\r
+\r
+/**\r
+  Reads a 32-bit I/O port, performs a bitwise AND, and writes the result back\r
+  to the 32-bit I/O port.\r
+\r
+  Reads the 32-bit I/O port specified by Port, performs a bitwise AND between\r
+  the read result and the value specified by AndData, and writes the result to\r
+  the 32-bit I/O port specified by Port. The value written to the I/O port is\r
+  returned. This function must guarantee that all I/O read and write operations\r
+  are serialized.\r
+\r
+  If 32-bit I/O port operations are not supported, then ASSERT().\r
+\r
+  @param  Port    The I/O port to write.\r
+  @param  AndData The value to AND with the read value from the I/O port.\r
+\r
+  @return The value written back to the I/O port.\r
+\r
+**/\r
+UINT32\r
+EFIAPI\r
+IoAnd32 (\r
+  IN      UINTN                     Port,\r
+  IN      UINT32                    AndData\r
+  )\r
+{\r
+  return IoWrite32 (Port, IoRead32 (Port) & AndData);\r
+}\r
+\r
+/**\r
+  Reads a 32-bit I/O port, performs a bitwise AND followed by a bitwise\r
+  inclusive OR, and writes the result back to the 32-bit I/O port.\r
+\r
+  Reads the 32-bit I/O port specified by Port, performs a bitwise AND between\r
+  the read result and the value specified by AndData, performs a bitwise OR\r
+  between the result of the AND operation and the value specified by OrData,\r
+  and writes the result to the 32-bit I/O port specified by Port. The value\r
+  written to the I/O port is returned. This function must guarantee that all\r
+  I/O read and write operations are serialized.\r
+\r
+  If 32-bit I/O port operations are not supported, then ASSERT().\r
+\r
+  @param  Port    The I/O port to write.\r
+  @param  AndData The value to AND with the read value from the I/O port.\r
+  @param  OrData  The value to OR with the result of the AND operation.\r
+\r
+  @return The value written back to the I/O port.\r
+\r
+**/\r
+UINT32\r
+EFIAPI\r
+IoAndThenOr32 (\r
+  IN      UINTN                     Port,\r
+  IN      UINT32                    AndData,\r
+  IN      UINT32                    OrData\r
+  )\r
+{\r
+  return IoWrite32 (Port, (IoRead32 (Port) & AndData) | OrData);\r
+}\r
+\r
+/**\r
+  Reads a bit field of an I/O register.\r
+\r
+  Reads the bit field in a 32-bit I/O register. The bit field is specified by\r
+  the StartBit and the EndBit. The value of the bit field is returned.\r
+\r
+  If 32-bit I/O port operations are not supported, then ASSERT().\r
+  If StartBit is greater than 31, then ASSERT().\r
+  If EndBit is greater than 31, then ASSERT().\r
+  If EndBit is less than StartBit, then ASSERT().\r
+\r
+  @param  Port      The I/O port to read.\r
+  @param  StartBit  The ordinal of the least significant bit in the bit field.\r
+                    Range 0..31.\r
+  @param  EndBit    The ordinal of the most significant bit in the bit field.\r
+                    Range 0..31.\r
+\r
+  @return The value read.\r
+\r
+**/\r
+UINT32\r
+EFIAPI\r
+IoBitFieldRead32 (\r
+  IN      UINTN                     Port,\r
+  IN      UINTN                     StartBit,\r
+  IN      UINTN                     EndBit\r
+  )\r
+{\r
+  return BitFieldRead32 (IoRead32 (Port), StartBit, EndBit);\r
+}\r
+\r
+/**\r
+  Writes a bit field to an I/O register.\r
+\r
+  Writes Value to the bit field of the I/O register. The bit field is specified\r
+  by the StartBit and the EndBit. All other bits in the destination I/O\r
+  register are preserved. The value written to the I/O port is returned. Extra\r
+  left bits in Value are stripped.\r
+\r
+  If 32-bit I/O port operations are not supported, then ASSERT().\r
+  If StartBit is greater than 31, then ASSERT().\r
+  If EndBit is greater than 31, then ASSERT().\r
+  If EndBit is less than StartBit, then ASSERT().\r
+\r
+  @param  Port      The I/O port to write.\r
+  @param  StartBit  The ordinal of the least significant bit in the bit field.\r
+                    Range 0..31.\r
+  @param  EndBit    The ordinal of the most significant bit in the bit field.\r
+                    Range 0..31.\r
+  @param  Value     New value of the bit field.\r
+\r
+  @return The value written back to the I/O port.\r
+\r
+**/\r
+UINT32\r
+EFIAPI\r
+IoBitFieldWrite32 (\r
+  IN      UINTN                     Port,\r
+  IN      UINTN                     StartBit,\r
+  IN      UINTN                     EndBit,\r
+  IN      UINT32                    Value\r
+  )\r
+{\r
+  return IoWrite32 (\r
+           Port,\r
+           BitFieldWrite32 (IoRead32 (Port), StartBit, EndBit, Value)\r
+           );\r
+}\r
+\r
+/**\r
+  Reads a bit field in a 32-bit port, performs a bitwise OR, and writes the\r
+  result back to the bit field in the 32-bit port.\r
+\r
+  Reads the 32-bit I/O port specified by Port, performs a bitwise inclusive OR\r
+  between the read result and the value specified by OrData, and writes the\r
+  result to the 32-bit I/O port specified by Port. The value written to the I/O\r
+  port is returned. This function must guarantee that all I/O read and write\r
+  operations are serialized. Extra left bits in OrData are stripped.\r
+\r
+  If 32-bit I/O port operations are not supported, then ASSERT().\r
+  If StartBit is greater than 31, then ASSERT().\r
+  If EndBit is greater than 31, then ASSERT().\r
+  If EndBit is less than StartBit, then ASSERT().\r
+\r
+  @param  Port      The I/O port to write.\r
+  @param  StartBit  The ordinal of the least significant bit in the bit field.\r
+                    Range 0..31.\r
+  @param  EndBit    The ordinal of the most significant bit in the bit field.\r
+                    Range 0..31.\r
+  @param  OrData    The value to OR with the read value from the I/O port.\r
+\r
+  @return The value written back to the I/O port.\r
+\r
+**/\r
+UINT32\r
+EFIAPI\r
+IoBitFieldOr32 (\r
+  IN      UINTN                     Port,\r
+  IN      UINTN                     StartBit,\r
+  IN      UINTN                     EndBit,\r
+  IN      UINT32                    OrData\r
+  )\r
+{\r
+  return IoWrite32 (\r
+           Port,\r
+           BitFieldOr32 (IoRead32 (Port), StartBit, EndBit, OrData)\r
+           );\r
+}\r
+\r
+/**\r
+  Reads a bit field in a 32-bit port, performs a bitwise AND, and writes the\r
+  result back to the bit field in the 32-bit port.\r
+\r
+  Reads the 32-bit I/O port specified by Port, performs a bitwise AND between\r
+  the read result and the value specified by AndData, and writes the result to\r
+  the 32-bit I/O port specified by Port. The value written to the I/O port is\r
+  returned. This function must guarantee that all I/O read and write operations\r
+  are serialized. Extra left bits in AndData are stripped.\r
+\r
+  If 32-bit I/O port operations are not supported, then ASSERT().\r
+  If StartBit is greater than 31, then ASSERT().\r
+  If EndBit is greater than 31, then ASSERT().\r
+  If EndBit is less than StartBit, then ASSERT().\r
+\r
+  @param  Port      The I/O port to write.\r
+  @param  StartBit  The ordinal of the least significant bit in the bit field.\r
+                    Range 0..31.\r
+  @param  EndBit    The ordinal of the most significant bit in the bit field.\r
+                    Range 0..31.\r
+  @param  AndData   The value to AND with the read value from the I/O port.\r
+\r
+  @return The value written back to the I/O port.\r
+\r
+**/\r
+UINT32\r
+EFIAPI\r
+IoBitFieldAnd32 (\r
+  IN      UINTN                     Port,\r
+  IN      UINTN                     StartBit,\r
+  IN      UINTN                     EndBit,\r
+  IN      UINT32                    AndData\r
+  )\r
+{\r
+  return IoWrite32 (\r
+           Port,\r
+           BitFieldAnd32 (IoRead32 (Port), StartBit, EndBit, AndData)\r
+           );\r
+}\r
+\r
+/**\r
+  Reads a bit field in a 32-bit port, performs a bitwise AND followed by a\r
+  bitwise inclusive OR, and writes the result back to the bit field in the\r
+  32-bit port.\r
+\r
+  Reads the 32-bit I/O port specified by Port, performs a bitwise AND followed\r
+  by a bitwise inclusive OR between the read result and the value specified by\r
+  AndData, and writes the result to the 32-bit I/O port specified by Port. The\r
+  value written to the I/O port is returned. This function must guarantee that\r
+  all I/O read and write operations are serialized. Extra left bits in both\r
+  AndData and OrData are stripped.\r
+\r
+  If 32-bit I/O port operations are not supported, then ASSERT().\r
+  If StartBit is greater than 31, then ASSERT().\r
+  If EndBit is greater than 31, then ASSERT().\r
+  If EndBit is less than StartBit, then ASSERT().\r
+\r
+  @param  Port      The I/O port to write.\r
+  @param  StartBit  The ordinal of the least significant bit in the bit field.\r
+                    Range 0..31.\r
+  @param  EndBit    The ordinal of the most significant bit in the bit field.\r
+                    Range 0..31.\r
+  @param  AndData   The value to AND with the read value from the I/O port.\r
+  @param  OrData    The value to OR with the result of the AND operation.\r
+\r
+  @return The value written back to the I/O port.\r
+\r
+**/\r
+UINT32\r
+EFIAPI\r
+IoBitFieldAndThenOr32 (\r
+  IN      UINTN                     Port,\r
+  IN      UINTN                     StartBit,\r
+  IN      UINTN                     EndBit,\r
+  IN      UINT32                    AndData,\r
+  IN      UINT32                    OrData\r
+  )\r
+{\r
+  return IoWrite32 (\r
+           Port,\r
+           BitFieldAndThenOr32 (IoRead32 (Port), StartBit, EndBit, AndData, OrData)\r
+           );\r
+}\r
+\r
+/**\r
+  Reads a 64-bit I/O port, performs a bitwise inclusive OR, and writes the\r
+  result back to the 64-bit I/O port.\r
+\r
+  Reads the 64-bit I/O port specified by Port, performs a bitwise inclusive OR\r
+  between the read result and the value specified by OrData, and writes the\r
+  result to the 64-bit I/O port specified by Port. The value written to the I/O\r
+  port is returned. This function must guarantee that all I/O read and write\r
+  operations are serialized.\r
+\r
+  If 64-bit I/O port operations are not supported, then ASSERT().\r
+\r
+  @param  Port    The I/O port to write.\r
+  @param  OrData  The value to OR with the read value from the I/O port.\r
+\r
+  @return The value written back to the I/O port.\r
+\r
+**/\r
+UINT64\r
+EFIAPI\r
+IoOr64 (\r
+  IN      UINTN                     Port,\r
+  IN      UINT64                    OrData\r
+  )\r
+{\r
+  return IoWrite64 (Port, IoRead64 (Port) | OrData);\r
+}\r
+\r
+/**\r
+  Reads a 64-bit I/O port, performs a bitwise AND, and writes the result back\r
+  to the 64-bit I/O port.\r
+\r
+  Reads the 64-bit I/O port specified by Port, performs a bitwise AND between\r
+  the read result and the value specified by AndData, and writes the result to\r
+  the 64-bit I/O port specified by Port. The value written to the I/O port is\r
+  returned. This function must guarantee that all I/O read and write operations\r
+  are serialized.\r
+\r
+  If 64-bit I/O port operations are not supported, then ASSERT().\r
+\r
+  @param  Port    The I/O port to write.\r
+  @param  AndData The value to AND with the read value from the I/O port.\r
+\r
+  @return The value written back to the I/O port.\r
+\r
+**/\r
+UINT64\r
+EFIAPI\r
+IoAnd64 (\r
+  IN      UINTN                     Port,\r
+  IN      UINT64                    AndData\r
+  )\r
+{\r
+  return IoWrite64 (Port, IoRead64 (Port) & AndData);\r
+}\r
+\r
+/**\r
+  Reads a 64-bit I/O port, performs a bitwise AND followed by a bitwise\r
+  inclusive OR, and writes the result back to the 64-bit I/O port.\r
+\r
+  Reads the 64-bit I/O port specified by Port, performs a bitwise AND between\r
+  the read result and the value specified by AndData, performs a bitwise OR\r
+  between the result of the AND operation and the value specified by OrData,\r
+  and writes the result to the 64-bit I/O port specified by Port. The value\r
+  written to the I/O port is returned. This function must guarantee that all\r
+  I/O read and write operations are serialized.\r
+\r
+  If 64-bit I/O port operations are not supported, then ASSERT().\r
+\r
+  @param  Port    The I/O port to write.\r
+  @param  AndData The value to AND with the read value from the I/O port.\r
+  @param  OrData  The value to OR with the result of the AND operation.\r
+\r
+  @return The value written back to the I/O port.\r
+\r
+**/\r
+UINT64\r
+EFIAPI\r
+IoAndThenOr64 (\r
+  IN      UINTN                     Port,\r
+  IN      UINT64                    AndData,\r
+  IN      UINT64                    OrData\r
+  )\r
+{\r
+  return IoWrite64 (Port, (IoRead64 (Port) & AndData) | OrData);\r
+}\r
+\r
+/**\r
+  Reads a bit field of an I/O register.\r
+\r
+  Reads the bit field in a 64-bit I/O register. The bit field is specified by\r
+  the StartBit and the EndBit. The value of the bit field is returned.\r
+\r
+  If 64-bit I/O port operations are not supported, then ASSERT().\r
+  If StartBit is greater than 63, then ASSERT().\r
+  If EndBit is greater than 63, then ASSERT().\r
+  If EndBit is less than StartBit, then ASSERT().\r
+\r
+  @param  Port      The I/O port to read.\r
+  @param  StartBit  The ordinal of the least significant bit in the bit field.\r
+                    Range 0..63.\r
+  @param  EndBit    The ordinal of the most significant bit in the bit field.\r
+                    Range 0..63.\r
+\r
+  @return The value read.\r
+\r
+**/\r
+UINT64\r
+EFIAPI\r
+IoBitFieldRead64 (\r
+  IN      UINTN                     Port,\r
+  IN      UINTN                     StartBit,\r
+  IN      UINTN                     EndBit\r
+  )\r
+{\r
+  return BitFieldRead64 (IoRead64 (Port), StartBit, EndBit);\r
+}\r
+\r
+/**\r
+  Writes a bit field to an I/O register.\r
+\r
+  Writes Value to the bit field of the I/O register. The bit field is specified\r
+  by the StartBit and the EndBit. All other bits in the destination I/O\r
+  register are preserved. The value written to the I/O port is returned. Extra\r
+  left bits in Value are stripped.\r
+\r
+  If 64-bit I/O port operations are not supported, then ASSERT().\r
+  If StartBit is greater than 63, then ASSERT().\r
+  If EndBit is greater than 63, then ASSERT().\r
+  If EndBit is less than StartBit, then ASSERT().\r
+\r
+  @param  Port      The I/O port to write.\r
+  @param  StartBit  The ordinal of the least significant bit in the bit field.\r
+                    Range 0..63.\r
+  @param  EndBit    The ordinal of the most significant bit in the bit field.\r
+                    Range 0..63.\r
+  @param  Value     New value of the bit field.\r
+\r
+  @return The value written back to the I/O port.\r
+\r
+**/\r
+UINT64\r
+EFIAPI\r
+IoBitFieldWrite64 (\r
+  IN      UINTN                     Port,\r
+  IN      UINTN                     StartBit,\r
+  IN      UINTN                     EndBit,\r
+  IN      UINT64                    Value\r
+  )\r
+{\r
+  return IoWrite64 (\r
+           Port,\r
+           BitFieldWrite64 (IoRead64 (Port), StartBit, EndBit, Value)\r
+           );\r
+}\r
+\r
+/**\r
+  Reads a bit field in a 64-bit port, performs a bitwise OR, and writes the\r
+  result back to the bit field in the 64-bit port.\r
+\r
+  Reads the 64-bit I/O port specified by Port, performs a bitwise inclusive OR\r
+  between the read result and the value specified by OrData, and writes the\r
+  result to the 64-bit I/O port specified by Port. The value written to the I/O\r
+  port is returned. This function must guarantee that all I/O read and write\r
+  operations are serialized. Extra left bits in OrData are stripped.\r
+\r
+  If 64-bit I/O port operations are not supported, then ASSERT().\r
+  If StartBit is greater than 63, then ASSERT().\r
+  If EndBit is greater than 63, then ASSERT().\r
+  If EndBit is less than StartBit, then ASSERT().\r
+\r
+  @param  Port      The I/O port to write.\r
+  @param  StartBit  The ordinal of the least significant bit in the bit field.\r
+                    Range 0..63.\r
+  @param  EndBit    The ordinal of the most significant bit in the bit field.\r
+                    Range 0..63.\r
+  @param  OrData    The value to OR with the read value from the I/O port.\r
+\r
+  @return The value written back to the I/O port.\r
+\r
+**/\r
+UINT64\r
+EFIAPI\r
+IoBitFieldOr64 (\r
+  IN      UINTN                     Port,\r
+  IN      UINTN                     StartBit,\r
+  IN      UINTN                     EndBit,\r
+  IN      UINT64                    OrData\r
+  )\r
+{\r
+  return IoWrite64 (\r
+           Port,\r
+           BitFieldOr64 (IoRead64 (Port), StartBit, EndBit, OrData)\r
+           );\r
+}\r
+\r
+/**\r
+  Reads a bit field in a 64-bit port, performs a bitwise AND, and writes the\r
+  result back to the bit field in the 64-bit port.\r
+\r
+  Reads the 64-bit I/O port specified by Port, performs a bitwise AND between\r
+  the read result and the value specified by AndData, and writes the result to\r
+  the 64-bit I/O port specified by Port. The value written to the I/O port is\r
+  returned. This function must guarantee that all I/O read and write operations\r
+  are serialized. Extra left bits in AndData are stripped.\r
+\r
+  If 64-bit I/O port operations are not supported, then ASSERT().\r
+  If StartBit is greater than 63, then ASSERT().\r
+  If EndBit is greater than 63, then ASSERT().\r
+  If EndBit is less than StartBit, then ASSERT().\r
+\r
+  @param  Port      The I/O port to write.\r
+  @param  StartBit  The ordinal of the least significant bit in the bit field.\r
+                    Range 0..63.\r
+  @param  EndBit    The ordinal of the most significant bit in the bit field.\r
+                    Range 0..63.\r
+  @param  AndData   The value to AND with the read value from the I/O port.\r
+\r
+  @return The value written back to the I/O port.\r
+\r
+**/\r
+UINT64\r
+EFIAPI\r
+IoBitFieldAnd64 (\r
+  IN      UINTN                     Port,\r
+  IN      UINTN                     StartBit,\r
+  IN      UINTN                     EndBit,\r
+  IN      UINT64                    AndData\r
+  )\r
+{\r
+  return IoWrite64 (\r
+           Port,\r
+           BitFieldAnd64 (IoRead64 (Port), StartBit, EndBit, AndData)\r
+           );\r
+}\r
+\r
+/**\r
+  Reads a bit field in a 64-bit port, performs a bitwise AND followed by a\r
+  bitwise inclusive OR, and writes the result back to the bit field in the\r
+  64-bit port.\r
+\r
+  Reads the 64-bit I/O port specified by Port, performs a bitwise AND followed\r
+  by a bitwise inclusive OR between the read result and the value specified by\r
+  AndData, and writes the result to the 64-bit I/O port specified by Port. The\r
+  value written to the I/O port is returned. This function must guarantee that\r
+  all I/O read and write operations are serialized. Extra left bits in both\r
+  AndData and OrData are stripped.\r
+\r
+  If 64-bit I/O port operations are not supported, then ASSERT().\r
+  If StartBit is greater than 63, then ASSERT().\r
+  If EndBit is greater than 63, then ASSERT().\r
+  If EndBit is less than StartBit, then ASSERT().\r
+\r
+  @param  Port      The I/O port to write.\r
+  @param  StartBit  The ordinal of the least significant bit in the bit field.\r
+                    Range 0..63.\r
+  @param  EndBit    The ordinal of the most significant bit in the bit field.\r
+                    Range 0..63.\r
+  @param  AndData   The value to AND with the read value from the I/O port.\r
+  @param  OrData    The value to OR with the result of the AND operation.\r
+\r
+  @return The value written back to the I/O port.\r
+\r
+**/\r
+UINT64\r
+EFIAPI\r
+IoBitFieldAndThenOr64 (\r
+  IN      UINTN                     Port,\r
+  IN      UINTN                     StartBit,\r
+  IN      UINTN                     EndBit,\r
+  IN      UINT64                    AndData,\r
+  IN      UINT64                    OrData\r
+  )\r
+{\r
+  return IoWrite64 (\r
+           Port,\r
+           BitFieldAndThenOr64 (IoRead64 (Port), StartBit, EndBit, AndData, OrData)\r
+           );\r
+}\r
+\r
+/**\r
+  Reads an 8-bit MMIO register, performs a bitwise inclusive OR, and writes the\r
+  result back to the 8-bit MMIO register.\r
+\r
+  Reads the 8-bit MMIO register specified by Address, performs a bitwise\r
+  inclusive OR between the read result and the value specified by OrData, and\r
+  writes the result to the 8-bit MMIO register specified by Address. The value\r
+  written to the MMIO register is returned. This function must guarantee that\r
+  all MMIO read and write operations are serialized.\r
+\r
+  If 8-bit MMIO register operations are not supported, then ASSERT().\r
+\r
+  @param  Address The MMIO register to write.\r
+  @param  OrData  The value to OR with the read value from the MMIO register.\r
+\r
+  @return The value written back to the MMIO register.\r
+\r
+**/\r
+UINT8\r
+EFIAPI\r
+MmioOr8 (\r
+  IN      UINTN                     Address,\r
+  IN      UINT8                     OrData\r
+  )\r
+{\r
+  return MmioWrite8 (Address, (UINT8) (MmioRead8 (Address) | OrData));\r
+}\r
+\r
+/**\r
+  Reads an 8-bit MMIO register, performs a bitwise AND, and writes the result\r
+  back to the 8-bit MMIO register.\r
+\r
+  Reads the 8-bit MMIO register specified by Address, performs a bitwise AND\r
+  between the read result and the value specified by AndData, and writes the\r
+  result to the 8-bit MMIO register specified by Address. The value written to\r
+  the MMIO register is returned. This function must guarantee that all MMIO\r
+  read and write operations are serialized.\r
+\r
+  If 8-bit MMIO register operations are not supported, then ASSERT().\r
+\r
+  @param  Address The MMIO register to write.\r
+  @param  AndData The value to AND with the read value from the MMIO register.\r
+\r
+  @return The value written back to the MMIO register.\r
+\r
+**/\r
+UINT8\r
+EFIAPI\r
+MmioAnd8 (\r
+  IN      UINTN                     Address,\r
+  IN      UINT8                     AndData\r
+  )\r
+{\r
+  return MmioWrite8 (Address, (UINT8) (MmioRead8 (Address) & AndData));\r
+}\r
+\r
+/**\r
+  Reads an 8-bit MMIO register, performs a bitwise AND followed by a bitwise\r
+  inclusive OR, and writes the result back to the 8-bit MMIO register.\r
+\r
+  Reads the 8-bit MMIO register specified by Address, performs a bitwise AND\r
+  between the read result and the value specified by AndData, performs a\r
+  bitwise OR between the result of the AND operation and the value specified by\r
+  OrData, and writes the result to the 8-bit MMIO register specified by\r
+  Address. The value written to the MMIO register is returned. This function\r
+  must guarantee that all MMIO read and write operations are serialized.\r
+\r
+  If 8-bit MMIO register operations are not supported, then ASSERT().\r
+\r
+\r
+  @param  Address The MMIO register to write.\r
+  @param  AndData The value to AND with the read value from the MMIO register.\r
+  @param  OrData  The value to OR with the result of the AND operation.\r
+\r
+  @return The value written back to the MMIO register.\r
+\r
+**/\r
+UINT8\r
+EFIAPI\r
+MmioAndThenOr8 (\r
+  IN      UINTN                     Address,\r
+  IN      UINT8                     AndData,\r
+  IN      UINT8                     OrData\r
+  )\r
+{\r
+  return MmioWrite8 (Address, (UINT8) ((MmioRead8 (Address) & AndData) | OrData));\r
+}\r
+\r
+/**\r
+  Reads a bit field of a MMIO register.\r
+\r
+  Reads the bit field in an 8-bit MMIO register. The bit field is specified by\r
+  the StartBit and the EndBit. The value of the bit field is returned.\r
+\r
+  If 8-bit MMIO register operations are not supported, then ASSERT().\r
+  If StartBit is greater than 7, then ASSERT().\r
+  If EndBit is greater than 7, then ASSERT().\r
+  If EndBit is less than StartBit, then ASSERT().\r
+\r
+  @param  Address   MMIO register to read.\r
+  @param  StartBit  The ordinal of the least significant bit in the bit field.\r
+                    Range 0..7.\r
+  @param  EndBit    The ordinal of the most significant bit in the bit field.\r
+                    Range 0..7.\r
+\r
+  @return The value read.\r
+\r
+**/\r
+UINT8\r
+EFIAPI\r
+MmioBitFieldRead8 (\r
+  IN      UINTN                     Address,\r
+  IN      UINTN                     StartBit,\r
+  IN      UINTN                     EndBit\r
+  )\r
+{\r
+  return BitFieldRead8 (MmioRead8 (Address), StartBit, EndBit);\r
+}\r
+\r
+/**\r
+  Writes a bit field to a MMIO register.\r
+\r
+  Writes Value to the bit field of the MMIO register. The bit field is\r
+  specified by the StartBit and the EndBit. All other bits in the destination\r
+  MMIO register are preserved. The new value of the 8-bit register is returned.\r
+\r
+  If 8-bit MMIO register operations are not supported, then ASSERT().\r
+  If StartBit is greater than 7, then ASSERT().\r
+  If EndBit is greater than 7, then ASSERT().\r
+  If EndBit is less than StartBit, then ASSERT().\r
+\r
+  @param  Address   MMIO register to write.\r
+  @param  StartBit  The ordinal of the least significant bit in the bit field.\r
+                    Range 0..7.\r
+  @param  EndBit    The ordinal of the most significant bit in the bit field.\r
+                    Range 0..7.\r
+  @param  Value     New value of the bit field.\r
+\r
+  @return The value written back to the MMIO register.\r
+\r
+**/\r
+UINT8\r
+EFIAPI\r
+MmioBitFieldWrite8 (\r
+  IN      UINTN                     Address,\r
+  IN      UINTN                     StartBit,\r
+  IN      UINTN                     EndBit,\r
+  IN      UINT8                     Value\r
+  )\r
+{\r
+  return MmioWrite8 (\r
+           Address,\r
+           BitFieldWrite8 (MmioRead8 (Address), StartBit, EndBit, Value)\r
+           );\r
+}\r
+\r
+/**\r
+  Reads a bit field in an 8-bit MMIO register, performs a bitwise OR, and\r
+  writes the result back to the bit field in the 8-bit MMIO register.\r
+\r
+  Reads the 8-bit MMIO register specified by Address, performs a bitwise\r
+  inclusive OR between the read result and the value specified by OrData, and\r
+  writes the result to the 8-bit MMIO register specified by Address. The value\r
+  written to the MMIO register is returned. This function must guarantee that\r
+  all MMIO read and write operations are serialized. Extra left bits in OrData\r
+  are stripped.\r
+\r
+  If 8-bit MMIO register operations are not supported, then ASSERT().\r
+  If StartBit is greater than 7, then ASSERT().\r
+  If EndBit is greater than 7, then ASSERT().\r
+  If EndBit is less than StartBit, then ASSERT().\r
+\r
+  @param  Address   MMIO register to write.\r
+  @param  StartBit  The ordinal of the least significant bit in the bit field.\r
+                    Range 0..7.\r
+  @param  EndBit    The ordinal of the most significant bit in the bit field.\r
+                    Range 0..7.\r
+  @param  OrData    The value to OR with read value from the MMIO register.\r
+\r
+  @return The value written back to the MMIO register.\r
+\r
+**/\r
+UINT8\r
+EFIAPI\r
+MmioBitFieldOr8 (\r
+  IN      UINTN                     Address,\r
+  IN      UINTN                     StartBit,\r
+  IN      UINTN                     EndBit,\r
+  IN      UINT8                     OrData\r
+  )\r
+{\r
+  return MmioWrite8 (\r
+           Address,\r
+           BitFieldOr8 (MmioRead8 (Address), StartBit, EndBit, OrData)\r
+           );\r
+}\r
+\r
+/**\r
+  Reads a bit field in an 8-bit MMIO register, performs a bitwise AND, and\r
+  writes the result back to the bit field in the 8-bit MMIO register.\r
+\r
+  Reads the 8-bit MMIO register specified by Address, performs a bitwise AND\r
+  between the read result and the value specified by AndData, and writes the\r
+  result to the 8-bit MMIO register specified by Address. The value written to\r
+  the MMIO register is returned. This function must guarantee that all MMIO\r
+  read and write operations are serialized. Extra left bits in AndData are\r
+  stripped.\r
+\r
+  If 8-bit MMIO register operations are not supported, then ASSERT().\r
+  If StartBit is greater than 7, then ASSERT().\r
+  If EndBit is greater than 7, then ASSERT().\r
+  If EndBit is less than StartBit, then ASSERT().\r
+\r
+  @param  Address   MMIO register to write.\r
+  @param  StartBit  The ordinal of the least significant bit in the bit field.\r
+                    Range 0..7.\r
+  @param  EndBit    The ordinal of the most significant bit in the bit field.\r
+                    Range 0..7.\r
+  @param  AndData   The value to AND with read value from the MMIO register.\r
+\r
+  @return The value written back to the MMIO register.\r
+\r
+**/\r
+UINT8\r
+EFIAPI\r
+MmioBitFieldAnd8 (\r
+  IN      UINTN                     Address,\r
+  IN      UINTN                     StartBit,\r
+  IN      UINTN                     EndBit,\r
+  IN      UINT8                     AndData\r
+  )\r
+{\r
+  return MmioWrite8 (\r
+           Address,\r
+           BitFieldAnd8 (MmioRead8 (Address), StartBit, EndBit, AndData)\r
+           );\r
+}\r
+\r
+/**\r
+  Reads a bit field in an 8-bit MMIO register, performs a bitwise AND followed\r
+  by a bitwise inclusive OR, and writes the result back to the bit field in the\r
+  8-bit MMIO register.\r
+\r
+  Reads the 8-bit MMIO register specified by Address, performs a bitwise AND\r
+  followed by a bitwise inclusive OR between the read result and the value\r
+  specified by AndData, and writes the result to the 8-bit MMIO register\r
+  specified by Address. The value written to the MMIO register is returned.\r
+  This function must guarantee that all MMIO read and write operations are\r
+  serialized. Extra left bits in both AndData and OrData are stripped.\r
+\r
+  If 8-bit MMIO register operations are not supported, then ASSERT().\r
+  If StartBit is greater than 7, then ASSERT().\r
+  If EndBit is greater than 7, then ASSERT().\r
+  If EndBit is less than StartBit, then ASSERT().\r
+\r
+  @param  Address   MMIO register to write.\r
+  @param  StartBit  The ordinal of the least significant bit in the bit field.\r
+                    Range 0..7.\r
+  @param  EndBit    The ordinal of the most significant bit in the bit field.\r
+                    Range 0..7.\r
+  @param  AndData   The value to AND with read value from the MMIO register.\r
+  @param  OrData    The value to OR with the result of the AND operation.\r
+\r
+  @return The value written back to the MMIO register.\r
+\r
+**/\r
+UINT8\r
+EFIAPI\r
+MmioBitFieldAndThenOr8 (\r
+  IN      UINTN                     Address,\r
+  IN      UINTN                     StartBit,\r
+  IN      UINTN                     EndBit,\r
+  IN      UINT8                     AndData,\r
+  IN      UINT8                     OrData\r
+  )\r
+{\r
+  return MmioWrite8 (\r
+           Address,\r
+           BitFieldAndThenOr8 (MmioRead8 (Address), StartBit, EndBit, AndData, OrData)\r
+           );\r
+}\r
+\r
+/**\r
+  Reads a 16-bit MMIO register, performs a bitwise inclusive OR, and writes the\r
+  result back to the 16-bit MMIO register.\r
+\r
+  Reads the 16-bit MMIO register specified by Address, performs a bitwise\r
+  inclusive OR between the read result and the value specified by OrData, and\r
+  writes the result to the 16-bit MMIO register specified by Address. The value\r
+  written to the MMIO register is returned. This function must guarantee that\r
+  all MMIO read and write operations are serialized.\r
+\r
+  If 16-bit MMIO register operations are not supported, then ASSERT().\r
+\r
+  @param  Address The MMIO register to write.\r
+  @param  OrData  The value to OR with the read value from the MMIO register.\r
+\r
+  @return The value written back to the MMIO register.\r
+\r
+**/\r
+UINT16\r
+EFIAPI\r
+MmioOr16 (\r
+  IN      UINTN                     Address,\r
+  IN      UINT16                    OrData\r
+  )\r
+{\r
+  return MmioWrite16 (Address, (UINT16) (MmioRead16 (Address) | OrData));\r
+}\r
+\r
+/**\r
+  Reads a 16-bit MMIO register, performs a bitwise AND, and writes the result\r
+  back to the 16-bit MMIO register.\r
+\r
+  Reads the 16-bit MMIO register specified by Address, performs a bitwise AND\r
+  between the read result and the value specified by AndData, and writes the\r
+  result to the 16-bit MMIO register specified by Address. The value written to\r
+  the MMIO register is returned. This function must guarantee that all MMIO\r
+  read and write operations are serialized.\r
+\r
+  If 16-bit MMIO register operations are not supported, then ASSERT().\r
+\r
+  @param  Address The MMIO register to write.\r
+  @param  AndData The value to AND with the read value from the MMIO register.\r
+\r
+  @return The value written back to the MMIO register.\r
+\r
+**/\r
+UINT16\r
+EFIAPI\r
+MmioAnd16 (\r
+  IN      UINTN                     Address,\r
+  IN      UINT16                    AndData\r
+  )\r
+{\r
+  return MmioWrite16 (Address, (UINT16) (MmioRead16 (Address) & AndData));\r
+}\r
+\r
+/**\r
+  Reads a 16-bit MMIO register, performs a bitwise AND followed by a bitwise\r
+  inclusive OR, and writes the result back to the 16-bit MMIO register.\r
+\r
+  Reads the 16-bit MMIO register specified by Address, performs a bitwise AND\r
+  between the read result and the value specified by AndData, performs a\r
+  bitwise OR between the result of the AND operation and the value specified by\r
+  OrData, and writes the result to the 16-bit MMIO register specified by\r
+  Address. The value written to the MMIO register is returned. This function\r
+  must guarantee that all MMIO read and write operations are serialized.\r
+\r
+  If 16-bit MMIO register operations are not supported, then ASSERT().\r
+\r
+\r
+  @param  Address The MMIO register to write.\r
+  @param  AndData The value to AND with the read value from the MMIO register.\r
+  @param  OrData  The value to OR with the result of the AND operation.\r
+\r
+  @return The value written back to the MMIO register.\r
+\r
+**/\r
+UINT16\r
+EFIAPI\r
+MmioAndThenOr16 (\r
+  IN      UINTN                     Address,\r
+  IN      UINT16                    AndData,\r
+  IN      UINT16                    OrData\r
+  )\r
+{\r
+  return MmioWrite16 (Address, (UINT16) ((MmioRead16 (Address) & AndData) | OrData));\r
+}\r
+\r
+/**\r
+  Reads a bit field of a MMIO register.\r
+\r
+  Reads the bit field in a 16-bit MMIO register. The bit field is specified by\r
+  the StartBit and the EndBit. The value of the bit field is returned.\r
+\r
+  If 16-bit MMIO register operations are not supported, then ASSERT().\r
+  If StartBit is greater than 15, then ASSERT().\r
+  If EndBit is greater than 15, then ASSERT().\r
+  If EndBit is less than StartBit, then ASSERT().\r
+\r
+  @param  Address   MMIO register to read.\r
+  @param  StartBit  The ordinal of the least significant bit in the bit field.\r
+                    Range 0..15.\r
+  @param  EndBit    The ordinal of the most significant bit in the bit field.\r
+                    Range 0..15.\r
+\r
+  @return The value read.\r
+\r
+**/\r
+UINT16\r
+EFIAPI\r
+MmioBitFieldRead16 (\r
+  IN      UINTN                     Address,\r
+  IN      UINTN                     StartBit,\r
+  IN      UINTN                     EndBit\r
+  )\r
+{\r
+  return BitFieldRead16 (MmioRead16 (Address), StartBit, EndBit);\r
+}\r
+\r
+/**\r
+  Writes a bit field to a MMIO register.\r
+\r
+  Writes Value to the bit field of the MMIO register. The bit field is\r
+  specified by the StartBit and the EndBit. All other bits in the destination\r
+  MMIO register are preserved. The new value of the 16-bit register is returned.\r
+\r
+  If 16-bit MMIO register operations are not supported, then ASSERT().\r
+  If StartBit is greater than 15, then ASSERT().\r
+  If EndBit is greater than 15, then ASSERT().\r
+  If EndBit is less than StartBit, then ASSERT().\r
+\r
+  @param  Address   MMIO register to write.\r
+  @param  StartBit  The ordinal of the least significant bit in the bit field.\r
+                    Range 0..15.\r
+  @param  EndBit    The ordinal of the most significant bit in the bit field.\r
+                    Range 0..15.\r
+  @param  Value     New value of the bit field.\r
+\r
+  @return The value written back to the MMIO register.\r
+\r
+**/\r
+UINT16\r
+EFIAPI\r
+MmioBitFieldWrite16 (\r
+  IN      UINTN                     Address,\r
+  IN      UINTN                     StartBit,\r
+  IN      UINTN                     EndBit,\r
+  IN      UINT16                    Value\r
+  )\r
+{\r
+  return MmioWrite16 (\r
+           Address,\r
+           BitFieldWrite16 (MmioRead16 (Address), StartBit, EndBit, Value)\r
+           );\r
+}\r
+\r
+/**\r
+  Reads a bit field in a 16-bit MMIO register, performs a bitwise OR, and\r
+  writes the result back to the bit field in the 16-bit MMIO register.\r
+\r
+  Reads the 16-bit MMIO register specified by Address, performs a bitwise\r
+  inclusive OR between the read result and the value specified by OrData, and\r
+  writes the result to the 16-bit MMIO register specified by Address. The value\r
+  written to the MMIO register is returned. This function must guarantee that\r
+  all MMIO read and write operations are serialized. Extra left bits in OrData\r
+  are stripped.\r
+\r
+  If 16-bit MMIO register operations are not supported, then ASSERT().\r
+  If StartBit is greater than 15, then ASSERT().\r
+  If EndBit is greater than 15, then ASSERT().\r
+  If EndBit is less than StartBit, then ASSERT().\r
+\r
+  @param  Address   MMIO register to write.\r
+  @param  StartBit  The ordinal of the least significant bit in the bit field.\r
+                    Range 0..15.\r
+  @param  EndBit    The ordinal of the most significant bit in the bit field.\r
+                    Range 0..15.\r
+  @param  OrData    The value to OR with read value from the MMIO register.\r
+\r
+  @return The value written back to the MMIO register.\r
+\r
+**/\r
+UINT16\r
+EFIAPI\r
+MmioBitFieldOr16 (\r
+  IN      UINTN                     Address,\r
+  IN      UINTN                     StartBit,\r
+  IN      UINTN                     EndBit,\r
+  IN      UINT16                    OrData\r
+  )\r
+{\r
+  return MmioWrite16 (\r
+           Address,\r
+           BitFieldOr16 (MmioRead16 (Address), StartBit, EndBit, OrData)\r
+           );\r
+}\r
+\r
+/**\r
+  Reads a bit field in a 16-bit MMIO register, performs a bitwise AND, and\r
+  writes the result back to the bit field in the 16-bit MMIO register.\r
+\r
+  Reads the 16-bit MMIO register specified by Address, performs a bitwise AND\r
+  between the read result and the value specified by AndData, and writes the\r
+  result to the 16-bit MMIO register specified by Address. The value written to\r
+  the MMIO register is returned. This function must guarantee that all MMIO\r
+  read and write operations are serialized. Extra left bits in AndData are\r
+  stripped.\r
+\r
+  If 16-bit MMIO register operations are not supported, then ASSERT().\r
+  If StartBit is greater than 15, then ASSERT().\r
+  If EndBit is greater than 15, then ASSERT().\r
+  If EndBit is less than StartBit, then ASSERT().\r
+\r
+  @param  Address   MMIO register to write.\r
+  @param  StartBit  The ordinal of the least significant bit in the bit field.\r
+                    Range 0..15.\r
+  @param  EndBit    The ordinal of the most significant bit in the bit field.\r
+                    Range 0..15.\r
+  @param  AndData   The value to AND with read value from the MMIO register.\r
+\r
+  @return The value written back to the MMIO register.\r
+\r
+**/\r
+UINT16\r
+EFIAPI\r
+MmioBitFieldAnd16 (\r
+  IN      UINTN                     Address,\r
+  IN      UINTN                     StartBit,\r
+  IN      UINTN                     EndBit,\r
+  IN      UINT16                    AndData\r
+  )\r
+{\r
+  return MmioWrite16 (\r
+           Address,\r
+           BitFieldAnd16 (MmioRead16 (Address), StartBit, EndBit, AndData)\r
+           );\r
+}\r
+\r
+/**\r
+  Reads a bit field in a 16-bit MMIO register, performs a bitwise AND followed\r
+  by a bitwise inclusive OR, and writes the result back to the bit field in the\r
+  16-bit MMIO register.\r
+\r
+  Reads the 16-bit MMIO register specified by Address, performs a bitwise AND\r
+  followed by a bitwise inclusive OR between the read result and the value\r
+  specified by AndData, and writes the result to the 16-bit MMIO register\r
+  specified by Address. The value written to the MMIO register is returned.\r
+  This function must guarantee that all MMIO read and write operations are\r
+  serialized. Extra left bits in both AndData and OrData are stripped.\r
+\r
+  If 16-bit MMIO register operations are not supported, then ASSERT().\r
+  If StartBit is greater than 15, then ASSERT().\r
+  If EndBit is greater than 15, then ASSERT().\r
+  If EndBit is less than StartBit, then ASSERT().\r
+\r
+  @param  Address   MMIO register to write.\r
+  @param  StartBit  The ordinal of the least significant bit in the bit field.\r
+                    Range 0..15.\r
+  @param  EndBit    The ordinal of the most significant bit in the bit field.\r
+                    Range 0..15.\r
+  @param  AndData   The value to AND with read value from the MMIO register.\r
+  @param  OrData    The value to OR with the result of the AND operation.\r
+\r
+  @return The value written back to the MMIO register.\r
+\r
+**/\r
+UINT16\r
+EFIAPI\r
+MmioBitFieldAndThenOr16 (\r
+  IN      UINTN                     Address,\r
+  IN      UINTN                     StartBit,\r
+  IN      UINTN                     EndBit,\r
+  IN      UINT16                    AndData,\r
+  IN      UINT16                    OrData\r
+  )\r
+{\r
+  return MmioWrite16 (\r
+           Address,\r
+           BitFieldAndThenOr16 (MmioRead16 (Address), StartBit, EndBit, AndData, OrData)\r
+           );\r
+}\r
+\r
+/**\r
+  Reads a 32-bit MMIO register, performs a bitwise inclusive OR, and writes the\r
+  result back to the 32-bit MMIO register.\r
+\r
+  Reads the 32-bit MMIO register specified by Address, performs a bitwise\r
+  inclusive OR between the read result and the value specified by OrData, and\r
+  writes the result to the 32-bit MMIO register specified by Address. The value\r
+  written to the MMIO register is returned. This function must guarantee that\r
+  all MMIO read and write operations are serialized.\r
+\r
+  If 32-bit MMIO register operations are not supported, then ASSERT().\r
+\r
+  @param  Address The MMIO register to write.\r
+  @param  OrData  The value to OR with the read value from the MMIO register.\r
+\r
+  @return The value written back to the MMIO register.\r
+\r
+**/\r
+UINT32\r
+EFIAPI\r
+MmioOr32 (\r
+  IN      UINTN                     Address,\r
+  IN      UINT32                    OrData\r
+  )\r
+{\r
+  return MmioWrite32 (Address, MmioRead32 (Address) | OrData);\r
+}\r
+\r
+/**\r
+  Reads a 32-bit MMIO register, performs a bitwise AND, and writes the result\r
+  back to the 32-bit MMIO register.\r
+\r
+  Reads the 32-bit MMIO register specified by Address, performs a bitwise AND\r
+  between the read result and the value specified by AndData, and writes the\r
+  result to the 32-bit MMIO register specified by Address. The value written to\r
+  the MMIO register is returned. This function must guarantee that all MMIO\r
+  read and write operations are serialized.\r
+\r
+  If 32-bit MMIO register operations are not supported, then ASSERT().\r
+\r
+  @param  Address The MMIO register to write.\r
+  @param  AndData The value to AND with the read value from the MMIO register.\r
+\r
+  @return The value written back to the MMIO register.\r
+\r
+**/\r
+UINT32\r
+EFIAPI\r
+MmioAnd32 (\r
+  IN      UINTN                     Address,\r
+  IN      UINT32                    AndData\r
+  )\r
+{\r
+  return MmioWrite32 (Address, MmioRead32 (Address) & AndData);\r
+}\r
+\r
+/**\r
+  Reads a 32-bit MMIO register, performs a bitwise AND followed by a bitwise\r
+  inclusive OR, and writes the result back to the 32-bit MMIO register.\r
+\r
+  Reads the 32-bit MMIO register specified by Address, performs a bitwise AND\r
+  between the read result and the value specified by AndData, performs a\r
+  bitwise OR between the result of the AND operation and the value specified by\r
+  OrData, and writes the result to the 32-bit MMIO register specified by\r
+  Address. The value written to the MMIO register is returned. This function\r
+  must guarantee that all MMIO read and write operations are serialized.\r
+\r
+  If 32-bit MMIO register operations are not supported, then ASSERT().\r
+\r
+\r
+  @param  Address The MMIO register to write.\r
+  @param  AndData The value to AND with the read value from the MMIO register.\r
+  @param  OrData  The value to OR with the result of the AND operation.\r
+\r
+  @return The value written back to the MMIO register.\r
+\r
+**/\r
+UINT32\r
+EFIAPI\r
+MmioAndThenOr32 (\r
+  IN      UINTN                     Address,\r
+  IN      UINT32                    AndData,\r
+  IN      UINT32                    OrData\r
+  )\r
+{\r
+  return MmioWrite32 (Address, (MmioRead32 (Address) & AndData) | OrData);\r
+}\r
+\r
+/**\r
+  Reads a bit field of a MMIO register.\r
+\r
+  Reads the bit field in a 32-bit MMIO register. The bit field is specified by\r
+  the StartBit and the EndBit. The value of the bit field is returned.\r
+\r
+  If 32-bit MMIO register operations are not supported, then ASSERT().\r
+  If StartBit is greater than 31, then ASSERT().\r
+  If EndBit is greater than 31, then ASSERT().\r
+  If EndBit is less than StartBit, then ASSERT().\r
+\r
+  @param  Address   MMIO register to read.\r
+  @param  StartBit  The ordinal of the least significant bit in the bit field.\r
+                    Range 0..31.\r
+  @param  EndBit    The ordinal of the most significant bit in the bit field.\r
+                    Range 0..31.\r
+\r
+  @return The value read.\r
+\r
+**/\r
+UINT32\r
+EFIAPI\r
+MmioBitFieldRead32 (\r
+  IN      UINTN                     Address,\r
+  IN      UINTN                     StartBit,\r
+  IN      UINTN                     EndBit\r
+  )\r
+{\r
+  return BitFieldRead32 (MmioRead32 (Address), StartBit, EndBit);\r
+}\r
+\r
+/**\r
+  Writes a bit field to a MMIO register.\r
+\r
+  Writes Value to the bit field of the MMIO register. The bit field is\r
+  specified by the StartBit and the EndBit. All other bits in the destination\r
+  MMIO register are preserved. The new value of the 32-bit register is returned.\r
+\r
+  If 32-bit MMIO register operations are not supported, then ASSERT().\r
+  If StartBit is greater than 31, then ASSERT().\r
+  If EndBit is greater than 31, then ASSERT().\r
+  If EndBit is less than StartBit, then ASSERT().\r
+\r
+  @param  Address   MMIO register to write.\r
+  @param  StartBit  The ordinal of the least significant bit in the bit field.\r
+                    Range 0..31.\r
+  @param  EndBit    The ordinal of the most significant bit in the bit field.\r
+                    Range 0..31.\r
+  @param  Value     New value of the bit field.\r
+\r
+  @return The value written back to the MMIO register.\r
+\r
+**/\r
+UINT32\r
+EFIAPI\r
+MmioBitFieldWrite32 (\r
+  IN      UINTN                     Address,\r
+  IN      UINTN                     StartBit,\r
+  IN      UINTN                     EndBit,\r
+  IN      UINT32                    Value\r
+  )\r
+{\r
+  return MmioWrite32 (\r
+           Address,\r
+           BitFieldWrite32 (MmioRead32 (Address), StartBit, EndBit, Value)\r
+           );\r
+}\r
+\r
+/**\r
+  Reads a bit field in a 32-bit MMIO register, performs a bitwise OR, and\r
+  writes the result back to the bit field in the 32-bit MMIO register.\r
+\r
+  Reads the 32-bit MMIO register specified by Address, performs a bitwise\r
+  inclusive OR between the read result and the value specified by OrData, and\r
+  writes the result to the 32-bit MMIO register specified by Address. The value\r
+  written to the MMIO register is returned. This function must guarantee that\r
+  all MMIO read and write operations are serialized. Extra left bits in OrData\r
+  are stripped.\r
+\r
+  If 32-bit MMIO register operations are not supported, then ASSERT().\r
+  If StartBit is greater than 31, then ASSERT().\r
+  If EndBit is greater than 31, then ASSERT().\r
+  If EndBit is less than StartBit, then ASSERT().\r
+\r
+  @param  Address   MMIO register to write.\r
+  @param  StartBit  The ordinal of the least significant bit in the bit field.\r
+                    Range 0..31.\r
+  @param  EndBit    The ordinal of the most significant bit in the bit field.\r
+                    Range 0..31.\r
+  @param  OrData    The value to OR with read value from the MMIO register.\r
+\r
+  @return The value written back to the MMIO register.\r
+\r
+**/\r
+UINT32\r
+EFIAPI\r
+MmioBitFieldOr32 (\r
+  IN      UINTN                     Address,\r
+  IN      UINTN                     StartBit,\r
+  IN      UINTN                     EndBit,\r
+  IN      UINT32                    OrData\r
+  )\r
+{\r
+  return MmioWrite32 (\r
+           Address,\r
+           BitFieldOr32 (MmioRead32 (Address), StartBit, EndBit, OrData)\r
+           );\r
+}\r
+\r
+/**\r
+  Reads a bit field in a 32-bit MMIO register, performs a bitwise AND, and\r
+  writes the result back to the bit field in the 32-bit MMIO register.\r
+\r
+  Reads the 32-bit MMIO register specified by Address, performs a bitwise AND\r
+  between the read result and the value specified by AndData, and writes the\r
+  result to the 32-bit MMIO register specified by Address. The value written to\r
+  the MMIO register is returned. This function must guarantee that all MMIO\r
+  read and write operations are serialized. Extra left bits in AndData are\r
+  stripped.\r
+\r
+  If 32-bit MMIO register operations are not supported, then ASSERT().\r
+  If StartBit is greater than 31, then ASSERT().\r
+  If EndBit is greater than 31, then ASSERT().\r
+  If EndBit is less than StartBit, then ASSERT().\r
+\r
+  @param  Address   MMIO register to write.\r
+  @param  StartBit  The ordinal of the least significant bit in the bit field.\r
+                    Range 0..31.\r
+  @param  EndBit    The ordinal of the most significant bit in the bit field.\r
+                    Range 0..31.\r
+  @param  AndData   The value to AND with read value from the MMIO register.\r
+\r
+  @return The value written back to the MMIO register.\r
+\r
+**/\r
+UINT32\r
+EFIAPI\r
+MmioBitFieldAnd32 (\r
+  IN      UINTN                     Address,\r
+  IN      UINTN                     StartBit,\r
+  IN      UINTN                     EndBit,\r
+  IN      UINT32                    AndData\r
+  )\r
+{\r
+  return MmioWrite32 (\r
+           Address,\r
+           BitFieldAnd32 (MmioRead32 (Address), StartBit, EndBit, AndData)\r
+           );\r
+}\r
+\r
+/**\r
+  Reads a bit field in a 32-bit MMIO register, performs a bitwise AND followed\r
+  by a bitwise inclusive OR, and writes the result back to the bit field in the\r
+  32-bit MMIO register.\r
+\r
+  Reads the 32-bit MMIO register specified by Address, performs a bitwise AND\r
+  followed by a bitwise inclusive OR between the read result and the value\r
+  specified by AndData, and writes the result to the 32-bit MMIO register\r
+  specified by Address. The value written to the MMIO register is returned.\r
+  This function must guarantee that all MMIO read and write operations are\r
+  serialized. Extra left bits in both AndData and OrData are stripped.\r
+\r
+  If 32-bit MMIO register operations are not supported, then ASSERT().\r
+  If StartBit is greater than 31, then ASSERT().\r
+  If EndBit is greater than 31, then ASSERT().\r
+  If EndBit is less than StartBit, then ASSERT().\r
+\r
+  @param  Address   MMIO register to write.\r
+  @param  StartBit  The ordinal of the least significant bit in the bit field.\r
+                    Range 0..31.\r
+  @param  EndBit    The ordinal of the most significant bit in the bit field.\r
+                    Range 0..31.\r
+  @param  AndData   The value to AND with read value from the MMIO register.\r
+  @param  OrData    The value to OR with the result of the AND operation.\r
+\r
+  @return The value written back to the MMIO register.\r
+\r
+**/\r
+UINT32\r
+EFIAPI\r
+MmioBitFieldAndThenOr32 (\r
+  IN      UINTN                     Address,\r
+  IN      UINTN                     StartBit,\r
+  IN      UINTN                     EndBit,\r
+  IN      UINT32                    AndData,\r
+  IN      UINT32                    OrData\r
+  )\r
+{\r
+  return MmioWrite32 (\r
+           Address,\r
+           BitFieldAndThenOr32 (MmioRead32 (Address), StartBit, EndBit, AndData, OrData)\r
+           );\r
+}\r
+\r
+/**\r
+  Reads a 64-bit MMIO register, performs a bitwise inclusive OR, and writes the\r
+  result back to the 64-bit MMIO register.\r
+\r
+  Reads the 64-bit MMIO register specified by Address, performs a bitwise\r
+  inclusive OR between the read result and the value specified by OrData, and\r
+  writes the result to the 64-bit MMIO register specified by Address. The value\r
+  written to the MMIO register is returned. This function must guarantee that\r
+  all MMIO read and write operations are serialized.\r
+\r
+  If 64-bit MMIO register operations are not supported, then ASSERT().\r
+\r
+  @param  Address The MMIO register to write.\r
+  @param  OrData  The value to OR with the read value from the MMIO register.\r
+\r
+  @return The value written back to the MMIO register.\r
+\r
+**/\r
+UINT64\r
+EFIAPI\r
+MmioOr64 (\r
+  IN      UINTN                     Address,\r
+  IN      UINT64                    OrData\r
+  )\r
+{\r
+  return MmioWrite64 (Address, MmioRead64 (Address) | OrData);\r
+}\r
+\r
+/**\r
+  Reads a 64-bit MMIO register, performs a bitwise AND, and writes the result\r
+  back to the 64-bit MMIO register.\r
+\r
+  Reads the 64-bit MMIO register specified by Address, performs a bitwise AND\r
+  between the read result and the value specified by AndData, and writes the\r
+  result to the 64-bit MMIO register specified by Address. The value written to\r
+  the MMIO register is returned. This function must guarantee that all MMIO\r
+  read and write operations are serialized.\r
+\r
+  If 64-bit MMIO register operations are not supported, then ASSERT().\r
+\r
+  @param  Address The MMIO register to write.\r
+  @param  AndData The value to AND with the read value from the MMIO register.\r
+\r
+  @return The value written back to the MMIO register.\r
+\r
+**/\r
+UINT64\r
+EFIAPI\r
+MmioAnd64 (\r
+  IN      UINTN                     Address,\r
+  IN      UINT64                    AndData\r
+  )\r
+{\r
+  return MmioWrite64 (Address, MmioRead64 (Address) & AndData);\r
+}\r
+\r
+/**\r
+  Reads a 64-bit MMIO register, performs a bitwise AND followed by a bitwise\r
+  inclusive OR, and writes the result back to the 64-bit MMIO register.\r
+\r
+  Reads the 64-bit MMIO register specified by Address, performs a bitwise AND\r
+  between the read result and the value specified by AndData, performs a\r
+  bitwise OR between the result of the AND operation and the value specified by\r
+  OrData, and writes the result to the 64-bit MMIO register specified by\r
+  Address. The value written to the MMIO register is returned. This function\r
+  must guarantee that all MMIO read and write operations are serialized.\r
+\r
+  If 64-bit MMIO register operations are not supported, then ASSERT().\r
+\r
+\r
+  @param  Address The MMIO register to write.\r
+  @param  AndData The value to AND with the read value from the MMIO register.\r
+  @param  OrData  The value to OR with the result of the AND operation.\r
+\r
+  @return The value written back to the MMIO register.\r
+\r
+**/\r
+UINT64\r
+EFIAPI\r
+MmioAndThenOr64 (\r
+  IN      UINTN                     Address,\r
+  IN      UINT64                    AndData,\r
+  IN      UINT64                    OrData\r
+  )\r
+{\r
+  return MmioWrite64 (Address, (MmioRead64 (Address) & AndData) | OrData);\r
+}\r
+\r
+/**\r
+  Reads a bit field of a MMIO register.\r
+\r
+  Reads the bit field in a 64-bit MMIO register. The bit field is specified by\r
+  the StartBit and the EndBit. The value of the bit field is returned.\r
+\r
+  If 64-bit MMIO register operations are not supported, then ASSERT().\r
+  If StartBit is greater than 63, then ASSERT().\r
+  If EndBit is greater than 63, then ASSERT().\r
+  If EndBit is less than StartBit, then ASSERT().\r
+\r
+  @param  Address   MMIO register to read.\r
+  @param  StartBit  The ordinal of the least significant bit in the bit field.\r
+                    Range 0..63.\r
+  @param  EndBit    The ordinal of the most significant bit in the bit field.\r
+                    Range 0..63.\r
+\r
+  @return The value read.\r
+\r
+**/\r
+UINT64\r
+EFIAPI\r
+MmioBitFieldRead64 (\r
+  IN      UINTN                     Address,\r
+  IN      UINTN                     StartBit,\r
+  IN      UINTN                     EndBit\r
+  )\r
+{\r
+  return BitFieldRead64 (MmioRead64 (Address), StartBit, EndBit);\r
+}\r
+\r
+/**\r
+  Writes a bit field to a MMIO register.\r
+\r
+  Writes Value to the bit field of the MMIO register. The bit field is\r
+  specified by the StartBit and the EndBit. All other bits in the destination\r
+  MMIO register are preserved. The new value of the 64-bit register is returned.\r
+\r
+  If 64-bit MMIO register operations are not supported, then ASSERT().\r
+  If StartBit is greater than 63, then ASSERT().\r
+  If EndBit is greater than 63, then ASSERT().\r
+  If EndBit is less than StartBit, then ASSERT().\r
+\r
+  @param  Address   MMIO register to write.\r
+  @param  StartBit  The ordinal of the least significant bit in the bit field.\r
+                    Range 0..63.\r
+  @param  EndBit    The ordinal of the most significant bit in the bit field.\r
+                    Range 0..63.\r
+  @param  Value     New value of the bit field.\r
+\r
+  @return The value written back to the MMIO register.\r
+\r
+**/\r
+UINT64\r
+EFIAPI\r
+MmioBitFieldWrite64 (\r
+  IN      UINTN                     Address,\r
+  IN      UINTN                     StartBit,\r
+  IN      UINTN                     EndBit,\r
+  IN      UINT64                    Value\r
+  )\r
+{\r
+  return MmioWrite64 (\r
+           Address,\r
+           BitFieldWrite64 (MmioRead64 (Address), StartBit, EndBit, Value)\r
+           );\r
+}\r
+\r
+/**\r
+  Reads a bit field in a 64-bit MMIO register, performs a bitwise OR, and\r
+  writes the result back to the bit field in the 64-bit MMIO register.\r
+\r
+  Reads the 64-bit MMIO register specified by Address, performs a bitwise\r
+  inclusive OR between the read result and the value specified by OrData, and\r
+  writes the result to the 64-bit MMIO register specified by Address. The value\r
+  written to the MMIO register is returned. This function must guarantee that\r
+  all MMIO read and write operations are serialized. Extra left bits in OrData\r
+  are stripped.\r
+\r
+  If 64-bit MMIO register operations are not supported, then ASSERT().\r
+  If StartBit is greater than 63, then ASSERT().\r
+  If EndBit is greater than 63, then ASSERT().\r
+  If EndBit is less than StartBit, then ASSERT().\r
+\r
+  @param  Address   MMIO register to write.\r
+  @param  StartBit  The ordinal of the least significant bit in the bit field.\r
+                    Range 0..63.\r
+  @param  EndBit    The ordinal of the most significant bit in the bit field.\r
+                    Range 0..63.\r
+  @param  OrData    The value to OR with read value from the MMIO register.\r
+\r
+  @return The value written back to the MMIO register.\r
+\r
+**/\r
+UINT64\r
+EFIAPI\r
+MmioBitFieldOr64 (\r
+  IN      UINTN                     Address,\r
+  IN      UINTN                     StartBit,\r
+  IN      UINTN                     EndBit,\r
+  IN      UINT64                    OrData\r
+  )\r
+{\r
+  return MmioWrite64 (\r
+           Address,\r
+           BitFieldOr64 (MmioRead64 (Address), StartBit, EndBit, OrData)\r
+           );\r
+}\r
+\r
+/**\r
+  Reads a bit field in a 64-bit MMIO register, performs a bitwise AND, and\r
+  writes the result back to the bit field in the 64-bit MMIO register.\r
+\r
+  Reads the 64-bit MMIO register specified by Address, performs a bitwise AND\r
+  between the read result and the value specified by AndData, and writes the\r
+  result to the 64-bit MMIO register specified by Address. The value written to\r
+  the MMIO register is returned. This function must guarantee that all MMIO\r
+  read and write operations are serialized. Extra left bits in AndData are\r
+  stripped.\r
+\r
+  If 64-bit MMIO register operations are not supported, then ASSERT().\r
+  If StartBit is greater than 63, then ASSERT().\r
+  If EndBit is greater than 63, then ASSERT().\r
+  If EndBit is less than StartBit, then ASSERT().\r
+\r
+  @param  Address   MMIO register to write.\r
+  @param  StartBit  The ordinal of the least significant bit in the bit field.\r
+                    Range 0..63.\r
+  @param  EndBit    The ordinal of the most significant bit in the bit field.\r
+                    Range 0..63.\r
+  @param  AndData   The value to AND with read value from the MMIO register.\r
+\r
+  @return The value written back to the MMIO register.\r
+\r
+**/\r
+UINT64\r
+EFIAPI\r
+MmioBitFieldAnd64 (\r
+  IN      UINTN                     Address,\r
+  IN      UINTN                     StartBit,\r
+  IN      UINTN                     EndBit,\r
+  IN      UINT64                    AndData\r
+  )\r
+{\r
+  return MmioWrite64 (\r
+           Address,\r
+           BitFieldAnd64 (MmioRead64 (Address), StartBit, EndBit, AndData)\r
+           );\r
+}\r
+\r
+/**\r
+  Reads a bit field in a 64-bit MMIO register, performs a bitwise AND followed\r
+  by a bitwise inclusive OR, and writes the result back to the bit field in the\r
+  64-bit MMIO register.\r
+\r
+  Reads the 64-bit MMIO register specified by Address, performs a bitwise AND\r
+  followed by a bitwise inclusive OR between the read result and the value\r
+  specified by AndData, and writes the result to the 64-bit MMIO register\r
+  specified by Address. The value written to the MMIO register is returned.\r
+  This function must guarantee that all MMIO read and write operations are\r
+  serialized. Extra left bits in both AndData and OrData are stripped.\r
+\r
+  If 64-bit MMIO register operations are not supported, then ASSERT().\r
+  If StartBit is greater than 63, then ASSERT().\r
+  If EndBit is greater than 63, then ASSERT().\r
+  If EndBit is less than StartBit, then ASSERT().\r
+\r
+  @param  Address   MMIO register to write.\r
+  @param  StartBit  The ordinal of the least significant bit in the bit field.\r
+                    Range 0..63.\r
+  @param  EndBit    The ordinal of the most significant bit in the bit field.\r
+                    Range 0..63.\r
+  @param  AndData   The value to AND with read value from the MMIO register.\r
+  @param  OrData    The value to OR with the result of the AND operation.\r
+\r
+  @return The value written back to the MMIO register.\r
+\r
+**/\r
+UINT64\r
+EFIAPI\r
+MmioBitFieldAndThenOr64 (\r
+  IN      UINTN                     Address,\r
+  IN      UINTN                     StartBit,\r
+  IN      UINTN                     EndBit,\r
+  IN      UINT64                    AndData,\r
+  IN      UINT64                    OrData\r
+  )\r
+{\r
+  return MmioWrite64 (\r
+           Address,\r
+           BitFieldAndThenOr64 (MmioRead64 (Address), StartBit, EndBit, AndData, OrData)\r
+           );\r
+}\r
diff --git a/IntelFrameworkPkg/Library/DxeIoLibCpuIo/IoLib.c b/IntelFrameworkPkg/Library/DxeIoLibCpuIo/IoLib.c
new file mode 100644 (file)
index 0000000..096f899
--- /dev/null
@@ -0,0 +1,614 @@
+/** @file\r
+  I/O Library.\r
+\r
+  Copyright (c) 2006, Intel Corporation<BR>\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+  Module Name:  IoLib.c\r
+\r
+**/\r
+\r
+#include "DxeCpuIoLibInternal.h"\r
+\r
+//\r
+// Globle varible to cache pointer to CpuIo protocol.\r
+//\r
+STATIC EFI_CPU_IO_PROTOCOL              *mCpuIo = NULL;\r
+STATIC EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL  *mPciRootBridgeIo = NULL;\r
+\r
+/**\r
+  The constructor function caches the pointer to CpuIo protocol.\r
+\r
+  The constructor function locates CpuIo protocol from protocol database.\r
+  It will ASSERT() if that operation fails and it will always return EFI_SUCCESS.\r
+\r
+  @param  ImageHandle   The firmware allocated handle for the EFI image.\r
+  @param  SystemTable   A pointer to the EFI System Table.\r
+\r
+  @retval EFI_SUCCESS   The constructor always returns EFI_SUCCESS.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+IoLibConstructor (\r
+  IN      EFI_HANDLE                ImageHandle,\r
+  IN      EFI_SYSTEM_TABLE          *SystemTable\r
+  )\r
+{\r
+  EFI_STATUS                        Status;\r
+\r
+  Status = gBS->LocateProtocol (&gEfiPciRootBridgeIoProtocolGuid, NULL, &mPciRootBridgeIo);\r
+  if (EFI_ERROR (Status)) {\r
+    Status = gBS->LocateProtocol (&gEfiCpuIoProtocolGuid, NULL, &mCpuIo);\r
+  }\r
+  ASSERT_EFI_ERROR (Status);\r
+\r
+  return Status;\r
+}\r
+\r
+/**\r
+  Reads registers in the EFI CPU I/O space.\r
+\r
+  Reads the I/O port specified by Port with registers width specified by Width.\r
+  The read value is returned. If such operations are not supported, then ASSERT().\r
+  This function must guarantee that all I/O read and write operations are serialized.\r
+\r
+  @param  Port          The base address of the I/O operation.\r
+                        The caller is responsible for aligning the Address if required.\r
+  @param  Width         The width of the I/O operation.\r
+\r
+  @return Data read from registers in the EFI CPU I/O space.\r
+\r
+**/\r
+UINT64\r
+EFIAPI\r
+IoReadWorker (\r
+  IN      UINTN                     Port,\r
+  IN      EFI_CPU_IO_PROTOCOL_WIDTH Width\r
+  )\r
+{\r
+  EFI_STATUS                        Status;\r
+  UINT64                            Data;\r
+\r
+  if (mPciRootBridgeIo != NULL) {\r
+    Status = mPciRootBridgeIo->Io.Read (mPciRootBridgeIo, Width, Port, 1, &Data);\r
+  } else {\r
+    Status = mCpuIo->Io.Read (mCpuIo, Width, Port, 1, &Data);\r
+  }\r
+  ASSERT_EFI_ERROR (Status);\r
+\r
+  return Data;\r
+}\r
+\r
+/**\r
+  Writes registers in the EFI CPU I/O space.\r
+\r
+  Writes the I/O port specified by Port with registers width and value specified by Width\r
+  and Data respectively.  Data is returned. If such operations are not supported, then ASSERT().\r
+  This function must guarantee that all I/O read and write operations are serialized.\r
+\r
+  @param  Port          The base address of the I/O operation.\r
+                        The caller is responsible for aligning the Address if required.\r
+  @param  Width         The width of the I/O operation.\r
+  @param  Data          The value to write to the I/O port.\r
+\r
+  @return The paramter of Data.\r
+\r
+**/\r
+UINT64\r
+EFIAPI\r
+IoWriteWorker (\r
+  IN      UINTN                     Port,\r
+  IN      EFI_CPU_IO_PROTOCOL_WIDTH Width,\r
+  IN      UINT64                    Data\r
+  )\r
+{\r
+  EFI_STATUS                        Status;\r
+\r
+  if (mPciRootBridgeIo != NULL) {\r
+    Status = mPciRootBridgeIo->Io.Write (mPciRootBridgeIo, Width, Port, 1, &Data);\r
+  } else {\r
+    Status = mCpuIo->Io.Write (mCpuIo, Width, Port, 1, &Data);\r
+  }\r
+  ASSERT_EFI_ERROR (Status);\r
+\r
+  return Data;\r
+}\r
+\r
+/**\r
+  Reads memory-mapped registers in the EFI system memory space.\r
+\r
+  Reads the MMIO registers specified by Address with registers width specified by Width.\r
+  The read value is returned. If such operations are not supported, then ASSERT().\r
+  This function must guarantee that all MMIO read and write operations are serialized.\r
+\r
+  @param  Address       The MMIO register to read.\r
+                        The caller is responsible for aligning the Address if required.\r
+  @param  Width         The width of the I/O operation.\r
+\r
+  @return Data read from registers in the EFI system memory space.\r
+\r
+**/\r
+UINT64\r
+EFIAPI\r
+MmioReadWorker (\r
+  IN      UINTN                     Address,\r
+  IN      EFI_CPU_IO_PROTOCOL_WIDTH Width\r
+  )\r
+{\r
+  EFI_STATUS                        Status;\r
+  UINT64                            Data;\r
+\r
+  if (mPciRootBridgeIo != NULL) {\r
+    Status = mPciRootBridgeIo.Mem.Read (mPciRootBridgeIo, Width, Address, 1, &Data);\r
+  } else {\r
+    Status = mCpuIo->Mem.Read (mCpuIo, Width, Address, 1, &Data);\r
+  }\r
+  ASSERT_EFI_ERROR (Status);\r
+\r
+  return Data;\r
+}\r
+\r
+/**\r
+  Writes memory-mapped registers in the EFI system memory space.\r
+\r
+  Writes the MMIO registers specified by Address with registers width and value specified by Width\r
+  and Data respectively. Data is returned. If such operations are not supported, then ASSERT().\r
+  This function must guarantee that all MMIO read and write operations are serialized.\r
+\r
+  @param  Address       The MMIO register to read.\r
+                        The caller is responsible for aligning the Address if required.\r
+  @param  Width         The width of the I/O operation.\r
+\r
+  @return Data read from registers in the EFI system memory space.\r
+\r
+**/\r
+UINT64\r
+EFIAPI\r
+MmioWriteWorker (\r
+  IN      UINTN                     Address,\r
+  IN      EFI_CPU_IO_PROTOCOL_WIDTH Width,\r
+  IN      UINT64                    Data\r
+  )\r
+{\r
+  EFI_STATUS                        Status;\r
+\r
+  if (mPciRootBridgeIo != NULL) {\r
+    Status = mPciRootBridgeIo->Mem.Write (mPciRootBridgeIo, Width, Address, 1, &Data);\r
+  } else {\r
+    Status = mCpuIo->Mem.Write (mCpuIo, Width, Address, 1, &Data);\r
+  }\r
+  ASSERT_EFI_ERROR (Status);\r
+\r
+  return Data;\r
+}\r
+\r
+/**\r
+  Reads an 8-bit I/O port.\r
+\r
+  Reads the 8-bit I/O port specified by Port. The 8-bit read value is returned.\r
+  This function must guarantee that all I/O read and write operations are\r
+  serialized.\r
+\r
+  If 8-bit I/O port operations are not supported, then ASSERT().\r
+\r
+  @param  Port  The I/O port to read.\r
+\r
+  @return The value read.\r
+\r
+**/\r
+UINT8\r
+EFIAPI\r
+IoRead8 (\r
+  IN      UINTN                     Port\r
+  )\r
+{\r
+  return (UINT8)IoReadWorker (Port, EfiCpuIoWidthUint8);\r
+}\r
+\r
+/**\r
+  Writes an 8-bit I/O port.\r
+\r
+  Writes the 8-bit I/O port specified by Port with the value specified by Value\r
+  and returns Value. This function must guarantee that all I/O read and write\r
+  operations are serialized.\r
+\r
+  If 8-bit I/O port operations are not supported, then ASSERT().\r
+\r
+  @param  Port  The I/O port to write.\r
+  @param  Value The value to write to the I/O port.\r
+\r
+  @return The value written the I/O port.\r
+\r
+**/\r
+UINT8\r
+EFIAPI\r
+IoWrite8 (\r
+  IN      UINTN                     Port,\r
+  IN      UINT8                     Value\r
+  )\r
+{\r
+  return (UINT8)IoWriteWorker (Port, EfiCpuIoWidthUint8, Value);\r
+}\r
+\r
+/**\r
+  Reads a 16-bit I/O port.\r
+\r
+  Reads the 16-bit I/O port specified by Port. The 16-bit read value is returned.\r
+  This function must guarantee that all I/O read and write operations are\r
+  serialized.\r
+\r
+  If 16-bit I/O port operations are not supported, then ASSERT().\r
+\r
+  @param  Port  The I/O port to read.\r
+\r
+  @return The value read.\r
+\r
+**/\r
+UINT16\r
+EFIAPI\r
+IoRead16 (\r
+  IN      UINTN                     Port\r
+  )\r
+{\r
+  //\r
+  // Make sure Port is aligned on a 16-bit boundary.\r
+  //\r
+  ASSERT ((Port & 1) == 0);\r
+  return (UINT16)IoReadWorker (Port, EfiCpuIoWidthUint16);\r
+}\r
+\r
+/**\r
+  Writes a 16-bit I/O port.\r
+\r
+  Writes the 16-bit I/O port specified by Port with the value specified by Value\r
+  and returns Value. This function must guarantee that all I/O read and write\r
+  operations are serialized.\r
+\r
+  If 16-bit I/O port operations are not supported, then ASSERT().\r
+\r
+  @param  Port  The I/O port to write.\r
+  @param  Value The value to write to the I/O port.\r
+\r
+  @return The value written the I/O port.\r
+\r
+**/\r
+UINT16\r
+EFIAPI\r
+IoWrite16 (\r
+  IN      UINTN                     Port,\r
+  IN      UINT16                    Value\r
+  )\r
+{\r
+  //\r
+  // Make sure Port is aligned on a 16-bit boundary.\r
+  //\r
+  ASSERT ((Port & 1) == 0);\r
+  return (UINT16)IoWriteWorker (Port, EfiCpuIoWidthUint16, Value);\r
+}\r
+\r
+/**\r
+  Reads a 32-bit I/O port.\r
+\r
+  Reads the 32-bit I/O port specified by Port. The 32-bit read value is returned.\r
+  This function must guarantee that all I/O read and write operations are\r
+  serialized.\r
+\r
+  If 32-bit I/O port operations are not supported, then ASSERT().\r
+\r
+  @param  Port  The I/O port to read.\r
+\r
+  @return The value read.\r
+\r
+**/\r
+UINT32\r
+EFIAPI\r
+IoRead32 (\r
+  IN      UINTN                     Port\r
+  )\r
+{\r
+  //\r
+  // Make sure Port is aligned on a 32-bit boundary.\r
+  //\r
+  ASSERT ((Port & 3) == 0);\r
+  return (UINT32)IoReadWorker (Port, EfiCpuIoWidthUint32);\r
+}\r
+\r
+/**\r
+  Writes a 32-bit I/O port.\r
+\r
+  Writes the 32-bit I/O port specified by Port with the value specified by Value\r
+  and returns Value. This function must guarantee that all I/O read and write\r
+  operations are serialized.\r
+\r
+  If 32-bit I/O port operations are not supported, then ASSERT().\r
+\r
+  @param  Port  The I/O port to write.\r
+  @param  Value The value to write to the I/O port.\r
+\r
+  @return The value written the I/O port.\r
+\r
+**/\r
+UINT32\r
+EFIAPI\r
+IoWrite32 (\r
+  IN      UINTN                     Port,\r
+  IN      UINT32                    Value\r
+  )\r
+{\r
+  //\r
+  // Make sure Port is aligned on a 32-bit boundary.\r
+  //\r
+  ASSERT ((Port & 3) == 0);\r
+  return (UINT32)IoWriteWorker (Port, EfiCpuIoWidthUint32, Value);\r
+}\r
+\r
+/**\r
+  Reads a 64-bit I/O port.\r
+\r
+  Reads the 64-bit I/O port specified by Port. The 64-bit read value is returned.\r
+  This function must guarantee that all I/O read and write operations are\r
+  serialized.\r
+\r
+  If 64-bit I/O port operations are not supported, then ASSERT().\r
+\r
+  @param  Port  The I/O port to read.\r
+\r
+  @return The value read.\r
+\r
+**/\r
+UINT64\r
+EFIAPI\r
+IoRead64 (\r
+  IN      UINTN                     Port\r
+  )\r
+{\r
+  //\r
+  // Make sure Port is aligned on a 64-bit boundary.\r
+  //\r
+  ASSERT ((Port & 7) == 0);\r
+  return IoReadWorker (Port, EfiCpuIoWidthUint64);\r
+}\r
+\r
+/**\r
+  Writes a 64-bit I/O port.\r
+\r
+  Writes the 64-bit I/O port specified by Port with the value specified by Value\r
+  and returns Value. This function must guarantee that all I/O read and write\r
+  operations are serialized.\r
+\r
+  If 64-bit I/O port operations are not supported, then ASSERT().\r
+\r
+  @param  Port  The I/O port to write.\r
+  @param  Value The value to write to the I/O port.\r
+\r
+  @return The value written the I/O port.\r
+\r
+**/\r
+UINT64\r
+EFIAPI\r
+IoWrite64 (\r
+  IN      UINTN                     Port,\r
+  IN      UINT64                    Value\r
+  )\r
+{\r
+  //\r
+  // Make sure Port is aligned on a 64-bit boundary.\r
+  //\r
+  ASSERT ((Port & 7) == 0);\r
+  return IoWriteWorker (Port, EfiCpuIoWidthUint64, Value);\r
+}\r
+\r
+/**\r
+  Reads an 8-bit MMIO register.\r
+\r
+  Reads the 8-bit MMIO register specified by Address. The 8-bit read value is\r
+  returned. This function must guarantee that all MMIO read and write\r
+  operations are serialized.\r
+\r
+  If 8-bit MMIO register operations are not supported, then ASSERT().\r
+\r
+  @param  Address The MMIO register to read.\r
+\r
+  @return The value read.\r
+\r
+**/\r
+UINT8\r
+EFIAPI\r
+MmioRead8 (\r
+  IN      UINTN                     Address\r
+  )\r
+{\r
+  return (UINT8)MmioReadWorker (Address, EfiCpuIoWidthUint8);\r
+}\r
+\r
+/**\r
+  Writes an 8-bit MMIO register.\r
+\r
+  Writes the 8-bit MMIO register specified by Address with the value specified\r
+  by Value and returns Value. This function must guarantee that all MMIO read\r
+  and write operations are serialized.\r
+\r
+  If 8-bit MMIO register operations are not supported, then ASSERT().\r
+\r
+  @param  Address The MMIO register to write.\r
+  @param  Value   The value to write to the MMIO register.\r
+\r
+**/\r
+UINT8\r
+EFIAPI\r
+MmioWrite8 (\r
+  IN      UINTN                     Address,\r
+  IN      UINT8                     Value\r
+  )\r
+{\r
+  return (UINT8)MmioWriteWorker (Address, EfiCpuIoWidthUint8, Value);\r
+}\r
+\r
+/**\r
+  Reads a 16-bit MMIO register.\r
+\r
+  Reads the 16-bit MMIO register specified by Address. The 16-bit read value is\r
+  returned. This function must guarantee that all MMIO read and write\r
+  operations are serialized.\r
+\r
+  If 16-bit MMIO register operations are not supported, then ASSERT().\r
+\r
+  @param  Address The MMIO register to read.\r
+\r
+  @return The value read.\r
+\r
+**/\r
+UINT16\r
+EFIAPI\r
+MmioRead16 (\r
+  IN      UINTN                     Address\r
+  )\r
+{\r
+  //\r
+  // Make sure Address is aligned on a 16-bit boundary.\r
+  //\r
+  ASSERT ((Address & 1) == 0);\r
+  return (UINT16)MmioReadWorker (Address, EfiCpuIoWidthUint16);\r
+}\r
+\r
+/**\r
+  Writes a 16-bit MMIO register.\r
+\r
+  Writes the 16-bit MMIO register specified by Address with the value specified\r
+  by Value and returns Value. This function must guarantee that all MMIO read\r
+  and write operations are serialized.\r
+\r
+  If 16-bit MMIO register operations are not supported, then ASSERT().\r
+\r
+  @param  Address The MMIO register to write.\r
+  @param  Value   The value to write to the MMIO register.\r
+\r
+**/\r
+UINT16\r
+EFIAPI\r
+MmioWrite16 (\r
+  IN      UINTN                     Address,\r
+  IN      UINT16                    Value\r
+  )\r
+{\r
+  //\r
+  // Make sure Address is aligned on a 16-bit boundary.\r
+  //\r
+  ASSERT ((Address & 1) == 0);\r
+  return (UINT16)MmioWriteWorker (Address, EfiCpuIoWidthUint16, Value);\r
+}\r
+\r
+/**\r
+  Reads a 32-bit MMIO register.\r
+\r
+  Reads the 32-bit MMIO register specified by Address. The 32-bit read value is\r
+  returned. This function must guarantee that all MMIO read and write\r
+  operations are serialized.\r
+\r
+  If 32-bit MMIO register operations are not supported, then ASSERT().\r
+\r
+  @param  Address The MMIO register to read.\r
+\r
+  @return The value read.\r
+\r
+**/\r
+UINT32\r
+EFIAPI\r
+MmioRead32 (\r
+  IN      UINTN                     Address\r
+  )\r
+{\r
+  //\r
+  // Make sure Address is aligned on a 32-bit boundary.\r
+  //\r
+  ASSERT ((Address & 3) == 0);\r
+  return (UINT32)MmioReadWorker (Address, EfiCpuIoWidthUint32);\r
+}\r
+\r
+/**\r
+  Writes a 32-bit MMIO register.\r
+\r
+  Writes the 32-bit MMIO register specified by Address with the value specified\r
+  by Value and returns Value. This function must guarantee that all MMIO read\r
+  and write operations are serialized.\r
+\r
+  If 32-bit MMIO register operations are not supported, then ASSERT().\r
+\r
+  @param  Address The MMIO register to write.\r
+  @param  Value   The value to write to the MMIO register.\r
+\r
+**/\r
+UINT32\r
+EFIAPI\r
+MmioWrite32 (\r
+  IN      UINTN                     Address,\r
+  IN      UINT32                    Value\r
+  )\r
+{\r
+  //\r
+  // Make sure Address is aligned on a 32-bit boundary.\r
+  //\r
+  ASSERT ((Address & 3) == 0);\r
+  return (UINT32)MmioWriteWorker (Address, EfiCpuIoWidthUint32, Value);\r
+}\r
+\r
+/**\r
+  Reads a 64-bit MMIO register.\r
+\r
+  Reads the 64-bit MMIO register specified by Address. The 64-bit read value is\r
+  returned. This function must guarantee that all MMIO read and write\r
+  operations are serialized.\r
+\r
+  If 64-bit MMIO register operations are not supported, then ASSERT().\r
+\r
+  @param  Address The MMIO register to read.\r
+\r
+  @return The value read.\r
+\r
+**/\r
+UINT64\r
+EFIAPI\r
+MmioRead64 (\r
+  IN      UINTN                     Address\r
+  )\r
+{\r
+  //\r
+  // Make sure Address is aligned on a 64-bit boundary.\r
+  //\r
+  ASSERT ((Address & 7) == 0);\r
+  return (UINT64)MmioReadWorker (Address, EfiCpuIoWidthUint64);\r
+}\r
+\r
+/**\r
+  Writes a 64-bit MMIO register.\r
+\r
+  Writes the 64-bit MMIO register specified by Address with the value specified\r
+  by Value and returns Value. This function must guarantee that all MMIO read\r
+  and write operations are serialized.\r
+\r
+  If 64-bit MMIO register operations are not supported, then ASSERT().\r
+\r
+  @param  Address The MMIO register to write.\r
+  @param  Value   The value to write to the MMIO register.\r
+\r
+**/\r
+UINT64\r
+EFIAPI\r
+MmioWrite64 (\r
+  IN      UINTN                     Address,\r
+  IN      UINT64                    Value\r
+  )\r
+{\r
+  //\r
+  // Make sure Address is aligned on a 64-bit boundary.\r
+  //\r
+  ASSERT ((Address & 7) == 0);\r
+  return (UINT64)MmioWriteWorker (Address, EfiCpuIoWidthUint64, Value);\r
+}\r
diff --git a/IntelFrameworkPkg/Library/DxeIoLibCpuIo/IoLibMmioBuffer.c b/IntelFrameworkPkg/Library/DxeIoLibCpuIo/IoLibMmioBuffer.c
new file mode 100644 (file)
index 0000000..d3f745c
--- /dev/null
@@ -0,0 +1,411 @@
+/** @file\r
+  I/O Library MMIO Buffer Functions.\r
+\r
+  Copyright (c) 2007, Intel Corporation<BR>\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#include "DxeCpuIoLibInternal.h"\r
+\r
+/**\r
+  Copy data from MMIO region to system memory by using 8-bit access.\r
+\r
+  Copy data from MMIO region specified by starting address StartAddress\r
+  to system memory specified by Buffer by using 8-bit access. The total\r
+  number of byte to be copied is specified by Length. Buffer is returned.\r
+\r
+  If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT().\r
+  If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().\r
+\r
+\r
+  @param  StartAddress    Starting address for the MMIO region to be copied from.\r
+  @param  Length          Size in bytes of the copy.\r
+  @param  Buffer          Pointer to a system memory buffer receiving the data read.\r
+\r
+  @return Buffer\r
+\r
+**/\r
+UINT8 *\r
+EFIAPI\r
+MmioReadBuffer8 (\r
+  IN  UINTN       StartAddress,\r
+  IN  UINTN       Length,\r
+  OUT UINT8       *Buffer\r
+  )\r
+{\r
+  UINT8   *ReturnBuffer;\r
+\r
+  ASSERT ((Length - 1) <=  (MAX_ADDRESS - StartAddress));\r
+  ASSERT ((Length - 1) <=  (MAX_ADDRESS - (UINTN) Buffer));\r
+\r
+  ReturnBuffer = Buffer;\r
+\r
+  while (Length--) {\r
+    *(Buffer++) = MmioRead8 (StartAddress++);\r
+  }\r
+\r
+  return ReturnBuffer;\r
+}\r
+\r
+/**\r
+  Copy data from MMIO region to system memory by using 16-bit access.\r
+\r
+  Copy data from MMIO region specified by starting address StartAddress\r
+  to system memory specified by Buffer by using 16-bit access. The total\r
+  number of byte to be copied is specified by Length. Buffer is returned.\r
+\r
+  If StartAddress is not aligned on a 16-bit boundary, then ASSERT().\r
+\r
+  If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT().\r
+  If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().\r
+\r
+  If Length is not aligned on a 16-bit boundary, then ASSERT().\r
+  If Buffer is not aligned on a 16-bit boundary, then ASSERT().\r
+\r
+  @param  StartAddress    Starting address for the MMIO region to be copied from.\r
+  @param  Length          Size in bytes of the copy.\r
+  @param  Buffer          Pointer to a system memory buffer receiving the data read.\r
+\r
+  @return Buffer\r
+\r
+**/\r
+UINT16 *\r
+EFIAPI\r
+MmioReadBuffer16 (\r
+  IN  UINTN       StartAddress,\r
+  IN  UINTN       Length,\r
+  OUT UINT16      *Buffer\r
+  )\r
+{\r
+  UINT16    *ReturnBuffer;\r
+\r
+  ASSERT ((StartAddress & (sizeof (UINT16) - 1)) == 0);\r
+\r
+  ASSERT ((Length - 1) <=  (MAX_ADDRESS - StartAddress));\r
+  ASSERT ((Length - 1) <=  (MAX_ADDRESS - (UINTN) Buffer));\r
+\r
+  ASSERT ((Length & (sizeof (UINT16) - 1)) == 0);\r
+  ASSERT (((UINTN) Buffer & (sizeof (UINT16) - 1)) == 0);\r
+\r
+  ReturnBuffer = Buffer;\r
+\r
+  while (Length) {\r
+    *(Buffer++) = MmioRead16 (StartAddress);\r
+    StartAddress += sizeof (UINT16);\r
+    Length -= sizeof (UINT16);\r
+  }\r
+\r
+  return ReturnBuffer;\r
+}\r
+\r
+/**\r
+  Copy data from MMIO region to system memory by using 32-bit access.\r
+\r
+  Copy data from MMIO region specified by starting address StartAddress\r
+  to system memory specified by Buffer by using 32-bit access. The total\r
+  number of byte to be copied is specified by Length. Buffer is returned.\r
+\r
+  If StartAddress is not aligned on a 32-bit boundary, then ASSERT().\r
+\r
+  If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT().\r
+  If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().\r
+\r
+  If Length is not aligned on a 32-bit boundary, then ASSERT().\r
+  If Buffer is not aligned on a 32-bit boundary, then ASSERT().\r
+\r
+  @param  StartAddress    Starting address for the MMIO region to be copied from.\r
+  @param  Length          Size in bytes of the copy.\r
+  @param  Buffer          Pointer to a system memory buffer receiving the data read.\r
+\r
+  @return Buffer\r
+\r
+**/\r
+UINT32 *\r
+EFIAPI\r
+MmioReadBuffer32 (\r
+  IN  UINTN       StartAddress,\r
+  IN  UINTN       Length,\r
+  OUT UINT32      *Buffer\r
+  )\r
+{\r
+  UINT32    *ReturnBuffer;\r
+\r
+  ASSERT ((StartAddress & (sizeof (UINT32) - 1)) == 0);\r
+\r
+  ASSERT ((Length - 1) <=  (MAX_ADDRESS - StartAddress));\r
+  ASSERT ((Length - 1) <=  (MAX_ADDRESS - (UINTN) Buffer));\r
+\r
+  ASSERT ((Length & (sizeof (UINT32) - 1)) == 0);\r
+  ASSERT (((UINTN) Buffer & (sizeof (UINT32) - 1)) == 0);\r
+\r
+  ReturnBuffer = Buffer;\r
+\r
+  while (Length) {\r
+    *(Buffer++) = MmioRead32 (StartAddress);\r
+    StartAddress += sizeof (UINT32);\r
+    Length -= sizeof (UINT32);\r
+  }\r
+\r
+  return ReturnBuffer;\r
+}\r
+\r
+/**\r
+  Copy data from MMIO region to system memory by using 64-bit access.\r
+\r
+  Copy data from MMIO region specified by starting address StartAddress\r
+  to system memory specified by Buffer by using 64-bit access. The total\r
+  number of byte to be copied is specified by Length. Buffer is returned.\r
+\r
+  If StartAddress is not aligned on a 64-bit boundary, then ASSERT().\r
+\r
+  If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT().\r
+  If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().\r
+\r
+  If Length is not aligned on a 64-bit boundary, then ASSERT().\r
+  If Buffer is not aligned on a 64-bit boundary, then ASSERT().\r
+\r
+  @param  StartAddress    Starting address for the MMIO region to be copied from.\r
+  @param  Length          Size in bytes of the copy.\r
+  @param  Buffer          Pointer to a system memory buffer receiving the data read.\r
+\r
+  @return Buffer\r
+\r
+**/\r
+UINT64 *\r
+EFIAPI\r
+MmioReadBuffer64 (\r
+  IN  UINTN       StartAddress,\r
+  IN  UINTN       Length,\r
+  OUT UINT64      *Buffer\r
+  )\r
+{\r
+  UINT64    *ReturnBuffer;\r
+\r
+  ASSERT ((StartAddress & (sizeof (UINT64) - 1)) == 0);\r
+\r
+  ASSERT ((Length - 1) <=  (MAX_ADDRESS - StartAddress));\r
+  ASSERT ((Length - 1) <=  (MAX_ADDRESS - (UINTN) Buffer));\r
+\r
+  ASSERT ((Length & (sizeof (UINT64) - 1)) == 0);\r
+  ASSERT (((UINTN) Buffer & (sizeof (UINT64) - 1)) == 0);\r
+\r
+  ReturnBuffer = Buffer;\r
+\r
+  while (Length) {\r
+    *(Buffer++) = MmioRead64 (StartAddress);\r
+    StartAddress += sizeof (UINT64);\r
+    Length -= sizeof (UINT64);\r
+  }\r
+\r
+  return ReturnBuffer;\r
+}\r
+\r
+\r
+/**\r
+  Copy data from system memory to MMIO region by using 8-bit access.\r
+\r
+  Copy data from system memory specified by Buffer to MMIO region specified\r
+  by starting address StartAddress by using 8-bit access. The total number\r
+  of byte to be copied is specified by Length. Buffer is returned.\r
+\r
+  If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT().\r
+  If Length is greater than (MAX_ADDRESS -Buffer + 1), then ASSERT().\r
+\r
+\r
+  @param  StartAddress    Starting address for the MMIO region to be copied to.\r
+  @param  Length     Size in bytes of the copy.\r
+  @param  Buffer          Pointer to a system memory buffer containing the data to write.\r
+\r
+  @return Size in bytes of the copy.\r
+\r
+**/\r
+UINT8 *\r
+EFIAPI\r
+MmioWriteBuffer8 (\r
+  IN  UINTN         StartAddress,\r
+  IN  UINTN         Length,\r
+  IN  CONST UINT8   *Buffer\r
+  )\r
+{\r
+  VOID* ReturnBuffer;\r
+\r
+  ASSERT ((Length - 1) <=  (MAX_ADDRESS - StartAddress));\r
+  ASSERT ((Length - 1) <=  (MAX_ADDRESS - (UINTN) Buffer));\r
+\r
+  ReturnBuffer = (UINT8 *) Buffer;\r
+\r
+  while (Length--) {\r
+     MmioWrite8 (StartAddress++, *(Buffer++));\r
+  }\r
+\r
+  return ReturnBuffer;\r
+\r
+}\r
+\r
+/**\r
+  Copy data from system memory to MMIO region by using 16-bit access.\r
+\r
+  Copy data from system memory specified by Buffer to MMIO region specified\r
+  by starting address StartAddress by using 16-bit access. The total number\r
+  of byte to be copied is specified by Length. Length is returned.\r
+\r
+  If StartAddress is not aligned on a 16-bit boundary, then ASSERT().\r
+\r
+  If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT().\r
+  If Length is greater than (MAX_ADDRESS -Buffer + 1), then ASSERT().\r
+\r
+  If Length is not aligned on a 16-bit boundary, then ASSERT().\r
+\r
+  If Buffer is not aligned on a 16-bit boundary, then ASSERT().\r
+\r
+  @param  StartAddress    Starting address for the MMIO region to be copied to.\r
+  @param  Length     Size in bytes of the copy.\r
+  @param  Buffer          Pointer to a system memory buffer containing the data to write.\r
+\r
+  @return Size in bytes of the copy.\r
+\r
+**/\r
+UINT16 *\r
+EFIAPI\r
+MmioWriteBuffer16 (\r
+  IN  UINTN        StartAddress,\r
+  IN  UINTN        Length,\r
+  IN  CONST UINT16 *Buffer\r
+  )\r
+{\r
+  UINT16    *ReturnBuffer;\r
+\r
+  ASSERT ((StartAddress & (sizeof (UINT16) - 1)) == 0);\r
+\r
+  ASSERT ((Length - 1) <=  (MAX_ADDRESS - StartAddress));\r
+  ASSERT ((Length - 1) <=  (MAX_ADDRESS - (UINTN) Buffer));\r
+\r
+  ASSERT ((Length & (sizeof (UINT16) - 1)) == 0);\r
+  ASSERT (((UINTN) Buffer & (sizeof (UINT16) - 1)) == 0);\r
+\r
+  ReturnBuffer = (UINT16 *) Buffer;\r
+\r
+  while (Length) {\r
+    MmioWrite16 (StartAddress, *(Buffer++));\r
+\r
+    StartAddress += sizeof (UINT16);\r
+    Length -= sizeof (UINT16);\r
+  }\r
+\r
+  return ReturnBuffer;\r
+}\r
+\r
+\r
+/**\r
+  Copy data from system memory to MMIO region by using 32-bit access.\r
+\r
+  Copy data from system memory specified by Buffer to MMIO region specified\r
+  by starting address StartAddress by using 32-bit access. The total number\r
+  of byte to be copied is specified by Length. Length is returned.\r
+\r
+  If StartAddress is not aligned on a 32-bit boundary, then ASSERT().\r
+\r
+  If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT().\r
+  If Length is greater than (MAX_ADDRESS -Buffer + 1), then ASSERT().\r
+\r
+  If Length is not aligned on a 32-bit boundary, then ASSERT().\r
+\r
+  If Buffer is not aligned on a 32-bit boundary, then ASSERT().\r
+\r
+  @param  StartAddress    Starting address for the MMIO region to be copied to.\r
+  @param  Length     Size in bytes of the copy.\r
+  @param  Buffer          Pointer to a system memory buffer containing the data to write.\r
+\r
+  @return Size in bytes of the copy.\r
+\r
+**/\r
+UINT32 *\r
+EFIAPI\r
+MmioWriteBuffer32 (\r
+  IN  UINTN        StartAddress,\r
+  IN  UINTN        Length,\r
+  IN  CONST UINT32 *Buffer\r
+  )\r
+{\r
+  UINT32    *ReturnBuffer;\r
+\r
+  ASSERT ((StartAddress & (sizeof (UINT32) - 1)) == 0);\r
+\r
+  ASSERT ((Length - 1) <=  (MAX_ADDRESS - StartAddress));\r
+  ASSERT ((Length - 1) <=  (MAX_ADDRESS - (UINTN) Buffer));\r
+\r
+  ASSERT ((Length & (sizeof (UINT32) - 1)) == 0);\r
+  ASSERT (((UINTN) Buffer & (sizeof (UINT32) - 1)) == 0);\r
+\r
+  ReturnBuffer = (UINT32 *) Buffer;\r
+\r
+  while (Length) {\r
+    MmioWrite32 (StartAddress, *(Buffer++));\r
+\r
+    StartAddress += sizeof (UINT32);\r
+    Length -= sizeof (UINT32);\r
+  }\r
+\r
+  return ReturnBuffer;\r
+}\r
+\r
+/**\r
+  Copy data from system memory to MMIO region by using 64-bit access.\r
+\r
+  Copy data from system memory specified by Buffer to MMIO region specified\r
+  by starting address StartAddress by using 64-bit access. The total number\r
+  of byte to be copied is specified by Length. Length is returned.\r
+\r
+  If StartAddress is not aligned on a 64-bit boundary, then ASSERT().\r
+\r
+  If Length is greater than (MAX_ADDRESS - StartAddress + 1), then ASSERT().\r
+  If Length is greater than (MAX_ADDRESS -Buffer + 1), then ASSERT().\r
+\r
+  If Length is not aligned on a 64-bit boundary, then ASSERT().\r
+\r
+  If Buffer is not aligned on a 64-bit boundary, then ASSERT().\r
+\r
+  @param  StartAddress    Starting address for the MMIO region to be copied to.\r
+  @param  Length     Size in bytes of the copy.\r
+  @param  Buffer          Pointer to a system memory buffer containing the data to write.\r
+\r
+  @return Size in bytes of the copy.\r
+\r
+**/\r
+UINT64 *\r
+EFIAPI\r
+MmioWriteBuffer64 (\r
+  IN  UINTN        StartAddress,\r
+  IN  UINTN        Length,\r
+  IN  CONST UINT64 *Buffer\r
+  )\r
+{\r
+  UINT64    *ReturnBuffer;\r
+\r
+  ASSERT ((StartAddress & (sizeof (UINT64) - 1)) == 0);\r
+\r
+  ASSERT ((Length - 1) <=  (MAX_ADDRESS - StartAddress));\r
+  ASSERT ((Length - 1) <=  (MAX_ADDRESS - (UINTN) Buffer));\r
+\r
+  ASSERT ((Length & (sizeof (UINT64) - 1)) == 0);\r
+  ASSERT (((UINTN) Buffer & (sizeof (UINT64) - 1)) == 0);\r
+\r
+  ReturnBuffer = (UINT64 *) Buffer;\r
+\r
+  while (Length) {\r
+    MmioWrite64 (StartAddress, *(Buffer++));\r
+\r
+    StartAddress += sizeof (UINT64);\r
+    Length -= sizeof (UINT64);\r
+  }\r
+\r
+  return ReturnBuffer;\r
+}\r
+\r
diff --git a/IntelFrameworkPkg/Library/DxeReportStatusCodeLibFramework/DxeReportStatusCodeLib.msa b/IntelFrameworkPkg/Library/DxeReportStatusCodeLibFramework/DxeReportStatusCodeLib.msa
new file mode 100644 (file)
index 0000000..3014952
--- /dev/null
@@ -0,0 +1,75 @@
+<?xml version="1.0" encoding="UTF-8"?>\r
+<ModuleSurfaceArea xmlns="http://www.TianoCore.org/2006/Edk2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">\r
+  <MsaHeader>\r
+    <ModuleName>DxeReportStatusCodeLib</ModuleName>\r
+    <ModuleType>DXE_DRIVER</ModuleType>\r
+    <GuidValue>3ddc3b12-99ea-4364-b315-6310a2050be5</GuidValue>\r
+    <Version>1.0</Version>\r
+    <Abstract>DXE report status code library</Abstract>\r
+    <Description>Retrieve status code and report status code in DXE phase</Description>\r
+    <Copyright>Copyright (c) 2006 - 2007, Intel Corporation.</Copyright>\r
+    <License>All rights reserved. This program and the accompanying materials
+      are licensed and made available under the terms and conditions of the BSD License
+      which accompanies this distribution.  The full text of the license may be found at
+      http://opensource.org/licenses/bsd-license.php
+      THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+      WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.</License>\r
+    <Specification>FRAMEWORK_BUILD_PACKAGING_SPECIFICATION   0x00000052</Specification>\r
+  </MsaHeader>\r
+  <ModuleDefinitions>\r
+    <SupportedArchitectures>IA32 X64 IPF EBC</SupportedArchitectures>\r
+    <BinaryModule>false</BinaryModule>\r
+    <OutputFileBasename>DxeReportStatusCodeLib</OutputFileBasename>\r
+  </ModuleDefinitions>\r
+  <LibraryClassDefinitions>\r
+    <LibraryClass Usage="ALWAYS_PRODUCED" SupModuleList="DXE_CORE DXE_DRIVER DXE_RUNTIME_DRIVER DXE_SAL_DRIVER DXE_SMM_DRIVER UEFI_APPLICATION UEFI_DRIVER">\r
+      <Keyword>ReportStatusCodeLib</Keyword>\r
+    </LibraryClass>\r
+    <LibraryClass Usage="ALWAYS_CONSUMED">\r
+      <Keyword>DebugLib</Keyword>\r
+    </LibraryClass>\r
+    <LibraryClass Usage="ALWAYS_CONSUMED">\r
+      <Keyword>UefiBootServicesTableLib</Keyword>\r
+    </LibraryClass>\r
+    <LibraryClass Usage="ALWAYS_CONSUMED">\r
+      <Keyword>BaseLib</Keyword>\r
+    </LibraryClass>\r
+    <LibraryClass Usage="ALWAYS_CONSUMED">\r
+      <Keyword>BaseMemoryLib</Keyword>\r
+    </LibraryClass>\r
+    <LibraryClass Usage="ALWAYS_CONSUMED">\r
+      <Keyword>PcdLib</Keyword>\r
+    </LibraryClass>\r
+  </LibraryClassDefinitions>\r
+  <SourceFiles>\r
+    <Filename>ReportStatusCodeLib.c</Filename>\r
+  </SourceFiles>\r
+  <PackageDependencies>\r
+    <Package PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/>\r
+  </PackageDependencies>\r
+  <Protocols>\r
+    <Protocol Usage="ALWAYS_CONSUMED">\r
+      <ProtocolCName>gEfiStatusCodeRuntimeProtocolGuid</ProtocolCName>\r
+    </Protocol>\r
+  </Protocols>\r
+  <Guids>\r
+    <GuidCNames Usage="ALWAYS_CONSUMED">\r
+      <GuidCName>gEfiStatusCodeDataTypeDebugGuid</GuidCName>\r
+    </GuidCNames>\r
+    <GuidCNames Usage="ALWAYS_CONSUMED">\r
+      <GuidCName>gEfiStatusCodeSpecificDataGuid</GuidCName>\r
+    </GuidCNames>\r
+  </Guids>\r
+  <Externs>\r
+    <Specification>EFI_SPECIFICATION_VERSION 0x00020000</Specification>\r
+    <Specification>EDK_RELEASE_VERSION 0x00020000</Specification>\r
+  </Externs>\r
+  <PcdCoded>\r
+    <PcdEntry PcdItemType="FIXED_AT_BUILD">\r
+      <C_Name>PcdReportStatusCodePropertyMask</C_Name>\r
+      <TokenSpaceGuidCName>gEfiMdePkgTokenSpaceGuid</TokenSpaceGuidCName>\r
+      <HelpText>The bitmask of flags that specify the enable/disable of
+                Progress Code, Error Code and Debug Code.</HelpText>\r
+    </PcdEntry>\r
+  </PcdCoded>\r
+</ModuleSurfaceArea>
\ No newline at end of file
diff --git a/IntelFrameworkPkg/Library/DxeReportStatusCodeLibFramework/ReportStatusCodeLib.c b/IntelFrameworkPkg/Library/DxeReportStatusCodeLibFramework/ReportStatusCodeLib.c
new file mode 100644 (file)
index 0000000..270966a
--- /dev/null
@@ -0,0 +1,602 @@
+/** @file\r
+  Report Status Code Library for DXE Phase.\r
+\r
+  Copyright (c) 2006 - 2007, Intel Corporation<BR>\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#include <Common/FrameworkDxeCis.h>\r
+#include <Library/DebugLib.h>\r
+#include <Library/UefiBootServicesTableLib.h>\r
+#include <Library/UefiRuntimeServicesTableLib.h>\r
+#include <Library/BaseLib.h>\r
+#include <Library/BaseMemoryLib.h>\r
+#include <Library/PcdLib.h>\r
+#include <Library/ReportStatusCodeLib.h>\r
+\r
+#include <Protocol/StatusCode.h>\r
+\r
+/**\r
+  Internal worker function that reports a status code through the Status Code Protocol\r
+\r
+  This function checks to see if a Status Code Protocol is present in the handle\r
+  database.  If a Status Code Protocol is not present, then EFI_UNSUPPORTED is\r
+  returned.  If a Status Code Protocol is present, then it is cached in gStatusCode,\r
+  and the ReportStatusCode() service of the Status Code Protocol is called passing in\r
+  Type, Value, Instance, CallerId, and Data.  The result of this call is returned.\r
+\r
+  @param  Type              Status code type.\r
+  @param  Value             Status code value.\r
+  @param  Instance          Status code instance number.\r
+  @param  CallerId          Pointer to a GUID that identifies the caller of this\r
+                            function.  This is an optional parameter that may be\r
+                            NULL.\r
+  @param  Data              Pointer to the extended data buffer.  This is an\r
+                            optional parameter that may be NULL.\r
+\r
+  @retval  EFI_SUCCESS           The status code was reported.\r
+  @retval  EFI_OUT_OF_RESOURCES  There were not enough resources to report the status code.\r
+  @retval  EFI_UNSUPPORTED       Status Code Protocol is not available.\r
+\r
+**/\r
+STATIC\r
+EFI_STATUS\r
+InternalReportStatusCode (\r
+  IN EFI_STATUS_CODE_TYPE     Type,\r
+  IN EFI_STATUS_CODE_VALUE    Value,\r
+  IN UINT32                   Instance,\r
+  IN CONST EFI_GUID           *CallerId OPTIONAL,\r
+  IN EFI_STATUS_CODE_DATA     *Data     OPTIONAL\r
+  )\r
+{\r
+  EFI_STATUS                    Status;\r
+  EFI_STATUS_CODE_PROTOCOL      *StatusCode;\r
+  STATIC EFI_REPORT_STATUS_CODE ReportStatusCode = NULL;\r
+\r
+  //\r
+  // If gStatusCode is NULL, then see if a Status Code Protocol instance is present\r
+  // in the handle database.\r
+  //\r
+  if (ReportStatusCode == NULL) {\r
+    if (gBS == NULL) {\r
+      return EFI_UNSUPPORTED;\r
+    }\r
+    Status = gBS->LocateProtocol (&gEfiStatusCodeRuntimeProtocolGuid, NULL, &StatusCode);\r
+    if (!EFI_ERROR (Status) && StatusCode != NULL) {\r
+      ReportStatusCode = StatusCode->ReportStatusCode;\r
+    } else if (gRT->Hdr.Revision < 0x20000) {\r
+      ReportStatusCode = ((FRAMEWORK_EFI_RUNTIME_SERVICES*)gRT)->ReportStatusCode;\r
+    } else {\r
+      return EFI_UNSUPPORTED;\r
+    }\r
+  }\r
+\r
+  //\r
+  // A Status Code Protocol is present in the handle database, so pass in all the\r
+  // parameters to the ReportStatusCode() service of the Status Code Protocol\r
+  //\r
+  return (*ReportStatusCode) (Type, Value, Instance, (EFI_GUID *)CallerId, Data);\r
+}\r
+\r
+\r
+/**\r
+  Computes and returns the size, in bytes, of a device path.\r
+\r
+  @param  DevicePath  A pointer to a device path.\r
+\r
+  @return  The size, in bytes, of DevicePath.\r
+\r
+**/\r
+STATIC\r
+UINTN\r
+InternalReportStatusCodeDevicePathSize (\r
+  IN CONST EFI_DEVICE_PATH_PROTOCOL  *DevicePath\r
+  )\r
+{\r
+  CONST EFI_DEVICE_PATH_PROTOCOL  *Start;\r
+\r
+  //\r
+  // Search for the end of the device path structure\r
+  //\r
+  Start = DevicePath;\r
+  while (!EfiIsDevicePathEnd (DevicePath)) {\r
+    DevicePath = EfiNextDevicePathNode (DevicePath);\r
+  }\r
+\r
+  //\r
+  // Subtract the start node from the end node and add in the size of the end node\r
+  //\r
+  return ((UINTN) DevicePath - (UINTN) Start) + DevicePathNodeLength (DevicePath);\r
+}\r
+\r
+\r
+/**\r
+  Converts a status code to an 8-bit POST code value.\r
+\r
+  Converts the status code specified by CodeType and Value to an 8-bit POST code\r
+  and returns the 8-bit POST code in PostCode.  If CodeType is an\r
+  EFI_PROGRESS_CODE or CodeType is an EFI_ERROR_CODE, then bits 0..4 of PostCode\r
+  are set to bits 16..20 of Value, and bits 5..7 of PostCode are set to bits\r
+  24..26 of Value., and TRUE is returned.  Otherwise, FALSE is returned.\r
+\r
+  If PostCode is NULL, then ASSERT().\r
+\r
+  @param  CodeType  The type of status code being converted.\r
+  @param  Value     The status code value being converted.\r
+  @param  PostCode  A pointer to the 8-bit POST code value to return.\r
+\r
+  @retval  TRUE   The status code specified by CodeType and Value was converted\r
+                  to an 8-bit POST code and returned in  PostCode.\r
+  @retval  FALSE  The status code specified by CodeType and Value could not be\r
+                  converted to an 8-bit POST code value.\r
+\r
+**/\r
+BOOLEAN\r
+EFIAPI\r
+CodeTypeToPostCode (\r
+  IN  EFI_STATUS_CODE_TYPE   CodeType,\r
+  IN  EFI_STATUS_CODE_VALUE  Value,\r
+  OUT UINT8                  *PostCode\r
+  )\r
+{\r
+  //\r
+  // If PostCode is NULL, then ASSERT()\r
+  //\r
+  ASSERT (PostCode != NULL);\r
+\r
+  //\r
+  // Convert Value to an 8 bit post code\r
+  //\r
+  if (((CodeType & EFI_STATUS_CODE_TYPE_MASK) == EFI_PROGRESS_CODE) ||\r
+      ((CodeType & EFI_STATUS_CODE_TYPE_MASK) == EFI_ERROR_CODE)       ) {\r
+    *PostCode  = (UINT8) ((((Value & EFI_STATUS_CODE_CLASS_MASK) >> 24) << 5) |\r
+                          (((Value & EFI_STATUS_CODE_SUBCLASS_MASK) >> 16) & 0x1f));\r
+    return TRUE;\r
+  }\r
+  return FALSE;\r
+}\r
+\r
+\r
+/**\r
+  Extracts ASSERT() information from a status code structure.\r
+\r
+  Converts the status code specified by CodeType, Value, and Data to the ASSERT()\r
+  arguments specified by Filename, Description, and LineNumber.  If CodeType is\r
+  an EFI_ERROR_CODE, and CodeType has a severity of EFI_ERROR_UNRECOVERED, and\r
+  Value has an operation mask of EFI_SW_EC_ILLEGAL_SOFTWARE_STATE, extract\r
+  Filename, Description, and LineNumber from the optional data area of the\r
+  status code buffer specified by Data.  The optional data area of Data contains\r
+  a Null-terminated ASCII string for the FileName, followed by a Null-terminated\r
+  ASCII string for the Description, followed by a 32-bit LineNumber.  If the\r
+  ASSERT() information could be extracted from Data, then return TRUE.\r
+  Otherwise, FALSE is returned.\r
+\r
+  If Data is NULL, then ASSERT().\r
+  If Filename is NULL, then ASSERT().\r
+  If Description is NULL, then ASSERT().\r
+  If LineNumber is NULL, then ASSERT().\r
+\r
+  @param  CodeType     The type of status code being converted.\r
+  @param  Value        The status code value being converted.\r
+  @param  Data         Pointer to status code data buffer.\r
+  @param  Filename     Pointer to the source file name that generated the ASSERT().\r
+  @param  Description  Pointer to the description of the ASSERT().\r
+  @param  LineNumber   Pointer to source line number that generated the ASSERT().\r
+\r
+  @retval  TRUE   The status code specified by CodeType, Value, and Data was\r
+                  converted ASSERT() arguments specified by Filename, Description,\r
+                  and LineNumber.\r
+  @retval  FALSE  The status code specified by CodeType, Value, and Data could\r
+                  not be converted to ASSERT() arguments.\r
+\r
+**/\r
+BOOLEAN\r
+EFIAPI\r
+ReportStatusCodeExtractAssertInfo (\r
+  IN EFI_STATUS_CODE_TYPE        CodeType,\r
+  IN EFI_STATUS_CODE_VALUE       Value,\r
+  IN CONST EFI_STATUS_CODE_DATA  *Data,\r
+  OUT CHAR8                      **Filename,\r
+  OUT CHAR8                      **Description,\r
+  OUT UINT32                     *LineNumber\r
+  )\r
+{\r
+  EFI_DEBUG_ASSERT_DATA  *AssertData;\r
+\r
+  ASSERT (Data        != NULL);\r
+  ASSERT (Filename    != NULL);\r
+  ASSERT (Description != NULL);\r
+  ASSERT (LineNumber  != NULL);\r
+\r
+  if (((CodeType & EFI_STATUS_CODE_TYPE_MASK)      == EFI_ERROR_CODE) &&\r
+      ((CodeType & EFI_STATUS_CODE_SEVERITY_MASK)  == EFI_ERROR_UNRECOVERED) &&\r
+      ((Value    & EFI_STATUS_CODE_OPERATION_MASK) == EFI_SW_EC_ILLEGAL_SOFTWARE_STATE)) {\r
+    AssertData   = (EFI_DEBUG_ASSERT_DATA *)(Data + 1);\r
+    *Filename    = (CHAR8 *)(AssertData + 1);\r
+    *Description = *Filename + AsciiStrLen (*Filename) + 1;\r
+    *LineNumber  = AssertData->LineNumber;\r
+    return TRUE;\r
+  }\r
+  return FALSE;\r
+}\r
+\r
+\r
+/**\r
+  Extracts DEBUG() information from a status code structure.\r
+\r
+  Converts the status code specified by Data to the DEBUG() arguments specified\r
+  by ErrorLevel, Marker, and Format.  If type GUID in Data is\r
+  EFI_STATUS_CODE_DATA_TYPE_DEBUG_GUID, then extract ErrorLevel, Marker, and\r
+  Format from the optional data area of the status code buffer specified by Data.\r
+  The optional data area of Data contains a 32-bit ErrorLevel followed by Marker\r
+  which is 12 UINTN parameters, followed by a Null-terminated ASCII string for\r
+  the Format.  If the DEBUG() information could be extracted from Data, then\r
+  return TRUE.  Otherwise, FALSE is returned.\r
+\r
+  If Data is NULL, then ASSERT().\r
+  If ErrorLevel is NULL, then ASSERT().\r
+  If Marker is NULL, then ASSERT().\r
+  If Format is NULL, then ASSERT().\r
+\r
+  @param  Data        Pointer to status code data buffer.\r
+  @param  ErrorLevel  Pointer to error level mask for a debug message.\r
+  @param  Marker      Pointer to the variable argument list associated with Format.\r
+  @param  Format      Pointer to a Null-terminated ASCII format string of a\r
+                      debug message.\r
+\r
+  @retval  TRUE   The status code specified by Data was converted DEBUG() arguments\r
+                  specified by ErrorLevel, Marker, and Format.\r
+  @retval  FALSE  The status code specified by Data could not be converted to\r
+                  DEBUG() arguments.\r
+\r
+**/\r
+BOOLEAN\r
+EFIAPI\r
+ReportStatusCodeExtractDebugInfo (\r
+  IN CONST EFI_STATUS_CODE_DATA  *Data,\r
+  OUT UINT32                     *ErrorLevel,\r
+  OUT VA_LIST                    *Marker,\r
+  OUT CHAR8                      **Format\r
+  )\r
+{\r
+  EFI_DEBUG_INFO  *DebugInfo;\r
+\r
+  ASSERT (Data       != NULL);\r
+  ASSERT (ErrorLevel != NULL);\r
+  ASSERT (Marker     != NULL);\r
+  ASSERT (Format     != NULL);\r
+\r
+  //\r
+  // If the GUID type is not EFI_STATUS_CODE_DATA_TYPE_DEBUG_GUID then return FALSE\r
+  //\r
+  if (!CompareGuid (&Data->Type, &gEfiStatusCodeDataTypeDebugGuid)) {\r
+    return FALSE;\r
+  }\r
+\r
+  //\r
+  // Retrieve the debug information from the status code record\r
+  //\r
+  DebugInfo = (EFI_DEBUG_INFO *)(Data + 1);\r
+\r
+  *ErrorLevel = DebugInfo->ErrorLevel;\r
+\r
+  //\r
+  // The first 12 * UINTN bytes of the string are really an\r
+  // argument stack to support varargs on the Format string.\r
+  //\r
+  *Marker = (VA_LIST) (DebugInfo + 1);\r
+  *Format = (CHAR8 *)(((UINT64 *)*Marker) + 12);\r
+\r
+  return TRUE;\r
+}\r
+\r
+\r
+/**\r
+  Reports a status code.\r
+\r
+  Reports the status code specified by the parameters Type and Value.  Status\r
+  code also require an instance, caller ID, and extended data.  This function\r
+  passed in a zero instance, NULL extended data, and a caller ID of\r
+  gEfiCallerIdGuid, which is the GUID for the module.\r
+\r
+  ReportStatusCode()must actively prevent recusrsion.  If ReportStatusCode()\r
+  is called while processing another any other Report Status Code Library function,\r
+  then ReportStatusCode() must return immediately.\r
+\r
+  @param  Type   Status code type.\r
+  @param  Value  Status code value.\r
+\r
+  @retval  EFI_SUCCESS       The status code was reported.\r
+  @retval  EFI_DEVICE_ERROR  There status code could not be reported due to a\r
+                             device error.\r
+  @retval  EFI_UNSUPPORTED   Report status code is not supported\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+ReportStatusCode (\r
+  IN EFI_STATUS_CODE_TYPE   Type,\r
+  IN EFI_STATUS_CODE_VALUE  Value\r
+  )\r
+{\r
+  return InternalReportStatusCode (Type, Value, 0, &gEfiCallerIdGuid, NULL);\r
+}\r
+\r
+\r
+/**\r
+  Reports a status code with a Device Path Protocol as the extended data.\r
+\r
+  Allocates and fills in the extended data section of a status code with the\r
+  Device Path Protocol specified by DevicePath.  This function is responsible\r
+  for allocating a buffer large enough for the standard header and the device\r
+  path.  The standard header is filled in with a GUID of\r
+  gEfiStatusCodeSpecificDataGuid.  The status code is reported with a zero\r
+  instance and a caller ID of gEfiCallerIdGuid.\r
+\r
+  ReportStatusCodeWithDevicePath()must actively prevent recursion.  If\r
+  ReportStatusCodeWithDevicePath() is called while processing another any other\r
+  Report Status Code Library function, then ReportStatusCodeWithDevicePath()\r
+  must return EFI_DEVICE_ERROR immediately.\r
+\r
+  If DevicePath is NULL, then ASSERT().\r
+\r
+  @param  Type        Status code type.\r
+  @param  Value       Status code value.\r
+  @param  DevicePath  Pointer to the Device Path Protocol to be reported.\r
+\r
+  @retval  EFI_SUCCESS           The status code was reported with the extended\r
+                                 data specified by DevicePath.\r
+  @retval  EFI_OUT_OF_RESOURCES  There were not enough resources to allocate the\r
+                                 extended data section.\r
+  @retval  EFI_UNSUPPORTED       Report status code is not supported\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+ReportStatusCodeWithDevicePath (\r
+  IN EFI_STATUS_CODE_TYPE            Type,\r
+  IN EFI_STATUS_CODE_VALUE           Value,\r
+  IN CONST EFI_DEVICE_PATH_PROTOCOL  *DevicePath\r
+  )\r
+{\r
+  ASSERT (DevicePath != NULL);\r
+  return ReportStatusCodeWithExtendedData (\r
+           Type,\r
+           Value,\r
+           (VOID *)DevicePath,\r
+           InternalReportStatusCodeDevicePathSize (DevicePath)\r
+           );\r
+}\r
+\r
+\r
+/**\r
+  Reports a status code with an extended data buffer.\r
+\r
+  Allocates and fills in the extended data section of a status code with the\r
+  extended data specified by ExtendedData and ExtendedDataSize.  ExtendedData\r
+  is assumed to be one of the data structures specified in Related Definitions.\r
+  These data structure do not have the standard header, so this function is\r
+  responsible for allocating a buffer large enough for the standard header and\r
+  the extended data passed into this function.  The standard header is filled\r
+  in with a GUID of  gEfiStatusCodeSpecificDataGuid.  The status code is reported\r
+  with a zero instance and a caller ID of gEfiCallerIdGuid.\r
+\r
+  ReportStatusCodeWithExtendedData()must actively prevent recursion.  If\r
+  ReportStatusCodeWithExtendedData() is called while processing another any other\r
+  Report Status Code Library function, then ReportStatusCodeWithExtendedData()\r
+  must return EFI_DEVICE_ERROR immediately.\r
+\r
+  If ExtendedData is NULL, then ASSERT().\r
+  If ExtendedDataSize is 0, then ASSERT().\r
+\r
+  @param  Type              Status code type.\r
+  @param  Value             Status code value.\r
+  @param  ExtendedData      Pointer to the extended data buffer to be reported.\r
+  @param  ExtendedDataSize  The size, in bytes, of the extended data buffer to\r
+                            be reported.\r
+\r
+  @retval  EFI_SUCCESS           The status code was reported with the extended\r
+                                 data specified by ExtendedData and ExtendedDataSize.\r
+  @retval  EFI_OUT_OF_RESOURCES  There were not enough resources to allocate the\r
+                                 extended data section.\r
+  @retval  EFI_UNSUPPORTED       Report status code is not supported\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+ReportStatusCodeWithExtendedData (\r
+  IN EFI_STATUS_CODE_TYPE   Type,\r
+  IN EFI_STATUS_CODE_VALUE  Value,\r
+  IN CONST VOID             *ExtendedData,\r
+  IN UINTN                  ExtendedDataSize\r
+  )\r
+{\r
+  ASSERT (ExtendedData     != NULL);\r
+  ASSERT (ExtendedDataSize != 0);\r
+  return ReportStatusCodeEx (\r
+           Type,\r
+           Value,\r
+           0,\r
+           NULL,\r
+           NULL,\r
+           ExtendedData,\r
+           ExtendedDataSize\r
+           );\r
+}\r
+\r
+\r
+/**\r
+  Reports a status code with full parameters.\r
+\r
+  The function reports a status code.  If ExtendedData is NULL and ExtendedDataSize\r
+  is 0, then an extended data buffer is not reported.  If ExtendedData is not\r
+  NULL and ExtendedDataSize is not 0, then an extended data buffer is allocated.\r
+  ExtendedData is assumed not have the standard status code header, so this function\r
+  is responsible for allocating a buffer large enough for the standard header and\r
+  the extended data passed into this function.  The standard header is filled in\r
+  with a GUID specified by ExtendedDataGuid.  If ExtendedDataGuid is NULL, then a\r
+  GUID of gEfiStatusCodeSpecificDatauid is used.  The status code is reported with\r
+  an instance specified by Instance and a caller ID specified by CallerId.  If\r
+  CallerId is NULL, then a caller ID of gEfiCallerIdGuid is used.\r
+\r
+  ReportStatusCodeEx()must actively prevent recursion.  If ReportStatusCodeEx()\r
+  is called while processing another any other Report Status Code Library function,\r
+  then ReportStatusCodeEx() must return EFI_DEVICE_ERROR immediately.\r
+\r
+  If ExtendedData is NULL and ExtendedDataSize is not zero, then ASSERT().\r
+  If ExtendedData is not NULL and ExtendedDataSize is zero, then ASSERT().\r
+\r
+  @param  Type              Status code type.\r
+  @param  Value             Status code value.\r
+  @param  Instance          Status code instance number.\r
+  @param  CallerId          Pointer to a GUID that identifies the caller of this\r
+                            function.  If this parameter is NULL, then a caller\r
+                            ID of gEfiCallerIdGuid is used.\r
+  @param  ExtendedDataGuid  Pointer to the GUID for the extended data buffer.\r
+                            If this parameter is NULL, then a the status code\r
+                            standard header is filled in with\r
+                            gEfiStatusCodeSpecificDataGuid.\r
+  @param  ExtendedData      Pointer to the extended data buffer.  This is an\r
+                            optional parameter that may be NULL.\r
+  @param  ExtendedDataSize  The size, in bytes, of the extended data buffer.\r
+\r
+  @retval  EFI_SUCCESS           The status code was reported.\r
+  @retval  EFI_OUT_OF_RESOURCES  There were not enough resources to allocate\r
+                                 the extended data section if it was specified.\r
+  @retval  EFI_UNSUPPORTED       Report status code is not supported\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+ReportStatusCodeEx (\r
+  IN EFI_STATUS_CODE_TYPE   Type,\r
+  IN EFI_STATUS_CODE_VALUE  Value,\r
+  IN UINT32                 Instance,\r
+  IN CONST EFI_GUID         *CallerId          OPTIONAL,\r
+  IN CONST EFI_GUID         *ExtendedDataGuid  OPTIONAL,\r
+  IN CONST VOID             *ExtendedData      OPTIONAL,\r
+  IN UINTN                  ExtendedDataSize\r
+  )\r
+{\r
+  EFI_STATUS            Status;\r
+  EFI_STATUS_CODE_DATA  *StatusCodeData;\r
+\r
+  ASSERT (!((ExtendedData == NULL) && (ExtendedDataSize != 0)));\r
+  ASSERT (!((ExtendedData != NULL) && (ExtendedDataSize == 0)));\r
+\r
+  if (gBS == NULL) {\r
+    return EFI_UNSUPPORTED;\r
+  }\r
+\r
+  //\r
+  // Allocate space for the Status Code Header and its buffer\r
+  //\r
+  StatusCodeData = NULL;\r
+  gBS->AllocatePool (EfiBootServicesData, sizeof (EFI_STATUS_CODE_DATA) + ExtendedDataSize, (VOID **)&StatusCodeData);\r
+  if (StatusCodeData == NULL) {\r
+    return EFI_OUT_OF_RESOURCES;\r
+  }\r
+\r
+  //\r
+  // Fill in the extended data header\r
+  //\r
+  StatusCodeData->HeaderSize = sizeof (EFI_STATUS_CODE_DATA);\r
+  StatusCodeData->Size = (UINT16)ExtendedDataSize;\r
+  if (ExtendedDataGuid == NULL) {\r
+    ExtendedDataGuid = &gEfiStatusCodeSpecificDataGuid;\r
+  }\r
+  CopyGuid (&StatusCodeData->Type, ExtendedDataGuid);\r
+\r
+  //\r
+  // Fill in the extended data buffer\r
+  //\r
+  CopyMem (StatusCodeData + 1, ExtendedData, ExtendedDataSize);\r
+\r
+  //\r
+  // Report the status code\r
+  //\r
+  if (CallerId == NULL) {\r
+    CallerId = &gEfiCallerIdGuid;\r
+  }\r
+  Status = InternalReportStatusCode (Type, Value, Instance, CallerId, StatusCodeData);\r
+\r
+  //\r
+  // Free the allocated buffer\r
+  //\r
+  gBS->FreePool (StatusCodeData);\r
+\r
+  return Status;\r
+}\r
+\r
+\r
+/**\r
+  Returns TRUE if status codes of type EFI_PROGRESS_CODE are enabled\r
+\r
+  This function returns TRUE if the REPORT_STATUS_CODE_PROPERTY_PROGRESS_CODE_ENABLED\r
+  bit of PcdReportStatusCodeProperyMask is set.  Otherwise FALSE is returned.\r
+\r
+  @retval  TRUE   The REPORT_STATUS_CODE_PROPERTY_PROGRESS_CODE_ENABLED bit of\r
+                  PcdReportStatusCodeProperyMask is set.\r
+  @retval  FALSE  The REPORT_STATUS_CODE_PROPERTY_PROGRESS_CODE_ENABLED bit of\r
+                  PcdReportStatusCodeProperyMask is clear.\r
+\r
+**/\r
+BOOLEAN\r
+EFIAPI\r
+ReportProgressCodeEnabled (\r
+  VOID\r
+  )\r
+{\r
+  return (BOOLEAN) ((PcdGet8(PcdReportStatusCodePropertyMask) & REPORT_STATUS_CODE_PROPERTY_PROGRESS_CODE_ENABLED) != 0);\r
+}\r
+\r
+\r
+/**\r
+  Returns TRUE if status codes of type EFI_ERROR_CODE are enabled\r
+\r
+  This function returns TRUE if the REPORT_STATUS_CODE_PROPERTY_ERROR_CODE_ENABLED\r
+  bit of PcdReportStatusCodeProperyMask is set.  Otherwise FALSE is returned.\r
+\r
+  @retval  TRUE   The REPORT_STATUS_CODE_PROPERTY_ERROR_CODE_ENABLED bit of\r
+                  PcdReportStatusCodeProperyMask is set.\r
+  @retval  FALSE  The REPORT_STATUS_CODE_PROPERTY_ERROR_CODE_ENABLED bit of\r
+                  PcdReportStatusCodeProperyMask is clear.\r
+\r
+**/\r
+BOOLEAN\r
+EFIAPI\r
+ReportErrorCodeEnabled (\r
+  VOID\r
+  )\r
+{\r
+  return (BOOLEAN) ((PcdGet8(PcdReportStatusCodePropertyMask) & REPORT_STATUS_CODE_PROPERTY_ERROR_CODE_ENABLED) != 0);\r
+}\r
+\r
+\r
+/**\r
+  Returns TRUE if status codes of type EFI_DEBUG_CODE are enabled\r
+\r
+  This function returns TRUE if the REPORT_STATUS_CODE_PROPERTY_DEBUG_CODE_ENABLED\r
+  bit of PcdReportStatusCodeProperyMask is set.  Otherwise FALSE is returned.\r
+\r
+  @retval  TRUE   The REPORT_STATUS_CODE_PROPERTY_DEBUG_CODE_ENABLED bit of\r
+                  PcdReportStatusCodeProperyMask is set.\r
+  @retval  FALSE  The REPORT_STATUS_CODE_PROPERTY_DEBUG_CODE_ENABLED bit of\r
+                  PcdReportStatusCodeProperyMask is clear.\r
+\r
+**/\r
+BOOLEAN\r
+EFIAPI\r
+ReportDebugCodeEnabled (\r
+  VOID\r
+  )\r
+{\r
+  return (BOOLEAN) ((PcdGet8(PcdReportStatusCodePropertyMask) & REPORT_STATUS_CODE_PROPERTY_DEBUG_CODE_ENABLED) != 0);\r
+}\r
diff --git a/IntelFrameworkPkg/Library/DxeSmmDriverEntryPoint/DriverEntryPoint.c b/IntelFrameworkPkg/Library/DxeSmmDriverEntryPoint/DriverEntryPoint.c
new file mode 100644 (file)
index 0000000..cf50f23
--- /dev/null
@@ -0,0 +1,282 @@
+/** @file\r
+  Entry point to a EFI/DXE driver.\r
+\r
+Copyright (c) 2006, Intel Corporation<BR>\r
+All rights reserved. This program and the accompanying materials\r
+are licensed and made available under the terms and conditions of the BSD License\r
+which accompanies this distribution.  The full text of the license may be found at\r
+http://opensource.org/licenses/bsd-license.php\r
+\r
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#include <FrameworkDxe.h>\r
+#include <Library/UefiBootServicesTableLib.h>\r
+#include <Library/DebugLib.h>\r
+#include <Library/DxeSmmDriverEntryPoint.h>\r
+\r
+#include <Protocol/LoadedImage.h>\r
+#include <Protocol/SmmBase.h>\r
+\r
+EFI_BOOT_SERVICES  *mBS;\r
+\r
+/**\r
+  This function returns the size, in bytes,\r
+  of the device path data structure specified by DevicePath.\r
+  If DevicePath is NULL, then 0 is returned.\r
+\r
+  @param  DevicePath A pointer to a device path data structure.\r
+\r
+  @return The size of a device path in bytes.\r
+\r
+**/\r
+STATIC\r
+UINTN\r
+EFIAPI\r
+SmmGetDevicePathSize (\r
+  IN CONST EFI_DEVICE_PATH_PROTOCOL  *DevicePath\r
+  )\r
+{\r
+  CONST EFI_DEVICE_PATH_PROTOCOL  *Start;\r
+\r
+  if (DevicePath == NULL) {\r
+    return 0;\r
+  }\r
+\r
+  //\r
+  // Search for the end of the device path structure\r
+  //\r
+  Start = DevicePath;\r
+  while (!EfiIsDevicePathEnd (DevicePath)) {\r
+    DevicePath = EfiNextDevicePathNode (DevicePath);\r
+  }\r
+\r
+  //\r
+  // Compute the size and add back in the size of the end device path structure\r
+  //\r
+  return ((UINTN) DevicePath - (UINTN) Start) + sizeof (EFI_DEVICE_PATH_PROTOCOL);\r
+}\r
+\r
+/**\r
+  This function appends the device path SecondDevicePath\r
+  to every device path instance in FirstDevicePath.\r
+\r
+  @param  FirstDevicePath A pointer to a device path data structure.\r
+\r
+  @param  SecondDevicePath A pointer to a device path data structure.\r
+\r
+  @return A pointer to the new device path is returned.\r
+          NULL is returned if space for the new device path could not be allocated from pool.\r
+          It is up to the caller to free the memory used by FirstDevicePath and SecondDevicePath\r
+          if they are no longer needed.\r
+\r
+**/\r
+EFI_DEVICE_PATH_PROTOCOL *\r
+EFIAPI\r
+SmmAppendDevicePath (\r
+  IN CONST EFI_DEVICE_PATH_PROTOCOL  *FirstDevicePath,\r
+  IN CONST EFI_DEVICE_PATH_PROTOCOL  *SecondDevicePath\r
+  )\r
+{\r
+  EFI_STATUS                Status;\r
+  UINTN                     Size;\r
+  UINTN                     Size1;\r
+  UINTN                     Size2;\r
+  EFI_DEVICE_PATH_PROTOCOL  *NewDevicePath;\r
+  EFI_DEVICE_PATH_PROTOCOL  *DevicePath2;\r
+\r
+  ASSERT (FirstDevicePath != NULL && SecondDevicePath != NULL);\r
+\r
+  //\r
+  // Allocate space for the combined device path. It only has one end node of\r
+  // length EFI_DEVICE_PATH_PROTOCOL\r
+  //\r
+  Size1         = SmmGetDevicePathSize (FirstDevicePath);\r
+  Size2         = SmmGetDevicePathSize (SecondDevicePath);\r
+  Size          = Size1 + Size2 - sizeof (EFI_DEVICE_PATH_PROTOCOL);\r
+\r
+  Status = mBS->AllocatePool (EfiBootServicesData, Size, (VOID **) &NewDevicePath);\r
+\r
+  if (EFI_SUCCESS == Status) {\r
+    mBS->CopyMem ((VOID *) NewDevicePath, (VOID *) FirstDevicePath, Size1);\r
+    //\r
+    // Over write Src1 EndNode and do the copy\r
+    //\r
+    DevicePath2 = (EFI_DEVICE_PATH_PROTOCOL *) ((CHAR8 *) NewDevicePath + (Size1 - sizeof (EFI_DEVICE_PATH_PROTOCOL)));\r
+    mBS->CopyMem ((VOID *) DevicePath2, (VOID *) SecondDevicePath, Size2);\r
+  }\r
+\r
+  return NewDevicePath;\r
+}\r
+\r
+/**\r
+  Unload function that is registered in the LoadImage protocol.  It un-installs\r
+  protocols produced and deallocates pool used by the driver.  Called by the core\r
+  when unloading the driver.\r
+\r
+  @param  ImageHandle   ImageHandle of the unloaded driver\r
+\r
+  @return Status of the ProcessModuleUnloadList.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+_DriverUnloadHandler (\r
+  EFI_HANDLE ImageHandle\r
+  )\r
+{\r
+  EFI_STATUS  Status;\r
+\r
+  //\r
+  // Call the unload handlers for all the modules\r
+  //\r
+  Status = ProcessModuleUnloadList (ImageHandle);\r
+\r
+  //\r
+  // If the driver specific unload handler does not return an error, then call all of the\r
+  // library destructors.  If the unload handler returned an error, then the driver can not be\r
+  // unloaded, and the library destructors should not be called\r
+  //\r
+  if (!EFI_ERROR (Status)) {\r
+    ProcessLibraryDestructorList (ImageHandle, gST);\r
+  }\r
+\r
+  //\r
+  // Return the status from the driver specific unload handler\r
+  //\r
+  return Status;\r
+}\r
+\r
+/**\r
+  Enrty point to DXE SMM Driver.\r
+\r
+  @param  ImageHandle ImageHandle of the loaded driver.\r
+  @param  SystemTable Pointer to the EFI System Table.\r
+\r
+  @retval  EFI_SUCCESS One or more of the drivers returned a success code.\r
+  @retval  !EFI_SUCESS The return status from the last driver entry point in the list.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+_ModuleEntryPoint (\r
+  IN EFI_HANDLE        ImageHandle,\r
+  IN EFI_SYSTEM_TABLE  *SystemTable\r
+  )\r
+{\r
+  EFI_STATUS                 Status;\r
+  EFI_LOADED_IMAGE_PROTOCOL  *LoadedImage;\r
+  EFI_SMM_BASE_PROTOCOL      *SmmBase;\r
+  BOOLEAN                    InSmm;\r
+  EFI_DEVICE_PATH_PROTOCOL   *CompleteFilePath;\r
+  EFI_DEVICE_PATH_PROTOCOL   *ImageDevicePath;\r
+  EFI_HANDLE                 Handle;\r
+\r
+  //\r
+  // Cache a pointer to the Boot Services Table\r
+  //\r
+  mBS = SystemTable->BootServices;\r
+\r
+  //\r
+  // Retrieve the Loaded Image Protocol\r
+  //\r
+  Status = mBS->HandleProtocol (\r
+                  ImageHandle,\r
+                  &gEfiLoadedImageProtocolGuid,\r
+                  (VOID*)&LoadedImage\r
+                  );\r
+  ASSERT_EFI_ERROR (Status);\r
+\r
+  //\r
+  // Retrieve SMM Base Protocol\r
+  //\r
+  Status = mBS->LocateProtocol (\r
+                  &gEfiSmmBaseProtocolGuid,\r
+                  NULL,\r
+                  (VOID **) &SmmBase\r
+                  );\r
+  ASSERT_EFI_ERROR (Status);\r
+\r
+  //\r
+  // Check to see if we are already in SMM\r
+  //\r
+  SmmBase->InSmm (SmmBase, &InSmm);\r
+\r
+  //\r
+  //\r
+  //\r
+  if (!InSmm) {\r
+    //\r
+    // Retrieve the Device Path Protocol from the DeviceHandle tha this driver was loaded from\r
+    //\r
+    Status = mBS->HandleProtocol (\r
+                    LoadedImage->DeviceHandle,\r
+                    &gEfiDevicePathProtocolGuid,\r
+                    (VOID*)&ImageDevicePath\r
+                    );\r
+    ASSERT_EFI_ERROR (Status);\r
+\r
+    //\r
+    // Build the full device path to the currently execuing image\r
+    //\r
+    CompleteFilePath = SmmAppendDevicePath (ImageDevicePath, LoadedImage->FilePath);\r
+\r
+    //\r
+    // Load the image in memory to SMRAM; it will automatically generate the\r
+    // SMI.\r
+    //\r
+    Status = SmmBase->Register (SmmBase, CompleteFilePath, NULL, 0, &Handle, FALSE);\r
+    ASSERT_EFI_ERROR (Status);\r
+    return Status;\r
+  }\r
+\r
+  //\r
+  // Call constructor for all libraries\r
+  //\r
+  ProcessLibraryConstructorList (ImageHandle, SystemTable);\r
+\r
+  //\r
+  // Optionally install the unload handler\r
+  //\r
+  if (_gDriverUnloadImageCount > 0) {\r
+    Status = mBS->HandleProtocol (\r
+                    ImageHandle,\r
+                    &gEfiLoadedImageProtocolGuid,\r
+                    (VOID **)&LoadedImage\r
+                    );\r
+    ASSERT_EFI_ERROR (Status);\r
+    LoadedImage->Unload = _DriverUnloadHandler;\r
+  }\r
+\r
+  //\r
+  // Call the list of driver entry points\r
+  //\r
+  Status = ProcessModuleEntryPointList (ImageHandle, SystemTable);\r
+  if (EFI_ERROR (Status)) {\r
+    ProcessLibraryDestructorList (ImageHandle, SystemTable);\r
+  }\r
+\r
+  return Status;\r
+}\r
+\r
+/**\r
+  Enrty point wrapper of DXE SMM Driver.\r
+\r
+  @param  ImageHandle ImageHandle of the loaded driver.\r
+  @param  SystemTable Pointer to the EFI System Table.\r
+\r
+  @retval  EFI_SUCCESS One or more of the drivers returned a success code.\r
+  @retval  !EFI_SUCESS The return status from the last driver entry point in the list.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+EfiMain (\r
+  IN EFI_HANDLE        ImageHandle,\r
+  IN EFI_SYSTEM_TABLE  *SystemTable\r
+  )\r
+{\r
+  return _ModuleEntryPoint (ImageHandle, SystemTable);\r
+}\r
diff --git a/IntelFrameworkPkg/Library/DxeSmmDriverEntryPoint/DxeSmmDriverEntryPoint.msa b/IntelFrameworkPkg/Library/DxeSmmDriverEntryPoint/DxeSmmDriverEntryPoint.msa
new file mode 100644 (file)
index 0000000..6055797
--- /dev/null
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="UTF-8"?>\r
+<ModuleSurfaceArea xmlns="http://www.TianoCore.org/2006/Edk2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">\r
+  <MsaHeader>\r
+    <ModuleName>DxeSmmDriverEntryPoint</ModuleName>\r
+    <ModuleType>DXE_SMM_DRIVER</ModuleType>\r
+    <GuidValue>79C5C7B7-1083-42a6-AD15-2A4E7C4274D7</GuidValue>\r
+    <Version>1.0</Version>\r
+    <Abstract>SMM driver entry point library</Abstract>\r
+    <Description>Register driver in SMRAM and wrapper driver library constructors and entry point</Description>\r
+    <Copyright>Copyright (c) 2006 - 2007, Intel Corporation.</Copyright>\r
+    <License>All rights reserved. This program and the accompanying materials
+      are licensed and made available under the terms and conditions of the BSD License
+      which accompanies this distribution.  The full text of the license may be found at
+      http://opensource.org/licenses/bsd-license.php
+      THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+      WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.</License>\r
+    <Specification>FRAMEWORK_BUILD_PACKAGING_SPECIFICATION   0x00000052</Specification>\r
+  </MsaHeader>\r
+  <ModuleDefinitions>\r
+    <SupportedArchitectures>IA32 X64</SupportedArchitectures>\r
+    <BinaryModule>false</BinaryModule>\r
+    <OutputFileBasename>DxeSmmDriverEntryPoint</OutputFileBasename>\r
+  </ModuleDefinitions>\r
+  <LibraryClassDefinitions>\r
+    <LibraryClass Usage="ALWAYS_PRODUCED" SupModuleList="DXE_SMM_DRIVER">\r
+      <Keyword>DxeSmmDriverEntryPoint</Keyword>\r
+    </LibraryClass>\r
+    <LibraryClass Usage="ALWAYS_CONSUMED">\r
+      <Keyword>UefiBootServicesTableLib</Keyword>\r
+    </LibraryClass>\r
+    <LibraryClass Usage="ALWAYS_CONSUMED">\r
+      <Keyword>DebugLib</Keyword>\r
+    </LibraryClass>\r
+  </LibraryClassDefinitions>\r
+  <SourceFiles>\r
+    <Filename>DriverEntryPoint.c</Filename>\r
+  </SourceFiles>\r
+  <PackageDependencies>\r
+    <Package PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/>\r
+  </PackageDependencies>\r
+  <Protocols>\r
+    <Protocol Usage="ALWAYS_CONSUMED">\r
+      <ProtocolCName>gEfiDevicePathProtocolGuid</ProtocolCName>\r
+    </Protocol>\r
+    <Protocol Usage="ALWAYS_CONSUMED">\r
+      <ProtocolCName>gEfiSmmBaseProtocolGuid</ProtocolCName>\r
+    </Protocol>\r
+    <Protocol Usage="ALWAYS_CONSUMED">\r
+      <ProtocolCName>gEfiLoadedImageProtocolGuid</ProtocolCName>\r
+    </Protocol>\r
+  </Protocols>\r
+  <Externs>\r
+    <Specification>EFI_SPECIFICATION_VERSION 0x00020000</Specification>\r
+    <Specification>EDK_RELEASE_VERSION 0x00020000</Specification>\r
+  </Externs>\r
+</ModuleSurfaceArea>
\ No newline at end of file
diff --git a/IntelFrameworkPkg/Library/UefiLibFramework/Console.c b/IntelFrameworkPkg/Library/UefiLibFramework/Console.c
new file mode 100644 (file)
index 0000000..6260555
--- /dev/null
@@ -0,0 +1,282 @@
+/** @file\r
+  Mde UEFI library functions.\r
+\r
+  Copyright (c) 2007, Intel Corporation<BR>\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+  Module Name:  Console.c\r
+\r
+**/\r
+\r
+#include "UefiLibFramework.h"\r
+\r
+typedef struct {\r
+  CHAR16  WChar;\r
+  UINT32  Width;\r
+} UNICODE_WIDTH_ENTRY;\r
+\r
+UNICODE_WIDTH_ENTRY mUnicodeWidthTable[] = {\r
+  //\r
+  // General script area\r
+  //\r
+  {(CHAR16)0x1FFF,  1},\r
+  /*\r
+   * Merge the blocks and replace them with the above entry as they fall to\r
+   * the same category and they are all narrow glyph. This will reduce search\r
+   * time and table size. The merge will omit the reserved code.\r
+   *\r
+   * Remove the above item if below is un-commented.\r
+   *\r
+  {(CHAR16)0x007F,  1},       // C0 controls and basic Latin. 0x0000-0x007F\r
+  {(CHAR16)0x00FF,  1},       // C1 controls and Latin-1 support. 0x0080-0x00FF\r
+  {(CHAR16)0x017F,  1},       // Latin extended-A. 0x0100-0x017F\r
+  {(CHAR16)0x024F,  1},       // Latin extended-B. 0x0180-0x024F\r
+  {(CHAR16)0x02AF,  1},       // IPA extensions. 0x0250-0x02AF\r
+  {(CHAR16)0x02FF,  1},       // Spacing modifier letters. 0x02B0-0x02FF\r
+  {(CHAR16)0x036F,  1},       // Combining diacritical marks. 0x0300-0x036F\r
+  {(CHAR16)0x03FF,  1},       // Greek. 0x0370-0x03FF\r
+  {(CHAR16)0x04FF,  1},       // Cyrillic. 0x0400-0x04FF\r
+  {(CHAR16)0x052F,  0},       // Unassigned. As Armenian in ver3.0. 0x0500-0x052F\r
+  {(CHAR16)0x058F,  1},       // Armenian. 0x0530-0x058F\r
+  {(CHAR16)0x05FF,  1},       // Hebrew. 0x0590-0x05FF\r
+  {(CHAR16)0x06FF,  1},       // Arabic. 0x0600-0x06FF\r
+  {(CHAR16)0x08FF,  0},       // Unassigned. 0x0700-0x08FF\r
+  {(CHAR16)0x097F,  1},       // Devanagari. 0x0900-0x097F\r
+  {(CHAR16)0x09FF,  1},       // Bengali. 0x0980-0x09FF\r
+  {(CHAR16)0x0A7F,  1},       // Gurmukhi. 0x0A00-0x0A7F\r
+  {(CHAR16)0x0AFF,  1},       // Gujarati. 0x0A80-0x0AFF\r
+  {(CHAR16)0x0B7F,  1},       // Oriya. 0x0B00-0x0B7F\r
+  {(CHAR16)0x0BFF,  1},       // Tamil. (See page 7-92). 0x0B80-0x0BFF\r
+  {(CHAR16)0x0C7F,  1},       // Telugu. 0x0C00-0x0C7F\r
+  {(CHAR16)0x0CFF,  1},       // Kannada. (See page 7-100). 0x0C80-0x0CFF\r
+  {(CHAR16)0x0D7F,  1},       // Malayalam (See page 7-104). 0x0D00-0x0D7F\r
+  {(CHAR16)0x0DFF,  0},       // Unassigned. 0x0D80-0x0DFF\r
+  {(CHAR16)0x0E7F,  1},       // Thai. 0x0E00-0x0E7F\r
+  {(CHAR16)0x0EFF,  1},       // Lao. 0x0E80-0x0EFF\r
+  {(CHAR16)0x0FBF,  1},       // Tibetan. 0x0F00-0x0FBF\r
+  {(CHAR16)0x109F,  0},       // Unassigned. 0x0FC0-0x109F\r
+  {(CHAR16)0x10FF,  1},       // Georgian. 0x10A0-0x10FF\r
+  {(CHAR16)0x11FF,  1},       // Hangul Jamo. 0x1100-0x11FF\r
+  {(CHAR16)0x1DFF,  0},       // Unassigned. 0x1200-0x1DFF\r
+  {(CHAR16)0x1EFF,  1},       // Latin extended additional. 0x1E00-0x1EFF\r
+  {(CHAR16)0x1FFF,  1},       // Greek extended. 0x1F00-0x1FFF\r
+  *\r
+  */\r
+\r
+  //\r
+  // Symbol area\r
+  //\r
+  {(CHAR16)0x2FFF,  1},\r
+  /*\r
+   * Merge the blocks and replace them with the above entry as they fall to\r
+   * the same category and they are all narrow glyph. This will reduce search\r
+   * time and table size. The merge will omit the reserved code.\r
+   *\r
+   * Remove the above item if below is un-commented.\r
+   *\r
+  {(CHAR16)0x206F,  1},       // General punctuation. (See page7-154). 0x200-0x206F\r
+  {(CHAR16)0x209F,  1},       // Superscripts and subscripts. 0x2070-0x209F\r
+  {(CHAR16)0x20CF,  1},       // Currency symbols. 0x20A0-0x20CF\r
+  {(CHAR16)0x20FF,  1},       // Combining diacritical marks for symbols. 0x20D0-0x20FF\r
+  {(CHAR16)0x214F,  1},       // Letterlike sympbols. 0x2100-0x214F\r
+  {(CHAR16)0x218F,  1},       // Number forms. 0x2150-0x218F\r
+  {(CHAR16)0x21FF,  1},       // Arrows. 0x2190-0x21FF\r
+  {(CHAR16)0x22FF,  1},       // Mathematical operators. 0x2200-0x22FF\r
+  {(CHAR16)0x23FF,  1},       // Miscellaneous technical. 0x2300-0x23FF\r
+  {(CHAR16)0x243F,  1},       // Control pictures. 0x2400-0x243F\r
+  {(CHAR16)0x245F,  1},       // Optical character recognition. 0x2440-0x245F\r
+  {(CHAR16)0x24FF,  1},       // Enclosed alphanumerics. 0x2460-0x24FF\r
+  {(CHAR16)0x257F,  1},       // Box drawing. 0x2500-0x257F\r
+  {(CHAR16)0x259F,  1},       // Block elements. 0x2580-0x259F\r
+  {(CHAR16)0x25FF,  1},       // Geometric shapes. 0x25A0-0x25FF\r
+  {(CHAR16)0x26FF,  1},       // Miscellaneous symbols. 0x2600-0x26FF\r
+  {(CHAR16)0x27BF,  1},       // Dingbats. 0x2700-0x27BF\r
+  {(CHAR16)0x2FFF,  0},       // Reserved. 0x27C0-0x2FFF\r
+  *\r
+  */\r
+\r
+  //\r
+  // CJK phonetics and symbol area\r
+  //\r
+  {(CHAR16)0x33FF,  2},\r
+  /*\r
+   * Merge the blocks and replace them with the above entry as they fall to\r
+   * the same category and they are all wide glyph. This will reduce search\r
+   * time and table size. The merge will omit the reserved code.\r
+   *\r
+   * Remove the above item if below is un-commented.\r
+   *\r
+  {(CHAR16)0x303F,  2},       // CJK symbols and punctuation. 0x3000-0x303F\r
+  {(CHAR16)0x309F,  2},       // Hiragana. 0x3040-0x309F\r
+  {(CHAR16)0x30FF,  2},       // Katakana. 0x30A0-0x30FF\r
+  {(CHAR16)0x312F,  2},       // Bopomofo. 0x3100-0x312F\r
+  {(CHAR16)0x318F,  2},       // Hangul compatibility jamo. 0x3130-0x318F\r
+  {(CHAR16)0x319F,  2},       // Kanbun. 0x3190-0x319F\r
+  {(CHAR16)0x31FF,  0},       // Reserved. As Bopomofo extended in ver3.0. 0x31A0-0x31FF\r
+  {(CHAR16)0x32FF,  2},       // Enclosed CJK letters and months. 0x3200-0x32FF\r
+  {(CHAR16)0x33FF,  2},       // CJK compatibility. 0x3300-0x33FF\r
+  *\r
+  */\r
+\r
+  //\r
+  // CJK ideograph area\r
+  //\r
+  {(CHAR16)0x9FFF,  2},\r
+  /*\r
+   * Merge the blocks and replace them with the above entry as they fall to\r
+   * the same category and they are all wide glyph. This will reduce search\r
+   * time and table size. The merge will omit the reserved code.\r
+   *\r
+   * Remove the above item if below is un-commented.\r
+   *\r
+  {(CHAR16)0x4DFF,  0},       // Reserved. 0x3400-0x4DBF as CJK unified ideographs\r
+                      // extension A in ver3.0. 0x3400-0x4DFF\r
+  {(CHAR16)0x9FFF,  2},       // CJK unified ideographs. 0x4E00-0x9FFF\r
+  *\r
+  */\r
+\r
+  //\r
+  // Reserved\r
+  //\r
+  {(CHAR16)0xABFF,  0},       // Reserved. 0xA000-0xA490 as Yi syllables. 0xA490-0xA4D0\r
+  // as Yi radicals in ver3.0. 0xA000-0xABFF\r
+  //\r
+  // Hangul syllables\r
+  //\r
+  {(CHAR16)0xD7FF,  2},\r
+  /*\r
+   * Merge the blocks and replace them with the above entry as they fall to\r
+   * the same category and they are all wide glyph. This will reduce search\r
+   * time and table size. The merge will omit the reserved code.\r
+   *\r
+   * Remove the above item if below is un-commented.\r
+   *\r
+  {(CHAR16)0xD7A3,  2},       // Hangul syllables. 0xAC00-0xD7A3\r
+  {(CHAR16)0xD7FF,  0},       // Reserved. 0xD7A3-0xD7FF\r
+  *\r
+  */\r
+\r
+  //\r
+  // Surrogates area\r
+  //\r
+  {(CHAR16)0xDFFF,  0},       // Surrogates, not used now. 0xD800-0xDFFF\r
+\r
+  //\r
+  // Private use area\r
+  //\r
+  {(CHAR16)0xF8FF,  0},       // Private use area. 0xE000-0xF8FF\r
+\r
+  //\r
+  // Compatibility area and specials\r
+  //\r
+  {(CHAR16)0xFAFF,  2},       // CJK compatibility ideographs. 0xF900-0xFAFF\r
+  {(CHAR16)0xFB4F,  1},       // Alphabetic presentation forms. 0xFB00-0xFB4F\r
+  {(CHAR16)0xFDFF,  1},       // Arabic presentation forms-A. 0xFB50-0xFDFF\r
+  {(CHAR16)0xFE1F,  0},       // Reserved. As variation selectors in ver3.0. 0xFE00-0xFE1F\r
+  {(CHAR16)0xFE2F,  1},       // Combining half marks. 0xFE20-0xFE2F\r
+  {(CHAR16)0xFE4F,  2},       // CJK compatibility forms. 0xFE30-0xFE4F\r
+  {(CHAR16)0xFE6F,  1},       // Small Form Variants. 0xFE50-0xFE6F\r
+  {(CHAR16)0xFEFF,  1},       // Arabic presentation forms-B. 0xFE70-0xFEFF\r
+  {(CHAR16)0xFFEF,  1},       // Half width and full width forms. 0xFF00-0xFFEF\r
+  {(CHAR16)0xFFFF,  0},       // Speicials. 0xFFF0-0xFFFF\r
+};\r
+\r
+/**\r
+  This function computes and returns the width of the Unicode character\r
+  specified by UnicodeChar.\r
+\r
+  @param  UnicodeChar   A Unicode character.\r
+\r
+  @retval 0             The width if UnicodeChar could not be determined.\r
+  @retval 1             UnicodeChar is a narrow glyph.\r
+  @retval 2             UnicodeChar is a wide glyph.\r
+\r
+**/\r
+UINTN\r
+EFIAPI\r
+GetGlyphWidth (\r
+  IN CHAR16  UnicodeChar\r
+  )\r
+{\r
+  UINTN               Index;\r
+  UINTN               Low;\r
+  UINTN               High;\r
+  UNICODE_WIDTH_ENTRY *Item;\r
+\r
+  Item  = NULL;\r
+  Low   = 0;\r
+  High  = (sizeof (mUnicodeWidthTable)) / (sizeof (UNICODE_WIDTH_ENTRY)) - 1;\r
+  while (Low <= High) {\r
+    Index = (Low + High) >> 1;\r
+    Item  = &(mUnicodeWidthTable[Index]);\r
+    if (Index == 0) {\r
+      if (UnicodeChar <= Item->WChar) {\r
+        break;\r
+      }\r
+\r
+      return 0;\r
+    }\r
+\r
+    if (UnicodeChar > Item->WChar) {\r
+      Low = Index + 1;\r
+    } else if (UnicodeChar <= mUnicodeWidthTable[Index - 1].WChar) {\r
+      High = Index - 1;\r
+    } else {\r
+      //\r
+      // Index - 1 < UnicodeChar <= Index. Found\r
+      //\r
+      break;\r
+    }\r
+  }\r
+\r
+  if (Low <= High) {\r
+    return Item->Width;\r
+  }\r
+\r
+  return 0;\r
+}\r
+\r
+/**\r
+  This function computes and returns the display length of\r
+  the Null-terminated Unicode string specified by String.\r
+  If String is NULL, then 0 is returned.\r
+  If any of the widths of the Unicode characters in String\r
+  can not be determined, then 0 is returned.\r
+\r
+  @param  String      A pointer to a Null-terminated Unicode string.\r
+\r
+  @return The display length of the Null-terminated Unicode string specified by String.\r
+\r
+**/\r
+UINTN\r
+EFIAPI\r
+UnicodeStringDisplayLength (\r
+  IN CONST CHAR16  *String\r
+  )\r
+{\r
+  UINTN      Length;\r
+  UINTN      Width;\r
+\r
+  if (String == NULL) {\r
+    return 0;\r
+  }\r
+\r
+  Length = 0;\r
+  while (*String != 0) {\r
+    Width = GetGlyphWidth (*String);\r
+    if (Width == 0) {\r
+      return 0;\r
+    }\r
+\r
+    Length += Width;\r
+    String++;\r
+  }\r
+\r
+  return Length;\r
+}\r
diff --git a/IntelFrameworkPkg/Library/UefiLibFramework/UefiLib.c b/IntelFrameworkPkg/Library/UefiLibFramework/UefiLib.c
new file mode 100644 (file)
index 0000000..732ac6c
--- /dev/null
@@ -0,0 +1,813 @@
+/** @file\r
+  Mde UEFI library functions.\r
+\r
+  Copyright (c) 2006 - 2007, Intel Corporation<BR>\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+  Module Name:  UefiLib.c\r
+\r
+**/\r
+\r
+#include "UefiLibFramework.h"\r
+\r
+/**\r
+  Compare whether two names of languages are identical.\r
+\r
+  @param  Language1 Name of language 1.\r
+  @param  Language2 Name of language 2.\r
+\r
+  @retval TRUE      Language 1 and language 2 are the same.\r
+  @retval FALSE     Language 1 and language 2 are not the same.\r
+\r
+**/\r
+STATIC\r
+BOOLEAN\r
+CompareIso639LanguageCode (\r
+  IN CONST CHAR8  *Language1,\r
+  IN CONST CHAR8  *Language2\r
+  )\r
+{\r
+  UINT32  Name1;\r
+  UINT32  Name2;\r
+\r
+  Name1 = ReadUnaligned24 ((CONST UINT32 *) Language1);\r
+  Name2 = ReadUnaligned24 ((CONST UINT32 *) Language2);\r
+\r
+  return (BOOLEAN) (Name1 == Name2);\r
+}\r
+\r
+/**\r
+  This function searches the list of configuration tables stored in the EFI System\r
+  Table for a table with a GUID that matches TableGuid.  If a match is found,\r
+  then a pointer to the configuration table is returned in Table, and EFI_SUCCESS\r
+  is returned.  If a matching GUID is not found, then EFI_NOT_FOUND is returned.\r
+\r
+  @param  TableGuid       Pointer to table's GUID type..\r
+  @param  Table           Pointer to the table associated with TableGuid in the EFI System Table.\r
+\r
+  @retval EFI_SUCCESS     A configuration table matching TableGuid was found.\r
+  @retval EFI_NOT_FOUND   A configuration table matching TableGuid could not be found.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+EfiGetSystemConfigurationTable (\r
+  IN  EFI_GUID  *TableGuid,\r
+  OUT VOID      **Table\r
+  )\r
+{\r
+  EFI_SYSTEM_TABLE  *SystemTable;\r
+  UINTN             Index;\r
+\r
+  ASSERT (TableGuid != NULL);\r
+  ASSERT (Table != NULL);\r
+\r
+  SystemTable = gST;\r
+  *Table = NULL;\r
+  for (Index = 0; Index < SystemTable->NumberOfTableEntries; Index++) {\r
+    if (CompareGuid (TableGuid, &(SystemTable->ConfigurationTable[Index].VendorGuid))) {\r
+      *Table = SystemTable->ConfigurationTable[Index].VendorTable;\r
+      return EFI_SUCCESS;\r
+    }\r
+  }\r
+\r
+  return EFI_NOT_FOUND;\r
+}\r
+\r
+/**\r
+  This function causes the notification function to be executed for every protocol\r
+  of type ProtocolGuid instance that exists in the system when this function is\r
+  invoked.  In addition, every time a protocol of type ProtocolGuid instance is\r
+  installed or reinstalled, the notification function is also executed.\r
+\r
+  @param  ProtocolGuid    Supplies GUID of the protocol upon whose installation the event is fired.\r
+  @param  NotifyTpl       Supplies the task priority level of the event notifications.\r
+  @param  NotifyFunction  Supplies the function to notify when the event is signaled.\r
+  @param  NotifyContext   The context parameter to pass to NotifyFunction.\r
+  @param  Registration    A pointer to a memory location to receive the registration value.\r
+\r
+  @return The notification event that was created.\r
+\r
+**/\r
+EFI_EVENT\r
+EFIAPI\r
+EfiCreateProtocolNotifyEvent(\r
+  IN  EFI_GUID          *ProtocolGuid,\r
+  IN  EFI_TPL           NotifyTpl,\r
+  IN  EFI_EVENT_NOTIFY  NotifyFunction,\r
+  IN  VOID              *NotifyContext,  OPTIONAL\r
+  OUT VOID              **Registration\r
+  )\r
+{\r
+  EFI_STATUS  Status;\r
+  EFI_EVENT   Event;\r
+\r
+  //\r
+  // Create the event\r
+  //\r
+\r
+  Status = gBS->CreateEvent (\r
+                  EFI_EVENT_NOTIFY_SIGNAL,\r
+                  NotifyTpl,\r
+                  NotifyFunction,\r
+                  NotifyContext,\r
+                  &Event\r
+                  );\r
+  ASSERT_EFI_ERROR (Status);\r
+\r
+  //\r
+  // Register for protocol notifactions on this event\r
+  //\r
+\r
+  Status = gBS->RegisterProtocolNotify (\r
+                  ProtocolGuid,\r
+                  Event,\r
+                  Registration\r
+                  );\r
+\r
+  ASSERT_EFI_ERROR (Status);\r
+\r
+  //\r
+  // Kick the event so we will perform an initial pass of\r
+  // current installed drivers\r
+  //\r
+\r
+  gBS->SignalEvent (Event);\r
+  return Event;\r
+}\r
+\r
+/**\r
+  This function creates an event using NotifyTpl, NoifyFunction, and NotifyContext.\r
+  This event is signaled with EfiNamedEventSignal().  This provide the ability for\r
+  one or more listeners on the same event named by the GUID specified by Name.\r
+\r
+  @param  Name                  Supplies GUID name of the event.\r
+  @param  NotifyTpl             Supplies the task priority level of the event notifications.\r
+  @param  NotifyFunction        Supplies the function to notify when the event is signaled.\r
+  @param  NotifyContext         The context parameter to pass to NotifyFunction.\r
+  @param  Registration          A pointer to a memory location to receive the registration value.\r
+\r
+  @retval EFI_SUCCESS           A named event was created.\r
+  @retval EFI_OUT_OF_RESOURCES  There are not enough resource to create the named event.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+EfiNamedEventListen (\r
+  IN CONST EFI_GUID    *Name,\r
+  IN EFI_TPL           NotifyTpl,\r
+  IN EFI_EVENT_NOTIFY  NotifyFunction,\r
+  IN CONST VOID        *NotifyContext,  OPTIONAL\r
+  OUT VOID             *Registration OPTIONAL\r
+  )\r
+{\r
+  EFI_STATUS  Status;\r
+  EFI_EVENT   Event;\r
+  VOID        *RegistrationLocal;\r
+\r
+  //\r
+  // Create event\r
+  //\r
+  Status = gBS->CreateEvent (\r
+                  EFI_EVENT_NOTIFY_SIGNAL,\r
+                  NotifyTpl,\r
+                  NotifyFunction,\r
+                  (VOID *) NotifyContext,\r
+                  &Event\r
+                  );\r
+  ASSERT_EFI_ERROR (Status);\r
+\r
+  //\r
+  // The Registration is not optional to RegisterProtocolNotify().\r
+  // To make it optional to EfiNamedEventListen(), may need to substitute with a local.\r
+  //\r
+  if (Registration != NULL) {\r
+    RegistrationLocal = Registration;\r
+  } else {\r
+    RegistrationLocal = &RegistrationLocal;\r
+  }\r
+\r
+  //\r
+  // Register for an installation of protocol interface\r
+  //\r
+\r
+  Status = gBS->RegisterProtocolNotify (\r
+                  (EFI_GUID *) Name,\r
+                  Event,\r
+                  RegistrationLocal\r
+                  );\r
+  ASSERT_EFI_ERROR (Status);\r
+\r
+  return EFI_SUCCESS;\r
+}\r
+\r
+/**\r
+  This function signals the named event specified by Name.  The named event must\r
+  have been created with EfiNamedEventListen().\r
+\r
+  @param  Name                  Supplies GUID name of the event.\r
+\r
+  @retval EFI_SUCCESS           A named event was signaled.\r
+  @retval EFI_OUT_OF_RESOURCES  There are not enough resource to signal the named event.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+EfiNamedEventSignal (\r
+  IN CONST EFI_GUID  *Name\r
+  )\r
+{\r
+  EFI_STATUS  Status;\r
+  EFI_HANDLE  Handle;\r
+\r
+  Handle = NULL;\r
+  Status = gBS->InstallProtocolInterface (\r
+                  &Handle,\r
+                  (EFI_GUID *) Name,\r
+                  EFI_NATIVE_INTERFACE,\r
+                  NULL\r
+                  );\r
+  ASSERT_EFI_ERROR (Status);\r
+\r
+  Status = gBS->UninstallProtocolInterface (\r
+                  Handle,\r
+                  (EFI_GUID *) Name,\r
+                  NULL\r
+                  );\r
+  ASSERT_EFI_ERROR (Status);\r
+\r
+  return EFI_SUCCESS;\r
+}\r
+\r
+/**\r
+  Returns the current TPL.\r
+\r
+  This function returns the current TPL.  There is no EFI service to directly\r
+  retrieve the current TPL. Instead, the RaiseTPL() function is used to raise\r
+  the TPL to TPL_HIGH_LEVEL.  This will return the current TPL.  The TPL level\r
+  can then immediately be restored back to the current TPL level with a call\r
+  to RestoreTPL().\r
+\r
+  @param  VOID\r
+\r
+  @retvale EFI_TPL              The current TPL.\r
+\r
+**/\r
+EFI_TPL\r
+EFIAPI\r
+EfiGetCurrentTpl (\r
+  VOID\r
+  )\r
+{\r
+  EFI_TPL Tpl;\r
+\r
+  Tpl = gBS->RaiseTPL (EFI_TPL_HIGH_LEVEL);\r
+  gBS->RestoreTPL (Tpl);\r
+\r
+  return Tpl;\r
+}\r
+\r
+\r
+/**\r
+  This function initializes a basic mutual exclusion lock to the released state\r
+  and returns the lock.  Each lock provides mutual exclusion access at its task\r
+  priority level.  Since there is no preemption or multiprocessor support in EFI,\r
+  acquiring the lock only consists of raising to the locks TPL.\r
+\r
+  @param  Lock       A pointer to the lock data structure to initialize.\r
+  @param  Priority   EFI TPL associated with the lock.\r
+\r
+  @return The lock.\r
+\r
+**/\r
+EFI_LOCK *\r
+EFIAPI\r
+EfiInitializeLock (\r
+  IN OUT EFI_LOCK  *Lock,\r
+  IN EFI_TPL        Priority\r
+  )\r
+{\r
+  ASSERT (Lock != NULL);\r
+  ASSERT (Priority <= EFI_TPL_HIGH_LEVEL);\r
+\r
+  Lock->Tpl       = Priority;\r
+  Lock->OwnerTpl  = EFI_TPL_APPLICATION;\r
+  Lock->Lock      = EfiLockReleased ;\r
+  return Lock;\r
+}\r
+\r
+/**\r
+  This function raises the system's current task priority level to the task\r
+  priority level of the mutual exclusion lock.  Then, it places the lock in the\r
+  acquired state.\r
+\r
+  @param  Priority  The task priority level of the lock.\r
+\r
+**/\r
+VOID\r
+EFIAPI\r
+EfiAcquireLock (\r
+  IN EFI_LOCK  *Lock\r
+  )\r
+{\r
+  ASSERT (Lock != NULL);\r
+  ASSERT (Lock->Lock == EfiLockReleased);\r
+\r
+  Lock->OwnerTpl = gBS->RaiseTPL (Lock->Tpl);\r
+  Lock->Lock     = EfiLockAcquired;\r
+}\r
+\r
+/**\r
+  This function raises the system's current task priority level to the task\r
+  priority level of the mutual exclusion lock.  Then, it attempts to place the\r
+  lock in the acquired state.\r
+\r
+  @param  Lock              A pointer to the lock to acquire.\r
+\r
+  @retval EFI_SUCCESS       The lock was acquired.\r
+  @retval EFI_ACCESS_DENIED The lock could not be acquired because it is already owned.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+EfiAcquireLockOrFail (\r
+  IN EFI_LOCK  *Lock\r
+  )\r
+{\r
+\r
+  ASSERT (Lock != NULL);\r
+  ASSERT (Lock->Lock != EfiLockUninitialized);\r
+\r
+  if (Lock->Lock == EfiLockAcquired) {\r
+    //\r
+    // Lock is already owned, so bail out\r
+    //\r
+    return EFI_ACCESS_DENIED;\r
+  }\r
+\r
+  Lock->OwnerTpl = gBS->RaiseTPL (Lock->Tpl);\r
+\r
+  Lock->Lock = EfiLockAcquired;\r
+\r
+  return EFI_SUCCESS;\r
+}\r
+\r
+/**\r
+  This function transitions a mutual exclusion lock from the acquired state to\r
+  the released state, and restores the system's task priority level to its\r
+  previous level.\r
+\r
+  @param  Lock  A pointer to the lock to release.\r
+\r
+**/\r
+VOID\r
+EFIAPI\r
+EfiReleaseLock (\r
+  IN EFI_LOCK  *Lock\r
+  )\r
+{\r
+  EFI_TPL Tpl;\r
+\r
+  ASSERT (Lock != NULL);\r
+  ASSERT (Lock->Lock == EfiLockAcquired);\r
+\r
+  Tpl = Lock->OwnerTpl;\r
+\r
+  Lock->Lock = EfiLockReleased;\r
+\r
+  gBS->RestoreTPL (Tpl);\r
+}\r
+\r
+/**
+  Tests whether a controller handle is being managed by a specific driver.
+
+  This function tests whether the driver specified by DriverBindingHandle is\r
+  currently managing the controller specified by ControllerHandle.  This test\r
+  is performed by evaluating if the the protocol specified by ProtocolGuid is\r
+  present on ControllerHandle and is was opened by DriverBindingHandle with an\r
+  attribute of EFI_OPEN_PROTOCOL_BY_DRIVER.\r
+  If ProtocolGuid is NULL, then ASSERT().\r
+
+  @param  ControllerHandle     A handle for a controller to test.
+  @param  DriverBindingHandle  Specifies the driver binding handle for the
+                               driver.
+  @param  ProtocolGuid         Specifies the protocol that the driver specified
+                               by DriverBindingHandle opens in its Start()
+                               function.
+
+  @retval EFI_SUCCESS          ControllerHandle is managed by the driver
+                               specifed by DriverBindingHandle.
+  @retval EFI_UNSUPPORTED      ControllerHandle is not managed by the driver
+                               specifed by DriverBindingHandle.
+
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+EfiTestManagedDevice (\r
+  IN CONST EFI_HANDLE       ControllerHandle,\r
+  IN CONST EFI_HANDLE       DriverBindingHandle,\r
+  IN CONST EFI_GUID         *ProtocolGuid\r
+  )\r
+{\r
+  EFI_STATUS     Status;\r
+  VOID           *ManagedInterface;\r
+\r
+  ASSERT (ProtocolGuid != NULL);\r
+\r
+  Status = gBS->OpenProtocol (\r
+                  ControllerHandle,\r
+                  (EFI_GUID *) ProtocolGuid,\r
+                  &ManagedInterface,\r
+                  DriverBindingHandle,\r
+                  ControllerHandle,\r
+                  EFI_OPEN_PROTOCOL_BY_DRIVER\r
+                  );\r
+  if (!EFI_ERROR (Status)) {\r
+    gBS->CloseProtocol (\r
+           ControllerHandle,\r
+           (EFI_GUID *) ProtocolGuid,\r
+           DriverBindingHandle,\r
+           ControllerHandle\r
+           );\r
+    return EFI_UNSUPPORTED;\r
+  }\r
+\r
+  if (Status != EFI_ALREADY_STARTED) {\r
+    return EFI_UNSUPPORTED;\r
+  }\r
+\r
+  return EFI_SUCCESS;\r
+}\r
+\r
+/**
+  Tests whether a child handle is a child device of the controller.
+
+  This function tests whether ChildHandle is one of the children of\r
+  ControllerHandle.  This test is performed by checking to see if the protocol\r
+  specified by ProtocolGuid is present on ControllerHandle and opened by\r
+  ChildHandle with an attribute of EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER.\r
+  If ProtocolGuid is NULL, then ASSERT().\r
+
+  @param  ControllerHandle     A handle for a (parent) controller to test.\r
+  @param  ChildHandle          A child handle to test.
+  @param  ConsumsedGuid        Supplies the protocol that the child controller
+                               opens on its parent controller.\r
+
+  @retval EFI_SUCCESS          ChildHandle is a child of the ControllerHandle.
+  @retval EFI_UNSUPPORTED      ChildHandle is not a child of the
+                               ControllerHandle.
+
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+EfiTestChildHandle (\r
+  IN CONST EFI_HANDLE       ControllerHandle,\r
+  IN CONST EFI_HANDLE       ChildHandle,\r
+  IN CONST EFI_GUID         *ProtocolGuid\r
+  )\r
+{\r
+  EFI_STATUS                            Status;\r
+  EFI_OPEN_PROTOCOL_INFORMATION_ENTRY   *OpenInfoBuffer;\r
+  UINTN                                 EntryCount;\r
+  UINTN                                 Index;\r
+\r
+  ASSERT (ProtocolGuid != NULL);\r
+\r
+  //\r
+  // Retrieve the list of agents that are consuming the specific protocol\r
+  // on ControllerHandle.\r
+  //\r
+  Status = gBS->OpenProtocolInformation (\r
+                  ControllerHandle,\r
+                  (EFI_GUID *) ProtocolGuid,\r
+                  &OpenInfoBuffer,\r
+                  &EntryCount\r
+                  );\r
+  if (EFI_ERROR (Status)) {\r
+    return EFI_UNSUPPORTED;\r
+  }\r
+\r
+  //\r
+  // Inspect if ChildHandle is one of the agents.\r
+  //\r
+  Status = EFI_UNSUPPORTED;\r
+  for (Index = 0; Index < EntryCount; Index++) {\r
+    if ((OpenInfoBuffer[Index].ControllerHandle == ChildHandle) &&\r
+        (OpenInfoBuffer[Index].Attributes & EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER) != 0) {\r
+      Status = EFI_SUCCESS;\r
+      break;\r
+    }\r
+  }\r
+\r
+  FreePool (OpenInfoBuffer);\r
+  return Status;\r
+}\r
+\r
+/**\r
+  This function looks up a Unicode string in UnicodeStringTable.  If Language is\r
+  a member of SupportedLanguages and a Unicode string is found in UnicodeStringTable\r
+  that matches the language code specified by Language, then it is returned in\r
+  UnicodeString.\r
+\r
+  @param  Language                A pointer to the ISO 639-2 language code for the\r
+                                  Unicode string to look up and return.\r
+  @param  SupportedLanguages      A pointer to the set of ISO 639-2 language codes\r
+                                  that the Unicode string table supports.  Language\r
+                                  must be a member of this set.\r
+  @param  UnicodeStringTable      A pointer to the table of Unicode strings.\r
+  @param  UnicodeString           A pointer to the Unicode string from UnicodeStringTable\r
+                                  that matches the language specified by Language.\r
+\r
+  @retval  EFI_SUCCESS            The Unicode string that matches the language\r
+                                  specified by Language was found\r
+                                  in the table of Unicoide strings UnicodeStringTable,\r
+                                  and it was returned in UnicodeString.\r
+  @retval  EFI_INVALID_PARAMETER  Language is NULL.\r
+  @retval  EFI_INVALID_PARAMETER  UnicodeString is NULL.\r
+  @retval  EFI_UNSUPPORTED        SupportedLanguages is NULL.\r
+  @retval  EFI_UNSUPPORTED        UnicodeStringTable is NULL.\r
+  @retval  EFI_UNSUPPORTED        The language specified by Language is not a\r
+                                  member of SupportedLanguages.\r
+  @retval  EFI_UNSUPPORTED        The language specified by Language is not\r
+                                  supported by UnicodeStringTable.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+LookupUnicodeString (\r
+  IN CONST CHAR8                     *Language,\r
+  IN CONST CHAR8                     *SupportedLanguages,\r
+  IN CONST EFI_UNICODE_STRING_TABLE  *UnicodeStringTable,\r
+  OUT CHAR16                         **UnicodeString\r
+  )\r
+{\r
+  //\r
+  // Make sure the parameters are valid\r
+  //\r
+  if (Language == NULL || UnicodeString == NULL) {\r
+    return EFI_INVALID_PARAMETER;\r
+  }\r
+\r
+  //\r
+  // If there are no supported languages, or the Unicode String Table is empty, then the\r
+  // Unicode String specified by Language is not supported by this Unicode String Table\r
+  //\r
+  if (SupportedLanguages == NULL || UnicodeStringTable == NULL) {\r
+    return EFI_UNSUPPORTED;\r
+  }\r
+\r
+  //\r
+  // Make sure Language is in the set of Supported Languages\r
+  //\r
+  while (*SupportedLanguages != 0) {\r
+    if (CompareIso639LanguageCode (Language, SupportedLanguages)) {\r
+\r
+      //\r
+      // Search the Unicode String Table for the matching Language specifier\r
+      //\r
+      while (UnicodeStringTable->Language != NULL) {\r
+        if (CompareIso639LanguageCode (Language, UnicodeStringTable->Language)) {\r
+\r
+          //\r
+          // A matching string was found, so return it\r
+          //\r
+          *UnicodeString = UnicodeStringTable->UnicodeString;\r
+          return EFI_SUCCESS;\r
+        }\r
+\r
+        UnicodeStringTable++;\r
+      }\r
+\r
+      return EFI_UNSUPPORTED;\r
+    }\r
+\r
+    SupportedLanguages += 3;\r
+  }\r
+\r
+  return EFI_UNSUPPORTED;\r
+}\r
+\r
+/**\r
+  This function adds a Unicode string to UnicodeStringTable.\r
+  If Language is a member of SupportedLanguages then UnicodeString is added to\r
+  UnicodeStringTable.  New buffers are allocated for both Language and\r
+  UnicodeString.  The contents of Language and UnicodeString are copied into\r
+  these new buffers.  These buffers are automatically freed when\r
+  FreeUnicodeStringTable() is called.\r
+\r
+  @param  Language                A pointer to the ISO 639-2 language code for the Unicode\r
+                                  string to add.\r
+  @param  SupportedLanguages      A pointer to the set of ISO 639-2 language codes\r
+                                  that the Unicode string table supports.\r
+                                  Language must be a member of this set.\r
+  @param  UnicodeStringTable      A pointer to the table of Unicode strings.\r
+  @param  UnicodeString           A pointer to the Unicode string to add.\r
+\r
+  @retval EFI_SUCCESS             The Unicode string that matches the language\r
+                                  specified by Language was found in the table of\r
+                                  Unicode strings UnicodeStringTable, and it was\r
+                                  returned in UnicodeString.\r
+  @retval EFI_INVALID_PARAMETER   Language is NULL.\r
+  @retval EFI_INVALID_PARAMETER   UnicodeString is NULL.\r
+  @retval EFI_INVALID_PARAMETER   UnicodeString is an empty string.\r
+  @retval EFI_UNSUPPORTED         SupportedLanguages is NULL.\r
+  @retval EFI_ALREADY_STARTED     A Unicode string with language Language is\r
+                                  already present in UnicodeStringTable.\r
+  @retval EFI_OUT_OF_RESOURCES    There is not enough memory to add another\r
+                                  Unicode string to UnicodeStringTable.\r
+  @retval EFI_UNSUPPORTED         The language specified by Language is not a\r
+                                  member of SupportedLanguages.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+AddUnicodeString (\r
+  IN CONST CHAR8               *Language,\r
+  IN CONST CHAR8               *SupportedLanguages,\r
+  IN EFI_UNICODE_STRING_TABLE  **UnicodeStringTable,\r
+  IN CONST CHAR16              *UnicodeString\r
+  )\r
+{\r
+  UINTN                     NumberOfEntries;\r
+  EFI_UNICODE_STRING_TABLE  *OldUnicodeStringTable;\r
+  EFI_UNICODE_STRING_TABLE  *NewUnicodeStringTable;\r
+  UINTN                     UnicodeStringLength;\r
+\r
+  //\r
+  // Make sure the parameter are valid\r
+  //\r
+  if (Language == NULL || UnicodeString == NULL || UnicodeStringTable == NULL) {\r
+    return EFI_INVALID_PARAMETER;\r
+  }\r
+\r
+  //\r
+  // If there are no supported languages, then a Unicode String can not be added\r
+  //\r
+  if (SupportedLanguages == NULL) {\r
+    return EFI_UNSUPPORTED;\r
+  }\r
+\r
+  //\r
+  // If the Unicode String is empty, then a Unicode String can not be added\r
+  //\r
+  if (UnicodeString[0] == 0) {\r
+    return EFI_INVALID_PARAMETER;\r
+  }\r
+\r
+  //\r
+  // Make sure Language is a member of SupportedLanguages\r
+  //\r
+  while (*SupportedLanguages != 0) {\r
+    if (CompareIso639LanguageCode (Language, SupportedLanguages)) {\r
+\r
+      //\r
+      // Determine the size of the Unicode String Table by looking for a NULL Language entry\r
+      //\r
+      NumberOfEntries = 0;\r
+      if (*UnicodeStringTable != NULL) {\r
+        OldUnicodeStringTable = *UnicodeStringTable;\r
+        while (OldUnicodeStringTable->Language != NULL) {\r
+          if (CompareIso639LanguageCode (Language, OldUnicodeStringTable->Language)) {\r
+            return EFI_ALREADY_STARTED;\r
+          }\r
+\r
+          OldUnicodeStringTable++;\r
+          NumberOfEntries++;\r
+        }\r
+      }\r
+\r
+      //\r
+      // Allocate space for a new Unicode String Table.  It must hold the current number of\r
+      // entries, plus 1 entry for the new Unicode String, plus 1 entry for the end of table\r
+      // marker\r
+      //\r
+      NewUnicodeStringTable = AllocatePool ((NumberOfEntries + 2) * sizeof (EFI_UNICODE_STRING_TABLE));\r
+      if (NewUnicodeStringTable == NULL) {\r
+        return EFI_OUT_OF_RESOURCES;\r
+      }\r
+\r
+      //\r
+      // If the current Unicode String Table contains any entries, then copy them to the\r
+      // newly allocated Unicode String Table.\r
+      //\r
+      if (*UnicodeStringTable != NULL) {\r
+        CopyMem (\r
+           NewUnicodeStringTable,\r
+           *UnicodeStringTable,\r
+           NumberOfEntries * sizeof (EFI_UNICODE_STRING_TABLE)\r
+           );\r
+      }\r
+\r
+      //\r
+      // Allocate space for a copy of the Language specifier\r
+      //\r
+      NewUnicodeStringTable[NumberOfEntries].Language = AllocateCopyPool (3, Language);\r
+      if (NewUnicodeStringTable[NumberOfEntries].Language == NULL) {\r
+        gBS->FreePool (NewUnicodeStringTable);\r
+        return EFI_OUT_OF_RESOURCES;\r
+      }\r
+\r
+      //\r
+      // Compute the length of the Unicode String\r
+      //\r
+      for (UnicodeStringLength = 0; UnicodeString[UnicodeStringLength] != 0; UnicodeStringLength++)\r
+        ;\r
+\r
+      //\r
+      // Allocate space for a copy of the Unicode String\r
+      //\r
+      NewUnicodeStringTable[NumberOfEntries].UnicodeString = AllocateCopyPool (\r
+                                                              (UnicodeStringLength + 1) * sizeof (CHAR16),\r
+                                                              UnicodeString\r
+                                                              );\r
+      if (NewUnicodeStringTable[NumberOfEntries].UnicodeString == NULL) {\r
+        gBS->FreePool (NewUnicodeStringTable[NumberOfEntries].Language);\r
+        gBS->FreePool (NewUnicodeStringTable);\r
+        return EFI_OUT_OF_RESOURCES;\r
+      }\r
+\r
+      //\r
+      // Mark the end of the Unicode String Table\r
+      //\r
+      NewUnicodeStringTable[NumberOfEntries + 1].Language       = NULL;\r
+      NewUnicodeStringTable[NumberOfEntries + 1].UnicodeString  = NULL;\r
+\r
+      //\r
+      // Free the old Unicode String Table\r
+      //\r
+      if (*UnicodeStringTable != NULL) {\r
+        gBS->FreePool (*UnicodeStringTable);\r
+      }\r
+\r
+      //\r
+      // Point UnicodeStringTable at the newly allocated Unicode String Table\r
+      //\r
+      *UnicodeStringTable = NewUnicodeStringTable;\r
+\r
+      return EFI_SUCCESS;\r
+    }\r
+\r
+    SupportedLanguages += 3;\r
+  }\r
+\r
+  return EFI_UNSUPPORTED;\r
+}\r
+\r
+/**\r
+  This function frees the table of Unicode strings in UnicodeStringTable.\r
+  If UnicodeStringTable is NULL, then EFI_SUCCESS is returned.\r
+  Otherwise, each language code, and each Unicode string in the Unicode string\r
+  table are freed, and EFI_SUCCESS is returned.\r
+\r
+  @param  UnicodeStringTable  A pointer to the table of Unicode strings.\r
+\r
+  @retval EFI_SUCCESS         The Unicode string table was freed.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+FreeUnicodeStringTable (\r
+  IN EFI_UNICODE_STRING_TABLE  *UnicodeStringTable\r
+  )\r
+{\r
+  UINTN Index;\r
+\r
+  //\r
+  // If the Unicode String Table is NULL, then it is already freed\r
+  //\r
+  if (UnicodeStringTable == NULL) {\r
+    return EFI_SUCCESS;\r
+  }\r
+\r
+  //\r
+  // Loop through the Unicode String Table until we reach the end of table marker\r
+  //\r
+  for (Index = 0; UnicodeStringTable[Index].Language != NULL; Index++) {\r
+\r
+    //\r
+    // Free the Language string from the Unicode String Table\r
+    //\r
+    gBS->FreePool (UnicodeStringTable[Index].Language);\r
+\r
+    //\r
+    // Free the Unicode String from the Unicode String Table\r
+    //\r
+    if (UnicodeStringTable[Index].UnicodeString != NULL) {\r
+      gBS->FreePool (UnicodeStringTable[Index].UnicodeString);\r
+    }\r
+  }\r
+\r
+  //\r
+  // Free the Unicode String Table itself\r
+  //\r
+  gBS->FreePool (UnicodeStringTable);\r
+\r
+  return EFI_SUCCESS;\r
+}\r
+\r
diff --git a/IntelFrameworkPkg/Library/UefiLibFramework/UefiLib.msa b/IntelFrameworkPkg/Library/UefiLibFramework/UefiLib.msa
new file mode 100644 (file)
index 0000000..19b5703
--- /dev/null
@@ -0,0 +1,84 @@
+<?xml version="1.0" encoding="UTF-8"?>\r
+<ModuleSurfaceArea xmlns="http://www.TianoCore.org/2006/Edk2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">\r
+  <MsaHeader>\r
+    <ModuleName>UefiLib</ModuleName>\r
+    <ModuleType>DXE_DRIVER</ModuleType>\r
+    <GuidValue>3a004ba5-efe0-4a61-9f1a-267a46ae5ba9</GuidValue>\r
+    <Version>1.0</Version>\r
+    <Abstract>Component description file for the entry point to a EFIDXE Drivers</Abstract>\r
+    <Description>Library to abstract Framework extensions that conflict with UEFI 2.0 Specification
+
+ Help Port Framework/Tinao code that has conflicts with UEFI 2.0 by hiding the oldconflicts with library functions and supporting implementations of the old 
+ (EDK/EFI 1.10) and new (EDK II/UEFI 2.0) way. This module is a DXE driver as  it contains DXE enum extensions for EFI event services.</Description>\r
+    <Copyright>Copyright (c) 2006, Intel Corporation.</Copyright>\r
+    <License>All rights reserved. This program and the accompanying materials
+      are licensed and made available under the terms and conditions of the BSD License
+      which accompanies this distribution.  The full text of the license may be found at
+      http://opensource.org/licenses/bsd-license.php
+      THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+      WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.</License>\r
+    <Specification>FRAMEWORK_BUILD_PACKAGING_SPECIFICATION   0x00000052</Specification>\r
+  </MsaHeader>\r
+  <ModuleDefinitions>\r
+    <SupportedArchitectures>IA32 X64 IPF EBC</SupportedArchitectures>\r
+    <BinaryModule>false</BinaryModule>\r
+    <OutputFileBasename>UefiLib</OutputFileBasename>\r
+  </ModuleDefinitions>\r
+  <LibraryClassDefinitions>\r
+    <LibraryClass Usage="ALWAYS_PRODUCED" SupModuleList="DXE_CORE DXE_DRIVER DXE_RUNTIME_DRIVER DXE_SAL_DRIVER DXE_SMM_DRIVER UEFI_APPLICATION UEFI_DRIVER">\r
+      <Keyword>UefiLib</Keyword>\r
+    </LibraryClass>\r
+    <LibraryClass Usage="ALWAYS_CONSUMED">\r
+      <Keyword>UefiBootServicesTableLib</Keyword>\r
+    </LibraryClass>\r
+    <LibraryClass Usage="ALWAYS_CONSUMED">\r
+      <Keyword>BaseLib</Keyword>\r
+    </LibraryClass>\r
+    <LibraryClass Usage="ALWAYS_CONSUMED">\r
+      <Keyword>BaseMemoryLib</Keyword>\r
+    </LibraryClass>\r
+    <LibraryClass Usage="ALWAYS_CONSUMED">\r
+      <Keyword>DebugLib</Keyword>\r
+    </LibraryClass>\r
+    <LibraryClass Usage="ALWAYS_CONSUMED">\r
+      <Keyword>MemoryAllocationLib</Keyword>\r
+    </LibraryClass>\r
+    <LibraryClass Usage="ALWAYS_CONSUMED">\r
+      <Keyword>PcdLib</Keyword>\r
+    </LibraryClass>\r
+    <LibraryClass Usage="ALWAYS_CONSUMED">\r
+      <Keyword>PrintLib</Keyword>\r
+    </LibraryClass>\r
+  </LibraryClassDefinitions>\r
+  <SourceFiles>\r
+    <Filename>UefiLib.c</Filename>\r
+    <Filename>Console.c</Filename>\r
+    <Filename>UefiNotTiano.c</Filename>\r
+    <Filename>UefiLibPrint.c</Filename>\r
+  </SourceFiles>\r
+  <PackageDependencies>\r
+    <Package PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/>\r
+  </PackageDependencies>\r
+  <Guids>\r
+    <GuidCNames Usage="ALWAYS_CONSUMED">\r
+      <GuidCName>gEfiEventLegacyBootGuid</GuidCName>\r
+    </GuidCNames>\r
+    <GuidCNames Usage="ALWAYS_CONSUMED">\r
+      <GuidCName>gEfiEventReadyToBootGuid</GuidCName>\r
+    </GuidCNames>\r
+    <GuidCNames Usage="ALWAYS_CONSUMED">\r
+      <GuidCName>gEfiFrameworkDevicePathGuid</GuidCName>\r
+    </GuidCNames>\r
+  </Guids>\r
+  <Externs>\r
+    <Specification>EFI_SPECIFICATION_VERSION 0x00020000</Specification>\r
+    <Specification>EDK_RELEASE_VERSION 0x00020000</Specification>\r
+  </Externs>\r
+  <PcdCoded>\r
+    <PcdEntry PcdItemType="FIXED_AT_BUILD" Usage="ALWAYS_CONSUMED">\r
+      <C_Name>PcdUefiLibMaxPrintBufferSize</C_Name>\r
+      <TokenSpaceGuidCName>gEfiMdePkgTokenSpaceGuid</TokenSpaceGuidCName>\r
+      <HelpText>This PCD is used by UefiLib APIs, which are Print, ErrorPrint, AsciiPrint, AsciiErrorPrint. If the length of the formatted Unicode or ASCII string is greater than PcdUefiLibMaxPrintBufferSize, then only the first (PcdUefiLibMaxPrintBufferSize / Sizeof(CHAR16)) Unicode characters or PcdUefiLibMaxPrintBufferSize Ascii characters are sent to the respective console.</HelpText>\r
+    </PcdEntry>\r
+  </PcdCoded>\r
+</ModuleSurfaceArea>
\ No newline at end of file
diff --git a/IntelFrameworkPkg/Library/UefiLibFramework/UefiLibFramework.h b/IntelFrameworkPkg/Library/UefiLibFramework/UefiLibFramework.h
new file mode 100644 (file)
index 0000000..4bdc4b1
--- /dev/null
@@ -0,0 +1,31 @@
+/** @file\r
+  Header file to include header files common to all source files in\r
+  UefiLibFramework.\r
+\r
+  Copyright (c) 2007, Intel Corporation<BR>\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+  Module Name:  UefiLibFramework.h\r
+\r
+**/\r
+\r
+#ifndef _UEFI_LIB_FRAMEWORK_H_\r
+#define _UEFI_LIB_FRAMEWORK_H_\r
+\r
+#include <FrameworkDxe.h>\r
+#include <Library/UefiBootServicesTableLib.h>\r
+#include <Library/BaseLib.h>\r
+#include <Library/BaseMemoryLib.h>\r
+#include <Library/DebugLib.h>\r
+#include <Library/MemoryAllocationLib.h>\r
+#include <Library/PcdLib.h>\r
+#include <Library/PrintLib.h>\r
+#include <Library/UefiLib.h>\r
+\r
+#endif\r
diff --git a/IntelFrameworkPkg/Library/UefiLibFramework/UefiLibPrint.c b/IntelFrameworkPkg/Library/UefiLibFramework/UefiLibPrint.c
new file mode 100644 (file)
index 0000000..7b539be
--- /dev/null
@@ -0,0 +1,261 @@
+/** @file\r
+  Mde UEFI library API implemention.\r
+  Print to StdErr or ConOut defined in EFI_SYSTEM_TABLE\r
+\r
+  Copyright (c) 2007, Intel Corporation<BR>\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#include "UefiLibFramework.h"\r
+\r
+/**\r
+  Internal function which prints a formatted Unicode string to the console output device\r
+  specified by Console\r
+\r
+  This function prints a formatted Unicode string to the console output device\r
+  specified by Console and returns the number of Unicode characters that printed\r
+  to it.  If the length of the formatted Unicode string is greater than PcdUefiLibMaxPrintBufferSize,\r
+  then only the first PcdUefiLibMaxPrintBufferSize characters are sent to Console.\r
+\r
+  @param Format   Null-terminated Unicode format string.\r
+  @param Console  The output console.\r
+  @param Marker   VA_LIST marker for the variable argument list.\r
+\r
+  If Format is NULL, then ASSERT().\r
+  If Format is not aligned on a 16-bit boundary, then ASSERT().\r
+\r
+**/\r
+\r
+STATIC\r
+UINTN\r
+InternalPrint (\r
+  IN  CONST CHAR16                  *Format,\r
+  IN  EFI_SIMPLE_TEXT_OUT_PROTOCOL  *Console,\r
+  IN  VA_LIST                       Marker\r
+  )\r
+{\r
+  UINTN   Return;\r
+  CHAR16  *Buffer;\r
+  UINTN   BufferSize;\r
+\r
+  ASSERT (Format != NULL);\r
+  ASSERT (((UINTN) Format & 0x01) == 0);\r
+\r
+  BufferSize = (PcdGet32 (PcdUefiLibMaxPrintBufferSize) + 1) * sizeof (CHAR16);\r
+\r
+  Buffer = (CHAR16 *) AllocatePool(BufferSize);\r
+  ASSERT (Buffer != NULL);\r
+\r
+  Return = UnicodeVSPrint (Buffer, BufferSize, Format, Marker);\r
+\r
+  if (Console != NULL) {\r
+    //\r
+    // To be extra safe make sure Console has been initialized\r
+    //\r
+    Console->OutputString (Console, Buffer);\r
+  }\r
+\r
+  FreePool (Buffer);\r
+\r
+  return Return;\r
+}\r
+\r
+/**\r
+  Prints a formatted Unicode string to the console output device specified by\r
+  ConOut defined in the EFI_SYSTEM_TABLE.\r
+\r
+  This function prints a formatted Unicode string to the console output device\r
+  specified by ConOut in EFI_SYSTEM_TABLE and returns the number of Unicode\r
+  characters that printed to ConOut.  If the length of the formatted Unicode\r
+  string is greater than PcdUefiLibMaxPrintBufferSize, then only the first\r
+  PcdUefiLibMaxPrintBufferSize characters are sent to ConOut.\r
+\r
+  @param Format   Null-terminated Unicode format string.\r
+  @param ...      VARARG list consumed to process Format.\r
+  If Format is NULL, then ASSERT().\r
+  If Format is not aligned on a 16-bit boundary, then ASSERT().\r
+\r
+**/\r
+UINTN\r
+EFIAPI\r
+Print (\r
+  IN CONST CHAR16  *Format,\r
+  ...\r
+  )\r
+{\r
+  VA_LIST Marker;\r
+  UINTN   Return;\r
+\r
+  VA_START (Marker, Format);\r
+\r
+  Return = InternalPrint (Format, gST->ConOut, Marker);\r
+\r
+  VA_END (Marker);\r
+\r
+  return Return;\r
+}\r
+\r
+/**\r
+  Prints a formatted Unicode string to the console output device specified by\r
+  StdErr defined in the EFI_SYSTEM_TABLE.\r
+\r
+  This function prints a formatted Unicode string to the console output device\r
+  specified by StdErr in EFI_SYSTEM_TABLE and returns the number of Unicode\r
+  characters that printed to StdErr.  If the length of the formatted Unicode\r
+  string is greater than PcdUefiLibMaxPrintBufferSize, then only the first\r
+  PcdUefiLibMaxPrintBufferSize characters are sent to StdErr.\r
+\r
+  @param Format   Null-terminated Unicode format string.\r
+  @param ...      VARARG list consumed to process Format.\r
+  If Format is NULL, then ASSERT().\r
+  If Format is not aligned on a 16-bit boundary, then ASSERT().\r
+\r
+**/\r
+\r
+UINTN\r
+EFIAPI\r
+ErrorPrint (\r
+  IN CONST CHAR16  *Format,\r
+  ...\r
+  )\r
+{\r
+  VA_LIST Marker;\r
+  UINTN   Return;\r
+\r
+  VA_START (Marker, Format);\r
+\r
+  Return = InternalPrint( Format, gST->StdErr, Marker);\r
+\r
+  VA_END (Marker);\r
+\r
+  return Return;\r
+}\r
+\r
+\r
+/**\r
+  Internal function which prints a formatted ASCII string to the console output device\r
+  specified by Console\r
+\r
+  This function prints a formatted ASCII string to the console output device\r
+  specified by Console and returns the number of ASCII characters that printed\r
+  to it.  If the length of the formatted ASCII string is greater than PcdUefiLibMaxPrintBufferSize,\r
+  then only the first PcdUefiLibMaxPrintBufferSize characters are sent to Console.\r
+\r
+  @param Format   Null-terminated ASCII format string.\r
+  @param Console  The output console.\r
+  @param Marker   VA_LIST marker for the variable argument list.\r
+\r
+  If Format is NULL, then ASSERT().\r
+\r
+**/\r
+\r
+STATIC\r
+UINTN\r
+AsciiInternalPrint (\r
+  IN  CONST CHAR8                   *Format,\r
+  IN  EFI_SIMPLE_TEXT_OUT_PROTOCOL  *Console,\r
+  IN  VA_LIST                       Marker\r
+  )\r
+{\r
+  UINTN   Return;\r
+  CHAR16  *Buffer;\r
+  UINTN   BufferSize;\r
+\r
+  ASSERT (Format != NULL);\r
+\r
+  BufferSize = (PcdGet32 (PcdUefiLibMaxPrintBufferSize) + 1) * sizeof (CHAR16);\r
+\r
+  Buffer = (CHAR16 *) AllocatePool(BufferSize);\r
+  ASSERT (Buffer != NULL);\r
+\r
+  Return = UnicodeVSPrintAsciiFormat (Buffer, BufferSize, Format, Marker);\r
+\r
+  if (Console != NULL) {\r
+    //\r
+    // To be extra safe make sure Console has been initialized\r
+    //\r
+    Console->OutputString (Console, Buffer);\r
+  }\r
+\r
+  FreePool (Buffer);\r
+\r
+  return Return;\r
+}\r
+\r
+/**\r
+  Prints a formatted ASCII string to the console output device specified by\r
+  ConOut defined in the EFI_SYSTEM_TABLE.\r
+\r
+  This function prints a formatted ASCII string to the console output device\r
+  specified by ConOut in EFI_SYSTEM_TABLE and returns the number of ASCII\r
+  characters that printed to ConOut.  If the length of the formatted ASCII\r
+  string is greater than PcdUefiLibMaxPrintBufferSize, then only the first\r
+  PcdUefiLibMaxPrintBufferSize characters are sent to ConOut.\r
+\r
+  @param Format   Null-terminated ASCII format string.\r
+  @param ...      VARARG list consumed to process Format.\r
+  If Format is NULL, then ASSERT().\r
+  If Format is not aligned on a 16-bit boundary, then ASSERT().\r
+\r
+**/\r
+UINTN\r
+EFIAPI\r
+AsciiPrint (\r
+  IN CONST CHAR8  *Format,\r
+  ...\r
+  )\r
+{\r
+  VA_LIST Marker;\r
+  UINTN   Return;\r
+\r
+  VA_START (Marker, Format);\r
+\r
+  Return = AsciiInternalPrint( Format, gST->ConOut, Marker);\r
+\r
+  VA_END (Marker);\r
+\r
+  return Return;\r
+}\r
+\r
+/**\r
+  Prints a formatted ASCII string to the console output device specified by\r
+  StdErr defined in the EFI_SYSTEM_TABLE.\r
+\r
+  This function prints a formatted ASCII string to the console output device\r
+  specified by StdErr in EFI_SYSTEM_TABLE and returns the number of ASCII\r
+  characters that printed to StdErr.  If the length of the formatted ASCII\r
+  string is greater than PcdUefiLibMaxPrintBufferSize, then only the first\r
+  PcdUefiLibMaxPrintBufferSize characters are sent to StdErr.\r
+\r
+  @param Format   Null-terminated ASCII format string.\r
+  @param ...      VARARG list consumed to process Format.\r
+  If Format is NULL, then ASSERT().\r
+  If Format is not aligned on a 16-bit boundary, then ASSERT().\r
+\r
+**/\r
+UINTN\r
+EFIAPI\r
+AsciiErrorPrint (\r
+  IN CONST CHAR8  *Format,\r
+  ...\r
+  )\r
+{\r
+  VA_LIST Marker;\r
+  UINTN   Return;\r
+\r
+  VA_START (Marker, Format);\r
+\r
+  Return = AsciiInternalPrint( Format, gST->StdErr, Marker);\r
+\r
+  VA_END (Marker);\r
+\r
+  return Return;\r
+}\r
+\r
diff --git a/IntelFrameworkPkg/Library/UefiLibFramework/UefiNotTiano.c b/IntelFrameworkPkg/Library/UefiLibFramework/UefiNotTiano.c
new file mode 100644 (file)
index 0000000..3553993
--- /dev/null
@@ -0,0 +1,353 @@
+/** @file\r
+  Library functions that abstract areas of conflict between Tiano an UEFI 2.1.\r
+\r
+  Help Port Framework/Tinao code that has conflicts with UEFI 2.1 by hiding the\r
+  oldconflicts with library functions and supporting implementations of the old\r
+  (EDK/EFI 1.10) and new (EDK II/UEFI 2.1) way. This module is a DXE driver as\r
+  it contains DXE enum extensions for EFI event services.\r
+\r
+Copyright (c) 2007, Intel Corporation<BR>\r
+All rights reserved. This program and the accompanying materials\r
+are licensed and made available under the terms and conditions of the BSD License\r
+which accompanies this distribution.  The full text of the license may be found at\r
+http://opensource.org/licenses/bsd-license.php\r
+\r
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#include "UefiLibFramework.h"\r
+\r
+/**\r
+  An empty function to pass error checking of CreateEventEx ().\r
+\r
+  This empty function ensures that EFI_EVENT_NOTIFY_SIGNAL_ALL is error\r
+  checked correctly since it is now mapped into CreateEventEx() in UEFI 2.0.\r
+\r
+**/\r
+STATIC\r
+VOID\r
+EFIAPI\r
+InternalEmptyFuntion (\r
+  IN EFI_EVENT                Event,\r
+  IN VOID                     *Context\r
+  )\r
+{\r
+  return;\r
+}\r
+\r
+/**\r
+  Create a Legacy Boot Event.\r
+\r
+  Tiano extended the CreateEvent Type enum to add a legacy boot event type.\r
+  This was bad as Tiano did not own the enum. In UEFI 2.0 CreateEventEx was\r
+  added and now it's possible to not voilate the UEFI specification by\r
+  declaring a GUID for the legacy boot event class. This library supports\r
+  the EDK/EFI 1.10 form and EDK II/UEFI 2.0 form and allows common code to\r
+  work both ways.\r
+\r
+  @param  LegacyBootEvent   Returns the EFI event returned from gBS->CreateEvent(Ex).\r
+\r
+  @retval EFI_SUCCESS       Event was created.\r
+  @retval Other             Event was not created.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+EfiCreateEventLegacyBoot (\r
+  OUT EFI_EVENT  *LegacyBootEvent\r
+  )\r
+{\r
+  return EfiCreateEventLegacyBootEx (\r
+           EFI_TPL_CALLBACK,\r
+           InternalEmptyFuntion,\r
+           NULL,\r
+           LegacyBootEvent\r
+           );\r
+}\r
+\r
+/**\r
+  Create an EFI event in the Legacy Boot Event Group and allows\r
+  the caller to specify a notification function.\r
+\r
+  This function abstracts the creation of the Legacy Boot Event.\r
+  The Framework moved from a proprietary to UEFI 2.0 based mechanism.\r
+  This library abstracts the caller from how this event is created to prevent\r
+  to code form having to change with the version of the specification supported.\r
+  If LegacyBootEvent is NULL, then ASSERT().\r
+\r
+  @param  NotifyTpl         The task priority level of the event.\r
+  @param  NotifyFunction    The notification function to call when the event is signaled.\r
+  @param  NotifyContext     The content to pass to NotifyFunction when the event is signaled.\r
+  @param  LegacyBootEvent   Returns the EFI event returned from gBS->CreateEvent(Ex).\r
+\r
+  @retval EFI_SUCCESS       Event was created.\r
+  @retval Other             Event was not created.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+EfiCreateEventLegacyBootEx (\r
+  IN  EFI_TPL           NotifyTpl,\r
+  IN  EFI_EVENT_NOTIFY  NotifyFunction,  OPTIONAL\r
+  IN  VOID              *NotifyContext,  OPTIONAL\r
+  OUT EFI_EVENT         *LegacyBootEvent\r
+  )\r
+{\r
+  EFI_STATUS    Status;\r
+\r
+  ASSERT (LegacyBootEvent != NULL);\r
+\r
+  if (gST->Hdr.Revision < 0x00020000) {\r
+    //\r
+    // prior to UEFI 2.0 use Tiano extension to EFI\r
+    //\r
+    Status = gBS->CreateEvent (\r
+                    EFI_EVENT_SIGNAL_LEGACY_BOOT | EFI_EVENT_NOTIFY_SIGNAL_ALL,\r
+                    NotifyTpl,\r
+                    NotifyFunction,\r
+                    NotifyContext,\r
+                    LegacyBootEvent\r
+                    );\r
+  } else {\r
+    //\r
+    // For UEFI 2.0 and the future use an Event Group\r
+    //\r
+    Status = gBS->CreateEventEx (\r
+                    EVENT_NOTIFY_SIGNAL,\r
+                    NotifyTpl,\r
+                    NotifyFunction,\r
+                    NotifyContext,\r
+                    &gEfiEventLegacyBootGuid,\r
+                    LegacyBootEvent\r
+                    );\r
+  }\r
+\r
+  return Status;\r
+}\r
+\r
+/**\r
+  Create a Read to Boot Event.\r
+\r
+  Tiano extended the CreateEvent Type enum to add a ready to boot event type.\r
+  This was bad as Tiano did not own the enum. In UEFI 2.0 CreateEventEx was\r
+  added and now it's possible to not voilate the UEFI specification and use\r
+  the ready to boot event class defined in UEFI 2.0. This library supports\r
+  the EDK/EFI 1.10 form and EDK II/UEFI 2.0 form and allows common code to\r
+  work both ways.\r
+\r
+  @param  LegacyBootEvent   Returns the EFI event returned from gBS->CreateEvent(Ex).\r
+\r
+  @retval EFI_SUCCESS       Event was created.\r
+  @retval Other             Event was not created.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+EfiCreateEventReadyToBoot (\r
+  OUT EFI_EVENT  *ReadyToBootEvent\r
+  )\r
+{\r
+  return EfiCreateEventReadyToBootEx (\r
+           EFI_TPL_CALLBACK,\r
+           InternalEmptyFuntion,\r
+           NULL,\r
+           ReadyToBootEvent\r
+           );\r
+}\r
+\r
+/**\r
+  Create an EFI event in the Ready To Boot Event Group and allows\r
+  the caller to specify a notification function.\r
+\r
+  This function abstracts the creation of the Ready to Boot Event.\r
+  The Framework moved from a proprietary to UEFI 2.0 based mechanism.\r
+  This library abstracts the caller from how this event is created to prevent\r
+  to code form having to change with the version of the specification supported.\r
+  If ReadyToBootEvent is NULL, then ASSERT().\r
+\r
+  @param  NotifyTpl         The task priority level of the event.\r
+  @param  NotifyFunction    The notification function to call when the event is signaled.\r
+  @param  NotifyContext     The content to pass to NotifyFunction when the event is signaled.\r
+  @param  LegacyBootEvent   Returns the EFI event returned from gBS->CreateEvent(Ex).\r
+\r
+  @retval EFI_SUCCESS       Event was created.\r
+  @retval Other             Event was not created.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+EfiCreateEventReadyToBootEx (\r
+  IN  EFI_TPL           NotifyTpl,\r
+  IN  EFI_EVENT_NOTIFY  NotifyFunction,  OPTIONAL\r
+  IN  VOID              *NotifyContext,  OPTIONAL\r
+  OUT EFI_EVENT         *ReadyToBootEvent\r
+  )\r
+{\r
+  EFI_STATUS    Status;\r
+\r
+  ASSERT (ReadyToBootEvent != NULL);\r
+\r
+  if (gST->Hdr.Revision < 0x00020000) {\r
+    //\r
+    // prior to UEFI 2.0 use Tiano extension to EFI\r
+    //\r
+    Status = gBS->CreateEvent (\r
+                    EFI_EVENT_SIGNAL_READY_TO_BOOT | EFI_EVENT_NOTIFY_SIGNAL_ALL,\r
+                    NotifyTpl,\r
+                    NotifyFunction,\r
+                    NotifyContext,\r
+                    ReadyToBootEvent\r
+                    );\r
+  } else {\r
+    //\r
+    // For UEFI 2.0 and the future use an Event Group\r
+    //\r
+    Status = gBS->CreateEventEx (\r
+                    EVENT_NOTIFY_SIGNAL,\r
+                    NotifyTpl,\r
+                    NotifyFunction,\r
+                    NotifyContext,\r
+                    &gEfiEventReadyToBootGuid,\r
+                    ReadyToBootEvent\r
+                    );\r
+  }\r
+\r
+  return Status;\r
+}\r
+\r
+\r
+/**\r
+  Signal a Ready to Boot Event.\r
+\r
+  Create a Ready to Boot Event. Signal it and close it. This causes other\r
+  events of the same event group to be signaled in other modules.\r
+\r
+**/\r
+VOID\r
+EFIAPI\r
+EfiSignalEventReadyToBoot (\r
+  VOID\r
+  )\r
+{\r
+  EFI_STATUS    Status;\r
+  EFI_EVENT     ReadyToBootEvent;\r
+\r
+  Status = EfiCreateEventReadyToBoot (&ReadyToBootEvent);\r
+  if (!EFI_ERROR (Status)) {\r
+    gBS->SignalEvent (ReadyToBootEvent);\r
+    gBS->CloseEvent (ReadyToBootEvent);\r
+  }\r
+}\r
+\r
+/**\r
+  Signal a Legacy Boot Event.\r
+\r
+  Create a legacy Boot Event. Signal it and close it. This causes other\r
+  events of the same event group to be signaled in other modules.\r
+\r
+**/\r
+VOID\r
+EFIAPI\r
+EfiSignalEventLegacyBoot (\r
+  VOID\r
+  )\r
+{\r
+  EFI_STATUS    Status;\r
+  EFI_EVENT     LegacyBootEvent;\r
+\r
+  Status = EfiCreateEventLegacyBoot (&LegacyBootEvent);\r
+  if (!EFI_ERROR (Status)) {\r
+    gBS->SignalEvent (LegacyBootEvent);\r
+    gBS->CloseEvent (LegacyBootEvent);\r
+  }\r
+}\r
+\r
+\r
+/**\r
+  Check to see if the Firmware Volume (FV) Media Device Path is valid\r
+\r
+  Tiano extended the EFI 1.10 device path nodes. Tiano does not own this enum\r
+  so as we move to UEFI 2.0 support we must use a mechanism that conforms with\r
+  the UEFI 2.0 specification to define the FV device path. An UEFI GUIDed\r
+  device path is defined for Tiano extensions of device path. If the code\r
+  is compiled to conform with the UEFI 2.0 specification use the new device path\r
+  else use the old form for backwards compatability. The return value to this\r
+  function points to a location in FvDevicePathNode and it does not allocate\r
+  new memory for the GUID pointer that is returned.\r
+\r
+  @param  FvDevicePathNode  Pointer to FV device path to check.\r
+\r
+  @retval NULL              FvDevicePathNode is not valid.\r
+  @retval Other             FvDevicePathNode is valid and pointer to NameGuid was returned.\r
+\r
+**/\r
+EFI_GUID *\r
+EFIAPI\r
+EfiGetNameGuidFromFwVolDevicePathNode (\r
+  IN CONST MEDIA_FW_VOL_FILEPATH_DEVICE_PATH  *FvDevicePathNode\r
+  )\r
+{\r
+  ASSERT (FvDevicePathNode != NULL);\r
+\r
+  //\r
+  // Use the new Device path that does not conflict with the UEFI\r
+  //\r
+  if (FvDevicePathNode->Tiano.Header.Type == MEDIA_DEVICE_PATH ||\r
+      FvDevicePathNode->Tiano.Header.SubType == MEDIA_VENDOR_DP) {\r
+    if (CompareGuid (&gEfiFrameworkDevicePathGuid, &FvDevicePathNode->Tiano.TianoSpecificDevicePath)) {\r
+      if (FvDevicePathNode->Tiano.Type == TIANO_MEDIA_FW_VOL_FILEPATH_DEVICE_PATH_TYPE) {\r
+        return (EFI_GUID *) &FvDevicePathNode->NameGuid;\r
+      }\r
+    }\r
+  }\r
+\r
+  return NULL;\r
+}\r
+\r
+\r
+/**\r
+  Initialize a Firmware Volume (FV) Media Device Path node.\r
+\r
+  Tiano extended the EFI 1.10 device path nodes. Tiano does not own this enum\r
+  so as we move to UEFI 2.0 support we must use a mechanism that conforms with\r
+  the UEFI 2.0 specification to define the FV device path. An UEFI GUIDed\r
+  device path is defined for Tiano extensions of device path. If the code\r
+  is compiled to conform with the UEFI 2.0 specification use the new device path\r
+  else use the old form for backwards compatability.\r
+\r
+  @param  FvDevicePathNode  Pointer to a FV device path node to initialize\r
+  @param  NameGuid          FV file name to use in FvDevicePathNode\r
+\r
+**/\r
+VOID\r
+EFIAPI\r
+EfiInitializeFwVolDevicepathNode (\r
+  IN OUT MEDIA_FW_VOL_FILEPATH_DEVICE_PATH  *FvDevicePathNode,\r
+  IN CONST EFI_GUID                         *NameGuid\r
+  )\r
+{\r
+  ASSERT (FvDevicePathNode  != NULL);\r
+  ASSERT (NameGuid          != NULL);\r
+\r
+  //\r
+  // Use the new Device path that does not conflict with the UEFI\r
+  //\r
+  FvDevicePathNode->Tiano.Header.Type     = MEDIA_DEVICE_PATH;\r
+  FvDevicePathNode->Tiano.Header.SubType  = MEDIA_VENDOR_DP;\r
+  SetDevicePathNodeLength (&FvDevicePathNode->Tiano.Header, sizeof (MEDIA_FW_VOL_FILEPATH_DEVICE_PATH));\r
+\r
+  //\r
+  // Add the GUID for generic Tiano device paths\r
+  //\r
+  CopyGuid (&FvDevicePathNode->Tiano.TianoSpecificDevicePath, &gEfiFrameworkDevicePathGuid);\r
+\r
+  //\r
+  // Add in the FW Vol File Path Tiano defined information\r
+  //\r
+  FvDevicePathNode->Tiano.Type = TIANO_MEDIA_FW_VOL_FILEPATH_DEVICE_PATH_TYPE;\r
+\r
+  CopyGuid (&FvDevicePathNode->NameGuid, NameGuid);\r
+}\r
+\r