summaryrefslogtreecommitdiff
path: root/Include
diff options
context:
space:
mode:
authorraywu <raywu0301@gmail.com>2018-06-15 00:00:50 +0800
committerraywu <raywu0301@gmail.com>2018-06-15 00:00:50 +0800
commitb7c51c9cf4864df6aabb99a1ae843becd577237c (patch)
treeeebe9b0d0ca03062955223097e57da84dd618b9a /Include
downloadzprj-b7c51c9cf4864df6aabb99a1ae843becd577237c.tar.xz
init. 1AQQW051HEADmaster
Diffstat (limited to 'Include')
-rw-r--r--Include/ACPI.H230
-rw-r--r--Include/ACPI11.H334
-rw-r--r--Include/ACPI20.H576
-rw-r--r--Include/ACPI30.H156
-rw-r--r--Include/ACPI50.h208
-rw-r--r--Include/AMICSPLib.h97
-rw-r--r--Include/AMIVfr.h682
-rw-r--r--Include/AcpiRes.h831
-rw-r--r--Include/Aint13Protocol.cif8
-rw-r--r--Include/AmiBoardInfoIncludes.cif8
-rw-r--r--Include/AmiBufferValidationLib.h149
-rw-r--r--Include/AmiBufferValidationLibInclude.cif8
-rw-r--r--Include/AmiCertificate.h270
-rw-r--r--Include/AmiDebugPort.h141
-rw-r--r--Include/AmiDxeLib.h1018
-rw-r--r--Include/AmiHobs.h356
-rw-r--r--Include/AmiLib.h1097
-rw-r--r--Include/AmiLoadCsmPolicy.h94
-rw-r--r--Include/AmiPeiLib.h270
-rw-r--r--Include/AmiSmm.h97
-rw-r--r--Include/AmiStatusCodes.h365
-rw-r--r--Include/AmiUSBProtocols.cif15
-rw-r--r--Include/AmiUsbLibInclude.cif8
-rw-r--r--Include/AmiUsbSmmGlobalDataValidationLib.h47
-rw-r--r--Include/BaseCryptLib.h417
-rw-r--r--Include/BootOptions.h356
-rw-r--r--Include/BootScriptCommon.h206
-rw-r--r--Include/CPU Hobs.cif8
-rw-r--r--Include/CSPLibInc.CIF9
-rw-r--r--Include/CacheSubClass.h192
-rw-r--r--Include/Capsule.h152
-rw-r--r--Include/CmosAccess.h661
-rw-r--r--Include/CmosAccess32.inc799
-rw-r--r--Include/CmosAccessSec.inc159
-rw-r--r--Include/CmosManagerInterfaces.cif10
-rw-r--r--Include/CpuHobs.h171
-rw-r--r--Include/CryptLib.h611
-rw-r--r--Include/CryptoAPIIncludes.cif10
-rw-r--r--Include/CryptoLibInc.cif9
-rw-r--r--Include/CsmProtocols.cif13
-rw-r--r--Include/DXE.h266
-rw-r--r--Include/DataHubSubClass.h94
-rw-r--r--Include/EFI.h1234
-rw-r--r--Include/EdkIICommon.h291
-rw-r--r--Include/EdkIIHii.h247
-rw-r--r--Include/EdkII_headers.cif9
-rw-r--r--Include/FFS.h563
-rw-r--r--Include/FastBoot.h409
-rw-r--r--Include/FastBootIncludes.cif8
-rw-r--r--Include/Flash.h109
-rw-r--r--Include/FlashPart.cif8
-rw-r--r--Include/FlashPart.h290
-rw-r--r--Include/FlashUpd.h221
-rw-r--r--Include/FlashUpdInc.cif8
-rw-r--r--Include/GenericSio.h433
-rw-r--r--Include/HIIDB.h225
-rw-r--r--Include/HOB.h530
-rw-r--r--Include/HardwareChangeProtocols.cif8
-rw-r--r--Include/ImageAuthentication.h184
-rw-r--r--Include/Include.cif55
-rw-r--r--Include/Include.sdl0
-rw-r--r--Include/KeyboardCommonDefinitions.h175
-rw-r--r--Include/Languages.unibin0 -> 6240 bytes
-rw-r--r--Include/PCI.h620
-rw-r--r--Include/PCIE.h632
-rw-r--r--Include/PCIE21.h486
-rw-r--r--Include/PCIE30.h138
-rw-r--r--Include/PCIX.h157
-rw-r--r--Include/PEI.h792
-rw-r--r--Include/PPI/AmiEarlyBistPpi.h88
-rw-r--r--Include/PPI/AmiKeyCodePpi.h117
-rw-r--r--Include/PPI/AmiTcgPlatformPpi.cif8
-rw-r--r--Include/PPI/AmiTcgPlatformPpi.h105
-rw-r--r--Include/PPI/AtaController.h85
-rw-r--r--Include/PPI/BaseMemoryTest.h82
-rw-r--r--Include/PPI/BootScriptExecuter.h88
-rw-r--r--Include/PPI/CPUPolicy.h91
-rw-r--r--Include/PPI/Capsule.h100
-rw-r--r--Include/PPI/CpuIo.h92
-rw-r--r--Include/PPI/CpuPPIs.cif9
-rw-r--r--Include/PPI/CryptoPPI.h162
-rw-r--r--Include/PPI/CspLibPPI.CIF9
-rw-r--r--Include/PPI/CspLibPPI.h223
-rw-r--r--Include/PPI/Decompress.h85
-rw-r--r--Include/PPI/DeviceRecoveryBlockIo.h121
-rw-r--r--Include/PPI/DeviceRecoveryModule.h97
-rw-r--r--Include/PPI/FirmwareVolumeInfo.h76
-rw-r--r--Include/PPI/FwVersion.h156
-rw-r--r--Include/PPI/LoadFile.h136
-rw-r--r--Include/PPI/LoadedImagePpi.h83
-rw-r--r--Include/PPI/NBPPI.CIF9
-rw-r--r--Include/PPI/NBPPI.h395
-rw-r--r--Include/PPI/OHCIPPI.cif8
-rw-r--r--Include/PPI/OhciPPI.h67
-rw-r--r--Include/PPI/PPI.cif30
-rw-r--r--Include/PPI/PciCfg.h111
-rw-r--r--Include/PPI/PciCfg2.h76
-rw-r--r--Include/PPI/PeiGetUCtrl.h96
-rw-r--r--Include/PPI/ProgressCode.h90
-rw-r--r--Include/PPI/ReadOnlyVariable.h122
-rw-r--r--Include/PPI/ReadOnlyVariable2.h101
-rw-r--r--Include/PPI/RecoveryModule.h76
-rw-r--r--Include/PPI/RecoveryPpi.cif11
-rw-r--r--Include/PPI/ReportStatusCodeHandler.h97
-rw-r--r--Include/PPI/Reset.h87
-rw-r--r--Include/PPI/S3Resume.h79
-rw-r--r--Include/PPI/S3Resume2.h78
-rw-r--r--Include/PPI/SBPPI.h142
-rw-r--r--Include/PPI/SerialDevice.h110
-rw-r--r--Include/PPI/SmBus.h167
-rw-r--r--Include/PPI/SmBus2.h137
-rw-r--r--Include/PPI/SmmControl.h92
-rw-r--r--Include/PPI/Stall.h91
-rw-r--r--Include/PPI/TemporaryRamSupport.h89
-rw-r--r--Include/PPI/UhciPPI.CIF8
-rw-r--r--Include/PPI/UsbHCPpi.cif8
-rw-r--r--Include/PPI/UsbHostController.h236
-rw-r--r--Include/PPI/UsbIo.h165
-rw-r--r--Include/PPI/UsbIoPpi.cif8
-rw-r--r--Include/PPI/sbPPI.CIF8
-rw-r--r--Include/PciBus.h1251
-rw-r--r--Include/PciBusEx.h158
-rw-r--r--Include/PciBusIncludes.cif11
-rw-r--r--Include/PciHostBridge.h454
-rw-r--r--Include/ProcessorSubClass.h354
-rw-r--r--Include/Protocol/AMIPostMgr.h510
-rw-r--r--Include/Protocol/AbsPointerProtocol.h129
-rw-r--r--Include/Protocol/AcousticProtocol.cif8
-rw-r--r--Include/Protocol/AcousticProtocol.h101
-rw-r--r--Include/Protocol/AcpiSupport.h124
-rw-r--r--Include/Protocol/AcpiSystemDescriptionTable.h209
-rw-r--r--Include/Protocol/AcpiTable.h88
-rw-r--r--Include/Protocol/AhciSmmProtocol.h183
-rw-r--r--Include/Protocol/AhciSmmProtocols.CIF8
-rw-r--r--Include/Protocol/AmiBoardInfo.h362
-rw-r--r--Include/Protocol/AmiCpuInfo.h154
-rw-r--r--Include/Protocol/AmiCpuInfo2.h236
-rw-r--r--Include/Protocol/AmiDigitalSignature.h316
-rw-r--r--Include/Protocol/AmiInternalSmmComm.h84
-rw-r--r--Include/Protocol/AmiKeycode.h152
-rw-r--r--Include/Protocol/AmiNvmeController.h369
-rw-r--r--Include/Protocol/AmiNvmeLegacy.h86
-rw-r--r--Include/Protocol/AmiNvmePassThru.h88
-rw-r--r--Include/Protocol/AmiNvmeProtocol.cif11
-rw-r--r--Include/Protocol/AmiReflashProtocol.h102
-rw-r--r--Include/Protocol/AmiSetupProtocol.cif8
-rw-r--r--Include/Protocol/AmiSetupProtocol.h115
-rw-r--r--Include/Protocol/AmiSio.h131
-rw-r--r--Include/Protocol/AmiSmmInfo.h90
-rw-r--r--Include/Protocol/AmiTcgPlatformProtocol.cif8
-rw-r--r--Include/Protocol/AmiTcgPlatformProtocol.h92
-rw-r--r--Include/Protocol/AmiTpmClearOnRollbackProtocol.cif8
-rw-r--r--Include/Protocol/AmiTpmClearOnRollbackProtocol.h79
-rw-r--r--Include/Protocol/AmiUsbCCID.h185
-rw-r--r--Include/Protocol/AmiUsbController.h1572
-rw-r--r--Include/Protocol/ArchProtocol.cif21
-rw-r--r--Include/Protocol/AtaPassThru.h208
-rw-r--r--Include/Protocol/AuthenticationInfo.h93
-rw-r--r--Include/Protocol/BDS.h88
-rw-r--r--Include/Protocol/BlockIo.h212
-rw-r--r--Include/Protocol/BootScriptSave.h193
-rw-r--r--Include/Protocol/BusSpecificDriverOverride.h88
-rw-r--r--Include/Protocol/CPU.h174
-rw-r--r--Include/Protocol/Capsule.h66
-rw-r--r--Include/Protocol/ComponentName.h117
-rw-r--r--Include/Protocol/ComponentName2.h94
-rw-r--r--Include/Protocol/ConsoleControl.h120
-rw-r--r--Include/Protocol/CpuIo.h87
-rw-r--r--Include/Protocol/CpuIo2.h124
-rw-r--r--Include/Protocol/CpuProtocols.cif10
-rw-r--r--Include/Protocol/CsmPlatform.h161
-rw-r--r--Include/Protocol/CsmVideoPolicy.h84
-rw-r--r--Include/Protocol/CspLibProtocols.CIF8
-rw-r--r--Include/Protocol/CspLibProtocols.h75
-rw-r--r--Include/Protocol/DataHub.h144
-rw-r--r--Include/Protocol/DebugSupport.h495
-rw-r--r--Include/Protocol/Decompress.h95
-rw-r--r--Include/Protocol/DeferredImageLoad.h85
-rw-r--r--Include/Protocol/DeviceIo.h169
-rw-r--r--Include/Protocol/DevicePath.h570
-rw-r--r--Include/Protocol/DevicePathFromText.h91
-rw-r--r--Include/Protocol/DevicePathToText.h98
-rw-r--r--Include/Protocol/DevicePathUtilities.h113
-rw-r--r--Include/Protocol/DiskIo.h160
-rw-r--r--Include/Protocol/DriverBinding.h111
-rw-r--r--Include/Protocol/DriverDiagnostics2.h99
-rw-r--r--Include/Protocol/DriverFamilyOverride.h82
-rw-r--r--Include/Protocol/DriverHealth.h120
-rw-r--r--Include/Protocol/DxeSmmReadyToLock.h72
-rw-r--r--Include/Protocol/EBC.h106
-rw-r--r--Include/Protocol/EdidActive.h70
-rw-r--r--Include/Protocol/EdidDiscovered.h70
-rw-r--r--Include/Protocol/EdidOverride.h84
-rw-r--r--Include/Protocol/EfiOemBadging.h101
-rw-r--r--Include/Protocol/Emul6064KbdInput.h93
-rw-r--r--Include/Protocol/Emul6064MsInput.h83
-rw-r--r--Include/Protocol/Emul6064Trap.h115
-rw-r--r--Include/Protocol/ExtHii.h171
-rw-r--r--Include/Protocol/FastBootProtocol.cif8
-rw-r--r--Include/Protocol/FastBootProtocol.h248
-rw-r--r--Include/Protocol/FirmwareManagement.h189
-rw-r--r--Include/Protocol/FirmwareVolume.h234
-rw-r--r--Include/Protocol/FirmwareVolume2.h260
-rw-r--r--Include/Protocol/FirmwareVolumeBlock.h192
-rw-r--r--Include/Protocol/FlashProtocol.h93
-rw-r--r--Include/Protocol/FormBrowser2.h106
-rw-r--r--Include/Protocol/FormCallBack.h108
-rw-r--r--Include/Protocol/GraphicsOutput.h151
-rw-r--r--Include/Protocol/GuidedSectionExtraction.h103
-rw-r--r--Include/Protocol/HII.h1009
-rw-r--r--Include/Protocol/HardwareChangeProtocol.h362
-rw-r--r--Include/Protocol/Hash.h137
-rw-r--r--Include/Protocol/HiiConfigAccess.h114
-rw-r--r--Include/Protocol/HiiConfigRouting.h137
-rw-r--r--Include/Protocol/HiiDatabase.h189
-rw-r--r--Include/Protocol/HiiFont.h202
-rw-r--r--Include/Protocol/HiiPackageList.h67
-rw-r--r--Include/Protocol/HiiString.h141
-rw-r--r--Include/Protocol/HiiUtilities.h155
-rw-r--r--Include/Protocol/HotKeys.h108
-rw-r--r--Include/Protocol/IdeBusBoard.h138
-rw-r--r--Include/Protocol/IdeBusBoardProtocol.cif8
-rw-r--r--Include/Protocol/IdeControllerInit.h358
-rw-r--r--Include/Protocol/IncompatiblePciDeviceSupport.h86
-rw-r--r--Include/Protocol/IntelSaGopDriver.h190
-rw-r--r--Include/Protocol/IntelSaGopDriverProtocol.cif8
-rw-r--r--Include/Protocol/Legacy8259.h174
-rw-r--r--Include/Protocol/LegacyAhci.h110
-rw-r--r--Include/Protocol/LegacyBios.h1041
-rw-r--r--Include/Protocol/LegacyBiosExt.h440
-rw-r--r--Include/Protocol/LegacyBiosPlatform.h560
-rw-r--r--Include/Protocol/LegacyInterrupt.h119
-rw-r--r--Include/Protocol/LegacyRegion.h129
-rw-r--r--Include/Protocol/LegacyRegion2.h148
-rw-r--r--Include/Protocol/LegacyRegionProtocols.cif10
-rw-r--r--Include/Protocol/LegacySredir.h361
-rw-r--r--Include/Protocol/LegacySredirProtocol.cif8
-rw-r--r--Include/Protocol/LoadFile.h90
-rw-r--r--Include/Protocol/LoadFile2.h86
-rw-r--r--Include/Protocol/LoadPe32Image.h95
-rw-r--r--Include/Protocol/LoadedImage.h153
-rw-r--r--Include/Protocol/LoadedImageDevicePath.h71
-rw-r--r--Include/Protocol/MXMProtocol.cif9
-rw-r--r--Include/Protocol/ManageShadowProtocol.h131
-rw-r--r--Include/Protocol/Metronome.h99
-rw-r--r--Include/Protocol/MonotonicCounter.h78
-rw-r--r--Include/Protocol/MpService.h436
-rw-r--r--Include/Protocol/MpService/MpService.h232
-rw-r--r--Include/Protocol/Mxm30.h80
-rw-r--r--Include/Protocol/NBMemInfo.h89
-rw-r--r--Include/Protocol/NBPlatformData.h117
-rw-r--r--Include/Protocol/NBProtocols.CIF9
-rw-r--r--Include/Protocol/Nbci.h77
-rw-r--r--Include/Protocol/NvmExpressPassThru.h307
-rw-r--r--Include/Protocol/PAhciBus.h399
-rw-r--r--Include/Protocol/PDiskInfo.h130
-rw-r--r--Include/Protocol/PIDEBus.cif8
-rw-r--r--Include/Protocol/PIDEBus.h1364
-rw-r--r--Include/Protocol/PIDEController.h151
-rw-r--r--Include/Protocol/PciHostBridgeResourceAllocation.h363
-rw-r--r--Include/Protocol/PciHotPlugInit.h119
-rw-r--r--Include/Protocol/PciIo.h306
-rw-r--r--Include/Protocol/PciPlatform.h137
-rw-r--r--Include/Protocol/PciRootBridgeIo.h311
-rw-r--r--Include/Protocol/Performance.h117
-rw-r--r--Include/Protocol/PlatformDriverOverride.h105
-rw-r--r--Include/Protocol/PlatformToDriverConfiguration.h110
-rw-r--r--Include/Protocol/Protocol.cif100
-rw-r--r--Include/Protocol/RealTimeClock.h79
-rw-r--r--Include/Protocol/ReportStatusCodeHandler.h94
-rw-r--r--Include/Protocol/Reset.h80
-rw-r--r--Include/Protocol/Runtime.h118
-rw-r--r--Include/Protocol/S3SaveState.h187
-rw-r--r--Include/Protocol/S3SmmSaveState.h46
-rw-r--r--Include/Protocol/SBPlatformData.h93
-rw-r--r--Include/Protocol/SBSmiProtocol.h134
-rw-r--r--Include/Protocol/SMBIOSProto.CIF10
-rw-r--r--Include/Protocol/SMBios.h1729
-rw-r--r--Include/Protocol/SMIFlashProtocols.CIF8
-rw-r--r--Include/Protocol/SbHpet.h238
-rw-r--r--Include/Protocol/ScsiPassThruExt.h212
-rw-r--r--Include/Protocol/SecSMIFlashProtocols.CIF8
-rw-r--r--Include/Protocol/SecSmiFlash.h165
-rw-r--r--Include/Protocol/Security.h81
-rw-r--r--Include/Protocol/Security2.h80
-rw-r--r--Include/Protocol/SerialIo.h186
-rw-r--r--Include/Protocol/ServiceBinding.h84
-rw-r--r--Include/Protocol/SetupInit.h73
-rw-r--r--Include/Protocol/SimpleFileSystem.h247
-rw-r--r--Include/Protocol/SimplePointer.h108
-rw-r--r--Include/Protocol/SimpleTextIn.h113
-rw-r--r--Include/Protocol/SimpleTextInEx.h148
-rw-r--r--Include/Protocol/SimpleTextOut.h258
-rw-r--r--Include/Protocol/SmBus.h140
-rw-r--r--Include/Protocol/SmbiosDynamicData.h585
-rw-r--r--Include/Protocol/SmbiosGetFlashDataProtocol.h93
-rw-r--r--Include/Protocol/SmmAccess.h170
-rw-r--r--Include/Protocol/SmmAccess2.h136
-rw-r--r--Include/Protocol/SmmBase.h183
-rw-r--r--Include/Protocol/SmmBase2.h102
-rw-r--r--Include/Protocol/SmmBiosWriteDispatch.h101
-rw-r--r--Include/Protocol/SmmCommunication.h111
-rw-r--r--Include/Protocol/SmmControl.h147
-rw-r--r--Include/Protocol/SmmControl2.h108
-rw-r--r--Include/Protocol/SmmCpu.h211
-rw-r--r--Include/Protocol/SmmCpuIo2.h114
-rw-r--r--Include/Protocol/SmmCpuState.h181
-rw-r--r--Include/Protocol/SmmGpiDispatch.h106
-rw-r--r--Include/Protocol/SmmGpiDispatch2.h114
-rw-r--r--Include/Protocol/SmmIoTrapDispatch.h129
-rw-r--r--Include/Protocol/SmmIoTrapDispatch2.h122
-rw-r--r--Include/Protocol/SmmPchIoTrapDispatch2.h134
-rw-r--r--Include/Protocol/SmmPciRootBridgeIo.h78
-rw-r--r--Include/Protocol/SmmPeriodicTimerDispatch.h118
-rw-r--r--Include/Protocol/SmmPeriodicTimerDispatch2.h121
-rw-r--r--Include/Protocol/SmmPiProtocols.cif27
-rw-r--r--Include/Protocol/SmmPiProtocols.sdl11
-rw-r--r--Include/Protocol/SmmPowerButtonDispatch.h132
-rw-r--r--Include/Protocol/SmmPowerButtonDispatch2.h119
-rw-r--r--Include/Protocol/SmmProtocols.cif22
-rw-r--r--Include/Protocol/SmmReadyToLock.h73
-rw-r--r--Include/Protocol/SmmReportStatusCodeHandler.h93
-rw-r--r--Include/Protocol/SmmStandbyButtonDispatch.h123
-rw-r--r--Include/Protocol/SmmStandbyButtonDispatch2.h124
-rw-r--r--Include/Protocol/SmmStatusCode.h106
-rw-r--r--Include/Protocol/SmmSwDispatch.h121
-rw-r--r--Include/Protocol/SmmSwDispatch2.h133
-rw-r--r--Include/Protocol/SmmSxDispatch.h142
-rw-r--r--Include/Protocol/SmmSxDispatch2.h127
-rw-r--r--Include/Protocol/SmmTcoDispatch.h114
-rw-r--r--Include/Protocol/SmmThunk.h252
-rw-r--r--Include/Protocol/SmmUsbDispatch.h135
-rw-r--r--Include/Protocol/SmmUsbDispatch2.h205
-rw-r--r--Include/Protocol/StatusCode.h94
-rw-r--r--Include/Protocol/StorageSecurityCommand.h97
-rw-r--r--Include/Protocol/SuperIo.h286
-rw-r--r--Include/Protocol/TcgService.h209
-rw-r--r--Include/Protocol/TerminalAmiSerial Protocol.cif8
-rw-r--r--Include/Protocol/TerminalAmiSerial.h122
-rw-r--r--Include/Protocol/Timer.h222
-rw-r--r--Include/Protocol/UgaDraw.h145
-rw-r--r--Include/Protocol/UnicodeCollation.h173
-rw-r--r--Include/Protocol/UsbHC.h468
-rw-r--r--Include/Protocol/UsbIo.h278
-rw-r--r--Include/Protocol/UsbPolicy.h233
-rw-r--r--Include/Protocol/UserCredential.h183
-rw-r--r--Include/Protocol/UserManager.h281
-rw-r--r--Include/Protocol/Variable.h80
-rw-r--r--Include/Protocol/WatchdogTimer.h224
-rw-r--r--Include/Protocol/sbProtocols.CIF14
-rw-r--r--Include/Protocol/smiflash.h173
-rw-r--r--Include/RomLayout.h128
-rw-r--r--Include/RsdpPlusIncludes.cif8
-rw-r--r--Include/S3Common.cif9
-rw-r--r--Include/SMM.h401
-rw-r--r--Include/Setup.h397
-rw-r--r--Include/SmBus.h139
-rw-r--r--Include/SmmPi.h239
-rw-r--r--Include/SmmPiIncludes.cif9
-rw-r--r--Include/SmmPiIncludes.sdl11
-rw-r--r--Include/StatusCodes.h1062
-rw-r--r--Include/TSEIncludes.cif9
-rw-r--r--Include/TcgTpm.h2112
-rw-r--r--Include/UefiHii.h1297
-rw-r--r--Include/VFR.unibin0 -> 5412 bytes
-rw-r--r--Include/WinCertificate.h107
366 files changed, 70343 insertions, 0 deletions
diff --git a/Include/ACPI.H b/Include/ACPI.H
new file mode 100644
index 0000000..d24b089
--- /dev/null
+++ b/Include/ACPI.H
@@ -0,0 +1,230 @@
+#ifndef _ACPI_H //To Avoid this header get compiled twice
+#define _ACPI_H
+
+
+#include <Efi.h>
+#include <Token.h>
+
+//---------------------------------------------------------------------------
+#pragma pack(1)
+
+#define APIC_SIG 0x43495041 //"APIC"Multiple APIC Description Table
+
+#define SPIC_SIG 0x43495053 //"SPIC"Multiple SAPIC Description Table
+
+#define BOOT_SIG 0x544F4F42 //"BOOT"MS Simple Boot Spec
+
+#define DBGP_SIG 0x50474244 //"DBGP" MS Bebug Port Spec
+
+#define DSDT_SIG 0x54445344 //"DSDT" Differentiated System Description Table
+
+#define ECDT_SIG 0x54444345 //"ECDT" Embedded Controller Boot Resources Table
+
+#define ETDT_SIG 0x54445445 //"ETDT" Event Timer Description Table
+
+#define FACP_SIG 0x50434146 //"FACP" Fixed ACPI Description Table (FADT)
+
+#define FACS_SIG 0x53434146 //"FACS" //Firmware ACPI Control Structure
+
+#define PSDT_SIG 0x54445350 //"PSDT"Persistent System Description Table
+
+#define RSDT_SIG 0x54445352 //"RSDT"Root System Description Table
+
+#define SBST_SIG 0x54534253 //"SBST"Smart Battery Specification Table
+
+#define SLIT_SIG 0x54494C53 //"SLIT"System Locality Information Table
+
+#define SPCR_SIG 0x52435053 //"SPCR"Serial Port Concole Redirection Table
+
+#define SRAT_SIG 0x54415253 //"SBST"Static Resource Affinity Table
+
+#define SSDT_SIG 0x54445353 //"SSDT"Secondary System Description Table
+
+#define SPMI_SIG 0x494D5053 //"SPMI"Server Platform Management Interface Table
+
+#define XSDT_SIG 0x54445358 //"XSDT" eXtended System Description Table
+
+#define RSDP_SIG 0x2052545020445352 //"RSD PTR "
+
+//======================================================
+// ACPI Description Headers Signatures
+//======================================================
+#define MCFG_SIG 0x4746434D //PCI Express Congiguration Table
+
+#define HPET_SIG 0x54455048
+
+//for testing purposes only
+#define IPPT_SIG 0x54505049 // "IPPT" -- IA64 Platform Properties Table
+
+//======================================================
+// RSDT Pointer structure for IA32
+//======================================================
+typedef struct _RSDT_PTR_20{
+ UINT64 Signature; //should contain trailing space
+ UINT8 Checksum; //Only First 20 bytes for future compatability
+ UINT8 OEMID[6];
+ UINT8 Revision; //Now Revision ID was reserved in ACPI 1.1
+ //should be 0 for ACPI 1.0 or 2 for ACPI 2.0
+ UINT32 RsdtAddr; //32 bit RSDT Address for future compatability
+ // Here follows additional part that couldn't be met in ACPI 1.1
+ UINT32 Length; //Length of the table in bytes including header;
+ UINT64 XsdtAddr;
+ UINT8 XtdChecksum;//Checksum of entire table
+ UINT8 Reserved[3];
+} RSDT_PTR_20,*PRSDT_PTR_20;
+
+//======================================================
+// ACPI Tables header structure for IA32
+//======================================================
+typedef struct _ACPI_HDR {
+ UINT32 Signature;
+ UINT32 Length;
+ UINT8 Revision;
+ UINT8 Checksum;
+ UINT8 OemId[6];
+ UINT8 OemTblId[8];
+ UINT32 OemRev;
+ UINT32 CreatorId;
+ UINT32 CreatorRev;
+} ACPI_HDR,*PACPI_HDR;
+
+//======================================================
+// Bits Description in FACP.FLAGS field. IA32&IA64
+//======================================================
+#define FF_WBINVD 0x00000001
+#define FF_WBINVD_FLUSH 0x00000002
+#define FF_PROC_C1 0x00000004
+#define FF_LVL2_UP 0x00000008
+#define FF_PWR_BUTTON 0x00000010
+#define FF_SLP_BUTTON 0x00000020
+#define FF_FIX_RTC 0x00000040
+#define FF_RTC_S4 0x00000080
+#define FF_TMR_VAL_EXT 0x00000100
+#define FF_DCK_CAP 0x00000200
+
+//======================================================
+// RSDT Root System Description Table for IA32
+//======================================================
+#ifndef ACPI_RSDT_TABLE_NUM
+#define ACPI_RSDT_TABLE_NUM 0x10
+#endif
+
+typedef struct _RSDT32 {
+ ACPI_HDR Header;
+ UINT32 Ptrs[ACPI_RSDT_TABLE_NUM];
+} RSDT32, *PRSDT32, RSDT_20, *PRSDT_20;
+
+//======================================================
+// APIC Multiple APIC Description Table Header IA32
+//======================================================
+typedef struct _APIC32H {
+ ACPI_HDR Header; //0..35
+ UINT32 LAPIC_Address; //36
+ UINT32 Flags; //40
+} APIC32H,*PAPIC32H,APIC_20H,*PAPIC_20H;
+
+//======================================================
+// Bits Description in APIC32H.Flags field. IA32
+//======================================================
+#define PCAT_COMPAT 0x00000001
+
+//======================================================
+// Bits Description in APICXX.Type field. IA32&64
+//======================================================
+#define CpuLapic 0
+#define IoApic 1
+//For IA32 following is reserved
+#define IntSrcOvrd 2
+#define IntSrcPlat 3
+//For IA64 >4 reserved
+
+
+//======================================================
+// LAPIC Structure per each CPU IA32
+//======================================================
+typedef struct _LAPIC32 {
+ UINT8 Type; //0
+ UINT8 Length; //1
+ UINT8 CpuId;
+ UINT8 LapicId;
+ UINT32 Flags;
+} LAPIC32,*PLAPIC32, LAPIC_20,*PLAPIC_20;
+
+//======================================================
+// IOAPIC Structure per each CPU IA32
+//======================================================
+typedef struct _IOAPIC32 {
+ UINT8 Type; //0
+ UINT8 Length; //1
+ UINT8 IoapicId; //2
+ UINT8 Reserved; //3
+ UINT32 IoapicAddress; //4
+ UINT32 SysVectBase; //8
+} IOAPIC32,*PIOAPIC32, IOAPIC_20,*PIOAPIC_20;
+
+//======================================================
+// ISO Interrupt Source Override Structure IA32
+//======================================================
+// Should be present per each ISA Interrupt which
+// is not identity-mapped into SAPIC Interrupt space
+//======================================================
+typedef struct _ISO32 {
+ UINT8 Type; //0
+ UINT8 Length; //1
+ UINT8 Bus; //2
+ UINT8 Source; //3
+ UINT32 GlobalSysVect; //4
+ UINT16 Flags; //8
+
+} ISO32,*PISO32, ISO_20,*PISO_20;
+
+//======================================================
+// SBDT Smart Battery Description Table IA32
+//======================================================
+typedef struct _SBDT32 {
+ ACPI_HDR Header;
+ UINT32 WarningLvl;
+ UINT32 LowLvl;
+ UINT32 CriticalLvl;
+} SBDT32,*PSBDT32, SBDT_20,*PSBDT_20;
+
+//======================================================
+// Here Follows Definitions that are not Chipset specific
+//======================================================
+
+#define CREATOR_ID_MS 0x5446534D //"TFSM""MSFT"(Microsoft)
+
+#define CREATOR_REV_MS 0x00010013
+
+#define CREATOR_ID_AMI 0x20494D41 //" IMA""AMI "(AMI)
+
+#define CREATOR_REV 0x00000000
+
+//==========================================================
+// Define APIC IO Interrupt Assignment INT_FLAGS
+//==========================================================
+#define IF_PO_HIG 0x1
+
+#define IF_PO_LOW 0x3
+
+#define IF_EL_EDG 0x4
+
+#define IF_EL_LVL 0xC
+
+#pragma pack()
+
+#endif
+
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2005, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
diff --git a/Include/ACPI11.H b/Include/ACPI11.H
new file mode 100644
index 0000000..460d6f6
--- /dev/null
+++ b/Include/ACPI11.H
@@ -0,0 +1,334 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2005, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+
+//**********************************************************************//
+// $Header: /Alaska/BIN/Core/Include/ACPI11.H 5 5/05/06 5:17p Ambikas $
+//
+// $Revision: 5 $
+//
+// $Date: 5/05/06 5:17p $
+//**********************************************************************//
+// Revision History
+// ----------------
+//
+//**********************************************************************//
+// ACPI Data structures //
+// For building ACPI Tables //
+// !!!!NO PORTING NEEDED!!!!!! //
+//**********************************************************************//
+
+
+#ifndef _ACPI11_H //To Avoid this header get compiled twice
+#define _ACPI11_H
+
+
+#include <Efi.h>
+#include <Token.h>
+#include <Acpi.h>
+
+#pragma pack(1)
+
+//======================================================
+// RSDT Pointer structure for IA32
+//======================================================
+typedef struct _RSDT_PTR32{
+ UINT64 Signature; //should contain trailing space
+ UINT8 Checksum;
+ UINT8 OEMID[6];
+ UINT8 reserved; //should be 0 for ACPI 1.0
+ UINT32 RsdtAddress;
+} RSDT_PTR32,*PRSDT_PTR32;
+
+//======================================================
+// RSDT Pointer structure for IA64
+//======================================================
+typedef struct _RSDT_PTR64{
+ UINT64 Signature; // RSDP_signature
+ UINT8 Checksum; // Sum of all bytes of this struct must equal 0
+ UINT8 OEMID[6]; // UINTnique OEM ID string
+ UINT8 Reserved; // must be 0
+ UINT64 RsdtAddress; // Physical Address of RSDT
+} RSDT_PTR64,*PRSDT_PTR64;
+
+//======================================================
+// ACPI Tables header structure for IA64
+//======================================================
+typedef struct _ACPI_HDR64 {
+ UINT32 Signature;
+ UINT32 Length;
+ UINT8 Revision;
+ UINT8 Checksum;
+ UINT8 OemId[6];
+ UINT8 OemTableId[8];
+ UINT32 OemRevision;
+ UINT32 CreatorId;
+ UINT32 CreatorRevision;
+ UINT32 Reserved;
+} ACPI_HDR64,*PACPI_HDR64;
+
+#define facp_flags FF_WBINVD | FF_SLP_BUTTON
+
+//======================================================
+// RSDT Root System Description Table for IA64
+//======================================================
+typedef struct _RSDT64 {
+ ACPI_HDR64 Header;
+ UINT64 Ptrs[ACPI_RSDT_TABLE_NUM];
+} RSDT64, *PRSDT64;
+
+//======================================================
+// FACP Fixed ACPI Description Table for IA32
+//======================================================
+typedef struct _FACP32 {
+ ACPI_HDR Header; //0..35
+ UINT32 FIRMWARE_CTRL; //36 Phisical memory address (0-4G) of FACS
+ UINT32 DSDT; //40 Phisical memory address (0-4G) of DSDT
+ UINT8 INT_MODEL; //44 0 Dual PIC; 1 Multipy APIC; >1 reserved
+ UINT8 Reserved1; //45
+ UINT16 SCI_INT; //46 SCI int Pin should be Shareble/Level/Act Low
+ UINT32 SMI_CMD; //48 Port Addr of ACPI Command reg
+ UINT8 ACPI_ENABLE_CMD; //52 Value to write in SMI_CMD reg
+ UINT8 ACPI_DISABLE_CMD; //53 Value to write in SMI_CMD reg
+ UINT8 S4BIOS_REQ; //54 Value to write in SMI_CMD reg
+ UINT8 Reserved2; //55
+ UINT32 PM1a_EVT_BLK; //56
+ UINT32 PM1b_EVT_BLK; //60
+ UINT32 PM1a_CNT_BLK; //64
+ UINT32 PM1b_CNT_BLK; //68
+ UINT32 PM2_CNT_BLK; //72
+ UINT32 PM_TMR_BLK; //76
+ UINT32 GPE0_BLK; //80
+ UINT32 GPE1_BLK; //84
+ UINT8 PM1_EVT_LEN; //88
+ UINT8 PM1_CNT_LEN; //89
+ UINT8 PM2_CNT_LEN; //90
+ UINT8 PM_TM_LEN; //91
+ UINT8 GPE0_BLK_LEN; //92
+ UINT8 GPE1_BLK_LEN; //93
+ UINT8 GPE1_BASE; //94
+ UINT8 Reserved3; //95
+ UINT16 P_LVL2_LAT; //96
+ UINT16 P_LVL3_LAT; //98
+ UINT16 FLUSH_SIZE; //100
+ UINT16 FLUSH_STRIDE; //102
+ UINT8 DUTY_OFFSET; //104
+ UINT8 DUTY_WIDTH; //105
+ UINT8 DAY_ALRM; //106
+ UINT8 MON_ALRM; //107
+ UINT8 CENTURY; //108
+ UINT8 Reserved4; //109
+ UINT16 Reserved5; //110
+ UINT32 FLAGS; //112
+}FACP32,*PFACP32;
+
+//======================================================
+
+//======================================================
+// FACP Fixed ACPI Description Table for IA64
+//======================================================
+typedef struct _FACP64{
+ ACPI_HDR64 Header; //0..39
+ UINT64 FIRMWARE_CTRL; //40 Phisical memory address of FACS
+ UINT64 DSDT; //48 Phisical memory address of DSDT
+ UINT8 INT_MODEL; //56 <2-reserved; Mult SAPIC; >2 reserved
+ UINT8 ADDRESS_SPACE; //57 Addr space bitmask for each reg block
+ UINT16 SCI_INT; //58 SCI int Pin should be Shareble/Level/Act Low
+ UINT8 ACPI_ENABLE; //60 Value to write in SMI_CMD reg
+ UINT8 ACPI_DISABLE; //61 Value to write in SMI_CMD reg
+ UINT8 S4BIOS_REQ; //62 Value to write in SMI_CMD reg
+ UINT8 Reserved1; //63
+ UINT64 SMI_CMD; //64 Port Addr of ACPI Command reg
+ UINT64 PM1a_EVT_BLK; //72
+ UINT64 PM1b_EVT_BLK; //80
+ UINT64 PM1a_CNT_BLK; //88
+ UINT64 PM1b_CNT_BLK; //96
+ UINT64 PM2_CNT_BLK; //104
+ UINT64 PM_TMR_BLK; //112
+ UINT64 GPE0_BLK; //120
+ UINT64 GPE1_BLK; //128
+ UINT8 PM1_EVT_LEN; //136
+ UINT8 PM1_CNT_LEN; //137
+ UINT8 PM2_CNT_LEN; //138
+ UINT8 PM_TM_LEN; //139
+ UINT8 GPE0_BLK_LEN; //140
+ UINT8 GPE1_BLK_LEN; //141
+ UINT8 GPE1_BASE; //142
+ UINT8 Reserved2; //143
+ UINT16 P_LVL2_LAT; //144
+ UINT16 P_LVL3_LAT; //146
+ UINT8 DAY_ALRM; //148
+ UINT8 MON_ALRM; //149
+ UINT8 CENTURY; //150
+ UINT8 Reserved3; //151
+ UINT32 FLAGS; //152
+}FACP64,*PFACP64;
+
+
+//======================================================
+// FACS Firmware ACPI Control Structure for IA32
+//======================================================
+typedef struct _FACS32 {
+ UINT32 Signature; //0
+ UINT32 Length; //4
+ UINT32 HardwareSignature; //8
+ UINT32 FwWakingVector; //12
+ UINT32 GlobalLock; //16
+ UINT32 Flags; //20
+ UINT8 Reserved[40]; //24 Should be 0
+} FACS32,*PFACS32;
+
+//======================================================
+// FACS Firmware ACPI Control Structure for IA64
+//======================================================
+typedef struct _FACS64 {
+ UINT32 Signature; //0
+ UINT32 Length; //4
+ UINT32 HardwareSignature; //8
+ UINT32 Reserved1; //12
+ UINT64 FwWakingVector; //16
+ UINT64 GlobalLock; //24
+ UINT32 Flags; //32
+ UINT8 Reserved[28]; //24 Should be 0
+} FACS64,*PFACS64;
+
+
+//======================================================
+// SPIC Multiple SAPIC Description Table Header IA64
+//======================================================
+typedef struct _SPIC64H {
+ ACPI_HDR64 Header; //0..39
+ UINT64 IntBlock; //40
+} SPIC64H,*PSPIC64H;
+
+//======================================================
+// Bits Description in APICXX.Type field. IA32&64
+//======================================================
+#define CpuLapic 0
+#define IoApic 1
+//For IA32 following is reserved
+#define IntSrcOvrd 2
+#define IntSrcPlat 3
+//For IA64 >4 reserved
+
+//======================================================
+// LAPIC Structure per each CPU IA64
+//======================================================
+typedef struct _LSAPIC64 {
+ UINT8 Type; //0
+ UINT8 Length; //1
+ UINT16 CpuId;
+ UINT16 Flags;
+ UINT8 LsapicId;
+ UINT8 LsapicEid;
+} LSAPIC64,*PLSAPIC64;
+
+//======================================================
+// Bits Description in LAPICXX.Flags field. IA32&64
+//======================================================
+#ifndef FI_Enabled
+#define FI_Enabled 0x0001
+#endif
+// IOAPIC Structure per each IOAPIC IA64
+//======================================================
+typedef struct _IOSAPIC64 {
+ UINT8 Type; //0
+ UINT8 Length; //1
+ UINT16 Reserved; //2
+ UINT32 SysVectBase; //4
+ UINT64 IosapicAddress; //8
+} IOSAPIC64,*PIOSAPIC64;
+
+//======================================================
+// ISO Interrupt Source Override Structure IA64
+//======================================================
+// Should be present per each ISA Interrupt which
+// is not identity-mapped into SAPIC Interrupt space
+//======================================================
+typedef struct _ISO64 {
+ UINT8 Type; //0
+ UINT8 Length; //1
+ UINT8 Bus; //2
+ UINT8 Source; //3
+ UINT32 GlobalSysVect; //4
+ UINT16 Flags; //8
+ UINT8 Reserved[6]; //12
+} ISO64,*PISO64;
+
+
+//======================================================
+// NIS Non-Maskable Interrupt Source Structure IA32
+//======================================================
+typedef struct _NIS32 {
+ UINT8 Type; //0
+ UINT8 Length; //1
+ UINT16 Flags; //2
+ UINT32 GlobalSysVect; //4
+} NIS32,*PNIS32;
+
+
+//======================================================
+// PIS Platform Interrupt Source Structure IA64
+//======================================================
+typedef struct _PIS64 {
+ UINT8 Type; //0
+ UINT8 Length; //1
+ UINT16 Flags; //2
+ UINT8 IntType; //4
+ UINT8 CpuId; //5
+ UINT8 CpuEid; //6
+ UINT8 IosapicVect; //7
+ UINT32 Reserved; //8
+ UINT32 GlobalSysVect; //12
+} PIS64,*PPIS64;
+
+
+//======================================================
+// Define INT_TYPE values also can be used in MP 1.5
+// Bits Description in PIS64.IntType field. IA64
+//======================================================
+#define IT_INT 0x0000
+#define IT_NMI 0x0001
+#define IT_PMI 0x0002
+#define IT_EXT 0x0003
+#define IT_INIT 0x0004
+#define IT_CorrMem 0x0005
+#define IT_CorrPlt 0x0006
+
+//======================================================
+// SBDT Smart Battery Description Table IA64
+//======================================================
+typedef struct _SBDT64 {
+ ACPI_HDR64 Header;
+ UINT32 WarningLvl;
+ UINT32 LowLvl;
+ UINT32 CriticalLvl;
+} SBDT64,*PSBDT64;
+
+#pragma pack()
+
+#endif
+
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2005, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
diff --git a/Include/ACPI20.H b/Include/ACPI20.H
new file mode 100644
index 0000000..f1242a7
--- /dev/null
+++ b/Include/ACPI20.H
@@ -0,0 +1,576 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2005, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+
+//**********************************************************************//
+// $Header: /Alaska/BIN/Core/Include/ACPI20.H 10 1/15/10 4:26p Felixp $
+//
+// $Revision: 10 $
+//
+// $Date: 1/15/10 4:26p $
+//**********************************************************************//
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Core/Include/ACPI20.H $
+//
+// 10 1/15/10 4:26p Felixp
+// facp_flags2 macro removed in Core 4.6.3.6 is restored for compatibility
+// with the older versions of the ACPI module.
+//
+// 9 5/07/09 2:21p Yakovlevs
+// Removed unused macro for FACP Feaure Flags
+//
+// 8 5/24/06 3:52p Ambikas
+//
+// 7 5/05/06 5:18p Ambikas
+//
+// 6 5/05/06 5:13p Ambikas
+//
+// 5 4/13/06 7:24p Yakovlevs
+// ACPI Disable Support added
+//
+// 4 11/04/05 6:10p Yakovlevs
+// HPET Table Support
+//
+// 3 8/22/05 4:27p Girim
+// Set Reset Register and RTC S4 Timer Flags in FACP table for fixing the
+// Reset and S4 Task Schedule Wakeup.
+//
+// 2 6/28/05 6:41p Yakovlevs
+//
+// 1 6/28/05 12:26p Yakovlevs
+//
+// 3 6/21/05 5:07p Yakovlevs
+// Impementation of AcpiSupport Protocol was added
+//
+// 2 6/03/05 2:45p Yakovlevs
+// Removed redundant includes
+//
+// 1 3/24/05 5:01p Sivagarn
+// Initial Checkin
+//
+// 1 2/03/05 6:41p Sivagarn
+// 0ABHI001 Check in
+//
+// 3 1/19/05 7:24p Yakovlevs
+//
+// 2 7/27/04 6:45p Yakovlevs
+//
+// 1 4/08/04 3:29p Yakovlevs
+//
+// 6 2/20/03 2:49p Yakovlevs
+// Updated FACS flags value. May be it will affect system's power off
+// behavior.
+//
+// 5 3/14/02 2:29p Yakovlevs
+// Creation of SPCR table added in ACPI 2.0 routines using COM port
+// parameters acquired from BIOS SETUP.
+//
+// 3 3/01/02 9:19a Yakovlevs
+// Wirkaround to boot WIN 3590
+//
+// 2 12/20/01 6:32p Yakovlevs
+// SAL_C was updated and tested to support dinamic NODE discovery and find
+// and locate IOxAPIC using 0xFECXYZ000 space and regular PCI MMIO
+// Also was added SAL_C function 6 which allows put values in chipset
+// registers using specially prepared table
+//
+// 2 9/21/01 3:17p Yakovlevs
+// Code cleanup
+//
+//**********************************************************************//
+// ACPI v2.0 Data structures //
+// !!!!NO PORTING NEEDED!!!!!! //
+//**********************************************************************//
+
+
+
+#ifndef _ACPI20_H //To Avoid this header get compiled twice
+#define _ACPI20_H
+
+#include <Efi.h>
+#include <Token.h>
+#include <Acpi.h>
+
+#pragma pack(push, 1)
+
+
+
+
+//======================================================
+// GAS_20 Generic Address Structure Values
+//======================================================
+#define GAS_SYS_MEM 0x00 //System memory in IA32 Hi Dword must be 0
+#define GAS_SYS_IO 0x01 //System I/O in IA32 Hi Dword must be 0
+#define GAS_PCI_CFG 0x02 //PCI Configuration Space on PCI BUS 0 SEG 0
+ //Hi-> W3=0 | W2=DevId | W1=FunNo | W0=Offs <-Lo
+#define GAS_EMB_CTR 0x03 //Embeded Controller
+#define GAS_SM_BUS 0x04 //SMBus
+#define GAS_F_F_HW 0x7F //Functional Fixed Hardware
+ //all other field in GAS_20 must be 0
+
+//======================================================
+// GAS_20 Generic Address structure
+//======================================================
+typedef struct _GAS_20 {
+ UINT8 AddrSpcID; //The address space where the data structure or register exists.
+ //Defined values are above
+ UINT8 RegBitWidth; //The size in bits of the given register.
+ //When addressing a data structure, this field must be zero.
+ UINT8 RegBitOffs; //The bit offset of the given register at the given address.
+ //When addressing a data structure, this field must be zero.
+ UINT8 Reserved1; //must be 0.
+ UINT64 Address; //The 64-bit address of the data structure or register in
+ //the given address space (relative to the processor).
+} GAS_20,*PGAS_20;
+
+
+
+
+// Bits Description in FACP.FLAGS updated for ACPI 2.0
+//======================================================
+#define FF_RESET_REG_S 0x00000400
+#define FF_SEALED_CASE 0x00000800
+#define FF_HEADLESS 0x00001000
+#define FF_CPU_SW_SLP 0x00002000
+#define FF_PCI_EXP_WALK 0x00004000
+#define FF_USE_PLATFORM_CLOCK 0x00008000
+#define FF_S4_RTC_STS_VALID 0x00010000
+#define FF_REMOTE_POWER_ON_CAPABLE 0x00020000
+#define FF_FORCE_APIC_CLUSTER_MODEL 0x00040000
+#define FF_FORCE_APIC_PHYSICAL_DESTINATION_MODE 0x00080000
+
+#define facp_flags2 FF_WBINVD | FF_SLP_BUTTON | FF_PROC_C1 | FF_RESET_REG_S | FF_RTC_S4
+
+//======================================================
+// XSDT Extended System Description Table
+//======================================================
+typedef struct _XSDT_20 {
+ ACPI_HDR Header;
+ UINT64 Ptrs[ACPI_RSDT_TABLE_NUM];
+} XSDT_20, *PXSDT_20;
+
+//======================================================
+// Define Preffered PM Profile (PM_PPROF offset 45)
+//======================================================
+#define PM_UNSPEC 0 //Uncpecified
+#define PM_DESKTOP 1 //Desktop
+#define PM_MOBILE 2 //
+#define PM_WORKST 3
+#define PM_ENT_SVR 4
+#define PM_SOHO_SVR 5
+#define PM_APPL_PC 6
+
+//======================================================
+// Define Preffered IA-PC Boot Architacture Falg
+// (IAPC_BOOT_ARCH offset 109)
+//======================================================
+#define IA_LEGACY 0x01
+#define IA_8042 0x02
+
+//======================================================
+// FADT Fixed ACPI Description Table
+//======================================================
+typedef struct _FACP_20 {
+ ACPI_HDR Header; //0..35
+ UINT32 FIRMWARE_CTRL; //36 Phisical memory address (0-4G) of FACS
+ UINT32 DSDT; //40 Phisical memory address (0-4G) of DSDT
+ UINT8 Reserved1; //44 (Was INT_MODEL 0 Dual PIC;1 Multipy APIC)
+ // can be 0 or 1 for ACPI 1.0
+ UINT8 PM_PPROF; //45 Preffered PM Profile (was Reserved)
+ UINT16 SCI_INT; //46 SCI int Pin should be Shareble/Level/Act Low
+
+ UINT32 SMI_CMD; //48 Port Addr of ACPI Command reg
+ UINT8 ACPI_ENABLE_CMD; //52 Value to write in SMI_CMD reg
+ UINT8 ACPI_DISABLE_CMD; //53 Value to write in SMI_CMD reg
+ UINT8 S4BIOS_REQ; //54 Value to write in SMI_CMD reg
+ UINT8 PSTATE_CNT; //55 Was Reserved2 now
+ // Value that OSPM writes in SCI_CMD to assume
+ // Processor Perfomance State control responsibility
+ UINT32 PM1a_EVT_BLK; //56
+ UINT32 PM1b_EVT_BLK; //60
+ UINT32 PM1a_CNT_BLK; //64
+ UINT32 PM1b_CNT_BLK; //68
+ UINT32 PM2_CNT_BLK; //72
+ UINT32 PM_TMR_BLK; //76
+ UINT32 GPE0_BLK; //80
+ UINT32 GPE1_BLK; //84
+ UINT8 PM1_EVT_LEN; //88
+ UINT8 PM1_CNT_LEN; //89
+ UINT8 PM2_CNT_LEN; //90
+ UINT8 PM_TM_LEN; //91
+ UINT8 GPE0_BLK_LEN; //92
+ UINT8 GPE1_BLK_LEN; //93
+ UINT8 GPE1_BASE; //94
+ UINT8 CST_CNT; //95 Was Reserved3
+ UINT16 P_LVL2_LAT; //96
+ UINT16 P_LVL3_LAT; //98
+ UINT16 FLUSH_SIZE; //100
+ UINT16 FLUSH_STRIDE; //102
+ UINT8 DUTY_OFFSET; //104
+ UINT8 DUTY_WIDTH; //105
+ UINT8 DAY_ALRM; //106
+ UINT8 MON_ALRM; //107
+ UINT8 CENTURY; //108
+ UINT16 IAPC_BOOT_ARCH; //109
+ UINT8 Reserved2; //111
+ UINT32 FLAGS; //112
+//That was 32 bit part of a FADT Here follows 64bit part
+ GAS_20 RESET_REG; //116
+ UINT8 RESET_VAL; //128
+ UINT8 Reserved[3]; //129
+ UINT64 X_FIRMWARE_CTRL; //132 Phisical memory address (0-4G) of FACS
+ UINT64 X_DSDT; //140 Phisical memory address (0-4G) of DSDT
+ GAS_20 X_PM1a_EVT_BLK; //148
+ GAS_20 X_PM1b_EVT_BLK; //160
+ GAS_20 X_PM1a_CNT_BLK; //172
+ GAS_20 X_PM1b_CNT_BLK; //184
+ GAS_20 X_PM2_CNT_BLK; //196
+ GAS_20 X_PM_TMR_BLK; //208
+ GAS_20 X_GPE0_BLK; //220
+ GAS_20 X_GPE1_BLK; //232
+}FACP_20,*PFACP_20;
+
+//======================================================
+// FACS Firmware ACPI Control Structure for ACPI 2.0
+//======================================================
+typedef struct _FACS_20 {
+ UINT32 Signature; //0
+ UINT32 Length; //4
+ UINT32 HardwareSignature; //8
+ UINT32 FwWakingVector; //12
+ UINT32 GlobalLock; //16
+ UINT32 Flags; //20
+//====== ACPI 2.0 ======================================
+ //UINT8 Reserved[40]; //24 Should be 0
+ UINT64 X_FwWakingVector; //24
+ UINT8 Version; //32 1-Version of this table;
+ UINT8 Reserved[31]; //33
+} FACS_20,*PFACS_20;
+
+//======================================================
+// Bits Description in FACS.GlobalLock field. ACPI 2.0
+//======================================================
+#define GL_PENDING 0x01
+#define GL_OWNED 0x20
+
+//======================================================
+// APIC Multiple APIC Description Table Header ACPI 2.0
+//======================================================
+typedef struct _APIC_20H {
+ ACPI_HDR Header; //0..35
+ UINT32 LAPIC_Address; //36
+ UINT32 Flags; //40
+} ;
+
+//======================================================
+// Bits Description in APICXX.Type field. ACPI 2.0
+//======================================================
+#ifndef AT_LAPIC
+#define AT_LAPIC 0
+#endif
+
+#ifndef AT_IOAPIC
+#define AT_IOAPIC 1
+#endif
+
+#ifndef AT_ISO
+#define AT_ISO 2
+#endif
+
+#ifndef AT_NMI
+#define AT_NMI 3
+#endif
+
+#ifndef AT_LAPIC_NMI
+#define AT_LAPIC_NMI 4
+#endif
+
+#ifndef AT_LAPIC_ADR
+#define AT_LAPIC_ADR 5
+#endif
+
+#ifndef AT_IOSAPIC
+#define AT_IOSAPIC 6
+#endif
+//Updated according ACPI Spec 2.0 errata 1.3
+#ifndef AT_LSAPIC
+#define AT_LSAPIC 7
+#endif
+
+#ifndef AT_PIS
+#define AT_PIS 8
+#endif
+
+
+//======================================================
+// Bits Description in LAPICXX.Flags field. ACPI 2.0
+//======================================================
+#define FL_ENABLE 0x0001
+
+//======================================================
+// NMI Structure ACPI 2.0
+//======================================================
+typedef struct _NMI_20 {
+ UINT8 Type; //0
+ UINT8 Length; //1
+ UINT16 Flags; //2 same as MPS INTI flags 1.4
+ UINT32 GlobalSysVect; //4
+} NMI_20,*PNMI_20;
+
+//======================================================
+// Local APIC NMI Structure ACPI 2.0
+//======================================================
+typedef struct _LNMI_20 {
+ UINT8 Type; //0
+ UINT8 Length; //1
+ UINT8 CPU_ID; //2
+ UINT16 Flags; //3 same as MPS INTI flags 1.4
+ UINT8 LapicIntin; //5
+} LNMI_20,*PLNMI_20;
+
+//======================================================
+// Local APIC Address Override Structure ACPI 2.0
+// =========== Optional ================================
+//======================================================
+typedef struct _LAPIC_ADDR_20 {
+ UINT8 Type; //0
+ UINT8 Length; //1
+ UINT16 Reserved; //2
+ UINT64 LAPIC_Address; //4
+} LAPIC_ADDR_20,*PLAPIC_ADDR_20;
+
+//======================================================
+// IOSAPIC Structure per each IOSAPIC ACPI 2.0
+// =========== Optional ================================
+//======================================================
+typedef struct _IOSAPIC_20 {
+ UINT8 Type; //0
+ UINT8 Length; //1
+ UINT8 IoapicId; //2
+ UINT8 Reserved; //3
+ UINT32 SysVectBase; //8
+ UINT64 IosapicAddress; //4
+} IOSAPIC_20,*PIOSAPIC_20;
+
+//======================================================
+// LSAPIC Structure per each CPU ACPI 2.0
+// =========== Optional ================================
+//======================================================
+typedef struct _LSAPIC_20 {
+ UINT8 Type; //0
+ UINT8 Length; //1
+ UINT8 CpuId; //2
+ UINT8 LsapicId; //3
+ UINT8 LsapicEid; //4
+// PO_DBG_TAS_0321
+// Updates per ACPI errata spec.
+ UINT8 Reserved1; //5
+ UINT8 Reserved2; //6
+ UINT8 Reserved3; //7
+// PO_DBG_TAS_0321
+ UINT32 Flags; //8 Same as MPS 1.4
+} LSAPIC_20,*PLSAPIC_20;
+
+
+//======================================================
+// Platform Source Interrupt Override Structure
+// per each INTIN
+//======================================================
+typedef struct _PIS_20 {
+ UINT8 Type; //0
+ UINT8 Length; //1
+ UINT16 Flags; //2 Same as MPS 1.4
+ UINT8 IntType; //4
+ UINT8 CpuId; //5
+ UINT8 CpuEid; //6
+ UINT8 IoSapicVect; //7
+ UINT32 GlobalSysVect; //8
+ UINT32 Reserved; //12
+} PIS_20,*PPIS_20;
+
+//======================================================
+// Define INT_TYPE values
+//======================================================
+#define PIT_PMI 0x0001
+#define PIT_NMI 0x0002
+#define PIT_ERR 0x0003
+
+//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+//======================================================
+//Stuff following below is ACPI 2.0 new tables
+//======================================================
+//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
+//======================================================
+// ECDT Embeded Controller Boot Resource Table ACPI 2.0
+//======================================================
+typedef struct _ECDT_20 {
+ ACPI_HDR Header;
+ GAS_20 EC_CONTROL;
+ GAS_20 EC_DATA;
+ UINT32 UID;
+ UINT8 GPE_BIT;
+ UINT8 EC_ID[128]; //string that specify EC (\_SB.PCI0.ISA.EC)
+} ECDT_20,*PECDT_20;
+
+
+//======================================================
+// SRAT Static Resource Affinity Table
+//======================================================
+typedef struct _SRAT_H_20 {
+ ACPI_HDR Header;
+ UINT32 TBL_REV; //this table revision=1
+ UINT8 Reserved1;
+} SRAT_H_20,*PSRAT_H_20;
+
+//======================================================
+// IPPT Table -- IA64 Platform Properties Table
+//======================================================
+typedef struct _IPPT_20 {
+ ACPI_HDR Header;
+ UINT32 Flags;
+ UINT32 Reserved[3];
+} IPPT_20, *PIPPT_20;
+
+#define IPPT_DIS_WRITE_COMBINING BIT0
+#define IPPT_ENA_CROSS_PART_IPI BIT1
+#define IPPT_DIS_PTCG_TB_FLUSH BIT2
+#define IPPT_DIS_UC_MAIN_MEMORY BIT3
+
+//======================================================
+// SPCR Data Definitions
+//======================================================
+//Interface Type Definitions
+#define SER_IF_16550 0
+#define SER_IF_16450 1
+//interrupt Type Bits...
+#define SER_IT_8259 BIT0
+#define SER_IT_APIC BIT1
+#define SER_IT_SAPIC BIT2
+//Baud Rate Definitions
+#define SER_BR_9600 3
+#define SER_BR_19200 4
+#define SER_BR_57600 6
+#define SER_BR_115200 7
+//Flow Controll Definitions
+#define SER_FC_DCD BIT0
+#define SER_FC_RTS_CTS BIT1
+#define SER_FC_XON_XOF BIT2
+//Terminal Protocol Type Definitions
+#define SER_TT_VT100 0
+#define SER_TT_VT100P 1
+#define SER_TT_VT_UTF8 2
+#define SER_TT_ANCI 3
+
+
+//======================================================
+// SPCR Serial Port Console Redirection Table
+//======================================================
+typedef struct _SPCR_20 {
+ ACPI_HDR Header; //0..35
+ UINT8 InterfaceType; //36 0/1 16550/16450 interface type
+ UINT8 Reserved[3]; //37..39 Reserved
+ GAS_20 BaseAddress; //40..51 Address of the redirection serial port
+ UINT8 InterruptType; //52 System Interrupt modes supported
+ // bit[0] = dual 8259
+ // bit[1] = I/O APIC
+ // bit[2] = I/O SAPIC
+ // bit[3..7] = Reserved, must be 0
+ UINT8 Irq; //53 PIC mode IRQ for this serial port
+ UINT32 GlobalSystemInt; //54..57 (S)APIC mode IRQ for this serial port
+ UINT8 BaudRate; //58 Baud Rate of this serial port
+ // 3 = 9600
+ // 4 = 19200
+ // 6 = 57600
+ // 7 = 115200
+ UINT8 Parity; //59 0 = No Parity
+ UINT8 StopBits; //60 1 = 1 Stop Bit
+ UINT8 FlowControl; //61 Flow Control
+ // bit[0] = DCD Required
+ // bit[1] = RTS/CTS
+ // bit[2] = XON/XOFF
+ // bit[3..7] = Reserved, must be 0
+ UINT8 TerminalType; //62 Terminal Protocol
+ // 0 = VT100
+ // 1 = VT100+
+ // 2 = VT-UTF8
+ // 3 = ANSI
+ UINT8 Reserved1; //63 Must be 0
+ UINT16 PciDeviceId; //64 Must be 0xFFFF if not a PCI Device
+ UINT16 PciVendorId; //66 Must be 0xFFFF if not a PCI Device
+ UINT8 PciBusNumber; //68 Must be 0 if not a PCI Device
+ UINT8 PciDeviceNumber; //69 Must be 0 if not a PCI Device
+ UINT8 PciFunctionNumber; //70 Must be 0 if not a PCI Device
+ UINT32 PciFlags; //71 Must be 0 if not a PCI Device
+ UINT8 PciSegment; //75 For systems with less than 255 PCI Busses, this must be 0
+ UINT32 Reserved4; //76 Must be 0
+
+}SPCR_20,*PSPCR_20;
+
+//-------------------------------------------------------
+//Additional MCFG TAble
+
+typedef struct _MCFG_20 {
+ ACPI_HDR Header; //0..35
+ UINT64 Reserved; //Bits 1-31 are reserved in ACPI 2.0
+ UINT64 BaseAddr; //Base address of 256MB extended config space
+ UINT16 PciSeg; //Segment # of PCI Bus
+ UINT8 StartBus; //Start bus number of PCI segment
+ UINT8 EndBus; //End bus number of PCI segment
+ UINT32 Reserved1; //Reserved DWORD
+} MCFG_20;
+
+
+
+
+//-------------------------------------------------------
+//Additional HPET Table and data structures forit
+typedef union _HPET_CAP_BLK {
+ UINT32 TMR_BLK_ID;
+ struct {
+ UINT32 HwRevId : 8; //0..7
+ UINT32 BlkTmrNum : 5; //8..12 Number of Timers In this Block
+ UINT32 Cntr64Bit : 1; //13
+ UINT32 Reserved : 1; //14
+ UINT32 LegacyRout : 1; //15
+ UINT32 VendorID : 16; //16..32
+ };
+} HPET_CAP_BLK;
+
+typedef struct _HPET_20 {
+ ACPI_HDR Header; //0..35
+ HPET_CAP_BLK EvtTmrBlockId;
+ GAS_20 BaseAddress;
+ UINT8 HpetNumber;
+ UINT16 MinTickPeriod;
+ UINT8 PageProtOem;
+} HPET_20;
+
+#pragma pack(pop)
+
+#endif
+
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2005, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
diff --git a/Include/ACPI30.H b/Include/ACPI30.H
new file mode 100644
index 0000000..b6d0068
--- /dev/null
+++ b/Include/ACPI30.H
@@ -0,0 +1,156 @@
+#ifndef _ACPI30H //To Avoid this header get compiled twice
+#define _ACPI30H
+
+#include <Efi.h>
+#include <Token.h>
+#include <Acpi20.h>
+
+#pragma pack(1)
+
+typedef struct _GAS_30 {
+ UINT8 AddrSpcID; //The address space where the data structure or register exists.
+ //Defined values are above
+ UINT8 RegBitWidth; //The size in bits of the given register.
+ //When addressing a data structure, this field must be zero.
+ UINT8 RegBitOffs; //The bit offset of the given register at the given address.
+ //When addressing a data structure, this field must be zero.
+ UINT8 AccessSize;
+ UINT64 Address; //The 64-bit address of the data structure or register in
+ //the given address space (relative to the processor).
+} GAS_30,*PGAS_30;
+
+
+//======================================================
+// FADT Fixed ACPI Description Table
+//======================================================
+typedef struct _FACP_30 {
+ ACPI_HDR Header; //0..35
+ UINT32 FIRMWARE_CTRL; //36 Phisical memory address (0-4G) of FACS
+ UINT32 DSDT; //40 Phisical memory address (0-4G) of DSDT
+ UINT8 Reserved1; //44 (Was INT_MODEL 0 Dual PIC;1 Multipy APIC)
+ // can be 0 or 1 for ACPI 1.0
+ UINT8 PM_PPROF; //45 Preffered PM Profile (was Reserved)
+ UINT16 SCI_INT; //46 SCI int Pin should be Shareble/Level/Act Low
+
+ UINT32 SMI_CMD; //48 Port Addr of ACPI Command reg
+ UINT8 ACPI_ENABLE_CMD; //52 Value to write in SMI_CMD reg
+ UINT8 ACPI_DISABLE_CMD; //53 Value to write in SMI_CMD reg
+ UINT8 S4BIOS_REQ; //54 Value to write in SMI_CMD reg
+ UINT8 PSTATE_CNT; //55 Was Reserved2 now
+ // Value that OSPM writes in SCI_CMD to assume
+ // Processor Perfomance State control responsibility
+ UINT32 PM1a_EVT_BLK; //56
+ UINT32 PM1b_EVT_BLK; //60
+ UINT32 PM1a_CNT_BLK; //64
+ UINT32 PM1b_CNT_BLK; //68
+ UINT32 PM2_CNT_BLK; //72
+ UINT32 PM_TMR_BLK; //76
+ UINT32 GPE0_BLK; //80
+ UINT32 GPE1_BLK; //84
+ UINT8 PM1_EVT_LEN; //88
+ UINT8 PM1_CNT_LEN; //89
+ UINT8 PM2_CNT_LEN; //90
+ UINT8 PM_TM_LEN; //91
+ UINT8 GPE0_BLK_LEN; //92
+ UINT8 GPE1_BLK_LEN; //93
+ UINT8 GPE1_BASE; //94
+ UINT8 CST_CNT; //95 Was Reserved3
+ UINT16 P_LVL2_LAT; //96
+ UINT16 P_LVL3_LAT; //98
+ UINT16 FLUSH_SIZE; //100
+ UINT16 FLUSH_STRIDE; //102
+ UINT8 DUTY_OFFSET; //104
+ UINT8 DUTY_WIDTH; //105
+ UINT8 DAY_ALRM; //106
+ UINT8 MON_ALRM; //107
+ UINT8 CENTURY; //108
+ UINT16 IAPC_BOOT_ARCH; //109
+ UINT8 Reserved2; //111
+ UINT32 FLAGS; //112
+//That was 32 bit part of a FADT Here follows 64bit part
+ GAS_30 RESET_REG; //116
+ UINT8 RESET_VAL; //128
+ UINT8 Reserved[3]; //129
+ UINT64 X_FIRMWARE_CTRL; //132 Phisical memory address (0-4G) of FACS
+ UINT64 X_DSDT; //140 Phisical memory address (0-4G) of DSDT
+ GAS_30 X_PM1a_EVT_BLK; //148
+ GAS_30 X_PM1b_EVT_BLK; //160
+ GAS_30 X_PM1a_CNT_BLK; //172
+ GAS_30 X_PM1b_CNT_BLK; //184
+ GAS_30 X_PM2_CNT_BLK; //196
+ GAS_30 X_PM_TMR_BLK; //208
+ GAS_30 X_GPE0_BLK; //220
+ GAS_30 X_GPE1_BLK; //232
+}FACP_30,*PFACP_30;
+
+
+//======================================================
+// SPCR Serial Port Console Redirection Table
+//======================================================
+typedef struct _SPCR_30 {
+ ACPI_HDR Header; //0..35
+ UINT8 InterfaceType; //36 0/1 16550/16450 interface type
+ UINT8 Reserved[3]; //37..39 Reserved
+ GAS_30 BaseAddress; //40..51 Address of the redirection serial port
+ UINT8 InterruptType; //52 System Interrupt modes supported
+ // bit[0] = dual 8259
+ // bit[1] = I/O APIC
+ // bit[2] = I/O SAPIC
+ // bit[3..7] = Reserved, must be 0
+ UINT8 Irq; //53 PIC mode IRQ for this serial port
+ UINT32 GlobalSystemInt; //54..57 (S)APIC mode IRQ for this serial port
+ UINT8 BaudRate; //58 Baud Rate of this serial port
+ // 3 = 9600
+ // 4 = 19200
+ // 6 = 57600
+ // 7 = 115200
+ UINT8 Parity; //59 0 = No Parity
+ UINT8 StopBits; //60 1 = 1 Stop Bit
+ UINT8 FlowControl; //61 Flow Control
+ // bit[0] = DCD Required
+ // bit[1] = RTS/CTS
+ // bit[2] = XON/XOFF
+ // bit[3..7] = Reserved, must be 0
+ UINT8 TerminalType; //62 Terminal Protocol
+ // 0 = VT100
+ // 1 = VT100+
+ // 2 = VT-UTF8
+ // 3 = ANSI
+ UINT8 Reserved1; //63 Must be 0
+ UINT16 PciDeviceId; //64 Must be 0xFFFF if not a PCI Device
+ UINT16 PciVendorId; //66 Must be 0xFFFF if not a PCI Device
+ UINT8 PciBusNumber; //68 Must be 0 if not a PCI Device
+ UINT8 PciDeviceNumber; //69 Must be 0 if not a PCI Device
+ UINT8 PciFunctionNumber; //70 Must be 0 if not a PCI Device
+ UINT32 PciFlags; //71 Must be 0 if not a PCI Device
+ UINT8 PciSegment; //75 For systems with less than 255 PCI Busses, this must be 0
+ UINT32 Reserved4; //76 Must be 0
+
+}SPCR_30,*PSPCR_30;
+
+typedef struct _HPET_30 {
+ ACPI_HDR Header; //0..35
+ HPET_CAP_BLK EvtTmrBlockId;
+ GAS_30 BaseAddress;
+ UINT8 HpetNumber;
+ UINT16 MinTickPeriod;
+ UINT8 PageProtOem;
+} HPET_30;
+
+#pragma pack()
+
+#endif
+
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2005, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
diff --git a/Include/ACPI50.h b/Include/ACPI50.h
new file mode 100644
index 0000000..56a2dd2
--- /dev/null
+++ b/Include/ACPI50.h
@@ -0,0 +1,208 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2010, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/BIN/Core/Include/ACPI50.h 3 6/11/12 4:24p Oleksiyy $
+//
+// $Revision: 3 $
+//
+// $Date: 6/11/12 4:24p $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Core/Include/ACPI50.h $
+//
+// 3 6/11/12 4:24p Oleksiyy
+// [TAG] EIP88889
+// [Category] Improvement
+// [Description] FACP ver 5.0 structure added.
+// [Files] ACPI50.h, AcpiCore.c
+//
+// 2 12/01/11 2:54p Oleksiyy
+// [TAG] EIP76919
+// [Category] Bug Fix
+// [Severity] Normal
+// [Symptom] ACPI Performance Table is in incorrect location due to
+// compiler assumption
+// [RootCause] Structure alligment.
+// [Solution] pragma pack added to structure declaration.
+// [Files] ACPI50.h
+//
+// 1 11/11/11 4:10p Oleksiyy
+// [TAG] EIP64296
+// [Category] New Feature
+// [Description] Creation and filling of Firmware Performance Data Table
+// is added. FirmPerfDataTab.h renamed to ACPI50.h
+// [Files] AcpiCore.c, EfiLib.c, S3Resume.c and ACPI50.h added.
+//
+// 6 1/13/10 2:13p Felixp
+//
+//**********************************************************************
+//<AMI_FHDR_START>
+//
+// Name: <ACPI50.h>
+//
+// Description: Defenitions introduced in ACPI 5.0
+//
+//<AMI_FHDR_END>
+//**********************************************************************
+#ifndef __ACPI50__H__
+#define __ACPI50__H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+#include <ACPI30.h>
+#pragma pack(push, 1)
+#define FPDT_SIG 0x54445046 //"FPDT" Firmware Performance Data Table
+#define EFI_FPDT_VARIABLE L"FPDT_Variable"
+
+typedef struct _EFI_FPDT_STRUCTURE {
+ EFI_PHYSICAL_ADDRESS S3Pointer;
+ EFI_PHYSICAL_ADDRESS BasBootPointer;
+ UINT64 NanoFreq;
+} EFI_FPDT_STRUCTURE;
+
+typedef struct _FPDT_PERF_RECORD {
+ UINT16 PerfRecType; //0
+ UINT8 Length; //2
+ UINT8 Revision; //3
+ UINT32 Reserved; //4
+ EFI_PHYSICAL_ADDRESS Pointer; //8
+} FPDT_PERF_RECORD,*PFPDT_PERF_RECORD;
+
+typedef struct _FPDT_50 {
+ ACPI_HDR Header;
+ FPDT_PERF_RECORD BasS3Rec;
+ FPDT_PERF_RECORD BasBootRec;
+} FPDT_50,*PFPDT_50;
+
+typedef struct _PERF_TAB_HEADER {
+ UINT32 Signature; //0
+ UINT32 Length; //4
+} PERF_TAB_HEADER,*PPERF_TAB_HEADER;
+
+typedef struct _PERF_REC_HEADER {
+ UINT16 PerfRecType; //0
+ UINT8 RecLength; //2
+ UINT8 Revision; //3
+} PERF_REC_HEADER,*PPERF_REC_HEADER;
+
+typedef struct _BASIC_S3_RESUME_PERF_REC {
+ PERF_REC_HEADER Header; //0
+ UINT32 ResumeCount; //4
+ UINT64 FullResume; //8
+ UINT64 AverageResume; //16
+} BASIC_S3_RESUME_PERF_REC,*PBASIC_S3_RESUME_PERF_REC;
+
+typedef struct _BASIC_S3_SUSPEND_PERF_REC {
+ PERF_REC_HEADER Header; //0
+ UINT64 SuspendStart; //4
+ UINT64 SuspendEnd; //12
+} BASIC_S3_SUSPEND_PERF_REC,*PBASIC_S3_SUSPEND_PERF_REC;
+
+typedef struct _BASIC_BOOT_PERF_REC {
+ PERF_REC_HEADER Header; //0
+ UINT32 Reserved; //4
+ UINT64 ResetEnd; //8
+ UINT64 OsLoaderLoadImageStart; //16
+ UINT64 OsLoaderStartImageStart; //24
+ UINT64 ExitBootServicesEntry; //32
+ UINT64 ExitBootServicesExit; //40
+} BASIC_BOOT_PERF_REC,*PBASIC_BOOT_PERF_REC;
+
+//======================================================
+// FADT Fixed ACPI Description Table
+//======================================================
+typedef struct _FACP_50 {
+ ACPI_HDR Header; //0..35
+ UINT32 FIRMWARE_CTRL; //36 Phisical memory address (0-4G) of FACS
+ UINT32 DSDT; //40 Phisical memory address (0-4G) of DSDT
+ UINT8 Reserved1; //44 (Was INT_MODEL 0 Dual PIC;1 Multipy APIC)
+ // can be 0 or 1 for ACPI 1.0
+ UINT8 PM_PPROF; //45 Preffered PM Profile (was Reserved)
+ UINT16 SCI_INT; //46 SCI int Pin should be Shareble/Level/Act Low
+
+ UINT32 SMI_CMD; //48 Port Addr of ACPI Command reg
+ UINT8 ACPI_ENABLE_CMD; //52 Value to write in SMI_CMD reg
+ UINT8 ACPI_DISABLE_CMD; //53 Value to write in SMI_CMD reg
+ UINT8 S4BIOS_REQ; //54 Value to write in SMI_CMD reg
+ UINT8 PSTATE_CNT; //55 Was Reserved2 now
+ // Value that OSPM writes in SCI_CMD to assume
+ // Processor Perfomance State control responsibility
+ UINT32 PM1a_EVT_BLK; //56
+ UINT32 PM1b_EVT_BLK; //60
+ UINT32 PM1a_CNT_BLK; //64
+ UINT32 PM1b_CNT_BLK; //68
+ UINT32 PM2_CNT_BLK; //72
+ UINT32 PM_TMR_BLK; //76
+ UINT32 GPE0_BLK; //80
+ UINT32 GPE1_BLK; //84
+ UINT8 PM1_EVT_LEN; //88
+ UINT8 PM1_CNT_LEN; //89
+ UINT8 PM2_CNT_LEN; //90
+ UINT8 PM_TM_LEN; //91
+ UINT8 GPE0_BLK_LEN; //92
+ UINT8 GPE1_BLK_LEN; //93
+ UINT8 GPE1_BASE; //94
+ UINT8 CST_CNT; //95 Was Reserved3
+ UINT16 P_LVL2_LAT; //96
+ UINT16 P_LVL3_LAT; //98
+ UINT16 FLUSH_SIZE; //100
+ UINT16 FLUSH_STRIDE; //102
+ UINT8 DUTY_OFFSET; //104
+ UINT8 DUTY_WIDTH; //105
+ UINT8 DAY_ALRM; //106
+ UINT8 MON_ALRM; //107
+ UINT8 CENTURY; //108
+ UINT16 IAPC_BOOT_ARCH; //109
+ UINT8 Reserved2; //111
+ UINT32 FLAGS; //112
+//That was 32 bit part of a FADT Here follows 64bit part
+ GAS_30 RESET_REG; //116
+ UINT8 RESET_VAL; //128
+ UINT8 Reserved[3]; //129
+ UINT64 X_FIRMWARE_CTRL; //132 Phisical memory address (0-4G) of FACS
+ UINT64 X_DSDT; //140 Phisical memory address (0-4G) of DSDT
+ GAS_30 X_PM1a_EVT_BLK; //148
+ GAS_30 X_PM1b_EVT_BLK; //160
+ GAS_30 X_PM1a_CNT_BLK; //172
+ GAS_30 X_PM1b_CNT_BLK; //184
+ GAS_30 X_PM2_CNT_BLK; //196
+ GAS_30 X_PM_TMR_BLK; //208
+ GAS_30 X_GPE0_BLK; //220
+ GAS_30 X_GPE1_BLK; //232
+ GAS_30 SLEEP_CONTROL_REG; //244
+ GAS_30 SLEEP_STATUS_REG; //256
+
+}FACP_50,*PFACP_50;
+
+#pragma pack(pop)
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2010, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
diff --git a/Include/AMICSPLib.h b/Include/AMICSPLib.h
new file mode 100644
index 0000000..7fe4932
--- /dev/null
+++ b/Include/AMICSPLib.h
@@ -0,0 +1,97 @@
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2008, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/BIN/Chipset/Template/CSPLibrary/AMICSPLib.h 5 2/22/11 4:25p Artems $
+//
+// $Revision: 5 $
+//
+// $Date: 2/22/11 4:25p $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Chipset/Template/CSPLibrary/AMICSPLib.h $
+//
+// 5 2/22/11 4:25p Artems
+// EIP 51548 - Added AMI copyright headers, replaced TABs with spaces
+//
+// 4 2/22/11 4:22p Artems
+// EIP 51548 - Added AMI copyright headers, replaced TABs with spaces
+//
+// 3 6/11/09 5:55p Robert
+// CHM and coding standard update
+//
+// 2 9/27/05 3:20p Sivagarn
+// Included the macro "CSP_PCI_CFG_ADDRESS"
+//
+// 1 1/21/05 12:46p Sivagarn
+// Initial Checkin - Version 0.05
+//
+//**********************************************************************
+
+//<AMI_FHDR_START>
+//----------------------------------------------------------------------------
+//
+// Name: AmiCspLib.h
+//
+// Description:
+// This file contains generic code to add functionality that can be used
+// by any module.
+//
+//----------------------------------------------------------------------------
+//<AMI_FHDR_END>
+
+#ifndef __AMICSPLIB__H__
+#define __AMICSPLIB__H__
+
+#include <AmiCSPLibInc.H>
+
+//<AMI_PHDR_START>
+//----------------------------------------------------------------------------
+// Name: CSP_PCI_CFG_ADDRESS
+//
+// Description:
+// This MACRO Converts bus, device function and register number into 64bit
+// PCI configuration address
+//
+// Input:
+// bus - PCI bus where the device resides
+// dev - PCI device number to access
+// func - function number of the device being accessed
+// reg - PCI register of the function being accessed
+//
+// Notes:
+//
+//----------------------------------------------------------------------------
+//<AMI_PHDR_END>
+#define CSP_PCI_CFG_ADDRESS(bus,dev,func,reg) \
+ ((UINT64) ( (((UINTN)bus) << 24) + (((UINTN)dev) << 16) + (((UINTN)func) << 8) + ((UINTN)reg) ))& 0x00000000ffffffff
+
+
+
+#endif // __AMICSPLIB__H__
+
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2008, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//************************************************************************* \ No newline at end of file
diff --git a/Include/AMIVfr.h b/Include/AMIVfr.h
new file mode 100644
index 0000000..b513a77
--- /dev/null
+++ b/Include/AMIVfr.h
@@ -0,0 +1,682 @@
+//*****************************************************************//
+//*****************************************************************//
+//*****************************************************************//
+//** **//
+//** (C)Copyright 2014, American Megatrends, Inc. **//
+//** **//
+//** All Rights Reserved. **//
+//** **//
+//** 5555 Oakbrook Pkwy, Building 200,Norcross, Georgia 30093 **//
+//** **//
+//** Phone (770)-246-8600 **//
+//** **//
+//*****************************************************************//
+//*****************************************************************//
+//*****************************************************************//
+// $Archive: /Alaska/BIN/Modules/AMITSE2_0/AMITSE/Include/AMIVfr.h $
+//
+// $Author: Arunsb $
+//
+// $Revision: 24 $
+//
+// $Date: 5/08/14 9:11p $
+//
+//*****************************************************************//
+//*****************************************************************//
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Modules/AMITSE2_0/AMITSE/Include/AMIVfr.h $
+//
+// 24 5/08/14 9:11p Arunsb
+// EIP122164 changes reverted since the EIP is not generic.
+//
+// 23 5/02/14 5:10p Premkumara
+// [TAG] EIP162197
+// [Category] Improvement
+// [Description] Password encode feature modify to encode using Hashing
+// based on token.
+// [[Files] Password.c, PasswordEncodeBin.cif, AMITSE.cif,
+// TSESource.cif, PasswordEncode.c, PasswordEncode.h, AMITSE.sdl,
+// PasswordEncodeBin.mak, PasswordEncodeBin.sdl
+// AMIVfr.h, Boot.c
+//
+// 22 5/02/14 6:58a Premkumara
+// [TAG] EIP137373
+// [Category] Improvement
+// [Description] Added signal event for BeforeTimeOut and AfterTimeOut
+// with guids
+// [Files] AMIVfr.h,protocol.c
+//
+// 21 5/02/14 2:17a Arunsb
+// [TAG] EIP158989
+// [Category] Bug Fix
+// [Severity] Normal
+// [Symptom] BGRT status bit not cleared with Shell v2.0
+// [RootCause] Shell v2.0 protocol not registered
+// [Solution] Shell v2.0 protocol registered and cleared the BGRT status
+// bit
+// [Files] AMIVfr.h and boot.c
+//
+// 20 2/11/14 7:31p Arunsb
+// Changes reverted for 2.16.1243 label
+//
+// 19 1/30/14 3:21a Premkumara
+// [TAG] EIP122164
+// [Category] Improvement
+// [Description] Struct IDE_SECURITY_CONFIG added for IDE security
+// module
+// [Files] AMIVfr.h
+//
+// 18 1/22/14 10:53a Premkumara
+// [TAG] EIP148071
+// [Category] Improvement
+// [Description] Changed Path[1] to Path[120] in NEW_BOOT_OPTION struct
+// [Files] AMIVfr.h
+//
+// 17 12/04/13 2:44p Arunsb
+// [TAG] EIP125219
+// [Category] Improvement
+// [Description] Add event at end of BootFlowManageExit() after second
+// boot path
+// [Files] bootflow.c, AMIVfr.h
+//
+// 16 11/07/13 1:56a Premkumara
+// [TAG] EIP-137373
+// [Category] Improvement
+// [Description] Added signal event for BeforeTimeOut and AfterTimeOut
+// with GUID
+// [Files] Protocol.c, AMIVfr.h
+//
+// 15 12/01/12 6:48a Premkumara
+// [TAG] EIP105725
+// [Category] Bug Fix
+// [Severity] Important
+// [Symptom] Setup hangs on BBS Menu having string more than 200
+// characters
+// [RootCause] File path string is not handled properly
+// [Solution] Handled FilePath strings based on length of string and
+// allocate memory based on length dynamically
+// [Files] AddBootOption.c, AMIVfr.h
+//
+// 14 10/18/12 5:44a Arunsb
+// Updated for 2.16.1235 QA submission
+//
+// 7 10/10/12 12:24p Arunsb
+// Synched the source for v2.16.1232 backup with Aptio
+//
+// 12 9/25/12 12:28p Rajashakerg
+// [TAG] EIP92053
+// [Category] Improvement
+// [Description] Need support define Root page order using elinks
+// [Files] AMITSE.sdl, Menu.c, AMIVfr.h, AMITSE.mak, commonoem.c
+//
+// 11 9/25/12 9:30a Rajashakerg
+// [TAG] EIP92053
+// [Category] Improvement
+// [Description] Need support define Root page order using elinks
+// [Files] AMITSE.sdl, Menu.c, AMIVfr.h, AMITSE.mak, commonoem.c
+//
+// 10 1/30/12 3:30a Arunsb
+// [TAG] EIP74676
+// [Category] Improvement
+// [Description] Setup.ini and Upfisetup.ini to reserve 3~5 variable and
+// GUID for porting purpose
+// [Files] Amivfr.h, special.h, variable.h, Uefisetup.ini and setup.ini
+//
+// 9 1/30/12 1:24a Arunsb
+// [TAG] EIP74676
+// [Category] Improvement
+// [Description] Setup.ini and Upfisetup.ini to reserve 3~5 variable and
+// GUID for porting purpose
+// [Files] Amivfr.h, special.h, variable.h, Uefisetup.ini and setup.ini
+//
+// 8 11/13/11 1:14p Arunsb
+// [TAG] EIP70421
+// [Category] New Feature
+// [Description] Support for driver order in TSE
+// [Files] AMITSE.SDL, CommonHelper.c, setup.ini, uefisetup.ini,
+// boot.c,
+// minisetup.h, bbs.c, special.c, special.h, tseadvanced.c,
+// addbootoption.c,
+// callback.c, minisetupext.c, minisetupext.h, popupsel.c, popupsel.h,
+// TseLitehelper.c, variable.c, Uefi21Wapper.c, AMIVfr.h, boot.h,
+// TseElink.h, variable.h,
+// setup.h, Boot.vfr and Setup.uni
+//
+// 7 6/30/11 4:06a Arunsb
+// [TAG] EIP57661
+// [Category] New Feature
+// [Description] Boot manager algorithm for interaction with Driver
+// Health protocol.
+// Added driver health structures for vfr.
+// [Files] amitse.cif, amitse.sdl, faketokens.c, amitsestr.uni,
+// commonhelper.c, uefisetup.ini, tsedrvhealth.h,
+// amivfr.h, minisetupbin.mak,
+// hiistring21.c, hiistring20.c, tseadvanced.c, special.c,
+// special.h, boot.h, minisetup.h,
+// uefi20wapper.c, formbrowser2.c, hii.c, parse.c and
+// uefi21wapper.c.
+//
+// 6 3/23/11 8:37p Blaines
+// [TAG] - EIP 23601
+// [Category]- Enhancement
+// [Symptom]- Add support for OEM special controls.
+// [Files] - AmiTse.sdl, CommonHelper.c, Setup.ini, UefiSetup.ini,
+// AmiVfr.h, minisetup.h, minisetup.sdl, variable.c, special.c
+//
+// 5 2/11/11 4:43p Madhans
+// [TAG] EIP53146
+// [Category] New Feature
+// [Description] Add the support to Move the Dynamic IFR Pages under
+// subpages. It should be customizable to move around.
+//
+// [Files] AMITSE.sdl, CommonHelper.c, setup.ini, Uefisetup.ini,
+// setupdata.h, special.c,
+// special.h,minisetupext.c,minisetupext.h,UEFI20\hii.c,UEFI2.1\Hii.c,Pars
+// e.c,AMIVfr.h
+//
+// 4 12/28/10 6:05p Mallikarjunanv
+// [TAG] EIP41615
+// [Category] New Feature
+// [Description] Added the file browser support for the Add boot option
+// reated controls
+// [Files] AmiVfr.h, AmiTse.sdl, AmiTseStr.uni, CommonHelper.c,
+// Faketokens.c, TseElinks.h, EdkHelper.h, minisetup.h, TseAdvanced.c,
+// AddBootOption.c
+//
+// 3 2/19/10 12:59p Madhans
+// Updated for TSE 2.01. Refer Changelog.log for File change history.
+//
+// 4 2/19/10 8:03a Mallikarjunanv
+// updated year in copyright message
+//
+// 3 1/09/10 2:40a Mallikarjunanv
+// Updated TSE2.01 Release sources with coding standards
+//
+// 2 6/24/09 6:33p Madhans
+// Coding Standards.
+//
+// 1 6/04/09 7:49p Madhans
+// AMI TSE Advanced.
+//
+// 1 4/28/09 10:50p Madhans
+// Tse 2.0 Code complete Checkin.
+//
+// 1 4/28/09 10:25p Madhans
+// Tse 2.0 Code complete Checkin.
+//
+// 2 1/30/09 6:06p Madhans
+// Function headers added.
+//
+//
+//*****************************************************************//
+//*****************************************************************//
+//<AMI_FHDR_START>
+//----------------------------------------------------------------------------
+//
+// Name: AMIVfr.h
+//
+// Description: VFR related header
+//
+//----------------------------------------------------------------------------
+//<AMI_FHDR_END>
+
+#ifndef _AMI_VFR_H_
+#define _AMI_VFR_H_
+
+#ifndef EFI_GLOBAL_VARIABLE_GUID
+#define EFI_GLOBAL_VARIABLE_GUID \
+ { 0x8BE4DF61, 0x93CA, 0x11D2, 0xAA, 0x0D, 0x00, 0xE0, 0x98, 0x03, 0x2B, 0x8C }
+#endif
+
+#define SYSTEM_ACCESS_GUID \
+ { 0xE770BB69, 0xBCB4, 0x4D04, 0x9E, 0x97, 0x23, 0xFF, 0x94, 0x56, 0xFE, 0xAC }
+
+#define LEGACY_DEV_ORDER_GUID \
+ { 0xA56074DB, 0x65FE, 0x45F7, 0xBD, 0x21, 0x2D, 0x2B, 0xDD, 0x8E, 0x96, 0x52 }
+
+#define BOOT_MANAGER_GUID \
+ { 0xB4909CF3, 0x7B93, 0x4751, 0x9B, 0xD8, 0x5B, 0xA8, 0x22, 0x0B, 0x9B, 0xB2 }
+
+#define BOOT_NOW_COUNT_GUID \
+ { 0x052e6eb0, 0xf240, 0x42c5, 0x83, 0x09, 0x45, 0x87, 0x45, 0x45, 0xc6, 0xb4 }
+
+#define AMI_CALLBACK_GUID \
+ { 0x9CF0F18E, 0x7C7D, 0x49DE, 0xB5, 0xAA, 0xBB, 0xBA, 0xD6, 0xB2, 0x10, 0x07 }
+
+#define ERROR_MANAGER_GUID \
+ { 0xADDEBF82, 0xA560, 0x46B9, 0xA2, 0x80, 0x78, 0xC6, 0xAB, 0x61, 0xAE, 0xDA }
+
+#define DEL_BOOT_OPTION_GUID \
+ { 0xF6C73719, 0xF34C, 0x479C, 0xB3, 0x2F, 0x27, 0x7F, 0xCB, 0xBC, 0xFE, 0x4F }
+
+#define ADD_BOOT_OPTION_GUID \
+ { 0x19d96d3f, 0x6a6a, 0x47d2, 0xb1, 0x95, 0x7b, 0x24, 0x32, 0xda, 0x3b, 0xe2 }
+
+#define USER_DEFAULTS_GUID \
+ { 0xC4CC0DE8, 0x0687, 0x4422, 0x99, 0xC1, 0x65, 0x35, 0x1A, 0x5D, 0x5F, 0x95 }
+
+#ifndef EFI_SHELL_FILE_GUID
+#define EFI_SHELL_FILE_GUID \
+ { 0xc57ad6b7, 0x0515, 0x40a8, 0x9d, 0x21, 0x55, 0x16, 0x52, 0x85, 0x4e, 0x37 }
+#endif
+
+#ifndef EFI_SHELL2_0_FILE_GUID
+#define EFI_SHELL2_0_FILE_GUID \
+ { 0x6302d008, 0x7f9b, 0x4f30, 0x87, 0xac, 0x60, 0xc9, 0xfe, 0xf5, 0xda, 0x4e }
+#endif
+#define AMITSESETUP_GUID \
+ { 0xc811fa38, 0x42c8, 0x4579, 0xa9, 0xbb, 0x60, 0xe9, 0x4e, 0xdd, 0xfb, 0x34 }
+
+#define IDE_SECURITY_CONFIG_GUID \
+ { 0x3dd0de67, 0x2d7, 0x4129, 0x91, 0x4a, 0x9f, 0x37, 0x7c, 0xc3, 0x4b, 0xd}
+
+// TSE Notifications in single place.
+// These #define removed from setup.h and minisetup.h.
+#define AMITSE_SETUP_ENTER_GUID \
+ { 0x71202EEE, 0x5F53, 0x40d9, 0xAB, 0x3D, 0x9E, 0x0C, 0x26, 0xD9, 0x66, 0x57 }
+
+#define AMITSE_AFTER_FIRST_BOOT_OPTION_GUID \
+ { 0xC48D651C, 0x9D0E, 0x4ce7, 0xAD, 0x39, 0xED, 0xD1, 0xAB, 0x83, 0x6B, 0x30 }
+
+
+// {1CBFC9B6-7F1E-4e9e-801F-FBCE4D92A76D}
+#define AMITSE_BEFORE_TIMEOUT_GUID \
+ { 0x1cbfc9b6, 0x7f1e, 0x4e9e, 0x80, 0x1f, 0xfb, 0xce, 0x4d, 0x92, 0xa7, 0x6d }
+
+// {CAD40D6E-C871-4398-910D-2D74EE94711A}
+#define AMITSE_AFTER_TIMEOUT_GUID \
+ { 0xcad40d6e, 0xc871, 0x4398, 0x91, 0xd, 0x2d, 0x74, 0xee, 0x94, 0x71, 0x1a }
+
+
+// {3677770F-EFB2-43b2-B8AE-B302E9604882}
+#define AMITSE_EVENT_BEFORE_BOOT_GUID \
+ { 0x3677770f, 0xefb2, 0x43b2, 0xb8, 0xae, 0xb3, 0x2, 0xe9, 0x60, 0x48, 0x82 }
+
+// {8c12A959-70BC-4362-B437-bBB80514A1916E}
+#define AMITSE_EVENT_AFTER_BOOT_GUID \
+ {0x8c12a959, 0x70bc, 0x4362, 0xb4, 0x37, 0xb8, 0x05, 0x14, 0xa1, 0x91, 0x6e}
+
+// {1B6BC809-C986-4937-934F-1EA58622FE50}
+#define AMITSE_BOOT_ORDER_CHANGE_GUID \
+{ 0x1b6bc809, 0xc986, 0x4937, 0x93, 0x4f, 0x1e, 0xa5, 0x86, 0x22, 0xfe, 0x50 }
+
+// {D84BEFF0-159A-4b60-9AB9-AC5C474BD3B1}
+#define AMITSE_NVRAM_UPDATE_GUID \
+{ 0xd84beff0, 0x159a, 0x4b60, 0x9a, 0xb9, 0xac, 0x5c, 0x47, 0x4b, 0xd3, 0xb1 }
+
+// {073E7E01-2611-4e85-B896-A3B6767CBA00}
+#define AMITSE_PASSWORD_PROMPT_ENTER_GUID \
+{ 0x73e7e01, 0x2611, 0x4e85, 0xb8, 0x96, 0xa3, 0xb6, 0x76, 0x7c, 0xba, 0x0 }
+
+// {B9B038B0-E2B6-4aab-9435-4165ECFED032}
+#define AMITSE_PASSWORD_PROMPT_EXIT_GUID \
+{ 0xb9b038b0, 0xe2b6, 0x4aab, 0x94, 0x35, 0x41, 0x65, 0xec, 0xfe, 0xd0, 0x32 }
+
+// {AB1404CA-4801-4208-98BF-30D521DAD4D3}
+#define AMITSE_USER_PASSWORD_VALID_GUID \
+{ 0xab1404ca, 0x4801, 0x4208, 0x98, 0xbf, 0x30, 0xd5, 0x21, 0xda, 0xd4, 0xd3 }
+
+// {541D5A75-95EE-43c7-9E5D-2394DC486249}
+#define AMITSE_ADMIN_PASSWORD_VALID_GUID \
+{ 0x541d5a75, 0x95ee, 0x43c7, 0x9e, 0x5d, 0x23, 0x94, 0xdc, 0x48, 0x62, 0x49 }
+
+// {D69240C0-DD40-4f2d-9863-4848DA6E615F}
+#define AMITSE_INVALID_PASSWORD_GUID \
+{ 0xd69240c0, 0xdd40, 0x4f2d, 0x98, 0x63, 0x48, 0x48, 0xda, 0x6e, 0x61, 0x5f }
+
+#define DYNAMIC_PAGE_COUNT_GUID \
+ { 0xb63bf800, 0xf267, 0x4f55, 0x92, 0x17, 0xe9, 0x7f, 0xb3, 0xb6, 0x98, 0x46 }
+
+//EIP 57661 Start
+// {0885F288-418C-4be1-A6AF-8BAD61DA08FE}
+#define AMITSE_DRIVER_HEALTH_ENB_GUID \
+ { 0x885f288, 0x418c, 0x4be1, 0xa6, 0xaf, 0x8b, 0xad, 0x61, 0xda, 0x8, 0xfe }
+
+// {7459A7D4-6533-4480-BBA7-79E25A4443C9}
+#define AMITSE_DRIVER_HEALTH_GUID \
+ { 0x7459a7d4, 0x6533, 0x4480, 0xbb, 0xa7, 0x79, 0xe2, 0x5a, 0x44, 0x43, 0xc9 }
+
+// {58279C2D-FB19-466e-B42E-CD437016DC25}
+#define AMITSE_DRIVER_HEALTH_CTRL_GUID \
+ { 0x58279c2d, 0xfb19, 0x466e, 0xb4, 0x2e, 0xcd, 0x43, 0x70, 0x16, 0xdc, 0x25 }
+//EIP 57661 End
+
+//EIP70421 & 70422 Support for Driver Order starts
+// {C0B4FB05-15E5-4588-9FE9-B3D39C067715}
+#define DRIVER_MANAGER_GUID \
+ { 0xc0b4fb05, 0x15e5, 0x4588, 0x9f, 0xe9, 0xb3, 0xd3, 0x9c, 0x6, 0x77, 0x15 }
+
+ // {17A3C5DA-F51F-437c-91B6-002B6F262593}
+#define DEL_DRIVER_OPTION_GUID \
+ { 0x17a3c5da, 0xf51f, 0x437c, 0x91, 0xb6, 0x0, 0x2b, 0x6f, 0x26, 0x25, 0x93}
+
+#define ADD_DRIVER_OPTION_GUID \
+ { 0x7df66c0f, 0xd40a, 0x4748, 0xac, 0x5a, 0x6c, 0xb, 0xea, 0x78, 0x6a, 0x1a}
+//EIP70421 & 70422 Support for Driver ends
+
+#define OEM_TSE_VAR_GUID \
+ { 0xF4B2C007, 0x94A1, 0x4cd5, 0xA7, 0x10, 0xf4, 0x14, 0x1f, 0xce, 0xbc, 0xA0 }
+
+//EIP74676 guids and variables for porting purpose starts
+//EDA2B104-7A10-4519-B0A1-EBA5C52ACFCE
+#define OEM_PORT_VARIABEL1 \
+ { 0xEDA2B104, 0x7A10, 0x4519, 0xB0, 0xA1, 0xEB, 0xA5, 0xC5, 0x2A, 0xCF, 0xCE }
+
+//EF402953-B819-4cc2-A44C-4C9B4CFBC889
+#define OEM_PORT_VARIABEL2 \
+ { 0xEF402953, 0xB819, 0x4CC2, 0xA4, 0x4C, 0x4C, 0x9B, 0x4C, 0xFB, 0xC8, 0x89 }
+
+//1D6F853E-0006-40d8-9B4B-79618A5733B0
+#define OEM_PORT_VARIABEL3 \
+ { 0x1D6F853E, 0x0006, 0x40d8, 0x9B, 0x4B, 0x79, 0x61, 0x8A, 0x57, 0x33, 0xB0 }
+
+//47E87E67-FBC0-4c01-9002-4A0A6ECB92FF
+#define OEM_PORT_VARIABEL4 \
+ { 0x47E87E67, 0xFBC0, 0x4c01, 0x90, 0x02, 0x4A, 0x0A, 0x6E, 0xCB, 0x92, 0xFF }
+
+//2799A453-FC10-4334-9E66-D3D6EF09D0EE
+#define OEM_PORT_VARIABEL5 \
+ { 0x2799A453, 0xFC10, 0x4334, 0x9E, 0x66, 0xD3, 0xD6, 0xEF, 0x09, 0xD0, 0xEE }
+
+#define OEM_PORT_GUID1 \
+ { 0xecfd4bce, 0x4279, 0x40f8, 0xba, 0xf2, 0xdc, 0xb7, 0x96, 0x38, 0xd4, 0x1e }
+
+#define OEM_PORT_GUID2 \
+ { 0x23f69cd0, 0xff46, 0x4db6, 0xb9, 0x82, 0x63, 0xed, 0xf1, 0xa9, 0x1, 0xff }
+//EIP74676 ends
+
+//{06449bc5-4494-4f8c-8773-1d2464c0e7ec}
+#define AMITSE_AFTER_LAST_BOOT_OPTION_GUID \
+ { 0x06449bc5, 0x4494, 0x4f8c, 0x87, 0x73, 0x1d, 0x24, 0x64, 0xc0, 0xe7, 0xec }
+
+#define EXIT_KEY_ID 0xF001
+#define AMI_CALLBACK_KEY_ID 0xF002
+#define BOOT_MANAGER_KEY_ID 0xF003
+#define BOOT_OPTIONS_KEY_ID 0xF004
+#define BOOT_TIMEOUT_KEY_ID 0xF005
+#define BOOT_ORDER_KEY_ID 0xF006
+#define LEGACY_DEV_KEY_ID 0xF007
+#define LEGACY_ORDER_KEY_ID 0xF008
+#define LANGUAGE_KEY_ID 0xF009
+#define LANGUAGE_CODES_KEY_ID 0xF00A
+#define EFI_SHELL_KEY_ID 0xF00B
+#define ERROR_MANAGER_KEY_ID 0xF00C
+#define NEW_BOOT_OPTION_KEY_ID 0xF00D
+#define DEL_BOOT_OPTION_KEY_ID 0xF00E
+#define USER_DEFAULTS_KEY_ID 0xF00F
+#define SYSTEM_ACCESS_KEY 0xF010
+#define ADMIN_PASSWORD_KEY 0xF011
+#define USER_PASSWORD_KEY 0xF012
+#define AMITSESETUP_KEY 0xF013
+#define BOOT_NOW_COUNT_KEY_ID 0xF014
+#define IDE_SECURITY_HD_1_KEY_ID 0xF015
+#define LEGACY_GROUP_KEY_ID 0xF016
+#define SETUP_SAVE_STATE_INFO_KEY_ID 0xF017
+#define DYNAMIC_PAGE_COUNT_KEY_ID 0xF018
+#define DRIVER_HEALTH_ENB_KEY_ID 0xF019
+#define DRIVER_HEALTH_KEY_ID 0xF020
+#define DRIVER_HEALTH_CTRL_KEY_ID 0xF021
+#define DRIVER_MANAGER_KEY_ID 0xF022 //EIP70421 & 70422 Support for Driver Order
+#define DRIVER_ORDER_KEY_ID 0xF023
+#define NEW_DRIVER_OPTION_KEY_ID 0xF024
+#define DEL_DRIVER_OPTION_KEY_ID 0xF025
+#define OEM_TSE_VAR_KEY_ID 0xF100
+
+#define SYSTEM_PASSWORD_ADMIN 0
+#define SYSTEM_PASSWORD_USER 1
+
+#define SAVE_AND_EXIT_VALUE 1
+#define DISCARD_AND_EXIT_VALUE 2
+#define SAVE_VALUE 3
+#define DISCARD_VALUE 4
+#define RESTORE_DEFAULTS_VALUE 5
+#define SAVE_USER_DEFAULTS_VALUE 6
+#define RESTORE_USER_DEFAULTS_VALUE 7
+#define SAVE_BOOT_OPTION 8
+#define SAVE_AND_RESET_VALUE 9
+#define DISCARD_AND_RESET_VALUE 10
+#define INTERACTIVE_TEXT_VALUE 11
+#define LAUNCH_FILE_PATH 12 // EIP-41615: releated to file browser support for add boot option.
+#define LAUNCH_FILE_PATH_DRIVER 13
+#define SAVE_DRIVER_OPTION 14 //EIP70421 & 70422 Support for Driver Order
+
+#define ADD_FORM_ID 0x2000
+#define DEL_FORM_ID 0x2001
+#define ADD_DRIVER_FORM_ID 0x2002 //EIP70421 & 70422 Support for Driver Order
+#define DEL_DRIVER_FORM_ID 0x2003
+
+#define HARD_DISK_ORDER_FORM 0x1000
+#define CDROM_ORDER_FORM 0x1001
+#define FLOPPY_DISK_ORDER_FORM 0x1002
+#define NETWORK_ORDER_FORM 0x1003
+#define BEV_ORDER_FORM 0x1004
+
+typedef struct
+{
+ UINT16 HardDiskCount;
+ UINT16 CDROMCount;
+ UINT16 FloppyCount;
+ UINT16 NetworkCount;
+ UINT16 BevCount;
+}
+LEGACY_DEV_LIST;
+
+#define SETUP_RESET_NOT_REQUIRED 0
+#define SETUP_SAVED_AND_RESET_REQUIRED 1
+
+#pragma pack(1)
+typedef struct
+{
+ UINT16 SetupSaveState;
+}
+SETUP_SAVE_STATE_INFO;
+
+
+typedef struct
+{
+ UINT16 GroupCount;
+}
+LEGACY_DEV_INFO;
+
+typedef struct
+{
+ UINT16 DeviceCount;
+}
+LEGACY_GROUP_INFO;
+
+typedef struct _SYSTEM_ACCESS
+{
+ UINT8 Access;
+}
+SYSTEM_ACCESS;
+
+typedef struct
+{
+ UINT16 BootCount;
+}
+BOOT_MANAGER;
+
+typedef struct{
+ UINT16 BootCount;
+} BOOT_NOW_COUNT;
+
+typedef struct
+{
+ UINT16 Option;
+}
+DEL_BOOT_OPTION;
+
+typedef struct
+{
+ UINT16 Value;
+}
+AMI_CALLBACK;
+
+typedef struct
+{
+ UINT16 Value;
+}
+TIMEOUT;
+
+typedef struct{
+ UINT16 Value;
+} BOOT_ORDER;
+
+typedef struct{
+ UINT16 Value;
+} LEGACY_DEV_ORDER;
+
+typedef struct
+{
+ UINT16 Value;
+}
+LANGUAGE;
+
+typedef struct
+{
+ UINT16 Value;
+}
+LANGUAGE_CODES;
+
+typedef struct
+{
+ UINT16 Value;
+}
+EFI_SHELL;
+
+typedef struct{
+ UINT16 PageCount;
+} DYNAMIC_PAGE_COUNT;
+
+typedef struct
+{
+ UINT16 Value;
+
+}OEMTSEVAR;
+
+//EIP 57661 Start
+typedef struct
+{
+ UINT16 Enable;
+}
+DRIVER_HEALTH_ENABLE;
+
+typedef struct
+{
+ UINT16 DrvHandleCount;
+}
+DRIVER_HEALTH;
+
+typedef struct //Number of controllers support driver health handle
+{
+ UINT16 DrvHealthCtrlCnt;
+}
+DRIVER_HEALTH_CTRL_COUNT;
+//EIP 57661 End
+
+typedef struct
+{
+ UINT16 DriverCount;
+} DRIVER_MANAGER;
+
+typedef struct{
+ UINT16 Value;
+} DRIVER_ORDER;
+
+typedef struct
+{
+ UINT16 Option;
+}DEL_DRIVER_OPTION;
+
+#define ERROR_MANAGER_NOP 0x0000
+#define ERROR_MANAGER_ALL_ERRORS 0xFFFF
+
+#define OEM_TSE_VARSTORE\
+ varstore OEMTSEVAR, key = OEM_TSE_VAR_KEY_ID,\
+ name = OemTSEVar, guid = OEM_TSE_VAR_GUID;
+
+
+#ifndef VFRCOMPILE
+typedef struct _ERROR_LIST
+{
+ VOID* Handle;
+ UINT16 Summary;
+ UINT16 DetailInfo;
+}
+ERROR_LIST ;
+#endif
+
+typedef struct _ERROR_MANAGER
+{
+ UINT16 ErrorCount;
+ UINT16 ErrorFunction;
+#ifndef VFRCOMPILE
+ ERROR_LIST ErrorList[1];
+#endif
+}
+ERROR_MANAGER;
+
+typedef struct _NEW_BOOT_OPTION
+{
+ CHAR16 Label[20];
+ UINT16 FsCount;
+ UINT16 SelFs;
+ CHAR16 Path[120];
+}
+NEW_BOOT_OPTION;
+
+typedef struct _NEW_DRIVER_OPTION
+{
+ CHAR16 Label[20];
+ UINT16 FsCount;
+ UINT16 SelFs;
+ CHAR16 DriverPath[120];
+}
+NEW_DRIVER_OPTION;
+
+typedef struct
+{
+ UINT16 Count;
+}
+USER_DEFAULTS;
+
+typedef struct _IDE_SECURITY_CONFIG {
+ UINT16 Count;
+ UINT16 Supported;
+ UINT16 Enabled;
+ UINT16 Locked;
+ UINT16 Frozen;
+ UINT16 UserPasswordStatus;
+ UINT16 MasterPasswordStatus;
+ UINT16 ShowMaster;
+ UINT16 IDEUserPassword[32];
+ UINT16 IDEMasterPassword[32];
+}IDE_SECURITY_CONFIG;
+
+typedef struct _AMITSESETUP
+{
+ // Passwords
+ UINT16 UserPassword[SETUP_PASSWORD_LENGTH];
+ UINT16 AdminPassword[SETUP_PASSWORD_LENGTH];
+ // AMI SilentBoot
+ UINT8 AMISilentBoot;
+}
+AMITSESETUP;
+
+#pragma pack()
+
+#endif /* _AMI_VFR_H_ */
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2014, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Pkwy, Building 200,Norcross, Georgia 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
diff --git a/Include/AcpiRes.h b/Include/AcpiRes.h
new file mode 100644
index 0000000..c68730c
--- /dev/null
+++ b/Include/AcpiRes.h
@@ -0,0 +1,831 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2010, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/BIN/Core/Include/AcpiRes.h 18 4/13/11 11:39a Yakovlevs $
+//
+// $Revision: 18 $
+//
+// $Date: 4/13/11 11:39a $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Core/Include/AcpiRes.h $
+//
+// 18 4/13/11 11:39a Yakovlevs
+// Removed extra #pragma pack(push)
+//
+// 17 4/08/11 2:25p Yakovlevs
+// [TAG] EIP 55537
+// [Category] New Feature
+// [Description] Request for ACPI library function to dynamically modify
+// Package objects
+//
+// [Files] AcpiRes.c; AcpiRes.h
+//
+// 16 4/05/11 1:35p Yakovlevs
+// [TAG] EIP38174
+// [Category] New Feature
+// [Description] Generic support to handle PCI OUT OF RESOURDCES added.
+// [Files] AcpiRes.c; AcpiRes.h;p PciBus Module.
+//
+// 15 2/19/10 11:40a Oleksiyy
+// EIP 35099: HideAslMethodFromOs function prototype added.
+//
+// 14 8/21/09 4:14p Felixp
+// Copyright message is updated.
+//
+// 13 8/21/09 3:23p Yakovlevs
+// Definition of a new UpdateAslNameOfDevice() function added.
+//
+// 10 3/15/07 3:30p Yakovlevs
+//
+//**********************************************************************
+#ifndef _ACPI_RES_DEFS
+#define _ACPI_RES_DEFS
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <Efi.h>
+#include <AmiDxeLib.h>
+#include <Acpi.h>
+#include <Acpi20.h>
+#include <Protocol\AcpiSupport.h>
+//--------------------------------------------------------------------------------------------
+#pragma pack(push, 1)
+//--------------------------------------------------------------------------------------------
+//**********************************************************************
+//Definitions for ACPI resource descriptors defined in ACPI 2.0 spec
+// Starting from Section 6.4
+//**********************************************************************
+
+//-----------------------------------------------------------------------
+//OUT of Resources Generic support definitions
+//-----------------------------------------------------------------------
+#define AMI_PCI_OUT_OF_RESOURCES_GUID \
+ { 0xf26dec72, 0x19cf, 0x4e26, 0xb1, 0xad, 0x0f,0x6a, 0xef, 0x4f, 0x1d, 0x47 }
+
+//**********************************************************************
+//resource descriptor terms
+//**********************************************************************
+//============================================================================================
+//SMALL Resources Data Type
+//============================================================================================
+//All Resource type definitions starts with ASLR_and then ASLMACRO Name.
+//All ResourceField types definitions starts with ASLRF_ and then ASLMACRO Name ...
+//All Constatnt Definitions goes with names as defined in ASL Macro Parameters see
+//ACPI spec section 16.2.4
+#define ASLV_RES_TYPE_MSK 0x80
+#define ASLV_SMALL_RES 0
+#define ASLV_LARGE_RES 1
+
+//Small resource common header
+typedef union _ASLRF_S_HDR {
+ UINT8 HDR;
+ struct{
+ UINT8 Length : 3;
+ UINT8 Name : 4;
+ UINT8 Type : 1;
+ };
+} ASLRF_S_HDR;
+
+//Small resource Name definitions the valid part only nibble
+#define ASLV_RT_IRQ 0x4
+#define ASLV_RT_DMA 0x5
+#define ASLV_RT_StartDependentFn 0x6
+#define ASLV_RT_EndDependentFn 0x7
+#define ASLV_RT_IO 0x8
+#define ASLV_RT_FixedIO 0x9
+#define ASLV_RT_VendorShort 0xe
+#define ASLV_SR_EndTag 0xf
+#define ASLV_END_TAG_HDR 0x79
+//All other values are reserved
+
+//--------------------------------------------------------------------------------------------
+//IRQ resource descriptor NoFlags
+//--------------------------------------------------------------------------------------------
+//IRQ Descr MAcros definition
+#define ASLV_Nothing 0
+#define ASLV_Edge 1 //_HE
+#define ASLV_Level 0 //_HE
+#define ASLV_ActiveHigh 0 //_LL
+#define ASLV_ActiveLow 1 //_LL
+#define ASLV_Shared 1 //_SHR
+#define ASLV_Exclusive 0 //_SHR, Nothing defaults to Exclusive
+
+//type must be casted according to Length field value
+//Note: If byte 3 is not included, High true, edge sensitive, non-shareable is assumed.
+typedef struct _ASLR_IRQNoFlags {
+ ASLRF_S_HDR Hdr;
+ UINT16 _INT;
+}ASLR_IRQNoFlags;
+
+//--------------------------------------------------------------------------------------------
+//IRQ descriptor Flags for ASL_RT_IRQ_L3
+typedef union _ASLRF_IFLAGS{
+ UINT8 IRQ_FLAGS;
+ struct{
+ UINT8 _HE : 1; //0=Level-Triggered 1=Edge-Triggfered
+ UINT8 Ignored : 2; //don't care bits 1..2
+ UINT8 _LL : 1; //0=Active-High 1=Active-Low
+ UINT8 _SHR : 1; //Interrupt Shareble 1=
+ UINT8 Reserved: 3; //must be 0 bits 5..7
+ };
+}ASLRF_IFLAGS;
+
+//Note: This descriptor is meant for describing interrupts that are connected to PICcompatible
+//interrupt controllers, which can only be programmed for Active-High-
+//Edge-Triggered or Active-Low-Level-Triggered interrupts. Any other
+//combination is illegal. The Extended Interrupt Descriptor can be used to describe
+//other combinations.
+
+typedef struct _ASLR_IRQ {
+ ASLRF_S_HDR Hdr;
+ UINT16 _INT;
+ ASLRF_IFLAGS Flags;
+}ASLR_IRQ;
+
+//--------------------------------------------------------------------------------------------
+// DMA Resource Descriptor
+
+//releated Definitions
+// _TYP, DMA channel speed
+#define ASLV_Compatibility 0
+#define ASLV_TypeA 1
+#define ASLV_TypeB 2
+#define ASLV_TypeF 3
+// _BM, Nothing defaults to BusMaster
+#define ASLV_BusMaster 1
+#define ASLV_NotBusMaster 2
+ // _SIZ, Transfer size
+#define ASLV_Transfer8 0
+#define ASLV_Transfer16 2
+#define ASLV_Transfer8_16 1
+
+typedef union _ASLRF_DFLAGS {
+ UINT8 DMA_FLAGS;
+ struct {
+ UINT8 _SIZ : 2;
+ UINT8 _BM : 1;
+ UINT8 Ignored : 2;
+ UINT8 _TYP : 2;
+ UINT8 Reserved: 1;
+ };
+}ASLRF_DFLAGS;
+
+typedef struct _ASLR_DMA{
+ ASLRF_S_HDR Hdr;
+ UINT8 _DMA;
+ ASLRF_DFLAGS Flags;
+}ASLR_DMA;
+
+//--------------------------------------------------------------------------------------------
+// Start Dependent Function Resource Descriptor
+
+//releated Definitions
+#define ASLV_Optimal 0
+#define ASLV_Acceptable 1
+#define ASLV_Suboptimal 2
+
+typedef union _ASLRF_PFLAGS{
+ UINT8 PR_FLAGS;
+ struct {
+ UINT8 _CMP : 2;
+ UINT8 _PRF : 2;
+ UINT8 Reserved: 4;
+ };
+}ASLRF_PFLAGS;
+
+typedef struct _ASLR_StartDependentFn{
+ ASLRF_S_HDR Hdr;
+ ASLRF_PFLAGS _PRI; //Priority
+}ASLR_StartDependentFn;
+
+#define ASLR_StartDependentFnNoPri ASLRF_S_HDR
+
+//--------------------------------------------------------------------------------------------
+// End Dependent Function Resource Descriptor
+
+#define ASLR_EndDependentFn ASLRF_S_HDR
+
+//--------------------------------------------------------------------------------------------
+// I/O Port Resource Descriptor
+
+//releated Definitions
+#define ASLV_Decode16 1 // _DEC
+#define ASLV_Decode10 0 // _DEC
+
+typedef struct _ASLR_IO {
+ ASLRF_S_HDR Hdr;
+ UINT8 _DEC;
+ UINT16 _MIN;
+ UINT16 _MAX;
+ UINT8 _ALN;
+ UINT8 _LEN;
+}ASLR_IO;
+
+//this descriptor Assumes 10 bir IO
+typedef struct _ASLR_FixedIO {
+ ASLRF_S_HDR Hdr;
+ UINT16 _BAS;
+ UINT8 _LEN;
+}ASLR_FixedIO;
+
+//--------------------------------------------------------------------------------------------
+// Vendor Defined Short Resource Descriptor
+#define ASLR_VendorShort ASLRF_S_HDR
+
+//--------------------------------------------------------------------------------------------
+// END Resource Descriptor Tag
+
+//Automaticaly generated by ASL compiller
+//at the end of ResourceTemplate statement
+typedef struct _ASLR_EndTag {
+ ASLRF_S_HDR Hdr;
+ UINT8 Chsum;
+} ASLR_EndTag;
+
+//============================================================================================
+//LARGE Resources Data Type
+//============================================================================================
+//All Resource type definitions starts with ASLR_and then ASLMACRO Name.
+//All ResourceField types definitions starts with ASLRF_ and then ASLMACRO Name ...
+//All Constatnt Definitions goes with names as defined in ASL Macro Parameters see
+//ACPI spec section 16.2.4
+
+//Large Resource Name definitions the valid part bits 6..0
+#define ASLV_RT_Memory24 0x1
+#define ASLV_RT_Register 0x2
+#define ASLV_RT_VendorLong 0x4
+#define ASLV_RT_Memory32 0x5
+#define ASLV_RT_Memory32Fixed 0x6
+#define ASLV_RT_DWORD_ASD 0x7
+#define ASLV_RT_WORD_ASD 0x8
+#define ASLV_RT_Interrupt 0x9 //extended Interrupt Descr
+#define ASLV_RT_QWORD_ASD 0xA
+//All other values are reserved
+
+//Large resource common header
+typedef struct _ASLRF_L_HDR {
+ union {
+ UINT8 HDR;
+ struct {
+ UINT8 Name : 7;
+ UINT8 Type : 1;
+ };
+ };
+ UINT16 Length;
+} ASLRF_L_HDR;
+
+//--------------------------------------------------------------------------------------------
+// 24 Bit Memory Range Resource Descriptor
+// has not been used recently... but for compatibility sake
+
+
+//releated Definitions
+#define ASLV_ReadWrite 1 // _RW
+#define ASLV_ReadOnly 0 // _RW
+
+//In _ASLR_MEM24 the lover 8 bits of the _MIN and _MAX of the addrss Assume to be 0;
+//with this object we can specify fixed space making _MIN=_MAX.
+typedef struct _ASLR_Memory24 {
+ ASLRF_L_HDR Hdr;
+ UINT8 _RW; //0=NonWrtitable 1=Writable
+ UINT16 _MIN;
+ UINT16 _MAX;
+ UINT16 _ALN;
+ UINT16 _LEN;
+} ASLR_Memory24;
+
+
+//--------------------------------------------------------------------------------------------
+// Vendor Defined Long Resource Descriptor
+
+#define ASLR_VendorLong ASLRF_L_HDR;
+
+//--------------------------------------------------------------------------------------------
+// 32 Bit Memory Range Resource Descriptor
+typedef struct _ASLR_Memory32 {
+ ASLRF_L_HDR Hdr;
+ UINT8 _RW; //0=NonWrtitable 1=Writable
+ UINT32 _MIN;
+ UINT32 _MAX;
+ UINT32 _ALN;
+ UINT32 _LEN;
+} ASLR_Memory32;
+
+
+//--------------------------------------------------------------------------------------------
+// 32 Bit Memory Fixed Range Resource Descriptor
+
+typedef struct _ASLR_Memory32Fixed {
+ ASLRF_L_HDR Hdr;
+ UINT8 _RW; //0=NonWrtitable 1=Writable
+ UINT32 _BAS;
+ UINT32 _LEN;
+} ASLR_Memory32Fixed;
+//Mixing 24 bit and 32 bit resources in the same device are not allowed
+
+
+//--------------------------------------------------------------------------------------------
+// Extended Interrupt Descriptor
+
+//Extended Interrupts Flags Definitions
+typedef struct _ASLRF_XIFAGS{
+ UINT8 _RPR : 1; //0=Device Consumes 1=Produces and Consume this Resource
+ UINT8 _HE : 1; //0=Level-Triggered 1=Edge-Triggfered
+ UINT8 _LL : 1; //0=Active-High 1=Active-Low
+ UINT8 _SHR : 1; //Interrupt Shareble 1=
+ UINT8 Reserved: 4; //must be 0 bits 5..7
+} ASLRF_XIFAGS;
+
+typedef struct _ASLR_Interrupt {
+ ASLRF_L_HDR Hdr;
+ ASLRF_XIFAGS Flags;
+ UINT8 IntTblLen;
+ UINT8 _INT[1];
+} ASLR_Interrupt;
+
+//--------------------------------------------------------------------------------------------
+// Generic Register Descriptor
+
+// Definitions For _ASI field in ASLR_Register
+#define ASLRV_SystemMem 0
+#define ASLRV_SystemIo 1
+#define ASLRV_PciConfSpc 2
+#define ASLRV_EmbCtrl 3
+#define ASLRV_SmBus 4
+#define ASLRV_FixedHw 0x7f
+//all other values are reserved
+
+typedef struct _ASLR_Register {
+ ASLRF_L_HDR Hdr;
+ UINT8 _ASI;
+ UINT8 _RBW; //Register Width in Bits
+ UINT8 _RBO; //Register Offset in Bits
+ UINT64 _ADR;
+} ASLR_Register;
+
+//============================================================================================
+//Address Space Resource Descriptor Internal definitions
+//============================================================================================
+
+//Definitions for _RPR Field in ASLRF_GFLAGS
+#define ASLV_ResourceConsumer 1
+#define ASLV_ResourceProducer 0
+
+//Definitions for Type Field in ASLR_XXXXX_ASD
+#define ASLRV_SPC_TYPE_MEM 0
+#define ASLRV_SPC_TYPE_IO 1
+#define ASLRV_SPC_TYPE_BUS 2
+//3..255 are reserved
+
+//Address Space Descriptor General Flags
+typedef union _ASLRF_GFLAGS {
+ UINT8 GFLAGS;
+ struct {
+ UINT8 _RPR : 1; //Bit 0=1 This Device only consume this resource
+ UINT8 _DEC : 1; //if 1 Substractive Decoding 0 - Positive
+ UINT8 _MIF : 1; //MIN address is Fixed
+ UINT8 _MAF : 1; //MAX address is Fixed
+ UINT8 Reserved : 4;
+ };
+} ASLRF_GFLAGS;
+
+//type specific flag meaning for _MTP
+#define ASLRV_MTP_MEM 0
+#define ASLRV_MTP_RESERV 1
+#define ASLRV_MTP_ACPI 2
+#define ASLRV_MTP_NVS 3
+
+//type specific flag meaning for _MEM
+#define ASLRV_MEM_UC 0 //Non Cacheable
+#define ASLRV_MEM_CE 1 //Cacheable
+#define ASLRV_MEM_CEWC 2 //Cacheable and Supports Wrtite Combining
+#define ASLRV_MEM_CEPF 3 //Cacheable and Prefatchable
+
+//type specific flag meaning for _RNG
+#define ASLRV_RNG_ISA_IO 2
+#define ASLRV_RNG_NON_ISA 1
+
+typedef union _ASLRF_TFLAGS_{
+ UINT8 TFLAGS;
+ struct {//for memory space descriptor type
+ UINT8 _RW : 1; //1=ReadWrite 0=ReadOnly
+ UINT8 _MEM : 2; //Memory Attributes see above
+ UINT8 _MTP : 2; //Memory Type see above
+ UINT8 _TTP : 1; //Translation Type: 1=Translation 0=Static
+ UINT8 Reserved: 2;
+ }MEM_FLAGS;
+ struct {//For IO Space Descriptor
+ UINT8 _RNG : 2; //Range see above
+ UINT8 Reserved1: 2;
+ UINT8 _TTP : 1; //Translation Type: 1=Translation 0=Static
+ UINT8 _TRA : 1; //Space Translation 1=Sparse; 0=Dense
+ UINT8 Reserved2: 2;
+ }IO_FLAGS;
+} ASLRF_TFLAGS;
+
+//This date structure mught be attached to any Address Space descriptior
+//if ASD.Hdr.Length>sizeof(ASLR_XXXXX_ASD)
+typedef struct _ASLRF_RES_SRC {
+ UINT8 ResSrcIndex; //Rersource index in following Device Oblect Resource tamplete
+ UINT8 ResSrcName[1]; //Name of the Device Object
+} ASLRF_RES_SRC;
+
+//--------------------------------------------------------------------------------------------
+//QWORD Address Space Resource Descriptor Internal definitions
+typedef struct _ASLR_QWORD_ASD {
+ ASLRF_L_HDR Hdr;
+ UINT8 Type;
+ ASLRF_GFLAGS GFlags; //General Flags
+ ASLRF_TFLAGS TFlags; //Type Specific Flags
+ UINT64 _GRA;
+ UINT64 _MIN;
+ UINT64 _MAX;
+ UINT64 _TRA;
+ UINT64 _LEN;
+} ASLR_QWORD_ASD;
+
+//--------------------------------------------------------------------------------------------
+//DWORD Address Space Resource Descriptor Internal definitions
+typedef struct _ASLR_DWORD_ASD {
+ ASLRF_L_HDR Hdr;
+ UINT8 Type;
+ ASLRF_GFLAGS GFlags; //General Flags
+ ASLRF_TFLAGS TFlags; //Type Specific Flags
+ UINT64 _GRA;
+ UINT64 _MIN;
+ UINT64 _MAX;
+ UINT64 _TRA;
+ UINT64 _LEN;
+} ASLR_DWORD_ASD;
+
+//--------------------------------------------------------------------------------------------
+//WORD Address Space Resource Descriptor Internal definitions
+typedef struct _ASLR_WORD_ASD {
+ ASLRF_L_HDR Hdr;
+ UINT8 Type;
+ ASLRF_GFLAGS GFlags; //General Flags
+ ASLRF_TFLAGS TFlags; //Type Specific Flags
+ UINT64 _GRA;
+ UINT64 _MIN;
+ UINT64 _MAX;
+ UINT64 _TRA;
+ UINT64 _LEN;
+} ASLR_WORD_ASD;
+
+//Generic ASL resource header
+typedef union _ASLR_HDR{
+ ASLRF_S_HDR SHdr;
+ ASLRF_L_HDR LHdr;
+} ASLR_HDR;
+
+//Structure to store dependent functionresource descriptor pointers
+typedef struct _EFI_ASL_DepFn {
+ VOID *DepFn;
+ T_ITEM_LIST DepRes;
+}EFI_ASL_DepFn;
+
+//typedef struct _EFI_ASL_DepFnNoPri {
+// ASLR_StartDependentFnNoPri *DepFn;
+// T_ITEM_LIST DepRes;
+//} EFI_ASL_DepFnNoPri;
+
+//typedef union _EFI_ASL_DF{
+// EFI_ASL_DepFn DFwP;
+// EFI_ASL_DepFnNoPri DFnP;
+//}EFI_ASL_DF;
+
+
+//AML Definition of NameSpace "Name" Object
+typedef struct _AML_NAME_OBJ {
+ UINT8 OpCode;
+ UINT32 ObjName;
+ UINT8 Preffix;
+}AML_NAME_OBJ;
+
+//AML Name Object Size Preffix
+#define AML_PR_BYTE 0x0A
+#define AML_PR_WORD 0x0B
+#define AML_PR_DWORD 0x0C
+#define AML_PR_QWORD 0x0E
+#define AML_ZERO_OP 0x00
+#define AML_ONE_OP 0x01
+
+//Opcode Definition for Name Object
+#define AML_OP_ALIAS 0x06
+#define AML_OP_NAME 0x08
+#define AML_OP_SCOPE 0x10
+
+typedef enum {
+ tResBus,
+ tResIoMem,
+ tResAll,
+ tResMax
+}ASLR_TYPE_ENUM;
+
+//--------------------------------------------------------------------------------------------
+#pragma pack(pop)
+//--------------------------------------------------------------------------------------------
+
+
+//--------------------------------------------------------------------------------------------
+//Function Prototypes
+//--------------------------------------------------------------------------------------------
+VOID *ASLM_IRQ(UINT8 dsc_cnt, UINT8 ll, UINT8 he, UINT8 shr, ... );
+
+VOID *ASLM_IRQNoFlags(UINT8 dsc_cnt, ... );
+
+VOID *ASLM_DMA(UINT8 dsc_cnt, UINT8 typ, UINT8 bm, UINT8 siz, ... );
+
+VOID *ASLM_StartDependentFn(UINT8 dsc_cnt,UINT8 pComp,UINT8 pPerf, ...);
+
+VOID *ASLM_StartDependentFnNoPri(UINT8 dsc_cnt, ...);
+
+VOID *ASLM_IO(UINT8 dec,UINT16 min,UINT16 max,UINT8 aln,UINT8 len);
+
+VOID *ASLM_FixedIO(UINT16 bas, UINT8 len);
+
+VOID *ASLM_VendorShort(UINT8 byte_cnt, ...);
+
+VOID *ASLM_Memory24(UINT8 rw,UINT8 min, UINT8 max, UINT8 aln, UINT8 len);
+
+BOOLEAN ValidateDescriptor(ASLR_QWORD_ASD *Descriptor, ASLR_TYPE_ENUM ResType, BOOLEAN Fixed);
+
+UINTN ValidateDescriptorBlock(ASLR_QWORD_ASD* DscStart, ASLR_TYPE_ENUM ResType, BOOLEAN Fixed);
+//--------------------------------------------------------------------------------------------
+
+//AMP OP_CODE TYPE Definition
+#define AML_OP_CODE UINT8 //Normal OP_CODE
+#define AML_EOP_CODE UINT16 //Extended OP_CODE
+
+
+//AML Name Object Size Preffix
+#define AML_PR_BYTE 0x0A
+#define AML_PR_WORD 0x0B
+#define AML_PR_DWORD 0x0C
+#define AML_PR_STRING 0x0D
+#define AML_PR_QWORD 0x0E
+
+#define AML_PR_DUALNAME 0x2E
+#define AML_PR_MULTNAME 0x2F
+
+
+#define AML_PR_EXTOP 0x5B //'['
+#define AML_PR_ROOT 0x5C //'\'
+#define AML_PR_PARENT 0x5E //'^'
+
+
+//Opcode Definition for Name Object
+#define AML_OP_ZERO 0x00
+#define AML_OP_ONE 0x01
+#define AML_OP_ONES 0xFF
+
+
+#define AML_OP_ALIAS 0x06
+#define AML_OP_NAME 0x08
+#define AML_OP_SCOPE 0x10
+#define AML_OP_BUFFER 0x11
+#define AML_OP_PACKAGE 0x12
+#define AML_OP_VARPACK 0x13
+#define AML_OP_METHOD 0x14
+
+#define AML_OP_RETURN 0xA4
+
+#define AML_OP_OPREG 0x80
+#define AML_OP_DEVICE 0x82
+#define AML_OP_PROC 0x83
+#define AML_OP_PWRRES 0x84
+#define AML_OP_THERMAL 0x85
+
+
+#define AML_NULL_NAME 0x00
+
+
+//==============================================================
+//AML Definition for AML Objects NameString
+//==============================================================
+#pragma pack(push, 1)
+
+//--------------------------------------------------
+//LeadNameChar := 'A'-'Z' | '_' := 0x5f
+//DigitChar := '0'-'9'
+//NameChar := DigitChar | LeadNameChar
+//RootChar := '\'=0x5c
+//ParentPrefixChar := '^'=0x5e
+//NullName := 0x00
+//--------------------------------------------------
+
+//--------------------------------------------------
+//NameSeg := <LeadNameChar NameChar NameChar NameChar>
+// Notice that NameSegs shorter than 4 characters are
+// filled with trailing '_'s.
+typedef union _AML_NAME_SEG{
+ UINT32 NAME;
+ UINT8 Name[4];
+}AML_NAME_SEG;
+
+//--------------------------------------------------------------
+//DualNamePath := DualNamePrefix NameSeg NameSeg
+//DualNamePrefix := 0x2e
+typedef struct _AML_DUAL_NAME_PATH{
+ AML_OP_CODE OpCode;
+ AML_NAME_SEG Name1;
+ AML_NAME_SEG Name2;
+}AML_DUAL_NAME_PATH;
+
+//--------------------------------------------------------------
+//MultiNamePath := MultiNamePrefix SegCount NameSeg(SegCount)
+//MultiNamePrefix := 0x2f
+//SegCount := ByteData
+typedef struct _AML_MULTI_NAME_PATH{
+ AML_OP_CODE OpCode;
+ UINT8 SegCount;
+ AML_NAME_SEG Name[1];
+}AML_MULTI_NAME_PATH;
+
+
+////////////////////////////////////////////////////////////////
+//Some NAMED objects definitions
+////////////////////////////////////////////////////////////////
+
+//Type of object
+typedef enum {
+ otNone=0,
+ otScope,
+ otBuffer,
+ otName,
+ otProc,
+ otTermal,
+ otDevice,
+ otMethod,
+ otPwrRes,
+ otOpReg
+} ASL_OBJ_TYPE;
+
+//Structure to store ASL Object Information
+typedef struct _ASL_OBJ_INFO {
+ VOID *Object;
+ VOID *ObjName;
+ VOID *DataStart;
+ ASL_OBJ_TYPE ObjType;
+ UINTN Length;
+} ASL_OBJ_INFO;
+
+
+//AML Pckage Definition
+typedef struct _AML_PACKAGE_LBYTE {
+ UINT8 Length : 6;
+ UINT8 ByteCount : 2;
+ //Package Length Following Bytes 0..3
+} AML_PACKAGE_LBYTE;
+
+
+typedef struct _AML_PACKAGE{
+ AML_OP_CODE OpCode;
+ AML_PACKAGE_LBYTE Length;
+// UINT8 NumElements;
+// PckageElements:=ObjectList
+} AML_PACKAGE;
+
+
+typedef struct _AMI_OUT_OF_RES_VAR {
+ ASLR_QWORD_ASD Resource;
+ UINTN Count;
+} AMI_OUT_OF_RES_VAR;
+
+
+// PackageElements
+
+#define ELEMENT_UINT8_PREFIX 0xA
+#define ELEMENT_UINT16_PREFIX 0xB
+#define ELEMENT_UINT32_PREFIX 0xC
+#define ELEMENT_STRING_PREFIX 0xD
+#define ELEMENT_UINT64_PREFIX 0xE
+
+typedef struct {
+ UINT8 Prefix;
+ UINT8 Data;
+} PACKAGE_ELEMENT_UINT8;
+
+typedef struct {
+ UINT8 Prefix;
+ UINT16 Data;
+} PACKAGE_ELEMENT_UINT16;
+
+typedef struct {
+ UINT8 Prefix;
+ UINT32 Data;
+} PACKAGE_ELEMENT_UINT32;
+
+typedef struct {
+ UINT8 Prefix;
+ UINT64 Data;
+} PACKAGE_ELEMENT_UINT64;
+
+typedef union {
+ VOID *Ptr;
+ PACKAGE_ELEMENT_UINT8 *Type8;
+ PACKAGE_ELEMENT_UINT16 *Type16;
+ PACKAGE_ELEMENT_UINT32 *Type32;
+ PACKAGE_ELEMENT_UINT64 *Type64;
+} PACKAGE_ELEMENT;
+
+typedef struct {
+ UINT8 OpCode; // 0x11 is opcode for Package Objects
+ union
+ {
+ struct {
+ UINT8 Length :6; // [5:0] Length if ByteCount == 0
+ UINT8 ByteCount :2; // [7:6] # Bytes that follow
+ UINT8 ElementCount;
+ VOID *Element;
+ } Small;
+ struct {
+ UINT8 LowNibble :4; // [3:0] low nibble if ByteCount > 0
+ UINT8 Reserved :2; // [5:4] reserved if ByteCount > 0
+ UINT8 ByteCount :2; // [7:6] # Bytes that follow
+ UINT8 Byte1; // [15:8]
+ UINT8 ElementCount; // [23:16]
+ VOID *Element;
+ } Large1;
+ struct {
+ UINT8 LowNibble :4; // [3:0] low nibble if ByteCount > 0
+ UINT8 Reserved :2; // [5:4] reserved if ByteCount > 0
+ UINT8 ByteCount :2; // [7:6] # Bytes that follow
+ UINT8 Byte1; // [15:8]
+ UINT8 Byte2; // [23:16]
+ UINT8 ElementCount; // [31:24]
+ VOID *Element;
+ } Large2;
+ struct {
+ UINT8 LowNibble :4; // [3:0] low nibble if ByteCount > 0
+ UINT8 Reserved :2; // [5:4] reserved if ByteCount > 0
+ UINT8 ByteCount :2; // [7:6] # Bytes that follow
+ UINT8 Byte1; // [15:8]
+ UINT8 Byte2; // [23:16]
+ UINT8 Byte3; // [31:24]
+ UINT8 ElementCount; // [39:32]
+ VOID *Element;
+ } Large3;
+ } Encoding;
+} AML_PACKAGE_HEADER;
+#pragma pack(pop)
+
+
+
+//BOOLEAN CheckOpCode(UINT8 *NameStart, UINT8 OpCode, UINT8 ExtOpCode, ASL_OBJ_INFO *ObjInfo);
+//VOID* FindAslObjectName(UINT8 *Start, UINT8 *ObjName, UINTN Len);
+
+EFI_STATUS GetAslObj(UINT8 *Start, UINTN Length, UINT8 *Name, ASL_OBJ_TYPE ObjType, ASL_OBJ_INFO *ObjInfo);
+UINT8 ChsumTbl(UINT8* TblStart, UINT32 BytesCount);
+EFI_STATUS UpdateAslNameObject(ACPI_HDR *PDsdt, UINT8 *ObjName, UINT64 Value);
+UINTN GetPackageLen(AML_PACKAGE_LBYTE *Pck, UINT8 *BytesCnt);
+EFI_STATUS UpdateAslNameOfDevice(ACPI_HDR *PDsdt, CHAR8 *DeviceName, CHAR8 *ObjName, UINT64 Value);
+VOID HideAslMethodFromOs (ASL_OBJ_INFO *AslObj, UINT8 *MethodName);
+
+EFI_STATUS LibGetDsdt(EFI_PHYSICAL_ADDRESS *DsdtAddr, EFI_ACPI_TABLE_VERSION Version);
+
+EFI_STATUS AmiPciOutOfRes(AMI_OUT_OF_RES_VAR *AmiOutOfResData, BOOLEAN Get);
+
+EFI_STATUS GetRbAmlPackagePointer(
+ IN ACPI_HDR **Dsdt,
+ IN CHAR8 *RbName,
+ IN CHAR8 *PackageName,
+ OUT ASL_OBJ_INFO *Package,
+ OUT PACKAGE_ELEMENT *Elements,
+ OUT UINT8 *ElementCount );
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2010, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//********************************************************************** \ No newline at end of file
diff --git a/Include/Aint13Protocol.cif b/Include/Aint13Protocol.cif
new file mode 100644
index 0000000..73c69a4
--- /dev/null
+++ b/Include/Aint13Protocol.cif
@@ -0,0 +1,8 @@
+<component>
+ name = "AHCI Int13 Protocol"
+ category = ModulePart
+ LocalRoot = "Include"
+ RefName = "AHCI_INT13INIT_PROTOCOL"
+[files]
+"protocol\LegacyAhci.h" = "Protocols"
+<endComponent>
diff --git a/Include/AmiBoardInfoIncludes.cif b/Include/AmiBoardInfoIncludes.cif
new file mode 100644
index 0000000..73e98e8
--- /dev/null
+++ b/Include/AmiBoardInfoIncludes.cif
@@ -0,0 +1,8 @@
+<component>
+ name = "AmiBoardInfoIncludes"
+ category = ModulePart
+ LocalRoot = "Include\"
+ RefName = "AmiBoardInfoIncludes"
+[files]
+"Protocol\AmiBoardInfo.h"
+<endComponent>
diff --git a/Include/AmiBufferValidationLib.h b/Include/AmiBufferValidationLib.h
new file mode 100644
index 0000000..23c4373
--- /dev/null
+++ b/Include/AmiBufferValidationLib.h
@@ -0,0 +1,149 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2014, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/SOURCE/Modules/AmiBufferValidationLib/AmiBufferValidationLib Include/AmiBufferValidationLib.h 3 12/30/14 4:09p Aaronp $
+//
+// $Revision: 3 $
+//
+// $Date: 12/30/14 4:09p $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/SOURCE/Modules/AmiBufferValidationLib/AmiBufferValidationLib Include/AmiBufferValidationLib.h $
+//
+// 3 12/30/14 4:09p Aaronp
+// [TAG] EIP198005
+// [Category] Improvement
+// [Description] Added support for pre PI 1.2
+//
+// 2 11/26/14 10:33a Aaronp
+// Updated function headers with additional information that was added to
+// the AptioV component.
+//
+// 1 11/07/14 12:07p Aaronp
+// initial addition of AmiBufferValidationLib
+//
+//**********************************************************************
+
+//**********************************************************************
+//<AMI_FHDR_START>
+//
+// Name: AmiBufferValidationLib.h
+//
+// Description: Header file that defines the AmiBufferValidationLib functions
+//
+//<AMI_FHDR_END>
+//**********************************************************************
+
+#ifndef __AMI_BUFFER_VALIDATION_LIB__H__
+#define __AMI_BUFFER_VALIDATION_LIB__H__
+
+//<AMI_PHDR_START>
+//----------------------------------------------------------------------------
+// Procedure: InitAmiBufferValidationLib
+//
+// Description: Performs the necessary initialization so that the buffer validation functions will operate
+// correctly when they are called.
+//
+// Input:
+// IN EFI_HANDLE ImageHandle - The handle of this image
+// IN EFI_SYSTEM_TABLE *SystemTable - Pointer to the EFI_SYSTEM_TABLE
+//
+// Output:
+// EFI_NOT_FOUND - The Smm Access protocol could not be found
+// EFI_OUT_OF_RESOURCES - An allocation failed because it could not find any memory resources
+// EFI_INVALID_PARAMETER - An invalid parameter was passed to one of the functions
+// EFI_SUCCESS - The necessary functions were initialized
+//----------------------------------------------------------------------------
+//<AMI_PHDR_END>
+EFI_STATUS InitAmiBufferValidationLib(IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable);
+
+
+//<AMI_PHDR_START>
+//----------------------------------------------------------------------------
+// Procedure: AmiValidateMemoryBuffer
+//
+// Description: Function verifies the buffer to make sure its address range is legal for a memory buffer. A legal memory
+// buffer is one that lies entirely outside of SMRAM. SMI handlers that receive buffer address and/or size
+// from outside of SMM at runtime must validate the buffer using this function prior to using it or passing
+// to other SMM interfaces.
+//
+// Input:
+// VOID *Buffer - Buffer address
+// UINTN BufferSize - Size of the Buffer
+//
+// Output:
+// EFI_SUCCESS - The buffer address range is valid and can be safely used.
+// EFI_ACCESS_DENIED - The buffer can't be used because its address range overlaps with protected area such as SMRAM.
+// EFI_INVALID_PARAMETER - The buffer can't be used because its address range is invalid.
+// EFI_NOT_FOUND - The buffer can't be used because its validity cannot be verified. Normally due to the SMRAM ranges were not available.
+//----------------------------------------------------------------------------
+//<AMI_PHDR_END>
+EFI_STATUS AmiValidateMemoryBuffer(VOID* Buffer, UINTN BufferSize);
+
+//<AMI_PHDR_START>
+//----------------------------------------------------------------------------
+// Procedure: AmiValidateMmioBuffer
+//
+// Description: Function verifies the buffer to make sure its address range is legal for a MMIO buffer. A legal MMIO buffer is one that lies
+// entirely outside of SMRAM. SMI handlers that receive a buffer address and/or size from outside of SMM at runtime must validate
+// the buffer using this function prior to using the MMIO Buffer or passing to other SMM interfaces.
+//
+// Input:
+// VOID *Buffer - Buffer address
+// UINTN BufferSize - Size of the Buffer
+//
+// Output:
+// EFI_SUCCESS - The buffer address range is valid and can be safely used.
+// EFI_ACCESS_DENIED - The buffer can't be used because its address range overlaps with protected area such as SMRAM.
+// EFI_INVALID_PARAMETER - The buffer can't be used because its address range is invalid.
+// EFI_NOT_FOUND - The buffer can't be used because its validity cannot be verified. Normally due to the SMRAM ranges were not available.
+//----------------------------------------------------------------------------
+//<AMI_PHDR_END>
+EFI_STATUS AmiValidateMmioBuffer(VOID* Buffer, UINTN BufferSize);
+
+//<AMI_PHDR_START>
+//----------------------------------------------------------------------------
+// Procedure: AmiValidateSmramBuffer
+//
+// Description: Function verifies the buffer to make sure it wholly resides in the SMRAM.
+//
+// Input:
+// IN VOID *Buffer - Buffer address
+// IN UINTN BufferSize - Size of the Buffer
+//
+// Output:
+// EFI_SUCCESS - The buffer resides in the SMRAM and can be safely used.
+// EFI_ACCESS_DENIED - The buffer can't be used because at least one byte of the buffer is outside of SMRAM.
+// EFI_INVALID_PARAMETER - The buffer can't be used because its address range is invalid.
+// EFI_NOT_FOUND - The buffer can't be used because its validity cannot be verified. Normally due to the SMRAM ranges were not available.
+//----------------------------------------------------------------------------
+//<AMI_PHDR_END>
+EFI_STATUS AmiValidateSmramBuffer(VOID* Buffer, UINTN BufferSize);
+
+#endif
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2014, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
diff --git a/Include/AmiBufferValidationLibInclude.cif b/Include/AmiBufferValidationLibInclude.cif
new file mode 100644
index 0000000..e05ba9d
--- /dev/null
+++ b/Include/AmiBufferValidationLibInclude.cif
@@ -0,0 +1,8 @@
+<component>
+ name = "AmiBufferValidationLib Include"
+ category = ModulePart
+ LocalRoot = "Include\"
+ RefName = "AmiBufferValidationLibInclude"
+[files]
+"AmiBufferValidationLib.h"
+<endComponent>
diff --git a/Include/AmiCertificate.h b/Include/AmiCertificate.h
new file mode 100644
index 0000000..ee9eacd
--- /dev/null
+++ b/Include/AmiCertificate.h
@@ -0,0 +1,270 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2012 American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Pkwy, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+//**********************************************************************
+// $Header: /Alaska/BIN/Modules/CryptoPkg/AmiCertificate.h 8 6/18/13 12:45p Alexp $
+//
+// $Revision: 8 $
+//
+// $Date: 6/18/13 12:45p $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Modules/CryptoPkg/AmiCertificate.h $
+//
+// 8 6/18/13 12:45p Alexp
+// Added Platform FwKey HOB structure
+//
+// 7 11/20/12 2:30p Alexp
+// add macro "offsetof"
+//
+// 6 11/13/12 11:47a Alexp
+// EIP#105015
+// Add GUID defines for x509 Public Key file type and
+// Pkcs#7 Cert verification function in Crypto PPI
+//
+// 5 5/18/12 11:56a Alexp
+// add Extended FwCapsule GUID flags
+//
+// 4 2/29/12 3:58p Alexp
+// Add PR_KEY_FFS_FILE_SHA256_GUID for PR Key file in SHA256 Hash format
+//
+// 3 11/01/11 4:49p Alexp
+// formatted headers to be displayed properly in CHM file
+//
+// 2 7/19/11 2:13p Alexp
+// removed obsolete FW capsule structures
+//
+// 2 5/17/11 5:11p Alexp
+// commented out obsolete FW capsule structures
+//
+// 11 5/05/11 3:38p Alexp
+// update Hdr information
+//
+// 8 4/18/11 7:10p Alexp
+// change Aptio Hdr format to support RomMap
+//
+// 6 4/11/11 12:54p Alexp
+// New Capsule Certificate format, Key GUIDs reshuffle
+//
+// 5 4/05/11 6:30p Alexp
+// add new guid for Fw Signing Key image
+//
+//**********************************************************************
+//<AMI_FHDR_START>
+//
+// Name: AmiCertificate.h
+//
+// Description: AMI FW Certificate defines and data structures
+//
+//<AMI_FHDR_END>
+//**********************************************************************
+#ifndef __AMI_CERTIFICATE_H__
+#define __AMI_CERTIFICATE_H__
+
+#include <Efi.h>
+// All are EDKII defined headers
+#include "WinCertificate.h"
+#include "ImageAuthentication.h"
+#include <AmiHobs.h>
+#ifndef ROM_AREA
+#include <RomLayout.h>
+#endif
+
+#pragma pack(1)
+
+#ifndef offsetof
+#define offsetof(st, m) \
+ ((UINTN) ( (char *)&((st *)0)->m - (char *)0 ))
+#endif
+
+//**********************************************************************
+// AMI FW Certificate defines
+//**********************************************************************
+
+// Aptio FW Capsule
+// Update CapsuleMain.c and CapsuleRt.c to process APTIO_FW_CAPSULE_GUID capsules as normal CAPSULE
+//#define APTIO_FW_CAPSULE_GUID \
+// { 0xc50e4b4a, 0x302, 0x41fe, 0x9b, 0x99, 0x43, 0xde, 0x77, 0x7, 0x6, 0x3f }
+
+// FW Capsule with extended header fields.
+//4A3CA68B-7723-48FB-803D-578CC1FEC44D
+#define APTIO_FW_CAPSULE_GUID \
+ { 0x4A3CA68B, 0x7723, 0x48FB, 0x80, 0x3d, 0x57, 0x8c, 0xc1, 0xfe, 0xc4, 0x4d }
+
+//3FEEC852-F14C-4E7F-97FD-4C3A8C5BBECC
+// Key format: Raw 256 byte N-Modulus of RSA2048 Key
+#define PR_KEY_FFS_FILE_RAW_GUID \
+ { 0x3FEEC852, 0xF14C, 0x4E7F, 0x97, 0xFD, 0x4C, 0x3A, 0x8C, 0x5B, 0xBE, 0xCC }
+
+// 5B85965C-455D-4CC6-9C4C-7F086967D2B0
+// Key format: SHA256 hash of 256 byte N-Modulus of RSA2048 Key
+#define PR_KEY_FFS_FILE_SHA256_GUID \
+ { 0x05B85965C, 0x455D, 0x4CC6, 0x9C, 0x4C, 0x7F, 0x08, 0x69, 0x67, 0xD2, 0xB0 }
+
+// 3A666558-43E3-4D25-9169-DB81F5DB42E1
+// Key format: x509 ASN.1 DER containing RSA2048 Public Key
+#define PR_KEY_FFS_FILE_X509_GUID \
+ { 0x3A666558, 0x43E3, 0x4D25, 0x91, 0x69, 0xdb, 0x81, 0xf5, 0xdb, 0x42, 0xe1 }
+
+// APTIO Patform Fw Root Signing key identifier
+// {4E0F9BD4-E338-4B26-843E-BD3AD9B2837B}
+#define PR_KEY_GUID \
+ { 0x4E0F9BD4, 0xE338, 0x4B26, 0x84, 0x3E, 0xBD, 0x3A, 0xD9, 0xB2, 0x83, 0x7B }
+
+//9E625A27-4840-47CC-A6B5-1E9311CFC60E
+//#define PK_PUB_FFS_FILE_EFI_AUTH_VAR_GUID \
+// { 0x9E625A27, 0x4840, 0x47CC, 0xA6, 0xB5, 0x1E, 0x93, 0x11, 0xCF, 0xC6, 0x0E }
+
+// APTIO PK Key identifier
+// {A6C0E11E-929E-42b3-90CC-4F778E03FF57}
+//#define PKPUB_KEY_GUID \
+// { 0xa6c0e11e, 0x929e, 0x42b3, 0x90, 0xcc, 0x4f, 0x77, 0x8e, 0x3, 0xff, 0x57 }
+
+// The 256 byte buffer containing the public modulus of RSA2048 Public Key
+// Second part of the Public key, public exponent (e), must be hardwired elsewhere in the FW (recommended value of e=65537).
+// use EFI_CERT_RSA2048_GUID instead
+//#define AMI_PB_KEY_RSA2048_GUID \
+// { 0x04627B9B, 0x385E, 0x4744, 0x90, 0x21, 0xE6, 0x63, 0x19, 0xF2, 0x03, 0x94 }
+
+// AMI APTIO 4 Signature Owner id.
+// An identifier which identifies the agent which added the signature to the list.
+#define AMI_APTIO_SIG_OWNER_GUID \
+ { 0x26DC4851, 0x195F, 0x4AE1, 0x9A, 0x19, 0xFB, 0xF8, 0x83, 0xBB, 0xB3, 0x5E }
+
+//Platform FwKey GUIDed HOB
+//Header HobGUID = PR_KEY_GUID
+typedef struct {
+ EFI_HOB_GUID_TYPE Header;
+ EFI_GUID KeyGuid;
+ EFI_PHYSICAL_ADDRESS KeyAddress;
+ UINT32 KeySize;
+} FW_KEY_HOB;
+
+// Modified version of Win Uefi Cert. CertData is not defined in here
+typedef struct {
+ WIN_CERTIFICATE Hdr;
+ EFI_GUID CertType;
+// UINT8 CertData[1];
+// EFI_CERT_BLOCK_RSA_2048_SHA256 CertData;
+} WIN_CERTIFICATE_UEFI_GUID_1;
+
+//<AMI_SHDR_START>
+//----------------------------------------------------------------------------
+// Name: AMI_CERTIFICATE_RSA2048_SHA256
+//
+// Description: Certificate which encapsulates the UEFI RSA2048_SHA256 digital signature.
+//
+// The WIN_CERTIFICATE_UEFI_GUID structure is derived from
+// WIN_CERTIFICATE and encapsulate the information needed to
+// implement the digital signature algorithm
+// Hdr.Hdr.wRevision = 0x0200
+// Hdr.Hdr.wCertificateType = 0x0EF1; WIN_CERT_TYPE_EFI_GUID
+// Hdr.CertType = EFI_CERT_TYPE_RSA2048_SHA256_GUID;
+//
+// Fields: Name Type Description
+//----------------------------------------------------------------------------
+// Hdr WIN_CERTIFICATE_UEFI_GUID encapsulate the information needed to implement the digital signature algorithm
+// CertData EFI_CERT_BLOCK_RSA_2048_SHA256 Signature and Public key
+//----------------------------------------------------------------------------
+//<AMI_SHDR_END>
+typedef struct {
+ WIN_CERTIFICATE_UEFI_GUID_1 Hdr; // 24
+ EFI_CERT_BLOCK_RSA_2048_SHA256 CertData; // 16+256+256
+} AMI_CERTIFICATE_RSA2048_SHA256;
+//(sizeof(AMI_CERTIFICATE_RSA2048_SHA256) == 552);
+
+//<AMI_SHDR_START>
+//----------------------------------------------------------------------------
+// Name: FW_CERTIFICATE
+//
+// Description: Aptio FW Capsule certificate block
+//
+// Fields: Name Type Description
+//----------------------------------------------------------------------------
+// SignCert AMI_CERTIFICATE_RSA2048_SHA256 Certificate contains a signature of a Capsule's payload and Signer's public key
+// RootCert EFI_CERT_BLOCK_RSA_2048_SHA256 Certificate contains a signature of a Signer's public key signed by the
+// Root Key, whose public portion is also included into this certificate.
+// For Aptio FW update process to succeed, either of these keys must match the instance of a Platform FW Key in the Flash.
+//
+//----------------------------------------------------------------------------
+//<AMI_SHDR_END>
+typedef struct {
+ AMI_CERTIFICATE_RSA2048_SHA256 SignCert; // 24+16+256+256
+ EFI_CERT_BLOCK_RSA_2048_SHA256 RootCert; // 16+256+256
+} FW_CERTIFICATE;
+//(sizeof(FW_CERTIFICATE) == 1112);
+
+//<AMI_SHDR_START>
+//----------------------------------------------------------------------------
+// Name: APTIO_FW_CAPSULE_HEADER
+//
+// Description: Enhanced APTIO FW CAPSULE with certificate and the map of the modules in the
+// capsule's volume to be included into the signature calculation
+// Fields:
+// Name Type Description
+//----------------------------------------------------------------------------
+// CapHdr EFI_CAPSULE_HEADER UEFI 2.0 Capsule Hdr. Use APTIO_FW_CAPSULE_2_GUID
+// RomImageOffset UINT16 offset within the Fw Capsule header to the FW image
+// RomLayoutOffset UINT16 offset to the FW discriptor table used for signature calculation
+// FWCert FW_CERTIFICATE Certificate block. Format may change based on WIN_CERTIFICATE header Type.
+// Hdr.CertType = EFI_CERT_TYPE_RSA2048_SHA256_GUID;
+// Hdr.CertType = EFI_CERT_TYPE_PKCS7_GUID;
+// ....
+// RomAreaMap ROM_AREA
+// ....
+// Payload
+//----------------------------------------------------------------------------
+//<AMI_SHDR_END>
+typedef struct {
+ EFI_CAPSULE_HEADER CapHdr;
+ UINT16 RomImageOffset;
+ UINT16 RomLayoutOffset;
+ FW_CERTIFICATE FWCert;
+ ROM_AREA RomAreaMap[1];
+} APTIO_FW_CAPSULE_HEADER;
+
+// CapHdr.Flags Extended FwCapsule GUID flags
+// RSA Signature padding scheme:
+// 0-PKCS1v5
+// 1-PSS
+#define CAPSULE_FLAGS_RSA_PSS_PADDING_SCHEME 0x00000001
+// Blocks used for signing by Signing Certificate:
+// 0-RomMap + Payload
+// 1-FwCapHdr + RomMap + Payload
+#define CAPSULE_FLAGS_CAPHDR_IN_SIGNCERT 0x00000002
+// Blocks used for signing by Root Certificate:
+// 0-FwCert.SignCert structure
+// 1-FwCert.SignCert.PublicKey field
+#define CAPSULE_FLAGS_SIGNKEY_IN_ROOTCERT 0x00000004
+// Validity of the Signatures within FwCert block
+// 0-Capsule Payload signatures are current in FwCert block
+// 1-Capsule Payload Signatures are invalid
+#define CAPSULE_FLAGS_FWCERTBLOCK_VALID 0x00000008
+
+#pragma pack()
+#endif
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2012 American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Pkwy, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+//**********************************************************************
diff --git a/Include/AmiDebugPort.h b/Include/AmiDebugPort.h
new file mode 100644
index 0000000..7f0a25c
--- /dev/null
+++ b/Include/AmiDebugPort.h
@@ -0,0 +1,141 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2006, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+// $Header: /Alaska/SOURCE/Modules/DEBUGGER/Include/AmiDebugPort.h 7 10/30/07 10:49a Madhans $
+//
+// $Revision: 7 $
+//
+// $Date: 10/30/07 10:49a $
+//**********************************************************************
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/SOURCE/Modules/DEBUGGER/Include/AmiDebugPort.h $
+//
+// 7 10/30/07 10:49a Madhans
+// 1.20.0010 Eng Release
+//
+// 3 1/22/07 11:35a Madhans
+// Modification made for Binary Release 1.04.0003.
+//
+// 3 1/05/07 1:05p Ashrafj
+// Latest version 1.04.0001 Beta
+// Known issues from previous 1.04.000 Beta release has been fixed.
+//
+//**********************************************************************
+//*****************************************************************
+#ifndef _AMI_DEBUGPORT_H_
+#define _AMI_DEBUGPORT_H_
+
+#include "Hob.h"
+#include "Protocol\PciRootBridgeIo.h"
+#include "PciBus.h" //For Defn, of PCI_CFG_ADDR
+
+
+// {E894B313-54CA-4bb2-8CDD-851E8AC9027C}
+#define AMI_DEBUGPORT_HOB_GUID \
+ {0xe894b313, 0x54ca, 0x4bb2, 0x8c, 0xdd, 0x85, 0x1e, 0x8a, 0xc9, 0x2, 0x7c}
+
+typedef enum {
+ SERIAL,
+ USB2_EHCI, //currently only intel chipset has USB2 debug port on EHCI
+ USB2_UHCI, //for future chipset if any is going to support USB2 debug port
+ USB2_OHCI, //for future chipset if any is going to support USB2 debug port
+ LPT,
+ SMBUS_TO_USB
+}DEBUGPORT_TYPE;
+
+typedef struct _DEBUG_PORT_INFO
+{
+ DEBUGPORT_TYPE DebugPortType; //Type of physical Port used for communication
+ UINT64 BaseAddress; //BAR address
+ UINT64 Length; //Size of relocateable window size
+ UINT16 IRQn; //IRQ number
+ UINT8 BarOffset; //offset of this bar register in PCI_CFG space
+ UINT8 BarIndex; //Index from 0 to 5 of the the BAR
+ PCI_CFG_ADDR Address; //PCI configuration address like B,D,F for USB
+ //or Logical Device number in case Serial
+ PCI_BAR_TYPE BarType; //Type Of Resource (MMIO32/MMIO64/pfMMIO32/pfMMIO64/Io16/Io32)
+ //Offset=0x10 => Index=0;
+ //Offset=0x14 => Index=1;
+ //And soo on
+} DEBUG_PORT_INFO;
+
+typedef struct _AMI_DEBUGPORT_INFORMATION_HOB AMI_DEBUGPORT_INFORMATION_HOB; //forward declaration
+
+typedef EFI_STATUS (* GET_DEBUGPORT_PROPERTIES ) (
+ IN AMI_DEBUGPORT_INFORMATION_HOB *This,
+ IN OUT DEBUG_PORT_INFO *pDeviceInfo
+ );
+
+typedef EFI_STATUS (* SET_DEBUGPORT_RESOURCES) (
+ IN AMI_DEBUGPORT_INFORMATION_HOB *This,
+ IN EFI_BOOT_SERVICES *pBS,
+ IN DEBUG_PORT_INFO *pDeviceInfo
+ );
+
+typedef struct _AMI_DEBUGPORT_INFORMATION_HOB
+{
+ EFI_HOB_GUID_TYPE EfiHobGuidType;
+ DEBUG_PORT_INFO DeviceInfo;
+
+ GET_DEBUGPORT_PROPERTIES GetDebugPortProperties;
+
+ SET_DEBUGPORT_RESOURCES SetDebugPortResources;
+
+ UINT64 Reserved; //For PEI Debug support - do not use
+}
+AMI_DEBUGPORT_INFORMATION_HOB;
+
+typedef union _PEI_DBG_PORT_INFO PEI_DBG_PORT_INFO;
+typedef EFI_STATUS (PEI_INIT_FUNCTION) (IN OUT PEI_DBG_PORT_INFO *DebugPort);
+
+typedef struct _PEI_DBG_COM_PORT{
+ UINT16 COMBaseAddr;
+ UINT8 SIO_COM_LDN;
+}PEI_DBG_COM_PORT;
+
+typedef struct _PEI_DBG_USB_PORT{
+ UINT32 USBBaseAddr;
+ UINT32 USBDebugPortStartAddr;
+ UINT16 MemoryMappedIoSpaceSize;
+ UINT8 PciBusNumber;
+ UINT8 PciDeviceNumber;
+ UINT8 PciFunctionNumber;
+ UINT8 PciBAROffset;
+ PEI_INIT_FUNCTION *InitUSBEHCI;
+}PEI_DBG_USB_PORT;
+
+typedef union _PEI_DBG_PORT_INFO{
+ PEI_DBG_COM_PORT SerialPort;
+ PEI_DBG_USB_PORT UsbDebugPort;
+}PEI_DBG_PORT_INFO;
+
+#endif
+
+
+//****************************************************************
+//****************************************************************
+//** **
+//** (C)Copyright 1985-2006, American Megatrends Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 6145-F, Northbelt Parkway, Norcross, **
+//** **
+//** Georgia - 30071, USA. Phone-(770)-246-8600. **
+//** **
+//****************************************************************
+//****************************************************************
+
+
diff --git a/Include/AmiDxeLib.h b/Include/AmiDxeLib.h
new file mode 100644
index 0000000..2982104
--- /dev/null
+++ b/Include/AmiDxeLib.h
@@ -0,0 +1,1018 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2010, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/Projects/Intel/Haswell/LynxPoint_SharkBay-DT_Crb_1AQQW/Include/AmiDxeLib.h 2 10/25/12 8:50a Wesleychen $
+//
+// $Revision: 2 $
+//
+// $Date: 10/25/12 8:50a $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/Projects/Intel/Haswell/LynxPoint_SharkBay-DT_Crb_1AQQW/Include/AmiDxeLib.h $
+//
+// 2 10/25/12 8:50a Wesleychen
+// - Update Core to 4.6.5.4.
+// - Reprogram 'SaveStateMemPoll' functon.
+//
+// 68 7/19/12 5:08p Felixp
+// Declaration of the IsValidDevicePath is added.
+//
+// 67 4/30/12 3:59p Artems
+// [TAG] EIP N/A
+// [Category] Improvement
+// [Description] Modified GraphicsConsole driver to output whole string
+// instead of symbol-by-symbol output
+// [Files] Gc.c, AmiDxeLib.h, EfiLib.c, UefiHiiUtils.c
+//
+// 66 11/08/11 5:22p Oleksiyy
+// [TAG] EIP64296
+// [Category] New Feature
+// [Description] Creation and filling of Firmware Performance Data Table
+// is added.
+// [Files] AcpiCore.c, AmiDxeLib.h, CSM.c, DxeMain.c, EfiLib.c,
+// Image.c, S3Resume.c and FirmPerfDataTab.h
+//
+// 65 7/22/11 2:51p Oleksiyy
+// [TAG] EIP64391
+// [Category] Improvement
+// [Description] Some BOOT_SCRIPT_S3_xxx macros was updated with correct
+// parameters.
+// [Files] AmiDxeLib.h
+//
+// 64 7/22/11 10:03a Oleksiyy
+// [TAG] EIP64391
+// [Category] Improvement
+// [Description] Some BOOT_SCRIPT_S3_xxx macros was updated with correct
+// parameters.
+// [Files] AmiDxeLib.h
+//
+// 63 6/24/11 1:44p Felixp
+// PI definitions of the BOOT_SCRIPT_S3_ macros are updated to detect
+// which protocol to use (S3SaveState or BootScriptSave).
+//
+// 62 6/23/11 8:36p Artems
+// Backward compatibility bug fix - temporary disable new boot script till
+// modules are ready
+//
+// 61 6/16/11 3:42p Felixp
+//
+// 60 6/16/11 2:57p Felixp
+// Surround backward compatibility definitions with #if
+// BACKWARD_COMPATIBLE_MODE
+//
+// 59 6/16/11 9:24a Felixp
+// Enhancements:
+// 1. SMM-related functions and global variables are split into Framework
+// and PI instances. Proper instance is selected based on supported
+// version of the PI specification and module type.
+// 2. BOOT_SCRIPT_S3_... macros moved to AmiDxeLib.h from BootScripSave.h.
+// (both Framework and PI modes are supported).
+//
+// 58 2/05/11 2:02p Artems
+// Added helper function to initialize global pointers in SMM
+//
+// 57 11/17/10 4:30p Felixp
+// Declarations of EfiAtRuntime and EfiGoneVirtual functions are added.
+//
+// 56 10/01/10 2:57p Felixp
+// declaration of LibInitStatusCodePtr is added.
+//
+// 55 2/23/10 10:13p Felixp
+// HiiLibSetBrowserData function is added
+//
+// 54 10/14/09 10:41p Felixp
+//
+// 53 10/14/09 3:49p Felixp
+// HII_LIBRARY_FUNCTIONS_SUPPORT macro added.
+//
+// 52 10/09/09 4:28p Felixp
+// UEFI 2.1 related updates.
+//
+// 51 8/21/09 3:04p Felixp
+// LanguageCodesEqual function is added.
+//
+// 50 5/21/09 4:28p Felixp
+// New function InitAmiRuntimeLib is added.
+// The function can be used by Runtime drivers to initialize library
+// (the function calls InitAmiLib) and register callbacks
+// on exit boot services and virtual address change events.
+//
+// 49 5/14/09 9:42a Felixp
+// New functions: InitSmmHandlerEx and GetSmstConfigurationTable are
+// added.
+//
+// 48 9/30/08 12:09a Felixp
+// WriteBootToOsPerformanceData function added
+//
+// 47 6/06/08 10:47a Felixp
+//
+// 44 9/04/07 12:10p Felixp
+// TheImageHandle global variable is added. The variable is initialized in
+// the InitAmiLib routine with the current image handle.
+//
+// 43 8/30/07 11:03p Felixp
+// GetBootMode routine is added. The routine can be used by DXE/EFI
+// modules to get current boot mode.
+//
+// 42 4/20/07 5:08p Felixp
+// Status Code macros redefined
+//
+// 41 4/19/07 12:31p Felixp
+// New functions added: LibGetDxeSvcTbl and LibAllocateCspResource
+// LibAllocateCspResource replaces AllocCspResource
+// AllocCspResource preserved for backward compatibility.
+//
+// 39 4/17/07 10:56a Yakovlevs
+// AllocCspResource function preserved for compatibility witn core 4.5.3
+//
+// 36 4/13/07 6:51p Yakovlevs
+// Added function prototype LibGetDxeSvcTbl()
+// changed name of AllocateCspResource() to LibAllocateCspResource
+//
+//
+// EFI_HANDLE ImgHandle,EFI_HANDLE CntrHandle);
+//
+//
+// 35 3/08/07 3:01a Felixp
+// Status code reporting macros PROGRESS_CODE and ERROR_CODE added
+//
+// 34 2/12/07 1:37p Felixp
+//
+// 33 2/12/07 1:19p Felixp
+// DPGetEndNode declaration added
+//
+// 32 11/26/06 11:49p Yakovlevs
+// Added Functions AmiIsaIrqMAsk() and AmiIsaDmaMask() to sinchronize IRQ
+// allocation in SIO and CSM modules
+//
+// 31 11/26/06 11:00p Yakovlevs
+// Added AMI_IRQ_DMA_MASK_VARIABLE_GUID
+//
+// 30 10/13/06 2:36p Felixp
+//
+// 29 10/12/06 6:43p Felixp
+// DPNextInstance, DPCreateNode, DPIsMultiInstance functions added
+//
+// 28 10/12/06 9:37a Felixp
+// CreateLegacyBootEvent & CreateReadyToBootEvent functions added
+//
+// 27 9/08/06 9:20a Felixp
+//
+// 26 8/24/06 9:10a Felixp
+// x64 support
+//
+// 25 5/20/06 9:35p Felixp
+//
+// 24 3/13/06 1:15a Felixp
+//
+// 23 11/16/05 11:15a Yakovlevs
+// DPCmp(), DPCut() functions added
+//
+// 22 11/11/05 2:47p Felixp
+// GetControllerName added
+//
+// 21 11/11/05 11:47a Markw
+// Renamed IntallSmmHandler to InitSmmHandler because of build errors
+// because another driver used InstallSmmHandler.
+//
+// 20 11/08/05 5:59p Markw
+// Created InstallSmiHandler library function.
+//
+// 19 11/07/05 3:15p Felixp
+// CopyItemLst prototype added
+//
+// 18 6/29/05 10:41a Yakovlevs
+//
+// 17 6/28/05 6:45p Yakovlevs
+// Added: Function AllocCspResources() and CSP_RES_ITEM Structure
+// definition
+//
+// 16 6/03/05 3:45p Yakovlevs
+//
+// 15 4/06/05 9:33a Felixp
+// Function LoadStrings added
+//
+// 14 4/04/05 2:58p Felixp
+// LoadResources function added
+//
+// 13 3/25/05 11:34a Felixp
+// RegisterProtocolCallback function added
+//
+// 12 3/21/05 11:46a Felixp
+// Bit definitions moved from AmiDxeLib.h to AmiLib.h
+//
+// 11 3/17/05 1:28p Felixp
+// ReadImageResource funciton added
+//
+// 10 3/04/05 10:21a Mandal
+//
+// 9 3/03/05 12:31p Felixp
+// GetDefaultLang added
+//
+// 8 2/11/05 5:51p Felixp
+// DPAddNode, DPAddInstance functions added
+//
+// 7 2/08/05 5:24p Felixp
+// Parameter added to DPIsOneOf.
+//
+// 6 2/07/05 5:20p Felixp
+// GetEfiVariable funciton added
+//
+// 5 2/07/05 4:22p Yakovlevs
+//
+// 4 2/03/05 8:00p Felixp
+// DPLength and DPIsOneOf functions added
+//
+// 3 2/01/05 2:27a Felixp
+//
+// 2 2/01/05 2:00a Felixp
+// I/O routine declarations moved from AmiDxeLib.h to AmiLib.h
+//
+// 1 1/28/05 12:44p Felixp
+//
+// 3 1/18/05 3:21p Felixp
+// PrintDebugMessage renamed to Trace
+//
+// 2 1/17/05 3:46p Andriyn
+//
+// 1 12/23/04 9:41a Felixp
+//
+// 31 12/20/04 5:07p Felixp
+//
+// 30 12/17/04 6:45p Felixp
+// DEBUG_MSG renamed to TRACE
+//
+// 29 12/17/04 6:40p Olegi
+//
+// 28 12/16/04 6:34a Felixp
+//
+// 27 11/19/04 1:33a Felixp
+// GetImageName debug routine added (image name by image handle)
+//
+// 26 11/18/04 6:10p Felixp
+// FindNextHobByType removed (moved to AmiLib.h)
+//
+// 25 11/17/04 3:31p Markw
+//
+// 24 11/16/04 5:03p Markw
+// Added ASSERT.
+//
+// 23 11/10/04 5:15p Felixp
+// Level parameter added to Trace fucntion
+//
+// 22 11/02/04 5:33p Felixp
+//
+// 21 10/22/04 7:35p Felixp
+//
+// 20 10/14/04 12:04p Felixp
+//
+// 19 9/22/04 8:39p Yakovlevs
+// Added definition of GCD - TestRegion() Function to check if reg1
+// belongs to reg2
+//
+// 18 8/28/04 1:49a Felixp
+// NVRAM Routines fixes
+//
+// 17 8/10/04 1:03p Yakovlevs
+//
+// 16 8/06/04 12:17p Yakovlevs
+// Defined BIT mask from BIT00 to BIT32 to help set it in chipset
+// registers
+//
+// 15 7/13/04 10:42a Felixp
+//
+// 14 4/22/04 5:39p Markw
+// Changed FvReadFile to FvReadPe32Image.
+//
+// 13 4/17/04 4:23p Felixp
+//
+// 12 4/14/04 11:01a Markw
+// Added FvReadFile.
+//
+// 11 4/13/04 5:37p Felixp
+//
+// 10 4/13/04 5:36p Felixp
+//
+// 9 4/11/04 2:49p Felixp
+//
+// 8 4/10/04 4:38p Felixp
+//
+// 7 4/07/04 12:46a Felixp
+// REAL PLATFORM DEBUGGING (lots of bug fixes)
+//
+// 6 4/05/04 1:10a Felixp
+//
+// 5 3/30/04 3:26p Felixp
+//
+// 4 3/30/04 9:32a Markw
+// Added DEBUG_MSG macro.
+//
+// 3 3/28/04 2:11p Felixp
+// 1. PE Loader and some other commonly used code moved to the Library
+// 2. Warnings fixed (from now on warning will be treated as error)
+//
+// 2 3/24/04 1:29p Felixp
+//
+// 1 3/23/04 5:52p Felixp
+//
+//**********************************************************************
+//<AMI_FHDR_START>
+//
+// Name: AmiDxeLib.h
+//
+// Description:
+//
+//<AMI_FHDR_END>
+//**********************************************************************
+#ifndef __AMI_DXE_LIB__H__
+#define __AMI_DXE_LIB__H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+#include <amilib.h>
+#include <Dxe.h>
+#include <Protocol/FirmwareVolume.h>
+#include <Protocol/HiiUtilities.h>
+#include <Protocol/SmmBase.h>
+#include <Protocol/SmmBase2.h>
+#include <Protocol/BootScriptSave.h>
+#if PI_SPECIFICATION_VERSION >= 0x0001000A
+#include <Protocol/S3SaveState.h>
+#endif
+
+//****************************************************************************/
+// TYPE DECLARATIONS
+//****************************************************************************/
+//**********************************************************************
+//<AMI_THDR_START>
+//
+// Name: DBE_DATABASE_STRUCT
+//
+// Fields:
+// ColNum Type Description
+// 1 UINTN Initial elements Count of index array to be created
+// 2 UINTN Current RecordCount stored in Database
+// 3 UINTN Number of Indexes in Database
+// 4 DBE_INDEX* Pointerto the indexes information of this Database;
+// 5 VOID *IndexArray;
+//
+// Description: Initial structure to hold Database information
+//
+// Notes:
+//
+//<AMI_THDR_END>
+//**********************************************************************
+
+typedef struct _DBE_KEY_FIELD DBE_KEY_FIELD;
+
+typedef INTN (EFIAPI *DBE_CMP)(
+ IN VOID *pContext,
+ IN VOID *pRecord1,
+ IN VOID *pRecord2
+);
+
+struct _DBE_KEY_FIELD {
+ DBE_CMP RRcmp;
+ DBE_CMP KRcmp;
+ VOID *pContext;
+};
+
+typedef struct _DBE_OFFSET_KEY_CONTEXT {
+ UINTN Offset;
+ UINTN Size;
+}DBE_OFFSET_KEY_CONTEXT;
+
+typedef struct _DBE_DATABASE{
+ EFI_MEMORY_TYPE MemoryType;
+ UINTN InitialCount;
+ UINTN RecordCount;
+ UINTN KeyCount;
+ DBE_KEY_FIELD *KeyField;
+ VOID *IndexArray;
+}DBE_DATABASE;
+
+struct _DLINK;
+typedef struct _DLINK DLINK;
+struct _DLINK{
+ DLINK *pNext, *pPrev;
+};
+
+typedef struct _DLIST{
+ UINTN Size;
+ DLINK *pHead, *pTail;
+} DLIST;
+
+//Structure to store pointers to data
+//similar to VECTOR
+typedef struct _T_ITEM_LIST {
+ UINTN InitialCount;
+ UINTN ItemCount;
+ VOID **Items;
+}T_ITEM_LIST;
+
+//Structure to reserve CSP resources
+typedef struct _CSP_RES_ITEM {
+ UINT64 ResBase;
+ UINTN ResLength;
+ UINTN ResType;
+ UINT64 Attributes;
+} CSP_RES_ITEM;
+
+#pragma pack(push,1)
+typedef struct{
+ EFI_GUID SubtypeGuid;
+ UINT32 NumberOfPackages;
+} HII_RESOURCE_SECTION_HEADER;
+#pragma pack(pop)
+
+//****************************************************************************/
+// MACROS DECLARATIONS
+//****************************************************************************/
+#define AMI_IRQ_DMA_MASK_VARIABLE_GUID \
+ { 0xfc8be767, 0x89f1, 0x4d6e, 0x80, 0x99, 0x6f, 0x2, 0x1e, 0xbc, 0x87, 0xcc }
+
+// {395C33FE-287F-413e-A055-8088C0E1D43E}
+#define EFI_SMM_RUNTIME_SERVICES_TABLE_GUID \
+ { 0x395c33fe, 0x287f, 0x413e, { 0xa0, 0x55, 0x80, 0x88, 0xc0, 0xe1, 0xd4, 0x3e } }
+
+#define OFFSET_CONTEXT(Type, Field) { EFI_FIELD_OFFSET(Type,Field), EFI_FIELD_SIZE(Type,Field) }
+#define OFFSET_KEY(Context) { &OffsetRRCmp, &OffsetKRCmp, &Context }
+#define ADDRESS_KEY { &AddrRRCmp, &AddrKRCmp, NULL }
+
+#define new(Type) Malloc(sizeof(Type))
+#define delete(p) FreePool(p)
+#define DListEmpty(pList) (!(pList)->pHead)
+
+#ifdef EFI_DEBUG
+#define TRACE(Arguments) Trace Arguments
+
+#ifndef ASSERT
+#define ASSERT(Condition) if(!(Condition)) { \
+ Trace(-1,"ASSERT in %s on %i: %s\n",__FILE__, __LINE__, #Condition);\
+ EFI_DEADLOOP() \
+ }
+#define ASSERT_EFI_ERROR(Status) ASSERT(!EFI_ERROR(Status))
+#endif
+
+#define VERIFY ASSERT
+#define VERIFY_EFI_ERROR ASSERT_EFI_ERROR
+
+#else // EFI_DEBUG==0
+#define TRACE(Arguments)
+
+#ifndef ASSERT
+#define ASSERT(Condition)
+#define ASSERT_EFI_ERROR(Status)
+
+#endif
+
+#define VERIFY(x) (x)
+#define VERIFY_EFI_ERROR(x) (x)
+#endif
+
+#define PROGRESS_CODE(Code)\
+ LibReportStatusCode(EFI_PROGRESS_CODE, Code, 0, NULL, NULL)
+
+#define ERROR_CODE(Code, Severity)\
+ LibReportStatusCode(EFI_ERROR_CODE|(Severity), Code, 0, NULL, NULL)
+
+#define DEVICE_PROGRESS_CODE(Code,DeviceHandle)\
+ LibReportStatusCode(EFI_PROGRESS_CODE, Code, 0, NULL, NULL)
+
+#define DEVICE_ERROR_CODE(Code, Severity, DeviceHandle)\
+ LibReportStatusCode(EFI_ERROR_CODE|(Severity), Code, 0, NULL, NULL)
+
+//Performance Measurement Macros
+#ifdef EFI_DXE_PERFORMANCE
+#define PERF_START(handle, token, host, ticker) StartMeasure (handle, token, host, ticker)
+#define PERF_END(handle, token, host, ticker) EndMeasure (handle, token, host, ticker)
+#define PERF_CODE(code) code
+#else
+#define PERF_START(handle, token, host, ticker)
+#define PERF_END(handle, token, host, ticker)
+#define PERF_CODE(code)
+#endif
+
+#if (EFI_SPECIFICATION_VERSION > 0x00020000)
+#define LANGUAGE_RFC_4646
+#define LANGUAGE_CODE_ENGLISH "en-US"
+#else
+#define LANGUAGE_ISO_639_2
+#define LANGUAGE_CODE_ENGLISH "eng"
+#endif
+
+#define HII_RESOURCES_FFS_SECTION_GUID\
+ {0x97e409e6, 0x4cc1, 0x11d9, 0x81, 0xf6, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}
+
+//the macro serves as an indicator that this version of library
+//contains HII-related functions such as HiiLibGetString/HiiLibSetString
+#define HII_LIBRARY_FUNCTIONS_SUPPORT
+
+#if (!defined(BACKWARD_COMPATIBLE_MODE) || defined(SMM_BUILD)) && PI_SPECIFICATION_VERSION >= 0x0001000A
+#define pSmst pSmstPi
+#define pSmmBase pSmmBasePi
+#define GetSmstConfigurationTable GetSmstConfigurationTablePi
+#define InitSmmHandler InitSmmHandlerPi
+#define InitSmmHandlerEx InitSmmHandlerPi
+#define InitAmiSmmLib InitAmiSmmLibPi
+#else
+#define pSmst pSmstFramework
+#define pSmmBase pSmmBaseFramework
+#define GetSmstConfigurationTable GetSmstConfigurationTableFramework
+#define InitSmmHandler InitSmmHandlerFramework
+#define InitSmmHandlerEx InitSmmHandlerExFramework
+#define InitAmiSmmLib InitAmiSmmLibFramework
+#endif
+
+//Boot Script macros
+#if PI_SPECIFICATION_VERSION >= 0x0001000A
+#if BACKWARD_COMPATIBLE_MODE
+#define __PI_BOOT_SCRIPT_MACRO__(This, FrameworkCommand, PiCommand)\
+ ( (This==_GetBootScriptSaveInterface()) ? (FrameworkCommand) : (PiCommand) )
+#else
+#define __PI_BOOT_SCRIPT_MACRO__(This, FrameworkCommand, PiCommand) PiCommand
+#endif
+
+// S3SaveStateProtocol
+#define BOOT_SCRIPT_S3_IO_WRITE_MACRO(This, Width, Address, Count, Buffer) \
+ __PI_BOOT_SCRIPT_MACRO__(This,\
+ BOOT_SCRIPT_IO_WRITE_MACRO(This, EFI_ACPI_S3_RESUME_SCRIPT_TABLE, Width, Address, Count, Buffer),\
+ ((EFI_S3_SAVE_STATE_PROTOCOL*)This)->Write((EFI_S3_SAVE_STATE_PROTOCOL*)This,EFI_BOOT_SCRIPT_IO_WRITE_OPCODE,Width,(UINT64)Address,(UINTN)Count,Buffer)\
+ )
+
+#define BOOT_SCRIPT_S3_IO_READ_WRITE_MACRO(This,Width,Address,Data,DataMask) \
+ __PI_BOOT_SCRIPT_MACRO__(This,\
+ BOOT_SCRIPT_IO_READ_WRITE_MACRO(This,EFI_ACPI_S3_RESUME_SCRIPT_TABLE,Width,Address,Data,DataMask),\
+ ((EFI_S3_SAVE_STATE_PROTOCOL*)This)->Write((EFI_S3_SAVE_STATE_PROTOCOL*)This,EFI_BOOT_SCRIPT_IO_READ_WRITE_OPCODE,Width,(UINT64)Address,Data,DataMask)\
+ )
+
+#define BOOT_SCRIPT_S3_MEM_WRITE_MACRO(This,Width,Address,Count,Buffer) \
+ __PI_BOOT_SCRIPT_MACRO__(This,\
+ BOOT_SCRIPT_MEM_WRITE_MACRO(This,EFI_ACPI_S3_RESUME_SCRIPT_TABLE,Width,Address,Count,Buffer),\
+ ((EFI_S3_SAVE_STATE_PROTOCOL*)This)->Write((EFI_S3_SAVE_STATE_PROTOCOL*)This,EFI_BOOT_SCRIPT_MEM_WRITE_OPCODE,Width,(UINT64)Address,(UINTN)Count,Buffer)\
+ )
+
+#define BOOT_SCRIPT_S3_MEM_READ_WRITE_MACRO(This,Width,Address,Data,DataMask) \
+ __PI_BOOT_SCRIPT_MACRO__(This,\
+ BOOT_SCRIPT_MEM_READ_WRITE_MACRO(This,EFI_ACPI_S3_RESUME_SCRIPT_TABLE,Width,Address,Data,DataMask),\
+ ((EFI_S3_SAVE_STATE_PROTOCOL*)This)->Write((EFI_S3_SAVE_STATE_PROTOCOL*)This,EFI_BOOT_SCRIPT_MEM_READ_WRITE_OPCODE,Width,(UINT64)Address,Data,DataMask)\
+ )
+
+#define BOOT_SCRIPT_S3_PCI_CONFIG_WRITE_MACRO(This,Width,Address,Count,Buffer) \
+ __PI_BOOT_SCRIPT_MACRO__(This,\
+ BOOT_SCRIPT_PCI_CONFIG_WRITE_MACRO(This,EFI_ACPI_S3_RESUME_SCRIPT_TABLE,Width,Address,Count,Buffer),\
+ ((EFI_S3_SAVE_STATE_PROTOCOL*)This)->Write((EFI_S3_SAVE_STATE_PROTOCOL*)This,EFI_BOOT_SCRIPT_PCI_CONFIG_WRITE_OPCODE,Width,(UINT64)Address,(UINTN)Count,Buffer)\
+ )
+
+#define BOOT_SCRIPT_S3_PCI_CONFIG_READ_WRITE_MACRO(This,Width,Address,Data,DataMask) \
+ __PI_BOOT_SCRIPT_MACRO__(This,\
+ BOOT_SCRIPT_PCI_CONFIG_READ_WRITE_MACRO(This,EFI_ACPI_S3_RESUME_SCRIPT_TABLE,Width,Address,Data,DataMask),\
+ ((EFI_S3_SAVE_STATE_PROTOCOL*)This)->Write((EFI_S3_SAVE_STATE_PROTOCOL*)This,EFI_BOOT_SCRIPT_PCI_CONFIG_READ_WRITE_OPCODE,Width,(UINT64)Address,Data,DataMask)\
+ )
+
+#define BOOT_SCRIPT_S3_SMBUS_EXECUTE_MACRO(This,SlaveAddress,Command,Operation,PecCheck,Length,Buffer) \
+ __PI_BOOT_SCRIPT_MACRO__(This,\
+ BOOT_SCRIPT_SMBUS_EXECUTE_MACRO(This,EFI_ACPI_S3_RESUME_SCRIPT_TABLE,SlaveAddress,Command,Operation,PecCheck,Length,Buffer),\
+ ((EFI_S3_SAVE_STATE_PROTOCOL*)This)->Write((EFI_S3_SAVE_STATE_PROTOCOL*)This,EFI_BOOT_SCRIPT_SMBUS_EXECUTE_OPCODE,SlaveAddress,Command,Operation,PecCheck,Length,Buffer)\
+ )
+
+#define BOOT_SCRIPT_S3_STALL_MACRO(This,Duration) \
+ __PI_BOOT_SCRIPT_MACRO__(This,\
+ BOOT_SCRIPT_STALL_MACRO(This,EFI_ACPI_S3_RESUME_SCRIPT_TABLE,Duration),\
+ ((EFI_S3_SAVE_STATE_PROTOCOL*)This)->Write((EFI_S3_SAVE_STATE_PROTOCOL*)This,EFI_BOOT_SCRIPT_STALL_OPCODE,Duration)\
+ )
+
+#define BOOT_SCRIPT_S3_DISPATCH_MACRO(This,EntryPoint) \
+ __PI_BOOT_SCRIPT_MACRO__(This,\
+ BOOT_SCRIPT_DISPATCH_MACRO(This,EFI_ACPI_S3_RESUME_SCRIPT_TABLE,EntryPoint),\
+ ((EFI_S3_SAVE_STATE_PROTOCOL*)This)->Write((EFI_S3_SAVE_STATE_PROTOCOL*)This,EFI_BOOT_SCRIPT_DISPATCH_2_OPCODE,(EFI_PHYSICAL_ADDRESS)EntryPoint,NULL)\
+ )
+
+#define BOOT_SCRIPT_S3_IO_POLL_MACRO(This,Width,Address,Mask,Data) \
+ __PI_BOOT_SCRIPT_MACRO__(This,\
+ BOOT_SCRIPT_IO_POLL_MACRO(This,EFI_ACPI_S3_RESUME_SCRIPT_TABLE,Width,Address,Mask,Data),\
+ ((EFI_S3_SAVE_STATE_PROTOCOL*)This)->Write((EFI_S3_SAVE_STATE_PROTOCOL*)This,EFI_BOOT_SCRIPT_IO_POLL_OPCODE,Width,(UINT64)Address,Data,Mask,(UINT64)-1)\
+ )
+
+#define BOOT_SCRIPT_S3_IO_POLL2_MACRO(This,Width,Address,Mask,Data,Delay) \
+ This->Write(This,EFI_BOOT_SCRIPT_IO_POLL_OPCODE,Width,(UINT64)Address,Data,Mask,(UINT64)Delay)
+
+#if 0
+#define BOOT_SCRIPT_S3_MEM_POLL_MACRO(This,Width,Address,Mask,Data) \
+ __PI_BOOT_SCRIPT_MACRO__(This,\
+ BOOT_SCRIPT_MEM_POLL_MACRO(This,EFI_ACPI_S3_RESUME_SCRIPT_TABLE,Width,Address,Mask,Data),\
+ ((EFI_S3_SAVE_STATE_PROTOCOL*)This)->Write((EFI_S3_SAVE_STATE_PROTOCOL*)This,EFI_BOOT_SCRIPT_MEM_POLL_OPCODE,Width,(UINT64)Address,Data,Mask,(UINT64)-1)\
+ )
+
+#define BOOT_SCRIPT_S3_MEM_POLL2_MACRO(This,Width,Address,Mask,Data,Delay) \
+ This->Write(This,EFI_BOOT_SCRIPT_MEM_POLL_OPCODE,Width,(UINT64)Address,Data,Mask,(UINT64)Delay)
+#else
+#define BOOT_SCRIPT_S3_MEM_POLL_MACRO(This,Width,Address,Mask,Data) \
+ __PI_BOOT_SCRIPT_MACRO__(This,\
+ BOOT_SCRIPT_MEM_POLL_MACRO(This,EFI_ACPI_S3_RESUME_SCRIPT_TABLE,Width,Address,Mask,Data),\
+ ((EFI_S3_SAVE_STATE_PROTOCOL*)This)->Write((EFI_S3_SAVE_STATE_PROTOCOL*)This,EFI_BOOT_SCRIPT_MEM_POLL_OPCODE,Width,(UINT64)Address,Mask,Data,(UINT64)-1)\
+ )
+
+#define BOOT_SCRIPT_S3_MEM_POLL2_MACRO(This,Width,Address,Mask,Data,Delay) \
+ This->Write(This,EFI_BOOT_SCRIPT_MEM_POLL_OPCODE,Width,(UINT64)Address,Mask,Data,(UINT64)Delay)
+#endif
+
+#define BOOT_SCRIPT_S3_PCI_POLL_MACRO(This,Width,Address,Mask,Data) \
+ __PI_BOOT_SCRIPT_MACRO__(This,\
+ BOOT_SCRIPT_PCI_POLL_MACRO(This,EFI_ACPI_S3_RESUME_SCRIPT_TABLE,Width,Address,Mask,Data),\
+ ((EFI_S3_SAVE_STATE_PROTOCOL*)This)->Write((EFI_S3_SAVE_STATE_PROTOCOL*)This,EFI_BOOT_SCRIPT_PCI_CONFIG_POLL_OPCODE,Width,(UINT64)Address,Data,Mask,(UINT64)-1)\
+ )
+
+#define BOOT_SCRIPT_S3_PCI_POLL2_MACRO(This,Width,Address,Mask,Data,Delay) \
+ This->Write(This,EFI_BOOT_SCRIPT_PCI_CONFIG_POLL_OPCODE,Width,(UINT64)Address,Data,Mask,(UINT64)Delay)
+
+#define BOOT_SCRIPT_S3_DISPATCH_2_MACRO(This,EntryPoint,Context) \
+ This->Write(This,EFI_BOOT_SCRIPT_DISPATCH_2_OPCODE,(EFI_PHYSICAL_ADDRESS)EntryPoint,(EFI_PHYSICAL_ADDRESS)Context)
+
+#define BOOT_SCRIPT_S3_PCI_CONFIG2_WRITE_MACRO(This,Width,Segment,Address,Count,Buffer) \
+ This->Write(This,EFI_BOOT_SCRIPT_PCI_CONFIG2_WRITE_OPCODE,Width,(UINT16)Segment,(UINT64)Address,(UINTN)Count,Buffer)
+
+#define BOOT_SCRIPT_S3_PCI_CONFIG2_READ_WRITE_MACRO(This,Width,Segment,Address,Data,DataMask) \
+ This->Write(This,EFI_BOOT_SCRIPT_PCI_CONFIG2_READ_WRITE_OPCODE,Width,(UINT16)Segment,(UINT64)Address,Data,DataMask)
+
+#define BOOT_SCRIPT_S3_PCI_CFG2_POLL_MACRO(This,Width,Segment,Address,Mask,Result,Delay) \
+ This->Write(This,EFI_BOOT_SCRIPT_PCI_CONFIG2_POLL_OPCODE,Width,(UINT16)Segment,(UINT64)Address,Mask,Result,(UINT64)Delay)
+
+#else // #if PI_SPECIFICATION_VERSION >= 0x0001000A
+
+// BootScriptSave
+//************************************************
+// S3 specific macros below. Generic macros below.
+//************************************************
+#define BOOT_SCRIPT_S3_IO_WRITE_MACRO(This,Width,Address,Count,Buffer) \
+ BOOT_SCRIPT_IO_WRITE_MACRO(This, EFI_ACPI_S3_RESUME_SCRIPT_TABLE, Width, Address, Count, Buffer)
+
+#define BOOT_SCRIPT_S3_IO_READ_WRITE_MACRO(This,Width,Address,Data,DataMask) \
+ BOOT_SCRIPT_IO_READ_WRITE_MACRO(This,EFI_ACPI_S3_RESUME_SCRIPT_TABLE,Width,Address,Data,DataMask)
+
+#define BOOT_SCRIPT_S3_MEM_WRITE_MACRO(This,Width,Address,Count,Buffer) \
+ BOOT_SCRIPT_MEM_WRITE_MACRO(This,EFI_ACPI_S3_RESUME_SCRIPT_TABLE,Width,Address,Count,Buffer)
+
+#define BOOT_SCRIPT_S3_MEM_READ_WRITE_MACRO(This,Width,Address,Data,DataMask) \
+ BOOT_SCRIPT_MEM_READ_WRITE_MACRO(This,EFI_ACPI_S3_RESUME_SCRIPT_TABLE,Width,Address,Data,DataMask)
+
+#define BOOT_SCRIPT_S3_PCI_CONFIG_WRITE_MACRO(This,Width,Address,Count,Buffer) \
+ BOOT_SCRIPT_PCI_CONFIG_WRITE_MACRO(This,EFI_ACPI_S3_RESUME_SCRIPT_TABLE,Width,Address,Count,Buffer)
+
+#define BOOT_SCRIPT_S3_PCI_CONFIG_READ_WRITE_MACRO(This,Width,Address,Data,DataMask) \
+ BOOT_SCRIPT_PCI_CONFIG_READ_WRITE_MACRO(This,EFI_ACPI_S3_RESUME_SCRIPT_TABLE,Width,Address,Data,DataMask)
+
+#define BOOT_SCRIPT_S3_SMBUS_EXECUTE_MACRO(This,SlaveAddress,Command,Operation,PecCheck,Length,Buffer) \
+ BOOT_SCRIPT_SMBUS_EXECUTE_MACRO(This,EFI_ACPI_S3_RESUME_SCRIPT_TABLE,SlaveAddress,Command,Operation,PecCheck,Length,Buffer)
+
+#define BOOT_SCRIPT_S3_STALL_MACRO(This,Duration) \
+ BOOT_SCRIPT_STALL_MACRO(This,EFI_ACPI_S3_RESUME_SCRIPT_TABLE,Duration)
+
+#define BOOT_SCRIPT_S3_DISPATCH_MACRO(This,EntryPoint) \
+ BOOT_SCRIPT_DISPATCH_MACRO(This,EFI_ACPI_S3_RESUME_SCRIPT_TABLE,EntryPoint)
+
+//OEM
+#define BOOT_SCRIPT_S3_IO_POLL_MACRO(This,Width,Address,Mask,Result) \
+ BOOT_SCRIPT_IO_POLL_MACRO(This,EFI_ACPI_S3_RESUME_SCRIPT_TABLE,Width,Address,Mask,Result)
+
+#define BOOT_SCRIPT_S3_MEM_POLL_MACRO(This,Width,Address,Mask,Result) \
+ BOOT_SCRIPT_MEM_POLL_MACRO(This,EFI_ACPI_S3_RESUME_SCRIPT_TABLE,Width,Address,Mask,Result)
+
+#define BOOT_SCRIPT_S3_PCI_POLL_MACRO(This,Width,Address,Mask,Result) \
+ BOOT_SCRIPT_PCI_POLL_MACRO(This,EFI_ACPI_S3_RESUME_SCRIPT_TABLE,Width,Address,Mask,Result)
+#endif // #if PI_SPECIFICATION_VERSION >= 0x0001000A
+
+//****************************************************************************/
+// VARIABLE DECLARATIONS
+//****************************************************************************/
+extern EFI_SYSTEM_TABLE *pST;
+extern EFI_BOOT_SERVICES *pBS;
+extern EFI_RUNTIME_SERVICES *pRS;
+#if (!defined(BACKWARD_COMPATIBLE_MODE) || defined(SMM_BUILD)) && PI_SPECIFICATION_VERSION >= 0x0001000A
+extern EFI_SMM_BASE2_PROTOCOL *pSmmBasePi;
+extern EFI_SMM_SYSTEM_TABLE2 *pSmstPi;
+#else
+extern EFI_SMM_BASE_PROTOCOL *pSmmBaseFramework;
+extern EFI_SMM_SYSTEM_TABLE *pSmstFramework;
+#endif
+extern EFI_HANDLE TheImageHandle;
+extern EFI_GUID guidDevicePath;
+extern EFI_GUID guidFV;
+//****************************************************************************/
+// FUNCTION DECLARATIONS
+//****************************************************************************/
+VOID * GetEfiConfigurationTable(
+ IN EFI_SYSTEM_TABLE *SystemTable,
+ IN EFI_GUID *Guid
+);
+
+DBE_DATABASE* DbeCreateDatabase(UINTN KeyCount, UINTN InitialCount);
+
+EFI_STATUS DbeInsert(DBE_DATABASE *Database,VOID* Record);
+
+EFI_STATUS DbeLocateKey(IN DBE_DATABASE *Database,IN UINTN KeyNo,IN VOID *KeyValue,OUT VOID **Record,OUT INT8 *Vicinity, OPTIONAL OUT UINTN *RecordIndex);
+
+EFI_STATUS DbeGoToIndex(IN DBE_DATABASE *Database,IN UINTN KeyNo, IN INTN Index, OUT VOID **Record);
+
+EFI_STATUS DbeDelete(IN DBE_DATABASE *Database, IN VOID* Data, BOOLEAN FreeData);
+
+INTN OffsetRRCmp(
+ IN VOID *pContext, IN VOID *pRecord1, IN VOID *pRecord2
+);
+
+INTN OffsetKRCmp(
+ IN VOID *pContext, IN VOID *pKey, IN VOID *pRecord
+);
+
+INTN AddrRRCmp(
+ IN VOID* *pContext, VOID *pRecord1, VOID *pRecord2
+);
+
+INTN AddrKRCmp(
+ IN DBE_OFFSET_KEY_CONTEXT *pContext, VOID *pKey, VOID *pRecord
+);
+
+//List functions
+VOID DListInit(DLIST* pList);
+VOID DListAdd(DLIST* pList, DLINK* pElement);
+VOID DListDelete(DLIST* pList, DLINK* pElement);
+VOID DListInsert(DLIST* pList, DLINK* pElement, DLINK* pAfter);
+
+/*
+EFI_STATUS DbeAddIndexKeyEntry(DBE_DATABASE *Database, UINTN KeyNo, VOID* Data);
+
+EFI_STATUS DbeNext(IN DBE_DATABASE *Database,IN UINTN KeyNo,IN OUT VOID **Record);
+
+EFI_STATUS DbePrev(IN DBE_DATABASE *Database,IN UINTN KeyNo,IN OUT VOID **Record);
+
+EFI_STATUS DbeFirst(IN DBE_DATABASE *Database,IN UINTN KeyNo, OUT VOID **Record);
+
+EFI_STATUS DbeLast(IN DBE_DATABASE *Database,IN UINTN KeyNo, OUT VOID **Record);
+
+EFI_STATUS DbeDelIndexKeyEntry(IN DBE_DATABASE *Database, IN UINTN KeyNo, IN VOID* Data);
+
+VOID* DbeGetKeyPtrValue(IN DBE_DATABASE *Database, IN UINTN KeyNo, VOID* Data);
+
+VOID* DbeGetKeyPtrAddr(IN DBE_DATABASE *Database, IN UINTN KeyNo, VOID* Data);
+
+VOID* DbeGetKeyPtrPtr(IN DBE_DATABASE *Database, IN UINTN KeyNo, VOID* Data);
+*/
+
+#ifdef EFI_DEBUG
+void Trace(UINTN /* Level*/, CHAR8 * /*sFormat*/,...);
+void PrintDebugMessageVaList(UINTN /* Level*/, CHAR8 * /*sFormat*/, va_list /*ArgList*/);
+BOOLEAN GetImageName(EFI_HANDLE ImageHandle, CHAR8 *sName);
+#endif
+BOOLEAN GetControllerName(EFI_HANDLE Controller, CHAR16 **wsName);
+
+void* Malloc(UINTN Size);
+
+void* MallocZ(UINTN Size);
+
+VOID InitAmiLib(
+ IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable
+);
+
+UINTN DPLength(EFI_DEVICE_PATH_PROTOCOL *pDp);
+VOID* DPCopy(EFI_DEVICE_PATH_PROTOCOL *pDp);
+VOID* DPAdd(EFI_DEVICE_PATH_PROTOCOL *pDp1, EFI_DEVICE_PATH_PROTOCOL *pDp2);
+VOID* DPAddNode(EFI_DEVICE_PATH_PROTOCOL *pDp1, EFI_DEVICE_PATH_PROTOCOL *pDp2);
+VOID* DPAddInstance(EFI_DEVICE_PATH_PROTOCOL *pDp1, EFI_DEVICE_PATH_PROTOCOL *pDp2);
+VOID* DPGetLastNode(EFI_DEVICE_PATH_PROTOCOL *pDp);
+INTN DPCmp(EFI_DEVICE_PATH_PROTOCOL *pDp1, EFI_DEVICE_PATH_PROTOCOL *pDp2);
+VOID* DPCut(EFI_DEVICE_PATH_PROTOCOL *pDp);
+BOOLEAN DPIsOneOf(EFI_DEVICE_PATH_PROTOCOL *pAll, EFI_DEVICE_PATH_PROTOCOL *pOne, BOOLEAN ExactMatch);
+VOID* DPNextInstance(EFI_DEVICE_PATH_PROTOCOL **ppDp, UINTN *pSize);
+VOID* DPCreateNode(UINT8 Type, UINT8 SubType, UINT16 Length);
+BOOLEAN DPIsMultiInstance(EFI_DEVICE_PATH_PROTOCOL* pDp);
+EFI_DEVICE_PATH_PROTOCOL* DPGetEndNode(EFI_DEVICE_PATH_PROTOCOL *pDp);
+
+EFI_EVENT TimerStart(BOOLEAN *pTimerFlag, UINT64 Delay);
+void TimerStop(BOOLEAN TimerFlag, EFI_EVENT Event);
+
+EFI_STATUS FvReadPe32Image (
+ IN EFI_GUID *NameGuid,
+ IN OUT VOID **Buffer,
+ IN OUT UINTN *BufferSize,
+ OUT UINT32 *AuthenticationStatus);
+
+EFI_STATUS ReadImage (
+ IN BOOLEAN BootPolicy, IN EFI_DEVICE_PATH_PROTOCOL *FilePath,
+ IN OUT VOID **ppSource, IN OUT UINTN *pSourceSize OPTIONAL,
+ OUT UINTN *pImageSize OPTIONAL,
+ OUT EFI_HANDLE *phDevice OPTIONAL, OUT EFI_DEVICE_PATH_PROTOCOL **ppPath OPTIONAL
+);
+
+//Tests if region1(s-e) belongs to the region2(S-E)
+//returns EFI_ACCESS_DENIED if Belongs=FALSE and region 1 belong to region 2
+//returns EFI_ACCESS_DENIED if Belongs=TRUE and region 1 don't belong to region 2
+//returns EFI_SUCCESS in all other cases.
+EFI_STATUS TestRegions(UINT64 s, UINT64 e, UINT64 S, UINT64 E, BOOLEAN Belongs);
+
+EFI_STATUS AppendItemLst(T_ITEM_LIST *Lst, VOID* pRes);
+
+EFI_STATUS InsertItemLst(T_ITEM_LIST *Lst, VOID* pRes, UINTN ItemIndex);
+
+EFI_STATUS DeleteItemLst(T_ITEM_LIST *Lst, UINTN ItemIndex, BOOLEAN FreeData);
+
+VOID ClearItemLst(T_ITEM_LIST *Lst, BOOLEAN FreeData);
+
+EFI_STATUS CopyItemLst(T_ITEM_LIST *Lst, T_ITEM_LIST **NewLstPtr);
+
+EFI_STATUS GetEfiVariable(
+ IN CHAR16 *sName, IN EFI_GUID *pGuid,
+ OUT UINT32 *pAttributes OPTIONAL,
+ IN OUT UINTN *pDataSize, OUT VOID **ppData
+);
+
+EFI_STATUS GetDefaultLang(UINT16 *DefaultLang);
+
+EFI_STATUS ReadImageResource(
+ EFI_HANDLE ImageHandle, EFI_GUID *pGuid,
+ VOID **ppData, UINTN *pDataSize
+);
+
+EFI_STATUS RegisterProtocolCallback(
+ IN EFI_GUID *pProtocol, IN EFI_EVENT_NOTIFY NotifyFunction,
+ IN VOID *pNotifyContext, OUT EFI_EVENT *pEvent,
+ OUT VOID **ppRegistration
+);
+
+EFI_STATUS LoadResources(
+ EFI_HANDLE ImageHandle, UINTN NumberOfCallbacks,
+ CALLBACK_INFO *pCallBack, INIT_HII_PACK InitFunction
+);
+
+EFI_STATUS LoadStrings(
+ EFI_HANDLE ImageHandle, EFI_HII_HANDLE *pHiiHandle
+);
+
+EFI_STATUS HiiLibGetString(
+ IN EFI_HII_HANDLE HiiHandle, IN STRING_REF StringId,
+ IN OUT UINTN *StringSize, OUT EFI_STRING String
+);
+EFI_STATUS HiiLibSetString(
+ IN EFI_HII_HANDLE HiiHandle, IN STRING_REF StringId, IN EFI_STRING String
+);
+EFI_STATUS HiiLibPublishPackages(
+ IN VOID *PackagePointers, IN UINTN NumberOfPackages,
+ IN EFI_GUID *PackageGuid, IN EFI_HANDLE DriverHandle OPTIONAL,
+ OUT EFI_HII_HANDLE *HiiHandle
+);
+EFI_STATUS HiiLibGetBrowserData(
+ IN OUT UINTN *BufferSize, OUT VOID *Buffer,
+ IN CONST EFI_GUID *VarStoreGuid, OPTIONAL
+ IN CONST CHAR16 *VarStoreName OPTIONAL
+);
+EFI_STATUS HiiLibSetBrowserData(
+ IN UINTN BufferSize, IN VOID *Buffer,
+ IN CONST EFI_GUID *VarStoreGuid, OPTIONAL
+ IN CONST CHAR16 *VarStoreName OPTIONAL
+);
+EFI_STATUS HiiLibGetGlyphWidth(
+ IN CHAR16 Char, OUT UINT16 *Width
+);
+
+EFI_STATUS LibGetDxeSvcTbl(DXE_SERVICES **ppDxe OPTIONAL);
+
+EFI_STATUS LibAllocCspResource(CSP_RES_ITEM *ResTable, UINTN ResCount,
+ EFI_HANDLE ImgHandle,EFI_HANDLE CntrHandle);
+
+EFI_STATUS AllocCspResource(DXE_SERVICES *Dxe, CSP_RES_ITEM *ResTable, UINTN ResCount,
+ EFI_HANDLE ImgHandle,EFI_HANDLE CntrHandle, BOOLEAN AddSpace);
+
+#if (!defined(BACKWARD_COMPATIBLE_MODE) || defined(SMM_BUILD)) && PI_SPECIFICATION_VERSION >= 0x0001000A
+EFI_STATUS InitSmmHandlerPi(
+ IN EFI_HANDLE ImageHandle,
+ IN EFI_SYSTEM_TABLE *SystemTable,
+ IN EFI_STATUS (*InSmmFunction)(EFI_HANDLE,EFI_SYSTEM_TABLE*),
+ IN EFI_STATUS (*NotInSmmFunction)(EFI_HANDLE,EFI_SYSTEM_TABLE *) OPTIONAL
+);
+
+VOID* GetSmstConfigurationTablePi(IN EFI_GUID *TableGuid);
+
+EFI_STATUS InitAmiSmmLibPi(
+ IN EFI_HANDLE ImageHandle,
+ IN EFI_SYSTEM_TABLE *SystemTable
+);
+#else
+EFI_STATUS InitSmmHandlerFramework(
+ IN EFI_HANDLE ImageHandle,
+ IN EFI_SYSTEM_TABLE *SystemTable,
+ IN EFI_STATUS (*InSmmFunction)(EFI_HANDLE,EFI_SYSTEM_TABLE*),
+ IN EFI_STATUS (*NotInSmmFunction)(EFI_HANDLE,EFI_SYSTEM_TABLE *) OPTIONAL
+);
+
+EFI_STATUS InitSmmHandlerExFramework(
+ IN EFI_HANDLE ImageHandle,
+ IN EFI_SYSTEM_TABLE *SystemTable,
+ IN EFI_STATUS (*InSmmFunction)(EFI_HANDLE,EFI_SYSTEM_TABLE*),
+ IN EFI_STATUS (*NotInSmmFunction)(EFI_HANDLE,EFI_SYSTEM_TABLE *) OPTIONAL
+);
+
+VOID* GetSmstConfigurationTableFramework(IN EFI_GUID *TableGuid);
+
+EFI_STATUS InitAmiSmmLibFramework(
+ IN EFI_HANDLE ImageHandle,
+ IN EFI_SYSTEM_TABLE *SystemTable
+);
+#endif
+
+EFI_STATUS CreateReadyToBootEvent(
+ IN EFI_TPL NotifyTpl, IN EFI_EVENT_NOTIFY NotifyFunction,
+ IN VOID *pNotifyContext, OUT EFI_EVENT *pEvent
+);
+EFI_STATUS CreateLegacyBootEvent(
+ IN EFI_TPL NotifyTpl, IN EFI_EVENT_NOTIFY NotifyFunction,
+ IN VOID *pNotifyContext, OUT EFI_EVENT *pEvent
+);
+
+#if EFI_SPECIFICATION_VERSION>=0x20000
+EFI_STATUS LibReportStatusCode(
+ IN EFI_STATUS_CODE_TYPE Type, IN EFI_STATUS_CODE_VALUE Value,
+ IN UINT32 Instance, IN EFI_GUID *CallerId OPTIONAL,
+ IN EFI_STATUS_CODE_DATA *Data OPTIONAL
+);
+#else
+#define LibReportStatusCode pRS->ReportStatusCode
+#endif
+
+EFI_STATUS AmiIsaIrqMask(UINT16 *IsaIrqMask, BOOLEAN Get);
+EFI_STATUS AmiIsaDmaMask(UINT8 *IsaIrqMask, BOOLEAN Get);
+
+//returns current boot mode
+EFI_BOOT_MODE GetBootMode();
+
+//Performance Measurement Functions
+EFI_STATUS StartMeasure (
+ IN EFI_HANDLE Handle, IN CHAR16 *Token,
+ IN CHAR16 *Host, IN UINT64 Ticker
+);
+
+EFI_STATUS EndMeasure (
+ IN EFI_HANDLE Handle, IN CHAR16 *Token,
+ IN CHAR16 *Host, IN UINT64 Ticker
+);
+
+VOID WriteBootToOsPerformanceData();
+
+typedef enum {
+ FillOsLoaderLoadImageStart,
+ FillOsLoaderStartImageStart,
+ FillExitBootServicesEntry,
+ FillExitBootServicesExit
+} FPDT_FILL_TYPE;
+
+VOID AmiFillFpdt (IN FPDT_FILL_TYPE FieldToFill);
+
+VOID EFIAPI InitAmiRuntimeLib(
+ IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable,
+ IN EFI_EVENT_NOTIFY ExitBsCallback OPTIONAL,
+ IN EFI_EVENT_NOTIFY GoVirtualCallback OPTIONAL
+);
+//The EfiAtRuntime and EfiGoneVirtual functions will only work
+//if library has been initialized with InitAmiRuntimeLib
+BOOLEAN EFIAPI EfiAtRuntime();
+BOOLEAN EFIAPI EfiGoneVirtual();
+
+BOOLEAN LanguageCodesEqual(CONST CHAR8* LangCode1, CONST CHAR8* LangCode2);
+EFI_STATUS LibInitStatusCodePtr();
+#ifdef PEI_BUILD
+#define _GetBootScriptSaveInterface() NULL
+#else
+VOID* _GetBootScriptSaveInterface();
+#endif
+EFI_STATUS IsValidDevicePath(
+ IN EFI_DEVICE_PATH_PROTOCOL *pDp
+);
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2010, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
diff --git a/Include/AmiHobs.h b/Include/AmiHobs.h
new file mode 100644
index 0000000..287a3de
--- /dev/null
+++ b/Include/AmiHobs.h
@@ -0,0 +1,356 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2009, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/BIN/Core/Include/AmiHobs.h 24 11/14/11 3:17p Artems $
+//
+// $Revision: 24 $
+//
+// $Date: 11/14/11 3:17p $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Core/Include/AmiHobs.h $
+//
+// 24 11/14/11 3:17p Artems
+// Defined Extended errors for security recovery capsule check
+//
+// 23 5/13/11 3:45p Artems
+// Added fields to Recovery Hob structure to report flash update status
+//
+// 22 11/16/10 12:43p Artems
+// EIP 46175 Updated AMI_SMBIOS_MEMORY_INFO_HOB structure proposed layout
+//
+// 21 9/22/10 4:38p Artems
+// EIP 33629 - introduce AMI_SMBIOS_MEMORY_INFO_HOB
+//
+// 20 1/05/10 10:36a Markw
+// Create AMI_RESET_TYPE_HOB.
+//
+// 19 5/08/09 12:23a Felixp
+// Ifrastructure to simplify ROM layout customization(EIP 18426).
+// ROM_LAYOUT_HOB and RECOVERY_IMAGE_HOB are added.
+//
+// 18 1/16/09 10:00a Felixp
+// SmBus HOB added
+//
+// 17 5/05/08 4:26p Felixp
+// PEI Performance HOB added
+//
+// 15 8/10/07 2:11p Markw
+// Added additional feature flags and include to CpuHobs.h.
+//
+// 12 4/01/07 2:00p Felixp
+// AMI_CAPSULE_HOB added.
+//
+// 11 10/04/06 4:16p Markw
+// Added TsegLength.
+//
+// 10 5/02/06 6:42p Markw
+// Use common features between CPUs.
+//
+// 8 1/13/06 2:21p Markw
+// Added Cpu Disable flag and EIST info to CPU Hob.
+//
+// 7 6/16/05 10:44a Felixp
+// PEIM_LOAD_HOB added. (used by PEIMs to reguest reallocation to RAM,
+// once memory is detected)
+//
+// 6 5/04/05 12:46p Markw
+// Added cache line size to CPU hob.
+//
+// 5 4/28/05 5:59p Markw
+// Added Hob to keep track of Reserved IGD memory.
+//
+// 4 2/25/05 9:23a Sivagarn
+// Included Physical CPU count in CPUINFO HOB
+//
+// 3 2/25/05 8:06a Sivagarn
+// Included CPU revision field in CPU Info hob
+//
+// 3 2/16/05 4:15p Sivagarn
+// Changed the data format for physical address
+//
+// 2 2/10/05 10:36a Sivagarn
+// Updated CPUInfo structure & HOB
+//
+// 4 1/18/05 3:21p Felixp
+// PrintDebugMessage renamed to Trace
+//
+// 3 1/12/05 5:22p Markw
+// Changed cpu info hob guid.
+//
+// 2 1/12/05 3:00p Markw
+// Replaced APIC HOB with CPUINFO HOB.
+//
+// 2 10/22/04 10:32a Felixp
+// PEIM_HOB added
+//
+// 1 10/13/04 2:24p Markw
+//
+//**********************************************************************
+//<AMI_FHDR_START>
+//
+// Name: AmiHob.h
+//
+// Description:
+// Definitions of AMI specific Hobs
+//
+//<AMI_FHDR_END>
+//**********************************************************************
+#ifndef __AMIHOBS_H__
+#define __AMIHOBS_H__
+
+#include <pei.h>
+#include <hob.h>
+#include <CpuHobs.h>
+
+#pragma pack(push,1)
+
+
+// {39E8CDA1-6A35-4cdd-A902-D1A795F70380}
+#define AMI_RESET_TYPE_HOB_GUID \
+ {0x39e8cda1, 0x6a35, 0x4cdd, 0xa9, 0x2, 0xd1, 0xa7, 0x95, 0xf7, 0x3, 0x80}
+
+//Not all reset types are available on all systems.
+//Not all reset types may be reported.
+
+#define AMI_HOB_RESET_TYPE_POWER_ON 0
+#define AMI_HOB_RESET_TYPE_CPU 1
+#define AMI_HOB_RESET_TYPE_WARM 2
+#define AMI_HOB_RESET_TYPE_HARD 3
+#define AMI_HOB_RESET_TYPE_POWER_GOOD 4
+
+typedef struct {
+ EFI_HOB_GUID_TYPE EfiHobGuidType;
+ UINT8 ResetType;
+} AMI_RESET_TYPE_HOB;
+
+////////////////////////////////////////////////////////////////////////
+
+
+//HOB to report Apic Ids
+//This is a EFI_HOB_TYPE_GUID_EXTENSION.
+#define AMI_CPUINFO_HOB_GUID \
+ {0x2e547cb5,0x40f8,0x4f3e,0x8a,0xf4,0x19,0x52,0xaa,0xd5,0x5a,0xc}
+
+typedef struct {
+ UINT64 SmrrSupport:1;
+ UINT64 Reserved:63;
+} ADDITIONAL_FEATURE_FLAGS;
+
+typedef struct {
+ UINT32 FeatureEcx;
+ UINT32 FeatureEdx;
+ UINT32 ExtFeatureEax;
+ UINT32 ExtFeatureEbx;
+ UINT32 ExtFeatureEcx;
+ UINT32 ExtFeatureEdx;
+ ADDITIONAL_FEATURE_FLAGS Flags;
+} CPU_FEATURES;
+
+typedef struct {
+ BOOLEAN Valid;
+ BOOLEAN Disabled;
+ UINT32 CpuSignature;
+ UINT64 CpuFeatureInfo;
+ UINT32 CpuRevision; // Specific to the CPU brand
+ UINT32 BIST;
+ UINT8 ApicId;
+ UINT8 ApicEId;
+ UINT8 ApicVer;
+ BOOLEAN EistEnable;
+ UINT8 BusRatioMax;
+ UINT8 BusRatioMin;
+ UINT8 VidMax;
+ UINT8 VidMin;
+ UINT8 BusRatioMinStep;
+} CPUINFO;
+
+// SmramCap field values
+#define SMRAM_ASEG_SUPPORTED 0x01 // Bit 0
+#define SMRAM_TSEG_SUPPORTED 0x02 // BIT 1
+#define SMRAM_HSEG_SUPPORTED 0x04 // BIT 2
+
+typedef struct {
+ EFI_HOB_GUID_TYPE EfiHobGuidType;
+ UINT8 CpuCount;
+ UINT8 BspNo;
+ UINT8 NodeCount; // Physical CPU count
+ UINT32 SmramCap;
+ EFI_PHYSICAL_ADDRESS TsegAddress;
+ UINT32 TsegSize;
+ UINT16 CacheLineSize; // (Bytes)
+ CPU_FEATURES CpuFeatures;
+ CPUINFO Cpuinfo[1]; //This must be last in structure.
+} CPUINFO_HOB;
+////////////////////////////////////////////////////////////////////////
+
+//AB1BBFF5-2655-4e78-B442-0D264844B428
+#define SMM_HOB_GUID \
+ {0xab1bbff5,0x2655,0x4e78,0xb4,0x42,0xd,0x26,0x48,0x44,0xb4,0x28}
+
+typedef struct {
+ EFI_HOB_GUID_TYPE EfiHobGuidType;
+ UINT32 Tseg;
+ UINT32 TsegLength;
+ UINT32 ManagedMemStart;
+ UINT32 ManagedMemSize;
+ UINT32 IedStart;
+ UINT32 IedSize;
+ UINT16 NumCpus;
+ UINT16 Bsp;
+ UINT32 SmmBase[1];
+} SMM_HOB;
+
+////////////////////////////////////////////////////////////////////////
+
+// GUIDED NB HOB
+// {E7D449D9-1FFC-4eed-8D5D-7A53A4F8FB9A}
+#define AMI_NB_INFO_HOB_GUID \
+ {0xe7d449d9,0x1ffc,0x4eed,0x8d,0x5d,0x7a,0x53,0xa4,0xf8,0xfb,0x9a}
+
+typedef struct {
+ EFI_HOB_GUID_TYPE EfiHobGuidType;
+ UINT32 ReservedIgdFrameBufferSize;
+} NB_INFO_HOB;
+
+////////////////////////////////////////////////////////////////////////
+
+//GUIDed HOB to pass the code pointer from PEI to DXE
+// {F4491BA4-7672-486f-B4D7-99899D22DA57}
+#define AMI_PEIM_HOB_GUID \
+ { 0xf4491ba4, 0x7672, 0x486f, { 0xb4, 0xd7, 0x99, 0x89, 0x9d, 0x22, 0xda, 0x57 } }
+
+typedef struct {
+ EFI_HOB_GUID_TYPE Header;
+ EFI_IMAGE_ENTRY_POINT DxeEntryPoint;
+} PEIM_HOB;
+
+//GUIDed HOB to notify core that PEIM has to be reallocated to RAM once it's available
+// {EC9C36FD-1642-4b84-91FA-919C2D066FB4}
+#define AMI_PEIM_LOAD_HOB_GUID \
+ { 0xec9c36fd, 0x1642, 0x4b84, { 0x91, 0xfa, 0x91, 0x9c, 0x2d, 0x6, 0x6f, 0xb4 } }
+
+typedef struct {
+ EFI_HOB_GUID_TYPE Header;
+ VOID *pFfsHeader;
+ EFI_PEIM_ENTRY_POINT EntryPoint, InMemEntryPoint;
+} PEIM_LOAD_HOB;
+
+//GUIDed Hob for Capsule, that should be populated via System table
+// {BF66FDF7-F64C-4b11-8AB7-F843AA2A8BEA}
+#define AMI_CAPSULE_HOB_GUID \
+ { 0xbf66fdf7, 0xf64c, 0x4b11, { 0x8a, 0xb7, 0xf8, 0x43, 0xaa, 0x2a, 0x8b, 0xea } }
+
+typedef struct {
+ EFI_HOB_GUID_TYPE Header;
+ EFI_GUID CapsuleGuid;
+ EFI_PHYSICAL_ADDRESS CapsuleData;
+ UINT64 CapsuleLength;
+} AMI_CAPSULE_HOB;
+
+//GUIDed Hob used for PEI performance measurements
+#define EFI_PEI_PERFORMANCE_HOB_GUID \
+{0x10f432de, 0xdeec, 0x4631, 0x80, 0xcd, 0x47, 0xf6, 0x5d, 0x8f, 0x80, 0xbb}
+
+#define PEI_PERF_MAX_DESC_STRING 8
+
+typedef struct {
+ UINT64 StartTimeCount;
+ UINT64 StopTimeCount;
+ EFI_GUID Name;
+ UINT16 DescriptionString[PEI_PERF_MAX_DESC_STRING];
+} PEI_PERFORMANCE_MEASURE_LOG_ENTRY;
+
+typedef struct {
+ UINT32 NumberOfEntries;
+ UINT32 Reserved;
+ PEI_PERFORMANCE_MEASURE_LOG_ENTRY Log[1];
+} EFI_HOB_GUID_DATA_PERFORMANCE_LOG;
+
+//GUIDed Hob to pass SM Bus ArpMap
+// {017CB4B7-B80C-4040-B6C8-EA982BBB25B7}
+#define AMI_SMBUS_HOB_GUID \
+ { 0x17cb4b7, 0xb80c, 0x4040, { 0xb6, 0xc8, 0xea, 0x98, 0x2b, 0xbb, 0x25, 0xb7 } }
+
+typedef struct {
+ EFI_HOB_GUID_TYPE Header;
+ UINT8 BoardReservedAddressCount;
+ UINT32 BoardReservedAddressList;
+ UINT8 ArpDeviceCount;
+ UINT8 ArpDeviceList[1];
+} AMI_SMBUS_HOB;
+
+//ROM Layout GUIDed HOB
+// {D7642443-87B7-4832-9607-0E1EA81C1D86}
+#define AMI_ROM_LAYOUT_HOB_GUID { 0xd7642443, 0x87b7, 0x4832, { 0x96, 0x7, 0xe, 0x1e, 0xa8, 0x1c, 0x1d, 0x86 } }
+typedef struct {
+ EFI_HOB_GUID_TYPE Header;
+ //ROM_AREA RomLayout[];
+} ROM_LAYOUT_HOB;
+
+//GUIDed HOB used to describe location of the Recovery image
+// {DAC3CB98-2295-412e-826D-FDEEA320CF31}
+#define AMI_RECOVERY_IMAGE_HOB_GUID \
+ { 0xdac3cb98, 0x2295, 0x412e, { 0x82, 0x6d, 0xfd, 0xee, 0xa3, 0x20, 0xcf, 0x31 } }
+
+//Extended security errors definitions
+typedef enum {
+ InvalidHeader = 1,
+ InvalidSignature,
+ IvalidPlatformKey,
+ InvalidFwVersion,
+ MaxError
+} EXTENDED_SECURITY_ERRORS;
+
+typedef struct {
+ EFI_HOB_GUID_TYPE Header;
+ EFI_PHYSICAL_ADDRESS Address;
+ UINT8 Status; // Generic EFI_STATUS
+ UINT32 FailedStage; // Extended Security Error
+} RECOVERY_IMAGE_HOB;
+
+//GUIDed HOB used to pass SMBIOS memory related data to DXE SMBIOS driver
+// {7D6B8734-B754-443f-B588-7743843AD3F1}
+#define AMI_SMBIOS_MEMORY_INFO_HOB_GUID \
+ { 0x7d6b8734, 0xb754, 0x443f, { 0xb5, 0x88, 0x77, 0x43, 0x84, 0x3a, 0xd3, 0xf1 } }
+
+typedef struct {
+ EFI_HOB_GUID_TYPE Header;
+// MEM_SPD_DATA SpdDataArray[NO_OF_PHYSICAL_MEMORY_ARRAY][MAX_NUMBER_OF_MEM_MODULE];
+} AMI_SMBIOS_MEMORY_INFO_HOB;
+
+
+
+#pragma pack(pop)
+/****** DO NOT WRITE BELOW THIS LINE *******/
+
+#ifdef __cplusplus
+}
+#endif
+#endif
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2009, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
diff --git a/Include/AmiLib.h b/Include/AmiLib.h
new file mode 100644
index 0000000..82ce597
--- /dev/null
+++ b/Include/AmiLib.h
@@ -0,0 +1,1097 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2010, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/BIN/Core/Include/AmiLib.h 45 6/12/12 3:22p Oleksiyy $
+//
+// $Revision: 45 $
+//
+// $Date: 6/12/12 3:22p $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Core/Include/AmiLib.h $
+//
+// 45 6/12/12 3:22p Oleksiyy
+// TAG] EIP90322
+// [Category] Improvement
+// [Description] Extern declaradion of gAmiGlobalVariableGuid moved to
+// AmiLib.h.
+// [Files] AmiLib.h, Misc.c, EfiLib.c, AcpiCore.c and S3Resume.c
+//
+// 44 5/22/12 4:13p Oleksiyy
+// [TAG] EIP90322
+// [Category] Improvement
+// [Description] Defenition of AMI Global Variable Guid is added.
+// [Files] AmiLib.h
+//
+// 43 10/17/11 2:37p Yakovlevs
+// [TAG] EIP71694
+// [Category] Bug Fix
+// [Symptom] Option ROM is corrupted when copied from device on Rosecity
+// Core 4.6.5.1.
+// [RootCause] MemCopy routine was updated to use 64 bit access but PCI
+// BAR
+// Copy cannot handle this.
+//
+// [Solution] Introduced MemCpy32 routine to handle fast copy 4 byte at
+// a time.
+//
+//
+// [Files] MemCpy32.asm; AmiLib.h
+//
+// 42 3/09/11 5:37p Artems
+// PI 1.1 clean-up, removed duplicated and unused definitions
+//
+// 41 2/05/11 1:55p Artems
+// Added Intel's style LinkedList support
+//
+// 40 11/10/10 5:07p Felixp
+// Enhancement: MMIO_ORX, MMIO_ANDX, MMIO_ANDORX macros are added(EIP
+// 46932).
+//
+// 39 8/20/10 12:39p Felixp
+// LZMA compression support
+//
+// 38 11/05/09 3:51p Oleksiyy
+// EIP 27821: Support for 64 bit operations in IoRead and IoWrite added.
+// To use this functions AmiLib.h, IA32CLib.c, x64AsmLib.asm files should
+// be updated also.
+//
+// 37 7/30/09 4:43p Vyacheslava
+// Fixed comments.
+//
+// 36 7/28/09 4:54p Vyacheslava
+// Minor bug fix. EIP#24453: Synopsis: CPU exception when printing long
+// debug messages.
+//
+// 35 5/21/09 6:06p Felixp
+// Bit definitions (BITXX macros) are enclosed in #ifdef's to avoid
+// potential double definitions.
+//
+// 34 11/20/08 3:00p Felixp
+// ReallocatePeImage function is upadted to properly handle virtual
+// address fixups of the runtime images.
+//
+// 33 5/07/08 12:21p Felixp
+// Performance API added
+//
+// 32 4/17/08 3:17p Markw
+// Added Read/Write Cr3 and Identity map x64 page tables.
+//
+// 31 3/19/08 2:24p Markw
+// Add declaration GetPowerOfTwo64.
+//
+// 30 9/05/07 12:21p Felixp
+// GetDebugDirectory routine declarations removed (it's a private routine
+// used only by PELoader).
+//
+// 29 8/02/07 1:29a Felixp
+// Always define GetName (used to be only when EFI_DEBUG is defined). This
+// is needed to support selective debugging.
+//
+// 28 7/17/07 4:57p Yakovlevs
+//
+// 27 3/08/07 2:55a Felixp
+// AMI specific status code definitions moved to AmiStatusCodes.h
+//
+// 26 10/27/06 10:17a Felixp
+// Status codes for exit boot services and set virtual address map added
+//
+// 25 10/13/06 2:53p Felixp
+// AMI_STATUS_CODE_BEEP_CLASS added
+//
+// 24 10/12/06 9:36a Felixp
+// SectionSize parameter of FindPeSection changed from UINT32 to UINTN
+//
+// 23 8/24/06 9:09a Felixp
+// - x64 support
+// - memory mapped I/O macros added
+//
+// 22 6/28/06 1:01p Felixp
+//
+// 21 5/21/06 11:15p Felixp
+// PEI_RECOVERY_FAILED error code added
+//
+// 20 5/19/06 6:19p Felixp
+// Strcpy, Wcscpy changed to return pointer to the end of the string
+//
+// 19 4/30/06 9:40p Felixp
+//
+// 18 4/03/06 5:04p Felixp
+// Headers updated in accordance with new PCI and Super I/O infrastructure
+//
+// 17 3/13/06 1:15a Felixp
+//
+// 16 6/07/05 7:21p Felixp
+// additional macroses to work with AMI Status Code
+//
+// 15 5/31/05 10:23a Felixp
+//
+// 14 5/27/05 5:28p Felixp
+//
+// 12 4/02/05 2:23p Felixp
+// Swprintf function added
+//
+// 11 4/01/05 5:51p Felixp
+// CONVERT_TO_WSTRING macros added
+//
+// 10 4/01/05 3:50p Felixp
+// CONVERT_TO_STRING macros added
+//
+// 9 3/25/05 5:25p Felixp
+// Wcstol funciton added
+//
+// 8 3/23/05 4:27p Markw
+//
+// 7 3/23/05 4:13p Felixp
+//
+// 6 3/23/05 4:12p Felixp
+//
+// 5 3/21/05 11:46a Felixp
+// Bit definitions moved from AmiDxeLib.h to AmiLib.h
+//
+// 4 3/07/05 6:10p Felixp
+// FindPeSection added
+//
+// 3 2/01/05 2:27a Felixp
+//
+// 2 2/01/05 2:00a Felixp
+// I/O routine declarations moved from AmiDxeLib.h to AmiLib.h
+//
+// 1 1/28/05 12:44p Felixp
+//
+// 5 1/18/05 3:21p Felixp
+// PrintDebugMessage renamed to Trace
+//
+// 2 1/14/05 1:14p Felixp
+// FindNextHobByGuid added
+//
+// 1 12/23/04 9:41a Felixp
+//
+// 27 12/15/04 9:06p Felixp
+// LegacyBoot application added
+// Minor build process improvements
+//
+// 26 12/15/04 3:51p Markw
+// Added Strstr.
+//
+// 25 11/24/04 9:36a Felixp
+// int64 suppot added to Itoa and Itow
+//
+// 24 11/19/04 1:33a Felixp
+// GetName debug routine added
+//
+// 23 11/18/04 11:55a Markw
+//
+// 22 11/18/04 11:51a Felixp
+// FindNextHobByType declaration added
+//
+// 21 11/10/04 5:17p Felixp
+// 1. Definitions for StdC functions added
+// 2. Definition for NameAndEntryStr added
+//
+// 20 10/22/04 7:35p Felixp
+//
+// 19 10/14/04 12:04p Felixp
+//
+// 18 8/22/04 11:57p Felixp
+//
+// 17 8/18/04 3:16p Felixp
+//
+// 16 7/13/04 10:42a Felixp
+//
+// 15 4/11/04 2:49p Felixp
+//
+// 14 4/10/04 1:07p Felixp
+//
+// 13 4/08/04 6:54p Yakovlevs
+//
+// 12 4/04/04 2:58p Felixp
+//
+// 11 3/30/04 11:16a Felixp
+//
+// 10 3/30/04 2:48a Felixp
+//
+// 9 3/29/04 6:06p Felixp
+//
+// 7 3/29/04 5:05p Felixp
+//
+// 6 3/29/04 4:36p Felixp
+//
+// 5 3/28/04 2:11p Felixp
+// 1. PE Loader and some other commonly used code moved to the Library
+// 2. Warnings fixed (from now on warning will be treated as error)
+//
+// 4 3/26/04 6:04p Markw
+// Replaced printf with sprintf.
+//
+// 3 3/26/04 3:47p Markw
+// Added headers for stdlib.c.
+//
+// 2 3/25/04 2:12p Markw
+// Added Shr64.
+//
+// 1 3/23/04 5:52p Felixp
+//
+// 11 3/20/04 10:46a Felixp
+//
+// 10 3/19/04 10:30a Markw
+// Added GetEfiConfigurationTable.
+//
+// 9 3/17/04 12:01p Markw
+// Changed size_t UINTN.
+//
+// 8 3/08/04 5:44p Markw
+//
+//
+// 7 3/05/04 12:46p Markw
+// Added Div64
+//
+// 6 3/01/04 2:00p Markw
+// removed FILE typedef
+//
+// 5 2/26/04 3:23p Felixp
+//
+// 4 2/10/04 12:54p Markw
+// Fixed return type on IoWrite16 and added definition memcmp and guidcmp
+//
+// 3 2/05/04 3:45p Markw
+// Fixed parameter type error on IoWrite16.
+//
+// 2 1/28/04 12:11p Robert
+//
+// 1 1/22/04 3:15p Markw
+//
+//**********************************************************************
+#ifndef __AMI_LIBRARY__H__
+#define __AMI_LIBRARY__H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <EFI.h>
+#include <AmiStatusCodes.h>
+
+//****************************************************************************/
+// TYPE DECLARATIONS
+//****************************************************************************/
+typedef CHAR8 *va_list;
+
+// PE Loader */
+#pragma pack(push)
+#pragma pack(2)
+
+typedef struct _FILE_HEADER { // File Header
+ UINT16 Machine;
+ UINT16 NumberOfSections;
+ UINT32 Dummy[3];
+ UINT16 OptionalHeaderSize;
+ UINT16 Characteristics;
+} FILE_HEADER;
+
+typedef struct _DIRECTORY_ENTRY{ // Directory entry
+ UINT32 VirtualAddress;
+ UINT32 Size;
+} DIRECTORY_ENTRY;
+
+typedef struct _OPTIONAL_HEADER { // Optional header
+ UINT16 Magic;
+ UINT8 MajorLinkerVersion;
+ UINT8 MinorLinkerVersion;
+ UINT32 SizeOfCode;
+ UINT32 SizeOfInitializedData;
+ UINT32 SizeOfUninitializedData;
+ UINT32 AddressOfEntryPoint;
+ UINT32 BaseOfCode;
+#if !defined(EFI64) && !defined(EFIx64)
+ UINT32 BaseOfData;
+#endif
+ UINTN ImageBase;
+ UINT32 SectionAlignment;
+ UINT32 FileAlignment;
+ UINT16 MajorOperatingSystemVersion;
+ UINT16 MinorOperatingSystemVersion;
+ UINT16 MajorImageVersion;
+ UINT16 MinorImageVersion;
+ UINT16 MajorSubsystemVersion;
+ UINT16 MinorSubsystemVersion;
+ UINT32 Reserved;
+ UINT32 SizeOfImage;
+ UINT32 SizeOfHeaders;
+ UINT32 CheckSum;
+ UINT16 Subsystem;
+ UINT16 Characteristics;
+ UINTN SizeOfStackReserve;
+ UINTN SizeOfStackCommit;
+ UINTN SizeOfHeapReserve;
+ UINTN SizeOfHeapCommit;
+ UINT32 LoaderFlags;
+ UINT32 NumberOfRvaAndSizes;
+ DIRECTORY_ENTRY Export, Import, Resource, Exception,
+ Certificate, Reallocations, Debug;
+} OPTIONAL_HEADER;
+
+typedef struct _DEBUG_DIRECTORY{
+ UINT32 Characteristics; //A reserved field intended to be used for flags, set to zero for now.
+ UINT32 TimeDateStamp; //Time and date the debug data was created.
+ UINT16 MajorVersion; //Major version number of the debug data format.
+ UINT16 MinorVersion; //Minor version number of the debug data format.
+ UINT32 Type; //Format of debugging information: this field enables support of multiple debuggers. See Section 6.1.2, Debug Type, for more information.
+ UINT32 SizeOfData; //Size of the debug data (not including the debug directory itself).
+ //TODO: Is it UINT32 for IPF ?????
+ UINT32 AddressOfRawData; //Address of the debug data when loaded, relative to the image base.
+ UINT32 PointerToRawData; //File pointer to the debug data.
+} DEBUG_DIRECTORY;
+#pragma pack(pop)
+
+typedef enum {
+ CpuIoWidthUint8,
+ CpuIoWidthUint16,
+ CpuIoWidthUint32,
+ CpuIoWidthUint64,
+ CpuIoWidthFifoUint8,
+ CpuIoWidthFifoUint16,
+ CpuIoWidthFifoUint32,
+ CpuIoWidthFifoUint64,
+ CpuIoWidthFillUint8,
+ CpuIoWidthFillUint16,
+ CpuIoWidthFillUint32,
+ CpuIoWidthFillUint64
+} CPU_IO_WIDTH;
+
+//Decompression routine types
+typedef EFI_STATUS (*GET_INFO) (
+ IN VOID *Source, IN UINT32 SourceSize,
+ OUT UINT32 *DestinationSize, OUT UINT32 *ScratchSize
+);
+
+typedef EFI_STATUS (*DECOMPRESS) (
+ IN VOID* Source, IN UINT32 SourceSize,
+ IN OUT VOID* Destination, IN UINT32 DestinationSize,
+ IN OUT VOID* Scratch, IN UINT32 ScratchSize
+);
+// Variable Services
+#define AMI_GLOBAL_VARIABLE_GUID \
+ {0x1368881,0xc4ad,0x4b1d,0xb6,0x31,0xd5,0x7a,0x8e,0xc8,0xdb,0x6b}
+
+extern EFI_GUID gAmiGlobalVariableGuid;
+//****************************************************************************/
+// MACOROS DECLARATIONS
+//****************************************************************************/
+//Some BIT values definition for the sake of convenience
+#ifndef BIT0
+#define BIT0 0x01
+#endif
+#ifndef BIT1
+#define BIT1 0x02
+#endif
+#ifndef BIT2
+#define BIT2 0x04
+#endif
+#ifndef BIT3
+#define BIT3 0x08
+#endif
+#ifndef BIT4
+#define BIT4 0x10
+#endif
+#ifndef BIT5
+#define BIT5 0x20
+#endif
+#ifndef BIT6
+#define BIT6 0x40
+#endif
+#ifndef BIT7
+#define BIT7 0x80
+#endif
+#ifndef BIT8
+#define BIT8 0x100
+#endif
+#ifndef BIT9
+#define BIT9 0x200
+#endif
+#ifndef BIT00
+#define BIT00 0x00000001
+#endif
+#ifndef BIT01
+#define BIT01 0x00000002
+#endif
+#ifndef BIT02
+#define BIT02 0x00000004
+#endif
+#ifndef BIT03
+#define BIT03 0x00000008
+#endif
+#ifndef BIT04
+#define BIT04 0x00000010
+#endif
+#ifndef BIT05
+#define BIT05 0x00000020
+#endif
+#ifndef BIT06
+#define BIT06 0x00000040
+#endif
+#ifndef BIT07
+#define BIT07 0x00000080
+#endif
+#ifndef BIT08
+#define BIT08 0x00000100
+#endif
+#ifndef BIT09
+#define BIT09 0x00000200
+#endif
+#ifndef BIT10
+#define BIT10 0x00000400
+#endif
+#ifndef BIT11
+#define BIT11 0x00000800
+#endif
+#ifndef BIT12
+#define BIT12 0x00001000
+#endif
+#ifndef BIT13
+#define BIT13 0x00002000
+#endif
+#ifndef BIT14
+#define BIT14 0x00004000
+#endif
+#ifndef BIT15
+#define BIT15 0x00008000
+#endif
+#ifndef BIT16
+#define BIT16 0x00010000
+#endif
+#ifndef BIT17
+#define BIT17 0x00020000
+#endif
+#ifndef BIT18
+#define BIT18 0x00040000
+#endif
+#ifndef BIT19
+#define BIT19 0x00080000
+#endif
+#ifndef BIT20
+#define BIT20 0x00100000
+#endif
+#ifndef BIT21
+#define BIT21 0x00200000
+#endif
+#ifndef BIT22
+#define BIT22 0x00400000
+#endif
+#ifndef BIT23
+#define BIT23 0x00800000
+#endif
+#ifndef BIT24
+#define BIT24 0x01000000
+#endif
+#ifndef BIT25
+#define BIT25 0x02000000
+#endif
+#ifndef BIT26
+#define BIT26 0x04000000
+#endif
+#ifndef BIT27
+#define BIT27 0x08000000
+#endif
+#ifndef BIT28
+#define BIT28 0x10000000
+#endif
+#ifndef BIT29
+#define BIT29 0x20000000
+#endif
+#ifndef BIT30
+#define BIT30 0x40000000
+#endif
+#ifndef BIT31
+#define BIT31 0x80000000
+#endif
+//=============================================================================
+// This is all ANSI Standard macros pulled from stdarg.h
+// Support for Variable arguments in strings
+#ifndef _INTSIZEOF
+#define _INTSIZEOF(n)( (sizeof(n) + sizeof(UINTN) - 1) & ~(sizeof(UINTN) - 1) )
+#endif
+// Also support coding convention rules for var arg macros
+#ifndef va_start
+#define va_start(ap,v) ( ap = (va_list)&(v) + _INTSIZEOF(v) )
+#endif
+#define va_arg(ap,t) ( *(t *)((ap += _INTSIZEOF(t)) - _INTSIZEOF(t)) )
+#define va_end(ap) ( ap = (va_list)0 )
+// end variable argument support
+//=============================================================================
+#define ___INTERNAL_CONVERT_TO_STRING___(a) #a
+#define CONVERT_TO_STRING(a) ___INTERNAL_CONVERT_TO_STRING___(a)
+#define ___INTERNAL_CONVERT_TO_WSTRING___(a) L#a
+#define CONVERT_TO_WSTRING(a) ___INTERNAL_CONVERT_TO_WSTRING___(a)
+
+#define guidcmp(g1,g2) MemCmp(g1,g2,sizeof(EFI_GUID))
+
+// The EFI memory allocation functions work in units of EFI_PAGEs that are
+// 4K. This should in no way be confused with the page size of the processor.
+// An EFI_PAGE is just the quanta of memory in EFI.
+#define EFI_PAGE_MASK (EFI_PAGE_SIZE - 1)
+#define EFI_PAGE_SHIFT 12
+
+#define EFI_SIZE_TO_PAGES(s) \
+ ( (((UINTN)(s)) >> EFI_PAGE_SHIFT) + ((((UINTN)(s)) & EFI_PAGE_MASK) ? 1 : 0) )
+
+#define EFI_PAGES_TO_SIZE(p) ( ((UINTN)(p)) << EFI_PAGE_SHIFT)
+//FIELD_OFFSET - returns the byte offset to a field within a structure
+#define EFI_FIELD_OFFSET(TYPE,Field) ((UINTN)(&(((TYPE *) 0)->Field)))
+
+//returns the field size within a structure
+#define EFI_FIELD_SIZE(TYPE,Field) (sizeof((((TYPE *) 0)->Field)))
+#define OUTTER(pField, Field, OutterType) ((OutterType*)((UINT8*)(pField)-EFI_FIELD_OFFSET(OutterType,Field)))
+
+#define Itoa(value,string,radix) ItoaEx((INT32)value,string,radix,FALSE)
+#define Itow(value,string,radix) ItowEx((INT32)value,string,radix,FALSE)
+#define I64toa(value,string,radix) ItoaEx(value,string,radix,TRUE)
+#define I64tow(value,string,radix) ItowEx(value,string,radix,TRUE)
+
+#define Strtol(nptr,endptr,base) StrtolEx(nptr,endptr,base,1)
+#define Wcstol(nptr,endptr,base) StrtolEx((char*)nptr,(char**)endptr,base,2)
+
+//Debug Message Categories
+#define TRACE_NEVER 0 // never displayed
+#define TRACE_ALWAYS -1 // always displayed
+#define TRACE_PEICORE 1
+#define TRACE_DXEIPL 2
+#define TRACE_PEI_CHIPSET 4
+#define TRACE_PEI_PLATFORM 8
+#define TRACE_PEI_CPU 0x10
+#define TRACE_DXE_CORE 0x20
+#define TRACE_DXE_CHIPSET 0x40
+#define TRACE_DXE_PLATFORM 0x80
+#define TRACE_DXE_CPU 0x100
+#define TRACE_CSM 0x200
+#define TRACE_USB 0x400
+
+#define EFI_DEADLOOP() { volatile UINTN __DeadLoopVar__ = 1; while (__DeadLoopVar__); }
+
+#define MMIO_READ8(Address) (*(volatile UINT8*)(Address))
+#define MMIO_WRITE8(Address,Value) (*(volatile UINT8*)(Address)=(Value))
+#define MMIO_READ16(Address) (*(volatile UINT16*)(Address))
+#define MMIO_WRITE16(Address,Value) (*(volatile UINT16*)(Address)=(Value))
+#define MMIO_READ32(Address) (*(volatile UINT32*)(Address))
+#define MMIO_WRITE32(Address,Value) (*(volatile UINT32*)(Address)=(Value))
+#define MMIO_READ64(Address) (*(volatile UINT64*)(Address))
+#define MMIO_WRITE64(Address,Value) (*(volatile UINT64*)(Address)=(Value))
+
+#define MMIO_OR8(Address, Value) (*(volatile UINT8*)(Address) |= (Value))
+#define MMIO_OR16(Address, Value) (*(volatile UINT16*)(Address) |= (Value))
+#define MMIO_OR32(Address, Value) (*(volatile UINT32*)(Address) |= (Value))
+#define MMIO_OR64(Address, Value) (*(volatile UINT64*)(Address) |= (Value))
+
+#define MMIO_AND8(Address, Value) (*(volatile UINT8*)(Address) &= (Value))
+#define MMIO_AND16(Address, Value) (*(volatile UINT16*)(Address) &= (Value))
+#define MMIO_AND32(Address, Value) (*(volatile UINT32*)(Address) &= (Value))
+#define MMIO_AND64(Address, Value) (*(volatile UINT64*)(Address) &= (Value))
+
+#define MMIO_ANDOR8(Address, AndData, OrData) (*(volatile UINT8*)(Address)) = (*(volatile UINT8*)(Address) & (AndData) | (OrData))
+#define MMIO_ANDOR16(Address, AndData, OrData) (*(volatile UINT16*)(Address)) = (*(volatile UINT16*)(Address) & (AndData) | (OrData))
+#define MMIO_ANDOR32(Address, AndData, OrData) (*(volatile UINT32*)(Address)) = (*(volatile UINT32*)(Address) & (AndData) | (OrData))
+#define MMIO_ANDOR64(Address, AndData, OrData) (*(volatile UINT64*)(Address)) = (*(volatile UINT32*)(Address) & (AndData) | (OrData))
+
+#define DXE_TOK L"DXE"
+#define SHELL_TOK L"SHELL"
+#define PEI_TOK L"PEI"
+#define BDS_TOK L"BDS"
+#define DRIVERBINDING_START_TOK L"DriverBinding:Start"
+#define DRIVERBINDING_SUPPORT_TOK L"DriverBinding:Support"
+#define START_IMAGE_TOK L"StartImage"
+#define LOAD_IMAGE_TOK L"LoadImage"
+#define DXEIPL_TOK L"DXEIPL"
+#define PCI_TOK L"PCI"
+#define CSM_TOK L"CSM"
+#define NVRAM_TOK L"NVRAM"
+#define S3RESUME_TOK L"S3RESUME"
+
+//****************************************************************************/
+// VARIABLE DECLARATIONS
+//****************************************************************************/
+
+//****************************************************************************/
+// FUNCTION DECLARATIONS
+//****************************************************************************/
+UINTN Sprintf_va_list( char *buffer, char *format, va_list arg );
+UINTN Sprintf(char *Buffer, char *Format, ...);
+UINTN Sprintf_s(char *Buffer, UINTN BufferSize, char *Format, ...);
+UINTN Sprintf_s_va_list(char *Buffer, UINTN BufferSize, char *Format, va_list Marker);
+UINTN Swprintf_va_list(CHAR16 *buffer, CHAR16 *format, va_list arg);
+UINTN Swprintf(CHAR16 *Buffer, CHAR16 *Format, ...);
+UINTN Swprintf_s(CHAR16 *Buffer, UINTN BufferSize, CHAR16 *Format, ...);
+UINTN Swprintf_s_va_list(CHAR16 *Buffer, UINTN BufferSize, CHAR16 *Format, va_list Marker);
+int Atoi( char *string );
+char * ItoaEx(INT64 value, char *string,int radix, BOOLEAN is_int64);
+CHAR16 * ItowEx(INT64 value, CHAR16 *string,int radix, BOOLEAN is_int64);
+long StrtolEx(char *nptr,char **endptr,int base, int increment);
+int Strcmp(char *string1, char *string2);
+int Wcscmp(CHAR16 *string1, CHAR16 *string2);
+UINTN Strlen(char *);
+UINTN Wcslen(CHAR16 *);
+char* Strcpy(char *,char *);
+CHAR16* Wcscpy(CHAR16 *,CHAR16 *);
+char *Strstr(const char *,const char *);
+char * Strupr(char *str);
+CHAR16 * Wcsupr(CHAR16 *str);
+
+/*
+int tolower(int);
+int toupper(int);
+char * strupr(char *str);
+char *strcpy(char *,char *);
+char *strcat(char *,char *);
+CHAR16 *wcscat(CHAR16 *,CHAR16 *);
+*/
+
+VOID MemCpy(VOID* pDestination, VOID* pSource, UINTN Length);
+VOID MemCpy32(VOID* pDestination, VOID* pSource, UINTN Length);
+void MemSet(VOID* pBuffer, UINTN Size, UINT8 Value);
+INTN MemCmp(VOID* pDestination, VOID* pSource, UINTN Length);
+
+UINT64 Shr64( IN UINT64 Value, IN UINT8 Shift );
+UINT64 Shl64( IN UINT64 Value, IN UINT8 Shift );
+
+UINT64 Div64 (
+ IN UINT64 Dividend,
+ IN UINTN Divisor, //Can only be 31 bits for IA-32
+ OUT UINTN *Remainder OPTIONAL
+);
+
+UINT64 Mul64(
+ IN UINT64 Value64,
+ IN UINTN Value32
+);
+
+UINT64 GetPowerOfTwo64(
+ IN UINT64 Input
+);
+
+
+// PE Loader
+BOOLEAN ReallocatePeImage(UINT8 *pcurrent, UINT8 *pnew, UINT8 *prealloc);
+BOOLEAN IsPeImageValid(UINT8* pstart);
+UINT32 GetImageSize(VOID *p);
+OPTIONAL_HEADER* GetPeOptionalHeader(VOID *p);
+VOID* LoadPeImage(UINT8* pold, UINT8* pnew);
+VOID* LoadPeImageEx(UINT8* pold, UINT8* pnew, UINT8 *prealloc);
+VOID* FindPeSection(UINT8* pstart, UINT64 name, UINTN* pSize);
+BOOLEAN GetName(UINT8 *p, CHAR8 *sName);
+
+//Decompression
+// Standard UEFI Decompression
+EFI_STATUS GetInfo (
+ IN VOID *Source, IN UINT32 SourceSize,
+ OUT UINT32 *DestinationSize, OUT UINT32 *ScratchSize
+);
+
+EFI_STATUS Decompress (
+ IN VOID* Source, IN UINT32 SourceSize,
+ IN OUT VOID* Destination, IN UINT32 DestinationSize,
+ IN OUT VOID* Scratch, IN UINT32 ScratchSize
+);
+
+// LZMA Decompression
+EFI_STATUS LzmaGetInfo (
+ IN VOID *Source, IN UINT32 SourceSize,
+ OUT UINT32 *DestinationSize, OUT UINT32 *ScratchSize
+);
+
+EFI_STATUS LzmaDecompress (
+ IN VOID* Source, IN UINT32 SourceSize,
+ IN OUT VOID* Destination, IN UINT32 DestinationSize,
+ IN OUT VOID* Scratch, IN UINT32 ScratchSize
+);
+
+//Defined in Tokens.c
+BOOLEAN GetDecompressInterface(
+ UINT8 CompressionType, GET_INFO *GetInfoPtr, DECOMPRESS *DecompressPtr
+);
+
+// DEBUG
+VOID checkpoint(UINT8 c);
+UINT64 GetCpuTimer();
+VOID PrepareStatusCodeString(VOID* pBuffer, UINTN Size, CHAR8 *sFormat, va_list ArgList);
+
+//HOB
+EFI_STATUS FindNextHobByType(IN UINT16 Type,IN OUT VOID **Hob);
+EFI_STATUS FindNextHobByGuid(IN EFI_GUID *Guid, IN OUT VOID **Hob);
+
+UINT8 IoRead8(UINT16 Port);
+VOID IoWrite8(UINT16 Port, UINT8 Value);
+UINT16 IoRead16(UINT16 Port);
+VOID IoWrite16(UINT16 Port, UINT16 Value);
+UINT32 IoRead32(UINT16 Port);
+VOID IoWrite32(UINT16 Port, UINT32 Value);
+UINT64 IoRead64(UINT16 Port);
+VOID IoWrite64(UINT16 Port, UINT64 Value);
+
+EFI_STATUS IoRead(
+ IN CPU_IO_WIDTH Width,
+ IN UINT64 Address,
+ IN UINTN Count,
+ IN VOID *Buffer
+);
+
+EFI_STATUS IoWrite(
+ IN CPU_IO_WIDTH Width,
+ IN UINT64 Address,
+ IN UINTN Count,
+ OUT VOID *Buffer
+);
+
+EFI_STATUS IoReadWrite(
+ IN CPU_IO_WIDTH Width,
+ IN UINT64 Address,
+ IN VOID *DataValue,
+ IN VOID *DataMask
+);
+
+EFI_STATUS MemRead(
+ IN CPU_IO_WIDTH Width,
+ IN UINT64 Address,
+ IN UINTN Count,
+ IN VOID *Buffer
+);
+
+EFI_STATUS MemWrite(
+ IN CPU_IO_WIDTH Width,
+ IN UINT64 Address,
+ IN UINTN Count,
+ OUT VOID *Buffer
+);
+
+EFI_STATUS MemReadWrite(
+ IN CPU_IO_WIDTH Width,
+ IN UINT64 Address,
+ IN VOID *DataValue,
+ IN VOID *DataMask
+);
+
+typedef struct _IO_DATA{
+ UINT16 Addr;
+ CPU_IO_WIDTH Width;
+ UINT32 Data;
+} IO_DATA;
+
+//IO Init table execution function
+EFI_STATUS ExecScript(IO_DATA *ScriptData, UINTN EntryCount);
+
+
+UINTN ReadCr3(VOID);
+VOID WriteCr3(UINTN Value);
+
+UINT32 GetPageTableNumPages(
+ IN UINT8 NumberMemoryBits
+);
+
+VOID FillPageTable(
+ IN UINT8 NumberMemoryBits,
+ IN VOID *PageTable
+);
+
+//Linked List
+
+//
+// Prevent multiple includes in the same source file
+//
+
+#ifndef EFI_LIST_ENTRY_DEFINED
+#define EFI_LIST_ENTRY_DEFINED
+typedef struct _EFI_LIST_ENTRY {
+ struct _EFI_LIST_ENTRY *ForwardLink;
+ struct _EFI_LIST_ENTRY *BackLink;
+} EFI_LIST_ENTRY;
+//*** AMI PORTING BEGIN ***//
+#endif
+//*** AMI PORTING END *****//
+
+typedef EFI_LIST_ENTRY EFI_LIST;
+typedef EFI_LIST_ENTRY EFI_LIST_NODE;
+
+#define INITIALIZE_LIST_HEAD_VARIABLE(ListHead) {&ListHead, &ListHead}
+
+VOID
+InitializeListHead (
+ EFI_LIST_ENTRY *List
+ )
+/*++
+
+Routine Description:
+
+ Initialize the head of the List. The caller must allocate the memory
+ for the EFI_LIST. This function must be called before the other linked
+ list macros can be used.
+
+Arguments:
+
+ List - Pointer to list head to initialize
+
+Returns:
+
+ None.
+
+--*/
+;
+
+BOOLEAN
+IsListEmpty (
+ EFI_LIST_ENTRY *List
+ )
+/*++
+
+Routine Description:
+
+ Return TRUE is the list contains zero nodes. Otherzise return FALSE.
+ The list must have been initialized with InitializeListHead () before using
+ this function.
+
+Arguments:
+
+ List - Pointer to list head to test
+
+
+Returns:
+
+ Return TRUE is the list contains zero nodes. Otherzise return FALSE.
+
+--*/
+;
+
+VOID
+RemoveEntryList (
+ EFI_LIST_ENTRY *Entry
+ )
+/*++
+
+Routine Description:
+
+ Remove Node from the doubly linked list. It is the caller's responsibility
+ to free any memory used by the entry if needed. The list must have been
+ initialized with InitializeListHead () before using this function.
+
+Arguments:
+
+ Entry - Element to remove from the list.
+
+Returns:
+
+ None
+
+--*/
+;
+
+VOID
+InsertTailList (
+ EFI_LIST_ENTRY *ListHead,
+ EFI_LIST_ENTRY *Entry
+ )
+/*++
+
+Routine Description:
+
+ Insert a Node into the end of a doubly linked list. The list must have
+ been initialized with InitializeListHead () before using this function.
+
+Arguments:
+
+ ListHead - Head of doubly linked list
+
+ Entry - Element to insert at the end of the list.
+
+Returns:
+
+ None
+
+--*/
+;
+
+VOID
+InsertHeadList (
+ EFI_LIST_ENTRY *ListHead,
+ EFI_LIST_ENTRY *Entry
+ )
+/*++
+
+Routine Description:
+
+ Insert a Node into the start of a doubly linked list. The list must have
+ been initialized with InitializeListHead () before using this function.
+
+Arguments:
+
+ ListHead - Head of doubly linked list
+
+ Entry - Element to insert to beginning of list
+
+Returns:
+
+ None
+
+--*/
+;
+
+VOID
+SwapListEntries (
+ EFI_LIST_ENTRY *Entry1,
+ EFI_LIST_ENTRY *Entry2
+ )
+/*++
+
+Routine Description:
+
+ Swap the location of the two elements of a doubly linked list. Node2
+ is placed in front of Node1. The list must have been initialized with
+ InitializeListHead () before using this function.
+
+Arguments:
+
+ Entry1 - Element in the doubly linked list in front of Node2.
+
+ Entry2 - Element in the doubly linked list behind Node1.
+
+Returns:
+
+ None
+
+--*/
+;
+
+EFI_LIST_ENTRY *
+GetFirstNode (
+ EFI_LIST_ENTRY *List
+ )
+/*++
+
+Routine Description:
+
+ Return the first node pointed to by the list head. The list must
+ have been initialized with InitializeListHead () before using this
+ function and must contain data.
+
+Arguments:
+
+ List - The head of the doubly linked list.
+
+Returns:
+
+ Pointer to the first node, if the list contains nodes. The list will
+ return a null value--that is, the value of List--when the list is empty.
+ See the description of IsNull for more information.
+
+
+--*/
+;
+
+EFI_LIST_ENTRY *
+GetNextNode (
+ EFI_LIST_ENTRY *List,
+ EFI_LIST_ENTRY *Node
+ )
+/*++
+
+Routine Description:
+
+ Returns the node following Node in the list. The list must
+ have been initialized with InitializeListHead () before using this
+ function and must contain data.
+
+Arguments:
+
+ List - The head of the list. MUST NOT be the literal value NULL.
+ Node - The node in the list. This value MUST NOT be the literal value NULL.
+ See the description of IsNull for more information.
+
+Returns:
+
+ Pointer to the next node, if one exists. Otherwise, returns a null value,
+ which is actually a pointer to List.
+ See the description of IsNull for more information.
+
+--*/
+;
+
+BOOLEAN
+IsNull (
+ EFI_LIST_ENTRY *List,
+ EFI_LIST_ENTRY *Node
+ )
+/*++
+
+Routine Description:
+
+ Determines whether the given node is null. Note that Node is null
+ when its value is equal to the value of List. It is an error for
+ Node to be the literal value NULL [(VOID*)0x0].
+
+Arguments:
+
+ List - The head of the list. MUST NOT be the literal value NULL.
+ Node - The node to test. MUST NOT be the literal value NULL. See
+ the description above.
+
+Returns:
+
+ Returns true if the node is null.
+
+--*/
+;
+
+BOOLEAN
+IsNodeAtEnd (
+ EFI_LIST_ENTRY *List,
+ EFI_LIST_ENTRY *Node
+ )
+/*++
+
+Routine Description:
+
+ Determines whether the given node is at the end of the list. Used
+ to walk the list. The list must have been initialized with
+ InitializeListHead () before using this function and must contain
+ data.
+
+Arguments:
+
+ List - The head of the list. MUST NOT be the literal value NULL.
+ Node - The node to test. MUST NOT be the literal value NULL.
+ See the description of IsNull for more information.
+
+Returns:
+
+ Returns true if the list is the tail.
+
+--*/
+;
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2010, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
diff --git a/Include/AmiLoadCsmPolicy.h b/Include/AmiLoadCsmPolicy.h
new file mode 100644
index 0000000..9b20431
--- /dev/null
+++ b/Include/AmiLoadCsmPolicy.h
@@ -0,0 +1,94 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/BIN/Core/Include/AmiLoadCsmPolicy.h 2 5/22/12 10:15a Artems $
+//
+// $Revision: 2 $
+//
+// $Date: 5/22/12 10:15a $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Core/Include/AmiLoadCsmPolicy.h $
+//
+// 2 5/22/12 10:15a Artems
+// [TAG] EIP86097
+// [Description] Separate control for loading UEFI Oprom Driver
+// [Files] AmiLoadCsmPolicy.h, PciBus.c, CsmOptOut.c, CsmOptOut.sdl
+// CsmOptOut.mak
+//
+// 1 10/28/11 1:18p Artems
+// Added header to support CSM opt-out feature
+//
+//**********************************************************************
+//<AMI_FHDR_START>
+//
+// Name: AmiLoadCsmPolicy.h
+//
+// Description: This file contains guid definitions for AMI LoadCsm policy
+//
+//<AMI_FHDR_END>
+//**********************************************************************
+#ifndef __AMI_LOAD_CSM_POLICY__H__
+#define __AMI_LOAD_CSM_POLICY__H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define AMI_LOAD_CSM_GUID \
+ { 0x16287ba4, 0x5b9d, 0x4d98, 0x91, 0x9f, 0x7b, 0x7b, 0x78, 0xcb, 0x2b, 0xe0 }
+
+#define AMI_CSM_DRIVER_STARTED_GUID \
+ { 0x3EA824D1, 0x81E3, 0x4FF5, 0xBD, 0x43, 0xBB, 0x9C, 0x65, 0xDF, 0x7C, 0x46 }
+
+#define OPROM_START_END_PROTOCOL_GUID \
+ { 0xf2a128ff, 0x257b, 0x456e, 0x9d, 0xe8, 0x63, 0xe7, 0xc7, 0xdc, 0xdf, 0xac }
+
+#define AMI_CSM_THUNK_PROTOCOL_GUID \
+ { 0x2362ea9c, 0x84e5, 0x4dff, 0x83, 0xbc, 0xb5, 0xac, 0xec, 0xb5, 0x7c, 0xbb }
+
+#define AMI_OPROM_POLICY_PROTOCOL_GUID \
+ { 0x542d6248, 0x4198, 0x4960, 0x9f, 0x59, 0x23, 0x84, 0x64, 0x6d, 0x63, 0xb4 }
+
+typedef struct _AMI_OPROM_POLICY_PROTOCOL AMI_OPROM_POLICY_PROTOCOL;
+
+typedef EFI_STATUS (*CHECK_UEFI_OPROM_POLICY) (
+ IN AMI_OPROM_POLICY_PROTOCOL *This,
+ IN EFI_HANDLE PciHandle
+);
+
+struct _AMI_OPROM_POLICY_PROTOCOL {
+ CHECK_UEFI_OPROM_POLICY CheckUefiOpromPolicy;
+};
+
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2009, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
diff --git a/Include/AmiPeiLib.h b/Include/AmiPeiLib.h
new file mode 100644
index 0000000..3c4b8fa
--- /dev/null
+++ b/Include/AmiPeiLib.h
@@ -0,0 +1,270 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2007, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/BIN/Core/Include/AmiPeiLib.h 16 2/05/11 2:01p Artems $
+//
+// $Revision: 16 $
+//
+// $Date: 2/05/11 2:01p $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Core/Include/AmiPeiLib.h $
+//
+// 16 2/05/11 2:01p Artems
+// Added functions to support both PI 0.91 and PI 1.0-1.1 specifications
+//
+// 15 6/06/08 10:50a Felixp
+// Performance API extended with PEI_PERF_SAVE_S3_DATA macro
+//
+// 14 5/07/08 12:21p Felixp
+// Performance API added
+//
+// 13 10/22/07 6:24p Felixp
+// FindFfsFileByName routine added.
+//
+// 12 8/30/07 11:00p Felixp
+// PeiGetVariable and PeiGetNextVariableName routines added.
+//
+// 11 4/20/07 5:08p Felixp
+// Status Code macros redefined
+//
+// 10 3/08/07 2:59a Felixp
+// Update of the status code specific definitions
+//
+// 9 8/24/06 9:10a Felixp
+// x64 support
+//
+// 8 5/23/06 5:03a Felixp
+//
+// 7 5/20/06 9:35p Felixp
+// PEI_ASSET & EFI_PEI_ASSERT added
+//
+// 6 3/13/06 1:15a Felixp
+//
+// 5 10/09/05 11:26a Felixp
+// Support for performance measurements added.
+//
+// 4 6/16/05 10:43a Felixp
+// CreateLoadHob function added (used by PEIMs to reguest reallocation to
+// RAM,
+// once memory is detected)
+//
+// 3 6/07/05 7:22p Felixp
+// PEI_PROGRESS_CODE imeplemented via call to ReportStatusCode
+//
+// 2 3/04/05 10:21a Mandal
+//
+// 1 1/28/05 12:44p Felixp
+//
+// 5 1/24/05 2:23p Felixp
+// FVFILE_SIZE macros added
+//
+// 3 1/18/05 3:21p Felixp
+// PrintDebugMessage renamed to Trace
+//
+// 1 12/23/04 9:41a Felixp
+//
+// 7 12/17/04 6:45p Felixp
+// PEI_DEBUG_MSG renamed to PEI_TRACE
+//
+// 6 11/10/04 5:16p Felixp
+// Level parameter added to PeiTrace fucntion
+//
+// 5 11/02/04 5:32p Felixp
+//
+// 4 10/22/04 7:35p Felixp
+//
+// 3 10/20/04 10:48a Felixp
+//
+// 2 3/28/04 2:11p Felixp
+// 1. PE Loader and some other commonly used code moved to the Library
+// 2. Warnings fixed (from now on warning will be treated as error)
+//
+// 1 3/23/04 5:52p Felixp
+//
+//**********************************************************************
+//<AMI_FHDR_START>
+//
+// Name: AmiPeiLib.h
+//
+// Description:
+//
+//<AMI_FHDR_END>
+//**********************************************************************
+#ifndef __AMI_PEI_LIB__H__
+#define __AMI_PEI_LIB__H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+#include <PEI.h>
+#include <HOB.h>
+#include <AmiLib.h>
+//****************************************************************************/
+// TYPE DECLARATIONS
+//****************************************************************************/
+
+//****************************************************************************/
+// MACOROS DECLARATIONS
+//****************************************************************************/
+#define FVSECTION_SIZE(pSection) ((*(UINT32*)&((EFI_COMMON_SECTION_HEADER*)(pSection)-1)->Size[0] & 0xffffff) - sizeof(EFI_COMMON_SECTION_HEADER))
+#define FVFILE_SIZE(pFile) (*(UINT32*)&(pFile)->Size[0]&0xffffff)
+
+#ifdef EFI_DEBUG
+#define PEI_TRACE(Arguments) PeiTrace Arguments
+
+#ifndef PEI_ASSERT
+#define PEI_ASSERT(PeiServices,Condition) if(!(Condition)) { \
+ PeiTrace(-1,PeiServices,"ASSERT in %s on %i: %s\n",__FILE__, __LINE__, #Condition);\
+ EFI_DEADLOOP() \
+ }
+#define ASSERT_PEI_ERROR(PeiServices,Status) PEI_ASSERT(PeiServices,!EFI_ERROR(Status))
+#endif
+
+#define PEI_VERIFY PEI_ASSERT
+#define VERIFY_PEI_ERROR ASSERT_EFI_ERROR
+
+#else // EFI_DEBUG==0
+#define PEI_TRACE(Arguments)
+
+#ifndef PEI_ASSERT
+#define PEI_ASSERT(PeiServices,Condition)
+#define ASSERT_PEI_ERROR(PeiServices,Status)
+#endif
+
+#define PEI_VERIFY(x) (x)
+#define VERIFY_PEI_ERROR(x) (x)
+
+#endif
+
+#define PEI_PROGRESS_CODE(PeiServices, Code)\
+ (*PeiServices)->ReportStatusCode(PeiServices, EFI_PROGRESS_CODE, Code, 0, NULL, NULL)
+
+#define PEI_ERROR_CODE(PeiServices, Code, Severity)\
+ (*PeiServices)->ReportStatusCode(\
+ (EFI_PEI_SERVICES**)PeiServices, EFI_ERROR_CODE|(Severity),\
+ Code, 0, NULL, NULL\
+ )
+
+#ifdef EFI_PEI_PERFORMANCE
+#define PEI_PERF_START(Ps, Token, FileHeader, Value) PeiPerfMeasure (Ps, Token, FileHeader, FALSE, Value)
+#define PEI_PERF_END(Ps, Token, FileHeader, Value) PeiPerfMeasure (Ps, Token, FileHeader, TRUE, Value)
+#define PEI_PERF_SAVE_S3_DATA(Ps) SaveS3PerformanceData(Ps)
+#else
+#define PEI_PERF_START(Ps, Token, FileHeader, Value)
+#define PEI_PERF_END(Ps, Token, FileHeader, Value)
+#define PEI_PERF_SAVE_S3_DATA(Ps)
+#endif
+
+//****************************************************************************/
+// VARIABLE DECLARATIONS
+//****************************************************************************/
+
+//****************************************************************************/
+// FUNCTION DECLARATIONS
+//****************************************************************************/
+VOID* PEEntryPoint(VOID *p);
+VOID* TEEntryPoint(VOID *p);
+UINT32 GetImageSize(VOID *p);
+
+VOID PeiTrace(UINTN Level, CONST EFI_PEI_SERVICES **ppPS, CHAR8 *sFormat,...);
+VOID PeiReportErrorCode(EFI_PEI_SERVICES **ppPS, UINT16 Code, UINT32 Action);
+
+EFI_STATUS CreateHobMemoryAllocationModule(
+ IN EFI_PEI_SERVICES **PeiServices,
+ IN EFI_PHYSICAL_ADDRESS MemoryBaseAddress,
+ IN UINT64 MemoryLength, IN EFI_MEMORY_TYPE MemoryType,
+ IN EFI_GUID *ModuleName,
+ IN EFI_PHYSICAL_ADDRESS EntryPoint
+);
+EFI_STATUS CreateHobResourceDescriptor
+(
+ IN EFI_PEI_SERVICES **PeiServices,
+ IN EFI_GUID *Owner, IN EFI_RESOURCE_TYPE ResourceType,
+ IN EFI_RESOURCE_ATTRIBUTE_TYPE ResourceAttribute,
+ IN EFI_PHYSICAL_ADDRESS PhysicalStart,
+ IN UINT64 ResourceLength
+);
+EFI_STATUS CreateLoadHob(
+ IN EFI_PEI_SERVICES **ppPS, IN EFI_FFS_FILE_HEADER *pFfsHeader,
+ EFI_PEIM_ENTRY_POINT EntryPoint, EFI_PEIM_ENTRY_POINT InMemEntryPoint
+);
+
+EFI_STATUS PeiGetVariable(
+ IN EFI_PEI_SERVICES **PeiServices,
+ IN CONST CHAR16 *VariableName, IN CONST EFI_GUID *VariableGuid,
+ OUT UINT32 *Attributes,
+ IN OUT UINTN *DataSize, OUT VOID *Data
+);
+EFI_STATUS PeiGetNextVariableName(
+ IN EFI_PEI_SERVICES **PeiServices,
+ IN OUT UINTN *VariableNameSize, IN OUT CHAR16 *VariableName,
+ IN OUT EFI_GUID *VariableGuid
+);
+
+VOID* FindFfsFileByName(
+ IN EFI_PEI_SERVICES **PeiServices, EFI_FV_FILETYPE FileType,
+ EFI_GUID *FileName
+);
+
+VOID PeiPerfMeasure (
+ EFI_PEI_SERVICES **PeiServices,
+ IN CHAR16 *Token, IN EFI_FFS_FILE_HEADER *FileHeader,
+ IN BOOLEAN EntryExit, IN UINT64 Value
+);
+
+VOID SaveS3PerformanceData(IN EFI_PEI_SERVICES **PeiServices);
+
+EFI_STATUS PeiLoadFile(
+ IN CONST EFI_PEI_SERVICES ** PeiServices,
+ IN EFI_PEI_FILE_HANDLE FileHandle,
+ OUT EFI_PHYSICAL_ADDRESS *ImageAddress,
+ OUT UINT64 *ImageSize,
+ OUT EFI_PHYSICAL_ADDRESS *EntryPoint
+);
+
+EFI_PEI_SERVICES ** GetPeiServicesTablePointer (VOID);
+#if PI_SPECIFICATION_VERSION >= 0x00010000
+VOID SetPeiServicesTablePointer (
+ IN CONST EFI_PEI_SERVICES ** PeiServicesTablePointer
+);
+#endif
+
+EFI_STATUS PciCfgModify(
+ IN CONST EFI_PEI_SERVICES ** PeiServices,
+ IN EFI_PEI_PCI_CFG_PPI_WIDTH Width,
+ IN UINT64 Address,
+ IN UINTN SetBits,
+ IN UINTN ClearBits
+);
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2007, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
diff --git a/Include/AmiSmm.h b/Include/AmiSmm.h
new file mode 100644
index 0000000..2bdf7fb
--- /dev/null
+++ b/Include/AmiSmm.h
@@ -0,0 +1,97 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2005, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/BIN/Core/Include/AmiSmm.h 3 8/10/05 4:56p Markw $
+//
+// $Revision: 3 $
+//
+// $Date: 8/10/05 4:56p $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Core/Include/AmiSmm.h $
+//
+// 3 8/10/05 4:56p Markw
+// Change SmmBasesVariable to point to a function to change SMM Bases.
+//
+// 2 4/08/05 4:36p Markw
+// Added SmmBasesVariable.
+//
+// 1 4/06/05 10:55a Markw
+//
+//**********************************************************************
+//<AMI_FHDR_START>
+//
+// Name: AmiSmm.h
+//
+// Description: Ami specific Smm definitions
+//
+//<AMI_FHDR_END>
+//**********************************************************************
+
+#ifndef __AMI_SMM__H__
+#define __AMI_SMM__H__
+
+#include <efi.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+//The following is for restoring SMM bases on S3 resume.
+#define SMM_BASES_VARIABLE L"SmmBasesVariable"
+
+#pragma pack(1)
+
+typedef struct _SMM_BASE_CHANGE_INFO SMM_BASE_CHANGE_INFO;
+
+struct _SMM_BASE_CHANGE_INFO {
+ VOID (*ChgSmmBases)(SMM_BASE_CHANGE_INFO *This);
+};
+#pragma pack()
+
+//This structure is added to SMM Configuration Table to determine
+// which CPU generated a software smi.
+
+#define SW_SMI_CPU_TRIGGER_GUID \
+ {0xe4d535bb,0x5dea,0x42f8,0xb5,0xf8,0xd6,0xb8,0x13,0xff,0x6b,0x46}
+
+typedef struct {
+ UINTN Cpu;
+} SW_SMI_CPU_TRIGGER;
+
+
+
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2005, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
diff --git a/Include/AmiStatusCodes.h b/Include/AmiStatusCodes.h
new file mode 100644
index 0000000..8e1c3cc
--- /dev/null
+++ b/Include/AmiStatusCodes.h
@@ -0,0 +1,365 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2007, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/BIN/Core/Include/AmiStatusCodes.h 13 1/12/12 12:16p Oleksiyy $
+//
+// $Revision: 13 $
+//
+// $Date: 1/12/12 12:16p $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Core/Include/AmiStatusCodes.h $
+//
+// 13 1/12/12 12:16p Oleksiyy
+// [TAG] EIP75246
+// [Category] Bug Fix
+// [Severity] Normal
+// [Symptom] PI 1.2 Errata C Status Code
+// [RootCause] PI 1.2 Errata C introduced changies in definitions.
+// [Solution] Defenitions fixed up to PI 1.2 Errata C.
+// [Files] AmiStatusCodes.h, StatusCodes.h, StatusCodeDataTypeId.h
+//
+// 12 8/16/10 4:24p Felixp
+// Additional keyboard errors are added.
+//
+// 10 10/10/08 9:11a Felixp
+// Status Codes for NB2 initialization is added (EIP 15573)
+//
+// 9 5/14/08 4:47p Rameshraju
+// Ide Device Error Code Added.
+//
+// 8 4/22/08 4:33p Felixp
+// Additional progress codes added
+//
+// 7 12/18/07 10:00a Felixp
+// DXE_IDE_CONTROLLER_ERROR error code added
+//
+// 6 12/13/07 11:58a Felixp
+// DXE_IDE_SMART_ERROR error definition added
+//
+// 5 8/07/07 2:20p Felixp
+// New StatusCodes added
+//
+// 4 4/20/07 5:09p Felixp
+// AMI Status Codes added
+//
+// 3 3/13/07 1:40a Felixp
+//
+// 2 3/08/07 3:02a Felixp
+//
+//
+//**********************************************************************
+//<AMI_FHDR_START>
+//
+// Name: AmiStatusCodes.h
+//
+// Description: AMI Status Codes
+//
+//<AMI_FHDR_END>
+//**********************************************************************
+#ifndef __AMI_STATUS_CODES__H__
+#define __AMI_STATUS_CODES__H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <StatusCodes.h>
+///////////////////////////////////////////////////////////////////////////////
+// AMI Progress/Error Codes
+///////////////////////////////////////////////////////////////////////////////
+//Reported by PEI Core
+#define PEI_CORE_STARTED (EFI_SOFTWARE_PEI_CORE | EFI_SW_PEI_CORE_PC_ENTRY_POINT)
+// Reported by CPU PEIM
+#define PEI_CAR_CPU_INIT (EFI_COMPUTING_UNIT_HOST_PROCESSOR | EFI_CU_HP_PC_POWER_ON_INIT)
+// Reported by NB PEIM
+#define PEI_CAR_NB_INIT (EFI_COMPUTING_UNIT_CHIPSET | AMI_CHIPSET_PC_PEI_CAR_NB_INIT)
+// Reported by NB2 PEIM
+#define PEI_CAR_NB2_INIT (EFI_COMPUTING_UNIT_CHIPSET | AMI_CHIPSET_PC_PEI_CAR_NB2_INIT)
+// Reported by SB PEIM
+#define PEI_CAR_SB_INIT (EFI_COMPUTING_UNIT_CHIPSET | AMI_CHIPSET_PC_PEI_CAR_SB_INIT)
+//Reported by Memory Detection PEIM
+#define PEI_MEMORY_SPD_READ (EFI_COMPUTING_UNIT_MEMORY | EFI_CU_MEMORY_PC_SPD_READ)
+#define PEI_MEMORY_PRESENCE_DETECT (EFI_COMPUTING_UNIT_MEMORY | EFI_CU_MEMORY_PC_PRESENCE_DETECT)
+#define PEI_MEMORY_TIMING (EFI_COMPUTING_UNIT_MEMORY | EFI_CU_MEMORY_PC_TIMING)
+#define PEI_MEMORY_CONFIGURING (EFI_COMPUTING_UNIT_MEMORY | EFI_CU_MEMORY_PC_CONFIGURING)
+#define PEI_MEMORY_OPTIMIZING (EFI_COMPUTING_UNIT_MEMORY | EFI_CU_MEMORY_PC_OPTIMIZING)
+#define PEI_MEMORY_INIT (EFI_COMPUTING_UNIT_MEMORY | EFI_CU_MEMORY_PC_INIT)
+#define PEI_MEMORY_TEST (EFI_COMPUTING_UNIT_MEMORY | EFI_CU_MEMORY_PC_TEST)
+#define PEI_MEMORY_INVALID_TYPE (EFI_COMPUTING_UNIT_MEMORY | EFI_CU_MEMORY_EC_INVALID_TYPE)
+#define PEI_MEMORY_INVALID_SPEED (EFI_COMPUTING_UNIT_MEMORY | EFI_CU_MEMORY_EC_INVALID_SPEED)
+#define PEI_MEMORY_SPD_FAIL (EFI_COMPUTING_UNIT_MEMORY | EFI_CU_MEMORY_EC_SPD_FAIL)
+#define PEI_MEMORY_INVALID_SIZE (EFI_COMPUTING_UNIT_MEMORY | EFI_CU_MEMORY_EC_INVALID_SIZE)
+#define PEI_MEMORY_MISMATCH (EFI_COMPUTING_UNIT_MEMORY | EFI_CU_MEMORY_EC_MISMATCH)
+#define PEI_MEMORY_S3_RESUME_FAILED (EFI_COMPUTING_UNIT_MEMORY | EFI_CU_MEMORY_EC_S3_RESUME_FAIL)
+//If non of the errors above apply use one of these
+#define PEI_MEMORY_NOT_DETECTED (EFI_COMPUTING_UNIT_MEMORY | EFI_CU_MEMORY_EC_NONE_DETECTED)
+#define PEI_MEMORY_NONE_USEFUL (EFI_COMPUTING_UNIT_MEMORY | EFI_CU_MEMORY_EC_NONE_USEFUL)
+//Generic memory error. It should only be used if non of the errors above apply
+#define PEI_MEMORY_ERROR (EFI_COMPUTING_UNIT_MEMORY | EFI_CU_EC_NON_SPECIFIC)
+
+//Reported by PEI Core
+#define PEI_MEMORY_INSTALLED (EFI_SOFTWARE_PEI_SERVICE | EFI_SW_PS_PC_INSTALL_PEI_MEMORY)
+#define PEI_MEMORY_NOT_INSTALLED (EFI_SOFTWARE_PEI_SERVICE | AMI_PS_EC_MEMORY_NOT_INSTALLED)
+// (*PeiServices)->InstallPeiMemory called more then once
+#define PEI_MEMORY_INSTALLED_TWICE (EFI_SOFTWARE_PEI_SERVICE | AMI_PS_EC_MEMORY_INSTALLED_TWICE)
+
+//Reported by CPU PEIM
+#define PEI_CPU_INIT (EFI_COMPUTING_UNIT_HOST_PROCESSOR | EFI_CU_PC_INIT_BEGIN)
+#define PEI_CPU_CACHE_INIT (EFI_COMPUTING_UNIT_HOST_PROCESSOR | EFI_CU_HP_PC_CACHE_INIT)
+#define PEI_CPU_BSP_SELECT (EFI_COMPUTING_UNIT_HOST_PROCESSOR | EFI_CU_HP_PC_BSP_SELECT)
+#define PEI_CPU_AP_INIT (EFI_COMPUTING_UNIT_HOST_PROCESSOR | EFI_CU_HP_PC_AP_INIT)
+#define PEI_CPU_SMM_INIT (EFI_COMPUTING_UNIT_HOST_PROCESSOR | EFI_CU_HP_PC_SMM_INIT)
+#define PEI_CPU_INVALID_TYPE (EFI_COMPUTING_UNIT_HOST_PROCESSOR | EFI_CU_HP_EC_INVALID_TYPE)
+#define PEI_CPU_INVALID_SPEED (EFI_COMPUTING_UNIT_HOST_PROCESSOR | EFI_CU_HP_EC_INVALID_SPEED)
+#define PEI_CPU_MISMATCH (EFI_COMPUTING_UNIT_HOST_PROCESSOR | EFI_CU_HP_EC_MISMATCH)
+#define PEI_CPU_SELF_TEST_FAILED (EFI_COMPUTING_UNIT_HOST_PROCESSOR | EFI_CU_HP_EC_SELF_TEST)
+#define PEI_CPU_CACHE_ERROR (EFI_COMPUTING_UNIT_HOST_PROCESSOR | EFI_CU_HP_EC_CACHE)
+#define PEI_CPU_MICROCODE_UPDATE_FAILED (EFI_COMPUTING_UNIT_HOST_PROCESSOR | EFI_CU_HP_EC_MICROCODE_UPDATE)
+#define PEI_CPU_NO_MICROCODE (EFI_COMPUTING_UNIT_HOST_PROCESSOR | EFI_CU_HP_EC_NO_MICROCODE_UPDATE)
+//If non of the errors above apply use this one
+#define PEI_CPU_INTERNAL_ERROR (EFI_COMPUTING_UNIT_HOST_PROCESSOR | EFI_CU_HP_EC_INTERNAL)
+//Generic CPU error. It should only be used if non of the errors above apply
+#define PEI_CPU_ERROR (EFI_COMPUTING_UNIT_HOST_PROCESSOR | EFI_CU_EC_NON_SPECIFIC)
+
+// Reported by NB PEIM
+#define PEI_MEM_NB_INIT (EFI_COMPUTING_UNIT_CHIPSET | AMI_CHIPSET_PC_PEI_MEM_NB_INIT)
+// Reported by NB PEIM
+#define PEI_MEM_NB2_INIT (EFI_COMPUTING_UNIT_CHIPSET | AMI_CHIPSET_PC_PEI_MEM_NB2_INIT)
+// Reported by SB PEIM
+#define PEI_MEM_SB_INIT (EFI_COMPUTING_UNIT_CHIPSET | AMI_CHIPSET_PC_PEI_MEM_SB_INIT)
+
+//Reported by PEIM which detected forced or auto recovery condition
+#define PEI_RECOVERY_AUTO (EFI_SOFTWARE_PEI_MODULE | EFI_SW_PEIM_PC_RECOVERY_AUTO)
+#define PEI_RECOVERY_USER (EFI_SOFTWARE_PEI_MODULE | EFI_SW_PEIM_PC_RECOVERY_USER)
+
+//Reported by DXE IPL
+#define PEI_RECOVERY_PPI_NOT_FOUND (EFI_SOFTWARE_PEI_MODULE | AMI_PEIM_EC_RECOVERY_PPI_NOT_FOUND)
+#define PEI_RECOVERY_FAILED (EFI_SOFTWARE_PEI_MODULE | AMI_PEIM_EC_RECOVERY_FAILED)
+#define PEI_S3_RESUME_PPI_NOT_FOUND (EFI_SOFTWARE_PEI_MODULE | AMI_PEIM_EC_S3_RESUME_PPI_NOT_FOUND)
+#define PEI_S3_RESUME_FAILED (EFI_SOFTWARE_PEI_MODULE | AMI_PEIM_EC_S3_RESUME_FAILED)
+
+//Reported by Recovery PEIM
+#define PEI_RECOVERY_STARTED (EFI_SOFTWARE_PEI_MODULE | EFI_SW_PEIM_PC_RECOVERY_BEGIN)
+#define PEI_RECOVERY_CAPSULE_FOUND (EFI_SOFTWARE_PEI_MODULE | EFI_SW_PEIM_PC_CAPSULE_LOAD)
+#define PEI_RECOVERY_NO_CAPSULE (EFI_SOFTWARE_PEI_MODULE | EFI_SW_PEI_EC_NO_RECOVERY_CAPSULE)
+#define PEI_RECOVERY_CAPSULE_LOADED (EFI_SOFTWARE_PEI_MODULE | EFI_SW_PEIM_PC_CAPSULE_START)
+#define PEI_RECOVERY_INVALID_CAPSULE (EFI_SOFTWARE_PEI_MODULE | EFI_SW_PEI_EC_INVALID_CAPSULE_DESCRIPTOR)
+
+//Reported by S3 Resume PEIM
+#define PEI_S3_STARTED (EFI_SOFTWARE_PEI_MODULE | AMI_PEIM_PC_S3_STARTED)
+#define PEI_S3_BOOT_SCRIPT (EFI_SOFTWARE_PEI_MODULE | AMI_PEIM_PC_S3_BOOT_SCRIPT)
+#define PEI_S3_VIDEO_REPOST (EFI_SOFTWARE_PEI_MODULE | AMI_PEIM_PC_VIDEO_REPOST)
+#define PEI_S3_OS_WAKE (EFI_SOFTWARE_PEI_MODULE | AMI_PEIM_PC_OS_WAKE)
+#define PEI_S3_BOOT_SCRIPT_ERROR (EFI_SOFTWARE_PEI_MODULE | AMI_PEIM_EC_S3_BOOT_SCRIPT_ERROR)
+#define PEI_S3_OS_WAKE_ERROR (EFI_SOFTWARE_PEI_MODULE | AMI_PEIM_EC_S3_OS_WAKE_ERROR)
+#define PEI_S3_RESUME_ERROR (EFI_SOFTWARE_PEI_MODULE | AMI_PEIM_EC_S3_RESUME_ERROR)
+
+#define PEI_PEIM_STARTED (EFI_SOFTWARE_PEI_CORE | EFI_SW_PC_INIT_BEGIN)
+#define PEI_PEIM_ENDED (EFI_SOFTWARE_PEI_CORE | EFI_SW_PC_INIT_END)
+
+//Reported by PEI Core
+#define PEI_DXEIPL_NOT_FOUND (EFI_SOFTWARE_PEI_CORE | AMI_PEI_CORE_EC_DXEIPL_NOT_FOUND)
+
+//Reported by DXE IPL
+#define PEI_DXE_IPL_STARTED (EFI_SOFTWARE_PEI_CORE | EFI_SW_PEI_CORE_PC_HANDOFF_TO_NEXT)
+#define PEI_DXE_CORE_NOT_FOUND (EFI_SOFTWARE_PEI_CORE | EFI_SW_PEI_CORE_EC_DXE_CORRUPT)
+
+//Reported by PEIM which installs Reset PPI
+#define PEI_RESET_SYSTEM (EFI_SOFTWARE_PEI_SERVICE | AMI_PS_PC_RESET_SYSTEM)
+#define PEI_RESET_NOT_AVAILABLE (EFI_SOFTWARE_PEI_SERVICE | AMI_PS_EC_RESET_NOT_AVAILABLE)
+
+//Reported by the PEIM or DXE driver which detected the error
+#define GENERIC_MEMORY_CORRECTABLE_ERROR (EFI_COMPUTING_UNIT_MEMORY | EFI_CU_MEMORY_EC_CORRECTABLE)
+#define GENERIC_MEMORY_UNCORRECTABLE_ERROR (EFI_COMPUTING_UNIT_MEMORY | EFI_CU_MEMORY_EC_UNCORRECTABLE)
+
+//Reported by Flash Update DXE driver
+#define DXE_FLASH_UPDATE_FAILED (EFI_COMPUTING_UNIT_MEMORY | EFI_CU_MEMORY_EC_UPDATE_FAIL)
+
+//Reported by the PEIM or DXE driver which detected the error
+#define GENERIC_CPU_THERMAL_ERROR (EFI_COMPUTING_UNIT_HOST_PROCESSOR | EFI_CU_HP_EC_THERMAL)
+#define GENERIC_CPU_LOW_VOLTAGE (EFI_COMPUTING_UNIT_HOST_PROCESSOR | EFI_CU_HP_EC_LOW_VOLTAGE)
+#define GENERIC_CPU_HIGH_VOLTAGE (EFI_COMPUTING_UNIT_HOST_PROCESSOR | EFI_CU_HP_EC_HIGH_VOLTAGE)
+#define GENERIC_CPU_CORRECTABLE_ERROR (EFI_COMPUTING_UNIT_HOST_PROCESSOR | EFI_CU_HP_EC_CORRECTABLE)
+#define GENERIC_CPU_UNCORRECTABLE_ERROR (EFI_COMPUTING_UNIT_HOST_PROCESSOR | EFI_CU_HP_EC_UNCORRECTABLE)
+#define GENERIC_BAD_DATE_TIME_ERROR (EFI_SOFTWARE_UNSPECIFIED | EFI_SW_EC_BAD_DATE_TIME)
+#define GENERIC_MEMORY_SIZE_DECREASE (EFI_COMPUTING_UNIT_MEMORY | EFI_CU_MEMORY_EC_MISMATCH)
+
+//Reported by DXE Core
+#define DXE_CORE_STARTED (EFI_SOFTWARE_DXE_CORE | EFI_SW_DXE_CORE_PC_ENTRY_POINT)
+#define DXE_DRIVER_STARTED (EFI_SOFTWARE_EFI_DXE_SERVICE | EFI_SW_PC_INIT_BEGIN)
+#define DXE_DRIVER_ENED (EFI_SOFTWARE_DXE_CORE | EFI_SW_PC_INIT_END)
+#define DXE_ARCH_PROTOCOLS_AVAILABLE (EFI_SOFTWARE_DXE_CORE | AMI_DXE_CORE_PC_ARCH_READY)
+#define DXE_DRIVER_CONNECTED (EFI_SOFTWARE_DXE_CORE | EFI_SW_DXE_CORE_PC_START_DRIVER)
+#define DXE_ARCH_PROTOCOL_NOT_AVAILABLE (EFI_SOFTWARE_DXE_CORE | AMI_DXE_CORE_EC_NO_ARCH)
+
+//Reported by DXE CPU driver
+#define DXE_CPU_INIT (EFI_COMPUTING_UNIT_HOST_PROCESSOR | AMI_CU_HP_PC_DXE_CPU_INIT)
+#define DXE_CPU_ERROR (EFI_COMPUTING_UNIT_HOST_PROCESSOR | AMI_CU_HP_EC_DXE_CPU_ERROR)
+
+//Reported by PCI Host Bridge driver
+#define DXE_NB_HB_INIT (EFI_COMPUTING_UNIT_CHIPSET | AMI_CHIPSET_PC_DXE_HB_INIT )
+
+// Reported by NB Driver
+#define DXE_NB_INIT (EFI_COMPUTING_UNIT_CHIPSET | AMI_CHIPSET_PC_DXE_NB_INIT )
+#define DXE_NB_SMM_INIT (EFI_COMPUTING_UNIT_CHIPSET | AMI_CHIPSET_PC_DXE_NB_SMM_INIT )
+#define DXE_NB_ERROR (EFI_COMPUTING_UNIT_CHIPSET | AMI_CHIPSET_EC_DXE_NB_ERROR )
+
+// Reported by NB2 Driver
+#define DXE_NB2_INIT (EFI_COMPUTING_UNIT_CHIPSET | AMI_CHIPSET_PC_DXE_NB2_INIT )
+
+// Reported by SB Driver(s)
+#define DXE_SBRUN_INIT (EFI_COMPUTING_UNIT_CHIPSET | AMI_CHIPSET_PC_DXE_SB_RT_INIT )
+#define DXE_SB_INIT (EFI_COMPUTING_UNIT_CHIPSET | AMI_CHIPSET_PC_DXE_SB_INIT )
+#define DXE_SB_SMM_INIT (EFI_COMPUTING_UNIT_CHIPSET | AMI_CHIPSET_PC_DXE_SB_SMM_INIT )
+#define DXE_SB_DEVICES_INIT (EFI_COMPUTING_UNIT_CHIPSET | AMI_CHIPSET_PC_DXE_SB_DEVICES_INIT )
+#define DXE_SB_BAD_BATTERY (EFI_COMPUTING_UNIT_CHIPSET | AMI_CHIPSET_EC_BAD_BATTERY)
+#define DXE_SB_INTRUDER_DETECT (EFI_COMPUTING_UNIT_CHIPSET | AMI_CHIPSET_EC_INTRUDER_DETECT)
+#define DXE_SB_ERROR (EFI_COMPUTING_UNIT_CHIPSET | AMI_CHIPSET_EC_DXE_SB_ERROR )
+
+//Reported by ACPI driver
+#define DXE_ACPI_INIT (EFI_SOFTWARE_DXE_BS_DRIVER | AMI_DXE_BS_PC_ACPI_INIT)
+
+//Reported by DXE Core
+#define DXE_BDS_STARTED (EFI_SOFTWARE_DXE_CORE | EFI_SW_DXE_CORE_PC_HANDOFF_TO_NEXT)
+
+//Reported by BDS
+#define DXE_BDS_CONNECT_DRIVERS (EFI_SOFTWARE_DXE_BS_DRIVER | EFI_SW_DXE_BS_PC_BEGIN_CONNECTING_DRIVERS)
+
+//Reported by Boot Manager
+#define DXE_READY_TO_BOOT (EFI_SOFTWARE_DXE_BS_DRIVER | EFI_SW_DXE_BS_PC_READY_TO_BOOT_EVENT)
+
+//Reported by NVRAM driver
+#define DXE_NVRAM_INIT (EFI_SOFTWARE_EFI_BOOT_SERVICE | AMI_BS_PC_NVRAM_INIT)
+#define DXE_NVRAM_CLEANUP (EFI_SOFTWARE_EFI_BOOT_SERVICE | AMI_BS_PC_NVRAM_GC)
+#define DXE_CONFIGURATION_RESET (EFI_SOFTWARE_EFI_BOOT_SERVICE | AMI_BS_PC_CONFIG_RESET)
+
+//Reported by DXE Core
+#define DXE_EXIT_BOOT_SERVICES (EFI_SOFTWARE_EFI_BOOT_SERVICE | EFI_SW_BS_PC_EXIT_BOOT_SERVICES)
+#define DXE_EXIT_BOOT_SERVICES_EVENT (EFI_SOFTWARE_DXE_BS_DRIVER | EFI_SW_DXE_BS_PC_EXIT_BOOT_SERVICES_EVENT)
+
+//Reported by driver that installs Runtime AP
+#define RT_SET_VIRTUAL_ADDRESS_MAP_BEGIN (EFI_SOFTWARE_EFI_RUNTIME_SERVICE | EFI_SW_RS_PC_SET_VIRTUAL_ADDRESS_MAP)
+#define RT_SET_VIRTUAL_ADDRESS_MAP_END (EFI_SOFTWARE_DXE_BS_DRIVER | EFI_SW_DXE_BS_PC_VIRTUAL_ADDRESS_CHANGE_EVENT)
+
+//Reported by CSM
+#define DXE_CSM_INIT (EFI_SOFTWARE_DXE_BS_DRIVER | AMI_DXE_BS_PC_CSM_INIT)
+#define DXE_LEGACY_OPROM_INIT (EFI_SOFTWARE_DXE_BS_DRIVER | EFI_SW_DXE_BS_PC_LEGACY_OPROM_INIT)
+#define DXE_LEGACY_BOOT (EFI_SOFTWARE_DXE_BS_DRIVER | EFI_SW_DXE_BS_PC_LEGACY_BOOT_EVENT)
+#define DXE_LEGACY_OPROM_NO_SPACE (EFI_SOFTWARE_DXE_BS_DRIVER | EFI_SW_DXE_BS_EC_LEGACY_OPROM_NO_SPACE)
+
+//Reported by TSE
+#define DXE_SETUP_VERIFYING_PASSWORD (EFI_SOFTWARE_DXE_BS_DRIVER | EFI_SW_DXE_BS_PC_VERIFYING_PASSWORD)
+#define DXE_SETUP_START (EFI_SOFTWARE_DXE_BS_DRIVER | EFI_SW_PC_USER_SETUP)
+#define DXE_SETUP_INPUT_WAIT (EFI_SOFTWARE_DXE_BS_DRIVER | EFI_SW_PC_INPUT_WAIT)
+#define DXE_INVALID_PASSWORD (EFI_SOFTWARE_DXE_BS_DRIVER | AMI_DXE_BS_EC_INVALID_PASSWORD)
+#define DXE_INVALID_IDE_PASSWORD (EFI_SOFTWARE_DXE_BS_DRIVER | AMI_DXE_BS_EC_INVALID_IDE_PASSWORD)
+#define DXE_BOOT_OPTION_LOAD_ERROR (EFI_SOFTWARE_DXE_BS_DRIVER | AMI_DXE_BS_EC_BOOT_OPTION_LOAD_ERROR)
+#define DXE_BOOT_OPTION_FAILED (EFI_SOFTWARE_DXE_BS_DRIVER | AMI_DXE_BS_EC_BOOT_OPTION_FAILED)
+
+//Reported by a Driver that installs Reset AP
+#define DXE_RESET_SYSTEM (EFI_SOFTWARE_EFI_RUNTIME_SERVICE | EFI_SW_RS_PC_RESET_SYSTEM)
+#define DXE_RESET_NOT_AVAILABLE (EFI_SOFTWARE_EFI_RUNTIME_SERVICE | AMI_PS_EC_RESET_NOT_AVAILABLE)
+
+// Reported by PCI bus driver
+#define DXE_PCI_BUS_BEGIN (EFI_IO_BUS_PCI | EFI_IOB_PC_INIT)
+#define DXE_PCI_BUS_ENUM (EFI_IO_BUS_PCI | EFI_IOB_PCI_PC_BUS_ENUM)
+#define DXE_PCI_BUS_HPC_INIT (EFI_IO_BUS_PCI | EFI_IOB_PCI_PC_HPC_INIT)
+#define DXE_PCI_BUS_REQUEST_RESOURCES (EFI_IO_BUS_PCI | EFI_IOB_PCI_PC_RES_ALLOC)
+#define DXE_PCI_BUS_ASSIGN_RESOURCES (EFI_IO_BUS_PCI | EFI_IOB_PC_ENABLE)
+#define DXE_PCI_BUS_HOTPLUG (EFI_IO_BUS_PCI | EFI_IOB_PC_HOTPLUG)
+#define DXE_PCI_BUS_OUT_OF_RESOURCES (EFI_IO_BUS_PCI | EFI_IOB_EC_RESOURCE_CONFLICT)
+
+// Reported by USB bus driver
+#define DXE_USB_BEGIN (EFI_IO_BUS_USB | EFI_IOB_PC_INIT)
+#define DXE_USB_RESET (EFI_IO_BUS_USB | EFI_IOB_PC_RESET)
+#define DXE_USB_DETECT (EFI_IO_BUS_USB | EFI_IOB_PC_DETECT)
+#define DXE_USB_ENABLE (EFI_IO_BUS_USB | EFI_IOB_PC_ENABLE)
+#define DXE_USB_HOTPLUG (EFI_IO_BUS_USB | EFI_IOB_PC_HOTPLUG)
+
+//Reported by IDE bus driver
+#define DXE_IDE_BEGIN (EFI_IO_BUS_ATA_ATAPI | EFI_IOB_PC_INIT)
+#define DXE_IDE_RESET (EFI_IO_BUS_ATA_ATAPI | EFI_IOB_PC_RESET)
+#define DXE_IDE_DETECT (EFI_IO_BUS_ATA_ATAPI | EFI_IOB_PC_DETECT)
+#define DXE_IDE_ENABLE (EFI_IO_BUS_ATA_ATAPI | EFI_IOB_PC_ENABLE)
+#define DXE_IDE_SMART_ERROR (EFI_IO_BUS_ATA_ATAPI | EFI_IOB_ATA_BUS_SMART_OVERTHRESHOLD)
+#define DXE_IDE_CONTROLLER_ERROR (EFI_IO_BUS_ATA_ATAPI | EFI_IOB_EC_CONTROLLER_ERROR)
+#define DXE_IDE_DEVICE_FAILURE (EFI_IO_BUS_ATA_ATAPI | EFI_IOB_EC_INTERFACE_ERROR)
+
+// Reported by SCSI bus driver
+#define DXE_SCSI_BEGIN (EFI_IO_BUS_SCSI | EFI_IOB_PC_INIT)
+#define DXE_SCSI_RESET (EFI_IO_BUS_SCSI | EFI_IOB_PC_RESET)
+#define DXE_SCSI_DETECT (EFI_IO_BUS_SCSI | EFI_IOB_PC_DETECT)
+#define DXE_SCSI_ENABLE (EFI_IO_BUS_SCSI | EFI_IOB_PC_ENABLE)
+
+// Reported by Super I/O driver
+#define DXE_SIO_INIT (EFI_IO_BUS_LPC | EFI_IOB_PC_INIT)
+
+// Reported by Keyboard driver
+#define DXE_KEYBOARD_INIT (EFI_PERIPHERAL_KEYBOARD | EFI_P_PC_INIT)
+#define DXE_KEYBOARD_RESET (EFI_PERIPHERAL_KEYBOARD | EFI_P_PC_RESET)
+#define DXE_KEYBOARD_DISABLE (EFI_PERIPHERAL_KEYBOARD | EFI_P_PC_DISABLE)
+#define DXE_KEYBOARD_DETECT (EFI_PERIPHERAL_KEYBOARD | EFI_P_PC_PRESENCE_DETECT)
+#define DXE_KEYBOARD_ENABLE (EFI_PERIPHERAL_KEYBOARD | EFI_P_PC_ENABLE)
+#define DXE_KEYBOARD_CLEAR_BUFFER (EFI_PERIPHERAL_KEYBOARD | EFI_P_KEYBOARD_PC_CLEAR_BUFFER)
+#define DXE_KEYBOARD_SELF_TEST (EFI_PERIPHERAL_KEYBOARD | EFI_P_KEYBOARD_PC_SELF_TEST)
+#define DXE_KEYBOARD_STUCK_KEY_ERROR (EFI_PERIPHERAL_KEYBOARD | EFI_P_KEYBOARD_EC_STUCK_KEY)
+#define DXE_KEYBOARD_CONTROLLER_ERROR (EFI_PERIPHERAL_KEYBOARD | EFI_P_EC_CONTROLLER_ERROR)
+#define DXE_KEYBOARD_BUFFER_FULL_ERROR (EFI_PERIPHERAL_KEYBOARD | AMI_P_KEYBOARD_EC_BUFFER_FULL)
+
+// Reported by Mouse driver
+#define DXE_MOUSE_INIT (EFI_PERIPHERAL_MOUSE | EFI_P_PC_INIT)
+#define DXE_MOUSE_RESET (EFI_PERIPHERAL_MOUSE | EFI_P_PC_RESET)
+#define DXE_MOUSE_DISABLE (EFI_PERIPHERAL_MOUSE | EFI_P_PC_DISABLE)
+#define DXE_MOUSE_DETECT (EFI_PERIPHERAL_MOUSE | EFI_P_PC_PRESENCE_DETECT)
+#define DXE_MOUSE_ENABLE (EFI_PERIPHERAL_MOUSE | EFI_P_PC_ENABLE)
+
+// Reported by Mass Storage drivers
+#define DXE_FIXED_MEDIA_INIT (EFI_PERIPHERAL_FIXED_MEDIA | EFI_P_PC_INIT)
+#define DXE_FIXED_MEDIA_RESET (EFI_PERIPHERAL_FIXED_MEDIA | EFI_P_PC_RESET)
+#define DXE_FIXED_MEDIA_DISABLE (EFI_PERIPHERAL_FIXED_MEDIA | EFI_P_PC_DISABLE)
+#define DXE_FIXED_MEDIA_DETECT (EFI_PERIPHERAL_FIXED_MEDIA | EFI_P_PC_PRESENCE_DETECT)
+#define DXE_FIXED_MEDIA_ENABLE (EFI_PERIPHERAL_FIXED_MEDIA | EFI_P_PC_ENABLE)
+#define DXE_REMOVABLE_MEDIA_INIT (EFI_PERIPHERAL_REMOVABLE_MEDIA | EFI_P_PC_INIT)
+#define DXE_REMOVABLE_MEDIA_RESET (EFI_PERIPHERAL_REMOVABLE_MEDIA | EFI_P_PC_RESET)
+#define DXE_REMOVABLE_MEDIA_DISABLE (EFI_PERIPHERAL_REMOVABLE_MEDIA | EFI_P_PC_DISABLE)
+#define DXE_REMOVABLE_MEDIA_DETECT (EFI_PERIPHERAL_REMOVABLE_MEDIA | EFI_P_PC_PRESENCE_DETECT)
+#define DXE_REMOVABLE_MEDIA_ENABLE (EFI_PERIPHERAL_REMOVABLE_MEDIA | EFI_P_PC_ENABLE)
+
+
+// Reported by BDS
+#define DXE_CON_OUT_CONNECT (EFI_PERIPHERAL_LOCAL_CONSOLE | EFI_P_PC_INIT)
+#define DXE_CON_IN_CONNECT (EFI_PERIPHERAL_KEYBOARD | EFI_P_PC_INIT)
+#define DXE_NO_CON_OUT (EFI_PERIPHERAL_LOCAL_CONSOLE | EFI_P_EC_NOT_DETECTED)
+#define DXE_NO_CON_IN (EFI_PERIPHERAL_KEYBOARD | EFI_P_EC_NOT_DETECTED)
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2007, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
diff --git a/Include/AmiUSBProtocols.cif b/Include/AmiUSBProtocols.cif
new file mode 100644
index 0000000..608eef8
--- /dev/null
+++ b/Include/AmiUSBProtocols.cif
@@ -0,0 +1,15 @@
+<component>
+ name = "AmiUSBProtocols"
+ category = ModulePart
+ LocalRoot = "Include"
+ RefName = "AmiUSBProtocols"
+[files]
+"Protocol\AmiUsbController.h"
+"Protocol\UsbIo.h"
+"Protocol\UsbHC.h"
+"Protocol\UsbPolicy.h"
+"Protocol\Emul6064Trap.h"
+"Protocol\Emul6064KbdInput.h"
+"Protocol\Emul6064MsInput.h"
+"Protocol\AmiUsbCCID.h"
+<endComponent>
diff --git a/Include/AmiUsbLibInclude.cif b/Include/AmiUsbLibInclude.cif
new file mode 100644
index 0000000..a874aae
--- /dev/null
+++ b/Include/AmiUsbLibInclude.cif
@@ -0,0 +1,8 @@
+<component>
+ name = "AmiUsbLibInclude"
+ category = ModulePart
+ LocalRoot = "Include
+ RefName = "AmiUsbLibInclude"
+[files]
+"AmiUsbSmmGlobalDataValidationLib.h"
+<endComponent> \ No newline at end of file
diff --git a/Include/AmiUsbSmmGlobalDataValidationLib.h b/Include/AmiUsbSmmGlobalDataValidationLib.h
new file mode 100644
index 0000000..d1a0866
--- /dev/null
+++ b/Include/AmiUsbSmmGlobalDataValidationLib.h
@@ -0,0 +1,47 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2016, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+
+
+//<AMI_FHDR_START>
+//----------------------------------------------------------------------------
+//
+// Name: AmiUsbSmmGlobalDataValidationLib.h
+//
+// Description: Defines the AmiUsbSmmGlobalDataValidationLib library functions.
+//
+//----------------------------------------------------------------------------
+//<AMI_FHDR_END>
+
+
+#ifndef __AMI_USB_SMM_GLOBAL_DATA_VALIDATION_LIB__H
+#define __AMI_USB_SMM_GLOBAL_DATA_VALIDATION_LIB__H
+
+EFI_STATUS EFIAPI UpdateAmiUsbSmmGlobalDataCrc32(VOID*);
+EFI_STATUS EFIAPI AmiUsbSmmGlobalDataValidation(VOID*);
+EFI_STATUS EFIAPI InitAmiUsbSmmGlobalDataValidationLib(EFI_HANDLE, EFI_SYSTEM_TABLE*);
+
+#endif
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2016, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
diff --git a/Include/BaseCryptLib.h b/Include/BaseCryptLib.h
new file mode 100644
index 0000000..34bf640
--- /dev/null
+++ b/Include/BaseCryptLib.h
@@ -0,0 +1,417 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Pkwy, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+//**********************************************************************
+// $Header: /Alaska/BIN/Modules/CryptoPkg/Lib/Include/BaseCryptLib.h 1 6/13/11 5:19p Alexp $
+//
+// $Revision: 1 $
+//
+// $Date: 6/13/11 5:19p $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Modules/CryptoPkg/Lib/Include/BaseCryptLib.h $
+//
+// 1 6/13/11 5:19p Alexp
+//
+// 1 5/06/11 6:12p Alexp
+// initial module release
+//
+// 2 5/05/11 3:39p Alexp
+// add Help hdrs
+//
+//**********************************************************************
+
+//<AMI_FHDR_START>
+//----------------------------------------------------------------------------
+//
+// Name: BaseCryptLib.h
+//
+// Description: Defines base cryptographic library APIs compatible with EDK2 BaseCryptLib.
+// The Base Cryptographic Library provides implementations of basic cryptography
+// primitives (SHA-1, SHA-256, RSA, etc) for UEFI security functionality enabling.
+//
+//----------------------------------------------------------------------------
+//<AMI_FHDR_END>
+
+#ifndef __BASE_CRYPT_LIB_H__
+#define __BASE_CRYPT_LIB_H__
+
+#include <Efi.h>
+//=====================================================================================
+// One-Way Cryptographic Hash Primitives
+//=====================================================================================
+
+///
+/// SHA-1 digest size in bytes.
+///
+#define SHA1_DIGEST_SIZE 20
+///
+/// SHA-256 digest size in bytes
+///
+#define SHA256_DIGEST_SIZE 32
+
+//<AMI_PHDR_START>
+//----------------------------------------------------------------------------
+//
+// Procedure: Sha1GetContextSize
+//
+// Description: Retrieves the size, in bytes, of the context buffer required for SHA-1 hash operations.
+//
+// Input:none
+//
+// Output: The size, in bytes, of the context buffer required for SHA-1 hash operations.
+//
+//----------------------------------------------------------------------------
+//<AMI_PHDR_END>
+UINTN
+Sha1GetContextSize (
+ VOID
+ );
+
+
+//<AMI_PHDR_START>
+//----------------------------------------------------------------------------
+//
+// Procedure: Sha1Init
+//
+// Description: Initializes user-supplied memory pointed by Sha1Context as the SHA-1 hash context for
+// subsequent use. If Sha1Context is NULL, then ASSERT().
+//
+// Input:
+// param[in, out] Sha1Context Pointer to the SHA-1 Context being initialized.
+//
+// Output:
+// retval TRUE SHA-1 initialization succeeded.
+//
+//----------------------------------------------------------------------------
+//<AMI_PHDR_END>
+BOOLEAN
+Sha1Init (
+ IN OUT VOID *Sha1Context
+ );
+
+
+/**
+ Performs SHA-1 digest on a data buffer of the specified length. This function can
+ be called multiple times to compute the digest of long or discontinuous data streams.
+
+ If Sha1Context is NULL, then ASSERT().
+
+ @param[in, out] Sha1Context Pointer to the SHA-1 context.
+ @param[in] Data Pointer to the buffer containing the data to be hashed.
+ @param[in] DataLength Length of Data buffer in bytes.
+
+ @retval TRUE SHA-1 data digest succeeded.
+ @retval FALSE Invalid SHA-1 context. After Sha1Final function has been called, the
+ SHA-1 context cannot be reused.
+
+**/
+BOOLEAN
+Sha1Update (
+ IN OUT VOID *Sha1Context,
+ IN CONST VOID *Data,
+ IN UINTN DataLength
+ );
+
+
+//<AMI_PHDR_START>
+//----------------------------------------------------------------------------
+//
+// Procedure: Sha1Final
+//
+// Description: Completes SHA-1 hash computation and retrieves the digest value into the specified
+// memory. After this function has been called, the SHA-1 context cannot be used again.
+// If Sha1Context is NULL, then ASSERT().
+// If HashValue is NULL, then ASSERT().
+//
+// Input:
+// param[in, out] Sha1Context Pointer to the SHA-1 context
+// param[out] HashValue Pointer to a buffer that receives the SHA-1 digest
+// value (20 bytes).
+// Output: TRUE SHA-1 digest computation succeeded.
+//
+//----------------------------------------------------------------------------
+//<AMI_PHDR_END>
+BOOLEAN
+Sha1Final (
+ IN OUT VOID *Sha1Context,
+ OUT UINT8 *HashValue
+ );
+
+
+//<AMI_PHDR_START>
+//----------------------------------------------------------------------------
+//
+// Procedure: Sha256GetContextSize
+//
+// Description: Retrieves the size, in bytes, of the context buffer required for SHA256 hash operations.
+//
+// Input:none
+// Output: The size, in bytes, of the context buffer required for SHA256 hash operations.
+//
+//----------------------------------------------------------------------------
+//<AMI_PHDR_END>
+UINTN
+Sha256GetContextSize (
+ VOID
+ );
+
+
+//<AMI_PHDR_START>
+//----------------------------------------------------------------------------
+//
+// Procedure: Sha256Init
+//
+// Description: Initializes user-supplied memory pointed by Sha256Context as SHA-256 hash context for
+// subsequent use. If Sha256Context is NULL, then ASSERT().
+//
+// Input:
+// param[in, out] Sha256Context Pointer to the SHA-1 Context being initialized.
+//
+// Output:
+// retval TRUE SHA-256 context initialization succeeded.
+//
+//----------------------------------------------------------------------------
+//<AMI_PHDR_END>
+BOOLEAN
+Sha256Init (
+ IN OUT VOID *Sha256Context
+ );
+
+
+/**
+ Performs SHA-256 digest on a data buffer of the specified length. This function can
+ be called multiple times to compute the digest of long or discontinuous data streams.
+
+ If Sha256Context is NULL, then ASSERT().
+
+ @param[in, out] Sha256Context Pointer to the SHA-256 context.
+ @param[in] Data Pointer to the buffer containing the data to be hashed.
+ @param[in] DataLength Length of Data buffer in bytes.
+
+ @retval TRUE SHA-256 data digest succeeded.
+ @retval FALSE Invalid SHA-256 context. After Sha256Final function has been called, the
+ SHA-256 context cannot be reused.
+
+**/
+BOOLEAN
+Sha256Update (
+ IN OUT VOID *Sha256Context,
+ IN CONST VOID *Data,
+ IN UINTN DataLength
+ );
+
+
+//<AMI_PHDR_START>
+//----------------------------------------------------------------------------
+//
+// Procedure: Sha256Final
+//
+// Description: Completes SHA-256 hash computation and retrieves the digest value into the specified
+// memory. After this function has been called, the SHA-256 context cannot be used again.
+// If Sha256Context is NULL, then ASSERT().
+// If HashValue is NULL, then ASSERT().
+//
+// Input:
+// param[in, out] Sha256Context Pointer to SHA-256 context
+// param[out] HashValue Pointer to a buffer that receives the SHA-256 digest
+// value (32 bytes).
+// Output: TRUE SHA-256 digest computation succeeded.
+//
+//----------------------------------------------------------------------------
+//<AMI_PHDR_END>
+BOOLEAN
+Sha256Final (
+ IN OUT VOID *Sha256Context,
+ OUT UINT8 *HashValue
+ );
+
+
+//=====================================================================================
+// MAC (Message Authentication Code) Primitive
+//=====================================================================================
+
+///
+/// No MAC supports for minimum scope required by UEFI
+///
+
+
+//=====================================================================================
+// Symmetric Cryptography Primitive
+//=====================================================================================
+
+///
+/// No symmetric cryptographic supports for minimum scope required by UEFI
+///
+
+
+//=====================================================================================
+// Asymmetric Cryptography Primitive
+//=====================================================================================
+#define DEFAULT_RSA_KEY_MODULUS_LEN 256 // 2048 bits
+#define DEFAULT_RSA_SIG_LEN DEFAULT_RSA_KEY_MODULUS_LEN // This is true as long as > data
+
+//<AMI_PHDR_START>
+//----------------------------------------------------------------------------
+//
+// Procedure: RsaNew
+//
+// Description: Allocates and Initializes one RSA Context for subsequent use.
+//
+// Input:
+//
+// Output: Pointer to the RSA Context that has been initialized.
+// If the allocations fails, RsaNew() returns NULL.
+//
+//----------------------------------------------------------------------------
+//<AMI_PHDR_END>
+VOID *
+RsaNew (
+ VOID
+ );
+
+//<AMI_PHDR_START>
+//----------------------------------------------------------------------------
+//
+// Procedure: RsaFree
+//
+// Description: Release the specified RSA Context.
+//
+// Input:
+// param[in] RsaContext Pointer to the RSA context to be released.
+//
+// Output:
+//
+//----------------------------------------------------------------------------
+//<AMI_PHDR_END>
+VOID
+EFIAPI
+RsaFree (
+ IN VOID *RsaContext
+ );
+
+
+///
+/// RSA Key Tags Definition used in RsaSetKey() function for key component identification.
+///
+typedef enum _RSA_KEY_TAG {
+ RsaKeyN, ///< RSA public Modulus (N)
+ RsaKeyE, ///< RSA Public exponent (e)
+ RsaKeyD, ///< RSA Private exponent (d)
+ RsaKeyP, ///< RSA secret prime factor of Modulus (p)
+ RsaKeyQ, ///< RSA secret prime factor of Modules (q)
+ RsaKeyDp, ///< p's CRT exponent (== d mod (p - 1))
+ RsaKeyDq, ///< q's CRT exponent (== d mod (q - 1))
+ RsaKeyQInv ///< The CRT coefficient (== 1/q mod p)
+} RSA_KEY_TAG;
+
+//<AMI_PHDR_START>
+//----------------------------------------------------------------------------
+//
+// Procedure: RsaSetKey
+//
+// Description: Sets the tag-designated RSA key component into the established RSA context from
+// the user-specified nonnegative integer (octet string format represented in RSA
+// PKCS#1). If RsaContext is NULL, then ASSERT().
+//
+// Input:
+// @param[in, out] RsaContext Pointer to RSA context being set.
+// @param[in] KeyTag Tag of RSA key component being set.
+// @param[in] BigNumber Pointer to octet integer buffer.
+// @param[in] BnLength Length of big number buffer in bytes.
+//
+// Output:
+// @return TRUE RSA key component was set successfully.
+// @return FALSE Invalid RSA key component tag.
+//
+//----------------------------------------------------------------------------
+//<AMI_PHDR_END>
+BOOLEAN
+RsaSetKey (
+ IN OUT VOID *RsaContext,
+ IN RSA_KEY_TAG KeyTag,
+ IN CONST UINT8 *BigNumber,
+ IN UINTN BnLength
+ );
+
+//<AMI_PHDR_START>
+//----------------------------------------------------------------------------
+//
+// Procedure: RsaPkcs1Verify
+//
+// Description: Verifies the RSA-SSA signature with EMSA-PKCS1-v1_5 encoding scheme defined in
+// RSA PKCS#1.
+// If RsaContext is NULL, then ASSERT().
+// If MessageHash is NULL, then ASSERT().
+// If Signature is NULL, then ASSERT().
+// If HashLength is not equal to the size of SHA-1 or SHA-256 digest, then ASSERT().
+//
+// Input:
+// @param[in] RsaContext Pointer to RSA context for signature verification.
+// @param[in] MessageHash Pointer to octet message hash to be checked.
+// @param[in] HashLength Length of the message hash in bytes.
+// @param[in] Signature Pointer to RSA PKCS1-v1_5 signature to be verified.
+// @param[in] SigLength Length of signature in bytes.
+//
+// Output:
+// @return TRUE Valid signature encoded in PKCS1-v1_5.
+// @return FALSE Invalid signature or invalid RSA context.
+//
+//----------------------------------------------------------------------------
+//<AMI_PHDR_END>
+BOOLEAN
+RsaPkcs1Verify (
+ IN VOID *RsaContext,
+ IN CONST UINT8 *MessageHash,
+ IN UINTN HashLength,
+ IN UINT8 *Signature,
+ IN UINTN SigLength
+ );
+
+//<AMI_PHDR_START>
+//----------------------------------------------------------------------------
+//
+// Procedure: Pkcs7Verify
+//
+// Description: Verifies the validility of a PKCS#7 signed data as described in
+// "PKCS #7: Cryptographic Message Syntax Standard".
+// If P7Data is NULL, then ASSERT().
+//
+// Input:
+// @param[in] P7Data Pointer to the PKCS#7 message to verify.
+// @param[in] P7Length Length of the PKCS#7 message in bytes.
+// @param[in] TrustedCert Pointer to a trusted/root certificate encoded in DER, which
+// is used for certificate chain verification.
+// @param[in] CertLength Length of the trusted certificate in bytes.
+// @param[in] InData Pointer to the content to be verified.
+// @param[in] DataLength Length of InData in bytes.
+//
+// Output:
+// @return TRUE The specified PKCS#7 signed data is valid.
+// @return FALSE Invalid PKCS#7 signed data.
+//
+//----------------------------------------------------------------------------
+//<AMI_PHDR_END>
+BOOLEAN
+Pkcs7Verify (
+ IN CONST UINT8 *P7Data,
+ IN UINTN P7Length,
+ IN CONST UINT8 *TrustedCert,
+ IN UINTN CertLength,
+ IN CONST UINT8 *InData,
+ IN UINTN DataLength
+ );
+
+
+#endif // __BASE_CRYPT_LIB_H__
diff --git a/Include/BootOptions.h b/Include/BootOptions.h
new file mode 100644
index 0000000..0dd0dfc
--- /dev/null
+++ b/Include/BootOptions.h
@@ -0,0 +1,356 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2012, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/Projects/Intel/Haswell/LynxPoint_SharkBay-DT_Crb_1AQQW/Include/BootOptions.h 2 10/30/13 6:49a Ireneyang $
+//
+// $Revision: 2 $
+//
+// $Date: 10/30/13 6:49a $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/Projects/Intel/Haswell/LynxPoint_SharkBay-DT_Crb_1AQQW/Include/BootOptions.h $
+//
+// 2 10/30/13 6:49a Ireneyang
+// - Fix Setup menu erroneously shows multiple instances of
+// the same bootable device for EIP139412
+//
+// 6 5/20/13 4:35p Artems
+// [TAG] EIP N/A
+// [Category] Improvement
+// [Description] Implement ORPHAN_BOOT_POLICY_KEEP for legacy groups
+// [Files] BootOptions.h BootOptions.c BdsBoard.c
+//
+// 5 7/19/12 4:10p Felixp
+// Enhancement:
+// AMI_BOOT_OPTION_SIGNATURE macro is updated to start with a couple of
+// zeroes.
+// Some EFI applications (for example UEFI Shell) treats optional data
+// as a command line string.
+// These applications will treat a signature constructed by the
+// AMI_BOOT_OPTION_SIGNATURE macro
+// as an empty Unicode string.
+//
+// 4 5/23/12 4:08p Artems
+// [TAG] EIP N/A
+// [Category] Improvement
+// [Description] Added AMI-style header and footer
+// [Files] bootoptions.h
+//
+//
+//**********************************************************************
+//<AMI_FHDR_START>
+//
+// Name: <BootOptions.h>
+//
+// Description: Boot options infrastructure definitions
+//
+//<AMI_FHDR_END>
+//**********************************************************************
+
+#ifndef __BOOT_OPTIONS_H__
+#define __BOOT_OPTIONS_H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <Token.h>
+#include <AmiDxeLib.h>
+#include <Pci.h>
+#include <Protocol/SimpleFileSystem.h>
+#include <Protocol/LoadFile.h>
+#include <Protocol/BlockIo.h>
+#include <Protocol/FirmwareVolume2.h>
+#include <Protocol/DevicePath.h>
+#ifdef CSM_SUPPORT
+#include <Protocol/LegacyBios.h>
+#endif
+
+#ifndef CSM_SUPPORT
+typedef VOID BBS_TABLE;
+#endif
+
+typedef struct{
+ DLINK Link;
+ UINT32 Attributes;
+ CHAR16 *Description;
+ EFI_DEVICE_PATH_PROTOCOL *FilePathList;
+ UINTN FilePathListLength;
+ UINT8 *OptionalData;
+ UINTN OptionalDataSize;
+ UINT16 BootOptionNumber;
+ UINT32 Priority;
+ UINT32 Tag; // Just a number. Devices with the same number have something in common;
+ // Can be used as a sort key.
+ EFI_HANDLE DeviceHandle;
+ UINT16 BbsIndex;
+ BBS_TABLE *BbsEntry;
+ BOOLEAN FwBootOption;
+ BOOLEAN GroupHeader;
+} BOOT_OPTION;
+
+
+typedef struct{
+ DLINK Link;
+ EFI_HANDLE DeviceHandle;
+ UINT16 BbsIndex;
+ BBS_TABLE *BbsEntry;
+} BOOT_DEVICE;
+
+typedef BOOLEAN (DEVICE_PATH_TO_DEVICE_MATCH_TEST)(
+ EFI_DEVICE_PATH_PROTOCOL *OptionDevicePath, BOOT_DEVICE *Device
+);
+
+typedef BOOLEAN (BOOT_OPTION_TO_DEVICE_MATCH_TEST)(
+ BOOT_OPTION *Option, BOOT_DEVICE *Device
+);
+
+typedef BOOLEAN (FILTER_BOOT_DEVICE_TEST)(BOOT_DEVICE *Device);
+
+typedef UINTN (CONSTRUCT_BOOT_OPTION_NAME)(
+ BOOT_OPTION *Option, CHAR16 *Name, UINTN NameSize
+);
+
+typedef UINT16 (GET_BBS_ENTRY_DEVICE_TYPE)(BBS_TABLE *BbsEntry);
+
+typedef BOOLEAN (BUILD_BOOT_OPTION_FILE_PATH_LIST)(BOOT_OPTION *Option);
+
+#pragma pack(push,1)
+typedef struct{
+ UINT32 Signature;
+ UINT32 Size;
+ EFI_LOAD_OPTION Option;
+} NESTED_BOOT_OPTION;
+
+typedef struct{
+// Guid = AMI_BBS_DEVICE_PATH_GUID
+ VENDOR_DEVICE_PATH Header;
+ UINT8 Bus;
+ UINT8 Device;
+ UINT8 Function;
+ UINT8 Class;
+ UINT8 SubClass;
+ UINT8 Instance;
+}AMI_BBS_DEVICE_PATH;
+
+typedef struct{
+// Guid = AMI_DEVICE_NAME_DEVICE_PATH_GUID
+ VENDOR_DEVICE_PATH Header;
+// UINT8 DeviceName[n]
+// n = <node length from the header> - sizeof(AMI_DEVICE_NAME_DEVICE_PATH)
+}AMI_DEVICE_NAME_DEVICE_PATH;
+#pragma pack(pop)
+
+typedef INT32 ( *COMPARE_FUNCTION ) (DLINK *p, DLINK *q);
+
+typedef VOID (BDS_CONTROL_FLOW_FUNCTION)();
+
+#define INVALID_HANDLE NULL
+#define INVALID_BBS_INDEX 0xFFFF
+#define INVALID_BOOT_OPTION_NUMBER 0xFFFF
+#define LOWEST_BOOT_OPTION_PRIORITY 0xFFFFFFFF
+#define UNASSIGNED_LOWEST_TAG 0
+#define UNASSIGNED_HIGHEST_TAG 0xFFFFFFFF
+#define INVALID_STR_TOKEN 0xFFFF
+// The upper two bytes of the signature must be zeroes.
+// Some EFI applications (for example UEFI Shell) treats optional data
+// as a command line string.
+// These applications will treat this signature as an empty Unicode string.
+#define AMI_BOOT_OPTION_SIGNATURE(Letter) (('O'<<24)+((Letter)<<16))
+
+#define GetBaseTag(Tag) ((Tag)&0xFFFF)
+#define BootOptionTag(BaseTag,Priority) ((BaseTag)|((Priority)<<16))
+
+#define AMI_SIMPLE_BOOT_OPTION_SIGNATURE AMI_BOOT_OPTION_SIGNATURE('B')//'AMBO'
+#define AMI_GROUP_BOOT_OPTION_SIGNATURE AMI_BOOT_OPTION_SIGNATURE('G')//'AMGO'
+#define AMI_NESTED_BOOT_OPTION_SIGNATURE AMI_BOOT_OPTION_SIGNATURE('N')//'AMNO'
+#define AMI_NESTED_BOOT_OPTION_HEADER_SIZE EFI_FIELD_OFFSET(NESTED_BOOT_OPTION,Option)
+
+#define STARTING_BOOT_OPTION_PRIORITY 0x100
+#define DEFAULT_PRIORITY_INCREMENT 0x100
+#define GetNextBootOptionPriority(CurrentPriority) ((CurrentPriority)+DEFAULT_PRIORITY_INCREMENT)
+#define IndexToBootPriority(Index) (STARTING_BOOT_OPTION_PRIORITY+(Index)*DEFAULT_PRIORITY_INCREMENT)
+
+#define IsLegacyBootOption(Option) (\
+ ((Option)->FilePathList==NULL) ? (Option)->BbsEntry!=NULL : (Option)->FilePathList->Type==BBS_DEVICE_PATH\
+)
+#define IsBootOptionWithDevice(Option) ((Option)->BbsEntry!=NULL || (Option)->DeviceHandle!=INVALID_HANDLE)
+
+#define BOOT_VARIABLE_ATTRIBUTES \
+ (EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS)
+
+#define AMI_BBS_DEVICE_PATH_GUID \
+ { 0x1db184ae, 0x81f5, 0x4e72, { 0x85, 0x44, 0x2b, 0xab, 0xc, 0x2c, 0xac, 0x5c } }
+
+#define AMI_MASKED_DEVICE_PATH_GUID \
+ { 0x99e275e7, 0x75a0, 0x4b37, { 0xa2, 0xe6, 0xc5, 0x38, 0x5e, 0x6c, 0x0, 0xcb } }
+
+#define AMI_DEVICE_NAME_DEVICE_PATH_GUID \
+ { 0x2d6447ef, 0x3bc9, 0x41a0, { 0xac, 0x19, 0x4d, 0x51, 0xd0, 0x1b, 0x4c, 0xe6 } }
+
+#define SHELL_GUID \
+ {0Xc57ad6b7,0X0515,0X40a8,{0X9d,0X21,0X55,0X16,0X52,0X85,0X4e,0X37}}
+
+#define AMI_MEDIA_DEVICE_PATH_GUID \
+ { 0x5023b95c, 0xdb26, 0x429b, { 0xa6, 0x48, 0xbd, 0x47, 0x66, 0x4c, 0x80, 0x12 } }
+
+#define FOR_EACH_LIST_ELEMENT(FirstLinkPtr,LinkPtr,ElementPtr,ELEMENT_TYPE)\
+ for( LinkPtr=(FirstLinkPtr)\
+ ; LinkPtr!=NULL\
+ && (ElementPtr=OUTTER(LinkPtr,Link,ELEMENT_TYPE),LinkPtr=LinkPtr->pNext,TRUE)\
+ ;\
+ )
+
+#define FOR_EACH_BOOT_OPTION(List,Link,Element)\
+ FOR_EACH_LIST_ELEMENT((List)->pHead,Link,Element,BOOT_OPTION)
+#define FOR_EACH_BOOT_DEVICE(List,Link,Element)\
+ FOR_EACH_LIST_ELEMENT((List)->pHead,Link,Element,BOOT_DEVICE)
+
+#define NUMBER_OF_BBS_DEVICE_TYPES 8
+#define BBS_DEVICE_TYPE_TO_INDEX(DeviceType)\
+ ( (DeviceType)<=BBS_EMBED_NETWORK && (DeviceType)!=0\
+ ? (DeviceType)-1\
+ : (DeviceType)==BBS_BEV_DEVICE\
+ ? NUMBER_OF_BBS_DEVICE_TYPES-2\
+ : NUMBER_OF_BBS_DEVICE_TYPES-1\
+ )
+#ifdef EFI_DEBUG
+#define DUMP_BOOT_OPTION_LIST(List,Caption) DumpBootOptionList(List,Caption)
+#else
+#define DUMP_BOOT_OPTION_LIST(List,Caption)
+#endif
+
+#define ORPHAN_BOOT_OPTIONS_POLICY_KEEP 0
+#define ORPHAN_BOOT_OPTIONS_POLICY_DELETE 1
+#define ORPHAN_BOOT_OPTIONS_POLICY_DISABLE 2
+#define ORPHAN_BOOT_OPTIONS_POLICY_HIDE 3
+
+extern EFI_GUID EfiVariableGuid;
+extern EFI_GUID AmiBbsDevicePathGuid;
+extern EFI_GUID AmiMaskedDevicePathGuid;
+extern DEVICE_PATH_TO_DEVICE_MATCH_TEST *DpMatchingFunction[];
+extern BOOT_OPTION_TO_DEVICE_MATCH_TEST *MatchingFunction[];
+extern FILTER_BOOT_DEVICE_TEST *FilteringFunction[];
+extern CONSTRUCT_BOOT_OPTION_NAME *BuildNameFunctions[];
+extern BUILD_BOOT_OPTION_FILE_PATH_LIST *BuildFilePathFunctions[];
+extern EFI_HII_HANDLE HiiHandle;
+extern const STRING_REF UnknownDeviceToken;
+extern CONSTRUCT_BOOT_OPTION_NAME *ConstructBootOptionNamePrefix;
+extern CONSTRUCT_BOOT_OPTION_NAME *ConstructBootOptionNameSuffix;
+extern GET_BBS_ENTRY_DEVICE_TYPE *GetBbsEntryDeviceType;
+extern BOOLEAN NormalizeBootOptionName;
+extern BOOLEAN NormalizeBootOptionDevicePath;
+extern DLIST *BootOptionList;
+extern DLIST *BootDeviceList;
+
+#ifdef CSM_SUPPORT
+#define LEGACY_DEV_ORDER_GUID \
+ { 0xA56074DB, 0x65FE, 0x45F7, 0xBD, 0x21, 0x2D, 0x2B, 0xDD, 0x8E, 0x96, 0x52 }
+
+typedef struct{
+ UINT32 Type;
+ UINT16 Length;
+ UINT16 Device[1];
+} LEGACY_DEVICE_ORDER;
+
+extern EFI_GUID LegacyDevOrderGuid;
+#endif
+
+//defined in BootOptions.c
+VOID SortList(DLIST *List, COMPARE_FUNCTION Compare);
+INT32 CompareTagThenPriority(DLINK *Link1, DLINK *Link2);
+INT32 ComparePriorityThenBootOptionNumber(DLINK *Link1, DLINK *Link2);
+
+BOOT_OPTION* CreateBootOption(DLIST *BootOptionList);
+VOID DeleteBootOption(DLIST *BootOptionList, BOOT_OPTION *Option);
+BOOT_DEVICE* CreateBootDevice(
+ DLIST *BootDeviceList, EFI_HANDLE DeviceHandle,
+ UINT16 BbsIndex, BBS_TABLE *BbsEntry
+);
+VOID DeleteBootDevice(DLIST *BootDeviceList, BOOT_DEVICE* Device);
+VOID UpdateBootOptionWithBootDeviceInfo(
+ BOOT_OPTION *Option, BOOT_DEVICE* Device
+);
+
+BOOLEAN IsUefiHddBootDevice(BOOT_DEVICE *Device);
+BOOLEAN IsGroupOrphan(BOOT_OPTION *Option);
+
+BOOLEAN LocateDevicePathTest(
+ EFI_DEVICE_PATH_PROTOCOL *OptionDevicePath, BOOT_DEVICE *Device
+);
+BOOLEAN PartitionDevicePathTest(
+ EFI_DEVICE_PATH_PROTOCOL *OptionDevicePath, BOOT_DEVICE *Device
+);
+#ifdef CSM_SUPPORT
+BOOLEAN BbsDevicePathTest(
+ EFI_DEVICE_PATH_PROTOCOL *OptionDevicePath, BOOT_DEVICE *Device
+);
+BOOLEAN AmiBbsDevicePathTest(
+ EFI_DEVICE_PATH_PROTOCOL *OptionDevicePath, BOOT_DEVICE *Device
+);
+#endif
+
+UINTN ConstructBootOptionNameByHandle(
+ BOOT_OPTION *Option, CHAR16 *Name, UINTN NameSize
+);
+#ifdef CSM_SUPPORT
+UINTN ConstructBootOptionNameByBbsDescription(
+ BOOT_OPTION *Option, CHAR16 *Name, UINTN NameSize
+);
+VOID BuildLegacyDevOrderBuffer(
+ LEGACY_DEVICE_ORDER **DevOrderBuffer, UINTN *BufferSize
+);
+#endif
+UINTN ConstructBootOptionNameByHandleDevicePath(
+ BOOT_OPTION *Option, CHAR16 *Name, UINTN NameSize
+);
+UINTN ConstructBootOptionNameByFilePathList(
+ BOOT_OPTION *Option, CHAR16 *Name, UINTN NameSize
+);
+UINTN ConstructBootOptionName(BOOT_OPTION *Option);
+
+BOOLEAN BuildLegacyFilePath(BOOT_OPTION *Option);
+BOOLEAN BuildEfiFilePath(BOOT_OPTION *Option);
+BOOLEAN BuildBootOptionFilePath(BOOT_OPTION *Option);
+
+VOID DumpBootOptionList(DLIST *BootOptionList, CHAR8 *ListCaption);
+VOID MaskFilePathList(BOOT_OPTION *Option);
+
+//defined in BdsBoard.c
+UINT16 GetLegacyDevOrderType(BOOT_OPTION *Option);
+STRING_REF DevicePathNodeToStrRef(EFI_DEVICE_PATH_PROTOCOL *Dp);
+VOID ApplyOrphanBootOptionPolicy(
+ DLIST *BootOptionList, BOOT_OPTION *Option, const int Policy
+);
+
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2012, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//********************************************************************** \ No newline at end of file
diff --git a/Include/BootScriptCommon.h b/Include/BootScriptCommon.h
new file mode 100644
index 0000000..11f8cd9
--- /dev/null
+++ b/Include/BootScriptCommon.h
@@ -0,0 +1,206 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/BIN/Core/Include/BootScriptCommon.h 5 6/24/11 1:47p Felixp $
+//
+// $Revision: 5 $
+//
+// $Date: 6/24/11 1:47p $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Core/Include/BootScriptCommon.h $
+//
+// 5 6/24/11 1:47p Felixp
+// Improved compatibility with the Framework drivers in PI mode.
+//
+// 4 6/16/11 10:01a Felixp
+// Enhancements:
+// 1. SAVE_STATE_... macros are removed (used BOOT_SCRIPT_S3_... from
+// AmiDxeLib.h instead)
+// 2. OEM OpCodes moved into the Framework section of the header (no OEM
+// OpCodes in PEI)
+//
+// 3 5/13/11 3:28p Oleksiyy
+// [TAG] EIP56650
+// [Category] New Feature
+// [Description] S3 Save State Protocol and S3 Smm Save State Protocol
+// functions added. Support for opcodes introduced in PI 1.2 added.
+// [Files] BootScriptCommon.h, BootScriptExecuter.c,
+// BootScriptPrivate.h, BootScriptSave.c and BootScriptSave.h
+//
+// 2 3/11/11 7:02p Artems
+//
+// 1 3/09/11 5:33p Artems
+//
+// 1 2/03/11 4:45p Oleksiyy
+//
+// 1 2/03/11 4:09p Oleksiyy
+// [TAG] EIP53402
+// [Category] Improvement
+// [Description] Create new label of ACPI with separate S3 Functionality
+// [Files] S3Common.cif
+// ..\..\..\Include\BootScriptCommon.h
+//
+// 8 7/17/07 10:44a Markw
+// Updated typecasts in macro where UINTN is needed.
+//
+// 7 2/12/07 11:20a Felixp
+// Clean up
+//
+// 6 2/12/07 11:18a Felixp
+// Revision field removed from EFI_BOOT_SCRIPT_SAVE_PROTOCOL structure
+// to match BootScript spec (it was earlier their for Tiano compliance.
+// Tiano header is fixed now).
+//
+// 5 12/26/06 2:57p Markw
+// Add BootScript Polling.
+//
+// 4 3/13/06 1:40a Felixp
+//
+// 3 11/07/05 3:42p Sivagarn
+// Removed SMBus related definitions. The Smbus definitions are moved to
+// appropriate SMBUS.H file.
+//
+// 2 4/04/05 4:37p Markw
+// Modified existing and added new macros.
+//
+// 1 1/28/05 12:44p Felixp
+//
+// 1 12/23/04 9:41a Felixp
+//
+// 5 4/22/04 2:32p Felixp
+//
+// 4 3/09/04 9:37a Markw
+// Fixed Io RW Macro.
+//
+// 3 3/08/04 5:25p Markw
+// Fixed the BootScriptSave macros.
+//
+// 2 3/02/04 4:44p Markw
+// Added Boot Script Macros
+//
+// 1 2/26/04 2:36p Markw
+//
+//**********************************************************************
+
+
+//<AMI_FHDR_START>
+//---------------------------------------------------------------------------
+// Name: BootScriptCommon.h
+//
+// Description: Boot Script Common definitions header.
+//
+//---------------------------------------------------------------------------
+//<AMI_FHDR_END>
+
+#ifndef __BOOT_SCRIPT_COMMON__H__
+#define __BOOT_SCRIPT_COMMON__H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+//*******************************************
+// EFI Save State Script Opcode definitions (Common)
+//*******************************************
+#define EFI_BOOT_SCRIPT_IO_WRITE_OPCODE 0x00
+#define EFI_BOOT_SCRIPT_IO_READ_WRITE_OPCODE 0x01
+#define EFI_BOOT_SCRIPT_MEM_WRITE_OPCODE 0x02
+#define EFI_BOOT_SCRIPT_MEM_READ_WRITE_OPCODE 0x03
+#define EFI_BOOT_SCRIPT_PCI_CONFIG_WRITE_OPCODE 0x04
+#define EFI_BOOT_SCRIPT_PCI_CONFIG_READ_WRITE_OPCODE 0x05
+#define EFI_BOOT_SCRIPT_SMBUS_EXECUTE_OPCODE 0x06
+#define EFI_BOOT_SCRIPT_STALL_OPCODE 0x07
+#define EFI_BOOT_SCRIPT_DISPATCH_OPCODE 0x08
+
+#if PI_SPECIFICATION_VERSION>=0x0001000A
+//*******************************************
+// EFI Save State Script Opcode definitions (PI)
+//*******************************************
+#define EFI_BOOT_SCRIPT_DISPATCH_2_OPCODE 0x09
+#define EFI_BOOT_SCRIPT_INFORMATION_OPCODE 0x0A
+#define EFI_BOOT_SCRIPT_PCI_CONFIG2_WRITE_OPCODE 0x0B
+#define EFI_BOOT_SCRIPT_PCI_CONFIG2_READ_WRITE_OPCODE 0x0C
+#define EFI_BOOT_SCRIPT_IO_POLL_OPCODE 0x0D
+#define EFI_BOOT_SCRIPT_MEM_POLL_OPCODE 0x0E
+#define EFI_BOOT_SCRIPT_PCI_CONFIG_POLL_OPCODE 0x0F
+#define EFI_BOOT_SCRIPT_PCI_CONFIG2_POLL_OPCODE 0x10
+#define EFI_BOOT_SCRIPT_LABEL_OPCODE_OEM 0x83
+#endif
+
+#if BACKWARD_COMPATIBLE_MODE || PI_SPECIFICATION_VERSION < 0x0001000A
+//*******************************************
+// EFI Boot Script Opcode definitions (Framework)
+//*******************************************
+
+// Extensions to boot script definitions
+//OEM
+#ifndef EFI_BOOT_SCRIPT_IO_POLL_OPCODE_OEM
+#define EFI_BOOT_SCRIPT_IO_POLL_OPCODE_OEM 0x80
+#endif
+
+#ifndef EFI_BOOT_SCRIPT_MEM_POLL_OPCODE_OEM
+#define EFI_BOOT_SCRIPT_MEM_POLL_OPCODE_OEM 0x81
+#endif
+
+#ifndef EFI_BOOT_SCRIPT_PCI_POLL_OPCODE_OEM
+#define EFI_BOOT_SCRIPT_PCI_POLL_OPCODE_OEM 0x82
+#endif
+
+#endif
+
+#define EFI_BOOT_SCRIPT_TABLE_OPCODE 0xAA
+#define EFI_BOOT_SCRIPT_TERMINATE_OPCODE 0xFF
+
+//*******************************************
+// EFI_BOOT_SCRIPT_WIDTH
+//*******************************************
+typedef enum {
+ EfiBootScriptWidthUint8,
+ EfiBootScriptWidthUint16,
+ EfiBootScriptWidthUint32,
+ EfiBootScriptWidthUint64,
+ EfiBootScriptWidthFifoUint8,
+ EfiBootScriptWidthFifoUint16,
+ EfiBootScriptWidthFifoUint32,
+ EfiBootScriptWidthFifoUint64,
+ EfiBootScriptWidthFillUint8,
+ EfiBootScriptWidthFillUint16,
+ EfiBootScriptWidthFillUint32,
+ EfiBootScriptWidthFillUint64,
+ EfiBootScriptWidthMaximum
+} EFI_BOOT_SCRIPT_WIDTH;
+
+//////////////////////////////////////////////////////////////////////////////////
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
diff --git a/Include/CPU Hobs.cif b/Include/CPU Hobs.cif
new file mode 100644
index 0000000..36bd838
--- /dev/null
+++ b/Include/CPU Hobs.cif
@@ -0,0 +1,8 @@
+<component>
+ name = "CPU Hobs"
+ category = ModulePart
+ LocalRoot = "Include\"
+ RefName = "CPU Hobs"
+[files]
+"CpuHobs.h"
+<endComponent>
diff --git a/Include/CSPLibInc.CIF b/Include/CSPLibInc.CIF
new file mode 100644
index 0000000..7a40c2f
--- /dev/null
+++ b/Include/CSPLibInc.CIF
@@ -0,0 +1,9 @@
+<component>
+ name = "CSP Library Include"
+ category = ModulePart
+ LocalRoot = "Include\"
+ RefName = "CSP Library Include"
+[files]
+"\AMICSPLib.h"
+[parts]
+<endComponent>
diff --git a/Include/CacheSubClass.h b/Include/CacheSubClass.h
new file mode 100644
index 0000000..cfa5475
--- /dev/null
+++ b/Include/CacheSubClass.h
@@ -0,0 +1,192 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2005, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/BIN/Core/Include/CacheSubClass.h 2 6/29/10 2:05a Felixp $
+//
+// $Revision: 2 $
+//
+// $Date: 6/29/10 2:05a $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Core/Include/CacheSubClass.h $
+//
+// 2 6/29/10 2:05a Felixp
+// EFI_CACHE_ASSOCIATIVITY_DATA enum is extended with 32, 48, and 64 way
+// values.
+//
+// 1 10/10/05 4:45p Markw
+//
+// 1 10/10/05 4:25p Markw
+//
+//**********************************************************************
+//<AMI_FHDR_START>
+//
+// Name: CacheSubClass.h
+//
+// Description: CacheSubClass definitions.
+//
+//<AMI_FHDR_END>
+//**********************************************************************
+
+#ifndef __CACHE_SUBCLASS_H__
+#define __CACHE_SUBCLASS_H__
+
+#include <efi.h>
+#include <DataHubSubClass.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define EFI_CACHE_SUBCLASS_GUID \
+ {0x7f0013a7,0xdc79,0x4b22,0x80,0x99,0x11,0xf7,0x5f,0xdc,0x82,0x9d}
+#define EFI_CACHE_CLASS EFI_DATA_CLASS_DATA
+#define EFI_CACHE_SUBCLASS_VERSION 0x00010000
+
+//Size
+#define EFI_CACHE_SIZE_RECORD_NUMBER 0x00000001
+typedef EFI_EXP_BASE2_DATA EFI_CACHE_SIZE_DATA;
+
+//Maximum Size
+#define EFI_MAXIMUM_CACHE_SIZE_RECORD_NUMBER 0x00000002
+typedef EFI_EXP_BASE2_DATA EFI_MAXIMUM_CACHE_SIZE_DATA;
+
+//Speed
+#define EFI_CACHE_SPEED_RECORD_NUMBER 0x00000003
+typedef EFI_EXP_BASE10_DATA EFI_CACHE_SPEED_DATA;
+
+//Socket
+#define EFI_CACHE_SOCKET_RECORD_NUMBER 0x00000004
+typedef STRING_REF EFI_CACHE_SOCKET_DATA;
+
+//SRAM Type Supported
+#define EFI_CACHE_SRAM_SUPPORT_RECORD_NUMBER 0x00000005
+typedef struct {
+ UINT16 Other :1;
+ UINT16 Unknown :1;
+ UINT16 NonBurst :1;
+ UINT16 Burst :1;
+ UINT16 PipelineBurst:1;
+ UINT16 Asynchronous :1;
+ UINT16 Synchronous :1;
+ UINT16 Reserved :9;
+} EFI_CACHE_SRAM_TYPE_DATA;
+
+//SRAM Type Installed
+#define EFI_CACHE_SRAM_INSTALL_RECORD_NUMBER 0x00000006
+typedef EFI_CACHE_SRAM_TYPE_DATA EFI_CACHE_SRAM_INSTALL_DATA;
+
+//Error Correction Type Supported
+#define EFI_CACHE_ERROR_SUPPORT_RECORD_NUMBER 0x00000007
+typedef enum {
+ EfiCacheErrorOther = 1,
+ EfiCacheErrorUnknown = 2,
+ EfiCacheErrorNone = 3,
+ EfiCacheErrorParity = 4,
+ EfiCacheErrorSingleBit = 5,
+ EfiCacheErrorMultiBit = 6
+} EFI_CACHE_ERROR_TYPE_DATA;
+
+//Type
+#define EFI_CACHE_TYPE_RECORD_NUMBER 0x00000008
+typedef enum {
+ EfiCacheTypeOther = 1,
+ EfiCacheTypeUnknown = 2,
+ EfiCacheTypeInstruction = 3,
+ EfiCacheTypeData = 4,
+ EfiCacheTypeUnified = 5
+} EFI_CACHE_TYPE_DATA;
+
+//Associativity
+#define EFI_CACHE_ASSOCIATIVITY_RECORD_NUMBER 0x00000009
+typedef enum {
+ EfiCacheAssociativityOther = 1,
+ EfiCacheAssociativityUnknown = 2,
+ EfiCacheAssociativityDirectMapped = 3,
+ EfiCacheAssociativity2Way = 4,
+ EfiCacheAssociativity4Way = 5,
+ EfiCacheAssociativityFully = 6,
+ EfiCacheAssociativity8Way = 7,
+ EfiCacheAssociativity16Way = 8,
+ EfiCacheAssociativity32Way = 9,
+ EfiCacheAssociativity48Way = 10,
+ EfiCacheAssociativity64Way = 11
+} EFI_CACHE_ASSOCIATIVITY_DATA;
+
+
+//Configuration
+#define EFI_CACHE_CONFIGURATION_RECORD_NUMBER 0x0000000A;
+
+//The following constants are associated with Level:
+#define EFI_CACHE_L1 1
+#define EFI_CACHE_L2 2
+#define EFI_CACHE_L3 3
+
+//The following constants are associated with Socketed:
+#define EFI_CACHE_SOCKETED 1
+#define EFI_CACHE_NOT_SOCKETED 0
+
+//The following enumeration is associated with Location:
+typedef enum {
+ EfiCacheInternal = 0,
+ EfiCacheExternal = 1,
+ EfiCacheReserved = 2,
+ EfiCacheUnknown = 3
+} EFI_CACHE_LOCATION;
+
+//The following constants are associated with Enabled:
+#define EFI_CACHE_ENABLED 1
+#define EFI_CACHE_DISABLED 0
+
+//The following enumeration is associated with OperationalMode:
+typedef enum {
+ EfiCacheWriteThrough = 0,
+ EfiCacheWriteBack = 1,
+ EfiCacheDynamicMode = 2,
+ EfiCacheUnknownMode = 3
+} EFI_CACHE_OPERATIONAL_MODE;
+
+
+typedef struct {
+ UINT32 Level :3;
+ UINT32 Socketed :1;
+ UINT32 Reserved2 :1;
+ UINT32 Location :2;
+ UINT32 Enable :1;
+ UINT32 OperationalMode:2;
+ UINT32 Reserved1 :22;
+} EFI_CACHE_CONFIGURATION_DATA;
+
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2005, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
diff --git a/Include/Capsule.h b/Include/Capsule.h
new file mode 100644
index 0000000..54224e9
--- /dev/null
+++ b/Include/Capsule.h
@@ -0,0 +1,152 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2009, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/Projects/Intel/Haswell/LynxPoint_SharkBay-DT_Crb_1AQQW/Include/Capsule.h 2 4/16/13 5:42a Thomaschen $
+//
+// $Revision: 2 $
+//
+// $Date: 4/16/13 5:42a $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/Projects/Intel/Haswell/LynxPoint_SharkBay-DT_Crb_1AQQW/Include/Capsule.h $
+//
+// 2 4/16/13 5:42a Thomaschen
+// Fixed for EIP106722.
+//
+// 5 2/07/13 5:16p Artems
+// [TAG] EIP106722
+// [Category] Bug Fix
+// [Severity] Critical
+// [Symptom] Win8 firmware update doesn't work
+// [RootCause] For Win8 update capsule CapsuleRecovery device didn't
+// skip capsule header
+// [Solution] Added unique GUID to distinguish between AFU and Win8
+// capsule update
+// [Files] Capsule2_0.c CapsuleRecovery.c Capsule.h
+//
+// 4 7/20/12 10:06a Artems
+// [TAG] EIP93520
+// [Category] New Feature
+// [Description] Support of Microsoft ESRT spec
+// Added new capsule guids and header definitions
+// [Files] Capsule.h
+//
+// 3 5/19/12 2:27p Artems
+// [TAG] EIP74625
+// [Category] Improvement
+// [Description] Capsule PPI. Need to update Capsule PEI driver to
+// comply with Intel MRC reference code calling convention
+// [Files] Capsule.h Capsule.dxs Capsule.mak Capsule.sdl CapsuleDefs.h
+//
+// 2 10/28/11 1:17p Artems
+// Moved header from Capsule module to Core
+//
+// 5 1/28/10 2:51p Artems
+// Replaced TABs with Spaces
+//
+// 4 7/09/09 5:10p Artems
+// Changed file header
+//
+// 3 3/05/09 7:09p Artems
+// EIP 20013 Modified code according to code standard
+//
+// 2 3/05/09 5:29p Artems
+// EIP 20013 Modified according to coding standard
+//
+// 1 4/03/07 4:21p Robert
+//
+// 1 1/12/07 12:23p Artems
+//
+
+//<AMI_FHDR_START>
+//----------------------------------------------------------------------
+//
+// Name: Capsule.h
+//
+// Description: UEFI capsule data structure definition
+//
+//----------------------------------------------------------------------
+//<AMI_FHDR_END>
+
+#ifndef __CAPSULE__H__
+#define __CAPSULE__H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <Efi.h>
+
+//Capsule vendor-specific GUID and variable name
+#define EFI_CAPSULE_AMI_GUID \
+ { 0xfac2efad, 0x8511, 0x4e34, 0x9c, 0xae, 0x16, 0xa2, 0x57, 0xba, 0x94, 0x88 }
+
+#ifndef APTIO_FW_CAPSULE_GUID //AMI flash update capsule
+#define APTIO_FW_CAPSULE_GUID \
+ { 0x4A3CA68B, 0x7723, 0x48FB, 0x80, 0x3d, 0x57, 0x8c, 0xc1, 0xfe, 0xc4, 0x4d }
+#endif
+
+#define W8_SCREEN_IMAGE_CAPSULE_GUID \
+ { 0x3b8c8162, 0x188c, 0x46a4, 0xae, 0xc9, 0xbe, 0x43, 0xf1, 0xd6, 0x56, 0x97 }
+
+#define W8_FW_UPDATE_IMAGE_CAPSULE_GUID \
+ { 0x7039436b, 0x6acf, 0x433b, 0x86, 0xa1, 0x36, 0x8e, 0xc2, 0xef, 0x7e, 0x1f }
+
+
+#define CAPSULE_UPDATE_VAR L"AmiCapUp"
+
+
+#define MAX_SUPPORT_CAPSULE_NUM 50
+
+typedef struct {
+ EFI_EVENT CapsuleExitBootServiceEvent;
+ BOOLEAN IsRuntimeMode;
+} EFI_CAPSULE_RUNTIME_DATA;
+
+#pragma pack(push, 1)
+typedef struct {
+ EFI_CAPSULE_HEADER Header;
+ UINT8 Version;
+ UINT8 Checksum;
+ UINT8 ImageType;
+ UINT8 Reserved;
+ UINT32 Mode;
+ UINT32 ImageOffsetX;
+ UINT32 ImageOffsetY;
+ UINT8 Image[1];
+} W8_IMAGE_CAPSULE;
+
+#pragma pack(pop)
+
+
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2009, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//********************************************************************** \ No newline at end of file
diff --git a/Include/CmosAccess.h b/Include/CmosAccess.h
new file mode 100644
index 0000000..fa509b3
--- /dev/null
+++ b/Include/CmosAccess.h
@@ -0,0 +1,661 @@
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2009, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/SOURCE/Modules/CMOS Manager/CMOS Core/CMOS Interfaces/CmosAccess.h 21 12/11/11 8:53p Michaela $
+//
+// $Revision: 21 $
+//
+// $Date: 12/11/11 8:53p $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/SOURCE/Modules/CMOS Manager/CMOS Core/CMOS Interfaces/CmosAccess.h $
+//
+// 21 12/11/11 8:53p Michaela
+//
+// 20 3/16/11 2:46p Michaela
+//
+// 19 6/15/10 4:28p Michaela
+//
+// 18 3/05/10 4:54p Michaela
+//
+// 17 12/04/09 7:32p Michaela
+//
+// 16 11/10/09 9:13p Michaela
+//
+// 15 7/29/09 9:58a Michaela
+// updates Aptio Enhancement EIP 22205
+// (no code changes)
+//
+// 14 6/15/09 5:13p Michaela
+//
+// 13 6/02/09 3:27p Michaela
+// For label: 4.6.3_CMOSMGR_11
+//
+// 12 2/16/09 11:19p Michaela
+//
+// 11 2/16/09 10:20p Michaela
+// - Update LOCATE_CMOS_ACCESS_API_POINTER to use
+// new SDL tokens for index/data port access and
+// CMOS_NMI_BIT_VALUE to be OR'ed with the index
+// port value.
+// - Added AMI headers.
+//
+// 10 1/21/09 3:27p Michaela
+// Update LOCATE_CMOS_ACCESS_API_POINTER to use
+// CMOS_STD_INDEX and CMOS_STD_DATA
+//
+// 9 1/08/09 12:53p Michaela
+// CmosGetTokenFromRegister() modified to verify register size is 8
+//
+// 4 11/25/08 3:52p Michaela
+// Updates for Label 4.6.3_CMOSMGR_08
+// - Assembly macro fixes
+// - Added assembly macros
+// - Moved loading defaults into DXE phase
+// - Updated help file example
+//
+// 8 11/17/08 4:41p Michaela
+// --Removed Token Name strings in debug development code
+//
+// 7 11/17/08 3:28p Michaela
+// -Updated LOCATE_CMOS_ACCESS_API_POINTER macro to
+// initialize the pointer to NULL if the battery is bad
+// -added CMOS_ACCESS_TYPE typedef for client code usage
+// -including <SspTokens.h>
+// -CMOS Buffer feature is depreciated
+//
+// 6 11/14/08 9:05a Michaela
+// Width of Cmos Register variables changed to
+// UINT16 instead of UINT8
+//
+// 5 11/07/08 5:12p Michaela
+// Updated to make CMOS manager available in all phases
+// of the boot process:
+//
+// A CMOS API Pointer is maintained in CMOS and accessible
+// via provided macros in C and assembly source.
+//
+// 4 3/07/08 4:08p Michaela
+// Label 4.6.3_CMOSMGR_05 fixes:
+// -- write errors to Optimal Defaults buffer before memory detection
+// -- CMOS Token table corruption when name strings are disabled
+//
+// 3 2/29/08 9:36p Michaela
+// - Added recovery path policy
+// - fixed other minor bugs
+//
+// 2 2/26/08 12:47p Michaela
+// Added/modified Helpbuilder headers
+//
+// 1 2/22/08 2:29p Michaela
+//
+// 1 2/06/08 2:23p MichaelA
+// Created
+//
+//**********************************************************************
+
+//<AMI_FHDR_START>
+//---------------------------------------------------------------------------
+//
+// Name: CmosAccess.h
+//
+// Description:
+// This file provides declarations for CMOS access functions
+// for reading CMOS memory.
+//
+//---------------------------------------------------------------------------
+//<AMI_FHDR_END>
+
+
+//<AMI_GHDR_START>
+//----------------------------------------------------------------------------
+//
+// Name: Terms
+//
+// Description:
+// This page defines/clarifies the implied/intended meaning for the
+// terminology used in the CMOS Manager module's documentation.
+//
+// Notes:
+// Manager -
+// Refers to the entire collection of subsystems that compose
+// the CMOS Manager module, including internal and external
+// interfaces.
+//
+// Access Interface -
+// The collection of public services (functions/data) provided
+// by the Manager through the EFI_CMOS_ACCESS_INTERFACE
+// PPI/Protocol.
+//
+// API Pointer -
+// A CMOS-based EFI_CMOS_ACCESS_INTERFACE pointer that is
+// maintained until DXE phase. This pointer can be utilized
+// via macros defined in an assembly include and/or C-source
+// header file.
+//
+// External/Internal Interface -
+// The external interface is the set of functions/data
+// available to other modules, via the Access Interface.
+// The Internal Interface is the set of functions/data
+// used by the Manager itself, specifically the
+// EFI_CMOS_MANAGER_INTERFACE. Generally speaking, the
+// External Interface is a subset of the Internal Interface.
+//
+// Client -
+// A module that locates the Access Interface and uses the
+// services provided by the CMOS Manager module via this
+// external interface.
+//
+// Managed CMOS -
+// Describes the paradigm of using the CMOS Manager to access
+// a predefined region of CMOS locations.
+//
+// Managed Region -
+// The region of physical CMOS locations for which CMOS
+// Manager provides its allocation/access services.
+// This region is represented as a contiguous region of
+// locations, where the range is defined by SDL Tokens
+// (FIRST_MANAGED_CMOS_ADDRESS and MAX_MANAGED_CMOS_ADDRESS).
+//
+// CMOS Value -
+// This is one or more bits of data that will be stored at a
+// location in CMOS. The maximum size of a CMOS value is
+// 8 bits.
+//
+// CMOS Token -
+// This is an encoded value that represents the location,
+// size in bits, and offset within the CMOS byte for a
+// particular CMOS value.
+//
+//----------------------------------------------------------------------------
+//<AMI_GHDR_END>
+
+//<AMI_GHDR_START>
+//----------------------------------------------------------------------------
+//
+// Name: CMOS_Manager_Initialization_and_Usage
+//
+// Description:
+// This page provides an outline of the steps required for CMOS Manager
+// initialization and services usage.
+//
+// Notes:
+// Overview of CMOS Manager usage:
+//
+// 1) Include CmosAccess.h.
+//
+// 2) Declare a pointer to EFI_CMOS_ACCESS_INTERFACE.
+//
+// 3) Use the appropriate macro to locate the interface,
+// LOCATE_CMOS_ACCESS_PPI(),
+// LOCATE_CMOS_ACCESS_API_POINTER(),
+// LOCATE_CMOS_ACCESS_PROTOCOL() or
+// LOCATE_CMOS_ACCESS_SMM_PROTOCOL()
+//
+// 4) Use the interface to access CMOS.
+//
+// Note: Be sure to check the return value of each call!
+//
+//----------------------------------------------------------------------------
+//<AMI_GHDR_END>
+
+//<AMI_GHDR_START>
+//----------------------------------------------------------------------------
+//
+// Name: Protocols_and_PPI
+//
+// Description:
+// This page provides links to the Protocols and PPI installed by this
+// module. These are the external interfaces to the CMOS Manager
+// module's services.
+//
+// Fields: Phase Name Description
+// ------------------------------------------------------------------
+// All EFI_CMOS_ACCESS_INTERFACE Client interface installed by CMOS Manager
+//
+//----------------------------------------------------------------------------
+//<AMI_GHDR_END>
+
+
+//<AMI_GHDR_START>
+//----------------------------------------------------------------------------
+//
+// Name: Macros
+//
+// Description:
+// The page provides links to macros that can be used by CMOS Manager
+// client modules.
+//
+// Fields: Phase Name Description
+// ------------------------------------------------------------------
+// PEI READ_CMOS_PPI Use the CMOS Access PPI to read a value from CMOS using a CMOS token from assembly source
+// PEI WRITE_CMOS_PPI Use the CMOS Access PPI to write a value to CMOS using a CMOS token from assembly source
+// PEI READ_CMOS_TOKEN Use the CMOS-based API/PPI pointer to read a value from CMOS using a CMOS token from assembly source
+// PEI WRITE_CMOS_TOKEN Use the CMOS-based API/PPI pointer to write a value to CMOS using a CMOS token from assembly source
+// PEI READ_CMOS_REGISTER Use the CMOS-based API/PPI pointer to read a value from CMOS using a CMOS token from assembly source
+// PEI WRITE_CMOS_REGISTER Use the CMOS-based API/PPI pointer to write a value to CMOS using a CMOS token from assembly source
+// PEI LOCATE_CMOS_ACCESS_API_POINTER Get CMOS-based API/PPI pointer
+// PEI LOCATE_CMOS_ACCESS_PPI Get CMOS Access PPI pointer
+// DXE LOCATE_CMOS_ACCESS_PROTOCOL Get CMOS Access Protocol pointer
+//
+//----------------------------------------------------------------------------
+//<AMI_GHDR_END>
+
+#ifndef _CMOS_ACCESS_H
+#define _CMOS_ACCESS_H
+
+#include <EFI.h>
+#include <Pei.h>
+#include <Token.h>
+#include <SspTokens.h>
+
+//----------------------------------------------
+// The smallest theoretical CMOS token value is
+// one bit at CMOS register address 0:
+//
+// Token encoding is as follows:
+//
+// [2:0] Bit offset (in the CMOS byte)
+// [11:3] CMOS register address (0-511)
+// [15:12] Size (in bits)
+//----------------------------------------------
+#define MIN_TOKEN_VALUE (1 << 12) // 4096
+
+
+// PEI phase interface GUID
+//--------------------------------------------------------------
+// {CCBF2786-CD6C-4308-BDFA-625870CEBF81}
+#define EFI_PEI_CMOS_ACCESS_GUID \
+{ 0xccbf2786, 0xcd6c, 0x4308, 0xbd, 0xfa, 0x62, 0x58, 0x70, 0xce, 0xbf, 0x81 }
+
+
+// DXE phase interface GUID
+//--------------------------------------------------------------
+// {9851740C-22E0-440D-9090-EF2D71C251C9}
+#define EFI_DXE_CMOS_ACCESS_GUID \
+{ 0x9851740c, 0x22e0, 0x440d, 0x90, 0x90, 0xef, 0x2d, 0x71, 0xc2, 0x51, 0xc9 }
+
+// SMM interface GUID
+//--------------------------------------------------------------
+// {E5D3026A-1CA5-40f0-8FB6-4B1AFA3C6EAA}
+#define EFI_SMM_CMOS_ACCESS_GUID \
+{ 0xe5d3026a, 0x1ca5, 0x40f0, 0x8f, 0xb6, 0x4b, 0x1a, 0xfa, 0x3c, 0x6e, 0xaa }
+
+//<AMI_PHDR_START>
+//----------------------------------------------------------------------------
+// Name: LOCATE_CMOS_ACCESS_PPI
+//
+// Description:
+// This Macro calls (*PeiServices)->LocatePpi() to locate the CMOS
+// access PPI.
+//
+// Input:
+// IN OUT InterfacePtr - Pointer whose value will be updated
+// OUT Status - Return value from LocatePpi()
+//
+// Output:
+//
+// Modified:
+//
+// Referrals:
+// (*PeiServices)->LocatePpi
+//
+// Notes:
+// This macro assumes PeiServices is defined.
+//----------------------------------------------------------------------------
+//<AMI_PHDR_END>
+
+#define LOCATE_CMOS_ACCESS_PPI(Status, InterfacePtr) { \
+ EFI_GUID Guid = EFI_PEI_CMOS_ACCESS_GUID; \
+ Status = (*PeiServices)->LocatePpi( PeiServices, &Guid, \
+ 0, NULL, &InterfacePtr); }
+
+
+//<AMI_PHDR_START>
+//----------------------------------------------------------------------------
+// Name: LOCATE_CMOS_ACCESS_PROTOCOL
+//
+// Description:
+// This Macro calls pBS->LocateProtocol() to locate the CMOS access
+// Protocol.
+//
+// Input:
+// IN OUT InterfacePtr - Pointer whose value will be updated
+// OUT Status - Return value from LocateProtocol()
+//
+// Output:
+//
+// Modified:
+//
+// Referrals:
+// pBS->LocateProtocol
+//
+// Notes:
+// This macro assumes pBS is defined.
+//----------------------------------------------------------------------------
+//<AMI_PHDR_END>
+
+#define LOCATE_CMOS_ACCESS_PROTOCOL(Status, InterfacePtr) { \
+ EFI_GUID Guid = EFI_DXE_CMOS_ACCESS_GUID; \
+ Status = pBS->LocateProtocol( &Guid, NULL, &InterfacePtr); }
+
+
+//<AMI_PHDR_START>
+//----------------------------------------------------------------------------
+// Name: LOCATE_CMOS_ACCESS_SMM_PROTOCOL
+//
+// Description:
+// This Macro calls pBS->LocateProtocol() to locate the CMOS access
+// Protocol for SMM access to CMOS.
+//
+// Input:
+// IN OUT InterfacePtr - Pointer whose value will be updated
+// OUT Status - Return value from LocateProtocol()
+//
+// Output:
+//
+// Modified:
+//
+// Referrals:
+// pBS->LocateProtocol
+//
+// Notes:
+// This macro assumes pBS is defined.
+//----------------------------------------------------------------------------
+//<AMI_PHDR_END>
+
+#define LOCATE_CMOS_ACCESS_SMM_PROTOCOL(Status, InterfacePtr) { \
+ EFI_GUID Guid = EFI_SMM_CMOS_ACCESS_GUID; \
+ Status = pBS->LocateProtocol( &Guid, NULL, &InterfacePtr); }
+
+
+//<AMI_PHDR_START>
+//----------------------------------------------------------------------------
+// Name: LOCATE_CMOS_ACCESS_API_POINTER
+//
+// Description:
+// This Macro initializes InterfacePtr = NULL if the battery is bad.
+// Otherwise, read the four bytes of the CMOS-based API pointer into
+// InterfacePtr, starting at CMOS_ACCESS_API_BYTE3.
+//
+// Input:
+// IN OUT InterfacePtr - Pointer whose value will be updated
+//
+// Output:
+//
+// Modified:
+//
+// Referrals:
+// IoRead8, IoWrite8
+//
+// Notes:
+//----------------------------------------------------------------------------
+//<AMI_PHDR_END>
+
+#define LOCATE_CMOS_ACCESS_API_POINTER( InterfacePtr ) { \
+ UINT8 i; UINT32 d = 0;\
+ IoWrite8( CMOS_BANK0_INDEX, \
+ CMOS_RTC_STATUS_REGISTER | CMOS_NMI_BIT_VALUE );\
+ if ( !(IoRead8(CMOS_BANK0_DATA) & (0x80)) )\
+ InterfacePtr = (EFI_CMOS_ACCESS_INTERFACE*) NULL;\
+ else {\
+ for (i=0; i < 4; i++){\
+ IoWrite8( CMOS_BANK0_INDEX, \
+ (CMOS_ACCESS_API_BYTE3 + i) | CMOS_NMI_BIT_VALUE);\
+ d <<= 8; \
+ d |= IoRead8(CMOS_BANK0_DATA);\
+ }\
+ InterfacePtr = (EFI_CMOS_ACCESS_INTERFACE*) d;\
+ }\
+}
+
+typedef enum _CMOS_ACCESS_TYPE {
+ WriteType = 0,
+ ReadType = 1,
+} CMOS_ACCESS_TYPE;
+
+// Aggregate types
+//--------------------------------------------------------------
+#pragma pack(push, 1) // force byte alignment
+
+typedef union _StatusRegisterA
+ {
+ UINT8 AllBits;
+ struct _StatusRegisterAFields { // [Bits] - Description
+ //--------------------------------
+ UINT8 RateSelect :4; // [3-0] - divider output
+ // frequency
+ UINT8 BankControl :1; // [4] - selects the bank of CMOS
+ // RAM that is accessed
+ // through RTC
+ UINT8 SelectDivider :2; // [6-5] - time-base frequency is
+ // being used
+ UINT8 UpdateInProgress :1; // [7] - RTC update in progress
+ // 1 = TRUE
+ // 0 = FALSE
+ } Field;
+} STATUS_REGISTER_A_BYTE;
+
+
+typedef union _Diagnostic
+ {
+ UINT8 AllBits;
+ struct _DiagnosticFields { // [Bits] - Description
+ UINT8 Bit1_0 :2; // [1-0] - Reserved
+ UINT8 TimeIsInvalid :1; // [2] - CMOS time status indicator
+ // 0 = valid
+ // 1 = invalid
+ UINT8 Bit3 :1; // [3] - Not used
+ UINT8 Bit4 :1; // [4] - Not used
+ UINT8 Bit5 :1; // [5] - Not used
+ UINT8 ChecksumIsBad :1; // [6] - CMOS checksum status
+ // 0 = Checksum is good
+ // 1 = Checksum is bad
+ UINT8 RtcPowerIsBad :1; // [7] - Real time clock power status
+ // 0 = has not lost power
+ // 1 = has lost power
+ } Field;
+} DIAGNOSTIC_STATUS_BYTE;
+
+typedef union _Battery
+ {
+ UINT8 AllBits;
+ struct _BatteryFields { // [Bits] - Description
+ UINT8 Reserved :7; // [6-0] - Not used
+ UINT8 IsGood :1; // [7] - Valid CMOS RAM flag
+ // 0 = CMOS battery dead
+ // 1 = CMOS battery good
+ } Field;
+} BATTERY_STATUS_BYTE;
+
+typedef struct _CmosConfigurationStatus
+{
+ // Boolean status bits (0=FALSE, 1=TRUE)
+ UINT8 IsVirtualized :1; // [0] - Optimal defaults buffer
+ // is being used.
+ UINT8 NotUsable :1; // [1] - CMOS hardware is not usable
+ UINT8 BadBattery :1; // [2] - CMOS Battery is bad
+ UINT8 BadChecksum :1; // [3] - Bad checksum was detected,
+ // (recovery may have been initiated)
+ UINT8 DefaultsLoaded :1; // [4] - CMOS default values were loaded
+ UINT8 IsFirstBoot :1; // [5] - First boot detected
+ // (or NVRAM was reset)
+ UINT8 Reserved :2; // [7-6] - Reserved
+} CMOS_CONFIGURATION_STATUS;
+
+
+//<AMI_SHDR_START>
+//----------------------------------------------------------------------------
+// Name: CMOS_STATUS_BYTES
+//
+// Description:
+// This structure type is used to define particular CMOS status bytes.
+//
+// Fields: Type Name Description
+// ----------------------------------------------------------------
+// UINT8 DiagnosticStatusRegister Address of the diagnostic status register
+// DIAGNOSTIC_STATUS_BYTE Diagnostic CMOS register that contains clock & checksum information
+// UINT8 BatteryStatusRegister Address of the battery status register
+// BATTERY_STATUS_BYTE Battery CMOS register that contains CMOS battery information
+// CMOS_STATUS_BYTES ConfigurationStatus State information for the CMOS manager's access mechanisms
+//
+// Notes:
+// The bit-field naming convention affirms the bit-set condition, so that TRUE
+// conditions can be tested. For example, here is one possible usage
+// scenario:
+//
+// CMOS_STATUS_BYTES CmosStatus;
+// MyGetStatusBytes(&CmosStatus);
+//
+// if (CmosStatus.Diagnostic.Field.ChecksumIsBad)
+// MyInitiateRecovery();
+//
+// The union provides access to all the bits of the CMOS byte or to
+// a specific data field within the byte:
+//
+// Battery.AllBits All bits of the battery status byte
+// Battery.Field.IsGood Bit is set if battery is good
+//
+// Diagnostic.AllBits All bits of the diagnostics status byte
+// Diagnostic.Field.TimeIsInvalid Bit is set if time is invalid
+// Diagnostic.Field.ChecksumIsBad Bit is set if checksum is bad
+// Diagnostic.Field.RtcPowerIsBad Bit is set if real time clock has lost power
+//
+// ConfigurationStatus.IsVirtualized Bit is set if the optimal defaults buffer is in use
+//
+//----------------------------------------------------------------------------
+//<AMI_SHDR_END>
+
+typedef struct _CMOS_STATUS_BYTES
+{
+ UINT8 DiagnosticStatusRegister;
+ DIAGNOSTIC_STATUS_BYTE Diagnostic;
+ UINT8 BatteryStatusRegister;
+ BATTERY_STATUS_BYTE Battery;
+ CMOS_CONFIGURATION_STATUS ConfigurationStatus;
+}CMOS_STATUS_BYTES;
+
+
+typedef struct _CMOS_SMM_CONTEXT {
+ UINT8 Opcode; // 0 = Write, 1 = Read
+ UINT16 CmosToken;
+ UINT8 CmosByte;
+ UINT8 Status; // 0/FALSE => error, 1/TRUE => success
+} CMOS_SMM_CONTEXT;
+
+
+#pragma pack(pop)
+
+
+typedef struct _EFI_CMOS_ACCESS_INTERFACE EFI_CMOS_ACCESS_INTERFACE;
+
+typedef CHAR8* (*EFI_CMOS_GET_NAME) (
+ IN EFI_CMOS_ACCESS_INTERFACE *Cmos,
+ IN UINT16 CmosToken
+);
+
+typedef EFI_STATUS (*EFI_CMOS_READ) (
+ IN EFI_CMOS_ACCESS_INTERFACE *Cmos,
+ IN UINT16 CmosToken,
+ OUT UINT8 *CmosValue
+);
+
+typedef EFI_STATUS (*EFI_CMOS_WRITE) (
+ IN EFI_CMOS_ACCESS_INTERFACE *Cmos,
+ IN UINT16 CmosToken,
+ IN UINT8 CmosValue
+);
+
+typedef EFI_STATUS (*EFI_CMOS_READ_STATUS_BYTES) (
+ IN EFI_CMOS_ACCESS_INTERFACE *Cmos,
+ IN CMOS_STATUS_BYTES *StatusBytes
+);
+
+typedef UINT16 (*EFI_CMOS_GET_TOKEN_FROM_REGISTER) (
+ IN EFI_CMOS_ACCESS_INTERFACE *Cmos,
+ IN UINT16 CmosRegister
+);
+
+typedef EFI_STATUS (*EFI_CMOS_GET_DATE_TIME) (
+ IN EFI_CMOS_ACCESS_INTERFACE *Cmos,
+ OUT EFI_TIME *Time
+);
+
+typedef EFI_STATUS (*EFI_CMOS_SET_DATE_TIME) (
+ IN EFI_CMOS_ACCESS_INTERFACE *Cmos,
+ IN EFI_TIME *Time
+);
+
+//<AMI_SHDR_START>
+//----------------------------------------------------------------------------
+// Name: EFI_CMOS_ACCESS_INTERFACE
+//
+// Description:
+// This is the external interface to all the functionality provided by
+// the CMOS Manager to external modules.
+//
+// Fields: Type Name Description
+// EFI_PEI_SERVICES **PeiServices pointer to the PEI services table
+// EFI_CMOS_READ Read read a value from a CMOS register (see CmosRead)
+// EFI_CMOS_WRITE Write write a value to a CMOS register (see CmosWrite)
+// EFI_CMOS_GET_TOKEN_FROM_REGISTER GetTokenFromRegister returns the token from the register address (see CmosGetTokenFromRegister)
+// EFI_CMOS_READ_STATUS_BYTES ReadCmosStatusBytes updates a CMOS_STATUS_BYTES structure
+// EFI_CMOS_GET_DATE_TIME GetTime Reads the RTC CMOS registers and updates the EFI_TIME structure output parameter (see CmosGetDateTime)
+// EFI_CMOS_SET_DATE_TIME SetTime Writes the RTC CMOS registers from information in the EFI_TIME input parameter (see CmosSetDateTime)
+// EFI_HANDLE *Oem provide interface extensibility
+//
+// Notes:
+// The user of this interface should check the returns of all functions
+// and take the appropriate action if an error is returned.
+//
+// Important!! changes in this structure must also be implemented in
+// CmosAccess32.inc (EFI_CMOS_ACCESS_INTERFACE struct).
+//
+//----------------------------------------------------------------------------
+//<AMI_SHDR_END>
+
+#pragma pack(push, 1) // force byte alignment
+typedef struct _EFI_CMOS_ACCESS_INTERFACE
+{
+ // This structure must be identical to the one in CmosAccess32.inc
+ EFI_PEI_SERVICES **PeiServices; // NULL in DXE phase
+ EFI_CMOS_READ Read;
+ EFI_CMOS_WRITE Write;
+ EFI_CMOS_GET_TOKEN_FROM_REGISTER GetTokenFromRegister;
+ EFI_CMOS_READ_STATUS_BYTES ReadCmosStatusBytes;
+ EFI_CMOS_GET_DATE_TIME GetTime;
+ EFI_CMOS_SET_DATE_TIME SetTime;
+ EFI_HANDLE *Oem; // can extend, but should not
+ // modify, this structure
+};
+#pragma pack(pop)
+
+#endif // #ifndef _CMOS_ACCESS_H
+
+
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2009, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
diff --git a/Include/CmosAccess32.inc b/Include/CmosAccess32.inc
new file mode 100644
index 0000000..a498d9e
--- /dev/null
+++ b/Include/CmosAccess32.inc
@@ -0,0 +1,799 @@
+;**********************************************************************
+;**********************************************************************
+;** **
+;** (C)Copyright 1985-2009, American Megatrends, Inc. **
+;** **
+;** All Rights Reserved. **
+;** **
+;** 5555 Oakbrook Pkwy, Suite 200, Norcross, GA 30093 **
+;** **
+;** Phone: (770)-246-8600 **
+;** **
+;**********************************************************************
+;**********************************************************************
+; $Header: /Alaska/SOURCE/Modules/CMOS Manager/CMOS Core/CMOS Interfaces/CmosAccess32.inc 7 12/04/09 7:32p Michaela $
+;
+; $Revision: 7 $
+;
+; $Date: 12/04/09 7:32p $
+;
+;****************************************************************************
+; Revision History
+; ----------------
+; $Log: /Alaska/SOURCE/Modules/CMOS Manager/CMOS Core/CMOS Interfaces/CmosAccess32.inc $
+;
+; 7 12/04/09 7:32p Michaela
+;
+; 6 7/29/09 9:58a Michaela
+; updates Aptio Enhancement EIP 22205
+; (no code changes)
+;
+; 5 6/02/09 3:27p Michaela
+; For label: 4.6.3_CMOSMGR_11
+;
+; 4 2/16/09 10:24p Michaela
+; GetPointerCmos32() and MaReadCmosByte()
+; - OR index port values with CMOS_NMI_BIT_VALUE
+; Global equate changes
+; CMOS_BANK0_INDEX and CMOS_BANK0_DATA replaces
+; CMOS_STD_INDEX and CMOS_STD_DATA
+;
+; 3 2/06/09 2:03p Michaela
+; Fixed bug related to NMI policy token
+;
+; 2 1/21/09 3:32p Michaela
+;
+; 1 11/25/08 3:33p Michaela
+; Updates for Label 4.6.3_CMOSMGR_08
+; - Assembly macro fixes
+; - Added assembly macros
+; - Moved loading defaults into DXE phase
+; - Updated help file example
+;
+; 2 11/25/08 3:29p Michaela
+; Updates for Label 4.6.3_CMOSMGR_08
+; - Assembly macro fixes
+; - Added assembly macros
+; - Moved loading defaults into DXE phase
+; - Updated help file example
+;
+; 1 11/25/08 3:16p Michaela
+; moved to CMOS Interfaces
+;
+; 4 11/17/08 4:40p Michaela
+; --Removed Token Name strings in debug development code
+;
+; 3 11/17/08 3:50p Michaela
+; --CMOS Buffer feature is depreciated
+; --Port- and register-related constants are defined from SDL tokens
+; --Explicit battery check is made on call to GetPointerCmos32.
+; Upon battery error, carry flag is set and
+; EAX = CMOS_BATTERY_ERR
+; --For read/write access macros, EAX = CMOS_BATTERY_ERR
+; upon bad battery error check
+;
+; 2 11/07/08 5:31p Michaela
+; Added SS header
+;
+
+;*************************************************************************
+;<AMI_FHDR_START>
+;
+; Name: CmosAccess32.inc
+;
+; Description:
+; This file contains macros, constants, procedure definitions and structure
+; declarations to be used in 32-bit assembly code.
+;
+;<AMI_FHDR_END>
+;*************************************************************************
+
+IFNDEF _CMOSACCESS32_INC_
+_CMOSACCESS32_INC_ EQU 1
+
+INCLUDE TokenEqu.equ
+INCLUDE Token.equ
+
+EFI_CMOS_ACCESS_INTERFACE struct
+ PeiServices DD 0 ; EFI_PEI_SERVICES **
+ Read DD 0 ; EFI_CMOS_READ
+ Write DD 0 ; EFI_CMOS_WRITE
+ GetTokenFromRegister DD 0 ; EFI_CMOS_GET_TOKEN_FROM_REGISTER
+ ReadCmosStatusBytes DD 0 ; EFI_CMOS_READ_STATUS_BYTES
+ GetTime DD 0 ; EFI_CMOS_GET_DATE_TIME
+ SetTime DD 0 ; EFI_CMOS_SET_DATE_TIME
+ Oem DD 0 ; EFI_HANDLE *
+EFI_CMOS_ACCESS_INTERFACE ends
+
+CMOS_WRITE_ACCESS EQU 0
+CMOS_READ_ACCESS EQU 1
+
+CLOCK_STATUS_REG EQU MKF_CMOS_RTC_STATUS_REGISTER
+BATT_BIT EQU 080h ; bit 8 is battery status (set == good)
+CMOS_BATTERY_ERR EQU 012h
+CMOS_BITSIZE_ERR EQU 013h
+CMOS_OVERFLOW_ERR EQU 014h
+
+CMOS_ADDR_PORT equ MKF_CMOS_BANK0_INDEX ; standard CMOS r/w port
+CMOS_DATA_PORT equ MKF_CMOS_BANK0_DATA
+
+_Cmos TEXTEQU <(EFI_CMOS_ACCESS_INTERFACE PTR [eax])>
+byte_reg_list TEXTEQU <al aL Al AL ah Ah aH AH bl Bl bL BL bh Bh bH BH cl Cl cL CL ch Ch cH CH dl Dl dL DL dh Dh dH DH>
+
+
+;-----------------------------------------------------------------------------
+; return true (1) if arg is a byte register or variable
+; otherwise return 0
+;-----------------------------------------------------------------------------
+IS_BYTE_ARG MACRO arg
+ LOCAL pos, retval
+
+ ; test for byte register
+ pos = @InStr(, %byte_reg_list, <arg>)
+ IF (pos GT 0)
+ retval = 1
+
+ ; test for byte memory variable
+ ELSEIF (((OPATTR(arg)) AND 00000010y) AND (SIZEOF(TYPE(arg)) eq 1))
+ retval = 1
+
+ ; otherwise a pushd should work
+ ELSE
+ retval = 0
+
+ ENDIF
+
+ EXITM %retval
+ENDM
+
+
+IO_DELAY MACRO
+ jmp $+2
+ jmp $+2
+ENDM
+
+IFDEF USE_EXTERN_CMOS_PROCS
+ EXTERN MaReadCmosByte :NEAR
+ EXTERN GetPointerCmos32 :NEAR
+ EXTERN ReadWriteCmosToken :NEAR C
+ EXTERN ReadWriteCmosRegister :NEAR C
+ELSE
+
+;<AMI_PHDR_START>
+;----------------------------------------------------------------------------
+;
+; Procedure: MaReadCmosByte
+;
+; Description:
+; Reads a byte from the CMOS location specified by AL.
+;
+; Input:
+; AL - CMOS location
+;
+; Output:
+; AH - Value at CMOS location specified by AL
+;
+;----------------------------------------------------------------------------
+;<AMI_PHDR_END>
+
+MaReadCmosByte PROC NEAR PRIVATE
+ or al, MKF_CMOS_NMI_BIT_VALUE ; set value of the NMI bit
+ out CMOS_ADDR_PORT, al
+ jmp short $+2
+ xchg ah, al
+ in al, CMOS_DATA_PORT
+ xchg ah, al
+ and al, NOT MKF_CMOS_NMI_BIT_VALUE ; clear NMI bit
+ ret
+MaReadCmosByte ENDP
+
+
+;<AMI_PHDR_START>
+;----------------------------------------------------------------------------
+;
+; Procedure: GetPointerCmos32
+;
+; Description:
+; This routine returns the 32-bit value stored in CMOS where the high
+; byte starts at location specified by register AL.
+;
+; Input:
+; AL = Upper byte register (reads upper to lower bytes in
+; increasing register addresses)
+;
+; Output:
+; EAX = 32bit value stored in CMOS
+; CF = set if error (EAX = Error code)
+; CF = clear if success
+;
+; Modified:
+; None
+;
+; Referrals:
+; MaReadCmosByte
+;
+; Notes:
+; This function is defined to be called from C or assembly.
+;
+;----------------------------------------------------------------------------
+;<AMI_PHDR_END>
+
+GetPointerCmos32 PROC NEAR PRIVATE USES EBX
+ LOCAL ApiPointer:PTR DWORD,
+ LastByteRegister:BYTE
+
+ push ebx ; save temp register
+
+;-----------------------------------------------------
+; return error if battery is bad
+; (using clock range ports)
+;-----------------------------------------------------
+
+ push eax
+ mov al, CLOCK_STATUS_REG
+ or al, MKF_CMOS_NMI_BIT_VALUE ; set value of the NMI bit
+ out CMOS_ADDR_PORT, al
+ IO_DELAY
+ IO_DELAY
+ in al, CMOS_DATA_PORT ; AL = battery status
+ test al, BATT_BIT ; bit is set if OK
+ pop eax
+ .if (zero?)
+ stc
+ mov eax, CMOS_BATTERY_ERR ; CMOS battery is bad.
+ jmp GetPointerCmos32Exit
+ .endif
+
+;-----------------------------------------------------
+; No error, so get the API pointer
+;-----------------------------------------------------
+
+ mov ApiPointer, 0
+ mov LastByteRegister, MKF_CMOS_ACCESS_API_BYTE3
+ add LastByteRegister, 3
+
+ mov al, MKF_CMOS_ACCESS_API_BYTE3
+ .while (al <= LastByteRegister)
+ call MaReadCmosByte
+ movzx ebx, ah ; ah = current byte ApiPointer
+ or ApiPointer, ebx ; set current byte in ApiPointer
+ inc al
+ .if (al <= LastByteRegister)
+ shl ApiPointer, 8
+ .endif
+ .endw
+ clc
+ mov eax, ApiPointer ; return the 32-bit ApiPointer in eax
+
+GetPointerCmos32Exit:
+ pop ebx ; restore temp register
+ ret
+
+GetPointerCmos32 ENDP
+
+
+;<AMI_PHDR_START>
+;----------------------------------------------------------------------------
+;
+; Name: ReadWriteCmosRegister
+;
+; Description:
+; This function calls EFI_CMOS_ACCESS_INTERFACE.Write or
+; EFI_CMOS_ACCESS_INTERFACE.Read to write or read a CMOS value to
+; a CMOS register.
+;
+; Input:
+; AccessType - CMOS_WRITE_ACCESS or CMOS_READ_ACCESS (equate)
+; CmosRegister - the CMOS register to write (this is not a CMOS token)
+; CmosValue - value to be written or the return value of the read
+;
+;
+; Output:
+; eax - CMOS_BATTERY_ERR if battery is bad
+; eax - EFI error code if bit 31 is set
+; carry flag - clear on success or set on error
+;
+; Notes:
+;
+; Caller must ensure the register has been reserved & specified properly
+; in SSP.
+;
+;----------------------------------------------------------------------------
+;<AMI_PHDR_END>
+
+ReadWriteCmosRegister PROC NEAR32 C PRIVATE AccessType:DWORD,
+ CmosRegister:DWORD,
+ CmosValue:DWORD
+ LOCAL Cmos:DWORD
+
+; AccessType: WriteType = 0
+; ReadType = 1
+
+
+; Cmos = GetPointerCmos32();
+
+ call GetPointerCmos32
+ jc @F ; carry flag set on error
+ mov Cmos, eax
+
+; return Cmos->Read( Cmos,
+; Cmos->GetTokenFromRegister(Cmos, CmosRegister),
+; CmosValuePtr );
+; (or)
+;
+; return Cmos->Write( Cmos,
+; Cmos->GetTokenFromRegister(Cmos, CmosRegister),
+; CmosValue );
+
+ push CmosValue
+ push CmosRegister
+ push Cmos
+ mov eax, Cmos
+ call _Cmos.GetTokenFromRegister
+ add esp, 2*4 ; pop CmosRegister & Cmos
+ push eax ; eax = CmosToken
+ push Cmos
+ mov eax, Cmos
+ .if (AccessType == CMOS_READ_ACCESS)
+ call _Cmos.Read
+ .else
+ call _Cmos.Write
+ .endif
+ add esp, 3*4 ; pop 3 args
+ clc ; clear error flag
+
+@@:
+
+; EAX - CMOS_BATTERY_ERR if battery is bad
+; EAX - EFI error code if bit 31 is set
+
+ ret
+
+ReadWriteCmosRegister ENDP
+
+
+
+;<AMI_PHDR_START>
+;----------------------------------------------------------------------------
+;
+; Name: ReadWriteCmosToken
+;
+; Description:
+; This function calls EFI_CMOS_ACCESS_INTERFACE.Write or
+; EFI_CMOS_ACCESS_INTERFACE.Read to write or read a CMOS value to
+; a CMOS register.
+;
+; Input:
+; AccessType - CMOS_WRITE_ACCESS or CMOS_READ_ACCESS (equate)
+; CmosToken - the encoded CMOS token (not a CMOS register)
+; CmosValue - value to be written or the return value of the read
+;
+; Output:
+; eax - CMOS_BATTERY_ERR if battery is bad
+; eax - EFI error code if bit 31 is set
+;
+; Notes:
+;
+; Caller must ensure the register has been reserved & specified properly
+; in SSP.
+;
+;----------------------------------------------------------------------------
+;<AMI_PHDR_END>
+
+ReadWriteCmosToken PROC NEAR32 C PRIVATE AccessType:DWORD,
+ CmosToken:DWORD,
+ CmosValue:DWORD
+ LOCAL Cmos:DWORD
+
+; AccessType: WriteType = 0
+; ReadType = 1
+
+
+; Cmos = GetPointerCmos32();
+
+ call GetPointerCmos32
+ jc @F ; carry flag set on error
+ mov Cmos, eax
+
+; return Cmos->Read( Cmos,
+; CmosToken,
+; CmosValue );
+; (or)
+;
+; return Cmos->Write( Cmos,
+; CmosToken,
+; CmosValue );
+
+ push CmosValue
+ push CmosToken
+ push Cmos
+ mov eax, Cmos
+ .if (AccessType == 1)
+ call _Cmos.Read
+ .else
+ call _Cmos.Write
+ .endif
+ add esp, 3*4 ; pop 3 args
+ clc ; clear error flag
+
+@@:
+
+; EAX - CMOS_BATTERY_ERR if battery is bad
+; EAX - EFI error code if bit 31 is set
+
+ ret
+
+ReadWriteCmosToken ENDP
+
+ENDIF
+
+;----------------------------------------------------------------------------
+;----------------------------------------------------------------------------
+; Start macro definitions
+;----------------------------------------------------------------------------
+;----------------------------------------------------------------------------
+
+
+;<AMI_PHDR_START>
+;----------------------------------------------------------------------------
+;
+; Name: READ_CMOS_TOKEN
+;
+; Description:
+; This macro invokes ReadWriteCmosToken() to read the CMOS location
+; associated with CmosToken into the value byte at the address
+; specified by CmosValuePtr, after pushing the required arguments onto
+; the stack.
+;
+; Input:
+; CmosToken - valid CMOS token as defined in TokenEqu.equ
+;
+; Output:
+; CmosValuePtr - the byte value at this address is updated upon
+; successful execution
+; eax - CMOS_BATTERY_ERR if battery is bad
+; eax - EFI error code if bit 31 is set
+;
+; Notes:
+;
+; Example call:
+;
+; lea ecx, CmosValue
+; READ_CMOS_TOKEN CMOS_S3_COUNT_LOC, ecx
+; .if (eax != 0)
+; ; handle error
+; .endif
+;
+;----------------------------------------------------------------------------
+;<AMI_PHDR_END>
+
+READ_CMOS_TOKEN MACRO CmosToken:REQ, ; SSP encoded CMOS Token
+ CmosValuePtr:REQ ; Address of byte to update
+
+ push CmosValuePtr ; push byte value's address
+ pushd CmosToken
+ pushd CMOS_READ_ACCESS
+ call ReadWriteCmosToken
+ add sp, 3*4 ; Pop 3 args @ 4 bytes each
+
+; EAX - CMOS_BATTERY_ERR if battery is bad
+; EAX - EFI error code if bit 31 is set
+
+ENDM
+
+
+;<AMI_PHDR_START>
+;----------------------------------------------------------------------------
+;
+; Name: READ_CMOS_PPI
+;
+; Description:
+; This macro calls EFI_CMOS_ACCESS_INTERFACE.Read() to read the CMOS
+; location associated with CmosToken into the value byte at the address
+; specified by CmosValuePtr, after pushing the required arguments onto
+; the stack.
+;
+; Input:
+; Cmos - pointer to an instance of EFI_CMOS_ACCESS_INTERFACE
+; CmosToken - valid CMOS Token as defined in TokenEqu.equ
+;
+; Output:
+; CmosValuePtr
+; - the byte value at this address is updated upon
+; successful execution
+; eax - EFI error code if bit 31 is set
+;
+; Modified:
+; mm0 - destroyed
+;
+; Notes:
+;
+; Example usage:
+;
+; lea ecx, CmosValue
+; READ_CMOS_PPI CmosPpiPtr, CMOS_S3_COUNT_LOC, ecx
+; .if (eax != 0)
+; ; handle error
+; .endif
+;
+;----------------------------------------------------------------------------
+;<AMI_PHDR_END>
+
+READ_CMOS_PPI MACRO Cmos:REQ, ; PPI Pointer
+ CmosToken:REQ, ; SSP encoded CMOS Token
+ CmosValuePtr:REQ ; Address of byte to update
+
+; return Cmos->Read( Cmos,
+; CmosToken,
+; CmosValuePtr );
+ push CmosValuePtr
+ pushd CmosToken
+ push Cmos
+ mov eax, Cmos
+ call _Cmos.Read
+ add esp, 3*4 ; pop 3 args
+
+; EAX - EFI error code if error or zero if success
+
+ENDM
+
+
+
+;<AMI_PHDR_START>
+;----------------------------------------------------------------------------
+;
+; Name: READ_CMOS_REGISTER
+;
+; Description:
+; This macro calls ReadWriteCmosRegister to read the physical CMOS
+; register specified by CmosRegister into the value byte at the address
+; specified by CmosValuePtr, after pushing the required arguments onto
+; the stack.
+;
+; Input:
+; CmosRegister - the physical CMOS register to read (not a CMOS token)
+;
+; Output:
+; CmosValuePtr - the byte value at this address is updated upon
+; successful execution
+; eax - EFI_STATUS
+;
+; Notes:
+;
+; Caller must ensure the entire 8-bits of the register have been
+; reserved properly/explicitly in SSP.
+;
+; Example call:
+;
+; lea ecx, CmosValue
+; READ_CMOS_REGISTER CMOS_S3_COUNT_LOC_REG, ecx
+; .if (eax != 0)
+; ; handle error
+; .endif
+;
+;----------------------------------------------------------------------------
+;<AMI_PHDR_END>
+
+READ_CMOS_REGISTER MACRO CmosRegister:REQ, ; CMOS register address
+ CmosValuePtr:REQ ; Address of byte to update
+
+ push CmosValuePtr ; push the address of the value
+ IF IS_BYTE_ARG(CmosRegister) eq 1
+ movd mm0, eax ; save eax
+ mov al, CmosRegister
+ and eax, 0FFh ; clear all but lower byte
+ push eax
+ movd eax, mm0 ; restore eax
+ ELSE
+ pushd CmosRegister
+ ENDIF
+ pushd CMOS_READ_ACCESS
+ call ReadWriteCmosRegister
+ add sp, 3*4 ; Pop 3 Read() args @ 4 bytes each
+
+; EAX - CMOS_BATTERY_ERR if battery is bad
+; EAX - EFI error code if bit 31 is set
+
+ENDM
+
+
+;<AMI_PHDR_START>
+;----------------------------------------------------------------------------
+;
+; Name: WRITE_CMOS_TOKEN
+;
+; Description:
+; This macro invokes ReadWriteCmosToken() to write the byte specified
+; by CmosValue to the CMOS location associated with CmosToken,
+; after pushing the required arguments onto the stack.
+;
+; Input:
+; CmosToken - valid CMOS Token as defined in TokenEqu.equ
+; CmosValue - Byte value to write to the location associated with
+; CmosToken
+;
+; Output:
+; eax - EFI_STATUS
+;
+; Modified:
+; mm0 - destroyed (used as temporary register if needed)
+;
+; Notes:
+;
+; Example usage:
+;
+; mov cl, TokenValue
+; WRITE_CMOS_TOKEN CMOS_S3_COUNT_LOC, cl
+; .if (eax != 0)
+; ; handle error
+; .endif
+;
+;----------------------------------------------------------------------------
+;<AMI_PHDR_END>
+
+WRITE_CMOS_TOKEN MACRO CmosToken:REQ, ; SSP encoded CMOS Token
+ CmosValue:REQ ; Byte value to write
+
+ IF IS_BYTE_ARG(CmosValue) eq 1
+ movd mm0, eax ; save eax
+ mov al, CmosValue
+ and eax, 0FFh ; clear all but lower byte
+ push eax
+ movd eax, mm0 ; restore eax
+ ELSE
+ pushd CmosValue
+ ENDIF
+ pushd CmosToken ; push CmosToken value
+ pushd CMOS_WRITE_ACCESS
+ call ReadWriteCmosToken
+ add sp, 3*4 ; Pop 3 Write() args @ 4 bytes each
+
+; EAX - CMOS_BATTERY_ERR if battery is bad
+; EAX - EFI error code if bit 31 is set
+
+ENDM
+
+
+;<AMI_PHDR_START>
+;----------------------------------------------------------------------------
+;
+; Name: WRITE_CMOS_PPI
+;
+; Description:
+; This macro calls EFI_CMOS_ACCESS_INTERFACE.Write() to write the
+; the value specified by CmosValue to the CMOS location associated with
+; CmosToken, after pushing the required arguments onto the stack.
+;
+; Input:
+; Cmos - pointer to an instance of EFI_CMOS_ACCESS_INTERFACE
+; CmosToken - valid CMOS Token as defined in TokenEqu.equ
+; CmosValue - Byte value to write to the location associated with
+; CmosToken
+;
+; Output:
+; eax - EFI_STATUS
+;
+; Modified:
+; mm0 - destroyed (used as temporary register if needed)
+;
+; Notes:
+;
+; Example usage:
+;
+; mov cl, CmosTokenValue
+; WRITE_CMOS_PPI CmosPpiPtr, CMOS_S3_COUNT_LOC, cl
+; .if (eax != 0)
+; ; handle error
+; .endif
+;
+;----------------------------------------------------------------------------
+;<AMI_PHDR_END>
+
+WRITE_CMOS_PPI MACRO Cmos:REQ, ; PPI Pointer
+ CmosToken:REQ, ; SSP encoded CMOS Token
+ CmosValue:REQ ; Byte Value to write
+
+; return Cmos->Write( Cmos,
+; CmosToken,
+; CmosValue );
+
+ IF IS_BYTE_ARG(CmosValue) eq 1
+ movd mm0, eax ; save eax
+ mov al, CmosValue
+ and eax, 0FFh ; clear all but lower byte
+ push eax
+ movd eax, mm0 ; restore eax
+ ELSE
+ pushd CmosValue
+ ENDIF
+ pushd CmosToken
+ push Cmos
+ mov eax, Cmos
+ call _Cmos.Write
+ add esp, 3*4 ; pop 3 args
+
+; EAX - EFI error code if error or zero if success
+
+ENDM
+
+
+;<AMI_PHDR_START>
+;----------------------------------------------------------------------------
+;
+; Name: WRITE_CMOS_REGISTER
+;
+; Description:
+; This macro calls ReadWriteCmosRegister to write the value specified
+; by CmosValue to the physical CMOS location specified by CmosRegister
+; after pushing the required arguments onto the stack.
+;
+; Input:
+; CmosRegister - the physical CMOS register to write (not a CMOS token)
+; CmosValue - byte value to write to CmosRegister
+;
+; Output:
+; eax - EFI_STATUS
+;
+; Modified:
+; mm0 - destroyed
+;
+; Notes:
+; Caller must ensure the entire 8-bits of the register have been
+; reserved properly/explicitly in SSP.
+;
+; Example usage:
+;
+; mov cl, CmosValue
+; WRITE_CMOS_REGISTER S3_COUNT_LOC_REG, cl
+; .if (eax != 0)
+; ; handle error
+; .endif
+;
+;----------------------------------------------------------------------------
+;<AMI_PHDR_END>
+
+WRITE_CMOS_REGISTER MACRO CmosRegister:REQ, ; physical CMOS register
+ CmosValue:REQ ; Byte value to write
+ IF IS_BYTE_ARG(CmosValue) eq 1
+ movd mm0, eax ; save eax
+ mov al, CmosValue
+ and eax, 0FFh ; clear all but lower byte
+ push eax
+ movd eax, mm0 ; restore eax
+ ELSE
+ pushd CmosValue
+ ENDIF
+ IF IS_BYTE_ARG(CmosRegister) eq 1
+ movd mm0, eax ; save eax
+ mov al, CmosRegister
+ and eax, 0FFh ; clear all but lower byte
+ push eax
+ movd eax, mm0 ; restore eax
+ ELSE
+ pushd CmosRegister
+ ENDIF
+ pushd CMOS_WRITE_ACCESS
+ call ReadWriteCmosRegister
+ add sp, 3*4 ; Pop 3 args @ 4 bytes each
+
+; EAX - CMOS_BATTERY_ERR if battery is bad
+; EAX - EFI error code if bit 31 is set
+
+ENDM
+
+
+ENDIF
+
+;**********************************************************************
+;**********************************************************************
+;** **
+;** (C)Copyright 1985-2009, American Megatrends, Inc. **
+;** **
+;** All Rights Reserved. **
+;** **
+;** 5555 Oakbrook Pkwy, Suite 200, Norcross, GA 30093 **
+;** **
+;** Phone: (770)-246-8600 **
+;** **
+;**********************************************************************
+;**********************************************************************
diff --git a/Include/CmosAccessSec.inc b/Include/CmosAccessSec.inc
new file mode 100644
index 0000000..c249e86
--- /dev/null
+++ b/Include/CmosAccessSec.inc
@@ -0,0 +1,159 @@
+;**********************************************************************
+;**********************************************************************
+;** **
+;** (C)Copyright 1985-2009, American Megatrends, Inc. **
+;** **
+;** All Rights Reserved. **
+;** **
+;** 5555 Oakbrook Pkwy, Suite 200, Norcross, GA 30093 **
+;** **
+;** Phone: (770)-246-8600 **
+;** **
+;**********************************************************************
+;**********************************************************************
+; $Header: /Alaska/SOURCE/Modules/CMOS Manager/CMOS Core/CMOS Interfaces/CmosAccessSec.inc 7 12/04/09 7:32p Michaela $
+;
+; $Revision: 7 $
+;
+; $Date: 12/04/09 7:32p $
+;
+;****************************************************************************
+; Revision History
+; ----------------
+; $Log: /Alaska/SOURCE/Modules/CMOS Manager/CMOS Core/CMOS Interfaces/CmosAccessSec.inc $
+;
+; 7 12/04/09 7:32p Michaela
+;
+; 6 9/17/09 10:03a Michaela
+; updated jump macros for PE32 SEC binaries
+;
+; 5 7/29/09 9:58a Michaela
+; updates Aptio Enhancement EIP 22205
+; (no code changes)
+;
+; 4 7/23/09 2:28p Michaela
+;
+; 3 7/23/09 1:35p Michaela
+; Fixed build issue related to PE32 binaries
+;
+; 2 6/02/09 3:27p Michaela
+; For label: 4.6.3_CMOSMGR_11
+;
+; 1 11/25/08 3:33p Michaela
+; Updates for Label 4.6.3_CMOSMGR_08
+; - Assembly macro fixes
+; - Added assembly macros
+; - Moved loading defaults into DXE phase
+; - Updated help file example
+;
+; 2 11/25/08 3:29p Michaela
+; Updates for Label 4.6.3_CMOSMGR_08
+; - Assembly macro fixes
+; - Added assembly macros
+; - Moved loading defaults into DXE phase
+; - Updated help file example
+;
+; 1 11/25/08 3:17p Michaela
+; Moved to CMOS Interfaces
+;
+; 1 11/14/08 9:06a Michaela
+; Include file for CMOS access in SEC phase
+;
+; 2 11/07/08 5:31p Michaela
+; Added SS header
+;
+
+;*************************************************************************
+;<AMI_FHDR_START>
+;
+; Name: CmosAccessSec.inc
+;
+; Description:
+; This file contains macros, constants, procedure definitions and structure
+; declarations to be used in SEC phase assembly code.
+;
+;<AMI_FHDR_END>
+;*************************************************************************
+
+IFNDEF _CMOSACCESS_SEC_INC_
+_CMOSACCESS_SEC_INC_ EQU 1
+
+INCLUDE TokenEqu.equ
+INCLUDE Token.equ
+
+IFDEF MKF_SEC_CREATE_PE32 ; cannot use LAST_ADDRESS in PE32 files
+ IF MKF_SEC_CREATE_PE32
+ SEC_LAST_ADDRESS_VALID = 0
+ ELSE
+ SEC_LAST_ADDRESS_VALID = 1
+ ENDIF
+ELSE
+ SEC_LAST_ADDRESS_VALID = 1
+ENDIF
+
+IF SEC_LAST_ADDRESS_VALID
+jmp_edi macro dummy ; goto routine & back (via EDI)
+ local llll ; local label
+ mov edi, LAST_ADDRESS
+ sub edi, OFFSET llll
+ neg edi
+ jmp dummy
+llll:
+endm
+
+jmp_edx macro dummy ; goto routine & back (via EDX)
+ local llll ; local label
+ mov edx, LAST_ADDRESS
+ sub edx, OFFSET llll
+ neg edx
+ jmp dummy
+llll:
+endm
+
+;------- The following macros can be used in PE32 SEC
+ELSE
+jmp_edi macro dummy ; goto routine & back (via EDI)
+ local llll ; local label
+ mov edi, OFFSET llll
+ jmp dummy
+llll:
+endm
+
+jmp_edx macro dummy ; goto routine & back (via EDX)
+ local llll ; local label
+ mov edx, OFFSET llll
+ jmp dummy
+llll:
+endm
+ENDIF
+
+CMOS_WRITE_ACCESS = 0
+CMOS_READ_ACCESS = 1
+
+CMOS_BATTERY_ERR = 012h
+CMOS_BITSIZE_ERR = 013h
+CMOS_OVERFLOW_ERR = 014h
+
+IFNDEF CMOS_NO_EXTERNS
+EXTERN CmosReadWrite:NEAR32
+ENDIF
+
+IF SEC_LAST_ADDRESS_VALID
+EXTERN LAST_ADDRESS:ABS
+ENDIF
+
+ENDIF
+
+;**********************************************************************
+;**********************************************************************
+;** **
+;** (C)Copyright 1985-2009, American Megatrends, Inc. **
+;** **
+;** All Rights Reserved. **
+;** **
+;** 5555 Oakbrook Pkwy, Suite 200, Norcross, GA 30093 **
+;** **
+;** Phone: (770)-246-8600 **
+;** **
+;**********************************************************************
+;**********************************************************************
diff --git a/Include/CmosManagerInterfaces.cif b/Include/CmosManagerInterfaces.cif
new file mode 100644
index 0000000..2ac6d99
--- /dev/null
+++ b/Include/CmosManagerInterfaces.cif
@@ -0,0 +1,10 @@
+<component>
+ name = "CMOS Interfaces"
+ category = ModulePart
+ LocalRoot = "Include\"
+ RefName = "CmosInterfaces"
+[files]
+"CmosAccess.h"
+"CmosAccess32.inc"
+"CmosAccessSec.inc"
+<endComponent>
diff --git a/Include/CpuHobs.h b/Include/CpuHobs.h
new file mode 100644
index 0000000..546256e
--- /dev/null
+++ b/Include/CpuHobs.h
@@ -0,0 +1,171 @@
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2010, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/SOURCE/Modules/SharkBayRefCodes/Haswell/AMI Cpu PKG/CPU Core/CPU Hobs/CpuHobs.h 2 11/23/12 2:10a Hsingyingchung $
+//
+// $Revision: 2 $
+//
+// $Date: 11/23/12 2:10a $
+//*****************************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/SOURCE/Modules/SharkBayRefCodes/Haswell/AMI Cpu PKG/CPU Core/CPU Hobs/CpuHobs.h $
+//
+// 2 11/23/12 2:10a Hsingyingchung
+// [TAG] EIP99095
+// [Category] Improvement
+// [Description] Update by XTU 4.X
+//
+// 1 2/07/12 3:58a Davidhsieh
+//
+// 1 5/06/11 6:07a Davidhsieh
+// First release
+//
+// 11 10/09/10 11:29p Markw
+// Fix Label 33.
+//
+// 10 10/09/10 10:04p Markw
+// Fix Label 32.
+//
+// 9 10/06/10 7:52p Markw
+// Issue Number: 45131
+//
+// Category: Spec Update
+//
+// Severity: Normal
+//
+// Description: Support for IA core current limit and iGfx core current
+// limit for XTU on Sandy Bridge.
+//
+// Files: CpuPeiBoard.c, CpuDxeBoard.c, Cpu.h, CpuHobs.h
+//
+// 8 8/09/10 10:52a Markw
+// Add XTU 2.1 support.
+//
+// 7 4/02/10 11:35a Markw
+// Update HOB for Sandy Bridge VID support.
+//
+// 6 3/08/10 3:13p Markw
+// Add XE support for Sandy Bridge.
+//
+// 5 1/08/10 2:29p Markw
+// Add HOB definition for saving TDC/TDP.
+//
+// 4 10/28/09 5:24p Markw
+//
+// 3 3/04/09 10:39a Markw
+// Update copyright header.
+//
+// 2 7/16/08 6:09p Markw
+// Add DCA Hob.
+//
+// 1 11/02/07 1:59p Markw
+//
+//
+//*****************************************************************************
+
+//<AMI_FHDR_START>
+//---------------------------------------------------------------------------
+//
+// Name: CpuHobs.h
+//
+// Description: Collection of CPU Hobs.
+//
+//---------------------------------------------------------------------------
+//<AMI_FHDR_END>
+
+#ifndef _CPU_HOBS_H__
+#define _CPU_HOBS_H__
+
+#include <pei.h>
+#include <hob.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#pragma pack(push,1)
+
+//This HOB is intended to be temporary until a better solution is available.
+
+// {6865C455-8626-40d8-90F4-A69460A4AB5A}
+#define DCA_HOB_GUID \
+ {0x6865c455, 0x8626, 0x40d8, 0x90, 0xf4, 0xa6, 0x94, 0x60, 0xa4, 0xab, 0x5a}
+
+typedef struct {
+ EFI_HOB_GUID_TYPE EfiHobGuidType;
+ BOOLEAN Supported;
+} DCA_HOB;
+
+/////////////////////////////
+////////////////////////////
+
+//This HOB is subject to change at any CPU label and is only for the CPU module.
+
+// {982D8C6F-F6F6-4135-A309-A4593EA56417}
+#define AMI_INTERNAL_FACTORY_TDC_TDP_HOB_GUID \
+ {0x982d8c6f, 0xf6f6, 0x4135, 0xa3, 0x9, 0xa4, 0x59, 0x3e, 0xa5, 0x64, 0x17}
+
+typedef struct {
+ EFI_HOB_GUID_TYPE EfiHobGuidType;
+ UINT8 Revision;
+ BOOLEAN IsSandyBridge;
+ BOOLEAN IsHasWell;
+ UINT64 Reserved0;
+ UINT8 PowerConv;
+ UINT8 CurConv;
+ UINT8 TimeConv;
+ UINT16 Tdc;
+ UINT16 Tdp; //For Sandy Bridge, this also POWER_LIMIT_1
+ UINT8 TdpLimitTime; //For Sandy Bridge, this is POWER_LIMIT_1_TIME
+ UINT8 Vid;
+//Used for PERF_TUNE_SUPPORT Start
+ UINT8 OneCoreRatioLimit;
+ UINT8 TwoCoreRatioLimit;
+ UINT8 ThreeCoreRatioLimit;
+ UINT8 FourCoreRatioLimit;
+ UINT8 FiveCoreRatioLimit;
+ UINT8 SixCoreRatioLimit;
+ UINT16 IaCoreCurrentMax;
+ UINT16 IGfxCoreCurrentMax;
+ UINT8 OneCoreRatioMax;
+ UINT8 TwoCoreRatioMax;
+ UINT8 ThreeCoreRatioMax;
+ UINT8 FourCoreRatioMax;
+ UINT8 FiveCoreRatioMax;
+ UINT8 SixCoreRatioMax;
+//Used for PERF_TUNE_SUPPORT End
+} AMI_INTERNAL_FACTORY_TDC_TDP_HOB;
+
+#pragma pack(pop)
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2010, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
diff --git a/Include/CryptLib.h b/Include/CryptLib.h
new file mode 100644
index 0000000..b1e4f74
--- /dev/null
+++ b/Include/CryptLib.h
@@ -0,0 +1,611 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2013, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Pkwy, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+//**********************************************************************
+// $Header: /Alaska/BIN/Modules/CryptoPkg/Lib/Include/CryptLib.h 6 1/16/14 5:14p Alexp $
+//
+// $Revision: 6 $
+//
+// $Date: 1/16/14 5:14p $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Modules/CryptoPkg/Lib/Include/CryptLib.h $
+//
+// 6 1/16/14 5:14p Alexp
+// fix parameter inside pkcs_1_v1_5_decode()
+//
+// 5 8/15/13 9:45a Alexp
+// Expose TimeStamp validation functions:
+// Pkcs7_certificate_validate_timestamp_digest,
+// os_mktime,
+// Pkcs7_x509_certificate_chain_validate_with_timestamp
+//
+// 4 5/22/13 10:36a Alexp
+// expose MD5 hash librray function: md5_vector()
+//
+// 3 11/20/12 2:31p Alexp
+// New function to update default EfiTime for Pkcs7 operations
+// set_crypt_efitime(EFI_TIME*)
+//
+// 2 8/15/12 4:22p Alexp
+// Added new lib function:Pkcs7_x509_return_Cert_pubKey()
+// Used to extract n-Modulus of a pub key withinn given x509 Key
+// certificate
+//
+// 1 6/13/11 5:19p Alexp
+//
+// 2 6/10/11 6:22p Alexp
+// added new Pkcs7 parse Operation: Pkcs7CertValidateGetSignerKeyHash
+//
+// 1 5/06/11 6:12p Alexp
+// initial module release
+
+//
+//**********************************************************************
+//<AMI_FHDR_START>
+//----------------------------------------------------------------------------
+//
+// Name: CryptLib.h
+//
+// Description: Defines Aptio cryptographic library APIs.
+// This Cryptographic Library provides implementations of basic and extended cryptography
+// primitives (SHA-1, SHA-256, RSA, x509, PKCS7, ASN1.1) for UEFI security functionality enabling.
+//
+//----------------------------------------------------------------------------
+//<AMI_FHDR_END>
+#ifndef CRYPTOLIB_H
+#define CRYPTOLIB_H
+
+#if defined(_WIN64)
+//typedef unsigned __int64 size_t;
+#else
+typedef unsigned int size_t;
+#endif
+
+// Common Crypto Lib API
+//<AMI_PHDR_START>
+//----------------------------------------------------------------------------
+//
+// Procedure: RuntimeCryptLibConstructorInSMM
+//
+// Description: Init Crypto lib internal state.
+// This function is called from outside of SMM during SMM registration.
+//
+// Input:
+// IN EFI_HANDLE ImageHandle
+// IN EFI_SYSTEM_TABLE *SystemTable
+//
+// Output: EFI_STATUS
+//
+//----------------------------------------------------------------------------
+//<AMI_PHDR_END>
+EFI_STATUS RuntimeCryptLibConstructor(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable);
+EFI_STATUS RuntimeCryptLibConstructorInSmm(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable);
+
+
+//<AMI_PHDR_START>
+//----------------------------------------------------------------------------
+//
+// Procedure: wpa_set_trace_level
+//
+// Description: sets the debug message print mode
+//
+// Input:
+// level: print level: 0 - no messages, 1 - minimal, 2 - full
+//
+// Output: none
+//
+//----------------------------------------------------------------------------
+//<AMI_PHDR_END>
+VOID wpa_set_trace_level(int level);
+
+//<AMI_PHDR_START>
+//----------------------------------------------------------------------------
+//
+// Procedure: set_crypt_efitime
+//
+// Description: updates the local value of crypto EfiTime
+//
+// Input:
+// *EFI_TIME
+//
+// Output: none
+//
+//----------------------------------------------------------------------------
+//<AMI_PHDR_END>
+VOID set_crypt_efitime(EFI_TIME *EfiTime);
+
+// 0. auxilary Memory Manager
+//<AMI_PHDR_START>
+//----------------------------------------------------------------------
+//
+// Procedure: InitCRmm
+//
+// Description: Initializes Crypo Memory Manager
+//----------------------------------------------------------------------
+//<AMI_PHDR_END>
+void InitCRmm(void* pHeap, UINTN HeapSize);
+//<AMI_PHDR_START>
+//----------------------------------------------------------------------
+//
+// Procedure: ResetCRmm
+//
+// Description: Resets Crypto Memory Manager. Clears mem heap and descriptors
+//----------------------------------------------------------------------
+//<AMI_PHDR_END>
+void ResetCRmm();
+
+// 1. Rsa Public Key import
+//<AMI_PHDR_START>
+//**********************************************************************
+//
+// Procedure: crypto_import_rsa2048_public_key
+//
+// Description: Imports RSA2048 public key binary from RAW format into internal crypto_rsa_key data structure
+//
+// Input:
+// KeyN - Pointer to N public modulus buffer
+// KeyE - Pointer to E public exponent buffer
+// LenN - Size of KeyN buffer (must be 256)
+// LenE - Size of KeyE buffer
+//
+// Output: Pointer to Key data structure crypto_rsa_key
+// NULL if failed to import Key
+//
+//**********************************************************************
+//<AMI_PHDR_END>
+struct crypto_rsa_key *crypto_import_rsa2048_public_key(const UINT8 *KeyN, size_t lenN,
+ const UINT8 *KeyE, size_t lenE);
+//<AMI_PHDR_START>
+//**********************************************************************
+//
+// Procedure: crypto_import_asn1_public_key
+//
+// Description: Imports RSA2048 public key from ASN.1 DER format into
+// internal crypto_rsa_key data structure
+//
+// Input:
+// key - Pointer to public key buffer
+// len - Size of key buffer
+//
+// Output: Pointer to Key data structure crypto_rsa_key
+// NULL if failed to import Key
+//
+//**********************************************************************
+//<AMI_PHDR_END>
+struct crypto_rsa_key *crypto_import_asn1_public_key(const UINT8 *key, size_t len);
+
+//<AMI_PHDR_START>
+//**********************************************************************
+//
+// Procedure: base64_decode
+//
+// Description: Do in-place decoding of base-64 data of LENGTH in BUFFER.
+//
+// Input:
+// buffer - Data to be decoded
+// length - Length of the data to be decoded
+//
+// Output: New length of the buffer bytes of decoded data,
+// or -1 n failure
+//
+//**********************************************************************
+//<AMI_PHDR_END>
+size_t base64_decode (char *buffer, size_t length);
+
+// 2. RSA Exponentiation
+//<AMI_PHDR_START>
+//**********************************************************************
+//
+// Procedure: crypto_rsa_exptmod
+//
+// Description: RSA modular exponentiation
+//
+// Input:
+// in: Input data
+// inlen: Input data length
+// out: Buffer for output data
+// outlen: Maximum size of the output buffer and used size on success
+// key: RSA key
+// use_private: 1 = Use RSA private key, 0 = Use RSA public key
+//
+// Output: 0 on success, -1 on failure
+//
+//**********************************************************************
+//<AMI_PHDR_END>
+int crypto_rsa_exptmod(const UINT8 *in, size_t inlen, UINT8 *out, size_t *outlen,
+ struct crypto_rsa_key *key, int use_private);
+
+// 3. PKCS#1 Signatures
+//<AMI_PHDR_START>
+//**********************************************************************
+//
+// Procedure: pkcs_1_pss_decode
+//
+// Description: PKCS #1 v2.00 PSS sig decode
+//
+// Input:
+// msghash The hash to verify
+// msghashlen The length of the hash (octets)
+// sig The signature data (encoded data)
+// siglen The length of the signature data (octets)
+// saltlen The length of the salt used (octets)
+// modulus_bitlen The bit length of the RSA modulus
+//
+// Output: CRYPT_OK if successful (even if the comparison failed)
+//
+//**********************************************************************
+//<AMI_PHDR_END>
+int pkcs_1_pss_decode(const unsigned char *msghash, unsigned long msghashlen,
+ const unsigned char *sig, unsigned long siglen,
+ unsigned long saltlen, unsigned long modulus_bitlen);
+//<AMI_PHDR_START>
+//**********************************************************************
+//
+// Procedure: pkcs_1_v1_5_decode
+//
+// Description: Strip PKCS #1 header
+//
+// Input: Sig The encoded data to decode
+// siglen The length of the encoded data (octets)
+//
+// Output: CRYPT_OK if successful
+//
+//**********************************************************************
+//<AMI_PHDR_END>
+int pkcs_1_v1_5_decode(const UINT8 *hash, size_t hashlen, const UINT8 *sig, unsigned long siglen);
+
+// 4. SHA hashing
+//<AMI_PHDR_START>
+//----------------------------------------------------------------------
+//
+// Procedure: md5_vector
+//
+// Description: MD5 hash for data vector
+//
+// Input:
+// num_elem: Number of elements in the data vector
+// addr: Pointers to the data areas
+// len: Lengths of the data blocks
+// mac: Buffer for the hash
+//
+// Output: none
+//
+//----------------------------------------------------------------------
+//<AMI_PHDR_END>
+void md5_vector(size_t num_elem, const UINT8 *addr[], const size_t *len, UINT8 *mac);
+
+//<AMI_PHDR_START>
+//----------------------------------------------------------------------
+//
+// Procedure: sha1_vector
+//
+// Description: SHA-1 hash for data vector
+//
+// Input:
+// num_elem: Number of elements in the data vector
+// addr: Pointers to the data areas
+// len: Lengths of the data blocks
+// mac: Buffer for the hash
+//
+// Output: none
+//
+//----------------------------------------------------------------------
+//<AMI_PHDR_END>
+void sha1_vector(size_t num_elem, const UINT8 *addr[], const size_t *len, UINT8 *mac);
+
+//<AMI_PHDR_START>
+//----------------------------------------------------------------------
+//
+// Procedure: sha256_vector
+//
+// Description: SHA256 hash for data vector
+//
+// Input:
+// num_elem: Number of elements in the data vector
+// addr: Pointers to the data areas
+// len: Lengths of the data blocks
+// mac: Buffer for the hash
+//
+// Output: none
+//
+//----------------------------------------------------------------------
+//<AMI_PHDR_END>
+void sha256_vector(size_t num_elem, const UINT8 *addr[], const size_t *len, UINT8 *mac);
+
+// 5. Pkcs7/x509 certificates
+//<AMI_PHDR_START>
+//----------------------------------------------------------------------
+//
+// Procedure: x509_certificate_parse
+//
+// Description: Parse a X.509 certificate in DER format
+// Caller is responsible for freeing the returned certificate by calling
+// x509_certificate_free().
+//
+// Input:
+// buf: Pointer to the X.509 certificate in DER format
+// len: Buffer length
+//
+// Output: Pointer to the parsed certificate or %NULL on failure
+//
+//----------------------------------------------------------------------
+//<AMI_PHDR_END>
+struct x509_certificate *x509_certificate_parse(const UINT8 *buf, size_t len);
+
+//<AMI_PHDR_START>
+//----------------------------------------------------------------------
+//
+// Procedure: x509_certificate_chain_validate
+//
+// Description: Validate X.509 certificate chain
+//
+// Input:
+// trusted: List of trusted certificates
+// chain: Certificate chain to be validated (first chain must be issued by
+// igned by the second certificate in the chain and so on)
+// reason: Buffer for returning failure reason (X509_VALIDATE_*)
+//
+// Output: 0 if chain is valid, -1 if not
+//
+//----------------------------------------------------------------------
+//<AMI_PHDR_END>
+int x509_certificate_chain_validate(struct x509_certificate *trusted, struct x509_certificate *chain, int *reason);
+
+//<AMI_PHDR_START>
+//----------------------------------------------------------------------
+//
+// Procedure: Pkcs7_parse_Authenticode_certificate
+//
+// Description: Parse a Pkcs7 Authenticode certificate in DER format
+// Caller is responsible for freeing the returned certificate by calling
+// Pkcs7_certificate_free().
+//
+// Input:
+// buf: Pointer to the Pkcs7 Authenticode SignedData in DER format
+// len: Buffer length
+//
+// Output: Pointer to the parsed certificate or %NULL on failure
+//
+//----------------------------------------------------------------------
+//<AMI_PHDR_END>
+struct pkcs7_signed_data_st * Pkcs7_parse_Authenticode_certificate(const UINT8 *buf, size_t len);
+
+//<AMI_PHDR_START>
+//----------------------------------------------------------------------
+//
+// Procedure: Pkcs7_certificate_validate_digest
+//
+// Description: Verify certificate signature
+//
+// Input:
+// SignedData: Complete PKCS certificate
+// SignCert: Signing certificate containing the public key
+//
+// Output: 0 if cert has a valid signature that was signed by the issuer, -1 if not
+//
+//----------------------------------------------------------------------
+//<AMI_PHDR_END>
+int Pkcs7_certificate_validate_digest(struct pkcs7_signed_data_st *SignedData, struct x509_certificate *SignCert,
+ UINT8 *fileHash, size_t hashLen);
+
+//<AMI_PHDR_START>
+//----------------------------------------------------------------------
+//
+// Procedure: PKCS7_return_signing_cerificate
+//
+// Description: Return certificate with signer's public key
+//
+// Input:
+// SignedData: List of trusted certificates
+//
+// Output: cert if chain is valid, NULL if not found
+//
+//----------------------------------------------------------------------
+//<AMI_PHDR_END>
+struct x509_certificate
+ * Pkcs7_return_signing_cerificate(struct pkcs7_signed_data_st *SignedData);
+
+//<AMI_PHDR_START>
+//----------------------------------------------------------------------
+//
+// Procedure: Pkcs7_return_timestamp_signing_cerificate
+//
+// Description: Return timestamps root signing certificate
+//
+// Input:
+// SignedData: List of trusted certificates
+//
+// Output: cert if chain is valid, NULL if not found
+//
+//----------------------------------------------------------------------
+//<AMI_PHDR_END>
+struct x509_certificate
+ * Pkcs7_return_timestamp_signing_cerificate(struct pkcs7_signed_data_st *SignedData);
+
+//<AMI_PHDR_START>
+//----------------------------------------------------------------------
+//
+// Procedure: Pkcs7_x509_certificate_chain_validate
+//
+// Description: Validate Pkcs7 certificate chain
+//
+// Input:
+// trusted: List of trusted certificates
+// chain: Certificate chain to be validated (first chain must be issued by
+// igned by the second certificate in the chain and so on)
+// reason: Buffer for returning failure reason (X509_VALIDATE_*)
+//
+// Output: 0 if chain is valid, -1 if not
+//
+//----------------------------------------------------------------------
+//<AMI_PHDR_END>
+int Pkcs7_x509_certificate_chain_validate(struct pkcs7_signed_data_st *SignedData,
+ struct x509_certificate *trusted, int *reason);
+
+//<AMI_PHDR_START>
+//----------------------------------------------------------------------
+//
+// Procedure: Pkcs7_return_cerificate_ptr
+//
+// Description: Return pointer within DER buffer to:
+// 1. Signing certificate
+// 2. Root CA certificate that is used to sign Signing certificate
+//
+// Input:
+// SignedData: List of trusted certificates
+//
+// Output: cert if chain is valid, -1 if not found
+//
+//----------------------------------------------------------------------
+//<AMI_PHDR_END>
+int Pkcs7_return_cerificate_ptr(struct pkcs7_signed_data_st *SignedData,
+ UINT8** CAcert, size_t* CAcert_len,
+ UINT8** SignCert, size_t* SignCert_len);
+
+//<AMI_PHDR_START>
+//----------------------------------------------------------------------
+//
+// Procedure: Pkcs7_x509_return_signing_Key
+//
+// Description: Extract n-Modulus of a Signing Key from x509 certificate
+//
+// Input:
+// SignedData: Pkcs7 certificate structure
+//
+// Output: 0-key present, -1 if not found
+//
+//----------------------------------------------------------------------
+//<AMI_PHDR_END>
+int Pkcs7_x509_return_signing_Key(struct pkcs7_signed_data_st *SignedData,
+ UINT8 **public_key, size_t *public_key_len);
+
+//<AMI_PHDR_START>
+//----------------------------------------------------------------------
+//
+// Procedure: Pkcs7_x509_return_Cert_pubKey
+//
+// Description: Extract n-Modulus from an x509 Key certificate
+//
+// Input:
+// pCert: DER encoded x509 certificate
+//
+// Output: 0-key present, -1 if not found
+//
+//----------------------------------------------------------------------
+//<AMI_PHDR_END>
+int Pkcs7_x509_return_Cert_pubKey(UINT8 *pCert, size_t cert_len,
+ UINT8 **public_key, size_t *public_key_len);
+
+//<AMI_PHDR_START>
+//----------------------------------------------------------------------
+//
+// Procedure: Pkcs7_return_digestAlgorithm
+//
+// Description: Return digestAlgorithm type
+//
+// Input:
+// PKCS7cert: Pkcs7 certificate structure
+//
+// Output: cert if chain is valid, -1 if not found
+//
+//----------------------------------------------------------------------
+//<AMI_PHDR_END>
+int Pkcs7_return_digestAlgorithm(struct pkcs7_signed_data_st *PKCS7cert, UINT8* HashType);
+
+//<AMI_PHDR_START>
+//----------------------------------------------------------------------
+//
+// Procedure: Pkcs7_x509_certificate_chain_validate_with_timestamp
+//
+// Description: Common routine to validate Pkcs7 certificate chain and revoked time stamped certs
+// Supported RFC6131 TimeStampToken format
+// Input:
+// SignedData: Pkcs7 certificate chain to be validated (first chain must be issued by
+// signed by the second certificate in the chain and so on)
+// trusted : List of trusted x509 certificates
+// revokeInfo: Hash certificate
+// action: Buffer for returning either result of operation or intermediate data, e.g TimeOfSigning
+//
+// Output: 0 if chain is valid, -1 if not
+//
+//----------------------------------------------------------------------
+//<AMI_PHDR_END>
+typedef struct pkcs7_cert_revoke_info {
+ UINT8 *ToBeSignedHash;
+ size_t ToBeSignedHashLen;
+};
+int Pkcs7_x509_certificate_chain_validate_with_timestamp(
+ struct pkcs7_signed_data_st *SignedData,
+ BOOLEAN bTimeStampCert,
+ struct x509_certificate *trusted,
+ struct pkcs7_cert_revoke_info *revokeInfo,
+ int *action);
+
+//<AMI_PHDR_START>
+//----------------------------------------------------------------------
+// Procedure: os_mktime - Convert broken-down time into seconds since 1970-01-01
+//
+// Input:
+// year: Four digit year
+// month: Month (1 .. 12)
+// day: Day of month (1 .. 31)
+// hour: Hour (0 .. 23)
+// min: Minute (0 .. 59)
+// sec: Second (0 .. 60)
+// @t: Buffer for returning calendar time representation
+// (seconds since 1970-01-01 00:00:00)
+//
+// Output: int
+// 0 on success, -1 on failure
+//
+// Note: The result is in seconds from Epoch, i.e., in UTC, not in local time
+// which is used by POSIX mktime().
+
+//----------------------------------------------------------------------
+//<AMI_PHDR_END>
+typedef long os_time_t;
+int os_mktime(int year, int month, int day, int hour, int min, int sec,
+ os_time_t *t);
+
+//<AMI_PHDR_START>
+//----------------------------------------------------------------------
+//
+// Procedure: Pkcs7_certificate_validate_timestamp_digest
+//
+// Description: Validate RFC6131 TimeStampToken digest
+//
+// Input: PKCS7 Certificate
+//
+// Output: 0 if chain is valid, -1 if not
+//
+//----------------------------------------------------------------------
+//<AMI_PHDR_END>
+int Pkcs7_certificate_validate_timestamp_digest(struct pkcs7_signed_data_st *SignedData, os_time_t *TimeOfSign);
+
+#endif /* CRYPTOLIB_H */
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2013, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Pkwy, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+//**********************************************************************
diff --git a/Include/CryptoAPIIncludes.cif b/Include/CryptoAPIIncludes.cif
new file mode 100644
index 0000000..8ffe466
--- /dev/null
+++ b/Include/CryptoAPIIncludes.cif
@@ -0,0 +1,10 @@
+<component>
+ name = "Crypto API Includes"
+ category = ModulePart
+ LocalRoot = "Include\"
+ RefName = "CryptoIncludes"
+[files]
+"AmiCertificate.h"
+"Protocol\AmiDigitalSignature.h"
+"PPI\CryptoPPI.h"
+<endComponent>
diff --git a/Include/CryptoLibInc.cif b/Include/CryptoLibInc.cif
new file mode 100644
index 0000000..d2e2217
--- /dev/null
+++ b/Include/CryptoLibInc.cif
@@ -0,0 +1,9 @@
+<component>
+ name = "Crypto LIB Includes"
+ category = ModulePart
+ LocalRoot = "Include\"
+ RefName = "CryptoLibInc"
+[files]
+"CryptLib.h"
+"BaseCryptLib.h"
+<endComponent>
diff --git a/Include/CsmProtocols.cif b/Include/CsmProtocols.cif
new file mode 100644
index 0000000..1d5275a
--- /dev/null
+++ b/Include/CsmProtocols.cif
@@ -0,0 +1,13 @@
+<component>
+ name = "CSM Protocols"
+ category = ModulePart
+ LocalRoot = "include"
+ RefName = "CsmProtocols"
+[files]
+"protocol\LegacyInterrupt.h" = "Protocols"
+"Protocol\LegacyBiosPlatform.h"
+"Protocol\LegacyBios.h"
+"Protocol\CsmPlatform.h"
+"Protocol\LegacyBiosExt.h"
+"Protocol\CsmVideoPolicy.h"
+<endComponent>
diff --git a/Include/DXE.h b/Include/DXE.h
new file mode 100644
index 0000000..5934dae
--- /dev/null
+++ b/Include/DXE.h
@@ -0,0 +1,266 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2005, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/BIN/Core/Include/DXE.h 5 2/05/11 1:54p Artems $
+//
+// $Revision: 5 $
+//
+// $Date: 2/05/11 1:54p $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Core/Include/DXE.h $
+//
+// 5 2/05/11 1:54p Artems
+// Changed DXE_SERVICES_REVISION to match PI_SPECIFICATION version
+//
+// 4 10/12/06 1:00p Felixp
+//
+// 3 10/07/06 10:17a Felixp
+// UEFI 2.0 definitions added
+//
+// 2 3/04/05 10:24a Mandal
+//
+// 1 1/28/05 12:44p Felixp
+//
+// 2 1/18/05 3:21p Felixp
+// PrintDebugMessage renamed to Trace
+//
+// 1 12/23/04 9:41a Felixp
+//
+// 6 9/24/04 9:01p Yakovlevs
+//
+// 5 3/26/04 12:44a Felixp
+//
+// 4 3/23/04 4:56p Felixp
+//
+// 3 3/19/04 10:30a Markw
+// Added HOB_LIST_GUID.
+//
+// 2 3/03/04 5:04p Felixp
+//
+// 1 2/26/04 3:23p Felixp
+//
+//**********************************************************************
+//<AMI_FHDR_START>
+//
+// Name: dxe.h
+//
+// Description: DXE definitions
+//
+//<AMI_FHDR_END>
+//**********************************************************************
+#ifndef __DXE__H__
+#define __DXE__H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+#include <efi.h>
+
+#define DXE_SERVICES_TABLE_GUID \
+ {0x5ad34ba,0x6f02,0x4214,0x95,0x2e,0x4d,0xa0,0x39,0x8e,0x2b,0xb9}
+#define HOB_LIST_GUID \
+ {0x7739f24c,0x93d7,0x11d4,0x9a,0x3a,0x0,0x90,0x27,0x3f,0xc1,0x4d}
+#define EFI_APRIORI_GUID \
+ {0xfc510ee7,0xffdc,0x11d4,0xbd,0x41,0x0,0x80,0xc7,0x3c,0x88,0x81}
+
+#define DXE_SERVICES_SIGNATURE 0x565245535f455844
+#ifndef PI_SPECIFICATION_VERSION
+#define DXE_SERVICES_REVISION 91
+#else
+#define DXE_SERVICES_REVISION PI_SPECIFICATION_VERSION
+#endif
+
+//Let's make it backward compatible
+//#if EFI_SPECIFICATION_VERSION<0x20000
+//#if EFI_SPECIFICATION_VERSION<0x20000
+// Additional event types defined by DXE CIS
+#define EVT_NOTIFY_SIGNAL_ALL 0x00000400
+#define EVT_SIGNAL_READY_TO_BOOT 0x00000203
+#define EVT_SIGNAL_LEGACY_BOOT 0x00000204
+//#endif
+
+//Legacy boot event group defined by PI DXE CIS 1.0
+#define EFI_EVENT_LEGACY_BOOT_GUID \
+ { 0x2a571201, 0x4966, 0x47f6, 0x8b, 0x86, 0xf3, 0x1e, 0x41, 0xf3, 0x2f, 0x10 }
+#define EFI_EVENT_GROUP_DXE_DISPATCH \
+ {0x7081e22f, 0xcac6, 0x4053, 0x94, 0x68, 0x67, 0x57, 0x82, 0xcf, 0x88, 0xe5}
+
+//Define default memory attributes for MMIO and System Memory
+#define GCD_COMMON_MMIO_CAPS (EFI_MEMORY_UC | EFI_MEMORY_WT | EFI_MEMORY_WB | EFI_MEMORY_WP | EFI_MEMORY_RUNTIME)
+
+// Global Coherencey Domain types
+typedef enum {
+ EfiGcdMemoryTypeNonExistent,
+ EfiGcdMemoryTypeReserved,
+ EfiGcdMemoryTypeSystemMemory,
+ EfiGcdMemoryTypeMemoryMappedIo,
+ EfiGcdMemoryTypeMaximum
+}EFI_GCD_MEMORY_TYPE;
+
+typedef enum {
+ EfiGcdIoTypeNonExistent,
+ EfiGcdIoTypeReserved,
+ EfiGcdIoTypeIo,
+ EfiGcdIoTypeMaximum
+} EFI_GCD_IO_TYPE;
+
+typedef enum {
+ EfiGcdAllocateAnySearchBottomUp,
+ EfiGcdAllocateMaxAddressSearchBottomUp,
+ EfiGcdAllocateAddress,
+ EfiGcdAllocateAnySearchTopDown,
+ EfiGcdAllocateMaxAddressSearchTopDown,
+ EfiGcdMaxAllocateType
+} EFI_GCD_ALLOCATE_TYPE;
+
+typedef struct {
+ EFI_PHYSICAL_ADDRESS BaseAddress;
+ UINT64 Length;
+ UINT64 Capabilities;
+ UINT64 Attributes;
+ EFI_GCD_MEMORY_TYPE GcdMemoryType;
+ EFI_HANDLE ImageHandle;
+ EFI_HANDLE DeviceHandle;
+} EFI_GCD_MEMORY_SPACE_DESCRIPTOR;
+
+typedef struct {
+ EFI_PHYSICAL_ADDRESS BaseAddress;
+ UINT64 Length;
+ EFI_GCD_IO_TYPE GcdIoType;
+ EFI_HANDLE ImageHandle;
+ EFI_HANDLE DeviceHandle;
+} EFI_GCD_IO_SPACE_DESCRIPTOR;
+
+typedef EFI_STATUS (*EFI_ADD_MEMORY_SPACE)(
+ IN EFI_GCD_MEMORY_TYPE GcdMemoryType,
+ IN EFI_PHYSICAL_ADDRESS BaseAddress,
+ IN UINT64 Length, IN UINT64 Capabilities
+);
+
+typedef EFI_STATUS (*EFI_ADD_IO_SPACE)(
+ IN EFI_GCD_IO_TYPE GcdIoType, IN EFI_PHYSICAL_ADDRESS BaseAddress,
+ IN UINT64 Length
+);
+
+
+typedef EFI_STATUS (*EFI_GET_MEMORY_SPACE_DESCRIPTOR)(
+ IN EFI_PHYSICAL_ADDRESS BaseAddress,
+ OUT EFI_GCD_MEMORY_SPACE_DESCRIPTOR *Descriptor
+);
+
+typedef EFI_STATUS (*EFI_GET_IO_SPACE_DESCRIPTOR)(
+ IN EFI_PHYSICAL_ADDRESS BaseAddress,
+ OUT EFI_GCD_IO_SPACE_DESCRIPTOR *Descriptor
+);
+
+typedef EFI_STATUS (*EFI_ALLOCATE_MEMORY_SPACE)(
+ IN EFI_GCD_ALLOCATE_TYPE GcdAllocateType,
+ IN EFI_GCD_MEMORY_TYPE GcdMemoryType, IN UINTN Alignment,
+ IN UINT64 Length, IN OUT EFI_PHYSICAL_ADDRESS *BaseAddress,
+ IN EFI_HANDLE ImageHandle,IN EFI_HANDLE DeviceHandle OPTIONAL
+);
+
+typedef EFI_STATUS (*EFI_ALLOCATE_IO_SPACE)(
+ IN EFI_GCD_ALLOCATE_TYPE GcdAllocateType,
+ IN EFI_GCD_IO_TYPE GcdIoType, IN UINTN Alignment,
+ IN UINT64 Length, IN OUT EFI_PHYSICAL_ADDRESS *BaseAddress,
+ IN EFI_HANDLE ImageHandle, IN EFI_HANDLE DeviceHandle OPTIONAL
+);
+
+typedef EFI_STATUS (*EFI_FREE_MEMORY_SPACE)(
+ IN EFI_PHYSICAL_ADDRESS BaseAddress, IN UINT64 Length
+);
+
+typedef EFI_STATUS (*EFI_FREE_IO_SPACE)(
+ IN EFI_PHYSICAL_ADDRESS BaseAddress, IN UINT64 Length
+);
+
+typedef EFI_STATUS (*EFI_SET_MEMORY_SPACE_ATTRIBUTES)(
+ IN EFI_PHYSICAL_ADDRESS BaseAddress,
+ IN UINT64 Length, IN UINT64 Attributes
+);
+
+typedef EFI_STATUS (*EFI_REMOVE_MEMORY_SPACE)(
+ IN EFI_PHYSICAL_ADDRESS BaseAddress, IN UINT64 Length
+);
+
+typedef EFI_STATUS (*EFI_REMOVE_IO_SPACE)(
+ IN EFI_PHYSICAL_ADDRESS BaseAddress, IN UINT64 Length
+);
+
+typedef EFI_STATUS (*EFI_GET_MEMORY_SPACE_MAP)(
+ OUT UINTN *NumberOfDescriptors,
+ OUT EFI_GCD_MEMORY_SPACE_DESCRIPTOR **MemorySpaceMap
+);
+
+typedef EFI_STATUS (*EFI_GET_IO_SPACE_MAP)(
+ OUT UINTN *NumberOfDescriptors,
+ OUT EFI_GCD_IO_SPACE_DESCRIPTOR **IoSpaceMap
+);
+
+// Dispatcher Services
+typedef EFI_STATUS (*EFI_DISPATCH) ();
+typedef EFI_STATUS (*EFI_SCHEDULE) (
+ IN EFI_HANDLE FirmwareVolumeHandle, IN EFI_GUID *FileName
+);
+typedef EFI_STATUS (*EFI_TRUST) (
+ IN EFI_HANDLE FirmwareVolumeHandle, IN EFI_GUID *FileName
+);
+typedef EFI_STATUS (*EFI_PROCESS_FIRMWARE_VOLUME) (
+ IN VOID *FirmwareVolumeHeader, IN UINTN Size,
+ OUT EFI_HANDLE *FirmwareVolumeHandle
+);
+
+typedef struct {
+ EFI_TABLE_HEADER Hdr;
+ // Global Coherency Domain Services
+ EFI_ADD_MEMORY_SPACE AddMemorySpace;
+ EFI_ALLOCATE_MEMORY_SPACE AllocateMemorySpace;
+ EFI_FREE_MEMORY_SPACE FreeMemorySpace;
+ EFI_REMOVE_MEMORY_SPACE RemoveMemorySpace;
+ EFI_GET_MEMORY_SPACE_DESCRIPTOR GetMemorySpaceDescriptor;
+ EFI_SET_MEMORY_SPACE_ATTRIBUTES SetMemorySpaceAttributes;
+ EFI_GET_MEMORY_SPACE_MAP GetMemorySpaceMap;
+ EFI_ADD_IO_SPACE AddIoSpace;
+ EFI_ALLOCATE_IO_SPACE AllocateIoSpace;
+ EFI_FREE_IO_SPACE FreeIoSpace;
+ EFI_REMOVE_IO_SPACE RemoveIoSpace;
+ EFI_GET_IO_SPACE_DESCRIPTOR GetIoSpaceDescriptor;
+ EFI_GET_IO_SPACE_MAP GetIoSpaceMap;
+ // Dispatcher Services
+ EFI_DISPATCH Dispatch;
+ EFI_SCHEDULE Schedule;
+ EFI_TRUST Trust;
+ // Service to process a single firmware volume found in a capsule
+ EFI_PROCESS_FIRMWARE_VOLUME ProcessFirmwareVolume;
+} DXE_SERVICES;
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2005, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
diff --git a/Include/DataHubSubClass.h b/Include/DataHubSubClass.h
new file mode 100644
index 0000000..fd373a4
--- /dev/null
+++ b/Include/DataHubSubClass.h
@@ -0,0 +1,94 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2005, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/BIN/Core/Include/DataHubSubClass.h 1 10/10/05 4:26p Markw $
+//
+// $Revision: 1 $
+//
+// $Date: 10/10/05 4:26p $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Core/Include/DataHubSubClass.h $
+//
+// 1 10/10/05 4:26p Markw
+//
+//**********************************************************************
+//<AMI_FHDR_START>
+//
+// Name: DataHubSubClass.h
+//
+// Description: DataHubSubClass definitions.
+//
+//<AMI_FHDR_END>
+//**********************************************************************
+
+#ifndef __DATAHUB_SUBCLASS_H__
+#define __DATAHUB_SUBCLASS_H__
+
+#include <efi.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef struct {
+ UINT32 Version;
+ UINT32 HeaderSize;
+ UINT16 Instance;
+ UINT16 SubInstance;
+ UINT32 RecordType;
+} EFI_SUBCLASS_TYPE1_HEADER;
+
+typedef struct {
+ INT16 Value;
+ INT16 Exponent;
+} EFI_EXP_BASE10_DATA;
+
+typedef struct {
+ UINT16 Value;
+ UINT16 Exponent;
+} EFI_EXP_BASE2_DATA;
+
+typedef struct {
+ EFI_GUID ProducerName;
+ UINT16 Instance;
+ UINT16 SubInstance;
+} EFI_INTER_LINK_DATA;
+
+typedef UINT16 STRING_REF;
+
+
+
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2005, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
diff --git a/Include/EFI.h b/Include/EFI.h
new file mode 100644
index 0000000..78c6225
--- /dev/null
+++ b/Include/EFI.h
@@ -0,0 +1,1234 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2009, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/BIN/Core/Include/EFI.h 30 7/20/12 9:57a Artems $
+//
+// $Revision: 30 $
+//
+// $Date: 7/20/12 9:57a $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Core/Include/EFI.h $
+//
+// 30 7/20/12 9:57a Artems
+// [TAG] EIP N/A
+// [Category] Spec Update
+// [Severity] Minor
+// [Description] Added new structure name to be compliant with UEFI spec
+// [Files] Efi.h
+//
+// 29 5/24/12 4:37p Artems
+// [TAG] EIP N/A
+// [Category] Spec Update
+// [Severity] Minor
+// [Description] Updates structure members name according to UEFI spec
+// [Files] Efi.h
+//
+// 28 5/13/11 6:34p Artems
+// Added new Capsule flag, that was introduced in UEFI spec v.2.3.1
+//
+// 27 5/06/11 3:22p Artems
+// EIP 59569: Minor changes introduced in UEFI spec v. 2.3.1
+//
+// 26 5/02/11 5:34p Artems
+// EIP 59569: Minor changes introduced in UEFI spec v. 2.3.1
+//
+// 25 2/05/11 1:47p Artems
+// Added PI 1.1 Error and Warning codes
+//
+// 24 11/19/09 12:49p Felixp
+// UEFI 2.1 specific definitions are added.
+//
+// 23 11/13/09 4:06p Felixp
+// GUID_VARIABLE_DECLARATION macro declaration is updated to fix linker
+// warnings.
+//
+// 22 8/21/09 4:19p Felixp
+// EFI_INVALID_LANGUAGE error code is added
+//
+// 20 11/18/08 10:18a Felixp
+// GLOBAL_REMOVE_IF_UNREFERENCED macro added
+//
+// 19 11/11/08 2:38p Felixp
+// Disable warning that make it impossible to compile at /W4
+//
+// 18 10/12/06 12:59p Felixp
+// UEFI2.0 compatibility: PEI/DXE-specific error codes updated.
+//
+// 17 10/09/06 11:49a Felixp
+// Definition of EFI warnings fixed
+//
+// 16 10/07/06 10:17a Felixp
+// UEFI 2.0 definitions added
+//
+// 15 9/13/06 2:51p Felixp
+// CHAR8 and CHAR16 changed to unsigned types.
+//
+// 14 8/24/06 9:09a Felixp
+// x64 support
+//
+// 13 5/19/06 10:18p Felixp
+// Device Path Length changed from UINT16 to UINT8[2]
+//
+// 5 4/25/05 10:01a Felixp
+// type definition for EFI_LOAD_OPTION added
+//
+// 4 4/21/05 7:57p Felixp
+// values for AMI Status Codes changed to be in the OEM range defined by
+// EFI Spec.
+//
+// 2 4/05/05 9:14a Felixp
+// Boot option attributes added
+//
+//
+// 2 1/18/05 3:21p Felixp
+// PrintDebugMessage renamed to Trace
+//
+// 23 2/20/04 3:16p Markw
+// Arranges some of the structures and defines into columns.
+//
+// 19 2/09/04 9:48a Felixp
+// EFI services added
+//
+// 18 2/06/04 2:46a Felixp
+// - Support for VC6 tools
+// - bug fixes
+// - component AddOn added
+//
+// 17 2/05/04 2:59p Markw
+// Added the rest of memory allocation typedefs and rase lower TPL
+// typedefs.
+//
+// 16 2/04/04 12:35a Felixp
+// EFI_PAGE_SIZE defined
+//
+// 15 1/30/04 4:58p Felixp
+// BOOLEAN changed from char to unsigned char
+// VOID changed from typedef to define
+//
+// 14 1/22/04 11:54a Markw
+// Added more BootServices defintions.
+//
+// 13 1/18/04 1:10p Felixp
+// EFI_ERROR defined
+//
+// 12 1/15/04 6:33p Markw
+// Added RTC Services to Runtime Table and InstallMultipleProtocolService
+// to Boot Service Table.
+//
+// 11 1/06/04 5:01p Yakovlevs
+//
+// 10 1/05/04 3:38p Markw
+// Added EFI_VIRTUAL_ADDRESS typedef
+//
+// 9 1/05/04 3:28p Markw
+// Added structure EFI_MEMORY_DESCRIPTOR and definitions for memory
+// attributes.
+//
+// 8 12/24/03 2:09p Felixp
+// TRUE and FALSE added
+//
+// 7 12/23/03 2:27p Felixp
+// __w64 added to INTN and UINTN definitions to suppress compiler warnings
+//
+// 6 12/22/03 12:57p Felixp
+// Variable attributes added
+//
+// 4 12/11/03 4:08p Markw
+// Adding defines for errors and warnings and NULL.
+//
+// 3 12/11/03 3:17p Markw
+// Added some memory definitions.
+//
+// 2 12/11/03 10:30a Felixp
+// bugs in type definition fixed
+//
+// 1 12/08/03 4:04p Felixp
+//
+//**********************************************************************
+//<AMI_FHDR_START>
+//
+// Name: EFI.H
+//
+// Description:
+// EFI Header file. It has standard definitions defined by the
+// UEFI Specification
+//
+//<AMI_FHDR_END>
+//**********************************************************************
+#ifndef __EFI__H__
+#define __EFI__H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+#if _MSC_EXTENSIONS
+// Disable warning that make it impossible to compile at /W4
+// Disabling bitfield type checking warnings.
+#pragma warning ( disable : 4214 )
+// Disabling the unreferenced formal parameter warnings.
+#pragma warning ( disable : 4100 )
+// Disable slightly different base types warning as CHAR8 * can not be set
+// to a constant string.
+#pragma warning ( disable : 4057 )
+// ASSERT(FALSE) or while (TRUE) are legal constructes so supress this warning
+#pragma warning ( disable : 4127 )
+
+// The Microsoft C compiler can removed references to unreferenced data items
+// if the /OPT:REF linker option is used. We defined a macro as this is a
+// a non standard extension.
+#define GLOBAL_REMOVE_IF_UNREFERENCED __declspec(selectany)
+#else //#if _MSC_EXTENSIONS
+#define GLOBAL_REMOVE_IF_UNREFERENCED
+#endif
+//**********************************************************************
+//<AMI_GHDR_START>
+//
+// Name: Types (Common EFI Data Types)
+//
+// Description:
+// BOOLEAN - Logical Boolean. 1-byte value containing a 0 for FALSE or a 1 for TRUE. Other values are undefined.
+// INTN - Signed value of native width. (4 bytes on IA-32, 8 bytes on Itanium processor instructions)
+// UINTN - Unsigned value of native width. (4 bytes on IA-32, 8 bytes on Itanium processor instructions)
+// INT8 - 1-byte signed value.
+// UINT8 - 1-byte unsigned value.
+// INT16 - 2-byte signed value.
+// UINT16 - 2-byte unsigned value.
+// INT32 - 4-byte signed value.
+// UINT32 - 4-byte unsigned value.
+// INT64 - 8-byte signed value.
+// UINT64 - 8-byte unsigned value.
+// CHAR8 - 1-byte Character.
+// CHAR16 - 2-byte Character. Unless otherwise specified all strings are stored in the UTF-16 encoding format as defined by Unicode 2.1 and ISO/IEC 10646 standards.
+// VOID - Undeclared type.
+// EFI_GUID - 128-bit buffer containing a unique identifier value. Unless otherwise specified, aligned on a 64-bit boundary.
+// EFI_STATUS - Status code. Type INTN.
+// EFI_HANDLE - A collection of related interfaces. Type VOID *.
+// EFI_EVENT - Handle to an event structure. Type VOID *.
+// EFI_LBA - Logicalbl ock address. Type UINT64.
+// EFI_TPL - Task priority level. Type UINTN.
+// EFI_MAC_ADDRESS - 32-byte buffer containing a network Media Access Controlad dress.
+// EFI_IPv4_ADDRESS - 4-byte buffer. An IPv4 internet protocoladdress .
+// EFI_IPv6_ADDRESS - 16-byte buffer. An IPv6 internet protocoladdr ess.
+// EFI_IP_ADDRESS - 16-byte buffer aligned on a 4-byte boundary. An IPv4 or IPv6 internet protocol address.
+//<AMI_GHDR_END>
+//**********************************************************************
+typedef unsigned char BOOLEAN;
+#define TRUE 1
+#define FALSE 0
+#if !defined (_MSC_VER) || (_MSC_VER < 1300)
+#define __w64
+#endif
+#if defined(EFI64) || defined(EFIx64)
+typedef __int64 INTN;
+typedef unsigned __int64 UINTN;
+#else
+typedef int __w64 INTN;
+typedef unsigned __w64 UINTN;
+#endif
+typedef signed char INT8;
+typedef unsigned char UINT8;
+typedef short INT16;
+typedef unsigned short UINT16;
+typedef int INT32;
+typedef unsigned UINT32;
+typedef __int64 INT64;
+typedef unsigned __int64 UINT64;
+typedef unsigned char CHAR8;
+typedef unsigned short CHAR16;
+#define VOID void
+
+typedef struct{
+ UINT32 Data1;
+ UINT16 Data2;
+ UINT16 Data3;
+ UINT8 Data4[8];
+} EFI_GUID;
+
+typedef UINTN EFI_STATUS;
+typedef VOID* EFI_HANDLE;
+typedef VOID* EFI_EVENT;
+typedef UINT64 EFI_LBA;
+typedef UINTN EFI_TPL;
+
+typedef struct{
+ UINT8 mac[32];
+} EFI_MAC_ADDRESS;
+
+typedef UINT32 EFI_IPv4_ADDRESS;
+
+typedef struct{
+ UINT8 ip[16];
+} EFI_IPv6_ADDRESS;
+
+typedef union{
+ EFI_IPv4_ADDRESS ip4;
+ EFI_IPv6_ADDRESS ip6;
+}EFI_IP_ADDRESS;
+
+typedef enum {
+ AllocateAnyPages,
+ AllocateMaxAddress,
+ AllocateAddress,
+ MaxAllocateType
+} EFI_ALLOCATE_TYPE;
+
+typedef enum {
+ EfiReservedMemoryType,
+ EfiLoaderCode,
+ EfiLoaderData,
+ EfiBootServicesCode,
+ EfiBootServicesData,
+ EfiRuntimeServicesCode,
+ EfiRuntimeServicesData,
+ EfiConventionalMemory,
+ EfiUnusableMemory,
+ EfiACPIReclaimMemory,
+ EfiACPIMemoryNVS,
+ EfiMemoryMappedIO,
+ EfiMemoryMappedIOPortSpace,
+ EfiPalCode,
+ EfiMaxMemoryType
+} EFI_MEMORY_TYPE;
+
+typedef UINT64 EFI_PHYSICAL_ADDRESS;
+typedef UINT64 EFI_VIRTUAL_ADDRESS;
+
+//*******************************************************
+// Memory Descriptor Version Number
+//*******************************************************
+#define EFI_MEMORY_DESCRIPTOR_VERSION 1
+
+//EFI_MEMORY_DESCRIPTOR
+//*******************************************************
+typedef struct {
+ UINT32 Type;
+ EFI_PHYSICAL_ADDRESS PhysicalStart;
+ EFI_VIRTUAL_ADDRESS VirtualStart;
+ UINT64 NumberOfPages;
+ UINT64 Attribute;
+} EFI_MEMORY_DESCRIPTOR;
+
+
+#define EFI_PAGE_SIZE 4096
+
+//*******************************************************
+// Memory Attribute Definitions
+//*******************************************************
+// These types can be "ORed" together as needed.
+#define EFI_MEMORY_UC 0x0000000000000001
+#define EFI_MEMORY_WC 0x0000000000000002
+#define EFI_MEMORY_WT 0x0000000000000004
+#define EFI_MEMORY_WB 0x0000000000000008
+#define EFI_MEMORY_UCE 0x0000000000000010
+#define EFI_MEMORY_WP 0x0000000000001000
+#define EFI_MEMORY_RP 0x0000000000002000
+#define EFI_MEMORY_XP 0x0000000000004000
+#define EFI_MEMORY_RUNTIME 0x8000000000000000
+
+
+#define NULL 0
+
+//Error Codes and Warning Codes
+#define EFI_ERROR_BIT ((UINTN)1 << (sizeof(UINTN) * 8 - 1))
+#define PI_ERROR_BIT (EFI_ERROR_BIT | (EFI_ERROR_BIT >> 2))
+#define OEM_ERROR_BIT (EFI_ERROR_BIT | (EFI_ERROR_BIT >> 1))
+#define PI_WARNING_BIT (EFI_ERROR_BIT >> 2)
+#define EFI_SUCCESS 0
+
+#define EFI_ERROR(r) ( (r) & EFI_ERROR_BIT )
+
+#define EFI_LOAD_ERROR ( 1 | EFI_ERROR_BIT)
+#define EFI_INVALID_PARAMETER ( 2 | EFI_ERROR_BIT)
+#define EFI_UNSUPPORTED ( 3 | EFI_ERROR_BIT)
+#define EFI_BAD_BUFFER_SIZE ( 4 | EFI_ERROR_BIT)
+#define EFI_BUFFER_TOO_SMALL ( 5 | EFI_ERROR_BIT)
+#define EFI_NOT_READY ( 6 | EFI_ERROR_BIT)
+#define EFI_DEVICE_ERROR ( 7 | EFI_ERROR_BIT)
+#define EFI_WRITE_PROTECTED ( 8 | EFI_ERROR_BIT)
+#define EFI_OUT_OF_RESOURCES ( 9 | EFI_ERROR_BIT)
+#define EFI_VOLUME_CORRUPTED (10 | EFI_ERROR_BIT) // 0xa
+#define EFI_VOLUME_FULL (11 | EFI_ERROR_BIT) // 0xb
+#define EFI_NO_MEDIA (12 | EFI_ERROR_BIT) // 0xc
+#define EFI_MEDIA_CHANGED (13 | EFI_ERROR_BIT) // 0xd
+#define EFI_NOT_FOUND (14 | EFI_ERROR_BIT) // 0xe
+#define EFI_ACCESS_DENIED (15 | EFI_ERROR_BIT) // 0xf
+#define EFI_NO_RESPONSE (16 | EFI_ERROR_BIT) // 0x10
+#define EFI_NO_MAPPING (17 | EFI_ERROR_BIT) // 0x11
+#define EFI_TIMEOUT (18 | EFI_ERROR_BIT) // 0x12
+#define EFI_NOT_STARTED (19 | EFI_ERROR_BIT) // 0x13
+#define EFI_ALREADY_STARTED (20 | EFI_ERROR_BIT) // 0x14
+#define EFI_ABORTED (21 | EFI_ERROR_BIT) // 0x15
+#define EFI_ICMP_ERROR (22 | EFI_ERROR_BIT) // 0x16
+#define EFI_TFTP_ERROR (23 | EFI_ERROR_BIT) // 0x17
+#define EFI_PROTOCOL_ERROR (24 | EFI_ERROR_BIT) // 0x18
+#define EFI_INCOMPATIBLE_VERSION (25 | EFI_ERROR_BIT) // 0x19
+#define EFI_SECURITY_VIOLATION (26 | EFI_ERROR_BIT) // 0x1a
+#define EFI_CRC_ERROR (27 | EFI_ERROR_BIT) // 0x1b
+#if EFI_SPECIFICATION_VERSION<0x20000
+#define EFI_NOT_AVAILABLE_YET (28 | EFI_ERROR_BIT) // 0x1c
+#define EFI_UNLOAD_IMAGE (29 | EFI_ERROR_BIT) // 0x1d
+#else
+#define EFI_END_OF_MEDIA (28 | EFI_ERROR_BIT) // 0x1c
+#define EFI_END_OF_FILE (31 | EFI_ERROR_BIT) // 0x1f
+#define EFI_INVALID_LANGUAGE (32 | EFI_ERROR_BIT) // 0x20
+//PI Error Codes
+#define EFI_REQUEST_UNLOAD_IMAGE (1 | PI_ERROR_BIT)
+// The PI specification defines error as EFI_REQUEST_UNLOAD_IMAGE.
+// EFI_UNLOAD_IMAGE is here for backward compatibility.
+#define EFI_UNLOAD_IMAGE EFI_REQUEST_UNLOAD_IMAGE
+#define EFI_NOT_AVAILABLE_YET (2 | PI_ERROR_BIT)
+#define EFI_INTERRUPT_PENDING (0 | PI_ERROR_BIT)
+#endif
+// AMI Error Codes
+#define EFI_DBE_EOF (1 | OEM_ERROR_BIT)
+#define EFI_DBE_BOF (2 | OEM_ERROR_BIT)
+
+#define EFI_WARN_UNKNOWN_GLYPH ( 1 )
+#define EFI_WARN_DELETE_FAILURE ( 2 )
+#define EFI_WARN_WRITE_FAILURE ( 3 )
+#define EFI_WARN_BUFFER_TOO_SMALL ( 4 )
+//PI Warnings
+#define EFI_WARN_INTERRUPT_SOURCE_PENDING (0 | PI_WARNING_BIT)
+#define EFI_WARN_INTERRUPT_SOURCE_QUIESCED (1 | PI_WARNING_BIT)
+
+//**********************************************************************
+//<AMI_GHDR_START>
+//
+// Name: Modifiers (Modifiers for Common EFI Data Types)
+//
+// Description:
+// IN - Datum is passed to the function.
+// OUT - Datum is returned from the function.
+// OPTIONAL - Passing the datum to the function is optional, and a NULL may be passed if the value is not supplied.
+// EFIAPI - Defines the calling convention for EFI interfaces.
+//
+//<AMI_GHDR_END>
+//**********************************************************************
+#define IN
+#define OUT
+#define OPTIONAL
+#define EFIAPI
+#define CONST const
+
+typedef struct {
+ UINT64 Signature;
+ UINT32 Revision;
+ UINT32 HeaderSize;
+ UINT32 CRC32;
+ UINT32 Reserved;
+}EFI_TABLE_HEADER;
+
+//*******************************************************
+// Variable Attributes
+//*******************************************************
+#define EFI_VARIABLE_NON_VOLATILE 0x0000000000000001
+#define EFI_VARIABLE_BOOTSERVICE_ACCESS 0x0000000000000002
+#define EFI_VARIABLE_RUNTIME_ACCESS 0x0000000000000004
+#if EFI_SPECIFICATION_VERSION >= 0x2000A
+#define EFI_VARIABLE_HARDWARE_ERROR_RECORD 0x0000000000000008
+#define EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS 0x0000000000000010
+#define EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS 0x0000000000000020
+#define EFI_VARIABLE_APPEND_WRITE 0x0000000000000040
+#endif
+
+//*******************************************************
+//Efi Boot Services
+//*******************************************************
+
+//*******************************************************
+// Task Priority Levels
+//*******************************************************
+#define TPL_APPLICATION 4
+#define TPL_CALLBACK 8
+#define TPL_NOTIFY 16
+#define TPL_HIGH_LEVEL 31
+
+// Task Priority Services
+typedef EFI_TPL (*EFI_RAISE_TPL) (
+ IN EFI_TPL NewTpl
+);
+
+typedef VOID (*EFI_RESTORE_TPL) (
+ IN EFI_TPL OldTpl
+);
+
+// Memory Services
+typedef EFI_STATUS (*EFI_ALLOCATE_PAGES) (
+ IN EFI_ALLOCATE_TYPE Type,
+ IN EFI_MEMORY_TYPE MemoryType,
+ IN UINTN Pages,
+ IN OUT EFI_PHYSICAL_ADDRESS *Memory
+);
+
+typedef EFI_STATUS (*EFI_FREE_PAGES) (
+ IN EFI_PHYSICAL_ADDRESS Memory,
+ IN UINTN Pages
+);
+
+typedef EFI_STATUS (*EFI_GET_MEMORY_MAP) (
+ IN OUT UINTN *MemoryMapSize,
+ IN OUT EFI_MEMORY_DESCRIPTOR *MemoryMap,
+ OUT UINTN *MapKey,
+ OUT UINTN *DescriptorSize,
+ OUT UINT32 *DescriptorVersion
+);
+
+typedef EFI_STATUS (*EFI_ALLOCATE_POOL) (
+ IN EFI_MEMORY_TYPE PoolType,
+ IN UINTN Size,
+ OUT VOID **Buffer
+);
+
+typedef EFI_STATUS (*EFI_FREE_POOL) (
+ IN VOID *Buffer
+);
+
+// Event & Timer Services
+//*******************************************************
+// Event Types
+//*******************************************************
+// These types can be "ORed" together as needed. For example,
+// EVT_TIMER might be "Ored" with EVT_NOTIFY_WAIT or
+// EVT_NOTIFY_SIGNAL.
+#define EVT_TIMER 0x80000000
+#define EVT_RUNTIME 0x40000000
+#define EVT_RUNTIME_CONTEXT 0x20000000
+#define EVT_NOTIFY_WAIT 0x00000100
+#define EVT_NOTIFY_SIGNAL 0x00000200
+#define EVT_SIGNAL_EXIT_BOOT_SERVICES 0x00000201
+#define EVT_SIGNAL_VIRTUAL_ADDRESS_CHANGE 0x60000202
+//Extended event types defined in the DXE CIS
+#define EFI_EVENT_TIMER EVT_TIMER
+#define EFI_EVENT_RUNTIME EVT_RUNTIME
+#define EFI_EVENT_RUNTIME_CONTEXT EVT_RUNTIME_CONTEXT
+#define EFI_EVENT_NOTIFY_WAIT EVT_NOTIFY_WAIT
+#define EFI_EVENT_NOTIFY_SIGNAL EVT_NOTIFY_SIGNAL
+#define EFI_EVENT_NOTIFY_SIGNAL_ALL 0x00000400
+#define EFI_EVENT_SIGNAL_EXIT_BOOT_SERVICES EVT_SIGNAL_EXIT_BOOT_SERVICES
+#define EFI_EVENT_SIGNAL_VIRTUAL_ADDRESS_CHANGE EVT_SIGNAL_VIRTUAL_ADDRESS_CHANGE
+//Let's make it backward compatible
+//#if EFI_SPECIFICATION_VERSION<0x20000
+#define EFI_EVENT_SIGNAL_READY_TO_BOOT 0x00000203
+#define EFI_EVENT_SIGNAL_LEGACY_BOOT 0x00000204
+//#endif
+//*******************************************************
+// EFI_EVENT_NOTIFY
+//*******************************************************
+typedef VOID (EFIAPI *EFI_EVENT_NOTIFY) (
+ IN EFI_EVENT Event, IN VOID *Context
+);
+
+typedef EFI_STATUS (*EFI_CREATE_EVENT)(
+ IN UINT32 Type, IN EFI_TPL NotifyTpl,
+ IN EFI_EVENT_NOTIFY NotifyFunction,
+ IN VOID *NotifyContext, OUT EFI_EVENT *Event
+);
+//*******************************************************
+//EFI_TIMER_DELAY
+//*******************************************************
+//TODO: TimerTypeMax is not defined in EFI (UEFI) Spec. It is here just for compatibility with EDK
+typedef enum {
+ TimerCancel, TimerPeriodic, TimerRelative, TimerTypeMax
+} EFI_TIMER_DELAY;
+typedef EFI_STATUS (*EFI_SET_TIMER)(
+ IN EFI_EVENT Event, IN EFI_TIMER_DELAY Type,
+ IN UINT64 TriggerTime
+);
+typedef EFI_STATUS (*EFI_WAIT_FOR_EVENT)(
+ IN UINTN NumberOfEvents, IN EFI_EVENT *Event, OUT UINTN *Index
+);
+typedef EFI_STATUS (*EFI_SIGNAL_EVENT)(IN EFI_EVENT Event);
+typedef EFI_STATUS (*EFI_CLOSE_EVENT)(IN EFI_EVENT Event);
+typedef EFI_STATUS (*EFI_CHECK_EVENT)(IN EFI_EVENT Event);
+// Protocol Handler Services
+//**********************************************************************
+//<AMI_GHDR_START>
+// Name: EFI_INTERFACE_TYPE
+// Description: Enumeration type.
+// The only enumeration value currently defined is
+// EFI_NATIVE_INTERFACE
+// Refferals: see InstallProtocolInterface for more information about the type usage.
+//<AMI_GHDR_END>
+//**********************************************************************
+typedef enum { EFI_NATIVE_INTERFACE } EFI_INTERFACE_TYPE;
+typedef EFI_STATUS (*EFI_INSTALL_PROTOCOL_INTERFACE)(
+ IN OUT EFI_HANDLE *Handle, IN EFI_GUID *Protocol,
+ IN EFI_INTERFACE_TYPE InterfaceType, IN VOID *Interface
+);
+typedef EFI_STATUS (*EFI_REINSTALL_PROTOCOL_INTERFACE)(
+ IN EFI_HANDLE Handle, IN EFI_GUID *Protocol,
+ IN VOID *OldInterface, IN VOID *NewInterface
+);
+typedef EFI_STATUS (*EFI_UNINSTALL_PROTOCOL_INTERFACE)(
+ IN EFI_HANDLE Handle, IN EFI_GUID *Protocol,
+ IN VOID *Interface
+);
+typedef EFI_STATUS (*EFI_HANDLE_PROTOCOL)(
+ IN EFI_HANDLE Handle, IN EFI_GUID *Protocol,
+ OUT VOID **Interface
+);
+typedef EFI_STATUS (*EFI_REGISTER_PROTOCOL_NOTIFY)(
+ IN EFI_GUID *Protocol, IN EFI_EVENT Event,
+ OUT VOID **Registration
+);
+//**********************************************************************
+//<AMI_GHDR_START>
+// Name: EFI_LOCATE_SEARCH_TYPE
+// Description: Enumeration type.
+// Defines search type for the LocateHandle, LocateHandleBuffer,
+// and LocateProtocol functions.
+// AllHandles - Protocol and SearchKey are ignored and the function
+// returns an array of every handle in the system.
+// ByRegisterNotify - SearchKey supplies the Registration value returned by
+// RegisterProtocolNotify.The function returns the next handle
+// that is new or the registration. Only one handle is returned at a time,
+// and the caller must loop until no more handles are returned.
+// Protocol is ignored or this search type.
+// ByProtocol - All handles that support Protocol are returned.
+// SearchKey is ignored or this search type.
+//<AMI_GHDR_END>
+//**********************************************************************
+typedef enum {
+ AllHandles, ByRegisterNotify, ByProtocol
+} EFI_LOCATE_SEARCH_TYPE;
+typedef EFI_STATUS (*EFI_LOCATE_HANDLE)(
+ IN EFI_LOCATE_SEARCH_TYPE SearchType,
+ IN EFI_GUID *Protocol OPTIONAL, IN VOID *SearchKey OPTIONAL,
+ IN OUT UINTN *BufferSize, OUT EFI_HANDLE *Buffer
+);
+//*******************************************************
+// EFI_DEVICE_PATH_PROTOCOL
+//*******************************************************
+#pragma pack (push,1) //May not be alligned on a boundary.
+typedef struct _EFI_DEVICE_PATH {
+ UINT8 Type;
+ UINT8 SubType;
+ UINT8 Length[2];
+} EFI_DEVICE_PATH_PROTOCOL;
+#pragma pack (pop)
+typedef EFI_STATUS (*EFI_LOCATE_DEVICE_PATH)(
+ IN EFI_GUID *Protocol, IN OUT EFI_DEVICE_PATH_PROTOCOL **DevicePath,
+ OUT EFI_HANDLE *Device
+);
+typedef EFI_STATUS (*EFI_INSTALL_CONFIGURATION_TABLE)(
+ IN EFI_GUID *Guid, IN VOID *Table
+);
+// Image Services
+// Supported subsystem values
+#define EFI_IMAGE_SUBSYSTEM_EFI_APPLICATION 10
+#define EFI_IMAGE_SUBSYSTEM_EFI_BOOT_SERVICE_DRIVER 11
+#define EFI_IMAGE_SUBSYSTEM_EFI_RUNTIME_DRIVER 12
+#define EFI_IMAGE_SUBSYSTEM_SAL_RUNTIME_DRIVER 13
+// Supported machine types
+#define EFI_IMAGE_MACHINE_IA32 0x014c
+#define EFI_IMAGE_MACHINE_IA64 0x0200
+#define EFI_IMAGE_MACHINE_EBC 0x0EBC
+typedef EFI_STATUS (*EFI_IMAGE_LOAD)(
+ IN BOOLEAN BootPolicy, IN EFI_HANDLE ParentImageHandle,
+ IN EFI_DEVICE_PATH_PROTOCOL *FilePath, IN VOID *SourceBuffer OPTIONAL,
+ IN UINTN SourceSize, OUT EFI_HANDLE *ImageHandle
+);
+typedef EFI_STATUS (*EFI_IMAGE_START)(
+ IN EFI_HANDLE ImageHandle, OUT UINTN *ExitDataSize,
+ OUT CHAR16 **ExitData OPTIONAL
+);
+typedef EFI_STATUS (*EFI_EXIT)(
+ IN EFI_HANDLE ImageHandle, IN EFI_STATUS ExitStatus,
+ IN UINTN ExitDataSize, IN CHAR16 *ExitData OPTIONAL
+);
+typedef EFI_STATUS (*EFI_IMAGE_UNLOAD)(IN EFI_HANDLE ImageHandle);
+typedef EFI_STATUS (*EFI_EXIT_BOOT_SERVICES)(
+ IN EFI_HANDLE ImageHandle, IN UINTN MapKey
+);
+// Miscellaneous Services
+typedef EFI_STATUS (*EFI_GET_NEXT_MONOTONIC_COUNT)(
+ OUT UINT64 *Count
+);
+typedef EFI_STATUS (*EFI_STALL)(IN UINTN Microseconds);
+typedef EFI_STATUS (*EFI_SET_WATCHDOG_TIMER)(
+ IN UINTN Timeout, IN UINT64 WatchdogCode,
+ IN UINTN DataSize, IN CHAR16 *WatchdogData OPTIONAL
+);
+// DriverSupport Services
+typedef EFI_STATUS (*EFI_CONNECT_CONTROLLER)(
+ IN EFI_HANDLE ControllerHandle,
+ IN EFI_HANDLE *DriverImageHandle OPTIONAL,
+ IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL,
+ IN BOOLEAN Recursive
+);
+typedef EFI_STATUS (*EFI_DISCONNECT_CONTROLLER)(
+ IN EFI_HANDLE ControllerHandle,
+ IN EFI_HANDLE DriverImageHandle OPTIONAL,
+ IN EFI_HANDLE ChildHandle OPTIONAL
+);
+// Open and Close Protocol Services
+#define EFI_OPEN_PROTOCOL_BY_HANDLE_PROTOCOL 0x00000001
+#define EFI_OPEN_PROTOCOL_GET_PROTOCOL 0x00000002
+#define EFI_OPEN_PROTOCOL_TEST_PROTOCOL 0x00000004
+#define EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER 0x00000008
+#define EFI_OPEN_PROTOCOL_BY_DRIVER 0x00000010
+#define EFI_OPEN_PROTOCOL_EXCLUSIVE 0x00000020
+typedef EFI_STATUS (*EFI_OPEN_PROTOCOL)(
+ IN EFI_HANDLE Handle, IN EFI_GUID *Protocol,
+ OUT VOID **Interface OPTIONAL, IN EFI_HANDLE AgentHandle,
+ IN EFI_HANDLE ControllerHandle, IN UINT32 Attributes
+);
+typedef EFI_STATUS (*EFI_CLOSE_PROTOCOL)(
+ IN EFI_HANDLE Handle, IN EFI_GUID *Protocol,
+ IN EFI_HANDLE AgentHandle, IN EFI_HANDLE ControllerHandle
+);
+//**********************************************************************
+//<AMI_THDR_START>
+//
+// Name: EFI_OPEN_PROTOCOL_INFORMATION_ENTRY
+//
+// Fields: Name Type Description
+// AgentHandle EFI_HANDLE
+// ControllerHandle EFI_HANDLE
+// Attributes UINT32
+// OpenCount UINT32
+//
+// Description: the fields has the same semantics
+// as corresponding paramters of OpenProtocol function.
+//
+//<AMI_THDR_END>
+//**********************************************************************
+typedef struct {
+ EFI_HANDLE AgentHandle;
+ EFI_HANDLE ControllerHandle;
+ UINT32 Attributes;
+ UINT32 OpenCount;
+} EFI_OPEN_PROTOCOL_INFORMATION_ENTRY;
+
+typedef EFI_STATUS (*EFI_OPEN_PROTOCOL_INFORMATION)(
+ IN EFI_HANDLE Handle, IN EFI_GUID *Protocol,
+ OUT EFI_OPEN_PROTOCOL_INFORMATION_ENTRY **EntryBuffer,
+ OUT UINTN *EntryCount
+);
+
+// Library Services
+typedef EFI_STATUS (*EFI_PROTOCOLS_PER_HANDLE)(
+ IN EFI_HANDLE Handle, OUT EFI_GUID ***ProtocolBuffer,
+ OUT UINTN *ProtocolBufferCount
+);
+typedef EFI_STATUS (*EFI_LOCATE_HANDLE_BUFFER)(
+ IN EFI_LOCATE_SEARCH_TYPE SearchType,
+ IN EFI_GUID *Protocol OPTIONAL,
+ IN VOID *SearchKey OPTIONAL, IN OUT UINTN *NoHandles,
+ OUT EFI_HANDLE **Buffer
+);
+typedef EFI_STATUS (*EFI_LOCATE_PROTOCOL)(
+ IN EFI_GUID *Protocol, IN VOID *Registration OPTIONAL,
+ OUT VOID **Interface
+);
+typedef EFI_STATUS (*EFI_INSTALL_MULTIPLE_PROTOCOL_INTERFACES)(
+ IN OUT EFI_HANDLE *Handle, ...
+);
+typedef EFI_STATUS (*EFI_UNINSTALL_MULTIPLE_PROTOCOL_INTERFACES)(
+ IN OUT EFI_HANDLE Handle, ...
+);
+// 32-bit CRC Services
+typedef EFI_STATUS (*EFI_CALCULATE_CRC32)(
+ IN VOID *Data, IN UINTN DataSize, OUT UINT32 *Crc32
+);
+// Memory Utility Services
+typedef VOID (*EFI_COPY_MEM)(
+IN VOID *Destination, IN VOID *Source, IN UINTN Length
+);
+typedef VOID (*EFI_SET_MEM)(
+ IN VOID *Buffer, IN UINTN Size, IN UINT8 Value
+);
+
+//UEFI 2.0 Event Service
+//Predefined Event Groups
+#define EFI_EVENT_GROUP_EXIT_BOOT_SERVICES \
+ {0x27abf055, 0xb1b8, 0x4c26, 0x80, 0x48, 0x74, 0x8f, 0x37, 0xba, 0xa2, 0xdf}
+#define EFI_EVENT_GROUP_VIRTUAL_ADDRESS_CHANGE \
+ {0x13fa7698, 0xc831, 0x49c7, 0x87, 0xea, 0x8f, 0x43, 0xfc, 0xc2, 0x51, 0x96}
+#define EFI_EVENT_GROUP_MEMORY_MAP_CHANGE \
+ {0x78bee926, 0x692f, 0x48fd, 0x9e, 0xdb, 0x1, 0x42, 0x2e, 0xf0, 0xd7, 0xab}
+#define EFI_EVENT_GROUP_READY_TO_BOOT \
+ {0x7ce88fb3, 0x4bd7, 0x4679, 0x87, 0xa8, 0xa8, 0xd8, 0xde, 0xe5, 0xd, 0x2b}
+
+typedef EFI_STATUS (*EFI_CREATE_EVENT_EX)(
+ IN UINT32 Type, IN EFI_TPL NotifyTpl,
+ IN EFI_EVENT_NOTIFY NotifyFunction OPTIONAL,
+ IN CONST VOID *NotifyContext OPTIONAL,
+ IN CONST EFI_GUID *EventGroup OPTIONAL,
+ OUT EFI_EVENT *Event
+);
+
+#define EFI_BOOT_SERVICES_SIGNATURE 0x56524553544f4f42
+#ifndef EFI_SPECIFICATION_VERSION
+#define EFI_BOOT_SERVICES_REVISION ((1<<16) | (10))
+#else
+#define EFI_BOOT_SERVICES_REVISION EFI_SPECIFICATION_VERSION
+#endif
+typedef struct {
+ EFI_TABLE_HEADER Hdr;
+ // Task Priority Services
+ EFI_RAISE_TPL RaiseTPL;
+ EFI_RESTORE_TPL RestoreTPL;
+ // Memory Services
+ EFI_ALLOCATE_PAGES AllocatePages;
+ EFI_FREE_PAGES FreePages;
+ EFI_GET_MEMORY_MAP GetMemoryMap;
+ EFI_ALLOCATE_POOL AllocatePool;
+ EFI_FREE_POOL FreePool;
+ // Event & Timer Services
+ EFI_CREATE_EVENT CreateEvent;
+ EFI_SET_TIMER SetTimer;
+ EFI_WAIT_FOR_EVENT WaitForEvent;
+ EFI_SIGNAL_EVENT SignalEvent;
+ EFI_CLOSE_EVENT CloseEvent;
+ EFI_CHECK_EVENT CheckEvent;
+ // Protocol Handler Services
+ EFI_INSTALL_PROTOCOL_INTERFACE InstallProtocolInterface;
+ EFI_REINSTALL_PROTOCOL_INTERFACE ReinstallProtocolInterface;
+ EFI_UNINSTALL_PROTOCOL_INTERFACE UninstallProtocolInterface;
+ EFI_HANDLE_PROTOCOL HandleProtocol;
+ VOID *Reserved;
+ EFI_REGISTER_PROTOCOL_NOTIFY RegisterProtocolNotify;
+ EFI_LOCATE_HANDLE LocateHandle;
+ EFI_LOCATE_DEVICE_PATH LocateDevicePath;
+ EFI_INSTALL_CONFIGURATION_TABLE InstallConfigurationTable;
+ // Image Services
+ EFI_IMAGE_LOAD LoadImage;
+ EFI_IMAGE_START StartImage;
+ EFI_EXIT Exit;
+ EFI_IMAGE_UNLOAD UnloadImage;
+ EFI_EXIT_BOOT_SERVICES ExitBootServices;
+ // Miscellaneous Services
+ EFI_GET_NEXT_MONOTONIC_COUNT GetNextMonotonicCount;
+ EFI_STALL Stall;
+ EFI_SET_WATCHDOG_TIMER SetWatchdogTimer;
+ // DriverSupport Services
+ EFI_CONNECT_CONTROLLER ConnectController;
+ EFI_DISCONNECT_CONTROLLER DisconnectController;
+ // Open and Close Protocol Services
+ EFI_OPEN_PROTOCOL OpenProtocol;
+ EFI_CLOSE_PROTOCOL CloseProtocol;
+ EFI_OPEN_PROTOCOL_INFORMATION OpenProtocolInformation;
+ // Library Services
+ EFI_PROTOCOLS_PER_HANDLE ProtocolsPerHandle;
+ EFI_LOCATE_HANDLE_BUFFER LocateHandleBuffer;
+ EFI_LOCATE_PROTOCOL LocateProtocol;
+ EFI_INSTALL_MULTIPLE_PROTOCOL_INTERFACES InstallMultipleProtocolInterfaces;
+ EFI_UNINSTALL_MULTIPLE_PROTOCOL_INTERFACES UninstallMultipleProtocolInterfaces;
+ // 32-bit CRC Services
+ EFI_CALCULATE_CRC32 CalculateCrc32;
+ // Memory Utility Services
+ EFI_COPY_MEM CopyMem;
+ EFI_SET_MEM SetMem;
+#if EFI_SPECIFICATION_VERSION >=0x20000
+ // UEFI 2.0 Event Service
+ EFI_CREATE_EVENT_EX CreateEventEx;
+#endif
+} EFI_BOOT_SERVICES;
+
+
+//*******************************************************
+//Efi Runtime Services
+//*******************************************************
+
+//*******************************************************
+//EFI_TIME
+//*******************************************************
+// This represents the current time information
+typedef struct {
+ UINT16 Year; // 1998 - 2097
+ UINT8 Month; // 1 - 12
+ UINT8 Day; // 1 - 31
+ UINT8 Hour; // 0 - 23
+ UINT8 Minute; // 0 - 59
+ UINT8 Second; // 0 - 59
+ UINT8 Pad1;
+ UINT32 Nanosecond; // 0 - 999,999,999
+ INT16 TimeZone; // -1440 to 1440 or EFI_UNSPECIFIED_TIMEZONE
+ UINT8 Daylight;
+ UINT8 Pad2;
+} EFI_TIME;
+
+//*******************************************************
+// Bit Definitions for EFI_TIME.Daylight. See below.
+//*******************************************************
+#define EFI_TIME_ADJUST_DAYLIGHT 0x01
+#define EFI_TIME_IN_DAYLIGHT 0x02
+
+//*******************************************************
+// Value Definition for EFI_TIME.TimeZone. See below.
+//*******************************************************
+#define EFI_UNSPECIFIED_TIMEZONE 0x07FF
+
+//*******************************************************
+// EFI_TIME_CAPABILITIES
+//*******************************************************
+// This provides the capabilities of the
+// real time clock device as exposed through the EFI interfaces.
+typedef struct {
+ UINT32 Resolution;
+ UINT32 Accuracy;
+ BOOLEAN SetsToZero;
+} EFI_TIME_CAPABILITIES;
+
+typedef EFI_STATUS (*EFI_GET_TIME) (
+ OUT EFI_TIME *Time,
+ OUT EFI_TIME_CAPABILITIES *Capabilities OPTIONAL
+);
+
+typedef EFI_STATUS (*EFI_SET_TIME) (
+ IN EFI_TIME *Time
+);
+
+typedef EFI_STATUS (*EFI_GET_WAKEUP_TIME) (
+ OUT BOOLEAN *Enabled,
+ OUT BOOLEAN *Pending,
+ OUT EFI_TIME *Time
+);
+
+typedef EFI_STATUS (*EFI_SET_WAKEUP_TIME) (
+ IN BOOLEAN Enable,
+ IN EFI_TIME *Time OPTIONAL
+);
+
+// Virtual Memory Services
+typedef EFI_STATUS (*EFI_SET_VIRTUAL_ADDRESS_MAP)(
+ IN UINTN MemoryMapSize, IN UINTN DescriptorSize,
+ IN UINT32 DescriptorVersion, IN EFI_MEMORY_DESCRIPTOR *VirtualMap
+);
+
+#define EFI_OPTIONAL_PTR 1
+typedef EFI_STATUS (*EFI_CONVERT_POINTER)(
+ IN UINTN DebugDisposition, IN VOID **Address
+);
+// Variable Services
+#define EFI_GLOBAL_VARIABLE \
+ {0x8BE4DF61,0x93CA,0x11d2,0xAA,0xD,0x0,0xE0,0x98,0x03,0x2B,0x8C}
+
+typedef EFI_STATUS (*EFI_GET_VARIABLE)(
+ IN CHAR16 *VariableName, IN EFI_GUID *VendorGuid,
+ OUT UINT32 *Attributes OPTIONAL, IN OUT UINTN *DataSize,
+ OUT VOID *Data
+);
+typedef EFI_STATUS (*EFI_GET_NEXT_VARIABLE_NAME)(
+ IN OUT UINTN *VariableNameSize, IN OUT CHAR16 *VariableName,
+ IN OUT EFI_GUID *VendorGuid
+);
+typedef EFI_STATUS (*EFI_SET_VARIABLE)(
+ IN CHAR16 *VariableName, IN EFI_GUID *VendorGuid,
+ IN UINT32 Attributes, IN UINTN DataSize, IN VOID *Data
+);
+// Miscellaneous Services
+typedef EFI_STATUS (*EFI_GET_NEXT_HIGH_MONO_COUNT)(OUT UINT32 *HighCount);
+//*******************************************************
+// EFI_RESET_TYPE
+//*******************************************************
+typedef enum { EfiResetCold, EfiResetWarm, EfiResetShutdown, EfiResetUpdate } EFI_RESET_TYPE;
+typedef EFI_STATUS (*EFI_RESET_SYSTEM)(
+ IN EFI_RESET_TYPE ResetType, IN EFI_STATUS ResetStatus,
+ IN UINTN DataSize, IN CHAR16 *ResetData OPTIONAL
+);
+
+// Status Code Type Definition
+typedef UINT32 EFI_STATUS_CODE_TYPE;
+
+// A Status Code Type is made up of the code type and severity
+// All values masked by EFI_STATUS_CODE_RESERVED_MASK are
+// reserved for use by this specification.
+#define EFI_STATUS_CODE_TYPE_MASK 0x000000FF
+#define EFI_STATUS_CODE_SEVERITY_MASK 0xFF000000
+#define EFI_STATUS_CODE_RESERVED_MASK 0x00FFFF00
+
+// Definition of code types, all other values masked by
+// EFI_STATUS_CODE_TYPE_MASK are reserved for use by
+// this specification.
+#define EFI_PROGRESS_CODE 0x00000001
+#define EFI_ERROR_CODE 0x00000002
+#define EFI_DEBUG_CODE 0x00000003
+
+// Definitions of severities, all other values masked by
+// EFI_STATUS_CODE_SEVERITY_MASK are reserved for use by
+// this specification.
+// Uncontained errors are major errors that could not contained
+// to the specific component that is reporting the error
+// For example, if a memory error was not detected early enough,
+// the bad data could be consumed by other drivers.
+#define EFI_ERROR_MINOR 0x40000000
+#define EFI_ERROR_MAJOR 0x80000000
+#define EFI_ERROR_UNRECOVERED 0x90000000
+#define EFI_ERROR_UNCONTAINED 0xa0000000
+
+// Status Code Value Definition
+typedef UINT32 EFI_STATUS_CODE_VALUE;
+
+// A Status Code Value is made up of the class, subclass, and
+// an operation.
+#define EFI_STATUS_CODE_CLASS_MASK 0xFF000000
+#define EFI_STATUS_CODE_SUBCLASS_MASK 0x00FF0000
+#define EFI_STATUS_CODE_OPERATION_MASK 0x0000FFFF
+
+// Definition of Status Code extended data header.
+// The data will follow HeaderSize bytes from the beginning of
+// the structure and is Size bytes long.
+typedef struct {
+ UINT16 HeaderSize;
+ UINT16 Size;
+ EFI_GUID Type;
+} EFI_STATUS_CODE_DATA;
+
+typedef EFI_STATUS (EFIAPI *EFI_REPORT_STATUS_CODE)(
+ IN EFI_STATUS_CODE_TYPE Type, IN EFI_STATUS_CODE_VALUE Value,
+ IN UINT32 Instance, IN EFI_GUID *CallerId OPTIONAL,
+ IN EFI_STATUS_CODE_DATA *Data OPTIONAL
+);
+
+// UEFI 2.0 Capsule Services
+typedef struct {
+ UINT64 Length;
+ union {
+ EFI_PHYSICAL_ADDRESS DataBlock;
+ EFI_PHYSICAL_ADDRESS ContinuationPointer;
+ };
+} EFI_CAPSULE_BLOCK_DESCRIPTOR;
+
+typedef struct {
+ EFI_GUID CapsuleGuid;
+ UINT32 HeaderSize;
+ UINT32 Flags;
+ UINT32 CapsuleImageSize;
+} EFI_CAPSULE_HEADER;
+
+#define CAPSULE_FLAGS_PERSIST_ACROSS_RESET 0x00010000
+#define CAPSULE_FLAGS_POPULATE_SYSTEM_TABLE 0x00020000
+#define CAPSULE_FLAGS_INITIATE_RESET 0x00040000
+
+typedef EFI_STATUS (*EFI_UPDATE_CAPSULE) (
+ IN EFI_CAPSULE_HEADER **CapsuleHeaderArray,
+ IN UINTN CapsuleCount,
+ IN EFI_PHYSICAL_ADDRESS ScatterGatherList OPTIONAL
+);
+
+typedef EFI_STATUS (*EFI_QUERY_CAPSULE_CAPABILITIES) (
+ IN EFI_CAPSULE_HEADER **CapsuleHeaderArray,
+ IN UINTN CapsuleCount,
+ OUT UINT64 *MaximumCapsuleSize,
+ OUT EFI_RESET_TYPE *ResetType
+);
+
+// Miscellaneous UEFI 2.0 Service
+typedef EFI_STATUS (*EFI_QUERY_VARIABLE_INFO) (
+ IN UINT32 Attributes,
+ OUT UINT64 *MaximumVariableStorageSize,
+ OUT UINT64 *RemainingVariableStorageSize,
+ OUT UINT64 *MaximumVariableSize
+);
+
+#define EFI_RUNTIME_SERVICES_SIGNATURE 0x56524553544e5552
+#ifndef EFI_SPECIFICATION_VERSION
+#define EFI_RUNTIME_SERVICES_REVISION ((1<<16) | (10))
+#else
+#define EFI_RUNTIME_SERVICES_REVISION EFI_SPECIFICATION_VERSION
+#endif
+typedef struct {
+ EFI_TABLE_HEADER Hdr;
+ // Time Services
+ EFI_GET_TIME GetTime;
+ EFI_SET_TIME SetTime;
+ EFI_GET_WAKEUP_TIME GetWakeupTime;
+ EFI_SET_WAKEUP_TIME SetWakeupTime;
+ // Virtual Memory Services
+ EFI_SET_VIRTUAL_ADDRESS_MAP SetVirtualAddressMap;
+ EFI_CONVERT_POINTER ConvertPointer;
+ // Variable Services
+ EFI_GET_VARIABLE GetVariable;
+ EFI_GET_NEXT_VARIABLE_NAME GetNextVariableName;
+ EFI_SET_VARIABLE SetVariable;
+ // Miscellaneous Services
+ EFI_GET_NEXT_HIGH_MONO_COUNT GetNextHighMonotonicCount;
+ EFI_RESET_SYSTEM ResetSystem;
+#if EFI_SPECIFICATION_VERSION <0x20000
+ // ReportStatusCode is removed from this table in UEFI2.0
+ EFI_REPORT_STATUS_CODE ReportStatusCode;
+#else
+ // UEFI 2.0 Capsule Services
+ EFI_UPDATE_CAPSULE UpdateCapsule;
+ EFI_QUERY_CAPSULE_CAPABILITIES QueryCapsuleCapabilities;
+
+ // Miscellaneous UEFI 2.0 Service
+ EFI_QUERY_VARIABLE_INFO QueryVariableInfo;
+
+#endif
+} EFI_RUNTIME_SERVICES;
+
+#define ACPI_20_TABLE_GUID \
+ {0x8868e871,0xe4f1,0x11d3,0xbc,0x22,0x0,0x80,0xc7,0x3c,0x88,0x81}
+#define ACPI_TABLE_GUID \
+ {0xeb9d2d30,0x2d88,0x11d3,0x9a,0x16,0x0,0x90,0x27,0x3f,0xc1,0x4d}
+#define SAL_SYSTEM_TABLE_GUID \
+ {0xeb9d2d32,0x2d88,0x11d3,0x9a,0x16,0x0,0x90,0x27,0x3f,0xc1,0x4d}
+#define SMBIOS_TABLE_GUID \
+ {0xeb9d2d31,0x2d88,0x11d3,0x9a,0x16,0x0,0x90,0x27,0x3f,0xc1,0x4d}
+#define MPS_TABLE_GUID \
+ {0xeb9d2d2f,0x2d88,0x11d3,0x9a,0x16,0x0,0x90,0x27,0x3f,0xc1,0x4d}
+
+// ACPI 2.0 or newer tables should use EFI_ACPI_TABLE_GUID
+#define EFI_ACPI_TABLE_GUID ACPI_20_TABLE_GUID
+#define ACPI_10_TABLE_GUID ACPI_TABLE_GUID
+
+typedef struct{
+ EFI_GUID VendorGuid;
+ VOID *VendorTable;
+} EFI_CONFIGURATION_TABLE;
+
+//forward declarations
+typedef struct _EFI_SIMPLE_TEXT_INPUT_PROTOCOL EFI_SIMPLE_TEXT_INPUT_PROTOCOL;
+typedef struct _EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL;
+
+#define EFI_SYSTEM_TABLE_SIGNATURE 0x5453595320494249
+#ifndef EFI_SPECIFICATION_VERSION
+#define EFI_SYSTEM_TABLE_REVISION ((1<<16) | (10))
+#else
+#define EFI_SYSTEM_TABLE_REVISION EFI_SPECIFICATION_VERSION
+#define EFI_2_31_SYSTEM_TABLE_REVISION ((2<<16) | (31))
+#define EFI_2_30_SYSTEM_TABLE_REVISION ((2<<16) | (30))
+#define EFI_2_20_SYSTEM_TABLE_REVISION ((2<<16) | (20))
+#define EFI_2_10_SYSTEM_TABLE_REVISION ((2<<16) | (10))
+#define EFI_2_00_SYSTEM_TABLE_REVISION ((2<<16) | (00))
+#define EFI_1_10_SYSTEM_TABLE_REVISION ((1<<16) | (10))
+#define EFI_1_02_SYSTEM_TABLE_REVISION ((1<<16) | (02))
+#endif
+typedef struct {
+ EFI_TABLE_HEADER Hdr;
+ CHAR16 *FirmwareVendor;
+ UINT32 FirmwareRevision;
+ EFI_HANDLE ConsoleInHandle;
+ EFI_SIMPLE_TEXT_INPUT_PROTOCOL *ConIn;
+ EFI_HANDLE ConsoleOutHandle;
+ EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *ConOut;
+ EFI_HANDLE StandardErrorHandle;
+ EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *StdErr;
+ EFI_RUNTIME_SERVICES *RuntimeServices;
+ EFI_BOOT_SERVICES *BootServices;
+ UINTN NumberOfTableEntries;
+ EFI_CONFIGURATION_TABLE *ConfigurationTable;
+} EFI_SYSTEM_TABLE;
+
+typedef EFI_STATUS (EFIAPI *EFI_IMAGE_ENTRY_POINT) (
+ IN EFI_HANDLE ImageHandle,
+ IN EFI_SYSTEM_TABLE *SystemTable
+);
+
+// EFI_BOOT_MODE
+typedef UINT32 EFI_BOOT_MODE;
+
+#define BOOT_WITH_FULL_CONFIGURATION 0x00
+#define BOOT_WITH_MINIMAL_CONFIGURATION 0x01
+#define BOOT_ASSUMING_NO_CONFIGURATION_CHANGES 0x02
+#define BOOT_WITH_FULL_CONFIGURATION_PLUS_DIAGNOSTICS 0x03
+#define BOOT_WITH_DEFAULT_SETTINGS 0x04
+#define BOOT_ON_S4_RESUME 0x05
+#define BOOT_ON_S5_RESUME 0x06
+#define BOOT_ON_S2_RESUME 0x10
+#define BOOT_ON_S3_RESUME 0x11
+#define BOOT_ON_FLASH_UPDATE 0x12
+#define BOOT_IN_RECOVERY_MODE 0x20
+//0x21 - 0xF..F Reserved Encodings
+
+//*******************************************************
+// Boot Option Attributes
+//*******************************************************
+#define LOAD_OPTION_ACTIVE 0x00000001
+#define LOAD_OPTION_FORCE_RECONNECT 0x00000002
+#if EFI_SPECIFICATION_VERSION >= 0x2000A
+#define LOAD_OPTION_HIDDEN 0x00000008
+#define LOAD_OPTION_CATEGORY 0x00001F00
+#define LOAD_OPTION_CATEGORY_BOOT 0x00000000
+#define LOAD_OPTION_CATEGORY_APP 0x00000100
+
+#define EFI_BOOT_OPTION_SUPPORT_KEY 0x00000001
+#define EFI_BOOT_OPTION_SUPPORT_APP 0x00000002
+#define EFI_BOOT_OPTION_SUPPORT_COUNT 0x00000300
+#endif
+#pragma pack(push,1)
+typedef struct{
+ UINT32 Attributes;
+ UINT16 FilePathListLength;
+// CHAR16 Description[];
+// EFI_DEVICE_PATH_PROTOCOL FilePathList[];
+// UINT8 OptionalData[];
+} EFI_LOAD_OPTION;
+#pragma pack(pop)
+
+#if EFI_SPECIFICATION_VERSION >= 0x2000A
+typedef union {
+ struct {
+ UINT32 Revision : 8;
+ UINT32 ShiftPressed : 1;
+ UINT32 ControlPressed : 1;
+ UINT32 AltPressed : 1;
+ UINT32 LogoPressed : 1;
+ UINT32 MenuPressed : 1;
+ UINT32 SysReqPessed : 1;
+ UINT32 Reserved : 16;
+ UINT32 InputKeyCount : 2;
+ } Options;
+ UINT32 PackedValue;
+} EFI_BOOT_KEY_DATA, HOT_KEY_EFI_KEY_DATA;
+
+typedef struct {
+ EFI_BOOT_KEY_DATA KeyOptions;
+ UINT32 BootOptionCrc;
+ UINT16 BootOption;
+// EFI_INPUT_KEY Keys[];
+} EFI_KEY_OPTION;
+#endif
+
+// EFI File location to boot from on removable media devices
+#define EFI_REMOVABLE_MEDIA_FILE_NAME_IA32 L"\\EFI\\BOOT\\BOOTIA32.EFI"
+#define EFI_REMOVABLE_MEDIA_FILE_NAME_IA64 L"\\EFI\\BOOT\\BOOTIA64.EFI"
+#define EFI_REMOVABLE_MEDIA_FILE_NAME_X64 L"\\EFI\\BOOT\\BOOTX64.EFI"
+#if defined(EFI64)
+#define EFI_REMOVABLE_MEDIA_FILE_NAME EFI_REMOVABLE_MEDIA_FILE_NAME_IA64
+#elseif deinfed(EFIx64)
+#define EFI_REMOVABLE_MEDIA_FILE_NAME EFI_REMOVABLE_MEDIA_FILE_NAME_X64
+#else
+#define EFI_REMOVABLE_MEDIA_FILE_NAME EFI_REMOVABLE_MEDIA_FILE_NAME_IA32
+#endif
+
+#ifndef GUID_VARIABLE_DEFINITION
+#define GUID_VARIABLE_DECLARATION(Variable, Guid) extern EFI_GUID Variable
+#else
+#define GUID_VARIABLE_DECLARATION(Variable, Guid) GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID Variable=Guid
+#endif
+#define EFI_FORWARD_DECLARATION(x) typedef struct _##x x
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2009, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
diff --git a/Include/EdkIICommon.h b/Include/EdkIICommon.h
new file mode 100644
index 0000000..2106927
--- /dev/null
+++ b/Include/EdkIICommon.h
@@ -0,0 +1,291 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2009, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/SOURCE/Core/EdkIICompLib/EdkIICommon.h 2 5/13/11 5:50p Artems $
+//
+// $Revision: 2 $
+//
+// $Date: 5/13/11 5:50p $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/SOURCE/Core/EdkIICompLib/EdkIICommon.h $
+//
+// 2 5/13/11 5:50p Artems
+// Renamed function EfiCompareGuid with native EdkII CompareGuid
+//
+// 1 5/05/11 5:04p Artems
+// EdkII compatibility library headers
+//
+//
+//**********************************************************************
+//<AMI_FHDR_START>
+//
+// Name: <EdkIICommon.h>
+//
+// Description:
+//
+//<AMI_FHDR_END>
+//**********************************************************************
+#ifndef __EDKII_COMMON__H__
+#define __EDKII_COMMON__H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <Efi.h>
+#include <Protocol/DevicePath.h>
+#include <Protocol/SimpleTextIn.h>
+#include <Protocol/SimpleTextOut.h>
+
+#ifndef END_DEVICE_PATH_TYPE
+#define END_DEVICE_PATH_TYPE 0x7f
+#endif
+
+#define END_ENTIRE_DEVICE_PATH_SUBTYPE 0xFF
+#define EFI_DP_TYPE_MASK 0x7F
+#define EFI_DP_TYPE_UNPACKED 0x80
+#define END_INSTANCE_DEVICE_PATH_SUBTYPE 0x01
+
+#define DevicePathType(a) ( ((a)->Type) & EFI_DP_TYPE_MASK )
+#define DevicePathSubType(a) ( (a)->SubType )
+#define DevicePathNodeLength(a) ( ((a)->Length[0]) | ((a)->Length[1] << 8) )
+
+#define IsDevicePathEndType(a) ( DevicePathType(a) == END_DEVICE_PATH_TYPE )
+#define IsDevicePathEndSubType(a) ( (a)->SubType == END_ENTIRE_DEVICE_PATH_SUBTYPE )
+#define IsDevicePathEnd(a) ( IsDevicePathEndType(a) && IsDevicePathEndSubType(a) )
+#define NextDevicePathNode(a) ( (EFI_DEVICE_PATH_PROTOCOL *) ( ((UINT8 *) (a)) + DevicePathNodeLength(a)))
+
+#define SIGNATURE_16(A,B) ((A) | (B<<8))
+#define SIGNATURE_32(A,B,C,D) (SIGNATURE_16(A,B) | (SIGNATURE_16(C,D) << 16))
+#define SIGNATURE_64(A,B,C,D,E,F,G,H) (SIGNATURE_32(A,B,C,D) | ((UINT64)(SIGNATURE_32(E,F,G,H)) << 32))
+
+#define MIN(a,b) (((a) < (b)) ? (a) : (b))
+#define MAX(a,b) (((a) > (b)) ? (a) : (b))
+
+#define CHAR_NULL 0x0000
+#define CHAR_BACKSPACE 0x0008
+#define CHAR_TAB 0x0009
+#define CHAR_LINEFEED 0x000A
+#define CHAR_CARRIAGE_RETURN 0x000D
+
+#define SCAN_NULL EFI_SCAN_NULL
+#define SCAN_UP EFI_SCAN_UP
+#define SCAN_DOWN EFI_SCAN_DN
+#define SCAN_RIGHT EFI_SCAN_RIGHT
+#define SCAN_LEFT EFI_SCAN_LEFT
+#define SCAN_HOME EFI_SCAN_HOME
+#define SCAN_END EFI_SCAN_END
+#define SCAN_INSERT EFI_SCAN_INS
+#define SCAN_DELETE EFI_SCAN_DEL
+#define SCAN_PAGE_UP EFI_SCAN_PGUP
+#define SCAN_PAGE_DOWN EFI_SCAN_PGDN
+#define SCAN_F1 EFI_SCAN_F1
+#define SCAN_F2 EFI_SCAN_F2
+#define SCAN_F3 EFI_SCAN_F3
+#define SCAN_F4 EFI_SCAN_F4
+#define SCAN_F5 EFI_SCAN_F5
+#define SCAN_F6 EFI_SCAN_F6
+#define SCAN_F7 EFI_SCAN_F7
+#define SCAN_F8 EFI_SCAN_F8
+#define SCAN_F9 EFI_SCAN_F9
+#define SCAN_F10 EFI_SCAN_F10
+#define SCAN_F11 EFI_SCAN_F11
+#define SCAN_F12 EFI_SCAN_F12
+#define SCAN_ESC EFI_SCAN_ESC
+
+
+#define _EFI_INT_SIZE_OF(n) ((sizeof (n) + sizeof (UINTN) - 1) &~(sizeof (UINTN) - 1))
+
+#ifndef VA_START
+
+typedef CHAR8 *VA_LIST;
+#define VA_START(ap, v) (ap = (VA_LIST) & (v) + _EFI_INT_SIZE_OF (v))
+#define VA_ARG(ap, t) (*(t *) ((ap += _EFI_INT_SIZE_OF (t)) - _EFI_INT_SIZE_OF (t)))
+#define VA_END(ap) (ap = (VA_LIST) 0)
+
+#endif
+
+
+EFI_BOOT_SERVICES *gBS;
+EFI_RUNTIME_SERVICES *gRT;
+EFI_SYSTEM_TABLE *gST;
+
+INTN CompareMem(
+ IN VOID *DestinationBuffer,
+ IN VOID *SourceBuffer,
+ IN UINTN Length
+);
+
+
+VOID* CopyMem (
+ OUT VOID *DestinationBuffer,
+ IN VOID *SourceBuffer,
+ IN UINTN Length
+);
+
+VOID* SetMem16 (
+ OUT VOID *Buffer,
+ IN UINTN Length,
+ IN UINT16 Value
+);
+
+
+BOOLEAN CompareGuid(
+ IN EFI_GUID *Guid1,
+ IN EFI_GUID *Guid2
+);
+
+
+VOID* AllocateCopyPool(
+ IN UINTN AllocationSize,
+ IN CONST VOID *Buffer
+);
+
+VOID* AllocateZeroPool(
+ IN UINTN AllocationSize
+);
+
+VOID* AllocateRuntimePool(
+ IN UINTN AllocationSize
+);
+
+VOID* AllocatePool(
+ IN UINTN AllocationSize
+);
+
+VOID* ReallocatePool (
+ IN UINTN OldSize,
+ IN UINTN NewSize,
+ IN VOID *OldBuffer OPTIONAL
+);
+
+VOID FreePool(
+ IN VOID *Buffer
+);
+
+EFI_DEVICE_PATH_PROTOCOL* DevicePathFromHandle(
+ IN EFI_HANDLE Handle
+);
+
+UINTN GetDevicePathSize(
+ IN EFI_DEVICE_PATH_PROTOCOL *DevicePath
+);
+
+UINTN UnicodeSPrint (
+ OUT CHAR16 *StartOfBuffer,
+ IN UINTN BufferSize,
+ IN CHAR16 *FormatString,
+ ...
+);
+
+UINTN UnicodeVSPrint (
+ OUT CHAR16 *StartOfBuffer,
+ IN UINTN BufferSize,
+ IN CHAR16 *FormatString,
+ IN VA_LIST Marker
+);
+
+EFI_STATUS EfiGetSystemConfigurationTable(
+ IN EFI_GUID *TableGuid,
+ OUT VOID **Table
+);
+
+
+VOID* ZeroMem (
+ OUT VOID *Buffer,
+ IN UINTN Length
+);
+
+
+EFI_GUID* CopyGuid (
+ OUT EFI_GUID *DestinationGuid,
+ IN EFI_GUID *SourceGuid
+);
+
+VOID InitEfiPointers(
+ IN EFI_HANDLE ImageHandle,
+ IN EFI_SYSTEM_TABLE *SystemTable
+);
+
+VOID
+EFIAPI
+CreatePopUp (
+ IN UINTN Attribute,
+ OUT EFI_INPUT_KEY *Key, OPTIONAL
+ ...
+ );
+
+UINTN StrLen (
+ IN CHAR16 *String
+);
+
+INTN StrCmp (
+ IN CHAR16 *FirstString,
+ IN CHAR16 *SecondString
+);
+
+UINTN StrSize (
+ IN CHAR16 *String
+);
+
+CHAR16* StrCpy (
+ OUT CHAR16 *Destination,
+ IN CHAR16 *Source
+);
+
+CHAR16* StrCat (
+ IN OUT CHAR16 *Destination,
+ IN CHAR16 *Source
+);
+
+UINTN AsciiStrLen (
+ IN CHAR8 *String
+);
+
+CHAR16* ConvertDeviceNodeToText (
+ IN CONST EFI_DEVICE_PATH_PROTOCOL *DeviceNode,
+ IN BOOLEAN DisplayOnly,
+ IN BOOLEAN AllowShortcuts
+);
+
+CHAR16* ConvertDevicePathToText (
+ IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath,
+ IN BOOLEAN DisplayOnly,
+ IN BOOLEAN AllowShortcuts
+);
+
+VOID* GetEfiGlobalVariable (
+ IN CHAR16 *Name
+);
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2009, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//********************************************************************** \ No newline at end of file
diff --git a/Include/EdkIIHii.h b/Include/EdkIIHii.h
new file mode 100644
index 0000000..342316a
--- /dev/null
+++ b/Include/EdkIIHii.h
@@ -0,0 +1,247 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2009, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/SOURCE/Core/EdkIICompLib/EdkIIHii.h 1 5/05/11 5:04p Artems $
+//
+// $Revision: 1 $
+//
+// $Date: 5/05/11 5:04p $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/SOURCE/Core/EdkIICompLib/EdkIIHii.h $
+//
+// 1 5/05/11 5:04p Artems
+// EdkII compatibility library headers
+//
+//
+//**********************************************************************
+//<AMI_FHDR_START>
+//
+// Name: <EdkIIHii.h>
+//
+// Description:
+//
+//<AMI_FHDR_END>
+//**********************************************************************
+#ifndef __EDKII_HII__H__
+#define __EDKII_HII__H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <UefiHii.h>
+
+#define EFI_IFR_TIANO_GUID \
+ { 0xf0b1735, 0x87a0, 0x4193, 0xb2, 0x66, 0x53, 0x8c, 0x38, 0xaf, 0x48, 0xce }
+
+#define EFI_IFR_EXTEND_OP_LABEL 0x0
+
+
+#pragma pack(1)
+typedef struct _EFI_IFR_GUID_LABEL {
+ EFI_IFR_OP_HEADER Header;
+ EFI_GUID Guid;
+ UINT8 ExtendOpCode;
+ UINT16 Number;
+} EFI_IFR_GUID_LABEL;
+#pragma pack()
+
+EFI_STRING HiiGetString(
+ IN EFI_HII_HANDLE HiiHandle,
+ IN EFI_STRING_ID StringId,
+ IN CONST CHAR8 *Language OPTIONAL
+);
+
+EFI_STRING_ID HiiSetString(
+ IN EFI_HII_HANDLE HiiHandle,
+ IN EFI_STRING_ID StringId, OPTIONAL
+ IN EFI_STRING String,
+ IN CHAR8 *SupportedLanguages OPTIONAL
+);
+
+EFI_STATUS HiiUpdateForm(
+ IN EFI_HII_HANDLE HiiHandle,
+ IN EFI_GUID *FormSetGuid, OPTIONAL
+ IN EFI_FORM_ID FormId,
+ IN VOID *StartOpCodeHandle,
+ IN VOID *EndOpCodeHandle OPTIONAL
+);
+
+VOID* HiiAllocateOpCodeHandle(
+ VOID
+);
+
+VOID HiiFreeOpCodeHandle(
+ VOID *OpCodeHandle
+);
+
+/*
+EFI_HII_HANDLE HiiAddPackages(
+ IN CONST EFI_GUID *PackageListGuid,
+ IN EFI_HANDLE DeviceHandle OPTIONAL,
+ ...
+);
+*/
+
+UINT8* HiiCreateRawOpCodes (
+ IN VOID *OpCodeHandle,
+ IN UINT8 *RawBuffer,
+ IN UINTN RawBufferSize
+);
+
+UINT8* HiiCreateEndOpCode (
+ IN VOID *OpCodeHandle
+);
+
+UINT8* HiiCreateOneOfOptionOpCode (
+ IN VOID *OpCodeHandle,
+ IN UINT16 StringId,
+ IN UINT8 Flags,
+ IN UINT8 Type,
+ IN UINT64 Value
+);
+
+UINT8* HiiCreateDefaultOpCode (
+ IN VOID *OpCodeHandle,
+ IN UINT16 DefaultId,
+ IN UINT8 Type,
+ IN UINT64 Value
+);
+
+UINT8* HiiCreateActionOpCode(
+ IN VOID *OpCodeHandle,
+ IN EFI_QUESTION_ID QuestionId,
+ IN EFI_STRING_ID Prompt,
+ IN EFI_STRING_ID Help,
+ IN UINT8 QuestionFlags,
+ IN EFI_STRING_ID QuestionConfig
+);
+
+UINT8* HiiCreateGotoOpCode(
+ IN VOID *OpCodeHandle,
+ IN EFI_FORM_ID FormId,
+ IN EFI_STRING_ID Prompt,
+ IN EFI_STRING_ID Help,
+ IN UINT8 QuestionFlags,
+ IN EFI_QUESTION_ID QuestionId
+);
+
+UINT8* HiiCreateGuidOpCode (
+ IN VOID *OpCodeHandle,
+ IN CONST EFI_GUID *Guid,
+ IN CONST VOID *GuidOpCode, OPTIONAL
+ IN UINTN OpCodeSize
+);
+
+UINT8* HiiCreateSubTitleOpCode (
+ IN VOID *OpCodeHandle,
+ IN EFI_STRING_ID Prompt,
+ IN EFI_STRING_ID Help,
+ IN UINT8 Flags,
+ IN UINT8 Scope
+);
+
+UINT8* HiiCreateCheckBoxOpCode (
+ IN VOID *OpCodeHandle,
+ IN EFI_QUESTION_ID QuestionId,
+ IN EFI_VARSTORE_ID VarStoreId,
+ IN UINT16 VarOffset,
+ IN EFI_STRING_ID Prompt,
+ IN EFI_STRING_ID Help,
+ IN UINT8 QuestionFlags,
+ IN UINT8 CheckBoxFlags,
+ IN VOID *DefaultsOpCodeHandle OPTIONAL
+);
+
+UINT8* HiiCreateNumericOpCode (
+ IN VOID *OpCodeHandle,
+ IN EFI_QUESTION_ID QuestionId,
+ IN EFI_VARSTORE_ID VarStoreId,
+ IN UINT16 VarOffset,
+ IN EFI_STRING_ID Prompt,
+ IN EFI_STRING_ID Help,
+ IN UINT8 QuestionFlags,
+ IN UINT8 NumericFlags,
+ IN UINT64 Minimum,
+ IN UINT64 Maximum,
+ IN UINT64 Step,
+ IN VOID *DefaultsOpCodeHandle OPTIONAL
+);
+
+UINT8* HiiCreateStringOpCode (
+ IN VOID *OpCodeHandle,
+ IN EFI_QUESTION_ID QuestionId,
+ IN EFI_VARSTORE_ID VarStoreId,
+ IN UINT16 VarOffset,
+ IN EFI_STRING_ID Prompt,
+ IN EFI_STRING_ID Help,
+ IN UINT8 QuestionFlags,
+ IN UINT8 StringFlags,
+ IN UINT8 MinSize,
+ IN UINT8 MaxSize,
+ IN VOID *DefaultsOpCodeHandle OPTIONAL
+);
+
+UINT8* HiiCreateOneOfOpCode (
+ IN VOID *OpCodeHandle,
+ IN EFI_QUESTION_ID QuestionId,
+ IN EFI_VARSTORE_ID VarStoreId,
+ IN UINT16 VarOffset,
+ IN EFI_STRING_ID Prompt,
+ IN EFI_STRING_ID Help,
+ IN UINT8 QuestionFlags,
+ IN UINT8 OneOfFlags,
+ IN VOID *OptionsOpCodeHandle,
+ IN VOID *DefaultsOpCodeHandle OPTIONAL
+);
+
+UINT8* HiiCreateOrderedListOpCode (
+ IN VOID *OpCodeHandle,
+ IN EFI_QUESTION_ID QuestionId,
+ IN EFI_VARSTORE_ID VarStoreId,
+ IN UINT16 VarOffset,
+ IN EFI_STRING_ID Prompt,
+ IN EFI_STRING_ID Help,
+ IN UINT8 QuestionFlags,
+ IN UINT8 OrderedListFlags,
+ IN UINT8 DataType,
+ IN UINT8 MaxContainers,
+ IN VOID *OptionsOpCodeHandle,
+ IN VOID *DefaultsOpCodeHandle OPTIONAL
+);
+
+
+
+
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2009, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//********************************************************************** \ No newline at end of file
diff --git a/Include/EdkII_headers.cif b/Include/EdkII_headers.cif
new file mode 100644
index 0000000..c0f0332
--- /dev/null
+++ b/Include/EdkII_headers.cif
@@ -0,0 +1,9 @@
+<component>
+ name = "EDK II headers"
+ category = ModulePart
+ LocalRoot = "Include\"
+ RefName = "EdkII_headers"
+[files]
+"EdkIICommon.h"
+"EdkIIHii.h"
+<endComponent>
diff --git a/Include/FFS.h b/Include/FFS.h
new file mode 100644
index 0000000..bc705e3
--- /dev/null
+++ b/Include/FFS.h
@@ -0,0 +1,563 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2010, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/BIN/Core/Include/FFS.h 9 5/22/12 10:20a Artems $
+//
+// $Revision: 9 $
+//
+// $Date: 5/22/12 10:20a $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Core/Include/FFS.h $
+//
+// 9 5/22/12 10:20a Artems
+// [TAG] EIP N/A
+// [Category] Bug Fix
+// [Severity] Critical
+// [Symptom] In certain cases system may hang
+// [RootCause] File Efi.h was included inside #pragma <stack> statement,
+// which may lead to different offsets in Boot and Runtime services
+// functions
+// [Solution] Moved Efi.h out of #pragma statement
+// [Files] FFS.h
+//
+// 8 3/16/11 11:32p Felixp
+// Several identifiers have been updated to match with the latest revision
+// of the PI spec.
+//
+// 7 3/09/11 5:36p Artems
+// PI 1.0 clean-up
+//
+// 6 2/05/11 1:50p Artems
+// Added PI 1.0-1.1 support
+//
+// 5 8/20/10 12:43p Felixp
+//
+// 4 8/20/10 12:41p Felixp
+// Customized compression type (EFI_CUSTOMIZED_COMPRESSION) is added.
+//
+// 3 4/12/06 1:19p Felixp
+//
+// 2 3/13/06 1:15a Felixp
+//
+// 1 1/28/05 12:44p Felixp
+//
+// 3 1/24/05 2:23p Felixp
+// clean up
+//
+// 2 1/18/05 3:21p Felixp
+// PrintDebugMessage renamed to Trace
+//
+// 1 12/23/04 9:41a Felixp
+//
+// 4 10/21/04 2:45p Felixp
+// pack(1) added (EFI_COMPRESSION_SECTION_HEADER asked for it)
+//
+// 3 12/16/03 5:08p Markw
+// Removed some duplicate definitions.
+//
+// 2 12/16/03 5:06p Markw
+// Changed tabs to spaces.
+//
+// 1 12/16/03 1:06p Markw
+// Created. Contains structs and definitions for Firmware Volume, Files,
+// Sections.
+//
+//
+//**********************************************************************
+//<AMI_FHDR_START>
+//
+// Name: FFS.H
+//
+// Description:
+// Filesystem headers from specifications:
+// Intel Platform Innovation Framework for EFI Firmware Volume Specification
+//
+// Intel Platform Innovation Framework for EFI Firmware File System Specification
+//
+//<AMI_FHDR_END>
+//**********************************************************************
+
+#ifndef __FFS__H__
+#define __FFS__H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+#include <EFI.h>
+#pragma pack(push,1)
+
+
+//*************************************************
+// EFI_FVB_ATTRIBUTES
+//*************************************************
+typedef UINT32 EFI_FVB_ATTRIBUTES;
+typedef UINT32 EFI_FVB_ATTRIBUTES_2;
+// Attributes bit definitions
+#if PI_SPECIFICATION_VERSION < 0x00010000
+#define EFI_FVB_READ_DISABLED_CAP 0x00000001
+#define EFI_FVB_READ_ENABLED_CAP 0x00000002
+#define EFI_FVB_READ_STATUS 0x00000004
+#define EFI_FVB_WRITE_DISABLED_CAP 0x00000008
+#define EFI_FVB_WRITE_ENABLED_CAP 0x00000010
+#define EFI_FVB_WRITE_STATUS 0x00000020
+#define EFI_FVB_LOCK_CAP 0x00000040
+#define EFI_FVB_LOCK_STATUS 0x00000080
+#define EFI_FVB_STICKY_WRITE 0x00000200
+#define EFI_FVB_MEMORY_MAPPED 0x00000400
+#define EFI_FVB_ERASE_POLARITY 0x00000800
+#define EFI_FVB_ALIGNMENT_CAP 0x00008000
+#define EFI_FVB_ALIGNMENT_2 0x00010000
+#define EFI_FVB_ALIGNMENT_4 0x00020000
+#define EFI_FVB_ALIGNMENT_8 0x00040000
+#define EFI_FVB_ALIGNMENT_16 0x00080000
+#define EFI_FVB_ALIGNMENT_32 0x00100000
+#define EFI_FVB_ALIGNMENT_64 0x00200000
+#define EFI_FVB_ALIGNMENT_128 0x00400000
+#define EFI_FVB_ALIGNMENT_256 0x00800000
+#define EFI_FVB_ALIGNMENT_512 0x01000000
+#define EFI_FVB_ALIGNMENT_1K 0x02000000
+#define EFI_FVB_ALIGNMENT_2K 0x04000000
+#define EFI_FVB_ALIGNMENT_4K 0x08000000
+#define EFI_FVB_ALIGNMENT_8K 0x10000000
+#define EFI_FVB_ALIGNMENT_16K 0x20000000
+#define EFI_FVB_ALIGNMENT_32K 0x40000000
+#define EFI_FVB_ALIGNMENT_64K 0x80000000
+
+#else //#if PI_SPECIFICATION_VERSION < 0x00010000
+
+#define EFI_FVB2_READ_DISABLED_CAP 0x00000001
+#define EFI_FVB2_READ_ENABLED_CAP 0x00000002
+#define EFI_FVB2_READ_STATUS 0x00000004
+#define EFI_FVB2_WRITE_DISABLED_CAP 0x00000008
+#define EFI_FVB2_WRITE_ENABLED_CAP 0x00000010
+#define EFI_FVB2_WRITE_STATUS 0x00000020
+#define EFI_FVB2_LOCK_CAP 0x00000040
+#define EFI_FVB2_LOCK_STATUS 0x00000080
+#define EFI_FVB2_STICKY_WRITE 0x00000200
+#define EFI_FVB2_MEMORY_MAPPED 0x00000400
+#define EFI_FVB2_ERASE_POLARITY 0x00000800
+#define EFI_FVB2_READ_LOCK_CAP 0x00001000
+#define EFI_FVB2_READ_LOCK_STATUS 0x00002000
+#define EFI_FVB2_WRITE_LOCK_CAP 0x00004000
+#define EFI_FVB2_WRITE_LOCK_STATUS 0x00008000
+#define EFI_FVB2_ALIGNMENT 0x001F0000
+#define EFI_FVB2_ALIGNMENT_1 0x00000000
+#define EFI_FVB2_ALIGNMENT_2 0x00010000
+#define EFI_FVB2_ALIGNMENT_4 0x00020000
+#define EFI_FVB2_ALIGNMENT_8 0x00030000
+#define EFI_FVB2_ALIGNMENT_16 0x00040000
+#define EFI_FVB2_ALIGNMENT_32 0x00050000
+#define EFI_FVB2_ALIGNMENT_64 0x00060000
+#define EFI_FVB2_ALIGNMENT_128 0x00070000
+#define EFI_FVB2_ALIGNMENT_256 0x00080000
+#define EFI_FVB2_ALIGNMENT_512 0x00090000
+#define EFI_FVB2_ALIGNMENT_1K 0x000A0000
+#define EFI_FVB2_ALIGNMENT_2K 0x000B0000
+#define EFI_FVB2_ALIGNMENT_4K 0x000C0000
+#define EFI_FVB2_ALIGNMENT_8K 0x000D0000
+#define EFI_FVB2_ALIGNMENT_16K 0x000E0000
+#define EFI_FVB2_ALIGNMENT_32K 0x000F0000
+#define EFI_FVB2_ALIGNMENT_64K 0x00100000
+#define EFI_FVB2_ALIGNMENT_128K 0x00110000
+#define EFI_FVB2_ALIGNMENT_256K 0x00120000
+#define EFI_FVB2_ALIGNMNET_512K 0x00130000
+#define EFI_FVB2_ALIGNMENT_1M 0x00140000
+#define EFI_FVB2_ALIGNMENT_2M 0x00150000
+#define EFI_FVB2_ALIGNMENT_4M 0x00160000
+#define EFI_FVB2_ALIGNMENT_8M 0x00170000
+#define EFI_FVB2_ALIGNMENT_16M 0x00180000
+#define EFI_FVB2_ALIGNMENT_32M 0x00190000
+#define EFI_FVB2_ALIGNMENT_64M 0x001A0000
+#define EFI_FVB2_ALIGNMENT_128M 0x001B0000
+#define EFI_FVB2_ALIGNMENT_256M 0x001C0000
+#define EFI_FVB2_ALIGNMENT_512M 0x001D0000
+#define EFI_FVB2_ALIGNMENT_1G 0x001E0000
+#define EFI_FVB2_ALIGNMENT_2G 0x001F0000
+
+#endif //#if PI_SPECIFICATION_VERSION < 0x00010000
+
+// Extended Header Header. Located via ExtHeaderOffset.
+// The extended headers follow each other in memory and are
+// terminated by ExtHeaderType EFI_FV_EXT_TYPE_END
+typedef struct {
+ UINT16 ExtEntrySize;
+ UINT16 ExtEntryType;
+} EFI_FIRMWARE_VOLUME_EXT_ENTRY;
+
+// GUID that maps OEM file types to GUIDs
+#define EFI_FV_EXT_TYPE_OEM_TYPE 0x01
+typedef struct {
+ EFI_FIRMWARE_VOLUME_EXT_ENTRY Hdr;
+ UINT32 TypeMask;
+ EFI_GUID Types[1];
+} EFI_FIRMWARE_VOLUME_EXT_HEADER_OEM_TYPE;
+
+// Unique name of the FV
+typedef struct {
+ EFI_GUID FvName;
+ UINT32 ExtHeaderSize;
+} EFI_FIRMWARE_VOLUME_EXT_HEADER;
+
+
+//************************************************************
+// EFI_FV_FILE_ATTRIBUTES
+//************************************************************
+typedef UINT32 EFI_FV_FILE_ATTRIBUTES;
+#define EFI_FV_FILE_ATTRIB_ALIGNMENT 0x0000001F
+
+//**********************************************************************
+//<AMI_SHDR_START>
+//
+// Name: FvBlockMapEntry
+//
+// Description: This describes the Firmware Volume Flash Block Structure.
+// It is used in the Firmware Volume Header. There maybe
+// multiple entries in the array. The array ends with
+// NumBlocks=BlockLength=0
+//
+// Fields: Name Type Description
+// ------------------------------------------------------------
+// NumBlocks UINT32 Number of blocks of same size
+// BlockLength UINT32 Length of each block.
+//
+//**********************************************************************
+typedef struct {
+ UINT32 NumBlocks;
+ UINT32 BlockLength;
+} FvBlockMapEntry;
+
+#define FV_SIGNATURE 'HVF_'
+
+//**********************************************************************
+//<AMI_SHDR_START>
+//
+// Name: EFI_FIRMWARE_VOLUME_HEADER
+//
+// Description: This is the header for each firmware volume.
+//
+// Fields: Name Type Description
+// ------------------------------------------------------------
+// ZeroVector[16] UINT8 Volume is created with all zeros.
+// Utility may modify these values,
+// such as a jump address.
+//
+// FileSystemGuid EFI_GUID Name of File System
+// FvLength UINT64 Length of File System
+// Signature UINT32 _FVH
+// Attributes EFI_FVB_ATTRIBUTES
+// HeaderLength UINT16
+// Checksum UINT16 Header sums to zero.
+// Reserved[3] UINT8
+// Revision UINT8 Current revision of header.
+// FvBlockMap[1] FvBlockMapEntry
+// See definition of FvBlockMapEntry.
+// This is a variable array.
+//
+//**********************************************************************
+typedef struct {
+ UINT8 ZeroVector[16];
+ EFI_GUID FileSystemGuid;
+ UINT64 FvLength;
+ UINT32 Signature;
+#if PI_SPECIFICATION_VERSION < 0x00010000
+ EFI_FVB_ATTRIBUTES Attributes;
+#else
+ EFI_FVB_ATTRIBUTES_2 Attributes;
+#endif
+ UINT16 HeaderLength;
+ UINT16 Checksum;
+ UINT16 ExtHeaderOffset;
+ UINT8 Reserved[1];
+ UINT8 Revision;
+ FvBlockMapEntry FvBlockMap[1];
+} EFI_FIRMWARE_VOLUME_HEADER;
+
+
+
+typedef UINT8 EFI_FV_FILETYPE;
+
+#define EFI_FV_FILETYPE_ALL 0x00
+#define EFI_FV_FILETYPE_RAW 0x01
+#define EFI_FV_FILETYPE_FREEFORM 0x02
+#define EFI_FV_FILETYPE_SECURITY_CORE 0x03
+#define EFI_FV_FILETYPE_PEI_CORE 0x04
+#define EFI_FV_FILETYPE_DXE_CORE 0x05
+#define EFI_FV_FILETYPE_PEIM 0x06
+#define EFI_FV_FILETYPE_DRIVER 0x07
+#define EFI_FV_FILETYPE_COMBINED_PEIM_DRIVER 0x08
+#define EFI_FV_FILETYPE_APPLICATION 0x09
+// The value 0x0A is reserved and should not be used
+#define EFI_FV_FILETYPE_FIRMWARE_VOLUME_IMAGE 0x0B
+#define EFI_FV_FILETYPE_SMM 0x0A
+#define EFI_FV_FILETYPE_COMBINED_SMM_DXE 0x0C
+#define EFI_FV_FILETYPE_SMM_CORE 0x0D
+#define EFI_FV_FILETYPE_OEM_MIN 0xc0
+#define EFI_FV_FILETYPE_OEM_MAX 0xdf
+#define EFI_FV_FILETYPE_DEBUG_MIN 0xe0
+#define EFI_FV_FILETYPE_DEBUG_MAX 0xef
+#define EFI_FV_FILETYPE_FFS_MIN 0xf0
+#define EFI_FV_FILETYPE_FFS_MAX 0xff
+
+// 7A9354D9-0468-444a-81CE-0BF617D890DF
+#define EFI_FIRMWARE_FILE_SYSTEM_GUID \
+ {0x7A9354D9,0x0468,0x444a,0x81,0xCE,0x0B,0xF6,0x17,0xD8,0x90,0xDF}
+
+#define EFI_FIRMWARE_FILE_SYSTEM2_GUID \
+ { 0x8c8ce578, 0x8a3d, 0x4f1c, { 0x99, 0x35, 0x89, 0x61, 0x85, 0xc3, 0x2d, 0xd3 } }
+
+//**********************************************************************
+//<AMI_SHDR_START>
+//
+// Name: EFI_FFS_INTEGRITY_CHECK
+//
+// Description: This union make it easier to access the filed that
+// can be either a checksum or Tail Reference.
+//
+// Fields: Name Type Description
+// ------------------------------------------------------------
+// struct Checksum
+// Header UINT8
+// File UINT8
+// TailReference UINT16
+//
+//**********************************************************************
+typedef union {
+ struct {
+ UINT8 Header;
+ UINT8 File;
+ } Checksum;
+#if PI_SPECIFICATION_VERSION < 0x00010000
+ UINT16 TailReference;
+#else
+ UINT16 Checksum16;
+#endif
+} EFI_FFS_INTEGRITY_CHECK;
+
+//************************************************************
+// EFI_FFS_FILE_ATTRIBUTES
+//************************************************************
+typedef UINT8 EFI_FFS_FILE_ATTRIBUTES;
+// FFS File Attributes
+#if PI_SPECIFICATION_VERSION < 0x00010000
+#define FFS_ATTRIB_TAIL_PRESENT 0x01
+#define FFS_ATTRIB_RECOVERY 0x02
+#define FFS_ATTRIB_HEADER_EXTENSION 0x04
+#else
+#define FFS_ATTRIB_LARGE_FILE 0x01
+#define FFS_ATTRIB_FIXED 0x04
+#endif
+#define FFS_ATTRIB_DATA_ALIGNMENT 0x38
+#define FFS_ATTRIB_CHECKSUM 0x40
+
+//************************************************************
+// EFI_FFS_FILE_STATE
+//************************************************************
+typedef UINT8 EFI_FFS_FILE_STATE;
+// FFS File State Bits
+#define EFI_FILE_HEADER_CONSTRUCTION 0x01
+#define EFI_FILE_HEADER_VALID 0x02
+#define EFI_FILE_DATA_VALID 0x04
+#define EFI_FILE_MARKED_FOR_UPDATE 0x08
+#define EFI_FILE_DELETED 0x10
+#define EFI_FILE_HEADER_INVALID 0x20
+
+#if PI_SPECIFICATION_VERSION < 0x00010000
+typedef UINT16 EFI_FFS_FILE_TAIL;
+#endif
+
+#define EFI_FV_FILETYPE_FFS_PAD 0xF0
+
+
+//**********************************************************************
+//<AMI_SHDR_START>
+//
+// Name: EFI_FFS_FILE_HEADER
+//
+// Description: Each file has this header. Each FFS File Header must be
+// 8-bytes aligned.
+//
+// Fields: Name Type Description
+// ------------------------------------------------------------
+// Name EFI_GUID
+// IntegrityCheck EFI_FFS_INTEGRITY_CHECK
+// Type EFI_FV_FILETYPE
+// Attributes EFI_FFS_FILE_ATTRIBUTES
+// Size[3] UINT8
+// State EFI_FFS_FILE_STATE
+//
+//**********************************************************************
+typedef struct {
+ EFI_GUID Name;
+ EFI_FFS_INTEGRITY_CHECK IntegrityCheck;
+ EFI_FV_FILETYPE Type;
+ EFI_FFS_FILE_ATTRIBUTES Attributes;
+ UINT8 Size[3];
+ EFI_FFS_FILE_STATE State;
+} EFI_FFS_FILE_HEADER;
+
+
+// {1BA0062E-C779-4582-8566-336AE8F78F09}
+#define EFI_FFS_VOLUME_TOP_FILE_GUID \
+ {0x1BA0062E,0xC779,0x4582,0x85,0x66,0x33,0x6A,0xE8,0xF7,0x8F,0x9};
+
+//************************************************************
+// EFI_SECTION_TYPE
+//************************************************************
+typedef UINT8 EFI_SECTION_TYPE;
+//************************************************************
+// The section type EFI_SECTION_ALL is a pseudo type. It is
+// used as a wild card when retrieving sections. The section
+// type EFI_SECTION_ALL matches all section types.
+//************************************************************
+
+//**********************************************************************
+//<AMI_SHDR_START>
+//
+// Name: EFI_COMMON_SECTION_HEADER
+//
+// Description: Each section type has this common header. Each section
+// must be 4-byte aligned.
+//
+// Fields: Name Type Description
+// ------------------------------------------------------------
+// Size[3] UINT8
+// Type EFI_SECTION_TYPE
+//
+//**********************************************************************
+typedef struct {
+ UINT8 Size[3];
+ EFI_SECTION_TYPE Type;
+} EFI_COMMON_SECTION_HEADER;
+
+#define EFI_SECTION_ALL 0x00
+
+//************************************************************
+// Encapsulation section Type values
+//************************************************************
+#define EFI_SECTION_COMPRESSION 0x01
+#define EFI_SECTION_GUID_DEFINED 0x02
+//************************************************************
+// Leaf section Type values
+//************************************************************
+#define EFI_SECTION_PE32 0x10
+#define EFI_SECTION_PIC 0x11
+#define EFI_SECTION_TE 0x12
+#define EFI_SECTION_DXE_DEPEX 0x13
+#define EFI_SECTION_VERSION 0x14
+#define EFI_SECTION_USER_INTERFACE 0x15
+#define EFI_SECTION_COMPATIBILITY16 0x16
+#define EFI_SECTION_FIRMWARE_VOLUME_IMAGE 0x17
+#define EFI_SECTION_FREEFORM_SUBTYPE_GUID 0x18
+#define EFI_SECTION_RAW 0x19
+#define EFI_SECTION_PEI_DEPEX 0x1B
+#define EFI_SECTION_SMM_DEPEX 0x1C
+
+//**********************************************************************
+//<AMI_SHDR_START>
+//
+// Name: EFI_COMPRESSION_SECTION_HEADER
+//
+// Description: T
+//
+// Fields: Name Type Description
+// ------------------------------------------------------------
+//
+//**********************************************************************
+typedef struct {
+ UINT32 UncompressedLength;
+ UINT8 CompressionType;
+} EFI_COMPRESSION_SECTION_HEADER;
+
+//**********************************************************************
+//<AMI_SHDR_START>
+//
+// Name: EFI_COMPRESSION_SECTION_HEADER
+//
+// Description: T
+//
+// Fields: Name Type Description
+// ------------------------------------------------------------
+//
+//**********************************************************************
+typedef struct {
+ EFI_COMMON_SECTION_HEADER CommonHeader;
+//TODO: This definition DOES not match FV spec. However, that's how it is defined in EDK
+// EFI_COMPRESSION_SECTION_HEADER CompressionHeader;
+ UINT32 UncompressedLength;
+ UINT8 CompressionType;
+} EFI_COMPRESSION_SECTION;
+
+//************************************************************
+// CompressionType values
+//************************************************************
+#define EFI_NOT_COMPRESSED 0x00
+#define EFI_STANDARD_COMPRESSION 0x01
+#define EFI_CUSTOMIZED_COMPRESSION 0x02
+
+typedef struct {
+ EFI_COMMON_SECTION_HEADER CommonHeader;
+ EFI_GUID SectionDefinitionGuid;
+ UINT16 DataOffset;
+ UINT16 Attributes;
+} EFI_GUID_DEFINED_SECTION;
+
+//*****************************************************
+// Bit values for GuidedSectionHeader.Attributes
+//*****************************************************
+#define EFI_GUIDED_SECTION_PROCESSING_REQUIRED 0x01
+#define EFI_GUIDED_SECTION_AUTH_STATUS_VALID 0x02
+
+typedef struct {
+ EFI_COMMON_SECTION_HEADER CommonHeader;
+ UINT16 BuildNumber;
+ CHAR16 VersionString[1];
+} EFI_VERSION_SECTION;
+
+typedef struct {
+ EFI_COMMON_SECTION_HEADER CommonHeader;
+ EFI_GUID SubTypeGuid;
+} EFI_FREEFORM_SUBTYPE_GUID_SECTION;
+
+typedef struct {
+ EFI_COMMON_SECTION_HEADER CommonHeader;
+ CHAR16 FileNameString[1];
+} EFI_USER_INTERFACE_SECTION;
+
+typedef EFI_COMMON_SECTION_HEADER EFI_PE32_SECTION;
+typedef EFI_COMMON_SECTION_HEADER EFI_PIC_SECTION;
+typedef EFI_COMMON_SECTION_HEADER EFI_TE_SECTION;
+typedef EFI_COMMON_SECTION_HEADER EFI_COMPATIBILITY16_SECTION;
+typedef EFI_COMMON_SECTION_HEADER EFI_FIRMWARE_VOLUME_IMAGE_SECTION;
+
+#pragma pack(pop)
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2010, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//********************************************************************** \ No newline at end of file
diff --git a/Include/FastBoot.h b/Include/FastBoot.h
new file mode 100644
index 0000000..b3f8717
--- /dev/null
+++ b/Include/FastBoot.h
@@ -0,0 +1,409 @@
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2010, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
+
+//*************************************************************************
+// $Header: /Alaska/SOURCE/Modules/PTT/FastBoot.h 11 7/17/13 3:01a Simonchen $
+//
+// $Revision: 11 $
+//
+// $Date: 7/17/13 3:01a $
+//*************************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/SOURCE/Modules/PTT/FastBoot.h $
+//
+// 11 7/17/13 3:01a Simonchen
+// [TAG] EIP125309
+// [Category] New Feature
+// [Description] Add function to make sure before boot to OS, BIOS is in
+// fastboot path.
+// [Files] FastBoot.sdl
+// FastBootTseHook.c
+// FastBoot.c
+// FastBoot.h
+//
+// 10 7/11/13 10:23p Simonchen
+// [TAG] EIP126196
+// [Category] Bug Fix
+// [Severity] Minor
+// [Symptom] If set two HDD password and use Raid mode, fastboot will
+// fail
+// [RootCause] Because when AHCI driver unlock first HDD, Raid driver
+// will try to read all HDD, but second HDD is still lock, so access will
+// fail.
+// [Solution] Make sure all HDD unlock then Raid can access HDD.
+// And add "Support Raid Driver" token to control fastboot support Raid
+// feature or not.
+// [Files] FastBoot.c
+// FastBoot.sd
+// FastBoot.sdl
+// FastBootRuntime.c
+// FastBoot.h
+//
+// 9 4/18/13 5:37a Simonchen
+// [TAG] EIP113454
+// [Category] New Feature
+// [Description] This eip is created for implement or experiment for
+// Intel raid mode on fastboot.
+// [Files] FastBoot.h
+//
+// 8 8/07/12 4:43a Bibbyyeh
+// [TAG] EIP97545
+// [Category] Improvement
+// [Description] Updated PTT Module to Implement Support for
+// Initializing the Keyboard in First Call of Readkeystroke on Fastboot.
+// [Files] FastBoot.c FastBoot.h FastBootProtocol.h
+//
+// 7 6/27/12 4:23a Bibbyyeh
+// [TAG] EIP93038
+// [Category] New Feature
+// [Description] Ability to customize fast boot boot option selection
+// [Files] FastBoot.c FastBoot.h FastBoot.sdl
+//
+// 6 6/01/12 6:35a Bibbyyeh
+// [TAG] EIP90455
+// [Category] New Feature
+// [Description] PTT improvement - fastboot policy protocol for dynamic
+// control fast boot behavior.
+// [Files] FastBoot.c FastBoot.sdl FastBoot.sd FastBoot.uni
+// FastBootRuntime.c FastBootTseHook.c FastBootProtocol.h FastBoot.h
+//
+// 5 4/10/12 8:53a Bibbyyeh
+// [TAG] EIP87452
+// [Category] Improvement
+// [Description] 1. Create an elink "ReturnNormalMode", OEM/ODM can link
+// their procedure to handle the fastboot failure case. 2. Disconnect USB
+// controller when return to normal mode.
+// [Files] FastBoot.c FastBoot.h FastBoot.mak FastBoot.sdl
+//
+// 4 7/07/11 10:10a Bibbyyeh
+// [TAG] EIP63924
+// [Category] Improvement
+// [Description]
+// 1. Add elink for FastBoot mode change, default checking rule is check
+// post hotkey.
+// 2. Timer call back for check hotkey is not necessary. Create a protocol
+// for calling checkforkey in TSE.
+// 3. Since EIP68383 improve the performance of ps2 keyboard, we don't
+// need to exchange the initial order of ConIn/ConOut for getting more
+// time to detect hotkey.
+// [Files] FastBoot.sdl FastBoot.mak FastBoot.c FastBootTseHook.c
+// FastBoot.h FastBootProtocol.h
+//
+// 3 3/11/11 10:01p Bibbyyeh
+// [TAG] EIP54993
+// [Category] Improvement
+// [Description]
+// 1.Sync with Fastboot_10
+// 2.Remove token "SAVE_LAST_BOOT_DEVICE_CHECKSUM"
+// 3.Add token "CALL_DISPATCHER_AGAIN_IN_FASTBOOT"
+// 4.Use SimpleText protocol to detect mode change hotkey instead of
+// pBS->ConIn.
+// 5.Simplify the code about "AMILEGACY16_FASTBOOT_SOLUTION".
+// 6.Fixed a bug that SATA device can't be found if keep TSE execution on
+// fastboot path.
+// [Files] PPT.cif FastBoot.sdl FastBootRuntime.c FastBootTseHook.c
+// FastBoot.c FastBoot.h FastBoot.sd FastBootProtocol.cif
+// FastBootProtocol.h FastBootSMI.cif FastBootSMI.sdl FastBootSMI.c
+// FastBootSMI.dxs FastBootSMI.mak
+//
+// 2 11/17/10 9:44a Bibbyyeh
+// [TAG] EIP47397
+// [Category] Improvement
+// [Description] 1. Move all console related functions into PTT module
+// to avoid uncompatible with different core version.
+// 2. Install dumy SimpleTextCoin protocol when pBS->ConIn & pBS-ConOut is
+// Null.
+// 3. Raise timer call back as TPL_HIGH_LEVEL level, it will give BIOS
+// more chance to mode change successfully.
+// 4. Remove FASTBOOT_CONSOLE_SETTING token.Add setup option for fastboot
+// setting, "Skip VGA", "Skip USB", Skip "PS2".
+// [Files] FastBoot.c
+// FastBoot.h
+// FastBoot.sd
+// FastBoot.sdl
+// FastBoot.uni
+//
+// 1 10/12/10 9:04a Bibbyyeh
+// Initial check in
+//
+//*************************************************************************
+//<AMI_FHDR_START>
+//
+// Name: FastBoot.h
+//
+// Description:
+// Fast boot functions definitions
+//
+//<AMI_FHDR_END>
+//*************************************************************************
+#ifndef __FASTBOOT__H__
+#define __FASTBOOT__H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <Protocol/DevicePath.h>
+#include <Protocol/SimpleTextIn.h>
+#include <Protocol/SimpleTextOut.h>
+#include <HOB.h>
+#include <token.h>
+
+
+#define FAST_BOOT_TYPE_EFI 0x00000001 //last boot was from UEFI device
+#define FAST_BOOT_TYPE_LEGACY 0x00000000 //last boot was from Legacy device
+
+#if FASTBOOT_NEED_RESTART
+#define FAST_BOOT_RESTART L"FastbootRestart"
+#define FAST_BOOT_RESTART_COUNT L"FastbootRestartCount"
+
+//{39ac7cb1-789c-45f6-94f0-68873c5c1ff2}
+#define FAST_BOOT_RESTART_COUNT_GUID \
+ { 0x39ac7cb1, 0x789c, 0x45f6, 0x94, 0xf0, 0x68, 0x87, 0x3c, 0x5c, 0x1f, 0xf2 }
+
+//{800dabd7-ca8d-4611-bd77-3b200ebc275a}
+#define FAST_BOOT_RESTART_GUID \
+ { 0x800dabd7, 0xca8d, 0x4611, 0xbd, 0x77, 0x3b, 0x20, 0x0e, 0xbc, 0x27, 0x5a }
+#endif
+
+// {B540A530-6978-4da7-91CB-7207D764D262}
+#define FAST_BOOT_VARIABLE_GUID \
+ { 0xb540a530, 0x6978, 0x4da7, 0x91, 0xcb, 0x72, 0x7, 0xd7, 0x64, 0xd2, 0x62 }
+
+GUID_VARIABLE_DECLARATION(FastBootVariableGuid, FAST_BOOT_VARIABLE_GUID);
+
+// {50535FFD-1555-4329-A2C5-F3F44011A449}
+#define AMI_SATA_PRESENT_HOB_GUID \
+ {0x50535ffd, 0x1555, 0x4329, 0xa2, 0xc5, 0xf3, 0xf4, 0x40, 0x11, 0xa4, 0x49}
+
+
+#pragma pack(1)
+typedef struct _SATA_INFO {
+ UINT16 ClassCode; //Base class and Sub class code
+ UINT32 PresentPortBitMap; //Upper word is BDF, Lower word is port bitmap
+ /* Bit map description
+ IDE Mode:
+ Bit0: Primary Master
+ Bit1: Secondary Master
+ Bit2: Primary Slave
+ Bit3: Secondary Slave
+
+ AHCI or RAID mode:
+ Bit0: Port0
+ Bit1: Port1
+ Bit2: Port2
+ Bit3: Port3
+ Bit4: Port4
+ Bit5: Port5
+ */
+} SATA_INFO;
+
+#if SUPPORT_RAID_DRIVER
+typedef struct _SATA_PRESENT_HOB {
+ EFI_HOB_GUID_TYPE EfiHobGuidType;
+ UINT8 ControllerCount;
+ SATA_INFO SataInfo[4];
+} SATA_PRESENT_HOB;
+#endif
+
+#if SUPPORT_RAID_DRIVER
+typedef struct _SATA_DEVICE_DATA{
+ UINT16 BDF;
+ UINT16 ClassCode;
+ UINT8 DevType;
+ UINT8 PortNum; //IDE MODE: bit0:channel, bit1:device
+ UINT8 SerialNum[20];
+} SATA_DEVICE_DATA;
+#endif
+
+typedef struct _FAST_BOOT {
+ UINT32 BootOptionNumber : 16;
+ UINT32 BootType : 2;
+ UINT32 Reserved : 14;
+ UINT32 BootCount;
+ UINT16 DevStrCheckSum;
+//SATA device information
+#if SUPPORT_RAID_DRIVER
+ SATA_DEVICE_DATA SataDevice[MAX_SATA_DEVICE_COUNT] ;
+#endif
+//SATA controller information
+ UINT8 ControllerCount;
+ SATA_INFO SataInfo[4];
+} FAST_BOOT;
+#pragma pack()
+
+//FastBoot.c
+EFI_STATUS DummyInReset(
+ IN EFI_SIMPLE_TEXT_INPUT_PROTOCOL *This,
+ IN BOOLEAN EV
+);
+
+EFI_STATUS DummyReadKeyStroke(
+ IN EFI_SIMPLE_TEXT_INPUT_PROTOCOL *This,
+ OUT EFI_INPUT_KEY *Key
+);
+
+
+
+EFI_STATUS DummyReset(
+ IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
+ IN BOOLEAN EV
+);
+
+EFI_STATUS DummyOutputString(
+ IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
+ IN CHAR16 *String
+);
+
+EFI_STATUS DummyTestString(
+ IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
+ IN CHAR16 *String
+);
+
+EFI_STATUS DummyQueryMode(
+ IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
+ IN UINTN ModeNum,
+ OUT UINTN *Col,
+ OUT UINTN *Row
+);
+
+
+EFI_STATUS DummySetMode(
+ IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
+ IN UINTN ModeNum
+);
+
+
+EFI_STATUS DummySetAttribute(
+ IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
+ IN UINTN Attribute
+);
+
+EFI_STATUS DummyClearScreen(
+ IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This
+);
+
+EFI_STATUS DummySetCursorPosition(
+ IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
+ IN UINTN Column,
+ IN UINTN Row
+);
+
+EFI_STATUS DummyEnableCursor(
+ IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
+ IN BOOLEAN Visible
+);
+
+
+
+VOID FastBootWorker(
+ VOID
+);
+
+VOID ResetFastBootVariable(
+ VOID
+);
+
+BOOLEAN OemConfigurationChanged(
+ VOID
+);
+
+EFI_STATUS CreateLegacyFastBootOption(
+ FAST_BOOT *Var
+);
+
+EFI_STATUS CreateEfiFastBootOption(
+ IN EFI_LOAD_OPTION *BootOption,
+ IN UINTN OptionSize,
+ IN UINT16 OptionNumber
+);
+
+BOOLEAN IsSupportedDevice(
+ IN EFI_DEVICE_PATH_PROTOCOL *Dp,
+ OUT BOOLEAN *UsbMassStorage,
+ OUT BOOLEAN *HddFilePath
+);
+
+VOID FastBootClearBootFailFlag(
+ IN EFI_EVENT Event,
+ IN VOID *Context
+);
+
+BOOLEAN IsBootToShell(
+ IN EFI_DEVICE_PATH_PROTOCOL *Dp
+);
+
+VOID FastBootReadyToBootNotify(
+ IN EFI_EVENT Event,
+ IN VOID *Context
+);
+
+EFI_STATUS FastLegacyBoot(
+ VOID
+);
+
+EFI_STATUS FastEfiBoot(
+ VOID
+);
+
+EFI_STATUS CheckLoader(
+ IN EFI_DEVICE_PATH_PROTOCOL *Dp
+);
+
+EFI_STATUS TseHandShake();
+VOID ReturnToNormalBoot(
+ VOID
+);
+
+BOOLEAN IsRuntime(
+ VOID
+);
+
+VOID FbConnectInputDevices(
+ VOID
+);
+
+
+//FastBootTseHook.c
+ //(EIP63924+)>
+EFI_STATUS FastBootCheckForKey(
+ IN BOOLEAN *EnterSetup,
+ IN UINT32 *BootFlow);
+
+EFI_STATUS FastBootStopCheckForKeyTimer();
+
+ //<(EIP63924+)
+//Hook
+typedef BOOLEAN (IS_VALID_FASTBOOT_BOOT_OPTION_FUNC_PTR)(
+ IN UINTN BootOrderIndex,
+ IN EFI_LOAD_OPTION *BootOption
+);
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2010, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
diff --git a/Include/FastBootIncludes.cif b/Include/FastBootIncludes.cif
new file mode 100644
index 0000000..87a6ba8
--- /dev/null
+++ b/Include/FastBootIncludes.cif
@@ -0,0 +1,8 @@
+<component>
+ name = "FastBoot Includes"
+ category = ModulePart
+ LocalRoot = "Include"
+ RefName = "FastBootIncludes"
+[files]
+"FastBoot.h"
+<endComponent>
diff --git a/Include/Flash.h b/Include/Flash.h
new file mode 100644
index 0000000..049282e
--- /dev/null
+++ b/Include/Flash.h
@@ -0,0 +1,109 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2009, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/BIN/Core/Include/Flash.h 9 11/14/11 5:43p Artems $
+//
+// $Revision: 9 $
+//
+// $Date: 11/14/11 5:43p $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Core/Include/Flash.h $
+//
+// 9 11/14/11 5:43p Artems
+// Added guid for flash write lock event
+//
+// 8 8/27/10 1:21p Felixp
+// The prototype of the FlashInit function is added. The function is
+// implemented by the Flash module.
+//
+// 7 5/21/09 4:30p Felixp
+// Declaration of FlashRead function is added.
+//
+// 6 12/29/06 2:56p Felixp
+// Flash Interface Updated
+//
+// 5 12/18/06 10:50a Robert
+// Updated prototype to allow Is Program complete function to check an
+// entire block of data not just one byte at a time
+//
+// 4 11/01/06 5:49p Robert
+// updated for use with newest Flash module code
+//
+// 3 10/27/06 10:35a Felixp
+// FlashVirtualFixup declaration added
+//
+// 2 3/04/05 10:22a Mandal
+//
+// 1 2/01/05 11:23a Felixp
+//
+// 1 1/28/05 12:57p Felixp
+//
+//**********************************************************************
+//<AMI_FHDR_START>
+//
+// Name: Flash.h
+//
+// Description:
+//
+//<AMI_FHDR_END>
+//**********************************************************************
+#ifndef __FLASH__H__
+#define __FLASH__H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+#include <EFI.h>
+
+
+#define AMI_EVENT_FLASH_WRITE_LOCK \
+ { 0x49D34AE7, 0x9454, 0x4551, 0x8F, 0x71, 0x46, 0x7D, 0x8C, 0x0E, 0x4E, 0xF5 }
+
+VOID FlashDeviceWriteEnable();
+VOID FlashDeviceWriteDisable();
+BOOLEAN FlashWriteBlock(UINT8* BlockAddress, UINT8 *Data);
+EFI_STATUS FlashInit(volatile UINT8* pBlockAddress);
+
+VOID FlashVirtualFixup(EFI_RUNTIME_SERVICES *pRS);
+
+BOOLEAN FlashEraseBlock(volatile UINT8* BlockAddress);
+VOID FlashBlockWriteEnable(UINT8* BlockAddress);
+VOID FlashBlockWriteDisable(UINT8* BlockAddress);
+BOOLEAN FlashProgram(volatile UINT8* Address, UINT8 *Data, UINT32 Length);
+BOOLEAN FlashRead(volatile UINT8* Address, UINT8 *Data, UINT32 Length);
+
+#define BLOCK(adr) ( (UINTN)(adr) - (((UINTN)(adr) - FlashDeviceBase)%FlashBlockSize) )
+
+extern const UINT32 FlashBlockSize;
+extern const UINTN FlashDeviceBase;
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2009, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//********************************************************************** \ No newline at end of file
diff --git a/Include/FlashPart.cif b/Include/FlashPart.cif
new file mode 100644
index 0000000..a64f513
--- /dev/null
+++ b/Include/FlashPart.cif
@@ -0,0 +1,8 @@
+<component>
+ name = "Flash - Includes"
+ category = ModulePart
+ LocalRoot = "Include\"
+ RefName = "FLASH_INCLUDES"
+[files]
+"FlashPart.h"
+<endComponent>
diff --git a/Include/FlashPart.h b/Include/FlashPart.h
new file mode 100644
index 0000000..f1fe728
--- /dev/null
+++ b/Include/FlashPart.h
@@ -0,0 +1,290 @@
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2009, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/SOURCE/Flash_Combined_2/Core/FlashPart.h 14 12/15/09 5:46a Calvinchen $
+//
+// $Revision: 14 $
+//
+// $Date: 12/15/09 5:46a $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/SOURCE/Flash_Combined_2/Core/FlashPart.h $
+//
+// 14 12/15/09 5:46a Calvinchen
+// Improvement : Added Flash Chip Name support.
+//
+// 13 6/24/09 3:11a Calvinchen
+// (EIP22177) Updated for Aptio Source Enhancement.
+//
+// 11 1/08/08 2:23p Robert
+//
+// 10 11/09/07 3:47p Alexp
+// Added common FlashRead function.
+//
+// 9 10/09/07 5:47p Robert
+// removed data structure that was added by mistake
+//
+// 7 2/21/07 11:52a Robert
+// Removed unneeded extern definition
+//
+// 6 2/20/07 6:42p Robert
+// added packing for the data structures in the flash module
+//
+// 5 2/16/07 3:50p Robert
+// Updated the Flash_Part data structure to contain the FlashSectorSize
+// parameter so that SPI parts could contain this information in its
+// Identification Structure. It is used to define the erase sector size
+// for SPI parts
+//
+// 3 12/29/06 3:03p Felixp
+//
+// 2 12/20/06 1:47p Felixp
+// Bug fix in BLOCK macro
+//
+// 1 12/18/06 3:39p Robert
+// Initial Check in
+//
+// 1 10/31/06 2:30p Sivagarn
+// Initial Checkin
+//
+//
+//**********************************************************************
+
+#ifndef __FLASH_H_
+#define __FLASH_H_
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#pragma pack(push, 1)
+
+#include <Flash.h>
+
+
+//============================================================================
+// Flash part module function prototypes
+
+typedef VOID (EFIAPI *FLASH_READ_COMMAND) (
+ volatile UINT8* pByteAddress,
+ UINT8 *Byte,
+ UINT32 *Length
+ );
+typedef VOID (EFIAPI *FLASH_ERASE_COMMAND) (
+ volatile UINT8* pBlockAddress
+ );
+typedef VOID (EFIAPI *FLASH_PROGRAM_COMMAND) (
+ volatile UINT8* pByteAddress,
+ UINT8 *Byte,
+ UINT32 *Length
+ );
+typedef VOID (EFIAPI *FLASH_PAGE_PROGRAM_COMMAND) (
+ volatile UINT8* pByteAddress,
+ UINT8* Byte
+ );
+typedef BOOLEAN (EFIAPI *FLASH_IS_ERASE_COMPLETED) (
+ volatile UINT8* pBlockAddress,
+ BOOLEAN *pError,
+ UINTN *pStatus
+ );
+typedef BOOLEAN (EFIAPI *FLASH_IS_PROGRAM_COMPLETED)(
+ volatile UINT8* pByteAddress,
+ UINT8 *Byte,
+ UINT32 Length,
+ BOOLEAN *pError,
+ UINTN *pStatus
+ );
+typedef VOID (EFIAPI *FLASH_BLOCK_WRITE_ENABLE) (
+ UINT8* pBlockAddress
+ );
+typedef VOID (EFIAPI *FLASH_BLOCK_WRITE_DISABLE) (
+ UINT8* pBlockAddress
+ );
+typedef VOID (EFIAPI *FLASH_DEVICE_WRITE_ENABLE)(VOID);
+typedef VOID (EFIAPI *FLASH_DEVICE_WRITE_DISABLE)(VOID);
+typedef VOID (EFIAPI *FLASH_VIRTUAL_FIXUP)(EFI_RUNTIME_SERVICES *pRS);
+
+
+//============================================================================
+// Flash Part Structure Types
+
+//<AMI_STHDR_START>
+//============================================================================
+// Structure: OPCODE_CMD
+//
+// Description: This structure contains data that describe the different
+// commands for the flash parts
+//
+// Fields:
+// Opcode - UINT8 - Contains the command value
+// OpcodeType - UINT8 - Contains the type of command
+// - Read no Address
+// - Write no Address
+// - Read with Address
+// - Write with Address
+//
+// Referral:
+// None
+//============================================================================
+//<AMI_STHDR_END>
+typedef struct _OPCODE_CMD
+ {
+ UINT8 Opcode;
+ UINT8 OpcodeType;
+ } OPCODE_CMD;
+
+//<AMI_STHDR_START>
+//============================================================================
+// Structure: FLASH_INFO
+//
+// Description:
+// This structure contains data that describe flash part
+// information that is needed for each family of parts for the
+// interface to work properly
+//
+// Fields:
+// Write - OPCODE_CMD - Contains data for the Command for the part
+// Read - OPCODE_CMD - Contains data for the Command for the part
+// Erase - OPCODE_CMD - Contains data for the Command for the part
+// ReadStatus - OPCODE_CMD - Contains data for the Command for the part
+// ReadId - OPCODE_CMD - Contains data for the Command for the part
+// WriteStatus - OPCODE_CMD - Contains data for the Command for the part
+// WriteStatusEnable - OPCODE_CMD - Contains data for the Command for
+// the part
+// WriteEnable - OPCODE_CMD - Contains data for the Command for the part
+// PageSize - UINT32 - the number of bytes that can be
+// programed into the part with one write command
+// SectorSize - UINT32 - The size of the area to be erased by the
+// Erase command
+//
+// Referral:
+// OPCODE_CMD
+//============================================================================
+//<AMI_STHDR_END>
+typedef struct _FLASH_INFO {
+ OPCODE_CMD Write;
+ OPCODE_CMD Read;
+ OPCODE_CMD Erase;
+ OPCODE_CMD ReadStatus;
+ OPCODE_CMD ReadId;
+ OPCODE_CMD WriteStatus;
+ OPCODE_CMD WriteStatusEnable;
+ OPCODE_CMD WriteEnable;
+ UINT32 PageSize;
+ UINT32 SectorSize;
+ } FLASH_INFO;
+
+
+//<AMI_STHDR_START>
+//============================================================================
+// Structure: FLASH_WRITE_DATA
+//
+// Description: This structure contains variables that define the data to be
+// read from or written to the flash part
+//
+// Fields:
+// Data - BOOLEAN - Defines whether this read or write command has data
+// associated with it
+// Length - UINT32 - Defines the amount of data to be read or written
+// Values - UINT8 * - Pointer to a buffer that can contain the data
+//
+// Referral:
+// None
+//============================================================================
+//<AMI_STHDR_END>
+typedef struct _FLASH_WRITE_DATA {
+ BOOLEAN Data;
+ UINT32 Length;
+ UINT8 *Values;
+ }FLASH_WRITE_DATA;
+
+//<AMI_STHDR_START>
+//============================================================================
+// Structure: FLASH_PART
+//
+// Description: This structure defines the generic interface for the flash part
+//
+// Fields:
+// FlashReadCommand - FLASH_READ_COMMAND - generic flash function for
+// reading the flash part
+// FlashEraseCommand - FLASH_ERASE_COMMAND - generic flash function for
+// erasing the flash part
+// FlashProgramCommand - FLASH_PROGRAM_COMMAND - generic flash function
+// for programming the flash part
+// FlashIsEraseCompleted - FLASH_IS_ERASE_COMPLETED - generic flash
+// function for checking if the erase command is finished
+// FlashIsProgramCompleted - FLASH_IS_PROGRAM_COMPLETED - generic flash
+// function for checking if the program command is finished
+// FlashBlockWriteEnable - FLASH_BLOCK_WRITE_ENABLE - generic flash
+// function for write enabling the defined block in the flash part
+// FlashBlockWriteDisable - FLASH_BLOCK_WRITE_DISABLE - generic flash
+// function for write disabling the defined block in the flash part
+// FlashDeviceWriteEnable - FLASH_DEVICE_WRITE_ENABLE - generic flash
+// function for write enabling the flash part
+// FlashDeviceWriteDisable - FLASH_DEVICE_WRITE_DISABLE - generic flash
+// function for write disabling the flash part
+// FlashVirtualFixup - FLASH_VIRTUAL_FIXUP - generic flash function for
+// providing the virtual addressing fixups needed for the flash
+// routines to work during runtime
+// FlashProgramSize - UINT32 - the amount of data that can be
+// programmed into the flash part during one program command
+// FlashSectorSize - UINT32 - the size of area that is erased from
+// the flash part during an erase command
+//
+// Referral:
+// The types mentioned above are pointers to functions
+//
+//============================================================================
+//<AMI_STHDR_END>
+typedef struct _FLASH_PART {
+ FLASH_READ_COMMAND FlashReadCommand;
+ FLASH_ERASE_COMMAND FlashEraseCommand;
+ FLASH_PROGRAM_COMMAND FlashProgramCommand;
+ FLASH_IS_ERASE_COMPLETED FlashIsEraseCompleted;
+ FLASH_IS_PROGRAM_COMPLETED FlashIsProgramCompleted;
+ FLASH_BLOCK_WRITE_ENABLE FlashBlockWriteEnable;
+ FLASH_BLOCK_WRITE_DISABLE FlashBlockWriteDisable;
+ FLASH_DEVICE_WRITE_ENABLE FlashDeviceWriteEnable;
+ FLASH_DEVICE_WRITE_DISABLE FlashDeviceWriteDisable;
+ FLASH_VIRTUAL_FIXUP FlashVirtualFixup;
+ UINT32 FlashProgramSize;
+ UINT32 FlashSectorSize;
+ UINT8 *FlashPartNumber;
+ } FLASH_PART;
+
+extern UINTN FwhFeatureSpaceBase;
+
+
+#pragma pack(pop)
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2009, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//************************************************************************* \ No newline at end of file
diff --git a/Include/FlashUpd.h b/Include/FlashUpd.h
new file mode 100644
index 0000000..a4353ac
--- /dev/null
+++ b/Include/FlashUpd.h
@@ -0,0 +1,221 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2014, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/SOURCE/Modules/SecureFlashPkg/FlashUpdate/FlashUpd.h 8 3/18/14 3:05p Alexp $
+//
+// $Revision: 8 $
+//
+// $Date: 3/18/14 3:05p $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/SOURCE/Modules/SecureFlashPkg/FlashUpdate/FlashUpd.h $
+//
+// 8 3/18/14 3:05p Alexp
+// change year to 2014 in ftr and hdr
+//
+// 7 6/12/13 3:56p Alexp
+// Defined AMI_FW_CAPSULE_FFS_GUID and AMI_FW_CAPSULE_SECTION_GUID
+//
+// 6 2/21/13 12:42p Alexp
+// Add gFlashUpdBootModePpiGuid Variable declaration/extern
+//
+// 5 12/07/11 2:09p Alexp
+// Removed unused "MC" type from "VerifyTask".
+//
+// 4 10/17/11 2:33p Alexp
+// add parent function IsFlashUpdate()
+//
+// 3 8/05/11 3:20p Alexp
+// removed Flash Update Policy protocol definitions
+//
+// 2 7/20/11 7:17p Alexp
+// remove older check in comments
+//
+// 1 7/01/11 4:39p Alexp
+//
+//**********************************************************************
+
+#ifndef _EFI_FLASH_UPD_H_
+#define _EFI_FLASH_UPD_H_
+
+#include "Pei.h"
+
+//----------------------------------------------------------------------------
+// EFI FW Capsule Recovery PPI
+//----------------------------------------------------------------------------
+
+//2A6E902B-F1F3-4275-BC7B-40FD4B5481E7
+#define EFI_PEI_BOOT_IN_FLASH_UPDATE_MODE_PEIM_PPI \
+ { 0x2A6E902B, 0xF1F3, 0x4275, 0xBC, 0x7B, 0x40, 0xFD, 0x4B, 0x54, 0x81, 0xE7 }
+
+// Variable declaration/extern
+GUID_VARIABLE_DECLARATION(gFlashUpdBootModePpiGuid, EFI_PEI_BOOT_IN_FLASH_UPDATE_MODE_PEIM_PPI);
+
+// FW Capsule Recovery
+// {5E794317-A07E-45df-94BB-1C997D6232CA}
+//#define AMI_FW_RECOVERY_CAPSULE_GUID \
+// { 0x5e794317, 0xa07e, 0x45df, 0x94, 0xbb, 0x1c, 0x99, 0x7d, 0x62, 0x32, 0xca }
+
+//GUID used to identify FW Capsule Hdr FFS file within the Firmware Volume.
+// Aptio Tools must support this GUID
+#define AMI_FW_CAPSULE_FFS_GUID \
+ {0x414D94AD, 0x998D, 0x47D2, 0xBF, 0xCD, 0x4E, 0x88, 0x22, 0x41, 0xDE, 0x32}
+//Section GUID used to identify FW Capsule Hdr section within FwCap FFS file.
+// Aptio Tools must support this GUID
+#define AMI_FW_CAPSULE_SECTION_GUID \
+ {0x5A88641B, 0xBBB9, 0x4AA6, 0x80, 0xF7, 0x49, 0x8A, 0xE4, 0x07, 0xC3, 0x1F}
+
+//<AMI_SHDR_START>
+//----------------------------------------------------------------------------
+// Name: FLASH_UPD_POLICY
+//
+// Description: This structure is returned by Flash Update Policy protocol
+//
+// Fields: Name Type Description
+//----------------------------------------------------------------------------
+// FlashUpdate FLASH_OP Bit map of Enabled Flash update methods (online, recovery, capsule)
+// BBUpdate FLASH_OP Bit map of Enabled CRTM block update methods
+//----------------------------------------------------------------------------
+//<AMI_SHDR_END>
+typedef struct {
+ UINT8 FlashUpdate; //FLASH_OP
+ UINT8 BBUpdate;
+} FLASH_UPD_POLICY;
+
+//----------------------------------------------------------------------------
+// IsRecovery prototypes
+//----------------------------------------------------------------------------
+// Bit Mask of checks to perform on Aptio FW Image
+// 1- Capsule integrity
+// 2- Verify Signature
+// 3- Verify FW Key
+// 4- Verify FW Version compatibility.
+// To prevent possible re-play attack:
+// update current FW with older version with lower security.
+typedef enum {
+ Cap=1,
+ Sig,
+ Key,
+ Ver
+} VerifyTask;
+
+BOOLEAN IsFlashUpdate (
+ EFI_PEI_SERVICES **PeiServices,
+ EFI_BOOT_MODE *BootMode
+);
+// next 2 are left for backward compatibility with pre-ported SbPei.c
+BOOLEAN IsFlashUpdateRecovery (
+ EFI_PEI_SERVICES **PeiServices
+);
+
+BOOLEAN IsFlashUpdateS3Capsule (
+ EFI_PEI_SERVICES **PeiServices,
+ EFI_BOOT_MODE *BootMode
+);
+
+EFI_STATUS FwCapsuleInfo (
+ IN EFI_PEI_SERVICES **PeiServices,
+ IN OUT VOID **pCapsuleName,
+ IN OUT UINTN *pCapsuleSize,
+ OUT BOOLEAN *ExtendedVerification
+);
+
+EFI_STATUS VerifyFwImage(
+ IN EFI_PEI_SERVICES **PeiServices,
+ IN OUT VOID **pCapsule,
+ IN OUT UINT32 *pCapsuleSize,
+ IN OUT UINT32 *FailedVTask
+);
+
+//----------------------------------------------------------------------------
+// EFI Variable defines
+//----------------------------------------------------------------------------
+// {974231D5-ED4B-44d1-8870-CE515CC14D68}
+#define FLASH_UPDATE_GUID \
+ {0x974231d5, 0xed4b, 0x44d1, 0x88, 0x70, 0xce, 0x51, 0x5c, 0xc1, 0x4d, 0x68}
+
+#define FLASH_UPDATE_VAR L"AmiFlashUpd"
+
+//Enumerated Flash update methods
+typedef enum {
+ FlDisabled = 0,
+ FlRecovery = 1, // power can be lost, FW Capsule image read from file on the recovery media
+ FlCapsule = 2, // S3/SW reset with memory intact. FW Capsule resides in Memory
+ FlRuntime = 4, // runtime update using secured SMM Flash protocol
+} FLASH_OP;
+
+// UINT32 ROMSection
+// Bit mask of enumerated main Aptio Flash blocks.
+// FLASH_BLOCK_TYPE = 0-BB, 1-MAIN, 2-NV, 3-EC, etc.
+// TBD. Need to be replaced by the flash map with guidded types and offsets within new flash image
+// Order a complete re-flash if new flash map is different(map hash don't compare)
+typedef enum {
+ FV_BB
+ ,FV_MAIN
+ ,FV_NV
+ ,ROM_EC
+ ,ROM_NC = 0x80 //Types from NC_BLOCK to 0xFF are reserved for non critical blocks
+} FLASH_ROM_SECTIONS;
+
+//<AMI_SHDR_START>
+//----------------------------------------------------------------------------
+// Name: AMI_FLASH_UPDATE_BLOCK
+//
+// Description: This structure represents NVRAM variable stored to
+// indicate pending Flash Update operation
+//
+// Fields: Name Type Description
+//----------------------------------------------------------------------------
+// FlashOpType FLASH_OP Pending Flash update method
+// ROMSection UINT32 Bit map of FW image blocks to be flashed.
+// Can be 32bit map of the mem ranges within ROM Map data structure.
+// FwImage
+// AmiRomFileName CHAR8[16] Null terminated file name on recovery media. FlashOpType=Recovery
+// CapsuleMailboxPtr UINT64[2] Capsule Mailbox Ptr. FlashOpType=Capsule
+// ImageSize UINT32 Size of FW image including the Capsule's header
+// MonotonicCounter UINT32 Current value of EFI Hi Monotonic Counter.
+// Makes sure no replies happpen, fresh FlashUpd request
+//----------------------------------------------------------------------------
+//<AMI_SHDR_END>
+#pragma pack(1)
+typedef struct {
+ UINT8 FlashOpType;
+ UINT32 ROMSection;
+ union {
+ CHAR8 AmiRomFileName[16]; // can be a file path
+ EFI_PHYSICAL_ADDRESS CapsuleMailboxPtr[2];
+ } FwImage;
+ UINT32 ImageSize;
+ UINT32 MonotonicCounter;
+} AMI_FLASH_UPDATE_BLOCK;
+
+#pragma pack()
+
+#endif
+
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2014, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
diff --git a/Include/FlashUpdInc.cif b/Include/FlashUpdInc.cif
new file mode 100644
index 0000000..9793e53
--- /dev/null
+++ b/Include/FlashUpdInc.cif
@@ -0,0 +1,8 @@
+<component>
+ name = "Flash Update Include"
+ category = ModulePart
+ LocalRoot = "Include\"
+ RefName = "FlashUpdInc"
+[files]
+"FlashUpd.h"
+<endComponent>
diff --git a/Include/GenericSio.h b/Include/GenericSio.h
new file mode 100644
index 0000000..0dac5b9
--- /dev/null
+++ b/Include/GenericSio.h
@@ -0,0 +1,433 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2005, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/BIN/Core/Include/GenericSio.h 13 11/11/11 4:03p Yakovlevs $
+//
+// $Revision: 13 $
+//
+// $Date: 11/11/11 4:03p $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Core/Include/GenericSio.h $
+//
+// 13 11/11/11 4:03p Yakovlevs
+// [TAG] EIP72716
+// [Category] Improvement
+// [Description] Added Messages, Fixed issues in proposed by AMI China
+// solution.
+// [Files] GenericSio.c; GenericSio.h
+//
+// 12 5/06/11 5:09p Yakovlevs
+// Made depencency on PI_SPECIFICATIO_VERSION tolen
+//
+// 11 5/04/11 6:02p Yakovlevs
+// [TAG] EIP 56527
+// [Category] New Feature
+// [Description] AMI_SIO_PROTOCOL was the source for PI 1.2 spec
+// proposal. Will require some minor modification of the interface plus
+// adding EFI_SIO_PROTOCOL Modify() function.
+// [Files] GenericSio.h; GenericSio.c.
+//
+// 10 12/01/08 10:32a Yakovlevs
+// Added isAfterBootScript SIO initialization step definition.
+//
+// 9 6/11/07 11:55p Yakovlevs
+// Changed definition of SIO_RESOURCE_FLAG
+// SIO_NO_RES value 0x80 meands Device does not use resources it just
+// needs to be enabled.
+//
+// 8 5/14/07 7:05p Yakovlevs
+// Changes to support SIO Setup Data Override.
+// // Usefull if SIO uses none standard Setup Screens and Data Storage.
+//
+// 7 12/26/06 10:37a Yakovlevs
+// Changes for dynamic IRQ assignment
+//
+// 6 7/21/06 11:36a Yakovlevs
+// Added ImageHandle field to the end of SPIO_DEV structure
+//
+// 5 4/10/06 5:22p Yakovlevs
+// ACPI NO ACPI mode fix.
+// Added function prototypes for Setting Device _PRS in NONE ACPI mode
+//
+// 4 4/03/06 5:04p Felixp
+// Headers updated in accordance with new PCI and Super I/O infrastructure
+//
+// 3 11/23/05 11:22a Felixp
+// dev_status renamed to DEV_STATUS.
+//
+// 2 11/21/05 5:00p Ambikas
+// Added SIO_DEV_STATUS definition and related constants.
+//
+// 1 2/08/05 10:52a Felixp
+//
+// 2 2/07/05 7:04p Yakovlevs
+// Preparation has been done to split SIO module into Generic and Porting
+// Part
+//
+// 1 2/01/05 3:06a Felixp
+//
+// 1 2/01/05 3:05a Felixp
+//
+// 4 1/31/05 11:49p Felixp
+//
+// 3 1/31/05 11:44p Felixp
+//
+// 2 1/18/05 3:21p Felixp
+// PrintDebugMessage renamed to Trace
+//
+// 1 1/11/05 7:09p Felixp
+//
+// 2 12/23/04 10:25a Felixp
+//
+// 4 12/22/04 6:42p Yakovlevs
+//
+// 2 10/20/04 11:44a Yakovlevs
+//
+// 1 10/19/04 7:21p Yakovlevs
+//
+// 1 1/16/04 10:26a Markw
+//
+//**********************************************************************
+//<AMI_FHDR_START>
+//
+// Name: Sio.h
+//
+// Description: AMI Sio Protocol Definitions.
+//
+//<AMI_FHDR_END>
+//**********************************************************************
+#ifndef _GENERIC_SIO_H_
+#define _GENERIC_SIO_H_
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <Efi.h>
+#include <Protocol\DevicePath.h>
+#include <Protocol\BootScriptSave.h>
+#include <Protocol\AmiSio.h>
+#include <Protocol\PciIo.h>
+#include <AmiDxeLib.h>
+#if ((defined PI_SPECIFICATION_VERSION) && (PI_SPECIFICATION_VERSION >= 0x00010014))
+#include <Protocol\SuperIo.h>
+#endif;
+#include <Token.h>
+//---------------------------------------------------------
+//To exclude SIO Messages
+#ifndef TRACE_SIO
+#define TRACE_SIO TRACE_ALWAYS
+#endif
+
+#if SIO_DEBUG_MESSAGES
+#define SIO_TRACE(Arguments) TRACE(Arguments)
+#else
+#define SIO_TRACE(Arguments)
+#endif
+//---------------------------------------------------------
+
+
+#define PNP_HID EFI_PNP_ID
+
+//--------------------------------------------
+//Defines how to enter Exit config Mode
+typedef enum _SPIO_GFG_OP_TYPE{
+ cfgNone=0, //Not required any sequence
+ cfgByteSeq,
+ cfgRoutine,
+ cfgMaxCfg
+} SPIO_GFG_OP_TYPE;
+
+typedef VOID (*SPIO_ROUTINE)();
+
+typedef struct _SPIO_SCRIPT {
+ BOOLEAN IdxDat; //1=IDX 0=DAT
+ BOOLEAN WrRd; //1=Write 0=Read
+ UINT8 Value; //if WrRd=0 wait for this data to come
+} SPIO_SCRIPT;
+
+typedef struct SPIO_SCRIPT_LST {
+ SPIO_GFG_OP_TYPE OpType;
+ UINTN InstrCount;
+ VOID *Instruction[]; //using woid pointer to specify
+ //script or routine
+} SPIO_SCRIPT_LST;
+
+//==================================================================
+//Definitions of SIO Shared Resource Flags if this flags set
+//and will share following type of resources with PREVIOUSE device
+#define SIO_SHR_NONE 0x00
+#define SIO_SHR_IO1 0x01 //device shares resources programmed in SIO_1_BASE_REG
+#define SIO_SHR_IO2 0x02 //device shares resources programmed in SIO_2_BASE_REG
+#define SIO_SHR_IO (SIO_SHR_IO1 | SIO_SHR_IO2) //device shares resources programmed in both SIO_BASE_REG
+#define SIO_SHR_IRQ1 0x04
+#define SIO_SHR_IRQ2 0x08
+#define SIO_SHR_IRQ (SIO_SHR_IRQ1 | SIO_SHR_IRQ2)
+#define SIO_SHR_DMA1 0x10
+#define SIO_SHR_DMA2 0x20
+#define SIO_SHR_DMA (SIO_SHR_DMA1 | SIO_SHR_DMA2)
+#define SIO_SHR_ALL (SIO_SHR_IO | SIO_SHR_IRQ | SIO_SHR_DMA)
+#define SIO_NO_RES 0x80 //this bit will be set if device not using any resources but must be enabled
+//all other values reserved
+
+#pragma pack(push,1)
+
+ typedef struct _SIO_DEV_V_DATA {
+ UINT8 DevImplemented;
+ UINT16 DevBase1;
+ UINT16 DevBase2;
+ UINT8 DevIrq1;
+ UINT8 DevIrq2;
+ UINT8 DevDma1;
+ UINT8 DevDma2;
+ } SIO_DEV_V_DATA;
+
+ typedef struct _SIO_DEV_NV_DATA {
+ UINT8 DevEnable;
+ UINT8 DevPrsId;
+ UINT8 DevMode;
+ } SIO_DEV_NV_DATA;
+
+#pragma pack(pop)
+
+typedef enum {
+ isNone=0,
+ isPrsSelect,
+ isBeforeActivate,
+ isAfterActivate,
+ isGetSetupData,
+ isAfterBootScript, //this init step will be invoked after all SIO regs added to boot script
+ //for each device which has initialization function implemented.
+ isMaxInitStep
+} SIO_INIT_STEP;
+
+//SIO Component Initialization Routine ptrototype
+typedef EFI_STATUS (*SIO_INIT)( IN AMI_SIO_PROTOCOL *This,
+ IN EFI_PCI_IO_PROTOCOL *PciIo,
+ IN SIO_INIT_STEP InitStep);
+
+//Device table used for porting see YourSioNameDxe.c
+typedef struct _SPIO_DEV_LST {
+ SIO_DEV_TYPE Type;
+ UINT8 LDN; //LogicalDevice #
+ UINT8 UID; //Unique ID if there are 2 or more
+ //devices of the same type in this SPIO
+ UINT16 PnpId;
+ BOOLEAN Implemented;//Implemented on this Platform (has connector)
+ BOOLEAN HasSetup; //TRUE If Device has SETUP screen and se
+ UINT8 Flags; //set if Device shares all or some of it's resources
+ UINT8 AslName[5]; //ASL DEVICE OBJECT NAME to look for _PRS in AML
+ //if this field not 0,0,0,0 the rest of the table ignored.
+ UINT16 ResBase[2]; //Base Address for SIO_1_BASE_REG and SIO_2_BASE_REG
+ UINT8 ResLen[2];
+ UINT16 IrqMask[2];
+ UINT8 DmaMask[2];
+ SIO_INIT InitRoutine;
+// UINTN SetupOffset; //offset in SIO_SETUP_VAR for this device if any
+// UINTN VolatileOffset; //offset in SIO_SETUP_VOLATILE data for this device if any
+} SPIO_DEV_LST;
+
+//This structure will define a multiple SIO Porting Information
+//It will be an array of such structures each of them will represent
+//a different SIO Device.
+typedef struct _SPIO_LIST_ITEM {
+ //This Information is needed to identify right LPC bridge for the SIO
+ // value of -1 (0xF..F) means Do not check this parameter
+ UINT32 IsaVenDevId;
+ UINT32 IsaSubVenId;
+ UINT8 IsaBusNo;
+ UINT8 IsaDevNo;
+ UINT8 IsaFuncNo;
+// //This is the information Needed Get Sio Setup Data
+// //----------------------------------------
+// UINT16 *SetupVarName;
+// UINT16 *VolatileVarName;
+// EFI_GUID *SioVarGuid;
+// //This is the information Needed to access SIO Generic Registers
+// //----------------------------------------
+ UINT16 SioIndex;
+ UINT16 SioData;
+ // Dev Select and Activate
+ UINT8 DevSel;
+ UINT8 Activate;
+ UINT8 ActivVal;
+ UINT8 DeactVal;
+ //Generic registers location
+ UINT8 Base1Hi;
+ UINT8 Base1Lo;
+ UINT8 Base2Hi;
+ UINT8 Base2Lo;
+ UINT8 Irq1;
+ UINT8 Irq2;
+ UINT8 Dma1;
+ UINT8 Dma2;
+ //List of devices inside this SIO
+ UINTN DevCount;
+ SPIO_DEV_LST *SioDevList;
+ //List of valid registers inside SIO to check if they has to be saved
+ //----------------------------------------
+ //in BOOT_SCRIPT_SAVE for S3 state Resume
+ //This is for global registers which are the same for all devices in SIO
+ UINTN GlobalInclRegCount;
+ UINT8 *GlobalIncludeReg; //Buffer will be located in GSPIO structure
+ //This is for Local registers they are unique for each device in SIO
+ UINTN LocalInclRegCount;
+ UINT8 *LocalIncludeReg; //Buffer will be located in SIO_DEV structure
+ //----------------------------------------
+ //How To enter/exit Configuration mode if any
+ SPIO_SCRIPT_LST *EnterCfgMode;
+ SPIO_SCRIPT_LST *ExitCfgMode;
+}SPIO_LIST_ITEM;
+
+typedef struct _GSPIO GSPIO;
+
+#if ((defined PI_SPECIFICATION_VERSION) && (PI_SPECIFICATION_VERSION >= 0x00010014))
+typedef struct _EFI_SIO_DATA{
+ EFI_SIO_PROTOCOL EfiSio;
+ struct _SPIO_DEV *Owner;
+}EFI_SIO_DATA;
+#endif
+
+//SPIO Device Private Data section
+typedef struct _SPIO_DEV {
+ AMI_SIO_PROTOCOL AmiSio;
+ EFI_DEVICE_PATH_PROTOCOL *DevicePath;
+ EFI_HANDLE Handle;
+// BOOLEAN Implemented; //Present in SPIO_DEV.DeviceInfo;
+ BOOLEAN Started;
+ BOOLEAN Assigned;
+ BOOLEAN Initialized;
+ BOOLEAN IrqReserved;
+// UINT8 LDN; //Present in SPIO_DEV.DeviceInfo;
+// UINTN Flags; //Present in SPIO_DEV.DeviceInfo;
+ struct _SPIO_DEV *ResOwner;
+ struct _SPIO_DEV *ResConsumer;
+// SIO_DEV_TYPE Type; //Present in SPIO_DEV.DeviceInfo;
+ EFI_EISAID EisaId;
+ T_ITEM_LIST CRS;
+ T_ITEM_LIST PRS;
+ //SIO_INIT InitRoutine; //Present in SPIO_DEV.DeviceInfo;
+//we will need it to generate boot script for s3 resume
+ UINT8 *LocalCfgDump;
+ GSPIO *Owner;
+ SPIO_DEV_LST *DeviceInfo;
+ SIO_DEV_NV_DATA NvData;
+ SIO_DEV_V_DATA VlData;
+ EFI_HANDLE ImageHandle;
+#if ((defined PI_SPECIFICATION_VERSION) && (PI_SPECIFICATION_VERSION >= 0x00010014))
+ EFI_SIO_DATA EfiSioData;
+#endif;
+} SPIO_DEV;
+
+//Global Super IO device Private Structure
+typedef struct _GSPIO {
+ //UINT16 Indx;
+ //UINT16 Data;
+// EFI_HANDLE ImageHandle; don't need it since we have it gAmiSioDriverBinding.ImageHandle
+ EFI_HANDLE CntrHandle;
+ EFI_HANDLE SupportedHandle; //
+ EFI_DEVICE_PATH_PROTOCOL *CntrDevPath;
+ EFI_PCI_IO_PROTOCOL *IsaBrgPciIo;
+ BOOLEAN InCfgMode;
+ UINTN DeviceCount;
+ SPIO_DEV **DeviceList;
+ //we will need it to generate boot script for s3 resume
+ UINT8 *GlobalCfgDump;
+ SPIO_LIST_ITEM *SpioInfo;
+ EFI_BOOT_SCRIPT_SAVE_PROTOCOL *BootScript;
+} GSPIO;
+
+#define SIO_DEV_STATUS_VAR_NAME L"SIO_DEV_STATUS_VAR"
+
+#define SIO_DEV_STATUS_VAR_GUID \
+ {0x5820de98, 0xfc8e, 0x4b0b, 0xa4, 0xb9, 0xa, 0x94, 0xd, 0x16, 0x2a, 0x7e}
+
+//
+// Bit values of various SIO devices defined in SIO_DEV_STATUS
+//
+#define SIO_DEV_COM1 0x0001
+#define SIO_DEV_COM2 0x0002
+#define SIO_DEV_LPT 0x0004
+#define SIO_DEV_FDC 0x0008
+#define SIO_DEV_SB16 0x0010
+#define SIO_DEV_MIDI 0x0020
+#define SIO_DEV_MSSAUDIO 0x0040
+#define SIO_DEV_FMSYNTH 0x0080
+#define SIO_DEV_GAME1 0x0100
+#define SIO_DEV_GAME2 0x0200
+#define SIO_DEV_KBC 0x0400
+#define SIO_DEV_EC 0x0800
+#define SIO_DEV_PS2MS 0x4000
+
+typedef union {
+ UINT16 DEV_STATUS;
+ struct {
+ UINT16 SerialA : 1; //bit 0 - Serial A
+ UINT16 SerialB : 1; //bit 1 - Serial B
+ UINT16 Lpt : 1; //bit 2 - LPT
+ UINT16 Fdd : 1; //bit 3 - FDD
+ UINT16 Sb16 : 1; //bit 4 - SB16 Audio
+ UINT16 Midi : 1; //bit 5 - MIDI
+ UINT16 MssAudio : 1; //bit 6 - MSS Audio
+ UINT16 FmSynth : 1; //bit 7 - AdLib sound (FM synth)
+ UINT16 Game1 : 1; //bit 8 - Game port #1
+ UINT16 Game2 : 1; //bit 9 - Game port #2
+ UINT16 Key60_64 : 1; //bit a - KBC
+ UINT16 Ec62_66 : 1; //bit b - EC
+ UINT16 Res1 : 1; //bit c - Reserved
+ UINT16 Res2 : 1; //bit d - Reserved
+ UINT16 Ps2Mouse : 1; //bit e - PS/2 Mouse
+ UINT16 Res3 : 1; //bit f - Reserved
+ };
+} SIO_DEV_STATUS;
+
+#if ACPI_SUPPORT
+//_PRS Functions definition for ACPI
+EFI_STATUS GetPrsFromAml(SPIO_DEV* Dev, UINT8 *PrsName ,UINTN Index);
+#else
+//and NO ACPI mode
+EFI_STATUS SetUartPrs(SPIO_DEV *Dev);
+EFI_STATUS SetLptPrs(SPIO_DEV *Dev, BOOLEAN UseDma);
+EFI_STATUS SetFdcPrs(SPIO_DEV *Dev);
+EFI_STATUS SetPs2kPrs(SPIO_DEV *Dev);
+EFI_STATUS SetPs2mPrs(SPIO_DEV *Dev);
+EFI_STATUS SetGamePrs(SPIO_DEV *Dev);
+EFI_STATUS SetMpu401Prs(SPIO_DEV *Dev);
+#endif
+
+
+
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2005, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
diff --git a/Include/HIIDB.h b/Include/HIIDB.h
new file mode 100644
index 0000000..373808f
--- /dev/null
+++ b/Include/HIIDB.h
@@ -0,0 +1,225 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2004, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/BIN/Core/Include/HIIDB.h 9 12/29/09 1:16p Yakovlevs $Revision: 14 $
+//
+// $Date: 12/29/09 1:16p $
+//**********************************************************************
+// Revision History
+// ----------------
+//$Log: /Alaska/BIN/Core/Include/HIIDB.h $
+//
+// 9 12/29/09 1:16p Yakovlevs
+// Added Log
+//
+//**********************************************************************
+
+//**********************************************************************
+//<AMI_FHDR_START>
+//
+// Name: HiiDb.h
+//
+// Description: Human Interface Infrastructure Driver Internal definitions
+//
+//<AMI_FHDR_END>
+//**********************************************************************
+
+
+#ifndef _HII_DRIVER_
+#define _HII_DRIVER_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+#if EFI_SPECIFICATION_VERSION>0x20000
+#pragma message("The HiiDb.h header contains UEFI 2.0 definitions")
+#pragma message("UEFI 2.1 projects must use UefiHii.h instead")
+#pragma message("The supported version of the UEFI specification is defined by the EFI_SPECIFICATION_VERSION SDL token")
+#error the header is depricated
+#else
+#include <Efi.h>
+#include <AmiDxeLib.h>
+#include <Protocol\ExtHii.h>
+
+//=====================================================================
+//Initial Counts for the database
+//TODO//TODO//TODO//TODO//TODO//TODO//TODO//TODO//TODO
+ //Define SDL tokens for that
+#define FONT_DB_MAX_COUNT 0x10000
+#define KEYB_DB_MAX_COUNT 107
+#define STRING_DB_MAX_COUNT 0x200
+#define FORM_DB_MAX_COUNT 0x50
+
+//=====================================================================
+#define NG_SIZE 19
+#define WG_SIZE 38
+
+typedef enum {
+ lNone=0,
+ lDel,
+ lAdd
+} LBL_ACTION;
+
+
+#pragma pack(push,1)
+//=====================================================================
+
+//typedef UINT8 HII_GL_COL[GLYPH_H];
+//for internal storage we don't need to store UNICODE weight it will be
+//an index in FontDB array
+typedef struct _HII_N_FONT {
+ UINT8 Attr; //Font Glyph Attributes
+ UINT8 GlData[NG_SIZE];
+} HII_N_FONT;
+
+typedef struct _HII_W_FONT {
+ UINT8 Attr; //Font Glyph Attributes
+ UINT8 GlData[WG_SIZE];
+} HII_W_FONT;
+
+typedef struct _HII_HANDLE{
+ EFI_HII_HANDLE Handle;
+ UINT32 PriLang; //Primary Language Index
+ EFI_GUID Guid; //GUID asociated with this Handle
+ T_ITEM_LIST SecLang;
+ STRING_REF StrCount;
+ STRING_REF NextStrToken; //on that handle
+ BOOLEAN HasStr;
+ VOID *Ifr;
+}HII_HANDLE;
+
+typedef struct _HII_LANG {
+ UINT16 sName[4]; //ISO 639-2 3 char + 0 terminator
+ UINT16 *lName;
+ UINT32 Attr;
+} HII_LANG;
+
+
+typedef struct _HII_STORE {
+ EFI_IFR_VARSTORE *VarStore;
+ UINT8 *VarData;
+ BOOLEAN Updated;
+}HII_STORE;
+
+//Order is very importand for this srtructure
+typedef struct _HII_STR {
+//--Fields Used For DBE Key --------
+ STRING_REF Token; //size16 LSW
+ UINT32 LangIdx;//size32
+ EFI_HII_HANDLE Handle; //size16 total = 8 bytes -> UINT64 MSW
+//----------------------------------
+ EXT_STR_INFO String;
+ EXT_STR_INFO NewStr;
+} HII_STR;
+
+typedef struct _HII_STRKEY {
+ STRING_REF Token; //size16 LSW
+ UINT32 LangIdx;//size32
+ EFI_HII_HANDLE Handle; //size16 total = 8 bytes -> UINT64 MSW
+}HII_STRKEY;
+
+typedef struct _HII_LABEL {
+ EFI_FORM_LABEL LabelId;
+ EFI_IFR_LABEL *Label; //Points to a label in initial Package
+ EFI_IFR_OP_HEADER *LabelData;
+ UINTN DataCount; //number of OPCodes excluding label
+ UINTN DataLength; //in bytes
+ HII_FORM *OwnerForm;
+ BOOLEAN Updated; //flag to know free *LabelData or not... initialy it is part of a
+ //Form Data buffer but after first update it is independent buffer
+ T_ITEM_LIST Objects; //Points on list of HII_OBJECT Structure
+ T_ITEM_LIST Conditions; //Indpendent Conditions the ones which don't have an object;
+ HII_LABEL_UPDATE_CALLBACK UpdateCallBack;
+} HII_LABEL;
+
+//typedef struct _HII_COND {
+// EFI_IFR_OP_HEADER *Action; //EFI_IFR_INCONSISTENT_IF_OP or EFI_IFR_GRAYOUT_IF_OP or EFI_IFR_SUPPRESS_IF_OP;
+// EFI_IFR_OP_HEADER *Compare; //EFI_IFR_EQ_ID_VAL_OP or EFI_IFR_EQ_ID_ID_OP or EFI_IFR_EQ_ID_LIST_OP or EFI_IFR_EQ_VAR_VAL_OP
+// EFI_IFR_OP_HEADER *Logic; //EFI_IFR_OR_OP or EFI_IFR_AND_OP or EFI_IFR_OR_OP with nexrt condition in the list
+// BOOLEAN Result; //to what logical value (TRUE or FALSE) condition Evaluates
+// BOOLEAN Updated; //Signifies wethe Result reflects Current conditio of the Object;
+//} HII_COND;
+
+typedef struct _HII_OBJECT {
+ EFI_IFR_OP_HEADER *ObjectCode;
+ T_ITEM_LIST Options; //for composite opcodes like ORDERED_LIST or ONE_OF
+ HII_STORE *Store1; //Default NvStore
+ HII_STORE *Store2; //when EFI_IFR_VARSTORE_SELECT_PAIR_OP and EFI_IFR_EQ_ID_ID
+ T_ITEM_LIST Conditions; //just pointers to logical opcodes they must be following in right order
+ //including starting conditions as INCONSISTENT_IF_OP or GRAYOUT_IF_OP or
+ //SUPPRESS_IF_OP, Storage Compare options as EQ_xxx.. Logical AND OR NOT
+ //operators and END_IF OpCode.
+ T_ITEM_LIST SuppressStores; // varstores used for suppress conditions
+ BOOLEAN Supress; //TRUE if any conditions exicts which changes Suppress property of an Object
+ BOOLEAN GrayOut; //TRUE if any conditions exicts which changes GrayOut property of an Object
+ UINT16 Incons; //TRUE if any conditions exicts which changes Inconsistant property of an Object
+} HII_OBJECT;
+
+
+#pragma pack(pop)
+
+typedef struct _HII_KB_LAYOUT_DATA {
+ UINTN HandleIndex;
+ UINT8 KeyDscCount;
+ EFI_KEY_DESCRIPTOR *KeyDsc;
+ //Here will be following the actual key descriprors
+} HII_KB_LAYOUT_DATA;
+
+typedef struct _HII_KB_DATA {
+ UINTN ActiveLayout;
+ //Like T_ITEM_LIST
+ UINTN KblInitCount;
+ UINTN KblCount;
+ HII_KB_LAYOUT_DATA **KbLayout;
+} HII_KB_DATA;
+
+
+
+//=====================================================================
+//Definitions of Hii Databases
+typedef struct _HII_DB {
+ EFI_HII_PROTOCOL_OLD HiiProtocolOld;
+ EFI_HII_PROTOCOL HiiProtocolNew;
+ EXT_HII_PROTOCOL HiiExtProtocol;
+ EFI_HANDLE HiiHandle;
+ EFI_HANDLE ImageHandle;
+ EFI_HII_HANDLE NextHiiHandle;
+ T_ITEM_LIST HandleDb;
+ T_ITEM_LIST LangDb;
+ HII_N_FONT *FontDb[FONT_DB_MAX_COUNT];
+ T_ITEM_LIST IfrDb;
+ DBE_DATABASE StringDb;
+ HII_KB_DATA KeybdDb;
+}HII_DB;
+#endif // #if EFI_SPECIFICATION_VERSION>0x20000
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2004, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
diff --git a/Include/HOB.h b/Include/HOB.h
new file mode 100644
index 0000000..f643f3b
--- /dev/null
+++ b/Include/HOB.h
@@ -0,0 +1,530 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2009, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/BIN/Core/Include/HOB.h 8 6/16/11 2:54p Felixp $
+//
+// $Revision: 8 $
+//
+// $Date: 6/16/11 2:54p $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Core/Include/HOB.h $
+//
+// 8 6/16/11 2:54p Felixp
+// Surround backward compatibility definitions with #if
+// BACKWARD_COMPATIBLE_MODE
+//
+// 7 6/16/11 9:25a Felixp
+// Backward compatible definitions of the capsule HOB are added.
+//
+// 6 4/13/11 6:38p Artems
+// EIP 56529: Replaced old Capsule HOB definitions with new one as per PI
+// spec v.1.2
+//
+// 5 2/05/11 1:49p Artems
+// Added FirmwareVolumeHob2 type
+//
+// 4 4/26/10 9:55a Felixp
+// Clean up
+//
+// 3 5/22/09 1:35p Felixp
+// Clean up
+//
+// 2 5/19/06 10:18p Felixp
+// EFI_HOB_POINTERS renamed to EFI_PEI_HOB_POINTERS
+//
+// 1 1/28/05 12:44p Felixp
+//
+// 2 1/18/05 3:21p Felixp
+// PrintDebugMessage renamed to Trace
+//
+// 1 12/23/04 9:41a Felixp
+//
+// 4 3/19/04 11:04a Markw
+// Removed ; at end of define.
+//
+// 3 1/06/04 5:01p Yakovlevs
+//
+// 2 12/17/03 11:05a Markw
+// Added includes
+//
+// 1 12/16/03 10:41a Markw
+// Move HOB.h to include directory.
+//
+// 1 12/12/03 3:40p Markw
+// Hob definitions
+//
+//
+//**********************************************************************
+//<AMI_FHDR_START>
+//
+// Name: HOB.H
+//
+// Description:
+// EFI Header file. It has standard definitions defined by the
+// EFI Specification Version 1.10 12/01/02
+//
+//<AMI_FHDR_END>
+//**********************************************************************
+#ifndef __HOB__H__
+#define __HOB__H__
+
+#include "efi.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define NextHob(Hob,Type) ((Type *) ((UINT8 *) Hob + ((EFI_HOB_GENERIC_HEADER *)Hob)->HobLength))
+
+//******************************************************
+// HobType values
+//******************************************************
+#define EFI_HOB_TYPE_HANDOFF 0x0001
+#define EFI_HOB_TYPE_MEMORY_ALLOCATION 0x0002
+#define EFI_HOB_TYPE_RESOURCE_DESCRIPTOR 0x0003
+#define EFI_HOB_TYPE_GUID_EXTENSION 0x0004
+#define EFI_HOB_TYPE_FV 0x0005
+#define EFI_HOB_TYPE_CPU 0x0006
+#define EFI_HOB_TYPE_MEMORY_POOL 0x0007
+#define EFI_HOB_TYPE_FV2 0x0009
+#define EFI_HOB_TYPE_LOAD_PEIM_UNUSED 0x000A
+#define EFI_HOB_TYPE_UEFI_CAPSULE 0x000B
+#define EFI_HOB_TYPE_UNUSED 0xFFFE
+#define EFI_HOB_TYPE_END_OF_HOB_LIST 0xFFFF
+
+
+
+//**********************************************************************
+//<AMI_SHDR_START>
+//
+// Name: EFI_HOB_GENERIC_HEADER
+//
+// Description: This is a generic header for all HOBs.
+//
+// Fields: Name Type Description
+// ------------------------------------------------------------
+// HobType UINT16 Type of Hob
+// HobLength UINT16 Length of HOB
+// Reserved UINT32
+//
+//**********************************************************************
+
+
+typedef struct _EFI_HOB_GENERIC_HEADER{
+ UINT16 HobType;
+ UINT16 HobLength;
+ UINT32 Reserved;
+} EFI_HOB_GENERIC_HEADER;
+
+
+
+
+//**********************************************************************
+//<AMI_SHDR_START>
+//
+// Name: EFI_HOB_HANDOFF_INFO_TABLE
+//
+// Description: This is a generic header for all HOBs.
+//
+// Fields: Name Type Description
+// ------------------------------------------------------------
+// Header EFI_HOB_GENERIC_HEADER
+// Version UINT32
+// BootMode EFI_BOOT_MODE
+// EfiMemoryTop EFI_PHYSICAL_ADDRESS
+// EfiMemoryBottom EFI_PHYSICAL_ADDRESS
+// EfiFreeMemoryTop EFI_PHYSICAL_ADDRESS
+// EfiFreeMemoryBottom EFI_PHYSICAL_ADDRESS
+// EfiEndOfHobList EFI_PHYSICAL_ADDRESS
+//
+//**********************************************************************
+typedef struct _EFI_HOB_HANDOFF_INFO_TABLE {
+ EFI_HOB_GENERIC_HEADER Header;
+ UINT32 Version;
+ EFI_BOOT_MODE BootMode;
+ EFI_PHYSICAL_ADDRESS EfiMemoryTop;
+ EFI_PHYSICAL_ADDRESS EfiMemoryBottom;
+ EFI_PHYSICAL_ADDRESS EfiFreeMemoryTop;
+ EFI_PHYSICAL_ADDRESS EfiFreeMemoryBottom;
+ EFI_PHYSICAL_ADDRESS EfiEndOfHobList;
+} EFI_HOB_HANDOFF_INFO_TABLE;
+
+// Version values
+#define EFI_HOB_HANDOFF_TABLE_VERSION 0x0009
+
+
+//**********************************************************************
+//<AMI_SHDR_START>
+//
+// Name: EFI_HOB_MEMORY_ALLOCATION_HEADER
+//
+// Description: Memory Description used by EFI_HOB_MEMORY_ALLOCATION HOB.
+// This stores the purpose (as a GUID), the location,
+// and type as used by the EFI 1.1 allocate pages.
+//
+// Fields: Name Type Description
+// ------------------------------------------------------------
+// Name EFI_GUID Purpose
+// MemoryBaseAddress EFI_PHYSICAL_ADDRESS Start
+// MemoryLength UINT64 Length
+// MemoryType EFI_MEMORY_TYPE Type used by allocate pages.
+// Reserved[4] UINT8
+//
+//**********************************************************************
+typedef struct _EFI_HOB_MEMORY_ALLOCATION_HEADER {
+ EFI_GUID Name;
+ EFI_PHYSICAL_ADDRESS MemoryBaseAddress;
+ UINT64 MemoryLength;
+ EFI_MEMORY_TYPE MemoryType; // UINT32
+ UINT8 Reserved[4]; // Padding for Itanium
+ // processor family
+} EFI_HOB_MEMORY_ALLOCATION_HEADER;
+
+
+//**********************************************************************
+//<AMI_SHDR_START>
+//
+// Name: EFI_HOB_MEMORY_ALLOCATION
+//
+// Description: Describes memory not used by the HOB list.
+//
+// Fields: Name Type Description
+// ------------------------------------------------------------
+// Header EFI_HOB_GENERIC_HEADER
+// AllocDescriptor EFI_HOB_MEMORY_ALLOCATION_HEADER - Memory desciption
+// Additional fields pertaining to the Name Guid.
+//
+//**********************************************************************
+typedef struct _EFI_HOB_MEMORY_ALLOCATION {
+ EFI_HOB_GENERIC_HEADER Header;
+ EFI_HOB_MEMORY_ALLOCATION_HEADER AllocDescriptor;
+ //
+ // Additional data pertaining to the Name Guid.
+ //
+} EFI_HOB_MEMORY_ALLOCATION;
+
+
+//**********************************************************************
+//<AMI_SHDR_START>
+//
+// Name: EFI_HOB_MEMORY_ALLOCATION_STACK
+//
+// Description: Descibes PEI BSP Physical Memory Stack.
+// Same structure as EFI_HOB_MEMORY_ALLOCATION,
+// except AllocDescriptor has a specific Name of
+// EFI_HOB_MEMORY_ALLOC_STACK_GUID.
+//
+//
+// Fields: Name Type Description
+// ------------------------------------------------------------
+// Header EFI_HOB_GENERIC_HEADER
+// AllocDescriptor EFI_HOB_MEMORY_ALLOCATION_HEADER - Memory desciption
+//
+//**********************************************************************
+typedef struct _EFI_HOB_MEMORY_ALLOCATION_STACK {
+ EFI_HOB_GENERIC_HEADER Header;
+ EFI_HOB_MEMORY_ALLOCATION_HEADER AllocDescriptor;
+} EFI_HOB_MEMORY_ALLOCATION_STACK;
+
+#define EFI_HOB_MEMORY_ALLOC_STACK_GUID \
+ {0x4ed4bf27, 0x4092, 0x42e9, 0x80, 0x7d, 0x52, 0x7b, 0x1d, 0x0,0xc9, 0xbd};
+
+
+//**********************************************************************
+//<AMI_SHDR_START>
+//
+// Name: EFI_HOB_MEMORY_ALLOCATION_BSP_STORE
+//
+// Description: Descibes PEI BSP Physical Memory Store.
+// This for the Itanium CPU only.
+// Same structure as EFI_HOB_MEMORY_ALLOCATION,
+// except AllocDescriptor has a specific Name of
+// EFI_HOB_MEMORY_ALLOC_BSP_STORE_GUID.
+//
+//
+// Fields: Name Type Description
+// ------------------------------------------------------------
+// Header EFI_HOB_GENERIC_HEADER
+// AllocDescriptor EFI_HOB_MEMORY_ALLOCATION_HEADER - Memory desciption
+//
+//**********************************************************************
+typedef struct _EFI_HOB_MEMORY_ALLOCATION_BSP_STORE {
+ EFI_HOB_GENERIC_HEADER Header;
+ EFI_HOB_MEMORY_ALLOCATION_HEADER AllocDescriptor;
+} EFI_HOB_MEMORY_ALLOCATION_BSP_STORE;
+
+#define EFI_HOB_MEMORY_ALLOC_BSP_STORE_GUID \
+ {0x564b33cd, 0xc92a, 0x4593, 0x90, 0xbf, 0x24, 0x73, 0xe4, 0x3c,0x63, 0x22};
+
+
+//**********************************************************************
+//<AMI_SHDR_START>
+//
+// Name: EFI_HOB_MEMORY_ALLOCATION
+//
+// Description:
+//
+// Fields: Name Type Description
+// ------------------------------------------------------------
+// Header EFI_HOB_GENERIC_HEADER
+// AllocDescriptor EFI_HOB_MEMORY_ALLOCATION_HEADER - Memory desciption
+// ModuleName EFI_GUID
+// EntryPoint EFI_PHYSICAL_ADDRESS
+//
+//**********************************************************************
+typedef struct {
+ EFI_HOB_GENERIC_HEADER Header;
+ EFI_HOB_MEMORY_ALLOCATION_HEADER MemoryAllocationHeader;
+ EFI_GUID ModuleName;
+ EFI_PHYSICAL_ADDRESS EntryPoint;
+} EFI_HOB_MEMORY_ALLOCATION_MODULE;
+
+#define EFI_HOB_MEMORY_ALLOC_MODULE_GUID \
+ {0xf8e21975, 0x899, 0x4f58, 0xa4, 0xbe, 0x55, 0x25, 0xa9, 0xc6,0xd7, 0x7a}
+
+//*********************************************************
+// EFI_RESOURCE_TYPE
+//*********************************************************
+typedef UINT32 EFI_RESOURCE_TYPE;
+#define EFI_RESOURCE_SYSTEM_MEMORY 0x00000000
+#define EFI_RESOURCE_MEMORY_MAPPED_IO 0x00000001
+#define EFI_RESOURCE_IO 0x00000002
+#define EFI_RESOURCE_FIRMWARE_DEVICE 0x00000003
+#define EFI_RESOURCE_MEMORY_MAPPED_IO_PORT 0x00000004
+#define EFI_RESOURCE_MEMORY_RESERVED 0x00000005
+#define EFI_RESOURCE_IO_RESERVED 0x00000006
+#define EFI_RESOURCE_MAX_MEMORY_TYPE 0x00000007
+
+//*******************************************************
+// EFI_RESOURCE_ATTRIBUTE_TYPE
+//*******************************************************
+typedef UINT32 EFI_RESOURCE_ATTRIBUTE_TYPE;
+// These types can be ORed together as needed.
+//
+// The first three enumerations describe settings
+//
+#define EFI_RESOURCE_ATTRIBUTE_PRESENT 0x00000001
+#define EFI_RESOURCE_ATTRIBUTE_INITIALIZED 0x00000002
+#define EFI_RESOURCE_ATTRIBUTE_TESTED 0x00000004
+//
+// The rest of the settings describe capabilities
+//
+#define EFI_RESOURCE_ATTRIBUTE_SINGLE_BIT_ECC 0x00000008
+#define EFI_RESOURCE_ATTRIBUTE_MULTIPLE_BIT_ECC 0x00000010
+#define EFI_RESOURCE_ATTRIBUTE_ECC_RESERVED_1 0x00000020
+#define EFI_RESOURCE_ATTRIBUTE_ECC_RESERVED_2 0x00000040
+#define EFI_RESOURCE_ATTRIBUTE_READ_PROTECTED 0x00000080
+#define EFI_RESOURCE_ATTRIBUTE_WRITE_PROTECTED 0x00000100
+#define EFI_RESOURCE_ATTRIBUTE_EXECUTION_PROTECTED 0x00000200
+#define EFI_RESOURCE_ATTRIBUTE_UNCACHEABLE 0x00000400
+#define EFI_RESOURCE_ATTRIBUTE_WRITE_COMBINEABLE 0x00000800
+#define EFI_RESOURCE_ATTRIBUTE_WRITE_THROUGH_CACHEABLE 0x00001000
+#define EFI_RESOURCE_ATTRIBUTE_WRITE_BACK_CACHEABLE 0x00002000
+#define EFI_RESOURCE_ATTRIBUTE_16_BIT_IO 0x00004000
+#define EFI_RESOURCE_ATTRIBUTE_32_BIT_IO 0x00008000
+#define EFI_RESOURCE_ATTRIBUTE_64_BIT_IO 0x00010000
+#define EFI_RESOURCE_ATTRIBUTE_UNCACHED_EXPORTED 0x00020000
+
+
+//**********************************************************************
+//<AMI_SHDR_START>
+//
+// Name: EFI_HOB_RESOURCE_DESCRIPTOR
+//
+// Description: Used to describe system memory map including system memory,
+// MMIO, IO, and Firmware Device.
+//
+// Fields: Name Type Description
+// ------------------------------------------------------------
+// Header EFI_HOB_GENERIC_HEADER
+// Owner EFI_GUID
+// ResourceType EFI_RESOURCE_TYPE
+// ResourceAttribute EFI_RESOURCE_ATTRIBUTE_TYPE
+// PhysicalStart EFI_PHYSICAL_ADDRESS
+// ResourceLength UINT64
+//
+//**********************************************************************
+typedef struct _EFI_HOB_RESOURCE_DESCRIPTOR {
+ EFI_HOB_GENERIC_HEADER Header;
+ EFI_GUID Owner;
+ EFI_RESOURCE_TYPE ResourceType;
+ EFI_RESOURCE_ATTRIBUTE_TYPE ResourceAttribute;
+ EFI_PHYSICAL_ADDRESS PhysicalStart;
+ UINT64 ResourceLength;
+} EFI_HOB_RESOURCE_DESCRIPTOR;
+
+//**********************************************************************
+//<AMI_SHDR_START>
+//
+// Name: EFI_HOB_GUID_TYPE
+//
+// Description: Implementation specific data here.
+//
+// Fields: Name Type Description
+// ------------------------------------------------------------
+// Header EFI_HOB_GENERIC_HEADER
+// Name EFI_GUID
+// Guid specific data here.
+//
+//**********************************************************************
+typedef struct _EFI_HOB_GUID_TYPE {
+ EFI_HOB_GENERIC_HEADER Header;
+ EFI_GUID Name;
+ //
+ // Guid specific data goes here
+ //
+} EFI_HOB_GUID_TYPE;
+
+//**********************************************************************
+//<AMI_SHDR_START>
+//
+// Name: EFI_HOB_FIRMWARE_VOLUME
+//
+// Description: Describes Base and Length of a Firmware Volume
+//
+// Fields: Name Type Description
+// ------------------------------------------------------------
+// Header EFI_HOB_GENERIC_HEADER
+// BaseAddress EFI_PHYSICAL_ADDRESS
+// Length UINT64
+//
+//**********************************************************************
+typedef struct {
+ EFI_HOB_GENERIC_HEADER Header;
+ EFI_PHYSICAL_ADDRESS BaseAddress;
+ UINT64 Length;
+} EFI_HOB_FIRMWARE_VOLUME;
+
+//**********************************************************************
+//<AMI_SHDR_START>
+//
+// Name: EFI_HOB_FIRMWARE_VOLUME2
+//
+// Description: Describes a Firmware Volume.
+//
+// Fields: Name Type Description
+// ------------------------------------------------------------
+// Header EFI_HOB_GENERIC_HEADER
+// BaseAddress EFI_PHYSICAL_ADDRESS Base Address of Firmware Volume
+// Length UINT64 Length of the Firmware Volume
+// FvName EFI_GUID Guid of the Firmware Volume
+// FileName EFI_GUID Guid of the FFS which contained the Firmware Volume
+//**********************************************************************
+typedef struct _EFI_HOB_FIRMWARE_VOLUME2{
+ EFI_HOB_GENERIC_HEADER Header;
+ EFI_PHYSICAL_ADDRESS BaseAddress;
+ UINT64 Length;
+ EFI_GUID FvName;
+ EFI_GUID FileName;
+} EFI_HOB_FIRMWARE_VOLUME2;
+
+//**********************************************************************
+//<AMI_SHDR_START>
+//
+// Name: EFI_HOB_CPU
+//
+// Description: Describes the maximum physical addressablity of Memory
+// and IO of the processor.
+//
+// Fields: Name Type Description
+// ------------------------------------------------------------
+// Header EFI_HOB_GENERIC_HEADER
+// SizeOfMemorySpace UINT8
+// SizeOfIoSpace UINT8
+// Reserved[6] UINT8
+//
+//**********************************************************************
+typedef struct _EFI_HOB_CPU {
+ EFI_HOB_GENERIC_HEADER Header;
+ UINT8 SizeOfMemorySpace;
+ UINT8 SizeOfIoSpace;
+ UINT8 Reserved[6];
+} EFI_HOB_CPU;
+
+//Unkown usuage
+typedef struct _EFI_HOB_MEMORY_POOL {
+ EFI_HOB_GENERIC_HEADER Header;
+} EFI_HOB_MEMORY_POOL;
+
+//**********************************************************************
+//<AMI_SHDR_START>
+//
+// Name: EFI_HOB_UEFI_CAPSULE
+//
+// Description: Describes Capsule Volume Base and Length
+//
+// Fields: Name Type Description
+// ------------------------------------------------------------
+// Header EFI_HOB_GENERIC_HEADER
+// BaseAddress EFI_PHYSICAL_ADDRESS
+// Length UINT64
+//
+//**********************************************************************
+typedef struct {
+ EFI_HOB_GENERIC_HEADER Header;
+ EFI_PHYSICAL_ADDRESS BaseAddress;
+ UINT64 Length;
+} EFI_HOB_UEFI_CAPSULE;
+
+#if BACKWARD_COMPATIBLE_MODE
+#define EFI_HOB_TYPE_CV EFI_HOB_TYPE_UEFI_CAPSULE
+typedef EFI_HOB_UEFI_CAPSULE EFI_HOB_CAPSULE_VOLUME;
+#endif // BACKWARD_COMPATIBLE_MODE
+
+//**********************************************************************
+//<AMI_SHDR_START>
+//
+// Name: EFI_PEI_HOB_POINTERS
+//
+// Description: Union of all the possible HOB Types
+//
+//**********************************************************************
+typedef union {
+ EFI_HOB_GENERIC_HEADER *Header;
+ EFI_HOB_HANDOFF_INFO_TABLE *HandoffInformationTable;
+ EFI_HOB_MEMORY_ALLOCATION *MemoryAllocation;
+ EFI_HOB_MEMORY_ALLOCATION_BSP_STORE *MemoryAllocationBspStore;
+ EFI_HOB_MEMORY_ALLOCATION_STACK *MemoryAllocationStack;
+ EFI_HOB_MEMORY_ALLOCATION_MODULE *MemoryAllocationModule;
+ EFI_HOB_RESOURCE_DESCRIPTOR *ResourceDescriptor;
+ EFI_HOB_GUID_TYPE *Guid;
+ EFI_HOB_FIRMWARE_VOLUME *FirmwareVolume;
+ EFI_HOB_FIRMWARE_VOLUME2 *FirmwareVolume2;
+ EFI_HOB_CPU *Cpu;
+ EFI_HOB_MEMORY_POOL *Pool;
+ EFI_HOB_UEFI_CAPSULE *CapsuleVolume;
+ UINT8 *Raw;
+} EFI_PEI_HOB_POINTERS;
+/****** DO NOT WRITE BELOW THIS LINE *******/
+
+#ifdef __cplusplus
+}
+#endif
+#endif
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2009, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//********************************************************************** \ No newline at end of file
diff --git a/Include/HardwareChangeProtocols.cif b/Include/HardwareChangeProtocols.cif
new file mode 100644
index 0000000..49e70ad
--- /dev/null
+++ b/Include/HardwareChangeProtocols.cif
@@ -0,0 +1,8 @@
+<component>
+ name = "Hardware Change Protocols"
+ category = ModulePart
+ LocalRoot = "Include"
+ RefName = "HardwareChangeProtocols"
+[files]
+"Protocol\HardwareChangeProtocol.h"
+<endComponent>
diff --git a/Include/ImageAuthentication.h b/Include/ImageAuthentication.h
new file mode 100644
index 0000000..3c8aa58
--- /dev/null
+++ b/Include/ImageAuthentication.h
@@ -0,0 +1,184 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/BIN/Core/Include/ImageAuthentication.h 3 5/22/12 10:21a Artems $
+//
+// $Revision: 3 $
+//
+// $Date: 5/22/12 10:21a $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Core/Include/ImageAuthentication.h $
+//
+// 3 5/22/12 10:21a Artems
+// [TAG] EIP N/A
+// [Category] Spec Update
+// [Severity] Minor
+// [Description] Keep guid definitions in sync with UEFI 2.3.1 spec and
+// EDK II implementation
+// [Files] ImageAuthentication.h
+//
+// 2 5/13/11 3:56p Artems
+// AMI coding standard compliance added
+//
+//
+//**********************************************************************
+//<AMI_FHDR_START>
+//
+// Name: <ImageAuthentication.h>
+//
+// Description: Image Authentication definitions header file
+//
+//<AMI_FHDR_END>
+//**********************************************************************
+#ifndef __IMAGE_AUTHTICATION_H__
+#define __IMAGE_AUTHTICATION_H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <WinCertificate.h>
+
+#define EFI_IMAGE_SECURITY_DATABASE_GUID \
+ { 0xd719b2cb, 0x3d3a, 0x4596, 0xa3, 0xbc, 0xda, 0xd0, 0xe, 0x67, 0x65, 0x6f }
+
+
+#define EFI_IMAGE_SECURITY_DATABASE L"db"
+#define EFI_IMAGE_SECURITY_DATABASE1 L"dbx"
+
+#define SETUP_MODE 1
+#define USER_MODE 0
+
+#define EFI_SETUP_MODE_NAME L"SetupMode"
+#define EFI_PLATFORM_KEY_NAME L"PK"
+#define EFI_KEY_EXCHANGE_KEY_NAME L"KEK"
+#define EFI_SIGNATURE_SUPPORT_NAME L"SignatureSupport"
+#define EFI_SECURE_BOOT_NAME L"SecureBoot"
+
+#define SECURE_BOOT 1
+#define NONSECURE_BOOT 0
+
+//***********************************************************************
+// Signature Database
+//***********************************************************************
+
+#pragma pack(1)
+
+typedef struct {
+ EFI_GUID SignatureOwner;
+ UINT8 SignatureData[1];
+} EFI_SIGNATURE_DATA;
+
+typedef struct {
+ EFI_GUID SignatureType;
+ UINT32 SignatureListSize;
+ UINT32 SignatureHeaderSize;
+ UINT32 SignatureSize;
+// UINT8 SignatureHeader[SignatureHeaderSize];
+// EFI_SIGNATURE_DATA Signatures[][SignatureSize];
+} EFI_SIGNATURE_LIST;
+
+#pragma pack()
+
+#define EFI_CERT_SHA256_GUID \
+ { 0xc1c41626, 0x504c, 0x4092, 0xac, 0xa9, 0x41, 0xf9, 0x36, 0x93, 0x43, 0x28 }
+
+#define EFI_CERT_RSA2048_GUID \
+ { 0x3c5766e8, 0x269c, 0x4e34, 0xaa, 0x14, 0xed, 0x77, 0x6e, 0x85, 0xb3, 0xb6 }
+
+#define EFI_CERT_RSA2048_SHA256_GUID \
+ { 0xe2b36190, 0x879b, 0x4a3d, 0xad, 0x8d, 0xf2, 0xe7, 0xbb, 0xa3, 0x27, 0x84 }
+
+#define EFI_CERT_SHA1_GUID \
+ { 0x826ca512, 0xcf10, 0x4ac9, 0xb1, 0x87, 0xbe, 0x01, 0x49, 0x66, 0x31, 0xbd }
+
+#define EFI_CERT_RSA2048_SHA1_GUID \
+ { 0x67f8444f, 0x8743, 0x48f1, 0xa3, 0x28, 0x1e, 0xaa, 0xb8, 0x73, 0x60, 0x80 }
+
+#define EFI_CERT_X509 \
+ { 0xa5c059a1, 0x94e4, 0x4aa7, 0x87, 0xb5, 0xab, 0x15, 0x5c, 0x2b, 0xf0, 0x72 }
+
+#define EFI_CERT_SHA224_GUID \
+ { 0x0b6e5233, 0xa65c, 0x44c9, 0x94, 0x07, 0xd9, 0xab, 0x83, 0xbf, 0xc8, 0xbd }
+
+#define EFI_CERT_SHA384_GUID \
+ { 0xff3e5307, 0x9fd0, 0x48c9, 0x85, 0xf1, 0x8a, 0xd5, 0x6c, 0x70, 0x1e, 0x01 }
+
+#define EFI_CERT_SHA512_GUID \
+ { 0x093e0fae, 0xa6c4, 0x4f50, 0x9f, 0x1b, 0xd4, 0x1e, 0x2b, 0x89, 0xc1, 0x9a }
+
+#define EFI_CERT_TYPE_PKCS7_GUID \
+ { 0x4aafd29d, 0x68df, 0x49ee, 0x8a, 0xa9, 0x34, 0x7d, 0x37, 0x56, 0x65, 0xa7 }
+
+//***********************************************************************
+// Image Execution Information Table Definition
+//***********************************************************************
+typedef UINT32 EFI_IMAGE_EXECUTION_ACTION;
+
+#define EFI_IMAGE_EXECUTION_AUTHENTICATION 0x00000007
+#define EFI_IMAGE_EXECUTION_AUTH_UNTESTED 0x00000000
+#define EFI_IMAGE_EXECUTION_AUTH_SIG_FAILED 0x00000001
+#define EFI_IMAGE_EXECUTION_AUTH_SIG_PASSED 0x00000002
+#define EFI_IMAGE_EXECUTION_AUTH_SIG_NOT_FOUND 0x00000003
+#define EFI_IMAGE_EXECUTION_AUTH_SIG_FOUND 0x00000004
+#define EFI_IMAGE_EXECUTION_POLICY_FAILED 0x00000005
+#define EFI_IMAGE_EXECUTION_INITIALIZED 0x00000008
+
+typedef struct {
+ EFI_IMAGE_EXECUTION_ACTION Action;
+ UINT32 InfoSize;
+// CHAR16 Name[];
+// EFI_DEVICE_PATH_PROTOCOL DevicePath;
+ EFI_SIGNATURE_LIST Signature;
+} EFI_IMAGE_EXECUTION_INFO;
+
+typedef struct {
+ UINTN NumberOfImages;
+// EFI_IMAGE_EXECUTION_INFO InformationInfo[]
+} EFI_IMAGE_EXECUTION_INFO_TABLE;
+
+
+GUID_VARIABLE_DECLARATION(gEfiImageSecurityDatabaseGuid, EFI_IMAGE_SECURITY_DATABASE_GUID);
+GUID_VARIABLE_DECLARATION(gEfiCertSha256Guid, EFI_CERT_SHA256_GUID);
+GUID_VARIABLE_DECLARATION(gEfiCertRsa2048Guid, EFI_CERT_RSA2048_GUID);
+GUID_VARIABLE_DECLARATION(gEfiCertRsa2048Sha256Guid, EFI_CERT_RSA2048_SHA256_GUID);
+GUID_VARIABLE_DECLARATION(gEfiCertSha1Guid, EFI_CERT_SHA1_GUID);
+GUID_VARIABLE_DECLARATION(gEfiCertRsa2048Sha1Guid, EFI_CERT_RSA2048_SHA1_GUID);
+GUID_VARIABLE_DECLARATION(gEfiCertX509Guid, EFI_CERT_X509);
+GUID_VARIABLE_DECLARATION(gEfiCertSha224Guid, EFI_CERT_SHA224_GUID);
+GUID_VARIABLE_DECLARATION(gEfiCertSha384Guid, EFI_CERT_SHA384_GUID);
+GUID_VARIABLE_DECLARATION(gEfiCertSha512Guid, EFI_CERT_SHA512_GUID);
+GUID_VARIABLE_DECLARATION(gEfiCertPkcs7Guid, EFI_CERT_TYPE_PKCS7_GUID);
+GUID_VARIABLE_DECLARATION(gEfiCertTypePkcs7Guid, EFI_CERT_TYPE_PKCS7_GUID);
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//********************************************************************** \ No newline at end of file
diff --git a/Include/Include.cif b/Include/Include.cif
new file mode 100644
index 0000000..183e0f5
--- /dev/null
+++ b/Include/Include.cif
@@ -0,0 +1,55 @@
+<component>
+ name = "Include"
+ category = ModulePart
+ LocalRoot = "Include\"
+ RefName = "Include"
+[files]
+"Include.sdl"
+"EFI.h"
+"PEI.h"
+"HOB.h"
+"FFS.h"
+"SMM.h"
+"DXE.h"
+"AmiLib.h"
+"AmiPeiLib.h"
+"AmiDxeLib.h"
+"StatusCodes.h"
+"AcpiRes.h"
+"AmiHobs.h"
+"Flash.h"
+"PCI.h"
+"GenericSio.h"
+"HIIDB.h"
+"AmiSmm.h"
+"VFR.uni"
+"Languages.uni"
+"PCIE.h"
+"PCIE21.h"
+"Setup.h"
+"ACPI30.H"
+"ACPI20.H"
+"ACPI11.H"
+"ProcessorSubClass.h"
+"DataHubSubClass.h"
+"CacheSubClass.h"
+"PCIX.h"
+"AmiDebugPort.h"
+"ACPI.H"
+"AmiStatusCodes.h"
+"Capsule.h"
+"SmBus.h"
+"RomLayout.h"
+"UefiHii.h"
+"TcgTpm.h"
+"ImageAuthentication.h"
+"WinCertificate.h"
+"BootScriptCommon.h"
+"KeyboardCommonDefinitions.h"
+"AmiLoadCsmPolicy.h"
+"BootOptions.h"
+"ACPI50.h"
+[parts]
+"PPI"
+"Protocol"
+<endComponent>
diff --git a/Include/Include.sdl b/Include/Include.sdl
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/Include/Include.sdl
diff --git a/Include/KeyboardCommonDefinitions.h b/Include/KeyboardCommonDefinitions.h
new file mode 100644
index 0000000..e2c91b6
--- /dev/null
+++ b/Include/KeyboardCommonDefinitions.h
@@ -0,0 +1,175 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2009, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/BIN/Core/Include/KeyboardCommonDefinitions.h 2 9/23/11 12:37a Rameshr $
+//
+// $Revision: 2 $
+//
+// $Date: 9/23/11 12:37a $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Core/Include/KeyboardCommonDefinitions.h $
+//
+// 2 9/23/11 12:37a Rameshr
+// [TAG] EIP63054
+// [Category] New Feature
+// [Description] 0000790: Add warning to ReadKeyStrokeEx for partial key
+// press
+// [Files] KeyboardCommonDefinitions.h, In.c, Kbc.h, Ps2Kbd.c,
+// Efiusbkb.c, efiusbkb.h, efiusbhid.c
+//
+// 1 7/21/11 4:02p Artems
+// EIP 64356: Combine common keyboard definitions in one file
+//
+//**********************************************************************
+//<AMI_FHDR_START>
+//
+// Name: KeyboardCommonDefinitions.h
+//
+// Description: This file contains definitions common for HiiKeyboard,
+// SimpleTextIn protocol and Ami keyboard PPI
+//
+//<AMI_FHDR_END>
+//**********************************************************************
+#ifndef __KEYBOARD_COMMON_DEFINITIONS__H__
+#define __KEYBOARD_COMMON_DEFINITIONS__H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+#include <EFI.h>
+
+//
+// EFI Scan codes
+//
+#define EFI_SCAN_NULL 0x00
+#define EFI_SCAN_UP 0x01
+#define EFI_SCAN_DN 0x02
+#define EFI_SCAN_RIGHT 0x03
+#define EFI_SCAN_LEFT 0x04
+#define EFI_SCAN_HOME 0x05
+#define EFI_SCAN_END 0x06
+#define EFI_SCAN_INS 0x07
+#define EFI_SCAN_DEL 0x08
+#define EFI_SCAN_PGUP 0x09
+#define EFI_SCAN_PGDN 0x0A
+#define EFI_SCAN_F1 0x0B
+#define EFI_SCAN_F2 0x0C
+#define EFI_SCAN_F3 0x0D
+#define EFI_SCAN_F4 0x0E
+#define EFI_SCAN_F5 0x0F
+#define EFI_SCAN_F6 0x10
+#define EFI_SCAN_F7 0x11
+#define EFI_SCAN_F8 0x12
+#define EFI_SCAN_F9 0x13
+#define EFI_SCAN_F10 0x14
+#define EFI_SCAN_F11 0x15
+#define EFI_SCAN_F12 0x16
+#define EFI_SCAN_ESC 0x17
+
+#define SHIFT_STATE_VALID 0x80000000
+#define RIGHT_SHIFT_PRESSED 0x00000001
+#define LEFT_SHIFT_PRESSED 0x00000002
+#define RIGHT_CONTROL_PRESSED 0x00000004
+#define LEFT_CONTROL_PRESSED 0x00000008
+#define RIGHT_ALT_PRESSED 0x00000010
+#define LEFT_ALT_PRESSED 0x00000020
+#define RIGHT_LOGO_PRESSED 0x00000040
+#define LEFT_LOGO_PRESSED 0x00000080
+#define MENU_KEY_PRESSED 0x00000100
+#define SYS_REQ_PRESSED 0x00000200
+
+#define TOGGLE_STATE_VALID 0x80
+#define SCROLL_LOCK_ACTIVE 0x01
+#define NUM_LOCK_ACTIVE 0x02
+#define CAPS_LOCK_ACTIVE 0x04
+#define KEY_STATE_EXPOSED 0x40
+
+//*******************************************************
+// EFI_INPUT_KEY
+//*******************************************************
+typedef struct {
+ UINT16 ScanCode;
+ CHAR16 UnicodeChar;
+} EFI_INPUT_KEY;
+
+//*******************************************************
+// EFI_KEY_TOGGLE_STATE
+//*******************************************************
+typedef UINT8 EFI_KEY_TOGGLE_STATE;
+
+//*******************************************************
+// EFI_KEY_STATE
+//*******************************************************
+//
+// Any Shift or Toggle State that is valid should have
+// high order bit set.
+//
+typedef struct EFI_KEY_STATE {
+ UINT32 KeyShiftState;
+ EFI_KEY_TOGGLE_STATE KeyToggleState;
+} EFI_KEY_STATE;
+
+//***************************************************
+// EFI_KEY
+//***************************************************
+typedef enum {
+ EfiKeyLCtrl, EfiKeyA0, EfiKeyLAlt, EfiKeySpaceBar,
+ EfiKeyA2, EfiKeyA3, EfiKeyA4, EfiKeyRCtrl,
+ EfiKeyLeftArrow, EfiKeyDownArrow, EfiKeyRightArrow, EfiKeyZero,
+ EfiKeyPeriod, EfiKeyEnter, EfiKeyLShift, EfiKeyB0,
+ EfiKeyB1, EfiKeyB2, EfiKeyB3, EfiKeyB4,
+ EfiKeyB5, EfiKeyB6, EfiKeyB7, EfiKeyB8,
+ EfiKeyB9, EfiKeyB10, EfiKeyRShift, EfiKeyUpArrow,
+ EfiKeyOne, EfiKeyTwo, EfiKeyThree, EfiKeyCapsLock,
+ EfiKeyC1, EfiKeyC2, EfiKeyC3, EfiKeyC4,
+ EfiKeyC5, EfiKeyC6, EfiKeyC7, EfiKeyC8,
+ EfiKeyC9, EfiKeyC10, EfiKeyC11, EfiKeyC12,
+ EfiKeyFour, EfiKeyFive, EfiKeySix, EfiKeyPlus,
+ EfiKeyTab, EfiKeyD1, EfiKeyD2, EfiKeyD3,
+ EfiKeyD4, EfiKeyD5, EfiKeyD6, EfiKeyD7,
+ EfiKeyD8, EfiKeyD9, EfiKeyD10, EfiKeyD11,
+ EfiKeyD12, EfiKeyD13, EfiKeyDel, EfiKeyEnd,
+ EfiKeyPgDn, EfiKeySeven, EfiKeyEight, EfiKeyNine,
+ EfiKeyE0, EfiKeyE1, EfiKeyE2, EfiKeyE3,
+ EfiKeyE4, EfiKeyE5, EfiKeyE6, EfiKeyE7,
+ EfiKeyE8, EfiKeyE9, EfiKeyE10, EfiKeyE11,
+ EfiKeyE12, EfiKeyBackSpace, EfiKeyIns, EfiKeyHome,
+ EfiKeyPgUp, EfiKeyNLck, EfiKeySlash, EfiKeyAsterisk,
+ EfiKeyMinus, EfiKeyEsc, EfiKeyF1, EfiKeyF2,
+ EfiKeyF3, EfiKeyF4, EfiKeyF5, EfiKeyF6,
+ EfiKeyF7, EfiKeyF8, EfiKeyF9, EfiKeyF10,
+ EfiKeyF11, EfiKeyF12, EfiKeyPrint, EfiKeySLck,
+ EfiKeyPause
+} EFI_KEY;
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2009, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
diff --git a/Include/Languages.uni b/Include/Languages.uni
new file mode 100644
index 0000000..d04153b
--- /dev/null
+++ b/Include/Languages.uni
Binary files differ
diff --git a/Include/PCI.h b/Include/PCI.h
new file mode 100644
index 0000000..9afa536
--- /dev/null
+++ b/Include/PCI.h
@@ -0,0 +1,620 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2005, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/BIN/Core/Include/PCI.h 13 8/17/11 12:21p Yakovlevs $
+//
+// $Revision: 13 $
+//
+// $Date: 8/17/11 12:21p $
+//
+//**********************************************************************
+// Revision History
+// ----------------
+//$Log: /Alaska/BIN/Core/Include/PCI.h $
+//
+// 13 8/17/11 12:21p Yakovlevs
+// [TAG] EIP67406
+// [Category] Bug Fix
+// [Symptom] LEGACY_OPT_ROM_HEADER structure doesn't match to PCI
+// specification
+// [RootCause] Typo
+// [Solution] Correct the typo
+// [Files] Pci.h
+//
+// 12 8/07/09 2:57p Rameshr
+// Sd card definition added
+//
+// 11 7/17/07 5:01p Yakovlevs
+// Common PCI Header Offset Definitions added
+//
+// 10 7/17/07 5:00p Yakovlevs
+//
+// 9 3/15/07 3:10p Yakovlevs
+// Changed PCI_PME register block Field NAMES; made all data pack(1) here
+//
+// 8 3/15/07 3:09p Yakovlevs
+// File Headr updated
+//
+//**********************************************************************
+
+#ifndef _PCI22_H
+#define _PCI22_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <Efi.h>
+
+#define PCI_MAX_SEGMENT 255
+
+#define PCI_MAX_BUS 255
+
+#define PCI_MAX_DEVICE 31
+#define PCI_MAX_FUNC 7
+
+#define PCI_DEV_ROM_BAR 0x30
+#define PCI_P2P_ROM_BAR 0x38
+
+#define MAX_PCI_BAR 6
+
+#define P2P_BRG_MEM_GRA 0xFFFFF //naturally, P2P Brg MMIO aligned to the 1M boundary
+#define P2P_BRG_IO_GRA 0xFFF //naturally, P2P Brg IO aligned to the 4k boundary
+
+//Here comes some Common PCI Header Offset Definitions.
+#define PCI_VID 0x0000 // Vendor ID Register
+#define PCI_DID 0x0002 // Device ID Register
+#define PCI_CMD 0x0004 // PCI Command Register
+#define PCI_STS 0x0006 // PCI Status Register
+#define PCI_RID 0x0008 // Revision ID Register
+#define PCI_IFT 0x0009 // Interface Type
+#define PCI_SCC 0x000A // Sub Class Code Register
+#define PCI_BCC 0x000B // Base Class Code Register
+#define PCI_CLS 0x000C // Cache Line Size
+#define PCI_PMLT 0x000D // Primary Master Latency Timer
+#define PCI_HDR 0x000E // Header Type Register
+#define PCI_BIST 0x000F // Built in Self Test Register
+#define PCI_BAR0 0x0010 // Base Address Register 0
+#define PCI_BAR1 0x0014 // Base Address Register 1
+#define PCI_BAR2 0x0018 // Base Address Register 2
+#define PCI_PBUS 0x0018 // Primary Bus Number Register
+#define PCI_SBUS 0x0019 // Secondary Bus Number Register
+#define PCI_SUBUS 0x001A // Subordinate Bus Number Register
+#define PCI_SMLT 0x001B // Secondary Master Latency Timer
+#define PCI_BAR3 0x001C // Base Address Register 3
+#define PCI_IOBASE 0x001C // I/O base Register
+#define PCI_IOLIMIT 0x001D // I/O Limit Register
+#define PCI_SECSTATUS 0x001E // Secondary Status Register
+#define PCI_BAR4 0x0020 // Base Address Register 4
+#define PCI_MEMBASE 0x0020 // Memory Base Register
+#define PCI_MEMLIMIT 0x0022 // Memory Limit Register
+#define PCI_BAR5 0x0024 // Base Address Register 5
+#define PCI_PRE_MEMBASE 0x0024 // Prefetchable memory Base register
+#define PCI_PRE_MEMLIMIT 0x0026 // Prefetchable memory Limit register
+#define PCI_PRE_MEMBASE_U 0x0028 // Prefetchable memory base upper 32 bits
+#define PCI_PRE_MEMLIMIT_U 0x002C // Prefetchable memory limit upper 32 bits
+#define PCI_SVID 0x002C // Subsystem Vendor ID
+#define PCI_SID 0x002E // Subsystem ID
+#define PCI_IOBASE_U 0x0030 // I/O base Upper Register
+#define PCI_IOLIMIT_U 0x0032 // I/O Limit Upper Register
+#define PCI_CAPP 0x0034 // Capabilities Pointer
+#define PCI_EROM 0x0038 // Expansion ROM Base Address
+#define PCI_INTLINE 0x003C // Interrupt Line Register
+#define PCI_INTPIN 0x003D // Interrupt Pin Register
+#define PCI_MAXGNT 0x003E // Max Grant Register
+#define PCI_BRIDGE_CNTL 0x003E // Bridge Control Register
+#define PCI_MAXLAT 0x003F // Max Latency Register
+
+// Command
+#define PCI_VGA_PALETTE_SNOOP_DISABLED 0x20
+
+#pragma pack(push, 1)
+
+//Common part of PCI Devices
+typedef struct {
+ UINT16 VendorId;
+ UINT16 DeviceId;
+ UINT16 CmmandReg;
+ UINT16 StatusReg;
+ UINT8 RevisionID;
+ UINT8 ClassCode[3];
+ UINT8 CacheLineSize;
+ UINT8 LatencyTmr;
+ UINT8 HeaderType;
+ UINT8 BIST;
+} PCI_COMMON_REG;
+
+//Standard PCI Device
+typedef struct {
+ UINT32 Bar[6];
+ UINT32 CardBusCISPtr;
+ UINT16 SubsystemVendorID;
+ UINT16 SubsystemID;
+ UINT32 ExpansionRomBar;
+ UINT8 CapabilityPtr;
+ UINT8 Reserved[7];
+ UINT8 InterruptLine;
+ UINT8 InterruptPin;
+ UINT8 MinGnt;
+ UINT8 MaxLat;
+} PCI_DEVICE_REG;
+
+typedef struct {
+ PCI_COMMON_REG Header;
+ PCI_DEVICE_REG Device;
+} PCI_STD_DEVICE;
+
+//PCI 2 PCI Bridge
+typedef struct {
+ UINT32 Bar[2];
+ UINT8 PrimaryBus;
+ UINT8 SecondaryBus;
+ UINT8 SubordinateBus;
+ UINT8 SecondaryLatencyTimer;
+ UINT8 IoBase;
+ UINT8 IoLimit;
+ UINT16 SecondaryStatus;
+ UINT16 MemoryBase;
+ UINT16 MemoryLimit;
+ UINT16 PfMemoryBase;
+ UINT16 PfMemoryLimit;
+ UINT32 PfBaseUpper32;
+ UINT32 PfLimitUpper32;
+ UINT16 IoBaseUpper16;
+ UINT16 IoLimitUpper16;
+ UINT8 CapabilityPtr;
+ UINT8 Reserved[3];
+ UINT32 ExpansionRomBAR;
+ UINT8 InterruptLine;
+ UINT8 InterruptPin;
+ UINT16 BridgeControl;
+} PCI_P2P_BRG_REG;
+
+typedef struct {
+ PCI_COMMON_REG Header;
+ PCI_P2P_BRG_REG Bridge;
+} PCI_P2P_BRIDGE;
+
+//PCI 2 CardBUS BRIDGE
+typedef struct {
+ UINT32 CardBusSocketReg; // Cardus Socket/ExCA Base
+ //Address Register
+ UINT8 CapabilityPtr;
+ UINT8 Reserved;
+ UINT16 SecondaryStatus; // Secondary Status
+ UINT8 PciBusNumber; // PCI Bus Number
+ UINT8 CardBusBusNumber; // CardBus Bus Number
+ UINT8 SubordinateBusNumber; // Subordinate Bus Number
+ UINT8 CardBusLatencyTimer; // CardBus Latency Timer
+ UINT32 MemoryBase0; // Memory Base Register 0
+ UINT32 MemoryLimit0; // Memory Limit Register 0
+ UINT32 MemoryBase1;
+ UINT32 MemoryLimit1;
+ UINT32 IoBase0;
+ UINT32 IoLimit0; // I/O Base Register 0
+ UINT32 IoBase1; // I/O Limit Register 0
+ UINT32 IoLimit1;
+ UINT8 InterruptLine; // Interrupt Line
+ UINT8 InterruptPin; // Interrupt Pin
+ UINT16 BridgeControl; // Bridge Control
+} PCI_P2C_BRG_REG;
+
+typedef struct {
+ PCI_COMMON_REG Header;
+ PCI_P2C_BRG_REG Bridge;
+} PCI_P2C_BRIDGE;
+
+
+// Definitions of PCI class bytes and manipulation macros.
+#define PCI_CL_OLD 0x00
+#define PCI_CL_OLD_SCL_VGA 0x01
+
+#define PCI_CL_MASS_STOR 0x01
+#define PCI_CL_MASS_STOR_SCL_SCSI 0x00
+#define PCI_CL_MASS_STOR_SCL_IDE 0x01
+#define PCI_CL_MASS_STOR_SCL_FDC 0x02
+#define PCI_CL_MASS_STOR_SCL_IPI 0x03
+#define PCI_CL_MASS_STOR_SCL_RAID 0x04
+#define PCI_CL_MASS_STOR_SCL_OTHER 0x80
+
+#define PCI_CL_NETWORK 0x02
+#define PCI_CL_NETWORK_SCL_ETHERNET 0x00
+#define PCI_CL_NETWORK_SCL_TOK_RING 0x01
+#define PCI_CL_NETWORK_SCL_FDDI 0x02
+#define PCI_CL_NETWORK_SCL_ATM 0x03
+#define PCI_CL_NETWORK_SCL_ISDN 0x04
+#define PCI_CL_NETWORK_SCL_OTHER 0x80
+
+#define PCI_CL_DISPLAY 0x03
+#define PCI_CL_DISPLAY_SCL_VGA 0x00
+#define PCI_CL_DISPLAY_SCL_XGA 0x01
+#define PCI_CL_DISPLAY_SCL_3D 0x02
+#define PCI_CL_DISPLAY_SCL_OTHER 0x80
+
+#define PCI_CL_MMEDIA 0x04
+#define PCI_CL_MMEDIA_SCL_VIDEO 0x00
+#define PCI_CL_MMEDIA_SCL_AUDIO 0x01
+#define PCI_CL_MMEDIA_SCL_PHONE 0x02
+#define PCI_CL_MMEDIA_SCL_OTHER 0x80
+
+#define PCI_CL_MEMORY 0x05
+#define PCI_CL_MEMORY_SCL_RAM 0x00
+#define PCI_CL_MEMORY_SCL_FLASH 0x01
+#define PCI_CL_MEMORY_SCL_OTHER 0x80
+
+#define PCI_CL_BRIDGE 0x06
+#define PCI_CL_BRIDGE_SCL_HOST 0x00
+#define PCI_CL_BRIDGE_SCL_ISA 0x01
+#define PCI_CL_BRIDGE_SCL_EISA 0x02
+#define PCI_CL_BRIDGE_SCL_MCA 0x03
+#define PCI_CL_BRIDGE_SCL_P2P 0x04
+#define PCI_CL_BRIDGE_SCL_PCMCIA 0x05
+#define PCI_CL_BRIDGE_SCL_NUBUS 0x06
+#define PCI_CL_BRIDGE_SCL_CARDBUS 0x07
+#define PCI_CL_BRIDGE_SCL_RACEWAY 0x08
+#define PCI_CL_BRIDGE_SCL_OTHER 0x80
+
+#define PCI_CL_COMM 0x07
+#define PCI_CL_COMM_CSL_SERIAL 0x00
+#define PCI_CL_COMM_CSL_PARALLEL 0x01
+#define PCI_CL_COMM_CSL_MULTISERIAL 0x02
+#define PCI_CL_COMM_CSL_MODEM 0x03
+#define PCI_CL_COMM_CSL_OTHER 0x80
+
+#define PCI_CL_SYSTEM_PERIPHERALS 0x08
+#define PCI_CL_SYSTEM_PERIPHERALS_SCL_SD 0x05
+
+#define PCI_CL_SER_BUS 0x0C
+#define PCI_CL_SER_BUS_SCL_FIREWIRE 0x00
+#define PCI_CL_SER_BUS_SCL_ACCESS 0x01
+#define PCI_CL_SER_BUS_SCL_SSA 0x02
+#define PCI_CL_SER_BUS_SCL_USB 0x03
+#define PCI_CL_SER_BUS_SCL_FIBCHAN 0x04
+#define PCI_CL_SER_BUS_SCL_SMB 0x05
+
+#define PCI_CL_I2O 0x0E
+//TODO //TODO //TODO //TODO //TODO //TODO
+//Some Class codes are missing I just don't need them for PCI BUS Driver
+//to reflect the spec and mantain accuracy it has to be enterted.
+
+#define HDR_TYPE_DEVICE 0x00
+#define HDR_TYPE_P2P_BRG 0x01
+#define HDR_TYPE_P2C_BRG 0x02
+
+#define HDR_TYPE_MULTIFUNC 0x80
+
+#define PCI_MAX_BAR_NO 6
+#define PCI_MAX_CFG_OFFS 0x100
+
+
+#define PCI_COMMAND_REGISTER_OFFSET 0x04
+#define PCI_STATUS_REGISTER_OFFSET 0x06
+#define PCI_BRIDGE_CONTROL_REGISTER_OFFSET 0x3E
+#define PCI_BRIDGE_STATUS_REGISTER_OFFSET 0x1E
+
+#define PCI_BRIDGE_PRIMARY_BUS_REGISTER_OFFSET 0x18
+#define PCI_BRIDGE_SECONDARY_BUS_REGISTER_OFFSET 0x19
+#define PCI_BRIDGE_SUBORDINATE_BUS_REGISTER_OFFSET 0x1a
+
+typedef struct {
+ UINT8 Register;
+ UINT8 Function;
+ UINT8 Device;
+ UINT8 Bus;
+ UINT8 Reserved[4];
+} EFI_PCI_ADDR;
+
+typedef struct {
+ UINT32 Reg : 8;
+ UINT32 Func : 3;
+ UINT32 Dev : 5;
+ UINT32 Bus : 8;
+ UINT32 Reserved: 7;
+ UINT32 Enable : 1;
+} PCI_CONFIG_ACCESS_CF8;
+
+
+#define PCI_REV_ID_OFFSET 0x08
+#define PCI_PI_OFFSET 0x09
+
+// Following are the PCI-CARDBUS bridge control bit
+#define PCI_STD_OPT_ROM_SIGNATURE 0xaa55
+#define PCI_EFI_OPT_ROM_SIGNATURE 0x0EF1
+#define PCI_CODE_TYPE_PCAT_IMAGE 0x00
+#define PCI_CODE_TYPE_EFI_IMAGE 0x03
+#define PCI_EFI_OPT_ROM_SIGNATURE_COMPRESSED 0x0001
+
+// Following are the PCI-COMMAND REG control bit
+#define PCI_CMD_IO_SPACE 0x0001
+#define PCI_CMD_MEMORY_SPACE 0x0002
+#define PCI_CMD_BUS_MASTER 0x0004
+#define PCI_CMD_SPECIAL_CYCLE 0x0008
+#define PCI_CMD_MEMORY_WRITE_AND_INVALIDATE 0x0010
+#define PCI_CMD_VGA_PALETTE_SNOOP 0x0020
+#define PCI_CMD_PARITY_ERROR_RESPOND 0x0040
+#define PCI_CMD_STEPPING_CONTROL 0x0080
+#define PCI_CMD_SERR 0x0100
+#define PCI_CMD_FAST_BACK_TO_BACK 0x0200
+#define PCI_CMD_INTERRUPT_DISABLE 0x0400
+
+typedef union {
+ UINT16 CMD_REG_ALL;
+ struct{
+ UINT16 IO_SPACE : 1; //bit0
+ UINT16 MEM_SPACE : 1; //bit1
+ UINT16 BUS_MASTER : 1; //bit2
+ UINT16 SP_CYCLE : 1; //bit3
+ UINT16 MEM_WI_EN : 1; //bit4
+ UINT16 VGA_PALETTE : 1; //bit5
+ UINT16 PARITY_ERR : 1; //bit6
+ UINT16 STEP_CTR : 1; //bit7
+ UINT16 SERR_ENA : 1; //bit8
+ UINT16 FAST_B2B_ENA : 1; //bit9
+ UINT16 reserved : 6; //bit10-15
+ };
+} PCI_CMD_REG_BITS;
+
+// Following are the PCI-2-PCI bridge control bit
+#define P2P_BRG_CONTROL_PARITY_ERROR_RESPONSE 0x0001
+#define P2P_BRG_CONTROL_SERR 0x0002
+#define P2P_BRG_CONTROL_ISA 0x0004
+#define P2P_BRG_CONTROL_VGA 0x0008
+#define P2P_BRG_CONTROL_VGA_16 0x0010
+#define P2P_BRG_CONTROL_MASTER_ABORT 0x0020
+#define P2P_BRG_CONTROL_RESET_SECONDARY_BUS 0x0040
+#define P2P_BRG_CONTROL_FAST_BACK_TO_BACK 0x0080
+#define P2P_BRG_CONTROL_PRIMARY_DISCARD_TIMER 0x0100
+#define P2P_BRG_CONTROL_SECONDARY_DISCARD_TIMER 0x0200
+#define P2P_BRG_CONTROL_TIMER_STATUS 0x0400
+#define P2P_BRG_CONTROL_DISCARD_TIMER_SERR 0x0800
+
+// Following are the PCI-2-CARDBUS bridge control bit
+#define P2C_BRG_CONTROL_IREQINT_ENABLE 0x0080
+#define P2C_BRG_CONTROL_RANGE0_MEMORY_TYPE 0x0100
+#define P2C_BRG_CONTROL_RANGE1_MEMORY_TYPE 0x0200
+#define P2C_BRG_CONTROL_WRITE_POSTING_ENABLE 0x0400
+
+// Following are the PCI status control bit
+#define PCI_STS_CAPABILITY 0x0010
+#define PCI_STS_66MZ_CAPABLE 0x0020
+#define PCI_STS_FAST_BACK_TO_BACK 0x0080
+#define PCI_STS_MASTER_DATA_PARITY_ERROR 0x0100
+
+
+#define EFI_PCI_CAPABILITY_PTR 0x34
+#define EFI_PCI_CARDBUS_BRIDGE_CAPABILITY_PTR 0x14
+
+//Some signature definitions
+#define PCI_OPT_ROM_SIG 0xAA55
+#define PCI_OPT_ROM_EFISIG 0x0EF1
+#define PCI_PCIR_SIG 0x52494350 //"PCIR"
+
+//EFI subsystem definitions
+#define EFI_IMAGE_BS_DRIVER 11
+#define EFI_IMAGE_RT_DRIVER 12
+
+typedef struct {
+ UINT16 Signature; // 0xaa55
+ UINT8 Reserved[0x16];
+ UINT16 PcirOffset;
+} PCI_STD_OPT_ROM_HEADER;
+
+typedef struct {
+ UINT16 Signature; // 0xaa55
+ UINT16 InitializationSize;
+ UINT32 EfiSignature; // 0x0EF1
+ UINT16 EfiSubsystem;
+ UINT16 EfiMachineType;
+ UINT16 CompressionType;
+ UINT8 Reserved[8];
+ UINT16 EfiImageOffset;
+ UINT16 PcirOffset;
+} PCI_EFI_OPT_ROM_HEADER;
+
+typedef struct {
+ UINT16 Signature; // 0xaa55
+ UINT8 Size512;
+ UINT8 Reserved[0x15];
+ UINT16 PcirOffset;
+} LEGACY_OPT_ROM_HEADER;
+
+typedef union {
+ UINT8 *Raw;
+ PCI_STD_OPT_ROM_HEADER *Generic;
+ PCI_EFI_OPT_ROM_HEADER *Efi;
+ LEGACY_OPT_ROM_HEADER *PcAt;
+}EFI_PCI_ROM_HEADER;
+
+
+typedef struct {
+ UINT32 Signature; // "PCIR"
+ UINT16 VendorId;
+ UINT16 DeviceId;
+ UINT16 Reserved0;
+ UINT16 Length;
+ UINT8 Revision;
+ UINT8 ClassCode[3];
+ UINT16 ImageLength;
+ UINT16 CodeRevision;
+ UINT8 CodeType;
+ UINT8 Indicator;
+ UINT16 Reserved1;
+} PCI_DATA_STRUCTURE;
+
+
+
+// PCI Capability List IDs and records
+#define PCI_CAP_ID_PMI 0x01
+#define PCI_CAP_ID_AGP 0x02
+#define PCI_CAP_ID_VPD 0x03
+#define PCI_CAP_ID_SLOTID 0x04
+#define PCI_CAP_ID_MSI 0x05
+#define PCI_CAP_ID_HOTSWAP 0x06
+#define PCI_CAP_ID_PCIX 0x07
+#define PCI_CAP_ID_PCIEXP 0x10
+#define PCI_CAP_ID_HOTPLUG 0x0C
+
+typedef union {
+ UINT16 CAP_HDR;
+ struct {
+ UINT8 CapabilityID;
+ UINT8 NextItemPtr;
+ };
+} EFI_PCI_CAPABILITY_HDR;
+
+// Capability EFI_PCI_CAPABILITY_ID_PMI
+//Derfinitions for Power Management Interface
+typedef union _PCI_PM_CAP_REG {
+ UINT16 PMI_CAP_REG;
+ struct {
+ UINT16 Version : 3; //16,17,18
+ UINT16 PmeClock : 1; //19
+ UINT16 Reserved : 1; //20
+ UINT16 DevSpecInit : 1; //21
+ UINT16 AuxCurrent : 3; //22,23,24
+ UINT16 D1Support : 1; //25
+ UINT16 D2Support : 1; //26
+ UINT16 PmeSupport : 5; //27,28,29,30,31
+ };
+} PCI_PM_CAP_REG;
+
+//Power Mamagement Control/Status Reg
+typedef union _PCI_PM_CTRSTS_REG {
+ UINT16 PMI_CTRSTS_REG;
+ struct {
+ UINT16 PowerState : 2; //00,01
+ UINT16 Reserved : 6; //02,03,04,05,06,07
+ UINT16 PmeEnable : 1; //08
+ UINT16 DataSelect : 4; //09,10,11,12
+ UINT16 DataScale : 2; //13,14
+ UINT16 PmeStatus : 1; //15
+ };
+} PCI_PM_CTRSTS_REG;
+
+typedef struct {
+ EFI_PCI_CAPABILITY_HDR Hdr;
+ PCI_PM_CAP_REG PmCapReg;
+ PCI_PM_CTRSTS_REG PmStaCtlReg;
+ UINT8 BridgeExtention;
+ UINT8 Data;
+} EFI_PCI_CAPABILITY_PMI;
+
+// Capability EFI_PCI_CAPABILITY_ID_AGP
+typedef struct {
+ EFI_PCI_CAPABILITY_HDR Hdr;
+ UINT8 Rev;
+ UINT8 Reserved;
+ UINT32 Status;
+ UINT32 Command;
+} EFI_PCI_CAPABILITY_AGP;
+
+
+// Capability EFI_PCI_CAPABILITY_ID_VPD
+//Vital Poroduct Data
+typedef struct {
+ EFI_PCI_CAPABILITY_HDR Hdr;
+ UINT16 AddrReg;
+ UINT32 DataReg;
+} EFI_PCI_CAPABILITY_VPD;
+
+
+// Capability EFI_PCI_CAPABILITY_ID_SLOTID
+typedef struct {
+ EFI_PCI_CAPABILITY_HDR Hdr;
+ UINT8 ExpnsSlotReg;
+ UINT8 ChassisNo;
+} EFI_PCI_CAPABILITY_SLOTID;
+
+
+// Capability EFI_PCI_CAPABILITY_ID_MSI
+typedef struct {
+ EFI_PCI_CAPABILITY_HDR Hdr;
+ UINT16 MsgCtrlReg;
+ UINT32 MsgAddrReg;
+ UINT16 MsgDataReg;
+} EFI_PCI_CAPABILITY_MSI32;
+
+typedef struct {
+ EFI_PCI_CAPABILITY_HDR Hdr;
+ UINT16 MsgCtrlReg;
+ UINT32 MsgAddrRegLsdw;
+ UINT32 MsgAddrRegMsdw;
+ UINT16 MsgDataReg;
+} EFI_PCI_CAPABILITY_MSI64;
+
+
+// Capability EFI_PCI_CAPABILITY_ID_HOTPLUG
+typedef struct {
+ EFI_PCI_CAPABILITY_HDR Hdr;
+ // not finished - fields need to go here
+} EFI_PCI_CAPABILITY_HOTPLUG;
+
+
+// Capability EFI_PCI_CAPABILITY_ID_PCIX
+typedef struct {
+ EFI_PCI_CAPABILITY_HDR Hdr;
+ UINT16 CommandReg;
+ UINT32 StatusReg;
+} EFI_PCI_CAPABILITY_PCIX;
+
+typedef struct {
+ EFI_PCI_CAPABILITY_HDR Hdr;
+ UINT16 SecStatusReg;
+ UINT32 StatusReg;
+ UINT32 SplitTransCtrlRegUp;
+ UINT32 SplitTransCtrlRegDn;
+} EFI_PCI_CAPABILITY_PCIX_BRDG;
+
+#pragma pack (pop)
+
+
+#define DEVICE_ID_NOCARE 0xFFFF
+
+#define PCI_ACPI_UNUSED 0
+#define PCI_BAR_NOCHANGE 0
+#define PCI_BAR_OLD_ALIGN 0xFFFFFFFFFFFFFFFF
+#define PCI_BAR_EVEN_ALIGN 0xFFFFFFFFFFFFFFFE
+#define PCI_BAR_SQUAD_ALIGN 0xFFFFFFFFFFFFFFFD
+#define PCI_BAR_DQUAD_ALIGN 0xFFFFFFFFFFFFFFFC
+
+
+#define PCI_BAR_IDX0 0x00
+#define PCI_BAR_IDX1 0x01
+#define PCI_BAR_IDX2 0x02
+#define PCI_BAR_IDX3 0x03
+#define PCI_BAR_IDX4 0x04
+#define PCI_BAR_IDX5 0x05
+#define PCI_BAR_ALL 0xFF
+
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2005, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
diff --git a/Include/PCIE.h b/Include/PCIE.h
new file mode 100644
index 0000000..150a180
--- /dev/null
+++ b/Include/PCIE.h
@@ -0,0 +1,632 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2005, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Pkwy, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/BIN/Core/Include/PCIE.h 8 2/23/10 10:59p Felixp $Revision: 6 $
+//
+// $Date: 2/23/10 10:59p $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Core/Include/PCIE.h $
+//
+// 8 2/23/10 10:59p Felixp
+//
+// 7 2/23/10 3:30p Yakovlevs
+// Changed to match PCI Express 2.1 spec.
+
+#ifndef _PCI_EXPRESS_H
+#define _PCI_EXPRESS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+/****** DO NOT WRITE ABOVE THIS LINE *******/
+
+//How to assemble PCI Express Address
+#define PCIE_CFG_ADDR(bus,dev,func,reg) \
+ ((VOID*) (UINTN)(PCIEX_BASE_ADDRESS + ((bus) << 20) + ((dev) << 15) + ((func) << 12) + reg))
+
+
+#ifndef PCI_CAP_ID_PCIEXP
+#define PCI_CAP_ID_PCIEXP 0x10
+#endif
+
+// Extended capabilities IDs
+#define PCIE_CAP_ID_AER 0x0001 // Advanced error reporting
+#define PCIE_CAP_ID_VC 0x0002 // Virtual channel
+#define PCIE_CAP_ID_DSN 0x0003 // Device serial number
+#define PCIE_CAP_ID_PB 0x0004 // Power budgeting
+
+#pragma pack(push,1)
+//////////////////////////////////////////////////////////////////////
+//Pci Express Standard Registers
+//////////////////////////////////////////////////////////////////////
+
+#define PCIE_TYPE_ENDPOINT 0
+#define PCIE_TYPE_LEGACYEP 1
+#define PCIE_TYPE_ROOTPORT 4
+#define PCIE_TYPE_UPS_PORT 5
+#define PCIE_TYPE_DNS_PORT 6
+#define PCIE_TYPE_PCIE_PCI 7
+#define PCIE_TYPE_PCI_PCIE 8
+
+#define PCIE_MAXPL_128B 0
+#define PCIE_MAXPL_256B 1
+#define PCIE_MAXPL_512B 2
+#define PCIE_MAXPL_1024B 3
+#define PCIE_MAXPL_2048B 4
+#define PCIE_MAXPL_4096B 5
+
+#define PCIE_LAT0_LESS_64NS 0
+#define PCIE_LAT0_64_128NS 1
+#define PCIE_LAT0_128_256NS 2
+#define PCIE_LAT0_256_512NS 3
+#define PCIE_LAT0_512_1024NS 4
+#define PCIE_LAT0_1_2MS 5
+#define PCIE_LAT0_2_4MS 6
+#define PCIE_LAT0_MORE_4MS 7
+
+#define PCIE_LAT1_LESS_1MS 0
+#define PCIE_LAT1_1_2MS 1
+#define PCIE_LAT1_2_4MS 2
+#define PCIE_LAT1_4_8MS 3
+#define PCIE_LAT1_8_16MS 4
+#define PCIE_LAT1_16_32MS 5
+#define PCIE_LAT1_32_64MS 6
+#define PCIE_LAT1_MORE_64MS 7
+
+//////////////////////////////////////////////////////////////////////
+// PCI Express Capabilities Register
+//////////////////////////////////////////////////////////////////////
+
+#define PCIE_CAP_OFFSET 2
+
+typedef union _PCIE_PCIE_CAP_REG {
+ UINT16 PCIE_CAP;
+ struct {
+ UINT16 CapVersion : 4;
+ UINT16 PortType : 4;
+ UINT16 SlotImpl : 1;
+ UINT16 IntMsgNo : 5;
+ UINT16 Undefined : 1;
+ UINT16 Reserved : 1;
+ };
+} PCIE_PCIE_CAP_REG;
+
+//////////////////////////////////////////////////////////////////////
+// PCI Express Device Register Block
+//////////////////////////////////////////////////////////////////////
+
+//Pci Express Device Capabilities Register
+#define PCIE_DEV_CAP_OFFSET 0x004
+#define PCIE_DEV_CNT_OFFSET 0x008
+#define PCIE_DEV_STA_OFFSET 0x00A
+
+//Updated to Rev 2.0
+typedef union _PCIE_DEV_CAP_REG {
+ UINT32 DEV_CAP;
+ struct {
+ UINT32 MaxPayload : 3; //bit 0..2
+ UINT32 PhantomFunc : 2; //bit 3..4
+ UINT32 ExtTagFld : 1; //bit 5
+ UINT32 EpL0Latency : 3; //bit 6..8
+ UINT32 EpL1Latency : 3; //bit 9..11
+ UINT32 AttnBtn : 1; //bit 12 undefined in V2
+ UINT32 AttnInd : 1; //bit 13 undefined in V2
+ UINT32 PowerInd : 1; //bit 14 undefined in V2
+ UINT32 RoleBasedErr: 1; //bit 15 Added in V2
+ UINT32 Reserved1 : 2; //bit 16..17
+ UINT32 SlotPwrLimV : 8; //bit 18..25
+ UINT32 SlotPwrLimS : 2; //bit 26..27
+ UINT32 FuncResetCap: 1; //bit 28 Added in V2
+ UINT32 Reserved2 : 3; //bit 29..31
+ };
+} PCIE_DEV_CAP_REG;
+
+//PCI Express Device Control Register
+//Updated to Rev 2.0
+typedef union _PCIE_DEV_CNT_REG {
+ UINT16 DEV_CNT;
+ struct {
+ UINT16 CorrErrRep : 1; //bit 0
+ UINT16 NfErrRep : 1; //bit 1
+ UINT16 FatalErrRep : 1; //bit 2
+ UINT16 UsupReqRep : 1; //bit 3
+ UINT16 RelaxOrder : 1; //bit 4
+ UINT16 MaxPayload : 3; //bit 5..7
+ UINT16 ExtTagFld : 1; //bit 8
+ UINT16 PhantomFunc : 1; //bit 9
+ UINT16 AuxPwrPm : 1; //bit 10
+ UINT16 NoSnoop : 1; //bit 11
+ UINT16 MaxReadReq : 3; //bit 12..14
+ UINT16 FnRstBrgRtry: 1; //bit 15 Added in V2
+//------------------
+ };
+} PCIE_DEV_CNT_REG;
+
+//PCI Express Device Status Register
+//Updated to Rev 2.0 matches with 1.1
+typedef union _PCIE_DEV_STA_REG {
+ UINT16 DEV_STA;
+ struct {
+ UINT16 CorrErrRep : 1; //bit 0
+ UINT16 NfErrRep : 1; //bit 1
+ UINT16 FatalErrRep : 1; //bit 2
+ UINT16 UsupReqRep : 1; //bit 3
+ UINT16 AuxPower : 1; //bit 4
+ UINT16 TrasactPend : 1; //bit 5
+ UINT16 Reserved : 10; //bit 6..15
+ };
+} PCIE_DEV_STA_REG;
+
+//////////////////////////////////////////////////////////////////////
+// PCI Express Link Register Block
+//////////////////////////////////////////////////////////////////////
+#define PCIE_ASPM_DISABLE 0
+#define PCIE_ASPM_L0_ENABLE 1
+#define PCIE_ASPM_L1_ENABLE 2
+#define PCIE_ASPM_ALL_ENABLE 3
+
+#define PCIE_LNK_CAP_OFFSET 0x00C
+#define PCIE_LNK_CNT_OFFSET 0x010
+#define PCIE_LNK_STA_OFFSET 0x012
+
+#define PCIE_LINK_SPEED_25G 0x01
+
+#define PCIE_LINK_WIDTHx1 0x01
+#define PCIE_LINK_WIDTHx2 0x02
+#define PCIE_LINK_WIDTHx4 0x04
+#define PCIE_LINK_WIDTHx8 0x08
+#define PCIE_LINK_WIDTHx12 0x0c
+#define PCIE_LINK_WIDTHx16 0x10
+#define PCIE_LINK_WIDTHx32 0x20
+
+//Pci Express Link Capabilities Register
+//Updated to Rev 2.0
+typedef union _PCIE_LNK_CAP_REG {
+ UINT32 LNK_CAP;
+ struct {
+ UINT32 MaxLnkSpeed : 4; //bit 0..3
+ UINT32 MaxLnkWidth : 6; //bit 4,5,6,7,8,9
+ UINT32 AspmSupport : 2; //bit 10,11
+ UINT32 ExL0Latency : 3; //bit 12,13,14
+ UINT32 ExL1Latency : 3; //bit 15,16,17
+ UINT32 ClockPm : 1; //bit 18 Added in V2
+ UINT32 SurpDownErr : 1; //bit 19 Added in V2
+ UINT32 DllLnkActive: 1; //bit 20 Added in V2
+ UINT32 BandwNotify : 1; //bit 21 Added in V2
+ UINT32 Reserved : 2; //bit 22,23
+ UINT32 PortNum : 8; //bit 24,25,26,27,28,29,30,31
+ };
+} PCIE_LNK_CAP_REG;
+
+
+//PCI Express Link Control Register
+//Updated to Rev 2.0
+typedef union _PCIE_LNK_CNT_REG {
+ UINT16 LNK_CNT;
+ struct {
+ UINT16 AspmControl : 2; //bit 0,1
+ UINT16 Reserved0 : 1; //bit 2
+ UINT16 RdComplBound: 1; //bit 3
+ UINT16 LnkDisable : 1; //bit 4
+ UINT16 RetrainLnk : 1; //bit 5
+ UINT16 CommonClk : 1; //bit 6
+ UINT16 ExtSynch : 1; //bit 7
+ UINT16 ClockPm : 1; //bit 8 Added in V2
+ UINT16 HwAutoWdtDis: 1; //bit 9 Added in V2
+ UINT16 BandwMgmtInt: 1; //bit 10 Added in V2
+ UINT16 AutoBandwInt: 1; //bit 11 Added in V2
+ UINT16 Reserved1 : 4; //bit 12,13,14,15
+ };
+} PCIE_LNK_CNT_REG;
+
+//PCI Express Link Status Register
+//Updated to Rev 2.0
+typedef union _PCIE_LNK_STA_REG {
+ UINT16 LNK_STA;
+ struct {
+ UINT16 LnkSpeed : 4; //bit 0,1,2,3
+ UINT16 LnkWidth : 6; //bit 4,5,6,7,8,9
+ UINT16 TrainingErr : 1; //bit 10 Undefined in V2
+ UINT16 LnkTraining : 1; //bit 11
+ UINT16 CommonClk : 1; //bit 12
+ UINT16 DllLnkActive: 1; //bit 13 Added in V2
+ UINT16 BandwMgmtSts: 1; //bit 14 Added in V2
+ UINT16 AutoBandwSts: 1; //bit 15 Added in V2
+ };
+} PCIE_LNK_STA_REG;
+
+//////////////////////////////////////////////////////////////////////
+// PCI Express Slot Register Block
+//////////////////////////////////////////////////////////////////////
+
+#define PCIE_SLT_CAP_OFFSET 0x014
+#define PCIE_SLT_CNT_OFFSET 0x018
+#define PCIE_SLT_STA_OFFSET 0x01A
+
+
+//Pci Express Slot Capabilities Register
+//Updated to Rev 2.0
+typedef union _PCIE_SLT_CAP_REG {
+ UINT32 SLT_CAP;
+ struct {
+ UINT32 AttnBtn : 1; //bit 0
+ UINT32 PwrCntler : 1; //bit 1
+ UINT32 MrlSensor : 1; //bit 2
+ UINT32 AttnInd : 1; //bit 3
+ UINT32 PowerInd : 1; //bit 4
+ UINT32 HpSurprise : 1; //bit 5
+ UINT32 HpCapable : 1; //bit 6
+ UINT32 PwrLimVal : 8; //bit 7,8,9,10,11,12,13,14
+ UINT32 PwrLimScale : 2; //bit 15,16
+ UINT32 EmInterlock : 1; //bit 17 Added in V2
+ UINT32 NoCmdCompl : 1; //bit 18 Added in V2
+ UINT32 PhisSlotNum : 13; //bit 19,20,21,22,23,24,25,26,27,28,29,30,31
+ };
+} PCIE_SLT_CAP_REG;
+
+//HP Slot Indicator Settings
+#define PCIE_SLT_INDICATOR_ON 1
+#define PCIE_SLT_INDICATOR_BLINK 2
+#define PCIE_SLT_INDICATOR_OFF 3
+
+#define PCIE_SLT_PWR_OFF 1
+#define PCIE_SLT_PWR_ON 0
+
+//Different settings for Power Value Defaults.
+//Updated to Rev 2.0 Added
+#define PCIE_SLT_PWR_MAX 0xef
+#define PCIE_SLT_PWR_250W 0xf0
+#define PCIE_SLT_PWR_275W 0xf1
+#define PCIE_SLT_PWR_300W 0xf3
+
+
+//PCI Express Slot Control Register
+//Updated to Rev 2.0
+typedef union _PCIE_SLT_CNT_REG {
+ UINT16 SLT_CNT;
+ struct {
+ UINT16 AttnBtnPress: 1; //bit 0
+ UINT16 PowerFaul : 1; //bit 1
+ UINT16 MrlSensor : 1; //bit 2
+ UINT16 PresenceDet : 1; //bit 3
+ UINT16 CmdCompleted: 1; //bit 4
+ UINT16 HpIntEnable : 1; //bit 5
+ UINT16 AttnIndCnt : 2; //bit 6,7
+ UINT16 PowerIndCnt : 2; //bit 8,9
+ UINT16 PowerOff : 1; //bit 10
+ UINT16 InterlockCnt: 1; //bit 11 Added in V2
+ UINT16 DllStatChEn : 1; //bit 12 Added in V2
+ UINT16 Reserved : 3; //bit 13,14,15
+ };
+} PCIE_SLT_CNT_REG;
+
+//PCI Express Slot Status Register
+//Updated to Rev 2.0
+typedef union _PCIE_SLT_STA_REG {
+ UINT16 SLT_STA;
+ struct {
+ UINT16 AttnBtnPress: 1; //bit 0
+ UINT16 PowerFaul : 1; //bit 1
+ UINT16 MrlSensor : 1; //bit 2
+ UINT16 PresenceDet : 1; //bit 3
+ UINT16 CmdCompleted: 1; //bit 4
+ UINT16 MrlSensOpen : 1; //bit 5
+ UINT16 CardPresent : 1; //bit 6
+ UINT16 InterlockOn : 1; //bit 7 Added in V2
+ UINT16 DllStateChg : 1; //bit 8 Added in V2
+ UINT16 Reserved : 7; //bit 9,10,11,12,13,14,15
+ };
+} PCIE_SLT_STA_REG;
+
+//////////////////////////////////////////////////////////////////////
+// PCI Express Root Register Block
+//////////////////////////////////////////////////////////////////////
+
+#define PCIE_ROOT_CNT_OFFSET 0x01C
+#define PCIE_ROOT_CAP_OFFSET 0x01E //was reserved - Added in V2
+#define PCIE_ROOT_STA_OFFSET 0x020
+
+//PCI Express Root Control Register
+//Updated to Rev 2.0
+typedef union _PCIE_ROOT_CNT_REG {
+ UINT16 ROOT_CNT;
+ struct {
+ UINT16 SysErrCorErr: 1; //bit 0
+ UINT16 SysErrNfErr : 1; //bit 1
+ UINT16 SysErrFatErr: 1; //bit 2
+ UINT16 PmeIntEnable: 1; //bit 3
+ UINT16 CrsSwVisib : 1; //bit 4 Added in V2
+ UINT16 Reserved : 11; //bit 5..15
+ };
+} PCIE_ROOT_CNT_REG;
+
+//PCI Express Root Capabilities Register
+//Register was ADDED in V2 spec
+typedef union _PCIE_ROOT_CAP_REG {
+ UINT16 ROOT_CAP;
+ struct {
+ UINT16 CrsSwVisib : 1; //bit 0
+ UINT16 Reserved : 15; //bit 1..15
+ };
+} PCIE_ROOT_CAP_REG;
+
+
+//PCI Express Root Status Register
+//Updated to Rev 2.0 nothing has cahnged.
+typedef union _PCIE_ROOT_STA_REG {
+ UINT32 ROOT_STA;
+ struct {
+ UINT32 PmeRequesterId : 16; //bit 0..15
+ UINT32 PmeAsserted : 1; //bit 16
+ UINT32 PmePending : 1; //bit 17
+ UINT32 Reserved : 14; //bit 18..31
+ };
+} PCIE_ROOT_STA_REG;
+
+
+//////////////////////////////////////////////////////////////////////
+//PCI Express Extended Capability Pointer structure
+//////////////////////////////////////////////////////////////////////
+
+//First one (if any) located at adderss 0x100 in ext cfg space.
+typedef union _PCIE_EXT_CAP_HDR {
+ UINT32 EXT_CAP_HDR;
+ struct {
+ UINT16 ExtCapId;
+ UINT16 CapVersion : 4;
+ UINT16 NextItemPtr : 12;
+ };
+}PCIE_EXT_CAP_HDR;
+
+//PCI Express Spec Defined Capabilities ID
+#define PCIE_CAP_ID_NO_EXT_CAPS 0x0000
+#define PCIE_CAP_ID_ADV_ERR_REP 0x0001
+#define PCIE_CAP_ID_VIRTUAL_CH 0x0002
+#define PCIE_CAP_ID_SERIAL_NUM 0x0003
+#define PCIE_CAP_ID_POWER_BUDG 0x0004
+//this one is not defined in PCI Express Base Spec
+//but ROOT COMPLEX ROOT PORT must have this Capability
+#define PCIE_CAP_ID_RC_LNK_DECL 0x0005
+//after this cap pointer follows PCI Express Link Register Block
+#define PCIE_CAP_ID_INTERNAL_LNK 0x0006
+#define PCIE_CAP_ID_ARI 0x000E
+#define PCIE_CAP_ID_SRIOV 0x0010
+
+//--------------------------------------------------------------------
+//PCI Express extended Capabilities Definitions
+//--------------------------------------------------------------------
+//All Extended Headers Resides in Ext Cfg Space - above offset 0x100
+
+//////////////////////////////////////////////////////////////////////
+// PCI Express Virtual Cahnnel Register Block
+//////////////////////////////////////////////////////////////////////
+
+//Offsets from the beginning of corresponded Ext Cap Header
+#define PCIE_PORTVC_CAP1_OFFSET 0x004
+#define PCIE_PORTVC_CAP2_OFFSET 0x008
+#define PCIE_PORTVC_CNT_OFFSET 0x00C
+#define PCIE_PORTVC_STS_OFFSET 0x00E
+
+//PCI Express Virtual Channel Capability Register 1
+typedef union _PCIE_PORTVC_CAP_REG1 {
+ UINT32 PORTVC_CAP1;
+ struct {
+ UINT32 ExtVcCnt : 3; //bit 0..2
+ UINT32 Reserved1 : 1; //bit 3
+ UINT32 LPExtVcCnt : 3; //bit 4..6
+ UINT32 Reserved2 : 1; //bit 7
+ UINT32 RefClk : 2; //bit 8..9
+ UINT32 ArbTblEntrySz : 2; //bit 10..11
+ UINT32 Reserved : 20; //bit 12..31
+ };
+} PCIE_PORTVC_CAP_REG1;
+
+
+//PCI Express Virtual Channel Capability Register 2
+typedef union _PCIE_PORTVC_CAP_REG2 {
+ UINT32 PORTVC_CAP2;
+ struct {
+ UINT8 VcArbCap; //bit 0..7
+ UINT16 Reserved; //bit 8..23
+ UINT8 ArbTblOffset; //bit 24..31
+ };
+} PCIE_PORTVC_CAP_REG2;
+
+//PCI Express Virtual Channel Control Register
+typedef union _PCIE_PORTVC_CNT_REG {
+ UINT16 PORTVC_CNT;
+ struct {
+ UINT8 LoadArbTbl : 1; //bit 0
+ UINT8 VcArbSelect : 3; //bit 1..3
+ UINT8 Reserved1 : 4; //bit 4..7
+ UINT8 Reserved : 8; //bit 8..16
+ };
+} PCIE_PORTVC_CNT_REG;
+
+//PCI Express Virtual Channel Status Register
+typedef union _PCIE_PORTVC_STS_REG {
+ UINT16 PORTVC_STS;
+ struct {
+ UINT8 ArbTblSts : 1; //bit 0
+ UINT8 Reserved1 : 7; //bit 1..7
+ UINT8 Reserved : 8; //bit 8..16
+ };
+} PCIE_PORTVC_STS_REG;
+
+//Macro to determine offset of VC Resource Block for particular "Channel"
+//If Port supports N Virtual Channels where n = 0..7
+// n = PCIE_VC_CAP_REG1.ExtVcCnt + PCIE_VC_CAP_REG1.LoPriExtVcCnt
+//it must be same number of VC Resource Register Blocks
+#define PCIE_VC_RES_CAP_OFFSET(Channel) (0x010+(Channel*0x0C))
+#define PCIE_VC_RES_CNT_OFFSET(Channel) (0x014+(Channel*0x0C))
+#define PCIE_VC_RES_STS_OFFSET(Channel) (0x018+(Channel*0x0C)+2)
+
+//PCI Express Virtual Channel Resource Capabiliy Register
+typedef union _PCIE_VC_RESCAP_REG {
+ UINT32 VC_RESCAP;
+ struct {
+ UINT8 PortArbCap : 8; //bit 0..7
+ UINT8 Reserved1 : 6; //bit 8..13
+ UINT8 AdvPackSw : 1; //bit 14
+ UINT8 RejectSnoop : 1; //bit 15
+ UINT8 MaxTimeSlot : 7; //bit 16..22
+ UINT8 Reserved2 : 1; //bit 23
+ UINT8 PortArbTbl : 8; //bit 24..31
+ };
+} PCIE_VC_RESCAP_REG;
+
+//PCI Express Virtual Channel Resource Control Register
+typedef union _PCIE_VC_RESCNT_REG {
+ UINT32 VC_RESCNT;
+ struct {
+ UINT8 Tc_VcMap : 8; //bit 0..7
+ UINT8 Reserved1 : 8; //bit 8..15
+ UINT8 LdPortArbTbl : 1; //bit 16
+ UINT8 PortArbSel : 3; //bit 17..19
+ UINT8 Reserved2 : 4; //bit 20..23
+ UINT8 VcId : 3; //bit 24..26
+ UINT8 Reserved3 : 4; //bit 27..30
+ UINT8 VcEnable : 1; //bit 31
+ };
+} PCIE_VC_RESCNT_REG;
+
+//PCI Express Virtual Channel Resource Status Register
+typedef union _PCIE_VC_RESSTS_REG {
+ UINT16 VC_RESSTS;
+ struct {
+ UINT8 ArbTblSts : 1; //bit 0
+ UINT8 VcNegatPend : 1; //bit 1
+ UINT8 Reserved1 : 6; //bit 8..15
+ UINT8 Reserved2 : 8; //bit 20..23
+ };
+} PCIE_VC_RESSTS_REG;
+
+
+//////////////////////////////////////////////////////////////////////
+// Root Complex Link Declaration Enhanced Capability Header
+//////////////////////////////////////////////////////////////////////
+
+#define PCIE_RCT_ESD_OFFSET 0x004
+#define PCIE_LNK_DSC_OFFSET(Link) (0x010+(Link*0x10))
+#define PCIE_LNK_BAR_OFFSET(Link) (0x018+(Link*0x10))
+
+//definitions of Element Type Field
+#define EL_TYPE_CFG_SPACE 0x00 //Configuration Space Element
+#define EL_TYPE_SYSMEM_PORT 0x01 //System egress port or internal sink (memory)
+#define EL_TYPE_INTERNAL 0x02 //Internal Root Complex Link
+
+//Element Self Description register (ESD)
+typedef union _PCIE_RCT_ESD_REG {
+ UINT32 RCT_ESD;
+ struct{
+ UINT8 ElementType : 4; //bit 0..3
+ UINT8 Reserved1 : 4; //bit 4..7
+ UINT8 NumbOfLinks : 8; //bit 8..15
+ UINT8 ComponentId : 8; //bit 16..23 Starts at 1 - 00 is invalid value
+ UINT8 PortNumber : 8; //bit 24..31
+ };
+} PCIE_RCT_ESD_REG;
+
+#define LNK_TYPE_INT 0 //means link pointd to Memory Mapped space
+#define LNK_TYPE_EXT 1 //means link pointd to PCI Bus Device
+
+//Link Description Register
+typedef union _PCIE_LNK_DSC_REG {
+ UINT32 LNK_DSC;
+ struct{
+ UINT8 LinkValid : 1; //bit 0
+ UINT8 LinkType : 1; //bit 1
+ UINT8 AssocRCRBHdr : 1; //bit 2 //Added in V2.1
+ UINT8 Reserved1 : 5; //bit 3..7
+ UINT8 Reserved2 : 8; //bit 8..15
+ UINT8 TargetCompId : 8; //bit 16..23
+ UINT8 PortNumb : 8; //bit 24..31
+ };
+} PCIE_LNK_DSC_REG;
+
+typedef union _PCIE_LNK_BAR_REG {
+ UINT64 LNK_BAR;
+ struct {
+ UINT32 BitsInBus : 3; //bit 0..3 Encoded number of Bus Number bits (Added in V2.1)
+ UINT32 Reserved1 : 9; //bit 0..11
+ UINT32 Function : 3; //bit 12..14
+ UINT32 Device : 5; //bit 15..19
+ UINT32 Bus_CfgAddrx31 : 12; //bit 20..31 (Added in V2.1) see 7.13.3.2.2 of PCIe Base 2.1
+ UINT32 CfgAddr3263 : 32; //bit 32..64
+ };
+} PCIE_LNK_BAR_REG;
+
+
+//////////////////////////////////////////////////////////////////////
+// PCI Express SRIOV Register Block
+//////////////////////////////////////////////////////////////////////
+#define PCIE_SRIOV_CAP_OFFSET 4
+#define PCIE_SRIOV_CNT_OFFSET 8
+
+
+typedef union _PCIE_SRIOV_CAP_REG{
+ UINT32 SRIOV_CAP;
+ struct {
+ UINT32 VfMigr : 1; //bit 0
+ UINT32 Reserved : 20; //bit 1..20
+ UINT32 VfMgrInt : 11; //bit 21..31
+ };
+}PCIE_SRIOV_CAP_REG;
+
+typedef union _PCIE_SRIOV_CNT_REG{
+ UINT16 SRIOV_CNT;
+ struct {
+ UINT16 VfEnable : 1; //bit 0
+ UINT16 VfMigrEnable : 1; //bit 1
+ UINT16 VfMgrIntEnable : 1; //bit 2
+ UINT16 VfMse : 1; //bit 3
+ UINT16 AreCap : 1; //bit 4
+ UINT16 Reserved : 11; //bit 5..15
+ };
+}PCIE_SRIOV_CNT_REG;
+
+#define PCIE_SRIOV_INITIAL_VF_OFFSET 0x0C
+#define PCIE_SRIOV_FIRST_VF_OFFSET 0x14
+#define PCIE_SRIOV_VF_STRIDE_OFFSET 0x16
+#define PCIE_SRIOV_SUPPORTED_PAGE_SIZES_OFFSET 0x1C
+#define PCIE_SRIOV_SYSTEM_PAGE_SIZE_OFFSET 0x20
+#define PCIE_SRIOV_VF_BAR0_OFFSET 0x24
+
+
+
+#pragma pack(pop)
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2005, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Pkwy, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
diff --git a/Include/PCIE21.h b/Include/PCIE21.h
new file mode 100644
index 0000000..5f75507
--- /dev/null
+++ b/Include/PCIE21.h
@@ -0,0 +1,486 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2010, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/BIN/Core/Include/PCIE21.h 3 4/05/11 1:38p Yakovlevs $Revision: 6 $
+//
+// $Date: 4/05/11 1:38p $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Core/Include/PCIE21.h $
+//
+// 3 4/05/11 1:38p Yakovlevs
+// [TAG] EIP 53475
+// [Category] New Feature
+// [Description] 53475 PCI Express 3.0 support added.
+// [Files] PciBus Module.
+//
+// 2 2/24/10 11:37a Felixp
+//
+//**********************************************************************
+//<AMI_FHDR_START>
+//
+// Name: PCIE21.h
+//
+// Description: PCI-E 2.0/2.1 Declarations.
+//
+//<AMI_FHDR_END>
+//**********************************************************************
+
+#ifndef _PCI_EXPRESS20_H
+#define _PCI_EXPRESS20_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+/****** DO NOT WRITE ABOVE THIS LINE *******/
+
+#pragma pack(push,1)
+//////////////////////////////////////////////////////////////////////
+//Pci Express Gen 2.0 Registers And Definitions
+//////////////////////////////////////////////////////////////////////
+//PCI Express Capability version
+#define PCIE_CAP_VER1 1
+#define PCIE_CAP_VER2 2
+
+
+//New Dev/Port type defined in PCIe v.2 spec.
+#define PCIE_TYPE_RC_INTEGR_EP 9
+#define PCIE_TYPE_RC_EVT_COLLECT 0xa
+
+// Extended capabilities IDs
+#define PCIE_CAP2_RANGE_A 0x1 // Range A supported (50us - 10ms)
+#define PCIE_CAP2_RANGE_B 0x2 // Range B supported (10ms - 250ms)
+#define PCIE_CAP2_RANGE_C 0x4 // Range C supported (250ms - 4s)
+#define PCIE_CAP2_RANGE_D 0x8 // Range D supported (4s-64s)
+
+//////////////////////////////////////////////////////////////////////
+// PCI Express GEN 2 Device Register Block 2
+//////////////////////////////////////////////////////////////////////
+
+//Pci Express Device Capabilities Register
+#define PCIE_DEV_CAP2_OFFSET 0x024
+#define PCIE_DEV_CNT2_OFFSET 0x028
+#define PCIE_DEV_STA2_OFFSET 0x02A
+
+#define PCIE_CAP_TPH_SUPPORT 0x1
+#define PCIE_CAP_EXT_TPH_SUPPORT 0x2
+
+//PCI Express GEN2 Device Capability2 Register
+//Updated to PCIe v2.1
+typedef union _PCIE_DEV_CAP2_REG {
+ UINT32 DEV_CAP2;
+ struct {
+ UINT32 ComplToutRanges : 4; //bit 0..3
+ UINT32 ComplToutDisable: 1; //bit 4
+ UINT32 AriForwarding : 1; //bit 5
+ UINT32 AtomicOpRouting : 1; //bit 6
+ UINT32 AtomicOpCompl32 : 1; //bit 7
+ UINT32 AtomicOpCompl64 : 1; //bit 8
+ UINT32 Cas128Completer : 1; //bit 9
+ UINT32 NoRoPrPrPassing : 1; //bit 10
+ UINT32 LtrMechanism : 1; //bit 11
+ UINT32 TphCompleter : 2; //bit 12,13
+ UINT32 Reserved1 : 6; //bit 14..19
+ UINT32 ExtFmtField : 1; //bit 20
+ UINT32 EndEndTlpPrefix : 1; //bit 21
+ UINT32 MaxEndEndPrefix : 2; //bit 22,23
+ UINT32 Reserved2 : 8; //bit 24..31
+ };
+} PCIE_DEV_CAP2_REG;
+
+//PCI Express GEN2 Device Control2 Register
+//Updated to PCIe v2.1
+typedef union _PCIE_DEV_CNT2_REG {
+ UINT16 DEV_CNT2;
+ struct {
+ UINT16 ComplToutRanges : 4; //bit 0..3
+ UINT16 ComplToutDisable: 1; //bit 4
+ UINT16 AriForwarding : 1; //bit 5
+ UINT16 AtomicOpRequer : 1; //bit 6
+ UINT16 AtomicOpEgresBlk: 1; //bit 7
+ UINT16 IdoRequestEn : 1; //bit 8
+ UINT16 IdoComplEn : 1; //bit 9
+ UINT16 LtrEn : 1; //bit 10
+ UINT16 Reserved : 4; //bit 11..14
+ UINT16 EndEndTlpBlk : 1; //bit 15
+ };
+} PCIE_DEV_CNT2_REG;
+
+//PCI Express GEN2 Device Status2 Register
+//Just a place holder for now....in V2
+
+typedef union _PCIE_DEV_STA2_REG {
+ UINT16 DEV_STA2;
+ struct {
+ UINT16 PlaceHolder : 16;
+ };
+} PCIE_DEV_STA2_REG;
+
+//////////////////////////////////////////////////////////////////////
+// PCI Express GEN 2 Link Register Block 2
+//////////////////////////////////////////////////////////////////////
+//#define PCIE_ASPM_DISABLE 0
+//#define PCIE_ASPM_L0_ENABLE 1
+//#define PCIE_ASPM_L1_ENABLE 2
+//#define PCIE_ASPM_ALL_ENABLE 3
+
+#define PCIE_LNK_CAP2_OFFSET 0x02C
+#define PCIE_LNK_CNT2_OFFSET 0x030
+#define PCIE_LNK_STA2_OFFSET 0x032
+//Added in V2.0
+#define PCIE_LINK_SPEED_50G 0x02
+
+//Pci Express GEN2 Link Capabilities 2 Register
+//Just a place holder for now....in V2
+//In V 3.0 bit definitions was added
+/*typedef union _PCIE_LNK_CAP2_REG {
+ UINT32 LNK_CAP2;
+ struct {
+ UINT32 Reserved : 1; //bit 0
+ UINT32 SupLnkSpeedVect : 7; //bit 1..7
+ UINT32 CrossLnk : 1; //bit 8
+// UINT32 Reserved //bit 9..31
+ };
+} PCIE_LNK_CAP2_REG;
+*/
+
+//PCI Express GEN 2 Link Control2 Register
+//Updated to PCIe v2.1
+typedef union _PCIE_LNK_CNT2_REG {
+ UINT16 LNK_CNT2;
+ struct {
+ UINT16 TargetLnkSpeed : 4; //bit 0,1,2,3
+ UINT16 EnterCompliance : 1; //bit 4
+ UINT16 HwAutoSpeedDis : 1; //bit 5
+ UINT16 SelDeEmphasis : 1; //bit 6
+ UINT16 TrsMargin : 3; //bit 7,8,9
+ UINT16 EnterModCompl : 1; //bit 10
+ UINT16 ComplianceSos : 1; //bit 11
+ UINT16 ComplDeEmphasis : 4; //bit 12, 13,14,15
+ };
+} PCIE_LNK_CNT2_REG;
+
+//PCI Express GEN 2 Link Status2 Register
+//Updated to PCIe v2.1
+typedef union _PCIE_LNK_STA2_REG {
+ UINT16 LNK_STA2;
+ struct {
+ UINT16 SelDeEmphasis : 1; //bit 0
+//PCIe Base v3.0
+ UINT16 EqComplete : 1; //bit 1
+ UINT16 EqPhase1Ok : 1; //bit 2
+ UINT16 EqPhase2Ok : 1; //bit 3
+ UINT16 EqPhase3Ok : 1; //bit 4
+ UINT16 EqRequest : 1; //bit 5
+ UINT16 Reserved : 10; //bit 6..15
+ };
+} PCIE_LNK_STA2_REG;
+
+
+//////////////////////////////////////////////////////////////////////
+// PCI Express Gen 2 Slot Register Block 2
+//////////////////////////////////////////////////////////////////////
+//Rest of registers reserved as place holders in V2.1 spec.
+
+#define PCIE_SLT_CAP2_OFFSET 0x034
+#define PCIE_SLT_CNT2_OFFSET 0x038
+#define PCIE_SLT_STA2_OFFSET 0x03A
+
+
+//Pci Express Slot Capabilities 2 Register
+typedef union _PCIE_SLT_CAP2_REG {
+ UINT32 SLT_CAP2;
+ struct {
+ UINT32 PlaceHolder : 32;
+ };
+} PCIE_SLT_CAP2_REG;
+
+
+//PCI Express Slot Control 2 Register
+typedef union _PCIE_SLT_CNT2_REG {
+ UINT16 SLT_CNT2;
+ struct {
+ UINT16 PlaceHolder : 16;
+ };
+} PCIE_SLT_CNT2_REG;
+
+//PCI Express Slot Status 2 Register
+typedef union _PCIE_SLT_STA2_REG {
+ UINT16 SLT_STA2;
+ struct {
+ UINT16 PlaceHolder : 16;
+ };
+} PCIE_SLT_STA2_REG;
+
+
+//////////////////////////////////////////////////////////////////////
+//PCI Express Extended Capability ID added in V 2.0 and V 2.1 Spec
+//////////////////////////////////////////////////////////////////////
+#define PCIE_CAP_ID_LNK_DECL 0x0005 //Link Declaration Cap (Internal Link)
+#define PCIE_CAP_ID_RC_ECEPA 0x0007 //Root Complex Event Collector End Point Association
+#define PCIE_CAP_ID_MFVCH 0x0008 //Multi Finction Virtual Channel
+#define PCIE_CAP_ID_VIRTUAL_CH2 0x0009 //Another Cap for VC
+#define PCIE_CAP_ID_RCRB 0x000A //RCRB Header
+#define PCIE_CAP_ID_VENDOR_SPEC 0x000B //Vendor-Specific header
+
+#define PCIE_CAP_ID_ACS 0x000D //Access Controll Services Cap.
+#define PCIE_CAP_ID_ATS 0x000F //Address translation Services
+
+#define PCIE_CAP_ID_MULTICAST 0x0012 //Multicast Extended Capability
+
+#define PCIE_CAP_ID_RESIZ_BAR 0x0015 //Resizable BAR Capability
+
+//PCIE_CAP_ID_ARI defined in PCIe.h
+
+//////////////////////////////////////////////////////////////////////
+// Access Control Services (ACS) Extended Capability Structure
+//////////////////////////////////////////////////////////////////////
+#define PCIE_ACS_CAP_OFFSET 0x004
+#define PCIE_ACS_CNT_OFFSET 0x006
+#define PCIE_ACS_EVECT_OFFSET 0x008
+
+
+//ACS Capability register
+typedef union _PCIE_ACS_CAP_REG {
+ UINT16 ACS_CAP;
+ struct {
+ UINT16 SrcValid_V : 1; //bit 0
+ UINT16 TranslBlk_B : 1; //bit 1
+ UINT16 P2PReqRedir_R : 1; //bit 2
+ UINT16 P2PComplRedir_C : 1; //bit 3
+ UINT16 UpForwarding_U : 1; //bit 4
+ UINT16 P2PEgressCtrl_E : 1; //bit 5
+ UINT16 DirTransP2P_T : 1; //bit 6
+ UINT16 Reserved : 1; //bit 7
+ UINT16 CtrlVectSize : 8; //bit 8..15
+ };
+} PCIE_ACS_CAP_REG;
+
+//ACS Control Register.
+typedef union _PCIE_ACS_CNT_REG {
+ UINT16 ACS_CNT;
+ struct {
+ UINT16 SrcValid_V : 1; //bit 0
+ UINT16 TranslBlk_B : 1; //bit 1
+ UINT16 P2PReqRedir_R : 1; //bit 2
+ UINT16 P2PComplRedir_C : 1; //bit 3
+ UINT16 UpForwarding_U : 1; //bit 4
+ UINT16 P2PEgressCtrl_E : 1; //bit 5
+ UINT16 DirTransP2P_T : 1; //bit 6
+ UINT16 Reserved : 9; //bit 7..15
+ };
+} PCIE_ACS_CNT_REG;
+
+
+//////////////////////////////////////////////////////////////////////
+// Resizable BAR Extended Capability Structure CAP_ID == 0x0015
+//////////////////////////////////////////////////////////////////////
+
+#define PCIE_RESIZ_BAR_CAP_OFFSET 0x004
+#define PCIE_RESIZ_BAR_CNT_OFFSET 0x008
+
+//Value for Resizable BAR Control Register
+typedef enum {
+ lenBar1M =0,
+ lenBar2M, //1
+ lenBar4M, //2
+ lenBar8M, //3
+ lenBar16M, //4
+ lenBar32M, //5
+ lenBar64M, //6
+ lenBar128M, //7
+ lenBar256M, //8
+ lenBar512M, //9
+ lenBar1G, //10
+ lenBar2G, //11
+ lenBar4G, //12
+ lenBar8G, //13
+ lenBar16G, //14
+ lenBar32G, //15
+ lenBar64G, //16
+ lenBar128G, //17
+ lenBar256G, //18
+ lenBar512G, //19
+ lenBarMaxLen //20
+} PCIE_BAR_LENGTH;
+
+
+
+//Resizable BAR Capability Register.
+typedef union _PCIE_RESIZ_BAR_CAP_REG {
+ UINT32 RESIZ_BAR_CAP;
+ struct {
+ UINT8 Reserved1 : 4; //bit 0..3
+ UINT8 BarSize1M : 1; //bit 4
+ UINT8 BarSize2M : 1; //bit 5
+ UINT8 BarSize4M : 1; //bit 6
+ UINT8 BarSize8M : 1; //bit 7
+ UINT8 BarSize16M : 1; //bit 8
+ UINT8 BarSize32M : 1; //bit 9
+ UINT8 BarSize64M : 1; //bit 10
+ UINT8 BarSize128M : 1; //bit 11
+ UINT8 BarSize256M : 1; //bit 12
+ UINT8 BarSize512M : 1; //bit 13
+ UINT8 BarSize1G : 1; //bit 14
+ UINT8 BarSize2G : 1; //bit 15
+ UINT8 BarSize4G : 1; //bit 16
+ UINT8 BarSize8G : 1; //bit 17
+ UINT8 BarSize16G : 1; //bit 18
+ UINT8 BarSize32G : 1; //bit 19
+ UINT8 BarSize64G : 1; //bit 20
+ UINT8 BarSize128G : 1; //bit 21
+ UINT8 BarSize256G : 1; //bit 22
+ UINT8 BarSize512G : 1; //bit 23
+ };
+} PCIE_RESIZ_BAR_CAP_REG;
+
+//Resizable BAR Control Register.
+typedef union _PCIE_RESIZ_BAR_CNT_REG {
+ UINT16 RESIZ_BAR_CNT;
+ struct {
+ UINT16 BarIndex : 3; //bit 0..2
+ UINT16 Reserved1 : 2; //bit 3,4
+ UINT16 NumBars : 3; //bit 5..7 valid values 1..6 applicablr only for first RESIZ_BAR_CNT_REG for all other -Reserved.
+ UINT16 BarSize : 5; //bit 8..12
+ UINT16 Reserved2 : 3; //bit 13..15
+ };
+} PCIE_RESIZ_BAR_CNT_REG;
+
+
+//////////////////////////////////////////////////////////////////////
+// Alternative Routing ID (ARI) Extended Capability Structure CAP_ID == 0x0015
+//////////////////////////////////////////////////////////////////////
+
+#define PCIE_ARI_CAP_OFFSET 0x004
+#define PCIE_ARI_CNT_OFFSET 0x006
+
+//ARI Capability Register.
+typedef union _PCIE_ARI_CAP_REG {
+ UINT16 ARI_CAP;
+ struct {
+ UINT16 MFVCGroup : 1; //bit 0 MFVC Function Groups Capability (M)
+ UINT16 ACSGroup : 1; //bit 1 ACS Function Groups Capability (A)
+ UINT16 Reserved : 6; //bit 2..7
+ UINT16 NextFuncN : 8;
+ };
+}PCIE_ARI_CAP_REG;
+
+
+//ARI Control Register.
+typedef union _PCIE_ARI_CNT_REG {
+ UINT16 ARI_CNT;
+ struct {
+ UINT16 MFVCGroup : 1; //bit 0 MFVC Function Groups Capability (M)
+ UINT16 ACSGroup : 1; //bit 1 ACS Function Groups Capability (A)
+ UINT16 Reserved1 : 2; //bit 2..3
+ UINT16 FuncGroup : 3; //bit 4..6
+ UINT16 Reserved2 : 9; //bit 7..15
+ };
+}PCIE_ARI_CNT_REG;
+
+//////////////////////////////////////////////////////////////////////
+// Address Translation Services (ATS) Extended Capability Structure CAP_ID == 0x000F
+//////////////////////////////////////////////////////////////////////
+
+//ATS Capability Register.
+typedef union _PCIE_ATS_CAP_REG {
+ UINT16 ATS_CAP;
+ struct {
+ UINT16 InvQueue : 5; //bit 0..4
+ UINT16 AlignReq : 1; //bit 5
+ UINT16 Reserved : 10; //bit 2..3
+ };
+}PCIE_ATS_CAP_REG;
+
+
+//ATS Control Register.
+typedef union _PCIE_ATS_CNT_REG {
+ UINT16 ATS_CNT;
+ struct {
+ UINT16 InvQueue : 5; //bit 0..4
+ UINT16 AlignReq : 1; //bit 5
+ UINT16 Reserved : 10; //bit 2..3
+ };
+}PCIE_ATS_CNT_REG;
+
+
+//////////////////////////////////////////////////////////////////////
+// Root Complex Internal Link Control Extended
+// Capability Header CAP_ID == 0x000F
+//////////////////////////////////////////////////////////////////////
+#define PCIE_CAP_ID_RC_INT_LNK 0x0006
+//Pci Express RC Link Capabilities Register
+typedef union _PCIE_RC_LNK_CAP_REG {
+ UINT32 RC_LNK_CAP;
+ struct {
+ UINT32 MaxLnkSpeed : 4; //bit 0..3
+ UINT32 MaxLnkWidth : 6; //bit 4,5,6,7,8,9
+ UINT32 AspmSupport : 2; //bit 10,11
+ UINT32 ExL0Latency : 3; //bit 12,13,14
+ UINT32 ExL1Latency : 3; //bit 15,16,17
+ };
+} PCIE_RC_LNK_CAP_REG;
+
+//PCI Express RC Link Control Register
+typedef union _PCIE_RC_LNK_CNT_REG {
+ UINT16 LNK_CNT;
+ struct {
+ UINT16 AspmControl : 2; //bit 0,1
+ UINT16 Reserved0 : 5; //bit 2,3,4,5,6
+ UINT16 ExtSynch : 1; //bit 7
+ };
+} PCIE_RC_LNK_CNT_REG;
+
+//PCI Express RC Link Status Register
+typedef union _PCIE_RC_LNK_STA_REG {
+ UINT16 LNK_STA;
+ struct {
+ UINT16 LnkSpeed : 4; //bit 0,1,2,3
+ UINT16 LnkWidth : 6; //bit 4,5,6,7,8,9
+ };
+} PCIE_RC_LNK_STA_REG;
+
+
+
+
+
+
+
+
+#pragma pack(pop)
+
+
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2010, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//********************************************************************** \ No newline at end of file
diff --git a/Include/PCIE30.h b/Include/PCIE30.h
new file mode 100644
index 0000000..414c78f
--- /dev/null
+++ b/Include/PCIE30.h
@@ -0,0 +1,138 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/BIN/Core/Modules/PciBus/PCIE30.h 1 4/05/11 12:26p Yakovlevs $Revision: 6 $
+//
+// $Date: 4/05/11 12:26p $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Core/Modules/PciBus/PCIE30.h $
+//
+// 1 4/05/11 12:26p Yakovlevs
+// [TAG] EIP 53475
+// [Category] New Feature
+// [Description] PCI Express 3.0 support added.
+//
+// [Files] PciBus.c; PciBus.mak; PciBus.h; PciPort.c; PciPort.h;
+//
+// 2 2/24/10 11:37a Felixp
+//
+//**********************************************************************
+//<AMI_FHDR_START>
+//
+// Name: PCIE30.h
+//
+// Description: PCI-E 3.0/3.x Declarations.
+//
+//<AMI_FHDR_END>
+//**********************************************************************
+
+#ifndef _PCI_EXPRESS30_H
+#define _PCI_EXPRESS30_H
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+/****** DO NOT WRITE ABOVE THIS LINE *******/
+
+#pragma pack(push,1)
+//////////////////////////////////////////////////////////////////////
+//Pci Express Gen 3.x Registers And Definitions
+//////////////////////////////////////////////////////////////////////
+
+//Different encoding for determining Link Speed used in V3.0.
+//Added in V3.0
+#define PCIE_LINK_SPEED_VECT_25G 0x01
+#define PCIE_LINK_SPEED_VECT_50G 0x02
+#define PCIE_LINK_SPEED_VECT_80G 0x04
+
+//This Definitions cahnged to reflect LNK SPEED VECTOR BITs
+#define PCIE_LINK_SPEED_80G 0x03
+
+
+//Pci Express GEN2 Link Capabilities 2 Register
+//Just a place holder for now....in V2
+//Defined in Spec V3.0
+typedef union _PCIE_LNK_CAP2_REG {
+ UINT32 LNK_CAP2;
+ struct {
+ UINT32 Reserved1 : 1; //bit 0
+ UINT32 SuppLnkSpeeds : 7; //bit 1..7
+ UINT32 CrossLnk : 1; //bit 8
+ UINT32 Reserved2 : 23;
+ };
+} PCIE_LNK_CAP2_REG;
+
+
+// Extended capabilities IDs added in PCIe 3.0 spec
+#define PCIE_CAP_ID_SEC_PCIE_CAP 0x19
+
+#define PCIE_LNK_CNT3_OFFSET 0x04 //from Secondary PciE Ext Cap Header
+#define PCIE_LANE_ERR_STA_OFFSET 0x08
+#define PCIE_EQUALIZ_CNT_OFFSET 0x0C //Sized by MAx Link width.
+
+//
+//The Secondary PCI Express Extended Capability structure is required for all Ports and RCRBs that
+//support a Link speed of 8.0 GT/s or higher. For Multi-Function Upstream Ports, this capability
+//must be implemented in Function 0 and must not be implemented in other Functions.
+//
+
+//PCI Express GEN 3 Link Control 3 Register
+//Updated to PCIe v2.1
+typedef union _PCIE_LNK_CNT3_REG {
+ UINT32 LNK_CNT3;
+ struct {
+ UINT32 PerformEqualiz : 1; //bit 0
+ UINT32 LnkEqReqIntEn : 1; //bit 1
+ UINT32 Reserved : 29; //bit 2..31
+ };
+} PCIE_LNK_CNT3_REG;
+
+
+
+typedef union _PCIE_LANE_EQ_CNT_REG {
+ UINT16 LANE_EQ_CNT;
+ struct {
+ UINT16 DnsPortTrPreset : 4; //bit 0..3
+ UINT16 DnsPortRcPrHint : 3; //bit 4..6
+ UINT16 Reserved1 : 1; //bit 7
+ UINT16 UpsPortTrPreset : 4; //bit 0..3
+ UINT16 UpsPortRcPrHint : 3; //bit 4..6
+ UINT16 Reserved2 : 1; //bit 7
+ };
+} PCIE_LANE_EQ_CNT_REG;
+
+#pragma pack(pop)
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2010, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
diff --git a/Include/PCIX.h b/Include/PCIX.h
new file mode 100644
index 0000000..9752cc0
--- /dev/null
+++ b/Include/PCIX.h
@@ -0,0 +1,157 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2005, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/BIN/Core/Include/PCIX.h 1 11/04/05 6:32p Yakovlevs $Revision: 6 $
+//
+// $Date: 11/04/05 6:32p $
+//**********************************************************************
+// Revision History
+// ----------------
+
+#ifndef _PCIX_H
+#define _PCIX_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+/****** DO NOT WRITE ABOVE THIS LINE *******/
+
+//This Header file Suppose to cover PCIX and PCIX2
+#include <Efi.h>
+
+#ifndef PCI_CAP_ID_PCIX
+#define PCI_CAP_ID_PCIX 0x07
+#endif
+
+//PCIX and PCIX2 Register Block located after Capability Header
+
+//=================================================================================
+//Here will go Capability registers for Device with Type0 Header(PCIX Devices)
+
+//PCIX Device Command Register
+#define PCIX_DEV_CMD_OFFSET 0x0002
+
+typedef union _PCIX_DEV_CMD_REG {
+ UINT16 DEV_CMD;
+ struct {
+ UINT16 UncDataErrRecovery : 1; //0
+ UINT16 RelaxedOrdering : 1; //1
+ UINT16 MaxMemRdByteCnt : 2; //2 3
+ UINT16 MaxOutstSplitTrans : 3; //4 5 6
+ UINT16 Reserved1 : 5; //7 8 9 10 11
+ UINT16 CapabVersion : 2; //12 13
+ UINT16 Reserved : 2; //14 15
+ };
+} PCIX_DEV_CMD_REG;
+
+//PCIX Device Status register
+#define PCIX_DEV_STA_OFFSET 0x004
+
+typedef union _PCIX_DEV_STA_REG {
+ UINT32 DEV_STA;
+ struct {
+ UINT32 FunctionNo : 3; //0 1 2
+ UINT32 DeviceNo : 5; //3 4 5 6 7
+ UINT32 BusNo : 8; //8 ... 15
+ UINT32 DevCap64bit : 1; //16
+ UINT32 DevCap133Mhz : 1; //17
+ UINT32 SplComplDiscard : 1; //18
+ UINT32 UnexpSplCompl : 1; //19
+ UINT32 DevComplexity : 1; //20
+ UINT32 MaxMemRdBcnt : 2; //21 22
+ UINT32 MaxOutSplTrans : 3; //23 24 25
+ UINT32 MaxCmlRdSize : 3; //26 27 28
+ UINT32 SplComplErrRcv : 1; //29
+ UINT32 DevCapPcix266 : 1; //30
+ UINT32 DevCapPcix533 : 1; //31
+ };
+} PCIX_DEV_STA_REG;
+
+
+//=================================================================================
+//Now will go Capability registers for Device with Type1 Header(PCIX Bridges)
+
+//PCIX Secondary I/F Status register
+#define PCIX_SEC_STA_OFFSET 0x002
+
+//definitions for SecBus Mode and Frequency 4 bits
+#define PCIX_MODE_CONVENT 0x0
+
+#define PCIX_MODE1_66MHZ 0x1
+#define PCIX_MODE1_100MHZ 0x2
+#define PCIX_MODE1_133MHZ 0x3
+
+//next definitions are for PCI-X Mode 2
+#define PCIX_266_66MHZ 0x9
+#define PCIX_266_100MHZ 0xA
+#define PCIX_266_133MHZ 0xB
+
+#define PCIX_533_66MH 0xD
+#define PCIX_533_100MHZ 0xE
+#define PCIX_533_133MHZ 0xF
+
+
+typedef union _PCIX_SEC_STA_REG {
+ UINT16 SEC_STA;
+ struct {
+ UINT16 DevCap64bit : 1; //16
+ UINT16 DevCap133Mhz : 1; //17
+ UINT16 SplComplDiscard : 1; //2
+ UINT16 UnexpSplCompl : 1; //3
+ UINT16 SplComplOverrun : 1; //4
+ UINT16 SplReqDelayed : 1; //5
+ UINT16 SecBusModeFreq : 4; //6 7 8 9
+ UINT16 Reserverd : 2; //10 11
+ UINT16 CapabVersion : 2; //12 13
+ UINT16 DevCapPcix266 : 1; //14
+ UINT16 DevCapPcix533 : 1; //15
+ };
+} PCIX_SEC_STA_REG;
+
+
+
+//TODO//TODO//TODO//TODO//TODO//TODO//TODO//TODO//TODO//TODO//TODO//TODO//TODO//TODO//TODO
+//Here suppose to follow 4 PCIX ECC Control registers common for Devices and Bridges.
+// 1. ECC Control and Status Register
+// 2. ECC First 32 bits Of Address
+// 3. ECC Seconf 32 bits Of Address
+// 4. ECC Attribute Register
+//For PCI Bus Enumertation there are no need of these registers.
+//PCIX specific device drivers must utilize this registers along with corresponded
+//Enable bits in Command register to control ECC Errors and Correct them.
+
+
+
+//TODO//TODO//TODO//TODO//TODO//TODO//TODO//TODO//TODO//TODO//TODO//TODO//TODO//TODO//TODO
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2005, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
diff --git a/Include/PEI.h b/Include/PEI.h
new file mode 100644
index 0000000..51ac733
--- /dev/null
+++ b/Include/PEI.h
@@ -0,0 +1,792 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2005, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/BIN/Core/Include/PEI.h 13 6/16/11 2:52p Felixp $
+//
+// $Revision: 13 $
+//
+// $Date: 6/16/11 2:52p $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Core/Include/PEI.h $
+//
+// 13 6/16/11 2:52p Felixp
+// Surround backward compatibility definitions with #if
+// BACKWARD_COMPATIBLE_MODE
+//
+// 12 5/27/11 5:49p Felixp
+// The definitions that will be removed in the future versions are marked
+// with the comments.
+//
+// 11 3/16/11 11:31p Felixp
+// Several identifiers have been updated to match with the latest revision
+// of the PI spec.
+//
+// 10 3/09/11 5:36p Artems
+// PI 1.0 clean-up - added EFI_FV_INFO and EFI_FV_FILE_INFO definitions
+//
+// 9 2/05/11 1:48p Artems
+// Added PI 1.0-1.1 support
+//
+// 8 11/02/06 10:25p Felixp
+// EFI_PEI_END_OF_PEI_PHASE_PPI_GUID added
+//
+// 7 3/13/06 1:15a Felixp
+//
+// 6 6/06/05 7:49p Felixp
+//
+// 5 6/06/05 1:24p Felixp
+// Type parameter removed from AllocatePages to match PEI CIS 0.91
+//
+// 4 6/03/05 3:44p Felixp
+// Updated to support changes introduced in PEI CIS 0.91
+//
+// 3 3/22/05 5:31p Felixp
+//
+// 2 3/04/05 10:20a Mandal
+//
+// 1 1/28/05 12:44p Felixp
+//
+// 3 1/18/05 3:21p Felixp
+// PrintDebugMessage renamed to Trace
+//
+// 1 12/23/04 9:41a Felixp
+//
+// 11 3/29/04 2:32a Felixp
+//
+// 10 2/24/04 10:20a Felixp
+//
+// 9 2/04/04 12:34a Felixp
+// definition of EFI_PEI_REPORT_STATUS_CODE is fixed
+// to match the spec (PEICIS)
+//
+// 8 1/28/04 3:24a Felixp
+//
+// 7 1/19/04 4:25p Felixp
+// EFI_PEIM_ENTRY_POINT added
+//
+// 6 1/06/04 4:02p Felixp
+//
+// 5 12/29/03 6:58p Felixp
+//
+// 4 12/29/03 5:25p Felixp
+// preffix 'EFI_' added to the names of the PEIM descriptor structures and
+// flags
+//
+// 3 12/17/03 11:08a Markw
+// Uncommented Hob and FFS defintions. Added Boot Mode include.
+//
+// 2 12/15/03 5:33p Robert
+//
+// 1 12/15/03 3:40p Felixp
+//
+//**********************************************************************
+//<AMI_FHDR_START>
+//
+// Name: pei.h
+//
+// Description: PEI definitions
+//
+//<AMI_FHDR_END>
+//**********************************************************************
+#ifndef __PEI__H__
+#define __PEI__H__
+
+#include "efi.h"
+#include "ffs.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+// EFI PEI Services Table
+#define PEI_SERVICES_SIGNATURE 0x5652455320494550
+// PEI Specification Revision information
+#ifndef PI_SPECIFICATION_VERSION
+#define PI_SPECIFICATION_VERSION 91
+#endif
+#define PEI_SERVICES_REVISION PI_SPECIFICATION_VERSION
+#define PEI_SPECIFICATION_MAJOR_REVISION ((PEI_SERVICES_REVISION)>>16)
+#define PEI_SPECIFICATION_MINOR_REVISION ((UINT16)(PEI_SERVICES_REVISION))
+
+//=========================================================================
+
+// PEI Ppi Services List Descriptors
+#define EFI_PEI_PPI_DESCRIPTOR_PIC 0x00000001
+#define EFI_PEI_PPI_DESCRIPTOR_PPI 0x00000010
+#define EFI_PEI_PPI_DESCRIPTOR_NOTIFY_CALLBACK 0x00000020
+#define EFI_PEI_PPI_DESCRIPTOR_NOTIFY_DISPATCH 0x00000040
+#define EFI_PEI_PPI_DESCRIPTOR_NOTIFY_TYPES 0x00000060
+#define EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST 0x80000000
+
+typedef VOID *EFI_PEI_FILE_HANDLE;
+typedef VOID *EFI_PEI_FV_HANDLE;
+
+typedef struct _EFI_SEC_PEI_HAND_OFF {
+ UINT16 DataSize;
+ VOID *BootFirmwareVolumeBase;
+ UINTN BootFirmwareVolumeSize;
+ VOID *TemporaryRamBase;
+ UINTN TemporaryRamSize;
+ VOID *PeiTemporaryRamBase;
+ UINTN PeiTemporaryRamSize;
+ VOID *StackBase;
+ UINTN StackSize;
+} EFI_SEC_PEI_HAND_OFF;
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_PEIM_NOTIFY_ENTRY_POINT) (
+ IN struct _EFI_PEI_SERVICES **PeiServices,
+ IN struct _EFI_PEI_NOTIFY_DESCRIPTOR *NotifyDescriptor,
+ IN VOID *Ppi
+ );
+
+typedef struct _EFI_PEI_PPI_DESCRIPTOR {
+ UINTN Flags;
+ EFI_GUID *Guid;
+ VOID *Ppi;
+} EFI_PEI_PPI_DESCRIPTOR;
+
+typedef struct _EFI_PEI_NOTIFY_DESCRIPTOR {
+ UINTN Flags;
+ EFI_GUID *Guid;
+ EFI_PEIM_NOTIFY_ENTRY_POINT Notify;
+} EFI_PEI_NOTIFY_DESCRIPTOR;
+
+typedef union {
+ EFI_PEI_NOTIFY_DESCRIPTOR Notify;
+ EFI_PEI_PPI_DESCRIPTOR Ppi;
+} EFI_PEI_DESCRIPTOR;
+
+struct _EFI_PEI_SERVICES;
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_PEI_INSTALL_PPI) (
+ IN struct _EFI_PEI_SERVICES **PeiServices,
+ IN EFI_PEI_PPI_DESCRIPTOR *PpiList
+ );
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_PEI_REINSTALL_PPI) (
+ IN struct _EFI_PEI_SERVICES **PeiServices,
+ IN EFI_PEI_PPI_DESCRIPTOR *OldPpi,
+ IN EFI_PEI_PPI_DESCRIPTOR *NewPpi
+ );
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_PEI_LOCATE_PPI) (
+ IN struct _EFI_PEI_SERVICES **PeiServices,
+ IN EFI_GUID *Guid,
+ IN UINTN Instance,
+ IN OUT EFI_PEI_PPI_DESCRIPTOR **PpiDescriptor,
+ IN OUT VOID **Ppi
+ );
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_PEI_NOTIFY_PPI) (
+ IN struct _EFI_PEI_SERVICES **PeiServices,
+ IN EFI_PEI_NOTIFY_DESCRIPTOR *NotifyList
+ );
+
+
+// EFI PEI Boot Mode Services
+typedef
+EFI_STATUS
+(EFIAPI *EFI_PEI_GET_BOOT_MODE) (
+ IN struct _EFI_PEI_SERVICES **PeiServices,
+ IN OUT EFI_BOOT_MODE *BootMode
+ );
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_PEI_SET_BOOT_MODE) (
+ IN struct _EFI_PEI_SERVICES **PeiServices,
+ IN EFI_BOOT_MODE BootMode
+ );
+
+
+// PEI HOB Services
+typedef
+EFI_STATUS
+(EFIAPI *EFI_PEI_GET_HOB_LIST) (
+ IN struct _EFI_PEI_SERVICES **PeiServices,
+ IN OUT VOID **HobList
+ );
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_PEI_CREATE_HOB) (
+ IN struct _EFI_PEI_SERVICES **PeiServices,
+ IN UINT16 Type,
+ IN UINT16 Length,
+ IN OUT VOID **Hob
+ );
+
+
+// FFS Fw Volume support functions
+#if PI_SPECIFICATION_VERSION>=0x00010000
+typedef
+EFI_STATUS
+(EFIAPI *EFI_PEI_FFS_FIND_NEXT_VOLUME2) (
+ IN struct _EFI_PEI_SERVICES **PeiServices,
+ IN UINTN Instance,
+ IN OUT EFI_PEI_FV_HANDLE *FwVolHeader
+ );
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_PEI_FFS_FIND_NEXT_FILE2) (
+ IN struct _EFI_PEI_SERVICES **PeiServices,
+ IN UINT8 SearchType,
+ IN EFI_PEI_FV_HANDLE FwVolHeader,
+ IN OUT EFI_PEI_FILE_HANDLE *FileHeader
+ );
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_PEI_FFS_FIND_SECTION_DATA2) (
+ IN struct _EFI_PEI_SERVICES **PeiServices,
+ IN EFI_SECTION_TYPE SectionType,
+ IN EFI_PEI_FILE_HANDLE FfsFileHeader,
+ IN OUT VOID **SectionData
+ );
+#else
+typedef
+EFI_STATUS
+(EFIAPI *EFI_PEI_FFS_FIND_NEXT_VOLUME) (
+ IN struct _EFI_PEI_SERVICES **PeiServices,
+ IN UINTN Instance,
+ IN OUT EFI_FIRMWARE_VOLUME_HEADER **FwVolHeader
+ );
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_PEI_FFS_FIND_NEXT_FILE) (
+ IN struct _EFI_PEI_SERVICES **PeiServices,
+ IN UINT8 SearchType,
+ IN EFI_FIRMWARE_VOLUME_HEADER *FwVolHeader,
+ IN OUT EFI_FFS_FILE_HEADER **FileHeader
+ );
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_PEI_FFS_FIND_SECTION_DATA) (
+ IN struct _EFI_PEI_SERVICES **PeiServices,
+ IN EFI_SECTION_TYPE SectionType,
+ IN EFI_FFS_FILE_HEADER *FfsFileHeader,
+ IN OUT VOID **SectionData
+ );
+#endif
+
+// Memory Services
+typedef
+EFI_STATUS
+(EFIAPI *EFI_PEI_INSTALL_PEI_MEMORY) (
+ IN struct _EFI_PEI_SERVICES **PeiServices,
+ IN EFI_PHYSICAL_ADDRESS MemoryBegin,
+ IN UINT64 MemoryLength
+ );
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_PEI_ALLOCATE_PAGES) (
+ IN struct _EFI_PEI_SERVICES **PeiServices,
+ IN EFI_MEMORY_TYPE MemoryType,
+ IN UINTN Pages,
+ IN OUT EFI_PHYSICAL_ADDRESS *Memory
+ );
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_PEI_ALLOCATE_POOL) (
+ IN struct _EFI_PEI_SERVICES **PeiServices,
+ IN UINTN Size,
+ OUT VOID **Buffer
+ );
+
+typedef
+VOID
+(EFIAPI *EFI_PEI_COPY_MEM) (
+ IN VOID *Destination,
+ IN VOID *Source,
+ IN UINTN Length
+ );
+
+typedef
+VOID
+(EFIAPI *EFI_PEI_SET_MEM) (
+ IN VOID *Buffer,
+ IN UINTN Size,
+ IN UINT8 Value
+ );
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_PEI_REPORT_STATUS_CODE) (
+ IN struct _EFI_PEI_SERVICES **PeiServices,
+ IN EFI_STATUS_CODE_TYPE Type,
+ IN EFI_STATUS_CODE_VALUE Value,
+ IN UINT32 Instance,
+ IN EFI_GUID *CallerId OPTIONAL,
+ IN EFI_STATUS_CODE_DATA *Data OPTIONAL
+ );
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_PEI_RESET_SYSTEM) (
+ IN struct _EFI_PEI_SERVICES **PeiServices
+ );
+
+//forward declaration
+typedef struct _EFI_PEI_SERVICES EFI_PEI_SERVICES;
+
+//CPU I/O
+typedef struct _EFI_PEI_CPU_IO_PPI EFI_PEI_CPU_IO_PPI;
+
+typedef enum{
+ EfiPeiCpuIoWidthUint8,
+ EfiPeiCpuIoWidthUint16,
+ EfiPeiCpuIoWidthUint32,
+ EfiPeiCpuIoWidthUint64,
+ EfiPeiCpuIoWidthFifoUint8,
+ EfiPeiCpuIoWidthFifoUint16,
+ EfiPeiCpuIoWidthFifoUint32,
+ EfiPeiCpuIoWidthFifoUint64,
+ EfiPeiCpuIoWidthFillUint8,
+ EfiPeiCpuIoWidthFillUint16,
+ EfiPeiCpuIoWidthFillUint32,
+ EfiPeiCpuIoWidthFillUint64,
+ EfiPeiCpuIoWidthMaximum
+} EFI_PEI_CPU_IO_PPI_WIDTH;
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_PEI_CPU_IO_PPI_IO_MEM) (
+ IN CONST EFI_PEI_SERVICES **PeiServices,
+ IN CONST EFI_PEI_CPU_IO_PPI *This,
+ IN EFI_PEI_CPU_IO_PPI_WIDTH Width,
+ IN UINT64 Address,
+ IN UINTN Count,
+ IN OUT VOID *Buffer
+ );
+
+typedef
+UINT8
+(EFIAPI *EFI_PEI_CPU_IO_PPI_IO_READ8) (
+ IN CONST EFI_PEI_SERVICES **PeiServices,
+ IN CONST EFI_PEI_CPU_IO_PPI *This,
+ IN UINT64 Address
+ );
+
+typedef
+UINT16
+(EFIAPI *EFI_PEI_CPU_IO_PPI_IO_READ16) (
+ IN CONST EFI_PEI_SERVICES **PeiServices,
+ IN CONST EFI_PEI_CPU_IO_PPI *This,
+ IN UINT64 Address
+ );
+
+typedef
+UINT32
+(EFIAPI *EFI_PEI_CPU_IO_PPI_IO_READ32) (
+ IN CONST EFI_PEI_SERVICES **PeiServices,
+ IN CONST EFI_PEI_CPU_IO_PPI *This,
+ IN UINT64 Address
+ );
+
+typedef
+UINT64
+(EFIAPI *EFI_PEI_CPU_IO_PPI_IO_READ64) (
+ IN CONST EFI_PEI_SERVICES **PeiServices,
+ IN CONST EFI_PEI_CPU_IO_PPI *This,
+ IN UINT64 Address
+ );
+
+typedef
+VOID
+(EFIAPI *EFI_PEI_CPU_IO_PPI_IO_WRITE8) (
+ IN CONST EFI_PEI_SERVICES **PeiServices,
+ IN CONST EFI_PEI_CPU_IO_PPI *This,
+ IN UINT64 Address,
+ IN UINT8 Data
+ );
+
+typedef
+VOID
+(EFIAPI *EFI_PEI_CPU_IO_PPI_IO_WRITE16) (
+ IN CONST EFI_PEI_SERVICES **PeiServices,
+ IN CONST EFI_PEI_CPU_IO_PPI *This,
+ IN UINT64 Address,
+ IN UINT16 Data
+ );
+
+typedef
+VOID
+(EFIAPI *EFI_PEI_CPU_IO_PPI_IO_WRITE32) (
+ IN CONST EFI_PEI_SERVICES **PeiServices,
+ IN CONST EFI_PEI_CPU_IO_PPI *This,
+ IN UINT64 Address,
+ IN UINT32 Data
+ );
+
+typedef
+VOID
+(EFIAPI *EFI_PEI_CPU_IO_PPI_IO_WRITE64) (
+ IN CONST EFI_PEI_SERVICES **PeiServices,
+ IN CONST EFI_PEI_CPU_IO_PPI *This,
+ IN UINT64 Address,
+ IN UINT64 Data
+ );
+
+typedef
+UINT8
+(EFIAPI *EFI_PEI_CPU_IO_PPI_MEM_READ8) (
+ IN CONST EFI_PEI_SERVICES **PeiServices,
+ IN CONST EFI_PEI_CPU_IO_PPI *This,
+ IN UINT64 Address
+ );
+
+typedef
+UINT16
+(EFIAPI *EFI_PEI_CPU_IO_PPI_MEM_READ16) (
+ IN CONST EFI_PEI_SERVICES **PeiServices,
+ IN CONST EFI_PEI_CPU_IO_PPI *This,
+ IN UINT64 Address
+ );
+
+typedef
+UINT32
+(EFIAPI *EFI_PEI_CPU_IO_PPI_MEM_READ32) (
+ IN CONST EFI_PEI_SERVICES **PeiServices,
+ IN CONST EFI_PEI_CPU_IO_PPI *This,
+ IN UINT64 Address
+ );
+
+typedef
+UINT64
+(EFIAPI *EFI_PEI_CPU_IO_PPI_MEM_READ64) (
+ IN CONST EFI_PEI_SERVICES **PeiServices,
+ IN CONST EFI_PEI_CPU_IO_PPI *This,
+ IN UINT64 Address
+ );
+
+typedef
+VOID
+(EFIAPI *EFI_PEI_CPU_IO_PPI_MEM_WRITE8) (
+ IN CONST EFI_PEI_SERVICES **PeiServices,
+ IN CONST EFI_PEI_CPU_IO_PPI *This,
+ IN UINT64 Address,
+ IN UINT8 Data
+ );
+
+typedef
+VOID
+(EFIAPI *EFI_PEI_CPU_IO_PPI_MEM_WRITE16) (
+ IN CONST EFI_PEI_SERVICES **PeiServices,
+ IN CONST EFI_PEI_CPU_IO_PPI *This,
+ IN UINT64 Address,
+ IN UINT16 Data
+ );
+
+typedef
+VOID
+(EFIAPI *EFI_PEI_CPU_IO_PPI_MEM_WRITE32) (
+ IN CONST EFI_PEI_SERVICES **PeiServices,
+ IN CONST EFI_PEI_CPU_IO_PPI *This,
+ IN UINT64 Address,
+ IN UINT32 Data
+ );
+
+typedef
+VOID
+(EFIAPI *EFI_PEI_CPU_IO_PPI_MEM_WRITE64) (
+ IN CONST EFI_PEI_SERVICES **PeiServices,
+ IN CONST EFI_PEI_CPU_IO_PPI *This,
+ IN UINT64 Address,
+ IN UINT64 Data
+ );
+
+typedef struct _EFI_PEI_CPU_IO_PPI_ACCESS{
+ EFI_PEI_CPU_IO_PPI_IO_MEM Read;
+ EFI_PEI_CPU_IO_PPI_IO_MEM Write;
+} EFI_PEI_CPU_IO_PPI_ACCESS;
+
+// Interface definition
+typedef struct _EFI_PEI_CPU_IO_PPI{
+ EFI_PEI_CPU_IO_PPI_ACCESS Mem;
+ EFI_PEI_CPU_IO_PPI_ACCESS Io;
+ EFI_PEI_CPU_IO_PPI_IO_READ8 IoRead8;
+ EFI_PEI_CPU_IO_PPI_IO_READ16 IoRead16;
+ EFI_PEI_CPU_IO_PPI_IO_READ32 IoRead32;
+ EFI_PEI_CPU_IO_PPI_IO_READ64 IoRead64;
+ EFI_PEI_CPU_IO_PPI_IO_WRITE8 IoWrite8;
+ EFI_PEI_CPU_IO_PPI_IO_WRITE16 IoWrite16;
+ EFI_PEI_CPU_IO_PPI_IO_WRITE32 IoWrite32;
+ EFI_PEI_CPU_IO_PPI_IO_WRITE64 IoWrite64;
+ EFI_PEI_CPU_IO_PPI_MEM_READ8 MemRead8;
+ EFI_PEI_CPU_IO_PPI_MEM_READ16 MemRead16;
+ EFI_PEI_CPU_IO_PPI_MEM_READ32 MemRead32;
+ EFI_PEI_CPU_IO_PPI_MEM_READ64 MemRead64;
+ EFI_PEI_CPU_IO_PPI_MEM_WRITE8 MemWrite8;
+ EFI_PEI_CPU_IO_PPI_MEM_WRITE16 MemWrite16;
+ EFI_PEI_CPU_IO_PPI_MEM_WRITE32 MemWrite32;
+ EFI_PEI_CPU_IO_PPI_MEM_WRITE64 MemWrite64;
+} EFI_PEI_CPU_IO_PPI;
+
+// PCI Cfg
+
+// EFI_PEI_PCI_CFG_PPI_WIDTH
+typedef enum{
+ EfiPeiPciCfgWidthUint8,
+ EfiPeiPciCfgWidthUint16,
+ EfiPeiPciCfgWidthUint32,
+ EfiPeiPciCfgWidthUint64,
+ EfiPeiPciCfgWidthMaximum
+} EFI_PEI_PCI_CFG_PPI_WIDTH;
+
+#define PEI_PCI_CFG_ADDRESS(bus,dev,func,reg) \
+ ((UINT64) ( (((UINTN)bus) << 24) + (((UINTN)dev) << 16) + (((UINTN)func) << 8) + ((UINTN)reg) ))& 0x00000000ffffffff
+
+#ifndef EFI_PEI_PCI_CFG_ADDRESS
+#define EFI_PEI_PCI_CFG_ADDRESS(bus,dev,func,reg) \
+ ((UINT64) ( (((UINTN)bus) << 24) + (((UINTN)dev) << 16) + (((UINTN)func) << 8) + ((UINTN)reg) ))& 0x00000000ffffffff
+#endif
+
+typedef struct{
+ UINT8 Register;
+ UINT8 Function;
+ UINT8 Device;
+ UINT8 Bus;
+#if PI_SPECIFICATION_VERSION>=0x00010000
+ UINT32 ExtendedRegister;
+#else
+ UINT8 Reserved[4];
+#endif
+} PEI_PCI_CFG_PPI_PCI_ADDRESS;
+
+#if PI_SPECIFICATION_VERSION<0x00010000
+typedef struct _EFI_PEI_PCI_CFG_PPI EFI_PEI_PCI_CFG_PPI;
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_PEI_PCI_CFG_PPI_IO) (
+ IN EFI_PEI_SERVICES **PeiServices,
+ IN EFI_PEI_PCI_CFG_PPI *This,
+ IN EFI_PEI_PCI_CFG_PPI_WIDTH Width,
+ IN UINT64 Address,
+ IN OUT VOID *Buffer
+ );
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_PEI_PCI_CFG_PPI_RW) (
+ IN EFI_PEI_SERVICES **PeiServices,
+ IN EFI_PEI_PCI_CFG_PPI *This,
+ IN EFI_PEI_PCI_CFG_PPI_WIDTH Width,
+ IN UINT64 Address,
+ IN UINTN SetBits,
+ IN UINTN ClearBits
+ );
+
+typedef struct _EFI_PEI_PCI_CFG_PPI{
+ EFI_PEI_PCI_CFG_PPI_IO Read;
+ EFI_PEI_PCI_CFG_PPI_IO Write;
+ EFI_PEI_PCI_CFG_PPI_RW Modify;
+} EFI_PEI_PCI_CFG_PPI;
+
+//compatibility definition
+//for PI 1.x Modules that do not use Modify funciton
+typedef EFI_PEI_PCI_CFG_PPI EFI_PEI_PCI_CFG2_PPI;
+#else //#if PI_SPECIFICATION_VERSION<0x00010000
+typedef struct _EFI_PEI_PCI_CFG2_PPI EFI_PEI_PCI_CFG2_PPI;
+typedef
+EFI_STATUS
+(EFIAPI *EFI_PEI_PCI_CFG2_PPI_IO) (
+ IN CONST EFI_PEI_SERVICES **PeiServices,
+ IN CONST EFI_PEI_PCI_CFG2_PPI *This,
+ IN EFI_PEI_PCI_CFG_PPI_WIDTH Width,
+ IN UINT64 Address,
+ IN OUT VOID *Buffer
+ );
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_PEI_PCI_CFG2_PPI_RW) (
+ IN CONST EFI_PEI_SERVICES **PeiServices,
+ IN CONST EFI_PEI_PCI_CFG2_PPI *This,
+ IN EFI_PEI_PCI_CFG_PPI_WIDTH Width,
+ IN UINT64 Address,
+ IN VOID *SetBits,
+ IN VOID *ClearBits
+ );
+
+typedef struct _EFI_PEI_PCI_CFG2_PPI{
+ EFI_PEI_PCI_CFG2_PPI_IO Read;
+ EFI_PEI_PCI_CFG2_PPI_IO Write;
+ EFI_PEI_PCI_CFG2_PPI_RW Modify;
+ UINT16 Segment;
+} EFI_PEI_PCI_CFG2_PPI;
+
+#if BACKWARD_COMPATIBLE_MODE
+//compatibility definition
+//for PI 0.91 Modules that do not use Modify funciton
+typedef EFI_PEI_PCI_CFG2_PPI EFI_PEI_PCI_CFG_PPI;
+#endif
+
+typedef struct {
+ EFI_GUID FileName;
+ EFI_FV_FILETYPE FileType;
+ EFI_FV_FILE_ATTRIBUTES FileAttributes;
+ VOID *Buffer;
+ UINT32 BufferSize;
+} EFI_FV_FILE_INFO;
+
+typedef struct {
+ EFI_FVB_ATTRIBUTES_2 FvAttributes;
+ EFI_GUID FvFormat;
+ EFI_GUID FvName;
+ VOID *FvStart;
+ UINT64 FvSize;
+} EFI_FV_INFO;
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_PEI_FFS_FIND_BY_NAME) (
+ IN CONST EFI_GUID *FileName,
+ IN EFI_PEI_FV_HANDLE VolumeHandle,
+ OUT EFI_PEI_FILE_HANDLE *FileHandle
+ );
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_PEI_FFS_GET_FILE_INFO) (
+ IN EFI_PEI_FILE_HANDLE FileHandle,
+ OUT EFI_FV_FILE_INFO *FileInfo
+ );
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_PEI_FFS_GET_VOLUME_INFO) (
+ IN EFI_PEI_FV_HANDLE VolumeHandle,
+ OUT EFI_FV_INFO *VolumeInfo
+ );
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_PEI_REGISTER_FOR_SHADOW) (
+ IN EFI_PEI_FILE_HANDLE FileHandle
+ );
+
+#endif
+//PEI Services
+typedef struct _EFI_PEI_SERVICES {
+ EFI_TABLE_HEADER Hdr;
+ // PPI Functions
+ EFI_PEI_INSTALL_PPI InstallPpi;
+ EFI_PEI_REINSTALL_PPI ReInstallPpi;
+ EFI_PEI_LOCATE_PPI LocatePpi;
+ EFI_PEI_NOTIFY_PPI NotifyPpi;
+ // Boot Mode Functions
+ EFI_PEI_GET_BOOT_MODE GetBootMode;
+ EFI_PEI_SET_BOOT_MODE SetBootMode;
+ // HOB Functions
+ EFI_PEI_GET_HOB_LIST GetHobList;
+ EFI_PEI_CREATE_HOB CreateHob;
+ // Firmware Volume Functions
+#if PI_SPECIFICATION_VERSION>=0x00010000
+ EFI_PEI_FFS_FIND_NEXT_VOLUME2 FfsFindNextVolume;
+ EFI_PEI_FFS_FIND_NEXT_FILE2 FfsFindNextFile;
+ EFI_PEI_FFS_FIND_SECTION_DATA2 FfsFindSectionData;
+#else
+ EFI_PEI_FFS_FIND_NEXT_VOLUME FfsFindNextVolume;
+ EFI_PEI_FFS_FIND_NEXT_FILE FfsFindNextFile;
+ EFI_PEI_FFS_FIND_SECTION_DATA FfsFindSectionData;
+#endif
+ // PEI Memory Functions
+ EFI_PEI_INSTALL_PEI_MEMORY InstallPeiMemory;
+ EFI_PEI_ALLOCATE_PAGES AllocatePages;
+ EFI_PEI_ALLOCATE_POOL AllocatePool;
+ EFI_PEI_COPY_MEM CopyMem;
+ EFI_PEI_SET_MEM SetMem;
+ // Status Code
+ EFI_PEI_REPORT_STATUS_CODE ReportStatusCode;
+ // Reset
+ EFI_PEI_RESET_SYSTEM ResetSystem;
+ // I/O Abstractions
+ EFI_PEI_CPU_IO_PPI *CpuIo;
+ EFI_PEI_PCI_CFG2_PPI *PciCfg;
+#if PI_SPECIFICATION_VERSION>=0x00010000
+ EFI_PEI_FFS_FIND_BY_NAME FfsFindFileByName;
+ EFI_PEI_FFS_GET_FILE_INFO FfsGetFileInfo;
+ EFI_PEI_FFS_GET_VOLUME_INFO FfsGetVolumeInfo;
+ EFI_PEI_REGISTER_FOR_SHADOW RegisterForShadow;
+#endif
+} EFI_PEI_SERVICES;
+
+typedef EFI_STATUS (EFIAPI *EFI_PEIM_ENTRY_POINT) (
+ IN EFI_PEI_FILE_HANDLE FfsHeader,
+ IN EFI_PEI_SERVICES **PeiServices
+);
+
+#define EFI_PEI_PERMANENT_MEMORY_INSTALLED_PPI \
+{0xf894643d, 0xc449, 0x42d1, 0x8e, 0xa8, 0x85, 0xbd, 0xd8, 0xc6, 0x5b, 0xde}
+
+#define EFI_PEI_MASTER_BOOT_MODE_PEIM_PPI \
+{0x7408d748, 0xfc8c, 0x4ee6, 0x92, 0x88, 0xc4, 0xbe, 0xc0, 0x92, 0xa4, 0x10}
+
+#define EFI_PEI_BOOT_IN_RECOVERY_MODE_PEIM_PPI \
+{0x17ee496a, 0xd8e4, 0x4b9a, 0x94, 0xd1, 0xce, 0x82, 0x72, 0x30, 0x8, 0x50}
+
+#define EFI_DXE_IPL_PPI_GUID \
+{ 0xae8ce5d, 0xe448, 0x4437, 0xa8, 0xd7, 0xeb, 0xf5, 0xf1, 0x94, 0xf7, 0x31 }
+
+#define EFI_PEI_END_OF_PEI_PHASE_PPI_GUID \
+{ 0x605EA650, 0xC65C, 0x42e1, 0xBA, 0x80, 0x91, 0xA5, 0x2A, 0xB6,0x18, 0xC6 }
+
+typedef struct _EFI_DXE_IPL_PPI EFI_DXE_IPL_PPI;
+//TODO: Last parameter differs from PEICIS
+typedef EFI_STATUS (EFIAPI *EFI_DXE_IPL_ENTRY) (
+ IN EFI_DXE_IPL_PPI *This,
+ IN EFI_PEI_SERVICES **PeiServices,
+ IN VOID* HobList
+);
+
+//PPI Interface Structure
+struct _EFI_DXE_IPL_PPI {
+ EFI_DXE_IPL_ENTRY Entry;
+};
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2005, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
diff --git a/Include/PPI/AmiEarlyBistPpi.h b/Include/PPI/AmiEarlyBistPpi.h
new file mode 100644
index 0000000..6e18f11
--- /dev/null
+++ b/Include/PPI/AmiEarlyBistPpi.h
@@ -0,0 +1,88 @@
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2008, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/SOURCE/Modules/SharkBayRefCodes/Haswell/AMI Cpu PKG/CPU Core/CpuPPIs/AmiEarlyBistPpi.h 1 2/07/12 3:58a Davidhsieh $
+//
+// $Revision: 1 $
+//
+// $Date: 2/07/12 3:58a $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/SOURCE/Modules/SharkBayRefCodes/Haswell/AMI Cpu PKG/CPU Core/CpuPPIs/AmiEarlyBistPpi.h $
+//
+// 1 2/07/12 3:58a Davidhsieh
+//
+// 1 5/06/11 6:07a Davidhsieh
+// First release
+//
+// 2 3/04/09 10:42a Markw
+// Update copyright header.
+//
+// 1 10/03/08 1:18p Markw
+//
+//**********************************************************************
+
+//<AMI_FHDR_START>
+//---------------------------------------------------------------------------
+//
+// Name: AmiEarlyBistPpi.h
+//
+// Description: AmiEarlyBistPpi.h
+//
+//---------------------------------------------------------------------------
+//<AMI_FHDR_END>
+
+#ifndef __AMI_EARLY_BIST_PPI_H__
+#define __AMI_EARLY_BIST_PPI_H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+//a7e2ce72-dc32-4bc0-9e35-feb30ae5cc47
+#define AMI_EARLY_BIST_PPI_GUID \
+ {0xa7e2ce72, 0xdc32, 0x4bc0, 0x9e, 0x35, 0xfe, 0xb3, 0xa, 0xe5, 0xcc, 0x47}
+
+typedef struct {
+ UINT32 ApicId;
+ UINT32 Bist;
+} CPU_BIST;
+
+
+typedef struct {
+ UINT32 NumBists; //Number of Bists in array.
+ CPU_BIST CpuBist[1]; //Variable length array
+} AMI_EARLY_BIST_PPI;
+
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2008, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
diff --git a/Include/PPI/AmiKeyCodePpi.h b/Include/PPI/AmiKeyCodePpi.h
new file mode 100644
index 0000000..0da3b26
--- /dev/null
+++ b/Include/PPI/AmiKeyCodePpi.h
@@ -0,0 +1,117 @@
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/BIN/Core/Include/PPI/AmiKeycodePpi.h 2 10/07/11 5:03a Rameshr $
+//
+// $Revision: 2 $
+//
+// $Date: 10/07/11 5:03a $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Core/Include/PPI/AmiKeycodePpi.h $
+//
+// 2 10/07/11 5:03a Rameshr
+// [TAG] - EIP 64356
+// [Category]- IMPROVEMENT
+// [Description]- Check-in the AmiKeyCodePPI.h as a generic PPI
+// [Files] - AmiKeycodePpi.h
+//
+// 1 8/09/11 4:40p Olegi
+// Initial Amikeycode PPI header file check in.
+//
+//*************************************************************************
+
+//<AMI_FHDR_START>
+//---------------------------------------------------------------------------
+//
+// Name: AmiKeycodePpi.h
+//
+// Description: Interface with the input devices in PEI
+//
+//---------------------------------------------------------------------------
+//<AMI_FHDR_END>
+
+#ifndef __AMI_AMIKEYCODE_PPI_H__
+#define __AMI_AMIKEYCODE_PPI_H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "KeyboardCommonDefinitions.h"
+
+//
+//Guid for Normal AmiKeycodePPI ( Ex: Ps2 and USB)
+//
+// {20B0F1C2-B0D8-4c5d-AAD9-F44580DFDF8B}
+#define EFI_PEI_AMI_KEYCODE_PPI_GUID \
+ {0x20b0f1c2, 0xb0d8, 0x4c5d, 0xaa, 0xd9, 0xf4, 0x45, 0x80, 0xdf, 0xdf, 0x8b}
+
+//
+// Guid for PEI Consplitter AmiKeyCodePPI
+//
+// {73DDB5E1-5FB4-4751-AF1E-83CF75BECBB6}
+#define EFI_PEI_CONSPLIT_AMI_KEYCODE_PPI_GUID \
+ {0x73ddb5e1, 0x5fb4, 0x4751, 0xaf, 0x1e, 0x83, 0xcf, 0x75, 0xbe, 0xcb, 0xb6}
+
+GUID_VARIABLE_DECLARATION(gPeiAmikeycodeInputPpiGuid,EFI_PEI_AMI_KEYCODE_PPI_GUID);
+
+GUID_VARIABLE_DECLARATION(gPeiConsplitAmikeycodeInputPpiGuid,EFI_PEI_CONSPLIT_AMI_KEYCODE_PPI_GUID);
+
+typedef struct {
+ EFI_INPUT_KEY Key;
+ EFI_KEY_STATE KeyState;
+ EFI_KEY EfiKey;
+ UINT8 PS2ScanCode;
+} EFI_PEI_AMIKEYCODE_DATA;
+
+typedef struct _EFI_PEI_AMIKEYCODE_PPI EFI_PEI_AMIKEYCODE_PPI;
+
+typedef EFI_STATUS (EFIAPI * EFI_PEI_AMIKEYCODE_READKEY) (
+ IN EFI_PEI_SERVICES **PeiServices,
+ IN EFI_PEI_AMIKEYCODE_PPI *This,
+ OUT EFI_PEI_AMIKEYCODE_DATA *KeyData
+);
+
+typedef EFI_STATUS (EFIAPI * EFI_PEI_AMIKEYCODE_SETLEDSTATE) (
+ IN EFI_PEI_SERVICES **PeiServices,
+ IN EFI_PEI_AMIKEYCODE_PPI *This,
+ IN EFI_KEY_TOGGLE_STATE KeyToggleState
+);
+
+struct _EFI_PEI_AMIKEYCODE_PPI {
+ EFI_PEI_AMIKEYCODE_READKEY ReadKey;
+ EFI_PEI_AMIKEYCODE_SETLEDSTATE SetLedState;
+};
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
diff --git a/Include/PPI/AmiTcgPlatformPpi.cif b/Include/PPI/AmiTcgPlatformPpi.cif
new file mode 100644
index 0000000..edd1b59
--- /dev/null
+++ b/Include/PPI/AmiTcgPlatformPpi.cif
@@ -0,0 +1,8 @@
+<component>
+ name = "AmiTcgPlatformPpi"
+ category = ModulePart
+ LocalRoot = "Include\PPI"
+ RefName = "AmiTcgPlatformPpi"
+[files]
+"AmiTcgPlatformPpi.h"
+<endComponent> \ No newline at end of file
diff --git a/Include/PPI/AmiTcgPlatformPpi.h b/Include/PPI/AmiTcgPlatformPpi.h
new file mode 100644
index 0000000..a96f227
--- /dev/null
+++ b/Include/PPI/AmiTcgPlatformPpi.h
@@ -0,0 +1,105 @@
+//**********************************************************************//
+//**********************************************************************//
+//** **//
+//** (C)Copyright 1985-2012, American Megatrends, Inc. **//
+//** **//
+//** All Rights Reserved. **//
+//** **//
+//** 5555 Oakbrook Pkwy, Suite 200, Norcross, GA 30093 **//
+//** **//
+//** Phone: (770)-246-8600 **//
+//** **//
+//**********************************************************************//
+//**********************************************************************//
+//**********************************************************************//
+// $Header: /Alaska/SOURCE/Modules/TCG2/CommonHeaders/AmiTcgPlatformPpi/AmiTcgPlatformPpi.h 1 4/21/14 2:16p Fredericko $
+//
+// $Revision: 1 $
+//
+// $Date: 4/21/14 2:16p $
+//**********************************************************************//
+// Revision History
+// ----------------
+// $Log: /Alaska/SOURCE/Modules/TCG2/CommonHeaders/AmiTcgPlatformPpi/AmiTcgPlatformPpi.h $
+//
+// 1 4/21/14 2:16p Fredericko
+//
+// 1 10/08/13 12:02p Fredericko
+// Initial Check-In for Tpm-Next module
+//
+// 1 7/10/13 6:00p Fredericko
+// [TAG] EIP120969
+// [Category] New Feature
+// [Description] TCG (TPM20)
+//
+// 1 12/12/11 3:06p Fredericko
+// [TAG] EIP76865
+// [Category] Improvement
+// [Description] Dual Support for TCM and TPM. System could hang in TXT
+// if txt is enabled in setup
+// [Files] AmiTcgPlatfompeilib.c, AmiTcgPlatformPpi.cif,
+// AmiTcgPlatformPpi.h, AmiTcgPlatformProtocol.cif,
+// AmiTcgPlatformProtocol.h,
+// EMpTcmPei.c, TcgDxe.cif, TcgPei.cif, TcgPeiAfterMem.cif,
+// TcgPeiAfterMem.mak, TcgTcmPeiAfterMem.c, xTcgDxe.c, xTcgPei.c,
+// xTcgPeiAfterMem.c
+//
+// 1 12/12/11 2:58p Fredericko
+// [TAG] EIP76865
+// [Category] Improvement
+// [Description] Dual Support for TCM and TPM. System could hang in TXT
+// if txt is enabled in setup
+// [Files] AmiTcgPlatfompeilib.c, AmiTcgPlatformPpi.cif,
+// AmiTcgPlatformPpi.h, AmiTcgPlatformProtocol.cif,
+// AmiTcgPlatformProtocol.h,
+// EMpTcmPei.c, TcgDxe.cif, TcgPei.cif, TcgPeiAfterMem.cif,
+// TcgPeiAfterMem.mak, TcgTcmPeiAfterMem.c, xTcgDxe.c, xTcgPei.c,
+// xTcgPeiAfterMem.c
+//
+//**********************************************************************//
+#ifndef _AMI_TCG_PLATFORM_PPI_H_
+#define _AMI_TCG_PLATFORM_PPI_H_
+#include <PEI.h>
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define AMI_TCG_PLATFORM_PPI_GUID \
+ {0x5687f4a, 0x3ca7, 0x4d19, 0x9b, 0xc5, 0xe1, 0x80, 0xce, 0xa3, 0x56, 0x9f}
+
+typedef struct _AMI_TCG_PLATFORM_PPI AMI_TCG_PLATFORM_PPI;
+
+// for now all it does is return the platform security support type
+typedef UINT8 (EFIAPI *GET_TCG_SUPPORT_TYPE)();
+
+struct _AMI_TCG_PLATFORM_PPI {
+ GET_TCG_SUPPORT_TYPE GetPlatformSecurityType;
+};
+
+typedef struct _AMI_TPM20SUPPORTTYPE_PPI AMI_TPM20SUPPORTTYPE_PPI;
+
+// for now all it does is return the platform security support type
+struct _AMI_TPM20SUPPORTTYPE_PPI {
+ GET_TCG_SUPPORT_TYPE Tpm20SupportType;
+};
+
+#ifdef __cplusplus
+}
+#endif
+#endif
+
+//**********************************************************************//
+//**********************************************************************//
+//** **//
+//** (C)Copyright 1985-2012, American Megatrends, Inc. **//
+//** **//
+//** All Rights Reserved. **//
+//** **//
+//** 5555 Oakbrook Pkwy, Suite 200, Norcross, GA 30093 **//
+//** **//
+//** Phone: (770)-246-8600 **//
+//** **//
+//**********************************************************************//
+//**********************************************************************//
diff --git a/Include/PPI/AtaController.h b/Include/PPI/AtaController.h
new file mode 100644
index 0000000..c924c72
--- /dev/null
+++ b/Include/PPI/AtaController.h
@@ -0,0 +1,85 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2005, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+// $Header: /Alaska/BIN/Core/Modules/Recovery/AtaController.h 2 4/10/06 9:52a Ambikas $
+//
+// $Revision: 2 $
+//
+// $Date: 4/10/06 9:52a $
+//*****************************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Core/Modules/Recovery/AtaController.h $
+//
+// 2 4/10/06 9:52a Ambikas
+//
+// 1 12/01/05 9:35a Felixp
+//
+// 1 10/10/05 11:40a Radhikav
+// Initial Release.
+//
+//
+//
+//
+//*****************************************************************************
+
+
+
+
+#ifndef _PEI_ATA_CONTROLLER_PPI_H
+#define _PEI_ATA_CONTROLLER_PPI_H
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "EFI.h"
+#include "PEI.h"
+
+#define PEI_ATA_CONTROLLER_PPI_GUID \
+ { 0xa1e2176f, 0xcbda, 0x4f32, 0x87, 0x56, 0x7d, 0x7a, 0xe5, 0x22, 0xd6, 0x93 }
+
+typedef struct _PEI_ATA_CONTROLLER_PPI PEI_ATA_CONTROLLER_PPI;
+
+typedef
+EFI_STATUS
+(EFIAPI *PEI_ENABLE_ATA) (
+ IN EFI_PEI_SERVICES **PeiServices,
+ IN PEI_ATA_CONTROLLER_PPI *This,
+ IN UINT8 ChannelMask
+ );
+
+typedef struct _PEI_ATA_CONTROLLER_PPI {
+ PEI_ENABLE_ATA EnableAtaChannel;
+} PEI_ATA_CONTROLLER_PPI;
+
+
+#define PEI_ICH_IDE_PRIMARY 0x01
+#define PEI_ICH_IDE_SECONDARY 0x02
+
+#define PEI_IDE_RECOVERY_NATIVE_MODE_PPI_GUID \
+ { 0x7e13637a, 0xc3f8, 0x43d1, 0xb0, 0x51, 0xed, 0x19, 0xd7, 0x8, 0xec, 0x7a }
+
+typedef struct {
+ UINT16 PCMDBarAddress;
+ UINT16 PCNLBarAddress;
+ UINT16 SCMDBarAddress;
+ UINT16 SCNLBarAddress;
+} PEI_IDE_RECOVERY_NATIVE_MODE_PPI;
+
+#ifdef __cplusplus
+}
+#endif
+#endif
+
+
+
diff --git a/Include/PPI/BaseMemoryTest.h b/Include/PPI/BaseMemoryTest.h
new file mode 100644
index 0000000..84c094d
--- /dev/null
+++ b/Include/PPI/BaseMemoryTest.h
@@ -0,0 +1,82 @@
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
+
+//*************************************************************************
+// $Header: /Alaska/BIN/Chipset/Intel/NorthBridge/Haswell/Intel SystemAgent NB Chipset/NB PPI/BaseMemoryTest.h 1 2/08/12 4:35a Yurenlai $
+//
+// $Revision: 1 $
+//
+// $Date: 2/08/12 4:35a $
+//*************************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Chipset/Intel/NorthBridge/Haswell/Intel SystemAgent NB Chipset/NB PPI/BaseMemoryTest.h $
+//
+// 1 2/08/12 4:35a Yurenlai
+// Intel Haswell/NB eChipset initially releases.
+//
+//*************************************************************************
+//<AMI_FHDR_START>
+//
+// Name: BaseMemoryTest.h
+//
+// Description: This header file contains the PPI definition for the Base
+// Memory Test,
+//
+//<AMI_FHDR_END>
+//*************************************************************************
+
+#ifndef _BASE_MEMORY_TEST_H_
+#define _BASE_MEMORY_TEST_H_
+
+#define PEI_BASE_MEMORY_TEST_GUID \
+ {0xb6ec423c, 0x21d2, 0x490d, 0x85, 0xc6, 0xdd, 0x58, 0x64, 0xea, 0xa6, 0x74}
+
+typedef struct _PEI_BASE_MEMORY_TEST_PPI PEI_BASE_MEMORY_TEST_PPI;
+
+typedef enum {
+ Ignore,
+ Quick,
+ Sparse,
+ Extensive
+} PEI_MEMORY_TEST_OP;
+
+typedef EFI_STATUS (EFIAPI *PEI_BASE_MEMORY_TEST) (
+ IN EFI_PEI_SERVICES **PeiServices,
+ IN PEI_BASE_MEMORY_TEST_PPI *This,
+ IN EFI_PHYSICAL_ADDRESS BeginAddress,
+ IN UINT64 MemoryLength,
+ IN PEI_MEMORY_TEST_OP Operation,
+ OUT EFI_PHYSICAL_ADDRESS *ErrorAddress
+ );
+
+typedef struct _PEI_BASE_MEMORY_TEST_PPI {
+ PEI_BASE_MEMORY_TEST BaseMemoryTest;
+} PEI_BASE_MEMORY_TEST_PPI;
+
+#endif
+
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
diff --git a/Include/PPI/BootScriptExecuter.h b/Include/PPI/BootScriptExecuter.h
new file mode 100644
index 0000000..05dc757
--- /dev/null
+++ b/Include/PPI/BootScriptExecuter.h
@@ -0,0 +1,88 @@
+//**********************************************************************//
+//**********************************************************************//
+//** **//
+//** (C)Copyright 1985-2003, American Megatrends, Inc. **//
+//** **//
+//** All Rights Reserved. **//
+//** **//
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **//
+//** **//
+//** Phone: (770)-246-8600 **//
+//** **//
+//**********************************************************************//
+//**********************************************************************//
+
+//**********************************************************************
+// $Header: /Alaska/BIN/Core/Include/PPI/BootScriptExecuter.h 2 3/13/06 1:16a Felixp $
+//
+// $Revision: 2 $
+//
+// $Date: 3/13/06 1:16a $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Core/Include/PPI/BootScriptExecuter.h $
+//
+// 2 3/13/06 1:16a Felixp
+//
+// 1 1/28/05 12:44p Felixp
+//
+// 1 12/23/04 9:41a Felixp
+//
+// 1 2/26/04 2:45p Markw
+//
+//**********************************************************************
+//<AMI_FHDR_START>
+//
+// Name: BootScriptExecuter_h
+//
+// Description:
+//
+//<AMI_FHDR_END>
+//**********************************************************************
+#ifndef __BOOT_SCRIPT_EXECUTER_PPI__H__
+#define __BOOT_SCRIPT_EXECUTER_PPI__H__
+#include <PEI.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define EFI_PEI_BOOT_SCRIPT_EXECUTER_PPI_GUID \
+ {0xabd42895,0x78cf,0x4872,0x84,0x44,0x1b,0x5c,0x18,0x0b,0xfb,0xff}
+
+GUID_VARIABLE_DECLARATION(gPeiBootScriptExecuterPpiGuid,EFI_PEI_BOOT_SCRIPT_EXECUTER_PPI_GUID);
+
+typedef struct _EFI_PEI_BOOT_SCRIPT_EXECUTER_PPI EFI_PEI_BOOT_SCRIPT_EXECUTER_PPI;
+
+typedef EFI_STATUS (EFIAPI * EFI_PEI_BOOT_SCRIPT_EXECUTE) (
+ IN EFI_PEI_SERVICES **PeiServices,
+ IN EFI_PEI_BOOT_SCRIPT_EXECUTER_PPI *This,
+ IN EFI_PHYSICAL_ADDRESS Address,
+ IN EFI_GUID *FvFile OPTIONAL
+);
+
+struct _EFI_PEI_BOOT_SCRIPT_EXECUTER_PPI {
+ EFI_PEI_BOOT_SCRIPT_EXECUTE Execute;
+};
+
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+
+//**********************************************************************//
+//**********************************************************************//
+//** **//
+//** (C)Copyright 1985-2003, American Megatrends, Inc. **//
+//** **//
+//** All Rights Reserved. **//
+//** **//
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **//
+//** **//
+//** Phone: (770)-246-8600 **//
+//** **//
+//**********************************************************************//
+//**********************************************************************//
diff --git a/Include/PPI/CPUPolicy.h b/Include/PPI/CPUPolicy.h
new file mode 100644
index 0000000..5f12a99
--- /dev/null
+++ b/Include/PPI/CPUPolicy.h
@@ -0,0 +1,91 @@
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2008, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/SOURCE/Modules/SharkBayRefCodes/Haswell/AMI Cpu PKG/CPU Core/CpuPPIs/CPUPolicy.h 1 2/07/12 3:58a Davidhsieh $
+//
+// $Revision: 1 $
+//
+// $Date: 2/07/12 3:58a $
+//*****************************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/SOURCE/Modules/SharkBayRefCodes/Haswell/AMI Cpu PKG/CPU Core/CpuPPIs/CPUPolicy.h $
+//
+// 1 2/07/12 3:58a Davidhsieh
+//
+// 1 5/06/11 6:07a Davidhsieh
+// First release
+//
+// 2 3/04/09 10:42a Markw
+// Add Copyright header.
+//
+// 1 11/02/07 1:59p Markw
+//
+// 1 11/02/07 1:45p Markw
+//
+// 3 3/23/07 9:54a Markw
+// Updated headers.
+//
+// 2 2/20/07 10:56a Markw
+// Update headers.
+//
+// 1 4/01/05 12:55p Robert
+// Initial Checkin
+//
+//
+//*****************************************************************************
+
+//<AMI_FHDR_START>
+//---------------------------------------------------------------------------
+//
+// Name: CPUPolicy.h
+//
+// Description: This forces NB to load after CPU.
+//
+//---------------------------------------------------------------------------
+//<AMI_FHDR_END>
+
+#ifndef FILE_PEI_CPUINIT_POLICY_PPI_H_
+#define FILE_PEI_CPUINIT_POLICY_PPI_H_
+
+// {F824CCBB-D8E0-4522-8AA8-65F04B463DB5}
+#define AMI_PEI_CPUINIT_POLICY_PPI_GUID \
+ {0xf824ccbb, 0xd8e0, 0x4522, 0x8a, 0xa8, 0x65, 0xf0, 0x4b, 0x46, 0x3d, 0xb5}
+
+//EFI_GUID_STRING(AMI_PEI_CPUINIT_POLICY_PPI_GUID, "AMICPUPeiInitPolicy", "AMI Generic CPU PEI Init Policy");
+
+
+typedef struct _AMI_PEI_CPUINIT_POLICY_PPI AMI_PEI_CPUINIT_POLICY_PPI;
+
+typedef struct _AMI_PEI_CPUINIT_POLICY_PPI {
+ UINTN unFlag;
+} AMI_PEI_CPUINIT_POLICY_PPI;
+
+
+#endif
+
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2008, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
diff --git a/Include/PPI/Capsule.h b/Include/PPI/Capsule.h
new file mode 100644
index 0000000..ad1116a
--- /dev/null
+++ b/Include/PPI/Capsule.h
@@ -0,0 +1,100 @@
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/BIN/Core/Include/PPI/Capsule.h 1 5/24/12 3:15p Artems $
+//
+// $Revision: 1 $
+//
+// $Date: 5/24/12 3:15p $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Core/Include/PPI/Capsule.h $
+//
+// 1 5/24/12 3:15p Artems
+// [TAG] EIP74625
+// [Category] New Feature
+// [Description] added new capsule ppi used by Intel's MRC code
+// [Files] Capsule.h
+//
+//**********************************************************************
+//<AMI_FHDR_START>
+//
+// Name: Capsule.h
+//
+// Description:
+//
+//<AMI_FHDR_END>
+//**********************************************************************
+#ifndef _PEI_CAPSULE_PPI_H_
+#define _PEI_CAPSULE_PPI_H_
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <Efi.h>
+#include <Pei.h>
+
+#define PEI_CAPSULE_PPI_GUID \
+ { 0x3acf33ee, 0xd892, 0x40f4, 0xa2, 0xfc, 0x38, 0x54, 0xd2, 0xe1, 0x32, 0x3d }
+
+GUID_VARIABLE_DECLARATION(gPeiCapsulePpiGuid, PEI_CAPSULE_PPI_GUID);
+
+typedef struct _PEI_CAPSULE_PPI PEI_CAPSULE_PPI;
+
+typedef EFI_STATUS
+(EFIAPI *PEI_CAPSULE_COALESCE)(
+ IN EFI_PEI_SERVICES **PeiServices,
+ IN OUT VOID **MemoryBase,
+ IN OUT UINTN *MemSize
+);
+
+typedef EFI_STATUS
+(EFIAPI *PEI_CAPSULE_CHECK_CAPSULE_UPDATE)(
+ IN EFI_PEI_SERVICES **PeiServices
+);
+
+typedef EFI_STATUS
+(EFIAPI *PEI_CAPSULE_CREATE_STATE)(
+ IN EFI_PEI_SERVICES **PeiServices,
+ IN VOID *CapsuleBase,
+ IN UINTN CapsuleSize
+);
+
+struct _PEI_CAPSULE_PPI {
+ PEI_CAPSULE_COALESCE Coalesce;
+ PEI_CAPSULE_CHECK_CAPSULE_UPDATE CheckCapsuleUpdate;
+ PEI_CAPSULE_CREATE_STATE CreateState;
+};
+
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//************************************************************************* \ No newline at end of file
diff --git a/Include/PPI/CpuIo.h b/Include/PPI/CpuIo.h
new file mode 100644
index 0000000..4b869bf
--- /dev/null
+++ b/Include/PPI/CpuIo.h
@@ -0,0 +1,92 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2004, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+//**********************************************************************
+// $Header: /Alaska/BIN/Core/Include/PPI/CpuIo.h 4 3/13/06 1:16a Felixp $
+//
+// $Revision: 4 $
+//
+// $Date: 3/13/06 1:16a $
+//*****************************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Core/Include/PPI/CpuIo.h $
+//
+// 4 3/13/06 1:16a Felixp
+//
+// 3 6/06/05 1:24p Felixp
+//
+// 2 6/03/05 3:44p Felixp
+// Updated to support changes introduced in PEI CIS 0.91
+//
+// 1 1/28/05 12:44p Felixp
+//
+// 1 12/23/04 9:41a Felixp
+//
+// 7 12/19/03 10:15a Robert
+//
+// 6 12/18/03 3:08p Robert
+//
+// 5 12/18/03 2:46p Robert
+//
+// 4 12/16/03 4:03p Robert
+//
+// 3 12/15/03 4:21p Robert
+//
+// 2 12/15/03 3:01p Robert
+// Added SmBus SubComponent
+//
+// 1 12/11/03 5:35p Robert
+// Initial Check in of the Cpu I/O PPI
+//
+//*****************************************************************************
+//<AMI_FHDR_START>
+//
+// Name: CpuIo.h
+//
+// Description: This file is an include file used to define the PPI for the
+// CPU I/O PPI. For questions about the specification refer to the PEI CIS
+//
+//<AMI_FHDR_END>
+//*****************************************************************************
+#ifndef _PEI_CPUIO_PPI_H_
+#define _PEI_CPUIO_PPI_H_
+#ifdef __cplusplus
+extern "C" {
+#endif
+#include<PEI.h>
+
+// This is an indicator GUID without any data. It represents the fact that a PEIM
+// has written the address of the EFI_PEI_CPU_IO_PPI into the EFI_PEI_SERVICES
+#define EFI_PEI_CPU_IO_PPI_INSTALLED_GUID \
+ {0xe6af1f7b, 0xfc3f, 0x46da, 0xa8, 0x28, 0xa3, 0xb4, 0x57, 0xa4, 0x42, 0x82}
+
+GUID_VARIABLE_DECLARATION(gPeiCpuIoPpiInServiceTableGuid,EFI_PEI_CPU_IO_PPI_INSTALLED_GUID);
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2004, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
diff --git a/Include/PPI/CpuPPIs.cif b/Include/PPI/CpuPPIs.cif
new file mode 100644
index 0000000..b738fc8
--- /dev/null
+++ b/Include/PPI/CpuPPIs.cif
@@ -0,0 +1,9 @@
+<component>
+ name = "CpuPPIs"
+ category = ModulePart
+ LocalRoot = "Include\ppi\"
+ RefName = "CpuPPIs"
+[files]
+"CPUPolicy.h"
+"AmiEarlyBistPpi.h"
+<endComponent>
diff --git a/Include/PPI/CryptoPPI.h b/Include/PPI/CryptoPPI.h
new file mode 100644
index 0000000..669a6d2
--- /dev/null
+++ b/Include/PPI/CryptoPPI.h
@@ -0,0 +1,162 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2010, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Pkwy, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+//**********************************************************************
+// $Header: /Alaska/BIN/Modules/CryptoPkg/PPI/CryptoPPI.h 2 11/13/12 11:47a Alexp $
+//
+// $Revision: 2 $
+//
+// $Date: 11/13/12 11:47a $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Modules/CryptoPkg/PPI/CryptoPPI.h $
+//
+// 2 11/13/12 11:47a Alexp
+// EIP#105015
+// Add GUID defines for x509 Public Key file type and
+// Pkcs#7 Cert verification function in Crypto PPI
+//
+// 1 6/13/11 5:19p Alexp
+//
+// 1 5/06/11 6:11p Alexp
+// initial module release
+//
+// 3 4/11/11 12:53p Alexp
+// remove Verify Capsule from Crypto PPI.
+//
+// 2 3/10/11 4:53p Alexp
+//
+// 1 2/28/11 6:46p Alexp
+//
+//**********************************************************************
+//<AMI_FHDR_START>
+//
+// Name: CryptoPPI.h
+//
+// Description: AMI Digital Signature Protocol Definition
+//
+//<AMI_FHDR_END>
+//**********************************************************************
+#ifndef ___AMI_DIGITAL_SIGNATURE_PEI__H__
+#define ___AMI_DIGITAL_SIGNATURE_PEI__H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+// Flags to define type of signature to process
+#define EFI_CRYPT_RSASSA_PKCS1V15 1
+#define EFI_CRYPT_RSASSA_PSS 2
+
+///
+/// SHA-1 digest size in bytes.
+///
+#define SHA1_DIGEST_SIZE 20
+///
+/// SHA-256 digest size in bytes
+///
+#define SHA256_DIGEST_SIZE 32
+
+#define DEFAULT_RSA_KEY_MODULUS_LEN 256 // 2048 bits
+#define DEFAULT_RSA_SIG_LEN DEFAULT_RSA_KEY_MODULUS_LEN // This is true as long as > data
+
+#define AMI_DIGITAL_SIGNATURE_PPI_GUID \
+ { 0x86c29aa5, 0xdb0, 0x4343, 0xbd, 0x52, 0x7a, 0x72, 0x9f, 0x37, 0xc9, 0x6d }
+
+GUID_VARIABLE_DECLARATION(gAmiDigitalSignaturePPIGuid, AMI_DIGITAL_SIGNATURE_PPI_GUID);
+
+typedef struct _AMI_CRYPT_DIGITAL_SIGNATURE_PPI AMI_CRYPT_DIGITAL_SIGNATURE_PPI;
+
+typedef struct{
+ EFI_GUID AlgGuid;
+ UINT32 BlobSize;
+ UINT8 *Blob;
+} PEI_CRYPT_HANDLE;
+
+typedef
+EFI_STATUS
+(EFIAPI *PEI_CRYPT_DS_VERIFY_SIG) (
+ IN CONST AMI_CRYPT_DIGITAL_SIGNATURE_PPI *This,
+ IN PEI_CRYPT_HANDLE *PublicKey,
+ IN PEI_CRYPT_HANDLE *Hash,
+ IN VOID *Signature,
+ IN UINTN SignatureSize,
+ IN UINT32 Flags
+ );
+
+typedef
+EFI_STATUS
+(EFIAPI *PEI_CRYPT_DS_VERIFY_PKCS7SIG) (
+ IN CONST AMI_CRYPT_DIGITAL_SIGNATURE_PPI *This,
+ IN CONST UINT8 *P7Data,
+ IN UINTN P7Size,
+ IN CONST UINT8 *TrustedCert,
+ IN UINTN CertSize,
+ IN OUT UINT8 **Data,
+ IN OUT UINTN *DataSize
+ );
+
+typedef
+EFI_STATUS
+(EFIAPI *PEI_CRYPT_DS_GET_KEY) (
+ IN CONST AMI_CRYPT_DIGITAL_SIGNATURE_PPI *This,
+ IN CONST EFI_GUID *KeyAlgorithm, // supported PKPUB_KEY_GUID only
+ IN PEI_CRYPT_HANDLE *PublicKey
+ );
+
+typedef
+EFI_STATUS
+(EFIAPI *PEI_CRYPT_DS_VERIFY_KEY) (
+ IN CONST AMI_CRYPT_DIGITAL_SIGNATURE_PPI *This,
+ IN CONST EFI_GUID *KeyAlgorithm, // supported PKPUB_KEY_GUID only
+ IN PEI_CRYPT_HANDLE *PublicKey
+ );
+
+typedef
+EFI_STATUS
+(EFIAPI *PEI_CRYPT_DS_HASH)(
+ IN CONST AMI_CRYPT_DIGITAL_SIGNATURE_PPI *This,
+ IN CONST EFI_GUID *HashAlgorithm,
+ IN UINTN num_elem,
+ IN CONST UINT8 *addr[],
+ IN CONST UINTN *len,
+ OUT UINT8 *Hash
+ );
+
+typedef struct _AMI_CRYPT_DIGITAL_SIGNATURE_PPI {
+ PEI_CRYPT_DS_HASH Hash;
+ PEI_CRYPT_DS_VERIFY_KEY VerifyKey; // compares Key with Platform Signing key(PKpub)
+ PEI_CRYPT_DS_VERIFY_SIG VerifySig; // Rsa2048_sha256 Pkcs1v1.5
+ PEI_CRYPT_DS_GET_KEY GetKey;
+ PEI_CRYPT_DS_VERIFY_PKCS7SIG VerifyPkcs7Sig;
+};
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+
+#endif // ___AMI_DIGITAL_SIGNATURE_PEI__H__
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2010, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Pkwy, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
diff --git a/Include/PPI/CspLibPPI.CIF b/Include/PPI/CspLibPPI.CIF
new file mode 100644
index 0000000..c326f60
--- /dev/null
+++ b/Include/PPI/CspLibPPI.CIF
@@ -0,0 +1,9 @@
+<component>
+ name = "CSP Library PPIs"
+ category = ModulePart
+ LocalRoot = "INCLUDE\PPI"
+ RefName = "CSP Library PPIs"
+[files]
+"\CspLibPPI.h"
+"\FwVersion.h"
+<endComponent>
diff --git a/Include/PPI/CspLibPPI.h b/Include/PPI/CspLibPPI.h
new file mode 100644
index 0000000..cd5cf80
--- /dev/null
+++ b/Include/PPI/CspLibPPI.h
@@ -0,0 +1,223 @@
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2008, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/BIN/Chipset/Template/CSPLibrary/CspLibPPI.h 7 7/14/11 2:45p Artems $
+//
+// $Revision: 7 $
+//
+// $Date: 7/14/11 2:45p $
+//*****************************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Chipset/Template/CSPLibrary/CspLibPPI.h $
+//
+// 7 7/14/11 2:45p Artems
+// EIP 64106: Updated source to be UEFI 2.3.1 and PI 1.2 compliant
+//
+// 6 2/22/11 4:41p Artems
+// EIP 51548 - Added AMI copyright headers, replaced TABs with spaces
+//
+// 5 6/12/09 10:55a Robert
+// updated headers
+//
+// 4 6/12/09 10:51a Robert
+// CHM and comment updates
+//
+// 3 10/13/07 11:53p Michaela
+// Added ProgramPciTable to AMI_PEI_PCI_TABLE_INIT_PPI to
+// support multiple access widths
+//
+// 2 3/13/06 3:42p Felixp
+//
+// 1 1/21/05 12:46p Sivagarn
+// Initial Checkin - Version 0.05
+//
+//
+//*****************************************************************************
+
+//<AMI_FHDR_START>
+//----------------------------------------------------------------------------
+//
+// Name: CspLibPPI.h
+//
+// Description:
+// This file contains PPI definitions that are defined in the CSP Library
+//
+//----------------------------------------------------------------------------
+//<AMI_FHDR_END>
+#ifndef __CSP_LIB_PPI_H__
+#define __CSP_LIB_PPI_H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+#include <PEI.h>
+
+//<AMI_GHDR_START>
+//============================================================================
+//
+// Name: AMI_PEI_PCI_TABLE_INIT_PPI_GUID
+//
+// Description:
+// This is the GUID to use to locate the the instance of the
+// AMI_PEI_PCI_TABLE_INIT_PPI
+//
+// Notes:
+// #define AMI_PEI_PCI_TABLE_INIT_PPI_GUID \
+// { 0x97f91e78, 0xea12, 0x4ea6, 0xb7, 0xb3, 0x7b, 0x6, 0x78, 0xc2, 0x86, 0x73 }
+//
+//============================================================================
+//<AMI_GHDR_END>
+#define AMI_PEI_PCI_TABLE_INIT_PPI_GUID \
+{ 0x97f91e78, 0xea12, 0x4ea6, 0xb7, 0xb3, 0x7b, 0x6, 0x78, 0xc2, 0x86, 0x73 }
+
+GUID_VARIABLE_DECLARATION(gPeiPciTableInitPpiGuid,AMI_PEI_PCI_TABLE_INIT_PPI_GUID);
+
+#ifndef GUID_VARIABLE_DEFINITION
+#include <PPI/PciCfg2.h>
+
+typedef struct _AMI_PEI_PCI_TABLE_INIT_PPI AMI_PEI_PCI_TABLE_INIT_PPI;
+
+//<AMI_GHDR_START>
+//------------------------------------------------------------------
+//
+// Name: AMI_PEI_PCI_INIT_TABLE_STRUCT
+//
+// Fields: Type ParameterName Description
+//------------------------------------------------------------------
+// UINT8 bRegIndex - PCI Register to program
+// UINT8 bANDMask - AND mask to apply to data in PCI register
+// UINT8 bORMask - OR mask to apply to data in PCI register after AND mask
+//
+// Description:
+// This data structure contains the information that is used to
+// modify PCI register of a PCI specific device
+//
+//
+// Notes:
+// Only can modify a one byte register at a time.
+// See AMI_PEI_PCI_INIT_TABLE_STRUCT2 to modify lager register
+// at once
+//
+//------------------------------------------------------------------
+//<AMI_GHDR_END>
+typedef struct _AMI_PEI_PCI_INIT_TABLE_STRUCT
+{
+ UINT8 bRegIndex;
+ UINT8 bANDMask;
+ UINT8 bORMask;
+} AMI_PEI_PCI_INIT_TABLE_STRUCT;
+
+//<AMI_GHDR_START>
+//------------------------------------------------------------------
+//
+// Name: AMI_PEI_PCI_INIT_TABLE_STRUCT2
+//
+// Fields: Type ParameterName Description
+//------------------------------------------------------------------
+// UINT8 bRegIndex - PCI Register to program
+// UINTN bANDMask - AND mask to apply to data in PCI register
+// UINTN bORMask - OR mask to apply to data in PCI register after AND mask
+//
+// Description:
+// This data structure contains the information that is used to
+// modify PCI register of a PCI specific device
+//
+//
+// Notes:
+// This Structure is almost the same as AMI_PEI_PCI_INIT_TABLE_STRUCT
+// The difference is in the size of the AND and OR masks. to allow
+// modification of PCI registers larger than one byte
+//
+//------------------------------------------------------------------
+//<AMI_GHDR_END>
+typedef struct
+{
+ UINT8 bRegIndex; // register offset to modify
+ UINTN bANDMask; // specified bits will be cleared
+ UINTN bORMask; // specified bits will be set
+} AMI_PEI_PCI_INIT_TABLE_STRUCT2;
+
+typedef
+EFI_STATUS
+(EFIAPI * AMI_PEI_PCI_TABLE_INIT_FUNCTION) (
+ IN EFI_PEI_SERVICES **PeiServices,
+ IN AMI_PEI_PCI_TABLE_INIT_PPI *This,
+ IN EFI_PEI_PCI_CFG2_PPI *PciCfg, // OPTIONAL
+ IN UINT64 Address,
+ IN AMI_PEI_PCI_INIT_TABLE_STRUCT PCIInitTable[],
+ IN UINT16 wSize
+ );
+
+// This version allows a table of specified access width up to UINTN
+typedef
+EFI_STATUS
+(EFIAPI * AMI_PEI_PCI_TABLE_INIT_FUNCTION_VARACCESS) (
+ IN EFI_PEI_SERVICES **PeiServices,
+ IN AMI_PEI_PCI_TABLE_INIT_PPI *This,
+ IN EFI_PEI_PCI_CFG2_PPI *PciCfg, // OPTIONAL
+ IN UINT64 CfgAddress,
+ IN AMI_PEI_PCI_INIT_TABLE_STRUCT2 *PciInitTable,
+ IN UINT16 TableEntries,
+ IN EFI_PEI_PCI_CFG_PPI_WIDTH AccessWidth
+);
+
+//<AMI_GHDR_START>
+//------------------------------------------------------------------
+//
+// Name: AMI_PEI_PCI_TABLE_INIT_PPI
+//
+// Description:
+// This data structure is the AMI_PEI_PCI_TABLE_INIT_PPI definition
+// This provides this PPI to any module that includes the chipset
+// library. This provides a mechanism to program a table full of
+// PCI information in one function call
+//
+// Fields: Type ParameterName Description
+//------------------------------------------------------------------
+// AMI_PEI_PCI_TABLE_INIT_FUNCTION AMIPEIProgramPCITable - PciTableInit
+// AMI_PEI_PCI_TABLE_INIT_FUNCTION_VARACCESS ProgramPciTable - PciTableInit2
+//
+// Notes:
+// See the function headers for descriptions
+//
+//------------------------------------------------------------------
+//<AMI_GHDR_END>
+typedef struct _AMI_PEI_PCI_TABLE_INIT_PPI
+{
+ AMI_PEI_PCI_TABLE_INIT_FUNCTION AMIPEIProgramPCITable;
+ AMI_PEI_PCI_TABLE_INIT_FUNCTION_VARACCESS ProgramPciTable;
+} AMI_PEI_PCI_TABLE_INIT_PPI;
+
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#endif // #ifndef GUID_VARIABLE_DEFINITION
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2008, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//************************************************************************* \ No newline at end of file
diff --git a/Include/PPI/Decompress.h b/Include/PPI/Decompress.h
new file mode 100644
index 0000000..e87d307
--- /dev/null
+++ b/Include/PPI/Decompress.h
@@ -0,0 +1,85 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/BIN/Core/Include/PPI/Decompress.h 2 3/09/11 5:41p Artems $
+//
+// $Revision: 2 $
+//
+// $Date: 3/09/11 5:41p $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Core/Include/PPI/Decompress.h $
+//
+// 2 3/09/11 5:41p Artems
+// Modified to comply with AMI coding standard
+//
+//**********************************************************************
+
+//<AMI_FHDR_START>
+//---------------------------------------------------------------------------
+//
+// Name: Decompress.h
+//
+// Description: Decompress PPI definition file
+//
+//---------------------------------------------------------------------------
+//<AMI_FHDR_END>
+
+#ifndef __DECOMPRESS_PPI_H__
+#define __DECOMPRESS_PPI_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define EFI_PEI_DECOMPRESS_PPI_GUID \
+ { 0x1a36e4e7, 0xfab6, 0x476a, 0x8e, 0x75, 0x69, 0x5a, 0x5, 0x76, 0xfd, 0xd7 }
+
+GUID_VARIABLE_DECLARATION(gEfiPeiDecompressPpiGuid, EFI_PEI_DECOMPRESS_PPI_GUID);
+
+typedef struct _EFI_PEI_DECOMPRESS_PPI EFI_PEI_DECOMPRESS_PPI;
+
+typedef EFI_STATUS
+(EFIAPI *EFI_PEI_DECOMPRESS_DECOMPRESS)(
+ IN CONST EFI_PEI_DECOMPRESS_PPI *This,
+ IN CONST EFI_COMPRESSION_SECTION *InputSection,
+ OUT VOID **OutputBuffer,
+ OUT UINTN *OutputSize
+);
+
+struct _EFI_PEI_DECOMPRESS_PPI {
+ EFI_PEI_DECOMPRESS_DECOMPRESS Decompress;
+};
+
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
diff --git a/Include/PPI/DeviceRecoveryBlockIo.h b/Include/PPI/DeviceRecoveryBlockIo.h
new file mode 100644
index 0000000..7f1f70e
--- /dev/null
+++ b/Include/PPI/DeviceRecoveryBlockIo.h
@@ -0,0 +1,121 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2005, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/BIN/Core/Modules/Recovery/DeviceRecoveryBlockIo.h 1 12/01/05 9:35a Felixp $
+//
+// $Revision: 1 $
+//
+// $Date: 12/01/05 9:35a $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Core/Modules/Recovery/DeviceRecoveryBlockIo.h $
+//
+// 1 12/01/05 9:35a Felixp
+//
+// 2 3/22/05 9:33p Felixp
+//
+// 1 3/22/05 9:16p Felixp
+//
+//**********************************************************************
+//<AMI_FHDR_START>
+//
+// Name: DeviceRecoveryBlockIo.h
+//
+// Description:
+//
+//<AMI_FHDR_END>
+//**********************************************************************
+#ifndef __DeviceRecoveryBlockIo__H__
+#define __DeviceRecoveryBlockIo__H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+#include <PEI.h>
+
+#define EFI_PEI_VIRTUAL_BLOCK_IO_PPI \
+{ 0x695d8aa1, 0x42ee, 0x4c46, 0x80, 0x5c,0x6e, 0xa6, 0xbc, 0xe7, 0x99, 0xe3 }
+
+typedef struct _EFI_PEI_RECOVERY_BLOCK_IO_PPI EFI_PEI_RECOVERY_BLOCK_IO_PPI;
+
+typedef EFI_STATUS (EFIAPI *EFI_PEI_GET_NUMBER_BLOCK_DEVICES) (
+ IN EFI_PEI_SERVICES **PeiServices,
+ IN EFI_PEI_RECOVERY_BLOCK_IO_PPI *This,
+ OUT UINTN *NumberBlockDevices
+);
+
+//***********************************************************
+// EFI_PEI_BLOCK_DEVICE_TYPE
+//***********************************************************
+typedef enum {
+ LegacyFloppy = 0,
+ IdeCDROM = 1,
+ IdeLS120 = 2,
+ UsbMassStorage = 3,
+ MaxDeviceType
+} EFI_PEI_BLOCK_DEVICE_TYPE;
+
+//***************************************************
+// EFI_PEI_BLOCK_IO_MEDIA
+//***************************************************
+typedef struct {
+ EFI_PEI_BLOCK_DEVICE_TYPE DeviceType;
+ BOOLEAN MediaPresent;
+ UINTN LastBlock;
+ UINTN BlockSize;
+} EFI_PEI_BLOCK_IO_MEDIA;
+
+typedef EFI_STATUS (EFIAPI *EFI_PEI_GET_DEVICE_MEDIA_INFORMATION) (
+ IN EFI_PEI_SERVICES **PeiServices,
+ IN EFI_PEI_RECOVERY_BLOCK_IO_PPI *This,
+ IN UINTN DeviceIndex, OUT EFI_PEI_BLOCK_IO_MEDIA *MediaInfo
+);
+
+//*****************************************************
+// EFI_PEI_LBA
+//*****************************************************
+typedef UINT64 EFI_PEI_LBA;
+
+typedef EFI_STATUS (EFIAPI *EFI_PEI_READ_BLOCKS) (
+ IN EFI_PEI_SERVICES **PeiServices,
+ IN EFI_PEI_RECOVERY_BLOCK_IO_PPI *This,
+ IN UINTN DeviceIndex, IN EFI_PEI_LBA StartLBA,
+ IN UINTN BufferSize, OUT VOID *Buffer
+);
+
+struct _EFI_PEI_RECOVERY_BLOCK_IO_PPI {
+ EFI_PEI_GET_NUMBER_BLOCK_DEVICES GetNumberOfBlockDevices;
+ EFI_PEI_GET_DEVICE_MEDIA_INFORMATION GetBlockDeviceMediaInfo;
+ EFI_PEI_READ_BLOCKS ReadBlocks;
+};
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2005, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
diff --git a/Include/PPI/DeviceRecoveryModule.h b/Include/PPI/DeviceRecoveryModule.h
new file mode 100644
index 0000000..a925419
--- /dev/null
+++ b/Include/PPI/DeviceRecoveryModule.h
@@ -0,0 +1,97 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2005, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/BIN/Core/Modules/Recovery/DeviceRecoveryModule.h 1 12/01/05 9:35a Felixp $
+//
+// $Revision: 1 $
+//
+// $Date: 12/01/05 9:35a $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Core/Modules/Recovery/DeviceRecoveryModule.h $
+//
+// 1 12/01/05 9:35a Felixp
+//
+// 3 3/22/05 9:33p Felixp
+//
+// 2 3/22/05 8:21p Felixp
+//
+// 1 3/22/05 8:04p Felixp
+//
+//**********************************************************************
+//<AMI_FHDR_START>
+//
+// Name: DeviceRecoveryModule.h
+//
+// Description: EFI_PEI_DEVICE_RECOVERY_MODULE_PPI PPI definition
+//
+//<AMI_FHDR_END>
+//**********************************************************************
+#ifndef __DeviceRecoveryModule__H__
+#define __DeviceRecoveryModule__H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+#include <PEI.h>
+
+#define EFI_PEI_DEVICE_RECOVERY_MODULE_PPI_GUID \
+{ 0x0DE2CE25, 0x446A, 0x45a7, 0xBF, 0xC9, 0x37, 0xDA, 0x26, 0x34, 0x4B, 0x37}
+
+typedef struct _EFI_PEI_DEVICE_RECOVERY_MODULE_PPI EFI_PEI_DEVICE_RECOVERY_MODULE_PPI;
+
+typedef EFI_STATUS (EFIAPI *EFI_PEI_DEVICE_GET_NUMBER_RECOVERY_CAPSULE)(
+ IN EFI_PEI_SERVICES **PeiServices,
+ IN EFI_PEI_DEVICE_RECOVERY_MODULE_PPI *This,
+ OUT UINTN *NumberRecoveryCapsules
+);
+
+typedef EFI_STATUS (EFIAPI *EFI_PEI_DEVICE_GET_RECOVERY_CAPSULE_INFO)(
+ IN EFI_PEI_SERVICES **PeiServices,
+ IN EFI_PEI_DEVICE_RECOVERY_MODULE_PPI *This,
+ IN UINTN CapsuleInstance, OUT UINTN *Size,
+ OUT EFI_GUID *CapsuleType
+);
+
+typedef EFI_STATUS (EFIAPI *EFI_PEI_DEVICE_LOAD_RECOVERY_CAPSULE)(
+ IN OUT EFI_PEI_SERVICES **PeiServices,
+ IN struct _EFI_PEI_DEVICE_RECOVERY_MODULE_PPI *This,
+ IN UINTN CapsuleInstance, OUT VOID *Buffer
+);
+
+struct _EFI_PEI_DEVICE_RECOVERY_MODULE_PPI {
+ EFI_PEI_DEVICE_GET_NUMBER_RECOVERY_CAPSULE GetNumberRecoveryCapsules;
+ EFI_PEI_DEVICE_GET_RECOVERY_CAPSULE_INFO GetRecoveryCapsuleInfo;
+ EFI_PEI_DEVICE_LOAD_RECOVERY_CAPSULE LoadRecoveryCapsule;
+};
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2005, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//********************************************************************** \ No newline at end of file
diff --git a/Include/PPI/FirmwareVolumeInfo.h b/Include/PPI/FirmwareVolumeInfo.h
new file mode 100644
index 0000000..006b488
--- /dev/null
+++ b/Include/PPI/FirmwareVolumeInfo.h
@@ -0,0 +1,76 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/BIN/Core/Include/PPI/FirmwareVolumeInfo.h 1 2/05/11 2:15p Artems $
+//
+// $Revision: 1 $
+//
+// $Date: 2/05/11 2:15p $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Core/Include/PPI/FirmwareVolumeInfo.h $
+//
+// 1 2/05/11 2:15p Artems
+// EFI_PEI_FIRMWARE_VOLUME_INFO definition
+//
+// 6 1/13/10 2:13p Felixp
+//
+//**********************************************************************
+//<AMI_FHDR_START>
+//
+// Name: <This File's Name>
+//
+// Description:
+//
+//<AMI_FHDR_END>
+//**********************************************************************
+#ifndef __FIRMWARE_VOLUME_INFO__H__
+#define __FIRMWARE_VOLUME_INFO__H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define EFI_PEI_FIRMWARE_VOLUME_INFO_PPI_GUID \
+ { 0x49edb1c1, 0xbf21, 0x4761, { 0xbb, 0x12, 0xeb, 0x0, 0x31, 0xaa, 0xbb, 0x39 } }
+
+GUID_VARIABLE_DECLARATION(gEfiFirmwareVolumeInfoPpiGuid, EFI_PEI_FIRMWARE_VOLUME_INFO_PPI_GUID);
+
+typedef struct _EFI_PEI_FIRMWARE_VOLUME_INFO_PPI {
+ EFI_GUID FvFormat;
+ VOID *FvInfo;
+ UINT32 FvInfoSize;
+ EFI_GUID *ParentFvName;
+ EFI_GUID *ParentFileName;
+} EFI_PEI_FIRMWARE_VOLUME_INFO_PPI;
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
diff --git a/Include/PPI/FwVersion.h b/Include/PPI/FwVersion.h
new file mode 100644
index 0000000..a957515
--- /dev/null
+++ b/Include/PPI/FwVersion.h
@@ -0,0 +1,156 @@
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2008, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/BIN/Chipset/Template/CSPLibrary/FwVersion.h 11 2/22/11 4:41p Artems $
+//
+// $Revision: 11 $
+//
+// $Date: 2/22/11 4:41p $
+//*****************************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Chipset/Template/CSPLibrary/FwVersion.h $
+//
+// 11 2/22/11 4:41p Artems
+// EIP 51548 - Added AMI copyright headers, replaced TABs with spaces
+//
+// 10 12/17/10 4:41p Artems
+// Added OEM activation key support
+//
+// 9 5/21/10 4:29p Artems
+// Changed to version 3 as per Utility specification
+//
+// 8 4/05/10 6:15p Artems
+// Added Core 4.6.3 backward compatibility fix
+//
+// 7 12/03/09 12:07p Robert
+// updated table header information
+//
+// 6 12/02/09 4:55p Robert
+// Added changes for support for Revision 2 of the Firmware Version
+// Structure
+//
+// 5 6/12/09 1:40p Robert
+// added source safe headers
+//
+//
+//*****************************************************************************
+
+//<AMI_FHDR_START>
+//----------------------------------------------------------------------------
+//
+// Name: FwVersion.h
+//
+// Description:
+// This file the FW_VERSION data structure which is used by AMI utilities to
+// provide information about the BIOS
+//
+//----------------------------------------------------------------------------
+//<AMI_FHDR_END>
+
+#ifndef __FW_VERSION_H__
+#define __FW_VERSION_H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+#define FID_SIGNATURE 0x24464944 //'$FID' signature of the FW VERSION STRUCTURE
+#pragma pack (1)
+
+
+//<AMI_GHDR_START>
+//------------------------------------------------------------------
+//
+// Name: FW_VERSION
+//
+// Fields: Type ParameterName Description
+//------------------------------------------------------------------
+// CHAR8 "FirmwareID[4]" - Signature '$FID'
+// UINT8 StructVersion - Version of the FW_VERSION Structure
+// UINT16 Size - Size of this structure
+// CHAR8 "BiosTag[9]" - BIOS Tag
+// EFI_GUID FirmwareGuid - Firmware GUID
+// CHAR8 "CoreMajorVersion[3]" - Aptio Core Major Version
+// CHAR8 "CoreMinorVersion[3]" - Aptio Core Minor Version
+// CHAR8 "ProjectMajorVersion[3]" - Project Major Version
+// CHAR8 "ProjectMinorVersion[3]" - Project Minor Version
+// UINT16 Year - Build Year
+// UINT8 Month - Build Month
+// UINT8 Day - Build Day
+// UINT8 Hour - Build Hour
+// UINT8 Minute - Build Minute
+// UINT8 Second - Build Second
+// UINT32 OemActivationKeyLength - Length of the OEM Activation key
+// UINT8 OemActivationKey[49] - OEM Activation key
+//
+// Description:
+// This data structure contains the information used by AMI utilities
+// to provide information about the current BIOS
+//
+//
+// Notes:
+// Data structure changed for version 2 of the Firmware Version Structure
+// Version 1 is no longer supported
+//
+//------------------------------------------------------------------
+//<AMI_GHDR_END>
+typedef struct{
+CHAR8 FirmwareID[4]; //Signature '$FID'
+UINT8 StructVersion; //Version of the FW_VERSION Struct
+UINT16 Size; //Size of this structure
+CHAR8 BiosTag[9]; //BIOS Tag
+EFI_GUID FirmwareGuid; //Firmware GUID
+CHAR8 CoreMajorVersion[3];
+CHAR8 CoreMinorVersion[3];
+CHAR8 ProjectMajorVersion[3];
+CHAR8 ProjectMinorVersion[3];
+UINT16 Year;
+UINT8 Month;
+UINT8 Day;
+UINT8 Hour;
+UINT8 Minute;
+UINT8 Second;
+UINT16 SignOnStringId;
+UINT8 OemId[6];
+UINT8 OemTableId[8];
+UINT32 OemActivationKeyLength;
+UINT8 OemActivationKey[49];
+}FW_VERSION;
+#pragma pack ()
+
+
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2008, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
+
diff --git a/Include/PPI/LoadFile.h b/Include/PPI/LoadFile.h
new file mode 100644
index 0000000..47660e4
--- /dev/null
+++ b/Include/PPI/LoadFile.h
@@ -0,0 +1,136 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/BIN/Core/Include/PPI/LoadFile.h 7 6/16/11 3:18p Felixp $
+//
+// $Revision: 7 $
+//
+// $Date: 6/16/11 3:18p $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Core/Include/PPI/LoadFile.h $
+//
+// 7 6/16/11 3:18p Felixp
+// Surround backward compatibility definitions with #if
+// BACKWARD_COMPATIBLE_MODE
+//
+// 6 5/27/11 5:52p Felixp
+// Headers are updated to improve separation of the Framework and PI
+// interfaces.
+// The definitions that will be removed in the future versions are marked
+// with the comments.
+//
+// 5 2/05/11 2:10p Artems
+// Added PI 1.0 support
+//
+// 4 3/13/06 1:16a Felixp
+//
+// 3 3/24/05 11:45a Felixp
+//
+// 2 3/04/05 10:26a Mandal
+//
+// 1 1/28/05 12:44p Felixp
+//
+// 2 1/18/05 3:21p Felixp
+// PrintDebugMessage renamed to Trace
+//
+// 1 12/23/04 9:41a Felixp
+//
+// 1 10/14/04 12:06p Felixp
+//
+//**********************************************************************
+//<AMI_FHDR_START>
+//
+// Name: LoadFile.h
+//
+// Description: EFI_PEI_FV_FILE_LOADER_PPI PPI definition
+//
+//<AMI_FHDR_END>
+//**********************************************************************
+#ifndef __LoadFile__H__
+#define __LoadFile__H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <PEI.h>
+
+#if PI_SPECIFICATION_VERSION >= 0x00010000
+#define EFI_PEI_LOAD_FILE_PPI_GUID \
+ { 0xb9e0abfe, 0x5979, 0x4914, 0x97, 0x7f, 0x6d, 0xee, 0x78, 0xc2, 0x78, 0xa6 }
+#if BACKWARD_COMPATIBLE_MODE
+#define EFI_PEI_FV_FILE_LOADER_GUID EFI_PEI_LOAD_FILE_PPI_GUID
+#endif
+#else
+#define EFI_PEI_FV_FILE_LOADER_GUID \
+ { 0x7e1f0d85, 0x4ff, 0x4bb2, 0x86, 0x6a, 0x31, 0xa2, 0x99, 0x6a, 0x48, 0xa8 }
+GUID_VARIABLE_DECLARATION(gPeiFvFileLoaderPpiGuid, EFI_PEI_FV_FILE_LOADER_GUID);
+#define EFI_PEI_LOAD_FILE_PPI_GUID EFI_PEI_FV_FILE_LOADER_GUID
+#endif //#if PI_SPECIFICATION_VERSION >= 0x00010000
+
+GUID_VARIABLE_DECLARATION(gEfiPeiLoadFilePpiGuid, EFI_PEI_LOAD_FILE_PPI_GUID);
+
+#if PI_SPECIFICATION_VERSION >= 0x00010000
+typedef struct _EFI_PEI_LOAD_FILE_PPI EFI_PEI_LOAD_FILE_PPI;
+
+typedef EFI_STATUS (EFIAPI *EFI_PEI_LOAD_FILE)(
+ IN CONST EFI_PEI_LOAD_FILE_PPI *This,
+ IN EFI_PEI_FILE_HANDLE FileHandle,
+ OUT EFI_PHYSICAL_ADDRESS *ImageAddress,
+ OUT UINT64 *ImageSize,
+ OUT EFI_PHYSICAL_ADDRESS *EntryPoint,
+ OUT UINT32 *AuthenticationState
+);
+
+struct _EFI_PEI_LOAD_FILE_PPI {
+ EFI_PEI_LOAD_FILE LoadFile;
+};
+
+#else //#if PI_SPECIFICATION_VERSION >= 0x00010000
+
+typedef struct _EFI_PEI_FV_FILE_LOADER_PPI EFI_PEI_FV_FILE_LOADER_PPI;
+
+typedef EFI_STATUS (EFIAPI *EFI_PEI_FV_LOAD_FILE) (
+ IN EFI_PEI_FV_FILE_LOADER_PPI *This,
+ IN EFI_FFS_FILE_HEADER *FfsHeader,
+ OUT EFI_PHYSICAL_ADDRESS *ImageAddress,
+ OUT UINT64 *ImageSize,
+ OUT EFI_PHYSICAL_ADDRESS *EntryPoint
+);
+
+struct _EFI_PEI_FV_FILE_LOADER_PPI {
+ EFI_PEI_FV_LOAD_FILE FvLoadFile;
+};
+#endif //#if PI_SPECIFICATION_VERSION >= 0x00010000
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//********************************************************************** \ No newline at end of file
diff --git a/Include/PPI/LoadedImagePpi.h b/Include/PPI/LoadedImagePpi.h
new file mode 100644
index 0000000..4d14959
--- /dev/null
+++ b/Include/PPI/LoadedImagePpi.h
@@ -0,0 +1,83 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2006, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/BIN/Core/Include/PPI/LoadedImagePpi.h 4 2/05/11 2:12p Artems $
+//
+// $Revision: 4 $
+//
+// $Date: 2/05/11 2:12p $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Core/Include/PPI/LoadedImagePpi.h $
+//
+// 4 2/05/11 2:12p Artems
+// Removed EFI_PEI_FILE_HANDLE definition
+//
+// 3 3/12/07 9:49a Felixp
+//
+// 2 3/12/07 9:48a Felixp
+// FileHandle type changed
+//
+// 1 2/19/07 11:19a Pats
+// Add definition for Loaded Image PPI, required for AMI debugger support.
+//
+//**********************************************************************
+//<AMI_FHDR_START>
+//
+// Name: LoadedImagePpi.h
+//
+// Description: EFI_PEI_LOADED_IMAGE_PPI PPI definition
+//
+//<AMI_FHDR_END>
+//**********************************************************************
+#ifndef __LoadedImagePpi__H__
+#define __LoadedImagePpi__H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <PEI.h>
+#include <FFS.h>
+
+// {A62A3FFF-97F0-4332-8CFD-1E343D3631F2}
+#define EFI_PEI_LOADED_IMAGE_PPI_GUID \
+{ 0xa62a3fff, 0x97f0, 0x4332, 0x8c, 0xfd, 0x1e, 0x34, 0x3d, 0x36, 0x31, 0xf2 }
+
+GUID_VARIABLE_DECLARATION(gEfiPeiLoadedImagePpiGuid, EFI_PEI_LOADED_IMAGE_PPI_GUID);
+
+typedef struct _EFI_PEI_LOADED_IMAGE_PPI {
+ EFI_PHYSICAL_ADDRESS ImageAddress;
+ UINT64 ImageSize;
+ EFI_PEI_FILE_HANDLE FileHandle;
+} EFI_PEI_LOADED_IMAGE_PPI;
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2006, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
diff --git a/Include/PPI/NBPPI.CIF b/Include/PPI/NBPPI.CIF
new file mode 100644
index 0000000..84f8cb3
--- /dev/null
+++ b/Include/PPI/NBPPI.CIF
@@ -0,0 +1,9 @@
+<component>
+ name = "NB PPI"
+ category = ModulePart
+ LocalRoot = "INCLUDE\PPI"
+ RefName = "NB PPI"
+[files]
+"\NBPPI.h"
+"\BaseMemoryTest.h"
+<endComponent>
diff --git a/Include/PPI/NBPPI.h b/Include/PPI/NBPPI.h
new file mode 100644
index 0000000..1ba73bc
--- /dev/null
+++ b/Include/PPI/NBPPI.h
@@ -0,0 +1,395 @@
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
+
+//*************************************************************************
+// $Header: /Alaska/BIN/Chipset/Intel/NorthBridge/Haswell/Intel SystemAgent NB Chipset/NB PPI/NBPPI.h 6 4/08/13 8:13a Ireneyang $
+//
+// $Revision: 6 $
+//
+// $Date: 4/08/13 8:13a $
+//*************************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Chipset/Intel/NorthBridge/Haswell/Intel SystemAgent NB Chipset/NB PPI/NBPPI.h $
+//
+// 6 4/08/13 8:13a Ireneyang
+// Update SA RC to 1.4.0.0.
+//
+// 5 4/08/13 7:22a Ireneyang
+// Update SA RC to 1.4.0.0.
+//
+// 4 4/01/13 11:49p Ireneyang
+// [TAG] None
+// [Severity] Improvement
+// [Description] Reduce boot time through PEG.
+// [Files] NB.mak; NBDxe.c; NBPEI.c; NBPPI.h; Sa.asl;
+// PcieComplex.c; GraphicsInit.c; PciExpressInit.c;
+//
+// 3 12/03/12 5:53a Jeffch
+// [TAG] None
+// [Category] Improvement
+// [Description] optimize DetectNonComplaint function.
+// [Description] NBPEI.c, NBPPI.h, NBDxe.c
+//
+// 2 6/14/12 4:29a Yurenlai
+// [TAG] None
+// [Category] Improvement
+// [Description] Add Notify BeforeMrc and AfterMrc.
+// [Description] NBPEI.c, NBPPI.h, MemoryInit.c
+//
+// 1 2/08/12 4:35a Yurenlai
+// Intel Haswell/NB eChipset initially releases.
+//
+//*************************************************************************
+//<AMI_FHDR_START>
+//
+// Name: NBPPI.h
+//
+// Description: This header file contains the PPI definition for the NB.
+//
+//<AMI_FHDR_END>
+//*************************************************************************
+
+#ifndef FILE_PEI_NBINIT_POLICY_PPI_H_
+#define FILE_PEI_NBINIT_POLICY_PPI_H_
+
+#include "HOB.h"
+
+// {9CE4D938-9C87-41d0-9E55-34923FAF8B4F}
+#define AMI_PEI_NBINIT_POLICY_PPI_GUID \
+ {0x9ce4d938, 0x9c87, 0x41d0, 0x9e, 0x55, 0x34, 0x92, 0x3f, 0xaf, 0x8b, 0x4f}
+
+// {E813E116-C099-4D21-9c34-A552D5E9A5D0}
+#define AMI_PEI_MRC_DEFAULT_GUID \
+ {0xe813e116, 0xc099, 0x4d21, 0x9c, 0x34, 0xa5, 0x52, 0xd5, 0xe9, 0xa5, 0xd0}
+
+// {71A8917B-0891-4E27-8A73-A9B334840393}
+#define AMI_PEI_BEFORE_MRC_GUID \
+ {0x71a8917b, 0x891, 0x4e27, 0x8a, 0x73, 0xa9, 0xb3, 0x34, 0x84, 0x3, 0x93}
+
+// {64C96700-6B4C-480C-A3E1-B8BDE8F602B2}
+#define AMI_PEI_AFTER_MRC_GUID \
+ {0x64c96700, 0x6b4c, 0x480c, 0xa3, 0xe1, 0xb8, 0xbd, 0xe8, 0xf6, 0x2, 0xb2}
+
+// {633194BE-1697-11E1-B5F0-2CB24824019B}
+#define AMI_PEI_END_OF_MRC_GUID \
+ {0x633194be, 0x1697, 0x11e1, 0xb5, 0xf0, 0x2c, 0xb2, 0x48, 0x24, 0x01, 0x9b}
+
+// {9F58E424-B96B-45A5-ADDC-D2FE394A99D9}
+#define AMI_PEI_END_MEMORY_DETECT_GUID \
+ {0x9f58e424, 0xb96b, 0x45a5, 0xad, 0xdc, 0xd2, 0xfe, 0x39, 0x4a, 0x99, 0xd9}
+
+// {584CC99F-4BE8-43d1-A45A-933DC39479FC}
+#define AMI_PEI_SET_NB_SUBID_PPI_GUID \
+ {0x584cc99f, 0x4be8, 0x43d1, 0xa4, 0x5a, 0x93, 0x3d, 0xc3, 0x94, 0x79, 0xfc}
+
+// {1F0F049E-3A68-4c97-865A-BC5EED7920E7}
+#define AMI_PEI_NB_CPU_ONLY_RESET_PPI_GUID \
+ {0x1f0f049e, 0x3a68, 0x4c97, 0x86, 0x5a, 0xbc, 0x5e, 0xed, 0x79, 0x20, 0xe7}
+
+// {584CC99F-4BE8-43d1-A45A-933DC39479FC}
+#define AMI_PEI_NB_CUSTOM_PPI_GUID \
+ {0x584cc99f, 0x4be8, 0x43d1, 0xa4, 0x5a, 0x93, 0x3d, 0xc3, 0x94, 0x79, 0xfc}
+
+//-MrcErrorInfo Example
+#ifndef GUID_VARIABLE_DECLARATION
+#define GUID_VARIABLE_DECLARATION(Variable, Guid) extern EFI_GUID Variable
+#endif
+//-MrcErrorInfo Example end
+GUID_VARIABLE_DECLARATION(gAmiPeiNBCustomPpiGuid, AMI_PEI_NB_CUSTOM_PPI_GUID);
+
+#define PEI_MEMORY_RANGE_OPTION_ROM UINT32
+
+#define PEI_MR_OPTION_ROM_ALL 0xFFFFFFFF
+#define PEI_MR_OPTION_ROM_NONE 0x00000000
+#define PEI_MR_OPTION_ROM_C0000_16K 0x00000001
+#define PEI_MR_OPTION_ROM_C4000_16K 0x00000002
+#define PEI_MR_OPTION_ROM_C8000_16K 0x00000004
+#define PEI_MR_OPTION_ROM_CC000_16K 0x00000008
+#define PEI_MR_OPTION_ROM_D0000_16K 0x00000010
+#define PEI_MR_OPTION_ROM_D4000_16K 0x00000020
+#define PEI_MR_OPTION_ROM_D8000_16K 0x00000040
+#define PEI_MR_OPTION_ROM_DC000_16K 0x00000080
+#define PEI_MR_OPTION_ROM_E0000_16K 0x00000100
+#define PEI_MR_OPTION_ROM_E4000_16K 0x00000200
+#define PEI_MR_OPTION_ROM_E8000_16K 0x00000400
+#define PEI_MR_OPTION_ROM_EC000_16K 0x00000800
+#define PEI_MR_OPTION_ROM_F0000_16K 0x00001000
+#define PEI_MR_OPTION_ROM_F4000_16K 0x00002000
+#define PEI_MR_OPTION_ROM_F8000_16K 0x00004000
+#define PEI_MR_OPTION_ROM_FC000_16K 0x00008000
+
+//
+// SMRAM Memory Range
+//
+#define PEI_MEMORY_RANGE_SMRAM UINT32
+#define PEI_MR_SMRAM_ALL 0xFFFFFFFF
+#define PEI_MR_SMRAM_NONE 0x00000000
+#define PEI_MR_SMRAM_CACHEABLE_MASK 0x80000000
+#define PEI_MR_SMRAM_SEGTYPE_MASK 0x00FF0000
+#define PEI_MR_SMRAM_ABSEG_MASK 0x00010000
+#define PEI_MR_SMRAM_HSEG_MASK 0x00020000
+#define PEI_MR_SMRAM_TSEG_MASK 0x00040000
+//
+// If adding additional entries, SMRAM Size
+// is a multiple of 128KB.
+//
+#define PEI_MR_SMRAM_SIZE_MASK 0x0000FFFF
+#define PEI_MR_SMRAM_SIZE_128K_MASK 0x00000001
+#define PEI_MR_SMRAM_SIZE_256K_MASK 0x00000002
+#define PEI_MR_SMRAM_SIZE_512K_MASK 0x00000004
+#define PEI_MR_SMRAM_SIZE_1024K_MASK 0x00000008
+#define PEI_MR_SMRAM_SIZE_2048K_MASK 0x00000010
+#define PEI_MR_SMRAM_SIZE_4096K_MASK 0x00000020
+#define PEI_MR_SMRAM_SIZE_8192K_MASK 0x00000040
+
+
+#define PEI_MR_SMRAM_ABSEG_128K_NOCACHE 0x00010001
+#define PEI_MR_SMRAM_HSEG_128K_CACHE 0x80020001
+#define PEI_MR_SMRAM_HSEG_128K_NOCACHE 0x00020001
+#define PEI_MR_SMRAM_TSEG_128K_CACHE 0x80040001
+#define PEI_MR_SMRAM_TSEG_128K_NOCACHE 0x00040001
+#define PEI_MR_SMRAM_TSEG_256K_CACHE 0x80040002
+#define PEI_MR_SMRAM_TSEG_256K_NOCACHE 0x00040002
+#define PEI_MR_SMRAM_TSEG_512K_CACHE 0x80040004
+#define PEI_MR_SMRAM_TSEG_512K_NOCACHE 0x00040004
+#define PEI_MR_SMRAM_TSEG_1024K_CACHE 0x80040008
+#define PEI_MR_SMRAM_TSEG_1024K_NOCACHE 0x00040008
+#define PEI_MR_SMRAM_TSEG_8192K_CACHE 0x80040040
+#define PEI_MR_SMRAM_TSEG_8192K_NOCACHE 0x00040040
+
+//
+// Graphics Memory Range
+//
+#define PEI_MEMORY_RANGE_GRAPHICS_MEMORY UINT32
+#define PEI_MR_GRAPHICS_MEMORY_ALL 0xFFFFFFFF
+#define PEI_MR_GRAPHICS_MEMORY_NONE 0x00000000
+#define PEI_MR_GRAPHICS_MEMORY_CACHEABLE 0x80000000
+//
+// If adding additional entries, Graphics Memory Size
+// is a multiple of 512KB.
+//
+#define PEI_MR_GRAPHICS_MEMORY_SIZE_MASK 0x0000FFFF
+#define PEI_MR_GRAPHICS_MEMORY_512K_NOCACHE 0x00000001
+#define PEI_MR_GRAPHICS_MEMORY_512K_CACHE 0x80000001
+#define PEI_MR_GRAPHICS_MEMORY_1M_NOCACHE 0x00000002
+#define PEI_MR_GRAPHICS_MEMORY_1M_CACHE 0x80000002
+#define PEI_MR_GRAPHICS_MEMORY_2M_NOCACHE 0x00000004
+#define PEI_MR_GRAPHICS_MEMORY_2M_CACHE 0x80000004
+#define PEI_MR_GRAPHICS_MEMORY_4M_NOCACHE 0x00000008
+#define PEI_MR_GRAPHICS_MEMORY_4M_CACHE 0x80000008
+#define PEI_MR_GRAPHICS_MEMORY_8M_NOCACHE 0x00000010
+#define PEI_MR_GRAPHICS_MEMORY_8M_CACHE 0x80000010
+#define PEI_MR_GRAPHICS_MEMORY_16M_NOCACHE 0x00000020
+#define PEI_MR_GRAPHICS_MEMORY_16M_CACHE 0x80000020
+#define PEI_MR_GRAPHICS_MEMORY_32M_NOCACHE 0x00000040
+#define PEI_MR_GRAPHICS_MEMORY_32M_CACHE 0x80000040
+#define PEI_MR_GRAPHICS_MEMORY_48M_NOCACHE 0x00000060
+#define PEI_MR_GRAPHICS_MEMORY_48M_CACHE 0x80000060
+#define PEI_MR_GRAPHICS_MEMORY_64M_NOCACHE 0x00000080
+#define PEI_MR_GRAPHICS_MEMORY_64M_CACHE 0x80000080
+#define PEI_MR_GRAPHICS_MEMORY_96M_NOCACHE 0x000000C0
+#define PEI_MR_GRAPHICS_MEMORY_96M_CACHE 0x800000C0
+#define PEI_MR_GRAPHICS_MEMORY_128M_NOCACHE 0x00000100
+#define PEI_MR_GRAPHICS_MEMORY_128M_CACHE 0x80000100
+#define PEI_MR_GRAPHICS_MEMORY_256M_NOCACHE 0x00000200
+#define PEI_MR_GRAPHICS_MEMORY_256M_CACHE 0x80000200
+#define PEI_MR_GRAPHICS_MEMORY_96M_NOCACHE 0x000000C0
+#define PEI_MR_GRAPHICS_MEMORY_96M_CACHE 0x800000C0
+#define PEI_MR_GRAPHICS_MEMORY_160M_NOCACHE 0x00000140
+#define PEI_MR_GRAPHICS_MEMORY_160M_CACHE 0x80000140
+#define PEI_MR_GRAPHICS_MEMORY_192M_NOCACHE 0x00000180
+#define PEI_MR_GRAPHICS_MEMORY_192M_CACHE 0x80000180
+#define PEI_MR_GRAPHICS_MEMORY_224M_NOCACHE 0x000001C0
+#define PEI_MR_GRAPHICS_MEMORY_224M_CACHE 0x800001C0
+#define PEI_MR_GRAPHICS_MEMORY_256M_NOCACHE 0x00000200
+#define PEI_MR_GRAPHICS_MEMORY_256M_CACHE 0x80000200
+#define PEI_MR_GRAPHICS_MEMORY_288M_NOCACHE 0x00000240
+#define PEI_MR_GRAPHICS_MEMORY_288M_CACHE 0x80000240
+#define PEI_MR_GRAPHICS_MEMORY_320M_NOCACHE 0x00000280
+#define PEI_MR_GRAPHICS_MEMORY_320M_CACHE 0x80000280
+#define PEI_MR_GRAPHICS_MEMORY_352M_NOCACHE 0x000002C0
+#define PEI_MR_GRAPHICS_MEMORY_352M_CACHE 0x800002C0
+#define PEI_MR_GRAPHICS_MEMORY_384M_NOCACHE 0x00000300
+#define PEI_MR_GRAPHICS_MEMORY_384M_CACHE 0x80000300
+#define PEI_MR_GRAPHICS_MEMORY_416M_NOCACHE 0x00000340
+#define PEI_MR_GRAPHICS_MEMORY_416M_CACHE 0x80000340
+#define PEI_MR_GRAPHICS_MEMORY_448M_NOCACHE 0x00000380
+#define PEI_MR_GRAPHICS_MEMORY_448M_CACHE 0x80000380
+#define PEI_MR_GRAPHICS_MEMORY_480M_NOCACHE 0x000003C0
+#define PEI_MR_GRAPHICS_MEMORY_480M_CACHE 0x800003C0
+#define PEI_MR_GRAPHICS_MEMORY_512M_NOCACHE 0x00000400
+#define PEI_MR_GRAPHICS_MEMORY_512M_CACHE 0x80000400
+
+//
+// Pci Memory Hole
+//
+#define PEI_MEMORY_RANGE_PCI_MEMORY UINT32
+#define PEI_MR_PCI_MEMORY_SIZE_512M_MASK 0x00000001
+
+
+GUID_VARIABLE_DECLARATION(gAmiPeiMrcDefaultGuid, AMI_PEI_MRC_DEFAULT_GUID);
+GUID_VARIABLE_DECLARATION(gAmiPeiBeforeMrcGuid, AMI_PEI_BEFORE_MRC_GUID);
+GUID_VARIABLE_DECLARATION(gAmiPeiAfterMrcGuid, AMI_PEI_AFTER_MRC_GUID);
+GUID_VARIABLE_DECLARATION(gAmiPeiEndOfMemDetectGuid, AMI_PEI_END_OF_MRC_GUID);
+GUID_VARIABLE_DECLARATION(gSetNBSubIdPpiGuid, AMI_PEI_SET_NB_SUBID_PPI_GUID);
+GUID_VARIABLE_DECLARATION(gAmiPeiNBCpuOnlyResetPpiGuid, \
+ AMI_PEI_NB_CPU_ONLY_RESET_PPI_GUID);
+
+typedef struct _AMI_PEI_NBINIT_POLICY_PPI AMI_PEI_NBINIT_POLICY_PPI;
+
+typedef struct _AMI_PEI_NBINIT_POLICY_PPI {
+ UINTN unFlag;
+} AMI_PEI_NBINIT_POLICY_PPI;
+
+#define AMI_MRC_INFO_HOB_GUID \
+ {0xa6351a87, 0x2965, 0x4718, 0x88, 0xc7, 0x0b, 0x5b, 0x5a, 0xc0, 0xb5, 0xe4}
+
+#define AMI_NB_MRC_INFO_GUID \
+ {0x6737934b, 0xa27e, 0x4c05, 0xad, 0x5b, 0x6a, 0xb8, 0x62, 0x73, 0x68, 0x0b}
+
+//85226559-0def-48d8-a8c9-b746d6a4df01
+#define AMI_MEMORY_ERROR_REPORT_PPI_GUID \
+ { 0x85226559, 0x0def, 0x48d8, 0xa8, 0xc9, 0xb7, 0x46, 0xd6, 0xa4, 0xdf, 0x01 }
+
+// {7D971640-6815-408a-AC4F-BCB7A3BD9336}
+#define AMI_NB_PEG_INFO_GUID \
+ { 0x7d971640, 0x6815, 0x408a, 0xac, 0x4f, 0xbc, 0xb7, 0xa3, 0xbd, 0x93, 0x36 }
+
+// {E1E2A446-0365-4c65-919C-0371C3F9F5FF}
+#define AMI_NB_PEG_GEN3_PRESET_SEARCH_GUID \
+ { 0xe1e2a446, 0x365, 0x4c65, 0x91, 0x9c, 0x03, 0x71, 0xc3, 0xf9, 0xf5, 0xff }
+
+
+#define NB_MRC_INFO_VARIABLE L"NBMrcInfo"
+
+typedef struct _EFI_PEI_SET_NB_SID_PPI EFI_PEI_SET_NB_SID_PPI;
+
+typedef EFI_STATUS (EFIAPI *EFI_PEI_NB_SUBID_SET) (
+ IN EFI_PEI_SERVICES **PeiServices
+);
+
+typedef struct _EFI_PEI_SET_NB_SID_PPI {
+ EFI_PEI_NB_SUBID_SET PeiSetNBSubId;
+} EFI_PEI_SET_NB_SID_PPI;
+
+typedef struct _EFI_PEI_NB_CPU_ONLY_RESET_PPI EFI_PEI_NB_CPU_ONLY_RESET_PPI;
+
+typedef VOID (EFIAPI *EFI_PEI_NB_CPU_ONLY_RESET) (
+ IN EFI_PEI_SERVICES **PeiServices
+);
+
+typedef
+EFI_STATUS
+(EFIAPI *PEI_AMI_MEMORY_ERROR_READ) (
+ IN EFI_PEI_SERVICES **PeiServices, ///< Pointer to PeiServices
+ IN struct _PEI_MEMORY_ERROR_REPORT_PPI *This, ///< Pointer to the PPI structure
+ IN OUT UINT32 MemErrData ///< Memory Error Data Buffer
+);
+
+typedef struct _EFI_PEI_NB_CPU_ONLY_RESET_PPI {
+ EFI_PEI_NB_CPU_ONLY_RESET GenerateCpuOnlyReset;
+} EFI_PEI_NB_CPU_ONLY_RESET_PPI;
+
+typedef enum {
+ FreqAuto = 0,
+ Freq800 = 800,
+ Freq1067 = 1067,
+ Freq1333 = 1333,
+ Freq1600 = 1600,
+ Freq1867 = 1867,
+ Freq2133 = 2133,
+ FreqUnSupport
+} MemFrequency;
+
+
+// Porting Request.
+typedef struct {
+ UINT32 dRegEBP;
+ UINT32 dRegEBX;
+ UINT16 wMmioSSKPD;
+ UINT8 bMmioC0DRT1;
+ UINT8 bMmioC1DRT1;
+ UINT8 bRCVENMT;
+ UINT32 dMmioC0REOST;
+ UINT32 dMmioC1REOST;
+} NB_MRC_INFO;
+
+typedef struct {
+ EFI_HOB_GUID_TYPE Guid;
+ NB_MRC_INFO pMrcInfo;
+} MRC_INFO_HOB;
+
+typedef struct {
+ EFI_HOB_GUID_TYPE Guid;
+ UINT8 tCKminMTBUnits;
+} MRC_DEFAULT_HOB;
+
+#ifndef _PEI_HOB_H_
+#ifndef __HOB__H__
+typedef struct _EFI_HOB_GENERIC_HEADER {
+ UINT16 HobType;
+ UINT16 HobLength;
+ UINT32 Reserved;
+} EFI_HOB_GENERIC_HEADER;
+
+typedef struct _EFI_HOB_GUID_TYPE {
+ EFI_HOB_GENERIC_HEADER Header;
+ EFI_GUID Name;
+} EFI_HOB_GUID_TYPE;
+#endif
+#endif
+
+typedef struct {
+ EFI_HOB_GUID_TYPE Header;
+ UINT8 PegDeOverride[3];
+} NB_PEG_INFO_HOB;
+
+typedef struct _AMI_NB_PCI_SSID_TABLE_STRUCT AMI_NB_PCI_SSID_TABLE_STRUCT;
+
+typedef struct _AMI_NB_PCI_SSID_TABLE_STRUCT {
+ UINT64 PciAddr;
+ UINT32 Sid;
+} AMI_NB_PCI_SSID_TABLE_STRUCT;
+
+typedef struct _AMI_NB_PCH_SKU_DEVICE_ID_TABLE_STRUCT {
+ UINT16 VenderID;
+ UINT16 DeviceID;
+} AMI_NB_PCH_SKU_DEVICE_ID_TABLE_STRUCT;
+
+typedef struct _AMI_PEI_NB_CUSTOM_PPI AMI_PEI_NB_CUSTOM_PPI;
+
+typedef struct _AMI_PEI_NB_CUSTOM_PPI {
+ AMI_NB_PCI_SSID_TABLE_STRUCT *SsidTable;
+} AMI_PEI_NB_CUSTOM_PPI;
+
+typedef struct _PEI_MEMORY_ERROR_REPORT_PPI {
+ PEI_AMI_MEMORY_ERROR_READ AmiMemoryErrorRead;
+} PEI_MEMORY_ERROR_REPORT_PPI;
+
+#endif
+
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
diff --git a/Include/PPI/OHCIPPI.cif b/Include/PPI/OHCIPPI.cif
new file mode 100644
index 0000000..8ef7edb
--- /dev/null
+++ b/Include/PPI/OHCIPPI.cif
@@ -0,0 +1,8 @@
+<component>
+ name = "OHCI PPI"
+ category = ModulePart
+ LocalRoot = "INCLUDE\PPI"
+ RefName = "OHCI PPI"
+[files]
+"\OhciPPI.h"
+<endComponent>
diff --git a/Include/PPI/OhciPPI.h b/Include/PPI/OhciPPI.h
new file mode 100644
index 0000000..73fa912
--- /dev/null
+++ b/Include/PPI/OhciPPI.h
@@ -0,0 +1,67 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2006, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Pkwy, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+//**********************************************************************
+//
+// $Header: /Alaska/SOURCE/Modules/USBRecovery/OhciPPI.h 3 7/10/08 6:36p Michaela $
+//
+// $Revision: 3 $
+//
+// $Date: 7/10/08 6:36p $
+//
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/SOURCE/Modules/USBRecovery/OhciPPI.h $
+//
+// 3 7/10/08 6:36p Michaela
+// Updated to support OHCI controllers
+//
+// 2 9/22/06 12:22p Sivagarn
+// - Included appropriate headers for flies and functions
+// - Updated copyright messages
+//
+//
+//**********************************************************************
+
+//<AMI_FHDR_START>
+//----------------------------------------------------------------------------
+//
+// Name: OhciPpi.h
+//
+// Description: This header file contains the PPI definition for the OHCI
+// host controller PPI
+//
+//----------------------------------------------------------------------------
+//<AMI_FHDR_END>
+
+#ifndef _PEI_OHCIPPI_H_
+#define _PEI_OHCIPPI_H_
+
+
+#endif
+
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2006, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Pkwy, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+//********************************************************************** \ No newline at end of file
diff --git a/Include/PPI/PPI.cif b/Include/PPI/PPI.cif
new file mode 100644
index 0000000..08d2f54
--- /dev/null
+++ b/Include/PPI/PPI.cif
@@ -0,0 +1,30 @@
+<component>
+ name = "PPI"
+ category = ModulePart
+ LocalRoot = "Include\PPI\"
+ RefName = "PPI"
+[files]
+"AmiKeyCodePpi.h"
+"CpuIo.h"
+"PciCfg.h"
+"PciCfg2.h"
+"SmBus.h"
+"SmBus2.h"
+"Stall.h"
+"ProgressCode.h"
+"ReadOnlyVariable.h"
+"ReadOnlyVariable2.h"
+"Reset.h"
+"BootScriptExecuter.h"
+"LoadFile.h"
+"S3Resume.h"
+"S3Resume2.h"
+"SmmControl.h"
+"RecoveryModule.h"
+"LoadedImagePpi.h"
+"Decompress.h"
+"TemporaryRamSupport.h"
+"FirmwareVolumeInfo.h"
+"ReportStatusCodeHandler.h"
+"Capsule.h"
+<endComponent>
diff --git a/Include/PPI/PciCfg.h b/Include/PPI/PciCfg.h
new file mode 100644
index 0000000..088d3fd
--- /dev/null
+++ b/Include/PPI/PciCfg.h
@@ -0,0 +1,111 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/BIN/Core/Include/PPI/PciCfg.h 7 6/16/11 3:18p Felixp $
+//
+// $Revision: 7 $
+//
+// $Date: 6/16/11 3:18p $
+//*****************************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Core/Include/PPI/PciCfg.h $
+//
+// 7 6/16/11 3:18p Felixp
+// Surround backward compatibility definitions with #if
+// BACKWARD_COMPATIBLE_MODE
+//
+// 6 5/27/11 5:52p Felixp
+// Headers are updated to improve separation of the Framework and PI
+// interfaces.
+// The definitions that will be removed in the future versions are marked
+// with the comments.
+//
+// 5 2/05/11 2:09p Artems
+// Added PI 1.0 compatibility definitions
+//
+// 4 3/13/06 1:16a Felixp
+//
+// 3 6/06/05 1:24p Felixp
+//
+// 2 6/03/05 3:44p Felixp
+// Updated to support changes introduced in PEI CIS 0.91
+//
+// 1 1/28/05 12:44p Felixp
+//
+// 1 12/23/04 9:41a Felixp
+//
+// 5 12/18/03 3:08p Robert
+//
+// 4 12/18/03 2:46p Robert
+//
+// 3 12/16/03 4:03p Robert
+//
+// 2 12/15/03 4:21p Robert
+//
+// 1 12/11/03 5:36p Robert
+// Initial Check in of the PCI Cfg PPI
+//
+//*****************************************************************************
+//<AMI_FHDR_START>
+//
+// Name: PciCfg.h
+//
+// Description: This file is an include file used to define the PPI for the
+// PCI CFG PPI. For questions about the specification refer to the PEI CIS
+//
+//<AMI_FHDR_END>
+//*****************************************************************************
+#ifndef _PCI_CFG_PPI_H_
+#define _PCI_CFG_PPI_H_
+#ifdef __cplusplus
+extern "C" {
+#endif
+#include <PEI.h>
+
+#if BACKWARD_COMPATIBLE_MODE
+#include <Ppi/PciCfg2.h>
+#if PI_SPECIFICATION_VERSION >= 0x00010000
+//Compatibility definition
+#define EFI_PEI_PCI_CFG_PPI_INSTALLED_GUID EFI_PEI_PCI_CFG2_PPI_GUID
+#endif
+#endif
+
+//Remove the #ifndef-clause when backward compatibility definitions above are removed.
+#ifndef EFI_PEI_PCI_CFG_PPI_INSTALLED_GUID
+#define EFI_PEI_PCI_CFG_PPI_INSTALLED_GUID \
+ { 0xe1f2eba0, 0xf7b9, 0x4a26, 0x86, 0x20, 0x13, 0x12, 0x21, 0x64, 0x2a, 0x90 }
+#endif
+
+GUID_VARIABLE_DECLARATION(gPeiPciCfgPpiInServiceTableGuid,EFI_PEI_PCI_CFG_PPI_INSTALLED_GUID);
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
diff --git a/Include/PPI/PciCfg2.h b/Include/PPI/PciCfg2.h
new file mode 100644
index 0000000..c527c49
--- /dev/null
+++ b/Include/PPI/PciCfg2.h
@@ -0,0 +1,76 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/BIN/Core/Include/PPI/PciCfg2.h 1 5/27/11 5:50p Felixp $
+//
+// $Revision: 1 $
+//
+// $Date: 5/27/11 5:50p $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Core/Include/PPI/PciCfg2.h $
+//
+// 1 5/27/11 5:50p Felixp
+//
+// 6 1/13/10 2:13p Felixp
+//
+//**********************************************************************
+//<AMI_FHDR_START>
+//
+// Name: PciCfg2.h
+//
+// Description:
+//
+//<AMI_FHDR_END>
+//**********************************************************************
+#ifndef __PCI_CFG2_PPI__H__
+#define __PCI_CFG2_PPI__H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <PEI.h>
+
+#if PI_SPECIFICATION_VERSION<0x00010000
+//Compatibility definition
+//#define EFI_PEI_PCI_CFG2_PPI_GUID EFI_PEI_PCI_CFG_PPI_INSTALLED_GUID
+#define EFI_PEI_PCI_CFG2_PPI_GUID \
+ { 0xe1f2eba0, 0xf7b9, 0x4a26, 0x86, 0x20, 0x13, 0x12, 0x21, 0x64, 0x2a, 0x90 }
+#else
+#define EFI_PEI_PCI_CFG2_PPI_GUID \
+ { 0x57a449a, 0x1fdc, 0x4c06, 0xbf, 0xc9, 0xf5, 0x3f, 0x6a, 0x99, 0xbb, 0x92 }
+#endif
+
+GUID_VARIABLE_DECLARATION(gEfiPciCfg2PpiGuid,EFI_PEI_PCI_CFG2_PPI_GUID);
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
diff --git a/Include/PPI/PeiGetUCtrl.h b/Include/PPI/PeiGetUCtrl.h
new file mode 100644
index 0000000..ce143ab
--- /dev/null
+++ b/Include/PPI/PeiGetUCtrl.h
@@ -0,0 +1,96 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2006, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Pkwy, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+//**********************************************************************
+//
+// $Header: /Alaska/SOURCE/Modules/USBRecovery/PeiGetUCtrl.h 3 7/10/08 6:34p Michaela $
+//
+// $Revision: 3 $
+//
+// $Date: 7/10/08 6:34p $
+//
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/SOURCE/Modules/USBRecovery/PeiGetUCtrl.h $
+//
+// 3 7/10/08 6:34p Michaela
+// Updated to support OHCI controllers
+//
+// 2 9/22/06 12:25p Sivagarn
+// - Included appropriate headers for flies and functions
+// - Updated copyright messages
+//
+//*****************************************************************************
+
+//<AMI_FHDR_START>
+//----------------------------------------------------------------------------
+//
+// Name: PeiGetUCtrl.H
+//
+// Description: This header file contains PPI information for the Get UHCI
+// controller PPI
+//
+//----------------------------------------------------------------------------
+//<AMI_FHDR_END>
+
+#ifndef __PEIGETUCTRL__H__
+#define __PEIGETUCTRL__H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+// {C12DAA49-A061-47fc-955E-EAE34513511D}
+#define EFI_PEI_GET_UHCI_CTRLER_GUID \
+ {0x3bc1f6de, 0x693e, 0x4547, 0xa3, 0x0, 0x21, 0x82, 0x3c, 0xa4, 0x20,\
+ 0xb2}
+
+
+typedef struct _EFI_PEI_USB_CONTROLLER_PPI EFI_PEI_USB_CONTROLLER_PPI;
+
+#define PEI_UHCI_CONTROLLER 0x01
+#define PEI_OHCI_CONTROLLER 0x02
+
+typedef EFI_STATUS (EFIAPI * EFI_PEI_GET_UHCI_CTRLER)(
+ IN EFI_PEI_SERVICES **PeiServices,
+ IN EFI_PEI_USB_CONTROLLER_PPI *This,
+ IN UINT8 UsbControllerId,
+ IN UINTN *ControllerType,
+ IN UINTN *IoBaseAddress
+);
+
+struct _EFI_PEI_USB_CONTROLLER_PPI
+{
+ EFI_PEI_GET_UHCI_CTRLER GetUhciControllerPpi;
+};
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2006, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Pkwy, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+//********************************************************************** \ No newline at end of file
diff --git a/Include/PPI/ProgressCode.h b/Include/PPI/ProgressCode.h
new file mode 100644
index 0000000..f89f747
--- /dev/null
+++ b/Include/PPI/ProgressCode.h
@@ -0,0 +1,90 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2005, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/BIN/Core/Include/PPI/ProgressCode.h 2 3/13/06 1:16a Felixp $
+//
+// $Revision: 2 $
+//
+// $Date: 3/13/06 1:16a $
+//*****************************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Core/Include/PPI/ProgressCode.h $
+//
+// 2 3/13/06 1:16a Felixp
+//
+// 1 1/28/05 12:44p Felixp
+//
+// 2 1/18/05 3:21p Felixp
+// PrintDebugMessage renamed to Trace
+//
+// 1 12/23/04 9:41a Felixp
+//
+// 1 1/15/04 5:18p Robert
+//
+//*****************************************************************************
+//<AMI_FHDR_START>
+//
+// Name:
+//
+// Description: This file contains
+//
+//<AMI_FHDR_END>
+//*****************************************************************************
+#ifndef _PEI_PROGRESS_CODE_PPI_H
+#define _PEI_PROGRESS_CODE_PPI_H
+#ifdef __cplusplus
+extern "C" {
+#endif
+#include <PEI.h>
+
+#define EFI_PEI_REPORT_PROGRESS_CODE_PPI_GUID \
+ {0x229832d3, 0x7a30, 0x4b36, 0xb8, 0x27, 0xf4, 0xc, 0xb7, 0xd4, 0x54, 0x36}
+
+GUID_VARIABLE_DECLARATION(gPeiStatusCodePpiGuid,EFI_PEI_REPORT_PROGRESS_CODE_PPI_GUID);
+
+typedef
+EFI_STATUS (EFIAPI *PEI_REPORT_STATUS_CODE) (
+ IN EFI_PEI_SERVICES **PeiServices,
+ IN EFI_STATUS_CODE_TYPE CodeType,
+ IN EFI_STATUS_CODE_VALUE Value,
+ IN UINT32 Instance,
+ IN EFI_GUID *CallerId OPTIONAL,
+ IN EFI_STATUS_CODE_DATA *Data OPTIONAL
+ );
+
+typedef
+struct _EFI_PEI_PROGRESS_CODE_PPI {
+ PEI_REPORT_STATUS_CODE ReportStatusCode;
+} EFI_PEI_PROGRESS_CODE_PPI;
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2005, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
diff --git a/Include/PPI/ReadOnlyVariable.h b/Include/PPI/ReadOnlyVariable.h
new file mode 100644
index 0000000..465dba4
--- /dev/null
+++ b/Include/PPI/ReadOnlyVariable.h
@@ -0,0 +1,122 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2007, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/BIN/Core/Include/PPI/ReadOnlyVariable.h 7 6/16/11 3:18p Felixp $
+//
+// $Revision: 7 $
+//
+// $Date: 6/16/11 3:18p $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Core/Include/PPI/ReadOnlyVariable.h $
+//
+// 7 6/16/11 3:18p Felixp
+// Surround backward compatibility definitions with #if
+// BACKWARD_COMPATIBLE_MODE
+//
+// 6 5/27/11 5:52p Felixp
+// Headers are updated to improve separation of the Framework and PI
+// interfaces.
+// The definitions that will be removed in the future versions are marked
+// with the comments.
+//
+// 5 8/30/07 11:06p Felixp
+// EFI_PEI_READ_ONLY_VARIABLE2_PPI added
+//
+// 4 3/13/06 1:16a Felixp
+//
+// 3 3/22/05 9:23p Felixp
+//
+// 2 3/04/05 10:26a Mandal
+//
+// 1 1/28/05 12:44p Felixp
+//
+// 2 1/18/05 3:21p Felixp
+// PrintDebugMessage renamed to Trace
+//
+// 1 12/23/04 9:41a Felixp
+//
+// 1 1/22/04 12:47p Felixp
+//
+//**********************************************************************
+//<AMI_FHDR_START>
+//
+// Name: ReadOnlyVariable.h
+//
+// Description: Defines Read Only Variable PPI
+//
+//<AMI_FHDR_END>
+//**********************************************************************
+#ifndef __ReadOnlyVariable__H__
+#define __ReadOnlyVariable__H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+#include <PEI.h>
+
+#define EFI_PEI_READ_ONLY_VARIABLE_PPI_GUID \
+ {0x3cdc90c6, 0x13fb, 0x4a75, 0x9e, 0x79, 0x59, 0xe9, 0xdd, 0x78, 0xb9, 0xfa}
+
+GUID_VARIABLE_DECLARATION(gPeiReadOnlyVariablePpiGuid,EFI_PEI_READ_ONLY_VARIABLE_PPI_GUID);
+
+typedef EFI_STATUS (EFIAPI *EFI_PEI_GET_VARIABLE)
+(
+ IN EFI_PEI_SERVICES **PeiServices,
+ IN CHAR16 *VariableName,
+ IN EFI_GUID *VendorGuid,
+ OUT UINT32 *Attributes OPTIONAL,
+ IN OUT UINTN *DataSize,
+ OUT VOID *Data
+);
+
+typedef EFI_STATUS (EFIAPI *EFI_PEI_GET_NEXT_VARIABLE_NAME)
+(
+ IN EFI_PEI_SERVICES **PeiServices,
+ IN OUT UINTN *VariableNameSize,
+ IN OUT CHAR16 *VariableName,
+ IN OUT EFI_GUID *VendorGuid
+);
+
+//PPI Interface Structure
+typedef struct _EFI_PEI_READ_ONLY_VARIABLE_PPI {
+ EFI_PEI_GET_VARIABLE GetVariable;
+ EFI_PEI_GET_NEXT_VARIABLE_NAME GetNextVariableName;
+} EFI_PEI_READ_ONLY_VARIABLE_PPI;
+//===============================================================================
+#if BACKWARD_COMPATIBLE_MODE
+#include <Ppi/ReadOnlyVariable2.h>
+
+GUID_VARIABLE_DECLARATION(gPeiReadOnlyVariable2PpiGuid,EFI_PEI_READ_ONLY_VARIABLE2_PPI_GUID);
+#endif
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2007, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
diff --git a/Include/PPI/ReadOnlyVariable2.h b/Include/PPI/ReadOnlyVariable2.h
new file mode 100644
index 0000000..2c1397a
--- /dev/null
+++ b/Include/PPI/ReadOnlyVariable2.h
@@ -0,0 +1,101 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/BIN/Core/Include/PPI/ReadOnlyVariable2.h 3 6/16/11 5:30p Felixp $
+//
+// $Revision: 3 $
+//
+// $Date: 6/16/11 5:30p $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Core/Include/PPI/ReadOnlyVariable2.h $
+//
+// 3 6/16/11 5:30p Felixp
+// FORWARD_COMPATIBLE_MODE definitions removed (they are not needed in the
+// Core version of the header).
+//
+// 1 6/16/11 4:56p Felixp
+//
+// 2 5/27/11 6:02p Felixp
+//
+// 1 5/27/11 5:50p Felixp
+//
+// 6 1/13/10 2:13p Felixp
+//
+//**********************************************************************
+//<AMI_FHDR_START>
+//
+// Name: ReadOnlyVariable2.h
+//
+// Description: ReadOnlyVariable2 PPI Definition
+//
+//<AMI_FHDR_END>
+//**********************************************************************
+#ifndef __READ_ONLY_VARIABLE2_PPI__H__
+#define __READ_ONLY_VARIABLE2_PPI__H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+#include <Pei.h>
+
+#define EFI_PEI_READ_ONLY_VARIABLE2_PPI_GUID \
+ { 0x2ab86ef5, 0xecb5, 0x4134, 0xb5, 0x56, 0x38, 0x54, 0xca, 0x1f, 0xe1, 0xb4 }
+
+GUID_VARIABLE_DECLARATION(gEfiPeiReadOnlyVariable2PpiGuid, EFI_PEI_READ_ONLY_VARIABLE2_PPI_GUID);
+
+typedef struct _EFI_PEI_READ_ONLY_VARIABLE2_PPI EFI_PEI_READ_ONLY_VARIABLE2_PPI;
+
+typedef EFI_STATUS (EFIAPI *EFI_PEI_GET_VARIABLE2)
+(
+ IN CONST EFI_PEI_READ_ONLY_VARIABLE2_PPI *This,
+ IN CONST CHAR16 *VariableName,
+ IN CONST EFI_GUID *VariableGuid,
+ OUT UINT32 *Attributes,
+ IN OUT UINTN *DataSize,
+ OUT VOID *Data
+);
+
+typedef EFI_STATUS (EFIAPI *EFI_PEI_GET_NEXT_VARIABLE_NAME2)
+(
+ IN CONST EFI_PEI_READ_ONLY_VARIABLE2_PPI *This,
+ IN OUT UINTN *VariableNameSize,
+ IN OUT CHAR16 *VariableName,
+ IN OUT EFI_GUID *VariableGuid
+);
+
+struct _EFI_PEI_READ_ONLY_VARIABLE2_PPI {
+ EFI_PEI_GET_VARIABLE2 GetVariable;
+ EFI_PEI_GET_NEXT_VARIABLE_NAME2 NextVariableName;
+};
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
diff --git a/Include/PPI/RecoveryModule.h b/Include/PPI/RecoveryModule.h
new file mode 100644
index 0000000..606bc4d
--- /dev/null
+++ b/Include/PPI/RecoveryModule.h
@@ -0,0 +1,76 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2005, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/BIN/Core/Include/PPI/RecoveryModule.h 2 3/13/06 1:16a Felixp $
+//
+// $Revision: 2 $
+//
+// $Date: 3/13/06 1:16a $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Core/Include/PPI/RecoveryModule.h $
+//
+// 2 3/13/06 1:16a Felixp
+//
+// 1 12/01/05 9:48a Felixp
+//
+//**********************************************************************
+//<AMI_FHDR_START>
+//
+// Name: RecoveryModule.h
+//
+// Description:
+//
+//<AMI_FHDR_END>
+//**********************************************************************
+#ifndef __RECOVERY_MODULE__H__
+#define __RECOVERY_MODULE__H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+#include<PEI.h>
+
+#define EFI_PEI_RECOVERY_MODULE_PPI_GUID \
+ {0xFB6D9542, 0x612D, 0x4f45, 0x87, 0x2F, 0x5C, 0xFF, 0x52, 0xE9, 0x3D, 0xCF}
+
+GUID_VARIABLE_DECLARATION(gPeiRecoveryModulePpiGuid,EFI_PEI_RECOVERY_MODULE_PPI_GUID);
+
+typedef EFI_STATUS (EFIAPI *EFI_PEI_LOAD_RECOVERY_CAPSULE)(
+ IN EFI_PEI_SERVICES **PeiServices,
+ IN struct _EFI_PEI_RECOVERY_MODULE_PPI *This
+);
+
+typedef struct _EFI_PEI_RECOVERY_MODULE_PPI {
+ EFI_PEI_LOAD_RECOVERY_CAPSULE LoadRecoveryCapsule;
+} EFI_PEI_RECOVERY_MODULE_PPI;
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2005, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//********************************************************************** \ No newline at end of file
diff --git a/Include/PPI/RecoveryPpi.cif b/Include/PPI/RecoveryPpi.cif
new file mode 100644
index 0000000..359e2e5
--- /dev/null
+++ b/Include/PPI/RecoveryPpi.cif
@@ -0,0 +1,11 @@
+<component>
+ name = "RecoveryPpi"
+ category = ModulePart
+ LocalRoot = "Include\PPI\"
+ RefName = "RecoveryPpi"
+[files]
+"DeviceRecoveryModule.h"
+"DeviceRecoveryBlockIo.h"
+"AtaController.h"
+"SerialDevice.h"
+<endComponent>
diff --git a/Include/PPI/ReportStatusCodeHandler.h b/Include/PPI/ReportStatusCodeHandler.h
new file mode 100644
index 0000000..d5ebd10
--- /dev/null
+++ b/Include/PPI/ReportStatusCodeHandler.h
@@ -0,0 +1,97 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/BIN/Core/Include/PPI/ReportStatusCodeHandler.h 1 6/16/11 9:45a Felixp $
+//
+// $Revision: 1 $
+//
+// $Date: 6/16/11 9:45a $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Core/Include/PPI/ReportStatusCodeHandler.h $
+//
+// 1 6/16/11 9:45a Felixp
+//
+// 6 1/13/10 2:13p Felixp
+//
+//**********************************************************************
+//<AMI_FHDR_START>
+//
+// Name: ReportStatusCodeHandler.h
+//
+// Description: Report Status Code Handler PPI definitions header.
+//
+//<AMI_FHDR_END>
+//**********************************************************************
+#ifndef __REPORT_STATUS_CODE_HANDLER_PPI_H__
+#define __REPORT_STATUS_CODE_HANDLER_PPI_H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define EFI_PEI_RSC_HANDLER_PPI_GUID \
+ { 0x65d394, 0x9951, 0x4144, 0x82, 0xa3, 0xa, 0xfc, 0x85, 0x79, 0xc2, 0x51 }
+
+GUID_VARIABLE_DECLARATION(gEfiPeiRscHandlerPpiGuid, EFI_PEI_RSC_HANDLER_PPI_GUID);
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_PEI_RSC_HANDLER_CALLBACK)(
+ IN CONST EFI_PEI_SERVICES **PeiServices,
+ IN EFI_STATUS_CODE_TYPE Type,
+ IN EFI_STATUS_CODE_VALUE Value,
+ IN UINT32 Instance,
+ IN CONST EFI_GUID *CallerId,
+ IN CONST EFI_STATUS_CODE_DATA *Data
+);
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_PEI_RSC_HANDLER_REGISTER)(
+ IN EFI_PEI_RSC_HANDLER_CALLBACK Callback //A pointer to a function of type EFI_PEI_RSC_HANDLER_CALLBACK that
+ //is called when a call to ReportStatusCode() occurs.
+);
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_PEI_RSC_HANDLER_UNREGISTER)(
+ IN EFI_PEI_RSC_HANDLER_CALLBACK Callback //A pointer to a function of type EFI_PEI_RSC_HANDLER_CALLBACK that
+ // is to be unregistered
+);
+
+typedef struct _EFI_PEI_RSC_HANDLER_PPI {
+ EFI_PEI_RSC_HANDLER_REGISTER Register; //Register the callback for notification of status code messages.
+ EFI_PEI_RSC_HANDLER_UNREGISTER Unregister; //Unregister the callback.
+} EFI_PEI_RSC_HANDLER_PPI;
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif // __REPORT_STATUS_CODE_HANDLER_PPI_H__
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
diff --git a/Include/PPI/Reset.h b/Include/PPI/Reset.h
new file mode 100644
index 0000000..38840e5
--- /dev/null
+++ b/Include/PPI/Reset.h
@@ -0,0 +1,87 @@
+//************************************************************************
+//************************************************************************
+//** **
+//** (C)Copyright 1985-2004, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//************************************************************************
+//************************************************************************
+//************************************************************************
+// $Header: /Alaska/BIN/Core/Include/PPI/Reset.h 2 3/13/06 1:16a Felixp $
+//
+// $Revision: 2 $
+//
+// $Date: 3/13/06 1:16a $
+//*****************************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Core/Include/PPI/Reset.h $
+//
+// 2 3/13/06 1:16a Felixp
+//
+// 1 1/28/05 12:44p Felixp
+//
+// 1 12/23/04 9:41a Felixp
+//
+// 2 2/16/04 11:48a Robert
+//
+// 1 2/13/04 11:15a Robert
+//
+//*****************************************************************************
+//<AMI_FHDR_START>
+//
+// Name: Reset.h
+//
+// Description: This file is used to define the Reset PPI used to reset the
+// system when the PeiServices ResetSystem function is called
+//
+//<AMI_FHDR_END>
+//*****************************************************************************
+#ifndef _RESET_PPI_H_
+#define _RESET_PPI_H_
+#ifdef __cplusplus
+extern "C" {
+#endif
+#include <PEI.h>
+
+#define EFI_PEI_RESET_PPI_GUID \
+ {0xef398d58, 0x9dfd, 0x4103, 0xbf, 0x94, 0x78, 0xc6, 0xf4, 0xfe, 0x71, 0x2f}
+
+GUID_VARIABLE_DECLARATION(gPeiResetPpiGuid, EFI_PEI_RESET_PPI_GUID);
+
+typedef struct _EFI_PEI_RESET_PPI EFI_RESET_PPI;
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_PEI_RESET) (
+ IN EFI_PEI_SERVICES **PeiServices
+ );
+
+
+typedef struct _EFI_PEI_RESET_PPI {
+ EFI_PEI_RESET ResetSystem;
+ } EFI_PEI_RESET_PPI;
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2004, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
diff --git a/Include/PPI/S3Resume.h b/Include/PPI/S3Resume.h
new file mode 100644
index 0000000..5c0ed52
--- /dev/null
+++ b/Include/PPI/S3Resume.h
@@ -0,0 +1,79 @@
+//**********************************************************************//
+//**********************************************************************//
+//** **//
+//** (C)Copyright 1985-2003, American Megatrends, Inc. **//
+//** **//
+//** All Rights Reserved. **//
+//** **//
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **//
+//** **//
+//** Phone: (770)-246-8600 **//
+//** **//
+//**********************************************************************//
+//**********************************************************************//
+
+//**********************************************************************
+// $Header: /Alaska/BIN/Core/Include/PPI/S3Resume.h 3 3/13/06 1:16a Felixp $
+//
+// $Revision: 3 $
+//
+// $Date: 3/13/06 1:16a $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Core/Include/PPI/S3Resume.h $
+//
+// 3 3/13/06 1:16a Felixp
+//
+// 2 3/25/05 4:02p Markw
+//
+//**********************************************************************
+//<AMI_FHDR_START>
+//
+// Name: S3Resume.h
+//
+// Description:
+//
+//<AMI_FHDR_END>
+//**********************************************************************
+#ifndef __S3_RESUME_PPI__H__
+#define __S3_RESUME_PPI__H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+#include <PEI.h>
+
+#define EFI_PEI_S3_RESUME_PPI_GUID \
+ {0x4426CCB2,0xE684,0x4a8a,0xAE,0x40,0x20,0xD4,0xB0,0x25,0xB7,0x10}
+
+GUID_VARIABLE_DECLARATION(gPeiS3ResumePpiGuid,EFI_PEI_S3_RESUME_PPI_GUID);
+
+typedef struct _EFI_PEI_S3_RESUME_PPI EFI_PEI_S3_RESUME_PPI;
+
+typedef EFI_STATUS (EFIAPI *EFI_PEI_S3_RESUME_PPI_RESTORE_CONFIG) (
+ IN EFI_PEI_SERVICES **PeiServices
+);
+
+struct _EFI_PEI_S3_RESUME_PPI {
+ EFI_PEI_S3_RESUME_PPI_RESTORE_CONFIG S3RestoreConfig;
+};
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+
+//**********************************************************************//
+//**********************************************************************//
+//** **//
+//** (C)Copyright 1985-2003, American Megatrends, Inc. **//
+//** **//
+//** All Rights Reserved. **//
+//** **//
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **//
+//** **//
+//** Phone: (770)-246-8600 **//
+//** **//
+//**********************************************************************//
+//**********************************************************************//
diff --git a/Include/PPI/S3Resume2.h b/Include/PPI/S3Resume2.h
new file mode 100644
index 0000000..6fa6d55
--- /dev/null
+++ b/Include/PPI/S3Resume2.h
@@ -0,0 +1,78 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/BIN/Core/Include/PPI/S3Resume2.h 1 5/27/11 5:50p Felixp $
+//
+// $Revision: 1 $
+//
+// $Date: 5/27/11 5:50p $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Core/Include/PPI/S3Resume2.h $
+//
+// 1 5/27/11 5:50p Felixp
+//
+// 6 1/13/10 2:13p Felixp
+//
+//**********************************************************************
+//<AMI_FHDR_START>
+//
+// Name: S3Resume2.h
+//
+// Description: S3Resume2 PPI definition
+//
+//<AMI_FHDR_END>
+//**********************************************************************
+#ifndef __S3_RESUME2_PPI__H__
+#define __S3_RESUME2_PPI__H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+#include <PEI.h>
+
+#define EFI_PEI_S3_RESUME2_PPI_GUID \
+ { 0x6D582DBC, 0xDB85, 0x4514, 0x8F, 0xCC, 0x5A, 0xDF, 0x62, 0x27, 0xB1, 0x47 }
+
+GUID_VARIABLE_DECLARATION(gEfiPeiS3Resume2PpiGuid,EFI_PEI_S3_RESUME2_PPI_GUID);
+
+typedef struct _EFI_PEI_S3_RESUME2_PPI EFI_PEI_S3_RESUME2_PPI;
+
+typedef EFI_STATUS (EFIAPI *EFI_PEI_S3_RESUME_PPI_RESTORE_CONFIG2)(
+ IN EFI_PEI_S3_RESUME2_PPI *This
+);
+
+struct _EFI_PEI_S3_RESUME2_PPI {
+ EFI_PEI_S3_RESUME_PPI_RESTORE_CONFIG2 S3RestoreConfig2;
+};
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
diff --git a/Include/PPI/SBPPI.h b/Include/PPI/SBPPI.h
new file mode 100644
index 0000000..faccd3b
--- /dev/null
+++ b/Include/PPI/SBPPI.h
@@ -0,0 +1,142 @@
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
+
+//*************************************************************************
+// $Header: /Alaska/BIN/Chipset/Intel/SouthBridge/LynxPoint/Intel Pch SB Chipset/SB PPI/SBPPI.h 3 4/24/13 2:16a Scottyang $
+//
+// $Revision: 3 $
+//
+// $Date: 4/24/13 2:16a $
+//*************************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Chipset/Intel/SouthBridge/LynxPoint/Intel Pch SB Chipset/SB PPI/SBPPI.h $
+//
+// 3 4/24/13 2:16a Scottyang
+// [TAG] None
+// [Category] Improvement
+// [Description] Porting GPI interrupt by LPT-LP EDS 1.5.
+// [Files] SB.sdl, SB.H, SBPPI.h, SBPEI.c
+//
+// 2 7/27/12 6:14a Victortu
+// [TAG] None
+// [Category] Improvement
+// [Description] Update to support ULT Platform.
+// [Files] SB.H, SB.mak, SB.sdl, SB.sd, SBSetup.c,
+// AcpiModeEnable.c, SBDxe.c, SBPEI.c, SBSMI.c, SleepSmi.c,
+// SmiHandlerPorting.c, SmiHandlerPorting2.c, SBPPI.h, Pch.sdl
+//
+// 1 2/08/12 8:25a Yurenlai
+// Intel Lynx Point/SB eChipset initially releases.
+//
+//*************************************************************************
+//<AMI_FHDR_START>
+//
+// Name: SBPPI.h
+//
+// Description: This header file contains the PPI definition for the SB.
+//
+//<AMI_FHDR_END>
+//*************************************************************************
+
+#ifndef FILE_PEI_SBINIT_POLICY_PPI_H_
+#define FILE_PEI_SBINIT_POLICY_PPI_H_
+
+// {95E8152B-1B98-4f11-8A77-DB26583EBC42}
+#define AMI_PEI_SBINIT_POLICY_PPI_GUID \
+ {0x95e8152b, 0x1b98, 0x4f11, 0x8a, 0x77, 0xdb, 0x26, 0x58, 0x3e, 0xbc, 0x42}
+
+#define AMI_PEI_SB_OEM_PLATFORM_POLICY_OVERRIDE_PPI_GUID \
+ {0x61187967, 0x9a77, 0x419d, 0xaa, 0xea, 0x64, 0xdd, 0x56, 0x19, 0x08, 0x15}
+
+// {38965BB5-8097-40f5-B742-8CC14A649B64}
+#define AMI_PEI_SB_CUSTOM_PPI_GUID \
+ {0x38965bb5, 0x8097, 0x40f5, 0xb7, 0x42, 0x8c, 0xc1, 0x4a, 0x64, 0x9b, 0x64}
+GUID_VARIABLE_DECLARATION(gAmiPeiSBCustomPpiGuid, AMI_PEI_SB_CUSTOM_PPI_GUID);
+
+typedef struct _AMI_PEI_SBINIT_POLICY_PPI AMI_PEI_SBINIT_POLICY_PPI;
+
+typedef struct _AMI_PEI_SBINIT_POLICY_PPI {
+ UINTN unFlag;
+} AMI_PEI_SBINIT_POLICY_PPI;
+
+typedef struct _AMI_SB_PCI_SSID_TABLE_STRUCT AMI_SB_PCI_SSID_TABLE_STRUCT;
+
+typedef struct _AMI_SB_PCI_DEVICES_TABLE_STRUCT {
+ UINT64 PciAddr;
+ UINT8 PciSidReg;
+} AMI_SB_PCI_DEVICES_TABLE_STRUCT;
+
+typedef struct _AMI_SB_PCI_SSID_TABLE_STRUCT {
+ UINT64 PciAddr;
+ UINT32 Sid;
+} AMI_SB_PCI_SSID_TABLE_STRUCT;
+
+typedef struct _AMI_GPIO_INIT_TABLE_STRUCT AMI_GPIO_INIT_TABLE_STRUCT;
+
+typedef union _AMI_GPIO_STRUCT
+{
+ UINT16 Dword;
+ struct
+ {
+ UINT16 USE:1;
+ UINT16 IO :1;
+ UINT16 LVL:1;
+ UINT16 INV:1;
+ UINT16 BLK:1;
+ UINT16 RST:1;
+ UINT16 OWN:1;
+ UINT16 LEB:1;
+ UINT16 DIS:1;
+ UINT16 WP :2;
+ UINT16 INT:1;
+ UINT16 RESERVED:4;
+ } Fileds;
+} AMI_GPIO_STRUCT;
+
+typedef struct _AMI_GPIO_INIT_TABLE_STRUCT {
+ UINT16 GpioNo;
+ AMI_GPIO_STRUCT GpioCfg;
+} AMI_GPIO_INIT_TABLE_STRUCT;
+
+typedef struct _AMI_GPIO_INIT_PPI AMI_GPIO_INIT_PPI;
+
+typedef struct _AMI_GPIO_INIT_PPI {
+ UINT32 GpioBaseAddr;
+ AMI_GPIO_INIT_TABLE_STRUCT *GpioTable;
+ BOOLEAN InitDefaultGpioSetting;
+} AMI_GPIO_INIT_PPI;
+
+typedef struct _AMI_PEI_SB_CUSTOM_PPI AMI_PEI_SB_CUSTOM_PPI;
+
+typedef struct _AMI_PEI_SB_CUSTOM_PPI {
+ AMI_GPIO_INIT_PPI *GpioInit;
+ AMI_SB_PCI_SSID_TABLE_STRUCT *SsidTable;
+} AMI_PEI_SB_CUSTOM_PPI;
+
+#endif
+
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
diff --git a/Include/PPI/SerialDevice.h b/Include/PPI/SerialDevice.h
new file mode 100644
index 0000000..dc42755
--- /dev/null
+++ b/Include/PPI/SerialDevice.h
@@ -0,0 +1,110 @@
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2009, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
+// $Header: /Alaska/BIN/Core/Modules/Recovery/SerialDevice.h 2 2/13/12 4:14a Rajeshms $
+//
+// $Revision: 2 $
+//
+// $Date: 2/13/12 4:14a $
+//*****************************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Core/Modules/Recovery/SerialDevice.h $
+//
+// 2 2/13/12 4:14a Rajeshms
+// [TAG] EIP80704
+// [Category] New Feature
+// [Description] Serial Recovery support through PCI Serial Port .
+// [Files] PciSerialRecovery.mak, PciSerialRecovery.sdl,
+// PciSerialRecovery.c, PciSerialRecovery.h, PciSerialRecovery.chm,
+// PciSerialRecovery.dxs, SerialRecovery.c, SerialDevice.h
+//
+// 1 7/10/09 10:40a Rameshr
+// Initial Check-in
+// -Recovery from Multiple Serial Device support Added
+//
+//
+//*****************************************************************************
+//<AMI_FHDR_START>
+//----------------------------------------------------------------------------
+//
+// Name: SerialDevice.h
+//
+// Description: Protocol Header for the Serial Recovery Device.
+//
+//----------------------------------------------------------------------------
+//<AMI_FHDR_END>
+
+#ifndef _PEI_SERIAL_DEVICE_PPI_H
+#define _PEI_SERIAL_DEVICE_PPI_H
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "EFI.h"
+#include "PEI.h"
+
+#define PEI_RECOVERY_SERIAL_MODE_PPI_GUID \
+ { 0x5e7063d3, 0xc12, 0x475b, 0x98, 0x35, 0x14, 0xab, 0xb1, 0xcb, 0xe, 0xe9 }
+
+
+enum {
+ SerialDataReg,
+ InteruptEnableReg,
+ FifoControlReg,
+ LineControlReg,
+ ModemControlReg,
+ LineStatusReg,
+ ModemStatusReg
+};
+
+typedef struct _PEI_RECOVERY_SERIAL_MODE_PPI PEI_RECOVERY_SERIAL_MODE_PPI;
+
+typedef UINT8 (EFIAPI *SERIAL_READ) (
+ IN PEI_RECOVERY_SERIAL_MODE_PPI *This,
+ IN UINT8 Offset
+);
+
+typedef VOID (EFIAPI *SERIAL_WRITE) (
+ IN PEI_RECOVERY_SERIAL_MODE_PPI *This,
+ IN UINT8 Offset,
+ IN UINT8 Data
+);
+
+#pragma pack(1)
+struct _PEI_RECOVERY_SERIAL_MODE_PPI {
+ UINT64 SerialDeviceBaseAddress;
+ SERIAL_READ ReadSerialDevice;
+ SERIAL_WRITE WriteSerialDevice;
+};
+#pragma pack()
+
+#ifdef __cplusplus
+}
+#endif
+#endif
+
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2009, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
+
diff --git a/Include/PPI/SmBus.h b/Include/PPI/SmBus.h
new file mode 100644
index 0000000..3ef2363
--- /dev/null
+++ b/Include/PPI/SmBus.h
@@ -0,0 +1,167 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2009, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+//**********************************************************************
+// $Header: /Alaska/BIN/Core/Include/PPI/SmBus.h 7 6/16/11 3:18p Felixp $
+//
+// $Revision: 7 $
+//
+// $Date: 6/16/11 3:18p $
+//*****************************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Core/Include/PPI/SmBus.h $
+//
+// 7 6/16/11 3:18p Felixp
+// Surround backward compatibility definitions with #if
+// BACKWARD_COMPATIBLE_MODE
+//
+// 6 5/27/11 5:52p Felixp
+// Headers are updated to improve separation of the Framework and PI
+// interfaces.
+// The definitions that will be removed in the future versions are marked
+// with the comments.
+//
+// 5 1/16/09 9:49a Felixp
+// SM Bus Protocol and PPI headers are updated. Common code moved into
+// newly created header file (Include\SmBus.h).
+//
+// 4 9/04/07 12:31p Felixp
+// Added EFI_PEI_SMBUS2_PPI GUID and structures as defined in Platform
+// Initialization Specification version 1.0.
+//
+// 2 6/23/05 10:51a Robert
+// Updated to reflect the new public spec from Intel
+//
+// 1 12/12/03 11:03a Robert
+// Initial checkin of the SmBus PPI and the PPI subcomponent
+//
+//*****************************************************************************
+//<AMI_FHDR_START>
+//
+// Name: SmBus.h.c
+//
+// Description: This file contains SmBus PPI definitions
+//
+//<AMI_FHDR_END>
+//*****************************************************************************
+#ifndef _SM_BUS_PPI_H
+#define _SM_BUS_PPI_H
+#ifdef __cplusplus
+extern "C" {
+#endif
+#include <PEI.h>
+#include <SmBus.h>
+
+//----------------------------------------------------------------------------
+// Definition for EFI_PEI_SMBUS_PPI
+//----------------------------------------------------------------------------
+#define EFI_PEI_SMBUS_PPI_GUID \
+ {0xabd42895, 0x78cf, 0x4872, 0x84, 0x44, 0x1b, 0x5c, 0x18, 0xb, 0xfb, 0xda}
+
+GUID_VARIABLE_DECLARATION(gPeiSmbusPpiGuid,EFI_PEI_SMBUS_PPI_GUID);
+
+typedef struct _EFI_PEI_SMBUS_PPI EFI_PEI_SMBUS_PPI;
+
+
+//*******************************************************
+// EFI_SMBUS_NOTIFY_FUNCTION
+//*******************************************************
+typedef
+EFI_STATUS
+(EFIAPI *EFI_PEI_SMBUS_NOTIFY_FUNCTION) (
+ IN EFI_PEI_SERVICES **PeiServices,
+ IN EFI_PEI_SMBUS_PPI *This,
+ IN EFI_SMBUS_DEVICE_ADDRESS SlaveAddress,
+ IN UINTN Data
+);
+//*******************************************************
+// EFI_PEI_SMBUS_PPI_EXECUTE_OPERATION
+//*******************************************************
+typedef EFI_STATUS (EFIAPI *EFI_PEI_SMBUS_PPI_EXECUTE_OPERATION) (
+ IN EFI_PEI_SERVICES **PeiServices,
+ IN EFI_PEI_SMBUS_PPI *This,
+ IN EFI_SMBUS_DEVICE_ADDRESS SlaveAddress,
+ IN EFI_SMBUS_DEVICE_COMMAND Command,
+ IN EFI_SMBUS_OPERATION Operation,
+ IN BOOLEAN PecCheck,
+ IN OUT UINTN *Length,
+ IN OUT VOID *Buffer
+ );
+//*******************************************************
+// EFI_PEI_SMBUS_PPI_ARP_DEVICE
+//*******************************************************
+typedef EFI_STATUS (EFIAPI *EFI_PEI_SMBUS_PPI_ARP_DEVICE) (
+ IN EFI_PEI_SERVICES **PeiServices,
+ IN EFI_PEI_SMBUS_PPI *This,
+ IN BOOLEAN ArpAll,
+ IN EFI_SMBUS_UDID *SmbusUdid, OPTIONAL
+ IN OUT EFI_SMBUS_DEVICE_ADDRESS *SlaveAddress OPTIONAL
+ );
+//*******************************************************
+// EFI_PEI_SMBUS_PPI_GET_ARP_MAP
+//*******************************************************
+typedef EFI_STATUS (EFIAPI *EFI_PEI_SMBUS_PPI_GET_ARP_MAP) (
+ IN EFI_PEI_SERVICES **PeiServices,
+ IN EFI_PEI_SMBUS_PPI *This,
+ IN OUT UINTN *Length,
+ IN OUT EFI_SMBUS_DEVICE_MAP **SmbusDeviceMap
+ );
+//*******************************************************
+// EFI_PEI_SMBUS_PPI_NOTIFY
+//*******************************************************
+typedef EFI_STATUS (EFIAPI *EFI_PEI_SMBUS_PPI_NOTIFY) (
+ IN EFI_PEI_SERVICES **PeiServices,
+ IN EFI_PEI_SMBUS_PPI *This,
+ IN EFI_SMBUS_DEVICE_ADDRESS SlaveAddress,
+ IN UINTN Data,
+ IN EFI_PEI_SMBUS_NOTIFY_FUNCTION NotifyFunction
+ );
+//*******************************************************
+// EFI_PEI_SMBUS_PPI
+//*******************************************************
+typedef struct _EFI_PEI_SMBUS_PPI {
+ EFI_PEI_SMBUS_PPI_EXECUTE_OPERATION Execute;
+ EFI_PEI_SMBUS_PPI_ARP_DEVICE ArpDevice;
+ EFI_PEI_SMBUS_PPI_GET_ARP_MAP GetArpMap;
+ EFI_PEI_SMBUS_PPI_NOTIFY Notify;
+} EFI_PEI_SMBUS_PPI;
+//----------------------------------------------------------------------------
+
+//----------------------------------------------------------------------------
+// Definition for EFI_PEI_SMBUS2_PPI
+//----------------------------------------------------------------------------
+#if BACKWARD_COMPATIBLE_MODE
+#include <Ppi/SmBus2.h>
+#pragma warning ( disable : 4090 4028)
+GUID_VARIABLE_DECLARATION(gPeiSmbus2PpiGuid,EFI_PEI_SMBUS2_PPI_GUID);
+#endif
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2009, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
diff --git a/Include/PPI/SmBus2.h b/Include/PPI/SmBus2.h
new file mode 100644
index 0000000..c458fc5
--- /dev/null
+++ b/Include/PPI/SmBus2.h
@@ -0,0 +1,137 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/BIN/Core/Include/PPI/SmBus2.h 1 5/27/11 5:50p Felixp $
+//
+// $Revision: 1 $
+//
+// $Date: 5/27/11 5:50p $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Core/Include/PPI/SmBus2.h $
+//
+// 1 5/27/11 5:50p Felixp
+//
+// 6 1/13/10 2:13p Felixp
+//
+//**********************************************************************
+//<AMI_FHDR_START>
+//
+// Name: SmBus2.h
+//
+// Description: SmBus2 PPI definition
+//
+//<AMI_FHDR_END>
+//**********************************************************************
+#ifndef __SMBUS2_PPI__H__
+#define __SMBUS2_PPI__H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <PEI.h>
+#include <SmBus.h>
+
+#define EFI_PEI_SMBUS2_PPI_GUID \
+ {0x9ca93627, 0xb65b, 0x4324, 0xa2, 0x2, 0xc0, 0xb4, 0x61, 0x76, 0x45, 0x43}
+
+GUID_VARIABLE_DECLARATION(gEfiPeiSmbus2PpiGuid, EFI_PEI_SMBUS2_PPI_GUID);
+
+typedef struct _EFI_PEI_SMBUS2_PPI EFI_PEI_SMBUS2_PPI;
+
+//*******************************************************
+// EFI_PEI_SMBUS2_PPI_EXECUTE_OPERATION
+//*******************************************************
+typedef EFI_STATUS (EFIAPI *EFI_PEI_SMBUS2_PPI_EXECUTE_OPERATION) (
+ IN CONST EFI_PEI_SMBUS2_PPI *This,
+ IN EFI_SMBUS_DEVICE_ADDRESS SlaveAddress,
+ IN EFI_SMBUS_DEVICE_COMMAND Command,
+ IN EFI_SMBUS_OPERATION Operation,
+ IN BOOLEAN PecCheck,
+ IN OUT UINTN *Length,
+ IN OUT VOID *Buffer
+ );
+
+
+//*******************************************************
+// EFI_PEI_SMBUS2_PPI_ARP_DEVICE
+//*******************************************************
+typedef EFI_STATUS (EFIAPI *EFI_PEI_SMBUS2_PPI_ARP_DEVICE) (
+ IN CONST EFI_PEI_SMBUS2_PPI *This,
+ IN BOOLEAN ArpAll,
+ IN EFI_SMBUS_UDID *SmbusUdid, OPTIONAL
+ IN OUT EFI_SMBUS_DEVICE_ADDRESS *SlaveAddress OPTIONAL
+ );
+
+//*******************************************************
+// EFI_PEI_SMBUS2_PPI_GET_ARP_MAP
+//*******************************************************
+typedef EFI_STATUS (EFIAPI *EFI_PEI_SMBUS2_PPI_GET_ARP_MAP) (
+ IN CONST EFI_PEI_SMBUS2_PPI *This,
+ IN OUT UINTN *Length,
+ IN OUT EFI_SMBUS_DEVICE_MAP **SmbusDeviceMap
+ );
+
+//*******************************************************
+// EFI_SMBUS_NOTIFY2_FUNCTION
+//*******************************************************
+typedef
+EFI_STATUS
+(EFIAPI *EFI_PEI_SMBUS_NOTIFY2_FUNCTION) (
+ IN CONST EFI_PEI_SMBUS2_PPI *This,
+ IN EFI_SMBUS_DEVICE_ADDRESS SlaveAddress,
+ IN UINTN Data
+);
+
+//*******************************************************
+// EFI_PEI_SMBUS_PPI_NOTIFY
+//*******************************************************
+typedef EFI_STATUS (EFIAPI *EFI_PEI_SMBUS2_PPI_NOTIFY) (
+ IN EFI_PEI_SMBUS2_PPI *This,
+ IN EFI_SMBUS_DEVICE_ADDRESS SlaveAddress,
+ IN UINTN Data,
+ IN EFI_PEI_SMBUS_NOTIFY2_FUNCTION NotifyFunction
+ );
+
+//*******************************************************
+// EFI_PEI_SMBUS2_PPI
+//*******************************************************
+typedef struct _EFI_PEI_SMBUS2_PPI {
+ EFI_PEI_SMBUS2_PPI_EXECUTE_OPERATION Execute;
+ EFI_PEI_SMBUS2_PPI_ARP_DEVICE ArpDevice;
+ EFI_PEI_SMBUS2_PPI_GET_ARP_MAP GetArpMap;
+ EFI_PEI_SMBUS2_PPI_NOTIFY Notify;
+ EFI_GUID Identifier;
+} EFI_PEI_SMBUS2_PPI;
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
diff --git a/Include/PPI/SmmControl.h b/Include/PPI/SmmControl.h
new file mode 100644
index 0000000..0f94d9a
--- /dev/null
+++ b/Include/PPI/SmmControl.h
@@ -0,0 +1,92 @@
+//**********************************************************************//
+//**********************************************************************//
+//** **//
+//** (C)Copyright 1985-2005, American Megatrends, Inc. **//
+//** **//
+//** All Rights Reserved. **//
+//** **//
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **//
+//** **//
+//** Phone: (770)-246-8600 **//
+//** **//
+//**********************************************************************//
+//**********************************************************************//
+
+//**********************************************************************
+// $Header: /Alaska/BIN/Core/Include/PPI/SmmControl.h 2 3/13/06 1:16a Felixp $
+//
+// $Revision: 2 $
+//
+// $Date: 3/13/06 1:16a $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Core/Include/PPI/SmmControl.h $
+//
+// 2 3/13/06 1:16a Felixp
+//
+// 1 6/21/05 7:12p Markw
+//
+//**********************************************************************
+//<AMI_FHDR_START>
+//
+// Name: SmmControl.h
+//
+// Description:
+//
+//<AMI_FHDR_END>
+//**********************************************************************
+#ifndef _SMM_CONTROL_PPI_H__
+#define _SMM_CONTROL_PPI_H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+#include <PEI.h>
+
+#define PEI_SMM_CONTROL_PPI_GUID \
+ {0x61c68702,0x4d7e,0x4f43,0x8d,0xef,0xa7,0x43,0x5,0xce,0x74,0xc5}
+
+GUID_VARIABLE_DECLARATION(gPeiSmmControlPpiGuid,PEI_SMM_CONTROL_PPI_GUID);
+
+typedef struct _PEI_SMM_CONTROL_PPI PEI_SMM_CONTROL_PPI;
+
+typedef EFI_STATUS (EFIAPI *PEI_SMM_ACTIVATE) (
+ IN EFI_PEI_SERVICES **PeiServices,
+ IN PEI_SMM_CONTROL_PPI *This,
+ IN OUT INT8 *ArgumentBuffer OPTIONAL,
+ IN OUT UINTN *ArgumentBufferSize OPTIONAL,
+ IN BOOLEAN Periodic OPTIONAL,
+ IN UINTN ActivationInterval OPTIONAL
+);
+
+typedef EFI_STATUS (EFIAPI *PEI_SMM_DEACTIVATE) (
+ IN EFI_PEI_SERVICES **PeiServices,
+ IN PEI_SMM_CONTROL_PPI *This,
+ IN BOOLEAN Periodic OPTIONAL
+);
+
+typedef struct _PEI_SMM_CONTROL_PPI {
+ PEI_SMM_ACTIVATE Trigger;
+ PEI_SMM_DEACTIVATE Clear;
+};
+
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+
+//**********************************************************************//
+//**********************************************************************//
+//** **//
+//** (C)Copyright 1985-2005, American Megatrends, Inc. **//
+//** **//
+//** All Rights Reserved. **//
+//** **//
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **//
+//** **//
+//** Phone: (770)-246-8600 **//
+//** **//
+//**********************************************************************//
+//**********************************************************************//
diff --git a/Include/PPI/Stall.h b/Include/PPI/Stall.h
new file mode 100644
index 0000000..ffc78d1
--- /dev/null
+++ b/Include/PPI/Stall.h
@@ -0,0 +1,91 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2004, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+//**********************************************************************
+// $Header: /Alaska/BIN/Core/Include/PPI/Stall.h 2 3/13/06 1:16a Felixp $
+//
+// $Revision: 2 $
+//
+// $Date: 3/13/06 1:16a $
+//*****************************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Core/Include/PPI/Stall.h $
+//
+// 2 3/13/06 1:16a Felixp
+//
+// 1 1/28/05 12:44p Felixp
+//
+// 1 12/23/04 9:41a Felixp
+//
+// 2 2/12/04 5:07p Robert
+//
+// 1 1/06/04 2:53p Robert
+//
+//*****************************************************************************
+//<AMI_FHDR_START>
+//
+// Name: Stall.h
+//
+// Description: This file is an include file used to define the PPI for the
+// Stall PPI. For questions about the specification refer to the PEI CIS
+//
+//<AMI_FHDR_END>
+//*****************************************************************************
+#ifndef _STALL_PPI_H_
+#define _STALL_PPI_H_
+#ifdef __cplusplus
+extern "C" {
+#endif
+#include <PEI.h>
+
+#define EFI_PEI_STALL_PPI_GUID \
+{ 0x1f4c6f90, 0xb06b, 0x48d8, 0xa2, 0x01, 0xba, 0xe5, 0xf1, 0xcd, 0x7d, 0x56 }
+
+GUID_VARIABLE_DECLARATION(gPeiStallPpiGuid,EFI_PEI_STALL_PPI_GUID);
+
+typedef struct _EFI_PEI_STALL_PPI EFI_PEI_STALL_PPI;
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_PEI_STALL) (
+ IN EFI_PEI_SERVICES **PeiServices,
+ IN struct _EFI_PEI_STALL_PPI *This,
+ IN UINTN Microseconds
+ );
+
+
+typedef
+struct _EFI_PEI_STALL_PPI {
+ UINTN Resolution;
+ EFI_PEI_STALL Stall;
+ } EFI_PEI_STALL_PPI;
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2004, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
diff --git a/Include/PPI/TemporaryRamSupport.h b/Include/PPI/TemporaryRamSupport.h
new file mode 100644
index 0000000..1506134
--- /dev/null
+++ b/Include/PPI/TemporaryRamSupport.h
@@ -0,0 +1,89 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/BIN/Core/Include/PPI/TemporaryRamSupport.h 3 3/25/11 12:50p Felixp $
+//
+// $Revision: 3 $
+//
+// $Date: 3/25/11 12:50p $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Core/Include/PPI/TemporaryRamSupport.h $
+//
+// 3 3/25/11 12:50p Felixp
+// Identifiers are renamed based on PI errata (EFI_PEI_ prefix is added.)
+//
+// 2 3/09/11 5:42p Artems
+// Modified to comply with AMI coding standard
+//
+//**********************************************************************
+
+//<AMI_FHDR_START>
+//---------------------------------------------------------------------------
+//
+// Name: TemporaryRamSupport.h
+//
+// Description: In SEC-to-PEI Handoff phase, this copies memory content
+// from temporary RAM to permanent RAM.
+//
+//---------------------------------------------------------------------------
+//<AMI_FHDR_END>
+
+#ifndef __TEMPORARY_RAM_SUPPORT_H__
+#define __TEMPORARY_RAM_SUPPORT_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+// {DBE23AA9-A345-4B97-85B6-B226F1617389}
+#define EFI_PEI_TEMPORARY_RAM_SUPPORT_PPI_GUID \
+ { 0xdbe23aa9, 0xa345, 0x4b97, 0x85, 0xb6, 0xb2, 0x26, 0xf1, 0x61, 0x73, 0x89 }
+
+GUID_VARIABLE_DECLARATION(gEfiTemporaryRamSupportPpiGuid, EFI_PEI_TEMPORARY_RAM_SUPPORT_PPI_GUID);
+
+typedef EFI_STATUS (EFIAPI *TEMPORARY_RAM_MIGRATION)
+(
+ IN CONST EFI_PEI_SERVICES **PeiServices,
+ IN EFI_PHYSICAL_ADDRESS TemporaryMemoryBase,
+ IN EFI_PHYSICAL_ADDRESS PermanentMemoryBase,
+ IN UINTN CopySize
+);
+
+typedef struct
+{
+ TEMPORARY_RAM_MIGRATION TemporaryRamMigration;
+} EFI_PEI_TEMPORARY_RAM_SUPPORT_PPI;
+
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
diff --git a/Include/PPI/UhciPPI.CIF b/Include/PPI/UhciPPI.CIF
new file mode 100644
index 0000000..9dbdef2
--- /dev/null
+++ b/Include/PPI/UhciPPI.CIF
@@ -0,0 +1,8 @@
+<component>
+ name = "UHCI PPI"
+ category = ModulePart
+ LocalRoot = "INCLUDE\PPI"
+ RefName = "UHCI PPI"
+[files]
+"\PeiGetUCtrl.h"
+<endComponent>
diff --git a/Include/PPI/UsbHCPpi.cif b/Include/PPI/UsbHCPpi.cif
new file mode 100644
index 0000000..a3efdb4
--- /dev/null
+++ b/Include/PPI/UsbHCPpi.cif
@@ -0,0 +1,8 @@
+<component>
+ name = "UsbHCPpi"
+ category = ModulePart
+ LocalRoot = "Include\Ppi"
+ RefName = "UsbHCPpi"
+[files]
+"UsbHostController.h"
+<endComponent>
diff --git a/Include/PPI/UsbHostController.h b/Include/PPI/UsbHostController.h
new file mode 100644
index 0000000..e8fdb0a
--- /dev/null
+++ b/Include/PPI/UsbHostController.h
@@ -0,0 +1,236 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2006, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Pkwy, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+//**********************************************************************
+//
+// $Header: /Alaska/SOURCE/Modules/USBRecovery/UhcPeimSrc/UsbHostController.h 8 1/18/11 1:04a Ryanchou $
+//
+// $Revision: 8 $
+//
+// $Date: 1/18/11 1:04a $
+//
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/SOURCE/Modules/USBRecovery/UhcPeimSrc/UsbHostController.h $
+//
+// 8 1/18/11 1:04a Ryanchou
+// [TAG] EIP47931
+// [Category] Improvement
+// [Description] Added USB 3.0 hub support.
+// [Files] EhciPei.c, EhciPei.h, HubPeim.c, HubPeim.h, OhciPei.c,
+// OhciPei.h, UhcPeim.c, UhcPeim.h, usb.h, UsbHostController.h,
+// UsbIoPeim.c, UsbPeim.c, UsbPeim.h, XhciPei.c, XhciPei.h
+//
+// 7 10/22/10 2:56a Rameshr
+// [TAG]- EIP 43687
+// [Category]-IMPROVEMENT
+// [Description]- Build warning from UsbRecovery driver -
+// UsbHostController.obj : warning LNK4221: no public symbols found;
+// archive member will be inaccessible.
+// [Files]- uhcpeim.c, usbpeim.c, UsbHostcontroller.h
+//
+// 6 10/12/10 11:19a Olegi
+// XHCI support added.
+//
+// 5 4/26/10 4:17p Krishnakumarg
+// DebugRx causes the system to hang in Recovery mode EIP#34401
+//
+// 4 3/17/09 5:08p Olegi
+// Added TransactionTranslator for slow/full speed devices behind USB2
+// hub.
+//
+// 3 3/03/09 7:27p Olegi
+// MaximumPacketLength changed from UINT8 to UINT16.
+//
+// 2 7/10/08 6:37p Michaela
+// Updated to support OHCI controllers
+//
+// 1 9/22/06 12:21p Sivagarn
+//
+//*****************************************************************************
+
+//<AMI_FHDR_START>
+//----------------------------------------------------------------------------
+//
+// Name: UsbHostController.h
+//
+// Description: This file belongs to "Framework".
+// This file is modified by AMI to include copyright message,
+// appropriate header and integration code.
+//
+//----------------------------------------------------------------------------
+//<AMI_FHDR_END>
+
+//
+// This file contains 'Framework Code' and is licensed as such
+// under the terms of your license agreement with Intel or your
+// vendor. This file may not be modified, except as allowed by
+// additional terms of your license agreement.
+//
+
+/*++
+
+ Copyright (c) 1999 - 2002 Intel Corporation. All rights reserved
+ This software and associated documentation (if any) is furnished
+ under a license and may only be used or copied in accordance
+ with the terms of the license. Except as permitted by such
+ license, no part of this software or documentation may be
+ reproduced, stored in a retrieval system, or transmitted in any
+ form or by any means without the express written consent of
+ Intel Corporation.
+
+
+ Module Name:
+
+ UsbHostController.h
+
+ Abstract:
+
+ Usb Host Controller PPI as defined in EFI 2.0
+
+ This code abstracts the PEI core to provide Usb Host Contrller
+ access services.
+
+ --*/
+
+#ifndef _PEI_USB_HOST_CONTROLLER_PPI_H_
+#define _PEI_USB_HOST_CONTROLLER_PPI_H_
+
+#include "core\em\usbrecovery\usb.h"
+
+#define PEI_USB_HOST_CONTROLLER_PPI_GUID {\
+ 0x652b38a9, 0x77f4, 0x453f, 0x89, 0xd5, 0xe7, \
+ 0xbd, 0xc3, 0x52, 0xfc, 0x53}
+
+GUID_VARIABLE_DECLARATION(gPeiUsbHostControllerPpiGuid,PEI_USB_HOST_CONTROLLER_PPI_GUID);
+EFI_FORWARD_DECLARATION( PEI_USB_HOST_CONTROLLER_PPI );
+
+typedef
+EFI_STATUS
+(EFIAPI * PEI_USB_HOST_CONTROLLER_CONTROL_TRANSFER)(
+ IN EFI_PEI_SERVICES **PeiServices,
+ IN PEI_USB_HOST_CONTROLLER_PPI *This,
+ IN UINT8 DeviceAddress,
+ IN UINT8 DeviceSpeed,
+ IN UINT8 MaximumPacketLength,
+ IN UINT16 TransactionTranslator,
+ IN EFI_USB_DEVICE_REQUEST *Request,
+ IN EFI_USB_DATA_DIRECTION TransferDirection,
+ IN OUT VOID *Data OPTIONAL,
+ IN OUT UINTN *DataLength OPTIONAL,
+ IN UINTN TimeOut,
+ OUT UINT32 *TransferResult
+);
+
+typedef
+EFI_STATUS
+(EFIAPI * PEI_USB_HOST_CONTROLLER_BULK_TRANSFER)(
+ IN EFI_PEI_SERVICES **PeiServices,
+ IN PEI_USB_HOST_CONTROLLER_PPI *This,
+ IN UINT8 DeviceAddress,
+ IN UINT8 EndPointAddress,
+ IN UINT8 DeviceSpeed,
+ IN UINT16 MaximumPacketLength,
+ IN UINT16 TransactionTranslator,
+ IN OUT VOID *Data,
+ IN OUT UINTN *DataLength,
+ IN OUT UINT8 *DataToggle,
+ IN UINTN TimeOut,
+ OUT UINT32 *TransferResult
+);
+
+typedef
+EFI_STATUS
+(EFIAPI * PEI_USB_HOST_CONTROLLER_GET_ROOTHUB_PORT_NUMBER)(
+ IN EFI_PEI_SERVICES **PeiServices,
+ IN PEI_USB_HOST_CONTROLLER_PPI *This,
+ OUT UINT8 *PortNumber
+);
+
+typedef
+EFI_STATUS
+(EFIAPI * PEI_USB_HOST_CONTROLLER_GET_ROOTHUB_PORT_STATUS)(
+ IN EFI_PEI_SERVICES **PeiServices,
+ IN PEI_USB_HOST_CONTROLLER_PPI *This,
+ IN UINT8 PortNumber,
+ OUT EFI_USB_PORT_STATUS *PortStatus
+);
+
+typedef
+EFI_STATUS
+(EFIAPI * PEI_USB_HOST_CONTROLLER_SET_ROOTHUB_PORT_FEATURE)(
+ IN EFI_PEI_SERVICES **PeiServices,
+ IN PEI_USB_HOST_CONTROLLER_PPI *This,
+ IN UINT8 PortNumber,
+ IN EFI_USB_PORT_FEATURE PortFeature
+);
+
+typedef
+EFI_STATUS
+(EFIAPI * PEI_USB_HOST_CONTROLLER_CLEAR_ROOTHUB_PORT_FEATURE)(
+ IN EFI_PEI_SERVICES **PeiServices,
+ IN PEI_USB_HOST_CONTROLLER_PPI *This,
+ IN UINT8 PortNumber,
+ IN EFI_USB_PORT_FEATURE PortFeature
+);
+
+typedef
+EFI_STATUS
+(EFIAPI * PEI_USB_HOST_CONTROLLER_PRECONFIGURE_DEVICE) (
+ IN EFI_PEI_SERVICES **PeiServices,
+ IN PEI_USB_HOST_CONTROLLER_PPI *This,
+ IN UINT8 PortNumber,
+ IN UINT8 Speed,
+ IN UINT16 TransactionTranslator
+);
+
+typedef
+EFI_STATUS
+(EFIAPI * PEI_USB_HOST_CONTROLLER_ENABLE_ENDPOINTS) (
+ IN EFI_PEI_SERVICES **PeiServices,
+ IN PEI_USB_HOST_CONTROLLER_PPI *This,
+ IN UINT8 *ConfigurationData
+);
+
+typedef struct _PEI_USB_HOST_CONTROLLER_PPI
+{
+ PEI_USB_HOST_CONTROLLER_CONTROL_TRANSFER ControlTransfer;
+ PEI_USB_HOST_CONTROLLER_BULK_TRANSFER BulkTransfer;
+ PEI_USB_HOST_CONTROLLER_GET_ROOTHUB_PORT_NUMBER GetRootHubPortNumber;
+ PEI_USB_HOST_CONTROLLER_GET_ROOTHUB_PORT_STATUS GetRootHubPortStatus;
+ PEI_USB_HOST_CONTROLLER_SET_ROOTHUB_PORT_FEATURE SetRootHubPortFeature;
+ PEI_USB_HOST_CONTROLLER_CLEAR_ROOTHUB_PORT_FEATURE
+ ClearRootHubPortFeature;
+ BOOLEAN DebugPortUsed;
+ PEI_USB_HOST_CONTROLLER_PRECONFIGURE_DEVICE PreConfigureDevice;
+ PEI_USB_HOST_CONTROLLER_ENABLE_ENDPOINTS EnableEndpoints;
+} PEI_USB_HOST_CONTROLLER_PPI;
+
+
+#endif
+
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2006, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Pkwy, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+//********************************************************************** \ No newline at end of file
diff --git a/Include/PPI/UsbIo.h b/Include/PPI/UsbIo.h
new file mode 100644
index 0000000..99f7713
--- /dev/null
+++ b/Include/PPI/UsbIo.h
@@ -0,0 +1,165 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2006, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Pkwy, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+//**********************************************************************
+//
+// $Header: /Alaska/SOURCE/Modules/USBRecovery/UsbPeimSrc/UsbIo.h 2 7/10/08 6:37p Michaela $
+//
+// $Revision: 2 $
+//
+// $Date: 7/10/08 6:37p $
+//
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/SOURCE/Modules/USBRecovery/UsbPeimSrc/UsbIo.h $
+//
+// 2 7/10/08 6:37p Michaela
+// Updated to support OHCI controllers
+//
+// 1 9/22/06 12:19p Sivagarn
+// - Initial Check-in
+// - Included Recovery code in Source
+//
+//*****************************************************************************
+
+//<AMI_FHDR_START>
+//----------------------------------------------------------------------------
+//
+// Name: UsbIo.h
+//
+// Description: This file belongs to "Framework".
+// This file is modified by AMI to include copyright message,
+// appropriate header and integration code.
+//
+//----------------------------------------------------------------------------
+//<AMI_FHDR_END>
+
+//
+// This file contains 'Framework Code' and is licensed as such
+// under the terms of your license agreement with Intel or your
+// vendor. This file may not be modified, except as allowed by
+// additional terms of your license agreement.
+//
+
+/*++
+
+ Copyright (c) 1999 - 2002 Intel Corporation. All rights reserved
+ This software and associated documentation (if any) is furnished
+ under a license and may only be used or copied in accordance
+ with the terms of the license. Except as permitted by such
+ license, no part of this software or documentation may be
+ reproduced, stored in a retrieval system, or transmitted in any
+ form or by any means without the express written consent of
+ Intel Corporation.
+
+
+ Module Name:
+
+ UsbIo.h
+
+ Abstract:
+
+ Usb access PPI as defined in EFI 2.0
+
+ This code abstracts the PEI core to provide Usb access services.
+
+ --*/
+
+#ifndef _PEI_USB_IO_PPI_H_
+#define _PEI_USB_IO_PPI_H_
+
+#include "core\em\usbrecovery\usb.h"
+
+#define PEI_USB_IO_PPI_GUID \
+ {\
+ 0x7c29785c, 0x66b9, 0x49fc, 0xb7, 0x97, 0x1c, 0xa5, 0x55, 0xe, 0xf2,\
+ 0x83 \
+ }
+
+EFI_FORWARD_DECLARATION( PEI_USB_IO_PPI );
+
+typedef
+EFI_STATUS
+(EFIAPI * PEI_USB_CONTROL_TRANSFER)(
+ IN EFI_PEI_SERVICES **PeiServices,
+ IN PEI_USB_IO_PPI *This,
+ IN EFI_USB_DEVICE_REQUEST *Request,
+ IN EFI_USB_DATA_DIRECTION Direction,
+ IN UINT32 Timeout,
+ IN OUT VOID *Data OPTIONAL,
+ IN UINTN DataLength OPTIONAL
+);
+
+typedef
+EFI_STATUS
+(EFIAPI * PEI_USB_BULK_TRANSFER)(
+ IN EFI_PEI_SERVICES **PeiServices,
+ IN PEI_USB_IO_PPI *This,
+ IN UINT8 DeviceEndpoint,
+ IN OUT VOID *Data,
+ IN OUT UINTN *DataLength,
+ IN UINTN Timeout
+);
+
+typedef
+EFI_STATUS
+(EFIAPI * PEI_USB_GET_INTERFACE_DESCRIPTOR)(
+ IN EFI_PEI_SERVICES **PeiServices,
+ IN PEI_USB_IO_PPI *This,
+ IN EFI_USB_INTERFACE_DESCRIPTOR **InterfaceDescriptor
+);
+
+typedef
+EFI_STATUS
+(EFIAPI * PEI_USB_GET_ENDPOINT_DESCRIPTOR)(
+ IN EFI_PEI_SERVICES **PeiServices,
+ IN PEI_USB_IO_PPI *This,
+ IN UINT8 EndpointIndex,
+ IN EFI_USB_ENDPOINT_DESCRIPTOR **EndpointDescriptor
+);
+
+typedef
+EFI_STATUS
+(EFIAPI * PEI_USB_PORT_RESET)(
+ IN EFI_PEI_SERVICES **PeiServices,
+ IN PEI_USB_IO_PPI *This
+);
+
+typedef struct _PEI_USB_IO_PPI
+{
+ PEI_USB_CONTROL_TRANSFER UsbControlTransfer;
+ PEI_USB_BULK_TRANSFER UsbBulkTransfer;
+ PEI_USB_GET_INTERFACE_DESCRIPTOR UsbGetInterfaceDescriptor;
+ PEI_USB_GET_ENDPOINT_DESCRIPTOR UsbGetEndpointDescriptor;
+ PEI_USB_PORT_RESET UsbPortReset;
+} PEI_USB_IO_PPI;
+
+extern EFI_GUID gPeiUsbIoPpiGuid;
+
+#endif
+
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2006, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Pkwy, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+//********************************************************************** \ No newline at end of file
diff --git a/Include/PPI/UsbIoPpi.cif b/Include/PPI/UsbIoPpi.cif
new file mode 100644
index 0000000..9927341
--- /dev/null
+++ b/Include/PPI/UsbIoPpi.cif
@@ -0,0 +1,8 @@
+<component>
+ name = "UsbIoPpi"
+ category = ModulePart
+ LocalRoot = "Include\Ppi\"
+ RefName = "UsbIoPpi"
+[files]
+"UsbIo.h"
+<endComponent>
diff --git a/Include/PPI/sbPPI.CIF b/Include/PPI/sbPPI.CIF
new file mode 100644
index 0000000..c8b1f24
--- /dev/null
+++ b/Include/PPI/sbPPI.CIF
@@ -0,0 +1,8 @@
+<component>
+ name = "SB PPI"
+ category = ModulePart
+ LocalRoot = "INCLUDE\PPI"
+ RefName = "SB PPI"
+[files]
+"\SBPPI.h"
+<endComponent>
diff --git a/Include/PciBus.h b/Include/PciBus.h
new file mode 100644
index 0000000..31d95ed
--- /dev/null
+++ b/Include/PciBus.h
@@ -0,0 +1,1251 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2005, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/BIN/Core/Modules/PciBus/PciBus.h 18 4/19/11 2:31p Yakovlevs $
+//
+// $Revision: 18 $
+//
+// $Date: 4/19/11 2:31p $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Core/Modules/PciBus/PciBus.h $
+//
+// 18 4/19/11 2:31p Yakovlevs
+//
+// 17 4/19/11 10:58a Yakovlevs
+// [TAG] EIP 57664
+// [Category] New Feature
+// [Description] Aptio PI 1.2; UEFI 2.3.1 Support Extended PCI bus
+// driver functionality
+// [Files] DevicePath.h; LoadFile2.h; PciBus.h; PciBus.c.
+//
+// 16 4/05/11 10:55a Yakovlevs
+// [TAG] EIP38174
+// [Category] New Feature
+// [Description] Added generic support to handle PCI OUT OF RESOURDCES.
+// [Files] PciBus.c; PciHostBridge.c; PciBus.h; PciHostBridge.c;
+// PciPort.c
+//
+// 15 8/16/10 1:13p Yakovlevs
+//
+// 14 3/01/10 5:59p Yakovlevs
+// Pci Express V2.1 Support Added.
+//
+// 13 9/22/09 6:06p Yakovlevs
+//
+// 12 4/28/09 3:53p Yakovlevs
+// Changes related to AmiBoardInfo protocol and Multiplatform support.
+//
+// 11 3/25/09 10:54a Yakovlevs
+// PCI_BRG_CNT_REG definition and APPLICATION added
+//
+// 10 1/30/09 12:52p Yakovlevs
+// Added MaxPayload field to the PCIE_DEV info structure EIP 17947
+//
+// 9 10/01/08 1:08a Felixp
+//
+// 8 10/01/08 12:25a Felixp
+//
+// 7 9/25/08 11:31a Yakovlevs
+// Changes in data structure to support new features.
+//
+// 6 4/29/08 6:52p Yakovlevs
+//
+// 5 12/10/07 4:23p Yakovlevs
+// Added field in PCI_BRG_EXT structure to support PciBus.c recent
+// changes.
+//
+// 4 12/10/07 4:21p Yakovlevs
+// Added field in PCI_BRG_EXT structure to support PciBus.c recent
+// changes.
+//
+// 3 10/16/07 4:58p Davidd
+//
+// 4 10/15/07 4:14p Yakovlevs
+// Added ResGran field into BRG_ALIGN_INFO structure.
+//
+// 3 8/31/07 11:17a Yakovlevs
+// Changes in Data Structures to accomodate improuvements in PCI Resource
+// Allocation Algorithm.
+//
+// 1 5/25/07 1:50p Yakovlevs
+//
+// 2 5/02/07 4:42p Yakovlevs
+//
+// 1 3/12/07 12:08p Yakovlevs
+//
+// 16 10/13/06 4:23p Yakovlevs
+// Support for IDE specisl Attributes added
+//
+// 15 9/20/06 7:23p Yakovlevs
+// Code cleanup. Structure headers Added!
+//
+// 14 9/19/06 7:08p Yakovlevs
+// Some code clen up
+//
+// 13 8/09/06 5:10p Yakovlevs
+// PCI Express VC initialization support
+//
+// 12 4/03/06 5:04p Felixp
+// Headers updated in accordance with new PCI and Super I/O infrastructure
+//
+// 11 3/13/06 1:15a Felixp
+//
+//**********************************************************************
+
+//<AMI_FHDR_START>
+//---------------------------------------------------------------------------
+// Name: PciBus.h
+//
+// Description: This header file contains Data Type Definitions for
+// the PCI Bus Driver Private Data
+//
+// Tabsize: 4
+//---------------------------------------------------------------------------
+//<AMI_FHDR_END>
+
+#ifndef _PCI_BUS_DRIVER_
+#define _PCI_BUS_DRIVER_
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+//---------------------------------------------------------------------------
+// Include Files
+//---------------------------------------------------------------------------
+#include <Efi.h>
+#include <Pci.h>
+#include <PciE.h>
+#include <PciE21.h>
+#include <PciE30.h>
+#include <PciX.h>
+#include <AcpiRes.h>
+#include <Protocol\PciIo.h>
+#include <Protocol\BusSpecificDriverOverride.h>
+#include <Protocol\DevicePath.h>
+#include <Protocol\PciHostBridgeResourceAllocation.h>
+#include <Protocol\PciHotplugInit.h>
+#include <Protocol\PciPlatform.h>
+#include <Protocol\AmiBoardInfo.h>
+#include <Protocol\IncompatiblePciDeviceSupport.h>
+#if ((defined EFI_SPECIFICATION_VERSION) && (EFI_SPECIFICATION_VERSION >= 0x2001F))
+#include <Protocol\LoadFile2.h>
+#endif
+#include <Token.h>
+
+#pragma pack(push, 1)
+/////////////////////////////////////////////////////////////////////////////
+//---------------------------------------------------------------------------
+// Constants Definitions
+//---------------------------------------------------------------------------
+//To exclude PCI Bus Messages
+#ifndef TRACE_PCI
+#define TRACE_PCI TRACE_ALWAYS
+#endif
+#if PCI_BUS_DEBUG_MESSAGES
+#define PCI_TRACE(Arguments) TRACE(Arguments)
+#else
+#define PCI_TRACE(Arguments)
+#endif
+
+
+#define PCI_ASSEMBLE_ADDR(b,d,f,r) \
+ ((UINT64) ( (((UINTN)b) << 24) + (((UINTN)d) << 16) + (((UINTN)f) << 8) + ((UINTN)r) ))
+
+//I will need to store some more information for device cpabilities
+//the standard PCI IO Attributes has bits from 1 to 0x40000 defined
+//the attributes is 64 bit value ...
+#define MY_PCI_IO_ATTRIBUTE_MEM_WR_INVALIDATE 0x8000000000000000
+
+// I/O cycles 0x3C6, 0x3C8, 0x3C9 (10 bit decode)
+// MEM cycles 0xA0000-0xBFFFF (24 bit decode)
+//I/O cycles 0x3B0-0x3BB and 0x3C0-0x3DF (10 bit decode)
+#define PCI_VGA_ATTRIBUTES (EFI_PCI_IO_ATTRIBUTE_VGA_PALETTE_IO | \
+ EFI_PCI_IO_ATTRIBUTE_VGA_MEMORY | \
+ EFI_PCI_IO_ATTRIBUTE_VGA_IO )
+
+
+//Defining Attributes MASK which could be set based on Platform code
+#define PCI_ALLOWED_ATTRIBUTES (EFI_PCI_IO_ATTRIBUTE_EMBEDDED_DEVICE | EFI_PCI_IO_ATTRIBUTE_EMBEDDED_ROM)
+
+//Only this attributes make sence for the BAR
+#define BAR_ATTR (EFI_PCI_IO_ATTRIBUTE_MEMORY_CACHED | EFI_PCI_IO_ATTRIBUTE_MEMORY_WRITE_COMBINE)
+
+//PciBus Driver Signature UINT64
+#define AMI_PCI_SIG 0x24494350494d4124 //'$AMIPCI$'
+
+
+/////////////////////////////////////////////////////////////////////////////
+//---------------------------------------------------------------------------
+//Forward Declaration
+//---------------------------------------------------------------------------
+typedef struct _PCI_DEV_INFO PCI_DEV_INFO;
+typedef struct _PCI_HOST_INFO PCI_HOST_INFO;
+
+/////////////////////////////////////////////////////////////////////////////
+//---------------------------------------------------------------------------
+//PCI Bus Driver Types Definitios
+//---------------------------------------------------------------------------
+
+//<AMI_SHDR_START>
+//----------------------------------------------------------------------------
+// Name: PCI_INCOMPATIBILITY_TYPE
+//
+// Description: ENUM used to specify PCI Device Incompatibility Type for Device that
+// doesn't comply with defined in PCI Spec enumeration algorithm.
+//
+// Fields:
+// Name Type Description
+// ------------------------------------------------------------------
+// icNone ENUM Device is Compatible with PCI Spec
+// icBarBad ENUM Device doesn't set all implemented bits as "1" after writing there all "1"s. Setting icBadBar will notify PCI bus Driver that it could be a sizing problems with this BAR and it should treat this BAR differently.
+// icBarFixedSize ENUM Device could hang the system if all "1s" will be written in corresponded BAR register. Setting icBarFixedSize will notify PCI bus Driver to use Value provided in Incompatible Devices table intead of querying the Device.
+// icNotBar ENUM Device has a read/write register implemented but this register must not be enumerated. So the PCI Bus Driver will not consider this BAR as valid and will skip it.
+// icBad64BitBar ENUM Device has a bar that is 64bit capable, but the card does not function properly when it is allocated with an address above 4G.
+// icMaxIncompatibility ENUM Last valid value of this ENUM
+//----------------------------------------------------------------------------
+//<AMI_SHDR_END>
+typedef enum {
+ icNone,
+ icBarBad,
+ icBarFixedSize,
+ icNotBar,
+ icBad64BitBar,
+ icMaxIncompatibility
+} PCI_INCOMPATIBILITY_TYPE;
+
+
+//<AMI_SHDR_START>
+//----------------------------------------------------------------------------
+// Name: PCI_SPACE_TYPE
+//
+// Description: This ENUM value definitions used to identify PCI Device's different Space types.
+//
+// Fields:
+// Name Type Description
+// ------------------------------------------------------------------
+// stMemSpace ENUM Memory Space
+// stIoSpace ENUM I/O Space
+// stMemIoSpace ENUM Memory and I/O Space
+// stOptRomSpace ENUM PCI Option ROM Space
+// stDisableAll ENUM Disable all possinble decoding
+// stMaxType ENUM Last valid value of this ENUM
+//----------------------------------------------------------------------------
+//<AMI_SHDR_END>
+typedef enum {
+ stMemSpace,
+ stIoSpace,
+ stMemIoSpace,
+ stOptRomSpace,
+ stDisableAll,
+ stMaxType
+} PCI_SPACE_TYPE;
+
+
+//<AMI_SHDR_START>
+//----------------------------------------------------------------------------
+// Name: MRES_TYPE
+//
+// Description: This ENUM value definitions used to identify PCI Device different Resource types.
+//
+// Fields:
+// Name Type Description
+// ------------------------------------------------------------------
+// rtBus ENUM Bus resources
+// rtIo16 ENUM I/O 16bit Resources
+// rtIo32 ENUM I/O 32bit Resources
+// rtMmio32 ENUM MMIO 32bit Resources
+// rtMmio32p ENUM Prefetchable MMIO 32bit
+// rtMmio64 ENUM MMIO 64bit Resources
+// rtMmio64p ENUM Prefetchable MMIO 64bit
+// rtMaxRes ENUM Last valid value of this ENUM
+//----------------------------------------------------------------------------
+//<AMI_SHDR_END>
+typedef enum {
+ rtBus=0,
+ rtIo16, //1
+ rtIo32, //2
+ rtMmio32, //3
+ rtMmio32p, //4
+ rtMmio64, //5
+ rtMmio64p, //6
+ rtMaxRes
+} MRES_TYPE;
+
+
+//<AMI_SHDR_START>
+//----------------------------------------------------------------------------
+// Name: RES_CONV_TYPE
+//
+// Description: This ENUM used to identify PCI Device Resource Conversion Type
+//
+// Notes: Standard P2P bridge supports 16 or 32 bit IO(rcOneOf) only 32
+// bit MMIO(rcNarrow) and One Of PF MMIO either 64 or 32 bit (rcOneOf).
+//
+// Fields:
+// Name Type Description
+// ------------------------------------------------------------------
+// rcNone ENUM Device doesn't supports any width of IO, MMIO, or PF MMIO.
+// rcOneOf ENUM If Device has any "wide" addressing resources it must considered as "narrow" if any "narrow" resources also present. (I.e. if Device has Mmio64pf and Mmio32pf on the same bridge - consider Mmio64pf resources as Mmio32pf. However if Device doesn't have any 32bit resources but only 64bit, 64bit resources for the bridge will be considered).
+// rcNarrow ENUM Device doesn't supports "wide" resources. So if Device has any Io32 or Mmio64, it must be addressed as Io16 and Mmio32 resources correspondently.
+// rcBoth ENUM Device has facilities to support both type of resources "wide" and "narrow" at the same time (i.e. Io16 is supported as well as Io32).
+//----------------------------------------------------------------------------
+//<AMI_SHDR_END>
+typedef enum {
+ rcNone=0,
+ rcOneOf,
+ rcNarrow,
+ rcBoth
+} RES_CONV_TYPE;
+
+//<AMI_SHDR_START>
+//----------------------------------------------------------------------------
+// Name: PCI_CFG_ADDR
+//
+// Description: UNION of UINT64 and a Structure used to access
+// and store PCI Device Address.
+//
+// Fields:
+// Name Type Description
+// ------------------------------------------------------------------
+// ADDR UINT64 All Fields together as a single value
+// Addr EFI_PCI_CONFIGURATION_ADDRESS PCI Device Address Structure
+//----------------------------------------------------------------------------
+//<AMI_SHDR_END>
+typedef union _PCI_CFG_ADDR {
+ UINT64 ADDR;
+ EFI_PCI_CONFIGURATION_ADDRESS Addr;
+} PCI_CFG_ADDR;
+
+//<AMI_SHDR_START>
+//----------------------------------------------------------------------------
+// Name: MBRG_RES_DSC
+//
+// Description: Structure used to access and store PCI Device Resource Requirements
+// in a form of QWORD ACPI Resource Descriptor.
+//
+// Notes: See ACPI Specification 3.0 for details on ACPI Resource Descriptors.
+// See definition of MRES_TYPE for definitions of rtMaxRes.
+//
+// Fields:
+// Name Type Description
+// ------------------------------------------------------------------
+// Res ASLR_QWORD_ASD An "rtMaxRes" array of all possible Resources
+// EndDsc ASLR_EndTag Array terminator
+//----------------------------------------------------------------------------
+//<AMI_SHDR_END>
+typedef struct _MBRG_RES_DSC {
+ ASLR_QWORD_ASD Res[rtMaxRes];
+ ASLR_EndTag EndDsc;
+} MBRG_RES_DSC;
+
+
+//<AMI_SHDR_START>
+//----------------------------------------------------------------------------
+// Name: PCI_CMD_REG
+//
+// Description: UNION of UINT16 and a Structure used to access and store PCI
+// COMMAND REGISTER values.
+//
+// Fields:
+// Name Type Description
+// ------------------------------------------------------------------
+// CMD_REG UINT16 Content of entire PCI COMMAND Register.
+// struct UINT16 Bit field definition of COMMAND register bits.
+//----------------------------------------------------------------------------
+//<AMI_SHDR_END>
+typedef union _PCI_CMD_REG {
+ UINT16 CMD_REG;
+ struct {
+ UINT16 IoSpace : 1; //bit 0
+ UINT16 MemSpace : 1; //bit 1
+ UINT16 BusMaster : 1; //bit 2
+ UINT16 SpecialCycles : 1; //bit 3
+ UINT16 MemWrAndInv : 1; //bit 4
+ UINT16 VgaPaletteSnoop : 1; //bit 5
+ UINT16 ParityErrorResp : 1; //bit 6
+ UINT16 Resrved1 : 1; //bit 7
+ UINT16 SerrEnable : 1; //bit 8
+ UINT16 FastBack2Back : 1; //bit 9
+ UINT16 IntDisable : 1; //bit 8
+ };
+} PCI_CMD_REG;
+
+//<AMI_SHDR_START>
+//----------------------------------------------------------------------------
+// Name: PCI_BRG_CNT_REG
+//
+// Description: UNION of UINT16 and a Structure used to access and store PCI
+// COMMAND REGISTER values.
+//
+// Fields:
+// Name Type Description
+// ------------------------------------------------------------------
+// CMD_REG UINT16 Content of entire PCI COMMAND Register.
+// struct UINT16 Bit field definition of COMMAND register bits.
+//----------------------------------------------------------------------------
+//<AMI_SHDR_END>
+typedef union _PCI_BRG_CNT_REG {
+ UINT16 BRG_CNT_REG;
+ struct {
+ UINT16 PerrEnable : 1; //bit 0
+ UINT16 SerrEnable : 1; //bit 1
+ UINT16 IsaEnable : 1; //bit 2
+ UINT16 VgaEnable : 1; //bit 3
+ UINT16 Vga16Enable : 1; //bit 4
+ UINT16 MasterAbort : 1; //bit 5
+ UINT16 SecBusReset : 1; //bit 6
+ UINT16 SecFastBack2Back: 1; //bit 7
+ UINT16 PriDiscardTmr : 1; //bit 8
+ UINT16 SecDiscardTmr : 1; //bit 9
+ UINT16 DiscardTmrSts : 1; //bit 10
+ UINT16 DiscardTmrSerr : 1; //bit 11
+// UINT16 Reserved : 4; //bit 12...15
+ };
+} PCI_BRG_CNT_REG;
+
+
+//<AMI_SHDR_START>
+//----------------------------------------------------------------------------
+// Name: PCI_STA_REG
+//
+// Description: UNION of UINT16 and a Structure used to access and store PCI
+// COMMAND REGISTER values.
+//
+// Fields:
+// Name Type Description
+// ------------------------------------------------------------------
+// STA_REG UINT16 Content of entire PCI STATUS Register.
+// struct UINT16 Bit field definition of STATUS register bits.
+//----------------------------------------------------------------------------
+//<AMI_SHDR_END>
+typedef union _PCI_STA_REG {
+ UINT16 STA_REG;
+ struct {
+ UINT16 Resrved1 : 3; //bit 0..2
+ UINT16 IntStatus : 1; //bit 3
+ UINT16 CapList : 1; //bit 4
+ UINT16 Cap66Mhz : 1; //bit 5
+ UINT16 Resrved2 : 1; //bit 6
+ UINT16 FastBack2Back : 1; //bit 7
+ UINT16 MasterDataPERR : 1; //bit 8
+ UINT16 DevSellTiming : 2; //bit 9..10
+ UINT16 TrgAbortSignaled: 1; //bit 11
+ UINT16 TrgAbortReceived: 1; //bit 12
+ UINT16 MstAbortReceived: 1; //bit 13
+ UINT16 SystErrSignaled : 1; //bit 14
+ UINT16 DetectedPERR : 1; //bit 15
+ };
+} PCI_STA_REG;
+
+
+
+//<AMI_SHDR_START>
+//----------------------------------------------------------------------------
+// Name: PCI_DEV_ID
+//
+// Description: UNION of UINT32 and a Structure used to access and store PCI
+// Device VendorId and DeviceId values.
+//
+// Fields:
+// Name Type Description
+// ------------------------------------------------------------------
+// DEV_VEN_ID UINT32 VendorId and DeviceId all together.
+// VenId UINT16 VendorId value.
+// DevId UINT16 DeviceId value.
+//----------------------------------------------------------------------------
+//<AMI_SHDR_END>
+typedef union _PCI_DEV_ID {
+ UINT32 DEV_VEN_ID;
+ struct {
+ UINT16 VenId;
+ UINT16 DevId;
+ };
+} PCI_DEV_ID;
+
+//<AMI_SHDR_START>
+//----------------------------------------------------------------------------
+// Name: PCI_DEV_CLASS
+//
+// Description: UNION of UINT32 and a Structure used to access and store PCI
+// Device BaseClass, SubClass, ProgrammingInterface and RevisionId values.
+//
+// Fields:
+// Name Type Description
+// ------------------------------------------------------------------
+// DEV_CLASS UINT32 BaseClass, SubClass, ProgrammingInterface and RevisionId all together
+// RevisionId UINT8 RevisionId value
+// ProgInterface UINT8 ProgInterface value
+// SubClassCode UINT8 SubClassCode value
+// BaseCalssCode UINT8 BaseCalssCode value
+//----------------------------------------------------------------------------
+//<AMI_SHDR_END>
+typedef union _PCI_DEV_CLASS {
+ UINT32 DEV_CLASS;
+ struct {
+ UINT8 RevisionId;
+ UINT8 ProgInterface;
+ UINT8 SubClassCode;
+ UINT8 BaseClassCode;
+ };
+} PCI_DEV_CLASS;
+
+
+//<AMI_SHDR_START>
+//----------------------------------------------------------------------------
+// Name: PCI_DEVICE_TYPE
+//
+// Description: This ENUM definition used to identify PCI Device different BAR types
+//
+// Notes: Don't cange the order! Some PCI Bus internal routines rely on it!
+//
+// Fields:
+// Name Type Description
+// ------------------------------------------------------------------
+// tPciUnknown ENUM PCI Bus Driver wasn't able to Identify the Device
+// tPciRootBrg ENUM Device is a PCI Root Bridge Device (A virtual device the root of PCI tree)
+// tPci2PciBrg ENUM Device is a PCI to PCI Bridge Device
+// tPci2CrdBrg ENUM Device is a PCI to CARD Bus Bridge Device
+// tPciHostDev ENUM Device is a PCI Host Bridge Device (North Bridge)
+// tUncompatibleDevice ENUM Device is an Uncompatible PCI Device
+// tPciMaxDevice ENUM Last valid value of this ENUM
+//----------------------------------------------------------------------------
+//<AMI_SHDR_END>
+typedef enum {
+ tPciUnknown=0,
+ tPciRootBrg, //1
+ tPci2PciBrg, //2
+ tPci2CrdBrg, //3
+ tPciHostDev, //4
+ tPciDevice, //5
+ tUncompatibleDevice, //6
+ tPciMaxDevice //7
+} PCI_DEVICE_TYPE;
+
+//<AMI_SHDR_START>
+//----------------------------------------------------------------------------
+// Name: PCI_BAR_TYPE
+//
+// Description: This ENUM value used to identify PCI Device different BAR types.
+//
+// Fields:
+// Name Type Description
+// ------------------------------------------------------------------
+// tBarUnused ENUM BAR is not used to Specify Device Resources(empty)
+// tBarBus ENUM Virtual BAR type to use the same mechanism to clame BUS resources for the device used in bridge specific resourse routines
+// tBarIo16 ENUM BAR is used to Specify Device's I/O 16bit Resources
+// tBarIo32 ENUM BAR is used to Specify Device's I/O 32bit Resources
+// tBarMmio32 ENUM BAR is used to Specify Device's MMIO 32bit Resources
+// tBarMmio32pf ENUM BAR is used to Specify Device's Prefetchable MMIO 32bit
+// tBarMmio64 ENUM BAR is used to Specify Device's MMIO 64bit Resources
+// tBarMmio64pf ENUM BAR is used to Specify Device's Prefetchable MMIO 64bit
+// tBarIo ENUM A superset of PCI_BAR_TYPE tBarIo16 and tBarIo32
+// tBarMem ENUM A superset of PCI_BAR_TYPE tBarMmio32 and tBarMmio64
+// tBarMemPf ENUM A superset of PCI_BAR_TYPE tBarMmio32pf and tBarMmio64pf
+// tBarMaxType ENUM Last valid value of this ENUM
+//----------------------------------------------------------------------------
+//<AMI_SHDR_END>
+typedef enum {
+ tBarUnused=0,
+ tBarBus, //1
+ tBarIo16, //2
+ tBarIo32, //3
+ tBarMmio32, //4
+ tBarMmio32pf, //5
+ tBarMmio64, //6
+ tBarMmio64pf, //7
+ tBarIo, //8
+ tBarMem, //9
+ tBarMemPf, //a
+ tBarMaxType //b
+} PCI_BAR_TYPE;
+
+//<AMI_SHDR_START>
+//----------------------------------------------------------------------------
+// Name: PCI_BAD_BAR
+//
+// Description: This structure used to identify Incapable PCI Devices which
+// has some BAR irregularity.
+//
+// Fields:
+// Name Type Description
+// ------------------------------------------------------------------
+// IncompType PCI_INCOMPATIBILITY_TYPE Type of PCI Device Incompatibility
+// VendorId UINT16 Vedor ID of the PCI Device (PCI CFG OFFSET 0x00)
+// DeviceId UINT16 Device ID of the PCI Device (PCI CFG OFFSET 0x02)
+// DeviceIdMask UINT16 AND MASK to apply to Device ID value to include wider variety of the devices from the same VENDOR
+// Reserved UINT16 Must be ZERO
+// BarType PCI_BAR_TYPE PCI Device Bar Type which is Incompatible to include all device BARs of the same type Only tBarIo, tBarMem and tBarMaxType allowed.
+// BarOffset UINTN If BarType==tBarMaxType this field specifies BAR offset. Ignored if BarType!=tBarMaxType.
+// BarBase UINT64 this field will be ignored at all times Fixed Base feature not implemented yet
+// BarLength UINT64 If IncompType==icBarFixedSize this field will indicate actual resource length for the BAR. Ignored if IncompType!=icBarFixedSize.
+//----------------------------------------------------------------------------
+//<AMI_SHDR_END>
+typedef struct _PCI_BAD_BAR {
+ PCI_INCOMPATIBILITY_TYPE IncompType;
+ UINT16 VendorId;
+ UINT16 DeviceId;
+ UINT16 DevIdMask; //used to AND with DevID value
+ UINT16 Reserved;
+ PCI_BAR_TYPE BarType; //if this field=tBarMaxType then BarOffset must be used
+ //tBarMaxType, tBarIo and tBarMem only allowed
+ UINTN BarOffset;
+ UINT64 BarBase;
+ UINTN BarLength;
+
+}PCI_BAD_BAR;
+
+
+//<AMI_SHDR_START>
+//----------------------------------------------------------------------------
+// Name: PCI_BAR
+//
+// Description: This Structure used to store information about PCI Device
+// Base Address Register (BAR)
+//
+// Fields:
+// Name Type Description
+// ------------------------------------------------------------------
+// Type PCI_BAR_TYPE Type of PCI Device BAR may be converted
+// DiscoveredType PCI_BAR_TYPE Actual Type of PCI Device BAR
+// Base UINT64 Base Address of the Resource assigned to this BAR
+// Length UINT64 Length of the Resource assigned to this BAR in bytes
+// Gran UINT64 Grenularity of the Resource assigned to this BAR - a value that was read back after all ONEs was applied to the BAR.
+// Offset UINT8 Offset of the PCI Config Space where this bar Located
+// Reserved UINT8 7 Reserved Byte Fields to make structure 4 byte aligned
+// BarAttr UINT64 PCI BAR Attributes see EFI 1.1 spec for details
+// *Owner PCI_DEV_INFO Pointer to Device Private data Structure of the device who owns this structure.
+//----------------------------------------------------------------------------
+//<AMI_SHDR_END>
+typedef struct _PCI_BAR {
+ PCI_BAR_TYPE Type;
+ PCI_BAR_TYPE DiscoveredType;
+ UINT64 Base;
+ UINT64 Length;
+ UINT64 Gran;
+ UINT8 Offset; //offset of this bar register in PCI_CFG space
+ UINT8 Reserved[7];
+ UINT64 BarAttr;
+ UINT16 ExtOffset;
+ struct _PCI_DEV_INFO *Owner;
+} PCI_BAR;
+
+typedef struct _BRG_RES_ORDER {
+ //To make it look Like _T_ITEM_LST
+ UINTN InitCount;
+ UINTN BarCount;
+ PCI_BAR **BarList; //this is array of Pointers
+}BRG_RES_ORDER;
+
+//<AMI_SHDR_START>
+//----------------------------------------------------------------------------
+// Name: BRG_ALIGN_INFO
+//
+// Description: This Structure used to store information about PCI Bridge
+// alignment requirements since behind the bridge could be more than one
+// device.
+//
+// Fields:
+// Name Type Description
+// ------------------------------------------------------------------
+// MaxGran UINT64 Maximum Granularity of the Resources Behind the Bridge
+// ResGran UINT64 Granularity that will apply after Bridge Resources would be assigned
+// MinGran UINT64 Minimum Granularity supported by the Bridge
+// PCI_BAR ExtraRes Resource window Padded in order to support Granularity of the next allocation
+//----------------------------------------------------------------------------
+//<AMI_SHDR_END>
+typedef struct _BRG_ALIGN_INFO {
+ UINT64 MaxGran;
+ UINT64 ResGran;
+ UINT64 MinGran;
+ PCI_BAR ExtraRes;
+} BRG_ALIGN_INFO;
+
+
+
+//<AMI_SHDR_START>
+//----------------------------------------------------------------------------
+// Name: PCI_BUS_OVERRIDE_DATA
+//
+// Description: This Structure used to store information about PCI Device's
+// EFI_BUS_SPECIFIC_DRIVER_OVERRIDE_PROTOCOL Instance, if any.
+//
+// Fields:
+// Name Type Description
+// ------------------------------------------------------------------
+// BusOverride EFI_BUS_SPECIFIC_DRIVER_OVERRIDE_PROTOCOL EFI_BUS_SPECIFIC_DRIVER_OVERRIDE_PROTOCOL instance.
+// *OverrideHandles EFI_HANDLE Pointer to the EFI_HANDLEs Buffer gets overriden by the inctance of EFI_BUS_SPECIFIC_DRIVER_OVERRIDE_PROTOCOL above.
+// OhCount UINTN Number of EFI_HANDLEs in "OverrideHandles" buffer
+// *Owner PCI_DEV_INFO Pointer to Device Private data Structure of the device who owns this structure.
+//----------------------------------------------------------------------------
+//<AMI_SHDR_END>
+typedef struct _PCI_BUS_OVERRIDE_DATA {
+ EFI_BUS_SPECIFIC_DRIVER_OVERRIDE_PROTOCOL BusOverride;
+ struct _PCI_DEV_INFO *Owner;
+}PCI_BUS_OVERRIDE_DATA;
+
+
+#if ((defined EFI_SPECIFICATION_VERSION) && (EFI_SPECIFICATION_VERSION >= 0x2001F))
+typedef struct _PCI_LOAD_FILE_DATA {
+ EFI_LOAD_FILE2_PROTOCOL LoadFile2;
+ struct _PCI_DEV_INFO *Owner;
+}PCI_LOAD_FILE_DATA;
+#endif
+
+typedef struct _PCI_ROM_IMAGE_DATA {
+ EFI_HANDLE RomImgHandle;
+ MEDIA_RELATIVE_OFFSET_RANGE_DEVICE_PATH RomImageDP;
+ PCI_EFI_OPT_ROM_HEADER *RomHeader;
+ UINTN ActualSize;
+} PCI_ROM_IMAGE_DATA;
+
+
+//<AMI_SHDR_START>
+//----------------------------------------------------------------------------
+// Name: PCIE_EXT_DATA_HDR
+//
+// Description: This Structure used to store PCI Express Device's Extended
+// Data Structure Header. It is the same for all data types.
+//
+// Notes: See PCIE.h for details on PCIE_VC_RESCAP_REG.
+//
+// Fields:
+// Name Type Description
+// ------------------------------------------------------------------
+// VcResOffset UINT16 Offset in PCI Express Extanded Configuration Space of the Virtual Channel Resources header.
+// Reserved UINT8 2 Reserved bytes to make structure 4 byte aligned.
+// VcResCap PCIE_VC_RESCAP_REG Contents of Virtual Channel Capability Register.
+//----------------------------------------------------------------------------
+//<AMI_SHDR_END>
+typedef struct _PCIE_EXT_DATA_HDR {
+ UINT16 CapHdrOffset;
+ UINT32 CapReg;
+}PCIE_EXT_DATA_HDR;
+
+
+//<AMI_SHDR_START>
+//----------------------------------------------------------------------------
+// Name: VC_RES_DATA
+//
+// Description: This Structure used to store PCI Express Device's Virtual
+// Channel Resource Data.
+//
+// Notes: See PCIE.h for details on PCIE_VC_RESCAP_REG.
+//
+// Fields:
+// Name Type Description
+// ------------------------------------------------------------------
+// VcResOffset UINT16 Offset in PCI Express Extanded Configuration Space of the Virtual Channel Resources header.
+// Reserved UINT8 2 Reserved bytes to make structure 4 byte aligned.
+// VcResCap PCIE_VC_RESCAP_REG Contents of Virtual Channel Capability Register.
+//----------------------------------------------------------------------------
+//<AMI_SHDR_END>
+typedef struct _VC_RES_DATA {
+ UINT16 VcResOffset;
+ PCIE_VC_RESCAP_REG VcResCap;
+ UINT8 Reserved[2];
+}VC_RES_DATA;
+
+
+
+
+//<AMI_SHDR_START>
+//----------------------------------------------------------------------------
+// Name: VC_DATA
+//
+// Description: This Structure used to store PCI Express Device's Virtual Channel Data.
+//
+// Notes: See PCIE.h for details on PCIE_PORTVC_CAP_REG1, PCIE_PORTVC_CAP_REG2.
+// See AmiDxeLib.h for details on T_ITEM_LIST;
+//
+// Fields:
+// Name Type Description
+// ------------------------------------------------------------------
+// VcResOffset UINT16 Offset in extanded PCI Express Extanded Configuration Space of the Virtual Channel Capability header
+// Reserved UINT8 2 Reserved bytes to make structure 4 byte aligned
+// VcCap1 PCIE_PORTVC_CAP_REG1 Contents of Virtual Channel Port Capability Register 1
+// VcCap2 PCIE_PORTVC_CAP_REG2 Contents of Virtual Channel Port Capability Register 2
+// InitCnt UINTN to make this and 2 following fields look like T_ITEM_LIST
+// VcCount UINTN Number of VC resource Headers found in this Device
+// **VcResData VC_RES_DATA Pointer on Array of "VcCount" pointers on the Devices VC_RES_DATA structure.
+//----------------------------------------------------------------------------
+//<AMI_SHDR_END>
+typedef struct _VC_DATA {
+ UINT16 VcOffset; //Offset of Extd VC Cap Header
+ PCIE_PORTVC_CAP_REG1 VcCap1;
+ PCIE_PORTVC_CAP_REG2 VcCap2;
+ UINT8 Reserved[2];
+//to make it look like T_ITEM_LIST
+ UINTN InitCnt;
+ UINTN VcCount;
+ VC_RES_DATA **VcResData;
+}VC_DATA;
+
+
+typedef struct _PCIE_SRIOV_DATA{
+ UINT16 SriovCapHdrOffs;
+ PCIE_ARI_CAP_REG AriCaps; //16 bit reg
+ UINT8 Reserved[2];
+ PCI_BAR Bar[PCI_MAX_BAR_NO]; //VF BARs
+}PCIE_SRIOV_DATA;
+
+
+//Alternative routing ID
+typedef struct _PCIE2_ARI_DATA {
+ UINT16 AriCapHdrOffs;
+ PCIE_ARI_CAP_REG AriCaps; //16 bit reg
+ UINT8 Reserved[4];
+}PCIE2_ARI_DATA;
+
+//Access Control
+typedef struct _PCIE2_ACS_DATA {
+ UINT16 AcsCapHdrOffs;
+ PCIE_ACS_CAP_REG AcsCaps; //16 bit reg
+ UINT8 Reserved[4];
+}PCIE2_ACS_DATA;
+
+//Address Translation
+typedef struct _PCIE2_ATS_DATA {
+ UINT16 AtsCapHdrOffs;
+ PCIE_ATS_CAP_REG AtsCaps; //16 bit reg
+ UINT8 Reserved[4];
+}PCIE2_ATS_DATA;
+
+//Internal RC Link
+typedef struct _PCIE_RCLNK_DATA {
+ UINT16 RcLnkCapHdrOffs;
+ PCIE_RC_LNK_CAP_REG PcLncCap; //32 bit reg
+ UINT8 Reserved[2];
+}PCIE_RCLNK_DATA;
+
+//Secondary PCIe Ext Capability
+typedef struct _PCIE3_DATA {
+ UINT16 SecPcieCapOffs;
+ UINT32 LaneErrSts; //32 bit reg
+ UINT8 MaxLanesCount;
+} PCIE3_DATA;
+
+//<AMI_SHDR_START>
+//----------------------------------------------------------------------------
+// Name: PCIE2_DATA
+//
+// Description: This Structure used to store Device's PCI Express Gen2 Specific Data.
+//
+// Notes: See PCIE.h for details on PCIE_PCIE_CAP_REG, PCIE_DEV_CAP_REG,
+// PCIE_LNK_CAP_REG, PCIE_SLT_CAP_REG;
+// See AmiDxeLib.h for details on T_ITEM_LIST;
+//
+// Fields:
+// Name Type Description
+// ------------------------------------------------------------------
+// PcieOffs UINT16 Offset in Standard PCI Configuration Space of the PCI Express Capability header
+// DeviceCap PCIE_DEV_CAP2_REG Contents of PCI Express Device Capability 2 Register
+// LinkCap PCIE_LNK_CAP2_REG Contents of PCI Express Link Capability 2 Register
+// SlotCap PCIE_SLT_CAP2_REG Contents of PCI Express Slot Capability 2 Register
+// *Owner PCI_DEV_INFO Pointer to Device Private data Structure of the Device who owns this structure.
+//----------------------------------------------------------------------------
+//<AMI_SHDR_END>
+typedef struct _PCIE2_DATA {
+ PCIE_DEV_CAP2_REG DeviceCap2;
+ PCIE_LNK_CAP2_REG LinkCap2; //in spec v2.1 this reg is a place holder reserved for future use
+ //in spec v3.0 this register was defined and holds LNK Supported Speed
+ PCIE_SLT_CAP2_REG SlotCap2; //in spec v2.1 this reg is a place holder reserved for future use
+ //in spec v3.0 this reg a place holder as well
+ BOOLEAN AriEnabled; //to indicate for Dowm Stream Port has ARI forwarding ON
+ UINT8 LnkSpeed;
+ UINT8 Reserved[2];
+ PCI_DEV_INFO *Owner;
+} PCIE2_DATA;
+
+
+
+//<AMI_SHDR_START>
+//----------------------------------------------------------------------------
+// Name: PCIE_DATA
+//
+// Description: This Structure used to store Device's PCI Express Specific Data.
+//
+// Notes: See PCIE.h for details on PCIE_PCIE_CAP_REG, PCIE_DEV_CAP_REG,
+// PCIE_LNK_CAP_REG, PCIE_SLT_CAP_REG;
+// See AmiDxeLib.h for details on T_ITEM_LIST;
+//
+// Fields:
+// Name Type Description
+// ------------------------------------------------------------------
+// PcieOffs UINT16 Offset in Standard PCI Configuration Space of the PCI Express Capability header
+// PcieCap PCIE_PCIE_CAP_REG Contents of PCI Express Capability Register
+// DeviceCap PCIE_DEV_CAP_REG Contents of PCI Express Device Capability Register
+// LinkCap PCIE_LNK_CAP_REG Contents of PCI Express Link Capability Register
+// SlotCap PCIE_SLT_CAP_REG Contents of PCI Express Slot Capability Register
+// CommonClk BOOLEAN Flag to record Device's Link Clock Configuration
+// ClockSet BOOLEAN Flag to mark PCI Express Initialization Process steps
+// PayloadSet BOOLEAN Flag to mark PCI Express Initialization Process steps
+// AspmSet BOOLEAN Flag to mark PCI Express Initialization Process steps
+// *VcData VC_DATA Pointer to Device's Virtual Channel Data Structure
+// *Owner PCI_DEV_INFO Pointer to Device Private data Structure of the Device who owns this structure.
+//----------------------------------------------------------------------------
+//<AMI_SHDR_END>
+typedef struct _PCIE_DATA {
+ UINT16 PcieOffs; //in order not to calculate Offset every time we need to access it
+ PCIE_PCIE_CAP_REG PcieCap;
+ PCIE_DEV_CAP_REG DeviceCap;
+ PCIE_LNK_CAP_REG LinkCap;
+ PCIE_SLT_CAP_REG SlotCap;
+ PCIE_ROOT_CAP_REG RootCap;
+ BOOLEAN LinkSet; //to indicate - Link Cnt Reg was programmed
+ BOOLEAN DevSet; //to indicate - Device Cnt Reg was programmed
+ BOOLEAN SlotSet; //to indicate - Slot Cnt Reg was programmed
+ UINT8 Reserved;
+ UINT16 MaxPayload;//Calculated and stored on both sides of the stored in
+ UINT16 MaxL0Lat; //Calculated Max latency on the link from top down
+ UINT16 MaxL1Lat; //(not included internal latency of Switch or Root Complex)
+ //in 2 fields abowe
+ //value of 0xFFFF indicates corresponded Lx state is not supported)
+ //values form 0...7 corresponds to Maximum latency for the link to which device is connected.
+ //All other values 8..0xFFFE are illegal and reserved.
+ UINT8 CurrLnkSpeed; // encoding changed from previous versiom 8GT/s speed added so name as well
+ UINT8 CurrLnkWidth;
+ PCIE2_DATA *Pcie2;
+ PCIE3_DATA *Pcie3;
+ //Ext Capabilities collected information
+ VC_DATA *VcData;
+ PCIE_SRIOV_DATA *SriovData;
+ PCIE2_ARI_DATA *AriData;
+ PCIE2_ACS_DATA *AcsData;
+ PCIE2_ATS_DATA *AtsData;
+ PCIE_RCLNK_DATA *RcLnkData;
+ //Back reference information
+ PCI_DEV_INFO *Owner;
+} PCIE_DATA;
+
+
+//<AMI_SHDR_START>
+//----------------------------------------------------------------------------
+// Name: PCIX_DATA
+//
+// Description: This Structure used to store Device's PCI-X Specific Data.
+//
+// Notes: See PCIX.h for details on PCIX_DEV_STA_REG, PCIX_SEC_STA_REG;
+//
+// Fields:
+// Name Type Description
+// ------------------------------------------------------------------
+// PcixOffs UINT16 Offset in Standard PCI Configuration Space of the PCI-X Capability header
+// PcixDevStatus PCIX_DEV_STA_REG Contents of PCI-X Device Status Register
+// PcixSecStatus PCIX_SEC_STA_REG Contents of PCI-X Device Secondary Status Register
+// *Owner PCI_DEV_INFO Pointer to Device Private data Structure of the Device who owns this structure.
+//----------------------------------------------------------------------------
+//<AMI_SHDR_END>
+typedef struct _PCIX_DATA {
+ UINT16 PcixOffs;
+ PCIX_DEV_STA_REG PcixDevStatus;
+ PCIX_SEC_STA_REG PcixSecStatus;
+ PCI_DEV_INFO *Owner;
+} PCIX_DATA;
+
+
+//<AMI_SHDR_START>
+//----------------------------------------------------------------------------
+// Name: PCIX_DATA
+//
+// Description: This Structure used to store Device's Hot Plug Controller (HPC) Specific Data.
+//
+// Notes: See "PciHotPlugInit.h" for details on HPC and RHPC;
+//
+// Fields:
+// Name Type Description
+// ------------------------------------------------------------------
+// HpcOffs UINT16 Offset in Standard PCI Configuration Space of the PCI Hotplug Capability header.
+// Root BOOLEAN Flag to indicate Root Hot Plug Controller (RHPC).
+// Reserved UINT8 3 Reserved bytes to make structure 4 byte aligned.
+// *HpcLocation EFI_HPC_LOCATION Location of the RHPC delivered from EFI_PCI_HOT_PLUG_INIT_PROTOCOL.
+// *HpbBridge PCI_DEV_INFO The P2P Bridge which creates the bus controlled by this HPC.
+// HpcPciAddr PCI_CFG_ADDR Address on the PCI Bus of this HPC.
+// BusFound BOOLEAN Flag to indicate that bus controlled by this HPC was alresdy found.
+// Initialized BOOLEAN Flag to indicate that HPC Initialization Routine was called.
+// HpcState EFI_HPC_STATE Current state of the HPC
+// *Owner PCI_DEV_INFO Pointer to Device Private data Structure of the Device who owns this structure.
+//----------------------------------------------------------------------------
+//<AMI_SHDR_END>
+typedef struct _PCI_HPC_INFO {
+ UINT16 HpcOffs;
+ BOOLEAN Root;
+ UINT8 Reserved[3];
+ EFI_HPC_LOCATION *HpcLocation;
+ PCI_DEV_INFO *HpbBridge;
+ PCI_CFG_ADDR HpcPciAddr;
+ BOOLEAN BusFound;
+ BOOLEAN Initialized;
+ EFI_HPC_STATE HpcState; //UINT16
+ PCI_DEV_INFO *Owner;
+}PCI_HPC_INFO;
+
+
+
+//<AMI_SHDR_START>
+//----------------------------------------------------------------------------
+// Name: PCI_DEV_INFO
+//
+// Description: This Structure is the main data structure associated with the PCI Device.
+// It holds all device specific data and references all other data srtuctures defined in "PciBus.h".
+//
+// Notes: See "PCI.h" for details;
+//
+// Fields:
+// Name Type Description
+// ------------------------------------------------------------------
+// PciIo EFI_PCI_IO_PROTOCOL An instance of the EFI_PCI_IO_PROTOCOL for This Device.
+// BusOvrData PCI_BUS_OVERRIDE_DATA An instance of PCI_BUS_OVERRIDE_DATA structure for This Device.
+// *DevicePath EFI_DEVICE_PATH_PROTOCOL A pointer to an instance of EFI_DEVICE_PATH_PROTOCOL for This Device.
+// *RbIo EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL A pointer to an instance of EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL of This Device's Root Bridge.
+// *ParentBrg PCI_DEV_INFO Pointer to a private datastructure of This Device's "Parent" Bridge.
+// *HostData PCI_HOST_INFO Pointer to This Device's Host Bridge private data.
+// Type PCI_DEVICE_TYPE Type of This Device. See PCI_DEVICE_TYPE for details.
+// Started BOOLEAN Flag to indicate that device has been Registred with HandleDatabase and has its EFI_PCI_IO_PROTOCOL installed. Device is READY TO USE
+// Assigned BOOLEAN Flag to indicate that resources requested by this Device was assigned to it and corresponded BARs were programmed.
+// Discovered BOOLEAN Flag to indicate that resource requested information of This Device has been gethered and recorded.
+// Discovered BOOLEAN Flag to indicate that that This Device was enumerated and it's Address; ClassCode; Type and DevID/VendId data recorded.
+// Address PCI_CFG_ADDR Address on the PCI Bus of This Device.
+// Handle EFI_HANDLE This Device Handle.
+// DevVenId PCI_DEV_ID This Device Identification - Contents of DevID and VendorID Registers
+// Class PCI_DEV_CLASS This Device RevisionId Cllas, Sub Class and ProgrInterface Code.
+// Bar PCI_BAR PCI_MAX_BAR_NO+1 Bar Registers if Device has implemented Option ROM BAR it is also covered.
+// Capab UINT64 This Device Capabilities.
+// Attrib UINT64 This Device Attributes.
+// PmiCapOffs UINTN This Device Power Management Capabilities Header Offset in PCI Config Space.
+// *PciExpress PCIE_DATA If This Device has PCI Express features this field will have pointer to the PCI Express Data Structure.
+// *PciX PCIX_DATA If This Device has PCI-X or PCI-X2 features this field will have pointer to the PCI X Data Structure.
+// *HotPlug PCI_HPC_INFO If This Device is a Hot Plug Controller or the bridge behind which Hot Plug Slots located this field will have a Pointer to a member of PCI_HOST_INFO.HpcList[?].
+// Incompatible BOOLEAN Flag to indicaste that This Device's VendorID DeviceID was found in Bad Pci Device Table.
+// RbError BOOLEAN Flag to indicaste that Root Bridge Access failed during initialization.
+// RomBarError BOOLEAN Flag to indicaste that Option ROM BAR implemented but Invalid.
+// DebugPort BOOLEAN Flag to indicaste that This Device is reserved as a Debug Port.
+//----------------------------------------------------------------------------
+//<AMI_SHDR_END>
+typedef struct _PCI_DEV_INFO {
+ EFI_PCI_IO_PROTOCOL PciIo; //PCI IO Protocol Instance
+ PCI_BUS_OVERRIDE_DATA BusOvrData; //PCI Specific
+ EFI_DEVICE_PATH_PROTOCOL *DevicePath;
+//-- Device Parent Info
+ EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *RbIo;//Root Bridge PCI IO protocol Instance
+ struct _PCI_DEV_INFO *ParentBrg; //to help iterate backwards
+ PCI_HOST_INFO *HostData; //will have pointers
+//-- Device Specific Info
+ PCI_DEVICE_TYPE Type; //Identifies the device
+ BOOLEAN Started; //Indicate that device has been Registred with HandleDatabase
+ //and ready to use by others - Device is READY TO USE
+ BOOLEAN Assigned; //Indicates that resources requested by this device
+ //was assigned to it and corresponded BARs were programmed
+ BOOLEAN Discovered; //Indicates that resources information requested by this device
+ //has been gethered and recorded
+ BOOLEAN Enumerated; //Indicates that Device was enumerated
+ //and it's Addrss; ClassCode; Type and DevID/VendId data recorded
+ PCI_CFG_ADDR Address; //Device Location On The Pci Bus
+ EFI_HANDLE Handle; //this Device Handle
+ PCI_DEV_ID DevVenId; //Device Identification - Contents of DevID and VendorID Registers
+ PCI_DEV_CLASS Class; //Device Cllas, Sub Class and Progr Interface Code
+ PCI_BAR Bar[PCI_MAX_BAR_NO+1];//Bar Registers if Device has an Option ROM it is also covered by this bar
+ UINT64 Capab;
+ UINT64 Attrib;
+ UINTN PmiCapOffs;
+//-- Device Features Info
+ PCIE_DATA *PciExpress;
+ PCIX_DATA *PciX;
+ PCI_HPC_INFO *HotPlug;
+//This fields will indicate problems the device might have during initialization.
+ BOOLEAN Incompatible;
+ BOOLEAN RbError;
+ BOOLEAN RomBarError;
+ BOOLEAN DebugPort;
+//-------------------------------------------------------------------
+//Additional stuff used in CORE Version 4.6.3.2 and up
+ UINT64 Signature;
+ UINT8 MajorVersion;
+ UINT8 MinorVersion;
+ UINT8 Revision;
+ BOOLEAN SkipDevice;
+ BOOLEAN OutOfResRemove;
+ UINT8 Reserved0[3];
+ PCI_IRQ_PIC_ROUTE *PicIrqEntry;
+ PCI_IRQ_APIC_ROUTE *ApicIrqEntry;
+//This field added to meet compatibility with UEFI 2.1
+ PCI_CMD_REG CmdReg;
+ PCI_STA_REG StaReg;
+//Additional stuff used in PCI Bus Version 2.3.1 and up
+//if device a Multi Finctional
+//T_ITEM_LIST to store all available functions of this device
+//and signify Function 0 since with PCIe some programinig applicable for F0 only.
+ PCI_DEV_INFO *Func0; //Signifies if Device Is Multy Function ==NULL single
+ // following fieds holds all other functions of the device.
+ UINTN FuncInitCnt;
+ //If (Func0==NULL && FuncCount==0) function is a single function device, following fields are not used and reserved;
+ //If (Func0!=NULL && FuncCount==0) function is one of the Func1..Func7 of multyfunc device Func0 points on DevFunc0;
+ //If (Func0!=NULL && (FuncCount!=0 || FuncInitCnt!=0)) function is Func0 of multyfunc device DevFunc holds pointers at all other Func1..7 found
+ //If (Func0==NULL && FuncCount!=0) Illehgal combination - reserved!
+ UINTN FuncCount;
+ PCI_DEV_INFO **DevFunc;
+//Collection of EFI Compatible Option ROMs
+ UINTN RomInitCnt;
+ UINTN EfiRomCount;
+ PCI_ROM_IMAGE_DATA **EfiRomImages;
+#if ((defined EFI_SPECIFICATION_VERSION) && (EFI_SPECIFICATION_VERSION >= 0x2001F))
+ PCI_LOAD_FILE_DATA LoadFileData;
+#endif
+}PCI_DEV_INFO;
+
+
+//<AMI_SHDR_START>
+//----------------------------------------------------------------------------
+// Name: PCI_BRG_EXT
+//
+// Description: PCI Bridge Extended Data Structure. This Structure used to store
+// Hosts and PCI to PCI Bridges additional data. It must follow exactly after the
+// PCI_DEV_INFO data structure of the device identified as a Bridge.
+//
+// Notes: See PCI.h for details;
+//
+// Fields:
+// Name Type Description
+// ------------------------------------------------------------------
+// Res PCI_BAR An Array of "rtMaxRes" PCI_BAR structures to hold resource requirements of bridge secondary interface
+// Pad PCI_BAR An Array of "rtMaxRes" PCI_BAR structures to hold resource Padding requirements of bridge secondary interface
+// Align BRG_ALIGN_INFO An Array of "rtMaxRes" BRG_ALIGN_INFO structures to hold Resource Alignment requirements of bridge secondary interface
+// BarOrder BRG_RES_ORDER An Array of "rtMaxRes" BRG_RES_ORDER structures to hold BAR Order of bridge secondary interface
+// PaddAttr EFI_HPC_PADDING_ATTRIBUTES Resource Padding Attributes.
+// AllocAttr UINT64 Resource Allocation Attributes.
+// InitialCount UINTN To make this and 2 following fields look like T_ITEM_LIST.
+// ChildCount UINTN Number of PCI Devices descovered on Bridge's secondary interface.
+// **ChildList PCI_DEV_INFO Pointer to the array of pointers on Child Devices Private Data.
+// Padded BOOLEAN Indicaes that resources Vas Padded for that Bridge.
+//----------------------------------------------------------------------------
+//<AMI_SHDR_END>
+typedef struct _PCI_BRG_EXT {
+ PCI_BAR Res[rtMaxRes]; //it will include Bus properties
+ //SecBus= Bar.Base SubBus=Len
+ PCI_BAR Pad[rtMaxRes]; //Same as above but for Padding
+ BRG_ALIGN_INFO Align[rtMaxRes];
+ BRG_RES_ORDER BarOrder[rtMaxRes];
+ EFI_HPC_PADDING_ATTRIBUTES PaddAttr; //Attributes For Resource Padding
+ UINT64 AllocAttr;
+//to make it look like as T_ITEM_LIST structure
+ UINTN InitialCount;
+ UINTN ChildCount;
+ PCI_DEV_INFO **ChildList;
+ BOOLEAN Padded;
+ BOOLEAN Reserved;
+ UINT8 ItemNumber; //Item Number in sorted gPciBusDb array
+ UINT8 ChainNumber;
+ PCI_BUS_XLAT_HDR *XlatTblEntry;
+ PCI_BRG_CNT_REG BrgCmdReg;
+} PCI_BRG_EXT;
+
+
+//<AMI_SHDR_START>
+//----------------------------------------------------------------------------
+// Name: PCI_BRG_INFO
+//
+// Description: PCI Bridge Private Data Structure.
+//
+// Fields:
+// Name Type Description
+// ------------------------------------------------------------------
+// Common PCI_DEV_INFO Data Structure which common for all Objects. See PCI_DEV_INFO.
+// Bridge PCI_BRG_EXT PCI Bridge additional information. See PCI_BRG_EXT.
+//----------------------------------------------------------------------------
+//<AMI_SHDR_END>
+typedef struct _PCI_BRG_INFO {
+ PCI_DEV_INFO Common;
+ PCI_BRG_EXT Bridge;
+}PCI_BRG_INFO;
+
+
+//<AMI_SHDR_START>
+//----------------------------------------------------------------------------
+// Name: PCI_HOST_INFO
+//
+// Description: Root Srtucture of the PCI Subsystem.
+//
+// Fields:
+// Name Type Description
+// ------------------------------------------------------------------
+// *VgaDev PCI_DEV_INFO Pointer on curently selected Legacy VGA device.
+// *PriIde PCI_DEV_INFO Pointer on curently selected Legacy Primary IDE device.
+// *SecIde PCI_DEV_INFO Pointer on curently selected Legacy Secondary IDE device.
+// RbInitCount UINTN To make this and 2 following fields look like T_ITEM_LIST.
+// RbCount UINTN Number of Root Bridges in the System.
+// **RootBridges PCI_DEV_INFO Pointer to the array of pointers on PCI Root Bridge PCI Devices Private Data.
+// HostHandle EFI_HANDLE Handle of the PCI Host Bridge Associated with this Root Bridge
+// *ResAllocProt EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL Pointer to the EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL Instance.
+// *PlatformProt EFI_PCI_PLATFORM_PROTOCOL Pointer to the EFI_PCI_PLATFORM_PROTOCOL Instance.
+// *IncompDevProt EFI_INCOMPATIBLE_PCI_DEVICE_SUPPORT_PROTOCOL Pointer to the EFI_INCOMPATIBLE_PCI_DEVICE_SUPPORT_PROTOCOL Instance.
+// *HpInitProt EFI_PCI_HOT_PLUG_INIT_PROTOCOL Pointer to the EFI_PCI_HOT_PLUG_INIT_PROTOCOL Instance.
+// RhpcInitCnt UINTN To make this and 2 following fields look like T_ITEM_LIST.
+// RhpcCount UINTN Number of Root Hot plug Controllers in the System.
+// **RhpcList PCI_HPC_INFO Pointer to the array of pointers on PCI Root Hot Plug Controller Private Data. See PCI_HPC_INFO.
+// InitRhpcCount UINTN Number of Initialized PCI Root Hot Plug Controllers
+// Updated BOOLEAN Flag to indicate that Host information has been collected.
+// Enumerated BOOLEAN Flag to indicate that This Host infrastructure has been enumerated.
+//----------------------------------------------------------------------------
+//<AMI_SHDR_END>
+typedef struct _PCI_HOST_INFO {
+ PCI_DEV_INFO *VgaDev;
+ PCI_DEV_INFO *PriIde;
+ PCI_DEV_INFO *SecIde;
+//T_ITEM_LST object with pointer on type
+ UINTN RbInitCnt;
+ UINTN RbCount;
+ PCI_DEV_INFO **RootBridges;
+//Protocols Associated with PCI Host Infrastructure and Pci Enumeration
+ EFI_HANDLE HostHandle;
+ EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL *ResAllocProt;
+ EFI_PCI_PLATFORM_PROTOCOL *PlatformProt;
+ EFI_INCOMPATIBLE_PCI_DEVICE_SUPPORT_PROTOCOL *IncompDevProt;
+ EFI_PCI_HOT_PLUG_INIT_PROTOCOL *HpInitProt;
+//T_ITEM_LST object with pointer on type
+ UINTN RhpcInitCnt;
+ UINTN RhpcCount;
+ PCI_HPC_INFO **RhpcList;
+ UINTN InitRhpcCount; //to save some time InitializedRhpcCount
+//------------------------------------------------------------------------
+ BOOLEAN Updated; //this will indicate that Host information has been collected
+ BOOLEAN Enumerated; //this host infrastructure has been enumerated
+} PCI_HOST_INFO;
+
+
+#pragma pack(pop)
+
+//Export some routines to be used in PciHostBridge.c
+EFI_STATUS AddBusDbEntry(PCI_BUS_XLAT_HDR *BusHdr, T_ITEM_LIST *BusDb);
+
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2005, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
diff --git a/Include/PciBusEx.h b/Include/PciBusEx.h
new file mode 100644
index 0000000..53b1796
--- /dev/null
+++ b/Include/PciBusEx.h
@@ -0,0 +1,158 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2005, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/BIN/Core/Modules/PciBus/PciBusEx.h 2 11/14/08 1:36p Yakovlevs $
+//
+// $Revision: 2 $
+//
+// $Date: 11/14/08 1:36p $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Core/Modules/PciBus/PciBusEx.h $
+//
+// 2 11/14/08 1:36p Yakovlevs
+// Removed unused function from PciBusEx protocol.
+//
+// 1 9/25/08 11:29a Yakovlevs
+//
+//**********************************************************************
+//<AMI_FHDR_START>
+//
+// Name: PciBusEx.h
+//
+// Description: Defines PciBus Extended protocol Interface to provide
+// additional PCI Bus related functions.
+//
+//<AMI_FHDR_END>
+//**********************************************************************
+#ifndef __PCI_BUS_EX__H__
+#define __PCI_BUS_EX__H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+#include <Efi.h>
+#include <PciBus.h>
+#include <Protocol\PciIo.h>
+
+#define AMI_PCI_BUS_EXT_PROTOCOL_GUID \
+{ 0xf42a009d, 0x977f, 0x4f08, 0x94, 0x40, 0xbc, 0xa5, 0xa3, 0xbe, 0xd9, 0xaf };
+
+//-------------------------------------------------
+//Forward Declarations
+//-------------------------------------------------
+typedef struct _AMI_PCI_EXT_PROTOCOL AMI_PCI_EXT_PROTOCOL;
+
+
+//-------------------------------------------------
+// Protocol Function Definitions
+//-------------------------------------------------
+typedef EFI_STATUS (EFIAPI * AMI_PCI_EXT_IS_PCI_EXPRESS)(
+ IN AMI_PCI_EXT_PROTOCOL *This,
+ IN EFI_HANDLE PciDeviceHandle,
+ IN EFI_PCI_IO_PROTOCOL *PciIo OPTIONAL,
+ OUT PCIE_DATA **PciExpData OPTIONAL
+);
+
+//-------------------------------------------------
+typedef EFI_STATUS (EFIAPI * AMI_PCI_EXT_IS_PCI_X)(
+ IN AMI_PCI_EXT_PROTOCOL *This,
+ IN EFI_HANDLE PciDeviceHandle,
+ IN EFI_PCI_IO_PROTOCOL *PciIo OPTIONAL,
+ OUT PCIX_DATA **PciXData OPTIONAL
+);
+
+//-------------------------------------------------
+typedef EFI_STATUS (EFIAPI * AMI_PCI_EXT_IS_P2P_BRG)(
+ IN AMI_PCI_EXT_PROTOCOL *This,
+ IN EFI_HANDLE PciDeviceHandle,
+ IN EFI_PCI_IO_PROTOCOL *PciIo OPTIONAL,
+ OUT PCI_BRG_EXT **BrgData OPTIONAL
+);
+
+//-------------------------------------------------
+typedef EFI_STATUS (EFIAPI * AMI_PCI_EXT_IS_CRD_BRG)(
+ IN AMI_PCI_EXT_PROTOCOL *This,
+ IN EFI_HANDLE PciDeviceHandle,
+ IN EFI_PCI_IO_PROTOCOL *PciIo OPTIONAL,
+ OUT PCI_BRG_EXT **BrgData OPTIONAL
+);
+
+//-------------------------------------------------
+typedef EFI_STATUS (EFIAPI * AMI_PCI_EXT_IS_REG_DEVICE)(
+ IN AMI_PCI_EXT_PROTOCOL *This,
+ IN EFI_HANDLE PciDeviceHandle,
+ IN EFI_PCI_IO_PROTOCOL *PciIo OPTIONAL
+);
+
+typedef EFI_STATUS (EFIAPI * AMI_PCI_EXT_GET_CLASS_CODES_INFO) (
+ IN AMI_PCI_EXT_PROTOCOL *This,
+ IN EFI_HANDLE PciDeviceHandle,
+ IN EFI_PCI_IO_PROTOCOL *PciIo OPTIONAL,
+ OUT PCI_DEV_CLASS *CassCodes
+);
+
+typedef EFI_STATUS (EFIAPI * AMI_PCI_EXT_GET_PCI_PIC_IRQ) (
+ IN AMI_PCI_EXT_PROTOCOL *This,
+ IN EFI_HANDLE PciDeviceHandle,
+ IN EFI_PCI_IO_PROTOCOL *PciIo OPTIONAL,
+ OUT PCI_IRQ_PIC_ROUTE **PicIrqTblEntry,
+ EFI_PCI_CONFIGURATION_ADDRESS **ParentDevices,
+ OUT UINTN *EntryCount
+);
+
+typedef EFI_STATUS (EFIAPI * AMI_PCI_EXT_GET_PCI_APIC_IRQ) (
+ IN AMI_PCI_EXT_PROTOCOL *This,
+ IN EFI_HANDLE PciDeviceHandle,
+ IN EFI_PCI_IO_PROTOCOL *PciIo OPTIONAL,
+ OUT PCI_IRQ_APIC_ROUTE **ApicIrqTblEntry,
+ EFI_PCI_CONFIGURATION_ADDRESS **ParentDevices,
+ OUT UINTN *EntryCount
+);
+
+
+
+typedef struct _AMI_PCI_EXT_PROTOCOL {
+ AMI_PCI_EXT_IS_PCI_EXPRESS IsPciExpress;
+ AMI_PCI_EXT_IS_PCI_X IsPciX;
+ AMI_PCI_EXT_IS_P2P_BRG IsPci2PciBridge;
+ AMI_PCI_EXT_IS_CRD_BRG IsPci2CrdBridge;
+ AMI_PCI_EXT_IS_REG_DEVICE IsPciDevice;
+ AMI_PCI_EXT_GET_CLASS_CODES_INFO GetClassCodesInfo;
+ AMI_PCI_EXT_GET_PCI_PIC_IRQ GetPciPicIrq;
+ AMI_PCI_EXT_GET_PCI_APIC_IRQ GetPciApicIrq;
+ EFI_HANDLE PciExtHanle;
+} AMI_PCI_EXT_PROTOCOL;
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2005, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//********************************************************************** \ No newline at end of file
diff --git a/Include/PciBusIncludes.cif b/Include/PciBusIncludes.cif
new file mode 100644
index 0000000..8ce655b
--- /dev/null
+++ b/Include/PciBusIncludes.cif
@@ -0,0 +1,11 @@
+<component>
+ name = "PciBusIncludes"
+ category = ModulePart
+ LocalRoot = "Include\"
+ RefName = "PciBusIncludes"
+[files]
+"PciBus.h"
+"PciHostBridge.h"
+"PciBusEx.h"
+"PCIE30.h"
+<endComponent>
diff --git a/Include/PciHostBridge.h b/Include/PciHostBridge.h
new file mode 100644
index 0000000..7b191f0
--- /dev/null
+++ b/Include/PciHostBridge.h
@@ -0,0 +1,454 @@
+//**********************************************************************//
+//**********************************************************************//
+//** **//
+//** (C)Copyright 1985-2005, American Megatrends, Inc. **//
+//** **//
+//** All Rights Reserved. **//
+//** **//
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **//
+//** **//
+//** Phone: (770)-246-8600 **//
+//** **//
+//**********************************************************************//
+//**********************************************************************//
+//**********************************************************************
+// $Header: /Alaska/BIN/Core/Modules/PciBus/PciHostBridge.h 16 4/05/11 10:56a Yakovlevs $Revision:$
+//
+// $Date: 4/05/11 10:56a $
+//**********************************************************************
+// Revision History
+// ----------------
+//$Log: /Alaska/BIN/Core/Modules/PciBus/PciHostBridge.h $
+//
+// 16 4/05/11 10:56a Yakovlevs
+// selfreference removed.
+//
+// 15 8/16/10 1:14p Yakovlevs
+// Separated VGA attributes from Glaobal Compatibility attributes.
+//
+// 14 3/01/10 5:59p Yakovlevs
+// Multi-ROOT Generic Support Added.
+//
+// 13 9/22/09 6:07p Yakovlevs
+// 1. Added definitions to support changes for EIP 23548 (Support MMIO
+// allocation above 4GB).
+//
+// 12 8/21/09 4:36p Yakovlevs
+// Added ImageHandle field in HostBridge and RootBridge Structures.
+// Added definitions for default PCI_MAX .. MIN Resource boubdaries.
+//
+// 11 4/28/09 3:53p Yakovlevs
+// Changes related to AmiBoardInfo protocol and Multiplatform support.
+//
+// 10 3/27/09 12:35p Yakovlevs
+// Added missing IO_16 attributes from UEFI 2.1 spec
+//
+// 9 3/23/09 4:51p Yakovlevs
+// Added generic support for PCI Express Hot-Plug.
+//**********************************************************************
+#ifndef _PCI_HOST_BRIDGE_H_
+#define _PCI_HOST_BRIDGE_H_
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <Token.h>
+#if AMI_ROOT_BRIDGE_SUPPORT == 1
+
+//**********************************************************************
+//Includes goes here
+#include <Efi.h>
+#include <Dxe.h>
+#include <Protocol\PciHostBridgeResourceAllocation.h>
+#include <Protocol\PciHotPlugInit.h>
+#include <Protocol\PciPlatform.h>
+#include <Protocol\PciRootBridgeIo.h>
+#include <Protocol\DeviceIo.h>
+#include <Protocol\AmiBoardInfo.h>
+#include <AcpiRes.h>
+
+//<AMI_SHDR_START>
+//----------------------------------------------------------------------------
+// Name: EFI_PCI_CFG_ADDRESS
+//
+// Description: Macro defining PCI Config Spase access UCING PCI Express Base
+//
+// Notes:
+//
+//----------------------------------------------------------------------------
+//<AMI_SHDR_END>
+#ifndef EFI_PCI_CFG_ADDRESS
+#define EFI_PCI_CFG_ADDRESS(bus,dev,func,reg) \
+ ((UINT64) ( (((UINTN)bus) << 24)+(((UINTN)dev) << 16) + (((UINTN)func) << 8) + ((UINTN)reg)))& 0x00000000ffffffff
+#endif
+
+
+//Defining ROOT BRIDGE Compatibility Attributes group
+#define PCI_ROOT_COMPATIBILITY_ATTRIBUTES (EFI_PCI_ATTRIBUTE_IDE_PRIMARY_IO | EFI_PCI_ATTRIBUTE_IDE_SECONDARY_IO| \
+ EFI_PCI_ATTRIBUTE_ISA_IO | EFI_PCI_ATTRIBUTE_ISA_MOTHERBOARD_IO | EFI_PCI_ATTRIBUTE_ISA_IO_16)
+
+#define PCI_ROOT_VGA_ATTRIBUTES (EFI_PCI_ATTRIBUTE_VGA_PALETTE_IO | EFI_PCI_ATTRIBUTE_VGA_MEMORY | \
+ EFI_PCI_ATTRIBUTE_VGA_IO | EFI_PCI_ATTRIBUTE_VGA_PALETTE_IO_16 | EFI_PCI_ATTRIBUTE_VGA_IO_16)
+
+#define MAX_PCI_BUSES 0xFF
+#define MIN_PCI_IO 0x1000
+#define MAX_PCI_IO 0xFFFF
+#define MIN_PCI_MMIO32 0x100000
+#define MAX_PCI_MMIO32 0xFFFFFFFF
+#define MIN_PCI_MMIO64 0x100000000
+#define MAX_PCI_MMIO64 0xFFFFFFFFFFFFFFFF
+
+
+//**********************************************************************
+//Private Data Definitions
+//**********************************************************************
+
+//forward declaration
+typedef struct _PCI_HOST_BRG_DATA PCI_HOST_BRG_DATA;
+
+//<AMI_SHDR_START>
+//----------------------------------------------------------------------------
+// Name: PCI_ROOT_BRIDGE_MAPPING
+//
+// Description: Structure used to specify RootBridge Specific Mapping
+// Information for DMA transfere.
+//
+// Fields:
+// Name Type Description
+// ------------------------------------------------------------------
+// Operation EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_OPERATION PciRoot Bridge IO Operation Description.
+// NumBytes UINTN Number Of Bytes in Mapping Buffer.
+// HostAddr EFI_PHYSICAL_ADDRESS Buffer Address of the device who initiated BM transfere.
+// DeviceAddr EFI_PHYSICAL_ADDRESS Buffer Address of the device who receives BM transfere.
+//----------------------------------------------------------------------------
+//<AMI_SHDR_END>
+typedef struct _PCI_ROOT_BRIDGE_MAPPING {
+ EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_OPERATION Operation;
+ UINTN NumPages;
+ EFI_PHYSICAL_ADDRESS HostAddr;
+ EFI_PHYSICAL_ADDRESS DeviceAddr;
+} PCI_ROOT_BRIDGE_MAPPING;
+
+
+typedef enum {
+ raBus=0,
+ raIo,
+ raMmio32,
+ raMmio64,
+ raMaxRes
+} ACPI_RES_TYPE;
+
+
+typedef struct _ACPI_RES_DATA{
+ UINT64 Min;
+ UINT64 Len;
+ UINT64 Max;
+ UINT64 Gra;
+ UINT64 AddrUsed;
+ EFI_GCD_ALLOCATE_TYPE AllocType;
+} ACPI_RES_DATA;
+
+//<AMI_SHDR_START>
+//----------------------------------------------------------------------------
+// Name: PCI_ROOT_BRG_DATA
+//
+// Description: Private RootBridge Data Structure
+//
+// Fields:
+// Name Type Description
+// ------------------------------------------------------------------
+// RbIoProtocol EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL This PCI Root Bridge IO Protocol Instance.
+// RbHandle EFI_HANDLE This PCI Root Bridge EFI_HANDLE.
+// DevPath *EFI_DEVICE_PATH_PROTOCOL This PCI Root Bridge Device Path Protocol instance.
+// Owner *PCI_HOST_BRG_DATA Pointer on the Host Bridge Private Data Structure who owns this Root Bridge.
+// DevIoProtocol *EFI_DEVICE_IO_INTERFACE This PCI Root Bridge Device IO Protocol instance.
+// Supports UINT64 Set of Attirbutes Supported by this PCI Root Bridge.
+// Attributes UINT64 Set of currently supported Attirbutes by this PCI Root Bridge.
+// ResInitCnt UINTN To make this and following 2 fields look like T_ITEM_LIST type.
+// ResCount UINTN Number of ACPI QWord Resource descriptors of this PCI Root Bridge.
+// RbRes **ASLR_QWORD_ASD Pointer to the array of pointers at the resource descriptors of this PCI Root Bridge.
+// Mapping *PCI_ROOT_BRIDGE_MAPPING When Mapping is set this pointer points on Private RB Mapping Structure.
+// BusesSet BOOLEAN Flag to indicate that Bus Allocation Phase is over.
+// ResSubmited BOOLEAN Flag to indicate that Resources were submited by the PciBus Driver.
+// ResAsquired BOOLEAN Flag to indicate that Resource request was sutisfied by the GCD.
+// Reserved UINT8 Reserved field to make this structure end at 4 byte alignment.
+// BusXlatEntry *PCI_BUS_XLAT_HDR Pointer at AMI SDL Generated Bus Translate table corresponded to THIS Root Bridge.
+// RbAslName *CHAR8 Pointer to the String of THIS Root Bridge Device in ACPI Name Space.
+// AcpiRbRes[] ACPI_RES_DATA Array holding THIS Root Bridge Resource Information for ACPI
+//----------------------------------------------------------------------------
+//<AMI_SHDR_END>
+typedef struct _PCI_ROOT_BRG_DATA {
+ EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL RbIoProtocol;
+ EFI_HANDLE RbHandle;
+ EFI_HANDLE ImageHandle;
+ EFI_DEVICE_PATH_PROTOCOL *DevPath;
+ PCI_HOST_BRG_DATA *Owner;
+ EFI_DEVICE_IO_INTERFACE *DevIoProtocol;
+ UINT64 Supports;
+ UINT64 Attributes;
+ //make it as T_ITEM_LIST type
+ UINTN ResInitCnt;
+ UINTN ResCount;
+ ASLR_QWORD_ASD **RbRes;
+ PCI_ROOT_BRIDGE_MAPPING *Mapping;
+ BOOLEAN BusesSet;
+ BOOLEAN ResSubmited;
+ BOOLEAN ResAsquired;
+ BOOLEAN NotPresent;
+ PCI_BUS_XLAT_HDR *BusXlatEntry;
+ CHAR8 *RbAslName;
+ ACPI_RES_DATA AcpiRbRes[raMaxRes];//BUS; IO; MMIO32; MMIO64;
+} PCI_ROOT_BRG_DATA;
+
+typedef enum {
+ ptBus=0, //0
+ ptIo, //1
+ ptMmio32, //2
+ ptMmio32pf, //3
+ ptMmio64, //4
+ ptMmio64pf, //5
+ ptMaxType
+} HP_PADD_RES_TYPE;
+
+
+//<AMI_SHDR_START>
+//----------------------------------------------------------------------------
+// Name: HPC_LOCATION_DATA
+//
+// Description: Private HostBridge Data Structure. It holds all information
+// related to HPC and HPB Location in the System.
+//
+// Fields:
+// Name Type Description
+// ------------------------------------------------------------------
+// HpcLocation EFI_HPC_LOCATION HPC Location Information in terms of Device Path.
+// Owner *PCI_HOST_BRG_DATA Back Pointer to Locate this Data structure Owner.
+// SlotHdr PCI_BUS_XLAT_HDR AMI SDL Generated SLOT Bus Xlat Information (AmiBoardInfoProtocol).
+// Padding[] UINTN64 Array, holding Padding Information for particular Resource type.
+//----------------------------------------------------------------------------
+//<AMI_SHDR_END>
+typedef struct _HPC_LOCATION_DATA {
+ EFI_HPC_LOCATION HpcLocation;
+ PCI_ROOT_BRG_DATA *Owner;
+ PCI_BUS_XLAT_HDR *SlotHdr;
+ UINT64 Padding[ptMaxType];
+} HPC_LOCATION_DATA;
+
+
+//<AMI_SHDR_START>
+//----------------------------------------------------------------------------
+// Name: PCI_HPC_DATA
+//
+// Description: Private HostBridge Data Structure. It holds all Hot Plug
+// related Information. Used to Produce EFI_PCI_HOT_PLUG_INIT_PROTOCOL.
+//
+// Fields:
+// Name Type Description
+// ------------------------------------------------------------------
+// RootHotplugProtocol EFI_PCI_HOT_PLUG_INIT_PROTOCOL This PCI Root Hot Plug Controller Initialization Protocol Instance.
+// HbHandle EFI_HANDLE This PCI Host Bridge EFI_HANDLE.
+// HpclInitCnt UINTN To make this and following 2 fields look like T_ITEM_LIST type.
+// HpcLocCount UINTN Number of Root Bridges Hot Plug Location Data Structures Associated with THIS HOST.
+// HpcLocData **HPC_LOCATION_DATA Pointer to the array of pointers at the private PCI Hot Plug Controller Location Data.
+// Owner *PCI_HOST_BRG_DATA Back Pointer to Locate this Data structure Owner.
+//----------------------------------------------------------------------------
+//<AMI_SHDR_END>
+typedef struct _PCI_HPC_DATA {
+ //The Protocol coming first...
+ EFI_PCI_HOT_PLUG_INIT_PROTOCOL RootHotplugProtocol;
+ //HPC Location data... to make it look like T_ITEM_LIST
+ UINTN HpclInitCnt;
+ UINTN HpcLocCount;
+ HPC_LOCATION_DATA **HpcLocData;
+ PCI_HOST_BRG_DATA *Owner;
+} PCI_HPC_DATA;
+
+
+
+//<AMI_SHDR_START>
+//----------------------------------------------------------------------------
+// Name: PCI_HOST_BRG_DATA
+//
+// Description: Private HostBridge Data Structure. This is the Starting
+// point for PCI Subsystem.
+//
+// Fields:
+// Name Type Description
+// ------------------------------------------------------------------
+// ResAllocProtocol EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL This PCI Host Bridge Resource Allocation Protocol Instance.
+// HbHandle EFI_HANDLE This PCI Host Bridge EFI_HANDLE.
+// RbInitCnt UINTN To make this and following 2 fields look like T_ITEM_LIST type.
+// RootBridgeCount UINTN Number of PCI_ROOT_BRG_DATA structures (Root Bridges) this host will group.
+// RootBridges **PCI_ROOT_BRG_DATA Pointer to the array of pointers at the private PCI Root Bridge Data Structure.
+// AllocPhase EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PHASE Current Phase of PCI Bus Enumeration.
+// AllocAttrib UINT64 This PCI Host Bridge Allocation Attributes.
+// EnumStarted BOOLEAN Flag to indicate that PCI Bus Enumeration has started.
+// Reserved[3] UINT8 Reserved fields to make this structure end at 4 byte alignment.
+//----------------------------------------------------------------------------
+//<AMI_SHDR_END>
+typedef struct _PCI_HOST_BRG_DATA {
+ EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL ResAllocProtocol;
+ EFI_HANDLE HbHandle;
+ EFI_HANDLE ImageHandle;
+ //make it as T_ITEM_LIST type
+ UINTN RbInitCnt;
+ UINTN RootBridgeCount;
+ PCI_ROOT_BRG_DATA **RootBridges;
+ //----------------------------
+ EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PHASE AllocPhase;
+ UINT64 AllocAttrib;
+ BOOLEAN EnumStarted;
+ UINT8 Reserved[3];
+ //Optional Protocols - one instance per HOST
+ PCI_HPC_DATA *HpcData;
+// EFI_PCI_PLATFORM_PROTOCOL *PlatformProtocol;
+}PCI_HOST_BRG_DATA;
+
+//**********************************************************************//
+//Global Variables
+//extern UINTN gRbCountTbl[];
+//extern ASLR_QWORD_ASD *gRbBusesTbl;
+//extern UINT64 gRbSupportsTbl[];
+//extern UINT64 gHbAllocAttribTbl[];
+//**********************************************************************//
+//Some Helper Functions
+EFI_STATUS GetResources(PCI_ROOT_BRG_DATA *RootBrg, ASLR_QWORD_ASD **Resources, ASLR_TYPE_ENUM ResType);
+
+//-----------------------------------------------------------------------
+//Function Prototypes for PciRootBridgeIo
+//-----------------------------------------------------------------------
+EFI_STATUS PollMem (
+ IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *This,
+ IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH Width,
+ IN UINT64 Address,
+ IN UINT64 Mask,
+ IN UINT64 Value,
+ IN UINT64 Delay,
+ OUT UINT64 *Result);
+
+EFI_STATUS PollIo (
+ IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *This,
+ IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH Width,
+ IN UINT64 Address,
+ IN UINT64 Mask,
+ IN UINT64 Value,
+ IN UINT64 Delay,
+ OUT UINT64 *Result);
+
+EFI_STATUS PciMemRead (
+ IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *This,
+ IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH Width,
+ IN UINT64 Address,
+ IN UINTN Count,
+ IN OUT VOID *Buffer);
+
+EFI_STATUS PciMemWrite (
+ IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *This,
+ IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH Width,
+ IN UINT64 Address,
+ IN UINTN Count,
+ IN OUT VOID *Buffer);
+
+EFI_STATUS PciIoRead (
+ IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *This,
+ IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH Width,
+ IN UINT64 UserAddress,
+ IN UINTN Count,
+ IN OUT VOID *UserBuffer);
+
+EFI_STATUS PciIoWrite (
+ IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *This,
+ IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH Width,
+ IN UINT64 UserAddress,
+ IN UINTN Count,
+ IN OUT VOID *UserBuffer);
+
+EFI_STATUS CopyMem (
+ IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *This,
+ IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH Width,
+ IN UINT64 DestAddress,
+ IN UINT64 SrcAddress,
+ IN UINTN Count);
+
+EFI_STATUS PciRead (
+ IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *This,
+ IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH Width,
+ IN UINT64 Address,
+ IN UINTN Count,
+ IN OUT VOID *Buffer);
+
+EFI_STATUS PciWrite (
+ IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *This,
+ IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH Width,
+ IN UINT64 Address,
+ IN UINTN Count,
+ IN OUT VOID *Buffer);
+
+EFI_STATUS Map (
+ IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *This,
+ IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_OPERATION Operation,
+ IN VOID *HostAddress,
+ IN OUT UINTN *NumberOfBytes,
+ OUT EFI_PHYSICAL_ADDRESS *DeviceAddress,
+ OUT VOID **Mapping);
+
+EFI_STATUS Unmap (
+ IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *This,
+ IN VOID *Mapping);
+
+EFI_STATUS AllocateBuffer (
+ IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *This,
+ IN EFI_ALLOCATE_TYPE Type,
+ IN EFI_MEMORY_TYPE MemoryType,
+ IN UINTN Pages,
+ OUT VOID **HostAddress,
+ IN UINT64 Attributes);
+
+EFI_STATUS FreeBuffer (
+ IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *This,
+ IN UINTN Pages,
+ OUT VOID *HostAddress);
+
+EFI_STATUS Flush (
+ IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *This);
+
+EFI_STATUS GetAttributes (
+ IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *This,
+ OUT UINT64 *Supported,
+ OUT UINT64 *Attributes);
+
+EFI_STATUS SetAttributes (
+ IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *This,
+ IN UINT64 Attributes,
+ IN OUT UINT64 *ResourceBase,
+ IN OUT UINT64 *ResourceLength);
+
+EFI_STATUS Configuration (
+ IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *This,
+ OUT VOID **Resources);
+
+EFI_DEVICE_IO_INTERFACE * ConstructDeviceIoProtocol(
+ IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *RootBridgeIo,
+ IN EFI_DEVICE_PATH_PROTOCOL *Path);
+
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+#endif
+//**********************************************************************//
+//**********************************************************************//
+//** **//
+//** (C)Copyright 1985-2005, American Megatrends, Inc. **//
+//** **//
+//** All Rights Reserved. **//
+//** **//
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **//
+//** **//
+//** Phone: (770)-246-8600 **//
+//** **//
+//**********************************************************************//
+//**********************************************************************//
diff --git a/Include/ProcessorSubClass.h b/Include/ProcessorSubClass.h
new file mode 100644
index 0000000..39ae494
--- /dev/null
+++ b/Include/ProcessorSubClass.h
@@ -0,0 +1,354 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2005, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/BIN/Core/Include/ProcessorSubClass.h 2 10/11/05 11:19a Markw $
+//
+// $Revision: 2 $
+//
+// $Date: 10/11/05 11:19a $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Core/Include/ProcessorSubClass.h $
+//
+// 2 10/11/05 11:19a Markw
+// Added proc subclass version.
+//
+// 1 10/10/05 4:25p Markw
+//
+//**********************************************************************
+//<AMI_FHDR_START>
+//
+// Name: ProcessorSubClass.h
+//
+// Description: ProcessorSubClass definitions.
+//
+//<AMI_FHDR_END>
+//**********************************************************************
+
+#ifndef __PROCESSOR_SUBCLASS_H__
+#define __PROCESSOR_SUBCLASS_H__
+
+#include <efi.h>
+#include <DataHubSubClass.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define EFI_PROCESSOR_SUBCLASS_GUID \
+ {0x26fdeb7e,0xb8af,0x4ccf,0xaa,0x97,0x2,0x63,0x3c,0xe4,0x8c,0xa7}
+
+#define EFI_PROCESSOR_CLASS EFI_DATA_CLASS_DATA
+
+#define EFI_PROCESSOR_SUBCLASS_VERSION 0x00010000
+
+
+//Core Frequency
+#define EFI_PROCESSOR_FREQUENCY_RECORD_NUMBER 0x00000001
+typedef EFI_EXP_BASE10_DATA EFI_PROCESSOR_CORE_FREQUENCY_DATA;
+
+//Front Side Bus Frequency
+#define EFI_PROCESSOR_BUS_FREQUENCY_RECORD_NUMBER 0x00000002
+typedef EFI_EXP_BASE10_DATA EFI_PROCESSOR_FSB_FREQUENCY_DATA;
+
+//Version
+#define EFI_PROCESSOR_VERSION_RECORD_NUMBER 0x00000003
+typedef STRING_REF EFI_PROCESSOR_VERSION_DATA;
+
+//Manufacturer
+#define EFI_PROCESSOR_MANUFACTURER_RECORD_NUMBER 0x00000004
+typedef STRING_REF EFI_PROCESSOR_MANUFACTURER_DATA;
+
+//Serial Number
+#define EFI_PROCESSOR_SERIAL_NUMBER_RECORD_NUMBER 0x00000005
+typedef STRING_REF EFI_PROCESSOR_SERIAL_NUMBER_DATA;
+
+
+//ID
+#define EFI_PROCESSOR_ID_RECORD_NUMBER 0x00000006
+
+
+typedef struct {
+ UINT32 ProcessorSteppingId :4;
+ UINT32 ProcessorModel :4;
+ UINT32 ProcessorFamily :4;
+ UINT32 ProcessorType :2;
+ UINT32 ProcessorReserved1 :2;
+ UINT32 ProcessorXModel :4;
+ UINT32 ProcessorXFamily :8;
+ UINT32 ProcessorReserved2 :4;
+} EFI_PROCESSOR_SIGNATURE;
+
+typedef struct {
+ UINT32 ProcessorBrandIndex :8;
+ UINT32 ProcessorClflush :8;
+ UINT32 ProcessorReserved :8;
+ UINT32 ProcessorDfltApicId :8;
+} EFI_PROCESSOR_MISC_INFO;
+
+typedef struct {
+ UINT32 ProcessorFpu :1;
+ UINT32 ProcessorVme :1;
+ UINT32 ProcessorDe :1;
+ UINT32 ProcessorPse :1;
+ UINT32 ProcessorTsc :1;
+ UINT32 ProcessorMsr :1;
+ UINT32 ProcessorPae :1;
+ UINT32 ProcessorMce :1;
+ UINT32 ProcessorCx8 :1;
+ UINT32 ProcessorApic:1;
+ UINT32 ProcessorReserved1:1;
+ UINT32 ProcessorSep :1;
+ UINT32 ProcessorMtrr:1;
+ UINT32 ProcessorPge :1;
+ UINT32 ProcessorMca :1;
+ UINT32 ProcessorCmov:1;
+ UINT32 ProcessorPat :1;
+ UINT32 ProcessorPse36:1;
+ UINT32 ProcessorPsn :1;
+ UINT32 ProcessorClfsh:1;
+ UINT32 ProcessorReserved2:1;
+ UINT32 ProcessorDs :1;
+ UINT32 ProcessorAcpi:1;
+ UINT32 ProcessorMmx :1;
+ UINT32 ProcessorFxsr:1;
+ UINT32 ProcessorSse :1;
+ UINT32 ProcessorSse2:1;
+ UINT32 ProcessorSs :1;
+ UINT32 ProcessorReserved3:1;
+ UINT32 ProcessorTm :1;
+ UINT32 ProcessorReserved4:2;
+} EFI_PROCESSOR_FEATURE_FLAGS;
+
+typedef struct {
+ EFI_PROCESSOR_SIGNATURE Signature;
+ EFI_PROCESSOR_MISC_INFO MiscInfo;
+ UINT32 Reserved;
+ EFI_PROCESSOR_FEATURE_FLAGS FeatureFlags;
+} EFI_PROCESSOR_ID_DATA;
+
+//Type
+#define EFI_PROCESSOR_TYPE_RECORD_NUMBER 0x00000007
+typedef enum {
+ EfiProcessorOther = 1,
+ EfiProcessorUnknown = 2,
+ EfiCentralProcessor = 3,
+ EfiMathProcessor = 4,
+ EfiDspProcessor = 5,
+ EfiVideoProcessor = 6
+} EFI_PROCESSOR_TYPE_DATA;
+
+
+//Family
+#define EFI_PROCESSOR_FAMILY_RECORD_NUMBER 0x00000008
+typedef enum {
+ EfiProcessorFamilyOther = 1,
+ EfiProcessorFamilyUnknown = 2,
+ EfiProcessorFamily8086 = 3,
+ EfiProcessorFamily80286 = 4,
+ EfiProcessorFamilyIntel386 = 5,
+ EfiProcessorFamilyIntel486 = 6,
+ EfiProcessorFamily8087 = 7,
+ EfiProcessorFamily80287 = 8,
+ EfiProcessorFamily80387 = 9,
+ EfiProcessorFamily80487 = 0x0A,
+ EfiProcessorFamilyPentium = 0x0B,
+ EfiProcessorFamilyPentiumPro = 0x0C,
+ EfiProcessorFamilyPentiumII = 0x0D,
+ EfiProcessorFamilyPentiumMMX = 0x0E,
+ EfiProcessorFamilyCeleron = 0x0F,
+ EfiProcessorFamilyPentiumIIXeon = 0x10,
+ EfiProcessorFamilyPentiumIII = 0x11,
+ EfiProcessorFamilyM1 = 0x12,
+ EfiProcessorFamilyM1Reserved1 = 0x13,
+ EfiProcessorFamilyM1Reserved2 = 0x14,
+ EfiProcessorFamilyM1Reserved3 = 0x15,
+ EfiProcessorFamilyM1Reserved4 = 0x16,
+ EfiProcessorFamilyM1Reserved5 = 0x17,
+ EfiProcessorFamilyM1Reserved6 = 0x18,
+ EfiProcessorFamilyK5 = 0x19,
+ EfiProcessorFamilyK5Reserved1 = 0x1A,
+ EfiProcessorFamilyK5Reserved2 = 0x1B,
+ EfiProcessorFamilyK5Reserved3 = 0x1C,
+ EfiProcessorFamilyK5Reserved4 = 0x1D,
+ EfiProcessorFamilyK5Reserved5 = 0x1E,
+ EfiProcessorFamilyK5Reserved6 = 0x1F,
+ EfiProcessorFamilyPowerPC = 0x20,
+ EfiProcessorFamilyPowerPC601 = 0x21,
+ EfiProcessorFamilyPowerPC603 = 0x22,
+ EfiProcessorFamilyPowerPC603Plus = 0x23,
+ EfiProcessorFamilyPowerPC604 = 0x24,
+ EfiProcessorFamilyAlpha2 = 0x30,
+ EfiProcessorFamilyMips = 0x40,
+ EfiProcessorFamilySparc = 0x50,
+ EfiProcessorFamily68040 = 0x60,
+ EfiProcessorFamily68xxx = 0x61,
+ EfiProcessorFamily68000 = 0x62,
+ EfiProcessorFamily68010 = 0x63,
+ EfiProcessorFamily68020 = 0x64,
+ EfiProcessorFamily68030 = 0x65,
+ EfiProcessorFamilyHobbit = 0x70,
+ EfiProcessorFamilyWeitek = 0x80,
+ EfiProcessorFamilyPARISC = 0x90,
+ EfiProcessorFamilyV30 = 0xA0,
+ EfiProcessorFamilyPentiumIIIXeon = 0xB0,
+ EfiProcessorFamilyPentiumIIISpeedStep = 0xB1,
+ EfiProcessorFamilyPentium4 = 0xB2,
+ EfiProcessorFamilyIntelXeon = 0xB3,
+ EfiProcessorFamilyAS400 = 0xB4,
+ EfiProcessorFamilyIntelXeonMP = 0xB5,
+ EfiProcessorFamilyAMDAthlonXP = 0xB6,
+ EfiProcessorFamilyAMDAthlonMP = 0xB7,
+ EfiProcessorFamilyIBM390 = 0xC8,
+ EfiProcessorFamilyG4 = 0xC9,
+ EfiProcessorFamilyG5 = 0xCA,
+ EfiProcessorFamilyi860 = 0xFA,
+ EfiProcessorFamilyi960 = 0xFB
+} EFI_PROCESSOR_TYPE;
+
+
+
+//Volatage
+#define EFI_PROCESSOR_VOLTAGE_RECORD_NUMBER 0x00000009
+typedef EFI_EXP_BASE10_DATA EFI_PROCESSOR_VOLTAGE_DATA;
+
+//Processor APIC ID
+#define EFI_PROCESSOR_APIC_ID_RECORD_NUMBER 0x0000000B
+typedef UINT32 EFI_PROCESSOR_APIC_ID_DATA;
+
+
+//APIC Version Number
+#define EFI_PROCESSOR_APIC_VER_NUMBER_RECORD_NUMBER 0x0000000C
+typedef UINT32 EFI_PROCESSOR_APIC_VERSION_NUMBER_DATA;
+
+
+//Microcode Update Revision
+#define EFI_PROCESSOR_MICROCODE_REVISION_RECORD_NUMBER 0x0000000D
+
+typedef enum {
+ EfiProcessorIa32Microcode = 1,
+ EfiProcessorIpfPalAMicrocode = 2,
+ EfiProcessorIpfPalBMicrocode = 3,
+} EFI_PROCESSOR_MICROCODE_TYPE;
+
+typedef struct {
+ EFI_PROCESSOR_MICROCODE_TYPE ProcessorMicrocodeType;
+ UINT32 ProcessorMicrocodeRevisionNumber;
+} EFI_PROCESSOR_MICROCODE_REVISION_DATA;
+
+
+
+//Processor Status
+#define EFI_PROCESSOR_STATUS_RECORD_NUMBER 0x0000000E
+
+typedef struct {
+ UINT32 CpuStatus :3;
+ UINT32 Reserved :3;
+ UINT32 SocketPopulated :1;
+ UINT32 Reserved2 :1;
+ UINT32 ApicEnable :1;
+ UINT32 BootApplicationProcessor :1;
+ UINT32 Reserved3 :22;
+} EFI_PROCESSOR_STATUS_DATA;
+
+typedef enum {
+ EfiCpuStatusUnknown = 0,
+ EfiCpuStatusEnabled = 1,
+ EfiCpuStatusDisabledByUser = 2,
+ EfiCpuStatusDisabledbyBios = 3,
+ EfiCpuStatusIdle = 4,
+ EfiCpuStatusOther = 7
+} EFI_CPU_STATUS;
+
+//Socket Type
+#define EFI_PROCESSOR_SOCKET_TYPE_RECORD_NUMBER 0x0000000F
+
+typedef enum {
+ EfiProcessorSocketOther = 1,
+ EfiProcessorSocketUnknown = 2,
+ EfiProcessorSocketDaughterBoard = 3,
+ EfiProcessorSocketZIF = 4,
+ EfiProcessorSocketReplacePiggyBack = 5,
+ EfiProcessorSocketNone = 6,
+ EfiProcessorSocketLIF = 7,
+ EfiProcessorSocketSlot1 = 8,
+ EfiProcessorSocketSlot2 = 9,
+ EfiProcessorSocket370Pin = 0xA,
+ EfiProcessorSocketSlotA = 0xB,
+ EfiProcessorSocketSlotM = 0xC,
+ EfiProcessorSocket423 = 0xD,
+ EfiProcessorSocketA462 = 0xE,
+ EfiProcessorSocket478 = 0xF
+} EFI_PROCESSOR_SOCKET_TYPE_DATA;
+
+
+//Socket Name
+#define EFI_PROCESSOR_SOCKET_NAME_RECORD_NUMBER 0x00000010
+typedef STRING_REF EFI_PROCESSOR_SOCKET_NAME_DATA;
+
+
+//Cache Association
+#define EFI_SUBCLASS_ASSOCIATION_RECORD_NUMBER 0x00000011
+typedef EFI_INTER_LINK_DATA EFI_CACHE_ASSOCIATION_DATA;
+
+//Processor Maximum Frequency
+#define EFI_PROCESSOR_MAX_FREQUENCY_RECORD_NUMBER 0x00000012
+typedef EFI_EXP_BASE10_DATA EFI_PROCESSOR_MAX_FREQUENCY_DATA;
+
+
+//Processor Asset Tag
+#define EFI_PROCESSOR_ASSET_TAG_RECORD_NUMBER 0x000000013
+typedef STRING_REF EFI_PROCESSOR_ASSET_TAG_DATA;
+
+
+//Processor Maximum Bus Frequency
+#define EFI_PROCESSOR_MAX_FSB_FREQUENCY_RECORD_NUMBER 0x000000014
+typedef EFI_EXP_BASE10_DATA EFI_PROCESSOR_MAX_FSB_FREQUENCY_DATA;
+
+
+//Processor Package Number
+#define EFI_PROCESSOR_PACKAGE_NUMBER_RECORD_NUMBER 0x00000015
+typedef UINTN EFI_PROCESSOR_PACKAGE_NUMBER_DATA;
+
+//Core Frequency List
+#define EFI_PROCESSOR_FREQUENCY_LIST_RECORD_NUMBER 0x00000016
+typedef EFI_EXP_BASE10_DATA *EFI_PROCESSOR_CORE_FREQUENCY_LIST_DATA;
+
+
+//Front Side Bus Frequency List
+#define EFI_PROCESSOR_BUS_FREQUENCY_LIST_RECORD_NUMBER 0x00000017
+typedef EFI_EXP_BASE10_DATA *EFI_PROCESSOR_FSB_FREQUENCY_LIST_DATA;
+
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2005, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
diff --git a/Include/Protocol/AMIPostMgr.h b/Include/Protocol/AMIPostMgr.h
new file mode 100644
index 0000000..b3e0974
--- /dev/null
+++ b/Include/Protocol/AMIPostMgr.h
@@ -0,0 +1,510 @@
+//*****************************************************************//
+//*****************************************************************//
+//*****************************************************************//
+//** **//
+//** (C)Copyright 2013, American Megatrends, Inc. **//
+//** **//
+//** All Rights Reserved. **//
+//** **//
+//** 5555 Oakbrook Pkwy, Building 200,Norcross, Georgia 30093 **//
+//** **//
+//** Phone (770)-246-8600 **//
+//** **//
+//*****************************************************************//
+//*****************************************************************//
+//*****************************************************************//
+// $Archive: /Alaska/BIN/Modules/AMITSE2_0/AMITSE/Include/Protocol/AMIPostMgr.h $
+//
+// $Author: Arunsb $
+//
+// $Revision: 15 $
+//
+// $Date: 5/02/14 6:16a $
+//
+//*****************************************************************//
+//*****************************************************************//
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Modules/AMITSE2_0/AMITSE/Include/Protocol/AMIPostMgr.h $
+//
+// 15 5/02/14 6:16a Arunsb
+// [TAG] EIP128665
+// [Category] Improvement
+// [Description] Providing support to invalidate the BGRT status bit.
+// [Files] protocol.c and amivfr.h
+//
+// 14 2/11/14 7:29p Arunsb
+// Reverted the changes for 2.16.1243 label
+//
+// 13 9/13/13 2:04p Premkumara
+// Uploaded back for EIP-128665 after TSEBootOnly 1240 release
+// Files - Protocol.c, Protocol.h, AMIPostMgr.h
+//
+// 12 8/26/13 2:18a Premkumara
+// Reverted back for BootOnly1240 release
+//
+// 10 10/18/12 5:44a Arunsb
+// Updated for 2.16.1235 QA submission
+//
+// 11 10/10/12 12:24p Arunsb
+// Synched the source for v2.16.1232 backup with Aptio
+//
+// 9 11/10/11 7:17p Blaines
+// [TAG] - EIP 66860
+// [Category]- Function Request
+// [Synopsis]- AmiPostManager interface for text entry.
+// [Files] - LogoLib.h, AMIPostMgr.h, protocol.c, protocol.h,
+// TseAdvanced.c, TseLitehelper.c, TseUefiHii.h, Uefi21Wapper.c
+//
+// Added new parameter to the function prototype DISPLAY_TEXT_KEY_VALIDATE
+//
+// 8 9/29/11 7:00p Blaines
+// [TAG] - EIP 66860
+// [Category]- Function Request
+// [Synopsis]- AmiPostManager interface for text entry.
+// [Files] - LogoLib.h, AMIPostMgr.h, protocol.c, protocol.h,
+// TseAdvanced.c, TseLitehelper.c, TseUefiHii.h, Uefi21Wapper.c
+//
+// 7 12/02/10 12:10p Madhans
+// [TAG] - EIP 41838
+// [Category]- Enhancement
+// [Severity]- Mordarate
+// [Symptom]- Update AMI Post Manager Protocol witht he following. 2.
+// Updating the interface PostManagerDisplayPostMessageEx to handle the
+// cursor position properly. 2. Need to add new interface to GetAttribute
+// To keep the GetAttribute to end of protocol.
+// [Rootcause] - 1. Display string is over written by the next string if
+// the interface PostManagerDisplayPostMessageEx used simultaneously. 2.
+// Need to get the attribute info to use PostManagerDisplayPostMessage
+// interfaces effectively
+// [Solution]- Fix in string.c to handle cursor and line positions. The
+// files Protocol.c, Protocol.h and AmiPostMgr.h have the new interface
+// implementaion to get the attribute.
+// [Files] - Protocol.c, Protocol.h, AmiPostMgr.h and string.c
+//
+// 6 11/23/10 5:14p Blaines
+// [TAG] - EIP 45374
+// [Category]- Function Request
+// [Synopsis]- Need method to configure Post Menu programmatically, Items
+// requested
+// - Exit Keys
+// - Font Colors
+// - Background Colors.
+// [Solution]
+// - Create hook to set window color,
+// - Add AMI_POSTMENU_ATTRIB_EXIT_KEY attribute to POSTMENU_TEMPLATE to
+// configure exit keys.
+// [Files] - stylecommon.c, style.h, listbox.c, minisetupext.c,
+// AMIPostMgr.h
+//
+// [TAG] - EIP 47962
+// [Category]- Defect
+// [Symptom]- Post Manager's DisplayMsgBox displays a corrupted screen
+// When the French or Japanese langues are selected and a call is made to
+// DisplayMsgBox, the screen that is displayed is corrupted
+//
+// [Rootcause]
+// The bounding box area of the message box is drawn, which may not span
+// previous screen redraws.
+// Therefore, artifacts from previous screen displays may appear.
+// [Solution]- Clear the screen before drawing message box to clear
+// artifacts from previous screen redraws.
+// [Files] - TseAdvanced.c, AMIPostMgr.h,
+//
+// 5 11/16/10 9:00a Mallikarjunanv
+// [TAG] - EIP 41838
+// [Category]- Enhancement
+// [Severity]- Mordarate
+// [Symptom]- Update AMI Post Manager Protocol witht he following. 2.
+// Updating the interface PostManagerDisplayPostMessageEx to handle the
+// cursor position properly. 2. Need to add new interface to GetAttribute
+// [Rootcause] - 1. Display string is over written by the next string if
+// the interface PostManagerDisplayPostMessageEx used simultaneously. 2.
+// Need to get the attribute info to use PostManagerDisplayPostMessage
+// interfaces effectively
+// [Solution]- Fix in string.c to handle cursor and line positions. The
+// files Protocol.c, Protocol.h and AmiPostMgr.h have the new interface
+// implementaion to get the attribute.
+// [Files] - Protocol.c, Protocol.h, AmiPostMgr.h and string.c
+//
+// 4 4/16/10 5:11p Madhans
+// Changes for Tse 2.02. Please see Changelog.log for more details.
+//
+// 3 2/19/10 12:59p Madhans
+// Updated for TSE 2.01. Refer Changelog.log for File change history.
+//
+// 4 2/19/10 8:03a Mallikarjunanv
+// updated year in copyright message
+//
+// 3 2/04/10 12:01p Blaines
+// EIP-28005
+//
+// Added PostManagerSetAttribute to support display of text in color.
+// Added support for handling string characters --- \n, \r.
+//
+// 2 6/24/09 6:33p Madhans
+// Coding Standards.
+//
+// 2 6/24/09 11:55a Blaines
+// Coding standard update
+//
+// 1 6/09/09 9:53a Madhans
+// TSE 2.00.1201
+//
+// 1 6/04/09 7:49p Madhans
+// AMI TSE Advanced.
+//
+// 1 4/28/09 10:47p Madhans
+// Tse 2.0 Code complete Checkin.
+//
+// 4 4/28/09 9:41p Madhans
+// Tse 2.0 Code complete Checkin.
+//
+// 3 2/05/09 5:19p Madhans
+// PostMgrStatus interface added.
+//
+// 2 1/30/09 6:06p Madhans
+// Function headers added.
+//
+//
+//*****************************************************************//
+//*****************************************************************//
+//<AMI_FHDR_START>
+//----------------------------------------------------------------------------
+//
+// Name: AMIPostMgr.h
+//
+// Description: AMI post manager protocol related code
+//
+//----------------------------------------------------------------------------
+//<AMI_FHDR_END>
+
+#ifndef _AMI_POSTMGR_H_
+#define _AMI_POSTMGR_H_
+
+#define AMI_POST_MANAGER_PROTOCOL_GUID \
+ { 0x8A91B1E1, 0x56C7, 0x4ADC, 0xAB, 0xEB, 0x1C, 0x2C, 0xA1, 0x72, 0x9E, 0xFF }
+
+#ifndef EFI_PROTOCOL_DEFINITION
+#define TSE_STRINGIZE(a) #a
+#define EFI_PROTOCOL_DEFINITION(a) TSE_STRINGIZE(Protocol/a.h)
+#endif
+
+#include EFI_PROTOCOL_DEFINITION(GraphicsOutput)
+#include EFI_PROTOCOL_DEFINITION(SimpleTextIn)
+
+#define AMI_POSTMENU_ATTRIB_FOCUS 0
+#define AMI_POSTMENU_ATTRIB_NON_FOCUS 1
+#define AMI_POSTMENU_ATTRIB_HIDDEN 2
+#define AMI_POSTMENU_ATTRIB_EXIT_KEY 3
+
+#define TSE_WINDOW_TYPE_SETUP 0
+#define TSE_WINDOW_TYPE_POSTMENU 1
+
+#define TSE_FILTER_KEY_NULL 0
+#define TSE_FILTER_KEY_NUMERIC 1
+#define TSE_FILTER_KEY_ALPHA 2
+#define TSE_FILTER_KEY_ALPHANUMERIC 3
+#define TSE_FILTER_KEY_CUSTOM 4
+
+
+typedef struct {
+ EFI_INPUT_KEY Key;
+ UINT32 KeyShiftState;
+} AMI_POST_MGR_KEY;
+
+typedef struct _TEXT_INPUT_TEMPLATE
+{
+ UINT16 ItemToken;
+ UINT8 MaxSize;
+ UINT8 FilterKey;
+ BOOLEAN Hidden;
+ CHAR16 *Value;
+}
+TEXT_INPUT_TEMPLATE;
+
+typedef VOID (EFIAPI *POSTMENU_FUNCTION) (VOID *CallbackContext);
+
+typedef struct _POSTMENU_TEMPLATE
+{
+ UINT16 ItemToken;
+ AMI_POST_MGR_KEY Key;
+ POSTMENU_FUNCTION Callback;
+ VOID *CallbackContext;
+ UINT8 Attribute;
+}
+POSTMENU_TEMPLATE;
+
+typedef EFI_GRAPHICS_OUTPUT_BLT_PIXEL EFI_UGA_PIXEL;
+
+typedef enum _CO_ORD_ATTRIBUTE {
+CA_AttributeLeftTop,
+CA_AttributeCenterTop,
+CA_AttributeRightTop,
+CA_AttributeRightCenter,
+CA_AttributeRightBottom,
+CA_AttributeCenterBottom,
+CA_AttributeLeftBottom,
+CA_AttributeLeftCenter,
+CA_AttributeCenter,
+CA_AttributeCustomised
+}CO_ORD_ATTRIBUTE;
+
+typedef
+EFI_STATUS
+(EFIAPI *AMI_POST_MANAGER_HANDSHAKE) (
+ VOID
+ );
+
+typedef
+EFI_STATUS
+(EFIAPI *AMI_POST_MANAGER_DISPLAY_MESSAGE) (
+ CHAR16 *Message
+ );
+
+typedef
+EFI_STATUS
+(EFIAPI *AMI_POST_MANAGER_DISPLAY_MESSAGE_EX) (
+ CHAR16 *Message,
+ UINTN Attribute
+ );
+
+typedef
+BOOLEAN
+(EFIAPI *DISPLAY_TEXT_KEY_VALIDATE) (
+ UINT16 ItemIndex,
+ UINT16 Unicode,
+ CHAR16 *Value
+);
+
+//Post message ex attributes
+#define PM_EX_DONT_ADVANCE_TO_NEXT_LINE 0x00000001
+
+typedef
+EFI_STATUS
+(EFIAPI *AMI_POST_MANAGER_DISPLAY_QUIETBOOT_MESSAGE) (
+ CHAR16 *Message,
+ INTN CoOrdX,
+ INTN CoOrdY,
+ CO_ORD_ATTRIBUTE Attribute,
+ EFI_UGA_PIXEL Foreground,
+ EFI_UGA_PIXEL Background
+ );
+
+//Message box types
+#define MSGBOX_TYPE_NULL 0
+#define MSGBOX_TYPE_OK 1
+#define MSGBOX_TYPE_OKCANCEL 2
+#define MSGBOX_TYPE_YESNO 3
+#define MSGBOX_TYPE_CUSTOM 4
+//Message box result buttons
+#define MSGBOX_OK 0
+#define MSGBOX_CANCEL 1
+#define MSGBOX_YES 0
+#define MSGBOX_NO 1
+typedef enum _MSGBOX_EX_CATAGORY {
+MSGBOX_EX_CATAGORY_NORMAL,
+MSGBOX_EX_CATAGORY_HELP,
+MSGBOX_EX_CATAGORY_QUERY,
+MSGBOX_EX_CATAGORY_SUCCESS,
+MSGBOX_EX_CATAGORY_WARNING,
+MSGBOX_EX_CATAGORY_ERROR,
+MSGBOX_EX_CATAGORY_HALT,
+MSGBOX_EX_CATAGORY_PROGRESS,
+MSGBOX_EX_ATTRIB_CLEARSCREEN=0x1000,
+} MSGBOX_EX_CATAGORY;
+
+typedef
+EFI_STATUS
+(EFIAPI *AMI_POST_MANAGER_DISPLAY_MSG_BOX) (
+ IN CHAR16 *MsgBoxTitle,
+ IN CHAR16 *Message,
+ IN UINT8 MsgBoxType,
+ OUT UINT8 *MsgBoxSel
+ );
+
+typedef
+EFI_STATUS
+(EFIAPI *AMI_POST_MANAGER_DISPLAY_TEXT_BOX) (
+ IN VOID *HiiHandle,
+ IN UINT16 TitleToken,
+ IN TEXT_INPUT_TEMPLATE *InputData,
+ IN UINT16 ItemCount,
+ IN DISPLAY_TEXT_KEY_VALIDATE DisplayTextKeyValidate
+ );
+
+
+
+typedef
+EFI_STATUS
+(EFIAPI *AMI_POST_MANAGER_SWITCH_TO_POST_SCREEN) (VOID);
+
+typedef
+EFI_STATUS
+(EFIAPI *AMI_POST_MANAGER_SET_CURSOR_POSITION) (
+ UINTN X,
+ UINTN Y
+ );
+
+typedef
+EFI_STATUS
+(EFIAPI *AMI_POST_MANAGER_GET_CURSOR_POSITION) (
+ UINTN *pX,
+ UINTN *pY
+ );
+
+typedef
+EFI_STATUS
+(EFIAPI *AMI_POST_MANAGER_INIT_PROGRESSBAR) (
+ UINTN x,
+ UINTN y,
+ UINTN w,
+ UINTN h,
+ UINTN delta
+ );
+
+
+typedef
+EFI_STATUS
+(EFIAPI *AMI_POST_MANAGER_SET_PROGRESSBAR_POSITION) (
+ );
+
+typedef
+EFI_STATUS
+(EFIAPI *AMI_POST_MANAGER_SET_ATTRIBUTE) (
+ UINT8 Attrib
+ );
+
+typedef
+EFI_STATUS
+(EFIAPI *AMI_POST_MANAGER_GET_ATTRIBUTE) (
+ UINT8 *Attrib
+ );
+
+
+typedef enum _TSE_POST_STATUS {
+TSE_POST_STATUS_BEFORE_POST_SCREEN, // TSE Loaded and yet goto post screen
+TSE_POST_STATUS_IN_POST_SCREEN, // In the post screen
+TSE_POST_STATUS_IN_QUITE_BOOT_SCREEN, // In the quite boot screen
+TSE_POST_STATUS_IN_BOOT_TIME_OUT, // Witing for Boot timeout
+TSE_POST_STATUS_ENTERING_TSE, // Entering TSE
+TSE_POST_STATUS_IN_TSE, // Inside TSE
+TSE_POST_STATUS_IN_BBS_POPUP, // Inside BBS Poupup
+TSE_POST_STATUS_PROCEED_TO_BOOT // Outside TSE and Booting or in Shell
+}TSE_POST_STATUS;
+
+typedef
+TSE_POST_STATUS
+(EFIAPI *AMI_POST_MANAGER_POST_STATUS) (
+ );
+
+typedef
+EFI_STATUS
+(EFIAPI *AMI_POST_MANAGER_DISPLAY_INFO_BOX) (
+ IN CHAR16 *InfoBoxTitle,
+ IN CHAR16 *InfoString,
+ IN UINTN Timeout,
+ OUT EFI_EVENT *Event
+ );
+
+typedef
+EFI_STATUS
+(EFIAPI *AMI_POST_MANAGER_DISPLAY_MSG_BOX_EX) (
+ IN CHAR16 *Title,
+ IN CHAR16 *Message,
+ IN CHAR16 *Legend,
+ IN MSGBOX_EX_CATAGORY MsgBoxExCatagory,
+ IN UINT8 MsgBoxType,
+ IN UINT16 *OptionPtrTokens, // Valid only with MSGBOX_TYPE_CUSTOM
+ IN UINT16 OptionCount, // Valid only with MSGBOX_TYPE_CUSTOM
+ IN AMI_POST_MGR_KEY *HotKeyList, // NULL - AnyKeyPress closes
+ IN UINT16 HotKeyListCount,
+ OUT UINT8 *MsgBoxSel,
+ OUT AMI_POST_MGR_KEY *OutKey
+);
+
+// ProgressBoxState
+#define AMI_PROGRESS_BOX_INIT 1
+#define AMI_PROGRESS_BOX_UPDATE 2
+#define AMI_PROGRESS_BOX_CLOSE 3
+
+typedef
+EFI_STATUS
+(EFIAPI *AMI_POST_MANAGER_DRAW_PROGRESS_BOX) (
+IN UINT8 ProgressBoxState,
+IN CHAR16 *Title,
+IN CHAR16 *Message,
+IN CHAR16 *Legend,
+IN UINTN Percent, // 0 - 100
+IN OUT VOID **Handle, //Out HANDLE. Valid Handle for update and close
+OUT AMI_POST_MGR_KEY *OutKey //Out Key
+);
+
+
+
+typedef
+EFI_STATUS
+(EFIAPI *AMI_POST_MANAGER_DISPLAY_MENU) (
+
+ IN VOID *HiiHandle,
+ IN UINT16 TitleToken,
+ IN UINT16 LegendToken,
+ IN POSTMENU_TEMPLATE *MenuData,
+ IN UINT16 MenuCount,
+ OUT UINT16 *pSelection
+);
+
+
+typedef struct _AMI_POST_MANAGER_PROTOCOL
+{
+ AMI_POST_MANAGER_HANDSHAKE Handshake;
+ AMI_POST_MANAGER_DISPLAY_MESSAGE DisplayPostMessage;
+ AMI_POST_MANAGER_DISPLAY_MESSAGE_EX DisplayPostMessageEx;
+ AMI_POST_MANAGER_DISPLAY_QUIETBOOT_MESSAGE DisplayQuietBootMessage;
+ AMI_POST_MANAGER_DISPLAY_MSG_BOX DisplayMsgBox;
+ AMI_POST_MANAGER_SWITCH_TO_POST_SCREEN SwitchToPostScreen;
+ AMI_POST_MANAGER_SET_CURSOR_POSITION SetCurPos;
+ AMI_POST_MANAGER_GET_CURSOR_POSITION GetCurPos;
+ AMI_POST_MANAGER_INIT_PROGRESSBAR InitProgressBar;
+ AMI_POST_MANAGER_SET_PROGRESSBAR_POSITION SetProgressBarPosition;
+ AMI_POST_MANAGER_POST_STATUS GetPostStatus;
+ AMI_POST_MANAGER_DISPLAY_INFO_BOX DisplayInfoBox;
+ AMI_POST_MANAGER_SET_ATTRIBUTE SetAttribute;
+ AMI_POST_MANAGER_DISPLAY_MENU DisplayPostMenu;
+ AMI_POST_MANAGER_DISPLAY_MSG_BOX_EX DisplayMsgBoxEx;
+ AMI_POST_MANAGER_DRAW_PROGRESS_BOX DisplayProgress;
+ AMI_POST_MANAGER_GET_ATTRIBUTE GetAttribute; //EIP-41838: New interface to get the attribute value
+ AMI_POST_MANAGER_DISPLAY_TEXT_BOX DisplayTextBox;
+}
+AMI_POST_MANAGER_PROTOCOL;
+
+extern EFI_GUID gAmiPostManagerProtocolGuid;
+
+//EIP 128665 starts
+#define TSE_INVALIDATE_BGRT_STATUS_PROTOCOL_GUID \
+ { 0x73905351, 0xeb4d, 0x4637, 0xa8, 0x3b, 0xd1, 0xbf, 0x6c, 0x1c, 0x48, 0xeb }
+
+typedef EFI_STATUS (EFIAPI *INVALIDATE_BGRT_STATUS) (void);
+typedef struct _TSE_INVALIDATE_BGRT_STATUS_PROTOCOL
+{
+ INVALIDATE_BGRT_STATUS InvalidateBgrtStatusByProtocol;
+}TSE_INVALIDATE_BGRT_STATUS_PROTOCOL;
+
+extern EFI_GUID gTSEInvalidateBgrtStatusProtocolGuid;
+///EIP 128665 ends
+
+#endif /* _AMI_POSTMGR_H_ */
+
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2010, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Pkwy, Building 200,Norcross, Georgia 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
diff --git a/Include/Protocol/AbsPointerProtocol.h b/Include/Protocol/AbsPointerProtocol.h
new file mode 100644
index 0000000..d08ab4b
--- /dev/null
+++ b/Include/Protocol/AbsPointerProtocol.h
@@ -0,0 +1,129 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2010, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Pkwy, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+// $Header: /Alaska/BIN/Core/Include/Protocol/AbsPointerProtocol.h 1 4/15/10 3:58a Rameshr $
+//
+// $Revision: 1 $
+//
+// $Date: 4/15/10 3:58a $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Core/Include/Protocol/AbsPointerProtocol.h $
+//
+// 1 4/15/10 3:58a Rameshr
+// Initial Check-in
+//
+//
+//**********************************************************************
+
+//<AMI_FHDR_START>
+//--------------------------------------------------------------------------
+//
+// Name: AbsPointerProtocol.h
+//
+// Description: Absolute Pointer Protocol
+//
+//--------------------------------------------------------------------------
+//<AMI_FHDR_END>
+
+#ifndef __EFI_ABSOLUTE_POINTER_PROTOCOL_H__
+#define __EFI_ABSOLUTE_POINTER_PROTOCOL_H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <EFI.h>
+
+#define EFI_ABSOLUTE_POINTER_PROTOCOL_GUID \
+{0x8D59D32B, 0xC655, 0x4AE9, 0x9B, 0x15, 0xF2, 0x59, 0x04, 0x99, 0x2A, 0x43};
+
+GUID_VARIABLE_DECLARATION(gEfiAbsolutePointerProtocolGuid,EFI_ABSOLUTE_POINTER_PROTOCOL_GUID);
+
+// Forward declaration
+typedef struct _EFI_ABSOLUTE_POINTER_PROTOCOL EFI_ABSOLUTE_POINTER_PROTOCOL;
+
+#define EFI_ABSP_SupportsAltActive 0x00000001
+#define EFI_ABSP_SupportsPressureAsZ 0x00000002
+
+//
+//definitions of bits within ActiveButtons
+//
+#define EFI_ABSP_TouchActive 0x00000001
+#define EFI_ABS_AltActive 0x00000002
+
+//
+// EFI_ABSOLUTE_POINTER_STATE
+//
+typedef struct {
+ UINT64 CurrentX;
+ UINT64 CurrentY;
+ UINT64 CurrentZ;
+ UINT32 ActiveButtons;
+} EFI_ABSOLUTE_POINTER_STATE;
+
+//
+// EFI_ABSOLUTE_POINTER_MODE
+//
+typedef struct {
+ UINT64 AbsoluteMinX;
+ UINT64 AbsoluteMinY;
+ UINT64 AbsoluteMinZ;
+ UINT64 AbsoluteMaxX;
+ UINT64 AbsoluteMaxY;
+ UINT64 AbsoluteMaxZ;
+ UINT32 Attributes;
+} EFI_ABSOLUTE_POINTER_MODE;
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_ABSOLUTE_POINTER_RESET) (
+ IN EFI_ABSOLUTE_POINTER_PROTOCOL * This,
+ IN BOOLEAN ExtendedVerification
+ );
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_ABSOLUTE_POINTER_GET_STATE) (
+ IN EFI_ABSOLUTE_POINTER_PROTOCOL * This,
+ IN OUT EFI_ABSOLUTE_POINTER_STATE * State
+ );
+
+typedef struct _EFI_ABSOLUTE_POINTER_PROTOCOL {
+ EFI_ABSOLUTE_POINTER_RESET Reset;
+ EFI_ABSOLUTE_POINTER_GET_STATE GetState;
+ EFI_EVENT WaitForInput;
+ EFI_ABSOLUTE_POINTER_MODE *Mode;
+} EFI_ABSOLUTE_POINTER_PROTOCOL;
+
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2010, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Pkwy, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+
diff --git a/Include/Protocol/AcousticProtocol.cif b/Include/Protocol/AcousticProtocol.cif
new file mode 100644
index 0000000..be40894
--- /dev/null
+++ b/Include/Protocol/AcousticProtocol.cif
@@ -0,0 +1,8 @@
+<component>
+ name = "AcousticProtocol"
+ category = ModulePart
+ LocalRoot = "Include\Protocol"
+ RefName = "AcousticProtocol"
+[files]
+"AcousticProtocol.h"
+<endComponent>
diff --git a/Include/Protocol/AcousticProtocol.h b/Include/Protocol/AcousticProtocol.h
new file mode 100644
index 0000000..1ea3332
--- /dev/null
+++ b/Include/Protocol/AcousticProtocol.h
@@ -0,0 +1,101 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2010, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Pkwy, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+//**********************************************************************
+// $Header: /Alaska/SOURCE/Modules/HddAcoustic/AcousticProtocol.h 2 2/10/11 11:31a Pats $
+//
+// $Revision: 2 $
+//
+// $Date: 2/10/11 11:31a $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/SOURCE/Modules/HddAcoustic/AcousticProtocol.h $
+//
+// 2 2/10/11 11:31a Pats
+// [TAG] - EIP 52920
+// [Category]- Function Request
+// [Severity]- Minor
+// [Symptom] - The Acoustic mode (Bypass/Quiet/Max Performance) of port 5
+// is invalid on AMD SB700.
+// [RootCause] - Special case where 2nd controller counts by incrementing
+// device number only not handled properly
+// [Solution] - Added another item (ControllerNumber) to protocol.
+// [Files] - Acoustic.c, AcousticBoard.c, AcousticSetup.c,
+// AcousticProtocol.n
+//
+// 1 1/05/11 12:22a Rameshr
+// Initial check-in for Hdd Acoustic Management Support.
+//
+//**********************************************************************
+
+//<AMI_FHDR_START>
+//--------------------------------------------------------------------------
+//
+// Name: AcousticProtocol.h
+//
+// Description: Header file that has protocol structure for Acoustic Module.
+//
+//--------------------------------------------------------------------------
+//<AMI_FHDR_END>
+
+#ifndef _AcousticProtocol_H
+#define _AcousticProtocol_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <Efi.h>
+
+#define ACOUSTIC_SETUP_PROTOCOL_GUID\
+ { 0xc1d7859d, 0x5719, 0x46c3, 0xa2, 0x98, 0xd0, 0x71, 0xe3, 0x2, 0x64, 0xd1 }
+
+// Equates used for Acoustic Flags
+#define ACOUSTIC_SUPPORT_DISABLE 0x00
+#define ACOUSTIC_SUPPORT_ENABLE 0x01
+#define ACOUSTIC_LEVEL_BYPASS 0xFF
+#define ACOUSTIC_LEVEL_MAXIMUM_PERFORMANCE 0xFE
+#define ACOUSTIC_LEVEL_QUIET 0x80
+
+typedef struct {
+ UINT8 DeviceCount; // Should be updated by the Protocol installer
+ UINT8 ControllerNumber;
+ UINT8 AcousticPwrMgmt;
+ UINT8 AcousticLevel;
+ UINT8 *DeviceDetected;
+ UINT8 *AcousticLevelIndv; // Each byte is for a port. For IDE mode it is PM, PS, SM and SS.
+ // If there is any translation it has to be done at a later stage.
+ UINT8 *AcousticSupportIndv;
+}ACOUSTIC_SETUP_PROTOCOL;
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2010, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
diff --git a/Include/Protocol/AcpiSupport.h b/Include/Protocol/AcpiSupport.h
new file mode 100644
index 0000000..ed25c33
--- /dev/null
+++ b/Include/Protocol/AcpiSupport.h
@@ -0,0 +1,124 @@
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/BIN/Core/Include/Protocol/AcpiSupport.h 9 6/16/11 3:26p Felixp $Revision: 6 $
+//
+// $Date: 6/16/11 3:26p $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Core/Include/Protocol/AcpiSupport.h $
+//
+// 9 6/16/11 3:26p Felixp
+// Surround backward compatibility definitions with #if
+// BACKWARD_COMPATIBLE_MODE
+//
+// 8 5/27/11 5:53p Felixp
+// Headers are updated to improve separation of the Framework and PI
+// interfaces.
+// The definitions that will be removed in the future versions are marked
+// with the comments.
+//
+//**********************************************************************
+//<AMI_FHDR_START>
+//
+// Name: AcpiSupport.h
+//
+// Description: Definition of the ACPI Support protocol.
+// This is defined in the Tiano ACPI External
+// Product Specification, revision 0.5.1.
+//
+//**********************************************************************
+#ifndef __ACPI_SUPPORT_PROTOCOL_H__
+#define __ACPI_SUPPORT_PROTOCOL_H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+/****** DO NOT WRITE ABOVE THIS LINE *******/
+//**********************************************************************
+#include <EFI.h>
+
+// ACPI Support Protocol GUID
+#define EFI_ACPI_SUPPORT_GUID \
+ {0xdbff9d55, 0x89b7, 0x46da, 0xbd, 0xdf, 0x67, 0x7d, 0x3d, 0xc0, 0x24, 0x1d }
+
+GUID_VARIABLE_DECLARATION(gEfiAcpiSupportGuid,EFI_ACPI_SUPPORT_GUID);
+
+#include <Protocol/AcpiSystemDescriptionTable.h>
+
+// Forward reference
+typedef struct _EFI_ACPI_SUPPORT_PROTOCOL EFI_ACPI_SUPPORT_PROTOCOL;
+
+//**********************************************************************
+// Protocol Data Definitions
+#define EFI_ACPI_TABLE_VERSION_X (EFI_ACPI_TABLE_VERSION_2_0 | EFI_ACPI_TABLE_VERSION_3_0 | EFI_ACPI_TABLE_VERSION_4_0)
+#define EFI_ACPI_TABLE_VERSION_ALL (EFI_ACPI_TABLE_VERSION_1_0B|EFI_ACPI_TABLE_VERSION_X)
+
+//**********************************************************************
+// Protocol Member Functions
+//**********************************************************************
+
+// Retrieve a copy of an ACPI table and the handle of the table.
+typedef EFI_STATUS (EFIAPI *EFI_ACPI_GET_ACPI_TABLE) (
+ IN EFI_ACPI_SUPPORT_PROTOCOL *This,
+ IN INTN Index,
+ OUT VOID **Table,
+ OUT EFI_ACPI_TABLE_VERSION *Version,
+ OUT UINTN *Handle );
+
+// Add, update, or remove a table.
+typedef EFI_STATUS (EFIAPI *EFI_ACPI_SET_ACPI_TABLE) (
+ IN EFI_ACPI_SUPPORT_PROTOCOL *This,
+ IN VOID *Table OPTIONAL,
+ IN BOOLEAN Checksum,
+ IN EFI_ACPI_TABLE_VERSION Version,
+ IN OUT UINTN *Handle );
+
+// Publish tables to the outside world
+typedef EFI_STATUS (EFIAPI *EFI_ACPI_PUBLISH_TABLES) (
+ IN EFI_ACPI_SUPPORT_PROTOCOL *This,
+ IN EFI_ACPI_TABLE_VERSION Version );
+
+// ACPI Support Protocol
+typedef struct _EFI_ACPI_SUPPORT_PROTOCOL {
+ EFI_ACPI_GET_ACPI_TABLE GetAcpiTable;
+ EFI_ACPI_SET_ACPI_TABLE SetAcpiTable;
+ EFI_ACPI_PUBLISH_TABLES PublishTables;
+} EFI_ACPI_SUPPORT_PROTOCOL;
+
+#if BACKWARD_COMPATIBLE_MODE
+#include <Protocol/AcpiTable.h>
+#endif
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+
+#endif //_ACPI_SUPPORT_PROTOCOL_H
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
+
diff --git a/Include/Protocol/AcpiSystemDescriptionTable.h b/Include/Protocol/AcpiSystemDescriptionTable.h
new file mode 100644
index 0000000..7af72e2
--- /dev/null
+++ b/Include/Protocol/AcpiSystemDescriptionTable.h
@@ -0,0 +1,209 @@
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
+
+//*************************************************************************
+// $Header: /Alaska/BIN/Core/Include/Protocol/AcpiSystemDescriptionTable.h 1 5/27/11 5:52p Felixp $
+//
+// $Revision: 1 $
+//
+// $Date: 5/27/11 5:52p $
+//*************************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Core/Include/Protocol/AcpiSystemDescriptionTable.h $
+//
+// 1 5/27/11 5:52p Felixp
+//
+// 1 5/13/11 4:50p Yakovlevs
+// [TAG] EIP 56526
+// [Category] New Feature
+// [Description] ACPI Manipulation Protocol Initial Checkin
+
+//*************************************************************************
+//<AMI_FHDR_START>
+//
+// Name: AcpiSystemDescriptionTable.h
+//
+// Description:
+// Definition of PI 1.2 Vol 5 ACPI System Description Table Protocol.
+//
+//<AMI_FHDR_END>
+//*************************************************************************
+
+#ifndef __ACPI_SYSTEM_DESCRIPTION_TABLE_H___
+#define __ACPI_SYSTEM_DESCRIPTION_TABLE_H___
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <Efi.h>
+
+#define EFI_ACPI_SDT_PROTOCOL_GUID \
+ { 0xeb97088e, 0xcfdf, 0x49c6, 0xbe, 0x4b, 0xd9, 0x6, 0xa5, 0xb2, 0xe, 0x86 }
+
+GUID_VARIABLE_DECLARATION(gEfiAcpiSdtProtocolGuid, EFI_ACPI_SDT_PROTOCOL_GUID);
+
+typedef UINT32 EFI_ACPI_TABLE_VERSION;
+typedef VOID *EFI_ACPI_HANDLE;
+
+//**********************************************************************
+// ACPI Version bitmap definition:
+//
+// EFI_ACPI_TABLE_VERSION_1_0B - ACPI Version 1.0b (not supported curently)
+// EFI_ACPI_TABLE_VERSION_2_0 - ACPI Version 2.0
+// EFI_ACPI_TABLE_VERSION_NONE - No ACPI Versions. This might be used
+// to create memory-based operation regions or other information
+// that is not part of the ACPI "tree" but must still be found
+// in ACPI memory space and/or managed by the core ACPI driver.
+//
+//**********************************************************************
+#define EFI_ACPI_TABLE_VERSION_NONE (1 << 0)
+#define EFI_ACPI_TABLE_VERSION_1_0B (1 << 1)
+#define EFI_ACPI_TABLE_VERSION_2_0 (1 << 2)
+#define EFI_ACPI_TABLE_VERSION_3_0 (1 << 3)
+#define EFI_ACPI_TABLE_VERSION_4_0 (1 << 4)
+
+typedef UINT32 EFI_ACPI_DATA_TYPE;
+#define EFI_ACPI_DATA_TYPE_NONE 0
+#define EFI_ACPI_DATA_TYPE_OPCODE 1
+#define EFI_ACPI_DATA_TYPE_NAME_STRING 2
+#define EFI_ACPI_DATA_TYPE_OP 3
+#define EFI_ACPI_DATA_TYPE_UINT 4
+#define EFI_ACPI_DATA_TYPE_STRING 5
+#define EFI_ACPI_DATA_TYPE_CHILD 6
+
+typedef struct {
+ UINT32 Signature;
+ UINT32 Length;
+ UINT8 Revision;
+ UINT8 Checksum;
+ CHAR8 OemId[6];
+ CHAR8 OemTableId[8];
+ UINT32 OemRevision;
+ UINT32 CreatorId;
+ UINT32 CreatorRevision;
+} EFI_ACPI_SDT_HEADER;
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_ACPI_NOTIFICATION_FN)(
+ IN EFI_ACPI_SDT_HEADER *Table, ///< A pointer to the ACPI table header.
+ IN EFI_ACPI_TABLE_VERSION Version, ///< The ACPI table's version.
+ IN UINTN TableKey ///< The table key for this ACPI table.
+);
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_ACPI_GET_ACPI_TABLE2)(
+ IN UINTN Index,
+ OUT EFI_ACPI_SDT_HEADER **Table,
+ OUT EFI_ACPI_TABLE_VERSION *Version,
+ OUT UINTN *TableKey
+);
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_ACPI_REGISTER_NOTIFY)(
+ IN BOOLEAN Register,
+ IN EFI_ACPI_NOTIFICATION_FN Notification
+);
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_ACPI_OPEN)(
+ IN VOID *Buffer,
+ OUT EFI_ACPI_HANDLE *Handle
+);
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_ACPI_OPEN_SDT)(
+ IN UINTN TableKey,
+ OUT EFI_ACPI_HANDLE *Handle
+);
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_ACPI_CLOSE)(
+ IN EFI_ACPI_HANDLE Handle
+);
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_ACPI_GET_CHILD)(
+ IN EFI_ACPI_HANDLE ParentHandle,
+ IN OUT EFI_ACPI_HANDLE *Handle
+);
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_ACPI_GET_OPTION)(
+ IN EFI_ACPI_HANDLE Handle,
+ IN UINTN Index,
+ OUT EFI_ACPI_DATA_TYPE *DataType,
+ OUT CONST VOID **Data,
+ OUT UINTN *DataSize
+);
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_ACPI_SET_OPTION)(
+ IN EFI_ACPI_HANDLE Handle,
+ IN UINTN Index,
+ IN CONST VOID *Data,
+ IN UINTN DataSize
+);
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_ACPI_FIND_PATH)(
+ IN EFI_ACPI_HANDLE HandleIn,
+ IN VOID *AcpiPath,
+ OUT EFI_ACPI_HANDLE *HandleOut
+);
+
+typedef struct _EFI_ACPI_SDT_PROTOCOL {
+ // Specifies the ACPI version supported by this protocol.
+ EFI_ACPI_TABLE_VERSION AcpiVersion;
+ EFI_ACPI_GET_ACPI_TABLE2 GetAcpiTable;
+ EFI_ACPI_REGISTER_NOTIFY RegisterNotify;
+ EFI_ACPI_OPEN Open;
+ EFI_ACPI_OPEN_SDT OpenSdt;
+ EFI_ACPI_CLOSE Close;
+ EFI_ACPI_GET_CHILD GetChild;
+ EFI_ACPI_GET_OPTION GetOption;
+ EFI_ACPI_SET_OPTION SetOption;
+ EFI_ACPI_FIND_PATH FindPath;
+} EFI_ACPI_SDT_PROTOCOL;
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+
+#endif // __ACPI_SYSTEM_DESCRIPTION_TABLE_H___
+
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
diff --git a/Include/Protocol/AcpiTable.h b/Include/Protocol/AcpiTable.h
new file mode 100644
index 0000000..8c0aaf0
--- /dev/null
+++ b/Include/Protocol/AcpiTable.h
@@ -0,0 +1,88 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/BIN/Core/Include/Protocol/AcpiTable.h 1 5/27/11 5:52p Felixp $
+//
+// $Revision: 1 $
+//
+// $Date: 5/27/11 5:52p $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Core/Include/Protocol/AcpiTable.h $
+//
+// 1 5/27/11 5:52p Felixp
+//
+// 6 1/13/10 2:13p Felixp
+//
+//**********************************************************************
+//<AMI_FHDR_START>
+//
+// Name: AcpiTable.h
+//
+// Description: AcpiTable Protocol
+//
+//<AMI_FHDR_END>
+//**********************************************************************
+#ifndef __ACPI_TABLE_PROTOCOL__H__
+#define __ACPI_TABLE_PROTOCOL__H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+#include <EFI.h>
+
+#define EFI_ACPI_TABLE_PROTOCOL_GUID \
+ { 0xffe06bdd, 0x6107, 0x46a6, 0x7b, 0xb2, 0x5a, 0x9c, 0x7e, 0xc5, 0x27, 0x5c }
+
+GUID_VARIABLE_DECLARATION(gEfiAcpiTableProtocolGuid,EFI_ACPI_TABLE_PROTOCOL_GUID);
+
+// Forward reference
+typedef struct _EFI_ACPI_TABLE_PROTOCOL EFI_ACPI_TABLE_PROTOCOL;
+
+typedef EFI_STATUS (EFIAPI *EFI_ACPI_TABLE_INSTALL_ACPI_TABLE)(
+ IN CONST EFI_ACPI_TABLE_PROTOCOL *This,
+ IN CONST VOID *AcpiTableBuffer,
+ IN UINTN AcpiTableBufferSize,
+ OUT UINTN *TableKey
+);
+
+typedef EFI_STATUS (EFIAPI *EFI_ACPI_TABLE_UNINSTALL_ACPI_TABLE)(
+ IN CONST EFI_ACPI_TABLE_PROTOCOL *This,
+ IN UINTN TableKey
+);
+
+struct _EFI_ACPI_TABLE_PROTOCOL {
+ EFI_ACPI_TABLE_INSTALL_ACPI_TABLE InstallAcpiTable;
+ EFI_ACPI_TABLE_UNINSTALL_ACPI_TABLE UninstallAcpiTable;
+};
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif // __ACPI_TABLE_PROTOCOL__H__
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//********************************************************************** \ No newline at end of file
diff --git a/Include/Protocol/AhciSmmProtocol.h b/Include/Protocol/AhciSmmProtocol.h
new file mode 100644
index 0000000..a93aca0
--- /dev/null
+++ b/Include/Protocol/AhciSmmProtocol.h
@@ -0,0 +1,183 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Pkwy, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+//**********************************************************************
+// $Header: /Alaska/SOURCE/Modules/AHCI/AhciSmm/AhciSmmProtocol.h 7 11/24/14 11:57p Kapilporwal $
+//
+// $Revision: 7 $
+//
+// $Date: 11/24/14 11:57p $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/SOURCE/Modules/AHCI/AhciSmm/AhciSmmProtocol.h $
+//
+// 7 11/24/14 11:57p Kapilporwal
+// [TAG] EIP191939
+// [Category] Improvement
+// [Description] Issue about BIG_REAL_MODE_MMIO_ACCESS of AHCI module
+// [Files] AI13.bin
+// AHCIACC.ASM
+// AhciInt13Dxe.c
+// AhciInt13Dxe.dxs
+// AhciInt13Smm.c
+// AhciInt13Smm.cif
+// AhciInt13Smm.dxs
+// AhciInt13Smm.h
+// AhciInt13Smm.mak
+// AhciInt13Smm.sdl
+// AInt13.c
+// Aint13.cif
+// AInt13.h
+// AhciSmm.c
+// AhciSmm.h
+// AhciSmmProtocol.h
+//
+// 6 5/05/11 7:39a Rameshr
+// [TAG] EIP51884
+// [Category] Bug Fix
+// [Severity] Minor
+// [Symptom] Build error in pervious EIP 51884 check-in
+// [RootCause] Atapi structure was missing.
+// [Solution] Added Atapi Structure into AHCI_BUS_SMM_PROTOCOL
+// [Files] AhciSmmProtocol.h
+//
+// 5 3/15/11 4:13a Rameshr
+// [TAG]- EIP 51884
+// [Category]- New Feature
+// [Description]- Added packet command function in AhciSMM for sending
+// command in SMM handler
+// [Files]- AhciSmm.c, AhciSmm.h, AhciSmmProtocols.h
+//
+// 4 2/11/11 4:12a Rameshr
+// [TAG] EIP53704
+// [Category] Improvement
+// [Description] AMI headers update for Alaska Ahci Driver
+// [Files] AhciSmmProtocol.h
+//
+// 3 5/07/10 2:31p Krishnakumarg
+// Updated the date in AMI header
+//
+// 2 5/07/10 11:48a Krishnakumarg
+// Updated the AMI Header
+//
+// 1 4/28/09 6:39p Rameshr
+// Initial Check-in
+//
+//
+//**********************************************************************
+
+//<AMI_FHDR_START>
+//--------------------------------------------------------------------------
+//
+// Name: AHCISmmProtocol.h
+//
+// Description: Protocol definition
+//
+//--------------------------------------------------------------------------
+//<AMI_FHDR_END>
+
+#ifndef _EFI_AHCI_SMM_PROTOCOLS_H_
+#define _EFI_AHCI_SMM_PROTOCOLS_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define AHCI_SMM_PROTOCOL_GUID \
+ {0xB2FA5764, 0x3B6E, 0x43D3, 0x91, 0xDF, 0x87, 0xD1, 0x5A, 0x3E, 0x56, 0x68}
+
+GUID_VARIABLE_DECLARATION(gAhciSmmProtocolGuid,AHCI_SMM_PROTOCOL_GUID);
+
+#ifndef GUID_VARIABLE_DEFINITION
+
+#include <Protocol\PAhciBus.h>
+
+typedef struct _AHCI_BUS_SMM_PROTOCOL AHCI_BUS_SMM_PROTOCOL;
+
+typedef EFI_STATUS (*EFI_AHCI_SMM_SATA_DEV_PIO_DATA_IN) (
+ IN AHCI_BUS_SMM_PROTOCOL *SataDevInterface,
+ IN OUT COMMAND_STRUCTURE *CommandStructure,
+ UINT8 PortNumber,
+ UINT8 PMPortNumber,
+ DEVICE_TYPE DeviceType,
+ IN BOOLEAN READWRITE
+
+);
+
+typedef EFI_STATUS (*EFI_AHCI_SMM_SATA_DEV_DMA_DATA_IN) (
+ IN AHCI_BUS_SMM_PROTOCOL *SataDevInterface,
+ IN OUT COMMAND_STRUCTURE *CommandStructure,
+ UINT8 PortNumber,
+ UINT8 PMPortNumber,
+ DEVICE_TYPE DeviceType,
+ IN BOOLEAN READWRITE
+);
+
+typedef EFI_STATUS (*EFI_AHCI_SMM_SATA_DEV_NON_DATA_CMD) (
+ IN AHCI_BUS_SMM_PROTOCOL *SataDevInterface,
+ IN COMMAND_STRUCTURE CommandStructure,
+ UINT8 PortNumber,
+ UINT8 PMPortNumber,
+ DEVICE_TYPE DeviceType
+);
+
+typedef EFI_STATUS (*EFI_AHCI_SMM_SATA_DEV_PACKET_CMD) (
+ IN AHCI_BUS_SMM_PROTOCOL *SataDevInterface,
+ IN COMMAND_STRUCTURE *CommandStructure,
+ IN BOOLEAN READWRITE,
+ UINT8 PortNumber,
+ UINT8 PMPortNumber,
+ DEVICE_TYPE DeviceType
+);
+
+typedef EFI_STATUS (*EFI_AHCI_SMM_INIT_ON_S3) (
+ IN AHCI_BUS_SMM_PROTOCOL *SataDevInterface,
+ IN UINT8 Port
+);
+
+typedef struct _AHCI_BUS_SMM_PROTOCOL{
+ UINT64 AhciBaseAddress;
+ UINT32 PortCommandTableBaseAddr;
+ UINT32 PortCommandListBaseAddr;
+ UINT32 PortFISBaseAddr;
+ UINT8 PortNumber;
+ UINT8 PMPortNumber;
+ DEVICE_TYPE DeviceType;
+ ATAPI_DEVICE AtapiDevice;
+ EFI_AHCI_SMM_INIT_ON_S3 AhciSmmInitPortOnS3Resume;
+ EFI_AHCI_SMM_SATA_DEV_PIO_DATA_IN AhciSmmExecutePioDataCommand;
+ EFI_AHCI_SMM_SATA_DEV_DMA_DATA_IN AhciSmmExecuteDmaDataCommand;
+ EFI_AHCI_SMM_SATA_DEV_NON_DATA_CMD AhciSmmExecuteNonDataCommand;
+ EFI_AHCI_SMM_SATA_DEV_PACKET_CMD AhciSmmExecutePacketCommand;
+}AHCI_BUS_SMM_PROTOCOL;
+
+#endif // #ifndef GUID_VARIABLE_DEFINITION
+#ifdef __cplusplus
+}
+#endif
+#endif
+
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Pkwy, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
diff --git a/Include/Protocol/AhciSmmProtocols.CIF b/Include/Protocol/AhciSmmProtocols.CIF
new file mode 100644
index 0000000..0fc5c9c
--- /dev/null
+++ b/Include/Protocol/AhciSmmProtocols.CIF
@@ -0,0 +1,8 @@
+<component>
+ name = "AhciSmmProtocols"
+ category = ModulePart
+ LocalRoot = "INCLUDE\Protocol"
+ RefName = "AhciSmmProtocols"
+[files]
+"AhciSmmProtocol.h"
+<endComponent>
diff --git a/Include/Protocol/AmiBoardInfo.h b/Include/Protocol/AmiBoardInfo.h
new file mode 100644
index 0000000..883aadd
--- /dev/null
+++ b/Include/Protocol/AmiBoardInfo.h
@@ -0,0 +1,362 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2005, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/BIN/Core/Modules/BoardInfo/Protocol/AmiBoardInfo.h 3 9/30/11 5:43p Yakovlevs $
+//
+// $Revision: 3 $
+//
+// $Date: 9/30/11 5:43p $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Core/Modules/BoardInfo/Protocol/AmiBoardInfo.h $
+//
+// 3 9/30/11 5:43p Yakovlevs
+// [TAG] EIP66222
+// [Category] New Feature
+// [Description] Modify PCI bus driver to get board info from separate
+// FFS section
+// [Files] AmiBoaardInfo.mak;
+// AmiBoaardInfo.sdl;
+// PciBoard.c
+// AmiBoaardInfo.h
+//
+// 2 3/01/10 5:06p Yakovlevs
+// New separate Label with generic Multi-Root support.
+// Uses new AMI SDL "C" sytle output for the former "ASM" style.
+//
+// 1 5/18/09 2:49p Yakovlevs
+//
+// 1 4/28/09 1:26p Yakovlevs
+//
+// 5 1/30/09 12:53p Yakovlevs
+// Added Porting Function declaration EIP 8874
+//
+// 4 11/14/08 1:37p Yakovlevs
+// Declared NEW AMI Board Info Protocol
+//
+// 3 10/01/08 7:10p Yakovlevs
+// Updated AMI FUNC HEADER information.
+//
+// 2 10/01/08 12:46p Yakovlevs
+// Added missing constants associated with PCI BUS TOKENS
+//
+// 1 9/25/08 11:29a Yakovlevs
+
+
+#ifndef AMI_BOARD_INFO_H_
+#define AMI_BOARD_INFO_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+#include <Efi.h>
+#include <Token.h>
+
+//Define AmiBoardInfo Protocol Intreface GUID
+#define AMI_BOARD_INFO_PROTOCOL_GUID \
+{ 0x0273146c, 0x96c4, 0x45a1, 0xa7, 0xaf, 0x78, 0xe0, 0x52, 0x4a, 0x0a, 0xe2 }
+
+#define AMI_BOARD_INFO_SECTION_GUID \
+{ 0xE6F4F8F7, 0x4992, 0x47b2, 0x83, 0x02, 0x85, 0x08, 0x74, 0x5E, 0x4A, 0x23 }
+
+GUID_VARIABLE_DECLARATION(gAmiBoardInfoProtocolGuid,AMI_BOARD_INFO_PROTOCOL_GUID);
+
+GUID_VARIABLE_DECLARATION(gAmiBoardInfoSectionGuid, AMI_BOARD_INFO_SECTION_GUID);
+
+#ifndef GUID_VARIABLE_DEFINITION
+
+//-------------------------------------------------
+//Forward Declarations
+//-------------------------------------------------
+typedef struct _AMI_BOARD_INFO_PROTOCOL AMI_BOARD_INFO_PROTOCOL;
+
+
+//SDL Binary Signature Defifnition
+#define AMI_PIR_SIGNATURE 0x52495024 //"$PIR" Legacy PCI IRQ Routing
+#define AMI_AIR_SIGNATURE 0x52494124 //"$AIR" IO APIC IRQ Routing
+#define AMI_APD_SIGNATURE 0x44504124 //"$APD" APIC Data Structure
+#define AMI_XLT_SIGNATURE 0x544C5824 //"$XLT" APIC Data Structure
+
+/////////////////////////////////////////////////////////////////////////////
+//---------------------------------------------------------------------------
+//Define Internal VeB Structures
+//Use BYTE alignment since tis stuff comes from ASM file.
+//---------------------------------------------------------------------------
+#pragma pack(push, 1)
+
+typedef struct _AMI_SDL_IRQR_HDR {
+ UINT32 Sugnature; //"$PIR" or "$AIR"
+ UINT16 Version; //Version 0x100
+ UINT16 Size; //Size 0x142 data + header
+ UINT8 RouterBus; //bRouterBus 0
+ UINT8 RouterDevFunc; //bRouterDevFunc 0
+ UINT16 ExclusiveIRQ; //
+ UINT32 CompatibleRouter;//
+ UINT32 MiniPortData; //
+ UINT32 SlotCount; //Number of Non-hotplug devices
+ UINT32 HpSlotCount; //Number of Hotplug devices Total slots == SlotsCounrt+ HpSlotsCount
+ UINT8 Reserved [3]; //0,0,0
+ UINT8 Checksum; //0
+} AMI_SDL_IRQR_HDR;
+
+typedef struct _AMI_SDL_INFO_HDR {
+ UINT32 Sugnature; //"$XLT" or "$APD"
+ UINT16 Size;
+} AMI_SDL_INFO_HDR;
+
+//<AMI_SHDR_START>
+//----------------------------------------------------------------------------
+// Name: PCI_DEV_FUN
+//
+// Description: UNION of UINT8 and a Structure used to describe AMISDL format
+// for PCI Device Function Package. Packed PCI DEV/FUNCTION number.
+//
+// Fields:
+// Name Type Description
+// ------------------------------------------------------------------
+// DEV_FUN UINT8 Device / Function all together
+// Fun UINT8 PCI Device's Function#
+// Dev UINT8 PCI Device's Device#
+//----------------------------------------------------------------------------
+//<AMI_SHDR_END>
+typedef union _PCI_DEV_FUN {
+ UINT8 DEV_FUN;
+ struct {
+ UINT8 Fun : 3;
+ UINT8 Dev : 5;
+ };
+} PCI_DEV_FUN;
+
+//<AMI_SHDR_START>
+//----------------------------------------------------------------------------
+// Name: PCI_PIC_IRQ_DATA
+//
+// Description: Structure used to describe PCI IRQ Router Register and available
+// IRQ MASK used by AMISDL output format.
+//
+// Fields:
+// Name Type Description
+// ------------------------------------------------------------------
+// ChipsetReg UINT8 Chipset register number
+// IrqMask UINT16 IRQ MASK for legacy Interrupts
+//----------------------------------------------------------------------------
+//<AMI_SHDR_END>
+typedef struct _PCI_PIC_IRQ_DATA {
+ UINT8 ChipsetReg;
+ UINT16 IrqMask;
+} PCI_PIC_IRQ_DATA;
+
+//<AMI_SHDR_START>
+//----------------------------------------------------------------------------
+// Name: PCI_IRQ_PIC_ROUTE
+//
+// Description: Structure used to describe Legacy (PIC) IRQ Routing Information.
+// AUTOGENERATED DATA.
+//
+// Fields:
+// Name Type Description
+// ------------------------------------------------------------------
+// PciBusNumber UINT8 PCI Bus #
+// DevFun PCI_DEV_FUN PCI Device # \ Function #
+// PciIrq[4] PCI_PIC_IRQ_DATA Register \ IRQ MASK
+// SlotNum UINT8 Pci Slot # or 0 if embeded device
+// Reserved UINT8
+//----------------------------------------------------------------------------
+//<AMI_SHDR_END>
+typedef struct _PCI_IRQ_PIC_ROUTE {
+ UINT8 PciBusNumber;
+ PCI_DEV_FUN DevFun;
+ PCI_PIC_IRQ_DATA PciIrq[4];
+ UINT8 SlotNum;
+ UINT8 Reserved;
+} PCI_IRQ_PIC_ROUTE;
+
+
+//<AMI_SHDR_START>
+//----------------------------------------------------------------------------
+// Name: PCI_APIC_IRQ_DATA
+//
+// Description: Structure used to describe (APIC) IRQ Routing DATA.
+//
+// Fields:
+// Name Type Description
+// ------------------------------------------------------------------
+// IoApicItin UINT8 IO/APIC INTIN pin
+// IoApicId UINT8 IO/APIC ID value
+//----------------------------------------------------------------------------
+//<AMI_SHDR_END>
+typedef struct _PCI_APIC_IRQ_DATA {
+ UINT8 IoApicItin;
+ UINT8 IoApicId;
+} PCI_APIC_IRQ_DATA;
+
+
+//<AMI_SHDR_START>
+//----------------------------------------------------------------------------
+// Name: PCI_IRQ_APIC_ROUTE
+//
+// Description: Structure used to describe Extended (IO/APIC) IRQ Routing
+// Information. AUTOGENERATED DATA.
+//
+// Fields:
+// Name Type Description
+// ------------------------------------------------------------------
+// PciBusNumber UINT8 PCI Bus #
+// DeviceNumber UINT8 PCI Device #
+// Intn[4] PCI_APIC_IRQ_DATA APIC IRQ Routing Info.
+// Reserved UINT8
+//----------------------------------------------------------------------------
+//<AMI_SHDR_END>
+typedef struct _PCI_IRQ_APIC_ROUTE {
+ UINT8 PciBusNumber;
+ UINT8 DeviceNumber;
+ PCI_APIC_IRQ_DATA Intn[4];
+ UINT8 Reserved;
+} PCI_IRQ_APIC_ROUTE;
+
+
+//<AMI_SHDR_START>
+//----------------------------------------------------------------------------
+// Name: PCI_BUS_XLAT_HDR
+//
+// Description: Structure used to describe Extended (IO/APIC) IRQ Routing
+// Information. AUTOGENERATED DATA.
+//
+// Fields:
+// Name Type Description
+// ------------------------------------------------------------------
+// BusBuild UINT8 PCI Bus# Assigned at BIOS build time
+// BusRun UINT8 PCI Bus# Assigned at run time
+// Bridge[] PCI_DEV_FUN Describes bridges chain
+//----------------------------------------------------------------------------
+//<AMI_SHDR_END>
+typedef struct _PCI_BUS_XLAT_HDR {
+ UINT8 BusBuild;
+ UINT8 BusRun;
+// PCI_DEV_FUN Bridge[];
+// UINT8 Terminator==0xFF;
+// CAHR8 AslName[5]; //0 terminates ASL Name (4 Letters)
+} PCI_BUS_XLAT_HDR;
+
+
+typedef union _AMI_IOAPIC_ADDRESS{
+ UINT32 ADDRESS;
+ struct {
+ UINT32 Func : 8;
+ UINT32 Dev : 8;
+ UINT32 Bus : 8;
+ UINT32 Seg : 8;
+ };
+}AMI_IOAPIC_ADDRESS;
+
+//<AMI_SHDR_START>
+//----------------------------------------------------------------------------
+// Name: AMI_APIC_INFO
+//
+// Description: Structure used to describe IO/APIC Information
+//
+// Fields:
+// Name Type Description
+// ------------------------------------------------------------------
+// BusBuild UINT8 PCI Bus# Assigned at BIOS build time
+// BusRun UINT8 PCI Bus# Assigned at run time
+// Bridge[] PCI_DEV_FUN Describes bridges chain
+//----------------------------------------------------------------------------
+//<AMI_SHDR_END>
+typedef struct _AMI_APIC_INFO {
+ AMI_IOAPIC_ADDRESS ApicAddress;
+ UINT8 ApicIdBuild;
+ UINT8 ApicIdRun;
+ UINT8 VectorBase;
+} AMI_APIC_INFO;
+
+
+#pragma pack(pop)
+
+//----------------------------------------------------------------------------
+//Definition of AMI Board Info Protocol.
+//All PCI related VeB configuration output files
+//generated based on PCI Portibg using VeB Wizards
+typedef struct _AMI_BOARD_INFO_PROTOCOL {
+ BOOLEAN DataValid; //Signifies if Board Specific IRQ data was updated.
+ UINT16 BusXlatEntries;
+ UINT16 SdlPciIrqMask; //rth_pci_dedicated_irqs_equ value from IQR_C output.
+ UINT8 Reserved[3];
+ PCI_BUS_XLAT_HDR *BusXlatTable;
+ UINTN BusXlatLength;
+ PCI_IRQ_PIC_ROUTE *PicRoutTable;
+ UINTN PicRoutLength;
+ PCI_IRQ_PIC_ROUTE *HpSltTablePic;
+ UINTN HpSltPicLength;
+ PCI_IRQ_APIC_ROUTE *ApicRoutTable;
+ UINTN ApicRoutLength;
+ PCI_IRQ_APIC_ROUTE *HpSltTableApic;
+ UINTN HpSltApicLength;
+ AMI_APIC_INFO *ApicInfoTable;
+ UINTN ApicInfoLength;
+ VOID *BoardAcpiInfo;
+ VOID *BoardOemInfo;
+} AMI_BOARD_INFO_PROTOCOL;
+
+/*
+#define AMI_SDL_PICR_SIG 0x52495024
+#define AMI_SDL_APICR_SIG 0x52494124
+#define AMI_SDL_XLAT_SIG 0x52494124
+
+
+
+typedef struct _AMI_BOARD_INFO_IRQ_HEADER
+ 0x24, 0x50, 0x49, 0x52, // $PIR
+ 0x00, 0x01, // Version 0x100
+ 0xF0, 0x01, // Size 0x1F0
+ 0x00, // bRouterBus 0
+ 0x00, // bRouterDevFunc 0
+ 0x00, 0x00, // wExclusiveIRQ 0
+ 0x00, 0x00, 0x00, 0x00, // dCompatibleRouter 0
+ 0x00, 0x00, 0x00, 0x00, // dMiniPortData 0
+ 0x00, 0x00, 0x00, 0x12, //Number of Non-hotplug devices
+ 0x00, 0x00, 0x00, 0x00, //Number of Hotplug devices
+ 0x00, 0x00, 0x00, // Reserved [3]
+ 0x00 // Checksum 0???
+*/
+
+
+#endif //ifndef GUID_VARIABLE_DEFINITION
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+
+#ifdef __cplusplus
+}
+#endif
+#endif //AMI_BOARD_INFO_H_
+
+
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2005, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+
diff --git a/Include/Protocol/AmiCpuInfo.h b/Include/Protocol/AmiCpuInfo.h
new file mode 100644
index 0000000..46a6699
--- /dev/null
+++ b/Include/Protocol/AmiCpuInfo.h
@@ -0,0 +1,154 @@
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2008, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/SOURCE/Modules/SharkBayRefCodes/Haswell/AMI Cpu PKG/CPU Core/CpuProtocols/AmiCpuInfo.h 2 6/16/14 4:51a Davidhsieh $
+//
+// $Revision: 2 $
+//
+// $Date: 6/16/14 4:51a $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/SOURCE/Modules/SharkBayRefCodes/Haswell/AMI Cpu PKG/CPU Core/CpuProtocols/AmiCpuInfo.h $
+//
+// 2 6/16/14 4:51a Davidhsieh
+// [TAG] None
+// [Category] Improvement
+// [Description] Support the cache size which bigger than 0x8000MB
+// [Files] AmiCpuInfo.h, CpuSmbios.c
+//
+// 1 2/07/12 3:59a Davidhsieh
+//
+// 1 5/06/11 6:08a Davidhsieh
+// First release
+//
+// 2 3/04/09 10:45a Markw
+// Update copyright header.
+//
+// 1 11/02/07 1:59p Markw
+//
+// 1 11/02/07 1:45p Markw
+//
+// 7 7/23/07 7:58p Markw
+//
+// 6 3/23/07 9:54a Markw
+// Updated headers.
+//
+// 5 2/23/07 12:23p Markw
+// Added comments.
+//
+// 4 1/31/07 3:03p Markw
+// Added providing EMT64 CPU support.
+//
+// 3 7/21/05 10:12p Markw
+// Fixed AmiCpuInfo.
+//
+// 2 7/20/05 3:54p Markw
+// Updated CACHE_INFO.
+//
+// 1 7/19/05 10:18a Markw
+//
+//**********************************************************************
+
+//<AMI_FHDR_START>
+//---------------------------------------------------------------------------
+// Name: AmiCpuInfo.h
+//
+// Description: AMI CPU INFO protocol header.
+//
+//<AMI_FHDR_END>
+//---------------------------------------------------------------------------
+
+#ifndef _AMI_CPU_INFO_H_
+#define _AMI_CPU_INFO_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+//F109F361-370C-4d9c-B1AB-7CA2D4C8B3FF
+#define AMI_CPU_INFO_PROTOCOL_GUID \
+ {0xf109f361,0x370c,0x4d9c,0xb1,0xab,0x7c,0xa2,0xd4,0xc8,0xb3,0xff}
+
+typedef struct _AMI_CPU_INFO_PROTOCOL AMI_CPU_INFO_PROTOCOL;
+
+typedef struct {
+ UINT8 Desc;
+ UINT8 Level;
+ UINT8 Type; //0 - Data, 1 - Instruction, 3 - Unified
+ UINT32 Size;
+ UINT8 Associativity;
+} CACHE_DESCRIPTOR_INFO;
+
+
+typedef struct {
+ UINT32 Version;
+ UINT64 Features;
+ CHAR8 *BrandString;
+ BOOLEAN X64Supported;
+ UINT8 NumCores; //Number of Cores. Ex. If Dual core, 2 cores.
+ UINT8 NumHts; //Number of Hyper threading. This will be 0 or 2.
+ UINT32 FSBFreq; //MT/s
+ UINT32 IntendedFreq; //MHz
+ UINT32 ActualFreq; //MHz
+ UINT32 Voltage; // Volt / 10000.
+ UINT32 MicroCodeVers;
+ CACHE_DESCRIPTOR_INFO *CacheInfo;
+ BOOLEAN Ht0; //Set if core is hyper-threadding logical CPU.
+ //True, if not-hyperthreaded CPU.
+} AMI_CPU_INFO;
+
+
+//CPU = 0, 1, 2, ...
+//CPU number is ordered by APIC ID.
+//The CPUs are also ordered (because APIC ID) that
+// for example if dual core hyper-threading then
+// CPU 0 = CORE0, HT0
+// CPU 1 = CORE0, HT1
+// CPU 2 = CORE1, HT0
+// CPU 3 = CORE1, HT1
+typedef EFI_STATUS (*GET_CPU_INFO) (
+ IN AMI_CPU_INFO_PROTOCOL *This,
+ IN UINTN Cpu,
+ OUT AMI_CPU_INFO **Info
+);
+
+struct _AMI_CPU_INFO_PROTOCOL {
+ GET_CPU_INFO GetCpuInfo;
+};
+
+
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2008, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
diff --git a/Include/Protocol/AmiCpuInfo2.h b/Include/Protocol/AmiCpuInfo2.h
new file mode 100644
index 0000000..5ec045c
--- /dev/null
+++ b/Include/Protocol/AmiCpuInfo2.h
@@ -0,0 +1,236 @@
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2008, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/SOURCE/Modules/SharkBayRefCodes/Haswell/AMI Cpu PKG/CPU Core/CpuProtocols/AmiCpuInfo2.h 1 2/07/12 3:59a Davidhsieh $
+//
+// $Revision: 1 $
+//
+// $Date: 2/07/12 3:59a $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/SOURCE/Modules/SharkBayRefCodes/Haswell/AMI Cpu PKG/CPU Core/CpuProtocols/AmiCpuInfo2.h $
+//
+// 1 2/07/12 3:59a Davidhsieh
+//
+// 1 5/06/11 6:08a Davidhsieh
+// First release
+//
+// 8 1/03/11 3:56p Markw
+// [TAG] EIP47298
+// [Category] New Feature
+// [Description] Add ability to get cache information using the AMI CPU
+// INFO 2 Protocol for setup.
+// [Files] AmiCpuInfo2.h, CpuDxeBoard.c
+//
+// 7 8/11/09 3:39p Markw
+// EIP #24914 - Add early local x2APIC support. Add flag to AMI CPU INFO 2
+// Protocol.
+//
+// 6 5/21/09 11:31p Markw
+// Add ASL Processor object path to ACPI_PROCESSOR_INFO.
+//
+// 5 5/04/09 5:00p Markw
+// EIP #17903 Add to GetAcpiInfo to AmiCpuInfo2 Protocol. This updates
+// fields for MP table.
+//
+// 4 4/30/09 5:48p Markw
+// EIP #17903 Add to GetAcpiInfo to AmiCpuInfo2 Protocol. This is to
+// provide correct ordering for Nehalem in APIC table.
+//
+// 3 3/04/09 10:45a Markw
+// Update copyright header.
+//
+// 2 11/10/08 6:47p Markw
+// Update Ami Cpu Info 2 Protocol.
+//
+// 1 11/05/08 11:11a Markw
+//
+//**********************************************************************
+
+//<AMI_FHDR_START>
+//---------------------------------------------------------------------------
+// Name: AmiCpuInfo2.h
+//
+// Description: AMI CPU INFO 2 protocol header.
+//
+//<AMI_FHDR_END>
+//---------------------------------------------------------------------------
+
+#ifndef _AMI_CPU_INFO_2_H_
+#define _AMI_CPU_INFO_2_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+// {AC9CF0A8-E551-4be2-AD0A-E1B564EEA273}
+#define AMI_CPU_INFO_2_PROTOCOL_GUID \
+ {0xac9cf0a8, 0xe551, 0x4be2, 0xad, 0xa, 0xe1, 0xb5, 0x64, 0xee, 0xa2, 0x73}
+
+///////////////
+//ACPI Data
+//////////////
+
+//Table Type 0//
+//The Local APIC in MADT and MP should be filled in order of table entries.
+//The length may be increased, so to be compatible with earlier version, get the
+// next entry by using length instead of sizeof(ACPI_PROCESSOR_INFO) or array.
+
+#define ACPI_PROCESSOR_INFO_TYPE 0
+#define ACPI_PROC_INFO_xAPIC 0
+#define ACPI_PROC_INFO_x2APIC 1
+
+//When adding to structure, use only types with the same size for x32 and x64,
+//so length can be used to determine supported features.
+//This means no VOID* and no UINTN.
+
+typedef struct {
+ UINT32 Type; //0
+ UINT32 Length; //Note: Find next structure by length.
+ UINT32 Enable;
+ UINT32 Bsp; //0 or 1
+ UINT32 Package;
+ UINT32 Core;
+ UINT32 Thread; //Thread of processor 0 or 1.
+ UINT32 ApicId; //APIC ID of processor.
+ UINT32 ApicVer;
+ UINT32 CpuSignature; //Used by MPS table.
+ UINT32 FeatureFlags; //Used by MPS table.
+ UINT32 ProcId; //ASL processor object ID.
+ EFI_PHYSICAL_ADDRESS ProcObjPath; //ASL Processor Object Path.
+ //Only if Length >= 60.
+ UINT32 LocalApicType; //0 - xApic, 1 - x2Apic
+} ACPI_PROCESSOR_INFO;
+
+
+typedef struct _AMI_CPU_INFO_2_PROTOCOL AMI_CPU_INFO_2_PROTOCOL;
+
+#define AMI_CPU_INFO_2_FLAGS_NUM_DIS_CORES_VALID 1
+#define AMI_CPU_INFO_2_FLAGS_NUM_DIS_THRDS_VALID 2
+
+typedef EFI_STATUS (*GET_NUM_PACKAGES) (
+ IN AMI_CPU_INFO_2_PROTOCOL *This,
+ OUT UINT32 *NumPopulatedPackages,
+ OUT UINT32 *NumBoardSockets OPTIONAL
+);
+
+
+typedef EFI_STATUS (*GET_NUM_CORES_THREADS) (
+ IN AMI_CPU_INFO_2_PROTOCOL *This,
+ IN UINT32 Package,
+ OUT UINT32 *NumEnabledCores,
+ OUT UINT32 *NumEnabledThreads,
+ OUT UINT32 *NumDisabledCores OPTIONAL,
+ OUT UINT32 *NumDisabledThreads OPTIONAL
+);
+
+typedef EFI_STATUS (*GET_NUM_THREADS) (
+ IN AMI_CPU_INFO_2_PROTOCOL *This,
+ IN UINT32 Package,
+ IN UINT32 Core,
+ OUT UINT32 *NumEnabledThreads,
+ OUT UINT32 *NumDisabledThreads OPTIONAL
+);
+
+typedef EFI_STATUS (*GET_SBSP) (
+ IN AMI_CPU_INFO_2_PROTOCOL *This,
+ OUT UINT32 *Package,
+ OUT UINT32 *Core,
+ OUT UINT32 *Thread
+);
+
+typedef EFI_STATUS (*GET_APIC_INFO) (
+ IN AMI_CPU_INFO_2_PROTOCOL *This,
+ IN UINT32 Package,
+ IN UINT32 Core,
+ IN UINT32 Thread,
+ OUT UINT32 *ApicId,
+ OUT UINT32 *ApicVer OPTIONAL
+);
+
+typedef EFI_STATUS (*GET_ACPI_INFO) (
+ IN AMI_CPU_INFO_2_PROTOCOL *This,
+ OUT VOID **AcpiData,
+ OUT UINT32 *NumEntries
+);
+
+#define AMI_CPU_INFO_2_CACHE_TYPE_DATA 0
+#define AMI_CPU_INFO_2_CACHE_TYPE_CODE 1
+#define AMI_CPU_INFO_2_CACHE_TYPE_UNIFIED 2
+
+#define AMI_CPU_INFO_2_CACHE_SHARED_CORE 1
+#define AMI_CPU_INFO_2_CACHE_SHARED_PACKAGE 2
+
+typedef struct {
+ UINT32 LengthDesc; //Later updates may increase this.
+ UINT32 Level;
+ UINT32 Size;
+ UINT32 Type;
+ UINT32 Associativity;
+ UINT32 Shared;
+} AMI_CPU_INFO_2_CACHE_DESCR;
+
+typedef EFI_STATUS (*GET_PACKAGE_CACHE_DESCR) (
+ IN AMI_CPU_INFO_2_PROTOCOL *This,
+ IN UINT32 Package,
+ OUT AMI_CPU_INFO_2_CACHE_DESCR **Description,
+ OUT UINT32 *NumEntries
+);
+
+typedef EFI_STATUS (*GET_CORE_CACHE_DESCR) (
+ IN AMI_CPU_INFO_2_PROTOCOL *This,
+ IN UINT32 Package,
+ IN UINT32 Core,
+ OUT AMI_CPU_INFO_2_CACHE_DESCR **Description,
+ OUT UINT32 *NumEntries
+);
+
+struct _AMI_CPU_INFO_2_PROTOCOL {
+ //Protocol Ver 0
+ UINT32 ProtocolVer;
+ UINT64 Flags;
+ GET_NUM_PACKAGES GetNumPackages;
+ GET_NUM_CORES_THREADS GetNumCoresThreads;
+ GET_NUM_THREADS GetNumThreads;
+ GET_SBSP GetSbsp;
+ GET_APIC_INFO GetApicInfo;
+ //Protocol Ver 1
+ GET_ACPI_INFO GetAcpiInfo;
+ //Protocol Ver 2
+ GET_PACKAGE_CACHE_DESCR GetPackageCacheDesc;
+ GET_CORE_CACHE_DESCR GetCoreCacheDesc;
+};
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2008, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
diff --git a/Include/Protocol/AmiDigitalSignature.h b/Include/Protocol/AmiDigitalSignature.h
new file mode 100644
index 0000000..d8cdeff
--- /dev/null
+++ b/Include/Protocol/AmiDigitalSignature.h
@@ -0,0 +1,316 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2013, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Pkwy, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/BIN/Modules/CryptoPkg/Protocol/AmiDigitalSignature.h 11 8/15/13 9:44a Alexp $
+//
+// $Revision: 11 $
+//
+// $Date: 8/15/13 9:44a $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Modules/CryptoPkg/Protocol/AmiDigitalSignature.h $
+//
+// 11 8/15/13 9:44a Alexp
+// Add UEFI TimeStamp certificate definitions; add new Pkcs7 operation
+// code-Pkcs7TimeStampCertVerifyGet
+//
+// 10 8/02/13 4:27p Alexp
+// Add temporary defines for new Hash types with noPad
+//
+// 9 8/01/13 6:45p Alexp
+// temp add TIME STAMP type definitions per UEFI ECR#1009
+//
+// 8 7/11/13 4:06p Alexp
+// EIP#118850:Develop functionality per UEFI Mantis ticket (ECR)#1009
+// add new Pkcs7 operator: Pkcs7TimeStampCertValidate
+//
+// 7 8/22/12 4:38p Alexp
+// Added new Pkcs7Parse operations:
+// Pkcs7CertValidateGetSignerKey,
+// Pkcs7CertGetMatchInCertChain,
+// Pkcs7CertValidateGetCAKey,
+// Pkcs7GetCAKey, Pkcs7GetSignerKey
+//
+// 5 4/09/12 4:49p Alexp
+// Add new Pkcs7Verify operand::Pkcs7CertValidateGetMatchInCertChain
+//
+// 4 2/29/12 3:59p Alexp
+// Add VerifyKey Protocol function to match to Crypto PEI API.
+//
+// 3 6/10/11 6:21p Alexp
+// added new Pkcs7 parse Operation: Pkcs7CertValidateGetSignerKeyHash
+//
+// 2 5/10/11 6:57p Alexp
+// include all Crypto related Guid Variable declarations
+//
+// 1 5/06/11 6:11p Alexp
+// initial module release
+//
+//**********************************************************************
+//<AMI_FHDR_START>
+//
+// Name: AmiDigitalSignature.h
+//
+// Description: AMI Digital Signature Protocol Definition
+//
+//<AMI_FHDR_END>
+//**********************************************************************
+#ifndef __AMI_DIGITAL_SIGNATURE_DXE__H__
+#define __AMI_DIGITAL_SIGNATURE_DXE__H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+// All are EDKII defined headers
+#include <Protocol/Hash.h>
+#include <ImageAuthentication.h>
+
+// Flags to define type of signature to process
+#define EFI_CRYPT_RSASSA_PKCS1V15 1
+#define EFI_CRYPT_RSASSA_PSS 2
+
+///
+/// SHA-1 digest size in bytes.
+///
+#define SHA1_DIGEST_SIZE 20
+///
+/// SHA-256 digest size in bytes
+///
+#define SHA256_DIGEST_SIZE 32
+
+#define DEFAULT_RSA_KEY_MODULUS_LEN 256 // 2048 bits
+#define DEFAULT_RSA_SIG_LEN DEFAULT_RSA_KEY_MODULUS_LEN // This is true as long as > data
+
+#define AMI_DIGITAL_SIGNATURE_PROTOCOL_GUID \
+ { 0x5f87ba17, 0x957d, 0x433d, 0x9e, 0x15, 0xc0, 0xe7, 0xc8, 0x79, 0x88, 0x99 }
+
+#define AMI_SMM_DIGITAL_SIGNATURE_PROTOCOL_GUID \
+ { 0x91ABC830, 0x16FC, 0x4D9E, 0xA1, 0x89, 0x5F, 0xC8, 0xBB, 0x41, 0x14, 0x02 }
+
+GUID_VARIABLE_DECLARATION(gAmiDigitalSignatureProtocolGuid, AMI_DIGITAL_SIGNATURE_PROTOCOL_GUID);
+GUID_VARIABLE_DECLARATION(gAmiSmmDigitalSignatureProtocolGuid, AMI_SMM_DIGITAL_SIGNATURE_PROTOCOL_GUID);
+
+// Common Crypt construction type: ASN1 PubKey, Hash sha256, etc.
+typedef struct{
+ EFI_GUID AlgGuid;
+ UINT32 BlobSize;
+ UINT8 *Blob;
+} CRYPT_HANDLE;
+
+//**********************************************************************
+//<AMI_THDR_START>
+//
+// Name: PKCS7_OPERATIONS
+//
+// Description: Enumerated Pkcs7 Operations.
+// List of different Pkcs7 verify tasks to perform:
+//
+// Fields: Name Number Description
+// ------------------------------------------------------------
+// Pkcs7Arg0 0 Function presence check. Must return EFI_SUCCESS
+// Pkcs7CertValidate 1 Validate Certificate
+// Pkcs7GetSignerCert 2 Return Signer Certificate in *Data. Performs cert chaining and time based validity tests
+// Pkcs7GetCACert 3 Return Root CA certificate referenced by Signer. Used to compare with Trusted Cert in FW
+// Pkcs7ValidateRootCert 4 Validate Root Certificate
+// x509ValidateCertChain 5 Validate Signer Certificate Chain
+// Pkcs7GetDigestAlgorithm 6 Return Signature Digest Algorithm
+// Pkcs7CertValidateGetCACert 7 Validate Pkcs7 Cert, return Root CA Certificate
+// Pkcs7CertValidateGetSignerCert 8 Validate Pkcs7 Cert, return Signer Certificate
+// Pkcs7CertValidateGetSignerKeyHash 9 Validate Pkcs7 Cert, return Signer Key Hash (SHA256)
+// Pkcs7CertValidateGetMatchInCertChain 10 Validate Pkcs7 Cert and return Success if match is found between Trust and any leaf certificates in the Pkcs7 Signer chain
+// Pkcs7CertValidateGetSignerKey 11 Validate Pkcs7 Cert, return ptr in *Data to n-modulus of a Signer Key
+// Pkcs7CertGetMatchInCertChain 12 Return Success if match is found between Trust and any leaf certificates in the Signer chain
+// Pkcs7CertValidateGetCAKey 13 Validate Pkcs7 Cert, return ptr in *Data to n-modulus of a Root CA Key
+// Pkcs7GetCAKey 14 Return ptr in *Data to n-modulus of a Root CA Key
+// Pkcs7GetSignerKey 15 Return ptr in *Data to n-modulus of a Signer Key
+// Pkcs7TimeStampCertValidateGet 16 Validate TimeStamp certificate chain in Pkcs7 Certificate. Return TimeOfSigning
+//<AMI_THDR_END>
+//**********************************************************************
+typedef enum {
+ Pkcs7Arg0,
+ Pkcs7CertValidate,
+ Pkcs7GetSignerCert,
+ Pkcs7GetCACert,
+ Pkcs7ValidateRootCert,
+ x509ValidateCertChain,
+ Pkcs7GetDigestAlgorithm,
+ Pkcs7CertValidateGetCACert,
+ Pkcs7CertValidateGetSignerCert,
+ Pkcs7CertValidateGetSignerKeyHash,
+ Pkcs7CertValidateGetMatchInCertChain, // obsolete
+ Pkcs7CertValidateGetSignerKey,
+ Pkcs7CertGetMatchInCertChain,
+ Pkcs7CertValidateGetCAKey,
+ Pkcs7GetCAKey,
+ Pkcs7GetSignerKey,
+ Pkcs7TimeStampCertValidateGet
+} PKCS7_OP;
+
+typedef enum { SHA1, SHA256, SHA384, SHA512} HASH_ALG;
+
+typedef struct _AMI_DIGITAL_SIGNATURE_PROTOCOL AMI_DIGITAL_SIGNATURE_PROTOCOL;
+
+typedef
+EFI_STATUS
+(EFIAPI *AMI_DIGITAL_SIGNATURE_PKCS1_VERIFY) (
+ IN CONST AMI_DIGITAL_SIGNATURE_PROTOCOL *This,
+ IN CRYPT_HANDLE *PublicKey,
+ IN CRYPT_HANDLE *Hash,
+ IN VOID *Signature,
+ IN UINTN SignatureSize,
+ IN UINT32 Flags
+);
+
+typedef
+EFI_STATUS
+(EFIAPI *AMI_DIGITAL_SIGNATURE_PKCS7_VERIFY) (
+ IN CONST AMI_DIGITAL_SIGNATURE_PROTOCOL *This,
+ IN CONST UINT8 *P7Data,
+ IN UINTN P7Size,
+ IN CONST UINT8 *TrustedCert,
+ IN UINTN CertSize,
+ IN OUT UINT8 **Data,
+ IN OUT UINTN *DataSize,
+ IN UINT8 Operation,
+ IN UINT32 Flags
+);
+
+typedef
+EFI_STATUS
+(EFIAPI *AMI_DIGITAL_SIGNATURE_HASH) (
+ IN CONST AMI_DIGITAL_SIGNATURE_PROTOCOL *This,
+ IN CONST EFI_GUID *HashAlgorithm,
+ IN UINTN Num_elem,
+ IN CONST UINT8 *Addr[],
+ IN CONST UINTN *Len,
+ OUT UINT8 *Hash
+);
+
+typedef
+EFI_STATUS
+(EFIAPI *AMI_DIGITAL_SIGNATURE_GET_KEY) (
+ IN CONST AMI_DIGITAL_SIGNATURE_PROTOCOL *This,
+ OUT CRYPT_HANDLE *Key,
+ IN EFI_GUID *AlgId,
+ IN UINTN KeyLen,
+ IN UINT32 Flags
+ );
+
+typedef
+EFI_STATUS
+(EFIAPI *AMI_DIGITAL_SIGNATURE_VERIFY_KEY) (
+ IN CONST AMI_DIGITAL_SIGNATURE_PROTOCOL *This,
+ IN EFI_GUID *AlgId,
+ IN CRYPT_HANDLE *Key
+ );
+/*
+Structure mutex
+Mutual exclusion (mutex) semaphore locking mechanism used to serialise interthread intraprocess activities.
+
+Usage example:
+ mutex = identifier
+
+LOCK:
+ Lock the given mutex. Only one function owner can have the mutex locked at any time.
+ A caller that attempts to lock a mutex already locked by another caller will receive ACCESS_DENIED untill mutex owner unlocks the mutex.
+
+UNLOCK:
+ Unlock the given mutex. Other callers trying to lock the mutex/use the function will succeed.
+
+RELEASE
+ Releases Lock on exit from the function:
+
+CHECK:
+ Does not change the state of Mutex Lock state
+*/
+typedef enum { RESET, LOCK, RELEASE, KEEP} RESET_MMGR;
+
+typedef struct _AMI_DIGITAL_SIGNATURE_PROTOCOL {
+ AMI_DIGITAL_SIGNATURE_PKCS1_VERIFY Pkcs1Verify;
+ AMI_DIGITAL_SIGNATURE_PKCS7_VERIFY Pkcs7Verify;
+ AMI_DIGITAL_SIGNATURE_HASH Hash;
+ AMI_DIGITAL_SIGNATURE_GET_KEY GetKey;
+ AMI_DIGITAL_SIGNATURE_VERIFY_KEY VerifyKey;
+};
+
+//**********************************************************************
+// NEW UEFI 2.3.1c hash types
+//**********************************************************************
+#ifndef EFI_HASH_ALGORITHM_SHA256_NOPAD_GUID
+#define EFI_HASH_ALGORITHM_SHA1_NOPAD_GUID \
+ { \
+ 0x24c5dc2f, 0x53e2,0x40ca,{0x9e, 0xd6, 0xa5, 0xd9,0xa4, 0x9f, 0x46, 0x3b} \
+ }
+#define EFI_HASH_ALGORITHM_SHA256_NOPAD_GUID \
+ { \
+ 0x8628752a, 0x6cb7, 0x4814, {0x96, 0xfc, 0x24, 0xa8,0x15, 0xac, 0x22, 0x26} \
+ }
+GUID_VARIABLE_DECLARATION(gEfiHashAlgorithmSha1NoPadGuid,EFI_HASH_ALGORITHM_SHA1_NOPAD_GUID);
+GUID_VARIABLE_DECLARATION(gEfiHashAlgorithmSha256NoPadGuid,EFI_HASH_ALGORITHM_SHA256_NOPAD_GUID);
+#endif
+//**********************************************************************
+// NEW TIME STAMP definitions ECR#1009
+//**********************************************************************
+#ifndef EFI_CERT_X509_SHA256_GUID
+#define EFI_CERT_X509_SHA256_GUID \
+ { 0x3bd2a492, 0x96c0, 0x4079, 0xb4, 0x20, 0xfc, 0xf9, 0x8e, 0xf1, 0x03, 0xed }
+#define EFI_CERT_X509_SHA384_GUID \
+ { 0x7076876e, 0x80c2, 0x4ee6, 0xaa, 0xd2, 0x28, 0xb3, 0x49, 0xa6, 0x86, 0x5b }
+#define EFI_CERT_X509_SHA512_GUID \
+ { 0x446dbf63, 0x2502, 0x4cda, 0xbc, 0xfa, 0x24, 0x65, 0xd2, 0xb0, 0xfe, 0x9d }
+
+GUID_VARIABLE_DECLARATION(gEfiCertX509Sha256Guid, EFI_CERT_X509_SHA256_GUID);
+GUID_VARIABLE_DECLARATION(gEfiCertX509Sha384Guid, EFI_CERT_X509_SHA384_GUID);
+GUID_VARIABLE_DECLARATION(gEfiCertX509Sha512Guid, EFI_CERT_X509_SHA512_GUID);
+
+typedef struct _EFI_CERT_X509_SHA256 {
+ EFI_SHA256_HASH ToBeSignedHash;
+ EFI_TIME TimeOfRevocation;
+} EFI_CERT_X509_SHA256;
+
+typedef struct _EFI_CERT_X509_SHA384 {
+ EFI_SHA384_HASH ToBeSignedHash;
+ EFI_TIME TimeOfRevocation;
+} EFI_CERT_X509_SHA384;
+
+typedef struct _EFI_CERT_X509_SHA512 {
+ EFI_SHA512_HASH ToBeSignedHash;
+ EFI_TIME TimeOfRevocation;
+} EFI_CERT_X509_SHA512;
+
+#endif
+//**********************************************************************
+// NEW TIME STAMP definitions ECR#1009
+//**********************************************************************
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif // __AMI_DIGITAL_SIGNATURE_DXE__H__
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2013, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Pkwy, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//***********************************************************************
diff --git a/Include/Protocol/AmiInternalSmmComm.h b/Include/Protocol/AmiInternalSmmComm.h
new file mode 100644
index 0000000..fad3128
--- /dev/null
+++ b/Include/Protocol/AmiInternalSmmComm.h
@@ -0,0 +1,84 @@
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/SOURCE/Modules/SMM/AmiInternalSmmComm.h 1 4/15/11 4:43p Markw $
+//
+// $Revision: 1 $
+//
+// $Date: 4/15/11 4:43p $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/SOURCE/Modules/SMM/AmiInternalSmmComm.h $
+//
+// 1 4/15/11 4:43p Markw
+// [TAG] EIP57440
+// [Category] New Feature
+// [Description] Add PI 1.1 SMM Communicate support.
+// [Files] Smm.cif, SmmCommunicate.cif, SmmCommunicate.sdl,
+// SmmCommunicate.c, SmmCommunicate.dxs, SmmDxeCommunicate.dxs,
+// SmmCommunicate.mak, SmmPiProtocols.cif, SmmCommunication.h,
+// AmiInternalSmmComm.h
+//
+//**********************************************************************
+
+//<AMI_FHDR_START>
+//----------------------------------------------------------------------------
+//
+// Name: AmiInternalSmmComm.h
+//
+// Description: Protocol used by SmmCommunication to Communication DXE driver know SMM has been installed.
+//
+//----------------------------------------------------------------------------
+//<AMI_FHDR_END>
+
+#ifndef __AMI_INT_SMM_COMM_H__
+#define __AMI_INT_SMM_COMM_H__
+#if PI_SPECIFICATION_VERSION >= 0x0001000A
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+#include <EFI.h>
+
+// {B27DAB38-9814-4e06-A5A2-65AE9A14258F}
+#define AMI_INT_SMM_COMM_PROTOCOL_GUID \
+ {0xb27dab38, 0x9814, 0x4e06, 0xa5, 0xa2, 0x65, 0xae, 0x9a, 0x14, 0x25, 0x8f}
+
+GUID_VARIABLE_DECLARATION(gAmiIntSmmCommProtocolGuid,AMI_INT_SMM_COMM_PROTOCOL_GUID);
+
+//Currently this is a NULL protocol.
+
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+#endif
+
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
diff --git a/Include/Protocol/AmiKeycode.h b/Include/Protocol/AmiKeycode.h
new file mode 100644
index 0000000..3d53d03
--- /dev/null
+++ b/Include/Protocol/AmiKeycode.h
@@ -0,0 +1,152 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/Projects/Intel/Haswell/LynxPoint_SharkBay-DT_Crb_1AQQW/Include/Protocol/AmiKeycode.h 1 6/04/13 1:51a Thomaschen $
+//
+// $Revision: 1 $
+//
+// $Date: 6/04/13 1:51a $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/Projects/Intel/Haswell/LynxPoint_SharkBay-DT_Crb_1AQQW/Include/Protocol/AmiKeycode.h $
+//
+// 1 6/04/13 1:51a Thomaschen
+// Fixed for EIP118202.
+//
+// 10 10/25/12 2:36a Deepthins
+// [TAG] EIP99475
+// [Category] Improvement
+// [Description] Multi language module Support in the console splitter
+// [Files] ConSplit.c, ConSplit.h , In.c and AmiKeycode.h
+//
+// 9 7/21/11 3:57p Artems
+// EIP 64356: Combine common keyboard definitions in one file
+//
+// 8 10/13/09 6:06p Felixp
+// Hii.h renamed to UefiHii.h
+//
+// 7 10/09/09 3:53p Felixp
+// UEFI 2.1 related changes (new protocols added; existing protocols
+// updated; one protocol deleted).
+//
+// 6 8/21/09 10:19a Felixp
+// define GUID_VARIABLE_DECLARATION macro only if it has not been already
+// defined.
+//
+// 5 10/23/07 4:37p Olegi
+// Added PS2ScanCode field to the protocol.
+//
+// 4 9/18/07 11:52a Olegi
+//
+// 3 9/18/07 11:43a Olegi
+//
+// 2 9/17/07 3:53p Olegi
+// Removed EFI.H inclusion so that this header file can be also used in
+// EDK drivers.
+//
+// 1 9/07/07 4:35p Olegi
+//
+// 2 8/24/07 3:03p Olegi
+//
+// 1 8/23/07 2:44p Olegi
+//
+//**********************************************************************
+//<AMI_FHDR_START>
+//
+// Name: AmiKeycode.h
+//
+// Description: AMI_EFIKEYCODE_PROTOCOL definition
+//
+// Note: Currently this file is used both in Aptio and EDK files (MiniSetup.h)
+//
+//<AMI_FHDR_END>
+//**********************************************************************
+#ifndef __AMI_KEYCODE_PROTOCOL_H__
+#define __AMI_KEYCODE_PROTOCOL_H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <EFI.h>
+#include <KeyboardCommonDefinitions.h>
+
+#ifndef GUID_VARIABLE_DECLARATION
+#define GUID_VARIABLE_DECLARATION(Variable, Guid) extern EFI_GUID Variable
+#endif
+
+#define AMI_EFIKEYCODE_PROTOCOL_GUID \
+ {0x0adfb62d, 0xff74, 0x484c, 0x89, 0x44, 0xf8, 0x5c, 0x4b, 0xea, 0x87, 0xa8}
+
+#define AMI_MULTI_LANG_SUPPORT_PROTOCOL_GUID \
+ {0xb295bd1c, 0x63e3, 0x48e3, 0xb2, 0x65, 0xf7, 0xdf, 0xa2, 0x7, 0x1, 0x23}
+GUID_VARIABLE_DECLARATION(gAmiEfiKeycodeProtocolGuid,AMI_EFIKEYCODE_PROTOCOL_GUID);
+
+#ifndef GUID_VARIABLE_DEFINITION
+
+#include <Protocol/SimpleTextInEx.h>
+
+typedef struct _AMI_EFIKEYCODE_PROTOCOL AMI_EFIKEYCODE_PROTOCOL;
+typedef struct _AMI_MULTI_LANG_SUPPORT_PROTOCOL AMI_MULTI_LANG_SUPPORT_PROTOCOL;
+
+typedef struct {
+ EFI_INPUT_KEY Key;
+ EFI_KEY_STATE KeyState;
+ EFI_KEY EfiKey;
+ UINT8 EfiKeyIsValid;
+ UINT8 PS2ScanCode;
+ UINT8 PS2ScanCodeIsValid;
+} AMI_EFI_KEY_DATA;
+
+typedef EFI_STATUS (EFIAPI *AMI_READ_EFI_KEY) (
+ IN AMI_EFIKEYCODE_PROTOCOL *This,
+ OUT AMI_EFI_KEY_DATA *KeyData
+);
+
+typedef struct _AMI_EFIKEYCODE_PROTOCOL {
+ EFI_INPUT_RESET_EX Reset;
+ AMI_READ_EFI_KEY ReadEfikey;
+ EFI_EVENT WaitForKeyEx;
+ EFI_SET_STATE SetState;
+ EFI_REGISTER_KEYSTROKE_NOTIFY RegisterKeyNotify;
+ EFI_UNREGISTER_KEYSTROKE_NOTIFY UnregisterKeyNotify;
+} AMI_EFIKEYCODE_PROTOCOL;
+
+typedef EFI_STATUS (EFIAPI *EFI_KEYBOARD_LAYOUT_MAP)(
+ IN AMI_MULTI_LANG_SUPPORT_PROTOCOL *This,
+ IN OUT AMI_EFI_KEY_DATA *Keydata );
+
+typedef struct _AMI_MULTI_LANG_SUPPORT_PROTOCOL {
+ EFI_KEYBOARD_LAYOUT_MAP KeyboardLayoutMap;
+} AMI_MULTI_LANG_SUPPORT_PROTOCOL;
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#endif // #ifndef GUID_VARIABLE_DEFINITION
+#ifdef __cplusplus
+}
+#endif
+#endif
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//********************************************************************** \ No newline at end of file
diff --git a/Include/Protocol/AmiNvmeController.h b/Include/Protocol/AmiNvmeController.h
new file mode 100644
index 0000000..9e25525
--- /dev/null
+++ b/Include/Protocol/AmiNvmeController.h
@@ -0,0 +1,369 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2015, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+//**********************************************************************
+// $Header: /Alaska/SOURCE/Modules/NVMe/Nvme Protocol/AmiNvmeController.h 3 5/19/15 8:01a Deepthins $
+//
+// $Revision: 3 $
+//
+// $Date: 5/19/15 8:01a $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/SOURCE/Modules/NVMe/Nvme Protocol/AmiNvmeController.h $
+//
+// 3 5/19/15 8:01a Deepthins
+// [TAG] EIP218059
+// [Category] Improvement
+// [Description] Update Aptio4 NVME module to spec v1.2
+// [Files] AmiNvmeController.h, NvmeController.h
+//
+// 2 4/08/15 10:24a Anbuprakashp
+// [TAG] EIP212320
+// [Category] Bug Fix
+// [Severity] Critical
+// [Symptom] CPU exception in Nvme Driver if
+// PcdCpuSmmCodeAccessCheckEnable is enabled
+// [RootCause] BootService call shouldn't be used inside SMM function.
+// if PcdCpuSmmCodeAccessCheckEnable is enabled, It causes CPU exception.
+// [Solution] Changes made to avoid BootService call inside SMM function
+// [Files] NvmeSmm.c
+// NvmeBus.c
+// AmiNvmeController.h
+//
+// 1 9/04/14 8:02a Anandakrishnanl
+// [TAG] EIP180861
+// [Category] Improvement
+// [Description] Legacy Boot support in Aptio 4.x Nvme driver
+// [Files] AmiNvmeProtocol.cif
+// AmiNvmeController.h
+// AmiNvmePassThru.h
+// AmiNvmeLegacy.h
+//
+//**********************************************************************
+//**********************************************************************
+//<AMI_FHDR_START>
+//
+// Name: AmiNvmeController.h
+//
+// Description: Protocol Header file for the Nvme Controller
+//
+//<AMI_FHDR_END>
+//**********************************************************************
+
+#ifndef _NVME_CONTROLLER_PROTOCOL_H_
+#define _NVME_CONTROLLER_PROTOCOL_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+#include <Protocol/PciIo.h>
+
+#define NVME_MANUFACTUREID_LENGTH 30
+
+#ifndef EFI_LIST_ENTRY_DEFINED
+#define EFI_LIST_ENTRY_DEFINED
+typedef struct _EFI_LIST_ENTRY {
+ struct _EFI_LIST_ENTRY *ForwardLink;
+ struct _EFI_LIST_ENTRY *BackLink;
+} EFI_LIST_ENTRY;
+#endif
+
+typedef struct {
+ UINT64 ControllerCapabilities;
+ UINT32 Version;
+ UINT32 InterruptMaskSet;
+ UINT32 InterruptMaskClear;
+ UINT32 ControllerConfiguration;
+ UINT32 Reserved1;
+ UINT32 ControllerStatus;
+ UINT32 NVMSubSystemReset;
+ UINT32 AdminQueueAttributes;
+ UINT64 AdminSubmissionQueueBaseAddress;
+ UINT64 AdminCompletionQueueBaseAddress;
+ // Variable offsets follow
+} NVME_CONTROLLER_REGISTER;
+
+// Figure 10 NVM Express 1.2
+
+typedef struct {
+ UINT8 Opcode;
+ UINT8 FusedOperation : 2;
+ UINT8 RESERVED1 : 4;
+ UINT8 PSDT : 2;
+ UINT16 CommandIdentifier;
+} STRUC_CMD0;
+
+typedef struct {
+ STRUC_CMD0 CMD0;
+ UINT32 NSID;
+ UINT64 RESERVED1;
+ UINT64 MPTR;
+ UINT64 PRP1;
+ UINT64 PRP2;
+ UINT32 CDW10;
+ UINT32 CDW11;
+ UINT32 CDW12;
+ UINT32 CDW13;
+ UINT32 CDW14;
+ UINT32 CDW15;
+} NVME_ADMIN_COMMAND;
+
+//Figure 25 NVM Express 1.2 Spec
+typedef struct {
+ UINT32 DW0;
+ UINT32 DW1;
+ UINT16 SQHeadPointer;
+ UINT16 SQIdentifier;
+ UINT16 CommandIdentifier;
+ UINT16 PhaseTag : 1;
+ UINT16 StatusCode : 8;
+ UINT16 StatusCodeType : 3;
+ UINT16 Reservered1 : 2;
+ UINT16 More : 1;
+ UINT16 DoNotRetry : 1;
+} COMPLETION_QUEUE_ENTRY;
+
+// Figure 91 NVM Express 1.2 Spec
+typedef struct {
+
+ UINT16 MP; // Bits 15:0
+ UINT8 Reserved1; // Bits 23:16
+ UINT8 MPS : 1; // Bits 24
+ UINT8 NOPS : 1; // Bits 25
+ UINT8 Reserved2 : 6; // Bits 31:26
+ UINT32 ENLAT; // Bits 63:32
+ UINT32 EXLAT; // Bits 95:64
+ UINT8 RRT : 5; // Bits 100:96
+ UINT8 Reserved3 : 3; // Bits 103:101
+ UINT8 RRL : 5; // Bits 108:104
+ UINT8 Reserved4 : 3; // Bits 111:109
+ UINT8 RWT : 5; // Bits 116:112
+ UINT8 Reserved5 : 3; // Bits 119:117
+ UINT8 RWL : 5; // Bits 124:120
+ UINT8 Reserved6 : 3; // Bits 127:125
+ UINT16 IDLP; // Bits 143:128
+ UINT8 Reserved7 : 6; // Bits 149:144
+ UINT8 IPS :2; // Bits 151:150
+ UINT8 Reserved8; // Bits 159:152
+ UINT16 ACTP; // Bits 175:160
+ UINT8 APW : 3; // Bits 178:176
+ UINT8 Reserved9 : 3; // Bits 181:179
+ UINT8 APS : 2; // Bits 183:182
+ UINT8 Reserved10[9]; // Bits 255:184
+} POWER_STATE_DESCRIPTOR;
+
+// Figure 90 NVM Express 1.2 spec
+typedef struct {
+ UINT16 VID; // Offset 01:00
+ UINT16 SSVID; // Offset 03:02
+ UINT8 SerialNumber[20]; // Offset 23:04
+ UINT8 ModelNumber[40]; // Offset 63:24
+ UINT8 FirmwareRevision[8]; // Offset 71:64
+ UINT8 ArbitrationBurst; // Offset 72
+ UINT8 IEEEOUIIdentifier[3]; // Offset 75:73
+ UINT8 CMIC; // Offset 76
+ UINT8 MDTS; // Offset 77
+ UINT16 ControllerID; // Offset 79:78
+ UINT32 VER; // Offset 83:80
+ UINT32 RTD3R; // Offset 87:84
+ UINT32 RTD3E; // Offset 91:88
+ UINT32 OAES; // Offset 95:92
+ UINT8 Reserved1[144]; // Offset 239:96
+ UINT8 MTCP[16]; // Offset 255:240
+ UINT16 OACS; // Offset 257:256
+ UINT8 ACL; // Offset 258
+ UINT8 AERL; // Offset 259
+ UINT8 FRMW; // Offset 260
+ UINT8 LPA; // Offset 261
+ UINT8 ELPE; // Offset 262
+ UINT8 NPSS; // Offset 263
+ UINT8 AVSCC; // Offset 264
+ UINT8 APSTA; // Offset 265
+ UINT16 WCTEMP; // Offset 267:266
+ UINT16 CCTEMP; // Offset 269:268
+ UINT16 MTFA; // Offset 271:270
+ UINT32 HMPRE; // Offset 275:272
+ UINT32 HMMIN; // Offset 279:276
+ UINT8 TNVMCAP[16]; // Offset 295:280
+ UINT8 UNVMCAP[16]; // Offset 311:296
+ UINT32 RPMBS; // Offset 315:312
+ UINT8 Reserved2[196]; // Offset 511:316
+ UINT8 SQES; // Offset 512
+ UINT8 CQES; // Offset 513
+ UINT16 Reserved3; // Offset 515:514
+ UINT32 NN; // Offset 519:516
+ UINT16 ONCS; // Offset 521:520
+ UINT16 FUSES; // Offset 523:522
+ UINT8 FNA; // Offset 524
+ UINT8 VWC; // Offset 525
+ UINT16 AWUN; // Offset 527:526
+ UINT16 AWUPF; // Offset 529:528
+ UINT8 NVSCC; // Offset 530
+ UINT8 Reserved4; // Offset 531
+ UINT16 ACWU; // Offset 533:532
+ UINT16 Reserved5; // Offset 535:536
+ UINT32 SGLS; // Offset 539:536
+ UINT8 Reserved6[164]; // Offset 703:540
+ UINT8 Reserved7[1344]; // Offset 2047:704
+ POWER_STATE_DESCRIPTOR psdd[32]; // Offset 3071:2048
+ UINT8 VS[1024]; // Offset 4095:3072
+} IDENTIFY_CONTROLLER_DATA;
+
+// Figure 93 NVM Express 1.2 Spec
+typedef struct {
+
+ UINT16 MS; // Bits 15:0
+ UINT8 LBADS; // Bits 23:16
+ UINT8 RP : 2; // Bits 25:24
+ UINT8 Reserved1 :6; // Bits 31:26
+
+} LBA_FORMAT_DATA;
+
+
+// Figure 92 NVM Express 1.2 Spec
+typedef struct {
+
+ UINT64 NSIZE; // Offset 7:0
+ UINT64 NCAP; // Offset 15:8
+ UINT64 NUSE; // Offset 23:16
+ UINT8 NSFEAT; // Offset 24
+ UINT8 NLBAF; // Offset 25
+ UINT8 FLBAS; // Offset 26
+ UINT8 MC; // Offset 27
+ UINT8 DPC; // Offset 28
+ UINT8 DPS; // Offset 29
+ UINT8 NMIC; // Offset 30
+ UINT8 RESCAP; // Offset 31
+ UINT8 FPI; // Offset 32
+ UINT8 Reserved1; // Offset 33
+ UINT16 NAWUN; // Offset 35:34
+ UINT16 NAWUPF; // Offset 37:36
+ UINT16 NACWU; // Offset 39:38
+ UINT16 NABSN; // Offset 41:40
+ UINT16 NABO; // Offset 43:42
+ UINT16 NABSPF; // Offset 45:44
+ UINT8 Reserved2[2]; // Offset 46:47
+ UINT8 NVMCAP[16]; // Offset 63:48
+ UINT8 Reserved3[40]; // Offset 103:64
+ UINT8 NGUID[16]; // Offset 119:104
+ UINT64 EUI64; // Offset 127:120
+ LBA_FORMAT_DATA LBAF[16]; // Offset 191:128
+ UINT8 Reserved4[192]; // Offset 383:192
+ UINT8 VS[3712]; // Offset 4095:384
+
+} IDENTIFY_NAMESPACE_DATA;
+
+typedef struct {
+ NVME_ADMIN_COMMAND NvmCmd;
+ BOOLEAN AdminOrNVMCmdSet; // TRUE for Admin
+ UINT16 SQIdentifier; // Queue 0 for Admin cmds and 1 for NVM cmds
+ UINT32 CmdTimeOut; // In msec.
+ UINT8 RetryCount;
+} NVME_COMMAND_WRAPPER;
+
+typedef struct {
+
+ UINT64 NvmeBarOffset;
+ EFI_PCI_IO_PROTOCOL *PciIO;
+ EFI_HANDLE ControllerHandle;
+ UINT16 CommandIdentifierAdmin;
+ UINT16 CommandIdentifierQueue1;
+ UINT64 RawControllerCapabilities;
+ UINT32 MaxQueueEntrySupported;
+ BOOLEAN ContiguousQueueRequired;
+ UINT8 ArbitrationMechanismSupport;
+ UINT8 TimeOut;
+ UINT8 DoorBellStride;
+ BOOLEAN NVMResetSupport;
+ UINT8 CmdSetsSupported;
+ UINT32 MemoryPageSizeMin;
+ UINT32 MemoryPageSizeMax;
+ UINT32 MemoryPageSize; // In Bytes
+ NVME_COMMAND_WRAPPER *NvmeCmdWrapper; // Will be used by internal routines
+
+//----------------------------Admin Queue--------------------------------------------------------------
+ UINT64 AdminSubmissionUnAligned; // Points to the start of the buffer
+ UINT64 AdminSubmissionQueue; // Points to the start of the buffer Aligned
+ UINT64 AdminSubmissionQueueMappedAddr; // Mapped address for the controller to use
+ VOID *AdminSubmissionQueueUnMap; //
+ UINTN AdminSubmissionUnAlignedSize; // in Pages
+ UINT64 AdminCompletionUnAligned;
+ UINT64 AdminCompletionQueue;
+ UINT64 AdminCompletionQueueMappedAddr;
+ VOID *AdminCompletionQueueUnMap;
+ UINTN AdminCompletionUnAlignedSize;
+ UINT16 AdminSubmissionQueueSize; // Max is 4KB
+ UINT16 AdminCompletionQueueSize; // Max is 4KB
+ UINT16 AdminCompletionQueueHeadPtr;
+ UINT16 AdminCompletionQueueTailPtr;
+ UINT16 AdminSubmissionQueueHeadPtr; // Updated from Completion queue entry
+ UINT16 AdminSubmissionQueueTailPtr; // Updated when new cmds are issued
+ UINT8 AdminPhaseTag : 1;
+ UINT8 RESERVED : 7;
+
+//----------------------------Queue1 for Nvme Cmds------------------------------------------------------
+ UINT16 NVMQueueNumber;
+ UINT64 Queue1SubmissionUnAligned; // Points to the start of the buffer
+ UINTN Queue1SubmissionUnAlignedSize; // Original size
+ UINT64 Queue1SubmissionQueue; // Aligned address
+ UINT64 Queue1SubmissionQueueMappedAddr; // Address for controller to use
+ VOID *Queue1SubmissionQueueUnMap;
+ UINT64 Queue1CompletionUnAligned;
+ UINTN Queue1CompletionUnAlignedSize;
+ UINT64 Queue1CompletionQueue;
+ UINT64 Queue1CompletionQueueMappedAddr;
+ VOID *Queue1CompletionQueueUnMap;
+ UINT32 Queue1SubmissionQueueSize;
+ UINT32 Queue1CompletionQueueSize;
+ UINT16 Queue1CompletionQueueHeadPtr;
+ UINT16 Queue1CompletionQueueTailPtr;
+ UINT16 Queue1SubmissionQueueHeadPtr; // Updated from Completion queue entry
+ UINT16 Queue1SubmissionQueueTailPtr; // Updated when new cmds are issued
+ UINT8 Queue1PhaseTag : 1;
+ UINT8 RESERVED1 : 7;
+ BOOLEAN ReInitializingQueue1; // Flag used to prevent initializing Queue1 in an infinite loop
+
+ //-----------------------------------------------------------------------------------------------------
+ VOID *LegacyNvmeBuffer;
+ BOOLEAN NvmeInSmm;
+ IDENTIFY_CONTROLLER_DATA *IdentifyControllerData;
+ UINT32 *ActiveNameSpaceIDs;
+ EFI_LIST_ENTRY ActiveNameSpaceList; // Linked list of Active Name space found in this controller
+} AMI_NVME_CONTROLLER_PROTOCOL;
+
+
+extern EFI_GUID gAmiNvmeControllerProtocolGuid;
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2015, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
diff --git a/Include/Protocol/AmiNvmeLegacy.h b/Include/Protocol/AmiNvmeLegacy.h
new file mode 100644
index 0000000..b47f14b
--- /dev/null
+++ b/Include/Protocol/AmiNvmeLegacy.h
@@ -0,0 +1,86 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2014, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+//**********************************************************************
+// $Header: /Alaska/SOURCE/Modules/NVMe/Nvme Protocol/AmiNvmeLegacy.h 1 9/04/14 8:02a Anandakrishnanl $
+//
+// $Revision: 1 $
+//
+// $Date: 9/04/14 8:02a $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/SOURCE/Modules/NVMe/Nvme Protocol/AmiNvmeLegacy.h $
+//
+// 1 9/04/14 8:02a Anandakrishnanl
+// [TAG] EIP180861
+// [Category] Improvement
+// [Description] Legacy Boot support in Aptio 4.x Nvme driver
+// [Files] AmiNvmeProtocol.cif
+// AmiNvmeController.h
+// AmiNvmePassThru.h
+// AmiNvmeLegacy.h
+//
+//**********************************************************************
+//**********************************************************************
+//<AMI_FHDR_START>
+//
+// Name: AmiNvmeLegacy.h
+//
+// Description: Protocol header file the Ami Nvme Legacy interface
+//
+//<AMI_FHDR_END>
+//**********************************************************************
+
+#ifndef __NVME_LEGACY_PROTOCOL_H__
+#define __NVME_LEGACY_PROTOCOL_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef struct _NVME_LEGACY_MASS_DEVICE NVME_LEGACY_MASS_DEVICE;
+
+typedef EFI_STATUS
+(EFIAPI *AMI_NVME_LEGACY_DEVICE_INSTALL)(
+ IN OUT NVME_LEGACY_MASS_DEVICE *AddNvmeLegacyDevice
+);
+
+typedef struct {
+ AMI_NVME_LEGACY_DEVICE_INSTALL AddNvmeLegacyDevice;
+} AMI_NVME_LEGACY_PROTOCOL;
+
+
+extern EFI_GUID gAmiNvmeLegacyProtocolGuid;
+
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2014, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
diff --git a/Include/Protocol/AmiNvmePassThru.h b/Include/Protocol/AmiNvmePassThru.h
new file mode 100644
index 0000000..074a3d2
--- /dev/null
+++ b/Include/Protocol/AmiNvmePassThru.h
@@ -0,0 +1,88 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2014, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+//**********************************************************************
+// $Header: /Alaska/SOURCE/Modules/NVMe/Nvme Protocol/AmiNvmePassThru.h 1 9/04/14 8:02a Anandakrishnanl $
+//
+// $Revision: 1 $
+//
+// $Date: 9/04/14 8:02a $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/SOURCE/Modules/NVMe/Nvme Protocol/AmiNvmePassThru.h $
+//
+// 1 9/04/14 8:02a Anandakrishnanl
+// [TAG] EIP180861
+// [Category] Improvement
+// [Description] Legacy Boot support in Aptio 4.x Nvme driver
+// [Files] AmiNvmeProtocol.cif
+// AmiNvmeController.h
+// AmiNvmePassThru.h
+// AmiNvmeLegacy.h
+//
+//**********************************************************************
+//**********************************************************************
+//<AMI_FHDR_START>
+//
+// Name: AmiNvmePassThru.h
+//
+// Description: Protocol Header file for the Nvme PassThru Protocol
+//
+//<AMI_FHDR_END>
+//**********************************************************************
+
+#ifndef _NVME_PASSTHRU_PROTOCOL_H_
+#define _NVME_PASSTHRU_PROTOCOL_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <Protocol/AmiNvmeController.h>
+
+typedef struct _AMI_NVME_PASS_THRU_PROTOCOL AMI_NVME_PASS_THRU_PROTOCOL;
+
+typedef EFI_STATUS
+(EFIAPI *AMI_NVME_PASS_THRU_EXECUTECMD)(
+ IN AMI_NVME_CONTROLLER_PROTOCOL *NvmeController,
+ IN NVME_COMMAND_WRAPPER *NvmeCmdWrapper,
+ OUT COMPLETION_QUEUE_ENTRY *CmdCompletionData
+);
+
+typedef struct _AMI_NVME_PASS_THRU_PROTOCOL {
+ AMI_NVME_PASS_THRU_EXECUTECMD ExecuteNvmeCmd;
+} AMI_NVME_PASS_THRU_PROTOCOL;
+
+extern EFI_GUID gAmiNvmePassThruProtocolGuid;
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2014, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
diff --git a/Include/Protocol/AmiNvmeProtocol.cif b/Include/Protocol/AmiNvmeProtocol.cif
new file mode 100644
index 0000000..3687a8c
--- /dev/null
+++ b/Include/Protocol/AmiNvmeProtocol.cif
@@ -0,0 +1,11 @@
+<component>
+ name = "Nvme Protocol"
+ category = ModulePart
+ LocalRoot = "Include\Protocol\"
+ RefName = "NvmeProtocol"
+[files]
+"AmiNvmeController.h"
+"AmiNvmePassThru.h"
+"AmiNvmeLegacy.h"
+"NvmExpressPassThru.h"
+<endComponent>
diff --git a/Include/Protocol/AmiReflashProtocol.h b/Include/Protocol/AmiReflashProtocol.h
new file mode 100644
index 0000000..1fe8127
--- /dev/null
+++ b/Include/Protocol/AmiReflashProtocol.h
@@ -0,0 +1,102 @@
+//*****************************************************************//
+//*****************************************************************//
+//*****************************************************************//
+//** **//
+//** (C)Copyright 2012, American Megatrends, Inc. **//
+//** **//
+//** All Rights Reserved. **//
+//** **//
+//** 5555 Oakbrook Pkwy, Building 200,Norcross, Georgia 30093 **//
+//** **//
+//** Phone (770)-246-8600 **//
+//** **//
+//*****************************************************************//
+//*****************************************************************//
+//*****************************************************************//
+// $Archive: /Alaska/BIN/Core/Include/Protocol/AmiReflashProtocol.h $
+//
+// $Author: Artems $
+//
+// $Revision: 1 $
+//
+// $Date: 7/20/12 10:09a $
+//
+//*****************************************************************//
+//*****************************************************************//
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Core/Include/Protocol/AmiReflashProtocol.h $
+//
+// 1 7/20/12 10:09a Artems
+// [TAG] EIP93520
+// [Category] New Feature
+// [Description] Added AmiReflashProtocol definition file
+// [Files] AmiReflashProtocol.h
+//
+//*****************************************************************//
+//*****************************************************************//
+//<AMI_FHDR_START>
+//----------------------------------------------------------------------------
+//
+// Name: AMIReflashProtocol.h
+//
+// Description: Header file for ESRT.
+//
+//----------------------------------------------------------------------------
+//<AMI_FHDR_END>
+
+#ifndef __REFLASH_PROTOCOL__H__
+#define __REFLASH_PROTOCOL__H__
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+#define EFI_REFLASH_PROTOCOL_GUID \
+ {0x8fe545e5, 0xdca9, 0x4d52, 0xbf, 0xcd, 0x8f, 0x13, 0xe7, 0x17, 0x1, 0x5f}
+
+GUID_VARIABLE_DECLARATION(gAmiReflashProtocolGuid, EFI_REFLASH_PROTOCOL_GUID);
+
+typedef struct _EFI_REFLASH_PROTOCOL EFI_REFLASH_PROTOCOL;
+
+typedef EFI_STATUS
+(EFIAPI *EFI_REFLASH_PROGRESS)(
+ IN EFI_REFLASH_PROTOCOL *This
+);
+
+typedef EFI_STATUS
+(EFIAPI *EFI_REFLASH_GET_DISPLAY_IMAGE)(
+ IN EFI_REFLASH_PROTOCOL *This,
+ OUT UINTN *CoordinateX,
+ OUT UINTN *CoordinateY,
+ OUT VOID **ImageAddress
+);
+
+struct _EFI_REFLASH_PROTOCOL {
+ EFI_REFLASH_PROGRESS CapUpdProgress;
+ EFI_REFLASH_GET_DISPLAY_IMAGE GetDisplayImage;
+};
+
+
+ /****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+
+//*****************************************************************//
+//*****************************************************************//
+//*****************************************************************//
+//** **//
+//** (C)Copyright 2012, American Megatrends, Inc. **//
+//** **//
+//** All Rights Reserved. **//
+//** **//
+//** 5555 Oakbrook Pkwy, Building 200,Norcross, Georgia 30093 **//
+//** **//
+//** Phone (770)-246-8600 **//
+//** **//
+//*****************************************************************//
+//*****************************************************************//
+//*****************************************************************// \ No newline at end of file
diff --git a/Include/Protocol/AmiSetupProtocol.cif b/Include/Protocol/AmiSetupProtocol.cif
new file mode 100644
index 0000000..1c916f9
--- /dev/null
+++ b/Include/Protocol/AmiSetupProtocol.cif
@@ -0,0 +1,8 @@
+<component>
+ name = "AmiSetup Protocol"
+ category = ModulePart
+ LocalRoot = "Include\Protocol\"
+ RefName = "AmiSetupProtocol"
+[files]
+"AmiSetupProtocol.h"
+<endComponent>
diff --git a/Include/Protocol/AmiSetupProtocol.h b/Include/Protocol/AmiSetupProtocol.h
new file mode 100644
index 0000000..9a16881
--- /dev/null
+++ b/Include/Protocol/AmiSetupProtocol.h
@@ -0,0 +1,115 @@
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2012, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
+
+//*************************************************************************
+// $Header: /Alaska/BIN/Board/Setup/AmiSetupProtocol.h 1 8/28/12 4:18p Artems $
+//
+// $Revision: 1 $
+//
+// $Date: 8/28/12 4:18p $
+//*************************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Board/Setup/AmiSetupProtocol.h $
+//
+// 1 8/28/12 4:18p Artems
+// [TAG] EIP N/A
+// [Category] New Feature
+// [Description] Add infrastructure to support runtime registration of
+// setup controls callbacks
+// [Files] Setup.c Setup.h Setup.cif AmiSetupProtocol.c
+// AmiSetupProtocol.h
+//
+//
+//*************************************************************************
+//<AMI_FHDR_START>
+//
+// Name: AmiSetupProtocol.h
+//
+// Description:
+// AMI Setup protocol definitions
+//
+//<AMI_FHDR_END>
+//*************************************************************************
+#ifndef __AMI_SETUP_PROTOCOL__H__
+#define __AMI_SETUP_PROTOCOL__H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <Setup.h>
+
+// {C528AA1C-4011-42ee-A551-5238B8FB5A9F}
+#define AMI_SETUP_PROTOCOL_GUID \
+ { 0xc528aa1c, 0x4011, 0x42ee, 0xa5, 0x51, 0x52, 0x38, 0xb8, 0xfb, 0x5a, 0x9f }
+
+
+GUID_VARIABLE_DECLARATION(AmiSetupProtocolGuid, AMI_SETUP_PROTOCOL_GUID);
+
+typedef
+EFI_STATUS
+(EFIAPI *AMI_SETUP_REGISTER_CALLBACK) (
+ IN UINT16 Class,
+ IN UINT16 Subclass,
+ IN UINT16 Key,
+ IN SETUP_ITEM_CALLBACK_HANDLER *Handler,
+ OUT EFI_HANDLE *Handle
+ );
+
+typedef
+EFI_STATUS
+(EFIAPI *AMI_SETUP_UNREGISTER_CALLBACK) (
+ IN EFI_HANDLE Handle
+ );
+
+typedef
+EFI_STATUS
+(EFIAPI *AMI_SETUP_GET_CALLBACKS) (
+ IN OUT UINTN *BufferSize,
+ OUT SETUP_ITEM_CALLBACK *Buffer
+ );
+
+typedef
+EFI_STATUS
+(EFIAPI *AMI_SETUP_GET_CALLBACK_PARAMETERS) (
+ OUT CALLBACK_PARAMETERS **Parameters
+ );
+
+typedef struct _AMI_SETUP_PROTOCOL
+{
+ AMI_SETUP_REGISTER_CALLBACK RegisterCallback;
+ AMI_SETUP_UNREGISTER_CALLBACK UnregisterCallback;
+ AMI_SETUP_GET_CALLBACKS GetCallbacks;
+ AMI_SETUP_GET_CALLBACK_PARAMETERS GetCallbackParameters;
+} AMI_SETUP_PROTOCOL;
+
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2012, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
diff --git a/Include/Protocol/AmiSio.h b/Include/Protocol/AmiSio.h
new file mode 100644
index 0000000..f807300
--- /dev/null
+++ b/Include/Protocol/AmiSio.h
@@ -0,0 +1,131 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2005, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/BIN/Core/Include/Protocol/AmiSio.h 4 4/03/06 5:01p Felixp $Revision: $
+//
+// $Date: 4/03/06 5:01p $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log:
+//
+
+//**********************************************************************
+//<AMI_FHDR_START>
+//
+// Name: AmiSio.h
+//
+// Description: AMI Sio Protocol Definitions.
+//
+//<AMI_FHDR_END>
+//**********************************************************************
+#ifndef __SIO_PROTOCOL_H__
+#define __SIO_PROTOCOL_H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+#include <EFI.h>
+
+// 51E9B4F9-555D-476c-8BB5-BD18D9A68878
+#define EFI_AMI_SIO_PROTOCOL_GUID \
+ {0x51e9b4f9,0x555d,0x476c,0x8b, 0xb5, 0xbd, 0x18, 0xd9, 0xa6, 0x88, 0x78}
+
+GUID_VARIABLE_DECLARATION(gEfiAmiSioProtocolGuid,EFI_AMI_SIO_PROTOCOL_GUID);
+
+#ifndef GUID_VARIABLE_DEFINITION
+#include <AmiDxeLib.h>
+
+typedef struct _AMI_SIO_PROTOCOL AMI_SIO_PROTOCOL;
+
+typedef struct _EFI_EISAID {
+ UINT32 HID;
+ UINT32 UID;
+} EFI_EISAID;
+
+//This list migt be extended if some devices
+//not mention here present in SIO
+typedef enum {
+ dsNone=0,
+ dsFDC,
+ dsPS2K, //PS2 Keyboard Controller if KBC on separate from MS Logical Device
+ dsPS2M, //PS2 Mouse Controller if MS on separate from KBC Logical Device
+ dsPS2CK,//PS2 Keyboard Controller where KBC and MS on same Logical Device
+ dsPS2CM,//PS2 Mouse Controller where KBC and MS on same Logical Device
+ dsUART,
+ dsLPT,
+ dsGAME,
+ dsSB16,
+ dsMPU401,
+ dsFmSynth,
+ dsCIR,
+ dsGPIO,
+ dsHwMon,
+ dsPME,
+ dsACPI,
+} SIO_DEV_TYPE;
+
+
+typedef EFI_STATUS (*SIO_REGISTER) (
+ IN AMI_SIO_PROTOCOL *This,
+ IN BOOLEAN Write,
+ IN BOOLEAN ExitCfgMode,
+ IN UINT8 Register,
+ IN OUT UINT8 *Value
+);
+
+typedef EFI_STATUS (*SIO_RESOURCES)(
+ IN AMI_SIO_PROTOCOL *This,
+ IN BOOLEAN Set,
+ IN OUT T_ITEM_LIST **Resources
+);
+
+//**********************************************************************
+//<AMI_SHDR_START>
+//
+// Name: AMI_SIO_PROTOCOL
+//
+// Description: Functions to access the SIO.
+//
+// Fields: Name Type Description
+// ------------------------------------------------------------
+//
+//<AMI_SHDR_END>
+//**********************************************************************
+typedef struct _AMI_SIO_PROTOCOL {
+ SIO_REGISTER Access;
+ SIO_RESOURCES CurrentRes;
+ SIO_RESOURCES PossibleRes;
+} AMI_SIO_PROTOCOL;
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#endif // #ifndef GUID_VARIABLE_DEFINITION
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2005, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
diff --git a/Include/Protocol/AmiSmmInfo.h b/Include/Protocol/AmiSmmInfo.h
new file mode 100644
index 0000000..5debe9f
--- /dev/null
+++ b/Include/Protocol/AmiSmmInfo.h
@@ -0,0 +1,90 @@
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2010, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/SOURCE/Modules/SMM/AmiSmmInfo.h 1 2/25/10 5:17p Markw $
+//
+// $Revision: 1 $
+//
+// $Date: 2/25/10 5:17p $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/SOURCE/Modules/SMM/AmiSmmInfo.h $
+//
+// 1 2/25/10 5:17p Markw
+// Initial version
+//
+//**********************************************************************
+
+//<AMI_FHDR_START>
+//----------------------------------------------------------------------------
+//
+// Name: AmiSmmInfo.h
+//
+// Description: Provide AMI Smm Info
+//
+//----------------------------------------------------------------------------
+//<AMI_FHDR_END>
+
+#ifndef __AMI_SMM_INFO_H__
+#define __AMI_SMM_INFO_H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+#include <Efi.h>
+
+// {EB5198EB-E7F5-45a1-9CCB-E53364BB4992}
+#define AMI_SMM_INFO_PROTOCOL_GUID \
+ {0xeb5198eb, 0xe7f5, 0x45a1, 0x9c, 0xcb, 0xe5, 0x33, 0x64, 0xbb, 0x49, 0x92}
+
+GUID_VARIABLE_DECLARATION(gAmiSmmInfoProtcolGuid, AMI_SMM_INFO_PROTOCOL_GUID);
+
+typedef struct _AMI_SMM_INFO_PROTOCOL AMI_SMM_INFO_PROTOCOL;
+
+
+typedef EFI_STATUS (EFIAPI *GET_NUM_OF_CPUS_INSIDE_SMM) (
+ IN AMI_SMM_INFO_PROTOCOL *This,
+ OUT UINT32 *Cpus
+);
+
+
+struct _AMI_SMM_INFO_PROTOCOL {
+ UINT32 ProtocolVer;
+ GET_NUM_OF_CPUS_INSIDE_SMM GetNumOfCpusInsideSmm;
+};
+
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2009, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
+
+
+
diff --git a/Include/Protocol/AmiTcgPlatformProtocol.cif b/Include/Protocol/AmiTcgPlatformProtocol.cif
new file mode 100644
index 0000000..d716354
--- /dev/null
+++ b/Include/Protocol/AmiTcgPlatformProtocol.cif
@@ -0,0 +1,8 @@
+<component>
+ name = "AmiTcgPlatformProtocol"
+ category = ModulePart
+ LocalRoot = "Include\Protocol"
+ RefName = "AmiTcgPlatformProtocol"
+[files]
+"AmiTcgPlatformProtocol.h"
+<endComponent>
diff --git a/Include/Protocol/AmiTcgPlatformProtocol.h b/Include/Protocol/AmiTcgPlatformProtocol.h
new file mode 100644
index 0000000..ffbfed2
--- /dev/null
+++ b/Include/Protocol/AmiTcgPlatformProtocol.h
@@ -0,0 +1,92 @@
+//**********************************************************************//
+//**********************************************************************//
+//** **//
+//** (C)Copyright 1985-2012, American Megatrends, Inc. **//
+//** **//
+//** All Rights Reserved. **//
+//** **//
+//** 5555 Oakbrook Pkwy, Suite 200, Norcross, GA 30093 **//
+//** **//
+//** Phone: (770)-246-8600 **//
+//** **//
+//**********************************************************************//
+//**********************************************************************//
+//**********************************************************************//
+// $Header: /Alaska/SOURCE/Modules/TCG2/CommonHeaders/AmiTcgPlatformProtocol/AmiTcgPlatformProtocol.h 1 4/21/14 2:15p Fredericko $
+//
+// $Revision: 1 $
+//
+// $Date: 4/21/14 2:15p $
+//**********************************************************************//
+// Revision History
+// ----------------
+// $Log: /Alaska/SOURCE/Modules/TCG2/CommonHeaders/AmiTcgPlatformProtocol/AmiTcgPlatformProtocol.h $
+//
+// 1 4/21/14 2:15p Fredericko
+//
+// 1 10/08/13 12:01p Fredericko
+// Initial Check-In for Tpm-Next module
+//
+// 1 7/10/13 5:59p Fredericko
+// [TAG] EIP120969
+// [Category] New Feature
+// [Description] TCG (TPM20)
+//
+// 1 12/12/11 3:03p Fredericko
+// [TAG] EIP76865
+// [Category] Improvement
+// [Description] Dual Support for TCM and TPM. System could hang in TXT
+// if txt is enabled in setup
+// [Files] AmiTcgPlatfompeilib.c, AmiTcgPlatformPpi.cif,
+// AmiTcgPlatformPpi.h, AmiTcgPlatformProtocol.cif,
+// AmiTcgPlatformProtocol.h,
+// EMpTcmPei.c, TcgDxe.cif, TcgPei.cif, TcgPeiAfterMem.cif,
+// TcgPeiAfterMem.mak, TcgTcmPeiAfterMem.c, xTcgDxe.c, xTcgPei.c,
+// xTcgPeiAfterMem.c
+//
+// 1 12/12/11 2:59p Fredericko
+// [TAG] EIP76865
+// [Category] Improvement
+// [Description] Dual Support for TCM and TPM. System could hang in TXT
+// if txt is enabled in setup
+// [Files] AmiTcgPlatfompeilib.c, AmiTcgPlatformPpi.cif,
+// AmiTcgPlatformPpi.h, AmiTcgPlatformProtocol.cif,
+// AmiTcgPlatformProtocol.h,
+// EMpTcmPei.c, TcgDxe.cif, TcgPei.cif, TcgPeiAfterMem.cif,
+// TcgPeiAfterMem.mak, TcgTcmPeiAfterMem.c, xTcgDxe.c, xTcgPei.c,
+// xTcgPeiAfterMem.c
+//
+//**********************************************************************//
+
+#ifndef _AMI_TCG_PLATFORM_PROTOCOL_H_
+#define _AMI_TCG_PLATFORM_PROTOCOL_H_
+
+#include <token.h>
+
+#define AMI_TCG_PLATFORM_PROTOCOL_GUID \
+ {0x320bdc39, 0x3fa0, 0x4ba9, 0xbf, 0x2d, 0xb3, 0x3f, 0x72, 0xba, 0x9c, 0xa1}
+
+typedef struct _AMI_TCG_PLATFORM_PROTOCOL AMI_TCG_PLATFORM_PROTOCOL;
+
+// for now all it does is return the platform security support type
+typedef UINT8 (*GET_TCG_SUPPORT_TYPE)();
+
+struct _AMI_TCG_PLATFORM_PROTOCOL {
+ GET_TCG_SUPPORT_TYPE GetPlatformSecurityType;
+};
+
+#endif
+
+//**********************************************************************//
+//**********************************************************************//
+//** **//
+//** (C)Copyright 1985-2012, American Megatrends, Inc. **//
+//** **//
+//** All Rights Reserved. **//
+//** **//
+//** 5555 Oakbrook Pkwy, Suite 200, Norcross, GA 30093 **//
+//** **//
+//** Phone: (770)-246-8600 **//
+//** **//
+//**********************************************************************//
+//**********************************************************************//
diff --git a/Include/Protocol/AmiTpmClearOnRollbackProtocol.cif b/Include/Protocol/AmiTpmClearOnRollbackProtocol.cif
new file mode 100644
index 0000000..06507c8
--- /dev/null
+++ b/Include/Protocol/AmiTpmClearOnRollbackProtocol.cif
@@ -0,0 +1,8 @@
+<component>
+ name = "AmiTpmClearOnRollbackProtocol"
+ category = ModulePart
+ LocalRoot = "Include\Protocol"
+ RefName = "AmiTpmClearOnRollbackProtocol"
+[files]
+"AmiTpmClearOnRollbackProtocol.h"
+<endComponent>
diff --git a/Include/Protocol/AmiTpmClearOnRollbackProtocol.h b/Include/Protocol/AmiTpmClearOnRollbackProtocol.h
new file mode 100644
index 0000000..9002010
--- /dev/null
+++ b/Include/Protocol/AmiTpmClearOnRollbackProtocol.h
@@ -0,0 +1,79 @@
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
+//**********************************************************************
+// $Header: /Alaska/SOURCE/Modules/TCG2/CommonHeaders/AmiTpmClearOnRollbackProtocol/AmiTpmClearOnRollbackProtocol.h 1 4/21/14 2:16p Fredericko $
+//
+// $Revision: 1 $
+//
+// $Date: 4/21/14 2:16p $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/SOURCE/Modules/TCG2/CommonHeaders/AmiTpmClearOnRollbackProtocol/AmiTpmClearOnRollbackProtocol.h $
+//
+// 1 4/21/14 2:16p Fredericko
+//
+// 1 10/08/13 12:01p Fredericko
+// Initial Check-In for Tpm-Next module
+//
+// 1 7/10/13 5:57p Fredericko
+// [TAG] EIP120969
+// [Category] New Feature
+// [Description] TCG (TPM20)
+//
+//
+//**********************************************************************
+//<AMI_FHDR_START>
+//----------------------------------------------------------------------------
+//
+// Name:
+//
+// Description:
+//
+//----------------------------------------------------------------------------
+//<AMI_FHDR_END>
+#ifndef _AMI_TPM_CLEAR_ON_ROLLBACK_H
+#define _AMI_TPM_CLEAR_ON_ROLLBACK_H
+
+#define AMI_TPM_ROLLBACK_SMM_PROTOCOL_GUID \
+ {0x79fbad19, 0xf9e1, 0x4d08, 0xb7, 0xbc, 0x35, 0x84, 0x53, 0x19, 0x5e, 0x41}
+
+#define TPM_CLEAR_SUCCESSFUL 0x0
+#define TPM_CLEAR_RESET_REQUIRED 0x01
+#define TPM_FATAL_CONTINUE_FLASH 0x02
+#define TPM_FATAL_DISCONTINUE_FLASH 0x03
+
+typedef
+UINT8
+(EFIAPI * CLEAR_TPM_ON_ROLLBACK)(VOID);
+
+typedef struct _CLEAR_TPM_ROLLBACK_PROTOCOL
+{
+ CLEAR_TPM_ON_ROLLBACK ClearTpmOnRollBack;
+} CLEAR_TPM_ROLLBACK_PROTOCOL;
+
+#endif
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//************************************************************************* \ No newline at end of file
diff --git a/Include/Protocol/AmiUsbCCID.h b/Include/Protocol/AmiUsbCCID.h
new file mode 100644
index 0000000..dfb81ee
--- /dev/null
+++ b/Include/Protocol/AmiUsbCCID.h
@@ -0,0 +1,185 @@
+//****************************************************************************
+//****************************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Pkwy, Norcross, GA 30093 **
+//** **
+//** Phone (770)-246-8600 **
+//** **
+//****************************************************************************
+//****************************************************************************
+
+//****************************************************************************
+// $Header: /Alaska/SOURCE/Modules/USB/ALASKA/Protocol/AmiUsbCCID.h 3 5/02/12 2:02a Rajeshms $
+//
+// $Revision: 3 $
+//
+// $Date: 5/02/12 2:02a $
+//
+//****************************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/SOURCE/Modules/USB/ALASKA/Protocol/AmiUsbCCID.h $
+//
+// 3 5/02/12 2:02a Rajeshms
+// [TAG] EIP83117
+// [Category] Improvement
+// [Description] Extend the Support to different smart card Readers and
+// smart Cards.
+// [Files] usbCCID.c, amiusbrtCCID.h, usbdef.h, efiusbccid.c,
+// AmiusbCCID.h
+//
+// 2 10/14/11 4:58a Rajeshms
+// [TAG] EIP70315
+// [Category] Improvement
+// [Description] Remove Slot number in the USB CCID API's
+// [Files] efiusbccid.c, AmiUsbCCID.h
+//
+// 1 7/12/11 8:19a Ryanchou
+// [TAG] EIP56918
+// [Category] New Feature
+// [Description] Added CCID device support.
+// [Files] amiusb.c, amiusb.h, amiusbrtCCID.h, ehci.c, ohci.c, uhci.c,
+// usb.c, UsbCCID.c, usbdef.h, usbrt.cif, usbsetup.c, efiusbccid.c,
+// framework.cif, uhcd.c, uhcd.cif, uhcd.h, usbsrc.sdl, AmiusbCCID.h,
+// AmiUsbController.h, AmiUSBProtocols.cif
+//
+//****************************************************************************
+
+//<AMI_FHDR_START>
+//-----------------------------------------------------------------------------
+//
+// Name: AmiUsbCCID.h
+//
+// Description: AMI USB CCID Protocol definition
+//
+//-----------------------------------------------------------------------------
+//<AMI_FHDR_END>
+
+#ifndef _USB_CCID_H
+#define _USB_CCID_H
+
+#include <EFI.h>
+
+#ifndef GUID_VARIABLE_DEFINITION
+
+// CCID definitions/Structures
+typedef struct _AMI_CCID_IO_PROTOCOL AMI_CCID_IO_PROTOCOL;
+
+#define AMI_CCID_IO_PROTOCOL_GUID \
+ { 0xB167C2F5, 0xE26A, 0x4DFF, 0x8E, 0x1C, 0x08, 0x07, 0xC7, 0xF0, 0x2A, 0x88}
+
+#define AMI_CCID_PRESENCE_GUID \
+ { 0x5FDEE00D, 0xDA40, 0x405A, 0xB9, 0x2E, 0xCF, 0x4A, 0x80, 0xEA, 0x8F, 0x76}
+
+typedef enum {
+ I_BLOCK,
+ S_IFS_REQUEST = 0xC1,
+ S_ABORT_REQUEST,
+ S_WTX_REQUEST
+} ISBlock;
+
+typedef
+EFI_STATUS
+(*AMI_CCID_SMARTCLASSDESCRIPTOR) (
+ IN AMI_CCID_IO_PROTOCOL *This,
+ OUT UINT8 *ResponseBuffer
+);
+
+typedef
+EFI_STATUS
+(*AMI_CCID_GET_ATR) (
+ IN AMI_CCID_IO_PROTOCOL *This,
+ IN UINT8 Slot,
+ OUT UINT8 *ATRData
+);
+
+typedef
+EFI_STATUS
+(*AMI_CCID_POWERUP_SLOT) (
+ IN AMI_CCID_IO_PROTOCOL *This,
+ OUT UINT8 *bStatus,
+ OUT UINT8 *bError,
+ OUT UINT8 *ATRData
+);
+
+typedef
+EFI_STATUS
+(*AMI_CCID_POWERDOWN_SLOT) (
+ IN AMI_CCID_IO_PROTOCOL *This,
+ OUT UINT8 *bStatus,
+ OUT UINT8 *bError
+);
+
+typedef
+EFI_STATUS
+(*AMI_CCID_GET_SLOT_STATUS) (
+ IN AMI_CCID_IO_PROTOCOL *This,
+ OUT UINT8 *bStatus,
+ OUT UINT8 *bError,
+ OUT UINT8 *bClockStatus
+);
+
+typedef
+EFI_STATUS
+(*AMI_CCID_XFR_BLOCK) (
+ IN AMI_CCID_IO_PROTOCOL *This,
+ IN UINTN CmdLength,
+ IN UINT8 *CmdBuffer,
+ IN UINT8 ISBlock,
+ OUT UINT8 *bStatus,
+ OUT UINT8 *bError,
+ IN OUT UINTN *ResponseLength,
+ OUT UINT8 *ResponseBuffer
+);
+
+typedef
+EFI_STATUS
+(*AMI_CCID_GET_PARAMETERS) (
+ IN AMI_CCID_IO_PROTOCOL *This,
+ OUT UINT8 *bStatus,
+ OUT UINT8 *bError,
+ OUT UINTN *ResponseLength,
+ OUT UINT8 *ResponseBuffer
+);
+
+typedef struct _AMI_CCID_IO_PROTOCOL {
+
+ AMI_CCID_SMARTCLASSDESCRIPTOR USBCCIDAPISmartClassDescriptor;
+ AMI_CCID_GET_ATR USBCCIDAPIGetAtr;
+ AMI_CCID_POWERUP_SLOT USBCCIDAPIPowerupSlot;
+ AMI_CCID_POWERDOWN_SLOT USBCCIDAPIPowerDownSlot;
+ AMI_CCID_GET_SLOT_STATUS USBCCIDAPIGetSlotStatus;
+ AMI_CCID_XFR_BLOCK USBCCIDAPIXfrBlock;
+ AMI_CCID_GET_PARAMETERS USBCCIDAPIGetParameters;
+
+}AMI_CCID_IO_PROTOCOL;
+
+typedef struct {
+ AMI_CCID_IO_PROTOCOL CCIDIoProtocol;
+ VOID *DevInfo;
+ UINT8 Slot;
+ EFI_HANDLE ControllerHandle;
+ EFI_HANDLE ChildHandle;
+
+} USB_ICC_DEV;
+
+#endif
+#endif // _USB_CCID_H
+
+//****************************************************************************
+//****************************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Pkwy, Norcross, GA 30093 **
+//** **
+//** Phone (770)-246-8600 **
+//** **
+//****************************************************************************
+//****************************************************************************
diff --git a/Include/Protocol/AmiUsbController.h b/Include/Protocol/AmiUsbController.h
new file mode 100644
index 0000000..39d8d46
--- /dev/null
+++ b/Include/Protocol/AmiUsbController.h
@@ -0,0 +1,1572 @@
+//****************************************************************************
+//****************************************************************************
+//** **
+//** (C)Copyright 1985-2016, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Pkwy, Norcross, GA 30093 **
+//** **
+//** Phone (770)-246-8600 **
+//** **
+//****************************************************************************
+//****************************************************************************
+
+//****************************************************************************
+// $Header: /Alaska/SOURCE/Modules/USB/ALASKA/Protocol/AmiUsbController.h 36 10/16/16 10:24p Wilsonlee $
+//
+// $Revision: 36 $
+//
+// $Date: 10/16/16 10:24p $
+//
+//****************************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/SOURCE/Modules/USB/ALASKA/Protocol/AmiUsbController.h $
+//
+// 36 10/16/16 10:24p Wilsonlee
+// [TAG] EIP288158
+// [Category] Improvement
+// [Description] Check if gUsbData is integrity.
+// [Files] amiusb.cif, usbsb.c, AmiUsbLib.cif, AmiUsbLib.sdl,
+// AmiUsbSmmGlobalDataValidationLib.c,
+// AmiUsbSmmGlobalDataValidationLib.cif,
+// AmiUsbSmmGlobalDataValidationLib.mak, Crc32.c, amiusb.c, amiusb.h,
+// ehci.c, elib.c, ohci.c, syskbc.c, uhci.c, usb.c, usbCCID.c, usbdef.h,
+// usbhid.c, usbhub.c, usbkbd.c, usbmass.c, usbms.c, usbrt.mak, xhci.c,
+// amiusbhc.c, efiusbccid.c, efiusbmass.c, uhcd.c, usbmisc.c,
+// AmiUsbController.h, AmiUsbLibInclude.cif,
+// AmiUsbSmmGlobalDataValidationLib.h
+//
+// 35 3/02/16 9:43p Wilsonlee
+// [TAG] EIP254309
+// [Category] Bug Fix
+// [Severity] Normal
+// [Symptom] GK-FORCE K83 USB KB function abnormal.
+// [RootCause] This device has an interrupt out endpoint and doesn't
+// support "Set Report" request.
+// [Solution] Use the interrupt out endpoint instead of sending "Set
+// Report" request.
+// [Files] AmiUsbController.h, xhci.c, usbmass.c, usbkbd.h, usbkbd.c,
+// usbhub.c, usbhid.c, usbdef.h, usbCCID.c, usb.c, uhci.c, ohci.c, ehci.c,
+// amiusb.h, efiusbms,c, amiusbhc.c
+//
+// 34 11/04/15 9:54p Wilsonlee
+// TAG] EIP241067
+// [Category] Improvement
+// [Description] Add the device descriptor to the DEV_INFO structure.
+// [Files] usb.c, usbdef.h, xhci.c, usbbus.c, AmiUsbController.h
+//
+// 33 4/10/15 3:07a Wilsonlee
+// [TAG] EIP207413
+// [Category] Improvement
+// [Description] Install UsbApiTable and UsbMassApitTable in
+// AmiUsbSmmProtocol.
+// [Files] amiusbhc.c, AmiUsbController.h, usbdef.h, usbCCID.c, uhci.c,
+// ehci.c, amiusbrtCCID.h, amiusb.h, amiusb.c, uhcd.c
+//
+// 32 12/24/14 10:42p Wilsonlee
+// [TAG] EIP196287
+// [Category] Improvement
+// [Description] Display info of connected usb controllers and remove or
+// grayed-out some item according the connected usb controller number.
+// [Files] uhcd.c, usbport.c, usb.uni, usb.sd, usbsetup.c,
+// AmiUsbController.h, UsbPolicy.h
+//
+// 31 6/11/14 8:23p Wilsonlee
+// [TAG] EIP172625
+// [Category] Improvement
+// [Description] Usb skip table function adds the flag
+// "SKIP_FLAG_SKIP_MULTI_LEVEL" that skips usb ports include down stream
+// ports.
+// [Files] usbport.c, AmiUsbController.h
+//
+// 30 7/03/13 5:25a Ryanchou
+// [TAG] EIP123988
+// [Category] Improvement
+// [Description] Move the code creating BBS table to end of POST.
+// [Files] UsbBbs.c, UsbInt13.c, UsbInt13.cif, UsbInt13.h,
+// UsbInt13.mak, UsbInt13.sdl, efiusbmass.c, uhcd.c, uhcd.h,
+// AmiUsbController.h
+//
+// 29 9/03/12 5:23a Roberthsu
+// [TAG] EIP88776
+// [Category] Improvement
+// [Description] Implement keep port function.
+// [Files] usbport.c,AmiUsbController.h
+//
+// 28 8/29/12 8:42a Ryanchou
+// [TAG] EIP77262
+// [Category] New Feature
+// [Description] Remove SMM dependency of USB.
+// [Files] usb.sdl, usbport.c, amiusb.c, amiusb.dxs, amiusb.h, ehci.c,
+// elib.c, ohci.c, uhci.c, usb.c, usbdef.h, usbrt.mak, xhci.c, amiusbhc.c,
+// efiusbccid.c, efiusbhid.c, efiusbkb.c, efiusbmass.c, uhcd.c, uhcd.dxs,
+// uhcd.h, usbmisc.c, AmiUsbController.h
+//
+// 27 1/14/12 4:10a Ryanchou
+// [TAG] EIP80609
+// [Category] Bug Fix
+// [Severity] Important
+// [Symptom] If to enable debug mode and set launch CSM is "Never" in
+// setup, system will hang at 0xB1
+// [RootCause] The pointer AmiUsb is invalid if CSM is not launched,
+// that may cause CPU exception.
+// [Solution] Added USB smm protocol, and use SmmLocateProtocol to get
+// the pointer.
+// [Files] amiusb.c, AmiUsbController.h, usbrt.mak, usbsb.c
+//
+// 26 12/26/11 2:25a Roberthsu
+// [TAG] EIP74609
+// [Category] Improvement
+// [Description] Add check oemskiplist at check port change.
+// [Files] usbport.c,usb.c,AmiUsbController.h
+//
+// 25 11/08/11 8:26a Wilsonlee
+// [TAG] EIP74876
+// [Category] New Feature
+// [Description] Add USB API for shutdown single USB controller.
+// [Files] amiusb.c, amiusb.h, usb.c, usbdef.h, uhcd.c, uhcd.h,
+// AmiUsbController.h
+//
+// 24 8/05/11 6:19a Ryanchou
+// [TAG] EIP60706
+// [Category] Improvement
+// [Description] Move gUsbBadDeviceTable into SMRAM.
+// [Files] usbport.c, amiusb.c, usb.c, uhcd.c, AmiUsbController.h
+//
+// 23 7/15/11 6:31a Ryanchou
+// [TAG] EIP38434
+// [Category] New Feature
+// [Description] Added USB HID report protocol support.
+// [Files] amiusb.c, AmiUsbController.h, amiusbhc.c, efiusbkb.c,
+// efiusbkb.h, efiusbpoint.c, ehci.c, ohci.c, uhcd.c uhcd.cif, uhci.c,
+// usb.c, usbdef.h, usbhid.c, usbkbd.c, usbkbd.h, usbms.c, usbpoint.c,
+// usbrt.cif, usbsb.c, usbsetup.c, usbsrc.sdl, xhci.c
+//
+// 22 7/12/11 8:18a Ryanchou
+// [TAG] EIP56918
+// [Category] New Feature
+// [Description] Added CCID device support.
+// [Files] amiusb.c, amiusb.h, amiusbrtCCID.h, ehci.c, ohci.c, uhci.c,
+// usb.c, UsbCCID.c, usbdef.h, usbrt.cif, usbsetup.c, efiusbccid.c,
+// framework.cif, uhcd.c, uhcd.cif, uhcd.h, usbsrc.sdl, AmiusbCCID.h,
+// AmiUsbController.h, AmiUSBProtocols.cif
+//
+// 21 6/22/11 2:13a Ryanchou
+// [TAG] EIP62695
+// [Improvement] Add new oemskiplist function
+// [Description] Add skip function by controller or port.Skip by device
+// type or port number.
+//
+// 20 4/06/11 3:28a Ryanchou
+// [TAG] EIP55275
+// [Category] Bug Fix
+// [Severity] Important
+// [Symptom] EBDA:108 conflict
+// [RootCause] The EIP48064 save EFI_USB_PROTOCOL pointer in EBDA:108,
+// but Keymon filter driver used the same location.
+// [Solution] Use the EBDA:32 to save EFI_USB_PROTOCOL pointer and add a
+// signature in EFI_USB_PROTOCOL.
+// [Files] amidef.h, AmiUsbController.h, uhcd.c, usbsb.c
+//
+// 19 4/06/11 12:45a Ryanchou
+// [TAG] EIP51653
+// [Category] New Feature
+// [Description] Added an interface that skips specific port
+// enumeration.
+// [Files] AmiUsbController.h, uhcd.c, uhcd.h, usb.c, usbdef.h,
+// usbport.c
+//
+// 18 3/30/11 9:07a Ryanchou
+// [TAG] EIP41483
+// [Category] Improvement
+// [Description] Stop timer SMI after legacy shutdown.
+// [Files] amiusb.c, AmiUsbController.h, ohci.c
+//
+// 17 2/22/11 5:11a Tonylo
+// [TAG] EIP52339
+// [Category] New Feature
+// [Description] USB changes of USB host safe disabling solution.
+// [Files] USB.C
+// UHCD.C
+// UHCD.H
+// AmiUsbController.h
+//
+// 16 11/22/10 8:46a Ryanchou
+// [TAG] EIP48064
+// [Category] Improvement
+// [Description] The SB template implemented elink
+// AcpiEnableCallbackList, the XHCI/EHCI hand off function should be
+// invoked via the elink AcpiEnableCallbackList.
+// [Files] amidef.h, amiusb.c, amiusb.dxs, amiusb.h,
+// AmiUsbController.h, usb.sdl, usbrt.mak, usbsb.c
+//
+// 15 7/15/10 4:45a Tonylo
+// EIP15489 - Add USB HandOff function for shurdown/init USB legacy
+// through USB API function.
+//
+// 14 4/02/10 9:00a Olegi
+//
+// 13 10/02/09 10:51a Olegi
+// Code cleanup.
+//
+// 12 11/25/08 6:04p Olegi
+// Support for OEM USB Boot Override feature. EIP#17052.
+//
+// 11 6/27/08 6:00p Olegi
+// - USB_MASS_DEV structure has been updated
+// - Several equates moved from USBDEF.H
+//
+// 10 5/16/08 12:07p Olegi
+// Compliance with AMI coding standard.
+//
+// 9 8/09/07 3:50p Artems
+// Added new protocol function GetRuntimeRegion
+//
+// 8 6/03/07 11:26p Olegi
+// Added UsbBbsRemoveMassStorage function.
+//
+// 7 5/29/07 6:14p Olegi
+// Added UsbChangeEfiToLegacy function.
+//
+// 1 3/15/05 9:23a Olegi
+// Initial VSS check-in.
+//
+//****************************************************************************
+
+//<AMI_FHDR_START>
+//-----------------------------------------------------------------------------
+//
+// Name: AmiUsbController.h
+//
+// Description: AMI USB Driver Protocol definition
+//
+//-----------------------------------------------------------------------------
+//<AMI_FHDR_END>
+
+#ifndef _USB_PROT_H
+#define _USB_PROT_H
+
+#include <EFI.h>
+#include <Protocol\AmiUsbCCID.h>
+
+#define EFI_USB_PROTOCOL_GUID \
+ { 0x2ad8e2d2, 0x2e91, 0x4cd1, 0x95, 0xf5, 0xe7, 0x8f, 0xe5, 0xeb, 0xe3, 0x16 }
+
+#define AMI_USB_SMM_PROTOCOL_GUID \
+ { 0x3ef7500e, 0xcf55, 0x474f, 0x8e, 0x7e, 0x0, 0x9e, 0xe, 0xac, 0xec, 0xd2 }
+
+GUID_VARIABLE_DECLARATION(gEfiUsbProtocolGuid,EFI_USB_PROTOCOL_GUID);
+
+GUID_VARIABLE_DECLARATION(gAmiUsbSmmProtocolGuid,AMI_USB_SMM_PROTOCOL_GUID);
+
+#ifndef GUID_VARIABLE_DEFINITION
+#include <Protocol/BlockIo.h>
+#include <AmiDxeLib.h>
+
+typedef union {
+ VOID *fpUHCIDescPtrs;
+ VOID *fpOHCIDescPtrs;
+ VOID *fpEHCIDescPtrs;
+} DESC_PTRS;
+
+typedef struct {
+ UINT8 Flag;
+ UINT8 ReportId;
+ UINT16 UsagePage;
+ UINT32 ReportCount;
+ UINT8 ReportSize;
+ UINT32 LogicalMin;
+ UINT32 LogicalMax;
+ UINT32 PhysicalMax; //(EIP127014)
+ UINT32 PhysicalMin; //(EIP127014)
+ UINT8 UnitExponent; //(EIP127014)
+ UINT16 UsageCount;
+ UINT16 *Usages;
+ UINT16 MaxUsages;
+ UINT16 UsageMin;
+ UINT16 UsageMax;
+} HID_REPORT_FIELD;
+
+typedef struct {
+ UINT8 Flag;
+ UINT16 AbsMaxX;
+ UINT16 AbsMaxY;
+ UINT16 ReportDescLen;
+ UINT8 FieldCount;
+ HID_REPORT_FIELD **Fields;
+} HID_REPORT;
+
+#pragma pack(push, 1)
+
+typedef struct {
+ UINT8 DescLength;
+ UINT8 DescType;
+ UINT16 BcdUsb;
+ UINT8 BaseClass;
+ UINT8 SubClass;
+ UINT8 Protocol;
+ UINT8 MaxPacketSize0;
+ UINT16 VendorId;
+ UINT16 DeviceId;
+ UINT16 BcdDevice;
+ UINT8 MfgStr;
+ UINT8 ProductStr;
+ UINT8 SerialStr;
+ UINT8 NumConfigs;
+} DEV_DESC;
+
+#pragma pack(pop)
+
+typedef struct _HC_STRUC HC_STRUC;
+typedef struct _DEV_INFO DEV_INFO;
+typedef struct _DEV_DRIVER DEV_DRIVER;
+typedef struct _URP_STRUC URP_STRUC;
+
+//<AMI_SHDR_START>
+//----------------------------------------------------------------------------
+// Name: HC_STRUC
+//
+// Description: USB Host Controller structure
+//
+// Fields: Name Type Description
+// ------------------------------------------------------------
+// bHCNumber UINT8 Host Controller number, 1-based
+// bHCType UINT8 Host Controller Type, U/O/E HCI
+// fpFrameList UINT32* Host Controller Frame List Address
+// BaseAddress UINTN Host Controller Base Address, memory (EHCI,OHCI) or IO (UHCI)
+// bNumPorts UINT8 Number of root ports, 1-based
+// wBusDevFuncNum UINT16 PCI location, bus (Bits8..15), device (Bits3..7), function(bits0..2)
+// fpIRQInfo IRQ_INFO IRQ information
+// stDescPtrs DESC_PTRS Commonly used descriptor pointers, see definition of DESC_PTRS
+// wAsyncListSize UINT16 Async. list size
+// bOpRegOffset UINT8 Operation region offset
+// dMaxBulkDataSize UINT32 Maximum Bulk Transfer data size
+// dHCFlag UINT32 Host Controller flag
+// bExtCapPtr UINT8 EHCI Extended Capabilities Pointer
+// bRegOfs UINT8 EHCI Capabilities PCI register Offset
+// DebugPort UINT8 Port number of EHCI debug port
+// usbbus_data VOID* USB Bus data specific to this Host Controller
+// Controller EFI_HANDLE EFI Handle of this controller
+// pHCdp EFI_DEVICE_PATH_PROTOCOL* Pointer to this controller's device path
+//----------------------------------------------------------------------------
+//<AMI_SHDR_END>
+
+struct _HC_STRUC {
+ UINT8 bHCNumber;
+ UINT8 bHCType;
+ UINT32 *fpFrameList;
+ UINTN BaseAddress;
+ UINTN BaseAddressSize;
+ UINT8 bNumPorts;
+ UINT16 wBusDevFuncNum;
+ UINT8 Irq;
+ DESC_PTRS stDescPtrs;
+ UINT16 wAsyncListSize;
+ UINT8 bOpRegOffset;
+ UINT32 dMaxBulkDataSize;
+ UINT32 dHCSParams;
+ UINT32 dHCCParams;
+ UINT32 dHCFlag;
+ UINT8 bExtCapPtr; // EHCI Extended Capabilities Pointer
+ UINT8 DebugPort;
+ VOID* usbbus_data;
+ EFI_HANDLE Controller;
+ EFI_DEVICE_PATH_PROTOCOL *pHCdp;
+ UINT8 PwrCapPtr; //(EIP54018+)
+ VOID *PciIo;
+ UINT16 Vid;
+ UINT16 Did;
+ EFI_HANDLE HwSmiHandle;
+ UINT16 SplitPeriodicIndex;
+#if !USB_RUNTIME_DRIVER_IN_SMM
+ UINT32 MemPoolPages;
+ UINT8 *MemPool;
+ UINT32 MemBlkStsBytes;
+ UINT32 *MemBlkSts;
+#endif
+};
+
+//<AMI_SHDR_START>
+//----------------------------------------------------------------------------
+// Name: DEV_INFO
+//
+// Description: USB Device Information Structure
+//
+// Fields: Name Type Description
+// ------------------------------------------------------------
+// bFlag UINT8 Device Information flags
+// bDeviceType UINT8 Device Type
+// wVendorId UINT16 Device VID
+// wDeviceId UINT16 Device DID
+// bDeviceAddress UINT8 Device USB Address
+// bHCNumber UINT8 Host Controller Number this device is attached to
+// bHubDeviceNumber UINT8 USB Hub Device Number this device is attached to
+// bHubPortNumber UINT8 USB Hub Port Number this device is attached to
+// bEndpointNum UINT8 Endpoint number
+// bEndpointSpeed UINT8 Endpoint speed
+// bLUN UINT8 Device Logical Unit number
+// wEndp0MaxPacket UINT16 Endpoint0 max packet size, in Bytes
+// bNumConfigs UINT8 Number of configurations
+// bConfigNum UINT8 Active configuration number (0-based)
+// bInterfaceNum UINT8 Active interface number
+// bAltSettingNum UINT8 Alternate setting number (0-based)
+// bCallBackIndex UINT8 Callback function index
+// fpPollTDPtr UINT8* Polling TD pointer
+// fpPollTEPtr UINT8* Polling ED pointer
+// bHubNumPorts UINT8 Hub # of ports (USB hubs only)
+// bHubPowerOnDelay UINT8 Hub power-on delay (USB hubs only)
+// fpLUN0DevInfoPtr DEV_INFO* Pointer to Lun0 device (for multiple-LUN devices)
+// wDataIn/OutSync UINT16 toggle tracking information
+// bStorageType UINT8 USB_MASS_DEV_ARMD, USB_MASS_DEV_HDD, etc.
+// wIntMaxPkt UINT16 Interrupt Max Packet size, in Bytes
+// bPresent UINT8 Device presence indicator
+// bIntEndpoint UINT8 Interrupt endpoint number
+// bBulkInEndpoint UINT8 Bulk-In endpoint number
+// bBulkOutEndpoint UINT8 Bulk-Out endpoint number
+// bProtocol UINT8 Protocol
+// wEmulationOption UINT16 USB Mass Storage Drive Emulation Option, from Setup
+// bHiddenSectors UINT8 Number of hidden sectors, for USB mass storage devices only
+// bSubClass UINT8 Device sub-class
+// wBlockSize UINT16 USB Mass Storage Device block size, in Bytes
+// dMaxLba UINT32 USB Mass Storage Device Maximum LBA number
+// bHeads UINT8 USB Mass Storage Device # of heads
+// bSectors UINT8 USB Mass Storage Device # of sectors
+// wCylinders UINT16 USB Mass Storage Device # of cylinders
+// bNonLBAHeads UINT8 USB Mass Storage Device # of heads reported in Non-LBA (CHS) functions
+// bNonLBASectors UINT8 USB Mass Storage Device # of sectors reported in Non-LBA (CHS) functions
+// wNonLBACylinders UINT16 USB Mass Storage Device # of cylinders reported in Non-LBA (CHS) functions
+// bEmuType UINT8 USB Mass Storage Device emulation type
+// bPhyDevType UINT8 USB Mass Storage Device physical type
+// bMediaType UINT8 USB Mass Storage Device media type
+// bDriveNumber UINT8 USB Mass Storage Device INT13 drive number
+// wBulkInMaxPkt UINT16 USB Mass Storage Device Bulk-In max packet size, in Bytes
+// wBulkOutMaxPkt UINT16 USB Mass Storage Device Bulk-Out max packet size, in Bytes
+// wIncompatFlags UINT16 USB Mass Storage Device Incompatibility flags
+// MassDev VOID* USB Mass Storage Device EFI handle
+// fpDeviceDriver DEV_DRIVER* Device driver pointer
+// bLastStatus UINT8 Last transaction status
+// pExtra UINT8* Pointer to extra device specific data
+// UINT32 UINT8 USB Mass Storage Device # of heads
+// Handle UINT32[2] USB Device Handle
+//----------------------------------------------------------------------------
+//<AMI_SHDR_END>
+struct _DEV_INFO {
+ UINT32 Flag; //00
+ UINT8 bDeviceType; //01
+ UINT16 wVendorId; //02
+ UINT16 wDeviceId; //04
+ UINT8 bDeviceAddress; //06
+
+ UINT8 bHCNumber; //07
+ UINT8 bHubDeviceNumber; //08
+ UINT8 bHubPortNumber; //09
+// UINT8 bEndpointNum; //0A //(EIP70933-)
+ UINT8 bEndpointSpeed; //0B
+ UINT8 bLUN; //0C
+ UINT16 wEndp0MaxPacket;//0D
+// UINT8 bNumConfigs; //0F
+ UINT8 bConfigNum; //10
+ UINT8 bInterfaceNum; //11
+ UINT8 bAltSettingNum; //12
+
+ UINT8 bCallBackIndex; //13
+ UINT8 *fpPollTDPtr; //14
+ UINT8 *fpPollEDPtr; //18
+
+ UINT8 bHubNumPorts; //1C
+ UINT8 bHubPowerOnDelay;//1D
+
+ struct _DEV_INFO *fpLUN0DevInfoPtr; //1E
+// UINT8 bDataSync; //22
+
+ UINT16 wDataInSync; // 22
+ UINT16 wDataOutSync; // 24
+ UINT8 bStorageType; // 26, USB_MASS_DEV_ARMD, USB_MASS_DEV_HDD, etc.
+ UINT16 IntInMaxPkt; //27
+ UINT8 IntInEndpoint; //2A
+ UINT16 IntOutMaxPkt;
+ UINT8 IntOutEndpoint;
+ UINT8 bBulkInEndpoint;
+ UINT8 bBulkOutEndpoint;
+
+ UINT8 bBaseClass; // BASE_CLASS_HID, BASE_CLASS_MASS_STORAGE or BASE_CLASS_HUB
+ UINT8 bSubClass;
+ UINT8 bProtocol; //
+ UINT16 wEmulationOption; //
+ UINT8 bHiddenSectors; //
+
+ UINT16 wBlockSize; //
+ UINT64 MaxLba; //
+ UINT16 Heads; //
+ UINT8 bSectors; //
+ UINT16 wCylinders; //
+ UINT16 NonLBAHeads; //
+ UINT8 bNonLBASectors; //
+ UINT16 wNonLBACylinders; //
+ UINT8 bEmuType; //
+ UINT8 bPhyDevType; //
+ UINT8 bMediaType; //
+ UINT8 bDriveNumber; //
+ UINT16 wBulkInMaxPkt; //
+ UINT16 wBulkOutMaxPkt; //
+ UINT16 wIncompatFlags; //
+ VOID *MassDev; //
+ DEV_DRIVER *fpDeviceDriver; //
+ UINT8 bLastStatus; //
+ UINT8 *pExtra; //
+ UINT32 Handle[2];
+ UINT8 DevNameString[64];
+ VOID *DevMiscInfo;
+ UINT8 HubDepth;
+ UINT8 *fpPollDataBuffer; //Polling Data Buffer //(EIP54782+)
+ VOID *pCCIDDescriptor; // Ptr to CCID descriptor
+ UINT32 *DataRates; // List of DataRates supported by CCID
+ UINT32 *ClockFrequencies; // List of Frequencies suported by CCID
+ DLIST ICCDeviceList; // Linked list of ICC devices. :Linked to "ICCDeviceLink"
+ HID_REPORT HidReport;
+ UINT8 HidDevType;
+ UINT8 bPollInterval; //(EIP84455+)
+ UINT16 PollingLength;
+ UINT16 HubPortConnectMap;
+ UINT8 BpbMediaDesc;
+ DEV_DESC DevDesc;
+};
+
+//<AMI_SHDR_START>
+//----------------------------------------------------------------------------
+// Name: DEV_DRIVER
+//
+// Description: USB Device Driver Structure
+//
+// Fields: Name Type Description
+// ------------------------------------------------------------
+// bDevType UINT8 Device Type
+// bBaseClass UINT8 Device Base Type
+// bSubClass UINT8 Device Subclass
+// bProtocol UINT8 Device Protocol
+// pfnDeviceInit VOID Device Initialization Function
+// pfnCheckDeviceType UINT8 Check Device Type Function
+// pfnConfigureDevice DEV_INFO* Configure Device Function
+// pfnDisconnectDevice UINT8 Disconnect Device Function
+//----------------------------------------------------------------------------
+//<AMI_SHDR_END>
+
+struct _DEV_DRIVER {
+ UINT8 bDevType;
+ UINT8 bBaseClass;
+ UINT8 bSubClass;
+ UINT8 bProtocol;
+ VOID (*pfnDeviceInit)(VOID);
+ UINT8 (*pfnCheckDeviceType)(DEV_INFO*, UINT8, UINT8, UINT8);
+ DEV_INFO* (*pfnConfigureDevice)(HC_STRUC*, DEV_INFO*, UINT8*, UINT16, UINT16);
+ UINT8 (*pfnDisconnectDevice)(DEV_INFO*);
+ VOID (*pfnDriverRequest)(DEV_INFO*, URP_STRUC*);
+};
+
+#pragma pack(push, 1)
+
+//<AMI_SHDR_START>
+//----------------------------------------------------------------------------
+// Name: CK_PRESENCE
+//
+// Description: This is a URP (USB Request Packet) structure for the BIOS
+// API call CheckPresence (API #0)
+//
+//----------------------------------------------------------------------------
+//<AMI_SHDR_END>
+
+typedef struct {
+ UINT16 wBiosRev; // USB BIOS Revision
+ UINT8 bBiosActive; // USB BIOS active/inactive
+ UINT8 bNumBootDev; // # of USB boot device
+ UINT16 wUsbDataArea; // USB Data area
+ UINT8 bNumKeyboards; // Number of USB keyboards present
+ UINT8 bNumMice; // Number of USB mice present
+ UINT8 bNumPoint; // Number of USB point present //<(EIP38434+)
+ UINT8 bNumHubs; // Number of USB hubs present
+ UINT8 bNumStorage; // Number of USB storage devices present
+///////// DO NOT ADD ANY FIELD HERE. IF IT IS NECESSARY PLEASE UPDATE THE CODE
+///////// IN THE FUNCTION USBWrap_GetDeviceCount in the file USBWRAP.ASM
+ UINT8 bNumHarddisk; // Number of hard disk emulated USB devices
+ UINT8 bNumCDROM; // Number of CDROM emulated USB devices
+ UINT8 bNumFloppy; // Number of floppy emulated USB devices
+} CK_PRESENCE;
+
+//<AMI_SHDR_START>
+//----------------------------------------------------------------------------
+// Name: START_HC
+//
+// Description: This is a URP (USB Request Packet) structure for the BIOS
+// API call StartHC and MoveDataArea (API #20 & #24)
+//
+// Fields: Name Type Description
+// ------------------------------------------------------------
+// wDataAreaFlag UINT16 Indicates which data area to use
+//
+//----------------------------------------------------------------------------
+//<AMI_SHDR_END>
+
+typedef struct {
+ UINT16 wDataAreaFlag; // Data area to use
+} START_HC;
+
+//<AMI_SHDR_START>
+//----------------------------------------------------------------------------
+// Name: GET_DEV_INFO
+//
+// Description: This is a URP (USB Request Packet) structure for the BIOS
+// API call GetDeviceInfo (API #25)
+//
+// Fields: Name Type Description
+// ------------------------------------------------------------
+// bDevNumber UINT8 Device # whose info is requested
+// bHCNumber UINT8 HC # to which this device is connected (0 if no such device found)
+// bDevType UINT8 Device type (0 if no such device found)
+//
+//----------------------------------------------------------------------------
+//<AMI_SHDR_END>
+
+typedef struct {
+ UINT8 bDevNumber;
+ UINT8 bHCNumber;
+ UINT8 bDevType;
+} GET_DEV_INFO;
+
+//<AMI_SHDR_START>
+//----------------------------------------------------------------------------
+// Name: CHK_DEV_PRSNC
+//
+// Description: This is a URP (USB Request Packet) structure for the BIOS
+// API call CheckDevicePresence (API #26)
+//
+// Fields: Name Type Description
+// ------------------------------------------------------------
+// bDevType UINT8 Type of device to look for
+// fpHCStruc FPHC_STRUC Pointer to HC being checked for device connection
+// bNumber UINT8 Number of devices connected
+//
+//----------------------------------------------------------------------------
+//<AMI_SHDR_END>
+
+typedef struct {
+ UINT8 bDevType;
+ HC_STRUC *fpHCStruc;
+ UINT8 bNumber;
+} CHK_DEV_PRSNC;
+
+typedef struct {
+ UINT8 ScrLock: 1;
+ UINT8 NumLock: 1;
+ UINT8 CapsLock: 1;
+ UINT8 Resrvd: 5;
+} LED_MAP;
+
+//<AMI_SHDR_START>
+//----------------------------------------------------------------------------
+// Name: KB_LEDS_DATA
+//
+// Description: This is a URP (USB Request Packet) structure for the BIOS
+// API call LightenKeyboardLeds(API #2B)
+//
+// Fields: Name Type Description
+// ------------------------------------------------------------
+// fpLedMap UINT32 32-bit Pointer to LED_MAP structure
+//
+//----------------------------------------------------------------------------
+//<AMI_SHDR_END>
+
+typedef struct {
+ UINT32 fpLedMap;
+} KB_LEDS_DATA;
+
+//<AMI_SHDR_START>
+//----------------------------------------------------------------------------
+// Name: SECURITY_IF
+//
+// Description: This is a URP (USB Request Packet) structure for the BIOS
+// API call SecurityInterface (API #2Ah)
+//
+// Fields: Name Type Description
+// ------------------------------------------------------------
+// fpBuffer FAR Buffer pointer to read/write data
+// dLength UINT32 Length of the buffer
+// dWaitTime UINT32 Wait time for the transaction in msec
+//
+//----------------------------------------------------------------------------
+//<AMI_SHDR_END>
+
+typedef struct {
+ UINT32 fpBuffer;
+ UINT32 dLength;
+ UINT32 dWaitTime;
+} SECURITY_IF;
+
+//<AMI_SHDR_START>
+//----------------------------------------------------------------------------
+// Name: MASS_GET_DEV_INFO
+//
+// Description: This is a Mass URP (Mass USB Request Packet) structure for
+// the BIOS API call MassGetDeviceInfo (API #27h, SubFunc 00h)
+//
+// Fields: Name Type Description
+// ------------------------------------------------------------
+// bDevAddr UINT8 USB device address of the device
+// dSenseData UINT32 Sense data of the last command
+// bDevType UINT8 Device type byte (HDD, CD, Removable)
+// bEmuType UINT8 Emulation type used
+// fpDevId UINT32 Far pointer to the device ID
+//----------------------------------------------------------------------------
+//<AMI_SHDR_END>
+
+typedef struct {
+ UINT8 bDevAddr; // (Return value)
+ UINT32 dSenseData; // USB Sense data
+ UINT8 bDevType; // Device type
+ UINT8 bEmuType; // Emulation type
+// UINT8 bPhyDevType; // Physical device type
+ UINT32 fpDevId; // Far ptr to the device id
+// DO NOT ADD OR DELETE ANY FIELD ABOVE - This should match the MASS_INQUIRY
+// structure for proper working
+ UINT8 bTotalMassDev; // TotalNumber of devices
+ UINT8 bReserved;
+ UINT16 wPciInfo; // PCI Bus/Dev/Func number of HC the device is connected to
+ UINT32 Handle[2]; // Device handle
+} MASS_GET_DEV_INFO;
+
+//<AMI_SHDR_START>
+//----------------------------------------------------------------------------
+// Name: MASS_GET_DEV_STATUS
+//
+// Description: This is a Mass URP (Mass USB Request Packet) structure for
+// the BIOS API call MASS_GET_DEV_STATUS (API #27h, SubFunc XXh)
+//
+// Fields: Name Type Description
+// ------------------------------------------------------------
+// bDevAddr UINT8 USB device address of the device
+// bDeviceStatus UINT8 Connection status of the Mass device
+//----------------------------------------------------------------------------
+//<AMI_SHDR_END>
+
+typedef struct {
+ UINT8 bDevAddr;
+ UINT8 bDeviceStatus;
+} MASS_GET_DEV_STATUS;
+
+//<AMI_SHDR_START>
+//----------------------------------------------------------------------------
+// Name: MASS_GET_DEV_GEO
+//
+// Description: This is a Mass URP (Mass USB Request Packet) structure for
+// the BIOS API call MassGetDeviceGeometry (API #27h,
+// SubFunc 01h)
+//
+// Fields: Name Type Description
+// ------------------------------------------------------------
+// bDevAddr UINT8 USB device address of the device
+// dSenseData UINT32 Sense data of the last command
+// bNumHeads UINT8 Number of heads
+// wNumCylinders UINT16 Number of cylinders
+// bNumSectors UINT8 Number of sectors
+// bLBANumHeads UINT8 Number of heads (for INT13h function 48h)
+// wLBANumCyls UINT16 Number of cylinders (for INT13h function 48h)
+// bLBANumSectors UINT8 Number of sectors (for INT13h function 48h)
+// wUINT8sPerSector UINT16 Number of bytes per sector
+// bMediaType UINT8 Media type
+// dLastLBA UINT32 Last LBA address
+//----------------------------------------------------------------------------
+//<AMI_SHDR_END>
+
+typedef struct {
+ UINT8 bDevAddr; // (Return value)
+ UINT32 dSenseData; // USB Sense data
+ UINT16 NumHeads;
+ UINT16 wNumCylinders;
+ UINT8 bNumSectors;
+ UINT16 LBANumHeads;
+ UINT16 wLBANumCyls;
+ UINT8 bLBANumSectors;
+ UINT16 wBytesPerSector;
+ UINT8 bMediaType;
+ UINT64 LastLBA;
+ UINT8 bInt13FuncNum; //(EIP13457+)
+ UINT8 BpbMediaDesc;
+} MASS_GET_DEV_GEO;
+
+//<AMI_SHDR_START>
+//----------------------------------------------------------------------------
+// Name: MASS_RESET
+//
+// Description: This is a Mass URP (Mass USB Request Packet) structure for
+// the BIOS API call MassResetDevice (API #27h, SubFunc 02h)
+//
+// Fields: Name Type Description
+// ------------------------------------------------------------
+// bDevAddr UINT8 USB device address of the device
+// dSenseData UINT32 Sense data of the last command
+//
+//----------------------------------------------------------------------------
+//<AMI_SHDR_END>
+
+typedef struct {
+ UINT8 bDevAddr; // USB Device Address
+ UINT32 dSenseData; // USB Sense data
+} MASS_RESET;
+
+//<AMI_SHDR_START>
+//----------------------------------------------------------------------------
+// Name: MASS_ASSIGN_DRIVE_NUM
+//
+// Description: This is a Mass URP (Mass USB Request Packet) structure for
+// the BIOS API call USBMass_AssignDriveNumber
+// (API #27h, SubFunc 0Eh)
+//
+// Fields: Name Type Description
+// ------------------------------------------------------------
+// bDevAddr UINT8 USB device address of the device
+// bLogDevNum UINT8 Logical Drive Number to assign to the device
+// bHeads UINT8 Number of heads
+// bSectors UINT8 Number of sectors/track
+// wCylinders UINT16 Number of cylinders
+// wBlockSize UINT16 Sector size in bytes
+// bLUN UINT8 Maximum LUNs in the system
+// bSpeed UINT8 <>0 if the device is hi-speed device
+//
+//----------------------------------------------------------------------------
+//<AMI_SHDR_END>
+
+typedef struct {
+ UINT8 bDevAddr; // USB Device Address
+ UINT8 bLogDevNum; // Logical Drive Number to assign to the device
+ UINT8 bHeads;
+ UINT8 bSectors;
+ UINT16 wCylinders;
+ UINT16 wBlockSize;
+ UINT8 bLUN;
+ UINT8 bSpeed;
+} MASS_ASSIGN_DRIVE_NUM;
+
+//<AMI_SHDR_START>
+//----------------------------------------------------------------------------
+// Name: MASS_READ
+//
+// Description: This is a Mass URP (Mass USB Request Packet) structure for
+// the BIOS API call MassReadDevice (API #27h, SubFunc 03h)
+//
+// Fields: Name Type Description
+// ------------------------------------------------------------
+// bDevAddr UINT8 USB device address of the device
+// dSenseData UINT32 Sense data of the last command
+// dStartLBA UINT32 Starting LBA address
+// wNumBlks UINT16 Number of blocks to read
+// wPreSkipSize UINT16 Number of bytes to skip before
+// wPostSkipSize UINT16 Number of bytes to skip after
+// fpBufferPtr UINT32 Far buffer pointer
+//
+//----------------------------------------------------------------------------
+//<AMI_SHDR_END>
+
+typedef struct {
+ UINT8 DevAddr; // USB Device Address
+ UINT32 SenseData; // USB Sense data
+ UINT64 StartLba; // Starting LBA address
+ UINT16 NumBlks; // Number of blocks to read
+ UINT16 PreSkipSize; // Number of bytes to skip before
+ UINT16 PostSkipSize; // Number of bytes to skip after
+ UINT32 BufferPtr; // Far buffer pointer
+} MASS_READ;
+
+//<AMI_SHDR_START>
+//----------------------------------------------------------------------------
+// Name: MASS_WRITE
+//
+// Description: This is a Mass URP (Mass USB Request Packet) structure for
+// the BIOS API call MassWriteDevice (API #27h, SubFunc 04h)
+//
+// Fields: Name Type Description
+// ------------------------------------------------------------
+// bDevAddr UINT8 USB device address of the device
+// dSenseData UINT32 Sense data of the last command
+// dStartLBA UINT32 Starting LBA address
+// wNumBlks UINT16 Number of blocks to write
+// wPreSkipSize UINT16 Number of bytes to skip before
+// wPostSkipSize UINT16 Number of bytes to skip after
+// fpBufferPtr UINT32 Far buffer pointer
+//
+//----------------------------------------------------------------------------
+//<AMI_SHDR_END>
+
+typedef struct {
+ UINT8 DevAddr; // USB Device Address
+ UINT32 SenseData; // USB Sense data
+ UINT64 StartLba; // Starting LBA address
+ UINT16 NumBlks; // Number of blocks to write
+ UINT16 PreSkipSize; // Number of bytes to skip before
+ UINT16 PostSkipSize; // Number of bytes to skip after
+ UINT32 BufferPtr; // Far buffer pointer
+} MASS_WRITE;
+
+//<AMI_SHDR_START>
+//----------------------------------------------------------------------------
+// Name: MASS_VERIFY
+//
+// Description: This is a Mass URP (Mass USB Request Packet) structure for
+// the BIOS API call MassVerifyDevice (API #27h, SubFunc 05h)
+//
+// Fields: Name Type Description
+// ------------------------------------------------------------
+// bDevAddr UINT8 USB device address of the device
+// dSenseData UINT32 Sense data of the last command
+// dStartLBA UINT32 Starting LBA address
+// wNumBlks UINT16 Number of blocks to verify
+// wPreSkipSize UINT16 Number of bytes to skip before
+// wPostSkipSize UINT16 Number of bytes to skip after
+// fpBufferPtr UINT32 Far buffer pointer
+//
+//----------------------------------------------------------------------------
+//<AMI_SHDR_END>
+
+typedef struct {
+ UINT8 DevAddr; // USB Device Address
+ UINT32 SenseData; // USB Sense data
+ UINT64 StartLba; // Starting LBA address
+ UINT16 NumBlks; // Number of blocks to verify
+ UINT16 PreSkipSize; // Number of bytes to skip before
+ UINT16 PostSkipSize; // Number of bytes to skip after
+ UINT32 BufferPtr; // Far buffer pointer
+} MASS_VERIFY;
+
+//<AMI_SHDR_START>
+//----------------------------------------------------------------------------
+// Name: MASS_FORMAT
+//
+// Description: This is a Mass URP (Mass USB Request Packet) structure for
+// the BIOS API call MassFormatDevice (API #27h, SubFunc 06h)
+//
+// Fields: Name Type Description
+// ------------------------------------------------------------
+// bDevAddr UINT8 USB device address of the device
+// dSenseData UINT32 Sense data of the last command
+// bHeadNumber UINT8 Head number to format
+// bTrackNumber UINT8 Track number to format
+//
+//----------------------------------------------------------------------------
+//<AMI_SHDR_END>
+
+typedef struct {
+ UINT8 bDevAddr; // USB Device Address
+ UINT32 dSenseData; // USB Sense data
+ UINT8 bHeadNumber; // Head number to format
+ UINT8 bTrackNumber; // Track number to format
+} MASS_FORMAT;
+
+//<AMI_SHDR_START>
+//----------------------------------------------------------------------------
+// Name: MASS_REQ_SENSE
+//
+// Description: This is a Mass URP (Mass USB Request Packet) structure for
+// the BIOS API call MassRequestSense (API #27h, SubFunc 07h)
+//
+// Fields: Name Type Description
+// ------------------------------------------------------------
+// bDevAddr UINT8 USB device address of the device
+// dSenseData UINT32 Sense data of the last command
+//
+//----------------------------------------------------------------------------
+//<AMI_SHDR_END>
+
+typedef struct {
+ UINT8 bDevAddr; // USB Device Address
+ UINT32 dSenseData; // USB Sense data
+} MASS_REQ_SENSE;
+
+//<AMI_SHDR_START>
+//----------------------------------------------------------------------------
+// Name: MASS_TEST_UNIT_RDY
+//
+// Description: This is a Mass URP (Mass USB Request Packet) structure for
+// the BIOS API call MassTestUnitReady (API #27h, SubFunc 08h)
+//
+// Fields: Name Type Description
+// ------------------------------------------------------------
+// bDevAddr UINT8 USB device address of the device
+// dSenseData UINT32 Sense data of the last command
+//
+//----------------------------------------------------------------------------
+//<AMI_SHDR_END>
+
+typedef struct {
+ UINT8 bDevAddr; // USB Device Address
+ UINT32 dSenseData; // USB Sense data
+} MASS_TEST_UNIT_RDY;
+
+//<AMI_SHDR_START>
+//----------------------------------------------------------------------------
+// Name: MASS_START_STOP_UNIT
+//
+// Description: This is a Mass URP (Mass USB Request Packet) structure for
+// the BIOS API call MassStartStopUnit (API #27h, SubFunc 09h)
+//
+// Fields: Name Type Description
+// ------------------------------------------------------------
+// bDevAddr UINT8 USB device address of the device
+// dSenseData UINT32 Sense data of the last command
+// bCommand UINT8 0 - Stop, 1 - Start
+//
+//----------------------------------------------------------------------------
+//<AMI_SHDR_END>
+
+typedef struct {
+ UINT8 bDevAddr; // USB Device Address
+ UINT32 dSenseData; // USB Sense data
+ UINT8 bCommand; // 0 - Stop, 1 - Start
+} MASS_START_STOP_UNIT;
+
+//<AMI_SHDR_START>
+//----------------------------------------------------------------------------
+// Name: MASS_READ_CAPACITY
+//
+// Description: This is a Mass URP (Mass USB Request Packet) structure for
+// the BIOS API call MassReadCapacity (API #27h, SubFunc 0Ah)
+//
+// Fields: Name Type Description
+// ------------------------------------------------------------
+// bDevAddr UINT8 USB device address of the device
+// dSenseData UINT32 Sense data of the last command
+// dMaxLBA UINT32 Maximum LBA address
+// dBlockSize UINT32 Block size
+//
+//----------------------------------------------------------------------------
+//<AMI_SHDR_END>
+
+typedef struct {
+ UINT8 bDevAddr; // USB Device Address
+ UINT32 dSenseData; // USB Sense data
+ UINT32 dMaxLBA; // Max LBA address
+ UINT32 dBlockSize; // Block size
+} MASS_READ_CAPACITY;
+
+//<AMI_SHDR_START>
+//----------------------------------------------------------------------------
+// Name: MASS_MODE_SENSE
+//
+// Description: This is a Mass URP (Mass USB Request Packet) structure for
+// the BIOS API call MassModeSense (API #27h, SubFunc 0Bh)
+//
+// Fields: Name Type Description
+// ------------------------------------------------------------
+// bDevAddr UINT8 USB device address of the device
+// dSenseData UINT32 Sense data of the last command
+// bNumHeads UINT8 Number of heads
+// wNumCylinders UINT16 Number of cylinders
+// bNumSectors UINT8 Number of sectors
+// wBytesPerSector UINT16 Number of bytes per sector
+// bMediaType UINT8 Media type
+//
+//----------------------------------------------------------------------------
+//<AMI_SHDR_END>
+
+typedef struct {
+ UINT8 bDevAddr; // USB Device Address
+ UINT32 dSenseData; // USB Sense data
+ UINT8 bNumHeads; // Number of heads
+ UINT16 wNumCylinders; // Number of cylinders
+ UINT8 bNumSectors; // Number of sectors
+ UINT16 wBytesPerSector;// Number of bytes per sector
+ UINT8 bMediaType; // Media type
+} MASS_MODE_SENSE;
+
+//<AMI_SHDR_START>
+//----------------------------------------------------------------------------
+// Name: MASS_INQUIRY
+//
+// Description: This is a Mass URP (Mass USB Request Packet) structure for
+// the BIOS API call MassInquiry (API #27h, SubFunc 0Ch)
+//
+// Fields: Name Type Description
+// ------------------------------------------------------------
+// bDevAddr UINT8 USB device address of the device
+// dSenseData UINT32 Sense data of the last command
+// bDevType UINT8 Device type byte (HDD, CD, Removable)
+// bEmuType BYTE Emulation type used
+// fpDevId UINT32 Far pointer to the device ID
+//
+//----------------------------------------------------------------------------
+//<AMI_SHDR_END>
+
+typedef struct {
+ UINT8 bDevAddr; // USB Device Address
+ UINT32 dSenseData; // USB Sense data
+ UINT8 bDevType; // Device type
+ UINT8 bEmuType; // Emulation type
+ UINT32 fpDevId; // Far ptr to the device id
+// DO NOT ADD OR DELETE ANY FIELD ABOVE - This should match the
+// MASS_GET_DEV_INFO structure for proper working
+} MASS_INQUIRY;
+
+typedef struct {
+ DEV_INFO *fpDevInfo;
+ MASS_INQUIRY *fpInqData;
+} MASS_GET_DEV_PARMS;
+
+typedef struct {
+ DEV_INFO* fpDevInfo;
+} MASS_CHK_DEV_READY;
+
+//<AMI_SHDR_START>
+//----------------------------------------------------------------------------
+// Name: MASS_CMD_PASS_THRU
+//
+// Description: This is a Mass URP (Mass USB Request Packet) structure for
+// the BIOS API call MassCmdPassThru command (API #27h,
+// SubFunc 0Dh)
+//
+// Fields: Name Type Description
+// ------------------------------------------------------------
+// bDevAddr BYTE USB device address of the device
+// dSenseData UINT32 Sense data of the last command
+// fpCmdBuffer UINT32 Far pointer to the command buffer
+// wCmdLength UINT16 Command length
+// fpDataBuffer UINT32 Far pointer for data buffer
+// wDataLength UINT16 Data length
+// bXferDir BYTE Data transfer direction
+//
+//----------------------------------------------------------------------------
+//<AMI_SHDR_END>
+
+typedef struct {
+ UINT8 bDevAddr;
+ UINT32 dSenseData;
+ UINT32 fpCmdBuffer;
+ UINT16 wCmdLength;
+ UINT32 fpDataBuffer;
+ UINT16 wDataLength;
+ UINT8 bXferDir;
+} MASS_CMD_PASS_THRU;
+
+//<AMI_SHDR_START>
+//----------------------------------------------------------------------------
+// Name: HCPROC_PARAM
+//
+// Description: N/A
+//
+//----------------------------------------------------------------------------
+//<AMI_SHDR_END>
+
+typedef struct _HCPROC_PARAM{
+ VOID* paramBuffer; //parameters as they should apear in stack of
+ // of the corresponding function invocation
+ unsigned bHCType;
+ unsigned paramSize;
+ UINTN retVal;
+} HCPROC_PARAM;
+
+//<AMI_SHDR_START>
+//----------------------------------------------------------------------------
+// Name: COREPROC_PARAM
+//
+// Description: This is a Core Procedure URP structure for
+// the BIOS API call core command (API #2eh )
+//----------------------------------------------------------------------------
+//<AMI_SHDR_END>
+
+typedef struct _COREPROC_PARAM{
+ VOID* paramBuffer; //parameters as they should apear in stack of
+ // of the corresponding function invocation
+ unsigned paramSize;
+ UINTN retVal;
+} COREPROC_PARAM, * FPCOREPROC_PARAM;
+
+//<AMI_SHDR_START>
+//----------------------------------------------------------------------------
+// Name: GET_DEV_ADDR
+//
+// Description: This is a URP structure for the BIOS API(API #32h)
+//----------------------------------------------------------------------------
+//<AMI_SHDR_END>
+
+typedef struct {
+ UINT16 Vid; // Vendor Id
+ UINT16 Did; // Device Id
+ UINT8 DevAddr; // USB Device Address
+} GET_DEV_ADDR;
+
+//<AMI_SHDR_START>
+//----------------------------------------------------------------------------
+// Name: HC_START_STOP
+//
+// Description: This is a URP structure for the BIOS API(API #36)
+//----------------------------------------------------------------------------
+//<AMI_SHDR_END>
+
+typedef struct {
+ BOOLEAN Start;
+ HC_STRUC *HcStruc;
+} HC_START_STOP;
+
+//<AMI_SHDR_START>
+//----------------------------------------------------------------------------
+// Name: CCID_GETSMARTCLASSDESCRIPTOR
+//
+// Description: This is a Core Procedure URP structure for
+// the BIOS API call USB_API_CCID_DEVICE_REQUEST command (API #2Fh )
+//----------------------------------------------------------------------------
+//<AMI_SHDR_END>
+typedef struct _CCID_GETSMARTCLASSDESCRIPTOR{
+ OUT UINTN fpResponseBuffer;
+ IN UINT8 Slot;
+ OUT UINTN fpDevInfo;
+} CCID_GETSMARTCLASSDESCRIPTOR, * FPCCID_GETSMARTCLASSDESCRIPTOR;
+
+
+//<AMI_SHDR_START>
+//----------------------------------------------------------------------------
+// Name: CCID_ATR
+//
+// Description: This is a Core Procedure URP structure for
+// the BIOS API call USB_API_CCID_DEVICE_REQUEST command (API #2Fh )
+//----------------------------------------------------------------------------
+//<AMI_SHDR_END>
+typedef struct _CCID_ATR{
+ IN UINT8 Slot;
+ IN OUT UINTN ATRData;
+ OUT UINTN fpDevInfo;
+} CCID_ATR, * FPCCID_ATR;
+
+
+//<AMI_SHDR_START>
+//----------------------------------------------------------------------------
+// Name: CCID_POWERUP_SLOT
+//
+// Description: This is a Core Procedure URP structure for
+// the BIOS API call USB_API_CCID_DEVICE_REQUEST command (API #2Fh )
+//----------------------------------------------------------------------------
+//<AMI_SHDR_END>
+typedef struct _CCID_POWERUP_SLOT{
+ IN UINT8 Slot;
+ OUT UINT8 bStatus;
+ OUT UINT8 bError;
+ IN OUT UINTN ATRData;
+ OUT UINTN fpDevInfo;
+} CCID_POWERUP_SLOT, * FPCCID_POWERUP_SLOT;
+
+//<AMI_SHDR_START>
+//----------------------------------------------------------------------------
+// Name: CCID_POWERDOWN_SLOT
+//
+// Description: This is a Core Procedure URP structure for
+// the BIOS API call USB_API_CCID_DEVICE_REQUEST command (API #2Fh )
+//----------------------------------------------------------------------------
+//<AMI_SHDR_END>
+typedef struct _CCID_POWERDOWN_SLOT{
+ IN UINT8 Slot;
+ OUT UINT8 bStatus;
+ OUT UINT8 bError;
+ OUT UINTN fpDevInfo;
+} CCID_POWERDOWN_SLOT, * FPCCID_POWERDOWN_SLOT;
+
+//<AMI_SHDR_START>
+//----------------------------------------------------------------------------
+// Name: CCID_GETSLOT_STATUS
+//
+// Description: This is a Core Procedure URP structure for
+// the BIOS API call USB_API_CCID_DEVICE_REQUEST command (API #2Fh )
+//----------------------------------------------------------------------------
+//<AMI_SHDR_END>
+typedef struct _CCID_GETSLOT_STATUS{
+ OUT UINT8 bStatus;
+ OUT UINT8 bError;
+ OUT UINT8 bClockStatus;
+ IN UINT8 Slot;
+ OUT UINTN fpDevInfo;
+} CCID_GETSLOT_STATUS, * FPCCID_GETSLOT_STATUS;
+
+//<AMI_SHDR_START>
+//----------------------------------------------------------------------------
+// Name: CCID_XFRBLOCK
+//
+// Description: This is a Core Procedure URP structure for
+// the BIOS API call USB_API_CCID_DEVICE_REQUEST command (API #2Fh )
+//----------------------------------------------------------------------------
+//<AMI_SHDR_END>
+typedef struct _CCID_CCID_XFRBLOCK{
+ IN UINTN CmdLength;
+ IN UINTN fpCmdBuffer;
+ IN UINT8 ISBlock;
+ OUT UINT8 bStatus;
+ OUT UINT8 bError;
+ IN OUT UINTN ResponseLength;
+ OUT UINTN fpResponseBuffer;
+ IN UINT8 Slot;
+ OUT UINTN fpDevInfo;
+} CCID_XFRBLOCK, * FPCCID_XFRBLOCK;
+
+//<AMI_SHDR_START>
+//----------------------------------------------------------------------------
+// Name: CCID_GET_PARAMS
+//
+// Description: This is a Core Procedure URP structure for
+// the BIOS API call USB_API_CCID_DEVICE_REQUEST command (API #2Fh )
+//----------------------------------------------------------------------------
+//<AMI_SHDR_END>
+typedef struct _CCID_GET_PARAMS{
+ OUT UINT8 bStatus;
+ OUT UINT8 bError;
+ IN OUT UINTN ResponseLength;
+ OUT UINTN fpResponseBuffer;
+ IN UINT8 Slot;
+ OUT UINTN fpDevInfo;
+} CCID_GET_PARAMS, * FPCCID_GET_PARAMS;
+
+//<AMI_SHDR_START>
+//----------------------------------------------------------------------------
+// Name: API_DATA
+//
+// Description: This is a union data type of all the API related data
+//
+//----------------------------------------------------------------------------
+//<AMI_SHDR_END>
+
+typedef union {
+ CK_PRESENCE CkPresence;
+ START_HC StartHc;
+ GET_DEV_INFO GetDevInfo;
+ CHK_DEV_PRSNC ChkDevPrsnc;
+ SECURITY_IF SecurityIf;
+ MASS_GET_DEV_INFO MassGetDevInfo;
+ MASS_GET_DEV_STATUS MassGetDevSts;
+ MASS_GET_DEV_GEO MassGetDevGeo;
+ MASS_RESET MassReset;
+ MASS_READ MassRead;
+ MASS_WRITE MassWrite;
+ MASS_VERIFY MassVerify;
+ MASS_FORMAT MassFormat;
+ MASS_REQ_SENSE MassReqSense;
+ MASS_TEST_UNIT_RDY MassTstUnitRdy;
+ MASS_START_STOP_UNIT MassStartStop;
+ MASS_READ_CAPACITY MassReadCap;
+ MASS_MODE_SENSE MassModeSense;
+ MASS_INQUIRY MassInquiry;
+ MASS_CMD_PASS_THRU MassCmdPassThru;
+ MASS_ASSIGN_DRIVE_NUM MassAssignNum;
+ MASS_CHK_DEV_READY MassChkDevReady;
+ MASS_GET_DEV_PARMS MassGetDevParms;
+ KB_LEDS_DATA KbLedsData;
+ UINT8 Owner;
+ HCPROC_PARAM HcProc;
+ COREPROC_PARAM CoreProc;
+ UINT8 KbcControlCode; //(EIP29733+)
+ GET_DEV_ADDR GetDevAddr;
+ UINT8 DevAddr;
+ // CCID APIs
+ CCID_GETSMARTCLASSDESCRIPTOR CCIDSmartClassDescriptor;
+ CCID_ATR CCIDAtr;
+ CCID_POWERUP_SLOT CCIDPowerupSlot;
+ CCID_POWERDOWN_SLOT CCIDPowerdownSlot;
+ CCID_GETSLOT_STATUS CCIDGetSlotStatus;
+ CCID_XFRBLOCK CCIDXfrBlock;
+ CCID_GET_PARAMS CCIDGetParameters;
+ UINT16 HcBusDevFuncNum; //(EIP74876+)
+ HC_START_STOP HcStartStop;
+} U_API_DATA;
+
+//<AMI_SHDR_START>
+//----------------------------------------------------------------------------
+// Name: URP_STRUC
+//
+// Description: This structure is the URP structure
+//
+// Fields: Name Type Description
+// ------------------------------------------------------------
+// bFuncNumber UINT8 Function number of the URP
+// bSubFunc UINT8 Sub-func number of the URP
+// bRetValue UINT8 Return value
+// ApiData API_DATA Refer structure definition
+//----------------------------------------------------------------------------
+//<AMI_SHDR_END>
+
+struct _URP_STRUC {
+ UINT8 bFuncNumber;
+ UINT8 bSubFunc;
+ UINT8 bRetValue;
+ U_API_DATA ApiData;
+};
+
+#pragma pack(pop)
+
+typedef struct {
+ UINT8 NumUsbKbds;
+ UINT8 NumUsbMice;
+ UINT8 NumUsbPoint; //(EIP38434+)
+ UINT8 NumUsbMass;
+ UINT8 NumUsbHubs;
+ UINT8 NumUsbCcids;
+ UINT8 NumUhcis;
+ UINT8 NumOhcis;
+ UINT8 NumEhcis;
+ UINT8 NumXhcis;
+} CONNECTED_USB_DEVICES_NUM;
+
+typedef VOID (EFIAPI *EFI_USB_REPORT_DEVICES ) (
+ CONNECTED_USB_DEVICES_NUM *);
+
+typedef struct _EFI_USB_HOTPLUG_DEVS {
+ BOOLEAN cdrom;
+ BOOLEAN floppy;
+} EFI_USB_HOTPLUG_DEVS;
+
+typedef EFI_STATUS (EFIAPI *EFI_USB_GET_HOTPLUG_DEVS ) (
+ EFI_USB_HOTPLUG_DEVS *);
+
+typedef EFI_STATUS (EFIAPI *EFI_USB_GET_RUNTIME_REGION ) (
+ EFI_PHYSICAL_ADDRESS *,
+ EFI_PHYSICAL_ADDRESS *);
+
+typedef UINT8 (EFIAPI *EFI_USB_GET_NEXT_MASS_DEVICE_NAME ) (
+ UINT8*, UINT8, UINT8);
+
+typedef struct
+{
+ EFI_BLOCK_IO_PROTOCOL BlockIoProtocol;
+ EFI_BLOCK_IO_MEDIA *Media;
+ VOID *DevInfo;
+ UINT16 LogicalAddress;
+ EFI_HANDLE Handle;
+ UINT16 PciBDF;
+ UINT8 *DevString;
+ UINT8 StorageType;
+} USB_MASS_DEV;
+
+//(EIP51653+)>
+//<AMI_SHDR_START>
+//----------------------------------------------------------------------------
+// Name: USB_SKIP_LIST
+//
+//
+// Description: If your roothub port 4 insert a hub.You want to skip hub's port 2.
+// Set bRootPort = 4, dRoutePath =2
+// If your roothub port 4 insert a hub1.And hub1 port 2 insert a hub2.
+// You want to skip hub2's port 1.
+// Set bRootPort = 4, dRoutePath =21
+// Fields: Name Type Description
+// ------------------------------------------------------------
+// bSkipType BYTE Skip by which Type
+// bSkipAll BYTE If this flag is 1 than skip all ports.
+// wBDF WORD Bus Dev Function
+// bRootPort BYTE Root port path
+// dRoutePath DWORD Hub route path. See description.
+// bBaseClass BYTE Device Type
+//
+//----------------------------------------------------------------------------
+//<AMI_SHDR_END>
+#define SKIP_FOR_ALLCONTROLLER 0x1 //(EIP62695)
+ //(EIP88776+)>
+#define SKIP_FLAG_SKIP_PORT 0x0
+#define SKIP_FLAG_KEEP_PORT 0x1
+#define SKIP_FLAG_SKIP_LEVEL 0x2 //Skip usb ports on the same level.
+#define SKIP_FLAG_SKIP_MULTI_LEVEL 0x3 //Skip usb ports which include down stream ports.
+ //<(EIP88776+)
+typedef struct _USB_SKIP_LIST{
+ UINT8 bSkipType;
+ UINT8 bFlag; //(EIP88776)
+ UINT16 wBDF;
+ UINT8 bRootPort;
+ UINT32 dRoutePath;
+ UINT8 bBaseClass;
+} USB_SKIP_LIST;
+//<(EIP51653+)
+
+//----------------------------------------------------------------------------
+// USB Mass Storage Related Data Structures and Equates
+//----------------------------------------------------------------------------
+#define USB_EMU_NONE 0
+#define USB_EMU_FLOPPY_ONLY 1
+#define USB_EMU_HDD_ONLY 2
+#define USB_EMU_HDD_OR_FDD 3
+#define USB_EMU_FORCED_FDD 4
+
+#define BAID_TYPE_HDD 1
+#define BAID_TYPE_RMD_HDD 2
+#define BAID_TYPE_CDROM 3
+#define BAID_TYPE_RMD_FDD 4
+#define BAID_TYPE_FDD 5
+
+// Values for Mass Storage Device type
+//-------------------------------------
+#define USB_MASS_DEV_UNKNOWN 0
+#define USB_MASS_DEV_HDD 1
+#define USB_MASS_DEV_CDROM 2
+#define USB_MASS_DEV_ARMD 3
+#define USB_MASS_DEV_FDD 4
+#define USB_MASS_DEV_MO 5
+
+
+#define STOP_USB_CONTROLLER 0 //(EIP43475+)
+#define START_USB_CONTROLLER 1 //(EIP43475+)
+
+typedef VOID (*API_FUNC)(URP_STRUC*);
+typedef VOID (EFIAPI *EFI_USB_CHANGE_EFI_TO_LEGACY) (UINT8);
+//typedef EFI_STATUS (EFIAPI *EFI_USB_BBS_REMOVE_MASSSTORAGE) ();
+
+typedef EFI_STATUS (EFIAPI *EFI_INSTALL_USB_LEGACY_BOOT_DEVICES)(VOID);
+typedef EFI_STATUS (EFIAPI *EFI_USB_INSTALL_LEGACY_DEVICE)(USB_MASS_DEV*);
+typedef EFI_STATUS (EFIAPI *EFI_USB_UNINSTALL_LEGACY_DEVICE)(USB_MASS_DEV*);
+typedef EFI_STATUS (EFIAPI *EFI_GET_ASSIGN_USB_BOOT_PORT)(UINT8*, UINT8*);
+typedef VOID (EFIAPI *EFI_KBC_ACCESS_CONTROL)(UINT8);
+typedef EFI_STATUS (EFIAPI *EFI_USB_RT_LEGACY_CONTROL)(VOID *);
+typedef VOID (EFIAPI *EFI_USB_STOP_UNSUPPORTED_HC)();
+typedef VOID (EFIAPI *EFI_USB_SHUTDOWN_LEGACY)(); //<(EIP52339+)
+typedef VOID (EFIAPI *EFI_USB_COPY_SKIP_TABLE)(USB_SKIP_LIST*, UINT8); //(EIP51653+)
+typedef VOID (EFIAPI *EFI_USB_RT_STOP_CONTROLLER)(UINT16); //(EIP74876+)
+typedef VOID (EFIAPI *EFI_USB_INVOKE_API)(VOID*);
+typedef struct _EFI_USB_PROTOCOL {
+ UINT32 Signature; //(EIP55275+)
+ VOID *USBDataPtr;
+// VOID *UsbBadDeviceTable; //(EIP60706-)
+ EFI_USB_REPORT_DEVICES UsbReportDevices;
+ EFI_USB_GET_NEXT_MASS_DEVICE_NAME UsbGetNextMassDeviceName;
+ EFI_USB_CHANGE_EFI_TO_LEGACY UsbChangeEfiToLegacy;
+// EFI_USB_BBS_REMOVE_MASSSTORAGE UsbBbsRemoveMassStorage;
+ EFI_USB_GET_RUNTIME_REGION UsbGetRuntimeRegion;
+ EFI_INSTALL_USB_LEGACY_BOOT_DEVICES InstallUsbLegacyBootDevices;
+ EFI_USB_INSTALL_LEGACY_DEVICE UsbInstallLegacyDevice;
+ EFI_USB_UNINSTALL_LEGACY_DEVICE UsbUninstallLegacyDevice;
+ EFI_GET_ASSIGN_USB_BOOT_PORT UsbGetAssignBootPort;
+ EFI_KBC_ACCESS_CONTROL UsbRtKbcAccessControl;
+ EFI_USB_RT_LEGACY_CONTROL UsbLegacyControl;
+ EFI_USB_STOP_UNSUPPORTED_HC UsbStopUnsupportedHc;
+ EFI_USB_SHUTDOWN_LEGACY UsbRtShutDownLegacy; //EIP52339+
+ EFI_USB_COPY_SKIP_TABLE UsbCopySkipTable; //(EIP51653+)
+ EFI_USB_RT_STOP_CONTROLLER UsbRtStopController; //(EIP74876+)
+ EFI_USB_INVOKE_API UsbInvokeApi;
+} EFI_USB_PROTOCOL;
+
+typedef struct {
+ UINT32 ConstantDataCrc32;
+ UINT32 Crc32Hash;
+} AMI_USB_GLOBAL_DATA_VALIDATION;
+
+typedef struct {
+ EFI_USB_STOP_UNSUPPORTED_HC UsbStopUnsupportedHc;
+ API_FUNC *UsbApiTable;
+ API_FUNC *UsbMassApiTable;
+ AMI_USB_GLOBAL_DATA_VALIDATION GlobalDataValidation;
+} AMI_USB_SMM_PROTOCOL;
+
+#endif
+#endif // _USB_PROT_H
+
+//****************************************************************************
+//****************************************************************************
+//** **
+//** (C)Copyright 1985-2016, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Pkwy, Norcross, GA 30093 **
+//** **
+//** Phone (770)-246-8600 **
+//** **
+//****************************************************************************
+//****************************************************************************
diff --git a/Include/Protocol/ArchProtocol.cif b/Include/Protocol/ArchProtocol.cif
new file mode 100644
index 0000000..846a440
--- /dev/null
+++ b/Include/Protocol/ArchProtocol.cif
@@ -0,0 +1,21 @@
+<component>
+ name = "ArchProtocol"
+ category = ModulePart
+ LocalRoot = "Include\Protocol\"
+ RefName = "ArchProtocol"
+[files]
+"Timer.h"
+"WatchdogTimer.h"
+"Metronome.h"
+"CPU.h"
+"RealTimeClock.h"
+"Reset.h"
+"Variable.h"
+"MonotonicCounter.h"
+"BDS.h"
+"StatusCode.h"
+"Runtime.h"
+"Capsule.h"
+"Security.h"
+"Security2.h"
+<endComponent>
diff --git a/Include/Protocol/AtaPassThru.h b/Include/Protocol/AtaPassThru.h
new file mode 100644
index 0000000..0196ee4
--- /dev/null
+++ b/Include/Protocol/AtaPassThru.h
@@ -0,0 +1,208 @@
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
+
+//*************************************************************************
+// $Header: /Alaska/BIN/Core/Include/Protocol/AtaPassThru.h 1 6/13/11 6:35p Artems $
+//
+// $Revision: 1 $
+//
+// $Date: 6/13/11 6:35p $
+//*************************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Core/Include/Protocol/AtaPassThru.h $
+//
+// 1 6/13/11 6:35p Artems
+//
+//*************************************************************************
+//<AMI_FHDR_START>
+//
+// Name: AtaPassThru.h
+//
+// Description:
+// EFI_DRIVER_HEALTH_PROTOCOL definition file
+//
+//<AMI_FHDR_END>
+//*************************************************************************
+#ifndef __ATA_PASS_THRU_PROTOCOL__H__
+#define __ATA_PASS_THRU_PROTOCOL__H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <EFI.h>
+#include <Protocol/DevicePath.h>
+
+#define EFI_ATA_PASS_THRU_PROTOCOL_GUID \
+ { 0x1d3de7f0, 0x807, 0x424f, 0xaa, 0x69, 0x11, 0xa5, 0x4e, 0x19, 0xa4, 0x6f }
+
+GUID_VARIABLE_DECLARATION(gEfiAtaPassThruProtocolGuid, EFI_ATA_PASS_THRU_PROTOCOL_GUID);
+
+typedef struct _EFI_ATA_PASS_THRU_PROTOCOL EFI_ATA_PASS_THRU_PROTOCOL;
+
+typedef struct {
+ UINT32 Attributes;
+ UINT32 IoAlign;
+} EFI_ATA_PASS_THRU_MODE;
+
+#define EFI_ATA_PASS_THRU_ATTRIBUTES_PHYSICAL 0x0001
+#define EFI_ATA_PASS_THRU_ATTRIBUTES_LOGICAL 0x0002
+#define EFI_ATA_PASS_THRU_ATTRIBUTES_NONBLOCKIO 0x0004
+
+typedef struct _EFI_ATA_COMMAND_BLOCK {
+ UINT8 Reserved1[2];
+ UINT8 AtaCommand;
+ UINT8 AtaFeatures;
+ UINT8 AtaSectorNumber;
+ UINT8 AtaCylinderLow;
+ UINT8 AtaCylinderHigh;
+ UINT8 AtaDeviceHead;
+ UINT8 AtaSectorNumberExp;
+ UINT8 AtaCylinderLowExp;
+ UINT8 AtaCylinderHighExp;
+ UINT8 AtaFeaturesExp;
+ UINT8 AtaSectorCount;
+ UINT8 AtaSectorCountExp;
+ UINT8 Reserved2[6];
+} EFI_ATA_COMMAND_BLOCK;
+
+typedef struct _EFI_ATA_STATUS_BLOCK {
+ UINT8 Reserved1[2];
+ UINT8 AtaStatus;
+ UINT8 AtaError;
+ UINT8 AtaSectorNumber;
+ UINT8 AtaCylinderLow;
+ UINT8 AtaCylinderHigh;
+ UINT8 AtaDeviceHead;
+ UINT8 AtaSectorNumberExp;
+ UINT8 AtaCylinderLowExp;
+ UINT8 AtaCylinderHighExp;
+ UINT8 Reserved2;
+ UINT8 AtaSectorCount;
+ UINT8 AtaSectorCountExp;
+ UINT8 Reserved3[6];
+} EFI_ATA_STATUS_BLOCK;
+
+typedef UINT8 EFI_ATA_PASS_THRU_CMD_PROTOCOL;
+
+#define EFI_ATA_PASS_THRU_PROTOCOL_ATA_HARDWARE_RESET 0x00
+#define EFI_ATA_PASS_THRU_PROTOCOL_ATA_SOFTWARE_RESET 0x01
+#define EFI_ATA_PASS_THRU_PROTOCOL_ATA_NON_DATA 0x02
+#define EFI_ATA_PASS_THRU_PROTOCOL_PIO_DATA_IN 0x04
+#define EFI_ATA_PASS_THRU_PROTOCOL_PIO_DATA_OUT 0x05
+#define EFI_ATA_PASS_THRU_PROTOCOL_DMA 0x06
+#define EFI_ATA_PASS_THRU_PROTOCOL_DMA_QUEUED 0x07
+#define EFI_ATA_PASS_THRU_PROTOCOL_DEVICE_DIAGNOSTIC 0x08
+#define EFI_ATA_PASS_THRU_PROTOCOL_DEVICE_RESET 0x09
+#define EFI_ATA_PASS_THRU_PROTOCOL_UDMA_DATA_IN 0x0A
+#define EFI_ATA_PASS_THRU_PROTOCOL_UDMA_DATA_OUT 0x0B
+#define EFI_ATA_PASS_THRU_PROTOCOL_FPDMA 0x0C
+#define EFI_ATA_PASS_THRU_PROTOCOL_RETURN_RESPONSE 0xFF
+
+typedef UINT8 EFI_ATA_PASS_THRU_LENGTH;
+
+#define EFI_ATA_PASS_THRU_LENGTH_BYTES 0x80
+#define EFI_ATA_PASS_THRU_LENGTH_MASK 0x70
+#define EFI_ATA_PASS_THRU_LENGTH_NO_DATA_TRANSFER 0x00
+#define EFI_ATA_PASS_THRU_LENGTH_FEATURES 0x10
+#define EFI_ATA_PASS_THRU_LENGTH_SECTOR_COUNT 0x20
+#define EFI_ATA_PASS_THRU_LENGTH_TPSIU 0x30
+#define EFI_ATA_PASS_THRU_LENGTH_COUNT 0x0F
+
+typedef struct {
+ EFI_ATA_STATUS_BLOCK *Asb;
+ EFI_ATA_COMMAND_BLOCK *Acb;
+ UINT64 Timeout;
+ VOID *InDataBuffer;
+ VOID *OutDataBuffer;
+ UINT32 InTransferLength;
+ UINT32 OutTransferLength;
+ EFI_ATA_PASS_THRU_CMD_PROTOCOL Protocol;
+ EFI_ATA_PASS_THRU_LENGTH Length;
+} EFI_ATA_PASS_THRU_COMMAND_PACKET;
+
+typedef EFI_STATUS (EFIAPI *EFI_ATA_PASS_THRU_PASSTHRU) (
+ IN EFI_ATA_PASS_THRU_PROTOCOL *This,
+ IN UINT16 Port,
+ IN UINT16 PortMultiplierPort,
+ IN OUT EFI_ATA_PASS_THRU_COMMAND_PACKET *Packet,
+ IN EFI_EVENT Event OPTIONAL
+);
+
+typedef EFI_STATUS (EFIAPI *EFI_ATA_PASS_THRU_GET_NEXT_PORT) (
+ IN EFI_ATA_PASS_THRU_PROTOCOL *This,
+ IN OUT UINT16 *Port
+);
+
+typedef EFI_STATUS (EFIAPI *EFI_ATA_PASS_THRU_GET_NEXT_DEVICE) (
+ IN EFI_ATA_PASS_THRU_PROTOCOL *This,
+ IN UINT16 Port,
+ IN OUT UINT16 *PortMultiplierPort
+);
+
+typedef EFI_STATUS (EFIAPI *EFI_ATA_PASS_THRU_BUILD_DEVICE_PATH) (
+ IN EFI_ATA_PASS_THRU_PROTOCOL *This,
+ IN UINT16 Port,
+ IN UINT16 PortMultiplierPort,
+ IN OUT EFI_DEVICE_PATH_PROTOCOL **DevicePath
+);
+
+typedef EFI_STATUS (EFIAPI *EFI_ATA_PASS_THRU_GET_DEVICE) (
+ IN EFI_ATA_PASS_THRU_PROTOCOL *This,
+ IN EFI_DEVICE_PATH_PROTOCOL *DevicePath,
+ OUT UINT16 *Port,
+ OUT UINT16 *PortMultiplierPort
+);
+
+typedef EFI_STATUS (EFIAPI *EFI_ATA_PASS_THRU_RESET_PORT) (
+ IN EFI_ATA_PASS_THRU_PROTOCOL *This,
+ IN UINT16 Port
+);
+
+typedef EFI_STATUS (EFIAPI *EFI_ATA_PASS_THRU_RESET_DEVICE) (
+ IN EFI_ATA_PASS_THRU_PROTOCOL *This,
+ IN UINT16 Port,
+ IN UINT16 PortMultiplierPort
+);
+
+struct _EFI_ATA_PASS_THRU_PROTOCOL {
+ EFI_ATA_PASS_THRU_MODE *Mode;
+ EFI_ATA_PASS_THRU_PASSTHRU PassThru;
+ EFI_ATA_PASS_THRU_GET_NEXT_PORT GetNextPort;
+ EFI_ATA_PASS_THRU_GET_NEXT_DEVICE GetNextDevice;
+ EFI_ATA_PASS_THRU_BUILD_DEVICE_PATH BuildDevicePath;
+ EFI_ATA_PASS_THRU_GET_DEVICE GetDevice;
+ EFI_ATA_PASS_THRU_RESET_PORT ResetPort;
+ EFI_ATA_PASS_THRU_RESET_DEVICE ResetDevice;
+};
+
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
diff --git a/Include/Protocol/AuthenticationInfo.h b/Include/Protocol/AuthenticationInfo.h
new file mode 100644
index 0000000..99a10df
--- /dev/null
+++ b/Include/Protocol/AuthenticationInfo.h
@@ -0,0 +1,93 @@
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
+
+//*************************************************************************
+// $Header: /Alaska/BIN/Core/Include/Protocol/AuthenticationInfo.h 1 4/22/11 6:45p Artems $
+//
+// $Revision: 1 $
+//
+// $Date: 4/22/11 6:45p $
+//*************************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Core/Include/Protocol/AuthenticationInfo.h $
+//
+// 1 4/22/11 6:45p Artems
+//
+//*************************************************************************
+//<AMI_FHDR_START>
+//
+// Name: AuthenticationInfo.h
+//
+// Description:
+// EFI_AUTHENTICATION_INFO_PROTOCOL definition file
+//
+//<AMI_FHDR_END>
+//*************************************************************************
+#ifndef __AUTHENTICATION_INFO_PROTOCOL__H__
+#define __AUTHENTICATION_INFO_PROTOCOL__H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <EFI.h>
+
+#define EFI_AUTHENTICATION_INFO_PROTOCOL_GUID \
+ { 0x7671d9d0, 0x53db, 0x4173, 0xaa, 0x69, 0x23, 0x27, 0xf2, 0x1f, 0xb, 0xc7 }
+
+GUID_VARIABLE_DECLARATION(gEfiAuthenticationInfoProtocolGuid, EFI_AUTHENTICATION_INFO_PROTOCOL_GUID);
+
+
+typedef struct _EFI_AUTHENTICATION_INFO_PROTOCOL EFI_AUTHENTICATION_INFO_PROTOCOL;
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_AUTHENTICATION_INFO_PROTOCOL_GET) (
+ IN EFI_AUTHENTICATION_INFO_PROTOCOL *This,
+ IN EFI_HANDLE ControllerHandle,
+ OUT VOID **Buffer
+);
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_AUTHENTICATION_INFO_PROTOCOL_SET) (
+ IN EFI_AUTHENTICATION_INFO_PROTOCOL *This,
+ IN EFI_HANDLE ControllerHandle,
+ IN VOID *Buffer
+);
+
+struct _EFI_AUTHENTICATION_INFO_PROTOCOL {
+ EFI_AUTHENTICATION_INFO_PROTOCOL_GET Get;
+ EFI_AUTHENTICATION_INFO_PROTOCOL_SET Set;
+};
+
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
diff --git a/Include/Protocol/BDS.h b/Include/Protocol/BDS.h
new file mode 100644
index 0000000..16088a5
--- /dev/null
+++ b/Include/Protocol/BDS.h
@@ -0,0 +1,88 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2005, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/BIN/Core/CORE_DXE/ArchProtocol/BDS.h 3 3/13/06 1:45a Felixp $
+//
+// $Revision: 3 $
+//
+// $Date: 3/13/06 1:45a $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Core/CORE_DXE/ArchProtocol/BDS.h $
+//
+// 3 3/13/06 1:45a Felixp
+//
+// 2 3/04/05 10:30a Mandal
+//
+// 1 1/28/05 12:44p Felixp
+//
+// 2 1/18/05 3:21p Felixp
+// PrintDebugMessage renamed to Trace
+//
+// 1 12/23/04 9:42a Felixp
+//
+// 1 12/23/04 9:29a Felixp
+//
+// 1 3/30/04 2:24a Felixp
+//
+//**********************************************************************
+//<AMI_FHDR_START>
+//
+// Name: BDS.h
+//
+// Description: BDS Architectural Protocol Definition
+//
+//<AMI_FHDR_END>
+//**********************************************************************
+#ifndef __BDS_ARCH_PROTOCOL_H__
+#define __BDS_ARCH_PROTOCOL_H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+#include <EFI.h>
+
+#define EFI_BDS_ARCH_PROTOCOL_GUID \
+ {0x665E3FF6,0x46CC,0x11d4,0x9A,0x38,0x00,0x90,0x27,0x3F,0xC1,0x4D}
+
+GUID_VARIABLE_DECLARATION(gEfiBdsArchProtocolGuid, EFI_BDS_ARCH_PROTOCOL_GUID);
+
+typedef struct _EFI_BDS_ARCH_PROTOCOL EFI_BDS_ARCH_PROTOCOL;
+
+typedef VOID (EFIAPI *EFI_BDS_ENTRY) (
+ IN EFI_BDS_ARCH_PROTOCOL *This
+);
+
+struct _EFI_BDS_ARCH_PROTOCOL{
+ EFI_BDS_ENTRY Entry;
+} ;
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2005, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
diff --git a/Include/Protocol/BlockIo.h b/Include/Protocol/BlockIo.h
new file mode 100644
index 0000000..8a1d7d1
--- /dev/null
+++ b/Include/Protocol/BlockIo.h
@@ -0,0 +1,212 @@
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
+//**********************************************************************
+// $Header: /Alaska/BIN/Core/Include/Protocol/BlockIo.h 5 4/21/11 12:50p Artems $
+//
+// $Revision: 5 $
+//
+// $Date: 4/21/11 12:50p $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Core/Include/Protocol/BlockIo.h $
+//
+// 5 4/21/11 12:50p Artems
+// EIP 58686: add new structure fields for UEFI 2.3.1 specification
+// compliance
+//
+// 4 3/13/06 1:40a Felixp
+//
+// 3 3/04/05 10:31a Mandal
+//
+// 2 2/08/05 11:49a Felixp
+// EFI_LBA definition removed since it's already defined in EFI.h
+//
+// 1 1/28/05 12:44p Felixp
+//
+// 2 1/18/05 3:21p Felixp
+// PrintDebugMessage renamed to Trace
+//
+// 1 12/23/04 9:41a Felixp
+//
+// 1 8/19/04 6:26p Robert
+//
+// 1 1/26/04 3:25p Markw
+//
+//**********************************************************************
+//<AMI_FHDR_START>
+//
+// Name: BlockIo.h
+//
+// Description: EFI_BLOCK_IO_PROTOCOL definition file
+//
+//<AMI_FHDR_END>
+//**********************************************************************
+#ifndef __BLOCK_IO_PROTOCOL_H__
+#define __BLOCK_IO_PROTOCOL_H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+#include <EFI.h>
+
+#define EFI_BLOCK_IO_PROTOCOL_GUID \
+ { 0x964e5b21, 0x6459, 0x11d2, 0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b }
+
+#define EFI_BLOCK_IO_PROTOCOL_REVISION2 0x00020001
+#define EFI_BLOCK_IO_PROTOCOL_REVISION3 ((2<<16) | (31))
+
+GUID_VARIABLE_DECLARATION(gEfiBlockIoProtocolGuid,EFI_BLOCK_IO_PROTOCOL_GUID);
+
+// Forward reference for pure ANSI compatability
+typedef struct _EFI_BLOCK_IO_PROTOCOL EFI_BLOCK_IO_PROTOCOL;
+
+//=============================================================================
+typedef struct {
+ UINT32 MediaId;
+ BOOLEAN RemovableMedia;
+ BOOLEAN MediaPresent;
+ BOOLEAN LogicalPartition;
+ BOOLEAN ReadOnly;
+ BOOLEAN WriteCaching;
+ UINT32 BlockSize;
+ UINT32 IoAlign;
+ EFI_LBA LastBlock;
+ EFI_LBA LowestAlignedLba; //added in Revision 2
+ UINT32 LogicalBlocksPerPhysicalBlock; //added in Revision 2
+ UINT32 OptimalTransferLengthGranularity; //added in Revision 3
+} EFI_BLOCK_IO_MEDIA;
+
+//=============================================================================
+// Function: Reset
+//
+// Description: resets the block device hardware.
+//
+// Inputs:
+// This - Indicates a pointer to the calling context.
+// ExtendedVerification - Indicates that the driver may perform a more exhaustive
+// verification operation of the device during reset.
+//
+// Outputs: Returns EFI_STATUS
+//
+// Notes:
+//
+//=============================================================================
+typedef EFI_STATUS (EFIAPI *EFI_BLOCK_RESET) (
+ IN EFI_BLOCK_IO_PROTOCOL *This,
+ IN BOOLEAN ExtendedVerification
+);
+
+//=============================================================================
+// Function: ReadBlocks
+//
+// Description: function reads the requested number of blocks from the device. All the
+// blocks are read, or an error is returned.
+//
+// Inputs:
+// This Indicates a pointer to the calling context.
+// MediaId - The media ID that the read request is for.
+// LBA - The starting logical block address to read from on the device.
+// BufferSize - The size of the Buffer in bytes. This must be a multiple of the intrinsic
+// block size of the device.
+//
+// Outputs:
+// Buffer - A pointer to the destination buffer for the data. The caller is responsible
+// for either having implicit or explicit ownership of the buffer.
+//
+// Notes:
+//
+//=============================================================================
+typedef EFI_STATUS (EFIAPI *EFI_BLOCK_READ) (
+ IN EFI_BLOCK_IO_PROTOCOL *This,
+ IN UINT32 MediaId,
+ IN EFI_LBA LBA,
+ IN UINTN BufferSize,
+ OUT VOID *Buffer
+);
+
+//=============================================================================
+// Function: WriteBlocks
+//
+// Description: writes the requested number of blocks to the device. All blocks
+// are written, or an error is returned.
+//
+// Inputs:
+// This - Indicates a pointer to the calling context.
+// MediaId - The media ID that the write request is for.
+// LBA - The starting logical block address to be written.
+// BufferSize - The size in bytes of Buffer. This must be a multiple of the intrinsic
+// block size of the device.
+// Buffer - A pointer to the source buffer for the data.
+//
+// Outputs: returns EFI_STATUS
+//
+// Notes:
+//
+//=============================================================================
+typedef EFI_STATUS (EFIAPI *EFI_BLOCK_WRITE) (
+ IN EFI_BLOCK_IO_PROTOCOL *This,
+ IN UINT32 MediaId,
+ IN EFI_LBA LBA,
+ IN UINTN BufferSize,
+ IN VOID *Buffer
+);
+
+//=============================================================================
+// Function: FlushBlocks
+//
+// Description: flushes all modified data to the physical block device.
+//
+// Inputs:
+// This - Indicates a pointer to the calling context.
+//
+// Outputs: returns EFI_STATUS
+//
+// Notes:
+//
+//=============================================================================
+typedef EFI_STATUS (EFIAPI *EFI_BLOCK_FLUSH) (
+ IN EFI_BLOCK_IO_PROTOCOL *This
+);
+
+//=============================================================================
+// Protocol Definition
+struct _EFI_BLOCK_IO_PROTOCOL {
+ UINT64 Revision;
+ EFI_BLOCK_IO_MEDIA *Media;
+ EFI_BLOCK_RESET Reset;
+ EFI_BLOCK_READ ReadBlocks;
+ EFI_BLOCK_WRITE WriteBlocks;
+ EFI_BLOCK_FLUSH FlushBlocks;
+};
+
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
diff --git a/Include/Protocol/BootScriptSave.h b/Include/Protocol/BootScriptSave.h
new file mode 100644
index 0000000..744ce64
--- /dev/null
+++ b/Include/Protocol/BootScriptSave.h
@@ -0,0 +1,193 @@
+//**********************************************************************//
+//**********************************************************************//
+//** **//
+//** (C)Copyright 1985-2007, American Megatrends, Inc. **//
+//** **//
+//** All Rights Reserved. **//
+//** **//
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **//
+//** **//
+//** Phone: (770)-246-8600 **//
+//** **//
+//**********************************************************************//
+//**********************************************************************//
+
+//**********************************************************************
+// $Header: /Alaska/BIN/Core/Include/Protocol/BootScriptSave.h 12 6/16/11 9:48a Felixp $
+//
+// $Revision: 12 $
+//
+// $Date: 6/16/11 9:48a $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Core/Include/Protocol/BootScriptSave.h $
+//
+// 12 6/16/11 9:48a Felixp
+// BOOT_SCRIPT_S3_... macros moved to AmiDxeLib.h from BootScripSave.h
+//
+// 11 5/13/11 3:29p Oleksiyy
+// [TAG] EIP56650
+// [Category] New Feature
+// [Description] S3 Save State Protocol and S3 Smm Save State Protocol
+// functions added. Support for opcodes introduced in PI 1.2 added.
+// [Files] BootScriptCommon.h, BootScriptExecuter.c,
+// BootScriptPrivate.h, BootScriptSave.c and BootScriptSave.h
+//
+// 10 3/09/11 5:43p Artems
+// EFI_BOOT_SCRIPT_WIDTH moved to BootScriptCommon.h
+//
+// 9 2/05/11 2:29p Artems
+// Common definitions for PI 0.91 and PI 1.1 moved to BootScriptCommon.h
+//
+// 8 7/17/07 10:44a Markw
+// Updated typecasts in macro where UINTN is needed.
+//
+// 7 2/12/07 11:20a Felixp
+// Clean up
+//
+// 6 2/12/07 11:18a Felixp
+// Revision field removed from EFI_BOOT_SCRIPT_SAVE_PROTOCOL structure
+// to match BootScript spec (it was earlier their for Tiano compliance.
+// Tiano header is fixed now).
+//
+// 5 12/26/06 2:57p Markw
+// Add BootScript Polling.
+//
+// 4 3/13/06 1:40a Felixp
+//
+// 3 11/07/05 3:42p Sivagarn
+// Removed SMBus related definitions. The Smbus definitions are moved to
+// appropriate SMBUS.H file.
+//
+// 2 4/04/05 4:37p Markw
+// Modified existing and added new macros.
+//
+// 1 1/28/05 12:44p Felixp
+//
+// 1 12/23/04 9:41a Felixp
+//
+// 5 4/22/04 2:32p Felixp
+//
+// 4 3/09/04 9:37a Markw
+// Fixed Io RW Macro.
+//
+// 3 3/08/04 5:25p Markw
+// Fixed the BootScriptSave macros.
+//
+// 2 3/02/04 4:44p Markw
+// Added Boot Script Macros
+//
+// 1 2/26/04 2:36p Markw
+//
+//**********************************************************************
+
+
+//<AMI_FHDR_START>
+//---------------------------------------------------------------------------
+// Name: BootScriptSave.h
+//
+// Description: Boot Script Save Protocol header.
+//
+//---------------------------------------------------------------------------
+//<AMI_FHDR_END>
+
+#ifndef __BOOT_SCRIPT_SAVE_PROTOCOL__H__
+#define __BOOT_SCRIPT_SAVE_PROTOCOL__H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+#include <EFI.h>
+#include <BootScriptCommon.h>
+
+#define EFI_BOOT_SCRIPT_SAVE_GUID \
+ {0x470e1529,0xb79e,0x4e32,0xa0,0xfe,0x6a,0x15,0x6d,0x29,0xf9,0xb2}
+
+GUID_VARIABLE_DECLARATION(gEfiBootScriptSaveGuid,EFI_BOOT_SCRIPT_SAVE_GUID);
+
+//*******************************************
+// EFI_ACPI_S3_RESUME_SCRIPT_TABLE
+//*******************************************
+#define EFI_ACPI_S3_RESUME_SCRIPT_TABLE 0x00
+
+//*****************
+// Generic macros.
+//*****************
+
+#define BOOT_SCRIPT_IO_WRITE_MACRO(This, TableName, Width, Address, Count, Buffer) \
+ This->Write(This,TableName,EFI_BOOT_SCRIPT_IO_WRITE_OPCODE,Width,(UINT64)Address,(UINTN)Count,Buffer)
+
+#define BOOT_SCRIPT_IO_READ_WRITE_MACRO(This,TableName,Width,Address,Data,DataMask) \
+ This->Write(This,TableName,EFI_BOOT_SCRIPT_IO_READ_WRITE_OPCODE,Width,(UINT64)Address,Data,DataMask)
+
+#define BOOT_SCRIPT_MEM_WRITE_MACRO(This,TableName,Width,Address,Count,Buffer) \
+ This->Write(This,TableName,EFI_BOOT_SCRIPT_MEM_WRITE_OPCODE,Width,(UINT64)Address,(UINTN)Count,Buffer)
+
+#define BOOT_SCRIPT_MEM_READ_WRITE_MACRO(This,TableName,Width,Address,Data,DataMask) \
+ This->Write(This,TableName,EFI_BOOT_SCRIPT_MEM_READ_WRITE_OPCODE,Width,(UINT64)Address,Data,DataMask)
+
+#define BOOT_SCRIPT_PCI_CONFIG_WRITE_MACRO(This,TableName,Width,Address,Count,Buffer) \
+ This->Write(This,TableName,EFI_BOOT_SCRIPT_PCI_CONFIG_WRITE_OPCODE,Width,(UINT64)Address,(UINTN)Count,Buffer)
+
+#define BOOT_SCRIPT_PCI_CONFIG_READ_WRITE_MACRO(This,TableName,Width,Address,Data,DataMask) \
+ This->Write(This,TableName,EFI_BOOT_SCRIPT_PCI_CONFIG_READ_WRITE_OPCODE,Width,(UINT64)Address,Data,DataMask)
+
+#define BOOT_SCRIPT_SMBUS_EXECUTE_MACRO(This,TableName,SlaveAddress,Command,Operation,PecCheck,Length,Buffer) \
+ This->Write(This,TableName,EFI_BOOT_SCRIPT_SMBUS_EXECUTE_OPCODE,SlaveAddress,Command,Operation,PecCheck,Length,Buffer)
+
+#define BOOT_SCRIPT_STALL_MACRO(This,TableName,Duration) \
+ This->Write(This,TableName,EFI_BOOT_SCRIPT_STALL_OPCODE,Duration)
+
+#define BOOT_SCRIPT_DISPATCH_MACRO(This,TableName,EntryPoint) \
+ This->Write(This,TableName,EFI_BOOT_SCRIPT_DISPATCH_OPCODE,(EFI_PHYSICAL_ADDRESS)EntryPoint)
+
+//OEM
+
+#define BOOT_SCRIPT_IO_POLL_MACRO(This,TableName,Width,Address,Mask,Result) \
+ This->Write(This,TableName,EFI_BOOT_SCRIPT_IO_POLL_OPCODE_OEM,Width,(UINT64)Address,Mask,Result)
+
+#define BOOT_SCRIPT_MEM_POLL_MACRO(This,TableName,Width,Address,Mask,Result) \
+ This->Write(This,TableName,EFI_BOOT_SCRIPT_MEM_POLL_OPCODE_OEM,Width,(UINT64)Address,Mask,Result)
+
+#define BOOT_SCRIPT_PCI_POLL_MACRO(This,TableName,Width,Address,Mask,Result) \
+ This->Write(This,TableName,EFI_BOOT_SCRIPT_PCI_POLL_OPCODE_OEM,Width,(UINT64)Address,Mask,Result)
+
+typedef struct _EFI_BOOT_SCRIPT_SAVE_PROTOCOL EFI_BOOT_SCRIPT_SAVE_PROTOCOL;
+
+typedef EFI_STATUS (EFIAPI *EFI_BOOT_SCRIPT_WRITE) (
+ IN EFI_BOOT_SCRIPT_SAVE_PROTOCOL *This,
+ IN UINT16 TableName,
+ IN UINT16 OpCode,
+ ...
+);
+
+typedef EFI_STATUS (EFIAPI *EFI_BOOT_SCRIPT_CLOSE_TABLE) (
+ IN EFI_BOOT_SCRIPT_SAVE_PROTOCOL *This,
+ IN UINT16 TableName,
+ OUT EFI_PHYSICAL_ADDRESS *Address
+);
+
+struct _EFI_BOOT_SCRIPT_SAVE_PROTOCOL {
+ EFI_BOOT_SCRIPT_WRITE Write;
+ EFI_BOOT_SCRIPT_CLOSE_TABLE CloseTable;
+};
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+
+//**********************************************************************//
+//**********************************************************************//
+//** **//
+//** (C)Copyright 1985-2007, American Megatrends, Inc. **//
+//** **//
+//** All Rights Reserved. **//
+//** **//
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **//
+//** **//
+//** Phone: (770)-246-8600 **//
+//** **//
+//**********************************************************************//
+//**********************************************************************//
diff --git a/Include/Protocol/BusSpecificDriverOverride.h b/Include/Protocol/BusSpecificDriverOverride.h
new file mode 100644
index 0000000..090202a
--- /dev/null
+++ b/Include/Protocol/BusSpecificDriverOverride.h
@@ -0,0 +1,88 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2005, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/BIN/Core/Include/Protocol/BusSpecificDriverOverride.h 3 3/13/06 1:40a Felixp $
+//
+// $Revision: 3 $
+//
+// $Date: 3/13/06 1:40a $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Core/Include/Protocol/BusSpecificDriverOverride.h $
+//
+// 3 3/13/06 1:40a Felixp
+//
+// 2 3/04/05 10:32a Mandal
+//
+// 1 1/28/05 12:44p Felixp
+//
+// 2 1/18/05 3:21p Felixp
+// PrintDebugMessage renamed to Trace
+//
+// 1 12/23/04 9:41a Felixp
+//
+// 2 3/13/04 5:13p Felixp
+//
+// 1 3/13/04 4:36p Felixp
+//
+//**********************************************************************
+//<AMI_FHDR_START>
+//
+// Name: BusSpecificDriverOverride
+//
+// Description: EFI_BUS_SPECIFIC_DRIVER_OVERRIDE Protocol Definition
+//
+//<AMI_FHDR_END>
+//**********************************************************************
+#ifndef __EFI_BUS_SPECIFIC_DRIVER_OVERRIDE_PROTOCOL__H__
+#define __EFI_BUS_SPECIFIC_DRIVER_OVERRIDE_PROTOCOL__H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+#include <EFI.h>
+
+#define EFI_BUS_SPECIFIC_DRIVER_OVERRIDE_PROTOCOL_GUID \
+ { 0x3bc1b285,0x8a15,0x4a82,0xaa,0xbf,0x4d,0x7d,0x13,0xfb,0x32,0x65 }
+
+GUID_VARIABLE_DECLARATION(gEfiBusSpecificDriverOverrideProtocolGuid,EFI_BUS_SPECIFIC_DRIVER_OVERRIDE_PROTOCOL_GUID);
+
+typedef struct _EFI_BUS_SPECIFIC_DRIVER_OVERRIDE_PROTOCOL EFI_BUS_SPECIFIC_DRIVER_OVERRIDE_PROTOCOL;
+
+typedef EFI_STATUS (EFIAPI *EFI_BUS_SPECIFIC_DRIVER_OVERRIDE_GET_DRIVER) (
+ IN EFI_BUS_SPECIFIC_DRIVER_OVERRIDE_PROTOCOL *This,
+ IN OUT EFI_HANDLE *DriverImageHandle
+);
+
+struct _EFI_BUS_SPECIFIC_DRIVER_OVERRIDE_PROTOCOL {
+ EFI_BUS_SPECIFIC_DRIVER_OVERRIDE_GET_DRIVER GetDriver;
+};
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2005, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
diff --git a/Include/Protocol/CPU.h b/Include/Protocol/CPU.h
new file mode 100644
index 0000000..8a32d81
--- /dev/null
+++ b/Include/Protocol/CPU.h
@@ -0,0 +1,174 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2005, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/BIN/Core/CORE_DXE/ArchProtocol/CPU.h 2 3/13/06 1:45a Felixp $
+//
+// $Revision: 2 $
+//
+// $Date: 3/13/06 1:45a $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Core/CORE_DXE/ArchProtocol/CPU.h $
+//
+// 2 3/13/06 1:45a Felixp
+//
+// 1 1/28/05 12:44p Felixp
+//
+// 2 1/18/05 3:21p Felixp
+// PrintDebugMessage renamed to Trace
+//
+// 1 12/23/04 9:42a Felixp
+//
+// 1 12/23/04 9:29a Felixp
+//
+// 1 1/05/04 4:07p Markw
+//
+//**********************************************************************
+//<AMI_FHDR_START>
+//
+// Name: Cpu.h
+//
+// Description: This header defines the CPU Architecture protocol.
+//
+//<AMI_FHDR_END>
+//**********************************************************************
+#ifndef __CPU_ARCH_PROTOCOL_H__
+#define __CPU_ARCH_PROTOCOL_H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define EFI_CPU_ARCH_PROTOCOL_GUID \
+ {0x26baccb1,0x6f42,0x11d4,0xbc,0xe7,0x0,0x80,0xc7,0x3c,0x88,0x81}
+
+GUID_VARIABLE_DECLARATION(gEfiCpuArchProtocolGuid, EFI_CPU_ARCH_PROTOCOL_GUID);
+
+#ifndef GUID_VARIABLE_DEFINITION
+#include <Protocol/DebugSupport.h>
+
+typedef struct _EFI_CPU_ARCH_PROTOCOL EFI_CPU_ARCH_PROTOCOL;
+
+typedef enum {
+ EfiCpuFlushTypeWriteBackInvalidate,
+ EfiCpuFlushTypeWriteBack,
+ EfiCpuFlushTypeInvalidate,
+ EfiCpuMaxFlushType
+} EFI_CPU_FLUSH_TYPE;
+
+typedef EFI_STATUS (EFIAPI *EFI_CPU_FLUSH_DATA_CACHE) (
+ IN EFI_CPU_ARCH_PROTOCOL *This,
+ IN EFI_PHYSICAL_ADDRESS Start,
+ IN UINT64 Length,
+ IN EFI_CPU_FLUSH_TYPE FlushType);
+
+typedef EFI_STATUS (EFIAPI *EFI_CPU_ENABLE_INTERRUPT) (
+ IN EFI_CPU_ARCH_PROTOCOL *This);
+
+typedef EFI_STATUS (EFIAPI *EFI_CPU_DISABLE_INTERRUPT) (
+ IN EFI_CPU_ARCH_PROTOCOL *This);
+
+typedef EFI_STATUS (EFIAPI *EFI_CPU_GET_INTERRUPT_STATE) (
+ IN EFI_CPU_ARCH_PROTOCOL *This,
+ OUT BOOLEAN *State);
+
+ typedef enum {
+ EfiCpuInit,
+ EfiCpuMaxInitType
+ } EFI_CPU_INIT_TYPE;
+
+typedef EFI_STATUS (EFIAPI *EFI_CPU_INIT) (
+ IN EFI_CPU_ARCH_PROTOCOL *This,
+ IN EFI_CPU_INIT_TYPE InitType);
+
+
+ typedef VOID (*EFI_CPU_INTERRUPT_HANDLER) (
+ IN EFI_EXCEPTION_TYPE InterruptType,
+ IN EFI_SYSTEM_CONTEXT SystemContext);
+
+typedef EFI_STATUS (EFIAPI *EFI_CPU_REGISTER_INTERRUPT_HANDLER) (
+ IN EFI_CPU_ARCH_PROTOCOL *This,
+ IN EFI_EXCEPTION_TYPE InterruptType,
+ IN EFI_CPU_INTERRUPT_HANDLER InterruptHandler);
+
+typedef EFI_STATUS (EFIAPI *EFI_CPU_GET_TIMER_VALUE) (
+ IN EFI_CPU_ARCH_PROTOCOL *This,
+ IN UINT32 TimerIndex,
+ OUT UINT64 *TimerValue,
+ OUT UINT64 *TimerPeriod OPTIONAL);
+
+typedef EFI_STATUS (EFIAPI *EFI_CPU_SET_MEMORY_ATTRIBUTES) (
+ IN EFI_CPU_ARCH_PROTOCOL *This,
+ IN EFI_PHYSICAL_ADDRESS BaseAddress,
+ IN UINT64 Length,
+ IN UINT64 Attributes);
+
+
+//**********************************************************************
+//<AMI_SHDR_START>
+//
+// Name: EFI_CPU_ARCH_PROTOCOL
+//
+// Description: CPU Architecture Protocol for modifing the Interrupt state,
+// Interrupt Handles, INIT CPU, Reading CPU timers, flush data
+// cache if needed for DMA, and setting Cache Attributes.
+//
+// Fields: Name Type Description
+// ------------------------------------------------------------
+// FlushDataCache EFI_CPU_FLUSH_DATA_CACHE
+// EnableInterrupt EFI_CPU_ENABLE_INTERRUPT
+// DisableInterrupt EFI_CPU_DISABLE_INTERRUPT
+// GetInterruptState EFI_CPU_GET_INTERRUPT_STATE
+// Init EFI_CPU_INIT
+// RegisterInterruptHandler EFI_CPU_REGISTER_INTERRUPT_HANDLER
+// GetTimerValue EFI_CPU_GET_TIMER_VALUE
+// SetMemoryAttributes EFI_CPU_SET_MEMORY_ATTRIBUTES
+// NumberOfTimers UINT32
+// DmaBufferAlignment UINT32
+//
+//<AMI_SHDR_END>
+//**********************************************************************
+typedef struct _EFI_CPU_ARCH_PROTOCOL {
+ EFI_CPU_FLUSH_DATA_CACHE FlushDataCache;
+ EFI_CPU_ENABLE_INTERRUPT EnableInterrupt;
+ EFI_CPU_DISABLE_INTERRUPT DisableInterrupt;
+ EFI_CPU_GET_INTERRUPT_STATE GetInterruptState;
+ EFI_CPU_INIT Init;
+ EFI_CPU_REGISTER_INTERRUPT_HANDLER RegisterInterruptHandler;
+ EFI_CPU_GET_TIMER_VALUE GetTimerValue;
+ EFI_CPU_SET_MEMORY_ATTRIBUTES SetMemoryAttributes;
+ UINT32 NumberOfTimers;
+ UINT32 DmaBufferAlignment;
+} EFI_CPU_ARCH_PROTOCOL;
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#endif // #ifndef GUID_VARIABLE_DEFINITION
+#ifdef __cplusplus
+}
+#endif
+#endif
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2005, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
diff --git a/Include/Protocol/Capsule.h b/Include/Protocol/Capsule.h
new file mode 100644
index 0000000..80aab12
--- /dev/null
+++ b/Include/Protocol/Capsule.h
@@ -0,0 +1,66 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2006, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/BIN/Core/CORE_DXE/ArchProtocol/Capsule.h 1 10/07/06 10:17a Felixp $
+//
+// $Revision: 1 $
+//
+// $Date: 10/07/06 10:17a $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Core/CORE_DXE/ArchProtocol/Capsule.h $
+//
+// 1 10/07/06 10:17a Felixp
+//
+//**********************************************************************
+//<AMI_FHDR_START>
+//
+// Name: Capsule.h
+//
+// Description: Defines Capsule Architectural Protocol
+//
+//<AMI_FHDR_END>
+//**********************************************************************
+#ifndef __CAPSULE_ARCH_PROTOCOL_H__
+#define __CAPSULE_ARCH_PROTOCOL_H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+#include <EFI.h>
+
+#define EFI_CAPSULE_ARCH_PROTOCOL_GUID \
+ { 0x5053697e, 0x2cbc, 0x4819, 0x90, 0xd9, 0x5, 0x80, 0xde, 0xee, 0x57, 0x54 }
+
+GUID_VARIABLE_DECLARATION(gEfiCapsuleArchProtocolGuid, EFI_CAPSULE_ARCH_PROTOCOL_GUID);
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2006, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//********************************************************************** \ No newline at end of file
diff --git a/Include/Protocol/ComponentName.h b/Include/Protocol/ComponentName.h
new file mode 100644
index 0000000..26d6d85
--- /dev/null
+++ b/Include/Protocol/ComponentName.h
@@ -0,0 +1,117 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/BIN/Core/Include/Protocol/ComponentName.h 6 6/16/11 3:22p Felixp $
+//
+// $Revision: 6 $
+//
+// $Date: 6/16/11 3:22p $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Core/Include/Protocol/ComponentName.h $
+//
+// 6 6/16/11 3:22p Felixp
+// Surround backward compatibility definitions with #if
+// BACKWARD_COMPATIBLE_MODE
+//
+// 5 5/27/11 5:53p Felixp
+// Headers are updated to improve separation of the Framework and PI
+// interfaces.
+// The definitions that will be removed in the future versions are marked
+// with the comments.
+//
+// 4 8/21/09 3:05p Felixp
+// Definition of the ComponentName2 protocol is added.
+//
+// 1 9/20/04 1:24p Olegi
+//
+//**********************************************************************
+//<AMI_FHDR_START>
+//
+// Name: ComponentName.h
+//
+// Description: Component Name protocol definition
+//
+//<AMI_FHDR_END>
+//**********************************************************************
+#ifndef __COMPONENT_NAME_PROTOCOL__H__
+#define __COMPONENT_NAME_PROTOCOL__H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+#include <EFI.h>
+
+//*********************** Component Name Protocol ******************/
+#define EFI_COMPONENT_NAME_PROTOCOL_GUID \
+ {0x107a772c,0xd5e1,0x11d4,0x9a,0x46,0x0,0x90,0x27,0x3f,0xc1,0x4d}
+
+GUID_VARIABLE_DECLARATION(gEfiComponentNameProtocolGuid, EFI_COMPONENT_NAME_PROTOCOL_GUID);
+
+// Forward declaration
+typedef struct _EFI_COMPONENT_NAME_PROTOCOL EFI_COMPONENT_NAME_PROTOCOL;
+
+typedef EFI_STATUS (EFIAPI *EFI_COMPONENT_NAME_GET_DRIVER_NAME) (
+ IN EFI_COMPONENT_NAME_PROTOCOL *This,
+ IN CHAR8 *Language,
+ OUT CHAR16 **DriverName
+);
+
+typedef EFI_STATUS (EFIAPI *EFI_COMPONENT_NAME_GET_CONTROLLER_NAME) (
+ EFI_COMPONENT_NAME_PROTOCOL *This,
+ EFI_HANDLE ControllerHandle,
+ EFI_HANDLE ChildHandle OPTIONAL,
+ CHAR8 *Language,
+ CHAR16 **ControllerName
+);
+
+struct _EFI_COMPONENT_NAME_PROTOCOL {
+ EFI_COMPONENT_NAME_GET_DRIVER_NAME GetDriverName;
+ EFI_COMPONENT_NAME_GET_CONTROLLER_NAME GetControllerName;
+ CHAR8 *SupportedLanguages;
+};
+
+#if BACKWARD_COMPATIBLE_MODE
+#include <Protocol/ComponentName2.h>
+#else
+#ifndef EFI_COMPONENT_NAME2_PROTOCOL_GUID
+#if EFI_SPECIFICATION_VERSION<=0x20000
+#define EFI_COMPONENT_NAME2_PROTOCOL_GUID \
+ {0x107a772c,0xd5e1,0x11d4,0x9a,0x46,0x0,0x90,0x27,0x3f,0xc1,0x4d}
+#else //if EFI_SPECIFICATION_VERSION
+#define EFI_COMPONENT_NAME2_PROTOCOL_GUID \
+ { 0x6a7a5cff, 0xe8d9, 0x4f70, 0xba, 0xda, 0x75, 0xab, 0x30, 0x25, 0xce, 0x14 }
+#endif //if EFI_SPECIFICATION_VERSION
+#endif // EFI_COMPONENT_NAME2_PROTOCOL_GUID
+#endif //if BACKWARD_COMPATIBLE_MODE
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//********************************************************************** \ No newline at end of file
diff --git a/Include/Protocol/ComponentName2.h b/Include/Protocol/ComponentName2.h
new file mode 100644
index 0000000..fa9be3f
--- /dev/null
+++ b/Include/Protocol/ComponentName2.h
@@ -0,0 +1,94 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/BIN/Core/Include/Protocol/ComponentName2.h 1 5/27/11 5:52p Felixp $
+//
+// $Revision: 1 $
+//
+// $Date: 5/27/11 5:52p $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Core/Include/Protocol/ComponentName2.h $
+//
+// 1 5/27/11 5:52p Felixp
+//
+//**********************************************************************
+//<AMI_FHDR_START>
+//
+// Name: ComponentName2.h
+//
+// Description: Component Name 2 Protocol definition
+//
+//<AMI_FHDR_END>
+//**********************************************************************
+#ifndef __COMPONENT_NAME2_PROTOCOL__H__
+#define __COMPONENT_NAME2_PROTOCOL__H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+#include <EFI.h>
+
+#ifndef EFI_COMPONENT_NAME2_PROTOCOL_GUID
+#if EFI_SPECIFICATION_VERSION<=0x20000
+#define EFI_COMPONENT_NAME2_PROTOCOL_GUID \
+ {0x107a772c,0xd5e1,0x11d4,0x9a,0x46,0x0,0x90,0x27,0x3f,0xc1,0x4d}
+#else //if EFI_SPECIFICATION_VERSION
+#define EFI_COMPONENT_NAME2_PROTOCOL_GUID \
+ { 0x6a7a5cff, 0xe8d9, 0x4f70, 0xba, 0xda, 0x75, 0xab, 0x30, 0x25, 0xce, 0x14 }
+#endif //if EFI_SPECIFICATION_VERSION
+#endif // EFI_COMPONENT_NAME2_PROTOCOL_GUID
+
+GUID_VARIABLE_DECLARATION(gEfiComponentName2ProtocolGuid, EFI_COMPONENT_NAME2_PROTOCOL_GUID);
+
+typedef struct _EFI_COMPONENT_NAME2_PROTOCOL EFI_COMPONENT_NAME2_PROTOCOL;
+
+typedef EFI_STATUS (EFIAPI *EFI_COMPONENT_NAME2_GET_DRIVER_NAME) (
+ IN EFI_COMPONENT_NAME2_PROTOCOL *This,
+ IN CHAR8 *Language,
+ OUT CHAR16 **DriverName
+);
+
+typedef EFI_STATUS (EFIAPI *EFI_COMPONENT_NAME2_GET_CONTROLLER_NAME) (
+ IN EFI_COMPONENT_NAME2_PROTOCOL *This,
+ IN EFI_HANDLE ControllerHandle,
+ IN EFI_HANDLE ChildHandle OPTIONAL,
+ IN CHAR8 *Language,
+ OUT CHAR16 **ControllerName
+);
+
+struct _EFI_COMPONENT_NAME2_PROTOCOL {
+ EFI_COMPONENT_NAME2_GET_DRIVER_NAME GetDriverName;
+ EFI_COMPONENT_NAME2_GET_CONTROLLER_NAME GetControllerName;
+ CHAR8 *SupportedLanguages;
+};
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//********************************************************************** \ No newline at end of file
diff --git a/Include/Protocol/ConsoleControl.h b/Include/Protocol/ConsoleControl.h
new file mode 100644
index 0000000..b095b2c
--- /dev/null
+++ b/Include/Protocol/ConsoleControl.h
@@ -0,0 +1,120 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2005, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/BIN/Core/Include/Protocol/ConsoleControl.h 7 12/29/06 2:57p Felixp $
+//
+// $Revision: 7 $
+//
+// $Date: 12/29/06 2:57p $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Core/Include/Protocol/ConsoleControl.h $
+//
+// 7 12/29/06 2:57p Felixp
+//
+// 6 3/13/06 1:40a Felixp
+//
+// 5 8/23/05 11:43a Felixp
+//
+// 4 7/15/05 7:16p Felixp
+// CONSOLE_DEVICES_STARTED_PROTOCOL_GUID added.
+// BDS uses it to notify Splitter that Console Devices have been started.
+// Once Splitter receives notification, it will install ConIn and ConOut
+// in System Table
+//
+// 3 5/27/05 12:19a Felixp
+//
+// 2 5/27/05 12:00a Felixp
+//
+// 1 5/26/05 11:59p Felixp
+//
+//**********************************************************************
+//<AMI_FHDR_START>
+//
+// Name: ConsoleControl.h
+//
+// Description:
+//
+//<AMI_FHDR_END>
+//**********************************************************************
+#ifndef __CONSOLE_CONTROL_PROTOCOL_H__
+#define __CONSOLE_CONTROL_PROTOCOL_H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+#include <EFI.h>
+
+#define EFI_CONSOLE_CONTROL_PROTOCOL_GUID \
+ { 0xf42f7782, 0x12e, 0x4c12, 0x99, 0x56, 0x49, 0xf9, 0x43, 0x4, 0xf7, 0x21 }
+
+GUID_VARIABLE_DECLARATION(gEfiConsoleControlProtocolGuid,EFI_CONSOLE_CONTROL_PROTOCOL_GUID);
+
+// {EF9A3971-C1A0-4a93-BD40-5AA165F2DC3A}
+#define CONSOLE_OUT_DEVICES_STARTED_PROTOCOL_GUID \
+ { 0xef9a3971, 0xc1a0, 0x4a93, 0xbd, 0x40, 0x5a, 0xa1, 0x65, 0xf2, 0xdc, 0x3a }
+
+// {2DF1E051-906D-4eff-869D-24E65378FB9E}
+#define CONSOLE_IN_DEVICES_STARTED_PROTOCOL_GUID \
+ { 0x2df1e051, 0x906d, 0x4eff, 0x86, 0x9d, 0x24, 0xe6, 0x53, 0x78, 0xfb, 0x9e }
+
+typedef struct _EFI_CONSOLE_CONTROL_PROTOCOL EFI_CONSOLE_CONTROL_PROTOCOL;
+
+typedef enum {
+ EfiConsoleControlScreenText,
+ EfiConsoleControlScreenGraphics,
+ EfiConsoleControlScreenMaxValue
+} EFI_CONSOLE_CONTROL_SCREEN_MODE;
+
+typedef EFI_STATUS (EFIAPI *EFI_CONSOLE_CONTROL_PROTOCOL_GET_MODE)(
+ IN EFI_CONSOLE_CONTROL_PROTOCOL *This,
+ OUT EFI_CONSOLE_CONTROL_SCREEN_MODE *Mode,
+ OUT BOOLEAN *UgaExists OPTIONAL,
+ OUT BOOLEAN *StdInLocked OPTIONAL
+);
+
+typedef EFI_STATUS (EFIAPI *EFI_CONSOLE_CONTROL_PROTOCOL_SET_MODE)(
+ IN EFI_CONSOLE_CONTROL_PROTOCOL *This,
+ OUT EFI_CONSOLE_CONTROL_SCREEN_MODE Mode
+);
+
+typedef EFI_STATUS (EFIAPI *EFI_CONSOLE_CONTROL_PROTOCOL_LOCK_STD_IN)(
+ IN EFI_CONSOLE_CONTROL_PROTOCOL *This, IN CHAR16 *Password
+);
+
+struct _EFI_CONSOLE_CONTROL_PROTOCOL {
+ EFI_CONSOLE_CONTROL_PROTOCOL_GET_MODE GetMode;
+ EFI_CONSOLE_CONTROL_PROTOCOL_SET_MODE SetMode;
+ EFI_CONSOLE_CONTROL_PROTOCOL_LOCK_STD_IN LockStdIn;
+};
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2005, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
diff --git a/Include/Protocol/CpuIo.h b/Include/Protocol/CpuIo.h
new file mode 100644
index 0000000..44372d2
--- /dev/null
+++ b/Include/Protocol/CpuIo.h
@@ -0,0 +1,87 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2005, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/BIN/Core/Include/Protocol/CpuIo.h 3 4/15/11 2:37p Artems $
+//
+// $Revision: 3 $
+//
+// $Date: 4/15/11 2:37p $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Core/Include/Protocol/CpuIo.h $
+//
+// 3 4/15/11 2:37p Artems
+// EIP 56523: Added support for PI specification v 1.2
+//
+// 2 3/13/06 1:40a Felixp
+//
+// 1 6/01/05 4:58p Markw
+//
+//**********************************************************************
+// $Header: /Alaska/BIN/Core/Include/Protocol/CpuIo.h 3 4/15/11 2:37p Artems $Revision: $
+//
+// $Date: 4/15/11 2:37p $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log:
+//
+//**********************************************************************
+
+//**********************************************************************
+//<AMI_FHDR_START>
+//
+// Name: CpuIo.h
+//
+// Description:
+//
+//<AMI_FHDR_END>
+//**********************************************************************
+#ifndef __EFI_CPU_IO_PROTOCOL_H__
+#define __EFI_CPU_IO_PROTOCOL_H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <EFI.h>
+#include <Protocol/CpuIo2.h>
+
+#define EFI_CPU_IO_PROTOCOL_GUID \
+ { 0xB0732526, 0x38C8, 0x4b40, 0x88, 0x77, 0x61, 0xC7, 0xB0, 0x6A, 0xAC, 0x45 }
+
+GUID_VARIABLE_DECLARATION(gEfiCpuIoProtocolGuid, EFI_CPU_IO_PROTOCOL_GUID);
+
+typedef EFI_CPU_IO2_PROTOCOL EFI_CPU_IO_PROTOCOL;
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2005, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
diff --git a/Include/Protocol/CpuIo2.h b/Include/Protocol/CpuIo2.h
new file mode 100644
index 0000000..e328ea2
--- /dev/null
+++ b/Include/Protocol/CpuIo2.h
@@ -0,0 +1,124 @@
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/BIN/Core/Include/Protocol/CpuIo2.h 2 5/27/11 5:53p Felixp $
+//
+// $Revision: 2 $
+//
+// $Date: 5/27/11 5:53p $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Core/Include/Protocol/CpuIo2.h $
+//
+// 2 5/27/11 5:53p Felixp
+// Headers are updated to improve separation of the Framework and PI
+// interfaces.
+// The definitions that will be removed in the future versions are marked
+// with the comments.
+//
+// 1 4/15/11 2:38p Artems
+// EIP 56523: Added protocol definition as per PI spec v 1.2
+//
+//
+//**********************************************************************
+//<AMI_FHDR_START>
+//
+// Name: CpuIo2.h
+//
+// Description: EFI_CPU_IO2_PROTOCOL definition file
+//
+//<AMI_FHDR_END>
+//**********************************************************************
+#ifndef __EFI_CPU_IO2_PROTOCOL_H__
+#define __EFI_CPU_IO2_PROTOCOL_H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <EFI.h>
+
+#if PI_SPECIFICATION_VERSION < 0x10014
+#define EFI_CPU_IO2_PROTOCOL_GUID \
+ { 0xB0732526, 0x38C8, 0x4b40, 0x88, 0x77, 0x61, 0xC7, 0xB0, 0x6A, 0xAC, 0x45 }
+#else
+#define EFI_CPU_IO2_PROTOCOL_GUID \
+ { 0xad61f191, 0xae5f, 0x4c0e, 0xb9, 0xfa, 0xe8, 0x69, 0xd2, 0x88, 0xc6, 0x4f }
+#endif
+
+GUID_VARIABLE_DECLARATION(gEfiCpuIo2ProtocolGuid, EFI_CPU_IO2_PROTOCOL_GUID);
+
+
+//*******************************************************
+// EFI_CPU_IO_PROTOCOL_WIDTH
+//*******************************************************
+typedef enum {
+ EfiCpuIoWidthUint8,
+ EfiCpuIoWidthUint16,
+ EfiCpuIoWidthUint32,
+ EfiCpuIoWidthUint64,
+ EfiCpuIoWidthFifoUint8,
+ EfiCpuIoWidthFifoUint16,
+ EfiCpuIoWidthFifoUint32,
+ EfiCpuIoWidthFifoUint64,
+ EfiCpuIoWidthFillUint8,
+ EfiCpuIoWidthFillUint16,
+ EfiCpuIoWidthFillUint32,
+ EfiCpuIoWidthFillUint64,
+ EfiCpuIoWidthMaximum
+} EFI_CPU_IO_PROTOCOL_WIDTH;
+
+typedef struct _EFI_CPU_IO2_PROTOCOL EFI_CPU_IO2_PROTOCOL;
+
+typedef EFI_STATUS
+(EFIAPI *EFI_CPU_IO_PROTOCOL_IO_MEM) (
+ IN EFI_CPU_IO2_PROTOCOL *This,
+ IN EFI_CPU_IO_PROTOCOL_WIDTH Width,
+ IN UINT64 Address,
+ IN UINTN Count,
+ IN OUT VOID *Buffer
+);
+
+typedef struct {
+ EFI_CPU_IO_PROTOCOL_IO_MEM Read;
+ EFI_CPU_IO_PROTOCOL_IO_MEM Write;
+} EFI_CPU_IO_PROTOCOL_ACCESS;
+
+
+struct _EFI_CPU_IO2_PROTOCOL {
+ EFI_CPU_IO_PROTOCOL_ACCESS Mem;
+ EFI_CPU_IO_PROTOCOL_ACCESS Io;
+};
+
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
diff --git a/Include/Protocol/CpuProtocols.cif b/Include/Protocol/CpuProtocols.cif
new file mode 100644
index 0000000..9ae76a7
--- /dev/null
+++ b/Include/Protocol/CpuProtocols.cif
@@ -0,0 +1,10 @@
+<component>
+ name = "CpuProtocols"
+ category = ModulePart
+ LocalRoot = "Include\Protocol\"
+ RefName = "CpuProtocols"
+[files]
+"AmiCpuInfo.h"
+"AmiCpuInfo2.h"
+"MpService\MpService.h"
+<endComponent>
diff --git a/Include/Protocol/CsmPlatform.h b/Include/Protocol/CsmPlatform.h
new file mode 100644
index 0000000..9b487a5
--- /dev/null
+++ b/Include/Protocol/CsmPlatform.h
@@ -0,0 +1,161 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2010, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Pkwy, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/SOURCE/Modules/CSM/Generic/Protocol/CsmPlatform.h 13 1/27/14 12:59p Olegi $
+//
+// $Revision: 13 $
+//
+// $Date: 1/27/14 12:59p $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/SOURCE/Modules/CSM/Generic/Protocol/CsmPlatform.h $
+//
+// 13 1/27/14 12:59p Olegi
+// EIP151588: added Rom field to CSM_PLATFORM_POLICY_DATA
+//
+// 12 11/14/11 12:05p Olegi
+//
+// 11 11/10/11 7:31p Olegi
+// Added thunk GUID protocol definition.
+//
+// 10 10/03/11 3:19p Olegi
+// [TAG] EIP71591
+// [Category] Improvement
+// [Description] CSM opt-out changes
+//
+// 9 8/19/11 4:30p Olegi
+// [TAG] EIP65477
+// [Category] Improvement
+// [Description] CSM Opt-out mechanism
+// [Files] csmplatform.h, csm.dxs
+//
+// 8 3/01/10 3:57p Olegi
+// Changed the prototypes of Pre/PostOptionRom functions; requires the
+// update of AMI Board component. EIP34085.
+//
+// 7 1/12/10 11:51a Olegi
+// Copyright message updated.
+//
+// 6 6/18/09 10:06a Olegi
+// Added definition of CSM OpROM policy related data.
+//
+// 5 4/27/07 5:17p Olegi
+// CSM.CHM file preparation.
+//
+// 4 4/13/07 9:51a Olegi
+//
+//**********************************************************************
+//<AMI_FHDR_START>
+//
+// Name: CsmPlatform.h
+//
+// Description: CsmPlatform protocol declaration
+//
+//<AMI_FHDR_END>
+//**********************************************************************
+
+#ifndef __CSM_PLATFORM_PROTOCOL_H__
+#define __CSM_PLATFORM_PROTOCOL_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <EFI.h>
+
+// {91FA9DFD-DBD4-44ae-97A4-BD1837D5B462}
+#define CSM_PLATFORM_PROTOCOL_GUID \
+ {0x91fa9dfd,0xdbd4,0x44ae,0x97,0xa4,0xbd,0x18,0x37,0xd5,0xb4,0x62}
+
+GUID_VARIABLE_DECLARATION(gCsmPlatformProtocolGuid,CSM_PLATFORM_PROTOCOL_GUID);
+
+#ifndef GUID_VARIABLE_DEFINITION
+#include <Protocol/PciIo.h>
+#include <Protocol/LegacyBios.h>
+
+typedef struct _CSM_PLATFORM_PROTOCOL CSM_PLATFORM_PROTOCOL;
+
+typedef EFI_STATUS (EFIAPI *CSM_PLATFORM_PROTOCOL_PRE_PROCESS_OPROM) (
+ IN CSM_PLATFORM_PROTOCOL *This,
+ IN EFI_PCI_IO_PROTOCOL *PciIo,
+ IN VOID **RomImage
+);
+
+typedef EFI_STATUS (EFIAPI *CSM_PLATFORM_PROTOCOL_POST_PROCESS_OPROM) (
+ IN CSM_PLATFORM_PROTOCOL *This,
+ IN EFI_PCI_IO_PROTOCOL *PciIo,
+ IN VOID **RomImage
+);
+
+typedef EFI_STATUS (EFIAPI *CSM_PLATFORM_PROTOCOL_GET_ATAPI_DEVICE_TYPE) (
+ IN CSM_PLATFORM_PROTOCOL *This,
+ IN struct _ATAPI_IDENTIFY *IdentifyDriveData,
+ OUT UINT16 *DevType
+);
+
+typedef struct _CSM_PLATFORM_PROTOCOL {
+ CSM_PLATFORM_PROTOCOL_PRE_PROCESS_OPROM PreProcessOpRom;
+ CSM_PLATFORM_PROTOCOL_POST_PROCESS_OPROM PostProcessOpRom;
+ CSM_PLATFORM_PROTOCOL_GET_ATAPI_DEVICE_TYPE GetAtapiDeviceType;
+} CSM_PLATFORM_PROTOCOL;
+
+#define CSM_OPRROM_POLICY_GUID \
+ {0xf2a128ff,0x257b,0x456e,0x9d,0xe8,0x63,0xe7,0xc7,0xdc,0xdf,0xac}
+
+typedef struct _CSM_PLATFORM_POLICY_DATA {
+ EFI_PCI_IO_PROTOCOL *PciIo;
+ BOOLEAN ExecuteThisRom;
+ VOID **Rom;
+} CSM_PLATFORM_POLICY_DATA;
+
+// The following GUID is used in DXS; it can be installed by the driver that
+// has minimum or no dependencies so that it is launched earlier than CSM.
+//
+#ifndef AMI_LOAD_CSM_GUID
+#define AMI_LOAD_CSM_GUID \
+ { 0x16287ba4, 0x5b9d, 0x4d98, 0x91, 0x9f, 0x7b, 0x7b, 0x78, 0xcb, 0x2b, 0xe0 }
+#endif
+
+#ifndef AMI_CSM_DRIVER_STARTED_GUID
+#define AMI_CSM_DRIVER_STARTED_GUID \
+ { 0x3EA824D1, 0x81E3, 0x4FF5, 0xBD, 0x43, 0xBB, 0x9C, 0x65, 0xDF, 0x7C, 0x46}
+#endif
+
+#ifndef AMI_CSM_THUNK_PROTOCOL_GUID
+#define AMI_CSM_THUNK_PROTOCOL_GUID \
+ { 0x2362ea9c, 0x84e5, 0x4dff, 0x83, 0xbc, 0xb5, 0xac, 0xec, 0xb5, 0x7c, 0xbb }
+#endif
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#endif // #ifndef GUID_VARIABLE_DEFINITION
+#ifdef __cplusplus
+}
+#endif
+#endif
+
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2010, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Pkwy, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
diff --git a/Include/Protocol/CsmVideoPolicy.h b/Include/Protocol/CsmVideoPolicy.h
new file mode 100644
index 0000000..fe24c5d
--- /dev/null
+++ b/Include/Protocol/CsmVideoPolicy.h
@@ -0,0 +1,84 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2010, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/SOURCE/Modules/CSM/Generic/Protocol/CsmVideoPolicy.h 1 4/26/10 11:08a Felixp $
+//
+// $Revision: 1 $
+//
+// $Date: 4/26/10 11:08a $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/SOURCE/Modules/CSM/Generic/Protocol/CsmVideoPolicy.h $
+//
+// 1 4/26/10 11:08a Felixp
+//
+// 6 1/13/10 2:13p Felixp
+//
+//**********************************************************************
+//<AMI_FHDR_START>
+//
+// Name: CsmVideoPolicy.h
+//
+// Description: CSM Video Policy Protocol Declaration
+//
+//<AMI_FHDR_END>
+//**********************************************************************
+#ifndef __CSM_VIDEO_POLICY_PROTOCOL__H__
+#define __CSM_VIDEO_POLICY_PROTOCOL__H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+#include <Efi.h>
+
+// {3A4E4376-4871-4b0e-A02F-ED36F2AECD00}
+#define CSM_VIDEO_POLICY_PROTOCOL_GUID\
+ { 0x3a4e4376, 0x4871, 0x4b0e, 0xa0, 0x2f, 0xed, 0x36, 0xf2, 0xae, 0xcd, 0x0 }
+
+GUID_VARIABLE_DECLARATION(gCsmVideoPolicyProtocolGuid, CSM_VIDEO_POLICY_PROTOCOL_GUID);
+
+typedef struct _CSM_VIDEO_POLICY_PROTOCOL CSM_VIDEO_POLICY_PROTOCOL;
+
+typedef EFI_STATUS (EFIAPI *CSM_VIDEO_POLICY_GET_MODE)(
+ IN CSM_VIDEO_POLICY_PROTOCOL *This, IN BOOLEAN *IsTextMode
+);
+
+typedef EFI_STATUS (EFIAPI *CSM_VIDEO_POLICY_SET_MODE)(
+ IN CSM_VIDEO_POLICY_PROTOCOL *This,
+ IN BOOLEAN TextMode, IN BOOLEAN ForceModeChange
+);
+
+struct _CSM_VIDEO_POLICY_PROTOCOL{
+ CSM_VIDEO_POLICY_GET_MODE GetMode;
+ CSM_VIDEO_POLICY_SET_MODE SetMode;
+};
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2010, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
diff --git a/Include/Protocol/CspLibProtocols.CIF b/Include/Protocol/CspLibProtocols.CIF
new file mode 100644
index 0000000..1f09ca9
--- /dev/null
+++ b/Include/Protocol/CspLibProtocols.CIF
@@ -0,0 +1,8 @@
+<component>
+ name = "CSP Library Protocols"
+ category = ModulePart
+ LocalRoot = "Include\Protocol\"
+ RefName = "CSP Library Protocols"
+[files]
+"\CspLibProtocols.h"
+<endComponent>
diff --git a/Include/Protocol/CspLibProtocols.h b/Include/Protocol/CspLibProtocols.h
new file mode 100644
index 0000000..0c486a8
--- /dev/null
+++ b/Include/Protocol/CspLibProtocols.h
@@ -0,0 +1,75 @@
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2008, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/BIN/Chipset/Template/CSPLibrary/CspLibProtocols.h 3 2/22/11 4:33p Artems $
+//
+// $Revision: 3 $
+//
+// $Date: 2/22/11 4:33p $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Chipset/Template/CSPLibrary/CspLibProtocols.h $
+//
+// 3 2/22/11 4:33p Artems
+// EIP 51548 - Added AMI copyright headers, replaced TABs with spaces
+//
+// 2 6/11/09 5:58p Robert
+// CHM and coding standard updates
+//
+// 1 1/21/05 12:46p Sivagarn
+// Initial Checkin - Version 0.05
+//
+//
+//**********************************************************************
+//<AMI_FHDR_START>
+//----------------------------------------------------------------------------
+//
+// Name: CspLibProtocols.h
+//
+// Description:
+// This file contains Protocol definitions that are defined in the CSP Library
+//
+//
+//----------------------------------------------------------------------------
+//<AMI_FHDR_END>
+
+#ifndef _CSP_LIBRARY_PROTOCOLS_
+#define _CSP_LIBRARY_PROTOCOLS_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2008, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
diff --git a/Include/Protocol/DataHub.h b/Include/Protocol/DataHub.h
new file mode 100644
index 0000000..02a9436
--- /dev/null
+++ b/Include/Protocol/DataHub.h
@@ -0,0 +1,144 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2005, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+//**********************************************************************
+// $Header: /Alaska/BIN/Core/Include/Protocol/DataHub.h 2 3/13/06 1:40a Felixp $
+//
+// $Revision: 2 $
+//
+// $Date: 3/13/06 1:40a $
+//*****************************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Core/Include/Protocol/DataHub.h $
+//
+// 2 3/13/06 1:40a Felixp
+//
+// 1 1/28/05 12:44p Felixp
+//
+// 2 1/18/05 3:21p Felixp
+// PrintDebugMessage renamed to Trace
+//
+// 1 12/23/04 9:41a Felixp
+//
+// 1 3/12/04 5:30p Markw
+//
+//*****************************************************************************
+//<AMI_FHDR_START>
+//
+// Name: DataHub_h
+//
+// Description:
+//
+//<AMI_FHDR_END>
+//*****************************************************************************
+#ifndef _DATA_HUB_PROTOCOL_H_
+#define _DATA_HUB_PROTOCOL_H_
+#ifdef __cplusplus
+extern "C" {
+#endif
+#include <EFI.h>
+
+#define EFI_DATA_HUB_PROTOCOL_GUID \
+ {0xae80d021,0x618e,0x11d4,0xbc,0xd7,0x0,0x80,0xc7,0x3c,0x88,0x81}
+
+GUID_VARIABLE_DECLARATION(gEfiDataHubProtocolGuid,EFI_DATA_HUB_PROTOCOL_GUID);
+
+typedef struct _EFI_DATA_HUB_PROTOCOL EFI_DATA_HUB_PROTOCOL;
+
+typedef struct {
+ UINT16 Version;
+ UINT16 HeaderSize;
+ UINT32 RecordSize;
+ EFI_GUID DataRecordGuid;
+ EFI_GUID ProducerName;
+ UINT64 DataRecordClass;
+ EFI_TIME LogTime;
+ UINT64 LogMonotonicCount;
+} EFI_DATA_RECORD_HEADER;
+
+
+//************************************************************
+// Version value
+//************************************************************
+#define EFI_DATA_RECORD_HEADER_VERSION 0x0100
+
+//************************************************************
+// DataRecordClass values
+//************************************************************
+//
+// Definition of DataRecordClass. These are used to filter
+// out data types at a very high level. The
+// DataRecord. DataRecordGuid still defines the format
+// of the data.
+//
+#define EFI_DATA_CLASS_DEBUG 0x0000000000000001
+#define EFI_DATA_CLASS_ERROR 0x0000000000000002
+#define EFI_DATA_CLASS_DATA 0x0000000000000004
+#define EFI_DATA_CLASS_PROGRESS_CODE 0x0000000000000008
+
+typedef EFI_STATUS (EFIAPI *EFI_DATA_HUB_LOG_DATA) (
+ IN EFI_DATA_HUB_PROTOCOL *This,
+ IN EFI_GUID *DataRecordGuid,
+ IN EFI_GUID *ProducerName,
+ IN UINT64 DataRecordClass,
+ IN VOID *RawData,
+ IN UINT32 RawDataSize
+);
+
+typedef EFI_STATUS (EFIAPI *EFI_DATA_HUB_GET_NEXT_DATA_RECORD) (
+ IN EFI_DATA_HUB_PROTOCOL *This,
+ IN OUT UINT64 *MonotonicCount,
+ IN EFI_EVENT *FilterDriver OPTIONAL,
+ OUT EFI_DATA_RECORD_HEADER **Record
+);
+
+typedef EFI_STATUS (EFIAPI *EFI_DATA_HUB_REGISTER_DATA_FILTER_DRIVER) (
+ IN EFI_DATA_HUB_PROTOCOL *This,
+ IN EFI_EVENT FilterEvent,
+ IN EFI_TPL FilterTpl,
+ IN UINT64 FilterClass,
+ IN EFI_GUID *FilterDataRecordGuid OPTIONAL
+);
+
+typedef EFI_STATUS (EFIAPI *EFI_DATA_HUB_UNREGISTER_DATA_FILTER_DRIVER) (
+ IN EFI_DATA_HUB_PROTOCOL *This,
+ IN EFI_EVENT FilterEvent
+);
+
+struct _EFI_DATA_HUB_PROTOCOL {
+ EFI_DATA_HUB_LOG_DATA LogData;
+ EFI_DATA_HUB_GET_NEXT_DATA_RECORD GetNextDataRecord;
+ EFI_DATA_HUB_REGISTER_DATA_FILTER_DRIVER RegisterFilterDriver;
+ EFI_DATA_HUB_UNREGISTER_DATA_FILTER_DRIVER UnregisterFilterDriver;
+};
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2005, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
diff --git a/Include/Protocol/DebugSupport.h b/Include/Protocol/DebugSupport.h
new file mode 100644
index 0000000..39d2b23
--- /dev/null
+++ b/Include/Protocol/DebugSupport.h
@@ -0,0 +1,495 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2006, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/BIN/Core/Include/Protocol/DebugSupport.h 4 5/13/11 6:35p Oleksiyy $
+//
+// $Revision: 4 $
+//
+// $Date: 5/13/11 6:35p $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Core/Include/Protocol/DebugSupport.h $
+//
+// 4 5/13/11 6:35p Oleksiyy
+// [TAG] EIP56645
+// [Category] Improvement
+// [Description] Status Code PI 1.2 Specification Update
+// [Files] DebugSupport.h, StatusCodeDataTypeId.h and StatusCodes.h
+//
+// 3 12/27/06 7:34a Felixp
+// Updated to be complient with UEFI 2.0 Specification.
+//
+// 2 3/13/06 1:40a Felixp
+//
+// 1 1/28/05 12:44p Felixp
+//
+// 2 1/18/05 3:21p Felixp
+// PrintDebugMessage renamed to Trace
+//
+// 1 12/23/04 9:41a Felixp
+//
+// 2 3/21/04 1:42p Felixp
+//
+// 1 1/02/04 3:00p Markw
+//
+//**********************************************************************
+//<AMI_FHDR_START>
+//
+// Name: DebugSupport.h
+//
+// Description: DebugSupport protocol is for providing functions to
+// support source level debugging. Some of these difinitions
+// are used by other protocols, such as the EFI_CPU_ARCH_PROTOCOL.
+//
+//<AMI_FHDR_END>
+//**********************************************************************
+#ifndef __EFI_DEBUG_SUPPORT_PROTOCOL__H__
+#define __EFI_DEBUG_SUPPORT_PROTOCOL__H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+#include <EFI.h>
+
+#define EFI_DEBUG_SUPPORT_PROTOCOL_GUID \
+ {0x2755590C,0x6F3C,0x42FA,0x9E,0xA4,0xA3,0xBA,0x54,0x3C,0xDA,0x25}
+
+GUID_VARIABLE_DECLARATION(gEfiDebugSupportProtocolGuid,EFI_DEBUG_SUPPORT_PROTOCOL_GUID);
+
+typedef struct _EFI_DEBUG_SUPPORT_PROTOCOL EFI_DEBUG_SUPPORT_PROTOCOL;
+
+//At the time of publication of this specification, the latest revision of the PE/COFF specification
+//was 6.2. The definition of IMAGE_FILE_MACHINE_EBC is not included in revision 6.2 of the
+//PE/COFF specification. It will be added in a future revision of the PE/COFF specification
+
+#define IMAGE_FILE_MACHINE_I386 0x014C
+#define IMAGE_FILE_MACHINE_IA64 0x0200
+#define IMAGE_FILE_MACHINE_EBC 0x0EBC
+#define EFI_IMAGE_MACHINE_X64 0x8664
+
+ typedef enum {
+ IsaIa32 = IMAGE_FILE_MACHINE_I386, // 0x014C
+ IsaIpf = IMAGE_FILE_MACHINE_IA64, // 0x0200
+ IsaEbc = IMAGE_FILE_MACHINE_EBC, // 0x0EBC
+ IsaX64 = EFI_IMAGE_MACHINE_X64 // 0x8664
+ } EFI_INSTRUCTION_SET_ARCHITECTURE;
+
+typedef EFI_STATUS (EFIAPI *EFI_GET_MAXIMUM_PROCESSOR_INDEX) (
+ IN EFI_DEBUG_SUPPORT_PROTOCOL *This,
+ OUT UINTN *MaxProcessorIndex);
+
+
+
+ // System context for virtual EBC processors
+ typedef struct {
+ UINT64 R0, R1, R2, R3, R4, R5, R6, R7;
+ UINT64 Flags;
+ UINT64 ControlFlags;
+ UINT64 Ip;
+ } EFI_SYSTEM_CONTEXT_EBC;
+
+
+ // FXSAVE_STATE - FP / MMX / XMM registers
+ typedef struct {
+ UINT16 Fcw;
+ UINT16 Fsw;
+ UINT16 Ftw;
+ UINT16 Opcode;
+ UINT32 Eip;
+ UINT16 Cs;
+ UINT16 Reserved1;
+ UINT32 DataOffset;
+ UINT16 Ds;
+ UINT8 Reserved2[10];
+#if (EFI_SPECIFICATION_VERSION >= 0x00020000)
+ UINT8 St0Mm0[10], Reserved3[6];
+ UINT8 St1Mm1[10], Reserved4[6];
+ UINT8 St2Mm2[10], Reserved5[6];
+ UINT8 St3Mm3[10], Reserved6[6];
+ UINT8 St4Mm4[10], Reserved7[6];
+ UINT8 St5Mm5[10], Reserved8[6];
+ UINT8 St6Mm6[10], Reserved9[6];
+ UINT8 St7Mm7[10], Reserved10[6];
+ UINT8 Xmm0[16];
+ UINT8 Xmm1[16];
+ UINT8 Xmm2[16];
+ UINT8 Xmm3[16];
+ UINT8 Xmm4[16];
+ UINT8 Xmm5[16];
+ UINT8 Xmm6[16];
+ UINT8 Xmm7[16];
+ UINT8 Reserved11[14 * 16];
+ } EFI_FX_SAVE_STATE_IA32;
+#else
+ UINT8 St0Mm0[10], Reserved3[6];
+ UINT8 St0Mm1[10], Reserved4[6];
+ UINT8 St0Mm2[10], Reserved5[6];
+ UINT8 St0Mm3[10], Reserved6[6];
+ UINT8 St0Mm4[10], Reserved7[6];
+ UINT8 St0Mm5[10], Reserved8[6];
+ UINT8 St0Mm6[10], Reserved9[6];
+ UINT8 St0Mm7[10], Reserved10[6];
+ UINT8 Reserved11[22 * 16];
+ } EFI_FXSAVE_STATE;
+#endif
+
+ // System context for IA-32 processors
+ typedef struct {
+ UINT32 ExceptionData; // ExceptionData is
+ // additional data pushed
+ // on the stack by some
+ // types of IA-32
+ // exceptions
+#if (EFI_SPECIFICATION_VERSION >= 0x00020000)
+ EFI_FX_SAVE_STATE_IA32 FxSaveState;
+#else
+ EFI_FXSAVE_STATE FxSaveState;
+#endif
+ UINT32 Dr0, Dr1, Dr2, Dr3, Dr6, Dr7;
+ UINT32 Cr0, Cr1 /* Reserved */, Cr2, Cr3, Cr4;
+ UINT32 Eflags;
+ UINT32 Ldtr, Tr;
+ UINT32 Gdtr[2], Idtr[2];
+ UINT32 Eip;
+ UINT32 Gs, Fs, Es, Ds, Cs, Ss;
+ UINT32 Edi, Esi, Ebp, Esp, Ebx, Edx, Ecx, Eax;
+ } EFI_SYSTEM_CONTEXT_IA32;
+
+
+//
+// X64 processor exception types
+//
+#define EXCEPT_X64_DIVIDE_ERROR 0
+#define EXCEPT_X64_DEBUG 1
+#define EXCEPT_X64_NMI 2
+#define EXCEPT_X64_BREAKPOINT 3
+#define EXCEPT_X64_OVERFLOW 4
+#define EXCEPT_X64_BOUND 5
+#define EXCEPT_X64_INVALID_OPCODE 6
+#define EXCEPT_X64_DOUBLE_FAULT 8
+#define EXCEPT_X64_INVALID_TSS 10
+#define EXCEPT_X64_SEG_NOT_PRESENT 11
+#define EXCEPT_X64_STACK_FAULT 12
+#define EXCEPT_X64_GP_FAULT 13
+#define EXCEPT_X64_PAGE_FAULT 14
+#define EXCEPT_X64_FP_ERROR 16
+#define EXCEPT_X64_ALIGNMENT_CHECK 17
+#define EXCEPT_X64_MACHINE_CHECK 18
+#define EXCEPT_X64_SIMD 19
+
+//
+// X64 processor context definition
+//
+// FXSAVE_STATE
+// FP / MMX / XMM registers (see fxrstor instruction definition)
+//
+ typedef struct {
+ UINT16 Fcw;
+ UINT16 Fsw;
+ UINT16 Ftw;
+ UINT16 Opcode;
+ UINT64 Rip;
+ UINT64 DataOffset;
+ UINT8 Reserved1[8];
+ UINT8 St0Mm0[10], Reserved2[6];
+ UINT8 St1Mm1[10], Reserved3[6];
+ UINT8 St2Mm2[10], Reserved4[6];
+ UINT8 St3Mm3[10], Reserved5[6];
+ UINT8 St4Mm4[10], Reserved6[6];
+ UINT8 St5Mm5[10], Reserved7[6];
+ UINT8 St6Mm6[10], Reserved8[6];
+ UINT8 St7Mm7[10], Reserved9[6];
+ UINT8 Xmm0[16];
+ UINT8 Xmm1[16];
+ UINT8 Xmm2[16];
+ UINT8 Xmm3[16];
+ UINT8 Xmm4[16];
+ UINT8 Xmm5[16];
+ UINT8 Xmm6[16];
+ UINT8 Xmm7[16];
+#if (EFI_SPECIFICATION_VERSION >= 0x00020000)
+ //
+ // NOTE: UEFI 2.0 spec definition as follows. It should be updated
+ // after spec update.
+ //
+ UINT8 Reserved11[14 * 16];
+#else
+ UINT8 Xmm8[16];
+ UINT8 Xmm9[16];
+ UINT8 Xmm10[16];
+ UINT8 Xmm11[16];
+ UINT8 Xmm12[16];
+ UINT8 Xmm13[16];
+ UINT8 Xmm14[16];
+ UINT8 Xmm15[16];
+ UINT8 Reserved10[6 * 16];
+#endif
+ } EFI_FX_SAVE_STATE_X64;
+
+ typedef struct {
+ UINT64 ExceptionData;
+ EFI_FX_SAVE_STATE_X64 FxSaveState;
+ UINT64 Dr0;
+ UINT64 Dr1;
+ UINT64 Dr2;
+ UINT64 Dr3;
+ UINT64 Dr6;
+ UINT64 Dr7;
+ UINT64 Cr0;
+ UINT64 Cr1; /* Reserved */
+ UINT64 Cr2;
+ UINT64 Cr3;
+ UINT64 Cr4;
+ UINT64 Cr8;
+ UINT64 Rflags;
+ UINT64 Ldtr;
+ UINT64 Tr;
+ UINT64 Gdtr[2];
+ UINT64 Idtr[2];
+ UINT64 Rip;
+ UINT64 Gs;
+ UINT64 Fs;
+ UINT64 Es;
+ UINT64 Ds;
+ UINT64 Cs;
+ UINT64 Ss;
+ UINT64 Rdi;
+ UINT64 Rsi;
+ UINT64 Rbp;
+ UINT64 Rsp;
+ UINT64 Rbx;
+ UINT64 Rdx;
+ UINT64 Rcx;
+ UINT64 Rax;
+ UINT64 R8;
+ UINT64 R9;
+ UINT64 R10;
+ UINT64 R11;
+ UINT64 R12;
+ UINT64 R13;
+ UINT64 R14;
+ UINT64 R15;
+ } EFI_SYSTEM_CONTEXT_X64;
+
+
+ // System context for Itanium processor family
+ typedef struct {
+ UINT64 Reserved;
+ UINT64 R1, R2, R3, R4, R5, R6, R7, R8, R9, R10,
+ R11, R12, R13, R14, R15, R16, R17, R18, R19, R20,
+ R21, R22, R23, R24, R25, R26, R27, R28, R29, R30,
+ R31;
+ UINT64 F2[2], F3[2], F4[2], F5[2], F6[2],
+ F7[2], F8[2], F9[2], F10[2], F11[2],
+ F12[2], F13[2], F14[2], F15[2], F16[2],
+ F17[2], F18[2], F19[2], F20[2], F21[2],
+ F22[2], F23[2], F24[2], F25[2], F26[2],
+ F27[2], F28[2], F29[2], F30[2], F31[2];
+ UINT64 Pr;
+ UINT64 B0, B1, B2, B3, B4, B5, B6, B7;
+ // application registers
+ UINT64 ArRsc, ArBsp, ArBspstore, ArRnat;
+ UINT64 ArFcr;
+ UINT64 ArEflag, ArCsd, ArSsd, ArCflg;
+ UINT64 ArFsr, ArFir, ArFdr;
+ UINT64 ArCcv;
+ UINT64 ArUnat;
+ UINT64 ArFpsr;
+ UINT64 ArPfs, ArLc, ArEc;
+ // control registers
+ UINT64 CrDcr, CrItm, CrIva, CrPta, CrIpsr, CrIsr;
+ UINT64 CrIip, CrIfa, CrItir, CrIipa, CrIfs, CrIim;
+ UINT64 CrIha;
+ // debug registers
+ UINT64 Dbr0, Dbr1, Dbr2, Dbr3, Dbr4, Dbr5, Dbr6, Dbr7;
+ UINT64 Ibr0, Ibr1, Ibr2, Ibr3, Ibr4, Ibr5, Ibr6, Ibr7;
+ // virtual registers
+ UINT64 IntNat; // nat bits for R1-R31
+ } EFI_SYSTEM_CONTEXT_IPF;
+
+ //
+ // ARM processor context definition
+ //
+ typedef struct {
+ UINT32 R0;
+ UINT32 R1;
+ UINT32 R2;
+ UINT32 R3;
+ UINT32 R4;
+ UINT32 R5;
+ UINT32 R6;
+ UINT32 R7;
+ UINT32 R8;
+ UINT32 R9;
+ UINT32 R10;
+ UINT32 R11;
+ UINT32 R12;
+ UINT32 SP;
+ UINT32 LR;
+ UINT32 PC;
+ UINT32 CPSR;
+ UINT32 DFSR;
+ UINT32 DFAR;
+ UINT32 IFSR;
+ } EFI_SYSTEM_CONTEXT_ARM;
+
+
+ typedef union {
+ EFI_SYSTEM_CONTEXT_EBC *SystemContextEbc;
+ EFI_SYSTEM_CONTEXT_IA32 *SystemContextIa32;
+ EFI_SYSTEM_CONTEXT_X64 *SystemContextX64;
+ EFI_SYSTEM_CONTEXT_IPF *SystemContextIpf;
+ } EFI_SYSTEM_CONTEXT;
+
+typedef VOID (*EFI_PERIODIC_CALLBACK) (
+ IN OUT EFI_SYSTEM_CONTEXT SystemContext);
+
+typedef EFI_STATUS (EFIAPI *EFI_REGISTER_PERIODIC_CALLBACK) (
+ IN EFI_DEBUG_SUPPORT_PROTOCOL *This,
+ IN UINTN ProcessorIndex,
+ IN EFI_PERIODIC_CALLBACK PeriodicCallback);
+
+ typedef INTN EFI_EXCEPTION_TYPE;
+
+ // EBC Exception types
+ #define EXCEPT_EBC_UNDEFINED 0
+ #define EXCEPT_EBC_DIVIDE_ERROR 1
+ #define EXCEPT_EBC_DEBUG 2
+ #define EXCEPT_EBC_BREAKPOINT 3
+ #define EXCEPT_EBC_OVERFLOW 4
+ #define EXCEPT_EBC_INVALID_OPCODE 5
+ #define EXCEPT_EBC_STACK_FAULT 6
+ #define EXCEPT_EBC_ALIGNMENT_CHECK 7
+ #define EXCEPT_EBC_INSTRUCTION_ENCODING 8
+ #define EXCEPT_EBC_BAD_BREAK 9
+ #define EXCEPT_EBC_SINGLE_STEP 10
+
+ // IA-32 Exception types
+ #define EXCEPT_IA32_DIVIDE_ERROR 0
+ #define EXCEPT_IA32_DEBUG 1
+ #define EXCEPT_IA32_NMI 2
+ #define EXCEPT_IA32_BREAKPOINT 3
+ #define EXCEPT_IA32_OVERFLOW 4
+ #define EXCEPT_IA32_BOUND 5
+ #define EXCEPT_IA32_INVALID_OPCODE 6
+ #define EXCEPT_IA32_DOUBLE_FAULT 8
+ #define EXCEPT_IA32_INVALID_TSS 10
+ #define EXCEPT_IA32_SEG_NOT_PRESENT 11
+ #define EXCEPT_IA32_STACK_FAULT 12
+ #define EXCEPT_IA32_GP_FAULT 13
+ #define EXCEPT_IA32_PAGE_FAULT 14
+ #define EXCEPT_IA32_FP_ERROR 16
+ #define EXCEPT_IA32_ALIGNMENT_CHECK 17
+ #define EXCEPT_IA32_MACHINE_CHECK 18
+ #define EXCEPT_IA32_SIMD 19
+
+ // Itanium Processor Family Exception types
+ #define EXCEPT_IPF_VHTP_TRANSLATION 0
+ #define EXCEPT_IPF_INSTRUCTION_TLB 1
+ #define EXCEPT_IPF_DATA_TLB 2
+ #define EXCEPT_IPF_ALT_INSTRUCTION_TLB 3
+ #define EXCEPT_IPF_ALT_DATA_TLB 4
+ #define EXCEPT_IPF_DATA_NESTED_TLB 5
+ #define EXCEPT_IPF_INSTRUCTION_KEY_MISSED 6
+ #define EXCEPT_IPF_DATA_KEY_MISSED 7
+ #define EXCEPT_IPF_DIRTY_BIT 8
+ #define EXCEPT_IPF_INSTRUCTION_ACCESS_BIT 9
+ #define EXCEPT_IPF_DATA_ACCESS_BIT 10
+ #define EXCEPT_IPF_BREAKPOINT 11
+ #define EXCEPT_IPF_EXTERNAL_INTERRUPT 12
+ // 13 - 19 reserved
+ #define EXCEPT_IPF_PAGE_NOT_PRESENT 20
+ #define EXCEPT_IPF_KEY_PERMISSION 21
+ #define EXCEPT_IPF_INSTRUCTION_ACCESS_RIGHTS 22
+ #define EXCEPT_IPF_DATA_ACCESS_RIGHTS 23
+ #define EXCEPT_IPF_GENERAL_EXCEPTION 24
+ #define EXCEPT_IPF_DISABLED_FP_REGISTER 25
+ #define EXCEPT_IPF_NAT_CONSUMPTION 26
+ #define EXCEPT_IPF_SPECULATION 27
+ // 28 reserved
+ #define EXCEPT_IPF_DEBUG 29
+ #define EXCEPT_IPF_UNALIGNED_REFERENCE 30
+ #define EXCEPT_IPF_UNSUPPORTED_DATA_REFERENCE 31
+ #define EXCEPT_IPF_FP_FAULT 32
+ #define EXCEPT_IPF_FP_TRAP 33
+ #define EXCEPT_IPF_LOWER_PRIVILEGE_TRANSFER_TRAP 34
+ #define EXCEPT_IPF_TAKEN_BRANCH 35
+ #define EXCEPT_IPF_SINGLE_STEP 36
+ // 37 - 44 reserved
+ #define EXCEPT_IPF_IA32_EXCEPTION 45
+ #define EXCEPT_IPF_IA32_INTERCEPT 46
+ #define EXCEPT_IPF_IA32_INTERRUPT 47
+
+ //
+ // ARM processor exception types
+ //
+ #define EXCEPT_ARM_RESET 0
+ #define EXCEPT_ARM_UNDEFINED_INSTRUCTION 1
+ #define EXCEPT_ARM_SOFTWARE_INTERRUPT 2
+ #define EXCEPT_ARM_PREFETCH_ABORT 3
+ #define EXCEPT_ARM_DATA_ABORT 4
+ #define EXCEPT_ARM_RESERVED 5
+ #define EXCEPT_ARM_IRQ 6
+ #define EXCEPT_ARM_FIQ 7
+ //
+ // For coding convenience, define the maximum valid ARM
+ // exception.
+ //
+ #define MAX_ARM_EXCEPTION EXCEPT_ARM_FIQ
+
+ typedef VOID (*EFI_EXCEPTION_CALLBACK) (
+ IN EFI_EXCEPTION_TYPE ExceptionType,
+ IN OUT EFI_SYSTEM_CONTEXT SystemContext);
+
+typedef EFI_STATUS (EFIAPI *EFI_REGISTER_EXCEPTION_CALLBACK) (
+ IN EFI_DEBUG_SUPPORT_PROTOCOL *This,
+ IN UINTN ProcessorIndex,
+ IN EFI_EXCEPTION_CALLBACK ExceptionCallback,
+ IN EFI_EXCEPTION_TYPE ExceptionType);
+
+typedef EFI_STATUS (EFIAPI *EFI_INVALIDATE_INSTRUCTION_CACHE) (
+ IN EFI_DEBUG_SUPPORT_PROTOCOL *This,
+ IN UINTN ProcessorIndex,
+ IN VOID *Start,
+ IN UINT64 Length);
+
+
+typedef struct _EFI_DEBUG_SUPPORT_PROTOCOL {
+ EFI_INSTRUCTION_SET_ARCHITECTURE Isa;
+ EFI_GET_MAXIMUM_PROCESSOR_INDEX GetMaximumProcessorIndex;
+ EFI_REGISTER_PERIODIC_CALLBACK RegisterPeriodicCallback;
+ EFI_REGISTER_EXCEPTION_CALLBACK RegisterExceptionCallback;
+ EFI_INVALIDATE_INSTRUCTION_CACHE InvalidateInstructionCache;
+} EFI_DEBUG_SUPPORT_PROTOCOL;
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2006, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
diff --git a/Include/Protocol/Decompress.h b/Include/Protocol/Decompress.h
new file mode 100644
index 0000000..37a1109
--- /dev/null
+++ b/Include/Protocol/Decompress.h
@@ -0,0 +1,95 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2005, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/BIN/Core/Include/Protocol/Decompress.h 3 3/13/06 1:40a Felixp $
+//
+// $Revision: 3 $
+//
+// $Date: 3/13/06 1:40a $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Core/Include/Protocol/Decompress.h $
+//
+// 3 3/13/06 1:40a Felixp
+//
+// 2 3/04/05 10:33a Mandal
+//
+// 1 1/28/05 12:44p Felixp
+//
+// 2 1/18/05 3:21p Felixp
+// PrintDebugMessage renamed to Trace
+//
+// 1 12/23/04 9:41a Felixp
+//
+// 1 3/30/04 2:24a Felixp
+//
+//**********************************************************************
+//<AMI_FHDR_START>
+//
+// Name: Decompress.h
+//
+// Description: Decompress Protocol Definition
+//
+//<AMI_FHDR_END>
+//**********************************************************************
+#ifndef __DECOMPRESS_PROTOCOL__H__
+#define __DECOMPRESS_PROTOCOL__H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+#include <EFI.h>
+
+#define EFI_DECOMPRESS_PROTOCOL_GUID \
+{0xd8117cfe,0x94a6,0x11d4,0x9a,0x3a,0x0,0x90,0x27,0x3f,0xc1,0x4d}
+
+GUID_VARIABLE_DECLARATION(gEfiDecompressProtocolGuid, EFI_DECOMPRESS_PROTOCOL_GUID);
+
+typedef struct _EFI_DECOMPRESS_PROTOCOL EFI_DECOMPRESS_PROTOCOL;
+
+typedef EFI_STATUS (EFIAPI *EFI_DECOMPRESS_GET_INFO) (
+ IN EFI_DECOMPRESS_PROTOCOL *This,
+ IN VOID *Source, IN UINT32 SourceSize,
+ OUT UINT32 *DestinationSize, OUT UINT32 *ScratchSize
+);
+
+typedef EFI_STATUS (EFIAPI *EFI_DECOMPRESS_DECOMPRESS) (
+ IN EFI_DECOMPRESS_PROTOCOL *This,
+ IN VOID* Source, IN UINT32 SourceSize,
+ IN OUT VOID* Destination, IN UINT32 DestinationSize,
+ IN OUT VOID* Scratch, IN UINT32 ScratchSize
+);
+
+struct _EFI_DECOMPRESS_PROTOCOL {
+ EFI_DECOMPRESS_GET_INFO GetInfo;
+ EFI_DECOMPRESS_DECOMPRESS Decompress;
+} ;
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2005, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
diff --git a/Include/Protocol/DeferredImageLoad.h b/Include/Protocol/DeferredImageLoad.h
new file mode 100644
index 0000000..8df3abd
--- /dev/null
+++ b/Include/Protocol/DeferredImageLoad.h
@@ -0,0 +1,85 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/BIN/Core/Include/Protocol/DeferredImageLoad.h 1 5/13/11 4:40p Artems $
+//
+// $Revision: 1 $
+//
+// $Date: 5/13/11 4:40p $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Core/Include/Protocol/DeferredImageLoad.h $
+//
+// 1 5/13/11 4:40p Artems
+//
+//**********************************************************************
+//<AMI_FHDR_START>
+//
+// Name: <DeferredImageLoad.h>
+//
+// Description: Deferred image load protocol header file
+//
+//<AMI_FHDR_END>
+//**********************************************************************
+
+#ifndef __DEFERRED_IMAGE_LOAD_H__
+#define __DEFERRED_IMAGE_LOAD_H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define EFI_DEFERRED_IMAGE_LOAD_PROTOCOL_GUID \
+ { 0x15853d7c, 0x3ddf, 0x43e0, 0xa1, 0xcb, 0xeb, 0xf8, 0x5b, 0x8f, 0x87, 0x2c }
+
+
+GUID_VARIABLE_DECLARATION(gEfiDeferredImageLoadProtocolGuid, EFI_DEFERRED_IMAGE_LOAD_PROTOCOL_GUID);
+
+typedef struct _EFI_DEFERRED_IMAGE_LOAD_PROTOCOL EFI_DEFERRED_IMAGE_LOAD_PROTOCOL;
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_DEFERRED_IMAGE_INFO)(
+ IN EFI_DEFERRED_IMAGE_LOAD_PROTOCOL *This,
+ IN UINTN ImageIndex,
+ OUT EFI_DEVICE_PATH_PROTOCOL **ImageDevicePath,
+ OUT VOID **Image,
+ OUT UINTN *ImageSize,
+ OUT BOOLEAN *BootOption
+);
+
+struct _EFI_DEFERRED_IMAGE_LOAD_PROTOCOL {
+ EFI_DEFERRED_IMAGE_INFO GetImageInfo;
+};
+
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//********************************************************************** \ No newline at end of file
diff --git a/Include/Protocol/DeviceIo.h b/Include/Protocol/DeviceIo.h
new file mode 100644
index 0000000..e1d42e8
--- /dev/null
+++ b/Include/Protocol/DeviceIo.h
@@ -0,0 +1,169 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2005, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+//**********************************************************************
+// $Header: /Alaska/BIN/Core/Include/Protocol/DeviceIo.h 4 3/13/06 1:40a Felixp $
+//
+// $Revision: 4 $
+//
+// $Date: 3/13/06 1:40a $
+//*****************************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Core/Include/Protocol/DeviceIo.h $
+//
+// 4 3/13/06 1:40a Felixp
+//
+// 3 8/15/05 9:03a Andriyn
+//
+// 2 3/04/05 10:33a Mandal
+//
+// 1 1/28/05 12:44p Felixp
+//
+// 2 1/18/05 3:21p Felixp
+// PrintDebugMessage renamed to Trace
+//
+// 1 12/23/04 9:41a Felixp
+//
+// 1 8/26/04 3:56p Markw
+//
+//*****************************************************************************
+//<AMI_FHDR_START>
+//
+// Name: DeviceIo_h
+//
+// Description: This file is an include file used to define the Protocol for the
+// DeviceIo Protocol.
+//
+//<AMI_FHDR_END>
+//*****************************************************************************
+
+#ifndef __DEVICE_IO_PROTOCOL_H__
+#define __DEVICE_IO_PROTOCOL_H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+#include <EFI.h>
+
+// af6ac311-84c3-11d2-8e3c-00a0c969723b }
+#define DEVICE_IO_PROTOCOL \
+ {0xaf6ac311,0x84c3,0x11d2,0x8e,0x3c,0x00,0xa0,0xc9,0x69,0x72,0x3b}
+
+typedef struct _EFI_DEVICE_IO_INTERFACE EFI_DEVICE_IO_INTERFACE;
+
+//*******************************************************
+// EFI_IO_WIDTH
+//*******************************************************
+typedef enum {
+ IO_UINT8 = 0,
+ IO_UINT16 = 1,
+ IO_UINT32 = 2,
+ IO_UINT64 = 3
+} EFI_IO_WIDTH;
+
+//*******************************************************
+// EFI_IO_OPERATION_TYPE
+//*******************************************************
+typedef enum {
+ EfiBusMasterRead,
+ EfiBusMasterWrite,
+ EfiBusMasterCommonBuffer
+} EFI_IO_OPERATION_TYPE;
+
+
+//*******************************************************
+// EFI_DEVICE_IO
+//*******************************************************
+typedef EFI_STATUS (EFIAPI *EFI_DEVICE_IO) (
+ IN EFI_DEVICE_IO_INTERFACE *This,
+ IN EFI_IO_WIDTH Width,
+ IN UINT64 Address,
+ IN UINTN Count,
+ IN OUT VOID *Buffer
+);
+//*******************************************************
+// EFI_IO_ACCESS
+//*******************************************************
+typedef struct {
+ EFI_DEVICE_IO Read;
+ EFI_DEVICE_IO Write;
+} EFI_IO_ACCESS;
+
+typedef EFI_STATUS (EFIAPI *EFI_PCI_DEVICE_PATH) (
+ IN EFI_DEVICE_IO_INTERFACE *This,
+ IN UINT64 PciAddress,
+ IN OUT EFI_DEVICE_PATH_PROTOCOL **PciDevicePath
+);
+
+typedef EFI_STATUS (EFIAPI *EFI_IO_MAP) (
+ IN EFI_DEVICE_IO_INTERFACE *This,
+ IN EFI_IO_OPERATION_TYPE Operation,
+ IN EFI_PHYSICAL_ADDRESS *HostAddress,
+ IN OUT UINTN *NumberOfBytes,
+ OUT EFI_PHYSICAL_ADDRESS *DeviceAddress,
+ OUT VOID **Mapping
+);
+
+typedef EFI_STATUS (EFIAPI *EFI_IO_UNMAP) (
+ IN EFI_DEVICE_IO_INTERFACE *This,
+ IN VOID *Mapping
+);
+
+typedef EFI_STATUS (EFIAPI *EFI_IO_ALLOCATE_BUFFER) (
+ IN EFI_DEVICE_IO_INTERFACE *This,
+ IN EFI_ALLOCATE_TYPE Type,
+ IN EFI_MEMORY_TYPE MemoryType,
+ IN UINTN Pages,
+ IN OUT EFI_PHYSICAL_ADDRESS *HostAddress
+);
+
+typedef EFI_STATUS (EFIAPI *EFI_IO_FLUSH) (
+ IN EFI_DEVICE_IO_INTERFACE *This
+);
+
+typedef EFI_STATUS (EFIAPI *EFI_IO_FREE_BUFFER) (
+ IN EFI_DEVICE_IO_INTERFACE *This,
+ IN UINTN Pages,
+ IN EFI_PHYSICAL_ADDRESS HostAddress
+);
+
+struct _EFI_DEVICE_IO_INTERFACE {
+ EFI_IO_ACCESS Mem;
+ EFI_IO_ACCESS Io;
+ EFI_IO_ACCESS Pci;
+ EFI_IO_MAP Map;
+ EFI_PCI_DEVICE_PATH PciDevicePath;
+ EFI_IO_UNMAP Unmap;
+ EFI_IO_ALLOCATE_BUFFER AllocateBuffer;
+ EFI_IO_FLUSH Flush;
+ EFI_IO_FREE_BUFFER FreeBuffer;
+};
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2005, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
diff --git a/Include/Protocol/DevicePath.h b/Include/Protocol/DevicePath.h
new file mode 100644
index 0000000..304d92c
--- /dev/null
+++ b/Include/Protocol/DevicePath.h
@@ -0,0 +1,570 @@
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
+//**********************************************************************
+// $Header: /Alaska/BIN/Core/Include/Protocol/DevicePath.h 16 4/10/12 12:50p Artems $
+//
+// $Revision: 16 $
+//
+// $Date: 4/10/12 12:50p $
+//*****************************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Core/Include/Protocol/DevicePath.h $
+//
+// 16 4/10/12 12:50p Artems
+// EIP 87234: SCT devicepath test error - added support for SAS Ex device
+// path
+//
+// 15 10/20/11 7:01p Artems
+// Added new DevicePath types as described in UEFI spec v.2.3.1
+//
+// 14 5/05/11 12:05p Artems
+// Added support for new device types. Minor changes done to reduce
+// difference with EDKII
+//
+// 13 4/21/11 12:53p Artems
+// EIP 58707: Added changes introduced in UEFI specification v. 2.3.1
+//
+// 11 11/15/10 4:34p Felixp
+// MSG_SATA_DP constant is added.
+//
+// 10 28/02/08 7:38p Anandakrishnanl
+// Added sata device path length definition
+//
+// 9 3/19/07 2:21p Felixp
+//
+// 8 1/17/07 9:54a Felixp
+// New device path types added
+//
+// 4 1/12/07 5:24p Felixp
+//
+// 3 12/06/06 11:46a Vyacheslava
+//
+// 6 5/19/06 10:20p Felixp
+// SET_NODE_LENGTH & NODE_LENGTH macros added
+//
+// 5 3/13/06 1:40a Felixp
+//
+// 4 4/20/05 4:54p Andriyn
+// USB_DEVICE_PATH added
+//
+// 2 2/03/05 4:56p Felixp
+// NEXT_NODE macros added
+//
+// 1 1/28/05 12:44p Felixp
+//
+// 2 1/18/05 3:21p Felixp
+// PrintDebugMessage renamed to Trace
+//
+// 1 12/23/04 9:41a Felixp
+//
+// 17 12/22/04 11:10a Markw
+// Added the rest of the device paths.
+//
+// 16 12/21/04 5:53p Markw
+// Added several device path structures.
+//
+// 15 12/21/04 5:00p Markw
+// Modified device path defines for consistency and added defines for all
+// types and subtypes.
+//
+// 14 12/21/04 4:21p Markw
+// Renamed hardware device path definition for consistency and some more
+// hardware paths.
+//
+// 13 12/13/04 3:36p Markw
+// Device Path checked erasing previous changes. Fixed. Added Vendor
+// Define Device Path Terminal GUIDs.
+//
+// 12 12/10/04 4:24p Felixp
+//
+// 11 12/08/04 8:57a Radhikav
+// Added UART Devicpath.
+
+// 10 12/02/04 6:27p Markw
+// Added Vendor Define Device Path and Terminal GUIDs.
+//
+// 9 11/16/04 6:15p Robert
+// Updated errors in the Hard drive device path and the cdrom device path
+// structures
+//
+// 8 10/11/04 5:54p Olegi
+//
+// 7 10/01/04 5:46p Robert
+// Added support for Hard drives and CDROM device paths
+//
+// 6 9/27/04 12:09p Felixp
+//
+// 5 7/16/04 3:57p Felixp
+// Changes to support both 7f and ff values for the device path end type
+//
+// 4 3/18/04 5:22p Markw
+// Add memory mapped device path.
+//
+// 3 2/17/04 4:38p Felixp
+// Media device path added
+//
+// 2 2/09/04 2:23p Markw
+// header/typedef fixes
+//
+// 1 2/09/04 1:25p Markw
+//
+//*****************************************************************************
+//<AMI_FHDR_START>
+//
+// Name: DevicePath.h
+//
+// Description: This file is an include file used to define the Protocol and
+// definitions for the Device Path.
+//
+//<AMI_FHDR_END>
+//*****************************************************************************
+
+#ifndef __DEVICE_PATH_PROTOCOL_H__
+#define __DEVICE_PATH_PROTOCOL_H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+#include <EFI.h>
+
+#define EFI_DEVICE_PATH_PROTOCOL_GUID \
+ { 0x09576e91, 0x6d3f, 0x11d2, 0x8e, 0x39, 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b}
+
+GUID_VARIABLE_DECLARATION(gEfiDevicePathProtocolGuid, EFI_DEVICE_PATH_PROTOCOL_GUID);
+
+#define NODE_LENGTH(pPath) (*(UINT16*)&(pPath)->Length[0])
+#define SET_NODE_LENGTH(pPath,Length) (NODE_LENGTH(pPath)=(Length))
+#define NEXT_NODE(pPath) ((EFI_DEVICE_PATH_PROTOCOL*)((UINT8*)(pPath)+NODE_LENGTH(pPath)))
+
+#define END_DEVICE_PATH 0x7F
+#define END_DEVICE_PATH1 0xFF
+ #define END_INSTANCE_SUBTYPE 0x01
+ #define END_ENTIRE_SUBTYPE 0xFF
+ #define END_DEVICE_PATH_LENGTH 0x04
+
+#define isEndNode(pDp) ((pDp)->Type==END_DEVICE_PATH||(pDp)->Type==END_DEVICE_PATH1)
+
+#define HARDWARE_DEVICE_PATH 0x01
+ #define HW_PCI_DP 0x01
+ #define HW_PCCARD_DP 0x02
+ #define HW_MEMMAP_DP 0x03
+ #define HW_VENDOR_DP 0x04
+ #define HW_CONTROLLER_DP 0x05
+ #define HW_PCI_DEVICE_PATH_LENGTH 0x06
+
+#define ACPI_DEVICE_PATH 0x02
+ #define ACPI_DP 0x01
+ #define ACPI_DEVICE_PATH_LENGTH 0x0C
+ #define ACPI_EXTENDED_DP 0x02
+ #define ACPI_ADR_DP 0x03
+
+#define MESSAGING_DEVICE_PATH 0x03
+ #define MSG_ATAPI_DP 0x01
+ #define MSG_SCSI_DP 0x02
+ #define MSG_FIBRECHANNEL_DP 0x03
+ #define MSG_1394_DP 0x04
+ #define MSG_USB_DP 0x05
+ #define MSG_I2O_DP 0x06
+ #define MSG_INFINIBAND_DP 0x09
+ #define MSG_VENDOR_DP 0x0A
+ #define MSG_MAC_ADDR_DP 0x0B
+ #define MSG_IPv4_DP 0x0C
+ #define MSG_IPv6_DP 0x0D
+ #define MSG_UART_DP 0x0E
+ #define MSG_USB_CLASS_DP 0x0F
+ #define MSG_USB_WWID_CLASS_DP 0x10
+ #define MSG_USB_LOGICAL_UNIT_CLASS_DP 0x11
+ #define MSG_USB_SATA_DP 0x12
+ #define MSG_SATA_DP 0x12
+ #define MSG_ISCSI_DP 0x13
+ #define MSG_VLAN_DP 0x14
+ #define MSG_FIBRECHANNELEX_DP 0x15
+ #define MSG_SASEX_DP 0x16
+
+ #define MSG_DEVICE_PATH_LENGTH 0x08
+ #define ATAPI_DEVICE_PATH_LENGTH 0x08
+ #define SATA_DEVICE_PATH_LENGTH 0x0A
+ #define UART_DEVICE_PATH_LENGTH 0x13
+
+#define MEDIA_DEVICE_PATH 0x04
+ #define MEDIA_HARDDRIVE_DP 0x01
+ #define MEDIA_CDROM_DP 0x02
+ #define MEDIA_VENDOR_DP 0x03
+ #define MEDIA_FILEPATH_DP 0x04
+ #define MEDIA_PROTOCOL_DP 0x05
+ #define MEDIA_FV_FILEPATH_DP 0x06
+ #define MEDIA_FV_DP 0x07
+ #define MEDIA_RELATIVE_OFFSET_RANGE_DP 0x08
+
+//Does not follow our device path naming convensions but
+//this is how it is defined in the CSM Spec
+#define BBS_DEVICE_PATH 0x05
+ #define BBS_BBS_DP 0x01
+
+//EFI defined Vendor defined device path guids.
+#define EFI_PC_ANSI_GUID \
+ {0xe0c14753,0xf9be,0x11d2,0x9a,0x0c,0x00,0x90,0x27,0x3f,0xc1,0x4d}
+#define EFI_VT_100_GUID \
+ {0xdfa66065,0xb419,0x11d3,0x9a,0x2d,0x00,0x90,0x27,0x3f,0xc1,0x4d}
+#define EFI_VT_100_PLUS_GUID \
+ {0x7baec70b,0x57e0,0x4c76,0x8e,0x87,0x2f,0x9e,0x28,0x08,0x83,0x43}
+#define EFI_VT_UTF8_GUID \
+ {0xad15a0d6,0x8bec,0x4acf,0xa0,0x73,0xd0,0x1d,0xe7,0x7e,0x2d,0x88}
+#define DEVICE_PATH_MESSAGING_UART_FLOW_CONTROL \
+ {0x37499A9D,0x542F,0x4C89,0xA0,0x26,0x35,0xDA,0x14,0x20,0x94,0xE4}
+#define EFI_SAS_PROTOCOL_GUID \
+ {0xd487ddb4,0x008b,0x11d9,0xaf,0xdc,0x00,0x10,0x83,0xff,0xca,0x4d}
+#define EFI_DEBUGPORT_PROTOCOL_GUID \
+ {0xEBA4E8D2,0x3858,0x41EC,0xA2,0x81,0x26,0x47,0xBA,0x96,0x60,0xD0}
+
+GUID_VARIABLE_DECLARATION(gEfiPcAnsiGuid, EFI_PC_ANSI_GUID);
+GUID_VARIABLE_DECLARATION(gEfiVT100Guid, EFI_VT_100_GUID);
+GUID_VARIABLE_DECLARATION(gEfiVT100PlusGuid, EFI_VT_100_PLUS_GUID);
+GUID_VARIABLE_DECLARATION(gEfiVTUTF8Guid, EFI_VT_UTF8_GUID);
+GUID_VARIABLE_DECLARATION(gEfiUartDevicePathGuid, DEVICE_PATH_MESSAGING_UART_FLOW_CONTROL);
+GUID_VARIABLE_DECLARATION(gEfiSasDevicePathGuid, EFI_SAS_PROTOCOL_GUID);
+GUID_VARIABLE_DECLARATION(gEfiDebugPortProtocolGuid, EFI_DEBUGPORT_PROTOCOL_GUID);
+
+#pragma pack (push) //May not be alligned on a boundary.
+#pragma pack (1)
+
+//Hardware Device Path Type
+typedef struct {
+ EFI_DEVICE_PATH_PROTOCOL Header;
+ UINT8 Function;
+ UINT8 Device;
+} PCI_DEVICE_PATH;
+
+//Hardware Device Path Type
+typedef struct {
+ EFI_DEVICE_PATH_PROTOCOL Header;
+ UINT8 Function;
+} PCCARD_DEVICE_PATH;
+
+//Hardware Device Path Type
+typedef struct {
+ EFI_DEVICE_PATH_PROTOCOL Header;
+ EFI_MEMORY_TYPE MemoryType;
+ EFI_PHYSICAL_ADDRESS StartingAddress;
+ EFI_PHYSICAL_ADDRESS EndingAddress;
+} MEMMAP_DEVICE_PATH;
+
+//Hardware Device Path Type
+typedef struct {
+ EFI_DEVICE_PATH_PROTOCOL Header;
+ EFI_GUID Guid;
+ //Variable Length Vendor Defined Data
+} VENDOR_DEVICE_PATH;
+
+//Hardware Device Path Type
+typedef struct {
+ EFI_DEVICE_PATH_PROTOCOL Header;
+ UINT32 Controller;
+} CONTROLLER_DEVICE_PATH;
+
+//ACPI Device Path Type
+typedef struct {
+ EFI_DEVICE_PATH_PROTOCOL Header;
+ UINT32 HID;
+ UINT32 UID;
+} ACPI_HID_DEVICE_PATH;
+
+//ACPI Device Path Type
+typedef struct {
+ EFI_DEVICE_PATH_PROTOCOL Header;
+ UINT32 HID;
+ UINT32 UID;
+ UINT32 CID;
+ //Variable Length _HIDSTR string
+ //Variable Length _UIDSTR string
+ //Variable Length _CIDSTR string
+} ACPI_EXTENDED_HID_DEVICE_PATH;
+
+#define PNP_EISA_ID_CONST 0x41d0
+#define EISA_ID(_Name, _Num) ((UINT32) ((_Name) | (_Num) << 16))
+#define EISA_PNP_ID(_PNPId) (EISA_ID(PNP_EISA_ID_CONST, (_PNPId)))
+#define EFI_PNP_ID(_PNPId) (EISA_ID(PNP_EISA_ID_CONST, (_PNPId)))
+
+#define PNP_EISA_ID_MASK 0xffff
+#define EISA_ID_TO_NUM(_Id) ((_Id) >> 16)
+
+//ACPI Address Device Path Type
+typedef struct {
+ EFI_DEVICE_PATH_PROTOCOL Header;
+ UINT32 ADR;
+} ACPI_ADR_DEVICE_PATH;
+
+//Messaging Device Path Type
+typedef struct {
+ EFI_DEVICE_PATH_PROTOCOL Header;
+ UINT8 PrimarySecondary;
+ UINT8 SlaveMaster;
+ UINT16 Lun;
+} ATAPI_DEVICE_PATH;
+
+//Messaging Device Path Type
+typedef struct {
+ EFI_DEVICE_PATH_PROTOCOL Header;
+ UINT16 Pun;
+ UINT16 Lun;
+} SCSI_DEVICE_PATH;
+
+//Messaging Device Path Type
+typedef struct {
+ EFI_DEVICE_PATH_PROTOCOL Header;
+ UINT32 Reserved;
+ UINT64 WWN;
+ UINT64 Lun;
+} FIBRECHANNEL_DEVICE_PATH;
+
+//Messaging Device Path Type
+typedef struct {
+ EFI_DEVICE_PATH_PROTOCOL Header;
+ UINT32 Reserved;
+ UINT8 WWN[8];
+ UINT8 Lun[8];
+} FIBRECHANNELEX_DEVICE_PATH;
+
+//Messaging Device Path Type
+typedef struct {
+ EFI_DEVICE_PATH_PROTOCOL Header;
+ UINT32 Reserved;
+ UINT64 Guid; //Different than EFI_GUID.
+} F1394_DEVICE_PATH;
+
+//Messaging Device Path Type
+typedef struct {
+ EFI_DEVICE_PATH_PROTOCOL Header;
+ UINT8 ParentPortNumber;
+ UINT8 InterfaceNumber;
+} USB_DEVICE_PATH;
+
+//Messaging Device Path Type
+typedef struct {
+ EFI_DEVICE_PATH_PROTOCOL Header;
+ UINT16 VendorId;
+ UINT16 ProductId;
+ UINT8 DeviceClass;
+ UINT8 DeviceSubClass;
+ UINT8 DeviceProtocol;
+} USB_CLASS_DEVICE_PATH;
+
+//USB WWID Device Path
+typedef struct {
+ EFI_DEVICE_PATH_PROTOCOL Header;
+ UINT16 InterfaceNumber;
+ UINT16 VendorId;
+ UINT16 ProductId;
+} USB_WWID_DEVICE_PATH;
+
+// Device Logical Unit
+typedef struct {
+ EFI_DEVICE_PATH_PROTOCOL Header;
+ UINT8 Lun;
+} LOGICAL_UNIT_DEVICE_PATH;
+
+//SATA Device Path
+typedef struct {
+ EFI_DEVICE_PATH_PROTOCOL Header;
+ UINT16 PortNumber;
+ UINT16 MultiplierPortNumber;
+ UINT16 LogicalUnitNumber;
+} SATA_DEVICE_PATH;
+
+#define SATA_HBA_DIRECT_CONNECT_FLAG 0x8000
+
+//iSCSI Device Path Node
+typedef struct {
+ EFI_DEVICE_PATH_PROTOCOL Header;
+ UINT16 NetworkProtocol;
+ UINT16 LoginOption;
+ UINT64 Lun;
+ UINT16 TargetPortalGroupTag;
+ // CHAR8 iSCSI Target Name
+} iSCSI_DEVICE_PATH;
+
+typedef struct {
+ EFI_DEVICE_PATH_PROTOCOL Header;
+ UINT16 VlanId;
+} VLAN_DEVICE_PATH;
+
+//Serial Attached SCSI (SAS) Device Path
+typedef struct {
+ EFI_DEVICE_PATH_PROTOCOL Header;
+ EFI_GUID Guid;
+ UINT32 Reserved;
+ UINT64 SasAddress;
+ UINT64 Lun;
+ UINT16 DeviceTopology;
+ UINT16 RelativeTargetPort;
+} SAS_DEVICE_PATH;
+
+//Serial Attached SCSI (SAS) Ex Device Path
+typedef struct {
+ EFI_DEVICE_PATH_PROTOCOL Header;
+ UINT8 SasAddress[8];
+ UINT8 Lun[8];
+ UINT16 DeviceTopology;
+ UINT16 RelativeTargetPort;
+} SASEX_DEVICE_PATH;
+
+//Messaging Device Path Type
+typedef struct {
+ EFI_DEVICE_PATH_PROTOCOL Header;
+ UINT32 Tid;
+} I20_DEVICE_PATH;
+
+//Messaging Device Path Type
+typedef struct {
+ EFI_DEVICE_PATH_PROTOCOL Header;
+ EFI_MAC_ADDRESS MacAddr;
+ UINT8 IfType;
+} MAC_ADDRESS_DEVICE_PATH;
+
+//Messaging Device Path Type
+typedef struct {
+ EFI_DEVICE_PATH_PROTOCOL Header;
+ EFI_IPv4_ADDRESS LocalIpAddress;
+ EFI_IPv4_ADDRESS RemoteIpAddress;
+ UINT16 LocalPort;
+ UINT16 RemotePort;
+ UINT16 Protocol;
+ BOOLEAN StaticIpAddress;
+ EFI_IPv4_ADDRESS GatewayIpAddress;
+ EFI_IPv4_ADDRESS SubnetMask;
+} IPv4_DEVICE_PATH;
+
+//Messaging Device Path Type
+typedef struct {
+ EFI_DEVICE_PATH_PROTOCOL Header;
+ EFI_IPv6_ADDRESS LocalIp;
+ EFI_IPv6_ADDRESS RemoteIp;
+ UINT16 LocalPort;
+ UINT16 RemotePort;
+ UINT16 Protocol;
+ UINT8 IpAddressOrigin;
+ UINT8 PrefixLength;
+ EFI_IPv6_ADDRESS GatewayIpAddress;
+} IPv6_DEVICE_PATH;
+
+//Messaging Device Path Type
+typedef struct {
+ EFI_DEVICE_PATH_PROTOCOL Header;
+ UINT32 ResourceFlags;
+ UINT64 PortGid[2];
+ UINT64 ServiceId;
+ UINT64 TargetPortId;
+ UINT64 DeviceId;
+} INFINIBAND_DEVICE_PATH;
+
+//Messaging Device Path Type
+typedef struct {
+ EFI_DEVICE_PATH_PROTOCOL Header;
+ UINT32 Reserved;
+ UINT64 BaudRate;
+ UINT8 DataBits;
+ UINT8 Parity;
+ UINT8 StopBits;
+} UART_DEVICE_PATH;
+
+//Messaging Device Path Type
+typedef struct {
+ EFI_DEVICE_PATH_PROTOCOL Header;
+ EFI_GUID Guid;
+ UINT32 FlowControlMap;
+} UART_FLOW_CONTROL_DEVICE_PATH;
+
+//Media Device Path Type
+typedef struct {
+ EFI_DEVICE_PATH_PROTOCOL Header;
+ UINT32 PartitionNumber;
+ UINT64 PartitionStart;
+ UINT64 PartitionSize;
+ UINT8 Signature[16];
+ UINT8 MBRType;
+ UINT8 SignatureType;
+} HARDDRIVE_DEVICE_PATH;
+
+#define MBR_TYPE_MASTER_BOOT_RECORD 0x01
+#define MBR_TYPE_EFI_PARTITION_TABLE_HEADER 0x02
+
+#define SIGNATURE_TYPE_MBR 0x01
+#define SIGNATURE_TYPE_GUID 0x02
+
+//Media Device Path Type
+typedef struct {
+ EFI_DEVICE_PATH_PROTOCOL Header;
+ UINT32 BootEntry;
+ UINT64 PartitionStart;
+ UINT64 PartitionSize;
+} CDROM_DEVICE_PATH;
+
+//Media Device Path Type
+typedef struct {
+ EFI_DEVICE_PATH_PROTOCOL Header;
+ CHAR16 PathName[1];
+} FILEPATH_DEVICE_PATH;
+
+//Media Device Path Type
+typedef struct {
+ EFI_DEVICE_PATH_PROTOCOL Header;
+ EFI_GUID NameGuid;
+ //Variable Unicode Path String.
+} MEDIA_FW_VOL_FILEPATH_DEVICE_PATH;
+
+//Media Device Path Type
+typedef struct {
+ EFI_DEVICE_PATH_PROTOCOL Header;
+ EFI_GUID ProtocolGuid;
+} PROTOCOL_DEVICE_PATH;
+
+// Media relative offset range device path.
+typedef struct _{
+ EFI_DEVICE_PATH_PROTOCOL Header;
+ UINT32 Reserved;
+ UINT64 StartingOffset;
+ UINT64 EndingOffset;
+} MEDIA_RELATIVE_OFFSET_RANGE_DEVICE_PATH;
+
+//BIOS Boot Specification Device Path
+//Does not follow our device path naming convensions but
+//this is how it is defined in the CSM Spec
+typedef struct _BBS_BBS_DEVICE_PATH {
+ EFI_DEVICE_PATH_PROTOCOL Header;
+ UINT16 DeviceType;
+ UINT16 StatusFlag;
+ CHAR8 String[1];
+} BBS_BBS_DEVICE_PATH;
+#pragma pack (pop)
+
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
diff --git a/Include/Protocol/DevicePathFromText.h b/Include/Protocol/DevicePathFromText.h
new file mode 100644
index 0000000..42c183b
--- /dev/null
+++ b/Include/Protocol/DevicePathFromText.h
@@ -0,0 +1,91 @@
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
+
+//*************************************************************************
+// $Header: /Alaska/BIN/Core/Include/Protocol/DevicePathFromText.h 1 5/05/11 12:05p Artems $
+//
+// $Revision: 1 $
+//
+// $Date: 5/05/11 12:05p $
+//*************************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Core/Include/Protocol/DevicePathFromText.h $
+//
+// 1 5/05/11 12:05p Artems
+//
+//
+//*************************************************************************
+//<AMI_FHDR_START>
+//
+// Name: DevicePathFromText.h
+//
+// Description:
+// EFI_DEVICE_PATH_FROM_TEXT_PROTOCOL definition file
+//
+//<AMI_FHDR_END>
+//*************************************************************************
+#ifndef __DEVICE_PATH_FROM_TEXT_PROTOCOL__H__
+#define __DEVICE_PATH_FROM_TEXT_PROTOCOL__H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <EFI.h>
+#include <Protocol/DevicePath.h>
+
+
+#define EFI_DEVICE_PATH_FROM_TEXT_PROTOCOL_GUID \
+ { 0x5c99a21, 0xc70f, 0x4ad2, 0x8a, 0x5f, 0x35, 0xdf, 0x33, 0x43, 0xf5, 0x1e }
+
+GUID_VARIABLE_DECLARATION(gEfiDevicePathFromTextProtocolGuid, EFI_DEVICE_PATH_FROM_TEXT_PROTOCOL_GUID);
+
+
+typedef struct _EFI_DEVICE_PATH_FROM_TEXT_PROTOCOL EFI_DEVICE_PATH_FROM_TEXT_PROTOCOL;
+
+typedef
+EFI_DEVICE_PATH_PROTOCOL*
+(EFIAPI *EFI_DEVICE_PATH_FROM_TEXT_NODE) (
+ IN CONST CHAR16* TextDeviceNode
+);
+
+typedef
+EFI_DEVICE_PATH_PROTOCOL*
+(EFIAPI *EFI_DEVICE_PATH_FROM_TEXT_PATH) (
+ IN CONST CHAR16* TextDevicePath
+);
+
+struct _EFI_DEVICE_PATH_FROM_TEXT_PROTOCOL {
+ EFI_DEVICE_PATH_FROM_TEXT_NODE ConvertTextToDeviceNode;
+ EFI_DEVICE_PATH_FROM_TEXT_PATH ConvertTextToDevicePath;
+};
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
diff --git a/Include/Protocol/DevicePathToText.h b/Include/Protocol/DevicePathToText.h
new file mode 100644
index 0000000..4ce3726
--- /dev/null
+++ b/Include/Protocol/DevicePathToText.h
@@ -0,0 +1,98 @@
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
+
+//*************************************************************************
+// $Header: /Alaska/BIN/Core/Include/Protocol/DevicePathToText.h 2 6/13/11 6:18p Artems $
+//
+// $Revision: 2 $
+//
+// $Date: 6/13/11 6:18p $
+//*************************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Core/Include/Protocol/DevicePathToText.h $
+//
+// 2 6/13/11 6:18p Artems
+// Fixed bug in file header
+//
+// 1 5/05/11 12:05p Artems
+//
+//
+//*************************************************************************
+//<AMI_FHDR_START>
+//
+// Name: DevicePathToText.h
+//
+// Description:
+// EFI_DEVICE_PATH_TO_TEXT_PROTOCOL definition file
+//
+//<AMI_FHDR_END>
+//*************************************************************************
+#ifndef __DEVICE_PATH_TO_TEXT_PROTOCOL__H__
+#define __DEVICE_PATH_TO_TEXT_PROTOCOL__H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <EFI.h>
+#include <Protocol/DevicePath.h>
+
+#define EFI_DEVICE_PATH_TO_TEXT_PROTOCOL_GUID \
+ { 0x8b843e20, 0x8132, 0x4852, 0x90, 0xcc, 0x55, 0x1a, 0x4e, 0x4a, 0x7f, 0x1c }
+
+GUID_VARIABLE_DECLARATION(gEfiDevicePathToTextProtocolGuid, EFI_DEVICE_PATH_TO_TEXT_PROTOCOL_GUID);
+
+
+typedef struct _EFI_DEVICE_PATH_TO_TEXT_PROTOCOL EFI_DEVICE_PATH_TO_TEXT_PROTOCOL;
+
+typedef
+CHAR16*
+(EFIAPI *EFI_DEVICE_PATH_TO_TEXT_NODE) (
+ IN CONST EFI_DEVICE_PATH_PROTOCOL *DeviceNode,
+ IN BOOLEAN DisplayOnly,
+ IN BOOLEAN AllowShortcuts
+);
+
+typedef
+CHAR16*
+(EFIAPI *EFI_DEVICE_PATH_TO_TEXT_PATH) (
+ IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath,
+ IN BOOLEAN DisplayOnly,
+ IN BOOLEAN AllowShortcuts
+);
+
+struct _EFI_DEVICE_PATH_TO_TEXT_PROTOCOL {
+ EFI_DEVICE_PATH_TO_TEXT_NODE ConvertDeviceNodeToText;
+ EFI_DEVICE_PATH_TO_TEXT_PATH ConvertDevicePathToText;
+};
+
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
diff --git a/Include/Protocol/DevicePathUtilities.h b/Include/Protocol/DevicePathUtilities.h
new file mode 100644
index 0000000..74c0706
--- /dev/null
+++ b/Include/Protocol/DevicePathUtilities.h
@@ -0,0 +1,113 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2006, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/BIN/Core/Include/Protocol/DevicePathUtilities.h 1 10/12/06 6:43p Felixp $
+//
+// $Revision: 1 $
+//
+// $Date: 10/12/06 6:43p $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Core/Include/Protocol/DevicePathUtilities.h $
+//
+// 1 10/12/06 6:43p Felixp
+//
+//**********************************************************************
+//<AMI_FHDR_START>
+//
+// Name: DevicePathUtilities.h
+//
+// Description: EFI_DEVICE_PATH_UTILITIES_PROTOCOL protocol definition
+//
+//<AMI_FHDR_END>
+//**********************************************************************
+#ifndef __EFI_DEVICE_PATH_UTILITIES_PROTOCOL__H__
+#define __EFI_DEVICE_PATH_UTILITIES_PROTOCOL__H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+#include <EFI.h>
+
+#define EFI_DEVICE_PATH_UTILITIES_PROTOCOL_GUID \
+ {0x379be4e,0xd706,0x437d,0xb0,0x37,0xed,0xb8,0x2f,0xb7,0x72,0xa4}
+
+GUID_VARIABLE_DECLARATION(gEfiDevicePathUtilitiesProtocolGuid, EFI_DEVICE_PATH_UTILITIES_PROTOCOL_GUID);
+
+typedef UINTN (EFIAPI *EFI_DEVICE_PATH_UTILS_GET_DEVICE_PATH_SIZE)(
+ IN CONST EFI_DEVICE_PATH_PROTOCOL* DevicePath
+);
+
+typedef EFI_DEVICE_PATH_PROTOCOL* (EFIAPI *EFI_DEVICE_PATH_UTILS_DUP_DEVICE_PATH)(
+ IN CONST EFI_DEVICE_PATH_PROTOCOL* DevicePath
+);
+
+typedef EFI_DEVICE_PATH_PROTOCOL* (EFIAPI *EFI_DEVICE_PATH_UTILS_APPEND_PATH)(
+ IN CONST EFI_DEVICE_PATH_PROTOCOL* Src1,
+ IN CONST EFI_DEVICE_PATH_PROTOCOL* Src2
+);
+
+typedef EFI_DEVICE_PATH_PROTOCOL* (EFIAPI *EFI_DEVICE_PATH_UTILS_APPEND_NODE)(
+ IN CONST EFI_DEVICE_PATH_PROTOCOL* DevicePath,
+ IN CONST EFI_DEVICE_PATH_PROTOCOL* DeviceNode
+);
+
+typedef EFI_DEVICE_PATH_PROTOCOL* (EFIAPI *EFI_DEVICE_PATH_UTILS_APPEND_INSTANCE)(
+ IN CONST EFI_DEVICE_PATH_PROTOCOL* DevicePath,
+ IN CONST EFI_DEVICE_PATH_PROTOCOL* DevicePathInstance
+);
+
+typedef EFI_DEVICE_PATH_PROTOCOL* (EFIAPI *EFI_DEVICE_PATH_UTILS_GET_NEXT_INSTANCE)(
+ IN OUT EFI_DEVICE_PATH_PROTOCOL **DevicePathInstance,
+ OUT UINTN *DevicePathInstanceSize
+);
+
+typedef EFI_DEVICE_PATH_PROTOCOL* (EFIAPI *EFI_DEVICE_PATH_UTILS_CREATE_NODE)(
+ IN UINT8 NodeType, IN UINT8 NodeSubType,
+ IN UINT16 NodeLength
+);
+
+typedef BOOLEAN (EFIAPI *EFI_DEVICE_PATH_UTILS_IS_MULTI_INSTANCE)(
+ IN CONST EFI_DEVICE_PATH_PROTOCOL* DevicePath
+);
+
+typedef struct _EFI_DEVICE_PATH_UTILITIES_PROTOCOL{
+ EFI_DEVICE_PATH_UTILS_GET_DEVICE_PATH_SIZE GetDevicePathSize;
+ EFI_DEVICE_PATH_UTILS_DUP_DEVICE_PATH DuplicateDevicePath;
+ EFI_DEVICE_PATH_UTILS_APPEND_PATH AppendDevicePath;
+ EFI_DEVICE_PATH_UTILS_APPEND_NODE AppendDeviceNode;
+ EFI_DEVICE_PATH_UTILS_APPEND_INSTANCE AppendDevicePathInstance;
+ EFI_DEVICE_PATH_UTILS_GET_NEXT_INSTANCE GetNextDevicePathInstance;
+ EFI_DEVICE_PATH_UTILS_IS_MULTI_INSTANCE IsDevicePathMultiInstance;
+ EFI_DEVICE_PATH_UTILS_CREATE_NODE CreateDeviceNode;
+} EFI_DEVICE_PATH_UTILITIES_PROTOCOL;
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2006, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//********************************************************************** \ No newline at end of file
diff --git a/Include/Protocol/DiskIo.h b/Include/Protocol/DiskIo.h
new file mode 100644
index 0000000..c06b811
--- /dev/null
+++ b/Include/Protocol/DiskIo.h
@@ -0,0 +1,160 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2005, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/BIN/Core/Include/Protocol/DiskIo.h 4 4/20/07 3:47p Robert $
+//
+// $Revision: 4 $
+//
+// $Date: 4/20/07 3:47p $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Core/Include/Protocol/DiskIo.h $
+//
+// 4 4/20/07 3:47p Robert
+// Updated File header for Coding standard compliance
+//
+// 3 3/13/06 1:40a Felixp
+//
+// 2 3/04/05 10:34a Mandal
+//
+// 1 1/28/05 12:44p Felixp
+//
+// 2 1/18/05 3:22p Felixp
+// PrintDebugMessage renamed to Trace
+//
+// 1 12/23/04 9:41a Felixp
+//
+// 1 8/19/04 6:26p Robert
+//
+// 1 1/26/04 3:25p Markw
+//
+//**********************************************************************
+//<AMI_FHDR_START>
+//
+// Name: DiskIo.h
+//
+// Description: Contains Function Prototypes and Data Structures for
+// the DiskIo Protocol
+//
+//<AMI_FHDR_END>
+//**********************************************************************
+#ifndef __DISK_IO_PROTOCOL_H__
+#define __DISK_IO_PROTOCOL_H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+#include <EFI.h>
+
+#define EFI_DISK_IO_PROTOCOL_GUID \
+ { 0xCE345171, 0xBA0B, 0x11d2, 0x8e, 0x4F, 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b }
+
+GUID_VARIABLE_DECLARATION(gEfiDiskIoProtocolGuid, EFI_DISK_IO_PROTOCOL_GUID);
+
+#define EFI_DISK_IO_PROTOCOL_REVISION 0x00010000
+
+
+typedef struct _EFI_DISK_IO_PROTOCOL EFI_DISK_IO_PROTOCOL;
+
+
+//=============================================================================
+// Function Prototypes
+
+//=============================================================================
+// Function: ReadDisk
+//
+// Description: rreads the number of bytes specified by BufferSize from the device
+//
+// Inputs:
+// This - Indicates a pointer to the calling context.
+// MediaId - ID of the medium to be read.
+// Offset - The starting byte offset on the logical block I/O device to read from.
+// BufferSize - The size in bytes of Buffer. The number of bytes to read from
+// the device.
+//
+// Outputs: Returns EFI_STATUS
+// Buffer - A pointer to the destination buffer for the data. The caller is responsible
+// for either having implicit or explicit ownership of the buffer.
+//
+// Notes:
+//
+//=============================================================================
+typedef EFI_STATUS (*EFI_DISK_READ) (
+ IN EFI_DISK_IO_PROTOCOL *This,
+ IN UINT32 MediaId,
+ IN UINT64 Offset,
+ IN UINTN BufferSize,
+ OUT VOID *Buffer
+ );
+
+
+
+//=============================================================================
+// Function: WriteDisk
+//
+// Description: writes the number of bytes specified by BufferSize to the device
+//
+// Inputs:
+// This - Indicates a pointer to the calling context.
+// MediaId - ID of the medium to be read.
+// Offset - The starting byte offset on the logical block I/O device to read from.
+// BufferSize - The size in bytes of Buffer. The number of bytes to read from
+// the device.
+// Buffer - A pointer to the destination buffer for the data. The caller is responsible
+// for either having implicit or explicit ownership of the buffer.
+//
+// Outputs: Returns EFI_STATUS
+//
+// Notes:
+//
+//=============================================================================
+typedef EFI_STATUS (*EFI_DISK_WRITE) (
+ IN EFI_DISK_IO_PROTOCOL *This,
+ IN UINT32 MediaId,
+ IN UINT64 Offset,
+ IN UINTN BufferSize,
+ IN VOID *Buffer
+ );
+
+
+
+//=============================================================================
+// Protocol Definition
+typedef struct _EFI_DISK_IO_PROTOCOL {
+ UINT64 Revision;
+ EFI_DISK_READ ReadDisk;
+ EFI_DISK_WRITE WriteDisk;
+ } EFI_DISK_IO_PROTOCOL;
+
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2005, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
diff --git a/Include/Protocol/DriverBinding.h b/Include/Protocol/DriverBinding.h
new file mode 100644
index 0000000..5a5ff80
--- /dev/null
+++ b/Include/Protocol/DriverBinding.h
@@ -0,0 +1,111 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2005, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/BIN/Core/Include/Protocol/DriverBinding.h 3 3/13/06 1:40a Felixp $
+//
+// $Revision: 3 $
+//
+// $Date: 3/13/06 1:40a $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Core/Include/Protocol/DriverBinding.h $
+//
+// 3 3/13/06 1:40a Felixp
+//
+// 2 3/04/05 10:34a Mandal
+//
+// 1 1/28/05 12:44p Felixp
+//
+// 2 1/18/05 3:22p Felixp
+// PrintDebugMessage renamed to Trace
+//
+// 1 12/23/04 9:41a Felixp
+//
+// 3 12/02/04 10:32a Markw
+// Added DevicePath include.
+//
+// 2 3/13/04 5:13p Felixp
+//
+// 1 3/13/04 4:36p Felixp
+//
+//**********************************************************************
+//<AMI_FHDR_START>
+//
+// Name: DriverBinging.h
+//
+// Description: EFI_DRIVER_BINDING Protocol Definition.
+//
+//<AMI_FHDR_END>
+//**********************************************************************
+#ifndef __DRIVER_BINDING_PROTOCOL_H__
+#define __DRIVER_BINDING_PROTOCOL_H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+#include <EFI.h>
+
+#define EFI_DRIVER_BINDING_PROTOCOL_GUID \
+ {0x18A031AB,0xB443,0x4D1A,0xA5,0xC0,0x0C,0x09,0x26,0x1E,0x9F,0x71}
+
+GUID_VARIABLE_DECLARATION(gEfiDriverBindingProtocolGuid, EFI_DRIVER_BINDING_PROTOCOL_GUID);
+
+typedef struct _EFI_DRIVER_BINDING_PROTOCOL EFI_DRIVER_BINDING_PROTOCOL;
+
+typedef EFI_STATUS (EFIAPI *EFI_DRIVER_BINDING_PROTOCOL_SUPPORTED) (
+ IN EFI_DRIVER_BINDING_PROTOCOL *This,
+ IN EFI_HANDLE ControllerHandle,
+ IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL
+);
+
+typedef EFI_STATUS (EFIAPI *EFI_DRIVER_BINDING_PROTOCOL_START) (
+ IN EFI_DRIVER_BINDING_PROTOCOL *This,
+ IN EFI_HANDLE ControllerHandle,
+ IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL
+);
+
+typedef EFI_STATUS (EFIAPI *EFI_DRIVER_BINDING_PROTOCOL_STOP) (
+ IN EFI_DRIVER_BINDING_PROTOCOL *This,
+ IN EFI_HANDLE ControllerHandle,
+ IN UINTN NumberOfChildren,
+ IN EFI_HANDLE *ChildHandleBuffer OPTIONAL
+);
+
+struct _EFI_DRIVER_BINDING_PROTOCOL {
+ EFI_DRIVER_BINDING_PROTOCOL_SUPPORTED Supported;
+ EFI_DRIVER_BINDING_PROTOCOL_START Start;
+ EFI_DRIVER_BINDING_PROTOCOL_STOP Stop;
+ UINT32 Version;
+ EFI_HANDLE ImageHandle;
+ EFI_HANDLE DriverBindingHandle;
+};
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2005, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
diff --git a/Include/Protocol/DriverDiagnostics2.h b/Include/Protocol/DriverDiagnostics2.h
new file mode 100644
index 0000000..a059e7f
--- /dev/null
+++ b/Include/Protocol/DriverDiagnostics2.h
@@ -0,0 +1,99 @@
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
+
+//*************************************************************************
+// $Header: /Alaska/BIN/Core/Include/Protocol/DriverDiagnostics2.h 1 4/21/11 12:53p Artems $
+//
+// $Revision: 1 $
+//
+// $Date: 4/21/11 12:53p $
+//*************************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Core/Include/Protocol/DriverDiagnostics2.h $
+//
+// 1 4/21/11 12:53p Artems
+//
+//
+//*************************************************************************
+//<AMI_FHDR_START>
+//
+// Name: DriverDiagnostics2.h
+//
+// Description:
+// EFI_DRIVER_DIAGNOSTICS2_PROTOCOL definition file
+//
+//<AMI_FHDR_END>
+//*************************************************************************
+#ifndef __DRIVER_DIAGNOSTICS2_PROTOCOL__H__
+#define __DRIVER_DIAGNOSTICS2_PROTOCOL__H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <EFI.h>
+
+#define EFI_DRIVER_DIAGNOSTICS_PROTOCOL_GUID \
+ { 0x4d330321, 0x025f, 0x4aac, 0x90, 0xd8, 0x5e, 0xd9, 0x00, 0x17, 0x3b, 0x63 }
+
+GUID_VARIABLE_DECLARATION(gEfiDriverDiagnostics2ProtocolGuid, EFI_DRIVER_DIAGNOSTICS_PROTOCOL_GUID);
+
+
+typedef struct _EFI_DRIVER_DIAGNOSTICS2_PROTOCOL EFI_DRIVER_DIAGNOSTICS2_PROTOCOL;
+
+typedef enum {
+ EfiDriverDiagnosticTypeStandard = 0,
+ EfiDriverDiagnosticTypeExtended = 1,
+ EfiDriverDiagnosticTypeManufacturing = 2,
+ EfiDriverDiagnosticTypeMaximum
+} EFI_DRIVER_DIAGNOSTIC_TYPE;
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_DRIVER_DIAGNOSTICS2_RUN_DIAGNOSTICS) (
+ IN EFI_DRIVER_DIAGNOSTICS2_PROTOCOL *This,
+ IN EFI_HANDLE ControllerHandle,
+ IN EFI_HANDLE ChildHandle OPTIONAL,
+ IN EFI_DRIVER_DIAGNOSTIC_TYPE DiagnosticType,
+ IN CHAR8 *Language,
+ OUT EFI_GUID **ErrorType,
+ OUT UINTN *BufferSize,
+ OUT CHAR16 **Buffer
+);
+
+
+struct _EFI_DRIVER_DIAGNOSTICS2_PROTOCOL {
+ EFI_DRIVER_DIAGNOSTICS2_RUN_DIAGNOSTICS RunDiagnostics;
+ CHAR8 *SupportedLanguages;
+};
+
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
diff --git a/Include/Protocol/DriverFamilyOverride.h b/Include/Protocol/DriverFamilyOverride.h
new file mode 100644
index 0000000..1a38165
--- /dev/null
+++ b/Include/Protocol/DriverFamilyOverride.h
@@ -0,0 +1,82 @@
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
+
+//*************************************************************************
+// $Header: /Alaska/BIN/Core/Include/Protocol/DriverFamilyOverride.h 1 4/22/11 6:45p Artems $
+//
+// $Revision: 1 $
+//
+// $Date: 4/22/11 6:45p $
+//*************************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Core/Include/Protocol/DriverFamilyOverride.h $
+//
+// 1 4/22/11 6:45p Artems
+//
+//*************************************************************************
+//<AMI_FHDR_START>
+//
+// Name: DriverFamilyOverride.h
+//
+// Description:
+// EFI_DRIVER_FAMILY_OVERRIDE_PROTOCOL definition file
+//
+//<AMI_FHDR_END>
+//*************************************************************************
+#ifndef __DRIVER_FAMILY_OVERRIDE_PROTOCOL__H__
+#define __DRIVER_FAMILY_OVERRIDE_PROTOCOL__H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <EFI.h>
+
+#define EFI_DRIVER_FAMILY_OVERRIDE_PROTOCOL_GUID \
+ {0xb1ee129e, 0xda36, 0x4181, 0x91, 0xf8, 0x4, 0xa4, 0x92, 0x37, 0x66, 0xa7 }
+
+GUID_VARIABLE_DECLARATION(gEfiDriverFamilyOverrideProtocolGuid, EFI_DRIVER_FAMILY_OVERRIDE_PROTOCOL_GUID);
+
+
+typedef struct _EFI_DRIVER_FAMILY_OVERRIDE_PROTOCOL EFI_DRIVER_FAMILY_OVERRIDE_PROTOCOL;
+
+typedef
+UINT32
+(EFIAPI *EFI_DRIVER_FAMILY_OVERRIDE_GET_VERSION) (
+ IN EFI_DRIVER_FAMILY_OVERRIDE_PROTOCOL *This
+);
+
+struct _EFI_DRIVER_FAMILY_OVERRIDE_PROTOCOL {
+ EFI_DRIVER_FAMILY_OVERRIDE_GET_VERSION GetVersion;
+};
+
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
diff --git a/Include/Protocol/DriverHealth.h b/Include/Protocol/DriverHealth.h
new file mode 100644
index 0000000..a4fd13b
--- /dev/null
+++ b/Include/Protocol/DriverHealth.h
@@ -0,0 +1,120 @@
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
+
+//*************************************************************************
+// $Header: /Alaska/BIN/Core/Include/Protocol/DriverHealth.h 1 4/21/11 12:53p Artems $
+//
+// $Revision: 1 $
+//
+// $Date: 4/21/11 12:53p $
+//*************************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Core/Include/Protocol/DriverHealth.h $
+//
+// 1 4/21/11 12:53p Artems
+//
+//*************************************************************************
+//<AMI_FHDR_START>
+//
+// Name: DriverHealth.h
+//
+// Description:
+// EFI_DRIVER_HEALTH_PROTOCOL definition file
+//
+//<AMI_FHDR_END>
+//*************************************************************************
+#ifndef __DRIVER_HEALTH_PROTOCOL__H__
+#define __DRIVER_HEALTH_PROTOCOL__H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <EFI.h>
+#include <UefiHii.h>
+
+#define EFI_DRIVER_HEALTH_PROTOCOL_GUID \
+ { 0x2a534210, 0x9280, 0x41d8, 0xae, 0x79, 0xca, 0xda, 0x1, 0xa2, 0xb1, 0x27 }
+
+GUID_VARIABLE_DECLARATION(gEfiDriverHealthProtocolGuid, EFI_DRIVER_HEALTH_PROTOCOL_GUID);
+
+
+typedef struct _EFI_DRIVER_HEALTH_PROTOCOL EFI_DRIVER_HEALTH_PROTOCOL;
+
+typedef enum {
+ EfiDriverHealthStatusHealthy,
+ EfiDriverHealthStatusRepairRequired,
+ EfiDriverHealthStatusConfigurationRequired,
+ EfiDriverHealthStatusFailed,
+ EfiDriverHealthStatusReconnectRequired,
+ EfiDriverHealthStatusRebootRequired
+} EFI_DRIVER_HEALTH_STATUS;
+
+typedef struct {
+ EFI_HII_HANDLE HiiHandle;
+ EFI_STRING_ID StringId;
+ UINT64 Reserved;
+} EFI_DRIVER_HEALTH_HII_MESSAGE;
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_DRIVER_HEALTH_REPAIR_NOTIFY) (
+ IN UINTN Value,
+ IN UINTN Limit
+);
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_DRIVER_HEALTH_GET_HEALTH_STATUS) (
+ IN EFI_DRIVER_HEALTH_PROTOCOL *This,
+ IN EFI_HANDLE ControllerHandle, OPTIONAL
+ IN EFI_HANDLE ChildHandle, OPTIONAL
+ OUT EFI_DRIVER_HEALTH_STATUS *HealthStatus,
+ OUT EFI_DRIVER_HEALTH_HII_MESSAGE **MessageList, OPTIONAL
+ OUT EFI_HII_HANDLE *FormHiiHandle OPTIONAL
+);
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_DRIVER_HEALTH_REPAIR) (
+ IN EFI_DRIVER_HEALTH_PROTOCOL *This,
+ IN EFI_HANDLE ControllerHandle,
+ IN EFI_HANDLE ChildHandle, OPTIONAL
+ IN EFI_DRIVER_HEALTH_REPAIR_NOTIFY RepairNotify OPTIONAL
+);
+
+struct _EFI_DRIVER_HEALTH_PROTOCOL {
+ EFI_DRIVER_HEALTH_GET_HEALTH_STATUS GetHealthStatus;
+ EFI_DRIVER_HEALTH_REPAIR Repair;
+};
+
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
diff --git a/Include/Protocol/DxeSmmReadyToLock.h b/Include/Protocol/DxeSmmReadyToLock.h
new file mode 100644
index 0000000..a32ba0a
--- /dev/null
+++ b/Include/Protocol/DxeSmmReadyToLock.h
@@ -0,0 +1,72 @@
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+
+//*************************************************************************
+//**********************************************************************
+// $Header: /Alaska/SOURCE/Modules/SMM/DxeSmmReadyToLock.h 1 6/22/11 11:54a Markw $
+//
+// $Revision: 1 $
+//
+// $Date: 6/22/11 11:54a $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/SOURCE/Modules/SMM/DxeSmmReadyToLock.h $
+//
+// 1 6/22/11 11:54a Markw
+//
+// 6 1/13/10 2:13p Felixp
+//
+//**********************************************************************
+//<AMI_FHDR_START>
+//
+// Name: DxeSmmReadyToLock.h
+//
+// Description: DxeSmmReadyToLock protocol definition
+//
+//<AMI_FHDR_END>
+//**********************************************************************
+
+#ifndef __DXE_SMM_READY_TO_LOCK__H__
+#define __DXE_SMM_READY_TO_LOCK__H__
+#if PI_SPECIFICATION_VERSION >= 0x0001000A
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define EFI_DXE_SMM_READY_TO_LOCK_PROTOCOL_GUID \
+ {0x60ff8964, 0xe906, 0x41d0, 0xaf, 0xed, 0xf2, 0x41, 0xe9, 0x74, 0xe0, 0x8e }
+
+GUID_VARIABLE_DECLARATION(gEfiDxeSmmReadyToLockProtocolGuid,EFI_DXE_SMM_READY_TO_LOCK_PROTOCOL_GUID);
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+#endif
+
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
diff --git a/Include/Protocol/EBC.h b/Include/Protocol/EBC.h
new file mode 100644
index 0000000..59f57d8
--- /dev/null
+++ b/Include/Protocol/EBC.h
@@ -0,0 +1,106 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2005, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/BIN/Core/Include/Protocol/EBC.h 3 3/13/06 1:40a Felixp $
+//
+// $Revision: 3 $
+//
+// $Date: 3/13/06 1:40a $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Core/Include/Protocol/EBC.h $
+//
+// 3 3/13/06 1:40a Felixp
+//
+// 2 3/04/05 10:34a Mandal
+//
+// 1 1/28/05 12:44p Felixp
+//
+// 2 1/18/05 3:22p Felixp
+// PrintDebugMessage renamed to Trace
+//
+// 1 12/23/04 9:41a Felixp
+//
+// 1 8/22/04 11:23p Felixp
+//
+//**********************************************************************
+//<AMI_FHDR_START>
+//
+// Name: EBC.h
+//
+// Description: EBC Protocol definition
+//
+//<AMI_FHDR_END>
+//**********************************************************************
+#ifndef __EBC_PROTOCOL__H__
+#define __EBC_PROTOCOL__H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+#include <EFI.h>
+
+#define EFI_EBC_PROTOCOL_GUID \
+ {0x13AC6DD1,0x73D0,0x11D4,0xB0,0x6B,0x00,0xAA,0x00,0xBD,0x6D,0xE7}
+
+GUID_VARIABLE_DECLARATION(gEfiEbcProtocolGuid, EFI_EBC_PROTOCOL_GUID );
+
+typedef struct _EFI_EBC_PROTOCOL EFI_EBC_PROTOCOL;
+
+typedef EFI_STATUS (EFIAPI *EFI_EBC_CREATE_THUNK) (
+ IN EFI_EBC_PROTOCOL *This, IN EFI_HANDLE ImageHandle,
+ IN VOID *EbcEntryPoint, OUT VOID **Thunk
+);
+
+typedef EFI_STATUS (EFIAPI *EFI_EBC_UNLOAD_IMAGE) (
+ IN EFI_EBC_PROTOCOL *This, IN EFI_HANDLE ImageHandle
+);
+
+typedef EFI_STATUS (* EBC_ICACHE_FLUSH) (
+ IN EFI_PHYSICAL_ADDRESS Start, IN UINT64 Length
+);
+
+typedef EFI_STATUS (* EFI_EBC_REGISTER_ICACHE_FLUSH) (
+ IN EFI_EBC_PROTOCOL *This, IN EBC_ICACHE_FLUSH Flush
+);
+
+typedef EFI_STATUS (* EFI_EBC_GET_VERSION) (
+ IN EFI_EBC_PROTOCOL *This, OUT UINT64 *Version
+);
+
+struct _EFI_EBC_PROTOCOL {
+ EFI_EBC_CREATE_THUNK CreateThunk;
+ EFI_EBC_UNLOAD_IMAGE UnloadImage;
+ EFI_EBC_REGISTER_ICACHE_FLUSH RegisterICacheFlush;
+ EFI_EBC_GET_VERSION GetVersion;
+};
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2005, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
diff --git a/Include/Protocol/EdidActive.h b/Include/Protocol/EdidActive.h
new file mode 100644
index 0000000..2090424
--- /dev/null
+++ b/Include/Protocol/EdidActive.h
@@ -0,0 +1,70 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2006, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/BIN/Core/Include/Protocol/EdidActive.h 1 12/20/06 1:45p Felixp $
+//
+// $Revision: 1 $
+//
+// $Date: 12/20/06 1:45p $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Core/Include/Protocol/EdidActive.h $
+//
+// 1 12/20/06 1:45p Felixp
+//
+//**********************************************************************
+//<AMI_FHDR_START>
+//
+// Name: EdidActive.h
+//
+// Description: EFI_EDID_ACTIVE_PROTOCOL protocol declaration
+//
+//<AMI_FHDR_END>
+//**********************************************************************
+#ifndef __EFI_EDID_ACTIVE_PROTOCOL__H__
+#define __EFI_EDID_ACTIVE_PROTOCOL__H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define EFI_EDID_ACTIVE_PROTOCOL_GUID \
+ { 0xbd8c1056, 0x9f36, 0x44ec, 0x92, 0xa8, 0xa6, 0x33, 0x7f, 0x81, 0x79, 0x86 }
+
+GUID_VARIABLE_DECLARATION (gEfiEdidActiveProtocolGuid, EFI_EDID_ACTIVE_PROTOCOL_GUID);
+
+typedef struct {
+ UINT32 SizeOfEdid;
+ UINT8 *Edid;
+} EFI_EDID_ACTIVE_PROTOCOL;
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2006, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//********************************************************************** \ No newline at end of file
diff --git a/Include/Protocol/EdidDiscovered.h b/Include/Protocol/EdidDiscovered.h
new file mode 100644
index 0000000..6182e8b
--- /dev/null
+++ b/Include/Protocol/EdidDiscovered.h
@@ -0,0 +1,70 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2006, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/BIN/Core/Include/Protocol/EdidDiscovered.h 1 12/20/06 1:45p Felixp $
+//
+// $Revision: 1 $
+//
+// $Date: 12/20/06 1:45p $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Core/Include/Protocol/EdidDiscovered.h $
+//
+// 1 12/20/06 1:45p Felixp
+//
+//**********************************************************************
+//<AMI_FHDR_START>
+//
+// Name: EdidDiscovered.h
+//
+// Description: EFI_EDID_DISCOVERED_PROTOCOL protocol declaration
+//
+//<AMI_FHDR_END>
+//**********************************************************************
+#ifndef __EFI_EDID_DISCOVERED_PROTOCOL__H__
+#define __EFI_EDID_DISCOVERED_PROTOCOL__H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define EFI_EDID_DISCOVERED_PROTOCOL_GUID \
+ { 0x1c0c34f6, 0xd380, 0x41fa, 0xa0, 0x49, 0x8a, 0xd0, 0x6c,0x1a, 0x66, 0xaa }
+
+GUID_VARIABLE_DECLARATION (gEfiEdidDiscoveredProtocolGuid, EFI_EDID_DISCOVERED_PROTOCOL_GUID);
+
+typedef struct {
+ UINT32 SizeOfEdid;
+ UINT8 *Edid;
+} EFI_EDID_DISCOVERED_PROTOCOL;
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2006, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//********************************************************************** \ No newline at end of file
diff --git a/Include/Protocol/EdidOverride.h b/Include/Protocol/EdidOverride.h
new file mode 100644
index 0000000..8936842
--- /dev/null
+++ b/Include/Protocol/EdidOverride.h
@@ -0,0 +1,84 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2012, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/Projects/Intel/Haswell/LynxPoint_SharkBay-DT_Crb_1AQQW/Include/Protocol/EdidOverride.h 1 10/30/13 6:44a Ireneyang $
+//
+// $Revision: 1 $
+//
+// $Date: 10/30/13 6:44a $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/Projects/Intel/Haswell/LynxPoint_SharkBay-DT_Crb_1AQQW/Include/Protocol/EdidOverride.h $
+//
+// 1 10/30/13 6:44a Ireneyang
+// -Fix no display in Win8. It would have a compiler error when
+// enableing token "OEM_EDID_OVERRIDE_PROTOCOL_SUPPORT".
+//
+//**********************************************************************
+//<AMI_FHDR_START>
+//
+// Name: EdidOverride.h
+//
+// Description: EFI_EDID_OVERRIDE_PROTOCOL protocol declaration
+//
+//<AMI_FHDR_END>
+//**********************************************************************
+#ifndef __EFI_EDID_OVERRIDE_PROTOCOL__H__
+#define __EFI_EDID_OVERRIDE_PROTOCOL__H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define EFI_EDID_OVERRIDE_PROTOCOL_GUID \
+ { 0x48ecb431, 0xfb72, 0x45c0, 0xa9, 0x22, 0xf4, 0x58, 0xfe, 0x4, 0xb, 0xd5 }
+
+GUID_VARIABLE_DECLARATION (gEfiEdidOverrideProtocolGuid, EFI_EDID_OVERRIDE_PROTOCOL_GUID);
+
+#define EFI_EDID_OVERRIDE_DONT_OVERRIDE 0x01
+#define EFI_EDID_OVERRIDE_ENABLE_HOT_PLUG 0x02
+
+typedef struct _EFI_EDID_OVERRIDE_PROTOCOL EFI_EDID_OVERRIDE_PROTOCOL;
+
+typedef EFI_STATUS (EFIAPI *EFI_EDID_OVERRIDE_PROTOCOL_GET_EDID) (
+ IN EFI_EDID_OVERRIDE_PROTOCOL *This,
+ IN EFI_HANDLE *ChildHandle,
+ OUT UINT32 *Attributes,
+ IN OUT UINTN *EdidSize,
+ IN OUT UINT8 **Edid
+ );
+
+typedef struct _EFI_EDID_OVERRIDE_PROTOCOL {
+ EFI_EDID_OVERRIDE_PROTOCOL_GET_EDID GetEdid;
+} EFI_EDID_OVERRIDE_PROTOCOL;
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2012, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//********************************************************************** \ No newline at end of file
diff --git a/Include/Protocol/EfiOemBadging.h b/Include/Protocol/EfiOemBadging.h
new file mode 100644
index 0000000..9860bca
--- /dev/null
+++ b/Include/Protocol/EfiOemBadging.h
@@ -0,0 +1,101 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2007, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/BIN/Core/Include/Protocol/EfiOemBadging.h 1 8/31/07 11:58a Felixp $
+//
+// $Revision: 1 $
+//
+// $Date: 8/31/07 11:58a $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Core/Include/Protocol/EfiOemBadging.h $
+//
+// 1 8/31/07 11:58a Felixp
+//
+//**********************************************************************
+//<AMI_FHDR_START>
+//
+// Name: EfiOemBadging.h
+//
+// Description: OEM Badging protocol definition
+//
+//<AMI_FHDR_END>
+//**********************************************************************
+#ifndef __OEM_BADGING_PROTOCOL__H__
+#define __OEM_BADGING_PROTOCOL__H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+#include <EFI.h>
+
+#define EFI_OEM_BADGING_PROTOCOL_GUID \
+ { 0x170e13c0, 0xbf1b, 0x4218, 0x87, 0x1d, 0x2a, 0xbd, 0xc6, 0xf8, 0x87, 0xbc }
+
+GUID_VARIABLE_DECLARATION(gEfiOEMBadgingProtocolGuid, EFI_OEM_BADGING_PROTOCOL_GUID);
+
+typedef struct _EFI_OEM_BADGING_PROTOCOL EFI_OEM_BADGING_PROTOCOL;
+
+typedef enum {
+ EfiBadgingFormatBMP,
+ EfiBadgingFormatJPEG,
+ EfiBadgingFormatTIFF,
+ EfiBadgingFormatGIF,
+ EfiBadgingFormatUnknown
+} EFI_BADGING_FORMAT;
+
+typedef enum {
+ EfiBadgingDisplayAttributeLeftTop,
+ EfiBadgingDisplayAttributeCenterTop,
+ EfiBadgingDisplayAttributeRightTop,
+ EfiBadgingDisplayAttributeCenterRight,
+ EfiBadgingDisplayAttributeRightBottom,
+ EfiBadgingDisplayAttributeCenterBottom,
+ EfiBadgingDisplayAttributeLeftBottom,
+ EfiBadgingDisplayAttributeCenterLeft,
+ EfiBadgingDisplayAttributeCenter,
+ EfiBadgingDisplayAttributeCustomized
+} EFI_BADGING_DISPLAY_ATTRIBUTE;
+
+typedef EFI_STATUS (EFIAPI *EFI_BADGING_GET_IMAGE) (
+ IN EFI_OEM_BADGING_PROTOCOL *This,
+ IN OUT UINT32 *Instance, OUT EFI_BADGING_FORMAT *Format,
+ OUT UINT8 **ImageData, OUT UINTN *ImageSize,
+ OUT EFI_BADGING_DISPLAY_ATTRIBUTE *Attribute,
+ OUT UINTN *CoordinateX, OUT UINTN *CoordinateY
+);
+
+struct _EFI_OEM_BADGING_PROTOCOL {
+ EFI_BADGING_GET_IMAGE GetImage;
+};
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2007, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
diff --git a/Include/Protocol/Emul6064KbdInput.h b/Include/Protocol/Emul6064KbdInput.h
new file mode 100644
index 0000000..4e7facf
--- /dev/null
+++ b/Include/Protocol/Emul6064KbdInput.h
@@ -0,0 +1,93 @@
+//****************************************************************************
+//****************************************************************************
+//** **
+//** (C)Copyright 1985-2010, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Pkwy, Suite 200 Norcross, GA 30093 **
+//** **
+//** Phone (770)-246-8600 **
+//** **
+//****************************************************************************
+//****************************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/SOURCE/Modules/USB/ALASKA/Protocol/Emul6064KbdInput.h 4 6/28/10 5:24p Olegi $
+//
+// $Revision: 4 $
+//
+// $Date: 6/28/10 5:24p $
+//
+//**********************************************************************
+
+//<AMI_FHDR_START>
+//----------------------------------------------------------------------------
+//
+// Name: Emul6064KbdInput.h
+//
+// Description: Protocol used for USB 6064 keyboard emulation
+//
+//----------------------------------------------------------------------------
+//<AMI_FHDR_END>
+
+
+#ifndef _EMUL6064KBDINPUT_PROTOCOL_H_
+#define _EMUL6064KBDINPUT_PROTOCOL_H_
+
+EFI_FORWARD_DECLARATION (EFI_EMUL6064KBDINPUT_PROTOCOL);
+
+#define EFI_EMUL6064KBDINPUT_PROTOCOL_GUID \
+ { 0x62ceef5a, 0x1d7c, 0x4943, 0x9b, 0x3a, 0x95, 0xe2, 0x49, 0x4c, 0x89, 0x90 }
+
+typedef enum {
+ KBC_KBDTRANS_AT = 0, //NOT TRANSLATED (XLAT cleared in CCB)
+ KBC_KBDTRANS_PCXT = 1, //TRANSLATED (XLAT set in CCB)
+} KBC_KBDTRANSLATION;
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_EMUL6064KBDINPUT_PROTOCOL_SEND) (
+ IN EFI_EMUL6064KBDINPUT_PROTOCOL * This,
+ IN UINT8* data,
+ IN UINT32 count
+ );
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_EMUL6064KBDINPUT_PROTOCOL_GETTRANS) (
+ IN EFI_EMUL6064KBDINPUT_PROTOCOL * This,
+ OUT KBC_KBDTRANSLATION* outTrans
+ );
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_EMUL6064KBDINPUT_PROTOCOL_UPDATELEDSTATE) (
+ IN EFI_EMUL6064KBDINPUT_PROTOCOL * This,
+ IN UINT8 data
+ );
+
+
+typedef struct _EFI_EMUL6064KBDINPUT_PROTOCOL {
+ EFI_EMUL6064KBDINPUT_PROTOCOL_SEND Send ;
+ EFI_EMUL6064KBDINPUT_PROTOCOL_GETTRANS GetTranslation;
+ EFI_EMUL6064KBDINPUT_PROTOCOL_UPDATELEDSTATE UpdateLEDState;
+} EFI_EMUL6064KBDINPUT_PROTOCOL;
+
+extern EFI_GUID gEmul6064KbdInputProtocolGuid;
+
+#endif
+
+//****************************************************************************
+//****************************************************************************
+//** **
+//** (C)Copyright 1985-2010, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Pkwy, Suite 200 Norcross, GA 30093 **
+//** **
+//** Phone (770)-246-8600 **
+//** **
+//****************************************************************************
+//****************************************************************************
diff --git a/Include/Protocol/Emul6064MsInput.h b/Include/Protocol/Emul6064MsInput.h
new file mode 100644
index 0000000..ade138f
--- /dev/null
+++ b/Include/Protocol/Emul6064MsInput.h
@@ -0,0 +1,83 @@
+//****************************************************************************
+//****************************************************************************
+//** **
+//** (C)Copyright 1985-2010, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Pkwy, Suite 200 Norcross, GA 30093 **
+//** **
+//** Phone (770)-246-8600 **
+//** **
+//****************************************************************************
+//****************************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/SOURCE/Modules/USB/ALASKA/Protocol/Emul6064MsInput.h 4 6/28/10 5:24p Olegi $
+//
+// $Revision: 4 $
+//
+// $Date: 6/28/10 5:24p $
+//
+//**********************************************************************
+
+//<AMI_FHDR_START>
+//----------------------------------------------------------------------------
+//
+// Name: Emul6064MsInput.h
+//
+// Description: Protocol used for 6064 USB mouse emulation
+//
+//----------------------------------------------------------------------------
+//<AMI_FHDR_END>
+
+#ifndef _EMUL6064MSINPUT_PROTOCOL_H_
+#define _EMUL6064MSINPUT_PROTOCOL_H_
+
+EFI_FORWARD_DECLARATION (EFI_EMUL6064MSINPUT_PROTOCOL);
+
+#define EFI_EMUL6064MSINPUT_PROTOCOL_GUID \
+ { 0x7578b307, 0xb25b, 0x44f9, 0x89, 0x2e, 0x20, 0x9b, 0x0e, 0x39, 0x93, 0xc6 }
+
+#define PS2MSFLAGS_LBUTTON 0x01
+#define PS2MSFLAGS_RBUTTON 0x02
+#define PS2MSFLAGS_XSIGN 0x10
+#define PS2MSFLAGS_YSIGN 0x20
+#define PS2MSFLAGS_XO 0x40
+#define PS2MSFLAGS_YO 0x80
+
+typedef struct {
+ UINT8 flags;
+ UINT8 x;
+ UINT8 y;
+} PS2MouseData;
+
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_EMUL6064MSINPUT_PROTOCOL_SEND) (
+ IN EFI_EMUL6064MSINPUT_PROTOCOL * This,
+ IN PS2MouseData* data
+ );
+
+typedef struct _EFI_EMUL6064MSINPUT_PROTOCOL {
+ EFI_EMUL6064MSINPUT_PROTOCOL_SEND Send;
+} EFI_EMUL6064MSINPUT_PROTOCOL;
+
+extern EFI_GUID gEmul6064MsInputProtocolGuid;
+
+#endif
+
+//****************************************************************************
+//****************************************************************************
+//** **
+//** (C)Copyright 1985-2010, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Pkwy, Suite 200 Norcross, GA 30093 **
+//** **
+//** Phone (770)-246-8600 **
+//** **
+//****************************************************************************
+//****************************************************************************
diff --git a/Include/Protocol/Emul6064Trap.h b/Include/Protocol/Emul6064Trap.h
new file mode 100644
index 0000000..011458a
--- /dev/null
+++ b/Include/Protocol/Emul6064Trap.h
@@ -0,0 +1,115 @@
+//****************************************************************************
+//****************************************************************************
+//** **
+//** (C)Copyright 1985-2010, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Pkwy, Suite 200 Norcross, GA 30093 **
+//** **
+//** Phone (770)-246-8600 **
+//** **
+//****************************************************************************
+//****************************************************************************
+
+//****************************************************************************
+// $Header: /Alaska/SOURCE/Modules/USB/ALASKA/Protocol/Emul6064Trap.h 5 4/04/11 5:34a Ryanchou $
+//
+// $Revision: 5 $
+//
+// $Date: 4/04/11 5:34a $
+//
+//****************************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/SOURCE/Modules/USB/ALASKA/Protocol/Emul6064Trap.h $
+//
+// 5 4/04/11 5:34a Ryanchou
+// [TAG] EIP57534
+// [Category] Bug Fix
+// [Severity] Minor
+// [Symptom] BIOS rom image build process may stopped with error.
+// [RootCause] Has unnecessary semi-colon (;).
+// [Solution] Remove the unnecessary semi-colon.
+// [Files] Emul6064Trap.h
+//
+// 4 7/08/10 2:22a Rameshr
+// Ohci Emulation support Added.
+// EIP 39712
+//
+// 3 6/28/10 5:24p Olegi
+// EIP22197: Corrected headers/footers.
+//
+// 2 2/04/09 12:48p Olegi
+// Added NONSMMEMUL6064TRAP definitions.
+//
+// 1 12/17/07 2:46p Olegi
+//****************************************************************************
+
+//<AMI_FHDR_START>
+//----------------------------------------------------------------------------
+//
+// Name: Emul6064Trap.h
+//
+// Description: Protocol used for 6064 port trapping
+//
+//----------------------------------------------------------------------------
+//<AMI_FHDR_END>
+
+
+#ifndef _EMUL6064TRAP_PROTOCOL_H_
+#define _EMUL6064TRAP_PROTOCOL_H_
+
+EFI_FORWARD_DECLARATION (EFI_EMUL6064TRAP_PROTOCOL);
+
+#define EFI_EMUL6064TRAP_PROTOCOL_GUID \
+ { 0x6ea0f71c, 0x614a, 0x437e, 0x8f, 0x49, 0x24, 0x3a, 0xd4, 0xe8, 0x32, 0x68 }
+
+#define EFI_NONSMMEMUL6064TRAP_PROTOCOL_GUID \
+ { 0x68b81e51, 0x2583, 0x4582, 0x95, 0xdb, 0xc5, 0x72, 0x32, 0x36, 0xc4, 0xf1 }
+
+#define IRQ_SUPPORTED 0x0001
+
+typedef
+BOOLEAN
+(EFIAPI *EFI_EMUL6064TRAP_PROTOCOL_ENABLE) (
+ IN EFI_EMUL6064TRAP_PROTOCOL * This
+ );
+
+typedef
+BOOLEAN
+(EFIAPI *EFI_EMUL6064TRAP_PROTOCOL_DISABLE) (
+ IN EFI_EMUL6064TRAP_PROTOCOL * This
+ );
+
+typedef
+UINT32
+(EFIAPI *EFI_EMUL6064TRAP_PROTOCOL_FEATURE) (
+ IN EFI_EMUL6064TRAP_PROTOCOL * This
+ );
+
+
+typedef struct _EFI_EMUL6064TRAP_PROTOCOL {
+ EFI_EMUL6064TRAP_PROTOCOL_ENABLE TrapEnable;
+ EFI_EMUL6064TRAP_PROTOCOL_DISABLE TrapDisable;
+ EFI_EMUL6064TRAP_PROTOCOL_FEATURE FeatureSupported;
+} EFI_EMUL6064TRAP_PROTOCOL;
+
+extern EFI_GUID gEmul6064TrapProtocolGuid;
+extern EFI_GUID gNonSmmEmul6064TrapProtocolGuid;
+
+#endif
+
+//****************************************************************************
+//****************************************************************************
+//** **
+//** (C)Copyright 1985-2010, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Pkwy, Suite 200 Norcross, GA 30093 **
+//** **
+//** Phone (770)-246-8600 **
+//** **
+//****************************************************************************
+//****************************************************************************
diff --git a/Include/Protocol/ExtHii.h b/Include/Protocol/ExtHii.h
new file mode 100644
index 0000000..361817d
--- /dev/null
+++ b/Include/Protocol/ExtHii.h
@@ -0,0 +1,171 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2005, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/BIN/Core/Include/Protocol/ExtHii.h 6 12/29/09 1:17p Yakovlevs $Revision: 14 $
+//
+// $Date: 12/29/09 1:17p $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Core/Include/Protocol/ExtHii.h $
+//
+// 6 12/29/09 1:17p Yakovlevs
+//**********************************************************************
+
+//**********************************************************************
+//<AMI_FHDR_START>
+//
+// Name: Hii.h
+//
+// Description: This file defines the Extended Human Interface
+// Infrastructure protocol.
+//
+//<AMI_FHDR_END>
+//**********************************************************************
+#ifndef __EXT_HII_PROTOCOL_H__
+#define __EXT_HII_PROTOCOL_H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+/****** DO NOT WRITE ABOVE THIS LINE *******/
+#if EFI_SPECIFICATION_VERSION>0x20000 && !defined(GUID_VARIABLE_DEFINITION)
+#pragma message("The EXT_HII_PROTOCOL protocol is only supported for the UEFI 2.0 projects")
+#pragma message("The supported version of the UEFI specification is defined by the EFI_SPECIFICATION_VERSION SDL token")
+#error the protocol is depricated
+#else
+//======================================================================
+#include <EFI.h>
+
+#define EFI_HII_EXT_PROTOCOL_GUID \
+ { 0x2a57ae75, 0x8b7a, 0x4c64, 0x86, 0x56, 0xdb, 0x51, 0xdd, 0xc3, 0x6f, 0x7b }
+
+GUID_VARIABLE_DECLARATION(gEfiExtHiiProtocolGuid,EFI_HII_EXT_PROTOCOL_GUID);
+
+#ifndef GUID_VARIABLE_DEFINITION
+#include <AmiDxeLib.h>
+#include <Protocol/Hii.h>
+
+//Protocol Prototype
+typedef struct _EXT_HII_PROTOCOL EXT_HII_PROTOCOL;
+
+typedef struct _EXT_STR_INFO {
+ UINT16 StrLen; //Length of the String in unicode characters
+ UINT16 ScrLen; //Length of the string in Narrow Glyphs(Screen Grid)
+// BOOLEAN AllGlyphs; //Indicates if all gliphs for the string available.
+ UINT16 *StrPtr; //pointer to UNICODE string itself;
+} EXT_STR_INFO;
+
+typedef struct _HII_FORMSET {
+ UINT32 HandleId;
+ EFI_HII_HANDLE Handle; //Actual Handle Value
+ //this structure member must be updated each time UpdateForm is called
+ //it always reflects an actual length of Last updated Formset!!!!
+ UINTN BufferLength;//in bytes excluding EndOfFormSet OPCODE!!!
+ EFI_IFR_FORM_SET *FormSetData;
+ EFI_IFR_END_FORM_SET *EndFormSet;
+ T_ITEM_LIST Forms; //contains pointers to HII_FORM Structure
+ T_ITEM_LIST Labels; //contains pointers to HII_LABEL Structure
+ T_ITEM_LIST Storages;
+} HII_FORMSET;
+
+typedef struct _HII_FORM {
+ EFI_FORM_ID FormId;
+ EFI_IFR_FORM *FormData;
+ EFI_IFR_END_FORM *EndForm;
+ //this structure member must be updated each time UpdateForm is called
+ //it always reflects an actual length of Last updated Form!!!!
+ UINTN BufferLength; //in bytes including EndOfForm OPCODE!!!
+ T_ITEM_LIST Labels; //contains pointers to HII_LABEL Structure
+ //the very first label is a fake label containing all data from beginning of the form
+ //to the first valid label which means to be updated
+ //!!!!I'm definetly missing the END_OF_LABEL_OP opcode!!!!!
+ HII_FORMSET *Owner;
+} HII_FORM;
+
+
+typedef VOID (EFIAPI *HII_LABEL_UPDATE_CALLBACK)(UINT16 LabelId, UINT16 HiiHandle, BOOLEAN AddData);
+
+
+typedef EFI_STATUS (EFIAPI *HII_EXT_REGISTER_LABEL_UPDATE_CALBACK)(
+ IN EXT_HII_PROTOCOL *This,
+ IN EFI_HII_HANDLE Handle,
+ IN EFI_FORM_LABEL LabelId,
+ IN HII_LABEL_UPDATE_CALLBACK CallBack);
+
+typedef EFI_STATUS (EFIAPI *HII_EXT_UNREGISTER_LABEL_UPDATE_CALBACK)(
+ IN EXT_HII_PROTOCOL *This,
+ IN EFI_HII_HANDLE Handle,
+ IN EFI_FORM_LABEL LabelId);
+
+typedef EFI_STATUS (EFIAPI *HII_EXT_GET_FORM_INFO)(
+ IN EXT_HII_PROTOCOL *This,
+ IN EFI_HII_HANDLE Handle,
+ IN EFI_FORM_ID FormId,
+ OUT HII_FORM **ExtFormInfo);
+
+//Will get extended string info.
+typedef EFI_STATUS (EFIAPI *HII_EXT_GET_STRING)(
+ IN EXT_HII_PROTOCOL *This,
+ IN EFI_HII_HANDLE Handle,
+ IN STRING_REF Token,
+ IN CHAR16 *Lang,
+ OUT EXT_STR_INFO **ExtStrInfo);
+
+typedef EFI_STATUS (EFIAPI *HII_EXT_GET_FORMSET)(
+ IN EXT_HII_PROTOCOL *This,
+ IN UINT16 ClassMask,
+ IN UINT16 SubClass,
+ OUT T_ITEM_LIST *FormSetList);
+
+typedef EFI_STATUS (EFIAPI *HII_EXT_GET_FORM_LABELS)(
+ IN EXT_HII_PROTOCOL *This,
+ IN EFI_HII_HANDLE Handle,
+ IN EFI_FORM_ID FormID,
+ OUT T_ITEM_LIST *LabelList);
+
+
+typedef struct _EXT_HII_PROTOCOL{
+ HII_EXT_GET_STRING ExtGetStringInfo;
+ HII_EXT_GET_FORM_INFO ExtGetFormInfo;
+ HII_EXT_GET_FORMSET ExtGetFormsetInfo;
+ HII_EXT_REGISTER_LABEL_UPDATE_CALBACK ExtRegLblCallBack;
+ HII_EXT_UNREGISTER_LABEL_UPDATE_CALBACK ExtUnregLblCallBack;
+ HII_EXT_GET_FORM_LABELS ExtGetFormLabels;
+//TODO
+// suggestions ?????
+//TODO
+} EXT_HII_PROTOCOL;
+
+#endif // #if EFI_SPECIFICATION_VERSION>0x20000
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#endif // #ifndef GUID_VARIABLE_DEFINITION
+#ifdef __cplusplus
+}
+#endif
+#endif //_EXT_HII_H_
+
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2005, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
diff --git a/Include/Protocol/FastBootProtocol.cif b/Include/Protocol/FastBootProtocol.cif
new file mode 100644
index 0000000..a28ace1
--- /dev/null
+++ b/Include/Protocol/FastBootProtocol.cif
@@ -0,0 +1,8 @@
+<component>
+ name = "FastBoot Protocol"
+ category = ModulePart
+ LocalRoot = "Include\Protocol\"
+ RefName = "FastBootProtocol"
+[files]
+"FastBootProtocol.h"
+<endComponent>
diff --git a/Include/Protocol/FastBootProtocol.h b/Include/Protocol/FastBootProtocol.h
new file mode 100644
index 0000000..0a24b30
--- /dev/null
+++ b/Include/Protocol/FastBootProtocol.h
@@ -0,0 +1,248 @@
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2010, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
+//*************************************************************************
+// $Header: /Alaska/SOURCE/Modules/PTT/FastBootProtocol.h 8 4/18/13 5:35a Simonchen $
+//
+// $Revision: 8 $
+//
+// $Date: 4/18/13 5:35a $
+//*************************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/SOURCE/Modules/PTT/FastBootProtocol.h $
+//
+// 8 4/18/13 5:35a Simonchen
+// [TAG] EIP113454
+// [Category] New Feature
+// [Description] create for implement or experiment for Intel raid mode
+// on fastboot.
+// [Files] FastBootProtocol.h
+//
+// 7 8/23/12 6:08a Bibbyyeh
+// Add a flag "InFastBootPath" in FAST_BOOT_POLICY protocol.
+//
+// 6 8/10/12 3:26a Bibbyyeh
+// [TAG] EIP96276
+// [Category] New Feature
+// [Description] Function request for PTT_12
+// EIP96276.2 Fixed USB skip table issue.
+// EIP96276.3 Add token ¡¥CONNECT_ALL_SATA_DEVICE_IN_FASTBOOT¡¦ to
+// gFastBootPolicy.
+// EIP96276.4 Add IsValidFBBootOptionPtr support by driver type. Exp : usb
+// type skip or other type
+// EIP96276.5 Add token ¡¥Test mode¡¨ to gFastBootPolicy Setup menu.
+// EIP96276.6 Disable Tse Hotkey support in fastboot path.
+// EIP96276.7 Modify TRACE message.
+// [Files] FastBoot.c FastBoot.sd FastBoot.sdl FastBoot.uni
+// FastBootRuntime.c FastBootProtocol.c
+//
+// 5 8/07/12 4:42a Bibbyyeh
+// [TAG] EIP97545
+// [Category] Improvement
+// [Description] Updated PTT Module to Implement Support for
+// Initializing the Keyboard in First Call of Readkeystroke on Fastboot.
+// [Files] FastBoot.c FastBoot.h FastBootProtocol.h
+//
+// 4 6/01/12 6:51a Bibbyyeh
+// [TAG] EIP90455
+// [Category] New Feature
+// [Description] PTT improvement - fastboot policy protocol for dynamic
+// control fast boot behavior.
+// [Files] FastBoot.c FastBoot.sdl FastBoot.sd FastBoot.uni
+// FastBootRuntime.c FastBootTseHook.c FastBootProtocol.h FastBoot.h
+//
+// 3 9/08/11 5:27a Bibbyyeh
+// [TAG] EIP68329
+// [Category] Bug Fix
+// [Severity] Important
+// [Symptom] OS can't back to desktop correctly after resumed from
+// S3.
+// [RootCause] TSEIDEPasswordFreezeDevices is skipped in fastboot path
+// if SKIP_TSE_HANDSHAKE is enabled.
+// [Solution] Call TSEIDEPasswordFreezeDevices after ReadyToBoot
+// Event in fastboot path.
+// [Files] FastBoot.c FastBootProtocol.h FastBootTseHook.c
+//
+// 2 7/07/11 10:11a Bibbyyeh
+// [TAG] EIP63924
+// [Category] Improvement
+// [Description]
+// 1. Add elink for FastBoot mode change, default checking rule is check
+// post hotkey.
+// 2. Timer call back for check hotkey is not necessary. Create a protocol
+// for calling checkforkey in TSE.
+// 3. Since EIP68383 improve the performance of ps2 keyboard, we don't
+// need to exchange the initial order of ConIn/ConOut for getting more
+// time to detect hotkey.
+// [Files] FastBoot.sdl FastBoot.mak FastBoot.c FastBootTseHook.c
+// FastBoot.h FastBootProtocol.h
+//
+// 1 3/11/11 10:04p Bibbyyeh
+// [TAG] EIP54993
+// [Category] Improvement
+// [Description]
+// 1.Sync with Fastboot_10
+// 2.Remove token "SAVE_LAST_BOOT_DEVICE_CHECKSUM"
+// 3.Add token "CALL_DISPATCHER_AGAIN_IN_FASTBOOT"
+// 4.Use SimpleText protocol to detect mode change hotkey instead of
+// pBS->ConIn.
+// 5.Simplify the code about "AMILEGACY16_FASTBOOT_SOLUTION".
+// 6.Fixed a bug that SATA device can't be found if keep TSE execution on
+// fastboot path.
+// [Files] PPT.cif FastBoot.sdl FastBootRuntime.c FastBootTseHook.c
+// FastBoot.c FastBoot.h FastBoot.sd FastBootProtocol.cif
+// FastBootProtocol.h FastBootSMI.cif FastBootSMI.sdl FastBootSMI.c
+// FastBootSMI.dxs FastBootSMI.mak
+//
+//*************************************************************************
+//<AMI_FHDR_START>
+//
+// Name: FastBootProtocol.h
+//
+// Description:
+// Fast boot protocol definitions
+//
+//<AMI_FHDR_END>
+//*************************************************************************
+#ifndef __FASTBOOT_PROTOCOL__H__
+#define __FASTBOOT_PROTOCOL__H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+#pragma pack(1)
+
+
+// {3496A19A-2E99-41ba-833E-0FDE2EBF2A55}
+#define AMI_FAST_BOOT_PROTOCOL_GUID \
+ { 0x3496a19a, 0x2e99, 0x41ba, 0x83, 0x3e, 0xf, 0xde, 0x2e, 0xbf, 0x2a, 0x55 }
+
+ //(EIP63924+)>
+// {8fba43b8-acdb-4ee2-ab31-0fa4d5b6c3c5}
+#define FAST_BOOT_TSE_PROTOCOL_GUID \
+ { 0x0fba43b8, 0xacdb, 0x4ee2, 0xab, 0x31, 0x0f, 0xa4, 0xd5, 0xb6, 0xc3, 0xc5 }
+ //<(EIP63924+)
+
+#define FAST_BOOT_POLICY_PROTOCOL_GUID \
+ { 0xb2a07be9, 0xc754, 0x4c36, 0x93, 0x02, 0x7c, 0xc7, 0x8a, 0xa0, 0xd8, 0x75 }
+
+GUID_VARIABLE_DECLARATION(AmiFastBootProtocolGuid, AMI_FAST_BOOT_PROTOCOL_GUID);
+
+typedef struct _SKIP_PCI_LIST{
+ UINT8 Class;
+ UINT8 SubClass;
+} SKIP_PCI_LIST;
+
+typedef struct _FAST_BOOT_POLICY {
+ BOOLEAN FastBootEnable;
+ BOOLEAN TestMode;
+//pervious boot information
+ BOOLEAN UEfiBoot;
+ UINT16 BootOptionNumber;
+ UINT16 DevStrCheckSum;
+ EFI_DEVICE_PATH_PROTOCOL *FastBootOption;
+ BOOLEAN LastBootFailure;
+ BOOLEAN LastBootVarPresence;
+ UINT32 BootCount;
+//previous boot sata information
+ VOID *SataDevice;
+//fast boot behavior para
+ BOOLEAN FirstFastBootInS4;
+ BOOLEAN CheckBootOptionNumber;
+ BOOLEAN CheckDevStrCheckSum;
+ UINT8 SataSupport;
+ BOOLEAN VGASupport;
+ UINT8 UsbSupport;
+ VOID *UsbSkipTable;
+ UINTN UsbSkipTableSize;
+ BOOLEAN Ps2Support;
+ BOOLEAN NetWorkStackSupport;
+ SKIP_PCI_LIST *SkipPciList;
+ UINTN SkipPciListSize;
+ BOOLEAN CheckPassword;
+ BOOLEAN SkipTSEHandshake;
+// BOOLEAN ConnectAllSata; //(EIP96276.3)+
+ BOOLEAN InFastBootPath;
+} FAST_BOOT_POLICY;
+
+
+typedef
+EFI_STATUS
+(EFIAPI *AMI_FAST_BOOT_LAUNCH) (
+ VOID
+ );
+
+typedef
+VOID
+(EFIAPI *AMI_FAST_BOOT_CONNECT_INPUT_DEVICE) (
+ VOID
+ );
+
+typedef
+BOOLEAN
+(EFIAPI *AMI_FAST_BOOT_IS_RUNTIME) (
+ VOID
+ );
+
+typedef struct _AMI_FAST_BOOT_PROTOCOL
+{
+ AMI_FAST_BOOT_LAUNCH Launch;
+ AMI_FAST_BOOT_CONNECT_INPUT_DEVICE ConnectInputDevices;
+ AMI_FAST_BOOT_IS_RUNTIME IsRuntime;
+}AMI_FAST_BOOT_PROTOCOL;
+
+
+ //(EIP63924+)>
+typedef
+EFI_STATUS
+(EFIAPI *FAST_BOOT_CHECK_FOR_KEY) (
+ BOOLEAN *EnterSetup,
+ UINT32 *BootFlow
+ );
+
+typedef
+EFI_STATUS
+(EFIAPI *FAST_BOOT_STOP_CHECK_FOR_KEY_TIMER)();
+
+ //(EIP68329+)>
+typedef
+VOID
+(EFIAPI *FAST_BOOT_PASSWORD_FREEZE_DEVICES)();
+ //<(EIP68329+)
+typedef struct _FAST_BOOT_TSE_PROTOCOL
+{
+ FAST_BOOT_CHECK_FOR_KEY FastBootCheckForKey;
+ FAST_BOOT_STOP_CHECK_FOR_KEY_TIMER FastBootStopCheckForKeyTimer;
+ FAST_BOOT_PASSWORD_FREEZE_DEVICES FastBootPasswordFreezeDevices; //(EIP68329+)
+}
+FAST_BOOT_TSE_PROTOCOL;
+ //<(EIP63924+)
+#pragma pack()
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2010, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
diff --git a/Include/Protocol/FirmwareManagement.h b/Include/Protocol/FirmwareManagement.h
new file mode 100644
index 0000000..8d68fbf
--- /dev/null
+++ b/Include/Protocol/FirmwareManagement.h
@@ -0,0 +1,189 @@
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
+
+//*************************************************************************
+// $Header: /Alaska/BIN/Core/Include/Protocol/FirmwareManagement.h 1 5/02/11 5:39p Artems $
+//
+// $Revision: 1 $
+//
+// $Date: 5/02/11 5:39p $
+//*************************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Core/Include/Protocol/FirmwareManagement.h $
+//
+// 1 5/02/11 5:39p Artems
+//
+//*************************************************************************
+//<AMI_FHDR_START>
+//
+// Name: FirmwareManagement.h
+//
+// Description:
+// EFI_FIRMWARE_MANAGEMENT_PROTOCOL definition file
+//
+//<AMI_FHDR_END>
+//*************************************************************************
+#ifndef __FIRMWARE_MANAGEMENT_PROTOCOL__H__
+#define __FIRMWARE_MANAGEMENT_PROTOCOL__H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <EFI.h>
+#include <WinCertificate.h>
+
+#define EFI_FIRMWARE_MANAGEMENT_PROTOCOL_GUID \
+ { 0x86c77a67, 0xb97, 0x4633, 0xa1, 0x87, 0x49, 0x10, 0x4d, 0x6, 0x85, 0xc7 }
+
+#define IMAGE_ATTRIBUTE_IMAGE_UPDATABLE 0x0000000000000001
+#define IMAGE_ATTRIBUTE_RESET_REQUIRED 0x0000000000000002
+#define IMAGE_ATTRIBUTE_AUTHENTICATION_REQUIRED 0x0000000000000004
+#define IMAGE_ATTRIBUTE_IN_USE 0x0000000000000008
+
+#define IMAGE_COMPATIBILITY_CHECK_SUPPORTED 0x0000000000000001
+
+#define EFI_FIRMWARE_IMAGE_DESCRIPTOR_VERSION 1
+
+#define IMAGE_UPDATABLE_VALID 0x0000000000000001
+#define IMAGE_UPDATABLE_INVALID 0x0000000000000002
+#define IMAGE_UPDATABLE_INVALID_TYPE 0x0000000000000004
+#define IMAGE_UPDATABLE_INVALID_OLD 0x0000000000000008
+
+#define PACKAGE_ATTRIBUTE_VERSION_UPDATABLE 0x0000000000000001
+#define PACKAGE_ATTRIBUTE_RESET_REQUIRED 0x0000000000000002
+#define PACKAGE_ATTRIBUTE_AUTHENTICATION_REQUIRED 0x0000000000000004
+
+GUID_VARIABLE_DECLARATION(gEfiFirmwareManagementProtocolGuid, EFI_FIRMWARE_MANAGEMENT_PROTOCOL_GUID);
+
+
+typedef struct _EFI_FIRMWARE_MANAGEMENT_PROTOCOL EFI_FIRMWARE_MANAGEMENT_PROTOCOL;
+
+typedef struct {
+ UINT64 MonotonicCount;
+ WIN_CERTIFICATE_UEFI_GUID AuthInfo;
+} EFI_FIRMWARE_IMAGE_AUTHENTICATION;
+
+typedef struct {
+ UINT8 ImageIndex;
+ EFI_GUID ImageTypeId;
+ UINT64 ImageId;
+ CHAR16 *ImageIdName;
+ UINT32 Version;
+ CHAR16 *VersionName;
+ UINTN Size;
+ UINT64 AttributesSupported;
+ UINT64 AttributesSetting;
+ UINT64 Compatibilities;
+} EFI_FIRMWARE_IMAGE_DESCRIPTOR;
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_FIRMWARE_MANAGEMENT_UPDATE_IMAGE_PROGRESS) (
+ IN UINTN Completion
+);
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_FIRMWARE_MANAGEMENT_PROTOCOL_GET_IMAGE_INFO) (
+ IN EFI_FIRMWARE_MANAGEMENT_PROTOCOL *This,
+ IN OUT UINTN *ImageInfoSize,
+ IN OUT EFI_FIRMWARE_IMAGE_DESCRIPTOR *ImageInfo,
+ OUT UINT32 *DescriptorVersion,
+ OUT UINT8 *DescriptorCount,
+ OUT UINTN *DescriptorSize,
+ OUT UINT32 *PackageVersion,
+ OUT CHAR16 **PackageVersionName
+);
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_FIRMWARE_MANAGEMENT_PROTOCOL_GET_IMAGE) (
+ IN EFI_FIRMWARE_MANAGEMENT_PROTOCOL *This,
+ IN UINT8 ImageIndex,
+ IN OUT VOID *Image,
+ IN OUT UINTN *ImageSize
+);
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_FIRMWARE_MANAGEMENT_PROTOCOL_SET_IMAGE) (
+ IN EFI_FIRMWARE_MANAGEMENT_PROTOCOL *This,
+ IN UINT8 ImageIndex,
+ IN CONST VOID *Image,
+ IN UINTN ImageSize,
+ IN CONST VOID *VendorCode,
+ IN EFI_FIRMWARE_MANAGEMENT_UPDATE_IMAGE_PROGRESS Progress,
+ OUT CHAR16 **AbortReason
+);
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_FIRMWARE_MANAGEMENT_PROTOCOL_CHECK_IMAGE) (
+ IN EFI_FIRMWARE_MANAGEMENT_PROTOCOL *This,
+ IN UINT8 ImageIndex,
+ IN CONST VOID *Image,
+ IN UINTN ImageSize,
+ OUT UINT32 *ImageUpdatable
+);
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_FIRMWARE_MANAGEMENT_PROTOCOL_GET_PACKAGE_INFO) (
+ IN EFI_FIRMWARE_MANAGEMENT_PROTOCOL *This,
+ OUT UINT32 *PackageVersion,
+ OUT CHAR16 **PackageVersionName,
+ OUT UINT32 *PackageVersionNameMaxLen,
+ OUT UINT64 *AttributesSupported,
+ OUT UINT64 *AttributesSetting
+);
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_FIRMWARE_MANAGEMENT_PROTOCOL_SET_PACKAGE_INFO) (
+ IN EFI_FIRMWARE_MANAGEMENT_PROTOCOL *This,
+ IN CONST VOID *Image,
+ IN UINTN ImageSize,
+ IN CONST VOID *VendorCode,
+ IN UINT32 PackageVersion,
+ IN CONST CHAR16 *PackageVersionName
+);
+
+struct _EFI_FIRMWARE_MANAGEMENT_PROTOCOL {
+ EFI_FIRMWARE_MANAGEMENT_PROTOCOL_GET_IMAGE_INFO GetImageInfo;
+ EFI_FIRMWARE_MANAGEMENT_PROTOCOL_GET_IMAGE GetImage;
+ EFI_FIRMWARE_MANAGEMENT_PROTOCOL_SET_IMAGE SetImage;
+ EFI_FIRMWARE_MANAGEMENT_PROTOCOL_CHECK_IMAGE CheckImage;
+ EFI_FIRMWARE_MANAGEMENT_PROTOCOL_GET_PACKAGE_INFO GetPackageInfo;
+ EFI_FIRMWARE_MANAGEMENT_PROTOCOL_SET_PACKAGE_INFO SetPackageInfo;
+};
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
diff --git a/Include/Protocol/FirmwareVolume.h b/Include/Protocol/FirmwareVolume.h
new file mode 100644
index 0000000..21babbc
--- /dev/null
+++ b/Include/Protocol/FirmwareVolume.h
@@ -0,0 +1,234 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2005, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+//**********************************************************************
+// $Header: /Alaska/BIN/Core/Include/Protocol/FirmwareVolume.h 4 6/16/11 3:22p Felixp $
+//
+// $Revision: 4 $
+//
+// $Date: 6/16/11 3:22p $
+//*****************************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Core/Include/Protocol/FirmwareVolume.h $
+//
+// 4 6/16/11 3:22p Felixp
+// Surround backward compatibility definitions with #if
+// BACKWARD_COMPATIBLE_MODE
+//
+// 3 5/27/11 5:53p Felixp
+// Headers are updated to improve separation of the Framework and PI
+// interfaces.
+// The definitions that will be removed in the future versions are marked
+// with the comments.
+//
+// 2 2/05/11 2:30p Artems
+// Added PI 1.0-1.1 compatibility
+//
+// 1 3/13/06 1:38a Felixp
+//
+// 1 1/28/05 12:44p Felixp
+//
+// 2 1/18/05 3:22p Felixp
+// PrintDebugMessage renamed to Trace
+//
+// 1 12/23/04 9:41a Felixp
+//
+// 4 12/31/03 2:41p Markw
+// Fix structure help
+//
+// 3 12/19/03 2:21p Markw
+// Add EFI_FV_... Attribute definition
+//
+// 2 12/18/03 12:53p Markw
+// Header changes
+//
+//*****************************************************************************
+//<AMI_FHDR_START>
+//
+// Name: FirmwareVolume.h
+//
+// Description: This file is an include file used to define the Protocol for the
+// Firmware Volume Protocol.
+//
+//<AMI_FHDR_END>
+//*****************************************************************************
+#ifndef __FIRMWARE_VOLUME_PROTOCOL_H__
+#define __FIRMWARE_VOLUME_PROTOCOL_H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+#include <FFS.h>
+
+#if BACKWARD_COMPATIBLE_MODE && PI_SPECIFICATION_VERSION>=0x00010000
+#include <Protocol/FirmwareVolume2.h>
+#define EFI_FIRMWARE_VOLUME_PROTOCOL_GUID EFI_FIRMWARE_VOLUME2_PROTOCOL_GUID
+GUID_VARIABLE_DECLARATION(gEfiFirmwareVolumeProtocolGuid, EFI_FIRMWARE_VOLUME_PROTOCOL_GUID);
+typedef EFI_FIRMWARE_VOLUME2_PROTOCOL EFI_FIRMWARE_VOLUME_PROTOCOL;
+
+#else
+// 389F751F-1838-4388-8390-CD8154BD27F8
+#define EFI_FIRMWARE_VOLUME_PROTOCOL_GUID \
+ {0x389F751F,0x1838,0x4388,0x83,0x90,0xCD,0x81,0x54,0xBD,0x27,0xF8}
+
+GUID_VARIABLE_DECLARATION(gEfiFirmwareVolumeProtocolGuid, EFI_FIRMWARE_VOLUME_PROTOCOL_GUID);
+
+//************************************************************
+// EFI_FV_ATTRIBUTES
+//************************************************************
+typedef UINT64 EFI_FV_ATTRIBUTES;
+
+//************************************************************
+// EFI_FV_ATTRIBUTES bit definitions
+//************************************************************
+#define EFI_FV_READ_DISABLE_CAP 0x0000000000000001
+#define EFI_FV_READ_ENABLE_CAP 0x0000000000000002
+#define EFI_FV_READ_STATUS 0x0000000000000004
+#define EFI_FV_WRITE_DISABLE_CAP 0x0000000000000008
+#define EFI_FV_WRITE_ENABLE_CAP 0x0000000000000010
+#define EFI_FV_WRITE_STATUS 0x0000000000000020
+#define EFI_FV_LOCK_CAP 0x0000000000000040
+#define EFI_FV_LOCK_STATUS 0x0000000000000080
+#define EFI_FV_WRITE_POLICY_RELIABLE 0x0000000000000100
+#define EFI_FV_ALIGNMENT_CAP 0x0000000000008000
+#define EFI_FV_ALIGNMENT_2 0x0000000000010000
+#define EFI_FV_ALIGNMENT_4 0x0000000000020000
+#define EFI_FV_ALIGNMENT_8 0x0000000000040000
+#define EFI_FV_ALIGNMENT_16 0x0000000000080000
+#define EFI_FV_ALIGNMENT_32 0x0000000000100000
+#define EFI_FV_ALIGNMENT_64 0x0000000000200000
+#define EFI_FV_ALIGNMENT_128 0x0000000000400000
+#define EFI_FV_ALIGNMENT_256 0x0000000000800000
+#define EFI_FV_ALIGNMENT_512 0x0000000001000000
+#define EFI_FV_ALIGNMENT_1K 0x0000000002000000
+#define EFI_FV_ALIGNMENT_2K 0x0000000004000000
+#define EFI_FV_ALIGNMENT_4K 0x0000000008000000
+#define EFI_FV_ALIGNMENT_8K 0x0000000010000000
+#define EFI_FV_ALIGNMENT_16K 0x0000000020000000
+#define EFI_FV_ALIGNMENT_32K 0x0000000040000000
+#define EFI_FV_ALIGNMENT_64K 0x0000000080000000
+
+
+struct _EFI_FIRMWARE_VOLUME_PROTOCOL;
+typedef struct _EFI_FIRMWARE_VOLUME_PROTOCOL EFI_FIRMWARE_VOLUME_PROTOCOL;
+
+typedef EFI_STATUS (EFIAPI * EFI_FV_GET_ATTRIBUTES) (
+ IN EFI_FIRMWARE_VOLUME_PROTOCOL *This,
+ OUT EFI_FV_ATTRIBUTES *FvAttributes);
+
+
+typedef EFI_STATUS (EFIAPI * EFI_FV_SET_ATTRIBUTES) (
+ IN EFI_FIRMWARE_VOLUME_PROTOCOL *This,
+ IN OUT EFI_FV_ATTRIBUTES *FvAttributes);
+
+typedef EFI_STATUS (EFIAPI * EFI_FV_READ_FILE) (
+ IN EFI_FIRMWARE_VOLUME_PROTOCOL *This,
+ IN EFI_GUID *NameGuid,
+ IN OUT VOID **Buffer,
+ IN OUT UINTN *BufferSize,
+ OUT EFI_FV_FILETYPE *FoundType,
+ OUT EFI_FV_FILE_ATTRIBUTES *FileAttributes,
+ OUT UINT32 *AuthenticationStatus);
+
+typedef EFI_STATUS (EFIAPI * EFI_FV_READ_SECTION) (
+ IN EFI_FIRMWARE_VOLUME_PROTOCOL *This,
+ IN EFI_GUID *NameGuid,
+ IN EFI_SECTION_TYPE SectionType,
+ IN UINTN SectionInstance,
+ IN OUT VOID **Buffer,
+ IN OUT UINTN *BufferSize,
+ OUT UINT32 *AuthenticationStatus);
+
+
+//************************************************************
+// EFI_FV_WRITE_POLICY
+//************************************************************
+typedef UINT32 EFI_FV_WRITE_POLICY;
+#define EFI_FV_UNRELIABLE_WRITE 0x00000000
+#define EFI_FV_RELIABLE_WRITE 0x00000001
+
+//************************************************************
+// EFI_FV_WRITE_FILE_DATA
+//************************************************************
+typedef struct {
+ EFI_GUID *NameGuid;
+ EFI_FV_FILETYPE Type;
+ EFI_FV_FILE_ATTRIBUTES FileAttributes;
+ VOID *Buffer;
+ UINT32 BufferSize;
+} EFI_FV_WRITE_FILE_DATA;
+
+typedef EFI_STATUS (EFIAPI * EFI_FV_WRITE_FILE) (
+ IN EFI_FIRMWARE_VOLUME_PROTOCOL *This,
+ IN UINT32 NumberOfFiles,
+ IN EFI_FV_WRITE_POLICY WritePolicy,
+ IN EFI_FV_WRITE_FILE_DATA *FileData);
+
+typedef EFI_STATUS (EFIAPI * EFI_FV_GET_NEXT_FILE) (
+ IN EFI_FIRMWARE_VOLUME_PROTOCOL *This,
+ IN OUT VOID *Key,
+ IN OUT EFI_FV_FILETYPE *FileType,
+ OUT EFI_GUID *NameGuid,
+ OUT EFI_FV_FILE_ATTRIBUTES *Attributes,
+ OUT UINTN *Size);
+
+//**********************************************************************
+//<AMI_SHDR_START>
+//
+// Name: EFI_FIRMWARE_VOLUME_PROTOCOL
+//
+// Description: Firmware Volume Protocol for Reading/Seting Volume Attributes
+// Read/Writing Files.
+//
+// Fields: Name Type Description
+// ------------------------------------------------------------
+// GetVolumeAttributes EFI_FV_GET_ATTRIBUTES
+// SetVolumeAttributes EFI_FV_SET_ATTRIBUTES
+// ReadFile EFI_FV_READ_FILE
+// ReadSection EFI_FV_READ_SECTION
+// WriteFile EFI_FV_WRITE_FILE
+// GetNextFile EFI_FV_GET_NEXT_FILE
+// KeySize UINT32
+// ParentHandle EFI_HANDLE
+//
+//<AMI_SHDR_END>
+//**********************************************************************
+typedef struct _EFI_FIRMWARE_VOLUME_PROTOCOL {
+ EFI_FV_GET_ATTRIBUTES GetVolumeAttributes;
+ EFI_FV_SET_ATTRIBUTES SetVolumeAttributes;
+ EFI_FV_READ_FILE ReadFile;
+ EFI_FV_READ_SECTION ReadSection;
+ EFI_FV_WRITE_FILE WriteFile;
+ EFI_FV_GET_NEXT_FILE GetNextFile;
+ UINT32 KeySize;
+ EFI_HANDLE ParentHandle;
+} EFI_FIRMWARE_VOLUME_PROTOCOL;
+#endif // #else PI_SPECIFICATION_VERSION>=0x00010000
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2005, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
diff --git a/Include/Protocol/FirmwareVolume2.h b/Include/Protocol/FirmwareVolume2.h
new file mode 100644
index 0000000..60e0eb4
--- /dev/null
+++ b/Include/Protocol/FirmwareVolume2.h
@@ -0,0 +1,260 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/BIN/Core/Include/Protocol/FirmwareVolume2.h 1 2/05/11 2:31p Artems $
+//
+// $Revision: 1 $
+//
+// $Date: 2/05/11 2:31p $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Core/Include/Protocol/FirmwareVolume2.h $
+//
+// 1 2/05/11 2:31p Artems
+// FirmwareVolume2 protocol definition
+//
+// 6 1/13/10 2:13p Felixp
+//
+//**********************************************************************
+//<AMI_FHDR_START>
+//
+// Name: FirmwareVolume2.h
+//
+// Description: This file includes definition of the Firmware Volume2 Protocol
+//
+//<AMI_FHDR_END>
+//**********************************************************************
+#ifndef __FIRMWARE_VOLUME2_PROTOCOL_H__
+#define __FIRMWARE_VOLUME2_PROTOCOL_H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <ffs.h>
+
+#if PI_SPECIFICATION_VERSION<0x00010000
+#include <Protocol/FirmwareVolume.h>
+#define EFI_FIRMWARE_VOLUME2_PROTOCOL_GUID EFI_FIRMWARE_VOLUME_PROTOCOL_GUID
+GUID_VARIABLE_DECLARATION(gEfiFirmwareVolume2ProtocolGuid, EFI_FIRMWARE_VOLUME2_PROTOCOL_GUID);
+typedef EFI_FIRMWARE_VOLUME_PROTOCOL EFI_FIRMWARE_VOLUME2_PROTOCOL;
+
+#else
+
+// Firmware Volume Protocol GUID definition
+#define EFI_FIRMWARE_VOLUME2_PROTOCOL_GUID \
+ { 0x220e73b6, 0x6bdb, 0x4413, 0x84, 0x5, 0xb9, 0x74, 0xb1, 0x8, 0x61, 0x9a }
+
+GUID_VARIABLE_DECLARATION(gEfiFirmwareVolume2ProtocolGuid, EFI_FIRMWARE_VOLUME2_PROTOCOL_GUID);
+
+EFI_FORWARD_DECLARATION (EFI_FIRMWARE_VOLUME2_PROTOCOL);
+
+typedef EFI_FIRMWARE_VOLUME2_PROTOCOL EFI_FIRMWARE_VOLUME_PROTOCOL;
+
+typedef UINT64 EFI_FV_ATTRIBUTES;
+
+//
+// ************************************************************
+// EFI_FV2_ATTRIBUTES bit definitions
+// ************************************************************
+//
+#define EFI_FV2_READ_DISABLE_CAP 0x0000000000000001
+#define EFI_FV2_READ_ENABLE_CAP 0x0000000000000002
+#define EFI_FV2_READ_STATUS 0x0000000000000004
+
+#define EFI_FV2_WRITE_DISABLE_CAP 0x0000000000000008
+#define EFI_FV2_WRITE_ENABLE_CAP 0x0000000000000010
+#define EFI_FV2_WRITE_STATUS 0x0000000000000020
+
+#define EFI_FV2_LOCK_CAP 0x0000000000000040
+#define EFI_FV2_LOCK_STATUS 0x0000000000000080
+#define EFI_FV2_WRITE_POLICY_RELIABLE 0x0000000000000100
+
+#define EFI_FV2_READ_LOCK_CAP 0x0000000000001000
+#define EFI_FV2_READ_LOCK_STATUS 0x0000000000002000
+#define EFI_FV2_WRITE_LOCK_CAP 0x0000000000004000
+#define EFI_FV2_WRITE_LOCK_STATUS 0x0000000000008000
+#define EFI_FV2_ALIGNMENT 0x00000000001F0000
+
+
+#define EFI_FV2_ALIGNMENT_1 0x0000000000000000
+#define EFI_FV2_ALIGNMENT_2 0x0000000000010000
+#define EFI_FV2_ALIGNMENT_4 0x0000000000020000
+#define EFI_FV2_ALIGNMENT_8 0x0000000000030000
+#define EFI_FV2_ALIGNMENT_16 0x0000000000040000
+#define EFI_FV2_ALIGNMENT_32 0x0000000000050000
+#define EFI_FV2_ALIGNMENT_64 0x0000000000060000
+#define EFI_FV2_ALIGNMENT_128 0x0000000000070000
+#define EFI_FV2_ALIGNMENT_256 0x0000000000080000
+#define EFI_FV2_ALIGNMENT_512 0x0000000000090000
+#define EFI_FV2_ALIGNMENT_1K 0x00000000000A0000
+#define EFI_FV2_ALIGNMENT_2K 0x00000000000B0000
+#define EFI_FV2_ALIGNMENT_4K 0x00000000000C0000
+#define EFI_FV2_ALIGNMENT_8K 0x00000000000D0000
+#define EFI_FV2_ALIGNMENT_16K 0x00000000000E0000
+#define EFI_FV2_ALIGNMENT_32K 0x00000000000F0000
+#define EFI_FV2_ALIGNMENT_64K 0x0000000000100000
+#define EFI_FV2_ALIGNMENT_128K 0x0000000000110000
+#define EFI_FV2_ALIGNMENT_256K 0x0000000000120000
+#define EFI_FV2_ALIGNMENT_512K 0x0000000000130000
+#define EFI_FV2_ALIGNMENT_1M 0x0000000000140000
+#define EFI_FV2_ALIGNMENT_2M 0x0000000000150000
+#define EFI_FV2_ALIGNMENT_4M 0x0000000000160000
+#define EFI_FV2_ALIGNMENT_8M 0x0000000000170000
+#define EFI_FV2_ALIGNMENT_16M 0x0000000000180000
+#define EFI_FV2_ALIGNMENT_32M 0x0000000000190000
+#define EFI_FV2_ALIGNMENT_64M 0x00000000001A0000
+#define EFI_FV2_ALIGNMENT_128M 0x00000000001B0000
+#define EFI_FV2_ALIGNMENT_256M 0x00000000001C0000
+#define EFI_FV2_ALIGNMENT_512M 0x00000000001D0000
+#define EFI_FV2_ALIGNMENT_1G 0x00000000001E0000
+#define EFI_FV2_ALIGNMENT_2G 0x00000000001F0000
+
+#define EFI_FV_FILE_ATTRIB_FIXED 0x00000100
+#define EFI_FV_FILE_ATTRIB_MEMORY_MAPPED 0x00000200
+
+//************************************************************
+// EFI_FV_WRITE_POLICY
+//************************************************************
+typedef UINT32 EFI_FV_WRITE_POLICY;
+#define EFI_FV_UNRELIABLE_WRITE 0x00000000
+#define EFI_FV_RELIABLE_WRITE 0x00000001
+
+//************************************************************
+// EFI_FV_WRITE_FILE_DATA
+//************************************************************
+typedef struct {
+ EFI_GUID *NameGuid;
+ EFI_FV_FILETYPE Type;
+ EFI_FV_FILE_ATTRIBUTES FileAttributes;
+ VOID *Buffer;
+ UINT32 BufferSize;
+} EFI_FV_WRITE_FILE_DATA;
+
+//
+// Protocol API definitions
+//
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_FV_GET_ATTRIBUTES) (
+ IN CONST EFI_FIRMWARE_VOLUME2_PROTOCOL *This,
+ OUT EFI_FV_ATTRIBUTES *Attributes
+ );
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_FV_SET_ATTRIBUTES) (
+ IN CONST EFI_FIRMWARE_VOLUME2_PROTOCOL *This,
+ IN OUT EFI_FV_ATTRIBUTES *Attributes
+ );
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_FV_READ_FILE) (
+ IN CONST EFI_FIRMWARE_VOLUME2_PROTOCOL *This,
+ IN CONST EFI_GUID *NameGuid,
+ IN OUT VOID **Buffer,
+ IN OUT UINTN *BufferSize,
+ OUT EFI_FV_FILETYPE *FoundType,
+ OUT EFI_FV_FILE_ATTRIBUTES *FileAttributes,
+ OUT UINT32 *AuthenticationStatus
+ );
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_FV_READ_SECTION) (
+ IN CONST EFI_FIRMWARE_VOLUME2_PROTOCOL *This,
+ IN CONST EFI_GUID *NameGuid,
+ IN EFI_SECTION_TYPE SectionType,
+ IN UINTN SectionInstance,
+ IN OUT VOID **Buffer,
+ IN OUT UINTN *BufferSize,
+ OUT UINT32 *AuthenticationStatus
+ );
+
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_FV_WRITE_FILE) (
+ IN CONST EFI_FIRMWARE_VOLUME2_PROTOCOL *This,
+ IN UINT32 NumberOfFiles,
+ IN EFI_FV_WRITE_POLICY WritePolicy,
+ IN EFI_FV_WRITE_FILE_DATA *FileData
+ );
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_FV_GET_NEXT_FILE) (
+ IN CONST EFI_FIRMWARE_VOLUME2_PROTOCOL *This,
+ IN OUT VOID *Key,
+ IN OUT EFI_FV_FILETYPE *FileType,
+ OUT EFI_GUID *NameGuid,
+ OUT EFI_FV_FILE_ATTRIBUTES *Attributes,
+ OUT UINTN *Size
+ );
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_FV_GET_INFO) (
+ IN CONST EFI_FIRMWARE_VOLUME2_PROTOCOL *This,
+ IN CONST EFI_GUID *InformationType,
+ IN OUT UINTN *BufferSize,
+ OUT VOID *Buffer
+ );
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_FV_SET_INFO) (
+ IN CONST EFI_FIRMWARE_VOLUME2_PROTOCOL *This,
+ IN CONST EFI_GUID *InformationType,
+ IN UINTN BufferSize,
+ IN CONST VOID *Buffer
+ );
+
+
+typedef struct _EFI_FIRMWARE_VOLUME2_PROTOCOL {
+ EFI_FV_GET_ATTRIBUTES GetVolumeAttributes;
+ EFI_FV_SET_ATTRIBUTES SetVolumeAttributes;
+ EFI_FV_READ_FILE ReadFile;
+ EFI_FV_READ_SECTION ReadSection;
+ EFI_FV_WRITE_FILE WriteFile;
+ EFI_FV_GET_NEXT_FILE GetNextFile;
+ UINT32 KeySize;
+ EFI_HANDLE ParentHandle;
+ EFI_FV_GET_INFO GetInfo;
+ EFI_FV_SET_INFO SetInfo;
+} EFI_FIRMWARE_VOLUME2_PROTOCOL;
+
+
+#endif // #else PI_SPECIFICATION_VERSION<0x00010000
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
diff --git a/Include/Protocol/FirmwareVolumeBlock.h b/Include/Protocol/FirmwareVolumeBlock.h
new file mode 100644
index 0000000..33ef2d9
--- /dev/null
+++ b/Include/Protocol/FirmwareVolumeBlock.h
@@ -0,0 +1,192 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2005, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+//**********************************************************************
+// $Header: /Alaska/Projects/Intel/Haswell/LynxPoint_SharkBay-DT_Crb_1AQQW/Include/Protocol/FirmwareVolumeBlock.h 1 11/18/14 5:13a Chienhsieh $
+//
+// $Revision: 1 $
+//
+// $Date: 11/18/14 5:13a $
+//*****************************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/Projects/Intel/Haswell/LynxPoint_SharkBay-DT_Crb_1AQQW/Include/Protocol/FirmwareVolumeBlock.h $
+//
+// 1 11/18/14 5:13a Chienhsieh
+// Update rev6.
+//
+// 6 2/25/13 5:35p Artems
+// [TAG] EIP N/A
+// [Category] Spec Update
+// [Severity] Minor
+// [Description] Added definition of LBA_TERMINATOR
+// [Files] FirmwareVolumeBlock.h
+//
+// 5 6/16/11 5:33p Felixp
+// FORWARD_COMPATIBLE_MODE definitions removed (they are not needed in the
+// Core version of the header).
+//
+// 1 6/16/11 4:57p Felixp
+//
+// 4 6/16/11 3:33p Felixp
+// Surround backward compatibility definitions with #if
+// BACKWARD_COMPATIBLE_MODE
+//
+// 3 6/10/11 12:58p Artems
+// Added backward compatibility macro definition for PI mode
+//
+// 2 5/27/11 5:53p Felixp
+// Headers are updated to improve separation of the Framework and PI
+// interfaces.
+// The definitions that will be removed in the future versions are marked
+// with the comments.
+//
+// 1 3/13/06 1:38a Felixp
+//
+// 1 1/28/05 12:44p Felixp
+//
+// 2 1/18/05 3:22p Felixp
+// PrintDebugMessage renamed to Trace
+//
+// 1 12/23/04 9:41a Felixp
+//
+// 2 12/31/03 2:50p Markw
+// Added S Header.
+//
+// 1 12/18/03 4:14p Markw
+//
+//
+//*****************************************************************************
+//<AMI_FHDR_START>
+//
+// Name: FirmwareVolumeBlock.h
+//
+// Description: This file is an include file used to define the Protocol for the
+// Firmware Volume Block Protocol.
+//
+//<AMI_FHDR_END>
+//*****************************************************************************
+#ifndef __FIRMWARE_VOLUME_BLOCK_PROTOCOL_H__
+#define __FIRMWARE_VOLUME_BLOCK_PROTOCOL_H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+#include <FFS.h>
+
+#if PI_SPECIFICATION_VERSION<0x00010000
+// 0xDE28BC59-6228-41BD-BDF6-A3B9ADB58DA1
+#define FW_VOLUME_BLOCK_PROTOCOL_GUID \
+ {0xDE28BC59, 0x6228, 0x41BD, 0xBD, 0xF6, 0xA3, 0xB9,0xAD,0xB5, 0x8D, 0xA1}
+#define EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL_GUID FW_VOLUME_BLOCK_PROTOCOL_GUID
+#else
+#define EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL_GUID \
+ { 0x8f644fa9, 0xe850, 0x4db1, 0x9c, 0xe2, 0xb, 0x44, 0x69, 0x8e, 0x8d, 0xa4 }
+#if BACKWARD_COMPATIBLE_MODE
+#define FW_VOLUME_BLOCK_PROTOCOL_GUID EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL_GUID
+#endif // BACKWARD_COMPATIBLE_MODE
+#endif
+
+#define EFI_FIRMWARE_VOLUME_BLOCK2_PROTOCOL_GUID EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL_GUID
+#define EFI_LBA_LIST_TERMINATOR 0xFFFFFFFFFFFFFFFF
+
+GUID_VARIABLE_DECLARATION(gEfiFirmwareVolumeBlockProtocolGuid, EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL_GUID);
+GUID_VARIABLE_DECLARATION(gEfiFirmwareVolumeBlock2ProtocolGuid, EFI_FIRMWARE_VOLUME_BLOCK2_PROTOCOL_GUID);
+
+typedef struct _EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL;
+typedef EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL EFI_FIRMWARE_VOLUME_BLOCK2_PROTOCOL;
+
+typedef EFI_STATUS (EFIAPI * EFI_FVB_GET_ATTRIBUTES) (
+ IN EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL *This,
+ OUT EFI_FVB_ATTRIBUTES *Attributes);
+
+typedef EFI_STATUS (EFIAPI * EFI_FVB_SET_ATTRIBUTES) (
+ IN EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL *This,
+ IN OUT EFI_FVB_ATTRIBUTES *Attributes);
+
+typedef EFI_STATUS (EFIAPI * EFI_FVB_GET_PHYSICAL_ADDRESS) (
+ IN EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL *This,
+ OUT EFI_PHYSICAL_ADDRESS *Address);
+
+typedef EFI_STATUS (EFIAPI * EFI_FVB_GET_BLOCK_SIZE) (
+ IN EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL *This,
+ IN EFI_LBA Lba,
+ OUT UINTN *BlockSize,
+ OUT UINTN *NumberOfBlocks);
+
+typedef EFI_STATUS (EFIAPI *EFI_FVB_READ)(
+ IN EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL *This,
+ IN EFI_LBA Lba,
+ IN UINTN Offset,
+ IN OUT UINTN *NumBytes,
+ OUT UINT8 *Buffer);
+
+typedef EFI_STATUS (EFIAPI * EFI_FVB_WRITE) (
+ IN EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL *This,
+ IN EFI_LBA Lba,
+ IN UINTN Offset,
+ IN OUT UINTN *NumBytes,
+ IN UINT8 *Buffer);
+
+typedef EFI_STATUS (EFIAPI * EFI_FVB_ERASE_BLOCKS) (
+ IN EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL *This,...);
+
+//**********************************************************************
+//<AMI_SHDR_START>
+//
+// Name: EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL
+//
+// Description: Firmware Volume Protocol Block Gets/Sets attributes,
+// reads/writes/erases blocks in the firmware volume.
+//
+// Fields: Name Type Description
+// ------------------------------------------------------------
+// GetAttributes EFI_FVB_GET_ATTRIBUTES
+// SetAttributes EFI_FVB_SET_ATTRIBUTES
+// GetPhysicalAddress EFI_FVB_GET_PHYSICAL_ADDRESS
+// GetBlockSize EFI_FVB_GET_BLOCK_SIZE
+// Read EFI_FVB_READ
+// Write EFI_FVB_WRITE
+// EraseBlocks EFI_FVB_ERASE_BLOCKS
+// ParentHandle EFI_HANDLE
+//
+//<AMI_SHDR_END>
+//**********************************************************************
+typedef struct _EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL {
+ EFI_FVB_GET_ATTRIBUTES GetAttributes;
+ EFI_FVB_SET_ATTRIBUTES SetAttributes;
+ EFI_FVB_GET_PHYSICAL_ADDRESS GetPhysicalAddress;
+ EFI_FVB_GET_BLOCK_SIZE GetBlockSize;
+ EFI_FVB_READ Read;
+ EFI_FVB_WRITE Write;
+ EFI_FVB_ERASE_BLOCKS EraseBlocks;
+ EFI_HANDLE ParentHandle;
+} EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL;
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2005, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
diff --git a/Include/Protocol/FlashProtocol.h b/Include/Protocol/FlashProtocol.h
new file mode 100644
index 0000000..b6643fd
--- /dev/null
+++ b/Include/Protocol/FlashProtocol.h
@@ -0,0 +1,93 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2009, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/BIN/Core/Include/Protocol/FlashProtocol.h 2 5/21/09 4:34p Felixp $
+//
+// $Revision: 2 $
+//
+// $Date: 5/21/09 4:34p $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Core/Include/Protocol/FlashProtocol.h $
+//
+// 2 5/21/09 4:34p Felixp
+//
+// 1 5/21/09 4:33p Felixp
+//
+//**********************************************************************
+//<AMI_FHDR_START>
+//
+// Name: FlashProtocol.h
+//
+// Description: Flash Protocol
+//
+//<AMI_FHDR_END>
+//**********************************************************************
+#ifndef __FLASH_PROTOCOL__H__
+#define __FLASH_PROTOCOL__H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+#include <EFI.h>
+
+// {755B6596-6896-4ba3-B3DD-1C629FD1EA88}
+#define FLASH_PROTOCOL_GUID \
+ { 0x755b6596, 0x6896, 0x4ba3, 0xb3, 0xdd, 0x1c, 0x62, 0x9f, 0xd1, 0xea, 0x88 }
+
+// {ECB867AB-8DF4-492d-8150-A7FD1B9B5A75}
+#define FLASH_SMM_PROTOCOL_GUID \
+ { 0xecb867ab, 0x8df4, 0x492d, 0x81, 0x50, 0xa7, 0xfd, 0x1b, 0x9b, 0x5a, 0x75 }
+
+GUID_VARIABLE_DECLARATION(gFlashProtocolGuid,FLASH_PROTOCOL_GUID);
+GUID_VARIABLE_DECLARATION(gFlashSmmProtocolGuid,FLASH_SMM_PROTOCOL_GUID);
+
+typedef struct _FLASH_PROTOCOL FLASH_PROTOCOL;
+
+typedef EFI_STATUS (EFIAPI *FLASH_READ_WRITE)(
+ VOID* FlashAddress, UINTN Size, VOID* DataBuffer
+);
+typedef EFI_STATUS (EFIAPI *FLASH_ERASE)(
+ VOID* FlashAddress, UINTN Size
+);
+typedef EFI_STATUS (EFIAPI *FLASH_WRITE_ENABLE_DISABLE)();
+
+struct _FLASH_PROTOCOL {
+ FLASH_READ_WRITE Read;
+ FLASH_ERASE Erase;
+ FLASH_READ_WRITE Write; //Write only
+ FLASH_READ_WRITE Update; //Erase if necessary
+ FLASH_WRITE_ENABLE_DISABLE DeviceWriteEnable;
+ FLASH_WRITE_ENABLE_DISABLE DeviceWriteDisable;
+};
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2009, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
diff --git a/Include/Protocol/FormBrowser2.h b/Include/Protocol/FormBrowser2.h
new file mode 100644
index 0000000..f9e62ef
--- /dev/null
+++ b/Include/Protocol/FormBrowser2.h
@@ -0,0 +1,106 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2009, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/BIN/Core/Include/Protocol/FormBrowser2.h 3 10/26/09 10:46a Felixp $
+//
+// $Revision: 3 $
+//
+// $Date: 10/26/09 10:46a $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Core/Include/Protocol/FormBrowser2.h $
+//
+// 3 10/26/09 10:46a Felixp
+// Declaration of EFI_BROWSER_ACTION_REQUEST type and the values of the
+// type are removed (they are already defined in UefiHii.h).
+//
+// 2 10/13/09 6:06p Felixp
+// Hii.h renamed to UefiHii.h
+//
+// 1 10/09/09 3:52p Felixp
+//
+//**********************************************************************
+//<AMI_FHDR_START>
+//
+// Name: FormBrowser2.h
+//
+// Description: Form Browser protocol header file
+//
+//<AMI_FHDR_END>
+//**********************************************************************
+#ifndef __FORM_BROWSER_2__H__
+#define __FORM_BROWSER_2__H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+#include <UefiHii.h>
+
+#define EFI_FORM_BROWSER2_PROTOCOL_GUID \
+ { 0xb9d4c360, 0xbcfb, 0x4f9b, 0x92, 0x98, 0x53, 0xc1, 0x36, 0x98, 0x22, 0x58 }
+
+GUID_VARIABLE_DECLARATION(gEfiFormBrowser2ProtocolGuid, EFI_FORM_BROWSER2_PROTOCOL_GUID);
+
+typedef struct _EFI_FORM_BROWSER2_PROTOCOL EFI_FORM_BROWSER2_PROTOCOL;
+
+typedef struct {
+ UINTN LeftColumn;
+ UINTN RightColumn;
+ UINTN TopRow;
+ UINTN BottomRow;
+} EFI_SCREEN_DESCRIPTOR;
+
+typedef EFI_STATUS (EFIAPI *EFI_SEND_FORM2)(
+ IN CONST EFI_FORM_BROWSER2_PROTOCOL *This,
+ IN EFI_HII_HANDLE *Handles,
+ IN UINTN HandleCount,
+ IN EFI_GUID *FormSetGuid, OPTIONAL
+ IN UINT16 FormId, OPTIONAL
+ IN CONST EFI_SCREEN_DESCRIPTOR *ScreenDimensions, OPTIONAL
+ OUT EFI_BROWSER_ACTION_REQUEST *ActionRequest OPTIONAL
+);
+
+typedef EFI_STATUS (EFIAPI *EFI_BROWSER_CALLBACK2)(
+ IN CONST EFI_FORM_BROWSER2_PROTOCOL *This,
+ IN OUT UINTN *ResultsDataSize,
+ IN OUT EFI_STRING ResultsData,
+ IN BOOLEAN RetrieveData,
+ IN CONST EFI_GUID *VariableGuid, OPTIONAL
+ IN CONST CHAR16 *VariableName OPTIONAL
+);
+
+struct _EFI_FORM_BROWSER2_PROTOCOL {
+ EFI_SEND_FORM2 SendForm;
+ EFI_BROWSER_CALLBACK2 BrowserCallback;
+};
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2009, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
diff --git a/Include/Protocol/FormCallBack.h b/Include/Protocol/FormCallBack.h
new file mode 100644
index 0000000..7aeddea
--- /dev/null
+++ b/Include/Protocol/FormCallBack.h
@@ -0,0 +1,108 @@
+#ifndef __FORM_CALLBACK_PROTOCOL_H__
+#define __FORM_CALLBACK_PROTOCOL_H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+#if EFI_SPECIFICATION_VERSION>0x20000 && !defined(GUID_VARIABLE_DEFINITION)
+#pragma message("The EFI_FORM_CALLBACK_PROTOCOL protocol is only supported for the UEFI 2.0 projects")
+#pragma message("UEFI 2.1 projects must use HiiConfigAccess.h header instead")
+#pragma message("The supported version of the UEFI specification is defined by the EFI_SPECIFICATION_VERSION SDL token")
+#error the protocol is depricated
+#else
+#include <EFI.h>
+
+#define EFI_FORM_CALLBACK_PROTOCOL_GUID \
+ { 0xf3e4543d, 0xcf35, 0x6cef, 0x35, 0xc4, 0x4f, 0xe6, 0x34, 0x4d, 0xfc, 0x54 }
+
+GUID_VARIABLE_DECLARATION(gEfiFormCallbackProtocolGuid,EFI_FORM_CALLBACK_PROTOCOL_GUID);
+
+#ifndef GUID_VARIABLE_DEFINITION
+#include <Protocol/Hii.h>
+
+typedef struct _EFI_FORM_CALLBACK_PROTOCOL EFI_FORM_CALLBACK_PROTOCOL;
+
+//This flags are different from IFR Flags
+#define RESET_REQUIRED 1 //callback operation resulted in an eventual reset to be done upon exit of the browser
+#define EXIT_REQUIRED 2 //after the processing of the callback results - exit the browser
+#define SAVE_REQUIRED 4 //after the processing of the callback results - save the NV data
+#define NV_CHANGED 8 //processing of the callback results - turn the NV flag on
+#define NV_NOT_CHANGED 16 //after the processing of the callback results - turn the NV flag off
+
+#pragma pack(push, 1)
+
+typedef struct _EFI_IFR_PACKET {
+ EFI_HII_IFR_PACK *IfrData;
+ EFI_HII_STRING_PACK *StringData;
+} EFI_IFR_PACKET;
+
+typedef struct _IFR_DATA_HDR{
+ UINT8 OpCode; //string, numeric, one-of, check box or text
+ UINT8 Length; //length of the EFI_IFR_DATA_ENTRY packet
+ UINT16 Flags; //Flags settings see above
+} IFR_DATA_HDR;
+
+typedef struct {
+ IFR_DATA_HDR Header;
+ UINT8 Data[1]; //The data in the form based on the op-code type
+// If the OpCode is a OneOf or Numeric type - Data is a UINT16 value
+// If the OpCode is a String type - Data is a CHAR16[x] type
+// If the OpCode is a Checkbox type - Data is a UINT8 value
+// If the OpCode is a NV Access type - Data is a EFI_IFR_NV_DATA structure
+} EFI_IFR_DATA;
+
+
+typedef struct {
+ UINT8 *NvRamMap; // If the flag of the op-code specified retrieval of a copy of the NVRAM map,
+ // this is a pointer to a buffer copy
+ UINT32 EntryCount; // Number of EFI_IFR_DATA_ENTRY entries
+ EFI_IFR_DATA Data[1]; // Data entries.
+} EFI_IFR_DATA_ARRAY;
+
+
+typedef union {
+ EFI_IFR_DATA_ARRAY DataArray; // Primarily used by those who call back to their drivers and use HII as a repository
+ EFI_IFR_PACKET DataPacket; // Primarily used by those which do not use HII as a repository
+ CHAR16 String[1]; // If returning an error - fill the string with null-terminated contents
+} EFI_HII_CALLBACK_PACKET;
+
+#pragma pack(pop)
+
+// The following are a Callback Protocol functions
+typedef EFI_STATUS (EFIAPI *EFI_FORM_CALLBACK) (
+ IN EFI_FORM_CALLBACK_PROTOCOL *This,
+ IN UINT16 KeyValue,
+ IN EFI_IFR_DATA_ARRAY *Data,
+ OUT EFI_HII_CALLBACK_PACKET **Packet );
+
+
+typedef EFI_STATUS (EFIAPI *EFI_NV_READ) (
+ IN EFI_FORM_CALLBACK_PROTOCOL *This,
+ IN CHAR16 *VariableName,
+ IN EFI_GUID *VendorGuid,
+ OUT UINT32 *Attributes OPTIONAL,
+ IN OUT UINTN *DataSize,
+ OUT VOID *Buffer );
+
+typedef EFI_STATUS (EFIAPI *EFI_NV_WRITE) (
+ IN EFI_FORM_CALLBACK_PROTOCOL *This,
+ IN CHAR16 *VariableName,
+ IN EFI_GUID *VendorGuid,
+ IN UINT32 Attributes,
+ IN UINTN DataSize,
+ IN VOID *Buffer,
+ OUT BOOLEAN *ResetRequired);
+
+
+//the FormCallback Protocol structure
+typedef struct _EFI_FORM_CALLBACK_PROTOCOL {
+ EFI_NV_READ NvRead;
+ EFI_NV_WRITE NvWrite;
+ EFI_FORM_CALLBACK Callback;
+} EFI_FORM_CALLBACK_PROTOCOL;
+#endif // #if EFI_SPECIFICATION_VERSION>0x20000
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#endif // #ifndef GUID_VARIABLE_DEFINITION
+#ifdef __cplusplus
+}
+#endif
+#endif \ No newline at end of file
diff --git a/Include/Protocol/GraphicsOutput.h b/Include/Protocol/GraphicsOutput.h
new file mode 100644
index 0000000..ffb6b04
--- /dev/null
+++ b/Include/Protocol/GraphicsOutput.h
@@ -0,0 +1,151 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2006, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/BIN/Core/Include/Protocol/GraphicsOutput.h 1 12/20/06 1:45p Felixp $
+//
+// $Revision: 1 $
+//
+// $Date: 12/20/06 1:45p $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Core/Include/Protocol/GraphicsOutput.h $
+//
+// 1 12/20/06 1:45p Felixp
+//
+//**********************************************************************
+//<AMI_FHDR_START>
+//
+// Name: GraphicsOutput.h
+//
+// Description: EFI_GRAPHICS_OUTPUT_PROTOCOL protocol declaration
+//
+//<AMI_FHDR_END>
+//**********************************************************************
+#ifndef __EFI_GRAPHICS_OUTPUT_PROTOCOL__H__
+#define __EFI_GRAPHICS_OUTPUT_PROTOCOL__H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <EFI.h>
+
+#define EFI_GRAPHICS_OUTPUT_PROTOCOL_GUID \
+ { 0x9042a9de, 0x23dc, 0x4a38, 0x96, 0xfb, 0x7a, 0xde, 0xd0, 0x80, 0x51, 0x6a }
+
+GUID_VARIABLE_DECLARATION (gEfiGraphicsOutputProtocolGuid, EFI_GRAPHICS_OUTPUT_PROTOCOL_GUID);
+
+typedef struct _EFI_GRAPHICS_OUTPUT_PROTOCOL EFI_GRAPHICS_OUTPUT_PROTOCOL;
+
+typedef struct {
+ UINT32 RedMask;
+ UINT32 GreenMask;
+ UINT32 BlueMask;
+ UINT32 ReservedMask;
+} EFI_PIXEL_BITMASK;
+
+typedef enum {
+ PixelRedGreenBlueReserved8BitPerColor,
+ PixelBlueGreenRedReserved8BitPerColor,
+ PixelBitMask,
+ PixelBltOnly,
+ PixelFormatMax
+} EFI_GRAPHICS_PIXEL_FORMAT;
+
+typedef struct {
+ UINT32 Version;
+ UINT32 HorizontalResolution;
+ UINT32 VerticalResolution;
+ EFI_GRAPHICS_PIXEL_FORMAT PixelFormat;
+ EFI_PIXEL_BITMASK PixelInformation;
+ UINT32 PixelsPerScanLine;
+} EFI_GRAPHICS_OUTPUT_MODE_INFORMATION;
+
+typedef EFI_STATUS (EFIAPI *EFI_GRAPHICS_OUTPUT_PROTOCOL_QUERY_MODE)(
+ IN EFI_GRAPHICS_OUTPUT_PROTOCOL *This,
+ IN UINT32 ModeNumber,
+ OUT UINTN *SizeOfInfo,
+ OUT EFI_GRAPHICS_OUTPUT_MODE_INFORMATION **Info
+);
+
+typedef EFI_STATUS (EFIAPI *EFI_GRAPHICS_OUTPUT_PROTOCOL_SET_MODE)(
+ IN EFI_GRAPHICS_OUTPUT_PROTOCOL *This,
+ IN UINT32 ModeNumber
+);
+
+typedef struct {
+ UINT8 Blue;
+ UINT8 Green;
+ UINT8 Red;
+ UINT8 Reserved;
+} EFI_GRAPHICS_OUTPUT_BLT_PIXEL;
+
+typedef union {
+ EFI_GRAPHICS_OUTPUT_BLT_PIXEL Pixel;
+ UINT32 Raw;
+} EFI_GRAPHICS_OUTPUT_BLT_PIXEL_UNION;
+
+typedef enum {
+ EfiBltVideoFill,
+ EfiBltVideoToBltBuffer,
+ EfiBltBufferToVideo,
+ EfiBltVideoToVideo,
+ EfiGraphicsOutputBltOperationMax
+} EFI_GRAPHICS_OUTPUT_BLT_OPERATION;
+
+typedef EFI_STATUS (EFIAPI *EFI_GRAPHICS_OUTPUT_PROTOCOL_BLT) (
+ IN EFI_GRAPHICS_OUTPUT_PROTOCOL *This,
+ IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL *BltBuffer OPTIONAL,
+ IN EFI_GRAPHICS_OUTPUT_BLT_OPERATION BltOperation,
+ IN UINTN SourceX, IN UINTN SourceY,
+ IN UINTN DestinationX, IN UINTN DestinationY,
+ IN UINTN Width, IN UINTN Height,
+ IN UINTN Delta OPTIONAL
+);
+
+typedef struct {
+ UINT32 MaxMode;
+ UINT32 Mode;
+ EFI_GRAPHICS_OUTPUT_MODE_INFORMATION *Info;
+ UINTN SizeOfInfo;
+ EFI_PHYSICAL_ADDRESS FrameBufferBase;
+ UINTN FrameBufferSize;
+} EFI_GRAPHICS_OUTPUT_PROTOCOL_MODE;
+
+struct _EFI_GRAPHICS_OUTPUT_PROTOCOL {
+ EFI_GRAPHICS_OUTPUT_PROTOCOL_QUERY_MODE QueryMode;
+ EFI_GRAPHICS_OUTPUT_PROTOCOL_SET_MODE SetMode;
+ EFI_GRAPHICS_OUTPUT_PROTOCOL_BLT Blt;
+ EFI_GRAPHICS_OUTPUT_PROTOCOL_MODE *Mode;
+};
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2006, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//********************************************************************** \ No newline at end of file
diff --git a/Include/Protocol/GuidedSectionExtraction.h b/Include/Protocol/GuidedSectionExtraction.h
new file mode 100644
index 0000000..1f512d5
--- /dev/null
+++ b/Include/Protocol/GuidedSectionExtraction.h
@@ -0,0 +1,103 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2005, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+//**********************************************************************
+// $Header: /Alaska/BIN/Core/Include/Protocol/GuidedSectionExtraction.h 2 3/13/06 1:40a Felixp $
+//
+// $Revision: 2 $
+//
+// $Date: 3/13/06 1:40a $
+//*****************************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Core/Include/Protocol/GuidedSectionExtraction.h $
+//
+// 2 3/13/06 1:40a Felixp
+//
+// 1 1/28/05 12:44p Felixp
+//
+// 2 1/18/05 3:22p Felixp
+// PrintDebugMessage renamed to Trace
+//
+// 1 12/23/04 9:41a Felixp
+//
+// 2 12/31/03 2:53p Markw
+// Added S-Header.
+//
+// 1 12/24/03 1:59p Markw
+//
+//
+//*****************************************************************************
+//<AMI_FHDR_START>
+//
+// Name: GuidedSectionExtraction.h
+//
+// Description: This file is an include file used to define the Protocol for the
+// Guided Section Extraction Protocol. It is used for GUID processing
+// for the Firmware Volume.
+//
+//<AMI_FHDR_END>
+//*****************************************************************************
+
+#ifndef __GUIDED_SECTION_EXTRACTION_PROTOCOL_H__
+#define __GUIDED_SECTION_EXTRACTION_PROTOCOL_H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+#include <EFI.h>
+
+typedef struct _EFI_GUIDED_SECTION_EXTRACTION_PROTOCOL EFI_GUIDED_SECTION_EXTRACTION_PROTOCOL;
+
+typedef EFI_STATUS (EFIAPI *EFI_EXTRACT_GUIDED_SECTION)(
+ IN EFI_GUIDED_SECTION_EXTRACTION_PROTOCOL *This,
+ IN VOID *InputSection,
+ OUT VOID **OutputBuffer,
+ OUT UINTN *OutputSize,
+ OUT UINT32 *AuthenticationStatus);
+
+//**********************************************************************
+//<AMI_SHDR_START>
+//
+// Name: EFI_GUIDED_SECTION_EXTRACTION_PROTOCOL
+//
+// Description: Provide proccessing for extracting a Guided Section.
+//
+// Fields: Name Type Description
+// ------------------------------------------------------------
+// ExtractSection EFI_EXTRACT_GUIDED_SECTION
+//
+//<AMI_SHDR_END>
+//**********************************************************************
+typedef struct _EFI_GUIDED_SECTION_EXTRACTION_PROTOCOL {
+ EFI_EXTRACT_GUIDED_SECTION ExtractSection;
+} EFI_GUIDED_SECTION_EXTRACTION_PROTOCOL;
+
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2005, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
diff --git a/Include/Protocol/HII.h b/Include/Protocol/HII.h
new file mode 100644
index 0000000..4c27e3f
--- /dev/null
+++ b/Include/Protocol/HII.h
@@ -0,0 +1,1009 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2005, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/BIN/Core/Include/Protocol/HII.h 11 10/14/09 10:24p Felixp $Revision: 14 $
+//
+// $Date: 10/14/09 10:24p $
+//**********************************************************************
+// Revision History
+// ----------------
+//**********************************************************************
+//<AMI_FHDR_START>
+//
+// Name: Hii.h
+//
+// Description: This file defines the Human Interface Infrastructure protocol
+// which will be used by resources which want to publish
+// IFR/Font/String data and have it collected by the
+// Configuration engine.
+//
+//<AMI_FHDR_END>
+//**********************************************************************
+#ifndef __HII_PROTOCOL_H__
+#define __HII_PROTOCOL_H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+/****** DO NOT WRITE ABOVE THIS LINE *******/
+#if EFI_SPECIFICATION_VERSION>0x20000 && !defined(GUID_VARIABLE_DEFINITION)
+#pragma message("The Include\\Hii.h header contains UEFI 2.0 definitions")
+#pragma message("UEFI 2.1 projects must use different set of headers:")
+#pragma message("\tfor generic HII definitions use: UefiHii.h")
+#pragma message("\tfor HII database operations use: Protocol\\HiiDatabase.h")
+#pragma message("\tfor HII string operations use: Protocol\\HiiString.h")
+#pragma message("The supported version of the UEFI specification is defined by the EFI_SPECIFICATION_VERSION SDL token")
+#error the header is depricated
+#else
+//======================================================================
+#include <EFI.h>
+
+#define EFI_HII_OLD_PROTOCOL_GUID \
+ { 0xcd361957, 0xafbe, 0x425e, 0xa3, 0x58, 0x5f, 0x58, 0x89, 0xcf, 0xfe, 0x7b }
+#define EFI_HII_NEW_PROTOCOL_GUID \
+ { 0xea816d2c, 0xcee5, 0x4f02, 0x99, 0xb5, 0xd3, 0x90, 0x5c, 0xbb, 0xd0, 0x77 }
+#define EFI_HII_PROTOCOL_GUID EFI_HII_NEW_PROTOCOL_GUID
+
+GUID_VARIABLE_DECLARATION(gEfiHiiProtocolGuid,EFI_HII_PROTOCOL_GUID);
+
+#ifndef GUID_VARIABLE_DEFINITION
+#include <Protocol/UgaDraw.h>
+
+typedef struct _EFI_HII_PROTOCOL EFI_HII_PROTOCOL;
+
+//======================================================================
+// Global definition
+//======================================================================
+
+//======================================================================
+// Defined Type values
+#define EFI_HII_FONT 1
+#define EFI_HII_STRING 2
+#define EFI_HII_IFR 3
+#define EFI_HII_KEYBOARD 4
+#define EFI_HII_HANDLES 5
+#define EFI_HII_VARIABLE 6 //not in current spec
+#define EFI_HII_DEVICE_PATH 7 //not in current spec
+
+
+//Unicode Char const
+//#define NARROW_CHAR 0xFFF0
+//#define WIDE_CHAR 0xFFF1
+//#define NON_BREAKING_CHAR 0xFFF2
+
+
+//Gliph const
+#define GLYPH_W 8
+#define GLYPH_H 19
+
+
+typedef UINT16 EFI_FORM_ID;
+typedef UINT16 EFI_FORM_LABEL;
+typedef UINT16 EFI_HII_HANDLE;
+
+// Glyph Attributes
+#define GLYPH_NON_SPACING 1
+#define GLYPH_WIDE 2
+
+// String attributes
+#define LANG_RIGHT_TO_LEFT 1
+
+//String releated definitions
+typedef UINT32 RELOFST;
+typedef UINT16 STRING_REF;
+typedef CHAR16 *EFI_STRING;
+
+//IFR releated definitions
+#define EFI_IFR_FORM_OP 0x01
+#define EFI_IFR_SUBTITLE_OP 0x02
+#define EFI_IFR_TEXT_OP 0x03
+#define EFI_IFR_GRAPHIC_OP 0x04
+#define EFI_IFR_ONE_OF_OP 0x05
+#define EFI_IFR_CHECKBOX_OP 0x06
+#define EFI_IFR_NUMERIC_OP 0x07
+#define EFI_IFR_PASSWORD_OP 0x08
+#define EFI_IFR_ONE_OF_OPTION_OP 0x09 // ONEOF OPTION field
+#define EFI_IFR_SUPPRESS_IF_OP 0x0A
+#define EFI_IFR_END_FORM_OP 0x0B
+#define EFI_IFR_HIDDEN_OP 0x0C
+#define EFI_IFR_END_FORM_SET_OP 0x0D
+#define EFI_IFR_FORM_SET_OP 0x0E
+#define EFI_IFR_REF_OP 0x0F
+#define EFI_IFR_END_ONE_OF_OP 0x10
+#define EFI_IFR_END_OP EFI_IFR_END_ONE_OF_OP
+#define EFI_IFR_INCONSISTENT_IF_OP 0x11
+#define EFI_IFR_EQ_ID_VAL_OP 0x12
+#define EFI_IFR_EQ_ID_ID_OP 0x13
+#define EFI_IFR_EQ_ID_LIST_OP 0x14
+#define EFI_IFR_AND_OP 0x15
+#define EFI_IFR_OR_OP 0x16
+#define EFI_IFR_NOT_OP 0x17
+#define EFI_IFR_END_IF_OP 0x18 // for endif of inconsistentif, suppressif, grayoutif
+#define EFI_IFR_GRAYOUT_IF_OP 0x19
+#define EFI_IFR_DATE_OP 0x1A
+#define EFI_IFR_TIME_OP 0x1B
+#define EFI_IFR_STRING_OP 0x1C
+#define EFI_IFR_LABEL_OP 0x1D
+#define EFI_IFR_SAVE_DEFAULTS_OP 0x1E
+#define EFI_IFR_RESTORE_DEFAULTS_OP 0x1F
+#define EFI_IFR_BANNER_OP 0x20
+#define EFI_IFR_INVENTORY_OP 0x21
+#define EFI_IFR_EQ_VAR_VAL_OP 0x22
+#define EFI_IFR_ORDERED_LIST_OP 0x23
+#define EFI_IFR_VARSTORE_OP 0x24
+#define EFI_IFR_VARSTORE_SELECT_OP 0x25
+#define EFI_IFR_VARSTORE_SELECT_PAIR_OP 0x26
+#define EFI_IFR_LAST_OPCODE EFI_IFR_VARSTORE_SELECT_PAIR_OP
+#define EFI_IFR_NV_ACCESS_COMMAND 0xFF
+
+//Values for the flags fields in some VFR opcodes
+#define EFI_IFR_FLAG_DEFAULT 0x01
+#define EFI_IFR_FLAG_MANUFACTURING 0x02
+#define EFI_IFR_FLAG_INTERACTIVE 0x04
+#define EFI_IFR_FLAG_NV_ACCESS 0x08
+#define EFI_IFR_FLAG_RESET_REQUIRED 0x10
+#define EFI_IFR_FLAG_LATE_CHECK 0x20
+#define EFI_IFR_FLAG_CREATED 0x80 // Used to flag dynamically created op-codes.
+
+#define EFI_NON_DEVICE_CLASS 0x00 // Useful when you do not want something in the Device Manager
+#define EFI_DISK_DEVICE_CLASS 0x01
+#define EFI_VIDEO_DEVICE_CLASS 0x02
+#define EFI_NETWORK_DEVICE_CLASS 0x04
+#define EFI_INPUT_DEVICE_CLASS 0x08
+#define EFI_ON_BOARD_DEVICE_CLASS 0x10
+#define EFI_OTHER_DEVICE_CLASS 0x20
+
+#define EFI_SETUP_APPLICATION_SUBCLASS 0x00
+#define EFI_GENERAL_APPLICATION_SUBCLASS 0x01
+#define EFI_FRONT_PAGE_SUBCLASS 0x02
+#define EFI_SINGLE_USE_SUBCLASS 0x03 // Used to display a single entity and then exit
+
+#define EFI_IFR_BANNER_ALIGN_LEFT 0
+#define EFI_IFR_BANNER_ALIGN_CENTER 1
+#define EFI_IFR_BANNER_ALIGN_RIGHT 2
+#define EFI_IFR_BANNER_TIMEOUT 0xFF
+
+//----------------------------------------------------------------------------
+// Modifier values
+
+#define EFI_NULL_MODIFIER 0x0000
+#define EFI_LEFT_CONTROL_MODIFIER 0x0001
+#define EFI_RIGHT_CONTROL_MODIFIER 0x0002
+#define EFI_LEFT_ALT_MODIFIER 0x0003
+#define EFI_RIGHT_ALT_MODIFIER 0x0004
+#define EFI_ALT_GR_MODIFIER 0x0005
+#define EFI_INSERT_MODIFIER 0x0006
+#define EFI_DELETE_MODIFIER 0x0007
+#define EFI_PAGE_DOWN_MODIFIER 0x0008
+#define EFI_PAGE_UP_MODIFIER 0x0009
+#define EFI_HOME_MODIFIER 0x000A
+#define EFI_END_MODIFIER 0x000B
+#define EFI_LEFT_SHIFT_MODIFIER 0x000C
+#define EFI_RIGHT_SHIFT_MODIFIER 0x000D
+#define EFI_CAPS_LOCK_MODIFIER 0x000E
+#define EFI_NUM_LOCK_MODIFIER 0x000F
+#define EFI_LEFT_ARROW_MODIFIER 0x0010
+#define EFI_RIGHT_ARROW_MODIFIER 0x0011
+#define EFI_DOWN_ARROW_MODIFIER 0x0012
+#define EFI_UP_ARROW_MODIFIER 0X0013
+#define EFI_DEAD_KEY_MODIFIER 0x0014
+#define EFI_DEAD_KEY_DEPENDENCY_MODIFIER 0x0015
+#define EFI_FUNCTION_KEY_ONE_MODIFIER 0x0016
+#define EFI_FUNCTION_KEY_TWO_MODIFIER 0x0017
+#define EFI_FUNCTION_KEY_THREE_MODIFIER 0x0018
+#define EFI_FUNCTION_KEY_FOUR_MODIFIER 0x0019
+#define EFI_FUNCTION_KEY_FIVE_MODIFIER 0x001A
+#define EFI_FUNCTION_KEY_SIX_MODIFIER 0x001B
+#define EFI_FUNCTION_KEY_SEVEN_MODIFIER 0x001C
+#define EFI_FUNCTION_KEY_EIGHT_MODIFIER 0x001D
+#define EFI_FUNCTION_KEY_NINE_MODIFIER 0x001E
+#define EFI_FUNCTION_KEY_TEN_MODIFIER 0x001F
+#define EFI_FUNCTION_KEY_ELEVEN_MODIFIER 0x0020
+#define EFI_FUNCTION_KEY_TWELVE_MODIFIER 0x0021
+
+// Keys that have multiple control functions based on modifier
+// settings are handled in the keyboard driver implementation.
+// For instance PRINT_KEY might have a modifier held down and
+// is still a nonprinting character, but might have an alternate
+// control function like SYSREQUEST
+
+#define EFI_PRINT_MODIFIER 0x0022
+#define EFI_SYS_REQUEST_MODIFIER 0x0023
+#define EFI_SCROLL_LOCK_MODIFIER 0x0024
+#define EFI_PAUSE_MODIFIER 0x0025
+#define EFI_BREAK_MODIFIER 0x0026
+
+// Keyboard layout switching modifiers
+// This assumes that the driver implementation will not
+// assign a key definition if one of the following modifier
+// values is presented.
+
+#define EFI_LAYOUT_SWITCH_MODIFIER 0x0027
+#define EFI_LAYOUT_SWITCH_DEPENDENCY_MODIFIER 0x0028
+
+
+//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+#pragma pack(push, 1) //must be 1
+//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
+//======================================================================
+//Packages
+typedef struct _EFI_HII_PACK_HEADER {
+ UINT32 Length;
+ UINT16 Type;
+} EFI_HII_PACK_HEADER;
+
+
+//********************************************************
+// EFI_HII_HANDLE_PACK
+//********************************************************
+typedef struct _EFI_HII_HANDLE_PACK{
+ EFI_HII_PACK_HEADER Header; // Must be filled in
+ EFI_HANDLE ImageHandle; // Must be filled in
+ EFI_HANDLE DeviceHandle; // Optional
+ EFI_HANDLE ControllerHandle; // Optional
+ EFI_HANDLE CallbackHandle; // Optional
+} EFI_HII_HANDLE_PACK;
+
+
+typedef struct EFI_HII_PACKAGES {
+//TODO: HII Spec. 0.92 defines NumberOfPackages as UINT32
+//However, EDK header defines it as UINTN
+//Should we be compatible with the spec or with EDK?
+//For now, we are choosing EDK
+// UINT32 NumberOfPackages;
+ UINTN NumberOfPackages;
+ EFI_GUID *GuidId;
+// EFI_HII_HANDLE_PACK *HandlePack;
+
+} EFI_HII_PACKAGES;
+
+
+//======================================================================
+// EFI_HII_IFR_PACK
+//======================================================================
+typedef struct {
+ EFI_HII_PACK_HEADER Header;
+} EFI_HII_IFR_PACK;
+
+//======================================================================
+// EFI_HII_VARIABLE_PACK
+//======================================================================
+typedef struct {
+ EFI_HII_PACK_HEADER Header;
+ EFI_GUID VariableGuid;
+ UINT32 VariableNameLength;
+ UINT16 VariableId;
+// CHAR16 VariableName[]; //Null-terminated
+} EFI_HII_VARIABLE_PACK;
+
+//======================================================================
+// EFI_HII_VARIABLE_PACK_LIST
+//======================================================================
+typedef struct _EFI_HII_VARIABLE_PACK_LIST {
+ struct _EFI_HII_VARIABLE_PACK_LIST *NextVariablePack;
+ EFI_HII_VARIABLE_PACK *VariablePack;
+//Per implementation but better to gave it anywhere in the memory.
+ //EFI_HII_VARIABLE_PACK Content //
+} EFI_HII_VARIABLE_PACK_LIST;
+
+
+//======================================================================
+// EFI_DEVICE_PATH_PACK
+//======================================================================
+typedef struct {
+ EFI_HII_PACK_HEADER Header;
+// EFI_DEVICE_PATH DevicePath[];
+} EFI_HII_DEVICE_PATH_PACK;
+
+//======================================================================
+// EFI_HII_DATA_TABLE
+//======================================================================
+typedef struct {
+ EFI_HII_HANDLE HiiHandle;
+ EFI_GUID PackageGuid;
+ UINT32 DataTableSize;
+ UINT32 IfrDataOffset;
+ UINT32 StringDataOffset;
+ UINT32 VariableDataOffset;
+ UINT32 DevicePathOffset;
+ UINT32 NumberOfVariableData;
+ UINT32 NumberOfLanguages;
+ //EFI_HII_DEVICE_PATH_PACK DevicePath[];
+ //EFI_HII_VARIABLE_PACK VariableData[];
+ //EFI_HII_IFR_PACK IfrData;
+ //EFI_HII_STRING_PACK StringData[];
+} EFI_HII_DATA_TABLE;
+
+//======================================================================
+// EFI_HII_EXPORT_TABLE
+//======================================================================
+typedef struct {
+//HII .91 spec defines following field as UINT32 but Intel's R8 implememtation still
+//using UINT16 value. To be Compliant with ITK, I'll leave this field as UINT16
+//TODO//TODO//TODO//TODO//TODO//TODO//TODO//TODO
+// uncomment this and comment next line
+// UINT32 NumberOfHiiDataTables;
+//TODO//TODO//TODO//TODO//TODO//TODO//TODO//TODO
+ UINT16 NumberOfHiiDataTables;
+ EFI_GUID Revision;
+ //EFI_HII_DATA_TABLE HiiDataTable[];
+} EFI_HII_EXPORT_TABLE;
+
+//======================================================================
+typedef struct {
+ BOOLEAN FormSetUpdate; // If TRUE, next variable is significant
+ EFI_PHYSICAL_ADDRESS FormCallbackHandle; // If not 0, will update Formset with this info
+ BOOLEAN FormUpdate; // If TRUE, next variable is significant
+//TODO//TODO//TODO//TODO//TODO//TODO//TODO//TODO//TODO//TODO//TODO//TODO//TODO//TODO//TODO//TODO
+ //to maintain compatibility with Intel's Setup I changed this
+ //Intel doesnot have this field included in Sources but they does in Spec??????????
+ //UINT16 FormValue; // Which Form to be Updated if FormUpdate=TRUE;
+//TODO//TODO//TODO//TODO//TODO//TODO//TODO//TODO//TODO//TODO//TODO//TODO//TODO//TODO//TODO//TODO
+ STRING_REF FormTitle; // If not 0, will update Form with this info
+ UINT16 DataCount; // The number of Data entries in this structure
+ UINT8 *Data; // An array of 1+ op-codes, specified by DataCount
+} EFI_HII_UPDATE_DATA;
+
+//======================================================================
+// A string package is used to localize strings to a particular
+// language. The package is associated with a particular driver
+// or set of drivers. Tools are used to associate tokens with
+// string references in forms and in programs. These tokens are
+// language agnostic. When paired with a language pack (directly
+// or indirectly), the string token resolves into an actual
+// UNICODE string. The NumStringPointers determines how many
+// StringPointers (offset values) there are as well as the total
+// number of Strings that are defined.
+typedef struct {
+ EFI_HII_PACK_HEADER Header;
+ RELOFST LanguageNameString;
+ RELOFST PrintableLanguageName;
+ UINT32 NumStringPointers;
+ UINT32 Attributes;
+// RELOFST StringPointers[];
+// EFI_STRING Strings[];
+} EFI_HII_STRING_PACK;
+
+//======================================================================
+
+typedef struct {
+ CHAR16 UnicodeWeight;
+ UINT8 Attributes;
+ UINT8 GlyphCol1[GLYPH_H];
+} EFI_NARROW_GLYPH;
+
+typedef struct {
+ CHAR16 UnicodeWeight;
+ UINT8 Attributes;
+ UINT8 GlyphCol1[GLYPH_H];
+ UINT8 GlyphCol2[GLYPH_H];
+ UINT8 Pad[3];
+} EFI_WIDE_GLYPH;
+
+//======================================================================
+// A font list consists of a font header followed by a series
+// of glyph structures. Note that fonts are not language specific.
+typedef struct {
+ EFI_HII_PACK_HEADER Header;
+ UINT16 NumberOfNarrowGlyphs;
+ UINT16 NumberOfWideGlyphs;
+} EFI_HII_FONT_PACK;
+
+//======================================================================
+// Keyboard Keys Definition
+typedef enum {
+ EfiKeyLCtrl, EfiKeyA0, EfiKeyLAlt, EfiKeySpaceBar,
+ EfiKeyA2, EfiKeyA3, EfiKeyA4, EfiKeyRCtrl, EfiKeyLeftArrow,
+ EfiKeyDownArrow, EfiKeyRightArrow, EfiKeyZero,
+ EfiKeyPeriod, EfiKeyEnter, EfiKeyLShift, EfiKeyB0,
+ EfiKeyB1, EfiKeyB2, EfiKeyB3, EfiKeyB4, EfiKeyB5, EfiKeyB6,
+ EfiKeyB7, EfiKeyB8, EfiKeyB9, EfiKeyB10, EfiKeyRshift,
+ EfiKeyUpArrow, EfiKeyOne, EfiKeyTwo, EfiKeyThree,
+ EfiKeyCapsLock, EfiKeyC1, EfiKeyC2, EfiKeyC3, EfiKeyC4,
+ EfiKeyC5, EfiKeyC6, EfiKeyC7, EfiKeyC8, EfiKeyC9,
+ EfiKeyC10, EfiKeyC11, EfiKeyC12, EfiKeyFour, EfiKeyFive,
+ EfiKeySix, EfiKeyPlus, EfiKeyTab, EfiKeyD1, EfiKeyD2,
+ EfiKeyD3, EfiKeyD4, EfiKeyD5, EfiKeyD6, EfiKeyD7, EfiKeyD8,
+ EfiKeyD9, EfiKeyD10, EfiKeyD11, EfiKeyD12, EfiKeyD13,
+ EfiKeyDel, EfiKeyEnd, EfiKeyPgDn, EfiKeySeven, EfiKeyEight,
+ EfiKeyNine, EfiKeyE0, EfiKeyE1, EfiKeyE2, EfiKeyE3,
+ EfiKeyE4, EfiKeyE5, EfiKeyE6, EfiKeyE7, EfiKeyE8, EfiKeyE9,
+ EfiKeyE10, EfiKeyE11, EfiKeyE12, EfiKeyBackSpace,
+ EfiKeyIns, EfiKeyHome, EfiKeyPgUp, EfiKeyNLck, EfiKeySlash,
+ EfiKeyAsterisk, EfiKeyMinus, EfiKeyEsc, EfiKeyF1, EfiKeyF2,
+ EfiKeyF3, EfiKeyF4, EfiKeyF5, EfiKeyF6, EfiKeyF7, EfiKeyF8,
+ EfiKeyF9, EfiKeyF10, EfiKeyF11, EfiKeyF12, EfiKeyPrint,
+ EfiKeySLck, EfiKeyPause
+} EFI_KEY;
+
+typedef struct {
+ EFI_KEY Key;
+ CHAR16 Unicode;
+ CHAR16 ShiftedUnicode;
+ CHAR16 AltGrUnicode;
+ CHAR16 ShiftedAltGrUnicode;
+ UINT16 Modifier;
+} EFI_KEY_DESCRIPTOR;
+
+//======================================================================
+// This structure allows a sparse set of keys to be redefined
+// or a complete redefinition of the keyboard layout. Most
+// keyboards have a lot of commonality in their layouts, therefore
+// only defining those keys that need to change from the default
+// minimizes the passed in information.
+//
+// Additionally, when an update occurs, the active keyboard layout
+// will be switched to the newly updated keyboard layout. This
+// allows for situations that when a keyboard layout driver is
+// loaded as part of system initialization, the system will default
+// the keyboard behavior to the new layout.
+//
+// Each call to update the keyboard mapping should contain the
+// complete set of key descriptors to be updated, since every
+// call to the HII which contains an EFI_HII_KEYBOARD_PACK will
+// wipe the previous set of overrides. A call to
+//
+typedef struct {
+ EFI_HII_PACK_HEADER Header;
+ EFI_KEY_DESCRIPTOR *Descriptor;
+ UINT8 DescriptorCount;
+} EFI_HII_KEYBOARD_PACK;
+
+
+
+// The StringPack is a pointer to a series of EFI_HII_STRING_PACK structures.
+// The terminating instance of this structure will be a NULL entry.
+
+
+//TODO//TODO//TODO//TODO//TODO//TODO//TODO//TODO//TODO//TODO//TODO//TODO
+//Not actual anymore is been replaced by EFI_HII_PACKAGES structure below
+typedef struct {
+ EFI_HII_IFR_PACK *IfrPack;
+ EFI_HII_FONT_PACK *FontPack;
+ EFI_HII_STRING_PACK *StringPack;
+ EFI_HII_KEYBOARD_PACK *KeyboardPack;
+ EFI_GUID *GuidId;
+} EFI_HII_PACK_LIST;
+
+
+//======================================================================
+// IFR Structure definitions
+typedef struct {
+ UINT8 OpCode;
+ UINT8 Length;
+} EFI_IFR_OP_HEADER;
+
+typedef struct {
+ EFI_IFR_OP_HEADER Header;
+ EFI_GUID Guid;
+ STRING_REF FormSetTitle;
+ STRING_REF Help;
+ EFI_PHYSICAL_ADDRESS CallbackHandle;
+ UINT16 Class;
+ UINT16 SubClass;
+ UINT16 NvDataSize; // set once, size of the NV data as defined in the script
+} EFI_IFR_FORM_SET;
+
+typedef struct {
+ EFI_IFR_OP_HEADER Header;
+ UINT16 FormId;
+ STRING_REF FormTitle;
+} EFI_IFR_FORM;
+
+typedef struct {
+ EFI_IFR_OP_HEADER Header;
+ UINT16 LabelId;
+} EFI_IFR_LABEL;
+
+typedef struct {
+ EFI_IFR_OP_HEADER Header;
+ STRING_REF SubTitle;
+} EFI_IFR_SUBTITLE;
+
+typedef struct {
+ EFI_IFR_OP_HEADER Header;
+ STRING_REF Help;
+ STRING_REF Text;
+ STRING_REF TextTwo;
+ UINT8 Flags; // This is included solely for purposes of interactive/dynamic support.
+ UINT16 Key; // Value to be passed to caller to identify this particular op-code
+} EFI_IFR_TEXT;
+
+//
+// goto
+//
+typedef struct {
+ EFI_IFR_OP_HEADER Header;
+ UINT16 FormId;
+ STRING_REF Prompt;
+ STRING_REF Help; // The string Token for the context-help
+ UINT8 Flags; // This is included solely for purposes of interactive/dynamic support.
+ UINT16 Key; // Value to be passed to caller to identify this particular op-code
+} EFI_IFR_REF;
+
+typedef struct {
+ EFI_IFR_OP_HEADER Header;
+} EFI_IFR_END_FORM;
+
+typedef struct {
+ EFI_IFR_OP_HEADER Header;
+} EFI_IFR_END_FORM_SET;
+
+//
+// Also notice that the IFR_ONE_OF and IFR_CHECK_BOX are identical in structure......code assumes this to be true, if this ever
+// changes we need to revisit the InitializeTagStructures code
+//
+typedef struct {
+ EFI_IFR_OP_HEADER Header;
+ UINT16 QuestionId; // The ID designating what the question is about...sucked in from a #define, likely in the form of a variable name
+ UINT8 Width; // The Size of the Data being saved
+ STRING_REF Prompt; // The String Token for the Prompt
+ STRING_REF Help; // The string Token for the context-help
+} EFI_IFR_ONE_OF;
+
+typedef struct {
+ EFI_IFR_OP_HEADER Header;
+ UINT16 QuestionId; // The offset in NV for storage of the data
+ UINT8 MaxEntries; // The maximum number of options in the ordered list (=size of NVStore)
+ STRING_REF Prompt; // The string token for the prompt
+ STRING_REF Help; // The string token for the context-help
+} EFI_IFR_ORDERED_LIST;
+
+typedef struct {
+ EFI_IFR_OP_HEADER Header;
+ UINT16 QuestionId; // The ID designating what the question is about...sucked in from a #define, likely in the form of a variable name
+ UINT8 Width; // The Size of the Data being saved
+ STRING_REF Prompt; // The String Token for the Prompt
+ STRING_REF Help; // The string Token for the context-help
+ UINT8 Flags; // For now, if non-zero, means that it is the default option, - further definition likely
+ UINT16 Key; // Value to be passed to caller to identify this particular op-code
+} EFI_IFR_CHECK_BOX;
+
+typedef struct {
+ EFI_IFR_OP_HEADER Header;
+ STRING_REF Option; // The string token describing the option
+ UINT16 Value; // The value associated with this option that is stored in the NVRAM if chosen
+ UINT8 Flags; // For now, if non-zero, means that it is the default option, - further definition likely above
+ UINT16 Key; // Value to be passed to caller to identify this particular op-code
+} EFI_IFR_ONE_OF_OPTION;
+
+typedef struct {
+ EFI_IFR_OP_HEADER Header;
+ UINT16 QuestionId; // The ID designating what the question is about...sucked in from a #define, likely in the form of a variable name
+ UINT8 Width; // The Size of the Data being saved
+ STRING_REF Prompt; // The String Token for the Prompt
+ STRING_REF Help; // The string Token for the context-help
+ UINT8 Flags; // This is included solely for purposes of interactive/dynamic support.
+ UINT16 Key; // Value to be passed to caller to identify this particular op-code
+ UINT16 Minimum;
+ UINT16 Maximum;
+ UINT16 Step; // If step is 0, then manual input is specified, otherwise, left/right arrow selection is called for
+ UINT16 Default;
+} EFI_IFR_NUMERIC;
+
+//
+// There is an interesting twist with regards to Time and Date. This is one of the few items which can accept input from
+// a user, however may or may not need to use storage in the NVRAM space. The decided method for determining if NVRAM space
+// will be used (only for a TimeOp or DateOp) is: If .QuestionId == 0 && .Width == 0 (normally an impossibility) then use system
+// resources to store the data away and not NV resources. In other words, the setup engine will call gRT->SetTime, and gRT->SetDate
+// for the saving of data, and the values displayed will be from the gRT->GetXXXX series of calls.
+//
+typedef struct {
+ EFI_IFR_NUMERIC Hour;
+ EFI_IFR_NUMERIC Minute;
+ EFI_IFR_NUMERIC Second;
+} EFI_IFR_TIME;
+
+typedef struct {
+ EFI_IFR_NUMERIC Year;
+ EFI_IFR_NUMERIC Month;
+ EFI_IFR_NUMERIC Day;
+} EFI_IFR_DATE;
+
+typedef struct {
+ EFI_IFR_OP_HEADER Header;
+ UINT16 QuestionId; // The ID designating what the question is about...sucked in from a #define, likely in the form of a variable name
+ UINT8 Width; // The Size of the Data being saved -- BUGBUG -- remove someday
+ STRING_REF Prompt; // The String Token for the Prompt
+ STRING_REF Help; // The string Token for the context-help
+ UINT8 Flags; // This is included solely for purposes of interactive/dynamic support.
+ UINT16 Key; // Value to be passed to caller to identify this particular op-code
+ UINT8 MinSize; // Minimum allowable sized password
+ UINT8 MaxSize; // Maximum allowable sized password
+ UINT16 Encoding;
+} EFI_IFR_PASSWORD;
+
+typedef struct {
+ EFI_IFR_OP_HEADER Header;
+ UINT16 QuestionId; // The ID designating what the question is about...sucked in from a #define, likely in the form of a variable name
+ UINT8 Width; // The Size of the Data being saved -- BUGBUG -- remove someday
+ STRING_REF Prompt; // The String Token for the Prompt
+ STRING_REF Help; // The string Token for the context-help
+ UINT8 Flags; // This is included solely for purposes of interactive/dynamic support.
+ UINT16 Key; // Value to be passed to caller to identify this particular op-code
+ UINT8 MinSize; // Minimum allowable sized password
+ UINT8 MaxSize; // Maximum allowable sized password
+} EFI_IFR_STRING;
+
+typedef struct {
+ EFI_IFR_OP_HEADER Header;
+} EFI_IFR_END_ONE_OF;
+
+typedef struct {
+ EFI_IFR_OP_HEADER Header;
+ UINT16 Value;
+ UINT16 Key;
+} EFI_IFR_HIDDEN;
+
+typedef struct {
+ EFI_IFR_OP_HEADER Header;
+ UINT8 Flags;
+} EFI_IFR_SUPPRESS;
+
+typedef struct {
+ EFI_IFR_OP_HEADER Header;
+ UINT8 Flags;
+} EFI_IFR_GRAYOUT;
+
+typedef struct {
+ EFI_IFR_OP_HEADER Header;
+ STRING_REF Popup;
+ UINT8 Flags;
+} EFI_IFR_INCONSISTENT;
+
+typedef struct {
+ EFI_IFR_OP_HEADER Header;
+ UINT16 QuestionId; // offset into variable storage
+ UINT8 Width; // size of variable storage
+ UINT16 Value; // value to compare against
+} EFI_IFR_EQ_ID_VAL;
+
+typedef struct {
+ EFI_IFR_OP_HEADER Header;
+ UINT16 QuestionId; // offset into variable storage
+ UINT8 Width; // size of variable storage
+ UINT16 ListLength;
+ UINT16 ValueList[1];
+} EFI_IFR_EQ_ID_LIST;
+
+typedef struct {
+ EFI_IFR_OP_HEADER Header;
+ UINT16 QuestionId1; // offset into variable storage for first value to compare
+ UINT8 Width; // size of variable storage (must be same for both)
+ UINT16 QuestionId2; // offset into variable storage for second value to compare
+} EFI_IFR_EQ_ID_ID;
+
+typedef struct {
+ EFI_IFR_OP_HEADER Header;
+ UINT16 VariableId; // offset into variable storage
+ UINT16 Value; // value to compare against
+} EFI_IFR_EQ_VAR_VAL;
+
+typedef struct {
+ EFI_IFR_OP_HEADER Header;
+} EFI_IFR_AND;
+
+typedef struct {
+ EFI_IFR_OP_HEADER Header;
+} EFI_IFR_OR;
+
+typedef struct {
+ EFI_IFR_OP_HEADER Header;
+} EFI_IFR_NOT;
+
+typedef struct {
+ EFI_IFR_OP_HEADER Header;
+} EFI_IFR_END_IF;
+
+typedef struct {
+ EFI_IFR_OP_HEADER Header;
+ UINT16 FormId;
+ STRING_REF Prompt;
+ STRING_REF Help;
+ UINT8 Flags;
+ UINT16 Key;
+} EFI_IFR_SAVE_DEFAULTS;
+
+typedef struct {
+ EFI_IFR_OP_HEADER Header;
+ STRING_REF Help;
+ STRING_REF Text;
+ STRING_REF TextTwo; // optional text
+} EFI_IFR_INVENTORY;
+
+typedef struct {
+ EFI_IFR_OP_HEADER Header;
+ EFI_GUID Guid; // GUID for the variable
+ UINT16 VarId; // variable store ID, as referenced elsewhere in the form
+ UINT16 Size; // size of the variable storage
+//UINT8 VarName[] // ASCII representation of VarName
+} EFI_IFR_VARSTORE;
+
+typedef struct {
+ EFI_IFR_OP_HEADER Header;
+ UINT16 VarId; // variable store ID, as referenced elsewhere in the form
+} EFI_IFR_VARSTORE_SELECT;
+
+//
+// Used for the ideqid VFR statement where two variable stores may be referenced in the
+// same VFR statement.
+// A browser should treat this as an EFI_IFR_VARSTORE_SELECT statement and assume that all following
+// IFR opcodes use the VarId as defined here.
+//
+typedef struct {
+ EFI_IFR_OP_HEADER Header;
+ UINT16 VarId; // variable store ID, as referenced elsewhere in the form
+ UINT16 SecondaryVarId; // variable store ID, as referenced elsewhere in the form
+} EFI_IFR_VARSTORE_SELECT_PAIR;
+
+// Save defaults and restore defaults have same structure
+#define EFI_IFR_RESTORE_DEFAULTS EFI_IFR_SAVE_DEFAULTS
+
+typedef struct {
+ EFI_IFR_OP_HEADER Header;
+ STRING_REF Title; // The string token for the banner title
+ UINT16 LineNumber; // 1-based line number
+ UINT8 Alignment; // left, center, or right-aligned
+} EFI_IFR_BANNER;
+
+typedef struct {
+ EFI_IFR_OP_HEADER Header;
+ UINT16 QuestionId; // Offset into the map
+ UINT8 StorageWidth; // Width of the value
+ CHAR8 Data[1]; // The Data itself
+} EFI_IFR_NV_DATA;
+
+
+
+//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+#pragma pack(pop) //must be 1
+//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
+typedef EFI_STATUS (EFIAPI *EFI_HII_NEW_PACK_OLD)(
+ IN EFI_HII_PROTOCOL *This,
+ IN EFI_HII_PACK_LIST *Package,
+//TODO//TODO//TODO//TODO//TODO//TODO//TODO//TODO//TODO//TODO//TODO//TODO
+//IN EFI_HII_PACKAGES *Packages,
+//TODO//TODO//TODO//TODO//TODO//TODO//TODO//TODO//TODO//TODO//TODO//TODO
+ OUT EFI_HII_HANDLE *Handle );
+
+typedef EFI_STATUS (EFIAPI *EFI_HII_NEW_PACK)(
+ IN EFI_HII_PROTOCOL *This,
+ IN EFI_HII_PACKAGES *Packages,
+ OUT EFI_HII_HANDLE *Handle );
+
+typedef EFI_STATUS (EFIAPI *EFI_HII_REMOVE_PACK) (
+ IN EFI_HII_PROTOCOL *This,
+ IN EFI_HII_HANDLE Handle );
+
+typedef EFI_STATUS (EFIAPI *EFI_HII_FIND_HANDLES) (
+ IN EFI_HII_PROTOCOL *This,
+ IN OUT UINT16 *HandleBufferLength,
+ OUT EFI_HII_HANDLE *Handle );
+
+typedef EFI_STATUS (EFIAPI *EFI_HII_EXPORT) (
+ IN EFI_HII_PROTOCOL *This,
+ IN EFI_HII_HANDLE Handle,
+ IN OUT UINTN *BufferSize,
+ OUT VOID *Buffer );
+
+//Not in Spec and do we need it????
+typedef EFI_STATUS (EFIAPI *EFI_HII_RESET_STRINGS) (
+ IN EFI_HII_PROTOCOL *This,
+ IN EFI_HII_HANDLE Handle);
+
+typedef EFI_STATUS (EFIAPI *EFI_HII_TEST_STRING) (
+ IN EFI_HII_PROTOCOL *This,
+ IN CHAR16 *StringToTest,
+ IN OUT UINT32 *FirstMissing,
+ OUT UINT32 *GlyphBufferSize );
+
+typedef EFI_STATUS (EFIAPI *EFI_HII_GET_GLYPH) (
+ IN EFI_HII_PROTOCOL *This,
+ IN CHAR16 *Source,
+ IN OUT UINT16 *Index,
+ OUT UINT8 **GlyphBuffer,
+ OUT UINT16 *BitWidth,
+ IN OUT UINT32 *InternalStatus );
+
+typedef EFI_STATUS (EFIAPI *EFI_HII_GLYPH_TO_BLT) (
+ IN EFI_HII_PROTOCOL *This,
+ IN UINT8 *GlyphBuffer,
+ IN EFI_UGA_PIXEL Foreground,
+ IN EFI_UGA_PIXEL Background,
+ IN UINTN Count,
+ IN UINTN Width,
+ IN UINTN Height,
+ IN OUT EFI_UGA_PIXEL *BltBuffer);
+
+typedef EFI_STATUS (EFIAPI *EFI_HII_NEW_STRING) (
+ IN EFI_HII_PROTOCOL *This,
+ IN CHAR16 *Language,
+ IN EFI_HII_HANDLE Handle,
+ IN OUT STRING_REF *Reference,
+ IN CHAR16 *NewString );
+
+typedef EFI_STATUS (EFIAPI *EFI_HII_GET_PRI_LANGUAGES) (
+ IN EFI_HII_PROTOCOL *This,
+ IN EFI_HII_HANDLE Handle,
+ OUT EFI_STRING *LanguageString);
+
+typedef EFI_STATUS (EFIAPI *EFI_HII_GET_SEC_LANGUAGES) (
+ IN EFI_HII_PROTOCOL *This,
+ IN EFI_HII_HANDLE Handle,
+ IN CHAR16 *PrimaryLanguage,
+ OUT EFI_STRING *LanguageString );
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_HII_GET_STRING_OLD) (
+ IN EFI_HII_PROTOCOL *This,
+ IN EFI_HII_HANDLE Handle,
+ IN STRING_REF Token,
+ IN BOOLEAN Raw,
+ IN CHAR16 *LanguageString,
+ IN OUT UINT16 *BufferLength,
+ OUT EFI_STRING StringBuffer
+ );
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_HII_GET_STRING_NEW) (
+ IN EFI_HII_PROTOCOL *This,
+ IN EFI_HII_HANDLE Handle,
+ IN STRING_REF Token,
+ IN BOOLEAN Raw,
+ IN CHAR16 *LanguageString,
+ IN OUT UINTN *BufferLength, //0.92 Spec Update
+ OUT EFI_STRING StringBuffer
+);
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_HII_GET_LINE) (
+ IN EFI_HII_PROTOCOL *This,
+ IN EFI_HII_HANDLE Handle,
+ IN STRING_REF Token,
+ IN OUT UINT16 *Index,
+ IN UINT16 LineWidth,
+ IN CHAR16 *LanguageString,
+ IN OUT UINT16 *BufferLength,
+ OUT EFI_STRING StringBuffer
+ );
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_HII_GET_FORMS_OLD) (
+ IN EFI_HII_PROTOCOL *This,
+ IN EFI_HII_HANDLE Handle,
+ IN EFI_FORM_ID FormId,
+ IN OUT UINT16 *BufferLength,
+ OUT UINT8 *Buffer
+ );
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_HII_GET_FORMS_NEW) (
+ IN EFI_HII_PROTOCOL *This,
+ IN EFI_HII_HANDLE Handle,
+ IN EFI_FORM_ID FormId,
+ IN OUT UINTN *BufferLength,
+ OUT UINT8 *Buffer
+ );
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_HII_GET_DEFAULT_IMAGE_OLD) (
+ IN EFI_HII_PROTOCOL *This,
+ IN EFI_HII_HANDLE Handle,
+ IN UINTN DefaultMask,
+ IN OUT UINT16 *BufferLength,
+ OUT UINT8 *Buffer
+ );
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_HII_GET_DEFAULT_IMAGE_NEW) (
+ IN EFI_HII_PROTOCOL *This,
+ IN EFI_HII_HANDLE Handle,
+ IN UINTN DefaultMask,
+ OUT EFI_HII_VARIABLE_PACK_LIST **VariablePackList
+ );
+
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_HII_UPDATE_FORM) (
+ IN EFI_HII_PROTOCOL *This,
+ IN EFI_HII_HANDLE Handle,
+ IN EFI_FORM_LABEL Label,
+ IN BOOLEAN AddData,
+ IN EFI_HII_UPDATE_DATA *Data
+ );
+
+typedef EFI_STATUS (EFIAPI *EFI_HII_GET_KEYBOARD_LAYOUT)(
+ IN EFI_HII_PROTOCOL *This,
+ OUT UINT16 *DescriptorCount,
+ OUT EFI_KEY_DESCRIPTOR *Descriptor);
+
+
+typedef struct _EFI_HII_PROTOCOL_OLD {
+ EFI_HII_NEW_PACK_OLD NewPack; //part kb data is missing
+ EFI_HII_REMOVE_PACK RemovePack; //ok
+ EFI_HII_FIND_HANDLES FindHandles; //ok
+ EFI_HII_EXPORT ExportDatabase; //ok
+
+ EFI_HII_TEST_STRING TestString; //ok
+ EFI_HII_GET_GLYPH GetGlyph; //ok
+ EFI_HII_GLYPH_TO_BLT GlyphToBlt; //ok
+
+ EFI_HII_NEW_STRING NewString; //ok
+ EFI_HII_GET_PRI_LANGUAGES GetPrimaryLanguages;//ok
+ EFI_HII_GET_SEC_LANGUAGES GetSecondaryLanguages;//ok
+ EFI_HII_GET_STRING_OLD GetString; //ok
+ EFI_HII_RESET_STRINGS ResetStrings; //ok
+ EFI_HII_GET_LINE GetLine; //ok
+ EFI_HII_GET_FORMS_OLD GetForms; //ok
+ EFI_HII_GET_DEFAULT_IMAGE_OLD GetDefaultImage;//
+ EFI_HII_UPDATE_FORM UpdateForm;
+
+ EFI_HII_GET_KEYBOARD_LAYOUT GetKeyboardLayout;
+} EFI_HII_PROTOCOL_OLD;
+
+typedef struct _EFI_HII_PROTOCOL {
+ EFI_HII_NEW_PACK NewPack; //part kb data is missing
+ EFI_HII_REMOVE_PACK RemovePack; //ok
+ EFI_HII_FIND_HANDLES FindHandles; //ok
+ EFI_HII_EXPORT ExportDatabase; //ok
+
+ EFI_HII_TEST_STRING TestString; //ok
+ EFI_HII_GET_GLYPH GetGlyph; //ok
+ EFI_HII_GLYPH_TO_BLT GlyphToBlt; //ok
+
+ EFI_HII_NEW_STRING NewString; //ok
+ EFI_HII_GET_PRI_LANGUAGES GetPrimaryLanguages;//ok
+ EFI_HII_GET_SEC_LANGUAGES GetSecondaryLanguages;//ok
+ EFI_HII_GET_STRING_NEW GetString; //ok
+ EFI_HII_RESET_STRINGS ResetStrings; //ok
+ EFI_HII_GET_LINE GetLine; //ok
+ EFI_HII_GET_FORMS_NEW GetForms; //ok
+ EFI_HII_GET_DEFAULT_IMAGE_NEW GetDefaultImage;//ok
+ EFI_HII_UPDATE_FORM UpdateForm;
+
+ EFI_HII_GET_KEYBOARD_LAYOUT GetKeyboardLayout;
+} EFI_HII_PROTOCOL;
+
+#endif // #if EFI_SPECIFICATION_VERSION>0x20000
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#endif // #ifndef GUID_VARIABLE_DEFINITION
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2005, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
diff --git a/Include/Protocol/HardwareChangeProtocol.h b/Include/Protocol/HardwareChangeProtocol.h
new file mode 100644
index 0000000..0a2cbb0
--- /dev/null
+++ b/Include/Protocol/HardwareChangeProtocol.h
@@ -0,0 +1,362 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2012, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Pkwy, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/SOURCE/Modules/HardwareSignatureManagement/Protocol/HardwareChangeProtocol.h 7 1/09/14 8:04a Albertlin $
+//
+// $Revision: 7 $
+//
+// $Date: 1/09/14 8:04a $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/SOURCE/Modules/HardwareSignatureManagement/Protocol/HardwareChangeProtocol.h $
+//
+// 7 1/09/14 8:04a Albertlin
+// [TAG] EIP147244
+// [Category] Not Specified
+// [Description] BIOS need to report changed hardware signature when
+// BIOS setup was modified.
+// [Files] HardwareChangeProtocol.h
+//
+// 6 3/01/13 3:34a Albertlin
+// [TAG] EIP115994
+// [Category] Improvement
+// [Description] Modify the comment for chm table.
+// [Files] HardwareChangeProtocol.h
+//
+// 5 1/10/13 10:28p Albertlin
+// [TAG] EIP109014
+// [Category] Improvement
+// [Description] Currently, HardwareSignature module report signature by
+// changed count.But it cause the same hardware may have different
+// signature.
+// For solve this issue, BIOS should report signature by hardware config.
+// [Files] HardwareChangeDetect.c HardwareSignatureManagement.c
+// HardwareSignatureManagement.sdl HardwareChangeProtocol.h
+//
+// 4 12/11/12 1:51a Sophiachen
+// [TAG] EIP105523
+// [Category] New Feature
+// [Description] Record the disk configuration data to check the
+// connection change of disk.
+// [Files] HardwareChangeDetect.c, HardwareSignatureManagement.c,
+// HardwareChangeProtocol.h
+//
+// 3 11/20/12 8:20a Sophiachen
+// [TAG] EIP105154
+// [Category] New Feature
+// [Description] Record the video configuration data to check the
+// connection change of monitor.
+// [Files] HardwareChangeDetect.c, HardwareSignatureManagement.c,
+// HardwareChangeProtocol.h
+//
+// 2 10/18/12 7:53a Sophiachen
+//
+// 1 9/25/12 8:58a Sophiachen
+// [TAG] EIP96258
+// [Category] New Feature
+// [Description] Update the Hardware Signature of the ACPI table FACS
+// field can notify ACPI OS whether any hardware configuration change.
+// [Files] HardwareChangeProtocols.cif
+// Protocol\HardwareChangeProtocol.h
+//
+//**********************************************************************
+//<AMI_FHDR_START>
+//
+// Name: HardwareChangeProtocol.h
+//
+// Description: The header file for Hardware change protocol.
+//
+//<AMI_FHDR_END>
+//**********************************************************************
+
+#ifndef __HARDWARE_CHANGE_PROTOCOL__H__
+#define __HARDWARE_CHANGE_PROTOCOL__H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+// {43169678-506C-46fe-B32A-FCB301F74FBD}
+#define HARDWARE_CHANGE_PROTOCOL_GUID \
+ { 0x43169678, 0x506c, 0x46fe, 0xb3, 0x2a, 0xfc, 0xb3, 0x1, 0xf7, 0x4f, 0xbd }
+
+// {B80A8E5B-C02A-4a31-AE12-58E46E803E89}
+#define HARDWARE_CONFIG_DATA_GUID \
+ { 0xb80a8e5b, 0xc02a, 0x4a31, 0xae, 0x12, 0x58, 0xe4, 0x6e, 0x80, 0x3e, 0x89 }
+
+// {e08126e5-b93c-4f5e-8e81-6dfcf34ff88e}
+#define FIRMWARE_UPDATE_COUNT_GUID \
+ { 0xe08126e5, 0xb93c, 0x4f5e, 0x8e, 0x81, 0x6d, 0xfc, 0xf3, 0x4f, 0xf8, 0x8e }
+
+//<EIP147244 >
+// {81c76078-bfde-4368-9790-570914c01a65}
+#define SETUP_UPDATE_COUNT_GUID \
+ { 0x81c76078, 0xbfde, 0x4368, 0x97, 0x90, 0x57, 0x09, 0x14, 0xc0, 0x1a, 0x65 }
+
+#define SETUP_UPDATE_COUNT_VARIABLE L"SetUpdateCountVar"
+//EFI_GUID gSetupUpdateCountGuid = SETUP_UPDATE_COUNT_GUID;
+//<EIP147244 >
+
+#define HW_CHANGE_PS2_KEYBOARD BIT0
+#define HW_CHANGE_PS2_MOUSE BIT1
+#define HW_CHANGE_MEMORY_SIZE_CONFIG BIT2
+#define HW_CHANGE_MEMORY_MAP_CONFIG BIT3
+#define HW_CHANGE_PCI_CONFIG BIT4
+#define HW_CHANGE_USB_CONFIG BIT5
+#define HW_CHANGE_VIDEO_CONFIG BIT6
+#define HW_CHANGE_DISK_CONFIG BIT7
+//For limit the protocol be called
+#define LIMIT_PROTOCOL_CALLED 20
+
+#if HARDWARE_SIGNATURE_DEBUG_MESSAGES
+#define HWSIG_TRACE(Arguments) TRACE(Arguments)
+#else
+#define HWSIG_TRACE(Arguments)
+#endif
+
+typedef enum {
+ Ps2KeyboardConfigType,
+ Ps2MouseConfigType,
+ MemorySizeConfigType,
+ MemoryMapConfigType,
+ PciConfigType,
+ UsbConfigType,
+ VideoConfigType,
+ DiskConfigType,
+ MaxConfigType
+} HW_CONFIG_TYPE;
+
+#pragma pack (push,1)
+
+//<AMI_SHDR_START>
+//----------------------------------------------------------------------------
+// Name: HW_MEMORY_MAP_DATA
+//
+// Description: This structure represents the memory map data which contains
+// memory size(Megabyte) and checksum of the runtime memory type.
+//
+// Fields: Name Type Description
+// ------------------------------------------------------------------
+// MemMapCheckSum UINT8 Checksum of the runtime memory type
+// MemoryMbSize UINT32 Total memory size(Megabyte)
+//
+//----------------------------------------------------------------------------
+//<AMI_SHDR_END>
+typedef struct _HW_MEMORY_MAP_DATA {
+ UINT8 MemMapCheckSum;
+ UINT32 MemoryMbSize;
+} HW_MEMORY_MAP_DATA;
+
+//<AMI_SHDR_START>
+//----------------------------------------------------------------------------
+// Name: HW_PCI_DATA
+//
+// Description: This structure represents the PCI configuration data which
+// contains number of PCI/PCIE devices, checksum of Bus number/Device number/
+// Function number, and checksum of VID/DID.
+//
+// Fields: Name Type Description
+// ------------------------------------------------------------------
+// PciNum UINT16 Number of PCI/PCIE devices
+// BdfChecksum UINT8 Checksum of Bus number/Device number/Function number
+// VidDidChecksum UINT8 Checksum of VID/DID
+//
+//----------------------------------------------------------------------------
+//<AMI_SHDR_END>
+typedef struct _HW_PCI_DATA {
+ UINT16 PciNum;
+ UINT8 BdfChecksum;
+ UINT8 VidDidChecksum;
+} HW_PCI_DATA;
+
+//<AMI_SHDR_START>
+//----------------------------------------------------------------------------
+// Name: HW_USB_DATA
+//
+// Description: This structure represents the USB configuration data which
+// contains number of USB devices, checksum of VID/PID, and checksum of Port
+// number and Interface number.
+//
+// Fields: Name Type Description
+// ------------------------------------------------------------------
+// UsbNum UINT16 Number of USB devices
+// VidPidChecksum UINT8 Checksum of VID/PID
+// PortNumInterfaceNumChecksum UINT8 Checksum of Port number and Interface number
+//
+//----------------------------------------------------------------------------
+//<AMI_SHDR_END>
+typedef struct _HW_USB_DATA {
+ UINT16 UsbNum;
+ UINT8 VidPidChecksum;
+ UINT8 PortNumInterfaceNumChecksum;
+} HW_USB_DATA;
+
+//<AMI_SHDR_START>
+//----------------------------------------------------------------------------
+// Name: HW_VIDEO_DATA
+//
+// Description: This structure represents the Video configuration data which
+// contains checksum of EDID data, and checksum of resolution.
+//
+// Fields: Name Type Description
+// ------------------------------------------------------------------
+// EdidCheckNum UINT8 Checksum of EDID data
+// ResolutionChecksum UINT8 Checksum of resolution
+//
+//----------------------------------------------------------------------------
+//<AMI_SHDR_END>
+typedef struct _HW_VIDEO_DATA {
+ UINT8 EdidCheckNum;
+ UINT8 ResolutionChecksum;
+} HW_VIDEO_DATA;
+
+//<AMI_SHDR_START>
+//----------------------------------------------------------------------------
+// Name: HW_DISK_DATA
+//
+// Description: This structure represents the Disk configuration data with checksum.
+//
+// Fields: Name Type Description
+// ------------------------------------------------------------------
+// CDSchecksum UINT8 Checksum
+//----------------------------------------------------------------------------
+//<AMI_SHDR_END>
+typedef struct _HW_DISK_DATA {
+ UINT32 CDSchecksum;
+} HW_DISK_DATA;
+
+//<AMI_SHDR_START>
+//----------------------------------------------------------------------------
+// Name: DISK_STRUCTURE
+//
+// Description: This structure represents the Disk configuration data which
+// contains port number and serial number .
+//
+// Fields: Name Type Description
+// ------------------------------------------------------------------
+// Portnumber UINT8 Port number
+// Serialnumber UINT8 Serial number
+//
+//----------------------------------------------------------------------------
+//<AMI_SHDR_END>
+typedef struct _DISK_STRUCTURE {
+ UINT8 Portnumber;
+ UINT8 Serialnumber[20];
+} DISK_STRUCTURE;
+
+//<AMI_SHDR_START>
+//----------------------------------------------------------------------------
+// Name: HW_CONFIG_DATA
+//
+// Description: This structure represents the hardware configuration data
+// which contains PS2 Keyboard/Mouse configuration, Memory Map configuration,
+// PCI configuration Data, USB configuration Data, Video configuration data,
+// Disk configuration data, Firmware update times, and Checksum which external
+// function given.
+//
+// Fields: Name Type Description
+// ------------------------------------------------------------------
+// bPs2Keyboard BOOLEAN The present state of PS2 Keyboard
+// bPs2Mouse BOOLEAN The present state of PS2 Mouse
+// MemMapData HW_MEMORY_MAP_DATA Memory configuration data
+// PciData HW_PCI_DATA PCI configuration data
+// UsbData HW_USB_DATA USB configuration data
+// VideoData HW_VIDEO_DATA Video configuration data
+// DiskData HW_DISK_DATA Disk configuration data
+// FirmwareUpdateCount UINT32 Firmware update count
+// ReturnChecksum UINT32 Checksum which the external function given
+//
+//----------------------------------------------------------------------------
+//<AMI_SHDR_END>
+typedef struct _HW_CONFIG_DATA {
+ BOOLEAN bPs2Keyboard;
+ BOOLEAN bPs2Mouse;
+ HW_MEMORY_MAP_DATA MemMapData;
+ HW_PCI_DATA PciData;
+#if HARDWARE_SIGNATURE_USB_CHANGE
+ HW_USB_DATA UsbData;
+#endif
+ HW_VIDEO_DATA VideoData;
+ HW_DISK_DATA DiskData;
+ UINT32 FirmwareUpdateCount;
+//<EIP147244 >
+ UINT32 SetupUpdateCount;
+//<EIP147244 >
+ UINT32 ReturnChecksum[LIMIT_PROTOCOL_CALLED];
+} HW_CONFIG_DATA;
+#pragma pack (pop)
+
+typedef
+EFI_STATUS (EFIAPI *SET_HW_CONFIG_DATA) (
+ IN HW_CONFIG_TYPE ConfigType,
+ IN UINTN BufferSize,
+ IN VOID *Buffer
+);
+
+typedef
+EFI_STATUS (EFIAPI *GET_HW_CONFIG_DATA_FROM_NVRAM) (
+ IN OUT HW_CONFIG_DATA *HardwareConfigData
+);
+
+typedef
+EFI_STATUS (EFIAPI *SIGNAL_HW_SIGNATURE_CHANGE) (
+ IN UINT32 ReturnChecksum
+);
+
+typedef struct {
+ SET_HW_CONFIG_DATA SetHardwareConfigData;
+ GET_HW_CONFIG_DATA_FROM_NVRAM GetHardwareConfigDataFromNvram;
+ SIGNAL_HW_SIGNATURE_CHANGE SignalHardwareSignatureChange;
+} EFI_HARDWARE_CHANGE_PROTOCOL;
+
+EFI_STATUS SetHardwareConfigData(
+ IN HW_CONFIG_TYPE ConfigType,
+ IN UINTN BufferSize,
+ IN VOID *Buffer
+);
+
+EFI_STATUS GetHardwareConfigDataFromNvram(
+ IN OUT HW_CONFIG_DATA *HardwareConfigData
+);
+
+EFI_STATUS SignalHardwareSignatureChange(
+ IN UINT32 ReturnChecksum );
+
+UINT32 CRC32 (
+ IN UINT8 *fpData,
+ IN UINT16 Length,
+ IN UINT8 ExtenData
+);
+
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2012, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Pkwy, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
diff --git a/Include/Protocol/Hash.h b/Include/Protocol/Hash.h
new file mode 100644
index 0000000..21bfc59
--- /dev/null
+++ b/Include/Protocol/Hash.h
@@ -0,0 +1,137 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+//**********************************************************************
+// $Header: /Alaska/BIN/Core/Include/Protocol/Hash.h 3 5/13/11 4:35p Artems $
+//
+// $Revision: 3 $
+//
+// $Date: 5/13/11 4:35p $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Core/Include/Protocol/Hash.h $
+//
+// 3 5/13/11 4:35p Artems
+// AMI coding style compliance added
+//
+//
+//**********************************************************************
+//<AMI_FHDR_START>
+//
+// Name: <Hash.h>
+//
+// Description: Hash protocol header file
+//
+//<AMI_FHDR_END>
+//**********************************************************************
+
+#ifndef __EFI_HASH_PROTOCOL_H__
+#define __EFI_HASH_PROTOCOL_H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define EFI_HASH_SERVICE_BINDING_PROTOCOL_GUID \
+ { 0x42881c98, 0xa4f3, 0x44b0, 0xa3, 0x9d, 0xdf, 0xa1, 0x86, 0x67, 0xd8, 0xcd }
+
+#define EFI_HASH_PROTOCOL_GUID \
+ { 0xc5184932, 0xdba5, 0x46db, 0xa5, 0xba, 0xcc, 0x0b, 0xda, 0x9c, 0x14, 0x35 }
+
+#define EFI_HASH_ALGORITHM_SHA1_GUID \
+ { 0x2ae9d80f, 0x3fb2, 0x4095, 0xb7, 0xb1, 0xe9, 0x31, 0x57, 0xb9, 0x46, 0xb6 }
+
+#define EFI_HASH_ALGORITHM_SHA224_GUID \
+ { 0x8df01a06, 0x9bd5, 0x4bf7, 0xb0, 0x21, 0xdb, 0x4f, 0xd9, 0xcc, 0xf4, 0x5b }
+
+#define EFI_HASH_ALGORITHM_SHA256_GUID \
+ { 0x51aa59de, 0xfdf2, 0x4ea3, 0xbc, 0x63, 0x87, 0x5f, 0xb7, 0x84, 0x2e, 0xe9 }
+
+#define EFI_HASH_ALGORITHM_SHA384_GUID \
+ { 0xefa96432, 0xde33, 0x4dd2, 0xae, 0xe6, 0x32, 0x8c, 0x33, 0xdf, 0x77, 0x7a }
+
+#define EFI_HASH_ALGORITHM_SHA512_GUID \
+ { 0xcaa4381e, 0x750c, 0x4770, 0xb8, 0x70, 0x7a, 0x23, 0xb4, 0xe4, 0x21, 0x30 }
+
+#define EFI_HASH_ALGORTIHM_MD5_GUID \
+ { 0xaf7c79c, 0x65b5, 0x4319, 0xb0, 0xae, 0x44, 0xec, 0x48, 0x4e, 0x4a, 0xd7 }
+
+typedef struct _EFI_HASH_PROTOCOL EFI_HASH_PROTOCOL;
+
+typedef UINT8 EFI_MD5_HASH[16];
+typedef UINT8 EFI_SHA1_HASH[20];
+typedef UINT8 EFI_SHA224_HASH[28];
+typedef UINT8 EFI_SHA256_HASH[32];
+typedef UINT8 EFI_SHA384_HASH[48];
+typedef UINT8 EFI_SHA512_HASH[64];
+
+typedef union {
+ EFI_MD5_HASH *Md5Hash;
+ EFI_SHA1_HASH *Sha1Hash;
+ EFI_SHA224_HASH *Sha224Hash;
+ EFI_SHA256_HASH *Sha256Hash;
+ EFI_SHA384_HASH *Sha384Hash;
+ EFI_SHA512_HASH *Sha512Hash;
+} EFI_HASH_OUTPUT;
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_HASH_GET_HASH_SIZE) (
+ IN CONST EFI_HASH_PROTOCOL *This,
+ IN CONST EFI_GUID *HashAlgorithm,
+ OUT UINTN *HashSize
+);
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_HASH_HASH) (
+ IN CONST EFI_HASH_PROTOCOL *This,
+ IN CONST EFI_GUID *HashAlgorithm,
+ IN BOOLEAN Extend,
+ IN CONST UINT8 *Message,
+ IN UINT64 MessageSize,
+ IN OUT EFI_HASH_OUTPUT *Hash
+);
+
+struct _EFI_HASH_PROTOCOL {
+ EFI_HASH_GET_HASH_SIZE GetHashSize;
+ EFI_HASH_HASH Hash;
+};
+
+GUID_VARIABLE_DECLARATION(gEfiHashServiceBindingProtocolGuid, EFI_HASH_SERVICE_BINDING_PROTOCOL_GUID);
+GUID_VARIABLE_DECLARATION(gEfiHashProtocolGuid, EFI_HASH_PROTOCOL_GUID);
+GUID_VARIABLE_DECLARATION(gEfiHashAlgorithmSha1Guid, EFI_HASH_ALGORITHM_SHA1_GUID);
+GUID_VARIABLE_DECLARATION(gEfiHashAlgorithmSha224Guid, EFI_HASH_ALGORITHM_SHA224_GUID);
+GUID_VARIABLE_DECLARATION(gEfiHashAlgorithmSha256Guid, EFI_HASH_ALGORITHM_SHA256_GUID);
+GUID_VARIABLE_DECLARATION(gEfiHashAlgorithmSha384Guid, EFI_HASH_ALGORITHM_SHA384_GUID);
+GUID_VARIABLE_DECLARATION(gEfiHashAlgorithmSha512Guid, EFI_HASH_ALGORITHM_SHA512_GUID);
+GUID_VARIABLE_DECLARATION(gEfiHashAlgorithmMD5Guid, EFI_HASH_ALGORTIHM_MD5_GUID);
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
diff --git a/Include/Protocol/HiiConfigAccess.h b/Include/Protocol/HiiConfigAccess.h
new file mode 100644
index 0000000..e133ac9
--- /dev/null
+++ b/Include/Protocol/HiiConfigAccess.h
@@ -0,0 +1,114 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2009, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/BIN/Core/Include/Protocol/HiiConfigAccess.h 3 11/25/09 11:23a Felixp $
+//
+// $Revision: 3 $
+//
+// $Date: 11/25/09 11:23a $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Core/Include/Protocol/HiiConfigAccess.h $
+//
+// 3 11/25/09 11:23a Felixp
+// Action parameter of the Callback function is updated based on UEFI
+// errata
+//
+// 2 10/13/09 6:06p Felixp
+// Hii.h renamed to UefiHii.h
+//
+// 1 10/09/09 3:52p Felixp
+//
+// 1 2/27/09 3:55p Artems
+// Initial check-in
+//
+// 1 3/18/07 5:23p Felixp
+//
+//**********************************************************************
+//<AMI_FHDR_START>
+//
+// Name: <HiiConfigAccess.h>
+//
+// Description: Hii Config access protocol header file
+//
+//<AMI_FHDR_END>
+//**********************************************************************
+#ifndef __HII_CONFIG_ACCESS__H__
+#define __HII_CONFIG_ACCESS__H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <UefiHii.h>
+
+#define EFI_HII_CONFIG_ACCESS_PROTOCOL_GUID \
+ { 0x330d4706, 0xf2a0, 0x4e4f, 0xa3, 0x69, 0xb6, 0x6f, 0xa8, 0xd5, 0x43, 0x85 }
+
+GUID_VARIABLE_DECLARATION(gEfiHiiConfigAccessProtocolGuid, EFI_HII_CONFIG_ACCESS_PROTOCOL_GUID);
+
+typedef struct _EFI_HII_CONFIG_ACCESS_PROTOCOL EFI_HII_CONFIG_ACCESS_PROTOCOL;
+
+typedef EFI_STATUS
+(EFIAPI * EFI_HII_ACCESS_EXTRACT_CONFIG ) (
+ IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This,
+ IN CONST EFI_STRING Request,
+ OUT EFI_STRING *Progress,
+ OUT EFI_STRING *Results
+);
+
+typedef EFI_STATUS
+(EFIAPI * EFI_HII_ACCESS_ROUTE_CONFIG ) (
+ IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This,
+ IN CONST EFI_STRING Configuration,
+ OUT EFI_STRING *Progress
+);
+
+typedef EFI_STATUS
+(EFIAPI *EFI_HII_ACCESS_FORM_CALLBACK) (
+ IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This,
+//Based on errata for uefi2.1-2.3 approved in the 11/18 USWG meeting
+//the Action parameter is not a pointer
+ IN EFI_BROWSER_ACTION Action,
+ IN EFI_QUESTION_ID QuestionId,
+ IN UINT8 Type,
+ IN EFI_IFR_TYPE_VALUE *Value,
+ OUT EFI_BROWSER_ACTION_REQUEST *ActionRequest
+);
+
+struct _EFI_HII_CONFIG_ACCESS_PROTOCOL {
+ EFI_HII_ACCESS_EXTRACT_CONFIG ExtractConfig;
+ EFI_HII_ACCESS_ROUTE_CONFIG RouteConfig;
+ EFI_HII_ACCESS_FORM_CALLBACK Callback;
+};
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2009, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//********************************************************************** \ No newline at end of file
diff --git a/Include/Protocol/HiiConfigRouting.h b/Include/Protocol/HiiConfigRouting.h
new file mode 100644
index 0000000..063fb44
--- /dev/null
+++ b/Include/Protocol/HiiConfigRouting.h
@@ -0,0 +1,137 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2009, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/BIN/Core/Include/Protocol/HiiConfigRouting.h 2 10/13/09 6:06p Felixp $
+//
+// $Revision: 2 $
+//
+// $Date: 10/13/09 6:06p $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Core/Include/Protocol/HiiConfigRouting.h $
+//
+// 2 10/13/09 6:06p Felixp
+// Hii.h renamed to UefiHii.h
+//
+// 1 10/09/09 3:52p Felixp
+//
+// 1 2/27/09 3:55p Artems
+// Initial check-in
+//
+// 1 3/18/07 5:23p Felixp
+//
+//**********************************************************************
+//<AMI_FHDR_START>
+//
+// Name: HiiConfigRouting.h
+//
+// Description: Hii Configuration Routing protocol header file
+//
+//<AMI_FHDR_END>
+//**********************************************************************
+#ifndef __HII_CONFIG_ROUTING_PROTOCOL__H__
+#define __HII_CONFIG_ROUTING_PROTOCOL__H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <UefiHii.h>
+
+#define EFI_HII_CONFIG_ROUTING_PROTOCOL_GUID \
+ { 0x587e72d7, 0xcc50, 0x4f79, 0x82, 0x09, 0xca, 0x29, 0x1f, 0xc1, 0xa1, 0x0f }
+
+GUID_VARIABLE_DECLARATION(gEfiHiiConfigRoutingProtocolGuid, EFI_HII_CONFIG_ROUTING_PROTOCOL_GUID);
+
+typedef struct _EFI_HII_CONFIG_ROUTING_PROTOCOL EFI_HII_CONFIG_ROUTING_PROTOCOL;
+
+typedef EFI_STATUS
+(EFIAPI * EFI_HII_EXTRACT_CONFIG ) (
+ IN CONST EFI_HII_CONFIG_ROUTING_PROTOCOL *This,
+ IN CONST EFI_STRING Request,
+ OUT EFI_STRING *Progress,
+ OUT EFI_STRING *Results
+);
+
+typedef EFI_STATUS
+(EFIAPI * EFI_HII_EXPORT_CONFIG ) (
+ IN CONST EFI_HII_CONFIG_ROUTING_PROTOCOL *This,
+ OUT EFI_STRING *Results
+);
+
+typedef EFI_STATUS
+(EFIAPI * EFI_HII_ROUTE_CONFIG ) (
+ IN CONST EFI_HII_CONFIG_ROUTING_PROTOCOL *This,
+ IN CONST EFI_STRING Configuration,
+ OUT EFI_STRING *Progress
+);
+
+typedef EFI_STATUS
+(EFIAPI * EFI_HII_BLOCK_TO_CONFIG ) (
+ IN CONST EFI_HII_CONFIG_ROUTING_PROTOCOL *This,
+ IN CONST EFI_STRING ConfigRequest,
+ IN CONST UINT8 *Block,
+ IN CONST UINTN BlockSize,
+ OUT EFI_STRING *Config,
+ OUT EFI_STRING *Progress
+);
+
+typedef EFI_STATUS
+(EFIAPI * EFI_HII_CONFIG_TO_BLOCK ) (
+ IN CONST EFI_HII_CONFIG_ROUTING_PROTOCOL *This,
+ IN CONST EFI_STRING ConfigResp,
+ IN OUT CONST UINT8 *Block,
+ IN OUT UINTN *BlockSize,
+ OUT EFI_STRING *Progress
+);
+
+typedef EFI_STATUS
+(EFIAPI * EFI_HII_GET_ALT_CFG ) (
+ IN CONST EFI_HII_CONFIG_ROUTING_PROTOCOL *This,
+ IN CONST EFI_STRING ConfigResp,
+ IN CONST EFI_GUID *Guid,
+ IN CONST EFI_STRING Name,
+ IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath,
+ IN CONST EFI_STRING AltCfgId,
+ OUT EFI_STRING *AltCfgResp
+);
+
+struct _EFI_HII_CONFIG_ROUTING_PROTOCOL {
+ EFI_HII_EXTRACT_CONFIG ExtractConfig;
+ EFI_HII_EXPORT_CONFIG ExportConfig;
+ EFI_HII_ROUTE_CONFIG RouteConfig;
+ EFI_HII_BLOCK_TO_CONFIG BlockToConfig;
+ EFI_HII_CONFIG_TO_BLOCK ConfigToBlock;
+ EFI_HII_GET_ALT_CFG GetAltConfig;
+};
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2009, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//********************************************************************** \ No newline at end of file
diff --git a/Include/Protocol/HiiDatabase.h b/Include/Protocol/HiiDatabase.h
new file mode 100644
index 0000000..b53d177
--- /dev/null
+++ b/Include/Protocol/HiiDatabase.h
@@ -0,0 +1,189 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2009, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/BIN/Core/Include/Protocol/HiiDatabase.h 2 10/13/09 6:06p Felixp $
+//
+// $Revision: 2 $
+//
+// $Date: 10/13/09 6:06p $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Core/Include/Protocol/HiiDatabase.h $
+//
+// 2 10/13/09 6:06p Felixp
+// Hii.h renamed to UefiHii.h
+//
+// 1 10/09/09 3:52p Felixp
+//
+// 1 2/27/09 3:55p Artems
+// Initial check-in
+//
+// 1 3/18/07 5:23p Felixp
+//
+//**********************************************************************
+//<AMI_FHDR_START>
+//
+// Name: <HiiDatabase.h>
+//
+// Description: Hii Database protocol header file
+//
+//<AMI_FHDR_END>
+//**********************************************************************
+#ifndef __HII_DATABASE__H__
+#define __HII_DATABASE__H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <UefiHii.h>
+
+#define EFI_HII_DATABASE_PROTOCOL_GUID \
+ { 0xef9fc172, 0xa1b2, 0x4693, 0xb3, 0x27, 0x6d, 0x32, 0xfc, 0x41, 0x60, 0x42 }
+
+GUID_VARIABLE_DECLARATION(gEfiHiiDatabaseProtocolGuid, EFI_HII_DATABASE_PROTOCOL_GUID);
+
+typedef struct _EFI_HII_DATABASE_PROTOCOL EFI_HII_DATABASE_PROTOCOL;
+
+typedef EFI_STATUS
+(EFIAPI *EFI_HII_DATABASE_NEW_PACK) (
+ IN CONST EFI_HII_DATABASE_PROTOCOL *This,
+ IN CONST EFI_HII_PACKAGE_LIST_HEADER *PackageList,
+ IN CONST EFI_HANDLE DriverHandle,
+ OUT EFI_HII_HANDLE *Handle
+);
+
+typedef EFI_STATUS
+(EFIAPI *EFI_HII_DATABASE_REMOVE_PACK) (
+ IN CONST EFI_HII_DATABASE_PROTOCOL *This,
+ IN EFI_HII_HANDLE Handle
+);
+
+typedef EFI_STATUS
+(EFIAPI *EFI_HII_DATABASE_UPDATE_PACK) (
+ IN CONST EFI_HII_DATABASE_PROTOCOL *This,
+ IN EFI_HII_HANDLE Handle,
+ IN CONST EFI_HII_PACKAGE_LIST_HEADER *PackageList
+);
+
+typedef EFI_STATUS
+(EFIAPI *EFI_HII_DATABASE_LIST_PACKS) (
+ IN CONST EFI_HII_DATABASE_PROTOCOL *This,
+ IN UINT8 PackageType,
+ IN CONST EFI_GUID *PackageGuid,
+ IN OUT UINTN *HandleBufferLength,
+ OUT EFI_HII_HANDLE *Handle
+);
+
+typedef EFI_STATUS
+(EFIAPI *EFI_HII_DATABASE_EXPORT_PACKS) (
+ IN CONST EFI_HII_DATABASE_PROTOCOL *This,
+ IN EFI_HII_HANDLE Handle,
+ IN OUT UINTN *BufferSize,
+ OUT EFI_HII_PACKAGE_LIST_HEADER *Buffer
+);
+
+typedef UINTN EFI_HII_DATABASE_NOTIFY_TYPE;
+
+#define EFI_HII_DATABASE_NOTIFY_NEW_PACK 0x00000001
+#define EFI_HII_DATABASE_NOTIFY_REMOVE_PACK 0x00000002
+#define EFI_HII_DATABASE_NOTIFY_EXPORT_PACK 0x00000004
+#define EFI_HII_DATABASE_NOTIFY_ADD_PACK 0x00000008
+
+typedef EFI_STATUS
+(EFIAPI *EFI_HII_DATABASE_NOTIFY) (
+ IN UINT8 PackageType,
+ IN CONST EFI_GUID *PackageGuid,
+ IN CONST EFI_HII_PACKAGE_HEADER *Package,
+ IN EFI_HII_HANDLE Handle,
+ IN EFI_HII_DATABASE_NOTIFY_TYPE NotifyType
+);
+
+typedef EFI_STATUS
+(EFIAPI *EFI_HII_DATABASE_REGISTER_NOTIFY) (
+ IN CONST EFI_HII_DATABASE_PROTOCOL *This,
+ IN UINT8 PackageType,
+ IN CONST EFI_GUID *PackageGuid,
+ IN CONST EFI_HII_DATABASE_NOTIFY PackageNotifyFn,
+ IN EFI_HII_DATABASE_NOTIFY_TYPE NotifyType,
+ OUT EFI_HANDLE *NotifyHandle
+);
+
+typedef EFI_STATUS
+(EFIAPI *EFI_HII_DATABASE_UNREGISTER_NOTIFY) (
+ IN CONST EFI_HII_DATABASE_PROTOCOL *This,
+ IN EFI_HANDLE NotificationHandle
+);
+
+typedef EFI_STATUS
+(EFIAPI *EFI_HII_FIND_KEYBOARD_LAYOUTS) (
+ IN EFI_HII_DATABASE_PROTOCOL *This,
+ IN OUT UINT16 *KeyGuidBufferLength,
+ OUT EFI_GUID *KeyGuidBuffer
+);
+
+typedef
+EFI_STATUS (EFIAPI *EFI_HII_GET_KEYBOARD_LAYOUT) (
+ IN EFI_HII_DATABASE_PROTOCOL *This,
+ IN EFI_GUID *KeyGuid,
+ IN OUT UINT16 *KeyGuidBufferLength,
+ OUT EFI_HII_KEYBOARD_LAYOUT *KeyboardLayout
+);
+
+typedef
+EFI_STATUS (EFIAPI *EFI_HII_SET_KEYBOARD_LAYOUT) (
+ IN EFI_HII_DATABASE_PROTOCOL *This,
+ IN EFI_GUID *KeyGuid
+);
+
+typedef
+EFI_STATUS (EFIAPI *EFI_HII_DATABASE_GET_PACK_HANDLE) (
+ IN EFI_HII_DATABASE_PROTOCOL *This,
+ IN EFI_HII_HANDLE PackageListHandle,
+ OUT EFI_HANDLE *DriverHandle
+);
+
+struct _EFI_HII_DATABASE_PROTOCOL {
+ EFI_HII_DATABASE_NEW_PACK NewPackageList;
+ EFI_HII_DATABASE_REMOVE_PACK RemovePackageList;
+ EFI_HII_DATABASE_UPDATE_PACK UpdatePackageList;
+ EFI_HII_DATABASE_LIST_PACKS ListPackageLists;
+ EFI_HII_DATABASE_EXPORT_PACKS ExportPackageLists;
+ EFI_HII_DATABASE_REGISTER_NOTIFY RegisterPackageNotify;
+ EFI_HII_DATABASE_UNREGISTER_NOTIFY UnregisterPackageNotify;
+ EFI_HII_FIND_KEYBOARD_LAYOUTS FindKeyboardLayouts;
+ EFI_HII_GET_KEYBOARD_LAYOUT GetKeyboardLayout;
+ EFI_HII_SET_KEYBOARD_LAYOUT SetKeyboardLayout;
+ EFI_HII_DATABASE_GET_PACK_HANDLE GetPackageListHandle;
+};
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2009, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//********************************************************************** \ No newline at end of file
diff --git a/Include/Protocol/HiiFont.h b/Include/Protocol/HiiFont.h
new file mode 100644
index 0000000..812754b
--- /dev/null
+++ b/Include/Protocol/HiiFont.h
@@ -0,0 +1,202 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2009, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/BIN/Core/Include/Protocol/HiiFont.h 6 5/23/12 3:41p Artems $
+//
+// $Revision: 6 $
+//
+// $Date: 5/23/12 3:41p $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Core/Include/Protocol/HiiFont.h $
+//
+// 6 5/23/12 3:41p Artems
+// [TAG] EIP N/A
+// [Category] Spec Update
+// [Severity] Minor
+// [Description] Minor change in protocol function input parameter
+// [Files] HiiFont.h
+//
+// 5 10/25/11 6:55p Artems
+// Renamed CLIP flags according to UEFI 2.3.1 spec
+//
+// 4 12/04/09 12:14p Felixp
+//
+// 3 12/03/09 6:02p Artems
+// moved font related structures outside pack pragma
+//
+// 2 10/13/09 6:06p Felixp
+// Hii.h renamed to UefiHii.h
+//
+// 1 10/09/09 3:52p Felixp
+//
+// 1 2/27/09 3:55p Artems
+// Initial check-in
+//
+// 1 3/18/07 5:23p Felixp
+//
+//**********************************************************************
+//<AMI_FHDR_START>
+//
+// Name: <HiiFont.h>
+//
+// Description: Hii Font protocol header file
+//
+//<AMI_FHDR_END>
+//**********************************************************************
+#ifndef __HII_FONT__H__
+#define __HII_FONT__H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define EFI_HII_FONT_PROTOCOL_GUID \
+ { 0xe9ca4775, 0x8657, 0x47fc, 0x97, 0xe7, 0x7e, 0xd6, 0x5a, 0x8, 0x43, 0x24 }
+
+GUID_VARIABLE_DECLARATION(gEfiHiiFontProtocolGuid, EFI_HII_FONT_PROTOCOL_GUID);
+
+#ifndef GUID_VARIABLE_DEFINITION
+#include <UefiHii.h>
+#include <Protocol/GraphicsOutput.h>
+
+typedef UINT32 EFI_HII_OUT_FLAGS;
+
+#define EFI_HII_OUT_FLAG_CLIP 0x00000001
+#define EFI_HII_OUT_FLAG_WRAP 0x00000002
+#define EFI_HII_OUT_FLAG_CLIP_CLEAN_Y 0x00000004
+#define EFI_HII_OUT_FLAG_CLIP_CLEAN_X 0x00000008
+#define EFI_HII_OUT_FLAG_TRANSPARENT 0x00000010
+#define EFI_HII_IGNORE_IF_NO_GLYPH 0x00000020
+#define EFI_HII_IGNORE_LINE_BREAK 0x00000040
+#define EFI_HII_DIRECT_TO_SCREEN 0x00000080
+
+typedef UINT32 EFI_FONT_INFO_MASK;
+
+#define EFI_FONT_INFO_SYS_FONT 0x00000001
+#define EFI_FONT_INFO_SYS_SIZE 0x00000002
+#define EFI_FONT_INFO_SYS_STYLE 0x00000004
+#define EFI_FONT_INFO_SYS_FORE_COLOR 0x00000010
+#define EFI_FONT_INFO_SYS_BACK_COLOR 0x00000020
+#define EFI_FONT_INFO_RESIZE 0x00001000
+#define EFI_FONT_INFO_RESTYLE 0x00002000
+#define EFI_FONT_INFO_ANY_FONT 0x00010000
+#define EFI_FONT_INFO_ANY_SIZE 0x00020000
+#define EFI_FONT_INFO_ANY_STYLE 0x00040000
+
+typedef struct _EFI_HII_ROW_INFO {
+ UINTN StartIndex;
+ UINTN EndIndex;
+ UINTN LineHeight;
+ UINTN LineWidth;
+ UINTN BaselineOffset;
+} EFI_HII_ROW_INFO;
+
+typedef struct _EFI_FONT_DISPLAY_INFO {
+ EFI_GRAPHICS_OUTPUT_BLT_PIXEL ForegroundColor;
+ EFI_GRAPHICS_OUTPUT_BLT_PIXEL BackgroundColor;
+ EFI_FONT_INFO_MASK FontInfoMask;
+ EFI_FONT_INFO FontInfo;
+} EFI_FONT_DISPLAY_INFO;
+
+typedef struct _EFI_IMAGE_OUTPUT {
+ UINT16 Width;
+ UINT16 Height;
+ union {
+ EFI_GRAPHICS_OUTPUT_BLT_PIXEL *Bitmap;
+ EFI_GRAPHICS_OUTPUT_PROTOCOL *Screen;
+ } Image;
+} EFI_IMAGE_OUTPUT;
+
+//Protocol functions prototypes
+
+typedef struct _EFI_HII_FONT_PROTOCOL EFI_HII_FONT_PROTOCOL;
+
+typedef EFI_STATUS
+(EFIAPI *EFI_HII_STRING_TO_IMAGE) (
+ IN CONST EFI_HII_FONT_PROTOCOL *This,
+ IN EFI_HII_OUT_FLAGS Flags,
+ IN CONST EFI_STRING String,
+ IN CONST EFI_FONT_DISPLAY_INFO *StringInfo OPTIONAL,
+ IN OUT EFI_IMAGE_OUTPUT **Blt,
+ IN UINTN BltX,
+ IN UINTN BltY,
+ OUT EFI_HII_ROW_INFO **RowInfoArray OPTIONAL,
+ OUT UINTN *RowInfoArraySize OPTIONAL,
+ OUT UINTN *ColumnInfoArray OPTIONAL
+);
+
+typedef EFI_STATUS
+(EFIAPI *EFI_HII_STRING_ID_TO_IMAGE) (
+ IN CONST EFI_HII_FONT_PROTOCOL *This,
+ IN EFI_HII_OUT_FLAGS Flags,
+ IN EFI_HII_HANDLE PackageList,
+ IN EFI_STRING_ID StringId,
+ IN CONST CHAR8* Language,
+ IN CONST EFI_FONT_DISPLAY_INFO *StringInfo OPTIONAL,
+ IN OUT EFI_IMAGE_OUTPUT **Blt,
+ IN UINTN BltX,
+ IN UINTN BltY,
+ OUT EFI_HII_ROW_INFO **RowInfoArray OPTIONAL,
+ OUT UINTN *RowInfoArraySize OPTIONAL,
+ OUT UINTN *ColumnInfoArray OPTIONAL
+);
+
+typedef EFI_STATUS
+(EFIAPI *EFI_HII_GET_GLYPH) (
+ IN CONST EFI_HII_FONT_PROTOCOL *This,
+ IN CHAR16 Char,
+ IN CONST EFI_FONT_DISPLAY_INFO *StringInfo,
+ OUT EFI_IMAGE_OUTPUT **Blt,
+ OUT UINTN *Baseline OPTIONAL
+);
+
+typedef VOID *EFI_FONT_HANDLE;
+
+typedef EFI_STATUS
+(EFIAPI *EFI_HII_GET_FONT_INFO) (
+ IN CONST EFI_HII_FONT_PROTOCOL *This,
+ IN OUT EFI_FONT_HANDLE *FontHandle,
+ IN CONST EFI_FONT_DISPLAY_INFO *StringInfoIn, OPTIONAL
+ OUT EFI_FONT_DISPLAY_INFO **StringInfoOut,
+ IN CONST EFI_STRING String OPTIONAL
+);
+
+struct _EFI_HII_FONT_PROTOCOL {
+ EFI_HII_STRING_TO_IMAGE StringToImage;
+ EFI_HII_STRING_ID_TO_IMAGE StringIdToImage;
+ EFI_HII_GET_GLYPH GetGlyph;
+ EFI_HII_GET_FONT_INFO GetFontInfo;
+};
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#endif // #ifndef GUID_VARIABLE_DEFINITION
+#ifdef __cplusplus
+}
+#endif
+#endif
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2009, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//********************************************************************** \ No newline at end of file
diff --git a/Include/Protocol/HiiPackageList.h b/Include/Protocol/HiiPackageList.h
new file mode 100644
index 0000000..d5ddb62
--- /dev/null
+++ b/Include/Protocol/HiiPackageList.h
@@ -0,0 +1,67 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2009, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/BIN/Core/Include/Protocol/HiiPackageList.h 1 11/19/09 12:53p Felixp $
+//
+// $Revision: 1 $
+//
+// $Date: 11/19/09 12:53p $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Core/Include/Protocol/HiiPackageList.h $
+//
+// 1 11/19/09 12:53p Felixp
+//
+//**********************************************************************
+//<AMI_FHDR_START>
+//
+// Name: HiiPackageList.h
+//
+// Description: HII Package List Protocol Definition
+//
+//<AMI_FHDR_END>
+//**********************************************************************
+#ifndef __HII_PACKAGE_LIST_PROTOCOL__H__
+#define __HII_PACKAGE_LIST_PROTOCOL__H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+#include <UefiHii.h>
+
+#define EFI_HII_PACKAGE_LIST_PROTOCOL_GUID \
+ { 0x6a1ee763, 0xd47a, 0x43b4, {0xaa, 0xbe, 0xef, 0x1d, 0xe2, 0xab, 0x56, 0xfc}}
+
+GUID_VARIABLE_DECLARATION(gEfiHiiPackageListProtocolGuid, EFI_HII_PACKAGE_LIST_PROTOCOL_GUID);
+
+typedef EFI_HII_PACKAGE_LIST_HEADER* EFI_HII_PACKAGE_LIST_PROTOCOL;
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2009, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
diff --git a/Include/Protocol/HiiString.h b/Include/Protocol/HiiString.h
new file mode 100644
index 0000000..d579daf
--- /dev/null
+++ b/Include/Protocol/HiiString.h
@@ -0,0 +1,141 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2009, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/BIN/Core/Include/Protocol/HiiString.h 3 5/23/12 3:51p Artems $
+//
+// $Revision: 3 $
+//
+// $Date: 5/23/12 3:51p $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Core/Include/Protocol/HiiString.h $
+//
+// 3 5/23/12 3:51p Artems
+// [TAG] EIP N/A
+// [Category] Spec Update
+// [Severity] Minor
+// [Description] Change in input parameter of protocol function
+// [Files] HiiString.h
+//
+// 2 10/13/09 6:06p Felixp
+// Hii.h renamed to UefiHii.h
+//
+// 1 10/09/09 3:52p Felixp
+//
+// 1 2/27/09 3:55p Artems
+// Initial check-in
+//
+// 1 3/18/07 5:23p Felixp
+//
+//**********************************************************************
+//<AMI_FHDR_START>
+//
+// Name: <HiiString.h>
+//
+// Description: Hii String protocol header file
+//
+//<AMI_FHDR_END>
+//**********************************************************************
+#ifndef __HII_STRING__H__
+#define __HII_STRING__H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <UefiHii.h>
+
+#define EFI_HII_STRING_PROTOCOL_GUID \
+ { 0xfd96974, 0x23aa, 0x4cdc, 0xb9, 0xcb, 0x98, 0xd1, 0x77, 0x50, 0x32, 0x2a }
+
+GUID_VARIABLE_DECLARATION(gEfiHiiStringProtocolGuid, EFI_HII_STRING_PROTOCOL_GUID);
+
+typedef struct _EFI_HII_STRING_PROTOCOL EFI_HII_STRING_PROTOCOL;
+
+typedef EFI_STATUS
+(EFIAPI *EFI_HII_NEW_STRING) (
+ IN CONST EFI_HII_STRING_PROTOCOL *This,
+ IN EFI_HII_HANDLE PackageList,
+ OUT EFI_STRING_ID *StringId,
+ IN CONST CHAR8 *Language,
+ IN CONST CHAR16 *LanguageName OPTIONAL,
+ IN CONST EFI_STRING String,
+ IN CONST EFI_FONT_INFO *StringFontInfo
+);
+
+typedef EFI_STATUS
+(EFIAPI *EFI_HII_GET_STRING) (
+ IN CONST EFI_HII_STRING_PROTOCOL *This,
+ IN CONST CHAR8 *Language,
+ IN EFI_HII_HANDLE PackageList,
+ IN EFI_STRING_ID StringId,
+ OUT EFI_STRING String,
+ IN OUT UINTN *StringSize,
+ OUT EFI_FONT_INFO **StringFontInfo OPTIONAL
+);
+
+typedef EFI_STATUS
+(EFIAPI *EFI_HII_SET_STRING) (
+ IN CONST EFI_HII_STRING_PROTOCOL *This,
+ IN EFI_HII_HANDLE PackageList,
+ IN EFI_STRING_ID StringId,
+ IN CONST CHAR8 *Language,
+ IN CONST EFI_STRING String,
+ IN CONST EFI_FONT_INFO *StringFontInfo OPTIONAL
+);
+
+typedef EFI_STATUS
+(EFIAPI *EFI_HII_GET_LANGUAGES) (
+ IN CONST EFI_HII_STRING_PROTOCOL *This,
+ IN EFI_HII_HANDLE PackageList,
+ IN OUT CHAR8 *Languages,
+ IN OUT UINTN *LanguagesSize
+);
+
+typedef EFI_STATUS
+(EFIAPI *EFI_HII_GET_2ND_LANGUAGES) (
+ IN CONST EFI_HII_STRING_PROTOCOL *This,
+ IN EFI_HII_HANDLE PackageList,
+ IN CONST CHAR8* FirstLanguage,
+ IN OUT CHAR8 *SecondLanguages,
+ IN OUT UINTN *SecondLanguagesSize
+);
+
+struct _EFI_HII_STRING_PROTOCOL {
+ EFI_HII_NEW_STRING NewString;
+ EFI_HII_GET_STRING GetString;
+ EFI_HII_SET_STRING SetString;
+ EFI_HII_GET_LANGUAGES GetLanguages;
+ EFI_HII_GET_2ND_LANGUAGES GetSecondaryLanguages;
+};
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2009, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//********************************************************************** \ No newline at end of file
diff --git a/Include/Protocol/HiiUtilities.h b/Include/Protocol/HiiUtilities.h
new file mode 100644
index 0000000..3c90e19
--- /dev/null
+++ b/Include/Protocol/HiiUtilities.h
@@ -0,0 +1,155 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2009, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/BIN/Core/Include/Protocol/HiiUtilities.h 3 5/23/12 3:54p Artems $
+//
+// $Revision: 3 $
+//
+// $Date: 5/23/12 3:54p $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Core/Include/Protocol/HiiUtilities.h $
+//
+// 3 5/23/12 3:54p Artems
+// [TAG] EIP N/A
+// [Category] Improvement
+// [Description] Rewrite GraphicsConsole driver to draw strings as a
+// whole,
+// not symbol-by-symbol for performance reasons
+// [Files] HiiUtilities.h, AmiDxeLib.h, EfiLib.h, GC.c, UefiHiiUtils.c
+//
+// 2 2/23/10 10:14p Felixp
+// SetBrowserData function is added
+//
+// 1 10/09/09 3:15p Felixp
+//
+//**********************************************************************
+//<AMI_FHDR_START>
+//
+// Name: HiiUtilities.h
+//
+// Description: HII Utilities Protocol
+//
+//<AMI_FHDR_END>
+//**********************************************************************
+#ifndef __HII_UTILITIES_PROTOCOL__H__
+#define __HII_UTILITIES_PROTOCOL__H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+#include <EFI.h>
+
+// {67B5787C-0E6A-4796-943E-A093B73A0267}
+#define HII_UTILITIES_PROTOCOL_GUID \
+ { 0x67b5787c, 0xe6a, 0x4796, 0x94, 0x3e, 0xa0, 0x93, 0xb7, 0x3a, 0x2, 0x67 }
+
+GUID_VARIABLE_DECLARATION(gHiiUtilitiesProtocolGuid,HII_UTILITIES_PROTOCOL_GUID);
+
+#ifndef GUID_VARIABLE_DEFINITION
+#if EFI_SPECIFICATION_VERSION>0x20000
+#include <Protocol/HiiConfigAccess.h>
+#else
+#include <Protocol/FormCallBack.h >
+#endif
+
+typedef struct _CALLBACK_INFO CALLBACK_INFO;
+
+typedef VOID(*INIT_HII_PACK)(
+ EFI_HII_HANDLE HiiHandle,
+ CALLBACK_INFO *pCallBackFound
+);
+
+struct _CALLBACK_INFO{
+ EFI_GUID *pGuid;
+#if EFI_SPECIFICATION_VERSION>0x20000
+ EFI_HII_CONFIG_ACCESS_PROTOCOL *pFormCallback;
+#else
+ EFI_FORM_CALLBACK_PROTOCOL *pFormCallback;
+#endif
+ UINT16 Class, SubClass;
+ EFI_HII_HANDLE HiiHandle;
+};
+
+typedef EFI_STATUS (EFIAPI *HII_UTILS_LOAD_RESOURCES)(
+ IN EFI_HANDLE ImageHandle, IN UINTN NumberOfCallbacks,
+ IN CALLBACK_INFO *CallbackInfo, IN INIT_HII_PACK InitFunction OPTIONAL
+);
+
+typedef EFI_STATUS (EFIAPI *HII_UTILS_LOAD_STRINGS)(
+ EFI_HANDLE ImageHandle, OUT EFI_HII_HANDLE *HiiHandle
+);
+
+typedef EFI_STATUS (EFIAPI *HII_UTILS_GET_STRING)(
+ IN EFI_HII_HANDLE HiiHandle, IN STRING_REF StringId,
+ IN OUT UINTN *StringSize, OUT EFI_STRING String
+);
+
+typedef EFI_STATUS (EFIAPI *HII_UTILS_SET_STRING)(
+ IN EFI_HII_HANDLE HiiHandle, IN STRING_REF StringId, IN EFI_STRING String
+);
+
+typedef EFI_STATUS (EFIAPI *HII_UTILS_PUBLISH_PACKAGES)(
+ IN VOID *PackagePointers, IN UINTN NumberOfPackages,
+ IN EFI_GUID *PackageGuid, IN EFI_HANDLE DriverHandle OPTIONAL,
+ OUT EFI_HII_HANDLE *HiiHandle
+);
+
+typedef EFI_STATUS (EFIAPI *HII_UTILS_GET_BROWSER_DATA)(
+ IN UINTN *BufferSize, OUT VOID *Buffer,
+ IN CONST EFI_GUID *VarStoreGuid OPTIONAL,
+ IN CONST CHAR16 *VarStoreName OPTIONAL
+);
+
+typedef EFI_STATUS (EFIAPI *HII_UTILS_SET_BROWSER_DATA)(
+ IN UINTN BufferSize, IN VOID *Buffer,
+ IN CONST EFI_GUID *VarStoreGuid, OPTIONAL
+ IN CONST CHAR16 *VarStoreName OPTIONAL
+);
+
+typedef EFI_STATUS (EFIAPI *HII_UTILS_GET_GLYPH_WIDTH)(
+ IN CHAR16 Char, OUT UINT16 *Width
+);
+
+typedef struct{
+ HII_UTILS_LOAD_RESOURCES LoadResources;
+ HII_UTILS_LOAD_STRINGS LoadStrings;
+ HII_UTILS_PUBLISH_PACKAGES PublishPackages;
+ HII_UTILS_GET_BROWSER_DATA GetBrowserData;
+ HII_UTILS_SET_BROWSER_DATA SetBrowserData;
+ HII_UTILS_GET_STRING GetString;
+ HII_UTILS_SET_STRING SetString;
+ HII_UTILS_GET_GLYPH_WIDTH GetGlyphWidth;
+}HII_UTILITIES_PROTOCOL;
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#endif // #ifndef GUID_VARIABLE_DEFINITION
+#ifdef __cplusplus
+}
+#endif
+#endif
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2009, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
diff --git a/Include/Protocol/HotKeys.h b/Include/Protocol/HotKeys.h
new file mode 100644
index 0000000..eb4375b
--- /dev/null
+++ b/Include/Protocol/HotKeys.h
@@ -0,0 +1,108 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2005, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/BIN/Core/Include/Protocol/HotKeys.h 3 3/13/06 1:40a Felixp $
+//
+// $Revision: 3 $
+//
+// $Date: 3/13/06 1:40a $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Core/Include/Protocol/HotKeys.h $
+//
+// 3 3/13/06 1:40a Felixp
+//
+// 2 3/04/05 10:38a Mandal
+//
+// 1 2/01/05 1:14a Felixp
+//
+// 2 1/18/05 3:22p Felixp
+// PrintDebugMessage renamed to Trace
+//
+// 1 10/28/04 10:19a Olegi
+//
+// 1 9/30/04 3:38p Olegi
+// Initial HotKeys protocol checkin.
+
+//**********************************************************************
+//<AMI_FHDR_START>
+//
+// Name: HotKeys.h
+//
+// Description: HotKeys protocol definition
+//
+//<AMI_FHDR_END>
+//**********************************************************************
+#ifndef __HOT_KEYS_PROTOCOL_H__
+#define __HOT_KEYS_PROTOCOL_H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+#include <EFI.h>
+
+#define EFI_HOT_KEYS_PROTOCOL_GUID \
+ {0xf1e48287, 0x3fe1, 0x4535, 0x89, 0xab, 0x48, 0xd6, 0xc3, 0xda, 0x27, 0x59}
+
+GUID_VARIABLE_DECLARATION(gEfiHotKeysProtocolGuid,EFI_HOT_KEYS_PROTOCOL_GUID);
+
+//
+// Keyboard extension functions definitions
+//
+typedef EFI_STATUS (*KEY_EXTENDED_FUNC) (VOID* Context);
+
+typedef struct _KEY_ASSOCIATION {
+ UINT8 KeyCode;
+ UINT8 KeyAttrib;
+ BOOLEAN ReportKey;
+ KEY_EXTENDED_FUNC KeyExtendedFunc;
+ VOID* FunctionContext;
+} KEY_ASSOCIATION;
+
+//
+// Forward declaration
+//
+//typedef struct _HOT_KEYS_PROTOCOL HOT_KEYS_PROTOCOL;
+
+typedef EFI_STATUS (EFIAPI *REGISTER_HOT_KEY) (
+ IN KEY_ASSOCIATION *HotKey,
+ IN BOOLEAN ReplaceExisting
+);
+
+typedef EFI_STATUS (EFIAPI *UNREGISTER_HOT_KEYS) ();
+
+typedef struct _HOT_KEYS_PROTOCOL {
+ REGISTER_HOT_KEY RegisterHotKey;
+ UNREGISTER_HOT_KEYS UnregisterHotKeys;
+} HOT_KEYS_PROTOCOL;
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2005, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
diff --git a/Include/Protocol/IdeBusBoard.h b/Include/Protocol/IdeBusBoard.h
new file mode 100644
index 0000000..2f84bb4
--- /dev/null
+++ b/Include/Protocol/IdeBusBoard.h
@@ -0,0 +1,138 @@
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2010, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
+
+//*************************************************************************
+// $Header: /Alaska/BIN/Core/Modules/IdeBus/IdeBusBoard.h 2 9/27/11 3:17a Rajeshms $
+//
+// $Revision: 2 $
+//
+// $Date: 9/27/11 3:17a $
+//*************************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Core/Modules/IdeBus/IdeBusBoard.h $
+//
+// 2 9/27/11 3:17a Rajeshms
+// [TAG] EIP69295
+// [Category] Improvement
+// [Description] The Timeout values used by IDE and AHCI drivers are
+// made as SDL tokens, so that the timeout values can be varied.
+// [Files] IdeBusBoard.c, CORE_DXE.sdl, AhciSmm.h, AhciBus.h, IDESMM.h,
+// Ata.c, Atapi.c, IdeBus.c, IdeBus.h, IdeBusMaster.c, IdeBusBoard.h
+//
+// 1 8/25/10 5:37a Rameshr
+// New Feature: EIP 37748
+// Description: Move all the IDEBus Source driver SDL token into IdeBus
+// Bin Driver.
+// FilesModified: Ata.c, Atapi.c, idebus.c, IdeBus.h,
+// IdebuscomponentName.c, IdeBusmaster.c IdeBusSrc.mak IdebusSrc.sdl
+// IdeHpa.c, IdePowerManagement.c
+//
+//
+//
+//*************************************************************************
+//<AMI_FHDR_START>
+//
+// Name: IdeBusBoard.h
+//
+// Description: defines Platform IDE Protocol
+//
+//<AMI_FHDR_END>
+//*************************************************************************
+#ifndef __IdeBusBoard__H__
+#define __IdeBusBoard__H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <EFI.h>
+
+#define PLATFORM_IDE_PROTOCOL_GUID \
+ { 0x6737f69b, 0xb8cc, 0x45bc, 0x93, 0x27, 0xcc, 0xf5, 0xee, 0xf7, 0xc, 0xde }
+
+//
+// Protocol revision number
+// Any backwards compatible changes to this protocol will result in an update in the revision number
+//
+// Revision 2: Changed from Original version to support for ATA/ATAPI timeout values as TOKENS.
+//
+#define PLATFORM_IDE_PROTOCOL_REVISION 2
+//
+// Protocol Revision Number supported by IdeBus Source.
+//
+#define PLATFORM_IDE_PROTOCOL_SUPPORTED_REVISION 2
+
+#ifndef EFI_COMPONENT_NAME2_PROTOCOL_GUID //old Core
+#ifndef LANGUAGE_CODE_ENGLISH
+#define LANGUAGE_CODE_ENGLISH "eng"
+#endif
+BOOLEAN LanguageCodesEqual(
+ CONST CHAR8* LangCode1, CONST CHAR8* LangCode2
+);
+#endif
+
+//
+// Interface structure for PLATFORM_IDE_PROTOCOL
+//
+typedef struct _PLATFORM_IDE_PROTOCOL {
+ UINT8 Revision;
+ BOOLEAN MasterSlaveEnumeration;
+ BOOLEAN IdeBusMasterSupport;
+ BOOLEAN AtapiBusMasterSupport;
+ BOOLEAN AcousticManagementSupport;
+ BOOLEAN IdePowerManagementSupport;
+ INT16 StandbyTimeout;
+ BOOLEAN AdvPowerManagementSupport;
+ UINT8 AdvPowerManagementLevel;
+ BOOLEAN PowerupInStandbySupport;
+ BOOLEAN PowerupInStandbyMode;
+ BOOLEAN IdePwrManagementInterfaceSupport;
+ BOOLEAN HostProtectedAreaSupport;
+ BOOLEAN IdeHPSupport;
+ BOOLEAN EfiIdeProtocol;
+ BOOLEAN AhciCompatibleMode;
+ BOOLEAN SBIdeSupport;
+ BOOLEAN HddPowerLossInS3;
+ BOOLEAN DiPMSupport;
+ BOOLEAN DisableSoftSetPrev;
+ BOOLEAN ForceHddPasswordPrompt;
+ EFI_GUID gIdeControllerProtocolGuid;
+ EFI_GUID gComponentNameProtocolGuid;
+ UINT32 S3BusyClearTimeout;
+ UINT32 DmaAtaCompleteCommandTimeout;
+ UINT32 DmaAtaPiCompleteCommandTimeout;
+ UINT32 AtaPiResetCommandTimeout;
+ UINT32 AtaPiBusyClearTimeout;
+ UINT32 PoweonBusyClearTimeout;
+} PLATFORM_IDE_PROTOCOL;
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2010, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
diff --git a/Include/Protocol/IdeBusBoardProtocol.cif b/Include/Protocol/IdeBusBoardProtocol.cif
new file mode 100644
index 0000000..879a042
--- /dev/null
+++ b/Include/Protocol/IdeBusBoardProtocol.cif
@@ -0,0 +1,8 @@
+<component>
+ name = "IdeBusBoardProtocol"
+ category = ModulePart
+ LocalRoot = "Include\Protocol\"
+ RefName = "IdeBusBoardProtocol"
+[files]
+"IdeBusBoard.h"
+<endComponent>
diff --git a/Include/Protocol/IdeControllerInit.h b/Include/Protocol/IdeControllerInit.h
new file mode 100644
index 0000000..ecd789a
--- /dev/null
+++ b/Include/Protocol/IdeControllerInit.h
@@ -0,0 +1,358 @@
+/*++
+
+Copyright (c) 2004, Intel Corporation
+All rights reserved. This program and the accompanying materials
+are licensed and made available under the terms and conditions of the BSD License
+which accompanies this distribution. The full text of the license may be found at
+http://opensource.org/licenses/bsd-license.php
+
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+Module Name:
+
+ IdeControllerInit.h
+
+Abstract:
+
+ EFI Platform IDE Init Protocol
+
+Revision History
+
+ 0.01 - Draft, 5-01-2002
+ Add Atapi6 Identify structure definition, 8-14-2002
+
+--*/
+
+#ifndef _EFI_IDE_CONTROLLER_INIT_PROTOCOL_H
+#define _EFI_IDE_CONTROLLER_INIT_PROTOCOL_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+//
+// Global ID for the EFI Platform IDE Protocol GUID
+//
+#define EFI_IDE_CONTROLLER_INIT_PROTOCOL_GUID \
+ { 0xa1e37052, 0x80d9, 0x4e65, 0xa3, 0x17, 0x3e, 0x9a, 0x55, 0xc4, 0x3e, 0xc9 }
+
+GUID_VARIABLE_DECLARATION(gEfiIdeControllerInitProtocolGuid,EFI_IDE_CONTROLLER_INIT_PROTOCOL_GUID);
+
+////////////////////////////////////////////////////////////////////////////////////////
+// Forward reference, ANSI compatability
+//
+typedef struct _EFI_IDE_CONTROLLER_INIT_PROTOCOL EFI_IDE_CONTROLLER_INIT_PROTOCOL;
+
+//
+//////////////////////////////////////////////////////////////////////////////////////////
+// EFI_IDE_BUS_ENUMERATION_PHASE
+// EFI_IDE_CONTROLLER_ENUM_PHASE
+//
+typedef enum{
+ EfiIdeBeforeChannelEnumeration,
+ EfiIdeAfterChannelEnumeration,
+ EfiIdeBeforeChannelReset,
+ EfiIdeAfterChannelReset,
+ EfiIdeBusBeforeDevicePresenceDetection,
+ EfiIdeBusAfterDevicePresenceDetection,
+ EfiIdeResetMode,
+ EfiIdeBusPhaseMaximum
+} EFI_IDE_CONTROLLER_ENUM_PHASE;
+
+//
+//******************************************************
+// EFI_ATA_EXT_TRANSFER_PROTOCOL
+//******************************************************
+//
+// This extended mode describes the SATA physical protocol.
+// SATA physical layers can operate at different speeds.
+// These speeds are defined below. Various PATA protocols
+// and associated modes are not applicable to SATA devices.
+//
+
+typedef enum {
+ EfiAtaSataTransferProtocol
+} EFI_ATA_EXT_TRANSFER_PROTOCOL;
+
+#define EFI_SATA_AUTO_SPEED 0
+#define EFI_SATA_GEN1_SPEED 1
+#define EFI_SATA_GEN2_SPEED 2
+
+//
+//*******************************************************
+// EFI_IDE_CABLE_TYPE
+//*******************************************************
+//
+typedef enum {
+ EfiIdeCableTypeUnknown,
+ EfiIdeCableType40pin,
+ EfiIdeCableType80Pin,
+ EfiIdeCableTypeSerial,
+ EfiIdeCableTypeMaximum
+} EFI_IDE_CABLE_TYPE;
+
+//
+//******************************************************
+// EFI_ATA_MODE
+//******************************************************
+//
+typedef struct {
+ BOOLEAN Valid;
+ UINT32 Mode;
+} EFI_ATA_MODE;
+
+//
+//******************************************************
+// EFI_ATA_EXTENDED_MODE
+//******************************************************
+//
+typedef struct {
+ EFI_ATA_EXT_TRANSFER_PROTOCOL TransferProtocol;
+ UINT32 Mode;
+} EFI_ATA_EXTENDED_MODE;
+
+//
+//******************************************************
+// EFI_ATA_COLLECTIVE_MODE
+//******************************************************
+//
+typedef struct {
+ EFI_ATA_MODE PioMode;
+ EFI_ATA_MODE SingleWordDmaMode;
+ EFI_ATA_MODE MultiWordDmaMode;
+ EFI_ATA_MODE UdmaMode;
+ UINT32 ExtModeCount;
+ EFI_ATA_EXTENDED_MODE ExtMode[1];
+} EFI_ATA_COLLECTIVE_MODE;
+
+//
+//*******************************************************
+// EFI_ATA_IDENTIFY_DATA
+//*******************************************************
+//
+
+#pragma pack(1)
+
+typedef struct {
+ UINT16 config; // General Configuration
+ UINT16 cylinders; // Number of Cylinders
+ UINT16 reserved_2;
+ UINT16 heads; //Number of logical heads
+ UINT16 vendor_data1;
+ UINT16 vendor_data2;
+ UINT16 sectors_per_track;
+ UINT16 vendor_specific_7_9[3];
+ CHAR8 SerialNo[20]; // ASCII
+ UINT16 vendor_specific_20_21[2];
+ UINT16 ecc_bytes_available;
+ CHAR8 FirmwareVer[8]; // ASCII
+ CHAR8 ModelName[40]; // ASCII
+ UINT16 multi_sector_cmd_max_sct_cnt;
+ UINT16 reserved_48;
+ UINT16 capabilities;
+ UINT16 reserved_50;
+ UINT16 pio_cycle_timing; //51
+ UINT16 reserved_52;
+ UINT16 field_validity;
+ UINT16 current_cylinders;
+ UINT16 current_heads;
+ UINT16 current_sectors;
+ UINT16 CurrentCapacityLsb;
+ UINT16 CurrentCapacityMsb;
+ UINT16 reserved_59;
+ UINT16 user_addressable_sectors_lo;
+ UINT16 user_addressable_sectors_hi;
+ UINT16 reserved_62;
+ UINT16 multi_word_dma_mode;
+ UINT16 advanced_pio_modes; //64
+ UINT16 min_multi_word_dma_cycle_time;
+ UINT16 rec_multi_word_dma_cycle_time;
+ UINT16 min_pio_cycle_time_without_flow_control;
+ UINT16 min_pio_cycle_time_with_flow_control; //68
+ UINT16 reserved_69_79[11];
+ UINT16 major_version_no;
+ UINT16 minor_version_no;
+ UINT16 command_set_supported_82; // word 82
+ UINT16 command_set_supported_83; // word 83
+ UINT16 command_set_feature_extn; // word 84
+ UINT16 command_set_feature_enb_85; // word 85
+ UINT16 command_set_feature_enb_86; // word 86
+ UINT16 command_set_feature_default; // word 87
+ UINT16 ultra_dma_mode; // word 88
+ UINT16 reserved_89_105[17];
+ UINT16 phy_logic_sector_support; // word 106
+ UINT16 reserved_107_116[10];
+ UINT16 logic_sector_size_lo; // word 117
+ UINT16 logic_sector_size_hi; // word 118
+ UINT16 reserved_119_127[9];
+ UINT16 security_status;
+ UINT16 vendor_data_129_159[31];
+ UINT16 reserved_160_208[49];
+ UINT16 alignment_logic_in_phy_blocks; // word 209
+ UINT16 reserved_210_255[46];
+} EFI_ATA_IDENTIFY_DATA;
+
+#pragma pack()
+//
+//*******************************************************
+// EFI_ATAPI_IDENTIFY_DATA
+//*******************************************************
+//
+#pragma pack(1)
+typedef struct {
+ UINT16 config; // General Configuration
+ UINT16 obsolete_1;
+ UINT16 specific_config;
+ UINT16 obsolete_3;
+ UINT16 retired_4_5[2];
+ UINT16 obsolete_6;
+ UINT16 cfa_reserved_7_8[2];
+ UINT16 retired_9;
+ CHAR8 SerialNo[20]; // ASCII
+ UINT16 retired_20_21[2];
+ UINT16 obsolete_22;
+ CHAR8 FirmwareVer[8]; // ASCII
+ CHAR8 ModelName[40]; // ASCII
+ UINT16 multi_sector_cmd_max_sct_cnt;
+ UINT16 reserved_48;
+ UINT16 capabilities_49;
+ UINT16 capabilities_50;
+ UINT16 obsolete_51_52[2];
+ UINT16 field_validity;
+ UINT16 obsolete_54_58[5];
+ UINT16 mutil_sector_setting;
+ UINT16 user_addressable_sectors_lo;
+ UINT16 user_addressable_sectors_hi;
+ UINT16 obsolete_62;
+ UINT16 multi_word_dma_mode;
+ UINT16 advanced_pio_modes;
+ UINT16 min_multi_word_dma_cycle_time;
+ UINT16 rec_multi_word_dma_cycle_time;
+ UINT16 min_pio_cycle_time_without_flow_control;
+ UINT16 min_pio_cycle_time_with_flow_control;
+ UINT16 reserved_69_74[6];
+ UINT16 queue_depth;
+ UINT16 reserved_76_79[4];
+ UINT16 major_version_no;
+ UINT16 minor_version_no;
+ UINT16 cmd_set_support_82;
+ UINT16 cmd_set_support_83;
+ UINT16 cmd_feature_support;
+ UINT16 cmd_feature_enable_85;
+ UINT16 cmd_feature_enable_86;
+ UINT16 cmd_feature_default;
+ UINT16 ultra_dma_select;
+ UINT16 time_required_for_sec_erase;
+ UINT16 time_required_for_enhanced_sec_erase;
+ UINT16 current_advanced_power_mgmt_value;
+ UINT16 master_pwd_revison_code;
+ UINT16 hardware_reset_result;
+ UINT16 current_auto_acoustic_mgmt_value;
+ UINT16 reserved_95_99[5];
+ UINT16 max_user_lba_for_48bit_addr[4];
+ UINT16 reserved_104_126[23];
+ UINT16 removable_media_status_notification_support;
+ UINT16 security_status;
+ UINT16 vendor_data_129_159[31];
+ UINT16 cfa_power_mode;
+ UINT16 cfa_reserved_161_175[15];
+ UINT16 current_media_serial_no[30];
+ UINT16 reserved_206_254[49];
+ UINT16 integrity_word;
+} EFI_ATAPI_IDENTIFY_DATA;
+
+#pragma pack()
+//
+//*******************************************************
+// EFI_IDENTIFY_DATA
+//*******************************************************
+//
+typedef union {
+ EFI_ATA_IDENTIFY_DATA AtaData;
+ EFI_ATAPI_IDENTIFY_DATA AtapiData;
+} EFI_IDENTIFY_DATA;
+
+#define EFI_ATAPI_DEVICE_IDENTIFY_DATA 0x8000
+
+//
+/////////////////////////////////////////////////////////////////////////////////////////
+// Function prototype declaration, for ANSI compatability
+//
+typedef
+EFI_STATUS
+(*EFI_IDE_CONTROLLER_GET_CHANNEL_INFO) (
+ IN EFI_IDE_CONTROLLER_INIT_PROTOCOL *This,
+ IN UINT8 Channel,
+ OUT BOOLEAN *Enabled,
+ OUT UINT8 *MaxDevices
+
+);
+
+typedef
+EFI_STATUS
+(*EFI_IDE_CONTROLLER_NOTIFY_PHASE) (
+ IN EFI_IDE_CONTROLLER_INIT_PROTOCOL *This,
+ IN EFI_IDE_CONTROLLER_ENUM_PHASE Phase,
+ IN UINT8 Channel
+);
+
+typedef
+EFI_STATUS
+(*EFI_IDE_CONTROLLER_SUBMIT_DATA) (
+ IN EFI_IDE_CONTROLLER_INIT_PROTOCOL *This,
+ IN UINT8 Channel,
+ IN UINT8 Device,
+ IN EFI_IDENTIFY_DATA *IdentifyData
+);
+
+
+typedef
+EFI_STATUS
+(*EFI_IDE_CONTROLLER_DISQUALIFY_MODE) (
+ IN EFI_IDE_CONTROLLER_INIT_PROTOCOL *This,
+ IN UINT8 Channel,
+ IN UINT8 Device,
+ IN EFI_ATA_COLLECTIVE_MODE *BadModes
+);
+
+typedef
+EFI_STATUS
+(*EFI_IDE_CONTROLLER_CALCULATE_MODE) (
+ IN EFI_IDE_CONTROLLER_INIT_PROTOCOL *This,
+ IN UINT8 Channel,
+ IN UINT8 Device,
+ OUT EFI_ATA_COLLECTIVE_MODE **SupportedModes
+);
+
+//
+// ?? What happen to EFI_IDE_CONTROLLER_SET_TIMING ???
+//
+typedef
+EFI_STATUS
+(EFIAPI *EFI_IDE_CONTROLLER_SET_TIMING) (
+ IN EFI_IDE_CONTROLLER_INIT_PROTOCOL *This,
+ IN UINT8 Channel,
+ IN UINT8 Device,
+ IN EFI_ATA_COLLECTIVE_MODE *Modes
+);
+
+//
+////////////////////////////////////////////////////////////////////////////////////////////////////
+// Interface structure
+// EFI_IDE_CONTROLLER_INIT_PROTOCOL protocol provides the chipset specific information to the IDE bus driver.
+// An IDE Bus driver wants to manage an IDE bus and possible IDE devices will have to retrieve the
+// EFI_IDE_CONTROLLER_INIT_PROTOCOL instances.
+//
+typedef struct _EFI_IDE_CONTROLLER_INIT_PROTOCOL {
+ EFI_IDE_CONTROLLER_GET_CHANNEL_INFO GetChannelInfo;
+ EFI_IDE_CONTROLLER_NOTIFY_PHASE NotifyPhase;
+ EFI_IDE_CONTROLLER_SUBMIT_DATA SubmitData;
+ EFI_IDE_CONTROLLER_DISQUALIFY_MODE DisqualifyMode;
+ EFI_IDE_CONTROLLER_CALCULATE_MODE CalculateMode;
+ EFI_IDE_CONTROLLER_SET_TIMING SetTiming;
+ BOOLEAN EnumAll;
+ UINT8 ChannelCount;
+} EFI_IDE_CONTROLLER_INIT_PROTOCOL;
+
+#endif
diff --git a/Include/Protocol/IncompatiblePciDeviceSupport.h b/Include/Protocol/IncompatiblePciDeviceSupport.h
new file mode 100644
index 0000000..69a644e
--- /dev/null
+++ b/Include/Protocol/IncompatiblePciDeviceSupport.h
@@ -0,0 +1,86 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2005, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/BIN/Core/Include/Protocol/IncompatiblePciDeviceSupport.h 1 3/13/06 1:40a Felixp $
+//
+// $Revision: 1 $
+//
+// $Date: 3/13/06 1:40a $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Core/Include/Protocol/IncompatiblePciDeviceSupport.h $
+//
+// 1 3/13/06 1:40a Felixp
+//
+//**********************************************************************
+//<AMI_FHDR_START>
+//
+// Name: <This File Name>
+//
+// Description:
+//
+//<AMI_FHDR_END>
+//**********************************************************************
+#ifndef __INCOMPATIBLE_PCI_DEVICE_SUPPORT_PROTOCOL_H__
+#define __INCOMPATIBLE_PCI_DEVICE_SUPPORT_PROTOCOL_H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+#include <EFI.h>
+
+#define EFI_INCOMPATIBLE_PCI_DEVICE_SUPPORT_PROTOCOL_GUID \
+ {0xeb23f55a, 0x7863, 0x4ac2, 0x8d, 0x3d, 0x95, 0x65, 0x35, 0xde, 0x03, 0x75}
+
+GUID_VARIABLE_DECLARATION(gEfiIncompatiblePciDeviceSupportProtocolGuid,EFI_INCOMPATIBLE_PCI_DEVICE_SUPPORT_PROTOCOL_GUID);
+
+typedef struct _EFI_INCOMPATIBLE_PCI_DEVICE_SUPPORT_PROTOCOL EFI_INCOMPATIBLE_PCI_DEVICE_SUPPORT_PROTOCOL;
+
+typedef EFI_STATUS (EFIAPI *EFI_INCOMPATIBLE_PCI_DEVICE_SUPPORT_CHECK_DEVICE) (
+ IN EFI_INCOMPATIBLE_PCI_DEVICE_SUPPORT_PROTOCOL *This,
+ IN UINTN VendorId,
+ IN UINTN DeviceId,
+ IN UINTN Revision,
+ IN UINTN SubVendorId,OPTIONAL
+ IN UINTN SubDeviceId,OPTIONAL
+ OUT VOID *Configuration
+);
+
+
+typedef struct _EFI_INCOMPATIBLE_PCI_DEVICE_SUPPORT_PROTOCOL {
+ EFI_INCOMPATIBLE_PCI_DEVICE_SUPPORT_CHECK_DEVICE CheckDevice;
+} EFI_INCOMPATIBLE_PCI_DEVICE_SUPPORT_PROTOCOL;
+
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2005, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+
diff --git a/Include/Protocol/IntelSaGopDriver.h b/Include/Protocol/IntelSaGopDriver.h
new file mode 100644
index 0000000..a42e751
--- /dev/null
+++ b/Include/Protocol/IntelSaGopDriver.h
@@ -0,0 +1,190 @@
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2012, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
+
+//*************************************************************************
+// $Header: /Alaska/BIN/Chipset/Intel/NorthBridge/Haswell/IntelGopDriver/IntelSaGopDriverProtocol/IntelSaGopDriver.h 3 4/23/13 8:00a Ireneyang $
+//
+// $Revision: 3 $
+//
+// $Date: 4/23/13 8:00a $
+//*************************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Chipset/Intel/NorthBridge/Haswell/IntelGopDriver/IntelSaGopDriverProtocol/IntelSaGopDriver.h $
+//
+// 3 4/23/13 8:00a Ireneyang
+// [TAG] None
+// [Severity] Improvement
+// [Description] Support for BIST (Built-In Self Test) Protocol.
+// [Files] IntelSaGopSetup.c; IntelSaGopSetup.h;
+// IntelSaGopSetup.sd;
+// IntelSaGopSetup.sd; IntelSaGopSetup.sdl;
+// IntelSaGopSetup.uni; IntelSaGopDriver.h;
+//
+// 2 8/14/12 5:49a Yurenlai
+// [TAG] None
+// [Severity] Important
+// [Description] Implemented BIOS Integration Guide Rev 1.0 to Intel SA
+// GOP driver.
+// [Files] IntelSaGopDriver.cif, IntelSaGopDriver.mak,
+// IntelSaGopDriver.sdl, IntelSaGopPolicy.c,
+// IntelSaGopSetup.c, IntelSaGopSetup.h,
+// IntelSaGopSetup.mak,
+// IntelSaGopSetup.sd, IntelSaGopSetup.sdl,
+// IntelSaGopSetup.uni,
+// IntelSaGopSwitch.c, IntelSaGopDriver.h, NBPlatformData.h
+//
+// 1 3/08/12 10:57p Yurenlai
+// [TAG] None
+// [Category] Improvement
+// [Description] Create Haswell Intel SA GOP Driver module part.
+// Notice : IntelGopDriver.efi and vbt.bin is dummy files.
+//
+//*************************************************************************
+//<AMI_FHDR_START>
+//
+// Name: IntelSaGopDriver.h
+//
+// Description: GOP Specific Setup Variables and Structures
+//
+//<AMI_FHDR_END>
+//*************************************************************************
+
+#ifndef _PLATFORM_GOP_POLICY_PROTOCOL_H_
+#define _PLATFORM_GOP_POLICY_PROTOCOL_H_
+
+#define EFI_PLATFORM_GOP_POLICY_PROTOCOL_GUID \
+ { 0xec2e931b, 0x3281, 0x48a5, 0x81, 0x7, 0xdf, 0x8a, 0x8b, 0xed, 0x3c, 0x5d }
+
+#define GOP_DISPLAY_BRIGHTNESS_PROTOCOL_GUID \
+ { 0x6ff23f1d, 0x877c, 0x4b1b, 0x93, 0xfc, 0xf1, 0x42, 0xb2, 0xee, 0xa6, 0xa7 }
+
+#define GOP_DISPLAY_BIST_PROTOCOL_GUID \
+ { 0xf51dd33a, 0xe57f, 0x4020, 0xb4, 0x66, 0xf4, 0xc1, 0x71, 0xc6, 0xe4, 0xf7 }
+
+#define PLATFORM_GOP_POLICY_PROTOCOL_REVISION_01 0x01
+#define PLATFORM_GOP_POLICY_PROTOCOL_REVISION_02 0x0222
+
+#define GOP_DISPLAY_BRIGHTNESS_PROTOCOL_REVISION_01 0x01
+
+#define GOP_DISPLAY_BIST_PROTOCOL_REVISION_01 0x01
+
+#pragma pack(1)
+
+typedef
+struct _GOP_DISPLAY_BRIGHTNESS_PROTOCOL GOP_DISPLAY_BRIGHTNESS_PROTOCOL;
+
+typedef
+struct _GOP_DISPLAY_BIST_PROTOCOL GOP_DISPLAY_BIST_PROTOCOL;
+
+typedef enum {
+ LidClosed,
+ LidOpen,
+ LidStatusMax
+} LID_STATUS;
+
+typedef enum {
+ Docked,
+ UnDocked,
+ DockStatusMax
+} DOCK_STATUS;
+
+typedef
+EFI_STATUS
+(EFIAPI *GET_PLATFORM_LID_STATUS) (
+ OUT LID_STATUS *CurrentLidStatus
+);
+
+typedef
+EFI_STATUS
+(EFIAPI *GET_VBT_DATA) (
+ OUT EFI_PHYSICAL_ADDRESS *VbtAddress,
+ OUT UINT32 *VbtSize
+);
+
+typedef
+EFI_STATUS
+(EFIAPI *GET_PLATFORM_DOCK_STATUS) (
+ OUT DOCK_STATUS CurrentDockStatus
+);
+
+typedef
+EFI_STATUS
+(EFIAPI *GET_MAXIMUM_BRIGHTNESS_LEVEL) (
+ IN GOP_DISPLAY_BRIGHTNESS_PROTOCOL *This,
+ OUT UINT32 *MaxBrightnessLevel
+);
+
+typedef
+EFI_STATUS
+(EFIAPI *GET_CURRENT_BRIGHTNESS_LEVEL) (
+ IN GOP_DISPLAY_BRIGHTNESS_PROTOCOL *This,
+ OUT UINT32 *CurrentBrightnessLevel
+);
+
+typedef
+EFI_STATUS
+(EFIAPI *SET_BRIGHTNESS_LEVEL) (
+ IN GOP_DISPLAY_BRIGHTNESS_PROTOCOL *This,
+ IN UINT32 BrightnessLevel
+);
+
+typedef
+EFI_STATUS
+(EFIAPI *ENABLE_BIST) (
+ IN GOP_DISPLAY_BIST_PROTOCOL *This
+);
+
+typedef
+EFI_STATUS
+(EFIAPI *DISABLE_BIST) (
+ IN GOP_DISPLAY_BIST_PROTOCOL *This
+);
+
+#pragma pack()
+
+typedef struct _PLATFORM_GOP_POLICY_PROTOCOL {
+ UINT32 Revision;
+ GET_PLATFORM_LID_STATUS GetPlatformLidStatus;
+ GET_VBT_DATA GetVbtData;
+ GET_PLATFORM_DOCK_STATUS GetPlatformDockStatus;
+} PLATFORM_GOP_POLICY_PROTOCOL;
+
+typedef struct _GOP_DISPLAY_BRIGHTNESS_PROTOCOL {
+ UINT32 Revision;
+ GET_MAXIMUM_BRIGHTNESS_LEVEL GetMaxBrightnessLevel;
+ GET_CURRENT_BRIGHTNESS_LEVEL GetCurrentBrightnessLevel;
+ SET_BRIGHTNESS_LEVEL SetBrightnessLevel;
+} GOP_DISPLAY_BRIGHTNESS_PROTOCOL;
+
+typedef struct _GOP_DISPLAY_BIST_PROTOCOL{
+ UINT32 Revision;
+ ENABLE_BIST EnableBist;
+ DISABLE_BIST DisableBist;
+} GOP_DISPLAY_BIST_PROTOCOL;
+
+#endif
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2012, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
diff --git a/Include/Protocol/IntelSaGopDriverProtocol.cif b/Include/Protocol/IntelSaGopDriverProtocol.cif
new file mode 100644
index 0000000..f1b4080
--- /dev/null
+++ b/Include/Protocol/IntelSaGopDriverProtocol.cif
@@ -0,0 +1,8 @@
+<component>
+ name = "IntelSaGopDriverProtocol"
+ category = ModulePart
+ LocalRoot = "Include\Protocol\"
+ RefName = "IntelSaGopDriverProtocol"
+[files]
+"IntelSaGopDriver.h"
+<endComponent> \ No newline at end of file
diff --git a/Include/Protocol/Legacy8259.h b/Include/Protocol/Legacy8259.h
new file mode 100644
index 0000000..6cf3d85
--- /dev/null
+++ b/Include/Protocol/Legacy8259.h
@@ -0,0 +1,174 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2005, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/BIN/Core/Include/Protocol/Legacy8259.h 2 3/13/06 1:40a Felixp $
+//
+// $Revision: 2 $
+//
+// $Date: 3/13/06 1:40a $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Core/Include/Protocol/Legacy8259.h $
+//
+// 2 3/13/06 1:40a Felixp
+//
+// 1 1/28/05 12:44p Felixp
+//
+// 2 1/18/05 3:22p Felixp
+// PrintDebugMessage renamed to Trace
+//
+// 1 12/23/04 9:41a Felixp
+//
+// 1 7/13/04 2:33p Markw
+//
+//**********************************************************************
+//<AMI_FHDR_START>
+//
+// Name:
+//
+// Description:
+//
+//<AMI_FHDR_END>
+//**********************************************************************
+#ifndef __LEGACY8259_PROTOCOL_H__
+#define __LEGACY8259_PROTOCOL_H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+#include<EFI.h>
+
+// {38321DBA-4FE0-4E17-8AEC-413055EAEDC1}
+#define EFI_LEGACY_8259_PROTOCOL_GUID \
+ {0x38321dba,0x4fe0,0x4e17,0x8a,0xec,0x41,0x30,0x55,0xea,0xed,0xc1}
+
+GUID_VARIABLE_DECLARATION(gEfiLegacy8259ProtocolGuid,EFI_LEGACY_8259_PROTOCOL_GUID);
+
+typedef struct _EFI_LEGACY_8259_PROTOCOL EFI_LEGACY_8259_PROTOCOL;
+
+
+//************************************************
+// EFI_8259_MODE
+//************************************************
+typedef enum {
+ Efi8259LegacyMode,
+ Efi8259ProtectedMode,
+ Efi8259MaxMode
+} EFI_8259_MODE;
+
+//******************************************
+// EFI_8259_IRQ
+//******************************************
+typedef enum {
+ Efi8259Irq0, Efi8259Irq1,
+ Efi8259Irq2, Efi8259Irq3,
+ Efi8259Irq4, Efi8259Irq5,
+ Efi8259Irq6, Efi8259Irq7,
+ Efi8259Irq8, Efi8259Irq9,
+ Efi8259Irq10, Efi8259Irq11,
+ Efi8259Irq12, Efi8259Irq13,
+ Efi8259Irq14, Efi8259Irq15,
+ Efi8259IrqMax
+} EFI_8259_IRQ;
+
+
+typedef EFI_STATUS (EFIAPI *EFI_LEGACY_8259_SET_VECTOR_BASE) (
+ IN EFI_LEGACY_8259_PROTOCOL *This,
+ IN UINT8 MasterBase,
+ IN UINT8 SlaveBase
+);
+
+typedef EFI_STATUS (EFIAPI *EFI_LEGACY_8259_GET_MASK) (
+ IN EFI_LEGACY_8259_PROTOCOL *This,
+ OUT UINT16 *LegacyMask OPTIONAL,
+ OUT UINT16 *LegacyEdgeLevel OPTIONAL,
+ OUT UINT16 *ProtectedMask OPTIONAL,
+ OUT UINT16 *ProtectedEdgeLevel OPTIONAL
+);
+
+typedef EFI_STATUS (EFIAPI *EFI_LEGACY_8259_SET_MASK) (
+ IN EFI_LEGACY_8259_PROTOCOL *This,
+ IN UINT16 *LegacyMask OPTIONAL,
+ IN UINT16 *LegacyEdgeLevel OPTIONAL,
+ IN UINT16 *ProtectedMask OPTIONAL,
+ IN UINT16 *ProtectedEdgeLevel OPTIONAL
+);
+
+typedef EFI_STATUS (EFIAPI *EFI_LEGACY_8259_SET_MODE) (
+ IN EFI_LEGACY_8259_PROTOCOL *This,
+ IN EFI_8259_MODE Mode,
+ IN UINT16 *Mask OPTIONAL,
+ IN UINT16 *EdgeLevel OPTIONAL
+);
+
+typedef EFI_STATUS (EFIAPI *EFI_LEGACY_8259_GET_VECTOR) (
+ IN EFI_LEGACY_8259_PROTOCOL *This,
+ IN EFI_8259_IRQ Irq,
+ OUT UINT8 *Vector
+);
+
+typedef EFI_STATUS (EFIAPI *EFI_LEGACY_8259_ENABLE_IRQ) (
+ IN EFI_LEGACY_8259_PROTOCOL *This,
+ IN EFI_8259_IRQ Irq,
+ IN BOOLEAN LevelTriggered
+);
+
+typedef EFI_STATUS (EFIAPI *EFI_LEGACY_8259_DISABLE_IRQ) (
+ IN EFI_LEGACY_8259_PROTOCOL *This,
+ IN EFI_8259_IRQ Irq
+);
+
+typedef EFI_STATUS (EFIAPI *EFI_LEGACY_8259_GET_INTERRUPT_LINE) (
+ IN EFI_LEGACY_8259_PROTOCOL *This,
+ IN EFI_HANDLE PciHandle,
+ OUT UINT8 *Vector
+);
+
+typedef EFI_STATUS (EFIAPI *EFI_LEGACY_8259_END_OF_INTERRUPT) (
+ IN EFI_LEGACY_8259_PROTOCOL *This,
+ IN EFI_8259_IRQ Irq
+);
+
+typedef struct _EFI_LEGACY_8259_PROTOCOL {
+ EFI_LEGACY_8259_SET_VECTOR_BASE SetVectorBase;
+ EFI_LEGACY_8259_GET_MASK GetMask;
+ EFI_LEGACY_8259_SET_MASK SetMask;
+ EFI_LEGACY_8259_SET_MODE SetMode;
+ EFI_LEGACY_8259_GET_VECTOR GetVector;
+ EFI_LEGACY_8259_ENABLE_IRQ EnableIrq;
+ EFI_LEGACY_8259_DISABLE_IRQ DisableIrq;
+ EFI_LEGACY_8259_GET_INTERRUPT_LINE GetInterruptLine;
+ EFI_LEGACY_8259_END_OF_INTERRUPT EndOfInterrupt;
+};
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2005, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
diff --git a/Include/Protocol/LegacyAhci.h b/Include/Protocol/LegacyAhci.h
new file mode 100644
index 0000000..66873a5
--- /dev/null
+++ b/Include/Protocol/LegacyAhci.h
@@ -0,0 +1,110 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Pkwy, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/SOURCE/Modules/AHCI/INT13/protocol/LegacyAhci.h 5 2/10/11 10:50a Rameshr $
+//
+// $Revision: 5 $
+//
+// $Date: 2/10/11 10:50a $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/SOURCE/Modules/AHCI/INT13/protocol/LegacyAhci.h $
+//
+// 5 2/10/11 10:50a Rameshr
+// [TAG] EIP53704
+// [Category] Improvement
+// [Description] AMI headers update for Alaska Ahci Driver
+// [Files] LegacyAhci.h
+//
+// 4 5/28/08 9:42a Rameshraju
+// Updated the AMI Address.
+//
+// 3 3/28/08 12:15p Michaela
+// updated copyright
+//
+// 2 8/02/08 12:48p Anandakrishnanl
+// Matched InitAhciSupport Parameters with c file
+//
+// 1 12/07/07 11:18a Olegi
+//
+//
+//**********************************************************************
+//<AMI_FHDR_START>
+//
+// Name: LegacyAhci.h
+//
+// Description: AHCI INT13 initialization protocol
+//
+//<AMI_FHDR_END>
+//**********************************************************************
+#ifndef __LEGACY_AHCI_PROTOCOL_H__
+#define __LEGACY_AHCI_PROTOCOL_H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define EFI_AHCI_INT13_INIT_PROTOCOL_GUID \
+ { 0x67820532, 0x7613, 0x4dd3, 0x9e, 0xd7, 0x3d, 0x9b, 0xe3, 0xa7, 0xda, 0x63 }
+
+// the following ifndef is used when this .h file is included from EDK module...
+#ifndef GUID_VARIABLE_DECLARATION
+#define GUID_VARIABLE_DECLARATION(Variable, Guid) extern EFI_GUID Variable
+#endif
+
+GUID_VARIABLE_DECLARATION(gAint13ProtocolGuid,EFI_AHCI_INT13_INIT_PROTOCOL_GUID);
+
+#ifndef GUID_VARIABLE_DEFINITION
+#pragma pack (1)
+
+typedef struct _EFI_AHCI_INT13_INIT_PROTOCOL EFI_AHCI_INT13_INIT_PROTOCOL;
+
+typedef EFI_STATUS (EFIAPI *EFI_INIT_AHCI_INT13_SUPPORT) ();
+
+//<AMI_SHDR_START>
+//----------------------------------------------------------------------------
+// Name: EFI_AHCI_INT13_INIT_PROTOCOL
+//
+// Description: AHCI Int13 initialization protocol definition
+//
+//----------------------------------------------------------------------------
+//<AMI_SHDR_END>
+
+typedef struct _EFI_AHCI_INT13_INIT_PROTOCOL {
+ EFI_INIT_AHCI_INT13_SUPPORT InitAhciInt13Support;
+} EFI_AHCI_INT13_INIT_PROTOCOL;
+
+#pragma pack ()
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#endif // #ifndef GUID_VARIABLE_DEFINITION
+#ifdef __cplusplus
+}
+#endif
+#endif
+
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Pkwy, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
diff --git a/Include/Protocol/LegacyBios.h b/Include/Protocol/LegacyBios.h
new file mode 100644
index 0000000..ffb60da
--- /dev/null
+++ b/Include/Protocol/LegacyBios.h
@@ -0,0 +1,1041 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2010, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Pkwy, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/SOURCE/Modules/CSM/Generic/Protocol/LegacyBios.h 19 3/15/11 3:48p Olegi $
+//
+// $Revision: 19 $
+//
+// $Date: 3/15/11 3:48p $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/SOURCE/Modules/CSM/Generic/Protocol/LegacyBios.h $
+//
+// 19 3/15/11 3:48p Olegi
+// [TAG] EIP55913
+// [Category] Improvement
+// [Description] Remove LastOpromAddress from EFI_COMPATIBILITY16_TABLE
+// structure
+// [Files] Amilegacy16.bin, LegacyBios.h, LegacyBiosExt.h, Csm.c
+//
+// 18 1/12/10 11:51a Olegi
+// Copyright message updated.
+//
+// 17 6/12/07 10:10a Olegi
+// Changed MAX_BBS_ENTRIES_NO from 64 to 256 to comply with EDK protocol
+// file.
+//
+// 16 4/27/07 5:17p Olegi
+// CSM.CHM file preparation.
+//
+// 15 4/10/07 5:21p Olegi
+//
+// 14 2/06/07 10:47a Olegi
+//
+// 13 9/15/06 4:18p Davidd
+// Update the EfiSystemTable type in EFI_COMPATIBILITY16_TABLE to UINT32
+// per CSM Spec Ver 0.96
+//
+// 12 8/14/06 10:01a Olegi
+//
+// 11 5/25/06 2:30p Olegi
+//
+// 10 3/13/06 2:43p Felixp
+//
+//**********************************************************************
+//<AMI_FHDR_START>
+//
+// Name: LegacyBios.h
+//
+// Description: LegacyBios protocol declaration
+//
+//<AMI_FHDR_END>
+//**********************************************************************
+#ifndef __LEGACY_BIOS_PROTOCOL_H__
+#define __LEGACY_BIOS_PROTOCOL_H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+#include <EFI.h>
+
+#define EFI_LEGACY_BIOS_PROTOCOL_GUID \
+ { 0xdb9a1e3d, 0x45cb, 0x4abb, 0x85, 0x3b, 0xe5, 0x38, 0x7f, 0xdb, 0x2e, 0x2d}
+
+GUID_VARIABLE_DECLARATION(gEfiLegacyBiosProtocolGuid,EFI_LEGACY_BIOS_PROTOCOL_GUID);
+
+#ifndef GUID_VARIABLE_DEFINITION
+#include <Protocol/DevicePath.h>
+#pragma pack (1)
+
+typedef struct _EFI_LEGACY_BIOS_PROTOCOL EFI_LEGACY_BIOS_PROTOCOL;
+
+#define F0000_BIT 1
+#define E0000_BIT 2
+
+//<AMI_SHDR_START>
+//----------------------------------------------------------------------------
+// Name: EFI_COMPATIBILITY16_TABLE
+//
+// Desription:
+// There is a table located within the traditional BIOS in either the 0xF000:xxxx
+// or 0xE000:xxxx physical address range. It is located on a 16-byte boundary and
+// provides the physical address of the entry point for the Compatibility16
+// functions. These functions provide the platform-specific information that is
+// required by the generic EfiCompatibility code. The functions are invoked via
+// thunking by using EFI_LEGACY_BIOS_PROTOCOL.FarCall86() with the 32-bit physical
+// entry point defined below.
+//
+// Fields:
+// Signature UINT32 The string "$EFI"
+// TableChecksum UINT8 The value required such that byte checksum of TableLength equals zero.
+// TableLength UINT8 The length of this table.
+// EfiMajorRevision UINT8 The major EFI revision for which this table was generated.
+// EfiMinorRevision UINT8 The minor EFI revision for which this table was generated.
+// TableMajorRevision UINT8 The major revision of this table.
+// TableMinorRevision UINT8 The minor revision of this table.
+// Reserved UINT16 Reserved for future usage.
+// Compatibility16CallSegment UINT16 The segment of the entry point.
+// Compatibility16CallOffset UINT16 The offset of the entry point.
+// PnPInstallationCheckSegment UINT16 The segment of the PnP installation check structure.
+// PnPInstallationCheckOffset UINT16 The offset of the PnP installation check structure.
+// EfiSystemTable UINT32 The address of the EFI system resources table.
+// OemIdStringPointer UINT32 The address of an OEM-provided identifier string, 0-terminated.
+// AcpiRsdPtrPointer UINT32 The 32-bit physical address where ACPI RSD PTR is stored.
+// OemRevision UINT16 The OEM revision number. Usage is undefined.
+// E820Pointer UINT32 The 32-bit physical address where INT15 E820 data is stored.
+// E820Length UINT32 The length of the E820 data and is filled in by the EfiCompatibility code.
+// IrqRoutingTablePointer UINT32 The 32-bit physical address where the $PIR table is stored.
+// IrqRoutingTableLength UINT32 The length of the $PIR table and is filled in by the EfiCompatibility code.
+// MpTablePtr UINT32 The 32-bit physical address where the MP table is stored.
+// MpTableLength UINT32 The length of the MP table and is filled in by the EfiCompatibility code.
+// OemintSegment UINT16 The segment of the OEM-specific INT table/code.
+// OemIntOffset UINT16 The offset of the OEM-specific INT table/code.
+// Oem32Segment UINT16 The segment of the OEM-specific 32-bit table/code.
+// Oem32Offset UINT16 The offset of the OEM-specific 32-bit table/code.
+// Oem16Segment UINT16 The segment of the OEM-specific 16-bit table/code.
+// Oem16Offset UINT16 The offset of the OEM-specific 16-bit table/code.
+// TpmSegment UINT16 The segment of the TPM binary passed to 16-bit CSM.
+// TpmOffset UINT16 The offset of the TPM binary passed to 16-bit CSM.
+// IbvPointer UINT32 A pointer to a string identifying the independent BIOS vendor.
+// PciExpressBase UINT32 This field is the base value of the start of the PCI Express memory-mapped configuration registers.
+// LastpciBus UINT8 Maximum PCI bus number assigned.
+// LastOpromAddress UINT32 The last address that can be occupied by the Option ROM.
+//
+// Notes:
+// 1) The string "$EFI" denotes the start of the EfiCompatibility table. Byte 0 is
+// "I," byte 1 is "F," byte 2 is "E," and byte 3 is "$" and is normally accessed
+// as a DWORD or UINT32.
+// 2) The E820Pointer, IrqRoutingTablePointer, and MpTablePtr values are generated
+// by calling the Compatibility16GetTableAddress() function and converted to
+// 32-bit physical pointers.
+//----------------------------------------------------------------------------
+//<AMI_SHDR_END>
+
+typedef struct _EFI_COMPATIBILITY16_TABLE {
+ UINT32 Signature;
+ UINT8 TableChecksum;
+ UINT8 TableLength;
+ UINT8 EfiMajorRevision;
+ UINT8 EfiMinorRevision;
+ UINT8 TableMajorRevision;
+ UINT8 TableMinorRevision;
+ UINT16 Reserved;
+ UINT16 Compatibility16CallSegment;
+ UINT16 Compatibility16CallOffset;
+ UINT16 PnPInstallationCheckSegment;
+ UINT16 PnPInstallationCheckOffset;
+ UINT32 EfiSystemTable;
+ UINT32 OemIdStringPointer;
+ UINT32 AcpiRsdPtrPointer;
+ UINT16 OemRevision;
+ UINT32 E820Pointer;
+ UINT32 E820Length;
+ UINT32 IrqRoutingTablePointer;
+ UINT32 IrqRoutingTableLength;
+ UINT32 MpTablePtr;
+ UINT32 MpTableLength;
+ UINT16 OemIntSegment;
+ UINT16 OemIntOffset;
+ UINT16 Oem32Segment;
+ UINT16 Oem32Offset;
+ UINT16 Oem16Segment;
+ UINT16 Oem16Offset;
+ UINT16 TpmSegment;
+ UINT16 TpmOffset;
+ UINT32 IbvPointer;
+ UINT32 PciExpressBase;
+ UINT8 LastPciBus;
+} EFI_COMPATIBILITY16_TABLE;
+
+
+//<AMI_SHDR_START>
+//----------------------------------------------------------------------------
+// Name: HDD_INFO
+//
+// Fields:
+// Status UINT16 Status of IDE device. See Notes for details.
+// Bus UINT32 PCI bus of IDE controller.
+// Device UINT32 PCI device of IDE controller.
+// Function UINT32 PCI function of IDE controller.
+// CommandBaseAddress UINT16 Command ports base address.
+// ControlBaseAddress UINT16 Control ports base address.
+// BusMasterAddress UINT16 Bus master address.
+// IdentifyDrive ATAPI_IDENTIFY Data that identifies the drive data.
+//
+// Notes:
+// The values for the Status field are the following:
+// HDD_PRIMARY 0x01
+// HDD_SECONDARY 0x02
+// HDD_MASTER_ATAPI 0x04
+// HDD_SLAVE_ATAPI 0x08
+// HDD_MASTER_IDE 0x20
+// HDD_SLAVE_IDE 0x40
+// HDD_SATA_PATA 0x80
+// There is one HDD_INFO structure per IDE controller. The IdentifyDrive is
+// one per drive. Index 0 is master and index 1 is slave.
+//----------------------------------------------------------------------------
+//<AMI_SHDR_END>
+
+typedef struct _ATAPI_IDENTIFY {
+ UINT16 Raw[256];
+} ATAPI_IDENTIFY;
+
+//*************************************************
+// IDE device status values
+//*************************************************
+
+#define HDD_PRIMARY 0x01
+#define HDD_SECONDARY 0x02
+#define HDD_MASTER_ATAPI 0x04
+#define HDD_SLAVE_ATAPI 0x08
+#define HDD_MASTER_IDE 0x20
+#define HDD_SLAVE_IDE 0x40
+#define HDD_SATA_PATA 0x80
+
+typedef struct _HDD_INFO {
+ UINT16 Status;
+ UINT32 Bus;
+ UINT32 Device;
+ UINT32 Function;
+ UINT16 CommandBaseAddress;
+ UINT16 ControlBaseAddress;
+ UINT16 BusMasterAddress;
+ UINT8 HddIrq;
+ ATAPI_IDENTIFY IdentifyDrive[2];
+} HDD_INFO;
+
+
+//****************************************************
+// BBS related definitions
+//****************************************************
+
+//
+// BootPriority values
+//
+#define BBS_DO_NOT_BOOT_FROM 0xFFFC
+#define BBS_LOWEST_PRIORITY 0xFFFD
+#define BBS_UNPRIORITIZED_ENTRY 0xFFFE
+#define BBS_IGNORE_ENTRY 0xFFFF
+//
+// Following is a description of the above fields.
+//
+// BBS_DO_NOT_BOOT_FROM - Removes a device from the boot list but still
+// allows it to be enumerated as a valid device
+// under MS-DOS*.
+// BBS_LOWEST_PRIORITY - Forces the device to be the last boot device.
+// BBS_UNPRIORITIZED_ENTRY - Value that is placed in the BBS_TABLE.BootPriority
+// field before priority has been assigned but that
+// indicates it is valid entry. Other values indicate
+// the priority, with 0x0000 being the highest priority.
+// BBS_IGNORE_ENTRY - When placed in the BBS_TABLE.BootPriority field,
+// indicates that the entry is to be skipped.
+//
+
+//<AMI_SHDR_START>
+//----------------------------------------------------------------------------
+// Name: BBS_STATUS_FLAGS
+//
+// Fields:
+// OldPosition UINT16:4 Prior priority.
+// Reserved1 UINT16:4 Reserved for future use.
+// Enabled UINT16:1 If 0, ignore this entry.
+// Failed UINT16:1 0-Not known if boot failure occurred; 1-Boot attempt failed.
+// MediaPresent UINT16:2 State of media present, see notes.
+// Reserved2 UINT16:4 Reserved for future use.
+//
+// Notes:
+// MediaPresent field details:
+// 00 = No bootable media is present in the device.
+// 01 = Unknown if a bootable media present.
+// 10 = Media is present and appears bootable.
+// 11 = Reserved.
+//----------------------------------------------------------------------------
+//<AMI_SHDR_END>
+
+typedef struct {
+ UINT16 OldPosition : 4;
+ UINT16 Reserved1 : 4;
+ UINT16 Enabled : 1;
+ UINT16 Failed : 1;
+ UINT16 MediaPresent: 2;
+ UINT16 Reserved2 : 4;
+} BBS_STATUS_FLAGS;
+
+
+
+//****************************************************
+// DeviceType values
+//****************************************************
+#define BBS_FLOPPY 0x01
+#define BBS_HARDDISK 0x02
+#define BBS_CDROM 0x03
+#define BBS_PCMCIA 0x04
+#define BBS_USB 0x05
+#define BBS_EMBED_NETWORK 0x06
+#define BBS_BEV_DEVICE 0x80
+#define BBS_UNKNOWN 0xff
+
+
+
+//<AMI_SHDR_START>
+//----------------------------------------------------------------------------
+// Name: BBS_TABLE
+//
+// Fields:
+// BootPriority UINT16 The boot priority for this boot device.
+// Bus UINT32 The PCI bus for this boot device.
+// Device UINT32 The PCI device for this boot device.
+// Function UINT32 The PCI function for the boot device.
+// Class UINT8 The PCI class for this boot device..
+// SubClass UINT8 The PCI Subclass for this boot device.
+// MfgString UINT32 Segment:offset address of an ASCIIZ description.
+// DeviceType UINT16 BBS device type.
+// StatusFlags BBS_STATUS_FLAGS Status of this boot device.
+// BootHandler UINT32 Segment:Offset address of boot loader for IPL devices.
+// DescString UINT32 Segment:offset address of an ASCIIZ description string.
+// InitPerReserved UINT32 Reserved.
+// AdditionalIrq??Handler UINT32 See notes for details.
+// AssignedDriveNumber UINT8 The drive number(0x80 -0x8?) assigned by the 16-bit code.
+// IBV1 UINT32 IBV specific field.
+// IBV2 UINT32 IBV specific field.
+//
+// Notes:
+// The use of AdditionalIrq??Handler fields is IBV dependent. They can be
+// used to flag that an OpROM has hooked the specified IRQ. The OpROM
+// may be BBS compliant as some SCSI BBS-compliant OpROMs also hook IRQ
+// vectors in order to run their BIOS Setup.
+//----------------------------------------------------------------------------
+//<AMI_SHDR_END>
+
+typedef struct _BBS_TABLE {
+ UINT16 BootPriority;
+ UINT32 Bus;
+ UINT32 Device;
+ UINT32 Function;
+ UINT8 Class;
+ UINT8 SubClass;
+ UINT16 MfgStringOffset;
+ UINT16 MfgStringSegment;
+ UINT16 DeviceType;
+ BBS_STATUS_FLAGS StatusFlags;
+ UINT16 BootHandlerOffset;
+ UINT16 BootHandlerSegment;
+ UINT16 DescStringOffset;
+ UINT16 DescStringSegment;
+ UINT32 InitPerReserved;
+ UINT32 AdditionalIrq13Handler;
+ UINT32 AdditionalIrq18Handler;
+ UINT32 AdditionalIrq19Handler;
+ UINT32 AdditionalIrq40Handler;
+ UINT8 AssignedDriveNumber;
+ UINT32 AdditionalIrq41Handler;
+ UINT32 AdditionalIrq46Handler;
+ UINT32 IBV1;
+ UINT32 IBV2;
+} BBS_TABLE;
+
+#define MAX_BBS_ENTRIES_NO 256
+
+//<AMI_SHDR_START>
+//----------------------------------------------------------------------------
+// Name: EFI_IA32_REGISTER_SET
+// Name: EFI_BYTE_REGS
+// Name: EFI_WORD_REGS
+// Name: EFI_DWORD_REGS
+// Name: EFI_FLAGS_REG
+// Name: EFI_EFLAGS_REG
+//
+// Description: These register set definitions are used in EFI_LEGACY_BIOS_INT86
+// and EFI_LEGACY_BIOS_FARCALL86 fuctions.
+//
+//----------------------------------------------------------------------------
+//<AMI_SHDR_END>
+
+typedef struct {
+ UINT16 CF:1;
+ UINT16 Reserved1:1;
+ UINT16 PF:1;
+ UINT16 Reserved2:1;
+ UINT16 AF:1;
+ UINT16 Reserved3:1;
+ UINT16 ZF:1;
+ UINT16 SF:1;
+ UINT16 TF:1;
+ UINT16 IF:1;
+ UINT16 DF:1;
+ UINT16 OF:1;
+ UINT16 IOPL:2;
+ UINT16 NT:1;
+ UINT16 Reserved4:1;
+} EFI_FLAGS_REG;
+
+#define CARRY_FLAG 0x01
+
+typedef struct {
+ UINT32 CF:1;
+ UINT32 Reserved1:1;
+ UINT32 PF:1;
+ UINT32 Reserved2:1;
+ UINT32 AF:1;
+ UINT32 Reserved3:1;
+ UINT32 ZF:1;
+ UINT32 SF:1;
+ UINT32 TF:1;
+ UINT32 IF:1;
+ UINT32 DF:1;
+ UINT32 OF:1;
+ UINT32 IOPL:2;
+ UINT32 NT:1;
+ UINT32 Reserved4:2;
+ UINT32 VM:1;
+ UINT32 Reserved5:14;
+} EFI_EFLAGS_REG;
+
+typedef struct {
+ UINT32 EAX;
+ UINT32 EBX;
+ UINT32 ECX;
+ UINT32 EDX;
+ UINT32 ESI;
+ UINT32 EDI;
+ EFI_EFLAGS_REG EFlags;
+ UINT16 ES;
+ UINT16 CS;
+ UINT16 SS;
+ UINT16 DS;
+ UINT16 FS;
+ UINT16 GS;
+ UINT32 EBP;
+} EFI_DWORD_REGS;
+
+typedef struct {
+ UINT16 AX;
+ UINT16 ReservedAX;
+ UINT16 BX;
+ UINT16 ReservedBX;
+ UINT16 CX;
+ UINT16 ReservedCX;
+ UINT16 DX;
+ UINT16 ReservedDX;
+ UINT16 SI;
+ UINT16 ReservedSI;
+ UINT16 DI;
+ UINT16 ReservedDI;
+ EFI_FLAGS_REG Flags;
+ UINT16 ReservedFlags;
+ UINT16 ES;
+ UINT16 CS;
+ UINT16 SS;
+ UINT16 DS;
+ UINT16 FS;
+ UINT16 GS;
+ UINT16 BP;
+ UINT16 ReservedBP;
+} EFI_WORD_REGS;
+
+typedef struct {
+ UINT8 AL, AH;
+ UINT16 ReservedAX;
+ UINT8 BL, BH;
+ UINT16 ReservedBX;
+ UINT8 CL, CH;
+ UINT16 ReservedCX;
+ UINT8 DL, DH;
+ UINT16 ReservedDX;
+} EFI_BYTE_REGS;
+
+typedef union {
+ EFI_DWORD_REGS E;
+ EFI_WORD_REGS X;
+ EFI_BYTE_REGS H;
+} EFI_IA32_REGISTER_SET;
+
+
+//<AMI_PHDR_START>
+//----------------------------------------------------------------------------
+// Name: EFI_LEGACY_BIOS_INT86
+//
+// Description: Issues a traditional software INT.
+//
+// Input:
+// This - Indicates the EFI_LEGACY_BIOS_PROTOCOL instance.
+// BiosInt - The software INT requested.
+// Regs - The IA-32 registers.
+//
+// Output:
+// FALSE INT completed. Status returned in Regs.
+// TRUE INT was not completed.
+//
+// Referrals: EFI_IA32_REGISTER_SET
+//
+//----------------------------------------------------------------------------
+//<AMI_PHDR_END>
+
+typedef
+BOOLEAN
+(EFIAPI *EFI_LEGACY_BIOS_INT86) (
+ IN EFI_LEGACY_BIOS_PROTOCOL *This,
+ IN UINT8 BiosInt,
+ IN OUT EFI_IA32_REGISTER_SET *Regs
+ );
+
+
+//<AMI_PHDR_START>
+//----------------------------------------------------------------------------
+// Name: EFI_LEGACY_BIOS_FARCALL86
+//
+// Description: This function performs a far call into Compatibility16 or
+// traditional OpROM code at the specified Segment:Offset.
+// Input:
+// This Indicates the EFI_LEGACY_BIOS_PROTOCOL instance.
+// Segment Segment of 16-bit mode call.
+// Offset Offset of 16-bit mode call.
+// Regs The IA-32 registers, type EFI_IA32_REGISTER_SET
+// Stack Caller-allocated stack that is used to pass arguments.
+// StackSize Size of Stack in bytes.
+//
+// Output:
+// FALSE FarCall() completed. Status returned in Regs
+// TRUE FarCall() was not completed.
+//
+// Referrals: EFI_IA32_REGISTER_SET
+//
+//----------------------------------------------------------------------------
+//<AMI_PHDR_END>
+
+typedef
+BOOLEAN
+(EFIAPI *EFI_LEGACY_BIOS_FARCALL86) (
+ IN EFI_LEGACY_BIOS_PROTOCOL *This,
+ IN UINT16 Segment,
+ IN UINT16 Offset,
+ IN EFI_IA32_REGISTER_SET *Regs,
+ IN VOID *Stack,
+ IN UINTN StackSize
+ );
+
+
+//<AMI_PHDR_START>
+//----------------------------------------------------------------------------
+// Name: EFI_LEGACY_BIOS_CHECK_ROM
+//
+// Description: Tests to see if a traditional PCI ROM exists for this device
+//
+// Input:
+// This Indicates the EFI_LEGACY_BIOS_PROTOCOL instance.
+// PciHandle The handle for this device. Type EFI_HANDLE is defined in
+// InstallProtocolInterface() in the EFI 1.10 Specification.
+// RomImage Pointer to the ROM image.
+// RomSize The size of the ROM image.
+// Flags The type of ROM discovered. Multiple bits can be set, as follows:
+// 00 = No ROM
+// 01 = ROM Found
+// 02 = ROM is a valid legacy ROM
+//
+// Output: EFI_SUCCESS A traditional OpROM is available for this device.
+// EFI_UNSUPPORTED A traditional OpROM is not supported.
+//----------------------------------------------------------------------------
+//<AMI_PHDR_END>
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_LEGACY_BIOS_CHECK_ROM) (
+ IN EFI_LEGACY_BIOS_PROTOCOL *This,
+ IN EFI_HANDLE PciHandle,
+ OUT VOID **RomImage, OPTIONAL
+ OUT UINTN *RomSize, OPTIONAL
+ OUT UINTN *Flags
+ );
+
+//<AMI_PHDR_START>
+//----------------------------------------------------------------------------
+// Name: EFI_LEGACY_BIOS_INSTALL_ROM
+//
+// Description: Shadows an OpROM
+//
+// Input:
+// This Indicates the EFI_LEGACY_BIOS_PROTOCOL instance.
+// PciHandle The PCI PC-AT* OpROM from this device's ROM BAR will be loaded
+// RomImage A PCI PC-AT ROM image. This argument is non-NULL if there is
+// no hardware associated with the ROM and thus no PciHandle; otherwise it
+// must be NULL. An example is the PXE base code.
+// Flags The type of ROM discovered. Multiple bits can be set, as follows:
+// 00 = No ROM.
+// 01 = ROM found.
+// 02 = ROM is a valid legacy ROM.
+// DiskStart Disk number of the first device hooked by the ROM. If DiskStart is
+// the same as DiskEnd, no disks were hooked.
+// DiskEnd Disk number of the last device hooked by the ROM.
+// RomShadowAddress Shadow address of PC-AT ROM.
+// ShadowedRomSize Size in bytes of RomShadowAddress.
+//
+// Output:
+// EFI_SUCCESS The OpROM was shadowed
+// EFI_UNSUPPORTED The PciHandle was not found
+//----------------------------------------------------------------------------
+//<AMI_PHDR_END>
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_LEGACY_BIOS_INSTALL_ROM) (
+ IN EFI_LEGACY_BIOS_PROTOCOL *This,
+ IN EFI_HANDLE PciHandle,
+ IN VOID **RomImage,
+ OUT UINTN *Flags,
+ OUT UINT8 *DiskStart, OPTIONAL
+ OUT UINT8 *DiskEnd, OPTIONAL
+ OUT VOID **RomShadowAddress, OPTIONAL
+ OUT UINT32 *ShadowedRomSize OPTIONAL
+ );
+
+//<AMI_PHDR_START>
+//----------------------------------------------------------------------------
+// Name: EFI_LEGACY_BIOS_BOOT
+//
+// Description: Boots a traditional OS
+//
+// Input:
+// This Indicates the EFI_LEGACY_BIOS_PROTOCOL instance.
+// BootOption The EFI device path from BootXXXX variable.
+// LoadOptionSize Size of LoadOption.
+// LoadOption The load option from BootXXXX variable.
+//
+// Output:
+// EFI_DEVICE_ERROR Failed to boot from any boot device and
+// memory is uncorrupted.
+//
+// Notes: This function normally never returns. It will either boot the OS
+// or reset the system if memory has been "corrupted" by loading a
+// boot sector and passing control to it.
+//----------------------------------------------------------------------------
+//<AMI_PHDR_END>
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_LEGACY_BIOS_BOOT) (
+ IN EFI_LEGACY_BIOS_PROTOCOL *This,
+ IN BBS_BBS_DEVICE_PATH *BootOption,
+ IN UINT32 LoadOptionsSize,
+ IN VOID *LoadOptions
+ );
+
+
+//<AMI_PHDR_START>
+//----------------------------------------------------------------------------
+// Name: EFI_LEGACY_BIOS_UPDATE_KEYBOARD_LED_STATUS
+//
+// Description: Updates the BDA to reflect status of the Scroll Lock,
+// Num Lock, and Caps Lock keys and LEDs.
+//
+// Input:
+// This Indicates the EFI_LEGACY_BIOS_PROTOCOL instance.
+// Leds Current LED status, as follows:
+// Bit 0 - Scroll Lock 0 = Off
+// Bit 1 - Num Lock
+// Bit 2 - Caps Lock
+// Output:
+// EFI_SUCCESS The BDA was updated successfully.
+//
+//----------------------------------------------------------------------------
+//<AMI_PHDR_END>
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_LEGACY_BIOS_UPDATE_KEYBOARD_LED_STATUS) (
+ IN EFI_LEGACY_BIOS_PROTOCOL *This,
+ IN UINT8 Leds
+ );
+
+
+//<AMI_PHDR_START>
+//----------------------------------------------------------------------------
+// Name: EFI_LEGACY_BIOS_GET_BBS_INFO
+//
+// Description: Presents BBS information to external agents.
+//
+// Input:
+// This Indicates the EFI_LEGACY_BIOS_PROTOCOL instance.
+// HddCount Number of HDD_INFO structures.
+// HddInfo Onboard IDE controller information.
+// BbsCount Number of BBS_TABLE structures.
+// BbsTable BBS entry.
+//
+// Output: EFI_SUCCESS
+//----------------------------------------------------------------------------
+//<AMI_PHDR_END>
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_LEGACY_BIOS_GET_BBS_INFO) (
+ IN EFI_LEGACY_BIOS_PROTOCOL *This,
+ OUT UINT16 *HddCount,
+ OUT struct _HDD_INFO **HddInfo,
+ OUT UINT16 *BbsCount,
+ IN OUT struct _BBS_TABLE **BbsTable
+ );
+
+
+//<AMI_PHDR_START>
+//----------------------------------------------------------------------------
+// Name: EFI_LEGACY_BIOS_SHADOW_ALL_LEGACY_OPROMS
+//
+// Description: Allows external agents to force loading of all legacy OpROMs.
+// This function can be invoked before GetBbsInfo() to ensure all
+// devices are counted.
+// Input:
+// This Indicates the EFI_LEGACY_BIOS_PROTOCOL instance.
+//
+// Output:
+// EFI_SUCCESS OpROMs are shadowed successfully.
+//----------------------------------------------------------------------------
+//<AMI_PHDR_END>
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_LEGACY_BIOS_SHADOW_ALL_LEGACY_OPROMS) (
+ IN EFI_LEGACY_BIOS_PROTOCOL *This
+ );
+
+
+//<AMI_PHDR_START>
+//----------------------------------------------------------------------------
+// Name: EFI_LEGACY_BIOS_PREPARE_TO_BOOT
+//
+// Description: This function is called when booting an EFI-aware OS with legacy
+// hard disks. The legacy hard disks may or may not be the boot
+// device but will be accessed by the EFI-aware OS.
+// Input:
+// This Indicates the EFI_LEGACY_BIOS_PROTOCOL instance.
+// BbsCount Number of BBS_TABLE structures.
+// BbsTable BBS entry.
+//
+// Output:
+// EFI_SUCCESS Boot is prepared successfully.
+//----------------------------------------------------------------------------
+//<AMI_PHDR_END>
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_LEGACY_BIOS_PREPARE_TO_BOOT) (
+ IN EFI_LEGACY_BIOS_PROTOCOL *This,
+ OUT UINT16 *BbsCount,
+ OUT struct _BBS_TABLE **BbsTable
+ );
+
+
+//<AMI_PHDR_START>
+//----------------------------------------------------------------------------
+// Name: EFI_LEGACY_BIOS_GET_LEGACY_REGION
+//
+// Description: This function is called when EFI needs to reserve an area
+// in the 0xE0000 or 0xF0000 64 KB blocks.
+// Input:
+// This Indicates the EFI_LEGACY_BIOS_PROTOCOL instance.
+// LegacyMemorySize Requested size in bytes of the region.
+// Region Requested region.
+// 00 = Either 0xE0000 or 0xF0000 blocks.
+// Bit0 = 1 Specify 0xF0000 block
+// Bit1 = 1 Specify 0xE0000 block
+// Alignment Bit-mapped value specifying the address alignment of the requested
+// region. The first nonzero value from the right is alignment.
+//
+// Output:
+// LegacyMemoryAddress Address assigned.
+// EFI_SUCCESS The requested region was assigned.
+// EFI_ACCESS_DENIED The function was previously invoked.
+// Other The requested region was not assigned.
+//----------------------------------------------------------------------------
+//<AMI_PHDR_END>
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_LEGACY_BIOS_GET_LEGACY_REGION) (
+ IN EFI_LEGACY_BIOS_PROTOCOL *This,
+ IN UINTN LegacyMemorySize,
+ IN UINTN Region,
+ IN UINTN Alignment,
+ OUT VOID **LegacyMemoryAddress
+ );
+
+//<AMI_PHDR_START>
+//----------------------------------------------------------------------------
+// Name: EFI_LEGACY_BIOS_COPY_LEGACY_REGION
+//
+// Description: This function is called when copying data to the region
+// assigned by EFI_LEGACY_BIOS_PROTOCOL.GetLegacyRegion().
+//
+// Input:
+// This Indicates the EFI_LEGACY_BIOS_PROTOCOL instance.
+// LegacyMemorySize Size in bytes of the memory to copy.
+// LegacyMemoryAddress The location within the region returned by
+// EFI_LEGACY_BIOS_PROTOCOL.GetLegacyRegion().
+// LegacyMemorySourceAddress Source of the data to copy.
+//
+// Output:
+// EFI_SUCCESS The data was copied successfully.
+// EFI_ACCESS_DENIED Either the starting or ending address is out of bounds.
+//
+//----------------------------------------------------------------------------
+//<AMI_PHDR_END>
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_LEGACY_BIOS_COPY_LEGACY_REGION) (
+ IN EFI_LEGACY_BIOS_PROTOCOL *This,
+ IN UINTN LegacyMemorySize,
+ IN VOID *LegacyMemoryAddress,
+ IN VOID *LegacyMemorySourceAddress
+ );
+
+
+//<AMI_SHDR_START>
+//----------------------------------------------------------------------------
+// Name: UDC_ATTRIBUTES
+//
+// Fields:
+// DirectoryServiceValidity UINT8:1 This bit set indicates that the ServiceAreaData is valid.
+// RacbaUsedFlag UINT8:1 This bit set indicates to use the RACBA only if DirectoryServiceValidity is 0.
+// ExecuteHddDiagnosticsFlag UINT8:1 This bit set indicates to execute hard disk diagnostics.
+// Reserved UINT8:5 Reserved for future use. Set to 0.
+//
+//----------------------------------------------------------------------------
+//<AMI_SHDR_END>
+
+typedef struct {
+ UINT8 DirectoryServiceValidity : 1;
+ UINT8 RabcaUsedFlag : 1;
+ UINT8 ExecuteHddDiagnosticsFlag : 1;
+ UINT8 Reserved : 5;
+} UDC_ATTRIBUTES;
+
+
+//<AMI_SHDR_START>
+//----------------------------------------------------------------------------
+// Name: UD_TABLE
+//
+// Fields:
+// Attributes UDC_ATTRIBUTES This field contains the bit-mapped attributes of the PARTIES information.
+// DeviceNumber UINT8 This field contains the zero-based device on which the selected ServiceDataArea is present.
+// BbsTableEntryNumberForParentDevice UINT8 This field contains the zero-based index into the BbsTable for the parent device.
+// BbsTableEntryNumberForBoot UINT8 This field contains the zero-based index into the BbsTable for the boot entry.
+// BbsTableEntryNumberForHddDiag UINT8 This field contains the zero-based index into the BbsTable for the HDD diagnostics entry.
+// BeerData UINT8[128] The raw Beer data.
+// ServiceAreaData UINT8[64] The raw data of selected service area.
+//
+//----------------------------------------------------------------------------
+//<AMI_SHDR_END>
+
+typedef struct {
+ UDC_ATTRIBUTES Attributes;
+ UINT8 DeviceNumber;
+ UINT8 BbsTableEntryNumberForParentDevice;
+ UINT8 BbsTableEntryNumberForBoot;
+ UINT8 BbtTableEntryNumberForHddDiag;
+ UINT8 BeerData[128];
+ UINT8 ServiceAreaData[64];
+} UD_TABLE;
+
+
+//----------------------------------------------------------------------------
+// PCI Bus Xlat protocol definition
+//
+// {CB5C54C0-230D-43db-922C-24D34F8C915C}
+#define AMICSM_PCIBUSNUM_XLAT_PROTOCOL_GUID \
+ {0xcb5c54c0, 0x230d, 0x43db, 0x92, 0x2c, 0x24, 0xd3, 0x4f, 0x8c, 0x91, 0x5c}
+
+//<AMI_PHDR_START>
+//----------------------------------------------------------------------------
+// Name: AMICSM_GET_PCIBUS_XLAT_NUMBER
+//
+// Description: This function returns the PCI bus number translated according
+// to Xlat table defined in BusNumXlat.inc. This translation file
+// is generated by AMISDL using "BUSNUM_XLAT" output type.
+//
+// Input: Build time PCI bus number - 1st coulmn of the xlat table
+//
+// Output: EFI_SUCCESS, real PCI bus number - 2nd column of the xlat table
+// EFI_NOT_FOUND, the requested bus is not found in the xlat table
+// EFI_INVALID_PARAMETER, if NULL pointer is supplied on input
+//
+//----------------------------------------------------------------------------
+//<AMI_PHDR_END>
+
+typedef
+EFI_STATUS
+(EFIAPI *AMICSM_GET_PCIBUS_XLAT_NUMBER) (
+ IN OUT UINT8 *busNumber
+);
+
+//<AMI_SHDR_START>
+//----------------------------------------------------------------------------
+// Name: AMICSM_PCIBUSNUM_XLAT_PROTOCOL
+//
+// Description: This protocol defines the function that returns the PCI
+// according to the table generated by AMISDL out of the list
+// of PCI-PCI bridges.
+// Fields:
+// GetXlatPciBusNum AMICSM_GET_PCIBUS_XLAT_NUMBER Returns the translated bus number
+//
+//----------------------------------------------------------------------------
+//<AMI_SHDR_END>
+
+typedef struct _AMICSM_PCIBUSNUM_XLAT_PROTOCOL {
+ AMICSM_GET_PCIBUS_XLAT_NUMBER GetXlatPciBusNum;
+} AMICSM_PCIBUSNUM_XLAT_PROTOCOL;
+
+
+//<AMI_PHDR_START>
+//----------------------------------------------------------------------------
+// Name: EFI_LEGACY_BIOS_BOOT_UNCONVENTIONAL_DEVICE
+//
+// Description: This function is called when either booting to an unconventional
+// device such as a PARTIES partition and/or executing hard disk
+// diagnostics.
+// Input:
+// This
+// Indicates the EFI_LEGACY_BIOS_PROTOCOL instance.
+// Attributes
+// Flags used to interpret the rest of the input parameters. Type UDC_ATTRIBUTES
+// is defined in Compatibility16PrepareToBoot().
+// BbsEntry
+// The zero-based index into the BbsTable for the parent device. Type BBS_TABLE
+// is defined in Compatibility16PrepareToBoot().
+// BeerData
+// Pointer to the 128 bytes of raw Beer data.
+// ServiceAreaData
+// Pointer to the 64 bytes of raw service area data. It is up to the caller to
+// select the appropriate service area and point to it.
+//
+// Output:
+// EFI_INVALID_PARAMETER Either the Attribute and/or pointers do not match.
+//
+//----------------------------------------------------------------------------
+//<AMI_PHDR_END>
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_LEGACY_BIOS_BOOT_UNCONVENTIONAL_DEVICE) (
+ IN EFI_LEGACY_BIOS_PROTOCOL *This,
+ IN UDC_ATTRIBUTES Attributes,
+ IN UINTN BbsEntry,
+ IN VOID *BeerData,
+ IN VOID *ServiceAreaData
+ );
+
+
+//*****************************************************************
+// Compatibility16 Functions
+//*****************************************************************
+typedef enum {
+ Compatibility16InitializeYourself, // 0000,
+ Compatibility16UpdateBbs, // 0001,
+ Compatibility16PrepareToBoot, // 0002,
+ Compatibility16Boot, // 0003,
+ Compatibility16RetrieveLastBootDevice,// 0004,
+ Compatibility16DispatchOprom, // 0005,
+ Compatibility16GetTableAddress, // 0006,
+ Compatibility16SetKeyboardLeds, // 0007,
+ Compatibility16InstallPciHandler // 0008,
+} EFI_COMPATIBILITY_FUNCTIONS;
+
+
+//<AMI_SHDR_START>
+//----------------------------------------------------------------------------
+// Name: EFI_LEGACY_BIOS_PROTOCOL
+//
+// Description: Abstracts the traditional BIOS from the rest of EFI. The
+// LegacyBoot() member function allows the BDS to support booting
+// a traditional OS. EFI thunks drivers that make EFI bindings for
+// BIOS INT services use all the other member functions.
+// Fields:
+// Int86 EFI_LEGACY_BIOS_INT86 Performs traditional software INT.
+// FarCall86 EFI_LEGACY_BIOS_FARCALL86 Performs a 16-bit far call.
+// CheckPciRom EFI_LEGACY_BIOS_CHECK_ROM Checks if a traditional OpROM exists for this device.
+// InstallPciRom EFI_LEGACY_BIOS_INSTALL_ROM Loads a traditional OpROM in traditional OpROM address space.
+// LegacyBoot EFI_LEGACY_BIOS_BOOT Boots a traditional OS.
+// UpdateKeyboardLedStatus EFI_LEGACY_BIOS_UPDATE_KEYBOARD_LED_STATUS Updates BDA to reflect the current EFI keyboard LED status.
+// GetBbsInfo EFI_LEGACY_BIOS_GET_BBS_INFO Allows an external agent, such as BIOS Setup, to get the BBS data.
+// ShadowAllLegacyOproms EFI_LEGACY_BIOS_SHADOW_ALL_LEGACY_OPROMS Causes all legacy OpROMs to be shadowed.
+// PrepareToBoot EFI_LEGACY_BIOS_PREPARE_TO_BOOT Performs all actions prior to boot.
+// GetLegacyRegion EFI_LEGACY_BIOS_GET_LEGACY_REGION Allows EFI to reserve an area in the 0xE0000 or 0xF0000 block.
+// CopyLegacyRegion EFI_LEGACY_BIOS_COPY_LEGACY_REGION Allows EFI to copy data to the area specified by GetLegacyRegion.
+// BootUnconventionalDevice EFI_LEGACY_BIOS_BOOT_UNCONVENTIONAL_DEVICE Allows the user to boot off an unconventional device.
+//
+//----------------------------------------------------------------------------
+//<AMI_SHDR_END>
+
+typedef struct _EFI_LEGACY_BIOS_PROTOCOL {
+ EFI_LEGACY_BIOS_INT86 Int86;
+ EFI_LEGACY_BIOS_FARCALL86 FarCall86;
+ EFI_LEGACY_BIOS_CHECK_ROM CheckPciRom;
+ EFI_LEGACY_BIOS_INSTALL_ROM InstallPciRom;
+ EFI_LEGACY_BIOS_BOOT LegacyBoot;
+ EFI_LEGACY_BIOS_UPDATE_KEYBOARD_LED_STATUS
+ UpdateKeyboardLedStatus;
+ EFI_LEGACY_BIOS_GET_BBS_INFO GetBbsInfo;
+ EFI_LEGACY_BIOS_SHADOW_ALL_LEGACY_OPROMS
+ ShadowAllLegacyOproms;
+ EFI_LEGACY_BIOS_PREPARE_TO_BOOT
+ PrepareToBootEFI;
+ EFI_LEGACY_BIOS_GET_LEGACY_REGION
+ GetLegacyRegion;
+ EFI_LEGACY_BIOS_COPY_LEGACY_REGION
+ CopyLegacyRegion;
+ EFI_LEGACY_BIOS_BOOT_UNCONVENTIONAL_DEVICE
+ BootUnconventionalDevice;
+} EFI_LEGACY_BIOS_PROTOCOL;
+
+#pragma pack ()
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#endif // #ifndef GUID_VARIABLE_DEFINITION
+#ifdef __cplusplus
+}
+#endif
+#endif
+
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2010, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Pkwy, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
diff --git a/Include/Protocol/LegacyBiosExt.h b/Include/Protocol/LegacyBiosExt.h
new file mode 100644
index 0000000..6eb801c
--- /dev/null
+++ b/Include/Protocol/LegacyBiosExt.h
@@ -0,0 +1,440 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2010, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Pkwy, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/SOURCE/Modules/CSM/Generic/Protocol/LegacyBiosExt.h 37 1/10/14 12:17p Olegi $
+//
+// $Revision: 37 $
+//
+// $Date: 1/10/14 12:17p $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/SOURCE/Modules/CSM/Generic/Protocol/LegacyBiosExt.h $
+//
+// 37 1/10/14 12:17p Olegi
+// EIP149769: LegacyToEfi boot management
+// Changed default setting, added new token to extend the functionality
+//
+// 36 10/18/13 12:39p Olegi
+// EIP139866
+// Create interface to manage LegacyToEfi CSM feature
+//
+// 35 10/07/13 10:22a Olegi
+// [TAG] EIP138427
+// [Category] New Feature
+// [Description] Create interface to let OEM customers change CSM16
+// variables
+// [Files] csm.c, csm.h, csmlib.c, legacybiosext.h
+//
+// 34 9/26/13 10:43a Olegi
+//
+// 33 8/14/13 8:37a Olegi
+// [TAG] EIP132753
+// [Category] Improvement
+// Legacy2Efi module support
+//
+// 32 12/26/12 3:26p Olegi
+//
+// 31 7/23/12 12:10p Olegi
+// [TAG] EIP92416
+// [Description] Testing request for Smbios (INT)a_4.6.5.1_SMBIOS_32
+// label
+// LegacyBiosExt protocol is rearranged to match the one used by the
+// SMBIOS.
+//
+// 30 12/23/11 2:14p Olegi
+// [TAG] EIP78921
+// [Category] Improvement
+// [Description] CsmBlockIo should create device handle in BBS table
+//
+// 29 3/15/11 3:50p Olegi
+// [TAG] EIP55913
+// [Category] Improvement
+// [Description] Remove LastOpromAddress from EFI_COMPATIBILITY16_TABLE
+// structure
+// [Files] Csm.c LegacyBios.h LegacyBiosExt.h
+//
+// 28 3/14/11 10:00a Olegi
+// [TAG] EIP54942
+// [Category] New Feature
+// [Description] CLP support implementation
+// [Files] CsmOprom.c LegacyBiosExt.h
+//
+// 27 9/13/10 5:50p Vyacheslava
+// Added ReverseThunkPtrOfs variable.
+//
+// 26 8/18/10 5:25p Olegi
+// added two fields to LEGACY16_TO_EFI_DATA_TABLE structure: offset of
+// "$EFI" and offset of SMBIOS header. EIP42457
+//
+// 25 7/27/10 2:14p Olegi
+// Added ReverseThunkPtrOfs field to LEGACY16_TO_EFI_DATA_TABLE_STRUC
+// structure. EIP39674.
+//
+// 24 7/08/10 11:29a Olegi
+// Added EFI_AMI_LEGACYBOOT_PROTOCOL_GUID definition.
+//
+// 23 5/17/10 4:27p Olegi
+//
+// 22 5/14/10 4:09p Olegi
+//
+// 21 4/28/10 11:55a Olegi
+//
+// 20 1/27/10 6:28p Olegi
+//
+// 19 1/12/10 11:51a Olegi
+// Copyright message updated.
+//
+// 18 8/07/09 4:33p Olegi
+// SD binary ID definition added.
+//
+// 17 7/02/08 1:51p Olegi
+//
+// 16 5/22/08 11:47a Olegi
+// Added CSM16_OEM_BEFORE_CALL_BOOT_VECTOR definition.
+//
+// 15 5/08/08 6:03p Olegi
+// Added definition of OPROM_MULTIPLE_MODULEID
+//
+// 14 1/31/08 6:09p Olegi
+// Modifications in AllocateEbda API
+//
+// 13 1/16/08 2:05p Olegi
+//
+// 12 1/16/08 1:54p Olegi
+// AllocateEbda interface is updated.
+//
+// 9 12/03/07 4:01p Olegi
+// Added three new interface functions: UnlockShadow, LockShadow, and
+// Get16BitFuncAddress.
+//
+// 8 11/14/07 12:36p Olegi
+//
+// 7 10/24/07 12:28p Olegi
+// Function AllocateEbda added to LegacyBiosExt protocol.
+//
+// 6 8/21/07 11:27a Olegi
+//
+// 5 8/09/07 4:24p Olegi
+//
+// 4 7/13/07 8:44a Olegi
+//
+// 3 6/21/07 10:31a Olegi
+//
+// 2 6/18/07 5:52p Olegi
+//
+// 1 6/13/07 10:44a Olegi
+//
+//**********************************************************************
+//<AMI_FHDR_START>
+//
+// Name: LegacyBiosExt.h
+//
+// Description: AMI extensions to LegacyBios protocol
+//
+//<AMI_FHDR_END>
+//**********************************************************************
+#ifndef __LEGACY_BIOS_EXT_PROTOCOL_H__
+#define __LEGACY_BIOS_EXT_PROTOCOL_H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+//#include <EFI.h>
+#include <Protocol\LegacyRegion.h>
+#include <Protocol\LegacyBios.h>
+
+#define EFI_LEGACY_BIOS_EXT_PROTOCOL_GUID \
+ { 0x8e008510, 0x9bb1, 0x457d, 0x9f, 0x70, 0x89, 0x7a, 0xba, 0x86, 0x5d, 0xb9 }
+
+GUID_VARIABLE_DECLARATION(gEfiLegacyBiosExtProtocolGuid,EFI_LEGACY_BIOS_EXT_PROTOCOL_GUID);
+
+#ifndef GUID_VARIABLE_DEFINITION
+#pragma pack (1)
+
+typedef struct _EFI_LEGACY_BIOS_EXT_PROTOCOL EFI_LEGACY_BIOS_EXT_PROTOCOL;
+
+//****************************************************************************
+// Embedded Legacy ROM ID definitions
+//****************************************************************************
+#define CSM16_VENDORID 0
+#define CSM16_DEVICEID 0
+#define CSM16_AHCI_RT_DID 1
+#define CSM16_USB_RT_DID 2
+#define CSM16_PNP_RT_DID 3
+#define CSM16_SD_BOOT_DID 4
+
+//****************************************************************************
+// OEM Module ID definitions. Note: use CSM16_VENDORID and CSM16_DEVICEID as
+// vendor/device ID for these modules.
+//****************************************************************************
+#define CSM16_MODULEID 1
+#define SERVICEROM_MODULEID 2
+#define OEM_MODULEID 3
+
+#define OPROM_MODULEID 0x20
+#define OPROM_MULTIPLE_MODULEID (0xa0 << 8)
+
+//****************************************************************************
+// CSM16 API equates
+//****************************************************************************
+#define CSM16_OEM_HW_RESET 1
+#define CSM16_OEM_NMI 2
+#define CSM16_SMBIOS_PNP 3
+#define CSM16_OEM_AFTER_SWSMI 4
+#define CSM16_OEM_BEFORE_SWSMI 5
+#define CSM16_OEM_ON_BOOT_FAIL 6
+#define CSM16_CSP_AHCI_ACCESSHBA 7
+#define CSM16_OEM_BEFORE_CALL_BOOT_VECTOR 8
+#define CSM16_OEM_PROBE_KBC 9
+#define CSM16_OEM_VIRUS_WARNING 10
+#define CSM16_OEM_SERIAL_ACCESS 11
+#define CSM16_OEM_BEFORE_CALL_INT19 12
+#define CSM16_OEM_TRY_NEXT_BOOT 14
+
+#define MAX_OEM16_FUNC_NUM 14
+
+typedef struct{
+ UINT16 ModuleId, VendorId, DeviceId;
+ UINT32 Size;
+} OPROM_HEADER;
+
+typedef struct {
+ UINT16 ModuleId;
+ UINT16 VendorId;
+ UINT16 DeviceId;
+} PARTIAL_OPROM_HEADER;
+
+
+typedef EFI_STATUS (EFIAPI *EFI_AMICSM_GET_EMBEDDED_ROM) (
+ IN UINT16 ModuleId,
+ IN UINT16 VendorId,
+ IN UINT16 DeviceId,
+ OUT VOID **ImageStart,
+ OUT UINTN *ImageSize
+);
+
+typedef EFI_STATUS (EFIAPI *EFI_AMICSM_GET_BBS_TABLE) (
+ IN OUT BBS_TABLE **BbsTable,
+ IN OUT UINT8 *BbsCount
+);
+
+typedef EFI_STATUS (EFIAPI *EFI_AMICSM_ADD_BBS_ENTRY) (
+ IN BBS_TABLE *BbsEntry
+);
+
+typedef EFI_STATUS (EFIAPI *EFI_AMICSM_INSERT_BBS_ENTRY_AT) (
+ IN EFI_LEGACY_BIOS_EXT_PROTOCOL *This,
+ IN OUT BBS_TABLE *BbsEntry,
+ IN OUT UINT8 *EntryNumber
+);
+
+typedef EFI_STATUS (EFIAPI *EFI_AMICSM_REMOVE_BBS_ENTRY_AT) (
+ IN EFI_LEGACY_BIOS_EXT_PROTOCOL *This,
+ IN UINT8 EntryNumber
+);
+
+typedef EFI_STATUS (EFIAPI *EFI_AMICSM_ALLOCATE_EBDA) (
+ IN EFI_LEGACY_BIOS_EXT_PROTOCOL *This,
+ IN UINT8 RequestedSizeKB,
+ OUT UINT32 *NewEbdaAddress,
+ OUT UINT32 *EbdaStartOffset
+);
+
+typedef EFI_STATUS (EFIAPI *EFI_AMICSM_UNLOCK_SHADOW) (
+ IN UINT8 *Address,
+ IN UINTN Size,
+ OUT UINT32 *LockUnlockAddr,
+ OUT UINT32 *LockUnlockSize
+);
+
+typedef EFI_STATUS (EFIAPI *EFI_AMICSM_LOCK_SHADOW) (
+ IN UINT32 LockAddr,
+ IN UINT32 LockSize
+);
+
+typedef struct _LEGACY16_TO_EFI_DATA_TABLE_STRUC {
+ UINT32 MiscInfoAddress; // 32-bit address of misc_info variable
+ UINT32 RtCmosByteAddress; // 32-bit address of rt_cmos_byte variable
+ UINT32 SmiFlashTableAddress; // 32-bit address of RUN_CSEG:smiflash_table variable
+ UINT16 CdrBevOffset;
+ UINT16 CDROMSupportAPIOfs;
+ UINT16 AddedPnpFunctionsOfs;
+ UINT16 BaidRmdVectorCntOfs;
+ UINT16 ReverseThunkPtrOfs;
+ UINT16 ReverseThunkStackPtrOfs;
+ UINT16 Compatibility16TableOfs;
+ UINT16 SmbiosTableOfs;
+ UINT16 StartOfFreeE000Ofs;
+ UINT16 ReadjustHddPrioritiesOfs;
+ UINT16 BootBufferPtrOfs;
+} LEGACY16_TO_EFI_DATA_TABLE_STRUC;
+
+typedef EFI_STATUS (*EFI_AMICSM_GET_16BIT_FUNC_ADDRESS)(UINT16 id, UINT32 *Addr);
+
+typedef UINTN (*EFI_AMICSM_COPY_LEGACY_TABLE)(
+ IN VOID *Table,
+ IN UINT16 TableSize,
+ IN UINT16 Alignment,
+ IN UINT16 Csm16LocationAttribute
+);
+
+typedef EFI_STATUS (*EFI_AMICSM_INSTALL_ISA_ROM)(
+ IN EFI_LEGACY_BIOS_EXT_PROTOCOL *This,
+ IN UINTN RomAddress
+);
+
+typedef EFI_STATUS (*EFI_AMICSM_GET_SHADOWRAM_ADDRESS)(
+ IN OUT UINT32 *AddrMin,
+ IN UINT32 AddrMax,
+ IN UINT32 Size,
+ IN UINT32 Alignment
+);
+
+//---------------------------------//
+// CSM16_CONFIGURATION definitions //
+//---------------------------------//-------------------------------------
+typedef enum {
+ Csm16FeatureGet,
+ Csm16FeatureSet,
+ Csm16FeatureReset
+} CSM16_CONFIGURATION_ACTION;
+
+typedef enum {
+ Csm16HeadlessI19Retry,
+ Csm16I13MbrWriteProtect,
+ Csm16LegacyFree,
+ Csm16ZipHddEmulation,
+ Csm16NoUsbBoot,
+ Csm16I19Trap,
+ Csm16Flexboot,
+ Csm16GA20,
+ Csm16SkipGA20Deactivation,
+ Csm16Nmi,
+ Csm16CpuRealModeOnBoot,
+ Csm16PS2,
+ Csm16LegacyToEfi,
+ Csm16LegacyToEfiPonr,
+ Csm16FeatureMax
+} CSM16_FEATURE;
+
+typedef EFI_STATUS (*EFI_AMICSM16_CONFIGURATION) (
+ IN CSM16_CONFIGURATION_ACTION ConfigAction,
+ IN CSM16_FEATURE Param,
+ OUT OPTIONAL UINT32 *Data
+);
+
+//<AMI_SHDR_START>
+//----------------------------------------------------------------------------
+// Name: EFI_LEGACY_BIOS_EXT_PROTOCOL
+//
+// Description: Extends LegacyBios protocol with the AMI implementation specific
+// CSM funcitons and data.
+//
+//----------------------------------------------------------------------------
+//<AMI_SHDR_END>
+
+typedef struct _EFI_LEGACY_BIOS_EXT_PROTOCOL {
+ EFI_AMICSM_GET_EMBEDDED_ROM GetEmbeddedRom;
+ EFI_AMICSM_ADD_BBS_ENTRY AddBbsEntry;
+ EFI_AMICSM_INSERT_BBS_ENTRY_AT InsertBbsEntryAt;
+ EFI_AMICSM_REMOVE_BBS_ENTRY_AT RemoveBbsEntryAt;
+ EFI_AMICSM_ALLOCATE_EBDA AllocateEbda;
+ EFI_AMICSM_UNLOCK_SHADOW UnlockShadow;
+ EFI_AMICSM_LOCK_SHADOW LockShadow;
+ EFI_AMICSM_GET_16BIT_FUNC_ADDRESS Get16BitFuncAddress;
+ EFI_AMICSM_COPY_LEGACY_TABLE CopyLegacyTable;
+ EFI_AMICSM_INSTALL_ISA_ROM InstallIsaRom;
+ EFI_AMICSM_GET_SHADOWRAM_ADDRESS GetShadowRamAddress;
+ EFI_AMICSM_GET_BBS_TABLE GetBbsTable;
+ EFI_AMICSM16_CONFIGURATION Csm16Configuration;
+} EFI_LEGACY_BIOS_EXT_PROTOCOL;
+
+// PCI Interrupt installation protocol
+
+#define EFI_PCIIRQ_PGM_PROTOCOL_GUID \
+ { 0x9400d59b, 0xe9c, 0x4f6c, 0xb5, 0x9a, 0xfc, 0x20, 0x0, 0x9d, 0xb9, 0xec };
+
+typedef struct {
+ VOID *PciIo;
+ UINT8 Irq;
+} PROGRAMMED_PCIIRQ_CTX;
+
+#define EFI_AMI_LEGACYBOOT_PROTOCOL_GUID \
+ {0x120d28aa, 0x6630, 0x46f0, 0x81, 0x57, 0xc0, 0xad, 0xc2, 0x38, 0x3b, 0xf5};
+
+VOID SignalAmiLegacyBootEvent(VOID);
+
+// CLP support related definitions
+
+// The following PCIR data structure is the extended version of PCI_DATA_STRUCTURE
+// from PCI.H. It can be removed once PCI header file is generically updated.
+typedef struct {
+ UINT32 Signature;
+ UINT16 VendorId;
+ UINT16 DeviceId;
+ UINT16 Reserved0;
+ UINT16 Length;
+ UINT8 Revision;
+ UINT8 ClassCode[3];
+ UINT16 ImageLength;
+ UINT16 CodeRevision;
+ UINT8 CodeType;
+ UINT8 Indicator;
+ UINT16 MaxRtImageLength;
+ UINT16 CfgUtilPointer;
+ UINT16 ClpEntryPoint;
+} PCI_PCIR30_DATA_STRUCTURE;
+
+#define EFI_CLP_PROTOCOL_GUID \
+ {0xcbbee336, 0x2682, 0x4cd6, 0x81, 0x8b, 0xa, 0xd, 0x96, 0x7e, 0x5a, 0x67};
+
+typedef struct _EFI_CLP_PROTOCOL EFI_CLP_PROTOCOL;
+
+typedef EFI_STATUS (*EFI_CLP_EXECUTE) (
+ IN EFI_CLP_PROTOCOL *This,
+ IN UINT8 *CmdInputLine,
+ IN UINT8 *CmdResponseBuffer,
+ OUT UINT32 *CmdStatus
+);
+
+typedef struct _EFI_CLP_PROTOCOL {
+ EFI_HANDLE Handle;
+ UINT16 EntrySeg;
+ UINT16 EntryOfs;
+ EFI_CLP_EXECUTE Execute;
+} EFI_CLP_PROTOCOL;
+
+#pragma pack ()
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#endif // #ifndef GUID_VARIABLE_DEFINITION
+#ifdef __cplusplus
+}
+#endif
+#endif
+
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2010, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Pkwy, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
diff --git a/Include/Protocol/LegacyBiosPlatform.h b/Include/Protocol/LegacyBiosPlatform.h
new file mode 100644
index 0000000..0d07a90
--- /dev/null
+++ b/Include/Protocol/LegacyBiosPlatform.h
@@ -0,0 +1,560 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2010, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Pkwy, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/SOURCE/Modules/CSM/Generic/Protocol/LegacyBiosPlatform.h 15 4/24/12 6:41p Olegi $
+//
+// $Revision: 15 $
+//
+// $Date: 4/24/12 6:41p $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/SOURCE/Modules/CSM/Generic/Protocol/LegacyBiosPlatform.h $
+//
+// 15 4/24/12 6:41p Olegi
+// [TAG] EIP86770
+// [Category] Improvement
+// [Description] Added EfiGetBcvSkipDeviceList to
+// EFI_GET_PLATFORM_INFO_MODE structure.
+//
+// 14 1/12/10 11:51a Olegi
+// Copyright message updated.
+//
+// 13 12/02/09 9:57a Olegi
+// Extended the parameters of GetPlatformInfo with
+// EfiGetPlatformNmiInformation.
+//
+// 12 12/09/08 3:33p Olegi
+//
+// 11 12/04/08 5:57p Olegi
+//
+// 10 11/12/08 5:02p Olegi
+//
+// 9 4/27/07 5:49p Olegi
+//
+// 8 4/27/07 5:17p Olegi
+// CSM.CHM file preparation.
+//
+// 7 3/13/06 2:43p Felixp
+//
+//**********************************************************************
+//<AMI_FHDR_START>
+//
+// Name: LegacyBiosPlatform.h
+//
+// Description: LegacyBiosPlatform protocol declaration
+//
+//<AMI_FHDR_END>
+//**********************************************************************
+#ifndef __LEGACY_BIOS_PLATFORM_PROTOCOL_H__
+#define __LEGACY_BIOS_PLATFORM_PROTOCOL_H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define EFI_LEGACY_BIOS_PLATFORM_PROTOCOL_GUID \
+ { 0x783658a3, 0x4172, 0x4421, 0xa2, 0x99, 0xe0, 0x9, 0x7, 0x9c, 0xc, 0xb4 }
+
+GUID_VARIABLE_DECLARATION(gEfiLegacyBiosPlatformProtocolGuid,EFI_LEGACY_BIOS_PLATFORM_PROTOCOL_GUID);
+
+#ifndef GUID_VARIABLE_DEFINITION
+#include <Protocol/DevicePath.h>
+#pragma pack(1)
+
+typedef struct _EFI_LEGACY_BIOS_PLATFORM_PROTOCOL EFI_LEGACY_BIOS_PLATFORM_PROTOCOL;
+
+//<AMI_PHDR_START>
+//----------------------------------------------------------------------------
+// Name: EFI_LEGACY_BIOS_PLATFORM_PREPARE_TO_BOOT
+//
+// Description: Prepares the attempt to boot a traditional OS.
+//
+// Input:
+// This Indicates the EFI_LEGACY_BIOS_PLATFORM_PROTOCOL instance.
+// BbsDevicePath EFI Device Path from BootXXXX variable.
+// BbsTable A list of BBS entries of type BBS_TABLE.
+// LoadOptionsSize Size of LoadOption in bytes.
+// LoadOptions LoadOption from BootXXXX variable.
+// EfiToLegacyBootTable Pointer to EFI_TO_COMPATIBILITY16_BOOT_TABLE.
+//
+// Output:
+// EFI_SUCCESS Ready to boot.
+//
+//----------------------------------------------------------------------------
+//<AMI_PHDR_END>
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_LEGACY_BIOS_PLATFORM_PREPARE_TO_BOOT) (
+ IN EFI_LEGACY_BIOS_PLATFORM_PROTOCOL *This,
+ IN BBS_BBS_DEVICE_PATH *BbsDevicePath,
+ IN VOID *BbsTable,
+ IN UINT32 LoadOptionsSize,
+ IN VOID *LoadOptions,
+ IN VOID *EfiToLegacyBootTable
+ );
+
+//<AMI_PHDR_START>
+//----------------------------------------------------------------------------
+// Name: EFI_LEGACY_BIOS_PLATFORM_TRANSLATE_PIRQ
+//
+// Description: This function translates the given PIRQ back through all
+// buses, if required, and returns the true PIRQ and associated IRQ.
+// Input:
+// This Indicates the EFI_LEGACY_BIOS_PLATFORM_PROTOCOL instance.
+// PciBus PCI bus number for this device.
+// PciDevice PCI device number for this device.
+// PciFunction PCI function number for this device.
+// Pirq The PIRQ. PIRQ A = 0, PIRQ B = 1, and so on.
+// PirqIrq IRQ assigned to the indicated PIRQ.
+//
+// Output:
+// EFI_SUCCESS The PIRQ was translated.
+//----------------------------------------------------------------------------
+//<AMI_PHDR_END>
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_LEGACY_BIOS_PLATFORM_TRANSLATE_PIRQ) (
+ IN EFI_LEGACY_BIOS_PLATFORM_PROTOCOL *This,
+ IN UINTN PciBus,
+ IN UINTN PciDevice,
+ IN UINTN PciFunction,
+ IN OUT UINT8 *Pirq,
+ OUT UINT8 *PciIrq
+ );
+
+
+//<AMI_SHDR_START>
+//----------------------------------------------------------------------------
+// Name: EFI_LEGACY_PIRQ_ENTRY
+//
+// Description: EFI_LEGACY_BIOS_PLATFORM_GET_ROUTING_TABLE related definition
+//
+// Fields:
+// Pirq UINT8 If nonzero, a value assigned by the IBV.
+// IrqMask UINT16 If nonzero, the IRQs that can be assigned to this device.
+//
+//----------------------------------------------------------------------------
+//<AMI_SHDR_END>
+
+typedef struct {
+ UINT8 Pirq;
+ UINT16 IrqMask;
+} EFI_LEGACY_PIRQ_ENTRY;
+
+
+//<AMI_SHDR_START>
+//----------------------------------------------------------------------------
+// Name: EFI_LEGACY_IRQ_ROUTING_ENTRY
+//
+// Description: EFI_LEGACY_BIOS_PLATFORM_GET_ROUTING_TABLE related definition
+//
+// Fields:
+// Bus UINT8 PCI bus of the entry.
+// Device UINT8 PCI device of this entry.
+// PirqEntry EFI_LEGACY_PIRQ_ENTRY An IBV value and IRQ mask for PIRQ pins A through D.
+// Slot UINT8 If nonzero, the slot number assigned by the board manufacturer.
+// Reserved UINT8 Reserved for future use.
+//
+// Referrals: EFI_LEGACY_PIRQ_ENTRY
+//----------------------------------------------------------------------------
+//<AMI_SHDR_END>
+typedef struct {
+ UINT8 Bus;
+ UINT8 Device;
+ EFI_LEGACY_PIRQ_ENTRY PirqEntry[4];
+ UINT8 Slot;
+ UINT8 Reserved;
+} EFI_LEGACY_IRQ_ROUTING_ENTRY;
+
+
+//<AMI_SHDR_START>
+//----------------------------------------------------------------------------
+// Name: EFI_LEGACY_PIRQ_TABLE_HEADER
+//
+// Description: EFI_LEGACY_BIOS_PLATFORM_GET_ROUTING_TABLE related definition
+//
+// Fields:
+// Signature UINT32 "$PIR".
+// MinorVersion UINT8 0x00.
+// MajorVersion UINT8 0x01 for table version 1.0.
+// TableSize UINT16 0x20 + RoutingTableEntries * 0x10.
+// Bus UINT8 PCI interrupt router bus.
+// DevFunc UINT8 PCI interrupt router device/function.
+// PciOnlyIrq UINT16 If nonzero, bit map of IRQs reserved for PCI.
+// CompatibleVid UINT16 Vendor ID of a compatible PCI interrupt router.
+// CompatibleDid UINT16 Device ID of a compatible PCI interrupt router.
+// Minport UINT32 If nonzero, a value passed directly to the IRQ miniport's Initialize function.
+// Reserved UINT8[11] Reserved for future usage.
+// Checksum UINT8 This byte plus the sum of all other bytes in the LocalPirqTable equal 0x00.
+//----------------------------------------------------------------------------
+//<AMI_SHDR_END>
+
+typedef struct {
+ UINT32 Signature;
+ UINT8 MinorVersion;
+ UINT8 MajorVersion;
+ UINT16 TableSize;
+ UINT8 Bus;
+ UINT8 DevFun;
+ UINT16 PciOnlyIrq;
+ UINT16 CompatibleVid;
+ UINT16 CompatibleDid;
+ UINT32 Miniport;
+ UINT8 Reserved[11];
+ UINT8 Checksum;
+} EFI_LEGACY_PIRQ_TABLE_HEADER;
+
+
+//<AMI_SHDR_START>
+//----------------------------------------------------------------------------
+// Name: EFI_LEGACY_IRQ_PRIORITY_TABLE_ENTRY
+//
+// Description: EFI_LEGACY_BIOS_PLATFORM_GET_ROUTING_TABLE related definition
+//
+// Fields:
+// Irq UINT8 IRQ for this entry.
+// Used UINT8 Status of this IRQ
+//
+// Notes: The field Used data definitions below:
+// PCI_UNUSED 0x00 - This IRQ has not been assigned to PCI.
+// PCI_USED 0xFF - This IRQ has been assigned to PCI.
+// LEGACY_USED 0xFE - This IRQ has been used by an SIO legacy device and
+// cannot be used by PCI.
+//----------------------------------------------------------------------------
+//<AMI_SHDR_END>
+
+typedef struct {
+ UINT8 Irq;
+ UINT8 Used;
+} EFI_LEGACY_IRQ_PRIORITY_TABLE_ENTRY;
+
+
+//<AMI_PHDR_START>
+//----------------------------------------------------------------------------
+// Name: EFI_LEGACY_BIOS_PLATFORM_GET_ROUTING_TABLE
+//
+// Description: Returns information associated with PCI IRQ routing.
+//
+// Input:
+// This Indicates the EFI_LEGACY_BIOS_PLATFORM_PROTOCOL instance.
+//
+// RoutingTable Pointer to the PCI IRQ routing table. This location is the $PIR table
+// minus the header. The contents are described by the PCI IRQ Routing Table
+// Specification and consist of RoutingTableEntries of EFI_LEGACY_IRQ_ROUTING_ENTRY.
+//
+// RoutingTableEntries Number of entries in the PCI IRQ routing table.
+//
+// LocalPirqTable $PIR table. It consists of EFI_LEGACY_PIRQ_TABLE_HEADER,
+// immediately followed by RoutingTable.
+//
+// PirqTableSize Size of $PIR table.
+//
+// LocalIrqPriorityTable A priority table of IRQs to assign to PCI. This table
+// consists of IrqPriorityTableEntries of EFI_LEGACY_IRQ_PRIORITY_TABLE_ENTRY
+// and is used to prioritize the allocation of IRQs to PCI.
+//
+// IrqPriorityTableEntries Number of entries in the priority table.
+//
+// Output:
+// EFI_SUCCESS Data was returned successfully.
+//
+// Referrals:
+// EFI_LEGACY_BIOS_PLATFORM_PROTOCOL, EFI_LEGACY_IRQ_ROUTING_ENTRY,
+// EFI_LEGACY_PIRQ_TABLE_HEADER, EFI_LEGACY_IRQ_PRIORITY_TABLE_ENTRY
+//
+//----------------------------------------------------------------------------
+//<AMI_PHDR_END>
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_LEGACY_BIOS_PLATFORM_GET_ROUTING_TABLE) (
+ IN EFI_LEGACY_BIOS_PLATFORM_PROTOCOL *This,
+ OUT VOID **RoutingTable,
+ OUT UINTN *RoutingTableEntries,
+ OUT VOID **LocalPirqTable, OPTIONAL
+ OUT UINTN *PirqTableSize, OPTIONAL
+ OUT VOID **LocalIrqPriorityTable, OPTIONAL
+ OUT UINTN *IrqPriorityTableEntries OPTIONAL
+ );
+
+
+//<AMI_SHDR_START>
+//----------------------------------------------------------------------------
+// Name: EFI_GET_PLATFORM_HOOK_MODE
+//
+// Description: Mode definitions for EFI_LEGACY_BIOS_PLATFORM_HOOKS
+//
+//----------------------------------------------------------------------------
+//<AMI_SHDR_END>
+
+typedef enum {
+ EfiPlatformHookPrepareToScanRom = 0,
+ EfiPlatformHookShadowServiceRoms = 1,
+ EfiPlatformHookAfterRomInit = 2
+} EFI_GET_PLATFORM_HOOK_MODE;
+
+
+//<AMI_PHDR_START>
+//----------------------------------------------------------------------------
+// Name: EFI_LEGACY_BIOS_PLATFORM_HOOKS
+//
+// Description: Allows platform to perform any required action after a LegacyBios
+// operation.
+// Input:
+// DeviceHandle List of PCI devices in the system.
+// ShadowAddress First free OpROM area, after other OpROMs have been dispatched.
+// Compatibility16Table Pointer to the Compatibility16 Table.
+// AdditionalData Pointer to additional data returned - mode specific.
+//
+// Output:
+// EFI_SUCCESS The operation performed successfully.
+// EFI_UNSUPPORTED Mode is not supported on this platform.
+// EFI_SUCCESS Mode specific.
+//
+//----------------------------------------------------------------------------
+//<AMI_PHDR_END>
+struct _EFI_COMPATIBILITY16_TABLE;
+typedef
+EFI_STATUS
+(EFIAPI *EFI_LEGACY_BIOS_PLATFORM_HOOKS) (
+ IN EFI_LEGACY_BIOS_PLATFORM_PROTOCOL *This,
+ IN EFI_GET_PLATFORM_HOOK_MODE Mode,
+ IN UINT16 Type,
+ IN EFI_HANDLE OPTIONAL DeviceHandle,
+ IN OUT UINTN OPTIONAL *ShadowAddress,
+ IN struct _EFI_COMPATIBILITY16_TABLE *Compatibility16Table,
+ OUT VOID OPTIONAL **AdditionalData
+ );
+
+
+//<AMI_PHDR_START>
+//----------------------------------------------------------------------------
+// Name: EFI_LEGACY_BIOS_PLATFORM_SMM_INIT
+//
+// Description: Loads and registers the Compatibility16 handler with the EFI SMM code.
+//
+// Input:
+// This Indicates the EFI_LEGACY_BIOS_PLATFORM_PROTOCOL instance.
+// EfiToCompatibility16BootTable The boot table passed to the Compatibility16.
+//
+// Output:
+// EFI_SUCCESS The SMM code loaded.
+// EFI_DEVICE_ERROR The SMM code failed to load.
+//
+//----------------------------------------------------------------------------
+//<AMI_PHDR_END>
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_LEGACY_BIOS_PLATFORM_SMM_INIT) (
+ IN EFI_LEGACY_BIOS_PLATFORM_PROTOCOL *This,
+ IN VOID *EfiToCompatibility16BootTable
+ );
+
+
+//<AMI_SHDR_START>
+//----------------------------------------------------------------------------
+// Name: EFI_GET_PLATFORM_HANDLE_MODE
+//
+// Description: Mode definitions for EFI_LEGACY_BIOS_PLATFORM_GET_PLATFORM_HANDLE
+//
+//----------------------------------------------------------------------------
+//<AMI_SHDR_END>
+
+typedef enum {
+ EfiGetPlatformVgaHandle = 0,
+ EfiGetPlatformIdeHandle = 1,
+ EfiGetPlatformIsaBusHandle = 2,
+ EfiGetPlatformUsbHandle = 3
+} EFI_GET_PLATFORM_HANDLE_MODE;
+
+
+//<AMI_PHDR_START>
+//----------------------------------------------------------------------------
+// Name: EFI_LEGACY_BIOS_PLATFORM_GET_PLATFORM_HANDLE
+//
+// Description: Returns a buffer of handles for the requested subfunction.
+//
+// Input:
+// This Indicates the EFI_LEGACY_BIOS_PLATFORM_PROTOCOL instance.
+// Mode Specifies what handle to return.
+// GetVgaHandle
+// GetIdeHandle
+// GetIsaBusHandle
+// GetUsbHandle
+// Type Handle Modifier - Mode specific
+// HandleBuffer Pointer to buffer containing all Handles matching the specified criteria.
+// Handles are sorted in priority order. Type EFI_HANDLE is defined in
+// InstallProtocolInterface() in the EFI 1.10 Specification.
+// HandleCount Number of handles in HandleBuffer.
+// AdditionalData Pointer to additional data returned - mode specific..
+//
+// Output:
+// EFI_SUCCESS The handle is valid.
+// EFI_UNSUPPORTED Mode is not supported on this platform.
+// EFI_NOT_FOUND The handle is not known.
+//
+//----------------------------------------------------------------------------
+//<AMI_PHDR_END>
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_LEGACY_BIOS_PLATFORM_GET_PLATFORM_HANDLE) (
+ IN EFI_LEGACY_BIOS_PLATFORM_PROTOCOL *This,
+ IN EFI_GET_PLATFORM_HANDLE_MODE Mode,
+ IN UINT16 Type,
+ OUT EFI_HANDLE **HandleBuffer,
+ OUT UINTN *HandleCount,
+ OUT VOID OPTIONAL **AdditionalData
+ );
+
+
+//<AMI_SHDR_START>
+//----------------------------------------------------------------------------
+// Name: EFI_GET_PLATFORM_INFO_MODE
+//
+// Description: Mode definitions for EFI_LEGACY_BIOS_PLATFORM_GET_PLATFORM_INFO
+//
+//----------------------------------------------------------------------------
+//<AMI_SHDR_END>
+typedef enum {
+ EfiGetPlatformBinaryMpTable = 0,
+ EfiGetPlatformBinaryOemIntData = 1,
+ EfiGetPlatformBinaryOem16Data = 2,
+ EfiGetPlatformBinaryOem32Data = 3,
+ EfiGetPlatformBinaryTpmBinary = 4,
+ EfiGetPlatformBinarySystemRom = 5,
+ EfiGetPlatformPciExpressBase = 6,
+ EfiGetPlatformPmmSize = 7,
+ EfiGetPlatformEndRomShadowAddr = 8,
+ EfiGetPlatformOpromVideoMode = 9,
+ EfiGetPlatformIntSaveRestoreTable = 10,
+ EfiGetPlatformPciIrqMask = 11,
+ EfiGetPlatformGateA20Information = 12,
+ EfiGetPlatformNmiInformation = 13,
+ EfiGetBcvSkipDeviceList = 14,
+} EFI_GET_PLATFORM_INFO_MODE;
+
+
+//<AMI_PHDR_START>
+//----------------------------------------------------------------------------
+// Name: EFI_LEGACY_BIOS_PLATFORM_GET_PLATFORM_INFO
+//
+// Description: Finds the binary data or other platform information.
+// Refer to the subfunctions for additional information.
+//
+// Input:
+// This Indicates the EFI_LEGACY_BIOS_PLATFORM_PROTOCOL instance.
+// Mode Specifies what data to return:
+// GetMpTable
+// GetOemIntData
+// GetOem16Data
+// GetOem32Data
+// GetTpmBinary
+// GetSystemRom
+// GetPciExpressBase
+// GetPmmSize
+// GetPlatformEndRomShadowAddr
+// EfiGetOpromVideoSwitchingMode
+// EfiGetInterruptSaveRestoreTable
+//
+// Table Pointer to OEM legacy 16-bit code or data.
+// TableSize Size of data.
+// Location Location to place table. 0x00 - Either 0xE0000 or 0xF0000 64 KB blocks.
+// Bit 0 = 1 0xF0000 64 KB block.
+// Bit 1 = 1 0xE0000 64 KB block.
+// Note: Multiple bits can be set.
+// Alignment Bit-mapped address alignment granularity. The first nonzero bit from the
+// right is the address granularity.
+// LegacySegment Segment where EfiCompatibility code will place the table or data.
+// LegacyOffset Offset where EfiCompatibility code will place the table or data.
+//
+// Output:
+// EFI_SUCCESS The data was returned successfully.
+// EFI_UNSUPPORTED Mode is not supported on this platform.
+// EFI_NOT_FOUND Binary image not found.
+//
+// Referrals: EFI_GET_PLATFORM_INFO_MODE
+//
+//----------------------------------------------------------------------------
+//<AMI_PHDR_END>
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_LEGACY_BIOS_PLATFORM_GET_PLATFORM_INFO) (
+ IN EFI_LEGACY_BIOS_PLATFORM_PROTOCOL *This,
+ IN EFI_GET_PLATFORM_INFO_MODE Mode,
+ IN OUT VOID **Table,
+ IN OUT UINTN *TableSize,
+ IN OUT UINTN *Location,
+ OUT UINTN *Alignment,
+ IN UINT16 LegacySegment,
+ IN UINT16 LegacyOffset
+ );
+
+
+//<AMI_SHDR_START>
+//----------------------------------------------------------------------------
+// Name: EFI_LEGACY_BIOS_PLATFORM_PROTOCOL
+//
+// Description: The EFI_LEGACY_BIOS_PLATFORM_PROTOCOL is used to abstract the
+// platform-specific traditional hardware and or policy decisions
+// from the generic EfiCompatibility code.
+// Fields:
+// GetPlatformInfo EFI_LEGACY_BIOS_PLATFORM_GET_PLATFORM_INFO Gets binary data or other platform information.
+// GetPlatformHandle EFI_LEGACY_BIOS_PLATFORM_GET_PLATFORM_HANDLE Returns a buffer of all handles matching the requested subfunction.
+// SmmInit EFI_LEGACY_BIOS_PLATFORM_SMM_INIT Loads and initializes the traditional BIOS SMM handler.
+// PlatformHooks EFI_LEGACY_BIOS_PLATFORM_HOOKS Allows platform to perform any required actions after a LegacyBios operation.
+// GetRoutingTable EFI_LEGACY_BIOS_PLATFORM_GET_ROUTING_TABLE Gets $PIR table.
+// TranslatePirq EFI_LEGACY_BIOS_PLATFORM_TRANSLATE_PIRQ Translates the given PIRQ to the final value after traversing any PCI bridges.
+// PrepareToBoot EFI_LEGACY_BIOS_PLATFORM_PREPARE_TO_BOOT Final platform function before the system attempts to boot to a traditional OS.
+//
+//----------------------------------------------------------------------------
+//<AMI_SHDR_END>
+
+typedef struct _EFI_LEGACY_BIOS_PLATFORM_PROTOCOL {
+ EFI_LEGACY_BIOS_PLATFORM_GET_PLATFORM_INFO GetPlatformInfo;
+ EFI_LEGACY_BIOS_PLATFORM_GET_PLATFORM_HANDLE GetPlatformHandle;
+ EFI_LEGACY_BIOS_PLATFORM_SMM_INIT SmmInit;
+ EFI_LEGACY_BIOS_PLATFORM_HOOKS PlatformHooks;
+ EFI_LEGACY_BIOS_PLATFORM_GET_ROUTING_TABLE GetRoutingTable;
+ EFI_LEGACY_BIOS_PLATFORM_TRANSLATE_PIRQ TranslatePirq;
+ EFI_LEGACY_BIOS_PLATFORM_PREPARE_TO_BOOT PrepareToBoot;
+} EFI_LEGACY_BIOS_PLATFORM_PROTOCOL;
+
+#pragma pack()
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#endif // #ifndef GUID_VARIABLE_DEFINITION
+#ifdef __cplusplus
+}
+#endif
+#endif
+
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2010, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Pkwy, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
diff --git a/Include/Protocol/LegacyInterrupt.h b/Include/Protocol/LegacyInterrupt.h
new file mode 100644
index 0000000..adec21f
--- /dev/null
+++ b/Include/Protocol/LegacyInterrupt.h
@@ -0,0 +1,119 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2010, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Pkwy, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/SOURCE/Modules/CSM/Generic/protocol/LegacyInterrupt.h 5 1/12/10 11:51a Olegi $
+//
+// $Revision: 5 $
+//
+// $Date: 1/12/10 11:51a $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/SOURCE/Modules/CSM/Generic/protocol/LegacyInterrupt.h $
+//
+// 5 1/12/10 11:51a Olegi
+// Copyright message updated.
+//
+// 4 4/27/07 5:17p Olegi
+// CSM.CHM file preparation.
+//
+// 3 3/13/06 2:43p Felixp
+//
+// 2 1/18/05 3:22p Felixp
+// PrintDebugMessage renamed to Trace
+//
+// 1 10/26/04 9:48a Olegi
+//
+// 2 8/24/04 3:56p Markw
+// Fixed ifndef in *.h file.
+//
+// 1 8/24/04 3:55p Markw
+//
+//**********************************************************************
+//<AMI_FHDR_START>
+//
+// Name: LegacyInterrupt.h
+//
+// Description: Legacy Interrupt driver header file
+//
+//<AMI_FHDR_END>
+//**********************************************************************
+#ifndef __LEGACY_INTERRUPT_PROTOCOL_H__
+#define __LEGACY_INTERRUPT_PROTOCOL_H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+#include <EFI.h>
+
+// { 31CE593D-108A-485D-ADB2-78F21F2966BE }
+#define EFI_LEGACY_INTERRUPT_PROTOCOL_GUID \
+ {0x31ce593d,0x108a,0x485d,0xad,0xb2,0x78,0xf2,0x1f,0x29,0x66,0xbe}
+
+GUID_VARIABLE_DECLARATION(gEfiLegacyInterruptProtocolGuid,EFI_LEGACY_INTERRUPT_PROTOCOL_GUID);
+
+typedef struct _EFI_LEGACY_INTERRUPT_PROTOCOL EFI_LEGACY_INTERRUPT_PROTOCOL;
+
+typedef EFI_STATUS (EFIAPI *EFI_LEGACY_INTERRUPT_GET_NUMBER_PIRQS) (
+ IN EFI_LEGACY_INTERRUPT_PROTOCOL *This,
+ OUT UINT8 *NumberPirqs
+);
+
+typedef EFI_STATUS (EFIAPI *EFI_LEGACY_INTERRUPT_GET_LOCATION) (
+ IN EFI_LEGACY_INTERRUPT_PROTOCOL *This,
+ OUT UINT8 *Bus,
+ OUT UINT8 *Device,
+ OUT UINT8 *Function
+);
+
+typedef EFI_STATUS (EFIAPI *EFI_LEGACY_INTERRUPT_READ_PIRQ) (
+ IN EFI_LEGACY_INTERRUPT_PROTOCOL *This,
+ IN UINT8 PirqNumber,
+ OUT UINT8 *PirqData
+);
+
+typedef EFI_STATUS (EFIAPI *EFI_LEGACY_INTERRUPT_WRITE_PIRQ) (
+ IN EFI_LEGACY_INTERRUPT_PROTOCOL *This,
+ IN UINT8 PirqNumber,
+ IN UINT8 PirqData
+);
+
+
+typedef struct _EFI_LEGACY_INTERRUPT_PROTOCOL {
+ EFI_LEGACY_INTERRUPT_GET_NUMBER_PIRQS GetNumberPirqs;
+ EFI_LEGACY_INTERRUPT_GET_LOCATION GetLocation;
+ EFI_LEGACY_INTERRUPT_READ_PIRQ ReadPirq;
+ EFI_LEGACY_INTERRUPT_WRITE_PIRQ WritePirq;
+} EFI_LEGACY_INTERRUPT_PROTOCOL;
+
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2010, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Pkwy, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
diff --git a/Include/Protocol/LegacyRegion.h b/Include/Protocol/LegacyRegion.h
new file mode 100644
index 0000000..43f2ad0
--- /dev/null
+++ b/Include/Protocol/LegacyRegion.h
@@ -0,0 +1,129 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2010, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Pkwy, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/BIN/Chipset/Intel/NorthBridge/Haswell/Intel SystemAgent NB Chipset/LegacyRegion/LegacyRegion Protocols/LegacyRegion.h 1 4/02/13 6:28a Ireneyang $
+//
+// $Revision: 1 $
+//
+// $Date: 4/02/13 6:28a $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Chipset/Intel/NorthBridge/Haswell/Intel SystemAgent NB Chipset/LegacyRegion/LegacyRegion Protocols/LegacyRegion.h $
+//
+// 1 4/02/13 6:28a Ireneyang
+//
+// 1 12/20/12 12:40p Olegi
+//
+// 5 1/12/10 11:51a Olegi
+// Copyright message updated.
+//
+// 4 4/27/07 5:17p Olegi
+// CSM.CHM file preparation.
+//
+// 3 3/13/06 2:43p Felixp
+//
+// 2 1/18/05 3:22p Felixp
+// PrintDebugMessage renamed to Trace
+//
+// 1 10/26/04 9:48a Olegi
+//
+// 1 8/30/04 3:13p Markw
+//
+// 2 8/24/04 3:56p Markw
+// Fixed ifndef in *.h file.
+//
+// 1 8/24/04 3:55p Markw
+//
+//**********************************************************************
+//<AMI_FHDR_START>
+//
+// Name: LegacyRegion.h
+//
+// Description: LegacyRegion protocol API declaration
+//
+//<AMI_FHDR_END>
+//**********************************************************************
+#ifndef __LEGACY_REGION_PROTOCOL_H__
+#define __LEGACY_REGION_PROTOCOL_H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+#include <EFI.h>
+
+//{0FC9013A-0568-4BA9-9B7E-C9C390A6609B}
+#define EFI_LEGACY_REGION_PROTOCOL_GUID \
+ {0xfc9013a,0x568,0x4ba9,0x9b,0x7e,0xc9,0xc3,0x90,0xa6,0x60,0x9b}
+
+GUID_VARIABLE_DECLARATION(gEfiLegacyRegionProtocolGuid,EFI_LEGACY_REGION_PROTOCOL_GUID);
+
+typedef struct _EFI_LEGACY_REGION_PROTOCOL EFI_LEGACY_REGION_PROTOCOL;
+
+typedef EFI_STATUS (EFIAPI *EFI_LEGACY_REGION_DECODE) (
+ IN EFI_LEGACY_REGION_PROTOCOL *This,
+ IN UINT32 Start,
+ IN UINT32 Length,
+ IN BOOLEAN *On
+);
+
+typedef EFI_STATUS (EFIAPI *EFI_LEGACY_REGION_LOCK) (
+ IN EFI_LEGACY_REGION_PROTOCOL *This,
+ IN UINT32 Start,
+ IN UINT32 Length,
+ OUT UINT32 *Granularity OPTIONAL
+);
+
+typedef EFI_STATUS (EFIAPI *EFI_LEGACY_REGION_BOOT_LOCK) (
+ IN EFI_LEGACY_REGION_PROTOCOL *This,
+ IN UINT32 Start,
+ IN UINT32 Length,
+ OUT UINT32 *Granularity OPTIONAL
+);
+
+typedef EFI_STATUS (EFIAPI *EFI_LEGACY_REGION_UNLOCK) (
+ IN EFI_LEGACY_REGION_PROTOCOL *This,
+ IN UINT32 Start,
+ IN UINT32 Length,
+ OUT UINT32 *Granularity OPTIONAL
+);
+
+
+struct _EFI_LEGACY_REGION_PROTOCOL {
+ EFI_LEGACY_REGION_DECODE Decode;
+ EFI_LEGACY_REGION_LOCK Lock;
+ EFI_LEGACY_REGION_BOOT_LOCK BootLock;
+ EFI_LEGACY_REGION_UNLOCK UnLock;
+};
+
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2010, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Pkwy, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
diff --git a/Include/Protocol/LegacyRegion2.h b/Include/Protocol/LegacyRegion2.h
new file mode 100644
index 0000000..17ee599
--- /dev/null
+++ b/Include/Protocol/LegacyRegion2.h
@@ -0,0 +1,148 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Pkwy, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/BIN/Chipset/Intel/NorthBridge/Haswell/Intel SystemAgent NB Chipset/LegacyRegion/LegacyRegion Protocols/LegacyRegion2.h 1 4/02/13 6:28a Ireneyang $
+//
+// $Revision: 1 $
+//
+// $Date: 4/02/13 6:28a $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Chipset/Intel/NorthBridge/Haswell/Intel SystemAgent NB Chipset/LegacyRegion/LegacyRegion Protocols/LegacyRegion2.h $
+//
+// 1 4/02/13 6:28a Ireneyang
+//
+// 1 12/20/12 12:40p Olegi
+//
+// 2 5/24/11 2:04p Olegi
+// Header/footer updated.
+//
+// 6 1/13/10 2:13p Felixp
+//
+//**********************************************************************
+//<AMI_FHDR_START>
+//
+// Name: LegacyRegion2.h
+//
+// Description: LegacyRegion2 protocol definition (PI 1.2, Volume 5)
+//
+//<AMI_FHDR_END>
+//**********************************************************************
+#ifndef __LEGACY_REGION2_PROTOCOL_H__
+#define __LEGACY_REGION2_PROTOCOL_H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <Efi.h>
+
+#define EFI_LEGACY_REGION2_PROTOCOL_GUID \
+ { 0x70101eaf, 0x85, 0x440c, 0xb3, 0x56, 0x8e, 0xe3, 0x6f, 0xef, 0x24, 0xf0 }
+
+GUID_VARIABLE_DECLARATION(gEfiLegacyRegion2ProtocolGuid,EFI_LEGACY_REGION2_PROTOCOL_GUID);
+
+typedef struct _EFI_LEGACY_REGION2_PROTOCOL EFI_LEGACY_REGION2_PROTOCOL;
+
+typedef EFI_STATUS (EFIAPI *EFI_LEGACY_REGION2_DECODE)(
+ IN EFI_LEGACY_REGION2_PROTOCOL *This,
+ IN UINT32 Start,
+ IN UINT32 Length,
+ OUT UINT32 *Granularity,
+ IN BOOLEAN *On
+);
+
+typedef EFI_STATUS (EFIAPI *EFI_LEGACY_REGION2_LOCK)(
+ IN EFI_LEGACY_REGION2_PROTOCOL *This,
+ IN UINT32 Start,
+ IN UINT32 Length,
+ OUT UINT32 *Granularity
+);
+
+typedef EFI_STATUS (EFIAPI *EFI_LEGACY_REGION2_BOOT_LOCK)(
+ IN EFI_LEGACY_REGION2_PROTOCOL *This,
+ IN UINT32 Start,
+ IN UINT32 Length,
+ OUT UINT32 *Granularity OPTIONAL
+);
+
+typedef EFI_STATUS (EFIAPI *EFI_LEGACY_REGION2_UNLOCK)(
+ IN EFI_LEGACY_REGION2_PROTOCOL *This,
+ IN UINT32 Start,
+ IN UINT32 Length,
+ OUT UINT32 *Granularity
+);
+
+typedef enum {
+ LegacyRegionDecoded, ///< This region is currently set to allow reads.
+ LegacyRegionNotDecoded, ///< This region is currently set to not allow reads.
+ LegacyRegionWriteEnabled, ///< This region is currently set to allow writes.
+ LegacyRegionWriteDisabled, ///< This region is currently set to write protected.
+ LegacyRegionBootLocked, ///< This region's attributes are locked, cannot be modified until
+ ///< after a power cycle.
+ LegacyRegionNotLocked ///< This region's attributes are not locked.
+} EFI_LEGACY_REGION_ATTRIBUTE;
+
+typedef struct {
+ /// The beginning of the physical address of this
+ /// region.
+ UINT32 Start;
+ /// The number of bytes in this region.
+ UINT32 Length;
+ /// Attribute of the Legacy Region Descriptor that
+ /// describes the capabilities for that memory region.
+ EFI_LEGACY_REGION_ATTRIBUTE Attribute;
+ /// Describes the byte length programmability
+ /// associated with the Start address and the specified
+ /// Attribute setting.
+ UINT32 Granularity;
+} EFI_LEGACY_REGION_DESCRIPTOR;
+
+typedef EFI_STATUS (EFIAPI *EFI_LEGACY_REGION_GET_INFO)(
+ IN EFI_LEGACY_REGION2_PROTOCOL *This,
+ OUT UINT32 *DescriptorCount,
+ OUT EFI_LEGACY_REGION_DESCRIPTOR **Descriptor
+);
+
+/// The EFI_LEGACY_REGION2_PROTOCOL is used to abstract the hardware control of the memory
+/// attributes of the Option ROM shadowing region, 0xC0000 to 0xFFFFF.
+/// There are three memory attributes that can be modified through this protocol: read, write and
+/// boot-lock. These protocols may be set in any combination.
+struct _EFI_LEGACY_REGION2_PROTOCOL {
+ EFI_LEGACY_REGION2_DECODE Decode;
+ EFI_LEGACY_REGION2_LOCK Lock;
+ EFI_LEGACY_REGION2_BOOT_LOCK BootLock;
+ EFI_LEGACY_REGION2_UNLOCK UnLock;
+ EFI_LEGACY_REGION_GET_INFO GetInfo;
+};
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
diff --git a/Include/Protocol/LegacyRegionProtocols.cif b/Include/Protocol/LegacyRegionProtocols.cif
new file mode 100644
index 0000000..ede35cc
--- /dev/null
+++ b/Include/Protocol/LegacyRegionProtocols.cif
@@ -0,0 +1,10 @@
+<component>
+ name = "LegacyRegion Protocols"
+ category = ModulePart
+ LocalRoot = "Include\Protocol"
+ RefName = "LEGACY_REGION_PROTOCOLS"
+
+[files]
+"LegacyRegion.h"
+"LegacyRegion2.h"
+<endComponent>
diff --git a/Include/Protocol/LegacySredir.h b/Include/Protocol/LegacySredir.h
new file mode 100644
index 0000000..28b06c5
--- /dev/null
+++ b/Include/Protocol/LegacySredir.h
@@ -0,0 +1,361 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2013, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Pkwy, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+//**********************************************************************
+// $Header: /Alaska/SOURCE/Modules/Legacy Serial Redirection/LegacySredir.h 22 11/18/14 5:30a Anandakrishnanl $
+//
+// $Revision: 22 $
+//
+// $Date: 11/18/14 5:30a $
+//**********************************************************************
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/SOURCE/Modules/Legacy Serial Redirection/LegacySredir.h $
+//
+// 22 11/18/14 5:30a Anandakrishnanl
+// [TAG] EIP192802
+// [Category] Improvement
+// [Description] Support for legacy redirection by UART polling is added
+// for platforms in which serial port does not support IRQ on PIC Mode.
+// [Files] LegacySredir.c,LegacySredir.h,LegacySredir.sdl
+//
+// 21 12/10/13 7:13a Divyac
+// [TAG] EIP146597
+// [Category] Bug Fix
+// [Severity] Important
+// [Symptom] Build Error in Legacy Serial Redirection for label
+// 4.5.5_LegacySredir_37
+// [RootCause] Modules Which were consuming EFI_LEGACY_SREDIR_PROTOCOL
+// had been throwing error, since the Protocol header file LegacySredir.h
+// has been updated.
+// [Solution] Added #define Macros for backward Compatibility
+// [Files] LegacySredir.h
+//
+// 20 12/09/13 5:21a Divyac
+// [TAG] EIP129549
+// [Category] Improvement
+// [Description] Serial Redirection has dependency on Amilegacy16.bin
+// [Files] LegacySredir.c, LegacySredir.h, OR_MOD.EQU, SREDIR.ASM
+//
+// 19 12/09/13 4:51a Divyac
+// [TAG] EIP146051
+// [Category] Improvement
+// [Description] Refresh Key needs to be configured via SDL token for
+// Legacy Serial Redirection.
+// [Files] LegacySredir.c, LegacySredir_Setup.C, LegacySredir.h,
+// Sredir.bin
+//
+// 18 2/29/12 11:39p Rameshr
+// [TAG] EIP82480
+// [Category] Bug Fix
+// [Severity] Important
+// [Symptom] System does not boot to Legacy Devices when Launch Video
+// OpRom DISABLED
+// [RootCause] Temp buffer address is not correct
+// [Solution] Redirection uses the 0x9F000 are temp buffer to save the
+// Video data. It should have been calculated in runtime based on the Base
+// memory allocated for sredir.bin
+// [Files] Legacysredir.c, LegacySredir.h
+//
+// 17 2/27/12 6:05a Jittenkumarp
+// [TAG] EIP81401
+// [Category] New Feature
+// [Description] Select Redirection After BIOS POST as BootLoader in
+// serial redirection, the behaviour is made same as Core8.
+// [Files] LegacySredir.c, LegacySredir.mak, LegacySredir.sdl,
+// LegacySredir_Setup.c, LegacySredir.h ,SerialBootCall.asm,
+// SredirBootFail.asm,GRAPHREDIR.ASM, INT10REDIR.ASM, OR_MOD.EQU,
+// SREDIR.ASM,LegacySredir.cif
+//
+// 16 12/28/11 10:56p Rajeshms
+// [TAG] EIP65051
+// [Category] Improvement
+// [Description] Data passing between EFI to Legacy has been changed in
+// Legacy console redirection as we are running out of registers to pass
+// parameters from EFI to Legacy.
+// [Files] LegacySredir.c, LegacySredir.h, LegacySredir_Setup.C,
+// SREDIR.ASM, OR_MOD.ASM, OR_MOD.EQU
+//
+// 15 11/09/11 11:53p Rajeshms
+// [TAG]- EIP 63665
+// [Category]-IMPROVEMENT
+// [Description]- Install Linux(Legacy OS) through remote. Some Linux
+// versions are forced to text mode to redirect and some are redirected in
+// graphics mode itself. It might not work for all the Linux versions as
+// the Linux kernel's behave differently.
+// [Files]- Terminal.sdl, Terminal.uni, Terminal.sd, LegacySredir.c,
+// LegacySredir.h, LegacySredir_Setup.c, GRAPHREDIR.ASM, INT10REDIR.ASM,
+// OR_MOD.ASM, OR_MOD.EQU, SREDIR.ASM
+//
+// 14 8/16/11 4:46p Davidd
+// [TAG] EIP55337
+// [Category] New Feature
+// [Description] Add optional code to clear keyboard buffer at
+// ReadyToBoot in Legacy Serial Redirection driver
+// [Files] LegacySredir.c
+// LegacySredir.h
+// LegacySredir.sdl
+// Sredir.asm
+//
+// 13 7/13/11 2:40a Rajeshms
+// [TAG]- EIP 36444
+// [Category]- New Feature
+// [Description]- Add Setup option for Various Putty keyPad support in
+// Legacy console redirection driver
+// [Files]- LegacySredir.c, LegacySredir.h, LegacySredir_Setup.C,
+// SREDIR.ASM, KEYREDIR.ASM, OR_MOD.EQU, SREDIR.MAK
+//
+// 12 6/14/11 5:38a Rameshr
+// [TAG]- EIP 58140
+// [Category]- New Feature
+// [Description]- Add Setup option for Vt-UTF8 combo key support in Legacy
+// console redirection driver
+// [Files]- Sredir.asm, Legacysredir.c, Legacysredir.h,
+// Legacysredir_setup.c
+//
+// 11 5/03/10 1:22a Rameshr
+// Issue:Need to handle different Base Hz values for SerialStatusCode,
+// Terminal, and Legacy Serial Redirection.
+// Solution: Moved Uart input clock into Core.sdl token and used in all
+// the above modules.
+// EIP: 37332
+//
+// 10 4/13/10 4:15a Rameshr
+// Recorder Mode support added
+// EIP 36514
+// Some of the MMIO COM port has non standard bits implemented. These bits
+// are reset to 0 in Sredir.bin
+// EIP 37123
+//
+// 9 3/05/10 4:43a Rameshr
+//
+// 8 3/05/10 4:38a Rameshr
+// MMIO COM device support added.
+// EIP 33847
+//
+// 7 3/05/10 1:33a Rameshr
+// Sredir.bin Version added
+//
+// 6 10/23/09 10:47a Yul
+// EIP 24167 and EIP 26405
+// Serial redirection selection of 80X24 or 80X25 implemented based on
+// setup question instead of BUILD token
+//
+// 5 6/29/09 12:12p Rameshr
+// Coding Standard and File header updated.
+//
+// 4 4/21/09 2:09p Rameshr
+// Build problem Resolved
+//
+// 3 4/21/09 12:16p Rameshr
+// Updated the Legacy console redirection to get the Databits,Parity and
+// Stop bits from the Terminal Driver Setup option
+// EIP20874-Legacy serial redirection is using hra coded values for
+// Databits as 8, Parity as None and Stop bit as 1
+//
+// 2 4/17/07 4:43a Rameshraju
+// PCIserial support added
+//
+//**********************************************************************
+
+//<AMI_FHDR_START>
+//****************************************************************************
+//
+// Name: LegacySreDir.h
+//
+// Description: Legacy console redirection Protocol header file
+//****************************************************************************
+//<AMI_FHDR_END>
+
+#ifndef __LEGACY_SREDIR_PROTOCOL_H__
+#define __LEGACY_SREDIR_PROTOCOL_H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <EFI.h>
+
+#define AMI_LEGACY_SREDIR_PROTOCOL_GUID \
+ { 0xA062CF1F, 0x8473, 0x4aa3, 0x87, 0x93, 0x60, 0x0B, 0xC4, 0xFF, 0xA9, 0xA9 }
+
+#define EFI_LEGACY_SREDIR_PROTOCOL_GUID AMI_LEGACY_SREDIR_PROTOCOL_GUID
+
+#ifndef GUID_VARIABLE_DECLARATION
+#define GUID_VARIABLE_DECLARATION(Variable, Guid) extern EFI_GUID Variable
+#endif
+
+GUID_VARIABLE_DECLARATION( gAmiLegacySredirProtocolGuid, AMI_LEGACY_SREDIR_PROTOCOL_GUID);
+#define gEfiLegacySredirProtocolGuid gAmiLegacySredirProtocolGuid
+
+#ifndef GUID_VARIABLE_DEFINITION
+typedef struct _AMI_LEGACY_SREDIR_PROTOCOL AMI_LEGACY_SREDIR_PROTOCOL;
+
+#define SREDIR_VENDORID 0x7
+#define SREDIR_DEVICEID 0x9
+#define SREDIR_MODULEID 0x3
+
+//<AMI_SHDR_START>
+//----------------------------------------------------------------------------
+// Name: AMI_LEGACYSREDIR_TABLE
+//
+// Desription: There is a table located within the traditional BIOS.It is located on a 16-byte
+// boundary and provides the physical address of the entry point for the Legacy Redirection
+// functions. These functions provide the platform-specific information that is
+// required by the generic EfiCompatibility code. The functions are invoked via
+// thunking by using EFI_LEGACY_BIOS_PROTOCOL.FarCall86() with the 32-bit physical
+// entry point defined below.
+//
+//----------------------------------------------------------------------------
+//<AMI_SHDR_END>
+#pragma pack(1)
+typedef struct _AMI_LEGACYSREDIR_TABLE {
+ UINT32 Signature;
+ UINT8 Version;
+ UINT8 TableChecksum;
+ UINT8 TableLength;
+ UINT16 SreDirSegment;
+ UINT16 SreDirOffset;
+ UINT16 SreDirEfiToLegacyOffset;
+} AMI_LEGACYSREDIR_TABLE;
+#pragma pack()
+
+//<AMI_SHDR_START>
+//----------------------------------------------------------------------------
+// Name: AMI_LEGACYSREDIR_FUNCTIONS
+//
+// Description: This structure consists of functions which are used for Leagcy Redirection
+//
+// Fields:
+//
+// LEGACY_SreDirInitializeSerialPort : Initialises the Serial Port
+// LEGACY_SerialRedirection : Starts the Legacy Serial Redirection by hooking the required interrupts
+// LEGACY_ReleaseSerialRedirection : Stops the Legacy Serial Redirection by Releasing the corresponding interrupts
+// LEGACY_InvalidFunction_FAR : Invalid function
+//
+//----------------------------------------------------------------------------
+//<AMI_SHDR_END>
+
+typedef enum {
+ LEGACY_SreDirInitializeSerialPort, // 0000,
+ LEGACY_SerialRedirection, // 0001,
+ LEGACY_ReleaseSerialRedirection, // 0002,
+ LEGACY_GetInterruptAddress, // 0003,
+ LEGACY_ClearKbCharBuffer, // 0004,
+ LEGACY_InvalidFunction_FAR, // 0005
+} AMI_LEGACYSREDIR_FUNCTIONS;
+
+//<AMI_SHDR_START>
+//----------------------------------------------------------------------------
+// Name: AMI_COM_PARAMETERS
+//
+// Description: This structure consists of Com parameters and setup values
+// which are used to transfer the data from EFI to Legacy for
+// Legacy Redirection.
+//
+//
+// Notes: Don't Change this structure,as the same structure is defined in
+// CSM16 Serial Redirection.
+//----------------------------------------------------------------------------
+//<AMI_SHDR_END>
+#pragma pack(1)
+typedef struct _AMI_COM_PARAMETERS {
+ UINT32 SdlParameters;
+ UINT16 BaseAddress;
+ UINT32 MMIOBaseAddress;
+ UINT8 SerialIRQ;
+ UINT32 Baudrate;
+ UINT8 TerminalType;
+ UINT8 FlowControl;
+ UINT8 DataParityStop;
+ UINT8 LegacyOsResolution;
+ UINT8 RecorderMode;
+ UINT8 VtUtf8;
+ UINT8 PuttyKeyPad;
+ UINT8 SwSMIValue;
+ UINT8 InstallLegacyOSthroughRemote;
+ UINT16 SredirBinSize;
+
+ UINT8 RedirectionAfterBiosPost;
+ UINT8 Flag; //This is not a setup variable rather than used as
+ // a flag to start or stop Serial Redirection
+ UINT8 RefreshScreenKey;
+ UINT8 SwSMIPort; // Sw SMI port Address
+ UINT8 UartPollingRedirection;
+} AMI_COM_PARAMETERS;
+#pragma pack()
+
+
+//<AMI_PHDR_START>
+//----------------------------------------------------------------------------
+// Name: LEGACY_SREDIR_ENABLE
+//
+// Description: Enable the Legacy Serial Redirection
+//
+// Input:
+// This Legacy Serial Redirection Protocol address
+//
+// Output:
+// EFI_SUCCESS Redirection Enabled
+// EFI_NOT_FOUND Redirection Not enabled
+//----------------------------------------------------------------------------
+//<AMI_PHDR_END>
+typedef EFI_STATUS (EFIAPI *LEGACY_SREDIR_ENABLE) (
+ IN AMI_LEGACY_SREDIR_PROTOCOL *This
+);
+
+//<AMI_PHDR_START>
+//----------------------------------------------------------------------------
+// Name: LEGACY_SREDIR_DISABLE
+//
+// Description: Disable the Legacy Serial Redirection
+//
+// Input:
+// This Legacy Serial Redirection Protocol address
+//
+// Output:
+// EFI_SUCCESS Redirection Disabled
+// EFI_NOT_FOUND Redirection Not disabled
+//----------------------------------------------------------------------------
+//<AMI_PHDR_END>
+typedef EFI_STATUS (EFIAPI *LEGACY_SREDIR_DISABLE) (
+ IN AMI_LEGACY_SREDIR_PROTOCOL *This
+);
+
+typedef struct _AMI_LEGACY_SREDIR_PROTOCOL {
+ LEGACY_SREDIR_ENABLE EnableLegacySredir;
+ LEGACY_SREDIR_DISABLE DisableLegacySredir;
+} AMI_LEGACY_SREDIR_PROTOCOL;
+
+#define EFI_LEGACY_SREDIR_PROTOCOL AMI_LEGACY_SREDIR_PROTOCOL
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#endif // #ifndef GUID_VARIABLE_DEFINITION
+#ifdef __cplusplus
+}
+#endif
+#endif
+
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2013, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Pkwy, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
diff --git a/Include/Protocol/LegacySredirProtocol.cif b/Include/Protocol/LegacySredirProtocol.cif
new file mode 100644
index 0000000..940bf45
--- /dev/null
+++ b/Include/Protocol/LegacySredirProtocol.cif
@@ -0,0 +1,8 @@
+<component>
+ name = "Legacy Sredir Protocol"
+ category = ModulePart
+ LocalRoot = "Include\Protocol\"
+ RefName = "LEGACY_SREDIR_PROTOCOL"
+[files]
+"\LegacySredir.h"
+<endComponent>
diff --git a/Include/Protocol/LoadFile.h b/Include/Protocol/LoadFile.h
new file mode 100644
index 0000000..8337515
--- /dev/null
+++ b/Include/Protocol/LoadFile.h
@@ -0,0 +1,90 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2005, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/BIN/Core/Include/Protocol/LoadFile.h 4 3/13/06 1:40a Felixp $
+//
+// $Revision: 4 $
+//
+// $Date: 3/13/06 1:40a $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Core/Include/Protocol/LoadFile.h $
+//
+// 4 3/13/06 1:40a Felixp
+//
+// 3 6/17/05 5:56p Felixp
+//
+// 2 3/04/05 10:35a Mandal
+//
+// 1 1/28/05 12:44p Felixp
+//
+// 2 1/18/05 3:22p Felixp
+// PrintDebugMessage renamed to Trace
+//
+// 1 12/23/04 9:41a Felixp
+//
+// 1 3/19/04 1:14p Felixp
+//
+//**********************************************************************
+//<AMI_FHDR_START>
+//
+// Name: LoadFile.h
+//
+// Description: LOAD_FILE protocol definition
+//
+//<AMI_FHDR_END>
+//**********************************************************************
+#ifndef __LOAD_FILE_PROTOCOL_H__
+#define __LOAD_FILE_PROTOCOL_H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+#include <EFI.h>
+
+#define EFI_LOAD_FILE_PROTOCOL_GUID \
+ {0x56EC3091,0x954C,0x11d2,0x8E,0x3F,0x00,0xA0,0xC9,0x69,0x72,0x3B}
+
+GUID_VARIABLE_DECLARATION(gEfiLoadFileProtocolGuid, EFI_LOAD_FILE_PROTOCOL_GUID);
+
+typedef struct _EFI_LOAD_FILE_PROTOCOL EFI_LOAD_FILE_PROTOCOL;
+
+typedef EFI_STATUS (EFIAPI *EFI_LOAD_FILE) (
+ IN EFI_LOAD_FILE_PROTOCOL *This, IN EFI_DEVICE_PATH_PROTOCOL *FilePath,
+ IN BOOLEAN BootPolicy, IN OUT UINTN *BufferSize,
+ IN VOID *Buffer OPTIONAL
+);
+
+struct _EFI_LOAD_FILE_PROTOCOL{
+ EFI_LOAD_FILE LoadFile;
+};
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2005, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
diff --git a/Include/Protocol/LoadFile2.h b/Include/Protocol/LoadFile2.h
new file mode 100644
index 0000000..80289e6
--- /dev/null
+++ b/Include/Protocol/LoadFile2.h
@@ -0,0 +1,86 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2009, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/BIN/Core/Include/Protocol/LoadFile2.h 2 4/19/11 10:53a Yakovlevs $
+//
+// $Revision: 2 $
+//
+// $Date: 4/19/11 10:53a $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Core/Include/Protocol/LoadFile2.h $
+//
+// 2 4/19/11 10:53a Yakovlevs
+// [TAG] EIP 57664
+// [Category] New Feature
+// [Description] Aptio PI 1.2; UEFI 2.3.1 Support Extended PCI bus
+// driver functionality
+// [Files] DevicePath.h; LoadFile2.h; PciBus.h; PciBus.c.
+//
+// 1 11/19/09 12:53p Felixp
+//
+//**********************************************************************
+//<AMI_FHDR_START>
+//
+// Name: LoadFile2.h
+//
+// Description: Load File 2 Protocol Definition
+//
+//<AMI_FHDR_END>
+//**********************************************************************
+#ifndef __LOAD_FILE2_PROTOCOL_H__
+#define __LOAD_FILE2_PROTOCOL_H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+#include <EFI.h>
+
+#define EFI_LOAD_FILE2_PROTOCOL_GUID \
+ {0x4006c0c1,0xfcb3,0x403e,0x99, 0x6d, 0x4a, 0x6c, 0x87, 0x24, 0xe0, 0x6d}
+
+GUID_VARIABLE_DECLARATION(gEfiLoadFile2ProtocolGuid, EFI_LOAD_FILE2_PROTOCOL_GUID);
+
+typedef struct _EFI_LOAD_FILE2_PROTOCOL EFI_LOAD_FILE2_PROTOCOL;
+
+typedef EFI_STATUS (EFIAPI *EFI_LOAD_FILE2) (
+ IN EFI_LOAD_FILE2_PROTOCOL *This,
+ IN EFI_DEVICE_PATH_PROTOCOL *FilePath,
+ IN BOOLEAN BootPolicy,
+ IN OUT UINTN *BufferSize,
+ IN VOID *Buffer OPTIONAL
+);
+
+struct _EFI_LOAD_FILE2_PROTOCOL{
+ EFI_LOAD_FILE2 LoadFile;
+};
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2009, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
diff --git a/Include/Protocol/LoadPe32Image.h b/Include/Protocol/LoadPe32Image.h
new file mode 100644
index 0000000..4efcf57
--- /dev/null
+++ b/Include/Protocol/LoadPe32Image.h
@@ -0,0 +1,95 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2005, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/BIN/Core/Include/Protocol/LoadPe32Image.h 2 3/13/06 1:40a Felixp $
+//
+// $Revision: 2 $
+//
+// $Date: 3/13/06 1:40a $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Core/Include/Protocol/LoadPe32Image.h $
+//
+// 2 3/13/06 1:40a Felixp
+//
+// 1 4/27/05 11:27a Felixp
+//
+//**********************************************************************
+//<AMI_FHDR_START>
+//
+// Name: LoadPe32Image.h
+//
+// Description: EFI_PE32_IMAGE_PROTOCOL protocol definition
+//
+//<AMI_FHDR_END>
+//**********************************************************************
+#ifndef __LOAD_PE32_IMAGE_PROTOCOL_H__
+#define __LOAD_PE32_IMAGE_PROTOCOL_H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+#include <EFI.h>
+
+#define PE32_IMAGE_PROTOCOL_GUID \
+ {0x5cb5c776,0x60d5,0x45ee,0x88,0x3c,0x45,0x27,0x8,0xcd,0x74,0x3f }
+
+GUID_VARIABLE_DECLARATION(gEfiLoadPeImageGuid, PE32_IMAGE_PROTOCOL_GUID);
+
+#define EFI_LOAD_PE_IMAGE_ATTRIBUTE_NONE 0x00
+#define EFI_LOAD_PE_IMAGE_ATTRIBUTE_RUNTIME_REGISTRATION 0x01
+#define EFI_LOAD_PE_IMAGE_ATTRIBUTE_DEBUG_IMAGE_INFO_TABLE_REGISTRATION 0x02
+
+typedef struct _EFI_PE32_IMAGE_PROTOCOL EFI_PE32_IMAGE_PROTOCOL;
+
+typedef EFI_STATUS (EFIAPI *LOAD_PE_IMAGE)(
+ IN EFI_PE32_IMAGE_PROTOCOL *This,
+ IN EFI_HANDLE ParentImageHandle,
+ IN EFI_DEVICE_PATH_PROTOCOL *FilePath,
+ IN VOID *SourceBuffer OPTIONAL, IN UINTN SourceSize,
+ IN EFI_PHYSICAL_ADDRESS DstBuffer OPTIONAL,
+ IN OUT UINTN *NumberOfPages OPTIONAL,
+ OUT EFI_HANDLE *ImageHandle,
+ OUT EFI_PHYSICAL_ADDRESS *EntryPoint OPTIONAL,
+ IN UINT32 Attribute
+);
+
+typedef EFI_STATUS (EFIAPI *UNLOAD_PE_IMAGE)(
+ IN EFI_PE32_IMAGE_PROTOCOL *This, IN EFI_HANDLE ImageHandle
+);
+
+struct _EFI_PE32_IMAGE_PROTOCOL {
+ LOAD_PE_IMAGE LoadPeImage;
+ UNLOAD_PE_IMAGE UnLoadPeImage;
+};
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2005, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//********************************************************************** \ No newline at end of file
diff --git a/Include/Protocol/LoadedImage.h b/Include/Protocol/LoadedImage.h
new file mode 100644
index 0000000..8a1b057
--- /dev/null
+++ b/Include/Protocol/LoadedImage.h
@@ -0,0 +1,153 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2005, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/BIN/Core/Include/Protocol/LoadedImage.h 5 11/08/10 6:15p Felixp $
+//
+// $Revision: 5 $
+//
+// $Date: 11/08/10 6:15p $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Core/Include/Protocol/LoadedImage.h $
+//
+// 5 11/08/10 6:15p Felixp
+// The Core source files are updated to remove upper ASCII characters
+// (above 128)
+// from the comment blocks. The characters caused build errors
+// with Japanese version of Microsoft compiler.
+//
+// 4 5/22/09 1:18p Felixp
+// Clean up
+//
+// 3 3/13/06 1:40a Felixp
+//
+// 2 3/04/05 10:35a Mandal
+//
+// 1 1/28/05 12:44p Felixp
+//
+// 2 1/18/05 3:22p Felixp
+// PrintDebugMessage renamed to Trace
+//
+// 1 12/23/04 9:41a Felixp
+//
+// 2 2/19/04 4:31p Felixp
+//
+// 1 2/16/04 5:11p Felixp
+//
+//**********************************************************************
+//<AMI_FHDR_START>
+//
+// Name: LoadedImage.h
+//
+// Description: EFI_LOADED_IMAGE_PROTOCOL Protocol Definition.
+//
+//<AMI_FHDR_END>
+//**********************************************************************
+#ifndef __LOADED_IMAGE_PROTOCOL_H__
+#define __LOADED_IMAGE_PROTOCOL_H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+#include <EFI.h>
+
+#define EFI_LOADED_IMAGE_PROTOCOL_GUID \
+ {0x5B1B31A1,0x9562,0x11d2,0x8E,0x3F,0x00,0xA0,0xC9,0x69,0x72,0x3B}
+
+GUID_VARIABLE_DECLARATION(gEfiLoadedImageProtocolGuid, EFI_LOADED_IMAGE_PROTOCOL_GUID);
+
+#define EFI_LOADED_IMAGE_PROTOCOL_REVISION 0x1000
+
+//**********************************************************************
+//<AMI_PHDR_START>
+//
+// Procedure: EFI_UNLOAD
+//
+// Description: Unloads an image from memory.
+//
+// Input:
+// IN EFI_HANDLE ImageHandle - The handle to the image to unload.
+//
+// Output: EFI_STATUS
+// Status Codes Returned
+// EFI_SUCCESS - The image was unloaded.
+// EFI_INVALID_PARAMETER - The ImageHandle was not valid.
+//
+//<AMI_PHDR_END>
+//**********************************************************************
+typedef EFI_STATUS (EFIAPI *EFI_UNLOAD) (
+ IN EFI_HANDLE ImageHandle
+);
+
+//**********************************************************************
+//<AMI_THDR_START>
+//
+// Name: EFI_LOADED_IMAGE_PROTOCOL
+//
+// Fields: Name Type Description
+// Revision UINT32 Defines the revision of the EFI_LOADED_IMAGE_PROTOCOL structure.
+// ParentHandle EFI_HANDLE Parent image's image handle. NULL if the image is loaded directly from the firmware's boot manager.
+// SystemTable EFI_SYSTEM_TABLE* The image's EFI system table pointer.
+// DeviceHandle EFI_HANDLE The device handle that the EFI Image was loaded from.
+// FilePath EFI_DEVICE_PATH_PROTOCOL* A pointer to the file path portion specific to DeviceHandle that the EFI Image was loaded from.
+// Reserved VOID* Reserved. DO NOT USE.
+// LoadOptionsSize UINT32 The size in bytes of LoadOptions.
+// LoadOptions VOID* A pointer to the image's binary load options.
+// ImageBase VOID* The base address at which the image was loaded.
+// ImageSize UINT64 The size in bytes of the loaded image.
+// ImageCodeType EFI_MEMORY_TYPE The Memory type that the code sections were loaded as.
+// ImageDataType EFI_MEMORY_TYPE The Memory type that the data sections were loaded as.
+// Unload EFI_IMAGE_UNLOAD Function that unloads the image.
+//
+// Description: EFI_LOADED_IMAGE_PROTOCOL protocol interface structure
+//
+//<AMI_THDR_END>
+//**********************************************************************
+typedef struct {
+ UINT32 Revision;
+ EFI_HANDLE ParentHandle;
+ EFI_SYSTEM_TABLE *SystemTable;
+ // Source location of the image
+ EFI_HANDLE DeviceHandle;
+ EFI_DEVICE_PATH_PROTOCOL *FilePath;
+ VOID *Reserved;
+ // Image's load options
+ UINT32 LoadOptionsSize;
+ VOID *LoadOptions;
+ // Location where image was loaded
+ VOID *ImageBase;
+ UINT64 ImageSize;
+ EFI_MEMORY_TYPE ImageCodeType;
+ EFI_MEMORY_TYPE ImageDataType;
+ EFI_UNLOAD Unload;
+} EFI_LOADED_IMAGE_PROTOCOL;
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2005, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
diff --git a/Include/Protocol/LoadedImageDevicePath.h b/Include/Protocol/LoadedImageDevicePath.h
new file mode 100644
index 0000000..f345685
--- /dev/null
+++ b/Include/Protocol/LoadedImageDevicePath.h
@@ -0,0 +1,71 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2009, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/BIN/Core/Include/Protocol/LoadedImageDevicePath.h 1 11/19/09 12:53p Felixp $
+//
+// $Revision: 1 $
+//
+// $Date: 11/19/09 12:53p $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Core/Include/Protocol/LoadedImageDevicePath.h $
+//
+// 1 11/19/09 12:53p Felixp
+//
+//**********************************************************************
+//<AMI_FHDR_START>
+//
+// Name: LoadedImageDevicePath.h
+//
+// Description: Loaded Image Device Path Protocol Definition
+//
+//<AMI_FHDR_END>
+//**********************************************************************
+#ifndef __LOADED_IMAGE_DEVICE_PATH_PROTOCOL__H__
+#define __LOADED_IMAGE_DEVICE_PATH_PROTOCOL__H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+#ifndef GUID_VARIABLE_DEFINITION
+#include <Protocol/DevicePath.h>
+#else
+#include <EFI.h>
+#endif
+
+#define EFI_LOADED_IMAGE_DEVICE_PATH_PROTOCOL_GUID \
+ { 0xbc62157e, 0x3e33, 0x4fec, 0x99, 0x20, 0x2d, 0x3b, 0x36, 0xd7, 0x50, 0xdf }
+
+GUID_VARIABLE_DECLARATION(gEfiLoadedImageDevicePathProtocolGuid, EFI_LOADED_IMAGE_DEVICE_PATH_PROTOCOL_GUID);
+
+typedef EFI_DEVICE_PATH_PROTOCOL EFI_LOADED_IMAGE_DEVICE_PATH_PROTOCOL;
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2009, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
diff --git a/Include/Protocol/MXMProtocol.cif b/Include/Protocol/MXMProtocol.cif
new file mode 100644
index 0000000..9a4b019
--- /dev/null
+++ b/Include/Protocol/MXMProtocol.cif
@@ -0,0 +1,9 @@
+<component>
+ name = "MXM Protocol"
+ category = ModulePart
+ LocalRoot = "Include\Protocol\"
+ RefName = "MXM_Protocol"
+[files]
+"Mxm30.h"
+"Nbci.h"
+<endComponent>
diff --git a/Include/Protocol/ManageShadowProtocol.h b/Include/Protocol/ManageShadowProtocol.h
new file mode 100644
index 0000000..9e17613
--- /dev/null
+++ b/Include/Protocol/ManageShadowProtocol.h
@@ -0,0 +1,131 @@
+//****************************************************************************
+//****************************************************************************
+//** **
+//** (C)Copyright 1985-2012, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Pkwy, Norcross, GA 30093 **
+//** **
+//** Phone (770)-246-8600 **
+//** **
+//****************************************************************************
+//****************************************************************************
+
+//****************************************************************************
+// $Header: /Alaska/SOURCE/Modules/RsdpPlus/Rsdp+ Includes/Protocol/ManageShadowProtocol.h 3 9/17/12 11:35p Norlwu $
+//
+// $Revision: 3 $
+//
+// $Date: 9/17/12 11:35p $
+//****************************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/SOURCE/Modules/RsdpPlus/Rsdp+ Includes/Protocol/ManageShadowProtocol.h $
+//
+// 3 9/17/12 11:35p Norlwu
+// [TAG] EIP92735
+// [Category] Improvement
+// [Description] Please help to return the pointer and offset of
+// HeapToF000 in MANAGE_SHADOW_RAM_PROTOCOL
+// [Files] RsdpPlus.c
+// ManageShadowRam.c
+// ManageShadowProtocol.h
+//
+// 2 8/17/12 8:14a Norlwu
+// [TAG] EIP98247
+// [Category] Improvement
+// [Description] [RsdpPlus]Add alignment support in
+// MANAGE_SHADOW_RAM_PROTOCOL
+// [Files] RsdpPlus.sdl
+// RsdpPlus.mak
+// RsdpPlus.c
+// ManageShadowRam.c
+// ManageShadowRam.h
+//
+// 1 2/09/12 3:17a Norlwu
+// [TAG] EIP81756
+// [Category] New Feature
+// [Description] Enhance RspdPlus module.
+// [Files] ManageShadowProtocol.h
+//****************************************************************************
+
+//<AMI_FHDR_START>
+//-----------------------------------------------------------------------------
+//
+// Name: ManageShadowProtocol.h
+//
+// Description:
+//
+//-----------------------------------------------------------------------------
+//<AMI_FHDR_END>
+
+#ifndef __MANAGE_SHADOW_PROTOCOL_H__
+#define __MANAGE_SHADOW_PROTOCOL_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define MANAGE_SHADOW_RAM_PROTOCOL_GUID \
+ {0x1fa319e, 0xc36c, 0x4f19, 0x9d, 0x9d, 0xd0, 0x29, 0xd, 0xbe, 0xe9, 0x28}
+
+typedef struct{
+ UINTN BuffAddress;
+ UINTN UsedLength;
+}DATA_BUFF_STRUC;
+
+typedef
+EFI_STATUS
+(EFIAPI *HEAP_TO_E000) (
+ UINT8 *pData,
+ UINT32 Align,
+ UINTN Length,
+ DATA_BUFF_STRUC *pData2
+);
+
+typedef
+EFI_STATUS
+(EFIAPI *HEAP_TO_F000) (
+ UINT8 *pData,
+ UINT32 Align,
+ UINTN Length,
+ DATA_BUFF_STRUC *pData2
+);
+
+typedef struct {
+ HEAP_TO_E000 HeapToE000;
+ HEAP_TO_F000 HeapToF000;
+} MANAGE_SHADOW_RAM_PROTOCOL;
+
+
+//elink struct type define
+typedef VOID (UPDATE_E000_SHDOW_RAM_HOOK)(
+ IN UINT32* pShadowRam,
+ IN UINTN Length
+);
+
+typedef VOID (UPDATE_F000_SHDOW_RAM_HOOK)(
+ IN UINT32* pShadowRam,
+ IN UINTN Length
+);
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+
+//****************************************************************************
+//****************************************************************************
+//** **
+//** (C)Copyright 1985-2012, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Pkwy, Norcross, GA 30093 **
+//** **
+//** Phone (770)-246-8600 **
+//** **
+//****************************************************************************
+//****************************************************************************
diff --git a/Include/Protocol/Metronome.h b/Include/Protocol/Metronome.h
new file mode 100644
index 0000000..7869fb5
--- /dev/null
+++ b/Include/Protocol/Metronome.h
@@ -0,0 +1,99 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2005, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+//**********************************************************************
+// $Header: /Alaska/BIN/Core/CORE_DXE/ArchProtocol/Metronome.h 2 3/13/06 1:45a Felixp $
+//
+// $Revision: 2 $
+//
+// $Date: 3/13/06 1:45a $
+//*****************************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Core/CORE_DXE/ArchProtocol/Metronome.h $
+//
+// 2 3/13/06 1:45a Felixp
+//
+// 1 1/28/05 12:44p Felixp
+//
+// 2 1/18/05 3:21p Felixp
+// PrintDebugMessage renamed to Trace
+//
+// 1 12/23/04 9:42a Felixp
+//
+// 1 12/23/04 9:29a Felixp
+//
+// 2 3/29/04 2:32a Felixp
+//
+// 1 12/31/03 11:05a Robert
+//
+//*****************************************************************************
+//<AMI_FHDR_START>
+//
+// Name: Metronome.h
+//
+// Description: This file is an include file used to define the Architectural
+// Protocol for the Legacy Metronome. For questions about the specification
+// refer to the DXE CIS
+//
+//<AMI_FHDR_END>
+//*****************************************************************************
+#ifndef __METRONOME_ARCH_PROTOCOL_H__
+#define __METRONOME_ARCH_PROTOCOL_H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+#include <EFI.h>
+
+// GUID for the Metronome Architectural Protocol
+#define EFI_METRONOME_ARCH_PROTOCOL_GUID \
+ { 0x26baccb2, 0x6f42, 0x11d4, 0xbc, 0xe7, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81 }
+
+GUID_VARIABLE_DECLARATION(gEfiMetronomeArchProtocolGuid, EFI_METRONOME_ARCH_PROTOCOL_GUID);
+
+// Declare forward reference for the Metronome Architectural Protocol
+typedef struct _EFI_METRONOME_ARCH_PROTOCOL EFI_METRONOME_ARCH_PROTOCOL;
+
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_METRONOME_WAIT_FOR_TICK) (
+ IN struct _EFI_METRONOME_ARCH_PROTOCOL *This,
+ IN UINT32 TickNumber
+ );
+
+
+// Architectural Protocol structure for Metronome
+typedef struct _EFI_METRONOME_ARCH_PROTOCOL {
+ EFI_METRONOME_WAIT_FOR_TICK WaitForTick;
+ UINT32 TickPeriod;
+} EFI_METRONOME_ARCH_PROTOCOL;
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2005, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
diff --git a/Include/Protocol/MonotonicCounter.h b/Include/Protocol/MonotonicCounter.h
new file mode 100644
index 0000000..98149a9
--- /dev/null
+++ b/Include/Protocol/MonotonicCounter.h
@@ -0,0 +1,78 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2005, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/BIN/Core/CORE_DXE/ArchProtocol/MonotonicCounter.h 3 3/13/06 1:45a Felixp $
+//
+// $Revision: 3 $
+//
+// $Date: 3/13/06 1:45a $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Core/CORE_DXE/ArchProtocol/MonotonicCounter.h $
+//
+// 3 3/13/06 1:45a Felixp
+//
+// 2 3/04/05 10:42a Mandal
+//
+// 1 1/28/05 12:44p Felixp
+//
+// 2 1/18/05 3:21p Felixp
+// PrintDebugMessage renamed to Trace
+//
+// 1 12/23/04 9:42a Felixp
+//
+// 1 12/23/04 9:29a Felixp
+//
+// 1 3/30/04 2:24a Felixp
+//
+//**********************************************************************
+//<AMI_FHDR_START>
+//
+// Name: MonotonicCounter.h
+//
+// Description: MonotonicCounter Architectural Protocol Definition
+//
+//<AMI_FHDR_END>
+//**********************************************************************
+#ifndef __MONOTONIC_COUNTER_ARCH_PROTOCOL_H__
+#define __MONOTONIC_COUNTER_ARCH_PROTOCOL_H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+#include <EFI.h>
+
+#define EFI_MONOTONIC_COUNTER_ARCH_PROTOCOL_GUID \
+ {0x1da97072,0xbddc,0x4b30,0x99,0xf1,0x72,0xa0,0xb5,0x6f,0xff,0x2a}
+
+GUID_VARIABLE_DECLARATION(gEfiMonotonicCounterArchProtocolGuid, EFI_MONOTONIC_COUNTER_ARCH_PROTOCOL_GUID);
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2005, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
diff --git a/Include/Protocol/MpService.h b/Include/Protocol/MpService.h
new file mode 100644
index 0000000..1d7aafd
--- /dev/null
+++ b/Include/Protocol/MpService.h
@@ -0,0 +1,436 @@
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/Projects/Intel/Haswell/LynxPoint_SharkBay-DT_Crb_1AQQW/Include/Protocol/MpService.h 1 10/25/12 8:54a Wesleychen $
+//
+// $Revision: 1 $
+//
+// $Date: 10/25/12 8:54a $
+//*****************************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/Projects/Intel/Haswell/LynxPoint_SharkBay-DT_Crb_1AQQW/Include/Protocol/MpService.h $
+//
+// 1 10/25/12 8:54a Wesleychen
+// EFI_MP_PROC_CONTEXT is copyied from Intel CPU RC.
+//
+// 5 11/12/11 6:46p Artems
+//
+// 5 9/09/11 4:47p Markw
+// [TAG] EIP64115
+// [Category] Spec Update
+// [Description] Always support Framework MP Services for binaries.
+// Support Framework MP Service header for Framework, and
+// support PI MP Service header for PI.
+//
+// [Files] Cpu.sdl, CpuMp.c, CpuDxe.h, CpuDxe.c, MpServices.h
+//
+// 4 7/13/11 3:39p Felixp
+// #if PI_SPECIFICATION_VERSION <= 0x0001000A is replaced with
+// #if PI_SPECIFICATION_VERSION < 0x0001000A
+// (equal sign is removed).
+//
+// 3 6/23/11 5:34p Felixp
+// Improved compatibility with existing CPU modules.
+// (PI definitions are disabled when NO_PI_MP_SERVICES_SUPPORT macro is
+// defined).
+//
+// 2 6/16/11 9:50a Felixp
+// Header is updated to include PI and Framework flavors of the protocol
+//
+// 3 8/03/09 4:04p Markw
+// Add GetProcessorContext update.
+//
+// 2 3/04/09 10:45a Markw
+// Update copyright header.
+//
+// 1 11/02/07 1:59p Markw
+//
+// 1 11/02/07 1:45p Markw
+//
+// 2 7/23/07 7:33p Markw
+// Make EFI_MP_SERVICES_PROTOCOL output parameters optional.
+//
+// 1 3/28/06 1:07p Markw
+//
+//
+//*****************************************************************************
+//<AMI_FHDR_START>
+//
+// Name: MpService.h
+//
+// Description: This file is an include file used to define the Protocol for the
+// DXE Mp Service Protocol.
+//
+//<AMI_FHDR_END>
+//*****************************************************************************
+
+#ifndef _MP_SERVICES_H_
+#define _MP_SERVICES_H_
+
+#include <Efi.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#if PI_SPECIFICATION_VERSION < 0x0001000A || BACKWARD_COMPATIBLE_MODE && defined(NO_PI_MP_SERVICES_SUPPORT)
+
+#define EFI_MP_SERVICES_PROTOCOL_GUID \
+ {0xf33261e7,0x23cb,0x11d5,0xbd,0x5c,0x0,0x80,0xc7,0x3c,0x88,0x81}
+
+GUID_VARIABLE_DECLARATION(gEfiMpServiceProtocolGuid, EFI_MP_SERVICES_PROTOCOL_GUID);
+
+#ifndef EFI_AP_PROCEDURE_TYPE_DEFINED
+#define EFI_AP_PROCEDURE_TYPE_DEFINED
+typedef VOID (*EFI_AP_PROCEDURE) (
+ IN VOID *Buffer
+);
+#endif
+
+//*******************************************************
+// Processor Context Buffer Definitions.
+//*******************************************************
+//(Intel CPU RC)>
+//EFI_MP_PROC_CONTEXT is copyied from Intel CPU RC, it's different from Aptio CPU module
+//
+typedef union {
+ struct {
+ UINT32 Status : 2;
+ UINT32 Tested : 1;
+ UINT32 Reserved1 : 13;
+ UINT32 VirtualMemoryUnavailable : 1;
+ UINT32 Ia32ExecutionUnavailable : 1;
+ UINT32 FloatingPointUnavailable : 1;
+ UINT32 MiscFeaturesUnavailable : 1;
+ UINT32 Reserved2 : 12;
+ } Bits;
+ UINT32 Uint32;
+} EFI_MP_HEALTH_FLAGS;
+
+#define EFI_MP_HEALTH_FLAGS_STATUS_HEALTHY 0x0
+#define EFI_MP_HEALTH_FLAGS_STATUS_PERFORMANCE_RESTRICTED 0x1
+#define EFI_MP_HEALTH_FLAGS_STATUS_FUNCTIONALLY_RESTRICTED 0x2
+
+typedef struct {
+ EFI_MP_HEALTH_FLAGS Flags;
+ UINT32 TestStatus;
+} EFI_MP_HEALTH;
+
+typedef enum {
+ EfiCpuAP = 0,
+ EfiCpuBSP,
+ EfiCpuDesignationMaximum
+} EFI_CPU_DESIGNATION;
+
+typedef struct {
+ UINT32 Package;
+ UINT32 Die;
+ UINT32 Core;
+ UINT32 Thread;
+} PHYSICAL_LOCATION;
+
+typedef struct {
+ UINT32 ApicID;
+ BOOLEAN Enabled;
+ EFI_CPU_DESIGNATION Designation;
+ EFI_MP_HEALTH Health;
+ UINTN PackageNumber;
+ UINTN NumberOfCores;
+ UINTN NumberOfThreads;
+ UINT64 ProcessorPALCompatibilityFlags;
+ UINT64 ProcessorTestMask;
+} EFI_MP_PROC_CONTEXT;
+//<(Intel CPU RC)
+
+#define EFI_MP_PROC_CONTEXT_VERSION \
+ {0x4DCFD87B, 0x2C99, 0x11d6, 0xAF, 0x22,0x00,0xA0, 0xC9, 0x44, 0xA0, 0x5B}
+
+
+typedef struct _EFI_MP_SERVICES_PROTOCOL EFI_MP_SERVICES_PROTOCOL;
+
+typedef EFI_STATUS (EFIAPI *EFI_MP_SERVICES_GET_GENERAL_MP_INFO) (
+ IN EFI_MP_SERVICES_PROTOCOL *This,
+ OUT UINTN *NumberOfCPUs OPTIONAL,
+ OUT UINTN *MaximumNumberOfCPUs OPTIONAL,
+ OUT UINTN *NumberOfEnabledCPUs OPTIONAL,
+ OUT UINTN *RendezvousIntNumber OPTIONAL,
+ OUT UINTN *RendezvousProcLength OPTIONAL
+);
+
+typedef EFI_STATUS (EFIAPI *EFI_MP_SERVICES_GET_PROCESSOR_CONTEXT) (
+ IN EFI_MP_SERVICES_PROTOCOL *This,
+ IN UINTN ProcessorNumber,
+ IN OUT UINTN *BufferLength,
+ IN OUT VOID *ProcessorContextBuffer
+);
+
+typedef EFI_STATUS (EFIAPI *EFI_MP_SERVICES_STARTUP_ALL_APS) (
+ IN EFI_MP_SERVICES_PROTOCOL *This,
+ IN EFI_AP_PROCEDURE Procedure,
+ IN BOOLEAN SingleThread,
+ IN EFI_EVENT WaitEvent OPTIONAL,
+ IN UINTN TimeoutInMicroSecs OPTIONAL,
+ IN OUT VOID *ProcArguments OPTIONAL,
+ OUT UINTN *FailedCPUList OPTIONAL
+);
+
+typedef EFI_STATUS (EFIAPI *EFI_MP_SERVICES_STARTUP_THIS_AP) (
+ IN EFI_MP_SERVICES_PROTOCOL *This,
+ IN EFI_AP_PROCEDURE Procedure,
+ IN UINTN ProcessorNumber,
+ IN EFI_EVENT WaitEvent OPTIONAL,
+ IN UINTN TimeoutInMicroSecs OPTIONAL,
+ IN OUT VOID *ProcArguments OPTIONAL
+);
+
+typedef EFI_STATUS (EFIAPI *EFI_MP_SERVICES_SWITCH_BSP) (
+ IN EFI_MP_SERVICES_PROTOCOL *This,
+ IN UINTN ProcessorNumber,
+ IN BOOLEAN EnableOldBSP
+);
+
+typedef EFI_STATUS (EFIAPI *EFI_MP_SERVICES_SEND_IPI) (
+ IN EFI_MP_SERVICES_PROTOCOL *This,
+ IN UINTN ProcessorNumber,
+ IN UINTN VectorNumber,
+ IN UINTN DeliveryMode
+);
+
+typedef EFI_STATUS (EFIAPI *EFI_MP_SERVICES_ENABLEDISABLEAP) (
+ IN EFI_MP_SERVICES_PROTOCOL *This,
+ IN UINTN ProcessorNumber,
+ IN BOOLEAN Enable,
+ IN VOID *HealthState OPTIONAL
+);
+
+typedef EFI_STATUS (EFIAPI *EFI_MP_SERVICES_WHOAMI) (
+ IN EFI_MP_SERVICES_PROTOCOL *This,
+ OUT UINTN *ProcessorNumber
+);
+
+typedef struct _EFI_MP_SERVICES_PROTOCOL {
+ EFI_MP_SERVICES_GET_GENERAL_MP_INFO GetGeneralMPInfo;
+ EFI_MP_SERVICES_GET_PROCESSOR_CONTEXT GetProcessorContext;
+ EFI_MP_SERVICES_STARTUP_ALL_APS StartupAllAPs;
+ EFI_MP_SERVICES_STARTUP_THIS_AP StartupThisAP;
+ EFI_MP_SERVICES_SWITCH_BSP SwitchBSP;
+ EFI_MP_SERVICES_SEND_IPI SendIPI;
+ EFI_MP_SERVICES_ENABLEDISABLEAP EnableDisableAP;
+ EFI_MP_SERVICES_WHOAMI WhoAmI;
+};
+
+#else // #if PI_SPECIFICATION_VERSION < 0x0001000A
+
+/// Global ID for the EFI_MP_SERVICES_PROTOCOL.
+#define EFI_MP_SERVICES_PROTOCOL_GUID \
+ { 0x3fdda605, 0xa76e, 0x4f46, 0xad, 0x29, 0x12, 0xf4, 0x53, 0x1b, 0x3d, 0x08 }
+
+GUID_VARIABLE_DECLARATION(gEfiMpServiceProtocolGuid, EFI_MP_SERVICES_PROTOCOL_GUID);
+
+typedef struct _EFI_MP_SERVICES_PROTOCOL EFI_MP_SERVICES_PROTOCOL;
+
+#ifndef EFI_AP_PROCEDURE_TYPE_DEFINED
+#define EFI_AP_PROCEDURE_TYPE_DEFINED
+typedef VOID (*EFI_AP_PROCEDURE) (
+ IN VOID *Buffer
+);
+#endif
+
+/// Terminator for a list of failed CPUs returned by StartAllAPs().
+#define END_OF_CPU_LIST 0xffffffff
+
+/// This bit is used in the StatusFlag field of EFI_PROCESSOR_INFORMATION and
+/// indicates whether the processor is playing the role of BSP. If the bit is 1,
+/// then the processor is BSP. Otherwise, it is AP.
+#define PROCESSOR_AS_BSP_BIT 0x00000001
+
+/// This bit is used in the StatusFlag field of EFI_PROCESSOR_INFORMATION and
+/// indicates whether the processor is enabled. If the bit is 1, then the
+/// processor is enabled. Otherwise, it is disabled.
+#define PROCESSOR_ENABLED_BIT 0x00000002
+
+/// This bit is used in the StatusFlag field of EFI_PROCESSOR_INFORMATION and
+/// indicates whether the processor is healthy. If the bit is 1, then the
+/// processor is healthy. Otherwise, some fault has been detected for the processor.
+#define PROCESSOR_HEALTH_STATUS_BIT 0x00000004
+
+/// Structure that describes the pyhiscal location of a logical CPU.
+typedef struct {
+ /// Zero-based physical package number that identifies the cartridge of the processor.
+ UINT32 Package;
+ /// Zero-based physical core number within package of the processor.
+ UINT32 Core;
+ /// Zero-based logical thread number within core of the processor.
+ UINT32 Thread;
+} EFI_CPU_PHYSICAL_LOCATION;
+
+/// Structure that describes information about a logical CPU.
+typedef struct {
+ /// The unique processor ID determined by system hardware. For IA32 and X64,
+ /// the processor ID is the same as the Local APIC ID. Only the lower 8 bits
+ /// are used, and higher bits are reserved. For IPF, the lower 16 bits contains
+ /// id/eid, and higher bits are reserved.
+ ///
+ UINT64 ProcessorId;
+ ///
+ /// Flags indicating if the processor is BSP or AP, if the processor is enabled
+ /// or disabled, and if the processor is healthy. Bits 3..31 are reserved and
+ /// must be 0.
+ ///
+ /// <pre>
+ /// BSP ENABLED HEALTH Description
+ /// === ======= ====== ===================================================
+ /// 0 0 0 Unhealthy Disabled AP.
+ /// 0 0 1 Healthy Disabled AP.
+ /// 0 1 0 Unhealthy Enabled AP.
+ /// 0 1 1 Healthy Enabled AP.
+ /// 1 0 0 Invalid. The BSP can never be in the disabled state.
+ /// 1 0 1 Invalid. The BSP can never be in the disabled state.
+ /// 1 1 0 Unhealthy Enabled BSP.
+ /// 1 1 1 Healthy Enabled BSP.
+ /// </pre>
+ ///
+ UINT32 StatusFlag;
+ ///
+ /// The physical location of the processor, including the physical package number
+ /// that identifies the cartridge, the physical core number within package, and
+ /// logical thread number within core.
+ ///
+ EFI_CPU_PHYSICAL_LOCATION Location;
+} EFI_PROCESSOR_INFORMATION;
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_MP_SERVICES_GET_NUMBER_OF_PROCESSORS)(
+ IN EFI_MP_SERVICES_PROTOCOL *This,
+ OUT UINTN *NumberOfProcessors,
+ OUT UINTN *NumberOfEnabledProcessors
+ );
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_MP_SERVICES_GET_PROCESSOR_INFO)(
+ IN EFI_MP_SERVICES_PROTOCOL *This,
+ IN UINTN ProcessorNumber,
+ OUT EFI_PROCESSOR_INFORMATION *ProcessorInfoBuffer
+ );
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_MP_SERVICES_STARTUP_ALL_APS)(
+ IN EFI_MP_SERVICES_PROTOCOL *This,
+ IN EFI_AP_PROCEDURE Procedure,
+ IN BOOLEAN SingleThread,
+ IN EFI_EVENT WaitEvent OPTIONAL,
+ IN UINTN TimeoutInMicroSeconds,
+ IN VOID *ProcedureArgument OPTIONAL,
+ OUT UINTN **FailedCpuList OPTIONAL
+ );
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_MP_SERVICES_STARTUP_THIS_AP)(
+ IN EFI_MP_SERVICES_PROTOCOL *This,
+ IN EFI_AP_PROCEDURE Procedure,
+ IN UINTN ProcessorNumber,
+ IN EFI_EVENT WaitEvent OPTIONAL,
+ IN UINTN TimeoutInMicroseconds,
+ IN VOID *ProcedureArgument OPTIONAL,
+ OUT BOOLEAN *Finished OPTIONAL
+ );
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_MP_SERVICES_SWITCH_BSP)(
+ IN EFI_MP_SERVICES_PROTOCOL *This,
+ IN UINTN ProcessorNumber,
+ IN BOOLEAN EnableOldBSP
+ );
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_MP_SERVICES_ENABLEDISABLEAP)(
+ IN EFI_MP_SERVICES_PROTOCOL *This,
+ IN UINTN ProcessorNumber,
+ IN BOOLEAN EnableAP,
+ IN UINT32 *HealthFlag OPTIONAL
+ );
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_MP_SERVICES_WHOAMI)(
+ IN EFI_MP_SERVICES_PROTOCOL *This,
+ OUT UINTN *ProcessorNumber
+ );
+
+/// When installed, the MP Services Protocol produces a collection of services
+/// that are needed for MP management.
+///
+/// Before the UEFI event EFI_EVENT_GROUP_READY_TO_BOOT is signaled, the module
+/// that produces this protocol is required to place all APs into an idle state
+/// whenever the APs are disabled or the APs are not executing code as requested
+/// through the StartupAllAPs() or StartupThisAP() services. The idle state of
+/// an AP before the UEFI event EFI_EVENT_GROUP_READY_TO_BOOT is signaled is
+/// implementation dependent.
+///
+/// After the UEFI event EFI_EVENT_GROUP_READY_TO_BOOT is signaled, all the APs
+/// must be placed in the OS compatible CPU state as defined by the UEFI
+/// Specification. Implementations of this protocol may use the UEFI event
+/// EFI_EVENT_GROUP_READY_TO_BOOT to force APs into the OS compatible state as
+/// defined by the UEFI Specification. Modules that use this protocol must
+/// guarantee that all non-blocking mode requests on all APs have been completed
+/// before the UEFI event EFI_EVENT_GROUP_READY_TO_BOOT is signaled. Since the
+/// order that event notification functions in the same event group are executed
+/// is not deterministic, an event of type EFI_EVENT_GROUP_READY_TO_BOOT cannot
+/// be used to guarantee that APs have completed their non-blocking mode requests.
+///
+/// When the UEFI event EFI_EVENT_GROUP_READY_TO_BOOT is signaled, the StartAllAPs()
+/// and StartupThisAp() services must no longer support non-blocking mode requests.
+/// The support for SwitchBSP() and EnableDisableAP() may no longer be supported
+/// after this event is signaled. Since UEFI Applications and UEFI OS Loaders
+/// execute after the UEFI event EFI_EVENT_GROUP_READY_TO_BOOT is signaled, these
+/// UEFI images must be aware that the functionality of this protocol may be reduced.
+///
+struct _EFI_MP_SERVICES_PROTOCOL {
+ EFI_MP_SERVICES_GET_NUMBER_OF_PROCESSORS GetNumberOfProcessors;
+ EFI_MP_SERVICES_GET_PROCESSOR_INFO GetProcessorInfo;
+ EFI_MP_SERVICES_STARTUP_ALL_APS StartupAllAPs;
+ EFI_MP_SERVICES_STARTUP_THIS_AP StartupThisAP;
+ EFI_MP_SERVICES_SWITCH_BSP SwitchBSP;
+ EFI_MP_SERVICES_ENABLEDISABLEAP EnableDisableAP;
+ EFI_MP_SERVICES_WHOAMI WhoAmI;
+};
+
+#endif // #if PI_SPECIFICATION_VERSION <= 0x0001000A
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
diff --git a/Include/Protocol/MpService/MpService.h b/Include/Protocol/MpService/MpService.h
new file mode 100644
index 0000000..e5dec6a
--- /dev/null
+++ b/Include/Protocol/MpService/MpService.h
@@ -0,0 +1,232 @@
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1987-2013, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/SOURCE/Modules/SharkBayRefCodes/Haswell/AMI Cpu PKG/CPU Core/CpuProtocols/MpService/MpService.h 2 2/23/12 2:05a Davidhsieh $
+//
+// $Revision: 2 $
+//
+// $Date: 2/23/12 2:05a $
+//*****************************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/SOURCE/Modules/SharkBayRefCodes/Haswell/AMI Cpu PKG/CPU Core/CpuProtocols/MpService/MpService.h $
+//
+// 2 2/23/12 2:05a Davidhsieh
+// [TAG] EIP72056
+// [Category] Improvement
+// [Description] Change EFI_MP_PROC_CONTEXT to follow Intel CPU driver
+//
+// 1 2/07/12 3:59a Davidhsieh
+//
+// 1 7/07/11 4:41a Davidhsieh
+//
+// 1 5/06/11 6:08a Davidhsieh
+// First release
+//
+// 3 8/03/09 4:04p Markw
+// Add GetProcessorContext update.
+//
+// 2 3/04/09 10:45a Markw
+// Update copyright header.
+//
+// 1 11/02/07 1:59p Markw
+//
+// 1 11/02/07 1:45p Markw
+//
+// 2 7/23/07 7:33p Markw
+// Make EFI_MP_SERVICES_PROTOCOL output parameters optional.
+//
+// 1 3/28/06 1:07p Markw
+//
+//
+//*****************************************************************************
+//<AMI_FHDR_START>
+//
+// Name: MpService.h
+//
+// Description: This file is an include file used to define the Protocol for the
+// DXE Mp Service Protocol.
+//
+//<AMI_FHDR_END>
+//*****************************************************************************
+
+#ifndef _MP_SERVICES_H_
+#define _MP_SERVICES_H_
+
+#include "efi.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+//This Protocol has been significantly changed by the PI spec. If this protocol is used,
+//be prepared to update your code accordingly.
+
+#define EFI_MP_SERVICES_PROTOCOL_GUID \
+ {0xf33261e7,0x23cb,0x11d5,0xbd,0x5c,0x0,0x80,0xc7,0x3c,0x88,0x81}
+
+typedef VOID (*EFI_AP_PROCEDURE) (
+ IN VOID *Buffer
+);
+
+//*******************************************************
+// Processor Context Buffer Definitions.
+//*******************************************************
+//EFI_MP_PROC_CONTEXT is copyied from Intel CPU RC, it's different from Aptio CPU module
+//
+typedef union {
+ struct {
+ UINT32 Status : 2;
+ UINT32 Tested : 1;
+ UINT32 Reserved1 : 13;
+ UINT32 VirtualMemoryUnavailable : 1;
+ UINT32 Ia32ExecutionUnavailable : 1;
+ UINT32 FloatingPointUnavailable : 1;
+ UINT32 MiscFeaturesUnavailable : 1;
+ UINT32 Reserved2 : 12;
+ } Bits;
+ UINT32 Uint32;
+} EFI_MP_HEALTH_FLAGS;
+
+#define EFI_MP_HEALTH_FLAGS_STATUS_HEALTHY 0x0
+#define EFI_MP_HEALTH_FLAGS_STATUS_PERFORMANCE_RESTRICTED 0x1
+#define EFI_MP_HEALTH_FLAGS_STATUS_FUNCTIONALLY_RESTRICTED 0x2
+
+typedef struct {
+ EFI_MP_HEALTH_FLAGS Flags;
+ UINT32 TestStatus;
+} EFI_MP_HEALTH;
+
+typedef enum {
+ EfiCpuAP = 0,
+ EfiCpuBSP,
+ EfiCpuDesignationMaximum
+} EFI_CPU_DESIGNATION;
+
+typedef struct {
+ UINT32 Package;
+ UINT32 Die;
+ UINT32 Core;
+ UINT32 Thread;
+} PHYSICAL_LOCATION;
+
+typedef struct {
+ UINT32 ApicID;
+ BOOLEAN Enabled;
+ EFI_CPU_DESIGNATION Designation;
+ EFI_MP_HEALTH Health;
+ UINTN PackageNumber;
+ UINTN NumberOfCores;
+ UINTN NumberOfThreads;
+ UINT64 ProcessorPALCompatibilityFlags;
+ UINT64 ProcessorTestMask;
+} EFI_MP_PROC_CONTEXT;
+
+#define EFI_MP_PROC_CONTEXT_VERSION \
+ {0x4DCFD87B, 0x2C99, 0x11d6, 0xAF, 0x22,0x00,0xA0, 0xC9, 0x44, 0xA0, 0x5B}
+
+
+typedef struct _EFI_MP_SERVICES_PROTOCOL EFI_MP_SERVICES_PROTOCOL;
+
+typedef EFI_STATUS (EFIAPI *EFI_MP_SERVICES_GET_GENERAL_MP_INFO) (
+ IN EFI_MP_SERVICES_PROTOCOL *This,
+ OUT UINTN *NumberOfCPUs OPTIONAL,
+ OUT UINTN *MaximumNumberOfCPUs OPTIONAL,
+ OUT UINTN *NumberOfEnabledCPUs OPTIONAL,
+ OUT UINTN *RendezvousIntNumber OPTIONAL,
+ OUT UINTN *RendezvousProcLength OPTIONAL
+);
+
+typedef EFI_STATUS (EFIAPI *EFI_MP_SERVICES_GET_PROCESSOR_CONTEXT) (
+ IN EFI_MP_SERVICES_PROTOCOL *This,
+ IN UINTN ProcessorNumber,
+ IN OUT UINTN *BufferLength,
+ IN OUT VOID *ProcessorContextBuffer
+);
+
+typedef EFI_STATUS (EFIAPI *EFI_MP_SERVICES_STARTUP_ALL_APS) (
+ IN EFI_MP_SERVICES_PROTOCOL *This,
+ IN EFI_AP_PROCEDURE Procedure,
+ IN BOOLEAN SingleThread,
+ IN EFI_EVENT WaitEvent OPTIONAL,
+ IN UINTN TimeoutInMicroSecs OPTIONAL,
+ IN OUT VOID *ProcArguments OPTIONAL,
+ OUT UINTN *FailedCPUList OPTIONAL
+);
+
+typedef EFI_STATUS (EFIAPI *EFI_MP_SERVICES_STARTUP_THIS_AP) (
+ IN EFI_MP_SERVICES_PROTOCOL *This,
+ IN EFI_AP_PROCEDURE Procedure,
+ IN UINTN ProcessorNumber,
+ IN EFI_EVENT WaitEvent OPTIONAL,
+ IN UINTN TimeoutInMicroSecs OPTIONAL,
+ IN OUT VOID *ProcArguments OPTIONAL
+);
+
+typedef EFI_STATUS (EFIAPI *EFI_MP_SERVICES_SWITCH_BSP) (
+ IN EFI_MP_SERVICES_PROTOCOL *This,
+ IN UINTN ProcessorNumber,
+ IN BOOLEAN EnableOldBSP
+);
+
+typedef EFI_STATUS (EFIAPI *EFI_MP_SERVICES_SEND_IPI) (
+ IN EFI_MP_SERVICES_PROTOCOL *This,
+ IN UINTN ProcessorNumber,
+ IN UINTN VectorNumber,
+ IN UINTN DeliveryMode
+);
+
+typedef EFI_STATUS (EFIAPI *EFI_MP_SERVICES_ENABLEDISABLEAP) (
+ IN EFI_MP_SERVICES_PROTOCOL *This,
+ IN UINTN ProcessorNumber,
+ IN BOOLEAN Enable,
+ IN VOID *HealthState OPTIONAL
+);
+
+typedef EFI_STATUS (EFIAPI *EFI_MP_SERVICES_WHOAMI) (
+ IN EFI_MP_SERVICES_PROTOCOL *This,
+ OUT UINTN *ProcessorNumber
+);
+
+typedef struct _EFI_MP_SERVICES_PROTOCOL {
+ EFI_MP_SERVICES_GET_GENERAL_MP_INFO GetGeneralMPInfo;
+ EFI_MP_SERVICES_GET_PROCESSOR_CONTEXT GetProcessorContext;
+ EFI_MP_SERVICES_STARTUP_ALL_APS StartupAllAPs;
+ EFI_MP_SERVICES_STARTUP_THIS_AP StartupThisAP;
+ EFI_MP_SERVICES_SWITCH_BSP SwitchBSP;
+ EFI_MP_SERVICES_SEND_IPI SendIPI;
+ EFI_MP_SERVICES_ENABLEDISABLEAP EnableDisableAP;
+ EFI_MP_SERVICES_WHOAMI WhoAmI;
+};
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1987-2013, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
diff --git a/Include/Protocol/Mxm30.h b/Include/Protocol/Mxm30.h
new file mode 100644
index 0000000..a53b70e
--- /dev/null
+++ b/Include/Protocol/Mxm30.h
@@ -0,0 +1,80 @@
+// {2EF1BA1A-C836-4a50-BF89-525FF29FF787}
+#define MXM30_PEI_GUID \
+ { 0x2ef1ba1a, 0xc836, 0x4a50, 0xbf, 0x89, 0x52, 0x5f, 0xf2, 0x9f, 0xf7, 0x87 }
+
+// {4EA9D4FE-E6F6-410b-8037-0F98B5968B65}
+#define MXM3_EFI_GUID \
+ { 0x4EA9D4FE, 0xE6F6, 0x410B, 0x90, 0x37, 0x0f, 0x98, 0xB5, 0x96, 0x8B, 0x65 }
+
+/////////////////////////////////////////////////////////////////////////////////////////
+//////M X M 3.0 D E F I N I T I O N S /////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////////////////////////////
+#define EFI30_DataBlockID MXM_REV_SUPPORTED
+//0x30;
+// the revision of the MXM software specification that is supported by the MXM module.
+// Format is binary coded decimal, for example: 0x30 = 3.0, etc.
+
+#define EFI30_SupportFuncs MXM_FUNC_SUPPORTED
+//0x3;
+// Bit 0 = `1' MxmReturnSpecLevel method is required
+// Bit 1 = `1' MxmReturnStucture is also required
+// Bit 2 = `1' OPTIONAL. if MxmSelectOutputDevice is supported, `0' if not
+// Bit 3 = `1' OPTIONAL. if MxmCheckOutputDevice is supported, `0' if not
+
+typedef struct {
+ CHAR8 Sig[4]; // "MXM_"
+ UINT8 Ver;
+ UINT8 Rev;
+ UINT16 Len;
+} MXM_STRUCT_HDR;
+
+typedef EFI_STATUS (EFIAPI *MXM_RETURN_SPEC_LEVEL) (
+ IN struct _MXM3_EFI_INTERFACE *This,
+ IN EFI_HANDLE ControllerHandle,
+ IN OUT CHAR16 usStructSize,
+ IN OUT CHAR8 *pucRevisionLevel,
+ OUT UINTN *puSupportFuncs
+);
+
+typedef EFI_STATUS (EFIAPI *MXM_RETURN_STRUCTURE)(
+ IN struct _MXM3_EFI_INTERFACE *This,
+ IN EFI_HANDLE ControllerHandle,
+ IN OUT CHAR16 *usStructSize,
+ IN CHAR16 usDataBlockID,
+ OUT CHAR8 **pMxmStruct
+);
+
+typedef EFI_STATUS (EFIAPI *MXM_SELECT_OUTPUT_DEVICE)(
+ IN struct _MXM3_EFI_INTERFACE *This,
+ IN EFI_HANDLE ControllerHandle,
+ IN OUT CHAR16 usStructSize,
+ IN EFI_HANDLE ChildHandle,
+ IN CHAR8 ucOutputSetting
+);
+
+typedef EFI_STATUS (EFIAPI *MXM_CHECK_OUTPUT_DEVICE)(
+ IN struct _MXM3_EFI_INTERFACE *This,
+ IN EFI_HANDLE ControllerHandle,
+ IN OUT CHAR16 usStructSize,
+ IN EFI_HANDLE ChildHandle,
+ OUT CHAR8 ucDisplayAvailable
+);
+
+typedef struct _MXM3_EFI_INTERFACE {
+ MXM_RETURN_SPEC_LEVEL MxmReturnSpecLevel;
+ MXM_RETURN_STRUCTURE MxmReturnStructure;
+ MXM_SELECT_OUTPUT_DEVICE MxmSelectOutputDevice;
+ MXM_CHECK_OUTPUT_DEVICE MxmCheckOutputDevice;
+} MXM3_EFI_PROTOCOL;
+
+
+
+EFI_STATUS
+LoadFile(
+ IN EFI_GUID *Guid,
+ OUT VOID **Buffer,
+ OUT UINTN *BufferSize
+ );
+
+//#define MXM_DRIVER_VERSION 0x001
+
diff --git a/Include/Protocol/NBMemInfo.h b/Include/Protocol/NBMemInfo.h
new file mode 100644
index 0000000..1dc03b4
--- /dev/null
+++ b/Include/Protocol/NBMemInfo.h
@@ -0,0 +1,89 @@
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
+
+//*************************************************************************
+// $Header: /Alaska/BIN/Chipset/Intel/NorthBridge/Haswell/Intel SystemAgent NB Chipset/NB Protocols/NBMemInfo.h 2 10/14/12 12:13a Jeffch $
+//
+// $Revision: 2 $
+//
+// $Date: 10/14/12 12:13a $
+//*************************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Chipset/Intel/NorthBridge/Haswell/Intel SystemAgent NB Chipset/NB Protocols/NBMemInfo.h $
+//
+// 2 10/14/12 12:13a Jeffch
+// [TAG] None
+// [Severity] Important
+// [Description] Follow MahoBay Update.
+// [Files] NBMemInfo.h, NBPEI.c, PciHostBridge.c
+//
+// 1 2/08/12 4:35a Yurenlai
+// Intel Haswell/NB eChipset initially releases.
+//
+//*************************************************************************
+//<AMI_FHDR_START>
+//
+// Name: NBMemInfo.h
+//
+// Description: The header file for NB Memory Information
+//
+//<AMI_FHDR_END>
+//*************************************************************************
+
+#ifndef _NB_MEMORY_INFO_
+#define _NB_MEMORY_INFO_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <Token.h>
+
+#define EFI_NB_MEMORY_INFO_GUID \
+ {0x490216c0, 0x76a, 0x44d3, 0xa5, 0x36, 0xac, 0xe0, 0x5c, 0x90, 0xe3, 0x86}
+
+// {40312829-7891-4abd-B200-0C541B061939}
+#define EFI_NB_MRC_S3_DATA_GUID \
+ {0x40312829, 0x7891, 0x4abd, 0xb2, 0x00, 0x0c, 0x54, 0x1b, 0x06, 0x19, 0x39}
+
+GUID_VARIABLE_DECLARATION(gEfiNBMemoryInfoGuid, EFI_NB_MEMORY_INFO_GUID);
+
+#define NB_MEMORY_INFO_VARIABLE L"NBMemoryInfo"
+
+#pragma pack(push,1)
+
+
+#pragma pack(pop)
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
diff --git a/Include/Protocol/NBPlatformData.h b/Include/Protocol/NBPlatformData.h
new file mode 100644
index 0000000..e9e60e6
--- /dev/null
+++ b/Include/Protocol/NBPlatformData.h
@@ -0,0 +1,117 @@
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
+
+//*************************************************************************
+// $Header: /Alaska/BIN/Chipset/Intel/NorthBridge/Haswell/Intel SystemAgent NB Chipset/NB Protocols/NBPlatformData.h 5 1/28/13 3:36a Jeffch $
+//
+// $Revision: 5 $
+//
+// $Date: 1/28/13 3:36a $
+//*************************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Chipset/Intel/NorthBridge/Haswell/Intel SystemAgent NB Chipset/NB Protocols/NBPlatformData.h $
+//
+// 5 1/28/13 3:36a Jeffch
+// [TAG] None
+// [Severity] Important
+// [Description] Update SA RC 1.0.
+// [Files] NBPei.c; GetSetupData.c; NbSetupData.h; NBDXE.c; NB.sd;
+// NB.uni;
+//
+// 4 12/24/12 2:53a Jeffch
+// [TAG] None
+// [Category] Improvement
+// [Description] added ULT SKU auto disable PEG.
+// [Files] NBPei.c; NBDxe.c; NbPlatform.h; NB.sd;
+//
+// 3 11/29/12 2:30a Jeffch
+// [TAG] None
+// [Category] Improvement
+// [Description] added bootime check IGFX Available.
+// [Files] NBDxe.c; NbPlatform.h; NB.sd;
+//
+// 2 8/14/12 4:42a Yurenlai
+// [TAG] None
+// [Severity] Important
+// [Description] Implemented BIOS Integration Guide Rev 1.0 to Intel SA
+// GOP driver.
+// [Files] IntelSaGopDriver.cif, IntelSaGopDriver.mak,
+// IntelSaGopDriver.sdl,
+// IntelSaGopPolicy.c, IntelSaGopSetup.c, IntelSaGopSetup.h,
+// IntelSaGopSetup.mak, IntelSaGopSetup.sd, IntelSaGopSetup.sdl,
+// IntelSaGopSetup.uni, IntelSaGopSwitch.c,
+// IntelSaGopDriver.h,
+// NBPlatformData.h
+//
+// 1 2/08/12 4:35a Yurenlai
+// Intel Haswell/NB eChipset initially releases.
+//
+//*************************************************************************
+//<AMI_FHDR_START>
+//
+// Name: NBPlatformData.h
+//
+// Description: NB Specific Setup Variables and Structures
+//
+//<AMI_FHDR_END>
+//*************************************************************************
+#ifndef _NB_PLATFORM_DATA_H_
+#define _NB_PLATFORM_DATA_H_
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef EXIT_PM_AUTH_PROTOCOL_GUID
+#define EXIT_PM_AUTH_PROTOCOL_GUID \
+ { 0xd088a413, 0xa70, 0x4217, 0xba, 0x55, 0x9a, 0x3c, 0xb6, 0x5c, 0x41, 0xb3 };
+#endif
+
+ #pragma pack(1)
+
+ typedef struct _NB_PLATFORM_DATA
+ {
+ UINT8 DimmPresent[4];
+ UINT8 IGFXCapability;
+ UINT8 IGFXAvailable;
+ UINT8 IGFXGopAvailable;
+ UINT8 PegAvailable;
+ UINT8 VTdAvailable;
+ UINT8 UserBoard;
+ UINT8 PresentCPU;
+ UINT8 XmpProfile1;
+ UINT8 XmpProfile2;
+ UINT8 DDR3Type;
+ }NB_PLATFORM_DATA;
+
+ #pragma pack()
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
diff --git a/Include/Protocol/NBProtocols.CIF b/Include/Protocol/NBProtocols.CIF
new file mode 100644
index 0000000..0de04ee
--- /dev/null
+++ b/Include/Protocol/NBProtocols.CIF
@@ -0,0 +1,9 @@
+<component>
+ name = "NB Protocols"
+ category = ModulePart
+ LocalRoot = "INCLUDE\Protocol"
+ RefName = "NB Protocols"
+[files]
+"NBMemInfo.h"
+"NBPlatformData.h"
+<endComponent>
diff --git a/Include/Protocol/Nbci.h b/Include/Protocol/Nbci.h
new file mode 100644
index 0000000..276fa93
--- /dev/null
+++ b/Include/Protocol/Nbci.h
@@ -0,0 +1,77 @@
+#define NBCI_EFI_GUID \
+ { 0x4EA9D4FE, 0xE6F6, 0x410B, 0x80, 0x37, 0x0F, 0x98, 0xB5, 0x96, 0x8B, 0x65 }
+
+/////////////////////////////////////////////////////////////////////////////////////////
+//////N B C I D E F I N I T I O N S ////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////////////////////////////
+#define EFI_Nbci_DataBlockID NBCI_REV_SUPPORTED
+//0x11;
+// the revision of the NBCI software specification that is supported by the NBCI module.
+// Format is binary coded decimal, for example: 0x30 = 3.0, etc.
+
+#define EFI_Nbci_SupportFuncs NBCI_FUNC_SUPPORTED
+//0x3;
+// Bit 0 = `1' NBCIReturnSpecLevel method is required
+// Bit 1 = `1' NBCIReturnStucture is also required
+// Bit 2 = `1' OPTIONAL. if NBCISelectOutputDevice is supported, `0' if not
+// Bit 3 = `1' OPTIONAL. if NBCICheckOutputDevice is supported, `0' if not
+
+typedef struct {
+ CHAR8 Sig[4]; // "NBCI_"
+ UINT8 Ver;
+ UINT8 Rev;
+ UINT16 Len;
+} NBCI_STRUCT_HDR;
+
+typedef EFI_STATUS (EFIAPI *NBCI_RETURN_SPEC_LEVEL) (
+ IN struct _NBCI_EFI_INTERFACE *This,
+ IN OUT CHAR8 *pucRevisionLevel,
+ OUT UINTN *puSupportFuncs
+);
+
+typedef EFI_STATUS (EFIAPI *NBCI_RETURN_STRUCTURE)(
+ IN struct _NBCI_EFI_INTERFACE *This,
+ IN EFI_HANDLE ControllerHandle,
+ IN OUT CHAR16 *usStructSize,
+ IN CHAR16 usDataBlockID,
+ OUT CHAR8 **pNBCIStruct
+);
+
+typedef EFI_STATUS (EFIAPI *NBCI_SELECT_OUTPUT_DEVICE)(
+ IN struct _NBCI_EFI_INTERFACE *This,
+ IN EFI_HANDLE ControllerHandle,
+ IN OUT CHAR16 usStructSize,
+ IN EFI_HANDLE ChildHandle,
+ IN CHAR8 ucOutputSetting
+);
+
+typedef EFI_STATUS (EFIAPI *NBCI_CHECK_OUTPUT_DEVICE)(
+ IN struct _NBCI_EFI_INTERFACE *This,
+ IN EFI_HANDLE ControllerHandle,
+ IN OUT CHAR16 usStructSize,
+ IN EFI_HANDLE ChildHandle,
+ OUT CHAR8 ucDisplayAvailable
+);
+
+typedef struct _NBCI_EFI_INTERFACE {
+ NBCI_RETURN_SPEC_LEVEL NBCIReturnSpecLevel;
+ NBCI_RETURN_STRUCTURE NBCIReturnStructure;
+ NBCI_SELECT_OUTPUT_DEVICE NBCISelectOutputDevice;
+ NBCI_CHECK_OUTPUT_DEVICE NBCICheckOutputDevice;
+} NBCI_EFI_PROTOCOL;
+
+
+EFI_STATUS
+LoadAcpiTables(
+ IN EFI_EVENT Event, IN VOID *Context
+ );
+
+EFI_STATUS
+LoadFile(
+ IN EFI_GUID *Guid,
+ OUT VOID **Buffer,
+ OUT UINTN *BufferSize
+ );
+
+//#define NBCI_DRIVER_VERSION 0x001
+
diff --git a/Include/Protocol/NvmExpressPassThru.h b/Include/Protocol/NvmExpressPassThru.h
new file mode 100644
index 0000000..2e9e7ac
--- /dev/null
+++ b/Include/Protocol/NvmExpressPassThru.h
@@ -0,0 +1,307 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2015, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+//**********************************************************************
+// $Header: /Alaska/SOURCE/Modules/NVMe/Nvme Protocol/NvmExpressPassThru.h 1 5/14/15 2:40a Karthikar $
+//
+// $Revision: 1 $
+//
+// $Date: 5/14/15 2:40a $
+//**********************************************************************
+//**********************************************************************
+//<AMI_FHDR_START>
+//
+// Name: NvmExpressPassThru.h
+//
+// Description: Protocol Header file for the NvmExpressPassThru Protocol
+//
+//<AMI_FHDR_END>
+//**********************************************************************
+
+#ifndef __EFI_NVM_EXPRESS_PASS_THRU_PROTOCOL_H__
+#define __EFI_NVM_EXPRESS_PASS_THRU_PROTOCOL_H__
+
+typedef struct _EFI_NVM_EXPRESS_PASS_THRU_PROTOCOL EFI_NVM_EXPRESS_PASS_THRU_PROTOCOL;
+
+#define EFI_NVM_EXPRESS_PASS_THRU_PROTOCOL_GUID \
+ {0x52c78312, 0x8edc, 0x4233, { 0x98, 0xf2, 0x1a, 0x1a, 0xa5, 0xe3, 0x88, 0xa5 } }
+
+#define EFI_NVM_EXPRESS_PASS_THRU_ATTRIBUTES_PHYSICAL 0x0001
+
+#define EFI_NVM_EXPRESS_PASS_THRU_ATTRIBUTES_LOGICAL 0x0002
+
+#define EFI_NVM_EXPRESS_PASS_THRU_ATTRIBUTES_NONBLOCKINGIO 0x0004
+
+#define EFI_NVM_EXPRESS_PASS_THRU_ATTRIBUTES_CMD_SET_NVME 0x0008
+
+// FusedOperation
+#define NORMAL_CMD 0x00
+#define FUSED_FIRST_CMD 0x01
+#define FUSED_SECOND_CMD 0x02
+
+// Flags
+#define CDW2_VALID 0x01
+#define CDW3_VALID 0x02
+#define CDW10_VALID 0x04
+#define CDW11_VALID 0x08
+#define CDW12_VALID 0x10
+#define CDW13_VALID 0x20
+#define CDW14_VALID 0x40
+#define CDW15_VALID 0x80
+
+typedef struct {
+ UINT32 Attributes;
+ UINT32 IoAlign;
+ UINT32 NvmeVersion;
+} EFI_NVM_EXPRESS_PASS_THRU_MODE;
+
+typedef struct {
+ UINT8 OpCode;
+ UINT8 FusedOperation;
+ UINT16 Unused;
+} NVME_CDW0;
+
+typedef struct {
+ NVME_CDW0 Cdw0;
+ UINT8 Flags;
+ UINT32 Nsid;
+ UINT32 Cdw2;
+ UINT32 Cdw3;
+ UINT32 Cdw10;
+ UINT32 Cdw11;
+ UINT32 Cdw12;
+ UINT32 Cdw13;
+ UINT32 Cdw14;
+ UINT32 Cdw15;
+} EFI_NVM_EXPRESS_COMMAND;
+
+// This structure maps to the NVM Express specification Completion Queue Entry
+
+typedef struct {
+ UINT32 DW0;
+ UINT32 DW1;
+ UINT32 DW2;
+ UINT32 DW3;
+} EFI_NVM_EXPRESS_COMPLETION;
+
+typedef struct _EFI_NVM_EXPRESS_PASS_THRU_COMMAND_PACKET {
+ // The timeout, in 100 ns units, to use for the execution of this
+ // NVM Express Command Packet. A Timeout value of 0 means that this
+ // function will wait indefinitely for the command to execute.
+ // If Timeout is greater than zero, then this function will return
+ // EFI_TIMEOUT if the time required to execute the NVM Express
+ // command is greater than Timeout
+ UINT64 CommandTimeout;
+ //
+ // A pointer to the data buffer to transfer between the host, and the
+ // NVM Express controller for read, write, and bi-directional commands
+ //
+ VOID *TransferBuffer;
+ //
+ // On input, the size in bytes of TransferBuffer. On output, the number
+ // of bytes transferred to the NVM Express controller, or namespace
+ //
+ UINT32 TransferLength;
+ //
+ // A pointer to the optional metadata buffer to transfer between the host,
+ // and the NVM Express controller.If this field is not NULL, then it must
+ // be aligned on the boundary specified by the IoAlign field in the
+ // EFI_NVM_EXPRESS_PASS_THRU_MODE structure.
+ //
+ VOID *MetaDataBuffer;
+ //
+ // On Input, the size in bytes of MetadataBuffer. On output, the number
+ // of bytes transferred to/from the NVM Express controller, or namespace
+ //
+ UINT32 MetadataLength;
+ //
+ // The type of the queue that the NVMe command should be posted to.
+ // A value of 0 indicates it should be posted to the Admin Submission Queue.
+ // A value of 1 indicates it should be posted to an I/O Submission Queue
+ //
+ UINT16 QueueType;
+ //
+ // A pointer to an NVM Express Command Packet.
+ //
+ EFI_NVM_EXPRESS_COMMAND *NvmeCmd;
+ //
+ // The raw NVM Express completion queue
+ //
+ EFI_NVM_EXPRESS_COMPLETION *NvmeCompletion;
+} EFI_NVM_EXPRESS_PASS_THRU_COMMAND_PACKET;
+//**********************************************************************
+//<AMI_PHDR_START>
+//
+//
+// Description: Sends an NVM Express Command Packet to an NVM Express controller or namespace.
+//
+// Input:
+// IN This A pointer to the EFI_NVM_EXPRESS_PASS_THRU_PROTOCOL instance
+// IN NamespaceId A 32 bit namespace ID as defined in the NVMe specification
+// to which the NVM Express Command Packet will be sent.
+// IN Packet A pointer to the NVM Express Command Packet to send to
+// the NVMe namespace specified by NamespaceId.
+// IN Event Event to be signalled when the NVM Express Command Packet completes
+// and non-blocking I/O is supported
+// Output:
+// EFI_SUCCESS The NVM Express Command Packet was sent by the host successfully
+// EFI_BAD_BUFFER_SIZE The number of bytes that could be transferred is not valid
+// EFI_NOT_READY The NVM Express Command Packet could not be sent as the controller
+// is not ready
+// EFI_DEVICE_ERROR Device error
+// EFI_UNSUPPORTED The command described by the NVM Express Command Packet is not
+// supported by the host adapter
+// EFI_TIMEOUT A timeout occurred while waiting for the NVM Express Command Packet
+// to execute
+// Modified:
+//
+// Referrals:
+//
+// Notes:
+//<AMI_PHDR_END>
+//**********************************************************************
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_NVM_EXPRESS_PASS_THRU_PASSTHRU) (
+ IN EFI_NVM_EXPRESS_PASS_THRU_PROTOCOL *This,
+ IN UINT32 NamespaceId,
+ IN OUT EFI_NVM_EXPRESS_PASS_THRU_COMMAND_PACKET *Packet,
+ IN EFI_EVENT Event
+ );
+
+//**********************************************************************
+//<AMI_PHDR_START>
+//
+// Description:Used to retrieve the next namespace ID for this NVM Express controller.
+//
+// Input:
+// IN This A pointer to the EFI_NVM_EXPRESS_PASS_THRU_PROTOCOL instance
+// IN NamespaceId On input, a pointer to a valid namespace ID on this NVM Express controller
+// or a pointer to the value 0xFFFFFFFF. A pointer to the value 0xFFFFFFFF retrieves
+// the first valid namespace ID on this NVM Express controller.
+// Output:
+// EFI_SUCCESS The Namespace ID of the next Namespace was returned
+// EFI_NOT_FOUND There are no more namespaces defined on this controller
+// EFI_INVALID_PARAMETER The Namespace ID was not valid
+//
+// Modified:
+//
+// Referrals:
+//
+// Notes:
+//
+//<AMI_PHDR_END>
+//**********************************************************************
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_NVM_EXPRESS_PASS_THRU_GET_NEXT_NAMESPACE) (
+ IN EFI_NVM_EXPRESS_PASS_THRU_PROTOCOL *This,
+ IN OUT UINT32 *NamespaceId
+ );
+//**********************************************************************
+//<AMI_PHDR_START>
+//
+// Description:Used to allocate and build a device path node for an NVM Express namespace
+// on an NVM Express controller
+//
+// Input:
+// IN This A pointer to the EFI_NVM_EXPRESS_PASS_THRU_PROTOCOL instance
+// IN NamespaceId The NVM Express namespace ID for which a device path node is
+// to be allocated and built
+// IN DevicePath A pointer to a single device path node that describes the
+// NVM Express namespace specified by NamespaceId.
+// This function is responsible for allocating the buffer DevicePath
+// with the boot service AllocatePool(). It is the caller's responsibility
+// to free DevicePath when the caller is finished with DevicePath.
+//
+// Output:
+// EFI_SUCCESS The device path node that describes the NVM Express
+// namespace specified by NamespaceId was allocated and
+// returned in DevicePath
+// EFI_NOT_FOUND The NamespaceIdis not valid
+// EFI_INVALID_PARAMETER DevicePath is NULL
+// EFI_OUT_OF_RESOURCES There are not enough resources to allocate the
+// DevicePath node.
+// Modified:
+//
+// Referrals:
+//
+// Notes:
+//
+//<AMI_PHDR_END>
+//**********************************************************************
+typedef
+EFI_STATUS
+(EFIAPI *EFI_NVM_EXPRESS_PASS_THRU_BUILD_DEVICE_PATH) (
+ IN EFI_NVM_EXPRESS_PASS_THRU_PROTOCOL *This,
+ IN UINT32 NamespaceId,
+ IN OUT EFI_DEVICE_PATH_PROTOCOL **DevicePath
+ );
+
+//**********************************************************************
+//<AMI_PHDR_START>
+//
+// Description: Used to translate a device path node to a namespace ID
+//
+// Input:
+// IN This A pointer to the EFI_NVM_EXPRESS_PASS_THRU_PROTOCOL instance
+// IN NamespaceId The NVM Express namespace ID contained in the device path node
+// IN DevicePath A pointer to the device path node that describes an NVM
+// Express namespace on the NVM Express controller.
+// Output:
+// EFI_SUCCESS Namespace ID is returned in NamespaceID
+//
+// Modified:
+//
+// Referrals:
+//
+// Notes:
+//
+//<AMI_PHDR_END>
+//**********************************************************************
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_NVM_EXPRESS_PASS_THRU_GET_NAMESPACE) (
+ IN EFI_NVM_EXPRESS_PASS_THRU_PROTOCOL *This,
+ IN EFI_DEVICE_PATH_PROTOCOL *DevicePath,
+ OUT UINT32 *NamespaceId
+ );
+
+struct _EFI_NVM_EXPRESS_PASS_THRU_PROTOCOL {
+ EFI_NVM_EXPRESS_PASS_THRU_MODE *Mode;
+ EFI_NVM_EXPRESS_PASS_THRU_PASSTHRU PassThru;
+ EFI_NVM_EXPRESS_PASS_THRU_GET_NEXT_NAMESPACE GetNextNamespace;
+ EFI_NVM_EXPRESS_PASS_THRU_BUILD_DEVICE_PATH BuildDevicePath;
+ EFI_NVM_EXPRESS_PASS_THRU_GET_NAMESPACE GetNameSpace;
+};
+
+extern EFI_GUID gEfiNvmExpressPassThruProtocolGuid;
+
+#endif
+
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2015, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//********************************************************************** \ No newline at end of file
diff --git a/Include/Protocol/PAhciBus.h b/Include/Protocol/PAhciBus.h
new file mode 100644
index 0000000..0f6e2c1
--- /dev/null
+++ b/Include/Protocol/PAhciBus.h
@@ -0,0 +1,399 @@
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2013, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/Projects/Intel/Haswell/LynxPoint_SharkBay-DT_Crb_1AQQW/Include/Protocol/PAhciBus.h 3 2/01/15 11:02p Chienhsieh $
+//
+// $Revision: 3 $
+//
+// $Date: 2/01/15 11:02p $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/Projects/Intel/Haswell/LynxPoint_SharkBay-DT_Crb_1AQQW/Include/Protocol/PAhciBus.h $
+//
+// 3 2/01/15 11:02p Chienhsieh
+// Update v12 for AHCI module labeled 27.
+//
+// 12 6/25/14 10:08a Anandakrishnanl
+// [TAG] EIP170118
+// [Category] Bug Fix
+// [Severity] Normal
+// [Symptom] MDAT can't program correctly in AHCI module
+// [RootCause] Identify Data Word 76_79 Offset for DiPM Support/Enabled
+// is incorrect for validation
+// [Solution] Changed separating DiPM and Device Sleep into two routines
+// and also modified the tokens to disable both support by default .
+// Corrected Identify data validations
+// [Files] AhciBus.c
+// AhciBus.h
+// AhciSrc.sdl
+// PAhciBus.h
+// PIDEBus.h
+//
+// 11 7/23/13 11:58p Srikantakumarp
+// [TAG] EIP129989
+// [Category] Improvement
+// [Description] Added DIPM support in Aptio 4.x AHCIBUS driver.
+// [Files] AhciBus.c, AhciBus.h, AhciController.h, AhciSrc.sdl,
+// PAhciBus.h
+//
+// 10 7/22/13 2:10a Rameshr
+// [TAG] EIP129028
+// [Category] Improvement
+// [Description] Implement the POWERUP_IN_STANDBY_MODE support in
+// AHCIBUS driver
+// [Files] Ahcibus.c, Ahcibus.h, Pahcibus.h
+//
+// 9 7/18/13 4:23a Rameshr
+// [TAG] EIP127919
+// [Category] Improvement
+// [Description] "Device is Atapi" bit of PxCMD will be set if the ATAPI
+// device connected on the Port and "Drive LED on ATAPI" Enabled by AHCI
+// platform policy
+// [Files] Pahcibus.h, Ahcibus.c, Ahcibus.h
+//
+// 8 11/28/12 7:22a Deepthins
+// [TAG] EIP104011
+// [Category] Bug Fix
+// [Severity] Minor
+// [Symptom] AhciBaseAddress build x86 problem
+// [RootCause] When x64_BUILD is disabled, UINTN is UINT32, when copied
+// to UINT64 can cause data loss
+// [Solution] AhciBaseAddress is defined as UINT32 instead of UINTN.
+// [Files] AtaPassThru.c ,PAhciBus.h
+//
+// 7 9/10/12 3:05a Rameshr
+// [TAG] EIP95440
+// [Category] Improvement
+// [Description] Add HddSecurity and HddSmart feature under UEFI Raid
+// driver mode
+// [Files] Ahcibus.c, Pahcibus.h, Aint13.c
+//
+// 6 8/16/12 3:16a Rajeshms
+// [TAG] EIP97048
+// [Category] New Feature
+// [Description] ATAPI PassThru Support using
+// EFI_EXT_SCSI_PASS_THRU_PROTOCOL.
+// [Files] AhciBus.c, AhciController.c, IdeBus.c, Atapi.c, PIDEBus.h,
+// PAhciBus.h, ScsiPassThruAtapi.sdl, ScsiPassThruAtapi.mak,
+// ScsiPassThruAtapi.c, ScsiPassThruAtapiSupport.h, ScsiPassThruAtapi.chm,
+// ScsiPassThruExt.h
+//
+// 5 7/20/12 6:16a Anandakrishnanl
+// [TAG] EIP88683
+// [Category] New Feature
+// [Description] EFI_ATA_PASS_THRU_PROTOCOL Support for Aptio IDE
+// [Files] AhciBus.c
+// AhciBus.h
+// AInt13.h
+// IdeBus.c
+// IdeBus.h
+// PIDEBus.h
+// PAhciBus.h
+// AtaPassThru.sdl
+// AtaPassThru.mak
+// AtaPassThru.c
+// AtaPassThruSupport.h
+// AtaPassThru.chm
+//
+// 4 12/23/10 3:49a Lavanyap
+// [TAG] - EIP41445
+// [Category] - NEW FEATURE
+// [Description] - Created SataPioDataOut and AtaPioDataOut protocol
+// function that can accept additional input parameters.
+// [Files] - AhciBus.h, AhciBus.c, AhciController.c, Ata.c, IdeBus.c,
+// IdeBus.h, IdeBusMaster.c,PAhciBus.h, PIdeBus.h
+//
+// 3 1/11/10 12:15p Krishnakumarg
+// Added DiPM in AHCI_BUS_PROTOCOL - EIP 30041
+//
+// 2 9/08/09 9:21a Krishnakumarg
+// Acoustic member variables added to AHCI_BUS_PROTOCOL
+//
+// 1 28/02/08 7:51p Anandakrishnanl
+// Added PIdeBus.h and PAhciBus.h to generic Protocol for HddSecurity
+// support.
+//
+//**********************************************************************
+//<AMI_FHDR_START>
+//
+// Name: AhciBus.h
+//
+// Description:
+//
+//<AMI_FHDR_END>
+//**********************************************************************
+
+#ifndef _PAchiBus_
+#define _PAchiBus_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+
+#define AHCI_BUS_INIT_PROTOCOL_GUID \
+ {0xB2FA4764, 0x3B6E, 0x43D3, 0x91, 0xDF, 0x87, 0xD1, 0x5A, 0x3E, 0x56, 0x68}
+
+
+GUID_VARIABLE_DECLARATION(gAciBusInitProtocolGuid,AHCI_BUS_INIT_PROTOCOL_GUID);
+
+
+#define AHCI_PLATFORM_POLICY_PROTOCOL_GUID \
+ {0x17706d27, 0x83fe, 0x4770,0x87, 0x5f, 0x4c, 0xef, 0x4c, 0xb8, 0xf6, 0x3d}
+
+GUID_VARIABLE_DECLARATION(gAciPlatformPolicyProtocolGuid,AHCI_PLATFORM_POLICY_PROTOCOL_GUID);
+
+#ifndef GUID_VARIABLE_DEFINITION
+#include <AmiDxeLib.h>
+
+// Forward reference for pure ANSI compatability
+typedef struct _SATA_DEVICE_INTERFACE SATA_DEVICE_INTERFACE;
+typedef struct _AHCI_BUS_PROTOCOL AHCI_BUS_PROTOCOL;
+
+#define COMMAND_COMPLETE_TIMEOUT 5000 // 5Sec
+
+#pragma pack(1)
+
+typedef struct {
+ UINT32 Lowdword;
+ UINT32 Upperdword;
+} STRUCT_U64_U32;
+
+//typedef enum {
+// ATA = 0,
+// ATAPI = 1,
+// PMPORT = 2
+//} DEVICE_TYPE;
+
+typedef enum {
+ NON_DATA_CMD = 0,
+ PIO_DATA_IN_CMD = 1,
+ PIO_DATA_OUT_CMD = 2,
+ DMA_DATA_IN_CMD = 3,
+ DMA_DATA_OUT_CMD = 4,
+ PACKET_PIO_DATA_IN_CMD = 5,
+ PACKET_PIO_DATA_OUT_CMD = 6,
+ PACKET_DMA_DATA_IN_CMD = 7,
+ PACKET_DMA_DATA_OUT_CMD = 8,
+} COMMAND_TYPE;
+
+
+typedef struct {
+ DLIST AhciControllerList;
+ DLINK AhciControllerLink;
+} AHCI_CONTOLLER_LINKED_LIST;
+
+typedef struct _AHCI_ATAPI_COMMAND{
+ UINT8 Ahci_Atapi_Command[0x10];
+} AHCI_ATAPI_COMMAND;
+
+typedef struct{
+ VOID *Buffer;
+ UINT32 ByteCount;
+ UINT8 Features;
+ UINT8 FeaturesExp;
+ UINT16 SectorCount;
+ UINT8 LBALow;
+ UINT8 LBALowExp;
+ UINT8 LBAMid;
+ UINT8 LBAMidExp;
+ UINT8 LBAHigh;
+ UINT8 LBAHighExp;
+ UINT8 Device;
+ UINT8 Command;
+ UINT8 Control;
+ AHCI_ATAPI_COMMAND AtapiCmd;
+}COMMAND_STRUCTURE;
+
+typedef EFI_STATUS (*EFI_SATA_DEV_RAED_WRITE_PIO) (
+ IN SATA_DEVICE_INTERFACE *SataDevInterface,
+ IN OUT VOID *Buffer,
+ IN UINTN ByteCount,
+ IN UINT64 LBA,
+ IN UINT8 ReadWriteCommand,
+ IN BOOLEAN READWRITE
+);
+
+typedef EFI_STATUS (*EFI_SATA_DEV_PIO_DATA_IN) (
+ IN SATA_DEVICE_INTERFACE *SataDevInterface,
+ IN OUT COMMAND_STRUCTURE *CommandStructure,
+ IN BOOLEAN READWRITE
+
+);
+
+typedef EFI_STATUS (*EFI_SATA_DEV_PIO_DATA_OUT) (
+ IN SATA_DEVICE_INTERFACE *SataDevInterface,
+ IN OUT VOID *Buffer,
+ IN UINTN ByteCount,
+ IN UINT8 Features,
+ IN UINT8 LBALow,
+ IN UINT8 LBALowExp,
+ IN UINT8 LBAMid,
+ IN UINT8 LBAMidExp,
+ IN UINT8 LBAHigh,
+ IN UINT8 LBAHighExp,
+ IN UINT8 Command,
+ IN BOOLEAN READWRITE
+);
+typedef EFI_STATUS (*EFI_SATA_DEV_NON_DATA_CMD) (
+ IN SATA_DEVICE_INTERFACE *SataDevInterface,
+ IN COMMAND_STRUCTURE CommandStructure
+);
+
+typedef EFI_STATUS (*EFI_SATA_DEV_WAIT_FOR_CMD_COMPLETE) (
+ IN SATA_DEVICE_INTERFACE *SataDevInterface,
+ IN COMMAND_TYPE CommandType,
+ IN UINTN TimeOut
+
+);
+
+typedef EFI_STATUS (*EFI_SATA_GENERATE_PORT_RESET) (
+ AHCI_BUS_PROTOCOL *AhciBusInterface,
+ SATA_DEVICE_INTERFACE *SataDevInterface,
+ UINT8 Port,
+ UINT8 PMPort,
+ UINT8 Speed,
+ UINT8 PowerManagement
+);
+
+typedef EFI_STATUS (*EFI_EXECUTE_PACKET_COMMAND) (
+ IN SATA_DEVICE_INTERFACE *SataDevInterface,
+ IN COMMAND_STRUCTURE *CommandStructure,
+ IN BOOLEAN READWRITE
+);
+
+typedef struct _AHCI_BUS_PROTOCOL{
+ EFI_HANDLE ControllerHandle;
+ UINT32 AhciBaseAddress;
+ UINT32 AhciVersion;
+ UINT32 HBACapability;
+ UINT32 HBAPortImplemented; // Bit Map
+ UINT32 PortCommandListBaseAddr;
+ UINT32 PortCommandListLength;
+ UINT32 PortCommandTableBaseAddr;
+ UINT32 PortCommandTableLength;
+ UINT32 PortFISBaseAddr;
+ UINT32 PortFISBaseAddrEnd;
+ DLIST SataDeviceList;
+ EFI_DEVICE_PATH_PROTOCOL *DevicePathProtocol;
+ EFI_IDE_CONTROLLER_INIT_PROTOCOL *IdeControllerInterface;
+ EFI_PCI_IO_PROTOCOL *PciIO;
+ UINT32 Address1; // Unmodified PortFISBaseAddr
+ UINT32 Address2; // Unmodified PortCommandListBaseAddr
+ UINT8 NumberofPortsImplemented; // 1 based Count
+ BOOLEAN AHCIRAIDMODE; // Set to TRUE in AHCI mode, FALSE in RAID mode
+
+ EFI_SATA_DEV_RAED_WRITE_PIO SataReadWritePio;
+ EFI_SATA_DEV_PIO_DATA_IN ExecutePioDataCommand;
+ EFI_SATA_DEV_PIO_DATA_OUT SataPioDataOut;
+ EFI_SATA_DEV_NON_DATA_CMD ExecuteNonDataCommand;
+ EFI_SATA_DEV_WAIT_FOR_CMD_COMPLETE WaitforCommandComplete;
+ EFI_SATA_GENERATE_PORT_RESET GeneratePortReset;
+ EFI_EXECUTE_PACKET_COMMAND ExecutePacketCommand;
+
+ BOOLEAN Acoustic_Enable; // Acoustic Support
+ UINT8 Acoustic_Management_Level; // Acoustic Level
+ UINT8 DiPM;
+ UINT16 PrevPortNum;
+ UINT16 PrevPortMultiplierPortNum;
+
+}AHCI_BUS_PROTOCOL;
+
+typedef struct _SATA_DISK_INFO{
+ EFI_DISK_INFO_PROTOCOL DiskInfo; // should be the first Entry
+ SATA_DEVICE_INTERFACE *SataDevInterface;
+}SATA_DISK_INFO;
+
+typedef struct _SATA_BLOCK_IO{
+ EFI_BLOCK_IO_PROTOCOL BlkIo; // should be the first Entry
+ SATA_DEVICE_INTERFACE *SataDevInterface;
+}SATA_BLOCK_IO;
+
+typedef struct _SATA_DEVICE_INTERFACE{
+ EFI_HANDLE IdeDeviceHandle;
+ UINT8 PortNumber;
+ UINT8 PMPortNumber;
+ UINT8 NumPMPorts; // Number of Ports in PM, Valid for PMPORT only
+ UINT8 DeviceState;
+ UINT32 Signature;
+ UINT32 SControl;
+ DEVICE_TYPE DeviceType;
+
+ UINT8 PIOMode;
+ UINT8 SWDma;
+ UINT8 MWDma;
+ UINT8 UDma;
+ UINT8 IORdy;
+ UINT8 ReadCommand;
+ UINT8 WriteCommand;
+ IDENTIFY_DATA IdentifyData;
+ EFI_UNICODE_STRING_TABLE *UDeviceName;
+ ATAPI_DEVICE *AtapiDevice;
+ UINT8 AtapiSenseData[256];
+ UINT8 AtapiSenseDataLength;
+
+ UINT32 PortCommandListBaseAddr;
+ UINT32 PortFISBaseAddr;
+
+ AHCI_BUS_PROTOCOL *AhciBusInterface;
+ EFI_DEVICE_PATH_PROTOCOL *DevicePathProtocol;
+ SATA_BLOCK_IO *SataBlkIo;
+ SATA_DISK_INFO *SataDiskInfo;
+ SECURITY_PROTOCOL *IdeSecurityInterface;
+ SMART_INTERFACE *SMARTInterface;
+ POWER_MGMT_INTERFACE *PowerMgmtInterface;
+
+ DLINK SataDeviceLink;
+ DLIST PMSataDeviceList; // for devices behind Port Multiplier
+ DLINK PMSataDeviceLink;
+}SATA_DEVICE_INTERFACE;
+
+typedef struct{
+ BOOLEAN RaidDriverMode; // Set to TRUE For UEFI Raid driver and FALSE for Legacy Raid option rom
+ BOOLEAN AhciBusAtapiSupport; // Set to FALSE For UEFI Raid driver and TRUE for Legacy Raid option rom
+ BOOLEAN DriverLedOnAtapiEnable; // Set to TRUE to enable the Drive LED on ATAPI Enable (DLAE) bit
+ BOOLEAN PowerUpInStandbySupport;
+ BOOLEAN PowerUpInStandbyMode;
+ BOOLEAN DipmSupport; // Set to TRUE to Support the Device initiated power management.
+ BOOLEAN DipmEnable; // Set to TRUE to Enable the Device initiated power management.
+ BOOLEAN DeviceSleepSupport; // Set to TRUE to Support the Device Sleep
+ BOOLEAN DeviceSleepEnable;
+} AHCI_PLATFORM_POLICY_PROTOCOL;
+
+#pragma pack()
+
+#endif // #ifndef GUID_VARIABLE_DEFINITION
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2013, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//************************************************************************* \ No newline at end of file
diff --git a/Include/Protocol/PDiskInfo.h b/Include/Protocol/PDiskInfo.h
new file mode 100644
index 0000000..6715382
--- /dev/null
+++ b/Include/Protocol/PDiskInfo.h
@@ -0,0 +1,130 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Pkwy, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+//**********************************************************************
+// $Header: /Alaska/BIN/Core/Modules/IdeBus/PDiskInfo.h 4 7/05/11 2:54a Anandakrishnanl $
+//
+// $Revision: 4 $
+//
+// $Date: 7/05/11 2:54a $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Core/Modules/IdeBus/PDiskInfo.h $
+//
+// 4 7/05/11 2:54a Anandakrishnanl
+// [TAG] EIP56530
+// [Category] Improvement
+// [Description] EFI_IDE_CONTROLLER_INIT_PROTOCOL and
+// EFI_DISK_INFO_PROTOCOL are used accordingly to the PI 1.2 spec
+// [Files] AhciBus.c, IdeControllerInit.h, PDiskInfo.h
+//
+// 3 8/25/10 5:38a Rameshr
+// New Feature: EIP 37748
+// Description: Move all the IDEBus Source driver SDL token into IdeBus
+// Bin Driver.
+// FilesModified: Ata.c, Atapi.c, idebus.c, IdeBus.h,
+// IdebuscomponentName.c, IdeBusmaster.c IdeBusSrc.mak IdebusSrc.sdl
+// IdeHpa.c, IdePowerManagement.c
+//
+// 2 7/01/09 12:25p Rameshr
+// Coding Standard and File header updated.
+//
+// 1 12/01/05 9:38a Felixp
+//
+// 2 3/04/05 10:44a Mandal
+//
+// 1 1/28/05 12:45p Felixp
+//
+// 2 1/18/05 3:22p Felixp
+// PrintDebugMessage renamed to Trace
+//
+// 1 12/10/04 1:01p Srinin
+//
+//
+//**********************************************************************
+
+#ifndef __DISK_INFO_H__
+#define __DISK_INFO_H__
+
+
+#define EFI_DISK_INFO_PROTOCOL_GUID \
+ { 0xd432a67f, 0x14dc, 0x484b, 0xb3, 0xbb, 0x3f, 0x2, 0x91, 0x84, 0x93, 0x27 }
+
+
+typedef struct _EFI_DISK_INFO_PROTOCOL EFI_DISK_INFO_PROTOCOL;
+
+typedef
+EFI_STATUS
+(*EFI_DISK_INFO_INQUIRY) (
+ IN EFI_DISK_INFO_PROTOCOL *This,
+ IN OUT VOID *InquiryData,
+ IN OUT UINT32 *InquiryDataSize
+);
+
+typedef
+EFI_STATUS
+(*EFI_DISK_INFO_IDENTIFY) (
+ IN EFI_DISK_INFO_PROTOCOL *This,
+ IN OUT VOID *IdentifyData,
+ IN OUT UINT32 *IdentifyDataSize
+);
+
+typedef
+EFI_STATUS
+(*EFI_DISK_INFO_SENSE_DATA) (
+ IN EFI_DISK_INFO_PROTOCOL *This,
+ IN OUT VOID *SenseData,
+ IN OUT UINT32 *SenseDataSize,
+ OUT UINT8 *SenseDataNumber
+);
+
+typedef
+EFI_STATUS
+(*EFI_DISK_INFO_WHICH_IDE) (
+ IN EFI_DISK_INFO_PROTOCOL *This,
+ OUT UINT32 *IdeChannel,
+ OUT UINT32 *IdeDevice
+);
+
+#define EFI_DISK_INFO_IDE_INTERFACE_GUID \
+ { 0x5e948fe3, 0x26d3, 0x42b5, 0xaf, 0x17, 0x61, 0x2, 0x87, 0x18, 0x8d, 0xec }
+
+#define EFI_DISK_INFO_AHCI_INTERFACE_GUID \
+{ 0x9e498932, 0x4abc, 0x45af, 0xa3, 0x4d, 0x2, 0x47, 0x78, 0x7b, 0xe7, 0xc6 }
+
+typedef struct _EFI_DISK_INFO_PROTOCOL {
+ EFI_GUID Interface;
+ EFI_DISK_INFO_INQUIRY Inquiry;
+ EFI_DISK_INFO_IDENTIFY Identify;
+ EFI_DISK_INFO_SENSE_DATA SenseData;
+ EFI_DISK_INFO_WHICH_IDE WhichIde;
+} EFI_DISK_INFO_PROTOCOL;
+
+
+#endif
+
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Pkwy, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+//********************************************************************** \ No newline at end of file
diff --git a/Include/Protocol/PIDEBus.cif b/Include/Protocol/PIDEBus.cif
new file mode 100644
index 0000000..3a63549
--- /dev/null
+++ b/Include/Protocol/PIDEBus.cif
@@ -0,0 +1,8 @@
+<component>
+ name = "IDEBusProtocol"
+ category = ModulePart
+ LocalRoot = "Include\Protocol\"
+ RefName = "IDEBusProtocol"
+[files]
+"\PDiskInfo.h"
+<endComponent> \ No newline at end of file
diff --git a/Include/Protocol/PIDEBus.h b/Include/Protocol/PIDEBus.h
new file mode 100644
index 0000000..5077984
--- /dev/null
+++ b/Include/Protocol/PIDEBus.h
@@ -0,0 +1,1364 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2013, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Pkwy, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/Projects/Intel/Haswell/LynxPoint_SharkBay-DT_Crb_1AQQW/Include/Protocol/PIDEBus.h 3 2/01/15 11:02p Chienhsieh $
+//
+// $Revision: 3 $
+//
+// $Date: 2/01/15 11:02p $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/Projects/Intel/Haswell/LynxPoint_SharkBay-DT_Crb_1AQQW/Include/Protocol/PIDEBus.h $
+//
+// 3 2/01/15 11:02p Chienhsieh
+// Update v31 for AHCI module labeled 27.
+//
+// 31 6/25/14 10:12a Anandakrishnanl
+// [TAG] EIP170118
+// [Category] Bug Fix
+// [Severity] Normal
+// [Symptom] MDAT can't program correctly in AHCI module
+// [RootCause] Identify Data Word 76_79 Offset for DiPM
+// Support/Enabled is incorrect for validation
+// [Solution] Changed separating DiPM and Device Sleep into two routines
+// and also modified the tokens to disable both support by default .
+// Corrected Identify data validations.
+// [Files] AhciBus.c
+// AhciBus.h
+// AhciSrc.sdl
+// PAhciBus.h
+// PIDEBus.h
+//
+// 2 9/18/13 1:47a Thomaschen
+// Update for ACHI module labeled 24.
+//
+// 29 6/06/13 4:17a Rameshr
+// [TAG] EIP106423
+// [Category] Improvement
+// [Description] HddPassword Support in UEFI Raid and Legacy Raid. And
+// also taken care where there is no Conin Device avilable in the post
+// [Files] IdeSecurity.cif,IdeSecurity.sdl,IdeSecurity.mak,IdeSecurityB
+// dsCall.c,HddPassword.c, Ahcibus.c, Pidebus.h
+//
+// 28 11/27/12 3:23a Rameshr
+// [TAG] EIP106985
+// [Category] Improvement
+// [Description] The IDE_SMART_INTERFACE structure matched with the
+// SMART_INTERFACE structure
+// [Files] PIDEBus.h
+//
+// 27 8/16/12 3:14a Rajeshms
+// [TAG] EIP97048
+// [Category] New Feature
+// [Description] ATAPI PassThru Support using
+// EFI_EXT_SCSI_PASS_THRU_PROTOCOL.
+// [Files] AhciBus.c, AhciController.c, IdeBus.c, Atapi.c, PIDEBus.h,
+// PAhciBus.h, ScsiPassThruAtapi.sdl, ScsiPassThruAtapi.mak,
+// ScsiPassThruAtapi.c, ScsiPassThruAtapiSupport.h, ScsiPassThruAtapi.chm,
+// ScsiPassThruExt.h
+//
+// 26 7/20/12 6:15a Anandakrishnanl
+// [TAG] EIP88683
+// [Category] New Feature
+// [Description] EFI_ATA_PASS_THRU_PROTOCOL Support for Aptio IDE
+// [Files] AhciBus.c
+// AhciBus.h
+// AInt13.h
+// IdeBus.c
+// IdeBus.h
+// PIDEBus.h
+// PAhciBus.h
+// AtaPassThru.sdl
+// AtaPassThru.mak
+// AtaPassThru.c
+// AtaPassThruSupport.h
+// AtaPassThru.chm
+//
+// 25 7/02/12 8:17a Jittenkumarp
+// [TAG] EIP91969
+// [Category] Improvement
+// [Description] Added versioning and signature support in IDESMART
+// driver
+// [Files] IdeSMART.c, IdeSMART.h, IdeSMART.sdl, PIDEBus.h
+//
+// 24 3/20/12 12:10a Anandakrishnanl
+// [TAG] EIP68496
+// [Category] Bug Fix
+// [Severity] Normal
+// [Symptom] Opal Security Little Endian vs Big Endian
+// [RootCause] Equate defines are defined in alternative endian
+// [Solution] Equate defines changed to reflect correct format
+// [Files] PIDEBus.h
+//
+// 23 12/05/11 6:14p Rajkumarkc
+// [TAG] EIP77142
+// [Category] Improvement
+// [Description] Added the function 'IdeNonDataCommandExp' in the
+// 'IDE_BUS_PROTOCOL' and removed the existing function
+// 'IdeNonDataCommand' for supporting the upper 24bits of LBA.
+// [Files]
+// Ata.c
+// IdeBus.c
+// Idebus.h
+// PIDEBus.h
+//
+// 22 8/22/11 2:59a Anandakrishnanl
+// [TAG] EIP62912
+// [Category] Improvement
+// [Description] Opal Security Definitions Should be Moved to PIDEBUS.h
+// from StorageSecurityProtocol.h
+// StorageSecurityProtocol.h included in OPAL security driver module will
+// give build error when disabled without sdl token #if
+// OpalSecurity_SUPPORT properly placed in Ahcibus and IdeBus drivers. But
+// Bus driver should not depend on any tokens. For this reason need to
+// move OPAL_SEC_INIT_PROTOCOL_GUID in Pidebus.h
+// [Files] IdeBus.c
+// Pidebus.h
+// OpalSecurity.cif
+// OpalSecurity.h
+// IdeOpalSec.c
+// AhciOpalSec.c
+//
+// 21 6/13/11 11:52a Artems
+// Removed unreferenced include
+//
+// 20 5/19/11 2:42a Anandakrishnanl
+// [TAG] EIP53565
+// [Category] New Feature
+// [Description] UEFI2.3+ Specifications defines Storage Security
+// protocol which needs to be implemented.
+// [Files] AhciBus.c,IdeBus.c,AHCIOpalSec.c,IDEOpalSec.c,OpalSecurity.c
+// ,OpalSecurity.chm,OpalSecurity.cif,OpalSecurity.h,OpalSecurity.mak,Opal
+// Security.sdl,PIDEBus.h,StorageSecurityProtocol.CIF,StorageSecurityProto
+// col.h
+//
+// 19 2/21/11 3:50a Rameshr
+// [TAG] - EIP53730
+// [Category] - Improvement
+// [Description] - Add Odd Loading type information into ATAPI_DEVICE
+// structure in AHCI mode
+// [Files] - Pidebus.h
+//
+// 18 2/05/11 6:39p Krishnakumarg
+// [TAG] - EIP36485
+// [Category] - Action Item
+// [Description] - IDESMART module enhancement
+// [Files] - IdeSmart.c,IdeSmart.h,PIdeBus.h
+//
+// 17 12/23/10 3:48a Lavanyap
+// [TAG] - EIP41445
+// [Category] - NEW FEATURE
+// [Description] - Created SataPioDataOut and AtaPioDataOut protocol
+// function that can accept additional input parameters.
+// [Files] - AhciBus.h, AhciBus.c, AhciController.c, Ata.c, IdeBus.c,
+// IdeBus.h, IdeBusMaster.c,PAhciBus.h, PIdeBus.h
+//
+// 16 9/13/10 1:48a Rameshr
+// [TAG]- EIP 43299
+// [Category]-IMPROVEMENT
+// [Description]- About IdeSecurity module. It use soft smi port 0xb2
+// directly.It will need to re-modify on all of AMD project.
+// 1) Added the SDL token for Sw SMI port address.
+// 2) Used Pciio protocol to get the device location and passed this
+// information to SMM driver.
+// [Files]- IdeSecurity.c, IdeSmm.c, PideBus.h
+//
+// 15 8/25/10 5:41a Rameshr
+// New Feature: EIP 37748
+// Description: Move all the IDEBus Source driver SDL token into IdeBus
+// Bin Driver.
+// FilesModified: Ata.c, Atapi.c, idebus.c, IdeBus.h,
+// IdebuscomponentName.c, IdeBusmaster.c IdeBusSrc.mak IdebusSrc.sdl
+// IdeHpa.c, IdePowerManagement.c
+//
+// 14 8/20/10 4:28p Krishnakumarg
+// Ide Smart doesn't support the ATA 8 Read Smart Data. EIP#42492
+// Corrected datasize for PollPeriod in Selftest funtion
+//
+// 13 8/13/10 5:02p Krishnakumarg
+// Ide Smart doesn't support the ATA 8 Read Smart Data. EIP#42492
+//
+// 12 5/12/10 4:58p Aaronp
+// Changed definitions of password flags function and security flags
+// function to refelect return values.
+//
+// 11 5/05/10 11:39a Aaronp
+//
+// 10 5/03/10 11:04a Krishnakumarg
+// Request additional generic functionality to be added to the IdeSMART
+// component.EIP#31559
+//
+// 9 2/24/10 2:04p Felixp
+//
+// 8 1/20/10 9:51a Krishnakumarg
+// Included previous IDE_SETUP_PROTOCOL structure and definitions to have
+// backward compatibility with AHCI drivers.
+//
+// 7 1/11/10 12:17p Krishnakumarg
+// Added DiPM in IDE_BUS_PROTOCOL - EIP 30041.
+// Removed IDE_SETUP_PROTOCOL and Acoustic defintions as this is
+// implemented in SBIDE subcomponent.
+//
+// 6 9/04/09 5:21p Krishnakumarg
+// IDE_SETUP_PROTOCOL definition added for Acoustic management
+// implementation EIP:11835
+// Acoustic flag definitions added.
+//
+// 5 7/08/09 12:52p Felixp
+//
+// 4 6/22/09 11:41a Rameshr
+// Odd Type information Saved in Atapi Device Structure.
+// EIP:21548
+//
+// 3 4/28/09 7:13p Rameshr
+// HDD password support in RAID mode
+//
+// 2 7/03/08 6:02p Anandakrishnanl
+// Added Protocol and Guid Changes for SMART support as a seperate
+// Driver.
+//
+//
+// 1 28/02/08 7:51p Anandakrishnanl
+// Added PIdeBus.h and PAhciBus.h to generic Protocol for HddSecurity
+// support.
+//
+// 11 14/08/07 2:04p Anandakrishnanl
+// Coding standard applied.
+//
+// 10 22/06/07 12:51p Anandakrishnanl
+// HardDisk Security Support Module Added.
+// Need ACPI Module and SB Module and under Core\Include we updated
+// Setup.h.
+// Also New IdeBus bin module.
+//
+// 9 12/19/06 6:16p Srinin
+// DISABLE_SATA2_SOFTPREV equate added.
+//
+// 8 11/13/06 1:39p Ambikas
+//
+// 7 4/26/06 4:03p Robert
+//
+// 5 3/13/06 1:46a Felixp
+//
+// 4 1/09/06 11:34a Felixp
+// IDE_BUS_INIT_PROTOCOL modified.
+//
+// 2 12/14/05 3:13p Srinin
+// IDE_BUS_INIT_PROTOCOL modified.
+//
+// 1 12/01/05 9:38a Felixp
+//
+// 4 8/23/05 10:57a Srinin
+//
+// 4 8/17/05 3:30p Srinin
+// ATA/ATAPI device identification modified.
+//
+// 3 3/04/05 10:45a Mandal
+//
+// 2 2/01/05 1:03p Srinin
+// IDE HotPlug Support added.
+//
+// 1 1/28/05 12:45p Felixp
+//
+// 7 1/18/05 3:22p Felixp
+// PrintDebugMessage renamed to Trace
+//
+// 5 1/13/05 4:26p Srinin
+// Host Protection Area Support added.
+//
+// 4 1/11/05 2:11p Srinin
+// IDE Power Management Support added.
+//
+// 3 1/10/05 11:32a Srinin
+// IDE SMART Support added.
+//
+// 2 1/05/05 11:22a Srinin
+// Busmaster and Password support added.
+//
+// 1 12/10/04 1:01p Srinin
+//
+//
+//**********************************************************************
+
+#ifndef _PIDEBus_
+#define _PIDEBus_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef GUID_VARIABLE_DEFINITION
+
+#include <Protocol\IdeControllerInit.h>
+
+#define IDE_BUS_DRIVER_BINDING_PROTOCOL_GUID \
+ { 0x8AA67071, 0x8BEC, 0x47AB, 0x83, 0xC8, 0xCD, 0x0E, 0xB7, 0x23, 0xD0, 0x72 }
+
+#define IDE_BUS_INIT_PROTOCOL_GUID \
+ { 0xE159A956, 0x3299, 0x4EE9, 0x91, 0x76, 0x65, 0x18, 0x1A, 0x4E, 0x5E, 0x9F }
+
+#define IDE_SECURITY_INTERFACE_GUID \
+ { 0xF4F63529, 0x281E, 0x4040, 0xA3, 0x13, 0xC1, 0xD6, 0x76, 0x63, 0x84, 0xBE }
+
+#define IDE_SMART_INTERFACE_GUID \
+ { 0xFFBD9AD2, 0xF1DB, 0x4F92, 0xA6, 0x49, 0xEB, 0x9E, 0xED, 0xEA, 0x86, 0xB5 }
+
+#define IDE_POWER_MGMT_INTERFACE_GUID \
+ { 0x67BC3883, 0x7E79, 0x4BC1, 0xA3, 0x3E, 0x3A, 0xF7, 0xD1, 0x75, 0x89, 0xBA }
+
+#define IDE_HPA_INTERFACE_GUID\
+ { 0x51AA65FC, 0x82B6, 0x49E6, 0x95, 0xE2, 0xE6, 0x82, 0x7A, 0x8D, 0x7D, 0xB4 }
+
+#define IDE_SETUP_PROTOCOL_GUID\
+ { 0x5578ae16, 0xf1c9, 0x4e8f, 0xb1, 0x29, 0xba, 0x7, 0xf8, 0xfc, 0xf8, 0x4a }
+
+#define HDD_SECURITY_INIT_PROTOCOL_GUID \
+ { 0xce6f86bb, 0xb800, 0x4c71, 0xb2, 0xd1, 0x38, 0x97, 0xa3, 0xbc, 0x1d, 0xae }
+
+#define HDD_SMART_INIT_PROTOCOL_GUID \
+ { 0x9401bd4f, 0x1a00, 0x4990, 0xab, 0x56, 0xda, 0xf0, 0xe4, 0xe3, 0x48, 0xde }
+
+#define HDD_SECURITY_END_PROTOCOL_GUID \
+ { 0xad77ae29, 0x4c20, 0x4fdd, 0x85, 0x04, 0x81, 0x76, 0x61, 0x9b, 0x67, 0x6a }
+
+#define OPAL_SEC_INIT_PROTOCOL_GUID \
+ { 0x59af16b0, 0x661d, 0x4865, 0xa3, 0x81, 0x38, 0xde, 0x68, 0x38, 0x5d, 0x8d }
+
+#define ATA_PASS_THRU_INIT_PROTOCOL_GUID \
+ { 0xc6734411, 0x2dda, 0x4632, 0xa5, 0x92, 0x92, 0x0f, 0x24, 0xd6, 0xed, 0x21 }
+
+#define SCSI_PASS_THRU_ATAPI_INIT_PROTOCOL_GUID \
+ { 0x0fc50878, 0x1633, 0x432a, 0xbd, 0xe4, 0x84, 0x13, 0x57, 0xfc, 0x15, 0xe9 }
+
+#define ONBOARD_RAID_CONTROLLER_GUID \
+ { 0x5d206dd3, 0x516a, 0x47dc, 0xa1, 0xbc, 0x6d, 0xa2, 0x04, 0xaa, 0xbe, 0x08 }
+
+#define HDD_PASSWORD_VERIFIED_GUID \
+ { 0x1fd29be6, 0x70d0, 0x42a4, 0xa6, 0xe7, 0xe5, 0xd1, 0x0e, 0x6a, 0xc3, 0x76 }
+
+#define MASTER_DRIVE 0
+#define SLAVE_DRIVE 1
+#define PRIMARY_CHANNEL 0
+#define SECONDARY_CHANNEL 1
+
+
+#define HOB 0x80
+#define SRST 0x04
+#define nIEN 0x02
+
+#define ABRT 0x04
+
+#define BSY 0x80
+#define DRDY 0x40
+#define DF 0x20
+#define DRQ 0x08
+#define ERR 0x01
+#define CHK 0x01
+
+// Get Media Status ERROR register output
+#define WP 0x40
+#define MC 0x20
+#define MCR 0x08
+#define NM 0x02
+
+// IDE Bus Master status Register
+#define BM_INTERRUPT 0x4
+#define BM_ERROR 0x2
+#define BM_ACTIVE 0x1
+
+// IDE Bus Master Command Register
+#define BM_START_STOP 0x1
+#define DMA_MEMORY_WRITE 0x08
+#define DMA_MEMORY_READ 0x00
+
+
+#define SPIN_UP_REQUIRED1 0x37C8
+#define SPIN_UP_REQUIRED2 0x738c
+
+#define ATAPI_SIGNATURE 0xEB14
+#define ATAPI_FORMAT_UNIT 0x04
+#define ATAPI_INQUIRY 0x12
+#define ATAPI_MODE_SELECT 0x55
+#define ATAPI_MODE_SENSE 0x5A
+#define READ_WRITE_ERROR 0x01
+#define CACHING_PAGE 0x08
+#define REMOVABLE_BLOCK_CAPABILITIES 0x1B
+#define TIMER_PROTECT_PAGE 0x1C
+#define RETURN_ALL_PAGES 0x3F
+#define ATAPI_PREVENT_ALLOW_MEDIA_REMOVAL 0x1E
+#define ATAPI_READ_10 0x28
+#define ATAPI_READ_12 0xA8
+#define ATAPI_READ_CAPACITY 0x25
+#define ATAPI_READ_FORMAT_CAPACITIES 0x23
+#define ATAPI_REQUEST_SENSE 0x03
+#define ATAPI_SEEK 0x2B
+#define ATAPI_START_STOP_UNIT 0x1B
+#define STOP_DISC 0x00
+#define START_DISC 0x01
+#define EJECT_DISC 0x02
+#define LOAD_DISC 0x03
+#define ATAPI_TEST_UNIT_READY 0x00
+#define ATAPI_VERIFY 0x2F
+#define ATAPI_WRITE_10 0x2A
+#define ATAPI_WRITE_12 0xAA
+#define ATAPI_WRITE_AND_VERIFY 0x2E
+#define ATAPI_GET_CONFIGURATION 0x46
+#define GET_PROFILE_LIST 0x00
+#define FEATURE_DISCRIPTOR 0x02
+#define GET_REMOVEABLE_MEDIUM_FEATURE 0x03
+
+
+#define MEDIUM_NOT_PRESENT 0x01
+#define BECOMING_READY 0x02
+#define MEDIA_CHANGED 0x03
+#define DEVICE_ERROR 0x04
+#define WRITE_PROTECTED_MEDIA 0x05
+#define POWER_ON_OR_DEVICE_RESET 0x06
+#define ILLEGAL_REQUEST 0x07
+
+
+#define DEVICE_RESET 0x08
+#define PACKET_COMMAND 0xA0
+#define DMA 0x01
+#define OVL 0x02
+
+#define IDENTIFY_COMMAND 0xEC
+#define IDENTIFY_PACKET_COMMAND 0xA1
+
+#define READ_SECTORS 0x20
+#define READ_SECTORS_EXT 0x24
+#define READ_LOG_EXT_COMMAND 0x2F
+
+#define READ_MULTIPLE 0xC4
+#define READ_MULTIPLE_EXT 0x29
+
+#define WRITE_SECTORS 0x30
+#define WRITE_SECTORS_EXT 0x34
+
+#define WRITE_MULTIPLE 0xC5
+#define WRITE_MULTIPLE_EXT 0x39
+
+#define READ_DMA 0xC8
+#define READ_DMA_EXT 0x25
+
+#define WRITE_DMA 0xCA
+#define WRITE_DMA_EXT 0x35
+
+#define SET_MULTIPLE_MODE 0xC6
+#define GET_MEDIA_STATUS 0xDA
+
+#define SET_FEATURE_COMMAND 0xEF
+#define SET_TRANSFER_MODE 0x03
+#define ADV_POWER_MANAGEMENT 0x05
+#define ENABLE_POWERUP_IN_STANDBY 0x06
+#define SET_DEVICE_SPINUP 0x07
+#define DISABLE_MEDIA_STATUS_NOTIFICATION 0x31
+#define ENABLE_MEDIA_STATUS_NOTIFICATION 0x95
+#define ACOUSTIC_MANAGEMENT_ENABLE 0x42
+#define DISABLE_ADV_POWER_MANAGEMENT 0x85
+#define DISABLE_POWERUP_IN_STANDBY 0x86
+#define ACOUSTIC_MANAGEMENT_DISABLE 0xC2
+#define DISABLE_SATA2_SOFTPREV 0x90
+
+
+#define SECURITY_SET_PASSWORD 0xF1
+#define SECURITY_UNLOCK 0xF2
+#define SECURITY_ERASE_PREPARE 0xF3
+#define SECURITY_ERASE_UNIT 0xF4
+#define SECURITY_FREEZE_LOCK 0xF5
+#define SECURITY_DISABLE_PASSWORD 0xF6
+#define SECURITY_BUFFER_LENGTH 512 // Bytes
+#define DEV_CONFIG_FREEZE_LOCK 0xB1
+#define DEV_CONFIG_FREEZE_LOCK_FEATURES 0xC1
+
+
+#define SMART_COMMAND 0xB0
+#define SMART_READ_DATA 0xD0
+#define SMART_READ_THRESHOLD 0xD1 // (Obsolete)
+#define SMART_AUTOSAVE 0xD2
+#define SMART_EXECUTE_OFFLINE_IMMEDIATE 0xD4
+#define SMART_READLOG 0xD5
+#define SMART_WRITELOG 0xD6
+#define SMART_ENABLE_CMD 0xD8
+#define SMART_DISABLE_CMD 0xD9
+#define SMART_RETURN_STATUS 0xDA
+#define THRESHOLD_NOT_EXCEEDED 0xC24F
+#define THRESHOLD_EXCEEDED 0x2CF4
+#define SMART_ABORT_SELF_TEST_SUBROUTINE 0x7F
+
+//
+// Trusted Commands
+//
+#define TRUSTED_NON_DATA 0x5B
+#define TRUSTED_RECEIVE 0x5C
+#define TRUSTED_SEND 0x5E
+
+//
+// Level 0 Discovery Feature code
+//
+#define TPER_FEATURE_CODE 0x0100
+#define LOCKING_FEATURE_CODE 0x0200
+#define OPAL_SSC_FEATURE_CODE 0x0002
+
+#define PIO_FLOW_CONTROL 0x08
+#define MWDMA_MODE 0x20
+#define UDMA_MODE 0x40
+
+#define ATA_SECTOR_BYTES 512
+#define MAX_SECTOR_COUNT_PIO 256
+#define MAX_SECTOR_COUNT_PIO_48BIT 65536
+#define CDROM_BLOCK_SIZE 2048
+#define LS120_BLOCK_SIZE 512
+
+#define STANDBY_IMMEDIATE 0xE0
+#define IDLE_IMMEDIATE 0xE1
+#define STANDBY_CMD 0xE2
+#define IDLE_CMD 0xE3
+#define CHECK_POWER_MODE 0xE5
+#define SLEEP_CMD 0xE6
+
+#define READ_NATIVE_MAX_ADDRESS 0xF8
+#define READ_NATIVE_MAX_ADDRESS_EXT 0x27
+#define SET_MAX_ADDRESS 0xF9
+#define SET_MAX_SET_PASSWORD 0x01
+#define SET_MAX_LOCK 0x02
+#define SET_MAX_UNLOCK 0x03
+#define SET_MAX_FREEZE_LOCK 0x04
+#define SET_MAX_ADDRESS_EXT 0x37
+
+#define READ_LOG_EXT 0x2F
+#define IDENTIFY_DEVICE_DATA_LOG 0x30
+#define SERIAL_ATA_SETTINGS_PAGE 0x08
+#define DEVSLP_TIMING_VARIABLES_OFFSET 0x30
+#define DEVSLEEP_EXIT_TIMEOUT 20
+#define MINIMUM_DEVSLP_ASSERTION_TIME 10
+
+#define DIRECT_ACCESS_DEVICE 0
+#define SEQUENTIAL_ACCESS_DEVICE 1
+#define WORM 4
+#define CDROM_DEVICE 5
+#define OPTICAL_MEMORY_DEVICE 7
+
+#if (SBIDE_SUPPORT == 0)
+
+// Equates used for Acoustic Flags
+#define ACOUSTIC_SUPPORT_DISABLE 0x00
+#define ACOUSTIC_SUPPORT_ENABLE 0x01
+#define ACOUSTIC_LEVEL_BYPASS 0xFF
+#define ACOUSTIC_LEVEL_MAXIMUM_PERFORMANCE 0xFE
+#define ACOUSTIC_LEVEL_QUIET 0x80
+
+
+/// Equates used for DiPM Support
+#define DiPM_SUB_COMMAND 0x03 // Count value in SetFeature identification : 03h Device-initiated interface power state transitions
+#define DiPM_ENABLE 0x10
+#define DiPM_DISABLE 0x90
+#define IDENTIFY_DiPM_ENABLED 0x08 // Identify Data Word 79 Bit 3 : Device initiating interface power management Enabled
+#define IDENTIFY_DiPM__SUPPORT 0x08 // Identify Data Word 78 Bit 3 : Supports Device initiating interface power management
+#define IDENTIFY_DiPM_HIIPM_REQUESTS_CAPABLE 0x200 // Identify Data Word 76 Bit 9 : Receipt of host-initiated interface power management requests
+
+/// Equates used for DevSleep Support
+#define DEVSLEEP_SUB_COMMAND 0x09 // Count value in SetFeature identification : 09h Device Sleep
+#define DEVSLEEP_ENABLE 0x10
+#define DEVSLEEP_DISABLE 0x90
+#define IDENTIFY_DEVSLEEP_ENABLED 0x100 // Identify Data Word 79 Bit 8 : Device Sleep Enabled
+#define IDENTIFY_DEVSLEEP_SUPPORT 0x100 // Identify Data Word 78 Bit 8 : Supports Device Sleep
+#define IDENTIFY_DEVSLP_TO_REDUCED_PWRSTATE_CAPABLE 0x80 // Identify Data Word 77 Bit 7 : Device Sleep in reduced Power state capable
+
+typedef struct {
+ UINT8 AcousticPwrMgmt;
+ UINT8 AcousticLevel;
+ UINT8 DiPM;
+}IDE_SETUP_PROTOCOL;
+#else
+#include "SBIDE.h"
+#endif
+
+// Equates used for SMART command support
+
+// LOG Address Definition
+#define LOG_DIRECTORY 0x00
+#define SUM_SMART_ERROR_LOG 0x01 //Summary SMART ERROR LOG
+#define COMP_SMART_ERROR_LOG 0x02 //Comprehensive SMART ERROR LOG
+#define SMART_SELFTEST_LOG 0x06
+#define HOST_VENDOR_SPECIFIC 0x80 //0x80 - 0x9F
+#define DEVICE_VENDOR_SPECIFIC 0xA0 //0xA0 - 0xBF
+
+// AUTOSAVE Enable/Disable option
+#define DISABLE_AUTOSAVE 0x00
+#define ENABLE_AUTOSAVE 0xF1
+
+typedef enum {
+ ATA = 0,
+ ATAPI = 1,
+ PMPORT = 2
+} DEVICE_TYPE;
+
+// Forward reference for pure ANSI compatability
+typedef struct _IDE_SMART_INTERFACE IDE_SMART_INTERFACE;
+typedef struct _IDE_SECURITY_PROTOCOL IDE_SECURITY_PROTOCOL;
+typedef struct _IDE_POWER_MGMT_INTERFACE IDE_POWER_MGMT_INTERFACE;
+typedef struct _IDE_HPA_INTERFACE IDE_HPA_INTERFACE;
+typedef struct _HDD_SECURITY_INIT_PROTOCOL HDD_SECURITY_INIT_PROTOCOL;
+typedef struct _OPAL_SECURITY_INIT_PROTOCOL OPAL_SECURITY_INIT_PROTOCOL;
+typedef struct _HDD_SMART_INIT_PROTOCOL HDD_SMART_INIT_PROTOCOL;
+typedef struct _ATA_PASS_THRU_INIT_PROTOCOL ATA_PASS_THRU_INIT_PROTOCOL;
+typedef struct _IDE_BUS_PROTOCOL IDE_BUS_PROTOCOL;
+typedef struct _IDE_BLOCK_IO IDE_BLOCK_IO;
+
+typedef struct _IDE_DISK_INFO{
+ EFI_DISK_INFO_PROTOCOL DiskInfo; // should be the first Entry
+ IDE_BUS_PROTOCOL *IdeBusInterface;
+}IDE_DISK_INFO;
+
+typedef struct _IDE_BLOCK_IO{
+ EFI_BLOCK_IO_PROTOCOL BlkIo; // should be the first Entry
+ IDE_BUS_PROTOCOL *IdeBusInterface;
+}IDE_BLOCK_IO;
+
+typedef EFI_STATUS (*EFI_IDE_ATA_RAED_WRITE_PIO) (
+ IN IDE_BUS_PROTOCOL *This,
+ IN OUT VOID *Buffer,
+ IN UINTN ByteCount,
+ IN UINT64 LBA,
+ IN UINT8 ReadWriteCommand,
+ IN BOOLEAN ReadWrite
+);
+
+typedef EFI_STATUS (*EFI_IDE_ATA_PIO_DATA_IN) (
+ IN IDE_BUS_PROTOCOL *This,
+ OUT VOID *Buffer,
+ IN UINT32 ByteCount,
+ IN UINT8 Features,
+ IN UINT8 SectorCount,
+ IN UINT8 LBALow,
+ IN UINT8 LBAMid,
+ IN UINT8 LBAHigh,
+ IN UINT8 Device,
+ IN UINT8 Command,
+ IN BOOLEAN Multiple
+);
+
+typedef EFI_STATUS (*EFI_IDE_ATA_PIO_DATA_OUT) (
+ IN IDE_BUS_PROTOCOL *This,
+ IN OUT VOID *Buffer,
+ IN UINTN ByteCount,
+ IN UINT8 Features,
+ IN UINT32 SectorCountIn,
+ IN UINT8 LBALow,
+ IN UINT8 LBALowExp,
+ IN UINT8 LBAMid,
+ IN UINT8 LBAMidExp,
+ IN UINT8 LBAHigh,
+ IN UINT8 LBAHighExp,
+ IN UINT8 Device,
+ IN UINT8 Command,
+ IN BOOLEAN ReadWrite,
+ IN BOOLEAN Multiple
+);
+
+typedef EFI_STATUS (*EFI_IDE_NON_DATA_CMD) (
+ IN IDE_BUS_PROTOCOL *This,
+ IN UINT8 Features,
+ IN UINT8 SectorCount,
+ IN UINT8 SectorCountExp,
+ IN UINT8 LBALow,
+ IN UINT8 LBALowExp,
+ IN UINT8 LBAMid,
+ IN UINT8 LBAMidExp,
+ IN UINT8 LBAHigh,
+ IN UINT8 LBAHighExp,
+ IN UINT8 Device,
+ IN UINT8 Command
+
+);
+
+typedef EFI_STATUS (*EFI_WAIT_FOR_CMD_COMPLETE) (
+ IN IDE_BUS_PROTOCOL *This
+);
+
+typedef UINT16 SECURITY_FLAGS;
+// BIT0 : Security Supported
+// BIT1 : Security Enabled
+// BIT2 : Security Locked
+// BIT3 : Security Frozen
+// BIT4 : Security Count Expired
+// BIT5 : Enhanced Security Erase supported
+// BIT6 : Enhanced Security Erase supported
+// BIT8 : Security Level 0:High, 1:Maximum
+
+typedef EFI_STATUS (*EFI_IDE_RETURN_SECURITY_STATUS) (
+ IN IDE_SECURITY_PROTOCOL *This,
+ SECURITY_FLAGS *SecurityStatus
+);
+
+typedef EFI_STATUS (*EFI_IDE_SECURITY_SET_PASSWORD) (
+ IN IDE_SECURITY_PROTOCOL *This,
+ UINT16 Control,
+ UINT8 *Buffer,
+ UINT16 RevisionCode
+);
+
+typedef EFI_STATUS (*EFI_IDE_SECURITY_UNLOCK_PASSWORD) (
+ IN IDE_SECURITY_PROTOCOL *This,
+ UINT16 Control,
+ UINT8 *Buffer
+);
+
+
+typedef EFI_STATUS (*EFI_IDE_SECURITY_DISABLE_PASSWORD) (
+ IN IDE_SECURITY_PROTOCOL *This,
+ UINT16 Control,
+ UINT8 *Buffer
+);
+
+typedef EFI_STATUS (*EFI_IDE_SECURITY_FREEZE_LOCK) (
+ IN IDE_SECURITY_PROTOCOL *This
+);
+
+typedef EFI_STATUS (*EFI_IDE_SECURITY_ERASE_UNIT) (
+ IN IDE_SECURITY_PROTOCOL *This,
+ UINT16 Control,
+ UINT8 *Buffer
+);
+
+typedef UINT32 PASSWORD_FLAGS;
+// IdePasswordFlags:
+// BIT0 User Password Support
+// BIT1 Master Password Support
+// BIT2 Display User Password
+// BIT3 Display Master Password
+// BIT11 OEM Default Master Password
+// BIT16 MasterPassword Set Status.
+// BIT17 UserPassword Set Status.
+
+typedef EFI_STATUS (*EFI_IDE_RETURN_PASSWORD_FLAGS) (
+ IN IDE_SECURITY_PROTOCOL *This,
+ PASSWORD_FLAGS *IdePasswordFlags
+);
+
+typedef EFI_STATUS (*IDE_SMARTRETURNSTATUS) (
+ IN IDE_SMART_INTERFACE *This
+);
+
+typedef EFI_STATUS (*IDE_SMARTSELFTEST) (
+ IN IDE_SMART_INTERFACE *This,
+ IN UINT8 SelfTestType,
+ OUT UINT16 *PollPeriod
+);
+
+typedef EFI_STATUS (*IDE_SMARTABORTSELFTEST) (
+ IN IDE_SMART_INTERFACE *This
+);
+
+typedef EFI_STATUS (*IDE_SENDSMARTCOMMAND) (
+ IN IDE_SMART_INTERFACE *This,
+ IN UINT8 SubCommand,
+ IN UINT8 AutoSaveEnable, //OPTIONAL
+ IN UINT8 SelfTestType //OPTIONAL
+);
+
+typedef EFI_STATUS (*IDE_SMARTREADDATA) (
+ IN IDE_SMART_INTERFACE *This,
+ IN UINT8 SubCommand,
+ OUT VOID *Buffer,
+ IN UINT8 LogAddress, //OPTIONAL
+ IN UINT8 SectorCount //OPTIONAL
+);
+
+typedef EFI_STATUS (*IDE_SMARTWRITEDATA) (
+ IN IDE_SMART_INTERFACE *This,
+ IN UINT8 SubCommand,
+ IN VOID *Buffer,
+ IN UINT8 LogAddress,
+ IN UINT8 SectorCount
+);
+
+typedef EFI_STATUS (*IDE_SMARTGETSMARTDATA) (
+ IN IDE_SMART_INTERFACE *This,
+ OUT UINT8 **SmartData
+);
+
+typedef EFI_STATUS (*IDE_SMARTSELFTESTSTATUS) (
+ IN IDE_SMART_INTERFACE *This,
+ OUT UINT8 *TestStatus
+);
+
+typedef EFI_STATUS (*EFI_IDE_CHECK_POWER_MODE)(
+ IN IDE_POWER_MGMT_INTERFACE *IdePowerMgmtInterface,
+ IN OUT UINT8 *PowerMode
+);
+
+typedef EFI_STATUS (*EFI_IDE_IDLE_MODE)(
+ IN IDE_POWER_MGMT_INTERFACE *IdePowerMgmtInterface,
+ IN UINT8 StandbyTimeout
+);
+
+typedef EFI_STATUS (*EFI_IDE_STANDBY_MODE)(
+ IN IDE_POWER_MGMT_INTERFACE *IdePowerMgmtInterface,
+ IN UINT8 StandbyTimeout
+);
+
+typedef EFI_STATUS (*EFI_IDE_ADVANCE_POWER_MGMT_MODE)(
+ IN IDE_POWER_MGMT_INTERFACE *IdePowerMgmtInterface,
+ IN UINT8 AdvPowerMgmtLevel
+);
+
+typedef EFI_STATUS (*EFI_IDE_GET_NATIVE_MAX_ADDRESS)(
+ IN IDE_HPA_INTERFACE *This,
+ OUT UINT64 *LBA
+);
+
+typedef EFI_STATUS (*EFI_IDE_SET_MAX_ADDRESS)(
+ IN IDE_HPA_INTERFACE *This,
+ OUT UINT64 LBA,
+ IN BOOLEAN Volatile
+);
+
+typedef EFI_STATUS (*EFI_IDE_HPA_DISABLED_LAST_LBA)(
+ IN IDE_HPA_INTERFACE *This,
+ OUT UINT64 *LBA
+);
+
+typedef EFI_STATUS (*EFI_IDE_SET_MAX_PASSWORD)(
+ IN IDE_HPA_INTERFACE *This,
+ IN UINT8 *PasswordBuffer
+);
+
+typedef EFI_STATUS (*EFI_IDE_SET_MAX_LOCK)(
+ IN IDE_HPA_INTERFACE *This
+);
+
+typedef EFI_STATUS (*EFI_IDE_SET_MAX_UNLOCK)(
+ IN IDE_HPA_INTERFACE *This,
+ IN UINT8 *PasswordBuffer
+);
+
+typedef EFI_STATUS (*EFI_IDE_SET_MAX_FREEZE_LOCK)(
+ IN IDE_HPA_INTERFACE *This
+);
+
+typedef EFI_STATUS (EFIAPI *HDD_SECURITY_INSTALL) (
+ IN VOID *BusInterface,
+ IN BOOLEAN ModeFlag
+);
+
+typedef EFI_STATUS (EFIAPI *HDD_SECURITY_UNINSTALL) (
+ IN VOID *BusInterface,
+ IN BOOLEAN ModeFlag
+);
+
+typedef EFI_STATUS (EFIAPI *HDD_SMART_INSTALL) (
+ IN VOID *BusInterface,
+ IN BOOLEAN ModeFlag
+);
+
+typedef EFI_STATUS (EFIAPI *HDD_SMART_UNINSTALL) (
+ IN VOID *BusInterface,
+ IN BOOLEAN ModeFlag
+);
+
+typedef EFI_STATUS (EFIAPI *HDD_SMART_INIT) (
+ IN VOID *BusInterface,
+ IN BOOLEAN ModeFlag
+);
+
+
+#pragma pack(1)
+
+typedef struct {
+ CHAR8 *Language;
+ CHAR16 *UnicodeString;
+} EFI_UNICODE_STRING_TABLE;
+
+
+typedef struct {
+ UINT32 DataLength;
+ UINT8 Reserved[2];
+ UINT16 CurrentProfile;
+} GET_CONFIGURATION_HEADER;
+
+// Based on ATA/ATAPI-6
+typedef struct _IDENTIFY_DATA{
+
+ UINT16 General_Config_0;
+ UINT16 Reserved_1;
+ UINT16 Special_Config_2;
+ UINT16 Reserved_3;
+ UINT16 Reserved_4;
+ UINT16 Reserved_5;
+ UINT16 Reserved_6;
+ UINT16 Reserved_7;
+ UINT16 Reserved_8;
+ UINT16 Reserved_9;
+ UINT8 Serial_Number_10[20];
+ UINT16 Reserved_20;
+ UINT16 Reserved_21;
+ UINT16 Reserved_22;
+ UINT8 Firmware_Revision_23[8];
+ UINT8 Model_Number_27[40];
+ UINT16 Maximum_Sector_Multiple_Command_47;
+ UINT16 Trusted_Computing_Support;
+ UINT16 Capabilities_49;
+ UINT16 Capabilities_50;
+ UINT16 PIO_Mode_51;
+ UINT16 Reserved_52;
+ UINT16 Valid_Bits_53;
+ UINT16 Reserved_54_58[5];
+ UINT16 Valid_Bits_59;
+ UINT32 Addressable_Sector_60;
+ UINT16 SingleWord_DMA_62;
+ UINT16 MultiWord_DMA_63;
+ UINT16 PIO_Mode_64;
+ UINT16 Min_Multiword_DMA_timing_65;
+ UINT16 Manuf_Multiword_DMA_timing_66;
+ UINT16 Min_PIO_Mode_timing_67;
+ UINT16 Min_PIO_Mode_timing_68;
+ UINT16 Reserved_69_74[6];
+ UINT16 Queue_Depth_75;
+ UINT16 Reserved_76_79[4];
+ UINT16 Major_Revision_80;
+ UINT16 Minor_Revision_81;
+ UINT16 Command_Set_Supported_82;
+ UINT16 Command_Set_Supported_83;
+ UINT16 Command_Set_Supported_84;
+ UINT16 Command_Set_Enabled_85;
+ UINT16 Command_Set_Enabled_86;
+ UINT16 Command_Set_Enabled_87;
+ UINT16 UDMA_Mode_88;
+ UINT16 Time_security_Earse_89;
+ UINT16 Time_Esecurity_Earse_90;
+ UINT16 Current_Power_Level_91;
+ UINT16 Master_Password_Rev_92;
+ UINT16 Hard_Reset_Value_93;
+ UINT16 Acoustic_Level_94;
+ UINT16 Reserved_95_99[5];
+ UINT64 LBA_48;
+ UINT16 Reserved_104_126[23];
+ UINT16 Status_Notification_127;
+ UINT16 Security_Status_128;
+ UINT16 Reserved_129_159[31];
+ UINT16 CFA_Power_Mode_160;
+ UINT16 Reserved_161_175[15];
+ UINT16 Media_Serial_Number_176_205[30];
+ UINT16 Reserved_206_254[49];
+ UINT16 Checksum_255;
+} IDENTIFY_DATA;
+
+typedef struct {
+ UINT16 BMCommandRegister;
+ UINT16 Reserved;
+ UINT16 BMStatusRegister;
+ UINT16 BMDescriptorTablePointerReg;
+} BUS_MASTER_IO;
+
+
+typedef struct {
+ UINT32 BaseAddress;
+ UINT16 ByteCount;
+ UINT16 Flag;
+} BUS_MASTER_DESCRIPTOR_TABLE;
+
+
+typedef struct {
+ UINT16 DataReg;
+ UINT16 FeatureReg;
+ UINT16 ErrorReg;
+ UINT16 SectorCountReg;
+ UINT16 LBALowReg;
+ UINT16 LBAMidReg;
+ UINT16 LBAHighReg;
+ UINT16 DeviceReg;
+ UINT16 CommandReg;
+ UINT16 StatusReg;
+} COMMAND_BLOCK;
+
+typedef struct{
+ UINT16 DeviceControlReg;
+ UINT16 AlternateStatusReg;
+} CONTROL_BLOCK;
+
+
+typedef struct {
+ UINT8 IdeBusInitData[2][2];
+ IDE_BUS_PROTOCOL *pIdeBusProtocol[2][2];
+ EFI_IDE_CONTROLLER_INIT_PROTOCOL *EfiIdeControllerInterface;
+ IDE_CONTROLLER_PROTOCOL *IdeControllerInterface;
+ UINT8 BusMasterSelection;
+ UINT8 HPMask;
+ EFI_EVENT HPEvent;
+ UINT8 Flags;
+ UINT8 Acoustic_Management_Level;
+ UINT8 DiPM;
+ UINT16 PrevPortNum;
+ UINT16 PrevPortMultiplierPortNum;
+} IDE_BUS_INIT_PROTOCOL;
+
+typedef struct {
+ COMMAND_BLOCK CommandBlock;
+ CONTROL_BLOCK ControlBlock;
+ BUS_MASTER_IO BusMasterBlock;
+} IO_REGS;
+
+
+typedef enum {
+ Obsolete,
+ Removabledisk,
+ CDROM,
+ CDR,
+ CDRW,
+ DVDROM,
+ DVDRSequentialrecording,
+ DVDRAM,
+ DVDRWRestrictedOverwrite,
+ DVDRWSequentialrecording,
+ DVDRDualLayerSequential,
+ DVDRDualLayerJumprecording,
+ DVDRWDualLayer,
+ DVDDownloaddiscrecording,
+ DVDRW,
+ DVDR,
+ BDROM,
+ BDRSequentialRecording,
+ BDRRandomRecordingMode,
+ BDRE,
+ HDDVDROM,
+ HDDVDR,
+ HDDVDRAM,
+ HDDVDRW,
+ HDDVDRDualLayer,
+ HDDVDRWDualLayer,
+ UnknownType
+} ODD_TYPE;
+
+typedef enum {
+ CaddySlotType,
+ TrayType,
+ PopupType,
+ ReservedType,
+ EmbeddedChangerWithIndividuallyChangeablediscs,
+ EmbeddedChangerUsingCartridgeMmechanism,
+ ReservedLoadingType
+} ODD_LOADING_TYPE;
+
+typedef struct {
+ UINT8 *PacketBuffer;
+ UINT8 DeviceType;
+ UINT8 Lun;
+ UINT8 PacketSize;
+ UINT16 BlockSize;
+ BOOLEAN ReadOnly;
+ UINT8 Atapi_Status;
+ UINT8 *InquiryData;
+ UINT32 InquiryDataSize;
+ ODD_TYPE OddType;
+ ODD_LOADING_TYPE OddLoadingType;
+} ATAPI_DEVICE;
+
+typedef struct _IDE_DEVICE_INTERFACE {
+ IDENTIFY_DATA IdentifyData;
+ UINT8 Channel;
+ UINT8 Device;
+ DEVICE_TYPE DeviceType;
+ UINT8 PIOMode;
+ UINT8 SWDma;
+ UINT8 MWDma;
+ UINT8 UDma;
+ UINT8 IORdy;
+ UINT8 ReadCommand;
+ UINT8 WriteCommand;
+ IO_REGS Regs;
+ EFI_PCI_IO_PROTOCOL *PciIO;
+ EFI_UNICODE_STRING_TABLE *UDeviceName;
+ ATAPI_DEVICE *AtapiDevice;
+} IDE_DEVICE_INTERFACE;
+
+
+typedef struct {
+ UINT32 Signature;
+ UINT8 UserPassword[32];
+ UINT8 MasterPassword[32];
+ UINT16 BaseAddress;
+ UINT16 DeviceControlReg;
+ UINT8 Device; // Master/Slave
+ UINT16 Control;
+ UINT16 RevisionCode;
+ UINT8 PortNumber;
+ UINT8 PMPortNumber;
+ UINT8 BusNo;
+ UINT8 DeviceNo;
+ UINT8 FunctionNo;
+ BOOLEAN ModeFlag;
+ DLINK LinkList;
+} HDD_PASSWORD;
+
+typedef struct _IDE_SMART_INTERFACE{
+ UINT8 Revision;
+ UINT32 Signature;
+ IDE_SMARTSELFTEST SMARTSelfTest;
+ IDE_SMARTSELFTESTSTATUS SMARTSelfTestStatus;
+ IDE_SMARTRETURNSTATUS SMARTReturnStatus;
+ IDE_SENDSMARTCOMMAND SendSmartCommand;
+ IDE_SMARTREADDATA SmartReadData;
+ IDE_SMARTWRITEDATA SmartWriteData;
+ IDE_SMARTABORTSELFTEST SMARTAbortSelfTest;
+ IDE_SMARTGETSMARTDATA SMARTGetSmartData;
+}IDE_SMART_INTERFACE;
+
+
+typedef struct _SMART_INTERFACE{
+
+ UINT8 Revision;
+ UINT32 Signature;
+ IDE_SMARTSELFTEST SMARTSelfTest;
+ IDE_SMARTSELFTESTSTATUS SMARTSelfTestStatus;
+ IDE_SMARTRETURNSTATUS SMARTReturnStatus;
+ IDE_SENDSMARTCOMMAND SendSmartCommand;
+ IDE_SMARTREADDATA SmartReadData;
+ IDE_SMARTWRITEDATA SmartWriteData;
+ IDE_SMARTABORTSELFTEST SMARTAbortSelfTest;
+ IDE_SMARTGETSMARTDATA SMARTGetSmartData;
+ VOID *BusInterface;
+ UINT8 ShortPollingTime;
+ UINT16 ExtPollingTime;
+ BOOLEAN ModeFlag;
+}SMART_INTERFACE;
+
+typedef struct _IDE_SECURITY_PROTOCOL{
+
+ EFI_IDE_RETURN_SECURITY_STATUS ReturnSecurityStatus;
+ EFI_IDE_SECURITY_SET_PASSWORD SecuritySetPassword;
+ EFI_IDE_SECURITY_UNLOCK_PASSWORD SecurityUnlockPassword;
+ EFI_IDE_SECURITY_DISABLE_PASSWORD SecurityDisablePassword;
+ EFI_IDE_SECURITY_FREEZE_LOCK SecurityFreezeLock;
+ EFI_IDE_SECURITY_ERASE_UNIT SecurityEraseUnit;
+ EFI_IDE_RETURN_PASSWORD_FLAGS ReturnIdePasswordFlags;
+
+}IDE_SECURITY_PROTOCOL;
+
+typedef struct _SECURITY_PROTOCOL{
+
+ EFI_IDE_RETURN_SECURITY_STATUS ReturnSecurityStatus;
+ EFI_IDE_SECURITY_SET_PASSWORD SecuritySetPassword;
+ EFI_IDE_SECURITY_UNLOCK_PASSWORD SecurityUnlockPassword;
+ EFI_IDE_SECURITY_DISABLE_PASSWORD SecurityDisablePassword;
+ EFI_IDE_SECURITY_FREEZE_LOCK SecurityFreezeLock;
+ EFI_IDE_SECURITY_ERASE_UNIT SecurityEraseUnit;
+ EFI_IDE_RETURN_PASSWORD_FLAGS ReturnIdePasswordFlags;
+ HDD_PASSWORD *pHDDPasswordBuffer;
+ VOID *BusInterface;
+ BOOLEAN ModeFlag;
+
+}SECURITY_PROTOCOL;
+
+typedef struct _IDE_POWER_MGMT_INTERFACE {
+
+ EFI_IDE_CHECK_POWER_MODE CheckPowerMode;
+ EFI_IDE_IDLE_MODE IdleMode;
+ EFI_IDE_STANDBY_MODE StandbyMode;
+ EFI_IDE_ADVANCE_POWER_MGMT_MODE AdvancePowerMgmtMode;
+
+}IDE_POWER_MGMT_INTERFACE;
+
+typedef struct _POWER_MGMT_INTERFACE {
+
+ EFI_IDE_CHECK_POWER_MODE CheckPowerMode;
+ EFI_IDE_IDLE_MODE IdleMode;
+ EFI_IDE_STANDBY_MODE StandbyMode;
+ EFI_IDE_ADVANCE_POWER_MGMT_MODE AdvancePowerMgmtMode;
+ IDE_BUS_PROTOCOL *IdeBusInterface;
+
+}POWER_MGMT_INTERFACE;
+
+typedef struct _IDE_HPA_INTERFACE {
+
+ EFI_IDE_GET_NATIVE_MAX_ADDRESS GetNativeMaxAddress;
+ EFI_IDE_SET_MAX_ADDRESS SetMaxAddress;
+ EFI_IDE_HPA_DISABLED_LAST_LBA HPADisabledLastLBA;
+ EFI_IDE_SET_MAX_PASSWORD SetMaxPassword;
+ EFI_IDE_SET_MAX_LOCK SetMaxLock;
+ EFI_IDE_SET_MAX_UNLOCK SetMaxUnLock;
+ EFI_IDE_SET_MAX_FREEZE_LOCK SetMaxFreezeLock;
+
+}IDE_HPA_INTERFACE;
+
+typedef struct _HPA_INTERFACE {
+
+ EFI_IDE_GET_NATIVE_MAX_ADDRESS GetNativeMaxAddress;
+ EFI_IDE_SET_MAX_ADDRESS SetMaxAddress;
+ EFI_IDE_HPA_DISABLED_LAST_LBA HPADisabledLastLBA;
+ EFI_IDE_SET_MAX_PASSWORD SetMaxPassword;
+ EFI_IDE_SET_MAX_LOCK SetMaxLock;
+ EFI_IDE_SET_MAX_UNLOCK SetMaxUnLock;
+ EFI_IDE_SET_MAX_FREEZE_LOCK SetMaxFreezeLock;
+ IDE_BUS_PROTOCOL *IdeBusInterface;
+
+}HPA_INTERFACE;
+
+typedef struct _PORT_DRIVE_DATA {
+ UINT8 DriveNumber;
+ UINT8 PortNumber;
+} PORT_DRIVE_DATA;
+
+typedef struct _HDD_SECURITY_INIT_PROTOCOL {
+ HDD_SECURITY_INSTALL InstallSecurityInterface;
+ HDD_SECURITY_UNINSTALL StopSecurityModeSupport;
+} HDD_SECURITY_INIT_PROTOCOL;
+
+typedef struct _HDD_SMART_INIT_PROTOCOL {
+ HDD_SMART_INSTALL InstallSMARTInterface;
+ HDD_SMART_UNINSTALL UnInstallSMARTInterface;
+ HDD_SMART_INIT InitSMARTSupport;
+ BOOLEAN SmartDiagonasticFlag;
+} HDD_SMART_INIT_PROTOCOL;
+
+typedef EFI_STATUS (EFIAPI *OPAL_SECURITY_INSTALL) (
+ IN VOID *BusInterface,
+ IN BOOLEAN ModeFlag
+);
+
+typedef EFI_STATUS (EFIAPI *OPAL_SECURITY_UNINSTALL) (
+ IN VOID *BusInterface,
+ IN BOOLEAN ModeFlag
+);
+
+typedef struct _OPAL_SECURITY_INIT_PROTOCOL {
+ OPAL_SECURITY_INSTALL InstallOpalSecurityInterface;
+ OPAL_SECURITY_UNINSTALL UnInstallOpalSecurityInterface;
+} OPAL_SECURITY_INIT_PROTOCOL;
+
+typedef EFI_STATUS (EFIAPI *ATA_PASS_THRU_INSTALL) (
+ IN VOID *Controller,
+ IN BOOLEAN ModeFlag
+);
+
+typedef EFI_STATUS (EFIAPI *ATA_PASS_THRU_UNINSTALL) (
+ IN VOID *Controller,
+ IN BOOLEAN ModeFlag
+);
+
+typedef struct _ATA_PASS_THRU_INIT_PROTOCOL {
+ ATA_PASS_THRU_INSTALL InstallAtaPassThru;
+ ATA_PASS_THRU_UNINSTALL StopAtaPassThruSupport;
+} ATA_PASS_THRU_INIT_PROTOCOL;
+
+typedef EFI_STATUS (EFIAPI *GENERAL_ATAPI_COMMAND_DATA)(
+ IN IDE_BUS_PROTOCOL *IdeBusInterface,
+ UINT8 *PacketBuffer,
+ UINT8 *Buffer,
+ IN OUT UINT16 *ByteCount );
+
+typedef EFI_STATUS (EFIAPI *SCSI_PASS_THRU_INSTALL) (
+ IN VOID *Controller,
+ IN BOOLEAN ModeFlag
+);
+
+typedef EFI_STATUS (EFIAPI *SCSI_PASS_THRU_UNINSTALL) (
+ IN VOID *Controller,
+ IN BOOLEAN ModeFlag
+);
+
+typedef struct _SCSI_PASS_THRU_ATAPI_INIT_PROTOCOL {
+ SCSI_PASS_THRU_INSTALL InstallScsiPassThruAtapi;
+ SCSI_PASS_THRU_UNINSTALL StopScsiPassThruAtapiSupport;
+} SCSI_PASS_THRU_ATAPI_INIT_PROTOCOL;
+
+
+typedef struct _IDE_BUS_PROTOCOL{
+ IDE_BLOCK_IO *IdeBlkIo;
+ IDE_DISK_INFO *IdeDiskInfo;
+ EFI_DEVICE_PATH_PROTOCOL *DevicePathProtocol;
+ EFI_IDE_CONTROLLER_INIT_PROTOCOL *EfiIdeControllerInterface;
+ EFI_HANDLE IdeControllerInterfaceHandle;
+ IDE_CONTROLLER_PROTOCOL *IdeControllerInterface;
+ SECURITY_PROTOCOL *IdeSecurityInterface;
+ SMART_INTERFACE *SMARTInterface;
+ POWER_MGMT_INTERFACE *PowerMgmtInterface;
+ HPA_INTERFACE *HPAInterface;
+ IDE_BUS_INIT_PROTOCOL *IdeBusInitInterface;
+ EFI_PCI_IO_PROTOCOL *PciIO;
+ EFI_HANDLE IdeDeviceHandle;
+ IDE_DEVICE_INTERFACE IdeDevice;
+ EFI_UNICODE_STRING_TABLE *ControllerNameTable;
+ UINT8 AtapiSenseData[256];
+ UINT8 AtapiSenseDataLength;
+ EFI_IDE_ATA_RAED_WRITE_PIO AtaReadWritePio;
+ EFI_IDE_ATA_PIO_DATA_IN AtaPioDataIn;
+ EFI_IDE_ATA_PIO_DATA_OUT AtaPioDataOut;
+ EFI_IDE_NON_DATA_CMD IdeNonDataCommand;
+ EFI_WAIT_FOR_CMD_COMPLETE WaitForCmdCompletion;
+ GENERAL_ATAPI_COMMAND_DATA GeneralAtapiCommandAndData;
+} IDE_BUS_PROTOCOL;
+
+typedef struct _IDE_BLK_IO_DEV {
+ UINT32 Signature;
+ EFI_HANDLE Handle;
+ EFI_BLOCK_IO_PROTOCOL BlkIo; // should be the first Entry
+ IDE_BUS_PROTOCOL *IdeBusInterface;
+ IDE_DISK_INFO *IdeDiskInfo;
+ EFI_DEVICE_PATH_PROTOCOL *DevicePathProtocol;
+ EFI_IDE_CONTROLLER_INIT_PROTOCOL *EfiIdeControllerInterface;
+ EFI_HANDLE IdeControllerInterfaceHandle;
+ IDE_CONTROLLER_PROTOCOL *IdeControllerInterface;
+ SECURITY_PROTOCOL *IdeSecurityInterface;
+ SMART_INTERFACE *SMARTInterface;
+ POWER_MGMT_INTERFACE *PowerMgmtInterface;
+ HPA_INTERFACE *HPAInterface;
+ IDE_BUS_INIT_PROTOCOL *IdeBusInitInterface;
+ EFI_PCI_IO_PROTOCOL *PciIO;
+ EFI_HANDLE IdeDeviceHandle;
+ IDE_DEVICE_INTERFACE IdeDevice;
+ EFI_UNICODE_STRING_TABLE *ControllerNameTable;
+ UINT8 AtapiSenseData[256];
+} IDE_BLK_IO_DEV;
+
+#define _CR(Record, TYPE, Field) ((TYPE *) ((CHAR8 *) (Record) - (CHAR8 *) &(((TYPE *) 0)->Field)))
+#ifndef CR
+#define CR(record, TYPE, field, signature) _CR(record, TYPE, field)
+#endif
+
+#define EFI_SIGNATURE_16(A, B) ((A) | (B << 8))
+#define EFI_SIGNATURE_32(A, B, C, D) (EFI_SIGNATURE_16 (A, B) | (EFI_SIGNATURE_16 (C, D) << 16))
+
+#define IDE_BLK_IO_DEV_SIGNATURE EFI_SIGNATURE_32 ('i', 'b', 'i', 'd')
+#define IDE_BLOCK_IO_DEV_FROM_THIS(a) CR (a, IDE_BLK_IO_DEV, BlkIo, IDE_BLK_IO_DEV_SIGNATURE)
+
+
+
+#pragma pack()
+
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#endif // #ifndef GUID_VARIABLE_DEFINITION
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2013, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Pkwy, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
diff --git a/Include/Protocol/PIDEController.h b/Include/Protocol/PIDEController.h
new file mode 100644
index 0000000..196d342
--- /dev/null
+++ b/Include/Protocol/PIDEController.h
@@ -0,0 +1,151 @@
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
+
+//*************************************************************************
+// $Header: /Alaska/BIN/Chipset/Intel/SouthBridge/LynxPoint/Intel Pch SB Chipset/SB Protocols/PIDEController.h 1 2/08/12 8:26a Yurenlai $
+//
+// $Revision: 1 $
+//
+// $Date: 2/08/12 8:26a $
+//*************************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Chipset/Intel/SouthBridge/LynxPoint/Intel Pch SB Chipset/SB Protocols/PIDEController.h $
+//
+// 1 2/08/12 8:26a Yurenlai
+// Intel Lynx Point/SB eChipset initially releases.
+//
+//*************************************************************************
+//<AMI_FHDR_START>
+//
+// Name: PIDEController.h
+//
+// Description: The header file for the south bridge ATA controller(s).
+//
+//<AMI_FHDR_END>
+//*************************************************************************
+
+#ifndef _PIDEController_
+#define _PIDEController_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define IDE_CONTROLLER_PROTOCOL_GUID \
+ {0x20E28787, 0xDF32, 0x4BDA, 0xB7, 0xE7, 0xCB, 0xBD, 0xA3, 0x37, 0x1E, 0xF8}
+
+#define SATA_CONTROLLER_PROTOCOL_GUID \
+ {0x2acb6627, 0xdf02, 0x4e23, 0xb4, 0xf9, 0x6a, 0x93, 0xfa, 0x6e, 0x9d, 0xa6}
+
+// Forward reference for pure ANSI compatability
+typedef struct _IDE_CONTROLLER_PROTOCOL IDE_CONTROLLER_PROTOCOL;
+typedef struct _IDENTIFY_DATA IDENTIFY_DATA;
+typedef struct _IDE_DEVICE_INTERFACE IDE_DEVICE_INTERFACE;
+typedef struct _IDE_BUS_PROTOCOL IDE_BUS_PROTOCOL;
+
+#pragma pack(1)
+
+typedef struct {
+ UINT8 Register;
+ UINT8 And_Mask;
+ UINT8 Or_Mask;
+} IDE_CONTROLLER_INIT_DATA;
+
+
+// Equates used for Flag
+#define Acoustic_Support_Enable 0x01
+#define S3_RESUME_UNLOCK_HDD_PASSWORD 0x02 // Set bit 1 in Flags only
+ // if HDD loses power in S3
+ // state.
+
+typedef struct {
+ UINT8 PrimaryChannel;
+ UINT8 PrimaryMasterDevice;
+ UINT8 PrimarySlaveDevice;
+ UINT8 SecondaryChannel;
+ UINT8 SecondaryMasterDevice;
+ UINT8 SecondarySlaveDevice;
+ UINT8 BusMasterEnable;
+ UINT8 HPMask;
+ UINT8 Flags;
+ UINT8 Acoustic_Management_Level;
+} CONTROLLER_INFO;
+
+typedef EFI_STATUS (*EFI_IDE_CONTROLLER_SET_PIO_TIMING) (
+ IDE_DEVICE_INTERFACE *IdeDevice
+);
+
+typedef EFI_STATUS (*EFI_IDE_CONTROLLER_SET_DMA_TIMING) (
+ IDE_DEVICE_INTERFACE *IdeDevice
+);
+
+typedef EFI_STATUS (*EFI_IDE_CONTROLLER_GET_MODE) (
+ IDE_DEVICE_INTERFACE *IdeDevice
+);
+
+typedef EFI_STATUS (*EFI_IDE_CONTROLLER_GET_CONTROLLER_INFO) (
+ IN EFI_HANDLE Controller,
+ IN OUT CONTROLLER_INFO *ControllerInfo
+);
+
+typedef EFI_STATUS (*EFI_IDE_HP_DEVICE_CHANGE) (
+ EFI_PCI_IO_PROTOCOL *PciIO,
+ UINT8 HPMask,
+ UINT8 *CurrentStatus
+);
+
+
+typedef EFI_STATUS (*EFI_IDE_DISABLE_ENABLE_CHANNEL) (
+ EFI_PCI_IO_PROTOCOL *PciIO,
+ UINT8 Channel,
+ UINT8 Device,
+ BOOLEAN DisableEnable
+);
+
+typedef struct _IDE_CONTROLLER_PROTOCOL {
+ UINT8 Max_Channel;
+ EFI_PCI_IO_PROTOCOL *PciIO;
+ EFI_HANDLE ControllerHandle;
+ EFI_IDE_CONTROLLER_GET_CONTROLLER_INFO IdeGetControllerInfo;
+ EFI_IDE_CONTROLLER_SET_PIO_TIMING IdeSetPioMode;
+ EFI_IDE_CONTROLLER_SET_DMA_TIMING IdeSetDmaMode;
+ EFI_IDE_CONTROLLER_GET_MODE GetbestPioDmaMode;
+ EFI_IDE_HP_DEVICE_CHANGE HPCheckForDeviceChange;
+ EFI_IDE_DISABLE_ENABLE_CHANNEL HPDisableEnableChannel;
+ CHAR16 * Controllername;
+}IDE_CONTROLLER_PROTOCOL;
+
+#pragma pack()
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
diff --git a/Include/Protocol/PciHostBridgeResourceAllocation.h b/Include/Protocol/PciHostBridgeResourceAllocation.h
new file mode 100644
index 0000000..0577328
--- /dev/null
+++ b/Include/Protocol/PciHostBridgeResourceAllocation.h
@@ -0,0 +1,363 @@
+//**********************************************************************//
+//**********************************************************************//
+//** **//
+//** (C)Copyright 1985-2004, American Megatrends, Inc. **//
+//** **//
+//** All Rights Reserved. **//
+//** **//
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **//
+//** **//
+//** Phone: (770)-246-8600 **//
+//** **//
+//**********************************************************************//
+//**********************************************************************//
+
+//**********************************************************************
+// $Header: /Alaska/BIN/Core/Include/Protocol/PciHostBridgeResourceAllocation.h 2 3/13/06 1:40a Felixp $
+//
+// $Revision: 2 $
+//
+// $Date: 3/13/06 1:40a $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Core/Include/Protocol/PciHostBridgeResourceAllocation.h $
+//
+// 2 3/13/06 1:40a Felixp
+//
+// 1 11/04/05 6:36p Yakovlevs
+//
+// 1 4/18/05 5:42p Yakovlevs
+// Host Brg Resource Allocation Protocol
+//
+//*****************************************************************************
+//<AMI_FHDR_START>
+//
+// Name: PciHostBridgeResourceAllocation.h
+//
+// Description: This file is an include file used to define the Protocol and
+// definitions for the Pci Host Bridge Resource Allocation.
+//
+//<AMI_FHDR_END>
+//*****************************************************************************
+#ifndef __PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL_H__
+#define __PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL_H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+#include <EFI.h>
+
+#define EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL_GUID \
+ { 0xCF8034BE,0x6768,0x4d8b,0xB7,0x39,0x7C,0xCE,0x68,0x3A,0x9F,0xBE }
+
+GUID_VARIABLE_DECLARATION(gEfiPciHostBridgeResourceAllocationProtocolGuid,EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL_GUID);
+
+#ifndef GUID_VARIABLE_DEFINITION
+#include <Protocol/PciRootBridgeIo.h>
+
+typedef struct _EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL;
+
+
+//----------------------------------------------------------------------------
+// EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_ATTRIBUTES
+//----------------------------------------------------------------------------
+// If this bit is set, then the PCI Root Bridge does not
+// support separate windows for Non-prefetchable and Prefetchable
+// memory. A PCI bus driver needs to include requests for Prefetchable
+// memory in the Non-prefetchable memory pool.
+#define EFI_PCI_HOST_BRIDGE_COMBINE_MEM_PMEM 1
+
+//----------------------------------------------------------------------------
+// If this bit is set, then the PCI Root Bridge supports
+// 64 bit memory windows. If this bit is not set,
+// the PCI bus driver needs to include requests for 64 bit
+// memory address in the corresponding 32 bit memory pool.
+#define EFI_PCI_HOST_BRIDGE_MEM64_DECODE 2
+
+
+//----------------------------------------------------------------------------
+// EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PHASE
+//----------------------------------------------------------------------------
+typedef enum {
+ EfiPciHostBridgeBeginEnumeration,
+ EfiPciHostBridgeBeginBusAllocation,
+ EfiPciHostBridgeEndBusAllocation,
+ EfiPciHostBridgeBeginResourceAllocation,
+ EfiPciHostBridgeAllocateResources,
+ EfiPciHostBridgeSetResources,
+ EfiPciHostBridgeFreeResources,
+ EfiPciHostBridgeEndResourceAllocation
+} EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PHASE;
+
+//----------------------------------------------------------------------------
+// EfiPciHostBridgeBeginEnumeration
+// Reset the host bridge PCI apertures and internal data structures.
+// PCI enumerator should issue this notification before starting fresh
+// enumeration process. Enumeration cannot be restarted after sending
+// any other notification such as EfiPciHostBridgeBeginBusAllocation.
+//
+// EfiPciHostBridgeBeginBusAllocation
+// The bus allocation phase is about to begin. No specific action
+// is required here. This notification can be used to perform any
+// chipset specific programming.
+//
+// EfiPciHostBridgeEndBusAllocation
+// The bus allocation and bus programming phase is complete. No specific
+// action is required here. This notification can be used to perform any
+// chipset specific programming.
+//
+// EfiPciHostBridgeBeginResourceAllocation
+// The resource allocation phase is about to begin.No specific action is
+// required here. This notification can be used to perform any chipset specific programming.
+//
+// EfiPciHostBridgeAllocateResources
+// Allocate resources per previously submitted requests for all the PCI Root
+// Bridges. These resource settings are returned on the next call to
+// GetProposedResources().
+//
+// EfiPciHostBridgeSetResources
+// Program the Host Bridge hardware to decode previously allocated resources
+// (proposed resources) for all the PCI Root Bridges.
+//
+// EfiPciHostBridgeFreeResources
+// De-allocate previously allocated resources previously for all the PCI
+// Root Bridges and reset the I/O and memory apertures to initial state.
+//
+// EfiPciHostBridgeEndResourceAllocation
+// The resource allocation phase is completed. No specific action is required
+// here. This notification can be used to perform any chipset specific programming.
+
+//----------------------------------------------------------------------------
+// EFI_PCI_CONTROLLER_RESOURCE_ALLOCATION_PHASE
+//----------------------------------------------------------------------------
+typedef enum {
+ EfiPciBeforeChildBusEnumeration,
+ EfiPciBeforeResourceCollection
+} EFI_PCI_CONTROLLER_RESOURCE_ALLOCATION_PHASE;
+
+//----------------------------------------------------------------------------
+// EfiPciBeforeChildBusEnumeration
+// This notification is only applicable to PCI-PCI bridges and
+// indicates that the PCI enumerator is about to begin enumerating
+// the bus behind the PCI-PCI Bridge. This notification is sent after
+// the primary bus number, the secondary bus number and the subordinate
+// bus number registers in the PCI-PCI Bridge are programmed to valid
+// (not necessary final) values
+//
+// EfiPciBeforeResourceCollection
+// This notification is sent before the PCI enumerator probes BAR registers
+// for every valid PCI function.
+//
+
+//----------------------------------------------------------------------------
+//Description:
+// Enter a certain phase of the PCI enumeration process
+//
+//Input:
+// This -- The EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL instance
+// Phase -- The phase during enumeration
+//
+//Output:
+// EFI_SUCCESS - Success
+// EFI_OUT_OF_RESOURCES - If SubmitResources ( ) could not allocate resources
+// EFI_NOT_READY - This phase cannot be entered at this time
+// EFI_DEVICE_ERROR - SetResources failed due to HW error.
+//----------------------------------------------------------------------------
+typedef EFI_STATUS (EFIAPI *EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL_NOTIFY_PHASE)(
+ IN EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL *This,
+ IN EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PHASE Phase );
+
+//----------------------------------------------------------------------------
+//Description:
+// Return the device handle of the next PCI root bridge that is associated with
+// this Host Bridge
+//
+//Input:
+// This -- The EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_ PROTOCOL instance
+// RootBridgeHandle -- Returns the device handle of the next PCI Root Bridge.
+// On input, it holds the RootBridgeHandle returned by the most
+// recent call to GetNextRootBridge().The handle for the first
+// PCI Root Bridge is returned if RootBridgeHandle is NULL on input
+//
+//Output:
+// EFI_SUCCESS - Success
+// EFI_INVALID_PARAMETER - RootBridgeHandle is invalid
+//----------------------------------------------------------------------------
+typedef EFI_STATUS (EFIAPI *EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL_GET_NEXT_ROOT_BRIDGE)(
+ IN EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL *This,
+ IN OUT EFI_HANDLE *RootBridgeHandle);
+
+
+//----------------------------------------------------------------------------
+//Routine Description:
+// Returns the attributes of a PCI Root Bridge.
+//
+//Input:
+// This -- The EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_ PROTOCOL instance
+// RootBridgeHandle -- The device handle of the PCI Root Bridge
+// that the caller is interested in
+// Attribute -- The pointer to attributes of the PCI Root Bridge
+//
+//Output:
+// EFI_SUCCESS - Success
+// EFI_INVALID_PARAMETER - RootBridgeHandle is invalid
+// EFI_INVALID_PARAMETER - Attributes is NULL
+//----------------------------------------------------------------------------
+typedef EFI_STATUS (EFIAPI * EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL_GET_ATTRIBUTES)(
+ IN EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL *This,
+ IN EFI_HANDLE RootBridgeHandle,
+ OUT UINT64 *Attributes);
+
+
+//----------------------------------------------------------------------------
+//Routine Description:
+// This is the request from the PCI enumerator to set up
+// the specified PCI Root Bridge for bus enumeration process.
+//
+//Arguments:
+// This -- The EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_ PROTOCOL instance
+// RootBridgeHandle -- The PCI Root Bridge to be set up
+// Configuration -- Pointer to the pointer to the PCI bus resource descriptor
+//
+//Returns:
+// EFI_SUCCESS - Success
+// EFI_INVALID_PARAMETER - RootBridgeHandle is invalid
+// EFI_DEVICE_ERROR - Request failed due to hardware error
+// EFI_OUT_OF_RESOURCES - Request failed due to lack of resources
+//----------------------------------------------------------------------------
+typedef EFI_STATUS(EFIAPI *EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL_START_BUS_ENUMERATION)(
+ IN EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL *This,
+ IN EFI_HANDLE RootBridgeHandle,
+ OUT VOID **Configuration);
+
+
+//----------------------------------------------------------------------------
+//Routine Description:
+// This function programs the PCI Root Bridge hardware so that
+// it decodes the specified PCI bus range
+//
+//Arguments:
+// This -- The EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_ PROTOCOL instance
+// RootBridgeHandle -- The PCI Root Bridge whose bus range is to be programmed
+// Configuration -- The pointer to the PCI bus resource descriptor
+//
+//Returns:
+// EFI_SUCCESS - Success
+// EFI_INVALID_PARAMETER - RootBridgeHandle is invalid
+// EFI_INVALID_PARAMETER - Configuration is NULL
+// EFI_INVALID_PARAMETER - Configuration does not point to a valid ACPI resource descriptor
+// EFI_INVALID_PARAMETER - Configuration contains one or more memory or IO ACPI resource descriptor
+// EFI_INVALID_PARAMETER - Address Range Minimum or Address Range Length fields in Configuration
+// are invalid for this Root Bridge.
+// EFI_INVALID_PARAMETER - Configuration contains one or more invalid ACPI resource descriptor
+// EFI_DEVICE_ERROR - Request failed due to hardware error
+// EFI_OUT_OF_RESOURCES - Request failed due to lack of resources
+//----------------------------------------------------------------------------
+typedef EFI_STATUS(EFIAPI *EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL_SET_BUS_NUMBERS)(
+ IN EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL *This,
+ IN EFI_HANDLE RootBridgeHandle,
+ IN VOID *Configuration);
+
+
+//----------------------------------------------------------------------------
+//Routine Description:
+// Submits the I/O and memory resource requirements for the specified PCI Root Bridge
+//
+//Arguments:
+// This -- The EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_ PROTOCOL instance
+// RootBridgeHandle -- The PCI Root Bridge whose I/O and memory resource requirements
+// are being submitted
+// Configuration -- The pointer to the PCI I/O and PCI memory resource descriptor
+//Returns:
+// EFI_SUCCESS - Success
+// EFI_INVALID_PARAMETER - RootBridgeHandle is invalid
+// EFI_INVALID_PARAMETER - Configuration is NULL
+// EFI_INVALID_PARAMETER - Configuration does not point to a valid ACPI resource descriptor
+// EFI_INVALID_PARAMETER - Configuration includes a resource descriptor of unsupported type
+//----------------------------------------------------------------------------
+typedef EFI_STATUS(EFIAPI * EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL_SUBMIT_RESOURCES)(
+ IN EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL *This,
+ IN EFI_HANDLE RootBridgeHandle,
+ IN VOID *Configuration);
+
+
+//----------------------------------------------------------------------------
+//Routine Description:
+// This function returns the proposed resource settings for the specified
+// PCI Root Bridge
+//
+//Arguments:
+// This -- The EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_ PROTOCOL instance
+// RootBridgeHandle -- The PCI Root Bridge handle
+// Configuration -- The pointer to the pointer to the PCI I/O
+// and memory resource descriptor
+//Returns:
+// EFI_SUCCESS - Success
+// EFI_INVALID_PARAMETER - RootBridgeHandle is invalid
+// EFI_DEVICE_ERROR - Request failed due to hardware error
+// EFI_OUT_OF_RESOURCES - Request failed due to lack of resources
+//----------------------------------------------------------------------------
+typedef EFI_STATUS(EFIAPI * EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL_GET_PROPOSED_RESOURCES)(
+ IN EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL *This,
+ IN EFI_HANDLE RootBridgeHandle,
+ OUT VOID **Configuration);
+
+
+//----------------------------------------------------------------------------
+//Routine Description:
+// This function is called for all the PCI controllers that the PCI
+// bus driver finds. Can be used to Preprogram the controller.
+//
+//Arguments:
+// This -- The EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_ PROTOCOL instance
+// RootBridgeHandle -- The PCI Root Bridge handle
+// PciBusAddress -- Address of the controller on the PCI bus
+// Phase -- The Phase during resource allocation
+//
+//Returns:
+// EFI_SUCCESS - Success
+// EFI_INVALID_PARAMETER - RootBridgeHandle is invalid
+// EFI_DEVICE_ERROR - Device pre-initialization failed due to hardware error.
+//----------------------------------------------------------------------------
+typedef EFI_STATUS(EFIAPI * EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL_PREPROCESS_CONTROLLER)(
+ IN EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL *This,
+ IN EFI_HANDLE RootBridgeHandle,
+ IN EFI_PCI_CONFIGURATION_ADDRESS PciAddress,
+ IN EFI_PCI_CONTROLLER_RESOURCE_ALLOCATION_PHASE Phase);
+
+
+//----------------------------------------------------------------------------
+// The Protocol itself
+//----------------------------------------------------------------------------
+typedef struct _EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL {
+ EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL_NOTIFY_PHASE NotifyPhase;
+ EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL_GET_NEXT_ROOT_BRIDGE GetNextRootBridge;
+ EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL_GET_ATTRIBUTES GetAllocAttributes;
+ EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL_START_BUS_ENUMERATION StartBusEnumeration;
+ EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL_SET_BUS_NUMBERS SetBusNumbers;
+ EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL_SUBMIT_RESOURCES SubmitResources;
+ EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL_GET_PROPOSED_RESOURCES GetProposedResources;
+ EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL_PREPROCESS_CONTROLLER PreprocessController;
+} EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL;
+
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#endif // #ifndef GUID_VARIABLE_DEFINITION
+#ifdef __cplusplus
+}
+#endif
+#endif //_PCI_HB_RES_ALLOC_
+
+//**********************************************************************//
+//**********************************************************************//
+//** **//
+//** (C)Copyright 1985-2004, American Megatrends, Inc. **//
+//** **//
+//** All Rights Reserved. **//
+//** **//
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **//
+//** **//
+//** Phone: (770)-246-8600 **//
+//** **//
+//**********************************************************************//
+//**********************************************************************// \ No newline at end of file
diff --git a/Include/Protocol/PciHotPlugInit.h b/Include/Protocol/PciHotPlugInit.h
new file mode 100644
index 0000000..38a5d7b
--- /dev/null
+++ b/Include/Protocol/PciHotPlugInit.h
@@ -0,0 +1,119 @@
+//**********************************************************************//
+//**********************************************************************//
+//** **//
+//** (C)Copyright 1985-2005, American Megatrends, Inc. **//
+//** **//
+//** All Rights Reserved. **//
+//** **//
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **//
+//** **//
+//** Phone: (770)-246-8600 **//
+//** **//
+//**********************************************************************//
+//**********************************************************************//
+
+//**********************************************************************
+// $Header: /Alaska/BIN/Core/Include/Protocol/PciHotPlugInit.h 2 3/13/06 1:40a Felixp $
+//
+// $Revision: 2 $
+//
+// $Date: 3/13/06 1:40a $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Core/Include/Protocol/PciHotPlugInit.h $
+//
+// 2 3/13/06 1:40a Felixp
+//
+//**********************************************************************
+//<AMI_FHDR_START>
+//
+// Name: <This File Name>
+//
+// Description:
+//
+//<AMI_FHDR_END>
+//**********************************************************************
+#ifndef __PCI_HOT_PLUG_INIT_PROTOCOL_H__
+#define __PCI_HOT_PLUG_INIT_PROTOCOL_H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+/****** DO NOT WRITE ABOVE THIS LINE *******/
+#include <EFI.h>
+
+//**********************************************************************
+#define EFI_PCI_HOT_PLUG_INIT_PROTOCOL_GUID \
+ { 0xaa0e8bc1, 0xdabc, 0x46b0, 0xa8, 0x44, 0x37, 0xb8, 0x16, 0x9b, 0x2b, 0xea }
+
+GUID_VARIABLE_DECLARATION(gEfiPciHotPlugInitProtocolGuid,EFI_PCI_HOT_PLUG_INIT_PROTOCOL_GUID);
+
+typedef struct _EFI_PCI_HOT_PLUG_INIT_PROTOCOL EFI_PCI_HOT_PLUG_INIT_PROTOCOL;
+
+#define EFI_HPC_STATE_INITIALIZED 0x01
+#define EFI_HPC_STATE_ENABLED 0x02
+
+typedef UINT16 EFI_HPC_STATE;
+
+typedef struct{
+ EFI_DEVICE_PATH_PROTOCOL *HpcDevicePath;
+ EFI_DEVICE_PATH_PROTOCOL *HpbDevicePath;
+} EFI_HPC_LOCATION;
+
+
+typedef enum{
+ EfiPaddingPciBus,
+ EfiPaddingPciRootBridge
+}EFI_HPC_PADDING_ATTRIBUTES;
+
+typedef EFI_STATUS (EFIAPI *EFI_GET_ROOT_HPC_LIST)(
+ IN EFI_PCI_HOT_PLUG_INIT_PROTOCOL *This,
+ OUT UINTN *HpcCount,
+ OUT EFI_HPC_LOCATION **HpcList
+);
+
+typedef EFI_STATUS (EFIAPI *EFI_INITIALIZE_ROOT_HPC)(
+ IN EFI_PCI_HOT_PLUG_INIT_PROTOCOL *This,
+ IN EFI_DEVICE_PATH_PROTOCOL *HpcDevicePath,
+ IN UINT64 HpcPciAddress,
+ IN EFI_EVENT Event, OPTIONAL
+ OUT EFI_HPC_STATE *HpcState
+);
+
+typedef EFI_STATUS (EFIAPI *EFI_GET_PCI_HOT_PLUG_PADDING)(
+ IN EFI_PCI_HOT_PLUG_INIT_PROTOCOL *This,
+ IN EFI_DEVICE_PATH_PROTOCOL *HpcDevicePath,
+ IN UINT64 HpcPciAddress,
+ OUT EFI_HPC_STATE *HpcState,
+ OUT VOID **Padding,
+ OUT EFI_HPC_PADDING_ATTRIBUTES *Attributes
+);
+
+
+// Prototypes for the PCI Hot Plug Init Protocol
+typedef struct _EFI_PCI_HOT_PLUG_INIT_PROTOCOL {
+ EFI_GET_ROOT_HPC_LIST GetRootHpcList;
+ EFI_INITIALIZE_ROOT_HPC InitializeRootHpc;
+ EFI_GET_PCI_HOT_PLUG_PADDING GetResourcePadding;
+} EFI_PCI_HOT_PLUG_INIT_PROTOCOL;
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+
+//**********************************************************************//
+//**********************************************************************//
+//** **//
+//** (C)Copyright 1985-2005, American Megatrends, Inc. **//
+//** **//
+//** All Rights Reserved. **//
+//** **//
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **//
+//** **//
+//** Phone: (770)-246-8600 **//
+//** **//
+//**********************************************************************//
+//**********************************************************************//
diff --git a/Include/Protocol/PciIo.h b/Include/Protocol/PciIo.h
new file mode 100644
index 0000000..58f2abf
--- /dev/null
+++ b/Include/Protocol/PciIo.h
@@ -0,0 +1,306 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2005, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/BIN/Core/Include/Protocol/PciIo.h 4 10/01/08 12:56p Yakovlevs $
+//
+// $Revision: 4 $
+//
+// $Date: 10/01/08 12:56p $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Core/Include/Protocol/PciIo.h $
+//
+// 4 10/01/08 12:56p Yakovlevs
+// UEFI 2.1 PciIo Attributes definitions added.
+//
+// 3 3/13/06 1:40a Felixp
+//
+// 2 3/04/05 10:36a Mandal
+//
+
+//**********************************************************************
+//<AMI_FHDR_START>
+//
+// Name: PciIo.h
+//
+// Description:
+//
+//<AMI_FHDR_END>
+//**********************************************************************
+#ifndef __PCI_IO_PROTOCOL_H__
+#define __PCI_IO_PROTOCOL_H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+#include <EFI.h>
+
+// Global ID for the PCI I/O Protocol
+#define EFI_PCI_IO_PROTOCOL_GUID \
+ { 0x4cf5b200, 0x68b8, 0x4ca5, 0x9e, 0xec, 0xb2, 0x3e, 0x3f, 0x50, 0x2, 0x9a }
+
+GUID_VARIABLE_DECLARATION(gEfiPciIoProtocolGuid,EFI_PCI_IO_PROTOCOL_GUID);
+
+// Prototypes for the PCI I/O Protocol
+typedef enum {
+ EfiPciIoWidthUint8 = 0,
+ EfiPciIoWidthUint16,
+ EfiPciIoWidthUint32,
+ EfiPciIoWidthUint64,
+ EfiPciIoWidthFifoUint8,
+ EfiPciIoWidthFifoUint16,
+ EfiPciIoWidthFifoUint32,
+ EfiPciIoWidthFifoUint64,
+ EfiPciIoWidthFillUint8,
+ EfiPciIoWidthFillUint16,
+ EfiPciIoWidthFillUint32,
+ EfiPciIoWidthFillUint64,
+ EfiPciIoWidthMaximum
+} EFI_PCI_IO_PROTOCOL_WIDTH;
+
+//Complete PCI address generater
+#define EFI_PCI_IO_PASS_THROUGH_BAR 0xff // Special BAR that passes a memory or I/O cycle through unchanged
+
+#define EFI_PCI_IO_ATTRIBUTE_MASK 0x077f // All the following I/O and Memory cycles
+
+#define EFI_PCI_IO_ATTRIBUTE_ISA_MOTHERBOARD_IO 0x0001 // I/O cycles 0x0000-0x00FF (10 bit decode)
+#define EFI_PCI_IO_ATTRIBUTE_ISA_IO 0x0002 // I/O cycles 0x0100-0x03FF or greater (10 bit decode)
+#define EFI_PCI_IO_ATTRIBUTE_VGA_PALETTE_IO 0x0004 // I/O cycles 0x3C6, 0x3C8, 0x3C9 (10 bit decode)
+#define EFI_PCI_IO_ATTRIBUTE_VGA_MEMORY 0x0008 // MEM cycles 0xA0000-0xBFFFF (24 bit decode)
+#define EFI_PCI_IO_ATTRIBUTE_VGA_IO 0x0010 // I/O cycles 0x3B0-0x3BB and 0x3C0-0x3DF (10 bit decode)
+#define EFI_PCI_IO_ATTRIBUTE_IDE_PRIMARY_IO 0x0020 // I/O cycles 0x1F0-0x1F7, 0x3F6, 0x3F7 (10 bit decode)
+#define EFI_PCI_IO_ATTRIBUTE_IDE_SECONDARY_IO 0x0040 // I/O cycles 0x170-0x177, 0x376, 0x377 (10 bit decode)
+#define EFI_PCI_IO_ATTRIBUTE_MEMORY_WRITE_COMBINE 0x0080 // Map a memory range so write are combined
+#define EFI_PCI_IO_ATTRIBUTE_IO 0x0100 // Enable the I/O decode bit in the PCI Config Header
+#define EFI_PCI_IO_ATTRIBUTE_MEMORY 0x0200 // Enable the Memory decode bit in the PCI Config Header
+#define EFI_PCI_IO_ATTRIBUTE_BUS_MASTER 0x0400 // Enable the DMA bit in the PCI Config Header
+#define EFI_PCI_IO_ATTRIBUTE_MEMORY_CACHED 0x0800 // Map a memory range so all r/w accesses are cached
+#define EFI_PCI_IO_ATTRIBUTE_MEMORY_DISABLE 0x1000 // Disable a memory range
+#define EFI_PCI_IO_ATTRIBUTE_EMBEDDED_DEVICE 0x2000 // Clear for an add-in PCI Device
+#define EFI_PCI_IO_ATTRIBUTE_EMBEDDED_ROM 0x4000 // Clear for a physical PCI Option ROM accessed through ROM BAR
+#define EFI_PCI_IO_ATTRIBUTE_DUAL_ADDRESS_CYCLE 0x8000 // Clear for PCI controllers that can not genrate a DAC
+//UEFI 2.1 Update
+#define EFI_PCI_IO_ATTRIBUTE_ISA_IO_16 0x10000 // I/O cycles 0x0100-0x03FF or greater (16 bit decode)
+#define EFI_PCI_IO_ATTRIBUTE_VGA_PALETTE_IO_16 0x20000 // I/O cycles 0x3C6, 0x3C8, 0x3C9 (16 bit decode)
+#define EFI_PCI_IO_ATTRIBUTE_VGA_IO_16 0x40000 // I/O cycles 0x3B0-0x3BB and 0x3C0-0x3DF (16 bit decode)
+
+#define EFI_PCI_DEVICE_ENABLE (EFI_PCI_IO_ATTRIBUTE_IO | EFI_PCI_IO_ATTRIBUTE_MEMORY | EFI_PCI_IO_ATTRIBUTE_BUS_MASTER)
+#define EFI_VGA_DEVICE_ENABLE (EFI_PCI_IO_ATTRIBUTE_VGA_PALETTE_IO | EFI_PCI_IO_ATTRIBUTE_VGA_MEMORY | EFI_PCI_IO_ATTRIBUTE_VGA_IO | EFI_PCI_IO_ATTRIBUTE_IO)
+
+//*******************************************************
+// EFI_PCI_IO_PROTOCOL_OPERATION
+//*******************************************************
+typedef enum {
+ EfiPciIoOperationBusMasterRead,
+ EfiPciIoOperationBusMasterWrite,
+ EfiPciIoOperationBusMasterCommonBuffer,
+ EfiPciIoOperationMaximum
+} EFI_PCI_IO_PROTOCOL_OPERATION;
+
+
+//*******************************************************
+// EFI_PCI_IO_PROTOCOL_ATTRIBUTE_OPERATION
+//*******************************************************
+typedef enum {
+ EfiPciIoAttributeOperationGet,
+ EfiPciIoAttributeOperationSet,
+ EfiPciIoAttributeOperationEnable,
+ EfiPciIoAttributeOperationDisable,
+ EfiPciIoAttributeOperationSupported,
+ EfiPciIoAttributeOperationMaximum
+} EFI_PCI_IO_PROTOCOL_ATTRIBUTE_OPERATION;
+
+
+typedef EFI_STATUS(*EFI_PCI_IO_PROTOCOL_POLL_IO_MEM) (
+ IN struct _EFI_PCI_IO_PROTOCOL *This,
+ IN EFI_PCI_IO_PROTOCOL_WIDTH Width,
+ IN UINT8 BarIndex,
+ IN UINT64 Offset,
+ IN UINT64 Mask,
+ IN UINT64 Value,
+ IN UINT64 Delay,
+ OUT UINT64 *Result
+ );
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_PCI_IO_PROTOCOL_IO_MEM) (
+ IN struct _EFI_PCI_IO_PROTOCOL *This,
+ IN EFI_PCI_IO_PROTOCOL_WIDTH Width,
+ IN UINT8 BarIndex,
+ IN UINT64 Offset,
+ IN UINTN Count,
+ IN OUT VOID *Buffer
+ );
+
+typedef struct {
+ EFI_PCI_IO_PROTOCOL_IO_MEM Read;
+ EFI_PCI_IO_PROTOCOL_IO_MEM Write;
+} EFI_PCI_IO_PROTOCOL_ACCESS;
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_PCI_IO_PROTOCOL_CONFIG) (
+ IN struct _EFI_PCI_IO_PROTOCOL *This,
+ IN EFI_PCI_IO_PROTOCOL_WIDTH Width,
+ IN UINT32 Offset,
+ IN UINTN Count,
+ IN OUT VOID *Buffer
+ );
+
+typedef struct {
+ EFI_PCI_IO_PROTOCOL_CONFIG Read;
+ EFI_PCI_IO_PROTOCOL_CONFIG Write;
+} EFI_PCI_IO_PROTOCOL_CONFIG_ACCESS;
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_PCI_IO_PROTOCOL_COPY_MEM) (
+ IN struct _EFI_PCI_IO_PROTOCOL *This,
+ IN EFI_PCI_IO_PROTOCOL_WIDTH Width,
+ IN UINT8 DestBarIndex,
+ IN UINT64 DestOffset,
+ IN UINT8 SrcBarIndex,
+ IN UINT64 SrcOffset,
+ IN UINTN Count
+ );
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_PCI_IO_PROTOCOL_MAP) (
+ IN struct _EFI_PCI_IO_PROTOCOL *This,
+ IN EFI_PCI_IO_PROTOCOL_OPERATION Operation,
+ IN VOID *HostAddress,
+ IN OUT UINTN *NumberOfBytes,
+ OUT EFI_PHYSICAL_ADDRESS *DeviceAddress,
+ OUT VOID **Mapping
+ );
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_PCI_IO_PROTOCOL_UNMAP) (
+ IN struct _EFI_PCI_IO_PROTOCOL *This,
+ IN VOID *Mapping
+ );
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_PCI_IO_PROTOCOL_ALLOCATE_BUFFER) (
+ IN struct _EFI_PCI_IO_PROTOCOL *This,
+ IN EFI_ALLOCATE_TYPE Type,
+ IN EFI_MEMORY_TYPE MemoryType,
+ IN UINTN Pages,
+ OUT VOID **HostAddress,
+ IN UINT64 Attributes
+ );
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_PCI_IO_PROTOCOL_FREE_BUFFER) (
+ IN struct _EFI_PCI_IO_PROTOCOL *This,
+ IN UINTN Pages,
+ IN VOID *HostAddress
+ );
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_PCI_IO_PROTOCOL_FLUSH) (
+ IN struct _EFI_PCI_IO_PROTOCOL *This
+ );
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_PCI_IO_PROTOCOL_GET_LOCATION) (
+ IN struct _EFI_PCI_IO_PROTOCOL *This,
+ OUT UINTN *SegmentNumber,
+ OUT UINTN *BusNumber,
+ OUT UINTN *DeviceNumber,
+ OUT UINTN *FunctionNumber
+ );
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_PCI_IO_PROTOCOL_ATTRIBUTES) (
+ IN struct _EFI_PCI_IO_PROTOCOL *This,
+ IN EFI_PCI_IO_PROTOCOL_ATTRIBUTE_OPERATION Operation,
+ IN UINT64 Attributes,
+ OUT UINT64 *Result OPTIONAL
+ );
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_PCI_IO_PROTOCOL_GET_BAR_ATTRIBUTES) (
+ IN struct _EFI_PCI_IO_PROTOCOL *This,
+ IN UINT8 BarIndex,
+ OUT UINT64 *Supports, OPTIONAL
+ OUT VOID **Resources OPTIONAL
+ );
+
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_PCI_IO_PROTOCOL_SET_BAR_ATTRIBUTES) (
+ IN struct _EFI_PCI_IO_PROTOCOL *This,
+ IN UINT64 Attributes,
+ IN UINT8 BarIndex,
+ IN OUT UINT64 *Offset,
+ IN OUT UINT64 *Length
+ );
+
+//
+// Interface structure for the PCI I/O Protocol
+//
+typedef struct _EFI_PCI_IO_PROTOCOL {
+ EFI_PCI_IO_PROTOCOL_POLL_IO_MEM PollMem;
+ EFI_PCI_IO_PROTOCOL_POLL_IO_MEM PollIo;
+ EFI_PCI_IO_PROTOCOL_ACCESS Mem;
+ EFI_PCI_IO_PROTOCOL_ACCESS Io;
+ EFI_PCI_IO_PROTOCOL_CONFIG_ACCESS Pci;
+ EFI_PCI_IO_PROTOCOL_COPY_MEM CopyMem;
+ EFI_PCI_IO_PROTOCOL_MAP Map;
+ EFI_PCI_IO_PROTOCOL_UNMAP Unmap;
+ EFI_PCI_IO_PROTOCOL_ALLOCATE_BUFFER AllocateBuffer;
+ EFI_PCI_IO_PROTOCOL_FREE_BUFFER FreeBuffer;
+ EFI_PCI_IO_PROTOCOL_FLUSH Flush;
+ EFI_PCI_IO_PROTOCOL_GET_LOCATION GetLocation;
+ EFI_PCI_IO_PROTOCOL_ATTRIBUTES Attributes;
+ EFI_PCI_IO_PROTOCOL_GET_BAR_ATTRIBUTES GetBarAttributes ;
+ EFI_PCI_IO_PROTOCOL_SET_BAR_ATTRIBUTES SetBarAttributes;
+ UINT64 RomSize;
+ VOID *RomImage;
+} EFI_PCI_IO_PROTOCOL;
+
+
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2005, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
diff --git a/Include/Protocol/PciPlatform.h b/Include/Protocol/PciPlatform.h
new file mode 100644
index 0000000..c8d13e5
--- /dev/null
+++ b/Include/Protocol/PciPlatform.h
@@ -0,0 +1,137 @@
+//**********************************************************************//
+//**********************************************************************//
+//** **//
+//** (C)Copyright 1985-2005, American Megatrends, Inc. **//
+//** **//
+//** All Rights Reserved. **//
+//** **//
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **//
+//** **//
+//** Phone: (770)-246-8600 **//
+//** **//
+//**********************************************************************//
+//**********************************************************************//
+
+//**********************************************************************
+// $Header: /Alaska/BIN/Core/Include/Protocol/PciPlatform.h 2 3/13/06 1:40a Felixp $
+//
+// $Revision: 2 $
+//
+// $Date: 3/13/06 1:40a $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Core/Include/Protocol/PciPlatform.h $
+//
+// 2 3/13/06 1:40a Felixp
+//
+//**********************************************************************
+//<AMI_FHDR_START>
+//
+// Name: <This File Name>
+//
+// Description:
+//
+//<AMI_FHDR_END>
+//**********************************************************************
+#ifndef __PCI_PLATFORM_PROTOCOL_H__
+#define __PCI_PLATFORM_PROTOCOL_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+/****** DO NOT WRITE ABOVE THIS LINE *******/
+
+//**********************************************************************
+#include <EFI.h>
+
+// Protocol for GUID.
+#define EFI_PCI_PLATFORM_PROTOCOL_GUID \
+{ 0x7d75280, 0x27d4, 0x4d69, 0x90, 0xd0, 0x56, 0x43, 0xe2, 0x38, 0xb3, 0x41}
+
+GUID_VARIABLE_DECLARATION(gEfiPciPlatformProtocolGuid,EFI_PCI_PLATFORM_PROTOCOL_GUID);
+
+#ifndef GUID_VARIABLE_DEFINITION
+#include <Protocol/PciHostBridgeResourceAllocation.h>
+
+typedef struct _EFI_PCI_PLATFORM_PROTOCOL EFI_PCI_PLATFORM_PROTOCOL;
+
+typedef UINT32 EFI_PCI_PLATFORM_POLICY;
+
+//-------------------------------------------------
+#define EFI_RESERVE_NONE_IO_ALIAS 0x0000
+#define EFI_RESERVE_ISA_IO_ALIAS 0x0001
+#define EFI_RESERVE_ISA_IO_NO_ALIAS 0x0002
+#define EFI_RESERVE_VGA_IO_ALIAS 0x0004
+#define EFI_RESERVE_VGA_IO_NO_ALIAS 0x0008
+
+
+typedef enum {
+ ChipsetEntry,
+ ChipsetExit,
+ MaximumChipsetPhase
+} EFI_PCI_CHIPSET_EXECUTION_PHASE;
+
+//-------------------------------------------------
+// Protocol Function Definitions
+//-------------------------------------------------
+typedef EFI_STATUS (EFIAPI * EFI_PCI_PLATFORM_PHASE_NOTIFY)(
+ IN EFI_PCI_PLATFORM_PROTOCOL *This,
+ IN EFI_HANDLE HostBridge,
+ IN EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PHASE Phase,
+ IN EFI_PCI_CHIPSET_EXECUTION_PHASE ChipsetPhase
+);
+
+//-------------------------------------------------
+typedef EFI_STATUS (EFIAPI * EFI_PCI_PLATFORM_PREPROCESS_CONTROLLER)(
+ IN EFI_PCI_PLATFORM_PROTOCOL *This,
+ IN EFI_HANDLE HostBridge,
+ IN EFI_HANDLE RootBridge,
+ IN EFI_PCI_CONFIGURATION_ADDRESS PciAddress,
+ IN EFI_PCI_CONTROLLER_RESOURCE_ALLOCATION_PHASE Phase,
+ IN EFI_PCI_CHIPSET_EXECUTION_PHASE ChipsetPhase
+);
+
+//-------------------------------------------------
+typedef EFI_STATUS (EFIAPI * EFI_PCI_PLATFORM_GET_PLATFORM_POLICY)(
+ IN EFI_PCI_PLATFORM_PROTOCOL *This,
+ OUT EFI_PCI_PLATFORM_POLICY *PciPolicy
+);
+
+//-------------------------------------------------
+typedef EFI_STATUS (EFIAPI *EFI_PCI_PLATFORM_GET_PCI_ROM)(
+ IN EFI_PCI_PLATFORM_PROTOCOL *This,
+ IN EFI_HANDLE PciHandle,
+ OUT VOID **RomImage,
+ OUT UINTN *RomSize
+);
+
+//-------------------------------------------------
+typedef struct _EFI_PCI_PLATFORM_PROTOCOL {
+ EFI_PCI_PLATFORM_PHASE_NOTIFY PhaseNotify;
+ EFI_PCI_PLATFORM_PREPROCESS_CONTROLLER PlatformPrepController;
+ EFI_PCI_PLATFORM_GET_PLATFORM_POLICY GetPlatformPolicy;
+ EFI_PCI_PLATFORM_GET_PCI_ROM GetPciRom;
+} EFI_PCI_PLATFORM_PROTOCOL;
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#endif // #ifndef GUID_VARIABLE_DEFINITION
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2005, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
diff --git a/Include/Protocol/PciRootBridgeIo.h b/Include/Protocol/PciRootBridgeIo.h
new file mode 100644
index 0000000..bc173a0
--- /dev/null
+++ b/Include/Protocol/PciRootBridgeIo.h
@@ -0,0 +1,311 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2005, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/BIN/Core/Include/Protocol/PciRootBridgeIo.h 4 2/05/11 2:33p Artems $
+//
+// $Revision: 4 $
+//
+// $Date: 2/05/11 2:33p $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Core/Include/Protocol/PciRootBridgeIo.h $
+//
+// 4 2/05/11 2:33p Artems
+// Added EFI_PCI_CONFIGURATION_ADDRESS definition
+//
+// 3 10/06/08 3:32p Yakovlevs
+// UEFI 2.1 Update
+//
+// 2 3/13/06 1:40a Felixp
+//
+// 1 1/28/05 12:44p Felixp
+//
+// 2 1/18/05 3:22p Felixp
+// PrintDebugMessage renamed to Trace
+//
+// 1 12/23/04 9:41a Felixp
+//
+// 2 2/05/04 6:26p Markw
+// Added EFI_PCI_CONFIGURATION_ADDRESS structure.
+//
+// 1 2/03/04 10:23a Markw
+//
+// 1 2/03/04 10:22a Markw
+//
+// 1 1/26/04 3:25p Markw
+//
+//**********************************************************************
+//<AMI_FHDR_START>
+//
+// Name: PciRootBridgeIo_h
+//
+// Description: Provides functions to access memory/io/pci behind a Pci bridge.
+//
+//<AMI_FHDR_END>
+//**********************************************************************
+
+#ifndef __PCI_ROOT_BRIDGE_IO_PROTOCOL_H__
+#define __PCI_ROOT_BRIDGE_IO_PROTOCOL_H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+#include <EFI.h>
+
+#define EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_GUID \
+ {0x2F707EBB,0x4A1A,0x11d4,0x9A,0x38,0x00,0x90,0x27,0x3F,0xC1,0x4D}
+
+GUID_VARIABLE_DECLARATION(gEfiPciRootBridgeIoProtocolGuid,EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_GUID);
+
+//*******************************************************
+// EFI PCI Root Bridge I/O Protocol Attribute bits
+//*******************************************************
+#define EFI_PCI_ATTRIBUTE_ISA_MOTHERBOARD_IO 0x0001
+#define EFI_PCI_ATTRIBUTE_ISA_IO 0x0002
+#define EFI_PCI_ATTRIBUTE_VGA_PALETTE_IO 0x0004
+#define EFI_PCI_ATTRIBUTE_VGA_MEMORY 0x0008
+#define EFI_PCI_ATTRIBUTE_VGA_IO 0x0010
+#define EFI_PCI_ATTRIBUTE_IDE_PRIMARY_IO 0x0020
+#define EFI_PCI_ATTRIBUTE_IDE_SECONDARY_IO 0x0040
+#define EFI_PCI_ATTRIBUTE_MEMORY_WRITE_COMBINE 0x0080
+#define EFI_PCI_ATTRIBUTE_MEMORY_CACHED 0x0800
+#define EFI_PCI_ATTRIBUTE_MEMORY_DISABLE 0x1000
+#define EFI_PCI_ATTRIBUTE_DUAL_ADDRESS_CYCLE 0x8000
+//UIEFI 2.1 update
+#define EFI_PCI_ATTRIBUTE_ISA_IO_16 0x10000
+#define EFI_PCI_ATTRIBUTE_VGA_PALETTE_IO_16 0x20000
+#define EFI_PCI_ATTRIBUTE_VGA_IO_16 0x40000
+
+//*******************************************************
+// EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH
+//*******************************************************
+typedef enum {
+ EfiPciWidthUint8,
+ EfiPciWidthUint16,
+ EfiPciWidthUint32,
+ EfiPciWidthUint64,
+ EfiPciWidthFifoUint8,
+ EfiPciWidthFifoUint16,
+ EfiPciWidthFifoUint32,
+ EfiPciWidthFifoUint64,
+ EfiPciWidthFillUint8,
+ EfiPciWidthFillUint16,
+ EfiPciWidthFillUint32,
+ EfiPciWidthFillUint64,
+ EfiPciWidthMaximum
+} EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH;
+
+//*******************************************************
+// EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_OPERATION
+//*******************************************************
+typedef enum {
+ EfiPciOperationBusMasterRead,
+ EfiPciOperationBusMasterWrite,
+ EfiPciOperationBusMasterCommonBuffer,
+ EfiPciOperationBusMasterRead64,
+ EfiPciOperationBusMasterWrite64,
+ EfiPciOperationBusMasterCommonBuffer64,
+ EfiPciOperationMaximum
+} EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_OPERATION;
+
+
+typedef struct {
+ UINT8 Register;
+ UINT8 Function;
+ UINT8 Device;
+ UINT8 Bus;
+ UINT32 ExtendedRegister;
+} EFI_PCI_CONFIGURATION_ADDRESS;
+
+#define EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_PCI_ADDRESS EFI_PCI_CONFIGURATION_ADDRESS
+
+typedef struct _EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL;
+
+//*******************************************************
+// EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_POLL_IO_MEM
+//*******************************************************
+typedef EFI_STATUS (EFIAPI *EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_POLL_IO_MEM) (
+ IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *This,
+ IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH Width,
+ IN UINT64 Address,
+ IN UINT64 Mask,
+ IN UINT64 Value,
+ IN UINT64 Delay,
+ OUT UINT64 *Result
+);
+
+typedef EFI_STATUS (EFIAPI *EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_POLL_IO_MEM) (
+ IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *This,
+ IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH Width,
+ IN UINT64 Address,
+ IN UINT64 Mask,
+ IN UINT64 Value,
+ IN UINT64 Delay,
+ OUT UINT64 *Result
+);
+
+typedef EFI_STATUS (EFIAPI *EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_IO_MEM) (
+ IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *This,
+ IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH Width,
+ IN UINT64 Address,
+ IN UINTN Count,
+ IN OUT VOID *Buffer
+);
+
+typedef EFI_STATUS (EFIAPI *EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_COPY_MEM) (
+ IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *This,
+ IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH Width,
+ IN UINT64 DestAddress,
+ IN UINT64 SrcAddress,
+ IN UINTN Count
+);
+
+typedef EFI_STATUS (EFIAPI *EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_MAP) (
+ IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *This,
+ IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_OPERATION Operation,
+ IN VOID *HostAddress,
+ IN OUT UINTN *NumberOfBytes,
+ OUT EFI_PHYSICAL_ADDRESS *DeviceAddress,
+ OUT VOID **Mapping
+);
+
+typedef EFI_STATUS (EFIAPI *EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_UNMAP) (
+ IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *This,
+ IN VOID *Mapping
+);
+
+typedef EFI_STATUS (EFIAPI *EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_ALLOCATE_BUFFER) (
+ IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *This,
+ IN EFI_ALLOCATE_TYPE Type,
+ IN EFI_MEMORY_TYPE MemoryType,
+ IN UINTN Pages,
+ OUT VOID **HostAddress,
+ IN UINT64 Attributes
+);
+
+typedef EFI_STATUS (EFIAPI *EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_FREE_BUFFER) (
+ IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *This,
+ IN UINTN Pages,
+ IN VOID *HostAddress
+);
+
+typedef EFI_STATUS (EFIAPI *EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_FLUSH) (
+ IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *This
+);
+
+typedef EFI_STATUS (EFIAPI *EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_GET_ATTRIBUTES) (
+ IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *This,
+ OUT UINT64 *Supports OPTIONAL,
+ OUT UINT64 *Attributes OPTIONAL
+);
+
+typedef EFI_STATUS (EFIAPI *EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_SET_ATTRIBUTES) (
+ IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *This,
+ IN UINT64 Attributes,
+ IN OUT UINT64 *ResourceBase OPTIONAL,
+ IN OUT UINT64 *ResourceLength OPTIONAL
+);
+
+typedef EFI_STATUS (EFIAPI *EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_CONFIGURATION) (
+ IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *This,
+ OUT VOID **Resources
+);
+
+//**********************************************************************
+//<AMI_THDR_START>
+//
+// Name: EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_ACCESS
+//
+// Description: This provides north bridge functions to open, close, lock,
+// and describe SMM space.
+//
+// Fields: Name Type Description
+// ------------------------------------------------------------
+// Read EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_IO_MEM - definition to read Mem/Io/Pci.
+// Write EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_IO_MEM - definition to read Mem/Io/Pci.
+//<AMI_THDR_END>
+//**********************************************************************
+typedef struct {
+ EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_IO_MEM Read;
+ EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_IO_MEM Write;
+} EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_ACCESS;
+
+//**********************************************************************
+//<AMI_THDR_START>
+//
+// Name: EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL
+//
+// Description: Functions to access Pci Root Bridge for reading/writting
+// Memory/IO/config space.
+//
+// Fields: Name Type Description
+// ------------------------------------------------------------
+// ParentHandle EFI_HANDLE
+// PollMem EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_POLL_IO_MEM
+// PollIo EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_POLL_IO_MEM
+// Mem EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_ACCESS
+// Io EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_ACCESS
+// Pci EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_ACCESS
+// CopyMem EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_COPY_MEM
+// Map EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_MAP
+// Unmap EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_UNMAP
+// AllocateBuffer EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_ALLOCATE_BUFFER
+// FreeBuffer EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_FREE_BUFFER
+// Flush EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_FLUSH
+// GetAttributes EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_GET_ATTRIBUTES
+// SetAttributes EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_SET_ATTRIBUTES
+// Configuration EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_CONFIGURATION
+// SegmentNumber UINT32
+//
+//<AMI_THDR_END>
+//**********************************************************************
+struct _EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL {
+ EFI_HANDLE ParentHandle;
+ EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_POLL_IO_MEM PollMem;
+ EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_POLL_IO_MEM PollIo;
+ EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_ACCESS Mem;
+ EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_ACCESS Io;
+ EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_ACCESS Pci;
+ EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_COPY_MEM CopyMem;
+ EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_MAP Map;
+ EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_UNMAP Unmap;
+ EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_ALLOCATE_BUFFER AllocateBuffer;
+ EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_FREE_BUFFER FreeBuffer;
+ EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_FLUSH Flush;
+ EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_GET_ATTRIBUTES GetAttributes;
+ EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_SET_ATTRIBUTES SetAttributes;
+ EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_CONFIGURATION Configuration;
+ UINT32 SegmentNumber;
+};
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2005, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
diff --git a/Include/Protocol/Performance.h b/Include/Protocol/Performance.h
new file mode 100644
index 0000000..7f8945e
--- /dev/null
+++ b/Include/Protocol/Performance.h
@@ -0,0 +1,117 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2008, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/BIN/Core/Include/Protocol/Performance.h 2 5/06/08 10:04a Felixp $Revision:
+//
+// $Date: 5/06/08 10:04a $Log:
+//
+//
+//**********************************************************************
+//<AMI_FHDR_START>
+//
+// Name: Performance.h
+//
+// Description: Header file for DXE_PERFORMANCE protocol
+//
+//<AMI_FHDR_END>
+//**********************************************************************
+
+#ifndef _EFI_PERFORMANCE_H_
+#define _EFI_PERFORMANCE_H_
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <EFI.h>
+
+#define EFI_PERFORMANCE_PROTOCOL_GUID \
+ { 0xFFECFFFF, 0x923C, 0x14d2, 0x9E, 0x3F, 0x22, 0xA0, 0xC9, 0x69, 0x56, 0x3B }
+
+#define EFI_PERF_TOKEN_LENGTH 32
+#define EFI_PERF_HOST_LENGTH 32
+#define EFI_PERF_PDBFILENAME_LENGTH 40
+
+typedef struct _EFI_PERFORMANCE_PROTOCOL EFI_PERFORMANCE_PROTOCOL;
+
+typedef struct {
+ EFI_HANDLE Handle;
+ UINT16 Token[EFI_PERF_TOKEN_LENGTH];
+ UINT16 Host[EFI_PERF_HOST_LENGTH];
+ UINT64 StartTick;
+ UINT64 EndTick;
+ EFI_GUID GuidName;
+ UINT8 PdbFileName[EFI_PERF_PDBFILENAME_LENGTH];
+ UINT8 Phase;
+} EFI_GAUGE_DATA ;
+
+
+typedef
+EFI_STATUS
+(EFIAPI * EFI_PERF_START_GAUGE) (
+ IN EFI_PERFORMANCE_PROTOCOL *This,
+ IN EFI_HANDLE Handle,
+ IN UINT16 *Token,
+ IN UINT16 *Host,
+ IN UINT64 Ticker
+ );
+
+typedef
+EFI_STATUS
+(EFIAPI * EFI_PERF_END_GAUGE) (
+ IN EFI_PERFORMANCE_PROTOCOL *This,
+ IN EFI_HANDLE Handle,
+ IN UINT16 *Token,
+ IN UINT16 *Host,
+ IN UINT64 Ticker
+ );
+
+
+typedef
+EFI_GAUGE_DATA *
+(EFIAPI * EFI_PERF_GET_GAUGE) (
+ IN EFI_PERFORMANCE_PROTOCOL *This,
+ IN EFI_HANDLE Handle,
+ IN UINT16 *Token,
+ IN UINT16 *Host,
+ IN EFI_GAUGE_DATA *PrevGauge
+ );
+
+
+typedef struct _EFI_PERFORMANCE_PROTOCOL{
+ EFI_PERF_START_GAUGE StartGauge;
+ EFI_PERF_END_GAUGE EndGauge;
+ EFI_PERF_GET_GAUGE GetGauge;
+} EFI_PERFORMANCE_PROTOCOL;
+
+GUID_VARIABLE_DECLARATION(gEfiPerformanceProtocolGuid, EFI_PERFORMANCE_PROTOCOL_GUID);
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2008, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
diff --git a/Include/Protocol/PlatformDriverOverride.h b/Include/Protocol/PlatformDriverOverride.h
new file mode 100644
index 0000000..1f69eaa
--- /dev/null
+++ b/Include/Protocol/PlatformDriverOverride.h
@@ -0,0 +1,105 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2005, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/BIN/Core/Include/Protocol/PlatformDriverOverride.h 3 3/13/06 1:40a Felixp $
+//
+// $Revision: 3 $
+//
+// $Date: 3/13/06 1:40a $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Core/Include/Protocol/PlatformDriverOverride.h $
+//
+// 3 3/13/06 1:40a Felixp
+//
+// 2 3/04/05 10:36a Mandal
+//
+// 1 1/28/05 12:44p Felixp
+//
+// 2 1/18/05 3:22p Felixp
+// PrintDebugMessage renamed to Trace
+//
+// 1 12/23/04 9:41a Felixp
+//
+// 2 3/13/04 5:13p Felixp
+//
+// 1 3/13/04 4:36p Felixp
+//
+//**********************************************************************
+//<AMI_FHDR_START>
+//
+// Name: PlatformDriverOverride.h
+//
+// Description: EFI_PLATFORM_DRIVER_OVERRIDE Protocol Definition
+//
+//<AMI_FHDR_END>
+//**********************************************************************
+#ifndef __EFI_PLATFORM_DRIVER_OVERRIDE_PROTOCOL__H__
+#define __EFI_PLATFORM_DRIVER_OVERRIDE_PROTOCOL__H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+#include <EFI.h>
+
+#define EFI_PLATFORM_DRIVER_OVERRIDE_PROTOCOL_GUID \
+ { 0x6b30c738,0xa391,0x11d4,0x9a,0x3b,0x00,0x90,0x27,0x3f,0xc1,0x4d }
+
+GUID_VARIABLE_DECLARATION(gEfiPlatformDriverOverrideProtocolGuid,EFI_PLATFORM_DRIVER_OVERRIDE_PROTOCOL_GUID);
+
+typedef struct _EFI_PLATFORM_DRIVER_OVERRIDE_PROTOCOL EFI_PLATFORM_DRIVER_OVERRIDE_PROTOCOL;
+
+typedef EFI_STATUS (EFIAPI *EFI_PLATFORM_DRIVER_OVERRIDE_GET_DRIVER) (
+ IN EFI_PLATFORM_DRIVER_OVERRIDE_PROTOCOL *This,
+ IN EFI_HANDLE ControllerHandle,
+ IN OUT EFI_HANDLE *DriverImageHandle
+);
+
+typedef EFI_STATUS (EFIAPI *EFI_PLATFORM_DRIVER_OVERRIDE_GET_DRIVER_PATH) (
+ IN EFI_PLATFORM_DRIVER_OVERRIDE_PROTOCOL *This,
+ IN EFI_HANDLE ControllerHandle,
+ IN OUT EFI_DEVICE_PATH_PROTOCOL **DriverImagePath
+);
+
+typedef EFI_STATUS (EFIAPI *EFI_PLATFORM_DRIVER_OVERRIDE_DRIVER_LOADED) (
+ IN EFI_PLATFORM_DRIVER_OVERRIDE_PROTOCOL *This,
+ IN EFI_HANDLE ControllerHandle,
+ IN EFI_DEVICE_PATH_PROTOCOL *DriverImagePath,
+ IN EFI_HANDLE DriverImageHandle
+);
+
+struct _EFI_PLATFORM_DRIVER_OVERRIDE_PROTOCOL {
+ EFI_PLATFORM_DRIVER_OVERRIDE_GET_DRIVER GetDriver;
+ EFI_PLATFORM_DRIVER_OVERRIDE_GET_DRIVER_PATH GetDriverPath;
+ EFI_PLATFORM_DRIVER_OVERRIDE_DRIVER_LOADED DriverLoaded;
+};
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2005, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
diff --git a/Include/Protocol/PlatformToDriverConfiguration.h b/Include/Protocol/PlatformToDriverConfiguration.h
new file mode 100644
index 0000000..f97e383
--- /dev/null
+++ b/Include/Protocol/PlatformToDriverConfiguration.h
@@ -0,0 +1,110 @@
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
+
+//*************************************************************************
+// $Header: /Alaska/BIN/Core/Include/Protocol/PlatformToDriverConfiguration.h 1 4/22/11 6:45p Artems $
+//
+// $Revision: 1 $
+//
+// $Date: 4/22/11 6:45p $
+//*************************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Core/Include/Protocol/PlatformToDriverConfiguration.h $
+//
+// 1 4/22/11 6:45p Artems
+//
+//*************************************************************************
+//<AMI_FHDR_START>
+//
+// Name: PlatformToDriverConfiguration.h
+//
+// Description:
+// EFI_PLATFORM_TO_DRIVER_CONFIGURATION_PROTOCOL definition file
+//
+//<AMI_FHDR_END>
+//*************************************************************************
+#ifndef __PLATFORM_TO_DRIVER_CONFIGURATION_PROTOCOL__H__
+#define __PLATFORM_TO_DRIVER_CONFIGURATION_PROTOCOL__H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <EFI.h>
+
+#define EFI_PLATFORM_TO_DRIVER_CONFIGURATION_PROTOCOL_GUID \
+ { 0x642cd590, 0x8059, 0x4c0a, 0xa9, 0x58, 0xc5, 0xec, 0x7, 0xd2, 0x3c, 0x4b }
+
+GUID_VARIABLE_DECLARATION(gEfiPlatformToDriverConfigurationProtocolGuid, EFI_PLATFORM_TO_DRIVER_CONFIGURATION_PROTOCOL_GUID);
+
+typedef struct _EFI_PLATFORM_TO_DRIVER_CONFIGURATION_PROTOCOL EFI_PLATFORM_TO_DRIVER_CONFIGURATION_PROTOCOL;
+
+typedef enum {
+ EfiPlatformConfigurationActionNone = 0,
+ EfiPlatformConfigurationActionStopController = 1,
+ EfiPlatformConfigurationActionRestartController = 2,
+ EfiPlatformConfigurationActionRestartPlatform = 3,
+ EfiPlatformConfigurationActionNvramFailed = 4,
+ EfiPlatformConfigurationActionMaximum
+} EFI_PLATFORM_CONFIGURATION_ACTION;
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_PLATFORM_TO_DRIVER_CONFIGURATION_QUERY) (
+ IN EFI_PLATFORM_TO_DRIVER_CONFIGURATION_PROTOCOL *This,
+ IN EFI_HANDLE ControllerHandle,
+ IN EFI_HANDLE ChildHandle OPTIONAL,
+ IN UINTN *Instance,
+ OUT EFI_GUID **ParameterTypeGuid,
+ OUT VOID **ParameterBlock,
+ OUT UINTN *ParameterBlockSize
+);
+
+typedef
+EFI_STATUS
+ (EFIAPI *EFI_PLATFORM_TO_DRIVER_CONFIGURATION_RESPONSE) (
+ IN EFI_PLATFORM_TO_DRIVER_CONFIGURATION_PROTOCOL *This,
+ IN EFI_HANDLE ControllerHandle,
+ IN EFI_HANDLE ChildHandle OPTIONAL,
+ IN UINTN *Instance,
+ IN EFI_GUID *ParameterTypeGuid,
+ IN VOID *ParameterBlock,
+ IN UINTN ParameterBlockSize,
+ IN EFI_PLATFORM_CONFIGURATION_ACTION ConfigurationAction
+);
+
+struct _EFI_PLATFORM_TO_DRIVER_CONFIGURATION_PROTOCOL {
+ EFI_PLATFORM_TO_DRIVER_CONFIGURATION_QUERY Query;
+ EFI_PLATFORM_TO_DRIVER_CONFIGURATION_RESPONSE Response;
+};
+
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
diff --git a/Include/Protocol/Protocol.cif b/Include/Protocol/Protocol.cif
new file mode 100644
index 0000000..68b68aa
--- /dev/null
+++ b/Include/Protocol/Protocol.cif
@@ -0,0 +1,100 @@
+<component>
+ name = "Protocol"
+ category = ModulePart
+ LocalRoot = "Include\Protocol\"
+ RefName = "Protocol"
+[files]
+"AbsPointerProtocol.h"
+"AuthenticationInfo.h"
+"BlockIo.h"
+"BootScriptSave.h"
+"BusSpecificDriverOverride.h"
+"ComponentName.h"
+"ComponentName2.h"
+"DataHub.h"
+"DebugSupport.h"
+"Decompress.h"
+"DeviceIo.h"
+"DevicePath.h"
+"DevicePathFromText.h"
+"DevicePathToText.h"
+"DiskIo.h"
+"DriverBinding.h"
+"ServiceBinding.h"
+"DriverDiagnostics2.h"
+"DriverHealth.h"
+"DriverFamilyOverride.h"
+"EBC.h"
+"FirmwareVolume.h"
+"FirmwareVolume2.h"
+"FirmwareVolumeBlock.h"
+"FirmwareManagement.h"
+"GuidedSectionExtraction.h"
+"HII.h"
+"IdeControllerInit.h"
+"Legacy8259.h"
+"LoadedImage.h"
+"LoadFile.h"
+"PciIo.h"
+"PciRootBridgeIo.h"
+"PlatformDriverOverride.h"
+"PlatformToDriverConfiguration.h"
+"SerialIo.h"
+"SimpleFileSystem.h"
+"SimplePointer.h"
+"SimpleTextIn.h"
+"SimpleTextOut.h"
+"UgaDraw.h"
+"UnicodeCollation.h"
+"HotKeys.h"
+"AmiSio.h"
+"AmiReflashProtocol.h"
+"SuperIo.h"
+"ExtHii.h"
+"FormCallBack.h"
+"SetupInit.h"
+"LoadPe32Image.h"
+"ConsoleControl.h"
+"CpuIo.h"
+"CpuIo2.h"
+"AcpiSupport.h"
+"AcpiSystemDescriptionTable.h"
+"AcpiTable.h"
+"PciPlatform.h"
+"PciHostBridgeResourceAllocation.h"
+"PciHotPlugInit.h"
+"IncompatiblePciDeviceSupport.h"
+"SmBus.h"
+"DevicePathUtilities.h"
+"GraphicsOutput.h"
+"EdidActive.h"
+"EdidDiscovered.h"
+"SimpleTextInEx.h"
+"EfiOemBadging.h"
+"AmiKeycode.h"
+"PIDEBus.h"
+"PAhciBus.h"
+"Performance.h"
+"FlashProtocol.h"
+"HiiConfigRouting.h"
+"HiiConfigAccess.h"
+"HiiDatabase.h"
+"HiiFont.h"
+"HiiString.h"
+"FormBrowser2.h"
+"HiiUtilities.h"
+"TcgService.h"
+"LoadFile2.h"
+"LoadedImageDevicePath.h"
+"HiiPackageList.h"
+"Hash.h"
+"UserManager.h"
+"UserCredential.h"
+"DeferredImageLoad.h"
+"StorageSecurityCommand.h"
+"AtaPassThru.h"
+"MpService.h"
+"ReportStatusCodeHandler.h"
+"SmmReportStatusCodeHandler.h"
+"ScsiPassThruExt.h"
+<endComponent>
diff --git a/Include/Protocol/RealTimeClock.h b/Include/Protocol/RealTimeClock.h
new file mode 100644
index 0000000..6e7ae06
--- /dev/null
+++ b/Include/Protocol/RealTimeClock.h
@@ -0,0 +1,79 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2005, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/BIN/Core/CORE_DXE/ArchProtocol/RealTimeClock.h 1 3/13/06 1:45a Felixp $
+//
+// $Revision: 1 $
+//
+// $Date: 3/13/06 1:45a $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Core/CORE_DXE/ArchProtocol/RealTimeClock.h $
+//
+// 1 3/13/06 1:45a Felixp
+//
+// 1 1/28/05 12:44p Felixp
+//
+// 2 1/18/05 3:21p Felixp
+// PrintDebugMessage renamed to Trace
+//
+// 1 12/23/04 9:42a Felixp
+//
+// 1 12/23/04 9:29a Felixp
+//
+// 1 1/15/04 6:19p Markw
+//
+//**********************************************************************
+//<AMI_FHDR_START>
+//
+// Name: RealTimeClock.h
+//
+// Description: The Real Time Clock Architectural Protocol only consists
+// of a GUID. The Protocol is installed with a NULL pointer
+// to the structure after the RTC EFI services are installed.
+//
+//<AMI_FHDR_END>
+//**********************************************************************
+#ifndef __REAL_TIME_CLOCK_ARCH_PROTOCOL_H__
+#define __REAL_TIME_CLOCK_ARCH_PROTOCOL_H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+#include <EFI.h>
+
+#define EFI_REAL_TIME_CLOCK_ARCH_PROTOCOL_GUID \
+ {0x27CFAC87,0x46CC,0x11d4,0x9A,0x38,0x00,0x90,0x27,0x3F,0xC1,0x4D}
+
+GUID_VARIABLE_DECLARATION(gEfiRealTimeClockArchProtocolGuid, EFI_REAL_TIME_CLOCK_ARCH_PROTOCOL_GUID);
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2005, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
diff --git a/Include/Protocol/ReportStatusCodeHandler.h b/Include/Protocol/ReportStatusCodeHandler.h
new file mode 100644
index 0000000..ccbfe3a
--- /dev/null
+++ b/Include/Protocol/ReportStatusCodeHandler.h
@@ -0,0 +1,94 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/BIN/Core/Include/Protocol/ReportStatusCodeHandler.h 1 6/16/11 9:48a Felixp $
+//
+// $Revision: 1 $
+//
+// $Date: 6/16/11 9:48a $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Core/Include/Protocol/ReportStatusCodeHandler.h $
+//
+// 1 6/16/11 9:48a Felixp
+//
+// 6 1/13/10 2:13p Felixp
+//
+//**********************************************************************
+//<AMI_FHDR_START>
+//
+// Name: ReportStatusCodeHandler.h
+//
+// Description: Report Status Code Handler Protocol definitions header.
+//
+//<AMI_FHDR_END>
+//**********************************************************************
+#ifndef __REPORT_STATUS_CODE_HANDLER_PROTOCOL_H__
+#define __REPORT_STATUS_CODE_HANDLER_PROTOCOL_H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define EFI_RSC_HANDLER_PROTOCOL_GUID \
+ { 0x86212936, 0xe76, 0x41c8, 0xa0, 0x3a, 0x2a, 0xf2, 0xfc, 0x1c, 0x39, 0xe2 }
+
+GUID_VARIABLE_DECLARATION(gEfiRscHandlerProtocolGuid, EFI_RSC_HANDLER_PROTOCOL_GUID);
+
+typedef EFI_STATUS
+(EFIAPI *EFI_RSC_HANDLER_CALLBACK)(
+ IN EFI_STATUS_CODE_TYPE CodeType,
+ IN EFI_STATUS_CODE_VALUE Value,
+ IN UINT32 Instance,
+ IN EFI_GUID *CallerId,
+ IN EFI_STATUS_CODE_DATA *Data
+);
+
+typedef EFI_STATUS
+(EFIAPI *EFI_RSC_HANDLER_REGISTER) (
+ IN EFI_RSC_HANDLER_CALLBACK Callback, //A pointer to a function of type EFI_RSC_HANDLER_CALLBACK that is
+ //called when a call to ReportStatusCode() occurs.
+ IN EFI_TPL Tpl //TPL at which callback can be safely invoked.
+);
+
+typedef EFI_STATUS
+(EFIAPI *EFI_RSC_HANDLER_UNREGISTER) (
+ IN EFI_RSC_HANDLER_CALLBACK Callback //A pointer to a function of type EFI_RSC_HANDLER_CALLBACK that is to be
+ //unregistered.
+);
+
+typedef struct {
+ EFI_RSC_HANDLER_REGISTER Register; //Register the callback for notification of status code messages.
+ EFI_RSC_HANDLER_UNREGISTER Unregister; //Unregister the callback.
+} EFI_RSC_HANDLER_PROTOCOL;
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif // __REPORT_STATUS_CODE_HANDLER_H__
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
diff --git a/Include/Protocol/Reset.h b/Include/Protocol/Reset.h
new file mode 100644
index 0000000..0bb4a07
--- /dev/null
+++ b/Include/Protocol/Reset.h
@@ -0,0 +1,80 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2005, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/BIN/Core/CORE_DXE/ArchProtocol/Reset.h 2 3/13/06 1:45a Felixp $
+//
+// $Revision: 2 $
+//
+// $Date: 3/13/06 1:45a $
+//*****************************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Core/CORE_DXE/ArchProtocol/Reset.h $
+//
+// 2 3/13/06 1:45a Felixp
+//
+// 1 1/28/05 12:44p Felixp
+//
+// 2 1/18/05 3:21p Felixp
+// PrintDebugMessage renamed to Trace
+//
+// 1 12/23/04 9:42a Felixp
+//
+// 1 12/23/04 9:29a Felixp
+//
+// 1 3/25/04 3:02p Robert
+//
+//
+//*****************************************************************************
+//<AMI_FHDR_START>
+//
+// Name: Reset.h
+//
+// Description: This file contains the support values for the Reset
+// Architectural Protocol
+//
+//<AMI_FHDR_END>
+//*****************************************************************************
+#ifndef __RESET_ARCH_PROTOCOL_H__
+#define __RESET_ARCH_PROTOCOL_H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+#include <EFI.h>
+
+// GUID for the Reset Architectural Protocol
+#define EFI_RESET_ARCH_PROTOCOL_GUID \
+ { 0x27CFAC88, 0x46CC, 0x11D4, 0x9A, 0x38, 0x00, 0x90, 0x27, 0x3F, 0xC1, 0x4D }
+
+GUID_VARIABLE_DECLARATION(gEfiResetArchProtocolGuid, EFI_RESET_ARCH_PROTOCOL_GUID);
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2005, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
diff --git a/Include/Protocol/Runtime.h b/Include/Protocol/Runtime.h
new file mode 100644
index 0000000..6dbe9b4
--- /dev/null
+++ b/Include/Protocol/Runtime.h
@@ -0,0 +1,118 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2005, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/BIN/Core/CORE_DXE/ArchProtocol/Runtime.h 4 10/07/06 10:18a Felixp $
+//
+// $Revision: 4 $
+//
+// $Date: 10/07/06 10:18a $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Core/CORE_DXE/ArchProtocol/Runtime.h $
+//
+// 4 10/07/06 10:18a Felixp
+// Updated to a new Runtime protocol defined by DXE CIS 0.91
+//
+// 3 3/13/06 1:45a Felixp
+//
+// 2 3/04/05 10:44a Mandal
+//
+// 1 1/28/05 12:44p Felixp
+//
+// 2 1/18/05 3:21p Felixp
+// PrintDebugMessage renamed to Trace
+//
+// 1 12/23/04 9:42a Felixp
+//
+// 1 12/23/04 9:29a Felixp
+//
+// 1 3/30/04 2:24a Felixp
+//
+//**********************************************************************
+//<AMI_FHDR_START>
+//
+// Name: Runtime.h
+//
+// Description: Runtime Architectural Protocol Definition
+//
+//<AMI_FHDR_END>
+//**********************************************************************
+#ifndef __RUNTIME_ARCH_PROTOCOL_H__
+#define __RUNTIME_ARCH_PROTOCOL_H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+#include <EFI.h>
+
+#define EFI_RUNTIME_ARCH_PROTOCOL_GUID \
+ { 0xb7dfb4e1, 0x52f, 0x449f, 0x87, 0xbe, 0x98, 0x18, 0xfc, 0x91, 0xb7, 0x33 }
+
+GUID_VARIABLE_DECLARATION(gEfiRuntimeArchProtocolGuid, EFI_RUNTIME_ARCH_PROTOCOL_GUID);
+
+#ifndef EFI_LIST_ENTRY_DEFINED
+#define EFI_LIST_ENTRY_DEFINED
+typedef struct _EFI_LIST_ENTRY {
+ struct _EFI_LIST_ENTRY *ForwardLink;
+ struct _EFI_LIST_ENTRY *BackLink;
+} EFI_LIST_ENTRY;
+#endif
+
+typedef struct _EFI_RUNTIME_IMAGE_ENTRY {
+ VOID *ImageBase;
+ UINT64 ImageSize;
+ VOID *RelocationData;
+ EFI_HANDLE Handle;
+ EFI_LIST_ENTRY Link;
+} EFI_RUNTIME_IMAGE_ENTRY;
+
+typedef struct _EFI_RUNTIME_EVENT_ENTRY {
+ UINT32 Type;
+ EFI_TPL NotifyTpl;
+ EFI_EVENT_NOTIFY NotifyFunction;
+ VOID *NotifyContext;
+ EFI_EVENT *Event;
+ EFI_LIST_ENTRY Link;
+} EFI_RUNTIME_EVENT_ENTRY;
+
+// Interface stucture for the Runtime Architectural Protocol
+typedef struct _EFI_RUNTIME_ARCH_PROTOCOL {
+ EFI_LIST_ENTRY ImageHead;
+ EFI_LIST_ENTRY EventHead;
+ UINTN MemoryDescriptorSize;
+ UINT32 MemoryDesciptorVersion;
+ UINTN MemoryMapSize;
+ EFI_MEMORY_DESCRIPTOR *MemoryMapPhysical;
+ EFI_MEMORY_DESCRIPTOR *MemoryMapVirtual;
+ BOOLEAN VirtualMode;
+ BOOLEAN AtRuntime;
+} EFI_RUNTIME_ARCH_PROTOCOL;
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2005, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
diff --git a/Include/Protocol/S3SaveState.h b/Include/Protocol/S3SaveState.h
new file mode 100644
index 0000000..21509bf
--- /dev/null
+++ b/Include/Protocol/S3SaveState.h
@@ -0,0 +1,187 @@
+/** @file
+ S3 Save State Protocol as defined in PI1.2 Specification VOLUME 5 Standard.
+
+ This protocol is used by DXE PI module to store or record various IO operations
+ to be replayed during an S3 resume.
+ This protocol is not required for all platforms.
+
+ Copyright (c) 2009 - 2010, Intel Corporation
+ All rights reserved. This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+ @par Revision Reference:
+ This PPI is defined in UEFI Platform Initialization Specification 1.2 Volume 5:
+ Standards
+
+**/
+
+#ifndef __S3_SAVE_STATE_H__
+#define __S3_SAVE_STATE_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <EFI.h>
+
+
+#define EFI_S3_SAVE_STATE_PROTOCOL_GUID \
+ { 0xe857caf6, 0xc046, 0x45dc, 0xbe, 0x3f, 0xee, 0x7, 0x65, 0xfb, 0xa8, 0x87}
+
+GUID_VARIABLE_DECLARATION(gEfiS3SaveStateProtocolGuid,EFI_S3_SAVE_STATE_PROTOCOL_GUID);
+
+typedef VOID *EFI_S3_BOOT_SCRIPT_POSITION;
+
+typedef struct _EFI_S3_SAVE_STATE_PROTOCOL EFI_S3_SAVE_STATE_PROTOCOL;
+
+/**
+ Record operations that need to be replayed during an S3 resume.
+
+ This function is used to store an OpCode to be replayed as part of the S3 resume boot path. It is
+ assumed this protocol has platform specific mechanism to store the OpCode set and replay them
+ during the S3 resume.
+
+ @param[in] This A pointer to the EFI_S3_SAVE_STATE_PROTOCOL instance.
+ @param[in] OpCode The operation code (opcode) number.
+ @param[in] ... Argument list that is specific to each opcode. See the following subsections for the
+ definition of each opcode.
+
+ @retval EFI_SUCCESS The operation succeeded. A record was added into the specified
+ script table.
+ @retval EFI_INVALID_PARAMETER The parameter is illegal or the given boot script is not supported.
+ @retval EFI_OUT_OF_RESOURCES There is insufficient memory to store the boot script.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_S3_SAVE_STATE_WRITE)(
+ IN CONST EFI_S3_SAVE_STATE_PROTOCOL *This,
+ IN UINT16 OpCode,
+ ...
+);
+
+/**
+ Record operations that need to be replayed during an S3 resume.
+
+ This function is used to store an OpCode to be replayed as part of the S3 resume boot path. It is
+ assumed this protocol has platform specific mechanism to store the OpCode set and replay them
+ during the S3 resume.
+ The opcode is inserted before or after the specified position in the boot script table. If Position is
+ NULL then that position is after the last opcode in the table (BeforeOrAfter is TRUE) or before
+ the first opcode in the table (BeforeOrAfter is FALSE). The position which is pointed to by
+ Position upon return can be used for subsequent insertions.
+
+ This function has a variable parameter list. The exact parameter list depends on the OpCode that is
+ passed into the function. If an unsupported OpCode or illegal parameter list is passed in, this
+ function returns EFI_INVALID_PARAMETER.
+ If there are not enough resources available for storing more scripts, this function returns
+ EFI_OUT_OF_RESOURCES.
+ OpCode values of 0x80 - 0xFE are reserved for implementation specific functions.
+
+ @param[in] This A pointer to the EFI_S3_SAVE_STATE_PROTOCOL instance.
+ @param[in] BeforeOrAfter Specifies whether the opcode is stored before (TRUE) or after (FALSE) the position
+ in the boot script table specified by Position. If Position is NULL or points to
+ NULL then the new opcode is inserted at the beginning of the table (if TRUE) or end
+ of the table (if FALSE).
+ @param[in, out] Position On entry, specifies the position in the boot script table where the opcode will be
+ inserted, either before or after, depending on BeforeOrAfter. On exit, specifies
+ the position of the inserted opcode in the boot script table.
+ @param[in] OpCode The operation code (opcode) number. See "Related Definitions" in Write() for the
+ defined opcode types.
+ @param[in] ... Argument list that is specific to each opcode. See the following subsections for the
+ definition of each opcode.
+
+ @retval EFI_SUCCESS The operation succeeded. An opcode was added into the script.
+ @retval EFI_INVALID_PARAMETER The Opcode is an invalid opcode value.
+ @retval EFI_INVALID_PARAMETER The Position is not a valid position in the boot script table.
+ @retval EFI_OUT_OF_RESOURCES There is insufficient memory to store the boot script table.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_S3_SAVE_STATE_INSERT)(
+ IN CONST EFI_S3_SAVE_STATE_PROTOCOL *This,
+ IN BOOLEAN BeforeOrAfter,
+ IN OUT EFI_S3_BOOT_SCRIPT_POSITION *Position OPTIONAL,
+ IN UINT16 OpCode,
+ ...
+);
+
+/**
+ Find a label within the boot script table and, if not present, optionally create it.
+
+ If the label Label is already exists in the boot script table, then no new label is created, the
+ position of the Label is returned in *Position and EFI_SUCCESS is returned.
+ If the label Label does not already exist and CreateIfNotFound is TRUE, then it will be
+ created before or after the specified position and EFI_SUCCESS is returned.
+ If the label Label does not already exist and CreateIfNotFound is FALSE, then
+ EFI_NOT_FOUND is returned.
+
+ @param[in] This A pointer to the EFI_S3_SAVE_STATE_PROTOCOL instance.
+ @param[in] BeforeOrAfter Specifies whether the label is stored before (TRUE) or after (FALSE) the position in
+ the boot script table specified by Position. If Position is NULL or points to
+ NULL then the new label is inserted at the beginning of the table (if TRUE) or end of
+ the table (if FALSE).
+ @param[in] CreateIfNotFound Specifies whether the label will be created if the label does not exists (TRUE) or not (FALSE).
+ @param[in, out] Position On entry, specifies the position in the boot script table where the label will be inserted,
+ either before or after, depending on BeforeOrAfter. On exit, specifies the position
+ of the inserted label in the boot script table.
+ @param[in] Label Points to the label which will be inserted in the boot script table.
+
+ @retval EFI_SUCCESS The label already exists or was inserted.
+ @retval EFI_NOT_FOUND The label did not already exist and CreateifNotFound was FALSE.
+ @retval EFI_INVALID_PARAMETER The Opcode is an invalid opcode value.
+ @retval EFI_INVALID_PARAMETER The Position is not a valid position in the boot script table.
+ @retval EFI_OUT_OF_RESOURCES There is insufficient memory to store the boot script.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_S3_SAVE_STATE_LABEL)(
+ IN CONST EFI_S3_SAVE_STATE_PROTOCOL *This,
+ IN BOOLEAN BeforeOrAfter,
+ IN BOOLEAN CreateIfNotFound,
+ IN OUT EFI_S3_BOOT_SCRIPT_POSITION *Position OPTIONAL,
+ IN CONST CHAR8 *Label
+);
+
+/**
+ Compare two positions in the boot script table and return their relative position.
+
+ This function compares two positions in the boot script table and returns their relative positions. If
+ Position1 is before Position2, then -1 is returned. If Position1 is equal to Position2,
+ then 0 is returned. If Position1 is after Position2, then 1 is returned.
+
+ @param[in] This A pointer to the EFI_S3_SAVE_STATE_PROTOCOL instance.
+ @param[in] Position1 The positions in the boot script table to compare.
+ @param[in] Position2 The positions in the boot script table to compare.
+ @param[out] RelativePosition On return, points to the result of the comparison.
+
+ @retval EFI_SUCCESS The label already exists or was inserted.
+ @retval EFI_INVALID_PARAMETER The Position1 or Position2 is not a valid position in the boot script table.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_S3_SAVE_STATE_COMPARE)(
+ IN CONST EFI_S3_SAVE_STATE_PROTOCOL *This,
+ IN EFI_S3_BOOT_SCRIPT_POSITION Position1,
+ IN EFI_S3_BOOT_SCRIPT_POSITION Position2,
+ OUT UINTN *RelativePosition
+);
+
+struct _EFI_S3_SAVE_STATE_PROTOCOL {
+ EFI_S3_SAVE_STATE_WRITE Write;
+ EFI_S3_SAVE_STATE_INSERT Insert;
+ EFI_S3_SAVE_STATE_LABEL Label;
+ EFI_S3_SAVE_STATE_COMPARE Compare;
+};
+
+//extern EFI_GUID gEfiS3SaveStateProtocolGuid;
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif // __S3_SAVE_STATE_H__
diff --git a/Include/Protocol/S3SmmSaveState.h b/Include/Protocol/S3SmmSaveState.h
new file mode 100644
index 0000000..50606b1
--- /dev/null
+++ b/Include/Protocol/S3SmmSaveState.h
@@ -0,0 +1,46 @@
+/** @file
+ S3 SMM Save State Protocol as defined in PI1.2 Specification VOLUME 5 Standard.
+
+ The EFI_S3_SMM_SAVE_STATE_PROTOCOL publishes the PI SMMboot script abstractions
+ On an S3 resume boot path the data stored via this protocol is replayed in the order it was stored.
+ The order of replay is the order either of the S3 Save State Protocol or S3 SMM Save State Protocol
+ Write() functions were called during the boot process. Insert(), Label(), and
+ Compare() operations are ordered relative other S3 SMM Save State Protocol write() operations
+ and the order relative to S3 State Save Write() operations is not defined. Due to these ordering
+ restrictions it is recommended that the S3 State Save Protocol be used during the DXE phase when
+ every possible.
+ The EFI_S3_SMM_SAVE_STATE_PROTOCOL can be called at runtime and
+ EFI_OUT_OF_RESOURCES may be returned from a runtime call. It is the responsibility of the
+ platform to ensure enough memory resource exists to save the system state. It is recommended that
+ runtime calls be minimized by the caller.
+
+ Copyright (c) 2009, Intel Corporation
+ All rights reserved. This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+ @par Revision Reference:
+ This PPI is defined in UEFI Platform Initialization Specification 1.2 Volume 5:
+ Standards
+
+**/
+
+#ifndef __S3_SMM_SAVE_STATE_H__
+#define __S3_SMM_SAVE_STATE_H__
+
+#include <Protocol/S3SaveState.h>
+
+#define EFI_S3_SMM_SAVE_STATE_PROTOCOL_GUID \
+ {0x320afe62, 0xe593, 0x49cb, 0xa9, 0xf1, 0xd4, 0xc2, 0xf4, 0xaf, 0x1, 0x4c}
+
+GUID_VARIABLE_DECLARATION(gEfiS3SmmSaveStateProtocolGuid,EFI_S3_SMM_SAVE_STATE_PROTOCOL_GUID);
+
+typedef EFI_S3_SAVE_STATE_PROTOCOL EFI_S3_SMM_SAVE_STATE_PROTOCOL;
+
+
+#endif // __S3_SMM_SAVE_STATE_H__
+
diff --git a/Include/Protocol/SBPlatformData.h b/Include/Protocol/SBPlatformData.h
new file mode 100644
index 0000000..ba1eeda
--- /dev/null
+++ b/Include/Protocol/SBPlatformData.h
@@ -0,0 +1,93 @@
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
+
+//*************************************************************************
+// $Header: /Alaska/BIN/Chipset/Intel/SouthBridge/LynxPoint/Intel Pch SB Chipset/SB Protocols/SBPlatformData.h 3 4/24/13 6:50a Scottyang $
+//
+// $Revision: 3 $
+//
+// $Date: 4/24/13 6:50a $
+//*************************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Chipset/Intel/SouthBridge/LynxPoint/Intel Pch SB Chipset/SB Protocols/SBPlatformData.h $
+//
+// 3 4/24/13 6:50a Scottyang
+// [TAG] EIP82149
+// [Category] Improvement
+// [Description] Intel(R) 8 Series Chipset Family Deep Sx and CPU
+// Soft-Strap BIOS Override Co-Existence Issue. If the soft-strap override
+// feature is required and enabled, BIOS must disable Deep Sx
+// functionality.
+// [Files] SBDxe.c, SB.sd, SBPlatformData.h
+//
+// 2 10/16/12 5:15a Scottyang
+// [TAG] None
+//
+// [Category] Improvement
+//
+// [Description] One rom for two chip and one chip.
+// [Files] SPPEIBoard.c, SB.sd, SBDxe.c, SBPEI.c, PCH.asl,
+// SBPlatformData.h
+//
+// 1 2/08/12 8:26a Yurenlai
+// Intel Lynx Point/SB eChipset initially releases.
+//
+//*************************************************************************
+//<AMI_FHDR_START>
+//
+// Name: SBPlatformData.h
+//
+// Description: SB Specific Setup Variables and Structures
+//
+//<AMI_FHDR_END>
+//**********************************************************************
+#ifndef _SB_PLATFORM_DATA_H_
+#define _SB_PLATFORM_DATA_H_
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ #pragma pack(1)
+
+ typedef struct _SB_PLATFORM_DATA
+ {
+ UINT8 PchHotLevelPresent;
+ UINT8 GbePciePortNum;
+ UINT8 PcieSBDE;
+ UINT8 PchRid;
+ UINT8 LPTType;
+ UINT8 HideDeepSx; // [EIP82149]
+ }SB_PLATFORM_DATA;
+
+ #pragma pack()
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
diff --git a/Include/Protocol/SBSmiProtocol.h b/Include/Protocol/SBSmiProtocol.h
new file mode 100644
index 0000000..be7d2c3
--- /dev/null
+++ b/Include/Protocol/SBSmiProtocol.h
@@ -0,0 +1,134 @@
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
+
+//*************************************************************************
+// $Header: /Alaska/BIN/Chipset/Intel/SouthBridge/LynxPoint/Intel Pch SB Chipset/SB Protocols/SBSmiProtocol.h 1 2/08/12 8:26a Yurenlai $
+//
+// $Revision: 1 $
+//
+// $Date: 2/08/12 8:26a $
+//*************************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Chipset/Intel/SouthBridge/LynxPoint/Intel Pch SB Chipset/SB Protocols/SBSmiProtocol.h $
+//
+// 1 2/08/12 8:26a Yurenlai
+// Intel Lynx Point/SB eChipset initially releases.
+//
+//*************************************************************************
+//<AMI_FHDR_START>
+//
+// Name: SBSmiProtocol.h
+//
+// Description: South Bridge SMI Dispatch Protocol header.
+//
+//<AMI_FHDR_END>
+//*************************************************************************
+
+#ifndef _SB_SMI_PROTOCOL_H
+#define _SB_SMI_PROTOCOL_H
+
+#pragma pack(push, 1)
+
+// {589BC616-BB4F-47ed-92F7-93393C697E25}
+#define AMI_SB_SMI_PROTOCOL_GUID \
+ {0x589bc616, 0xbb4f, 0x47ed, 0x92, 0xf7, 0x93, 0x39, 0x3c, 0x69, 0x7e, 0x25}
+
+#define EFI_SB_PCIE_ERROR_LOG_DISPATCH_PROTOCOL_GUID \
+ {0xf281fc6e, 0xf4c4, 0x431c, 0x96, 0x2b, 0x2f, 0x13, 0xae, 0x79, 0x84, 0xec}
+
+
+#ifndef __SMM_CHILD_DISPATCH__H__
+typedef struct _GENERIC_LINK GENERIC_LINK;
+typedef struct _GENERIC_LINK {
+ void *Link;
+};
+#endif
+
+typedef struct _SB_PCIE_ERR
+{
+ UINT32 PcieAddress;
+ UINT8 Bus;
+ UINT8 Dev;
+ UINT8 Fun;
+ UINT16 VendorId;
+ UINT16 DeviceId;
+ UINT16 PciCommand;
+ UINT16 PciStatus;
+ UINT16 PciCCode;
+ UINT16 PcieStatus;
+ UINT32 PortType;
+ UINT8 Version;
+ UINT16 SecondaryStatus;
+ UINT16 BridgeControl;
+ BOOLEAN Correctable;
+ BOOLEAN NonFatal;
+ BOOLEAN Fatal;
+ BOOLEAN ParityError;
+ BOOLEAN SystemError;
+} SB_PCIE_ERR;
+
+typedef struct _EFI_SB_PCIE_ERROR_LOG_DISPATCH_PROTOCOL EFI_SB_PCIE_ERROR_LOG_DISPATCH_PROTOCOL;
+
+typedef VOID (EFIAPI *EFI_SB_PCIE_ERROR_LOG_DISPATCH) (
+ IN EFI_HANDLE DispatchHandle,
+ IN SB_PCIE_ERR SbPcieErrorInfo
+);
+
+typedef struct _SB_PCIE_ERROR_LOG_DISPATCH_LINK SB_PCIE_ERROR_LOG_DISPATCH_LINK;
+struct _SB_PCIE_ERROR_LOG_DISPATCH_LINK {
+ IN SB_PCIE_ERROR_LOG_DISPATCH_LINK *Link;
+ IN EFI_SB_PCIE_ERROR_LOG_DISPATCH Function;
+};
+
+typedef EFI_STATUS (EFIAPI *EFI_SB_PCIE_ERROR_LOG_REGISTER) (
+ IN EFI_SB_PCIE_ERROR_LOG_DISPATCH_PROTOCOL *This,
+ IN EFI_SB_PCIE_ERROR_LOG_DISPATCH DispatchFunction,
+ OUT EFI_HANDLE *DispatchHandle
+);
+
+typedef EFI_STATUS (EFIAPI *EFI_SB_PCIE_ERROR_LOG_UNREGISTER) (
+ IN EFI_SB_PCIE_ERROR_LOG_DISPATCH_PROTOCOL *This,
+ IN EFI_HANDLE DispatchHandle
+);
+
+struct _EFI_SB_PCIE_ERROR_LOG_DISPATCH_PROTOCOL {
+ EFI_SB_PCIE_ERROR_LOG_REGISTER Register;
+ EFI_SB_PCIE_ERROR_LOG_UNREGISTER UnRegister;
+};
+
+#define NMI_SC_PORT 0x61
+#define SMI_EN_OFFSET 0x30 //SMI Control and Enable Register
+#define SMI_STS_OFFSET 0x34 //SMI Status Register
+#define TCOBASE_OFFSET 0x60 //TCO registers offset
+#define TCO1_CNT_OFFSET TCOBASE_OFFSET + 0x08 //TCO1 Control Register
+#define TCO1_STS_OFFSET TCOBASE_OFFSET + 0x04 //TCO1 Status Register
+
+#pragma pack(pop)
+
+#endif
+
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
diff --git a/Include/Protocol/SMBIOSProto.CIF b/Include/Protocol/SMBIOSProto.CIF
new file mode 100644
index 0000000..69efc5c
--- /dev/null
+++ b/Include/Protocol/SMBIOSProto.CIF
@@ -0,0 +1,10 @@
+<component>
+ name = "SMBIOS - Protocols"
+ category = ModulePart
+ LocalRoot = "Include\Protocol"
+ RefName = "SMBIOSProto"
+[files]
+"SmbiosDynamicData.h"
+"SmbiosGetFlashDataProtocol.h"
+"SMBios.h"
+<endComponent>
diff --git a/Include/Protocol/SMBios.h b/Include/Protocol/SMBios.h
new file mode 100644
index 0000000..1a564e6
--- /dev/null
+++ b/Include/Protocol/SMBios.h
@@ -0,0 +1,1729 @@
+//**********************************************************************//
+//**********************************************************************//
+//** **//
+//** (C)Copyright 1985-2016, American Megatrends, Inc. **//
+//** **//
+//** All Rights Reserved. **//
+//** **//
+//** 5555 Oakbrook Pkwy, Suite 200, Norcross, GA 30093 **//
+//** **//
+//** Phone: (770)-246-8600 **//
+//** **//
+//**********************************************************************//
+//**********************************************************************//
+
+//**********************************************************************//
+// $Header: /Alaska/BIN/Modules/SMBIOS/SmbiosProtocol/SMBios.h 30 4/07/16 5:51p Davidd $
+//
+// $Revision: 30 $
+//
+// $Date: 4/07/16 5:51p $
+//**********************************************************************//
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Modules/SMBIOS/SmbiosProtocol/SMBios.h $
+//
+// 30 4/07/16 5:51p Davidd
+// [TAG] EIP231162
+// [Category] New Feature
+// [Description] Merge Aptio V Smbios -09 changes for Aptio 4
+// 4.6.5.5_SMBIOS_40 release
+// [Files] Smbios.sdl
+// SmbiosDynamicData.h
+// Smbios.h
+// SmbiosStaticData.sdl
+// SmbiosStaticData.asm
+// SmbData.mac
+// SmbMacro.aid
+// SmbDesc.def
+//
+// 29 6/13/14 3:25p Davidd
+// [TAG] EIP171151
+// [Category] Bug Fix
+// [Severity] Minor
+// [Symptom] Smbios Type 12 - Changes beyond string #8 were not
+// persistent across the reboot
+// [RootCause] Test flag is only 8 bits
+// [Solution] Create and use array of test flags for specified number of
+// Type 12 structure
+// [Files] Smbios.c
+// Smbios.h
+//
+// 28 6/03/13 6:21p Davidd
+// [TAG] EIP125665
+// [Category] New Feature
+// [Description] Request to Support multiple instances of SMBIOS Type 3
+// structure (merge EIP106206 into Aptio 4)
+// [Files] Smbdata.mac
+// SmbiosStaticData.sdl
+// Smbstruc.def
+// Smbios.c
+// SmbiosDMIEditFunc.c
+// Smbios.h
+//
+// 27 5/29/13 12:48p Davidd
+// [TAG] EIP124735
+// [Category] Spec Update
+// [Severity] Normal
+// [Description] SMBIOS 2.8.0 specification support for Aptio 4
+// [Files] Smb.equ
+// Smbdata.mac
+// Smbdesc.def
+// Smbstruc.def
+// Smbios.c
+// Smbios.h
+// SmbiosDynamicData.h
+//
+// 26 5/23/13 2:38p Davidd
+// [TAG] EIP104836
+// [Category] New Feature
+// [Description] DMIEdit support edit type 4
+// [Files] SmbiosBoard.c
+// SmbiosDMIEditBoard.sdl
+// Smbios.c
+// SmbiosDMIEditFunc.c
+// Smbios.h
+// SmbiosDynamicData.h
+//
+// 25 6/11/12 11:24a Davidd
+// [TAG] EIP92170
+// [Category] Improvement
+// [Description] Adding DmiEdit support for multiple instances of Smbios
+// type 39 structure to match with AMI DmiEdit tool
+// [Files] Smbios.h
+// Smbios.c
+// SmbiosStaticData.sdl
+//
+// 24 3/26/12 12:04p Davidd
+// [TAG] EIP84370
+// [Category] New Feature
+// [Description] Flash memory(type 16 and 17) on aptio
+// [Files] Smbdata.mac
+// SmbiosStaticData.asm
+// SmbiosStaticData.sdl
+// Smbios.c
+// Smbios.mak
+// Smbios.h
+//
+// 23 3/09/12 10:56a Davidd
+// [TAG] EIP81469
+// [Category] Bug Fix
+// [Severity] Normal
+// [Symptom] SMBIOS protocl didn't compatible with PI1.1
+// [RootCause] PI1.1 protocol functions incorrectly added after AMI
+// functions of Smbios protocols.
+// [Solution] Moved PI1.1 protocol functions to the top of the protocol.
+// [Files] Smbios.c
+// Smbios.h
+//
+// 22 1/17/12 4:37p Davidd
+// [TAG] EIP78264
+// [Category] Improvement
+// [Description] SMBOS Type 2 (Spec 2.7.1) - No multiple type 2 support
+// [Files] Smbios.c
+// Smbios.h
+// Smbdata.mac
+// Smbdesc.def
+// SmbiosStaticData.sdl
+//
+// 21 11/17/11 2:43p Davidd
+// [TAG] EIP74579
+// [Category] Improvement
+// [Description] Update SMBIOS moudule to let AMDELNX support SMBIOS
+// spec 2.7
+// (remove the 64 characters string limitation)
+// [Files] Smbios.h
+// SmbiosStaticData.sdl
+// Smbios.c
+// SMBios.dxs
+// SmbiosDMIEdit.sdl
+// SmbiosDMIEdit.h
+// SmbiosDMIEditFunc.c
+// SmbiosNvram.c
+// SmbiosFlashData.sdl
+//
+// 20 10/05/11 3:53p Davidd
+// [Category] NEW FEATURE
+// [Description] Allow Smbios Type 2 Location field and Type 3 SKU
+// Number field
+// to be updated by dmieditwingui tool
+// [Files] Smbios.c
+// SmbiosDMIEditFunc.c
+// Smbdata.mac
+// Smbios.h
+//
+// 19 8/03/11 10:54a Davidd
+// [TAG] EIP64029
+// [Category] NEW FEATURE
+// [Description] Allow SMBIOS Type 22 to be modified using DMIEdit
+// [Files] Smbios.h
+// Smbios.c
+// SmbiosDmieditFunc.c
+//
+// 18 6/10/11 3:02p Davidd
+// [TAG] EIP61934
+// [Category] Improvement
+// [Description] Dependency viewer is not working in Chief River Project
+// [Files] Smbios.h
+//
+// 17 5/04/11 3:34p Davidd
+// [TAG] EIP57144
+// [Category] NEW FEATURE
+// [Description] Allow SMBIOS Type 39 to be modified using DMIEdit
+// [Files] SmbiosBoard.c
+// Smbios.h
+// SmbiosDynamicData.h
+// Smbios.c
+// SmbiosDmieditFunc.c
+// SmbiosNvramFunc.c
+//
+// 16 11/02/10 4:17p Davidd
+// [TAG] EIP42938
+// [Category] BUG FIX
+// [Severity] Critical
+// [Symptom] The SMBIOS string field cannot be successfully updated
+// if it was programmed to Null by the 3-party SMBIOS tool
+// [RootCause] BIOS did not have support for NULL strings
+// [Solution] Problem has been fixed with code changes
+// [Files]
+// Smbios.c
+// SmbiosDMIEditFunc.c
+// SmbiosGetFlashData.c
+// SmbiosDMIEdit.h
+// SmbiosFlashData.sdl
+//
+// 15 10/08/10 8:14p Davidd
+// [TAG] EIP43278
+//
+// [Category] Function Request
+//
+// [Severity] Normal
+//
+// [Description] SMBIOS 2.7 requirement
+//
+// [Files] Include\Protocol\Smbios.h
+// Include\Protocol\SmbiosDynamicData.h
+// Board\EM\SMBIOS\SMBiosStaticData\SmbiosStaticData.sdl
+// Board\EM\SMBIOS\SMBiosStaticData\SMBDATA.MAC
+// Board\EM\SMBIOS\SMBiosStaticData\SMBSTRUC.DEF
+// Board\EM\SMBIOS\SMBiosStaticData\SMBMACRO.AID
+// Board\EM\SMBIOS\SMBiosStaticData\Smbdesc.def
+// Board\EM\SMBIOS\SMBiosStaticData\SMB.EQU
+//
+// 14 5/18/10 5:15p Davidd
+// Added PnP function 52h commands 3 and 4 support - EIP 38010.
+//
+// 13 5/06/10 10:37a Davidd
+// Added Smbios PI 1.1 support.
+//
+// 12 11/23/09 5:52p Davidd
+// Corrected the DMIEdit data not updated after being updated 5-6 times
+// (when NVRAM is used to store DMIEdit data) - EIP 30837.
+//
+// 11 1/28/09 11:36a Davidd
+//
+// 10 11/14/08 4:44p Davidd
+// - Added GetFreeHandle protocol
+// - Added AddStructureByHandle protocol
+// - Added ReadStructureByType protocol
+//
+// 9 10/23/08 6:22p Davidd
+// Added changes to support SMBIOS version 2.5 and 2.6.
+//
+// 8 11/26/07 11:39a Davidd
+//
+// 7 11/21/07 10:39a Davidd
+// Added SmbiosUpdateHeader protocol.
+//
+// 6 11/09/07 11:15a Davidd
+// Reapply the fixes for long string that were inadvertently changed in
+// revision 5.
+//
+// 5 6/21/07 3:11p Pats
+// Modified to support editing of SMBIOS structure type 0, offsets 5 and 8
+//
+// 4 4/18/07 12:36p Davidd
+// Fixed long strings (64 characters) problem after being updated with
+// DMIEdit and system restarted.
+//
+// 3 3/28/07 7:49p Davidd
+// Updated the year on the AMI banner
+//
+// 2 12/15/06 1:16p Davidd
+// Code cleanup and reformatted to coding standard.
+//
+// 1 3/02/06 2:29p Davidd
+//
+// 3 8/10/05 10:35a Davidd
+// Removed definition for EFI_SMBIOS_PROTOCOL_GUID. It has been moved to
+// SmbiosGetFlashDataProtocol.h
+//
+// 2 7/20/05 12:41p Davidd
+// - Corrected dynamic update on-board device problem.
+//
+// 1 4/29/05 2:03p Davidd
+// Initial checkin.
+//
+//**********************************************************************//
+
+#ifndef _Smbios_DRIVER_H
+#define _Smbios_DRIVER_H
+
+#include <token.h>
+
+#define EFI_SMBIOS_STATIC_DATA_GUID \
+ {0xdaf4bf89, 0xce71, 0x4917, { 0xb5, 0x22, 0xc8, 0x9d, 0x32, 0xfb, 0xc5, 0x9f }}
+#define EFI_SMBIOS_NVRAM_DATA_GUID \
+ {0x4b3082a3, 0x80c6, 0x4d7e, { 0x9c, 0xd0, 0x58, 0x39, 0x17, 0x26, 0x5d, 0xf1 }}
+
+#ifndef EFI_SMBIOS_PROTOCOL_GUID
+ #if (SMBIOS_PI_1_1 == 0)
+ #define EFI_SMBIOS_PROTOCOL_GUID \
+ {0x5e90a50d, 0x6955, 0x4a49, { 0x90, 0x32, 0xda, 0x38, 0x12, 0xf8, 0xe8, 0xe5 }}
+ #else
+ #define EFI_SMBIOS_PROTOCOL_GUID \
+ {0x03583ff6, 0xcb36, 0x4940, { 0x94, 0x7e, 0xb9, 0xb3, 0x9f, 0x4a, 0xfa, 0xf7 }}
+ #endif
+#endif
+
+//**********************************************************************//
+// DMI ERROR Codes
+//**********************************************************************//
+
+#define DMI_SUCCESS 0x00
+#define DMI_UNKNOWN_FUNCTION 0x81
+#define DMI_FUNCTION_NOT_SUPPORTED 0x82
+#define DMI_INVALID_HANDLE 0x83
+#define DMI_BAD_PARAMETER 0x84
+#define DMI_INVALID_SUBFUNCTION 0x85
+#define DMI_NO_CHANGE 0x86
+#define DMI_ADD_STRUCTURE_FAILED 0x87
+#define DMI_READ_ONLY 0x8D
+#define DMI_LOCK_NOT_SUPPORTED 0x90
+#define DMI_CURRENTLY_LOCKED 0x91
+#define DMI_INVALID_LOCK 0x92
+
+//**********************************************************************//
+
+#pragma pack(1)
+
+//<AMI_SHDR_START>
+//----------------------------------------------------------------------------
+// Name: SMBIOS_TABLE_ENTRY_POINT
+//
+// Description: SMBIOS Structure Table Entry Point
+//----------------------------------------------------------------------------
+//<AMI_SHDR_END>
+typedef struct {
+ UINT8 AnchorString[4];
+ UINT8 EntryPointStructureChecksum;
+ UINT8 EntryPointLength;
+ UINT8 MajorVersion;
+ UINT8 MinorVersion;
+ UINT16 MaxStructureSize;
+ UINT8 EntryPointRevision;
+ UINT8 FormattedArea[5];
+ UINT8 IntermediateAnchorString[5];
+ UINT8 IntermediateChecksum;
+ UINT16 TableLength;
+ UINT32 TableAddress;
+ UINT16 NumberOfSmbiosStructures;
+ UINT8 SmbiosBCDRevision;
+} SMBIOS_TABLE_ENTRY_POINT;
+
+//<AMI_SHDR_START>
+//----------------------------------------------------------------------------
+// Name: SMBIOS_STRUCTURE_HEADER
+//
+// Description: SMBIOS Structure Header - Common for all structures
+// Describing the type, size of the fixed area, and handle
+// of the structure.
+//----------------------------------------------------------------------------
+//<AMI_SHDR_END>
+typedef struct {
+ UINT8 Type;
+ UINT8 Length;
+ UINT16 Handle;
+} SMBIOS_STRUCTURE_HEADER;
+
+//<AMI_SHDR_START>
+//----------------------------------------------------------------------------
+// Name: SMBIOS_BIOS_INFO
+//
+// Description: BIOS Information Structure (Type 0)
+//----------------------------------------------------------------------------
+//<AMI_SHDR_END>
+typedef struct {
+ SMBIOS_STRUCTURE_HEADER StructureType;
+ UINT8 BiosVendor; // String number
+ UINT8 BiosVersion; // String number
+ UINT16 BiosStartingAddrSegment;
+ UINT8 BiosReleaseDate; // String number
+ UINT8 BiosRomSize;
+ UINT32 BiosChar_1;
+ UINT32 BiosChar_2;
+ UINT8 BiosCharExtByte1;
+ UINT8 BiosCharExtByte2;
+ UINT8 SystemBiosMajorRelease;
+ UINT8 SystemBiosMinorRelease;
+ UINT8 ECFirmwareMajorRelease;
+ UINT8 ECFirmwareMinorRelease;
+} SMBIOS_BIOS_INFO; // TYPE 0
+
+//<AMI_SHDR_START>
+//----------------------------------------------------------------------------
+// Name: SMBIOS_SYSTEM_INFO
+//
+// Description: System Information Structure (Type 1)
+//----------------------------------------------------------------------------
+//<AMI_SHDR_END>
+typedef struct {
+ SMBIOS_STRUCTURE_HEADER StructureType;
+ UINT8 Manufacturer; // String number
+ UINT8 ProductName; // String number
+ UINT8 Version; // String number
+ UINT8 SerialNumber; // String number
+ EFI_GUID Uuid;
+ UINT8 WakeupType;
+ UINT8 SkuNumber;
+ UINT8 Family;
+} SMBIOS_SYSTEM_INFO; // TYPE 1
+
+#if BASE_BOARD_INFO
+//<AMI_SHDR_START>
+//----------------------------------------------------------------------------
+// Name: SMBIOS_BASE_BOARD_INFO
+//
+// Description: Base Board (or Module) Information Structure (Type 2)
+//----------------------------------------------------------------------------
+//<AMI_SHDR_END>
+typedef struct {
+ SMBIOS_STRUCTURE_HEADER StructureType;
+ UINT8 Manufacturer; // String number
+ UINT8 ProductName; // String number
+ UINT8 Version; // String number
+ UINT8 SerialNumber; // String number
+ UINT8 AssetTag; // String number
+ UINT8 FeatureTag;
+ UINT8 Location; // String number
+ UINT16 ChassisHandle;
+ UINT8 BoardType;
+ UINT8 NumberOfObjectHandles;
+#if NUMBER_OF_OBJECT_HANDLES != 0
+ UINT8 ObjectHandles[NUMBER_OF_OBJECT_HANDLES];
+#endif
+} SMBIOS_BASE_BOARD_INFO; // TYPE 2
+#endif
+
+//<AMI_SHDR_START>
+//----------------------------------------------------------------------------
+// Name: SMBIOS_SYSTEM_ENCLOSURE_INFO
+//
+// Description: System Enclosure or Chassis Information Structure (Type 3)
+//----------------------------------------------------------------------------
+//<AMI_SHDR_END>
+typedef struct {
+ SMBIOS_STRUCTURE_HEADER StructureType;
+ UINT8 Manufacturer; // String number
+ UINT8 Type;
+ UINT8 Version; // String number
+ UINT8 SerialNumber; // String number
+ UINT8 AssetTag; // String number
+ UINT8 BootupState;
+ UINT8 PowerSupplyState;
+ UINT8 ThermalState;
+ UINT8 SecurityStatus;
+ UINT32 OemDefined;
+ UINT8 Height;
+ UINT8 NumberOfPowerCord;
+ UINT8 ElementCount;
+ UINT8 ElementRecordLength;
+#if ((ELEMENT_COUNT != 0) && (ELEMENT_LEN != 0))
+ UINT8 Elements[ELEMENT_COUNT * ELEMENT_LEN];
+#endif
+ UINT8 SkuNumber;
+} SMBIOS_SYSTEM_ENCLOSURE_INFO; // TYPE 3
+
+//<AMI_SHDR_START>
+//----------------------------------------------------------------------------
+// Name: SMBIOS_PROCESSOR_INFO
+//
+// Description: Processor Information Structure (Type 4)
+//----------------------------------------------------------------------------
+//<AMI_SHDR_END>
+typedef struct {
+ SMBIOS_STRUCTURE_HEADER StructureType;
+ UINT8 SocketDesignation; // String number
+ UINT8 ProcessotType;
+ UINT8 Family;
+ UINT8 ProcessorManufacturer; // String number
+ UINT32 ProcessorID_1;
+ UINT32 ProcessorID_2;
+ UINT8 ProcessorVersion; // String number
+ UINT8 Voltage;
+ UINT16 ExtClockFreq;
+ UINT16 MaxSpeed;
+ UINT16 CurrentSpeed;
+ UINT8 Status;
+ UINT8 Upgrade;
+ UINT16 L1CacheHandle;
+ UINT16 L2CacheHandle;
+ UINT16 L3CacheHandle;
+ UINT8 SerialNumber; // String number
+ UINT8 AssetTag; // String number
+ UINT8 PartNumber; // String number
+ UINT8 CoreCount; // Number of cores per processor socket
+ UINT8 CoreEnabled; // Number of enabled cores per processor socket
+ UINT8 ThreadCount; // Number of threads per processor socket
+ UINT16 ProcessorChar; // Defines which functions the processor supports
+ UINT16 Family2;
+} SMBIOS_PROCESSOR_INFO; // TYPE 4
+
+#if MEM_CTRL_INFO
+//<AMI_SHDR_START>
+//----------------------------------------------------------------------------
+// Name: SMBIOS_MEM_CONTROLLER_INFO
+//
+// Description: Memory Controller Information Structure (Type 5)
+//----------------------------------------------------------------------------
+//<AMI_SHDR_END>
+typedef struct {
+ SMBIOS_STRUCTURE_HEADER StructureType;
+ UINT8 ErrDetMethod;
+ UINT8 ECC;
+ UINT8 SupportInterleave;
+ UINT8 CurrentInterleave;
+ UINT8 MaxMemModuleSize;
+ UINT16 SupportSpeed;
+ UINT16 SupportMemTypes;
+ UINT8 MemModuleVoltage;
+ UINT8 NumberMemSlots;
+ UINT16 MemModuleConfigHandle[NUMBER_OF_MEM_MODULE];
+ UINT8 EnabledECC;
+} SMBIOS_MEM_CONTROLLER_INFO; // TYPE 5
+#endif
+
+#if MEM_MODULE_INFO
+//<AMI_SHDR_START>
+//----------------------------------------------------------------------------
+// Name: SMBIOS_MEM_MODULE_INFO
+//
+// Description: Memory Module Information Structure (Type 6)
+//----------------------------------------------------------------------------
+//<AMI_SHDR_END>
+typedef struct {
+ SMBIOS_STRUCTURE_HEADER StructureType;
+ UINT8 SocketDesignation;
+ UINT8 BankConnections;
+ UINT8 CurrentSpeed;
+ UINT16 CurrentMemType;
+ UINT8 InstalledSize;
+ UINT8 EnabledSize;
+ UINT8 ErrorStatus;
+} SMBIOS_MEM_MODULE_INFO; // TYPE 6
+#endif
+
+//<AMI_SHDR_START>
+//----------------------------------------------------------------------------
+// Name: SMBIOS_CACHE_INFO
+//
+// Description: Cache Information Structure (Type 7)
+//----------------------------------------------------------------------------
+//<AMI_SHDR_END>
+typedef struct {
+ SMBIOS_STRUCTURE_HEADER StructureType;
+ UINT8 SocketDesignation;
+ UINT16 CacheConfig;
+ UINT16 MaxCacheSize;
+ UINT16 InstalledSize;
+ UINT16 SupportSRAM;
+ UINT16 CurrentSRAM;
+ UINT8 CacheSpeed;
+ UINT8 ErrorCorrectionType;
+ UINT8 SystemCacheType;
+ UINT8 Associativity;
+} SMBIOS_CACHE_INFO; // TYPE 7
+
+#if PORT_CONNECTOR_INFO
+//<AMI_SHDR_START>
+//----------------------------------------------------------------------------
+// Name: SMBIOS_PORT_CONN_INFO
+//
+// Description: Port Connector Information Structure (Type 8)
+//----------------------------------------------------------------------------
+//<AMI_SHDR_END>
+typedef struct {
+ SMBIOS_STRUCTURE_HEADER StructureType;
+ UINT8 IntRefDesig;
+ UINT8 IntConnType;
+ UINT8 ExtRefDesig;
+ UINT8 ExtConnType;
+ UINT8 PortType;
+} SMBIOS_PORT_CONN_INFO; // TYPE 8
+#endif
+
+//<AMI_SHDR_START>
+//----------------------------------------------------------------------------
+// Name: SMBIOS_SYSTEM_SLOTS_INFO
+//
+// Description: System Slot Information Structure (Type 9)
+//----------------------------------------------------------------------------
+//<AMI_SHDR_END>
+typedef struct {
+ SMBIOS_STRUCTURE_HEADER StructureType;
+ UINT8 SlotDesig;
+ UINT8 SlotType;
+ UINT8 SlotDataBusWidth;
+ UINT8 CurrentUsage;
+ UINT8 SlotLength;
+ UINT16 SlotID;
+ UINT8 SlotChar_1;
+ UINT8 SlotChar_2;
+ UINT16 SegGroupNumber;
+ UINT8 BusNumber;
+ UINT8 DevFuncNumber;
+} SMBIOS_SYSTEM_SLOTS_INFO; // TYPE 9
+
+#if ONBOARD_DEVICE_INFO
+//<AMI_SHDR_START>
+//----------------------------------------------------------------------------
+// Name: SINGLE_DEV_INFO
+//
+// Description: Single Device Information
+//----------------------------------------------------------------------------
+//<AMI_SHDR_END>
+typedef struct {
+ UINT8 DeviceType;
+ UINT8 DescStringNum;
+} SINGLE_DEV_INFO;
+
+//<AMI_SHDR_START>
+//----------------------------------------------------------------------------
+// Name: SMBIOS_ONBOARD_DEV_INFO
+//
+// Description: On Board Devices Information Structure (Type 10)
+//----------------------------------------------------------------------------
+//<AMI_SHDR_END>
+typedef struct {
+ SMBIOS_STRUCTURE_HEADER StructureType;
+ SINGLE_DEV_INFO OnBoardDev;
+} SMBIOS_ONBOARD_DEV_INFO; // TYPE 10
+#endif
+
+#if OEM_STRING_INFO
+//<AMI_SHDR_START>
+//----------------------------------------------------------------------------
+// Name: SMBIOS_OEM_STRINGS_INFO
+//
+// Description: OEM Strings Structure (Type 11)
+//----------------------------------------------------------------------------
+//<AMI_SHDR_END>
+typedef struct {
+ SMBIOS_STRUCTURE_HEADER StructureType;
+ UINT8 Count;
+} SMBIOS_OEM_STRINGS_INFO; // TYPE 11
+#endif
+
+#if SYSTEM_CONFIG_OPTION_INFO
+//<AMI_SHDR_START>
+//----------------------------------------------------------------------------
+// Name: SMBIOS_SYSTEM_CONFIG_INFO
+//
+// Description: System Configuration Options (Type 12)
+//----------------------------------------------------------------------------
+//<AMI_SHDR_END>
+typedef struct {
+ SMBIOS_STRUCTURE_HEADER StructureType;
+ UINT8 Count;
+} SMBIOS_SYSTEM_CONFIG_INFO; // TYPE 12
+#endif
+
+#if BIOS_LANGUAGE_INFO
+//<AMI_SHDR_START>
+//----------------------------------------------------------------------------
+// Name: SMBIOS_BIOS_LANG_INFO
+//
+// Description: BIOS Language Information (Type 13)
+//----------------------------------------------------------------------------
+//<AMI_SHDR_END>
+typedef struct {
+ SMBIOS_STRUCTURE_HEADER StructureType;
+ UINT8 InstallableLang;
+ UINT8 Flags;
+ UINT8 Reserved[15];
+ UINT8 CurrentLang;
+} SMBIOS_BIOS_LANG_INFO; // TYPE 13
+#endif
+
+#if EVENT_LOG_INFO
+//<AMI_SHDR_START>
+//----------------------------------------------------------------------------
+// Name: EVENT_LOG_DESCRIPTOR
+//
+// Description: Event Log Descriptor - Part of the System Event Log (Type 15)
+//----------------------------------------------------------------------------
+//<AMI_SHDR_END>
+typedef struct {
+ UINT8 LogType;
+ UINT8 VariableDataFormatType;
+} EVENT_LOG_DESCRIPTOR;
+
+//<AMI_SHDR_START>
+//----------------------------------------------------------------------------
+// Name: SMBIOS_EVENT_LOG_INFO
+//
+// Description: System Event Log (Type 15)
+//----------------------------------------------------------------------------
+//<AMI_SHDR_END>
+typedef struct {
+ SMBIOS_STRUCTURE_HEADER StructureType;
+ UINT16 LogAreaLength;
+ UINT16 LogHeaderStartOffset;
+ UINT16 LogDataStartOffset;
+ UINT8 AccessMethod;
+ UINT8 LogStatus;
+ UINT32 LogChangeToken;
+ UINT32 AccesMethodAddr;
+ UINT8 LogHeaderFormat;
+ UINT8 NumbetOfLogTypeDesc;
+ UINT8 LengthOfLogTypeDesc;
+ EVENT_LOG_DESCRIPTOR LogDescriptors[NO_OF_SUPPORTED_EVENTS];
+} SMBIOS_EVENT_LOG_INFO; // TYPE 15
+#endif
+
+//<AMI_SHDR_START>
+//----------------------------------------------------------------------------
+// Name: SMBIOS_PHYSICAL_MEM_ARRAY_INFO
+//
+// Description: Physical Memory Array (Type 16)
+//----------------------------------------------------------------------------
+//<AMI_SHDR_END>
+typedef struct {
+ SMBIOS_STRUCTURE_HEADER StructureType;
+ UINT8 Location;
+ UINT8 Use;
+ UINT8 MemErrorCorrection;
+ UINT32 MaxCapacity;
+ UINT16 MemErrInfoHandle;
+ UINT16 NumberOfMemDev;
+ UINT64 ExtMaxCapacity;
+} SMBIOS_PHYSICAL_MEM_ARRAY_INFO; // TYPE 16
+
+//<AMI_SHDR_START>
+//----------------------------------------------------------------------------
+// Name: SMBIOS_MEMORY_DEVICE_INFO
+//
+// Description: Memory Device (Type 17)
+//----------------------------------------------------------------------------
+//<AMI_SHDR_END>
+typedef struct {
+ SMBIOS_STRUCTURE_HEADER StructureType;
+ UINT16 PhysicalMemArrayHandle;
+ UINT16 MemErrorInfoHandle;
+ UINT16 TotalWidth;
+ UINT16 DataWidth;
+ UINT16 Size;
+ UINT8 FormFactor;
+ UINT8 DeviceSet;
+ UINT8 DeviceLocator;
+ UINT8 BankLocator;
+ UINT8 MemoryType;
+ UINT16 TypeDetail;
+ UINT16 Speed;
+ UINT8 Manufacturer;
+ UINT8 SerialNumber;
+ UINT8 AssetTag;
+ UINT8 PartNumber;
+ UINT8 Attributes;
+ UINT32 ExtendedSize;
+ UINT16 ConfMemClkSpeed;
+ UINT16 MinimumVoltage;
+ UINT16 MaximumVoltage;
+ UINT16 ConfiguredVoltage;
+} SMBIOS_MEMORY_DEVICE_INFO; // TYPE 17
+
+#if MEMORY_ERROR_INFO
+//<AMI_SHDR_START>
+//----------------------------------------------------------------------------
+// Name: SMBIOS_MEMORY_ERROR_INFO
+//
+// Description: 32-bit Memory Error Information (Type 18)
+//----------------------------------------------------------------------------
+//<AMI_SHDR_END>
+typedef struct {
+ SMBIOS_STRUCTURE_HEADER StructureType;
+ UINT8 ErrorType;
+ UINT8 ErrorGranularity;
+ UINT8 ErrorOperation;
+ UINT32 VendorSyndrome;
+ UINT32 MemArrayErrorAddress;
+ UINT32 DeviceErrorAddress;
+ UINT32 ErrorResolution;
+} SMBIOS_MEMORY_ERROR_INFO; // TYPE 18
+#endif
+
+//<AMI_SHDR_START>
+//----------------------------------------------------------------------------
+// Name: SMBIOS_MEM_ARRAY_MAP_ADDR_INFO
+//
+// Description: Memory Array Mapped Address (Type 19)
+//----------------------------------------------------------------------------
+//<AMI_SHDR_END>
+typedef struct {
+ SMBIOS_STRUCTURE_HEADER StructureType;
+ UINT32 StartingAddress;
+ UINT32 EndingAddress;
+ UINT16 MemoryArrayHandle;
+ UINT8 PartitionWidth;
+ UINT64 ExtendedStartAddr;
+ UINT64 ExtendedEndAddr;
+} SMBIOS_MEM_ARRAY_MAP_ADDR_INFO; // TYPE 19
+
+//<AMI_SHDR_START>
+//----------------------------------------------------------------------------
+// Name: SMBIOS_MEM_DEV_MAP_ADDR_INFO
+//
+// Description: Memory Device Mapped Address (Type 20)
+//----------------------------------------------------------------------------
+//<AMI_SHDR_END>
+typedef struct {
+ SMBIOS_STRUCTURE_HEADER StructureType;
+ UINT32 StartingAddress;
+ UINT32 EndingAddress;
+ UINT16 MemoryDeviceHandle;
+ UINT16 MemoryArrayMapAddrHandle;
+ UINT8 PartitionRowPosition;
+ UINT8 InterleavePosition;
+ UINT8 InterleaveDataDepth;
+ UINT64 ExtendedStartAddr;
+ UINT64 ExtendedEndAddr;
+} SMBIOS_MEM_DEV_MAP_ADDR_INFO; // TYPE 20
+
+#if BUILTIN_POINTING_DEVICE_INFO
+//<AMI_SHDR_START>
+//----------------------------------------------------------------------------
+// Name: SMBIOS_POINTING_DEV_INFO
+//
+// Description: Built-in Pointing Device (Type 21)
+//----------------------------------------------------------------------------
+//<AMI_SHDR_END>
+typedef struct {
+ SMBIOS_STRUCTURE_HEADER StructureType;
+ UINT8 Type;
+ UINT8 Interface;
+ UINT8 NumberOfButtons;
+} SMBIOS_POINTING_DEV_INFO; // TYPE 21
+#endif
+
+#if PORTABLE_BATTERY_INFO
+//<AMI_SHDR_START>
+//----------------------------------------------------------------------------
+// Name: SMBIOS_PORTABLE_BATTERY_INFO
+//
+// Description: Portable Battery (Type 22)
+//----------------------------------------------------------------------------
+//<AMI_SHDR_END>
+typedef struct {
+ SMBIOS_STRUCTURE_HEADER StructureType;
+ UINT8 Location;
+ UINT8 Manufacturer;
+ UINT8 ManufacturerData;
+ UINT8 SerialNumber;
+ UINT8 DeviceName;
+ UINT8 DeviceChemistry;
+ UINT16 DesignCapacity;
+ UINT16 DesignVoltage;
+ UINT8 SBDSVersion;
+ UINT8 MaxErrorInBatteryData;
+ UINT16 SBDSSerialNumber;
+ UINT16 SBDSManufacturerDate;
+ UINT8 SBDSDeviceChecmistry;
+ UINT8 DesignCapabilityMult;
+ UINT32 OEMSpecific;
+} SMBIOS_PORTABLE_BATTERY_INFO; // TYPE 22
+#endif
+
+#if SYSTEM_RESET_INFO
+//<AMI_SHDR_START>
+//----------------------------------------------------------------------------
+// Name: SMBIOS_SYSTEM_RESET_INFO
+//
+// Description: System Reset (Type 23)
+//----------------------------------------------------------------------------
+//<AMI_SHDR_END>
+typedef struct {
+ SMBIOS_STRUCTURE_HEADER StructureType;
+ UINT8 Capabilities;
+ UINT16 ResetCount;
+ UINT16 ResetLimit;
+ UINT16 TimerInterval;
+ UINT16 TimeOut;
+} SMBIOS_SYSTEM_RESET_INFO; // TYPE 23
+#endif
+
+#if HARDWARE_SECURITY_INFO
+//<AMI_SHDR_START>
+//----------------------------------------------------------------------------
+// Name: SMBIOS_HARDWARE_SECURITY_INFO
+//
+// Description: Hardware Security (Type 24)
+//----------------------------------------------------------------------------
+//<AMI_SHDR_END>
+typedef struct {
+ SMBIOS_STRUCTURE_HEADER StructureType;
+ UINT8 HardwareSecSettings;
+} SMBIOS_HARDWARE_SECURITY_INFO; // TYPE 24
+#endif
+
+#if SYSTEM_POWER_CONTROLS_INFO
+//<AMI_SHDR_START>
+//----------------------------------------------------------------------------
+// Name: SMBIOS_SYSTEM_PWR_CONTROL_INFO
+//
+// Description: System Power Control (Type 25)
+//----------------------------------------------------------------------------
+//<AMI_SHDR_END>
+typedef struct {
+ SMBIOS_STRUCTURE_HEADER StructureType;
+ UINT8 NextSchedulePwrOnMonth;
+ UINT8 NextSchedulePwrOnDayOfMonth;
+ UINT8 NextSchedulePwrOnHour;
+ UINT8 NextSchedulePwrOnMinute;
+ UINT8 NextSchedulePwrOnSecond;
+} SMBIOS_SYSTEM_PWR_CONTROL_INFO; // TYPE 25
+#endif
+
+#if VOLTAGE_PROBE_INFO
+//<AMI_SHDR_START>
+//----------------------------------------------------------------------------
+// Name: SMBIOS_VOLTAGE_PROBE_INFO
+//
+// Description: Voltage Probe (Type 26)
+//----------------------------------------------------------------------------
+//<AMI_SHDR_END>
+typedef struct {
+ SMBIOS_STRUCTURE_HEADER StructureType;
+ UINT8 Description;
+ UINT8 LocationAndStatus;
+ UINT16 MaxValue;
+ UINT16 MinValue;
+ UINT16 Resolution;
+ UINT16 Tolerance;
+ UINT16 Accuracy;
+ UINT32 OEMDefine;
+ UINT16 NorminalValue;
+} SMBIOS_VOLTAGE_PROBE_INFO; // TYPE 26
+#endif
+
+#if COOLING_DEVICE_INFO
+//<AMI_SHDR_START>
+//----------------------------------------------------------------------------
+// Name: SMBIOS_COOLING_DEV_INFO
+//
+// Description: Cooling Device (Type 27)
+//----------------------------------------------------------------------------
+//<AMI_SHDR_END>
+typedef struct {
+ SMBIOS_STRUCTURE_HEADER StructureType;
+ UINT16 TempProbeHandle;
+ UINT8 DevTypeAndStatus;
+ UINT8 CoolingUnitGroup;
+ UINT32 OEMDefine;
+ UINT16 NorminalSpeed;
+ UINT8 Description;
+} SMBIOS_COOLING_DEV_INFO; // TYPE 27
+#endif
+
+#if TEMPERATURE_PROBE_INFO
+//<AMI_SHDR_START>
+//----------------------------------------------------------------------------
+// Name: SMBIOS_TEMPERATURE_PROBE_INFO
+//
+// Description: Temperature Probe (Type 28)
+//----------------------------------------------------------------------------
+//<AMI_SHDR_END>
+typedef struct {
+ SMBIOS_STRUCTURE_HEADER StructureType;
+ UINT8 Description;
+ UINT8 LocationAndStatus;
+ UINT16 MaxValue;
+ UINT16 MinValue;
+ UINT16 Resolution;
+ UINT16 Tolerance;
+ UINT16 Accuracy;
+ UINT32 OEMDefine;
+ UINT16 NorminalValue;
+} SMBIOS_TEMPERATURE_PROBE_INFO; // TYPE 28
+#endif
+
+#if ELECTRICAL_PROBE_INFO
+//<AMI_SHDR_START>
+//----------------------------------------------------------------------------
+// Name: SMBIOS_ELECT_CURRENT_PROBE_INFO
+//
+// Description: Electrical Current Probe (Type 29)
+//----------------------------------------------------------------------------
+//<AMI_SHDR_END>
+typedef struct {
+ SMBIOS_STRUCTURE_HEADER StructureType;
+ UINT8 Description;
+ UINT8 LocationAndStatus;
+ UINT16 MaxValue;
+ UINT16 MinValue;
+ UINT16 Resolution;
+ UINT16 Tolerance;
+ UINT16 Accuracy;
+ UINT32 OEMDefine;
+ UINT16 NorminalValue;
+} SMBIOS_ELECT_CURRENT_PROBE_INFO; // TYPE 29
+#endif
+
+#if OUT_OF_BAND_REMOTE_ACCESS_INFO
+//<AMI_SHDR_START>
+//----------------------------------------------------------------------------
+// Name: SMBIOS_OUT_OF_BAND_REMOTE_ACCESS_INFO
+//
+// Description: Out-of-Band Remote Access (Type 30)
+//----------------------------------------------------------------------------
+//<AMI_SHDR_END>
+typedef struct {
+ SMBIOS_STRUCTURE_HEADER StructureType;
+ UINT8 ManufacturerName;
+ UINT8 Connections;
+} SMBIOS_OUT_OF_BAND_REMOTE_ACCESS_INFO; // TYPE 30
+#endif
+
+#if MKF_BIS_INFO
+//<AMI_SHDR_START>
+//----------------------------------------------------------------------------
+// Name: SMBIOS_BIS_ENTRYPOINT_INFO
+//
+// Description: Boot Integrity Services (BIS) Entry Point (Type 31)
+//----------------------------------------------------------------------------
+//<AMI_SHDR_END>
+typedef struct {
+ SMBIOS_STRUCTURE_HEADER StructureType;
+ UINT8 Checksum;
+ UINT8 Reserved_1;
+ UINT16 Reserved_2;
+ UINT32 BISEntrySt;
+ UINT32 BISEntryTt;
+ UINT64 Reserved_3;
+ UINT32 Reserved_4;
+} SMBIOS_BIS_ENTRYPOINT_INFO; // TYPE 31
+#endif
+
+//<AMI_SHDR_START>
+//----------------------------------------------------------------------------
+// Name: SMBIOS_SYSTEM_BOOT_INFO
+//
+// Description: System Boot Information (Type 32)
+//----------------------------------------------------------------------------
+//<AMI_SHDR_END>
+typedef struct {
+ SMBIOS_STRUCTURE_HEADER StructureType;
+ UINT8 Reserved[6];
+ UINT8 BootStatus[10];
+} SMBIOS_SYSTEM_BOOT_INFO; // TYPE 32
+
+#if SIXTY_FOURBIT_MEMORY_ERROR_INFO
+//<AMI_SHDR_START>
+//----------------------------------------------------------------------------
+// Name: SMBIOS_SIXTYFOUR_MEM_ERROR_INFO
+//
+// Description: 64-bit Memory Error Information (Type 33)
+//----------------------------------------------------------------------------
+//<AMI_SHDR_END>
+typedef struct {
+ SMBIOS_STRUCTURE_HEADER StructureType;
+ UINT8 ErrorType;
+ UINT8 ErrorGranularity;
+ UINT8 ErrorOperation;
+ UINT32 VendorSyndrome;
+ UINT64 MemoryArrayErrAddr;
+ UINT64 DeviceErrAddr;
+ UINT32 ErrorResolution;
+} SMBIOS_SIXTYFOUR_MEM_ERROR_INFO; // TYPE 33
+#endif
+
+#if MANAGEMENT_DEVICE_INFO
+//<AMI_SHDR_START>
+//----------------------------------------------------------------------------
+// Name: SMBIOS_MANAGEMENT_DEV_INFO
+//
+// Description: Management Device (Type 34)
+//----------------------------------------------------------------------------
+//<AMI_SHDR_END>
+typedef struct {
+ SMBIOS_STRUCTURE_HEADER StructureType;
+ UINT8 Description;
+ UINT8 Type;
+ UINT32 Address;
+ UINT8 AddressType;
+} SMBIOS_MANAGEMENT_DEV_INFO; // TYPE 34
+#endif
+
+#if MEMORY_CHANNEL_INFO
+//<AMI_SHDR_START>
+//----------------------------------------------------------------------------
+// Name: TYPE37_MEMORY_DEVICE
+//
+// Description: Type 37 Memory Device
+//----------------------------------------------------------------------------
+//<AMI_SHDR_END>
+typedef struct {
+ UINT8 MemDevLoad;
+ UINT16 MemDevHandle;
+} TYPE37_MEMORY_DEVICE;
+
+//<AMI_SHDR_START>
+//----------------------------------------------------------------------------
+// Name: SMBIOS_MEMORY_CHANNEL_INFO
+//
+// Description: Memory Channel (Type 37)
+//----------------------------------------------------------------------------
+//<AMI_SHDR_END>
+typedef struct {
+ SMBIOS_STRUCTURE_HEADER StructureType;
+ UINT8 ChannelType;
+ UINT8 MaxChannelLoad;
+ UINT8 MemDeviceCount;
+ TYPE37_MEMORY_DEVICE MemoryDevice[NUMBER_OF_MEMORY_CHANNELS];
+} SMBIOS_MEMORY_CHANNEL_INFO; // TYPE 37
+#endif
+
+#if IPMI_DEVICE_INFO
+//<AMI_SHDR_START>
+//----------------------------------------------------------------------------
+// Name: SMBIOS_IPMI_DEV_INFO
+//
+// Description: IPMI Device Information (Type 38)
+//----------------------------------------------------------------------------
+//<AMI_SHDR_END>
+typedef struct {
+ SMBIOS_STRUCTURE_HEADER StructureType;
+ UINT8 InterfaceType;
+ UINT8 IPMISpecRevision;
+ UINT8 I2CSlaveAddr;
+ UINT8 NVStorageDevAddr;
+ UINT64 BaseAddress;
+} SMBIOS_IPMI_DEV_INFO; // TYPE 38
+#endif
+
+#if SYSTEM_POWER_SUPPLY_INFO
+//<AMI_SHDR_START>
+//----------------------------------------------------------------------------
+// Name: SMBIOS_SYSTEM_PWR_SUPPY_INFO
+//
+// Description: System Power Supply (Type 39)
+//----------------------------------------------------------------------------
+//<AMI_SHDR_END>
+typedef struct {
+ SMBIOS_STRUCTURE_HEADER StructureType;
+ UINT8 PwrUnitGroup;
+ UINT8 Location;
+ UINT8 DeviceName;
+ UINT8 Manufacturer;
+ UINT8 SerialNumber;
+ UINT8 AssetTagNumber;
+ UINT8 ModelPartNumber;
+ UINT8 RevisionLevel;
+ UINT16 MaxPwrCapacity;
+ UINT16 PwrSupplyChar;
+ UINT16 InputVoltProbeHandle;
+ UINT16 CoolingDevHandle;
+ UINT16 InputCurrentProbeHandle;
+} SMBIOS_SYSTEM_PWR_SUPPY_INFO; // TYPE 39
+#endif
+
+#if ADDITIONAL_INFO
+//<AMI_SHDR_START>
+//----------------------------------------------------------------------------
+// Name: SMBIOS_ADDITIONAL_INFO
+//
+// Description: System Power Supply (Type 40)
+//----------------------------------------------------------------------------
+//<AMI_SHDR_END>
+typedef struct {
+ UINT8 EntryLength;
+ UINT16 RefHandle;
+ UINT8 RefOffset;
+ UINT8 StringNum;
+ union {
+ UINT8 Value8;
+ UINT16 Value16;
+ UINT32 Value32;
+ };
+} ADDITIONAL_INFO_ENTRY;
+
+typedef struct {
+ SMBIOS_STRUCTURE_HEADER StructureType;
+ UINT8 NumAdditionalInfoEntries;
+ ADDITIONAL_INFO_ENTRY AdditionalEntries[ADDITIONAL_INFO_COUNT];
+} SMBIOS_ADDITIONAL_INFO; // TYPE 40
+#endif
+
+#if ONBOARD_DEVICE_EXTENDED_INFO
+//<AMI_SHDR_START>
+//----------------------------------------------------------------------------
+// Name: SMBIOS_ONBOARD_DEVICE_EXTENDED_INFO
+//
+// Description: Onboard Devices Extended Information (Type 41)
+//----------------------------------------------------------------------------
+//<AMI_SHDR_END>
+typedef struct {
+ SMBIOS_STRUCTURE_HEADER StructureType;
+ UINT8 RefDesignation;
+ UINT8 DeviceType;
+ UINT8 DeviceTypeInstance;
+ UINT16 SegGroupNumber;
+ UINT8 BusNumber;
+ UINT8 DevFuncNumber;
+} SMBIOS_ONBOARD_DEV_EXT_INFO; // TYPE 41
+#endif
+
+typedef struct _JEDEC_MF_ID {
+ UINT8 VendorId;
+ CHAR8 *ManufacturerString;
+} JEDEC_MF_ID;
+
+typedef struct {
+ UINT8 NumContCode;
+ UINT8 ModuleManufacturer;
+ UINT8 *Manufacturer;
+} JEDEC_DATA;
+
+//**********************************************************************//
+// SMBIOS NVRAM DATA
+//**********************************************************************//
+//<AMI_SHDR_START>
+//----------------------------------------------------------------------------
+// Name: SMBIOS_NVRAM_TYPE
+//
+// Description: DMI Type X data
+//----------------------------------------------------------------------------
+//<AMI_SHDR_END>
+typedef struct {
+ UINT32 Flag;
+ CHAR8 *StringSet[32];
+} SMBIOS_NVRAM_TYPE;
+
+//<AMI_SHDR_START>
+//----------------------------------------------------------------------------
+// Name: SMBIOS_NVRAM_TYPE0
+//
+// Description: DMI Type 0 data
+// UINT32 Flag; // Bit0 = Vendor string changed
+// // Bit1 = BIOS version string changed
+// // Bit2 = BIOS Release Date string changed
+//----------------------------------------------------------------------------
+//<AMI_SHDR_END>
+typedef struct {
+ UINT32 Flag;
+ CHAR8 *StringSet[3];
+} SMBIOS_NVRAM_TYPE0;
+
+//<AMI_SHDR_START>
+//----------------------------------------------------------------------------
+// Name: SMBIOS_NVRAM_TYPE1
+//
+// Description: DMI Type 1 data
+// UINT32 Flag; // Bit0 = Manufacturer string changed
+// // Bit1 = Product Name string changed
+// // Bit2 = Version string changed
+// // Bit3 = Serial Number string changed
+// // Bit4 = SKU string changed
+// // Bit5 = Family string changed
+// // Bit16 = UUID changed
+//----------------------------------------------------------------------------
+//<AMI_SHDR_END>
+typedef struct {
+ UINT32 Flag;
+ CHAR8 *StringSet[6];
+ EFI_GUID Uuid;
+} SMBIOS_NVRAM_TYPE1;
+
+//<AMI_SHDR_START>
+//----------------------------------------------------------------------------
+// Name: SMBIOS_NVRAM_TYPE2
+//
+// Description: DMI Type 2 data
+// UINT32 Flag; // Bit0 = Manufacturer string changed
+// // Bit1 = Product Name string changed
+// // Bit2 = Version string changed
+// // Bit3 = Serial Number string changed
+// // Bit4 = Asset Tag string changed
+//----------------------------------------------------------------------------
+//<AMI_SHDR_END>
+typedef struct {
+ UINT32 Flag;
+ CHAR8 *StringSet[6];
+ UINT16 Handle;
+} SMBIOS_NVRAM_TYPE2;
+
+//<AMI_SHDR_START>
+//----------------------------------------------------------------------------
+// Name: SMBIOS_NVRAM_TYPE3
+//
+// Description: DMI Type 3 data
+// UINT32 Flag; // Bit0 = Manufacturer string changed
+// // Bit1 = Version string changed
+// // Bit2 = Serial Number string changed
+// // Bit3 = Asset Tag string changed
+// // Bit4 = SKU Number string changed
+// // Bit16 = Chassis Type changed
+// // Bit17 = OEM-defined changed
+//----------------------------------------------------------------------------
+//<AMI_SHDR_END>
+typedef struct {
+ UINT32 Flag;
+ CHAR8 *StringSet[5];
+ UINT8 Type;
+ UINT32 OemDefined;
+ UINT16 Handle;
+} SMBIOS_NVRAM_TYPE3;
+
+//<AMI_SHDR_START>
+//----------------------------------------------------------------------------
+// Name: SMBIOS_NVRAM_TYPE4
+//
+// Description: DMI Type 4 data
+// UINT32 Flag; // Bit0 = Serial Number string changed
+// // Bit1 = Asset Tag string changed
+// // Bit2 = Part Number string changed
+//----------------------------------------------------------------------------
+//<AMI_SHDR_END>
+typedef struct {
+ UINT32 Flag;
+ CHAR8 *StringSet[6];
+} SMBIOS_NVRAM_TYPE4;
+
+//<AMI_SHDR_START>
+//----------------------------------------------------------------------------
+// Name: SMBIOS_NVRAM_TYPE11
+//
+// Description: DMI Type 11 data
+// UINT32 Flag; // Bit(x) = String #(x) changed
+//----------------------------------------------------------------------------
+//<AMI_SHDR_END>
+typedef struct {
+ UINT32 Flag;
+ CHAR8 *StringSet[32];
+} SMBIOS_NVRAM_TYPE11;
+
+//<AMI_SHDR_START>
+//----------------------------------------------------------------------------
+// Name: SMBIOS_NVRAM_TYPE12
+//
+// Description: DMI Type 12 data
+// UINT32 Flag; // Bit(x) = String #(x) changed
+//----------------------------------------------------------------------------
+//<AMI_SHDR_END>
+typedef struct {
+ UINT32 Flag;
+ CHAR8 *StringSet[32];
+} SMBIOS_NVRAM_TYPE12;
+
+//<AMI_SHDR_START>
+//----------------------------------------------------------------------------
+// Name: SMBIOS_NVRAM_TYPE22
+//
+// Description: DMI Type 22 data
+// UINT8 Flag; // Bit0 = Location string changed
+// // Bit1 = Manufacturer string changed
+// // Bit2 = Manufacturer Date changed
+// // Bit3 = Serial Number string changed
+// // Bit4 = Device Name string changed
+// // Bit5 = SBDS Version Number string changed
+// // Bit6 = SBDS Device Chemistry string changed
+// // Bit16 = Device Chemistry changed
+// // Bit17 = Design Capacity changed
+// // Bit18 = Design Voltage changed
+// // Bit19 = Maximum Error in Battery Data changed
+// // Bit20 = SBDS Serial Number changed
+// // Bit21 = SBDS Manufacturer Date changed
+// // Bit22 = Design Capacity Multiplier changed
+// // Bit23 = OEM-specific changed
+//----------------------------------------------------------------------------
+//<AMI_SHDR_END>
+typedef struct {
+ UINT32 Flag;
+ CHAR8 *StringSet[7];
+ UINT8 DeviceChemistry;
+ UINT16 DesignCapacity;
+ UINT16 DesignVoltage;
+ UINT8 MaxErrorInBatteryData;
+ UINT16 SbdsSerialNumber;
+ UINT16 SbdsManufacturerDate;
+ UINT8 DesignCapacityMultiplier;
+ UINT32 OemSpecific;
+ UINT16 Handle;
+} SMBIOS_NVRAM_TYPE22;
+
+//<AMI_SHDR_START>
+//----------------------------------------------------------------------------
+// Name: SMBIOS_NVRAM_TYPE39
+//
+// Description: DMI Type 39 data
+// UINT8 Flag; // Bit0 = Location string changed
+// // Bit1 = Device Name string changed
+// // Bit2 = Manufacturer string changed
+// // Bit3 = Serial Number string changed
+// // Bit4 = Asset Tag string changed
+// // Bit5 = Model Part Number string changed
+// // Bit6 = Revision Level string changed
+// // Bit16 = Power Unit Group changed
+// // Bit17 = Max Power Capacity changed
+// // Bit18 = Power Supply Characteristics changed
+// // Bit19 = Input Voltage Probe Handle changed
+// // Bit20 = Cooling Device Handle changed
+// // Bit21 = Input Current Probe Handle changed
+//----------------------------------------------------------------------------
+//<AMI_SHDR_END>
+typedef struct {
+ UINT32 Flag;
+ CHAR8 *StringSet[7];
+ UINT8 PwrUnitGroup;
+ UINT16 MaxPwrCapacity;
+ UINT16 PwrSupplyChar;
+ UINT16 InputVoltageProbeHandle;
+ UINT16 CoolingDevHandle;
+ UINT16 InputCurrentProbeHandle;
+ UINT16 Handle;
+} SMBIOS_NVRAM_TYPE39;
+
+typedef struct {
+ UINT8 Type;
+ UINT16 Handle;
+ UINT8 Offset;
+ UINT8 Flags; // Bit0 = Write Once
+ // Bit1 = Delete Structure
+ // Bit2 = Add structure
+} DMI_VAR;
+
+typedef struct {
+ UINT8 Offset;
+ UINT8 SpecStrNum;
+ UINT8 CurStrValue;
+} STRING_TABLE;
+
+#pragma pack()
+
+//**********************************************************************//
+// SMBIOS Protocol
+//**********************************************************************//
+
+typedef struct _EFI_SMBIOS_PROTOCOL EFI_SMBIOS_PROTOCOL;
+
+typedef VOID* (EFIAPI *EFI_SMBIOS_GET_TABLE_ENTRY) (
+);
+
+typedef VOID* (EFIAPI *EFI_SMBIOS_GET_SCRATCH_BUFFER) (
+);
+
+typedef UINT16 (EFIAPI *EFI_SMBIOS_GET_BUFFER_MAX_SIZE) (
+);
+
+typedef UINT16 (EFIAPI *EFI_SMBIOS_GET_FREE_HANDLE) (
+);
+
+typedef EFI_STATUS (EFIAPI *EFI_SMBIOS_ADD_STRUCTURE) (
+ IN UINT8 *Buffer,
+ IN UINT16 Size
+);
+
+typedef EFI_STATUS (EFIAPI *EFI_SMBIOS_ADD_STRUC_HANDLE) (
+ IN UINT16 Handle,
+ IN UINT8 *Buffer,
+ IN UINT16 Size
+);
+
+typedef EFI_STATUS (EFIAPI *EFI_SMBIOS_DELETE_STRUCTURE) (
+ IN UINT16 Handle
+);
+
+typedef EFI_STATUS (EFIAPI *EFI_SMBIOS_READ_STRUCTURE) (
+ IN UINT16 Handle,
+ IN OUT UINT8 **BufferPtr,
+ IN OUT UINT16 *BufferSize
+);
+
+typedef EFI_STATUS (EFIAPI *EFI_SMBIOS_READ_STRUC_TYPE) (
+ IN UINT8 Type,
+ IN UINT8 Instance,
+ IN UINT8 **BufferPtr,
+ IN UINT16 *BufferSize
+);
+
+typedef EFI_STATUS (EFIAPI *EFI_SMBIOS_WRITE_STRUCTURE) (
+ IN UINT16 Handle,
+ IN UINT8 *BufferPtr,
+ IN UINT16 BufferSize
+);
+
+typedef EFI_STATUS (EFIAPI *EFI_SMBIOS_UPDATE_HEADER) (
+);
+
+typedef enum {
+ ADD_STRUCTURE,
+ DELETE_STRUCTURE,
+} SMBIOS_OPERATION;
+
+typedef UINT8 EFI_SMBIOS_STRING;
+typedef UINT8 EFI_SMBIOS_TYPE;
+typedef UINT16 EFI_SMBIOS_HANDLE;
+
+#if ( defined(SMBIOS_PI_1_1) && (SMBIOS_PI_1_1 == 1) )
+
+#define SMBIOS_MAJOR_VERSION 02
+#define SMBIOS_MINOR_VERSION 06
+
+#define EFI_SMBIOS_TYPE_BIOS_INFORMATION 0
+#define EFI_SMBIOS_TYPE_SYSTEM_INFORMATION 1
+#define EFI_SMBIOS_TYPE_BASEBOARD_INFORMATION 2
+#define EFI_SMBIOS_TYPE_SYSTEM_ENCLOSURE 3
+#define EFI_SMBIOS_TYPE_PROCESSOR_INFORMATION 4
+#define EFI_SMBIOS_TYPE_MEMORY_CONTROLLER_INFORMATION 5
+#define EFI_SMBIOS_TYPE_MEMORY_MODULE_INFORMATON 6
+#define EFI_SMBIOS_TYPE_CACHE_INFORMATION 7
+#define EFI_SMBIOS_TYPE_PORT_CONNECTOR_INFORMATION 8
+#define EFI_SMBIOS_TYPE_SYSTEM_SLOTS 9
+#define EFI_SMBIOS_TYPE_ONBOARD_DEVICE_INFORMATION 10
+#define EFI_SMBIOS_TYPE_OEM_STRINGS 11
+#define EFI_SMBIOS_TYPE_SYSTEM_CONFIGURATION_OPTIONS 12
+#define EFI_SMBIOS_TYPE_BIOS_LANGUAGE_INFORMATION 13
+#define EFI_SMBIOS_TYPE_GROUP_ASSOCIATIONS 14
+#define EFI_SMBIOS_TYPE_SYSTEM_EVENT_LOG 15
+#define EFI_SMBIOS_TYPE_PHYSICAL_MEMORY_ARRAY 16
+#define EFI_SMBIOS_TYPE_MEMORY_DEVICE 17
+#define EFI_SMBIOS_TYPE_32BIT_MEMORY_ERROR_INFORMATION 18
+#define EFI_SMBIOS_TYPE_MEMORY_ARRAY_MAPPED_ADDRESS 19
+#define EFI_SMBIOS_TYPE_MEMORY_DEVICE_MAPPED_ADDRESS 20
+#define EFI_SMBIOS_TYPE_BUILT_IN_POINTING_DEVICE 21
+#define EFI_SMBIOS_TYPE_PORTABLE_BATTERY 22
+#define EFI_SMBIOS_TYPE_SYSTEM_RESET 23
+#define EFI_SMBIOS_TYPE_HARDWARE_SECURITY 24
+#define EFI_SMBIOS_TYPE_SYSTEM_POWER_CONTROLS 25
+#define EFI_SMBIOS_TYPE_VOLTAGE_PROBE 26
+#define EFI_SMBIOS_TYPE_COOLING_DEVICE 27
+#define EFI_SMBIOS_TYPE_TEMPERATURE_PROBE 28
+#define EFI_SMBIOS_TYPE_ELECTRICAL_CURRENT_PROBE 29
+#define EFI_SMBIOS_TYPE_OUT_OF_BAND_REMOTE_ACCESS 30
+#define EFI_SMBIOS_TYPE_BOOT_INTEGRITY_SERVICE 31
+#define EFI_SMBIOS_TYPE_SYSTEM_BOOT_INFORMATION 32
+#define EFI_SMBIOS_TYPE_64BIT_MEMORY_ERROR_INFORMATION 33
+#define EFI_SMBIOS_TYPE_MANAGEMENT_DEVICE 34
+#define EFI_SMBIOS_TYPE_MANAGEMENT_DEVICE_COMPONENT 35
+#define EFI_SMBIOS_TYPE_MANAGEMENT_DEVICE_THRESHOLD_DATA 36
+#define EFI_SMBIOS_TYPE_MEMORY_CHANNEL 37
+#define EFI_SMBIOS_TYPE_IPMI_DEVICE_INFORMATION 38
+#define EFI_SMBIOS_TYPE_SYSTEM_POWER_SUPPLY 39
+#define EFI_SMBIOS_TYPE_INACTIVE 126
+#define EFI_SMBIOS_TYPE_END_OF_TABLE 127
+#define EFI_SMBIOS_OEM_BEGIN 128
+#define EFI_SMBIOS_OEM_END 255
+
+#pragma pack(1)
+
+typedef struct {
+ EFI_SMBIOS_TYPE Type;
+ UINT8 Length;
+ EFI_SMBIOS_HANDLE Handle;
+} EFI_SMBIOS_TABLE_HEADER;
+
+#define PRODUCER_HANDLE_ELEMENTS 200
+typedef struct {
+ EFI_SMBIOS_HANDLE SmbiosHandle;
+ EFI_HANDLE ProducerHandle;
+} EFI_PRODUCER_HANDLE;
+
+#pragma pack()
+
+typedef EFI_STATUS (EFIAPI *EFI_SMBIOS_ADD) (
+ IN CONST EFI_SMBIOS_PROTOCOL *This,
+ IN EFI_HANDLE ProducerHandle, OPTIONAL
+ IN OUT EFI_SMBIOS_HANDLE *SmbiosHandle,
+ IN EFI_SMBIOS_TABLE_HEADER *Record
+);
+
+typedef EFI_STATUS (EFIAPI *EFI_SMBIOS_UPDATE_STRING) (
+ IN CONST EFI_SMBIOS_PROTOCOL *This,
+ IN EFI_SMBIOS_HANDLE *SmbiosHandle,
+ IN UINTN *StringNumber,
+ IN CHAR8 *String
+);
+
+typedef EFI_STATUS (EFIAPI *EFI_SMBIOS_REMOVE) (
+ IN CONST EFI_SMBIOS_PROTOCOL *This,
+ IN UINTN SmbiosHandle
+);
+
+typedef EFI_STATUS (EFIAPI *EFI_SMBIOS_GET_NEXT) (
+ IN CONST EFI_SMBIOS_PROTOCOL *This,
+ IN OUT EFI_SMBIOS_HANDLE *SmbiosHandle,
+ IN EFI_SMBIOS_TYPE *Type, OPTIONAL
+ OUT EFI_SMBIOS_TABLE_HEADER **Record,
+ OUT EFI_HANDLE *ProducerHandle OPTIONAL
+);
+#endif // End of SMBIOS_PI_1_1 == 1
+
+typedef struct _EFI_SMBIOS_PROTOCOL {
+#if ( defined(SMBIOS_PI_1_1) && (SMBIOS_PI_1_1 == 1) )
+ EFI_SMBIOS_ADD Add;
+ EFI_SMBIOS_UPDATE_STRING UpdateString;
+ EFI_SMBIOS_REMOVE Remove;
+ EFI_SMBIOS_GET_NEXT GetNext;
+ UINT8 MajorVersion;
+ UINT8 MinorVersion;
+#endif // End of SMBIOS_PI_1_1 == 1
+ EFI_SMBIOS_GET_TABLE_ENTRY SmbiosGetTableEntryPoint; // SMBIOS Table Entry Point
+ EFI_SMBIOS_GET_SCRATCH_BUFFER SmbiosGetScratchBufferPtr; // Scratch Buffer of maximum table size
+ EFI_SMBIOS_GET_BUFFER_MAX_SIZE SmbiosGetBufferMaxSize; // Maximum SMBIOS Table Size
+ EFI_SMBIOS_GET_FREE_HANDLE SmbiosGetFreeHandle; // Get available free handle
+ EFI_SMBIOS_ADD_STRUCTURE SmbiosAddStructure; // Add structure
+ EFI_SMBIOS_ADD_STRUC_HANDLE SmbiosAddStrucByHandle; // Add structure
+ EFI_SMBIOS_DELETE_STRUCTURE SmbiosDeleteStructure; // Delete structure (by handle)
+ EFI_SMBIOS_READ_STRUCTURE SmbiosReadStructure; // Read structure. Caller is responsible
+ // for deallocating the memory
+ EFI_SMBIOS_READ_STRUC_TYPE SmbiosReadStrucByType; // Read structure by type. Caller is
+ // responsible for deallocating the memory
+ EFI_SMBIOS_WRITE_STRUCTURE SmbiosWriteStructure; // Write structure
+ EFI_SMBIOS_UPDATE_HEADER SmbiosUpdateHeader; // Update SMBIOS Table Header
+};
+
+//**********************************************************************//
+// SMBIOS Functions
+//**********************************************************************//
+
+VOID*
+GetSmbiosTableEntryPoint(
+);
+
+VOID*
+GetScratchBufferPtr(
+);
+
+UINT16
+GetBufferMaxSize(
+);
+
+UINT16
+GetFreeHandle(
+);
+
+EFI_STATUS
+AddStructure(
+ IN UINT8 *Buffer,
+ IN UINT16 Size
+);
+
+EFI_STATUS
+AddStructureByHandle(
+ IN UINT16 Handle,
+ IN UINT8 *Buffer,
+ IN UINT16 Size
+);
+
+EFI_STATUS
+DeleteStructureByHandle(
+ IN UINT16 Handle
+);
+
+EFI_STATUS
+ReadStructureByHandle(
+ IN UINT16 Handle,
+ IN OUT UINT8 **BufferPtr,
+ IN OUT UINT16 *BufferSize
+);
+
+EFI_STATUS
+ReadStructureByType(
+ IN UINT8 Type,
+ IN UINT8 Instance,
+ IN OUT UINT8 **BufferPtr,
+ IN OUT UINT16 *BufferSize
+);
+
+EFI_STATUS
+WriteStructureByHandle(
+ IN UINT16 Handle,
+ IN UINT8 *BufferPtr,
+ IN UINT16 BufferSize
+);
+
+EFI_STATUS
+UpdateSmbiosTableHeader(
+);
+
+UINT16
+GetStructureLength(
+ IN UINT8 *BufferStart
+);
+
+BOOLEAN
+FindStructureHandle(
+ IN OUT UINT8 **Buffer,
+ IN UINT16 Handle
+);
+
+EFI_STATUS
+ReplaceString(
+ IN UINT8 *DestStructPtr,
+ IN UINT8 StringNum,
+ IN UINT8 *StringData
+);
+
+VOID
+ClearStringNumber (
+ IN STRING_TABLE *StringTablePtr,
+ IN UINT8 Index
+);
+
+#if ( defined(SMBIOS_PI_1_1) && (SMBIOS_PI_1_1 == 1) )
+EFI_STATUS
+SmbiosPiAddStructure (
+ IN CONST EFI_SMBIOS_PROTOCOL *This,
+ IN EFI_HANDLE ProducerHandle, OPTIONAL
+ IN OUT EFI_SMBIOS_HANDLE *SmbiosHandle,
+ IN EFI_SMBIOS_TABLE_HEADER *Record
+);
+
+EFI_STATUS
+SmbiosPiUpdateString (
+ IN CONST EFI_SMBIOS_PROTOCOL *This,
+ IN EFI_SMBIOS_HANDLE *SmbiosHandle,
+ IN UINTN *StringNumber,
+ IN CHAR8 *String
+);
+
+EFI_STATUS
+SmbiosPiRemoveStructure (
+ IN CONST EFI_SMBIOS_PROTOCOL *This,
+ IN UINTN SmbiosHandle
+);
+
+EFI_STATUS
+SmbiosPiGetNextStructure (
+ IN CONST EFI_SMBIOS_PROTOCOL *This,
+ IN OUT EFI_SMBIOS_HANDLE *SmbiosHandle,
+ IN EFI_SMBIOS_TYPE *Type, OPTIONAL
+ OUT EFI_SMBIOS_TABLE_HEADER **Record,
+ OUT EFI_HANDLE *ProducerHandle OPTIONAL
+);
+#endif // End of SMBIOS_PI_1_1 == 1
+
+#endif // _Smbios_DRIVER_H
+
+//**********************************************************************//
+//**********************************************************************//
+//** **//
+//** (C)Copyright 1985-2016, American Megatrends, Inc. **//
+//** **//
+//** All Rights Reserved. **//
+//** **//
+//** 5555 Oakbrook Pkwy, Suite 200, Norcross, GA 30093 **//
+//** **//
+//** Phone: (770)-246-8600 **//
+//** **//
+//**********************************************************************//
+//**********************************************************************//
diff --git a/Include/Protocol/SMIFlashProtocols.CIF b/Include/Protocol/SMIFlashProtocols.CIF
new file mode 100644
index 0000000..99d7a96
--- /dev/null
+++ b/Include/Protocol/SMIFlashProtocols.CIF
@@ -0,0 +1,8 @@
+<component>
+ name = "SMIFlash Protocols"
+ category = ModulePart
+ LocalRoot = "INCLUDE\Protocol"
+ RefName = "SMIFlashProtocols"
+[files]
+"smiflash.h" = "protocols"
+<endComponent>
diff --git a/Include/Protocol/SbHpet.h b/Include/Protocol/SbHpet.h
new file mode 100644
index 0000000..bd8f2cc
--- /dev/null
+++ b/Include/Protocol/SbHpet.h
@@ -0,0 +1,238 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2013, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/BIN/Chipset/Intel/SouthBridge/LynxPoint/Intel Pch SB Chipset/SB Protocols/SbHpet.h 1 11/19/13 7:27a Barretlin $
+//
+// $Revision: 1 $
+//
+// $Date: 11/19/13 7:27a $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Chipset/Intel/SouthBridge/LynxPoint/Intel Pch SB Chipset/SB Protocols/SbHpet.h $
+//
+// 1 11/19/13 7:27a Barretlin
+// [TAG] EIP141917
+// [Category] New Feature
+// [Description] Support SetTimer() with HPET Timer on Lynx Point
+// [Files] SB.sdl SBGeneric.c SBDxe.c SbHpet.h SamrtTimer.sdl
+//
+// 6 1/13/10 2:13p Felixp
+//
+//**********************************************************************
+//<AMI_FHDR_START>
+//
+// Name: SbHPET.h
+//
+// Description: High Precision Event Timer register definitions.
+//
+//<AMI_FHDR_END>
+//**********************************************************************
+#ifndef __SB_HPET__H__
+#define __SB_HPET__H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <Efi.h>
+
+//----------------------------------------------------------------------------
+// High Precision Event Timer Registers
+//----------------------------------------------------------------------------
+// HPET General Register Offsets
+#define HPET_GENERAL_CAPABILITIES_ID_OFFSET 0x000
+#define HPET_GENERAL_CONFIGURATION_OFFSET 0x010
+#define HPET_GENERAL_INTERRUPT_STATUS_OFFSET 0x020
+// HPET Timer Register Offsets
+#define HPET_MAIN_COUNTER_OFFSET 0x0F0
+#define HPET_TIMER_CONFIGURATION_OFFSET 0x100
+#define HPET_TIMER_COMPARATOR_OFFSET 0x108
+#define HPET_TIMER_MSI_ROUTE_OFFSET 0x110
+// Stride between sets of HPET Timer Registers
+#define HPET_TIMER_STRIDE 0x020
+
+#pragma pack(push,1)
+
+// HPET General Capabilities and ID Register
+typedef union {
+ struct {
+ UINT32 Revision:8;
+ UINT32 NumberOfTimers:5;
+ UINT32 CounterSize:1;
+ UINT32 Reserved0:1;
+ UINT32 LegacyRoute:1;
+ UINT32 VendorId:16;
+ UINT32 CounterClockPeriod:32;
+ } Bits;
+ UINT64 Uint64;
+} HPET_GENERAL_CAPABILITIES_ID_REGISTER;
+
+// HPET General Configuration Register
+typedef union {
+ struct {
+ UINT32 MainCounterEnable:1;
+ UINT32 LegacyRouteEnable:1;
+ UINT32 Reserved0:30;
+ UINT32 Reserved1:32;
+ } Bits;
+ UINT64 Uint64;
+} HPET_GENERAL_CONFIGURATION_REGISTER;
+
+// HPET General Interrupt Status Register
+typedef union {
+ struct {
+ UINT32 Timer0InterruptActive:1;
+ UINT32 Timer1InterruptActive:1;
+ UINT32 Timer2InterruptActive:1;
+ UINT32 Reserved0:29;
+ UINT32 Reserved1:32;
+ } Bits;
+ UINT64 Uint64;
+} HPET_GENERAL_INTERRUPT_STATUS_REGISTER;
+
+// HPET Timer Configuration Register
+typedef union {
+ struct {
+ UINT32 Reserved0:1;
+ UINT32 LevelTriggeredInterrupt:1;
+ UINT32 InterruptEnable:1;
+ UINT32 PeriodicInterruptEnable:1;
+ UINT32 PeriodicInterruptCapablity:1;
+ UINT32 CounterSizeCapablity:1;
+ UINT32 ValueSetEnable:1;
+ UINT32 Reserved1:1;
+ UINT32 CounterSizeEnable:1;
+ UINT32 InterruptRoute:5;
+ UINT32 MsiInterruptEnable:1;
+ UINT32 MsiInterruptCapablity:1;
+ UINT32 Reserved2:16;
+ UINT32 InterruptRouteCapability;
+ } Bits;
+ UINT64 Uint64;
+} HPET_TIMER_CONFIGURATION_REGISTER;
+
+// HPET Timer MSI Route Register
+typedef union {
+ struct {
+ UINT32 Value:32;
+ UINT32 Address:32;
+ } Bits;
+ UINT64 Uint64;
+} HPET_TIMER_MSI_ROUTE_REGISTER;
+
+#if defined(HPET_APIC_INTERRUPT_MODE) && (HPET_APIC_INTERRUPT_MODE != 0)
+//-------------------------
+// HPET APIC Support
+//-------------------------
+#define IO_APIC_REDIR_TABLE_LOW 0x10 // Reditection Table Low 32 bits.
+#define IO_APIC_REDIR_TABLE_HIGH 0x11 // Reditection Table High 32 bits.
+
+#define APIC_EOI_REGISTER 0xB0
+#define APIC_PPR_REGISTER 0xA0
+#define APIC_APR_REGISTER 0x90
+#define APIC_ISR_REGISTER 0x100
+#define ISR_REG(v) (APIC_ISR_REGISTER + (v / 32) * 0x10)
+#define ISR_BIT(v) (UINT32) (1 << (v % 32))
+
+struct IO_APIC {
+ UINT8 Index;
+ UINT8 Unused[3];
+ UINT32 Unused1[3];
+ UINT32 Data;
+ UINT32 Unused2[11];
+ UINT32 Eoi;
+};
+
+typedef struct {
+ UINT32 Vector : 8,
+ DeliveryMode : 3,
+ DestMode : 1,
+ DeliveryStatus : 1,
+ Polarity : 1,
+ Irr : 1,
+ Trigger : 1,
+ Mask : 1,
+ __Reserved_2 : 15;
+
+ UINT32 __Reserved_3 : 24,
+ Dest : 8;
+} IO_APIC_ROUTE_ENTRY;
+
+union ENTRY_UNION {
+ struct { UINT32 W1, W2; };
+ IO_APIC_ROUTE_ENTRY Entry;
+};
+
+//---------------------------------------------------------------------------
+struct IO_APIC* IoApicBase( VOID );
+
+EFI_STATUS IoApicWrite (
+ IN UINT8 Reg,
+ IN UINT32 Value
+);
+
+UINT32 IoApicRead(
+ IN UINT8 Reg
+);
+
+EFI_STATUS IoApicEnableIrq (
+ IN UINT8 Irq,
+ IN BOOLEAN LevelTriggered,
+ IN BOOLEAN Polarity
+);
+
+EFI_STATUS
+IoApicDisableIrq (
+ IN UINT8 Irq
+ );
+
+EFI_STATUS IoApicEoi (
+ IN UINT8 Irq
+);
+
+EFI_STATUS IoApicMaskIrq (
+ IN UINT8 Irq
+);
+
+EFI_STATUS IoApicUnmaskIrq (
+ IN UINT8 Irq
+);
+
+UINT8 GetHpetApicPin ( VOID );
+
+BOOLEAN IsHpetApicEnable ( VOID );
+
+#endif
+
+#pragma pack(pop)
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2013, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
diff --git a/Include/Protocol/ScsiPassThruExt.h b/Include/Protocol/ScsiPassThruExt.h
new file mode 100644
index 0000000..8bd32f9
--- /dev/null
+++ b/Include/Protocol/ScsiPassThruExt.h
@@ -0,0 +1,212 @@
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2012, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
+
+//*************************************************************************
+// $Header: /Alaska/BIN/Core/Include/Protocol/ScsiPassThruExt.h 1 8/16/12 5:00a Rajeshms $
+//
+// $Revision: 1 $
+//
+// $Date: 8/16/12 5:00a $
+//*************************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Core/Include/Protocol/ScsiPassThruExt.h $
+//
+// 1 8/16/12 5:00a Rajeshms
+// [TAG] EIP97048
+// [Category] New Feature
+// [Description] ATAPI PassThru Support using
+// EFI_EXT_SCSI_PASS_THRU_PROTOCOL.
+// [Files] AhciBus.c, AhciController.c, IdeBus.c, Atapi.c, PIDEBus.h,
+// PAhciBus.h, ScsiPassThruAtapi.sdl, ScsiPassThruAtapi.mak,
+// ScsiPassThruAtapi.c, ScsiPassThruAtapiSupport.h, ScsiPassThruAtapi.chm,
+// ScsiPassThruExt.h
+//
+//
+//*************************************************************************
+//<AMI_FHDR_START>
+//
+// Name: ScsiPassThruExt.h
+//
+// Description:
+// EFI_EXT_SCSI_PASS_THRU_PROTOCOL definition file.
+//
+//<AMI_FHDR_END>
+//*************************************************************************
+
+#ifndef __EXT_SCSI_PASS_THROUGH_PROTOCOL_H__
+#define __EXT_SCSI_PASS_THROUGH_PROTOCOL_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define EFI_EXT_SCSI_PASS_THRU_PROTOCOL_GUID \
+ { \
+ 0x143b7632, 0xb81b, 0x4cb7, {0xab, 0xd3, 0xb6, 0x25, 0xa5, 0xb9, 0xbf, 0xfe } \
+ }
+
+GUID_VARIABLE_DECLARATION(gEfiExtScsiPassThruProtocolGuid, EFI_EXT_SCSI_PASS_THRU_PROTOCOL_GUID);
+
+typedef struct _EFI_EXT_SCSI_PASS_THRU_PROTOCOL EFI_EXT_SCSI_PASS_THRU_PROTOCOL;
+
+#define TARGET_MAX_BYTES 0x10
+
+#define EFI_EXT_SCSI_PASS_THRU_ATTRIBUTES_PHYSICAL 0x0001
+#define EFI_EXT_SCSI_PASS_THRU_ATTRIBUTES_LOGICAL 0x0002
+#define EFI_EXT_SCSI_PASS_THRU_ATTRIBUTES_NONBLOCKIO 0x0004
+
+//
+// DataDirection
+//
+#define EFI_EXT_SCSI_DATA_DIRECTION_READ 0
+#define EFI_EXT_SCSI_DATA_DIRECTION_WRITE 1
+#define EFI_EXT_SCSI_DATA_DIRECTION_BIDIRECTIONAL 2
+//
+// HostAdapterStatus
+//
+#define EFI_EXT_SCSI_STATUS_HOST_ADAPTER_OK 0x00
+#define EFI_EXT_SCSI_STATUS_HOST_ADAPTER_TIMEOUT_COMMAND 0x09
+#define EFI_EXT_SCSI_STATUS_HOST_ADAPTER_TIMEOUT 0x0b
+#define EFI_EXT_SCSI_STATUS_HOST_ADAPTER_MESSAGE_REJECT 0x0d
+#define EFI_EXT_SCSI_STATUS_HOST_ADAPTER_BUS_RESET 0x0e
+#define EFI_EXT_SCSI_STATUS_HOST_ADAPTER_PARITY_ERROR 0x0f
+#define EFI_EXT_SCSI_STATUS_HOST_ADAPTER_REQUEST_SENSE_FAILED 0x10
+#define EFI_EXT_SCSI_STATUS_HOST_ADAPTER_SELECTION_TIMEOUT 0x11
+#define EFI_EXT_SCSI_STATUS_HOST_ADAPTER_DATA_OVERRUN_UNDERRUN 0x12
+#define EFI_EXT_SCSI_STATUS_HOST_ADAPTER_BUS_FREE 0x13
+#define EFI_EXT_SCSI_STATUS_HOST_ADAPTER_PHASE_ERROR 0x14
+#define EFI_EXT_SCSI_STATUS_HOST_ADAPTER_OTHER 0x7f
+//
+// TargetStatus
+//
+#define EFI_EXT_SCSI_STATUS_TARGET_GOOD 0x00
+#define EFI_EXT_SCSI_STATUS_TARGET_CHECK_CONDITION 0x02
+#define EFI_EXT_SCSI_STATUS_TARGET_CONDITION_MET 0x04
+#define EFI_EXT_SCSI_STATUS_TARGET_BUSY 0x08
+#define EFI_EXT_SCSI_STATUS_TARGET_INTERMEDIATE 0x10
+#define EFI_EXT_SCSI_STATUS_TARGET_INTERMEDIATE_CONDITION_MET 0x14
+#define EFI_EXT_SCSI_STATUS_TARGET_RESERVATION_CONFLICT 0x18
+#define EFI_EXT_SCSI_STATUS_TARGET_TASK_SET_FULL 0x28
+#define EFI_EXT_SCSI_STATUS_TARGET_ACA_ACTIVE 0x30
+#define EFI_EXT_SCSI_STATUS_TARGET_TASK_ABORTED 0x40
+
+typedef struct {
+ UINT32 AdapterId;
+ UINT32 Attributes;
+ UINT32 IoAlign;
+} EFI_EXT_SCSI_PASS_THRU_MODE;
+
+typedef struct {
+ UINT64 Timeout;
+ VOID *InDataBuffer;
+ VOID *OutDataBuffer;
+ VOID *SenseData;
+ VOID *Cdb;
+ UINT32 InTransferLength;
+ UINT32 OutTransferLength;
+ UINT8 CdbLength;
+ UINT8 DataDirection;
+ UINT8 HostAdapterStatus;
+ UINT8 TargetStatus;
+ UINT8 SenseDataLength;
+} EFI_EXT_SCSI_PASS_THRU_SCSI_REQUEST_PACKET;
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_EXT_SCSI_PASS_THRU_PASSTHRU) (
+ IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL *This,
+ IN UINT8 *Target,
+ IN UINT64 Lun,
+ IN OUT EFI_EXT_SCSI_PASS_THRU_SCSI_REQUEST_PACKET *Packet,
+ IN EFI_EVENT Event OPTIONAL
+);
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_EXT_SCSI_PASS_THRU_GET_NEXT_TARGET_LUN) (
+ IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL *This,
+ IN OUT UINT8 **Target,
+ IN OUT UINT64 *Lun
+);
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_EXT_SCSI_PASS_THRU_BUILD_DEVICE_PATH) (
+ IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL *This,
+ IN UINT8 *Target,
+ IN UINT64 Lun,
+ IN OUT EFI_DEVICE_PATH_PROTOCOL **DevicePath
+);
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_EXT_SCSI_PASS_THRU_GET_TARGET_LUN) (
+ IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL *This,
+ IN EFI_DEVICE_PATH_PROTOCOL *DevicePath,
+ OUT UINT8 **Target,
+ OUT UINT64 *Lun
+);
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_EXT_SCSI_PASS_THRU_RESET_CHANNEL) (
+ IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL *This
+);
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_EXT_SCSI_PASS_THRU_RESET_TARGET_LUN) (
+ IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL *This,
+ IN UINT8 *Target,
+ IN UINT64 Lun
+);
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_EXT_SCSI_PASS_THRU_GET_NEXT_TARGET) (
+ IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL *This,
+ IN OUT UINT8 **Target
+);
+
+struct _EFI_EXT_SCSI_PASS_THRU_PROTOCOL {
+ EFI_EXT_SCSI_PASS_THRU_MODE *Mode;
+ EFI_EXT_SCSI_PASS_THRU_PASSTHRU PassThru;
+ EFI_EXT_SCSI_PASS_THRU_GET_NEXT_TARGET_LUN GetNextTargetLun;
+ EFI_EXT_SCSI_PASS_THRU_BUILD_DEVICE_PATH BuildDevicePath;
+ EFI_EXT_SCSI_PASS_THRU_GET_TARGET_LUN GetTargetLun;
+ EFI_EXT_SCSI_PASS_THRU_RESET_CHANNEL ResetChannel;
+ EFI_EXT_SCSI_PASS_THRU_RESET_TARGET_LUN ResetTargetLun;
+ EFI_EXT_SCSI_PASS_THRU_GET_NEXT_TARGET GetNextTarget;
+};
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2012, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
diff --git a/Include/Protocol/SecSMIFlashProtocols.CIF b/Include/Protocol/SecSMIFlashProtocols.CIF
new file mode 100644
index 0000000..3c06e9b
--- /dev/null
+++ b/Include/Protocol/SecSMIFlashProtocols.CIF
@@ -0,0 +1,8 @@
+<component>
+ name = "SecSMIFlash Protocols"
+ category = ModulePart
+ LocalRoot = "INCLUDE\Protocol"
+ RefName = "SecSMIFlashProtocols"
+[files]
+"SecSmiFlash.h" = "Protocols"
+<endComponent>
diff --git a/Include/Protocol/SecSmiFlash.h b/Include/Protocol/SecSmiFlash.h
new file mode 100644
index 0000000..4c8d7bc
--- /dev/null
+++ b/Include/Protocol/SecSmiFlash.h
@@ -0,0 +1,165 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2014, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/SOURCE/Modules/SecureFlashPkg/SecureSmiFlash/SecSmiFlash.h 8 3/18/14 3:10p Alexp $
+//
+// $Revision: 8 $
+//
+// $Date: 3/18/14 3:10p $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/SOURCE/Modules/SecureFlashPkg/SecureSmiFlash/SecSmiFlash.h $
+//
+// 8 3/18/14 3:10p Alexp
+// change year to 2014 in ftr & hdr
+//
+// 7 6/12/13 3:53p Alexp
+// CapsuleValidate() made external function in SecSmiFlash API
+//
+// 6 5/18/12 3:55p Alexp
+// Add pointer to local copy of *RomLayout table inside Sec Smi Flash
+// Protocol table
+//
+// 5 2/03/12 2:41p Alexp
+// Use SHA256 Hash for Hash table
+//
+// 4 1/18/12 5:39p Alexp
+// add defines SEC_FLASH_HASH_TBL_BLOCK_COUNT/SEC_FLASH_HASH_TBL_SIZE
+//
+// 3 1/13/12 4:29p Alexp
+// cleaned up comments
+//
+// 2 11/03/11 6:45p Alexp
+// define Afu Flash page as SDL token: AFU_FLASH_PAGE_SIZE
+//
+// 4 5/25/11 8:32p Alexp
+// change FSHandle from *UINT32 to UINT32
+//
+// 8 4/22/11 4:36p Alexp
+// hardwire sw smi codes for Sec SMI.
+//
+// 6 4/18/11 7:20p Alexp
+// change HashTable to Sha1. Temp solution. may remove table as not
+// practical
+//
+// 5 4/13/11 7:09p Alexp
+// enhanced Protocol with local poijters to HashTbl, Capsule, FSHandle
+//
+// 3 4/11/11 2:11p Alexp
+// -Revision 12 and upper to support "Installed" field in Flash Info as
+// bit mask
+// -Add support for new CApsule SigningCert header
+// - Replace PKpub with new FW Sign key as a root Platform key to verify
+// Capsule Sig with
+//**********************************************************************
+
+#ifndef _EFI_SEC_SMI_FLASH_H_
+#define _EFI_SEC_SMI_FLASH_H_
+
+#include <RomLayout.h>
+#include <Protocol/Hash.h>
+#include <Protocol/AmiDigitalSignature.h>
+#include <BaseCryptLib.h>
+#include <FlashUpd.h>
+#include <Protocol/SmiFlash.h>
+#include "AmiCertificate.h"
+
+// {3BF4AF16-AB7C-4b43-898D-AB26AC5DDC6C}
+#define EFI_SEC_SMI_FLASH_GUID \
+{ 0x3bf4af16, 0xab7c, 0x4b43, { 0x89, 0x8d, 0xab, 0x26, 0xac, 0x5d, 0xdc, 0x6c } }
+
+GUID_VARIABLE_DECLARATION(gSecureSMIFlashProtocolGuid, EFI_SEC_SMI_FLASH_GUID);
+
+typedef struct _EFI_SEC_SMI_FLASH_PROTOCOL EFI_SEC_SMI_FLASH_PROTOCOL;
+
+// SMI Flash INFO_BLOCK->Implemented bit mask flags
+//typedef enum {SMIflash=0, noSMIflash=1, SecuredSMIflash=2};
+#ifndef SwSmi_LoadFwImage
+#define SwSmi_LoadFwImage 0x1D
+#define SwSmi_GetFlashPolicy 0x1E
+#define SwSmi_SetFlashMethod 0x1F
+#endif
+// SMI Flash Command API
+typedef enum {
+ SecSMIflash_Load =SwSmi_LoadFwImage,
+ SecSMIflash_GetPolicy=SwSmi_GetFlashPolicy,
+ SecSMIflash_SetFlash =SwSmi_SetFlashMethod,
+ SMIflash_Enable =0x20,
+ SMIflash_Read =0x21,
+ SMIflash_Erase =0x22,
+ SMIflash_Write =0x23,
+ SMIflash_Disable =0x24,
+ SMIflash_Info =0x25
+};
+
+#define SEC_FLASH_HASH_TBL_BLOCK_COUNT (FLASH_SIZE/FLASH_BLOCK_SIZE)
+#define SEC_FLASH_HASH_TBL_SIZE (sizeof(EFI_SHA256_HASH)*SEC_FLASH_HASH_TBL_BLOCK_COUNT)
+
+typedef struct {
+ FLASH_UPD_POLICY FlUpdPolicy;
+ UINT8 PKpub[DEFAULT_RSA_KEY_MODULUS_LEN];
+ UINT8 ErrorCode;
+} FLASH_POLICY_INFO_BLOCK;
+
+typedef struct {
+ AMI_FLASH_UPDATE_BLOCK FlUpdBlock;
+ UINT8 ErrorCode;
+ UINT32 FSHandle;
+} FUNC_FLASH_SESSION_BLOCK;
+
+typedef EFI_STATUS (*LOAD_FLASH_IMAGE) (
+ IN OUT FUNC_BLOCK *FuncBlock
+);
+
+typedef EFI_STATUS (*GET_FLASH_UPD_POLICY) (
+ IN OUT FLASH_POLICY_INFO_BLOCK *InfoBlock
+);
+
+typedef EFI_STATUS (*SET_FLASH_UPD_METHOD) (
+ IN OUT FUNC_FLASH_SESSION_BLOCK *InfoBlock
+);
+
+typedef EFI_STATUS (*CAPSULE_VALIDATE) (
+ IN OUT UINT8 **pFWCapsule,
+ IN OUT APTIO_FW_CAPSULE_HEADER **pFWCapsuleHdr
+);
+
+struct _EFI_SEC_SMI_FLASH_PROTOCOL {
+ LOAD_FLASH_IMAGE LoadFwImage; // SW SMI Port 0x1d
+ GET_FLASH_UPD_POLICY GetFlUpdPolicy; // SW SMI Port 0x1e
+ SET_FLASH_UPD_METHOD SetFlUpdMethod; // SW SMI Port 0x1f
+ CAPSULE_VALIDATE CapsuleValidate;
+ UINT32 *pFwCapsule; // Local buffer for FwCapsule
+ ROM_AREA *RomLayout; // Local copy of Rom Layout table
+ EFI_SHA256_HASH *HashTbl; // ptr to Fw image Hash table
+ UINT32 FSHandle; // SetFlash Session handle
+};
+
+#endif
+
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2014, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
diff --git a/Include/Protocol/Security.h b/Include/Protocol/Security.h
new file mode 100644
index 0000000..163b757
--- /dev/null
+++ b/Include/Protocol/Security.h
@@ -0,0 +1,81 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2006, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/BIN/Core/CORE_DXE/ArchProtocol/Security.h 1 4/25/07 9:36a Felixp $
+//
+// $Revision: 1 $
+//
+// $Date: 4/25/07 9:36a $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Core/CORE_DXE/ArchProtocol/Security.h $
+//
+// 1 4/25/07 9:36a Felixp
+//
+// 1 5/19/06 11:28p Felixp
+//
+// 1 3/13/06 1:57a Felixp
+//
+//**********************************************************************
+//<AMI_FHDR_START>
+//
+// Name: <This File Name>
+//
+// Description:
+//
+//<AMI_FHDR_END>
+//**********************************************************************
+#ifndef __ARCH_PROTOCOL_SECURITY__H__
+#define __ARCH_PROTOCOL_SECURITY__H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+#include <EFI.h>
+
+#define EFI_SECURITY_ARCH_PROTOCOL_GUID \
+ { 0xA46423E3, 0x4617, 0x49f1, 0xB9, 0xFF, 0xD1, 0xBF, 0xA9, 0x11, 0x58, 0x39 }
+
+typedef struct _EFI_SECURITY_ARCH_PROTOCOL EFI_SECURITY_ARCH_PROTOCOL;
+
+typedef EFI_STATUS (EFIAPI *EFI_SECURITY_FILE_AUTHENTICATION_STATE)(
+ IN EFI_SECURITY_ARCH_PROTOCOL *This,
+ IN UINT32 AuthenticationStatus,
+ IN EFI_DEVICE_PATH_PROTOCOL *File
+);
+
+struct _EFI_SECURITY_ARCH_PROTOCOL {
+ EFI_SECURITY_FILE_AUTHENTICATION_STATE FileAuthenticationState;
+};
+
+GUID_VARIABLE_DECLARATION(gEfiSecurityArchProtocolGuid, EFI_SECURITY_ARCH_PROTOCOL_GUID);
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2006, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//********************************************************************** \ No newline at end of file
diff --git a/Include/Protocol/Security2.h b/Include/Protocol/Security2.h
new file mode 100644
index 0000000..1cd533e
--- /dev/null
+++ b/Include/Protocol/Security2.h
@@ -0,0 +1,80 @@
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2012, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/BIN/Core/CORE_DXE/ArchProtocol/Security2.h 1 4/09/12 5:41p Artems $
+//
+// $Revision: 1 $
+//
+// $Date: 4/09/12 5:41p $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Core/CORE_DXE/ArchProtocol/Security2.h $
+//
+// 1 4/09/12 5:41p Artems
+// Initial check-in
+//
+//**********************************************************************
+//<AMI_FHDR_START>
+//
+// Name: Security2.h
+//
+// Description:
+//
+//<AMI_FHDR_END>
+//**********************************************************************
+#ifndef __ARCH_PROTOCOL_SECURITY2__H__
+#define __ARCH_PROTOCOL_SECURITY2__H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+#include <EFI.h>
+
+#define EFI_SECURITY2_ARCH_PROTOCOL_GUID \
+ { 0x94ab2f58, 0x1438, 0x4ef1, 0x91, 0x52, 0x18, 0x94, 0x1a, 0x3a, 0xe, 0x68 }
+
+typedef struct _EFI_SECURITY2_ARCH_PROTOCOL EFI_SECURITY2_ARCH_PROTOCOL;
+
+typedef EFI_STATUS (EFIAPI *EFI_SECURITY2_FILE_AUTHENTICATION) (
+ IN CONST EFI_SECURITY2_ARCH_PROTOCOL *This,
+ IN CONST EFI_DEVICE_PATH_PROTOCOL *File,
+ IN VOID *FileBuffer,
+ IN UINTN FileSize,
+ IN BOOLEAN BootPolicy
+);
+
+struct _EFI_SECURITY2_ARCH_PROTOCOL {
+ EFI_SECURITY2_FILE_AUTHENTICATION FileAuthentication;
+};
+
+GUID_VARIABLE_DECLARATION(gEfiSecurity2ArchProtocolGuid, EFI_SECURITY2_ARCH_PROTOCOL_GUID);
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//************************************************************************* \ No newline at end of file
diff --git a/Include/Protocol/SerialIo.h b/Include/Protocol/SerialIo.h
new file mode 100644
index 0000000..457ef53
--- /dev/null
+++ b/Include/Protocol/SerialIo.h
@@ -0,0 +1,186 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2005, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/BIN/Core/Include/Protocol/SerialIo.h 3 3/13/06 1:40a Felixp $
+//
+// $Revision: 3 $
+//
+// $Date: 3/13/06 1:40a $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Core/Include/Protocol/SerialIo.h $
+//
+// 3 3/13/06 1:40a Felixp
+//
+// 2 10/26/05 5:08p Ambikas
+//
+// 1 1/28/05 12:44p Felixp
+//
+// 2 1/18/05 3:22p Felixp
+// PrintDebugMessage renamed to Trace
+//
+// 1 12/23/04 9:41a Felixp
+//
+// 1 12/02/04 12:07p Markw
+//
+//**********************************************************************
+//<AMI_FHDR_START>
+//
+// Name: SerialIo_h
+//
+// Description:
+//
+//<AMI_FHDR_END>
+//**********************************************************************
+#ifndef __SERIAL_IO_PROTOCOL_H__
+#define __SERIAL_IO_PROTOCOL_H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+#include <EFI.h>
+
+#define EFI_SERIAL_IO_PROTOCOL_GUID \
+ {0xbb25cf6f,0xf1D4,0x11d2,0x9a,0x0c,0x00,0x90,0x27,0x3f,0xc1,0xfd}
+
+GUID_VARIABLE_DECLARATION(gEfiSerialIoProtocolGuid,EFI_SERIAL_IO_PROTOCOL_GUID);
+
+#define EFI_SERIAL_IO_PROTOCOL_REVISION 0x00010000
+
+//*******************************************************
+// SERIAL_IO_MODE
+//*******************************************************
+typedef struct {
+ UINT32 ControlMask;
+ // current Attributes
+ UINT32 Timeout;
+ UINT64 BaudRate;
+ UINT32 ReceiveFifoDepth;
+ UINT32 DataBits;
+ UINT32 Parity;
+ UINT32 StopBits;
+} SERIAL_IO_MODE;
+
+//*******************************************************
+// EFI_PARITY_TYPE
+//*******************************************************
+typedef enum {
+ DefaultParity,
+ NoParity,
+ EvenParity,
+ OddParity,
+ MarkParity,
+ SpaceParity
+} EFI_PARITY_TYPE;
+
+//*******************************************************
+// EFI_STOP_BITS_TYPE
+//*******************************************************
+typedef enum {
+ DefaultStopBits,
+ OneStopBit, // 1 stop bit
+ OneFiveStopBits, // 1.5 stop bits
+ TwoStopBits // 2 stop bits
+} EFI_STOP_BITS_TYPE;
+
+
+//*******************************************************
+// CONTROL BITS
+//*******************************************************
+#define EFI_SERIAL_CLEAR_TO_SEND 0x0010
+#define EFI_SERIAL_DATA_SET_READY 0x0020
+#define EFI_SERIAL_RING_INDICATE 0x0040
+#define EFI_SERIAL_CARRIER_DETECT 0x0080
+#define EFI_SERIAL_REQUEST_TO_SEND 0x0002
+#define EFI_SERIAL_DATA_TERMINAL_READY 0x0001
+#define EFI_SERIAL_INPUT_BUFFER_EMPTY 0x0100
+#define EFI_SERIAL_OUTPUT_BUFFER_EMPTY 0x0200
+#define EFI_SERIAL_HARDWARE_LOOPBACK_ENABLE 0x1000
+#define EFI_SERIAL_SOFTWARE_LOOPBACK_ENABLE 0x2000
+#define EFI_SERIAL_HARDWARE_FLOW_CONTROL_ENABLE 0x4000
+#define EFI_SERIAL_SOFTWARE_FLOW_CONTROL_ENABLE 0x8000
+
+
+
+
+
+typedef struct _EFI_SERIAL_IO_PROTOCOL EFI_SERIAL_IO_PROTOCOL;
+
+typedef EFI_STATUS (EFIAPI *EFI_SERIAL_RESET) (
+ IN EFI_SERIAL_IO_PROTOCOL *This
+);
+
+typedef EFI_STATUS (EFIAPI *EFI_SERIAL_SET_ATTRIBUTES) (
+ IN EFI_SERIAL_IO_PROTOCOL *This,
+ IN UINT64 BaudRate,
+ IN UINT32 ReceiveFifoDepth,
+ IN UINT32 Timeout,
+ IN EFI_PARITY_TYPE Parity,
+ IN UINT8 DataBits,
+ IN EFI_STOP_BITS_TYPE StopBits
+);
+
+typedef EFI_STATUS (EFIAPI *EFI_SERIAL_SET_CONTROL_BITS) (
+ IN EFI_SERIAL_IO_PROTOCOL *This,
+ IN UINT32 Control
+);
+
+typedef EFI_STATUS (EFIAPI *EFI_SERIAL_GET_CONTROL_BITS) (
+ IN EFI_SERIAL_IO_PROTOCOL *This,
+ OUT UINT32 *Control
+);
+
+typedef EFI_STATUS (EFIAPI *EFI_SERIAL_WRITE) (
+ IN EFI_SERIAL_IO_PROTOCOL *This,
+ IN OUT UINTN *BufferSize,
+ IN VOID *Buffer
+);
+
+typedef EFI_STATUS (EFIAPI *EFI_SERIAL_READ) (
+ IN EFI_SERIAL_IO_PROTOCOL *This,
+ IN OUT UINTN *BufferSize,
+ OUT VOID *Buffer
+);
+
+struct _EFI_SERIAL_IO_PROTOCOL {
+ UINT32 Revision;
+ EFI_SERIAL_RESET Reset;
+ EFI_SERIAL_SET_ATTRIBUTES SetAttributes;
+ EFI_SERIAL_SET_CONTROL_BITS SetControl;
+ EFI_SERIAL_GET_CONTROL_BITS GetControl;
+ EFI_SERIAL_WRITE Write;
+ EFI_SERIAL_READ Read;
+ SERIAL_IO_MODE *Mode;
+};
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2005, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
diff --git a/Include/Protocol/ServiceBinding.h b/Include/Protocol/ServiceBinding.h
new file mode 100644
index 0000000..b28b7b4
--- /dev/null
+++ b/Include/Protocol/ServiceBinding.h
@@ -0,0 +1,84 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2012, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/BIN/Core/Include/Protocol/ServiceBinding.h 1 5/24/12 3:18p Artems $
+//
+// $Revision: 1 $
+//
+// $Date: 5/24/12 3:18p $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Core/Include/Protocol/ServiceBinding.h $
+//
+// 1 5/24/12 3:18p Artems
+// [TAG] EIP N/A
+// [Category] Spec Update
+// [Severity] Minor
+// [Description] Added definition for EFI_SERVICE_BINDING_PROTOCOL
+// [Files] ServiceBinding.h
+//
+//
+//**********************************************************************
+//<AMI_FHDR_START>
+//
+// Name: ServiceBinging.h
+//
+// Description: EFI_SERVICE_BINDING Protocol Definition.
+//
+//<AMI_FHDR_END>
+//**********************************************************************
+#ifndef __SERVICE_BINDING_PROTOCOL_H__
+#define __SERVICE_BINDING_PROTOCOL_H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+#include <EFI.h>
+
+typedef struct _EFI_SERVICE_BINDING_PROTOCOL EFI_SERVICE_BINDING_PROTOCOL;
+
+typedef EFI_STATUS (EFIAPI *EFI_SERVICE_BINDING_CREATE_CHILD) (
+ IN EFI_SERVICE_BINDING_PROTOCOL *This,
+ IN OUT EFI_HANDLE *ChildHandle
+);
+
+typedef EFI_STATUS (EFIAPI *EFI_SERVICE_BINDING_DESTROY_CHILD) (
+ IN EFI_SERVICE_BINDING_PROTOCOL*This,
+ IN EFI_HANDLE ChildHandle
+);
+
+struct _EFI_SERVICE_BINDING_PROTOCOL {
+ EFI_SERVICE_BINDING_CREATE_CHILD CreateChild;
+ EFI_SERVICE_BINDING_DESTROY_CHILD DestroyChild;
+};
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2012, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
diff --git a/Include/Protocol/SetupInit.h b/Include/Protocol/SetupInit.h
new file mode 100644
index 0000000..018b0f0
--- /dev/null
+++ b/Include/Protocol/SetupInit.h
@@ -0,0 +1,73 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2009, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/BIN/Core/Include/Protocol/SetupInit.h 4 11/23/09 7:07p Felixp $
+//
+// $Revision: 4 $
+//
+// $Date: 11/23/09 7:07p $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Core/Include/Protocol/SetupInit.h $
+//
+// 4 11/23/09 7:07p Felixp
+// The content is removed. The protocol is deprecated.
+//
+// 3 3/13/06 1:40a Felixp
+//
+// 2 3/25/05 11:21a Felixp
+//
+// 1 3/25/05 11:19a Felixp
+//
+//**********************************************************************
+//<AMI_FHDR_START>
+//
+// Name: SetupInit.h
+//
+// Description: SetupInit Protocol
+//
+//<AMI_FHDR_END>
+//**********************************************************************
+#ifndef __SETUP_INIT_PROTOCOL_H__
+#define __SETUP_INIT_PROTOCOL_H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+#if !defined(GUID_VARIABLE_DEFINITION)
+#pragma message("The SETUP_INIT_INTERFACE protocol is depricated.")
+#pragma message("Use LoadResources library function instead.")
+#if EFI_SPECIFICATION_VERSION>0x20000
+#error the protocol is depricated
+#endif
+#endif
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2009, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
diff --git a/Include/Protocol/SimpleFileSystem.h b/Include/Protocol/SimpleFileSystem.h
new file mode 100644
index 0000000..fcc9743
--- /dev/null
+++ b/Include/Protocol/SimpleFileSystem.h
@@ -0,0 +1,247 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2010, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Pkwy , Norcross, GA 30071 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/BIN/Core/Include/Protocol/SimpleFileSystem.h 6 1/27/10 1:36p Aaronp $
+//
+// $Revision: 6 $
+//
+// $Date: 1/27/10 1:36p $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Core/Include/Protocol/SimpleFileSystem.h $
+//
+// 6 1/27/10 1:36p Aaronp
+// Updated comments and formatting.
+//
+// 5 3/13/06 1:40a Felixp
+//
+// 4 3/16/05 3:48p Felixp
+//
+// 3 3/16/05 2:46p Felixp
+//
+// 2 3/04/05 10:37a Mandal
+//
+// 1 1/28/05 12:44p Felixp
+//
+// 2 1/18/05 3:22p Felixp
+// PrintDebugMessage renamed to Trace
+//
+// 1 12/23/04 9:41a Felixp
+//
+// 5 7/20/04 7:10p Yakovlevs
+//
+// 4 7/20/04 7:06p Yakovlevs
+//
+// 3 3/25/04 4:53p Felixp
+//
+// 2 3/19/04 12:23a Felixp
+//
+// 1 3/19/04 12:17a Felixp
+//
+//**********************************************************************
+//<AMI_FHDR_START>
+//
+// Name: SimpleFileSystem.h
+//
+// Description: EFI_SIMPLE_FILE_SYSTEM Protocol Definition
+//
+//<AMI_FHDR_END>
+//**********************************************************************
+#ifndef __SIMPLE_FILE_SYSTEM_PROTOCOL_H__
+#define __SIMPLE_FILE_SYSTEM_PROTOCOL_H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+#include <EFI.h>
+
+#define EFI_SIMPLE_FILE_SYSTEM_PROTOCOL_GUID \
+ { 0x964e5b22,0x6459,0x11d2,0x8e,0x39,0x0,0xa0,0xc9,0x69,0x72,0x3b }
+
+GUID_VARIABLE_DECLARATION(gEfiSimpleFileSystemProtocolGuid, EFI_SIMPLE_FILE_SYSTEM_PROTOCOL_GUID);
+
+#define EFI_FILE_PROTOCOL_REVISION 0x00010000
+
+typedef struct _EFI_FILE_PROTOCOL EFI_FILE_PROTOCOL;
+
+// Open Modes used by the EFI_FILE_OPEN function
+#define EFI_FILE_MODE_READ 0x0000000000000001
+#define EFI_FILE_MODE_WRITE 0x0000000000000002
+#define EFI_FILE_MODE_CREATE 0x8000000000000000
+
+// File Attributes
+#define EFI_FILE_READ_ONLY 0x0000000000000001
+#define EFI_FILE_HIDDEN 0x0000000000000002
+#define EFI_FILE_SYSTEM 0x0000000000000004
+#define EFI_FILE_RESERVED 0x0000000000000008
+#define EFI_FILE_DIRECTORY 0x0000000000000010
+#define EFI_FILE_ARCHIVE 0x0000000000000020
+#define EFI_FILE_VALID_ATTR 0x0000000000000037
+
+// Opens an existing file, or creates a new file, or open a directory
+typedef EFI_STATUS (EFIAPI *EFI_FILE_OPEN) (
+ IN EFI_FILE_PROTOCOL *This,
+ OUT EFI_FILE_PROTOCOL **NewHandle,
+ IN CHAR16 *FileName,
+ IN UINT64 OpenMode,
+ IN UINT64 Attributes
+);
+
+// Closes a file, or direcotry
+typedef EFI_STATUS (EFIAPI *EFI_FILE_CLOSE) ( IN EFI_FILE_PROTOCOL *This );
+
+// Deletes a file, or directory
+typedef EFI_STATUS (EFIAPI *EFI_FILE_DELETE) ( IN EFI_FILE_PROTOCOL *This );
+
+// Read out of a file
+typedef EFI_STATUS (EFIAPI *EFI_FILE_READ) (
+ IN EFI_FILE_PROTOCOL *This,
+ IN OUT UINTN *BufferSize,
+ OUT VOID *Buffer
+);
+
+// Writes to a file
+typedef EFI_STATUS (EFIAPI *EFI_FILE_WRITE) (
+ IN EFI_FILE_PROTOCOL *This,
+ IN OUT UINTN *BufferSize,
+ IN VOID *Buffer
+);
+
+// Returns the current position in a file
+typedef EFI_STATUS (EFIAPI *EFI_FILE_GET_POSITION) (
+ IN EFI_FILE_PROTOCOL *This,
+ OUT UINT64 *Position
+);
+
+// Sets the current position in a file
+typedef EFI_STATUS (EFIAPI *EFI_FILE_SET_POSITION) (
+ IN EFI_FILE_PROTOCOL *This,
+ IN UINT64 Position
+);
+
+#define EFI_FILE_INFO_ID \
+ { 0x9576e92,0x6d3f,0x11d2,0x8e,0x39,0x0,0xa0,0xc9,0x69,0x72,0x3b }
+
+typedef struct {
+ UINT64 Size;
+ UINT64 FileSize;
+ UINT64 PhysicalSize;
+ EFI_TIME CreateTime;
+ EFI_TIME LastAccessTime;
+ EFI_TIME ModificationTime;
+ UINT64 Attribute;
+//TODO//TODO//TODO//TODO//TODO//TODO//TODO//TODO//TODO//TODO
+//S.Y.
+//GetFileInfo was retunring EFI_BUFFER_TOO_SMALL because of this
+//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+//we must take care of this in SimpleFileSystem Driver this is not right definition
+//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+ CHAR16 FileName[1];
+//TODO//TODO//TODO//TODO//TODO//TODO//TODO//TODO//TODO//TODO
+} EFI_FILE_INFO;
+
+// File Attribute Bits returned by
+#define EFI_FILE_READ_ONLY 0x0000000000000001
+#define EFI_FILE_HIDDEN 0x0000000000000002
+#define EFI_FILE_SYSTEM 0x0000000000000004
+#define EFI_FILE_RESERVED 0x0000000000000008
+#define EFI_FILE_DIRECTORY 0x0000000000000010
+#define EFI_FILE_ARCHIVE 0x0000000000000020
+#define EFI_FILE_VALID_ATTR 0x0000000000000037
+
+#define EFI_FILE_SYSTEM_INFO_ID \
+ { 0x9576e93,0x6d3f,0x11d2,0x8e,0x39,0x0,0xa0,0xc9,0x69,0x72,0x3b }
+
+typedef struct {
+ UINT64 Size;
+ BOOLEAN ReadOnly;
+ UINT64 VolumeSize;
+ UINT64 FreeSpace;
+ UINT32 BlockSize;
+ CHAR16 VolumeLabel[];
+} EFI_FILE_SYSTEM_INFO;
+
+
+#define EFI_FILE_SYSTEM_VOLUME_LABEL_ID \
+ { 0xDB47D7D3,0xFE81,0x11d3,0x9A,0x35,0x00,0x90,0x27,0x3F,0xC1,0x4D }
+
+typedef struct {
+ CHAR16 VolumeLabel[];
+} EFI_FILE_SYSTEM_VOLUME_LABEL;
+
+// Reads the requested file or direcotry info
+typedef EFI_STATUS (EFIAPI *EFI_FILE_GET_INFO) (
+ IN EFI_FILE_PROTOCOL *This,
+ IN EFI_GUID *InformationType,
+ IN OUT UINTN *BufferSize,
+ OUT VOID *Buffer
+);
+
+// Sets the requested file's info
+typedef EFI_STATUS (EFIAPI *EFI_FILE_SET_INFO) (
+ IN EFI_FILE_PROTOCOL *This,
+ IN EFI_GUID *InformationType,
+ IN UINTN BufferSize,
+ IN VOID *Buffer
+);
+
+// Flushes all modified information to the device
+typedef EFI_STATUS (EFIAPI *EFI_FILE_FLUSH) ( IN EFI_FILE_PROTOCOL *This );
+
+struct _EFI_FILE_PROTOCOL {
+ UINT64 Revision;
+ EFI_FILE_OPEN Open;
+ EFI_FILE_CLOSE Close;
+ EFI_FILE_DELETE Delete;
+ EFI_FILE_READ Read;
+ EFI_FILE_WRITE Write;
+ EFI_FILE_GET_POSITION GetPosition;
+ EFI_FILE_SET_POSITION SetPosition;
+ EFI_FILE_GET_INFO GetInfo;
+ EFI_FILE_SET_INFO SetInfo;
+ EFI_FILE_FLUSH Flush;
+};
+
+#define EFI_SIMPLE_FILE_SYSTEM_PROTOCOL_REVISION 0x00010000
+
+typedef struct _EFI_SIMPLE_FILE_SYSTEM_PROTOCOL EFI_SIMPLE_FILE_SYSTEM_PROTOCOL;
+
+typedef EFI_STATUS (EFIAPI *EFI_VOLUME_OPEN) (
+ IN EFI_SIMPLE_FILE_SYSTEM_PROTOCOL *This,
+ OUT EFI_FILE_PROTOCOL **Root
+);
+
+struct _EFI_SIMPLE_FILE_SYSTEM_PROTOCOL {
+ UINT64 Revision;
+ EFI_VOLUME_OPEN OpenVolume;
+};
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2010, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Pkwy , Norcross, GA 30071 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
diff --git a/Include/Protocol/SimplePointer.h b/Include/Protocol/SimplePointer.h
new file mode 100644
index 0000000..c8bbc89
--- /dev/null
+++ b/Include/Protocol/SimplePointer.h
@@ -0,0 +1,108 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2005, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/BIN/Core/Include/Protocol/SimplePointer.h 2 3/13/06 1:40a Felixp $
+//
+// $Revision: 2 $
+//
+// $Date: 3/13/06 1:40a $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Core/Include/Protocol/SimplePointer.h $
+//
+// 2 3/13/06 1:40a Felixp
+//
+// 1 1/28/05 12:44p Felixp
+//
+// 2 1/18/05 3:22p Felixp
+// PrintDebugMessage renamed to Trace
+//
+// 1 12/23/04 9:41a Felixp
+//
+// 1 8/30/04 11:38a Olegi
+//
+//**********************************************************************
+//<AMI_FHDR_START>
+//
+// Name: SimplePointer.h
+//
+// Description: SimplePointer protocol definition
+//
+//<AMI_FHDR_END>
+//**********************************************************************
+#ifndef __SIMPLE_POINTER_PROTOCOL_H__
+#define __SIMPLE_POINTER_PROTOCOL_H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+#include <EFI.h>
+
+#define EFI_SIMPLE_POINTER_PROTOCOL_GUID \
+ {0x31878c87,0xb75,0x11d5,0x9a,0x4f,0x0,0x90,0x27,0x3f,0xc1,0x4d}
+
+GUID_VARIABLE_DECLARATION(gEfiSimplePointerProtocolGuid,EFI_SIMPLE_POINTER_PROTOCOL_GUID);
+
+// Forward declaration
+typedef struct _EFI_SIMPLE_POINTER_PROTOCOL EFI_SIMPLE_POINTER_PROTOCOL;
+
+typedef EFI_STATUS (EFIAPI *EFI_SIMPLE_POINTER_RESET) (
+ EFI_SIMPLE_POINTER_PROTOCOL *This,
+ BOOLEAN ExtendedVerification);
+
+typedef struct {
+ INT32 RelativeMovementX;
+ INT32 RelativeMovementY;
+ INT32 RelativeMovementZ;
+ BOOLEAN LeftButton;
+ BOOLEAN RightButton;
+} EFI_SIMPLE_POINTER_STATE;
+
+typedef struct {
+ UINT64 ResolutionX;
+ UINT64 ResolutionY;
+ UINT64 ResolutionZ;
+ BOOLEAN LeftButton;
+ BOOLEAN RightButton;
+} EFI_SIMPLE_POINTER_MODE;
+
+typedef EFI_STATUS (EFIAPI *EFI_SIMPLE_POINTER_GET_STATE) (
+ EFI_SIMPLE_POINTER_PROTOCOL *This,
+ EFI_SIMPLE_POINTER_STATE *State);
+
+typedef struct _EFI_SIMPLE_POINTER_PROTOCOL {
+ EFI_SIMPLE_POINTER_RESET Reset;
+ EFI_SIMPLE_POINTER_GET_STATE GetState;
+ EFI_EVENT WaitForInput;
+ EFI_SIMPLE_POINTER_MODE *Mode;
+} EFI_SIMPLE_POINTER_PROTOCOL;
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2005, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//********************************************************************** \ No newline at end of file
diff --git a/Include/Protocol/SimpleTextIn.h b/Include/Protocol/SimpleTextIn.h
new file mode 100644
index 0000000..87b6a30
--- /dev/null
+++ b/Include/Protocol/SimpleTextIn.h
@@ -0,0 +1,113 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/BIN/Core/Include/Protocol/SimpleTextIn.h 7 7/21/11 3:59p Artems $
+//
+// $Revision: 7 $
+//
+// $Date: 7/21/11 3:59p $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Core/Include/Protocol/SimpleTextIn.h $
+//
+// 7 7/21/11 3:59p Artems
+// EIP 64356: Combine common keyboard definitions in one file
+//
+// 6 8/21/09 10:19a Felixp
+// define GUID_VARIABLE_DECLARATION macro only if it has not been already
+// defined.
+//
+// 5 10/17/07 4:10p Felixp
+// Clean up
+//
+// 3 3/13/06 1:40a Felixp
+//
+// 2 3/04/05 10:37a Mandal
+//
+// 1 1/28/05 12:44p Felixp
+//
+// 2 1/18/05 3:22p Felixp
+// PrintDebugMessage renamed to Trace
+//
+// 1 12/23/04 9:41a Felixp
+//
+// 2 10/11/04 5:56p Olegi
+//
+// 1 8/30/04 11:38a Olegi
+//
+//**********************************************************************
+//<AMI_FHDR_START>
+//
+// Name: SimpleTextIn.h
+//
+// Description: SimpleTextIn protocol definition
+//
+//<AMI_FHDR_END>
+//**********************************************************************
+#ifndef __SIMPLE_TEXT_INPUT_PROTOCOL_H__
+#define __SIMPLE_TEXT_INPUT_PROTOCOL_H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <EFI.h>
+#include <KeyboardCommonDefinitions.h>
+
+#ifndef GUID_VARIABLE_DECLARATION
+#define GUID_VARIABLE_DECLARATION(Variable, Guid) extern EFI_GUID Variable
+#endif
+
+#define EFI_SIMPLE_TEXT_INPUT_PROTOCOL_GUID \
+ {0x387477c1, 0x69c7, 0x11d2, 0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b }
+
+GUID_VARIABLE_DECLARATION(gEfiSimpleTextInProtocolGuid,EFI_SIMPLE_TEXT_INPUT_PROTOCOL_GUID);
+
+//EFI.h contains forward declaration of EFI_SIMPLE_TEXT_INPUT_PROTOCOL
+//typedef struct _EFI_SIMPLE_TEXT_INPUT_PROTOCOL EFI_SIMPLE_TEXT_INPUT_PROTOCOL;
+
+typedef EFI_STATUS (EFIAPI *EFI_INPUT_RESET) (
+ EFI_SIMPLE_TEXT_INPUT_PROTOCOL *This,
+ BOOLEAN ExtendedVerification );
+
+typedef EFI_STATUS (EFIAPI *EFI_INPUT_READ_KEY) (
+ EFI_SIMPLE_TEXT_INPUT_PROTOCOL *This,
+ EFI_INPUT_KEY *Key );
+
+typedef struct _EFI_SIMPLE_TEXT_INPUT_PROTOCOL {
+ EFI_INPUT_RESET Reset;
+ EFI_INPUT_READ_KEY ReadKeyStroke;
+ EFI_EVENT WaitForKey;
+} EFI_SIMPLE_TEXT_INPUT_PROTOCOL;
+
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
diff --git a/Include/Protocol/SimpleTextInEx.h b/Include/Protocol/SimpleTextInEx.h
new file mode 100644
index 0000000..316d321
--- /dev/null
+++ b/Include/Protocol/SimpleTextInEx.h
@@ -0,0 +1,148 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/BIN/Core/Include/Protocol/SimpleTextInEx.h 11 9/22/11 6:16a Rameshr $
+//
+// $Revision: 11 $
+//
+// $Date: 9/22/11 6:16a $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Core/Include/Protocol/SimpleTextInEx.h $
+//
+// 11 9/22/11 6:16a Rameshr
+// [TAG] EIP63054
+// [Category] New Feature
+// [Description] Undo Pervious check-in.
+//
+// 9 7/21/11 3:58p Artems
+// EIP 64356: Combine common keyboard definitions in one file
+//
+// 8 8/21/09 10:19a Felixp
+// define GUID_VARIABLE_DECLARATION macro only if it has not been already
+// defined.
+//
+// 7 3/17/08 4:56p Rameshraju
+// Build error resolved.
+//
+// 6 10/18/07 11:23a Felixp
+//
+// 5 10/17/07 4:24p Felixp
+//
+// 4 10/17/07 4:10p Felixp
+// Clean up
+//
+// 2 8/24/07 3:03p Olegi
+//
+// 1 8/23/07 2:44p Olegi
+//
+//**********************************************************************
+//<AMI_FHDR_START>
+//
+// Name: SimpleTextInEx.h
+//
+// Description: SimpleTextInEx protocol definition
+//
+//<AMI_FHDR_END>
+//**********************************************************************
+#ifndef __SIMPLE_TEXT_INPUT_EX_PROTOCOL_H__
+#define __SIMPLE_TEXT_INPUT_EX_PROTOCOL_H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <EFI.h>
+#include <KeyboardCommonDefinitions.h>
+
+#ifndef GUID_VARIABLE_DECLARATION
+#define GUID_VARIABLE_DECLARATION(Variable, Guid) extern EFI_GUID Variable
+#endif
+
+#define EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL_GUID \
+ {0xdd9e7534, 0x7762, 0x4698, 0x8c, 0x14, 0xf5, 0x85, 0x17, 0xa6, 0x25, 0xaa}
+
+GUID_VARIABLE_DECLARATION(gEfiSimpleTextInExProtocolGuid,EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL_GUID);
+
+#ifndef GUID_VARIABLE_DEFINITION
+
+typedef struct _EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL;
+
+typedef EFI_STATUS (EFIAPI *EFI_INPUT_RESET_EX) (
+ IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This,
+ IN BOOLEAN ExtendedVerification
+);
+
+
+typedef struct {
+ EFI_INPUT_KEY Key;
+ EFI_KEY_STATE KeyState;
+} EFI_KEY_DATA;
+
+typedef EFI_STATUS (EFIAPI *EFI_INPUT_READ_KEY_EX) (
+ IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This,
+ OUT EFI_KEY_DATA *KeyData
+);
+
+typedef EFI_STATUS (EFIAPI *EFI_SET_STATE) (
+ IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This,
+ IN EFI_KEY_TOGGLE_STATE *KeyToggleState
+);
+
+typedef EFI_STATUS (EFIAPI *EFI_KEY_NOTIFY_FUNCTION) (
+ IN EFI_KEY_DATA *KeyData
+);
+
+typedef EFI_STATUS (EFIAPI *EFI_REGISTER_KEYSTROKE_NOTIFY) (
+ IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This,
+ IN EFI_KEY_DATA *KeyData,
+ IN EFI_KEY_NOTIFY_FUNCTION KeyNotificationFunction,
+ OUT EFI_HANDLE *NotifyHandle
+);
+
+typedef EFI_STATUS (EFIAPI *EFI_UNREGISTER_KEYSTROKE_NOTIFY) (
+ IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This,
+ IN EFI_HANDLE NotificationHandle
+);
+
+typedef struct _EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL {
+ EFI_INPUT_RESET_EX Reset;
+ EFI_INPUT_READ_KEY_EX ReadKeyStrokeEx;
+ EFI_EVENT WaitForKeyEx;
+ EFI_SET_STATE SetState;
+ EFI_REGISTER_KEYSTROKE_NOTIFY RegisterKeyNotify;
+ EFI_UNREGISTER_KEYSTROKE_NOTIFY UnregisterKeyNotify;
+} EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL;
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#endif // #ifndef GUID_VARIABLE_DEFINITION
+#ifdef __cplusplus
+}
+#endif
+#endif
+
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//********************************************************************** \ No newline at end of file
diff --git a/Include/Protocol/SimpleTextOut.h b/Include/Protocol/SimpleTextOut.h
new file mode 100644
index 0000000..e4d95ef
--- /dev/null
+++ b/Include/Protocol/SimpleTextOut.h
@@ -0,0 +1,258 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2005, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/BIN/Core/Include/Protocol/SimpleTextOut.h 1 3/13/06 1:39a Felixp $
+//
+// $Revision: 1 $
+//
+// $Date: 3/13/06 1:39a $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Core/Include/Protocol/SimpleTextOut.h $
+//
+// 1 3/13/06 1:39a Felixp
+//
+// 2 10/26/05 5:08p Ambikas
+//
+// 1 1/28/05 12:44p Felixp
+//
+// 2 1/18/05 3:22p Felixp
+// PrintDebugMessage renamed to Trace
+//
+// 1 12/23/04 9:41a Felixp
+//
+// 3 12/10/04 4:39p Robert
+// Added #pragma pack(1) around the Simple text output mode datastructure
+//
+// 2 11/08/04 3:15p Robert
+// fixed a typedef for the for the EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL
+//
+// 1 11/03/04 9:39p Felixp
+//
+// 1 9/15/04 5:09p Markw
+//
+//**********************************************************************
+//<AMI_FHDR_START>
+//
+// Name: SimpleTextOut.h
+//
+// Description: SIMPLE_TEXT_OUTPUT Protocol Definition
+//
+//<AMI_FHDR_END>
+//**********************************************************************
+#ifndef __SIMPLE_TEXT_OUPUT_PROTOCOL_H__
+#define __SIMPLE_TEXT_OUPUT_PROTOCOL_H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+#include <EFI.h>
+
+#define EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL_GUID \
+ {0x387477c2,0x69c7,0x11d2,0x8e,0x39,0x00,0xa0,0xc9,0x69,0x72,0x3b}
+
+GUID_VARIABLE_DECLARATION(gEfiSimpleTextOutProtocolGuid,EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL_GUID);
+
+//EFI.h contains forward declaration of EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL
+//typedef struct _EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL;
+
+//*******************************************************
+// SIMPLE_TEXT_OUTPUT_MODE
+//*******************************************************
+
+#pragma pack(1)
+typedef struct {
+ INT32 MaxMode;
+ INT32 Mode;
+ INT32 Attribute;
+ INT32 CursorColumn;
+ INT32 CursorRow;
+ BOOLEAN CursorVisible;
+} SIMPLE_TEXT_OUTPUT_MODE;
+
+#pragma pack()
+//*******************************************************
+// UNICODE DRAWING CHARACTERS
+//*******************************************************
+#define BOXDRAW_HORIZONTAL 0x2500
+#define BOXDRAW_VERTICAL 0x2502
+#define BOXDRAW_DOWN_RIGHT 0x250c
+#define BOXDRAW_DOWN_LEFT 0x2510
+#define BOXDRAW_UP_RIGHT 0x2514
+#define BOXDRAW_UP_LEFT 0x2518
+#define BOXDRAW_VERTICAL_RIGHT 0x251c
+#define BOXDRAW_VERTICAL_LEFT 0x2524
+#define BOXDRAW_DOWN_HORIZONTAL 0x252c
+#define BOXDRAW_UP_HORIZONTAL 0x2534
+#define BOXDRAW_VERTICAL_HORIZONTAL 0x253c
+#define BOXDRAW_DOUBLE_HORIZONTAL 0x2550
+#define BOXDRAW_DOUBLE_VERTICAL 0x2551
+#define BOXDRAW_DOWN_RIGHT_DOUBLE 0x2552
+#define BOXDRAW_DOWN_DOUBLE_RIGHT 0x2553
+#define BOXDRAW_DOUBLE_DOWN_RIGHT 0x2554
+#define BOXDRAW_DOWN_LEFT_DOUBLE 0x2555
+#define BOXDRAW_DOWN_DOUBLE_LEFT 0x2556
+#define BOXDRAW_DOUBLE_DOWN_LEFT 0x2557
+#define BOXDRAW_UP_RIGHT_DOUBLE 0x2558
+#define BOXDRAW_UP_DOUBLE_RIGHT 0x2559
+#define BOXDRAW_DOUBLE_UP_RIGHT 0x255a
+#define BOXDRAW_UP_LEFT_DOUBLE 0x255b
+#define BOXDRAW_UP_DOUBLE_LEFT 0x255c
+#define BOXDRAW_DOUBLE_UP_LEFT 0x255d
+#define BOXDRAW_VERTICAL_RIGHT_DOUBLE 0x255e
+#define BOXDRAW_VERTICAL_DOUBLE_RIGHT 0x255f
+#define BOXDRAW_DOUBLE_VERTICAL_RIGHT 0x2560
+#define BOXDRAW_VERTICAL_LEFT_DOUBLE 0x2561
+#define BOXDRAW_VERTICAL_DOUBLE_LEFT 0x2562
+#define BOXDRAW_DOUBLE_VERTICAL_LEFT 0x2563
+#define BOXDRAW_DOWN_HORIZONTAL_DOUBLE 0x2564
+#define BOXDRAW_DOWN_DOUBLE_HORIZONTAL 0x2565
+#define BOXDRAW_DOUBLE_DOWN_HORIZONTAL 0x2566
+#define BOXDRAW_UP_HORIZONTAL_DOUBLE 0x2567
+#define BOXDRAW_UP_DOUBLE_HORIZONTAL 0x2568
+#define BOXDRAW_DOUBLE_UP_HORIZONTAL 0x2569
+#define BOXDRAW_VERTICAL_HORIZONTAL_DOUBLE 0x256a
+#define BOXDRAW_VERTICAL_DOUBLE_HORIZONTAL 0x256b
+#define BOXDRAW_DOUBLE_VERTICAL_HORIZONTAL 0x256c
+//*******************************************************
+// EFI Required Block Elements Code Chart
+//*******************************************************
+#define BLOCKELEMENT_FULL_BLOCK 0x2588
+#define BLOCKELEMENT_LIGHT_SHADE 0x2591
+//*******************************************************
+// EFI Required Geometric Shapes Code Chart
+//*******************************************************
+#define GEOMETRICSHAPE_UP_TRIANGLE 0x25b2
+#define GEOMETRICSHAPE_RIGHT_TRIANGLE 0x25ba
+#define GEOMETRICSHAPE_DOWN_TRIANGLE 0x25bc
+#define GEOMETRICSHAPE_LEFT_TRIANGLE 0x25c4
+//*******************************************************
+// EFI Required Arrow shapes
+//*******************************************************
+#define ARROW_LEFT 0x2190
+#define ARROW_UP 0x2191
+#define ARROW_RIGHT 0x2192
+#define ARROW_DOWN 0x2193
+//*******************************************************
+// Attributes
+//*******************************************************
+#define EFI_BLACK 0x00
+#define EFI_BLUE 0x01
+#define EFI_GREEN 0x02
+#define EFI_CYAN 0x03
+#define EFI_RED 0x04
+#define EFI_MAGENTA 0x05
+#define EFI_BROWN 0x06
+#define EFI_LIGHTGRAY 0x07
+#define EFI_BRIGHT 0x08
+#define EFI_DARKGRAY 0x08
+#define EFI_LIGHTBLUE 0x09
+#define EFI_LIGHTGREEN 0x0A
+#define EFI_LIGHTCYAN 0x0B
+#define EFI_LIGHTRED 0x0C
+#define EFI_LIGHTMAGENTA 0x0D
+#define EFI_YELLOW 0x0E
+#define EFI_WHITE 0x0F
+#define EFI_BACKGROUND_BLACK 0x00
+#define EFI_BACKGROUND_BLUE 0x10
+#define EFI_BACKGROUND_GREEN 0x20
+#define EFI_BACKGROUND_CYAN 0x30
+#define EFI_BACKGROUND_RED 0x40
+#define EFI_BACKGROUND_MAGENTA 0x50
+#define EFI_BACKGROUND_BROWN 0x60
+#define EFI_BACKGROUND_LIGHTGRAY 0x70
+#define EFI_TEXT_ATTR(foreground,background) \
+ ((foreground) | ((background) << 4))
+
+
+typedef EFI_STATUS (EFIAPI *EFI_TEXT_RESET) (
+ IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
+ IN BOOLEAN ExtendedVerification
+);
+
+typedef EFI_STATUS (EFIAPI *EFI_TEXT_STRING) (
+ IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
+ IN CHAR16 *String
+);
+
+typedef EFI_STATUS (EFIAPI *EFI_TEXT_TEST_STRING) (
+ IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
+ IN CHAR16 *String
+);
+
+typedef EFI_STATUS (EFIAPI *EFI_TEXT_QUERY_MODE) (
+ IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
+ IN UINTN ModeNumber,
+ OUT UINTN *Columns,
+ OUT UINTN *Rows
+);
+
+typedef EFI_STATUS (* EFIAPI EFI_TEXT_SET_MODE) (
+ IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
+ IN UINTN ModeNumber
+);
+
+typedef EFI_STATUS (EFIAPI *EFI_TEXT_SET_ATTRIBUTE) (
+ IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
+ IN UINTN Attribute
+);
+
+typedef EFI_STATUS (EFIAPI *EFI_TEXT_CLEAR_SCREEN) (
+ IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This
+);
+
+typedef EFI_STATUS (EFIAPI *EFI_TEXT_SET_CURSOR_POSITION) (
+ IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
+ IN UINTN Column,
+ IN UINTN Row
+);
+
+typedef EFI_STATUS (EFIAPI *EFI_TEXT_ENABLE_CURSOR) (
+ IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
+ IN BOOLEAN Visible
+);
+
+
+typedef struct _EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL {
+ EFI_TEXT_RESET Reset;
+ EFI_TEXT_STRING OutputString;
+ EFI_TEXT_TEST_STRING TestString;
+ EFI_TEXT_QUERY_MODE QueryMode;
+ EFI_TEXT_SET_MODE SetMode;
+ EFI_TEXT_SET_ATTRIBUTE SetAttribute;
+ EFI_TEXT_CLEAR_SCREEN ClearScreen;
+ EFI_TEXT_SET_CURSOR_POSITION SetCursorPosition;
+ EFI_TEXT_ENABLE_CURSOR EnableCursor;
+ SIMPLE_TEXT_OUTPUT_MODE *Mode;
+ } EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL;
+
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2005, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
diff --git a/Include/Protocol/SmBus.h b/Include/Protocol/SmBus.h
new file mode 100644
index 0000000..aa2d349
--- /dev/null
+++ b/Include/Protocol/SmBus.h
@@ -0,0 +1,140 @@
+//**********************************************************************//
+//**********************************************************************//
+//** **//
+//** (C)Copyright 1985-2009, American Megatrends, Inc. **//
+//** **//
+//** All Rights Reserved. **//
+//** **//
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **//
+//** **//
+//** Phone: (770)-246-8600 **//
+//** **//
+//**********************************************************************//
+//**********************************************************************//
+//**********************************************************************//
+// $Header: /Alaska/BIN/Core/Include/Protocol/SmBus.h 3 1/16/09 9:51a Felixp $
+//
+// $Revision: 3 $
+//
+// $Date: 1/16/09 9:51a $
+//*****************************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Core/Include/Protocol/SmBus.h $
+//
+// 3 1/16/09 9:51a Felixp
+// SM Bus Protocol and PPI headers are updated. Common code moved into
+// newly created header file (Include\SmBus.h).
+//
+// 1 11/07/05 3:40p Sivagarn
+// Initial Checkin
+//
+//*****************************************************************************
+//<AMI_FHDR_START>
+//----------------------------------------------------------------------------
+// Name: SmBus.h
+//
+// Description: This file contains the protocol definitions for Smbus protocol
+//
+//----------------------------------------------------------------------------
+//<AMI_FHDR_END>
+#ifndef __SMBUS_HC_PROTOCOL_H__
+#define __SMBUS_HC_PROTOCOL_H__
+#include <EFI.h>
+#include <SmBus.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define EFI_SMBUS_HC_PROTOCOL_GUID \
+ {0xe49d33ed, 0x513d, 0x4634, 0xb6, 0x98, 0x6f, 0x55, 0xaa, 0x75, 0x1c, 0x1b}
+
+GUID_VARIABLE_DECLARATION(gEfiSmbusProtocolGuid,EFI_SMBUS_HC_PROTOCOL_GUID);
+
+typedef struct _EFI_SMBUS_HC_PROTOCOL EFI_SMBUS_HC_PROTOCOL;
+typedef struct _EFI_SMBUS_DATA_STRUC SMBUS_DATA_STRUC;
+
+
+//*******************************************************
+// EFI_SMBUS_NOTIFY_FUNCTION
+//*******************************************************
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SMBUS_NOTIFY_FUNCTION) (
+ IN EFI_SMBUS_DEVICE_ADDRESS SlaveAddress,
+ IN UINTN Data
+);
+//*******************************************************
+// EFI_SMBUS_HC_EXECUTE_OPERATION
+//*******************************************************
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SMBUS_HC_EXECUTE_OPERATION) (
+ IN EFI_SMBUS_HC_PROTOCOL *This,
+ IN EFI_SMBUS_DEVICE_ADDRESS SlaveAddress,
+ IN EFI_SMBUS_DEVICE_COMMAND Command,
+ IN EFI_SMBUS_OPERATION Operation,
+ IN BOOLEAN PecCheck,
+ IN OUT UINTN *Length,
+ IN OUT VOID *Buffer
+ );
+//*******************************************************
+// EFI_SMBUS_HC_PROTOCOL_ARP_DEVICE
+//*******************************************************
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SMBUS_HC_PROTOCOL_ARP_DEVICE) (
+ IN EFI_SMBUS_HC_PROTOCOL *This,
+ IN BOOLEAN ArpAll,
+ IN EFI_SMBUS_UDID *SmbusUdid, OPTIONAL
+ IN OUT EFI_SMBUS_DEVICE_ADDRESS *SlaveAddress OPTIONAL
+);
+//*******************************************************
+// EFI_SMBUS_HC_PROTOCOL_GET_ARP_MAP
+//*******************************************************
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SMBUS_HC_PROTOCOL_GET_ARP_MAP) (
+ IN EFI_SMBUS_HC_PROTOCOL *This,
+ IN OUT UINTN *Length,
+ IN OUT EFI_SMBUS_DEVICE_MAP **SmbusDeviceMap
+);
+//*******************************************************
+// EFI_SMBUS_HC_PROTOCOL_NOTIFY
+//*******************************************************
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SMBUS_HC_PROTOCOL_NOTIFY) (
+ IN EFI_SMBUS_HC_PROTOCOL *This,
+ IN EFI_SMBUS_DEVICE_ADDRESS SlaveAddress,
+ IN UINTN Data,
+ IN EFI_SMBUS_NOTIFY_FUNCTION NotifyFunction
+);
+//*******************************************************
+// EFI_SMBUS_HC_PROTOCOL
+//*******************************************************
+typedef struct _EFI_SMBUS_HC_PROTOCOL {
+ EFI_SMBUS_HC_EXECUTE_OPERATION Execute;
+ EFI_SMBUS_HC_PROTOCOL_ARP_DEVICE ArpDevice;
+ EFI_SMBUS_HC_PROTOCOL_GET_ARP_MAP GetArpMap;
+ EFI_SMBUS_HC_PROTOCOL_NOTIFY Notify;
+};
+
+#ifdef __cplusplus
+}
+#endif
+#endif // __SMBUS_CTRL_H__
+//**********************************************************************//
+//**********************************************************************//
+//** **//
+//** (C)Copyright 1985-2009, American Megatrends, Inc. **//
+//** **//
+//** All Rights Reserved. **//
+//** **//
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **//
+//** **//
+//** Phone: (770)-246-8600 **//
+//** **//
+//**********************************************************************//
+//**********************************************************************//
diff --git a/Include/Protocol/SmbiosDynamicData.h b/Include/Protocol/SmbiosDynamicData.h
new file mode 100644
index 0000000..76bf66e
--- /dev/null
+++ b/Include/Protocol/SmbiosDynamicData.h
@@ -0,0 +1,585 @@
+//**********************************************************************//
+//**********************************************************************//
+//** **//
+//** (C)Copyright 1985-2016, American Megatrends, Inc. **//
+//** **//
+//** All Rights Reserved. **//
+//** **//
+//** 5555 Oakbrook Pkwy, Suite 200, Norcross, GA 30093 **//
+//** **//
+//** Phone: (770)-246-8600 **//
+//** **//
+//**********************************************************************//
+//**********************************************************************//
+
+//**********************************************************************//
+// $Header: /Alaska/BIN/Modules/SMBIOS/SmbiosProtocol/SmbiosDynamicData.h 33 4/07/16 5:50p Davidd $
+//
+// $Revision: 33 $
+//
+// $Date: 4/07/16 5:50p $
+//**********************************************************************//
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Modules/SMBIOS/SmbiosProtocol/SmbiosDynamicData.h $
+//
+// 33 4/07/16 5:50p Davidd
+// [TAG] EIP231162
+// [Category] New Feature
+// [Description] Merge Aptio V Smbios -09 changes for Aptio 4
+// 4.6.5.5_SMBIOS_40 release
+// [Files] Smbios.sdl
+// SmbiosDynamicData.h
+// Smbios.h
+// SmbiosStaticData.sdl
+// SmbiosStaticData.asm
+// SmbData.mac
+// SmbMacro.aid
+// SmbDesc.def
+//
+// 32 5/29/13 12:47p Davidd
+// [TAG] EIP124735
+// [Category] Spec Update
+// [Severity] Normal
+// [Description] SMBIOS 2.8.0 specification support for Aptio 4
+// [Files] Smb.equ
+// Smbdata.mac
+// Smbdesc.def
+// Smbstruc.def
+// Smbios.c
+// Smbios.h
+// SmbiosDynamicData.h
+//
+// 31 5/23/13 2:37p Davidd
+// [TAG] EIP104836
+// [Category] New Feature
+// [Description] DMIEdit support edit type 4
+// [Files] SmbiosBoard.c
+// SmbiosDMIEditBoard.sdl
+// Smbios.c
+// SmbiosDMIEditFunc.c
+// Smbios.h
+// SmbiosDynamicData.h
+//
+// 30 6/16/11 12:28p Davidd
+// [TAG] EIP61776
+// [Category] Improvement
+// [Description] SMBIOS Type 17 "Type Detail" Registered/Unbuffered,
+// needs to be dynamically updated
+// [Files] Smbios.sdl
+// SmbiosDynamicData.h
+// Smbios.c
+//
+// 29 5/04/11 3:34p Davidd
+// [TAG] EIP57144
+// [Category] NEW FEATURE
+// [Description] Allow SMBIOS Type 39 to be modified using DMIEdit
+// [Files] SmbiosBoard.c
+// Smbios.h
+// SmbiosDynamicData.h
+// Smbios.c
+// SmbiosDmieditFunc.c
+// SmbiosNvramFunc.c
+//
+// 28 12/08/10 10:57a Davidd
+// [TAG] EIP48952
+// [Category] Improvement
+// [Description] Customer Request for SMBIOS Type 16
+// MemoryErrorCorrection field to be filled out
+// [Files]
+// Smbios.c
+// SmbiosDynamicData.h
+//
+// 27 11/19/10 6:19p Davidd
+// [TAG] EIP46175
+// [Category] Improvement
+// [Description] Redesign SMBIOS to avoid redundant SPD reading
+// [Files]
+// Smbios.c
+// SmbiosDynamicData.h
+//
+// 26 11/15/10 3:56p Davidd
+// [TAG] EIP46175
+// [Category] Improvement
+// [Description] Redesign SMBIOS to avoid redundant SPD reading
+// [Files]
+// Smbios.c
+// SmbiosDynamicData.h
+//
+// 25 11/15/10 2:19p Davidd
+// [TAG] EIP46936
+// [Category] Improvement
+// [Description] Generic Smbios module should have the support to
+// disable SMBIOS memory update
+// [Files]
+// Smbios.c
+// Smbios.sdl
+// SmbiosBoard.c
+// SmbiosDynamicData.h
+//
+// 24 10/08/10 8:07p Davidd
+// [TAG] EIP43278
+//
+// [Category] Function Request
+//
+// [Severity] Normal
+//
+// [Description] SMBIOS 2.7 requirement
+//
+// [Files] Include\Protocol\Smbios.h
+// Include\Protocol\SmbiosDynamicData.h
+// Board\EM\SMBIOS\SMBiosStaticData\SmbiosStaticData.sdl
+// Board\EM\SMBIOS\SMBiosStaticData\SMBDATA.MAC
+// Board\EM\SMBIOS\SMBiosStaticData\SMBSTRUC.DEF
+// Board\EM\SMBIOS\SMBiosStaticData\SMBMACRO.AID
+// Board\EM\SMBIOS\SMBiosStaticData\Smbdesc.def
+// Board\EM\SMBIOS\SMBiosStaticData\SMB.EQU
+//
+// 23 6/02/09 3:52p Davidd
+// Updated AMI headers (EIP 22180)
+//
+// 22 5/19/09 11:01a Davidd
+// Changes added to improve memory type 17 porting (EIP 22241).
+//
+// 21 12/30/08 3:15p Davidd
+// Fixed the hanging problem when only SMBIOS binary component is present
+// (ref. EIP 18370)
+//
+// 20 11/14/08 4:42p Davidd
+// - Added OemUpdate protocol
+//
+// 19 10/23/08 6:21p Davidd
+// Added changes to support SMBIOS version 2.5 and 2.6.
+//
+// 18 2/22/08 10:20a Davidd
+// Simplified the way the number of memory slots for each physical memory
+// array are defined.
+//
+// 17 2/06/08 3:44p Davidd
+// Added NumberOfBatteries field to _EFI_SMBIOS_BOARD_PROTOCOL to hold the
+// number of batteries in the system.
+//
+// 16 2/01/08 11:57a Davidd
+// Changes made to support SMBIOS type 17 with multiple memory arrays.
+//
+// 15 12/17/07 12:20p Davidd
+// Added PORTABLE_BATTERY_INFO to EFI_SMBIOS_BOARD_PROTOCOL
+//
+// 14 11/26/07 5:53p Davidd
+// Changes added to dynamically update the Processor Information Type 4.
+//
+// 13 11/21/07 10:38a Davidd
+// Added dynamic data update support for Portable Battery Data structure
+// 22.
+//
+// 12 9/12/07 2:26p Davidd
+// Added changes to set memory type and speed to unknown for unoccupied
+// memory slot.
+//
+// 11 6/05/07 4:18p Michaela
+// Added AMI_SMBIOS_CPU_INFO_PROTOCOL for dynamic
+// updating of CPU information
+//
+// 10 3/29/07 4:05p Davidd
+// Made change to the year in the AMI banner
+//
+// 9 3/21/07 4:01p Michaela
+// Added MemErrInfoHandle field in MEMORY_DEVICE
+// structure typedef
+//
+// 8 12/15/06 1:15p Davidd
+// Code cleanup and reformatted to coding standard.
+//
+// 7 3/02/06 10:35a Davidd
+// Commented out fields deemed to be static.
+//
+// 6 7/27/05 1:25p Davidd
+// Removed conditional compilation switches and added them to
+// SmbiosBoardProtocol.
+//
+// 5 7/18/05 6:07p Davidd
+// Added protocol definition for creating the dynamic data.
+//
+// 4 7/13/05 5:35p Davidd
+// Added Processor Manufacturer and Processor Version fields.
+//
+// 3 7/05/05 12:17p Davidd
+// Made SMBIOS variables static so that it can be shared in different
+// files.
+//
+// 2 6/21/05 12:08p Davidd
+// Corrected build error.
+//
+// 1 5/02/05 3:23p Davidd
+// Initial Check-in.
+//
+// 1 4/29/05 2:12p Davidd
+// Initial checkin.
+//
+//**********************************************************************//
+
+#ifndef _SMIBios_Dynamic_H
+#define _SMIBios_Dynamic_H
+
+#include <Token.h>
+#include <AmiHobs.h>
+#include <Protocol/SmBus.h>
+
+#if SMBIOS_SUPPORT
+#define EFI_SMBIOS_DYNAMIC_DATA_GUID \
+ {0xe380280c, 0x4c35, 0x4aa3, { 0xb9, 0x61, 0x7a, 0xe4, 0x89, 0xa2, 0xb9, 0x26 }}
+
+#define EFI_SMBIOS_BOARD_PROTOCOL_GUID \
+ {0x903dd14, 0x2ca0, 0x458a, 0xb5, 0xeb, 0xc, 0xc, 0xa3, 0xd, 0x78, 0x5c}
+
+#define EFI_MEMORY_SUBCLASS_DRIVER_GUID \
+ { 0x1767CEED, 0xDB82, 0x47cd, 0xBF, 0x2B, 0x68, 0x45, 0x8A, 0x8C, 0xCF, 0xFF }
+
+#define EFI_MEMORY_SUBCLASS_GUID \
+ {0x4E8F4EBB, 0x64B9, 0x4e05, 0x9B, 0x18, 0x4C, 0xFE, 0x49, 0x23, 0x50, 0x97}
+
+// {3D6CDB0A-5B1F-43a3-A43B-441267F9DAB5}
+#define AMI_SMBIOS_CPU_INFO_PROTOCOL_GUID \
+ {0x3d6cdb0a, 0x5b1f, 0x43a3, 0xa4, 0x3b, 0x44, 0x12, 0x67, 0xf9, 0xda, 0xb5}
+
+#define MAX_NUMBER_OF_MEM_MODULE A1_MEMORY_SOCKETS
+#if NO_OF_PHYSICAL_MEMORY_ARRAY >= 2
+ #if A2_MEMORY_SOCKETS > MAX_NUMBER_OF_MEM_MODULE
+ #undef MAX_NUMBER_OF_MEM_MODULE
+ #define MAX_NUMBER_OF_MEM_MODULE A2_MEMORY_SOCKETS
+ #endif
+#endif
+#if NO_OF_PHYSICAL_MEMORY_ARRAY >= 3
+ #if A3_MEMORY_SOCKETS > MAX_NUMBER_OF_MEM_MODULE
+ #undef MAX_NUMBER_OF_MEM_MODULE
+ #define MAX_NUMBER_OF_MEM_MODULE A3_MEMORY_SOCKETS
+ #endif
+#endif
+#if NO_OF_PHYSICAL_MEMORY_ARRAY == 4
+ #if A4_MEMORY_SOCKETS > MAX_NUMBER_OF_MEM_MODULE
+ #undef MAX_NUMBER_OF_MEM_MODULE
+ #define MAX_NUMBER_OF_MEM_MODULE A4_MEMORY_SOCKETS
+ #endif
+#endif
+
+static CHAR16 *SmbiosBaseBoardVar = L"BASEBOARD DATA";
+static CHAR16 *SmbiosChassisVar = L"CHASSIS DATA";
+static CHAR16 *SmbiosCpuVar = L"CPU DATA";
+static CHAR16 *SmbiosSlotsVar = L"SLOTS DATA";
+static CHAR16 *SmbiosOnBoardVar = L"ONBOARD DEV DATA";
+static CHAR16 *SmbiosMemVar = L"MEMORY DATA";
+static CHAR16 *SmbiosBatteryVar = L"BATTERY DATA";
+static CHAR16 *SmbiosOnBoardExtVar = L"ONBOARD DEV EXTENDED DATA";
+
+#pragma pack(1)
+
+//**********************************************************************//
+// Base Board Structure
+//**********************************************************************//
+#if BASE_BOARD_INFO
+typedef struct { // Type 2
+ CHAR8 *BoardManufacturer;
+ CHAR8 *BoardName;
+} BASE_BOARD_DATA;
+#endif //BASE_BOARD_INFO
+
+//**********************************************************************//
+// Chassis Structure
+//**********************************************************************//
+#if SYS_CHASSIS_INFO
+typedef struct { // Type 3
+ UINT8 Type;
+} CHASSIS_DATA;
+#endif //SYS_CHASSIS_INFO
+
+//**********************************************************************//
+// CPU Structure
+//**********************************************************************//
+
+typedef struct { // Type 4
+ UINT8 Family; // 3.3.5.2
+ UINT32 ProcessorID_1; // 3.3.5.3 - 1st DWORD
+ UINT32 ProcessorID_2; // 3.3.5.3 - 2nd DWORD
+ UINT8 Voltage; // 3.3.5.4
+ UINT16 ExtClockFreq; // in MHz
+ UINT16 MaxSpeed; // in MHz
+ UINT16 CurrentSpeed; // in MHz
+ UINT8 Status; // pg 43
+ UINT8 Upgrade; // 3.3.5.5
+ UINT8 Manufacturer[18];
+ UINT8 Version[48];
+ UINT8 CoreCount; // 3.3.5.6
+ UINT8 CoreEnabled; // 3.3.5.7
+ UINT8 ThreadCount; // 3.3.5.8
+ UINT16 Family2; // 3.3.5.2
+} CPU_DATA;
+
+typedef struct { // Type 7
+ UINT16 CacheConfig; // pg 52
+ UINT16 MaxCacheSize; // pg 52
+ UINT16 InstalledSize; // pg 52
+ UINT16 SupportSRAM; // 3.3.8.1
+ UINT16 CurrentSRAM; // 3.3.8.1
+ UINT8 CacheSpeed; // in nS
+ UINT8 ErrorCorrectionType; // 3.3.8.2
+ UINT8 SystemCacheType; // 3.3.8.3
+ UINT8 Associativity; // 3.3.8.4
+} CACHE_DATA;
+
+typedef struct { // One for each CPU
+ CPU_DATA CpuData;
+ CACHE_DATA L1Cache;
+ CACHE_DATA L2Cache;
+ CACHE_DATA L3Cache;
+} SINGLE_CPU_DATA;
+
+typedef struct { // CPU data structure
+ UINT8 NumberCPU;
+ SINGLE_CPU_DATA CpuData[NO_OF_PROCESSOR_SOCKETS];
+} CPU_DYNAMIC_DATA;
+
+typedef CPU_DYNAMIC_DATA SMBIOS_CPU_INFO_PROTOCOL;
+
+//**********************************************************************//
+// Slot Structure
+//**********************************************************************//
+
+typedef struct { // Type 9
+ UINT8 CurrentUsage[NUMBER_OF_SYSTEM_SLOTS]; // 3.3.10.3
+ UINT8 BusNumber[NUMBER_OF_SYSTEM_SLOTS];
+} SYSTEM_SLOT_DYNAMIC_DATA;
+
+//**********************************************************************//
+// On-Board Device Structure
+//**********************************************************************//
+
+#if ONBOARD_DEVICE_INFO
+typedef struct { // Type 10
+ UINT8 OnBoardDev[NUMBER_OF_ONBOARD_DEVICES]; // 3.3.11.1
+} ONBOARD_DEV_DYNAMIC_DATA;
+#endif
+
+//**********************************************************************//
+// Memory Structure
+//**********************************************************************//
+
+typedef struct { // Type 18
+ UINT8 ErrorType; // 3.3.19.1
+ UINT8 ErrorGranularity; // 3.3.19.2
+ UINT8 ErrorOperation; // 3.3.19.3
+ UINT32 MemArrayErrorAddress; // 32-bit physical address (8000 0000h if unknown)
+ UINT32 DeviceErrorAddress; // 32-bit physical address (8000 0000h if unknown)
+ UINT32 ErrorResolution; // in bytes
+} MEM_ERROR;
+
+typedef struct { // Type 19
+ UINT32 StartingAddress; // in KB
+ UINT32 EndingAddress; // in KB
+ UINT8 PartitionWidth; //
+ UINT64 ExtendedStartAddr; // in bytes
+ UINT64 ExtendedEndAddr; // in bytes
+} MEM_ARRAY_MAP_ADDR;
+
+#if MEMORY_DEVICE_INFO
+typedef struct { // Type 20
+ UINT32 StartingAddress; // in KB
+ UINT32 EndingAddress; // in KB
+ UINT8 PartitionRowPosition; //
+ UINT8 InterleavePosition; //
+ UINT8 InterleaveDataDepth; //
+ UINT64 ExtendedStartAddr; // in bytes
+ UINT64 ExtendedEndAddr; // in bytes
+} MEM_DEV_MAP_ADDR;
+#endif
+
+typedef struct { // Type 17
+ UINT16 MemErrInfoHandle; // Type 18
+ UINT16 TotalWidth; // in bits (FFFFh if unknown)
+ UINT16 Size; // FFFFh if unknown, 7FFFh if size is >= 32GB - 1MB
+ UINT8 DeviceSet; //
+ UINT8 MemoryType; //
+ UINT16 Speed; // in MHz
+ UINT32 ExtendedSize; // in megabytes when Size field = 7FFFh, 0 otherwise
+ UINT16 ConfMemClkSpeed; // in MHz, 0 if unknown
+ UINT16 TypeDetail; //
+ UINT16 MinimumVoltage; // Minimum operating voltage in millivolts, 0 if unknown
+ UINT16 MaximumVoltage; // Maximum operating voltage in millivolts, 0 if unknown
+ UINT16 ConfiguredVoltage; // Configured voltage in millivolts, 0 if unknown
+} MEMORY_DEVICE;
+
+typedef struct {
+ MEMORY_DEVICE Type17; // Type 17
+ MEM_ERROR Type18; // Type 18
+#if MEMORY_DEVICE_INFO
+ MEM_DEV_MAP_ADDR Type20; // Type 20
+#endif
+} MEMORY_DEVICE_GROUP;
+
+typedef struct { // Type 16
+ UINT32 MaxCapacity; // in KB (8000 0000h if unknown)
+ UINT16 MemErrInfoHandle; // Type 18
+ MEM_ERROR ArrayMemoryError; // Type 18
+ MEM_ARRAY_MAP_ADDR MemArrayMapAddr; // Type 19
+ MEMORY_DEVICE_GROUP MemoryDeviceData[MAX_NUMBER_OF_MEM_MODULE]; // Type 17 group
+ EFI_SMBUS_DEVICE_ADDRESS SpdSmBusAddr[MAX_NUMBER_OF_MEM_MODULE];
+ UINT64 ExtMaxCapacity; // in Bytes when MaxCapacity = 8000 0000h, 0 otherwise
+} PHYSICAL_MEM_ARRAY;
+
+typedef struct {
+ PHYSICAL_MEM_ARRAY PhysicalMemArray[NO_OF_PHYSICAL_MEMORY_ARRAY];
+} SYSTEM_MEM_ARRAY_DYNAMIC_DATA;
+
+#ifndef AMI_SMBIOS_MEMORY_INFO_HOB_GUID
+ #define AMI_SMBIOS_MEMORY_INFO_HOB_GUID \
+ {0x7d6b8734, 0xb754, 0x443f, { 0xb5, 0x88, 0x77, 0x43, 0x84, 0x3a, 0xd3, 0xf1 }}
+#endif
+
+typedef struct {
+ UINT8 Byte2; // Memory Type
+ UINT8 Byte5To8[9 - 5]; // Attribute, Total Width, Data Width (DDR2 & 3)
+ UINT8 Byte11To14[15 - 11]; // ECC Data Width, Data Width (DDR4)
+ UINT8 Byte64To71[72 - 64]; // Manufacturer (DDR2)
+ UINT8 Byte73To90[91 - 73]; // Part Number (DDR2)
+ UINT8 Byte95To98[99 - 95]; // Serial Number (DDR2)
+ UINT8 Byte117To118[119 - 117]; // Manufacturer (DDR3)
+ UINT8 Byte122To125[126 - 122]; // Serial Number (DDR3)
+ UINT8 Byte128To145[146 - 128]; // Part Number (DDR3)
+ UINT8 Byte320To321[322 - 320]; // Manufacturer (DDR4)
+ UINT8 Byte325To328[329 - 325]; // Serial Number (DDR4)
+ UINT8 Byte329To348[349 - 329]; // Part Number (DDR4)
+} MEM_SPD_DATA;
+
+//**********************************************************************//
+// SPD data needed from NB driver
+//**********************************************************************//
+//typedef struct {
+// EFI_HOB_GUID_TYPE EfiHobGuidType;
+// MEM_SPD_DATA SpdDataArray[NO_OF_PHYSICAL_MEMORY_ARRAY][MAX_NUMBER_OF_MEM_MODULE];
+//} AMI_SMBIOS_MEMORY_INFO_HOB;
+
+//**********************************************************************//
+// Portable Battery Structure
+//**********************************************************************//
+
+#if PORTABLE_BATTERY_INFO
+typedef struct { // One for each Portable Battery
+ UINT8 DeviceName[65];
+ UINT16 DesignCapacity;
+ UINT16 DesignVoltage;
+ UINT8 SbdsVersion[65];
+ UINT16 SbdsSerialNumber;
+ UINT16 SbdsManufacturedDate;
+ UINT8 DesignCapacityMult;
+ BOOLEAN Valid;
+} SMBIOS_PORTABLE_BATTERY_DYNAMIC_INFO;
+
+typedef struct { // Type 22
+ SMBIOS_PORTABLE_BATTERY_DYNAMIC_INFO BatteryDynamicData[NO_OF_PORTABLE_BATTERY];
+} BATTERY_DYNAMIC_DATA;
+#endif
+
+//**********************************************************************//
+// On-Board Device Extended Information Structure
+//**********************************************************************//
+
+#if ONBOARD_DEVICE_EXTENDED_INFO
+typedef struct { // Type 41
+ UINT8 OnBoardDev[ONBOARD_DEVICE_EXT_COUNT]; // 3.3.42
+ UINT8 BusNumber[ONBOARD_DEVICE_EXT_COUNT];
+} ONBOARD_DEV_EXT_DYNAMIC_DATA;
+#endif
+
+#pragma pack()
+
+typedef struct _EFI_SMBIOS_BOARD_PROTOCOL EFI_SMBIOS_BOARD_PROTOCOL;
+
+typedef EFI_STATUS (EFIAPI *EFI_SMBIOS_CREATE_BASE_BOARD_DATA_STRUCTURE) (
+);
+
+typedef EFI_STATUS (EFIAPI *EFI_SMBIOS_CREATE_CHASSIS_DATA_STRUCTURE) (
+);
+
+typedef EFI_STATUS (EFIAPI *EFI_SMBIOS_CREATE_CPU_DATA_STRUCTURE) (
+);
+
+typedef EFI_STATUS (EFIAPI *EFI_SMBIOS_CREATE_SYSTEM_SLOT_DATA_STRUCTURE) (
+);
+
+typedef EFI_STATUS (EFIAPI *EFI_SMBIOS_CREATE_ONBOARD_DEV_DATA_STRUCTURE) (
+);
+
+typedef EFI_STATUS (EFIAPI *EFI_SMBIOS_CREATE_BATTERY_DEV_DATA_STRUCTURE) (
+);
+
+typedef EFI_STATUS (EFIAPI *EFI_SMBIOS_CREATE_ONBOARD_DEV_EXT_STRUCTURE) (
+);
+typedef EFI_STATUS (EFIAPI *EFI_SMBIOS_ENABLE_SMBUS_CONTROLLER) (
+);
+typedef EFI_STATUS (EFIAPI *EFI_SMBIOS_RESTORE_SMBUS_CONTROLLER) (
+);
+typedef EFI_STATUS (EFIAPI *EFI_SMBIOS_READ_SPD) (
+);
+typedef VOID (EFIAPI *EFI_SMBIOS_OEM_UPDATE) (
+);
+
+typedef struct _EFI_SMBIOS_BOARD_PROTOCOL {
+ UINT8 BaseBoardInfoSupport;
+ UINT8 SysChassisInfoSupport;
+ UINT8 ProcessorDmiEditSupport;
+ UINT8 OemStringInfoSupport;
+ UINT8 SystemConfigOptionInfoSupport;
+ UINT8 MemoryErrorInfoSupport;
+ UINT8 OnboardDeviceInfoSupport;
+ UINT8 PortableBatteryInfoSupport;
+ UINT8 AdditionalInfoSupport;
+ UINT8 OnboardDeviceExtInfoSupport;
+ UINT8 SystemPowerSupplyInfoSupport;
+ UINT8 NumberOfCPU;
+ UINT8 NumberOfSystemSlots;
+ UINT8 NumberOfOnBoardDevices;
+ UINT8 NumberOfPhysicalMemoryArray;
+ UINT8 NumberOfBatteries;
+ UINT8 NumberOfOnboardDevExt;
+ EFI_SMBIOS_CREATE_BASE_BOARD_DATA_STRUCTURE SmbiosCreateBaseBoardData; // Create Base Board dynamic data
+ EFI_SMBIOS_CREATE_CHASSIS_DATA_STRUCTURE SmbiosCreateChassisData; // Create Chassis dynamic data
+ EFI_SMBIOS_CREATE_CPU_DATA_STRUCTURE SmbiosCreateCPUData; // Create CPU dynamic data
+ EFI_SMBIOS_CREATE_SYSTEM_SLOT_DATA_STRUCTURE SmbiosCreateSystemSlotData; // Create system slot dynamic data
+ EFI_SMBIOS_CREATE_ONBOARD_DEV_DATA_STRUCTURE SmbiosCreateOnBoardDevData; // Create on-board device dynamic data
+ EFI_SMBIOS_CREATE_BATTERY_DEV_DATA_STRUCTURE SmbiosCreateBatteryDevData; // Create Portable Battery device dynamic data
+ EFI_SMBIOS_CREATE_ONBOARD_DEV_EXT_STRUCTURE SmbiosCreateOnBoardDevExtInfo;
+ EFI_SMBIOS_ENABLE_SMBUS_CONTROLLER EnableSmbusController;
+ EFI_SMBIOS_RESTORE_SMBUS_CONTROLLER RestoreSmbusController;
+ EFI_SMBIOS_READ_SPD GetSpdByte;
+ EFI_SMBIOS_OEM_UPDATE OemUpdate;
+ UINT8 NumberOfMemorySlots[NO_OF_PHYSICAL_MEMORY_ARRAY];
+};
+
+EFI_STATUS CreateBaseBoardDataForSMBios();
+EFI_STATUS CreateChassisDataForSMBios();
+EFI_STATUS CreateCPUDataForSMBios();
+EFI_STATUS CreateSlotDataForSMBios();
+EFI_STATUS CreateOnBoardDevDataForSMBios();
+EFI_STATUS CreateBatteryDataForSMBios();
+EFI_STATUS CreateOnBoardDevExtInfoForSMBios();
+EFI_STATUS EnableSmbusController();
+EFI_STATUS RestoreSmbusController();
+EFI_STATUS GetSpdByte();
+VOID OemUpdate();
+
+#endif // if SMBIOS_SUPPORT
+
+#endif
+
+//**********************************************************************//
+//**********************************************************************//
+//** **//
+//** (C)Copyright 1985-2016, American Megatrends, Inc. **//
+//** **//
+//** All Rights Reserved. **//
+//** **//
+//** 5555 Oakbrook Pkwy, Suite 200, Norcross, GA 30093 **//
+//** **//
+//** Phone: (770)-246-8600 **//
+//** **//
+//**********************************************************************//
+//**********************************************************************//
diff --git a/Include/Protocol/SmbiosGetFlashDataProtocol.h b/Include/Protocol/SmbiosGetFlashDataProtocol.h
new file mode 100644
index 0000000..d1a2d07
--- /dev/null
+++ b/Include/Protocol/SmbiosGetFlashDataProtocol.h
@@ -0,0 +1,93 @@
+//**********************************************************************//
+//**********************************************************************//
+//** **//
+//** (C)Copyright 1985-2010, American Megatrends, Inc. **//
+//** **//
+//** All Rights Reserved. **//
+//** **//
+//** 5555 Oakbrook Pkwy, Suite 200, Norcross, GA 30093 **//
+//** **//
+//** Phone: (770)-246-8600 **//
+//** **//
+//**********************************************************************//
+//**********************************************************************//
+
+//**********************************************************************//
+// $Header: /Alaska/BIN/Modules/SMBIOS/SmbiosProtocol/SmbiosGetFlashDataProtocol.h 7 5/18/10 5:15p Davidd $
+//
+// $Revision: 7 $
+//
+// $Date: 5/18/10 5:15p $
+//**********************************************************************//
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Modules/SMBIOS/SmbiosProtocol/SmbiosGetFlashDataProtocol.h $
+//
+// 7 5/18/10 5:15p Davidd
+// Added PnP function 52h commands 3 and 4 support - EIP 38010.
+//
+// 6 6/02/09 3:53p Davidd
+// Updated AMI headers (EIP 22180)
+//
+// 5 11/14/08 4:42p Davidd
+//
+// 4 3/28/07 7:46p Davidd
+// Updated the year on the AMI banner
+//
+// 3 12/15/06 1:15p Davidd
+// Code cleanup and reformatted to coding standard.
+//
+// 2 8/10/05 11:12a Davidd
+// Added EFI_SMBIOS_PROTOCOL_GUID.
+//
+// 1 5/02/05 3:23p Davidd
+// Initial Check-in.
+//
+// 1 4/29/05 2:12p Davidd
+// Initial checkin.
+//
+//**********************************************************************//
+
+#ifndef _EFI_SMBOS_GET_FLASH_DATA_PROTOCOL_H_
+#define _EFI_SMBOS_GET_FLASH_DATA_PROTOCOL_H_
+
+#include <token.h>
+
+#define EFI_SMBIOS_FLASH_DATA_PROTOCOL_GUID \
+ {0xddfb5557,0x3e2e,0x4569,0xb4,0x59,0xbe,0xff,0xe1,0x89,0xb8,0xb0}
+
+typedef struct _EFI_SMBIOS_FLASH_DATA_PROTOCOL EFI_SMBIOS_FLASH_DATA_PROTOCOL;
+
+typedef EFI_STATUS (*GET_FLASH_TABLE_INFO)(
+ IN EFI_SMBIOS_FLASH_DATA_PROTOCOL *This,
+ OUT VOID **Location,
+ OUT UINT32 *Size
+);
+
+typedef EFI_STATUS (*GET_FIELD) (
+ IN EFI_SMBIOS_FLASH_DATA_PROTOCOL *This,
+ IN UINT8 Table,
+ IN UINT8 Offset,
+ OUT VOID **String
+);
+
+struct _EFI_SMBIOS_FLASH_DATA_PROTOCOL {
+ GET_FLASH_TABLE_INFO GetFlashTableInfo;
+ GET_FIELD GetField;
+};
+
+#endif
+
+//**********************************************************************//
+//**********************************************************************//
+//** **//
+//** (C)Copyright 1985-2010, American Megatrends, Inc. **//
+//** **//
+//** All Rights Reserved. **//
+//** **//
+//** 5555 Oakbrook Pkwy, Suite 200, Norcross, GA 30093 **//
+//** **//
+//** Phone: (770)-246-8600 **//
+//** **//
+//**********************************************************************//
+//**********************************************************************//
diff --git a/Include/Protocol/SmmAccess.h b/Include/Protocol/SmmAccess.h
new file mode 100644
index 0000000..d324595
--- /dev/null
+++ b/Include/Protocol/SmmAccess.h
@@ -0,0 +1,170 @@
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2009, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/SOURCE/Modules/SMM/SmmAccess.h 3 2/07/11 3:37p Markw $
+//
+// $Revision: 3 $
+//
+// $Date: 2/07/11 3:37p $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/SOURCE/Modules/SMM/SmmAccess.h $
+//
+// 3 2/07/11 3:37p Markw
+// [TAG] EIP53481
+// [Category] New Feature
+// [Description] Add PIWG 1.1 SMM support
+// [Files] Smm.sdl, SmmPrivateShared.h, SmmDispatcher.mak,
+// SmmDispatcher.h, SmmDispatcher.c,
+// Smst.c, SmmPiSmst.c, SmmInit.c, SmmBase.c, SmmBase2.c,
+// SmmDriverDispatcher.c, Smm Framewwork Protocol files, SmmPi.h,
+// Smm Pi Protocol files, SmmPciRbio files
+//
+// 2 7/08/09 8:01p Markw
+// Update headers.
+//
+// 1 3/18/07 1:54p Markw
+//
+// 2 3/13/06 1:40a Felixp
+//
+// 1 1/28/05 12:44p Felixp
+//
+// 2 1/18/05 3:22p Felixp
+// PrintDebugMessage renamed to Trace
+//
+// 1 12/23/04 9:41a Felixp
+//
+// 1 1/30/04 10:26a Markw
+//
+// 1 1/26/04 3:25p Markw
+//
+//**********************************************************************
+//<AMI_FHDR_START>
+//
+// Name: SmmAccess_h
+//
+// Description: This provides north bridge functions to open, close, lock,
+// and describe SMM space.
+//
+//<AMI_FHDR_END>
+//**********************************************************************
+#ifndef __SMM_ACCESS_PROTOCOL_H__
+#define __SMM_ACCESS_PROTOCOL_H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+#include <EFI.h>
+
+#define EFI_SMM_ACCESS_PROTOCOL_GUID \
+ {0x3792095a,0xe309,0x4c1e,0xaa,0x01,0x85,0xf5,0x65,0x5a,0x17,0xf1}
+
+GUID_VARIABLE_DECLARATION(gEfiSmmAccessProtocolGuid,EFI_SMM_ACCESS_PROTOCOL_GUID);
+
+//Forward Declaration
+typedef struct _EFI_SMM_ACCESS_PROTOCOL EFI_SMM_ACCESS_PROTOCOL;
+
+#ifndef SMM_ACCESS_DEF
+#define SMM_ACCESS_DEF
+
+//*******************************************************
+//EFI_SMRAM_STATE
+//*******************************************************
+#define EFI_SMRAM_OPEN 0x00000001
+#define EFI_SMRAM_CLOSED 0x00000002
+#define EFI_SMRAM_LOCKED 0x00000004
+#define EFI_CACHEABLE 0x00000008
+#define EFI_ALLOCATED 0x00000010
+#define EFI_NEEDS_TESTING 0x00000020
+#define EFI_NEEDS_ECC_INITIALIZATION 0x00000040
+
+typedef struct _EFI_SMRAM_DESCRIPTOR {
+ EFI_PHYSICAL_ADDRESS PhysicalStart;
+ EFI_PHYSICAL_ADDRESS CpuStart;
+ UINT64 PhysicalSize;
+ UINT64 RegionState;
+} EFI_SMRAM_DESCRIPTOR;
+
+#endif
+
+
+typedef EFI_STATUS (EFIAPI *EFI_SMM_OPEN) (
+ IN EFI_SMM_ACCESS_PROTOCOL *This,
+ IN UINTN DescriptorIndex
+);
+
+typedef EFI_STATUS (EFIAPI *EFI_SMM_CLOSE) (
+ IN EFI_SMM_ACCESS_PROTOCOL *This,
+ IN UINTN DescriptorIndex
+);
+
+typedef EFI_STATUS (EFIAPI *EFI_SMM_LOCK) (
+ IN EFI_SMM_ACCESS_PROTOCOL *This,
+ IN UINTN DescriptorIndex
+);
+
+typedef EFI_STATUS (EFIAPI *EFI_SMM_CAPABILITIES) (
+ IN EFI_SMM_ACCESS_PROTOCOL *This,
+ IN OUT UINTN *SmramMapSize,
+ IN OUT EFI_SMRAM_DESCRIPTOR *SmramMap
+);
+
+//**********************************************************************
+//<AMI_THDR_START>
+//
+// Name: EFI_SMM_ACCESS_PROTOCOL
+//
+// Description: This provides north bridge functions to open, close, lock,
+// and describe SMM space.
+//
+// Fields: Name Type Description
+// ------------------------------------------------------------
+// Open EFI_SMM_OPEN Access SMM space when in non-SMM mode.
+// Close EFI_SMM_CLOSE Close SMM space when in non-SMM mode.
+// Lock EFI_SMM_LOCK Do not allow access to SMM when in non-SMM Mode.
+// GetCapabilities EFI_SMM_CAPABILITIES Provide information for SMM memory areas.
+// LockState BOOLEAN TRUE if SMM memory is locked.
+// OpenState BOOLEAN TRUE if any SMM memory is opened.
+//
+//<AMI_THDR_END>
+//**********************************************************************
+struct _EFI_SMM_ACCESS_PROTOCOL {
+ EFI_SMM_OPEN Open;
+ EFI_SMM_CLOSE Close;
+ EFI_SMM_LOCK Lock;
+ EFI_SMM_CAPABILITIES GetCapabilities;
+ BOOLEAN LockState;
+ BOOLEAN OpenState;
+};
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2009, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
diff --git a/Include/Protocol/SmmAccess2.h b/Include/Protocol/SmmAccess2.h
new file mode 100644
index 0000000..daa5d75
--- /dev/null
+++ b/Include/Protocol/SmmAccess2.h
@@ -0,0 +1,136 @@
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/SOURCE/Modules/SMM/SmmAccess2.h 2 3/04/11 3:35p Markw $
+//
+// $Revision: 2 $
+//
+// $Date: 3/04/11 3:35p $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/SOURCE/Modules/SMM/SmmAccess2.h $
+//
+// 2 3/04/11 3:35p Markw
+// Update headers.
+//
+// 1 2/07/11 4:03p Markw
+// [TAG] EIP53481
+// [Category] New Feature
+// [Description] Add PIWG 1.1 SMM support
+// [Files] mm.sdl, SmmPrivateShared.h, SmmDispatcher.mak,
+// SmmDispatcher.h, SmmDispatcher.c,
+// Smst.c, SmmPiSmst.c, SmmInit.c, SmmBase.c, SmmBase2.c,
+// SmmDriverDispatcher.c, Smm Framewwork Protocol files, SmmPi.h,
+// Smm Pi Protocol files, SmmPciRbio files
+//
+//
+//**********************************************************************
+
+//<AMI_FHDR_START>
+//----------------------------------------------------------------------------
+//
+// Name: SmmAccess2.h
+//
+// Description:
+// This provides north bridge functions to open, close, lock, and describe SMM space.
+//
+//----------------------------------------------------------------------------
+//<AMI_FHDR_END>
+
+#ifndef __SMM_ACCESS2_PROTOCOL_H__
+#define __SMM_ACCESS2_PROTOCOL_H__
+#if PI_SPECIFICATION_VERSION >= 0x0001000A
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+#include <EFI.h>
+
+#define EFI_SMM_ACCESS2_PROTOCOL_GUID \
+ {0xc2702b74,0x800c,0x4131,0x87,0x46,0x8f,0xb5,0xb8,0x9c,0xe4,0xac}
+
+GUID_VARIABLE_DECLARATION(gEfiSmmAccess2ProtocolGuid,EFI_SMM_ACCESS2_PROTOCOL_GUID);
+
+//Forward Declaration
+typedef struct _EFI_SMM_ACCESS2_PROTOCOL EFI_SMM_ACCESS2_PROTOCOL;
+
+#ifndef SMM_ACCESS_DEF
+#define SMM_ACCESS_DEF
+
+#define EFI_SMRAM_OPEN 0x00000001
+#define EFI_SMRAM_CLOSED 0x00000002
+#define EFI_SMRAM_LOCKED 0x00000004
+#define EFI_CACHEABLE 0x00000008
+#define EFI_ALLOCATED 0x00000010
+#define EFI_NEEDS_TESTING 0x00000020
+#define EFI_NEEDS_ECC_INITIALIZATION 0x00000040
+
+typedef struct _EFI_SMRAM_DESCRIPTOR {
+ EFI_PHYSICAL_ADDRESS PhysicalStart;
+ EFI_PHYSICAL_ADDRESS CpuStart;
+ UINT64 PhysicalSize;
+ UINT64 RegionState;
+} EFI_SMRAM_DESCRIPTOR;
+
+#endif
+
+typedef EFI_STATUS (EFIAPI *EFI_SMM_OPEN2)(
+ IN EFI_SMM_ACCESS2_PROTOCOL *This
+);
+
+typedef EFI_STATUS (EFIAPI *EFI_SMM_CLOSE2)(
+ IN EFI_SMM_ACCESS2_PROTOCOL *This
+);
+
+typedef EFI_STATUS (EFIAPI *EFI_SMM_LOCK2)(
+ IN EFI_SMM_ACCESS2_PROTOCOL *This
+);
+
+typedef EFI_STATUS (EFIAPI *EFI_SMM_CAPABILITIES2)(
+ IN CONST EFI_SMM_ACCESS2_PROTOCOL *This,
+ IN OUT UINTN *SmramMapSize,
+ IN OUT EFI_SMRAM_DESCRIPTOR *SmramMap
+);
+
+struct _EFI_SMM_ACCESS2_PROTOCOL {
+ EFI_SMM_OPEN2 Open;
+ EFI_SMM_CLOSE2 Close;
+ EFI_SMM_LOCK2 Lock;
+ EFI_SMM_CAPABILITIES2 GetCapabilities; //Current state of the SMRAM. TRUE if locked.
+ BOOLEAN LockState; //Current state of the SMRAM. TRUE if open.
+ BOOLEAN OpenState;
+};
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+#endif
+
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
diff --git a/Include/Protocol/SmmBase.h b/Include/Protocol/SmmBase.h
new file mode 100644
index 0000000..f15b829
--- /dev/null
+++ b/Include/Protocol/SmmBase.h
@@ -0,0 +1,183 @@
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2009, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/SOURCE/Modules/SMM/SmmBase.h 4 4/15/11 4:41p Markw $
+//
+// $Revision: 4 $
+//
+// $Date: 4/15/11 4:41p $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/SOURCE/Modules/SMM/SmmBase.h $
+//
+// 4 4/15/11 4:41p Markw
+// [TAG] EIP57440
+// [Category] New Feature
+// [Description] Update from previous check-in. Add inclusion Guards.
+// [Files] SmmBase.h
+//
+// 3 7/08/09 8:00p Markw
+// Update headers.
+//
+// 2 3/28/07 2:48p Markw
+//
+//**********************************************************************
+
+//<AMI_FHDR_START>
+//----------------------------------------------------------------------------
+//
+// Name: SmmBase.h
+//
+// Description: Smm Base Protocol header file.
+//
+//----------------------------------------------------------------------------
+//<AMI_FHDR_END>
+
+#ifndef __SMM_BASE_PROTOCOL_H__
+#define __SMM_BASE_PROTOCOL_H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+#include <EFI.h>
+#include <SMM.h>
+
+#define EFI_SMM_BASE_PROTOCOL_GUID \
+ {0x1390954D,0xda95,0x4227,0x93,0x28,0x72,0x82,0xc2,0x17,0xda,0xa8}
+
+GUID_VARIABLE_DECLARATION(gEfiSmmBaseProtocolGuid,EFI_SMM_BASE_PROTOCOL_GUID);
+
+//*******************************************************
+//EFI SMM Handler Return Code
+//*******************************************************
+#define EFI_HANDLER_SUCCESS 0x0000
+#define EFI_HANDLER_CRITICAL_EXIT 0x0001
+#define EFI_HANDLER_SOURCE_QUIESCED 0x0002
+#define EFI_HANDLER_SOURCE_PENDING 0x0003
+
+#define SMM_COMMUNICATE_HEADER_GUID \
+ {0xF328E36C,0x23B6,0x4a95,0x85,0x4B,0x32,0xE1,0x95,0x34,0xCD,0x75}
+
+
+//******************************************************
+// EFI_SMM_COMMUNICATE_HEADER
+//******************************************************
+
+#ifndef EFI_SMM_COMM_HDR_DEF
+#define EFI_SMM_COMM_HDR_DEF
+
+
+typedef struct {
+ EFI_GUID HeaderGuid;
+ UINTN MessageLength;
+ UINT8 Data[1];
+} EFI_SMM_COMMUNICATE_HEADER;
+
+#endif
+
+//***********************************************
+// EFI_SMM_CALLBACK_ENTRY_POINT
+//***********************************************
+typedef EFI_STATUS (EFIAPI *EFI_SMM_CALLBACK_ENTRY_POINT) (
+ IN EFI_HANDLE SmmImageHandle,
+ IN OUT VOID *CommunicationBuffer OPTIONAL,
+ IN OUT UINTN *SourceSize OPTIONAL
+);
+
+
+typedef struct _EFI_SMM_BASE_PROTOCOL EFI_SMM_BASE_PROTOCOL;
+
+typedef EFI_STATUS (EFIAPI *EFI_SMM_REGISTER_HANDLER) (
+ IN EFI_SMM_BASE_PROTOCOL *This,
+ IN EFI_DEVICE_PATH_PROTOCOL *FilePath,
+ IN VOID *SourceBuffer OPTIONAL,
+ IN UINTN SourceSize,
+ OUT EFI_HANDLE *ImageHandle,
+ IN BOOLEAN LegacyIA32Binary OPTIONAL
+);
+
+typedef EFI_STATUS (EFIAPI *EFI_SMM_UNREGISTER_HANDLER) (
+ IN EFI_SMM_BASE_PROTOCOL *This,
+ IN EFI_HANDLE ImageHandle
+);
+
+typedef EFI_STATUS (EFIAPI *EFI_SMM_COMMUNICATE) (
+ IN EFI_SMM_BASE_PROTOCOL *This,
+ IN EFI_HANDLE ImageHandle,
+ IN OUT VOID *CommunicationBuffer,
+ IN OUT UINTN *SourceSize
+);
+
+typedef EFI_STATUS (EFIAPI *EFI_SMM_CALLBACK_SERVICE) (
+ IN EFI_SMM_BASE_PROTOCOL *This,
+ IN EFI_HANDLE SmmImageHandle,
+ IN EFI_SMM_CALLBACK_ENTRY_POINT CallbackAddress,
+ IN BOOLEAN MakeLast OPTIONAL,
+ IN BOOLEAN FloatingPointSave OPTIONAL
+);
+
+typedef EFI_STATUS (EFIAPI *EFI_SMM_INSIDE_OUT) (
+ IN EFI_SMM_BASE_PROTOCOL *This,
+ OUT BOOLEAN *InSmm
+);
+
+typedef EFI_STATUS (EFIAPI *EFI_SMM_ALLOCATE_POOL) (
+ IN EFI_SMM_BASE_PROTOCOL *This,
+ IN EFI_MEMORY_TYPE PoolType,
+ IN UINTN Size,
+ OUT VOID **Buffer
+);
+
+typedef EFI_STATUS (EFIAPI *EFI_SMM_FREE_POOL) (
+ IN EFI_SMM_BASE_PROTOCOL *This,
+ IN VOID *Buffer
+);
+
+typedef EFI_STATUS (EFIAPI *EFI_SMM_GET_SMST_LOCATION) (
+ IN EFI_SMM_BASE_PROTOCOL *This,
+ IN OUT EFI_SMM_SYSTEM_TABLE **Smst
+);
+
+
+struct _EFI_SMM_BASE_PROTOCOL {
+ EFI_SMM_REGISTER_HANDLER Register;
+ EFI_SMM_UNREGISTER_HANDLER UnRegister;
+ EFI_SMM_COMMUNICATE Communicate;
+ EFI_SMM_CALLBACK_SERVICE RegisterCallback;
+ EFI_SMM_INSIDE_OUT InSmm;
+ EFI_SMM_ALLOCATE_POOL SmmAllocatePool;
+ EFI_SMM_FREE_POOL SmmFreePool;
+ EFI_SMM_GET_SMST_LOCATION GetSmstLocation;
+};
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2009, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
diff --git a/Include/Protocol/SmmBase2.h b/Include/Protocol/SmmBase2.h
new file mode 100644
index 0000000..4eb23e9
--- /dev/null
+++ b/Include/Protocol/SmmBase2.h
@@ -0,0 +1,102 @@
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/SOURCE/Modules/SMM/SmmBase2.h 2 3/04/11 3:35p Markw $
+//
+// $Revision: 2 $
+//
+// $Date: 3/04/11 3:35p $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/SOURCE/Modules/SMM/SmmBase2.h $
+//
+// 2 3/04/11 3:35p Markw
+// Update headers.
+//
+// 1 2/07/11 4:03p Markw
+// [TAG] EIP53481
+// [Category] New Feature
+// [Description] Add PIWG 1.1 SMM support
+// [Files] mm.sdl, SmmPrivateShared.h, SmmDispatcher.mak,
+// SmmDispatcher.h, SmmDispatcher.c,
+// Smst.c, SmmPiSmst.c, SmmInit.c, SmmBase.c, SmmBase2.c,
+// SmmDriverDispatcher.c, Smm Framewwork Protocol files, SmmPi.h,
+// Smm Pi Protocol files, SmmPciRbio files
+//
+//**********************************************************************
+
+//<AMI_FHDR_START>
+//----------------------------------------------------------------------------
+//
+// Name: SmmBase2.h
+//
+// Description: PI Smm Base Protocol header file.
+//
+//----------------------------------------------------------------------------
+//<AMI_FHDR_END>
+
+#ifndef __SMM_BASE2_PROTOCOL_H__
+#define __SMM_BASE2_PROTOCOL_H__
+#if PI_SPECIFICATION_VERSION >= 0x0001000A
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+#include <EFI.h>
+#include <SmmPi.h>
+
+#define EFI_SMM_BASE2_PROTOCOL_GUID \
+ {0xf4ccbfb7,0xf6e0,0x47fd,0x9d,0xd4,0x10,0xa8,0xf1,0x50,0xc1,0x91}
+
+GUID_VARIABLE_DECLARATION(gEfiSmmBase2ProtocolGuid,EFI_SMM_BASE2_PROTOCOL_GUID);
+
+typedef struct _EFI_SMM_BASE2_PROTOCOL EFI_SMM_BASE2_PROTOCOL;
+
+typedef EFI_STATUS (EFIAPI *EFI_SMM_INSIDE_OUT2)(
+ IN CONST EFI_SMM_BASE2_PROTOCOL *This,
+ OUT BOOLEAN *InSmram
+);
+
+typedef EFI_STATUS (EFIAPI *EFI_SMM_GET_SMST_LOCATION2)(
+ IN CONST EFI_SMM_BASE2_PROTOCOL *This,
+ IN OUT EFI_SMM_SYSTEM_TABLE2 **Smst
+);
+
+struct _EFI_SMM_BASE2_PROTOCOL {
+ EFI_SMM_INSIDE_OUT2 InSmm;
+ EFI_SMM_GET_SMST_LOCATION2 GetSmstLocation;
+};
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+#endif
+
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
diff --git a/Include/Protocol/SmmBiosWriteDispatch.h b/Include/Protocol/SmmBiosWriteDispatch.h
new file mode 100644
index 0000000..6ac88e7
--- /dev/null
+++ b/Include/Protocol/SmmBiosWriteDispatch.h
@@ -0,0 +1,101 @@
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
+
+//*************************************************************************
+// $Header: /Alaska/BIN/Chipset/Intel/SouthBridge/LynxPoint/Intel Pch SB Chipset/SB Protocols/SmmBiosWriteDispatch.h 1 2/08/12 8:26a Yurenlai $
+//
+// $Revision: 1 $
+//
+// $Date: 2/08/12 8:26a $
+//*************************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Chipset/Intel/SouthBridge/LynxPoint/Intel Pch SB Chipset/SB Protocols/SmmBiosWriteDispatch.h $
+//
+// 1 2/08/12 8:26a Yurenlai
+// Intel Lynx Point/SB eChipset initially releases.
+//
+//*************************************************************************
+//<AMI_FHDR_START>
+//
+// Name: SmmBiosWriteDispatch.h
+//
+// Description: SMM BIOS Write Dispatch Protocol header.
+//
+//<AMI_FHDR_END>
+//*************************************************************************
+
+#ifndef __SMM_BIOS_WRITE_DISPATCH_PROTOCOL_H__
+#define __SMM_BIOS_WRITE_DISPATCH_PROTOCOL_H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+#include <EFI.h>
+
+// {E512DFE4-BF44-480d-9B7A-777B0BE32775}
+#define EFI_SMM_BIOS_WRITE_DISPATCH_PROTOCOL_GUID \
+ {0xe512dfe4, 0xbf44, 0x480d, 0x9b, 0x7a, 0x77, 0x7b, 0xb, 0xe3, 0x27, 0x75}
+
+GUID_VARIABLE_DECLARATION( gEfiSmmBiosWriteDispatchProtocolGuid, \
+ EFI_SMM_BIOS_WRITE_DISPATCH_PROTOCOL_GUID);
+
+typedef struct _EFI_SMM_BIOS_WRITE_DISPATCH_PROTOCOL \
+ EFI_SMM_BIOS_WRITE_DISPATCH_PROTOCOL;
+
+//******************************************************
+// EFI_SMM_BIOS_WRITE_DISPATCH
+//******************************************************
+typedef VOID (EFIAPI *EFI_SMM_BIOS_WRITE_DISPATCH) (
+ IN EFI_HANDLE DispatchHandle,
+ IN VOID *DispatchContext
+);
+
+
+typedef EFI_STATUS (EFIAPI *EFI_SMM_BIOS_WRITE_REGISTER) (
+ IN EFI_SMM_BIOS_WRITE_DISPATCH_PROTOCOL *This,
+ IN EFI_SMM_BIOS_WRITE_DISPATCH DispatchFunction,
+ OUT EFI_HANDLE *DispatchHandle
+);
+
+typedef EFI_STATUS (EFIAPI *EFI_SMM_BIOS_WRITE_UNREGISTER) (
+ IN EFI_SMM_BIOS_WRITE_DISPATCH_PROTOCOL *This,
+ IN EFI_HANDLE DispatchHandle
+);
+
+
+struct _EFI_SMM_BIOS_WRITE_DISPATCH_PROTOCOL {
+ EFI_SMM_BIOS_WRITE_REGISTER Register;
+ EFI_SMM_BIOS_WRITE_UNREGISTER UnRegister;
+};
+
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
diff --git a/Include/Protocol/SmmCommunication.h b/Include/Protocol/SmmCommunication.h
new file mode 100644
index 0000000..e4517bd
--- /dev/null
+++ b/Include/Protocol/SmmCommunication.h
@@ -0,0 +1,111 @@
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/SOURCE/Modules/SMM/SmmCommunication.h 3 4/15/11 4:44p Markw $
+//
+// $Revision: 3 $
+//
+// $Date: 4/15/11 4:44p $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/SOURCE/Modules/SMM/SmmCommunication.h $
+//
+// 3 4/15/11 4:44p Markw
+// Add Inclusion Guards.
+//
+// 2 3/04/11 3:35p Markw
+// Update headers.
+//
+// 1 2/07/11 4:03p Markw
+// [TAG] EIP53481
+// [Category] New Feature
+// [Description] Add PIWG 1.1 SMM support
+// [Files] mm.sdl, SmmPrivateShared.h, SmmDispatcher.mak,
+// SmmDispatcher.h, SmmDispatcher.c,
+// Smst.c, SmmPiSmst.c, SmmInit.c, SmmBase.c, SmmBase2.c,
+// SmmDriverDispatcher.c, Smm Framewwork Protocol files, SmmPi.h,
+// Smm Pi Protocol files, SmmPciRbio files
+//
+//**********************************************************************
+
+//<AMI_FHDR_START>
+//----------------------------------------------------------------------------
+//
+// Name: SmmCommunicate.h
+//
+// Description: PI Smm Base Protocol header file.
+//
+//----------------------------------------------------------------------------
+//<AMI_FHDR_END>
+
+#ifndef __SMM_COMMUNICATE_PROTOCOL_H__
+#define __SMM_COMMUNICATE_PROTOCOL_H__
+#if PI_SPECIFICATION_VERSION >= 0x0001000A
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+#include <EFI.h>
+
+#define EFI_SMM_COMMUNICATION_PROTOCOL_GUID \
+ {0xc68ed8e2, 0x9dc6, 0x4cbd, 0x9d, 0x94, 0xdb, 0x65, 0xac, 0xc5, 0xc3, 0x32}
+
+GUID_VARIABLE_DECLARATION(gEfiSmmCommunicationProtocolGuid,EFI_SMM_COMMUNICATION_PROTOCOL_GUID);
+
+
+#ifndef EFI_SMM_COMM_HDR_DEF
+#define EFI_SMM_COMM_HDR_DEF
+
+typedef struct {
+ EFI_GUID HeaderGuid;
+ UINTN MessageLength;
+ UINT8 Data[1];
+} EFI_SMM_COMMUNICATE_HEADER;
+
+#endif
+
+typedef struct _EFI_SMM_COMMUNICATION_PROTOCOL EFI_SMM_COMMUNICATION_PROTOCOL;
+
+typedef EFI_STATUS (EFIAPI *EFI_SMM_COMMUNICATE2) (
+ IN CONST EFI_SMM_COMMUNICATION_PROTOCOL *This,
+ IN OUT VOID *CommBuffer,
+ IN OUT UINTN *CommSize
+);
+
+struct _EFI_SMM_COMMUNICATION_PROTOCOL {
+ EFI_SMM_COMMUNICATE2 Communicate;
+};
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+#endif
+
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
diff --git a/Include/Protocol/SmmControl.h b/Include/Protocol/SmmControl.h
new file mode 100644
index 0000000..154e6c9
--- /dev/null
+++ b/Include/Protocol/SmmControl.h
@@ -0,0 +1,147 @@
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2009, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/SOURCE/Modules/SMM/SmmControl.h 2 7/08/09 8:01p Markw $
+//
+// $Revision: 2 $
+//
+// $Date: 7/08/09 8:01p $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/SOURCE/Modules/SMM/SmmControl.h $
+//
+// 2 7/08/09 8:01p Markw
+// Update headers.
+//
+// 1 3/18/07 1:54p Markw
+//
+// 4 12/19/06 12:42p Felixp
+// AMI_SMM_SW_SMI_16_BITS switch removed. Header is reverted to the
+// previous version.
+//
+// 2 3/13/06 1:40a Felixp
+//
+// 1 1/28/05 12:44p Felixp
+//
+// 2 1/18/05 3:22p Felixp
+// PrintDebugMessage renamed to Trace
+//
+// 1 12/23/04 9:41a Felixp
+//
+// 2 2/09/04 2:43p Markw
+// Fixed header info.
+//
+// 1 1/30/04 10:26a Markw
+//
+// 1 1/26/04 3:25p Markw
+//
+//**********************************************************************
+//<AMI_FHDR_START>
+//
+// Name: SmmControl.h
+//
+// Description: Provides south bridge functions for triggering and clearing SMIs.
+//
+//<AMI_FHDR_END>
+//**********************************************************************
+#ifndef __SMM_CONTROL_PROTOCOL_H__
+#define __SMM_CONTROL_PROTOCOL_H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+#include <EFI.h>
+
+#define EFI_SMM_CONTROL_PROTOCOL_GUID \
+ {0x8d12e231,0xc667,0x4fd1,0x98,0xf2,0x24,0x49,0xa7,0xe7,0xb2,0xe5}
+
+GUID_VARIABLE_DECLARATION(gEfiSmmControlProtocolGuid,EFI_SMM_CONTROL_PROTOCOL_GUID);
+
+//************************************************
+// EFI_SMM_PERIOD
+//************************************************
+typedef UINTN EFI_SMM_PERIOD;
+
+//*********************************************
+// EFI_SMM_CONTROL_REGISTER
+//*********************************************
+typedef struct {
+ UINT8 SmiTriggerRegister;
+ UINT8 SmiDataRegister;
+} EFI_SMM_CONTROL_REGISTER;
+
+
+typedef struct _EFI_SMM_CONTROL_PROTOCOL EFI_SMM_CONTROL_PROTOCOL;
+
+typedef EFI_STATUS (EFIAPI *EFI_SMM_ACTIVATE) (
+ IN EFI_SMM_CONTROL_PROTOCOL *This,
+ IN OUT INT8 *ArgumentBuffer OPTIONAL,
+ IN OUT UINTN *ArgumentBufferSize OPTIONAL,
+ IN BOOLEAN Periodic OPTIONAL,
+ IN UINTN ActivationInterval OPTIONAL
+);
+
+typedef EFI_STATUS (EFIAPI *EFI_SMM_DEACTIVATE) (
+ IN EFI_SMM_CONTROL_PROTOCOL *This,
+ IN BOOLEAN Periodic OPTIONAL
+);
+
+typedef EFI_STATUS (EFIAPI *EFI_SMM_GET_REGISTER_INFO) (
+ IN EFI_SMM_CONTROL_PROTOCOL *This,
+ IN OUT EFI_SMM_CONTROL_REGISTER *SmiRegister
+);
+
+//**********************************************************************
+//<AMI_THDR_START>
+//
+// Name: EFI_SMM_CONTROL_PROTOCOL
+//
+// Description: Provides south bridge functions for triggering and clearing SMIs.
+//
+// Fields: Name Type Description
+// ------------------------------------------------------------
+// Trigger EFI_SMM_ACTIVATE Trigger SMI and provide it with a byte code.
+// Clear EFI_SMM_DEACTIVATE Clear all SMI sources.
+// GetRegisterInfo EFI_SMM_GET_REGISTER_INFO Get SMI Trigger information.
+// MinimumTriggerPeriod UINTN 0 in IA32. SMI period is not supported.
+//
+//<AMI_THDR_END>
+//**********************************************************************
+struct _EFI_SMM_CONTROL_PROTOCOL {
+ EFI_SMM_ACTIVATE Trigger;
+ EFI_SMM_DEACTIVATE Clear;
+ EFI_SMM_GET_REGISTER_INFO GetRegisterInfo;
+ UINTN MinimumTriggerPeriod;
+};
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2009, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
diff --git a/Include/Protocol/SmmControl2.h b/Include/Protocol/SmmControl2.h
new file mode 100644
index 0000000..c025756
--- /dev/null
+++ b/Include/Protocol/SmmControl2.h
@@ -0,0 +1,108 @@
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/SOURCE/Modules/SMM/SmmControl2.h 2 3/04/11 3:35p Markw $
+//
+// $Revision: 2 $
+//
+// $Date: 3/04/11 3:35p $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/SOURCE/Modules/SMM/SmmControl2.h $
+//
+// 2 3/04/11 3:35p Markw
+// Update headers.
+//
+// 1 2/07/11 4:03p Markw
+// [TAG] EIP53481
+// [Category] New Feature
+// [Description] Add PIWG 1.1 SMM support
+// [Files] mm.sdl, SmmPrivateShared.h, SmmDispatcher.mak,
+// SmmDispatcher.h, SmmDispatcher.c,
+// Smst.c, SmmPiSmst.c, SmmInit.c, SmmBase.c, SmmBase2.c,
+// SmmDriverDispatcher.c, Smm Framewwork Protocol files, SmmPi.h,
+// Smm Pi Protocol files, SmmPciRbio files
+//
+//**********************************************************************
+//<AMI_FHDR_START>
+//
+// Name: SmmControl2.h
+//
+// Description: Provides south bridge functions for triggering and clearing SMIs.
+//
+//<AMI_FHDR_END>
+//**********************************************************************
+
+#ifndef __SMM_CONTROL2_PROTOCOL_H__
+#define __SMM_CONTROL2_PROTOCOL_H__
+#if PI_SPECIFICATION_VERSION >= 0x0001000A
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+#include <EFI.h>
+
+//************************************************
+// EFI_SMM_PERIOD
+//************************************************
+typedef UINTN EFI_SMM_PERIOD;
+
+#define EFI_SMM_CONTROL2_PROTOCOL_GUID \
+ {0x843dc720,0xab1e,0x42cb,0x93,0x57,0x8a,0x0,0x78,0xf3,0x56,0x1b}
+
+GUID_VARIABLE_DECLARATION(gEfiSmmControl2ProtocolGuid,EFI_SMM_CONTROL2_PROTOCOL_GUID);
+
+typedef struct _EFI_SMM_CONTROL2_PROTOCOL EFI_SMM_CONTROL2_PROTOCOL;
+
+typedef EFI_STATUS (EFIAPI *EFI_SMM_ACTIVATE2)(
+ IN CONST EFI_SMM_CONTROL2_PROTOCOL *This,
+ IN OUT UINT8 *CommandPort OPTIONAL,
+ IN OUT UINT8 *DataPort OPTIONAL,
+ IN BOOLEAN Periodic OPTIONAL,
+ IN UINTN ActivationInterval OPTIONAL
+);
+
+typedef EFI_STATUS (EFIAPI *EFI_SMM_DEACTIVATE2)(
+ IN CONST EFI_SMM_CONTROL2_PROTOCOL *This,
+ IN BOOLEAN Periodic OPTIONAL
+);
+
+struct _EFI_SMM_CONTROL2_PROTOCOL {
+ EFI_SMM_ACTIVATE2 Trigger;
+ EFI_SMM_DEACTIVATE2 Clear;
+ EFI_SMM_PERIOD MinimumTriggerPeriod; /// Minimum interval at which the platform can set the period.
+};
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+#endif
+
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
diff --git a/Include/Protocol/SmmCpu.h b/Include/Protocol/SmmCpu.h
new file mode 100644
index 0000000..c662dbb
--- /dev/null
+++ b/Include/Protocol/SmmCpu.h
@@ -0,0 +1,211 @@
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/SOURCE/Modules/SMM/SmmCpu.h 2 3/04/11 3:35p Markw $
+//
+// $Revision: 2 $
+//
+// $Date: 3/04/11 3:35p $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/SOURCE/Modules/SMM/SmmCpu.h $
+//
+// 2 3/04/11 3:35p Markw
+// Update headers.
+//
+// 1 2/07/11 4:03p Markw
+// [TAG] EIP53481
+// [Category] New Feature
+// [Description] Add PIWG 1.1 SMM support
+// [Files] mm.sdl, SmmPrivateShared.h, SmmDispatcher.mak,
+// SmmDispatcher.h, SmmDispatcher.c,
+// Smst.c, SmmPiSmst.c, SmmInit.c, SmmBase.c, SmmBase2.c,
+// SmmDriverDispatcher.c, Smm Framewwork Protocol files, SmmPi.h,
+// Smm Pi Protocol files, SmmPciRbio files
+//
+//**********************************************************************
+
+//<AMI_FHDR_START>
+//----------------------------------------------------------------------------
+//
+// Name: SmmCpu.h
+//
+// Description: Smm CPU Protocol
+//
+//----------------------------------------------------------------------------
+//<AMI_FHDR_END>
+
+#ifndef __SMM_CPU_PROTOCOL_H__
+#define __SMM_CPU_PROTOCOL_H__
+#if PI_SPECIFICATION_VERSION >= 0x0001000A
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+#include <EFI.h>
+
+#define EFI_SMM_CPU_PROTOCOL_GUID \
+ {0xeb346b97, 0x975f, 0x4a9f, 0x8b, 0x22, 0xf8, 0xe9, 0x2b, 0xb3, 0xd5, 0x69}
+
+GUID_VARIABLE_DECLARATION(gEfiCpuProtocolGuid, EFI_SMM_CPU_PROTOCOL_GUID);
+
+//Forward Declaration
+typedef struct _EFI_SMM_CPU_PROTOCOL EFI_SMM_CPU_PROTOCOL;
+
+#define EFI_SMM_SAVE_STATE_REGISTER_LMA_32BIT 32
+#define EFI_SMM_SAVE_STATE_REGISTER_LMA_64BIT 64
+
+typedef enum {
+ EFI_SMM_SAVE_STATE_REGISTER_GDTBASE = 4,
+ EFI_SMM_SAVE_STATE_REGISTER_IDTBASE = 5,
+ EFI_SMM_SAVE_STATE_REGISTER_LDTBASE = 6,
+ EFI_SMM_SAVE_STATE_REGISTER_GDTLIMIT = 7,
+ EFI_SMM_SAVE_STATE_REGISTER_IDTLIMIT = 8,
+ EFI_SMM_SAVE_STATE_REGISTER_LDTLIMIT = 9,
+ EFI_SMM_SAVE_STATE_REGISTER_LDTINFO = 10,
+ EFI_SMM_SAVE_STATE_REGISTER_ES = 20,
+ EFI_SMM_SAVE_STATE_REGISTER_CS = 21,
+ EFI_SMM_SAVE_STATE_REGISTER_SS = 22,
+ EFI_SMM_SAVE_STATE_REGISTER_DS = 23,
+ EFI_SMM_SAVE_STATE_REGISTER_FS = 24,
+ EFI_SMM_SAVE_STATE_REGISTER_GS = 25,
+ EFI_SMM_SAVE_STATE_REGISTER_LDTR_SEL = 26,
+ EFI_SMM_SAVE_STATE_REGISTER_TR_SEL = 27,
+ EFI_SMM_SAVE_STATE_REGISTER_DR7 = 28,
+ EFI_SMM_SAVE_STATE_REGISTER_DR6 = 29,
+ EFI_SMM_SAVE_STATE_REGISTER_R8 = 30,
+ EFI_SMM_SAVE_STATE_REGISTER_R9 = 31,
+ EFI_SMM_SAVE_STATE_REGISTER_R10 = 32,
+ EFI_SMM_SAVE_STATE_REGISTER_R11 = 33,
+ EFI_SMM_SAVE_STATE_REGISTER_R12 = 34,
+ EFI_SMM_SAVE_STATE_REGISTER_R13 = 35,
+ EFI_SMM_SAVE_STATE_REGISTER_R14 = 36,
+ EFI_SMM_SAVE_STATE_REGISTER_R15 = 37,
+ EFI_SMM_SAVE_STATE_REGISTER_RAX = 38,
+ EFI_SMM_SAVE_STATE_REGISTER_RBX = 39,
+ EFI_SMM_SAVE_STATE_REGISTER_RCX = 40,
+ EFI_SMM_SAVE_STATE_REGISTER_RDX = 41,
+ EFI_SMM_SAVE_STATE_REGISTER_RSP = 42,
+ EFI_SMM_SAVE_STATE_REGISTER_RBP = 43,
+ EFI_SMM_SAVE_STATE_REGISTER_RSI = 44,
+ EFI_SMM_SAVE_STATE_REGISTER_RDI = 45,
+ EFI_SMM_SAVE_STATE_REGISTER_RIP = 46,
+ EFI_SMM_SAVE_STATE_REGISTER_RFLAGS = 51,
+ EFI_SMM_SAVE_STATE_REGISTER_CR0 = 52,
+ EFI_SMM_SAVE_STATE_REGISTER_CR3 = 53,
+ EFI_SMM_SAVE_STATE_REGISTER_CR4 = 54,
+ EFI_SMM_SAVE_STATE_REGISTER_FCW = 256,
+ EFI_SMM_SAVE_STATE_REGISTER_FSW = 257,
+ EFI_SMM_SAVE_STATE_REGISTER_FTW = 258,
+ EFI_SMM_SAVE_STATE_REGISTER_OPCODE = 259,
+ EFI_SMM_SAVE_STATE_REGISTER_FP_EIP = 260,
+ EFI_SMM_SAVE_STATE_REGISTER_FP_CS = 261,
+ EFI_SMM_SAVE_STATE_REGISTER_DATAOFFSET = 262,
+ EFI_SMM_SAVE_STATE_REGISTER_FP_DS = 263,
+ EFI_SMM_SAVE_STATE_REGISTER_MM0 = 264,
+ EFI_SMM_SAVE_STATE_REGISTER_MM1 = 265,
+ EFI_SMM_SAVE_STATE_REGISTER_MM2 = 266,
+ EFI_SMM_SAVE_STATE_REGISTER_MM3 = 267,
+ EFI_SMM_SAVE_STATE_REGISTER_MM4 = 268,
+ EFI_SMM_SAVE_STATE_REGISTER_MM5 = 269,
+ EFI_SMM_SAVE_STATE_REGISTER_MM6 = 270,
+ EFI_SMM_SAVE_STATE_REGISTER_MM7 = 271,
+ EFI_SMM_SAVE_STATE_REGISTER_XMM0 = 272,
+ EFI_SMM_SAVE_STATE_REGISTER_XMM1 = 273,
+ EFI_SMM_SAVE_STATE_REGISTER_XMM2 = 274,
+ EFI_SMM_SAVE_STATE_REGISTER_XMM3 = 275,
+ EFI_SMM_SAVE_STATE_REGISTER_XMM4 = 276,
+ EFI_SMM_SAVE_STATE_REGISTER_XMM5 = 277,
+ EFI_SMM_SAVE_STATE_REGISTER_XMM6 = 278,
+ EFI_SMM_SAVE_STATE_REGISTER_XMM7 = 279,
+ EFI_SMM_SAVE_STATE_REGISTER_XMM8 = 280,
+ EFI_SMM_SAVE_STATE_REGISTER_XMM9 = 281,
+ EFI_SMM_SAVE_STATE_REGISTER_XMM10 = 282,
+ EFI_SMM_SAVE_STATE_REGISTER_XMM11 = 283,
+ EFI_SMM_SAVE_STATE_REGISTER_XMM12 = 284,
+ EFI_SMM_SAVE_STATE_REGISTER_XMM13 = 285,
+ EFI_SMM_SAVE_STATE_REGISTER_XMM14 = 286,
+ EFI_SMM_SAVE_STATE_REGISTER_XMM15 = 287,
+ //
+ // Pseudo-Registers
+ //
+ EFI_SMM_SAVE_STATE_REGISTER_IO = 512,
+ EFI_SMM_SAVE_STATE_REGISTER_LMA = 513
+} EFI_SMM_SAVE_STATE_REGISTER;
+
+typedef enum {
+ EFI_SMM_SAVE_STATE_IO_WIDTH_UINT8 = 0,
+ EFI_SMM_SAVE_STATE_IO_WIDTH_UINT16 = 1,
+ EFI_SMM_SAVE_STATE_IO_WIDTH_UINT32 = 2,
+ EFI_SMM_SAVE_STATE_IO_WIDTH_UINT64 = 3
+} EFI_SMM_SAVE_STATE_IO_WIDTH;
+
+typedef enum {
+ EFI_SMM_SAVE_STATE_IO_TYPE_INPUT = 1,
+ EFI_SMM_SAVE_STATE_IO_TYPE_OUTPUT = 2,
+ EFI_SMM_SAVE_STATE_IO_TYPE_STRING = 4,
+ EFI_SMM_SAVE_STATE_IO_TYPE_REP_PREFIX = 8
+} EFI_SMM_SAVE_STATE_IO_TYPE;
+
+
+typedef struct _EFI_SMM_SAVE_STATE_IO_INFO {
+ UINT64 IoData;
+ UINT16 IoPort;
+ EFI_SMM_SAVE_STATE_IO_WIDTH IoWidth;
+ EFI_SMM_SAVE_STATE_IO_TYPE IoType;
+} EFI_SMM_SAVE_STATE_IO_INFO;
+
+typedef EFI_STATUS (EFIAPI *EFI_SMM_READ_SAVE_STATE) (
+ IN CONST EFI_SMM_CPU_PROTOCOL *This,
+ IN UINTN Width,
+ IN EFI_SMM_SAVE_STATE_REGISTER Register,
+ IN UINTN CpuIndex,
+ OUT VOID *Buffer
+);
+
+typedef EFI_STATUS (EFIAPI *EFI_SMM_WRITE_SAVE_STATE) (
+ IN CONST EFI_SMM_CPU_PROTOCOL *This,
+ IN UINTN Width,
+ IN EFI_SMM_SAVE_STATE_REGISTER Register,
+ IN UINTN CpuIndex,
+ IN CONST VOID *Buffer
+);
+
+typedef struct _EFI_SMM_CPU_PROTOCOL {
+ EFI_SMM_READ_SAVE_STATE ReadSaveState;
+ EFI_SMM_WRITE_SAVE_STATE WriteSaveState;
+} EFI_SMM_CPU_PROTOCOL;
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+#endif
+
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
diff --git a/Include/Protocol/SmmCpuIo2.h b/Include/Protocol/SmmCpuIo2.h
new file mode 100644
index 0000000..b51c330
--- /dev/null
+++ b/Include/Protocol/SmmCpuIo2.h
@@ -0,0 +1,114 @@
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/SOURCE/Modules/SMM/SmmCpuIo2.h 2 3/04/11 3:36p Markw $
+//
+// $Revision: 2 $
+//
+// $Date: 3/04/11 3:36p $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/SOURCE/Modules/SMM/SmmCpuIo2.h $
+//
+// 2 3/04/11 3:36p Markw
+// Update headers.
+//
+// 1 2/07/11 4:04p Markw
+// [TAG] EIP53481
+// [Category] New Feature
+// [Description] Add PIWG 1.1 SMM support
+// [Files] mm.sdl, SmmPrivateShared.h, SmmDispatcher.mak,
+// SmmDispatcher.h, SmmDispatcher.c,
+// Smst.c, SmmPiSmst.c, SmmInit.c, SmmBase.c, SmmBase2.c,
+// SmmDriverDispatcher.c, Smm Framewwork Protocol files, SmmPi.h,
+// Smm Pi Protocol files, SmmPciRbio files
+//
+//**********************************************************************
+
+//<AMI_FHDR_START>
+//----------------------------------------------------------------------------
+//
+// Name: SmmCpuIo2.h
+//
+// Description: Smm CPU IO Protocol
+//
+//----------------------------------------------------------------------------
+//<AMI_FHDR_END>
+
+#ifndef _SMM_CPU_IO2_H_
+#define _SMM_CPU_IO2_H_
+#if PI_SPECIFICATION_VERSION >= 0x0001000A
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+#include <EFI.h>
+
+#define EFI_SMM_CPU_IO2_PROTOCOL_GUID \
+ { 0x3242A9D8, 0xCE70, 0x4AA0, 0x95, 0x5D, 0x5E, 0x7B, 0x14, 0x0D, 0xE4, 0xD2 }
+
+GUID_VARIABLE_DECLARATION(gEfiSmmCpuIo2ProtocolGuid, EFI_SMM_CPU_IO2_PROTOCOL_GUID);
+
+typedef struct _EFI_SMM_CPU_IO2_PROTOCOL EFI_SMM_CPU_IO2_PROTOCOL;
+
+#ifndef EFI_SMM_IO_WIDTH_DEF
+#define EFI_SMM_IO_WIDTH_DEF
+typedef enum {
+ SMM_IO_UINT8 = 0,
+ SMM_IO_UINT16 = 1,
+ SMM_IO_UINT32 = 2,
+ SMM_IO_UINT64 = 3
+} EFI_SMM_IO_WIDTH;
+#endif
+
+typedef EFI_STATUS (EFIAPI *EFI_SMM_CPU_IO2)(
+ IN CONST EFI_SMM_CPU_IO2_PROTOCOL *This,
+ IN EFI_SMM_IO_WIDTH Width,
+ IN UINT64 Address,
+ IN UINTN Count,
+ IN OUT VOID *Buffer
+ );
+
+typedef struct {
+ EFI_SMM_CPU_IO2 Read;
+ EFI_SMM_CPU_IO2 Write;
+} EFI_SMM_IO_ACCESS2;
+
+struct _EFI_SMM_CPU_IO2_PROTOCOL {
+ EFI_SMM_IO_ACCESS2 Mem;
+ EFI_SMM_IO_ACCESS2 Io;
+};
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+#endif
+
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
diff --git a/Include/Protocol/SmmCpuState.h b/Include/Protocol/SmmCpuState.h
new file mode 100644
index 0000000..1d6ab88
--- /dev/null
+++ b/Include/Protocol/SmmCpuState.h
@@ -0,0 +1,181 @@
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2009, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/SOURCE/Modules/SMM/SmmCpuState.h 2 7/08/09 8:01p Markw $
+//
+// $Revision: 2 $
+//
+// $Date: 7/08/09 8:01p $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/SOURCE/Modules/SMM/SmmCpuState.h $
+//
+// 2 7/08/09 8:01p Markw
+// Update headers.
+//
+// 1 2/07/07 11:00a Markw
+//
+// 1 2/07/07 10:59a Markw
+//
+//**********************************************************************
+//<AMI_FHDR_START>
+//
+// Name: SmmCpuSaveState.h
+//
+// Description: This provides the SMM Cpu Save State protocol.
+//
+//<AMI_FHDR_END>
+//**********************************************************************
+#ifndef __SMM_CPU_SAVE_STATE_PROTOCOL_H__
+#define __SMM_CPU_SAVE_STATE_PROTOCOL_H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+#include <EFI.h>
+
+#define EFI_SMM_CPU_SAVE_STATE_PROTOCOL_GUID \
+ {0x21f302ad,0x6e94,0x471b,0x84,0xbc,0xb1,0x48,0x0,0x40,0x3a,0x1d}
+
+GUID_VARIABLE_DECLARATION(gEfiSmmCpuSaveStateProtocolGuid,EFI_SMM_CPU_SAVE_STATE_PROTOCOL_GUID);
+
+typedef struct _EFI_SMM_CPU_SAVE_STATE_PROTOCOL EFI_SMM_CPU_SAVE_STATE_PROTOCOL;
+
+typedef struct _EFI_SMM_CPU_STATE32 {
+ UINT8 Reserved1[0xf8]; // fe00h
+ UINT32 SMBASE; // fef8h
+ UINT32 SMMRevId; // fefch
+ UINT16 IORestart; // ff00h
+ UINT16 AutoHALTRestart; // ff02h
+ UINT32 IEDBASE; // ff04h
+ UINT8 Reserved2[0x98]; // ff08h
+ UINT32 IOMemAddr; // ffa0h
+ UINT32 IOMisc; // ffa4h
+ UINT32 _ES;
+ UINT32 _CS;
+ UINT32 _SS;
+ UINT32 _DS;
+ UINT32 _FS;
+ UINT32 _GS;
+ UINT32 _LDTBase;
+ UINT32 _TR;
+ UINT32 _DR7;
+ UINT32 _DR6;
+ UINT32 _EAX;
+ UINT32 _ECX;
+ UINT32 _EDX;
+ UINT32 _EBX;
+ UINT32 _ESP;
+ UINT32 _EBP;
+ UINT32 _ESI;
+ UINT32 _EDI;
+ UINT32 _EIP;
+ UINT32 _EFLAGS;
+ UINT32 _CR3;
+ UINT32 _CR0;
+} EFI_SMM_CPU_STATE32;
+
+typedef struct _EFI_SMM_CPU_STATE64 {
+ UINT8 Reserved1[0x1d0]; // fc00h
+ UINT32 GdtBaseHiDword; // fdd0h
+ UINT32 LdtBaseHiDword; // fdd4h
+ UINT32 IdtBaseHiDword; // fdd8h
+ UINT8 Reserved2[0xc]; // fddch
+ UINT64 IO_EIP; // fde8h
+ UINT8 Reserved3[0x50]; // fdf0h
+ UINT32 _CR4; // fe40h
+ UINT8 Reserved4[0x48]; // fe44h
+ UINT32 GdtBaseLoDword; // fe8ch
+ UINT32 GdtLimit; // fe90h
+ UINT32 IdtBaseLoDword; // fe94h
+ UINT32 IdtLimit; // fe98h
+ UINT32 LdtBaseLoDword; // fe9ch
+ UINT32 LdtLimit; // fea0h
+ UINT32 LdtInfo; // fea4h
+ UINT8 Reserved5[0x50]; // fea8h
+ UINT32 SMBASE; // fef8h
+ UINT32 SMMRevId; // fefch
+ UINT16 AutoHALTRestart; // ff00h
+ UINT16 IORestart; // ff02h
+ UINT32 IEDBASE; // ff04h
+ UINT8 Reserved6[0x14]; // ff08h
+ UINT64 _R15; // ff1ch
+ UINT64 _R14;
+ UINT64 _R13;
+ UINT64 _R12;
+ UINT64 _R11;
+ UINT64 _R10;
+ UINT64 _R9;
+ UINT64 _R8;
+ UINT64 _RAX; // ff5ch
+ UINT64 _RCX;
+ UINT64 _RDX;
+ UINT64 _RBX;
+ UINT64 _RSP;
+ UINT64 _RBP;
+ UINT64 _RSI;
+ UINT64 _RDI;
+ UINT64 IOMemAddr; // ff9ch
+ UINT32 IOMisc; // ffa4h
+ UINT32 _ES; // ffa8h
+ UINT32 _CS;
+ UINT32 _SS;
+ UINT32 _DS;
+ UINT32 _FS;
+ UINT32 _GS;
+ UINT32 _LDTR; // ffc0h
+ UINT32 _TR;
+ UINT64 _DR7; // ffc8h
+ UINT64 _DR6;
+ UINT64 _RIP; // ffd8h
+ UINT64 IA32_EFER; // ffe0h
+ UINT64 _RFLAGS; // ffe8h
+ UINT64 _CR3; // fff0h
+ UINT64 _CR0; // fff8h
+} EFI_SMM_CPU_STATE64;
+
+typedef union _EFI_SMM_CPU_STATE {
+ struct {
+ UINT8 Reserved[0x200];
+ EFI_SMM_CPU_STATE32 x86;
+ };
+ EFI_SMM_CPU_STATE64 x64;
+} EFI_SMM_CPU_STATE;
+
+#define EFI_SMM_MIN_REV_ID_x64 0x30006
+
+typedef struct _EFI_SMM_CPU_SAVE_STATE_PROTOCOL {
+ EFI_SMM_CPU_STATE **CpuSaveState;
+};
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2009, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
diff --git a/Include/Protocol/SmmGpiDispatch.h b/Include/Protocol/SmmGpiDispatch.h
new file mode 100644
index 0000000..e75e082
--- /dev/null
+++ b/Include/Protocol/SmmGpiDispatch.h
@@ -0,0 +1,106 @@
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2009, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/SOURCE/Modules/SMM/SmmGpiDispatch.h 3 7/08/09 8:02p Markw $
+//
+// $Revision: 3 $
+//
+// $Date: 7/08/09 8:02p $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/SOURCE/Modules/SMM/SmmGpiDispatch.h $
+//
+// 3 7/08/09 8:02p Markw
+// Update headers.
+//
+// 2 3/28/07 2:41p Markw
+//
+//**********************************************************************
+
+//<AMI_FHDR_START>
+//----------------------------------------------------------------------------
+//
+// Name: SmmGpiDispatch.h
+//
+// Description: SMM GPI Dispatch Protocol header.
+//
+//----------------------------------------------------------------------------
+//<AMI_FHDR_END>
+
+#ifndef __SMM_GPI_DISPATCH_PROTOCOL_H__
+#define __SMM_GPI_DISPATCH_PROTOCOL_H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+#include <EFI.h>
+
+#define EFI_SMM_GPI_DISPATCH_PROTOCOL_GUID \
+ {0xe0744b81, 0x9513, 0x49cd, 0x8c, 0xea, 0xe9, 0x24, 0x5e, 0x70, 0x39, 0xda}
+
+GUID_VARIABLE_DECLARATION(gEfiSmmGpiDispatchProtocolGuid,EFI_SMM_GPI_DISPATCH_PROTOCOL_GUID);
+
+typedef struct _EFI_SMM_GPI_DISPATCH_PROTOCOL EFI_SMM_GPI_DISPATCH_PROTOCOL;
+
+typedef struct {
+ UINTN GpiNum;
+} EFI_SMM_GPI_DISPATCH_CONTEXT;
+
+//**********************************************
+// EFI_SMM_GPI_DISPATCH
+//**********************************************
+typedef VOID (EFIAPI *EFI_SMM_GPI_DISPATCH) (
+ IN EFI_HANDLE DispatchHandle,
+ IN EFI_SMM_GPI_DISPATCH_CONTEXT *DispatchContext
+);
+
+typedef EFI_STATUS (EFIAPI *EFI_SMM_GPI_REGISTER) (
+ IN EFI_SMM_GPI_DISPATCH_PROTOCOL *This,
+ IN EFI_SMM_GPI_DISPATCH DispatchFunction,
+ IN EFI_SMM_GPI_DISPATCH_CONTEXT *DispatchContext,
+ OUT EFI_HANDLE *DispatchHandle
+);
+
+typedef EFI_STATUS (EFIAPI *EFI_SMM_GPI_UNREGISTER) (
+ IN EFI_SMM_GPI_DISPATCH_PROTOCOL *This,
+ IN EFI_HANDLE DispatchHandle
+);
+
+struct _EFI_SMM_GPI_DISPATCH_PROTOCOL {
+ EFI_SMM_GPI_REGISTER Register;
+ EFI_SMM_GPI_UNREGISTER UnRegister;
+ UINTN NumSupportedGpis;
+};
+
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2009, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
diff --git a/Include/Protocol/SmmGpiDispatch2.h b/Include/Protocol/SmmGpiDispatch2.h
new file mode 100644
index 0000000..8bf8327
--- /dev/null
+++ b/Include/Protocol/SmmGpiDispatch2.h
@@ -0,0 +1,114 @@
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2009, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/SOURCE/Modules/SMM/SmmGpiDispatch2.h 2 3/04/11 3:36p Markw $
+//
+// $Revision: 2 $
+//
+// $Date: 3/04/11 3:36p $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/SOURCE/Modules/SMM/SmmGpiDispatch2.h $
+//
+// 2 3/04/11 3:36p Markw
+// Update headers.
+//
+// 1 2/07/11 4:03p Markw
+// [TAG] EIP53481
+// [Category] New Feature
+// [Description] Add PIWG 1.1 SMM support
+// [Files] mm.sdl, SmmPrivateShared.h, SmmDispatcher.mak,
+// SmmDispatcher.h, SmmDispatcher.c,
+// Smst.c, SmmPiSmst.c, SmmInit.c, SmmBase.c, SmmBase2.c,
+// SmmDriverDispatcher.c, Smm Framewwork Protocol files, SmmPi.h,
+// Smm Pi Protocol files, SmmPciRbio files
+//
+//**********************************************************************
+
+//<AMI_FHDR_START>
+//----------------------------------------------------------------------------
+//
+// Name: SmmGpiDispatch2.h
+//
+// Description: SMM GPI Dispatch Protocol header.
+//
+//----------------------------------------------------------------------------
+//<AMI_FHDR_END>
+
+#ifndef __SMM_GPI_DISPATCH2_PROTOCOL_H__
+#define __SMM_GPI_DISPATCH2_PROTOCOL_H__
+#if PI_SPECIFICATION_VERSION >= 0x0001000A
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <EFI.h>
+#include <SmmPi.h>
+
+#define EFI_SMM_GPI_DISPATCH2_PROTOCOL_GUID \
+ {0x25566b03, 0xb577, 0x4cbf, 0x95, 0x8c, 0xed, 0x66, 0x3e, 0xa2, 0x43, 0x80}
+
+GUID_VARIABLE_DECLARATION(gEfiSmmGpiDispatch2ProtocolGuid,EFI_SMM_GPI_DISPATCH2_PROTOCOL_GUID);
+
+typedef struct _EFI_SMM_GPI_DISPATCH_PROTOCOL EFI_SMM_GPI_DISPATCH_PROTOCOL;
+
+typedef struct {
+ //A bit mask of 64 possible GPIs that can generate an SMI. Bit 0 corresponds to logical
+ //GPI[0], 1 corresponds to logical GPI[1], and so on.
+ UINT64 GpiNum;
+} EFI_SMM_GPI_REGISTER_CONTEXT;
+
+typedef struct _EFI_SMM_GPI_DISPATCH2_PROTOCOL EFI_SMM_GPI_DISPATCH2_PROTOCOL;
+
+typedef EFI_STATUS (EFIAPI *EFI_SMM_GPI_REGISTER2)(
+ IN CONST EFI_SMM_GPI_DISPATCH2_PROTOCOL *This,
+ IN EFI_SMM_HANDLER_ENTRY_POINT2 DispatchFunction,
+ IN CONST EFI_SMM_GPI_REGISTER_CONTEXT *RegisterContext,
+ OUT EFI_HANDLE *DispatchHandle
+);
+
+typedef EFI_STATUS (EFIAPI *EFI_SMM_GPI_UNREGISTER2)(
+ IN CONST EFI_SMM_GPI_DISPATCH2_PROTOCOL *This,
+ IN EFI_HANDLE DispatchHandle
+);
+
+struct _EFI_SMM_GPI_DISPATCH2_PROTOCOL {
+ EFI_SMM_GPI_REGISTER2 Register;
+ EFI_SMM_GPI_UNREGISTER2 UnRegister;
+ UINTN NumSupportedGpis;
+};
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+#endif
+
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2009, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
diff --git a/Include/Protocol/SmmIoTrapDispatch.h b/Include/Protocol/SmmIoTrapDispatch.h
new file mode 100644
index 0000000..ad045bf
--- /dev/null
+++ b/Include/Protocol/SmmIoTrapDispatch.h
@@ -0,0 +1,129 @@
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
+
+//*************************************************************************
+// $Header: /Alaska/BIN/Chipset/Intel/SouthBridge/LynxPoint/Intel Pch SB Chipset/SB Protocols/SmmIoTrapDispatch.h 1 2/08/12 8:26a Yurenlai $
+//
+// $Revision: 1 $
+//
+// $Date: 2/08/12 8:26a $
+//*************************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Chipset/Intel/SouthBridge/LynxPoint/Intel Pch SB Chipset/SB Protocols/SmmIoTrapDispatch.h $
+//
+// 1 2/08/12 8:26a Yurenlai
+// Intel Lynx Point/SB eChipset initially releases.
+//
+//*************************************************************************
+//<AMI_FHDR_START>
+//
+// Name: SmmIoTrapDispatch.h
+//
+// Description: The header file for I/O Trap SMM Dispatch Protocol.
+//
+//<AMI_FHDR_END>
+//*************************************************************************
+
+#ifndef __SMM_IO_TRAP_DISPATCH_PROTOCOL_H__
+#define __SMM_IO_TRAP_DISPATCH_PROTOCOL_H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+#include <EFI.h>
+
+//follow Intel ref code IO TRAP GUID
+//#define EFI_SMM_IO_TRAP_DISPATCH_PROTOCOL_GUID \
+// { 0x58dc368d, 0x7bfa, 0x4e77, {0xab, 0xbc, 0xe, 0x29, 0x41, 0x8d, 0xf9, 0x30}}
+
+// {BD18369D-C242-45ca-82AD-138AC2E29BAB}
+//#define EFI_SMM_IO_TRAP_DISPATCH_PROTOCOL_GUID \
+// {0xbd18369d, 0xc242, 0x45ca, 0x82, 0xad, 0x13, 0x8a, 0xc2, 0xe2, 0x9b, 0xab}
+
+//GUID_VARIABLE_DECLARATION( gEfiSmmIoTrapDispatchProtocolGuid, \
+// EFI_SMM_IO_TRAP_DISPATCH_PROTOCOL_GUID );
+
+typedef enum {
+ ReadIoCycle = 0,
+ WriteIoCycle,
+ ReadWriteIoCycle
+} EFI_SMM_IOTRAP_OP_TYPE;
+
+typedef enum {
+ AccessAny = 0,
+ AccessByte,
+ AccessWord,
+ AccessDWord
+} EFI_SMM_ACCESS_WIDTH;
+
+typedef struct {
+ UINT16 Address;
+ UINT16 Length;
+ EFI_SMM_IOTRAP_OP_TYPE TrapOpType;
+ EFI_SMM_ACCESS_WIDTH TrapWidth;
+ UINT32 TrapAddress;
+ UINTN TrapData;
+ UINT32 TrapRegIndex;
+} EFI_SMM_IO_TRAP_DISPATCH_CONTEXT;
+
+typedef struct _EFI_SMM_IO_TRAP_DISPATCH_PROTOCOL \
+ EFI_SMM_IO_TRAP_DISPATCH_PROTOCOL;
+
+//******************************************************
+// EFI_SMM_IO_TRAP_DISPATCH
+//******************************************************
+typedef VOID (EFIAPI *EFI_SMM_IO_TRAP_DISPATCH) (
+ IN EFI_HANDLE DispatchHandle,
+ IN EFI_SMM_IO_TRAP_DISPATCH_CONTEXT *Context
+);
+
+
+typedef EFI_STATUS (EFIAPI *EFI_SMM_IO_TRAP_REGISTER) (
+ IN EFI_SMM_IO_TRAP_DISPATCH_PROTOCOL *This,
+ IN EFI_SMM_IO_TRAP_DISPATCH DispatchFunction,
+ IN EFI_SMM_IO_TRAP_DISPATCH_CONTEXT *DispatchContext,
+ OUT EFI_HANDLE *DispatchHandle
+);
+
+typedef EFI_STATUS (EFIAPI *EFI_SMM_IO_TRAP_UNREGISTER) (
+ IN EFI_SMM_IO_TRAP_DISPATCH_PROTOCOL *This,
+ IN EFI_HANDLE DispatchHandle
+);
+
+
+struct _EFI_SMM_IO_TRAP_DISPATCH_PROTOCOL {
+ EFI_SMM_IO_TRAP_REGISTER Register;
+ EFI_SMM_IO_TRAP_UNREGISTER UnRegister;
+};
+
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
diff --git a/Include/Protocol/SmmIoTrapDispatch2.h b/Include/Protocol/SmmIoTrapDispatch2.h
new file mode 100644
index 0000000..42941f6
--- /dev/null
+++ b/Include/Protocol/SmmIoTrapDispatch2.h
@@ -0,0 +1,122 @@
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/SOURCE/Modules/SMM/SmmIoTrapDispatch2.h 2 3/04/11 3:36p Markw $
+//
+// $Revision: 2 $
+//
+// $Date: 3/04/11 3:36p $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/SOURCE/Modules/SMM/SmmIoTrapDispatch2.h $
+//
+// 2 3/04/11 3:36p Markw
+// Update headers.
+//
+// 1 2/07/11 4:03p Markw
+// [TAG] EIP53481
+// [Category] New Feature
+// [Description] Add PIWG 1.1 SMM support
+// [Files] mm.sdl, SmmPrivateShared.h, SmmDispatcher.mak,
+// SmmDispatcher.h, SmmDispatcher.c,
+// Smst.c, SmmPiSmst.c, SmmInit.c, SmmBase.c, SmmBase2.c,
+// SmmDriverDispatcher.c, Smm Framewwork Protocol files, SmmPi.h,
+// Smm Pi Protocol files, SmmPciRbio files
+//
+//
+//**********************************************************************
+
+//<AMI_FHDR_START>
+//----------------------------------------------------------------------------
+//
+// Name: SmmBiosWriteDispatch2.h
+//
+// Description: SMM BIOS write Dispatch Protocol header.
+//
+//----------------------------------------------------------------------------
+//<AMI_FHDR_END>
+
+#ifndef __SMM_IO_TRAP_DISPATCH_PROTOCOL2_H__
+#define __SMM_IO_TRAP_DISPATCH_PROTOCOL2_H__
+#if PI_SPECIFICATION_VERSION >= 0x0001000A
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+#include <Efi.h>
+#include <SmmPi.h>
+
+#define EFI_SMM_IO_TRAP_DISPATCH2_PROTOCOL_GUID \
+ {0x58dc368d, 0x7bfa, 0x4e77, 0xab, 0xbc, 0xe, 0x29, 0x41, 0x8d, 0xf9, 0x30 }
+
+GUID_VARIABLE_DECLARATION(gEfiSmmIoTrapDispatch2ProtocolGuid, EFI_SMM_IO_TRAP_DISPATCH2_PROTOCOL_GUID);
+
+typedef enum {
+ WriteTrap,
+ ReadTrap,
+ ReadWriteTrap,
+ IoTrapTypeMaximum
+} EFI_SMM_IO_TRAP_DISPATCH_TYPE;
+
+typedef struct {
+ UINT16 Address;
+ UINT16 Length;
+ EFI_SMM_IO_TRAP_DISPATCH_TYPE Type;
+} EFI_SMM_IO_TRAP_REGISTER_CONTEXT;
+
+typedef struct {
+ UINT32 WriteData;
+} EFI_SMM_IO_TRAP_CONTEXT;
+
+typedef struct _EFI_SMM_IO_TRAP_DISPATCH2_PROTOCOL EFI_SMM_IO_TRAP_DISPATCH2_PROTOCOL;
+
+typedef EFI_STATUS (EFIAPI *EFI_SMM_IO_TRAP_DISPATCH2_REGISTER) (
+ IN CONST EFI_SMM_IO_TRAP_DISPATCH2_PROTOCOL *This,
+ IN EFI_SMM_HANDLER_ENTRY_POINT2 DispatchFunction,
+ IN OUT EFI_SMM_IO_TRAP_REGISTER_CONTEXT *RegisterContext,
+ OUT EFI_HANDLE *DispatchHandle
+);
+
+typedef EFI_STATUS (EFIAPI *EFI_SMM_IO_TRAP_DISPATCH2_UNREGISTER) (
+ IN CONST EFI_SMM_IO_TRAP_DISPATCH2_PROTOCOL *This,
+ IN EFI_HANDLE DispatchHandle
+);
+
+struct _EFI_SMM_IO_TRAP_DISPATCH2_PROTOCOL {
+ EFI_SMM_IO_TRAP_DISPATCH2_REGISTER Register;
+ EFI_SMM_IO_TRAP_DISPATCH2_UNREGISTER UnRegister;
+};
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+#endif
+
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
diff --git a/Include/Protocol/SmmPchIoTrapDispatch2.h b/Include/Protocol/SmmPchIoTrapDispatch2.h
new file mode 100644
index 0000000..b2c4b7c
--- /dev/null
+++ b/Include/Protocol/SmmPchIoTrapDispatch2.h
@@ -0,0 +1,134 @@
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
+
+//*************************************************************************
+// $Header: /Alaska/BIN/Chipset/Intel/SouthBridge/LynxPoint/Intel Pch SB Chipset/SB Protocols/SmmPchIoTrapDispatch2.h 1 2/08/12 8:26a Yurenlai $
+//
+// $Revision: 1 $
+//
+// $Date: 2/08/12 8:26a $
+//*************************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Chipset/Intel/SouthBridge/LynxPoint/Intel Pch SB Chipset/SB Protocols/SmmPchIoTrapDispatch2.h $
+//
+// 1 2/08/12 8:26a Yurenlai
+// Intel Lynx Point/SB eChipset initially releases.
+//
+//*************************************************************************
+//<AMI_FHDR_START>
+//
+// Name: SmmIoTrap2Dispatch.h
+//
+// Description: The header file for I/O Trap # 2 SMM Dispatch Protocol.
+//
+// Note: This GUID & Contexts are followed Platform Initialization
+// specification 1.2
+//
+//<AMI_FHDR_END>
+//*************************************************************************
+
+#ifndef __SMM_IO_TRAP_DISPATCH2_PROTOCOL_H__
+#define __SMM_IO_TRAP_DISPATCH2_PROTOCOL_H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+#include <EFI.h>
+
+//#### {58DC368D-7BFA-4E77-ABBC-0E29418DF930}
+//#####define EFI_SMM_IO_TRAP_DISPATCH2_PROTOCOL_GUID \
+//#### {0x58dc368d, 0x7bfa, 0x4e77, 0xab, 0xbc, 0x0e, 0x29, 0x41, 0x8d, 0xf9, 0x30}
+// For avoid conflicting with Intel RC's "EFI_SMM_IO_TRAP_DISPATCH_PROTOCOL_GUID",
+// therefore AMI modifies the IO trap #2 GUID.
+#define EFI_SMM_IO_TRAP_DISPATCH2_PROTOCOL_GUID \
+ {0xf1507845, 0x6494, 0x4377, 0xa1, 0x15, 0x45, 0xdf, 0xe6, 0x5f, 0x5d, 0x71}
+
+GUID_VARIABLE_DECLARATION( gEfiSmmIoTrapDispatch2ProtocolGuid, \
+ EFI_SMM_IO_TRAP_DISPATCH2_PROTOCOL_GUID );
+
+// I/O Trap valid types
+
+typedef enum {
+ WriteTrap = 0,
+ ReadTrap,
+ ReadWriteTrap,
+ IoTrapTypeMaximum
+} EFI_SMM_IO_TRAP_DISPATCH_TYPE;
+
+// I/O Trap #2 context structure containing information about the I/O Trap
+// event that should invoke the handler
+
+typedef struct {
+ UINT16 Address;
+ UINT16 Length;
+ EFI_SMM_IO_TRAP_DISPATCH_TYPE Type;
+} EFI_SMM_IO_TRAP_REGISTER_CONTEXT;
+
+// I/O Trap #2 context structure containing information about the I/O Trap
+// that occurred.
+
+typedef struct {
+ UINT32 WriteData;
+} EFI_SMM_IO_TRAP_CONTEXT;
+
+typedef struct _EFI_SMM_IO_TRAP_DISPATCH2_PROTOCOL \
+ EFI_SMM_IO_TRAP_DISPATCH2_PROTOCOL;
+
+//******************************************************
+// EFI_SMM_IO_TRAP_DISPATCH2
+//******************************************************
+typedef VOID (EFIAPI *EFI_SMM_IO_TRAP_DISPATCH2) (
+ IN EFI_HANDLE DispatchHandle,
+ IN EFI_SMM_IO_TRAP_CONTEXT *Context
+);
+
+
+typedef EFI_STATUS (EFIAPI *EFI_SMM_IO_TRAP_DISPATCH2_REGISTER) (
+ IN EFI_SMM_IO_TRAP_DISPATCH2_PROTOCOL *This,
+ IN EFI_SMM_IO_TRAP_DISPATCH2 DispatchFunction,
+ IN OUT EFI_SMM_IO_TRAP_REGISTER_CONTEXT *DispatchContext,
+ OUT EFI_HANDLE *DispatchHandle
+);
+
+typedef EFI_STATUS (EFIAPI *EFI_SMM_IO_TRAP_DISPATCH2_UNREGISTER) (
+ IN EFI_SMM_IO_TRAP_DISPATCH2_PROTOCOL *This,
+ IN EFI_HANDLE DispatchHandle
+);
+
+
+struct _EFI_SMM_IO_TRAP_DISPATCH2_PROTOCOL {
+ EFI_SMM_IO_TRAP_DISPATCH2_REGISTER Register;
+ EFI_SMM_IO_TRAP_DISPATCH2_UNREGISTER UnRegister;
+};
+
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
diff --git a/Include/Protocol/SmmPciRootBridgeIo.h b/Include/Protocol/SmmPciRootBridgeIo.h
new file mode 100644
index 0000000..f11eca9
--- /dev/null
+++ b/Include/Protocol/SmmPciRootBridgeIo.h
@@ -0,0 +1,78 @@
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/SOURCE/Modules/SMM/SmmPciRootBridgeIo.h 3 4/15/11 4:32p Markw $
+//
+// $Revision: 3 $
+//
+// $Date: 4/15/11 4:32p $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/SOURCE/Modules/SMM/SmmPciRootBridgeIo.h $
+//
+// 3 4/15/11 4:32p Markw
+// Header Update.
+//
+//**********************************************************************
+
+//<AMI_FHDR_START>
+//----------------------------------------------------------------------------
+//
+// Name: SmmPciRootBridgeIo.h
+//
+// Description:
+// Smm Pci Root Bridge Io Protocol
+//
+//----------------------------------------------------------------------------
+//<AMI_FHDR_END>
+
+#ifndef _SMM_PCI_ROOT_BRIDGE_IO_H_
+#define _SMM_PCI_ROOT_BRIDGE_IO_H_
+#if PI_SPECIFICATION_VERSION >= 0x0001000A
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <Protocol/PciRootBridgeIo.h>
+
+#define EFI_SMM_PCI_ROOT_BRIDGE_IO_PROTOCOL_GUID \
+ {0x8bc1714d, 0xffcb, 0x41c3, 0x89, 0xdc, 0x6c, 0x74, 0xd0, 0x6d, 0x98, 0xea}
+
+typedef EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL EFI_SMM_PCI_ROOT_BRIDGE_IO_PROTOCOL;
+
+GUID_VARIABLE_DECLARATION(gEfiSmmPciRootBridgeIoProtocolGuid, EFI_SMM_PCI_ROOT_BRIDGE_IO_PROTOCOL_GUID);
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+#endif
+
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
diff --git a/Include/Protocol/SmmPeriodicTimerDispatch.h b/Include/Protocol/SmmPeriodicTimerDispatch.h
new file mode 100644
index 0000000..989e829
--- /dev/null
+++ b/Include/Protocol/SmmPeriodicTimerDispatch.h
@@ -0,0 +1,118 @@
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2009, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/SOURCE/Modules/SMM/SmmPeriodicTimerDispatch.h 3 7/08/09 8:02p Markw $
+//
+// $Revision: 3 $
+//
+// $Date: 7/08/09 8:02p $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/SOURCE/Modules/SMM/SmmPeriodicTimerDispatch.h $
+//
+// 3 7/08/09 8:02p Markw
+// Update headers.
+//
+// 2 3/28/07 2:41p Markw
+//
+//**********************************************************************
+
+//----------------------------------------------------------------------------
+//<AMI_FHDR_START>
+//
+// Name: SmmPeriodicTimerDispatch.h
+//
+// Description: Smm Periodic Timer Dispatch Protocol header.
+//
+//<AMI_FHDR_END>
+//----------------------------------------------------------------------------
+#ifndef __SMM_PERIODIC_TIMER_DISPATCH_PROTOCOL_H__
+#define __SMM_PERIODIC_TIMER_DISPATCH_PROTOCOL_H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+#include <EFI.h>
+
+#define EFI_SMM_PERIODIC_TIMER_DISPATCH_PROTOCOL_GUID \
+ {0x9cca03fc, 0x4c9e, 0x4a19, 0x9b, 0x6, 0xed, 0x7b, 0x47, 0x9b, 0xde, 0x55}
+
+GUID_VARIABLE_DECLARATION(gEfiSmmPeriodicTimerDispatchProtocolGuid,EFI_SMM_PERIODIC_TIMER_DISPATCH_PROTOCOL_GUID);
+
+typedef struct _EFI_SMM_PERIODIC_TIMER_DISPATCH_PROTOCOL EFI_SMM_PERIODIC_TIMER_DISPATCH_PROTOCOL;
+
+
+//*******************************************************
+// EFI_SMM_PERIODIC_TIMER_DISPATCH_CONTEXT
+//*******************************************************
+typedef struct {
+ UINT64 Period;
+ UINT64 SmiTickInterval;
+ UINT64 ElapsedTime;
+} EFI_SMM_PERIODIC_TIMER_DISPATCH_CONTEXT;
+
+//*******************************************************
+// EFI_SMM_PERIODIC_TIMER_DISPATCH
+//*******************************************************
+typedef VOID (EFIAPI *EFI_SMM_PERIODIC_TIMER_DISPATCH) (
+ IN EFI_HANDLE DispatchHandle,
+ IN EFI_SMM_PERIODIC_TIMER_DISPATCH_CONTEXT *DispatchContext
+);
+
+typedef EFI_STATUS (EFIAPI *EFI_SMM_PERIODIC_TIMER_REGISTER) (
+ IN EFI_SMM_PERIODIC_TIMER_DISPATCH_PROTOCOL *This,
+ IN EFI_SMM_PERIODIC_TIMER_DISPATCH DispatchFunction,
+ IN EFI_SMM_PERIODIC_TIMER_DISPATCH_CONTEXT *DispatchContext,
+ OUT EFI_HANDLE *DispatchHandle
+);
+
+
+typedef EFI_STATUS (EFIAPI *EFI_SMM_PERIODIC_TIMER_UNREGISTER) (
+ IN EFI_SMM_PERIODIC_TIMER_DISPATCH_PROTOCOL *This,
+ IN EFI_HANDLE DispatchHandle
+);
+
+typedef EFI_STATUS (EFIAPI *EFI_SMM_PERIODIC_TIMER_INTERVAL) (
+ IN EFI_SMM_PERIODIC_TIMER_DISPATCH_PROTOCOL *This,
+ IN OUT UINT64 **SmiTickInterval
+);
+
+
+struct _EFI_SMM_PERIODIC_TIMER_DISPATCH_PROTOCOL {
+ EFI_SMM_PERIODIC_TIMER_REGISTER Register;
+ EFI_SMM_PERIODIC_TIMER_UNREGISTER UnRegister;
+ EFI_SMM_PERIODIC_TIMER_INTERVAL GetNextShorterInterval;
+};
+
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2009, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
diff --git a/Include/Protocol/SmmPeriodicTimerDispatch2.h b/Include/Protocol/SmmPeriodicTimerDispatch2.h
new file mode 100644
index 0000000..d636d15
--- /dev/null
+++ b/Include/Protocol/SmmPeriodicTimerDispatch2.h
@@ -0,0 +1,121 @@
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/SOURCE/Modules/SMM/SmmPeriodicTimerDispatch2.h 2 3/04/11 3:36p Markw $
+//
+// $Revision: 2 $
+//
+// $Date: 3/04/11 3:36p $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/SOURCE/Modules/SMM/SmmPeriodicTimerDispatch2.h $
+//
+// 2 3/04/11 3:36p Markw
+// Update headers.
+//
+// 1 2/07/11 4:03p Markw
+// [TAG] EIP53481
+// [Category] New Feature
+// [Description] Add PIWG 1.1 SMM support
+// [Files] mm.sdl, SmmPrivateShared.h, SmmDispatcher.mak,
+// SmmDispatcher.h, SmmDispatcher.c,
+// Smst.c, SmmPiSmst.c, SmmInit.c, SmmBase.c, SmmBase2.c,
+// SmmDriverDispatcher.c, Smm Framewwork Protocol files, SmmPi.h,
+// Smm Pi Protocol files, SmmPciRbio files
+//
+// 3 7/08/09 8:02p Markw
+// Update headers.
+//
+// 2 3/28/07 2:41p Markw
+//
+//**********************************************************************
+
+//----------------------------------------------------------------------------
+//<AMI_FHDR_START>
+//
+// Name: SmmPeriodicTimerDispatch2.h
+//
+// Description: Smm Periodic Timer Dispatch Protocol header.
+//
+//<AMI_FHDR_END>
+//----------------------------------------------------------------------------
+
+#ifndef __SMM_PERIODIC_TIMER_DISPATCH2_PROTOCOL_H__
+#define __SMM_PERIODIC_TIMER_DISPATCH2_PROTOCOL_H__
+#if PI_SPECIFICATION_VERSION >= 0x0001000A
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+#include <EFI.h>
+#include <SmmPi.h>
+
+
+#define EFI_SMM_PERIODIC_TIMER_DISPATCH2_PROTOCOL_GUID \
+ {0x4cec368e, 0x8e8e, 0x4d71, 0x8b, 0xe1, 0x95, 0x8c, 0x45, 0xfc, 0x8a, 0x53}
+
+GUID_VARIABLE_DECLARATION(gEfiSmmPeriodicTimerDispatch2ProtocolGuid,EFI_SMM_PERIODIC_TIMER_DISPATCH2_PROTOCOL_GUID);
+
+typedef struct _EFI_SMM_PERIODIC_TIMER_DISPATCH2_PROTOCOL EFI_SMM_PERIODIC_TIMER_DISPATCH2_PROTOCOL;
+
+typedef struct {
+ UINT64 Period;
+ UINT64 SmiTickInterval;
+} EFI_SMM_PERIODIC_TIMER_REGISTER_CONTEXT;
+
+typedef EFI_STATUS (EFIAPI *EFI_SMM_PERIODIC_TIMER_REGISTER2) (
+ IN CONST EFI_SMM_PERIODIC_TIMER_DISPATCH2_PROTOCOL *This,
+ IN EFI_SMM_HANDLER_ENTRY_POINT2 DispatchFunction,
+ IN CONST EFI_SMM_PERIODIC_TIMER_REGISTER_CONTEXT *RegisterContext,
+ OUT EFI_HANDLE *DispatchHandle
+);
+
+typedef EFI_STATUS (EFIAPI *EFI_SMM_PERIODIC_TIMER_UNREGISTER2) (
+ IN CONST EFI_SMM_PERIODIC_TIMER_DISPATCH2_PROTOCOL *This,
+ IN EFI_HANDLE DispatchHandle
+);
+
+typedef EFI_STATUS (EFIAPI *EFI_SMM_PERIODIC_TIMER_INTERVAL2) (
+ IN CONST EFI_SMM_PERIODIC_TIMER_DISPATCH2_PROTOCOL *This,
+ IN OUT UINT64 **SmiTickInterval
+);
+
+typedef struct _EFI_SMM_PERIODIC_TIMER_DISPATCH2_PROTOCOL {
+ EFI_SMM_PERIODIC_TIMER_REGISTER2 Register;
+ EFI_SMM_PERIODIC_TIMER_UNREGISTER2 UnRegister;
+ EFI_SMM_PERIODIC_TIMER_INTERVAL2 GetNextShorterInterval;
+} EFI_SMM_PERIODIC_TIMER_DISPATCH2_PROTOCOL;
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+#endif
+
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
diff --git a/Include/Protocol/SmmPiProtocols.cif b/Include/Protocol/SmmPiProtocols.cif
new file mode 100644
index 0000000..837ec37
--- /dev/null
+++ b/Include/Protocol/SmmPiProtocols.cif
@@ -0,0 +1,27 @@
+<component>
+ name = "SmmPiProtocols"
+ category = ModulePart
+ LocalRoot = "Include\Protocol\"
+ RefName = "SmmPiProtocols"
+[files]
+"SmmPiProtocols.sdl"
+"SmmBase2.h"
+"SmmAccess2.h"
+"SmmControl2.h"
+"SmmCommunication.h"
+"SmmCpu.h"
+"SmmCpuIo2.h"
+"SmmPciRootBridgeIo.h"
+"SmmReadyToLock.h"
+"DxeSmmReadyToLock.h"
+"SmmStatusCode.h"
+"SmmSwDispatch2.h"
+"SmmSxDispatch2.h"
+"SmmPowerButtonDispatch2.h"
+"SmmStandbyButtonDispatch2.h"
+"SmmUsbDispatch2.h"
+"SmmGpiDispatch2.h"
+"SmmPeriodicTimerDispatch2.h"
+"SmmIoTrapDispatch2.h"
+"AmiInternalSmmComm.h"
+<endComponent>
diff --git a/Include/Protocol/SmmPiProtocols.sdl b/Include/Protocol/SmmPiProtocols.sdl
new file mode 100644
index 0000000..a2fc051
--- /dev/null
+++ b/Include/Protocol/SmmPiProtocols.sdl
@@ -0,0 +1,11 @@
+TOKEN
+ Name = "SMM_PI_PROTOCOLS_SUPPORT"
+ Value = "1"
+ Help = "Main switch to enable SMM PI Protocols in Project"
+ TokenType = Boolean
+ TargetEQU = Yes
+ TargetMAK = Yes
+ TargetH = Yes
+ Master = Yes
+ Token = "PI_SPECIFICATION_VERSION" ">=" "0x1000A"
+End
diff --git a/Include/Protocol/SmmPowerButtonDispatch.h b/Include/Protocol/SmmPowerButtonDispatch.h
new file mode 100644
index 0000000..9086cb8
--- /dev/null
+++ b/Include/Protocol/SmmPowerButtonDispatch.h
@@ -0,0 +1,132 @@
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2009, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/SOURCE/Modules/SMM/SmmPowerButtonDispatch.h 3 7/08/09 8:02p Markw $
+//
+// $Revision: 3 $
+//
+// $Date: 7/08/09 8:02p $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/SOURCE/Modules/SMM/SmmPowerButtonDispatch.h $
+//
+// 3 7/08/09 8:02p Markw
+// Update headers.
+//
+// 2 3/28/07 2:45p Markw
+//
+// 1 3/18/07 1:54p Markw
+//
+// 2 3/13/06 1:40a Felixp
+//
+// 1 1/28/05 12:44p Felixp
+//
+// 2 1/18/05 3:22p Felixp
+// PrintDebugMessage renamed to Trace
+//
+// 1 12/23/04 9:41a Felixp
+//
+// 1 2/17/04 5:15p Markw
+//
+//**********************************************************************
+
+//<AMI_FHDR_START>
+//----------------------------------------------------------------------------
+//
+// Name: PowerButtonDispatch.h
+//
+// Description: Power Button Dispatch Protocol Header.
+//
+//----------------------------------------------------------------------------
+//<AMI_FHDR_END>
+
+#ifndef __SMM_POWER_BUTTON_DISPATCH_PROTOCOL_H__
+#define __SMM_POWER_BUTTON_DISPATCH_PROTOCOL_H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+#include <EFI.h>
+
+#define EFI_SMM_POWER_BUTTON_DISPATCH_PROTOCOL_GUID \
+ {0xb709efa0, 0x47a6, 0x4b41, 0xb9, 0x31, 0x12, 0xec, 0xe7, 0xa8, 0xee, 0x56 }
+
+GUID_VARIABLE_DECLARATION(gEfiSmmPowerButtonDispatchProtocolGuid,EFI_SMM_POWER_BUTTON_DISPATCH_PROTOCOL_GUID);
+
+typedef struct _EFI_SMM_POWER_BUTTON_DISPATCH_PROTOCOL EFI_SMM_POWER_BUTTON_DISPATCH_PROTOCOL;
+
+//******************************************************
+// EFI_POWER_BUTTON_PHASE
+//******************************************************
+typedef enum {
+ PowerButtonEntry, PowerButtonExit
+} EFI_POWER_BUTTON_PHASE;
+// Power Button. Example, Use for changing LEDs before ACPI OS is
+// on.
+// - DXE/BDS Phase
+// - OS Install Phase
+
+//******************************************************
+// EFI_SMM_POWER_BUTTON_DISPATCH_CONTEXT
+//******************************************************
+typedef struct {
+ EFI_POWER_BUTTON_PHASE Phase;
+} EFI_SMM_POWER_BUTTON_DISPATCH_CONTEXT;
+
+//******************************************************
+// EFI_SMM_POWER_BUTTON_DISPATCH
+//******************************************************
+typedef VOID (EFIAPI *EFI_SMM_POWER_BUTTON_DISPATCH) (
+ IN EFI_HANDLE DispatchHandle,
+ IN EFI_SMM_POWER_BUTTON_DISPATCH_CONTEXT *DispatchContext
+);
+
+typedef EFI_STATUS (EFIAPI *EFI_SMM_POWER_BUTTON_REGISTER) (
+ IN EFI_SMM_POWER_BUTTON_DISPATCH_PROTOCOL *This,
+ IN EFI_SMM_POWER_BUTTON_DISPATCH DispatchFunction,
+ IN EFI_SMM_POWER_BUTTON_DISPATCH_CONTEXT *DispatchContext,
+ OUT EFI_HANDLE *DispatchHandle
+);
+
+typedef EFI_STATUS (EFIAPI *EFI_SMM_POWER_BUTTON_UNREGISTER) (
+ IN EFI_SMM_POWER_BUTTON_DISPATCH_PROTOCOL *This,
+ IN EFI_HANDLE DispatchHandle
+);
+
+struct _EFI_SMM_POWER_BUTTON_DISPATCH_PROTOCOL {
+ EFI_SMM_POWER_BUTTON_REGISTER Register;
+ EFI_SMM_POWER_BUTTON_UNREGISTER UnRegister;
+};
+
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2009, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
diff --git a/Include/Protocol/SmmPowerButtonDispatch2.h b/Include/Protocol/SmmPowerButtonDispatch2.h
new file mode 100644
index 0000000..870cecd
--- /dev/null
+++ b/Include/Protocol/SmmPowerButtonDispatch2.h
@@ -0,0 +1,119 @@
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/SOURCE/Modules/SMM/SmmPowerButtonDispatch2.h 2 3/04/11 3:36p Markw $
+//
+// $Revision: 2 $
+//
+// $Date: 3/04/11 3:36p $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/SOURCE/Modules/SMM/SmmPowerButtonDispatch2.h $
+//
+// 2 3/04/11 3:36p Markw
+// Update headers.
+//
+// 1 2/07/11 4:03p Markw
+// [TAG] EIP53481
+// [Category] New Feature
+// [Description] Add PIWG 1.1 SMM support
+// [Files] mm.sdl, SmmPrivateShared.h, SmmDispatcher.mak,
+// SmmDispatcher.h, SmmDispatcher.c,
+// Smst.c, SmmPiSmst.c, SmmInit.c, SmmBase.c, SmmBase2.c,
+// SmmDriverDispatcher.c, Smm Framewwork Protocol files, SmmPi.h,
+// Smm Pi Protocol files, SmmPciRbio files
+//
+//**********************************************************************
+
+//<AMI_FHDR_START>
+//----------------------------------------------------------------------------
+//
+// Name: PowerButtonDispatch2.h
+//
+// Description: Power Button Dispatch Protocol Header.
+//
+//----------------------------------------------------------------------------
+//<AMI_FHDR_END>
+
+#ifndef __SMM_POWER_BUTTON_DISPATCH2_PROTOCOL_H__
+#define __SMM_POWER_BUTTON_DISPATCH2_PROTOCOL_H__
+#if PI_SPECIFICATION_VERSION >= 0x0001000A
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+#include <Efi.h>
+#include <SmmPi.h>
+
+
+#define EFI_SMM_POWER_BUTTON_DISPATCH2_PROTOCOL_GUID \
+ {0x1b1183fa, 0x1823, 0x46a7, 0x88, 0x72, 0x9c, 0x57, 0x87, 0x55, 0x40, 0x9d }
+
+GUID_VARIABLE_DECLARATION(gEfiSmmPowerButtonDispatch2ProtocolGuid,EFI_SMM_POWER_BUTTON_DISPATCH2_PROTOCOL_GUID);
+
+typedef struct _EFI_SMM_POWER_BUTTON_DISPATCH2_PROTOCOL EFI_SMM_POWER_BUTTON_DISPATCH2_PROTOCOL;
+
+typedef enum {
+ EfiPowerButtonEntry,
+ EfiPowerButtonExit,
+ EfiPowerButtonMax
+} EFI_POWER_BUTTON_PHASE;
+
+typedef struct {
+ EFI_POWER_BUTTON_PHASE Phase;
+} EFI_SMM_POWER_BUTTON_REGISTER_CONTEXT;
+
+
+typedef struct _EFI_SMM_POWER_BUTTON_DISPATCH2_PROTOCOL EFI_SMM_POWER_BUTTON_DISPATCH2_PROTOCOL;
+
+typedef EFI_STATUS (EFIAPI *EFI_SMM_POWER_BUTTON_REGISTER2)(
+ IN CONST EFI_SMM_POWER_BUTTON_DISPATCH2_PROTOCOL *This,
+ IN EFI_SMM_HANDLER_ENTRY_POINT2 DispatchFunction,
+ IN EFI_SMM_POWER_BUTTON_REGISTER_CONTEXT *RegisterContext,
+ OUT EFI_HANDLE *DispatchHandle
+);
+
+typedef EFI_STATUS (EFIAPI *EFI_SMM_POWER_BUTTON_UNREGISTER2)(
+ IN CONST EFI_SMM_POWER_BUTTON_DISPATCH2_PROTOCOL *This,
+ IN EFI_HANDLE DispatchHandle
+);
+
+// This protocol provides the parent dispatch service for the power button SMI source generator.
+struct _EFI_SMM_POWER_BUTTON_DISPATCH2_PROTOCOL {
+ EFI_SMM_POWER_BUTTON_REGISTER2 Register;
+ EFI_SMM_POWER_BUTTON_UNREGISTER2 UnRegister;
+};
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+#endif
+
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
diff --git a/Include/Protocol/SmmProtocols.cif b/Include/Protocol/SmmProtocols.cif
new file mode 100644
index 0000000..89457cc
--- /dev/null
+++ b/Include/Protocol/SmmProtocols.cif
@@ -0,0 +1,22 @@
+<component>
+ name = "SmmProtocols"
+ category = ModulePart
+ LocalRoot = "Include\Protocol\"
+ RefName = "SmmProtocols"
+[files]
+"SmmBase.h"
+"SmmAccess.h"
+"SmmControl.h"
+"SmmCpuState.h"
+"SmmThunk.h"
+"SmmStatusCode.h"
+"SmmSwDispatch.h"
+"SmmSxDispatch.h"
+"SmmPowerButtonDispatch.h"
+"SmmStandbyButtonDispatch.h"
+"SmmUsbDispatch.h"
+"SmmGpiDispatch.h"
+"SmmPeriodicTimerDispatch.h"
+"SmmTcoDispatch.h"
+"AmiSmmInfo.h"
+<endComponent>
diff --git a/Include/Protocol/SmmReadyToLock.h b/Include/Protocol/SmmReadyToLock.h
new file mode 100644
index 0000000..b48ab50
--- /dev/null
+++ b/Include/Protocol/SmmReadyToLock.h
@@ -0,0 +1,73 @@
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
+
+//*************************************************************************
+//**********************************************************************
+// $Header: /Alaska/SOURCE/Modules/SMM/SmmReadyToLock.h 3 6/24/11 2:11p Felixp $
+//
+// $Revision: 3 $
+//
+// $Date: 6/24/11 2:11p $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/SOURCE/Modules/SMM/SmmReadyToLock.h $
+//
+// 3 6/24/11 2:11p Felixp
+// DxeSmmReadyToLock protocol definitions are moved to DxeSmmReadyToLock.h
+//
+// 6 1/13/10 2:13p Felixp
+//
+//**********************************************************************
+//<AMI_FHDR_START>
+//
+// Name: SmmReadyToLock.h
+//
+// Description: SmmReadyToLock protocol definition
+//
+//<AMI_FHDR_END>
+//**********************************************************************
+#ifndef __SMM_READY_TO_LOCK__H__
+#define __SMM_READY_TO_LOCK__H__
+#if PI_SPECIFICATION_VERSION >= 0x0001000A
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define EFI_SMM_READY_TO_LOCK_PROTOCOL_GUID \
+ {0x47b7fa8c, 0xf4bd, 0x4af6, 0x82, 0x00, 0x33, 0x30, 0x86, 0xf0, 0xd2, 0xc8 }
+
+GUID_VARIABLE_DECLARATION(gEfiSmmReadyToLockProtocolGuid,EFI_SMM_READY_TO_LOCK_PROTOCOL_GUID);
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+#endif
+
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
diff --git a/Include/Protocol/SmmReportStatusCodeHandler.h b/Include/Protocol/SmmReportStatusCodeHandler.h
new file mode 100644
index 0000000..862d0cd
--- /dev/null
+++ b/Include/Protocol/SmmReportStatusCodeHandler.h
@@ -0,0 +1,93 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/BIN/Core/Include/Protocol/SmmReportStatusCodeHandler.h 1 6/16/11 9:48a Felixp $
+//
+// $Revision: 1 $
+//
+// $Date: 6/16/11 9:48a $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Core/Include/Protocol/SmmReportStatusCodeHandler.h $
+//
+// 1 6/16/11 9:48a Felixp
+//
+// 6 1/13/10 2:13p Felixp
+//
+//**********************************************************************
+//<AMI_FHDR_START>
+//
+// Name: SmmReportStatusCodeHandler.h
+//
+// Description: Smm Report Status Code Handler Protocol definitions header.
+//
+//<AMI_FHDR_END>
+//**********************************************************************
+#ifndef __SMM_REPORT_STATUS_CODE_HANDLER_PROTOCOL_H__
+#define __SMM_REPORT_STATUS_CODE_HANDLER_PROTOCOL_H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define EFI_SMM_RSC_HANDLER_PROTOCOL_GUID \
+ {0x2ff29fa7, 0x5e80, 0x4ed9, 0xb3, 0x80, 0x1, 0x7d, 0x3c, 0x55, 0x4f, 0xf4}
+
+GUID_VARIABLE_DECLARATION(gEfiSmmRscHandlerProtocolGuid, EFI_SMM_RSC_HANDLER_PROTOCOL_GUID);
+
+typedef EFI_STATUS
+(EFIAPI *EFI_SMM_RSC_HANDLER_CALLBACK) (
+ IN EFI_STATUS_CODE_TYPE CodeType,
+ IN EFI_STATUS_CODE_VALUE Value,
+ IN UINT32 Instance,
+ IN EFI_GUID * CallerId,
+ IN EFI_STATUS_CODE_DATA * Data
+);
+
+typedef EFI_STATUS
+(EFIAPI *EFI_SMM_RSC_HANDLER_REGISTER) (
+ IN EFI_SMM_RSC_HANDLER_CALLBACK Callback //A pointer to a function of type EFI_SMM_RSC_HANDLER_CALLBACK that is
+ //called when call to ReportStatusCode() occurs.
+);
+
+typedef EFI_STATUS
+(EFIAPI *EFI_SMM_RSC_HANDLER_UNREGISTER) (
+ IN EFI_SMM_RSC_HANDLER_CALLBACK Callback //A pointer to a function of type EFI_SMM_RSC_HANDLER_CALLBACK that is
+ //to be unregistered.
+);
+
+typedef struct _EFI_SMM_RSC_HANDLER_PROTOCOL {
+ EFI_SMM_RSC_HANDLER_REGISTER Register; //Register the callback for notification of status code messages.
+ EFI_SMM_RSC_HANDLER_UNREGISTER Unregister; //Unregister the callback.
+} EFI_SMM_RSC_HANDLER_PROTOCOL;
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif // __SMM_REPORT_STATUS_CODE_HANDLER_PROTOCOL_H__
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
diff --git a/Include/Protocol/SmmStandbyButtonDispatch.h b/Include/Protocol/SmmStandbyButtonDispatch.h
new file mode 100644
index 0000000..50060c3
--- /dev/null
+++ b/Include/Protocol/SmmStandbyButtonDispatch.h
@@ -0,0 +1,123 @@
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2009, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/SOURCE/Modules/SMM/SmmStandbyButtonDispatch.h 3 7/08/09 8:02p Markw $
+//
+// $Revision: 3 $
+//
+// $Date: 7/08/09 8:02p $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/SOURCE/Modules/SMM/SmmStandbyButtonDispatch.h $
+//
+// 3 7/08/09 8:02p Markw
+// Update headers.
+//
+// 2 3/28/07 2:44p Markw
+//
+//**********************************************************************
+
+//<AMI_FHDR_START>
+//----------------------------------------------------------------------------//
+// Name: StandbyButtonDispatch.h
+//
+// Description: Standby Button Dispatch Protocol Header.
+//
+//----------------------------------------------------------------------------
+//<AMI_FHDR_END>
+
+#ifndef __SMM_STANDBY_BUTTON_DISPATCH_PROTOCOL_H__
+#define __SMM_STANDBY_BUTTON_DISPATCH_PROTOCOL_H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+#include <EFI.h>
+
+#define EFI_SMM_STANDBY_BUTTON_DISPATCH_PROTOCOL_GUID \
+ {0x78965b98, 0xb0bf, 0x449e, 0x8b, 0x22, 0xd2, 0x91, 0x4e, 0x49, 0x8a, 0x98}
+
+GUID_VARIABLE_DECLARATION(gEfiSmmStandbyButtonDispatchProtocolGuid,EFI_SMM_STANDBY_BUTTON_DISPATCH_PROTOCOL_GUID);
+
+typedef struct _EFI_SMM_STANDBY_BUTTON_DISPATCH_PROTOCOL EFI_SMM_STANDBY_BUTTON_DISPATCH_PROTOCOL;
+
+
+//*****************************************************
+// EFI_STANDBY_BUTTON_PHASE;
+//*****************************************************
+typedef enum {
+ Entry, Exit
+} EFI_STANDBY_BUTTON_PHASE;
+
+//
+// Standby Button. Example, Use for changing LEDs before ACPI OS
+// is on.
+// - DXE/BDS Phase
+// - OS Install Phase
+//
+
+
+//*****************************************************
+// EFI_SMM_STANDBY_BUTTON_DISPATCH_CONTEXT
+//*****************************************************
+typedef struct {
+ EFI_STANDBY_BUTTON_PHASE Phase;
+} EFI_SMM_STANDBY_BUTTON_DISPATCH_CONTEXT;
+
+//*****************************************************
+// EFI_SMM_STANDBY_BUTTON_DISPATCH
+//*****************************************************
+typedef VOID (EFIAPI *EFI_SMM_STANDBY_BUTTON_DISPATCH) (
+ IN EFI_HANDLE DispatchHandle,
+ IN EFI_SMM_STANDBY_BUTTON_DISPATCH_CONTEXT *DispatchContext
+);
+
+typedef EFI_STATUS (EFIAPI *EFI_SMM_STANDBY_BUTTON_REGISTER) (
+ IN EFI_SMM_STANDBY_BUTTON_DISPATCH_PROTOCOL *This,
+ IN EFI_SMM_STANDBY_BUTTON_DISPATCH DispatchFunction,
+ IN EFI_SMM_STANDBY_BUTTON_DISPATCH_CONTEXT *DispatchContext,
+ OUT EFI_HANDLE *DispatchHandle
+);
+
+typedef EFI_STATUS (EFIAPI *EFI_SMM_STANDBY_BUTTON_UNREGISTER) (
+ IN EFI_SMM_STANDBY_BUTTON_DISPATCH_PROTOCOL *This,
+ IN EFI_HANDLE DispatchHandle
+);
+
+struct _EFI_SMM_STANDBY_BUTTON_DISPATCH_PROTOCOL {
+ EFI_SMM_STANDBY_BUTTON_REGISTER Register;
+ EFI_SMM_STANDBY_BUTTON_UNREGISTER UnRegister;
+};
+
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2009, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
diff --git a/Include/Protocol/SmmStandbyButtonDispatch2.h b/Include/Protocol/SmmStandbyButtonDispatch2.h
new file mode 100644
index 0000000..e05f5d9
--- /dev/null
+++ b/Include/Protocol/SmmStandbyButtonDispatch2.h
@@ -0,0 +1,124 @@
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/SOURCE/Modules/SMM/SmmStandbyButtonDispatch2.h 2 3/04/11 3:36p Markw $
+//
+// $Revision: 2 $
+//
+// $Date: 3/04/11 3:36p $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/SOURCE/Modules/SMM/SmmStandbyButtonDispatch2.h $
+//
+// 2 3/04/11 3:36p Markw
+// Update headers.
+//
+// 1 2/07/11 4:03p Markw
+// [TAG] EIP53481
+// [Category] New Feature
+// [Description] Add PIWG 1.1 SMM support
+// [Files] mm.sdl, SmmPrivateShared.h, SmmDispatcher.mak,
+// SmmDispatcher.h, SmmDispatcher.c,
+// Smst.c, SmmPiSmst.c, SmmInit.c, SmmBase.c, SmmBase2.c,
+// SmmDriverDispatcher.c, Smm Framewwork Protocol files, SmmPi.h,
+// Smm Pi Protocol files, SmmPciRbio files
+//
+//**********************************************************************
+
+//<AMI_FHDR_START>
+//----------------------------------------------------------------------------//
+// Name: StandbyButtonDispatch2.h
+//
+// Description: Standby Button Dispatch Protocol Header.
+//
+//----------------------------------------------------------------------------
+//<AMI_FHDR_END>
+
+#ifndef __SMM_STANDBY_BUTTON_DISPATCH2_PROTOCOL_H__
+#define __SMM_STANDBY_BUTTON_DISPATCH2_PROTOCOL_H__
+#if PI_SPECIFICATION_VERSION >= 0x0001000A
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <Efi.h>
+#include <SmmPi.h>
+
+
+/////////////////////////////////////////////////////
+// PI 1.1 Definitions
+////////////////////////////////////////////////////
+#define EFI_SMM_STANDBY_BUTTON_DISPATCH2_PROTOCOL_GUID \
+ {0x7300c4a1, 0x43f2, 0x4017, 0xa5, 0x1b, 0xc8, 0x1a, 0x7f, 0x40, 0x58, 0x5b}
+
+GUID_VARIABLE_DECLARATION(gEfiSmmStandbyButtonDispatch2ProtocolGuid,EFI_SMM_STANDBY_BUTTON_DISPATCH2_PROTOCOL_GUID);
+
+typedef struct _EFI_SMM_STANDBY_BUTTON_DISPATCH2_PROTOCOL EFI_SMM_STANDBY_BUTTON_DISPATCH2_PROTOCOL;
+
+
+typedef enum {
+ EfiStandbyButtonEntry,
+ EfiStandbyButtonExit,
+ EfiStandbyButtonMax
+} EFI_STANDBY_BUTTON_PHASE;
+
+typedef struct {
+ //Describes whether the child handler should be invoked upon the entry to the button, activation, or exit.
+ EFI_STANDBY_BUTTON_PHASE Phase;
+} EFI_SMM_STANDBY_BUTTON_REGISTER_CONTEXT;
+
+typedef EFI_STATUS (EFIAPI *EFI_SMM_STANDBY_BUTTON_REGISTER2)(
+ IN CONST EFI_SMM_STANDBY_BUTTON_DISPATCH2_PROTOCOL *This,
+ IN EFI_SMM_HANDLER_ENTRY_POINT2 DispatchFunction,
+ IN EFI_SMM_STANDBY_BUTTON_REGISTER_CONTEXT *RegisterContext,
+ OUT EFI_HANDLE *DispatchHandle
+);
+
+typedef EFI_STATUS (EFIAPI *EFI_SMM_STANDBY_BUTTON_UNREGISTER2)(
+ IN CONST EFI_SMM_STANDBY_BUTTON_DISPATCH2_PROTOCOL *This,
+ IN EFI_HANDLE DispatchHandle
+);
+
+///
+/// This protocol provides the parent dispatch service for the standby
+/// button SMI source generator.
+///
+struct _EFI_SMM_STANDBY_BUTTON_DISPATCH2_PROTOCOL {
+ EFI_SMM_STANDBY_BUTTON_REGISTER2 Register;
+ EFI_SMM_STANDBY_BUTTON_UNREGISTER2 UnRegister;
+};
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+#endif
+
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
diff --git a/Include/Protocol/SmmStatusCode.h b/Include/Protocol/SmmStatusCode.h
new file mode 100644
index 0000000..c5d3e96
--- /dev/null
+++ b/Include/Protocol/SmmStatusCode.h
@@ -0,0 +1,106 @@
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/SOURCE/Modules/SMM/SmmStatusCode.h 4 4/18/11 5:11p Markw $
+//
+// $Revision: 4 $
+//
+// $Date: 4/18/11 5:11p $
+//*****************************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/SOURCE/Modules/SMM/SmmStatusCode.h $
+//
+// 4 4/18/11 5:11p Markw
+// Revert back to Rev 1.
+//
+// 3 3/04/11 3:36p Markw
+// Update headers.
+//
+// 2 7/08/09 8:02p Markw
+// Update headers.
+//
+// 1 3/18/07 1:54p Markw
+//
+// 2 3/13/06 1:40a Felixp
+//
+// 1 1/28/05 12:44p Felixp
+//
+// 3 1/18/05 3:22p Felixp
+// PrintDebugMessage renamed to Trace
+//
+// 1 12/23/04 9:41a Felixp
+//
+// 2 3/30/04 3:16p Markw
+// Removed duplicate definition.
+//
+// 1 2/17/04 2:09p Markw
+//
+//*****************************************************************************
+//<AMI_FHDR_START>
+//
+// Name: SmmStatusCode_h
+//
+// Description: This file is an include file used to define the Protocol for the
+// Firmware Volume Block Protocol.
+//
+//<AMI_FHDR_END>
+//*****************************************************************************
+#ifndef __SMM_STATUS_CODE_PROTOCOL_H__
+#define __SMM_STATUS_CODE_PROTOCOL_H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+#include <EFI.h>
+
+#define EFI_SMM_STATUS_CODE_PROTOCOL_GUID \
+ {0x6afd2b77,0x98c1,0x4acd,0xa6,0xf9,0x8a,0x94,0x39,0xde,0xf,0xb1}
+
+GUID_VARIABLE_DECLARATION(gEfiSmmStatusCodeProtocolGuid,EFI_SMM_STATUS_CODE_PROTOCOL_GUID);
+
+typedef struct _EFI_SMM_STATUS_CODE_PROTOCOL EFI_SMM_STATUS_CODE_PROTOCOL;
+
+typedef EFI_STATUS (EFIAPI *EFI_SMM_REPORT_STATUS_CODE) (
+ IN EFI_SMM_STATUS_CODE_PROTOCOL *This,
+ IN EFI_STATUS_CODE_TYPE CodeType,
+ IN EFI_STATUS_CODE_VALUE Value,
+ IN UINT32 Instance,
+ IN EFI_GUID *CallerId,
+ IN EFI_STATUS_CODE_DATA *Data OPTIONAL
+);
+
+struct _EFI_SMM_STATUS_CODE_PROTOCOL {
+ EFI_SMM_REPORT_STATUS_CODE ReportStatusCode;
+};
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
diff --git a/Include/Protocol/SmmSwDispatch.h b/Include/Protocol/SmmSwDispatch.h
new file mode 100644
index 0000000..988c08d
--- /dev/null
+++ b/Include/Protocol/SmmSwDispatch.h
@@ -0,0 +1,121 @@
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2009, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/SOURCE/Modules/SMM/SmmSwDispatch.h 3 7/08/09 8:02p Markw $
+//
+// $Revision: 3 $
+//
+// $Date: 7/08/09 8:02p $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/SOURCE/Modules/SMM/SmmSwDispatch.h $
+//
+// 3 7/08/09 8:02p Markw
+// Update headers.
+//
+// 2 3/28/07 2:48p Markw
+//
+//
+//**********************************************************************
+
+//<AMI_FHDR_START>
+//----------------------------------------------------------------------------
+//
+// Name: SmmSwDispatch.h
+//
+// Description: SMM SW Dispatch Protocol header.
+//
+//----------------------------------------------------------------------------
+//<AMI_FHDR_END>
+
+#ifndef __SMM_SW_DISPATCH_PROTOCOL_H__
+#define __SMM_SW_DISPATCH_PROTOCOL_H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+#include <EFI.h>
+
+#define EFI_SMM_SW_DISPATCH_PROTOCOL_GUID \
+ {0xe541b773, 0xdd11, 0x420c, 0xb0, 0x26, 0xdf, 0x99, 0x36, 0x53, 0xf8, 0xbf}
+
+GUID_VARIABLE_DECLARATION(gEfiSmmSwDispatchProtocolGuid,EFI_SMM_SW_DISPATCH_PROTOCOL_GUID);
+
+typedef struct _EFI_SMM_SW_DISPATCH_PROTOCOL EFI_SMM_SW_DISPATCH_PROTOCOL;
+
+
+
+//******************************************************
+// EFI_SMM_SW_DISPATCH_CONTEXT
+//******************************************************
+//
+// A particular chipset may not support all possible software SMI
+// input values. For example, the ICH supports only values 00h to
+// 0FFh. The parent only allows a single child registration for
+// each SwSmiInputValue.
+//
+typedef struct {
+ UINTN SwSmiInputValue;
+} EFI_SMM_SW_DISPATCH_CONTEXT;
+
+
+//******************************************************
+// EFI_SMM_SW_DISPATCH
+//******************************************************
+typedef VOID (EFIAPI *EFI_SMM_SW_DISPATCH) (
+ IN EFI_HANDLE DispatchHandle,
+ IN EFI_SMM_SW_DISPATCH_CONTEXT *DispatchContext
+);
+
+
+typedef EFI_STATUS (EFIAPI *EFI_SMM_SW_REGISTER) (
+ IN EFI_SMM_SW_DISPATCH_PROTOCOL *This,
+ IN EFI_SMM_SW_DISPATCH DispatchFunction,
+ IN EFI_SMM_SW_DISPATCH_CONTEXT *DispatchContext,
+ OUT EFI_HANDLE *DispatchHandle
+);
+
+typedef EFI_STATUS (EFIAPI *EFI_SMM_SW_UNREGISTER) (
+IN EFI_SMM_SW_DISPATCH_PROTOCOL *This,
+IN EFI_HANDLE DispatchHandle
+);
+
+
+struct _EFI_SMM_SW_DISPATCH_PROTOCOL {
+ EFI_SMM_SW_REGISTER Register;
+ EFI_SMM_SW_UNREGISTER UnRegister;
+ UINTN MaximumSwiValue;
+};
+
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2009, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
diff --git a/Include/Protocol/SmmSwDispatch2.h b/Include/Protocol/SmmSwDispatch2.h
new file mode 100644
index 0000000..cac7825
--- /dev/null
+++ b/Include/Protocol/SmmSwDispatch2.h
@@ -0,0 +1,133 @@
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/SOURCE/Modules/SMM/SmmSwDispatch2.h 2 3/04/11 3:36p Markw $
+//
+// $Revision: 2 $
+//
+// $Date: 3/04/11 3:36p $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/SOURCE/Modules/SMM/SmmSwDispatch2.h $
+//
+// 2 3/04/11 3:36p Markw
+// Update headers.
+//
+// 1 2/07/11 4:03p Markw
+// [TAG] EIP53481
+// [Category] New Feature
+// [Description] Add PIWG 1.1 SMM support
+// [Files] mm.sdl, SmmPrivateShared.h, SmmDispatcher.mak,
+// SmmDispatcher.h, SmmDispatcher.c,
+// Smst.c, SmmPiSmst.c, SmmInit.c, SmmBase.c, SmmBase2.c,
+// SmmDriverDispatcher.c, Smm Framewwork Protocol files, SmmPi.h,
+// Smm Pi Protocol files, SmmPciRbio files
+//
+//**********************************************************************
+
+//<AMI_FHDR_START>
+//----------------------------------------------------------------------------
+//
+// Name: SmmSwDispatch2.h
+//
+// Description: SMM SW Dispatch Protocol header.
+//
+//----------------------------------------------------------------------------
+//<AMI_FHDR_END>
+
+#ifndef __SMM_SW_DISPATCH2_PROTOCOL_H__
+#define __SMM_SW_DISPATCH2_PROTOCOL_H__
+#if PI_SPECIFICATION_VERSION >= 0x0001000A
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <Efi.h>
+#include <SmmPi.h>
+
+#define EFI_SMM_SW_DISPATCH2_PROTOCOL_GUID \
+ {0x18a3c6dc, 0x5eea, 0x48c8, 0xa1, 0xc1, 0xb5, 0x33, 0x89, 0xf9, 0x89, 0x99}
+
+GUID_VARIABLE_DECLARATION(gEfiSmmSwDispatch2ProtocolGuid,EFI_SMM_SW_DISPATCH2_PROTOCOL_GUID);
+
+typedef struct _EFI_SMM_SW_DISPATCH2_PROTOCOL EFI_SMM_SW_DISPATCH2_PROTOCOL;
+
+//
+// A particular chipset may not support all possible software SMI input values.
+// For example, the ICH supports only values 00h to 0FFh. The parent only allows a single
+// child registration for each SwSmiInputValue.
+//
+typedef struct {
+ UINTN SwSmiInputValue;
+} EFI_SMM_SW_REGISTER_CONTEXT;
+
+//
+// The DispatchFunction will be called with Context set to the same value as was passed into
+// this function in RegisterContext and with CommBuffer (and CommBufferSize) pointing
+// to an instance of EFI_SMM_SW_CONTEXT indicating the index of the CPU which generated the
+// software SMI.
+//
+typedef struct {
+ UINTN SwSmiCpuIndex;//The 0-based index of the CPU which generated the software SMI.
+ UINT8 CommandPort; //This value corresponds directly to the CommandPort parameter used in the call to Trigger().
+ UINT8 DataPort; //This value corresponds directly to the DataPort parameter used in the call to Trigger().
+} EFI_SMM_SW_CONTEXT;
+
+typedef struct _EFI_SMM_SW_DISPATCH2_PROTOCOL EFI_SMM_SW_DISPATCH2_PROTOCOL;
+
+typedef EFI_STATUS (EFIAPI *EFI_SMM_SW_REGISTER2)(
+ IN CONST EFI_SMM_SW_DISPATCH2_PROTOCOL *This,
+ IN EFI_SMM_HANDLER_ENTRY_POINT2 DispatchFunction,
+ IN CONST EFI_SMM_SW_REGISTER_CONTEXT *RegisterContext,
+ OUT EFI_HANDLE *DispatchHandle
+);
+
+typedef EFI_STATUS (EFIAPI *EFI_SMM_SW_UNREGISTER2)(
+ IN CONST EFI_SMM_SW_DISPATCH2_PROTOCOL *This,
+ IN EFI_HANDLE DispatchHandle
+);
+
+//
+// The EFI_SMM_SW_DISPATCH2_PROTOCOL provides the ability to install child handlers for the
+// given software. These handlers will respond to software interrupts.
+//
+struct _EFI_SMM_SW_DISPATCH2_PROTOCOL {
+ EFI_SMM_SW_REGISTER2 Register;
+ EFI_SMM_SW_UNREGISTER2 UnRegister;
+ UINTN MaximumSwiValue;
+};
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+#endif
+
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
diff --git a/Include/Protocol/SmmSxDispatch.h b/Include/Protocol/SmmSxDispatch.h
new file mode 100644
index 0000000..f788f14
--- /dev/null
+++ b/Include/Protocol/SmmSxDispatch.h
@@ -0,0 +1,142 @@
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2009, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/SOURCE/Modules/SMM/SmmSxDispatch.h 4 2/07/11 3:38p Markw $
+//
+// $Revision: 4 $
+//
+// $Date: 2/07/11 3:38p $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/SOURCE/Modules/SMM/SmmSxDispatch.h $
+//
+// 4 2/07/11 3:38p Markw
+// [TAG] EIP53481
+// [Category] New Feature
+// [Description] Add PIWG 1.1 SMM support
+// [Files] Smm.sdl, SmmPrivateShared.h, SmmDispatcher.mak,
+// SmmDispatcher.h, SmmDispatcher.c,
+// Smst.c, SmmPiSmst.c, SmmInit.c, SmmBase.c, SmmBase2.c,
+// SmmDriverDispatcher.c, Smm Framewwork Protocol files, SmmPi.h,
+// Smm Pi Protocol files, SmmPciRbio files
+//
+// 3 7/08/09 8:02p Markw
+// Update headers.
+//
+// 2 3/28/07 2:47p Markw
+//
+//**********************************************************************
+
+//<AMI_FHDR_START>
+//----------------------------------------------------------------------------
+//
+// Name: SmmSxDispatch.h
+//
+// Description: SMM SX Dispatch Protocol Header.
+//
+//----------------------------------------------------------------------------
+//<AMI_FHDR_END>
+
+#ifndef __SMM_SX_DISPATCH_PROTOCOL_H__
+#define __SMM_SX_DISPATCH_PROTOCOL_H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+#include <EFI.h>
+
+#define EFI_SMM_SX_DISPATCH_PROTOCOL_GUID \
+ {0x14fc52be, 0x1dc, 0x426c, 0x91, 0xae, 0xa2, 0x3c, 0x3e, 0x22, 0xa, 0xe8}
+
+GUID_VARIABLE_DECLARATION(gEfiSmmSxDispatchProtocolGuid,EFI_SMM_SX_DISPATCH_PROTOCOL_GUID);
+
+typedef struct _EFI_SMM_SX_DISPATCH_PROTOCOL EFI_SMM_SX_DISPATCH_PROTOCOL;
+
+#ifndef SMM_SX_DEF
+#define SMM_SX_DEF
+
+//****************************************************
+// EFI_SLEEP_TYPE
+//****************************************************
+typedef enum {
+ SxS0, SxS1, SxS2, SxS3, SxS4, SxS5,
+ EfiMaximumSleepType
+} EFI_SLEEP_TYPE;
+
+//****************************************************
+// EFI_SLEEP_PHASE
+//****************************************************
+typedef enum {
+ SxEntry, SxExit,
+ EfiMaximumPhase
+} EFI_SLEEP_PHASE;
+
+#endif
+
+
+//****************************************************
+// EFI_SMM_SX_DISPATCH_CONTEXT
+//****************************************************
+typedef struct {
+ EFI_SLEEP_TYPE Type;
+ EFI_SLEEP_PHASE Phase;
+} EFI_SMM_SX_DISPATCH_CONTEXT;
+
+//****************************************************
+// EFI_SMM_SX_DISPATCH
+//****************************************************
+typedef VOID (EFIAPI *EFI_SMM_SX_DISPATCH) (
+ IN EFI_HANDLE DispatchHandle,
+ IN EFI_SMM_SX_DISPATCH_CONTEXT *DispatchContext
+);
+
+typedef EFI_STATUS (EFIAPI *EFI_SMM_SX_REGISTER) (
+ IN EFI_SMM_SX_DISPATCH_PROTOCOL *This,
+ IN EFI_SMM_SX_DISPATCH DispatchFunction,
+ IN EFI_SMM_SX_DISPATCH_CONTEXT *DispatchContext,
+ OUT EFI_HANDLE *DispatchHandle
+);
+
+
+typedef EFI_STATUS (EFIAPI *EFI_SMM_SX_UNREGISTER) (
+ IN EFI_SMM_SX_DISPATCH_PROTOCOL *This,
+ IN EFI_HANDLE DispatchHandle
+);
+
+
+struct _EFI_SMM_SX_DISPATCH_PROTOCOL {
+ EFI_SMM_SX_REGISTER Register;
+ EFI_SMM_SX_UNREGISTER UnRegister;
+};
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2009, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
diff --git a/Include/Protocol/SmmSxDispatch2.h b/Include/Protocol/SmmSxDispatch2.h
new file mode 100644
index 0000000..9e028e6
--- /dev/null
+++ b/Include/Protocol/SmmSxDispatch2.h
@@ -0,0 +1,127 @@
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/SOURCE/Modules/SMM/SmmSxDispatch2.h 2 3/04/11 3:36p Markw $
+//
+// $Revision: 2 $
+//
+// $Date: 3/04/11 3:36p $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/SOURCE/Modules/SMM/SmmSxDispatch2.h $
+//
+// 2 3/04/11 3:36p Markw
+// Update headers.
+//
+// 1 2/07/11 4:03p Markw
+// [TAG] EIP53481
+// [Category] New Feature
+// [Description] Add PIWG 1.1 SMM support
+// [Files] mm.sdl, SmmPrivateShared.h, SmmDispatcher.mak,
+// SmmDispatcher.h, SmmDispatcher.c,
+// Smst.c, SmmPiSmst.c, SmmInit.c, SmmBase.c, SmmBase2.c,
+// SmmDriverDispatcher.c, Smm Framewwork Protocol files, SmmPi.h,
+// Smm Pi Protocol files, SmmPciRbio files
+//
+//**********************************************************************
+
+//<AMI_FHDR_START>
+//----------------------------------------------------------------------------
+//
+// Name: SmmSxDispatch2.h
+//
+// Description: SMM SX Dispatch Protocol Header.
+//
+//----------------------------------------------------------------------------
+//<AMI_FHDR_END>
+
+#ifndef __SMM_SX_DISPATCH2_PROTOCOL_H__
+#define __SMM_SX_DISPATCH2_PROTOCOL_H__
+#if PI_SPECIFICATION_VERSION >= 0x0001000A
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <Efi.h>
+#include <SmmPi.h>
+
+#define EFI_SMM_SX_DISPATCH2_PROTOCOL_GUID \
+ {0x456d2859, 0xa84b, 0x4e47, 0xa2, 0xee, 0x32, 0x76, 0xd8, 0x86, 0x99, 0x7d }
+
+GUID_VARIABLE_DECLARATION(gEfiSmmSxDispatch2ProtocolGuid,EFI_SMM_SX_DISPATCH2_PROTOCOL_GUID);
+
+typedef struct _EFI_SMM_SX_DISPATCH2_PROTOCOL EFI_SMM_SX_DISPATCH2_PROTOCOL;
+
+#ifndef SMM_SX_DEF
+#define SMM_SX_DEF
+
+typedef enum {
+ SxS0, SxS1, SxS2, SxS3, SxS4, SxS5,
+ EfiMaximumSleepType
+} EFI_SLEEP_TYPE;
+
+typedef enum {
+ SxEntry, SxExit,
+ EfiMaximumPhase
+} EFI_SLEEP_PHASE;
+#endif
+
+
+typedef struct {
+ EFI_SLEEP_TYPE Type;
+ EFI_SLEEP_PHASE Phase;
+} EFI_SMM_SX_REGISTER_CONTEXT;
+
+typedef struct _EFI_SMM_SX_DISPATCH2_PROTOCOL EFI_SMM_SX_DISPATCH2_PROTOCOL;
+
+typedef EFI_STATUS (EFIAPI *EFI_SMM_SX_REGISTER2)(
+ IN CONST EFI_SMM_SX_DISPATCH2_PROTOCOL *This,
+ IN EFI_SMM_HANDLER_ENTRY_POINT2 DispatchFunction,
+ IN CONST EFI_SMM_SX_REGISTER_CONTEXT *RegisterContext,
+ OUT EFI_HANDLE *DispatchHandle
+);
+
+typedef EFI_STATUS (EFIAPI *EFI_SMM_SX_UNREGISTER2)(
+ IN CONST EFI_SMM_SX_DISPATCH2_PROTOCOL *This,
+ IN EFI_HANDLE DispatchHandle
+);
+
+struct _EFI_SMM_SX_DISPATCH2_PROTOCOL {
+ EFI_SMM_SX_REGISTER2 Register;
+ EFI_SMM_SX_UNREGISTER2 UnRegister;
+};
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+#endif
+
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
diff --git a/Include/Protocol/SmmTcoDispatch.h b/Include/Protocol/SmmTcoDispatch.h
new file mode 100644
index 0000000..7fd907b
--- /dev/null
+++ b/Include/Protocol/SmmTcoDispatch.h
@@ -0,0 +1,114 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2008, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Pkwy, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/SOURCE/Modules/SMM/SmmTcoDispatch.h 1 11/21/08 4:39p Yul $
+//
+// $Revision: 1 $
+//
+// $Date: 11/21/08 4:39p $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/SOURCE/Modules/SMM/SmmTcoDispatch.h $
+//
+// 1 11/21/08 4:39p Yul
+//
+// 2 8/01/08 2:49p Yul
+// Update for code review
+//
+// 1 12/14/07 12:42p Alexp
+//
+//**********************************************************************
+//<AMI_FHDR_START>
+//
+// Name: SmmTCODispatch_h
+//
+// Description:
+//
+//<AMI_FHDR_END>
+//**********************************************************************
+#ifndef __SMM_TCO_DISPATCH_PROTOCOL_H__
+#define __SMM_TCO_DISPATCH_PROTOCOL_H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+#include <EFI.h>
+
+#define EFI_SMM_TCO_DISPATCH_PROTOCOL_GUID \
+{0xe2d6bb1, 0xc624, 0x446d, 0x99, 0x82, 0x69, 0x3c, 0xd1, 0x81, 0xa6, 0x7}
+
+GUID_VARIABLE_DECLARATION(gEfiSmmTcoDispatchProtocolGuid, \
+ EFI_SMM_TCO_DISPATCH_PROTOCOL_GUID);
+
+typedef struct _EFI_SMM_TCO_DISPATCH_PROTOCOL \
+ EFI_SMM_TCO_DISPATCH_PROTOCOL;
+
+
+
+//******************************************************
+// EFI_SMM_TCO_DISPATCH_CONTEXT
+//******************************************************
+typedef struct {
+ UINTN TcoBitOffset;
+} EFI_SMM_TCO_DISPATCH_CONTEXT;
+
+
+//******************************************************
+// EFI_SMM_TCO_DISPATCH
+//******************************************************
+typedef VOID (EFIAPI *EFI_SMM_TCO_DISPATCH) (
+ IN EFI_HANDLE DispatchHandle,
+ IN EFI_SMM_TCO_DISPATCH_CONTEXT *DispatchContext
+);
+
+
+typedef EFI_STATUS (EFIAPI *EFI_SMM_TCO_REGISTER) (
+ IN EFI_SMM_TCO_DISPATCH_PROTOCOL *This,
+ IN EFI_SMM_TCO_DISPATCH DispatchFunction,
+ IN EFI_SMM_TCO_DISPATCH_CONTEXT *DispatchContext,
+ OUT EFI_HANDLE *DispatchHandle
+);
+
+typedef EFI_STATUS (EFIAPI *EFI_SMM_TCO_UNREGISTER) (
+IN EFI_SMM_TCO_DISPATCH_PROTOCOL *This,
+IN EFI_HANDLE DispatchHandle
+);
+
+
+struct _EFI_SMM_TCO_DISPATCH_PROTOCOL {
+ EFI_SMM_TCO_REGISTER Register;
+ EFI_SMM_TCO_UNREGISTER UnRegister;
+};
+
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2008, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Pkwy, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
diff --git a/Include/Protocol/SmmThunk.h b/Include/Protocol/SmmThunk.h
new file mode 100644
index 0000000..d52782e
--- /dev/null
+++ b/Include/Protocol/SmmThunk.h
@@ -0,0 +1,252 @@
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2009, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/SOURCE/Modules/SMM/SmmThunk.h 5 7/08/09 8:02p Markw $
+//
+// $Revision: 5 $
+//
+// $Date: 7/08/09 8:02p $
+//*****************************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/SOURCE/Modules/SMM/SmmThunk.h $
+//
+// 5 7/08/09 8:02p Markw
+// Update headers.
+//
+// 4 5/21/09 9:52a Markw
+// Added comments for the FarCall86 and FarCall86Ex may be used to do INT
+// XX calls.
+//
+// 3 3/03/08 6:35p Markw
+// Added 32-bit register for smm thunk.
+//
+// 2 10/29/07 11:00a Markw
+// Update register name. It was the same as CSM, which caused a symbol
+// redefintion when CSM headers are used with this header.
+//
+// 1 3/18/07 1:54p Markw
+//
+//*****************************************************************************
+//<AMI_FHDR_START>
+//
+// Name: SmmThunk.h
+//
+// Description: This file is an include file used to define the Protocol for the
+// SMM Thunk Protocol.
+//
+//<AMI_FHDR_END>
+//*****************************************************************************
+#ifndef __SMM_THUNK_PROTOCOL_H__
+#define __SMM_THUNK_PROTOCOL_H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+#include <EFI.h>
+
+#define EFI_SMM_THUNK_PROTOCOL_GUID \
+ {0x2a82fce6,0x8bb6,0x413e,0xb9,0xeb,0x45,0xdf,0xc0,0x52,0x2d,0xf3}
+
+GUID_VARIABLE_DECLARATION(gEfiSmmThunkProtocolGuid,EFI_SMM_THUNK_PROTOCOL_GUID);
+
+typedef struct _EFI_SMM_THUNK_PROTOCOL EFI_SMM_THUNK_PROTOCOL;
+
+//
+// SMM Thunk specification constant and types
+//
+
+typedef struct {
+ UINT16 CF:1;
+ UINT16 Reserved1:1;
+ UINT16 PF:1;
+ UINT16 Reserved2:1;
+ UINT16 AF:1;
+ UINT16 Reserved3:1;
+ UINT16 ZF:1;
+ UINT16 SF:1;
+ UINT16 TF:1;
+ UINT16 IF:1;
+ UINT16 DF:1;
+ UINT16 OF:1;
+ UINT16 IOPL:2;
+ UINT16 NT:1;
+ UINT16 Reserved4:1;
+} SMM_THUNK_FLAGS_REG;
+
+typedef struct {
+ UINT16 AX;
+ UINT16 BX;
+ UINT16 CX;
+ UINT16 DX;
+ UINT16 SI;
+ UINT16 DI;
+ SMM_THUNK_FLAGS_REG Flags;
+ UINT16 ES;
+ UINT16 CS;
+ UINT16 SS;
+ UINT16 DS;
+ UINT16 BP;
+} SMM_THUNK_WORD_REGS;
+
+typedef struct {
+ UINT8 AL, AH;
+ UINT8 BL, BH;
+ UINT8 CL, CH;
+ UINT8 DL, DH;
+} SMM_THUNK_BYTE_REGS;
+
+typedef union {
+ SMM_THUNK_WORD_REGS X;
+ SMM_THUNK_BYTE_REGS H;
+} SMM_THUNK_IA32_REGISTER_SET;
+
+typedef struct {
+ UINT32 CF:1;
+ UINT32 Reserved1:1;
+ UINT32 PF:1;
+ UINT32 Reserved2:1;
+ UINT32 AF:1;
+ UINT32 Reserved3:1;
+ UINT32 ZF:1;
+ UINT32 SF:1;
+ UINT32 TF:1;
+ UINT32 IF:1;
+ UINT32 DF:1;
+ UINT32 OF:1;
+ UINT32 IOPL:2;
+ UINT32 NT:1;
+ UINT32 Reserved4:1;
+ UINT32 RF:1;
+ UINT32 VM:1;
+ UINT32 AC:1;
+ UINT32 VIF:1;
+ UINT32 VIP:1;
+ UINT32 ID:1;
+ UINT32 Reserved5:10;
+} SMM_THUNK_FLAGS_REG_EX;
+
+typedef struct {
+ UINT32 EAX;
+ UINT32 EBX;
+ UINT32 ECX;
+ UINT32 EDX;
+ UINT32 ESI;
+ UINT32 EDI;
+ SMM_THUNK_FLAGS_REG_EX Flags;
+ UINT16 ES;
+ UINT16 CS;
+ UINT16 SS;
+ UINT16 DS;
+ UINT16 FS;
+ UINT16 GS;
+ UINT32 EBP;
+} SMM_THUNK_DWORD_REGS_EX;
+
+typedef struct {
+ UINT16 AX;
+ UINT16 Reserved1;
+ UINT16 BX;
+ UINT16 Reserved2;
+ UINT16 CX;
+ UINT16 Reserved3;
+ UINT16 DX;
+ UINT16 Reserved4;
+ UINT16 SI;
+ UINT16 Reserved5;
+ UINT16 DI;
+ UINT16 Reserved6;
+ SMM_THUNK_FLAGS_REG Flags;
+ UINT16 Reserved7;
+ UINT16 ES;
+ UINT16 CS;
+ UINT16 SS;
+ UINT16 DS;
+ UINT16 FS;
+ UINT16 GS;
+ UINT16 BP;
+ UINT16 Reserved8;
+} SMM_THUNK_WORD_REGS_EX;
+
+typedef struct {
+ UINT8 AL;
+ UINT8 AH;
+ UINT16 Reserved1;
+ UINT8 BL;
+ UINT8 BH;
+ UINT16 Reserved2;
+ UINT8 CL;
+ UINT8 CH;
+ UINT16 Reserved3;
+ UINT8 DL;
+ UINT8 DH;
+ UINT16 Reserved4;
+} SMM_THUNK_BYTE_REGS_EX;
+
+typedef union {
+ SMM_THUNK_DWORD_REGS_EX E;
+ SMM_THUNK_WORD_REGS_EX X;
+ SMM_THUNK_BYTE_REGS_EX H;
+} SMM_THUNK_IA32_REGISTER_SET_EX;
+
+typedef BOOLEAN (EFIAPI *EFI_SMM_FARCALL86) (
+ IN EFI_SMM_THUNK_PROTOCOL *This,
+ IN UINT16 Segment,
+ IN UINT16 Offset,
+ IN SMM_THUNK_IA32_REGISTER_SET *Regs,
+ IN VOID *Stack,
+ IN UINTN StackSize
+);
+
+typedef BOOLEAN (EFIAPI *EFI_SMM_FARCALL86_EX) (
+ IN EFI_SMM_THUNK_PROTOCOL *This,
+ IN UINT16 Segment,
+ IN UINT16 Offset,
+ IN SMM_THUNK_IA32_REGISTER_SET_EX *Regs,
+ IN VOID *Stack,
+ IN UINTN StackSize
+);
+
+//The FarCall86 and FarCall86Ex may be used to do INT XX calls.
+//INT XX call:
+// Stack = NULL
+// StackSize = 0,
+// Segment = Segment of INT xx.
+// Offset = Offset of INT xx.
+
+typedef struct _EFI_SMM_THUNK_PROTOCOL {
+ EFI_SMM_FARCALL86 FarCall86;
+ EFI_SMM_FARCALL86_EX FarCall86Ex;
+} EFI_SMM_THUNK_PROTOCOL;
+
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2009, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
diff --git a/Include/Protocol/SmmUsbDispatch.h b/Include/Protocol/SmmUsbDispatch.h
new file mode 100644
index 0000000..b2c8e97
--- /dev/null
+++ b/Include/Protocol/SmmUsbDispatch.h
@@ -0,0 +1,135 @@
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2009, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/SOURCE/Modules/SMM/SmmUsbDispatch.h 5 4/06/11 5:55p Markw $
+//
+// $Revision: 5 $
+//
+// $Date: 4/06/11 5:55p $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/SOURCE/Modules/SMM/SmmUsbDispatch.h $
+//
+// 5 4/06/11 5:55p Markw
+// Remove Smm.h include.
+//
+// 4 2/07/11 3:38p Markw
+// [TAG] EIP53481
+// [Category] New Feature
+// [Description] Add PIWG 1.1 SMM support.
+// Small header update.
+// [Files] Smm.sdl, SmmPrivateShared.h, SmmDispatcher.mak,
+// SmmDispatcher.h, SmmDispatcher.c,
+// Smst.c, SmmPiSmst.c, SmmInit.c, SmmBase.c, SmmBase2.c,
+// SmmDriverDispatcher.c, Smm Framewwork Protocol files, SmmPi.h,
+// Smm Pi Protocol files, SmmPciRbio files
+//
+// 3 7/08/09 8:02p Markw
+// Update headers.
+//
+// 2 3/28/07 2:43p Markw
+//
+//**********************************************************************
+
+
+//<AMI_FHDR_START>
+//----------------------------------------------------------------------------
+//
+// Name: SmmUsbDispatch.h
+//
+// Description: Smm Usb Dispatch Protocol header.
+//
+//----------------------------------------------------------------------------
+//<AMI_FHDR_END>
+
+#ifndef __SMM_USB_DISPATCH_PROTOCOL_H__
+#define __SMM_USB_DISPATCH_PROTOCOL_H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+#include <EFI.h>
+
+#define EFI_SMM_USB_DISPATCH_PROTOCOL_GUID \
+ {0xa05b6ffd, 0x87af, 0x4e42, 0x95, 0xc9, 0x62, 0x28, 0xb6, 0x3c, 0xf3, 0xf3}
+
+GUID_VARIABLE_DECLARATION(gEfiSmmUsbDispatchProtocolGuid,EFI_SMM_USB_DISPATCH_PROTOCOL_GUID);
+
+typedef struct _EFI_SMM_USB_DISPATCH_PROTOCOL EFI_SMM_USB_DISPATCH_PROTOCOL;
+
+#ifndef SMM_USB_DEF
+#define SMM_USB_DEF
+
+//********************************************************
+// EFI_USB_SMI_TYPE
+//********************************************************
+typedef enum {
+ UsbLegacy, UsbWake
+} EFI_USB_SMI_TYPE;
+
+//********************************************************
+// EFI_SMM_USB_DISPATCH_CONTEXT
+//********************************************************
+typedef struct {
+ EFI_USB_SMI_TYPE Type;
+ EFI_DEVICE_PATH_PROTOCOL *Device;
+} EFI_SMM_USB_DISPATCH_CONTEXT;
+
+#endif
+
+//********************************************************
+// EFI_SMM_USB_DISPATCH
+//********************************************************
+typedef VOID (EFIAPI *EFI_SMM_USB_DISPATCH) (
+ IN EFI_HANDLE DispatchHandle,
+ IN EFI_SMM_USB_DISPATCH_CONTEXT *DispatchContext
+);
+
+typedef EFI_STATUS (EFIAPI *EFI_SMM_USB_REGISTER) (
+ IN EFI_SMM_USB_DISPATCH_PROTOCOL *This,
+ IN EFI_SMM_USB_DISPATCH DispatchFunction,
+ IN EFI_SMM_USB_DISPATCH_CONTEXT *DispatchContext,
+ OUT EFI_HANDLE *DispatchHandle
+);
+
+typedef EFI_STATUS (EFIAPI *EFI_SMM_USB_UNREGISTER) (
+ IN EFI_SMM_USB_DISPATCH_PROTOCOL *This,
+ IN EFI_HANDLE DispatchHandle
+);
+
+struct _EFI_SMM_USB_DISPATCH_PROTOCOL {
+ EFI_SMM_USB_REGISTER Register;
+ EFI_SMM_USB_UNREGISTER UnRegister;
+};
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2009, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
diff --git a/Include/Protocol/SmmUsbDispatch2.h b/Include/Protocol/SmmUsbDispatch2.h
new file mode 100644
index 0000000..bfc9c73
--- /dev/null
+++ b/Include/Protocol/SmmUsbDispatch2.h
@@ -0,0 +1,205 @@
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/SOURCE/Modules/SMM/SmmUsbDispatch2.h 2 3/04/11 3:36p Markw $
+//
+// $Revision: 2 $
+//
+// $Date: 3/04/11 3:36p $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/SOURCE/Modules/SMM/SmmUsbDispatch2.h $
+//
+// 2 3/04/11 3:36p Markw
+// Update headers.
+//
+// 1 2/07/11 4:04p Markw
+// [TAG] EIP53481
+// [Category] New Feature
+// [Description] Add PIWG 1.1 SMM support
+// [Files] mm.sdl, SmmPrivateShared.h, SmmDispatcher.mak,
+// SmmDispatcher.h, SmmDispatcher.c,
+// Smst.c, SmmPiSmst.c, SmmInit.c, SmmBase.c, SmmBase2.c,
+// SmmDriverDispatcher.c, Smm Framewwork Protocol files, SmmPi.h,
+// Smm Pi Protocol files, SmmPciRbio files
+//
+// 3 7/08/09 8:02p Markw
+// Update headers.
+//
+// 2 3/28/07 2:43p Markw
+//
+//**********************************************************************
+
+
+//<AMI_FHDR_START>
+//----------------------------------------------------------------------------
+//
+// Name: SmmUsbDispatch.h
+//
+// Description: Smm Usb Dispatch Protocol header.
+//
+//----------------------------------------------------------------------------
+//<AMI_FHDR_END>
+
+#ifndef __SMM_USB_DISPATCH_PROTOCOL2_H__
+#define __SMM_USB_DISPATCH_PROTOCOL2_H__
+#if PI_SPECIFICATION_VERSION >= 0x0001000A
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+#include <EFI.h>
+#include <SmmPi.h>
+
+
+#ifndef SMM_USB_DEF
+#define SMM_USB_DEF
+
+//********************************************************
+// EFI_USB_SMI_TYPE
+//********************************************************
+typedef enum {
+ UsbLegacy, UsbWake
+} EFI_USB_SMI_TYPE;
+
+//********************************************************
+// EFI_SMM_USB_DISPATCH_CONTEXT
+//********************************************************
+typedef struct {
+ EFI_USB_SMI_TYPE Type;
+ EFI_DEVICE_PATH_PROTOCOL *Device;
+} EFI_SMM_USB_DISPATCH_CONTEXT;
+
+#endif
+
+/////////////////////////////////////////////////////
+// PI 1.1 Definitions
+////////////////////////////////////////////////////
+
+#define EFI_SMM_USB_DISPATCH2_PROTOCOL_GUID \
+ {0xee9b8d90, 0xc5a6, 0x40a2, 0xbd, 0xe2, 0x52, 0x55, 0x8d, 0x33, 0xcc, 0xa1}
+
+GUID_VARIABLE_DECLARATION(gEfiSmmUsbDispatch2ProtocolGuid,EFI_SMM_USB_DISPATCH2_PROTOCOL_GUID);
+
+typedef struct _EFI_SMM_USB_DISPATCH2_PROTOCOL EFI_SMM_USB_DISPATCH2_PROTOCOL;
+
+///
+/// The dispatch function's context.
+///
+typedef struct {
+ ///
+ /// Describes whether this child handler will be invoked in response to a USB legacy
+ /// emulation event, such as port-trap on the PS/2* keyboard control registers, or to a
+ /// USB wake event, such as resumption from a sleep state.
+ ///
+ EFI_USB_SMI_TYPE Type;
+ ///
+ /// The device path is part of the context structure and describes the location of the
+ /// particular USB host controller in the system for which this register event will occur.
+ /// This location is important because of the possible integration of several USB host
+ /// controllers in a system.
+ ///
+ EFI_DEVICE_PATH_PROTOCOL *Device;
+} EFI_SMM_USB_REGISTER_CONTEXT;
+
+
+/**
+ Provides the parent dispatch service for the USB SMI source generator.
+
+ This service registers a function (DispatchFunction) which will be called when the USB-
+ related SMI specified by RegisterContext has occurred. On return, DispatchHandle
+ contains a unique handle which may be used later to unregister the function using UnRegister().
+ The DispatchFunction will be called with Context set to the same value as was passed into
+ this function in RegisterContext and with CommBuffer containing NULL and
+ CommBufferSize containing zero.
+
+ @param[in] This Pointer to the EFI_SMM_USB_DISPATCH2_PROTOCOL instance.
+ @param[in] DispatchFunction Function to register for handler when a USB-related SMI occurs.
+ @param[in] RegisterContext Pointer to the dispatch function's context.
+ The caller fills this context in before calling
+ the register function to indicate to the register
+ function the USB SMI types for which the dispatch
+ function should be invoked.
+ @param[out] DispatchHandle Handle generated by the dispatcher to track the function instance.
+
+ @retval EFI_SUCCESS The dispatch function has been successfully
+ registered and the SMI source has been enabled.
+ @retval EFI_DEVICE_ERROR The driver was unable to enable the SMI source.
+ @retval EFI_INVALID_PARAMETER RegisterContext is invalid. The USB SMI type
+ is not within valid range.
+ @retval EFI_OUT_OF_RESOURCES There is not enough memory (system or SMM) to manage this child.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SMM_USB_REGISTER2)(
+ IN CONST EFI_SMM_USB_DISPATCH2_PROTOCOL *This,
+ IN EFI_SMM_HANDLER_ENTRY_POINT2 DispatchFunction,
+ IN CONST EFI_SMM_USB_REGISTER_CONTEXT *RegisterContext,
+ OUT EFI_HANDLE *DispatchHandle
+ );
+
+/**
+ Unregisters a USB service.
+
+ This service removes the handler associated with DispatchHandle so that it will no longer be
+ called when the USB event occurs.
+
+ @param[in] This Pointer to the EFI_SMM_USB_DISPATCH2_PROTOCOL instance.
+ @param[in] DispatchHandle Handle of the service to remove.
+
+ @retval EFI_SUCCESS The dispatch function has been successfully
+ unregistered and the SMI source has been disabled
+ if there are no other registered child dispatch
+ functions for this SMI source.
+ @retval EFI_INVALID_PARAMETER The DispatchHandle was not valid.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SMM_USB_UNREGISTER2)(
+ IN CONST EFI_SMM_USB_DISPATCH2_PROTOCOL *This,
+ IN EFI_HANDLE DispatchHandle
+ );
+
+///
+/// Interface structure for the SMM USB SMI Dispatch2 Protocol
+///
+/// This protocol provides the parent dispatch service for the USB SMI source generator.
+///
+struct _EFI_SMM_USB_DISPATCH2_PROTOCOL {
+ EFI_SMM_USB_REGISTER2 Register;
+ EFI_SMM_USB_UNREGISTER2 UnRegister;
+};
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+#endif
+
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
diff --git a/Include/Protocol/StatusCode.h b/Include/Protocol/StatusCode.h
new file mode 100644
index 0000000..cf539d8
--- /dev/null
+++ b/Include/Protocol/StatusCode.h
@@ -0,0 +1,94 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2005, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/BIN/Core/CORE_DXE/ArchProtocol/StatusCode.h 2 10/07/06 10:17a Felixp $
+//
+// $Revision: 2 $
+//
+// $Date: 10/07/06 10:17a $
+//*****************************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Core/CORE_DXE/ArchProtocol/StatusCode.h $
+//
+// 2 10/07/06 10:17a Felixp
+// UEFI 2.0 definitions added
+//
+// 1 3/13/06 1:45a Felixp
+//
+// 1 1/28/05 12:44p Felixp
+//
+// 2 1/18/05 3:21p Felixp
+// PrintDebugMessage renamed to Trace
+//
+// 1 12/23/04 9:42a Felixp
+//
+// 1 12/23/04 9:29a Felixp
+//
+// 1 4/07/04 5:19p Robert
+//
+//*****************************************************************************
+//<AMI_FHDR_START>
+//
+// Name: StatusCode.h
+//
+// Description: This file is an include file used to define the Architectural
+// Protocol for the Status Code Reporting. For questions about the
+// specification refer to the DXE CIS, The Status Code Spec,
+// and the EFI SPEC
+//
+//<AMI_FHDR_END>
+//*****************************************************************************
+#ifndef __STATUS_CODE_ARCH_PROTOCOL_H__
+#define __STATUS_CODE_ARCH_PROTOCOL_H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+#include <EFI.h>
+
+// GUID for the Status Code Architectural Protocol
+#define EFI_STATUS_CODE_ARCH_PROTOCOL_GUID \
+ { 0xd98e3ea3, 0x6f39, 0x4be4, 0x82, 0xce, 0x5a, 0x89, 0x0c, 0xcb, 0x2c, 0x95 }
+
+GUID_VARIABLE_DECLARATION(gEfiStatusCodeArchProtocolGuid, EFI_STATUS_CODE_ARCH_PROTOCOL_GUID);
+
+// UEFI 2.0 Status Code Runtime Protocol
+#define EFI_STATUS_CODE_RUNTIME_PROTOCOL_GUID \
+ { 0xd2b2b828, 0x826, 0x48a7, 0xb3, 0xdf, 0x98, 0x3c, 0x0, 0x60, 0x24, 0xf0}
+
+// Interface stucture for the STATUS CODE Runtime Protocol
+typedef struct _EFI_STATUS_CODE_PROTOCOL {
+ EFI_REPORT_STATUS_CODE ReportStatusCode;
+} EFI_STATUS_CODE_PROTOCOL;
+
+GUID_VARIABLE_DECLARATION(gEfiStatusCodeRuntimeProtocolGuid, EFI_STATUS_CODE_RUNTIME_PROTOCOL_GUID);
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2005, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
diff --git a/Include/Protocol/StorageSecurityCommand.h b/Include/Protocol/StorageSecurityCommand.h
new file mode 100644
index 0000000..4a63cd9
--- /dev/null
+++ b/Include/Protocol/StorageSecurityCommand.h
@@ -0,0 +1,97 @@
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
+
+//*************************************************************************
+// $Header: /Alaska/BIN/Core/Include/Protocol/StorageSecurityCommand.h 1 6/09/11 2:28p Artems $
+//
+// $Revision: 1 $
+//
+// $Date: 6/09/11 2:28p $
+//*************************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Core/Include/Protocol/StorageSecurityCommand.h $
+//
+// 1 6/09/11 2:28p Artems
+//
+//*************************************************************************
+//<AMI_FHDR_START>
+//
+// Name: StorageSecurityCommand.h
+//
+// Description:
+// EFI_DRIVER_HEALTH_PROTOCOL definition file
+//
+//<AMI_FHDR_END>
+//*************************************************************************
+#ifndef __STORAGE_SECURITY_COMMAND_PROTOCOL__H__
+#define __STORAGE_SECURITY_COMMAND_PROTOCOL__H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <EFI.h>
+
+#define EFI_STORAGE_SECURITY_COMMAND_PROTOCOL_GUID \
+ { 0xc88b0b6d, 0x0dfc, 0x49a7, 0x9c, 0xb4, 0x49, 0x7, 0x4b, 0x4c, 0x3a, 0x78 }
+
+GUID_VARIABLE_DECLARATION(gEfiStorageSecurityCommandProtocolGuid, EFI_STORAGE_SECURITY_COMMAND_PROTOCOL_GUID);
+
+
+typedef struct _EFI_STORAGE_SECURITY_COMMAND_PROTOCOL EFI_STORAGE_SECURITY_COMMAND_PROTOCOL;
+
+typedef EFI_STATUS (EFIAPI *EFI_STORAGE_SECURITY_RECEIVE_DATA)(
+ IN EFI_STORAGE_SECURITY_COMMAND_PROTOCOL *This,
+ IN UINT32 MediaId,
+ IN UINT64 Timeout,
+ IN UINT8 SecurityProtocol,
+ IN UINT16 SecurityProtocolSpecificData,
+ IN UINTN PayloadBufferSize,
+ OUT VOID *PayloadBuffer,
+ OUT UINTN *PayloadTransferSize
+);
+
+typedef EFI_STATUS (EFIAPI *EFI_STORAGE_SECURITY_SEND_DATA)(
+ IN EFI_STORAGE_SECURITY_COMMAND_PROTOCOL *This,
+ IN UINT32 MediaId,
+ IN UINT64 Timeout,
+ IN UINT8 SecurityProtocolId,
+ IN UINT16 SecurityProtocolSpecificData,
+ IN UINTN PayloadBufferSize,
+ IN VOID *PayloadBuffer
+);
+
+struct _EFI_STORAGE_SECURITY_COMMAND_PROTOCOL {
+ EFI_STORAGE_SECURITY_RECEIVE_DATA ReceiveData;
+ EFI_STORAGE_SECURITY_SEND_DATA SendData;
+};
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
diff --git a/Include/Protocol/SuperIo.h b/Include/Protocol/SuperIo.h
new file mode 100644
index 0000000..85bbfb0
--- /dev/null
+++ b/Include/Protocol/SuperIo.h
@@ -0,0 +1,286 @@
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/BIN/Core/Include/Protocol/SuperIo.h 2 5/06/11 12:09p Yakovlevs $
+//
+// $Revision: 2 $
+//
+// $Date: 5/06/11 12:09p $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Core/Include/Protocol/SuperIo.h $
+//
+// 2 5/06/11 12:09p Yakovlevs
+// AMI Function Headers added.
+//
+// 1 5/04/11 5:55p Yakovlevs
+// Initial Checkin.
+//
+
+//**********************************************************************
+//<AMI_FHDR_START>
+//
+// Name: SuperIo.h
+//
+// Description: EFI SuperIO Protocol Definitions.
+//
+//<AMI_FHDR_END>
+//**********************************************************************
+
+#ifndef __EFI_SUPER_IO_PROTOCOL_H__
+#define __EFI_SUPER_IO_PROTOCOL_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <Efi.h>
+
+#define EFI_SIO_PROTOCOL_GUID \
+ { 0x215fdd18, 0xbd50, 0x4feb, 0x89, 0xb, 0x58, 0xca, 0xb, 0x47, 0x39, 0xe9 }
+
+GUID_VARIABLE_DECLARATION(gEfiSioProtocolGuid, EFI_SIO_PROTOCOL_GUID);
+
+//Small resource common header
+typedef union _ACPI_SMALL_RESOURCE_HEADER {
+ UINT8 HDR;
+ struct{
+ UINT8 Length : 3;
+ UINT8 Name : 4;
+ UINT8 Type : 1;
+ };
+}ACPI_SMALL_RESOURCE_HEADER;
+
+//Large resource common header
+typedef struct _ACPI_LARGE_RESOURCE_HEADER {
+ union {
+ UINT8 HDR;
+ struct {
+ UINT8 Name : 7;
+ UINT8 Type : 1;
+ };
+ };
+ UINT16 Length;
+} ACPI_LARGE_RESOURCE_HEADER;
+
+typedef union {
+ ACPI_SMALL_RESOURCE_HEADER *SmallHeader;
+ ACPI_LARGE_RESOURCE_HEADER *LargeHeader;
+} ACPI_RESOURCE_HEADER_PTR;
+
+typedef struct {
+ UINT8 Register; ///< Register number.
+ UINT8 AndMask; ///< Bitwise AND mask.
+ UINT8 OrMask; ///< Bitwise OR mask.
+} EFI_SIO_REGISTER_MODIFY;
+
+typedef struct _EFI_SIO_PROTOCOL EFI_SIO_PROTOCOL;
+
+
+//**********************************************************************
+//<AMI_SHDR_START>
+//
+// Name: EFI_SIO_REGISTER_ACCESS
+//
+// Description: Provides a low level access to the registers for the Super I/O.
+//
+// Input:
+// This Indicates a pointer to the calling context.
+// Write Specifies the type of the register operation. If this parameter is TRUE, Value is
+// interpreted as an input parameter and the operation is a register write. If this parameter
+// is FALSE, Value is interpreted as an output parameter and the operation is a register
+// read.
+// ExitCfgMode Exit Configuration Mode Indicator. If this parameter is set to TRUE, the Super I/O
+// driver will turn off configuration mode of the Super I/O prior to returning from this
+// function. If this parameter is set to FALSE, the Super I/O driver will leave Super I/O
+// in the configuration mode.
+// The Super I/O driver must track the current state of the Super I/O and enable the
+// configuration mode of Super I/O if necessary prior to register access.
+// Register Register number.
+// Value If Write is TRUE, Value is a pointer to the buffer containing the byte of data to be
+// written to the Super I/O register. If Write is FALSE, Value is a pointer to the
+// destination buffer for the byte of data to be read from the Super I/O register.
+//
+// Output:
+// EFI_SUCCESS The operation completed successfully
+// EFI_INVALID_PARAMETER The Value is NULL
+// EFI_INVALID_PARAMETER Invalid Register number
+//
+// Notes:
+//
+//<AMI_SHDR_END>
+//**********************************************************************
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SIO_REGISTER_ACCESS)(
+ IN CONST EFI_SIO_PROTOCOL *This,
+ IN BOOLEAN Write,
+ IN BOOLEAN ExitCfgMode,
+ IN UINT8 Register,
+ IN OUT UINT8 *Value
+);
+
+//**********************************************************************
+//<AMI_SHDR_START>
+//
+// Name: EFI_SIO_GET_RESOURCES
+//
+// Description:
+// Provides an interface to get a list of the current resources consumed by the device in the ACPI
+// Resource Descriptor format.
+//
+// Input:
+// This Indicates a pointer to the calling context.
+// ResourceList A pointer to an ACPI resource descriptor list that defines the current resources used by
+// the device. Type ACPI_RESOURCE_HEADER_PTR is defined in the below.
+//
+// Output:
+// EFI_SUCCESS The operation completed successfully
+// EFI_INVALID_PARAMETER The Value is NULL
+//
+// Notes:
+//
+//<AMI_SHDR_END>
+//**********************************************************************
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SIO_GET_RESOURCES)(
+ IN CONST EFI_SIO_PROTOCOL *This,
+ OUT ACPI_RESOURCE_HEADER_PTR *ResourceList
+);
+
+//**********************************************************************
+//<AMI_SHDR_START>
+//
+// Name: EFI_SIO_SET_RESOURCES
+//
+// Description: Sets the resources for the device.
+//
+// Input:
+// This Indicates a pointer to the calling context.
+// ResourceList A pointer to an ACPI resource descriptor list that defines the current resources used by
+// the device. Type ACPI_RESOURCE_HEADER_PTR is defined in the below.
+//
+// Output:
+// EFI_SUCCESS The operation completed successfully
+// EFI_INVALID_PARAMETER The Value is NULL
+//
+// Notes:
+//
+//<AMI_SHDR_END>
+//**********************************************************************
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SIO_SET_RESOURCES)(
+ IN CONST EFI_SIO_PROTOCOL *This,
+ IN ACPI_RESOURCE_HEADER_PTR ResourceList
+);
+
+//**********************************************************************
+//<AMI_SHDR_START>
+//
+// Name: EFI_SIO_POSSIBLE_RESOURCES
+//
+// Description:
+// Provides a collection of resource descriptor lists. Each resource descriptor list in the collection
+// defines a combination of resources that can potentially be used by the device.
+//
+// Input:
+// This Indicates a pointer to the calling context.
+// ResourceCollection Collection of the resource descriptor lists.
+//
+// Output:
+// EFI_SUCCESS The operation completed successfully
+// EFI_INVALID_PARAMETER The Value is NULL
+//
+// Notes:
+//
+//<AMI_SHDR_END>
+//**********************************************************************
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SIO_POSSIBLE_RESOURCES)(
+ IN CONST EFI_SIO_PROTOCOL *This,
+ OUT ACPI_RESOURCE_HEADER_PTR *ResourceCollection
+);
+
+//**********************************************************************
+//<AMI_SHDR_START>
+//
+// Name: EFI_SIO_MODIFY
+//
+// Description:
+// Provides an interface for a table based programming of the Super I/O registers.
+//
+// The Modify() function provides an interface for table based programming of the Super I/O
+// registers. This function can be used to perform programming of multiple Super I/O registers with a
+// single function call. For each table entry, the Register is read, its content is bitwise ANDed with
+// AndMask, and then ORed with OrMask before being written back to the Register. The Super
+// I/O driver must track the current state of the Super I/O and enable the configuration mode of Super I/
+// O if necessary prior to table processing. Once the table is processed, the Super I/O device has to be
+// returned to the original state.
+//
+// Input:
+// This Indicates a pointer to the calling context.
+// Command A pointer to an array of NumberOfCommands EFI_SIO_REGISTER_MODIFY
+// structures. Each structure specifies a single Super I/O register modify operation. Type
+// EFI_SIO_REGISTER_MODIFY is defined in the "Related Definitions" below.
+// NumberOfCommands Number of elements in the Command array.
+//
+// Output:
+// EFI_SUCCESS The operation completed successfully
+// EFI_INVALID_PARAMETER The Value is NULL
+//
+// Notes:
+//
+//<AMI_SHDR_END>
+//**********************************************************************
+typedef
+EFI_STATUS
+(EFIAPI *EFI_SIO_MODIFY)(
+ IN CONST EFI_SIO_PROTOCOL *This,
+ IN CONST EFI_SIO_REGISTER_MODIFY *Command,
+ IN UINTN NumberOfCommands
+);
+
+typedef struct _EFI_SIO_PROTOCOL {
+ EFI_SIO_REGISTER_ACCESS RegisterAccess;
+ EFI_SIO_GET_RESOURCES GetResources;
+ EFI_SIO_SET_RESOURCES SetResources;
+ EFI_SIO_POSSIBLE_RESOURCES PossibleResources;
+ EFI_SIO_MODIFY Modify;
+}EFI_SIO_PROTOCOL;
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+
+#endif // __EFI_SUPER_IO_PROTOCOL_H__
+
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
diff --git a/Include/Protocol/TcgService.h b/Include/Protocol/TcgService.h
new file mode 100644
index 0000000..2c1cc4c
--- /dev/null
+++ b/Include/Protocol/TcgService.h
@@ -0,0 +1,209 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2009, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/BIN/Core/Include/Protocol/TcgService.h 1 11/19/09 12:51p Felixp $
+//
+// $Revision: 1 $
+//
+// $Date: 11/19/09 12:51p $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Core/Include/Protocol/TcgService.h $
+//
+// 1 11/19/09 12:51p Felixp
+// EFI TCG Protocol
+//
+//**********************************************************************
+//<AMI_FHDR_START>
+//
+// Name: TcgService.c
+//
+// Description: TCG Service Protocol as defined in TCG_EFI_Protocol_1_20_Final
+//
+//<AMI_FHDR_END>
+//**********************************************************************
+#ifndef __TCG_SERVICE_PROTOCOL__H__
+#define __TCG_SERVICE_PROTOCOL__H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+#include <TcgTpm.h>
+
+#define EFI_TCG_PROTOCOL_GUID \
+ {0xf541796d, 0xa62e, 0x4954, 0xa7, 0x75, 0x95, 0x84, 0xf6, 0x1b, 0x9c, 0xdd}
+
+#define EFI_TCG_PLATFORM_PROTOCOL_GUID \
+ { 0x8c4c9a41, 0xbf56, 0x4627, 0x9e, 0xa, 0xc8, 0x38, 0x6d, 0x66, 0x11, 0x5c }
+
+GUID_VARIABLE_DECLARATION(gEfiTcgProtocolGuid,EFI_TCG_PROTOCOL_GUID);
+GUID_VARIABLE_DECLARATION(gEfiTcgPlatformProtocolGuid,EFI_TCG_PLATFORM_PROTOCOL_GUID);
+
+#define TSS_EVENT_DATA_MAX_SIZE 256
+
+#define EFI_CALLING_EFI_APPLICATION \
+ "Calling EFI Application from Boot Option"
+#define EFI_RETURNING_FROM_EFI_APPLICATOIN \
+ "Returning from EFI Application from Boot Option"
+#define EFI_EXIT_BOOT_SERVICES_INVOCATION \
+ "Exit Boot Services Invocation"
+#define EFI_EXIT_BOOT_SERVICES_FAILED \
+ "Exit Boot Services Returned with Failure"
+#define EFI_EXIT_BOOT_SERVICES_SUCCEEDED \
+ "Exit Boot Services Returned with Success"
+
+EFI_FORWARD_DECLARATION (EFI_TCG_PROTOCOL);
+
+//
+// Set structure alignment to 1-byte
+//
+#pragma pack (push, 1)
+
+typedef struct {
+ UINT8 Major;
+ UINT8 Minor;
+ UINT8 RevMajor;
+ UINT8 RevMinor;
+} TCG_VERSION;
+
+typedef struct _TCG_EFI_BOOT_SERVICE_CAPABILITY {
+ UINT8 Size; // Size of this structure
+ TCG_VERSION StructureVersion;
+ TCG_VERSION ProtocolSpecVersion;
+ UINT8 HashAlgorithmBitmap; // Hash algorithms
+ // this protocol is capable of : 01=SHA-1
+ BOOLEAN TPMPresentFlag; // 00h = TPM not present
+ BOOLEAN TPMDeactivatedFlag; // 01h = TPM currently deactivated
+} TCG_EFI_BOOT_SERVICE_CAPABILITY;
+
+typedef UINT32 TCG_ALGORITHM_ID;
+
+//
+// Restore original structure alignment
+//
+#pragma pack (pop)
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_TCG_STATUS_CHECK) (
+ IN EFI_TCG_PROTOCOL *This,
+ OUT TCG_EFI_BOOT_SERVICE_CAPABILITY
+ *ProtocolCapability,
+ OUT UINT32 *TCGFeatureFlags,
+ OUT EFI_PHYSICAL_ADDRESS *EventLogLocation,
+ OUT EFI_PHYSICAL_ADDRESS *EventLogLastEntry
+ );
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_TCG_HASH_ALL) (
+ IN EFI_TCG_PROTOCOL *This,
+ IN UINT8 *HashData,
+ IN UINT64 HashDataLen,
+ IN TCG_ALGORITHM_ID AlgorithmId,
+ IN OUT UINT64 *HashedDataLen,
+ IN OUT UINT8 **HashedDataResult
+ );
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_TCG_LOG_EVENT) (
+ IN EFI_TCG_PROTOCOL *This,
+ IN TCG_PCR_EVENT *TCGLogData,
+ IN OUT UINT32 *EventNumber,
+ IN UINT32 Flags
+ );
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_TCG_PASS_THROUGH_TO_TPM) (
+ IN EFI_TCG_PROTOCOL *This,
+ IN UINT32 TpmInputParameterBlockSize,
+ IN UINT8 *TpmInputParameterBlock,
+ IN UINT32 TpmOutputParameterBlockSize,
+ IN UINT8 *TpmOutputParameterBlock
+ );
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_TCG_HASH_LOG_EXTEND_EVENT) (
+ IN EFI_TCG_PROTOCOL *This,
+ IN EFI_PHYSICAL_ADDRESS HashData,
+ IN UINT64 HashDataLen,
+ IN TCG_ALGORITHM_ID AlgorithmId,
+ IN OUT TCG_PCR_EVENT *TCGLogData,
+ IN OUT UINT32 *EventNumber,
+ OUT EFI_PHYSICAL_ADDRESS *EventLogLastEntry
+ );
+
+typedef struct _EFI_TCG_PROTOCOL {
+ EFI_TCG_STATUS_CHECK StatusCheck;
+ EFI_TCG_HASH_ALL HashAll;
+ EFI_TCG_LOG_EVENT LogEvent;
+ EFI_TCG_PASS_THROUGH_TO_TPM PassThroughToTpm;
+ EFI_TCG_HASH_LOG_EXTEND_EVENT HashLogExtendEvent;
+} EFI_TCG_PROTOCOL;
+
+//
+// EFI TCG Platform Protocol
+//
+typedef
+EFI_STATUS
+(EFIAPI *EFI_TCG_MEASURE_PE_IMAGE) (
+ IN BOOLEAN BootPolicy,
+ IN EFI_PHYSICAL_ADDRESS ImageAddress,
+ IN UINTN ImageSize,
+ IN UINTN LinkTimeBase,
+ IN UINT16 ImageType,
+ IN EFI_HANDLE DeviceHandle,
+ IN EFI_DEVICE_PATH_PROTOCOL *FilePath
+ );
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_TCG_MEASURE_ACTION) (
+ IN CHAR8 *ActionString
+ );
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_TCG_MEASURE_GPT_TABLE) (
+ IN EFI_DEVICE_PATH_PROTOCOL *DevicePath
+ );
+
+typedef struct _EFI_TCG_PLATFORM_PROTOCOL {
+ EFI_TCG_MEASURE_PE_IMAGE MeasurePeImage;
+ EFI_TCG_MEASURE_ACTION MeasureAction;
+ EFI_TCG_MEASURE_GPT_TABLE MeasureGptTable;
+} EFI_TCG_PLATFORM_PROTOCOL;
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2009, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
diff --git a/Include/Protocol/TerminalAmiSerial Protocol.cif b/Include/Protocol/TerminalAmiSerial Protocol.cif
new file mode 100644
index 0000000..44a1ef5
--- /dev/null
+++ b/Include/Protocol/TerminalAmiSerial Protocol.cif
@@ -0,0 +1,8 @@
+<component>
+ name = "TerminalAmiSerial Protocol"
+ category = ModulePart
+ LocalRoot = "Include\Protocol\"
+ RefName = "TerminalAmiSerial Protocol"
+[files]
+"TerminalAmiSerial.h"
+<endComponent>
diff --git a/Include/Protocol/TerminalAmiSerial.h b/Include/Protocol/TerminalAmiSerial.h
new file mode 100644
index 0000000..c67be86
--- /dev/null
+++ b/Include/Protocol/TerminalAmiSerial.h
@@ -0,0 +1,122 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2009, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Pkwy, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+// $Header: /Alaska/BIN/Modules/Terminal/TerminalAmiSerial.h 1 12/12/11 8:37a Rajeshms $
+//
+// $Revision: 1 $
+//
+// $Date: 12/12/11 8:37a $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Modules/Terminal/TerminalAmiSerial.h $
+//
+// 1 12/12/11 8:37a Rajeshms
+// [TAG] EIP71636
+// [Category] New Feature
+// [Description] Implement the AMI_SERIAL_PROTOCOL for non-generic PCI
+// Serial Device.
+// [Files] AmiSerial.c, AmiSerial.sdl, AmiSerial.mak, AmiSerial.chm,
+// AmiSerial.dxs, AmiSerial.cif, Terminal.c, SerialIo.c, TerminalSetup.c,
+// InitTerminalStrings.c, TerminalSetupVar.h, Terminal.cif,
+// TerminalAmiSerial.h, LegacySredir_Setup.c
+//
+//
+//
+//**********************************************************************
+
+//<AMI_FHDR_START>
+//--------------------------------------------------------------------------
+//
+// Name: TerminalAmiSerial.h
+//
+// Description: AMI Serial Protocol Definiton.
+//
+//--------------------------------------------------------------------------
+//<AMI_FHDR_END>
+
+#ifndef _AMI_SERIAL_H_
+#define _AMI_SERIAL_H_
+#ifdef __cplusplus
+extern "C" {
+#endif
+#include <EFI.h>
+#include <Protocol\DevicePath.h>
+
+#define AMI_SERIAL_VENDOR_DEVICE_PATH_GUID \
+ {0x32d1497b,0x288c,0x440a,0x9f,0xc3,0x65,0x1a,0x14,0xef,0xc7,0xb4}
+
+#define AMI_SERIAL_PROTOCOL_GUID \
+ {0x50dc5c90,0x1d33,0x4fd6,0x87,0xe5,0x06,0x3b,0x1d,0xfa,0x21,0x70}
+
+GUID_VARIABLE_DECLARATION(gAmiSerialProtocolGuid,AMI_SERIAL_PROTOCOL_GUID);
+
+typedef struct _AMI_SERIAL_PROTOCOL AMI_SERIAL_PROTOCOL;
+
+typedef VOID (EFIAPI *EFI_SERIAL_GET_BASE_ADDRESS) (
+ IN AMI_SERIAL_PROTOCOL *This,
+ OUT UINT64 *BaseAddress
+);
+
+typedef VOID (EFIAPI *EFI_CHECK_PCI_MMIO) (
+ IN AMI_SERIAL_PROTOCOL *This,
+ OUT BOOLEAN *Pci,
+ OUT BOOLEAN *Mmio
+);
+
+typedef VOID (EFIAPI *EFI_GET_PCI_LOCATION) (
+ IN AMI_SERIAL_PROTOCOL *This,
+ OUT UINTN *Bus,
+ OUT UINTN *Dev,
+ OUT UINTN *Func,
+ OUT UINT8 *Port
+);
+
+typedef VOID (EFIAPI *EFI_GET_SERIAL_IRQ) (
+ IN AMI_SERIAL_PROTOCOL *This,
+ OUT UINT8 *SerialIRQ
+);
+
+struct _AMI_SERIAL_PROTOCOL {
+ EFI_SERIAL_GET_BASE_ADDRESS GetBaseAddress;
+ EFI_CHECK_PCI_MMIO CheckPciMmio;
+ EFI_GET_PCI_LOCATION GetPciLocation;
+ EFI_GET_SERIAL_IRQ GetSerialIRQ;
+};
+
+typedef struct {
+ VENDOR_DEVICE_PATH VendorDevicePath;
+ UINT8 Bus;
+ UINT8 Device;
+ UINT8 Function;
+ UINT8 Port;
+}AMI_SERIAL_VENDOR_DEVICE_PATH;
+
+#ifdef __cplusplus
+}
+#endif
+#endif
+
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2009, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Pkwy, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//********************************************************************** \ No newline at end of file
diff --git a/Include/Protocol/Timer.h b/Include/Protocol/Timer.h
new file mode 100644
index 0000000..d51986f
--- /dev/null
+++ b/Include/Protocol/Timer.h
@@ -0,0 +1,222 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2005, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/BIN/Core/CORE_DXE/ArchProtocol/Timer.h 2 3/13/06 1:45a Felixp $
+//
+// $Revision: 2 $
+//
+// $Date: 3/13/06 1:45a $
+//*****************************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Core/CORE_DXE/ArchProtocol/Timer.h $
+//
+// 2 3/13/06 1:45a Felixp
+//
+// 1 1/28/05 12:44p Felixp
+//
+// 2 1/18/05 3:21p Felixp
+// PrintDebugMessage renamed to Trace
+//
+// 1 12/23/04 9:42a Felixp
+//
+// 1 12/23/04 9:29a Felixp
+//
+// 2 3/17/04 11:11a Robert
+//
+// 1 12/31/03 11:05a Robert
+//
+//*****************************************************************************
+//<AMI_FHDR_START>
+//
+// Name: Timer.h
+//
+// Description: This file contains Data structures and support values for the
+// Timer Architectural Protocol
+//
+//<AMI_FHDR_END>
+//*****************************************************************************
+#ifndef __TIMER_ARCH_PROTOCOL_H__
+#define __TIMER_ARCH_PROTOCOL_H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+#include <EFI.h>
+
+// GUID for the Timer Architectural Protocol
+#define EFI_TIMER_ARCH_PROTOCOL_GUID \
+ { 0x26baccb3, 0x6f42, 0x11d4, 0xbc, 0xe7, 0x00, 0x80, 0xc7, 0x3c, 0x88, 0x81 }
+
+GUID_VARIABLE_DECLARATION(gEfiTimerArchProtocolGuid, EFI_TIMER_ARCH_PROTOCOL_GUID);
+
+// Declare an empty structure for the Timer Architectural Protocol
+typedef struct _EFI_TIMER_ARCH_PROTOCOL EFI_TIMER_ARCH_PROTOCOL;
+
+
+//<AMI_PHDR_START>
+//============================================================================
+// Procedure Type: EFI_TIMER_NOTIFY
+//
+// Description: The function of this type is called when a timer interrupt
+// fires. This function executes at TPL_HIGH_LEVEL.
+//
+// Input:
+// Time - Time since the last timer interrupt in 100 ns units.
+//
+// Output: None
+//
+// Referrals:
+//
+//============================================================================
+//<AMI_PHDR_END>
+typedef
+VOID
+(EFIAPI *EFI_TIMER_NOTIFY) (
+ IN UINT64 Time
+ );
+
+
+//<AMI_PHDR_START>
+//============================================================================
+// Procedure Type: EFI_TIMER_REGISTER_HANDLER
+//
+// Description: The function of this type registers the notify function
+// that will be called if the timer interrupt fires
+//
+// Input:
+// This - The instance of the EFI_TIMER_ARCH_PROTOCOL
+//
+// NotifyFunction - The function to call when a timer interrupt fires
+//
+// Output: EFI_SUCCESS - The timer handler was registered.
+//
+// Referrals:
+//
+//============================================================================
+//<AMI_PHDR_END>
+typedef
+EFI_STATUS
+(EFIAPI *EFI_TIMER_REGISTER_HANDLER) (
+ IN EFI_TIMER_ARCH_PROTOCOL *This,
+ IN EFI_TIMER_NOTIFY NotifyFunction
+);
+
+
+//<AMI_PHDR_START>
+//============================================================================
+// Procedure Type: EFI_TIMER_SET_TIMER_PERIOD
+//
+// Description: The function of this type sets the timer interrupt interval
+// based on the input value in TimerPeriod
+//
+// Input:
+// This - The instance of the EFI_TIMER_ARCH_PROTOCOL
+//
+// TimerPeriod - The rate to program the timer interrupt in 100 nS units.
+//
+// Output: EFI_SUCCESS - The timer handler was registered.
+//
+// Referrals:
+//
+//============================================================================
+//<AMI_PHDR_END>
+typedef
+EFI_STATUS
+(EFIAPI *EFI_TIMER_SET_TIMER_PERIOD) (
+ IN EFI_TIMER_ARCH_PROTOCOL *This,
+ IN UINT64 TimerPeriod
+ );
+
+
+//<AMI_PHDR_START>
+//============================================================================
+// Procedure Type: EFI_TIMER_GET_TIMER_PERIOD
+//
+// Description: The function of this type gets the timer interrupt in
+// 100ns increments
+//
+// Input:
+// This - The instance of the EFI_TIMER_ARCH_PROTOCOL
+//
+// TimerPeriod - Pointer to the timer period in 100 nS units.
+//
+// Output:
+// EFI_SUCCESS - The timer period was returned in TimerPeriod.
+// EFI_INVALID_PARAMETER - TimerPeriod is NULL.
+//
+// Referrals:
+//
+//============================================================================
+//<AMI_PHDR_END>
+typedef
+EFI_STATUS
+(EFIAPI *EFI_TIMER_GET_TIMER_PERIOD) (
+ IN EFI_TIMER_ARCH_PROTOCOL *This,
+ IN UINT64 *TimerPeriod
+ );
+
+
+//<AMI_PHDR_START>
+//============================================================================
+// Procedure Type: EFI_TIMER_GENERATE_SOFT_INTERRUPT
+//
+// Description: The function of this type generates a soft timer interrupt
+//
+// Input:
+// This - The instance of the EFI_TIMER_ARCH_PROTOCOL
+//
+// Output:
+// EFI_SUCCESS - The timer period was returned in TimerPeriod.
+//
+// Referrals:
+//
+//============================================================================
+//<AMI_PHDR_END>
+typedef
+EFI_STATUS
+(EFIAPI *EFI_TIMER_GENERATE_SOFT_INTERRUPT) (
+ IN EFI_TIMER_ARCH_PROTOCOL *This
+ );
+
+
+
+
+
+// Interface for the Timer Architectural Protocol
+typedef struct _EFI_TIMER_ARCH_PROTOCOL {
+ EFI_TIMER_REGISTER_HANDLER RegisterHandler;
+ EFI_TIMER_SET_TIMER_PERIOD SetTimerPeriod;
+ EFI_TIMER_GET_TIMER_PERIOD GetTimerPeriod;
+ EFI_TIMER_GENERATE_SOFT_INTERRUPT GenerateSoftInterrupt;
+} EFI_TIMER_ARCH_PROTOCOL;
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2005, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
diff --git a/Include/Protocol/UgaDraw.h b/Include/Protocol/UgaDraw.h
new file mode 100644
index 0000000..5a046aa
--- /dev/null
+++ b/Include/Protocol/UgaDraw.h
@@ -0,0 +1,145 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2005, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/BIN/Core/Include/Protocol/UgaDraw.h 3 12/20/06 1:46p Felixp $
+//
+// $Revision: 3 $
+//
+// $Date: 12/20/06 1:46p $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Core/Include/Protocol/UgaDraw.h $
+//
+// 3 12/20/06 1:46p Felixp
+// Updated to co-exist with Graphics Output Protocol header
+//
+// 2 3/13/06 1:40a Felixp
+//
+// 1 1/28/05 12:44p Felixp
+//
+// 2 1/18/05 3:22p Felixp
+// PrintDebugMessage renamed to Trace
+//
+// 1 12/23/04 9:41a Felixp
+//
+// 1 11/08/04 1:41p Felixp
+//
+// 3 11/05/04 6:02p Robert
+//
+// 2 11/05/04 5:40p Robert
+//
+// 1 11/05/04 5:34p Robert
+//
+//**********************************************************************
+//<AMI_FHDR_START>
+//
+// Name: UgaDraw_h
+//
+// Description:
+//
+//<AMI_FHDR_END>
+//**********************************************************************
+#ifndef __UGA_DRAW_PROTOCOL_H__
+#define __UGA_DRAW_PROTOCOL_H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+#include <EFI.h>
+
+#define EFI_UGA_DRAW_PROTOCOL_GUID \
+ { 0x982c298b, 0xf4fa, 0x41cb, 0xb8, 0x38, 0x77, 0xaa, 0x68, 0x8f, 0xb8, 0x39 }
+
+GUID_VARIABLE_DECLARATION(gEfiUgaDrawProtocolGuid,EFI_UGA_DRAW_PROTOCOL_GUID);
+
+#ifndef GUID_VARIABLE_DEFINITION
+#include <Protocol/GraphicsOutput.h>
+
+typedef struct _EFI_UGA_DRAW_PROTOCOL EFI_UGA_DRAW_PROTOCOL;
+
+
+//=============================================================================
+// Structure Definitions
+
+typedef EFI_GRAPHICS_OUTPUT_BLT_PIXEL EFI_UGA_PIXEL;
+
+typedef enum {
+ EfiUgaVideoFill,
+ EfiUgaVideoToBltBuffer,
+ EfiUgaBltBufferToVideo,
+ EfiUgaVideoToVideo,
+ EfiUgaBltMax
+ } EFI_UGA_BLT_OPERATION;
+
+//=============================================================================
+// Protocol typedefs
+
+typedef EFI_STATUS (EFIAPI *EFI_UGA_DRAW_PROTOCOL_GET_MODE) (
+ IN EFI_UGA_DRAW_PROTOCOL *This,
+ OUT UINT32 *HorizontalResolution,
+ OUT UINT32 *VerticalResolution,
+ OUT UINT32 *ColorDepth,
+ OUT UINT32 *RefreshRate
+ );
+
+
+typedef EFI_STATUS (EFIAPI *EFI_UGA_DRAW_PROTOCOL_SET_MODE) (
+ IN EFI_UGA_DRAW_PROTOCOL *This,
+ IN UINT32 HorizontalResolution,
+ IN UINT32 VerticalResolution,
+ IN UINT32 ColorDepth,
+ IN UINT32 RefreshRate
+ );
+
+
+typedef EFI_STATUS (EFIAPI *EFI_UGA_DRAW_PROTOCOL_BLT) (
+ IN EFI_UGA_DRAW_PROTOCOL *This,
+ IN OUT EFI_UGA_PIXEL *BltBuffer, OPTIONAL
+ IN EFI_UGA_BLT_OPERATION BltOperation,
+ IN UINTN SourceX,
+ IN UINTN SourceY,
+ IN UINTN DestinationX,
+ IN UINTN DestinationY,
+ IN UINTN Width,
+ IN UINTN Height,
+ IN UINTN Delta OPTIONAL
+ );
+
+typedef struct _EFI_UGA_DRAW_PROTOCOL {
+ EFI_UGA_DRAW_PROTOCOL_GET_MODE GetMode;
+ EFI_UGA_DRAW_PROTOCOL_SET_MODE SetMode;
+ EFI_UGA_DRAW_PROTOCOL_BLT Blt;
+ } EFI_UGA_DRAW_PROTOCOL;
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#endif // #ifndef GUID_VARIABLE_DEFINITION
+#ifdef __cplusplus
+}
+#endif
+#endif
+
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2005, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
diff --git a/Include/Protocol/UnicodeCollation.h b/Include/Protocol/UnicodeCollation.h
new file mode 100644
index 0000000..8db47b8
--- /dev/null
+++ b/Include/Protocol/UnicodeCollation.h
@@ -0,0 +1,173 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2009, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/BIN/Core/Include/Protocol/UnicodeCollation.h 6 6/16/11 3:22p Felixp $
+//
+// $Revision: 6 $
+//
+// $Date: 6/16/11 3:22p $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Core/Include/Protocol/UnicodeCollation.h $
+//
+// 6 6/16/11 3:22p Felixp
+// Surround backward compatibility definitions with #if
+// BACKWARD_COMPATIBLE_MODE
+//
+// 5 5/27/11 5:53p Felixp
+// Headers are updated to improve separation of the Framework and PI
+// interfaces.
+// The definitions that will be removed in the future versions are marked
+// with the comments.
+//
+// 4 8/28/09 12:22p Felixp
+// Support for both UnicodeCollation and UnicodeCollation2 protocols
+// (based on value of the EFI_SPECIFICATION_VERSION SDL token).
+//
+// 3 3/13/06 1:40a Felixp
+//
+// 2 2/15/05 5:01p Felixp
+// SpecialChars array definition removed
+//
+// 1 1/28/05 12:44p Felixp
+//
+// 2 1/18/05 3:22p Felixp
+// PrintDebugMessage renamed to Trace
+//
+// 1 12/23/04 9:41a Felixp
+//
+// 2 12/22/04 4:50p Radhikav
+// removed unwanted comments.
+//
+// 1 10/05/04 2:50p Radhikav
+// Initial check in.
+//
+//**********************************************************************
+//<AMI_FHDR_START>
+//
+// Name: UnicodeCollation.h
+//
+// Description: UnicodeCollation Protocol Definition.
+//
+//<AMI_FHDR_END>
+//***********************************************************************
+#ifndef __UNICODE_COLLATION_PROTOCOL_H__
+#define __UNICODE_COLLATION_PROTOCOL_H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+#include <EFI.h>
+
+#define EFI_UNICODE_COLLATION_PROTOCOL_GUID \
+ { 0x1d85cd7f, 0xf43d, 0x11d2, 0x9a, 0x0c, 0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d }
+
+GUID_VARIABLE_DECLARATION(gEfiUnicodeCollationProtocolGuid,EFI_UNICODE_COLLATION_PROTOCOL_GUID);
+
+typedef struct _EFI_UNICODE_COLLATION_PROTOCOL EFI_UNICODE_COLLATION_PROTOCOL;
+
+// Protocol member functions
+typedef
+INTN
+(EFIAPI *EFI_UNICODE_COLLATION_STRICOLL) (
+ IN EFI_UNICODE_COLLATION_PROTOCOL *This,
+ IN CHAR16 *S1,
+ IN CHAR16 *S2
+ );
+
+typedef
+BOOLEAN
+(EFIAPI *EFI_UNICODE_COLLATION_METAIMATCH) (
+ IN EFI_UNICODE_COLLATION_PROTOCOL *This,
+ IN CHAR16 *String,
+ IN CHAR16 *Pattern
+ );
+
+typedef
+VOID
+(EFIAPI *EFI_UNICODE_COLLATION_STRLWR) (
+ IN EFI_UNICODE_COLLATION_PROTOCOL *This,
+ IN OUT CHAR16 *String
+ );
+
+typedef
+VOID
+(EFIAPI *EFI_UNICODE_COLLATION_STRUPR) (
+ IN EFI_UNICODE_COLLATION_PROTOCOL *This,
+ IN OUT CHAR16 *String
+ );
+
+typedef
+VOID
+(EFIAPI *EFI_UNICODE_COLLATION_FATTOSTR) (
+ IN EFI_UNICODE_COLLATION_PROTOCOL *This,
+ IN UINTN FatSize,
+ IN CHAR8 *Fat,
+ OUT CHAR16 *String
+ );
+
+typedef
+BOOLEAN
+(EFIAPI *EFI_UNICODE_COLLATION_STRTOFAT) (
+ IN EFI_UNICODE_COLLATION_PROTOCOL *This,
+ IN CHAR16 *String,
+ IN UINTN FatSize,
+ OUT CHAR8 *Fat
+ );
+
+struct _EFI_UNICODE_COLLATION_PROTOCOL {
+ EFI_UNICODE_COLLATION_STRICOLL StriColl;
+ EFI_UNICODE_COLLATION_METAIMATCH MetaiMatch;
+ EFI_UNICODE_COLLATION_STRLWR StrLwr;
+ EFI_UNICODE_COLLATION_STRUPR StrUpr;
+ EFI_UNICODE_COLLATION_FATTOSTR FatToStr;
+ EFI_UNICODE_COLLATION_STRTOFAT StrToFat;
+ CHAR8 *SupportedLanguages;
+};
+
+//********************* Unicode Collation 2 Protocol ******************/
+#if EFI_SPECIFICATION_VERSION<=0x20000
+#define EFI_UNICODE_COLLATION_PROTOCOL2_GUID EFI_UNICODE_COLLATION_PROTOCOL_GUID
+#else //if EFI_SPECIFICATION_VERSION
+#define EFI_UNICODE_COLLATION_PROTOCOL2_GUID \
+ {0xa4c751fc, 0x23ae, 0x4c3e, 0x92, 0xe9, 0x49, 0x64, 0xcf, 0x63, 0xf3, 0x49}
+#endif //if EFI_SPECIFICATION_VERSION
+GUID_VARIABLE_DECLARATION(gEfiUnicodeCollation2ProtocolGuid,EFI_UNICODE_COLLATION_PROTOCOL2_GUID);
+
+#if BACKWARD_COMPATIBLE_MODE
+//UEFI 2.3 uses GUID identifier EFI_UNICODE_COLLATION_PROTOCOL2_GUID.
+//According to UEFI naming convension it should be EFI_UNICODE_COLLATION2_PROTOCOL_GUID
+#define EFI_UNICODE_COLLATION2_PROTOCOL_GUID EFI_UNICODE_COLLATION_PROTOCOL2_GUID
+typedef EFI_UNICODE_COLLATION_PROTOCOL EFI_UNICODE_COLLATION2_PROTOCOL;
+#endif
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2009, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
diff --git a/Include/Protocol/UsbHC.h b/Include/Protocol/UsbHC.h
new file mode 100644
index 0000000..6dce813
--- /dev/null
+++ b/Include/Protocol/UsbHC.h
@@ -0,0 +1,468 @@
+//****************************************************************************
+//****************************************************************************
+//** **
+//** (C)Copyright 1985-2015, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Pkwy, Suite 200 Norcross, GA 30093 **
+//** **
+//** Phone (770)-246-8600 **
+//** **
+//****************************************************************************
+//****************************************************************************
+
+//****************************************************************************
+// $Header: /Alaska/SOURCE/Modules/USB/ALASKA/Protocol/UsbHC.h 14 1/27/15 3:46a Wilsonlee $
+//
+// $Revision: 14 $
+//
+// $Date: 1/27/15 3:46a $
+//
+//****************************************************************************
+
+#ifndef _USBHC_INC_
+#define _USBHC_INC_
+
+#include <Protocol\usbIo.h>
+
+typedef enum {
+ EfiUsbPortEnable = 1,
+ EfiUsbPortSuspend = 2,
+ EfiUsbPortReset = 4,
+ EfiUsbPortPower = 8,
+ EfiUsbPortOwner = 13, //(EIP57663+)
+ EfiUsbPortConnectChange = 16,
+ EfiUsbPortEnableChange = 17,
+ EfiUsbPortSuspendChange = 18,
+ EfiUsbPortOverCurrentChange = 19,
+ EfiUsbPortResetChange = 20
+} EFI_USB_PORT_FEATURE;
+
+typedef struct{
+ UINT16 PortStatus;
+ UINT16 PortChangeStatus;
+} EFI_USB_PORT_STATUS;
+
+//**************************************************
+// EFI_USB_PORT_STATUS.PortStatus bit definition
+//**************************************************
+#define USB_PORT_STAT_CONNECTION 0x0001
+#define USB_PORT_STAT_ENABLE 0x0002
+#define USB_PORT_STAT_SUSPEND 0x0004
+#define USB_PORT_STAT_OVERCURRENT 0x0008
+#define USB_PORT_STAT_RESET 0x0010
+#define USB_PORT_STAT_POWER 0x0100
+#define USB_PORT_STAT_LOW_SPEED 0x0200
+#define USB_PORT_STAT_HIGH_SPEED 0x0400
+#define USB_PORT_STAT_SUPER_SPEED 0x0800
+#define USB_PORT_STAT_SUPER_SPEED_PLUS 0x1000
+#define USB_PORT_STAT_OWNER 0x2000
+//**************************************************
+// EFI_USB_PORT_STATUS.PortChangeStatus bit definition
+//**************************************************
+#define USB_PORT_STAT_C_CONNECTION 0x0001
+#define USB_PORT_STAT_C_ENABLE 0x0002
+#define USB_PORT_STAT_C_SUSPEND 0x0004
+#define USB_PORT_STAT_C_OVERCURRENT 0x0008
+#define USB_PORT_STAT_C_RESET 0x0010
+
+
+#define EFI_USB_HC_PROTOCOL_GUID \
+ { \
+ 0xf5089266, 0x1aa0, 0x4953, 0x97, 0xd8, 0x56, 0x2f, 0x8a, 0x73, 0xb5, 0x19 \
+ }
+GUID_VARIABLE_DECLARATION(gEfiUsbHcProtocolGuid, EFI_USB_HC_PROTOCOL_GUID);
+
+#define EFI_USB2_HC_PROTOCOL_GUID \
+ { \
+ 0x3e745226, 0x9818, 0x45b6, 0xa2, 0xac, 0xd7, 0xcd, 0xe, 0x8b, 0xa2, 0xbc \
+ }
+GUID_VARIABLE_DECLARATION(gEfiUsb2HcProtocolGuid, EFI_USB2_HC_PROTOCOL_GUID);
+
+#ifndef GUID_VARIABLE_DEFINITION
+
+typedef struct _EFI_USB_HC_PROTOCOL EFI_USB_HC_PROTOCOL;
+typedef struct _EFI_USB2_HC_PROTOCOL EFI_USB2_HC_PROTOCOL;
+
+typedef enum {
+ EfiUsbHcStateHalt,
+ EfiUsbHcStateOperational,
+ EfiUsbHcStateSuspend,
+ EfiUsbHcStateMaximum
+} EFI_USB_HC_STATE;
+
+#define EFI_USB_HC_RESET_GLOBAL 0x0001
+#define EFI_USB_HC_RESET_HOST_CONTROLLER 0x0002
+
+//
+// Protocol definitions
+//
+typedef
+EFI_STATUS
+(EFIAPI *EFI_USB_HC_PROTOCOL_RESET) (
+ IN EFI_USB_HC_PROTOCOL *This,
+ IN UINT16 Attributes
+ );
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_USB_HC_PROTOCOL_GET_STATE) (
+ IN EFI_USB_HC_PROTOCOL *This,
+ OUT EFI_USB_HC_STATE *State
+ );
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_USB_HC_PROTOCOL_SET_STATE) (
+ IN EFI_USB_HC_PROTOCOL *This,
+ IN EFI_USB_HC_STATE State
+ );
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_USB_HC_PROTOCOL_CONTROL_TRANSFER) (
+ IN EFI_USB_HC_PROTOCOL *This,
+ IN UINT8 DeviceAddress,
+ IN UINT8 IsSlowDevice,
+ IN UINT8 MaximumPacketLength,
+ IN EFI_USB_DEVICE_REQUEST *Request,
+ IN EFI_USB_DATA_DIRECTION TransferDirection,
+ IN OUT VOID *Data OPTIONAL,
+ IN OUT UINTN *DataLength OPTIONAL,
+ IN UINTN TimeOut,
+ OUT UINT32 *TransferResult
+ );
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_USB_HC_PROTOCOL_BULK_TRANSFER) (
+ IN EFI_USB_HC_PROTOCOL *This,
+ IN UINT8 DeviceAddress,
+ IN UINT8 EndPointAddress,
+ IN UINT8 MaximumPacketLength,
+ IN OUT VOID *Data,
+ IN OUT UINTN *DataLength,
+ IN OUT UINT8 *DataToggle,
+ IN UINTN TimeOut,
+ OUT UINT32 *TransferResult
+ );
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_USB_HC_PROTOCOL_ASYNC_INTERRUPT_TRANSFER) (
+ IN EFI_USB_HC_PROTOCOL *This,
+ IN UINT8 DeviceAddress,
+ IN UINT8 EndPointAddress,
+ IN UINT8 IsSlowDevice,
+ IN UINT8 MaxiumPacketLength,
+ IN BOOLEAN IsNewTransfer,
+ IN OUT UINT8 *DataToggle OPTIONAL,
+ IN UINTN PollingInterval OPTIONAL,
+ IN UINTN DataLength OPTIONAL,
+ IN EFI_ASYNC_USB_TRANSFER_CALLBACK CallBackFunction OPTIONAL,
+ IN VOID *Context OPTIONAL
+ );
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_USB_HC_PROTOCOL_SYNC_INTERRUPT_TRANSFER) (
+ IN EFI_USB_HC_PROTOCOL *This,
+ IN UINT8 DeviceAddress,
+ IN UINT8 EndPointAddress,
+ IN UINT8 IsSlowDevice,
+ IN UINT8 MaximumPacketLength,
+ IN OUT VOID *Data,
+ IN OUT UINTN *DataLength,
+ IN OUT UINT8 *DataToggle,
+ IN UINTN TimeOut,
+ OUT UINT32 *TransferResult
+ );
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_USB_HC_PROTOCOL_ISOCHRONOUS_TRANSFER) (
+ IN EFI_USB_HC_PROTOCOL *This,
+ IN UINT8 DeviceAddress,
+ IN UINT8 EndPointAddress,
+ IN UINT8 MaximumPacketLength,
+ IN OUT VOID *Data,
+ IN OUT UINTN DataLength,
+ OUT UINT32 *TransferResult
+ );
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_USB_HC_PROTOCOL_ASYNC_ISOCHRONOUS_TRANSFER) (
+ IN EFI_USB_HC_PROTOCOL *This,
+ IN UINT8 DeviceAddress,
+ IN UINT8 EndPointAddress,
+ IN UINT8 MaximumPacketLength,
+ IN OUT VOID *Data,
+ IN UINTN DataLength,
+ IN EFI_ASYNC_USB_TRANSFER_CALLBACK IsochronousCallBack,
+ IN VOID *Context OPTIONAL
+ );
+
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_USB_HC_PROTOCOL_GET_ROOTHUB_PORT_NUMBER) (
+ IN EFI_USB_HC_PROTOCOL *This,
+ OUT UINT8 *PortNumber
+ );
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_USB_HC_PROTOCOL_GET_ROOTHUB_PORT_STATUS) (
+ IN EFI_USB_HC_PROTOCOL *This,
+ IN UINT8 PortNumber,
+ OUT EFI_USB_PORT_STATUS *PortStatus
+ );
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_USB_HC_PROTOCOL_SET_ROOTHUB_PORT_FEATURE) (
+ IN EFI_USB_HC_PROTOCOL *This,
+ IN UINT8 PortNumber,
+ IN EFI_USB_PORT_FEATURE PortFeature
+ );
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_USB_HC_PROTOCOL_CLEAR_ROOTHUB_PORT_FEATURE) (
+ IN EFI_USB_HC_PROTOCOL *This,
+ IN UINT8 PortNumber,
+ IN EFI_USB_PORT_FEATURE PortFeature
+ );
+
+typedef struct _EFI_USB_HC_PROTOCOL {
+ EFI_USB_HC_PROTOCOL_RESET Reset;
+ EFI_USB_HC_PROTOCOL_GET_STATE GetState;
+ EFI_USB_HC_PROTOCOL_SET_STATE SetState;
+ EFI_USB_HC_PROTOCOL_CONTROL_TRANSFER ControlTransfer;
+ EFI_USB_HC_PROTOCOL_BULK_TRANSFER BulkTransfer;
+ EFI_USB_HC_PROTOCOL_ASYNC_INTERRUPT_TRANSFER AsyncInterruptTransfer;
+ EFI_USB_HC_PROTOCOL_SYNC_INTERRUPT_TRANSFER SyncInterruptTransfer;
+ EFI_USB_HC_PROTOCOL_ISOCHRONOUS_TRANSFER IsochronousTransfer;
+ EFI_USB_HC_PROTOCOL_ASYNC_ISOCHRONOUS_TRANSFER AsyncIsochronousTransfer;
+ EFI_USB_HC_PROTOCOL_GET_ROOTHUB_PORT_NUMBER GetRootHubPortNumber;
+ EFI_USB_HC_PROTOCOL_GET_ROOTHUB_PORT_STATUS GetRootHubPortStatus;
+ EFI_USB_HC_PROTOCOL_SET_ROOTHUB_PORT_FEATURE SetRootHubPortFeature;
+ EFI_USB_HC_PROTOCOL_CLEAR_ROOTHUB_PORT_FEATURE ClearRootHubPortFeature;
+ UINT16 MajorRevision;
+ UINT16 MinorRevision;
+ } EFI_USB_HC_PROTOCOL;
+
+//
+// Forward reference for pure ANSI compatability
+//
+//EFI_FORWARD_DECLARATION (EFI_USB2_HC_PROTOCOL);
+
+#define EFI_USB_HC_RESET_GLOBAL_WITH_DEBUG 0x0004
+#define EFI_USB_HC_RESET_HOST_WITH_DEBUG 0x0008
+
+typedef struct {
+ UINT8 TranslatorHubAddress;
+ UINT8 TranslatorPortNumber;
+} EFI_USB2_HC_TRANSACTION_TRANSLATOR;
+
+//
+// Protocol definitions
+//
+typedef
+EFI_STATUS
+(EFIAPI *EFI_USB2_HC_PROTOCOL_GET_CAPABILITY) (
+ IN EFI_USB2_HC_PROTOCOL *This,
+ OUT UINT8 *MaxSpeed,
+ OUT UINT8 *PortNumber,
+ OUT UINT8 *Is64BitCapable
+ );
+
+#define EFI_USB_SPEED_FULL 0x0000
+#define EFI_USB_SPEED_LOW 0x0001
+#define EFI_USB_SPEED_HIGH 0x0002
+#define EFI_USB_SPEED_SUPER 0x0003
+#define EFI_USB_SPEED_SUPER_PLUS 0x0004
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_USB2_HC_PROTOCOL_RESET) (
+ IN EFI_USB2_HC_PROTOCOL *This,
+ IN UINT16 Attributes
+ );
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_USB2_HC_PROTOCOL_GET_STATE) (
+ IN EFI_USB2_HC_PROTOCOL *This,
+ OUT EFI_USB_HC_STATE *State
+ );
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_USB2_HC_PROTOCOL_SET_STATE) (
+ IN EFI_USB2_HC_PROTOCOL *This,
+ IN EFI_USB_HC_STATE State
+ );
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_USB2_HC_PROTOCOL_CONTROL_TRANSFER) (
+ IN EFI_USB2_HC_PROTOCOL *This,
+ IN UINT8 DeviceAddress,
+ IN UINT8 DeviceSpeed,
+ IN UINTN MaximumPacketLength,
+ IN EFI_USB_DEVICE_REQUEST *Request,
+ IN EFI_USB_DATA_DIRECTION TransferDirection,
+ IN OUT VOID *Data OPTIONAL,
+ IN OUT UINTN *DataLength OPTIONAL,
+ IN UINTN TimeOut,
+ IN EFI_USB2_HC_TRANSACTION_TRANSLATOR *Translator,
+ OUT UINT32 *TransferResult
+ );
+
+#define EFI_USB_MAX_BULK_BUFFER_NUM 10
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_USB2_HC_PROTOCOL_BULK_TRANSFER) (
+ IN EFI_USB2_HC_PROTOCOL *This,
+ IN UINT8 DeviceAddress,
+ IN UINT8 EndPointAddress,
+ IN UINT8 DeviceSpeed,
+ IN UINTN MaximumPacketLength,
+ IN UINT8 DataBuffersNumber,
+ IN OUT VOID *Data[EFI_USB_MAX_BULK_BUFFER_NUM],
+ IN OUT UINTN *DataLength,
+ IN OUT UINT8 *DataToggle,
+ IN UINTN TimeOut,
+ IN EFI_USB2_HC_TRANSACTION_TRANSLATOR *Translator,
+ OUT UINT32 *TransferResult
+ );
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_USB2_HC_PROTOCOL_ASYNC_INTERRUPT_TRANSFER) (
+ IN EFI_USB2_HC_PROTOCOL *This,
+ IN UINT8 DeviceAddress,
+ IN UINT8 EndPointAddress,
+ IN UINT8 DeviceSpeed,
+ IN UINTN MaxiumPacketLength,
+ IN BOOLEAN IsNewTransfer,
+ IN OUT UINT8 *DataToggle,
+ IN UINTN PollingInterval OPTIONAL,
+ IN UINTN DataLength OPTIONAL,
+ IN EFI_USB2_HC_TRANSACTION_TRANSLATOR *Translator,
+ IN EFI_ASYNC_USB_TRANSFER_CALLBACK CallBackFunction OPTIONAL,
+ IN VOID *Context OPTIONAL
+ );
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_USB2_HC_PROTOCOL_SYNC_INTERRUPT_TRANSFER) (
+ IN EFI_USB2_HC_PROTOCOL *This,
+ IN UINT8 DeviceAddress,
+ IN UINT8 EndPointAddress,
+ IN UINT8 DeviceSpeed,
+ IN UINTN MaximumPacketLength,
+ IN OUT VOID *Data,
+ IN OUT UINTN *DataLength,
+ IN OUT UINT8 *DataToggle,
+ IN UINTN TimeOut,
+ IN EFI_USB2_HC_TRANSACTION_TRANSLATOR *Translator,
+ OUT UINT32 *TransferResult
+ );
+
+#define EFI_USB_MAX_ISO_BUFFER_NUM 7
+#define EFI_USB_MAX_ISO_BUFFER_NUM1 2
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_USB2_HC_PROTOCOL_ISOCHRONOUS_TRANSFER) (
+ IN EFI_USB2_HC_PROTOCOL *This,
+ IN UINT8 DeviceAddress,
+ IN UINT8 EndPointAddress,
+ IN UINT8 DeviceSpeed,
+ IN UINTN MaximumPacketLength,
+ IN UINT8 DataBuffersNumber,
+ IN OUT VOID *Data[EFI_USB_MAX_ISO_BUFFER_NUM],
+ IN UINTN DataLength,
+ IN EFI_USB2_HC_TRANSACTION_TRANSLATOR *Translator,
+ OUT UINT32 *TransferResult
+ );
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_USB2_HC_PROTOCOL_ASYNC_ISOCHRONOUS_TRANSFER) (
+ IN EFI_USB2_HC_PROTOCOL *This,
+ IN UINT8 DeviceAddress,
+ IN UINT8 EndPointAddress,
+ IN UINT8 DeviceSpeed,
+ IN UINTN MaximumPacketLength,
+ IN UINT8 DataBuffersNumber,
+ IN OUT VOID *Data[EFI_USB_MAX_ISO_BUFFER_NUM],
+ IN UINTN DataLength,
+ IN EFI_USB2_HC_TRANSACTION_TRANSLATOR *Translator,
+ IN EFI_ASYNC_USB_TRANSFER_CALLBACK IsochronousCallBack,
+ IN VOID *Context OPTIONAL
+ );
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_USB2_HC_PROTOCOL_GET_ROOTHUB_PORT_STATUS) (
+ IN EFI_USB2_HC_PROTOCOL *This,
+ IN UINT8 PortNumber,
+ OUT EFI_USB_PORT_STATUS *PortStatus
+ );
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_USB2_HC_PROTOCOL_SET_ROOTHUB_PORT_FEATURE) (
+ IN EFI_USB2_HC_PROTOCOL *This,
+ IN UINT8 PortNumber,
+ IN EFI_USB_PORT_FEATURE PortFeature
+ );
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_USB2_HC_PROTOCOL_CLEAR_ROOTHUB_PORT_FEATURE) (
+ IN EFI_USB2_HC_PROTOCOL *This,
+ IN UINT8 PortNumber,
+ IN EFI_USB_PORT_FEATURE PortFeature
+ );
+
+typedef struct _EFI_USB2_HC_PROTOCOL {
+ EFI_USB2_HC_PROTOCOL_GET_CAPABILITY GetCapability;
+ EFI_USB2_HC_PROTOCOL_RESET Reset;
+ EFI_USB2_HC_PROTOCOL_GET_STATE GetState;
+ EFI_USB2_HC_PROTOCOL_SET_STATE SetState;
+ EFI_USB2_HC_PROTOCOL_CONTROL_TRANSFER ControlTransfer;
+ EFI_USB2_HC_PROTOCOL_BULK_TRANSFER BulkTransfer;
+ EFI_USB2_HC_PROTOCOL_ASYNC_INTERRUPT_TRANSFER AsyncInterruptTransfer;
+ EFI_USB2_HC_PROTOCOL_SYNC_INTERRUPT_TRANSFER SyncInterruptTransfer;
+ EFI_USB2_HC_PROTOCOL_ISOCHRONOUS_TRANSFER IsochronousTransfer;
+ EFI_USB2_HC_PROTOCOL_ASYNC_ISOCHRONOUS_TRANSFER AsyncIsochronousTransfer;
+ EFI_USB2_HC_PROTOCOL_GET_ROOTHUB_PORT_STATUS GetRootHubPortStatus;
+ EFI_USB2_HC_PROTOCOL_SET_ROOTHUB_PORT_FEATURE SetRootHubPortFeature;
+ EFI_USB2_HC_PROTOCOL_CLEAR_ROOTHUB_PORT_FEATURE ClearRootHubPortFeature;
+ UINT16 MajorRevision;
+ UINT16 MinorRevision;
+} EFI_USB2_HC_PROTOCOL;
+
+#endif // GUID_VARIABLE_DEFINITION
+#endif // _USBHC_INC_
+
+//****************************************************************************
+//****************************************************************************
+//** **
+//** (C)Copyright 1985-2015, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Pkwy, Suite 200 Norcross, GA 30093 **
+//** **
+//** Phone (770)-246-8600 **
+//** **
+//****************************************************************************
+//****************************************************************************
diff --git a/Include/Protocol/UsbIo.h b/Include/Protocol/UsbIo.h
new file mode 100644
index 0000000..9f9378c
--- /dev/null
+++ b/Include/Protocol/UsbIo.h
@@ -0,0 +1,278 @@
+//****************************************************************************
+//****************************************************************************
+//** **
+//** (C)Copyright 1985-2010, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Pkwy, Suite 200 Norcross, GA 30093 **
+//** **
+//** Phone (770)-246-8600 **
+//** **
+//****************************************************************************
+//****************************************************************************
+
+//****************************************************************************
+// $Header: /Alaska/SOURCE/Modules/USB/ALASKA/Protocol/UsbIo.h 9 5/04/12 5:35a Wilsonlee $
+//
+// $Revision: 9 $
+//
+// $Date: 5/04/12 5:35a $
+//
+//****************************************************************************
+
+//<AMI_FHDR_START>
+//----------------------------------------------------------------------------
+//
+// Name: UsbIo.h
+//
+// Description: AMI USB IO interface header file
+//
+//----------------------------------------------------------------------------
+//<AMI_FHDR_END>
+
+
+#ifndef _USBIO_INC_
+#define _USBIO_INC_
+
+#define EFI_USB_IO_PROTOCOL_GUID \
+ { 0x2B2F68D6, 0x0CD2, 0x44cf, 0x8E, 0x8B, 0xBB, 0xA2, 0x0B, 0x1B, 0x5B, 0x75 }
+
+GUID_VARIABLE_DECLARATION(gEfiUsbIoProtocolGuid,EFI_USB_IO_PROTOCOL_GUID);
+
+typedef struct _EFI_USB_IO_PROTOCOL EFI_USB_IO_PROTOCOL;
+
+#pragma pack(push, 1)
+
+//
+// See USB1.1 for detail descrption.
+//
+typedef struct {
+ UINT8 Length;
+ UINT8 DescriptorType;
+ UINT16 BcdUSB;
+ UINT8 DeviceClass;
+ UINT8 DeviceSubClass;
+ UINT8 DeviceProtocol;
+ UINT8 MaxPacketSize0;
+ UINT16 IdVendor;
+ UINT16 IdProduct;
+ UINT16 BcdDevice;
+ UINT8 StrManufacturer;
+ UINT8 StrProduct;
+ UINT8 StrSerialNumber;
+ UINT8 NumConfigurations;
+} EFI_USB_DEVICE_DESCRIPTOR;
+
+typedef struct {
+ UINT8 Length;
+ UINT8 DescriptorType;
+ UINT16 TotalLength;
+ UINT8 NumInterfaces;
+ UINT8 ConfigurationValue;
+ UINT8 Configuration;
+ UINT8 Attributes;
+ UINT8 MaxPower;
+} EFI_USB_CONFIG_DESCRIPTOR;
+
+typedef struct {
+ UINT8 Length;
+ UINT8 DescriptorType;
+ UINT8 InterfaceNumber;
+ UINT8 AlternateSetting;
+ UINT8 NumEndpoints;
+ UINT8 InterfaceClass;
+ UINT8 InterfaceSubClass;
+ UINT8 InterfaceProtocol;
+ UINT8 Interface;
+} EFI_USB_INTERFACE_DESCRIPTOR;
+
+
+// EFI_USB_ENDPOINT_DESCRIPTOR's EndPointAttributes
+// must mask the returned attributes before checking
+#define USB_ENDPOINT_TYPE_MASK 3
+
+#define USB_ENDPOINT_TYPE_CONTROL 0
+#define USB_ENDPOINT_TYPE_ISOCHRONOUS 1
+#define USB_ENDPOINT_TYPE_BULK 2
+#define USB_ENDPOINT_TYPE_INTERRUPT 3
+
+typedef struct {
+ UINT8 Length;
+ UINT8 DescriptorType;
+ UINT8 EndpointAddress;
+ UINT8 Attributes;
+ UINT16 MaxPacketSize;
+ UINT8 Interval;
+} EFI_USB_ENDPOINT_DESCRIPTOR;
+
+typedef struct {
+ UINT8 Length;
+ UINT8 DescriptorType;
+ CHAR16 String[1];
+} EFI_USB_STRING_DESCRIPTOR;
+
+typedef enum {
+ EfiUsbDataIn,
+ EfiUsbDataOut,
+ EfiUsbNoData
+} EFI_USB_DATA_DIRECTION;
+
+//
+// Error code for USB Transfer Results
+//
+#define EFI_USB_NOERROR 0x0000
+#define EFI_USB_ERR_NOTEXECUTE 0x0001
+#define EFI_USB_ERR_STALL 0x0002
+#define EFI_USB_ERR_BUFFER 0x0004
+#define EFI_USB_ERR_BABBLE 0x0008
+#define EFI_USB_ERR_NAK 0x0010
+#define EFI_USB_ERR_CRC 0x0020
+#define EFI_USB_ERR_TIMEOUT 0x0040
+#define EFI_USB_ERR_BITSTUFF 0x0080
+#define EFI_USB_ERR_SYSTEM 0x0100
+
+
+
+typedef struct {
+ UINT8 RequestType;
+ UINT8 Request;
+ UINT16 Value;
+ UINT16 Index;
+ UINT16 Length;
+} EFI_USB_DEVICE_REQUEST;
+
+#pragma pack(pop)
+
+typedef EFI_STATUS (EFIAPI *EFI_ASYNC_USB_TRANSFER_CALLBACK) (
+ IN void *Data,
+ IN UINTN DataLength,
+ IN void *Context,
+ IN UINT32 Status);
+
+typedef EFI_STATUS (EFIAPI *EFI_USB_IO_CONTROL_TRANSFER) (
+ IN EFI_USB_IO_PROTOCOL *This,
+ IN EFI_USB_DEVICE_REQUEST *Request,
+ IN EFI_USB_DATA_DIRECTION Direction,
+ IN UINT32 Timeout,
+ IN OUT void *Data OPTIONAL,
+ IN UINTN DataLength OPTIONAL,
+ OUT UINT32 *Status );
+
+typedef EFI_STATUS (EFIAPI *EFI_USB_IO_BULK_TRANSFER) (
+ IN EFI_USB_IO_PROTOCOL *This,
+ IN UINT8 DeviceEndpoint,
+ IN OUT void *Data,
+ IN OUT UINTN *DataLength,
+ IN UINTN Timeout,
+ OUT UINT32 *Status );
+
+typedef EFI_STATUS (EFIAPI *EFI_USB_IO_ASYNC_INTERRUPT_TRANSFER) (
+ IN EFI_USB_IO_PROTOCOL *This,
+ IN UINT8 DeviceEndpoint,
+ IN BOOLEAN IsNewTransfer,
+ IN UINTN PollingInterval OPTIONAL,
+ IN UINTN DataLength OPTIONAL,
+ IN EFI_ASYNC_USB_TRANSFER_CALLBACK InterruptCallBack OPTIONAL,
+ IN void *Context OPTIONAL );
+
+typedef EFI_STATUS (EFIAPI *EFI_USB_IO_SYNC_INTERRUPT_TRANSFER) (
+ IN EFI_USB_IO_PROTOCOL *This,
+ IN UINT8 DeviceEndpoint,
+ IN OUT void *Data,
+ IN OUT UINTN *DataLength,
+ IN UINTN Timeout,
+ OUT UINT32 *Status );
+
+typedef EFI_STATUS (EFIAPI *EFI_USB_IO_ISOCHRONOUS_TRANSFER) (
+ IN EFI_USB_IO_PROTOCOL *This,
+ IN UINT8 DeviceEndpoint,
+ IN OUT void *Data,
+ IN UINTN DataLength,
+ OUT UINT32 *Status );
+
+typedef EFI_STATUS (EFIAPI *EFI_USB_IO_ASYNC_ISOCHRONOUS_TRANSFER) (
+ IN EFI_USB_IO_PROTOCOL *This,
+ IN UINT8 DeviceEndpoint,
+ IN OUT void *Data,
+ IN UINTN DataLength,
+ IN EFI_ASYNC_USB_TRANSFER_CALLBACK IsochronousCallBack,
+ IN void *Context OPTIONAL );
+
+typedef EFI_STATUS (EFIAPI *EFI_USB_IO_PORT_RESET) ( IN EFI_USB_IO_PROTOCOL *This );
+
+typedef EFI_STATUS (EFIAPI *EFI_USB_IO_GET_DEVICE_DESCRIPTOR) (
+ IN EFI_USB_IO_PROTOCOL *This,
+ OUT EFI_USB_DEVICE_DESCRIPTOR *DeviceDescriptor );
+
+typedef EFI_STATUS (EFIAPI *EFI_USB_IO_GET_CONFIG_DESCRIPTOR) (
+ IN EFI_USB_IO_PROTOCOL *This,
+ OUT EFI_USB_CONFIG_DESCRIPTOR *ConfigurationDescriptor );
+
+typedef EFI_STATUS (EFIAPI *EFI_USB_IO_GET_INTERFACE_DESCRIPTOR) (
+ IN EFI_USB_IO_PROTOCOL *This,
+ OUT EFI_USB_INTERFACE_DESCRIPTOR *InterfaceDescriptor );
+
+typedef EFI_STATUS (EFIAPI *EFI_USB_IO_GET_ENDPOINT_DESCRIPTOR) (
+ IN EFI_USB_IO_PROTOCOL *This,
+ IN UINT8 EndpointIndex,
+ OUT EFI_USB_ENDPOINT_DESCRIPTOR *EndpointDescriptor );
+
+typedef EFI_STATUS (EFIAPI *EFI_USB_IO_GET_STRING_DESCRIPTOR) (
+ IN EFI_USB_IO_PROTOCOL *This,
+ IN UINT16 LangID,
+ IN UINT8 StringID,
+ OUT CHAR16 **String );
+
+typedef EFI_STATUS (EFIAPI *EFI_USB_IO_GET_SUPPORTED_LANGUAGE) (
+ IN EFI_USB_IO_PROTOCOL *This,
+ OUT UINT16 **LangIDTable,
+ OUT UINT16 *TableSize );
+
+
+
+//
+// _EFI_USB_IO_PROTOCOL
+//
+typedef struct _EFI_USB_IO_PROTOCOL {
+ //
+ // IO transfer
+ //
+ EFI_USB_IO_CONTROL_TRANSFER UsbControlTransfer;
+ EFI_USB_IO_BULK_TRANSFER UsbBulkTransfer;
+ EFI_USB_IO_ASYNC_INTERRUPT_TRANSFER UsbAsyncInterruptTransfer;
+ EFI_USB_IO_SYNC_INTERRUPT_TRANSFER UsbSyncInterruptTransfer;
+ EFI_USB_IO_ISOCHRONOUS_TRANSFER UsbIsochronousTransfer;
+ EFI_USB_IO_ASYNC_ISOCHRONOUS_TRANSFER UsbAsyncIsochronousTransfer;
+
+ //
+ // Common device request
+ //
+ EFI_USB_IO_GET_DEVICE_DESCRIPTOR UsbGetDeviceDescriptor;
+ EFI_USB_IO_GET_CONFIG_DESCRIPTOR UsbGetConfigDescriptor;
+ EFI_USB_IO_GET_INTERFACE_DESCRIPTOR UsbGetInterfaceDescriptor;
+ EFI_USB_IO_GET_ENDPOINT_DESCRIPTOR UsbGetEndpointDescriptor;
+ EFI_USB_IO_GET_STRING_DESCRIPTOR UsbGetStringDescriptor;
+ EFI_USB_IO_GET_SUPPORTED_LANGUAGE UsbGetSupportedLanguages;
+
+ //
+ // Reset controller's parent port
+ //
+ EFI_USB_IO_PORT_RESET UsbPortReset;
+} EFI_USB_IO_PROTOCOL;
+
+#endif //_USBIO_INC_
+
+//****************************************************************************
+//****************************************************************************
+//** **
+//** (C)Copyright 1985-2010, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Pkwy, Suite 200 Norcross, GA 30093 **
+//** **
+//** Phone (770)-246-8600 **
+//** **
+//****************************************************************************
+//****************************************************************************
diff --git a/Include/Protocol/UsbPolicy.h b/Include/Protocol/UsbPolicy.h
new file mode 100644
index 0000000..1a326d3
--- /dev/null
+++ b/Include/Protocol/UsbPolicy.h
@@ -0,0 +1,233 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2014, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/SOURCE/Modules/USB/ALASKA/Protocol/UsbPolicy.h 22 12/24/14 10:43p Wilsonlee $
+//
+// $Revision: 22 $
+//
+// $Date: 12/24/14 10:43p $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/SOURCE/Modules/USB/ALASKA/Protocol/UsbPolicy.h $
+//
+// 22 12/24/14 10:43p Wilsonlee
+// [TAG] EIP196287
+// [Category] Improvement
+// [Description] Display info of connected usb controllers and remove or
+// grayed-out some item according the connected usb controller number.
+// [Files] uhcd.c, usbport.c, usb.uni, usb.sd, usbsetup.c,
+// AmiUsbController.h, UsbPolicy.h
+//
+// 21 12/21/12 5:03a Ryanchou
+// [TAG] EIP71730
+// [Category] New Feature
+// [Description] Added OHCI handoff support.
+// [Files] usb.sdl, usbport.c, amiusb.c, usbdef.h, UsbPolicy.h, usb.sd,
+// usb.uni
+//
+// 20 9/04/12 8:01a Wilsonlee
+// [TAG] EIP99882
+// [Category] New Feature
+// [Description] Add the usb setup item and usbpolicyprotocol to enable
+// or disable the usb mass storage driver.
+// [Files] UsbPolicy.h, usb.uni, usb.sd, usbmass.c, usbdef.h,
+// efiusbmass.c, usbport.c, uhcd.c
+//
+// 19 5/03/12 5:11a Ryanchou
+// [TAG] EIP83361
+// [Category] New Feature
+// [Description] Added "USB 2.0 Controller Mode" setup item.
+// [Files] ehci.c, usb.sd, usb.sdl, usb.uni, usbdef.h, UsbPolicy.h,
+// usbport.c
+//
+// 18 8/08/11 5:26a Ryanchou
+// [TAG] EIP60561
+// [Category] New Feature
+// [Description] Add USB timing policy protocol for timing override.
+// [Files] ehci.c, guids.c, ohci.c, uhcd.c, uhci.c usb.c, usbdef.h,
+// usbhub.c, usbmass.c, UsbPolicy.h, usbport.c usbsrc.sdl
+//
+// 17 2/18/11 1:15a Ryanchou
+// [TAG] EIP48184
+// [Category] Improvement
+// [Description] Update files according to the new Setup Customization
+// guidelines.
+// [Files] usb.sd, UsbPolicy.h
+//
+// 16 10/12/10 2:45a Rameshr
+// [TAG]- EIP 44585
+// [Category]-IMPROVEMENT
+// [Description]- Number of maximum supported USB Mass Storage device
+// increased from 8 to 16.
+// [Files]- Uin13.bin, UsbPort.c, UsbInt13.h, Usb.c, Usbdef.h, Uasbmass.c,
+// Usb.sd, usb.uni, UsbSetup.c, UsbSrc.sdl, UsbPolicy.h
+//
+//**********************************************************************
+
+//<AMI_FHDR_START>
+//----------------------------------------------------------------------------
+//
+// Name: UsbPolicy.h
+//
+// Description: Protocol used for USB policy definitions
+//
+//----------------------------------------------------------------------------
+//<AMI_FHDR_END>
+
+#ifndef _AMIUSB_POLICY_PROTOCOL_H_
+#define _AMIUSB_POLICY_PROTOCOL_H_
+
+#define EFI_USB_POLICY_PROTOCOL_GUID \
+ { 0x5859cb76, 0x6bef, 0x468a, 0xbe, 0x2d, 0xb3, 0xdd, 0x1a, 0x27, 0xf0, 0x12 }
+#define USB_TIMING_POLICY_PROTOCOL_GUID \
+ { 0x89e3c1dc, 0xb5e3, 0x4d34, 0xae, 0xad, 0xdd, 0x7e, 0xb2, 0x82, 0x8c, 0x18 }
+
+#ifndef VFRCOMPILE
+typedef enum {
+ USBMASS_EMU_AUTO,
+ USBMASS_EMU_FDD,
+ USBMASS_EMU_FORCED_FDD,
+ USBMASS_EMU_HDD,
+ USBMASS_EMU_CD
+} USBMASS_EMU_TYPE;
+#endif
+
+#define USB_DEVPLCY_STATUS_PRESENT 1
+
+#ifndef TYPEDEF_USB_SUPPORT_SETUP
+#define TYPEDEF_USB_SUPPORT_SETUP
+typedef struct {
+ UINT8 UsbMainSupport;
+ UINT8 UsbLegacySupport;
+ UINT8 UsbEhciHandoff;
+ UINT8 UsbOhciHandoff;
+ UINT8 UsbHotplugFddSupport;
+ UINT8 UsbHotplugHddSupport;
+ UINT8 UsbHotplugCdromSupport;
+ UINT8 UsbEmul6064;
+ UINT8 UsbMassResetDelay;
+ UINT8 UsbControlTimeOut; //(EIP30079+)
+ UINT8 UsbEmu1;
+ UINT8 UsbEmu2;
+ UINT8 UsbEmu3;
+ UINT8 UsbEmu4;
+ UINT8 UsbEmu5;
+ UINT8 UsbEmu6;
+ UINT8 UsbEmu7;
+ UINT8 UsbEmu8;
+ UINT8 UsbEmu9;
+ UINT8 UsbEmu10;
+ UINT8 UsbEmu11;
+ UINT8 UsbEmu12;
+ UINT8 UsbEmu13;
+ UINT8 UsbEmu14;
+ UINT8 UsbEmu15;
+ UINT8 UsbEmu16;
+ UINT8 UsbXhciSupport;
+ UINT8 UsbXhciHandoff;
+ UINT8 PowerGoodDeviceDelay;
+ UINT8 PowerGoodDeviceNumDelay;
+ UINT8 UsbHiSpeedSupport;
+ UINT8 UsbMassDriverSupport; //(EIP99882+)
+} USB_SUPPORT_SETUP;
+#endif
+
+#ifndef TYPEDEF_USB_MASS_DEV_VALID
+#define TYPEDEF_USB_MASS_DEV_VALID
+typedef struct{
+ UINT8 UsbEmu1Valid;
+ UINT8 UsbEmu2Valid;
+ UINT8 UsbEmu3Valid;
+ UINT8 UsbEmu4Valid;
+ UINT8 UsbEmu5Valid;
+ UINT8 UsbEmu6Valid;
+ UINT8 UsbEmu7Valid;
+ UINT8 UsbEmu8Valid;
+ UINT8 UsbEmu9Valid;
+ UINT8 UsbEmu10Valid;
+ UINT8 UsbEmu11Valid;
+ UINT8 UsbEmu12Valid;
+ UINT8 UsbEmu13Valid;
+ UINT8 UsbEmu14Valid;
+ UINT8 UsbEmu15Valid;
+ UINT8 UsbEmu16Valid;
+} USB_MASS_DEV_VALID;
+#endif
+
+#define MAX_USB_MASS 8
+#define SETUP_DATA_HOTPLUG_ENABLED 1
+#define SETUP_DATA_HOTPLUG_DISABLED 2
+#define SETUP_DATA_HOTPLUG_AUTO 3
+#define SETUP_DATA_RESETDELAY_20S 1
+
+#ifndef VFRCOMPILE
+typedef struct _USB_POLICY_PROTOCOL {
+ USB_SUPPORT_SETUP *UsbDevPlcy;
+} EFI_USB_POLICY_PROTOCOL;
+#endif
+
+#define EMULATION_FAKE_INTERFACE 1
+
+#ifndef TYPEDEF_USB_MASS_DEV_NUM
+#define TYPEDEF_USB_MASS_DEV_NUM
+typedef struct {
+ UINT8 UsbMassDevNum;
+ UINT8 IsInteractionAllowed;
+} USB_MASS_DEV_NUM;
+#endif
+
+#ifndef TYPEDEF_USB_CONTROLLER_NUM
+#define TYPEDEF_USB_CONTROLLER_NUM
+typedef struct {
+ UINT8 UhciNum;
+ UINT8 OhciNum;
+ UINT8 EhciNum;
+ UINT8 XhciNum;
+} USB_CONTROLLER_NUM;
+#endif
+
+typedef struct {
+ UINT16 UsbTimingPolicyRevision;
+ UINT16 UsbTimingPolicyLength;
+ UINT16 EhciPortPowerOnDelay;
+ UINT16 EhciPortConnect;
+ UINT16 EhciPortReset;
+ UINT16 OhciHcResetDelay;
+ UINT16 OhciPortEnable;
+ UINT16 OhciHcReset;
+ UINT16 UhciGlobalReset;
+ UINT16 UhciPortEnable;
+ UINT16 HubPortConnect;
+ UINT16 HubPortEnable;
+ UINT16 MassDeviceComeUp;
+ UINT16 RmhPowerOnDelay;
+} USB_TIMING_POLICY;
+
+#endif
+
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2014, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
diff --git a/Include/Protocol/UserCredential.h b/Include/Protocol/UserCredential.h
new file mode 100644
index 0000000..2a324cf
--- /dev/null
+++ b/Include/Protocol/UserCredential.h
@@ -0,0 +1,183 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/BIN/Core/Include/Protocol/UserCredential.h 1 5/13/11 4:37p Artems $
+//
+// $Revision: 1 $
+//
+// $Date: 5/13/11 4:37p $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Core/Include/Protocol/UserCredential.h $
+//
+// 1 5/13/11 4:37p Artems
+//
+//
+//**********************************************************************
+//<AMI_FHDR_START>
+//
+// Name: <UserCredential.h>
+//
+// Description: User credential protocol header file
+//
+//<AMI_FHDR_END>
+//**********************************************************************
+#ifndef __USER_CREDENTIAL__H__
+#define __USER_CREDENTIAL__H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <UefiHii.h>
+#include <Protocol/UserManager.h>
+
+#define EFI_USER_CREDENTIAL_PROTOCOL_GUID \
+ { 0x71ee5e94, 0x65b9, 0x45d5, 0x82, 0x1a, 0x3a, 0x4d, 0x86, 0xcf, 0xe6, 0xbe }
+
+#define EFI_USER_CREDENTIAL_CLASS_UNKNOWN \
+ { 0x5cf32e68, 0x7660, 0x449b, 0x80, 0xe6, 0x7e, 0xa3, 0x6e, 0x03, 0xf6, 0xa8 }
+
+#define EFI_USER_CREDENTIAL_CLASS_PASSWORD \
+ { 0xf8e5058c, 0xccb6, 0x4714, 0xb2, 0x20, 0x3f, 0x7e, 0x3a, 0x64, 0x0b, 0xd1 }
+
+#define EFI_USER_CREDENTIAL_CLASS_SMART_CARD \
+ { 0x5f03ba33, 0x8c6b, 0x4c24, 0xaa, 0x2e, 0x14, 0xa2, 0x65, 0x7b, 0xd4, 0x54 }
+
+#define EFI_USER_CREDENTIAL_CLASS_FINGERPRINT \
+ { 0x32cba21f, 0xf308, 0x4cbc, 0x9a, 0xb5, 0xf5, 0xa3, 0x69, 0x9f, 0x04, 0x4a }
+
+#define EFI_USER_CREDENTIAL_CLASS_HANDPRINT \
+ { 0x5917ef16, 0xf723, 0x4bb9, 0xa6, 0x4b, 0xd8, 0xc5, 0x32, 0xf4, 0xd8, 0xb5 }
+
+#define EFI_USER_CREDENTIAL_CLASS_SECURE_CARD \
+ { 0x8a6b4a83, 0x42fe, 0x45d2, 0xa2, 0xef, 0x46, 0xf0, 0x6c, 0x7d, 0x98, 0x52 }
+
+
+#define EFI_CREDENTIAL_CAPABILITIES_ENROLL 0x0000000000000001
+
+#define EFI_CREDENTIAL_LOGON_FLAG_AUTO 0x00000001
+#define EFI_CREDENTIAL_LOGON_FLAG_DEFAULT 0x00000002
+
+GUID_VARIABLE_DECLARATION(gEfiUserCredentialProtocolGuid, EFI_USER_CREDENTIAL_PROTOCOL_GUID);
+GUID_VARIABLE_DECLARATION(gEfiUserCredentialClassPasswordGuid, EFI_USER_CREDENTIAL_CLASS_PASSWORD);
+
+typedef struct _EFI_USER_CREDENTIAL_PROTOCOL EFI_USER_CREDENTIAL_PROTOCOL;
+
+typedef UINT64 EFI_CREDENTIAL_CAPABILITIES;
+typedef UINT32 EFI_CREDENTIAL_LOGON_FLAGS;
+
+typedef EFI_STATUS
+(EFIAPI *EFI_CREDENTIAL_ENROLL)(
+ IN CONST EFI_USER_CREDENTIAL_PROTOCOL *This,
+ IN EFI_USER_PROFILE_HANDLE User
+);
+
+typedef EFI_STATUS
+(EFIAPI *EFI_CREDENTIAL_FORM)(
+ IN CONST EFI_USER_CREDENTIAL_PROTOCOL *This,
+ OUT EFI_HII_HANDLE *Hii,
+ OUT EFI_GUID *FormSetId,
+ OUT EFI_FORM_ID *FormId
+);
+
+typedef EFI_STATUS
+(EFIAPI *EFI_CREDENTIAL_TILE)(
+ IN CONST EFI_USER_CREDENTIAL_PROTOCOL *This,
+ IN OUT UINTN *Width,
+ IN OUT UINTN *Height,
+ OUT EFI_HII_HANDLE *Hii,
+ OUT EFI_IMAGE_ID *Image
+);
+
+typedef EFI_STATUS
+(EFIAPI *EFI_CREDENTIAL_TITLE)(
+ IN CONST EFI_USER_CREDENTIAL_PROTOCOL *This,
+ OUT EFI_HII_HANDLE *Hii,
+ OUT EFI_STRING_ID *String
+);
+
+typedef EFI_STATUS
+(EFIAPI *EFI_CREDENTIAL_USER)(
+ IN CONST EFI_USER_CREDENTIAL_PROTOCOL *This,
+ IN EFI_USER_PROFILE_HANDLE User,
+ OUT EFI_USER_INFO_IDENTIFIER *Identifier
+);
+
+typedef EFI_STATUS
+(EFIAPI *EFI_CREDENTIAL_SELECT)(
+ IN CONST EFI_USER_CREDENTIAL_PROTOCOL *This,
+ OUT EFI_CREDENTIAL_LOGON_FLAGS *AutoLogon
+);
+
+typedef
+EFI_STATUS (EFIAPI *EFI_CREDENTIAL_DESELECT)(
+ IN CONST EFI_USER_CREDENTIAL_PROTOCOL *This
+);
+
+typedef EFI_STATUS
+(EFIAPI *EFI_CREDENTIAL_DEFAULT)(
+ IN CONST EFI_USER_CREDENTIAL_PROTOCOL *This,
+ OUT EFI_CREDENTIAL_LOGON_FLAGS *AutoLogon
+);
+
+typedef EFI_STATUS
+(EFIAPI *EFI_CREDENTIAL_GET_INFO)(
+ IN CONST EFI_USER_CREDENTIAL_PROTOCOL *This,
+ IN EFI_USER_INFO_HANDLE UserInfo,
+ OUT EFI_USER_INFO *Info,
+ IN OUT UINTN *InfoSize
+);
+
+typedef EFI_STATUS
+(EFIAPI *EFI_CREDENTIAL_GET_NEXT_INFO)(
+ IN CONST EFI_USER_CREDENTIAL_PROTOCOL *This,
+ IN OUT EFI_USER_INFO_HANDLE *UserInfo
+);
+
+struct _EFI_USER_CREDENTIAL_PROTOCOL {
+ EFI_GUID Identifier;
+ EFI_GUID Type;
+ EFI_CREDENTIAL_ENROLL Enroll;
+ EFI_CREDENTIAL_FORM Form;
+ EFI_CREDENTIAL_TILE Tile;
+ EFI_CREDENTIAL_TITLE Title;
+ EFI_CREDENTIAL_USER User;
+ EFI_CREDENTIAL_SELECT Select;
+ EFI_CREDENTIAL_DESELECT Deselect;
+ EFI_CREDENTIAL_DEFAULT Default;
+ EFI_CREDENTIAL_GET_INFO GetInfo;
+ EFI_CREDENTIAL_GET_NEXT_INFO GetNextInfo;
+ EFI_CREDENTIAL_CAPABILITIES Capabilities;
+};
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//********************************************************************** \ No newline at end of file
diff --git a/Include/Protocol/UserManager.h b/Include/Protocol/UserManager.h
new file mode 100644
index 0000000..870727a
--- /dev/null
+++ b/Include/Protocol/UserManager.h
@@ -0,0 +1,281 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/BIN/Core/Include/Protocol/UserManager.h 1 5/13/11 4:36p Artems $
+//
+// $Revision: 1 $
+//
+// $Date: 5/13/11 4:36p $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Core/Include/Protocol/UserManager.h $
+//
+// 1 5/13/11 4:36p Artems
+//
+//
+//**********************************************************************
+//<AMI_FHDR_START>
+//
+// Name: <UserManager.h>
+//
+// Description: User manager protocol header file
+//
+//<AMI_FHDR_END>
+//**********************************************************************
+#ifndef __USER_MANAGER__H__
+#define __USER_MANAGER__H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define EFI_USER_MANAGER_PROTOCOL_GUID \
+ { 0x6fd5b00c, 0xd426, 0x4283, 0x98, 0x87, 0x6c, 0xf5, 0xcf, 0x1c, 0xb1, 0xfe }
+
+#define EFI_EVENT_GROUP_USER_PROFILE_CHANGED \
+ { 0xbaf1e6de, 0x209e, 0x4adb, 0x8d, 0x96, 0xfd, 0x8b, 0x71, 0xf3, 0xf6, 0x83 }
+
+#define EFI_USER_INFO_ACCESS_SETUP_ADMIN_GUID \
+ { 0x85b75607, 0xf7ce, 0x471e, 0xb7, 0xe4, 0x2a, 0xea, 0x5f, 0x72, 0x32, 0xee }
+
+#define EFI_USER_INFO_ACCESS_SETUP_NORMAL_GUID \
+ { 0x1db29ae0, 0x9dcb, 0x43bc, 0x8d, 0x87, 0x5d, 0xa1, 0x49, 0x64, 0xdd, 0xe2 }
+
+#define EFI_USER_INFO_ACCESS_SETUP_RESTRICTED_GUID \
+ { 0xbdb38125, 0x4d63, 0x49f4, 0x82, 0x12, 0x61, 0xcf, 0x5a, 0x19, 0x0a, 0xf8 }
+
+GUID_VARIABLE_DECLARATION(gEfiUserManagerProtocolGuid, EFI_USER_MANAGER_PROTOCOL_GUID);
+GUID_VARIABLE_DECLARATION(gEfiEventUserProfileChangedGuid, EFI_EVENT_GROUP_USER_PROFILE_CHANGED);
+GUID_VARIABLE_DECLARATION(gEfiUserInfoAccessSetupAdminGuid, EFI_USER_INFO_ACCESS_SETUP_ADMIN_GUID);
+GUID_VARIABLE_DECLARATION(gEfiUserInfoAccessSetupNormalGuid, EFI_USER_INFO_ACCESS_SETUP_NORMAL_GUID);
+GUID_VARIABLE_DECLARATION(gEfiUserInfoAccessSetupRestrictedGuid, EFI_USER_INFO_ACCESS_SETUP_RESTRICTED_GUID);
+
+typedef struct _EFI_USER_MANAGER_PROTOCOL EFI_USER_MANAGER_PROTOCOL;
+
+typedef VOID *EFI_USER_PROFILE_HANDLE;
+typedef VOID *EFI_USER_INFO_HANDLE;
+typedef UINT16 EFI_USER_INFO_ATTRIBS;
+
+#define EFI_USER_INFO_STORAGE 0x000F
+#define EFI_USER_INFO_STORAGE_VOLATILE 0x0000
+#define EFI_USER_INFO_STORAGE_CREDENTIAL_NV 0x0001
+#define EFI_USER_INFO_STORAGE_PLATFORM_NV 0x0002
+
+#define EFI_USER_INFO_ACCESS 0x0070
+#define EFI_USER_INFO_PUBLIC 0x0010
+#define EFI_USER_INFO_PRIVATE 0x0020
+#define EFI_USER_INFO_PROTECTED 0x0030
+#define EFI_USER_INFO_EXCLUSIVE 0x0080
+
+#define EFI_USER_INFO_ACCESS_POLICY_RECORD 0x0E
+typedef struct {
+ UINT32 Type;
+ UINT32 Size;
+} EFI_USER_INFO_ACCESS_CONTROL;
+typedef EFI_USER_INFO_ACCESS_CONTROL EFI_USER_INFO_ACCESS_POLICY;
+
+#define EFI_USER_INFO_ACCESS_FORBID_LOAD 0x00000001
+#define EFI_USER_INFO_ACCESS_PERMIT_LOAD 0x00000002
+#define EFI_USER_INFO_ACCESS_ENROLL_SELF 0x00000003
+#define EFI_USER_INFO_ACCESS_ENROLL_OTHERS 0x00000004
+#define EFI_USER_INFO_ACCESS_MANAGE 0x00000005
+#define EFI_USER_INFO_ACCESS_SETUP 0x00000006
+#define EFI_USER_INFO_ACCESS_FORBID_CONNECT 0x00000007
+#define EFI_USER_INFO_ACCESS_PERMIT_CONNECT 0x00000008
+#define EFI_USER_INFO_ACCESS_BOOT_ORDER 0x00000009
+ typedef UINT32 EFI_USER_INFO_ACCESS_BOOT_ORDER_HDR;
+ #define EFI_USER_INFO_ACCESS_BOOT_ORDER_MASK 0x000F
+ #define EFI_USER_INFO_ACCESS_BOOT_ORDER_INSERT 0x0000
+ #define EFI_USER_INFO_ACCESS_BOOT_ORDER_APPEND 0x0001
+ #define EFI_USER_INFO_ACCESS_BOOT_ORDER_REPLACE 0x0002
+ #define EFI_USER_INFO_ACCESS_BOOT_ORDER_NODEFAULT 0x0010
+
+#define EFI_USER_INFO_CBEFF_RECORD 0x0B
+typedef VOID *EFI_USER_INFO_CBEFF;
+
+#define EFI_USER_INFO_CREATE_DATE_RECORD 0x02
+typedef EFI_TIME EFI_USER_INFO_CREATE_DATE;
+
+#define EFI_USER_INFO_CREDENTIAL_PROVIDER_RECORD 0x08
+typedef EFI_GUID EFI_USER_INFO_CREDENTIAL_PROVIDER;
+
+#define EFI_USER_INFO_CREDENTIAL_PROVIDER_NAME_RECORD 0x09
+typedef CHAR16 *EFI_USER_INFO_CREDENTIAL_PROVIDER_NAME;
+
+#define EFI_USER_INFO_CREDENTIAL_TYPE_RECORD 0x06
+typedef EFI_GUID EFI_USER_INFO_CREDENTIAL_TYPE;
+
+#define EFI_USER_INFO_CREDENTIAL_TYPE_NAME_RECORD 0x07
+typedef CHAR16 *EFI_USER_INFO_CREDENTIAL_TYPE_NAME;
+
+#define EFI_USER_INFO_GUID_RECORD 0xFF
+typedef EFI_GUID EFI_USER_INFO_GUID;
+
+#define EFI_USER_INFO_FAR_RECORD 0x0C
+typedef UINT8 EFI_USER_INFO_FAR;
+
+#define EFI_USER_INFO_IDENTIFIER_RECORD 0x05
+typedef UINT8 EFI_USER_INFO_IDENTIFIER[16];
+
+#define EFI_USER_INFO_IDENTITY_POLICY_RECORD 0x0F
+typedef struct {
+ UINT32 Type;
+ UINT32 Length;
+} EFI_USER_INFO_IDENTITY_POLICY;
+#define EFI_USER_INFO_IDENTITY_FALSE 0x00
+#define EFI_USER_INFO_IDENTITY_TRUE 0x01
+#define EFI_USER_INFO_IDENTITY_CREDENTIAL_TYPE 0x02
+#define EFI_USER_INFO_IDENTITY_CREDENTIAL_PROVIDER 0x03
+#define EFI_USER_INFO_IDENTITY_NOT 0x10
+#define EFI_USER_INFO_IDENTITY_AND 0x11
+#define EFI_USER_INFO_IDENTITY_OR 0x12
+
+#define EFI_USER_INFO_NAME_RECORD 0x01
+typedef CHAR16 *EFI_USER_INFO_NAME;
+
+#define EFI_USER_INFO_PKCS11_RECORD 0x0A
+#define EFI_USER_INFO_RETRY_RECORD 0x0D
+typedef UINT8 EFI_USER_INFO_RETRY;
+
+#define EFI_USER_INFO_USAGE_DATE_RECORD 0x03
+typedef EFI_TIME EFI_USER_INFO_USAGE_DATE;
+
+#define EFI_USER_INFO_USAGE_COUNT_RECORD 0x04
+typedef UINT64 EFI_USER_INFO_USAGE_COUNT;
+
+#define EFI_USER_INFO_EMPTY_RECORD 0x00
+
+typedef struct {
+ UINT64 Size;
+} EFI_USER_INFO_TABLE;
+
+typedef struct {
+ EFI_GUID Credential;
+ UINT8 InfoType;
+ UINT8 Reserved1;
+ EFI_USER_INFO_ATTRIBS InfoAttribs;
+ UINT32 InfoSize;
+} EFI_USER_INFO;
+
+typedef EFI_STATUS
+(EFIAPI *EFI_USER_PROFILE_CREATE) (
+ IN CONST EFI_USER_MANAGER_PROTOCOL *This,
+ OUT EFI_USER_PROFILE_HANDLE *User
+);
+
+typedef EFI_STATUS
+(EFIAPI *EFI_USER_PROFILE_DELETE) (
+ IN CONST EFI_USER_MANAGER_PROTOCOL *This,
+ IN EFI_USER_PROFILE_HANDLE User
+);
+
+typedef EFI_STATUS
+(EFIAPI *EFI_USER_PROFILE_GET_NEXT)(
+ IN CONST EFI_USER_MANAGER_PROTOCOL *This,
+ IN OUT EFI_USER_PROFILE_HANDLE *User
+);
+
+typedef EFI_STATUS
+(EFIAPI *EFI_USER_PROFILE_CURRENT)(
+ IN CONST EFI_USER_MANAGER_PROTOCOL *This,
+ OUT EFI_USER_PROFILE_HANDLE *CurrentUser
+);
+
+typedef EFI_STATUS
+(EFIAPI *EFI_USER_PROFILE_IDENTIFY) (
+ IN CONST EFI_USER_MANAGER_PROTOCOL *This,
+ OUT EFI_USER_PROFILE_HANDLE *User
+);
+
+typedef EFI_STATUS
+(EFIAPI *EFI_USER_PROFILE_FIND)(
+ IN CONST EFI_USER_MANAGER_PROTOCOL *This,
+ IN OUT EFI_USER_PROFILE_HANDLE *User,
+ IN OUT EFI_USER_INFO_HANDLE *UserInfo OPTIONAL,
+ IN CONST EFI_USER_INFO *Info,
+ IN UINTN InfoSize
+);
+
+typedef EFI_STATUS
+(EFIAPI *EFI_USER_PROFILE_NOTIFY)(
+ IN CONST EFI_USER_MANAGER_PROTOCOL *This,
+ IN EFI_HANDLE Changed
+);
+
+typedef EFI_STATUS
+(EFIAPI *EFI_USER_PROFILE_GET_INFO)(
+ IN CONST EFI_USER_MANAGER_PROTOCOL *This,
+ IN EFI_USER_PROFILE_HANDLE User,
+ IN EFI_USER_INFO_HANDLE UserInfo,
+ OUT EFI_USER_INFO *Info,
+ IN OUT UINTN *InfoSize
+);
+
+typedef EFI_STATUS
+(EFIAPI *EFI_USER_PROFILE_SET_INFO) (
+ IN CONST EFI_USER_MANAGER_PROTOCOL *This,
+ IN EFI_USER_PROFILE_HANDLE User,
+ IN OUT EFI_USER_INFO_HANDLE *UserInfo,
+ IN CONST EFI_USER_INFO *Info,
+ IN UINTN InfoSize
+);
+
+typedef EFI_STATUS
+(EFIAPI *EFI_USER_PROFILE_DELETE_INFO) (
+ IN CONST EFI_USER_MANAGER_PROTOCOL *This,
+ IN EFI_USER_PROFILE_HANDLE User,
+ IN EFI_USER_INFO_HANDLE UserInfo
+);
+
+typedef EFI_STATUS
+(EFIAPI *EFI_USER_PROFILE_GET_NEXT_INFO)(
+ IN CONST EFI_USER_MANAGER_PROTOCOL *This,
+ IN EFI_USER_PROFILE_HANDLE User,
+ IN OUT EFI_USER_INFO_HANDLE *UserInfo
+);
+
+struct _EFI_USER_MANAGER_PROTOCOL {
+ EFI_USER_PROFILE_CREATE Create;
+ EFI_USER_PROFILE_DELETE Delete;
+ EFI_USER_PROFILE_GET_NEXT GetNext;
+ EFI_USER_PROFILE_CURRENT Current;
+ EFI_USER_PROFILE_IDENTIFY Identify;
+ EFI_USER_PROFILE_FIND Find;
+ EFI_USER_PROFILE_NOTIFY Notify;
+ EFI_USER_PROFILE_GET_INFO GetInfo;
+ EFI_USER_PROFILE_SET_INFO SetInfo;
+ EFI_USER_PROFILE_DELETE_INFO DeleteInfo;
+ EFI_USER_PROFILE_GET_NEXT_INFO GetNextInfo;
+};
+
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//********************************************************************** \ No newline at end of file
diff --git a/Include/Protocol/Variable.h b/Include/Protocol/Variable.h
new file mode 100644
index 0000000..7e5ee35
--- /dev/null
+++ b/Include/Protocol/Variable.h
@@ -0,0 +1,80 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2005, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/BIN/Core/CORE_DXE/ArchProtocol/Variable.h 3 3/13/06 1:45a Felixp $
+//
+// $Revision: 3 $
+//
+// $Date: 3/13/06 1:45a $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Core/CORE_DXE/ArchProtocol/Variable.h $
+//
+// 3 3/13/06 1:45a Felixp
+//
+// 2 3/04/05 10:43a Mandal
+//
+// 1 1/28/05 12:44p Felixp
+//
+// 2 1/18/05 3:21p Felixp
+// PrintDebugMessage renamed to Trace
+//
+// 1 12/23/04 9:42a Felixp
+//
+// 1 12/23/04 9:29a Felixp
+//
+// 1 3/30/04 2:24a Felixp
+//
+//**********************************************************************
+//<AMI_FHDR_START>
+//
+// Name: Variable.h
+//
+// Description: Variable Architectural Protocol Definitions
+//
+//<AMI_FHDR_END>
+//**********************************************************************
+#ifndef __VARIABLE_ARCH_PROTOCOL_H__
+#define __VARIABLE_ARCH_PROTOCOL_H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+#include <EFI.h>
+
+#define EFI_VARIABLE_ARCH_PROTOCOL_GUID \
+ {0x1e5668e2,0x8481,0x11d4,0xbc,0xf1,0x0,0x80,0xc7,0x3c,0x88,0x81}
+
+#define EFI_VARIABLE_WRITE_ARCH_PROTOCOL_GUID \
+ {0x6441f818,0x6362,0x4e44,0xb5,0x70,0x7d,0xba,0x31,0xdd,0x24,0x53}
+
+GUID_VARIABLE_DECLARATION(gEfiVariableArchProtocolGuid, EFI_VARIABLE_ARCH_PROTOCOL_GUID);
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2005, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
diff --git a/Include/Protocol/WatchdogTimer.h b/Include/Protocol/WatchdogTimer.h
new file mode 100644
index 0000000..4b10e1b
--- /dev/null
+++ b/Include/Protocol/WatchdogTimer.h
@@ -0,0 +1,224 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2005, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+//**********************************************************************
+// $Header: /Alaska/BIN/Core/CORE_DXE/ArchProtocol/WatchdogTimer.h 1 3/13/06 1:45a Felixp $
+//
+// $Revision: 1 $
+//
+// $Date: 3/13/06 1:45a $
+//*****************************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Core/CORE_DXE/ArchProtocol/WatchdogTimer.h $
+//
+// 1 3/13/06 1:45a Felixp
+//
+// 1 1/28/05 12:44p Felixp
+//
+// 2 1/18/05 3:21p Felixp
+// PrintDebugMessage renamed to Trace
+//
+// 1 12/23/04 9:42a Felixp
+//
+// 1 12/23/04 9:29a Felixp
+//
+// 3 3/29/04 5:16p Felixp
+//
+// 2 3/25/04 5:09p Robert
+// Updated the watchdog protocols with correct values from the
+// specification
+//
+// 1 12/31/03 11:05a Robert
+//
+//*****************************************************************************
+//<AMI_FHDR_START>
+//
+// Name: WatchdogTimer.h
+//
+// Description: This file contains Data structures and support values for the
+// Watchdog Timer Architectural Protocol
+//
+//<AMI_FHDR_END>
+//*****************************************************************************
+#ifndef __WATCHDOG_TIMER_ARCH_PROTOCOL_H__
+#define __WATCHDOG_TIMER_ARCH_PROTOCOL_H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+#include <EFI.h>
+
+// GUID for the Timer Architectural Protocol
+#define EFI_WATCHDOG_TIMER_ARCH_PROTOCOL_GUID \
+ { 0x665E3FF5, 0x46CC, 0x11D4, 0x9A, 0x38, 0x00, 0x90, 0x27, 0x3F, 0xC1, 0x4D }
+
+GUID_VARIABLE_DECLARATION(gEfiWatchdogTimerArchProtocolGuid, EFI_WATCHDOG_TIMER_ARCH_PROTOCOL_GUID);
+
+// Declare an empty structure for the Timer Architectural Protocol
+typedef struct _EFI_WATCHDOG_TIMER_ARCH_PROTOCOL EFI_WATCHDOG_TIMER_ARCH_PROTOCOL;
+
+
+//<AMI_PHDR_START>
+//============================================================================
+// Procedure Type: EFI_WATCHDOG_TIMER_NOTIFY
+//
+// Description: The function of this type is called from the Watchdog Notify
+// function. This is the type defnition of the Registered Handler.
+//
+// Input:
+// Time - Time since the last timer interrupt in 100 ns units.
+//
+// Output: None
+//
+// Referrals:
+//
+//============================================================================
+//<AMI_PHDR_END>
+typedef
+VOID
+(EFIAPI *EFI_WATCHDOG_TIMER_NOTIFY) (
+ IN UINT64 Timer
+ );
+
+
+//<AMI_PHDR_START>
+//============================================================================
+// Procedure Type: EFI_WATCHDOG_NOTIFY
+//
+// Description: The function of this type is called when the watchdog Event
+// is signalled
+//
+// Input:
+// Time - Time since the last timer interrupt in 100 ns units.
+//
+// Output: None
+//
+// Referrals:
+//
+//============================================================================
+//<AMI_PHDR_END>
+typedef
+VOID
+(EFIAPI *EFI_WATCHDOG_NOTIFY) (
+ IN EFI_EVENT Event,
+ IN VOID *Context
+ );
+
+
+//<AMI_PHDR_START>
+//============================================================================
+// Procedure Type: EFI_WATCHDOG_TIMER_REGISTER_HANDLER
+//
+// Description: The function of this type registers the notify function
+// that will be called if the timer interrupt fires
+//
+// Input:
+// This - The instance of the EFI_WATCHDOG_TIMER_ARCH_PROTOCOL
+//
+// NotifyFunction - The function to call when a timer interrupt fires
+//
+// Output: EFI_SUCCESS - The timer handler was registered.
+//
+// Referrals:
+//
+//============================================================================
+//<AMI_PHDR_END>
+typedef
+EFI_STATUS
+(EFIAPI *EFI_WATCHDOG_TIMER_REGISTER_HANDLER) (
+ IN EFI_WATCHDOG_TIMER_ARCH_PROTOCOL *This,
+ IN EFI_WATCHDOG_TIMER_NOTIFY NotifyFunction
+);
+
+
+//<AMI_PHDR_START>
+//============================================================================
+// Procedure Type: EFI_WATCHDOG_TIMER_SET_TIMER_PERIOD
+//
+// Description: The function of this type sets the timer interrupt interval
+// based on the input value in TimerPeriod
+//
+// Input:
+// This - The instance of the EFI_WATCHDOG_TIMER_ARCH_PROTOCOL
+//
+// TimerPeriod - The rate to program the timer interrupt in 100 nS units.
+//
+// Output: EFI_SUCCESS - The timer handler was registered.
+//
+// Referrals:
+//
+//============================================================================
+//<AMI_PHDR_END>
+typedef
+EFI_STATUS
+(EFIAPI *EFI_WATCHDOG_TIMER_SET_TIMER_PERIOD) (
+ IN EFI_WATCHDOG_TIMER_ARCH_PROTOCOL *This,
+ IN UINT64 TimerPeriod
+ );
+
+
+//<AMI_PHDR_START>
+//============================================================================
+// Procedure Type: EFI_WATCHDOG_TIMER_GET_TIMER_PERIOD
+//
+// Description: The function of this type gets the timer interrupt in
+// 100ns increments
+//
+// Input:
+// This - The instance of the EFI_WATCHDOG_TIMER_ARCH_PROTOCOL
+//
+// *TimerPeriod - Pointer to the timer period in 100 nS units.
+//
+// Output:
+// EFI_SUCCESS - The timer period was returned in TimerPeriod.
+// EFI_INVALID_PARAMETER - TimerPeriod is NULL.
+//
+// Referrals:
+//
+//============================================================================
+//<AMI_PHDR_END>
+typedef
+EFI_STATUS
+(EFIAPI *EFI_WATCHDOG_TIMER_GET_TIMER_PERIOD) (
+ IN EFI_WATCHDOG_TIMER_ARCH_PROTOCOL *This,
+ IN UINT64 *TimerPeriod
+ );
+
+
+
+
+// Interface for the Timer Architectural Protocol
+typedef struct _EFI_WATCHDOG_TIMER_ARCH_PROTOCOL {
+ EFI_WATCHDOG_TIMER_REGISTER_HANDLER RegisterHandler;
+ EFI_WATCHDOG_TIMER_SET_TIMER_PERIOD SetTimerPeriod;
+ EFI_WATCHDOG_TIMER_GET_TIMER_PERIOD GetTimerPeriod;
+} EFI_WATCHDOG_TIMER_ARCH_PROTOCOL;
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2005, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
diff --git a/Include/Protocol/sbProtocols.CIF b/Include/Protocol/sbProtocols.CIF
new file mode 100644
index 0000000..77e8de5
--- /dev/null
+++ b/Include/Protocol/sbProtocols.CIF
@@ -0,0 +1,14 @@
+<component>
+ name = "SB Protocols"
+ category = ModulePart
+ LocalRoot = "INCLUDE\Protocol"
+ RefName = "SB Protocols"
+[files]
+"PIDEController.h"
+"SmmBiosWriteDispatch.h"
+"SBSmiProtocol.h"
+"SmmIoTrapDispatch.h"
+"SmmPchIoTrapDispatch2.h"
+"SBPlatformData.h"
+"SbHpet.h"
+<endComponent>
diff --git a/Include/Protocol/smiflash.h b/Include/Protocol/smiflash.h
new file mode 100644
index 0000000..2484469
--- /dev/null
+++ b/Include/Protocol/smiflash.h
@@ -0,0 +1,173 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2009, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/SOURCE/Modules/SMIFlash/smiflash.h 9 3/06/12 1:43a Klzhan $
+//
+// $Revision: 9 $
+//
+// $Date: 3/06/12 1:43a $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/SOURCE/Modules/SMIFlash/smiflash.h $
+//
+// 9 3/06/12 1:43a Klzhan
+// Don't update another NVRam region.
+//
+// 8 8/29/11 7:10a Klzhan
+//
+// 7 5/16/11 4:39a Klzhan
+// [TAG] EIP58139
+// [Category] Improvement
+// [Description] Support OA3.0.
+// [Files] SMIFlash.h
+//
+// 6 12/21/09 4:40a Klzhan
+// Improvement : Updated for Aptio Source Enhancement.
+//
+// 5 7/02/09 8:34a Klzhan
+// Improvement: Add a parameter for ME FW Update.
+//
+// 4 3/05/09 1:17p Felixp
+// - Bug fix. EIP 17632.
+// Flash Blocks that do not belong to FV_BB, FV_MAIN, and FV_NVRAM
+// have been reported as boot block.
+// The SmiFlash.c is updated to report these blocks as non critical
+// blocks.
+// The SmiFlash.h header is updated to define non critical block type
+// (NC_BLOCK ).
+// - Headers updated.
+//
+// 3 12/29/06 3:11p Felixp
+// Embedded Controller support added
+//
+// 2 3/02/06 10:31a Davidd
+// Updated BLOCK_DESC array in INFO_BLOCK structure to correct the
+// data corruption problem when calling GetFlashInfo.
+//
+// 1 4/05/05 3:48p Sivagarn
+// Initial Checkin
+//
+//**********************************************************************
+
+#ifndef _EFI_SMI_FLASH_H_
+#define _EFI_SMI_FLASH_H_
+
+#include <token.h>
+
+// {6F2C06A8-D4B4-4a93-9F78-2B480BE80E0F}
+#define EFI_SMI_FLASH_GUID \
+ {0x6f2c06a8,0xd4b4,0x4a93,0x9f,0x78,0x2b,0x48,0xb,0xe8,0xe,0xf}
+
+#define NUMBER_OF_BLOCKS (FLASH_SIZE/FLASH_BLOCK_SIZE)
+
+#define SMIFLASH_ENABLE_FLASH 0x20
+#define SMIFLASH_READ_FLASH 0x21
+#define SMIFLASH_ERASE_FLASH 0x22
+#define SMIFLASH_WRITE_FLASH 0x23
+#define SMIFLASH_DISABLE_FLASH 0x24
+#define SMIFLASH_GET_FLASH_INFO 0x25
+
+#pragma pack(1)
+typedef struct {
+ UINT64 BufAddr;
+ UINT32 BlockAddr; //0 starts at 0xfff0_0000
+ UINT32 BlockSize;
+ UINT8 ErrorCode;
+} FUNC_BLOCK;
+
+typedef struct {
+ UINT32 StartAddress;
+ UINT32 BlockSize;
+ UINT8 Type;
+} BLOCK_DESC;
+
+typedef enum {
+ BOOT_BLOCK
+ ,MAIN_BLOCK
+ ,NV_BLOCK
+#if SMI_FLASH_INTERFACE_VERSION > 10
+ ,EC_BLOCK
+#endif
+ ,NVB_BLOCK
+ ,OA3_FLASH_BLOCK_DESC_TYPE = 0x4A
+ ,NC_BLOCK = 0x80 //Types from NC_BLOCK to 0xFF are reserved for non critical blocks
+} FLASH_BLOCK_TYPE;
+
+typedef struct {
+ UINT32 Length;
+ UINT8 Implemented;
+ UINT8 Version;
+ UINT16 TotalBlocks;
+#if SMI_FLASH_INTERFACE_VERSION > 10
+ UINT32 ECVersionOffset;
+ UINT32 ECVersionMask;
+#endif
+ BLOCK_DESC Blocks[NUMBER_OF_BLOCKS];
+} INFO_BLOCK;
+#pragma pack()
+
+typedef struct _EFI_SMI_FLASH_PROTOCOL EFI_SMI_FLASH_PROTOCOL;
+
+typedef EFI_STATUS (*GET_FLASH_INFO) (
+ IN OUT INFO_BLOCK *InfoBlock
+);
+
+typedef EFI_STATUS (*ENABLE_FLASH) (
+ IN OUT FUNC_BLOCK *FuncBlock
+);
+
+typedef EFI_STATUS (*DISABLE_FLASH) (
+ IN OUT FUNC_BLOCK *FuncBlock
+);
+
+typedef EFI_STATUS (*READ_FLASH) (
+ IN OUT FUNC_BLOCK *FuncBlock
+);
+
+typedef EFI_STATUS (*WRITE_FLASH) (
+ IN OUT FUNC_BLOCK *FuncBlock
+);
+
+typedef EFI_STATUS (*ERASE_FLASH) (
+ IN OUT FUNC_BLOCK *FuncBlock
+);
+
+struct _EFI_SMI_FLASH_PROTOCOL {
+ GET_FLASH_INFO GetFlashInfo;
+ ENABLE_FLASH EnableFlashWrite;
+ DISABLE_FLASH DisableFlashWrite;
+ READ_FLASH ReadFlash;
+ WRITE_FLASH WriteFlash;
+ ERASE_FLASH EraseFlash;
+ UINT32 FlashCapacity;
+};
+
+
+#endif
+
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2009, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
diff --git a/Include/RomLayout.h b/Include/RomLayout.h
new file mode 100644
index 0000000..0bc629b
--- /dev/null
+++ b/Include/RomLayout.h
@@ -0,0 +1,128 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2009, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/BIN/Core/Include/RomLayout.h 5 10/28/11 4:12p Felixp $
+//
+// $Revision: 5 $
+//
+// $Date: 10/28/11 4:12p $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Core/Include/RomLayout.h $
+//
+// 5 10/28/11 4:12p Felixp
+// [TAG] EIP70518
+// [Category] Improvement
+// [Description] New ROM_AREA_VITAL attribute is added to mark areas
+// that are required for the firmware recovery to work.
+//
+// 4 5/13/11 3:46p Artems
+// Added firmware volume attribute "Signed"
+//
+// 3 2/05/11 2:07p Artems
+// Added "OFFSET" field to ROM_LAYOUT structure
+// Added new FV attributes
+//
+// 2 6/09/09 10:08a Felixp
+// Bug fix: typo in ROM_AREA_TYPE definition: 'RomAeraTypeRaw' instead of
+// 'RomAreaTypeRaw'
+//
+// 1 5/08/09 12:21a Felixp
+// ROM Layout structure type and related definitions
+//
+//**********************************************************************
+//<AMI_FHDR_START>
+//
+// Name: RomLayout.h
+//
+// Description: ROM Layout structure type and related definitions
+//
+//<AMI_FHDR_END>
+//**********************************************************************
+#ifndef __ROM_LAYOUT__H__
+#define __ROM_LAYOUT__H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+#include <EFI.h>
+
+#pragma pack(push, 1)
+
+typedef enum {
+ RomAreaTypeFv,
+ RomAreaTypeRaw,
+ RomAreaTypeMax
+} ROM_AREA_TYPE;
+
+typedef struct {
+ EFI_PHYSICAL_ADDRESS Address;
+ UINT32 Offset;
+ UINT32 Size;
+ ROM_AREA_TYPE Type;
+ UINT32 Attributes;
+} ROM_AREA;
+
+#pragma pack(pop)
+
+// The FV will be published early in PEI
+#define ROM_AREA_FV_PEI 0x00000002
+// The FV will be published in PEI after the memory detection
+#define ROM_AREA_FV_PEI_MEM 0x00000004
+// The FV will be published in DXE IPL Entry prior to transition to DXE.
+// The FV published in DXE IPL are not processed by the PEI dispatcher.
+// The FV is visible to DXE IPL, which means it can contain the DXE Core.
+#define ROM_AREA_FV_DXE 0x00000008
+// Reserved for future use
+#define ROM_AREA_FV_BDS 0x00000010
+// The FV will be published in PEI after the memory detection
+// (just like ROM_AREA_FV_PEI_MEM).
+// The FV will be copied to memory prior to the publishing.
+#define ROM_AREA_FV_PEI_SHADOW 0x00000020
+
+// The FV is processed by the PEI dispatcher if either
+// ROM_AREA_FV_PEI, or ROM_AREA_FV_PEI_MEM, or ROM_AREA_FV_PEI_SHADOW
+// attribute is defined.
+// The FV is processed by the DXE dispatcher if ROM_AREA_FV_DXE attribute is defined.
+
+#define ROM_AREA_FV_VERIFY 0x00000040
+#define ROM_AREA_FV_NON_CRITICAL 0x00000080
+#define ROM_AREA_FV_NFV_PRESENT 0x00000100
+#define ROM_AREA_FV_SIGNED 0x00000200
+
+// This area is required to perform a firmware recovery.
+// The firmware recovery will not work if this area is corrupted.
+#define ROM_AREA_VITAL 0x00000400
+
+#define ROM_AREA_FV_PEI_ACCESS (ROM_AREA_FV_PEI | ROM_AREA_FV_PEI_MEM | ROM_AREA_FV_PEI_SHADOW)
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2009, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
diff --git a/Include/RsdpPlusIncludes.cif b/Include/RsdpPlusIncludes.cif
new file mode 100644
index 0000000..7572a26
--- /dev/null
+++ b/Include/RsdpPlusIncludes.cif
@@ -0,0 +1,8 @@
+<component>
+ name = "Rsdp+ Includes"
+ category = ModulePart
+ LocalRoot = "Include"
+ RefName = "RSDP_INCLUDES"
+[files]
+"Protocol\ManageShadowProtocol.h"
+<endComponent> \ No newline at end of file
diff --git a/Include/S3Common.cif b/Include/S3Common.cif
new file mode 100644
index 0000000..39306a5
--- /dev/null
+++ b/Include/S3Common.cif
@@ -0,0 +1,9 @@
+<component>
+ name = "S3Common"
+ category = ModulePart
+ LocalRoot = "Include\"
+ RefName = "S3Common"
+[files]
+"Protocol\S3SaveState.h"
+"Protocol\S3SmmSaveState.h"
+<endComponent>
diff --git a/Include/SMM.h b/Include/SMM.h
new file mode 100644
index 0000000..1594bc6
--- /dev/null
+++ b/Include/SMM.h
@@ -0,0 +1,401 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/Projects/Intel/Haswell/LynxPoint_SharkBay-DT_Crb_1AQQW/Include/SMM.h 2 10/25/12 8:51a Wesleychen $
+//
+// $Revision: 2 $
+//
+// $Date: 10/25/12 8:51a $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/Projects/Intel/Haswell/LynxPoint_SharkBay-DT_Crb_1AQQW/Include/SMM.h $
+//
+// 2 10/25/12 8:51a Wesleychen
+// Update Core to 4.6.5.4.
+//
+// 8 6/22/11 2:39p Markw
+// Add exclusions around typedef EFI_AP_PROCEDURE.
+//
+// 7 2/05/11 1:53p Artems
+// Redesigned to support both PI 0.91 and PI 1.0-1.1 requirements
+//
+// 6 1/16/08 11:51a Markw
+// Add CR4 to save state table.
+//
+// 5 1/08/08 12:09p Markw
+// small reformatting
+//
+// 4 1/08/08 11:54a Markw
+// Add GDTand IDT to EFI_SMI_CPU_STATE.
+//
+// 3 5/25/06 9:53a Markw
+//
+// 2 1/10/06 2:54p Markw
+// Add SMM Mp Service.
+//
+// 1 1/28/05 12:44p Felixp
+//
+// 2 1/18/05 3:21p Felixp
+// PrintDebugMessage renamed to Trace
+//
+// 1 12/23/04 9:41a Felixp
+//
+// 1 2/10/04 10:31a Markw
+//
+// 1 1/26/04 3:25p Markw
+//
+//**********************************************************************
+//<AMI_FHDR_START>
+//
+// Name: Smm.h
+//
+// Description: Smst table definitions.
+//
+//<AMI_FHDR_END>
+//**********************************************************************
+
+#ifndef __SMM__H__
+#define __SMM__H__
+
+#include <efi.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define SMM_SMST_SIGNATURE 'TSMS'
+#define EFI_SMM_SYSTEM_TABLE_REVISION (0<<16) | (0x09)
+
+#define EFI_SMM_CPU_IO_GUID \
+ {0x5f439a0b,0x45d8,0x4682,0xa4,0xf4,0xf0,0x57,0x6b,0x51,0x34,0x41}
+
+GUID_VARIABLE_DECLARATION(gEfiSmmCpuIoGuid,EFI_SMM_CPU_IO_GUID);
+
+typedef struct {
+ UINT8 Reserved1[240];
+ UINT32 CR4;
+ UINT32 Reserved2;
+ UINT32 SMBASE;
+ UINT32 SMMRevId;
+ UINT16 IORestart;
+ UINT16 AutoHALTRestart;
+ UINT8 Reserved3[132];
+ UINT32 GDTBase;
+ UINT8 Reserved4[8];
+ UINT32 IDTBase;
+ UINT8 Reserved5[16];
+ UINT32 ES;
+ UINT32 CS;
+ UINT32 SS;
+ UINT32 DS;
+ UINT32 FS;
+ UINT32 GS;
+ UINT32 LDTBase;
+ UINT32 TR;
+ UINT32 DR7;
+ UINT32 DR6;
+ UINT32 EAX;
+ UINT32 ECX;
+ UINT32 EDX;
+ UINT32 EBX;
+ UINT32 ESP;
+ UINT32 EBP;
+ UINT32 ESI;
+ UINT32 EDI;
+ UINT32 EIP;
+ UINT32 EFLAGS;
+ UINT32 CR3;
+ UINT32 CR0;
+} EFI_SMI_CPU_SAVE_STATE;
+
+typedef struct {
+ UINT64 reserved;
+ UINT64 r1;
+ UINT64 r2;
+ UINT64 r3;
+ UINT64 r4;
+ UINT64 r5;
+ UINT64 r6;
+ UINT64 r7;
+ UINT64 r8;
+ UINT64 r9;
+ UINT64 r10;
+ UINT64 r11;
+ UINT64 r12;
+ UINT64 r13;
+ UINT64 r14;
+ UINT64 r15;
+ UINT64 r16;
+ UINT64 r17;
+ UINT64 r18;
+ UINT64 r19;
+ UINT64 r20;
+ UINT64 r21;
+ UINT64 r22;
+ UINT64 r23;
+ UINT64 r24;
+ UINT64 r25;
+ UINT64 r26;
+ UINT64 r27;
+ UINT64 r28;
+ UINT64 r29;
+ UINT64 r30;
+ UINT64 r31;
+ UINT64 pr;
+ UINT64 b0;
+ UINT64 b1;
+ UINT64 b2;
+ UINT64 b3;
+ UINT64 b4;
+ UINT64 b5;
+ UINT64 b6;
+ UINT64 b7;
+
+ // application registers
+ UINT64 ar_rsc;
+ UINT64 ar_bsp;
+ UINT64 ar_bspstore;
+ UINT64 ar_rnat;
+ UINT64 ar_fcr;
+ UINT64 ar_eflag;
+ UINT64 ar_csd;
+ UINT64 ar_ssd;
+ UINT64 ar_cflg;
+ UINT64 ar_fsr;
+ UINT64 ar_fir;
+ UINT64 ar_fdr;
+ UINT64 ar_ccv;
+ UINT64 ar_unat;
+ UINT64 ar_fpsr;
+ UINT64 ar_pfs;
+ UINT64 ar_lc;
+ UINT64 ar_ec;
+
+ // control registers
+ UINT64 cr_dcr;
+ UINT64 cr_itm;
+ UINT64 cr_iva;
+ UINT64 cr_pta;
+ UINT64 cr_ipsr;
+ UINT64 cr_isr;
+ UINT64 cr_iip;
+ UINT64 cr_ifa;
+ UINT64 cr_itir;
+ UINT64 cr_iipa;
+ UINT64 cr_ifs;
+ UINT64 cr_iim;
+ UINT64 cr_iha;
+
+ // debug registers
+ UINT64 dbr0;
+ UINT64 dbr1;
+ UINT64 dbr2;
+ UINT64 dbr3;
+ UINT64 dbr4;
+ UINT64 dbr5;
+ UINT64 dbr6;
+ UINT64 dbr7;
+ UINT64 ibr0;
+ UINT64 ibr1;
+ UINT64 ibr2;
+ UINT64 ibr3;
+ UINT64 ibr4;
+ UINT64 ibr5;
+ UINT64 ibr6;
+ UINT64 ibr7;
+
+ // virtual registers
+ UINT64 int_nat; // nat bits for R1-R31
+} EFI_PMI_SYSTEM_CONTEXT;
+
+typedef union {
+ EFI_SMI_CPU_SAVE_STATE Ia32SaveState;
+ //P072911: Make this structure is the same with SmmBase.h
+ //EFI_PMI_SYSTEM_CONTEXT ItaniumSaveState;
+} EFI_SMM_CPU_SAVE_STATE;
+
+////////////////////////////////////////////////////////////////////////
+
+typedef struct {
+ UINT16 Fcw;
+ UINT16 Fsw;
+ UINT16 Ftw;
+ UINT16 Opcode;
+ UINT32 Eip;
+ UINT16 Cs;
+ UINT16 Rsvd1;
+ UINT32 DataOffset;
+ UINT16 Ds;
+ UINT8 Rsvd2[10];
+ UINT8 St0Mm0[10], Rsvd3[6];
+ UINT8 St0Mm1[10], Rsvd4[6];
+ UINT8 St0Mm2[10], Rsvd5[6];
+ UINT8 St0Mm3[10], Rsvd6[6];
+ UINT8 St0Mm4[10], Rsvd7[6];
+ UINT8 St0Mm5[10], Rsvd8[6];
+ UINT8 St0Mm6[10], Rsvd9[6];
+ UINT8 St0Mm7[10], Rsvd10[6];
+ UINT8 Rsvd11[22*16];
+} EFI_SMI_OPTIONAL_FPSAVE_STATE;
+
+typedef struct {
+ UINT64 f2[2];
+ UINT64 f3[2];
+ UINT64 f4[2];
+ UINT64 f5[2];
+ UINT64 f6[2];
+ UINT64 f7[2];
+ UINT64 f8[2];
+ UINT64 f9[2];
+ UINT64 f10[2];
+ UINT64 f11[2];
+ UINT64 f12[2];
+ UINT64 f13[2];
+ UINT64 f14[2];
+ UINT64 f15[2];
+ UINT64 f16[2];
+ UINT64 f17[2];
+ UINT64 f18[2];
+ UINT64 f19[2];
+ UINT64 f20[2];
+ UINT64 f21[2];
+ UINT64 f22[2];
+ UINT64 f23[2];
+ UINT64 f24[2];
+ UINT64 f25[2];
+ UINT64 f26[2];
+ UINT64 f27[2];
+ UINT64 f28[2];
+ UINT64 f29[2];
+ UINT64 f30[2];
+ UINT64 f31[2];
+} EFI_PMI_OPTIONAL_FLOATING_POINT_CONTEXT;
+
+typedef union {
+ EFI_SMI_OPTIONAL_FPSAVE_STATE Ia32FpSave;
+ EFI_PMI_OPTIONAL_FLOATING_POINT_CONTEXT ItaniumFpSave;
+} EFI_SMM_FLOATING_POINT_SAVE_STATE;
+
+////////////////////////////////////////////////////////////////////////
+
+typedef EFI_STATUS (EFIAPI *EFI_SMM_HANDLER_ENTRY_POINT) (
+ IN EFI_HANDLE SmmImageHandle,
+ IN OUT VOID *CommunicationBuffer OPTIONAL,
+ IN OUT UINTN *SourceSize OPTIONAL
+);
+
+typedef struct _EFI_SMM_SYSTEM_TABLE EFI_SMM_SYSTEM_TABLE;
+
+typedef EFI_STATUS (EFIAPI *EFI_SMM_INSTALL_CONFIGURATION_TABLE) (
+ IN EFI_SMM_SYSTEM_TABLE *SystemTable,
+ IN EFI_GUID *Guid,
+ IN VOID *Table,
+ IN UINTN TableSize
+);
+
+#ifndef EFI_SMM_IO_WIDTH_DEF
+#define EFI_SMM_IO_WIDTH_DEF
+typedef enum {
+ SMM_IO_UINT8 = 0,
+ SMM_IO_UINT16 = 1,
+ SMM_IO_UINT32 = 2,
+ SMM_IO_UINT64 = 3
+} EFI_SMM_IO_WIDTH;
+#endif
+
+typedef struct _EFI_SMM_CPU_IO_INTERFACE EFI_SMM_CPU_IO_INTERFACE;
+
+typedef EFI_STATUS (EFIAPI * EFI_SMM_CPU_IO) (
+ IN EFI_SMM_CPU_IO_INTERFACE *This,
+ IN EFI_SMM_IO_WIDTH Width,
+ IN UINT64 Address,
+ IN UINTN Count,
+ IN OUT VOID *Buffer
+);
+
+typedef struct {
+ EFI_SMM_CPU_IO Read;
+ EFI_SMM_CPU_IO Write;
+} EFI_SMM_IO_ACCESS;
+
+struct _EFI_SMM_CPU_IO_INTERFACE {
+ EFI_SMM_IO_ACCESS Mem;
+ EFI_SMM_IO_ACCESS Io;
+};
+
+#ifndef EFI_AP_PROCEDURE_TYPE_DEFINED
+#define EFI_AP_PROCEDURE_TYPE_DEFINED
+typedef VOID (*EFI_AP_PROCEDURE) (
+ IN VOID *Buffer
+);
+#endif
+
+typedef EFI_STATUS (EFIAPI *EFI_SMM_STARTUP_THIS_AP) (
+ IN EFI_AP_PROCEDURE Procedure,
+ IN UINTN CpuNumber,
+ IN OUT VOID *ProcArguments OPTIONAL
+);
+
+struct _EFI_SMM_SYSTEM_TABLE {
+ EFI_TABLE_HEADER Hdr;
+ CHAR16 *SmmFirmwareVendor;
+ UINT32 SmmFirmwareRevision;
+
+ EFI_SMM_INSTALL_CONFIGURATION_TABLE SmmInstallConfigurationTable;
+
+ // I/O Services
+ EFI_GUID EfiSmmCpuIoGuid;
+ EFI_SMM_CPU_IO_INTERFACE SmmIo;
+
+ // Runtime memory service
+ EFI_ALLOCATE_POOL SmmAllocatePool;
+ EFI_FREE_POOL SmmFreePool;
+ EFI_ALLOCATE_PAGES SmmAllocatePages;
+ EFI_FREE_PAGES SmmFreePages;
+
+ // Mp service
+ EFI_SMM_STARTUP_THIS_AP SmmStartupThisAp;
+
+ // CPU information records
+ UINTN CurrentlyExecutingCpu;
+ UINTN NumberOfCpus;
+ EFI_SMM_CPU_SAVE_STATE *CpuSaveState;
+ EFI_SMM_FLOATING_POINT_SAVE_STATE *CpuOptionalFloatingPointState;
+
+ // Extensibility table
+ UINTN NumberOfTableEntries;
+ EFI_CONFIGURATION_TABLE *SmmConfigurationTable;
+};
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
diff --git a/Include/Setup.h b/Include/Setup.h
new file mode 100644
index 0000000..121d522
--- /dev/null
+++ b/Include/Setup.h
@@ -0,0 +1,397 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2010, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/BIN/Core/Include/Setup.h 38 8/28/12 4:20p Artems $
+//
+// $Revision: 38 $
+//
+// $Date: 8/28/12 4:20p $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Core/Include/Setup.h $
+//
+// 38 8/28/12 4:20p Artems
+// [TAG] EIP N/A
+// [Category] New Feature
+// [Description] Add infrastructure to support runtime registration of
+// setup controls callbacks
+// [Files] Setup.c Setup.h Setup.cif AmiSetupProtocol.c
+// AmiSetupProtocol.h
+//
+// 37 7/20/12 10:05a Artems
+// [TAG] EIP93520
+// [Category] New Feature
+// [Description] Added new Boot Flow value
+// [Files] Setup.h
+//
+// 36 4/05/11 2:23p Yakovlevs
+// [TAG] EIP 38174
+// [Category] New Feature
+// [Description] Generic support to handle PCI OUT OF RESOURDCES added.
+// [Files] PciBus Module.
+//
+// 35 3/02/11 12:14p Felixp
+// EIP 54862(Enhancement):
+// Setup.h required Setup_SUPPORT to be defined to include AUTOID.h, which
+// was a problem for project that do not use Setup eModule but would like
+// to keep using AUTOID.h
+// The condition of inclusion of the AUTOID.h has been modified. It is
+// updated from #if Setup_SUPPORT to
+// #if Setup_SUPPORT || AUTOID_HEADER_SUPPORT.
+// To use AutioId.h without Setup eModule AUTOID_HEADER_SUPPORT must be
+// defined. It is also necessary to provide a build target that generates
+// AutoId.h
+//
+// 34 2/09/11 12:13p Felixp
+// Minor enhancement(EIP 53617):
+// #include "AMIVfr.h" is replaced with #include <AMIVfr.h> (AMIVfr.h is a
+// system header)
+//
+// 33 6/09/10 10:41p Felixp
+// Setup Customization Support
+//
+// 32 2/24/10 8:20a Felixp
+// FastBoot field is removed.
+//
+// 31 2/10/10 3:50p Felixp
+// declaration of CALLBACK_PARAMETERS is updated
+//
+// 30 2/05/10 1:58p Felixp
+// The definition of the SETUP_ITEM_CALLBACK_HANDLER type is added.
+// The declaration of the GetCallbackParameters functions is added.
+//
+// 29 2/04/10 5:12p Felixp
+// Auto-generated file Build\AutoId.h is included in Setup.h
+//
+// 28 12/14/09 3:10p Aaronp
+//
+// 27 12/14/09 3:02p Aaronp
+// Added macro definition for INTERACTIVE_TEXT for support in UEFI2.1
+//
+// 26 10/13/09 6:00p Felixp
+// Hii.h renamed to UefiHii.h
+//
+// 25 10/09/09 4:28p Felixp
+// UEFI 2.1 related updates.
+//
+// 24 4/18/08 6:35p Felixp
+//
+// 23 1/31/08 11:52a Olegi
+// Numlock field added.
+//
+// 22 8/31/07 3:04p Felixp
+// TSE-specific definitions moved to a separate header AmiVfr.h, which is
+// part of AMITSE module.
+//
+// 21 15/08/07 12:34p Anandakrishnanl
+// Updated the IDE Security Config. structure with HardDisk Security User
+// and Master Password status.
+//
+// 20 25/06/07 5:31p Anandakrishnanl
+// Missed To Fix the Build Error occured after previous Checkin
+//
+// 19 22/06/07 12:47p Anandakrishnanl
+// HardDisk Security Support Module Added.
+// Need ACPI Module and SB Module and under Core\Include we updated
+// Setup.h.
+// Also New IdeBus bin module.
+//
+// 18 6/04/07 6:05p Felixp
+//
+// 16 3/13/07 5:21p Pavell
+// Support for SETUP_ITK_COMPATIBILITY
+//
+// 15 2/12/07 2:33p Felixp
+// Definitions to support AMITSE 1.19.1089 features added.
+//
+// 14 11/10/06 11:42a Felixp
+// clean up
+//
+// 13 10/13/06 2:56p Felixp
+//
+// 12 1/12/06 9:49a Felixp
+//
+// 11 12/05/05 9:30a Felixp
+//
+// 10 12/05/05 9:27a Felixp
+//
+// 9 12/05/05 9:19a Felixp
+// PBA support added
+//
+// 8 11/08/05 5:10a Felixp
+// Password and AMISilentBoot field removed from SETUP_DATA to be
+// complient
+// with TSE 1.15.1044
+//
+// 7 11/07/05 10:10a Felixp
+// support for fast boot (with minimum configuration) added
+//
+// 6 10/05/05 7:04p Felixp
+// new values (supported by TSE 1.15.1033) added
+//
+// 5 9/07/05 2:35p Girim
+// Corrected the SYSTEM_ACCESS_GUID value and code cleanup.
+//
+// 4 7/14/05 3:54p Felixp
+// VFR.h removed.
+// Code moved to Setup.h
+//
+// 5 5/24/05 3:07p Felixp
+// Modular setup framework implemented
+//
+//**********************************************************************
+//<AMI_FHDR_START>
+//
+// Name: Setup.h
+//
+// Description:
+//
+//<AMI_FHDR_END>
+//**********************************************************************
+#ifndef __SETUP__H__
+#define __SETUP__H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+#include <Token.h>
+#ifndef VFRCOMPILE
+#if EFI_SPECIFICATION_VERSION>0x20000
+#include <UefiHii.h>
+#include <Protocol/HiiConfigAccess.h>
+#else
+#include <Protocol/Hii.h>
+#include <Protocol/FormCallBack.h>
+#endif//EFI_SPECIFICATION_VERSION
+#else//VFRCOMPILE
+#include<ControlDefinitions.h>
+#endif//VFRCOMPILE
+#if Setup_SUPPORT || AUTOID_HEADER_SUPPORT
+#include <AutoId.h>
+#endif
+//**********************************************************************//
+// Generic Definitions //
+//**********************************************************************//
+#define SETUP_GUID { 0xEC87D643, 0xEBA4, 0x4BB5, 0xA1, 0xE5, 0x3F, 0x3E, 0x36, 0xB2, 0x0D, 0xA9 }
+
+#if EFI_SPECIFICATION_VERSION > 0x20000
+#define MAIN_FORM_SET_GUID { 0x985eee91, 0xbcac, 0x4238, 0x87, 0x78, 0x57, 0xef, 0xdc, 0x93, 0xf2, 0x4e }
+#define ADVANCED_FORM_SET_GUID { 0xe14f04fa, 0x8706, 0x4353, 0x92, 0xf2, 0x9c, 0x24, 0x24, 0x74, 0x6f, 0x9f }
+#define CHIPSET_FORM_SET_GUID { 0xadfe34c8, 0x9ae1, 0x4f8f, 0xbe, 0x13, 0xcf, 0x96, 0xa2, 0xcb, 0x2c, 0x5b }
+#define BOOT_FORM_SET_GUID { 0x8b33ffe0, 0xd71c, 0x4f82, 0x9c, 0xeb, 0xc9, 0x70, 0x58, 0xc1, 0x3f, 0x8e }
+#define SECURITY_FORM_SET_GUID { 0x981ceaee, 0x931c, 0x4a17, 0xb9, 0xc8, 0x66, 0xc7, 0xbc, 0xfd, 0x77, 0xe1 }
+#define EXIT_FORM_SET_GUID { 0xa43b03dc, 0xc18a, 0x41b1, 0x91, 0xc8, 0x3f, 0xf9, 0xaa, 0xa2, 0x57, 0x13 }
+#else
+#define MAIN_FORM_SET_GUID SETUP_GUID
+#define ADVANCED_FORM_SET_GUID SETUP_GUID
+#define CHIPSET_FORM_SET_GUID SETUP_GUID
+#define BOOT_FORM_SET_GUID SETUP_GUID
+#define SECURITY_FORM_SET_GUID SETUP_GUID
+#define EXIT_FORM_SET_GUID SETUP_GUID
+#endif
+
+#define MAIN_FORM_SET_CLASS 0x01
+#define ADVANCED_FORM_SET_CLASS 0x02
+#define CHIPSET_FORM_SET_CLASS 0x04
+#define BOOT_FORM_SET_CLASS 0x08
+#define SECURITY_FORM_SET_CLASS 0x10
+#define EXIT_FORM_SET_CLASS 0x20
+
+
+#include <SetupDataDefinition.h>
+
+#include <AMIVfr.h>
+
+#ifdef VFRCOMPILE
+//**********************************************************************//
+// VFR Definitions //
+//**********************************************************************//
+#if defined(INVENTORY_SUPPORT) && INVENTORY_SUPPORT == 1
+ #define INVENTORY(Name,Value) \
+ inventory \
+ help = STRING_TOKEN(STR_EMPTY), \
+ text = Name, \
+ text = Value;
+#else
+ #define INVENTORY(Name,Value) \
+ text \
+ help = STRING_TOKEN(STR_EMPTY), \
+ text = Name, \
+ text = Value, \
+ flags = 0, \
+ key = 0;
+#endif
+
+#define SUBTITLE(Text) subtitle text = Text;
+#define SEPARATOR SUBTITLE(STRING_TOKEN(STR_EMPTY))
+
+#define SYSTEM_ACCESS_KEY_ID 0xF000
+
+#if EFI_SPECIFICATION_VERSION>0x20000
+#define INTERACTIVE_TEXT(HelpToken, CaptionToken, ValueToken, Key)\
+ text help = HelpToken,\
+ text = CaptionToken,\
+ text = ValueToken;\
+ suppressif TRUE;\
+ suppressif ideqval AMI_CALLBACK.Value == INTERACTIVE_TEXT_VALUE;\
+ text help = HelpToken,\
+ text = CaptionToken,\
+ text = ValueToken,\
+ flags = INTERACTIVE, key = Key;\
+ endif;\
+ endif;
+#else
+#define INTERACTIVE_TEXT(HelpToken, CaptionToken, ValueToken, Key)\
+ text help = HelpToken,\
+ text = CaptionToken,\
+ text = ValueToken,\
+ flags = INTERACTIVE, key = Key;
+#endif
+
+#if EFI_SPECIFICATION_VERSION>0x20000
+#define SUPPRESS_GRAYOUT_ENDIF endif; endif;
+#else
+#define SUPPRESS_GRAYOUT_ENDIF endif;
+#endif
+//definitions of the standard varstores
+#if EFI_SPECIFICATION_VERSION>0x20000
+#define SETUP_DATA_VARSTORE\
+ varstore SETUP_DATA, name = Setup, guid = SETUP_GUID;
+#define LANGUAGE_VARSTORE\
+ varstore LANGUAGE, key = LANGUAGE_KEY_ID,\
+ name = PlatformLang, guid = EFI_GLOBAL_VARIABLE_GUID;
+#define LANGUAGE_CODES_VARSTORE\
+ varstore LANGUAGE_CODES, key = LANGUAGE_CODES_KEY_ID,\
+ name = PlatformLangCodes, guid = EFI_GLOBAL_VARIABLE_GUID;
+#else //#if EFI_SPECIFICATION_VERSION>0x20000
+#define SETUP_DATA_VARSTORE
+#define LANGUAGE_VARSTORE\
+ varstore LANGUAGE, key = LANGUAGE_KEY_ID,\
+ name = Lang, guid = EFI_GLOBAL_VARIABLE_GUID;
+#define LANGUAGE_CODES_VARSTORE\
+ varstore LANGUAGE_CODES, key = LANGUAGE_CODES_KEY_ID,\
+ name = LangCodes, guid = EFI_GLOBAL_VARIABLE_GUID;
+#endif //#if EFI_SPECIFICATION_VERSION>0x20000
+#define SYSTEM_ACCESS_VARSTORE\
+ varstore SYSTEM_ACCESS, key = SYSTEM_ACCESS_KEY_ID,\
+ name = SystemAccess, guid = SYSTEM_ACCESS_GUID;
+#define AMITSESETUP_VARSTORE\
+ varstore AMITSESETUP, key = AMITSESETUP_KEY,\
+ name = AMITSESetup, guid = AMITSESETUP_GUID;
+#define BOOT_MANAGER_VARSTORE\
+ varstore BOOT_MANAGER, key = BOOT_MANAGER_KEY_ID,\
+ name = BootManager, guid = BOOT_MANAGER_GUID;
+#define TIMEOUT_VARSTORE\
+ varstore TIMEOUT, key = BOOT_TIMEOUT_KEY_ID,\
+ name = Timeout, guid = EFI_GLOBAL_VARIABLE_GUID;
+#define BOOT_ORDER_VARSTORE\
+ varstore BOOT_ORDER, key = BOOT_ORDER_KEY_ID,\
+ name = BootOrder, guid = EFI_GLOBAL_VARIABLE_GUID;
+#define NEW_BOOT_OPTION_VARSTORE\
+ varstore NEW_BOOT_OPTION, key = NEW_BOOT_OPTION_KEY_ID,\
+ name = AddBootOption, guid = ADD_BOOT_OPTION_GUID;
+#define DEL_BOOT_OPTION_VARSTORE\
+ varstore DEL_BOOT_OPTION, key = DEL_BOOT_OPTION_KEY_ID,\
+ name = DelBootOption, guid = DEL_BOOT_OPTION_GUID;
+#define LEGACY_DEV_INFO_VARSTORE\
+ varstore LEGACY_DEV_INFO, key = LEGACY_DEV_KEY_ID,\
+ name = LegacyDev, guid = LEGACY_DEV_ORDER_GUID;
+#define LEGACY_GROUP_INFO_VARSTORE\
+ varstore LEGACY_GROUP_INFO, key = LEGACY_GROUP_KEY_ID,\
+ name = LegacyGroup, guid = LEGACY_DEV_ORDER_GUID;
+#define LEGACY_DEV_ORDER_VARSTORE\
+ varstore LEGACY_DEV_ORDER, key = LEGACY_ORDER_KEY_ID,\
+ name = LegacyDevOrder, guid = LEGACY_DEV_ORDER_GUID;
+#define AMI_CALLBACK_VARSTORE\
+ varstore AMI_CALLBACK, key = AMI_CALLBACK_KEY_ID,\
+ name = AMICallback, guid = AMI_CALLBACK_GUID;
+#define BOOT_NOW_COUNT_VARSTORE\
+ varstore BOOT_NOW_COUNT, key = BOOT_NOW_COUNT_KEY_ID,\
+ name = BootNowCount, guid = BOOT_NOW_COUNT_GUID;
+#define EFI_SHELL_VARSTORE\
+ varstore EFI_SHELL, key = EFI_SHELL_KEY_ID,\
+ name = Shell, guid = EFI_SHELL_FILE_GUID;
+#else // #ifdef VFRCOMPILE
+//**********************************************************************//
+// C Definitions //
+//**********************************************************************//
+//Type of the Setup Callback Handling function registered using
+// ITEM_CALLBACK eLink
+typedef EFI_STATUS (SETUP_ITEM_CALLBACK_HANDLER)(
+ EFI_HII_HANDLE HiiHandle,
+ UINT16 Class,
+ UINT16 SubClass,
+ UINT16 Key
+);
+
+typedef struct{
+ UINT16 Class;
+ UINT16 SubClass;
+ UINT16 Key;
+ SETUP_ITEM_CALLBACK_HANDLER *UpdateItem;
+} SETUP_ITEM_CALLBACK;
+
+#if EFI_SPECIFICATION_VERSION>0x20000
+typedef struct{
+ EFI_HII_CONFIG_ACCESS_PROTOCOL *This;
+ EFI_BROWSER_ACTION Action;
+ EFI_QUESTION_ID KeyValue;
+ UINT8 Type;
+ EFI_IFR_TYPE_VALUE *Value;
+ EFI_BROWSER_ACTION_REQUEST *ActionRequest;
+} CALLBACK_PARAMETERS;
+#else
+typedef struct{
+ EFI_FORM_CALLBACK_PROTOCOL *This;
+ UINT16 KeyValue;
+ EFI_IFR_DATA_ARRAY *Data;
+ EFI_HII_CALLBACK_PACKET **Packet;
+} CALLBACK_PARAMETERS;
+#endif // EFI_SPECIFICATION_VERSION>0x20000
+
+//Defined in the Setup Module
+VOID InitString(EFI_HII_HANDLE HiiHandle, STRING_REF StrRef, CHAR16 *sFormat, ...);
+CALLBACK_PARAMETERS* GetCallbackParameters();
+#endif
+
+//Boot Flow Definitions
+// EF152FB4-7B2F-427D-BDB4-7E0A05826E64
+#define BOOT_FLOW_VARIABLE_GUID \
+ { 0xEF152FB4, 0x7B2F, 0x427D, 0xBD, 0xB4, 0x7E, 0x0A, 0x05, 0x82, 0x6E, 0x64 }
+
+#define BOOT_FLOW_CONDITION_RECOVERY 2
+#define BOOT_FLOW_CONDITION_FIRST_BOOT 4
+#define BOOT_FLOW_CONDITION_PCI_OUT_OF_RESOURCE 9
+#define BOOT_FLOW_CONDITION_OS_UPD_CAP 0xB
+
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2010, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//********************************************************************** \ No newline at end of file
diff --git a/Include/SmBus.h b/Include/SmBus.h
new file mode 100644
index 0000000..0ea31f2
--- /dev/null
+++ b/Include/SmBus.h
@@ -0,0 +1,139 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2009, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+//**********************************************************************
+// $Header: /Alaska/BIN/Core/Include/SmBus.h 2 2/05/11 2:05p Artems $
+//
+// $Revision: 2 $
+//
+// $Date: 2/05/11 2:05p $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Core/Include/SmBus.h $
+//
+// 2 2/05/11 2:05p Artems
+// Added helper macros to simplify SMBUS address handling
+//
+// 1 1/16/09 9:57a Felixp
+// SM Bus Protocol and PPI headers are updated. Common code moved into
+// newly created header file (Include\SmBus.h).
+//
+//**********************************************************************
+//<AMI_FHDR_START>
+//
+// Name: SmBus.h
+//
+// Description: SM BUS data structure declarations
+//
+//<AMI_FHDR_END>
+//**********************************************************************
+#ifndef __SMBUS_MAIN__H__
+#define __SMBUS_MAIN__H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <Efi.h>
+
+#pragma pack(1)
+
+// PEC BIT is bit 22 in SMBUS address
+#define SMBUS_LIB_PEC_BIT (1 << 22)
+
+/**
+ Macro that converts SMBUS slave address, SMBUS command, SMBUS data length,
+ and PEC to a value that can be passed to the SMBUS Library functions.
+
+ Computes an address that is compatible with the SMBUS Library functions.
+ The unused upper bits of SlaveAddress, Command, and Length are stripped
+ prior to the generation of the address.
+
+ @param SlaveAddress SMBUS Slave Address. Range 0..127.
+ @param Command SMBUS Command. Range 0..255.
+ @param Length SMBUS Data Length. Range 0..32.
+ @param Pec TRUE if Packet Error Checking is enabled. Otherwise FALSE.
+
+**/
+#define SMBUS_LIB_ADDRESS(SlaveAddress,Command,Length,Pec) \
+ ( ((Pec) ? SMBUS_LIB_PEC_BIT: 0) | \
+ (((SlaveAddress) & 0x7f) << 1) | \
+ (((Command) & 0xff) << 8) | \
+ (((Length) & 0x3f) << 16) \
+ )
+
+#define SMBUS_LIB_SLAVE_ADDRESS(SmBusAddress) (((SmBusAddress) >> 1) & 0x7f)
+#define SMBUS_LIB_COMMAND(SmBusAddress) (((SmBusAddress) >> 8) & 0xff)
+#define SMBUS_LIB_LENGTH(SmBusAddress) (((SmBusAddress) >> 16) & 0x3f)
+#define SMBUS_LIB_PEC(SmBusAddress) ((BOOLEAN) (((SmBusAddress) & SMBUS_LIB_PEC_BIT) != 0))
+#define SMBUS_LIB_RESERVED(SmBusAddress) ((SmBusAddress) & ~(((1 << 22) - 2) | SMBUS_LIB_PEC_BIT))
+
+typedef struct {
+ UINTN SmbusDeviceAddress:7;
+} EFI_SMBUS_DEVICE_ADDRESS;
+
+typedef UINTN EFI_SMBUS_DEVICE_COMMAND;
+
+typedef enum _EFI_SMBUS_OPERATION {
+ EfiSmbusQuickRead,
+ EfiSmbusQuickWrite,
+ EfiSmbusReceiveByte,
+ EfiSmbusSendByte,
+ EfiSmbusReadByte,
+ EfiSmbusWriteByte,
+ EfiSmbusReadWord,
+ EfiSmbusWriteWord,
+ EfiSmbusReadBlock,
+ EfiSmbusWriteBlock,
+ EfiSmbusProcessCall,
+ EfiSmbusBWBRProcessCall
+} EFI_SMBUS_OPERATION;
+//******************************************************
+// EFI_SMBUS_UDID
+//******************************************************
+typedef struct {
+ UINT32 VendorSpecificId;
+ UINT16 SubsystemDeviceId;
+ UINT16 SubsystemVendorId;
+ UINT16 Interface;
+ UINT16 DeviceId;
+ UINT16 VendorId;
+ UINT8 VendorRevision;
+ UINT8 DeviceCapabilities;
+} EFI_SMBUS_UDID;
+//*******************************************************
+// EFI_SMBUS_DEVICE_MAP
+//*******************************************************
+typedef struct {
+ EFI_SMBUS_DEVICE_ADDRESS SmbusDeviceAddress;
+ EFI_SMBUS_UDID SmbusDeviceUdid;
+} EFI_SMBUS_DEVICE_MAP;
+#pragma pack()
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2009, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 6145-F Northbelt Pkwy, Norcross, GA 30071 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
diff --git a/Include/SmmPi.h b/Include/SmmPi.h
new file mode 100644
index 0000000..d967a60
--- /dev/null
+++ b/Include/SmmPi.h
@@ -0,0 +1,239 @@
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/SOURCE/Modules/SMM/SmmPi.h 3 6/22/11 2:38p Markw $
+//
+// $Revision: 3 $
+//
+// $Date: 6/22/11 2:38p $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/SOURCE/Modules/SMM/SmmPi.h $
+//
+// 3 6/22/11 2:38p Markw
+// Add exclusions around typedef EFI_AP_PROCEDURE.
+//
+// 2 3/04/11 3:33p Markw
+// Update headers.
+//
+// 1 2/07/11 3:58p Markw
+// [TAG] EIP53481
+// [Category] New Feature
+// [Description] Add PIWG 1.1 SMM support
+// [Files] Smm.sdl, SmmPrivateShared.h, SmmDispatcher.mak,
+// SmmDispatcher.h, SmmDispatcher.c,
+// Smst.c, SmmPiSmst.c, SmmInit.c, SmmBase.c, SmmBase2.c,
+// SmmDriverDispatcher.c, Smm Framewwork Protocol files, SmmPi.h,
+// Smm Pi Protocol files, SmmPciRbio files
+//
+//**********************************************************************
+
+//<AMI_FHDR_START>
+//----------------------------------------------------------------------------
+//
+// Name: SmmPi.h
+//
+// Description: Smst table definitions.
+//
+//----------------------------------------------------------------------------
+//<AMI_FHDR_END>
+
+#ifndef __SMMPI__H__
+#define __SMMPI__H__
+
+#if PI_SPECIFICATION_VERSION >= 0x0001000A
+
+#include <efi.h>
+#include <Protocol\SmmCpuIo2.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define SMM_SMST_SIGNATURE 'TSMS'
+#define EFI_SMM_SYSTEM_TABLE_REVISION (0<<16) | (0x09)
+
+typedef struct _EFI_SMM_SYSTEM_TABLE2 EFI_SMM_SYSTEM_TABLE2;
+
+
+typedef EFI_STATUS (EFIAPI *EFI_SMM_INSTALL_CONFIGURATION_TABLE2) (
+ IN EFI_SMM_SYSTEM_TABLE2 *SystemTable,
+ IN EFI_GUID *Guid,
+ IN VOID *Table,
+ IN UINTN TableSize
+);
+
+#ifndef EFI_AP_PROCEDURE_TYPE_DEFINED
+#define EFI_AP_PROCEDURE_TYPE_DEFINED
+
+typedef VOID (*EFI_AP_PROCEDURE) (
+ IN VOID *Buffer
+);
+
+#endif
+
+typedef EFI_STATUS (EFIAPI *EFI_SMM_STARTUP_THIS_AP) (
+ IN EFI_AP_PROCEDURE Procedure,
+ IN UINTN CpuNumber,
+ IN OUT VOID *ProcArguments OPTIONAL
+);
+
+#define EFI_SMM_SYSTEM_TABLE_REVISION2 (1<<16) | (0x0A)
+
+
+typedef struct _EFI_SMM_ENTRY_CONTEXT {
+ EFI_SMM_STARTUP_THIS_AP SmmStartupThisAp;
+ UINTN CurrentlyExecutingCpu;
+ UINTN NumberOfCpus;
+ UINTN *CpuSaveStateSize;
+ VOID **CpuSaveState;
+} EFI_SMM_ENTRY_CONTEXT;
+
+typedef EFI_STATUS (EFIAPI *EFI_SMM_NOTIFY_FN)(
+ IN CONST EFI_GUID *Protocol,
+ IN VOID *Interface,
+ IN EFI_HANDLE Handle
+);
+
+
+typedef EFI_STATUS (EFIAPI *EFI_SMM_INSTALL_PROTOCOL_INTERFACE) (
+ IN OUT EFI_HANDLE *UserHandle,
+ IN EFI_GUID *Protocol,
+ IN EFI_INTERFACE_TYPE InterfaceType,
+ IN VOID *Interface
+);
+
+typedef EFI_STATUS (EFIAPI *EFI_SMM_UNINSTALL_PROTOCOL_INTERFACE)(
+ IN EFI_HANDLE UserHandle,
+ IN EFI_GUID *Protocol,
+ IN VOID *Interface
+);
+
+typedef EFI_STATUS (EFIAPI *EFI_SMM_HANDLE_PROTOCOL)(
+ IN EFI_HANDLE Handle,
+ IN EFI_GUID *Protocol,
+ OUT VOID **Interface
+);
+
+
+typedef EFI_STATUS (EFIAPI *EFI_SMM_REGISTER_PROTOCOL_NOTIFY)(
+ IN CONST EFI_GUID *Protocol,
+ IN EFI_SMM_NOTIFY_FN Function,
+ OUT VOID **Registration
+);
+
+typedef EFI_STATUS (EFIAPI *EFI_SMM_LOCATE_HANDLE)(
+ IN EFI_LOCATE_SEARCH_TYPE SearchType,
+ IN EFI_GUID *Protocol OPTIONAL,
+ IN VOID *SearchKey OPTIONAL,
+ IN OUT UINTN *BufferSize,
+ OUT EFI_HANDLE *Buffer
+);
+
+typedef EFI_STATUS (EFIAPI *EFI_SMM_LOCATE_PROTOCOL)(
+ IN EFI_GUID *Protocol,
+ IN VOID *Registration OPTIONAL,
+ OUT VOID **Interface
+);
+
+typedef EFI_STATUS (EFIAPI *EFI_SMM_INTERRUPT_MANAGE)(
+ IN CONST EFI_GUID *HandlerType,
+ IN CONST VOID *Context OPTIONAL,
+ IN OUT VOID *CommBuffer OPTIONAL,
+ IN OUT UINTN *CommBufferSize OPTIONAL
+);
+
+typedef EFI_STATUS (EFIAPI *EFI_SMM_HANDLER_ENTRY_POINT2) (
+ IN EFI_HANDLE DispatchHandle,
+ IN CONST VOID *Context OPTIONAL,
+ IN OUT VOID *CommBuffer OPTIONAL,
+ IN OUT UINTN *CommBufferSize OPTIONAL
+);
+
+typedef EFI_STATUS (EFIAPI *EFI_SMM_INTERRUPT_REGISTER) (
+ IN EFI_SMM_HANDLER_ENTRY_POINT2 Handler,
+ IN CONST EFI_GUID *HandlerType OPTIONAL,
+ OUT EFI_HANDLE *DispatchHandle
+);
+
+typedef EFI_STATUS (EFIAPI *EFI_SMM_INTERRUPT_UNREGISTER)(
+ IN EFI_HANDLE DispatchHandle
+);
+
+
+typedef struct _EFI_SMM_SYSTEM_TABLE2 {
+ EFI_TABLE_HEADER Hdr;
+ CHAR16 *SmmFirmwareVendor;
+ UINT32 SmmFirmwareRevision;
+
+ EFI_SMM_INSTALL_CONFIGURATION_TABLE2 SmmInstallConfigurationTable;
+
+ // I/O Services
+ EFI_SMM_CPU_IO2_PROTOCOL SmmIo;
+
+ // Runtime memory service
+ EFI_ALLOCATE_POOL SmmAllocatePool;
+ EFI_FREE_POOL SmmFreePool;
+ EFI_ALLOCATE_PAGES SmmAllocatePages;
+ EFI_FREE_PAGES SmmFreePages;
+
+ // Mp service
+ EFI_SMM_STARTUP_THIS_AP SmmStartupThisAp;
+
+ // CPU information records
+ UINTN CurrentlyExecutingCpu;
+ UINTN NumberOfCpus;
+ UINTN *CpuSaveStateSize;
+ VOID **CpuSaveState;
+
+ // Extensibility table
+ UINTN NumberOfTableEntries;
+ EFI_CONFIGURATION_TABLE *SmmConfigurationTable;
+
+ // Protocol services
+ EFI_SMM_INSTALL_PROTOCOL_INTERFACE SmmInstallProtocolInterface;
+ EFI_SMM_UNINSTALL_PROTOCOL_INTERFACE SmmUninstallProtocolInterface;
+ EFI_SMM_HANDLE_PROTOCOL SmmHandleProtocol;
+ EFI_SMM_REGISTER_PROTOCOL_NOTIFY SmmRegisterProtocolNotify;
+ EFI_SMM_LOCATE_HANDLE SmmLocateHandle;
+ EFI_SMM_LOCATE_PROTOCOL SmmLocateProtocol;
+
+ // SMI management functions
+ EFI_SMM_INTERRUPT_MANAGE SmiManage;
+ EFI_SMM_INTERRUPT_REGISTER SmiHandlerRegister;
+ EFI_SMM_INTERRUPT_UNREGISTER SmiHandlerUnRegister;
+} EFI_SMM_SYSTEM_TABLE2;
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+#endif
+
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
diff --git a/Include/SmmPiIncludes.cif b/Include/SmmPiIncludes.cif
new file mode 100644
index 0000000..cf82bf5
--- /dev/null
+++ b/Include/SmmPiIncludes.cif
@@ -0,0 +1,9 @@
+<component>
+ name = "SmmPiIncludes"
+ category = ModulePart
+ LocalRoot = "Include\"
+ RefName = "SmmPiIncludes"
+[files]
+"SmmPiIncludes.sdl"
+"SmmPi.h"
+<endComponent>
diff --git a/Include/SmmPiIncludes.sdl b/Include/SmmPiIncludes.sdl
new file mode 100644
index 0000000..4b73214
--- /dev/null
+++ b/Include/SmmPiIncludes.sdl
@@ -0,0 +1,11 @@
+TOKEN
+ Name = "SMM_PI_INCLUDES_SUPPORT"
+ Value = "1"
+ Help = "Main switch to enable SMM Includes support in Project"
+ TokenType = Boolean
+ TargetEQU = Yes
+ TargetMAK = Yes
+ TargetH = Yes
+ Master = Yes
+ Token = "PI_SPECIFICATION_VERSION" ">=" "0x1000A"
+End
diff --git a/Include/StatusCodes.h b/Include/StatusCodes.h
new file mode 100644
index 0000000..48fb08c
--- /dev/null
+++ b/Include/StatusCodes.h
@@ -0,0 +1,1062 @@
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2012, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
+//**********************************************************************
+// $Header: /Alaska/BIN/Core/Include/StatusCodes.h 14 4/12/12 4:58p Artems $
+//
+// $Revision: 14 $
+//
+// $Date: 4/12/12 4:58p $
+//*****************************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Core/Include/StatusCodes.h $
+//
+// 14 4/12/12 4:58p Artems
+// [TAG] EIP56645
+// [Category] Spec Update
+// [Description] Added backward compatibility fix by defining new macros
+// via old macros
+//
+// 13 3/15/12 12:11p Artems
+// Fixed typo in EFI_SW_PEI_PC_RECOVERY_BEGIN macro
+//
+// 11 5/13/11 6:26p Oleksiyy
+// [TAG] EIP56645
+// [Category] Improvement
+// [Description] Status Code PI 1.2 Specification Update
+// [Files] DebugSupport.h, StatusCodeDataTypeId.h and StatusCodes.h
+//
+// 10 8/16/10 4:23p Felixp
+// clean up
+//
+// 9 8/16/10 4:09p Felixp
+// Keyboard buffer full error code is added
+// (AMI_P_KEYBOARD_EC_BUFFER_FULL).
+//
+// 7 4/26/10 9:49a Felixp
+//
+// 6 10/10/08 9:11a Felixp
+// Status Codes for NB2 initialization is added (EIP 15573)
+//
+// 5 4/22/08 4:33p Felixp
+// AMI_DXE_BS_EC_INVALID_IDE_PASSWORD operation added
+//
+// 4 8/07/07 2:20p Felixp
+// New StatusCodes added
+//
+// 3 1/26/07 11:55a Felixp
+// Definition of EFI_SW_PEIM_PC_CAPSULE_START constant fixed
+//
+// 2 6/19/06 7:09p Felixp
+//
+// 1 3/13/06 1:15a Felixp
+//
+// 2 3/04/05 10:22a Mandal
+//
+// 1 1/28/05 12:44p Felixp
+//
+// 3 1/18/05 3:21p Felixp
+// PrintDebugMessage renamed to Trace
+//
+// 1 12/23/04 9:41a Felixp
+//
+// 3 10/22/04 7:35p Felixp
+//
+// 2 3/29/04 3:21p Markw
+// Added specification defined GUIDs.
+//
+// 1 3/29/04 12:38p Markw
+// Moved EfiStatusCode to include component.
+//
+// 2 3/29/04 10:27a Robert
+// removed duplication of definitions for general status codes
+//
+// 1 1/15/04 5:18p Robert
+//
+//*****************************************************************************
+//<AMI_FHDR_START>
+//
+// Name: StatusCodes.h
+//
+// Description: Status Code Definitions, according to Intel Platform
+// Innovation Framework for EFI Status Codes Specification Revision 0.90
+//
+// The code where logically separated into file is parts for a sesnible
+// grouping of the values
+//
+// Part: Contents:
+// 1 General Status Code Definitions --> moved to EFI.h
+// 2 Class definitions
+// 3 Computing Unit Subclasses, Progress and Error Codes
+// 4 Peripheral Subclasses, Progress and Error Codes.
+// 5 IO Bus Subclasses, Progress and Error Codes.
+// 6 Software Subclasses, Progress and Error Codes.
+// 7 Debug Codes
+//
+//<AMI_FHDR_END>
+//*****************************************************************************
+#ifndef _EFI_STATUS_CODE_H_
+#define _EFI_STATUS_CODE_H_
+#include <efi.h>
+#if PI_SPECIFICATION_VERSION>=0x0001000A
+#include <UefiHii.h>
+#include <DataHubSubClass.h>
+#endif
+
+#define EFI_STATUS_CODE_DATA_TYPE_STRING_GUID \
+ {0x92D11080,0x496F,0x4D95,0xBE,0x7E,0x03,0x74,0x88,0x38,0x2B,0x0A }
+
+#define EFI_STATUS_CODE_SPECIFIC_DATA_GUID \
+ {0x335984bd,0xe805,0x409a,0xb8,0xf8,0xd2,0x7e,0xce,0x5f,0xf7,0xa6}
+
+///////////////////////////////////////////////////////////////////////////////
+// Section 1
+///////////////////////////////////////////////////////////////////////////////
+// Moved to EFI.h
+// See EFI.h for General status code definitions
+
+
+// Data Hub Status Code class record definition
+typedef struct {
+ EFI_STATUS_CODE_TYPE CodeType;
+ EFI_STATUS_CODE_VALUE Value;
+ UINT32 Instance;
+ EFI_GUID CallerId;
+ EFI_STATUS_CODE_DATA Data;
+} DATA_HUB_STATUS_CODE_DATA_RECORD;
+
+///////////////////////////////////////////////////////////////////////////////
+// Section 2
+///////////////////////////////////////////////////////////////////////////////
+
+// Class definitions
+// Values of 4-127 are reserved for future use by this specification.
+// Values of 127-255 are reserved for OEM use.
+#define EFI_COMPUTING_UNIT 0x00000000
+#define EFI_PERIPHERAL 0x01000000
+#define EFI_IO_BUS 0x02000000
+#define EFI_SOFTWARE 0x03000000
+
+// General partitioning scheme for Progress and Error Codes are
+// 0x0000-0x0FFF - Shared by all sub-classes in a given class
+// 0x1000-0x7FFF - Subclass Specific
+// 0x8000-0xFFFF - OEM specific
+#define EFI_SUBCLASS_SPECIFIC 0x1000
+#define EFI_OEM_SPECIFIC 0x8000
+
+
+
+///////////////////////////////////////////////////////////////////////////////
+// Section 3
+///////////////////////////////////////////////////////////////////////////////
+
+// Computing Unit Subclass definitions.
+// Values of 8-127 are reserved for future use by this specification.
+// Values of 128-255 are reserved for OEM use.
+#define EFI_COMPUTING_UNIT_UNSPECIFIED (EFI_COMPUTING_UNIT | 0x00000000)
+#define EFI_COMPUTING_UNIT_HOST_PROCESSOR (EFI_COMPUTING_UNIT | 0x00010000)
+#define EFI_COMPUTING_UNIT_FIRMWARE_PROCESSOR (EFI_COMPUTING_UNIT | 0x00020000)
+#define EFI_COMPUTING_UNIT_IO_PROCESSOR (EFI_COMPUTING_UNIT | 0x00030000)
+#define EFI_COMPUTING_UNIT_CACHE (EFI_COMPUTING_UNIT | 0x00040000)
+#define EFI_COMPUTING_UNIT_MEMORY (EFI_COMPUTING_UNIT | 0x00050000)
+#define EFI_COMPUTING_UNIT_CHIPSET (EFI_COMPUTING_UNIT | 0x00060000)
+
+// Computing Unit Class Progress Code definitions. These are shared by
+// all subclasses.
+#define EFI_CU_PC_INIT_BEGIN 0x00000000
+#define EFI_CU_PC_INIT_END 0x00000001
+
+// Computing Unit Unspecified Subclass Progress Code definitions.
+
+// Computing Unit Host Processor Subclass Progress Code definitions.
+#define EFI_CU_HP_PC_POWER_ON_INIT (EFI_SUBCLASS_SPECIFIC | 0x00000000)
+#define EFI_CU_HP_PC_CACHE_INIT (EFI_SUBCLASS_SPECIFIC | 0x00000001)
+#define EFI_CU_HP_PC_RAM_INIT (EFI_SUBCLASS_SPECIFIC | 0x00000002)
+#define EFI_CU_HP_PC_MEMORY_CONTROLLER_INIT \
+ (EFI_SUBCLASS_SPECIFIC | 0x00000003)
+#define EFI_CU_HP_PC_IO_INIT (EFI_SUBCLASS_SPECIFIC | 0x00000004)
+#define EFI_CU_HP_PC_BSP_SELECT (EFI_SUBCLASS_SPECIFIC | 0x00000005)
+#define EFI_CU_HP_PC_BSP_RESELECT (EFI_SUBCLASS_SPECIFIC | 0x00000006)
+#define EFI_CU_HP_PC_AP_INIT (EFI_SUBCLASS_SPECIFIC | 0x00000007)
+#define EFI_CU_HP_PC_SMM_INIT (EFI_SUBCLASS_SPECIFIC | 0x00000008)
+
+// Computing Unit Firmware Processor Subclass Progress Code definitions.
+
+// Computing Unit IO Processor Subclass Progress Code definitions.
+
+// Computing Unit Cache Subclass Progress Code definitions.
+#define EFI_CU_CACHE_PC_PRESENCE_DETECT (EFI_SUBCLASS_SPECIFIC | 0x00000000)
+#define EFI_CU_CACHE_PC_CONFIGURATION (EFI_SUBCLASS_SPECIFIC | 0x00000001)
+
+// Computing Unit Memory Subclass Progress Code definitions.
+#define EFI_CU_MEMORY_PC_SPD_READ (EFI_SUBCLASS_SPECIFIC | 0x00000000)
+#define EFI_CU_MEMORY_PC_PRESENCE_DETECT (EFI_SUBCLASS_SPECIFIC | 0x00000001)
+#define EFI_CU_MEMORY_PC_TIMING (EFI_SUBCLASS_SPECIFIC | 0x00000002)
+#define EFI_CU_MEMORY_PC_CONFIGURING (EFI_SUBCLASS_SPECIFIC | 0x00000003)
+#define EFI_CU_MEMORY_PC_OPTIMIZING (EFI_SUBCLASS_SPECIFIC | 0x00000004)
+#define EFI_CU_MEMORY_PC_INIT (EFI_SUBCLASS_SPECIFIC | 0x00000005)
+#define EFI_CU_MEMORY_PC_TEST (EFI_SUBCLASS_SPECIFIC | 0x00000006)
+
+// Computing Unit Chipset Subclass Progress Code definitions.
+
+// Computing Unit Class Error Code definitions. These are shared by
+// all subclasses.
+#define EFI_CU_EC_NON_SPECIFIC 0x00000000
+#define EFI_CU_EC_DISABLED 0x00000001
+#define EFI_CU_EC_NOT_SUPPORTED 0x00000002
+#define EFI_CU_EC_NOT_DETECTED 0x00000003
+#define EFI_CU_EC_NOT_CONFIGURED 0x00000004
+
+// Computing Unit Unspecified Subclass Error Code definitions.
+
+// Computing Unit Host Processor Subclass Error Code definitions.
+#define EFI_CU_HP_EC_INVALID_TYPE (EFI_SUBCLASS_SPECIFIC | 0x00000000)
+#define EFI_CU_HP_EC_INVALID_SPEED (EFI_SUBCLASS_SPECIFIC | 0x00000001)
+#define EFI_CU_HP_EC_MISMATCH (EFI_SUBCLASS_SPECIFIC | 0x00000002)
+#define EFI_CU_HP_EC_TIMER_EXPIRED (EFI_SUBCLASS_SPECIFIC | 0x00000003)
+#define EFI_CU_HP_EC_SELF_TEST (EFI_SUBCLASS_SPECIFIC | 0x00000004)
+#define EFI_CU_HP_EC_INTERNAL (EFI_SUBCLASS_SPECIFIC | 0x00000005)
+#define EFI_CU_HP_EC_THERMAL (EFI_SUBCLASS_SPECIFIC | 0x00000006)
+#define EFI_CU_HP_EC_LOW_VOLTAGE (EFI_SUBCLASS_SPECIFIC | 0x00000007)
+#define EFI_CU_HP_EC_HIGH_VOLTAGE (EFI_SUBCLASS_SPECIFIC | 0x00000008)
+#define EFI_CU_HP_EC_CACHE (EFI_SUBCLASS_SPECIFIC | 0x00000009)
+#define EFI_CU_HP_EC_MICROCODE_UPDATE (EFI_SUBCLASS_SPECIFIC | 0x0000000A)
+#define EFI_CU_HP_EC_CORRECTABLE (EFI_SUBCLASS_SPECIFIC | 0x0000000B)
+#define EFI_CU_HP_EC_UNCORRECTABLE (EFI_SUBCLASS_SPECIFIC | 0x0000000C)
+#define EFI_CU_HP_EC_NO_MICROCODE_UPDATE (EFI_SUBCLASS_SPECIFIC | 0x0000000D)
+
+// Computing Unit Firmware Processor Subclass Error Code definitions.
+#define EFI_CU_FP_EC_HARD_FAIL (EFI_SUBCLASS_SPECIFIC | 0x00000000)
+#define EFI_CU_FP_EC_SOFT_FAIL (EFI_SUBCLASS_SPECIFIC | 0x00000001)
+#define EFI_CU_FP_EC_COMM_ERROR (EFI_SUBCLASS_SPECIFIC | 0x00000002)
+
+// Computing Unit IO Processor Subclass Error Code definitions.
+
+// Computing Unit Cache Subclass Error Code definitions.
+#define EFI_CU_CACHE_EC_INVALID_TYPE (EFI_SUBCLASS_SPECIFIC | 0x00000000)
+#define EFI_CU_CACHE_EC_INVALID_SPEED (EFI_SUBCLASS_SPECIFIC | 0x00000001)
+#define EFI_CU_CACHE_EC_INVALID_SIZE (EFI_SUBCLASS_SPECIFIC | 0x00000002)
+#define EFI_CU_CACHE_EC_MISMATCH (EFI_SUBCLASS_SPECIFIC | 0x00000003)
+
+// Computing Unit Memory Subclass Error Code definitions.
+#define EFI_CU_MEMORY_EC_INVALID_TYPE (EFI_SUBCLASS_SPECIFIC | 0x00000000)
+#define EFI_CU_MEMORY_EC_INVALID_SPEED (EFI_SUBCLASS_SPECIFIC | 0x00000001)
+#define EFI_CU_MEMORY_EC_CORRECTABLE (EFI_SUBCLASS_SPECIFIC | 0x00000002)
+#define EFI_CU_MEMORY_EC_UNCORRECTABLE (EFI_SUBCLASS_SPECIFIC | 0x00000003)
+#define EFI_CU_MEMORY_EC_SPD_FAIL (EFI_SUBCLASS_SPECIFIC | 0x00000004)
+#define EFI_CU_MEMORY_EC_INVALID_SIZE (EFI_SUBCLASS_SPECIFIC | 0x00000005)
+#define EFI_CU_MEMORY_EC_MISMATCH (EFI_SUBCLASS_SPECIFIC | 0x00000006)
+#define EFI_CU_MEMORY_EC_S3_RESUME_FAIL (EFI_SUBCLASS_SPECIFIC | 0x00000007)
+#define EFI_CU_MEMORY_EC_UPDATE_FAIL (EFI_SUBCLASS_SPECIFIC | 0x00000008)
+#define EFI_CU_MEMORY_EC_NONE_DETECTED (EFI_SUBCLASS_SPECIFIC | 0x00000009)
+#define EFI_CU_MEMORY_EC_NONE_USEFUL (EFI_SUBCLASS_SPECIFIC | 0x0000000A)
+
+
+#if PI_SPECIFICATION_VERSION>=0x0001000A
+//
+// Computing Unit Chipset Subclass Progress Code definitions.
+//
+#define EFI_CHIPSET_PC_PEI_CAR_SB_INIT (EFI_SUBCLASS_SPECIFIC | 0x00000000)
+#define EFI_CHIPSET_PC_PEI_CAR_NB_INIT (EFI_SUBCLASS_SPECIFIC | 0x00000001)
+#define EFI_CHIPSET_PC_PEI_MEM_SB_INIT (EFI_SUBCLASS_SPECIFIC | 0x00000002)
+#define EFI_CHIPSET_PC_PEI_MEM_NB_INIT (EFI_SUBCLASS_SPECIFIC | 0x00000003)
+#define EFI_CHIPSET_PC_DXE_HB_INIT (EFI_SUBCLASS_SPECIFIC | 0x00000004)
+#define EFI_CHIPSET_PC_DXE_NB_INIT (EFI_SUBCLASS_SPECIFIC | 0x00000005)
+#define EFI_CHIPSET_PC_DXE_NB_SMM_INIT (EFI_SUBCLASS_SPECIFIC | 0x00000006)
+#define EFI_CHIPSET_PC_DXE_SB_RT_INIT (EFI_SUBCLASS_SPECIFIC | 0x00000007)
+#define EFI_CHIPSET_PC_DXE_SB_INIT (EFI_SUBCLASS_SPECIFIC | 0x00000008)
+#define EFI_CHIPSET_PC_DXE_SB_SMM_INIT (EFI_SUBCLASS_SPECIFIC | 0x00000009)
+#define EFI_CHIPSET_PC_DXE_SB_DEVICES_INIT (EFI_SUBCLASS_SPECIFIC | 0x0000000A)
+
+//
+// Computing Unit Chipset Subclass Error Code definitions.
+//
+#define EFI_CHIPSET_EC_BAD_BATTERY (EFI_SUBCLASS_SPECIFIC | 0x00000000)
+#define EFI_CHIPSET_EC_DXE_NB_ERROR (EFI_SUBCLASS_SPECIFIC | 0x00000001)
+#define EFI_CHIPSET_EC_DXE_SB_ERROR (EFI_SUBCLASS_SPECIFIC | 0x00000002)
+
+#endif
+
+///////////////////////////////////////////////////////////////////////////////
+// Section 4
+///////////////////////////////////////////////////////////////////////////////
+
+// Peripheral Subclass definitions.
+// Values of 12-127 are reserved for future use by this specification.
+// Values of 128-255 are reserved for OEM use.
+#define EFI_PERIPHERAL_UNSPECIFIED (EFI_PERIPHERAL | 0x00000000)
+#define EFI_PERIPHERAL_KEYBOARD (EFI_PERIPHERAL | 0x00010000)
+#define EFI_PERIPHERAL_MOUSE (EFI_PERIPHERAL | 0x00020000)
+#define EFI_PERIPHERAL_LOCAL_CONSOLE (EFI_PERIPHERAL | 0x00030000)
+#define EFI_PERIPHERAL_REMOTE_CONSOLE (EFI_PERIPHERAL | 0x00040000)
+#define EFI_PERIPHERAL_SERIAL_PORT (EFI_PERIPHERAL | 0x00050000)
+#define EFI_PERIPHERAL_PARALLEL_PORT (EFI_PERIPHERAL | 0x00060000)
+#define EFI_PERIPHERAL_FIXED_MEDIA (EFI_PERIPHERAL | 0x00070000)
+#define EFI_PERIPHERAL_REMOVABLE_MEDIA (EFI_PERIPHERAL | 0x00080000)
+#define EFI_PERIPHERAL_AUDIO_INPUT (EFI_PERIPHERAL | 0x00090000)
+#define EFI_PERIPHERAL_AUDIO_OUTPUT (EFI_PERIPHERAL | 0x000A0000)
+#define EFI_PERIPHERAL_LCD_DEVICE (EFI_PERIPHERAL | 0x000B0000)
+#define EFI_PERIPHERAL_NETWORK (EFI_PERIPHERAL | 0x000C0000)
+
+// Peripheral Class Progress Code definitions. These are shared by
+// all subclasses.
+#define EFI_P_PC_INIT 0x00000000
+#define EFI_P_PC_RESET 0x00000001
+#define EFI_P_PC_DISABLE 0x00000002
+#define EFI_P_PC_PRESENCE_DETECT 0x00000003
+#define EFI_P_PC_ENABLE 0x00000004
+#define EFI_P_PC_RECONFIG 0x00000005
+#define EFI_P_PC_DETECTED 0x00000006
+
+// Peripheral Class Unspecified Subclass Progress Code definitions.
+
+// Peripheral Class Keyboard Subclass Progress Code definitions.
+#define EFI_P_KEYBOARD_PC_CLEAR_BUFFER (EFI_SUBCLASS_SPECIFIC | 0x00000000)
+#define EFI_P_KEYBOARD_PC_SELF_TEST (EFI_SUBCLASS_SPECIFIC | 0x00000001)
+
+// Peripheral Class Mouse Subclass Progress Code definitions.
+#define EFI_P_MOUSE_PC_SELF_TEST (EFI_SUBCLASS_SPECIFIC | 0x00000000)
+
+// Peripheral Class Local Console Subclass Progress Code definitions.
+
+// Peripheral Class Remote Console Subclass Progress Code definitions.
+
+// Peripheral Class Serial Port Subclass Progress Code definitions.
+#define EFI_P_SERIAL_PORT_PC_CLEAR_BUFFER (EFI_SUBCLASS_SPECIFIC | 0x00000000)
+
+// Peripheral Class Parallel Port Subclass Progress Code definitions.
+
+// Peripheral Class Fixed Media Subclass Progress Code definitions.
+
+// Peripheral Class Removable Media Subclass Progress Code definitions.
+
+// Peripheral Class Audio Input Subclass Progress Code definitions.
+
+// Peripheral Class Audio Output Subclass Progress Code definitions.
+
+
+// Peripheral Class LCD Device Subclass Progress Code definitions.
+
+// Peripheral Class Network Subclass Progress Code definitions.
+
+// Peripheral Class Error Code definitions.
+// These are shared by all subclasses.
+#define EFI_P_EC_NON_SPECIFIC 0x00000000
+#define EFI_P_EC_DISABLED 0x00000001
+#define EFI_P_EC_NOT_SUPPORTED 0x00000002
+#define EFI_P_EC_NOT_DETECTED 0x00000003
+#define EFI_P_EC_NOT_CONFIGURED 0x00000004
+#define EFI_P_EC_INTERFACE_ERROR 0x00000005
+#define EFI_P_EC_CONTROLLER_ERROR 0x00000006
+#define EFI_P_EC_INPUT_ERROR 0x00000007
+#define EFI_P_EC_OUTPUT_ERROR 0x00000008
+#define EFI_P_EC_RESOURCE_CONFLICT 0x00000009
+
+// Peripheral Class Unspecified Subclass Error Code definitions.
+
+// Peripheral Class Keyboard Subclass Error Code definitions.
+#define EFI_P_KEYBOARD_EC_LOCKED (EFI_SUBCLASS_SPECIFIC | 0x00000000)
+#define EFI_P_KEYBOARD_EC_STUCK_KEY (EFI_SUBCLASS_SPECIFIC | 0x00000001)
+
+// Peripheral Class Mouse Subclass Error Code definitions.
+#define EFI_P_MOUSE_EC_LOCKED (EFI_SUBCLASS_SPECIFIC | 0x00000000)
+
+// Peripheral Class Local Console Subclass Error Code definitions.
+
+// Peripheral Class Remote Console Subclass Error Code definitions.
+
+// Peripheral Class Serial Port Subclass Error Code definitions.
+
+// Peripheral Class Parallel Port Subclass Error Code definitions.
+
+// Peripheral Class Fixed Media Subclass Error Code definitions.
+
+// Peripheral Class Removable Media Subclass Error Code definitions.
+
+// Peripheral Class Audio Input Subclass Error Code definitions.
+
+// Peripheral Class Audio Output Subclass Error Code definitions.
+
+// Peripheral Class LCD Device Subclass Error Code definitions.
+
+// Peripheral Class Network Subclass Error Code definitions.
+
+///////////////////////////////////////////////////////////////////////////////
+// Section 5
+///////////////////////////////////////////////////////////////////////////////
+
+// IO Bus Subclass definitions.
+// Values of 14-127 are reserved for future use by this specification.
+// Values of 128-255 are reserved for OEM use.
+#define EFI_IO_BUS_UNSPECIFIED (EFI_IO_BUS | 0x00000000)
+#define EFI_IO_BUS_PCI (EFI_IO_BUS | 0x00010000)
+#define EFI_IO_BUS_USB (EFI_IO_BUS | 0x00020000)
+#define EFI_IO_BUS_IBA (EFI_IO_BUS | 0x00030000)
+#define EFI_IO_BUS_AGP (EFI_IO_BUS | 0x00040000)
+#define EFI_IO_BUS_PC_CARD (EFI_IO_BUS | 0x00050000)
+#define EFI_IO_BUS_LPC (EFI_IO_BUS | 0x00060000)
+#define EFI_IO_BUS_SCSI (EFI_IO_BUS | 0x00070000)
+#define EFI_IO_BUS_ATA_ATAPI (EFI_IO_BUS | 0x00080000)
+#define EFI_IO_BUS_FC (EFI_IO_BUS | 0x00090000)
+#define EFI_IO_BUS_IP_NETWORK (EFI_IO_BUS | 0x000A0000)
+#define EFI_IO_BUS_SMBUS (EFI_IO_BUS | 0x000B0000)
+#define EFI_IO_BUS_I2C (EFI_IO_BUS | 0x000C0000)
+
+// IO Bus Class Progress Code definitions.
+// These are shared by all subclasses.
+#define EFI_IOB_PC_INIT 0x00000000
+#define EFI_IOB_PC_RESET 0x00000001
+#define EFI_IOB_PC_DISABLE 0x00000002
+#define EFI_IOB_PC_DETECT 0x00000003
+#define EFI_IOB_PC_ENABLE 0x00000004
+#define EFI_IOB_PC_RECONFIG 0x00000005
+#define EFI_IOB_PC_HOTPLUG 0x00000006
+
+// IO Bus Class Unspecified Subclass Progress Code definitions.
+
+// IO Bus Class PCI Subclass Progress Code definitions.
+#define EFI_IOB_PCI_PC_BUS_ENUM (EFI_SUBCLASS_SPECIFIC | 0x00000000)
+#define EFI_IOB_PCI_PC_RES_ALLOC (EFI_SUBCLASS_SPECIFIC | 0x00000001)
+#define EFI_IOB_PCI_PC_HPC_INIT (EFI_SUBCLASS_SPECIFIC | 0x00000002)
+
+// IO Bus Class USB Subclass Progress Code definitions.
+
+// IO Bus Class IBA Subclass Progress Code definitions.
+
+// IO Bus Class AGP Subclass Progress Code definitions.
+
+// IO Bus Class PC Card Subclass Progress Code definitions.
+
+// IO Bus Class LPC Subclass Progress Code definitions.
+
+// IO Bus Class SCSI Subclass Progress Code definitions.
+
+// IO Bus Class ATA/ATAPI Subclass Progress Code definitions.
+#define EFI_IOB_ATA_BUS_SMART_ENABLE (EFI_SUBCLASS_SPECIFIC | 0x00000000)
+#define EFI_IOB_ATA_BUS_SMART_DISABLE (EFI_SUBCLASS_SPECIFIC | 0x00000001)
+#define EFI_IOB_ATA_BUS_SMART_OVERTHRESHOLD (EFI_SUBCLASS_SPECIFIC | 0x00000002)
+#define EFI_IOB_ATA_BUS_SMART_UNDERTHRESHOLD (EFI_SUBCLASS_SPECIFIC | 0x00000003)
+
+// IO Bus Class FC Subclass Progress Code definitions.
+
+// IO Bus Class IP Network Subclass Progress Code definitions.
+
+// IO Bus Class SMBUS Subclass Progress Code definitions.
+
+// IO Bus Class I2C Subclass Progress Code definitions.
+
+// IO Bus Class Error Code definitions.
+// These are shared by all subclasses.
+#define EFI_IOB_EC_NON_SPECIFIC 0x00000000
+#define EFI_IOB_EC_DISABLED 0x00000001
+#define EFI_IOB_EC_NOT_SUPPORTED 0x00000002
+#define EFI_IOB_EC_NOT_DETECTED 0x00000003
+#define EFI_IOB_EC_NOT_CONFIGURED 0x00000004
+#define EFI_IOB_EC_INTERFACE_ERROR 0x00000005
+#define EFI_IOB_EC_CONTROLLER_ERROR 0x00000006
+#define EFI_IOB_EC_READ_ERROR 0x00000007
+#define EFI_IOB_EC_WRITE_ERROR 0x00000008
+#define EFI_IOB_EC_RESOURCE_CONFLICT 0x00000009
+
+// IO Bus Class Unspecified Subclass Error Code definitions.
+
+// IO Bus Class PCI Subclass Error Code definitions.
+#define EFI_IOB_PCI_EC_PERR (EFI_SUBCLASS_SPECIFIC | 0x00000000)
+#define EFI_IOB_PCI_EC_SERR (EFI_SUBCLASS_SPECIFIC | 0x00000001)
+
+// IO Bus Class USB Subclass Error Code definitions.
+
+// IO Bus Class IBA Subclass Error Code definitions.
+
+// IO Bus Class AGP Subclass Error Code definitions.
+
+// IO Bus Class PC Card Subclass Error Code definitions.
+
+// IO Bus Class LPC Subclass Error Code definitions.
+
+// IO Bus Class SCSI Subclass Error Code definitions.
+
+// IO Bus Class ATA/ATAPI Subclass Error Code definitions.
+#define EFI_IOB_ATA_BUS_SMART_NOTSUPPORTED (EFI_SUBCLASS_SPECIFIC | 0x00000000)
+#define EFI_IOB_ATA_BUS_SMART_DISABLED (EFI_SUBCLASS_SPECIFIC | 0x00000001)
+
+// IO Bus Class FC Subclass Error Code definitions.
+
+// IO Bus Class IP Network Subclass Error Code definitions.
+
+// IO Bus Class SMBUS Subclass Error Code definitions.
+
+// IO Bus Class I2C Subclass Error Code definitions.
+
+///////////////////////////////////////////////////////////////////////////////
+// Section 6
+///////////////////////////////////////////////////////////////////////////////
+
+// Software Subclass definitions.
+// Values of 14-127 are reserved for future use by this specification.
+// Values of 128-255 are reserved for OEM use.
+#define EFI_SOFTWARE_UNSPECIFIED (EFI_SOFTWARE | 0x00000000)
+#define EFI_SOFTWARE_SEC (EFI_SOFTWARE | 0x00010000)
+#define EFI_SOFTWARE_PEI_CORE (EFI_SOFTWARE | 0x00020000)
+#define EFI_SOFTWARE_PEI_MODULE (EFI_SOFTWARE | 0x00030000)
+#define EFI_SOFTWARE_DXE_CORE (EFI_SOFTWARE | 0x00040000)
+#define EFI_SOFTWARE_DXE_BS_DRIVER (EFI_SOFTWARE | 0x00050000)
+#define EFI_SOFTWARE_DXE_RT_DRIVER (EFI_SOFTWARE | 0x00060000)
+#define EFI_SOFTWARE_SMM_DRIVER (EFI_SOFTWARE | 0x00070000)
+#define EFI_SOFTWARE_EFI_APPLICATION (EFI_SOFTWARE | 0x00080000)
+#define EFI_SOFTWARE_EFI_OS_LOADER (EFI_SOFTWARE | 0x00090000)
+#define EFI_SOFTWARE_RT (EFI_SOFTWARE | 0x000A0000)
+#define EFI_SOFTWARE_AL (EFI_SOFTWARE | 0x000B0000)
+#define EFI_SOFTWARE_EBC_EXCEPTION (EFI_SOFTWARE | 0x000C0000)
+#define EFI_SOFTWARE_IA32_EXCEPTION (EFI_SOFTWARE | 0x000D0000)
+#define EFI_SOFTWARE_IPF_EXCEPTION (EFI_SOFTWARE | 0x000E0000)
+#define EFI_SOFTWARE_PEI_SERVICE (EFI_SOFTWARE | 0x000F0000)
+#define EFI_SOFTWARE_EFI_BOOT_SERVICE (EFI_SOFTWARE | 0x00100000)
+#define EFI_SOFTWARE_EFI_RUNTIME_SERVICE (EFI_SOFTWARE | 0x00110000)
+#define EFI_SOFTWARE_EFI_DXE_SERVICE (EFI_SOFTWARE | 0x00120000)
+
+#if PI_SPECIFICATION_VERSION>=0x0001000A
+
+#define EFI_SOFTWARE_X64_EXCEPTION (EFI_SOFTWARE | 0x00130000)
+#define EFI_SOFTWARE_ARM_EXCEPTION (EFI_SOFTWARE | 0x00140000)
+
+#endif
+
+// Software Class Progress Code definitions. These are shared by all subclasses
+#define EFI_SW_PC_INIT 0x00000000
+#define EFI_SW_PC_LOAD 0x00000001
+#define EFI_SW_PC_INIT_BEGIN 0x00000002
+#define EFI_SW_PC_INIT_END 0x00000003
+#define EFI_SW_PC_AUTHENTICATE_BEGIN 0x00000004
+#define EFI_SW_PC_AUTHENTICATE_END 0x00000005
+#define EFI_SW_PC_INPUT_WAIT 0x00000006
+#define EFI_SW_PC_USER_SETUP 0x00000007
+
+
+// Software Class Unspecified Subclass Progress Code definitions.
+
+// Software Class SEC Subclass Progress Code definitions.
+#define EFI_SW_SEC_PC_ENTRY_POINT (EFI_SUBCLASS_SPECIFIC | 0x00000000)
+#define EFI_SW_SEC_PC_HANDOFF_TO_NEXT (EFI_SUBCLASS_SPECIFIC | 0x00000001)
+
+// Software Class PEI Core Subclass Progress Code definitions.
+#define EFI_SW_PEI_CORE_PC_ENTRY_POINT (EFI_SUBCLASS_SPECIFIC | 0x00000000)
+#define EFI_SW_PEI_CORE_PC_HANDOFF_TO_NEXT (EFI_SUBCLASS_SPECIFIC | 0x00000001)
+#define EFI_SW_PEI_CORE_PC_RETURN_TO_LAST (EFI_SUBCLASS_SPECIFIC | 0x00000002)
+
+// Software Class PEI Module Subclass Progress Code definitions.
+#define EFI_SW_PEIM_PC_RECOVERY_BEGIN (EFI_SUBCLASS_SPECIFIC | 0x00000000)
+#define EFI_SW_PEIM_PC_CAPSULE_LOAD (EFI_SUBCLASS_SPECIFIC | 0x00000001)
+//Status Code Specification 0.92 defines both CAPSULE_LOAD and CAPSULE_START as 1, which is a bug
+#define EFI_SW_PEIM_PC_CAPSULE_START (EFI_SUBCLASS_SPECIFIC | 0x00000002)
+#define EFI_SW_PEIM_PC_RECOVERY_USER (EFI_SUBCLASS_SPECIFIC | 0x00000003)
+#define EFI_SW_PEIM_PC_RECOVERY_AUTO (EFI_SUBCLASS_SPECIFIC | 0x00000004)
+
+#if PI_SPECIFICATION_VERSION>=0x0001000A
+//
+// Software Class PEI Module Subclass Progress Code definitions.
+//
+#define EFI_SW_PEI_PC_RECOVERY_BEGIN EFI_SW_PEIM_PC_RECOVERY_BEGIN
+#define EFI_SW_PEI_PC_CAPSULE_LOAD EFI_SW_PEIM_PC_CAPSULE_LOAD
+#define EFI_SW_PEI_PC_CAPSULE_START EFI_SW_PEIM_PC_CAPSULE_START
+#define EFI_SW_PEI_PC_RECOVERY_USER EFI_SW_PEIM_PC_RECOVERY_USER
+#define EFI_SW_PEI_PC_RECOVERY_AUTO EFI_SW_PEIM_PC_RECOVERY_AUTO
+#define EFI_SW_PEI_PC_S3_BOOT_SCRIPT (EFI_SUBCLASS_SPECIFIC | 0x00000005)
+#define EFI_SW_PEI_PC_OS_WAKE (EFI_SUBCLASS_SPECIFIC | 0x00000006)
+
+#endif
+
+// Software Class DXE Core Subclass Progress Code definitions.
+#define EFI_SW_DXE_CORE_PC_ENTRY_POINT (EFI_SUBCLASS_SPECIFIC | 0x00000000)
+#define EFI_SW_DXE_CORE_PC_HANDOFF_TO_NEXT (EFI_SUBCLASS_SPECIFIC | 0x00000001)
+#define EFI_SW_DXE_CORE_PC_RETURN_TO_LAST (EFI_SUBCLASS_SPECIFIC | 0x00000002)
+#define EFI_SW_DXE_CORE_PC_START_DRIVER (EFI_SUBCLASS_SPECIFIC | 0x00000003)
+
+// Software Class DXE BS Driver Subclass Progress Code definitions.
+#define EFI_SW_DXE_BS_PC_LEGACY_OPROM_INIT (EFI_SUBCLASS_SPECIFIC | 0x00000000)
+#define EFI_SW_DXE_BS_PC_READY_TO_BOOT_EVENT (EFI_SUBCLASS_SPECIFIC | 0x00000001)
+#define EFI_SW_DXE_BS_PC_LEGACY_BOOT_EVENT (EFI_SUBCLASS_SPECIFIC | 0x00000002)
+#define EFI_SW_DXE_BS_PC_EXIT_BOOT_SERVICES_EVENT (EFI_SUBCLASS_SPECIFIC | 0x00000003)
+#define EFI_SW_DXE_BS_PC_VIRTUAL_ADDRESS_CHANGE_EVENT (EFI_SUBCLASS_SPECIFIC | 0x00000004)
+#define EFI_SW_DXE_BS_PC_BEGIN_CONNECTING_DRIVERS (EFI_SUBCLASS_SPECIFIC | 0x00000005)
+#define EFI_SW_DXE_BS_PC_VERIFYING_PASSWORD (EFI_SUBCLASS_SPECIFIC | 0x00000006)
+
+// Software Class DXE RT Driver Subclass Progress Code definitions.
+#define EFI_SW_DXE_RT_PC_S0 (EFI_SUBCLASS_SPECIFIC | 0x00000000)
+#define EFI_SW_DXE_RT_PC_S1 (EFI_SUBCLASS_SPECIFIC | 0x00000001)
+#define EFI_SW_DXE_RT_PC_S2 (EFI_SUBCLASS_SPECIFIC | 0x00000002)
+#define EFI_SW_DXE_RT_PC_S3 (EFI_SUBCLASS_SPECIFIC | 0x00000003)
+#define EFI_SW_DXE_RT_PC_S4 (EFI_SUBCLASS_SPECIFIC | 0x00000004)
+#define EFI_SW_DXE_RT_PC_S5 (EFI_SUBCLASS_SPECIFIC | 0x00000005)
+
+// Software Class SMM Driver Subclass Progress Code definitions.
+
+// Software Class EFI Application Subclass Progress Code definitions.
+
+// Software Class EFI OS Loader Subclass Progress Code definitions.
+
+// Software Class EFI RT Subclass Progress Code definitions.
+#define EFI_SW_RT_PC_ENTRY_POINT (EFI_SUBCLASS_SPECIFIC | 0x00000000)
+#define EFI_SW_RT_PC_HANDOFF_TO_NEXT (EFI_SUBCLASS_SPECIFIC | 0x00000001)
+#define EFI_SW_RT_PC_RETURN_TO_LAST (EFI_SUBCLASS_SPECIFIC | 0x00000002)
+
+// Software Class EFI AL Subclass Progress Code definitions.
+#define EFI_SW_AL_PC_ENTRY_POINT (EFI_SUBCLASS_SPECIFIC | 0x00000000)
+#define EFI_SW_AL_PC_RETURN_TO_LAST (EFI_SUBCLASS_SPECIFIC | 0x00000001)
+
+// Software Class EBC Exception Subclass Progress Code definitions.
+
+// Software Class IA32 Exception Subclass Progress Code definitions.
+
+// Software Class IPF Exception Subclass Progress Code definitions.
+
+// Software Class PEI Services Subclass Progress Code definitions.
+#define EFI_SW_PS_PC_INSTALL_PPI (EFI_SUBCLASS_SPECIFIC | 0x00000000)
+#define EFI_SW_PS_PC_REINSTALL_PPI (EFI_SUBCLASS_SPECIFIC | 0x00000001)
+#define EFI_SW_PS_PC_LOCATE_PPI (EFI_SUBCLASS_SPECIFIC | 0x00000002)
+#define EFI_SW_PS_PC_NOTIFY_PPI (EFI_SUBCLASS_SPECIFIC | 0x00000003)
+#define EFI_SW_PS_PC_GET_BOOT_MODE (EFI_SUBCLASS_SPECIFIC | 0x00000004)
+#define EFI_SW_PS_PC_SET_BOOT_MODE (EFI_SUBCLASS_SPECIFIC | 0x00000005)
+#define EFI_SW_PS_PC_GET_HOB_LIST (EFI_SUBCLASS_SPECIFIC | 0x00000006)
+#define EFI_SW_PS_PC_CREATE_HOB (EFI_SUBCLASS_SPECIFIC | 0x00000007)
+#define EFI_SW_PS_PC_FFS_FIND_NEXT_VOLUME (EFI_SUBCLASS_SPECIFIC | 0x00000008)
+#define EFI_SW_PS_PC_FFS_FIND_NEXT_FILE (EFI_SUBCLASS_SPECIFIC | 0x00000009)
+#define EFI_SW_PS_PC_FFS_FIND_SECTION_DATA (EFI_SUBCLASS_SPECIFIC | 0x0000000A)
+#define EFI_SW_PS_PC_INSTALL_PEI_MEMORY (EFI_SUBCLASS_SPECIFIC | 0x0000000B)
+#define EFI_SW_PS_PC_ALLOCATE_PAGES (EFI_SUBCLASS_SPECIFIC | 0x0000000C)
+#define EFI_SW_PS_PC_ALLOCATE_POOL (EFI_SUBCLASS_SPECIFIC | 0x0000000D)
+#define EFI_SW_PS_PC_COPY_MEM (EFI_SUBCLASS_SPECIFIC | 0x0000000E)
+#define EFI_SW_PS_PC_SET_MEM (EFI_SUBCLASS_SPECIFIC | 0x0000000F)
+
+#if PI_SPECIFICATION_VERSION>=0x0001000A
+#define EFI_SW_PS_PC_RESET_SYSTEM (EFI_SUBCLASS_SPECIFIC | 0x00000010)
+#define EFI_SW_PS_PC_FFS_FIND_FILE_BY_NAME (EFI_SUBCLASS_SPECIFIC | 0x00000013)
+#define EFI_SW_PS_PC_FFS_GET_FILE_INFO (EFI_SUBCLASS_SPECIFIC | 0x00000014)
+#define EFI_SW_PS_PC_FFS_GET_VOLUME_INFO (EFI_SUBCLASS_SPECIFIC | 0x00000015)
+#define EFI_SW_PS_PC_FFS_REGISTER_FOR_SHADOW (EFI_SUBCLASS_SPECIFIC | 0x00000016)
+#endif
+// Software Class EFI Boot Services Subclass Progress Code definitions.
+#define EFI_SW_BS_PC_RAISE_TPL (EFI_SUBCLASS_SPECIFIC | 0x00000000)
+#define EFI_SW_BS_PC_RESTORE_TPL (EFI_SUBCLASS_SPECIFIC | 0x00000001)
+#define EFI_SW_BS_PC_ALLOCATE_PAGES (EFI_SUBCLASS_SPECIFIC | 0x00000002)
+#define EFI_SW_BS_PC_FREE_PAGES (EFI_SUBCLASS_SPECIFIC | 0x00000003)
+#define EFI_SW_BS_PC_GET_MEMORY_MAP (EFI_SUBCLASS_SPECIFIC | 0x00000004)
+#define EFI_SW_BS_PC_ALLOCATE_POOL (EFI_SUBCLASS_SPECIFIC | 0x00000005)
+#define EFI_SW_BS_PC_FREE_POOL (EFI_SUBCLASS_SPECIFIC | 0x00000006)
+#define EFI_SW_BS_PC_CREATE_EVENT (EFI_SUBCLASS_SPECIFIC | 0x00000007)
+#define EFI_SW_BS_PC_SET_TIMER (EFI_SUBCLASS_SPECIFIC | 0x00000008)
+#define EFI_SW_BS_PC_WAIT_FOR_EVENT (EFI_SUBCLASS_SPECIFIC | 0x00000009)
+#define EFI_SW_BS_PC_SIGNAL_EVENT (EFI_SUBCLASS_SPECIFIC | 0x0000000A)
+#define EFI_SW_BS_PC_CLOSE_EVENT (EFI_SUBCLASS_SPECIFIC | 0x0000000B)
+#define EFI_SW_BS_PC_CHECK_EVENT (EFI_SUBCLASS_SPECIFIC | 0x0000000C)
+#define EFI_SW_BS_PC_INSTALL_PROTOCOL_INTERFACE \
+ (EFI_SUBCLASS_SPECIFIC | 0x0000000D)
+#define EFI_SW_BS_PC_REINSTALL_PROTOCOL_INTERFACE \
+ (EFI_SUBCLASS_SPECIFIC | 0x0000000E)
+#define EFI_SW_BS_PC_UNINSTALL_PROTOCOL_INTERFACE \
+ (EFI_SUBCLASS_SPECIFIC | 0x0000000F)
+#define EFI_SW_BS_PC_HANDLE_PROTOCOL (EFI_SUBCLASS_SPECIFIC | 0x00000010)
+#define EFI_SW_BS_PC_PC_HANDLE_PROTOCOL (EFI_SUBCLASS_SPECIFIC | 0x00000011)
+#define EFI_SW_BS_PC_REGISTER_PROTOCOL_NOTIFY \
+ (EFI_SUBCLASS_SPECIFIC | 0x00000012)
+#define EFI_SW_BS_PC_LOCATE_HANDLE (EFI_SUBCLASS_SPECIFIC | 0x00000013)
+#define EFI_SW_BS_PC_INSTALL_CONFIGURATION_TABLE \
+ (EFI_SUBCLASS_SPECIFIC | 0x00000014)
+#define EFI_SW_BS_PC_LOAD_IMAGE (EFI_SUBCLASS_SPECIFIC | 0x00000015)
+#define EFI_SW_BS_PC_START_IMAGE (EFI_SUBCLASS_SPECIFIC | 0x00000016)
+#define EFI_SW_BS_PC_EXIT (EFI_SUBCLASS_SPECIFIC | 0x00000017)
+#define EFI_SW_BS_PC_UNLOAD_IMAGE (EFI_SUBCLASS_SPECIFIC | 0x00000018)
+#define EFI_SW_BS_PC_EXIT_BOOT_SERVICES (EFI_SUBCLASS_SPECIFIC | 0x00000019)
+#define EFI_SW_BS_PC_GET_NEXT_MONOTONIC_COUNT \
+ (EFI_SUBCLASS_SPECIFIC | 0x0000001A)
+#define EFI_SW_BS_PC_STALL (EFI_SUBCLASS_SPECIFIC | 0x0000001B)
+#define EFI_SW_BS_PC_SET_WATCHDOG_TIMER (EFI_SUBCLASS_SPECIFIC | 0x0000001C)
+#define EFI_SW_BS_PC_CONNECT_CONTROLLER (EFI_SUBCLASS_SPECIFIC | 0x0000001D)
+#define EFI_SW_BS_PC_DISCONNECT_CONTROLLER (EFI_SUBCLASS_SPECIFIC | 0x0000001E)
+#define EFI_SW_BS_PC_OPEN_PROTOCOL (EFI_SUBCLASS_SPECIFIC | 0x0000001F)
+#define EFI_SW_BS_PC_CLOSE_PROTOCOL (EFI_SUBCLASS_SPECIFIC | 0x00000020)
+#define EFI_SW_BS_PC_OPEN_PROTOCOL_INFORMATION \
+ (EFI_SUBCLASS_SPECIFIC | 0x00000021)
+#define EFI_SW_BS_PC_PROTOCOLS_PER_HANDLE (EFI_SUBCLASS_SPECIFIC | 0x00000022)
+#define EFI_SW_BS_PC_LOCATE_HANDLE_BUFFER (EFI_SUBCLASS_SPECIFIC | 0x00000023)
+#define EFI_SW_BS_PC_LOCATE_PROTOCOL (EFI_SUBCLASS_SPECIFIC | 0x00000024)
+#define EFI_SW_BS_PC_INSTALL_MULTIPLE_INTERFACES (EFI_SUBCLASS_SPECIFIC | 0x00000025)
+#define EFI_SW_BS_PC_UNINSTALL_MULTIPLE_INTERFACES (EFI_SUBCLASS_SPECIFIC | 0x00000026)
+#define EFI_SW_BS_PC_CALCULATE_CRC_32 (EFI_SUBCLASS_SPECIFIC | 0x00000027)
+#define EFI_SW_BS_PC_COPY_MEM (EFI_SUBCLASS_SPECIFIC | 0x00000028)
+#define EFI_SW_BS_PC_SET_MEM (EFI_SUBCLASS_SPECIFIC | 0x00000029)
+#if PI_SPECIFICATION_VERSION>=0x0001000A
+#define EFI_SW_BS_PC_CREATE_EVENT_EX (EFI_SUBCLASS_SPECIFIC | 0x0000002A)
+#endif
+//
+// Software Class EFI Runtime Services Subclass Progress Code definitions.
+//
+#define EFI_SW_RS_PC_GET_TIME (EFI_SUBCLASS_SPECIFIC | 0x00000000)
+#define EFI_SW_RS_PC_SET_TIME (EFI_SUBCLASS_SPECIFIC | 0x00000001)
+#define EFI_SW_RS_PC_GET_WAKEUP_TIME (EFI_SUBCLASS_SPECIFIC | 0x00000002)
+#define EFI_SW_RS_PC_SET_WAKEUP_TIME (EFI_SUBCLASS_SPECIFIC | 0x00000003)
+#define EFI_SW_RS_PC_SET_VIRTUAL_ADDRESS_MAP \
+ (EFI_SUBCLASS_SPECIFIC | 0x00000004)
+#define EFI_SW_RS_PC_CONVERT_POINTER (EFI_SUBCLASS_SPECIFIC | 0x00000005)
+#define EFI_SW_RS_PC_GET_VARIABLE (EFI_SUBCLASS_SPECIFIC | 0x00000006)
+#define EFI_SW_RS_PC_GET_NEXT_VARIABLE_NAME \
+ (EFI_SUBCLASS_SPECIFIC | 0x00000007)
+#define EFI_SW_RS_PC_SET_VARIABLE (EFI_SUBCLASS_SPECIFIC | 0x00000008)
+#define EFI_SW_RS_PC_GET_NEXT_HIGH_MONOTONIC_COUNT \
+ (EFI_SUBCLASS_SPECIFIC | 0x00000009)
+#define EFI_SW_RS_PC_RESET_SYSTEM (EFI_SUBCLASS_SPECIFIC | 0x0000000A)
+#if PI_SPECIFICATION_VERSION>=0x0001000A
+#define EFI_SW_RS_PC_UPDATE_CAPSULE (EFI_SUBCLASS_SPECIFIC | 0x0000000B)
+#define EFI_SW_RS_PC_QUERY_CAPSULE_CAPABILITIES \
+ (EFI_SUBCLASS_SPECIFIC | 0x0000000C)
+#define EFI_SW_RS_PC_QUERY_VARIABLE_INFO (EFI_SUBCLASS_SPECIFIC | 0x0000000D)
+#endif
+// Software Class EFI DXE Services Subclass Progress Code definitions
+#define EFI_SW_DS_PC_ADD_MEMORY_SPACE (EFI_SUBCLASS_SPECIFIC | 0x00000000)
+#define EFI_SW_DS_PC_ALLOCATE_MEMORY_SPACE (EFI_SUBCLASS_SPECIFIC | 0x00000001)
+#define EFI_SW_DS_PC_FREE_MEMORY_SPACE (EFI_SUBCLASS_SPECIFIC | 0x00000002)
+#define EFI_SW_DS_PC_REMOVE_MEMORY_SPACE (EFI_SUBCLASS_SPECIFIC | 0x00000003)
+#define EFI_SW_DS_PC_GET_MEMORY_SPACE_DESCRIPTOR \
+ (EFI_SUBCLASS_SPECIFIC | 0x00000004)
+#define EFI_SW_DS_PC_SET_MEMORY_SPACE_ATTRIBUTES \
+ (EFI_SUBCLASS_SPECIFIC | 0x00000005)
+#define EFI_SW_DS_PC_GET_MEMORY_SPACE_MAP (EFI_SUBCLASS_SPECIFIC | 0x00000006)
+#define EFI_SW_DS_PC_ADD_IO_SPACE (EFI_SUBCLASS_SPECIFIC | 0x00000007)
+#define EFI_SW_DS_PC_ALLOCATE_IO_SPACE (EFI_SUBCLASS_SPECIFIC | 0x00000008)
+#define EFI_SW_DS_PC_FREE_IO_SPACE (EFI_SUBCLASS_SPECIFIC | 0x00000009)
+#define EFI_SW_DS_PC_REMOVE_IO_SPACE (EFI_SUBCLASS_SPECIFIC | 0x0000000A)
+#define EFI_SW_DS_PC_GET_IO_SPACE_DESCRIPTOR \
+ (EFI_SUBCLASS_SPECIFIC | 0x0000000B)
+#define EFI_SW_DS_PC_GET_IO_SPACE_MAP (EFI_SUBCLASS_SPECIFIC | 0x0000000C)
+#define EFI_SW_DS_PC_DISPATCH (EFI_SUBCLASS_SPECIFIC | 0x0000000D)
+#define EFI_SW_DS_PC_SCHEDULE (EFI_SUBCLASS_SPECIFIC | 0x0000000E)
+#define EFI_SW_DS_PC_TRUST (EFI_SUBCLASS_SPECIFIC | 0x0000000F)
+#define EFI_SW_DS_PC_PROCESS_FIRMWARE_VOLUME \
+ (EFI_SUBCLASS_SPECIFIC | 0x00000010)
+
+// Software Class Error Code definitions.
+// These are shared by all subclasses.
+#define EFI_SW_EC_NON_SPECIFIC 0x00000000
+#define EFI_SW_EC_LOAD_ERROR 0x00000001
+#define EFI_SW_EC_INVALID_PARAMETER 0x00000002
+#define EFI_SW_EC_UNSUPPORTED 0x00000003
+#define EFI_SW_EC_INVALID_BUFFER 0x00000004
+#define EFI_SW_EC_OUT_OF_RESOURCES 0x00000005
+#define EFI_SW_EC_ABORTED 0x00000006
+#define EFI_SW_EC_ILLEGAL_SOFTWARE_STATE 0x00000007
+#define EFI_SW_EC_ILLEGAL_HARDWARE_STATE 0x00000008
+#define EFI_SW_EC_START_ERROR 0x00000009
+#define EFI_SW_EC_BAD_DATE_TIME 0x0000000A
+#define EFI_SW_EC_CFG_INVALID 0x0000000B
+#define EFI_SW_EC_CFG_CLR_REQUEST 0x0000000C
+#define EFI_SW_EC_CFG_DEFAULT 0x0000000D
+#define EFI_SW_EC_PWD_INVALID 0x0000000E
+#define EFI_SW_EC_PWD_CLR_REQUEST 0x0000000F
+#define EFI_SW_EC_PWD_CLEARED 0x00000010
+#define EFI_SW_EC_EVENT_LOG_FULL 0x00000011
+
+// Software Class Unspecified Subclass Error Code definitions.
+
+// Software Class SEC Subclass Error Code definitions.
+
+// Software Class PEI Core Subclass Error Code definitions.
+#define EFI_SW_PEI_CORE_EC_DXE_CORRUPT (EFI_SUBCLASS_SPECIFIC | 0x00000000)
+#if PI_SPECIFICATION_VERSION>=0x0001000A
+#define EFI_SW_PEI_CORE_EC_DXEIPL_NOT_FOUND (EFI_SUBCLASS_SPECIFIC | 0x00000001)
+#define EFI_SW_PEI_CORE_EC_MEMORY_NOT_INSTALLED (EFI_SUBCLASS_SPECIFIC | 0x00000002)
+#endif
+// Software Class PEI Module Subclass Error Code definitions.
+#define EFI_SW_PEIM_EC_NO_RECOVERY_CAPSULE (EFI_SUBCLASS_SPECIFIC | 0x00000000)
+#define EFI_SW_PEIM_EC_INVALID_CAPSULE_DESCRIPTOR \
+ (EFI_SUBCLASS_SPECIFIC | 0x00000001)
+#if PI_SPECIFICATION_VERSION>=0x0001000A
+#define EFI_SW_PEI_EC_NO_RECOVERY_CAPSULE EFI_SW_PEIM_EC_NO_RECOVERY_CAPSULE
+#define EFI_SW_PEI_EC_INVALID_CAPSULE_DESCRIPTOR EFI_SW_PEIM_EC_INVALID_CAPSULE_DESCRIPTOR
+#define EFI_SW_PEI_EC_S3_RESUME_PPI_NOT_FOUND (EFI_SUBCLASS_SPECIFIC | 0x00000002)
+#define EFI_SW_PEI_EC_S3_BOOT_SCRIPT_ERROR (EFI_SUBCLASS_SPECIFIC | 0x00000003)
+#define EFI_SW_PEI_EC_S3_OS_WAKE_ERROR (EFI_SUBCLASS_SPECIFIC | 0x00000004)
+#define EFI_SW_PEI_EC_S3_RESUME_FAILED (EFI_SUBCLASS_SPECIFIC | 0x00000005)
+#define EFI_SW_PEI_EC_RECOVERY_PPI_NOT_FOUND (EFI_SUBCLASS_SPECIFIC | 0x00000006)
+#define EFI_SW_PEI_EC_RECOVERY_FAILED (EFI_SUBCLASS_SPECIFIC | 0x00000007)
+#endif
+// Software Class DXE Core Subclass Error Code definitions.
+
+// Software Class DXE Boot Service Driver Subclass Error Code definitions.
+#define EFI_SW_DXE_BS_EC_LEGACY_OPROM_NO_SPACE \
+ (EFI_SUBCLASS_SPECIFIC | 0x00000000)
+#if PI_SPECIFICATION_VERSION>=0x0001000A
+#define EFI_SW_DXE_BS_EC_INVALID_PASSWORD (EFI_SUBCLASS_SPECIFIC | 0x00000001)
+#define EFI_SW_DXE_BS_EC_BOOT_OPTION_LOAD_ERROR (EFI_SUBCLASS_SPECIFIC | 0x00000002)
+#define EFI_SW_DXE_BS_EC_BOOT_OPTION_FAILED (EFI_SUBCLASS_SPECIFIC | 0x00000003)
+#define EFI_SW_DXE_BS_EC_INVALID_IDE_PASSWORD (EFI_SUBCLASS_SPECIFIC | 0x00000004)
+#endif
+// Software Class DXE Runtime Service Driver Subclass Error Code definitions.
+//
+#if PI_SPECIFICATION_VERSION>=0x0001000A
+//
+// Software Class DXE Foundation Subclass Error Code
+// definitions.
+//
+#define EFI_SW_DXE_CORE_EC_NO_ARCH (EFI_SUBCLASS_SPECIFIC | 0x00000000)
+
+#endif
+// Software Class SMM Driver Subclass Error Code definitions.
+
+// Software Class EFI Application Subclass Error Code definitions.
+
+// Software Class EFI OS Loader Subclass Error Code definitions.
+
+// Software Class EFI RT Subclass Error Code definitions.
+
+// Software Class EFI AL Subclass Error Code definitions.
+
+// Software Class EBC Exception Subclass Error Code definitions.
+// These exceptions are derived from the debug protocol definitions in the EFI
+// specification.
+#define EFI_SW_EC_EBC_UNDEFINED 0x00000000
+#define EFI_SW_EC_EBC_DIVIDE_ERROR EXCEPT_EBC_DIVIDE_ERROR
+#define EFI_SW_EC_EBC_DEBUG EXCEPT_EBC_DEBUG
+#define EFI_SW_EC_EBC_BREAKPOINT EXCEPT_EBC_BREAKPOINT
+#define EFI_SW_EC_EBC_OVERFLOW EXCEPT_EBC_OVERFLOW
+#define EFI_SW_EC_EBC_INVALID_OPCODE EXCEPT_EBC_INVALID_OPCODE
+#define EFI_SW_EC_EBC_STACK_FAULT EXCEPT_EBC_STACK_FAULT
+#define EFI_SW_EC_EBC_ALIGNMENT_CHECK EXCEPT_EBC_ALIGNMENT_CHECK
+#define EFI_SW_EC_EBC_INSTRUCTION_ENCODING EXCEPT_EBC_INSTRUCTION_ENCODING
+#define EFI_SW_EC_EBC_BAD_BREAK EXCEPT_EBC_BAD_BREAK
+#define EFI_SW_EC_EBC_STEP EXCEPT_EBC_STEP
+
+// Software Class IA32 Exception Subclass Error Code definitions.
+// These exceptions are derived from the debug protocol definitions in the EFI
+// specification.
+#define EFI_SW_EC_IA32_DIVIDE_ERROR EXCEPT_IA32_DIVIDE_ERROR
+#define EFI_SW_EC_IA32_DEBUG EXCEPT_IA32_DEBUG
+#define EFI_SW_EC_IA32_NMI EXCEPT_IA32_NMI
+#define EFI_SW_EC_IA32_BREAKPOINT EXCEPT_IA32_BREAKPOINT
+#define EFI_SW_EC_IA32_OVERFLOW EXCEPT_IA32_OVERFLOW
+#define EFI_SW_EC_IA32_BOUND EXCEPT_IA32_BOUND
+#define EFI_SW_EC_IA32_INVALID_OPCODE EXCEPT_IA32_INVALID_OPCODE
+#define EFI_SW_EC_IA32_DOUBLE_FAULT EXCEPT_IA32_DOUBLE_FAULT
+#define EFI_SW_EC_IA32_INVALID_TSS EXCEPT_IA32_INVALID_TSS
+#define EFI_SW_EC_IA32_SEG_NOT_PRESENT EXCEPT_IA32_SEG_NOT_PRESENT
+#define EFI_SW_EC_IA32_STACK_FAULT EXCEPT_IA32_STACK_FAULT
+#define EFI_SW_EC_IA32_GP_FAULT EXCEPT_IA32_GP_FAULT
+#define EFI_SW_EC_IA32_PAGE_FAULT EXCEPT_IA32_PAGE_FAULT
+#define EFI_SW_EC_IA32_FP_ERROR EXCEPT_IA32_FP_ERROR
+#define EFI_SW_EC_IA32_ALIGNMENT_CHECK EXCEPT_IA32_ALIGNMENT_CHECK
+#define EFI_SW_EC_IA32_MACHINE_CHECK EXCEPT_IA32_MACHINE_CHECK
+#define EFI_SW_EC_IA32_SIMD EXCEPT_IA32_SIMD
+
+// Software Class IPF Exception Subclass Error Code definitions. These
+// exceptions are derived from the debug protocol definitions in the EFI
+// specification.
+#define EFI_SW_EC_IPF_ALT_DTLB EXCEPT_IPF_ALT_DTLB
+#define EFI_SW_EC_IPF_DNESTED_TLB EXCEPT_IPF_DNESTED_TLB
+#define EFI_SW_EC_IPF_BREAKPOINT EXCEPT_IPF_BREAKPOINT
+#define EFI_SW_EC_IPF_EXTERNAL_INTERRUPT EXCEPT_IPF_EXTERNAL_INTERRUPT
+#define EFI_SW_EC_IPF_GEN_EXCEPT EXCEPT_IPF_GEN_EXCEPT
+#define EFI_SW_EC_IPF_NAT_CONSUMPTION EXCEPT_IPF_NAT_CONSUMPTION
+#define EFI_SW_EC_IPF_DEBUG_EXCEPT EXCEPT_IPF_DEBUG_EXCEPT
+#define EFI_SW_EC_IPF_UNALIGNED_ACCESS EXCEPT_IPF_UNALIGNED_ACCESS
+#define EFI_SW_EC_IPF_FP_FAULT EXCEPT_IPF_FP_FAULT
+#define EFI_SW_EC_IPF_FP_TRAP EXCEPT_IPF_FP_TRAP
+#define EFI_SW_EC_IPF_TAKEN_BRANCH EXCEPT_IPF_TAKEN_BRANCH
+#define EFI_SW_EC_IPF_SINGLE_STEP EXCEPT_IPF_SINGLE_STEP
+
+// Software Class PEI Service Subclass Error Code definitions.
+#if PI_SPECIFICATION_VERSION>=0x0001000A
+#define EFI_SW_PS_EC_RESET_NOT_AVAILABLE (EFI_SUBCLASS_SPECIFIC | 0x00000000)
+#define EFI_SW_PS_EC_MEMORY_INSTALLED_TWICE (EFI_SUBCLASS_SPECIFIC | 0x00000001)
+
+//
+// Software Class X64 Exception Subclass Error Code definitions.
+// These exceptions are derived from the debug protocol
+// definitions in the EFI
+// specification.
+//
+#define EFI_SW_EC_X64_DIVIDE_ERROR EXCEPT_X64_DIVIDE_ERROR
+#define EFI_SW_EC_X64_DEBUG EXCEPT_X64_DEBUG
+#define EFI_SW_EC_X64_NMI EXCEPT_X64_NMI
+#define EFI_SW_EC_X64_BREAKPOINT EXCEPT_X64_BREAKPOINT
+#define EFI_SW_EC_X64_OVERFLOW EXCEPT_X64_OVERFLOW
+#define EFI_SW_EC_X64_BOUND EXCEPT_X64_BOUND
+#define EFI_SW_EC_X64_INVALID_OPCODE EXCEPT_X64_INVALID_OPCODE
+#define EFI_SW_EC_X64_DOUBLE_FAULT EXCEPT_X64_DOUBLE_FAULT
+#define EFI_SW_EC_X64_INVALID_TSS EXCEPT_X64_INVALID_TSS
+#define EFI_SW_EC_X64_SEG_NOT_PRESENT EXCEPT_X64_SEG_NOT_PRESENT
+#define EFI_SW_EC_X64_STACK_FAULT EXCEPT_X64_STACK_FAULT
+#define EFI_SW_EC_X64_GP_FAULT EXCEPT_X64_GP_FAULT
+#define EFI_SW_EC_X64_PAGE_FAULT EXCEPT_X64_PAGE_FAULT
+#define EFI_SW_EC_X64_FP_ERROR EXCEPT_X64_FP_ERROR
+#define EFI_SW_EC_X64_ALIGNMENT_CHECK EXCEPT_X64_ALIGNMENT_CHECK
+#define EFI_SW_EC_X64_MACHINE_CHECK EXCEPT_X64_MACHINE_CHECK
+#define EFI_SW_EC_X64_SIMD EXCEPT_X64_SIMD
+//
+// Software Class ARM Exception Subclass Error Code definitions.
+// These exceptions are derived from the debug protocol
+// definitions in the EFI
+// specification.
+//
+#define EFI_SW_EC_ARM_RESET EXCEPT_ARM_RESET
+#define EFI_SW_EC_ARM_UNDEFINED_INSTRUCTION EXCEPT_ARM_UNDEFINED_INSTRUCTION
+#define EFI_SW_EC_ARM_SOFTWARE_INTERRUPT EXCEPT_ARM_SOFTWARE_INTERRUPT
+#define EFI_SW_EC_ARM_PREFETCH_ABORT EXCEPT_ARM_PREFETCH_ABORT
+#define EFI_SW_EC_ARM_DATA_ABORT EXCEPT_ARM_DATA_ABORT
+#define EFI_SW_EC_ARM_RESERVED EXCEPT_ARM_RESERVED
+#define EFI_SW_EC_ARM_IRQ EXCEPT_ARM_IRQ
+#define EFI_SW_EC_ARM_FIQ EXCEPT_ARM_FIQ
+
+#endif
+// Software Class EFI Boot Service Subclass Error Code definitions.
+
+// Software Class EFI Runtime Service Subclass Error Code definitions.
+
+// Software Class EFI DXE Service Subclass Error Code definitions.
+
+///////////////////////////////////////////////////////////////////////////////
+// Section 7
+///////////////////////////////////////////////////////////////////////////////
+
+// Debug Code definitions for all classes and subclass
+// Only one debug code is defined at this point and should
+// be used for anything that gets sent to debug stream.
+#define EFI_DC_UNSPECIFIED 0x0
+
+///////////////////////////////////////////////////////////////////////////////
+// Section 7
+///////////////////////////////////////////////////////////////////////////////
+//Status Code Data Structures
+#pragma pack(push,1)
+typedef enum {
+ EfiStringAscii, EfiStringUnicode, EfiStringToken
+} EFI_STRING_TYPE;
+#if PI_SPECIFICATION_VERSION>=0x0001000A
+//
+// HII string token
+//
+typedef struct {
+ EFI_HII_HANDLE Handle;
+ EFI_STRING_ID Token;
+} EFI_STATUS_CODE_STRING_TOKEN;
+
+#endif
+
+typedef union {
+ CHAR8 *Ascii;
+ CHAR16 *Unicode;
+#if PI_SPECIFICATION_VERSION>=0x0001000A
+ EFI_STATUS_CODE_STRING_TOKEN Hii;
+#endif
+} EFI_STATUS_CODE_STRING;
+
+typedef struct {
+ EFI_STATUS_CODE_DATA DataHeader;
+ EFI_STRING_TYPE StringType;
+ EFI_STATUS_CODE_STRING String;
+} EFI_STATUS_CODE_STRING_DATA;
+
+typedef struct {
+ EFI_STATUS_CODE_DATA DataHeader;
+ UINT32 LineNumber;
+ UINT32 FileNameSize;
+ EFI_STATUS_CODE_STRING_DATA *FileName;
+} EFI_DEBUG_ASSERT_DATA;
+
+///////////////////////////////////////////////////////////////////////////////
+// AMI-specific operations
+///////////////////////////////////////////////////////////////////////////////
+//AMI Status Code definitions
+#define AMI_STATUS_CODE_CLASS EFI_OEM_SPECIFIC //0x8000
+#define AMI_STATUS_CODE_BEEP_CLASS 0x8100
+
+// Host Processor AMI-specific codes
+#define AMI_CU_HP_PC_DXE_CPU_INIT (AMI_STATUS_CODE_CLASS | 0x00000000)
+#define AMI_CU_HP_EC_DXE_CPU_ERROR (AMI_STATUS_CODE_CLASS | 0x00000001)
+
+//Chipset AMI-specific codes
+#define AMI_CHIPSET_PC_PEI_CAR_SB_INIT (AMI_STATUS_CODE_CLASS | 0x00000000)
+#define AMI_CHIPSET_PC_PEI_CAR_NB_INIT (AMI_STATUS_CODE_CLASS | 0x00000001)
+#define AMI_CHIPSET_PC_PEI_MEM_SB_INIT (AMI_STATUS_CODE_CLASS | 0x00000002)
+#define AMI_CHIPSET_PC_PEI_MEM_NB_INIT (AMI_STATUS_CODE_CLASS | 0x00000003)
+#define AMI_CHIPSET_PC_DXE_HB_INIT (AMI_STATUS_CODE_CLASS | 0x00000004)
+#define AMI_CHIPSET_PC_DXE_NB_INIT (AMI_STATUS_CODE_CLASS | 0x00000005)
+#define AMI_CHIPSET_PC_DXE_NB_SMM_INIT (AMI_STATUS_CODE_CLASS | 0x00000006)
+#define AMI_CHIPSET_PC_DXE_SB_RT_INIT (AMI_STATUS_CODE_CLASS | 0x00000007)
+#define AMI_CHIPSET_PC_DXE_SB_INIT (AMI_STATUS_CODE_CLASS | 0x00000008)
+#define AMI_CHIPSET_PC_DXE_SB_SMM_INIT (AMI_STATUS_CODE_CLASS | 0x00000009)
+#define AMI_CHIPSET_PC_DXE_SB_DEVICES_INIT (AMI_STATUS_CODE_CLASS | 0x0000000A)
+#define AMI_CHIPSET_EC_BAD_BATTERY (AMI_STATUS_CODE_CLASS | 0x0000000B)
+#define AMI_CHIPSET_EC_INTRUDER_DETECT (AMI_STATUS_CODE_CLASS | 0x0000000C)
+#define AMI_CHIPSET_EC_DXE_NB_ERROR (AMI_STATUS_CODE_CLASS | 0x0000000D)
+#define AMI_CHIPSET_EC_DXE_SB_ERROR (AMI_STATUS_CODE_CLASS | 0x0000000E)
+#define AMI_CHIPSET_PC_PEI_CAR_NB2_INIT (AMI_STATUS_CODE_CLASS | 0x0000000F)
+#define AMI_CHIPSET_PC_PEI_MEM_NB2_INIT (AMI_STATUS_CODE_CLASS | 0x00000010)
+#define AMI_CHIPSET_PC_DXE_NB2_INIT (AMI_STATUS_CODE_CLASS | 0x00000011)
+
+// Keyboard AMI-specific codes
+#define AMI_P_KEYBOARD_EC_BUFFER_FULL (AMI_STATUS_CODE_CLASS | 0x00000000)
+
+//PEI Core AMI-specific codes
+#define AMI_PEI_CORE_EC_DXEIPL_NOT_FOUND (AMI_STATUS_CODE_CLASS | 0x00000000)
+
+//PEI Services AMI-specific codes
+#define AMI_PS_PC_RESET_SYSTEM (AMI_STATUS_CODE_CLASS | 0x00000000)
+#define AMI_PS_EC_RESET_NOT_AVAILABLE (AMI_STATUS_CODE_CLASS | 0x00000001)
+#define AMI_PS_EC_MEMORY_NOT_INSTALLED (AMI_STATUS_CODE_CLASS | 0x00000002)
+#define AMI_PS_EC_MEMORY_INSTALLED_TWICE (AMI_STATUS_CODE_CLASS | 0x00000003)
+
+//PEIM AMI-specific codes
+#define AMI_PEIM_PC_S3_STARTED (AMI_STATUS_CODE_CLASS | 0x00000000)
+#define AMI_PEIM_PC_S3_BOOT_SCRIPT (AMI_STATUS_CODE_CLASS | 0x00000001)
+#define AMI_PEIM_PC_VIDEO_REPOST (AMI_STATUS_CODE_CLASS | 0x00000003)
+#define AMI_PEIM_PC_OS_WAKE (AMI_STATUS_CODE_CLASS | 0x00000004)
+#define AMI_PEIM_EC_S3_RESUME_PPI_NOT_FOUND (AMI_STATUS_CODE_CLASS | 0x00000005)
+#define AMI_PEIM_EC_S3_BOOT_SCRIPT_ERROR (AMI_STATUS_CODE_CLASS | 0x00000006)
+#define AMI_PEIM_EC_S3_OS_WAKE_ERROR (AMI_STATUS_CODE_CLASS | 0x00000007)
+#define AMI_PEIM_EC_S3_RESUME_ERROR (AMI_STATUS_CODE_CLASS | 0x00000008)
+#define AMI_PEIM_EC_RECOVERY_PPI_NOT_FOUND (AMI_STATUS_CODE_CLASS | 0x00000009)
+#define AMI_PEIM_EC_RECOVERY_FAILED (AMI_STATUS_CODE_CLASS | 0x0000000A)
+#define AMI_PEIM_EC_S3_RESUME_FAILED (AMI_STATUS_CODE_CLASS | 0x0000000B)
+
+//DXE Core AMI-specific codes
+#define AMI_DXE_CORE_PC_ARCH_READY (AMI_STATUS_CODE_CLASS | 0x00000000)
+#define AMI_DXE_CORE_EC_NO_ARCH (AMI_STATUS_CODE_CLASS | 0x00000001)
+
+//Boot Services AMI-specific codes
+#define AMI_BS_PC_NVRAM_INIT (AMI_STATUS_CODE_CLASS | 0x00000000)
+#define AMI_BS_PC_NVRAM_GC (AMI_STATUS_CODE_CLASS | 0x00000001)
+#define AMI_BS_PC_CONFIG_RESET (AMI_STATUS_CODE_CLASS | 0x00000002)
+
+//DXE Driver AMI-specific codes
+#define AMI_DXE_BS_PC_ACPI_INIT (AMI_STATUS_CODE_CLASS | 0x00000000)
+#define AMI_DXE_BS_PC_CSM_INIT (AMI_STATUS_CODE_CLASS | 0x00000001)
+#define AMI_DXE_BS_EC_INVALID_PASSWORD (AMI_STATUS_CODE_CLASS | 0x00000002)
+#define AMI_DXE_BS_EC_BOOT_OPTION_LOAD_ERROR (AMI_STATUS_CODE_CLASS | 0x00000003)
+#define AMI_DXE_BS_EC_BOOT_OPTION_FAILED (AMI_STATUS_CODE_CLASS | 0x00000004)
+#define AMI_DXE_BS_EC_INVALID_IDE_PASSWORD (AMI_STATUS_CODE_CLASS | 0x00000005)
+
+#pragma pack(pop)
+#endif
+//*************************************************************************
+//*************************************************************************
+//** **
+//** (C)Copyright 1985-2012, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//*************************************************************************
+//*************************************************************************
diff --git a/Include/TSEIncludes.cif b/Include/TSEIncludes.cif
new file mode 100644
index 0000000..ec9acce
--- /dev/null
+++ b/Include/TSEIncludes.cif
@@ -0,0 +1,9 @@
+<component>
+ name = "TSE Includes"
+ category = ModulePart
+ LocalRoot = "Include\"
+ RefName = "TSEIncludes"
+[files]
+"Protocol\AMIPostMgr.h"
+"AMIVfr.h"
+<endComponent>
diff --git a/Include/TcgTpm.h b/Include/TcgTpm.h
new file mode 100644
index 0000000..dfc0c31
--- /dev/null
+++ b/Include/TcgTpm.h
@@ -0,0 +1,2112 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2009, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/BIN/Core/Include/TcgTpm.h 1 11/19/09 12:37p Felixp $
+//
+// $Revision: 1 $
+//
+// $Date: 11/19/09 12:37p $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Core/Include/TcgTpm.h $
+//
+// 1 11/19/09 12:37p Felixp
+// TCG Definitions
+//
+// 5 10/05/09 3:52p Felixp
+//
+//**********************************************************************
+//<AMI_FHDR_START>
+//
+// Name: Tcg.h
+//
+// Description: TCG definitions
+//
+//<AMI_FHDR_END>
+//**********************************************************************
+#ifndef __TCG__H__
+#define __TCG__H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+#include <EFI.h>
+#ifndef TPM_BASE
+#define TPM_BASE (EFI_MAX_BIT + (EFI_MAX_BIT >> 1))
+#endif
+
+//****************************************************************************/
+// TPM Specification data structures (TCG TPM Specification Version 1.2 Revision 103)
+//****************************************************************************/
+
+//
+// Structures are all packed on 1-byte alignment
+//
+
+#pragma pack (push, 1)
+
+//
+// Part 2, section 2.2: Basic types & Helper redefinitions
+//
+typedef UINT8 TPM_AUTH_DATA_USAGE;
+typedef UINT8 TPM_PAYLOAD_TYPE;
+typedef UINT8 TPM_VERSION_BYTE;
+typedef UINT8 TPM_DA_STATE;
+typedef UINT16 TPM_TAG;
+typedef UINT16 TPM_PROTOCOL_ID;
+typedef UINT16 TPM_STARTUP_TYPE;
+typedef UINT16 TPM_ENC_SCHEME;
+typedef UINT16 TPM_SIG_SCHEME;
+typedef UINT16 TPM_MIGRATE_SCHEME;
+typedef UINT16 TPM_PHYSICAL_PRESENCE;
+typedef UINT16 TPM_ENTITY_TYPE;
+typedef UINT16 TPM_KEY_USAGE;
+typedef UINT16 TPM_EK_TYPE;
+typedef UINT16 TPM_STRUCTURE_TAG;
+typedef UINT16 TPM_PLATFORM_SPECIFIC;
+typedef UINT32 TPM_COMMAND_CODE;
+typedef UINT32 TPM_CAPABILITY_AREA;
+typedef UINT32 TPM_KEY_FLAGS;
+typedef UINT32 TPM_ALGORITHM_ID;
+typedef UINT32 TPM_MODIFIER_INDICATOR;
+typedef UINT32 TPM_ACTUAL_COUNT;
+typedef UINT32 TPM_TRANSPORT_ATTRIBUTES;
+typedef UINT32 TPM_AUTHHANDLE;
+typedef UINT32 TPM_DIRINDEX;
+typedef UINT32 TPM_KEY_HANDLE;
+typedef UINT32 TPM_PCRINDEX;
+typedef UINT32 TPM_RESULT;
+typedef UINT32 TPM_RESOURCE_TYPE;
+typedef UINT32 TPM_KEY_CONTROL;
+typedef UINT32 TPM_NV_INDEX;
+typedef UINT32 TPM_FAMILY_ID;
+typedef UINT32 TPM_FAMILY_VERIFICATION;
+typedef UINT32 TPM_STARTUP_EFFECTS;
+typedef UINT32 TPM_SYM_MODE;
+typedef UINT32 TPM_FAMILY_FLAGS;
+typedef UINT32 TPM_DELEGATE_INDEX;
+typedef UINT32 TPM_CMK_DELEGATE;
+typedef UINT32 TPM_COUNT_ID;
+typedef UINT32 TPM_REDIT_COMMAND;
+typedef UINT32 TPM_TRANSHANDLE;
+typedef UINT32 TPM_HANDLE;
+typedef UINT32 TPM_FAMILY_OPERATION;
+
+//
+// Part 2, section 2.2.4: Vendor specific
+// The following defines allow for the quick specification of a
+// vendor specific item.
+//
+#define TPM_Vendor_Specific32 ((UINT32) 0x00000400)
+#define TPM_Vendor_Specific8 ((UINT8) 0x80)
+
+//
+// Part 2, section 3.1: Structure TAGs
+//
+#define TPM_TAG_CONTEXTBLOB ((TPM_STRUCTURE_TAG) 0x0001)
+#define TPM_TAG_CONTEXT_SENSITIVE ((TPM_STRUCTURE_TAG) 0x0002)
+#define TPM_TAG_CONTEXTPOINTER ((TPM_STRUCTURE_TAG) 0x0003)
+#define TPM_TAG_CONTEXTLIST ((TPM_STRUCTURE_TAG) 0x0004)
+#define TPM_TAG_SIGNINFO ((TPM_STRUCTURE_TAG) 0x0005)
+#define TPM_TAG_PCR_INFO_LONG ((TPM_STRUCTURE_TAG) 0x0006)
+#define TPM_TAG_PERSISTENT_FLAGS ((TPM_STRUCTURE_TAG) 0x0007)
+#define TPM_TAG_VOLATILE_FLAGS ((TPM_STRUCTURE_TAG) 0x0008)
+#define TPM_TAG_PERSISTENT_DATA ((TPM_STRUCTURE_TAG) 0x0009)
+#define TPM_TAG_VOLATILE_DATA ((TPM_STRUCTURE_TAG) 0x000A)
+#define TPM_TAG_SV_DATA ((TPM_STRUCTURE_TAG) 0x000B)
+#define TPM_TAG_EK_BLOB ((TPM_STRUCTURE_TAG) 0x000C)
+#define TPM_TAG_EK_BLOB_AUTH ((TPM_STRUCTURE_TAG) 0x000D)
+#define TPM_TAG_COUNTER_VALUE ((TPM_STRUCTURE_TAG) 0x000E)
+#define TPM_TAG_TRANSPORT_INTERNAL ((TPM_STRUCTURE_TAG) 0x000F)
+#define TPM_TAG_TRANSPORT_LOG_IN ((TPM_STRUCTURE_TAG) 0x0010)
+#define TPM_TAG_TRANSPORT_LOG_OUT ((TPM_STRUCTURE_TAG) 0x0011)
+#define TPM_TAG_AUDIT_EVENT_IN ((TPM_STRUCTURE_TAG) 0x0012)
+#define TPM_TAG_AUDIT_EVENT_OUT ((TPM_STRUCTURE_TAG) 0x0013)
+#define TPM_TAG_CURRENT_TICKS ((TPM_STRUCTURE_TAG) 0x0014)
+#define TPM_TAG_KEY ((TPM_STRUCTURE_TAG) 0x0015)
+#define TPM_TAG_STORED_DATA12 ((TPM_STRUCTURE_TAG) 0x0016)
+#define TPM_TAG_NV_ATTRIBUTES ((TPM_STRUCTURE_TAG) 0x0017)
+#define TPM_TAG_NV_DATA_PUBLIC ((TPM_STRUCTURE_TAG) 0x0018)
+#define TPM_TAG_NV_DATA_SENSITIVE ((TPM_STRUCTURE_TAG) 0x0019)
+#define TPM_TAG_DELEGATIONS ((TPM_STRUCTURE_TAG) 0x001A)
+#define TPM_TAG_DELEGATE_PUBLIC ((TPM_STRUCTURE_TAG) 0x001B)
+#define TPM_TAG_DELEGATE_TABLE_ROW ((TPM_STRUCTURE_TAG) 0x001C)
+#define TPM_TAG_TRANSPORT_AUTH ((TPM_STRUCTURE_TAG) 0x001D)
+#define TPM_TAG_TRANSPORT_PUBLIC ((TPM_STRUCTURE_TAG) 0x001E)
+#define TPM_TAG_PERMANENT_FLAGS ((TPM_STRUCTURE_TAG) 0x001F)
+#define TPM_TAG_STCLEAR_FLAGS ((TPM_STRUCTURE_TAG) 0x0020)
+#define TPM_TAG_STANY_FLAGS ((TPM_STRUCTURE_TAG) 0x0021)
+#define TPM_TAG_PERMANENT_DATA ((TPM_STRUCTURE_TAG) 0x0022)
+#define TPM_TAG_STCLEAR_DATA ((TPM_STRUCTURE_TAG) 0x0023)
+#define TPM_TAG_STANY_DATA ((TPM_STRUCTURE_TAG) 0x0024)
+#define TPM_TAG_FAMILY_TABLE_ENTRY ((TPM_STRUCTURE_TAG) 0x0025)
+#define TPM_TAG_DELEGATE_SENSITIVE ((TPM_STRUCTURE_TAG) 0x0026)
+#define TPM_TAG_DELG_KEY_BLOB ((TPM_STRUCTURE_TAG) 0x0027)
+#define TPM_TAG_KEY12 ((TPM_STRUCTURE_TAG) 0x0028)
+#define TPM_TAG_CERTIFY_INFO2 ((TPM_STRUCTURE_TAG) 0x0029)
+#define TPM_TAG_DELEGATE_OWNER_BLOB ((TPM_STRUCTURE_TAG) 0x002A)
+#define TPM_TAG_EK_BLOB_ACTIVATE ((TPM_STRUCTURE_TAG) 0x002B)
+#define TPM_TAG_DAA_BLOB ((TPM_STRUCTURE_TAG) 0x002C)
+#define TPM_TAG_DAA_CONTEXT ((TPM_STRUCTURE_TAG) 0x002D)
+#define TPM_TAG_DAA_ENFORCE ((TPM_STRUCTURE_TAG) 0x002E)
+#define TPM_TAG_DAA_ISSUER ((TPM_STRUCTURE_TAG) 0x002F)
+#define TPM_TAG_CAP_VERSION_INFO ((TPM_STRUCTURE_TAG) 0x0030)
+#define TPM_TAG_DAA_SENSITIVE ((TPM_STRUCTURE_TAG) 0x0031)
+#define TPM_TAG_DAA_TPM ((TPM_STRUCTURE_TAG) 0x0032)
+#define TPM_TAG_CMK_MIGAUTH ((TPM_STRUCTURE_TAG) 0x0033)
+#define TPM_TAG_CMK_SIGTICKET ((TPM_STRUCTURE_TAG) 0x0034)
+#define TPM_TAG_CMK_MA_APPROVAL ((TPM_STRUCTURE_TAG) 0x0035)
+#define TPM_TAG_QUOTE_INFO2 ((TPM_STRUCTURE_TAG) 0x0036)
+#define TPM_TAG_DA_INFO ((TPM_STRUCTURE_TAG) 0x0037)
+#define TPM_TAG_DA_LIMITED ((TPM_STRUCTURE_TAG) 0x0038)
+#define TPM_TAG_DA_ACTION_TYPE ((TPM_STRUCTURE_TAG) 0x0039)
+
+//
+// Part 2, section 4: TPM Types
+//
+
+//
+// Part 2, section 4.1: TPM_RESOURCE_TYPE
+//
+#define TPM_RT_KEY ((TPM_RESOURCE_TYPE) 0x00000001) // The handle is a key handle and is the result of a LoadKey type operation
+#define TPM_RT_AUTH ((TPM_RESOURCE_TYPE) 0x00000002) // The handle is an authorization handle. Auth handles come from TPM_OIAP, TPM_OSAP and TPM_DSAP
+#define TPM_RT_HASH ((TPM_RESOURCE_TYPE) 0x00000003) // Reserved for hashes
+#define TPM_RT_TRANS ((TPM_RESOURCE_TYPE) 0x00000004) // The handle is for a transport session. Transport handles come from TPM_EstablishTransport
+#define TPM_RT_CONTEXT ((TPM_RESOURCE_TYPE) 0x00000005) // Resource wrapped and held outside the TPM using the context save/restore commands
+#define TPM_RT_COUNTER ((TPM_RESOURCE_TYPE) 0x00000006) // Reserved for counters
+#define TPM_RT_DELEGATE ((TPM_RESOURCE_TYPE) 0x00000007) // The handle is for a delegate row. These are the internal rows held in NV storage by the TPM
+#define TPM_RT_DAA_TPM ((TPM_RESOURCE_TYPE) 0x00000008) // The value is a DAA TPM specific blob
+#define TPM_RT_DAA_V0 ((TPM_RESOURCE_TYPE) 0x00000009) // The value is a DAA V0 parameter
+#define TPM_RT_DAA_V1 ((TPM_RESOURCE_TYPE) 0x0000000A) // The value is a DAA V1 parameter
+
+//
+// Part 2, section 4.2: TPM_PAYLOAD_TYPE
+//
+#define TPM_PT_ASYM ((TPM_PAYLOAD_TYPE) 0x01) // The entity is an asymmetric key
+#define TPM_PT_BIND ((TPM_PAYLOAD_TYPE) 0x02) // The entity is bound data
+#define TPM_PT_MIGRATE ((TPM_PAYLOAD_TYPE) 0x03) // The entity is a migration blob
+#define TPM_PT_MAINT ((TPM_PAYLOAD_TYPE) 0x04) // The entity is a maintenance blob
+#define TPM_PT_SEAL ((TPM_PAYLOAD_TYPE) 0x05) // The entity is sealed data
+#define TPM_PT_MIGRATE_RESTRICTED ((TPM_PAYLOAD_TYPE) 0x06) // The entity is a restricted-migration asymmetric key
+#define TPM_PT_MIGRATE_EXTERNAL ((TPM_PAYLOAD_TYPE) 0x07) // The entity is a external migratable key
+#define TPM_PT_CMK_MIGRATE ((TPM_PAYLOAD_TYPE) 0x08) // The entity is a CMK migratable blob
+#define TPM_PT_VENDOR_SPECIFIC ((TPM_PAYLOAD_TYPE) 0x80) // 0x80 - 0xFF Vendor specific payloads
+
+//
+// Part 2, section 4.3: TPM_ENTIRY_TYPE
+//
+#define TPM_ET_KEYHANDLE ((UINT16) 0x0001) // The entity is a keyHandle or key
+#define TPM_ET_OWNER ((UINT16) 0x0002) // The entity is the TPM Owner
+#define TPM_ET_DATA ((UINT16) 0x0003) // The entity is some data
+#define TPM_ET_SRK ((UINT16) 0x0004) // The entity is the SRK
+#define TPM_ET_KEY ((UINT16) 0x0005) // The entity is a key or keyHandle
+#define TPM_ET_REVOKE ((UINT16) 0x0006) // The entity is the RevokeTrust value
+#define TPM_ET_DEL_OWNER_BLOB ((UINT16) 0x0007) // The entity is a delegate owner blob
+#define TPM_ET_DEL_ROW ((UINT16) 0x0008) // The entity is a delegate row
+#define TPM_ET_DEL_KEY_BLOB ((UINT16) 0x0009) // The entity is a delegate key blob
+#define TPM_ET_COUNTER ((UINT16) 0x000A) // The entity is a counter
+#define TPM_ET_NV ((UINT16) 0x000B) // The entity is a NV index
+#define TPM_ET_OPERATOR ((UINT16) 0x000C) // The entity is the operator
+#define TPM_ET_RESERVED_HANDLE ((UINT16) 0x0040) // Reserved. This value avoids collisions with the handle MSB setting.
+//
+// TPM_ENTITY_TYPE MSB Values: The MSB is used to indicate the ADIP encryption sheme when applicable
+//
+#define TPM_ET_XOR ((UINT16) 0x0000) // ADIP encryption scheme: XOR
+#define TPM_ET_AES128 ((UINT16) 0x0006) // ADIP encryption scheme: AES 128 bits
+
+//
+// Part 2, section 4.4.1: Reserved Key Handles
+//
+#define TPM_KH_SRK ((TPM_KEY_HANDLE) 0x40000000) // The handle points to the SRK
+#define TPM_KH_OWNER ((TPM_KEY_HANDLE) 0x40000001) // The handle points to the TPM Owner
+#define TPM_KH_REVOKE ((TPM_KEY_HANDLE) 0x40000002) // The handle points to the RevokeTrust value
+#define TPM_KH_TRANSPORT ((TPM_KEY_HANDLE) 0x40000003) // The handle points to the EstablishTransport static authorization
+#define TPM_KH_OPERATOR ((TPM_KEY_HANDLE) 0x40000004) // The handle points to the Operator auth
+#define TPM_KH_ADMIN ((TPM_KEY_HANDLE) 0x40000005) // The handle points to the delegation administration auth
+#define TPM_KH_EK ((TPM_KEY_HANDLE) 0x40000006) // The handle points to the PUBEK, only usable with TPM_OwnerReadInternalPub
+
+//
+// Part 2, section 4.5: TPM_STARTUP_TYPE
+//
+#define TPM_ST_CLEAR ((TPM_STARTUP_TYPE) 0x0001) // The TPM is starting up from a clean state
+#define TPM_ST_STATE ((TPM_STARTUP_TYPE) 0x0002) // The TPM is starting up from a saved state
+#define TPM_ST_DEACTIVATED ((TPM_STARTUP_TYPE) 0x0003) // The TPM is to startup and set the deactivated flag to TRUE
+
+//
+// Part 2, section 4.6: TPM_STATUP_EFFECTS
+// The table makeup is still an open issue.
+//
+
+//
+// Part 2, section 4.7: TPM_PROTOCOL_ID
+//
+#define TPM_PID_OIAP ((TPM_PROTOCOL_ID) 0x0001) // The OIAP protocol.
+#define TPM_PID_OSAP ((TPM_PROTOCOL_ID) 0x0002) // The OSAP protocol.
+#define TPM_PID_ADIP ((TPM_PROTOCOL_ID) 0x0003) // The ADIP protocol.
+#define TPM_PID_ADCP ((TPM_PROTOCOL_ID) 0x0004) // The ADCP protocol.
+#define TPM_PID_OWNER ((TPM_PROTOCOL_ID) 0x0005) // The protocol for taking ownership of a TPM.
+#define TPM_PID_DSAP ((TPM_PROTOCOL_ID) 0x0006) // The DSAP protocol
+#define TPM_PID_TRANSPORT ((TPM_PROTOCOL_ID) 0x0007) // The transport protocol
+
+//
+// Part 2, section 4.8: TPM_ALGORITHM_ID
+// The TPM MUST support the algorithms TPM_ALG_RSA, TPM_ALG_SHA, TPM_ALG_HMAC,
+// TPM_ALG_MGF1
+//
+#define TPM_ALG_RSA ((TPM_ALGORITHM_ID) 0x00000001) // The RSA algorithm.
+#define TPM_ALG_DES ((TPM_ALGORITHM_ID) 0x00000002) // The DES algorithm
+#define TPM_ALG_3DES ((TPM_ALGORITHM_ID) 0x00000003) // The 3DES algorithm in EDE mode
+#define TPM_ALG_SHA ((TPM_ALGORITHM_ID) 0x00000004) // The SHA1 algorithm
+#define TPM_ALG_HMAC ((TPM_ALGORITHM_ID) 0x00000005) // The RFC 2104 HMAC algorithm
+#define TPM_ALG_AES128 ((TPM_ALGORITHM_ID) 0x00000006) // The AES algorithm, key size 128
+#define TPM_ALG_MGF1 ((TPM_ALGORITHM_ID) 0x00000007) // The XOR algorithm using MGF1 to create a string the size of the encrypted block
+#define TPM_ALG_AES192 ((TPM_ALGORITHM_ID) 0x00000008) // AES, key size 192
+#define TPM_ALG_AES256 ((TPM_ALGORITHM_ID) 0x00000009) // AES, key size 256
+#define TPM_ALG_XOR ((TPM_ALGORITHM_ID) 0x0000000A) // XOR using the rolling nonces
+
+//
+// Part 2, section 4.9: TPM_PHYSICAL_PRESENCE
+//
+#define TPM_PHYSICAL_PRESENCE_HW_DISABLE ((TPM_PHYSICAL_PRESENCE) 0x0200) // Sets the physicalPresenceHWEnable to FALSE
+#define TPM_PHYSICAL_PRESENCE_CMD_DISABLE ((TPM_PHYSICAL_PRESENCE) 0x0100) // Sets the physicalPresenceCMDEnable to FALSE
+#define TPM_PHYSICAL_PRESENCE_LIFETIME_LOCK ((TPM_PHYSICAL_PRESENCE) 0x0080) // Sets the physicalPresenceLifetimeLock to TRUE
+#define TPM_PHYSICAL_PRESENCE_HW_ENABLE ((TPM_PHYSICAL_PRESENCE) 0x0040) // Sets the physicalPresenceHWEnable to TRUE
+#define TPM_PHYSICAL_PRESENCE_CMD_ENABLE ((TPM_PHYSICAL_PRESENCE) 0x0020) // Sets the physicalPresenceCMDEnable to TRUE
+#define TPM_PHYSICAL_PRESENCE_NOTPRESENT ((TPM_PHYSICAL_PRESENCE) 0x0010) // Sets PhysicalPresence = FALSE
+#define TPM_PHYSICAL_PRESENCE_PRESENT ((TPM_PHYSICAL_PRESENCE) 0x0008) // Sets PhysicalPresence = TRUE
+#define TPM_PHYSICAL_PRESENCE_LOCK ((TPM_PHYSICAL_PRESENCE) 0x0004) // Sets PhysicalPresenceLock = TRUE
+
+//
+// Part 2, section 4.10: TPM_MIGRATE_SCHEME
+//
+#define TPM_MS_MIGRATE ((TPM_MIGRATE_SCHEME) 0x0001) // A public key that can be used with all TPM migration commands other than 'ReWrap' mode.
+#define TPM_MS_REWRAP ((TPM_MIGRATE_SCHEME) 0x0002) // A public key that can be used for the ReWrap mode of TPM_CreateMigrationBlob.
+#define TPM_MS_MAINT ((TPM_MIGRATE_SCHEME) 0x0003) // A public key that can be used for the Maintenance commands
+#define TPM_MS_RESTRICT_MIGRATE ((TPM_MIGRATE_SCHEME) 0x0004) // The key is to be migrated to a Migration Authority.
+#define TPM_MS_RESTRICT_APPROVE_DOUBLE ((TPM_MIGRATE_SCHEME) 0x0005) // The key is to be migrated to an entity approved by a Migration Authority using double wrapping
+
+//
+// Part 2, section 4.11: TPM_EK_TYPE
+//
+#define TPM_EK_TYPE_ACTIVATE ((TPM_EK_TYPE) 0x0001) // The blob MUST be TPM_EK_BLOB_ACTIVATE
+#define TPM_EK_TYPE_AUTH ((TPM_EK_TYPE) 0x0002) // The blob MUST be TPM_EK_BLOB_AUTH
+
+//
+// Part 2, section 4.12: TPM_PLATFORM_SPECIFIC
+//
+#define TPM_PS_PC_11 ((TPM_PLATFORM_SPECIFIC) 0x0001) // PC Specific version 1.1
+#define TPM_PS_PC_12 ((TPM_PLATFORM_SPECIFIC) 0x0002) // PC Specific version 1.2
+#define TPM_PS_PDA_12 ((TPM_PLATFORM_SPECIFIC) 0x0003) // PDA Specific version 1.2
+#define TPM_PS_Server_12 ((TPM_PLATFORM_SPECIFIC) 0x0004) // Server Specific version 1.2
+#define TPM_PS_Mobile_12 ((TPM_PLATFORM_SPECIFIC) 0x0005) // Mobil Specific version 1.2
+
+//
+// Part 2, section 5: Basic Structures
+//
+
+//
+// Part 2, section 5.1: TPM_STRUCT_VER
+//
+typedef struct _TPM_STRUCT_VER {
+ UINT8 major;
+ UINT8 minor;
+ UINT8 revMajor;
+ UINT8 revMinor;
+} TPM_STRUCT_VER;
+
+//
+// Part 2, section 5.3: TPM_VERSION
+//
+typedef struct _TPM_VERSION {
+ TPM_VERSION_BYTE major;
+ TPM_VERSION_BYTE minor;
+ UINT8 revMajor;
+ UINT8 revMinor;
+} TPM_VERSION;
+
+//
+// Part 2, section 5.4: TPM_DIGEST
+//
+#define TPM_SHA1_160_HASH_LEN 0x14
+#define TPM_SHA1BASED_NONCE_LEN TPM_SHA1_160_HASH_LEN
+
+typedef struct _TPM_DIGEST{
+ UINT8 digest[TPM_SHA1_160_HASH_LEN];
+} TPM_DIGEST;
+
+typedef TPM_DIGEST TPM_CHOSENID_HASH; // This SHALL be the digest of the chosen identityLabel and privacyCA for a new TPM identity.
+typedef TPM_DIGEST TPM_COMPOSITE_HASH; // This SHALL be the hash of a list of PCR indexes and PCR values that a key or data is bound to.
+typedef TPM_DIGEST TPM_DIRVALUE; // This SHALL be the value of a DIR register
+typedef TPM_DIGEST TPM_HMAC;
+typedef TPM_DIGEST TPM_PCRVALUE; // The value inside of the PCR
+typedef TPM_DIGEST TPM_AUDITDIGEST; // This SHALL be the value of the current internal audit state
+
+//
+// Part 2, section 5.5: TPM_NONCE
+//
+typedef struct _TPM_NONCE{
+ UINT8 nonce[20];
+} TPM_NONCE;
+
+typedef TPM_NONCE TPM_DAA_TPM_SEED; // This SHALL be a random value generated by a TPM immediately after the EK is installed in that TPM, whenever an EK is installed in that TPM
+typedef TPM_NONCE TPM_DAA_CONTEXT_SEED; // This SHALL be a random value
+
+//
+// Part 2, section 5.6: TPM_AUTHDATA
+//
+typedef UINT8 TPM_AUTHDATA[20];
+typedef TPM_AUTHDATA TPM_SECRET;
+typedef TPM_AUTHDATA TPM_ENCAUTH;
+
+//
+// Part 2, section 5.7: TPM_KEY_HANDLE_LIST
+// Size of handle is loaded * sizeof(TPM_KEY_HANDLE)
+//
+typedef struct _TPM_KEY_HANDLE_LIST {
+ UINT16 loaded;
+ TPM_KEY_HANDLE handle[1];
+} TPM_KEY_HANDLE_LIST;
+
+//
+// Part 2, section 5.8: TPM_KEY_USAGE values
+//
+
+#define TPM_KEY_SIGNING ((UINT16) 0x0010)
+// TPM_KEY_SIGNING SHALL indicate a signing key. The [private] key SHALL be
+// used for signing operations, only. This means that it MUST be a leaf of the
+// Protected Storage key hierarchy.
+
+#define TPM_KEY_STORAGE ((UINT16) 0x0011)
+// TPM_KEY_STORAGE SHALL indicate a storage key. The key SHALL be used to wrap
+// and unwrap other keys in the Protected Storage hierarchy
+
+#define TPM_KEY_IDENTITY ((UINT16) 0x0012)
+// TPM_KEY_IDENTITY SHALL indicate an identity key. The key SHALL be used for
+// operations that require a TPM identity, only.
+
+#define TPM_KEY_AUTHCHANGE ((UINT16) 0x0013)
+// TPM_KEY_AUTHCHANGE SHALL indicate an ephemeral key that is in use during
+// the ChangeAuthAsym process, only.
+
+#define TPM_KEY_BIND ((UINT16) 0x0014)
+// TPM_KEY_BIND SHALL indicate a key that can be used for TPM_Bind and
+// TPM_Unbind operations only.
+
+#define TPM_KEY_LEGACY ((UINT16) 0x0015)
+// TPM_KEY_LEGACY SHALL indicate a key that can perform signing and binding
+// operations. The key MAY be used for both signing and binding operations.
+// The TPM_KEY_LEGACY key type is to allow for use by applications where both
+// signing and encryption operations occur with the same key. The use of this
+// key type is not recommended TPM_KEY_MIGRATE 0x0016 This SHALL indicate a
+// key in use for TPM_MigrateKey
+
+#define TPM_KEY_MIGRATE ((UINT16) 0x0016)
+// TPM_KEY_MIGRAGE SHALL indicate a key in use for TPM_MigrateKey
+
+//
+// Part 2, section 5.8.1: Encryption/Signature schemes
+//
+
+#define TPM_ES_NONE ((TPM_ENC_SCHEME) 0x0001)
+#define TPM_ES_RSAESPKCSv15 ((TPM_ENC_SCHEME) 0x0002)
+#define TPM_ES_RSAESOAEP_SHA1_MGF1 ((TPM_ENC_SCHEME) 0x0003)
+#define TPM_ES_SYM_CNT ((TPM_ENC_SCHEME) 0x0004) // rev94 defined
+#define TPM_ES_SYM_CTR ((TPM_ENC_SCHEME) 0x0004)
+#define TPM_ES_SYM_OFB ((TPM_ENC_SCHEME) 0x0005)
+
+#define TPM_SS_NONE ((TPM_SIG_SCHEME) 0x0001)
+#define TPM_SS_RSASSAPKCS1v15_SHA1 ((TPM_SIG_SCHEME) 0x0002)
+#define TPM_SS_RSASSAPKCS1v15_DER ((TPM_SIG_SCHEME) 0x0003)
+#define TPM_SS_RSASSAPKCS1v15_INFO ((TPM_SIG_SCHEME) 0x0004)
+
+//
+// Part 2, section 5.9: TPM_AUTH_DATA_USAGE values
+//
+#define TPM_AUTH_NEVER ((TPM_AUTH_DATA_USAGE) 0x00)
+#define TPM_AUTH_ALWAYS ((TPM_AUTH_DATA_USAGE) 0x01)
+#define TPM_AUTH_PRIV_USE_ONLY ((TPM_AUTH_DATA_USAGE) 0x03)
+
+//
+// Part 2, section 5.10: TPM_KEY_FLAGS
+//
+enum _TPM_KEY_FLAGS {
+ redirection = 0x00000001,
+ migratable = 0x00000002,
+ isVolatile = 0x00000004,
+ pcrIgnoredOnRead = 0x00000008,
+ migrateAuthority = 0x00000010
+};
+
+//
+// Part 2, section 5.11: TPM_CHANGEAUTH_VALIDATE
+//
+typedef struct _TPM_CHANGEAUTH_VALIDATE {
+ TPM_SECRET newAuthSecret;
+ TPM_NONCE n1;
+} TPM_CHANGEAUTH_VALIDATE;
+
+//
+// Part 2, section 5.12: TPM_MIGRATIONKEYAUTH
+// decalared after section 10 to catch declaration of TPM_PUBKEY
+//
+// Part 2 section 10.1: TPM_KEY_PARMS
+// [size_is(parmSize)] BYTE* parms;
+//
+typedef struct _TPM_KEY_PARMS {
+ TPM_ALGORITHM_ID algorithmID;
+ TPM_ENC_SCHEME encScheme;
+ TPM_SIG_SCHEME sigScheme;
+ UINT32 parmSize;
+ UINT8 *parms;
+} TPM_KEY_PARMS;
+
+//
+// Part 2, section 10.4: TPM_STORE_PUBKEY
+//
+typedef struct _TPM_STORE_PUBKEY {
+ UINT32 keyLength;
+ UINT8 key[1];
+} TPM_STORE_PUBKEY;
+
+//
+// Part 2, section 10.5: TPM_PUBKEY
+//
+typedef struct _TPM_PUBKEY{
+ TPM_KEY_PARMS algorithmParms;
+ TPM_STORE_PUBKEY pubKey;
+} TPM_PUBKEY;
+
+//
+// Part 2, section 5.12: TPM_MIGRATIONKEYAUTH
+//
+typedef struct _TPM_MIGRATIONKEYAUTH{
+ TPM_PUBKEY migrationKey;
+ TPM_MIGRATE_SCHEME migrationScheme;
+ TPM_DIGEST digest;
+} TPM_MIGRATIONKEYAUTH;
+
+//
+// Part 2, section 5.13: TPM_COUNTER_VALUE
+//
+typedef struct _TPM_COUNTER_VALUE{
+ TPM_STRUCTURE_TAG tag;
+ UINT8 label[4];
+ TPM_ACTUAL_COUNT counter;
+} TPM_COUNTER_VALUE;
+
+//
+// Part 2, section 5.14: TPM_SIGN_INFO
+// Size of data indicated by dataLen
+//
+typedef struct _TPM_SIGN_INFO {
+ TPM_STRUCTURE_TAG tag;
+ UINT8 fixed[4];
+ TPM_NONCE replay;
+ UINT32 dataLen;
+ UINT8 *data;
+} TPM_SIGN_INFO;
+
+//
+// Part 2, section 5.15: TPM_MSA_COMPOSITE
+// Number of migAuthDigest indicated by MSAlist
+//
+typedef struct _TPM_MSA_COMPOSITE {
+ UINT32 MSAlist;
+ TPM_DIGEST migAuthDigest[1];
+} TPM_MSA_COMPOSITE;
+
+//
+// Part 2, section 5.16: TPM_CMK_AUTH
+//
+typedef struct _TPM_CMK_AUTH{
+ TPM_DIGEST migrationAuthorityDigest;
+ TPM_DIGEST destinationKeyDigest;
+ TPM_DIGEST sourceKeyDigest;
+} TPM_CMK_AUTH;
+
+//
+// Part 2, section 5.17: TPM_CMK_DELEGATE
+//
+#define TPM_CMK_DELEGATE_SIGNING (((TPM_CMK_DELEGATE)1) << 31)
+#define TPM_CMK_DELEGATE_STORAGE (((TPM_CMK_DELEGATE)1) << 30)
+#define TPM_CMK_DELEGATE_BIND (((TPM_CMK_DELEGATE)1) << 29)
+#define TPM_CMK_DELEGATE_LEGACY (((TPM_CMK_DELEGATE)1) << 28)
+#define TPM_CMK_DELEGATE_MIGRATE (((TPM_CMK_DELEGATE)1) << 27)
+
+//
+// Part 2, section 5.18: TPM_SELECT_SIZE
+//
+typedef struct _TPM_SELECT_SIZE {
+ UINT8 major;
+ UINT8 minor;
+ UINT16 reqSize;
+} TPM_SELECT_SIZE;
+
+//
+// Part 2, section 5,19: TPM_CMK_MIGAUTH
+//
+typedef struct _TPM_CMK_MIGAUTH{
+ TPM_STRUCTURE_TAG tag;
+ TPM_DIGEST msaDigest;
+ TPM_DIGEST pubKeyDigest;
+} TPM_CMK_MIGAUTH;
+
+//
+// Part 2, section 5.20: TPM_CMK_SIGTICKET
+//
+typedef struct _TPM_CMK_SIGTICKET{
+ TPM_STRUCTURE_TAG tag;
+ TPM_DIGEST verKeyDigest;
+ TPM_DIGEST signedData;
+} TPM_CMK_SIGTICKET;
+
+//
+// Part 2, section 5.21: TPM_CMK_MA_APPROVAL
+//
+typedef struct _TPM_CMK_MA_APPROVAL{
+ TPM_STRUCTURE_TAG tag;
+ TPM_DIGEST migrationAuthorityDigest;
+} TPM_CMK_MA_APPROVAL;
+
+//
+// Part 2, section 6: Command Tags
+//
+#define TPM_TAG_RQU_COMMAND ((TPM_STRUCTURE_TAG) 0x00C1)
+#define TPM_TAG_RQU_AUTH1_COMMAND ((TPM_STRUCTURE_TAG) 0x00C2)
+#define TPM_TAG_RQU_AUTH2_COMMAND ((TPM_STRUCTURE_TAG) 0x00C3)
+#define TPM_TAG_RSP_COMMAND ((TPM_STRUCTURE_TAG) 0x00C4)
+#define TPM_TAG_RSP_AUTH1_COMMAND ((TPM_STRUCTURE_TAG) 0x00C5)
+#define TPM_TAG_RSP_AUTH2_COMMAND ((TPM_STRUCTURE_TAG) 0x00C6)
+
+//
+// Part 2, section 7.1: TPM_PERMANENT_FLAGS
+//
+typedef struct _TPM_PERMANENT_FLAGS{
+ TPM_STRUCTURE_TAG tag;
+ BOOLEAN disable;
+ BOOLEAN ownership;
+ BOOLEAN deactivated;
+ BOOLEAN readPubek;
+ BOOLEAN disableOwnerClear;
+ BOOLEAN allowMaintenance;
+ BOOLEAN physicalPresenceLifetimeLock;
+ BOOLEAN physicalPresenceHWEnable;
+ BOOLEAN physicalPresenceCMDEnable;
+ BOOLEAN CEKPUsed;
+ BOOLEAN TPMpost;
+ BOOLEAN TPMpostLock;
+ BOOLEAN FIPS;
+ BOOLEAN operator;
+ BOOLEAN enableRevokeEK;
+ BOOLEAN nvLocked;
+ BOOLEAN readSRKPub;
+ BOOLEAN tpmEstablished;
+ BOOLEAN maintenanceDone;
+ BOOLEAN disableFullDALogicInfo;
+} TPM_PERMANENT_FLAGS;
+
+//
+// Part 2, section 7.1.1: PERMANENT_FLAGS Subcap for SetCapability
+//
+#define TPM_PF_DISABLE ((TPM_CAPABILITY_AREA) 1)
+#define TPM_PF_OWNERSHIP ((TPM_CAPABILITY_AREA) 2)
+#define TPM_PF_DEACTIVATED ((TPM_CAPABILITY_AREA) 3)
+#define TPM_PF_READPUBEK ((TPM_CAPABILITY_AREA) 4)
+#define TPM_PF_DISABLEOWNERCLEAR ((TPM_CAPABILITY_AREA) 5)
+#define TPM_PF_ALLOWMAINTENANCE ((TPM_CAPABILITY_AREA) 6)
+#define TPM_PF_PHYSICALPRESENCELIFETIMELOCK ((TPM_CAPABILITY_AREA) 7)
+#define TPM_PF_PHYSICALPRESENCEHWENABLE ((TPM_CAPABILITY_AREA) 8)
+#define TPM_PF_PHYSICALPRESENCECMDENABLE ((TPM_CAPABILITY_AREA) 9)
+#define TPM_PF_CEKPUSED ((TPM_CAPABILITY_AREA) 10)
+#define TPM_PF_TPMPOST ((TPM_CAPABILITY_AREA) 11)
+#define TPM_PF_TPMPOSTLOCK ((TPM_CAPABILITY_AREA) 12)
+#define TPM_PF_FIPS ((TPM_CAPABILITY_AREA) 13)
+#define TPM_PF_OPERATOR ((TPM_CAPABILITY_AREA) 14)
+#define TPM_PF_ENABLEREVOKEEK ((TPM_CAPABILITY_AREA) 15)
+#define TPM_PF_NV_LOCKED ((TPM_CAPABILITY_AREA) 16)
+#define TPM_PF_READSRKPUB ((TPM_CAPABILITY_AREA) 17)
+#define TPM_PF_TPMESTABLISHED ((TPM_CAPABILITY_AREA) 18)
+#define TPM_PF_MAINTENANCEDONE ((TPM_CAPABILITY_AREA) 19)
+#define TPM_PF_DISABLEFULLDALOGICINFO ((TPM_CAPABILITY_AREA) 20)
+
+//
+// Part 2, section 7.2: TPM_STCLEAR_FLAGS
+//
+typedef struct _TPM_STCLEAR_FLAGS{
+ TPM_STRUCTURE_TAG tag;
+ BOOLEAN deactivated;
+ BOOLEAN disableForceClear;
+ BOOLEAN physicalPresence;
+ BOOLEAN physicalPresenceLock;
+ BOOLEAN bGlobalLock;
+} TPM_STCLEAR_FLAGS;
+
+//
+// Part 2, section 7.2.1: STCLEAR_FLAGS Subcap for SetCapability
+//
+#define TPM_SF_DEACTIVATED ((TPM_CAPABILITY_AREA) 1)
+#define TPM_SF_DISABLEFORCECLEAR ((TPM_CAPABILITY_AREA) 2)
+#define TPM_SF_PHYSICALPRESENCE ((TPM_CAPABILITY_AREA) 3)
+#define TPM_SF_PHYSICALPRESENCELOCK ((TPM_CAPABILITY_AREA) 4)
+#define TPM_SF_BGLOBALLOCK ((TPM_CAPABILITY_AREA) 5)
+
+//
+// Part 2, section 7.3: TPM_STANY_FLAGS
+//
+typedef struct _TPM_STANY_FLAGS{
+ TPM_STRUCTURE_TAG tag;
+ BOOLEAN postInitialise;
+ TPM_MODIFIER_INDICATOR localityModifier;
+ BOOLEAN transportExclusive;
+ BOOLEAN TOSPresent;
+} TPM_STANY_FLAGS;
+
+//
+// Part 2, section 7.3.1: STANY_FLAGS Subcap for SetCapability
+//
+#define TPM_AF_POSTINITIALISE ((TPM_CAPABILITY_AREA) 1)
+#define TPM_AF_LOCALITYMODIFIER ((TPM_CAPABILITY_AREA) 2)
+#define TPM_AF_TRANSPORTEXCLUSIVE ((TPM_CAPABILITY_AREA) 3)
+#define TPM_AF_TOSPRESENT ((TPM_CAPABILITY_AREA) 4)
+
+//
+// All those structures (section 7.4, 7.5, 7.6) are not normative and
+// thus no definitions here
+//
+// Part 2, section 7.4: TPM_PERMANENT_DATA
+//
+#define TPM_MIN_COUNTERS 4 // the minimum number of counters is 4
+#define TPM_DELEGATE_KEY TPM_KEY
+#define TPM_NUM_PCR 16
+#define TPM_MAX_NV_WRITE_NOOWNER 64
+
+//typedef struct _TPM_PERMANENT_DATA
+//{
+// TPM_STRUCTURE_TAG tag;
+// UINT8 revMajor;
+// UINT8 revMinor;
+// TPM_NONCE tpmProof;
+// TPM_NONCE ekReset;
+// TPM_SECRET ownerAuth;
+// TPM_SECRET operatorAuth;
+// TPM_DIRVALUE authDIR[1];
+// TPM_PUBKEY manuMaintPub;
+// TPM_KEY endorsementKey;
+// TPM_KEY srk;
+// TPM_KEY contextKey;
+// TPM_KEY delegateKey;
+// TPM_COUNTER_VALUE auditMonotonicCounter;
+// TPM_COUNTER_VALUE monitonicCounter[TPM_MIN_COUNTERS];
+// TPM_PCR_ATTRIBUTES pcrAttrib[TPM_NUM_PCR];
+// UINT8 ordinalAuditStatus[];
+// UINT8 *rngState;
+// TPM_FAMILY_TABLE familyTable;
+// TPM_DELEGATE_TABLE delegateTable;
+// UINT32 maxNVBufSize;
+// UINT32 lastFamilyID;
+// UINT32 noOwnerNVWrite;
+// TPM_CMK_DELEGATE restrictDelegate;
+// TPM_DAA_TPM_SEED tpmDAASeed;
+// TPM_NONCE daaProff;
+// TPM_KEY daaBlobKey;
+//} TPM_PERMANENT_DATA;
+
+//
+// Part 2, section 7.4.1: PERMANENT_DATA Subcap for SetCapability
+//
+#define TPM_PD_REVMAJOR ((TPM_CAPABILITY_AREA) 1)
+#define TPM_PD_REVMINOR ((TPM_CAPABILITY_AREA) 2)
+#define TPM_PD_TPMPROOF ((TPM_CAPABILITY_AREA) 3)
+#define TPM_PD_OWNERAUTH ((TPM_CAPABILITY_AREA) 4)
+#define TPM_PD_OPERATORAUTH ((TPM_CAPABILITY_AREA) 5)
+#define TPM_PD_MANUMAINTPUB ((TPM_CAPABILITY_AREA) 6)
+#define TPM_PD_ENDORSEMENTKEY ((TPM_CAPABILITY_AREA) 7)
+#define TPM_PD_SRK ((TPM_CAPABILITY_AREA) 8)
+#define TPM_PD_DELEGATEKEY ((TPM_CAPABILITY_AREA) 9)
+#define TPM_PD_CONTEXTKEY ((TPM_CAPABILITY_AREA) 10)
+#define TPM_PD_AUDITMONOTONICCOUNTER ((TPM_CAPABILITY_AREA) 11)
+#define TPM_PD_MONOTONICCOUNTER ((TPM_CAPABILITY_AREA) 12)
+#define TPM_PD_PCRATTRIB ((TPM_CAPABILITY_AREA) 13)
+#define TPM_PD_ORDINALAUDITSTATUS ((TPM_CAPABILITY_AREA) 14)
+#define TPM_PD_AUTHDIR ((TPM_CAPABILITY_AREA) 15)
+#define TPM_PD_RNGSTATE ((TPM_CAPABILITY_AREA) 16)
+#define TPM_PD_FAMILYTABLE ((TPM_CAPABILITY_AREA) 17)
+#define TPM_DELEGATETABLE ((TPM_CAPABILITY_AREA) 18)
+#define TPM_PD_EKRESET ((TPM_CAPABILITY_AREA) 19)
+#define TPM_PD_MAXNVBUFSIZE ((TPM_CAPABILITY_AREA) 20)
+#define TPM_PD_LASTFAMILYID ((TPM_CAPABILITY_AREA) 21)
+#define TPM_PD_NOOWNERNVWRITE ((TPM_CAPABILITY_AREA) 22)
+#define TPM_PD_RESTRICTDELEGATE ((TPM_CAPABILITY_AREA) 23)
+#define TPM_PD_TPMDAASEED ((TPM_CAPABILITY_AREA) 24)
+#define TPM_PD_DAAPROOF ((TPM_CAPABILITY_AREA) 25)
+
+//
+// Part 2, section 7.5: TPM_STCLEAR_DATA
+// available inside TPM only
+//
+ typedef struct _TPM_STCLEAR_DATA{
+ TPM_STRUCTURE_TAG tag;
+ TPM_NONCE contextNonceKey;
+ TPM_COUNT_ID countID;
+ UINT32 ownerReference;
+ BOOLEAN disableResetLock;
+ TPM_PCRVALUE PCR[TPM_NUM_PCR];
+ UINT32 deferredPhysicalPresence;
+ }TPM_STCLEAR_DATA;
+
+//
+// Part 2, section 7.5.1: STCLEAR_DATA Subcap for SetCapability
+//
+#define TPM_SD_CONTEXTNONCEKEY ((TPM_CAPABILITY_AREA)0x00000001)
+#define TPM_SD_COUNTID ((TPM_CAPABILITY_AREA)0x00000002)
+#define TPM_SD_OWNERREFERENCE ((TPM_CAPABILITY_AREA)0x00000003)
+#define TPM_SD_DISABLERESETLOCK ((TPM_CAPABILITY_AREA)0x00000004)
+#define TPM_SD_PCR ((TPM_CAPABILITY_AREA)0x00000005)
+#define TPM_SD_DEFERREDPHYSICALPRESENCE ((TPM_CAPABILITY_AREA)0x00000006)
+
+//
+// Part 2, section 7.6: TPM_STANY_DATA
+// available inside TPM only
+//
+//typedef struct _TPM_STANY_DATA
+//{
+// TPM_STRUCTURE_TAG tag;
+// TPM_NONCE contextNonceSession;
+// TPM_DIGEST auditDigest;
+// TPM_CURRENT_TICKS currentTicks;
+// UINT32 contextCount;
+// UINT32 contextList[TPM_MIN_SESSION_LIST];
+// TPM_SESSION_DATA sessions[TPM_MIN_SESSIONS];
+//} TPM_STANY_DATA;
+
+//
+// Part 2, section 7.6.1: STANY_DATA Subcap for SetCapability
+//
+#define TPM_AD_CONTEXTNONCESESSION ((TPM_CAPABILITY_AREA) 1)
+#define TPM_AD_AUDITDIGEST ((TPM_CAPABILITY_AREA) 2)
+#define TPM_AD_CURRENTTICKS ((TPM_CAPABILITY_AREA) 3)
+#define TPM_AD_CONTEXTCOUNT ((TPM_CAPABILITY_AREA) 4)
+#define TPM_AD_CONTEXTLIST ((TPM_CAPABILITY_AREA) 5)
+#define TPM_AD_SESSIONS ((TPM_CAPABILITY_AREA) 6)
+
+//
+// Part 2, section 8: PCR Structures
+//
+
+//
+// Part 2, section 8.1: TPM_PCR_SELECTION
+// Size of pcrSelect[] indicated by sizeOfSelect
+//
+typedef struct _TPM_PCR_SELECTION {
+ UINT16 sizeOfSelect;
+ UINT8 pcrSelect[1];
+} TPM_PCR_SELECTION;
+
+//
+// Part 2, section 8.2: TPM_PCR_COMPOSITE
+// Size of pcrValue[] indicated by valueSize
+//
+typedef struct _TPM_PCR_COMPOSITE {
+ TPM_PCR_SELECTION select;
+ UINT32 valueSize;
+ TPM_PCRVALUE pcrValue[1];
+} TPM_PCR_COMPOSITE;
+
+//
+// Part 2, section 8.3: TPM_PCR_INFO
+//
+typedef struct _TPM_PCR_INFO {
+ TPM_PCR_SELECTION pcrSelection;
+ TPM_COMPOSITE_HASH digestAtRelease;
+ TPM_COMPOSITE_HASH digestAtCreation;
+} TPM_PCR_INFO;
+
+//
+// Part 2, section 8.6: TPM_LOCALITY_SELECTION
+//
+typedef UINT8 TPM_LOCALITY_SELECTION;
+
+#define TPM_LOC_FOUR ((UINT8) 0x10)
+#define TPM_LOC_THREE ((UINT8) 0x08)
+#define TPM_LOC_TWO ((UINT8) 0x04)
+#define TPM_LOC_ONE ((UINT8) 0x02)
+#define TPM_LOC_ZERO ((UINT8) 0x01)
+
+//
+// Part 2, section 8.4: TPM_PCR_INFO_LONG
+//
+typedef struct _TPM_PCR_INFO_LONG {
+ TPM_STRUCTURE_TAG tag;
+ TPM_LOCALITY_SELECTION localityAtCreation;
+ TPM_LOCALITY_SELECTION localityAtRelease;
+ TPM_PCR_SELECTION creationPCRSelection;
+ TPM_PCR_SELECTION releasePCRSelection;
+ TPM_COMPOSITE_HASH digestAtCreation;
+ TPM_COMPOSITE_HASH digestAtRelease;
+} TPM_PCR_INFO_LONG;
+
+//
+// Part 2, section 8.5: TPM_PCR_INFO_SHORT
+//
+typedef struct _TPM_PCR_INFO_SHORT{
+ TPM_PCR_SELECTION pcrSelection;
+ TPM_LOCALITY_SELECTION localityAtRelease;
+ TPM_COMPOSITE_HASH digestAtRelease;
+} TPM_PCR_INFO_SHORT;
+
+//
+// Part 2, section 8.8: TPM_PCR_ATTRIBUTES
+//
+typedef struct _TPM_PCR_ATTRIBUTES{
+ BOOLEAN pcrReset;
+ TPM_LOCALITY_SELECTION pcrExtendLocal;
+ TPM_LOCALITY_SELECTION pcrResetLocal;
+} TPM_PCR_ATTRIBUTES;
+
+//
+// Part 2, section 9: Storage Structures
+//
+
+//
+// Part 2, section 9.1: TPM_STORED_DATA
+// [size_is(sealInfoSize)] BYTE* sealInfo;
+// [size_is(encDataSize)] BYTE* encData;
+//
+typedef struct _TPM_STORED_DATA {
+ TPM_STRUCT_VER ver;
+ UINT32 sealInfoSize;
+ UINT8 *sealInfo;
+ UINT32 encDataSize;
+ UINT8 *encData;
+} TPM_STORED_DATA;
+
+//
+// Part 2, section 9.2: TPM_STORED_DATA12
+// [size_is(sealInfoSize)] BYTE* sealInfo;
+// [size_is(encDataSize)] BYTE* encData;
+//
+typedef struct _TPM_STORED_DATA12 {
+ TPM_STRUCTURE_TAG tag;
+ TPM_ENTITY_TYPE et;
+ UINT32 sealInfoSize;
+ UINT8 *sealInfo;
+ UINT32 encDataSize;
+ UINT8 *encData;
+} TPM_STORED_DATA12;
+
+//
+// Part 2, section 9.3: TPM_SEALED_DATA
+// [size_is(dataSize)] BYTE* data;
+//
+typedef struct _TPM_SEALED_DATA {
+ TPM_PAYLOAD_TYPE payload;
+ TPM_SECRET authData;
+ TPM_NONCE tpmProof;
+ TPM_DIGEST storedDigest;
+ UINT32 dataSize;
+ UINT8 *data;
+} TPM_SEALED_DATA;
+
+//
+// Part 2, section 9.4: TPM_SYMMETRIC_KEY
+// [size_is(size)] BYTE* data;
+//
+typedef struct _TPM_SYMMETRIC_KEY {
+ TPM_ALGORITHM_ID algId;
+ TPM_ENC_SCHEME encScheme;
+ UINT16 dataSize;
+ UINT8 *data;
+} TPM_SYMMETRIC_KEY;
+
+//
+// Part 2, section 9.5: TPM_BOUND_DATA
+//
+typedef struct _TPM_BOUND_DATA {
+ TPM_STRUCT_VER ver;
+ TPM_PAYLOAD_TYPE payload;
+ UINT8 payloadData[1];
+} TPM_BOUND_DATA;
+
+//
+// Part 2 section 10: TPM_KEY complex
+//
+
+//
+// Part 2, section 10.2: TPM_KEY
+// [size_is(encDataSize)] BYTE* encData;
+//
+typedef struct _TPM_KEY{
+ TPM_STRUCT_VER ver;
+ TPM_KEY_USAGE keyUsage;
+ TPM_KEY_FLAGS keyFlags;
+ TPM_AUTH_DATA_USAGE authDataUsage;
+ TPM_KEY_PARMS algorithmParms;
+ UINT32 PCRInfoSize;
+ UINT8 *PCRInfo;
+ TPM_STORE_PUBKEY pubKey;
+ UINT32 encDataSize;
+ UINT8 *encData;
+} TPM_KEY;
+
+//
+// Part 2, section 10.3: TPM_KEY12
+// [size_is(encDataSize)] BYTE* encData;
+//
+typedef struct _TPM_KEY12{
+ TPM_STRUCTURE_TAG tag;
+ UINT16 fill;
+ TPM_KEY_USAGE keyUsage;
+ TPM_KEY_FLAGS keyFlags;
+ TPM_AUTH_DATA_USAGE authDataUsage;
+ TPM_KEY_PARMS algorithmParms;
+ UINT32 PCRInfoSize;
+ UINT8 *PCRInfo;
+ TPM_STORE_PUBKEY pubKey;
+ UINT32 encDataSize;
+ UINT8 *encData;
+} TPM_KEY12;
+
+//
+// Part 2, section 10.7: TPM_STORE_PRIVKEY
+// [size_is(keyLength)] BYTE* key;
+//
+typedef struct _TPM_STORE_PRIVKEY {
+ UINT32 keyLength;
+ UINT8 *key;
+} TPM_STORE_PRIVKEY;
+
+//
+// Part 2, section 10.6: TPM_STORE_ASYMKEY
+//
+typedef struct _TPM_STORE_ASYMKEY { // pos len total
+ TPM_PAYLOAD_TYPE payload; // 0 1 1
+ TPM_SECRET usageAuth; // 1 20 21
+ TPM_SECRET migrationAuth; // 21 20 41
+ TPM_DIGEST pubDataDigest; // 41 20 61
+ TPM_STORE_PRIVKEY privKey; // 61 132-151 193-214
+} TPM_STORE_ASYMKEY;
+
+//
+// Part 2, section 10.8: TPM_MIGRATE_ASYMKEY
+// [size_is(partPrivKeyLen)] BYTE* partPrivKey;
+//
+typedef struct _TPM_MIGRATE_ASYMKEY { // pos len total
+ TPM_PAYLOAD_TYPE payload; // 0 1 1
+ TPM_SECRET usageAuth; // 1 20 21
+ TPM_DIGEST pubDataDigest; // 21 20 41
+ UINT32 partPrivKeyLen; // 41 4 45
+ UINT8 *partPrivKey; // 45 112-127 157-172
+} TPM_MIGRATE_ASYMKEY;
+
+//
+// Part 2, section 10.9: TPM_KEY_CONTROL
+//
+#define TPM_KEY_CONTROL_OWNER_EVICT ((UINT32) 0x00000001)
+
+//
+// Part 2, section 11: Signed Structures
+//
+
+typedef struct _TPM_CERTIFY_INFO
+{
+ TPM_STRUCT_VER version;
+ TPM_KEY_USAGE keyUsage;
+ TPM_KEY_FLAGS keyFlags;
+ TPM_AUTH_DATA_USAGE authDataUsage;
+ TPM_KEY_PARMS algorithmParms;
+ TPM_DIGEST pubkeyDigest;
+ TPM_NONCE data;
+ BOOLEAN parentPCRStatus;
+ UINT32 PCRInfoSize;
+ UINT8 *PCRInfo;
+} TPM_CERTIFY_INFO;
+
+typedef struct _TPM_CERTIFY_INFO2
+{
+ TPM_STRUCTURE_TAG tag;
+ UINT8 fill;
+ TPM_PAYLOAD_TYPE payloadType;
+ TPM_KEY_USAGE keyUsage;
+ TPM_KEY_FLAGS keyFlags;
+ TPM_AUTH_DATA_USAGE authDataUsage;
+ TPM_KEY_PARMS algorithmParms;
+ TPM_DIGEST pubkeyDigest;
+ TPM_NONCE data;
+ BOOLEAN parentPCRStatus;
+ UINT32 PCRInfoSize;
+ UINT8 *PCRInfo;
+ UINT32 migrationAuthoritySize;
+ UINT8 *migrationAuthority;
+} TPM_CERTIFY_INFO2;
+
+typedef struct _TPM_QUOTE_INFO
+{
+ TPM_STRUCT_VER version;
+ UINT8 fixed[4];
+ TPM_COMPOSITE_HASH digestValue;
+ TPM_NONCE externalData;
+} TPM_QUOTE_INFO;
+
+typedef struct _TPM_QUOTE_INFO2
+{
+ TPM_STRUCTURE_TAG tag;
+ UINT8 fixed[4];
+ TPM_NONCE externalData;
+ TPM_PCR_INFO_SHORT infoShort;
+} TPM_QUOTE_INFO2;
+
+//
+// Part 2, section 12: Identity Structures
+//
+
+typedef struct _TPM_EK_BLOB
+{
+ TPM_STRUCTURE_TAG tag;
+ TPM_EK_TYPE ekType;
+ UINT32 blobSize;
+ UINT8 *blob;
+} TPM_EK_BLOB;
+
+typedef struct _TPM_EK_BLOB_ACTIVATE
+{
+ TPM_STRUCTURE_TAG tag;
+ TPM_SYMMETRIC_KEY sessionKey;
+ TPM_DIGEST idDigest;
+ TPM_PCR_INFO_SHORT pcrInfo;
+} TPM_EK_BLOB_ACTIVATE;
+
+typedef struct _TPM_EK_BLOB_AUTH
+{
+ TPM_STRUCTURE_TAG tag;
+ TPM_SECRET authValue;
+} TPM_EK_BLOB_AUTH;
+
+
+// TPM_CHOSENID_HASH = SHA(identityLabel || privacyCA)
+typedef TPM_DIGEST TPM_CHOSENID_HASH;
+
+typedef struct _TPM_IDENTITY_CONTENTS
+{
+ TPM_STRUCT_VER ver;
+ UINT32 ordinal;
+ TPM_CHOSENID_HASH labelPrivCADigest;
+ TPM_PUBKEY identityPubKey;
+} TPM_IDENTITY_CONTENTS;
+
+typedef struct _TPM_IDENTITY_REQ
+{
+ UINT32 asymSize;
+ UINT32 symSize;
+ TPM_KEY_PARMS asymAlgorithm;
+ TPM_KEY_PARMS symAlgorithm;
+ UINT8 *asymBlob;
+ UINT8 *symBlob;
+} TPM_IDENTITY_REQ;
+
+typedef struct _TPM_IDENTITY_PROOF
+{
+ TPM_STRUCT_VER ver;
+ UINT32 labelSize;
+ UINT32 identityBindingSize;
+ UINT32 endorsementSize;
+ UINT32 platformSize;
+ UINT32 conformanceSize;
+ TPM_PUBKEY identityKey;
+ UINT8 *labelArea;
+ UINT8 *identityBinding;
+ UINT8 *endorsementCredential;
+ UINT8 *platformCredential;
+ UINT8 *conformanceCredential;
+} TPM_IDENTITY_PROOF;
+
+typedef struct _TPM_ASYM_CA_CONTENTS
+{
+ TPM_SYMMETRIC_KEY sessionKey;
+ TPM_DIGEST idDigest;
+} TPM_ASYM_CA_CONTENTS;
+
+typedef struct _TPM_SYM_CA_ATTESTATION
+{
+ UINT32 credSize;
+ TPM_KEY_PARMS algorithm;
+ UINT8 *credential;
+} TPM_SYM_CA_ATTESTATION;
+
+//
+// Part 2, section 15: TPM_CURRENT_TICKS
+// Placed here out of order because definitions are used in section 13.
+//
+typedef struct _TPM_CURRENT_TICKS {
+ TPM_STRUCTURE_TAG tag;
+ UINT64 currentTicks;
+ UINT16 tickRate;
+ TPM_NONCE tickNonce;
+} TPM_CURRENT_TICKS;
+
+//
+// Part 2, section 13: Transport structures
+//
+
+#define TPM_TRANSPORT_ENCRYPT ((UINT32)0x00000001)
+#define TPM_TRANSPORT_LOG ((UINT32)0x00000002)
+#define TPM_TRANSPORT_EXCLUSIVE ((UINT32)0x00000004)
+
+typedef struct _TPM_TRANSPORT_PUBLIC
+{
+ TPM_STRUCTURE_TAG tag;
+ TPM_TRANSPORT_ATTRIBUTES transAttributes;
+ TPM_ALGORITHM_ID algId;
+ TPM_ENC_SCHEME encScheme;
+} TPM_TRANSPORT_PUBLIC;
+
+typedef struct _TPM_TRANSPORT_INTERNAL
+{
+ TPM_STRUCTURE_TAG tag;
+ TPM_AUTHDATA authData;
+ TPM_TRANSPORT_PUBLIC transPublic;
+ TPM_TRANSHANDLE transHandle;
+ TPM_NONCE transNonceEven;
+ TPM_DIGEST transDigest;
+} TPM_TRANSPORT_INTERNAL;
+
+typedef struct _TPM_TRANSPORT_LOG_IN
+{
+ TPM_STRUCTURE_TAG tag;
+ TPM_DIGEST parameters;
+ TPM_DIGEST pubKeyHash;
+} TPM_TRANSPORT_LOG_IN;
+
+typedef struct _TPM_TRANSPORT_LOG_OUT
+{
+ TPM_STRUCTURE_TAG tag;
+ TPM_CURRENT_TICKS currentTicks;
+ TPM_DIGEST parameters;
+ TPM_MODIFIER_INDICATOR locality;
+} TPM_TRANSPORT_LOG_OUT;
+
+typedef struct _TPM_TRANSPORT_AUTH
+{
+ TPM_STRUCTURE_TAG tag;
+ TPM_AUTHDATA authData;
+} TPM_TRANSPORT_AUTH;
+
+//
+// Part 2, section 14: Audit Structures
+//
+
+typedef struct _TPM_AUDIT_EVENT_IN
+{
+ TPM_STRUCTURE_TAG tag;
+ TPM_DIGEST inputParms;
+ TPM_COUNTER_VALUE auditCount;
+} TPM_AUDIT_EVENT_IN;
+
+typedef struct _TPM_AUDIT_EVENT_OUT
+{
+ TPM_STRUCTURE_TAG tag;
+ TPM_COMMAND_CODE ordinal;
+ TPM_DIGEST outputParms;
+ TPM_COUNTER_VALUE auditCount;
+ TPM_RESULT returnCode;
+} TPM_AUDIT_EVENT_OUT;
+
+//
+// Part 2, section 16: Return Codes
+//
+#ifndef TPM_BASE
+#error "TPM Error Codes require definition of TPM_BASE"
+#endif
+
+#define TPM_VENDOR_ERROR TPM_Vendor_Specific32
+#define TPM_NON_FATAL 0x00000800
+
+#define TPM_SUCCESS ((TPM_RESULT) TPM_BASE)
+#define TPM_AUTHFAIL ((TPM_RESULT) (TPM_BASE + 1))
+#define TPM_BADINDEX ((TPM_RESULT) (TPM_BASE + 2))
+#define TPM_BAD_PARAMETER ((TPM_RESULT) (TPM_BASE + 3))
+#define TPM_AUDITFAILURE ((TPM_RESULT) (TPM_BASE + 4))
+#define TPM_CLEAR_DISABLED ((TPM_RESULT) (TPM_BASE + 5))
+#define TPM_DEACTIVATED ((TPM_RESULT) (TPM_BASE + 6))
+#define TPM_DISABLED ((TPM_RESULT) (TPM_BASE + 7))
+#define TPM_DISABLED_CMD ((TPM_RESULT) (TPM_BASE + 8))
+#define TPM_FAIL ((TPM_RESULT) (TPM_BASE + 9))
+#define TPM_BAD_ORDINAL ((TPM_RESULT) (TPM_BASE + 10))
+#define TPM_INSTALL_DISABLED ((TPM_RESULT) (TPM_BASE + 11))
+#define TPM_INVALID_KEYHANDLE ((TPM_RESULT) (TPM_BASE + 12))
+#define TPM_KEYNOTFOUND ((TPM_RESULT) (TPM_BASE + 13))
+#define TPM_INAPPROPRIATE_ENC ((TPM_RESULT) (TPM_BASE + 14))
+#define TPM_MIGRATEFAIL ((TPM_RESULT) (TPM_BASE + 15))
+#define TPM_INVALID_PCR_INFO ((TPM_RESULT) (TPM_BASE + 16))
+#define TPM_NOSPACE ((TPM_RESULT) (TPM_BASE + 17))
+#define TPM_NOSRK ((TPM_RESULT) (TPM_BASE + 18))
+#define TPM_NOTSEALED_BLOB ((TPM_RESULT) (TPM_BASE + 19))
+#define TPM_OWNER_SET ((TPM_RESULT) (TPM_BASE + 20))
+#define TPM_RESOURCES ((TPM_RESULT) (TPM_BASE + 21))
+#define TPM_SHORTRANDOM ((TPM_RESULT) (TPM_BASE + 22))
+#define TPM_SIZE ((TPM_RESULT) (TPM_BASE + 23))
+#define TPM_WRONGPCRVAL ((TPM_RESULT) (TPM_BASE + 24))
+#define TPM_BAD_PARAM_SIZE ((TPM_RESULT) (TPM_BASE + 25))
+#define TPM_SHA_THREAD ((TPM_RESULT) (TPM_BASE + 26))
+#define TPM_SHA_ERROR ((TPM_RESULT) (TPM_BASE + 27))
+#define TPM_FAILEDSELFTEST ((TPM_RESULT) (TPM_BASE + 28))
+#define TPM_AUTH2FAIL ((TPM_RESULT) (TPM_BASE + 29))
+#define TPM_BADTAG ((TPM_RESULT) (TPM_BASE + 30))
+#define TPM_IOERROR ((TPM_RESULT) (TPM_BASE + 31))
+#define TPM_ENCRYPT_ERROR ((TPM_RESULT) (TPM_BASE + 32))
+#define TPM_DECRYPT_ERROR ((TPM_RESULT) (TPM_BASE + 33))
+#define TPM_INVALID_AUTHHANDLE ((TPM_RESULT) (TPM_BASE + 34))
+#define TPM_NO_ENDORSEMENT ((TPM_RESULT) (TPM_BASE + 35))
+#define TPM_INVALID_KEYUSAGE ((TPM_RESULT) (TPM_BASE + 36))
+#define TPM_WRONG_ENTITYTYPE ((TPM_RESULT) (TPM_BASE + 37))
+#define TPM_INVALID_POSTINIT ((TPM_RESULT) (TPM_BASE + 38))
+#define TPM_INAPPROPRIATE_SIG ((TPM_RESULT) (TPM_BASE + 39))
+#define TPM_BAD_KEY_PROPERTY ((TPM_RESULT) (TPM_BASE + 40))
+#define TPM_BAD_MIGRATION ((TPM_RESULT) (TPM_BASE + 41))
+#define TPM_BAD_SCHEME ((TPM_RESULT) (TPM_BASE + 42))
+#define TPM_BAD_DATASIZE ((TPM_RESULT) (TPM_BASE + 43))
+#define TPM_BAD_MODE ((TPM_RESULT) (TPM_BASE + 44))
+#define TPM_BAD_PRESENCE ((TPM_RESULT) (TPM_BASE + 45))
+#define TPM_BAD_VERSION ((TPM_RESULT) (TPM_BASE + 46))
+#define TPM_NO_WRAP_TRANSPORT ((TPM_RESULT) (TPM_BASE + 47))
+#define TPM_AUDITFAIL_UNSUCCESSFUL ((TPM_RESULT) (TPM_BASE + 48))
+#define TPM_AUDITFAIL_SUCCESSFUL ((TPM_RESULT) (TPM_BASE + 49))
+#define TPM_NOTRESETABLE ((TPM_RESULT) (TPM_BASE + 50))
+#define TPM_NOTLOCAL ((TPM_RESULT) (TPM_BASE + 51))
+#define TPM_BAD_TYPE ((TPM_RESULT) (TPM_BASE + 52))
+#define TPM_INVALID_RESOURCE ((TPM_RESULT) (TPM_BASE + 53))
+#define TPM_NOTFIPS ((TPM_RESULT) (TPM_BASE + 54))
+#define TPM_INVALID_FAMILY ((TPM_RESULT) (TPM_BASE + 55))
+#define TPM_NO_NV_PERMISSION ((TPM_RESULT) (TPM_BASE + 56))
+#define TPM_REQUIRES_SIGN ((TPM_RESULT) (TPM_BASE + 57))
+#define TPM_KEY_NOTSUPPORTED ((TPM_RESULT) (TPM_BASE + 58))
+#define TPM_AUTH_CONFLICT ((TPM_RESULT) (TPM_BASE + 59))
+#define TPM_AREA_LOCKED ((TPM_RESULT) (TPM_BASE + 60))
+#define TPM_BAD_LOCALITY ((TPM_RESULT) (TPM_BASE + 61))
+#define TPM_READ_ONLY ((TPM_RESULT) (TPM_BASE + 62))
+#define TPM_PER_NOWRITE ((TPM_RESULT) (TPM_BASE + 63))
+#define TPM_FAMILYCOUNT ((TPM_RESULT) (TPM_BASE + 64))
+#define TPM_WRITE_LOCKED ((TPM_RESULT) (TPM_BASE + 65))
+#define TPM_BAD_ATTRIBUTES ((TPM_RESULT) (TPM_BASE + 66))
+#define TPM_INVALID_STRUCTURE ((TPM_RESULT) (TPM_BASE + 67))
+#define TPM_KEY_OWNER_CONTROL ((TPM_RESULT) (TPM_BASE + 68))
+#define TPM_BAD_COUNTER ((TPM_RESULT) (TPM_BASE + 69))
+#define TPM_NOT_FULLWRITE ((TPM_RESULT) (TPM_BASE + 70))
+#define TPM_CONTEXT_GAP ((TPM_RESULT) (TPM_BASE + 71))
+#define TPM_MAXNVWRITES ((TPM_RESULT) (TPM_BASE + 72))
+#define TPM_NOOPERATOR ((TPM_RESULT) (TPM_BASE + 73))
+#define TPM_RESOURCEMISSING ((TPM_RESULT) (TPM_BASE + 74))
+#define TPM_DELEGATE_LOCK ((TPM_RESULT) (TPM_BASE + 75))
+#define TPM_DELEGATE_FAMILY ((TPM_RESULT) (TPM_BASE + 76))
+#define TPM_DELEGATE_ADMIN ((TPM_RESULT) (TPM_BASE + 77))
+#define TPM_TRANSPORT_NOTEXCLUSIVE ((TPM_RESULT) (TPM_BASE + 78))
+#define TPM_OWNER_CONTROL ((TPM_RESULT) (TPM_BASE + 79))
+#define TPM_DAA_RESOURCES ((TPM_RESULT) (TPM_BASE + 80))
+#define TPM_DAA_INPUT_DATA0 ((TPM_RESULT) (TPM_BASE + 81))
+#define TPM_DAA_INPUT_DATA1 ((TPM_RESULT) (TPM_BASE + 82))
+#define TPM_DAA_ISSUER_SETTINGS ((TPM_RESULT) (TPM_BASE + 83))
+#define TPM_DAA_TPM_SETTINGS ((TPM_RESULT) (TPM_BASE + 84))
+#define TPM_DAA_STAGE ((TPM_RESULT) (TPM_BASE + 85))
+#define TPM_DAA_ISSUER_VALIDITY ((TPM_RESULT) (TPM_BASE + 86))
+#define TPM_DAA_WRONG_W ((TPM_RESULT) (TPM_BASE + 87))
+#define TPM_BAD_HANDLE ((TPM_RESULT) (TPM_BASE + 88))
+#define TPM_BAD_DELEGATE ((TPM_RESULT) (TPM_BASE + 89))
+#define TPM_BADCONTEXT ((TPM_RESULT) (TPM_BASE + 90))
+#define TPM_TOOMANYCONTEXTS ((TPM_RESULT) (TPM_BASE + 91))
+#define TPM_MA_TICKET_SIGNATURE ((TPM_RESULT) (TPM_BASE + 92))
+#define TPM_MA_DESTINATION ((TPM_RESULT) (TPM_BASE + 93))
+#define TPM_MA_SOURCE ((TPM_RESULT) (TPM_BASE + 94))
+#define TPM_MA_AUTHORITY ((TPM_RESULT) (TPM_BASE + 95))
+#define TPM_PERMANENTEK ((TPM_RESULT) (TPM_BASE + 97))
+#define TPM_BAD_SIGNATURE ((TPM_RESULT) (TPM_BASE + 98))
+#define TPM_NOCONTEXTSPACE ((TPM_RESULT) (TPM_BASE + 99))
+
+#define TPM_RETRY ((TPM_RESULT) (TPM_BASE + TPM_NON_FATAL))
+#define TPM_NEEDS_SELFTEST ((TPM_RESULT) (TPM_BASE + TPM_NON_FATAL + 1))
+#define TPM_DOING_SELFTEST ((TPM_RESULT) (TPM_BASE + TPM_NON_FATAL + 2))
+#define TPM_DEFEND_LOCK_RUNNING ((TPM_RESULT) (TPM_BASE + TPM_NON_FATAL + 3))
+
+//
+// Part 2, section 17: Ordinals
+//
+// Ordinals are 32 bit values. The upper byte contains values that serve as
+// flag indicators, the next byte contains values indicating what committee
+// designated the ordinal, and the final two bytes contain the Command
+// Ordinal Index.
+// 3 2 1
+// 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0
+// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+// |P|C|V| Reserved| Purview | Command Ordinal Index |
+// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+//
+// Where:
+//
+// * P is Protected/Unprotected command. When 0 the command is a Protected
+// command, when 1 the command is an Unprotected command.
+//
+// * C is Non-Connection/Connection related command. When 0 this command
+// passes through to either the protected (TPM) or unprotected (TSS)
+// components.
+//
+// * V is TPM/Vendor command. When 0 the command is TPM defined, when 1 the
+// command is vendor defined.
+//
+// * All reserved area bits are set to 0.
+//
+
+#define TPM_ORD_ActivateIdentity ((TPM_COMMAND_CODE) 0x0000007A)
+#define TPM_ORD_AuthorizeMigrationKey ((TPM_COMMAND_CODE) 0x0000002B)
+#define TPM_ORD_CertifyKey ((TPM_COMMAND_CODE) 0x00000032)
+#define TPM_ORD_CertifyKey2 ((TPM_COMMAND_CODE) 0x00000033)
+#define TPM_ORD_CertifySelfTest ((TPM_COMMAND_CODE) 0x00000052)
+#define TPM_ORD_ChangeAuth ((TPM_COMMAND_CODE) 0x0000000C)
+#define TPM_ORD_ChangeAuthAsymFinish ((TPM_COMMAND_CODE) 0x0000000F)
+#define TPM_ORD_ChangeAuthAsymStart ((TPM_COMMAND_CODE) 0x0000000E)
+#define TPM_ORD_ChangeAuthOwner ((TPM_COMMAND_CODE) 0x00000010)
+#define TPM_ORD_CMK_ApproveMA ((TPM_COMMAND_CODE) 0x0000001D)
+#define TPM_ORD_CMK_ConvertMigration ((TPM_COMMAND_CODE) 0x00000024)
+#define TPM_ORD_CMK_CreateBlob ((TPM_COMMAND_CODE) 0x0000001B)
+#define TPM_ORD_CMK_CreateKey ((TPM_COMMAND_CODE) 0x00000013)
+#define TPM_ORD_CMK_CreateTicket ((TPM_COMMAND_CODE) 0x00000012)
+#define TPM_ORD_CMK_SetRestrictions ((TPM_COMMAND_CODE) 0x0000001C)
+#define TPM_ORD_ContinueSelfTest ((TPM_COMMAND_CODE) 0x00000053)
+#define TPM_ORD_ConvertMigrationBlob ((TPM_COMMAND_CODE) 0x0000002A)
+#define TPM_ORD_CreateCounter ((TPM_COMMAND_CODE) 0x000000DC)
+#define TPM_ORD_CreateEndorsementKeyPair ((TPM_COMMAND_CODE) 0x00000078)
+#define TPM_ORD_CreateMaintenanceArchive ((TPM_COMMAND_CODE) 0x0000002C)
+#define TPM_ORD_CreateMigrationBlob ((TPM_COMMAND_CODE) 0x00000028)
+#define TPM_ORD_CreateRevocableEK ((TPM_COMMAND_CODE) 0x0000007F)
+#define TPM_ORD_CreateWrapKey ((TPM_COMMAND_CODE) 0x0000001F)
+#define TPM_ORD_DAA_JOIN ((TPM_COMMAND_CODE) 0x00000029)
+#define TPM_ORD_DAA_SIGN ((TPM_COMMAND_CODE) 0x00000031)
+#define TPM_ORD_Delegate_CreateKeyDelegation ((TPM_COMMAND_CODE) 0x000000D4)
+#define TPM_ORD_Delegate_CreateOwnerDelegation ((TPM_COMMAND_CODE) 0x000000D5)
+#define TPM_ORD_Delegate_LoadOwnerDelegation ((TPM_COMMAND_CODE) 0x000000D8)
+#define TPM_ORD_Delegate_Manage ((TPM_COMMAND_CODE) 0x000000D2)
+#define TPM_ORD_Delegate_ReadTable ((TPM_COMMAND_CODE) 0x000000DB)
+#define TPM_ORD_Delegate_UpdateVerification ((TPM_COMMAND_CODE) 0x000000D1)
+#define TPM_ORD_Delegate_VerifyDelegation ((TPM_COMMAND_CODE) 0x000000D6)
+#define TPM_ORD_DirRead ((TPM_COMMAND_CODE) 0x0000001A)
+#define TPM_ORD_DirWriteAuth ((TPM_COMMAND_CODE) 0x00000019)
+#define TPM_ORD_DisableForceClear ((TPM_COMMAND_CODE) 0x0000005E)
+#define TPM_ORD_DisableOwnerClear ((TPM_COMMAND_CODE) 0x0000005C)
+#define TPM_ORD_DisablePubekRead ((TPM_COMMAND_CODE) 0x0000007E)
+#define TPM_ORD_DSAP ((TPM_COMMAND_CODE) 0x00000011)
+#define TPM_ORD_EstablishTransport ((TPM_COMMAND_CODE) 0x000000E6)
+#define TPM_ORD_EvictKey ((TPM_COMMAND_CODE) 0x00000022)
+#define TPM_ORD_ExecuteTransport ((TPM_COMMAND_CODE) 0x000000E7)
+#define TPM_ORD_Extend ((TPM_COMMAND_CODE) 0x00000014)
+#define TPM_ORD_FieldUpgrade ((TPM_COMMAND_CODE) 0x000000AA)
+#define TPM_ORD_FlushSpecific ((TPM_COMMAND_CODE) 0x000000BA)
+#define TPM_ORD_ForceClear ((TPM_COMMAND_CODE) 0x0000005D)
+#define TPM_ORD_GetAuditDigest ((TPM_COMMAND_CODE) 0x00000085)
+#define TPM_ORD_GetAuditDigestSigned ((TPM_COMMAND_CODE) 0x00000086)
+#define TPM_ORD_GetAuditEvent ((TPM_COMMAND_CODE) 0x00000082)
+#define TPM_ORD_GetAuditEventSigned ((TPM_COMMAND_CODE) 0x00000083)
+#define TPM_ORD_GetCapability ((TPM_COMMAND_CODE) 0x00000065)
+#define TPM_ORD_GetCapabilityOwner ((TPM_COMMAND_CODE) 0x00000066)
+#define TPM_ORD_GetCapabilitySigned ((TPM_COMMAND_CODE) 0x00000064)
+#define TPM_ORD_GetOrdinalAuditStatus ((TPM_COMMAND_CODE) 0x0000008C)
+#define TPM_ORD_GetPubKey ((TPM_COMMAND_CODE) 0x00000021)
+#define TPM_ORD_GetRandom ((TPM_COMMAND_CODE) 0x00000046)
+#define TPM_ORD_GetTestResult ((TPM_COMMAND_CODE) 0x00000054)
+#define TPM_ORD_GetTicks ((TPM_COMMAND_CODE) 0x000000F1)
+#define TPM_ORD_IncrementCounter ((TPM_COMMAND_CODE) 0x000000DD)
+#define TPM_ORD_Init ((TPM_COMMAND_CODE) 0x00000097)
+#define TPM_ORD_KeyControlOwner ((TPM_COMMAND_CODE) 0x00000023)
+#define TPM_ORD_KillMaintenanceFeature ((TPM_COMMAND_CODE) 0x0000002E)
+#define TPM_ORD_LoadAuthContext ((TPM_COMMAND_CODE) 0x000000B7)
+#define TPM_ORD_LoadContext ((TPM_COMMAND_CODE) 0x000000B9)
+#define TPM_ORD_LoadKey ((TPM_COMMAND_CODE) 0x00000020)
+#define TPM_ORD_LoadKey2 ((TPM_COMMAND_CODE) 0x00000041)
+#define TPM_ORD_LoadKeyContext ((TPM_COMMAND_CODE) 0x000000B5)
+#define TPM_ORD_LoadMaintenanceArchive ((TPM_COMMAND_CODE) 0x0000002D)
+#define TPM_ORD_LoadManuMaintPub ((TPM_COMMAND_CODE) 0x0000002F)
+#define TPM_ORD_MakeIdentity ((TPM_COMMAND_CODE) 0x00000079)
+#define TPM_ORD_MigrateKey ((TPM_COMMAND_CODE) 0x00000025)
+#define TPM_ORD_NV_DefineSpace ((TPM_COMMAND_CODE) 0x000000CC)
+#define TPM_ORD_NV_ReadValue ((TPM_COMMAND_CODE) 0x000000CF)
+#define TPM_ORD_NV_ReadValueAuth ((TPM_COMMAND_CODE) 0x000000D0)
+#define TPM_ORD_NV_WriteValue ((TPM_COMMAND_CODE) 0x000000CD)
+#define TPM_ORD_NV_WriteValueAuth ((TPM_COMMAND_CODE) 0x000000CE)
+#define TPM_ORD_OIAP ((TPM_COMMAND_CODE) 0x0000000A)
+#define TPM_ORD_OSAP ((TPM_COMMAND_CODE) 0x0000000B)
+#define TPM_ORD_OwnerClear ((TPM_COMMAND_CODE) 0x0000005B)
+#define TPM_ORD_OwnerReadInternalPub ((TPM_COMMAND_CODE) 0x00000081)
+#define TPM_ORD_OwnerReadPubek ((TPM_COMMAND_CODE) 0x0000007D)
+#define TPM_ORD_OwnerSetDisable ((TPM_COMMAND_CODE) 0x0000006E)
+#define TPM_ORD_PCR_Reset ((TPM_COMMAND_CODE) 0x000000C8)
+#define TPM_ORD_PcrRead ((TPM_COMMAND_CODE) 0x00000015)
+#define TPM_ORD_PhysicalDisable ((TPM_COMMAND_CODE) 0x00000070)
+#define TPM_ORD_PhysicalEnable ((TPM_COMMAND_CODE) 0x0000006F)
+#define TPM_ORD_PhysicalSetDeactivated ((TPM_COMMAND_CODE) 0x00000072)
+#define TPM_ORD_Quote ((TPM_COMMAND_CODE) 0x00000016)
+#define TPM_ORD_Quote2 ((TPM_COMMAND_CODE) 0x0000003E)
+#define TPM_ORD_ReadCounter ((TPM_COMMAND_CODE) 0x000000DE)
+#define TPM_ORD_ReadManuMaintPub ((TPM_COMMAND_CODE) 0x00000030)
+#define TPM_ORD_ReadPubek ((TPM_COMMAND_CODE) 0x0000007C)
+#define TPM_ORD_ReleaseCounter ((TPM_COMMAND_CODE) 0x000000DF)
+#define TPM_ORD_ReleaseCounterOwner ((TPM_COMMAND_CODE) 0x000000E0)
+#define TPM_ORD_ReleaseTransportSigned ((TPM_COMMAND_CODE) 0x000000E8)
+#define TPM_ORD_Reset ((TPM_COMMAND_CODE) 0x0000005A)
+#define TPM_ORD_ResetLockValue ((TPM_COMMAND_CODE) 0x00000040)
+#define TPM_ORD_RevokeTrust ((TPM_COMMAND_CODE) 0x00000080)
+#define TPM_ORD_SaveAuthContext ((TPM_COMMAND_CODE) 0x000000B6)
+#define TPM_ORD_SaveContext ((TPM_COMMAND_CODE) 0x000000B8)
+#define TPM_ORD_SaveKeyContext ((TPM_COMMAND_CODE) 0x000000B4)
+#define TPM_ORD_SaveState ((TPM_COMMAND_CODE) 0x00000098)
+#define TPM_ORD_Seal ((TPM_COMMAND_CODE) 0x00000017)
+#define TPM_ORD_Sealx ((TPM_COMMAND_CODE) 0x0000003D)
+#define TPM_ORD_SelfTestFull ((TPM_COMMAND_CODE) 0x00000050)
+#define TPM_ORD_SetCapability ((TPM_COMMAND_CODE) 0x0000003F)
+#define TPM_ORD_SetOperatorAuth ((TPM_COMMAND_CODE) 0x00000074)
+#define TPM_ORD_SetOrdinalAuditStatus ((TPM_COMMAND_CODE) 0x0000008D)
+#define TPM_ORD_SetOwnerInstall ((TPM_COMMAND_CODE) 0x00000071)
+#define TPM_ORD_SetOwnerPointer ((TPM_COMMAND_CODE) 0x00000075)
+#define TPM_ORD_SetRedirection ((TPM_COMMAND_CODE) 0x0000009A)
+#define TPM_ORD_SetTempDeactivated ((TPM_COMMAND_CODE) 0x00000073)
+#define TPM_ORD_SHA1Complete ((TPM_COMMAND_CODE) 0x000000A2)
+#define TPM_ORD_SHA1CompleteExtend ((TPM_COMMAND_CODE) 0x000000A3)
+#define TPM_ORD_SHA1Start ((TPM_COMMAND_CODE) 0x000000A0)
+#define TPM_ORD_SHA1Update ((TPM_COMMAND_CODE) 0x000000A1)
+#define TPM_ORD_Sign ((TPM_COMMAND_CODE) 0x0000003C)
+#define TPM_ORD_Startup ((TPM_COMMAND_CODE) 0x00000099)
+#define TPM_ORD_StirRandom ((TPM_COMMAND_CODE) 0x00000047)
+#define TPM_ORD_TakeOwnership ((TPM_COMMAND_CODE) 0x0000000D)
+#define TPM_ORD_Terminate_Handle ((TPM_COMMAND_CODE) 0x00000096)
+#define TPM_ORD_TickStampBlob ((TPM_COMMAND_CODE) 0x000000F2)
+#define TPM_ORD_UnBind ((TPM_COMMAND_CODE) 0x0000001E)
+#define TPM_ORD_Unseal ((TPM_COMMAND_CODE) 0x00000018)
+#define TSC_ORD_PhysicalPresence ((TPM_COMMAND_CODE) 0x4000000A)
+#define TSC_ORD_ResetEstablishmentBit ((TPM_COMMAND_CODE) 0x4000000B)
+
+//
+// Part 2, section 18: Context structures
+//
+
+typedef struct _TPM_CONTEXT_BLOB
+{
+ TPM_STRUCTURE_TAG tag;
+ TPM_RESOURCE_TYPE resourceType;
+ TPM_HANDLE handle;
+ UINT8 label[16];
+ UINT32 contextCount;
+ TPM_DIGEST integrityDigest;
+ UINT32 additionalSize;
+ UINT8 *additionalData;
+ UINT32 sensitiveSize;
+ UINT8 *sensitiveData;
+} TPM_CONTEXT_BLOB;
+
+typedef struct _TPM_CONTEXT_SENSITIVE
+{
+ TPM_STRUCTURE_TAG tag;
+ TPM_NONCE contextNonce;
+ UINT32 internalSize;
+ UINT8 *internalData;
+} TPM_CONTEXT_SENSITIVE;
+
+//
+// Part 2, section 19: NV Structures
+//
+
+#define TPM_NV_INDEX_LOCK ((UINT32)0xffffffff)
+#define TPM_NV_INDEX0 ((UINT32)0x00000000)
+#define TPM_NV_INDEX_DIR ((UINT32)0x10000001)
+#define TPM_NV_INDEX_EKCert ((UINT32)0x0000f000)
+#define TPM_NV_INDEX_TPM_CC ((UINT32)0x0000f001)
+#define TPM_NV_INDEX_PlatformCert ((UINT32)0x0000f002)
+#define TPM_NV_INDEX_Platform_CC ((UINT32)0x0000f003)
+// The following define ranges of reserved indices.
+#define TPM_NV_INDEX_TSS_BASE ((UINT32)0x00011100)
+#define TPM_NV_INDEX_PC_BASE ((UINT32)0x00011200)
+#define TPM_NV_INDEX_SERVER_BASE ((UINT32)0x00011300)
+#define TPM_NV_INDEX_MOBILE_BASE ((UINT32)0x00011400)
+#define TPM_NV_INDEX_PERIPHERAL_BASE ((UINT32)0x00011500)
+#define TPM_NV_INDEX_GROUP_RESV_BASE ((UINT32)0x00010000)
+
+typedef UINT32 TPM_NV_PER_ATTRIBUTES;
+// The typedefs TPM_NV_PER_ATTRIBUTES (not present in TPM 1.2 Spec. have been added
+// and structure fields that were to hold the following values
+#define TPM_NV_PER_READ_STCLEAR (((UINT32)1)<<31)
+#define TPM_NV_PER_AUTHREAD (((UINT32)1)<<18)
+#define TPM_NV_PER_OWNERREAD (((UINT32)1)<<17)
+#define TPM_NV_PER_PPREAD (((UINT32)1)<<16)
+#define TPM_NV_PER_GLOBALLOCK (((UINT32)1)<<15)
+#define TPM_NV_PER_WRITE_STCLEAR (((UINT32)1)<<14)
+#define TPM_NV_PER_WRITEDEFINE (((UINT32)1)<<13)
+#define TPM_NV_PER_WRITEALL (((UINT32)1)<<12)
+#define TPM_NV_PER_AUTHWRITE (((UINT32)1)<<2)
+#define TPM_NV_PER_OWNERWRITE (((UINT32)1)<<1)
+#define TPM_NV_PER_PPWRITE (((UINT32)1)<<0)
+
+typedef struct _TPM_NV_ATTRIBUTES
+{
+ TPM_STRUCTURE_TAG tag;
+ TPM_NV_PER_ATTRIBUTES attributes;
+} TPM_NV_ATTRIBUTES;
+
+
+typedef struct _TPM_NV_DATA_PUBLIC
+{
+ TPM_STRUCTURE_TAG tag;
+ TPM_NV_INDEX nvIndex;
+ TPM_PCR_INFO_SHORT pcrInfoRead;
+ TPM_PCR_INFO_SHORT pcrInfoWrite;
+ TPM_NV_ATTRIBUTES permission;
+ BOOLEAN bReadSTClear;
+ BOOLEAN bWriteSTClear;
+ BOOLEAN bWriteDefine;
+ UINT32 dataSize;
+} TPM_NV_DATA_PUBLIC;
+
+
+
+// Internal to TPM:
+//typedef struct _TPM_NV_DATA_SENSITIVE
+//{
+// TPM_STRUCTURE_TAG tag;
+// TPM_NV_DATA_PUBLIC pubInfo;
+// TPM_AUTHDATA authValue;
+// UINT8 *data;
+//} TPM_NV_DATA_SENSITIVE;
+
+
+//
+// Part 2, section 20: Delegation
+//
+
+//
+// Part 2, section 20.2.1: Owner Permissions Settings for per1 bits
+//
+#define TPM_DELEGATE_SetOrdinalAuditStatus (((UINT32)1)<<30)
+#define TPM_DELEGATE_DirWriteAuth (((UINT32)1)<<29)
+#define TPM_DELEGATE_CMK_ApproveMA (((UINT32)1)<<28)
+#define TPM_DELEGATE_NV_WriteValue (((UINT32)1)<<27)
+#define TPM_DELEGATE_CMK_CreateTicket (((UINT32)1)<<26)
+#define TPM_DELEGATE_NV_ReadValue (((UINT32)1)<<25)
+#define TPM_DELEGATE_Delegate_LoadOwnerDelegation (((UINT32)1)<<24)
+#define TPM_DELEGATE_DAA_Join (((UINT32)1)<<23)
+#define TPM_DELEGATE_AuthorizeMigrationKey (((UINT32)1)<<22)
+#define TPM_DELEGATE_CreateMaintenanceArchive (((UINT32)1)<<21)
+#define TPM_DELEGATE_LoadMaintenanceArchive (((UINT32)1)<<20)
+#define TPM_DELEGATE_KillMaintenanceFeature (((UINT32)1)<<19)
+#define TPM_DELEGATE_OwnerReadInteralPub (((UINT32)1)<<18)
+#define TPM_DELEGATE_ResetLockValue (((UINT32)1)<<17)
+#define TPM_DELEGATE_OwnerClear (((UINT32)1)<<16)
+#define TPM_DELEGATE_DisableOwnerClear (((UINT32)1)<<15)
+#define TPM_DELEGATE_NV_DefineSpace (((UINT32)1)<<14)
+#define TPM_DELEGATE_OwnerSetDisable (((UINT32)1)<<13)
+#define TPM_DELEGATE_SetCapability (((UINT32)1)<<12)
+#define TPM_DELEGATE_MakeIdentity (((UINT32)1)<<11)
+#define TPM_DELEGATE_ActivateIdentity (((UINT32)1)<<10)
+#define TPM_DELEGATE_OwnerReadPubek (((UINT32)1)<<9)
+#define TPM_DELEGATE_DisablePubekRead (((UINT32)1)<<8)
+#define TPM_DELEGATE_SetRedirection (((UINT32)1)<<7)
+#define TPM_DELEGATE_FieldUpgrade (((UINT32)1)<<6)
+#define TPM_DELEGATE_Delegate_UpdateVerification (((UINT32)1)<<5)
+#define TPM_DELEGATE_CreateCounter (((UINT32)1)<<4)
+#define TPM_DELEGATE_ReleaseCounterOwner (((UINT32)1)<<3)
+#define TPM_DELEGATE_DelegateManage (((UINT32)1)<<2)
+#define TPM_DELEGATE_Delegate_CreateOwnerDelegation (((UINT32)1)<<1)
+#define TPM_DELEGATE_DAA_Sign (((UINT32)1)<<0)
+
+//
+// Part 2, section 20.2.3: Key Permissions Settings for per1 bits
+//
+#define TPM_KEY_DELEGATE_CMK_ConvertMigration (((UINT32)1)<<28)
+#define TPM_KEY_DELEGATE_TickStampBlob (((UINT32)1)<<27)
+#define TPM_KEY_DELEGATE_ChangeAuthAsymStart (((UINT32)1)<<26)
+#define TPM_KEY_DELEGATE_ChangeAuthAsymFinish (((UINT32)1)<<25)
+#define TPM_KEY_DELEGATE_CMK_CreateKey (((UINT32)1)<<24)
+#define TPM_KEY_DELEGATE_MigrateKey (((UINT32)1)<<23)
+#define TPM_KEY_DELEGATE_LoadKey2 (((UINT32)1)<<22)
+#define TPM_KEY_DELEGATE_EstablishTransport (((UINT32)1)<<21)
+#define TPM_KEY_DELEGATE_ReleaseTransportSigned (((UINT32)1)<<20)
+#define TPM_KEY_DELEGATE_Quote2 (((UINT32)1)<<19)
+#define TPM_KEY_DELEGATE_Sealx (((UINT32)1)<<18)
+#define TPM_KEY_DELEGATE_MakeIdentity (((UINT32)1)<<17)
+#define TPM_KEY_DELEGATE_ActivateIdentity (((UINT32)1)<<16)
+#define TPM_KEY_DELEGATE_GetAuditDigestSigned (((UINT32)1)<<15)
+#define TPM_KEY_DELEGATE_Sign (((UINT32)1)<<14)
+#define TPM_KEY_DELEGATE_CertifyKey2 (((UINT32)1)<<13)
+#define TPM_KEY_DELEGATE_CertifyKey (((UINT32)1)<<12)
+#define TPM_KEY_DELEGATE_CreateWrapKey (((UINT32)1)<<11)
+#define TPM_KEY_DELEGATE_CMK_CreateBlob (((UINT32)1)<<10)
+#define TPM_KEY_DELEGATE_CreateMigrationBlob (((UINT32)1)<<9)
+#define TPM_KEY_DELEGATE_ConvertMigrationBlob (((UINT32)1)<<8)
+#define TPM_KEY_DELEGATE_CreateKeyDelegation (((UINT32)1)<<7)
+#define TPM_KEY_DELEGATE_ChangeAuth (((UINT32)1)<<6)
+#define TPM_KEY_DELEGATE_GetPubKey (((UINT32)1)<<5)
+#define TPM_KEY_DELEGATE_UnBind (((UINT32)1)<<4)
+#define TPM_KEY_DELEGATE_Quote (((UINT32)1)<<3)
+#define TPM_KEY_DELEGATE_Unseal (((UINT32)1)<<2)
+#define TPM_KEY_DELEGATE_Seal (((UINT32)1)<<1)
+#define TPM_KEY_DELEGATE_LoadKey (((UINT32)1)<<0)
+
+#define TPM_FAMILY_CREATE ((UINT32)0x00000001)
+#define TPM_FAMILY_ENABLE ((UINT32)0x00000002)
+#define TPM_FAMILY_ADMIN ((UINT32)0x00000003)
+#define TPM_FAMILY_INVALIDATE ((UINT32)0x00000004)
+
+#define TPM_FAMFLAG_DELEGATE_ADMIN_LOCK (((UINT32)1)<<1)
+#define TPM_FAMFLAG_ENABLE (((UINT32)1)<<0)
+
+typedef struct _TPM_FAMILY_LABEL
+{
+ UINT8 label;
+} TPM_FAMILY_LABEL;
+
+typedef struct _TPM_FAMILY_TABLE_ENTRY
+{
+ TPM_STRUCTURE_TAG tag;
+ TPM_FAMILY_LABEL label;
+ TPM_FAMILY_ID familyID;
+ TPM_FAMILY_VERIFICATION verificationCount;
+ TPM_FAMILY_FLAGS flags;
+} TPM_FAMILY_TABLE_ENTRY;
+
+#define TPM_FAMILY_TABLE_ENTRY_MIN 8
+//typedef struct _TPM_FAMILY_TABLE
+//{
+// TPM_FAMILY_TABLE_ENTRY FamTableRow[TPM_NUM_FAMILY_TABLE_ENTRY_MIN];
+//} TPM_FAMILY_TABLE;
+
+
+typedef struct _TPM_DELEGATE_LABEL
+{
+ UINT8 label;
+} TPM_DELEGATE_LABEL;
+
+
+typedef UINT32 TPM_DELEGATE_TYPE;
+#define TPM_DEL_OWNER_BITS ((UINT32)0x00000001)
+#define TPM_DEL_KEY_BITS ((UINT32)0x00000002)
+
+typedef struct _TPM_DELEGATIONS
+{
+ TPM_STRUCTURE_TAG tag;
+ TPM_DELEGATE_TYPE delegateType;
+ UINT32 per1;
+ UINT32 per2;
+} TPM_DELEGATIONS;
+
+typedef struct _TPM_DELEGATE_PUBLIC
+{
+ TPM_STRUCTURE_TAG tag;
+ TPM_DELEGATE_LABEL label;
+ TPM_PCR_INFO_SHORT pcrInfo;
+ TPM_DELEGATIONS permissions;
+ TPM_FAMILY_ID familyID;
+ TPM_FAMILY_VERIFICATION verificationCount;
+} TPM_DELEGATE_PUBLIC;
+
+typedef struct _TPM_DELEGATE_TABLE_ROW
+{
+ TPM_STRUCTURE_TAG tag;
+ TPM_DELEGATE_PUBLIC pub;
+ TPM_SECRET authValue;
+} TPM_DELEGATE_TABLE_ROW;
+
+
+#define TPM_NUM_DELEGATE_TABLE_ENTRY_MIN 2
+//typedef struct _TPM_DELEGATE_TABLE
+//{
+// TPM_DELEGATE_TABLE_ROW delRow[TPM_NUM_DELEGATE_TABLE_ENTRY_MIN];
+//} TPM_DELEGATE_TABLE;
+
+typedef struct _TPM_DELEGATE_SENSITIVE
+{
+ TPM_STRUCTURE_TAG tag;
+ TPM_SECRET authValue;
+} TPM_DELEGATE_SENSITIVE;
+
+typedef struct _TPM_DELEGATE_OWNER_BLOB
+{
+ TPM_STRUCTURE_TAG tag;
+ TPM_DELEGATE_PUBLIC pub;
+ TPM_DIGEST integrityDigest;
+ UINT32 additionalSize;
+ UINT8 *additionalArea;
+ UINT32 sensitiveSize;
+ UINT8 *sensitiveArea;
+} TPM_DELEGATE_OWNER_BLOB;
+
+typedef struct _TPM_DELEGATE_KEY_BLOB
+{
+ TPM_STRUCTURE_TAG tag;
+ TPM_DELEGATE_PUBLIC pub;
+ TPM_DIGEST integrityDigest;
+ TPM_DIGEST pubKeyDigest;
+ UINT32 additionalSize;
+ UINT8 *additionalArea;
+ UINT32 sensitiveSize;
+ UINT8 *sensitiveArea;
+} TPM_DELEGATE_KEY_BLOB;
+
+//
+// Part 2, section 21.1: TPM_CAPABILITY_AREA for GetCapability
+//
+#define TPM_CAP_ORD ((TPM_CAPABILITY_AREA) 0x00000001)
+#define TPM_CAP_ALG ((TPM_CAPABILITY_AREA) 0x00000002)
+#define TPM_CAP_PID ((TPM_CAPABILITY_AREA) 0x00000003)
+#define TPM_CAP_FLAG ((TPM_CAPABILITY_AREA) 0x00000004)
+#define TPM_CAP_PROPERTY ((TPM_CAPABILITY_AREA) 0x00000005)
+#define TPM_CAP_VERSION ((TPM_CAPABILITY_AREA) 0x00000006)
+#define TPM_CAP_KEY_HANDLE ((TPM_CAPABILITY_AREA) 0x00000007)
+#define TPM_CAP_CHECK_LOADED ((TPM_CAPABILITY_AREA) 0x00000008)
+#define TPM_CAP_SYM_MODE ((TPM_CAPABILITY_AREA) 0x00000009)
+#define TPM_CAP_KEY_STATUS ((TPM_CAPABILITY_AREA) 0x0000000C)
+#define TPM_CAP_NV_LIST ((TPM_CAPABILITY_AREA) 0x0000000D)
+#define TPM_CAP_MFR ((TPM_CAPABILITY_AREA) 0x00000010)
+#define TPM_CAP_NV_INDEX ((TPM_CAPABILITY_AREA) 0x00000011)
+#define TPM_CAP_TRANS_ALG ((TPM_CAPABILITY_AREA) 0x00000012)
+#define TPM_CAP_HANDLE ((TPM_CAPABILITY_AREA) 0x00000014)
+#define TPM_CAP_TRANS_ES ((TPM_CAPABILITY_AREA) 0x00000015)
+#define TPM_CAP_AUTH_ENCRYPT ((TPM_CAPABILITY_AREA) 0x00000017)
+#define TPM_CAP_SELECT_SIZE ((TPM_CAPABILITY_AREA) 0x00000018)
+#define TPM_CAP_VERSION_VAL ((TPM_CAPABILITY_AREA) 0x0000001A)
+
+#define TPM_CAP_FLAG_PERMANENT ((TPM_CAPABILITY_AREA) 0x00000108)
+#define TPM_CAP_FLAG_VOLATILE ((TPM_CAPABILITY_AREA) 0x00000109)
+
+//
+// Part 2, section 21.2: CAP_PROPERTY Subcap values for GetCapability
+//
+#define TPM_CAP_PROP_PCR ((TPM_CAPABILITY_AREA) 0x00000101)
+#define TPM_CAP_PROP_DIR ((TPM_CAPABILITY_AREA) 0x00000102)
+#define TPM_CAP_PROP_MANUFACTURER ((TPM_CAPABILITY_AREA) 0x00000103)
+#define TPM_CAP_PROP_KEYS ((TPM_CAPABILITY_AREA) 0x00000104)
+#define TPM_CAP_PROP_MIN_COUNTER ((TPM_CAPABILITY_AREA) 0x00000107)
+#define TPM_CAP_PROP_AUTHSESS ((TPM_CAPABILITY_AREA) 0x0000010A)
+#define TPM_CAP_PROP_TRANSESS ((TPM_CAPABILITY_AREA) 0x0000010B)
+#define TPM_CAP_PROP_COUNTERS ((TPM_CAPABILITY_AREA) 0x0000010C)
+#define TPM_CAP_PROP_MAX_AUTHSESS ((TPM_CAPABILITY_AREA) 0x0000010D)
+#define TPM_CAP_PROP_MAX_TRANSESS ((TPM_CAPABILITY_AREA) 0x0000010E)
+#define TPM_CAP_PROP_MAX_COUNTERS ((TPM_CAPABILITY_AREA) 0x0000010F)
+#define TPM_CAP_PROP_MAX_KEYS ((TPM_CAPABILITY_AREA) 0x00000110)
+#define TPM_CAP_PROP_OWNER ((TPM_CAPABILITY_AREA) 0x00000111)
+#define TPM_CAP_PROP_CONTEXT ((TPM_CAPABILITY_AREA) 0x00000112)
+#define TPM_CAP_PROP_MAX_CONTEXT ((TPM_CAPABILITY_AREA) 0x00000113)
+#define TPM_CAP_PROP_FAMILYROWS ((TPM_CAPABILITY_AREA) 0x00000114)
+#define TPM_CAP_PROP_TIS_TIMEOUT ((TPM_CAPABILITY_AREA) 0x00000115)
+#define TPM_CAP_PROP_STARTUP_EFFECT ((TPM_CAPABILITY_AREA) 0x00000116)
+#define TPM_CAP_PROP_DELEGATE_ROW ((TPM_CAPABILITY_AREA) 0x00000117)
+#define TPM_CAP_PROP_DAA_MAX ((TPM_CAPABILITY_AREA) 0x00000119)
+#define CAP_PROP_SESSION_DAA ((TPM_CAPABILITY_AREA) 0x0000011A)
+#define TPM_CAP_PROP_CONTEXT_DIST ((TPM_CAPABILITY_AREA) 0x0000011B)
+#define TPM_CAP_PROP_DAA_INTERRUPT ((TPM_CAPABILITY_AREA) 0x0000011C)
+#define TPM_CAP_PROP_SESSIONS ((TPM_CAPABILITY_AREA) 0x0000011D)
+#define TPM_CAP_PROP_MAX_SESSIONS ((TPM_CAPABILITY_AREA) 0x0000011E)
+#define TPM_CAP_PROP_CMK_RESTRICTION ((TPM_CAPABILITY_AREA) 0x0000011F)
+#define TPM_CAP_PROP_DURATION ((TPM_CAPABILITY_AREA) 0x00000120)
+#define TPM_CAP_PROP_ACTIVE_COUNTER ((TPM_CAPABILITY_AREA) 0x00000122)
+#define TPM_CAP_PROP_MAX_NV_AVAILABLE ((TPM_CAPABILITY_AREA) 0x00000123)
+#define TPM_CAP_PROP_INPUT_BUFFER ((TPM_CAPABILITY_AREA) 0x00000124)
+
+//
+// Part 2, section 21.4: TPM_CAPABILITY_AREA for SetCapability
+//
+#define TPM_SET_PERM_FLAGS ((TPM_CAPABILITY_AREA) 0x00000001)
+#define TPM_SET_PERM_DATA ((TPM_CAPABILITY_AREA) 0x00000002)
+#define TPM_SET_STCLEAR_FLAGS ((TPM_CAPABILITY_AREA) 0x00000003)
+#define TPM_SET_STCLEAR_DATA ((TPM_CAPABILITY_AREA) 0x00000004)
+#define TPM_SET_STANY_FLAGS ((TPM_CAPABILITY_AREA) 0x00000005)
+#define TPM_SET_STANY_DATA ((TPM_CAPABILITY_AREA) 0x00000006)
+
+// Part 2, section 21.6: TPM_CAP_VERSION_INFO
+// [size_is(vendorSpecificSize)] BYTE* vendorSpecific;
+//
+typedef struct _TPM_CAP_VERSION_INFO {
+ TPM_STRUCTURE_TAG tag;
+ TPM_VERSION version;
+ UINT16 specLevel;
+ UINT8 errataRev;
+ UINT8 tpmVendorID[4];
+ UINT16 vendorSpecificSize;
+ UINT8 *vendorSpecific;
+} TPM_CAP_VERSION_INFO;
+
+//
+// Part 2, section 21.10: TPM_DA_ACTION_TYPE
+//
+typedef struct _TPM_DA_ACTION_TYPE {
+ TPM_STRUCTURE_TAG tag;
+ UINT32 actions;
+} TPM_DA_ACTION_TYPE;
+
+#define TPM_DA_ACTION_FAILURE_MODE (((UINT32)1)<<3)
+#define TPM_DA_ACTION_DEACTIVATE (((UINT32)1)<<2)
+#define TPM_DA_ACTION_DISABLE (((UINT32)1)<<1)
+#define TPM_DA_ACTION_TIMEOUT (((UINT32)1)<<0)
+
+//
+// Part 2, section 21.7: TPM_DA_INFO
+//
+typedef struct _TPM_DA_INFO {
+ TPM_STRUCTURE_TAG tag;
+ TPM_DA_STATE state;
+ UINT16 currentCount;
+ UINT16 thresholdCount;
+ TPM_DA_ACTION_TYPE actionAtThreshold;
+ UINT32 actionDependValue;
+ UINT32 vendorDataSize;
+ UINT8 *vendorData;
+} TPM_DA_INFO;
+
+//
+// Part 2, section 21.8: TPM_DA_INFO_LIMITED
+//
+typedef struct _TPM_DA_INFO_LIMITED {
+ TPM_STRUCTURE_TAG tag;
+ TPM_DA_STATE state;
+ TPM_DA_ACTION_TYPE actionAtThreshold;
+ UINT32 vendorDataSize;
+ UINT8 *vendorData;
+} TPM_DA_INFO_LIMITED;
+
+//
+// Part 2, section 21.9: CAP_PROPERTY Subcap values for GetCapability
+//
+#define TPM_DA_STATE_INACTIVE ((UINT8)0x00)
+#define TPM_DA_STATE_ACTIVE ((UINT8)0x01)
+
+//
+// Part 2, section 22: DAA Structures
+//
+
+#define TPM_DAA_SIZE_r0 (43)
+#define TPM_DAA_SIZE_r1 (43)
+#define TPM_DAA_SIZE_r2 (128)
+#define TPM_DAA_SIZE_r3 (168)
+#define TPM_DAA_SIZE_r4 (219)
+#define TPM_DAA_SIZE_NT (20)
+#define TPM_DAA_SIZE_v0 (128)
+#define TPM_DAA_SIZE_v1 (192)
+#define TPM_DAA_SIZE_NE (256)
+#define TPM_DAA_SIZE_w (256)
+#define TPM_DAA_SIZE_issuerModulus (256)
+#define TPM_DAA_power0 (104)
+#define TPM_DAA_power1 (1024)
+
+typedef struct _TPM_DAA_ISSUER
+{
+ TPM_STRUCTURE_TAG tag;
+ TPM_DIGEST DAA_digest_R0;
+ TPM_DIGEST DAA_digest_R1;
+ TPM_DIGEST DAA_digest_S0;
+ TPM_DIGEST DAA_digest_S1;
+ TPM_DIGEST DAA_digest_n;
+ TPM_DIGEST DAA_digest_gamma;
+ UINT8 DAA_generic_q[26];
+} TPM_DAA_ISSUER;
+
+
+typedef struct _TPM_DAA_TPM
+{
+ TPM_STRUCTURE_TAG tag;
+ TPM_DIGEST DAA_digestIssuer;
+ TPM_DIGEST DAA_digest_v0;
+ TPM_DIGEST DAA_digest_v1;
+ TPM_DIGEST DAA_rekey;
+ UINT32 DAA_count;
+} TPM_DAA_TPM;
+
+typedef struct _TPM_DAA_CONTEXT
+{
+ TPM_STRUCTURE_TAG tag;
+ TPM_DIGEST DAA_digestContext;
+ TPM_DIGEST DAA_digest;
+ TPM_DAA_CONTEXT_SEED DAA_contextSeed;
+ UINT8 DAA_scratch[256];
+ UINT8 DAA_stage;
+} TPM_DAA_CONTEXT;
+
+typedef struct _TPM_DAA_JOINDATA
+{
+ UINT8 DAA_join_u0[128];
+ UINT8 DAA_join_u1[138];
+ TPM_DIGEST DAA_digest_n0;
+} TPM_DAA_JOINDATA;
+
+typedef struct _TPM_DAA_BLOB
+{
+ TPM_STRUCTURE_TAG tag;
+ TPM_RESOURCE_TYPE resourceType;
+ UINT8 label[16];
+ TPM_DIGEST blobIntegrity;
+ UINT32 additionalSize;
+ UINT8 *additionalData;
+ UINT32 sensitiveSize;
+ UINT8 *sensitiveData;
+} TPM_DAA_BLOB;
+
+typedef struct _TPM_DAA_SENSITIVE
+{
+ TPM_STRUCTURE_TAG tag;
+ UINT32 internalSize;
+ UINT8 *internalData;
+} TPM_DAA_SENSITIVE;
+
+
+//
+// Part 2, section 23: Redirection
+//
+
+// This section of the TPM spec defines exactly one value but does not
+// give it a name. The definition of TPM_SetRedirection in Part3
+// refers to exactly one name but does not give its value. We join
+// them here.
+#define TPM_REDIR_GPIO (0x00000001)
+
+//
+// TPM Command & Response Headers
+//
+typedef struct _TPM_RQU_COMMAND_HDR {
+ TPM_STRUCTURE_TAG tag;
+ UINT32 paramSize;
+ TPM_COMMAND_CODE ordinal;
+} TPM_RQU_COMMAND_HDR;
+
+typedef struct _TPM_RSP_COMMAND_HDR {
+ TPM_STRUCTURE_TAG tag;
+ UINT32 paramSize;
+ TPM_RESULT returnCode;
+} TPM_RSP_COMMAND_HDR;
+
+//****************************************************************************/
+// EFI definition according to TCG_EFI_Platform_1_20_Final
+//****************************************************************************/
+
+//
+// Standard event types
+//
+#define EV_POST_CODE ((TCG_EVENTTYPE) 0x00000001)
+#define EV_SEPARATOR ((TCG_EVENTTYPE) 0x00000004)
+#define EV_S_CRTM_CONTENTS ((TCG_EVENTTYPE) 0x00000007)
+#define EV_S_CRTM_VERSION ((TCG_EVENTTYPE) 0x00000008)
+
+//
+// EFI specific event types
+//
+#define EV_EFI_EVENT_BASE ((TCG_EVENTTYPE) 0x80000000)
+#define EV_EFI_VARIABLE_DRIVER_CONFIG (EV_EFI_EVENT_BASE + 1)
+#define EV_EFI_VARIABLE_BOOT (EV_EFI_EVENT_BASE + 2)
+#define EV_EFI_BOOT_SERVICES_APPLICATION (EV_EFI_EVENT_BASE + 3)
+#define EV_EFI_BOOT_SERVICES_DRIVER (EV_EFI_EVENT_BASE + 4)
+#define EV_EFI_RUNTIME_SERVICES_DRIVER (EV_EFI_EVENT_BASE + 5)
+#define EV_EFI_GPT_EVENT (EV_EFI_EVENT_BASE + 6)
+#define EV_EFI_ACTION (EV_EFI_EVENT_BASE + 7)
+#define EV_EFI_PLATFORM_FIRMWARE_BLOB (EV_EFI_EVENT_BASE + 8)
+#define EV_EFI_HANDOFF_TABLES (EV_EFI_EVENT_BASE + 9)
+
+typedef UINT32 TCG_EVENTTYPE;
+
+#define TCG_DIGEST TPM_DIGEST
+#define TCG_PCRINDEX TPM_PCRINDEX
+
+//
+// TCG_PCR_EVENT
+//
+typedef struct _TCG_PCR_EVENT {
+ TCG_PCRINDEX PCRIndex; // PCRIndex event extended to
+ TCG_EVENTTYPE EventType; // TCG EFI event type
+ TCG_DIGEST Digest; // Value extended into PCRIndex
+ UINT32 EventSize; // Size of the event data
+ UINT8 Event[1]; // The event data
+} TCG_PCR_EVENT;
+
+//
+// TCG_PCR_EVENT_HDR
+//
+typedef struct _TCG_PCR_EVENT_HDR {
+ TCG_PCRINDEX PCRIndex;
+ TCG_EVENTTYPE EventType;
+ TCG_DIGEST Digest;
+ UINT32 EventSize;
+} TCG_PCR_EVENT_HDR;
+
+//
+// EFI_PLATFORM_FIRMWARE_BLOB
+//
+// BlobLength should be of type UINTN but we use UINT64 here
+// because PEI is 32-bit while DXE is 64-bit on x64 platforms
+//
+typedef struct _EFI_PLATFORM_FIRMWARE_BLOB {
+ EFI_PHYSICAL_ADDRESS BlobBase;
+ UINT64 BlobLength;
+} EFI_PLATFORM_FIRMWARE_BLOB;
+
+//
+// EFI_IMAGE_LOAD_EVENT
+//
+// This structure is used in EV_EFI_BOOT_SERVICES_APPLICATION,
+// EV_EFI_BOOT_SERVICES_DRIVER and EV_EFI_RUNTIME_SERVICES_DRIVER
+//
+typedef struct _EFI_IMAGE_LOAD_EVENT {
+ EFI_PHYSICAL_ADDRESS ImageLocationInMemory;
+ UINTN ImageLengthInMemory;
+ UINTN ImageLinkTimeAddress;
+ UINTN LengthOfDevicePath;
+ EFI_DEVICE_PATH_PROTOCOL DevicePath[1];
+} EFI_IMAGE_LOAD_EVENT;
+
+//
+// EFI_HANDOFF_TABLE_POINTERS
+//
+// This structure is used in EV_EFI_HANDOFF_TABLES event to facilitate
+// the measurement of given configuration tables.
+//
+typedef struct _EFI_HANDOFF_TABLE_POINTERS {
+ UINTN NumberOfTables;
+ EFI_CONFIGURATION_TABLE TableEntry[1];
+} EFI_HANDOFF_TABLE_POINTERS;
+
+//
+// EFI_VARIABLE_DATA
+//
+// This structure serves as the header for measuring variables. The name of the
+// variable (in Unicode format) should immediately follow, then the variable
+// data.
+//
+typedef struct _EFI_VARIABLE_DATA {
+ EFI_GUID VariableName;
+ UINTN UnicodeNameLength;
+ UINTN VariableDataLength;
+ CHAR16 UnicodeName[1];
+ INT8 VariableData[1]; // Driver or platform-specific data
+} EFI_VARIABLE_DATA;
+
+//
+// Restore original structure alignment
+//
+#pragma pack (pop)
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2009, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
diff --git a/Include/UefiHii.h b/Include/UefiHii.h
new file mode 100644
index 0000000..b5683c4
--- /dev/null
+++ b/Include/UefiHii.h
@@ -0,0 +1,1297 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/BIN/Core/Include/UefiHii.h 12 5/22/12 10:25a Artems $
+//
+// $Revision: 12 $
+//
+// $Date: 5/22/12 10:25a $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Core/Include/UefiHii.h $
+//
+// 12 5/22/12 10:25a Artems
+// [TAG] EIP83593
+// [Category] New Feature
+// [Description] Proportional font support for Aptio
+// [Files] UefiHii.h HiiFont.c HiiFontEx.c HiiDatabase.c HiiString.c
+//
+// 11 12/21/11 10:52a Artems
+// Fixed bug in EFI_NUM_LOCK _MODIFIER macro
+//
+// 10 7/21/11 4:00p Artems
+// EIP 64356: Combine common keyboard definitions in one file
+//
+// 9 6/17/11 10:51a Artems
+// Updated EFI_HII_KEYBOARD_LAYOUT structure to UEFI 2.3.1 spec
+//
+// 8 5/05/11 3:40p Artems
+// EIP 58707: Added changes introduced in UEFI spec v. 2.3.1
+//
+// 7 5/05/11 11:55a Artems
+// EIP 58707: Added changes introduced in UEFI spec v. 2.3.1
+//
+// 6 5/02/11 5:37p Artems
+// EIP 59569: Minor changes introduced in UEFI spec v. 2.3.1
+//
+// 5 3/09/11 5:38p Artems
+// Added macros defined in UEFI 2.3.1 specification
+//
+// 4 12/04/09 12:09p Felixp
+//
+// 3 12/03/09 6:00p Artems
+// Added Keyboard layout structures inside pack pragma
+//
+// 2 11/05/09 3:29p Felixp
+// EfiKeyRshift compatibility declaration is added
+//
+// 1 10/13/09 5:59p Felixp
+//
+// 1 10/09/09 4:28p Felixp
+//
+// 1 3/18/07 5:23p Felixp
+//
+//**********************************************************************
+//<AMI_FHDR_START>
+//
+// Name: UefiHii.h
+//
+// Description: Hii basic types definition
+//
+//<AMI_FHDR_END>
+//**********************************************************************
+#ifndef __UEFI_HII__H__
+#define __UEFI_HII__H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <Efi.h>
+#include <KeyboardCommonDefinitions.h>
+
+#pragma pack (push,1)
+
+typedef struct {
+ EFI_GUID PackageListGuid;
+ UINT32 PackageLength;
+} EFI_HII_PACKAGE_LIST_HEADER;
+
+typedef struct {
+ UINT32 Length :24;
+ UINT32 Type :8;
+} EFI_HII_PACKAGE_HEADER;
+
+typedef struct _EFI_HII_GUID_PACKAGE_HDR {
+ EFI_HII_PACKAGE_HEADER Header;
+ EFI_GUID Guid;
+} EFI_HII_GUID_PACKAGE_HDR;
+
+typedef struct {
+ EFI_HII_PACKAGE_HEADER Header;
+ UINT16 LayoutCount;
+//EFI_HII_KEYBOARD_LAYOUT Layout[];
+} EFI_HII_KEYBOARD_PACKAGE_HDR;
+
+#define EFI_HII_PACKAGE_TYPE_ALL 0x00
+#define EFI_HII_PACKAGE_TYPE_GUID 0x01
+#define EFI_HII_PACKAGE_FORMS 0x02
+#define EFI_HII_PACKAGE_STRINGS 0x04
+#define EFI_HII_PACKAGE_FONTS 0x05
+#define EFI_HII_PACKAGE_IMAGES 0x06
+#define EFI_HII_PACKAGE_SIMPLE_FONTS 0x07
+#define EFI_HII_PACKAGE_DEVICE_PATH 0x08
+#define EFI_HII_PACKAGE_KEYBOARD_LAYOUT 0x09
+#define EFI_HII_PACKAGE_ANIMATIONS 0x0A
+#define EFI_HII_PACKAGE_END 0xDF
+#define EFI_HII_PACKAGE_TYPE_SYSTEM_BEGIN 0xE0
+#define EFI_HII_PACKAGE_TYPE_SYSTEM_END 0xFF
+
+typedef CHAR16 *EFI_STRING;
+typedef UINT16 EFI_QUESTION_ID;
+typedef UINT16 EFI_IMAGE_ID;
+typedef UINT16 EFI_STRING_ID;
+typedef UINT16 EFI_FORM_ID;
+typedef UINT16 EFI_VARSTORE_ID;
+
+typedef UINT32 EFI_HII_FONT_STYLE;
+
+typedef VOID *EFI_HII_HANDLE;
+
+#define EFI_HII_FONT_STYLE_NORMAL 0x00000000
+#define EFI_HII_FONT_STYLE_BOLD 0x00000001
+#define EFI_HII_FONT_STYLE_ITALIC 0x00000002
+#define EFI_HII_FONT_STYLE_EMBOSS 0x00010000
+#define EFI_HII_FONT_STYLE_OUTLINE 0x00020000
+#define EFI_HII_FONT_STYLE_SHADOW 0x00040000
+#define EFI_HII_FONT_STYLE_UNDERLINE 0x00080000
+#define EFI_HII_FONT_STYLE_DBL_UNDER 0x00100000
+
+typedef struct {
+ EFI_HII_FONT_STYLE FontStyle;
+ UINT16 FontSize; // character cell size in pixels
+ CHAR16 FontName[1];
+} EFI_FONT_INFO;
+
+
+#define EFI_GLYPH_NON_SPACING 0x01
+#define EFI_GLYPH_WIDE 0x02
+
+#define EFI_GLYPH_HEIGHT 19
+#define EFI_GLYPH_WIDTH 8
+#define EFI_GLYPH_WIDE_WIDTH 16
+#define EFI_GLYPH_BASE_LINE 14
+
+typedef struct {
+ CHAR16 UnicodeWeight;
+ UINT8 Attributes;
+ UINT8 GlyphCol1[EFI_GLYPH_HEIGHT];
+} EFI_NARROW_GLYPH;
+
+typedef struct {
+ CHAR16 UnicodeWeight;
+ UINT8 Attributes;
+ UINT8 GlyphCol1[EFI_GLYPH_HEIGHT];
+ UINT8 GlyphCol2[EFI_GLYPH_HEIGHT];
+ UINT8 Pad[3];
+} EFI_WIDE_GLYPH;
+
+typedef struct _EFI_HII_SIMPLE_FONT_PACKAGE_HDR {
+ EFI_HII_PACKAGE_HEADER Header;
+ UINT16 NumberOfNarrowGlyphs;
+ UINT16 NumberOfWideGlyphs;
+ EFI_NARROW_GLYPH NarrowGlyphs[1];
+// EFI_WIDE_GLYPH WideGlyphs[...];
+} EFI_HII_SIMPLE_FONT_PACKAGE_HDR;
+
+typedef struct _EFI_HII_GLYPH_INFO {
+ UINT16 Width;
+ UINT16 Height;
+ INT16 OffsetX;
+ INT16 OffsetY;
+ INT16 AdvanceX;
+} EFI_HII_GLYPH_INFO;
+
+typedef struct _EFI_HII_FONT_PACKAGE_HDR {
+ EFI_HII_PACKAGE_HEADER Header;
+ UINT32 HdrSize;
+ UINT32 GlyphBlockOffset;
+ EFI_HII_GLYPH_INFO Cell;
+ EFI_HII_FONT_STYLE FontStyle;
+// CHAR16 FontFamily[];
+} EFI_HII_FONT_PACKAGE_HDR;
+
+#define EFI_HII_GIBT_END 0x00
+#define EFI_HII_GIBT_GLYPH 0x10
+#define EFI_HII_GIBT_GLYPHS 0x11
+#define EFI_HII_GIBT_GLYPH_DEFAULT 0x12
+#define EFI_HII_GIBT_GLYPHS_DEFAULT 0x13
+#define EFI_HII_GIBT_DUPLICATE 0x20
+#define EFI_HII_GIBT_SKIP2 0x21
+#define EFI_HII_GIBT_SKIP1 0x22
+#define EFI_HII_GIBT_DEFAULTS 0x23
+#define EFI_HII_GIBT_EXT1 0x30
+#define EFI_HII_GIBT_EXT2 0x31
+#define EFI_HII_GIBT_EXT4 0x32
+
+typedef struct _EFI_HII_GLYPH_BLOCK {
+ UINT8 BlockType;
+// UINT8 BlockBody[];
+} EFI_HII_GLYPH_BLOCK;
+
+typedef struct _EFI_HII_GIBT_DEFAULTS_BLOCK {
+ EFI_HII_GLYPH_BLOCK Header;
+ EFI_HII_GLYPH_INFO Cell;
+} EFI_HII_GIBT_DEFAULTS_BLOCK;
+
+typedef struct _EFI_HII_GIBT_DUPLICATE_BLOCK {
+ EFI_HII_GLYPH_BLOCK Header;
+ CHAR16 CharValue;
+} EFI_HII_GIBT_DUPLICATE_BLOCK;
+
+typedef struct _EFI_GLYPH_GIBT_END_BLOCK {
+ EFI_HII_GLYPH_BLOCK Header;
+} EFI_GLYPH_GIBT_END_BLOCK;
+
+typedef struct _EFI_HII_GIBT_EXT1_BLOCK {
+ EFI_HII_GLYPH_BLOCK Header;
+ UINT8 BlockType2;
+ UINT8 Length;
+} EFI_HII_GIBT_EXT1_BLOCK;
+
+typedef struct _EFI_HII_GIBT_EXT2_BLOCK {
+ EFI_HII_GLYPH_BLOCK Header;
+ UINT8 BlockType2;
+ UINT16 Length;
+} EFI_HII_GIBT_EXT2_BLOCK;
+
+typedef struct _EFI_HII_GIBT_EXT4_BLOCK {
+ EFI_HII_GLYPH_BLOCK Header;
+ UINT8 BlockType2;
+ UINT32 Length;
+} EFI_HII_GIBT_EXT4_BLOCK;
+
+typedef struct _EFI_HII_GIBT_GLYPH_BLOCK {
+ EFI_HII_GLYPH_BLOCK Header;
+ EFI_HII_GLYPH_INFO Cell;
+// UINT8 BitmapData[];
+} EFI_HII_GIBT_GLYPH_BLOCK;
+
+typedef struct _EFI_HII_GIBT_GLYPHS_BLOCK {
+ EFI_HII_GLYPH_BLOCK Header;
+ EFI_HII_GLYPH_INFO Cell;
+ UINT16 Count;
+// UINT8 BitmapData[];
+} EFI_HII_GIBT_GLYPHS_BLOCK;
+
+typedef struct _EFI_HII_GIBT_GLYPH_DEFAULT_BLOCK {
+ EFI_HII_GLYPH_BLOCK Header;
+// UINT8 BitmapData[];
+} EFI_HII_GIBT_GLYPH_DEFAULT_BLOCK;
+
+typedef struct _EFI_HII_GIBT_GLYPHS_DEFAULT_BLOCK {
+ EFI_HII_GLYPH_BLOCK Header;
+ UINT16 Count;
+// UINT8 BitmapData[];
+} EFI_HII_GIBT_GLYPHS_DEFAULT_BLOCK;
+
+typedef struct _EFI_HII_GIBT_SKIP2_BLOCK {
+ EFI_HII_GLYPH_BLOCK Header;
+ UINT16 SkipCount;
+} EFI_HII_GIBT_SKIP2_BLOCK;
+
+typedef struct _EFI_HII_GIBT_SKIP1_BLOCK {
+ EFI_HII_GLYPH_BLOCK Header;
+ UINT8 SkipCount;
+} EFI_HII_GIBT_SKIP1_BLOCK;
+
+typedef struct _EFI_HII_STRING_PACKAGE_HDR {
+ EFI_HII_PACKAGE_HEADER Header;
+ UINT32 HdrSize;
+ UINT32 StringInfoOffset;
+ CHAR16 LanguageWindow[16];
+ EFI_STRING_ID LanguageName;
+ CHAR8 Language[1];
+} EFI_HII_STRING_PACKAGE_HDR;
+
+#define UEFI_CONFIG_LANG "x-UEFI"
+#define UEFI_CONFIG_LANG_2 "x-i-UEFI"
+
+typedef struct {
+ UINT8 BlockType;
+// UINT8 *BlockBody;
+} EFI_HII_STRING_BLOCK;
+
+#define EFI_HII_SIBT_END 0x00
+#define EFI_HII_SIBT_STRING_SCSU 0x10
+#define EFI_HII_SIBT_STRING_SCSU_FONT 0x11
+#define EFI_HII_SIBT_STRINGS_SCSU 0x12
+#define EFI_HII_SIBT_STRINGS_SCSU_FONT 0x13
+#define EFI_HII_SIBT_STRING_UCS2 0x14
+#define EFI_HII_SIBT_STRING_UCS2_FONT 0x15
+#define EFI_HII_SIBT_STRINGS_UCS2 0x16
+#define EFI_HII_SIBT_STRINGS_UCS2_FONT 0x17
+#define EFI_HII_SIBT_DUPLICATE 0x20
+#define EFI_HII_SIBT_SKIP2 0x21
+#define EFI_HII_SIBT_SKIP1 0x22
+#define EFI_HII_SIBT_EXT1 0x30
+#define EFI_HII_SIBT_EXT2 0x31
+#define EFI_HII_SIBT_EXT4 0x32
+#define EFI_HII_SIBT_FONT 0x40
+
+typedef struct _EFI_HII_SIBT_DUPLICATE_BLOCK {
+ EFI_HII_STRING_BLOCK Header;
+ EFI_STRING_ID StringId;
+} EFI_HII_SIBT_DUPLICATE_BLOCK;
+
+typedef struct _EFI_HII_SIBT_END_BLOCK {
+ EFI_HII_STRING_BLOCK Header;
+} EFI_HII_SIBT_END_BLOCK;
+
+typedef struct _EFI_HII_SIBT_EXT1_BLOCK {
+ EFI_HII_STRING_BLOCK Header;
+ UINT8 BlockType2;
+ UINT8 Length;
+} EFI_HII_SIBT_EXT1_BLOCK;
+
+typedef struct _EFI_HII_SIBT_EXT2_BLOCK {
+ EFI_HII_STRING_BLOCK Header;
+ UINT8 BlockType2;
+ UINT16 Length;
+} EFI_HII_SIBT_EXT2_BLOCK;
+
+typedef struct _EFI_HII_SIBT_EXT4_BLOCK {
+ EFI_HII_STRING_BLOCK Header;
+ UINT8 BlockType2;
+ UINT32 Length;
+} EFI_HII_SIBT_EXT4_BLOCK;
+
+typedef struct _EFI_HII_SIBT_FONT_BLOCK {
+ EFI_HII_SIBT_EXT2_BLOCK Header;
+ UINT8 FontId;
+ UINT16 FontSize;
+ EFI_HII_FONT_STYLE FontStyle;
+// CHAR16 FontName[];
+} EFI_HII_SIBT_FONT_BLOCK;
+
+typedef struct _EFI_HII_SIBT_SKIP1_BLOCK {
+ EFI_HII_STRING_BLOCK Header;
+ UINT8 SkipCount;
+} EFI_HII_SIBT_SKIP1_BLOCK;
+
+typedef struct _EFI_HII_SIBT_SKIP2_BLOCK {
+ EFI_HII_STRING_BLOCK Header;
+ UINT16 SkipCount;
+} EFI_HII_SIBT_SKIP2_BLOCK;
+
+typedef struct _EFI_HII_SIBT_STRING_SCSU_BLOCK {
+ EFI_HII_STRING_BLOCK Header;
+// UINT8 *StringText;
+} EFI_HII_SIBT_STRING_SCSU_BLOCK;
+
+typedef struct _EFI_HII_SIBT_STRING_SCSU_FONT_BLOCK {
+ EFI_HII_STRING_BLOCK Header;
+ UINT8 FontIdentifier;
+// UINT8 *StringText;
+} EFI_HII_SIBT_STRING_SCSU_FONT_BLOCK;
+
+typedef struct _EFI_HII_SIBT_STRINGS_SCSU_BLOCK {
+ EFI_HII_STRING_BLOCK Header;
+ UINT16 StringCount;
+// UINT8 *StringText;
+} EFI_HII_SIBT_STRINGS_SCSU_BLOCK;
+
+typedef struct _EFI_HII_SIBT_STRINGS_SCSU_FONT_BLOCK {
+ EFI_HII_STRING_BLOCK Header;
+ UINT8 FontIdentifier;
+ UINT16 StringCount;
+// UINT8 *StringText;
+} EFI_HII_SIBT_STRINGS_SCSU_FONT_BLOCK;
+
+typedef struct _EFI_HII_SIBT_STRING_UCS2_BLOCK {
+ EFI_HII_STRING_BLOCK Header;
+// CHAR16 *StringText;
+} EFI_HII_SIBT_STRING_UCS2_BLOCK;
+
+typedef struct _EFI_HII_SIBT_STRING_UCS2_FONT_BLOCK {
+ EFI_HII_STRING_BLOCK Header;
+ UINT8 FontIdentifier;
+// CHAR16 *StringText;
+} EFI_HII_SIBT_STRING_UCS2_FONT_BLOCK;
+
+typedef struct _EFI_HII_SIBT_STRINGS_UCS2_BLOCK {
+ EFI_HII_STRING_BLOCK Header;
+ UINT16 StringCount;
+// CHAR16 *StringText;
+} EFI_HII_SIBT_STRINGS_UCS2_BLOCK;
+
+typedef struct _EFI_HII_SIBT_STRINGS_UCS2_FONT_BLOCK {
+ EFI_HII_STRING_BLOCK Header;
+ UINT8 FontIdentifier;
+ UINT16 StringCount;
+// CHAR16 *StringText;
+} EFI_HII_SIBT_STRINGS_UCS2_FONT_BLOCK;
+
+
+#define EFI_IFR_FORM_OP 0x01
+#define EFI_IFR_SUBTITLE_OP 0x02
+#define EFI_IFR_TEXT_OP 0x03
+#define EFI_IFR_IMAGE_OP 0x04
+#define EFI_IFR_ONE_OF_OP 0x05
+#define EFI_IFR_CHECKBOX_OP 0x06
+#define EFI_IFR_NUMERIC_OP 0x07
+#define EFI_IFR_PASSWORD_OP 0x08
+#define EFI_IFR_ONE_OF_OPTION_OP 0x09
+#define EFI_IFR_SUPPRESS_IF_OP 0x0A
+#define EFI_IFR_LOCKED_OP 0x0B
+#define EFI_IFR_ACTION_OP 0x0C
+#define EFI_IFR_RESET_BUTTON_OP 0x0D
+#define EFI_IFR_FORM_SET_OP 0x0E
+#define EFI_IFR_REF_OP 0x0F
+#define EFI_IFR_NO_SUBMIT_IF_OP 0x10
+#define EFI_IFR_INCONSISTENT_IF_OP 0x11
+#define EFI_IFR_EQ_ID_VAL_OP 0x12
+#define EFI_IFR_EQ_ID_ID_OP 0x13
+#define EFI_IFR_EQ_ID_LIST_OP 0x14
+#define EFI_IFR_AND_OP 0x15
+#define EFI_IFR_OR_OP 0x16
+#define EFI_IFR_NOT_OP 0x17
+#define EFI_IFR_RULE_OP 0x18
+#define EFI_IFR_GRAY_OUT_IF_OP 0x19
+#define EFI_IFR_DATE_OP 0x1A
+#define EFI_IFR_TIME_OP 0x1B
+#define EFI_IFR_STRING_OP 0x1C
+#define EFI_IFR_REFRESH_OP 0x1D
+#define EFI_IFR_DISABLE_IF_OP 0x1E
+#define EFI_IFR_TO_LOWER_OP 0x20
+#define EFI_IFR_TO_UPPER_OP 0x21
+#define EFI_IFR_ORDERED_LIST_OP 0x23
+#define EFI_IFR_VARSTORE_OP 0x24
+#define EFI_IFR_VARSTORE_NAME_VALUE_OP 0x25
+#define EFI_IFR_VARSTORE_EFI_OP 0x26
+#define EFI_IFR_VARSTORE_DEVICE_OP 0x27
+#define EFI_IFR_VERSION_OP 0x28
+#define EFI_IFR_END_OP 0x29
+#define EFI_IFR_MATCH_OP 0x2A
+#define EFI_IFR_EQUAL_OP 0x2F
+#define EFI_IFR_NOT_EQUAL_OP 0x30
+#define EFI_IFR_GREATER_THAN_OP 0x31
+#define EFI_IFR_GREATER_EQUAL_OP 0x32
+#define EFI_IFR_LESS_THAN_OP 0x33
+#define EFI_IFR_LESS_EQUAL_OP 0x34
+#define EFI_IFR_BITWISE_AND_OP 0x35
+#define EFI_IFR_BITWISE_OR_OP 0x36
+#define EFI_IFR_BITWISE_NOT_OP 0x37
+#define EFI_IFR_SHIFT_LEFT_OP 0x38
+#define EFI_IFR_SHIFT_RIGHT_OP 0x39
+#define EFI_IFR_ADD_OP 0x3A
+#define EFI_IFR_SUBTRACT_OP 0x3B
+#define EFI_IFR_MULTIPLY_OP 0x3C
+#define EFI_IFR_DIVIDE_OP 0x3D
+#define EFI_IFR_MODULO_OP 0x3E
+#define EFI_IFR_RULE_REF_OP 0x3F
+#define EFI_IFR_QUESTION_REF1_OP 0x40
+#define EFI_IFR_QUESTION_REF2_OP 0x41
+#define EFI_IFR_UINT8_OP 0x42
+#define EFI_IFR_UINT16_OP 0x43
+#define EFI_IFR_UINT32_OP 0x44
+#define EFI_IFR_UINT64_OP 0x45
+#define EFI_IFR_TRUE_OP 0x46
+#define EFI_IFR_FALSE_OP 0x47
+#define EFI_IFR_TO_UINT_OP 0x48
+#define EFI_IFR_TO_STRING_OP 0x49
+#define EFI_IFR_TO_BOOLEAN_OP 0x4A
+#define EFI_IFR_MID_OP 0x4B
+#define EFI_IFR_FIND_OP 0x4C
+#define EFI_IFR_TOKEN_OP 0x4D
+#define EFI_IFR_STRING_REF1_OP 0x4E
+#define EFI_IFR_STRING_REF2_OP 0x4F
+#define EFI_IFR_CONDITIONAL_OP 0x50
+#define EFI_IFR_QUESTION_REF3_OP 0x51
+#define EFI_IFR_ZERO_OP 0x52
+#define EFI_IFR_ONE_OP 0x53
+#define EFI_IFR_ONES_OP 0x54
+#define EFI_IFR_UNDEFINED_OP 0x55
+#define EFI_IFR_LENGTH_OP 0x56
+#define EFI_IFR_DUP_OP 0x57
+#define EFI_IFR_THIS_OP 0x58
+#define EFI_IFR_SPAN_OP 0x59
+#define EFI_IFR_VALUE_OP 0x5A
+#define EFI_IFR_DEFAULT_OP 0x5B
+#define EFI_IFR_DEFAULTSTORE_OP 0x5C
+#define EFI_IFR_FORM_MAP_OP 0x5D
+#define EFI_IFR_CATENATE_OP 0x5E
+#define EFI_IFR_GUID_OP 0x5F
+#define EFI_IFR_SECURITY_OP 0x60
+#define EFI_IFR_MODAL_TAG_OP 0x61
+#define EFI_IFR_REFRESH_ID_OP 0x62
+
+typedef struct {
+ UINT8 Hour;
+ UINT8 Minute;
+ UINT8 Second;
+} EFI_HII_TIME;
+
+typedef struct {
+ UINT16 Year;
+ UINT8 Month;
+ UINT8 Day;
+} EFI_HII_DATE;
+
+typedef union {
+ UINT8 u8;
+ UINT16 u16;
+ UINT32 u32;
+ UINT64 u64;
+ BOOLEAN b;
+ EFI_HII_TIME time;
+ EFI_HII_DATE date;
+ EFI_STRING_ID string;
+} EFI_IFR_TYPE_VALUE;
+
+typedef struct _EFI_IFR_OP_HEADER {
+ UINT8 OpCode;
+ UINT8 Length:7;
+ UINT8 Scope:1;
+} EFI_IFR_OP_HEADER;
+
+typedef struct _EFI_IFR_STATEMENT_HEADER {
+ EFI_STRING_ID Prompt;
+ EFI_STRING_ID Help;
+} EFI_IFR_STATEMENT_HEADER;
+
+typedef struct _EFI_IFR_QUESTION_HEADER {
+ EFI_IFR_STATEMENT_HEADER Header;
+ EFI_QUESTION_ID QuestionId;
+ EFI_VARSTORE_ID VarStoreId;
+ union {
+ EFI_STRING_ID VarName;
+ UINT16 VarOffset;
+ } VarStoreInfo;
+ UINT8 Flags;
+} EFI_IFR_QUESTION_HEADER;
+
+#define EFI_IFR_FLAG_READ_ONLY 0x01
+#define EFI_IFR_FLAG_CALLBACK 0x04
+#define EFI_IFR_FLAG_RESET_REQUIRED 0x10
+#define EFI_IFR_FLAG_OPTIONS_ONLY 0x80
+
+typedef struct _EFI_IFR_DEFAULTSTORE {
+ EFI_IFR_OP_HEADER Header;
+ EFI_STRING_ID DefaultName;
+ UINT16 DefaultId;
+} EFI_IFR_DEFAULTSTORE;
+
+#define EFI_HII_DEFAULT_CLASS_STANDARD 0x0000
+#define EFI_HII_DEFAULT_CLASS_MANUFACTURING 0x0001
+#define EFI_HII_DEFAULT_CLASS_SAFE 0x0002
+#define EFI_HII_DEFAULT_CLASS_PLATFORM_BEGIN 0x4000
+#define EFI_HII_DEFAULT_CLASS_PLATFORM_END 0x7fff
+#define EFI_HII_DEFAULT_CLASS_HARDWARE_BEGIN 0x8000
+#define EFI_HII_DEFAULT_CLASS_HARDWARE_END 0xbfff
+#define EFI_HII_DEFAULT_CLASS_FIRMWARE_BEGIN 0xc000
+#define EFI_HII_DEFAULT_CLASS_FIRMWARE_END 0xffff
+
+typedef struct _EFI_IFR_VARSTORE {
+ EFI_IFR_OP_HEADER Header;
+ EFI_GUID Guid;
+ EFI_VARSTORE_ID VarStoreId;
+ UINT16 Size;
+ UINT8 Name[1];
+} EFI_IFR_VARSTORE;
+
+typedef struct _EFI_IFR_VARSTORE_EFI {
+ EFI_IFR_OP_HEADER Header;
+ EFI_VARSTORE_ID VarStoreId;
+ EFI_GUID Guid;
+ UINT32 Attributes;
+} EFI_IFR_VARSTORE_EFI;
+
+typedef struct _EFI_IFR_VARSTORE_NAME_VALUE {
+ EFI_IFR_OP_HEADER Header;
+ EFI_VARSTORE_ID VarStoreId;
+ EFI_GUID Guid;
+} EFI_IFR_VARSTORE_NAME_VALUE;
+
+#define EFI_HII_PLATFORM_SETUP_FORMSET_GUID \
+ { 0x93039971, 0x8545, 0x4b04, 0xb4, 0x5e, 0x32, 0xeb, 0x83, 0x26, 0x4, 0xe }
+
+#define EFI_HII_DRIVER_HEALTH_FORMSET_GUID \
+ { 0xf22fc20c, 0x8cf4, 0x45eb, 0x8e, 0x6, 0xad, 0x4e, 0x50, 0xb9, 0x5d, 0xd3 }
+
+#define EFI_HII_USER_CREDENTIAL_FORMSET_GUID \
+ { 0x337f4407, 0x5aee, 0x4b83, 0xb2, 0xa7, 0x4e, 0xad, 0xca, 0x30, 0x88, 0xcd }
+
+typedef struct _EFI_IFR_FORM_SET {
+ EFI_IFR_OP_HEADER Header;
+ EFI_GUID Guid;
+ EFI_STRING_ID FormSetTitle;
+ EFI_STRING_ID Help;
+ UINT8 Flags;
+ EFI_GUID ClassGuid[1];
+} EFI_IFR_FORM_SET;
+
+typedef struct _EFI_IFR_END {
+ EFI_IFR_OP_HEADER Header;
+} EFI_IFR_END;
+
+typedef struct _EFI_IFR_FORM {
+ EFI_IFR_OP_HEADER Header;
+ UINT16 FormId;
+ EFI_STRING_ID FormTitle;
+} EFI_IFR_FORM;
+
+typedef struct _EFI_IFR_IMAGE {
+ EFI_IFR_OP_HEADER Header;
+ EFI_IMAGE_ID Id;
+} EFI_IFR_IMAGE;
+
+typedef struct _EFI_IFR_LOCKED {
+ EFI_IFR_OP_HEADER Header;
+} EFI_IFR_LOCKED;
+
+typedef struct _EFI_IFR_RULE {
+ EFI_IFR_OP_HEADER Header;
+ UINT8 RuleId;
+} EFI_IFR_RULE;
+
+typedef struct _EFI_IFR_DEFAULT {
+ EFI_IFR_OP_HEADER Header;
+ UINT16 DefaultId;
+ UINT8 Type;
+ EFI_IFR_TYPE_VALUE Value;
+} EFI_IFR_DEFAULT;
+
+typedef struct _EFI_IFR_VALUE {
+ EFI_IFR_OP_HEADER Header;
+} EFI_IFR_VALUE;
+
+typedef struct _EFI_IFR_SUBTITLE {
+ EFI_IFR_OP_HEADER Header;
+ EFI_IFR_STATEMENT_HEADER Statement;
+ UINT8 Flags;
+} EFI_IFR_SUBTITLE;
+
+#define EFI_IFR_FLAGS_HORIZONTAL 0x01
+
+typedef struct _EFI_IFR_CHECKBOX {
+ EFI_IFR_OP_HEADER Header;
+ EFI_IFR_QUESTION_HEADER Question;
+ UINT8 Flags;
+} EFI_IFR_CHECKBOX;
+
+#define EFI_IFR_CHECKBOX_DEFAULT 0x01
+#define EFI_IFR_CHECKBOX_DEFAULT_MFG 0x02
+
+typedef struct _EFI_IFR_TEXT {
+ EFI_IFR_OP_HEADER Header;
+ EFI_IFR_STATEMENT_HEADER Statement;
+ EFI_STRING_ID TextTwo;
+} EFI_IFR_TEXT;
+
+typedef struct _EFI_IFR_REF {
+ EFI_IFR_OP_HEADER Header;
+ EFI_IFR_QUESTION_HEADER Question;
+ EFI_FORM_ID FormId;
+} EFI_IFR_REF;
+
+typedef struct _EFI_IFR_REF2 {
+ EFI_IFR_OP_HEADER Header;
+ EFI_IFR_QUESTION_HEADER Question;
+ EFI_FORM_ID FormId;
+ EFI_QUESTION_ID QuestionId;
+} EFI_IFR_REF2;
+
+typedef struct _EFI_IFR_REF3 {
+ EFI_IFR_OP_HEADER Header;
+ EFI_IFR_QUESTION_HEADER Question;
+ EFI_FORM_ID FormId;
+ EFI_QUESTION_ID QuestionId;
+ EFI_GUID FormSetId;
+} EFI_IFR_REF3;
+
+typedef struct _EFI_IFR_REF4 {
+ EFI_IFR_OP_HEADER Header;
+ EFI_IFR_QUESTION_HEADER Question;
+ EFI_FORM_ID FormId;
+ EFI_QUESTION_ID QuestionId;
+ EFI_GUID FormSetId;
+ EFI_STRING_ID DevicePath;
+} EFI_IFR_REF4;
+
+typedef struct _EFI_IFR_RESET_BUTTON {
+ EFI_IFR_OP_HEADER Header;
+ EFI_IFR_STATEMENT_HEADER Statement;
+ UINT16 DefaultId;
+} EFI_IFR_RESET_BUTTON;
+
+typedef struct _EFI_IFR_ACTION {
+ EFI_IFR_OP_HEADER Header;
+ EFI_IFR_QUESTION_HEADER Question;
+ EFI_STRING_ID QuestionConfig;
+} EFI_IFR_ACTION;
+
+typedef struct _EFI_IFR_ACTION_1 {
+ EFI_IFR_OP_HEADER Header;
+ EFI_IFR_QUESTION_HEADER Question;
+} EFI_IFR_ACTION_1;
+
+typedef struct _EFI_IFR_DATE {
+ EFI_IFR_OP_HEADER Header;
+ EFI_IFR_QUESTION_HEADER Question;
+ UINT8 Flags;
+} EFI_IFR_DATE;
+
+#define EFI_QF_DATE_YEAR_SUPPRESS 0x01
+#define EFI_QF_DATE_MONTH_SUPPRESS 0x02
+#define EFI_QF_DATE_DAY_SUPPRESS 0x04
+
+#define EFI_QF_DATE_STORAGE 0x30
+#define QF_DATE_STORAGE_NORMAL 0x00
+#define QF_DATE_STORAGE_TIME 0x10
+#define QF_DATE_STORAGE_WAKEUP 0x20
+
+typedef union {
+ struct {
+ UINT8 MinValue;
+ UINT8 MaxValue;
+ UINT8 Step;
+ } u8;
+ struct {
+ UINT16 MinValue;
+ UINT16 MaxValue;
+ UINT16 Step;
+ } u16;
+ struct {
+ UINT32 MinValue;
+ UINT32 MaxValue;
+ UINT32 Step;
+ } u32;
+ struct {
+ UINT64 MinValue;
+ UINT64 MaxValue;
+ UINT64 Step;
+ } u64;
+} MINMAXSTEP_DATA;
+
+typedef struct _EFI_IFR_NUMERIC {
+ EFI_IFR_OP_HEADER Header;
+ EFI_IFR_QUESTION_HEADER Question;
+ UINT8 Flags;
+ MINMAXSTEP_DATA data;
+} EFI_IFR_NUMERIC;
+
+#define EFI_IFR_NUMERIC_SIZE 0x03
+#define EFI_IFR_NUMERIC_SIZE_1 0x00
+#define EFI_IFR_NUMERIC_SIZE_2 0x01
+#define EFI_IFR_NUMERIC_SIZE_4 0x02
+#define EFI_IFR_NUMERIC_SIZE_8 0x03
+
+#define EFI_IFR_DISPLAY 0x30
+#define EFI_IFR_DISPLAY_INT_DEC 0x00
+#define EFI_IFR_DISPLAY_UINT_DEC 0x10
+#define EFI_IFR_DISPLAY_UINT_HEX 0x20
+
+typedef struct _EFI_IFR_ONE_OF {
+ EFI_IFR_OP_HEADER Header;
+ EFI_IFR_QUESTION_HEADER Question;
+ UINT8 Flags;
+ MINMAXSTEP_DATA data;
+} EFI_IFR_ONE_OF;
+
+typedef struct _EFI_IFR_STRING {
+ EFI_IFR_OP_HEADER Header;
+ EFI_IFR_QUESTION_HEADER Question;
+ UINT8 MinSize;
+ UINT8 MaxSize;
+ UINT8 Flags;
+} EFI_IFR_STRING;
+
+#define EFI_IFR_STRING_MULTI_LINE 0x01
+
+typedef struct _EFI_IFR_PASSWORD {
+ EFI_IFR_OP_HEADER Header;
+ EFI_IFR_QUESTION_HEADER Question;
+ UINT16 MinSize;
+ UINT16 MaxSize;
+} EFI_IFR_PASSWORD;
+
+typedef struct _EFI_IFR_ORDERED_LIST {
+ EFI_IFR_OP_HEADER Header;
+ EFI_IFR_QUESTION_HEADER Question;
+ UINT8 MaxContainers;
+ UINT8 Flags;
+} EFI_IFR_ORDERED_LIST;
+
+#define EFI_IFR_UNIQUE_SET 0x01
+#define EFI_IFR_NO_EMPTY_SET 0x02
+
+typedef struct _EFI_IFR_TIME {
+ EFI_IFR_OP_HEADER Header;
+ EFI_IFR_QUESTION_HEADER Question;
+ UINT8 Flags;
+} EFI_IFR_TIME;
+
+#define QF_TIME_HOUR_SUPPRESS 0x01
+#define QF_TIME_MINUTE_SUPPRESS 0x02
+#define QF_TIME_SECOND_SUPPRESS 0x04
+
+#define QF_TIME_STORAGE 0x30
+#define QF_TIME_STORAGE_NORMAL 0x00
+#define QF_TIME_STORAGE_TIME 0x10
+#define QF_TIME_STORAGE_WAKEUP 0x20
+
+typedef struct _EFI_IFR_DISABLE_IF {
+ EFI_IFR_OP_HEADER Header;
+} EFI_IFR_DISABLE_IF;
+
+typedef struct _EFI_IFR_SUPPRESS_IF {
+ EFI_IFR_OP_HEADER Header;
+} EFI_IFR_SUPPRESS_IF;
+
+typedef struct _EFI_IFR_GRAY_OUT_IF {
+ EFI_IFR_OP_HEADER Header;
+} EFI_IFR_GRAY_OUT_IF;
+
+typedef struct _EFI_IFR_INCONSISTENT_IF {
+ EFI_IFR_OP_HEADER Header;
+ EFI_STRING_ID Error;
+} EFI_IFR_INCONSISTENT_IF;
+
+typedef struct _EFI_IFR_NO_SUBMIT_IF {
+ EFI_IFR_OP_HEADER Header;
+ EFI_STRING_ID Error;
+} EFI_IFR_NO_SUBMIT_IF;
+
+typedef struct _EFI_IFR_REFRESH {
+ EFI_IFR_OP_HEADER Header;
+ UINT8 RefreshInterval;
+} EFI_IFR_REFRESH;
+
+typedef struct _EFI_IFR_VARSTORE_DEVICE {
+ EFI_IFR_OP_HEADER Header;
+ EFI_STRING_ID DevicePath;
+} EFI_IFR_VARSTORE_DEVICE;
+
+typedef struct _EFI_IFR_ONE_OF_OPTION {
+ EFI_IFR_OP_HEADER Header;
+ EFI_STRING_ID Option;
+ UINT8 Flags;
+ UINT8 Type;
+ EFI_IFR_TYPE_VALUE Value;
+} EFI_IFR_ONE_OF_OPTION;
+
+#define EFI_IFR_TYPE_NUM_SIZE_8 0x00
+#define EFI_IFR_TYPE_NUM_SIZE_16 0x01
+#define EFI_IFR_TYPE_NUM_SIZE_32 0x02
+#define EFI_IFR_TYPE_NUM_SIZE_64 0x03
+#define EFI_IFR_TYPE_BOOLEAN 0x04
+#define EFI_IFR_TYPE_TIME 0x05
+#define EFI_IFR_TYPE_DATE 0x06
+#define EFI_IFR_TYPE_STRING 0x07
+#define EFI_IFR_TYPE_OTHER 0x08
+
+#define EFI_IFR_OPTION_DEFAULT 0x10
+#define EFI_IFR_OPTION_DEFAULT_MFG 0x20
+
+typedef struct _EFI_IFR_GUID {
+ EFI_IFR_OP_HEADER Header;
+ EFI_GUID Guid;
+ //Optional Data Follows
+} EFI_IFR_GUID;
+
+typedef struct _EFI_IFR_DUP {
+ EFI_IFR_OP_HEADER Header;
+} EFI_IFR_DUP;
+
+typedef struct _EFI_IFR_EQ_ID_ID {
+ EFI_IFR_OP_HEADER Header;
+ EFI_QUESTION_ID QuestionId1;
+ EFI_QUESTION_ID QuestionId2;
+} EFI_IFR_EQ_ID_ID;
+
+typedef struct _EFI_IFR_EQ_ID_VAL {
+ EFI_IFR_OP_HEADER Header;
+ EFI_QUESTION_ID QuestionId;
+ UINT16 Value;
+} EFI_IFR_EQ_ID_VAL;
+
+typedef struct _EFI_IFR_EQ_ID_LIST {
+ EFI_IFR_OP_HEADER Header;
+ EFI_QUESTION_ID QuestionId;
+ UINT16 ListLength;
+ UINT16 ValueList[1];
+} EFI_IFR_EQ_ID_LIST;
+
+typedef struct _EFI_IFR_QUESTION_REF1 {
+ EFI_IFR_OP_HEADER Header;
+ EFI_QUESTION_ID QuestionId;
+} EFI_IFR_QUESTION_REF1;
+
+typedef struct _EFI_IFR_UINT8 {
+ EFI_IFR_OP_HEADER Header;
+ UINT8 Value;
+} EFI_IFR_UINT8;
+
+typedef struct _EFI_IFR_UINT16 {
+ EFI_IFR_OP_HEADER Header;
+ UINT16 Value;
+} EFI_IFR_UINT16;
+
+typedef struct _EFI_IFR_QUESTION_REF2 {
+ EFI_IFR_OP_HEADER Header;
+} EFI_IFR_QUESTION_REF2;
+
+typedef struct _EFI_IFR_UINT32 {
+ EFI_IFR_OP_HEADER Header;
+ UINT32 Value;
+} EFI_IFR_UINT32;
+
+typedef struct _EFI_IFR_UINT64 {
+ EFI_IFR_OP_HEADER Header;
+ UINT64 Value;
+} EFI_IFR_UINT64;
+
+typedef struct _EFI_IFR_QUESTION_REF3 {
+ EFI_IFR_OP_HEADER Header;
+} EFI_IFR_QUESTION_REF3;
+
+typedef struct _EFI_IFR_QUESTION_REF3_2 {
+ EFI_IFR_OP_HEADER Header;
+ EFI_STRING_ID DevicePath;
+} EFI_IFR_QUESTION_REF3_2;
+
+typedef struct _EFI_IFR_QUESTION_REF3_3 {
+ EFI_IFR_OP_HEADER Header;
+ EFI_STRING_ID DevicePath;
+ EFI_GUID Guid;
+} EFI_IFR_QUESTION_REF3_3;
+
+typedef struct _EFI_IFR_RULE_REF {
+ EFI_IFR_OP_HEADER Header;
+ UINT8 RuleId;
+} EFI_IFR_RULE_REF;
+
+typedef struct _EFI_IFR_STRING_REF1 {
+ EFI_IFR_OP_HEADER Header;
+ EFI_STRING_ID StringId;
+} EFI_IFR_STRING_REF1;
+
+typedef struct _EFI_IFR_STRING_REF2 {
+ EFI_IFR_OP_HEADER Header;
+} EFI_IFR_STRING_REF2;
+
+typedef struct _EFI_IFR_THIS {
+ EFI_IFR_OP_HEADER Header;
+} EFI_IFR_THIS;
+
+typedef struct _EFI_IFR_TRUE {
+ EFI_IFR_OP_HEADER Header;
+} EFI_IFR_TRUE;
+
+typedef struct _EFI_IFR_FALSE {
+ EFI_IFR_OP_HEADER Header;
+} EFI_IFR_FALSE;
+
+typedef struct _EFI_IFR_ONE {
+ EFI_IFR_OP_HEADER Header;
+} EFI_IFR_ONE;
+
+typedef struct _EFI_IFR_ONES {
+ EFI_IFR_OP_HEADER Header;
+} EFI_IFR_ONES;
+
+typedef struct _EFI_IFR_ZERO {
+ EFI_IFR_OP_HEADER Header;
+} EFI_IFR_ZERO;
+
+typedef struct _EFI_IFR_UNDEFINED {
+ EFI_IFR_OP_HEADER Header;
+} EFI_IFR_UNDEFINED;
+
+typedef struct _EFI_IFR_VERSION {
+ EFI_IFR_OP_HEADER Header;
+} EFI_IFR_VERSION;
+
+typedef struct _EFI_IFR_LENGTH {
+ EFI_IFR_OP_HEADER Header;
+} EFI_IFR_LENGTH;
+
+typedef struct _EFI_IFR_NOT {
+ EFI_IFR_OP_HEADER Header;
+} EFI_IFR_NOT;
+
+typedef struct _EFI_IFR_BITWISE_NOT {
+ EFI_IFR_OP_HEADER Header;
+} EFI_IFR_BITWISE_NOT;
+
+typedef struct _EFI_IFR_TO_BOOLEAN {
+ EFI_IFR_OP_HEADER Header;
+} EFI_IFR_TO_BOOLEAN;
+
+#define EFI_IFR_STRING_UNSIGNED_DEC 0
+#define EFI_IFR_STRING_SIGNED_DEC 1
+#define EFI_IFR_STRING_LOWERCASE_HEX 2
+#define EFI_IFR_STRING_UPPERCASE_HEX 3
+
+#define EFI_IFR_STRING_ASCII 0
+#define EFI_IFR_STRING_UNICODE 8
+
+typedef struct _EFI_IFR_TO_STRING {
+ EFI_IFR_OP_HEADER Header;
+ UINT8 Format;
+} EFI_IFR_TO_STRING;
+
+typedef struct _EFI_IFR_TO_UINT {
+ EFI_IFR_OP_HEADER Header;
+} EFI_IFR_TO_UINT;
+
+typedef struct _EFI_IFR_TO_UPPER {
+ EFI_IFR_OP_HEADER Header;
+} EFI_IFR_TO_UPPER;
+
+typedef struct _EFI_IFR_TO_LOWER {
+ EFI_IFR_OP_HEADER Header;
+} EFI_IFR_TO_LOWER;
+
+typedef struct _EFI_IFR_ADD {
+ EFI_IFR_OP_HEADER Header;
+} EFI_IFR_ADD;
+
+typedef struct _EFI_IFR_AND {
+ EFI_IFR_OP_HEADER Header;
+} EFI_IFR_AND;
+
+typedef struct _EFI_IFR_BITWISE_AND {
+ EFI_IFR_OP_HEADER Header;
+} EFI_IFR_BITWISE_AND;
+
+typedef struct _EFI_IFR_BITWISE_OR {
+ EFI_IFR_OP_HEADER Header;
+} EFI_IFR_BITWISE_OR;
+
+typedef struct _EFI_IFR_CATENATE {
+ EFI_IFR_OP_HEADER Header;
+} EFI_IFR_CATENATE;
+
+typedef struct _EFI_IFR_DIVIDE {
+ EFI_IFR_OP_HEADER Header;
+} EFI_IFR_DIVIDE;
+
+typedef struct _EFI_IFR_EQUAL {
+ EFI_IFR_OP_HEADER Header;
+} EFI_IFR_EQUAL;
+
+typedef struct _EFI_IFR_GREATER_EQUAL {
+ EFI_IFR_OP_HEADER Header;
+} EFI_IFR_GREATER_EQUAL;
+
+typedef struct _EFI_IFR_GREATER_THAN {
+ EFI_IFR_OP_HEADER Header;
+} EFI_IFR_GREATER_THAN;
+
+typedef struct _EFI_IFR_LESS_EQUAL {
+ EFI_IFR_OP_HEADER Header;
+} EFI_IFR_LESS_EQUAL;
+
+typedef struct _EFI_IFR_LESS_THAN {
+ EFI_IFR_OP_HEADER Header;
+} EFI_IFR_LESS_THAN;
+
+typedef struct _EFI_IFR_MATCH {
+ EFI_IFR_OP_HEADER Header;
+} EFI_IFR_MATCH;
+
+typedef struct _EFI_IFR_MULTIPLY {
+ EFI_IFR_OP_HEADER Header;
+} EFI_IFR_MULTIPLY;
+
+typedef struct _EFI_IFR_MODULO {
+ EFI_IFR_OP_HEADER Header;
+} EFI_IFR_MODULO;
+
+typedef struct _EFI_IFR_NOT_EQUAL {
+ EFI_IFR_OP_HEADER Header;
+} EFI_IFR_NOT_EQUAL;
+
+typedef struct _EFI_IFR_OR {
+ EFI_IFR_OP_HEADER Header;
+} EFI_IFR_OR;
+
+typedef struct _EFI_IFR_SHIFT_LEFT {
+ EFI_IFR_OP_HEADER Header;
+} EFI_IFR_SHIFT_LEFT;
+
+typedef struct _EFI_IFR_SHIFT_RIGHT {
+ EFI_IFR_OP_HEADER Header;
+} EFI_IFR_SHIFT_RIGHT;
+
+typedef struct _EFI_IFR_SUBTRACT {
+ EFI_IFR_OP_HEADER Header;
+} EFI_IFR_SUBTRACT;
+
+typedef struct _EFI_IFR_CONDITIONAL {
+ EFI_IFR_OP_HEADER Header;
+} EFI_IFR_CONDITIONAL;
+
+#define EFI_IFR_FF_CASE_SENSITIVE 0x00
+#define EFI_IFR_FF_CASE_INSENSITIVE 0x01
+
+typedef struct _EFI_IFR_FIND {
+ EFI_IFR_OP_HEADER Header;
+ UINT8 Format;
+} EFI_IFR_FIND;
+
+typedef struct _EFI_IFR_MID {
+ EFI_IFR_OP_HEADER Header;
+} EFI_IFR_MID;
+
+typedef struct _EFI_IFR_TOKEN {
+ EFI_IFR_OP_HEADER Header;
+} EFI_IFR_TOKEN;
+
+#define EFI_IFR_FLAGS_FIRST_MATCHING 0x00
+#define EFI_IFR_FLAGS_FIRST_NON_MATCHING 0x01
+
+typedef struct _EFI_IFR_SPAN {
+ EFI_IFR_OP_HEADER Header;
+ UINT8 Flags;
+} EFI_IFR_SPAN;
+
+typedef UINTN EFI_BROWSER_ACTION;
+
+#define EFI_BROWSER_ACTION_CHANGING 0
+#define EFI_BROWSER_ACTION_CHANGED 1
+#define EFI_BROWSER_ACTION_RETRIEVE 2
+#define EFI_BROWSER_ACTION_FORM_OPEN 3
+#define EFI_BROWSER_ACTION_FORM_CLOSE 4
+#define EFI_BROWSER_ACTION_DEFAULT_STANDARD 0x1000
+#define EFI_BROWSER_ACTION_DEFAULT_MANUFACTURING 0x1001
+#define EFI_BROWSER_ACTION_DEFAULT_SAFE 0x1002
+#define EFI_BROWSER_ACTION_DEFAULT_PLATFORM 0x2000
+#define EFI_BROWSER_ACTION_DEFAULT_HARDWARE 0x3000
+#define EFI_BROWSER_ACTION_DEFAULT_FIRMWARE 0x4000
+
+typedef UINTN EFI_BROWSER_ACTION_REQUEST;
+
+#define EFI_BROWSER_ACTION_REQUEST_NONE 0
+#define EFI_BROWSER_ACTION_REQUEST_RESET 1
+#define EFI_BROWSER_ACTION_REQUEST_SUBMIT 2
+#define EFI_BROWSER_ACTION_REQUEST_EXIT 3
+#define EFI_BROWSER_ACTION_REQUEST_FORM_SUBMIT_EXIT 4
+#define EFI_BROWSER_ACTION_REQUEST_FORM_DISCARD_EXIT 5
+#define EFI_BROWSER_ACTION_REQUEST_FORM_APPLY 6
+#define EFI_BROWSER_ACTION_REQUEST_FORM_DISCARD 7
+
+
+//***************************************************
+// EFI_DESCRIPTOR_STRING
+//***************************************************
+typedef struct {
+// CHAR16 Language[3];
+ CHAR16 Space;
+// CHAR16 *DescriptionString;
+} EFI_DESCRIPTION_STRING;
+
+//***************************************************
+// EFI_DESCRIPTOR_STRING_BUNDLE
+//
+// Example: 2ENG English Keyboard<null>SPA Keyboard en ingles<null>
+// <null> = U-0000
+//***************************************************
+typedef struct {
+ UINT16 DescriptionCount;
+ EFI_DESCRIPTION_STRING *DescriptionString;
+} EFI_DESCRIPTION_STRING_BUNDLE;
+
+
+//***************************************************
+// EFI_KEY_DESCRIPTOR
+//***************************************************
+typedef struct {
+ EFI_KEY Key;
+ CHAR16 Unicode;
+ CHAR16 ShiftedUnicode;
+ CHAR16 AltGrUnicode;
+ CHAR16 ShiftedAltGrUnicode;
+ UINT16 Modifier;
+ UINT16 AffectedAttribute;
+} EFI_KEY_DESCRIPTOR;
+
+// A key which is affected by all the standard shift modifiers.
+// Most keys would be expected to have this bit active.
+#define EFI_AFFECTED_BY_STANDARD_SHIFT 0x0001
+
+// This key is affected by the caps lock so that if a keyboard
+// driver would need to disambiguate between a key which had a
+// "1" defined versus a "a" character. Having this bit turned on
+// would tell the keyboard driver to use the appropriate shifted
+// state or not.
+#define EFI_AFFECTED_BY_CAPS_LOCK 0x0002
+
+// Similar to the case of CAPS lock, if this bit is active, the
+// key is affected by the num lock being turned on.
+#define EFI_AFFECTED_BY_NUM_LOCK 0x0004
+
+//***************************************************
+// EFI_HII_KEYBOARD_LAYOUT
+//***************************************************
+typedef struct {
+ UINT16 LayoutLength;
+ EFI_GUID Guid;
+ UINT32 LayoutDescriptorStringOffset;
+ UINT8 DescriptorCount;
+ EFI_KEY_DESCRIPTOR *Descriptors;
+} EFI_HII_KEYBOARD_LAYOUT;
+
+#pragma pack (pop)
+
+//***************************************************
+// Modifier values
+//***************************************************
+#define EFI_NULL_MODIFIER 0x0000
+#define EFI_LEFT_CONTROL_MODIFIER 0x0001
+#define EFI_RIGHT_CONTROL_MODIFIER 0x0002
+#define EFI_LEFT_ALT_MODIFIER 0x0003
+#define EFI_RIGHT_ALT_MODIFIER 0x0004
+#define EFI_ALT_GR_MODIFIER 0x0005
+#define EFI_INSERT_MODIFIER 0x0006
+#define EFI_DELETE_MODIFIER 0x0007
+#define EFI_PAGE_DOWN_MODIFIER 0x0008
+#define EFI_PAGE_UP_MODIFIER 0x0009
+#define EFI_HOME_MODIFIER 0x000A
+#define EFI_END_MODIFIER 0x000B
+#define EFI_LEFT_SHIFT_MODIFIER 0x000C
+#define EFI_RIGHT_SHIFT_MODIFIER 0x000D
+#define EFI_CAPS_LOCK_MODIFIER 0x000E
+#define EFI_NUM_LOCK_MODIFIER 0x000F
+#define EFI_LEFT_ARROW_MODIFIER 0x0010
+#define EFI_RIGHT_ARROW_MODIFIER 0x0011
+#define EFI_DOWN_ARROW_MODIFIER 0x0012
+#define EFI_UP_ARROW_MODIFIER 0X0013
+#define EFI_NS_KEY_MODIFIER 0x0014
+#define EFI_NS_KEY_DEPENDENCY_MODIFIER 0x0015
+#define EFI_FUNCTION_KEY_ONE_MODIFIER 0x0016
+#define EFI_FUNCTION_KEY_TWO_MODIFIER 0x0017
+#define EFI_FUNCTION_KEY_THREE_MODIFIER 0x0018
+#define EFI_FUNCTION_KEY_FOUR_MODIFIER 0x0019
+#define EFI_FUNCTION_KEY_FIVE_MODIFIER 0x001A
+#define EFI_FUNCTION_KEY_SIX_MODIFIER 0x001B
+#define EFI_FUNCTION_KEY_SEVEN_MODIFIER 0x001C
+#define EFI_FUNCTION_KEY_EIGHT_MODIFIER 0x001D
+#define EFI_FUNCTION_KEY_NINE_MODIFIER 0x001E
+#define EFI_FUNCTION_KEY_TEN_MODIFIER 0x001F
+#define EFI_FUNCTION_KEY_ELEVEN_MODIFIER 0x0020
+#define EFI_FUNCTION_KEY_TWELVE_MODIFIER 0x0021
+//
+// Keys that have multiple control functions based on modifier
+// settings are handled in the keyboard driver implementation.
+// For instance PRINT_KEY might have a modifier held down and
+// is still a nonprinting character, but might have an alternate
+// control function like SYSREQUEST
+//
+#define EFI_PRINT_MODIFIER 0x0022
+#define EFI_SYS_REQUEST_MODIFIER 0x0023
+#define EFI_SCROLL_LOCK_MODIFIER 0x0024
+#define EFI_PAUSE_MODIFIER 0x0025
+#define EFI_BREAK_MODIFIER 0x0026
+#define EFI_LEFT_LOGO_MODIFIER 0x0027
+#define EFI_RIGHT_LOGO_MODIFIER 0x0028
+#define EFI_MENU_MODIFIER 0x0029
+
+#define EFI_HII_SET_KEYBOARD_LAYOUT_EVENT_GUID \
+{ 0x14982a4f, 0xb0ed, 0x45b8, 0xa8, 0x11, 0x5a, 0x7a, 0x9b, 0xc2, 0x32, 0xdf }
+
+/**************** Compatibility declarations *******************************/
+typedef EFI_STRING_ID STRING_REF;
+#define EfiKeyRshift EfiKeyRShift
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//********************************************************************** \ No newline at end of file
diff --git a/Include/VFR.uni b/Include/VFR.uni
new file mode 100644
index 0000000..ab26763
--- /dev/null
+++ b/Include/VFR.uni
Binary files differ
diff --git a/Include/WinCertificate.h b/Include/WinCertificate.h
new file mode 100644
index 0000000..5d2e94c
--- /dev/null
+++ b/Include/WinCertificate.h
@@ -0,0 +1,107 @@
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//**********************************************************************
+
+//**********************************************************************
+// $Header: /Alaska/BIN/Core/Include/WinCertificate.h 3 5/22/12 10:23a Artems $
+//
+// $Revision: 3 $
+//
+// $Date: 5/22/12 10:23a $
+//**********************************************************************
+// Revision History
+// ----------------
+// $Log: /Alaska/BIN/Core/Include/WinCertificate.h $
+//
+// 3 5/22/12 10:23a Artems
+// [TAG] EIP N/A
+// [Category] Spec Update
+// [Severity] Minor
+// [Description] PKCS7 guid definition is moved to ImageAuthentication.h
+// in sync with EDKII
+// [Files] WinCertificate.h ImageAuthentication.h
+//
+// 2 5/13/11 4:28p Artems
+//
+//
+//**********************************************************************
+//<AMI_FHDR_START>
+//
+// Name: <WinCertificate.h>
+//
+// Description: Win certificate definition header file
+//
+//<AMI_FHDR_END>
+//**********************************************************************
+
+#ifndef __EFI_WIN_CERTIFICATE_H__
+#define __EFI_WIN_CERTIFICATE_H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define WIN_CERT_TYPE_PKCS_SIGNED_DATA 0x0002
+#define WIN_CERT_TYPE_EFI_PKCS115 0x0EF0
+#define WIN_CERT_TYPE_EFI_GUID 0x0EF1
+
+
+typedef struct {
+ UINT32 dwLength;
+ UINT16 wRevision;
+ UINT16 wCertificateType;
+// UINT8 bCertificate[ANYSIZE_ARRAY];
+} WIN_CERTIFICATE;
+
+#define EFI_CERT_TYPE_RSA2048_SHA256_GUID \
+ {0xa7717414, 0xc616, 0x4977, 0x94, 0x20, 0x84, 0x47, 0x12, 0xa7, 0x35, 0xbf }
+
+typedef struct {
+ EFI_GUID HashType;
+ UINT8 PublicKey[256];
+ UINT8 Signature[256];
+} EFI_CERT_BLOCK_RSA_2048_SHA256;
+
+typedef struct {
+ WIN_CERTIFICATE Hdr;
+ EFI_GUID CertType;
+ UINT8 CertData[1];
+// EFI_CERT_BLOCK_RSA_2048_SHA256 CertData;
+} WIN_CERTIFICATE_UEFI_GUID;
+
+typedef struct {
+ WIN_CERTIFICATE Hdr;
+ EFI_GUID HashAlgorithm;
+// UINT8 Signature[];
+} WIN_CERTIFICATE_EFI_PKCS1_15;
+
+GUID_VARIABLE_DECLARATION(gEfiCertTypeRsa2048Sha256Guid, EFI_CERT_TYPE_RSA2048_SHA256_GUID);
+
+
+/****** DO NOT WRITE BELOW THIS LINE *******/
+#ifdef __cplusplus
+}
+#endif
+#endif
+//**********************************************************************
+//**********************************************************************
+//** **
+//** (C)Copyright 1985-2011, American Megatrends, Inc. **
+//** **
+//** All Rights Reserved. **
+//** **
+//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+//** **
+//** Phone: (770)-246-8600 **
+//** **
+//**********************************************************************
+//********************************************************************** \ No newline at end of file