]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Remove the dependence to MdePkg
authorqouyang <qouyang@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 14 Jun 2006 08:07:19 +0000 (08:07 +0000)
committerqouyang <qouyang@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 14 Jun 2006 08:07:19 +0000 (08:07 +0000)
1. add Include folder which contain the *.h file which used by Tiano tools.
2. Change ${evn.WORKSPACE}/MdePkg to ${PACKAGE_DIR} in build.xml.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@509 6f19259b-4bc3-4df7-8a09-765794883524

190 files changed:
Tools/Source/TianoTools/Common/build.xml
Tools/Source/TianoTools/CompressDll/build.xml
Tools/Source/TianoTools/CreateMtFile/build.xml
Tools/Source/TianoTools/CustomizedCompress/build.xml
Tools/Source/TianoTools/EfiCompress/build.xml
Tools/Source/TianoTools/EfiRom/build.xml
Tools/Source/TianoTools/FlashMap/build.xml
Tools/Source/TianoTools/FwImage/build.xml
Tools/Source/TianoTools/GenAcpiTable/build.xml
Tools/Source/TianoTools/GenCRC32Section/build.xml
Tools/Source/TianoTools/GenCapsuleHdr/build.xml
Tools/Source/TianoTools/GenDepex/build.xml
Tools/Source/TianoTools/GenFfsFile/build.xml
Tools/Source/TianoTools/GenFvImage/build.xml
Tools/Source/TianoTools/GenSection/build.xml
Tools/Source/TianoTools/GenTEImage/build.xml
Tools/Source/TianoTools/GuidChk/build.xml
Tools/Source/TianoTools/Include/Base.h [new file with mode: 0644]
Tools/Source/TianoTools/Include/Common/BaseTypes.h [new file with mode: 0644]
Tools/Source/TianoTools/Include/Common/BootMode.h [new file with mode: 0644]
Tools/Source/TianoTools/Include/Common/BootScript.h [new file with mode: 0644]
Tools/Source/TianoTools/Include/Common/Capsule.h [new file with mode: 0644]
Tools/Source/TianoTools/Include/Common/DataHubRecords.h [new file with mode: 0644]
Tools/Source/TianoTools/Include/Common/Dependency.h [new file with mode: 0644]
Tools/Source/TianoTools/Include/Common/EfiImage.h [new file with mode: 0644]
Tools/Source/TianoTools/Include/Common/FirmwareFileSystem.h [new file with mode: 0644]
Tools/Source/TianoTools/Include/Common/FirmwareVolumeHeader.h [new file with mode: 0644]
Tools/Source/TianoTools/Include/Common/FirmwareVolumeImageFormat.h [new file with mode: 0644]
Tools/Source/TianoTools/Include/Common/Hob.h [new file with mode: 0644]
Tools/Source/TianoTools/Include/Common/InternalFormRepresentation.h [new file with mode: 0644]
Tools/Source/TianoTools/Include/Common/MultiPhase.h [new file with mode: 0644]
Tools/Source/TianoTools/Include/Common/StatusCode.h [new file with mode: 0644]
Tools/Source/TianoTools/Include/Common/StatusCodeDataTypeId.h [new file with mode: 0644]
Tools/Source/TianoTools/Include/Common/UefiBaseTypes.h [new file with mode: 0644]
Tools/Source/TianoTools/Include/Dxe.h [new file with mode: 0644]
Tools/Source/TianoTools/Include/Dxe/ArchProtocol/Bds.h [new file with mode: 0644]
Tools/Source/TianoTools/Include/Dxe/ArchProtocol/Cpu.h [new file with mode: 0644]
Tools/Source/TianoTools/Include/Dxe/ArchProtocol/Metronome.h [new file with mode: 0644]
Tools/Source/TianoTools/Include/Dxe/ArchProtocol/MonotonicCounter.h [new file with mode: 0644]
Tools/Source/TianoTools/Include/Dxe/ArchProtocol/RealTimeClock.h [new file with mode: 0644]
Tools/Source/TianoTools/Include/Dxe/ArchProtocol/Reset.h [new file with mode: 0644]
Tools/Source/TianoTools/Include/Dxe/ArchProtocol/Runtime.h [new file with mode: 0644]
Tools/Source/TianoTools/Include/Dxe/ArchProtocol/Security.h [new file with mode: 0644]
Tools/Source/TianoTools/Include/Dxe/ArchProtocol/SecurityPolicy.h [new file with mode: 0644]
Tools/Source/TianoTools/Include/Dxe/ArchProtocol/StatusCode.h [new file with mode: 0644]
Tools/Source/TianoTools/Include/Dxe/ArchProtocol/Timer.h [new file with mode: 0644]
Tools/Source/TianoTools/Include/Dxe/ArchProtocol/Variable.h [new file with mode: 0644]
Tools/Source/TianoTools/Include/Dxe/ArchProtocol/VariableWrite.h [new file with mode: 0644]
Tools/Source/TianoTools/Include/Dxe/ArchProtocol/WatchdogTimer.h [new file with mode: 0644]
Tools/Source/TianoTools/Include/Dxe/DxeCis.h [new file with mode: 0644]
Tools/Source/TianoTools/Include/Dxe/SmmCis.h [new file with mode: 0644]
Tools/Source/TianoTools/Include/Guid/Acpi.h [new file with mode: 0644]
Tools/Source/TianoTools/Include/Guid/AcpiTableStorage.h [new file with mode: 0644]
Tools/Source/TianoTools/Include/Guid/Apriori.h [new file with mode: 0644]
Tools/Source/TianoTools/Include/Guid/Capsule.h [new file with mode: 0644]
Tools/Source/TianoTools/Include/Guid/DataHubRecords.h [new file with mode: 0644]
Tools/Source/TianoTools/Include/Guid/DebugImageInfoTable.h [new file with mode: 0644]
Tools/Source/TianoTools/Include/Guid/DxeServices.h [new file with mode: 0644]
Tools/Source/TianoTools/Include/Guid/EventGroup.h [new file with mode: 0644]
Tools/Source/TianoTools/Include/Guid/EventLegacyBios.h [new file with mode: 0644]
Tools/Source/TianoTools/Include/Guid/FirmwareFileSystem.h [new file with mode: 0644]
Tools/Source/TianoTools/Include/Guid/FrameworkDevicePath.h [new file with mode: 0644]
Tools/Source/TianoTools/Include/Guid/GlobalVariable.h [new file with mode: 0644]
Tools/Source/TianoTools/Include/Guid/Gpt.h [new file with mode: 0644]
Tools/Source/TianoTools/Include/Guid/HobList.h [new file with mode: 0644]
Tools/Source/TianoTools/Include/Guid/MemoryAllocationHob.h [new file with mode: 0644]
Tools/Source/TianoTools/Include/Guid/PcAnsi.h [new file with mode: 0644]
Tools/Source/TianoTools/Include/Guid/SalSystemTable.h [new file with mode: 0644]
Tools/Source/TianoTools/Include/Guid/SmBios.h [new file with mode: 0644]
Tools/Source/TianoTools/Include/Guid/SmmCommunicate.h [new file with mode: 0644]
Tools/Source/TianoTools/Include/Guid/SmramMemoryReserve.h [new file with mode: 0644]
Tools/Source/TianoTools/Include/Guid/StatusCodeDataTypeId.h [new file with mode: 0644]
Tools/Source/TianoTools/Include/Ia32/ProcessorBind.h [new file with mode: 0644]
Tools/Source/TianoTools/Include/IndustryStandard/Usb.h [new file with mode: 0644]
Tools/Source/TianoTools/Include/IndustryStandard/pci22.h [new file with mode: 0644]
Tools/Source/TianoTools/Include/Library/BaseLib.h [new file with mode: 0644]
Tools/Source/TianoTools/Include/Library/BaseMemoryLib.h [new file with mode: 0644]
Tools/Source/TianoTools/Include/Library/PcdLib.h [new file with mode: 0644]
Tools/Source/TianoTools/Include/Library/PeCoffLib.h [new file with mode: 0644]
Tools/Source/TianoTools/Include/Library/PrintLib.h [new file with mode: 0644]
Tools/Source/TianoTools/Include/Protocol/AcpiSupport.h [new file with mode: 0644]
Tools/Source/TianoTools/Include/Protocol/Arp.h [new file with mode: 0644]
Tools/Source/TianoTools/Include/Protocol/AuthenticationInfo.h [new file with mode: 0644]
Tools/Source/TianoTools/Include/Protocol/Bis.h [new file with mode: 0644]
Tools/Source/TianoTools/Include/Protocol/BlockIo.h [new file with mode: 0644]
Tools/Source/TianoTools/Include/Protocol/BootScriptSave.h [new file with mode: 0644]
Tools/Source/TianoTools/Include/Protocol/BusSpecificDriverOverride.h [new file with mode: 0644]
Tools/Source/TianoTools/Include/Protocol/ComponentName.h [new file with mode: 0644]
Tools/Source/TianoTools/Include/Protocol/CpuIo.h [new file with mode: 0644]
Tools/Source/TianoTools/Include/Protocol/DataHub.h [new file with mode: 0644]
Tools/Source/TianoTools/Include/Protocol/DebugPort.h [new file with mode: 0644]
Tools/Source/TianoTools/Include/Protocol/DebugSupport.h [new file with mode: 0644]
Tools/Source/TianoTools/Include/Protocol/Decompress.h [new file with mode: 0644]
Tools/Source/TianoTools/Include/Protocol/DevicePath.h [new file with mode: 0644]
Tools/Source/TianoTools/Include/Protocol/DevicePathFromText.h [new file with mode: 0644]
Tools/Source/TianoTools/Include/Protocol/DevicePathToText.h [new file with mode: 0644]
Tools/Source/TianoTools/Include/Protocol/DevicePathUtilities.h [new file with mode: 0644]
Tools/Source/TianoTools/Include/Protocol/Dhcp4.h [new file with mode: 0644]
Tools/Source/TianoTools/Include/Protocol/DiskIo.h [new file with mode: 0644]
Tools/Source/TianoTools/Include/Protocol/DriverBinding.h [new file with mode: 0644]
Tools/Source/TianoTools/Include/Protocol/DriverConfiguration.h [new file with mode: 0644]
Tools/Source/TianoTools/Include/Protocol/DriverDiagnostics.h [new file with mode: 0644]
Tools/Source/TianoTools/Include/Protocol/Ebc.h [new file with mode: 0644]
Tools/Source/TianoTools/Include/Protocol/EdidActive.h [new file with mode: 0644]
Tools/Source/TianoTools/Include/Protocol/EdidDiscovered.h [new file with mode: 0644]
Tools/Source/TianoTools/Include/Protocol/EdidOverride.h [new file with mode: 0644]
Tools/Source/TianoTools/Include/Protocol/EfiNetworkInterfaceIdentifier.h [new file with mode: 0644]
Tools/Source/TianoTools/Include/Protocol/FileInfo.h [new file with mode: 0644]
Tools/Source/TianoTools/Include/Protocol/FileSystemInfo.h [new file with mode: 0644]
Tools/Source/TianoTools/Include/Protocol/FileSystemVolumeLabelInfo.h [new file with mode: 0644]
Tools/Source/TianoTools/Include/Protocol/FirmwareVolume.h [new file with mode: 0644]
Tools/Source/TianoTools/Include/Protocol/FirmwareVolumeBlock.h [new file with mode: 0644]
Tools/Source/TianoTools/Include/Protocol/FirmwareVolumeDispatch.h [new file with mode: 0644]
Tools/Source/TianoTools/Include/Protocol/FormBrowser.h [new file with mode: 0644]
Tools/Source/TianoTools/Include/Protocol/FormCallback.h [new file with mode: 0644]
Tools/Source/TianoTools/Include/Protocol/GraphicsOutput.h [new file with mode: 0644]
Tools/Source/TianoTools/Include/Protocol/GuidedSectionExtraction.h [new file with mode: 0644]
Tools/Source/TianoTools/Include/Protocol/Hash.h [new file with mode: 0644]
Tools/Source/TianoTools/Include/Protocol/Hii.h [new file with mode: 0644]
Tools/Source/TianoTools/Include/Protocol/IP4.h [new file with mode: 0644]
Tools/Source/TianoTools/Include/Protocol/IP4Config.h [new file with mode: 0644]
Tools/Source/TianoTools/Include/Protocol/IScsiInitatorName.h [new file with mode: 0644]
Tools/Source/TianoTools/Include/Protocol/IdeControllerInit.h [new file with mode: 0644]
Tools/Source/TianoTools/Include/Protocol/IncompatiblePciDeviceSupport.h [new file with mode: 0644]
Tools/Source/TianoTools/Include/Protocol/Legacy8259.h [new file with mode: 0644]
Tools/Source/TianoTools/Include/Protocol/LegacyBios.h [new file with mode: 0644]
Tools/Source/TianoTools/Include/Protocol/LegacyBiosPlatform.h [new file with mode: 0644]
Tools/Source/TianoTools/Include/Protocol/LegacyInterrupt.h [new file with mode: 0644]
Tools/Source/TianoTools/Include/Protocol/LegacyRegion.h [new file with mode: 0644]
Tools/Source/TianoTools/Include/Protocol/LoadFile.h [new file with mode: 0644]
Tools/Source/TianoTools/Include/Protocol/LoadedImage.h [new file with mode: 0644]
Tools/Source/TianoTools/Include/Protocol/ManagedNetwork.h [new file with mode: 0644]
Tools/Source/TianoTools/Include/Protocol/Mtftp4.h [new file with mode: 0644]
Tools/Source/TianoTools/Include/Protocol/Pcd.h [new file with mode: 0644]
Tools/Source/TianoTools/Include/Protocol/PciHostBridgeResourceAllocation.h [new file with mode: 0644]
Tools/Source/TianoTools/Include/Protocol/PciHotPlugInit.h [new file with mode: 0644]
Tools/Source/TianoTools/Include/Protocol/PciIo.h [new file with mode: 0644]
Tools/Source/TianoTools/Include/Protocol/PciPlatform.h [new file with mode: 0644]
Tools/Source/TianoTools/Include/Protocol/PciRootBridgeIo.h [new file with mode: 0644]
Tools/Source/TianoTools/Include/Protocol/PlatformDriverOverride.h [new file with mode: 0644]
Tools/Source/TianoTools/Include/Protocol/PxeBaseCode.h [new file with mode: 0644]
Tools/Source/TianoTools/Include/Protocol/PxeBaseCodeCallBack.h [new file with mode: 0644]
Tools/Source/TianoTools/Include/Protocol/ScsiIo.h [new file with mode: 0644]
Tools/Source/TianoTools/Include/Protocol/ScsiPassThru.h [new file with mode: 0644]
Tools/Source/TianoTools/Include/Protocol/ScsiPassThruExt.h [new file with mode: 0644]
Tools/Source/TianoTools/Include/Protocol/SectionExtraction.h [new file with mode: 0644]
Tools/Source/TianoTools/Include/Protocol/SerialIo.h [new file with mode: 0644]
Tools/Source/TianoTools/Include/Protocol/ServiceBinding.h [new file with mode: 0644]
Tools/Source/TianoTools/Include/Protocol/SimpleFileSystem.h [new file with mode: 0644]
Tools/Source/TianoTools/Include/Protocol/SimpleNetwork.h [new file with mode: 0644]
Tools/Source/TianoTools/Include/Protocol/SimplePointer.h [new file with mode: 0644]
Tools/Source/TianoTools/Include/Protocol/SimpleTextIn.h [new file with mode: 0644]
Tools/Source/TianoTools/Include/Protocol/SimpleTextOut.h [new file with mode: 0644]
Tools/Source/TianoTools/Include/Protocol/Smbus.h [new file with mode: 0644]
Tools/Source/TianoTools/Include/Protocol/SmmAccess.h [new file with mode: 0644]
Tools/Source/TianoTools/Include/Protocol/SmmBase.h [new file with mode: 0644]
Tools/Source/TianoTools/Include/Protocol/SmmControl.h [new file with mode: 0644]
Tools/Source/TianoTools/Include/Protocol/SmmGpiDispatch.h [new file with mode: 0644]
Tools/Source/TianoTools/Include/Protocol/SmmIchnDispatch.h [new file with mode: 0644]
Tools/Source/TianoTools/Include/Protocol/SmmPeriodicTimerDispatch.h [new file with mode: 0644]
Tools/Source/TianoTools/Include/Protocol/SmmPowerButtonDispatch.h [new file with mode: 0644]
Tools/Source/TianoTools/Include/Protocol/SmmStandbyButtonDispatch.h [new file with mode: 0644]
Tools/Source/TianoTools/Include/Protocol/SmmStatusCode.h [new file with mode: 0644]
Tools/Source/TianoTools/Include/Protocol/SmmSwDispatch.h [new file with mode: 0644]
Tools/Source/TianoTools/Include/Protocol/SmmSxDispatch.h [new file with mode: 0644]
Tools/Source/TianoTools/Include/Protocol/SmmUsbDispatch.h [new file with mode: 0644]
Tools/Source/TianoTools/Include/Protocol/TapeIo.h [new file with mode: 0644]
Tools/Source/TianoTools/Include/Protocol/Tcp4.h [new file with mode: 0644]
Tools/Source/TianoTools/Include/Protocol/Udp4.h [new file with mode: 0644]
Tools/Source/TianoTools/Include/Protocol/UgaDraw.h [new file with mode: 0644]
Tools/Source/TianoTools/Include/Protocol/UnicodeCollation.h [new file with mode: 0644]
Tools/Source/TianoTools/Include/Protocol/Usb2HostController.h [new file with mode: 0644]
Tools/Source/TianoTools/Include/Protocol/UsbHostController.h [new file with mode: 0644]
Tools/Source/TianoTools/Include/Protocol/UsbIo.h [new file with mode: 0644]
Tools/Source/TianoTools/Include/ToBeRemoved/Variable.h [new file with mode: 0644]
Tools/Source/TianoTools/Include/ToBeRemoved/WorkingBlockHeader.h [new file with mode: 0644]
Tools/Source/TianoTools/Include/Uefi/EfiPxe.h [new file with mode: 0644]
Tools/Source/TianoTools/Include/Uefi/UefiSpec.h [new file with mode: 0644]
Tools/Source/TianoTools/MakeDeps/build.xml
Tools/Source/TianoTools/PeCoffLoader/build.xml
Tools/Source/TianoTools/PeiRebase/build.xml
Tools/Source/TianoTools/SecApResetVectorFixup/build.xml
Tools/Source/TianoTools/SecFixup/build.xml
Tools/Source/TianoTools/SetStamp/build.xml
Tools/Source/TianoTools/SplitFile/build.xml
Tools/Source/TianoTools/StrGather/build.xml
Tools/Source/TianoTools/String/build.xml
Tools/Source/TianoTools/Strip/build.xml
Tools/Source/TianoTools/VfrCompile/build.xml
Tools/Source/TianoTools/ZeroDebugData/build.xml

index a8cec23ded25c34f3f8ea7205855186747c50657..56535944a047ec9b2ea522b4e754839c3f3fce57 100644 (file)
@@ -82,9 +82,9 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
         outtype="static"\r
         optimize="speed">\r
 \r
         outtype="static"\r
         optimize="speed">\r
 \r
-      <includepath path="${env.WORKSPACE}/MdePkg/Include"/>\r
-      <includepath path="${env.WORKSPACE}/MdePkg/Include/Common"/>\r
-      <includepath path="${env.WORKSPACE}/MdePkg/Include/Ia32"/>\r
+      <includepath path="${PACKAGE_DIR}/Include"/>\r
+      <includepath path="${PACKAGE_DIR}/Include/Common"/>\r
+      <includepath path="${PACKAGE_DIR}/Include/Ia32"/>\r
 \r
       <fileset dir="${basedir}/Common" \r
         includes="*.c" />\r
 \r
       <fileset dir="${basedir}/Common" \r
         includes="*.c" />\r
index 40df87f92e746823897abe78db8d19473e8aadc5..3e0d78f12e8d187806e40dbb8d8b4b061625b499 100644 (file)
@@ -81,9 +81,9 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
       outputfileproperty="result"\r
       >\r
       <fileset dir="${ToolName}" includes="${LibFileSet}" defaultexcludes="TRUE" excludes="*.xml *.inf"/>\r
       outputfileproperty="result"\r
       >\r
       <fileset dir="${ToolName}" includes="${LibFileSet}" defaultexcludes="TRUE" excludes="*.xml *.inf"/>\r
-      <includepath path="${env.WORKSPACE}/MdePkg/Include"/>\r
-      <includepath path="${env.WORKSPACE}/MdePkg/Include/Ia32"/>\r
-      <includepath path="${env.WORKSPACE}/MdePkg/Include/Common"/>\r
+      <includepath path="${PACKAGE_DIR}/Include"/>\r
+      <includepath path="${PACKAGE_DIR}/Include/Ia32"/>\r
+      <includepath path="${PACKAGE_DIR}/Include/Common"/>\r
       <includepath path="${PACKAGE_DIR}/Common"/>\r
       <includepath path="${env.JAVA_HOME}/include"/>\r
       <includepath path="${env.JAVA_HOME}/include/win32" if="windows"/>\r
       <includepath path="${PACKAGE_DIR}/Common"/>\r
       <includepath path="${env.JAVA_HOME}/include"/>\r
       <includepath path="${env.JAVA_HOME}/include/win32" if="windows"/>\r
index 56cff1fdb38728e10653c442a3b15651358f19a3..8d96e394b8139b87846142f1525c6a96ae69f7e4 100644 (file)
@@ -91,10 +91,10 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
         defaultexcludes="TRUE" \r
         excludes="*.xml *.inf"/>\r
 \r
         defaultexcludes="TRUE" \r
         excludes="*.xml *.inf"/>\r
 \r
-      <includepath path="${env.WORKSPACE}/MdePkg/Include"/>\r
-      <includepath path="${env.WORKSPACE}/MdePkg/Include/Ia32"/>\r
-      <includepath path="${env.WORKSPACE}/MdePkg/Include/Common"/>\r
-      <includepath path="${env.WORKSPACE}/MdePkg/Include/Protocol"/>\r
+      <includepath path="${PACKAGE_DIR}/Include"/>\r
+      <includepath path="${PACKAGE_DIR}/Include/Ia32"/>\r
+      <includepath path="${PACKAGE_DIR}/Include/Common"/>\r
+      <includepath path="${PACKAGE_DIR}/Include/Protocol"/>\r
       <includepath path="${PACKAGE_DIR}/Common"/>\r
       <libset dir="${LIB_DIR}" libs="CommonTools CustomizedCompress"/>\r
     </cc>\r
       <includepath path="${PACKAGE_DIR}/Common"/>\r
       <libset dir="${LIB_DIR}" libs="CommonTools CustomizedCompress"/>\r
     </cc>\r
index 388550a651e76c24721f2c2fbe1266ee47b504c4..07e55950d5d976bb6a0254c336fb898918b0cdd5 100644 (file)
@@ -90,9 +90,9 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
         defaultexcludes="TRUE" \r
         excludes="*.xml *.inf"/>\r
 \r
         defaultexcludes="TRUE" \r
         excludes="*.xml *.inf"/>\r
 \r
-      <includepath path="${env.WORKSPACE}/MdePkg/Include"/>\r
-      <includepath path="${env.WORKSPACE}/MdePkg/Include/Common"/>\r
-      <includepath path="${env.WORKSPACE}/MdePkg/Include/Ia32"/>\r
+      <includepath path="${PACKAGE_DIR}/Include"/>\r
+      <includepath path="${PACKAGE_DIR}/Include/Common"/>\r
+      <includepath path="${PACKAGE_DIR}/Include/Ia32"/>\r
     </cc>\r
     <if>\r
       <os family="dos"/>\r
     </cc>\r
     <if>\r
       <os family="dos"/>\r
index adf40d9586b48f6077d2c8a037f7ef2663a9d94c..b8bf7f54152b91985a48d47eb663bf45e30cd59f 100644 (file)
@@ -91,10 +91,10 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
         defaultexcludes="TRUE" \r
         excludes="*.xml *.inf"/>\r
 \r
         defaultexcludes="TRUE" \r
         excludes="*.xml *.inf"/>\r
 \r
-      <includepath path="${env.WORKSPACE}/MdePkg/Include"/>\r
-      <includepath path="${env.WORKSPACE}/MdePkg/Include/Ia32"/>\r
-      <includepath path="${env.WORKSPACE}/MdePkg/Include/Common"/>\r
-      <includepath path="${env.WORKSPACE}/MdePkg/Include/Protocol"/>\r
+      <includepath path="${PACKAGE_DIR}/Include"/>\r
+      <includepath path="${PACKAGE_DIR}/Include/Ia32"/>\r
+      <includepath path="${PACKAGE_DIR}/Include/Common"/>\r
+      <includepath path="${PACKAGE_DIR}/Include/Protocol"/>\r
       <includepath path="${PACKAGE_DIR}/Common"/>\r
       <libset dir="${LIB_DIR}" libs="CommonTools CustomizedCompress"/>\r
     </cc>\r
       <includepath path="${PACKAGE_DIR}/Common"/>\r
       <libset dir="${LIB_DIR}" libs="CommonTools CustomizedCompress"/>\r
     </cc>\r
index 619e9fc280b6eb5344afefe3c3ffe2637dfa7d26..956614fcab52b9500433b4bd3e9c6a6b21772369 100644 (file)
@@ -91,11 +91,11 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
         defaultexcludes="TRUE" \r
         excludes="*.xml *.inf"/>\r
 \r
         defaultexcludes="TRUE" \r
         excludes="*.xml *.inf"/>\r
 \r
-      <includepath path="${env.WORKSPACE}/MdePkg/Include"/>\r
-      <includepath path="${env.WORKSPACE}/MdePkg/Include/Ia32"/>\r
-      <includepath path="${env.WORKSPACE}/MdePkg/Include/Common"/>\r
-      <includepath path="${env.WORKSPACE}/MdePkg/Include/Protocol"/>\r
-      <includepath path="${env.WORKSPACE}/MdePkg/Include/IndustryStandard"/>\r
+      <includepath path="${PACKAGE_DIR}/Include"/>\r
+      <includepath path="${PACKAGE_DIR}/Include/Ia32"/>\r
+      <includepath path="${PACKAGE_DIR}/Include/Common"/>\r
+      <includepath path="${PACKAGE_DIR}/Include/Protocol"/>\r
+      <includepath path="${PACKAGE_DIR}/Include/IndustryStandard"/>\r
       <includepath path="${PACKAGE_DIR}/Common"/>\r
       <libset dir="${LIB_DIR}" libs="CommonTools CustomizedCompress"/>\r
     </cc>\r
       <includepath path="${PACKAGE_DIR}/Common"/>\r
       <libset dir="${LIB_DIR}" libs="CommonTools CustomizedCompress"/>\r
     </cc>\r
index d2bfdd55684a823c822b4de3457737bb08302237..169ca6bc6862d2e4b2d79f92a4e69021c1be5bab 100644 (file)
@@ -96,10 +96,10 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
         defaultexcludes="TRUE" \r
         excludes="*.xml *.inf"/>\r
 \r
         defaultexcludes="TRUE" \r
         excludes="*.xml *.inf"/>\r
 \r
-      <includepath path="${env.WORKSPACE}/MdePkg/Include"/>\r
-      <includepath path="${env.WORKSPACE}/MdePkg/Include/Ia32"/>\r
-      <includepath path="${env.WORKSPACE}/MdePkg/Include/Common"/>\r
-      <includepath path="${env.WORKSPACE}/MdePkg/Include/Protocol"/>\r
+      <includepath path="${PACKAGE_DIR}/Include"/>\r
+      <includepath path="${PACKAGE_DIR}/Include/Ia32"/>\r
+      <includepath path="${PACKAGE_DIR}/Include/Common"/>\r
+      <includepath path="${PACKAGE_DIR}/Include/Protocol"/>\r
       <includepath path="${PACKAGE_DIR}/Common"/>\r
       <libset dir="${LIB_DIR}" libs="CommonTools CustomizedCompress"/>\r
     </cc>\r
       <includepath path="${PACKAGE_DIR}/Common"/>\r
       <libset dir="${LIB_DIR}" libs="CommonTools CustomizedCompress"/>\r
     </cc>\r
index 13ecb1f9aa2d38ea116c74bed4175b29710cc659..dc493855ab4a7597a351b3c1aced2df3965bd116 100644 (file)
@@ -90,9 +90,9 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
         defaultexcludes="TRUE" \r
         excludes="*.xml *.inf"/>\r
 \r
         defaultexcludes="TRUE" \r
         excludes="*.xml *.inf"/>\r
 \r
-      <includepath path="${env.WORKSPACE}/MdePkg/Include"/>\r
-      <includepath path="${env.WORKSPACE}/MdePkg/Include/Common"/>\r
-      <includepath path="${env.WORKSPACE}/MdePkg/Include/Ia32"/>\r
+      <includepath path="${PACKAGE_DIR}/Include"/>\r
+      <includepath path="${PACKAGE_DIR}/Include/Common"/>\r
+      <includepath path="${PACKAGE_DIR}/Include/Ia32"/>\r
       <includepath path="${PACKAGE_DIR}/Common"/>\r
                        <libset dir="${LIB_DIR}" libs="CommonTools"/>\r
     </cc>\r
       <includepath path="${PACKAGE_DIR}/Common"/>\r
                        <libset dir="${LIB_DIR}" libs="CommonTools"/>\r
     </cc>\r
index b6f242715751fd6cb374d05fd0472abdb6229c9c..c5179bfe20ac58ee6f24d3a26651cddbd59e269f 100644 (file)
@@ -91,10 +91,10 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
         defaultexcludes="TRUE" \r
         excludes="*.xml *.inf"/>\r
 \r
         defaultexcludes="TRUE" \r
         excludes="*.xml *.inf"/>\r
 \r
-      <includepath path="${env.WORKSPACE}/MdePkg/Include"/>\r
-      <includepath path="${env.WORKSPACE}/MdePkg/Include/Ia32"/>\r
-      <includepath path="${env.WORKSPACE}/MdePkg/Include/Common"/>\r
-      <includepath path="${env.WORKSPACE}/MdePkg/Include/Protocol"/>\r
+      <includepath path="${PACKAGE_DIR}/Include"/>\r
+      <includepath path="${PACKAGE_DIR}/Include/Ia32"/>\r
+      <includepath path="${PACKAGE_DIR}/Include/Common"/>\r
+      <includepath path="${PACKAGE_DIR}/Include/Protocol"/>\r
       <includepath path="${PACKAGE_DIR}/Common"/>\r
       <libset dir="${LIB_DIR}" libs="CommonTools CustomizedCompress"/>\r
     </cc>\r
       <includepath path="${PACKAGE_DIR}/Common"/>\r
       <libset dir="${LIB_DIR}" libs="CommonTools CustomizedCompress"/>\r
     </cc>\r
index a432c86cc09cbec7b9dbd053bc1acc0f70066f75..c581605352c9c4bd8b2f7bc4cafde6428d5966e0 100644 (file)
@@ -88,9 +88,9 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
       <fileset dir="${basedir}/${ToolName}" \r
         includes="${FileSet}"/>\r
 \r
       <fileset dir="${basedir}/${ToolName}" \r
         includes="${FileSet}"/>\r
 \r
-      <includepath path="${env.WORKSPACE}/MdePkg/Include"/>\r
-      <includepath path="${env.WORKSPACE}/MdePkg/Include/Common"/>\r
-      <includepath path="${env.WORKSPACE}/MdePkg/Include/Ia32"/>\r
+      <includepath path="${PACKAGE_DIR}/Include"/>\r
+      <includepath path="${PACKAGE_DIR}/Include/Common"/>\r
+      <includepath path="${PACKAGE_DIR}/Include/Ia32"/>\r
       <includepath path="${PACKAGE_DIR}/Common"/>\r
                        <libset dir="${LIB_DIR}" libs="CommonTools"/>\r
 \r
       <includepath path="${PACKAGE_DIR}/Common"/>\r
                        <libset dir="${LIB_DIR}" libs="CommonTools"/>\r
 \r
index 88623078ce72cf2e8683ebd7f5c40e3f37a45ff4..b8265154029b07a3534b00ac0697552261b3203b 100644 (file)
@@ -91,10 +91,10 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
         defaultexcludes="TRUE" \r
         excludes="*.xml *.inf"/>\r
 \r
         defaultexcludes="TRUE" \r
         excludes="*.xml *.inf"/>\r
 \r
-      <includepath path="${env.WORKSPACE}/MdePkg/Include"/>\r
-      <includepath path="${env.WORKSPACE}/MdePkg/Include/Ia32"/>\r
-      <includepath path="${env.WORKSPACE}/MdePkg/Include/Common"/>\r
-      <includepath path="${env.WORKSPACE}/MdePkg/Include/Protocol"/>\r
+      <includepath path="${PACKAGE_DIR}/Include"/>\r
+      <includepath path="${PACKAGE_DIR}/Include/Ia32"/>\r
+      <includepath path="${PACKAGE_DIR}/Include/Common"/>\r
+      <includepath path="${PACKAGE_DIR}/Include/Protocol"/>\r
       <includepath path="${PACKAGE_DIR}/Common"/>\r
       <libset dir="${LIB_DIR}" libs="CommonTools CustomizedCompress"/>\r
     </cc>\r
       <includepath path="${PACKAGE_DIR}/Common"/>\r
       <libset dir="${LIB_DIR}" libs="CommonTools CustomizedCompress"/>\r
     </cc>\r
index 9b4b8952dbf097b9c66c93a77f979f7348d35d0b..4cccca4f35361669ef9b579f49333a7da2efd740 100644 (file)
@@ -89,9 +89,9 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
       <fileset dir="${basedir}/${ToolName}" \r
         includes="${FileSet}" />\r
 \r
       <fileset dir="${basedir}/${ToolName}" \r
         includes="${FileSet}" />\r
 \r
-      <includepath path="${env.WORKSPACE}/MdePkg/Include"/>\r
-      <includepath path="${env.WORKSPACE}/MdePkg/Include/Common"/>\r
-      <includepath path="${env.WORKSPACE}/MdePkg/Include/Ia32"/>\r
+      <includepath path="${PACKAGE_DIR}/Include"/>\r
+      <includepath path="${PACKAGE_DIR}/Include/Common"/>\r
+      <includepath path="${PACKAGE_DIR}/Include/Ia32"/>\r
       <includepath path="${PACKAGE_DIR}/Common"/>\r
                        <libset dir="${LIB_DIR}" libs="CommonTools"/>\r
     </cc>\r
       <includepath path="${PACKAGE_DIR}/Common"/>\r
                        <libset dir="${LIB_DIR}" libs="CommonTools"/>\r
     </cc>\r
index 00a1266e5d4468471e0bf542ca97659e9be84164..595523342544108fcc1d4ea92f165b11547c76c6 100644 (file)
@@ -91,10 +91,10 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
         defaultexcludes="TRUE" \r
         excludes="*.xml *.inf"/>\r
 \r
         defaultexcludes="TRUE" \r
         excludes="*.xml *.inf"/>\r
 \r
-      <includepath path="${env.WORKSPACE}/MdePkg/Include"/>\r
-      <includepath path="${env.WORKSPACE}/MdePkg/Include/Ia32"/>\r
-      <includepath path="${env.WORKSPACE}/MdePkg/Include/Common"/>\r
-      <includepath path="${env.WORKSPACE}/MdePkg/Include/Protocol"/>\r
+      <includepath path="${PACKAGE_DIR}/Include"/>\r
+      <includepath path="${PACKAGE_DIR}/Include/Ia32"/>\r
+      <includepath path="${PACKAGE_DIR}/Include/Common"/>\r
+      <includepath path="${PACKAGE_DIR}/Include/Protocol"/>\r
       <includepath path="${PACKAGE_DIR}/Common"/>\r
                        <libset dir="${LIB_DIR}" libs="CommonTools CustomizedCompress"/>\r
     </cc>\r
       <includepath path="${PACKAGE_DIR}/Common"/>\r
                        <libset dir="${LIB_DIR}" libs="CommonTools CustomizedCompress"/>\r
     </cc>\r
index c57ec2968e17e9cb7fefeed2e92b1ad3c1160a78..cc2141d3bb8c5a8351f8a4fa1bb1c4c3b3f42093 100644 (file)
@@ -122,13 +122,13 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
         includes="${FileSet}"/>\r
 \r
       <includepath path="${PACKAGE_DIR}/${ToolName}"/>\r
         includes="${FileSet}"/>\r
 \r
       <includepath path="${PACKAGE_DIR}/${ToolName}"/>\r
-      <includepath path="${env.WORKSPACE}/MdePkg/Include"/>\r
-      <includepath path="${env.WORKSPACE}/MdePkg/Include"/>\r
-      <includepath path="${env.WORKSPACE}/MdePkg/Include/Ia32"/>\r
-      <includepath path="${env.WORKSPACE}/MdePkg/Include/Common"/>\r
-      <includepath path="${env.WORKSPACE}/MdePkg/Include/Protocol"/>\r
-      <includepath path="${env.WORKSPACE}/MdePkg/Include/Library"/>\r
-      <includepath path="${env.WORKSPACE}/MdePkg/Include/ToBeRemoved"/>\r
+      <includepath path="${PACKAGE_DIR}/Include"/>\r
+      <includepath path="${PACKAGE_DIR}/Include"/>\r
+      <includepath path="${PACKAGE_DIR}/Include/Ia32"/>\r
+      <includepath path="${PACKAGE_DIR}/Include/Common"/>\r
+      <includepath path="${PACKAGE_DIR}/Include/Protocol"/>\r
+      <includepath path="${PACKAGE_DIR}/Include/Library"/>\r
+      <includepath path="${PACKAGE_DIR}/Include/ToBeRemoved"/>\r
       <includepath path="${PACKAGE_DIR}/Common"/>\r
       <libset dir="${LIB_DIR}" libs="CommonTools CustomizedCompress"/>\r
       <linkerarg value="/nodefaultlib:libc.lib" unless="gcc"/>\r
       <includepath path="${PACKAGE_DIR}/Common"/>\r
       <libset dir="${LIB_DIR}" libs="CommonTools CustomizedCompress"/>\r
       <linkerarg value="/nodefaultlib:libc.lib" unless="gcc"/>\r
index 34be36eaa094d6550b24f635ae973fc227c01ebf..18935d3ce8796c73354d8ce856d1548a6901dbd7 100644 (file)
@@ -91,10 +91,10 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
         defaultexcludes="TRUE" \r
         excludes="*.xml *.inf"/>\r
 \r
         defaultexcludes="TRUE" \r
         excludes="*.xml *.inf"/>\r
 \r
-      <includepath path="${env.WORKSPACE}/MdePkg/Include"/>\r
-      <includepath path="${env.WORKSPACE}/MdePkg/Include/Ia32"/>\r
-      <includepath path="${env.WORKSPACE}/MdePkg/Include/Common"/>\r
-      <includepath path="${env.WORKSPACE}/MdePkg/Include/Protocol"/>\r
+      <includepath path="${PACKAGE_DIR}/Include"/>\r
+      <includepath path="${PACKAGE_DIR}/Include/Ia32"/>\r
+      <includepath path="${PACKAGE_DIR}/Include/Common"/>\r
+      <includepath path="${PACKAGE_DIR}/Include/Protocol"/>\r
       <includepath path="${PACKAGE_DIR}/Common"/>\r
                        <libset dir="${LIB_DIR}" libs="CommonTools CustomizedCompress"/>\r
     </cc>\r
       <includepath path="${PACKAGE_DIR}/Common"/>\r
                        <libset dir="${LIB_DIR}" libs="CommonTools CustomizedCompress"/>\r
     </cc>\r
index c0e2c82c74cdd0b07270e63bc30a92005b5f8f27..472160f6733c822cb7fa1db2ea514447ad1c1f97 100644 (file)
@@ -91,10 +91,10 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
         defaultexcludes="TRUE" \r
         excludes="*.xml *.inf"/>\r
 \r
         defaultexcludes="TRUE" \r
         excludes="*.xml *.inf"/>\r
 \r
-      <includepath path="${env.WORKSPACE}/MdePkg/Include"/>\r
-      <includepath path="${env.WORKSPACE}/MdePkg/Include/Ia32"/>\r
-      <includepath path="${env.WORKSPACE}/MdePkg/Include/Common"/>\r
-      <includepath path="${env.WORKSPACE}/MdePkg/Include/Protocol"/>\r
+      <includepath path="${PACKAGE_DIR}/Include"/>\r
+      <includepath path="${PACKAGE_DIR}/Include/Ia32"/>\r
+      <includepath path="${PACKAGE_DIR}/Include/Common"/>\r
+      <includepath path="${PACKAGE_DIR}/Include/Protocol"/>\r
       <includepath path="${PACKAGE_DIR}/Common"/>\r
                        <libset dir="${LIB_DIR}" libs="CommonTools CustomizedCompress"/>\r
     </cc>\r
       <includepath path="${PACKAGE_DIR}/Common"/>\r
                        <libset dir="${LIB_DIR}" libs="CommonTools CustomizedCompress"/>\r
     </cc>\r
index d7b7fba63236a511bdb37d3f6995214f9ae5c16a..478edc6189966d66849a5be9407926a449c2464f 100644 (file)
@@ -91,11 +91,11 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
         defaultexcludes="TRUE" \r
         excludes="*.xml *.inf"/>\r
 \r
         defaultexcludes="TRUE" \r
         excludes="*.xml *.inf"/>\r
 \r
-      <includepath path="${env.WORKSPACE}/MdePkg/Include"/>\r
-      <includepath path="${env.WORKSPACE}/MdePkg/Include/Ia32"/>\r
-      <includepath path="${env.WORKSPACE}/MdePkg/Include/Common"/>\r
-      <includepath path="${env.WORKSPACE}/MdePkg/Include/Guid"/>\r
-      <includepath path="${env.WORKSPACE}/MdePkg/Include/Protocol"/>\r
+      <includepath path="${PACKAGE_DIR}/Include"/>\r
+      <includepath path="${PACKAGE_DIR}/Include/Ia32"/>\r
+      <includepath path="${PACKAGE_DIR}/Include/Common"/>\r
+      <includepath path="${PACKAGE_DIR}/Include/Guid"/>\r
+      <includepath path="${PACKAGE_DIR}/Include/Protocol"/>\r
       <includepath path="${PACKAGE_DIR}/Common"/>\r
                        <linkerarg value="${LIB_DIR}/CommonTools.lib"/>\r
                        <linkerarg value="${LIB_DIR}/CustomizedCompress.lib"/>\r
       <includepath path="${PACKAGE_DIR}/Common"/>\r
                        <linkerarg value="${LIB_DIR}/CommonTools.lib"/>\r
                        <linkerarg value="${LIB_DIR}/CustomizedCompress.lib"/>\r
diff --git a/Tools/Source/TianoTools/Include/Base.h b/Tools/Source/TianoTools/Include/Base.h
new file mode 100644 (file)
index 0000000..99ed686
--- /dev/null
@@ -0,0 +1,28 @@
+/** @file\r
+\r
+  Root include file for Mde Package Base type modules\r
+\r
+  This is the include file for any module of type base. Base modules only use \r
+  types defined via this include file and can be ported easily to any \r
+  environment. There are a set of base libraries in the Mde Package that can\r
+  be used to implement base modules.\r
+\r
+Copyright (c) 2006, Intel Corporation\r
+All rights reserved. This program and the accompanying materials\r
+are licensed and made available under the terms and conditions of the BSD License\r
+which accompanies this distribution.  The full text of the license may be found at\r
+http://opensource.org/licenses/bsd-license.php\r
+\r
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+\r
+#ifndef __BASE_H__\r
+#define __BASE_H__\r
+\r
+#include <Common/BaseTypes.h>\r
+#include <Common/EfiImage.h>\r
+\r
+#endif\r
diff --git a/Tools/Source/TianoTools/Include/Common/BaseTypes.h b/Tools/Source/TianoTools/Include/Common/BaseTypes.h
new file mode 100644 (file)
index 0000000..86c3c71
--- /dev/null
@@ -0,0 +1,206 @@
+/** @file\r
+  Processor or Compiler specific defines for all supported processors.\r
+\r
+  This file is stand alone self consistent set of definitions. \r
+\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. This program and the accompanying materials                          \r
+  are licensed and made available under the terms and conditions of the BSD License         \r
+  which accompanies this distribution.  The full text of the license may be found at        \r
+  http://opensource.org/licenses/bsd-license.php                                            \r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+  Module Name:  BaseTypes.h\r
+\r
+**/\r
+\r
+#ifndef __BASE_TYPES_H__\r
+#define __BASE_TYPES_H__\r
+\r
+//\r
+// Include processor specific binding\r
+//\r
+#include <ProcessorBind.h>\r
+\r
+#define MEMORY_FENCE()  MemoryFence ()\r
+#define BREAKPOINT()    CpuBreakpoint ()\r
+#define DEADLOOP()      CpuDeadLoop ()\r
+\r
+typedef struct {\r
+  UINT32  Data1;\r
+  UINT16  Data2;\r
+  UINT16  Data3;\r
+  UINT8   Data4[8];\r
+} GUID;\r
+\r
+\r
+//\r
+// Modifiers to absract standard types to aid in debug of problems\r
+//\r
+#define CONST     const\r
+#define STATIC    static\r
+#define VOID      void\r
+\r
+//\r
+// Modifiers for Data Types used to self document code.\r
+// This concept is borrowed for UEFI specification.\r
+//\r
+#ifndef IN\r
+//\r
+// Some other envirnments use this construct, so #ifndef to prevent\r
+// mulitple definition.\r
+//\r
+#define IN\r
+#define OUT\r
+#define OPTIONAL\r
+#endif\r
+\r
+//\r
+// Constants. They may exist in other build structures, so #ifndef them.\r
+//\r
+#ifndef TRUE\r
+//\r
+// BugBug: UEFI specification claims 1 and 0. We are concerned about the \r
+//  complier portability so we did it this way.\r
+//\r
+#define TRUE  ((BOOLEAN)(1==1))\r
+#endif\r
+\r
+#ifndef FALSE\r
+#define FALSE ((BOOLEAN)(0==1))\r
+#endif\r
+\r
+#ifndef NULL\r
+#define NULL  ((VOID *) 0)\r
+#endif\r
+\r
+//\r
+//  Support for variable length argument lists using the ANSI standard.\r
+//  \r
+//  Since we are using the ANSI standard we used the standard nameing and\r
+//  did not folow the coding convention\r
+//\r
+//  VA_LIST  - typedef for argument list.\r
+//  VA_START (VA_LIST Marker, argument before the ...) - Init Marker for use.\r
+//  VA_END (VA_LIST Marker) - Clear Marker\r
+//  VA_ARG (VA_LIST Marker, var arg size) - Use Marker to get an argumnet from\r
+//    the ... list. You must know the size and pass it in this macro.\r
+//\r
+//  example:\r
+//\r
+//  UINTN\r
+//  ExampleVarArg (\r
+//    IN UINTN  NumberOfArgs,\r
+//    ...\r
+//    )\r
+//  {\r
+//    VA_LIST Marker;\r
+//    UINTN   Index;\r
+//    UINTN   Result;\r
+//\r
+//    //\r
+//    // Initialize the Marker\r
+//    //\r
+//    VA_START (Marker, NumberOfArgs);\r
+//    for (Index = 0, Result = 0; Index < NumberOfArgs; Index++) {\r
+//      //\r
+//      // The ... list is a series of UINTN values, so average them up.\r
+//      //\r
+//      Result += VA_ARG (Marker, UINTN);\r
+//    }\r
+//\r
+//    VA_END (Marker);\r
+//    return Result\r
+//  }\r
+//\r
+\r
+#define _INT_SIZE_OF(n) ((sizeof (n) + sizeof (UINTN) - 1) &~(sizeof (UINTN) - 1))\r
+\r
+//\r
+// Also support coding convention rules for var arg macros\r
+//\r
+#ifndef VA_START\r
+\r
+typedef CHAR8 *VA_LIST;\r
+#define VA_START(ap, v) (ap = (VA_LIST) & (v) + _INT_SIZE_OF (v))\r
+#define VA_ARG(ap, t)   (*(t *) ((ap += _INT_SIZE_OF (t)) - _INT_SIZE_OF (t)))\r
+#define VA_END(ap)      (ap = (VA_LIST) 0)\r
+\r
+#endif\r
+\r
+///\r
+///  CONTAINING_RECORD - returns a pointer to the structure\r
+///      from one of it's elements.\r
+///\r
+#define _CR(Record, TYPE, Field)  ((TYPE *) ((CHAR8 *) (Record) - (CHAR8 *) &(((TYPE *) 0)->Field)))\r
+\r
+///\r
+///  ALIGN_POINTER - aligns a pointer to the lowest boundry\r
+///\r
+#define ALIGN_POINTER(p, s) ((VOID *) ((p) + (((s) - ((UINTN) (p))) & ((s) - 1))))\r
+\r
+///\r
+///  ALIGN_VARIABLE - aligns a variable up to the next natural boundry for int size of a processor\r
+///\r
+#define ALIGN_VARIABLE(Value, Adjustment) \\r
+  Adjustment = 0U; \\r
+  if ((UINTN) (Value) % sizeof (UINTN)) { \\r
+    (Adjustment) = (UINTN)(sizeof (UINTN) - ((UINTN) (Value) % sizeof (UINTN))); \\r
+  } \\r
+  (Value) = (UINTN)((UINTN) (Value) + (UINTN) (Adjustment))\r
+\r
+//\r
+// EFI Error Codes common to all execution phases\r
+//\r
+\r
+typedef INTN RETURN_STATUS;\r
+\r
+///\r
+/// Set the upper bit to indicate EFI Error.\r
+///\r
+#define ENCODE_ERROR(a)              (MAX_BIT | (a))\r
+\r
+#define ENCODE_WARNING(a)            (a)\r
+#define RETURN_ERROR(a)              ((a) < 0)\r
+\r
+#define RETURN_SUCCESS               0\r
+#define RETURN_LOAD_ERROR            ENCODE_ERROR (1)\r
+#define RETURN_INVALID_PARAMETER     ENCODE_ERROR (2)\r
+#define RETURN_UNSUPPORTED           ENCODE_ERROR (3)\r
+#define RETURN_BAD_BUFFER_SIZE       ENCODE_ERROR (4)\r
+#define RETURN_BUFFER_TOO_SMALL      ENCODE_ERROR (5)\r
+#define RETURN_NOT_READY             ENCODE_ERROR (6)\r
+#define RETURN_DEVICE_ERROR          ENCODE_ERROR (7)\r
+#define RETURN_WRITE_PROTECTED       ENCODE_ERROR (8)\r
+#define RETURN_OUT_OF_RESOURCES      ENCODE_ERROR (9)\r
+#define RETURN_VOLUME_CORRUPTED      ENCODE_ERROR (10)\r
+#define RETURN_VOLUME_FULL           ENCODE_ERROR (11)\r
+#define RETURN_NO_MEDIA              ENCODE_ERROR (12)\r
+#define RETURN_MEDIA_CHANGED         ENCODE_ERROR (13)\r
+#define RETURN_NOT_FOUND             ENCODE_ERROR (14)\r
+#define RETURN_ACCESS_DENIED         ENCODE_ERROR (15)\r
+#define RETURN_NO_RESPONSE           ENCODE_ERROR (16)\r
+#define RETURN_NO_MAPPING            ENCODE_ERROR (17)\r
+#define RETURN_TIMEOUT               ENCODE_ERROR (18)\r
+#define RETURN_NOT_STARTED           ENCODE_ERROR (19)\r
+#define RETURN_ALREADY_STARTED       ENCODE_ERROR (20)\r
+#define RETURN_ABORTED               ENCODE_ERROR (21)\r
+#define RETURN_ICMP_ERROR            ENCODE_ERROR (22)\r
+#define RETURN_TFTP_ERROR            ENCODE_ERROR (23)\r
+#define RETURN_PROTOCOL_ERROR        ENCODE_ERROR (24)\r
+#define RETURN_INCOMPATIBLE_VERSION  ENCODE_ERROR (25)\r
+#define RETURN_SECURITY_VIOLATION    ENCODE_ERROR (26)\r
+#define RETURN_CRC_ERROR             ENCODE_ERROR (27)\r
+#define RETURN_END_OF_MEDIA          ENCODE_ERROR (28)\r
+#define RETURN_END_OF_FILE           ENCODE_ERROR (31)\r
+\r
+#define RETURN_WARN_UNKNOWN_GLYPH    ENCODE_WARNING (1)\r
+#define RETURN_WARN_DELETE_FAILURE   ENCODE_WARNING (2)\r
+#define RETURN_WARN_WRITE_FAILURE    ENCODE_WARNING (3)\r
+#define RETURN_WARN_BUFFER_TOO_SMALL ENCODE_WARNING (4)\r
+\r
+typedef UINT64 PHYSICAL_ADDRESS;\r
+\r
+#endif\r
diff --git a/Tools/Source/TianoTools/Include/Common/BootMode.h b/Tools/Source/TianoTools/Include/Common/BootMode.h
new file mode 100644 (file)
index 0000000..2f2c516
--- /dev/null
@@ -0,0 +1,37 @@
+/** @file\r
+  This includes for the Boot mode information.\r
+\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. This program and the accompanying materials                          \r
+  are licensed and made available under the terms and conditions of the BSD License         \r
+  which accompanies this distribution.  The full text of the license may be found at        \r
+  http://opensource.org/licenses/bsd-license.php                                            \r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+  Module Name:  BootMode.h\r
+\r
+  @par Revision Reference:\r
+  These definitions are from PeiCis 0.91 spec.\r
+\r
+**/\r
+\r
+#ifndef __EFI_BOOT_MODE_H__\r
+#define __EFI_BOOT_MODE_H__\r
+\r
+#define BOOT_WITH_FULL_CONFIGURATION                  0x00\r
+#define BOOT_WITH_MINIMAL_CONFIGURATION               0x01\r
+#define BOOT_ASSUMING_NO_CONFIGURATION_CHANGES        0x02\r
+#define BOOT_WITH_FULL_CONFIGURATION_PLUS_DIAGNOSTICS 0x03\r
+#define BOOT_WITH_DEFAULT_SETTINGS                    0x04\r
+#define BOOT_ON_S4_RESUME                             0x05\r
+#define BOOT_ON_S5_RESUME                             0x06\r
+#define BOOT_ON_S2_RESUME                             0x10\r
+#define BOOT_ON_S3_RESUME                             0x11\r
+#define BOOT_ON_FLASH_UPDATE                          0x12\r
+#define BOOT_IN_RECOVERY_MODE                         0x20\r
+#define BOOT_IN_RECOVERY_MODE_MASK                    0x40\r
+#define BOOT_SPECIAL_MASK                             0x80\r
+\r
+#endif\r
diff --git a/Tools/Source/TianoTools/Include/Common/BootScript.h b/Tools/Source/TianoTools/Include/Common/BootScript.h
new file mode 100644 (file)
index 0000000..12bcc5b
--- /dev/null
@@ -0,0 +1,198 @@
+/** @file\r
+  This file declares the related BootScript definitions and some SMBus definitions.\r
+\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. This program and the accompanying materials                          \r
+  are licensed and made available under the terms and conditions of the BSD License         \r
+  which accompanies this distribution.  The full text of the license may be found at        \r
+  http://opensource.org/licenses/bsd-license.php                                            \r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+  Module Name:  BootScript.h\r
+\r
+  @par Revision Reference:\r
+  These definitions are defined in BootScript Spec 0.91 and SmBus PPI spec 0.9.\r
+\r
+**/\r
+\r
+#ifndef _EFI_SCRIPT_H_\r
+#define _EFI_SCRIPT_H_\r
+\r
+#define EFI_ACPI_S3_RESUME_SCRIPT_TABLE               0x00\r
+\r
+//\r
+// Boot Script Opcode Definitions\r
+//\r
+\r
+#define EFI_BOOT_SCRIPT_IO_WRITE_OPCODE               0x00\r
+#define EFI_BOOT_SCRIPT_IO_READ_WRITE_OPCODE          0x01\r
+#define EFI_BOOT_SCRIPT_MEM_WRITE_OPCODE              0x02\r
+#define EFI_BOOT_SCRIPT_MEM_READ_WRITE_OPCODE         0x03\r
+#define EFI_BOOT_SCRIPT_PCI_CONFIG_WRITE_OPCODE       0x04\r
+#define EFI_BOOT_SCRIPT_PCI_CONFIG_READ_WRITE_OPCODE  0x05\r
+#define EFI_BOOT_SCRIPT_SMBUS_EXECUTE_OPCODE          0x06\r
+#define EFI_BOOT_SCRIPT_STALL_OPCODE                  0x07\r
+#define EFI_BOOT_SCRIPT_DISPATCH_OPCODE               0x08\r
+\r
+#define EFI_BOOT_SCRIPT_TABLE_OPCODE                  0xAA\r
+#define EFI_BOOT_SCRIPT_TERMINATE_OPCODE              0xFF\r
+\r
+//\r
+// EFI Boot Script Width\r
+//\r
+typedef enum {\r
+  EfiBootScriptWidthUint8,\r
+  EfiBootScriptWidthUint16,\r
+  EfiBootScriptWidthUint32,\r
+  EfiBootScriptWidthUint64,\r
+  EfiBootScriptWidthFifoUint8,\r
+  EfiBootScriptWidthFifoUint16,\r
+  EfiBootScriptWidthFifoUint32,\r
+  EfiBootScriptWidthFifoUint64,\r
+  EfiBootScriptWidthFillUint8,\r
+  EfiBootScriptWidthFillUint16,\r
+  EfiBootScriptWidthFillUint32,\r
+  EfiBootScriptWidthFillUint64,\r
+  EfiBootScriptWidthMaximum\r
+} EFI_BOOT_SCRIPT_WIDTH;\r
+\r
+//\r
+// EFI Smbus Device Address, Smbus Device Command, Smbus Operation\r
+//\r
+typedef struct {\r
+  UINTN SmbusDeviceAddress : 7;\r
+} EFI_SMBUS_DEVICE_ADDRESS;\r
+\r
+typedef UINTN EFI_SMBUS_DEVICE_COMMAND;\r
+\r
+typedef enum _EFI_SMBUS_OPERATION\r
+{\r
+  EfiSmbusQuickRead,\r
+  EfiSmbusQuickWrite,\r
+  EfiSmbusReceiveByte,\r
+  EfiSmbusSendByte,\r
+  EfiSmbusReadByte,\r
+  EfiSmbusWriteByte,\r
+  EfiSmbusReadWord,\r
+  EfiSmbusWriteWord,\r
+  EfiSmbusReadBlock,\r
+  EfiSmbusWriteBlock,\r
+  EfiSmbusProcessCall,\r
+  EfiSmbusBWBRProcessCall\r
+} EFI_SMBUS_OPERATION;\r
+\r
+//\r
+// Boot Script Opcode Header Structure Definitions\r
+//\r
+\r
+typedef struct {\r
+  UINT16  OpCode;\r
+  UINT8   Length;\r
+} EFI_BOOT_SCRIPT_GENERIC_HEADER;\r
+\r
+typedef struct {\r
+  UINT16  OpCode;\r
+  UINT8   Length;\r
+  UINT16  Version;\r
+  UINT32  TableLength;\r
+  UINT16  Reserved[2];\r
+} EFI_BOOT_SCRIPT_TABLE_HEADER;\r
+\r
+typedef struct {\r
+  UINT16                OpCode;\r
+  UINT8                 Length;\r
+  EFI_BOOT_SCRIPT_WIDTH Width;\r
+} EFI_BOOT_SCRIPT_COMMON_HEADER;\r
+\r
+typedef struct {\r
+  UINT16                OpCode;\r
+  UINT8                 Length;\r
+  EFI_BOOT_SCRIPT_WIDTH Width;\r
+  UINTN                 Count;\r
+  UINT64                Address;\r
+} EFI_BOOT_SCRIPT_IO_WRITE;\r
+\r
+typedef struct {\r
+  UINT16                OpCode;\r
+  UINT8                 Length;\r
+  EFI_BOOT_SCRIPT_WIDTH Width;\r
+  UINT64                Address;\r
+} EFI_BOOT_SCRIPT_IO_READ_WRITE;\r
+\r
+typedef struct {\r
+  UINT16                OpCode;\r
+  UINT8                 Length;\r
+  EFI_BOOT_SCRIPT_WIDTH Width;\r
+  UINTN                 Count;\r
+  UINT64                Address;\r
+} EFI_BOOT_SCRIPT_MEM_WRITE;\r
+\r
+typedef struct {\r
+  UINT16                OpCode;\r
+  UINT8                 Length;\r
+  EFI_BOOT_SCRIPT_WIDTH Width;\r
+  UINT64                Address;\r
+} EFI_BOOT_SCRIPT_MEM_READ_WRITE;\r
+\r
+typedef struct {\r
+  UINT16                OpCode;\r
+  UINT8                 Length;\r
+  EFI_BOOT_SCRIPT_WIDTH Width;\r
+  UINTN                 Count;\r
+  UINT64                Address;\r
+} EFI_BOOT_SCRIPT_PCI_CONFIG_WRITE;\r
+\r
+typedef struct {\r
+  UINT16                OpCode;\r
+  UINT8                 Length;\r
+  EFI_BOOT_SCRIPT_WIDTH Width;\r
+  UINT64                Address;\r
+} EFI_BOOT_SCRIPT_PCI_CONFIG_READ_WRITE;\r
+\r
+typedef struct {\r
+  UINT16                    OpCode;\r
+  UINT8                     Length;\r
+  EFI_SMBUS_DEVICE_ADDRESS  SlaveAddress;\r
+  EFI_SMBUS_DEVICE_COMMAND  Command;\r
+  EFI_SMBUS_OPERATION       Operation;\r
+  BOOLEAN                   PecCheck;\r
+  UINTN                     DataSize;\r
+} EFI_BOOT_SCRIPT_SMBUS_EXECUTE;\r
+\r
+typedef struct {\r
+  UINT16  OpCode;\r
+  UINT8   Length;\r
+  UINTN   Duration;\r
+} EFI_BOOT_SCRIPT_STALL;\r
+\r
+typedef struct {\r
+  UINT16                OpCode;\r
+  UINT8                 Length;\r
+  EFI_PHYSICAL_ADDRESS  EntryPoint;\r
+} EFI_BOOT_SCRIPT_DISPATCH;\r
+\r
+typedef struct {\r
+  UINT16  OpCode;\r
+  UINT8   Length;\r
+} EFI_BOOT_SCRIPT_TERMINATE;\r
+\r
+typedef union {\r
+  EFI_BOOT_SCRIPT_GENERIC_HEADER        *Header;\r
+  EFI_BOOT_SCRIPT_TABLE_HEADER          *TableInfo;\r
+  EFI_BOOT_SCRIPT_IO_WRITE              *IoWrite;\r
+  EFI_BOOT_SCRIPT_IO_READ_WRITE         *IoReadWrite;\r
+  EFI_BOOT_SCRIPT_MEM_WRITE             *MemWrite;\r
+  EFI_BOOT_SCRIPT_MEM_READ_WRITE        *MemReadWrite;\r
+  EFI_BOOT_SCRIPT_PCI_CONFIG_WRITE      *PciWrite;\r
+  EFI_BOOT_SCRIPT_PCI_CONFIG_READ_WRITE *PciReadWrite;\r
+  EFI_BOOT_SCRIPT_SMBUS_EXECUTE         *SmbusExecute;\r
+  EFI_BOOT_SCRIPT_STALL                 *Stall;\r
+  EFI_BOOT_SCRIPT_DISPATCH              *Dispatch;\r
+  EFI_BOOT_SCRIPT_TERMINATE             *Terminate;\r
+  EFI_BOOT_SCRIPT_COMMON_HEADER         *CommonHeader;\r
+  UINT8                                 *Raw;\r
+} BOOT_SCRIPT_POINTERS;\r
+\r
+#endif\r
diff --git a/Tools/Source/TianoTools/Include/Common/Capsule.h b/Tools/Source/TianoTools/Include/Common/Capsule.h
new file mode 100644 (file)
index 0000000..0434fdf
--- /dev/null
@@ -0,0 +1,67 @@
+/** @file\r
+  Defines for the EFI Capsule functionality.\r
+\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. This program and the accompanying materials                          \r
+  are licensed and made available under the terms and conditions of the BSD License         \r
+  which accompanies this distribution.  The full text of the license may be found at        \r
+  http://opensource.org/licenses/bsd-license.php                                            \r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+  Module Name:  Capsule.h\r
+\r
+  @par Revision Reference:\r
+  These definitions are from Capsule Spec Version 0.9.\r
+\r
+**/\r
+\r
+#ifndef _EFI_CAPSULE_H_\r
+#define _EFI_CAPSULE_H_\r
+\r
+//\r
+// Bits in the flags field of the capsule header\r
+//\r
+#define EFI_CAPSULE_HEADER_FLAG_SETUP 0x00000001  // supports setup changes\r
+\r
+\r
+#define CAPSULE_BLOCK_DESCRIPTOR_SIGNATURE  EFI_SIGNATURE_32 ('C', 'B', 'D', 'S')\r
+\r
+//\r
+// An array of these describe the blocks that make up a capsule for\r
+// a capsule update.\r
+//\r
+typedef struct {\r
+  UINT64                Length;     // length of the data block\r
+  EFI_PHYSICAL_ADDRESS  Data;       // physical address of the data block\r
+  UINT32                Signature;  // CBDS\r
+  UINT32                CheckSum;   // to sum this structure to 0\r
+} EFI_CAPSULE_BLOCK_DESCRIPTOR;\r
+\r
+typedef struct {\r
+  EFI_GUID  OemGuid;\r
+  UINT32    HeaderSize;\r
+  //\r
+  // UINT8                       OemHdrData[];\r
+  //\r
+} EFI_CAPSULE_OEM_HEADER;\r
+\r
+typedef struct {\r
+  EFI_GUID  CapsuleGuid;\r
+  UINT32    HeaderSize;\r
+  UINT32    Flags;\r
+  UINT32    CapsuleImageSize;\r
+  UINT32    SequenceNumber;\r
+  EFI_GUID  InstanceId;\r
+  UINT32    OffsetToSplitInformation;\r
+  UINT32    OffsetToCapsuleBody;\r
+  UINT32    OffsetToOemDefinedHeader;\r
+  UINT32    OffsetToAuthorInformation;\r
+  UINT32    OffsetToRevisionInformation;\r
+  UINT32    OffsetToShortDescription;\r
+  UINT32    OffsetToLongDescription;\r
+  UINT32    OffsetToApplicableDevices;\r
+} EFI_CAPSULE_HEADER;\r
+\r
+#endif // #ifndef _EFI_CAPSULE_H_\r
diff --git a/Tools/Source/TianoTools/Include/Common/DataHubRecords.h b/Tools/Source/TianoTools/Include/Common/DataHubRecords.h
new file mode 100644 (file)
index 0000000..0bc8f23
--- /dev/null
@@ -0,0 +1,1847 @@
+/** @file\r
+  This file defines GUIDs and associated data structures for records \r
+  posted to the Data Hub. \r
+  The producers of these records use these definitions to construct \r
+  records.\r
+  The consumers of these records use these definitions to retrieve,\r
+  filter and parse records.\r
+\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. This program and the accompanying materials                          \r
+  are licensed and made available under the terms and conditions of the BSD License         \r
+  which accompanies this distribution.  The full text of the license may be found at        \r
+  http://opensource.org/licenses/bsd-license.php                                            \r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+  Module Name:  DataHubRecords.h\r
+\r
+  @par Revision Reference:\r
+  DataHubRecord.h include all data hub sub class defitions from Cache subclass \r
+  spec 0.9, DataHub SubClass spec 0.9, Memory SubClass Spec 0.9, Processor \r
+  Subclass spec 0.9,Misc SubClass spec 0.9.\r
+\r
+**/\r
+\r
+#ifndef _DATAHUB_RECORDS_H_\r
+#define _DATAHUB_RECORDS_H_\r
+\r
+#define EFI_PROCESSOR_SUBCLASS_VERSION    0x00010000\r
+\r
+\r
+#pragma pack(1)\r
+\r
+typedef struct _USB_PORT_DEVICE_PATH {\r
+  ACPI_HID_DEVICE_PATH      PciRootBridgeDevicePath;\r
+  PCI_DEVICE_PATH           PciBusDevicePath;\r
+  EFI_DEVICE_PATH_PROTOCOL  EndDevicePath;\r
+} USB_PORT_DEVICE_PATH;\r
+\r
+//\r
+// IDE\r
+//\r
+typedef struct _IDE_DEVICE_PATH {\r
+  ACPI_HID_DEVICE_PATH      PciRootBridgeDevicePath;\r
+  PCI_DEVICE_PATH           PciBusDevicePath;\r
+  EFI_DEVICE_PATH_PROTOCOL  EndDevicePath;\r
+} IDE_DEVICE_PATH;\r
+\r
+//\r
+// RMC Connector\r
+//\r
+typedef struct _RMC_CONN_DEVICE_PATH {\r
+  ACPI_HID_DEVICE_PATH      PciRootBridgeDevicePath;\r
+  PCI_DEVICE_PATH           PciBridgeDevicePath;\r
+  PCI_DEVICE_PATH           PciBusDevicePath;\r
+  EFI_DEVICE_PATH_PROTOCOL  EndDevicePath;\r
+} RMC_CONN_DEVICE_PATH;\r
+\r
+//\r
+// RIDE\r
+//\r
+typedef struct _RIDE_DEVICE_PATH {\r
+  ACPI_HID_DEVICE_PATH      PciRootBridgeDevicePath;\r
+  PCI_DEVICE_PATH           PciBridgeDevicePath;\r
+  PCI_DEVICE_PATH           PciBusDevicePath;\r
+  EFI_DEVICE_PATH_PROTOCOL  EndDevicePath;\r
+} RIDE_DEVICE_PATH;\r
+\r
+//\r
+// Gigabit NIC\r
+//\r
+typedef struct _GB_NIC_DEVICE_PATH {\r
+  ACPI_HID_DEVICE_PATH      PciRootBridgeDevicePath;\r
+  PCI_DEVICE_PATH           PciBridgeDevicePath;\r
+  PCI_DEVICE_PATH           PciXBridgeDevicePath;\r
+  PCI_DEVICE_PATH           PciXBusDevicePath;\r
+  EFI_DEVICE_PATH_PROTOCOL  EndDevicePath;\r
+} GB_NIC_DEVICE_PATH;\r
+\r
+//\r
+// P/S2 Connector\r
+//\r
+typedef struct _PS2_CONN_DEVICE_PATH {\r
+  ACPI_HID_DEVICE_PATH      PciRootBridgeDevicePath;\r
+  PCI_DEVICE_PATH           LpcBridgeDevicePath;\r
+  ACPI_HID_DEVICE_PATH      LpcBusDevicePath;\r
+  EFI_DEVICE_PATH_PROTOCOL  EndDevicePath;\r
+} PS2_CONN_DEVICE_PATH;\r
+\r
+//\r
+// Serial Port Connector\r
+//\r
+typedef struct _SERIAL_CONN_DEVICE_PATH {\r
+  ACPI_HID_DEVICE_PATH      PciRootBridgeDevicePath;\r
+  PCI_DEVICE_PATH           LpcBridgeDevicePath;\r
+  ACPI_HID_DEVICE_PATH      LpcBusDevicePath;\r
+  EFI_DEVICE_PATH_PROTOCOL  EndDevicePath;\r
+} SERIAL_CONN_DEVICE_PATH;\r
+\r
+//\r
+// Parallel Port Connector\r
+//\r
+typedef struct _PARALLEL_CONN_DEVICE_PATH {\r
+  ACPI_HID_DEVICE_PATH      PciRootBridgeDevicePath;\r
+  PCI_DEVICE_PATH           LpcBridgeDevicePath;\r
+  ACPI_HID_DEVICE_PATH      LpcBusDevicePath;\r
+  EFI_DEVICE_PATH_PROTOCOL  EndDevicePath;\r
+} PARALLEL_CONN_DEVICE_PATH;\r
+\r
+//\r
+// Floopy Connector\r
+//\r
+typedef struct _FLOOPY_CONN_DEVICE_PATH {\r
+  ACPI_HID_DEVICE_PATH      PciRootBridgeDevicePath;\r
+  PCI_DEVICE_PATH           LpcBridgeDevicePath;\r
+  ACPI_HID_DEVICE_PATH      LpcBusDevicePath;\r
+  EFI_DEVICE_PATH_PROTOCOL  EndDevicePath;\r
+} FLOOPY_CONN_DEVICE_PATH;\r
+\r
+typedef union _EFI_MISC_PORT_DEVICE_PATH {\r
+  USB_PORT_DEVICE_PATH      UsbDevicePath;\r
+  IDE_DEVICE_PATH           IdeDevicePath;\r
+  RMC_CONN_DEVICE_PATH      RmcConnDevicePath;\r
+  RIDE_DEVICE_PATH          RideDevicePath;\r
+  GB_NIC_DEVICE_PATH        GbNicDevicePath;\r
+  PS2_CONN_DEVICE_PATH      Ps2ConnDevicePath;\r
+  SERIAL_CONN_DEVICE_PATH   SerialConnDevicePath;\r
+  PARALLEL_CONN_DEVICE_PATH ParallelConnDevicePath;\r
+  FLOOPY_CONN_DEVICE_PATH   FloppyConnDevicePath;\r
+} EFI_MISC_PORT_DEVICE_PATH;\r
+\r
+#pragma pack()\r
+\r
+//\r
+// String Token Definition\r
+//\r
+#define EFI_STRING_TOKEN    UINT16\r
+\r
+typedef struct {\r
+  UINT32    Version;\r
+  UINT32    HeaderSize;\r
+  UINT16    Instance;\r
+  UINT16    SubInstance;\r
+  UINT32    RecordType;    \r
+} EFI_SUBCLASS_TYPE1_HEADER;\r
+\r
+typedef struct {\r
+  EFI_GUID    ProducerName;\r
+  UINT16      Instance;\r
+  UINT16      SubInstance;\r
+} EFI_INTER_LINK_DATA;\r
+\r
+\r
+//\r
+// EXP data\r
+//\r
+\r
+typedef struct {\r
+  UINT16    Value;\r
+  UINT16    Exponent;\r
+} EFI_EXP_BASE2_DATA;\r
+\r
+\r
+typedef EFI_EXP_BASE10_DATA   EFI_PROCESSOR_MAX_CORE_FREQUENCY_DATA;\r
+\r
+typedef EFI_EXP_BASE10_DATA   EFI_PROCESSOR_MAX_FSB_FREQUENCY_DATA;\r
+\r
+typedef EFI_EXP_BASE10_DATA   EFI_PROCESSOR_CORE_FREQUENCY_DATA;\r
+\r
+typedef EFI_EXP_BASE10_DATA  *EFI_PROCESSOR_CORE_FREQUENCY_LIST_DATA;\r
+\r
+typedef EFI_EXP_BASE10_DATA  *EFI_PROCESSOR_FSB_FREQUENCY_LIST_DATA;\r
+\r
+typedef EFI_EXP_BASE10_DATA   EFI_PROCESSOR_FSB_FREQUENCY_DATA;\r
+\r
+typedef STRING_REF            EFI_PROCESSOR_VERSION_DATA;\r
+\r
+typedef STRING_REF            EFI_PROCESSOR_MANUFACTURER_DATA;\r
+\r
+typedef STRING_REF            EFI_PROCESSOR_SERIAL_NUMBER_DATA;\r
+\r
+typedef STRING_REF            EFI_PROCESSOR_ASSET_TAG_DATA;\r
+\r
+typedef struct {\r
+  UINT32  ProcessorSteppingId:4;\r
+  UINT32  ProcessorModel:     4;\r
+  UINT32  ProcessorFamily:    4;\r
+  UINT32  ProcessorType:      2;\r
+  UINT32  ProcessorReserved1: 2;\r
+  UINT32  ProcessorXModel:    4;\r
+  UINT32  ProcessorXFamily:   8;\r
+  UINT32  ProcessorReserved2: 4;\r
+} EFI_PROCESSOR_SIGNATURE;\r
+\r
+typedef struct {\r
+  UINT32  ProcessorBrandIndex :8;\r
+  UINT32  ProcessorClflush    :8;\r
+  UINT32  ProcessorReserved   :8;\r
+  UINT32  ProcessorDfltApicId :8;\r
+} EFI_PROCESSOR_MISC_INFO;\r
+\r
+typedef struct {\r
+  UINT32  ProcessorFpu:       1;\r
+  UINT32  ProcessorVme:       1;\r
+  UINT32  ProcessorDe:        1;\r
+  UINT32  ProcessorPse:       1;\r
+  UINT32  ProcessorTsc:       1;\r
+  UINT32  ProcessorMsr:       1;\r
+  UINT32  ProcessorPae:       1;\r
+  UINT32  ProcessorMce:       1;\r
+  UINT32  ProcessorCx8:       1;\r
+  UINT32  ProcessorApic:      1;\r
+  UINT32  ProcessorReserved1: 1;\r
+  UINT32  ProcessorSep:       1;\r
+  UINT32  ProcessorMtrr:      1;\r
+  UINT32  ProcessorPge:       1;\r
+  UINT32  ProcessorMca:       1;\r
+  UINT32  ProcessorCmov:      1;\r
+  UINT32  ProcessorPat:       1;\r
+  UINT32  ProcessorPse36:     1;\r
+  UINT32  ProcessorPsn:       1;\r
+  UINT32  ProcessorClfsh:     1;\r
+  UINT32  ProcessorReserved2: 1;\r
+  UINT32  ProcessorDs:        1;\r
+  UINT32  ProcessorAcpi:      1;\r
+  UINT32  ProcessorMmx:       1;\r
+  UINT32  ProcessorFxsr:      1;\r
+  UINT32  ProcessorSse:       1;\r
+  UINT32  ProcessorSse2:      1;\r
+  UINT32  ProcessorSs:        1;\r
+  UINT32  ProcessorReserved3: 1;\r
+  UINT32  ProcessorTm:        1;\r
+  UINT32  ProcessorReserved4: 2;\r
+} EFI_PROCESSOR_FEATURE_FLAGS;\r
+\r
+typedef struct {\r
+  EFI_PROCESSOR_SIGNATURE     Signature;\r
+  EFI_PROCESSOR_MISC_INFO     MiscInfo;\r
+  UINT32                      Reserved;\r
+  EFI_PROCESSOR_FEATURE_FLAGS FeatureFlags;\r
+} EFI_PROCESSOR_ID_DATA;\r
+\r
+typedef enum {\r
+  EfiProcessorOther    = 1,\r
+  EfiProcessorUnknown  = 2,\r
+  EfiCentralProcessor  = 3,\r
+  EfiMathProcessor     = 4,\r
+  EfiDspProcessor      = 5,\r
+  EfiVideoProcessor    = 6\r
+} EFI_PROCESSOR_TYPE_DATA;\r
+\r
+typedef enum {\r
+  EfiProcessorFamilyOther               = 1,\r
+  EfiProcessorFamilyUnknown             = 2,\r
+  EfiProcessorFamily8086                = 3,\r
+  EfiProcessorFamily80286               = 4,\r
+  EfiProcessorFamilyIntel386            = 5,\r
+  EfiProcessorFamilyIntel486            = 6,\r
+  EfiProcessorFamily8087                = 7,\r
+  EfiProcessorFamily80287               = 8,\r
+  EfiProcessorFamily80387               = 9,\r
+  EfiProcessorFamily80487               = 0x0A,\r
+  EfiProcessorFamilyPentium             = 0x0B,\r
+  EfiProcessorFamilyPentiumPro          = 0x0C,\r
+  EfiProcessorFamilyPentiumII           = 0x0D,\r
+  EfiProcessorFamilyPentiumMMX          = 0x0E,\r
+  EfiProcessorFamilyCeleron             = 0x0F,\r
+  EfiProcessorFamilyPentiumIIXeon       = 0x10,\r
+  EfiProcessorFamilyPentiumIII          = 0x11,\r
+  EfiProcessorFamilyM1                  = 0x12,\r
+  EfiProcessorFamilyM1Reserved1         = 0x13,\r
+  EfiProcessorFamilyM1Reserved2         = 0x14,\r
+  EfiProcessorFamilyM1Reserved3         = 0x15,\r
+  EfiProcessorFamilyM1Reserved4         = 0x16,\r
+  EfiProcessorFamilyM1Reserved5         = 0x17,\r
+  EfiProcessorFamilyM1Reserved6         = 0x18,\r
+  EfiProcessorFamilyK5                  = 0x19,\r
+  EfiProcessorFamilyK5Reserved1         = 0x1A,\r
+  EfiProcessorFamilyK5Reserved2         = 0x1B,\r
+  EfiProcessorFamilyK5Reserved3         = 0x1C,\r
+  EfiProcessorFamilyK5Reserved4         = 0x1D,\r
+  EfiProcessorFamilyK5Reserved5         = 0x1E,\r
+  EfiProcessorFamilyK5Reserved6         = 0x1F,\r
+  EfiProcessorFamilyPowerPC             = 0x20,\r
+  EfiProcessorFamilyPowerPC601          = 0x21,\r
+  EfiProcessorFamilyPowerPC603          = 0x22,\r
+  EfiProcessorFamilyPowerPC603Plus      = 0x23,\r
+  EfiProcessorFamilyPowerPC604          = 0x24,\r
+  EfiProcessorFamilyAlpha2              = 0x30,\r
+  EfiProcessorFamilyMips                = 0x40,\r
+  EfiProcessorFamilySparc               = 0x50,\r
+  EfiProcessorFamily68040               = 0x60,\r
+  EfiProcessorFamily68xxx               = 0x61,\r
+  EfiProcessorFamily68000               = 0x62,\r
+  EfiProcessorFamily68010               = 0x63,\r
+  EfiProcessorFamily68020               = 0x64,\r
+  EfiProcessorFamily68030               = 0x65,\r
+  EfiProcessorFamilyHobbit              = 0x70,\r
+  EfiProcessorFamilyWeitek              = 0x80,\r
+  EfiProcessorFamilyPARISC              = 0x90,\r
+  EfiProcessorFamilyV30                 = 0xA0,\r
+  EfiProcessorFamilyPentiumIIIXeon      = 0xB0,\r
+  EfiProcessorFamilyPentiumIIISpeedStep = 0xB1,\r
+  EfiProcessorFamilyPentium4            = 0xB2,\r
+  EfiProcessorFamilyIntelXeon           = 0xB3,\r
+  EfiProcessorFamilyAS400               = 0xB4,\r
+  EfiProcessorFamilyIntelXeonMP         = 0xB5,\r
+  EfiProcessorFamilyAMDAthlonXP         = 0xB6,\r
+  EfiProcessorFamilyAMDAthlonMP         = 0xB7,\r
+  EfiProcessorFamilyIBM390              = 0xC8,\r
+  EfiProcessorFamilyG4                  = 0xC9,\r
+  EfiProcessorFamilyG5                  = 0xCA,\r
+  EfiProcessorFamilyi860                = 0xFA,\r
+  EfiProcessorFamilyi960                = 0xFB\r
+} EFI_PROCESSOR_FAMILY_DATA;\r
+\r
+typedef EFI_EXP_BASE10_DATA EFI_PROCESSOR_VOLTAGE_DATA;\r
+\r
+typedef EFI_PHYSICAL_ADDRESS EFI_PROCESSOR_APIC_BASE_ADDRESS_DATA;\r
+\r
+typedef UINT32 EFI_PROCESSOR_APIC_ID_DATA;\r
+\r
+typedef UINT32 EFI_PROCESSOR_APIC_VERSION_NUMBER_DATA;\r
+\r
+typedef enum {\r
+  EfiProcessorIa32Microcode    = 1,\r
+  EfiProcessorIpfPalAMicrocode = 2,\r
+  EfiProcessorIpfPalBMicrocode = 3\r
+} EFI_PROCESSOR_MICROCODE_TYPE;\r
+\r
+typedef struct {\r
+  EFI_PROCESSOR_MICROCODE_TYPE  ProcessorMicrocodeType;\r
+  UINT32                        ProcessorMicrocodeRevisionNumber;\r
+} EFI_PROCESSOR_MICROCODE_REVISION_DATA;\r
+\r
+typedef struct {\r
+  UINT32      CpuStatus                 :3;\r
+  UINT32      Reserved1                 :3;\r
+  UINT32      SocketPopulated           :1;\r
+  UINT32      Reserved2                 :1;\r
+  UINT32      ApicEnable                :1;\r
+  UINT32      BootApplicationProcessor  :1;\r
+  UINT32      Reserved3                 :22;\r
+} EFI_PROCESSOR_STATUS_DATA;\r
+\r
+typedef enum {\r
+  EfiCpuStatusUnknown        = 0,\r
+  EfiCpuStatusEnabled        = 1,\r
+  EfiCpuStatusDisabledByUser = 2,\r
+  EfiCpuStatusDisabledbyBios = 3,\r
+  EfiCpuStatusIdle           = 4,\r
+  EfiCpuStatusOther          = 7\r
+} EFI_CPU_STATUS;\r
+\r
+typedef enum {\r
+  EfiProcessorSocketOther            = 1,\r
+  EfiProcessorSocketUnknown          = 2,\r
+  EfiProcessorSocketDaughterBoard    = 3,\r
+  EfiProcessorSocketZIF              = 4,\r
+  EfiProcessorSocketReplacePiggyBack = 5,\r
+  EfiProcessorSocketNone             = 6,\r
+  EfiProcessorSocketLIF              = 7,\r
+  EfiProcessorSocketSlot1            = 8,\r
+  EfiProcessorSocketSlot2            = 9,\r
+  EfiProcessorSocket370Pin           = 0xA,\r
+  EfiProcessorSocketSlotA            = 0xB,\r
+  EfiProcessorSocketSlotM            = 0xC,\r
+  EfiProcessorSocket423              = 0xD,\r
+  EfiProcessorSocketA462             = 0xE,\r
+  EfiProcessorSocket478              = 0xF,\r
+  EfiProcessorSocket754              = 0x10,\r
+  EfiProcessorSocket940              = 0x11,\r
+  EfiProcessorSocketLG775            = 0x12\r
+\r
+} EFI_PROCESSOR_SOCKET_TYPE_DATA;\r
+\r
+typedef STRING_REF EFI_PROCESSOR_SOCKET_NAME_DATA;\r
+\r
+typedef EFI_INTER_LINK_DATA EFI_CACHE_ASSOCIATION_DATA;\r
+\r
+typedef enum {\r
+  EfiProcessorHealthy        = 1,\r
+  EfiProcessorPerfRestricted = 2,\r
+  EfiProcessorFuncRestricted = 3\r
+} EFI_PROCESSOR_HEALTH_STATUS;  \r
+\r
+typedef UINTN   EFI_PROCESSOR_PACKAGE_NUMBER_DATA;\r
+\r
+\r
+typedef enum {\r
+  ProcessorCoreFrequencyRecordType     = 1,\r
+  ProcessorFsbFrequencyRecordType      = 2,\r
+  ProcessorVersionRecordType           = 3,\r
+  ProcessorManufacturerRecordType      = 4,\r
+  ProcessorSerialNumberRecordType      = 5,\r
+  ProcessorIdRecordType                = 6,\r
+  ProcessorTypeRecordType              = 7,\r
+  ProcessorFamilyRecordType            = 8,\r
+  ProcessorVoltageRecordType           = 9,\r
+  ProcessorApicBaseAddressRecordType   = 10,\r
+  ProcessorApicIdRecordType            = 11,\r
+  ProcessorApicVersionNumberRecordType = 12,\r
+  CpuUcodeRevisionDataRecordType       = 13,\r
+  ProcessorStatusRecordType            = 14,\r
+  ProcessorSocketTypeRecordType        = 15,\r
+  ProcessorSocketNameRecordType        = 16,\r
+  CacheAssociationRecordType           = 17,\r
+  ProcessorMaxCoreFrequencyRecordType  = 18,\r
+  ProcessorAssetTagRecordType          = 19,\r
+  ProcessorMaxFsbFrequencyRecordType   = 20,\r
+  ProcessorPackageNumberRecordType     = 21,\r
+  ProcessorCoreFrequencyListRecordType = 22,\r
+  ProcessorFsbFrequencyListRecordType  = 23,\r
+  ProcessorHealthStatusRecordType      = 24\r
+} EFI_CPU_VARIABLE_RECORD_TYPE;\r
+\r
+typedef union {\r
+  EFI_PROCESSOR_CORE_FREQUENCY_LIST_DATA  ProcessorCoreFrequencyList;\r
+  EFI_PROCESSOR_FSB_FREQUENCY_LIST_DATA   ProcessorFsbFrequencyList;\r
+  EFI_PROCESSOR_SERIAL_NUMBER_DATA        ProcessorSerialNumber;\r
+  EFI_PROCESSOR_CORE_FREQUENCY_DATA       ProcessorCoreFrequency;\r
+  EFI_PROCESSOR_FSB_FREQUENCY_DATA        ProcessorFsbFrequency;\r
+  EFI_PROCESSOR_MAX_CORE_FREQUENCY_DATA   ProcessorMaxCoreFrequency;\r
+  EFI_PROCESSOR_MAX_FSB_FREQUENCY_DATA    ProcessorMaxFsbFrequency;\r
+  EFI_PROCESSOR_VERSION_DATA              ProcessorVersion;\r
+  EFI_PROCESSOR_MANUFACTURER_DATA         ProcessorManufacturer;\r
+  EFI_PROCESSOR_ID_DATA                   ProcessorId;\r
+  EFI_PROCESSOR_TYPE_DATA                 ProcessorType;\r
+  EFI_PROCESSOR_FAMILY_DATA               ProcessorFamily;\r
+  EFI_PROCESSOR_VOLTAGE_DATA              ProcessorVoltage;\r
+  EFI_PROCESSOR_APIC_BASE_ADDRESS_DATA    ProcessorApicBase;\r
+  EFI_PROCESSOR_APIC_ID_DATA              ProcessorApicId;\r
+  EFI_PROCESSOR_APIC_VERSION_NUMBER_DATA  ProcessorApicVersionNumber;\r
+  EFI_PROCESSOR_MICROCODE_REVISION_DATA   CpuUcodeRevisionData;\r
+  EFI_PROCESSOR_STATUS_DATA               ProcessorStatus;\r
+  EFI_PROCESSOR_SOCKET_TYPE_DATA          ProcessorSocketType;\r
+  EFI_PROCESSOR_SOCKET_NAME_DATA          ProcessorSocketName;\r
+  EFI_PROCESSOR_ASSET_TAG_DATA            ProcessorAssetTag;\r
+  EFI_PROCESSOR_HEALTH_STATUS             ProcessorHealthStatus;\r
+  EFI_PROCESSOR_PACKAGE_NUMBER_DATA       ProcessorPackageNumber;\r
+} EFI_CPU_VARIABLE_RECORD;\r
+\r
+typedef struct {\r
+  EFI_SUBCLASS_TYPE1_HEADER      DataRecordHeader;\r
+  EFI_CPU_VARIABLE_RECORD        VariableRecord;\r
+} EFI_CPU_DATA_RECORD;\r
+\r
+#define EFI_CACHE_SUBCLASS_VERSION    0x00010000\r
+\r
+\r
+typedef EFI_EXP_BASE2_DATA  EFI_CACHE_SIZE_DATA;\r
+\r
+typedef EFI_EXP_BASE2_DATA  EFI_MAXIMUM_CACHE_SIZE_DATA;\r
+\r
+typedef EFI_EXP_BASE10_DATA EFI_CACHE_SPEED_DATA;\r
+\r
+typedef STRING_REF          EFI_CACHE_SOCKET_DATA;\r
+\r
+typedef struct {\r
+  UINT32  Other         :1;\r
+  UINT32  Unknown       :1;\r
+  UINT32  NonBurst      :1;\r
+  UINT32  Burst         :1;\r
+  UINT32  PipelineBurst :1;\r
+  UINT32  Asynchronous  :1;\r
+  UINT32  Synchronous   :1;\r
+  UINT32  Reserved      :25;\r
+} EFI_CACHE_SRAM_TYPE_DATA;\r
+\r
+typedef enum {  \r
+  EfiCacheErrorOther     = 1,\r
+  EfiCacheErrorUnknown   = 2,\r
+  EfiCacheErrorNone      = 3,\r
+  EfiCacheErrorParity    = 4,\r
+  EfiCacheErrorSingleBit = 5,\r
+  EfiCacheErrorMultiBit  = 6\r
+} EFI_CACHE_ERROR_TYPE_DATA;\r
+\r
+typedef enum {  \r
+  EfiCacheTypeOther       = 1,\r
+  EfiCacheTypeUnknown     = 2,\r
+  EfiCacheTypeInstruction = 3,\r
+  EfiCacheTypeData        = 4,\r
+  EfiCacheTypeUnified     = 5\r
+} EFI_CACHE_TYPE_DATA;\r
+\r
+typedef enum {  \r
+  EfiCacheAssociativityOther        = 1,\r
+  EfiCacheAssociativityUnknown      = 2,\r
+  EfiCacheAssociativityDirectMapped = 3,\r
+  EfiCacheAssociativity2Way         = 4,\r
+  EfiCacheAssociativity4Way         = 5,\r
+  EfiCacheAssociativityFully        = 6,\r
+  EfiCacheAssociativity8Way         = 7,\r
+  EfiCacheAssociativity16Way        = 8\r
+} EFI_CACHE_ASSOCIATIVITY_DATA;\r
+\r
+typedef struct {  \r
+  UINT32    Level           :3;\r
+  UINT32    Socketed        :1;\r
+  UINT32    Reserved2       :1;\r
+  UINT32    Location        :2;\r
+  UINT32    Enable          :1;\r
+  UINT32    OperationalMode :2;\r
+  UINT32    Reserved1       :22;\r
+} EFI_CACHE_CONFIGURATION_DATA;\r
+\r
+#define EFI_CACHE_L1      1\r
+#define EFI_CACHE_L2      2\r
+#define EFI_CACHE_L3      3\r
+#define EFI_CACHE_L4      4\r
+#define EFI_CACHE_LMAX    EFI_CACHE_L4\r
+\r
+#define EFI_CACHE_SOCKETED      1\r
+#define EFI_CACHE_NOT_SOCKETED  0\r
+\r
+typedef enum {\r
+  EfiCacheInternal = 0,\r
+  EfiCacheExternal = 1,\r
+  EfiCacheReserved = 2,\r
+  EfiCacheUnknown  = 3\r
+} EFI_CACHE_LOCATION;\r
+  \r
+#define EFI_CACHE_ENABLED    1\r
+#define EFI_CACHE_DISABLED   0\r
+\r
+typedef enum {\r
+  EfiCacheWriteThrough = 0,\r
+  EfiCacheWriteBack    = 1,\r
+  EfiCacheDynamicMode  = 2,\r
+  EfiCacheUnknownMode  = 3\r
+} EFI_CACHE_OPERATIONAL_MODE;\r
+\r
+\r
+\r
+typedef enum {\r
+  CacheSizeRecordType              = 1,\r
+  MaximumSizeCacheRecordType       = 2,\r
+  CacheSpeedRecordType             = 3,\r
+  CacheSocketRecordType            = 4,\r
+  CacheSramTypeRecordType          = 5,\r
+  CacheInstalledSramTypeRecordType = 6,\r
+  CacheErrorTypeRecordType         = 7,\r
+  CacheTypeRecordType              = 8,\r
+  CacheAssociativityRecordType     = 9,\r
+  CacheConfigRecordType            = 10\r
+} EFI_CACHE_VARIABLE_RECORD_TYPE;\r
+\r
+\r
+typedef union {\r
+  EFI_CACHE_SIZE_DATA             CacheSize;\r
+  EFI_MAXIMUM_CACHE_SIZE_DATA     MaximumCacheSize;\r
+  EFI_CACHE_SPEED_DATA            CacheSpeed;\r
+  EFI_CACHE_SOCKET_DATA           CacheSocket;\r
+  EFI_CACHE_SRAM_TYPE_DATA        CacheSramType;\r
+  EFI_CACHE_SRAM_TYPE_DATA        CacheInstalledSramType;\r
+  EFI_CACHE_ERROR_TYPE_DATA       CacheErrorType;\r
+  EFI_CACHE_TYPE_DATA             CacheType;\r
+  EFI_CACHE_ASSOCIATIVITY_DATA    CacheAssociativity;\r
+  EFI_CACHE_CONFIGURATION_DATA    CacheConfig;\r
+  EFI_CACHE_ASSOCIATION_DATA      CacheAssociation;\r
+} EFI_CACHE_VARIABLE_RECORD;\r
+\r
+typedef struct {\r
+   EFI_SUBCLASS_TYPE1_HEADER      DataRecordHeader;\r
+   EFI_CACHE_VARIABLE_RECORD      VariableRecord;  \r
+} EFI_CACHE_DATA_RECORD;\r
+  \r
+#define EFI_MEMORY_SUBCLASS_VERSION     0x0100\r
+\r
+\r
+#define EFI_MEMORY_SIZE_RECORD_NUMBER                 0x00000001\r
+\r
+typedef enum _EFI_MEMORY_REGION_TYPE {\r
+  EfiMemoryRegionMemory                       = 0x01,\r
+  EfiMemoryRegionReserved                     = 0x02,\r
+  EfiMemoryRegionAcpi                         = 0x03,\r
+  EfiMemoryRegionNvs                          = 0x04\r
+} EFI_MEMORY_REGION_TYPE;\r
+\r
+typedef struct {\r
+  UINT32                      ProcessorNumber;\r
+  UINT16                      StartBusNumber;\r
+  UINT16                      EndBusNumber;\r
+  EFI_MEMORY_REGION_TYPE      MemoryRegionType;\r
+  EFI_EXP_BASE2_DATA          MemorySize;\r
+  EFI_PHYSICAL_ADDRESS        MemoryStartAddress;\r
+} EFI_MEMORY_SIZE_DATA;\r
+\r
+\r
+#define EFI_MEMORY_ARRAY_LOCATION_RECORD_NUMBER       0x00000002\r
+\r
+typedef enum _EFI_MEMORY_ARRAY_LOCATION {\r
+  EfiMemoryArrayLocationOther                 = 0x01,\r
+  EfiMemoryArrayLocationUnknown               = 0x02,\r
+  EfiMemoryArrayLocationSystemBoard           = 0x03,\r
+  EfiMemoryArrayLocationIsaAddonCard          = 0x04,\r
+  EfiMemoryArrayLocationEisaAddonCard         = 0x05,\r
+  EfiMemoryArrayLocationPciAddonCard          = 0x06,\r
+  EfiMemoryArrayLocationMcaAddonCard          = 0x07,\r
+  EfiMemoryArrayLocationPcmciaAddonCard       = 0x08,\r
+  EfiMemoryArrayLocationProprietaryAddonCard  = 0x09,\r
+  EfiMemoryArrayLocationNuBus                 = 0x0A,\r
+  EfiMemoryArrayLocationPc98C20AddonCard      = 0xA0,\r
+  EfiMemoryArrayLocationPc98C24AddonCard      = 0xA1,\r
+  EfiMemoryArrayLocationPc98EAddonCard        = 0xA2,\r
+  EfiMemoryArrayLocationPc98LocalBusAddonCard = 0xA3\r
+} EFI_MEMORY_ARRAY_LOCATION;\r
+\r
+typedef enum _EFI_MEMORY_ARRAY_USE {\r
+  EfiMemoryArrayUseOther                      = 0x01,\r
+  EfiMemoryArrayUseUnknown                    = 0x02,\r
+  EfiMemoryArrayUseSystemMemory               = 0x03,\r
+  EfiMemoryArrayUseVideoMemory                = 0x04,\r
+  EfiMemoryArrayUseFlashMemory                = 0x05,\r
+  EfiMemoryArrayUseNonVolatileRam             = 0x06,\r
+  EfiMemoryArrayUseCacheMemory                = 0x07,\r
+} EFI_MEMORY_ARRAY_USE;\r
+\r
+typedef enum _EFI_MEMORY_ERROR_CORRECTION {\r
+  EfiMemoryErrorCorrectionOther               = 0x01,\r
+  EfiMemoryErrorCorrectionUnknown             = 0x02,\r
+  EfiMemoryErrorCorrectionNone                = 0x03,\r
+  EfiMemoryErrorCorrectionParity              = 0x04,\r
+  EfiMemoryErrorCorrectionSingleBitEcc        = 0x05,\r
+  EfiMemoryErrorCorrectionMultiBitEcc         = 0x06,\r
+  EfiMemoryErrorCorrectionCrc                 = 0x07,\r
+} EFI_MEMORY_ERROR_CORRECTION;\r
+\r
+typedef struct {\r
+  EFI_MEMORY_ARRAY_LOCATION   MemoryArrayLocation;\r
+  EFI_MEMORY_ARRAY_USE        MemoryArrayUse;\r
+  EFI_MEMORY_ERROR_CORRECTION MemoryErrorCorrection;\r
+  EFI_EXP_BASE2_DATA          MaximumMemoryCapacity;\r
+  UINT16                      NumberMemoryDevices;\r
+} EFI_MEMORY_ARRAY_LOCATION_DATA;\r
+\r
+\r
+#define EFI_MEMORY_ARRAY_LINK_RECORD_NUMBER           0x00000003\r
+\r
+typedef enum _EFI_MEMORY_FORM_FACTOR {\r
+  EfiMemoryFormFactorOther                    = 0x01,\r
+  EfiMemoryFormFactorUnknown                  = 0x02,\r
+  EfiMemoryFormFactorSimm                     = 0x03,\r
+  EfiMemoryFormFactorSip                      = 0x04,\r
+  EfiMemoryFormFactorChip                     = 0x05,\r
+  EfiMemoryFormFactorDip                      = 0x06,\r
+  EfiMemoryFormFactorZip                      = 0x07,\r
+  EfiMemoryFormFactorProprietaryCard          = 0x08,\r
+  EfiMemoryFormFactorDimm                     = 0x09,\r
+  EfiMemoryFormFactorTsop                     = 0x0A,\r
+  EfiMemoryFormFactorRowOfChips               = 0x0B,\r
+  EfiMemoryFormFactorRimm                     = 0x0C,\r
+  EfiMemoryFormFactorSodimm                   = 0x0D,\r
+  EfiMemoryFormFactorSrimm                    = 0x0E\r
+} EFI_MEMORY_FORM_FACTOR;\r
+\r
+typedef enum _EFI_MEMORY_ARRAY_TYPE {\r
+  EfiMemoryTypeOther                          = 0x01,\r
+  EfiMemoryTypeUnknown                        = 0x02,\r
+  EfiMemoryTypeDram                           = 0x03,\r
+  EfiMemoryTypeEdram                          = 0x04,\r
+  EfiMemoryTypeVram                           = 0x05,\r
+  EfiMemoryTypeSram                           = 0x06,\r
+  EfiMemoryTypeRam                            = 0x07,\r
+  EfiMemoryTypeRom                            = 0x08,\r
+  EfiMemoryTypeFlash                          = 0x09,\r
+  EfiMemoryTypeEeprom                         = 0x0A,\r
+  EfiMemoryTypeFeprom                         = 0x0B,\r
+  EfiMemoryTypeEprom                          = 0x0C,\r
+  EfiMemoryTypeCdram                          = 0x0D,\r
+  EfiMemoryType3Dram                          = 0x0E,\r
+  EfiMemoryTypeSdram                          = 0x0F,\r
+  EfiMemoryTypeSgram                          = 0x10,\r
+  EfiMemoryTypeRdram                          = 0x11,\r
+  EfiMemoryTypeDdr                            = 0x12\r
+} EFI_MEMORY_ARRAY_TYPE;\r
+\r
+typedef struct {\r
+  UINT32                      Reserved        :1;\r
+  UINT32                      Other           :1;\r
+  UINT32                      Unknown         :1;\r
+  UINT32                      FastPaged       :1;\r
+  UINT32                      StaticColumn    :1;\r
+  UINT32                      PseudoStatic    :1;\r
+  UINT32                      Rambus          :1;\r
+  UINT32                      Synchronous     :1;\r
+  UINT32                      Cmos            :1;\r
+  UINT32                      Edo             :1;\r
+  UINT32                      WindowDram      :1;\r
+  UINT32                      CacheDram       :1;\r
+  UINT32                      Nonvolatile     :1;\r
+  UINT32                      Reserved1       :19;\r
+} EFI_MEMORY_TYPE_DETAIL;\r
+\r
+typedef enum {\r
+  EfiMemoryStateEnabled      = 0,\r
+  EfiMemoryStateUnknown      = 1,\r
+  EfiMemoryStateUnsupported  = 2,\r
+  EfiMemoryStateError        = 3,\r
+  EfiMemoryStateAbsent       = 4,\r
+  EfiMemoryStateDisabled     = 5,\r
+  EfiMemoryStatePartial      = 6\r
+} EFI_MEMORY_STATE;\r
+\r
+typedef struct {\r
+  STRING_REF                  MemoryDeviceLocator;\r
+  STRING_REF                  MemoryBankLocator;\r
+  STRING_REF                  MemoryManufacturer;\r
+  STRING_REF                  MemorySerialNumber;\r
+  STRING_REF                  MemoryAssetTag;\r
+  STRING_REF                  MemoryPartNumber;\r
+  EFI_INTER_LINK_DATA         MemoryArrayLink;\r
+  EFI_INTER_LINK_DATA         MemorySubArrayLink;\r
+  UINT16                      MemoryTotalWidth;\r
+  UINT16                      MemoryDataWidth;\r
+  EFI_EXP_BASE2_DATA          MemoryDeviceSize;\r
+  EFI_MEMORY_FORM_FACTOR      MemoryFormFactor;\r
+  UINT8                       MemoryDeviceSet;\r
+  EFI_MEMORY_ARRAY_TYPE       MemoryType;\r
+  EFI_MEMORY_TYPE_DETAIL      MemoryTypeDetail;\r
+  EFI_EXP_BASE10_DATA         MemorySpeed;\r
+  EFI_MEMORY_STATE            MemoryState;\r
+} EFI_MEMORY_ARRAY_LINK_DATA;\r
+\r
+\r
+#define EFI_MEMORY_ARRAY_START_ADDRESS_RECORD_NUMBER  0x00000004\r
+\r
+typedef struct {\r
+  EFI_PHYSICAL_ADDRESS        MemoryArrayStartAddress;\r
+  EFI_PHYSICAL_ADDRESS        MemoryArrayEndAddress;\r
+  EFI_INTER_LINK_DATA         PhysicalMemoryArrayLink;\r
+  UINT16                      MemoryArrayPartitionWidth;\r
+} EFI_MEMORY_ARRAY_START_ADDRESS_DATA;\r
+\r
+\r
+#define EFI_MEMORY_DEVICE_START_ADDRESS_RECORD_NUMBER 0x00000005\r
+\r
+typedef struct {\r
+  EFI_PHYSICAL_ADDRESS        MemoryDeviceStartAddress;\r
+  EFI_PHYSICAL_ADDRESS        MemoryDeviceEndAddress;\r
+  EFI_INTER_LINK_DATA         PhysicalMemoryDeviceLink;\r
+  EFI_INTER_LINK_DATA         PhysicalMemoryArrayLink;\r
+  UINT8                       MemoryDevicePartitionRowPosition;\r
+  UINT8                       MemoryDeviceInterleavePosition;\r
+  UINT8                       MemoryDeviceInterleaveDataDepth;\r
+} EFI_MEMORY_DEVICE_START_ADDRESS_DATA;\r
+\r
+\r
+//\r
+//  Memory. Channel Device Type -  SMBIOS Type 37\r
+//\r
+\r
+#define EFI_MEMORY_CHANNEL_TYPE_RECORD_NUMBER         0x00000006\r
+\r
+typedef enum _EFI_MEMORY_CHANNEL_TYPE {\r
+  EfiMemoryChannelTypeOther                   = 1,\r
+  EfiMemoryChannelTypeUnknown                 = 2,\r
+  EfiMemoryChannelTypeRambus                  = 3,\r
+  EfiMemoryChannelTypeSyncLink                = 4\r
+} EFI_MEMORY_CHANNEL_TYPE;\r
+\r
+typedef struct {\r
+  EFI_MEMORY_CHANNEL_TYPE     MemoryChannelType;\r
+  UINT8                       MemoryChannelMaximumLoad;\r
+  UINT8                       MemoryChannelDeviceCount;\r
+} EFI_MEMORY_CHANNEL_TYPE_DATA;\r
+\r
+#define EFI_MEMORY_CHANNEL_DEVICE_RECORD_NUMBER       0x00000007\r
+\r
+typedef struct {\r
+  UINT8                       DeviceId;\r
+  EFI_INTER_LINK_DATA         DeviceLink;\r
+  UINT8                       MemoryChannelDeviceLoad;\r
+} EFI_MEMORY_CHANNEL_DEVICE_DATA;\r
+\r
+\r
+\r
+typedef union _EFI_MEMORY_SUBCLASS_RECORDS {\r
+  EFI_MEMORY_SIZE_DATA                  SizeData;\r
+  EFI_MEMORY_ARRAY_LOCATION_DATA        ArrayLocationData;\r
+  EFI_MEMORY_ARRAY_LINK_DATA            ArrayLink;\r
+  EFI_MEMORY_ARRAY_START_ADDRESS_DATA   ArrayStartAddress;\r
+  EFI_MEMORY_DEVICE_START_ADDRESS_DATA  DeviceStartAddress;\r
+  EFI_MEMORY_CHANNEL_TYPE_DATA          ChannelTypeData;\r
+  EFI_MEMORY_CHANNEL_DEVICE_DATA        ChannelDeviceData;\r
+} EFI_MEMORY_SUBCLASS_RECORDS;\r
+\r
+typedef struct {\r
+  EFI_SUBCLASS_TYPE1_HEADER             Header;\r
+  EFI_MEMORY_SUBCLASS_RECORDS           Record;\r
+} EFI_MEMORY_SUBCLASS_DRIVER_DATA;\r
+\r
+#define EFI_MISC_SUBCLASS_VERSION     0x0100\r
+\r
+#pragma pack(1)\r
+//\r
+//////////////////////////////////////////////////////////////////////////////\r
+//\r
+// Last PCI Bus Number\r
+//\r
+#define EFI_MISC_LAST_PCI_BUS_RECORD_NUMBER  0x00000001\r
+\r
+typedef struct {\r
+  UINT8   LastPciBus;\r
+} EFI_MISC_LAST_PCI_BUS_DATA;\r
+\r
+//\r
+//////////////////////////////////////////////////////////////////////////////\r
+//\r
+// Misc. BIOS Vendor - SMBIOS Type 0\r
+//\r
+#define EFI_MISC_BIOS_VENDOR_RECORD_NUMBER  0x00000002\r
+\r
+typedef struct {\r
+  UINT32  Reserved1                         :2;\r
+  UINT32  Unknown                           :1;\r
+  UINT32  BiosCharacteristicsNotSupported   :1;\r
+  UINT32  IsaIsSupported                    :1;\r
+  UINT32  McaIsSupported                    :1;\r
+  UINT32  EisaIsSupported                   :1;\r
+  UINT32  PciIsSupported                    :1;\r
+  UINT32  PcmciaIsSupported                 :1;\r
+  UINT32  PlugAndPlayIsSupported            :1;\r
+  UINT32  ApmIsSupported                    :1;\r
+  UINT32  BiosIsUpgradable                  :1;\r
+  UINT32  BiosShadowingAllowed              :1;\r
+  UINT32  VlVesaIsSupported                 :1;\r
+  UINT32  EscdSupportIsAvailable            :1;\r
+  UINT32  BootFromCdIsSupported             :1;\r
+  UINT32  SelectableBootIsSupported         :1;\r
+  UINT32  RomBiosIsSocketed                 :1;\r
+  UINT32  BootFromPcmciaIsSupported         :1;\r
+  UINT32  EDDSpecificationIsSupported       :1;\r
+  UINT32  JapaneseNecFloppyIsSupported      :1;\r
+  UINT32  JapaneseToshibaFloppyIsSupported  :1;\r
+  UINT32  Floppy525_360IsSupported          :1;\r
+  UINT32  Floppy525_12IsSupported           :1;\r
+  UINT32  Floppy35_720IsSupported           :1;\r
+  UINT32  Floppy35_288IsSupported           :1;\r
+  UINT32  PrintScreenIsSupported            :1;\r
+  UINT32  Keyboard8042IsSupported           :1;\r
+  UINT32  SerialIsSupported                 :1;\r
+  UINT32  PrinterIsSupported                :1;\r
+  UINT32  CgaMonoIsSupported                :1;\r
+  UINT32  NecPc98                           :1;\r
+  UINT32  AcpiIsSupported                   :1;\r
+  UINT32  UsbLegacyIsSupported              :1;\r
+  UINT32  AgpIsSupported                    :1;\r
+  UINT32  I20BootIsSupported                :1;\r
+  UINT32  Ls120BootIsSupported              :1;\r
+  UINT32  AtapiZipDriveBootIsSupported      :1;\r
+  UINT32  Boot1394IsSupported               :1;\r
+  UINT32  SmartBatteryIsSupported           :1;\r
+  UINT32  BiosBootSpecIsSupported           :1;\r
+  UINT32  FunctionKeyNetworkBootIsSupported :1;\r
+  UINT32  Reserved                          :22;\r
+} EFI_MISC_BIOS_CHARACTERISTICS;\r
+\r
+typedef struct {\r
+  UINT32  BiosReserved                      :16;\r
+  UINT32  SystemReserved                    :16;\r
+  UINT32  Reserved                          :32;\r
+} EFI_MISC_BIOS_CHARACTERISTICS_EXTENSION;\r
+\r
+typedef struct {\r
+  STRING_REF                      BiosVendor;\r
+  STRING_REF                      BiosVersion;\r
+  STRING_REF                      BiosReleaseDate;\r
+  EFI_PHYSICAL_ADDRESS            BiosStartingAddress;\r
+  EFI_EXP_BASE2_DATA              BiosPhysicalDeviceSize;\r
+  EFI_MISC_BIOS_CHARACTERISTICS   BiosCharacteristics1;\r
+  EFI_MISC_BIOS_CHARACTERISTICS_EXTENSION  BiosCharacteristics2;\r
+} EFI_MISC_BIOS_VENDOR_DATA;       \r
+\r
+//\r
+//////////////////////////////////////////////////////////////////////////////\r
+//\r
+// Misc. System Manufacturer - SMBIOS Type 1\r
+//\r
+#define EFI_MISC_SYSTEM_MANUFACTURER_RECORD_NUMBER 0x00000003\r
+\r
+typedef enum {  \r
+  EfiSystemWakeupTypeReserved        = 0,\r
+  EfiSystemWakeupTypeOther           = 1,\r
+  EfiSystemWakeupTypeUnknown         = 2,\r
+  EfiSystemWakeupTypeApmTimer        = 3,\r
+  EfiSystemWakeupTypeModemRing       = 4,\r
+  EfiSystemWakeupTypeLanRemote       = 5,\r
+  EfiSystemWakeupTypePowerSwitch     = 6,\r
+  EfiSystemWakeupTypePciPme          = 7,\r
+  EfiSystemWakeupTypeAcPowerRestored = 8,\r
+} EFI_MISC_SYSTEM_WAKEUP_TYPE;\r
+\r
+typedef struct {\r
+  STRING_REF                      SystemManufacturer;\r
+  STRING_REF                      SystemProductName;\r
+  STRING_REF                      SystemVersion;\r
+  STRING_REF                      SystemSerialNumber;\r
+  EFI_GUID                        SystemUuid;\r
+  EFI_MISC_SYSTEM_WAKEUP_TYPE     SystemWakeupType;\r
+} EFI_MISC_SYSTEM_MANUFACTURER_DATA;       \r
+\r
+//\r
+//////////////////////////////////////////////////////////////////////////////\r
+//\r
+// Misc. Base Board Manufacturer - SMBIOS Type 2\r
+//\r
+#define EFI_MISC_BASE_BOARD_MANUFACTURER_RECORD_NUMBER 0x00000004\r
+\r
+typedef struct {\r
+  UINT32  Motherboard           :1;\r
+  UINT32  RequiresDaughterCard  :1;\r
+  UINT32  Removable             :1;\r
+  UINT32  Replaceable           :1;\r
+  UINT32  HotSwappable          :1;\r
+  UINT32  Reserved              :27;\r
+} EFI_BASE_BOARD_FEATURE_FLAGS;\r
+\r
+typedef enum {  \r
+  EfiBaseBoardTypeUnknown                = 1,\r
+  EfiBaseBoardTypeOther                  = 2,\r
+  EfiBaseBoardTypeServerBlade            = 3,\r
+  EfiBaseBoardTypeConnectivitySwitch     = 4,\r
+  EfiBaseBoardTypeSystemManagementModule = 5,\r
+  EfiBaseBoardTypeProcessorModule        = 6,\r
+  EfiBaseBoardTypeIOModule               = 7,\r
+  EfiBaseBoardTypeMemoryModule           = 8,\r
+  EfiBaseBoardTypeDaughterBoard          = 9,\r
+  EfiBaseBoardTypeMotherBoard            = 0xA,\r
+  EfiBaseBoardTypeProcessorMemoryModule  = 0xB,\r
+  EfiBaseBoardTypeProcessorIOModule      = 0xC,\r
+  EfiBaseBoardTypeInterconnectBoard      = 0xD,\r
+} EFI_BASE_BOARD_TYPE;\r
+\r
+typedef struct {\r
+  STRING_REF                      BaseBoardManufacturer;\r
+  STRING_REF                      BaseBoardProductName;\r
+  STRING_REF                      BaseBoardVersion;\r
+  STRING_REF                      BaseBoardSerialNumber;\r
+  STRING_REF                      BaseBoardAssetTag;\r
+  STRING_REF                      BaseBoardChassisLocation;\r
+  EFI_BASE_BOARD_FEATURE_FLAGS    BaseBoardFeatureFlags;\r
+  EFI_BASE_BOARD_TYPE             BaseBoardType;\r
+  EFI_INTER_LINK_DATA             BaseBoardChassisLink;\r
+  UINT32                          BaseBoardNumberLinks;\r
+  EFI_INTER_LINK_DATA             LinkN;\r
+} EFI_MISC_BASE_BOARD_MANUFACTURER_DATA;       \r
+\r
+//\r
+//////////////////////////////////////////////////////////////////////////////\r
+//\r
+// Misc. System/Chassis Enclosure - SMBIOS Type 3\r
+//\r
+#define EFI_MISC_CHASSIS_MANUFACTURER_RECORD_NUMBER  0x00000005\r
+\r
+typedef enum {  \r
+  EfiMiscChassisTypeOther               = 0x1,\r
+  EfiMiscChassisTypeUnknown             = 0x2,\r
+  EfiMiscChassisTypeDeskTop             = 0x3,\r
+  EfiMiscChassisTypeLowProfileDesktop   = 0x4,\r
+  EfiMiscChassisTypePizzaBox            = 0x5,\r
+  EfiMiscChassisTypeMiniTower           = 0x6,\r
+  EfiMiscChassisTypeTower               = 0x7,\r
+  EfiMiscChassisTypePortable            = 0x8,\r
+  EfiMiscChassisTypeLapTop              = 0x9,\r
+  EfiMiscChassisTypeNotebook            = 0xA,\r
+  EfiMiscChassisTypeHandHeld            = 0xB,\r
+  EfiMiscChassisTypeDockingStation      = 0xC,\r
+  EfiMiscChassisTypeAllInOne            = 0xD,\r
+  EfiMiscChassisTypeSubNotebook         = 0xE,\r
+  EfiMiscChassisTypeSpaceSaving         = 0xF,\r
+  EfiMiscChassisTypeLunchBox            = 0x10,\r
+  EfiMiscChassisTypeMainServerChassis   = 0x11,\r
+  EfiMiscChassisTypeExpansionChassis    = 0x12,\r
+  EfiMiscChassisTypeSubChassis          = 0x13,\r
+  EfiMiscChassisTypeBusExpansionChassis = 0x14,\r
+  EfiMiscChassisTypePeripheralChassis   = 0x15,\r
+  EfiMiscChassisTypeRaidChassis         = 0x16,\r
+  EfiMiscChassisTypeRackMountChassis    = 0x17,\r
+  EfiMiscChassisTypeSealedCasePc        = 0x18,\r
+  EfiMiscChassisMultiSystemChassis      = 0x19,\r
+} EFI_MISC_CHASSIS_TYPE;\r
+\r
+typedef struct {\r
+  UINT32  ChassisType       :16;\r
+  UINT32  ChassisLockPresent:1;\r
+  UINT32  Reserved          :15;\r
+} EFI_MISC_CHASSIS_STATUS;\r
+\r
+typedef enum {  \r
+  EfiChassisStateOther           = 0x01,\r
+  EfiChassisStateUnknown         = 0x02,\r
+  EfiChassisStateSafe            = 0x03,\r
+  EfiChassisStateWarning         = 0x04,\r
+  EfiChassisStateCritical        = 0x05,\r
+  EfiChassisStateNonRecoverable  = 0x06,\r
+} EFI_MISC_CHASSIS_STATE;\r
+\r
+typedef enum {  \r
+  EfiChassisSecurityStatusOther                          = 0x01,\r
+  EfiChassisSecurityStatusUnknown                        = 0x02,\r
+  EfiChassisSecurityStatusNone                           = 0x03,\r
+  EfiChassisSecurityStatusExternalInterfaceLockedOut     = 0x04,\r
+  EfiChassisSecurityStatusExternalInterfaceLockedEnabled = 0x05,\r
+} EFI_MISC_CHASSIS_SECURITY_STATE;\r
+\r
+typedef struct {\r
+  UINT32  RecordType  :1;\r
+  UINT32  Reserved    :24;\r
+} EFI_MISC_ELEMENT_TYPE;\r
+\r
+typedef struct {\r
+  EFI_MISC_ELEMENT_TYPE   ChassisElementType;\r
+  EFI_INTER_LINK_DATA     ChassisElementStructure;\r
+  EFI_BASE_BOARD_TYPE     ChassisBaseBoard;\r
+  UINT32                  ChassisElementMinimum;\r
+  UINT32                  ChassisElementMaximum;\r
+} EFI_MISC_ELEMENTS; \r
+\r
+typedef struct {\r
+  STRING_REF                      ChassisManufacturer;\r
+  STRING_REF                      ChassisVersion;\r
+  STRING_REF                      ChassisSerialNumber;\r
+  STRING_REF                      ChassisAssetTag;\r
+  EFI_MISC_CHASSIS_STATUS         ChassisType;\r
+  EFI_MISC_CHASSIS_STATE          ChassisBootupState;\r
+  EFI_MISC_CHASSIS_STATE          ChassisPowerSupplyState;\r
+  EFI_MISC_CHASSIS_STATE          ChassisThermalState;\r
+  EFI_MISC_CHASSIS_SECURITY_STATE ChassisSecurityState;\r
+  UINT32                          ChassisOemDefined;\r
+  UINT32                          ChassisHeight;\r
+  UINT32                          ChassisNumberPowerCords;\r
+  UINT32                          ChassisElementCount;\r
+  UINT32                          ChassisElementRecordLength;//\r
+  EFI_MISC_ELEMENTS               ChassisElements;\r
+} EFI_MISC_CHASSIS_MANUFACTURER_DATA;\r
+\r
+//\r
+//////////////////////////////////////////////////////////////////////////////\r
+//\r
+// Misc. Port Connector Information - SMBIOS Type 8\r
+//\r
+#define EFI_MISC_PORT_INTERNAL_CONNECTOR_DESIGNATOR_RECORD_NUMBER 0x00000006\r
+\r
+typedef enum {  \r
+  EfiPortConnectorTypeNone                   = 0x00,\r
+  EfiPortConnectorTypeCentronics             = 0x01,\r
+  EfiPortConnectorTypeMiniCentronics         = 0x02,\r
+  EfiPortConnectorTypeProprietary            = 0x03,\r
+  EfiPortConnectorTypeDB25Male               = 0x04,\r
+  EfiPortConnectorTypeDB25Female             = 0x05,\r
+  EfiPortConnectorTypeDB15Male               = 0x06,\r
+  EfiPortConnectorTypeDB15Female             = 0x07,\r
+  EfiPortConnectorTypeDB9Male                = 0x08,\r
+  EfiPortConnectorTypeDB9Female              = 0x09,\r
+  EfiPortConnectorTypeRJ11                   = 0x0A,\r
+  EfiPortConnectorTypeRJ45                   = 0x0B,\r
+  EfiPortConnectorType50PinMiniScsi          = 0x0C,\r
+  EfiPortConnectorTypeMiniDin                = 0x0D,\r
+  EfiPortConnectorTypeMicriDin               = 0x0E,\r
+  EfiPortConnectorTypePS2                    = 0x0F,\r
+  EfiPortConnectorTypeInfrared               = 0x10,\r
+  EfiPortConnectorTypeHpHil                  = 0x11,\r
+  EfiPortConnectorTypeUsb                    = 0x12,\r
+  EfiPortConnectorTypeSsaScsi                = 0x13,\r
+  EfiPortConnectorTypeCircularDin8Male       = 0x14,\r
+  EfiPortConnectorTypeCircularDin8Female     = 0x15,\r
+  EfiPortConnectorTypeOnboardIde             = 0x16,\r
+  EfiPortConnectorTypeOnboardFloppy          = 0x17,\r
+  EfiPortConnectorType9PinDualInline         = 0x18,\r
+  EfiPortConnectorType25PinDualInline        = 0x19,\r
+  EfiPortConnectorType50PinDualInline        = 0x1A,\r
+  EfiPortConnectorType68PinDualInline        = 0x1B,\r
+  EfiPortConnectorTypeOnboardSoundInput      = 0x1C,\r
+  EfiPortConnectorTypeMiniCentronicsType14   = 0x1D,\r
+  EfiPortConnectorTypeMiniCentronicsType26   = 0x1E,\r
+  EfiPortConnectorTypeHeadPhoneMiniJack      = 0x1F,\r
+  EfiPortConnectorTypeBNC                    = 0x20,\r
+  EfiPortConnectorType1394                   = 0x21,\r
+  EfiPortConnectorTypePC98                   = 0xA0,\r
+  EfiPortConnectorTypePC98Hireso             = 0xA1,\r
+  EfiPortConnectorTypePCH98                  = 0xA2,\r
+  EfiPortConnectorTypePC98Note               = 0xA3,\r
+  EfiPortConnectorTypePC98Full               = 0xA4,\r
+  EfiPortConnectorTypeOther                  = 0xFF,\r
+} EFI_MISC_PORT_CONNECTOR_TYPE;\r
+\r
+typedef enum {  \r
+  EfiPortTypeNone                      = 0x00,\r
+  EfiPortTypeParallelXtAtCompatible    = 0x01,\r
+  EfiPortTypeParallelPortPs2           = 0x02,\r
+  EfiPortTypeParallelPortEcp           = 0x03,\r
+  EfiPortTypeParallelPortEpp           = 0x04,\r
+  EfiPortTypeParallelPortEcpEpp        = 0x05,\r
+  EfiPortTypeSerialXtAtCompatible      = 0x06,\r
+  EfiPortTypeSerial16450Compatible     = 0x07,\r
+  EfiPortTypeSerial16550Compatible     = 0x08,\r
+  EfiPortTypeSerial16550ACompatible    = 0x09,\r
+  EfiPortTypeScsi                      = 0x0A,\r
+  EfiPortTypeMidi                      = 0x0B,\r
+  EfiPortTypeJoyStick                  = 0x0C,\r
+  EfiPortTypeKeyboard                  = 0x0D,\r
+  EfiPortTypeMouse                     = 0x0E,\r
+  EfiPortTypeSsaScsi                   = 0x0F,\r
+  EfiPortTypeUsb                       = 0x10,\r
+  EfiPortTypeFireWire                  = 0x11,\r
+  EfiPortTypePcmciaTypeI               = 0x12,\r
+  EfiPortTypePcmciaTypeII              = 0x13,\r
+  EfiPortTypePcmciaTypeIII             = 0x14,\r
+  EfiPortTypeCardBus                   = 0x15,\r
+  EfiPortTypeAccessBusPort             = 0x16,\r
+  EfiPortTypeScsiII                    = 0x17,\r
+  EfiPortTypeScsiWide                  = 0x18,\r
+  EfiPortTypePC98                      = 0x19,\r
+  EfiPortTypePC98Hireso                = 0x1A,\r
+  EfiPortTypePCH98                     = 0x1B,\r
+  EfiPortTypeVideoPort                 = 0x1C,\r
+  EfiPortTypeAudioPort                 = 0x1D,\r
+  EfiPortTypeModemPort                 = 0x1E,\r
+  EfiPortTypeNetworkPort               = 0x1F,\r
+  EfiPortType8251Compatible            = 0xA0,\r
+  EfiPortType8251FifoCompatible        = 0xA1,\r
+  EfiPortTypeOther                     = 0xFF,\r
+} EFI_MISC_PORT_TYPE;\r
+\r
+typedef struct {\r
+  STRING_REF                    PortInternalConnectorDesignator;\r
+  STRING_REF                    PortExternalConnectorDesignator;\r
+  EFI_MISC_PORT_CONNECTOR_TYPE  PortInternalConnectorType;\r
+  EFI_MISC_PORT_CONNECTOR_TYPE  PortExternalConnectorType;\r
+  EFI_MISC_PORT_TYPE            PortType;\r
+  EFI_MISC_PORT_DEVICE_PATH     PortPath;\r
+} EFI_MISC_PORT_INTERNAL_CONNECTOR_DESIGNATOR_DATA;      \r
+\r
+//\r
+//////////////////////////////////////////////////////////////////////////////\r
+//\r
+// Misc. System Slots - SMBIOS Type 9\r
+//\r
+#define EFI_MISC_SYSTEM_SLOT_DESIGNATION_RECORD_NUMBER 0x00000007\r
+\r
+typedef enum {  \r
+  EfiSlotTypeOther                        = 0x01,\r
+  EfiSlotTypeUnknown                      = 0x02,\r
+  EfiSlotTypeIsa                          = 0x03,\r
+  EfiSlotTypeMca                          = 0x04,\r
+  EfiSlotTypeEisa                         = 0x05,\r
+  EfiSlotTypePci                          = 0x06,\r
+  EfiSlotTypePcmcia                       = 0x07,\r
+  EfiSlotTypeVlVesa                       = 0x08,\r
+  EfiSlotTypeProprietary                  = 0x09,\r
+  EfiSlotTypeProcessorCardSlot            = 0x0A,\r
+  EfiSlotTypeProprietaryMemoryCardSlot    = 0x0B,\r
+  EfiSlotTypeIORiserCardSlot              = 0x0C,\r
+  EfiSlotTypeNuBus                        = 0x0D,\r
+  EfiSlotTypePci66MhzCapable              = 0x0E,\r
+  EfiSlotTypeAgp                          = 0x0F,\r
+  EfiSlotTypeApg2X                        = 0x10,\r
+  EfiSlotTypeAgp4X                        = 0x11,\r
+  EfiSlotTypePciX                         = 0x12,\r
+  EfiSlotTypeAgp4x                        = 0x13,\r
+  EfiSlotTypePC98C20                      = 0xA0,\r
+  EfiSlotTypePC98C24                      = 0xA1,\r
+  EfiSlotTypePC98E                        = 0xA2,\r
+  EfiSlotTypePC98LocalBus                 = 0xA3,\r
+  EfiSlotTypePC98Card                     = 0xA4,\r
+} EFI_MISC_SLOT_TYPE;\r
+\r
+typedef enum {  \r
+  EfiSlotDataBusWidthOther      = 0x01,\r
+  EfiSlotDataBusWidthUnknown    = 0x02,\r
+  EfiSlotDataBusWidth8Bit       = 0x03,\r
+  EfiSlotDataBusWidth16Bit      = 0x04,\r
+  EfiSlotDataBusWidth32Bit      = 0x05,\r
+  EfiSlotDataBusWidth64Bit      = 0x06,\r
+  EfiSlotDataBusWidth128Bit     = 0x07,\r
+} EFI_MISC_SLOT_DATA_BUS_WIDTH;\r
+\r
+typedef enum {  \r
+  EfiSlotUsageOther     = 1,\r
+  EfiSlotUsageUnknown   = 2,\r
+  EfiSlotUsageAvailable = 3,\r
+  EfiSlotUsageInUse     = 4,\r
+} EFI_MISC_SLOT_USAGE;\r
+  \r
+typedef enum {  \r
+  EfiSlotLengthOther   = 1,\r
+  EfiSlotLengthUnknown = 2,\r
+  EfiSlotLengthShort   = 3,\r
+  EfiSlotLengthLong    = 4\r
+} EFI_MISC_SLOT_LENGTH;\r
+\r
+typedef struct {\r
+  UINT32  CharacteristicsUnknown  :1;\r
+  UINT32  Provides50Volts         :1;\r
+  UINT32  Provides33Volts         :1;\r
+  UINT32  SharedSlot              :1;\r
+  UINT32  PcCard16Supported       :1;\r
+  UINT32  CardBusSupported        :1;\r
+  UINT32  ZoomVideoSupported      :1;\r
+  UINT32  ModemRingResumeSupported:1;\r
+  UINT32  PmeSignalSupported      :1;\r
+  UINT32  HotPlugDevicesSupported :1;\r
+  UINT32  SmbusSignalSupported    :1;\r
+  UINT32  Reserved                :21;\r
+} EFI_MISC_SLOT_CHARACTERISTICS;\r
+\r
+typedef struct {\r
+  STRING_REF                    SlotDesignation;\r
+  EFI_MISC_SLOT_TYPE            SlotType;\r
+  EFI_MISC_SLOT_DATA_BUS_WIDTH  SlotDataBusWidth;\r
+  EFI_MISC_SLOT_USAGE           SlotUsage;\r
+  EFI_MISC_SLOT_LENGTH          SlotLength;\r
+  UINT16                        SlotId;\r
+  EFI_MISC_SLOT_CHARACTERISTICS SlotCharacteristics;\r
+  EFI_DEVICE_PATH_PROTOCOL      SlotDevicePath;\r
+} EFI_MISC_SYSTEM_SLOT_DESIGNATION_DATA;      \r
+\r
+//\r
+//////////////////////////////////////////////////////////////////////////////\r
+//\r
+// Misc. Onboard Device - SMBIOS Type 10\r
+//\r
+#define EFI_MISC_ONBOARD_DEVICE_RECORD_NUMBER 0x00000008\r
+\r
+typedef enum {  \r
+  EfiOnBoardDeviceTypeOther          = 1,\r
+  EfiOnBoardDeviceTypeUnknown        = 2,\r
+  EfiOnBoardDeviceTypeVideo          = 3,\r
+  EfiOnBoardDeviceTypeScsiController = 4,\r
+  EfiOnBoardDeviceTypeEthernet       = 5,\r
+  EfiOnBoardDeviceTypeTokenRing      = 6,\r
+  EfiOnBoardDeviceTypeSound          = 7,\r
+} EFI_MISC_ONBOARD_DEVICE_TYPE;\r
+\r
+typedef struct {\r
+  UINT32  DeviceType    :16;\r
+  UINT32  DeviceEnabled :1;\r
+  UINT32  Reserved      :15;\r
+} EFI_MISC_ONBOARD_DEVICE_STATUS;\r
+\r
+typedef struct {\r
+  STRING_REF                           OnBoardDeviceDescription;\r
+  EFI_MISC_ONBOARD_DEVICE_STATUS       OnBoardDeviceStatus;\r
+  EFI_DEVICE_PATH_PROTOCOL             OnBoardDevicePath;\r
+} EFI_MISC_ONBOARD_DEVICE_DATA;\r
+\r
+//\r
+//////////////////////////////////////////////////////////////////////////////\r
+//\r
+// Misc. BIOS Language Information - SMBIOS Type 11\r
+//\r
+#define EFI_MISC_OEM_STRING_RECORD_NUMBER 0x00000009\r
+\r
+typedef struct {\r
+  STRING_REF                          OemStringRef[1];\r
+} EFI_MISC_OEM_STRING_DATA;\r
+\r
+//\r
+//////////////////////////////////////////////////////////////////////////////\r
+//\r
+// Misc. System Options - SMBIOS Type 12\r
+//\r
+typedef struct {\r
+  STRING_REF                          SystemOptionStringRef[1];\r
+} EFI_MISC_SYSTEM_OPTION_STRING_DATA;      \r
+\r
+#define EFI_MISC_SYSTEM_OPTION_STRING_RECORD_NUMBER 0x0000000A\r
+\r
+//\r
+//////////////////////////////////////////////////////////////////////////////\r
+//\r
+// Misc. Number of Installable Languages - SMBIOS Type 13\r
+//\r
+#define EFI_MISC_NUMBER_OF_INSTALLABLE_LANGUAGES_RECORD_NUMBER 0x0000000B\r
+\r
+typedef struct {\r
+  UINT32                              AbbreviatedLanguageFormat :1;\r
+  UINT32                              Reserved                  :31;\r
+} EFI_MISC_LANGUAGE_FLAGS;\r
+\r
+typedef struct {\r
+  UINT16                              NumberOfInstallableLanguages;\r
+  EFI_MISC_LANGUAGE_FLAGS             LanguageFlags;\r
+  UINT16                              CurrentLanguageNumber;\r
+} EFI_MISC_NUMBER_OF_INSTALLABLE_LANGUAGES_DATA;       \r
+\r
+//\r
+//////////////////////////////////////////////////////////////////////////////\r
+//\r
+// Misc. System Language String\r
+//\r
+#define EFI_MISC_SYSTEM_LANGUAGE_STRING_RECORD_NUMBER 0x0000000C\r
+\r
+typedef struct {\r
+  UINT16                              LanguageId;\r
+  STRING_REF                          SystemLanguageString;\r
+} EFI_MISC_SYSTEM_LANGUAGE_STRING_DATA;      \r
+\r
+//\r
+//////////////////////////////////////////////////////////////////////////////\r
+//\r
+// Group Associations - SMBIOS Type 14\r
+//\r
+#define EFI_MISC_GROUP_NAME_RECORD_NUMBER          0x0000000D\r
+\r
+typedef struct {\r
+  STRING_REF               GroupName;\r
+  UINT16                   NumberGroupItems;\r
+  UINT16                   GroupId;\r
+} EFI_MISC_GROUP_NAME_DATA;  \r
+\r
+//\r
+//////////////////////////////////////////////////////////////////////////////\r
+//\r
+// Group Item Set Element\r
+//\r
+#define EFI_MISC_GROUP_ITEM_SET_RECORD_NUMBER      0x0000000E\r
+\r
+typedef struct {\r
+  EFI_GUID                 SubClass;         \r
+  EFI_INTER_LINK_DATA      GroupLink;\r
+  UINT16                   GroupId;\r
+  UINT16                   GroupElementId;\r
+} EFI_MISC_GROUP_ITEM_SET_DATA;\r
+\r
+//\r
+//////////////////////////////////////////////////////////////////////////////\r
+//\r
+//  Misc. Pointing Device Type - SMBIOS Type 21\r
+//\r
+#define EFI_MISC_POINTING_DEVICE_TYPE_RECORD_NUMBER 0x0000000F\r
+\r
+typedef enum { \r
+  EfiPointingDeviceTypeOther         = 0x01,\r
+  EfiPointingDeviceTypeUnknown       = 0x02,\r
+  EfiPointingDeviceTypeMouse         = 0x03,\r
+  EfiPointingDeviceTypeTrackBall     = 0x04,\r
+  EfiPointingDeviceTypeTrackPoint    = 0x05,\r
+  EfiPointingDeviceTypeGlidePoint    = 0x06,\r
+  EfiPointingDeviceTouchPad          = 0x07,\r
+  EfiPointingDeviceTouchScreen       = 0x08,\r
+  EfiPointingDeviceOpticalSensor     = 0x09,\r
+} EFI_MISC_POINTING_DEVICE_TYPE;\r
+\r
+typedef enum {  \r
+  EfiPointingDeviceInterfaceOther              = 0x01,\r
+  EfiPointingDeviceInterfaceUnknown            = 0x02,\r
+  EfiPointingDeviceInterfaceSerial             = 0x03,\r
+  EfiPointingDeviceInterfacePs2                = 0x04,\r
+  EfiPointingDeviceInterfaceInfrared           = 0x05,\r
+  EfiPointingDeviceInterfaceHpHil              = 0x06,\r
+  EfiPointingDeviceInterfaceBusMouse           = 0x07,\r
+  EfiPointingDeviceInterfaceADB                = 0x08,\r
+  EfiPointingDeviceInterfaceBusMouseDB9        = 0xA0,\r
+  EfiPointingDeviceInterfaceBusMouseMicroDin   = 0xA1,\r
+  EfiPointingDeviceInterfaceUsb                = 0xA2,\r
+} EFI_MISC_POINTING_DEVICE_INTERFACE;\r
+\r
+typedef struct {\r
+  EFI_MISC_POINTING_DEVICE_TYPE       PointingDeviceType;\r
+  EFI_MISC_POINTING_DEVICE_INTERFACE  PointingDeviceInterface;\r
+  UINT16                              NumberPointingDeviceButtons;\r
+  EFI_DEVICE_PATH_PROTOCOL            PointingDevicePath;\r
+} EFI_MISC_PORTING_DEVICE_TYPE_DATA;\r
+\r
+//\r
+//////////////////////////////////////////////////////////////////////////////\r
+//\r
+// Portable Battery - SMBIOS Type 22\r
+//\r
+#define EFI_MISC_BATTERY_LOCATION_RECORD_NUMBER  0x00000010\r
+\r
+typedef enum { \r
+  EfiBatteryDeviceChemistryTypeOther               = 0x01,\r
+  EfiBatteryDeviceChemistryTypeUnknown             = 0x02,\r
+  EfiBatteryDeviceChemistryTypeLeadAcid            = 0x03,\r
+  EfiBatteryDeviceChemistryTypeNickelCadmium       = 0x04,\r
+  EfiBatteryDeviceChemistryTypeNickelMetalHydride  = 0x05,\r
+  EfiBatteryDeviceChemistryTypeLithiumIon          = 0x06,\r
+  EfiBatteryDeviceChemistryTypeZincAir             = 0x07,\r
+  EfiBatteryDeviceChemistryTypeLithiumPolymer      = 0x08,\r
+} EFI_MISC_BATTERY_DEVICE_CHEMISTRY;\r
+\r
+typedef struct  {\r
+  UINT32 Date              :5;\r
+  UINT32 Month             :4;\r
+  UINT32 Year              :7;\r
+  UINT32 Reserved          :16;\r
+} EFI_MISC_BATTERY_SBDS_MANUFACTURE_DATE;\r
+\r
+typedef struct {\r
+  STRING_REF                         BatteryLocation;\r
+  STRING_REF                         BatteryManufacturer;\r
+  STRING_REF                         BatteryManufactureDate;\r
+  STRING_REF                         BatterySerialNumber;\r
+  STRING_REF                         BatteryDeviceName;\r
+  STRING_REF                         BatterySbdsVersionNumber;\r
+  STRING_REF                         BatterySbdsDeviceChemistry;\r
+  EFI_MISC_BATTERY_DEVICE_CHEMISTRY  BatteryDeviceChemistry;\r
+  EFI_EXP_BASE10_DATA                BatteryDesignCapacity;\r
+  EFI_EXP_BASE10_DATA                BatteryDesignVoltage;\r
+  UINT16                             BatteryMaximumError;\r
+  UINT16                             BatterySbdsSerialNumber;\r
+  EFI_MISC_BATTERY_SBDS_MANUFACTURE_DATE\r
+                                     BatterySbdsManufacturingDate;\r
+  UINT32                             BatteryOemSpecific;\r
+} EFI_MISC_BATTERY_LOCATION_DATA;   \r
+\r
+//\r
+//////////////////////////////////////////////////////////////////////////////\r
+//\r
+// Misc. Reset Capabilities - SMBIOS Type 23\r
+//\r
+#define EFI_MISC_RESET_CAPABILITIES_RECORD_NUMBER 0x00000011\r
+\r
+typedef struct {\r
+  UINT32  Status              :1;\r
+  UINT32  BootOption          :2;\r
+  UINT32  BootOptionOnLimit   :2;\r
+  UINT32  WatchdogTimerPresent:1;\r
+  UINT32  Reserved            :26;\r
+} EFI_MISC_RESET_CAPABILITIES_TYPE;\r
+\r
+typedef struct {\r
+  EFI_MISC_RESET_CAPABILITIES_TYPE  ResetCapabilities;\r
+  UINT16                            ResetCount;\r
+  UINT16                            ResetLimit;\r
+  UINT16                            ResetTimerInterval;\r
+  UINT16                            ResetTimeout;\r
+} EFI_MISC_RESET_CAPABILITIES;\r
\r
+typedef struct {\r
+    EFI_MISC_RESET_CAPABILITIES   ResetCapabilities;\r
+    UINT16                        ResetCount;\r
+    UINT16                        ResetLimit;\r
+    UINT16                        ResetTimerInterval;\r
+    UINT16                        ResetTimeout;\r
+} EFI_MISC_RESET_CAPABILITIES_DATA;       \r
+\r
+//\r
+//////////////////////////////////////////////////////////////////////////////\r
+//\r
+// Misc. Hardware Security - SMBIOS Type 24\r
+//\r
+#define EFI_MISC_HARDWARE_SECURITY_RECORD_NUMBER 0x00000012\r
+\r
+typedef enum {\r
+  EfiHardwareSecurityStatusDisabled       = 0,\r
+  EfiHardwareSecurityStatusEnabled        = 1,\r
+  EfiHardwareSecurityStatusNotImplemented = 2,\r
+  EfiHardwareSecurityStatusUnknown        = 3\r
+} EFI_MISC_HARDWARE_SECURITY_STATUS; \r
+\r
+typedef struct {\r
+  EFI_MISC_HARDWARE_SECURITY_STATUS   FrontPanelResetStatus       :2;  \r
+  EFI_MISC_HARDWARE_SECURITY_STATUS   AdministratorPasswordStatus :2;  \r
+  EFI_MISC_HARDWARE_SECURITY_STATUS   KeyboardPasswordStatus      :2;  \r
+  EFI_MISC_HARDWARE_SECURITY_STATUS   PowerOnPasswordStatus       :2;  \r
+  EFI_MISC_HARDWARE_SECURITY_STATUS   Reserved                    :24;  \r
+} EFI_MISC_HARDWARE_SECURITY_SETTINGS;\r
+\r
+typedef struct {\r
+  EFI_MISC_HARDWARE_SECURITY_SETTINGS HardwareSecuritySettings;\r
+} EFI_MISC_HARDWARE_SECURITY_SETTINGS_DATA;       \r
+\r
+//\r
+//////////////////////////////////////////////////////////////////////////////\r
+//\r
+// System Power Controls - SMBIOS Type 25\r
+//\r
+#define EFI_MISC_SCHEDULED_POWER_ON_MONTH_RECORD_NUMBER  0x00000013\r
+\r
+typedef struct {\r
+  UINT16             ScheduledPoweronMonth;\r
+  UINT16             ScheduledPoweronDayOfMonth;\r
+  UINT16             ScheduledPoweronHour;\r
+  UINT16             ScheduledPoweronMinute;\r
+  UINT16             ScheduledPoweronSecond;\r
+} EFI_MISC_SCHEDULED_POWER_ON_MONTH_DATA;  \r
+\r
+//\r
+//////////////////////////////////////////////////////////////////////////////\r
+//\r
+// Voltage Probe - SMBIOS Type 26\r
+//\r
+#define EFI_MISC_VOLTAGE_PROBE_DESCRIPTION_RECORD_NUMBER  0x00000014\r
+\r
+typedef struct {\r
+  UINT32 VoltageProbeSite        :5;\r
+  UINT32 VoltageProbeStatus      :3;\r
+  UINT32 Reserved                :24;\r
+} EFI_MISC_VOLTAGE_PROBE_LOCATION;\r
+\r
+typedef struct {\r
+  STRING_REF                      VoltageProbeDescription;\r
+  EFI_MISC_VOLTAGE_PROBE_LOCATION VoltageProbeLocation;\r
+  EFI_EXP_BASE10_DATA             VoltageProbeMaximumValue;\r
+  EFI_EXP_BASE10_DATA             VoltageProbeMinimumValue;\r
+  EFI_EXP_BASE10_DATA             VoltageProbeResolution;\r
+  EFI_EXP_BASE10_DATA             VoltageProbeTolerance;\r
+  EFI_EXP_BASE10_DATA             VoltageProbeAccuracy;\r
+  EFI_EXP_BASE10_DATA             VoltageProbeNominalValue;\r
+  EFI_EXP_BASE10_DATA             MDLowerNoncriticalThreshold;\r
+  EFI_EXP_BASE10_DATA             MDUpperNoncriticalThreshold;\r
+  EFI_EXP_BASE10_DATA             MDLowerCriticalThreshold;\r
+  EFI_EXP_BASE10_DATA             MDUpperCriticalThreshold;\r
+  EFI_EXP_BASE10_DATA             MDLowerNonrecoverableThreshold;\r
+  EFI_EXP_BASE10_DATA             MDUpperNonrecoverableThreshold;\r
+  UINT32                          VoltageProbeOemDefined;\r
+} EFI_MISC_VOLTAGE_PROBE_DESCRIPTION_DATA; \r
+\r
+//\r
+//////////////////////////////////////////////////////////////////////////////\r
+//\r
+// Cooling Device - SMBIOS Type 27\r
+//\r
+#define EFI_MISC_COOLING_DEVICE_TEMP_LINK_RECORD_NUMBER   0x00000015\r
+\r
+typedef struct {\r
+  UINT32 CoolingDevice                 :5;\r
+  UINT32 CoolingDeviceStatus           :3;\r
+  UINT32 Reserved                      :24;\r
+} EFI_MISC_COOLING_DEVICE_TYPE;\r
+\r
+typedef struct {\r
+  EFI_MISC_COOLING_DEVICE_TYPE   CoolingDeviceType;\r
+  EFI_INTER_LINK_DATA            CoolingDeviceTemperatureLink;\r
+  UINT16                         CoolingDeviceUnitGroup;\r
+  EFI_EXP_BASE10_DATA            CoolingDeviceNominalSpeed;\r
+  UINT32                         CoolingDeviceOemDefined;\r
+} EFI_MISC_COOLING_DEVICE_TEMP_LINK_DATA; \r
+\r
+//\r
+//////////////////////////////////////////////////////////////////////////////\r
+//\r
+// Temperature Probe - SMBIOS Type 28\r
+//\r
+#define EFI_MISC_TEMPERATURE_PROBE_DESCRIPTION_RECORD_NUMBER   0x00000016\r
+\r
+typedef struct {\r
+  UINT32 TemperatureProbeSite          :5;\r
+  UINT32 TemperatureProbeStatus        :3;\r
+  UINT32 Reserved                      :24;\r
+} EFI_MISC_TEMPERATURE_PROBE_LOCATION;\r
+\r
+typedef struct {\r
+  STRING_REF               TemperatureProbeDescription;\r
+  EFI_MISC_TEMPERATURE_PROBE_LOCATION\r
+                           TemperatureProbeLocation;\r
+  EFI_EXP_BASE10_DATA      TemperatureProbeMaximumValue;\r
+  EFI_EXP_BASE10_DATA      TemperatureProbeMinimumValue;\r
+  EFI_EXP_BASE10_DATA      TemperatureProbeResolution;\r
+  EFI_EXP_BASE10_DATA      TemperatureProbeTolerance;\r
+  EFI_EXP_BASE10_DATA      TemperatureProbeAccuracy;\r
+  EFI_EXP_BASE10_DATA      TemperatureProbeNominalValue; \r
+  EFI_EXP_BASE10_DATA      MDLowerNoncriticalThreshold;\r
+  EFI_EXP_BASE10_DATA      MDUpperNoncriticalThreshold;\r
+  EFI_EXP_BASE10_DATA      MDLowerCriticalThreshold;\r
+  EFI_EXP_BASE10_DATA      MDUpperCriticalThreshold;\r
+  EFI_EXP_BASE10_DATA      MDLowerNonrecoverableThreshold;\r
+  EFI_EXP_BASE10_DATA      MDUpperNonrecoverableThreshold;\r
+  UINT32                   TemperatureProbeOemDefined;\r
+} EFI_MISC_TEMPERATURE_PROBE_DESCRIPTION_DATA;  \r
+\r
+//\r
+//////////////////////////////////////////////////////////////////////////////\r
+//\r
+// Electrical Current Probe - SMBIOS Type 29\r
+//\r
+\r
+#define EFI_MISC_ELECTRICAL_CURRENT_PROBE_DESCRIPTION_RECORD_NUMBER  0x00000017\r
+\r
+typedef struct {\r
+  UINT32 ElectricalCurrentProbeSite    :5;\r
+  UINT32 ElectricalCurrentProbeStatus  :3;\r
+  UINT32 Reserved                      :24;\r
+} EFI_MISC_ELECTRICAL_CURRENT_PROBE_LOCATION;\r
+\r
+typedef struct {\r
+  STRING_REF               ElectricalCurrentProbeDescription;\r
+  EFI_MISC_ELECTRICAL_CURRENT_PROBE_LOCATION\r
+                           ElectricalCurrentProbeLocation;\r
+  EFI_EXP_BASE10_DATA      ElectricalCurrentProbeMaximumValue;\r
+  EFI_EXP_BASE10_DATA      ElectricalCurrentProbeMinimumValue;\r
+  EFI_EXP_BASE10_DATA      ElectricalCurrentProbeResolution;\r
+  EFI_EXP_BASE10_DATA      ElectricalCurrentProbeTolerance;\r
+  EFI_EXP_BASE10_DATA      ElectricalCurrentProbeAccuracy;\r
+  EFI_EXP_BASE10_DATA      ElectricalCurrentProbeNominalValue;\r
+  EFI_EXP_BASE10_DATA      MDLowerNoncriticalThreshold;\r
+  EFI_EXP_BASE10_DATA      MDUpperNoncriticalThreshold;\r
+  EFI_EXP_BASE10_DATA      MDLowerCriticalThreshold;\r
+  EFI_EXP_BASE10_DATA      MDUpperCriticalThreshold;\r
+  EFI_EXP_BASE10_DATA      MDLowerNonrecoverableThreshold;\r
+  EFI_EXP_BASE10_DATA      MDUpperNonrecoverableThreshold;\r
+  UINT32                   ElectricalCurrentProbeOemDefined;\r
+} EFI_MISC_ELECTRICAL_CURRENT_PROBE_DESCRIPTION_DATA;\r
+\r
+//\r
+//////////////////////////////////////////////////////////////////////////////\r
+//\r
+// Out-of-Band Remote Access - SMBIOS Type 30\r
+//\r
+\r
+#define EFI_MISC_REMOTE_ACCESS_MANUFACTURER_DESCRIPTION_RECORD_NUMBER  0x00000018\r
+\r
+typedef struct  {\r
+  UINT32 InboundConnectionEnabled            :1;\r
+  UINT32 OutboundConnectionEnabled           :1;\r
+  UINT32 Reserved                            :30;\r
+} EFI_MISC_REMOTE_ACCESS_CONNECTIONS;\r
+\r
+typedef struct {\r
+  STRING_REF                             RemoteAccessManufacturerNameDescription;\r
+  EFI_MISC_REMOTE_ACCESS_CONNECTIONS     RemoteAccessConnections;\r
+} EFI_MISC_REMOTE_ACCESS_MANUFACTURER_DESCRIPTION_DATA;\r
+\r
+//\r
+//////////////////////////////////////////////////////////////////////////////\r
+//\r
+// Misc. BIS Entry Point - SMBIOS Type 31\r
+//\r
+#define EFI_MISC_BIS_ENTRY_POINT_RECORD_NUMBER          0x00000019\r
+\r
+typedef struct {\r
+  EFI_PHYSICAL_ADDRESS       BisEntryPoint;\r
+} EFI_MISC_BIS_ENTRY_POINT_DATA;    \r
+\r
+//\r
+//////////////////////////////////////////////////////////////////////////////\r
+//\r
+// Misc. Boot Information - SMBIOS Type 32\r
+//\r
+#define EFI_MISC_BOOT_INFORMATION_STATUS_RECORD_NUMBER  0x0000001A\r
+\r
+typedef enum {  \r
+  EfiBootInformationStatusNoError                  = 0x00,\r
+  EfiBootInformationStatusNoBootableMedia          = 0x01,\r
+  EfiBootInformationStatusNormalOSFailedLoading    = 0x02,\r
+  EfiBootInformationStatusFirmwareDetectedFailure  = 0x03,\r
+  EfiBootInformationStatusOSDetectedFailure        = 0x04,\r
+  EfiBootInformationStatusUserRequestedBoot        = 0x05,\r
+  EfiBootInformationStatusSystemSecurityViolation  = 0x06,\r
+  EfiBootInformationStatusPreviousRequestedImage   = 0x07,\r
+  EfiBootInformationStatusWatchdogTimerExpired     = 0x08,\r
+  EfiBootInformationStatusStartReserved            = 0x09,\r
+  EfiBootInformationStatusStartOemSpecific         = 0x80,\r
+  EfiBootInformationStatusStartProductSpecific     = 0xC0,\r
+} EFI_MISC_BOOT_INFORMATION_STATUS_DATA_TYPE;\r
+\r
+typedef struct {\r
+  EFI_MISC_BOOT_INFORMATION_STATUS_DATA_TYPE BootInformationStatus;\r
+  UINT8                                      BootInformationData[9];\r
+} EFI_MISC_BOOT_INFORMATION_STATUS_DATA;\r
+\r
+//\r
+//////////////////////////////////////////////////////////////////////////////\r
+//\r
+// Management Device - SMBIOS Type 34\r
+//\r
+#define EFI_MISC_MANAGEMENT_DEVICE_DESCRIPTION_RECORD_NUMBER   0x0000001B\r
+\r
+typedef enum { \r
+  EfiManagementDeviceTypeOther      = 0x01,\r
+  EfiManagementDeviceTypeUnknown    = 0x02,\r
+  EfiManagementDeviceTypeLm75       = 0x03,\r
+  EfiManagementDeviceTypeLm78       = 0x04,\r
+  EfiManagementDeviceTypeLm79       = 0x05,\r
+  EfiManagementDeviceTypeLm80       = 0x06,\r
+  EfiManagementDeviceTypeLm81       = 0x07,\r
+  EfiManagementDeviceTypeAdm9240    = 0x08,\r
+  EfiManagementDeviceTypeDs1780     = 0x09,\r
+  EfiManagementDeviceTypeMaxim1617  = 0x0A,\r
+  EfiManagementDeviceTypeGl518Sm    = 0x0B,\r
+  EfiManagementDeviceTypeW83781D    = 0x0C,\r
+  EfiManagementDeviceTypeHt82H791   = 0x0D,\r
+} EFI_MISC_MANAGEMENT_DEVICE_TYPE;\r
+\r
+typedef enum { \r
+  EfiManagementDeviceAddressTypeOther   = 1,\r
+  EfiManagementDeviceAddressTypeUnknown = 2,\r
+  EfiManagementDeviceAddressTypeIOPort  = 3,\r
+  EfiManagementDeviceAddressTypeMemory  = 4,\r
+  EfiManagementDeviceAddressTypeSmbus   = 5\r
+} EFI_MISC_MANAGEMENT_DEVICE_ADDRESS_TYPE;\r
+\r
+typedef struct {\r
+  STRING_REF                       ManagementDeviceDescription;\r
+  EFI_MISC_MANAGEMENT_DEVICE_TYPE  ManagementDeviceType;\r
+  UINTN                            ManagementDeviceAddress;\r
+  EFI_MISC_MANAGEMENT_DEVICE_ADDRESS_TYPE\r
+                                   ManagementDeviceAddressType;\r
+} EFI_MISC_MANAGEMENT_DEVICE_DESCRIPTION_DATA; \r
+\r
+//\r
+//////////////////////////////////////////////////////////////////////////////\r
+//\r
+// Management Device Component - SMBIOS Type 35\r
+//\r
+\r
+#define EFI_MISC_MANAGEMENT_DEVICE_COMPONENT_DESCRIPTION_RECORD_NUMBER  0x0000001C\r
+\r
+typedef struct {\r
+  STRING_REF               ManagementDeviceComponentDescription;\r
+  EFI_INTER_LINK_DATA      ManagementDeviceLink;\r
+  EFI_INTER_LINK_DATA      ManagementDeviceComponentLink; \r
+} EFI_MISC_MANAGEMENT_DEVICE_COMPONENT_DESCRIPTION_DATA; \r
+\r
+//\r
+//////////////////////////////////////////////////////////////////////////////\r
+//\r
+// IPMI Data Record - SMBIOS Type 38\r
+//\r
+typedef enum {  \r
+  EfiIpmiOther = 0,\r
+  EfiIpmiKcs   = 1,\r
+  EfiIpmiSmic  = 2,\r
+  EfiIpmiBt    = 3,\r
+} EFI_MISC_IPMI_INTERFACE_TYPE;\r
+\r
+typedef struct {\r
+  UINT16  IpmiSpecLeastSignificantDigit:4;\r
+  UINT16  IpmiSpecMostSignificantDigit: 4;\r
+  UINT16  Reserved:                     8;\r
+} EFI_MISC_IPMI_SPECIFICATION_REVISION;\r
+\r
+typedef struct {\r
+  EFI_MISC_IPMI_INTERFACE_TYPE          IpmiInterfaceType;\r
+  EFI_MISC_IPMI_SPECIFICATION_REVISION  IpmiSpecificationRevision;\r
+  UINT16                                IpmiI2CSlaveAddress;\r
+  UINT16                                IpmiNvDeviceAddress;\r
+  UINT64                                IpmiBaseAddress;\r
+  EFI_DEVICE_PATH_PROTOCOL              IpmiDevicePath;\r
+} EFI_MISC_IPMI_INTERFACE_TYPE_DATA;\r
+       \r
+#define EFI_MISC_IPMI_INTERFACE_TYPE_RECORD_NUMBER  0x0000001D\r
+\r
+//\r
+//////////////////////////////////////////////////////////////////////////////\r
+//\r
+//System Power supply Record - SMBIOS Type 39\r
+//\r
+typedef struct {\r
+  UINT16  PowerSupplyHotReplaceable  :1;\r
+  UINT16  PowerSupplyPresent         :1;\r
+  UINT16  PowerSupplyUnplugged       :1;\r
+  UINT16  InputVoltageRangeSwitch    :4;\r
+  UINT16  PowerSupplyStatus          :3;\r
+  UINT16  PowerSupplyType            :4;\r
+  UINT16  Reserved                   :2;\r
+} POWER_SUPPLY_CHARACTERISTICS;\r
+\r
+typedef struct {\r
+  UINT16                          PowerUnitGroup;\r
+  STRING_REF                      PowerSupplyLocation;\r
+  STRING_REF                      PowerSupplyDeviceName;\r
+  STRING_REF                      PowerSupplyManufacturer;\r
+  STRING_REF                      PowerSupplySerialNumber;\r
+  STRING_REF                      PowerSupplyAssetTagNumber;\r
+  STRING_REF                      PowerSupplyModelPartNumber;\r
+  STRING_REF                      PowerSupplyRevisionLevel;\r
+  UINT16                          PowerSupplyMaxPowerCapacity;\r
+  POWER_SUPPLY_CHARACTERISTICS    PowerSupplyCharacteristics;\r
+  EFI_INTER_LINK_DATA             PowerSupplyInputVoltageProbeLink;\r
+  EFI_INTER_LINK_DATA             PowerSupplyCoolingDeviceLink;\r
+  EFI_INTER_LINK_DATA             PowerSupplyInputCurrentProbeLink;\r
+} EFI_MISC_SYSTEM_POWER_SUPPLY_DATA;\r
+\r
+#define EFI_MISC_SYSTEM_POWER_SUPPLY_RECORD_NUMBER 0x0000001E\r
+\r
+//\r
+//////////////////////////////////////////////////////////////////////////////\r
+//\r
+// OEM Data Record - SMBIOS Type 0x80-0xFF\r
+//\r
+typedef struct {\r
+  UINT8       Type;\r
+  UINT8       Length;\r
+  UINT16      Handle;\r
+} SMBIOS_STRUCTURE_HDR;\r
+\r
+typedef struct {\r
+  SMBIOS_STRUCTURE_HDR          Header;\r
+  UINT8                         RawData[1];\r
+} EFI_MISC_SMBIOS_STRUCT_ENCAPSULATION_DATA; \r
+\r
+#define EFI_MISC_SMBIOS_STRUCT_ENCAP_RECORD_NUMBER  0x0000001F \r
+\r
+//\r
+//////////////////////////////////////////////////////////////////////////////\r
+//\r
+typedef union {\r
+  EFI_MISC_LAST_PCI_BUS_DATA                         LastPciBus;\r
+  EFI_MISC_BIOS_VENDOR_DATA                          MiscBiosVendor;\r
+  EFI_MISC_SYSTEM_MANUFACTURER_DATA                  MiscSystemManufacturer;\r
+  EFI_MISC_BASE_BOARD_MANUFACTURER_DATA              MiscBaseBoardManufacturer;\r
+  EFI_MISC_CHASSIS_MANUFACTURER_DATA                 MiscChassisManufacturer;  \r
+  EFI_MISC_PORT_INTERNAL_CONNECTOR_DESIGNATOR_DATA   MiscPortInternalConnectorDesignator;\r
+  EFI_MISC_SYSTEM_SLOT_DESIGNATION_DATA              MiscSystemSlotDesignation;\r
+  EFI_MISC_ONBOARD_DEVICE_DATA                       MiscOnboardDevice;\r
+  EFI_MISC_OEM_STRING_DATA                           MiscOemString;\r
+  EFI_MISC_SYSTEM_OPTION_STRING_DATA                 MiscOptionString;\r
+  EFI_MISC_NUMBER_OF_INSTALLABLE_LANGUAGES_DATA      NumberOfInstallableLanguages;\r
+  EFI_MISC_SYSTEM_LANGUAGE_STRING_DATA               MiscSystemLanguageString;  \r
+  EFI_MISC_GROUP_NAME_DATA                           MiscGroupNameData;\r
+  EFI_MISC_GROUP_ITEM_SET_DATA                       MiscGroupItemSetData;\r
+  EFI_MISC_PORTING_DEVICE_TYPE_DATA                  MiscPortingDeviceTypeData;\r
+  EFI_MISC_RESET_CAPABILITIES_DATA                   MiscResetCapablilitiesData;\r
+  EFI_MISC_HARDWARE_SECURITY_SETTINGS_DATA           MiscHardwareSecuritySettingsData;  \r
+  EFI_MISC_SCHEDULED_POWER_ON_MONTH_DATA             MiscScheduledPowerOnMonthData;\r
+  EFI_MISC_VOLTAGE_PROBE_DESCRIPTION_DATA            MiscVoltagePorbeDescriptionData;\r
+  EFI_MISC_COOLING_DEVICE_TEMP_LINK_DATA             MiscCoolingDeviceTempLinkData;\r
+  EFI_MISC_TEMPERATURE_PROBE_DESCRIPTION_DATA        MiscTemperatureProbeDescriptionData;   \r
+  EFI_MISC_ELECTRICAL_CURRENT_PROBE_DESCRIPTION_DATA MiscElectricalCurrentProbeDescriptionData;\r
+  EFI_MISC_REMOTE_ACCESS_MANUFACTURER_DESCRIPTION_DATA\r
+                                                     MiscRemoteAccessManufacturerDescriptionData;\r
+  EFI_MISC_BIS_ENTRY_POINT_DATA                      MiscBisEntryPoint;\r
+  EFI_MISC_BOOT_INFORMATION_STATUS_DATA              MiscBootInformationStatus;\r
+  EFI_MISC_MANAGEMENT_DEVICE_DESCRIPTION_DATA        MiscMangementDeviceDescriptionData;\r
+  EFI_MISC_MANAGEMENT_DEVICE_COMPONENT_DESCRIPTION_DATA\r
+                                                     MiscmangementDeviceComponentDescriptionData;\r
+  EFI_MISC_IPMI_INTERFACE_TYPE_DATA                  MiscIpmiInterfaceTypeData;\r
+  EFI_MISC_SYSTEM_POWER_SUPPLY_DATA                  MiscPowerSupplyInfo;\r
+  EFI_MISC_SMBIOS_STRUCT_ENCAPSULATION_DATA          MiscSmbiosStructEncapsulation;  \r
+} EFI_MISC_SUBCLASS_RECORDS;\r
+\r
+//\r
+//\r
+//\r
+typedef struct {\r
+  EFI_SUBCLASS_TYPE1_HEADER       Header;\r
+  EFI_MISC_SUBCLASS_RECORDS       Record;\r
+} EFI_MISC_SUBCLASS_DRIVER_DATA;\r
+\r
+#pragma pack()\r
+\r
+//\r
+// Sub Class Header type1\r
+//\r
+\r
+#define EFI_SUBCLASS_INSTANCE_RESERVED       0\r
+#define EFI_SUBCLASS_INSTANCE_NON_APPLICABLE 0xFFFF  //16 bit\r
+\r
+#endif\r
+\r
diff --git a/Tools/Source/TianoTools/Include/Common/Dependency.h b/Tools/Source/TianoTools/Include/Common/Dependency.h
new file mode 100644 (file)
index 0000000..744027d
--- /dev/null
@@ -0,0 +1,50 @@
+/** @file\r
+  This module contains data specific to dependency expressions\r
+  and local function prototypes.\r
+\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. This program and the accompanying materials                          \r
+  are licensed and made available under the terms and conditions of the BSD License         \r
+  which accompanies this distribution.  The full text of the license may be found at        \r
+  http://opensource.org/licenses/bsd-license.php                                            \r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+  Module Name:  Dependency.h\r
+\r
+**/\r
+\r
+#ifndef __DEPENDENCY_H__\r
+#define __DEPENDENCY_H__\r
+\r
+/// EFI_DEP_BEFORE       - If present, this must be the first and only opcode\r
+#define EFI_DEP_BEFORE        0x00\r
+\r
+/// EFI_DEP_AFTER        - If present, this must be the first and only opcode\r
+#define EFI_DEP_AFTER         0x01\r
+\r
+#define EFI_DEP_PUSH          0x02\r
+#define EFI_DEP_AND           0x03\r
+#define EFI_DEP_OR            0x04\r
+#define EFI_DEP_NOT           0x05\r
+#define EFI_DEP_TRUE          0x06\r
+#define EFI_DEP_FALSE         0x07\r
+#define EFI_DEP_END           0x08\r
+\r
+/// EFI_DEP_SOR          - If present, this must be the first opcode\r
+#define EFI_DEP_SOR           0x09\r
+\r
+///\r
+/// EFI_DEP_REPLACE_TRUE - Used to dynamically patch the dependecy expression\r
+///                        to save time.  A EFI_DEP_PUSH is evauated one an\r
+///                        replaced with EFI_DEP_REPLACE_TRUE\r
+///\r
+#define EFI_DEP_REPLACE_TRUE  0xff\r
+\r
+///\r
+/// Define the initial size of the dependency expression evaluation stack\r
+///\r
+#define DEPEX_STACK_SIZE_INCREMENT  0x1000\r
+\r
+#endif\r
diff --git a/Tools/Source/TianoTools/Include/Common/EfiImage.h b/Tools/Source/TianoTools/Include/Common/EfiImage.h
new file mode 100644 (file)
index 0000000..ebe251e
--- /dev/null
@@ -0,0 +1,698 @@
+/** @file\r
+  EFI image format for PE32+. Please note some data structures are different\r
+  for IA-32 and Itanium-based images, look for UINTN and the #ifdef EFI_IA64\r
+\r
+  @bug Fix text - doc as defined in MSFT EFI specification.\r
+\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. This program and the accompanying materials                          \r
+  are licensed and made available under the terms and conditions of the BSD License         \r
+  which accompanies this distribution.  The full text of the license may be found at        \r
+  http://opensource.org/licenses/bsd-license.php                                            \r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+  Module Name:  EfiImage.h\r
+\r
+**/\r
+\r
+#ifndef __EFI_IMAGE_H__\r
+#define __EFI_IMAGE_H__\r
+\r
+//\r
+// PE32+ Subsystem type for EFI images\r
+//\r
+#define EFI_IMAGE_SUBSYSTEM_EFI_APPLICATION         10\r
+#define EFI_IMAGE_SUBSYSTEM_EFI_BOOT_SERVICE_DRIVER 11\r
+#define EFI_IMAGE_SUBSYSTEM_EFI_RUNTIME_DRIVER      12\r
+#define EFI_IMAGE_SUBSYSTEM_SAL_RUNTIME_DRIVER      13\r
+\r
+//\r
+// BugBug: Need to get a real answer for this problem. This is not in the\r
+//         PE specification.\r
+//\r
+//         A SAL runtime driver does not get fixed up when a transition to\r
+//         virtual mode is made. In all other cases it should be treated\r
+//         like a EFI_IMAGE_SUBSYSTEM_EFI_RUNTIME_DRIVER image\r
+//\r
+#define EFI_IMAGE_SUBSYSTEM_SAL_RUNTIME_DRIVER  13\r
+\r
+//\r
+// PE32+ Machine type for EFI images\r
+//\r
+#define IMAGE_FILE_MACHINE_I386     0x014c\r
+#define IMAGE_FILE_MACHINE_IA64     0x0200\r
+#define IMAGE_FILE_MACHINE_EBC      0x0EBC\r
+#define IMAGE_FILE_MACHINE_X64      0x8664\r
+//\r
+// Support old names for backward compatible\r
+//\r
+#define EFI_IMAGE_MACHINE_IA32      IMAGE_FILE_MACHINE_I386 \r
+#define EFI_IMAGE_MACHINE_IA64      IMAGE_FILE_MACHINE_IA64  \r
+#define EFI_IMAGE_MACHINE_IPF       IMAGE_FILE_MACHINE_IA64  \r
+#define EFI_IMAGE_MACHINE_EBC       IMAGE_FILE_MACHINE_EBC  \r
+#define EFI_IMAGE_MACHINE_X64       IMAGE_FILE_MACHINE_X64\r
+\r
+#define EFI_IMAGE_DOS_SIGNATURE     0x5A4D      // MZ\r
+#define EFI_IMAGE_OS2_SIGNATURE     0x454E      // NE\r
+#define EFI_IMAGE_OS2_SIGNATURE_LE  0x454C      // LE\r
+#define EFI_IMAGE_NT_SIGNATURE      0x00004550  // PE00\r
+#define EFI_IMAGE_EDOS_SIGNATURE    0x44454550  // PEED\r
+\r
+///\r
+/// PE images can start with an optional DOS header, so if an image is run\r
+///  under DOS it can print an error message.\r
+///\r
+typedef struct {\r
+  UINT16  e_magic;    // Magic number\r
+  UINT16  e_cblp;     // Bytes on last page of file\r
+  UINT16  e_cp;       // Pages in file\r
+  UINT16  e_crlc;     // Relocations\r
+  UINT16  e_cparhdr;  // Size of header in paragraphs\r
+  UINT16  e_minalloc; // Minimum extra paragraphs needed\r
+  UINT16  e_maxalloc; // Maximum extra paragraphs needed\r
+  UINT16  e_ss;       // Initial (relative) SS value\r
+  UINT16  e_sp;       // Initial SP value\r
+  UINT16  e_csum;     // Checksum\r
+  UINT16  e_ip;       // Initial IP value\r
+  UINT16  e_cs;       // Initial (relative) CS value\r
+  UINT16  e_lfarlc;   // File address of relocation table\r
+  UINT16  e_ovno;     // Overlay number\r
+  UINT16  e_res[4];   // Reserved words\r
+  UINT16  e_oemid;    // OEM identifier (for e_oeminfo)\r
+  UINT16  e_oeminfo;  // OEM information; e_oemid specific\r
+  UINT16  e_res2[10]; // Reserved words\r
+  UINT32  e_lfanew;   // File address of new exe header\r
+} EFI_IMAGE_DOS_HEADER;\r
+\r
+///\r
+/// File header format.\r
+///\r
+typedef struct {\r
+  UINT16  Machine;\r
+  UINT16  NumberOfSections;\r
+  UINT32  TimeDateStamp;\r
+  UINT32  PointerToSymbolTable;\r
+  UINT32  NumberOfSymbols;\r
+  UINT16  SizeOfOptionalHeader;\r
+  UINT16  Characteristics;\r
+} EFI_IMAGE_FILE_HEADER;\r
+\r
+#define EFI_IMAGE_SIZEOF_FILE_HEADER        20\r
+\r
+#define EFI_IMAGE_FILE_RELOCS_STRIPPED      0x0001  // Relocation info stripped from file.\r
+#define EFI_IMAGE_FILE_EXECUTABLE_IMAGE     0x0002  // File is executable  (i.e. no unresolved externel references).\r
+#define EFI_IMAGE_FILE_LINE_NUMS_STRIPPED   0x0004  // Line nunbers stripped from file.\r
+#define EFI_IMAGE_FILE_LOCAL_SYMS_STRIPPED  0x0008  // Local symbols stripped from file.\r
+#define EFI_IMAGE_FILE_BYTES_REVERSED_LO    0x0080  // Bytes of machine word are reversed.\r
+#define EFI_IMAGE_FILE_32BIT_MACHINE        0x0100  // 32 bit word machine.\r
+#define EFI_IMAGE_FILE_DEBUG_STRIPPED       0x0200  // Debugging info stripped from file in .DBG file\r
+#define EFI_IMAGE_FILE_SYSTEM               0x1000  // System File.\r
+#define EFI_IMAGE_FILE_DLL                  0x2000  // File is a DLL.\r
+#define EFI_IMAGE_FILE_BYTES_REVERSED_HI    0x8000  // Bytes of machine word are reversed.\r
+#define EFI_IMAGE_FILE_MACHINE_UNKNOWN      0\r
+#define EFI_IMAGE_FILE_MACHINE_I386         0x14c   // Intel 386.\r
+#define EFI_IMAGE_FILE_MACHINE_R3000        0x162   // MIPS* little-endian, 0540 big-endian\r
+#define EFI_IMAGE_FILE_MACHINE_R4000        0x166   // MIPS* little-endian\r
+#define EFI_IMAGE_FILE_MACHINE_ALPHA        0x184   // Alpha_AXP*\r
+#define EFI_IMAGE_FILE_MACHINE_POWERPC      0x1F0   // IBM* PowerPC Little-Endian\r
+#define EFI_IMAGE_FILE_MACHINE_TAHOE        0x7cc   // Intel EM machine\r
+//\r
+// * Other names and brands may be claimed as the property of others.\r
+//\r
+\r
+///\r
+/// Directory format.\r
+///\r
+typedef struct {\r
+  UINT32  VirtualAddress;\r
+  UINT32  Size;\r
+} EFI_IMAGE_DATA_DIRECTORY;\r
+\r
+#define EFI_IMAGE_NUMBER_OF_DIRECTORY_ENTRIES 16\r
+\r
+typedef struct {\r
+  UINT16  Magic;\r
+  UINT8   MajorLinkerVersion;\r
+  UINT8   MinorLinkerVersion;\r
+  UINT32  SizeOfCode;\r
+  UINT32  SizeOfInitializedData;\r
+  UINT32  SizeOfUninitializedData;\r
+  UINT32  AddressOfEntryPoint;\r
+  UINT32  BaseOfCode;\r
+  UINT32  BaseOfData;\r
+  UINT32  BaseOfBss;\r
+  UINT32  GprMask;\r
+  UINT32  CprMask[4];\r
+  UINT32  GpValue;\r
+} EFI_IMAGE_ROM_OPTIONAL_HEADER;\r
+\r
+#define EFI_IMAGE_ROM_OPTIONAL_HDR_MAGIC      0x107\r
+#define EFI_IMAGE_SIZEOF_ROM_OPTIONAL_HEADER  sizeof (EFI_IMAGE_ROM_OPTIONAL_HEADER)\r
+\r
+typedef struct {\r
+  EFI_IMAGE_FILE_HEADER         FileHeader;\r
+  EFI_IMAGE_ROM_OPTIONAL_HEADER OptionalHeader;\r
+} EFI_IMAGE_ROM_HEADERS;\r
+\r
+///\r
+/// @attention\r
+/// EFI_IMAGE_OPTIONAL_HEADER32 and EFI_IMAGE_OPTIONAL_HEADER64\r
+/// are for use ONLY by tools.  All proper EFI code MUST use\r
+/// EFI_IMAGE_OPTIONAL_HEADER ONLY!!!\r
+///\r
+#define EFI_IMAGE_NT_OPTIONAL_HDR32_MAGIC 0x10b\r
+\r
+typedef struct {\r
+  //\r
+  // Standard fields.\r
+  //\r
+  UINT16                    Magic;\r
+  UINT8                     MajorLinkerVersion;\r
+  UINT8                     MinorLinkerVersion;\r
+  UINT32                    SizeOfCode;\r
+  UINT32                    SizeOfInitializedData;\r
+  UINT32                    SizeOfUninitializedData;\r
+  UINT32                    AddressOfEntryPoint;\r
+  UINT32                    BaseOfCode;\r
+  UINT32                    BaseOfData;\r
+  //\r
+  // NT additional fields.\r
+  //\r
+  UINT32                    ImageBase;\r
+  UINT32                    SectionAlignment;\r
+  UINT32                    FileAlignment;\r
+  UINT16                    MajorOperatingSystemVersion;\r
+  UINT16                    MinorOperatingSystemVersion;\r
+  UINT16                    MajorImageVersion;\r
+  UINT16                    MinorImageVersion;\r
+  UINT16                    MajorSubsystemVersion;\r
+  UINT16                    MinorSubsystemVersion;\r
+  UINT32                    Win32VersionValue;\r
+  UINT32                    SizeOfImage;\r
+  UINT32                    SizeOfHeaders;\r
+  UINT32                    CheckSum;\r
+  UINT16                    Subsystem;\r
+  UINT16                    DllCharacteristics;\r
+  UINT32                    SizeOfStackReserve;\r
+  UINT32                    SizeOfStackCommit;\r
+  UINT32                    SizeOfHeapReserve;\r
+  UINT32                    SizeOfHeapCommit;\r
+  UINT32                    LoaderFlags;\r
+  UINT32                    NumberOfRvaAndSizes;\r
+  EFI_IMAGE_DATA_DIRECTORY  DataDirectory[EFI_IMAGE_NUMBER_OF_DIRECTORY_ENTRIES];\r
+} EFI_IMAGE_OPTIONAL_HEADER32;\r
+\r
+///\r
+/// @attention\r
+/// EFI_IMAGE_OPTIONAL_HEADER32 and EFI_IMAGE_OPTIONAL_HEADER64\r
+/// are for use ONLY by tools.  All proper EFI code MUST use\r
+/// EFI_IMAGE_OPTIONAL_HEADER ONLY!!!\r
+///\r
+#define EFI_IMAGE_NT_OPTIONAL_HDR64_MAGIC 0x20b\r
+\r
+typedef struct {\r
+  //\r
+  // Standard fields.\r
+  //\r
+  UINT16                    Magic;\r
+  UINT8                     MajorLinkerVersion;\r
+  UINT8                     MinorLinkerVersion;\r
+  UINT32                    SizeOfCode;\r
+  UINT32                    SizeOfInitializedData;\r
+  UINT32                    SizeOfUninitializedData;\r
+  UINT32                    AddressOfEntryPoint;\r
+  UINT32                    BaseOfCode;\r
+  //\r
+  // NT additional fields.\r
+  //\r
+  UINT64                    ImageBase;\r
+  UINT32                    SectionAlignment;\r
+  UINT32                    FileAlignment;\r
+  UINT16                    MajorOperatingSystemVersion;\r
+  UINT16                    MinorOperatingSystemVersion;\r
+  UINT16                    MajorImageVersion;\r
+  UINT16                    MinorImageVersion;\r
+  UINT16                    MajorSubsystemVersion;\r
+  UINT16                    MinorSubsystemVersion;\r
+  UINT32                    Win32VersionValue;\r
+  UINT32                    SizeOfImage;\r
+  UINT32                    SizeOfHeaders;\r
+  UINT32                    CheckSum;\r
+  UINT16                    Subsystem;\r
+  UINT16                    DllCharacteristics;\r
+  UINT64                    SizeOfStackReserve;\r
+  UINT64                    SizeOfStackCommit;\r
+  UINT64                    SizeOfHeapReserve;\r
+  UINT64                    SizeOfHeapCommit;\r
+  UINT32                    LoaderFlags;\r
+  UINT32                    NumberOfRvaAndSizes;\r
+  EFI_IMAGE_DATA_DIRECTORY  DataDirectory[EFI_IMAGE_NUMBER_OF_DIRECTORY_ENTRIES];\r
+} EFI_IMAGE_OPTIONAL_HEADER64;\r
+\r
+///\r
+/// @attention\r
+/// EFI_IMAGE_NT_HEADERS32 and EFI_IMAGE_HEADERS64 are for use ONLY\r
+/// by tools.  All proper EFI code MUST use EFI_IMAGE_NT_HEADERS ONLY!!!\r
+///\r
+typedef struct {\r
+  UINT32                      Signature;\r
+  EFI_IMAGE_FILE_HEADER       FileHeader;\r
+  EFI_IMAGE_OPTIONAL_HEADER32 OptionalHeader;\r
+} EFI_IMAGE_NT_HEADERS32;\r
+\r
+#define EFI_IMAGE_SIZEOF_NT_OPTIONAL32_HEADER sizeof (EFI_IMAGE_NT_HEADERS32)\r
+\r
+typedef struct {\r
+  UINT32                      Signature;\r
+  EFI_IMAGE_FILE_HEADER       FileHeader;\r
+  EFI_IMAGE_OPTIONAL_HEADER64 OptionalHeader;\r
+} EFI_IMAGE_NT_HEADERS64;\r
+\r
+#define EFI_IMAGE_SIZEOF_NT_OPTIONAL64_HEADER sizeof (EFI_IMAGE_NT_HEADERS64)\r
+\r
+//\r
+// Processor specific definition of EFI_IMAGE_OPTIONAL_HEADER so the\r
+// type name EFI_IMAGE_OPTIONAL_HEADER is appropriate to the build.  Same for\r
+// EFI_IMAGE_NT_HEADERS.  These definitions MUST be used by ALL EFI code.\r
+//\r
+#if   defined (MDE_CPU_IA32)\r
+\r
+typedef EFI_IMAGE_OPTIONAL_HEADER32     EFI_IMAGE_OPTIONAL_HEADER;\r
+typedef EFI_IMAGE_NT_HEADERS32          EFI_IMAGE_NT_HEADERS;\r
+\r
+#define EFI_IMAGE_NT_OPTIONAL_HDR_MAGIC EFI_IMAGE_NT_OPTIONAL_HDR32_MAGIC\r
+#define EFI_IMAGE_MACHINE_TYPE_SUPPORTED(Machine) \\r
+  (((Machine) == EFI_IMAGE_MACHINE_IA32) || ((Machine) == EFI_IMAGE_MACHINE_EBC))\r
+\r
+#elif defined (MDE_CPU_IPF)\r
+\r
+typedef EFI_IMAGE_OPTIONAL_HEADER64     EFI_IMAGE_OPTIONAL_HEADER;\r
+typedef EFI_IMAGE_NT_HEADERS64          EFI_IMAGE_NT_HEADERS;\r
+\r
+#define EFI_IMAGE_NT_OPTIONAL_HDR_MAGIC EFI_IMAGE_NT_OPTIONAL_HDR64_MAGIC\r
+#define EFI_IMAGE_MACHINE_TYPE_SUPPORTED(Machine) \\r
+  (((Machine) == EFI_IMAGE_MACHINE_IPF) || ((Machine) == EFI_IMAGE_MACHINE_EBC))\r
+\r
+#elif defined (MDE_CPU_X64)\r
+\r
+typedef EFI_IMAGE_OPTIONAL_HEADER64     EFI_IMAGE_OPTIONAL_HEADER;\r
+typedef EFI_IMAGE_NT_HEADERS64          EFI_IMAGE_NT_HEADERS;\r
+\r
+#define EFI_IMAGE_NT_OPTIONAL_HDR_MAGIC EFI_IMAGE_NT_OPTIONAL_HDR64_MAGIC\r
+#define EFI_IMAGE_MACHINE_TYPE_SUPPORTED(Machine) \\r
+  (((Machine) == EFI_IMAGE_MACHINE_X64) || ((Machine) == EFI_IMAGE_MACHINE_EBC))\r
+\r
+#elif defined (MDE_CPU_EBC)\r
+\r
+//\r
+// This is just to make sure you can cross compile with the EBC compiiler.\r
+// It does not make sense to have a PE loader coded in EBC. You need to \r
+// understand the basic \r
+//\r
+typedef EFI_IMAGE_OPTIONAL_HEADER64     EFI_IMAGE_OPTIONAL_HEADER;\r
+typedef EFI_IMAGE_NT_HEADERS64          EFI_IMAGE_NT_HEADERS;\r
+\r
+#define EFI_IMAGE_NT_OPTIONAL_HDR_MAGIC EFI_IMAGE_NT_OPTIONAL_HDR64_MAGIC\r
+#define EFI_IMAGE_MACHINE_TYPE_SUPPORTED(Machine) ((Machine) == EFI_IMAGE_MACHINE_EBC)\r
+\r
+#else\r
+#error Unknown Processor Type\r
+#endif\r
+\r
+\r
+#define EFI_IMAGE_FIRST_SECTION(ntheader) \\r
+    ( \\r
+      (EFI_IMAGE_SECTION_HEADER *) \\r
+        ( \\r
+          (UINT32) ntheader + \\r
+          FIELD_OFFSET (EFI_IMAGE_NT_HEADERS, OptionalHeader) + \\r
+          ((EFI_IMAGE_NT_HEADERS *) (ntheader))->FileHeader.SizeOfOptionalHeader \\r
+        ) \\r
+    )\r
+\r
+//\r
+// Subsystem Values\r
+//\r
+#define EFI_IMAGE_SUBSYSTEM_UNKNOWN     0\r
+#define EFI_IMAGE_SUBSYSTEM_NATIVE      1\r
+#define EFI_IMAGE_SUBSYSTEM_WINDOWS_GUI 2\r
+#define EFI_IMAGE_SUBSYSTEM_WINDOWS_CUI 3.\r
+#define EFI_IMAGE_SUBSYSTEM_OS2_CUI     5\r
+#define EFI_IMAGE_SUBSYSTEM_POSIX_CUI   7\r
+\r
+//\r
+// Directory Entries\r
+//\r
+#define EFI_IMAGE_DIRECTORY_ENTRY_EXPORT      0\r
+#define EFI_IMAGE_DIRECTORY_ENTRY_IMPORT      1\r
+#define EFI_IMAGE_DIRECTORY_ENTRY_RESOURCE    2\r
+#define EFI_IMAGE_DIRECTORY_ENTRY_EXCEPTION   3\r
+#define EFI_IMAGE_DIRECTORY_ENTRY_SECURITY    4\r
+#define EFI_IMAGE_DIRECTORY_ENTRY_BASERELOC   5\r
+#define EFI_IMAGE_DIRECTORY_ENTRY_DEBUG       6\r
+#define EFI_IMAGE_DIRECTORY_ENTRY_COPYRIGHT   7\r
+#define EFI_IMAGE_DIRECTORY_ENTRY_GLOBALPTR   8\r
+#define EFI_IMAGE_DIRECTORY_ENTRY_TLS         9\r
+#define EFI_IMAGE_DIRECTORY_ENTRY_LOAD_CONFIG 10\r
+\r
+//\r
+// Section header format.\r
+//\r
+#define EFI_IMAGE_SIZEOF_SHORT_NAME 8\r
+\r
+typedef struct {\r
+  UINT8 Name[EFI_IMAGE_SIZEOF_SHORT_NAME];\r
+  union {\r
+    UINT32  PhysicalAddress;\r
+    UINT32  VirtualSize;\r
+  } Misc;\r
+  UINT32  VirtualAddress;\r
+  UINT32  SizeOfRawData;\r
+  UINT32  PointerToRawData;\r
+  UINT32  PointerToRelocations;\r
+  UINT32  PointerToLinenumbers;\r
+  UINT16  NumberOfRelocations;\r
+  UINT16  NumberOfLinenumbers;\r
+  UINT32  Characteristics;\r
+} EFI_IMAGE_SECTION_HEADER;\r
+\r
+#define EFI_IMAGE_SIZEOF_SECTION_HEADER       40\r
+\r
+#define EFI_IMAGE_SCN_TYPE_NO_PAD             0x00000008  // Reserved.\r
+#define EFI_IMAGE_SCN_CNT_CODE                0x00000020\r
+#define EFI_IMAGE_SCN_CNT_INITIALIZED_DATA    0x00000040\r
+#define EFI_IMAGE_SCN_CNT_UNINITIALIZED_DATA  0x00000080\r
+\r
+#define EFI_IMAGE_SCN_LNK_OTHER               0x00000100  // Reserved.\r
+#define EFI_IMAGE_SCN_LNK_INFO                0x00000200  // Section contains comments or some other type of information.\r
+#define EFI_IMAGE_SCN_LNK_REMOVE              0x00000800  // Section contents will not become part of image.\r
+#define EFI_IMAGE_SCN_LNK_COMDAT              0x00001000\r
+\r
+#define EFI_IMAGE_SCN_ALIGN_1BYTES            0x00100000\r
+#define EFI_IMAGE_SCN_ALIGN_2BYTES            0x00200000\r
+#define EFI_IMAGE_SCN_ALIGN_4BYTES            0x00300000\r
+#define EFI_IMAGE_SCN_ALIGN_8BYTES            0x00400000\r
+#define EFI_IMAGE_SCN_ALIGN_16BYTES           0x00500000\r
+#define EFI_IMAGE_SCN_ALIGN_32BYTES           0x00600000\r
+#define EFI_IMAGE_SCN_ALIGN_64BYTES           0x00700000\r
+\r
+#define EFI_IMAGE_SCN_MEM_DISCARDABLE         0x02000000\r
+#define EFI_IMAGE_SCN_MEM_NOT_CACHED          0x04000000\r
+#define EFI_IMAGE_SCN_MEM_NOT_PAGED           0x08000000\r
+#define EFI_IMAGE_SCN_MEM_SHARED              0x10000000\r
+#define EFI_IMAGE_SCN_MEM_EXECUTE             0x20000000\r
+#define EFI_IMAGE_SCN_MEM_READ                0x40000000\r
+#define EFI_IMAGE_SCN_MEM_WRITE               0x80000000\r
+\r
+///\r
+/// Symbol format.\r
+///\r
+#define EFI_IMAGE_SIZEOF_SYMBOL 18\r
+\r
+//\r
+// Section values.\r
+//\r
+// Symbols have a section number of the section in which they are\r
+// defined. Otherwise, section numbers have the following meanings:\r
+//\r
+#define EFI_IMAGE_SYM_UNDEFINED (UINT16) 0  // Symbol is undefined or is common.\r
+#define EFI_IMAGE_SYM_ABSOLUTE  (UINT16) -1 // Symbol is an absolute value.\r
+#define EFI_IMAGE_SYM_DEBUG     (UINT16) -2 // Symbol is a special debug item.\r
+//\r
+// Type (fundamental) values.\r
+//\r
+#define EFI_IMAGE_SYM_TYPE_NULL   0   // no type.\r
+#define EFI_IMAGE_SYM_TYPE_VOID   1   //\r
+#define EFI_IMAGE_SYM_TYPE_CHAR   2   // type character.\r
+#define EFI_IMAGE_SYM_TYPE_SHORT  3   // type short integer.\r
+#define EFI_IMAGE_SYM_TYPE_INT    4\r
+#define EFI_IMAGE_SYM_TYPE_LONG   5\r
+#define EFI_IMAGE_SYM_TYPE_FLOAT  6\r
+#define EFI_IMAGE_SYM_TYPE_DOUBLE 7\r
+#define EFI_IMAGE_SYM_TYPE_STRUCT 8\r
+#define EFI_IMAGE_SYM_TYPE_UNION  9\r
+#define EFI_IMAGE_SYM_TYPE_ENUM   10  // enumeration.\r
+#define EFI_IMAGE_SYM_TYPE_MOE    11  // member of enumeration.\r
+#define EFI_IMAGE_SYM_TYPE_BYTE   12\r
+#define EFI_IMAGE_SYM_TYPE_WORD   13\r
+#define EFI_IMAGE_SYM_TYPE_UINT   14\r
+#define EFI_IMAGE_SYM_TYPE_DWORD  15\r
+\r
+//\r
+// Type (derived) values.\r
+//\r
+#define EFI_IMAGE_SYM_DTYPE_NULL      0 // no derived type.\r
+#define EFI_IMAGE_SYM_DTYPE_POINTER   1\r
+#define EFI_IMAGE_SYM_DTYPE_FUNCTION  2\r
+#define EFI_IMAGE_SYM_DTYPE_ARRAY     3\r
+\r
+//\r
+// Storage classes.\r
+//\r
+#define EFI_IMAGE_SYM_CLASS_END_OF_FUNCTION   (UINT8) -1\r
+#define EFI_IMAGE_SYM_CLASS_NULL              0\r
+#define EFI_IMAGE_SYM_CLASS_AUTOMATIC         1\r
+#define EFI_IMAGE_SYM_CLASS_EXTERNAL          2\r
+#define EFI_IMAGE_SYM_CLASS_STATIC            3\r
+#define EFI_IMAGE_SYM_CLASS_REGISTER          4\r
+#define EFI_IMAGE_SYM_CLASS_EXTERNAL_DEF      5\r
+#define EFI_IMAGE_SYM_CLASS_LABEL             6\r
+#define EFI_IMAGE_SYM_CLASS_UNDEFINED_LABEL   7\r
+#define EFI_IMAGE_SYM_CLASS_MEMBER_OF_STRUCT  8\r
+#define EFI_IMAGE_SYM_CLASS_ARGUMENT          9\r
+#define EFI_IMAGE_SYM_CLASS_STRUCT_TAG        10\r
+#define EFI_IMAGE_SYM_CLASS_MEMBER_OF_UNION   11\r
+#define EFI_IMAGE_SYM_CLASS_UNION_TAG         12\r
+#define EFI_IMAGE_SYM_CLASS_TYPE_DEFINITION   13\r
+#define EFI_IMAGE_SYM_CLASS_UNDEFINED_STATIC  14\r
+#define EFI_IMAGE_SYM_CLASS_ENUM_TAG          15\r
+#define EFI_IMAGE_SYM_CLASS_MEMBER_OF_ENUM    16\r
+#define EFI_IMAGE_SYM_CLASS_REGISTER_PARAM    17\r
+#define EFI_IMAGE_SYM_CLASS_BIT_FIELD         18\r
+#define EFI_IMAGE_SYM_CLASS_BLOCK             100\r
+#define EFI_IMAGE_SYM_CLASS_FUNCTION          101\r
+#define EFI_IMAGE_SYM_CLASS_END_OF_STRUCT     102\r
+#define EFI_IMAGE_SYM_CLASS_FILE              103\r
+#define EFI_IMAGE_SYM_CLASS_SECTION           104\r
+#define EFI_IMAGE_SYM_CLASS_WEAK_EXTERNAL     105\r
+\r
+//\r
+// type packing constants\r
+//\r
+#define EFI_IMAGE_N_BTMASK  017\r
+#define EFI_IMAGE_N_TMASK   060\r
+#define EFI_IMAGE_N_TMASK1  0300\r
+#define EFI_IMAGE_N_TMASK2  0360\r
+#define EFI_IMAGE_N_BTSHFT  4\r
+#define EFI_IMAGE_N_TSHIFT  2\r
+\r
+//\r
+// Communal selection types.\r
+//\r
+#define EFI_IMAGE_COMDAT_SELECT_NODUPLICATES    1\r
+#define EFI_IMAGE_COMDAT_SELECT_ANY             2\r
+#define EFI_IMAGE_COMDAT_SELECT_SAME_SIZE       3\r
+#define EFI_IMAGE_COMDAT_SELECT_EXACT_MATCH     4\r
+#define EFI_IMAGE_COMDAT_SELECT_ASSOCIATIVE     5\r
+\r
+#define EFI_IMAGE_WEAK_EXTERN_SEARCH_NOLIBRARY  1\r
+#define EFI_IMAGE_WEAK_EXTERN_SEARCH_LIBRARY    2\r
+#define EFI_IMAGE_WEAK_EXTERN_SEARCH_ALIAS      3\r
+\r
+///\r
+/// Relocation format.\r
+///\r
+typedef struct {\r
+  UINT32  VirtualAddress;\r
+  UINT32  SymbolTableIndex;\r
+  UINT16  Type;\r
+} EFI_IMAGE_RELOCATION;\r
+\r
+#define EFI_IMAGE_SIZEOF_RELOCATION 10\r
+\r
+//\r
+// I386 relocation types.\r
+//\r
+#define EFI_IMAGE_REL_I386_ABSOLUTE 0   // Reference is absolute, no relocation is necessary\r
+#define EFI_IMAGE_REL_I386_DIR16    01  // Direct 16-bit reference to the symbols virtual address\r
+#define EFI_IMAGE_REL_I386_REL16    02  // PC-relative 16-bit reference to the symbols virtual address\r
+#define EFI_IMAGE_REL_I386_DIR32    06  // Direct 32-bit reference to the symbols virtual address\r
+#define EFI_IMAGE_REL_I386_DIR32NB  07  // Direct 32-bit reference to the symbols virtual address, base not included\r
+#define EFI_IMAGE_REL_I386_SEG12    011 // Direct 16-bit reference to the segment-selector bits of a 32-bit virtual address\r
+#define EFI_IMAGE_REL_I386_SECTION  012\r
+#define EFI_IMAGE_REL_I386_SECREL   013\r
+#define EFI_IMAGE_REL_I386_REL32    024 // PC-relative 32-bit reference to the symbols virtual address\r
+\r
+///\r
+/// Based relocation format.\r
+///\r
+typedef struct {\r
+  UINT32  VirtualAddress;\r
+  UINT32  SizeOfBlock;\r
+} EFI_IMAGE_BASE_RELOCATION;\r
+\r
+#define EFI_IMAGE_SIZEOF_BASE_RELOCATION  8\r
+\r
+//\r
+// Based relocation types.\r
+//\r
+#define EFI_IMAGE_REL_BASED_ABSOLUTE      0\r
+#define EFI_IMAGE_REL_BASED_HIGH          1\r
+#define EFI_IMAGE_REL_BASED_LOW           2\r
+#define EFI_IMAGE_REL_BASED_HIGHLOW       3\r
+#define EFI_IMAGE_REL_BASED_HIGHADJ       4\r
+#define EFI_IMAGE_REL_BASED_MIPS_JMPADDR  5\r
+#define EFI_IMAGE_REL_BASED_IA64_IMM64    9\r
+#define EFI_IMAGE_REL_BASED_DIR64         10\r
+\r
+///\r
+/// Line number format.\r
+///\r
+typedef struct {\r
+  union {\r
+    UINT32  SymbolTableIndex; // Symbol table index of function name if Linenumber is 0.\r
+    UINT32  VirtualAddress;   // Virtual address of line number.\r
+  } Type;\r
+  UINT16  Linenumber;         // Line number.\r
+} EFI_IMAGE_LINENUMBER;\r
+\r
+#define EFI_IMAGE_SIZEOF_LINENUMBER 6\r
+\r
+//\r
+// Archive format.\r
+//\r
+#define EFI_IMAGE_ARCHIVE_START_SIZE        8\r
+#define EFI_IMAGE_ARCHIVE_START             "!<arch>\n"\r
+#define EFI_IMAGE_ARCHIVE_END               "`\n"\r
+#define EFI_IMAGE_ARCHIVE_PAD               "\n"\r
+#define EFI_IMAGE_ARCHIVE_LINKER_MEMBER     "/               "\r
+#define EFI_IMAGE_ARCHIVE_LONGNAMES_MEMBER  "//              "\r
+\r
+typedef struct {\r
+  UINT8 Name[16];     // File member name - `/' terminated.\r
+  UINT8 Date[12];     // File member date - decimal.\r
+  UINT8 UserID[6];    // File member user id - decimal.\r
+  UINT8 GroupID[6];   // File member group id - decimal.\r
+  UINT8 Mode[8];      // File member mode - octal.\r
+  UINT8 Size[10];     // File member size - decimal.\r
+  UINT8 EndHeader[2]; // String to end header.\r
+} EFI_IMAGE_ARCHIVE_MEMBER_HEADER;\r
+\r
+#define EFI_IMAGE_SIZEOF_ARCHIVE_MEMBER_HDR 60\r
+\r
+//\r
+// DLL support.\r
+//\r
+\r
+///\r
+/// DLL Export Format\r
+///\r
+typedef struct {\r
+  UINT32  Characteristics;\r
+  UINT32  TimeDateStamp;\r
+  UINT16  MajorVersion;\r
+  UINT16  MinorVersion;\r
+  UINT32  Name;\r
+  UINT32  Base;\r
+  UINT32  NumberOfFunctions;\r
+  UINT32  NumberOfNames;\r
+  UINT32  AddressOfFunctions;\r
+  UINT32  AddressOfNames;\r
+  UINT32  AddressOfNameOrdinals;\r
+} EFI_IMAGE_EXPORT_DIRECTORY;\r
+\r
+///\r
+/// DLL support.\r
+/// Import Format\r
+///\r
+typedef struct {\r
+  UINT16  Hint;\r
+  UINT8   Name[1];\r
+} EFI_IMAGE_IMPORT_BY_NAME;\r
+\r
+typedef struct {\r
+  union {\r
+    UINT32                    Function;\r
+    UINT32                    Ordinal;\r
+    EFI_IMAGE_IMPORT_BY_NAME  *AddressOfData;\r
+  } u1;\r
+} EFI_IMAGE_THUNK_DATA;\r
+\r
+#define EFI_IMAGE_ORDINAL_FLAG              0x80000000\r
+#define EFI_IMAGE_SNAP_BY_ORDINAL(Ordinal)  ((Ordinal & EFI_IMAGE_ORDINAL_FLAG) != 0)\r
+#define EFI_IMAGE_ORDINAL(Ordinal)          (Ordinal & 0xffff)\r
+\r
+typedef struct {\r
+  UINT32                Characteristics;\r
+  UINT32                TimeDateStamp;\r
+  UINT32                ForwarderChain;\r
+  UINT32                Name;\r
+  EFI_IMAGE_THUNK_DATA  *FirstThunk;\r
+} EFI_IMAGE_IMPORT_DESCRIPTOR;\r
+\r
+///\r
+/// Debug Format\r
+///\r
+#define EFI_IMAGE_DEBUG_TYPE_CODEVIEW 2\r
+\r
+typedef struct {\r
+  UINT32  Characteristics;\r
+  UINT32  TimeDateStamp;\r
+  UINT16  MajorVersion;\r
+  UINT16  MinorVersion;\r
+  UINT32  Type;\r
+  UINT32  SizeOfData;\r
+  UINT32  RVA;\r
+  UINT32  FileOffset;\r
+} EFI_IMAGE_DEBUG_DIRECTORY_ENTRY;\r
+\r
+#define CODEVIEW_SIGNATURE_NB10 0x3031424E  // "NB10"\r
+typedef struct {\r
+  UINT32  Signature;                        // "NB10"\r
+  UINT32  Unknown;\r
+  UINT32  Unknown2;\r
+  UINT32  Unknown3;\r
+  //\r
+  // Filename of .PDB goes here\r
+  //\r
+} EFI_IMAGE_DEBUG_CODEVIEW_NB10_ENTRY;\r
+\r
+#define CODEVIEW_SIGNATURE_RSDS 0x53445352  // "RSDS"\r
+typedef struct {\r
+  UINT32  Signature;                        // "RSDS"\r
+  UINT32  Unknown;\r
+  UINT32  Unknown2;\r
+  UINT32  Unknown3;\r
+  UINT32  Unknown4;\r
+  UINT32  Unknown5;\r
+  //\r
+  // Filename of .PDB goes here\r
+  //\r
+} EFI_IMAGE_DEBUG_CODEVIEW_RSDS_ENTRY;\r
+\r
+///\r
+/// Header format for TE images\r
+///\r
+typedef struct {\r
+  UINT16                    Signature;            // signature for TE format = "VZ"\r
+  UINT16                    Machine;              // from the original file header\r
+  UINT8                     NumberOfSections;     // from the original file header\r
+  UINT8                     Subsystem;            // from original optional header\r
+  UINT16                    StrippedSize;         // how many bytes we removed from the header\r
+  UINT32                    AddressOfEntryPoint;  // offset to entry point -- from original optional header\r
+  UINT32                    BaseOfCode;           // from original image -- required for ITP debug\r
+  UINT64                    ImageBase;            // from original file header\r
+  EFI_IMAGE_DATA_DIRECTORY  DataDirectory[2];     // only base relocation and debug directory\r
+} EFI_TE_IMAGE_HEADER;\r
+\r
+#define EFI_TE_IMAGE_HEADER_SIGNATURE 0x5A56      // "VZ"\r
+\r
+//\r
+// Data directory indexes in our TE image header\r
+//\r
+#define EFI_TE_IMAGE_DIRECTORY_ENTRY_BASERELOC  0\r
+#define EFI_TE_IMAGE_DIRECTORY_ENTRY_DEBUG      1\r
+\r
+#endif\r
diff --git a/Tools/Source/TianoTools/Include/Common/FirmwareFileSystem.h b/Tools/Source/TianoTools/Include/Common/FirmwareFileSystem.h
new file mode 100644 (file)
index 0000000..5678a95
--- /dev/null
@@ -0,0 +1,98 @@
+/** @file\r
+  This file defines the data structures that comprise the FFS file system.\r
+\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. This program and the accompanying materials                          \r
+  are licensed and made available under the terms and conditions of the BSD License         \r
+  which accompanies this distribution.  The full text of the license may be found at        \r
+  http://opensource.org/licenses/bsd-license.php                                            \r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+  Module Name:  FirmwareFileSystem.h\r
+\r
+  @par Revision Reference:\r
+  These definitions are from Firmware File System Spec 0.9.\r
+\r
+**/\r
+\r
+#ifndef __EFI_FFS_FILE_SYSTEM_H__\r
+#define __EFI_FFS_FILE_SYSTEM_H__\r
+\r
+///\r
+/// FFS specific file types\r
+///\r
+#define EFI_FV_FILETYPE_FFS_PAD 0xF0\r
+\r
+//\r
+// FFS File Attributes\r
+//\r
+#define FFS_ATTRIB_TAIL_PRESENT     0x01\r
+#define FFS_ATTRIB_RECOVERY         0x02\r
+#define FFS_ATTRIB_HEADER_EXTENSION 0x04\r
+#define FFS_ATTRIB_DATA_ALIGNMENT   0x38\r
+#define FFS_ATTRIB_CHECKSUM         0x40\r
+\r
+///\r
+/// FFS_FIXED_CHECKSUM is the default checksum value used when the\r
+/// FFS_ATTRIB_CHECKSUM attribute bit is clear\r
+/// note this is NOT an architecturally defined value, but is in this file for\r
+/// implementation convenience\r
+///\r
+#define FFS_FIXED_CHECKSUM  0x5A\r
+\r
+//\r
+// File state definitions\r
+//\r
+#define EFI_FILE_HEADER_CONSTRUCTION  0x01\r
+#define EFI_FILE_HEADER_VALID         0x02\r
+#define EFI_FILE_DATA_VALID           0x04\r
+#define EFI_FILE_MARKED_FOR_UPDATE    0x08\r
+#define EFI_FILE_DELETED              0x10\r
+#define EFI_FILE_HEADER_INVALID       0x20\r
+\r
+#define EFI_FILE_ALL_STATE_BITS       (EFI_FILE_HEADER_CONSTRUCTION | \\r
+                                 EFI_FILE_HEADER_VALID | \\r
+                                 EFI_FILE_DATA_VALID | \\r
+                                 EFI_FILE_MARKED_FOR_UPDATE | \\r
+                                 EFI_FILE_DELETED | \\r
+                                 EFI_FILE_HEADER_INVALID \\r
+          )\r
+\r
+#define EFI_TEST_FFS_ATTRIBUTES_BIT(FvbAttributes, TestAttributes, Bit) \\r
+    ( \\r
+      (BOOLEAN) ( \\r
+          (FvbAttributes & EFI_FVB_ERASE_POLARITY) ? (((~TestAttributes) & Bit) == Bit) : ((TestAttributes & Bit) == Bit) \\r
+        ) \\r
+    )\r
+\r
+typedef UINT16  EFI_FFS_FILE_TAIL;\r
+\r
+///\r
+/// FFS file integrity check structure\r
+///\r
+typedef union {\r
+  struct {\r
+    UINT8 Header;\r
+    UINT8 File;\r
+  } Checksum;\r
+  UINT16  TailReference;\r
+} EFI_FFS_INTEGRITY_CHECK;\r
+\r
+//\r
+// FFS file header definition\r
+//\r
+typedef UINT8 EFI_FFS_FILE_ATTRIBUTES;\r
+typedef UINT8 EFI_FFS_FILE_STATE;\r
+\r
+typedef struct {\r
+  EFI_GUID                Name;\r
+  EFI_FFS_INTEGRITY_CHECK IntegrityCheck;\r
+  EFI_FV_FILETYPE         Type;\r
+  EFI_FFS_FILE_ATTRIBUTES Attributes;\r
+  UINT8                   Size[3];\r
+  EFI_FFS_FILE_STATE      State;\r
+} EFI_FFS_FILE_HEADER;\r
+\r
+#endif\r
diff --git a/Tools/Source/TianoTools/Include/Common/FirmwareVolumeHeader.h b/Tools/Source/TianoTools/Include/Common/FirmwareVolumeHeader.h
new file mode 100644 (file)
index 0000000..038dce6
--- /dev/null
@@ -0,0 +1,109 @@
+/** @file\r
+  Defines data structure that is the volume header found at the beginning of\r
+  all firmware volumes that are either memory mapped, or have an\r
+  associated FirmwareVolumeBlock protocol.\r
+\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. This program and the accompanying materials                          \r
+  are licensed and made available under the terms and conditions of the BSD License         \r
+  which accompanies this distribution.  The full text of the license may be found at        \r
+  http://opensource.org/licenses/bsd-license.php                                            \r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+  Module Name:  FirmwareVolumeHeader.h\r
+\r
+  @par Revision Reference:\r
+  These definitions are from Firmware Volume Block Spec 0.9.\r
+\r
+**/\r
+\r
+#ifndef __EFI_FIRMWARE_VOLUME_HEADER_H__\r
+#define __EFI_FIRMWARE_VOLUME_HEADER_H__\r
+\r
+//\r
+// Firmware Volume Block Attributes definition\r
+//\r
+typedef UINT32  EFI_FVB_ATTRIBUTES;\r
+\r
+//\r
+// Firmware Volume Block Attributes bit definitions\r
+//\r
+#define EFI_FVB_READ_DISABLED_CAP   0x00000001\r
+#define EFI_FVB_READ_ENABLED_CAP    0x00000002\r
+#define EFI_FVB_READ_STATUS         0x00000004\r
+\r
+#define EFI_FVB_WRITE_DISABLED_CAP  0x00000008\r
+#define EFI_FVB_WRITE_ENABLED_CAP   0x00000010\r
+#define EFI_FVB_WRITE_STATUS        0x00000020\r
+\r
+#define EFI_FVB_LOCK_CAP            0x00000040\r
+#define EFI_FVB_LOCK_STATUS         0x00000080\r
+\r
+#define EFI_FVB_STICKY_WRITE        0x00000200\r
+#define EFI_FVB_MEMORY_MAPPED       0x00000400\r
+#define EFI_FVB_ERASE_POLARITY      0x00000800\r
+\r
+#define EFI_FVB_ALIGNMENT_CAP       0x00008000\r
+#define EFI_FVB_ALIGNMENT_2         0x00010000\r
+#define EFI_FVB_ALIGNMENT_4         0x00020000\r
+#define EFI_FVB_ALIGNMENT_8         0x00040000\r
+#define EFI_FVB_ALIGNMENT_16        0x00080000\r
+#define EFI_FVB_ALIGNMENT_32        0x00100000\r
+#define EFI_FVB_ALIGNMENT_64        0x00200000\r
+#define EFI_FVB_ALIGNMENT_128       0x00400000\r
+#define EFI_FVB_ALIGNMENT_256       0x00800000\r
+#define EFI_FVB_ALIGNMENT_512       0x01000000\r
+#define EFI_FVB_ALIGNMENT_1K        0x02000000\r
+#define EFI_FVB_ALIGNMENT_2K        0x04000000\r
+#define EFI_FVB_ALIGNMENT_4K        0x08000000\r
+#define EFI_FVB_ALIGNMENT_8K        0x10000000\r
+#define EFI_FVB_ALIGNMENT_16K       0x20000000\r
+#define EFI_FVB_ALIGNMENT_32K       0x40000000\r
+#define EFI_FVB_ALIGNMENT_64K       0x80000000\r
+\r
+#define EFI_FVB_CAPABILITIES  (EFI_FVB_READ_DISABLED_CAP | \\r
+                              EFI_FVB_READ_ENABLED_CAP | \\r
+                              EFI_FVB_WRITE_DISABLED_CAP | \\r
+                              EFI_FVB_WRITE_ENABLED_CAP | \\r
+                              EFI_FVB_LOCK_CAP \\r
+                              )\r
+\r
+#define EFI_FVB_STATUS    (EFI_FVB_READ_STATUS | EFI_FVB_WRITE_STATUS | EFI_FVB_LOCK_STATUS)\r
+\r
+///\r
+/// Firmware Volume Header Revision definition\r
+///\r
+#define EFI_FVH_REVISION  0x01\r
+\r
+///\r
+/// Firmware Volume Header Signature definition\r
+///\r
+#define EFI_FVH_SIGNATURE EFI_SIGNATURE_32 ('_', 'F', 'V', 'H')\r
+\r
+///\r
+/// Firmware Volume Header Block Map Entry definition\r
+///\r
+typedef struct {\r
+  UINT32  NumBlocks;\r
+  UINT32  BlockLength;\r
+} EFI_FV_BLOCK_MAP_ENTRY;\r
+\r
+///\r
+/// Firmware Volume Header definition\r
+///\r
+typedef struct {\r
+  UINT8                   ZeroVector[16];\r
+  EFI_GUID                FileSystemGuid;\r
+  UINT64                  FvLength;\r
+  UINT32                  Signature;\r
+  EFI_FVB_ATTRIBUTES      Attributes;\r
+  UINT16                  HeaderLength;\r
+  UINT16                  Checksum;\r
+  UINT8                   Reserved[3];\r
+  UINT8                   Revision;\r
+  EFI_FV_BLOCK_MAP_ENTRY  FvBlockMap[1];\r
+} EFI_FIRMWARE_VOLUME_HEADER;\r
+\r
+#endif\r
diff --git a/Tools/Source/TianoTools/Include/Common/FirmwareVolumeImageFormat.h b/Tools/Source/TianoTools/Include/Common/FirmwareVolumeImageFormat.h
new file mode 100644 (file)
index 0000000..14fa41b
--- /dev/null
@@ -0,0 +1,277 @@
+/** @file\r
+  This file defines the data structures that are architecturally defined for file\r
+  images loaded via the FirmwareVolume protocol.  The Firmware Volume specification\r
+  is the basis for these definitions.\r
+\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. This program and the accompanying materials                          \r
+  are licensed and made available under the terms and conditions of the BSD License         \r
+  which accompanies this distribution.  The full text of the license may be found at        \r
+  http://opensource.org/licenses/bsd-license.php                                            \r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+  Module Name:  FimrwareVolumeImageFormat.h\r
+\r
+  @par Revision Reference:\r
+  These definitions are from Firmware Volume Spec 0.9.\r
+\r
+**/\r
+\r
+#ifndef __FIRMWARE_VOLUME_IMAGE_FORMAT_H__\r
+#define __FIRMWARE_VOLUME_IMAGE_FORMAT_H__\r
+\r
+//\r
+// pack all data structures since this is actually a binary format and we cannot\r
+// allow internal padding in the data structures because of some compilerism..\r
+//\r
+#pragma pack(1)\r
+//\r
+// ////////////////////////////////////////////////////////////////////////////\r
+//\r
+// Architectural file types\r
+//\r
+typedef UINT8 EFI_FV_FILETYPE;\r
+\r
+#define EFI_FV_FILETYPE_ALL                   0x00\r
+#define EFI_FV_FILETYPE_RAW                   0x01\r
+#define EFI_FV_FILETYPE_FREEFORM              0x02\r
+#define EFI_FV_FILETYPE_SECURITY_CORE         0x03\r
+#define EFI_FV_FILETYPE_PEI_CORE              0x04\r
+#define EFI_FV_FILETYPE_DXE_CORE              0x05\r
+#define EFI_FV_FILETYPE_PEIM                  0x06\r
+#define EFI_FV_FILETYPE_DRIVER                0x07\r
+#define EFI_FV_FILETYPE_COMBINED_PEIM_DRIVER  0x08\r
+#define EFI_FV_FILETYPE_APPLICATION           0x09\r
+//\r
+// File type 0x0A is reserved and should not be used\r
+//\r
+#define EFI_FV_FILETYPE_FIRMWARE_VOLUME_IMAGE 0x0B\r
+\r
+//\r
+// ////////////////////////////////////////////////////////////////////////////\r
+//\r
+// Section types\r
+//\r
+typedef UINT8 EFI_SECTION_TYPE;\r
+\r
+//\r
+// ************************************************************\r
+// The section type EFI_SECTION_ALL is a psuedo type.  It is\r
+// used as a wildcard when retrieving sections.  The section\r
+// type EFI_SECTION_ALL matches all section types.\r
+// ************************************************************\r
+//\r
+#define EFI_SECTION_ALL 0x00\r
+\r
+//\r
+// ************************************************************\r
+// Encapsulation section Type values\r
+// ************************************************************\r
+//\r
+#define EFI_SECTION_COMPRESSION   0x01\r
+#define EFI_SECTION_GUID_DEFINED  0x02\r
+\r
+//\r
+// ************************************************************\r
+// Leaf section Type values\r
+// ************************************************************\r
+//\r
+#define EFI_SECTION_FIRST_LEAF_SECTION_TYPE 0x10\r
+\r
+#define EFI_SECTION_PE32                    0x10\r
+#define EFI_SECTION_PIC                     0x11\r
+#define EFI_SECTION_TE                      0x12\r
+#define EFI_SECTION_DXE_DEPEX               0x13\r
+#define EFI_SECTION_VERSION                 0x14\r
+#define EFI_SECTION_USER_INTERFACE          0x15\r
+#define EFI_SECTION_COMPATIBILITY16         0x16\r
+#define EFI_SECTION_FIRMWARE_VOLUME_IMAGE   0x17\r
+#define EFI_SECTION_FREEFORM_SUBTYPE_GUID   0x18\r
+#define EFI_SECTION_RAW                     0x19\r
+#define EFI_SECTION_PEI_DEPEX               0x1B\r
+\r
+#define EFI_SECTION_LAST_LEAF_SECTION_TYPE  0x1B\r
+#define EFI_SECTION_LAST_SECTION_TYPE       0x1B\r
+\r
+//\r
+// ////////////////////////////////////////////////////////////////////////////\r
+//\r
+// Common section header\r
+//\r
+typedef struct {\r
+  UINT8 Size[3];\r
+  UINT8 Type;\r
+} EFI_COMMON_SECTION_HEADER;\r
+\r
+#define SECTION_SIZE(SectionHeaderPtr) \\r
+    ((UINT32) (*((UINT32 *) ((EFI_COMMON_SECTION_HEADER *) SectionHeaderPtr)->Size) & 0x00ffffff))\r
+\r
+//\r
+// ////////////////////////////////////////////////////////////////////////////\r
+//\r
+// Compression section\r
+//\r
+//\r
+// CompressionType values\r
+//\r
+#define EFI_NOT_COMPRESSED          0x00\r
+#define EFI_STANDARD_COMPRESSION    0x01\r
+#define EFI_CUSTOMIZED_COMPRESSION  0x02\r
+\r
+typedef struct {\r
+  EFI_COMMON_SECTION_HEADER CommonHeader;\r
+  UINT32                    UncompressedLength;\r
+  UINT8                     CompressionType;\r
+} EFI_COMPRESSION_SECTION;\r
+\r
+//\r
+// ////////////////////////////////////////////////////////////////////////////\r
+//\r
+// GUID defined section\r
+//\r
+typedef struct {\r
+  EFI_COMMON_SECTION_HEADER CommonHeader;\r
+  EFI_GUID                  SectionDefinitionGuid;\r
+  UINT16                    DataOffset;\r
+  UINT16                    Attributes;\r
+} EFI_GUID_DEFINED_SECTION;\r
+\r
+//\r
+// Bit values for Attributes\r
+//\r
+#define EFI_GUIDED_SECTION_PROCESSING_REQUIRED  0x01\r
+#define EFI_GUIDED_SECTION_AUTH_STATUS_VALID    0x02\r
+\r
+//\r
+// Bit values for AuthenticationStatus\r
+//\r
+#define EFI_AGGREGATE_AUTH_STATUS_PLATFORM_OVERRIDE 0x000001\r
+#define EFI_AGGREGATE_AUTH_STATUS_IMAGE_SIGNED      0x000002\r
+#define EFI_AGGREGATE_AUTH_STATUS_NOT_TESTED        0x000004\r
+#define EFI_AGGREGATE_AUTH_STATUS_TEST_FAILED       0x000008\r
+#define EFI_AGGREGATE_AUTH_STATUS_ALL               0x00000f\r
+\r
+#define EFI_LOCAL_AUTH_STATUS_PLATFORM_OVERRIDE     0x010000\r
+#define EFI_LOCAL_AUTH_STATUS_IMAGE_SIGNED          0x020000\r
+#define EFI_LOCAL_AUTH_STATUS_NOT_TESTED            0x040000\r
+#define EFI_LOCAL_AUTH_STATUS_TEST_FAILED           0x080000\r
+#define EFI_LOCAL_AUTH_STATUS_ALL                   0x0f0000\r
+\r
+//\r
+// ////////////////////////////////////////////////////////////////////////////\r
+//\r
+// PE32+ section\r
+//\r
+typedef struct {\r
+  EFI_COMMON_SECTION_HEADER CommonHeader;\r
+} EFI_PE32_SECTION;\r
+\r
+//\r
+// ////////////////////////////////////////////////////////////////////////////\r
+//\r
+// PIC section\r
+//\r
+typedef struct {\r
+  EFI_COMMON_SECTION_HEADER CommonHeader;\r
+} EFI_PIC_SECTION;\r
+\r
+//\r
+// ////////////////////////////////////////////////////////////////////////////\r
+//\r
+// PEIM header section\r
+//\r
+typedef struct {\r
+  EFI_COMMON_SECTION_HEADER CommonHeader;\r
+} EFI_PEIM_HEADER_SECTION;\r
+\r
+//\r
+// ////////////////////////////////////////////////////////////////////////////\r
+//\r
+// DEPEX section\r
+//\r
+typedef struct {\r
+  EFI_COMMON_SECTION_HEADER CommonHeader;\r
+} EFI_DEPEX_SECTION;\r
+\r
+//\r
+// ////////////////////////////////////////////////////////////////////////////\r
+//\r
+// Version section\r
+//\r
+typedef struct {\r
+  EFI_COMMON_SECTION_HEADER CommonHeader;\r
+  UINT16                    BuildNumber;\r
+  INT16                     VersionString[1];\r
+} EFI_VERSION_SECTION;\r
+\r
+//\r
+// ////////////////////////////////////////////////////////////////////////////\r
+//\r
+// User interface section\r
+//\r
+typedef struct {\r
+  EFI_COMMON_SECTION_HEADER CommonHeader;\r
+  INT16                     FileNameString[1];\r
+} EFI_USER_INTERFACE_SECTION;\r
+\r
+//\r
+// ////////////////////////////////////////////////////////////////////////////\r
+//\r
+// Code16 section\r
+//\r
+typedef struct {\r
+  EFI_COMMON_SECTION_HEADER CommonHeader;\r
+} EFI_CODE16_SECTION;\r
+\r
+//\r
+// ////////////////////////////////////////////////////////////////////////////\r
+//\r
+// Firmware Volume Image section\r
+//\r
+typedef struct {\r
+  EFI_COMMON_SECTION_HEADER CommonHeader;\r
+} EFI_FIRMWARE_VOLUME_IMAGE_SECTION;\r
+\r
+//\r
+// ////////////////////////////////////////////////////////////////////////////\r
+//\r
+// Freeform subtype GUID section\r
+//\r
+typedef struct {\r
+  EFI_COMMON_SECTION_HEADER CommonHeader;\r
+  EFI_GUID                  SubTypeGuid;\r
+} EFI_FREEFORM_SUBTYPE_GUID_SECTION;\r
+\r
+//\r
+// ////////////////////////////////////////////////////////////////////////////\r
+//\r
+// Raw section\r
+//\r
+typedef struct {\r
+  EFI_COMMON_SECTION_HEADER CommonHeader;\r
+} EFI_RAW_SECTION;\r
+\r
+//\r
+// undo the pragma from the beginning...\r
+//\r
+#pragma pack()\r
+\r
+typedef union {\r
+  EFI_COMMON_SECTION_HEADER         *CommonHeader;\r
+  EFI_COMPRESSION_SECTION           *CompressionSection;\r
+  EFI_GUID_DEFINED_SECTION          *GuidDefinedSection;\r
+  EFI_PE32_SECTION                  *Pe32Section;\r
+  EFI_PIC_SECTION                   *PicSection;\r
+  EFI_PEIM_HEADER_SECTION           *PeimHeaderSection;\r
+  EFI_DEPEX_SECTION                 *DependencySection;\r
+  EFI_VERSION_SECTION               *VersionSection;\r
+  EFI_USER_INTERFACE_SECTION        *UISection;\r
+  EFI_CODE16_SECTION                *Code16Section;\r
+  EFI_FIRMWARE_VOLUME_IMAGE_SECTION *FVImageSection;\r
+  EFI_FREEFORM_SUBTYPE_GUID_SECTION *FreeformSubtypeSection;\r
+  EFI_RAW_SECTION                   *RawSection;\r
+} EFI_FILE_SECTION_POINTER;\r
+\r
+#endif\r
diff --git a/Tools/Source/TianoTools/Include/Common/Hob.h b/Tools/Source/TianoTools/Include/Common/Hob.h
new file mode 100644 (file)
index 0000000..b6ae6de
--- /dev/null
@@ -0,0 +1,235 @@
+/** @file\r
+  Hand Off Block (HOB) definition.\r
+\r
+  The HOB is a memory data structure used to hand-off system information from\r
+  PEI to DXE (the next phase).\r
+\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. This program and the accompanying materials                          \r
+  are licensed and made available under the terms and conditions of the BSD License         \r
+  which accompanies this distribution.  The full text of the license may be found at        \r
+  http://opensource.org/licenses/bsd-license.php                                            \r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+  Module Name:  Hob.h\r
+\r
+  @par Revision Reference:\r
+  These definitions are from Hand Off Block (HOB) Spec Version 0.9.\r
+\r
+**/\r
+\r
+#ifndef __HOB_H__\r
+#define __HOB_H__\r
+\r
+\r
+//\r
+// Every Hob must start with this data structure.\r
+//\r
+typedef struct {\r
+  UINT16  HobType;\r
+  UINT16  HobLength;\r
+  UINT32  Reserved;\r
+} EFI_HOB_GENERIC_HEADER;\r
+\r
+//\r
+// End of HOB List HOB\r
+//\r
+#define EFI_HOB_TYPE_END_OF_HOB_LIST  0xffff\r
+\r
+//\r
+// Handoff Information Table HOB\r
+//\r
+#define EFI_HOB_TYPE_HANDOFF          0x0001\r
+\r
+#define EFI_HOB_HANDOFF_TABLE_VERSION 0x0009\r
+\r
+typedef UINT32  EFI_BOOT_MODE;\r
+\r
+typedef struct {\r
+  EFI_HOB_GENERIC_HEADER  Header;\r
+  UINT32                  Version;\r
+  EFI_BOOT_MODE           BootMode;\r
+  EFI_PHYSICAL_ADDRESS    EfiMemoryTop;\r
+  EFI_PHYSICAL_ADDRESS    EfiMemoryBottom;\r
+  EFI_PHYSICAL_ADDRESS    EfiFreeMemoryTop;\r
+  EFI_PHYSICAL_ADDRESS    EfiFreeMemoryBottom;\r
+  EFI_PHYSICAL_ADDRESS    EfiEndOfHobList;\r
+} EFI_HOB_HANDOFF_INFO_TABLE;\r
+\r
+//\r
+// Memory Descriptor HOB\r
+//\r
+#define EFI_HOB_TYPE_MEMORY_ALLOCATION  0x0002\r
+\r
+typedef struct {\r
+  EFI_GUID              Name;\r
+  EFI_PHYSICAL_ADDRESS  MemoryBaseAddress;\r
+  UINT64                MemoryLength;\r
+  EFI_MEMORY_TYPE       MemoryType;\r
+  UINT8                 Reserved[4];\r
+} EFI_HOB_MEMORY_ALLOCATION_HEADER;\r
+\r
+typedef struct {\r
+  EFI_HOB_GENERIC_HEADER            Header;\r
+  EFI_HOB_MEMORY_ALLOCATION_HEADER  AllocDescriptor;\r
+  //\r
+  // Additional data pertaining to the "Name" Guid memory\r
+  // may go here.\r
+  //\r
+} EFI_HOB_MEMORY_ALLOCATION;\r
+\r
+typedef struct {\r
+  EFI_HOB_GENERIC_HEADER            Header;\r
+  EFI_HOB_MEMORY_ALLOCATION_HEADER  AllocDescriptor;\r
+} EFI_HOB_MEMORY_ALLOCATION_BSP_STORE;\r
+\r
+typedef struct {\r
+  EFI_HOB_GENERIC_HEADER            Header;\r
+  EFI_HOB_MEMORY_ALLOCATION_HEADER  AllocDescriptor;\r
+} EFI_HOB_MEMORY_ALLOCATION_STACK;\r
+\r
+typedef struct {\r
+  EFI_HOB_GENERIC_HEADER            Header;\r
+  EFI_HOB_MEMORY_ALLOCATION_HEADER  MemoryAllocationHeader;\r
+  EFI_GUID                          ModuleName;\r
+  EFI_PHYSICAL_ADDRESS              EntryPoint;\r
+} EFI_HOB_MEMORY_ALLOCATION_MODULE;\r
+\r
+#define EFI_HOB_TYPE_RESOURCE_DESCRIPTOR  0x0003\r
+\r
+typedef UINT32  EFI_RESOURCE_TYPE;\r
+\r
+#define EFI_RESOURCE_SYSTEM_MEMORY          0\r
+#define EFI_RESOURCE_MEMORY_MAPPED_IO       1\r
+#define EFI_RESOURCE_IO                     2\r
+#define EFI_RESOURCE_FIRMWARE_DEVICE        3\r
+#define EFI_RESOURCE_MEMORY_MAPPED_IO_PORT  4\r
+#define EFI_RESOURCE_MEMORY_RESERVED        5\r
+#define EFI_RESOURCE_IO_RESERVED            6\r
+#define EFI_RESOURCE_MAX_MEMORY_TYPE        7\r
+\r
+typedef UINT32  EFI_RESOURCE_ATTRIBUTE_TYPE;\r
+\r
+#define EFI_RESOURCE_ATTRIBUTE_PRESENT                  0x00000001\r
+#define EFI_RESOURCE_ATTRIBUTE_INITIALIZED              0x00000002\r
+#define EFI_RESOURCE_ATTRIBUTE_TESTED                   0x00000004\r
+#define EFI_RESOURCE_ATTRIBUTE_SINGLE_BIT_ECC           0x00000008\r
+#define EFI_RESOURCE_ATTRIBUTE_MULTIPLE_BIT_ECC         0x00000010\r
+#define EFI_RESOURCE_ATTRIBUTE_ECC_RESERVED_1           0x00000020\r
+#define EFI_RESOURCE_ATTRIBUTE_ECC_RESERVED_2           0x00000040\r
+#define EFI_RESOURCE_ATTRIBUTE_READ_PROTECTED           0x00000080\r
+#define EFI_RESOURCE_ATTRIBUTE_WRITE_PROTECTED          0x00000100\r
+#define EFI_RESOURCE_ATTRIBUTE_EXECUTION_PROTECTED      0x00000200\r
+#define EFI_RESOURCE_ATTRIBUTE_UNCACHEABLE              0x00000400\r
+#define EFI_RESOURCE_ATTRIBUTE_WRITE_COMBINEABLE        0x00000800\r
+#define EFI_RESOURCE_ATTRIBUTE_WRITE_THROUGH_CACHEABLE  0x00001000\r
+#define EFI_RESOURCE_ATTRIBUTE_WRITE_BACK_CACHEABLE     0x00002000\r
+#define EFI_RESOURCE_ATTRIBUTE_16_BIT_IO                0x00004000\r
+#define EFI_RESOURCE_ATTRIBUTE_32_BIT_IO                0x00008000\r
+#define EFI_RESOURCE_ATTRIBUTE_64_BIT_IO                0x00010000\r
+#define EFI_RESOURCE_ATTRIBUTE_UNCACHED_EXPORTED        0x00020000\r
+\r
+typedef struct {\r
+  EFI_HOB_GENERIC_HEADER      Header;\r
+  EFI_GUID                    Owner;\r
+  EFI_RESOURCE_TYPE           ResourceType;\r
+  EFI_RESOURCE_ATTRIBUTE_TYPE ResourceAttribute;\r
+  EFI_PHYSICAL_ADDRESS        PhysicalStart;\r
+  UINT64                      ResourceLength;\r
+} EFI_HOB_RESOURCE_DESCRIPTOR;\r
+\r
+//\r
+// GUID Extension HOB\r
+// The HobLength is variable as it includes the GUID specific data.\r
+//\r
+#define EFI_HOB_TYPE_GUID_EXTENSION 0x0004\r
+\r
+typedef struct {\r
+  EFI_HOB_GENERIC_HEADER  Header;\r
+  EFI_GUID                Name;\r
+\r
+  //\r
+  // Guid specific data goes here\r
+  //\r
+} EFI_HOB_GUID_TYPE;\r
+\r
+//\r
+// Firmware Volume HOB\r
+//\r
+#define EFI_HOB_TYPE_FV 0x0005\r
+\r
+typedef struct {\r
+  EFI_HOB_GENERIC_HEADER  Header;\r
+  EFI_PHYSICAL_ADDRESS    BaseAddress;\r
+  UINT64                  Length;\r
+} EFI_HOB_FIRMWARE_VOLUME;\r
+\r
+//\r
+// CPU HOB\r
+//\r
+#define EFI_HOB_TYPE_CPU  0x0006\r
+\r
+typedef struct {\r
+  EFI_HOB_GENERIC_HEADER  Header;\r
+  UINT8                   SizeOfMemorySpace;\r
+  UINT8                   SizeOfIoSpace;\r
+  UINT8                   Reserved[6];\r
+} EFI_HOB_CPU;\r
+\r
+//\r
+// PEI Core Memory Pool HOB\r
+// The HobLength is variable as the HOB contains pool allocations by\r
+// the PeiServices AllocatePool function\r
+//\r
+#define EFI_HOB_TYPE_PEI_MEMORY_POOL  0x0007\r
+\r
+typedef struct {\r
+  EFI_HOB_GENERIC_HEADER  Header;\r
+} EFI_HOB_MEMORY_POOL;\r
+\r
+//\r
+// Capsule volume HOB -- identical to a firmware volume\r
+//\r
+#define EFI_HOB_TYPE_CV 0x0008\r
+\r
+typedef struct {\r
+  EFI_HOB_GENERIC_HEADER  Header;\r
+  EFI_PHYSICAL_ADDRESS    BaseAddress;\r
+  UINT64                  Length;\r
+} EFI_HOB_CAPSULE_VOLUME;\r
+\r
+#define EFI_HOB_TYPE_UNUSED 0xFFFE\r
+\r
+//\r
+// Union of all the possible HOB Types\r
+//\r
+typedef union {\r
+  EFI_HOB_GENERIC_HEADER              *Header;\r
+  EFI_HOB_HANDOFF_INFO_TABLE          *HandoffInformationTable;\r
+  EFI_HOB_MEMORY_ALLOCATION           *MemoryAllocation;\r
+  EFI_HOB_MEMORY_ALLOCATION_BSP_STORE *MemoryAllocationBspStore;\r
+  EFI_HOB_MEMORY_ALLOCATION_STACK     *MemoryAllocationStack;\r
+  EFI_HOB_MEMORY_ALLOCATION_MODULE    *MemoryAllocationModule;\r
+  EFI_HOB_RESOURCE_DESCRIPTOR         *ResourceDescriptor;\r
+  EFI_HOB_GUID_TYPE                   *Guid;\r
+  EFI_HOB_FIRMWARE_VOLUME             *FirmwareVolume;\r
+  EFI_HOB_CPU                         *Cpu;\r
+  EFI_HOB_MEMORY_POOL                 *Pool;\r
+  EFI_HOB_CAPSULE_VOLUME              *CapsuleVolume;\r
+  UINT8                               *Raw;\r
+} EFI_PEI_HOB_POINTERS;\r
+\r
+#define GET_HOB_TYPE(Hob)     ((Hob).Header->HobType)\r
+#define GET_HOB_LENGTH(Hob)   ((Hob).Header->HobLength)\r
+#define GET_NEXT_HOB(Hob)     ((Hob).Raw + GET_HOB_LENGTH (Hob))\r
+#define END_OF_HOB_LIST(Hob)  (GET_HOB_TYPE (Hob) == EFI_HOB_TYPE_END_OF_HOB_LIST)\r
+\r
+//\r
+// Get the data and data size field of GUID \r
+//\r
+#define GET_GUID_HOB_DATA(GuidHob)      ((VOID *) (((UINT8 *) &((GuidHob)->Name)) + sizeof (EFI_GUID)))\r
+#define GET_GUID_HOB_DATA_SIZE(GuidHob) (((GuidHob)->Header).HobLength - sizeof (EFI_HOB_GUID_TYPE))\r
+\r
+#endif\r
diff --git a/Tools/Source/TianoTools/Include/Common/InternalFormRepresentation.h b/Tools/Source/TianoTools/Include/Common/InternalFormRepresentation.h
new file mode 100644 (file)
index 0000000..bf3d824
--- /dev/null
@@ -0,0 +1,422 @@
+/** @file\r
+  This file defines the encoding for the VFR (Visual Form Representation) language.\r
+  IFR is primarily consumed by the EFI presentation engine, and produced by EFI\r
+  internal application and drivers as well as all add-in card option-ROM drivers\r
+\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. This program and the accompanying materials                          \r
+  are licensed and made available under the terms and conditions of the BSD License         \r
+  which accompanies this distribution.  The full text of the license may be found at        \r
+  http://opensource.org/licenses/bsd-license.php                                            \r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+  Module Name:  InternalFormRepresentation.h\r
+\r
+  @par Revision Reference:\r
+  These definitions are from Human Interface Infrastructure Spec Version 0.92.\r
+\r
+**/\r
+\r
+#ifndef __EFI_INTERNAL_FORM_REPRESENTATION_H__\r
+#define __EFI_INTERNAL_FORM_REPRESENTATION_H__\r
+\r
+//\r
+// The following types are currently defined:\r
+//\r
+typedef UINT32  RELOFST;\r
+typedef CHAR16  *EFI_STRING;\r
+\r
+//\r
+// IFR Op codes\r
+//\r
+#define EFI_IFR_FORM_OP                 0x01\r
+#define EFI_IFR_SUBTITLE_OP             0x02\r
+#define EFI_IFR_TEXT_OP                 0x03\r
+#define EFI_IFR_GRAPHIC_OP              0x04\r
+#define EFI_IFR_ONE_OF_OP               0x05\r
+#define EFI_IFR_CHECKBOX_OP             0x06\r
+#define EFI_IFR_NUMERIC_OP              0x07\r
+#define EFI_IFR_PASSWORD_OP             0x08\r
+#define EFI_IFR_ONE_OF_OPTION_OP        0x09  // ONEOF OPTION field\r
+#define EFI_IFR_SUPPRESS_IF_OP          0x0A\r
+#define EFI_IFR_END_FORM_OP             0x0B\r
+#define EFI_IFR_HIDDEN_OP               0x0C\r
+#define EFI_IFR_END_FORM_SET_OP         0x0D\r
+#define EFI_IFR_FORM_SET_OP             0x0E\r
+#define EFI_IFR_REF_OP                  0x0F\r
+#define EFI_IFR_END_ONE_OF_OP           0x10\r
+#define EFI_IFR_END_OP                  EFI_IFR_END_ONE_OF_OP\r
+#define EFI_IFR_INCONSISTENT_IF_OP      0x11\r
+#define EFI_IFR_EQ_ID_VAL_OP            0x12\r
+#define EFI_IFR_EQ_ID_ID_OP             0x13\r
+#define EFI_IFR_EQ_ID_LIST_OP           0x14\r
+#define EFI_IFR_AND_OP                  0x15\r
+#define EFI_IFR_OR_OP                   0x16\r
+#define EFI_IFR_NOT_OP                  0x17\r
+#define EFI_IFR_END_IF_OP               0x18  // for endif of inconsistentif, suppressif, grayoutif\r
+#define EFI_IFR_GRAYOUT_IF_OP           0x19\r
+#define EFI_IFR_DATE_OP                 0x1A\r
+#define EFI_IFR_TIME_OP                 0x1B\r
+#define EFI_IFR_STRING_OP               0x1C\r
+#define EFI_IFR_LABEL_OP                0x1D\r
+#define EFI_IFR_SAVE_DEFAULTS_OP        0x1E\r
+#define EFI_IFR_RESTORE_DEFAULTS_OP     0x1F\r
+#define EFI_IFR_BANNER_OP               0x20\r
+#define EFI_IFR_INVENTORY_OP            0x21\r
+#define EFI_IFR_EQ_VAR_VAL_OP           0x22\r
+#define EFI_IFR_ORDERED_LIST_OP         0x23\r
+#define EFI_IFR_VARSTORE_OP             0x24\r
+#define EFI_IFR_VARSTORE_SELECT_OP      0x25\r
+#define EFI_IFR_VARSTORE_SELECT_PAIR_OP 0x26\r
+#define EFI_IFR_TRUE_OP                 0x27\r
+#define EFI_IFR_FALSE_OP                0x28\r
+#define EFI_IFR_GT_OP                   0x29\r
+#define EFI_IFR_GE_OP                   0x2A\r
+#define EFI_IFR_OEM_DEFINED_OP          0x2B\r
+#define EFI_IFR_LAST_OPCODE             EFI_IFR_OEM_DEFINED_OP\r
+#define EFI_IFR_OEM_OP                  0xFE\r
+#define EFI_IFR_NV_ACCESS_COMMAND       0xFF\r
+\r
+//\r
+// Define values for the flags fields in some VFR opcodes. These are\r
+// bitmasks.\r
+//\r
+#define EFI_IFR_FLAG_DEFAULT              0x01\r
+#define EFI_IFR_FLAG_MANUFACTURING        0x02\r
+#define EFI_IFR_FLAG_INTERACTIVE          0x04\r
+#define EFI_IFR_FLAG_NV_ACCESS            0x08\r
+#define EFI_IFR_FLAG_RESET_REQUIRED       0x10\r
+#define EFI_IFR_FLAG_LATE_CHECK           0x20\r
+\r
+#define EFI_NON_DEVICE_CLASS              0x00  // Useful when you do not want something in the Device Manager\r
+#define EFI_DISK_DEVICE_CLASS             0x01\r
+#define EFI_VIDEO_DEVICE_CLASS            0x02\r
+#define EFI_NETWORK_DEVICE_CLASS          0x04\r
+#define EFI_INPUT_DEVICE_CLASS            0x08\r
+#define EFI_ON_BOARD_DEVICE_CLASS         0x10\r
+#define EFI_OTHER_DEVICE_CLASS            0x20\r
+\r
+#define EFI_SETUP_APPLICATION_SUBCLASS    0x00\r
+#define EFI_GENERAL_APPLICATION_SUBCLASS  0x01\r
+#define EFI_FRONT_PAGE_SUBCLASS           0x02\r
+#define EFI_SINGLE_USE_SUBCLASS           0x03  // Used to display a single entity and then exit\r
+\r
+//\r
+// Used to flag dynamically created op-codes. This is meaningful to the IFR Library set\r
+// and the browser since we need to distinguish between compiled NV map data and created data.\r
+// We do not allow new entries to be created in the NV map dynamically however we still need\r
+// to display this information correctly.  To dynamically create op-codes and assume that their\r
+// data will be saved, ensure that the NV starting location they refer to is pre-defined in the\r
+// NV map.\r
+//\r
+#define EFI_IFR_FLAG_CREATED  128\r
+\r
+#pragma pack(1)\r
+//\r
+// IFR Structure definitions\r
+//\r
+typedef struct {\r
+  UINT8 OpCode;\r
+  UINT8 Length;\r
+} EFI_IFR_OP_HEADER;\r
+\r
+typedef struct {\r
+  EFI_IFR_OP_HEADER     Header;\r
+  EFI_GUID              Guid;\r
+  STRING_REF            FormSetTitle;\r
+  STRING_REF            Help;\r
+  EFI_PHYSICAL_ADDRESS  CallbackHandle;\r
+  UINT16                Class;\r
+  UINT16                SubClass;\r
+  UINT16                NvDataSize; // set once, size of the NV data as defined in the script\r
+} EFI_IFR_FORM_SET;\r
+\r
+typedef struct {\r
+  EFI_IFR_OP_HEADER Header;\r
+  UINT16            FormId;\r
+  STRING_REF        FormTitle;\r
+} EFI_IFR_FORM;\r
+\r
+typedef struct {\r
+  EFI_IFR_OP_HEADER Header;\r
+  UINT16            LabelId;\r
+} EFI_IFR_LABEL;\r
+\r
+typedef struct {\r
+  EFI_IFR_OP_HEADER Header;\r
+  STRING_REF        SubTitle;\r
+} EFI_IFR_SUBTITLE;\r
+\r
+typedef struct {\r
+  EFI_IFR_OP_HEADER Header;\r
+  STRING_REF        Help;\r
+  STRING_REF        Text;\r
+  STRING_REF        TextTwo;\r
+  UINT8             Flags;          // This is included solely for purposes of interactive/dynamic support.\r
+  UINT16            Key;            // Value to be passed to caller to identify this particular op-code\r
+} EFI_IFR_TEXT;\r
+\r
+//\r
+// goto\r
+//\r
+typedef struct {\r
+  EFI_IFR_OP_HEADER Header;\r
+  UINT16            FormId;\r
+  STRING_REF        Prompt;\r
+  STRING_REF        Help;   // The string Token for the context-help\r
+  UINT8             Flags;  // This is included solely for purposes of interactive/dynamic support.\r
+  UINT16            Key;    // Value to be passed to caller to identify this particular op-code\r
+} EFI_IFR_REF;\r
+\r
+typedef struct {\r
+  EFI_IFR_OP_HEADER Header;\r
+} EFI_IFR_END_FORM;\r
+\r
+typedef struct {\r
+  EFI_IFR_OP_HEADER Header;\r
+} EFI_IFR_END_FORM_SET;\r
+\r
+//\r
+// Also notice that the IFR_ONE_OF and IFR_CHECK_BOX are identical in structure......code assumes this to be true, if this ever\r
+// changes we need to revisit the InitializeTagStructures code\r
+//\r
+typedef struct {\r
+  EFI_IFR_OP_HEADER Header;\r
+  UINT16            QuestionId; // The ID designating what the question is about...sucked in from a #define, likely in the form of a variable name\r
+  UINT8             Width;      // The Size of the Data being saved\r
+  STRING_REF        Prompt;     // The String Token for the Prompt\r
+  STRING_REF        Help;       // The string Token for the context-help\r
+} EFI_IFR_ONE_OF;\r
+\r
+typedef struct {\r
+  EFI_IFR_OP_HEADER Header;\r
+  UINT16            QuestionId; // The offset in NV for storage of the data\r
+  UINT8             MaxEntries; // The maximum number of options in the ordered list (=size of NVStore)\r
+  STRING_REF        Prompt;     // The string token for the prompt\r
+  STRING_REF        Help;       // The string token for the context-help\r
+} EFI_IFR_ORDERED_LIST;\r
+\r
+typedef struct {\r
+  EFI_IFR_OP_HEADER Header;\r
+  UINT16            QuestionId; // The ID designating what the question is about...sucked in from a #define, likely in the form of a variable name\r
+  UINT8             Width;      // The Size of the Data being saved\r
+  STRING_REF        Prompt;     // The String Token for the Prompt\r
+  STRING_REF        Help;       // The string Token for the context-help\r
+  UINT8             Flags;      // For now, if non-zero, means that it is the default option, - further definition likely\r
+  UINT16            Key;        // Value to be passed to caller to identify this particular op-code\r
+} EFI_IFR_CHECKBOX, EFI_IFR_CHECK_BOX;\r
+\r
+typedef struct {\r
+  EFI_IFR_OP_HEADER Header;\r
+  STRING_REF        Option;     // The string token describing the option\r
+  UINT16            Value;      // The value associated with this option that is stored in the NVRAM if chosen\r
+  UINT8             Flags;      // For now, if non-zero, means that it is the default option, - further definition likely above\r
+  UINT16            Key;        // Value to be passed to caller to identify this particular op-code\r
+} EFI_IFR_ONE_OF_OPTION;\r
+\r
+typedef struct {\r
+  EFI_IFR_OP_HEADER Header;\r
+  UINT16            QuestionId; // The ID designating what the question is about...sucked in from a #define, likely in the form of a variable name\r
+  UINT8             Width;      // The Size of the Data being saved\r
+  STRING_REF        Prompt;     // The String Token for the Prompt\r
+  STRING_REF        Help;       // The string Token for the context-help\r
+  UINT8             Flags;      // This is included solely for purposes of interactive/dynamic support.\r
+  UINT16            Key;        // Value to be passed to caller to identify this particular op-code\r
+  UINT16            Minimum;\r
+  UINT16            Maximum;\r
+  UINT16            Step;       // If step is 0, then manual input is specified, otherwise, left/right arrow selection is called for\r
+  UINT16            Default;\r
+} EFI_IFR_NUMERIC;\r
+\r
+//\r
+// There is an interesting twist with regards to Time and Date.  This is one of the few items which can accept input from\r
+// a user, however may or may not need to use storage in the NVRAM space.  The decided method for determining if NVRAM space\r
+// will be used (only for a TimeOp or DateOp) is:  If .QuestionId == 0 && .Width == 0 (normally an impossibility) then use system\r
+// resources to store the data away and not NV resources.  In other words, the setup engine will call gRT->SetTime, and gRT->SetDate\r
+// for the saving of data, and the values displayed will be from the gRT->GetXXXX series of calls.\r
+//\r
+typedef struct {\r
+  EFI_IFR_NUMERIC Hour;\r
+  EFI_IFR_NUMERIC Minute;\r
+  EFI_IFR_NUMERIC Second;\r
+} EFI_IFR_TIME;\r
+\r
+typedef struct {\r
+  EFI_IFR_NUMERIC Year;\r
+  EFI_IFR_NUMERIC Month;\r
+  EFI_IFR_NUMERIC Day;\r
+} EFI_IFR_DATE;\r
+\r
+typedef struct {\r
+  EFI_IFR_OP_HEADER Header;\r
+  UINT16            QuestionId;   // The ID designating what the question is about...sucked in from a #define, likely in the form of a variable name\r
+  UINT8             Width;        // The Size of the Data being saved -- BUGBUG -- remove someday\r
+  STRING_REF        Prompt;       // The String Token for the Prompt\r
+  STRING_REF        Help;         // The string Token for the context-help\r
+  UINT8             Flags;        // This is included solely for purposes of interactive/dynamic support.\r
+  UINT16            Key;          // Value to be passed to caller to identify this particular op-code\r
+  UINT8             MinSize;      // Minimum allowable sized password\r
+  UINT8             MaxSize;      // Maximum allowable sized password\r
+  UINT16            Encoding;\r
+} EFI_IFR_PASSWORD;\r
+\r
+typedef struct {\r
+  EFI_IFR_OP_HEADER Header;\r
+  UINT16            QuestionId;   // The ID designating what the question is about...sucked in from a #define, likely in the form of a variable name\r
+  UINT8             Width;        // The Size of the Data being saved -- BUGBUG -- remove someday\r
+  STRING_REF        Prompt;       // The String Token for the Prompt\r
+  STRING_REF        Help;         // The string Token for the context-help\r
+  UINT8             Flags;        // This is included solely for purposes of interactive/dynamic support.\r
+  UINT16            Key;          // Value to be passed to caller to identify this particular op-code\r
+  UINT8             MinSize;      // Minimum allowable sized password\r
+  UINT8             MaxSize;      // Maximum allowable sized password\r
+} EFI_IFR_STRING;\r
+\r
+typedef struct {\r
+  EFI_IFR_OP_HEADER Header;\r
+} EFI_IFR_END_ONE_OF;\r
+\r
+typedef struct {\r
+  EFI_IFR_OP_HEADER Header;\r
+  UINT16            Value;\r
+  UINT16            Key;\r
+} EFI_IFR_HIDDEN;\r
+\r
+typedef struct {\r
+  EFI_IFR_OP_HEADER Header;\r
+  UINT8             Flags;\r
+} EFI_IFR_SUPPRESS;\r
+\r
+typedef struct {\r
+  EFI_IFR_OP_HEADER Header;\r
+  UINT8             Flags;\r
+} EFI_IFR_GRAY_OUT;\r
+\r
+typedef struct {\r
+  EFI_IFR_OP_HEADER Header;\r
+  STRING_REF        Popup;\r
+  UINT8             Flags;\r
+} EFI_IFR_INCONSISTENT;\r
+\r
+typedef struct {\r
+  EFI_IFR_OP_HEADER Header;\r
+  UINT16            QuestionId;   // offset into variable storage\r
+  UINT8             Width;        // size of variable storage\r
+  UINT16            Value;        // value to compare against\r
+} EFI_IFR_EQ_ID_VAL;\r
+\r
+typedef struct {\r
+  EFI_IFR_OP_HEADER Header;\r
+  UINT16            QuestionId;   // offset into variable storage\r
+  UINT8             Width;        // size of variable storage\r
+  UINT16            ListLength;\r
+  UINT16            ValueList[1];\r
+} EFI_IFR_EQ_ID_LIST;\r
+\r
+typedef struct {\r
+  EFI_IFR_OP_HEADER Header;\r
+  UINT16            QuestionId1;  // offset into variable storage for first value to compare\r
+  UINT8             Width;        // size of variable storage (must be same for both)\r
+  UINT16            QuestionId2;  // offset into variable storage for second value to compare\r
+} EFI_IFR_EQ_ID_ID;\r
+\r
+typedef struct {\r
+  EFI_IFR_OP_HEADER Header;\r
+  UINT16            VariableId;   // offset into variable storage\r
+  UINT16            Value;        // value to compare against\r
+} EFI_IFR_EQ_VAR_VAL;\r
+\r
+typedef struct {\r
+  EFI_IFR_OP_HEADER Header;\r
+} EFI_IFR_AND;\r
+\r
+typedef struct {\r
+  EFI_IFR_OP_HEADER Header;\r
+} EFI_IFR_OR;\r
+\r
+typedef struct {\r
+  EFI_IFR_OP_HEADER Header;\r
+} EFI_IFR_NOT;\r
+\r
+typedef struct {\r
+  EFI_IFR_OP_HEADER Header;\r
+} EFI_IFR_END_EXPR, EFI_IFR_END_IF;\r
+\r
+typedef struct {\r
+  EFI_IFR_OP_HEADER Header;\r
+  UINT16            FormId;\r
+  STRING_REF        Prompt;\r
+  STRING_REF        Help;\r
+  UINT8             Flags;\r
+  UINT16            Key;\r
+} EFI_IFR_SAVE_DEFAULTS;\r
+\r
+typedef struct {\r
+  EFI_IFR_OP_HEADER Header;\r
+  STRING_REF        Help;\r
+  STRING_REF        Text;\r
+  STRING_REF        TextTwo;      // optional text\r
+} EFI_IFR_INVENTORY;\r
+\r
+typedef struct {\r
+  EFI_IFR_OP_HEADER Header;\r
+  EFI_GUID          Guid;         // GUID for the variable\r
+  UINT16            VarId;        // variable store ID, as referenced elsewhere in the form\r
+  UINT16            Size;         // size of the variable storage\r
+} EFI_IFR_VARSTORE;\r
+\r
+typedef struct {\r
+  EFI_IFR_OP_HEADER Header;\r
+  UINT16            VarId;        // variable store ID, as referenced elsewhere in the form\r
+} EFI_IFR_VARSTORE_SELECT;\r
+\r
+//\r
+// Used for the ideqid VFR statement where two variable stores may be referenced in the\r
+// same VFR statement.\r
+// A browser should treat this as an EFI_IFR_VARSTORE_SELECT statement and assume that all following\r
+// IFR opcodes use the VarId as defined here.\r
+//\r
+typedef struct {\r
+  EFI_IFR_OP_HEADER Header;\r
+  UINT16            VarId;          // variable store ID, as referenced elsewhere in the form\r
+  UINT16            SecondaryVarId; // variable store ID, as referenced elsewhere in the form\r
+} EFI_IFR_VARSTORE_SELECT_PAIR;\r
+\r
+typedef struct {\r
+  EFI_IFR_OP_HEADER Header;\r
+} EFI_IFR_TRUE;\r
+\r
+typedef struct {\r
+  EFI_IFR_OP_HEADER Header;\r
+} EFI_IFR_FALSE;\r
+\r
+typedef struct {\r
+  EFI_IFR_OP_HEADER Header;\r
+} EFI_IFR_GT;\r
+\r
+typedef struct {\r
+  EFI_IFR_OP_HEADER Header;\r
+} EFI_IFR_GE;\r
+\r
+//\r
+// Save defaults and restore defaults have same structure\r
+//\r
+#define EFI_IFR_RESTORE_DEFAULTS  EFI_IFR_SAVE_DEFAULTS\r
+\r
+typedef struct {\r
+  EFI_IFR_OP_HEADER Header;\r
+  STRING_REF        Title;        // The string token for the banner title\r
+  UINT16            LineNumber;   // 1-based line number\r
+  UINT8             Alignment;    // left, center, or right-aligned\r
+} EFI_IFR_BANNER;\r
+\r
+#define EFI_IFR_BANNER_ALIGN_LEFT   0\r
+#define EFI_IFR_BANNER_ALIGN_CENTER 1\r
+#define EFI_IFR_BANNER_ALIGN_RIGHT  2\r
+#define EFI_IFR_BANNER_TIMEOUT      0xFF\r
+\r
+#pragma pack()\r
+\r
+#endif\r
diff --git a/Tools/Source/TianoTools/Include/Common/MultiPhase.h b/Tools/Source/TianoTools/Include/Common/MultiPhase.h
new file mode 100644 (file)
index 0000000..93867a5
--- /dev/null
@@ -0,0 +1,84 @@
+/** @file\r
+  This includes some definitions that will be used in both PEI and DXE phases.\r
+\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. This program and the accompanying materials                          \r
+  are licensed and made available under the terms and conditions of the BSD License         \r
+  which accompanies this distribution.  The full text of the license may be found at        \r
+  http://opensource.org/licenses/bsd-license.php                                            \r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+  Module Name:  MultiPhase.h\r
+\r
+**/\r
+\r
+#ifndef __MULTI_PHASE_H__\r
+#define __MULTI_PHASE_H__\r
+\r
+//\r
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\r
+//\r
+// Needed EFI defines for PEI\r
+//\r
+typedef UINT64  EFI_PHYSICAL_ADDRESS;\r
+\r
+typedef enum {\r
+  EfiReservedMemoryType,\r
+  EfiLoaderCode,\r
+  EfiLoaderData,\r
+  EfiBootServicesCode,\r
+  EfiBootServicesData,\r
+  EfiRuntimeServicesCode,\r
+  EfiRuntimeServicesData,\r
+  EfiConventionalMemory,\r
+  EfiUnusableMemory,\r
+  EfiACPIReclaimMemory,\r
+  EfiACPIMemoryNVS,\r
+  EfiMemoryMappedIO,\r
+  EfiMemoryMappedIOPortSpace,\r
+  EfiPalCode,\r
+  EfiMaxMemoryType\r
+} EFI_MEMORY_TYPE;\r
+\r
+typedef UINT32  EFI_STATUS_CODE_TYPE;\r
+typedef UINT32  EFI_STATUS_CODE_VALUE;\r
+\r
+typedef struct {\r
+  UINT16    HeaderSize;\r
+  UINT16    Size;\r
+  EFI_GUID  Type;\r
+} EFI_STATUS_CODE_DATA;\r
+\r
+typedef struct {\r
+  UINT64  Signature;\r
+  UINT32  Revision;\r
+  UINT32  HeaderSize;\r
+  UINT32  CRC32;\r
+  UINT32  Reserved;\r
+} EFI_TABLE_HEADER;\r
+\r
+#define EFI_PAGE_SIZE         4096\r
+\r
+\r
+typedef VOID    *EFI_HANDLE;\r
+typedef UINT16  EFI_HII_HANDLE;\r
+typedef UINT16  STRING_REF;\r
+typedef struct {\r
+  INT16     Value;\r
+  INT16     Exponent;\r
+} EFI_EXP_BASE10_DATA;\r
+\r
+//\r
+// Define macros to build data structure signatures from characters.\r
+//\r
+#define EFI_SIGNATURE_16(A, B)        ((A) | (B << 8))\r
+#define EFI_SIGNATURE_32(A, B, C, D)  (EFI_SIGNATURE_16 (A, B) | (EFI_SIGNATURE_16 (C, D) << 16))\r
+#define EFI_SIGNATURE_64(A, B, C, D, E, F, G, H) \\r
+    (EFI_SIGNATURE_32 (A, B, C, D) | ((UINT64) (EFI_SIGNATURE_32 (E, F, G, H)) << 32))\r
+\r
+\r
+#include <Protocol/DevicePath.h>\r
+\r
+#endif\r
diff --git a/Tools/Source/TianoTools/Include/Common/StatusCode.h b/Tools/Source/TianoTools/Include/Common/StatusCode.h
new file mode 100644 (file)
index 0000000..474ed10
--- /dev/null
@@ -0,0 +1,912 @@
+/** @file\r
+  Status Code Definitions, according to Intel Platform Innovation Framework \r
+  for EFI Status Codes Specification\r
+\r
+  The file is divided into sections for ease of use.\r
+\r
+<pre>\r
+  Section:    Contents:\r
+  1           General Status Code Definitions\r
+  2           Class definitions\r
+  3           Computing Unit Subclasses, Progress and Error Codes\r
+  4           Peripheral Subclasses, Progress and Error Codes.\r
+  5           IO Bus Subclasses, Progress and Error Codes.\r
+  6           Software Subclasses, Progress and Error Codes.\r
+  7           Debug Codes\r
+</pre>\r
+\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. This program and the accompanying materials                          \r
+  are licensed and made available under the terms and conditions of the BSD License         \r
+  which accompanies this distribution.  The full text of the license may be found at        \r
+  http://opensource.org/licenses/bsd-license.php                                            \r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+  Module Name:  StatusCode.h\r
+\r
+  @par Revision Reference:\r
+  Version 0.92.\r
+\r
+**/\r
+\r
+#ifndef _EFI_STATUS_CODE_H_\r
+#define _EFI_STATUS_CODE_H_\r
+\r
+\r
+//\r
+// /////////////////////////////////////////////////////////////////////////////\r
+// Section 1\r
+///////////////////////////////////////////////////////////////////////////////\r
+\r
+//\r
+// A Status Code Type is made up of the code type and severity\r
+// All values masked by EFI_STATUS_CODE_RESERVED_MASK are\r
+// reserved for use by this specification.\r
+//\r
+#define EFI_STATUS_CODE_TYPE_MASK     0x000000FF\r
+#define EFI_STATUS_CODE_SEVERITY_MASK 0xFF000000\r
+#define EFI_STATUS_CODE_RESERVED_MASK 0x00FFFF00\r
+\r
+//\r
+// Definition of code types, all other values masked by\r
+// EFI_STATUS_CODE_TYPE_MASK are reserved for use by\r
+// this specification.\r
+//\r
+#define EFI_PROGRESS_CODE 0x00000001\r
+#define EFI_ERROR_CODE    0x00000002\r
+#define EFI_DEBUG_CODE    0x00000003\r
+\r
+//\r
+// Definitions of severities, all other values masked by\r
+// EFI_STATUS_CODE_SEVERITY_MASK are reserved for use by\r
+// this specification.\r
+//\r
+#define EFI_ERROR_MINOR       0x40000000\r
+#define EFI_ERROR_MAJOR       0x80000000\r
+#define EFI_ERROR_UNRECOVERED 0x90000000\r
+#define EFI_ERROR_UNCONTAINED 0xA0000000\r
+\r
+//\r
+// A Status Code Value is made up of the class, subclass, and\r
+// an operation.  Classes, subclasses, and operations are defined\r
+// in the following sections.\r
+//\r
+#define EFI_STATUS_CODE_CLASS_MASK      0xFF000000\r
+#define EFI_STATUS_CODE_SUBCLASS_MASK   0x00FF0000\r
+#define EFI_STATUS_CODE_OPERATION_MASK  0x0000FFFF\r
+\r
+//\r
+// Data Hub Status Code class record definition\r
+//\r
+typedef struct {\r
+  EFI_STATUS_CODE_TYPE  CodeType;\r
+  EFI_STATUS_CODE_VALUE Value;\r
+  UINT32                Instance;\r
+  EFI_GUID              CallerId;\r
+  EFI_STATUS_CODE_DATA  Data;\r
+} DATA_HUB_STATUS_CODE_DATA_RECORD;\r
+\r
+//\r
+// /////////////////////////////////////////////////////////////////////////////\r
+// Section 2\r
+///////////////////////////////////////////////////////////////////////////////\r
+//\r
+// Class definitions\r
+// Values of 4-127 are reserved for future use by this\r
+// specification.\r
+// Values in the range 127-255 are reserved for OEM use.\r
+//\r
+#define EFI_COMPUTING_UNIT  0x00000000\r
+#define EFI_PERIPHERAL      0x01000000\r
+#define EFI_IO_BUS          0x02000000\r
+#define EFI_SOFTWARE        0x03000000\r
+\r
+//\r
+// General partitioning scheme for Progress and Error Codes are\r
+// 0x0000-0x0FFF  - Shared by all sub-classes in a given class\r
+// 0x1000-0x7FFF  - Subclass Specific\r
+// 0x8000-0xFFFF  - OEM specific\r
+//\r
+#define EFI_SUBCLASS_SPECIFIC 0x1000\r
+#define EFI_OEM_SPECIFIC      0x8000\r
+\r
+//\r
+// /////////////////////////////////////////////////////////////////////////////\r
+// Section 3\r
+///////////////////////////////////////////////////////////////////////////////\r
+//\r
+// Computing Unit Subclass definitions.\r
+// Values of 8-127 are reserved for future use by this\r
+// specification.\r
+// Values of 128-255 are reserved for OEM use.\r
+//\r
+#define EFI_COMPUTING_UNIT_UNSPECIFIED        (EFI_COMPUTING_UNIT | 0x00000000)\r
+#define EFI_COMPUTING_UNIT_HOST_PROCESSOR     (EFI_COMPUTING_UNIT | 0x00010000)\r
+#define EFI_COMPUTING_UNIT_FIRMWARE_PROCESSOR (EFI_COMPUTING_UNIT | 0x00020000)\r
+#define EFI_COMPUTING_UNIT_IO_PROCESSOR       (EFI_COMPUTING_UNIT | 0x00030000)\r
+#define EFI_COMPUTING_UNIT_CACHE              (EFI_COMPUTING_UNIT | 0x00040000)\r
+#define EFI_COMPUTING_UNIT_MEMORY             (EFI_COMPUTING_UNIT | 0x00050000)\r
+#define EFI_COMPUTING_UNIT_CHIPSET            (EFI_COMPUTING_UNIT | 0x00060000)\r
+\r
+//\r
+// Computing Unit Class Progress Code definitions.\r
+// These are shared by all subclasses.\r
+//\r
+#define EFI_CU_PC_INIT_BEGIN  0x00000000\r
+#define EFI_CU_PC_INIT_END    0x00000001\r
+\r
+//\r
+// Computing Unit Unspecified Subclass Progress Code definitions.\r
+//\r
+//\r
+// Computing Unit Host Processor Subclass Progress Code definitions.\r
+//\r
+#define EFI_CU_HP_PC_POWER_ON_INIT          (EFI_SUBCLASS_SPECIFIC | 0x00000000)\r
+#define EFI_CU_HP_PC_CACHE_INIT             (EFI_SUBCLASS_SPECIFIC | 0x00000001)\r
+#define EFI_CU_HP_PC_RAM_INIT               (EFI_SUBCLASS_SPECIFIC | 0x00000002)\r
+#define EFI_CU_HP_PC_MEMORY_CONTROLLER_INIT (EFI_SUBCLASS_SPECIFIC | 0x00000003)\r
+#define EFI_CU_HP_PC_IO_INIT                (EFI_SUBCLASS_SPECIFIC | 0x00000004)\r
+#define EFI_CU_HP_PC_BSP_SELECT             (EFI_SUBCLASS_SPECIFIC | 0x00000005)\r
+#define EFI_CU_HP_PC_BSP_RESELECT           (EFI_SUBCLASS_SPECIFIC | 0x00000006)\r
+#define EFI_CU_HP_PC_AP_INIT                (EFI_SUBCLASS_SPECIFIC | 0x00000007)\r
+#define EFI_CU_HP_PC_SMM_INIT               (EFI_SUBCLASS_SPECIFIC | 0x00000008)\r
+\r
+//\r
+// Computing Unit Firmware Processor Subclass Progress Code definitions.\r
+//\r
+//\r
+// Computing Unit IO Processor Subclass Progress Code definitions.\r
+//\r
+//\r
+// Computing Unit Cache Subclass Progress Code definitions.\r
+//\r
+#define EFI_CU_CACHE_PC_PRESENCE_DETECT (EFI_SUBCLASS_SPECIFIC | 0x00000000)\r
+#define EFI_CU_CACHE_PC_CONFIGURATION   (EFI_SUBCLASS_SPECIFIC | 0x00000001)\r
+\r
+//\r
+// Computing Unit Memory Subclass Progress Code definitions.\r
+//\r
+#define EFI_CU_MEMORY_PC_SPD_READ         (EFI_SUBCLASS_SPECIFIC | 0x00000000)\r
+#define EFI_CU_MEMORY_PC_PRESENCE_DETECT  (EFI_SUBCLASS_SPECIFIC | 0x00000001)\r
+#define EFI_CU_MEMORY_PC_TIMING           (EFI_SUBCLASS_SPECIFIC | 0x00000002)\r
+#define EFI_CU_MEMORY_PC_CONFIGURING      (EFI_SUBCLASS_SPECIFIC | 0x00000003)\r
+#define EFI_CU_MEMORY_PC_OPTIMIZING       (EFI_SUBCLASS_SPECIFIC | 0x00000004)\r
+#define EFI_CU_MEMORY_PC_INIT             (EFI_SUBCLASS_SPECIFIC | 0x00000005)\r
+#define EFI_CU_MEMORY_PC_TEST             (EFI_SUBCLASS_SPECIFIC | 0x00000006)\r
+\r
+//\r
+// Computing Unit Chipset Subclass Progress Code definitions.\r
+//\r
+//\r
+// Computing Unit Class Error Code definitions.\r
+// These are shared by all subclasses.\r
+//\r
+#define EFI_CU_EC_NON_SPECIFIC    0x00000000\r
+#define EFI_CU_EC_DISABLED        0x00000001\r
+#define EFI_CU_EC_NOT_SUPPORTED   0x00000002\r
+#define EFI_CU_EC_NOT_DETECTED    0x00000003\r
+#define EFI_CU_EC_NOT_CONFIGURED  0x00000004\r
+\r
+//\r
+// Computing Unit Unspecified Subclass Error Code definitions.\r
+//\r
+//\r
+// Computing Unit Host Processor Subclass Error Code definitions.\r
+//\r
+#define EFI_CU_HP_EC_INVALID_TYPE         (EFI_SUBCLASS_SPECIFIC | 0x00000000)\r
+#define EFI_CU_HP_EC_INVALID_SPEED        (EFI_SUBCLASS_SPECIFIC | 0x00000001)\r
+#define EFI_CU_HP_EC_MISMATCH             (EFI_SUBCLASS_SPECIFIC | 0x00000002)\r
+#define EFI_CU_HP_EC_TIMER_EXPIRED        (EFI_SUBCLASS_SPECIFIC | 0x00000003)\r
+#define EFI_CU_HP_EC_SELF_TEST            (EFI_SUBCLASS_SPECIFIC | 0x00000004)\r
+#define EFI_CU_HP_EC_INTERNAL             (EFI_SUBCLASS_SPECIFIC | 0x00000005)\r
+#define EFI_CU_HP_EC_THERMAL              (EFI_SUBCLASS_SPECIFIC | 0x00000006)\r
+#define EFI_CU_HP_EC_LOW_VOLTAGE          (EFI_SUBCLASS_SPECIFIC | 0x00000007)\r
+#define EFI_CU_HP_EC_HIGH_VOLTAGE         (EFI_SUBCLASS_SPECIFIC | 0x00000008)\r
+#define EFI_CU_HP_EC_CACHE                (EFI_SUBCLASS_SPECIFIC | 0x00000009)\r
+#define EFI_CU_HP_EC_MICROCODE_UPDATE     (EFI_SUBCLASS_SPECIFIC | 0x0000000A)\r
+#define EFI_CU_HP_EC_CORRECTABLE          (EFI_SUBCLASS_SPECIFIC | 0x0000000B)\r
+#define EFI_CU_HP_EC_UNCORRECTABLE        (EFI_SUBCLASS_SPECIFIC | 0x0000000C)\r
+#define EFI_CU_HP_EC_NO_MICROCODE_UPDATE  (EFI_SUBCLASS_SPECIFIC | 0x0000000D)\r
+\r
+//\r
+// Computing Unit Firmware Processor Subclass Error Code definitions.\r
+//\r
+#define EFI_CU_FP_EC_HARD_FAIL  (EFI_SUBCLASS_SPECIFIC | 0x00000000)\r
+#define EFI_CU_FP_EC_SOFT_FAIL  (EFI_SUBCLASS_SPECIFIC | 0x00000001)\r
+#define EFI_CU_FP_EC_COMM_ERROR (EFI_SUBCLASS_SPECIFIC | 0x00000002)\r
+\r
+//\r
+// Computing Unit IO Processor Subclass Error Code definitions.\r
+//\r
+//\r
+// Computing Unit Cache Subclass Error Code definitions.\r
+//\r
+#define EFI_CU_CACHE_EC_INVALID_TYPE  (EFI_SUBCLASS_SPECIFIC | 0x00000000)\r
+#define EFI_CU_CACHE_EC_INVALID_SPEED (EFI_SUBCLASS_SPECIFIC | 0x00000001)\r
+#define EFI_CU_CACHE_EC_INVALID_SIZE  (EFI_SUBCLASS_SPECIFIC | 0x00000002)\r
+#define EFI_CU_CACHE_EC_MISMATCH      (EFI_SUBCLASS_SPECIFIC | 0x00000003)\r
+\r
+//\r
+// Computing Unit Memory Subclass Error Code definitions.\r
+//\r
+#define EFI_CU_MEMORY_EC_INVALID_TYPE   (EFI_SUBCLASS_SPECIFIC | 0x00000000)\r
+#define EFI_CU_MEMORY_EC_INVALID_SPEED  (EFI_SUBCLASS_SPECIFIC | 0x00000001)\r
+#define EFI_CU_MEMORY_EC_CORRECTABLE    (EFI_SUBCLASS_SPECIFIC | 0x00000002)\r
+#define EFI_CU_MEMORY_EC_UNCORRECTABLE  (EFI_SUBCLASS_SPECIFIC | 0x00000003)\r
+#define EFI_CU_MEMORY_EC_SPD_FAIL       (EFI_SUBCLASS_SPECIFIC | 0x00000004)\r
+#define EFI_CU_MEMORY_EC_INVALID_SIZE   (EFI_SUBCLASS_SPECIFIC | 0x00000005)\r
+#define EFI_CU_MEMORY_EC_MISMATCH       (EFI_SUBCLASS_SPECIFIC | 0x00000006)\r
+#define EFI_CU_MEMORY_EC_S3_RESUME_FAIL (EFI_SUBCLASS_SPECIFIC | 0x00000007)\r
+#define EFI_CU_MEMORY_EC_UPDATE_FAIL    (EFI_SUBCLASS_SPECIFIC | 0x00000008)\r
+#define EFI_CU_MEMORY_EC_NONE_DETECTED  (EFI_SUBCLASS_SPECIFIC | 0x00000009)\r
+#define EFI_CU_MEMORY_EC_NONE_USEFUL    (EFI_SUBCLASS_SPECIFIC | 0x0000000A)\r
+\r
+//\r
+// Computing Unit Chipset Subclass Error Code definitions.\r
+//\r
+\r
+///////////////////////////////////////////////////////////////////////////////\r
+// Section 4\r
+///////////////////////////////////////////////////////////////////////////////\r
+//\r
+// Peripheral Subclass definitions.\r
+// Values of 12-127 are reserved for future use by this\r
+// specification.\r
+// Values of 128-255 are reserved for OEM use.\r
+//\r
+#define EFI_PERIPHERAL_UNSPECIFIED      (EFI_PERIPHERAL | 0x00000000)\r
+#define EFI_PERIPHERAL_KEYBOARD         (EFI_PERIPHERAL | 0x00010000)\r
+#define EFI_PERIPHERAL_MOUSE            (EFI_PERIPHERAL | 0x00020000)\r
+#define EFI_PERIPHERAL_LOCAL_CONSOLE    (EFI_PERIPHERAL | 0x00030000)\r
+#define EFI_PERIPHERAL_REMOTE_CONSOLE   (EFI_PERIPHERAL | 0x00040000)\r
+#define EFI_PERIPHERAL_SERIAL_PORT      (EFI_PERIPHERAL | 0x00050000)\r
+#define EFI_PERIPHERAL_PARALLEL_PORT    (EFI_PERIPHERAL | 0x00060000)\r
+#define EFI_PERIPHERAL_FIXED_MEDIA      (EFI_PERIPHERAL | 0x00070000)\r
+#define EFI_PERIPHERAL_REMOVABLE_MEDIA  (EFI_PERIPHERAL | 0x00080000)\r
+#define EFI_PERIPHERAL_AUDIO_INPUT      (EFI_PERIPHERAL | 0x00090000)\r
+#define EFI_PERIPHERAL_AUDIO_OUTPUT     (EFI_PERIPHERAL | 0x000A0000)\r
+#define EFI_PERIPHERAL_LCD_DEVICE       (EFI_PERIPHERAL | 0x000B0000)\r
+#define EFI_PERIPHERAL_NETWORK          (EFI_PERIPHERAL | 0x000C0000)\r
+\r
+//\r
+// Peripheral Class Progress Code definitions.\r
+// These are shared by all subclasses.\r
+//\r
+#define EFI_P_PC_INIT             0x00000000\r
+#define EFI_P_PC_RESET            0x00000001\r
+#define EFI_P_PC_DISABLE          0x00000002\r
+#define EFI_P_PC_PRESENCE_DETECT  0x00000003\r
+#define EFI_P_PC_ENABLE           0x00000004\r
+#define EFI_P_PC_RECONFIG         0x00000005\r
+#define EFI_P_PC_DETECTED         0x00000006\r
+\r
+//\r
+// Peripheral Class Unspecified Subclass Progress Code definitions.\r
+//\r
+//\r
+// Peripheral Class Keyboard Subclass Progress Code definitions.\r
+//\r
+#define EFI_P_KEYBOARD_PC_CLEAR_BUFFER  (EFI_SUBCLASS_SPECIFIC | 0x00000000)\r
+#define EFI_P_KEYBOARD_PC_SELF_TEST     (EFI_SUBCLASS_SPECIFIC | 0x00000001)\r
+\r
+//\r
+// Peripheral Class Mouse Subclass Progress Code definitions.\r
+//\r
+#define EFI_P_MOUSE_PC_SELF_TEST  (EFI_SUBCLASS_SPECIFIC | 0x00000000)\r
+\r
+//\r
+// Peripheral Class Local Console Subclass Progress Code definitions.\r
+//\r
+//\r
+// Peripheral Class Remote Console Subclass Progress Code definitions.\r
+//\r
+//\r
+// Peripheral Class Serial Port Subclass Progress Code definitions.\r
+//\r
+#define EFI_P_SERIAL_PORT_PC_CLEAR_BUFFER (EFI_SUBCLASS_SPECIFIC | 0x00000000)\r
+\r
+//\r
+// Peripheral Class Parallel Port Subclass Progress Code definitions.\r
+//\r
+//\r
+// Peripheral Class Fixed Media Subclass Progress Code definitions.\r
+//\r
+//\r
+// Peripheral Class Removable Media Subclass Progress Code definitions.\r
+//\r
+//\r
+// Peripheral Class Audio Input Subclass Progress Code definitions.\r
+//\r
+//\r
+// Peripheral Class Audio Output Subclass Progress Code definitions.\r
+//\r
+//\r
+// Peripheral Class LCD Device Subclass Progress Code definitions.\r
+//\r
+//\r
+// Peripheral Class Network Subclass Progress Code definitions.\r
+//\r
+//\r
+// Peripheral Class Error Code definitions.\r
+// These are shared by all subclasses.\r
+//\r
+#define EFI_P_EC_NON_SPECIFIC       0x00000000\r
+#define EFI_P_EC_DISABLED           0x00000001\r
+#define EFI_P_EC_NOT_SUPPORTED      0x00000002\r
+#define EFI_P_EC_NOT_DETECTED       0x00000003\r
+#define EFI_P_EC_NOT_CONFIGURED     0x00000004\r
+#define EFI_P_EC_INTERFACE_ERROR    0x00000005\r
+#define EFI_P_EC_CONTROLLER_ERROR   0x00000006\r
+#define EFI_P_EC_INPUT_ERROR        0x00000007\r
+#define EFI_P_EC_OUTPUT_ERROR       0x00000008\r
+#define EFI_P_EC_RESOURCE_CONFLICT  0x00000009\r
+\r
+//\r
+// Peripheral Class Unspecified Subclass Error Code definitions.\r
+//\r
+//\r
+// Peripheral Class Keyboard Subclass Error Code definitions.\r
+//\r
+#define EFI_P_KEYBOARD_EC_LOCKED    (EFI_SUBCLASS_SPECIFIC | 0x00000000)\r
+#define EFI_P_KEYBOARD_EC_STUCK_KEY (EFI_SUBCLASS_SPECIFIC | 0x00000001)\r
+\r
+//\r
+// Peripheral Class Mouse Subclass Error Code definitions.\r
+//\r
+#define EFI_P_MOUSE_EC_LOCKED (EFI_SUBCLASS_SPECIFIC | 0x00000000)\r
+\r
+//\r
+// Peripheral Class Local Console Subclass Error Code definitions.\r
+//\r
+//\r
+// Peripheral Class Remote Console Subclass Error Code definitions.\r
+//\r
+//\r
+// Peripheral Class Serial Port Subclass Error Code definitions.\r
+//\r
+//\r
+// Peripheral Class Parallel Port Subclass Error Code definitions.\r
+//\r
+//\r
+// Peripheral Class Fixed Media Subclass Error Code definitions.\r
+//\r
+//\r
+// Peripheral Class Removable Media Subclass Error Code definitions.\r
+//\r
+//\r
+// Peripheral Class Audio Input Subclass Error Code definitions.\r
+//\r
+//\r
+// Peripheral Class Audio Output Subclass Error Code definitions.\r
+//\r
+//\r
+// Peripheral Class LCD Device Subclass Error Code definitions.\r
+//\r
+//\r
+// Peripheral Class Network Subclass Error Code definitions.\r
+//\r
+\r
+///////////////////////////////////////////////////////////////////////////////\r
+// Section 5\r
+///////////////////////////////////////////////////////////////////////////////\r
+//\r
+// IO Bus Subclass definitions.\r
+// Values of 14-127 are reserved for future use by this\r
+// specification.\r
+// Values of 128-255 are reserved for OEM use.\r
+//\r
+#define EFI_IO_BUS_UNSPECIFIED  (EFI_IO_BUS | 0x00000000)\r
+#define EFI_IO_BUS_PCI          (EFI_IO_BUS | 0x00010000)\r
+#define EFI_IO_BUS_USB          (EFI_IO_BUS | 0x00020000)\r
+#define EFI_IO_BUS_IBA          (EFI_IO_BUS | 0x00030000)\r
+#define EFI_IO_BUS_AGP          (EFI_IO_BUS | 0x00040000)\r
+#define EFI_IO_BUS_PC_CARD      (EFI_IO_BUS | 0x00050000)\r
+#define EFI_IO_BUS_LPC          (EFI_IO_BUS | 0x00060000)\r
+#define EFI_IO_BUS_SCSI         (EFI_IO_BUS | 0x00070000)\r
+#define EFI_IO_BUS_ATA_ATAPI    (EFI_IO_BUS | 0x00080000)\r
+#define EFI_IO_BUS_FC           (EFI_IO_BUS | 0x00090000)\r
+#define EFI_IO_BUS_IP_NETWORK   (EFI_IO_BUS | 0x000A0000)\r
+#define EFI_IO_BUS_SMBUS        (EFI_IO_BUS | 0x000B0000)\r
+#define EFI_IO_BUS_I2C          (EFI_IO_BUS | 0x000C0000)\r
+\r
+//\r
+// IO Bus Class Progress Code definitions.\r
+// These are shared by all subclasses.\r
+//\r
+#define EFI_IOB_PC_INIT     0x00000000\r
+#define EFI_IOB_PC_RESET    0x00000001\r
+#define EFI_IOB_PC_DISABLE  0x00000002\r
+#define EFI_IOB_PC_DETECT   0x00000003\r
+#define EFI_IOB_PC_ENABLE   0x00000004\r
+#define EFI_IOB_PC_RECONFIG 0x00000005\r
+#define EFI_IOB_PC_HOTPLUG  0x00000006\r
+\r
+//\r
+// IO Bus Class Unspecified Subclass Progress Code definitions.\r
+//\r
+//\r
+// IO Bus Class PCI Subclass Progress Code definitions.\r
+//\r
+#define EFI_IOB_PCI_PC_BUS_ENUM   (EFI_SUBCLASS_SPECIFIC | 0x00000000)\r
+#define EFI_IOB_PCI_PC_RES_ALLOC  (EFI_SUBCLASS_SPECIFIC | 0x00000001)\r
+#define EFI_IOB_PCI_PC_HPC_INIT   (EFI_SUBCLASS_SPECIFIC | 0x00000002)\r
+\r
+//\r
+// IO Bus Class USB Subclass Progress Code definitions.\r
+//\r
+//\r
+// IO Bus Class IBA Subclass Progress Code definitions.\r
+//\r
+//\r
+// IO Bus Class AGP Subclass Progress Code definitions.\r
+//\r
+//\r
+// IO Bus Class PC Card Subclass Progress Code definitions.\r
+//\r
+//\r
+// IO Bus Class LPC Subclass Progress Code definitions.\r
+//\r
+//\r
+// IO Bus Class SCSI Subclass Progress Code definitions.\r
+//\r
+//\r
+// IO Bus Class ATA/ATAPI Subclass Progress Code definitions.\r
+//\r
+#define EFI_IOB_ATA_BUS_SMART_ENABLE          (EFI_SUBCLASS_SPECIFIC | 0x00000000)\r
+#define EFI_IOB_ATA_BUS_SMART_DISABLE         (EFI_SUBCLASS_SPECIFIC | 0x00000001)\r
+#define EFI_IOB_ATA_BUS_SMART_OVERTHRESHOLD   (EFI_SUBCLASS_SPECIFIC | 0x00000002)\r
+#define EFI_IOB_ATA_BUS_SMART_UNDERTHRESHOLD  (EFI_SUBCLASS_SPECIFIC | 0x00000003)\r
+\r
+//\r
+// IO Bus Class FC Subclass Progress Code definitions.\r
+//\r
+//\r
+// IO Bus Class IP Network Subclass Progress Code definitions.\r
+//\r
+//\r
+// IO Bus Class SMBUS Subclass Progress Code definitions.\r
+//\r
+//\r
+// IO Bus Class I2C Subclass Progress Code definitions.\r
+//\r
+//\r
+// IO Bus Class Error Code definitions.\r
+// These are shared by all subclasses.\r
+//\r
+#define EFI_IOB_EC_NON_SPECIFIC       0x00000000\r
+#define EFI_IOB_EC_DISABLED           0x00000001\r
+#define EFI_IOB_EC_NOT_SUPPORTED      0x00000002\r
+#define EFI_IOB_EC_NOT_DETECTED       0x00000003\r
+#define EFI_IOB_EC_NOT_CONFIGURED     0x00000004\r
+#define EFI_IOB_EC_INTERFACE_ERROR    0x00000005\r
+#define EFI_IOB_EC_CONTROLLER_ERROR   0x00000006\r
+#define EFI_IOB_EC_READ_ERROR         0x00000007\r
+#define EFI_IOB_EC_WRITE_ERROR        0x00000008\r
+#define EFI_IOB_EC_RESOURCE_CONFLICT  0x00000009\r
+\r
+//\r
+// IO Bus Class Unspecified Subclass Error Code definitions.\r
+//\r
+//\r
+// IO Bus Class PCI Subclass Error Code definitions.\r
+//\r
+#define EFI_IOB_PCI_EC_PERR (EFI_SUBCLASS_SPECIFIC | 0x00000000)\r
+#define EFI_IOB_PCI_EC_SERR (EFI_SUBCLASS_SPECIFIC | 0x00000001)\r
+\r
+//\r
+// IO Bus Class USB Subclass Error Code definitions.\r
+//\r
+//\r
+// IO Bus Class IBA Subclass Error Code definitions.\r
+//\r
+//\r
+// IO Bus Class AGP Subclass Error Code definitions.\r
+//\r
+//\r
+// IO Bus Class PC Card Subclass Error Code definitions.\r
+//\r
+//\r
+// IO Bus Class LPC Subclass Error Code definitions.\r
+//\r
+//\r
+// IO Bus Class SCSI Subclass Error Code definitions.\r
+//\r
+//\r
+// IO Bus Class ATA/ATAPI Subclass Error Code definitions.\r
+//\r
+#define EFI_IOB_ATA_BUS_SMART_NOTSUPPORTED  (EFI_SUBCLASS_SPECIFIC | 0x00000000)\r
+#define EFI_IOB_ATA_BUS_SMART_DISABLED      (EFI_SUBCLASS_SPECIFIC | 0x00000001)\r
+\r
+//\r
+// IO Bus Class FC Subclass Error Code definitions.\r
+//\r
+//\r
+// IO Bus Class IP Network Subclass Error Code definitions.\r
+//\r
+//\r
+// IO Bus Class SMBUS Subclass Error Code definitions.\r
+//\r
+//\r
+// IO Bus Class I2C Subclass Error Code definitions.\r
+//\r
+\r
+///////////////////////////////////////////////////////////////////////////////\r
+// Section 6\r
+///////////////////////////////////////////////////////////////////////////////\r
+//\r
+// Software Subclass definitions.\r
+// Values of 14-127 are reserved for future use by this\r
+// specification.\r
+// Values of 128-255 are reserved for OEM use.\r
+//\r
+#define EFI_SOFTWARE_UNSPECIFIED          (EFI_SOFTWARE | 0x00000000)\r
+#define EFI_SOFTWARE_SEC                  (EFI_SOFTWARE | 0x00010000)\r
+#define EFI_SOFTWARE_PEI_CORE             (EFI_SOFTWARE | 0x00020000)\r
+#define EFI_SOFTWARE_PEI_MODULE           (EFI_SOFTWARE | 0x00030000)\r
+#define EFI_SOFTWARE_DXE_CORE             (EFI_SOFTWARE | 0x00040000)\r
+#define EFI_SOFTWARE_DXE_BS_DRIVER        (EFI_SOFTWARE | 0x00050000)\r
+#define EFI_SOFTWARE_DXE_RT_DRIVER        (EFI_SOFTWARE | 0x00060000)\r
+#define EFI_SOFTWARE_SMM_DRIVER           (EFI_SOFTWARE | 0x00070000)\r
+#define EFI_SOFTWARE_EFI_APPLICATION      (EFI_SOFTWARE | 0x00080000)\r
+#define EFI_SOFTWARE_EFI_OS_LOADER        (EFI_SOFTWARE | 0x00090000)\r
+#define EFI_SOFTWARE_RT                   (EFI_SOFTWARE | 0x000A0000)\r
+#define EFI_SOFTWARE_AL                   (EFI_SOFTWARE | 0x000B0000)\r
+#define EFI_SOFTWARE_EBC_EXCEPTION        (EFI_SOFTWARE | 0x000C0000)\r
+#define EFI_SOFTWARE_IA32_EXCEPTION       (EFI_SOFTWARE | 0x000D0000)\r
+#define EFI_SOFTWARE_IPF_EXCEPTION        (EFI_SOFTWARE | 0x000E0000)\r
+#define EFI_SOFTWARE_PEI_SERVICE          (EFI_SOFTWARE | 0x000F0000)\r
+#define EFI_SOFTWARE_EFI_BOOT_SERVICE     (EFI_SOFTWARE | 0x00100000)\r
+#define EFI_SOFTWARE_EFI_RUNTIME_SERVICE  (EFI_SOFTWARE | 0x00110000)\r
+#define EFI_SOFTWARE_EFI_DXE_SERVICE      (EFI_SOFTWARE | 0x00120000)\r
+\r
+//\r
+// Software Class Progress Code definitions.\r
+// These are shared by all subclasses.\r
+//\r
+#define EFI_SW_PC_INIT                0x00000000\r
+#define EFI_SW_PC_LOAD                0x00000001\r
+#define EFI_SW_PC_INIT_BEGIN          0x00000002\r
+#define EFI_SW_PC_INIT_END            0x00000003\r
+#define EFI_SW_PC_AUTHENTICATE_BEGIN  0x00000004\r
+#define EFI_SW_PC_AUTHENTICATE_END    0x00000005\r
+#define EFI_SW_PC_INPUT_WAIT          0x00000006\r
+#define EFI_SW_PC_USER_SETUP          0x00000007\r
+\r
+//\r
+// Software Class Unspecified Subclass Progress Code definitions.\r
+//\r
+//\r
+// Software Class SEC Subclass Progress Code definitions.\r
+//\r
+#define EFI_SW_SEC_PC_ENTRY_POINT     (EFI_SUBCLASS_SPECIFIC | 0x00000000)\r
+#define EFI_SW_SEC_PC_HANDOFF_TO_NEXT (EFI_SUBCLASS_SPECIFIC | 0x00000001)\r
+\r
+//\r
+// Software Class PEI Core Subclass Progress Code definitions.\r
+//\r
+#define EFI_SW_PEI_CORE_PC_ENTRY_POINT      (EFI_SUBCLASS_SPECIFIC | 0x00000000)\r
+#define EFI_SW_PEI_CORE_PC_HANDOFF_TO_NEXT  (EFI_SUBCLASS_SPECIFIC | 0x00000001)\r
+#define EFI_SW_PEI_CORE_PC_RETURN_TO_LAST   (EFI_SUBCLASS_SPECIFIC | 0x00000002)\r
+\r
+//\r
+// Software Class PEI Module Subclass Progress Code definitions.\r
+//\r
+#define EFI_SW_PEIM_PC_RECOVERY_BEGIN (EFI_SUBCLASS_SPECIFIC | 0x00000000)\r
+#define EFI_SW_PEIM_PC_CAPSULE_LOAD   (EFI_SUBCLASS_SPECIFIC | 0x00000001)\r
+#define EFI_SW_PEIM_PC_CAPSULE_START  (EFI_SUBCLASS_SPECIFIC | 0x00000001)\r
+#define EFI_SW_PEIM_PC_RECOVERY_USER  (EFI_SUBCLASS_SPECIFIC | 0x00000003)\r
+#define EFI_SW_PEIM_PC_RECOVERY_AUTO  (EFI_SUBCLASS_SPECIFIC | 0x00000004)\r
+\r
+//\r
+// Software Class DXE Core Subclass Progress Code definitions.\r
+//\r
+#define EFI_SW_DXE_CORE_PC_ENTRY_POINT      (EFI_SUBCLASS_SPECIFIC | 0x00000000)\r
+#define EFI_SW_DXE_CORE_PC_HANDOFF_TO_NEXT  (EFI_SUBCLASS_SPECIFIC | 0x00000001)\r
+#define EFI_SW_DXE_CORE_PC_RETURN_TO_LAST   (EFI_SUBCLASS_SPECIFIC | 0x00000002)\r
+#define EFI_SW_DXE_CORE_PC_START_DRIVER     (EFI_SUBCLASS_SPECIFIC | 0x00000003)\r
+\r
+//\r
+// Software Class DXE BS Driver Subclass Progress Code definitions.\r
+//\r
+#define EFI_SW_DXE_BS_PC_LEGACY_OPROM_INIT            (EFI_SUBCLASS_SPECIFIC | 0x00000000)\r
+#define EFI_SW_DXE_BS_PC_READY_TO_BOOT_EVENT          (EFI_SUBCLASS_SPECIFIC | 0x00000001)\r
+#define EFI_SW_DXE_BS_PC_LEGACY_BOOT_EVENT            (EFI_SUBCLASS_SPECIFIC | 0x00000002)\r
+#define EFI_SW_DXE_BS_PC_EXIT_BOOT_SERVICES_EVENT     (EFI_SUBCLASS_SPECIFIC | 0x00000003)\r
+#define EFI_SW_DXE_BS_PC_VIRTUAL_ADDRESS_CHANGE_EVENT (EFI_SUBCLASS_SPECIFIC | 0x00000004)\r
+#define EFI_SW_DXE_BS_PC_BEGIN_CONNECTING_DRIVERS     (EFI_SUBCLASS_SPECIFIC | 0x00000005)\r
+#define EFI_SW_DXE_BS_PC_VERIFYING_PASSWORD           (EFI_SUBCLASS_SPECIFIC | 0x00000006)\r
+\r
+//\r
+// Software Class DXE RT Driver Subclass Progress Code definitions.\r
+//\r
+#define EFI_SW_DXE_RT_PC_S0 (EFI_SUBCLASS_SPECIFIC | 0x00000000)\r
+#define EFI_SW_DXE_RT_PC_S1 (EFI_SUBCLASS_SPECIFIC | 0x00000001)\r
+#define EFI_SW_DXE_RT_PC_S2 (EFI_SUBCLASS_SPECIFIC | 0x00000002)\r
+#define EFI_SW_DXE_RT_PC_S3 (EFI_SUBCLASS_SPECIFIC | 0x00000003)\r
+#define EFI_SW_DXE_RT_PC_S4 (EFI_SUBCLASS_SPECIFIC | 0x00000004)\r
+#define EFI_SW_DXE_RT_PC_S5 (EFI_SUBCLASS_SPECIFIC | 0x00000005)\r
+\r
+//\r
+// Software Class SMM Driver Subclass Progress Code definitions.\r
+//\r
+//\r
+// Software Class EFI Application Subclass Progress Code definitions.\r
+//\r
+//\r
+// Software Class EFI OS Loader Subclass Progress Code definitions.\r
+//\r
+//\r
+// Software Class EFI RT Subclass Progress Code definitions.\r
+//\r
+#define EFI_SW_RT_PC_ENTRY_POINT      (EFI_SUBCLASS_SPECIFIC | 0x00000000)\r
+#define EFI_SW_RT_PC_HANDOFF_TO_NEXT  (EFI_SUBCLASS_SPECIFIC | 0x00000001)\r
+#define EFI_SW_RT_PC_RETURN_TO_LAST   (EFI_SUBCLASS_SPECIFIC | 0x00000002)\r
+\r
+//\r
+// Software Class EFI AL Subclass Progress Code definitions.\r
+//\r
+#define EFI_SW_AL_PC_ENTRY_POINT    (EFI_SUBCLASS_SPECIFIC | 0x00000000)\r
+#define EFI_SW_AL_PC_RETURN_TO_LAST (EFI_SUBCLASS_SPECIFIC | 0x00000001)\r
+\r
+//\r
+// Software Class EBC Exception Subclass Progress Code definitions.\r
+//\r
+//\r
+// Software Class IA32 Exception Subclass Progress Code definitions.\r
+//\r
+//\r
+// Software Class IPF Exception Subclass Progress Code definitions.\r
+//\r
+//\r
+// Software Class PEI Services Subclass Progress Code definitions.\r
+//\r
+#define EFI_SW_PS_PC_INSTALL_PPI            (EFI_SUBCLASS_SPECIFIC | 0x00000000)\r
+#define EFI_SW_PS_PC_REINSTALL_PPI          (EFI_SUBCLASS_SPECIFIC | 0x00000001)\r
+#define EFI_SW_PS_PC_LOCATE_PPI             (EFI_SUBCLASS_SPECIFIC | 0x00000002)\r
+#define EFI_SW_PS_PC_NOTIFY_PPI             (EFI_SUBCLASS_SPECIFIC | 0x00000003)\r
+#define EFI_SW_PS_PC_GET_BOOT_MODE          (EFI_SUBCLASS_SPECIFIC | 0x00000004)\r
+#define EFI_SW_PS_PC_SET_BOOT_MODE          (EFI_SUBCLASS_SPECIFIC | 0x00000005)\r
+#define EFI_SW_PS_PC_GET_HOB_LIST           (EFI_SUBCLASS_SPECIFIC | 0x00000006)\r
+#define EFI_SW_PS_PC_CREATE_HOB             (EFI_SUBCLASS_SPECIFIC | 0x00000007)\r
+#define EFI_SW_PS_PC_FFS_FIND_NEXT_VOLUME   (EFI_SUBCLASS_SPECIFIC | 0x00000008)\r
+#define EFI_SW_PS_PC_FFS_FIND_NEXT_FILE     (EFI_SUBCLASS_SPECIFIC | 0x00000009)\r
+#define EFI_SW_PS_PC_FFS_FIND_SECTION_DATA  (EFI_SUBCLASS_SPECIFIC | 0x0000000A)\r
+#define EFI_SW_PS_PC_INSTALL_PEI_MEMORY     (EFI_SUBCLASS_SPECIFIC | 0x0000000B)\r
+#define EFI_SW_PS_PC_ALLOCATE_PAGES         (EFI_SUBCLASS_SPECIFIC | 0x0000000C)\r
+#define EFI_SW_PS_PC_ALLOCATE_POOL          (EFI_SUBCLASS_SPECIFIC | 0x0000000D)\r
+#define EFI_SW_PS_PC_COPY_MEM               (EFI_SUBCLASS_SPECIFIC | 0x0000000E)\r
+#define EFI_SW_PS_PC_SET_MEM                (EFI_SUBCLASS_SPECIFIC | 0x0000000F)\r
+\r
+//\r
+// Software Class EFI Boot Services Subclass Progress Code definitions.\r
+//\r
+#define EFI_SW_BS_PC_RAISE_TPL                      (EFI_SUBCLASS_SPECIFIC | 0x00000000)\r
+#define EFI_SW_BS_PC_RESTORE_TPL                    (EFI_SUBCLASS_SPECIFIC | 0x00000001)\r
+#define EFI_SW_BS_PC_ALLOCATE_PAGES                 (EFI_SUBCLASS_SPECIFIC | 0x00000002)\r
+#define EFI_SW_BS_PC_FREE_PAGES                     (EFI_SUBCLASS_SPECIFIC | 0x00000003)\r
+#define EFI_SW_BS_PC_GET_MEMORY_MAP                 (EFI_SUBCLASS_SPECIFIC | 0x00000004)\r
+#define EFI_SW_BS_PC_ALLOCATE_POOL                  (EFI_SUBCLASS_SPECIFIC | 0x00000005)\r
+#define EFI_SW_BS_PC_FREE_POOL                      (EFI_SUBCLASS_SPECIFIC | 0x00000006)\r
+#define EFI_SW_BS_PC_CREATE_EVENT                   (EFI_SUBCLASS_SPECIFIC | 0x00000007)\r
+#define EFI_SW_BS_PC_SET_TIMER                      (EFI_SUBCLASS_SPECIFIC | 0x00000008)\r
+#define EFI_SW_BS_PC_WAIT_FOR_EVENT                 (EFI_SUBCLASS_SPECIFIC | 0x00000009)\r
+#define EFI_SW_BS_PC_SIGNAL_EVENT                   (EFI_SUBCLASS_SPECIFIC | 0x0000000A)\r
+#define EFI_SW_BS_PC_CLOSE_EVENT                    (EFI_SUBCLASS_SPECIFIC | 0x0000000B)\r
+#define EFI_SW_BS_PC_CHECK_EVENT                    (EFI_SUBCLASS_SPECIFIC | 0x0000000C)\r
+#define EFI_SW_BS_PC_INSTALL_PROTOCOL_INTERFACE     (EFI_SUBCLASS_SPECIFIC | 0x0000000D)\r
+#define EFI_SW_BS_PC_REINSTALL_PROTOCOL_INTERFACE   (EFI_SUBCLASS_SPECIFIC | 0x0000000E)\r
+#define EFI_SW_BS_PC_UNINSTALL_PROTOCOL_INTERFACE   (EFI_SUBCLASS_SPECIFIC | 0x0000000F)\r
+#define EFI_SW_BS_PC_HANDLE_PROTOCOL                (EFI_SUBCLASS_SPECIFIC | 0x00000010)\r
+#define EFI_SW_BS_PC_PC_HANDLE_PROTOCOL             (EFI_SUBCLASS_SPECIFIC | 0x00000011)\r
+#define EFI_SW_BS_PC_REGISTER_PROTOCOL_NOTIFY       (EFI_SUBCLASS_SPECIFIC | 0x00000012)\r
+#define EFI_SW_BS_PC_LOCATE_HANDLE                  (EFI_SUBCLASS_SPECIFIC | 0x00000013)\r
+#define EFI_SW_BS_PC_INSTALL_CONFIGURATION_TABLE    (EFI_SUBCLASS_SPECIFIC | 0x00000014)\r
+#define EFI_SW_BS_PC_LOAD_IMAGE                     (EFI_SUBCLASS_SPECIFIC | 0x00000015)\r
+#define EFI_SW_BS_PC_START_IMAGE                    (EFI_SUBCLASS_SPECIFIC | 0x00000016)\r
+#define EFI_SW_BS_PC_EXIT                           (EFI_SUBCLASS_SPECIFIC | 0x00000017)\r
+#define EFI_SW_BS_PC_UNLOAD_IMAGE                   (EFI_SUBCLASS_SPECIFIC | 0x00000018)\r
+#define EFI_SW_BS_PC_EXIT_BOOT_SERVICES             (EFI_SUBCLASS_SPECIFIC | 0x00000019)\r
+#define EFI_SW_BS_PC_GET_NEXT_MONOTONIC_COUNT       (EFI_SUBCLASS_SPECIFIC | 0x0000001A)\r
+#define EFI_SW_BS_PC_STALL                          (EFI_SUBCLASS_SPECIFIC | 0x0000001B)\r
+#define EFI_SW_BS_PC_SET_WATCHDOG_TIMER             (EFI_SUBCLASS_SPECIFIC | 0x0000001C)\r
+#define EFI_SW_BS_PC_CONNECT_CONTROLLER             (EFI_SUBCLASS_SPECIFIC | 0x0000001D)\r
+#define EFI_SW_BS_PC_DISCONNECT_CONTROLLER          (EFI_SUBCLASS_SPECIFIC | 0x0000001E)\r
+#define EFI_SW_BS_PC_OPEN_PROTOCOL                  (EFI_SUBCLASS_SPECIFIC | 0x0000001F)\r
+#define EFI_SW_BS_PC_CLOSE_PROTOCOL                 (EFI_SUBCLASS_SPECIFIC | 0x00000020)\r
+#define EFI_SW_BS_PC_OPEN_PROTOCOL_INFORMATION      (EFI_SUBCLASS_SPECIFIC | 0x00000021)\r
+#define EFI_SW_BS_PC_PROTOCOLS_PER_HANDLE           (EFI_SUBCLASS_SPECIFIC | 0x00000022)\r
+#define EFI_SW_BS_PC_LOCATE_HANDLE_BUFFER           (EFI_SUBCLASS_SPECIFIC | 0x00000023)\r
+#define EFI_SW_BS_PC_LOCATE_PROTOCOL                (EFI_SUBCLASS_SPECIFIC | 0x00000024)\r
+#define EFI_SW_BS_PC_INSTALL_MULTIPLE_INTERFACES    (EFI_SUBCLASS_SPECIFIC | 0x00000025)\r
+#define EFI_SW_BS_PC_UNINSTALL_MULTIPLE_INTERFACES  (EFI_SUBCLASS_SPECIFIC | 0x00000026)\r
+#define EFI_SW_BS_PC_CALCULATE_CRC_32               (EFI_SUBCLASS_SPECIFIC | 0x00000027)\r
+#define EFI_SW_BS_PC_COPY_MEM                       (EFI_SUBCLASS_SPECIFIC | 0x00000028)\r
+#define EFI_SW_BS_PC_SET_MEM                        (EFI_SUBCLASS_SPECIFIC | 0x00000029)\r
+\r
+//\r
+// Software Class EFI Runtime Services Subclass Progress Code definitions.\r
+//\r
+#define EFI_SW_RS_PC_GET_TIME                       (EFI_SUBCLASS_SPECIFIC | 0x00000000)\r
+#define EFI_SW_RS_PC_SET_TIME                       (EFI_SUBCLASS_SPECIFIC | 0x00000001)\r
+#define EFI_SW_RS_PC_GET_WAKEUP_TIME                (EFI_SUBCLASS_SPECIFIC | 0x00000002)\r
+#define EFI_SW_RS_PC_SET_WAKEUP_TIME                (EFI_SUBCLASS_SPECIFIC | 0x00000003)\r
+#define EFI_SW_RS_PC_SET_VIRTUAL_ADDRESS_MAP        (EFI_SUBCLASS_SPECIFIC | 0x00000004)\r
+#define EFI_SW_RS_PC_CONVERT_POINTER                (EFI_SUBCLASS_SPECIFIC | 0x00000005)\r
+#define EFI_SW_RS_PC_GET_VARIABLE                   (EFI_SUBCLASS_SPECIFIC | 0x00000006)\r
+#define EFI_SW_RS_PC_GET_NEXT_VARIABLE_NAME         (EFI_SUBCLASS_SPECIFIC | 0x00000007)\r
+#define EFI_SW_RS_PC_SET_VARIABLE                   (EFI_SUBCLASS_SPECIFIC | 0x00000008)\r
+#define EFI_SW_RS_PC_GET_NEXT_HIGH_MONOTONIC_COUNT  (EFI_SUBCLASS_SPECIFIC | 0x00000009)\r
+#define EFI_SW_RS_PC_RESET_SYSTEM                   (EFI_SUBCLASS_SPECIFIC | 0x0000000A)\r
+\r
+//\r
+// Software Class EFI DXE Services Subclass Progress Code definitions\r
+//\r
+#define EFI_SW_DS_PC_ADD_MEMORY_SPACE             (EFI_SUBCLASS_SPECIFIC | 0x00000000)\r
+#define EFI_SW_DS_PC_ALLOCATE_MEMORY_SPACE        (EFI_SUBCLASS_SPECIFIC | 0x00000001)\r
+#define EFI_SW_DS_PC_FREE_MEMORY_SPACE            (EFI_SUBCLASS_SPECIFIC | 0x00000002)\r
+#define EFI_SW_DS_PC_REMOVE_MEMORY_SPACE          (EFI_SUBCLASS_SPECIFIC | 0x00000003)\r
+#define EFI_SW_DS_PC_GET_MEMORY_SPACE_DESCRIPTOR  (EFI_SUBCLASS_SPECIFIC | 0x00000004)\r
+#define EFI_SW_DS_PC_SET_MEMORY_SPACE_ATTRIBUTES  (EFI_SUBCLASS_SPECIFIC | 0x00000005)\r
+#define EFI_SW_DS_PC_GET_MEMORY_SPACE_MAP         (EFI_SUBCLASS_SPECIFIC | 0x00000006)\r
+#define EFI_SW_DS_PC_ADD_IO_SPACE                 (EFI_SUBCLASS_SPECIFIC | 0x00000007)\r
+#define EFI_SW_DS_PC_ALLOCATE_IO_SPACE            (EFI_SUBCLASS_SPECIFIC | 0x00000008)\r
+#define EFI_SW_DS_PC_FREE_IO_SPACE                (EFI_SUBCLASS_SPECIFIC | 0x00000009)\r
+#define EFI_SW_DS_PC_REMOVE_IO_SPACE              (EFI_SUBCLASS_SPECIFIC | 0x0000000A)\r
+#define EFI_SW_DS_PC_GET_IO_SPACE_DESCRIPTOR      (EFI_SUBCLASS_SPECIFIC | 0x0000000B)\r
+#define EFI_SW_DS_PC_GET_IO_SPACE_MAP             (EFI_SUBCLASS_SPECIFIC | 0x0000000C)\r
+#define EFI_SW_DS_PC_DISPATCH                     (EFI_SUBCLASS_SPECIFIC | 0x0000000D)\r
+#define EFI_SW_DS_PC_SCHEDULE                     (EFI_SUBCLASS_SPECIFIC | 0x0000000E)\r
+#define EFI_SW_DS_PC_TRUST                        (EFI_SUBCLASS_SPECIFIC | 0x0000000F)\r
+#define EFI_SW_DS_PC_PROCESS_FIRMWARE_VOLUME      (EFI_SUBCLASS_SPECIFIC | 0x00000010)\r
+\r
+//\r
+// Software Class Error Code definitions.\r
+// These are shared by all subclasses.\r
+//\r
+#define EFI_SW_EC_NON_SPECIFIC            0x00000000\r
+#define EFI_SW_EC_LOAD_ERROR              0x00000001\r
+#define EFI_SW_EC_INVALID_PARAMETER       0x00000002\r
+#define EFI_SW_EC_UNSUPPORTED             0x00000003\r
+#define EFI_SW_EC_INVALID_BUFFER          0x00000004\r
+#define EFI_SW_EC_OUT_OF_RESOURCES        0x00000005\r
+#define EFI_SW_EC_ABORTED                 0x00000006\r
+#define EFI_SW_EC_ILLEGAL_SOFTWARE_STATE  0x00000007\r
+#define EFI_SW_EC_ILLEGAL_HARDWARE_STATE  0x00000008\r
+#define EFI_SW_EC_START_ERROR             0x00000009\r
+#define EFI_SW_EC_BAD_DATE_TIME           0x0000000A\r
+#define EFI_SW_EC_CFG_INVALID             0x0000000B\r
+#define EFI_SW_EC_CFG_CLR_REQUEST         0x0000000C\r
+#define EFI_SW_EC_CFG_DEFAULT             0x0000000D\r
+#define EFI_SW_EC_PWD_INVALID             0x0000000E\r
+#define EFI_SW_EC_PWD_CLR_REQUEST         0x0000000F\r
+#define EFI_SW_EC_PWD_CLEARED             0x00000010\r
+#define EFI_SW_EC_EVENT_LOG_FULL          0x00000011\r
+\r
+//\r
+// Software Class Unspecified Subclass Error Code definitions.\r
+//\r
+//\r
+// Software Class SEC Subclass Error Code definitions.\r
+//\r
+//\r
+// Software Class PEI Core Subclass Error Code definitions.\r
+//\r
+#define EFI_SW_PEI_CORE_EC_DXE_CORRUPT  (EFI_SUBCLASS_SPECIFIC | 0x00000000)\r
+\r
+//\r
+// Software Class PEI Module Subclass Error Code definitions.\r
+//\r
+#define EFI_SW_PEIM_EC_NO_RECOVERY_CAPSULE        (EFI_SUBCLASS_SPECIFIC | 0x00000000)\r
+#define EFI_SW_PEIM_EC_INVALID_CAPSULE_DESCRIPTOR (EFI_SUBCLASS_SPECIFIC | 0x00000001)\r
+\r
+//\r
+// Software Class DXE Core Subclass Error Code definitions.\r
+//\r
+#define EFI_SW_CSM_LEGACY_ROM_INIT  (EFI_SUBCLASS_SPECIFIC | 0x00000000)\r
+//\r
+// Software Class DXE Boot Service Driver Subclass Error Code definitions.\r
+//\r
+#define EFI_SW_DXE_BS_EC_LEGACY_OPROM_NO_SPACE  (EFI_SUBCLASS_SPECIFIC | 0x00000000)\r
+\r
+//\r
+// Software Class DXE Runtime Service Driver Subclass Error Code definitions.\r
+//\r
+//\r
+// Software Class SMM Driver Subclass Error Code definitions.\r
+//\r
+//\r
+// Software Class EFI Application Subclass Error Code definitions.\r
+//\r
+//\r
+// Software Class EFI OS Loader Subclass Error Code definitions.\r
+//\r
+//\r
+// Software Class EFI RT Subclass Error Code definitions.\r
+//\r
+//\r
+// Software Class EFI AL Subclass Error Code definitions.\r
+//\r
+//\r
+// Software Class EBC Exception Subclass Error Code definitions.\r
+// These exceptions are derived from the debug protocol definitions in the EFI\r
+// specification.\r
+//\r
+#define EFI_SW_EC_EBC_UNDEFINED             0x00000000\r
+#define EFI_SW_EC_EBC_DIVIDE_ERROR          EXCEPT_EBC_DIVIDE_ERROR\r
+#define EFI_SW_EC_EBC_DEBUG                 EXCEPT_EBC_DEBUG\r
+#define EFI_SW_EC_EBC_BREAKPOINT            EXCEPT_EBC_BREAKPOINT\r
+#define EFI_SW_EC_EBC_OVERFLOW              EXCEPT_EBC_OVERFLOW\r
+#define EFI_SW_EC_EBC_INVALID_OPCODE        EXCEPT_EBC_INVALID_OPCODE\r
+#define EFI_SW_EC_EBC_STACK_FAULT           EXCEPT_EBC_STACK_FAULT\r
+#define EFI_SW_EC_EBC_ALIGNMENT_CHECK       EXCEPT_EBC_ALIGNMENT_CHECK\r
+#define EFI_SW_EC_EBC_INSTRUCTION_ENCODING  EXCEPT_EBC_INSTRUCTION_ENCODING\r
+#define EFI_SW_EC_EBC_BAD_BREAK             EXCEPT_EBC_BAD_BREAK\r
+#define EFI_SW_EC_EBC_STEP                  EXCEPT_EBC_STEP\r
+\r
+//\r
+// Software Class IA32 Exception Subclass Error Code definitions.\r
+// These exceptions are derived from the debug protocol definitions in the EFI\r
+// specification.\r
+//\r
+#define EFI_SW_EC_IA32_DIVIDE_ERROR     EXCEPT_IA32_DIVIDE_ERROR\r
+#define EFI_SW_EC_IA32_DEBUG            EXCEPT_IA32_DEBUG\r
+#define EFI_SW_EC_IA32_NMI              EXCEPT_IA32_NMI\r
+#define EFI_SW_EC_IA32_BREAKPOINT       EXCEPT_IA32_BREAKPOINT\r
+#define EFI_SW_EC_IA32_OVERFLOW         EXCEPT_IA32_OVERFLOW\r
+#define EFI_SW_EC_IA32_BOUND            EXCEPT_IA32_BOUND\r
+#define EFI_SW_EC_IA32_INVALID_OPCODE   EXCEPT_IA32_INVALID_OPCODE\r
+#define EFI_SW_EC_IA32_DOUBLE_FAULT     EXCEPT_IA32_DOUBLE_FAULT\r
+#define EFI_SW_EC_IA32_INVALID_TSS      EXCEPT_IA32_INVALID_TSS\r
+#define EFI_SW_EC_IA32_SEG_NOT_PRESENT  EXCEPT_IA32_SEG_NOT_PRESENT\r
+#define EFI_SW_EC_IA32_STACK_FAULT      EXCEPT_IA32_STACK_FAULT\r
+#define EFI_SW_EC_IA32_GP_FAULT         EXCEPT_IA32_GP_FAULT\r
+#define EFI_SW_EC_IA32_PAGE_FAULT       EXCEPT_IA32_PAGE_FAULT\r
+#define EFI_SW_EC_IA32_FP_ERROR         EXCEPT_IA32_FP_ERROR\r
+#define EFI_SW_EC_IA32_ALIGNMENT_CHECK  EXCEPT_IA32_ALIGNMENT_CHECK\r
+#define EFI_SW_EC_IA32_MACHINE_CHECK    EXCEPT_IA32_MACHINE_CHECK\r
+#define EFI_SW_EC_IA32_SIMD             EXCEPT_IA32_SIMD\r
+\r
+//\r
+// Software Class IPF Exception Subclass Error Code definitions.\r
+// These exceptions are derived from the debug protocol definitions in the EFI\r
+// specification.\r
+//\r
+#define EFI_SW_EC_IPF_ALT_DTLB            EXCEPT_IPF_ALT_DTLB\r
+#define EFI_SW_EC_IPF_DNESTED_TLB         EXCEPT_IPF_DNESTED_TLB\r
+#define EFI_SW_EC_IPF_BREAKPOINT          EXCEPT_IPF_BREAKPOINT\r
+#define EFI_SW_EC_IPF_EXTERNAL_INTERRUPT  EXCEPT_IPF_EXTERNAL_INTERRUPT\r
+#define EFI_SW_EC_IPF_GEN_EXCEPT          EXCEPT_IPF_GEN_EXCEPT\r
+#define EFI_SW_EC_IPF_NAT_CONSUMPTION     EXCEPT_IPF_NAT_CONSUMPTION\r
+#define EFI_SW_EC_IPF_DEBUG_EXCEPT        EXCEPT_IPF_DEBUG_EXCEPT\r
+#define EFI_SW_EC_IPF_UNALIGNED_ACCESS    EXCEPT_IPF_UNALIGNED_ACCESS\r
+#define EFI_SW_EC_IPF_FP_FAULT            EXCEPT_IPF_FP_FAULT\r
+#define EFI_SW_EC_IPF_FP_TRAP             EXCEPT_IPF_FP_TRAP\r
+#define EFI_SW_EC_IPF_TAKEN_BRANCH        EXCEPT_IPF_TAKEN_BRANCH\r
+#define EFI_SW_EC_IPF_SINGLE_STEP         EXCEPT_IPF_SINGLE_STEP\r
+\r
+//\r
+// Software Class PEI Service Subclass Error Code definitions.\r
+//\r
+//\r
+// Software Class EFI Boot Service Subclass Error Code definitions.\r
+//\r
+//\r
+// Software Class EFI Runtime Service Subclass Error Code definitions.\r
+//\r
+//\r
+// Software Class EFI DXE Service Subclass Error Code definitions.\r
+//\r
+\r
+///////////////////////////////////////////////////////////////////////////////\r
+// Section 7\r
+///////////////////////////////////////////////////////////////////////////////\r
+//\r
+// Debug Code definitions for all classes and subclass\r
+// Only one debug code is defined at this point and should\r
+// be used for anything that gets sent to debug stream.\r
+//\r
+#define EFI_DC_UNSPECIFIED  0x0\r
+\r
+#endif\r
diff --git a/Tools/Source/TianoTools/Include/Common/StatusCodeDataTypeId.h b/Tools/Source/TianoTools/Include/Common/StatusCodeDataTypeId.h
new file mode 100644 (file)
index 0000000..49bea61
--- /dev/null
@@ -0,0 +1,336 @@
+/** @file\r
+  This file defines the data structures to support Status Code Data.\r
+\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. This program and the accompanying materials                          \r
+  are licensed and made available under the terms and conditions of the BSD License         \r
+  which accompanies this distribution.  The full text of the license may be found at        \r
+  http://opensource.org/licenses/bsd-license.php                                            \r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+  Module Name:  StatusCodeDataTypeId.h\r
+\r
+  @par Revision Reference:\r
+  These definitions are from Framework of EFI Status Code Spec\r
+  Version 0.92.\r
+\r
+**/\r
+\r
+#ifndef __STATUS_CODE_DATA_TYPE_ID_H__\r
+#define __STATUS_CODE_DATA_TYPE_ID_H__\r
+\r
+\r
+///\r
+/// The size of string\r
+///\r
+#define EFI_STATUS_CODE_DATA_MAX_STRING_SIZE  150\r
+\r
+///\r
+/// This is the max data size including all the headers which can be passed\r
+/// as Status Code data. This data should be multiple of 8 byte\r
+/// to avoid any kind of boundary issue. Also, sum of this data size (inclusive\r
+/// of size of EFI_STATUS_CODE_DATA should not exceed the max record size of\r
+/// data hub\r
+///\r
+#define EFI_STATUS_CODE_DATA_MAX_SIZE 200\r
+\r
+#pragma pack(1)\r
+typedef enum {\r
+  EfiStringAscii,\r
+  EfiStringUnicode,\r
+  EfiStringToken\r
+} EFI_STRING_TYPE;\r
+\r
+typedef struct {\r
+  EFI_HII_HANDLE  Handle;\r
+  STRING_REF      Token;\r
+} EFI_STATUS_CODE_STRING_TOKEN;\r
+\r
+typedef union {\r
+  CHAR8                         *Ascii;\r
+  CHAR16                        *Unicode;\r
+  EFI_STATUS_CODE_STRING_TOKEN  Hii;\r
+} EFI_STATUS_CODE_STRING;\r
+\r
+typedef struct {\r
+  EFI_STATUS_CODE_DATA                          DataHeader;\r
+  EFI_STRING_TYPE                               StringType;\r
+  EFI_STATUS_CODE_STRING                        String;\r
+} EFI_STATUS_CODE_STRING_DATA;\r
+\r
+#pragma pack()\r
+\r
+#pragma pack(1)\r
+\r
+typedef struct {\r
+  UINT32  ErrorLevel;\r
+  //\r
+  // 12 * sizeof (UINT64) Var Arg stack\r
+  //\r
+  // ascii DEBUG () Format string\r
+  //\r
+} EFI_DEBUG_INFO;\r
+\r
+#pragma pack()\r
+\r
+//\r
+// declaration for EFI_EXP_DATA. This may change\r
+//\r
+// typedef UINTN   EFI_EXP_DATA;\r
+\r
+///\r
+/// Voltage Extended Error Data\r
+///\r
+typedef struct {\r
+  EFI_STATUS_CODE_DATA  DataHeader;\r
+  EFI_EXP_BASE10_DATA   Voltage;\r
+  EFI_EXP_BASE10_DATA   Threshold;\r
+} EFI_COMPUTING_UNIT_VOLTAGE_ERROR_DATA;\r
+\r
+///\r
+/// Microcode Update Extended Error Data\r
+///\r
+typedef struct {\r
+  EFI_STATUS_CODE_DATA  DataHeader;\r
+  UINT32                Version;\r
+} EFI_COMPUTING_UNIT_MICROCODE_UPDATE_ERROR_DATA;\r
+\r
+///\r
+/// Asynchronous Timer Extended Error Data\r
+///\r
+typedef struct {\r
+  EFI_STATUS_CODE_DATA  DataHeader;\r
+  EFI_EXP_BASE10_DATA   TimerLimit;\r
+} EFI_COMPUTING_UNIT_TIMER_EXPIRED_ERROR_DATA;\r
+\r
+///\r
+/// Host Processor Mismatch Extended Error Data\r
+///\r
+typedef struct {\r
+  EFI_STATUS_CODE_DATA  DataHeader;\r
+  UINT32                Instance;\r
+  UINT16                Attributes;\r
+} EFI_HOST_PROCESSOR_MISMATCH_ERROR_DATA;\r
+\r
+//\r
+// EFI_COMPUTING_UNIT_MISMATCH_ATTRIBUTES\r
+// All other attributes are reserved for future use and\r
+// must be initialized to 0.\r
+//\r
+#define EFI_COMPUTING_UNIT_MISMATCH_SPEED       0x0001\r
+#define EFI_COMPUTING_UNIT_MISMATCH_FSB_SPEED   0x0002\r
+#define EFI_COMPUTING_UNIT_MISMATCH_FAMILY      0x0004\r
+#define EFI_COMPUTING_UNIT_MISMATCH_MODEL       0x0008\r
+#define EFI_COMPUTING_UNIT_MISMATCH_STEPPING    0x0010\r
+#define EFI_COMPUTING_UNIT_MISMATCH_CACHE_SIZE  0x0020\r
+#define EFI_COMPUTING_UNIT_MISMATCH_OEM1        0x1000\r
+#define EFI_COMPUTING_UNIT_MISMATCH_OEM2        0x2000\r
+#define EFI_COMPUTING_UNIT_MISMATCH_OEM3        0x4000\r
+#define EFI_COMPUTING_UNIT_MISMATCH_OEM4        0x8000\r
+\r
+///\r
+/// Thermal Extended Error Data\r
+///\r
+typedef struct {\r
+  EFI_STATUS_CODE_DATA  DataHeader;\r
+  EFI_EXP_BASE10_DATA   Temperature;\r
+  EFI_EXP_BASE10_DATA   Threshold;\r
+} EFI_COMPUTING_UNIT_THERMAL_ERROR_DATA;\r
+\r
+///\r
+/// Processor Disabled Extended Error Data\r
+///\r
+typedef struct {\r
+  EFI_STATUS_CODE_DATA  DataHeader;\r
+  UINT32                Cause;\r
+  BOOLEAN               SoftwareDisabled;\r
+} EFI_COMPUTING_UNIT_CPU_DISABLED_ERROR_DATA;\r
+\r
+typedef enum {\r
+  EfiInitCacheDataOnly,\r
+  EfiInitCacheInstrOnly,\r
+  EfiInitCacheBoth,\r
+  EfiInitCacheUnspecified\r
+} EFI_INIT_CACHE_TYPE;\r
+\r
+///\r
+/// Embedded cache init extended data\r
+///\r
+typedef struct {\r
+  EFI_STATUS_CODE_DATA  DataHeader;\r
+  UINT32                Level;\r
+  EFI_INIT_CACHE_TYPE   Type;\r
+} EFI_CACHE_INIT_DATA;\r
+\r
+//\r
+// Memory Extended Error Data\r
+//\r
+\r
+///\r
+/// Memory Error Granularity Definition\r
+///\r
+typedef UINT8 EFI_MEMORY_ERROR_GRANULARITY;\r
+\r
+///\r
+/// Memory Error Operation Definition\r
+///\r
+typedef UINT8 EFI_MEMORY_ERROR_OPERATION;\r
+\r
+typedef struct {\r
+  EFI_STATUS_CODE_DATA          DataHeader;\r
+  EFI_MEMORY_ERROR_GRANULARITY  Granularity;\r
+  EFI_MEMORY_ERROR_OPERATION    Operation;\r
+  UINTN                         Syndrome;\r
+  EFI_PHYSICAL_ADDRESS          Address;\r
+  UINTN                         Resolution;\r
+} EFI_MEMORY_EXTENDED_ERROR_DATA;\r
+\r
+//\r
+// Memory Error Granularities\r
+//\r
+#define EFI_MEMORY_ERROR_OTHER      0x01\r
+#define EFI_MEMORY_ERROR_UNKNOWN    0x02\r
+#define EFI_MEMORY_ERROR_DEVICE     0x03\r
+#define EFI_MEMORY_ERROR_PARTITION  0x04\r
+\r
+//\r
+// Memory Error Operations\r
+//\r
+#define EFI_MEMORY_OPERATION_OTHER          0x01\r
+#define EFI_MEMORY_OPERATION_UNKNOWN        0x02\r
+#define EFI_MEMORY_OPERATION_READ           0x03\r
+#define EFI_MEMORY_OPERATION_WRITE          0x04\r
+#define EFI_MEMORY_OPERATION_PARTIAL_WRITE  0x05\r
+\r
+//\r
+// Define shorthands to describe Group Operations\r
+// Many memory init operations are essentially group\r
+// operations.\r
+\r
+/// A shorthand to describe that the operation is performed\r
+/// on multiple devices within the array\r
+///\r
+#define EFI_MULTIPLE_MEMORY_DEVICE_OPERATION  0xfffe\r
+///\r
+/// A shorthand to describe that the operation is performed on all devices within the array\r
+///\r
+#define EFI_ALL_MEMORY_DEVICE_OPERATION 0xffff\r
+///\r
+/// A shorthand to describe that the operation is performed on multiple arrays\r
+///\r
+#define EFI_MULTIPLE_MEMORY_ARRAY_OPERATION 0xfffe\r
+///\r
+/// A shorthand to describe that the operation is performed on all the arrays\r
+///\r
+#define EFI_ALL_MEMORY_ARRAY_OPERATION  0xffff\r
+\r
+//\r
+// DIMM number\r
+//\r
+#pragma pack(1)\r
+typedef struct {\r
+  EFI_STATUS_CODE_DATA  DataHeader;\r
+  UINT16                Array;\r
+  UINT16                Device;\r
+} EFI_STATUS_CODE_DIMM_NUMBER;\r
+#pragma pack()\r
+\r
+///\r
+/// Memory Module Mismatch Extended Error Data\r
+///\r
+typedef struct {\r
+  EFI_STATUS_CODE_DATA        DataHeader;\r
+  EFI_STATUS_CODE_DIMM_NUMBER Instance;\r
+} EFI_MEMORY_MODULE_MISMATCH_ERROR_DATA;\r
+\r
+///\r
+/// Memory Range Extended Data\r
+///\r
+typedef struct {\r
+  EFI_STATUS_CODE_DATA  DataHeader;\r
+  EFI_PHYSICAL_ADDRESS  Start;\r
+  EFI_PHYSICAL_ADDRESS  Length;\r
+} EFI_MEMORY_RANGE_EXTENDED_DATA;\r
+\r
+///\r
+/// Device handle Extended Data. Used for many\r
+/// errors and progress codes to point to the device.\r
+///\r
+typedef struct {\r
+  EFI_STATUS_CODE_DATA  DataHeader;\r
+  EFI_HANDLE            Handle;\r
+} EFI_DEVICE_HANDLE_EXTENDED_DATA;\r
+\r
+typedef struct {\r
+  EFI_STATUS_CODE_DATA                 DataHeader;\r
+  UINT8                                *DevicePath;\r
+} EFI_DEVICE_PATH_EXTENDED_DATA;\r
+\r
+typedef struct {\r
+  EFI_STATUS_CODE_DATA           DataHeader;  \r
+  EFI_HANDLE                     ControllerHandle;\r
+  EFI_HANDLE                     DriverBindingHandle;\r
+  UINT16                         DevicePathSize;\r
+  UINT8                          *RemainingDevicePath;\r
+} EFI_STATUS_CODE_START_EXTENDED_DATA;\r
+\r
+///\r
+/// Resource Allocation Failure Extended Error Data\r
+///\r
+\r
+/*\r
+typedef struct {\r
+  EFI_STATUS_CODE_DATA      DataHeader;\r
+  EFI_DEVICE_PATH_PROTOCOL  *DevicePath;\r
+  UINT32                    Bar;\r
+  VOID                      *ReqRes;\r
+  VOID                      *AllocRes;\r
+} EFI_RESOURCE_ALLOC_FAILURE_ERROR_DATA;\r
+*/\r
+typedef struct {\r
+  EFI_STATUS_CODE_DATA               DataHeader;\r
+  UINT32                             Bar;\r
+  UINT16                             DevicePathSize;\r
+  UINT16                             ReqResSize;\r
+  UINT16                             AllocResSize;\r
+  UINT8                              *DevicePath;\r
+  UINT8                              *ReqRes;\r
+  UINT8                              *AllocRes;\r
+} EFI_RESOURCE_ALLOC_FAILURE_ERROR_DATA;\r
+\r
+///\r
+/// Extended Error Data for Assert\r
+///\r
+typedef struct {\r
+  EFI_STATUS_CODE_DATA        DataHeader;\r
+  UINT32                      LineNumber;\r
+  UINT32                      FileNameSize;\r
+  EFI_STATUS_CODE_STRING_DATA *FileName;\r
+} EFI_DEBUG_ASSERT_DATA;\r
+\r
+///\r
+/// System Context Data EBC/IA32/IPF\r
+///\r
+typedef union {\r
+  EFI_SYSTEM_CONTEXT_EBC  SystemContextEbc;\r
+  EFI_SYSTEM_CONTEXT_IA32 SystemContextIa32;\r
+  EFI_SYSTEM_CONTEXT_IPF  SystemContextIpf;\r
+} EFI_STATUS_CODE_EXCEP_SYSTEM_CONTEXT;\r
+\r
+typedef struct {\r
+  EFI_STATUS_CODE_DATA                  DataHeader;\r
+  EFI_STATUS_CODE_EXCEP_SYSTEM_CONTEXT  Context;\r
+} EFI_STATUS_CODE_EXCEP_EXTENDED_DATA;\r
+\r
+///\r
+/// Legacy Oprom extended data\r
+///\r
+typedef struct {\r
+  EFI_STATUS_CODE_DATA  DataHeader;\r
+  EFI_HANDLE            DeviceHandle;\r
+  EFI_PHYSICAL_ADDRESS  RomImageBase;\r
+} EFI_LEGACY_OPROM_EXTENDED_DATA;\r
+\r
+#endif\r
diff --git a/Tools/Source/TianoTools/Include/Common/UefiBaseTypes.h b/Tools/Source/TianoTools/Include/Common/UefiBaseTypes.h
new file mode 100644 (file)
index 0000000..4954c10
--- /dev/null
@@ -0,0 +1,85 @@
+/** @file\r
+  This file makes the BaseTypes.h backward compatible with the ones used in the \r
+  past for EFI and Tiano development. It's mostly just prepending an EFI_ on the \r
+  definitions.\r
+\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. This program and the accompanying materials                          \r
+  are licensed and made available under the terms and conditions of the BSD License         \r
+  which accompanies this distribution.  The full text of the license may be found at        \r
+  http://opensource.org/licenses/bsd-license.php                                            \r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+  Module Name:  UefiBaseTypes.h\r
+\r
+**/\r
+\r
+#ifndef __UEFI_BASE_TYPES_H__\r
+#define __UEFI_BASE_TYPES_H__\r
+\r
+#include <Common/BaseTypes.h>\r
+\r
+typedef UINT64    EFI_LBA;\r
+\r
+#define EFIERR(_a)                    ENCODE_ERROR(_a)\r
+\r
+#define EFI_MAX_BIT                   MAX_BIT\r
+#define EFI_MAX_ADDRESS               MAX_ADDRESS\r
+#define EFI_BREAKPOINT()              CpuBreakpoint ()\r
+#define EFI_DEADLOOP()                CpuDeadLoop ()\r
+#define EFI_ERROR(A)                  RETURN_ERROR(A)\r
+\r
+typedef GUID          EFI_GUID;\r
+typedef RETURN_STATUS EFI_STATUS;\r
+\r
+#define EFI_SUCCESS               RETURN_SUCCESS              \r
+#define EFI_LOAD_ERROR            RETURN_LOAD_ERROR           \r
+#define EFI_INVALID_PARAMETER     RETURN_INVALID_PARAMETER    \r
+#define EFI_UNSUPPORTED           RETURN_UNSUPPORTED          \r
+#define EFI_BAD_BUFFER_SIZE       RETURN_BAD_BUFFER_SIZE      \r
+#define EFI_BUFFER_TOO_SMALL      RETURN_BUFFER_TOO_SMALL     \r
+#define EFI_NOT_READY             RETURN_NOT_READY            \r
+#define EFI_DEVICE_ERROR          RETURN_DEVICE_ERROR         \r
+#define EFI_WRITE_PROTECTED       RETURN_WRITE_PROTECTED      \r
+#define EFI_OUT_OF_RESOURCES      RETURN_OUT_OF_RESOURCES     \r
+#define EFI_VOLUME_CORRUPTED      RETURN_VOLUME_CORRUPTED     \r
+#define EFI_VOLUME_FULL           RETURN_VOLUME_FULL          \r
+#define EFI_NO_MEDIA              RETURN_NO_MEDIA             \r
+#define EFI_MEDIA_CHANGED         RETURN_MEDIA_CHANGED        \r
+#define EFI_NOT_FOUND             RETURN_NOT_FOUND            \r
+#define EFI_ACCESS_DENIED         RETURN_ACCESS_DENIED        \r
+#define EFI_NO_RESPONSE           RETURN_NO_RESPONSE          \r
+#define EFI_NO_MAPPING            RETURN_NO_MAPPING           \r
+#define EFI_TIMEOUT               RETURN_TIMEOUT              \r
+#define EFI_NOT_STARTED           RETURN_NOT_STARTED          \r
+#define EFI_ALREADY_STARTED       RETURN_ALREADY_STARTED      \r
+#define EFI_ABORTED               RETURN_ABORTED              \r
+#define EFI_ICMP_ERROR            RETURN_ICMP_ERROR           \r
+#define EFI_TFTP_ERROR            RETURN_TFTP_ERROR           \r
+#define EFI_PROTOCOL_ERROR        RETURN_PROTOCOL_ERROR       \r
+#define EFI_INCOMPATIBLE_VERSION  RETURN_INCOMPATIBLE_VERSION \r
+#define EFI_SECURITY_VIOLATION    RETURN_SECURITY_VIOLATION   \r
+#define EFI_CRC_ERROR             RETURN_CRC_ERROR   \r
+#define EFI_END_OF_MEDIA          RETURN_END_OF_MEDIA\r
+#define EFI_END_OF_FILE           RETURN_END_OF_FILE\r
+\r
+#define EFI_WARN_UNKNOWN_GLYPH    RETURN_WARN_UNKNOWN_GLYPH   \r
+#define EFI_WARN_DELETE_FAILURE   RETURN_WARN_DELETE_FAILURE  \r
+#define EFI_WARN_WRITE_FAILURE    RETURN_WARN_WRITE_FAILURE   \r
+#define EFI_WARN_BUFFER_TOO_SMALL RETURN_WARN_BUFFER_TOO_SMALL\r
+\r
+//\r
+// The EFI memory allocation functions work in units of EFI_PAGEs that are\r
+// 4K. This should in no way be confused with the page size of the processor.\r
+// An EFI_PAGE is just the quanta of memory in EFI.\r
+//\r
+#define EFI_PAGE_MASK         0xFFF\r
+#define EFI_PAGE_SHIFT        12\r
+\r
+#define EFI_SIZE_TO_PAGES(a)  (((a) >> EFI_PAGE_SHIFT) + (((a) & EFI_PAGE_MASK) ? 1 : 0))\r
+\r
+#define EFI_PAGES_TO_SIZE(a)   ( (a) << EFI_PAGE_SHIFT)\r
+\r
+#endif\r
diff --git a/Tools/Source/TianoTools/Include/Dxe.h b/Tools/Source/TianoTools/Include/Dxe.h
new file mode 100644 (file)
index 0000000..d97209d
--- /dev/null
@@ -0,0 +1,50 @@
+/** @file\r
+\r
+  Root include file for Mde Package DXE modules\r
+\r
+  DXE modules follow the public Framework specifications and the UEFI \r
+  specifiations. The build infrastructure must set \r
+  EFI_SPECIFICATION_VERSION  before including  this file. To support \r
+  R9/UEFI2.0 set EFI_SPECIFIATION_VERSION to 0x00020000. To support \r
+  R8.5/EFI 1.10 set EFI_SPECIFIATION_VERSION to 0x00010010. \r
+  EDK_RELEASE_VERSION must be set to a non zero value.\r
+  EFI_SPECIFIATION_VERSION and EDK_RELEASE_VERSION are set automatically\r
+  by the build infrastructure for every module.\r
+\r
+\r
+Copyright (c) 2006, Intel Corporation\r
+All rights reserved. This program and the accompanying materials\r
+are licensed and made available under the terms and conditions of the BSD License\r
+which accompanies this distribution.  The full text of the license may be found at\r
+http://opensource.org/licenses/bsd-license.php\r
+\r
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#ifndef __DXE_H__\r
+#define __DXE_H__\r
+\r
+//\r
+// Check to make sure EFI_SPECIFICATION_VERSION and EDK_RELEASE_VERSION are defined.\r
+//\r
+#if !defined(EFI_SPECIFICATION_VERSION)\r
+  #error EFI_SPECIFICATION_VERSION not defined\r
+#elif !defined(EDK_RELEASE_VERSION)\r
+  #error EDK_RELEASE_VERSION not defined\r
+#elif (EDK_RELEASE_VERSION == 0)\r
+  #error EDK_RELEASE_VERSION can not be zero\r
+#endif\r
+\r
+\r
+#include <Common/UefiBaseTypes.h>\r
+#include <Dxe/DxeCis.h>\r
+#include <Dxe/SmmCis.h>\r
+\r
+#include <Common/DataHubRecords.h>\r
+#include <Guid/DataHubRecords.h>\r
+\r
+#include <Protocol/Pcd.h>\r
+\r
+#endif\r
diff --git a/Tools/Source/TianoTools/Include/Dxe/ArchProtocol/Bds.h b/Tools/Source/TianoTools/Include/Dxe/ArchProtocol/Bds.h
new file mode 100644 (file)
index 0000000..f6b72d2
--- /dev/null
@@ -0,0 +1,87 @@
+/** @file\r
+  Boot Device Selection Architectural Protocol as defined in DXE CIS\r
+\r
+  When the DXE core is done it calls the BDS via this protocol.\r
+\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. This program and the accompanying materials                          \r
+  are licensed and made available under the terms and conditions of the BSD License         \r
+  which accompanies this distribution.  The full text of the license may be found at        \r
+  http://opensource.org/licenses/bsd-license.php                                            \r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+  Module Name:  Bds.h\r
+\r
+  @par Revision Reference:\r
+  Version 0.91B.\r
+\r
+**/\r
+\r
+#ifndef __ARCH_PROTOCOL_BDS_H__\r
+#define __ARCH_PROTOCOL_BDS_H__\r
+\r
+//\r
+// Global ID for the BDS Architectural Protocol\r
+//\r
+#define EFI_BDS_ARCH_PROTOCOL_GUID \\r
+  { 0x665E3FF6, 0x46CC, 0x11d4, {0x9A, 0x38, 0x00, 0x90, 0x27, 0x3F, 0xC1, 0x4D } }\r
+\r
+//\r
+// Declare forward reference for the BDS Architectural Protocol\r
+//\r
+typedef struct _EFI_BDS_ARCH_PROTOCOL   EFI_BDS_ARCH_PROTOCOL;\r
+\r
+/**\r
+  This function uses policy data from the platform to determine what operating \r
+  system or system utility should be loaded and invoked.  This function call \r
+  also optionally make the use of user input to determine the operating system \r
+  or system utility to be loaded and invoked.  When the DXE Core has dispatched \r
+  all the drivers on the dispatch queue, this function is called.  This \r
+  function will attempt to connect the boot devices required to load and invoke \r
+  the selected operating system or system utility.  During this process, \r
+  additional firmware volumes may be discovered that may contain addition DXE \r
+  drivers that can be dispatched by the DXE Core.   If a boot device cannot be \r
+  fully connected, this function calls the DXE Service Dispatch() to allow the \r
+  DXE drivers from any newly discovered firmware volumes to be dispatched.  \r
+  Then the boot device connection can be attempted again.  If the same boot \r
+  device connection operation fails twice in a row, then that boot device has \r
+  failed, and should be skipped.  This function should never return.\r
+\r
+  @param  This The EFI_BDS_ARCH_PROTOCOL instance.\r
+\r
+  @return None.\r
+\r
+**/\r
+typedef\r
+VOID\r
+(EFIAPI *EFI_BDS_ENTRY) (\r
+  IN EFI_BDS_ARCH_PROTOCOL  *This\r
+  );\r
+\r
+/**\r
+  Interface stucture for the BDS Architectural Protocol.\r
+\r
+  @par Protocol Description:\r
+  The EFI_BDS_ARCH_PROTOCOL transfers control from DXE to an operating \r
+  system or a system utility.  If there are not enough drivers initialized \r
+  when this protocol is used to access the required boot device(s), then \r
+  this protocol should add drivers to the dispatch queue and return control \r
+  back to the dispatcher.  Once the required boot devices are available, then \r
+  the boot device can be used to load and invoke an OS or a system utility.\r
+\r
+  @par Protocol Parameters:\r
+  Entry - The entry point to BDS.  This call does not take any parameters, \r
+  and the return value can be ignored.  If it returns, then the \r
+  dispatcher must be invoked again, if it never returns, then an \r
+  operating system or a system utility have been invoked.\r
+\r
+**/\r
+struct _EFI_BDS_ARCH_PROTOCOL {\r
+  EFI_BDS_ENTRY Entry;\r
+};\r
+\r
+extern EFI_GUID gEfiBdsArchProtocolGuid;\r
+\r
+#endif\r
diff --git a/Tools/Source/TianoTools/Include/Dxe/ArchProtocol/Cpu.h b/Tools/Source/TianoTools/Include/Dxe/ArchProtocol/Cpu.h
new file mode 100644 (file)
index 0000000..975a816
--- /dev/null
@@ -0,0 +1,326 @@
+/** @file\r
+  CPU Architectural Protocol as defined in DXE CIS\r
+\r
+  This code abstracts the DXE core from processor implementation details.\r
+\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. This program and the accompanying materials                          \r
+  are licensed and made available under the terms and conditions of the BSD License         \r
+  which accompanies this distribution.  The full text of the license may be found at        \r
+  http://opensource.org/licenses/bsd-license.php                                            \r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+  Module Name:  Cpu.h\r
+\r
+  @par Revision Reference:\r
+  Version 0.91B.\r
+\r
+**/\r
+\r
+#ifndef __ARCH_PROTOCOL_CPU_H__\r
+#define __ARCH_PROTOCOL_CPU_H__\r
+\r
+\r
+#define EFI_CPU_ARCH_PROTOCOL_GUID \\r
+  { 0x26baccb1, 0x6f42, 0x11d4, {0xbc, 0xe7, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81 } }\r
+\r
+typedef struct _EFI_CPU_ARCH_PROTOCOL   EFI_CPU_ARCH_PROTOCOL;\r
+\r
+typedef enum {\r
+  EfiCpuFlushTypeWriteBackInvalidate,\r
+  EfiCpuFlushTypeWriteBack,\r
+  EfiCpuFlushTypeInvalidate,\r
+  EfiCpuMaxFlushType\r
+} EFI_CPU_FLUSH_TYPE;\r
+\r
+typedef enum {\r
+  EfiCpuInit,\r
+  EfiCpuMaxInitType\r
+} EFI_CPU_INIT_TYPE;\r
+\r
+/**\r
+  EFI_CPU_INTERRUPT_HANDLER that is called when a processor interrupt occurs.\r
+\r
+  @param  InterruptType Defines the type of interrupt or exception that \r
+  occurred on the processor.This parameter is processor architecture specific.\r
+  \r
+  @param  SystemContext A pointer to the processor context when \r
+  the interrupt occurred on the processor.\r
+\r
+  @return None\r
+\r
+**/\r
+typedef\r
+VOID\r
+(*EFI_CPU_INTERRUPT_HANDLER) (\r
+  IN EFI_EXCEPTION_TYPE                 InterruptType,\r
+  IN EFI_SYSTEM_CONTEXT                 SystemContext\r
+  );\r
+\r
+/**\r
+  This function flushes the range of addresses from Start to Start+Length \r
+  from the processor's data cache. If Start is not aligned to a cache line \r
+  boundary, then the bytes before Start to the preceding cache line boundary \r
+  are also flushed. If Start+Length is not aligned to a cache line boundary, \r
+  then the bytes past Start+Length to the end of the next cache line boundary \r
+  are also flushed. The FlushType of EfiCpuFlushTypeWriteBackInvalidate must be \r
+  supported. If the data cache is fully coherent with all DMA operations, then \r
+  this function can just return EFI_SUCCESS. If the processor does not support \r
+  flushing a range of the data cache, then the entire data cache can be flushed.\r
+\r
+  @param  This The EFI_CPU_ARCH_PROTOCOL instance.\r
+  @param  Start The beginning physical address to flush from the processor's data\r
+  cache.\r
+  @param  Length The number of bytes to flush from the processor's data cache. This\r
+  function may flush more bytes than Length specifies depending upon\r
+  the granularity of the flush operation that the processor supports.\r
+  @param  FlushType Specifies the type of flush operation to perform.\r
+\r
+  @retval  EFI_SUCCESS The address range from Start to Start+Length was flushed from\r
+  the processor's data cache.\r
+  @retval  EFI_UNSUPPORTEDT The processor does not support the cache flush type specified\r
+  by FlushType.\r
+  @retval  EFI_DEVICE_ERROR The address range from Start to Start+Length could not be flushed\r
+  from the processor's data cache.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_CPU_FLUSH_DATA_CACHE) (\r
+  IN EFI_CPU_ARCH_PROTOCOL              *This,\r
+  IN EFI_PHYSICAL_ADDRESS               Start,\r
+  IN UINT64                             Length,\r
+  IN EFI_CPU_FLUSH_TYPE                 FlushType\r
+  );\r
+\r
+\r
+/**\r
+  This function enables interrupt processing by the processor. \r
+\r
+  @param  This The EFI_CPU_ARCH_PROTOCOL instance.\r
+\r
+  @retval  EFI_SUCCESS Interrupts are enabled on the processor.\r
+  @retval  EFI_DEVICE_ERROR Interrupts could not be enabled on the processor.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_CPU_ENABLE_INTERRUPT) (\r
+  IN EFI_CPU_ARCH_PROTOCOL              *This\r
+  );\r
+\r
+\r
+/**\r
+  This function disables interrupt processing by the processor.\r
+\r
+  @param  This The EFI_CPU_ARCH_PROTOCOL instance.\r
+\r
+  @retval  EFI_SUCCESS Interrupts are disabled on the processor.\r
+  @retval  EFI_DEVICE_ERROR Interrupts could not be disabled on the processor.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_CPU_DISABLE_INTERRUPT) (\r
+  IN EFI_CPU_ARCH_PROTOCOL              *This\r
+  );\r
+\r
+\r
+/**\r
+  This function retrieves the processor's current interrupt state a returns it in \r
+  State. If interrupts are currently enabled, then TRUE is returned. If interrupts \r
+  are currently disabled, then FALSE is returned.\r
+\r
+  @param  This The EFI_CPU_ARCH_PROTOCOL instance.\r
+  @param  State A pointer to the processor's current interrupt state. Set to TRUE if\r
+  interrupts are enabled and FALSE if interrupts are disabled.\r
+\r
+  @retval  EFI_SUCCESS The processor's current interrupt state was returned in State.\r
+  @retval  EFI_INVALID_PARAMETER State is NULL.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_CPU_GET_INTERRUPT_STATE) (\r
+  IN EFI_CPU_ARCH_PROTOCOL              *This,\r
+  OUT BOOLEAN                           *State\r
+  );\r
+\r
+\r
+/**\r
+  This function generates an INIT on the processor. If this function succeeds, then the\r
+  processor will be reset, and control will not be returned to the caller. If InitType is \r
+  not supported by this processor, or the processor cannot programmatically generate an \r
+  INIT without help from external hardware, then EFI_UNSUPPORTED is returned. If an error \r
+  occurs attempting to generate an INIT, then EFI_DEVICE_ERROR is returned.\r
+\r
+  @param  This The EFI_CPU_ARCH_PROTOCOL instance.\r
+  @param  InitType The type of processor INIT to perform.\r
+\r
+  @retval  EFI_SUCCESS The processor INIT was performed. This return code should never be seen.\r
+  @retval  EFI_UNSUPPORTED The processor INIT operation specified by InitType is not supported\r
+  by this processor.\r
+  @retval  EFI_DEVICE_ERROR The processor INIT failed.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_CPU_INIT) (\r
+  IN EFI_CPU_ARCH_PROTOCOL              *This,\r
+  IN EFI_CPU_INIT_TYPE                  InitType\r
+  );\r
+\r
+\r
+/**\r
+  This function registers and enables the handler specified by InterruptHandler for a processor \r
+  interrupt or exception type specified by InterruptType. If InterruptHandler is NULL, then the \r
+  handler for the processor interrupt or exception type specified by InterruptType is uninstalled. \r
+  The installed handler is called once for each processor interrupt or exception.\r
+\r
+  @param  This The EFI_CPU_ARCH_PROTOCOL instance.\r
+  @param  InterruptType A pointer to the processor's current interrupt state. Set to TRUE if interrupts\r
+  are enabled and FALSE if interrupts are disabled.\r
+  @param  InterruptHandler A pointer to a function of type EFI_CPU_INTERRUPT_HANDLER that is called\r
+  when a processor interrupt occurs. If this parameter is NULL, then the handler\r
+  will be uninstalled.\r
+\r
+  @retval  EFI_SUCCESS The handler for the processor interrupt was successfully installed or uninstalled.\r
+  @retval  EFI_ALREADY_STARTED InterruptHandler is not NULL, and a handler for InterruptType was\r
+  previously installed.\r
+  @retval  EFI_INVALID_PARAMETER InterruptHandler is NULL, and a handler for InterruptType was not\r
+  previously installed.\r
+  @retval  EFI_UNSUPPORTED The interrupt specified by InterruptType is not supported.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_CPU_REGISTER_INTERRUPT_HANDLER) (\r
+  IN EFI_CPU_ARCH_PROTOCOL              *This,\r
+  IN EFI_EXCEPTION_TYPE                 InterruptType,\r
+  IN EFI_CPU_INTERRUPT_HANDLER          InterruptHandler\r
+  );\r
+\r
+\r
+/**\r
+  This function reads the processor timer specified by TimerIndex and returns it in TimerValue.\r
+\r
+  @param  This The EFI_CPU_ARCH_PROTOCOL instance.\r
+  @param  TimerIndex Specifies which processor timer is to be returned in TimerValue. This parameter\r
+  must be between 0 and NumberOfTimers-1.\r
+  @param  TimerValue Pointer to the returned timer value.\r
+  @param  TimerPeriod A pointer to the amount of time that passes in femtoseconds for each increment\r
+  of TimerValue.\r
+\r
+  @retval  EFI_SUCCESS The processor timer value specified by TimerIndex was returned in TimerValue.\r
+  @retval  EFI_DEVICE_ERROR An error occurred attempting to read one of the processor's timers.\r
+  @retval  EFI_INVALID_PARAMETER TimerValue is NULL or TimerIndex is not valid.\r
+  @retval  EFI_UNSUPPORTED The processor does not have any readable timers.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_CPU_GET_TIMER_VALUE) (\r
+  IN EFI_CPU_ARCH_PROTOCOL              *This,\r
+  IN UINT32                             TimerIndex,\r
+  OUT UINT64                            *TimerValue,\r
+  OUT UINT64                            *TimerPeriod OPTIONAL\r
+  );\r
+\r
+\r
+/**\r
+  This function modifies the attributes for the memory region specified by BaseAddress and\r
+  Length from their current attributes to the attributes specified by Attributes.\r
+\r
+  @param  This The EFI_CPU_ARCH_PROTOCOL instance.\r
+  @param  BaseAddress The physical address that is the start address of a memory region.\r
+  @param  Length The size in bytes of the memory region.\r
+  @param  Attributes The bit mask of attributes to set for the memory region.\r
+\r
+  @retval  EFI_SUCCESS The attributes were set for the memory region.\r
+  @retval  EFI_ACCESS_DENIED The attributes for the memory resource range specified by\r
+  BaseAddress and Length cannot be modified.\r
+  @retval  EFI_INVALID_PARAMETER Length is zero.\r
+  @retval  EFI_OUT_OF_RESOURCES There are not enough system resources to modify the attributes of\r
+  the memory resource range.\r
+  @retval  EFI_UNSUPPORTED The processor does not support one or more bytes of the memory\r
+  resource range specified by BaseAddress and Length.\r
+  The bit mask of attributes is not support for the memory resource\r
+  range specified by BaseAddress and Length.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_CPU_SET_MEMORY_ATTRIBUTES) (\r
+  IN EFI_CPU_ARCH_PROTOCOL              *This,\r
+  IN  EFI_PHYSICAL_ADDRESS              BaseAddress,\r
+  IN  UINT64                            Length,\r
+  IN  UINT64                            Attributes\r
+  );\r
+\r
+\r
+/**\r
+  @par Protocol Description:\r
+  The EFI_CPU_ARCH_PROTOCOL is used to abstract processor-specific functions from the DXE\r
+  Foundation. This includes flushing caches, enabling and disabling interrupts, hooking interrupt\r
+  vectors and exception vectors, reading internal processor timers, resetting the processor, and\r
+  determining the processor frequency.\r
+\r
+  @param FlushDataCache\r
+  Flushes a range of the processor's data cache. If the processor does \r
+  not contain a data cache, or the data cache is fully coherent, then this \r
+  function can just return EFI_SUCCESS. If the processor does not support \r
+  flushing a range of addresses from the data cache, then the entire data \r
+  cache must be flushed. \r
+\r
+  @param EnableInterrupt    Enables interrupt processing by the processor. \r
+\r
+  @param DisableInterrupt    Disables interrupt processing by the processor.\r
+\r
+  @param GetInterruptState  Retrieves the processor's current interrupt state.\r
+\r
+  @param Init\r
+  Generates an INIT on the processor. If a processor cannot programmatically \r
+  generate an INIT without help from external hardware, then this function \r
+  returns EFI_UNSUPPORTED.\r
+\r
+  @param RegisterInterruptHandler\r
+  Associates an interrupt service routine with one of the processor's interrupt \r
+  vectors. This function is typically used by the EFI_TIMER_ARCH_PROTOCOL to \r
+  hook the timer interrupt in a system. It can also be used by the debugger to \r
+  hook exception vectors.\r
+\r
+  @param GetTimerValue    Returns the value of one of the processor's internal timers.\r
+\r
+  @param SetMemoryAttributes  Attempts to set the attributes of a memory region.\r
+\r
+  @param NumberOfTimers\r
+  The number of timers that are available in a processor. The value in this \r
+  field is a constant that must not be modified after the CPU Architectural \r
+  Protocol is installed. All consumers must treat this as a read-only field.\r
+\r
+  @param DmaBufferAlignment\r
+  The size, in bytes, of the alignment required for DMA buffer allocations. \r
+  This is typically the size of the largest data cache line in the platform. \r
+  The value in this field is a constant that must not be modified after the \r
+  CPU Architectural Protocol is installed. All consumers must treat this as \r
+  a read-only field.\r
+\r
+**/\r
+struct _EFI_CPU_ARCH_PROTOCOL {\r
+  EFI_CPU_FLUSH_DATA_CACHE            FlushDataCache;\r
+  EFI_CPU_ENABLE_INTERRUPT            EnableInterrupt;\r
+  EFI_CPU_DISABLE_INTERRUPT           DisableInterrupt;\r
+  EFI_CPU_GET_INTERRUPT_STATE         GetInterruptState;\r
+  EFI_CPU_INIT                        Init;\r
+  EFI_CPU_REGISTER_INTERRUPT_HANDLER  RegisterInterruptHandler;\r
+  EFI_CPU_GET_TIMER_VALUE             GetTimerValue;\r
+  EFI_CPU_SET_MEMORY_ATTRIBUTES       SetMemoryAttributes;\r
+  UINT32                              NumberOfTimers;\r
+  UINT32                              DmaBufferAlignment;\r
+};\r
+\r
+extern EFI_GUID gEfiCpuArchProtocolGuid;\r
+\r
+#endif\r
diff --git a/Tools/Source/TianoTools/Include/Dxe/ArchProtocol/Metronome.h b/Tools/Source/TianoTools/Include/Dxe/ArchProtocol/Metronome.h
new file mode 100644 (file)
index 0000000..a07003e
--- /dev/null
@@ -0,0 +1,100 @@
+/** @file\r
+  Metronome Architectural Protocol as defined in DXE CIS\r
+\r
+  This code abstracts the DXE core to provide delay services.\r
+\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. This program and the accompanying materials                          \r
+  are licensed and made available under the terms and conditions of the BSD License         \r
+  which accompanies this distribution.  The full text of the license may be found at        \r
+  http://opensource.org/licenses/bsd-license.php                                            \r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+  Module Name:  Metronome.h\r
+\r
+  @par Revision Reference:\r
+  Version 0.91B.\r
+\r
+**/\r
+\r
+#ifndef __ARCH_PROTOCOL_METRONOME_H__\r
+#define __ARCH_PROTOCOL_METRONOME_H__\r
+\r
+//\r
+// Global ID for the Metronome Architectural Protocol\r
+//\r
+#define EFI_METRONOME_ARCH_PROTOCOL_GUID \\r
+  { 0x26baccb2, 0x6f42, 0x11d4, {0xbc, 0xe7, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81 } }\r
+\r
+//\r
+// Declare forward reference for the Metronome Architectural Protocol\r
+//\r
+typedef struct _EFI_METRONOME_ARCH_PROTOCOL   EFI_METRONOME_ARCH_PROTOCOL;\r
+\r
+/**\r
+  The WaitForTick() function waits for the number of ticks specified by \r
+  TickNumber from a known time source in the platform.  If TickNumber of \r
+  ticks are detected, then EFI_SUCCESS is returned.  The actual time passed \r
+  between entry of this function and the first tick is between 0 and \r
+  TickPeriod 100 nS units.  If you want to guarantee that at least TickPeriod \r
+  time has elapsed, wait for two ticks.  This function waits for a hardware \r
+  event to determine when a tick occurs.  It is possible for interrupt \r
+  processing, or exception processing to interrupt the execution of the \r
+  WaitForTick() function.  Depending on the hardware source for the ticks, it \r
+  is possible for a tick to be missed.  This function cannot guarantee that \r
+  ticks will not be missed.  If a timeout occurs waiting for the specified \r
+  number of ticks, then EFI_TIMEOUT is returned.\r
+\r
+  @param  This The EFI_METRONOME_ARCH_PROTOCOL instance.\r
+  \r
+  @param  TickNumber Number of ticks to wait.\r
+\r
+  @retval  EFI_SUCCESS The wait for the number of ticks specified by TickNumber\r
+  succeeded.\r
+  \r
+  @retval  EFI_TIMEOUT A timeout occurred waiting for the specified number of ticks.\r
+\r
+**/\r
+typedef \r
+EFI_STATUS\r
+(EFIAPI *EFI_METRONOME_WAIT_FOR_TICK) (\r
+   IN EFI_METRONOME_ARCH_PROTOCOL   *This,\r
+   IN UINT32                        TickNumber\r
+  );\r
+\r
+//\r
+//\r
+\r
+/**\r
+  Interface stucture for the Metronome Architectural Protocol.\r
+\r
+  @par Protocol Description:\r
+  This protocol provides access to a known time source in the platform to the\r
+  core.  The core uses this known time source to produce core services that \r
+  require calibrated delays.  \r
+\r
+  @param WaitForTick\r
+  Waits for a specified number of ticks from a known time source \r
+  in the platform.  The actual time passed between entry of this \r
+  function and the first tick is between 0 and TickPeriod 100 nS \r
+  units.  If you want to guarantee that at least TickPeriod time \r
+  has elapsed, wait for two ticks.\r
+\r
+  @param TickPeriod\r
+  The period of platform's known time source in 100 nS units.  \r
+  This value on any platform must be at least 10 uS, and must not \r
+  exceed 200 uS.  The value in this field is a constant that must \r
+  not be modified after the Metronome architectural protocol is \r
+  installed.  All consumers must treat this as a read-only field.\r
+\r
+**/\r
+struct _EFI_METRONOME_ARCH_PROTOCOL {\r
+  EFI_METRONOME_WAIT_FOR_TICK  WaitForTick;\r
+  UINT32                       TickPeriod;\r
+};\r
+\r
+extern EFI_GUID gEfiMetronomeArchProtocolGuid;\r
+\r
+#endif\r
diff --git a/Tools/Source/TianoTools/Include/Dxe/ArchProtocol/MonotonicCounter.h b/Tools/Source/TianoTools/Include/Dxe/ArchProtocol/MonotonicCounter.h
new file mode 100644 (file)
index 0000000..d253740
--- /dev/null
@@ -0,0 +1,33 @@
+/** @file\r
+  Monotonic Counter Architectural Protocol as defined in DXE CIS\r
+\r
+  This code provides the services required to access the systems monotonic counter\r
+\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. This program and the accompanying materials                          \r
+  are licensed and made available under the terms and conditions of the BSD License         \r
+  which accompanies this distribution.  The full text of the license may be found at        \r
+  http://opensource.org/licenses/bsd-license.php                                            \r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+  Module Name:  MonotonicCounter.h\r
+\r
+  @par Revision Reference:\r
+  Version 0.91B.\r
+\r
+**/\r
+\r
+#ifndef __ARCH_PROTOCOL_MONTONIC_COUNTER_H__\r
+#define __ARCH_PROTOCOL_MONTONIC_COUNTER_H__\r
+\r
+///\r
+/// Global ID for the Monotonic Counter Architectural Protocol\r
+///\r
+#define EFI_MONTONIC_COUNTER_ARCH_PROTOCOL_GUID \\r
+  {0x1da97072, 0xbddc, 0x4b30, {0x99, 0xf1, 0x72, 0xa0, 0xb5, 0x6f, 0xff, 0x2a} }\r
+  \r
+extern EFI_GUID gEfiMonotonicCounterArchProtocolGuid;\r
+\r
+#endif\r
diff --git a/Tools/Source/TianoTools/Include/Dxe/ArchProtocol/RealTimeClock.h b/Tools/Source/TianoTools/Include/Dxe/ArchProtocol/RealTimeClock.h
new file mode 100644 (file)
index 0000000..dc968e1
--- /dev/null
@@ -0,0 +1,41 @@
+/** @file\r
+  Real Time clock Architectural Protocol as defined in DXE CIS\r
+\r
+  This code abstracts time and data functions. Used to provide\r
+  Time and date related EFI runtime services.\r
+\r
+  The GetTime (), SetTime (), GetWakeupTime (), and SetWakeupTime () EFI 1.0\r
+  services are added to the EFI system table and the \r
+  EFI_REAL_TIME_CLOCK_ARCH_PROTOCOL_GUID protocol is registered with a NULL \r
+  pointer.\r
+\r
+  No CRC of the EFI system table is required, as it is done in the DXE core.\r
+\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. This program and the accompanying materials                          \r
+  are licensed and made available under the terms and conditions of the BSD License         \r
+  which accompanies this distribution.  The full text of the license may be found at        \r
+  http://opensource.org/licenses/bsd-license.php                                            \r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+  Module Name:  RealTimeClock.h\r
+\r
+  @par Revision Reference:\r
+  Version 0.91B.\r
+\r
+**/\r
+\r
+#ifndef __ARCH_PROTOCOL_REAL_TIME_CLOCK_H__\r
+#define __ARCH_PROTOCOL_REAL_TIME_CLOCK_H__\r
+\r
+//\r
+// Global ID for the Real Time Clock Architectural Protocol\r
+//\r
+#define EFI_REAL_TIME_CLOCK_ARCH_PROTOCOL_GUID \\r
+  { 0x27CFAC87, 0x46CC, 0x11d4, {0x9A, 0x38, 0x00, 0x90, 0x27, 0x3F, 0xC1, 0x4D } }\r
+\r
+extern EFI_GUID gEfiRealTimeClockArchProtocolGuid;\r
+\r
+#endif\r
diff --git a/Tools/Source/TianoTools/Include/Dxe/ArchProtocol/Reset.h b/Tools/Source/TianoTools/Include/Dxe/ArchProtocol/Reset.h
new file mode 100644 (file)
index 0000000..80befae
--- /dev/null
@@ -0,0 +1,38 @@
+/** @file\r
+  Reset Architectural Protocol as defined in the DXE CIS\r
+\r
+  Used to provide ResetSystem runtime services\r
+\r
+  The ResetSystem () EFI 1.0 service is added to the EFI system table and the \r
+  EFI_RESET_ARCH_PROTOCOL_GUID protocol is registered with a NULL pointer.\r
+\r
+  No CRC of the EFI system table is required, as it is done in the DXE core.\r
+\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. This program and the accompanying materials                          \r
+  are licensed and made available under the terms and conditions of the BSD License         \r
+  which accompanies this distribution.  The full text of the license may be found at        \r
+  http://opensource.org/licenses/bsd-license.php                                            \r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+  Module Name:  Reset.h\r
+\r
+  @par Revision Reference:\r
+  Version 0.91B.\r
+\r
+**/\r
+\r
+#ifndef __ARCH_PROTOCOL_RESET_H__\r
+#define __ARCH_PROTOCOL_RESET_H__\r
+\r
+//\r
+// Global ID for the Reset Architectural Protocol\r
+//\r
+#define EFI_RESET_ARCH_PROTOCOL_GUID  \\r
+  { 0x27CFAC88, 0x46CC, 0x11d4, {0x9A, 0x38, 0x00, 0x90, 0x27, 0x3F, 0xC1, 0x4D } }\r
+\r
+extern EFI_GUID gEfiResetArchProtocolGuid;\r
+\r
+#endif\r
diff --git a/Tools/Source/TianoTools/Include/Dxe/ArchProtocol/Runtime.h b/Tools/Source/TianoTools/Include/Dxe/ArchProtocol/Runtime.h
new file mode 100644 (file)
index 0000000..bbd4c1a
--- /dev/null
@@ -0,0 +1,162 @@
+/** @file\r
+  Runtime Architectural Protocol as defined in DXE CIS\r
+\r
+  This code is used to produce the EFI 1.0 runtime virtual switch over\r
+\r
+  This driver must add SetVirtualAddressMap () and ConvertPointer () to\r
+  the EFI system table. This driver is not responcible for CRCing the \r
+  EFI system table.\r
+\r
+  This driver will add EFI_RUNTIME_ARCH_PROTOCOL_GUID protocol with a \r
+  pointer to the Runtime Arch Protocol instance structure. The protocol\r
+  member functions are used by the DXE core to export information need\r
+  by this driver to produce the runtime transition to virtual mode\r
+  calling.\r
+\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. This program and the accompanying materials                          \r
+  are licensed and made available under the terms and conditions of the BSD License         \r
+  which accompanies this distribution.  The full text of the license may be found at        \r
+  http://opensource.org/licenses/bsd-license.php                                            \r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+  Module Name:  Runtime.h\r
+\r
+  @par Revision Reference:\r
+  Version 0.90.\r
+\r
+**/\r
+\r
+#ifndef __ARCH_PROTOCOL_RUNTIME_H__\r
+#define __ARCH_PROTOCOL_RUNTIME_H__\r
+\r
+//\r
+// Global ID for the Runtime Architectural Protocol\r
+//\r
+#define EFI_RUNTIME_ARCH_PROTOCOL_GUID \\r
+  { 0x96d08253, 0x8483, 0x11d4, {0xbc, 0xf1, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81 } }\r
+\r
+typedef struct _EFI_RUNTIME_ARCH_PROTOCOL   EFI_RUNTIME_ARCH_PROTOCOL;\r
+\r
+/**\r
+  When a SetVirtualAddressMap() is performed all the runtime images loaded by \r
+  DXE must be fixed up with the new virtual address map. To facilitate this the \r
+  Runtime Architectural Protocol needs to be informed of every runtime driver \r
+  that is registered.  All the runtime images loaded by DXE should be registered \r
+  with this service by the DXE Core when ExitBootServices() is called.  The \r
+  images that are registered with this service must have successfully been \r
+  loaded into memory with the Boot Service LoadImage().  As a result, no \r
+  parameter checking needs to be performed.\r
+\r
+  @param  This The EFI_RUNTIME_ARCH_PROTOCOL instance.\r
+  \r
+  @param  ImageBase Start of image that has been loaded in memory. It is either\r
+  a pointer to the DOS or PE header of the image.\r
+  \r
+  @param  ImageSize Size of the image in bytes.\r
+  \r
+  @param  RelocationData Information about the fixups that were performed on ImageBase\r
+  when it was loaded into memory. This information is needed\r
+  when the virtual mode fix-ups are reapplied so that data that\r
+  has been programmatically updated will not be fixed up. If\r
+  code updates a global variable the code is responsible for\r
+  fixing up the variable for virtual mode.\r
+\r
+  @retval  EFI_SUCCESS The ImageBase has been registered.\r
+  \r
+  @retval  EFI_OUT_OF_RESOURCES There are not enough resources to register ImageBase.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_RUNTIME_REGISTER_IMAGE) (\r
+  IN EFI_RUNTIME_ARCH_PROTOCOL  *This,\r
+  IN  EFI_PHYSICAL_ADDRESS              ImageBase,   \r
+  IN  UINTN                             ImageSize,     \r
+  IN  VOID                              *RelocationData    \r
+  );\r
+\r
+\r
+/**\r
+  This function is used to support the required runtime events. Currently only \r
+  runtime events of type EFI_EVENT_SIGNAL_VIRTUAL_ADDRESS_CHANGE needs to be \r
+  registered with this service.  All the runtime events that exist in the DXE \r
+  Core should be registered with this service when ExitBootServices() is called.  \r
+  All the events that are registered with this service must have been created \r
+  with the Boot Service CreateEvent().  As a result, no parameter checking needs \r
+  to be performed.\r
+\r
+  @param  This The EFI_RUNTIME_ARCH_PROTOCOL instance.\r
+  \r
+  @param  Type The same as Type passed into CreateEvent().\r
+  \r
+  @param  NotifyTpl The same as NotifyTpl passed into CreateEvent().\r
+  \r
+  @param  NotifyFunction The same as NotifyFunction passed into CreateEvent().\r
+  \r
+  @param  NotifyContext The same as NotifyContext passed into CreateEvent().\r
+  \r
+  @param  Event The EFI_EVENT returned by CreateEvent().  Event must be in\r
+  runtime memory.\r
+\r
+  @retval  EFI_SUCCESS The Event has been registered.\r
+  \r
+  @retval  EFI_OUT_OF_RESOURCES There are not enough resources to register Event.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_RUNTIME_REGISTER_EVENT) (\r
+  IN EFI_RUNTIME_ARCH_PROTOCOL  *This,\r
+  IN UINT32                             Type,\r
+  IN EFI_TPL                            NotifyTpl,\r
+  IN EFI_EVENT_NOTIFY                   NotifyFunction,\r
+  IN VOID                               *NotifyContext,\r
+  IN EFI_EVENT                          *Event\r
+  );\r
+\r
+//\r
+// Interface stucture for the Runtime Architectural Protocol\r
+//\r
+/**\r
+  @par Protocol Description:\r
+  The DXE driver that produces this protocol must be a runtime driver.  This \r
+  driver is responsible for initializing the SetVirtualAddressMap() and \r
+  ConvertPointer() fields of the EFI Runtime Services Table and the \r
+  CalculateCrc32() field of the EFI Boot Services Table.  See the Runtime \r
+  Services chapter and the Boot Services chapter for details on these services.\r
+  After the two fields of the EFI Runtime Services Table and the one field of \r
+  the EFI Boot Services Table have been initialized, the driver must install \r
+  the EFI_RUNTIME_ARCH_PROTOCOL_GUID on a new handle with an EFI_RUNTIME_ARCH_ \r
+  PROTOCOL interface pointer.  The installation of this protocol informs the \r
+  DXE core that the virtual memory services and the 32-bit CRC services are \r
+  now available, and the DXE core must update the 32-bit CRC of the EFI Runtime \r
+  Services Table and the 32-bit CRC of the EFI Boot Services Table.\r
+\r
+  All runtime core services are provided by the EFI_RUNTIME_ARCH_PROTOCOL.  \r
+  This includes the support for registering runtime images that must be \r
+  re-fixed up when a transition is made from physical mode to virtual mode. \r
+  This protocol also supports all events that are defined to fire at runtime. \r
+  This protocol also contains a CRC-32 function that will be used by the DXE \r
+  core as a boot service. The EFI_RUNTIME_ARCH_PROTOCOL needs the CRC-32 \r
+  function when a transition is made from physical mode to virtual mode and \r
+  the EFI System Table and EFI Runtime Table are fixed up with virtual pointers.\r
+\r
+  @param RegisterRuntimeImage\r
+  Register a runtime image so it can be converted to virtual mode if the EFI Runtime Services \r
+  SetVirtualAddressMap() is called.\r
+\r
+  @param RegisterRuntimeEvent\r
+  Register an event than needs to be notified at runtime. \r
+\r
+**/\r
+struct _EFI_RUNTIME_ARCH_PROTOCOL {\r
+  EFI_RUNTIME_REGISTER_IMAGE  RegisterImage;\r
+  EFI_RUNTIME_REGISTER_EVENT  RegisterEvent;\r
+};\r
+\r
+extern EFI_GUID gEfiRuntimeArchProtocolGuid;\r
+\r
+#endif\r
diff --git a/Tools/Source/TianoTools/Include/Dxe/ArchProtocol/Security.h b/Tools/Source/TianoTools/Include/Dxe/ArchProtocol/Security.h
new file mode 100644 (file)
index 0000000..3598199
--- /dev/null
@@ -0,0 +1,136 @@
+/** @file\r
+  Security Architectural Protocol as defined in the DXE CIS\r
+\r
+  Used to provide Security services.  Specifically, dependening upon the \r
+  authentication state of a discovered driver in a Firmware Volume, the \r
+  portable DXE Core Dispatcher will call into the Security Architectural \r
+  Protocol (SAP) with the authentication state of the driver.\r
+\r
+  This call-out allows for OEM-specific policy decisions to be made, such\r
+  as event logging for attested boots, locking flash in response to discovering\r
+  an unsigned driver or failed signature check, or other exception response.\r
+\r
+  The SAP can also change system behavior by having the DXE core put a driver\r
+  in the Schedule-On-Request (SOR) state.  This will allow for later disposition \r
+  of the driver by platform agent, such as Platform BDS.\r
+\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. This program and the accompanying materials                          \r
+  are licensed and made available under the terms and conditions of the BSD License         \r
+  which accompanies this distribution.  The full text of the license may be found at        \r
+  http://opensource.org/licenses/bsd-license.php                                            \r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+  Module Name:  Security.h\r
+\r
+  @par Revision Reference:\r
+  Version 0.91B.\r
+\r
+**/\r
+\r
+#ifndef __ARCH_PROTOCOL_SECURITY_H__\r
+#define __ARCH_PROTOCOL_SECURITY_H__\r
+\r
+//\r
+// Global ID for the Security Code Architectural Protocol\r
+//\r
+#define EFI_SECURITY_ARCH_PROTOCOL_GUID  \\r
+  { 0xA46423E3, 0x4617, 0x49f1, {0xB9, 0xFF, 0xD1, 0xBF, 0xA9, 0x11, 0x58, 0x39 } }\r
+\r
+typedef struct _EFI_SECURITY_ARCH_PROTOCOL    EFI_SECURITY_ARCH_PROTOCOL;\r
+\r
+/**\r
+  The EFI_SECURITY_ARCH_PROTOCOL (SAP) is used to abstract platform-specific \r
+  policy from the DXE core response to an attempt to use a file that returns a \r
+  given status for the authentication check from the section extraction protocol.  \r
+\r
+  The possible responses in a given SAP implementation may include locking \r
+  flash upon failure to authenticate, attestation logging for all signed drivers, \r
+  and other exception operations.  The File parameter allows for possible logging \r
+  within the SAP of the driver.\r
+\r
+  If File is NULL, then EFI_INVALID_PARAMETER is returned.\r
+\r
+  If the file specified by File with an authentication status specified by \r
+  AuthenticationStatus is safe for the DXE Core to use, then EFI_SUCCESS is returned.\r
+\r
+  If the file specified by File with an authentication status specified by \r
+  AuthenticationStatus is not safe for the DXE Core to use under any circumstances, \r
+  then EFI_ACCESS_DENIED is returned.\r
+\r
+  If the file specified by File with an authentication status specified by \r
+  AuthenticationStatus is not safe for the DXE Core to use right now, but it \r
+  might be possible to use it at a future time, then EFI_SECURITY_VIOLATION is \r
+  returned.\r
+\r
+  @param  This The EFI_SECURITY_ARCH_PROTOCOL instance.\r
+  \r
+  @param  AuthenticationStatus This is the authentication type returned from the Section\r
+  Extraction protocol.  See the Section Extraction Protocol\r
+  Specification for details on this type.\r
+  \r
+  @param  File This is a pointer to the device path of the file that is\r
+  being dispatched.  This will optionally be used for logging.\r
+\r
+  @retval  EFI_SUCCESS The file specified by File did authenticate, and the\r
+  platform policy dictates that the DXE Core may use File.\r
+  \r
+  @retval  EFI_INVALID_PARAMETER Driver is NULL.\r
+  \r
+  @retval  EFI_SECURITY_VIOLATION The file specified by File did not authenticate, and\r
+  the platform policy dictates that File should be placed\r
+  in the untrusted state.   A file may be promoted from\r
+  the untrusted to the trusted state at a future time\r
+  with a call to the Trust() DXE Service.\r
+  \r
+  @retval  EFI_ACCESS_DENIED The file specified by File did not authenticate, and\r
+  the platform policy dictates that File should not be\r
+  used for any purpose.\r
+\r
+**/\r
+typedef \r
+EFI_STATUS\r
+(EFIAPI *EFI_SECURITY_FILE_AUTHENTICATION_STATE) (\r
+  IN EFI_SECURITY_ARCH_PROTOCOL     *This,\r
+  IN  UINT32                        AuthenticationStatus,\r
+  IN  EFI_DEVICE_PATH_PROTOCOL      *File\r
+  )\r
+;\r
+\r
+//\r
+// Interface stucture for the Timer Architectural Protocol\r
+//\r
+/**\r
+  @par Protocol Description:\r
+\r
+  The EFI_SECURITY_ARCH_PROTOCOL is used to abstract platform-specific policy\r
+  from the DXE core.  This includes locking flash upon failure to authenticate, \r
+  attestation logging, and other exception operations.\r
+\r
+  The driver that produces the EFI_SECURITY_ARCH_PROTOCOL may also optionally \r
+  install the EFI_SECURITY_POLICY_PROTOCOL_GUID onto a new handle with a NULL \r
+  interface.  The existence of this GUID in the protocol database means that \r
+  the GUIDed Section Extraction Protocol should authenticate the contents of \r
+  an Authentication Section.  The expectation is that the GUIDed Section \r
+  Extraction protocol will look for the existence of the EFI_SECURITY_POLICY_ \r
+  PROTOCOL_GUID in the protocol database.  If it exists, then the publication \r
+  thereof is taken as an injunction to attempt an authentication of any section \r
+  wrapped in an Authentication Section.  See the Firmware File System \r
+  Specification for details on the GUIDed Section Extraction Protocol and \r
+  Authentication Sections.\r
+\r
+  @par Protocol Parameters:\r
+\r
+  FileAuthenticationState - This service is called upon fault with respect to \r
+  the authentication of a section of a file.\r
+\r
+**/\r
+struct _EFI_SECURITY_ARCH_PROTOCOL {\r
+  EFI_SECURITY_FILE_AUTHENTICATION_STATE  FileAuthenticationState;\r
+};\r
+\r
+extern EFI_GUID gEfiSecurityArchProtocolGuid;\r
+\r
+#endif\r
diff --git a/Tools/Source/TianoTools/Include/Dxe/ArchProtocol/SecurityPolicy.h b/Tools/Source/TianoTools/Include/Dxe/ArchProtocol/SecurityPolicy.h
new file mode 100644 (file)
index 0000000..b46267e
--- /dev/null
@@ -0,0 +1,31 @@
+/** @file\r
+  Security Policy protocol as defined in the DXE CIS\r
+\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. This program and the accompanying materials                          \r
+  are licensed and made available under the terms and conditions of the BSD License         \r
+  which accompanies this distribution.  The full text of the license may be found at        \r
+  http://opensource.org/licenses/bsd-license.php                                            \r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+  Module Name:  SecurityPolicy.h\r
+\r
+  @par Revision Reference:\r
+  Version 0.91B.\r
+\r
+**/\r
+\r
+#ifndef _SECURITY_POLICY_H_\r
+#define _SECURITY_POLICY_H_\r
+\r
+//\r
+// Security policy protocol GUID definition\r
+//\r
+#define EFI_SECURITY_POLICY_PROTOCOL_GUID  \\r
+  {0x78E4D245, 0xCD4D, 0x4a05, {0xA2, 0xBA, 0x47, 0x43, 0xE8, 0x6C, 0xFC, 0xAB} }\r
+\r
+extern EFI_GUID gEfiSecurityPolicyProtocolGuid;\r
+\r
+#endif\r
diff --git a/Tools/Source/TianoTools/Include/Dxe/ArchProtocol/StatusCode.h b/Tools/Source/TianoTools/Include/Dxe/ArchProtocol/StatusCode.h
new file mode 100644 (file)
index 0000000..6440dc3
--- /dev/null
@@ -0,0 +1,82 @@
+/** @file\r
+  Status code Runtime Protocol as defined in the DXE CIS\r
+\r
+  The StatusCode () Tiano service is added to the EFI system table and the \r
+  EFI_STATUS_CODE_ARCH_PROTOCOL_GUID protocol is registered with a NULL \r
+  pointer.\r
+\r
+  No CRC of the EFI system table is required, as it is done in the DXE core.\r
+\r
+  This code abstracts Status Code reporting.\r
+\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. This program and the accompanying materials                          \r
+  are licensed and made available under the terms and conditions of the BSD License         \r
+  which accompanies this distribution.  The full text of the license may be found at        \r
+  http://opensource.org/licenses/bsd-license.php                                            \r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+  Module Name:  StatusCode.h\r
+\r
+  @par Revision Reference:\r
+  Version 0.91B.\r
+\r
+**/\r
+\r
+#ifndef __STATUS_CODE_RUNTIME_PROTOCOL_H__\r
+#define __STATUS_CODE_RUNTIME_PROTOCOL_H__\r
+\r
+#define EFI_STATUS_CODE_RUNTIME_PROTOCOL_GUID  \\r
+{ 0xd2b2b828, 0x826, 0x48a7,  { 0xb3, 0xdf, 0x98, 0x3c, 0x0, 0x60, 0x24, 0xf0 } }\r
+\r
+/**\r
+  Provides an interface that a software module can call to report a status code.\r
+\r
+  @param  Type Indicates the type of status code being reported.\r
+  \r
+  @param  Value Describes the current status of a hardware or software entity.\r
+  This included information about the class and subclass that is used to \r
+  classify the entity as well as an operation.\r
+  \r
+  @param  Instance The enumeration of a hardware or software entity within \r
+  the system. Valid instance numbers start with 1.\r
+  \r
+  @param  CallerId This optional parameter may be used to identify the caller.\r
+  This parameter allows the status code driver to apply different rules to \r
+  different callers.\r
+  \r
+  @param  Data This optional parameter may be used to pass additional data.\r
+\r
+  @retval EFI_SUCCESS The function completed successfully\r
+  \r
+  @retval EFI_DEVICE_ERROR The function should not be completed due to a device error.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS \r
+(EFIAPI *EFI_REPORT_STATUS_CODE) (\r
+  IN EFI_STATUS_CODE_TYPE     Type,\r
+  IN EFI_STATUS_CODE_VALUE    Value,\r
+  IN UINT32                   Instance,\r
+  IN EFI_GUID                 *CallerId  OPTIONAL,\r
+  IN EFI_STATUS_CODE_DATA     *Data      OPTIONAL\r
+  );\r
+\r
+/**\r
+  @par Protocol Description:\r
+  Provides the service required to report a status code to the platform firmware.\r
+  This protocol must be produced by a runtime DXE driver and may be consumed \r
+  only by the DXE Foundation.\r
+\r
+  @param ReportStatusCode Emit a status code.\r
+\r
+**/\r
+typedef struct _EFI_STATUS_CODE_PROTOCOL {\r
+  EFI_REPORT_STATUS_CODE         ReportStatusCode;\r
+} EFI_STATUS_CODE_PROTOCOL;\r
+\r
+extern EFI_GUID gEfiStatusCodeRuntimeProtocolGuid;\r
+\r
+#endif\r
diff --git a/Tools/Source/TianoTools/Include/Dxe/ArchProtocol/Timer.h b/Tools/Source/TianoTools/Include/Dxe/ArchProtocol/Timer.h
new file mode 100644 (file)
index 0000000..330f4cf
--- /dev/null
@@ -0,0 +1,222 @@
+/** @file\r
+  Timer Architectural Protocol as defined in the DXE CIS\r
+\r
+  This code is used to provide the timer tick for the DXE core.\r
+\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. This program and the accompanying materials                          \r
+  are licensed and made available under the terms and conditions of the BSD License         \r
+  which accompanies this distribution.  The full text of the license may be found at        \r
+  http://opensource.org/licenses/bsd-license.php                                            \r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+  Module Name:  Timer.h\r
+\r
+  @par Revision Reference:\r
+  Version 0.91B.\r
+\r
+**/\r
+\r
+#ifndef __ARCH_PROTOCOL_TIMER_H__\r
+#define __ARCH_PROTOCOL_TIMER_H__\r
+\r
+//\r
+// Global ID for the Timer Architectural Protocol\r
+//\r
+#define EFI_TIMER_ARCH_PROTOCOL_GUID \\r
+  { 0x26baccb3, 0x6f42, 0x11d4, {0xbc, 0xe7, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81 } }\r
+\r
+//\r
+// Declare forward reference for the Timer Architectural Protocol\r
+//\r
+typedef struct _EFI_TIMER_ARCH_PROTOCOL   EFI_TIMER_ARCH_PROTOCOL;\r
+\r
+/**\r
+  This function of this type is called when a timer interrupt fires.  This \r
+  function executes at TPL_HIGH_LEVEL.  The DXE Core will register a funtion\r
+  of tyis type to be called for the timer interrupt, so it can know how much \r
+  time has passed.  This information is used to signal timer based events.  \r
+\r
+  @param  Time Time since the last timer interrupt in 100 ns units.  This will\r
+  typically be TimerPeriod, but if a timer interrupt is missed, and the\r
+  EFI_TIMER_ARCH_PROTOCOL driver can detect missed interrupts, then Time\r
+  will contain the actual amount of time since the last interrupt.\r
+\r
+  None.\r
+\r
+**/\r
+typedef\r
+VOID\r
+(EFIAPI *EFI_TIMER_NOTIFY) (\r
+  IN UINT64  Time\r
+  );\r
+\r
+/**\r
+  This function registers the handler NotifyFunction so it is called every time \r
+  the timer interrupt fires.  It also passes the amount of time since the last \r
+  handler call to the NotifyFunction.  If NotifyFunction is NULL, then the \r
+  handler is unregistered.  If the handler is registered, then EFI_SUCCESS is \r
+  returned.  If the CPU does not support registering a timer interrupt handler, \r
+  then EFI_UNSUPPORTED is returned.  If an attempt is made to register a handler \r
+  when a handler is already registered, then EFI_ALREADY_STARTED is returned.  \r
+  If an attempt is made to unregister a handler when a handler is not registered, \r
+  then EFI_INVALID_PARAMETER is returned.  If an error occurs attempting to \r
+  register the NotifyFunction with the timer interrupt, then EFI_DEVICE_ERROR \r
+  is returned.\r
+\r
+  @param  This The EFI_TIMER_ARCH_PROTOCOL instance.\r
+  \r
+  @param  NotifyFunction The function to call when a timer interrupt fires.  This\r
+  function executes at TPL_HIGH_LEVEL.  The DXE Core will\r
+  register a handler for the timer interrupt, so it can know\r
+  how much time has passed.  This information is used to\r
+  signal timer based events.  NULL will unregister the handler.\r
+\r
+  @retval  EFI_SUCCESS The timer handler was registered.\r
+  \r
+  @retval  EFI_UNSUPPORTED The platform does not support timer interrupts.\r
+  \r
+  @retval  EFI_ALREADY_STARTED NotifyFunction is not NULL, and a handler is already\r
+  registered.\r
+  \r
+  @retval  EFI_INVALID_PARAMETER NotifyFunction is NULL, and a handler was not\r
+  previously registered.\r
+  \r
+  @retval  EFI_DEVICE_ERROR The timer handler could not be registered.\r
+\r
+**/\r
+typedef \r
+EFI_STATUS\r
+(EFIAPI *EFI_TIMER_REGISTER_HANDLER) (\r
+  IN EFI_TIMER_ARCH_PROTOCOL    *This,\r
+  IN EFI_TIMER_NOTIFY           NotifyFunction\r
+);\r
+\r
+/**\r
+  This function adjusts the period of timer interrupts to the value specified \r
+  by TimerPeriod.  If the timer period is updated, then the selected timer \r
+  period is stored in EFI_TIMER.TimerPeriod, and EFI_SUCCESS is returned.  If \r
+  the timer hardware is not programmable, then EFI_UNSUPPORTED is returned.  \r
+  If an error occurs while attempting to update the timer period, then the \r
+  timer hardware will be put back in its state prior to this call, and \r
+  EFI_DEVICE_ERROR is returned.  If TimerPeriod is 0, then the timer interrupt \r
+  is disabled.  This is not the same as disabling the CPU's interrupts.  \r
+  Instead, it must either turn off the timer hardware, or it must adjust the \r
+  interrupt controller so that a CPU interrupt is not generated when the timer \r
+  interrupt fires. \r
+\r
+  @param  This The EFI_TIMER_ARCH_PROTOCOL instance.\r
+  \r
+  @param  TimerPeriod The rate to program the timer interrupt in 100 nS units.  If\r
+  the timer hardware is not programmable, then EFI_UNSUPPORTED is\r
+  returned.  If the timer is programmable, then the timer period\r
+  will be rounded up to the nearest timer period that is supported\r
+  by the timer hardware.  If TimerPeriod is set to 0, then the\r
+  timer interrupts will be disabled.\r
+\r
+  @retval  EFI_SUCCESS The timer period was changed.\r
+  \r
+  @retval  EFI_UNSUPPORTED The platform cannot change the period of the timer interrupt.\r
+  \r
+  @retval  EFI_DEVICE_ERROR The timer period could not be changed due to a device error.\r
+\r
+**/\r
+typedef \r
+EFI_STATUS\r
+(EFIAPI *EFI_TIMER_SET_TIMER_PERIOD) (\r
+  IN EFI_TIMER_ARCH_PROTOCOL    *This,\r
+  IN UINT64                     TimerPeriod\r
+  );\r
+\r
+/**\r
+  This function retrieves the period of timer interrupts in 100 ns units, \r
+  returns that value in TimerPeriod, and returns EFI_SUCCESS.  If TimerPeriod \r
+  is NULL, then EFI_INVALID_PARAMETER is returned.  If a TimerPeriod of 0 is \r
+  returned, then the timer is currently disabled.\r
+\r
+  @param  This The EFI_TIMER_ARCH_PROTOCOL instance.\r
+  \r
+  @param  TimerPeriod A pointer to the timer period to retrieve in 100 ns units.  If\r
+  0 is returned, then the timer is currently disabled.\r
+\r
+  @retval  EFI_SUCCESS The timer period was returned in TimerPeriod.\r
+  \r
+  @retval  EFI_INVALID_PARAMETER TimerPeriod is NULL.\r
+\r
+**/\r
+typedef \r
+EFI_STATUS\r
+(EFIAPI *EFI_TIMER_GET_TIMER_PERIOD) (\r
+  IN EFI_TIMER_ARCH_PROTOCOL      *This,\r
+  OUT UINT64                      *TimerPeriod\r
+  );\r
+\r
+/**\r
+  This function generates a soft timer interrupt. If the platform does not support soft \r
+  timer interrupts, then EFI_UNSUPPORTED is returned. Otherwise, EFI_SUCCESS is returned. \r
+  If a handler has been registered through the EFI_TIMER_ARCH_PROTOCOL.RegisterHandler() \r
+  service, then a soft timer interrupt will be generated. If the timer interrupt is \r
+  enabled when this service is called, then the registered handler will be invoked. The \r
+  registered handler should not be able to distinguish a hardware-generated timer \r
+  interrupt from a software-generated timer interrupt.\r
+\r
+  @param  This The EFI_TIMER_ARCH_PROTOCOL instance.\r
+\r
+  @retval  EFI_SUCCESS The soft timer interrupt was generated.\r
+  \r
+  @retval  EFI_UNSUPPORTEDT The platform does not support the generation of soft timer interrupts.\r
+\r
+**/\r
+typedef \r
+EFI_STATUS\r
+(EFIAPI *EFI_TIMER_GENERATE_SOFT_INTERRUPT) (\r
+  IN EFI_TIMER_ARCH_PROTOCOL    *This\r
+  );\r
+\r
+\r
+/**\r
+  Interface stucture for the Timer Architectural Protocol.\r
+\r
+  @par Protocol Description:\r
+  This protocol provides the services to initialize a periodic timer \r
+  interrupt, and to register a handler that is called each time the timer\r
+  interrupt fires.  It may also provide a service to adjust the rate of the\r
+  periodic timer interrupt.  When a timer interrupt occurs, the handler is \r
+  passed the amount of time that has passed since the previous timer \r
+  interrupt.\r
+\r
+  @param RegisterHandler\r
+  Registers a handler that will be called each time the \r
+  timer interrupt fires.  TimerPeriod defines the minimum \r
+  time between timer interrupts, so TimerPeriod will also \r
+  be the minimum time between calls to the registered \r
+  handler.\r
+\r
+  @param SetTimerPeriod\r
+  Sets the period of the timer interrupt in 100 nS units.  \r
+  This function is optional, and may return EFI_UNSUPPORTED.  \r
+  If this function is supported, then the timer period will \r
+  be rounded up to the nearest supported timer period.\r
+\r
+  @param GetTimerPeriod\r
+  Retrieves the period of the timer interrupt in 100 nS units.\r
+\r
+  @param GenerateSoftInterrupt\r
+  Generates a soft timer interrupt that simulates the firing of \r
+  the timer interrupt. This service can be used to invoke the \r
+  registered handler if the timer interrupt has been masked for \r
+  a period of time.\r
+\r
+**/\r
+struct _EFI_TIMER_ARCH_PROTOCOL {\r
+  EFI_TIMER_REGISTER_HANDLER          RegisterHandler;\r
+  EFI_TIMER_SET_TIMER_PERIOD          SetTimerPeriod;\r
+  EFI_TIMER_GET_TIMER_PERIOD          GetTimerPeriod;\r
+  EFI_TIMER_GENERATE_SOFT_INTERRUPT   GenerateSoftInterrupt;\r
+};\r
+\r
+extern EFI_GUID gEfiTimerArchProtocolGuid;\r
+\r
+#endif\r
diff --git a/Tools/Source/TianoTools/Include/Dxe/ArchProtocol/Variable.h b/Tools/Source/TianoTools/Include/Dxe/ArchProtocol/Variable.h
new file mode 100644 (file)
index 0000000..13eb113
--- /dev/null
@@ -0,0 +1,39 @@
+/** @file\r
+  Variable Architectural Protocol as defined in the DXE CIS\r
+\r
+  This code is used to produce the EFI 1.0 runtime variable services\r
+\r
+  The GetVariable (), GetNextVariableName (), and SetVariable () EFI 1.0 \r
+  services are added to the EFI system table and the \r
+  EFI_VARIABLE_ARCH_PROTOCOL_GUID protocol is registered with a NULL pointer.\r
+\r
+  No CRC of the EFI system table is required, as it is done in the DXE core.\r
+\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. This program and the accompanying materials                          \r
+  are licensed and made available under the terms and conditions of the BSD License         \r
+  which accompanies this distribution.  The full text of the license may be found at        \r
+  http://opensource.org/licenses/bsd-license.php                                            \r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+  Module Name:  Variable.h\r
+\r
+  @par Revision Reference:\r
+  Version 0.91B.\r
+\r
+**/\r
+\r
+#ifndef __ARCH_PROTOCOL_VARIABLE_ARCH_H__\r
+#define __ARCH_PROTOCOL_VARIABLE_ARCH_H__\r
+\r
+//\r
+// Global ID for the Variable Architectural Protocol\r
+//\r
+#define EFI_VARIABLE_ARCH_PROTOCOL_GUID \\r
+  { 0x1e5668e2, 0x8481, 0x11d4, {0xbc, 0xf1, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81 } }\r
+\r
+extern EFI_GUID gEfiVariableArchProtocolGuid;\r
+\r
+#endif \r
diff --git a/Tools/Source/TianoTools/Include/Dxe/ArchProtocol/VariableWrite.h b/Tools/Source/TianoTools/Include/Dxe/ArchProtocol/VariableWrite.h
new file mode 100644 (file)
index 0000000..8c21df5
--- /dev/null
@@ -0,0 +1,38 @@
+/** @file\r
+  Variable Write Architectural Protocol as defined in the DXE CIS\r
+\r
+  This code is used to produce the EFI 1.0 runtime variable services\r
+\r
+  The SetVariable () EFI 1.0 services may be updated to the EFI system table and the \r
+  EFI_VARIABLE_WRITE_ARCH_PROTOCOL_GUID protocol is registered with a NULL pointer.\r
+\r
+  No CRC of the EFI system table is required, as it is done in the DXE core.\r
+\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. This program and the accompanying materials                          \r
+  are licensed and made available under the terms and conditions of the BSD License         \r
+  which accompanies this distribution.  The full text of the license may be found at        \r
+  http://opensource.org/licenses/bsd-license.php                                            \r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+  Module Name:  VariableWrite.h\r
+\r
+  @par Revision Reference:\r
+  Version 0.91B.\r
+\r
+**/\r
+\r
+#ifndef __ARCH_PROTOCOL_VARIABLE_WRITE_ARCH_H__\r
+#define __ARCH_PROTOCOL_VARIABLE_WRITE_ARCH_H__\r
+\r
+//\r
+// Global ID for the Variable Write Architectural Protocol\r
+//\r
+#define EFI_VARIABLE_WRITE_ARCH_PROTOCOL_GUID \\r
+  { 0x6441f818, 0x6362, 0x4e44, {0xb5, 0x70, 0x7d, 0xba, 0x31, 0xdd, 0x24, 0x53 } }\r
+\r
+extern EFI_GUID gEfiVariableWriteArchProtocolGuid;\r
+\r
+#endif \r
diff --git a/Tools/Source/TianoTools/Include/Dxe/ArchProtocol/WatchdogTimer.h b/Tools/Source/TianoTools/Include/Dxe/ArchProtocol/WatchdogTimer.h
new file mode 100644 (file)
index 0000000..a8d84b1
--- /dev/null
@@ -0,0 +1,172 @@
+/** @file\r
+  Watchdog Timer Architectural Protocol as defined in the DXE CIS\r
+\r
+  Used to provide system watchdog timer services\r
+\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. This program and the accompanying materials                          \r
+  are licensed and made available under the terms and conditions of the BSD License         \r
+  which accompanies this distribution.  The full text of the license may be found at        \r
+  http://opensource.org/licenses/bsd-license.php                                            \r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+  Module Name:  WatchdogTimer.h\r
+\r
+  @par Revision Reference:\r
+  Version 0.91B.\r
+\r
+**/\r
+\r
+#ifndef __ARCH_PROTOCOL_WATCHDOG_TIMER_H__\r
+#define __ARCH_PROTOCOL_WATCHDOG_TIMER_H__\r
+\r
+//\r
+// Global ID for the Watchdog Timer Architectural Protocol\r
+//\r
+#define EFI_WATCHDOG_TIMER_ARCH_PROTOCOL_GUID \\r
+  { 0x665E3FF5, 0x46CC, 0x11d4, {0x9A, 0x38, 0x00, 0x90, 0x27, 0x3F, 0xC1, 0x4D } }\r
+\r
+//\r
+// Declare forward reference for the Timer Architectural Protocol\r
+//\r
+typedef struct _EFI_WATCHDOG_TIMER_ARCH_PROTOCOL  EFI_WATCHDOG_TIMER_ARCH_PROTOCOL;\r
+\r
+/**\r
+  A function of this type is called when the watchdog timer fires if a \r
+  handler has been registered.\r
+\r
+  @param  Time The time in 100 ns units that has passed since the watchdog\r
+  timer was armed.  For the notify function to be called, this\r
+  must be greater than TimerPeriod.\r
+\r
+  @return None.\r
+\r
+**/\r
+typedef\r
+VOID\r
+(EFIAPI *EFI_WATCHDOG_TIMER_NOTIFY) (\r
+  IN UINT64  Time\r
+  );\r
+\r
+/**\r
+  This function registers a handler that is to be invoked when the watchdog \r
+  timer fires.  By default, the EFI_WATCHDOG_TIMER protocol will call the \r
+  Runtime Service ResetSystem() when the watchdog timer fires.  If a \r
+  NotifyFunction is registered, then the NotifyFunction will be called before \r
+  the Runtime Service ResetSystem() is called.  If NotifyFunction is NULL, then \r
+  the watchdog handler is unregistered.  If a watchdog handler is registered, \r
+  then EFI_SUCCESS is returned.  If an attempt is made to register a handler \r
+  when a handler is already registered, then EFI_ALREADY_STARTED is returned.  \r
+  If an attempt is made to uninstall a handler when a handler is not installed, \r
+  then return EFI_INVALID_PARAMETER.\r
+\r
+  @param  This The EFI_WATCHDOG_TIMER_ARCH_PROTOCOL instance.\r
+  \r
+  @param  NotifyFunction The function to call when the watchdog timer fires.  If this\r
+  is NULL, then the handler will be unregistered.\r
+\r
+  @retval  EFI_SUCCESS The watchdog timer handler was registered or\r
+  unregistered.\r
+  \r
+  @retval  EFI_ALREADY_STARTED NotifyFunction is not NULL, and a handler is already\r
+  registered.\r
+  \r
+  @retval  EFI_INVALID_PARAMETER NotifyFunction is NULL, and a handler was not\r
+  previously registered.\r
+\r
+**/\r
+typedef \r
+EFI_STATUS\r
+(EFIAPI *EFI_WATCHDOG_TIMER_REGISTER_HANDLER) (\r
+  IN EFI_WATCHDOG_TIMER_ARCH_PROTOCOL  *This,\r
+  IN EFI_WATCHDOG_TIMER_NOTIFY         NotifyFunction\r
+  );\r
+\r
+/**\r
+  This function sets the amount of time to wait before firing the watchdog \r
+  timer to TimerPeriod 100 nS units.  If TimerPeriod is 0, then the watchdog \r
+  timer is disabled.\r
+\r
+  @param  This The EFI_WATCHDOG_TIMER_ARCH_PROTOCOL instance.\r
+  \r
+  @param  TimerPeriod The amount of time in 100 nS units to wait before the watchdog\r
+  timer is fired.  If TimerPeriod is zero, then the watchdog\r
+  timer is disabled.\r
+\r
+  @retval  EFI_SUCCESS The watchdog timer has been programmed to fire in Time\r
+  100 nS units.\r
+  \r
+  @retval  EFI_DEVICE_ERROR A watchdog timer could not be programmed due to a device\r
+  error.\r
+\r
+**/\r
+typedef \r
+EFI_STATUS\r
+(EFIAPI *EFI_WATCHDOG_TIMER_SET_TIMER_PERIOD) (\r
+  IN EFI_WATCHDOG_TIMER_ARCH_PROTOCOL  *This,\r
+  IN UINT64                            TimerPeriod\r
+  );\r
+\r
+/**\r
+  This function retrieves the amount of time the system will wait before firing \r
+  the watchdog timer.  This period is returned in TimerPeriod, and EFI_SUCCESS \r
+  is returned.  If TimerPeriod is NULL, then EFI_INVALID_PARAMETER is returned.\r
+\r
+  @param  This The EFI_WATCHDOG_TIMER_ARCH_PROTOCOL instance.\r
+  \r
+  @param  TimerPeriod A pointer to the amount of time in 100 nS units that the system\r
+  will wait before the watchdog timer is fired.  If TimerPeriod of\r
+  zero is returned, then the watchdog timer is disabled.\r
+\r
+  @retval  EFI_SUCCESS The amount of time that the system will wait before\r
+  firing the watchdog timer was returned in TimerPeriod.\r
+  \r
+  @retval  EFI_INVALID_PARAMETER TimerPeriod is NULL.\r
+\r
+**/\r
+typedef \r
+EFI_STATUS\r
+(EFIAPI *EFI_WATCHDOG_TIMER_GET_TIMER_PERIOD) (\r
+  IN  EFI_WATCHDOG_TIMER_ARCH_PROTOCOL  *This,\r
+  OUT UINT64                            *TimerPeriod\r
+  );\r
+\r
+\r
+/**\r
+  Interface stucture for the Watchdog Timer Architectural Protocol.\r
+\r
+  @par Protocol Description:\r
+  This protocol provides the services required to implement the Boot Service \r
+  SetWatchdogTimer().  It provides a service to set the amount of time to wait \r
+  before firing the watchdog timer, and it also provides a service to register \r
+  a handler that is invoked when the watchdog timer fires.  This protocol can \r
+  implement the watchdog timer by using the event and timer Boot Services, or \r
+  it can make use of custom hardware.  When the watchdog timer fires, control \r
+  will be passed to a handler if one has been registered.  If no handler has \r
+  been registered, or the registered handler returns, then the system will be \r
+  reset by calling the Runtime Service ResetSystem().\r
+\r
+  @param RegisterHandler - Registers a handler that is invoked when the watchdog \r
+  timer fires.\r
+\r
+  @param SetTimerPeriod  - Sets the amount of time in 100 ns units to wait before the \r
+  watchdog timer is fired.  If this function is supported, \r
+  then the watchdog timer period will be rounded up to the \r
+  nearest supported watchdog timer period.\r
+\r
+  @param GetTimerPeriod  - Retrieves the amount of time in 100 ns units that the \r
+  system will wait before the watchdog timer is fired.\r
+\r
+**/\r
+struct _EFI_WATCHDOG_TIMER_ARCH_PROTOCOL {\r
+  EFI_WATCHDOG_TIMER_REGISTER_HANDLER  RegisterHandler;\r
+  EFI_WATCHDOG_TIMER_SET_TIMER_PERIOD  SetTimerPeriod;\r
+  EFI_WATCHDOG_TIMER_GET_TIMER_PERIOD  GetTimerPeriod;\r
+};\r
+\r
+extern EFI_GUID gEfiWatchdogTimerArchProtocolGuid;\r
+\r
+#endif\r
+\r
diff --git a/Tools/Source/TianoTools/Include/Dxe/DxeCis.h b/Tools/Source/TianoTools/Include/Dxe/DxeCis.h
new file mode 100644 (file)
index 0000000..a36481c
--- /dev/null
@@ -0,0 +1,589 @@
+/** @file\r
+  Include file matches things in the DXE CIS.\r
+\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. This program and the accompanying materials                          \r
+  are licensed and made available under the terms and conditions of the BSD License         \r
+  which accompanies this distribution.  The full text of the license may be found at        \r
+  http://opensource.org/licenses/bsd-license.php                                            \r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+  Module Name:  DxeCis.h\r
+\r
+  @par Revision Reference:\r
+  Version 0.91B.\r
+\r
+**/\r
+\r
+#ifndef __DXE_CIS__\r
+#define __DXE_CIS__\r
+\r
+#include <Uefi/UefiSpec.h>\r
+\r
+\r
+#define TIANO_ERROR(a)              (MAX_2_BITS | (a))\r
+\r
+#if (EFI_SPECIFICATION_VERSION < 0x00020000)\r
+//\r
+// Tiano added a couple of return types. These are owned by UEFI specification\r
+//  and Tiano can not use them. Thus for UEFI 2.0/R9 support we moved the values\r
+//  to a UEFI OEM extension range to conform to UEFI specification.\r
+//\r
+#define EFI_NOT_AVAILABLE_YET   EFIERR (28)\r
+#define EFI_UNLOAD_IMAGE        EFIERR (29)\r
+#else\r
+#define EFI_NOT_AVAILABLE_YET   TIANO_ERROR (0)\r
+#define EFI_UNLOAD_IMAGE        TIANO_ERROR (1)\r
+#endif\r
+\r
+//\r
+// BugBug: Implementation contamination of UEFI 2.0\r
+// Pointer to internal runtime pointer\r
+//\r
+#define EFI_IPF_GP_POINTER  0x00000008\r
+\r
+\r
+//\r
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\r
+//\r
+\r
+//\r
+// attributes for reserved memory before it is promoted to system memory\r
+//\r
+#define EFI_MEMORY_PRESENT      0x0100000000000000ULL\r
+#define EFI_MEMORY_INITIALIZED  0x0200000000000000ULL\r
+#define EFI_MEMORY_TESTED       0x0400000000000000ULL\r
+\r
+//\r
+// range for memory mapped port I/O on IPF\r
+//\r
+#define EFI_MEMORY_PORT_IO  0x4000000000000000ULL\r
+\r
+//\r
+// Modifier for EFI DXE Services\r
+//\r
+#define EFI_DXESERVICE\r
+\r
+\r
+//\r
+// Global Coherencey Domain types\r
+//\r
+typedef enum {\r
+  EfiGcdMemoryTypeNonExistent,\r
+  EfiGcdMemoryTypeReserved,\r
+  EfiGcdMemoryTypeSystemMemory,\r
+  EfiGcdMemoryTypeMemoryMappedIo,\r
+  EfiGcdMemoryTypeMaximum\r
+} EFI_GCD_MEMORY_TYPE;\r
+\r
+typedef enum {\r
+  EfiGcdIoTypeNonExistent,\r
+  EfiGcdIoTypeReserved,\r
+  EfiGcdIoTypeIo,\r
+  EfiGcdIoTypeMaximum\r
+} EFI_GCD_IO_TYPE;\r
+\r
+typedef enum {\r
+  EfiGcdAllocateAnySearchBottomUp,\r
+  EfiGcdAllocateMaxAddressSearchBottomUp,\r
+  EfiGcdAllocateAddress,\r
+  EfiGcdAllocateAnySearchTopDown,\r
+  EfiGcdAllocateMaxAddressSearchTopDown,\r
+  EfiGcdMaxAllocateType\r
+} EFI_GCD_ALLOCATE_TYPE;\r
+\r
+typedef struct {\r
+  EFI_PHYSICAL_ADDRESS  BaseAddress;\r
+  UINT64                Length;\r
+  UINT64                Capabilities;\r
+  UINT64                Attributes;\r
+  EFI_GCD_MEMORY_TYPE   GcdMemoryType;\r
+  EFI_HANDLE            ImageHandle;\r
+  EFI_HANDLE            DeviceHandle;\r
+} EFI_GCD_MEMORY_SPACE_DESCRIPTOR;\r
+\r
+typedef struct {\r
+  EFI_PHYSICAL_ADDRESS  BaseAddress;\r
+  UINT64                Length;\r
+  EFI_GCD_IO_TYPE       GcdIoType;\r
+  EFI_HANDLE            ImageHandle;\r
+  EFI_HANDLE            DeviceHandle;\r
+} EFI_GCD_IO_SPACE_DESCRIPTOR;\r
+\r
+/**\r
+  Adds reserved memory, system memory, or memory-mapped I/O resources to the\r
+  global coherency domain of the processor.\r
+\r
+  @param  GcdMemoryType Memory type of the memory space.\r
+  \r
+  @param  BaseAddress Base address of the memory space.\r
+  \r
+  @param  Length Length of the memory space.\r
+  \r
+  @param  Capabilities alterable attributes of the memory space.\r
+\r
+  @retval  EFI_SUCCESS Merged this memory space into GCD map.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_ADD_MEMORY_SPACE) (\r
+  IN EFI_GCD_MEMORY_TYPE   GcdMemoryType,\r
+  IN EFI_PHYSICAL_ADDRESS  BaseAddress,\r
+  IN UINT64                Length,\r
+  IN UINT64                Capabilities\r
+  )\r
+;\r
+\r
+/**\r
+  Allocates nonexistent memory, reserved memory, system memory, or memorymapped\r
+  I/O resources from the global coherency domain of the processor.\r
+\r
+  @param  GcdAllocateType The type of allocate operation\r
+  \r
+  @param  GcdMemoryType The desired memory type\r
+  \r
+  @param  Alignment Align with 2^Alignment\r
+  \r
+  @param  Length Length to allocate\r
+  \r
+  @param  BaseAddress Base address to allocate\r
+  \r
+  @param  Imagehandle The image handle consume the allocated space.\r
+  \r
+  @param  DeviceHandle The device handle consume the allocated space.\r
+\r
+  @retval  EFI_INVALID_PARAMETER Invalid parameter.\r
+  \r
+  @retval  EFI_NOT_FOUND No descriptor contains the desired space.\r
+  \r
+  @retval  EFI_SUCCESS Memory space successfully allocated.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_ALLOCATE_MEMORY_SPACE) (\r
+  IN     EFI_GCD_ALLOCATE_TYPE               GcdAllocateType,\r
+  IN     EFI_GCD_MEMORY_TYPE                 GcdMemoryType,\r
+  IN     UINTN                               Alignment,\r
+  IN     UINT64                              Length,\r
+  IN OUT EFI_PHYSICAL_ADDRESS                *BaseAddress,\r
+  IN     EFI_HANDLE                          ImageHandle,\r
+  IN     EFI_HANDLE                          DeviceHandle OPTIONAL\r
+  )\r
+;\r
+\r
+/**\r
+  Frees nonexistent memory, reserved memory, system memory, or memory-mapped\r
+  I/O resources from the global coherency domain of the processor.\r
+\r
+  @param  BaseAddress Base address of the segment.\r
+  \r
+  @param  Length Length of the segment.\r
+\r
+  @retval  EFI_SUCCESS Space successfully freed.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_FREE_MEMORY_SPACE) (\r
+  IN EFI_PHYSICAL_ADDRESS  BaseAddress,\r
+  IN UINT64                Length\r
+  )\r
+;\r
+\r
+/**\r
+  Removes reserved memory, system memory, or memory-mapped I/O resources from\r
+  the global coherency domain of the processor.\r
+\r
+  @param  BaseAddress Base address of the memory space.\r
+  \r
+  @param  Length Length of the memory space.\r
+\r
+  @retval  EFI_SUCCESS Successfully remove a segment of memory space.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_REMOVE_MEMORY_SPACE) (\r
+  IN EFI_PHYSICAL_ADDRESS  BaseAddress,\r
+  IN UINT64                Length\r
+  )\r
+;\r
+\r
+/**\r
+  Retrieves the descriptor for a memory region containing a specified address.\r
+\r
+  @param  BaseAddress Specified start address\r
+  \r
+  @param  Descriptor Specified length\r
+\r
+  @retval  EFI_INVALID_PARAMETER Invalid parameter\r
+  \r
+  @retval  EFI_SUCCESS Successfully get memory space descriptor.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_GET_MEMORY_SPACE_DESCRIPTOR) (\r
+  IN  EFI_PHYSICAL_ADDRESS             BaseAddress,\r
+  OUT EFI_GCD_MEMORY_SPACE_DESCRIPTOR  *Descriptor\r
+  )\r
+;\r
+\r
+/**\r
+  Modifies the attributes for a memory region in the global coherency domain of the\r
+  processor.\r
+\r
+  @param  BaseAddress Specified start address\r
+  \r
+  @param  Length Specified length\r
+  \r
+  @param  Attributes Specified attributes\r
+\r
+  @retval  EFI_SUCCESS Successfully set attribute of a segment of memory space.\r
+\r
+**/\r
+typedef\r
+\r
+EFI_STATUS\r
+(EFIAPI *EFI_SET_MEMORY_SPACE_ATTRIBUTES) (\r
+  IN EFI_PHYSICAL_ADDRESS         BaseAddress,\r
+  IN UINT64                       Length,\r
+  IN UINT64                       Attributes\r
+  )\r
+;\r
+\r
+/**\r
+  Returns a map of the memory resources in the global coherency domain of the\r
+  processor.\r
+\r
+  @param  NumberOfDescriptors Number of descriptors.\r
+  \r
+  @param  MemorySpaceMap Descriptor array\r
+\r
+  @retval  EFI_INVALID_PARAMETER Invalid parameter\r
+  \r
+  @retval  EFI_OUT_OF_RESOURCES No enough buffer to allocate\r
+  \r
+  @retval  EFI_SUCCESS Successfully get memory space map.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_GET_MEMORY_SPACE_MAP) (\r
+  OUT UINTN                            *NumberOfDescriptors,\r
+  OUT EFI_GCD_MEMORY_SPACE_DESCRIPTOR  **MemorySpaceMap\r
+  )\r
+;\r
+\r
+/**\r
+  Adds reserved I/O or I/O resources to the global coherency domain of the processor.\r
+\r
+  @param  GcdIoType IO type of the segment.\r
+  \r
+  @param  BaseAddress Base address of the segment.\r
+  \r
+  @param  Length Length of the segment.\r
+\r
+  @retval  EFI_SUCCESS Merged this segment into GCD map.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_ADD_IO_SPACE) (\r
+  IN EFI_GCD_IO_TYPE       GcdIoType,\r
+  IN EFI_PHYSICAL_ADDRESS  BaseAddress,\r
+  IN UINT64                Length\r
+  )\r
+;\r
+\r
+/**\r
+  Allocates nonexistent I/O, reserved I/O, or I/O resources from the global coherency\r
+  domain of the processor.\r
+\r
+  @param  GcdAllocateType The type of allocate operation\r
+  \r
+  @param  GcdIoType The desired IO type\r
+  \r
+  @param  Alignment Align with 2^Alignment\r
+  \r
+  @param  Length Length to allocate\r
+  \r
+  @param  BaseAddress Base address to allocate\r
+  \r
+  @param  Imagehandle The image handle consume the allocated space.\r
+  \r
+  @param  DeviceHandle The device handle consume the allocated space.\r
+\r
+  @retval  EFI_INVALID_PARAMETER Invalid parameter.\r
+  \r
+  @retval  EFI_NOT_FOUND No descriptor contains the desired space.\r
+  \r
+  @retval  EFI_SUCCESS IO space successfully allocated.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_ALLOCATE_IO_SPACE) (\r
+  IN     EFI_GCD_ALLOCATE_TYPE               GcdAllocateType,\r
+  IN     EFI_GCD_IO_TYPE                     GcdIoType,\r
+  IN     UINTN                               Alignment,\r
+  IN     UINT64                              Length,\r
+  IN OUT EFI_PHYSICAL_ADDRESS                *BaseAddress,\r
+  IN     EFI_HANDLE                          ImageHandle,\r
+  IN     EFI_HANDLE                          DeviceHandle OPTIONAL\r
+  )\r
+;\r
+\r
+/**\r
+  Frees nonexistent I/O, reserved I/O, or I/O resources from the global coherency\r
+  domain of the processor.\r
+\r
+  @param  BaseAddress Base address of the segment.\r
+  \r
+  @param  Length Length of the segment.\r
+\r
+  @retval  EFI_SUCCESS Space successfully freed.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_FREE_IO_SPACE) (\r
+  IN EFI_PHYSICAL_ADDRESS  BaseAddress,\r
+  IN UINT64                Length\r
+  )\r
+;\r
+\r
+/**\r
+  Removes reserved I/O or I/O resources from the global coherency domain of the\r
+  processor.\r
+\r
+  @param  BaseAddress Base address of the segment.\r
+  \r
+  @param  Length Length of the segment.\r
+\r
+  @retval  EFI_SUCCESS Successfully removed a segment of IO space.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_REMOVE_IO_SPACE) (\r
+  IN EFI_PHYSICAL_ADDRESS  BaseAddress,\r
+  IN UINT64                Length\r
+  )\r
+;\r
+\r
+/**\r
+  Retrieves the descriptor for an I/O region containing a specified address.\r
+\r
+  @param  BaseAddress Specified start address\r
+  \r
+  @param  Descriptor Specified length\r
+\r
+  @retval  EFI_INVALID_PARAMETER Descriptor is NULL.\r
+  \r
+  @retval  EFI_SUCCESS Successfully get the IO space descriptor.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_GET_IO_SPACE_DESCRIPTOR) (\r
+  IN  EFI_PHYSICAL_ADDRESS         BaseAddress,\r
+  OUT EFI_GCD_IO_SPACE_DESCRIPTOR  *Descriptor\r
+  )\r
+;\r
+\r
+/**\r
+  Returns a map of the I/O resources in the global coherency domain of the processor.\r
+\r
+  @param  NumberOfDescriptors Number of descriptors.\r
+  \r
+  @param  MemorySpaceMap Descriptor array\r
+\r
+  @retval  EFI_INVALID_PARAMETER Invalid parameter\r
+  \r
+  @retval  EFI_OUT_OF_RESOURCES No enough buffer to allocate\r
+  \r
+  @retval  EFI_SUCCESS Successfully get IO space map.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_GET_IO_SPACE_MAP) (\r
+  OUT UINTN                        *NumberOfDescriptors,\r
+  OUT EFI_GCD_IO_SPACE_DESCRIPTOR  **IoSpaceMap\r
+  )\r
+;\r
+\r
+/**\r
+  Loads and executed DXE drivers from firmware volumes.\r
+\r
+  @return Status code\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_DISPATCH) (VOID)\r
+;\r
+\r
+/**\r
+  Clears the Schedule on Request (SOR) flag for a component that is stored in a firmware volume.\r
+\r
+  @param  FirmwareVolumeHandle The handle of the firmware volume that contains the file specified by FileName.\r
+  \r
+  @param  DriverName A pointer to the name of the file in a firmware volume.\r
+\r
+  @return Status code\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_SCHEDULE) (\r
+  IN EFI_HANDLE  FirmwareVolumeHandle,\r
+  IN EFI_GUID    *DriverName\r
+  )\r
+;\r
+\r
+/**\r
+  Promotes a file stored in a firmware volume from the untrusted to the trusted state.\r
+\r
+  @param  FirmwareVolumeHandle The handle of the firmware volume that contains the file specified by FileName.\r
+  \r
+  @param  DriverName A pointer to the name of the file in a firmware volume.\r
+\r
+  @return Status code\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_TRUST) (\r
+  IN EFI_HANDLE  FirmwareVolumeHandle,\r
+  IN EFI_GUID    *DriverName\r
+  )\r
+;\r
+\r
+/**\r
+  Creates a firmware volume handle for a firmware volume that is present in system memory.\r
+\r
+  @param  FirmwareVolumeHeader A pointer to the header of the firmware volume.\r
+  @param  Size The size, in bytes, of the firmware volume.\r
+  @param  FirmwareVolumeHandle On output, a pointer to the created handle.\r
+\r
+  @return Status code\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_PROCESS_FIRMWARE_VOLUME) (\r
+  IN VOID                             *FvHeader,\r
+  IN UINTN                            Size,\r
+  OUT EFI_HANDLE                      *FirmwareVolumeHandle\r
+  )\r
+;\r
+\r
+//\r
+// DXE Services Table\r
+//\r
+#define EFI_DXE_SERVICES_SIGNATURE  0x565245535f455844ULL\r
+#define EFI_DXE_SERVICES_REVISION   ((0 << 16) | (25))\r
+\r
+typedef struct {\r
+  EFI_TABLE_HEADER                Hdr;\r
+\r
+  //\r
+  // Global Coherency Domain Services\r
+  //\r
+  EFI_ADD_MEMORY_SPACE            AddMemorySpace;\r
+  EFI_ALLOCATE_MEMORY_SPACE       AllocateMemorySpace;\r
+  EFI_FREE_MEMORY_SPACE           FreeMemorySpace;\r
+  EFI_REMOVE_MEMORY_SPACE         RemoveMemorySpace;\r
+  EFI_GET_MEMORY_SPACE_DESCRIPTOR GetMemorySpaceDescriptor;\r
+  EFI_SET_MEMORY_SPACE_ATTRIBUTES SetMemorySpaceAttributes;\r
+  EFI_GET_MEMORY_SPACE_MAP        GetMemorySpaceMap;\r
+  EFI_ADD_IO_SPACE                AddIoSpace;\r
+  EFI_ALLOCATE_IO_SPACE           AllocateIoSpace;\r
+  EFI_FREE_IO_SPACE               FreeIoSpace;\r
+  EFI_REMOVE_IO_SPACE             RemoveIoSpace;\r
+  EFI_GET_IO_SPACE_DESCRIPTOR     GetIoSpaceDescriptor;\r
+  EFI_GET_IO_SPACE_MAP            GetIoSpaceMap;\r
+\r
+  //\r
+  // Dispatcher Services\r
+  //\r
+  EFI_DISPATCH                    Dispatch;\r
+  EFI_SCHEDULE                    Schedule;\r
+  EFI_TRUST                       Trust;\r
+  //\r
+  // Service to process a single firmware volume found in a capsule\r
+  //\r
+  EFI_PROCESS_FIRMWARE_VOLUME     ProcessFirmwareVolume;\r
+} EFI_DXE_SERVICES;\r
+\r
+\r
+#include <Common/BootMode.h>\r
+#include <Common/BootScript.h>\r
+#include <Common/Capsule.h>\r
+#include <Common/Dependency.h>\r
+#include <Common/FirmwareVolumeImageFormat.h>\r
+#include <Common/FirmwareVolumeHeader.h>\r
+#include <Common/FirmwareFileSystem.h>\r
+#include <Common/Hob.h>\r
+#include <Common/InternalFormRepresentation.h>\r
+#include <Common/StatusCode.h>\r
+#include <Common/StatusCodeDataTypeId.h>\r
+\r
+#include <Guid/AcpiTableStorage.h>\r
+#include <Guid/Apriori.h>\r
+#include <Guid/Capsule.h>\r
+#include <Guid/DxeServices.h>\r
+#include <Guid/EventLegacyBios.h>\r
+#include <Guid/FirmwareFileSystem.h>\r
+#include <Guid/FrameworkDevicePath.h>\r
+#include <Guid/HobList.h>\r
+#include <Guid/MemoryAllocationHob.h>\r
+#include <Guid/SmramMemoryReserve.h>\r
+#include <Guid/StatusCodeDataTypeId.h>\r
+\r
+#include <Dxe/ArchProtocol/Bds.h>\r
+#include <Dxe/ArchProtocol/Cpu.h>\r
+#include <Dxe/ArchProtocol/Metronome.h>\r
+#include <Dxe/ArchProtocol/MonotonicCounter.h>\r
+#include <Dxe/ArchProtocol/RealTimeClock.h>\r
+#include <Dxe/ArchProtocol/Reset.h>\r
+#include <Dxe/ArchProtocol/Runtime.h>\r
+#include <Dxe/ArchProtocol/Security.h>\r
+#include <Dxe/ArchProtocol/SecurityPolicy.h>\r
+#include <Dxe/ArchProtocol/StatusCode.h>\r
+#include <Dxe/ArchProtocol/Timer.h>\r
+#include <Dxe/ArchProtocol/Variable.h>\r
+#include <Dxe/ArchProtocol/VariableWrite.h>\r
+#include <Dxe/ArchProtocol/WatchdogTimer.h>\r
+\r
+#include <Protocol/AcpiSupport.h>\r
+#include <Protocol/BootScriptSave.h>\r
+#include <Protocol/CpuIo.h>\r
+#include <Protocol/DataHub.h>\r
+#include <Protocol/FirmwareVolume.h>\r
+#include <Protocol/FirmwareVolumeBlock.h>\r
+#include <Protocol/FirmwareVolumeDispatch.h>\r
+#include <Protocol/Hii.h>\r
+#include <Protocol/FormBrowser.h>\r
+#include <Protocol/FormCallback.h>\r
+#include <Protocol/GuidedSectionExtraction.h>\r
+#include <Protocol/IdeControllerInit.h>\r
+#include <Protocol/IncompatiblePciDeviceSupport.h>\r
+#include <Protocol/PciHostBridgeResourceAllocation.h>\r
+#include <Protocol/PciHotPlugInit.h>\r
+#include <Protocol/PciPlatform.h>\r
+#include <Protocol/SectionExtraction.h>\r
+#include <Protocol/Smbus.h>\r
+#include <Protocol/LegacyBios.h>\r
+#include <Protocol/Legacy8259.h>\r
+#include <Protocol/LegacyRegion.h>\r
+#include <Protocol/LegacyBiosPlatform.h>\r
+#include <Protocol/LegacyInterrupt.h>\r
+\r
+#endif\r
diff --git a/Tools/Source/TianoTools/Include/Dxe/SmmCis.h b/Tools/Source/TianoTools/Include/Dxe/SmmCis.h
new file mode 100644 (file)
index 0000000..35a1a64
--- /dev/null
@@ -0,0 +1,526 @@
+/** @file\r
+  Include file matches things in the Smm CIS spec.\r
+\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. This program and the accompanying materials                          \r
+  are licensed and made available under the terms and conditions of the BSD License         \r
+  which accompanies this distribution.  The full text of the license may be found at        \r
+  http://opensource.org/licenses/bsd-license.php                                            \r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+  Module Name:  SmmCis.h\r
+\r
+  @par Revision Reference:\r
+  Version 0.9.\r
+\r
+**/\r
+\r
+#ifndef __SMM_CIS__\r
+#define __SMM_CIS__\r
+\r
+#define EFI_SMM_CPU_IO_GUID \\r
+  { \\r
+    0x5f439a0b, 0x45d8, 0x4682, {0xa4, 0xf4, 0xf0, 0x57, 0x6b, 0x51, 0x34, 0x41 } \\r
+  }\r
+\r
+typedef struct _EFI_SMM_SYSTEM_TABLE              EFI_SMM_SYSTEM_TABLE;\r
+typedef struct _EFI_SMM_CPU_IO_INTERFACE          EFI_SMM_CPU_IO_INTERFACE;\r
+\r
+\r
+//\r
+// SMM Base specification constant and types\r
+//\r
+#define SMM_SMST_SIGNATURE            EFI_SIGNATURE_32 ('S', 'M', 'S', 'T')\r
+#define EFI_SMM_SYSTEM_TABLE_REVISION (0 << 16) | (0x09)\r
+\r
+//\r
+// *******************************************************\r
+// EFI_SMM_IO_WIDTH\r
+// *******************************************************\r
+//\r
+typedef enum {\r
+  SMM_IO_UINT8  = 0,\r
+  SMM_IO_UINT16 = 1,\r
+  SMM_IO_UINT32 = 2,\r
+  SMM_IO_UINT64 = 3\r
+} EFI_SMM_IO_WIDTH;\r
+\r
+/**\r
+  Provides the basic memory and I/O interfaces that are used to \r
+  abstract accesses to devices.\r
+\r
+  @param  This The EFI_SMM_CPU_IO_INTERFACE instance.  \r
+  \r
+  @param  Width Signifies the width of the I/O operations. \r
+  \r
+  @param  Address The base address of the I/O operations.\r
+  \r
+  @param  Count The number of I/O operations to perform. \r
+  \r
+  @param  Buffer For read operations, the destination buffer to store the results.\r
+  For write operations, the source buffer from which to write data.\r
+\r
+  @retval EFI_SUCCESS The data was read from or written to the device.\r
+  \r
+  @retval EFI_UNSUPPORTED The Address is not valid for this system.\r
+  \r
+  @retval EFI_INVALID_PARAMETER Width or Count, or both, were invalid.\r
+  \r
+  @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_SMM_CPU_IO) (\r
+  IN EFI_SMM_CPU_IO_INTERFACE         *This,\r
+  IN EFI_SMM_IO_WIDTH                 Width,\r
+  IN UINT64                           Address,\r
+  IN UINTN                            Count,\r
+  IN OUT VOID                         *Buffer\r
+  );\r
+\r
+typedef struct {\r
+  EFI_SMM_CPU_IO  Read;\r
+  EFI_SMM_CPU_IO  Write;\r
+} EFI_SMM_IO_ACCESS;\r
+\r
+struct _EFI_SMM_CPU_IO_INTERFACE {\r
+  EFI_SMM_IO_ACCESS Mem;\r
+  EFI_SMM_IO_ACCESS Io;\r
+};\r
+\r
+/**\r
+  Allocates pool memory from SMRAM for IA-32 or runtime memory for \r
+  the Itanium processor family.\r
+\r
+  @param  PoolType The type of pool to allocate.The only supported type is EfiRuntimeServicesData\r
+  \r
+  @param  Size The number of bytes to allocate from the pool.\r
+  \r
+  @param  Buffer A pointer to a pointer to the allocated buffer if the call \r
+  succeeds; undefined otherwise.\r
+\r
+  @retval EFI_SUCCESS  The requested number of bytes was allocated.\r
+  \r
+  @retval EFI_OUT_OF_RESOURCES  The pool requested could not be allocated.\r
+  \r
+  @retval EFI_UNSUPPORTED  In runtime.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_SMMCORE_ALLOCATE_POOL) (\r
+  IN EFI_MEMORY_TYPE                PoolType,\r
+  IN UINTN                          Size,\r
+  OUT VOID                          **Buffer\r
+  );\r
+\r
+/**\r
+  Returns pool memory to the system.\r
+\r
+  @param  Buffer Pointer to the buffer to free.\r
+\r
+  @retval EFI_SUCCESS  The memory was returned to the system.\r
+  \r
+  @retval EFI_INVALID_PARAMETER  Buffer was invalid.  \r
+  \r
+  @retval EFI_UNSUPPORTED  In runtime.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_SMMCORE_FREE_POOL) (\r
+  IN VOID                   *Buffer\r
+  );\r
+\r
+/**\r
+  Allocates memory pages from the system.\r
+\r
+  @param  Type The type of allocation to perform. \r
+  \r
+  @param  MemoryType The only supported type is EfiRuntimeServicesData\r
+  \r
+  @param  NumberofPages The number of contiguous 4 KB pages to allocate\r
+  \r
+  @param  Memory Pointer to a physical address. On input, the way in which \r
+  the address is used depends on the value of Type. On output, the address \r
+  is set to the base of the page range that was allocated.\r
+\r
+  @retval EFI_SUCCESS  The requested pages were allocated.\r
+  \r
+  @retval EFI_OUT_OF_RESOURCES  The pages requested could not be allocated.\r
+  \r
+  @retval EFI_NOT_FOUND   The requested pages could not be found.\r
+  \r
+  @retval EFI_INVALID_PARAMETER  Type is not AllocateAnyPages or AllocateMaxAddress \r
+  or AllocateAddress. Or MemoryType is in the range EfiMaxMemoryType..0x7FFFFFFF.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_SMMCORE_ALLOCATE_PAGES) (\r
+  IN EFI_ALLOCATE_TYPE      Type,\r
+  IN EFI_MEMORY_TYPE        MemoryType,\r
+  IN UINTN                  NumberOfPages,\r
+  OUT EFI_PHYSICAL_ADDRESS  *Memory\r
+  );\r
+\r
+/**\r
+  Frees memory pages for the system.\r
+\r
+  @param  Memory The base physical address of the pages to be freed\r
+  \r
+  @param  NumberOfPages The number of contiguous 4 KB pages to free.\r
+\r
+  @retval EFI_SUCCESS  The requested memory pages were freed.\r
+  \r
+  @retval EFI_INVALID_PARAMETER   Memory is not a page-aligned address or NumberOfPages is invalid.\r
+  \r
+  @retval EFI_NOT_FOUND   The requested memory pages were not allocated with SmmAllocatePages().\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_SMMCORE_FREE_PAGES) (\r
+  IN EFI_PHYSICAL_ADDRESS   Memory,\r
+  IN UINTN                  NumberOfPages\r
+  );\r
+\r
+typedef\r
+VOID\r
+(EFIAPI *EFI_AP_PROCEDURE) (\r
+  IN  VOID                              *Buffer\r
+  );\r
+\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_SMM_STARTUP_THIS_AP) (\r
+  IN  EFI_AP_PROCEDURE                    Procedure,\r
+  IN  UINTN                               CpuNumber,\r
+  IN  OUT VOID                            *ProcArguments OPTIONAL\r
+  );\r
+\r
+typedef struct {\r
+  UINT8                 Reserved1[248];\r
+  UINT32                SMBASE;\r
+  UINT32                SMMRevId;\r
+  UINT16                IORestart;\r
+  UINT16                AutoHALTRestart;\r
+  UINT8                 Reserved2[164];\r
+  UINT32                ES;\r
+  UINT32                CS;\r
+  UINT32                SS;\r
+  UINT32                DS;\r
+  UINT32                FS;\r
+  UINT32                GS;\r
+  UINT32                LDTBase;\r
+  UINT32                TR;\r
+  UINT32                DR7;\r
+  UINT32                DR6;\r
+  UINT32                EAX;\r
+  UINT32                ECX;\r
+  UINT32                EDX;\r
+  UINT32                EBX;\r
+  UINT32                ESP;\r
+  UINT32                EBP;\r
+  UINT32                ESI;\r
+  UINT32                EDI;\r
+  UINT32                EIP;\r
+  UINT32                EFLAGS;\r
+  UINT32                CR3;\r
+  UINT32                CR0;\r
+} EFI_SMI_CPU_SAVE_STATE;\r
+\r
+typedef struct {\r
+  UINT64   reserved;         \r
+  UINT64   r1;\r
+  UINT64   r2;\r
+  UINT64   r3;\r
+  UINT64   r4;\r
+  UINT64   r5;\r
+  UINT64   r6;\r
+  UINT64   r7;\r
+  UINT64   r8;\r
+  UINT64   r9;\r
+  UINT64   r10;\r
+  UINT64   r11;\r
+  UINT64   r12;\r
+  UINT64   r13;\r
+  UINT64   r14;\r
+  UINT64   r15;\r
+  UINT64   r16;\r
+  UINT64   r17;\r
+  UINT64   r18;\r
+  UINT64   r19;\r
+  UINT64   r20;\r
+  UINT64   r21;\r
+  UINT64   r22;\r
+  UINT64   r23;\r
+  UINT64   r24;\r
+  UINT64   r25;\r
+  UINT64   r26;\r
+  UINT64   r27;\r
+  UINT64   r28;\r
+  UINT64   r29;\r
+  UINT64   r30;\r
+  UINT64   r31;\r
+\r
+  UINT64   pr;\r
+\r
+  UINT64   b0;\r
+  UINT64   b1;\r
+  UINT64   b2;\r
+  UINT64   b3;\r
+  UINT64   b4;\r
+  UINT64   b5;\r
+  UINT64   b6;\r
+  UINT64   b7;\r
+\r
+  // application registers\r
+  UINT64   ar_rsc;\r
+  UINT64   ar_bsp;\r
+  UINT64   ar_bspstore;\r
+  UINT64   ar_rnat;\r
+\r
+  UINT64   ar_fcr;\r
+\r
+  UINT64   ar_eflag;\r
+  UINT64   ar_csd;\r
+  UINT64   ar_ssd;\r
+  UINT64   ar_cflg;\r
+  UINT64   ar_fsr;\r
+  UINT64   ar_fir;\r
+  UINT64   ar_fdr;\r
+\r
+  UINT64   ar_ccv;\r
+\r
+  UINT64   ar_unat;\r
+\r
+  UINT64   ar_fpsr;\r
+\r
+  UINT64   ar_pfs;\r
+  UINT64   ar_lc;\r
+  UINT64   ar_ec;\r
+\r
+  // control registers\r
+  UINT64   cr_dcr;\r
+  UINT64   cr_itm;\r
+  UINT64   cr_iva;\r
+  UINT64   cr_pta;\r
+  UINT64   cr_ipsr;\r
+  UINT64   cr_isr;\r
+  UINT64   cr_iip;\r
+  UINT64   cr_ifa;\r
+  UINT64   cr_itir;\r
+  UINT64   cr_iipa;\r
+  UINT64   cr_ifs;\r
+  UINT64   cr_iim;\r
+  UINT64   cr_iha;\r
+\r
+  // debug registers\r
+  UINT64   dbr0;\r
+  UINT64   dbr1;\r
+  UINT64   dbr2;\r
+  UINT64   dbr3;\r
+  UINT64   dbr4;\r
+  UINT64   dbr5;\r
+  UINT64   dbr6;\r
+  UINT64   dbr7;\r
+\r
+  UINT64   ibr0;\r
+  UINT64   ibr1;\r
+  UINT64   ibr2;\r
+  UINT64   ibr3;\r
+  UINT64   ibr4;\r
+  UINT64   ibr5;\r
+  UINT64   ibr6;\r
+  UINT64   ibr7;\r
+\r
+  // virtual registers\r
+  UINT64   int_nat;         // nat bits for R1-R31\r
+\r
+} EFI_PMI_SYSTEM_CONTEXT;\r
+\r
+typedef union {\r
+  EFI_SMI_CPU_SAVE_STATE     Ia32SaveState;\r
+  EFI_PMI_SYSTEM_CONTEXT     ItaniumSaveState;\r
+} EFI_SMM_CPU_SAVE_STATE;\r
+\r
+typedef struct {\r
+  UINT16                Fcw;\r
+  UINT16                Fsw;\r
+  UINT16                Ftw;\r
+  UINT16                Opcode;\r
+  UINT32                Eip;\r
+  UINT16                Cs;\r
+  UINT16                Rsvd1;\r
+  UINT32                DataOffset;\r
+  UINT16                Ds;\r
+  UINT8                 Rsvd2[10];\r
+  UINT8                 St0Mm0[10], Rsvd3[6];\r
+  UINT8                 St0Mm1[10], Rsvd4[6];\r
+  UINT8                 St0Mm2[10], Rsvd5[6];\r
+  UINT8                 St0Mm3[10], Rsvd6[6];\r
+  UINT8                 St0Mm4[10], Rsvd7[6];\r
+  UINT8                 St0Mm5[10], Rsvd8[6];\r
+  UINT8                 St0Mm6[10], Rsvd9[6];\r
+  UINT8                 St0Mm7[10], Rsvd10[6];\r
+  UINT8                 Rsvd11[22*16];\r
+} EFI_SMI_OPTIONAL_FPSAVE_STATE;\r
+\r
+typedef struct {\r
+  UINT64   f2[2];\r
+  UINT64   f3[2];\r
+  UINT64   f4[2];\r
+  UINT64   f5[2];\r
+  UINT64   f6[2];\r
+  UINT64   f7[2];\r
+  UINT64   f8[2];\r
+  UINT64   f9[2];\r
+  UINT64   f10[2];\r
+  UINT64   f11[2];\r
+  UINT64   f12[2];\r
+  UINT64   f13[2];\r
+  UINT64   f14[2];\r
+  UINT64   f15[2];\r
+  UINT64   f16[2];\r
+  UINT64   f17[2];\r
+  UINT64   f18[2];\r
+  UINT64   f19[2];\r
+  UINT64   f20[2];\r
+  UINT64   f21[2];\r
+  UINT64   f22[2];\r
+  UINT64   f23[2];\r
+  UINT64   f24[2];\r
+  UINT64   f25[2];\r
+  UINT64   f26[2];\r
+  UINT64   f27[2];\r
+  UINT64   f28[2];\r
+  UINT64   f29[2];\r
+  UINT64   f30[2];\r
+  UINT64   f31[2];\r
+} EFI_PMI_OPTIONAL_FLOATING_POINT_CONTEXT;\r
+\r
+typedef union {\r
+  EFI_SMI_OPTIONAL_FPSAVE_STATE             Ia32FpSave;\r
+  EFI_PMI_OPTIONAL_FLOATING_POINT_CONTEXT   ItaniumFpSave;\r
+} EFI_SMM_FLOATING_POINT_SAVE_STATE;\r
+\r
+/**\r
+  This function is the main entry point for an SMM handler dispatch \r
+  or communicate-based callback. \r
+\r
+  @param  SmmImageHandle A unique value returned by the SMM infrastructure \r
+  in response to registration for a communicate-based callback or dispatch. \r
+  \r
+  @param  CommunicationBuffer An optional buffer that will be populated \r
+  by the SMM infrastructure in response to a non-SMM agent (preboot or runtime) \r
+  invoking the EFI_SMM_BASE_PROTOCOL.Communicate() service.\r
+  \r
+  @param  SourceSize If CommunicationBuffer is non-NULL, this field \r
+  indicates the size of the data payload in this buffer.\r
+\r
+  @return Status Code\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_SMM_HANDLER_ENTRY_POINT) (\r
+  IN EFI_HANDLE             SmmImageHandle,\r
+  IN OUT VOID               *CommunicationBuffer OPTIONAL,\r
+  IN OUT UINTN              *SourceSize OPTIONAL\r
+  );\r
+\r
+/**\r
+  The SmmInstallConfigurationTable() function is used to maintain the list \r
+  of configuration tables that are stored in the System Management System \r
+  Table.  The list is stored as an array of (GUID, Pointer) pairs.  The list \r
+  must be allocated from pool memory with PoolType set to EfiRuntimeServicesData.\r
+\r
+  @param  SystemTable A pointer to the SMM System Table.\r
+  @param  Guid A pointer to the GUID for the entry to add, update, or remove.\r
+  @param  Table A pointer to the buffer of the table to add.\r
+  @param  TableSize The size of the table to install.\r
+\r
+  @retval EFI_SUCCESS The (Guid, Table) pair was added, updated, or removed.\r
+  @retval EFI_INVALID_PARAMETER Guid is not valid.\r
+  @retval EFI_NOT_FOUND An attempt was made to delete a non-existent entry.\r
+  @retval EFI_OUT_OF_RESOURCES There is not enough memory available to complete the operation.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_SMM_INSTALL_CONFIGURATION_TABLE) (\r
+  IN EFI_SMM_SYSTEM_TABLE         *SystemTable,\r
+  IN EFI_GUID                     *Guid,\r
+  IN VOID                         *Table,\r
+  IN UINTN                        TableSize\r
+  )\r
+;\r
+\r
+//\r
+// System Management System Table (SMST)\r
+//\r
+struct _EFI_SMM_SYSTEM_TABLE {\r
+  EFI_TABLE_HEADER                    Hdr;\r
+\r
+  CHAR16                              *SmmFirmwareVendor;\r
+  UINT32                              SmmFirmwareRevision;\r
+\r
+  EFI_SMM_INSTALL_CONFIGURATION_TABLE SmmInstallConfigurationTable;\r
+\r
+  //\r
+  // I/O Services\r
+  //\r
+  EFI_GUID                            EfiSmmCpuIoGuid;\r
+  EFI_SMM_CPU_IO_INTERFACE            SmmIo;\r
+\r
+  //\r
+  // Runtime memory service\r
+  //\r
+  EFI_SMMCORE_ALLOCATE_POOL           SmmAllocatePool;\r
+  EFI_SMMCORE_FREE_POOL               SmmFreePool;\r
+  EFI_SMMCORE_ALLOCATE_PAGES          SmmAllocatePages;\r
+  EFI_SMMCORE_FREE_PAGES              SmmFreePages;\r
+\r
+  //\r
+  // MP service\r
+  //\r
+  EFI_SMM_STARTUP_THIS_AP             SmmStartupThisAp;\r
+\r
+  //\r
+  // CPU information records\r
+  //\r
+  UINTN                               CurrentlyExecutingCpu;\r
+  UINTN                               NumberOfCpus;\r
+  EFI_SMM_CPU_SAVE_STATE              *CpuSaveState;\r
+  EFI_SMM_FLOATING_POINT_SAVE_STATE   *CpuOptionalFloatingPointState;\r
+\r
+  //\r
+  // Extensibility table\r
+  //\r
+  UINTN                               NumberOfTableEntries;\r
+  EFI_CONFIGURATION_TABLE             *SmmConfigurationTable;\r
+\r
+};\r
+\r
+#include <Guid/SmmCommunicate.h>\r
+#include <Guid/SmramMemoryReserve.h>\r
+#include <Protocol/SmmBase.h>\r
+#include <Protocol/SmmAccess.h>\r
+#include <Protocol/SmmControl.h>\r
+#include <Protocol/SmmGpiDispatch.h>\r
+#include <Protocol/SmmIchnDispatch.h>\r
+#include <Protocol/SmmPeriodicTimerDispatch.h>\r
+#include <Protocol/SmmPowerButtonDispatch.h>\r
+#include <Protocol/SmmStandbyButtonDispatch.h>\r
+#include <Protocol/SmmStatusCode.h>\r
+#include <Protocol/SmmSwDispatch.h>\r
+#include <Protocol/SmmSxDispatch.h>\r
+#include <Protocol/SmmUsbDispatch.h>\r
+\r
+extern EFI_GUID gEfiSmmCpuIoGuid;\r
+\r
+#endif\r
diff --git a/Tools/Source/TianoTools/Include/Guid/Acpi.h b/Tools/Source/TianoTools/Include/Guid/Acpi.h
new file mode 100644 (file)
index 0000000..a64f1b7
--- /dev/null
@@ -0,0 +1,48 @@
+/** @file\r
+  GUIDs used for ACPI entries in the EFI 1.0 system table\r
+\r
+  These GUIDs point the ACPI tables as defined in the ACPI specifications.\r
+  ACPI 2.0 specification defines the ACPI 2.0 GUID. UEFI 2.0 defines the \r
+  ACPI 2.0 Table GUID and ACPI Table GUID.\r
+\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. This program and the accompanying materials                          \r
+  are licensed and made available under the terms and conditions of the BSD License         \r
+  which accompanies this distribution.  The full text of the license may be found at        \r
+  http://opensource.org/licenses/bsd-license.php                                            \r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+  Module Name:  Acpi.h\r
+\r
+  @par Revision Reference:\r
+  GUIDs defined in UEFI 2.0 spec.\r
+\r
+**/\r
+\r
+#ifndef __ACPI_GUID_H__\r
+#define __ACPI_GUID_H__\r
+\r
+#define EFI_ACPI_10_TABLE_GUID \\r
+  { \\r
+    0xeb9d2d30, 0x2d88, 0x11d3, {0x9a, 0x16, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d } \\r
+  }\r
+\r
+#define EFI_ACPI_TABLE_GUID \\r
+  { \\r
+    0x8868e871, 0xe4f1, 0x11d3, {0xbc, 0x22, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81 } \\r
+  }\r
+\r
+#define ACPI_10_TABLE_GUID     EFI_ACPI_10_TABLE_GUID\r
+//\r
+// ACPI 2.0 or newer tables should use EFI_ACPI_TABLE_GUID.\r
+//\r
+#define EFI_ACPI_20_TABLE_GUID EFI_ACPI_TABLE_GUID\r
+#define EFI_ACPI_30_TABLE_GUID EFI_ACPI_TABLE_GUID\r
+\r
+extern EFI_GUID gEfiAcpi10TableGuid;\r
+extern EFI_GUID gEfiAcpi20TableGuid;\r
+extern EFI_GUID gEfiAcpi30TableGuid;\r
+\r
+#endif\r
diff --git a/Tools/Source/TianoTools/Include/Guid/AcpiTableStorage.h b/Tools/Source/TianoTools/Include/Guid/AcpiTableStorage.h
new file mode 100644 (file)
index 0000000..80b1154
--- /dev/null
@@ -0,0 +1,30 @@
+/** @file\r
+  The ACPI table storage file is fully FFS compliant. \r
+  The file is a number of sections of type EFI_SECTION_RAW.\r
+  This GUID is used to identify the file as an ACPI table storage file.\r
+\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. This program and the accompanying materials                          \r
+  are licensed and made available under the terms and conditions of the BSD License         \r
+  which accompanies this distribution.  The full text of the license may be found at        \r
+  http://opensource.org/licenses/bsd-license.php                                            \r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+  Module Name:  AcpiTableStorage.h\r
+\r
+  @par Revision Reference:\r
+  GUID defined in ACPI Table Storage Spec Version 0.9.\r
+\r
+**/\r
+\r
+#ifndef _ACPI_TABLE_STORAGE_H_\r
+#define _ACPI_TABLE_STORAGE_H_\r
+\r
+#define EFI_ACPI_TABLE_STORAGE_GUID \\r
+  { 0x7e374e25, 0x8e01, 0x4fee, {0x87, 0xf2, 0x39, 0xc, 0x23, 0xc6, 0x6, 0xcd } }\r
+\r
+extern EFI_GUID gEfiAcpiTableStorageGuid;\r
+\r
+#endif\r
diff --git a/Tools/Source/TianoTools/Include/Guid/Apriori.h b/Tools/Source/TianoTools/Include/Guid/Apriori.h
new file mode 100644 (file)
index 0000000..ba92560
--- /dev/null
@@ -0,0 +1,32 @@
+/** @file\r
+  GUID used as an FV filename for A Priori file. The A Priori file contains a\r
+  list of FV filenames that the DXE dispatcher will schedule reguardless of\r
+  the dependency grammer.\r
+\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. This program and the accompanying materials                          \r
+  are licensed and made available under the terms and conditions of the BSD License         \r
+  which accompanies this distribution.  The full text of the license may be found at        \r
+  http://opensource.org/licenses/bsd-license.php                                            \r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+  Module Name:  Apriori.h\r
+\r
+  @par Revision Reference:\r
+  GUID defined in DXE CIS spec version 0.91B\r
+\r
+**/\r
+\r
+#ifndef __APRIORI_GUID_H__\r
+#define __APRIORI_GUID_H__\r
+\r
+#define EFI_APRIORI_GUID \\r
+  { \\r
+    0xfc510ee7, 0xffdc, 0x11d4, {0xbd, 0x41, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81 } \\r
+  }\r
+\r
+extern EFI_GUID gAprioriGuid;\r
+\r
+#endif\r
diff --git a/Tools/Source/TianoTools/Include/Guid/Capsule.h b/Tools/Source/TianoTools/Include/Guid/Capsule.h
new file mode 100644 (file)
index 0000000..7864b92
--- /dev/null
@@ -0,0 +1,43 @@
+/** @file\r
+  GUIDs used for EFI Capsule\r
+\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. This program and the accompanying materials                          \r
+  are licensed and made available under the terms and conditions of the BSD License         \r
+  which accompanies this distribution.  The full text of the license may be found at        \r
+  http://opensource.org/licenses/bsd-license.php                                            \r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+  Module Name:  Capsule.h\r
+\r
+  @par Revision Reference:\r
+  GUIDs defined in Capsule Spec Version 0.9\r
+\r
+**/\r
+\r
+#ifndef __CAPSULE_GUID_H__\r
+#define __CAPSULE_GUID_H__\r
+\r
+//\r
+// This is the GUID of the capsule header of the image on disk.\r
+//\r
+#define EFI_CAPSULE_GUID \\r
+  { \\r
+    0x3B6686BD, 0x0D76, 0x4030, {0xB7, 0x0E, 0xB5, 0x51, 0x9E, 0x2F, 0xC5, 0xA0 } \\r
+  }\r
+\r
+//\r
+// This is the GUID of the configuration results file created by the capsule\r
+// application.\r
+//\r
+#define EFI_CONFIG_FILE_NAME_GUID \\r
+  { \\r
+    0x98B8D59B, 0xE8BA, 0x48EE, {0x98, 0xDD, 0xC2, 0x95, 0x39, 0x2F, 0x1E, 0xDB } \\r
+  }\r
+\r
+extern EFI_GUID gEfiCapsuleGuid;\r
+extern EFI_GUID gEfiConfigFileNameGuid;\r
+\r
+#endif\r
diff --git a/Tools/Source/TianoTools/Include/Guid/DataHubRecords.h b/Tools/Source/TianoTools/Include/Guid/DataHubRecords.h
new file mode 100644 (file)
index 0000000..f29a5a4
--- /dev/null
@@ -0,0 +1,66 @@
+/** @file\r
+  DataHubRecord.h include all data hub sub class GUID defitions.\r
+\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. This program and the accompanying materials                          \r
+  are licensed and made available under the terms and conditions of the BSD License         \r
+  which accompanies this distribution.  The full text of the license may be found at        \r
+  http://opensource.org/licenses/bsd-license.php                                            \r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+  Module Name:  DataHubRecords.h\r
+\r
+  @par Revision Reference:\r
+  These GUID are from Cache subclass spec 0.9, DataHub SubClass spec 0.9, Memory SubClass Spec 0.9, \r
+  Processor Subclass spec 0.9, Misc SubClass spec 0.9.\r
+\r
+**/\r
+#ifndef _DATAHUB_RECORDS_GUID_H_\r
+#define _DATAHUB_RECORDS_GUID_H_\r
+\r
+#define EFI_PROCESSOR_PRODUCER_GUID \\r
+  { 0x1bf06aea, 0x5bec, 0x4a8d, {0x95, 0x76, 0x74, 0x9b, 0x09, 0x56, 0x2d, 0x30 } }\r
+\r
+extern  EFI_GUID gEfiProcessorProducerGuid;\r
+\r
+\r
+#define EFI_PROCESSOR_SUBCLASS_GUID \\r
+  { 0x26fdeb7e, 0xb8af, 0x4ccf, {0xaa, 0x97, 0x02, 0x63, 0x3c, 0xe4, 0x8c, 0xa7 } }\r
+\r
+extern  EFI_GUID gEfiProcessorSubClassGuid;\r
+\r
+\r
+#define EFI_CACHE_SUBCLASS_GUID \\r
+  { 0x7f0013a7, 0xdc79, 0x4b22, {0x80, 0x99, 0x11, 0xf7, 0x5f, 0xdc, 0x82, 0x9d } }\r
+\r
+extern  EFI_GUID gEfiCacheSubClassGuid;\r
+\r
+\r
+#define EFI_MEMORY_PRODUCER_GUID \\r
+  { 0x1d7add6e, 0xb2da, 0x4b0b, {0xb2, 0x9f, 0x49, 0xcb, 0x42, 0xf4, 0x63, 0x56 } }\r
+\r
+extern  EFI_GUID gEfiMemoryProducerGuid;\r
+\r
+\r
+#define EFI_MEMORY_SUBCLASS_GUID \\r
+  {0x4E8F4EBB, 0x64B9, 0x4e05, {0x9B, 0x18, 0x4C, 0xFE, 0x49, 0x23, 0x50, 0x97} }\r
+\r
+extern  EFI_GUID  gEfiMemorySubClassGuid;\r
+\r
+\r
+#define EFI_MISC_PRODUCER_GUID \\r
+  { 0x62512c92, 0x63c4, 0x4d80, {0x82, 0xb1, 0xc1, 0xa4, 0xdc, 0x44, 0x80, 0xe5 } } \r
+\r
+extern  EFI_GUID gEfiMiscProducerGuid;\r
+\r
+\r
+#define EFI_MISC_SUBCLASS_GUID \\r
+  { 0x772484B2, 0x7482, 0x4b91, {0x9F, 0x9A, 0xAD, 0x43, 0xF8, 0x1C, 0x58, 0x81 } }\r
+\r
+extern  EFI_GUID  gEfiMiscSubClassGuid;\r
+\r
+\r
+#endif\r
+\r
diff --git a/Tools/Source/TianoTools/Include/Guid/DebugImageInfoTable.h b/Tools/Source/TianoTools/Include/Guid/DebugImageInfoTable.h
new file mode 100644 (file)
index 0000000..f050a2e
--- /dev/null
@@ -0,0 +1,58 @@
+/** @file\r
+  GUID and related data structures used with the Debug Image Info Table.\r
+\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. This program and the accompanying materials                          \r
+  are licensed and made available under the terms and conditions of the BSD License         \r
+  which accompanies this distribution.  The full text of the license may be found at        \r
+  http://opensource.org/licenses/bsd-license.php                                            \r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+  Module Name:  DebugImageInfoTable.h\r
+\r
+  @par Revision Reference:\r
+  GUID defined in UEFI 2.0 spec.\r
+\r
+**/\r
+\r
+#ifndef __DEBUG_IMAGE_INFO_GUID_H__\r
+#define __DEBUG_IMAGE_INFO_GUID_H__\r
+\r
+#define EFI_DEBUG_IMAGE_INFO_TABLE_GUID \\r
+  { \\r
+    0x49152e77, 0x1ada, 0x4764, {0xb7, 0xa2, 0x7a, 0xfe, 0xfe, 0xd9, 0x5e, 0x8b } \\r
+  }\r
+\r
+extern EFI_GUID gEfiDebugImageInfoTableGuid;\r
+\r
+#define EFI_DEBUG_IMAGE_INFO_UPDATE_IN_PROGRESS 0x01\r
+#define EFI_DEBUG_IMAGE_INFO_TABLE_MODIFIED     0x02\r
+#define EFI_DEBUG_IMAGE_INFO_INITIAL_SIZE       (EFI_PAGE_SIZE / sizeof (UINTN))\r
+#define EFI_DEBUG_IMAGE_INFO_TYPE_NORMAL        0x01\r
+\r
+typedef struct {\r
+  UINT64                Signature;\r
+  EFI_PHYSICAL_ADDRESS  EfiSystemTableBase;\r
+  UINT32                Crc32;\r
+} EFI_SYSTEM_TABLE_POINTER;\r
+\r
+typedef struct {\r
+  UINT32                     ImageInfoType;\r
+  EFI_LOADED_IMAGE_PROTOCOL  *LoadedImageProtocolInstance;\r
+  EFI_HANDLE                 ImageHandle;\r
+} EFI_DEBUG_IMAGE_INFO_NORMAL;\r
+\r
+typedef union {\r
+  UINTN                       *ImageInfoType;\r
+  EFI_DEBUG_IMAGE_INFO_NORMAL *NormalImage;\r
+} EFI_DEBUG_IMAGE_INFO;\r
+\r
+typedef struct {\r
+  volatile UINT32       UpdateStatus;\r
+  UINT32                TableSize;\r
+  EFI_DEBUG_IMAGE_INFO  *EfiDebugImageInfoTable;\r
+} EFI_DEBUG_IMAGE_INFO_TABLE_HEADER;\r
+\r
+#endif\r
diff --git a/Tools/Source/TianoTools/Include/Guid/DxeServices.h b/Tools/Source/TianoTools/Include/Guid/DxeServices.h
new file mode 100644 (file)
index 0000000..70e4304
--- /dev/null
@@ -0,0 +1,30 @@
+/** @file\r
+  GUID used to identify the DXE Services Table\r
+\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. This program and the accompanying materials                          \r
+  are licensed and made available under the terms and conditions of the BSD License         \r
+  which accompanies this distribution.  The full text of the license may be found at        \r
+  http://opensource.org/licenses/bsd-license.php                                            \r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+  Module Name:  DxeServices.h\r
+\r
+  @par Revision Reference:\r
+  GUID defined in DXE CIS spec version 0.91B\r
+\r
+**/\r
+\r
+#ifndef __DXE_SERVICES_GUID_H__\r
+#define __DXE_SERVICES_GUID_H__\r
+\r
+#define EFI_DXE_SERVICES_TABLE_GUID \\r
+  { \\r
+    0x5ad34ba, 0x6f02, 0x4214, {0x95, 0x2e, 0x4d, 0xa0, 0x39, 0x8e, 0x2b, 0xb9 } \\r
+  }\r
+\r
+extern EFI_GUID gEfiDxeServicesTableGuid;\r
+\r
+#endif\r
diff --git a/Tools/Source/TianoTools/Include/Guid/EventGroup.h b/Tools/Source/TianoTools/Include/Guid/EventGroup.h
new file mode 100644 (file)
index 0000000..f86abd4
--- /dev/null
@@ -0,0 +1,45 @@
+/** @file\r
+  GUIDs for gBS->CreateEventEx Event Groups. Defined in EFI 2.0.\r
+\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. This program and the accompanying materials                          \r
+  are licensed and made available under the terms and conditions of the BSD License         \r
+  which accompanies this distribution.  The full text of the license may be found at        \r
+  http://opensource.org/licenses/bsd-license.php                                            \r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+  Module Name:  EventGroup.h\r
+\r
+**/\r
+\r
+#ifndef __EVENT_GROUP_GUID__\r
+#define __EVENT_GROUP_GUID__\r
+\r
+                                             \r
+#define EFI_EVENT_GROUP_EXIT_BOOT_SERVICES \\r
+  { 0x27abf055, 0xb1b8, 0x4c26, { 0x80, 0x48, 0x74, 0x8f, 0x37, 0xba, 0xa2, 0xdf } }\r
+\r
+extern EFI_GUID gEfiEventExitBootServicesGuid;\r
+\r
+\r
+#define EFI_EVENT_GROUP_VIRTUAL_ADDRESS_CHANGE \\r
+  { 0x13fa7698, 0xc831, 0x49c7, { 0x87, 0xea, 0x8f, 0x43, 0xfc, 0xc2, 0x51, 0x96 } }\r
+\r
+extern EFI_GUID gEfiEventVirtualAddressChangeGuid;\r
+\r
+\r
+#define EFI_EVENT_GROUP_MEMORY_MAP_CHANGE \\r
+  { 0x78bee926, 0x692f, 0x48fd, { 0x9e, 0xdb, 0x1, 0x42, 0x2e, 0xf0, 0xd7, 0xab } }\r
+\r
+extern EFI_GUID gEfiEventMemoryMapChangeGuid;\r
+\r
+\r
+#define EFI_EVENT_GROUP_READY_TO_BOOT \\r
+  { 0x7ce88fb3, 0x4bd7, 0x4679, { 0x87, 0xa8, 0xa8, 0xd8, 0xde, 0xe5, 0x0d, 0x2b } }\r
+\r
+extern EFI_GUID gEfiEventReadyToBootGuid;\r
+\r
+\r
+#endif\r
diff --git a/Tools/Source/TianoTools/Include/Guid/EventLegacyBios.h b/Tools/Source/TianoTools/Include/Guid/EventLegacyBios.h
new file mode 100644 (file)
index 0000000..6700a2d
--- /dev/null
@@ -0,0 +1,28 @@
+/** @file\r
+  GUID is the name of events used with CreateEventEx in order to be notified when the EFI boot manager is about to boot a legacy boot option.  Events of this type are notificated just before Int19h is invoked. \r
+\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. This program and the accompanying materials                          \r
+  are licensed and made available under the terms and conditions of the BSD License         \r
+  which accompanies this distribution.  The full text of the license may be found at        \r
+  http://opensource.org/licenses/bsd-license.php                                            \r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+  Module Name:  EventLegacyBios.h\r
+\r
+  @par Revision Reference:\r
+  GUIDs defined in DXE CIS 0.91b.\r
+\r
+**/\r
+\r
+#ifndef __EVENT_LEGACY_BIOS_GUID_H__\r
+#define __EVENT_LEGACY_BIOS_GUID_H__\r
+\r
+#define EFI_EVENT_LEGACY_BOOT_GUID \\r
+   { 0x2a571201, 0x4966, 0x47f6, {0x8b, 0x86, 0xf3, 0x1e, 0x41, 0xf3, 0x2f, 0x10 } }\r
+\r
+extern EFI_GUID gEfiEventLegacyBootGuid;\r
+\r
+#endif\r
diff --git a/Tools/Source/TianoTools/Include/Guid/FirmwareFileSystem.h b/Tools/Source/TianoTools/Include/Guid/FirmwareFileSystem.h
new file mode 100644 (file)
index 0000000..06bfa7d
--- /dev/null
@@ -0,0 +1,40 @@
+/** @file\r
+  Guid used to define the Firmware File System.  See the Framework Firmware \r
+  File System Specification for more details.\r
+\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. This program and the accompanying materials                          \r
+  are licensed and made available under the terms and conditions of the BSD License         \r
+  which accompanies this distribution.  The full text of the license may be found at        \r
+  http://opensource.org/licenses/bsd-license.php                                            \r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+  Module Name:  FirmwareFileSystem.h\r
+\r
+  @par Revision Reference:\r
+  Guids defined in Firmware File System Spec 0.9\r
+\r
+**/\r
+\r
+#ifndef __FIRMWARE_FILE_SYSTEM_GUID_H__\r
+#define __FIRMWARE_FILE_SYSTEM_GUID_H__\r
+\r
+//\r
+// GUIDs defined by the FFS specification.\r
+//\r
+#define EFI_FIRMWARE_FILE_SYSTEM_GUID \\r
+  { \\r
+    0x7A9354D9, 0x0468, 0x444a, {0x81, 0xCE, 0x0B, 0xF6, 0x17, 0xD8, 0x90, 0xDF } \\r
+  }\r
+\r
+#define EFI_FFS_VOLUME_TOP_FILE_GUID \\r
+  { \\r
+    0x1BA0062E, 0xC779, 0x4582, {0x85, 0x66, 0x33, 0x6A, 0xE8, 0xF7, 0x8F, 0x9 } \\r
+  }\r
+\r
+extern EFI_GUID gEfiFirmwareFileSystemGuid;\r
+extern EFI_GUID gEfiFirmwareVolumeTopFileGuid;\r
+\r
+#endif\r
diff --git a/Tools/Source/TianoTools/Include/Guid/FrameworkDevicePath.h b/Tools/Source/TianoTools/Include/Guid/FrameworkDevicePath.h
new file mode 100644 (file)
index 0000000..74c17ea
--- /dev/null
@@ -0,0 +1,29 @@
+/** @file\r
+  This GUID is used to define a vendor specific device path being owned by the \r
+  Framework specificaitons. \r
+\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. This program and the accompanying materials                          \r
+  are licensed and made available under the terms and conditions of the BSD License         \r
+  which accompanies this distribution.  The full text of the license may be found at        \r
+  http://opensource.org/licenses/bsd-license.php                                            \r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+  Module Name:  FrameworkDevicePath.h\r
+\r
+  @par Revision Reference:\r
+  Spec Version 0.9\r
+\r
+**/\r
+\r
+#ifndef __FRAMEWORK_DEVICE_PATH_GUID_H__\r
+#define __FRAMEWORK_DEVICE_PATH_GUID_H__\r
+\r
+#define EFI_FRAMEWORK_DEVICE_PATH_GUID  \\r
+  { 0xb7084e63, 0x46b7, 0x4d1a, { 0x86, 0x77, 0xe3, 0x0b, 0x53, 0xdb, 0xf0, 0x50 } }\r
+\r
+extern EFI_GUID gEfiFrameworkDevicePathGuid;\r
+\r
+#endif\r
diff --git a/Tools/Source/TianoTools/Include/Guid/GlobalVariable.h b/Tools/Source/TianoTools/Include/Guid/GlobalVariable.h
new file mode 100644 (file)
index 0000000..4a774a5
--- /dev/null
@@ -0,0 +1,31 @@
+/** @file\r
+  GUID for EFI (NVRAM) Variables.\r
+\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. This program and the accompanying materials                          \r
+  are licensed and made available under the terms and conditions of the BSD License         \r
+  which accompanies this distribution.  The full text of the license may be found at        \r
+  http://opensource.org/licenses/bsd-license.php                                            \r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+  Module Name:  GlobalVariable.h\r
+\r
+  @par Revision Reference:\r
+  GUID defined in UEFI 2.0\r
+**/\r
+\r
+#ifndef __GLOBAL_VARIABLE_GUID_H__\r
+#define __GLOBAL_VARIABLE_GUID_H__\r
+\r
+#define EFI_GLOBAL_VARIABLE_GUID \\r
+  { \\r
+    0x8BE4DF61, 0x93CA, 0x11d2, {0xAA, 0x0D, 0x00, 0xE0, 0x98, 0x03, 0x2B, 0x8C } \\r
+  }\r
+\r
+#define EFI_GLOBAL_VARIABLE EFI_GLOBAL_VARIABLE_GUID\r
+\r
+extern EFI_GUID gEfiGlobalVariableGuid;\r
+\r
+#endif\r
diff --git a/Tools/Source/TianoTools/Include/Guid/Gpt.h b/Tools/Source/TianoTools/Include/Guid/Gpt.h
new file mode 100644 (file)
index 0000000..7124511
--- /dev/null
@@ -0,0 +1,45 @@
+/** @file\r
+  Guids used for the GPT (GUID Partition Table)\r
+\r
+  GPT defines a new disk partitioning scheme and also describes \r
+  usage of the legacy Master Boot Record (MBR) partitioning scheme. \r
+\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. This program and the accompanying materials                          \r
+  are licensed and made available under the terms and conditions of the BSD License         \r
+  which accompanies this distribution.  The full text of the license may be found at        \r
+  http://opensource.org/licenses/bsd-license.php                                            \r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+  Module Name:  Gpt.h\r
+\r
+  @par Revision Reference:\r
+  GUIDs defined in UEFI 2.0 spec.\r
+\r
+**/\r
+\r
+#ifndef __GPT_GUID_H__\r
+#define __GPT_GUID_H__\r
+\r
+#define EFI_PART_TYPE_UNUSED_GUID \\r
+  { \\r
+    0x00000000, 0x0000, 0x0000, {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } \\r
+  }\r
+\r
+#define EFI_PART_TYPE_EFI_SYSTEM_PART_GUID \\r
+  { \\r
+    0xc12a7328, 0xf81f, 0x11d2, {0xba, 0x4b, 0x00, 0xa0, 0xc9, 0x3e, 0xc9, 0x3b } \\r
+  }\r
+\r
+#define EFI_PART_TYPE_LEGACY_MBR_GUID \\r
+  { \\r
+    0x024dee41, 0x33e7, 0x11d3, {0x9d, 0x69, 0x00, 0x08, 0xc7, 0x81, 0xf3, 0x9f } \\r
+  }\r
+\r
+extern EFI_GUID gEfiPartTypeUnusedGuid;\r
+extern EFI_GUID gEfiPartTypeSystemPartGuid;\r
+extern EFI_GUID gEfiPartTypeLegacyMbrGuid;\r
+\r
+#endif\r
diff --git a/Tools/Source/TianoTools/Include/Guid/HobList.h b/Tools/Source/TianoTools/Include/Guid/HobList.h
new file mode 100644 (file)
index 0000000..2493292
--- /dev/null
@@ -0,0 +1,32 @@
+/** @file\r
+  GUIDs used for HOB List entries\r
+\r
+  These GUIDs point the HOB List passed from PEI to DXE.\r
+\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. This program and the accompanying materials                          \r
+  are licensed and made available under the terms and conditions of the BSD License         \r
+  which accompanies this distribution.  The full text of the license may be found at        \r
+  http://opensource.org/licenses/bsd-license.php                                            \r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+  Module Name:  HobList.h\r
+\r
+  @par Revision Reference:\r
+  GUID defined in DXE CIS spec version 0.91\r
+\r
+**/\r
+\r
+#ifndef __HOB_LIST_GUID_H__\r
+#define __HOB_LIST_GUID_H__\r
+\r
+#define EFI_HOB_LIST_GUID \\r
+  { \\r
+    0x7739f24c, 0x93d7, 0x11d4, {0x9a, 0x3a, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d } \\r
+  }\r
+\r
+extern EFI_GUID gEfiHobListGuid;\r
+\r
+#endif\r
diff --git a/Tools/Source/TianoTools/Include/Guid/MemoryAllocationHob.h b/Tools/Source/TianoTools/Include/Guid/MemoryAllocationHob.h
new file mode 100644 (file)
index 0000000..140d8b8
--- /dev/null
@@ -0,0 +1,36 @@
+/** @file\r
+  GUIDs for HOBs used in memory allcation\r
+\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. This program and the accompanying materials                          \r
+  are licensed and made available under the terms and conditions of the BSD License         \r
+  which accompanies this distribution.  The full text of the license may be found at        \r
+  http://opensource.org/licenses/bsd-license.php                                            \r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+  Module Name:  MemoryAllocationHob.h\r
+\r
+  @par Revision Reference:\r
+  GUID defined in Hob Spec Version 0.9\r
+\r
+**/\r
+\r
+#ifndef __MEMORY_ALLOCATION_GUID_H__\r
+#define __MEMORY_ALLOCATION_GUID_H__\r
+\r
+#define EFI_HOB_MEMORY_ALLOC_BSP_STORE_GUID  \\r
+  {0x564b33cd, 0xc92a, 0x4593, {0x90, 0xbf, 0x24, 0x73, 0xe4, 0x3c, 0x63, 0x22} };\r
+\r
+#define EFI_HOB_MEMORY_ALLOC_STACK_GUID  \\r
+  {0x4ed4bf27, 0x4092, 0x42e9, {0x80, 0x7d, 0x52, 0x7b, 0x1d, 0x0, 0xc9, 0xbd} }\r
+\r
+#define EFI_HOB_MEMORY_ALLOC_MODULE_GUID  \\r
+  {0xf8e21975, 0x899, 0x4f58, {0xa4, 0xbe, 0x55, 0x25, 0xa9, 0xc6, 0xd7, 0x7a} }\r
+\r
+extern EFI_GUID gEfiHobMemoryAllocBspStoreGuid;\r
+extern EFI_GUID gEfiHobMemoryAllocStackGuid;\r
+extern EFI_GUID gEfiHobMemoryAllocModuleGuid;\r
+\r
+#endif\r
diff --git a/Tools/Source/TianoTools/Include/Guid/PcAnsi.h b/Tools/Source/TianoTools/Include/Guid/PcAnsi.h
new file mode 100644 (file)
index 0000000..c9b74ab
--- /dev/null
@@ -0,0 +1,48 @@
+/** @file\r
+  Terminal Device Path Vendor Guid.\r
+\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. This program and the accompanying materials                          \r
+  are licensed and made available under the terms and conditions of the BSD License         \r
+  which accompanies this distribution.  The full text of the license may be found at        \r
+  http://opensource.org/licenses/bsd-license.php                                            \r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+  Module Name:  PcAnsi.h\r
+\r
+  @par Revision Reference:\r
+  GUIDs defined in UEFI 2.0 spec.\r
+\r
+**/\r
+\r
+#ifndef __PC_ANSI_H__\r
+#define __PC_ANSI_H__\r
+\r
+#define EFI_PC_ANSI_GUID \\r
+  { \\r
+    0xe0c14753, 0xf9be, 0x11d2, {0x9a, 0x0c, 0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d } \\r
+  }\r
+\r
+#define EFI_VT_100_GUID \\r
+  { \\r
+    0xdfa66065, 0xb419, 0x11d3, {0x9a, 0x2d, 0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d } \\r
+  }\r
+\r
+#define EFI_VT_100_PLUS_GUID \\r
+  { \\r
+    0x7baec70b, 0x57e0, 0x4c76, {0x8e, 0x87, 0x2f, 0x9e, 0x28, 0x08, 0x83, 0x43 } \\r
+  }\r
+\r
+#define EFI_VT_UTF8_GUID \\r
+  { \\r
+    0xad15a0d6, 0x8bec, 0x4acf, {0xa0, 0x73, 0xd0, 0x1d, 0xe7, 0x7e, 0x2d, 0x88 } \\r
+  }\r
+\r
+extern EFI_GUID gEfiPcAnsiGuid;\r
+extern EFI_GUID gEfiVT100Guid;\r
+extern EFI_GUID gEfiVT100PlusGuid;\r
+extern EFI_GUID gEfiVTUTF8Guid;\r
+\r
+#endif\r
diff --git a/Tools/Source/TianoTools/Include/Guid/SalSystemTable.h b/Tools/Source/TianoTools/Include/Guid/SalSystemTable.h
new file mode 100644 (file)
index 0000000..30c830f
--- /dev/null
@@ -0,0 +1,38 @@
+/** @file\r
+  GUIDs used for SAL system table entries in the EFI system table.\r
+\r
+  SAL System Table contains Itanium-based processor centric information about\r
+  the system.\r
+\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. This program and the accompanying materials                          \r
+  are licensed and made available under the terms and conditions of the BSD License         \r
+  which accompanies this distribution.  The full text of the license may be found at        \r
+  http://opensource.org/licenses/bsd-license.php                                            \r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+  Module Name:  SalSystemTable.h\r
+\r
+  @par Revision Reference:\r
+  GUIDs defined in UEFI 2.0 spec.\r
+\r
+**/\r
+\r
+#ifndef __SAL_SYSTEM_TABLE_GUID_H__\r
+#define __SAL_SYSTEM_TABLE_GUID_H__\r
+\r
+#define EFI_SAL_SYSTEM_TABLE_GUID \\r
+  { \\r
+    0xeb9d2d32, 0x2d88, 0x11d3, {0x9a, 0x16, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d } \\r
+  }\r
+\r
+//\r
+// GUID name defined in spec.\r
+//\r
+#define SAL_SYSTEM_TABLE_GUID EFI_SAL_SYSTEM_TABLE_GUID\r
+\r
+extern EFI_GUID gEfiSalSystemTableGuid;\r
+\r
+#endif\r
diff --git a/Tools/Source/TianoTools/Include/Guid/SmBios.h b/Tools/Source/TianoTools/Include/Guid/SmBios.h
new file mode 100644 (file)
index 0000000..f02f9fe
--- /dev/null
@@ -0,0 +1,68 @@
+/** @file\r
+  GUIDs used to locate the SMBIOS tables in the EFI 1.0 system table.\r
+\r
+  This GUID in the system table is the only legal way to search for and \r
+  locate the SMBIOS tables. Do not search the 0xF0000 segment to find SMBIOS\r
+  tables.\r
+\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. This program and the accompanying materials                          \r
+  are licensed and made available under the terms and conditions of the BSD License         \r
+  which accompanies this distribution.  The full text of the license may be found at        \r
+  http://opensource.org/licenses/bsd-license.php                                            \r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+  Module Name:  SmBios.h\r
+\r
+  @par Revision Reference:\r
+  GUIDs defined in UEFI 2.0 spec.\r
+\r
+**/\r
+\r
+#ifndef __SMBIOS_GUID_H__\r
+#define __SMBIOS_GUID_H__\r
+\r
+#define EFI_SMBIOS_TABLE_GUID \\r
+  { \\r
+    0xeb9d2d31, 0x2d88, 0x11d3, {0x9a, 0x16, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d } \\r
+  }\r
+\r
+#define SMBIOS_TABLE_GUID EFI_SMBIOS_TABLE_GUID\r
+\r
+//\r
+// Smbios Table Entry Point Structure\r
+//\r
+#pragma pack(1)\r
+typedef struct {\r
+  UINT8   AnchorString[4];\r
+  UINT8   EntryPointStructureChecksum;\r
+  UINT8   EntryPointLength;\r
+  UINT8   MajorVersion;\r
+  UINT8   MinorVersion;\r
+  UINT16  MaxStructureSize;\r
+  UINT8   EntryPointRevision;\r
+  UINT8   FormattedArea[5];\r
+  UINT8   IntermediateAnchorString[5];\r
+  UINT8   IntermediateChecksum;\r
+  UINT16  TableLength;\r
+  UINT32  TableAddress;\r
+  UINT16  NumberOfSmbiosStructures;\r
+  UINT8   SmbiosBcdRevision;\r
+} SMBIOS_TABLE_ENTRY_POINT;\r
+\r
+//\r
+// The Smbios structure header\r
+//\r
+typedef struct {\r
+  UINT8   Type;\r
+  UINT8   Length;\r
+  UINT16  Handle;\r
+} SMBIOS_STRUCTURE;\r
+\r
+#pragma pack()\r
+\r
+extern EFI_GUID       gEfiSmbiosTableGuid;\r
+\r
+#endif\r
diff --git a/Tools/Source/TianoTools/Include/Guid/SmmCommunicate.h b/Tools/Source/TianoTools/Include/Guid/SmmCommunicate.h
new file mode 100644 (file)
index 0000000..2ec200b
--- /dev/null
@@ -0,0 +1,39 @@
+/** @file\r
+  Definitions EFI_SMM_COMMUNICATE_HEADER used by EFI_SMM_BASE_PROTOCOL.Communicate() functions\r
+\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. This program and the accompanying materials                          \r
+  are licensed and made available under the terms and conditions of the BSD License         \r
+  which accompanies this distribution.  The full text of the license may be found at        \r
+  http://opensource.org/licenses/bsd-license.php                                            \r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+  Module Name:  SmmCommunicate.h\r
+\r
+  @par Revision Reference:\r
+  GUIDs defined in SmmCis spec version 0.9\r
+\r
+**/\r
+\r
+#ifndef __SMM_COMMUNICATE_GUID_H__\r
+#define __SMM_COMMUNICATE_GUID_H__\r
+\r
+//******************************************************\r
+// EFI_SMM_COMMUNICATE_HEADER\r
+//******************************************************\r
+#define SMM_COMMUNICATE_HEADER_GUID \\r
+  { \\r
+    0xf328e36c, 0x23b6, 0x4a95, {0x85, 0x4b, 0x32, 0xe1, 0x95, 0x34, 0xcd, 0x75 } \\r
+  }\r
+\r
+typedef struct {\r
+  EFI_GUID                         HeaderGuid;\r
+  UINTN                            MessageLength;\r
+  UINT8                            Data[1];\r
+} EFI_SMM_COMMUNICATE_HEADER;\r
+\r
+extern EFI_GUID gSmmCommunicateHeaderGuid;\r
+\r
+#endif\r
diff --git a/Tools/Source/TianoTools/Include/Guid/SmramMemoryReserve.h b/Tools/Source/TianoTools/Include/Guid/SmramMemoryReserve.h
new file mode 100644 (file)
index 0000000..fc49092
--- /dev/null
@@ -0,0 +1,67 @@
+/** @file\r
+  GUID for use in reserving SMRAM regions.\r
+\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. This program and the accompanying materials                          \r
+  are licensed and made available under the terms and conditions of the BSD License         \r
+  which accompanies this distribution.  The full text of the license may be found at        \r
+  http://opensource.org/licenses/bsd-license.php                                            \r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.    \r
+\r
+  Module Name:  SmramMemoryReserve.h\r
+\r
+  @par Revision Reference:\r
+  GUIDs defined in SmmCis spec version 0.9\r
+\r
+**/\r
+\r
+#ifndef _EFI_SMM_PEI_SMRAM_MEMORY_RESERVE_H_\r
+#define _EFI_SMM_PEI_SMRAM_MEMORY_RESERVE_H_\r
+\r
+#define EFI_SMM_PEI_SMRAM_MEMORY_RESERVE \\r
+  { \\r
+    0x6dadf1d1, 0xd4cc, 0x4910, {0xbb, 0x6e, 0x82, 0xb1, 0xfd, 0x80, 0xff, 0x3d } \\r
+  }\r
+\r
+//\r
+// *******************************************************\r
+//  EFI_SMRAM_DESCRIPTOR\r
+// *******************************************************\r
+//\r
+typedef struct {\r
+  EFI_PHYSICAL_ADDRESS  PhysicalStart;  // Phsyical location in DRAM\r
+  EFI_PHYSICAL_ADDRESS  CpuStart;       // Address CPU uses to access the SMI handler\r
+  // May or may not match PhysicalStart\r
+  //\r
+  UINT64                PhysicalSize;\r
+  UINT64                RegionState;\r
+} EFI_SMRAM_DESCRIPTOR;\r
+\r
+//\r
+// *******************************************************\r
+//  EFI_SMRAM_STATE\r
+// *******************************************************\r
+//\r
+#define EFI_SMRAM_OPEN                0x00000001\r
+#define EFI_SMRAM_CLOSED              0x00000002\r
+#define EFI_SMRAM_LOCKED              0x00000004\r
+#define EFI_CACHEABLE                 0x00000008\r
+#define EFI_ALLOCATED                 0x00000010\r
+#define EFI_NEEDS_TESTING             0x00000020\r
+#define EFI_NEEDS_ECC_INITIALIZATION  0x00000040\r
+\r
+//\r
+// *******************************************************\r
+//  EFI_SMRAM_HOB_DESCRIPTOR_BLOCK\r
+// *******************************************************\r
+//\r
+typedef struct {\r
+  UINTN                 NumberOfSmmReservedRegions;\r
+  EFI_SMRAM_DESCRIPTOR  Descriptor[1];\r
+} EFI_SMRAM_HOB_DESCRIPTOR_BLOCK;\r
+\r
+extern EFI_GUID gEfiSmmPeiSmramMemoryReserve;\r
+\r
+#endif\r
diff --git a/Tools/Source/TianoTools/Include/Guid/StatusCodeDataTypeId.h b/Tools/Source/TianoTools/Include/Guid/StatusCodeDataTypeId.h
new file mode 100644 (file)
index 0000000..f747af0
--- /dev/null
@@ -0,0 +1,82 @@
+/** @file\r
+  GUID used to identify id for the caller who is initiating the Status Code.\r
+\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. This program and the accompanying materials                          \r
+  are licensed and made available under the terms and conditions of the BSD License         \r
+  which accompanies this distribution.  The full text of the license may be found at        \r
+  http://opensource.org/licenses/bsd-license.php                                            \r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+  Module Name:  StatusCodeDataTypeId.h\r
+\r
+  @par Revision Reference:\r
+  GUIDs defined in Status Codes Specification 0.92\r
+\r
+**/\r
+\r
+#ifndef __STATUS_CODE_DATA_TYPE_ID_GUID_H__\r
+#define __STATUS_CODE_DATA_TYPE_ID_GUID_H__\r
+\r
+//\r
+// String Data Type defintion. This is part of Status Code Specification\r
+//\r
+#define EFI_STATUS_CODE_DATA_TYPE_STRING_GUID \\r
+  { 0x92D11080, 0x496F, 0x4D95, { 0xBE, 0x7E, 0x03, 0x74, 0x88, 0x38, 0x2B, 0x0A } }\r
+\r
+extern EFI_GUID gEfiStatusCodeDataTypeStringGuid;\r
+\r
+//\r
+// This GUID indicates that the format of the accompanying data depends\r
+// upon the Status Code Value, but follows this Specification\r
+//\r
+#define EFI_STATUS_CODE_SPECIFIC_DATA_GUID \\r
+  { 0x335984bd, 0xe805, 0x409a, { 0xb8, 0xf8, 0xd2, 0x7e, 0xce, 0x5f, 0xf7, 0xa6 } }\r
+\r
+extern EFI_GUID gEfiStatusCodeSpecificDataGuid;\r
+\r
+//\r
+// Debug Assert Data. This is part of Status Code Specification\r
+//\r
+#define EFI_STATUS_CODE_DATA_TYPE_ASSERT_GUID \\r
+ { 0xDA571595, 0x4D99, 0x487C, { 0x82, 0x7C, 0x26, 0x22, 0x67, 0x7D, 0x33, 0x07 } }\r
+\r
+\r
+extern EFI_GUID gEfiStatusCodeDataTypeAssertGuid;\r
+\r
+//\r
+// Exception Data type (CPU REGS)\r
+//\r
+#define EFI_STATUS_CODE_DATA_TYPE_EXCEPTION_HANDLER_GUID \\r
+  { 0x3BC2BD12, 0xAD2E, 0x11D5, { 0x87, 0xDD, 0x00, 0x06, 0x29, 0x45, 0xC3, 0xB9 } }\r
+\r
+extern EFI_GUID gEfiStatusCodeDataTypeExceptionHandlerGuid;\r
+\r
+//\r
+// Debug DataType defintions. User Defined Data Types.\r
+//\r
+#define EFI_STATUS_CODE_DATA_TYPE_DEBUG_GUID \\r
+  { 0x9A4E9246, 0xD553, 0x11D5, { 0x87, 0xE2, 0x00, 0x06, 0x29, 0x45, 0xC3, 0xb9 } }\r
+\r
+extern EFI_GUID gEfiStatusCodeDataTypeDebugGuid;\r
+\r
+//\r
+// Progress Code. User Defined Data Type Guid.\r
+//\r
+#define EFI_STATUS_CODE_DATA_TYPE_ERROR_GUID \\r
+  0xAB359CE3, 0x99B3, 0xAE18, { 0xC8, 0x9D, 0x95, 0xD3, 0xB0, 0x72, 0xE1, 0x9B } }\r
+\r
+extern EFI_GUID gEfiStatusCodeDataTypeErrorGuid;\r
+\r
+\r
+//\r
+// Progress Code. User Defined Data Type Guid.\r
+//\r
+#define EFI_STATUS_CODE_DATA_TYPE_PROGRESS_CODE_GUID \\r
+  { 0xA356AB39, 0x35C4, 0x35DA, { 0xB3, 0x7A, 0xF8, 0xEA, 0x9E, 0x8B, 0x36, 0xA3 } }\r
+\r
+extern EFI_GUID gEfiStatusCodeDataTypeProgressCodeGuid;\r
+\r
+#endif\r
diff --git a/Tools/Source/TianoTools/Include/Ia32/ProcessorBind.h b/Tools/Source/TianoTools/Include/Ia32/ProcessorBind.h
new file mode 100644 (file)
index 0000000..587d8a6
--- /dev/null
@@ -0,0 +1,167 @@
+/** @file\r
+  Processor or Compiler specific defines and types for x64.\r
+\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. This program and the accompanying materials                          \r
+  are licensed and made available under the terms and conditions of the BSD License         \r
+  which accompanies this distribution.  The full text of the license may be found at        \r
+  http://opensource.org/licenses/bsd-license.php                                            \r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+  Module Name:  ProcessorBind.h\r
+\r
+**/\r
+\r
+#ifndef __PROCESSOR_BIND_H__\r
+#define __PROCESSOR_BIND_H__\r
+\r
+//\r
+// Define the processor type so other code can make processor based choices\r
+//\r
+#define MDE_CPU_IA32\r
+\r
+//\r
+// Make sure we are useing the correct packing rules per EFI specification\r
+//\r
+#ifndef __GNUC__\r
+#pragma pack()\r
+#endif\r
+\r
+#if _MSC_EXTENSIONS\r
+\r
+//\r
+// Disable warning that make it impossible to compile at /W4\r
+// This only works for Microsoft* tools\r
+//\r
+\r
+//\r
+// Disabling bitfield type checking warnings.\r
+//\r
+#pragma warning ( disable : 4214 )\r
+\r
+//\r
+// Disabling the unreferenced formal parameter warnings.\r
+//\r
+#pragma warning ( disable : 4100 )\r
+\r
+//\r
+// Disable slightly different base types warning as CHAR8 * can not be set\r
+// to a constant string.\r
+//\r
+#pragma warning ( disable : 4057 )\r
+\r
+//\r
+// ASSERT(FALSE) or while (TRUE) are legal constructes so supress this warning\r
+//\r
+#pragma warning ( disable : 4127 )\r
+\r
+\r
+#endif\r
+\r
+\r
+#if !defined(__GNUC__) && (__STDC_VERSION__ < 199901L)\r
+  //\r
+  // No ANSI C 2000 stdint.h integer width declarations, so define equivalents\r
+  //\r
\r
+  #if _MSC_EXTENSIONS \r
+    \r
+    //\r
+    // use Microsoft* C complier dependent interger width types \r
+    //\r
+    typedef unsigned __int64    UINT64;\r
+    typedef __int64             INT64;\r
+    typedef unsigned __int32    UINT32;\r
+    typedef __int32             INT32;\r
+    typedef unsigned short      UINT16;\r
+    typedef unsigned short      CHAR16;\r
+    typedef short               INT16;\r
+    typedef unsigned char       BOOLEAN;\r
+    typedef unsigned char       UINT8;\r
+    typedef char                CHAR8;\r
+    typedef char                INT8;\r
+  #else\r
+\r
+    //\r
+    // Assume standard IA-32 alignment. \r
+    // BugBug: Need to check portability of long long\r
+    //\r
+    typedef unsigned long long  UINT64;\r
+    typedef long long           INT64;\r
+    typedef unsigned int        UINT32;\r
+    typedef int                 INT32;\r
+    typedef unsigned short      UINT16;\r
+    typedef unsigned short      CHAR16;\r
+    typedef short               INT16;\r
+    typedef unsigned char       BOOLEAN;\r
+    typedef unsigned char       UINT8;\r
+    typedef char                CHAR8;\r
+    typedef char                INT8;\r
+  #endif\r
+\r
+  #define UINT8_MAX 0xff\r
+\r
+#else\r
+  //\r
+  // Use ANSI C 2000 stdint.h integer width declarations\r
+  //\r
+  #include "stdint.h"\r
+  typedef uint8_t   BOOLEAN;\r
+  typedef int8_t    INT8;\r
+  typedef uint8_t   UINT8;\r
+  typedef int16_t   INT16;\r
+  typedef uint16_t  UINT16;\r
+  typedef int32_t   INT32;\r
+  typedef uint32_t  UINT32;\r
+  typedef int64_t   INT64;\r
+  typedef uint64_t  UINT64;\r
+  typedef char      CHAR8;\r
+  typedef uint16_t  CHAR16;\r
+\r
+#endif\r
+\r
+typedef UINT32  UINTN;\r
+typedef INT32   INTN;\r
+\r
+\r
+//\r
+// Processor specific defines\r
+//\r
+#define MAX_BIT     0x80000000\r
+#define MAX_2_BITS  0xC0000000\r
+\r
+//\r
+// Maximum legal IA-32 address\r
+//\r
+#define MAX_ADDRESS   0xFFFFFFFF\r
+\r
+//\r
+// Modifier to ensure that all protocol member functions and EFI intrinsics\r
+// use the correct C calling convention. All protocol member functions and\r
+// EFI intrinsics are required to modify thier member functions with EFIAPI.\r
+//\r
+#if _MSC_EXTENSIONS\r
+  //\r
+  // Microsoft* compiler requires _EFIAPI useage, __cdecl is Microsoft* specific C.\r
+  // \r
+  #define EFIAPI __cdecl  \r
+#endif\r
+\r
+#if __GNUC__\r
+  #define EFIAPI __attribute__((cdecl))    \r
+#endif\r
+\r
+//\r
+// The Microsoft* C compiler can removed references to unreferenced data items\r
+//  if the /OPT:REF linker option is used. We defined a macro as this is a \r
+//  a non standard extension\r
+//\r
+#if _MSC_EXTENSIONS\r
+  #define GLOBAL_REMOVE_IF_UNREFERENCED __declspec(selectany)\r
+#else\r
+  #define GLOBAL_REMOVE_IF_UNREFERENCED\r
+#endif\r
+\r
+#endif\r
diff --git a/Tools/Source/TianoTools/Include/IndustryStandard/Usb.h b/Tools/Source/TianoTools/Include/IndustryStandard/Usb.h
new file mode 100644 (file)
index 0000000..dca7351
--- /dev/null
@@ -0,0 +1,282 @@
+/** @file\r
+  Support for USB 1.1 standard.\r
+\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. This program and the accompanying materials                          \r
+  are licensed and made available under the terms and conditions of the BSD License         \r
+  which accompanies this distribution.  The full text of the license may be found at        \r
+  http://opensource.org/licenses/bsd-license.php                                            \r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+  Module Name:  Usb.h\r
+\r
+**/\r
+\r
+#ifndef __USB_H__\r
+#define __USB_H__\r
+\r
+//\r
+// USB Descriptor types\r
+//\r
+#define USB_DT_DEVICE     0x01\r
+#define USB_DT_CONFIG     0x02\r
+#define USB_DT_STRING     0x03\r
+#define USB_DT_INTERFACE  0x04\r
+#define USB_DT_ENDPOINT   0x05\r
+#define USB_DT_HUB        0x29\r
+#define USB_DT_HID        0x21\r
+\r
+//\r
+// USB request type\r
+//\r
+#define USB_TYPE_STANDARD (0x00 << 5)\r
+#define USB_TYPE_CLASS    (0x01 << 5)\r
+#define USB_TYPE_VENDOR   (0x02 << 5)\r
+#define USB_TYPE_RESERVED (0x03 << 5)\r
+\r
+//\r
+// USB request targer device\r
+//\r
+#define USB_RECIP_DEVICE    0x00\r
+#define USB_RECIP_INTERFACE 0x01\r
+#define USB_RECIP_ENDPOINT  0x02\r
+#define USB_RECIP_OTHER     0x03\r
+\r
+//\r
+// Request target types.\r
+//\r
+#define USB_RT_DEVICE     0x00\r
+#define USB_RT_INTERFACE  0x01\r
+#define USB_RT_ENDPOINT   0x02\r
+#define USB_RT_HUB        (USB_TYPE_CLASS | USB_RECIP_DEVICE)\r
+#define USB_RT_PORT       (USB_TYPE_CLASS | USB_RECIP_OTHER)\r
+\r
+//\r
+// USB Transfer Results\r
+//\r
+#define EFI_USB_NOERROR         0x00\r
+#define EFI_USB_ERR_NOTEXECUTE  0x01\r
+#define EFI_USB_ERR_STALL       0x02\r
+#define EFI_USB_ERR_BUFFER      0x04\r
+#define EFI_USB_ERR_BABBLE      0x08\r
+#define EFI_USB_ERR_NAK         0x10\r
+#define EFI_USB_ERR_CRC         0x20\r
+#define EFI_USB_ERR_TIMEOUT     0x40\r
+#define EFI_USB_ERR_BITSTUFF    0x80\r
+#define EFI_USB_ERR_SYSTEM      0x100\r
+\r
+//\r
+//Use 200 ms to increase the error handling response time\r
+//\r
+#define EFI_USB_INTERRUPT_DELAY 2000000\r
+\r
+//\r
+// USB transation direction\r
+//\r
+typedef enum {\r
+  EfiUsbDataOut,\r
+  EfiUsbDataIn,\r
+  EfiUsbNoData\r
+} EFI_USB_DATA_DIRECTION;\r
+\r
+//\r
+// Usb Data recipient type\r
+//\r
+typedef enum {\r
+  EfiUsbDevice,\r
+  EfiUsbInterface,\r
+  EfiUsbEndpoint\r
+} EFI_USB_RECIPIENT;\r
+\r
+typedef enum {\r
+  EfiUsbEndpointHalt,\r
+  EfiUsbDeviceRemoteWakeup\r
+} EFI_USB_STANDARD_FEATURE_SELECTOR;\r
+\r
+#pragma pack(1)\r
+//\r
+// Usb device request structure\r
+//\r
+typedef struct {\r
+  UINT8   RequestType;\r
+  UINT8   Request;\r
+  UINT16  Value;\r
+  UINT16  Index;\r
+  UINT16  Length;\r
+} EFI_USB_DEVICE_REQUEST;\r
+\r
+//\r
+// Standard USB request\r
+//\r
+#define USB_DEV_GET_STATUS                  0x00\r
+\r
+#define USB_DEV_CLEAR_FEATURE               0x01\r
+\r
+#define USB_DEV_SET_FEATURE                 0x03\r
+\r
+#define USB_DEV_SET_ADDRESS                 0x05\r
+#define USB_DEV_SET_ADDRESS_REQ_TYPE        0x00\r
+\r
+#define USB_DEV_GET_DESCRIPTOR              0x06\r
+#define USB_DEV_GET_DESCRIPTOR_REQ_TYPE     0x80\r
+\r
+#define USB_DEV_SET_DESCRIPTOR              0x07\r
+#define USB_DEV_SET_DESCRIPTOR_REQ_TYPE     0x00\r
+\r
+#define USB_DEV_GET_CONFIGURATION           0x08\r
+#define USB_DEV_GET_CONFIGURATION_REQ_TYPE  0x80\r
+\r
+#define USB_DEV_SET_CONFIGURATION           0x09\r
+#define USB_DEV_SET_CONFIGURATION_REQ_TYPE  0x00\r
+\r
+#define USB_DEV_GET_INTERFACE               0x0A\r
+#define USB_DEV_GET_INTERFACE_REQ_TYPE      0x81\r
+\r
+#define USB_DEV_SET_INTERFACE               0x0B\r
+#define USB_DEV_SET_INTERFACE_REQ_TYPE      0x01\r
+\r
+#define USB_DEV_SYNCH_FRAME                 0x0C\r
+#define USB_DEV_SYNCH_FRAME_REQ_TYPE        0x82\r
+\r
+//\r
+// Device descriptor. refer USB1.1\r
+//\r
+typedef struct usb_device_descriptor {\r
+  UINT8   Length;\r
+  UINT8   DescriptorType;\r
+  UINT16  BcdUSB;\r
+  UINT8   DeviceClass;\r
+  UINT8   DeviceSubClass;\r
+  UINT8   DeviceProtocol;\r
+  UINT8   MaxPacketSize0;\r
+  UINT16  IdVendor;\r
+  UINT16  IdProduct;\r
+  UINT16  BcdDevice;\r
+  UINT8   StrManufacturer;\r
+  UINT8   StrProduct;\r
+  UINT8   StrSerialNumber;\r
+  UINT8   NumConfigurations;\r
+} EFI_USB_DEVICE_DESCRIPTOR;\r
+\r
+//\r
+// Endpoint descriptor\r
+//\r
+typedef struct {\r
+  UINT8   Length;\r
+  UINT8   DescriptorType;\r
+  UINT8   EndpointAddress;\r
+  UINT8   Attributes;\r
+  UINT16  MaxPacketSize;\r
+  UINT8   Interval;\r
+} EFI_USB_ENDPOINT_DESCRIPTOR;\r
+\r
+//\r
+// Interface descriptor\r
+//\r
+typedef struct {\r
+  UINT8 Length;\r
+  UINT8 DescriptorType;\r
+  UINT8 InterfaceNumber;\r
+  UINT8 AlternateSetting;\r
+  UINT8 NumEndpoints;\r
+  UINT8 InterfaceClass;\r
+  UINT8 InterfaceSubClass;\r
+  UINT8 InterfaceProtocol;\r
+  UINT8 Interface;\r
+} EFI_USB_INTERFACE_DESCRIPTOR;\r
+\r
+//\r
+// USB alternate setting\r
+//\r
+typedef struct {\r
+  EFI_USB_INTERFACE_DESCRIPTOR  *Interface;\r
+} USB_ALT_SETTING;\r
+\r
+//\r
+// Configuration descriptor\r
+//\r
+typedef struct {\r
+  UINT8   Length;\r
+  UINT8   DescriptorType;\r
+  UINT16  TotalLength;\r
+  UINT8   NumInterfaces;\r
+  UINT8   ConfigurationValue;\r
+  UINT8   Configuration;\r
+  UINT8   Attributes;\r
+  UINT8   MaxPower;\r
+} EFI_USB_CONFIG_DESCRIPTOR;\r
+\r
+//\r
+// Supported String Languages\r
+//\r
+typedef struct {\r
+  UINT8   Length;\r
+  UINT8   DescriptorType;\r
+  UINT16  SupportedLanID[1];\r
+} EFI_USB_SUPPORTED_LANGUAGES;\r
+\r
+//\r
+// String descriptor\r
+//\r
+typedef struct {\r
+  UINT8   Length;\r
+  UINT8   DescriptorType;\r
+  CHAR16  String[1];\r
+} EFI_USB_STRING_DESCRIPTOR;\r
+\r
+//\r
+// Hub descriptor\r
+//\r
+#define MAXBYTES  8\r
+typedef struct {\r
+  UINT8 Length;\r
+  UINT8 DescriptorType;\r
+  UINT8 NbrPorts;\r
+  UINT8 HubCharacteristics[2];\r
+  UINT8 PwrOn2PwrGood;\r
+  UINT8 HubContrCurrent;\r
+  UINT8 Filler[MAXBYTES];\r
+} EFI_USB_HUB_DESCRIPTOR;\r
+\r
+typedef struct {\r
+  UINT16  PortStatus;\r
+  UINT16  PortChangeStatus;\r
+} EFI_USB_PORT_STATUS;\r
+\r
+//\r
+// Constant value for Port Status & Port Change Status\r
+//\r
+#define USB_PORT_STAT_CONNECTION    0x0001\r
+#define USB_PORT_STAT_ENABLE        0x0002\r
+#define USB_PORT_STAT_SUSPEND       0x0004\r
+#define USB_PORT_STAT_OVERCURRENT   0x0008\r
+#define USB_PORT_STAT_RESET         0x0010\r
+#define USB_PORT_STAT_POWER         0x0100\r
+#define USB_PORT_STAT_LOW_SPEED     0x0200\r
+\r
+#define USB_PORT_STAT_C_CONNECTION  0x0001\r
+#define USB_PORT_STAT_C_ENABLE      0x0002\r
+#define USB_PORT_STAT_C_SUSPEND     0x0004\r
+#define USB_PORT_STAT_C_OVERCURRENT 0x0008\r
+#define USB_PORT_STAT_C_RESET       0x0010\r
+\r
+//\r
+// Used for set/clear port feature request\r
+//\r
+typedef enum {\r
+  EfiUsbPortEnable            = 1,\r
+  EfiUsbPortSuspend           = 2,\r
+  EfiUsbPortReset             = 4,\r
+  EfiUsbPortPower             = 8,\r
+  EfiUsbPortConnectChange     = 16,\r
+  EfiUsbPortEnableChange      = 17,\r
+  EfiUsbPortSuspendChange     = 18,\r
+  EfiUsbPortOverCurrentChange = 19,\r
+  EfiUsbPortResetChange       = 20\r
+} EFI_USB_PORT_FEATURE;\r
+\r
+#pragma pack()\r
+\r
+#endif\r
diff --git a/Tools/Source/TianoTools/Include/IndustryStandard/pci22.h b/Tools/Source/TianoTools/Include/IndustryStandard/pci22.h
new file mode 100644 (file)
index 0000000..7fee279
--- /dev/null
@@ -0,0 +1,481 @@
+/** @file\r
+  Support for PCI 2.2 standard.\r
+\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. This program and the accompanying materials                          \r
+  are licensed and made available under the terms and conditions of the BSD License         \r
+  which accompanies this distribution.  The full text of the license may be found at        \r
+  http://opensource.org/licenses/bsd-license.php                                            \r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+  Module Name:  pci22.h\r
+\r
+**/\r
+\r
+#ifndef _PCI22_H\r
+#define _PCI22_H\r
+\r
+#define PCI_MAX_SEGMENT 0\r
+\r
+#define PCI_MAX_BUS     255\r
+\r
+#define PCI_MAX_DEVICE  31\r
+#define PCI_MAX_FUNC    7\r
+\r
+//\r
+// Command\r
+//\r
+#define PCI_VGA_PALETTE_SNOOP_DISABLED  0x20\r
+\r
+#pragma pack(push, 1)\r
+typedef struct {\r
+  UINT16  VendorId;\r
+  UINT16  DeviceId;\r
+  UINT16  Command;\r
+  UINT16  Status;\r
+  UINT8   RevisionID;\r
+  UINT8   ClassCode[3];\r
+  UINT8   CacheLineSize;\r
+  UINT8   LatencyTimer;\r
+  UINT8   HeaderType;\r
+  UINT8   BIST;\r
+} PCI_DEVICE_INDEPENDENT_REGION;\r
+\r
+typedef struct {\r
+  UINT32  Bar[6];\r
+  UINT32  CISPtr;\r
+  UINT16  SubsystemVendorID;\r
+  UINT16  SubsystemID;\r
+  UINT32  ExpansionRomBar;\r
+  UINT8   CapabilityPtr;\r
+  UINT8   Reserved1[3];\r
+  UINT32  Reserved2;\r
+  UINT8   InterruptLine;\r
+  UINT8   InterruptPin;\r
+  UINT8   MinGnt;\r
+  UINT8   MaxLat;\r
+} PCI_DEVICE_HEADER_TYPE_REGION;\r
+\r
+typedef struct {\r
+  PCI_DEVICE_INDEPENDENT_REGION Hdr;\r
+  PCI_DEVICE_HEADER_TYPE_REGION Device;\r
+} PCI_TYPE00;\r
+\r
+typedef struct {\r
+  UINT32  Bar[2];\r
+  UINT8   PrimaryBus;\r
+  UINT8   SecondaryBus;\r
+  UINT8   SubordinateBus;\r
+  UINT8   SecondaryLatencyTimer;\r
+  UINT8   IoBase;\r
+  UINT8   IoLimit;\r
+  UINT16  SecondaryStatus;\r
+  UINT16  MemoryBase;\r
+  UINT16  MemoryLimit;\r
+  UINT16  PrefetchableMemoryBase;\r
+  UINT16  PrefetchableMemoryLimit;\r
+  UINT32  PrefetchableBaseUpper32;\r
+  UINT32  PrefetchableLimitUpper32;\r
+  UINT16  IoBaseUpper16;\r
+  UINT16  IoLimitUpper16;\r
+  UINT8   CapabilityPtr;\r
+  UINT8   Reserved[3];\r
+  UINT32  ExpansionRomBAR;\r
+  UINT8   InterruptLine;\r
+  UINT8   InterruptPin;\r
+  UINT16  BridgeControl;\r
+} PCI_BRIDGE_CONTROL_REGISTER;\r
+\r
+typedef struct {\r
+  PCI_DEVICE_INDEPENDENT_REGION Hdr;\r
+  PCI_BRIDGE_CONTROL_REGISTER   Bridge;\r
+} PCI_TYPE01;\r
+\r
+typedef union {\r
+  PCI_TYPE00  Device;\r
+  PCI_TYPE01  Bridge;\r
+} PCI_TYPE_GENERIC;\r
+\r
+typedef struct {\r
+  UINT32  CardBusSocketReg; // Cardus Socket/ExCA Base\r
+  // Address Register\r
+  //\r
+  UINT16  Reserved;\r
+  UINT16  SecondaryStatus;      // Secondary Status\r
+  UINT8   PciBusNumber;         // PCI Bus Number\r
+  UINT8   CardBusBusNumber;     // CardBus Bus Number\r
+  UINT8   SubordinateBusNumber; // Subordinate Bus Number\r
+  UINT8   CardBusLatencyTimer;  // CardBus Latency Timer\r
+  UINT32  MemoryBase0;          // Memory Base Register 0\r
+  UINT32  MemoryLimit0;         // Memory Limit Register 0\r
+  UINT32  MemoryBase1;\r
+  UINT32  MemoryLimit1;\r
+  UINT32  IoBase0;\r
+  UINT32  IoLimit0;             // I/O Base Register 0\r
+  UINT32  IoBase1;              // I/O Limit Register 0\r
+  UINT32  IoLimit1;\r
+  UINT8   InterruptLine;        // Interrupt Line\r
+  UINT8   InterruptPin;         // Interrupt Pin\r
+  UINT16  BridgeControl;        // Bridge Control\r
+} PCI_CARDBUS_CONTROL_REGISTER;\r
+\r
+//\r
+// Definitions of PCI class bytes and manipulation macros.\r
+//\r
+#define PCI_CLASS_OLD                 0x00\r
+#define PCI_CLASS_OLD_OTHER           0x00\r
+#define PCI_CLASS_OLD_VGA             0x01\r
+\r
+#define PCI_CLASS_MASS_STORAGE        0x01\r
+#define PCI_CLASS_MASS_STORAGE_SCSI   0x00\r
+#define PCI_CLASS_MASS_STORAGE_IDE    0x01  // obsolete\r
+#define PCI_CLASS_IDE                 0x01\r
+#define PCI_CLASS_MASS_STORAGE_FLOPPY 0x02\r
+#define PCI_CLASS_MASS_STORAGE_IPI    0x03\r
+#define PCI_CLASS_MASS_STORAGE_RAID   0x04\r
+#define PCI_CLASS_MASS_STORAGE_OTHER  0x80\r
+\r
+#define PCI_CLASS_NETWORK             0x02\r
+#define PCI_CLASS_NETWORK_ETHERNET    0x00\r
+#define PCI_CLASS_ETHERNET            0x00  // obsolete\r
+#define PCI_CLASS_NETWORK_TOKENRING   0x01\r
+#define PCI_CLASS_NETWORK_FDDI        0x02\r
+#define PCI_CLASS_NETWORK_ATM         0x03\r
+#define PCI_CLASS_NETWORK_ISDN        0x04\r
+#define PCI_CLASS_NETWORK_OTHER       0x80\r
+\r
+#define PCI_CLASS_DISPLAY             0x03\r
+#define PCI_CLASS_DISPLAY_CTRL        0x03  // obsolete\r
+#define PCI_CLASS_DISPLAY_VGA         0x00\r
+#define PCI_CLASS_VGA                 0x00  // obsolete\r
+#define PCI_CLASS_DISPLAY_XGA         0x01\r
+#define PCI_CLASS_DISPLAY_3D          0x02\r
+#define PCI_CLASS_DISPLAY_OTHER       0x80\r
+#define PCI_CLASS_DISPLAY_GFX         0x80\r
+#define PCI_CLASS_GFX                 0x80  // obsolete\r
+#define PCI_CLASS_BRIDGE              0x06\r
+#define PCI_CLASS_BRIDGE_HOST         0x00\r
+#define PCI_CLASS_BRIDGE_ISA          0x01\r
+#define PCI_CLASS_ISA                 0x01  // obsolete\r
+#define PCI_CLASS_BRIDGE_EISA         0x02\r
+#define PCI_CLASS_BRIDGE_MCA          0x03\r
+#define PCI_CLASS_BRIDGE_P2P          0x04\r
+#define PCI_CLASS_BRIDGE_PCMCIA       0x05\r
+#define PCI_CLASS_BRIDGE_NUBUS        0x06\r
+#define PCI_CLASS_BRIDGE_CARDBUS      0x07\r
+#define PCI_CLASS_BRIDGE_RACEWAY      0x08\r
+#define PCI_CLASS_BRIDGE_ISA_PDECODE  0x80\r
+#define PCI_CLASS_ISA_POSITIVE_DECODE 0x80  // obsolete\r
+#define PCI_CLASS_SERIAL              0x0C\r
+#define PCI_CLASS_SERIAL_FIREWIRE     0x00\r
+#define PCI_CLASS_SERIAL_ACCESS_BUS   0x01\r
+#define PCI_CLASS_SERIAL_SSA          0x02\r
+#define PCI_CLASS_SERIAL_USB          0x03\r
+#define PCI_CLASS_SERIAL_FIBRECHANNEL 0x04\r
+#define PCI_CLASS_SERIAL_SMB          0x05\r
+\r
+#define IS_CLASS1(_p, c)              ((_p)->Hdr.ClassCode[2] == (c))\r
+#define IS_CLASS2(_p, c, s)           (IS_CLASS1 (_p, c) && ((_p)->Hdr.ClassCode[1] == (s)))\r
+#define IS_CLASS3(_p, c, s, p)        (IS_CLASS2 (_p, c, s) && ((_p)->Hdr.ClassCode[0] == (p)))\r
+\r
+#define IS_PCI_DISPLAY(_p)            IS_CLASS1 (_p, PCI_CLASS_DISPLAY)\r
+#define IS_PCI_VGA(_p)                IS_CLASS3 (_p, PCI_CLASS_DISPLAY, PCI_CLASS_DISPLAY_VGA, 0)\r
+#define IS_PCI_8514(_p)               IS_CLASS3 (_p, PCI_CLASS_DISPLAY, PCI_CLASS_DISPLAY_VGA, 1)\r
+#define IS_PCI_GFX(_p)                IS_CLASS3 (_p, PCI_CLASS_DISPLAY, PCI_CLASS_DISPLAY_GFX, 0)\r
+#define IS_PCI_OLD(_p)                IS_CLASS1 (_p, PCI_CLASS_OLD)\r
+#define IS_PCI_OLD_VGA(_p)            IS_CLASS2 (_p, PCI_CLASS_OLD, PCI_CLASS_OLD_VGA)\r
+#define IS_PCI_IDE(_p)                IS_CLASS2 (_p, PCI_CLASS_MASS_STORAGE, PCI_CLASS_MASS_STORAGE_IDE)\r
+#define IS_PCI_SCSI(_p)               IS_CLASS3 (_p, PCI_CLASS_MASS_STORAGE, PCI_CLASS_MASS_STORAGE_SCSI, 0)\r
+#define IS_PCI_RAID(_p)               IS_CLASS3 (_p, PCI_CLASS_MASS_STORAGE, PCI_CLASS_MASS_STORAGE_RAID, 0)\r
+#define IS_PCI_LPC(_p)                IS_CLASS3 (_p, PCI_CLASS_BRIDGE, PCI_CLASS_BRIDGE_ISA, 0)\r
+#define IS_PCI_P2P(_p)                IS_CLASS3 (_p, PCI_CLASS_BRIDGE, PCI_CLASS_BRIDGE_P2P, 0)\r
+#define IS_PCI_P2P_SUB(_p)            IS_CLASS3 (_p, PCI_CLASS_BRIDGE, PCI_CLASS_BRIDGE_P2P, 1)\r
+#define IS_PCI_USB(_p)                IS_CLASS2 (_p, PCI_CLASS_SERIAL, PCI_CLASS_SERIAL_USB)\r
+\r
+#define HEADER_TYPE_DEVICE            0x00\r
+#define HEADER_TYPE_PCI_TO_PCI_BRIDGE 0x01\r
+#define HEADER_TYPE_CARDBUS_BRIDGE    0x02\r
+\r
+#define HEADER_TYPE_MULTI_FUNCTION    0x80\r
+#define HEADER_LAYOUT_CODE            0x7f\r
+\r
+#define IS_PCI_BRIDGE(_p)             (((_p)->Hdr.HeaderType & HEADER_LAYOUT_CODE) == (HEADER_TYPE_PCI_TO_PCI_BRIDGE))\r
+#define IS_CARDBUS_BRIDGE(_p)         (((_p)->Hdr.HeaderType & HEADER_LAYOUT_CODE) == (HEADER_TYPE_CARDBUS_BRIDGE))\r
+#define IS_PCI_MULTI_FUNC(_p)         ((_p)->Hdr.HeaderType & HEADER_TYPE_MULTI_FUNCTION)\r
+\r
+#define PCI_DEVICE_ROMBAR             0x30\r
+#define PCI_BRIDGE_ROMBAR             0x38\r
+\r
+#define PCI_MAX_BAR                   6\r
+#define PCI_MAX_CONFIG_OFFSET         0x100\r
+//\r
+// bugbug: this is supported in PCI spec v2.3\r
+//\r
+#define PCI_EXP_MAX_CONFIG_OFFSET                   0x1000\r
+\r
+#define PCI_VENDOR_ID_OFFSET                        0x00\r
+#define PCI_DEVICE_ID_OFFSET                        0x02\r
+#define PCI_COMMAND_OFFSET                          0x04\r
+#define PCI_PRIMARY_STATUS_OFFSET                   0x06\r
+#define PCI_REVISION_ID_OFFSET                      0x08\r
+#define PCI_CLASSCODE_OFFSET                        0x09\r
+#define PCI_CACHELINE_SIZE_OFFSET                   0x0C\r
+#define PCI_LATENCY_TIMER_OFFSET                    0x0D\r
+#define PCI_HEADER_TYPE_OFFSET                      0x0E\r
+#define PCI_BIST_OFFSET                             0x0F\r
+\r
+#define PCI_BRIDGE_CONTROL_REGISTER_OFFSET          0x3E\r
+#define PCI_BRIDGE_STATUS_REGISTER_OFFSET           0x1E\r
+\r
+#define PCI_BRIDGE_PRIMARY_BUS_REGISTER_OFFSET      0x18\r
+#define PCI_BRIDGE_SECONDARY_BUS_REGISTER_OFFSET    0x19\r
+#define PCI_BRIDGE_SUBORDINATE_BUS_REGISTER_OFFSET  0x1a\r
+\r
+typedef struct {\r
+  UINT8 Register;\r
+  UINT8 Function;\r
+  UINT8 Device;\r
+  UINT8 Bus;\r
+  UINT8 Reserved[4];\r
+} DEFIO_PCI_ADDR;\r
+\r
+typedef union {\r
+  struct {\r
+    UINT32  Reg : 8;\r
+    UINT32  Func : 3;\r
+    UINT32  Dev : 5;\r
+    UINT32  Bus : 8;\r
+    UINT32  Reserved : 7;\r
+    UINT32  Enable : 1;\r
+  } Bits;\r
+  UINT32  Uint32;\r
+} PCI_CONFIG_ACCESS_CF8;\r
+\r
+#pragma pack()\r
+\r
+#define EFI_ROOT_BRIDGE_LIST                            'eprb'\r
+#define PCI_EXPANSION_ROM_HEADER_SIGNATURE              0xaa55\r
+#define EFI_PCI_EXPANSION_ROM_HEADER_EFISIGNATURE       0x0EF1\r
+#define PCI_DATA_STRUCTURE_SIGNATURE                    EFI_SIGNATURE_32 ('P', 'C', 'I', 'R')\r
+#define PCI_CODE_TYPE_PCAT_IMAGE                        0x00\r
+#define PCI_CODE_TYPE_EFI_IMAGE                         0x03\r
+#define EFI_PCI_EXPANSION_ROM_HEADER_COMPRESSED         0x0001\r
+\r
+#define EFI_PCI_COMMAND_IO_SPACE                        0x0001\r
+#define EFI_PCI_COMMAND_MEMORY_SPACE                    0x0002\r
+#define EFI_PCI_COMMAND_BUS_MASTER                      0x0004\r
+#define EFI_PCI_COMMAND_SPECIAL_CYCLE                   0x0008\r
+#define EFI_PCI_COMMAND_MEMORY_WRITE_AND_INVALIDATE     0x0010\r
+#define EFI_PCI_COMMAND_VGA_PALETTE_SNOOP               0x0020\r
+#define EFI_PCI_COMMAND_PARITY_ERROR_RESPOND            0x0040\r
+#define EFI_PCI_COMMAND_STEPPING_CONTROL                0x0080\r
+#define EFI_PCI_COMMAND_SERR                            0x0100\r
+#define EFI_PCI_COMMAND_FAST_BACK_TO_BACK               0x0200\r
+\r
+#define EFI_PCI_BRIDGE_CONTROL_PARITY_ERROR_RESPONSE    0x0001\r
+#define EFI_PCI_BRIDGE_CONTROL_SERR                     0x0002\r
+#define EFI_PCI_BRIDGE_CONTROL_ISA                      0x0004\r
+#define EFI_PCI_BRIDGE_CONTROL_VGA                      0x0008\r
+#define EFI_PCI_BRIDGE_CONTROL_VGA_16                   0x0010\r
+#define EFI_PCI_BRIDGE_CONTROL_MASTER_ABORT             0x0020\r
+#define EFI_PCI_BRIDGE_CONTROL_RESET_SECONDARY_BUS      0x0040\r
+#define EFI_PCI_BRIDGE_CONTROL_FAST_BACK_TO_BACK        0x0080\r
+#define EFI_PCI_BRIDGE_CONTROL_PRIMARY_DISCARD_TIMER    0x0100\r
+#define EFI_PCI_BRIDGE_CONTROL_SECONDARY_DISCARD_TIMER  0x0200\r
+#define EFI_PCI_BRIDGE_CONTROL_TIMER_STATUS             0x0400\r
+#define EFI_PCI_BRIDGE_CONTROL_DISCARD_TIMER_SERR       0x0800\r
+\r
+//\r
+// Following are the PCI-CARDBUS bridge control bit\r
+//\r
+#define EFI_PCI_BRIDGE_CONTROL_IREQINT_ENABLE       0x0080\r
+#define EFI_PCI_BRIDGE_CONTROL_RANGE0_MEMORY_TYPE   0x0100\r
+#define EFI_PCI_BRIDGE_CONTROL_RANGE1_MEMORY_TYPE   0x0200\r
+#define EFI_PCI_BRIDGE_CONTROL_WRITE_POSTING_ENABLE 0x0400\r
+\r
+//\r
+// Following are the PCI status control bit\r
+//\r
+#define EFI_PCI_STATUS_CAPABILITY             0x0010\r
+#define EFI_PCI_STATUS_66MZ_CAPABLE           0x0020\r
+#define EFI_PCI_FAST_BACK_TO_BACK_CAPABLE     0x0080\r
+#define EFI_PCI_MASTER_DATA_PARITY_ERROR      0x0100\r
+\r
+#define EFI_PCI_CAPABILITY_PTR                0x34\r
+#define EFI_PCI_CARDBUS_BRIDGE_CAPABILITY_PTR 0x14\r
+\r
+#pragma pack(1)\r
+typedef struct {\r
+  UINT16  Signature;    // 0xaa55\r
+  UINT8   Reserved[0x16];\r
+  UINT16  PcirOffset;\r
+} PCI_EXPANSION_ROM_HEADER;\r
+\r
+typedef struct {\r
+  UINT16  Signature;    // 0xaa55\r
+  UINT16  InitializationSize;\r
+  UINT32  EfiSignature; // 0x0EF1\r
+  UINT16  EfiSubsystem;\r
+  UINT16  EfiMachineType;\r
+  UINT16  CompressionType;\r
+  UINT8   Reserved[8];\r
+  UINT16  EfiImageHeaderOffset;\r
+  UINT16  PcirOffset;\r
+} EFI_PCI_EXPANSION_ROM_HEADER;\r
+\r
+typedef struct {\r
+  UINT16  Signature;    // 0xaa55\r
+  UINT8   Size512;\r
+  UINT8   Reserved[15];\r
+  UINT16  PcirOffset;\r
+} EFI_LEGACY_EXPANSION_ROM_HEADER;\r
+\r
+typedef union {\r
+  UINT8                           *Raw;\r
+  PCI_EXPANSION_ROM_HEADER        *Generic;\r
+  EFI_PCI_EXPANSION_ROM_HEADER    *Efi;\r
+  EFI_LEGACY_EXPANSION_ROM_HEADER *PcAt;\r
+} EFI_PCI_ROM_HEADER;\r
+\r
+typedef struct {\r
+  UINT32  Signature;    // "PCIR"\r
+  UINT16  VendorId;\r
+  UINT16  DeviceId;\r
+  UINT16  Reserved0;\r
+  UINT16  Length;\r
+  UINT8   Revision;\r
+  UINT8   ClassCode[3];\r
+  UINT16  ImageLength;\r
+  UINT16  CodeRevision;\r
+  UINT8   CodeType;\r
+  UINT8   Indicator;\r
+  UINT16  Reserved1;\r
+} PCI_DATA_STRUCTURE;\r
+\r
+//\r
+// PCI Capability List IDs and records\r
+//\r
+#define EFI_PCI_CAPABILITY_ID_PMI     0x01\r
+#define EFI_PCI_CAPABILITY_ID_AGP     0x02\r
+#define EFI_PCI_CAPABILITY_ID_VPD     0x03\r
+#define EFI_PCI_CAPABILITY_ID_SLOTID  0x04\r
+#define EFI_PCI_CAPABILITY_ID_MSI     0x05\r
+#define EFI_PCI_CAPABILITY_ID_HOTPLUG 0x06\r
+#define EFI_PCI_CAPABILITY_ID_PCIX    0x07\r
+//\r
+// bugbug: this ID is defined in PCI spec v2.3\r
+//\r
+#define EFI_PCI_CAPABILITY_ID_PCIEXP  0x10\r
+\r
+typedef struct {\r
+  UINT8 CapabilityID;\r
+  UINT8 NextItemPtr;\r
+} EFI_PCI_CAPABILITY_HDR;\r
+\r
+//\r
+// Capability EFI_PCI_CAPABILITY_ID_PMI\r
+//\r
+typedef struct {\r
+  EFI_PCI_CAPABILITY_HDR  Hdr;\r
+  UINT16                  PMC;\r
+  UINT16                  PMCSR;\r
+  UINT8                   BridgeExtention;\r
+  UINT8                   Data;\r
+} EFI_PCI_CAPABILITY_PMI;\r
+\r
+//\r
+// Capability EFI_PCI_CAPABILITY_ID_AGP\r
+//\r
+typedef struct {\r
+  EFI_PCI_CAPABILITY_HDR  Hdr;\r
+  UINT8                   Rev;\r
+  UINT8                   Reserved;\r
+  UINT32                  Status;\r
+  UINT32                  Command;\r
+} EFI_PCI_CAPABILITY_AGP;\r
+\r
+//\r
+// Capability EFI_PCI_CAPABILITY_ID_VPD\r
+//\r
+typedef struct {\r
+  EFI_PCI_CAPABILITY_HDR  Hdr;\r
+  UINT16                  AddrReg;\r
+  UINT32                  DataReg;\r
+} EFI_PCI_CAPABILITY_VPD;\r
+\r
+//\r
+// Capability EFI_PCI_CAPABILITY_ID_SLOTID\r
+//\r
+typedef struct {\r
+  EFI_PCI_CAPABILITY_HDR  Hdr;\r
+  UINT8                   ExpnsSlotReg;\r
+  UINT8                   ChassisNo;\r
+} EFI_PCI_CAPABILITY_SLOTID;\r
+\r
+//\r
+// Capability EFI_PCI_CAPABILITY_ID_MSI\r
+//\r
+typedef struct {\r
+  EFI_PCI_CAPABILITY_HDR  Hdr;\r
+  UINT16                  MsgCtrlReg;\r
+  UINT32                  MsgAddrReg;\r
+  UINT16                  MsgDataReg;\r
+} EFI_PCI_CAPABILITY_MSI32;\r
+\r
+typedef struct {\r
+  EFI_PCI_CAPABILITY_HDR  Hdr;\r
+  UINT16                  MsgCtrlReg;\r
+  UINT32                  MsgAddrRegLsdw;\r
+  UINT32                  MsgAddrRegMsdw;\r
+  UINT16                  MsgDataReg;\r
+} EFI_PCI_CAPABILITY_MSI64;\r
+\r
+//\r
+// Capability EFI_PCI_CAPABILITY_ID_HOTPLUG\r
+//\r
+typedef struct {\r
+  EFI_PCI_CAPABILITY_HDR  Hdr;\r
+  //\r
+  // not finished - fields need to go here\r
+  //\r
+} EFI_PCI_CAPABILITY_HOTPLUG;\r
+\r
+//\r
+// Capability EFI_PCI_CAPABILITY_ID_PCIX\r
+//\r
+typedef struct {\r
+  EFI_PCI_CAPABILITY_HDR  Hdr;\r
+  UINT16                  CommandReg;\r
+  UINT32                  StatusReg;\r
+} EFI_PCI_CAPABILITY_PCIX;\r
+\r
+typedef struct {\r
+  EFI_PCI_CAPABILITY_HDR  Hdr;\r
+  UINT16                  SecStatusReg;\r
+  UINT32                  StatusReg;\r
+  UINT32                  SplitTransCtrlRegUp;\r
+  UINT32                  SplitTransCtrlRegDn;\r
+} EFI_PCI_CAPABILITY_PCIX_BRDG;\r
+\r
+#define DEVICE_ID_NOCARE    0xFFFF\r
+\r
+#define PCI_ACPI_UNUSED     0\r
+#define PCI_BAR_NOCHANGE    0\r
+#define PCI_BAR_OLD_ALIGN   0xFFFFFFFFFFFFFFFFULL\r
+#define PCI_BAR_EVEN_ALIGN  0xFFFFFFFFFFFFFFFEULL\r
+#define PCI_BAR_SQUAD_ALIGN 0xFFFFFFFFFFFFFFFDULL\r
+#define PCI_BAR_DQUAD_ALIGN 0xFFFFFFFFFFFFFFFCULL\r
+\r
+#define PCI_BAR_IDX0        0x00\r
+#define PCI_BAR_IDX1        0x01\r
+#define PCI_BAR_IDX2        0x02\r
+#define PCI_BAR_IDX3        0x03\r
+#define PCI_BAR_IDX4        0x04\r
+#define PCI_BAR_IDX5        0x05\r
+#define PCI_BAR_ALL         0xFF\r
+\r
+#pragma pack(pop)\r
+\r
+#endif\r
diff --git a/Tools/Source/TianoTools/Include/Library/BaseLib.h b/Tools/Source/TianoTools/Include/Library/BaseLib.h
new file mode 100644 (file)
index 0000000..7fb2e64
--- /dev/null
@@ -0,0 +1,4890 @@
+/** @file\r
+       Memory-only library functions with no library constructor/destructor\r
+\r
+       Copyright (c) 2006, Intel Corporation\r
+       All rights reserved. This program and the accompanying materials\r
+       are licensed and made available under the terms and conditions of the BSD License\r
+       which accompanies this distribution.  The full text of the license may be found at\r
+       http://opensource.org/licenses/bsd-license.php\r
+\r
+       THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+       WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+       Module Name:    BaseLib.h\r
+\r
+**/\r
+\r
+#ifndef __BASE_LIB__\r
+#define __BASE_LIB__\r
+\r
+//\r
+// Definitions for architecture specific types\r
+// These include SPIN_LOCK and BASE_LIBRARY_JUMP_BUFFER\r
+//\r
+\r
+//\r
+// SPIN_LOCK\r
+//\r
+typedef UINTN                       SPIN_LOCK;\r
+\r
+#if   defined (MDE_CPU_IA32)\r
+//\r
+// IA32 context buffer used by SetJump() and LongJump()\r
+//\r
+typedef struct {\r
+  UINT32                            Ebx;\r
+  UINT32                            Esi;\r
+  UINT32                            Edi;\r
+  UINT32                            Ebp;\r
+  UINT32                            Esp;\r
+  UINT32                            Eip;\r
+} BASE_LIBRARY_JUMP_BUFFER;\r
+\r
+#elif defined (MDE_CPU_IPF)\r
+//\r
+// IPF context buffer used by SetJump() and LongJump()\r
+//\r
+typedef struct {\r
+  UINT64                            InitialUNAT;\r
+  UINT64                            AfterSpillUNAT;\r
+  UINT64                            PFS;\r
+  UINT64                            BSP;\r
+  UINT64                            RNAT;\r
+  UINT64                            Predicates;\r
+  UINT64                            LoopCount;\r
+  UINT64                            R4;\r
+  UINT64                            R5;\r
+  UINT64                            R6;\r
+  UINT64                            R7;\r
+  UINT64                            SP;\r
+  UINT64                            F2Low;\r
+  UINT64                            F2High;\r
+  UINT64                            F3Low;\r
+  UINT64                            F3High;\r
+  UINT64                            F4Low;\r
+  UINT64                            F4High;\r
+  UINT64                            F5Low;\r
+  UINT64                            F5High;\r
+  UINT64                            F16Low;\r
+  UINT64                            F16High;\r
+  UINT64                            F17Low;\r
+  UINT64                            F17High;\r
+  UINT64                            F18Low;\r
+  UINT64                            F18High;\r
+  UINT64                            F19Low;\r
+  UINT64                            F19High;\r
+  UINT64                            F20Low;\r
+  UINT64                            F20High;\r
+  UINT64                            F21Low;\r
+  UINT64                            F21High;\r
+  UINT64                            F22Low;\r
+  UINT64                            F22High;\r
+  UINT64                            F23Low;\r
+  UINT64                            F23High;\r
+  UINT64                            F24Low;\r
+  UINT64                            F24High;\r
+  UINT64                            F25Low;\r
+  UINT64                            F25High;\r
+  UINT64                            F26Low;\r
+  UINT64                            F26High;\r
+  UINT64                            F27Low;\r
+  UINT64                            F27High;\r
+  UINT64                            F28Low;\r
+  UINT64                            F28High;\r
+  UINT64                            F29Low;\r
+  UINT64                            F29High;\r
+  UINT64                            F30Low;\r
+  UINT64                            F30High;\r
+  UINT64                            F31Low;\r
+  UINT64                            F31High;\r
+  UINT64                            FPSR;\r
+  UINT64                            BR0;\r
+  UINT64                            BR1;\r
+  UINT64                            BR2;\r
+  UINT64                            BR3;\r
+  UINT64                            BR4;\r
+  UINT64                            BR5;\r
+} BASE_LIBRARY_JUMP_BUFFER;\r
+\r
+#elif defined (MDE_CPU_X64)\r
+//\r
+// X64 context buffer used by SetJump() and LongJump()\r
+//\r
+typedef struct {\r
+  UINT64                            Rbx;\r
+  UINT64                            Rsp;\r
+  UINT64                            Rbp;\r
+  UINT64                            Rdi;\r
+  UINT64                            Rsi;\r
+  UINT64                            R12;\r
+  UINT64                            R13;\r
+  UINT64                            R14;\r
+  UINT64                            R15;\r
+  UINT64                            Rip;\r
+} BASE_LIBRARY_JUMP_BUFFER;\r
+\r
+#elif defined (MDE_CPU_EBC)\r
+//\r
+// EBC context buffer used by SetJump() and LongJump()\r
+//\r
+typedef struct {\r
+  UINT64                            R0;\r
+  UINT64                            R1;\r
+  UINT64                            R2;\r
+  UINT64                            R3;\r
+  UINT64                            IP;\r
+} BASE_LIBRARY_JUMP_BUFFER;\r
+\r
+#else\r
+#error Unknown Processor Type\r
+#endif\r
+\r
+//\r
+// String Services\r
+//\r
+\r
+/**\r
+  Copies one Null-terminated Unicode string to another Null-terminated Unicode\r
+  string and returns the new Unicode string.\r
+\r
+  This function copies the contents of the Unicode string Source to the Unicode\r
+  string Destination, and returns Destination. If Source and Destination\r
+  overlap, then the results are undefined.\r
+\r
+  If Destination is NULL, then ASSERT().\r
+  If Source is NULL, then ASSERT().\r
+  If Source and Destination overlap, then ASSERT().\r
+  If PcdMaximumUnicodeStringLength is not zero, and Source contains more than\r
+  PcdMaximumUnicodeStringLength Unicode characters, then ASSERT().\r
+\r
+  @param  Destination Pointer to a Null-terminated Unicode string.\r
+  @param  Source      Pointer to a Null-terminated Unicode string.\r
+\r
+  @return Destiantion\r
+\r
+**/\r
+CHAR16 *\r
+EFIAPI\r
+StrCpy (\r
+  OUT     CHAR16                    *Destination,\r
+  IN      CONST CHAR16              *Source\r
+  );\r
+\r
+/**\r
+  Copies one Null-terminated Unicode string with a maximum length to another\r
+  Null-terminated Unicode string with a maximum length and returns the new\r
+  Unicode string.\r
+\r
+  This function copies the contents of the Unicode string Source to the Unicode\r
+  string Destination, and returns Destination. At most, Length Unicode\r
+  characters are copied from Source to Destination. If Length is 0, then\r
+  Destination is returned unmodified. If Length is greater that the number of\r
+  Unicode characters in Source, then Destination is padded with Null Unicode\r
+  characters. If Source and Destination overlap, then the results are\r
+  undefined.\r
+\r
+  If Destination is NULL, then ASSERT().\r
+  If Source is NULL, then ASSERT().\r
+  If Source and Destination overlap, then ASSERT().\r
+  If PcdMaximumUnicodeStringLength is not zero, and Source contains more than\r
+  PcdMaximumUnicodeStringLength Unicode characters, then ASSERT().\r
+\r
+  @param  Destination Pointer to a Null-terminated Unicode string.\r
+  @param  Source      Pointer to a Null-terminated Unicode string.\r
+  @param  Length      Maximum number of Unicode characters to copy.\r
+\r
+  @return Destination\r
+\r
+**/\r
+CHAR16 *\r
+EFIAPI\r
+StrnCpy (\r
+  OUT     CHAR16                    *Destination,\r
+  IN      CONST CHAR16              *Source,\r
+  IN      UINTN                     Length\r
+  );\r
+\r
+/**\r
+  Returns the length of a Null-terminated Unicode string.\r
+\r
+  This function returns the number of Unicode characters in the Null-terminated\r
+  Unicode string specified by String.\r
+\r
+  If String is NULL, then ASSERT().\r
+  If PcdMaximumUnicodeStringLength is not zero, and String contains more than\r
+  PcdMaximumUnicodeStringLength Unicode characters, then ASSERT().\r
+\r
+  @param  String  Pointer to a Null-terminated Unicode string.\r
+\r
+  @return The length of String.\r
+\r
+**/\r
+UINTN\r
+EFIAPI\r
+StrLen (\r
+  IN      CONST CHAR16              *String\r
+  );\r
+\r
+/**\r
+  Returns the size of a Null-terminated Unicode string in bytes, including the\r
+  Null terminator.\r
+\r
+  This function returns the size, in bytes, of the Null-terminated Unicode\r
+  string specified by String.\r
+\r
+  If String is NULL, then ASSERT().\r
+  If PcdMaximumUnicodeStringLength is not zero, and String contains more than\r
+  PcdMaximumUnicodeStringLength Unicode characters, then ASSERT().\r
+\r
+  @param  String  Pointer to a Null-terminated Unicode string.\r
+\r
+  @return The size of String.\r
+\r
+**/\r
+UINTN\r
+EFIAPI\r
+StrSize (\r
+  IN      CONST CHAR16              *String\r
+  );\r
+\r
+/**\r
+  Compares two Null-terminated Unicode strings, and returns the difference\r
+  between the first mismatched Unicode characters.\r
+\r
+  This function compares the Null-terminated Unicode string FirstString to the\r
+  Null-terminated Unicode string SecondString. If FirstString is identical to\r
+  SecondString, then 0 is returned. Otherwise, the value returned is the first\r
+  mismatched Unicode character in SecondString subtracted from the first\r
+  mismatched Unicode character in FirstString.\r
+\r
+  If FirstString is NULL, then ASSERT().\r
+  If SecondString is NULL, then ASSERT().\r
+  If PcdMaximumUnicodeStringLength is not zero, and FirstString contains more\r
+  than PcdMaximumUnicodeStringLength Unicode characters, then ASSERT().\r
+  If PcdMaximumUnicodeStringLength is not zero, and SecondString contains more\r
+  than PcdMaximumUnicodeStringLength Unicode characters, then ASSERT().\r
+\r
+  @param  FirstString   Pointer to a Null-terminated Unicode string.\r
+  @param  SecondString  Pointer to a Null-terminated Unicode string.\r
+\r
+  @retval 0   FirstString is identical to SecondString.\r
+  @retval !=0 FirstString is not identical to SecondString.\r
+\r
+**/\r
+INTN\r
+EFIAPI\r
+StrCmp (\r
+  IN      CONST CHAR16              *FirstString,\r
+  IN      CONST CHAR16              *SecondString\r
+  );\r
+\r
+/**\r
+  Compares two Null-terminated Unicode strings with maximum lengths, and\r
+  returns the difference between the first mismatched Unicode characters.\r
+\r
+  This function compares the Null-terminated Unicode string FirstString to the\r
+  Null-terminated Unicode string SecondString. At most, Length Unicode\r
+  characters will be compared. If Length is 0, then 0 is returned. If\r
+  FirstString is identical to SecondString, then 0 is returned. Otherwise, the\r
+  value returned is the first mismatched Unicode character in SecondString\r
+  subtracted from the first mismatched Unicode character in FirstString.\r
+\r
+  If FirstString is NULL, then ASSERT().\r
+  If SecondString is NULL, then ASSERT().\r
+  If PcdMaximumUnicodeStringLength is not zero, and FirstString contains more\r
+  than PcdMaximumUnicodeStringLength Unicode characters, then ASSERT().\r
+  If PcdMaximumUnicodeStringLength is not zero, and SecondString contains more\r
+  than PcdMaximumUnicodeStringLength Unicode characters, then ASSERT().\r
+\r
+  @param  FirstString   Pointer to a Null-terminated Unicode string.\r
+  @param  SecondString  Pointer to a Null-terminated Unicode string.\r
+  @param  Length        Maximum number of Unicode characters to compare.\r
+\r
+  @retval 0   FirstString is identical to SecondString.\r
+  @retval !=0 FirstString is not identical to SecondString.\r
+\r
+**/\r
+INTN\r
+EFIAPI\r
+StrnCmp (\r
+  IN      CONST CHAR16              *FirstString,\r
+  IN      CONST CHAR16              *SecondString,\r
+  IN      UINTN                     Length\r
+  );\r
+\r
+/**\r
+  Concatenates one Null-terminated Unicode string to another Null-terminated\r
+  Unicode string, and returns the concatenated Unicode string.\r
+\r
+  This function concatenates two Null-terminated Unicode strings. The contents\r
+  of Null-terminated Unicode string Source are concatenated to the end of\r
+  Null-terminated Unicode string Destination. The Null-terminated concatenated\r
+  Unicode String is returned. If Source and Destination overlap, then the\r
+  results are undefined.\r
+\r
+  If Destination is NULL, then ASSERT().\r
+  If Source is NULL, then ASSERT().\r
+  If Source and Destination overlap, then ASSERT().\r
+  If PcdMaximumUnicodeStringLength is not zero, and Destination contains more\r
+  than PcdMaximumUnicodeStringLength Unicode characters, then ASSERT().\r
+  If PcdMaximumUnicodeStringLength is not zero, and Source contains more than\r
+  PcdMaximumUnicodeStringLength Unicode characters, then ASSERT().\r
+  If PcdMaximumUnicodeStringLength is not zero, and concatenating Destination\r
+  and Source results in a Unicode string with more than\r
+  PcdMaximumUnicodeStringLength Unicode characters, then ASSERT().\r
+\r
+  @param  Destination Pointer to a Null-terminated Unicode string.\r
+  @param  Source      Pointer to a Null-terminated Unicode string.\r
+\r
+  @return Destination\r
+\r
+**/\r
+CHAR16 *\r
+EFIAPI\r
+StrCat (\r
+  IN OUT  CHAR16                    *Destination,\r
+  IN      CONST CHAR16              *Source\r
+  );\r
+\r
+/**\r
+  Concatenates one Null-terminated Unicode string with a maximum length to the\r
+  end of another Null-terminated Unicode string, and returns the concatenated\r
+  Unicode string.\r
+\r
+  This function concatenates two Null-terminated Unicode strings. The contents\r
+  of Null-terminated Unicode string Source are concatenated to the end of\r
+  Null-terminated Unicode string Destination, and Destination is returned. At\r
+  most, Length Unicode characters are concatenated from Source to the end of\r
+  Destination, and Destination is always Null-terminated. If Length is 0, then\r
+  Destination is returned unmodified. If Source and Destination overlap, then\r
+  the results are undefined.\r
+\r
+  If Destination is NULL, then ASSERT().\r
+  If Source is NULL, then ASSERT().\r
+  If Source and Destination overlap, then ASSERT().\r
+  If PcdMaximumUnicodeStringLength is not zero, and Destination contains more\r
+  than PcdMaximumUnicodeStringLength Unicode characters, then ASSERT().\r
+  If PcdMaximumUnicodeStringLength is not zero, and Source contains more than\r
+  PcdMaximumUnicodeStringLength Unicode characters, then ASSERT().\r
+  If PcdMaximumUnicodeStringLength is not zero, and concatenating Destination\r
+  and Source results in a Unicode string with more than\r
+  PcdMaximumUnicodeStringLength Unicode characters, then ASSERT().\r
+\r
+  @param  Destination Pointer to a Null-terminated Unicode string.\r
+  @param  Source      Pointer to a Null-terminated Unicode string.\r
+  @param  Length      Maximum number of Unicode characters to concatenate from\r
+                      Source.\r
+\r
+  @return Destination\r
+\r
+**/\r
+CHAR16 *\r
+EFIAPI\r
+StrnCat (\r
+  IN OUT  CHAR16                    *Destination,\r
+  IN      CONST CHAR16              *Source,\r
+  IN      UINTN                     Length\r
+  );\r
+\r
+/**\r
+  Copies one Null-terminated ASCII string to another Null-terminated ASCII\r
+  string and returns the new ASCII string.\r
+\r
+  This function copies the contents of the ASCII string Source to the ASCII\r
+  string Destination, and returns Destination. If Source and Destination\r
+  overlap, then the results are undefined.\r
+\r
+  If Destination is NULL, then ASSERT().\r
+  If Source is NULL, then ASSERT().\r
+  If Source and Destination overlap, then ASSERT().\r
+  If PcdMaximumAsciiStringLength is not zero and Source contains more than\r
+  PcdMaximumAsciiStringLength ASCII characters, then ASSERT().\r
+\r
+  @param  Destination Pointer to a Null-terminated ASCII string.\r
+  @param  Source      Pointer to a Null-terminated ASCII string.\r
+\r
+  @return Destination\r
+\r
+**/\r
+CHAR8 *\r
+EFIAPI\r
+AsciiStrCpy (\r
+  OUT     CHAR8                     *Destination,\r
+  IN      CONST CHAR8               *Source\r
+  );\r
+\r
+/**\r
+  Copies one Null-terminated ASCII string with a maximum length to another\r
+  Null-terminated ASCII string with a maximum length and returns the new ASCII\r
+  string.\r
+\r
+  This function copies the contents of the ASCII string Source to the ASCII\r
+  string Destination, and returns Destination. At most, Length ASCII characters\r
+  are copied from Source to Destination. If Length is 0, then Destination is\r
+  returned unmodified. If Length is greater that the number of ASCII characters\r
+  in Source, then Destination is padded with Null ASCII characters. If Source\r
+  and Destination overlap, then the results are undefined.\r
+\r
+  If Destination is NULL, then ASSERT().\r
+  If Source is NULL, then ASSERT().\r
+  If Source and Destination overlap, then ASSERT().\r
+  If PcdMaximumAsciiStringLength is not zero, and Source contains more than\r
+  PcdMaximumAsciiStringLength ASCII characters, then ASSERT().\r
+\r
+  @param  Destination Pointer to a Null-terminated ASCII string.\r
+  @param  Source      Pointer to a Null-terminated ASCII string.\r
+  @param  Length      Maximum number of ASCII characters to copy.\r
+\r
+  @return Destination\r
+\r
+**/\r
+CHAR8 *\r
+EFIAPI\r
+AsciiStrnCpy (\r
+  OUT     CHAR8                     *Destination,\r
+  IN      CONST CHAR8               *Source,\r
+  IN      UINTN                     Length\r
+  );\r
+\r
+/**\r
+  Returns the length of a Null-terminated ASCII string.\r
+\r
+  This function returns the number of ASCII characters in the Null-terminated\r
+  ASCII string specified by String.\r
+\r
+  If String is NULL, then ASSERT().\r
+  If PcdMaximumAsciiStringLength is not zero and String contains more than\r
+  PcdMaximumAsciiStringLength ASCII characters, then ASSERT().\r
+\r
+  @param  String  Pointer to a Null-terminated ASCII string.\r
+\r
+  @return The length of String.\r
+\r
+**/\r
+UINTN\r
+EFIAPI\r
+AsciiStrLen (\r
+  IN      CONST CHAR8               *String\r
+  );\r
+\r
+/**\r
+  Returns the size of a Null-terminated ASCII string in bytes, including the\r
+  Null terminator.\r
+\r
+  This function returns the size, in bytes, of the Null-terminated ASCII string\r
+  specified by String.\r
+\r
+  If String is NULL, then ASSERT().\r
+  If PcdMaximumAsciiStringLength is not zero and String contains more than\r
+  PcdMaximumAsciiStringLength ASCII characters, then ASSERT().\r
+\r
+  @param  String  Pointer to a Null-terminated ASCII string.\r
+\r
+  @return The size of String.\r
+\r
+**/\r
+UINTN\r
+EFIAPI\r
+AsciiStrSize (\r
+  IN      CONST CHAR8               *String\r
+  );\r
+\r
+/**\r
+  Compares two Null-terminated ASCII strings, and returns the difference\r
+  between the first mismatched ASCII characters.\r
+\r
+  This function compares the Null-terminated ASCII string FirstString to the\r
+  Null-terminated ASCII string SecondString. If FirstString is identical to\r
+  SecondString, then 0 is returned. Otherwise, the value returned is the first\r
+  mismatched ASCII character in SecondString subtracted from the first\r
+  mismatched ASCII character in FirstString.\r
+\r
+  If FirstString is NULL, then ASSERT().\r
+  If SecondString is NULL, then ASSERT().\r
+  If PcdMaximumAsciiStringLength is not zero and FirstString contains more than\r
+  PcdMaximumAsciiStringLength ASCII characters, then ASSERT().\r
+  If PcdMaximumAsciiStringLength is not zero and SecondString contains more\r
+  than PcdMaximumAsciiStringLength ASCII characters, then ASSERT().\r
+\r
+  @param  FirstString   Pointer to a Null-terminated ASCII string.\r
+  @param  SecondString  Pointer to a Null-terminated ASCII string.\r
+\r
+  @retval 0   FirstString is identical to SecondString.\r
+  @retval !=0 FirstString is not identical to SecondString.\r
+\r
+**/\r
+INTN\r
+EFIAPI\r
+AsciiStrCmp (\r
+  IN      CONST CHAR8               *FirstString,\r
+  IN      CONST CHAR8               *SecondString\r
+  );\r
+\r
+/**\r
+  Performs a case insensitive comparison of two Null-terminated ASCII strings,\r
+  and returns the difference between the first mismatched ASCII characters.\r
+\r
+  This function performs a case insensitive comparison of the Null-terminated\r
+  ASCII string FirstString to the Null-terminated ASCII string SecondString. If\r
+  FirstString is identical to SecondString, then 0 is returned. Otherwise, the\r
+  value returned is the first mismatched lower case ASCII character in\r
+  SecondString subtracted from the first mismatched lower case ASCII character\r
+  in FirstString.\r
+\r
+  If FirstString is NULL, then ASSERT().\r
+  If SecondString is NULL, then ASSERT().\r
+  If PcdMaximumAsciiStringLength is not zero and FirstString contains more than\r
+  PcdMaximumAsciiStringLength ASCII characters, then ASSERT().\r
+  If PcdMaximumAsciiStringLength is not zero and SecondString contains more\r
+  than PcdMaximumAsciiStringLength ASCII characters, then ASSERT().\r
+\r
+  @param  FirstString   Pointer to a Null-terminated ASCII string.\r
+  @param  SecondString  Pointer to a Null-terminated ASCII string.\r
+\r
+  @retval 0   FirstString is identical to SecondString using case insensitive\r
+              comparisons.\r
+  @retval !=0 FirstString is not identical to SecondString using case\r
+              insensitive comparisons.\r
+\r
+**/\r
+INTN\r
+EFIAPI\r
+AsciiStriCmp (\r
+  IN      CONST CHAR8               *FirstString,\r
+  IN      CONST CHAR8               *SecondString\r
+  );\r
+\r
+/**\r
+  Compares two Null-terminated ASCII strings with maximum lengths, and returns\r
+  the difference between the first mismatched ASCII characters.\r
+\r
+  This function compares the Null-terminated ASCII string FirstString to the\r
+  Null-terminated ASCII  string SecondString. At most, Length ASCII characters\r
+  will be compared. If Length is 0, then 0 is returned. If FirstString is\r
+  identical to SecondString, then 0 is returned. Otherwise, the value returned\r
+  is the first mismatched ASCII character in SecondString subtracted from the\r
+  first mismatched ASCII character in FirstString.\r
+\r
+  If FirstString is NULL, then ASSERT().\r
+  If SecondString is NULL, then ASSERT().\r
+  If PcdMaximumAsciiStringLength is not zero and FirstString contains more than\r
+  PcdMaximumAsciiStringLength ASCII characters, then ASSERT().\r
+  If PcdMaximumAsciiStringLength is not zero and SecondString contains more\r
+  than PcdMaximumAsciiStringLength ASCII characters, then ASSERT().\r
+\r
+  @param  FirstString   Pointer to a Null-terminated ASCII string.\r
+  @param  SecondString  Pointer to a Null-terminated ASCII string.\r
+\r
+  @retval 0   FirstString is identical to SecondString.\r
+  @retval !=0 FirstString is not identical to SecondString.\r
+\r
+**/\r
+INTN\r
+EFIAPI\r
+AsciiStrnCmp (\r
+  IN      CONST CHAR8               *FirstString,\r
+  IN      CONST CHAR8               *SecondString,\r
+  IN      UINTN                     Length\r
+  );\r
+\r
+/**\r
+  Concatenates one Null-terminated ASCII string to another Null-terminated\r
+  ASCII string, and returns the concatenated ASCII string.\r
+\r
+  This function concatenates two Null-terminated ASCII strings. The contents of\r
+  Null-terminated ASCII string Source are concatenated to the end of Null-\r
+  terminated ASCII string Destination. The Null-terminated concatenated ASCII\r
+  String is returned.\r
+\r
+  If Destination is NULL, then ASSERT().\r
+  If Source is NULL, then ASSERT().\r
+  If PcdMaximumAsciiStringLength is not zero and Destination contains more than\r
+  PcdMaximumAsciiStringLength ASCII characters, then ASSERT().\r
+  If PcdMaximumAsciiStringLength is not zero and Source contains more than\r
+  PcdMaximumAsciiStringLength ASCII characters, then ASSERT().\r
+  If PcdMaximumAsciiStringLength is not zero and concatenating Destination and\r
+  Source results in a ASCII string with more than PcdMaximumAsciiStringLength\r
+  ASCII characters, then ASSERT().\r
+\r
+  @param  Destination Pointer to a Null-terminated ASCII string.\r
+  @param  Source      Pointer to a Null-terminated ASCII string.\r
+\r
+  @return Destination\r
+\r
+**/\r
+CHAR8 *\r
+EFIAPI\r
+AsciiStrCat (\r
+  IN OUT  CHAR8                     *Destination,\r
+  IN      CONST CHAR8               *Source\r
+  );\r
+\r
+/**\r
+  Concatenates one Null-terminated ASCII string with a maximum length to the\r
+  end of another Null-terminated ASCII string, and returns the concatenated\r
+  ASCII string.\r
+\r
+  This function concatenates two Null-terminated ASCII strings. The contents\r
+  of Null-terminated ASCII string Source are concatenated to the end of Null-\r
+  terminated ASCII string Destination, and Destination is returned. At most,\r
+  Length ASCII characters are concatenated from Source to the end of\r
+  Destination, and Destination is always Null-terminated. If Length is 0, then\r
+  Destination is returned unmodified. If Source and Destination overlap, then\r
+  the results are undefined.\r
+\r
+  If Destination is NULL, then ASSERT().\r
+  If Source is NULL, then ASSERT().\r
+  If Source and Destination overlap, then ASSERT().\r
+  If PcdMaximumAsciiStringLength is not zero, and Destination contains more\r
+  than PcdMaximumAsciiStringLength ASCII characters, then ASSERT().\r
+  If PcdMaximumAsciiStringLength is not zero, and Source contains more than\r
+  PcdMaximumAsciiStringLength ASCII characters, then ASSERT().\r
+  If PcdMaximumAsciiStringLength is not zero, and concatenating Destination and\r
+  Source results in a ASCII string with more than PcdMaximumAsciiStringLength\r
+  ASCII characters, then ASSERT().\r
+\r
+  @param  Destination Pointer to a Null-terminated ASCII string.\r
+  @param  Source      Pointer to a Null-terminated ASCII string.\r
+  @param  Length      Maximum number of ASCII characters to concatenate from\r
+                      Source.\r
+\r
+  @return Destination\r
+\r
+**/\r
+CHAR8 *\r
+EFIAPI\r
+AsciiStrnCat (\r
+  IN OUT  CHAR8                     *Destination,\r
+  IN      CONST CHAR8               *Source,\r
+  IN      UINTN                     Length\r
+  );\r
+\r
+//\r
+// LIST_ENTRY definition\r
+//\r
+typedef struct _LIST_ENTRY LIST_ENTRY;\r
+\r
+struct _LIST_ENTRY {\r
+  LIST_ENTRY  *ForwardLink;\r
+  LIST_ENTRY  *BackLink;\r
+};\r
+\r
+//\r
+// Linked List Functions and Macros\r
+//\r
+\r
+/**\r
+  Initializes the head node of a doubly linked list that is declared as a\r
+  global variable in a module.\r
+\r
+  Initializes the forward and backward links of a new linked list. After\r
+  initializing a linked list with this macro, the other linked list functions\r
+  may be used to add and remove nodes from the linked list. This macro results\r
+  in smaller executables by initializing the linked list in the data section,\r
+  instead if calling the InitializeListHead() function to perform the\r
+  equivalent operation.\r
+\r
+  @param  ListHead  The head note of a list to initiailize.\r
+\r
+**/\r
+#define INITIALIZE_LIST_HEAD_VARIABLE(ListHead)  {&ListHead, &ListHead}\r
+\r
+/**\r
+  Initializes the head node of a doubly linked list, and returns the pointer to\r
+  the head node of the doubly linked list.\r
+\r
+  Initializes the forward and backward links of a new linked list. After\r
+  initializing a linked list with this function, the other linked list\r
+  functions may be used to add and remove nodes from the linked list. It is up\r
+  to the caller of this function to allocate the memory for ListHead.\r
+\r
+  If ListHead is NULL, then ASSERT().\r
+\r
+  @param  ListHead  A pointer to the head node of a new doubly linked list.\r
+\r
+  @return ListHead\r
+\r
+**/\r
+LIST_ENTRY *\r
+EFIAPI\r
+InitializeListHead (\r
+  IN      LIST_ENTRY                *ListHead\r
+  );\r
+\r
+/**\r
+  Adds a node to the beginning of a doubly linked list, and returns the pointer\r
+  to the head node of the doubly linked list.\r
+\r
+  Adds the node Entry at the beginning of the doubly linked list denoted by\r
+  ListHead, and returns ListHead.\r
+\r
+  If ListHead is NULL, then ASSERT().\r
+  If Entry is NULL, then ASSERT().\r
+  If ListHead was not initialized with InitializeListHead(), then ASSERT().\r
+  If PcdMaximumLinkedListLenth is not zero, and ListHead contains more than\r
+  PcdMaximumLinkedListLenth nodes, then ASSERT().\r
+\r
+  @param  ListHead  A pointer to the head node of a doubly linked list.\r
+  @param  Entry     A pointer to a node that is to be inserted at the beginning\r
+                    of a doubly linked list.\r
+\r
+  @return ListHead\r
+\r
+**/\r
+LIST_ENTRY *\r
+EFIAPI\r
+InsertHeadList (\r
+  IN      LIST_ENTRY                *ListHead,\r
+  IN      LIST_ENTRY                *Entry\r
+  );\r
+\r
+/**\r
+  Adds a node to the end of a doubly linked list, and returns the pointer to\r
+  the head node of the doubly linked list.\r
+\r
+  Adds the node Entry to the end of the doubly linked list denoted by ListHead,\r
+  and returns ListHead.\r
+\r
+  If ListHead is NULL, then ASSERT().\r
+  If Entry is NULL, then ASSERT().\r
+  If ListHead was not initialized with InitializeListHead(), then ASSERT().\r
+  If PcdMaximumLinkedListLenth is not zero, and ListHead contains more than\r
+  PcdMaximumLinkedListLenth nodes, then ASSERT().\r
+\r
+  @param  ListHead  A pointer to the head node of a doubly linked list.\r
+  @param  Entry     A pointer to a node that is to be added at the end of the\r
+                    doubly linked list.\r
+\r
+  @return ListHead\r
+\r
+**/\r
+LIST_ENTRY *\r
+EFIAPI\r
+InsertTailList (\r
+  IN      LIST_ENTRY                *ListHead,\r
+  IN      LIST_ENTRY                *Entry\r
+  );\r
+\r
+/**\r
+  Retrieves the first node of a doubly linked list.\r
+\r
+  Returns the first node of a doubly linked list. List must have been\r
+  initialized with InitializeListHead(). If List is empty, then NULL is\r
+  returned.\r
+\r
+  If List is NULL, then ASSERT().\r
+  If List was not initialized with InitializeListHead(), then ASSERT().\r
+  If PcdMaximumLinkedListLenth is not zero, and List contains more than\r
+  PcdMaximumLinkedListLenth nodes, then ASSERT().\r
+\r
+  @param  List  A pointer to the head node of a doubly linked list.\r
+\r
+  @return The first node of a doubly linked list.\r
+  @retval NULL  The list is empty.\r
+\r
+**/\r
+LIST_ENTRY *\r
+EFIAPI\r
+GetFirstNode (\r
+  IN      CONST LIST_ENTRY          *List\r
+  );\r
+\r
+/**\r
+  Retrieves the next node of a doubly linked list.\r
+\r
+  Returns the node of a doubly linked list that follows Node. List must have\r
+  been initialized with InitializeListHead(). If List is empty, then List is\r
+  returned.\r
+\r
+  If List is NULL, then ASSERT().\r
+  If Node is NULL, then ASSERT().\r
+  If List was not initialized with InitializeListHead(), then ASSERT().\r
+  If PcdMaximumLinkedListLenth is not zero, and List contains more than\r
+  PcdMaximumLinkedListLenth nodes, then ASSERT().\r
+  If Node is not a node in List, then ASSERT().\r
+\r
+  @param  List  A pointer to the head node of a doubly linked list.\r
+  @param  Node  A pointer to a node in the doubly linked list.\r
+\r
+  @return Pointer to the next node if one exists. Otherwise a null value which\r
+          is actually List is returned.\r
+\r
+**/\r
+LIST_ENTRY *\r
+EFIAPI\r
+GetNextNode (\r
+  IN      CONST LIST_ENTRY          *List,\r
+  IN      CONST LIST_ENTRY          *Node\r
+  );\r
+\r
+/**\r
+  Checks to see if a doubly linked list is empty or not.\r
+\r
+  Checks to see if the doubly linked list is empty. If the linked list contains\r
+  zero nodes, this function returns TRUE. Otherwise, it returns FALSE.\r
+\r
+  If ListHead is NULL, then ASSERT().\r
+  If ListHead was not initialized with InitializeListHead(), then ASSERT().\r
+  If PcdMaximumLinkedListLenth is not zero, and List contains more than\r
+  PcdMaximumLinkedListLenth nodes, then ASSERT().\r
+\r
+  @param  ListHead  A pointer to the head node of a doubly linked list.\r
+\r
+  @retval TRUE  The linked list is empty.\r
+  @retval FALSE The linked list is not empty.\r
+\r
+**/\r
+BOOLEAN\r
+EFIAPI\r
+IsListEmpty (\r
+  IN      CONST LIST_ENTRY          *ListHead\r
+  );\r
+\r
+/**\r
+  Determines if a node in a doubly linked list is null.\r
+\r
+  Returns FALSE if Node is one of the nodes in the doubly linked list specified\r
+  by List. Otherwise, TRUE is returned. List must have been initialized with\r
+  InitializeListHead().\r
+\r
+  If List is NULL, then ASSERT().\r
+  If Node is NULL, then ASSERT().\r
+  If List was not initialized with InitializeListHead(), then ASSERT().\r
+  If PcdMaximumLinkedListLenth is not zero, and List contains more than\r
+  PcdMaximumLinkedListLenth nodes, then ASSERT().\r
+  If Node is not a node in List and Node is not equal to List, then ASSERT().\r
+\r
+  @param  List  A pointer to the head node of a doubly linked list.\r
+  @param  Node A pointer to a node in the doubly linked list.\r
+\r
+  @retval TRUE  Node is one of the nodes in the doubly linked list.\r
+  @retval FALSE Node is not one of the nodes in the doubly linked list.\r
+\r
+**/\r
+BOOLEAN\r
+EFIAPI\r
+IsNull (\r
+  IN      CONST LIST_ENTRY          *List,\r
+  IN      CONST LIST_ENTRY          *Node\r
+  );\r
+\r
+/**\r
+  Determines if a node the last node in a doubly linked list.\r
+\r
+  Returns TRUE if Node is the last node in the doubly linked list specified by\r
+  List. Otherwise, FALSE is returned. List must have been initialized with\r
+  InitializeListHead().\r
+\r
+  If List is NULL, then ASSERT().\r
+  If Node is NULL, then ASSERT().\r
+  If List was not initialized with InitializeListHead(), then ASSERT().\r
+  If PcdMaximumLinkedListLenth is not zero, and List contains more than\r
+  PcdMaximumLinkedListLenth nodes, then ASSERT().\r
+  If Node is not a node in List, then ASSERT().\r
+\r
+  @param  List  A pointer to the head node of a doubly linked list.\r
+  @param  Node A pointer to a node in the doubly linked list.\r
+\r
+  @retval TRUE  Node is the last node in the linked list.\r
+  @retval FALSE Node is not the last node in the linked list.\r
+\r
+**/\r
+BOOLEAN\r
+EFIAPI\r
+IsNodeAtEnd (\r
+  IN      CONST LIST_ENTRY          *List,\r
+  IN      CONST LIST_ENTRY          *Node\r
+  );\r
+\r
+/**\r
+  Swaps the location of two nodes in a doubly linked list, and returns the\r
+  first node after the swap.\r
+\r
+  If FirstEntry is identical to SecondEntry, then SecondEntry is returned.\r
+  Otherwise, the location of the FirstEntry node is swapped with the location\r
+  of the SecondEntry node in a doubly linked list. SecondEntry must be in the\r
+  same double linked list as FirstEntry and that double linked list must have\r
+  been initialized with InitializeListHead(). SecondEntry is returned after the\r
+  nodes are swapped.\r
+\r
+  If FirstEntry is NULL, then ASSERT().\r
+  If SecondEntry is NULL, then ASSERT().\r
+  If SecondEntry and FirstEntry are not in the same linked list, then ASSERT().\r
+  If PcdMaximumLinkedListLenth is not zero, and the linked list containing\r
+  FirstEntry and SecondEntry contains more than PcdMaximumLinkedListLenth\r
+  nodes, then ASSERT().\r
+\r
+  @param  FirstEntry  A pointer to a node in a linked list.\r
+  @param  SecondEntry A pointer to another node in the same linked list.\r
+\r
+**/\r
+LIST_ENTRY *\r
+EFIAPI\r
+SwapListEntries (\r
+  IN      LIST_ENTRY                *FirstEntry,\r
+  IN      LIST_ENTRY                *SecondEntry\r
+  );\r
+\r
+/**\r
+  Removes a node from a doubly linked list, and returns the node that follows\r
+  the removed node.\r
+\r
+  Removes the node Entry from a doubly linked list. It is up to the caller of\r
+  this function to release the memory used by this node if that is required. On\r
+  exit, the node following Entry in the doubly linked list is returned. If\r
+  Entry is the only node in the linked list, then the head node of the linked\r
+  list is returned.\r
+\r
+  If Entry is NULL, then ASSERT().\r
+  If Entry is the head node of an empty list, then ASSERT().\r
+  If PcdMaximumLinkedListLenth is not zero, and the linked list containing\r
+  Entry contains more than PcdMaximumLinkedListLenth nodes, then ASSERT().\r
+\r
+  @param  Entry A pointer to a node in a linked list\r
+\r
+  @return Entry\r
+\r
+**/\r
+LIST_ENTRY *\r
+EFIAPI\r
+RemoveEntryList (\r
+  IN      CONST LIST_ENTRY          *Entry\r
+  );\r
+\r
+//\r
+// Math Services\r
+//\r
+\r
+/**\r
+  Shifts a 64-bit integer left between 0 and 63 bits. The low bits are filled\r
+  with zeros. The shifted value is returned.\r
+\r
+  This function shifts the 64-bit value Operand to the left by Count bits. The\r
+  low Count bits are set to zero. The shifted value is returned.\r
+\r
+  If Count is greater than 63, then ASSERT().\r
+\r
+  @param  Operand The 64-bit operand to shift left.\r
+  @param  Count   The number of bits to shift left.\r
+\r
+  @return Operand << Count\r
+\r
+**/\r
+UINT64\r
+EFIAPI\r
+LShiftU64 (\r
+  IN      UINT64                    Operand,\r
+  IN      UINTN                     Count\r
+  );\r
+\r
+/**\r
+  Shifts a 64-bit integer right between 0 and 63 bits. This high bits are\r
+  filled with zeros. The shifted value is returned.\r
+\r
+  This function shifts the 64-bit value Operand to the right by Count bits. The\r
+  high Count bits are set to zero. The shifted value is returned.\r
+\r
+  If Count is greater than 63, then ASSERT().\r
+\r
+  @param  Operand The 64-bit operand to shift right.\r
+  @param  Count   The number of bits to shift right.\r
+\r
+  @return Operand >> Count\r
+\r
+**/\r
+UINT64\r
+EFIAPI\r
+RShiftU64 (\r
+  IN      UINT64                    Operand,\r
+  IN      UINTN                     Count\r
+  );\r
+\r
+/**\r
+  Shifts a 64-bit integer right between 0 and 63 bits. The high bits are filled\r
+  with original integer's bit 63. The shifted value is returned.\r
+\r
+  This function shifts the 64-bit value Operand to the right by Count bits. The\r
+  high Count bits are set to bit 63 of Operand.  The shifted value is returned.\r
+\r
+  If Count is greater than 63, then ASSERT().\r
+\r
+  @param  Operand The 64-bit operand to shift right.\r
+  @param  Count   The number of bits to shift right.\r
+\r
+  @return Operand >> Count\r
+\r
+**/\r
+UINT64\r
+EFIAPI\r
+ARShiftU64 (\r
+  IN      UINT64                    Operand,\r
+  IN      UINTN                     Count\r
+  );\r
+\r
+/**\r
+  Rotates a 32-bit integer left between 0 and 31 bits, filling the low bits\r
+  with the high bits that were rotated.\r
+\r
+  This function rotates the 32-bit value Operand to the left by Count bits. The\r
+  low Count bits are fill with the high Count bits of Operand. The rotated\r
+  value is returned.\r
+\r
+  If Count is greater than 31, then ASSERT().\r
+\r
+  @param  Operand The 32-bit operand to rotate left.\r
+  @param  Count   The number of bits to rotate left.\r
+\r
+  @return Operand <<< Count\r
+\r
+**/\r
+UINT32\r
+EFIAPI\r
+LRotU32 (\r
+  IN      UINT32                    Operand,\r
+  IN      UINTN                     Count\r
+  );\r
+\r
+/**\r
+  Rotates a 32-bit integer right between 0 and 31 bits, filling the high bits\r
+  with the low bits that were rotated.\r
+\r
+  This function rotates the 32-bit value Operand to the right by Count bits.\r
+  The high Count bits are fill with the low Count bits of Operand. The rotated\r
+  value is returned.\r
+\r
+  If Count is greater than 31, then ASSERT().\r
+\r
+  @param  Operand The 32-bit operand to rotate right.\r
+  @param  Count   The number of bits to rotate right.\r
+\r
+  @return Operand >>> Count\r
+\r
+**/\r
+UINT32\r
+EFIAPI\r
+RRotU32 (\r
+  IN      UINT32                    Operand,\r
+  IN      UINTN                     Count\r
+  );\r
+\r
+/**\r
+  Rotates a 64-bit integer left between 0 and 63 bits, filling the low bits\r
+  with the high bits that were rotated.\r
+\r
+  This function rotates the 64-bit value Operand to the left by Count bits. The\r
+  low Count bits are fill with the high Count bits of Operand. The rotated\r
+  value is returned.\r
+\r
+  If Count is greater than 63, then ASSERT().\r
+\r
+  @param  Operand The 64-bit operand to rotate left.\r
+  @param  Count   The number of bits to rotate left.\r
+\r
+  @return Operand <<< Count\r
+\r
+**/\r
+UINT64\r
+EFIAPI\r
+LRotU64 (\r
+  IN      UINT64                    Operand,\r
+  IN      UINTN                     Count\r
+  );\r
+\r
+/**\r
+  Rotates a 64-bit integer right between 0 and 63 bits, filling the high bits\r
+  with the high low bits that were rotated.\r
+\r
+  This function rotates the 64-bit value Operand to the right by Count bits.\r
+  The high Count bits are fill with the low Count bits of Operand. The rotated\r
+  value is returned.\r
+\r
+  If Count is greater than 63, then ASSERT().\r
+\r
+  @param  Operand The 64-bit operand to rotate right.\r
+  @param  Count   The number of bits to rotate right.\r
+\r
+  @return Operand >>> Count\r
+\r
+**/\r
+UINT64\r
+EFIAPI\r
+RRotU64 (\r
+  IN      UINT64                    Operand,\r
+  IN      UINTN                     Count\r
+  );\r
+\r
+/**\r
+  Returns the bit position of the lowest bit set in a 32-bit value.\r
+\r
+  This function computes the bit position of the lowest bit set in the 32-bit\r
+  value specified by Operand. If Operand is zero, then -1 is returned.\r
+  Otherwise, a value between 0 and 31 is returned.\r
+\r
+  @param  Operand The 32-bit operand to evaluate.\r
+\r
+  @return Position of the lowest bit set in Operand if found.\r
+  @retval -1 Operand is zero.\r
+\r
+**/\r
+INTN\r
+EFIAPI\r
+LowBitSet32 (\r
+  IN      UINT32                    Operand\r
+  );\r
+\r
+/**\r
+  Returns the bit position of the lowest bit set in a 64-bit value.\r
+\r
+  This function computes the bit position of the lowest bit set in the 64-bit\r
+  value specified by Operand. If Operand is zero, then -1 is returned.\r
+  Otherwise, a value between 0 and 63 is returned.\r
+\r
+  @param  Operand The 64-bit operand to evaluate.\r
+\r
+  @return Position of the lowest bit set in Operand if found.\r
+  @retval -1  Operand is zero.\r
+\r
+**/\r
+INTN\r
+EFIAPI\r
+LowBitSet64 (\r
+  IN      UINT64                    Operand\r
+  );\r
+\r
+/**\r
+  Returns the bit position of the highest bit set in a 32-bit value. Equivalent\r
+  to log2(x).\r
+\r
+  This function computes the bit position of the highest bit set in the 32-bit\r
+  value specified by Operand. If Operand is zero, then -1 is returned.\r
+  Otherwise, a value between 0 and 31 is returned.\r
+\r
+  @param  Operand The 32-bit operand to evaluate.\r
+\r
+  @return Position of the highest bit set in Operand if found.\r
+  @retval -1  Operand is zero.\r
+\r
+**/\r
+INTN\r
+EFIAPI\r
+HighBitSet32 (\r
+  IN      UINT32                    Operand\r
+  );\r
+\r
+/**\r
+  Returns the bit position of the highest bit set in a 64-bit value. Equivalent\r
+  to log2(x).\r
+\r
+  This function computes the bit position of the highest bit set in the 64-bit\r
+  value specified by Operand. If Operand is zero, then -1 is returned.\r
+  Otherwise, a value between 0 and 63 is returned.\r
+\r
+  @param  Operand The 64-bit operand to evaluate.\r
+\r
+  @return Position of the highest bit set in Operand if found.\r
+  @retval -1  Operand is zero.\r
+\r
+**/\r
+INTN\r
+EFIAPI\r
+HighBitSet64 (\r
+  IN      UINT64                    Operand\r
+  );\r
+\r
+/**\r
+  Returns the value of the highest bit set in a 32-bit value. Equivalent to\r
+  1 << HighBitSet32(x).\r
+\r
+  This function computes the value of the highest bit set in the 32-bit value\r
+  specified by Operand. If Operand is zero, then zero is returned.\r
+\r
+  @param  Operand The 32-bit operand to evaluate.\r
+\r
+  @return 1 << HighBitSet32(Operand)\r
+  @retval 0 Operand is zero.\r
+\r
+**/\r
+UINT32\r
+EFIAPI\r
+GetPowerOfTwo32 (\r
+  IN      UINT32                    Operand\r
+  );\r
+\r
+/**\r
+  Returns the value of the highest bit set in a 64-bit value. Equivalent to\r
+  1 << HighBitSet64(x).\r
+\r
+  This function computes the value of the highest bit set in the 64-bit value\r
+  specified by Operand. If Operand is zero, then zero is returned.\r
+\r
+  @param  Operand The 64-bit operand to evaluate.\r
+\r
+  @return 1 << HighBitSet64(Operand)\r
+  @retval 0 Operand is zero.\r
+\r
+**/\r
+UINT64\r
+EFIAPI\r
+GetPowerOfTwo64 (\r
+  IN      UINT64                    Operand\r
+  );\r
+\r
+/**\r
+  Switches the endianess of a 16-bit integer.\r
+\r
+  This function swaps the bytes in a 16-bit unsigned value to switch the value\r
+  from little endian to big endian or vice versa. The byte swapped value is\r
+  returned.\r
+\r
+  @param  Operand A 16-bit unsigned value.\r
+\r
+  @return The byte swaped Operand.\r
+\r
+**/\r
+UINT16\r
+EFIAPI\r
+SwapBytes16 (\r
+  IN      UINT16                    Value\r
+  );\r
+\r
+/**\r
+  Switches the endianess of a 32-bit integer.\r
+\r
+  This function swaps the bytes in a 32-bit unsigned value to switch the value\r
+  from little endian to big endian or vice versa. The byte swapped value is\r
+  returned.\r
+\r
+  @param  Operand A 32-bit unsigned value.\r
+\r
+  @return The byte swaped Operand.\r
+\r
+**/\r
+UINT32\r
+EFIAPI\r
+SwapBytes32 (\r
+  IN      UINT32                    Value\r
+  );\r
+\r
+/**\r
+  Switches the endianess of a 64-bit integer.\r
+\r
+  This function swaps the bytes in a 64-bit unsigned value to switch the value\r
+  from little endian to big endian or vice versa. The byte swapped value is\r
+  returned.\r
+\r
+  @param  Operand A 64-bit unsigned value.\r
+\r
+  @return The byte swaped Operand.\r
+\r
+**/\r
+UINT64\r
+EFIAPI\r
+SwapBytes64 (\r
+  IN      UINT64                    Value\r
+  );\r
+\r
+/**\r
+  Multiples a 64-bit unsigned integer by a 32-bit unsigned integer and\r
+  generates a 64-bit unsigned result.\r
+\r
+  This function multiples the 64-bit unsigned value Multiplicand by the 32-bit\r
+  unsigned value Multiplier and generates a 64-bit unsigned result. This 64-\r
+  bit unsigned result is returned.\r
+\r
+  If the result overflows, then ASSERT().\r
+\r
+  @param  Multiplicand  A 64-bit unsigned value.\r
+  @param  Multiplier    A 32-bit unsigned value.\r
+\r
+  @return Multiplicand * Multiplier\r
+\r
+**/\r
+UINT64\r
+EFIAPI\r
+MultU64x32 (\r
+  IN      UINT64                    Multiplicand,\r
+  IN      UINT32                    Multiplier\r
+  );\r
+\r
+/**\r
+  Multiples a 64-bit unsigned integer by a 64-bit unsigned integer and\r
+  generates a 64-bit unsigned result.\r
+\r
+  This function multiples the 64-bit unsigned value Multiplicand by the 64-bit\r
+  unsigned value Multiplier and generates a 64-bit unsigned result. This 64-\r
+  bit unsigned result is returned.\r
+\r
+  If the result overflows, then ASSERT().\r
+\r
+  @param  Multiplicand  A 64-bit unsigned value.\r
+  @param  Multiplier    A 64-bit unsigned value.\r
+\r
+  @return Multiplicand * Multiplier\r
+\r
+**/\r
+UINT64\r
+EFIAPI\r
+MultU64x64 (\r
+  IN      UINT64                    Multiplicand,\r
+  IN      UINT64                    Multiplier\r
+  );\r
+\r
+/**\r
+  Multiples a 64-bit signed integer by a 64-bit signed integer and generates a\r
+  64-bit signed result.\r
+\r
+  This function multiples the 64-bit signed value Multiplicand by the 64-bit\r
+  signed value Multiplier and generates a 64-bit signed result. This 64-bit\r
+  signed result is returned.\r
+\r
+  If the result overflows, then ASSERT().\r
+\r
+  @param  Multiplicand  A 64-bit signed value.\r
+  @param  Multiplier    A 64-bit signed value.\r
+\r
+  @return Multiplicand * Multiplier\r
+\r
+**/\r
+INT64\r
+EFIAPI\r
+MultS64x64 (\r
+  IN      INT64                     Multiplicand,\r
+  IN      INT64                     Multiplier\r
+  );\r
+\r
+/**\r
+  Divides a 64-bit unsigned integer by a 32-bit unsigned integer and generates\r
+  a 64-bit unsigned result.\r
+\r
+  This function divides the 64-bit unsigned value Dividend by the 32-bit\r
+  unsigned value Divisor and generates a 64-bit unsigned quotient. This\r
+  function returns the 64-bit unsigned quotient.\r
+\r
+  If Divisor is 0, then ASSERT().\r
+\r
+  @param  Dividend  A 64-bit unsigned value.\r
+  @param  Divisor   A 32-bit unsigned value.\r
+\r
+  @return Dividend / Divisor\r
+\r
+**/\r
+UINT64\r
+EFIAPI\r
+DivU64x32 (\r
+  IN      UINT64                    Dividend,\r
+  IN      UINT32                    Divisor\r
+  );\r
+\r
+/**\r
+  Divides a 64-bit unsigned integer by a 32-bit unsigned integer and generates\r
+  a 32-bit unsigned remainder.\r
+\r
+  This function divides the 64-bit unsigned value Dividend by the 32-bit\r
+  unsigned value Divisor and generates a 32-bit remainder. This function\r
+  returns the 32-bit unsigned remainder.\r
+\r
+  If Divisor is 0, then ASSERT().\r
+\r
+  @param  Dividend  A 64-bit unsigned value.\r
+  @param  Divisor   A 32-bit unsigned value.\r
+\r
+  @return Dividend % Divisor\r
+\r
+**/\r
+UINT32\r
+EFIAPI\r
+ModU64x32 (\r
+  IN      UINT64                    Dividend,\r
+  IN      UINT32                    Divisor\r
+  );\r
+\r
+/**\r
+  Divides a 64-bit unsigned integer by a 32-bit unsigned integer and generates\r
+  a 64-bit unsigned result and an optional 32-bit unsigned remainder.\r
+\r
+  This function divides the 64-bit unsigned value Dividend by the 32-bit\r
+  unsigned value Divisor and generates a 64-bit unsigned quotient. If Remainder\r
+  is not NULL, then the 32-bit unsigned remainder is returned in Remainder.\r
+  This function returns the 64-bit unsigned quotient.\r
+\r
+  If Divisor is 0, then ASSERT().\r
+\r
+  @param  Dividend  A 64-bit unsigned value.\r
+  @param  Divisor   A 32-bit unsigned value.\r
+  @param  Remainder A pointer to a 32-bit unsigned value. This parameter is\r
+                    optional and may be NULL.\r
+\r
+  @return Dividend / Divisor\r
+\r
+**/\r
+UINT64\r
+EFIAPI\r
+DivU64x32Remainder (\r
+  IN      UINT64                    Dividend,\r
+  IN      UINT32                    Divisor,\r
+  OUT     UINT32                    *Remainder  OPTIONAL\r
+  );\r
+\r
+/**\r
+  Divides a 64-bit unsigned integer by a 64-bit unsigned integer and generates\r
+  a 64-bit unsigned result and an optional 64-bit unsigned remainder.\r
+\r
+  This function divides the 64-bit unsigned value Dividend by the 64-bit\r
+  unsigned value Divisor and generates a 64-bit unsigned quotient. If Remainder\r
+  is not NULL, then the 64-bit unsigned remainder is returned in Remainder.\r
+  This function returns the 64-bit unsigned quotient.\r
+\r
+  If Divisor is 0, then ASSERT().\r
+\r
+  @param  Dividend  A 64-bit unsigned value.\r
+  @param  Divisor   A 64-bit unsigned value.\r
+  @param  Remainder A pointer to a 64-bit unsigned value. This parameter is\r
+                    optional and may be NULL.\r
+\r
+  @return Dividend / Divisor\r
+\r
+**/\r
+UINT64\r
+EFIAPI\r
+DivU64x64Remainder (\r
+  IN      UINT64                    Dividend,\r
+  IN      UINT64                    Divisor,\r
+  OUT     UINT64                    *Remainder  OPTIONAL\r
+  );\r
+\r
+/**\r
+  Divides a 64-bit signed integer by a 64-bit signed integer and generates a\r
+  64-bit signed result and a optional 64-bit signed remainder.\r
+\r
+  This function divides the 64-bit signed value Dividend by the 64-bit signed\r
+  value Divisor and generates a 64-bit signed quotient. If Remainder is not\r
+  NULL, then the 64-bit signed remainder is returned in Remainder. This\r
+  function returns the 64-bit signed quotient.\r
+\r
+  If Divisor is 0, then ASSERT().\r
+\r
+  @param  Dividend  A 64-bit signed value.\r
+  @param  Divisor   A 64-bit signed value.\r
+  @param  Remainder A pointer to a 64-bit signed value. This parameter is\r
+                    optional and may be NULL.\r
+\r
+  @return Dividend / Divisor\r
+\r
+**/\r
+INT64\r
+EFIAPI\r
+DivS64x64Remainder (\r
+  IN      INT64                     Dividend,\r
+  IN      INT64                     Divisor,\r
+  OUT     INT64                     *Remainder  OPTIONAL\r
+  );\r
+\r
+/**\r
+  Reads a 16-bit value from memory that may be unaligned.\r
+\r
+  This function returns the 16-bit value pointed to by Buffer. The function\r
+  guarantees that the read operation does not produce an alignment fault.\r
+\r
+  If the Buffer is NULL, then ASSERT().\r
+\r
+  @param  Buffer  Pointer to a 16-bit value that may be unaligned.\r
+\r
+  @return *Uint16\r
+\r
+**/\r
+UINT16\r
+EFIAPI\r
+ReadUnaligned16 (\r
+  IN      CONST UINT16              *Uint16\r
+  );\r
+\r
+/**\r
+  Writes a 16-bit value to memory that may be unaligned.\r
+\r
+  This function writes the 16-bit value specified by Value to Buffer. Value is\r
+  returned. The function guarantees that the write operation does not produce\r
+  an alignment fault.\r
+\r
+  If the Buffer is NULL, then ASSERT().\r
+\r
+  @param  Buffer  Pointer to a 16-bit value that may be unaligned.\r
+  @param  Value   16-bit value to write to Buffer.\r
+\r
+  @return Value\r
+\r
+**/\r
+UINT16\r
+EFIAPI\r
+WriteUnaligned16 (\r
+  OUT     UINT16                    *Uint16,\r
+  IN      UINT16                    Value\r
+  );\r
+\r
+/**\r
+  Reads a 24-bit value from memory that may be unaligned.\r
+\r
+  This function returns the 24-bit value pointed to by Buffer. The function\r
+  guarantees that the read operation does not produce an alignment fault.\r
+\r
+  If the Buffer is NULL, then ASSERT().\r
+\r
+  @param  Buffer  Pointer to a 24-bit value that may be unaligned.\r
+\r
+  @return The value read.\r
+\r
+**/\r
+UINT32\r
+EFIAPI\r
+ReadUnaligned24 (\r
+  IN      CONST UINT32              *Buffer\r
+  );\r
+\r
+/**\r
+  Writes a 24-bit value to memory that may be unaligned.\r
+\r
+  This function writes the 24-bit value specified by Value to Buffer. Value is\r
+  returned. The function guarantees that the write operation does not produce\r
+  an alignment fault.\r
+\r
+  If the Buffer is NULL, then ASSERT().\r
+\r
+  @param  Buffer  Pointer to a 24-bit value that may be unaligned.\r
+  @param  Value   24-bit value to write to Buffer.\r
+\r
+  @return The value written.\r
+\r
+**/\r
+UINT32\r
+EFIAPI\r
+WriteUnaligned24 (\r
+  OUT     UINT32                    *Buffer,\r
+  IN      UINT32                    Value\r
+  );\r
+\r
+/**\r
+  Reads a 32-bit value from memory that may be unaligned.\r
+\r
+  This function returns the 32-bit value pointed to by Buffer. The function\r
+  guarantees that the read operation does not produce an alignment fault.\r
+\r
+  If the Buffer is NULL, then ASSERT().\r
+\r
+  @param  Buffer  Pointer to a 32-bit value that may be unaligned.\r
+\r
+  @return *Uint32\r
+\r
+**/\r
+UINT32\r
+EFIAPI\r
+ReadUnaligned32 (\r
+  IN      CONST UINT32              *Uint32\r
+  );\r
+\r
+/**\r
+  Writes a 32-bit value to memory that may be unaligned.\r
+\r
+  This function writes the 32-bit value specified by Value to Buffer. Value is\r
+  returned. The function guarantees that the write operation does not produce\r
+  an alignment fault.\r
+\r
+  If the Buffer is NULL, then ASSERT().\r
+\r
+  @param  Buffer  Pointer to a 32-bit value that may be unaligned.\r
+  @param  Value   32-bit value to write to Buffer.\r
+\r
+  @return Value\r
+\r
+**/\r
+UINT32\r
+EFIAPI\r
+WriteUnaligned32 (\r
+  OUT     UINT32                    *Uint32,\r
+  IN      UINT32                    Value\r
+  );\r
+\r
+/**\r
+  Reads a 64-bit value from memory that may be unaligned.\r
+\r
+  This function returns the 64-bit value pointed to by Buffer. The function\r
+  guarantees that the read operation does not produce an alignment fault.\r
+\r
+  If the Buffer is NULL, then ASSERT().\r
+\r
+  @param  Buffer  Pointer to a 64-bit value that may be unaligned.\r
+\r
+  @return *Uint64\r
+\r
+**/\r
+UINT64\r
+EFIAPI\r
+ReadUnaligned64 (\r
+  IN      CONST UINT64              *Uint64\r
+  );\r
+\r
+/**\r
+  Writes a 64-bit value to memory that may be unaligned.\r
+\r
+  This function writes the 64-bit value specified by Value to Buffer. Value is\r
+  returned. The function guarantees that the write operation does not produce\r
+  an alignment fault.\r
+\r
+  If the Buffer is NULL, then ASSERT().\r
+\r
+  @param  Buffer  Pointer to a 64-bit value that may be unaligned.\r
+  @param  Value   64-bit value to write to Buffer.\r
+\r
+  @return Value\r
+\r
+**/\r
+UINT64\r
+EFIAPI\r
+WriteUnaligned64 (\r
+  OUT     UINT64                    *Uint64,\r
+  IN      UINT64                    Value\r
+  );\r
+\r
+//\r
+// Bit Field Functions\r
+//\r
+\r
+/**\r
+  Returns a bit field from an 8-bit value.\r
+\r
+  Returns the bitfield specified by the StartBit and the EndBit from Operand.\r
+\r
+  If 8-bit operations are not supported, then ASSERT().\r
+  If StartBit is greater than 7, then ASSERT().\r
+  If EndBit is greater than 7, then ASSERT().\r
+  If EndBit is less than or equal to StartBit, then ASSERT().\r
+\r
+  @param  Operand   Operand on which to perform the bitfield operation.\r
+  @param  StartBit  The ordinal of the least significant bit in the bit field.\r
+                    Range 0..7.\r
+  @param  EndBit    The ordinal of the most significant bit in the bit field.\r
+                    Range 0..7.\r
+\r
+  @return The bit field read.\r
+\r
+**/\r
+UINT8\r
+EFIAPI\r
+BitFieldRead8 (\r
+  IN      UINT8                     Operand,\r
+  IN      UINTN                     StartBit,\r
+  IN      UINTN                     EndBit\r
+  );\r
+\r
+/**\r
+  Writes a bit field to an 8-bit value, and returns the result.\r
+\r
+  Writes Value to the bit field specified by the StartBit and the EndBit in\r
+  Operand. All other bits in Operand are preserved. The new 8-bit value is\r
+  returned.\r
+\r
+  If 8-bit operations are not supported, then ASSERT().\r
+  If StartBit is greater than 7, then ASSERT().\r
+  If EndBit is greater than 7, then ASSERT().\r
+  If EndBit is less than or equal to StartBit, then ASSERT().\r
+\r
+  @param  Operand   Operand on which to perform the bitfield operation.\r
+  @param  StartBit  The ordinal of the least significant bit in the bit field.\r
+                    Range 0..7.\r
+  @param  EndBit    The ordinal of the most significant bit in the bit field.\r
+                    Range 0..7.\r
+  @param  Value     New value of the bit field.\r
+\r
+  @return The new 8-bit value.\r
+\r
+**/\r
+UINT8\r
+EFIAPI\r
+BitFieldWrite8 (\r
+  IN      UINT8                     Operand,\r
+  IN      UINTN                     StartBit,\r
+  IN      UINTN                     EndBit,\r
+  IN      UINT8                     Value\r
+  );\r
+\r
+/**\r
+  Reads a bit field from an 8-bit value, performs a bitwise OR, and returns the\r
+  result.\r
+\r
+  Performs a bitwise inclusive OR between the bit field specified by StartBit\r
+  and EndBit in Operand and the value specified by OrData. All other bits in\r
+  Operand are preserved. The new 8-bit value is returned.\r
+\r
+  If 8-bit operations are not supported, then ASSERT().\r
+  If StartBit is greater than 7, then ASSERT().\r
+  If EndBit is greater than 7, then ASSERT().\r
+  If EndBit is less than or equal to StartBit, then ASSERT().\r
+\r
+  @param  Operand   Operand on which to perform the bitfield operation.\r
+  @param  StartBit  The ordinal of the least significant bit in the bit field.\r
+                    Range 0..7.\r
+  @param  EndBit    The ordinal of the most significant bit in the bit field.\r
+                    Range 0..7.\r
+  @param  OrData    The value to OR with the read value from the value\r
+\r
+  @return The new 8-bit value.\r
+\r
+**/\r
+UINT8\r
+EFIAPI\r
+BitFieldOr8 (\r
+  IN      UINT8                     Operand,\r
+  IN      UINTN                     StartBit,\r
+  IN      UINTN                     EndBit,\r
+  IN      UINT8                     OrData\r
+  );\r
+\r
+/**\r
+  Reads a bit field from an 8-bit value, performs a bitwise AND, and returns\r
+  the result.\r
+\r
+  Performs a bitwise AND between the bit field specified by StartBit and EndBit\r
+  in Operand and the value specified by AndData. All other bits in Operand are\r
+  preserved. The new 8-bit value is returned.\r
+\r
+  If 8-bit operations are not supported, then ASSERT().\r
+  If StartBit is greater than 7, then ASSERT().\r
+  If EndBit is greater than 7, then ASSERT().\r
+  If EndBit is less than or equal to StartBit, then ASSERT().\r
+\r
+  @param  Operand   Operand on which to perform the bitfield operation.\r
+  @param  StartBit  The ordinal of the least significant bit in the bit field.\r
+                    Range 0..7.\r
+  @param  EndBit    The ordinal of the most significant bit in the bit field.\r
+                    Range 0..7.\r
+  @param  AndData   The value to AND with the read value from the value.\r
+\r
+  @return The new 8-bit value.\r
+\r
+**/\r
+UINT8\r
+EFIAPI\r
+BitFieldAnd8 (\r
+  IN      UINT8                     Operand,\r
+  IN      UINTN                     StartBit,\r
+  IN      UINTN                     EndBit,\r
+  IN      UINT8                     AndData\r
+  );\r
+\r
+/**\r
+  Reads a bit field from an 8-bit value, performs a bitwise AND followed by a\r
+  bitwise OR, and returns the result.\r
+\r
+  Performs a bitwise AND between the bit field specified by StartBit and EndBit\r
+  in Operand and the value specified by AndData, followed by a bitwise\r
+  inclusive OR with value specified by OrData. All other bits in Operand are\r
+  preserved. The new 8-bit value is returned.\r
+\r
+  If 8-bit operations are not supported, then ASSERT().\r
+  If StartBit is greater than 7, then ASSERT().\r
+  If EndBit is greater than 7, then ASSERT().\r
+  If EndBit is less than or equal to StartBit, then ASSERT().\r
+\r
+  @param  Operand   Operand on which to perform the bitfield operation.\r
+  @param  StartBit  The ordinal of the least significant bit in the bit field.\r
+                    Range 0..7.\r
+  @param  EndBit    The ordinal of the most significant bit in the bit field.\r
+                    Range 0..7.\r
+  @param  AndData   The value to AND with the read value from the value.\r
+  @param  OrData    The value to OR with the result of the AND operation.\r
+\r
+  @return The new 8-bit value.\r
+\r
+**/\r
+UINT8\r
+EFIAPI\r
+BitFieldAndThenOr8 (\r
+  IN      UINT8                     Operand,\r
+  IN      UINTN                     StartBit,\r
+  IN      UINTN                     EndBit,\r
+  IN      UINT8                     AndData,\r
+  IN      UINT8                     OrData\r
+  );\r
+\r
+/**\r
+  Returns a bit field from a 16-bit value.\r
+\r
+  Returns the bitfield specified by the StartBit and the EndBit from Operand.\r
+\r
+  If 16-bit operations are not supported, then ASSERT().\r
+  If StartBit is greater than 15, then ASSERT().\r
+  If EndBit is greater than 15, then ASSERT().\r
+  If EndBit is less than or equal to StartBit, then ASSERT().\r
+\r
+  @param  Operand   Operand on which to perform the bitfield operation.\r
+  @param  StartBit  The ordinal of the least significant bit in the bit field.\r
+                    Range 0..15.\r
+  @param  EndBit    The ordinal of the most significant bit in the bit field.\r
+                    Range 0..15.\r
+\r
+  @return The bit field read.\r
+\r
+**/\r
+UINT16\r
+EFIAPI\r
+BitFieldRead16 (\r
+  IN      UINT16                    Operand,\r
+  IN      UINTN                     StartBit,\r
+  IN      UINTN                     EndBit\r
+  );\r
+\r
+/**\r
+  Writes a bit field to a 16-bit value, and returns the result.\r
+\r
+  Writes Value to the bit field specified by the StartBit and the EndBit in\r
+  Operand. All other bits in Operand are preserved. The new 16-bit value is\r
+  returned.\r
+\r
+  If 16-bit operations are not supported, then ASSERT().\r
+  If StartBit is greater than 15, then ASSERT().\r
+  If EndBit is greater than 15, then ASSERT().\r
+  If EndBit is less than or equal to StartBit, then ASSERT().\r
+\r
+  @param  Operand   Operand on which to perform the bitfield operation.\r
+  @param  StartBit  The ordinal of the least significant bit in the bit field.\r
+                    Range 0..15.\r
+  @param  EndBit    The ordinal of the most significant bit in the bit field.\r
+                    Range 0..15.\r
+  @param  Value     New value of the bit field.\r
+\r
+  @return The new 16-bit value.\r
+\r
+**/\r
+UINT16\r
+EFIAPI\r
+BitFieldWrite16 (\r
+  IN      UINT16                    Operand,\r
+  IN      UINTN                     StartBit,\r
+  IN      UINTN                     EndBit,\r
+  IN      UINT16                    Value\r
+  );\r
+\r
+/**\r
+  Reads a bit field from a 16-bit value, performs a bitwise OR, and returns the\r
+  result.\r
+\r
+  Performs a bitwise inclusive OR between the bit field specified by StartBit\r
+  and EndBit in Operand and the value specified by OrData. All other bits in\r
+  Operand are preserved. The new 16-bit value is returned.\r
+\r
+  If 16-bit operations are not supported, then ASSERT().\r
+  If StartBit is greater than 15, then ASSERT().\r
+  If EndBit is greater than 15, then ASSERT().\r
+  If EndBit is less than or equal to StartBit, then ASSERT().\r
+\r
+  @param  Operand   Operand on which to perform the bitfield operation.\r
+  @param  StartBit  The ordinal of the least significant bit in the bit field.\r
+                    Range 0..15.\r
+  @param  EndBit    The ordinal of the most significant bit in the bit field.\r
+                    Range 0..15.\r
+  @param  OrData    The value to OR with the read value from the value\r
+\r
+  @return The new 16-bit value.\r
+\r
+**/\r
+UINT16\r
+EFIAPI\r
+BitFieldOr16 (\r
+  IN      UINT16                    Operand,\r
+  IN      UINTN                     StartBit,\r
+  IN      UINTN                     EndBit,\r
+  IN      UINT16                    OrData\r
+  );\r
+\r
+/**\r
+  Reads a bit field from a 16-bit value, performs a bitwise AND, and returns\r
+  the result.\r
+\r
+  Performs a bitwise AND between the bit field specified by StartBit and EndBit\r
+  in Operand and the value specified by AndData. All other bits in Operand are\r
+  preserved. The new 16-bit value is returned.\r
+\r
+  If 16-bit operations are not supported, then ASSERT().\r
+  If StartBit is greater than 15, then ASSERT().\r
+  If EndBit is greater than 15, then ASSERT().\r
+  If EndBit is less than or equal to StartBit, then ASSERT().\r
+\r
+  @param  Operand   Operand on which to perform the bitfield operation.\r
+  @param  StartBit  The ordinal of the least significant bit in the bit field.\r
+                    Range 0..15.\r
+  @param  EndBit    The ordinal of the most significant bit in the bit field.\r
+                    Range 0..15.\r
+  @param  AndData   The value to AND with the read value from the value\r
+\r
+  @return The new 16-bit value.\r
+\r
+**/\r
+UINT16\r
+EFIAPI\r
+BitFieldAnd16 (\r
+  IN      UINT16                    Operand,\r
+  IN      UINTN                     StartBit,\r
+  IN      UINTN                     EndBit,\r
+  IN      UINT16                    AndData\r
+  );\r
+\r
+/**\r
+  Reads a bit field from a 16-bit value, performs a bitwise AND followed by a\r
+  bitwise OR, and returns the result.\r
+\r
+  Performs a bitwise AND between the bit field specified by StartBit and EndBit\r
+  in Operand and the value specified by AndData, followed by a bitwise\r
+  inclusive OR with value specified by OrData. All other bits in Operand are\r
+  preserved. The new 16-bit value is returned.\r
+\r
+  If 16-bit operations are not supported, then ASSERT().\r
+  If StartBit is greater than 15, then ASSERT().\r
+  If EndBit is greater than 15, then ASSERT().\r
+  If EndBit is less than or equal to StartBit, then ASSERT().\r
+\r
+  @param  Operand   Operand on which to perform the bitfield operation.\r
+  @param  StartBit  The ordinal of the least significant bit in the bit field.\r
+                    Range 0..15.\r
+  @param  EndBit    The ordinal of the most significant bit in the bit field.\r
+                    Range 0..15.\r
+  @param  AndData   The value to AND with the read value from the value.\r
+  @param  OrData    The value to OR with the result of the AND operation.\r
+\r
+  @return The new 16-bit value.\r
+\r
+**/\r
+UINT16\r
+EFIAPI\r
+BitFieldAndThenOr16 (\r
+  IN      UINT16                    Operand,\r
+  IN      UINTN                     StartBit,\r
+  IN      UINTN                     EndBit,\r
+  IN      UINT16                    AndData,\r
+  IN      UINT16                    OrData\r
+  );\r
+\r
+/**\r
+  Returns a bit field from a 32-bit value.\r
+\r
+  Returns the bitfield specified by the StartBit and the EndBit from Operand.\r
+\r
+  If 32-bit operations are not supported, then ASSERT().\r
+  If StartBit is greater than 31, then ASSERT().\r
+  If EndBit is greater than 31, then ASSERT().\r
+  If EndBit is less than or equal to StartBit, then ASSERT().\r
+\r
+  @param  Operand   Operand on which to perform the bitfield operation.\r
+  @param  StartBit  The ordinal of the least significant bit in the bit field.\r
+                    Range 0..31.\r
+  @param  EndBit    The ordinal of the most significant bit in the bit field.\r
+                    Range 0..31.\r
+\r
+  @return The bit field read.\r
+\r
+**/\r
+UINT32\r
+EFIAPI\r
+BitFieldRead32 (\r
+  IN      UINT32                    Operand,\r
+  IN      UINTN                     StartBit,\r
+  IN      UINTN                     EndBit\r
+  );\r
+\r
+/**\r
+  Writes a bit field to a 32-bit value, and returns the result.\r
+\r
+  Writes Value to the bit field specified by the StartBit and the EndBit in\r
+  Operand. All other bits in Operand are preserved. The new 32-bit value is\r
+  returned.\r
+\r
+  If 32-bit operations are not supported, then ASSERT().\r
+  If StartBit is greater than 31, then ASSERT().\r
+  If EndBit is greater than 31, then ASSERT().\r
+  If EndBit is less than or equal to StartBit, then ASSERT().\r
+\r
+  @param  Operand   Operand on which to perform the bitfield operation.\r
+  @param  StartBit  The ordinal of the least significant bit in the bit field.\r
+                    Range 0..31.\r
+  @param  EndBit    The ordinal of the most significant bit in the bit field.\r
+                    Range 0..31.\r
+  @param  Value     New value of the bit field.\r
+\r
+  @return The new 32-bit value.\r
+\r
+**/\r
+UINT32\r
+EFIAPI\r
+BitFieldWrite32 (\r
+  IN      UINT32                    Operand,\r
+  IN      UINTN                     StartBit,\r
+  IN      UINTN                     EndBit,\r
+  IN      UINT32                    Value\r
+  );\r
+\r
+/**\r
+  Reads a bit field from a 32-bit value, performs a bitwise OR, and returns the\r
+  result.\r
+\r
+  Performs a bitwise inclusive OR between the bit field specified by StartBit\r
+  and EndBit in Operand and the value specified by OrData. All other bits in\r
+  Operand are preserved. The new 32-bit value is returned.\r
+\r
+  If 32-bit operations are not supported, then ASSERT().\r
+  If StartBit is greater than 31, then ASSERT().\r
+  If EndBit is greater than 31, then ASSERT().\r
+  If EndBit is less than or equal to StartBit, then ASSERT().\r
+\r
+  @param  Operand   Operand on which to perform the bitfield operation.\r
+  @param  StartBit  The ordinal of the least significant bit in the bit field.\r
+                    Range 0..31.\r
+  @param  EndBit    The ordinal of the most significant bit in the bit field.\r
+                    Range 0..31.\r
+  @param  OrData    The value to OR with the read value from the value\r
+\r
+  @return The new 32-bit value.\r
+\r
+**/\r
+UINT32\r
+EFIAPI\r
+BitFieldOr32 (\r
+  IN      UINT32                    Operand,\r
+  IN      UINTN                     StartBit,\r
+  IN      UINTN                     EndBit,\r
+  IN      UINT32                    OrData\r
+  );\r
+\r
+/**\r
+  Reads a bit field from a 32-bit value, performs a bitwise AND, and returns\r
+  the result.\r
+\r
+  Performs a bitwise AND between the bit field specified by StartBit and EndBit\r
+  in Operand and the value specified by AndData. All other bits in Operand are\r
+  preserved. The new 32-bit value is returned.\r
+\r
+  If 32-bit operations are not supported, then ASSERT().\r
+  If StartBit is greater than 31, then ASSERT().\r
+  If EndBit is greater than 31, then ASSERT().\r
+  If EndBit is less than or equal to StartBit, then ASSERT().\r
+\r
+  @param  Operand   Operand on which to perform the bitfield operation.\r
+  @param  StartBit  The ordinal of the least significant bit in the bit field.\r
+                    Range 0..31.\r
+  @param  EndBit    The ordinal of the most significant bit in the bit field.\r
+                    Range 0..31.\r
+  @param  AndData   The value to AND with the read value from the value\r
+\r
+  @return The new 32-bit value.\r
+\r
+**/\r
+UINT32\r
+EFIAPI\r
+BitFieldAnd32 (\r
+  IN      UINT32                    Operand,\r
+  IN      UINTN                     StartBit,\r
+  IN      UINTN                     EndBit,\r
+  IN      UINT32                    AndData\r
+  );\r
+\r
+/**\r
+  Reads a bit field from a 32-bit value, performs a bitwise AND followed by a\r
+  bitwise OR, and returns the result.\r
+\r
+  Performs a bitwise AND between the bit field specified by StartBit and EndBit\r
+  in Operand and the value specified by AndData, followed by a bitwise\r
+  inclusive OR with value specified by OrData. All other bits in Operand are\r
+  preserved. The new 32-bit value is returned.\r
+\r
+  If 32-bit operations are not supported, then ASSERT().\r
+  If StartBit is greater than 31, then ASSERT().\r
+  If EndBit is greater than 31, then ASSERT().\r
+  If EndBit is less than or equal to StartBit, then ASSERT().\r
+\r
+  @param  Operand   Operand on which to perform the bitfield operation.\r
+  @param  StartBit  The ordinal of the least significant bit in the bit field.\r
+                    Range 0..31.\r
+  @param  EndBit    The ordinal of the most significant bit in the bit field.\r
+                    Range 0..31.\r
+  @param  AndData   The value to AND with the read value from the value.\r
+  @param  OrData    The value to OR with the result of the AND operation.\r
+\r
+  @return The new 32-bit value.\r
+\r
+**/\r
+UINT32\r
+EFIAPI\r
+BitFieldAndThenOr32 (\r
+  IN      UINT32                    Operand,\r
+  IN      UINTN                     StartBit,\r
+  IN      UINTN                     EndBit,\r
+  IN      UINT32                    AndData,\r
+  IN      UINT32                    OrData\r
+  );\r
+\r
+/**\r
+  Returns a bit field from a 64-bit value.\r
+\r
+  Returns the bitfield specified by the StartBit and the EndBit from Operand.\r
+\r
+  If 64-bit operations are not supported, then ASSERT().\r
+  If StartBit is greater than 63, then ASSERT().\r
+  If EndBit is greater than 63, then ASSERT().\r
+  If EndBit is less than or equal to StartBit, then ASSERT().\r
+\r
+  @param  Operand   Operand on which to perform the bitfield operation.\r
+  @param  StartBit  The ordinal of the least significant bit in the bit field.\r
+                    Range 0..63.\r
+  @param  EndBit    The ordinal of the most significant bit in the bit field.\r
+                    Range 0..63.\r
+\r
+  @return The bit field read.\r
+\r
+**/\r
+UINT64\r
+EFIAPI\r
+BitFieldRead64 (\r
+  IN      UINT64                    Operand,\r
+  IN      UINTN                     StartBit,\r
+  IN      UINTN                     EndBit\r
+  );\r
+\r
+/**\r
+  Writes a bit field to a 64-bit value, and returns the result.\r
+\r
+  Writes Value to the bit field specified by the StartBit and the EndBit in\r
+  Operand. All other bits in Operand are preserved. The new 64-bit value is\r
+  returned.\r
+\r
+  If 64-bit operations are not supported, then ASSERT().\r
+  If StartBit is greater than 63, then ASSERT().\r
+  If EndBit is greater than 63, then ASSERT().\r
+  If EndBit is less than or equal to StartBit, then ASSERT().\r
+\r
+  @param  Operand   Operand on which to perform the bitfield operation.\r
+  @param  StartBit  The ordinal of the least significant bit in the bit field.\r
+                    Range 0..63.\r
+  @param  EndBit    The ordinal of the most significant bit in the bit field.\r
+                    Range 0..63.\r
+  @param  Value     New value of the bit field.\r
+\r
+  @return The new 64-bit value.\r
+\r
+**/\r
+UINT64\r
+EFIAPI\r
+BitFieldWrite64 (\r
+  IN      UINT64                    Operand,\r
+  IN      UINTN                     StartBit,\r
+  IN      UINTN                     EndBit,\r
+  IN      UINT64                    Value\r
+  );\r
+\r
+/**\r
+  Reads a bit field from a 64-bit value, performs a bitwise OR, and returns the\r
+  result.\r
+\r
+  Performs a bitwise inclusive OR between the bit field specified by StartBit\r
+  and EndBit in Operand and the value specified by OrData. All other bits in\r
+  Operand are preserved. The new 64-bit value is returned.\r
+\r
+  If 64-bit operations are not supported, then ASSERT().\r
+  If StartBit is greater than 63, then ASSERT().\r
+  If EndBit is greater than 63, then ASSERT().\r
+  If EndBit is less than or equal to StartBit, then ASSERT().\r
+\r
+  @param  Operand   Operand on which to perform the bitfield operation.\r
+  @param  StartBit  The ordinal of the least significant bit in the bit field.\r
+                    Range 0..63.\r
+  @param  EndBit    The ordinal of the most significant bit in the bit field.\r
+                    Range 0..63.\r
+  @param  OrData    The value to OR with the read value from the value\r
+\r
+  @return The new 64-bit value.\r
+\r
+**/\r
+UINT64\r
+EFIAPI\r
+BitFieldOr64 (\r
+  IN      UINT64                    Operand,\r
+  IN      UINTN                     StartBit,\r
+  IN      UINTN                     EndBit,\r
+  IN      UINT64                    OrData\r
+  );\r
+\r
+/**\r
+  Reads a bit field from a 64-bit value, performs a bitwise AND, and returns\r
+  the result.\r
+\r
+  Performs a bitwise AND between the bit field specified by StartBit and EndBit\r
+  in Operand and the value specified by AndData. All other bits in Operand are\r
+  preserved. The new 64-bit value is returned.\r
+\r
+  If 64-bit operations are not supported, then ASSERT().\r
+  If StartBit is greater than 63, then ASSERT().\r
+  If EndBit is greater than 63, then ASSERT().\r
+  If EndBit is less than or equal to StartBit, then ASSERT().\r
+\r
+  @param  Operand   Operand on which to perform the bitfield operation.\r
+  @param  StartBit  The ordinal of the least significant bit in the bit field.\r
+                    Range 0..63.\r
+  @param  EndBit    The ordinal of the most significant bit in the bit field.\r
+                    Range 0..63.\r
+  @param  AndData   The value to AND with the read value from the value\r
+\r
+  @return The new 64-bit value.\r
+\r
+**/\r
+UINT64\r
+EFIAPI\r
+BitFieldAnd64 (\r
+  IN      UINT64                    Operand,\r
+  IN      UINTN                     StartBit,\r
+  IN      UINTN                     EndBit,\r
+  IN      UINT64                    AndData\r
+  );\r
+\r
+/**\r
+  Reads a bit field from a 64-bit value, performs a bitwise AND followed by a\r
+  bitwise OR, and returns the result.\r
+\r
+  Performs a bitwise AND between the bit field specified by StartBit and EndBit\r
+  in Operand and the value specified by AndData, followed by a bitwise\r
+  inclusive OR with value specified by OrData. All other bits in Operand are\r
+  preserved. The new 64-bit value is returned.\r
+\r
+  If 64-bit operations are not supported, then ASSERT().\r
+  If StartBit is greater than 63, then ASSERT().\r
+  If EndBit is greater than 63, then ASSERT().\r
+  If EndBit is less than or equal to StartBit, then ASSERT().\r
+\r
+  @param  Operand   Operand on which to perform the bitfield operation.\r
+  @param  StartBit  The ordinal of the least significant bit in the bit field.\r
+                    Range 0..63.\r
+  @param  EndBit    The ordinal of the most significant bit in the bit field.\r
+                    Range 0..63.\r
+  @param  AndData   The value to AND with the read value from the value.\r
+  @param  OrData    The value to OR with the result of the AND operation.\r
+\r
+  @return The new 64-bit value.\r
+\r
+**/\r
+UINT64\r
+EFIAPI\r
+BitFieldAndThenOr64 (\r
+  IN      UINT64                    Operand,\r
+  IN      UINTN                     StartBit,\r
+  IN      UINTN                     EndBit,\r
+  IN      UINT64                    AndData,\r
+  IN      UINT64                    OrData\r
+  );\r
+\r
+//\r
+// Base Library Synchronization Functions\r
+//\r
+\r
+/**\r
+  Retrieves the architecture specific spin lock alignment requirements for\r
+  optimal spin lock performance.\r
+\r
+  This function retrieves the spin lock alignment requirements for optimal\r
+  performance on a given CPU architecture. The spin lock alignment must be a\r
+  power of two and is returned by this function. If there are no alignment\r
+  requirements, then 1 must be returned. The spin lock synchronization\r
+  functions must function correctly if the spin lock size and alignment values\r
+  returned by this function are not used at all. These values are hints to the\r
+  consumers of the spin lock synchronization functions to obtain optimal spin\r
+  lock performance.\r
+\r
+  @return The architecture specific spin lock alignment.\r
+\r
+**/\r
+UINTN\r
+EFIAPI\r
+GetSpinLockProperties (\r
+  VOID\r
+  );\r
+\r
+/**\r
+  Initializes a spin lock to the released state and returns the spin lock.\r
+\r
+  This function initializes the spin lock specified by SpinLock to the released\r
+  state, and returns SpinLock. Optimal performance can be achieved by calling\r
+  GetSpinLockProperties() to determine the size and alignment requirements for\r
+  SpinLock.\r
+\r
+  If SpinLock is NULL, then ASSERT().\r
+\r
+  @param  SpinLock  A pointer to the spin lock to initialize to the released\r
+                    state.\r
+\r
+  @return SpinLock\r
+\r
+**/\r
+SPIN_LOCK *\r
+EFIAPI\r
+InitializeSpinLock (\r
+  IN      SPIN_LOCK                 *SpinLock\r
+  );\r
+\r
+/**\r
+  Waits until a spin lock can be placed in the acquired state.\r
+\r
+  This function checks the state of the spin lock specified by SpinLock. If\r
+  SpinLock is in the released state, then this function places SpinLock in the\r
+  acquired state and returns SpinLock. Otherwise, this function waits\r
+  indefinitely for the spin lock to be released, and then places it in the\r
+  acquired state and returns SpinLock. All state transitions of SpinLock must\r
+  be performed using MP safe mechanisms.\r
+\r
+  If SpinLock is NULL, then ASSERT().\r
+  If SpinLock was not initialized with InitializeSpinLock(), then ASSERT().\r
+  If PcdSpinLockTimeout is not zero, and SpinLock is can not be acquired in\r
+  PcdSpinLockTimeout microseconds, then ASSERT().\r
+\r
+  @param  SpinLock  A pointer to the spin lock to place in the acquired state.\r
+\r
+  @return SpinLock\r
+\r
+**/\r
+SPIN_LOCK *\r
+EFIAPI\r
+AcquireSpinLock (\r
+  IN      SPIN_LOCK                 *SpinLock\r
+  );\r
+\r
+/**\r
+  Attempts to place a spin lock in the acquired state.\r
+\r
+  This function checks the state of the spin lock specified by SpinLock. If\r
+  SpinLock is in the released state, then this function places SpinLock in the\r
+  acquired state and returns TRUE. Otherwise, FALSE is returned. All state\r
+  transitions of SpinLock must be performed using MP safe mechanisms.\r
+\r
+  If SpinLock is NULL, then ASSERT().\r
+  If SpinLock was not initialized with InitializeSpinLock(), then ASSERT().\r
+\r
+  @param  SpinLock  A pointer to the spin lock to place in the acquired state.\r
+\r
+  @retval TRUE  SpinLock was placed in the acquired state.\r
+  @retval FALSE SpinLock could not be acquired.\r
+\r
+**/\r
+BOOLEAN\r
+EFIAPI\r
+AcquireSpinLockOrFail (\r
+  IN      SPIN_LOCK                 *SpinLock\r
+  );\r
+\r
+/**\r
+  Releases a spin lock.\r
+\r
+  This function places the spin lock specified by SpinLock in the release state\r
+  and returns SpinLock.\r
+\r
+  If SpinLock is NULL, then ASSERT().\r
+  If SpinLock was not initialized with InitializeSpinLock(), then ASSERT().\r
+\r
+  @param  SpinLock  A pointer to the spin lock to release.\r
+\r
+  @return SpinLock\r
+\r
+**/\r
+SPIN_LOCK *\r
+EFIAPI\r
+ReleaseSpinLock (\r
+  IN      SPIN_LOCK                 *SpinLock\r
+  );\r
+\r
+/**\r
+  Performs an atomic increment of an 32-bit unsigned integer.\r
+\r
+  Performs an atomic increment of the 32-bit unsigned integer specified by\r
+  Value and returns the incremented value. The increment operation must be\r
+  performed using MP safe mechanisms. The state of the return value is not\r
+  guaranteed to be MP safe.\r
+\r
+  If Value is NULL, then ASSERT().\r
+\r
+  @param  Value A pointer to the 32-bit value to increment.\r
+\r
+  @return The incremented value.\r
+\r
+**/\r
+UINT32\r
+EFIAPI\r
+InterlockedIncrement (\r
+  IN      UINT32                    *Value\r
+  );\r
+\r
+/**\r
+  Performs an atomic decrement of an 32-bit unsigned integer.\r
+\r
+  Performs an atomic decrement of the 32-bit unsigned integer specified by\r
+  Value and returns the decremented value. The decrement operation must be\r
+  performed using MP safe mechanisms. The state of the return value is not\r
+  guaranteed to be MP safe.\r
+\r
+  If Value is NULL, then ASSERT().\r
+\r
+  @param  Value A pointer to the 32-bit value to decrement.\r
+\r
+  @return The decremented value.\r
+\r
+**/\r
+UINT32\r
+EFIAPI\r
+InterlockedDecrement (\r
+  IN      UINT32                    *Value\r
+  );\r
+\r
+/**\r
+  Performs an atomic compare exchange operation on a 32-bit unsigned integer.\r
+\r
+  @param  Value         A pointer to the 32-bit value for the compare exchange\r
+                        operation.\r
+  @param  CompareValue  32-bit value used in compare operation.\r
+  @param  ExchangeValue 32-bit value used in exchange operation.\r
+\r
+  @return The original *Value before exchange.\r
+\r
+**/\r
+UINT32\r
+EFIAPI\r
+InterlockedCompareExchange32 (\r
+  IN      UINT32                    *Value,\r
+  IN      UINT32                    CompareValue,\r
+  IN      UINT32                    ExchangeValue\r
+  );\r
+\r
+/**\r
+  Performs an atomic compare exchange operation on a 64-bit unsigned integer.\r
+\r
+  @param  Value         A pointer to the 64-bit value for the compare exchange\r
+                        operation.\r
+  @param  CompareValue  64-bit value used in compare operation.\r
+  @param  ExchangeValue 64-bit value used in exchange operation.\r
+\r
+  @return The original *Value before exchange.\r
+\r
+**/\r
+UINT64\r
+EFIAPI\r
+InterlockedCompareExchange64 (\r
+  IN      UINT64                    *Value,\r
+  IN      UINT64                    CompareValue,\r
+  IN      UINT64                    ExchangeValue\r
+  );\r
+\r
+/**\r
+  Performs an atomic compare exchange operation on a pointer value.\r
+\r
+  Performs an atomic compare exchange operation on the pointer value specified\r
+  by Value. If Value is equal to CompareValue, then Value is set to\r
+  ExchangeValue and CompareValue is returned. If Value is not equal to\r
+  CompareValue, then Value is returned. The compare exchange operation must be\r
+  performed using MP safe mechanisms.\r
+\r
+  If Value is NULL, then ASSERT().\r
+\r
+  @param  Value         A pointer to the pointer value for the compare exchange\r
+                        operation.\r
+  @param  CompareValue  Pointer value used in compare operation.\r
+  @param  ExchangeValue Pointer value used in exchange operation.\r
+\r
+**/\r
+VOID *\r
+EFIAPI\r
+InterlockedCompareExchangePointer (\r
+  IN      VOID                      **Value,\r
+  IN      VOID                      *CompareValue,\r
+  IN      VOID                      *ExchangeValue\r
+  );\r
+\r
+//\r
+// Base Library CPU Functions\r
+//\r
+typedef\r
+VOID\r
+(EFIAPI *SWITCH_STACK_ENTRY_POINT) (\r
+  IN      VOID                      *Context1,  OPTIONAL\r
+  IN      VOID                      *Context2   OPTIONAL\r
+  );\r
+\r
+/**\r
+  Used to serialize load and store operations.\r
+\r
+  All loads and stores that proceed calls to this function are guaranteed to be\r
+  globally visible when this function returns.\r
+\r
+**/\r
+VOID\r
+EFIAPI\r
+MemoryFence (\r
+  VOID\r
+  );\r
+\r
+/**\r
+  Saves the current CPU context that can be restored with a call to LongJump()\r
+  and returns 0.\r
+\r
+  Saves the current CPU context in the buffer specified by JumpBuffer and\r
+  returns 0. The initial call to SetJump() must always return 0. Subsequent\r
+  calls to LongJump() cause a non-zero value to be returned by SetJump().\r
+\r
+  If JumpBuffer is NULL, then ASSERT().\r
+\r
+  @param  JumpBuffer  A pointer to CPU context buffer.\r
+\r
+  @retval 0 Indicates a return from SetJump().\r
+\r
+**/\r
+UINTN\r
+EFIAPI\r
+SetJump (\r
+  OUT     BASE_LIBRARY_JUMP_BUFFER  *JumpBuffer\r
+  );\r
+\r
+/**\r
+  Restores the CPU context that was saved with SetJump().\r
+\r
+  Restores the CPU context from the buffer specified by JumpBuffer. This\r
+  function never returns to the caller. Instead is resumes execution based on\r
+  the state of JumpBuffer.\r
+\r
+  If JumpBuffer is NULL, then ASSERT().\r
+  If Value is 0, then ASSERT().\r
+\r
+  @param  JumpBuffer  A pointer to CPU context buffer.\r
+  @param  Value       The value to return when the SetJump() context is\r
+                      restored and must be non-zero.\r
+\r
+**/\r
+VOID\r
+EFIAPI\r
+LongJump (\r
+  IN      BASE_LIBRARY_JUMP_BUFFER  *JumpBuffer,\r
+  IN      UINTN                     Value\r
+  );\r
+\r
+/**\r
+  Enables CPU interrupts.\r
+\r
+  Enables CPU interrupts.\r
+\r
+**/\r
+VOID\r
+EFIAPI\r
+EnableInterrupts (\r
+  VOID\r
+  );\r
+\r
+/**\r
+  Disables CPU interrupts.\r
+\r
+  Disables CPU interrupts.\r
+\r
+**/\r
+VOID\r
+EFIAPI\r
+DisableInterrupts (\r
+  VOID\r
+  );\r
+\r
+/**\r
+  Disables CPU interrupts and returns the interrupt state prior to the disable\r
+  operation.\r
+\r
+  Disables CPU interrupts and returns the interrupt state prior to the disable\r
+  operation.\r
+\r
+  @retval TRUE  CPU interrupts were enabled on entry to this call.\r
+  @retval FALSE CPU interrupts were disabled on entry to this call.\r
+\r
+**/\r
+BOOLEAN\r
+EFIAPI\r
+SaveAndDisableInterrupts (\r
+  VOID\r
+  );\r
+\r
+/**\r
+  Enables CPU interrupts for the smallest window required to capture any\r
+  pending interrupts.\r
+\r
+  Enables CPU interrupts for the smallest window required to capture any\r
+  pending interrupts.\r
+\r
+**/\r
+VOID\r
+EFIAPI\r
+EnableDisableInterrupts (\r
+  VOID\r
+  );\r
+\r
+/**\r
+  Retrieves the current CPU interrupt state.\r
+\r
+  Retrieves the current CPU interrupt state. Returns TRUE is interrupts are\r
+  currently enabled. Otherwise returns FALSE.\r
+\r
+  @retval TRUE  CPU interrupts are enabled.\r
+  @retval FALSE CPU interrupts are disabled.\r
+\r
+**/\r
+BOOLEAN\r
+EFIAPI\r
+GetInterruptState (\r
+  VOID\r
+  );\r
+\r
+/**\r
+  Set the current CPU interrupt state.\r
+\r
+  Sets the current CPU interrupt state to the state specified by\r
+  InterruptState. If InterruptState is TRUE, then interrupts are enabled. If\r
+  InterruptState is FALSE, then interrupts are disabled. InterruptState is\r
+  returned.\r
+\r
+  @param  InterruptState  TRUE if interrupts should enabled. FALSE if\r
+                          interrupts should be disabled.\r
+\r
+  @return InterruptState\r
+\r
+**/\r
+BOOLEAN\r
+EFIAPI\r
+SetInterruptState (\r
+  IN      BOOLEAN                   InterruptState\r
+  );\r
+\r
+/**\r
+  Places the CPU in a sleep state until an interrupt is received.\r
+\r
+  Places the CPU in a sleep state until an interrupt is received. If interrupts\r
+  are disabled prior to calling this function, then the CPU will be placed in a\r
+  sleep state indefinitely.\r
+\r
+**/\r
+VOID\r
+EFIAPI\r
+CpuSleep (\r
+  VOID\r
+  );\r
+\r
+/**\r
+  Requests CPU to pause for a short period of time.\r
+\r
+  Requests CPU to pause for a short period of time. Typically used in MP\r
+  systems to prevent memory starvation while waiting for a spin lock.\r
+\r
+**/\r
+VOID\r
+EFIAPI\r
+CpuPause (\r
+  VOID\r
+  );\r
+\r
+/**\r
+  Flushes all the Translation Lookaside Buffers(TLB) entries in a CPU.\r
+\r
+  Flushes all the Translation Lookaside Buffers(TLB) entries in a CPU.\r
+\r
+**/\r
+VOID\r
+EFIAPI\r
+CpuFlushTlb (\r
+  VOID\r
+  );\r
+\r
+/**\r
+  Transfers control to a function starting with a new stack.\r
+\r
+  Transfers control to the function specified by EntryPoint using the new stack\r
+  specified by NewStack and passing in the parameters specified by Context1 and\r
+  Context2. Context1 and Context2 are optional and may be NULL. The function\r
+  EntryPoint must never return.\r
+\r
+  If EntryPoint is NULL, then ASSERT().\r
+  If NewStack is NULL, then ASSERT().\r
+\r
+  @param  EntryPoint  A pointer to function to call with the new stack.\r
+  @param  Context1    A pointer to the context to pass into the EntryPoint\r
+                      function.\r
+  @param  Context2    A pointer to the context to pass into the EntryPoint\r
+                      function.\r
+  @param  NewStack    A pointer to the new stack to use for the EntryPoint\r
+                      function.\r
+\r
+**/\r
+VOID\r
+EFIAPI\r
+SwitchStack (\r
+  IN      SWITCH_STACK_ENTRY_POINT  EntryPoint,\r
+  IN      VOID                      *Context1,  OPTIONAL\r
+  IN      VOID                      *Context2,  OPTIONAL\r
+  IN      VOID                      *NewStack\r
+  );\r
+\r
+/**\r
+  Generates a breakpoint on the CPU.\r
+\r
+  Generates a breakpoint on the CPU. The breakpoint must be implemented such\r
+  that code can resume normal execution after the breakpoint.\r
+\r
+**/\r
+VOID\r
+EFIAPI\r
+CpuBreakpoint (\r
+  VOID\r
+  );\r
+\r
+/**\r
+  Executes an infinite loop.\r
+\r
+  Forces the CPU to execute an infinite loop. A debugger may be used to skip\r
+  past the loop and the code that follows the loop must execute properly. This\r
+  implies that the infinite loop must not cause the code that follow it to be\r
+  optimized away.\r
+\r
+**/\r
+VOID\r
+EFIAPI\r
+CpuDeadLoop (\r
+  VOID\r
+  );\r
+\r
+//\r
+// IA32 and X64 Specific Functions\r
+//\r
+//\r
+// Byte packed structure for 16-bit Real Mode EFLAGS\r
+//\r
+typedef union {\r
+  struct {\r
+    UINT32  CF:1;           // Carry Flag\r
+    UINT32  Reserved_0:1;   // Reserved\r
+    UINT32  PF:1;           // Parity Flag\r
+    UINT32  Reserved_1:1;   // Reserved\r
+    UINT32  AF:1;           // Auxiliary Carry Flag\r
+    UINT32  Reserved_2:1;   // Reserved\r
+    UINT32  ZF:1;           // Zero Flag\r
+    UINT32  SF:1;           // Sign Flag\r
+    UINT32  TF:1;           // Trap Flag\r
+    UINT32  IF:1;           // Interrupt Enable Flag\r
+    UINT32  DF:1;           // Direction Flag\r
+    UINT32  OF:1;           // Overflow Flag\r
+    UINT32  IOPL:2;         // I/O Privilege Level\r
+    UINT32  NT:1;           // Nested Task\r
+    UINT32  Reserved_3:1;   // Reserved\r
+  } Bits;\r
+  UINT16    Uint16;\r
+} IA32_FLAGS16;\r
+\r
+//\r
+// Byte packed structure for EFLAGS/RFLAGS\r
+// 32-bits on IA-32\r
+// 64-bits on X64.  The upper 32-bits on X64 are reserved\r
+//\r
+typedef union {\r
+  struct {\r
+    UINT32  CF:1;           // Carry Flag\r
+    UINT32  Reserved_0:1;   // Reserved\r
+    UINT32  PF:1;           // Parity Flag\r
+    UINT32  Reserved_1:1;   // Reserved\r
+    UINT32  AF:1;           // Auxiliary Carry Flag\r
+    UINT32  Reserved_2:1;   // Reserved\r
+    UINT32  ZF:1;           // Zero Flag\r
+    UINT32  SF:1;           // Sign Flag\r
+    UINT32  TF:1;           // Trap Flag\r
+    UINT32  IF:1;           // Interrupt Enable Flag\r
+    UINT32  DF:1;           // Direction Flag\r
+    UINT32  OF:1;           // Overflow Flag\r
+    UINT32  IOPL:2;         // I/O Privilege Level\r
+    UINT32  NT:1;           // Nested Task\r
+    UINT32  Reserved_3:1;   // Reserved\r
+    UINT32  RF:1;           // Resume Flag\r
+    UINT32  VM:1;           // Virtual 8086 Mode\r
+    UINT32  AC:1;           // Alignment Check\r
+    UINT32  VIF:1;          // Virtual Interrupt Flag\r
+    UINT32  VIP:1;          // Virtual Interrupt Pending\r
+    UINT32  ID:1;           // ID Flag\r
+    UINT32  Reserved_4:10;  // Reserved\r
+  } Bits;\r
+  UINTN     UintN;\r
+} IA32_EFLAGS32;\r
+\r
+//\r
+// Byte packed structure for Control Register 0 (CR0)\r
+// 32-bits on IA-32\r
+// 64-bits on X64.  The upper 32-bits on X64 are reserved\r
+//\r
+typedef union {\r
+  struct {\r
+    UINT32  PE:1;           // Protection Enable\r
+    UINT32  MP:1;           // Monitor Coprocessor\r
+    UINT32  EM:1;           // Emulation\r
+    UINT32  TS:1;           // Task Switched\r
+    UINT32  ET:1;           // Extension Type\r
+    UINT32  NE:1;           // Numeric Error\r
+    UINT32  Reserved_0:10;  // Reserved\r
+    UINT32  WP:1;           // Write Protect\r
+    UINT32  Reserved_1:1;   // Reserved\r
+    UINT32  AM:1;           // Alignment Mask\r
+    UINT32  Reserved_2:10;  // Reserved\r
+    UINT32  NW:1;           // Mot Write-through\r
+    UINT32  CD:1;           // Cache Disable\r
+    UINT32  PG:1;           // Paging\r
+  } Bits;\r
+  UINTN     UintN;\r
+} IA32_CR0;\r
+\r
+//\r
+// Byte packed structure for Control Register 4 (CR4)\r
+// 32-bits on IA-32\r
+// 64-bits on X64.  The upper 32-bits on X64 are reserved\r
+//\r
+typedef union {\r
+  struct {\r
+    UINT32  VME:1;          // Virtual-8086 Mode Extensions\r
+    UINT32  PVI:1;          // Protected-Mode Virtual Interrupts\r
+    UINT32  TSD:1;          // Time Stamp Disable\r
+    UINT32  DE:1;           // Debugging Extensions\r
+    UINT32  PSE:1;          // Page Size Extensions\r
+    UINT32  PAE:1;          // Physical Address Extension\r
+    UINT32  MCE:1;          // Machine Check Enable\r
+    UINT32  PGE:1;          // Page Global Enable\r
+    UINT32  PCE:1;          // Performance Monitoring Counter\r
+                            // Enable\r
+    UINT32  OSFXSR:1;       // Operating System Support for\r
+                            // FXSAVE and FXRSTOR instructions\r
+    UINT32  OSXMMEXCPT:1;   // Operating System Support for\r
+                            // Unmasked SIMD Floating Point\r
+                            // Exceptions\r
+    UINT32  Reserved_0:2;   // Reserved\r
+    UINT32  VMXE:1;         // VMX Enable\r
+    UINT32  Reserved_1:18;  // Reseved\r
+  } Bits;\r
+  UINTN     UintN;\r
+} IA32_CR4;\r
+\r
+//\r
+// Byte packed structure for an IDTR, GDTR, LDTR descriptor\r
+//\r
+typedef struct {\r
+  UINT16  Limit;\r
+  UINTN   Base;\r
+} IA32_DESCRIPTOR;\r
+\r
+#define IA32_IDT_GATE_TYPE_TASK          0x85\r
+#define IA32_IDT_GATE_TYPE_INTERRUPT_16  0x86\r
+#define IA32_IDT_GATE_TYPE_TRAP_16       0x87\r
+#define IA32_IDT_GATE_TYPE_INTERRUPT_32  0x8E\r
+#define IA32_IDT_GATE_TYPE_TRAP_32       0x8F\r
+\r
+//\r
+// Byte packed structure for an Interrupt Gate Descriptor\r
+//\r
+typedef union {\r
+  struct {\r
+    UINT32  OffsetLow:16;   // Offset bits 15..0\r
+    UINT32  Selector:16;    // Selector\r
+    UINT32  Reserved_0:8;   // Reserved\r
+    UINT32  GateType:8;     // Gate Type.  See #defines above\r
+    UINT32  OffsetHigh:16;  // Offset bits 31..16\r
+  } Bits;\r
+  UINT64  Uint64;\r
+} IA32_IDT_GATE_DESCRIPTOR;\r
+\r
+//\r
+// Byte packed structure for an FP/SSE/SSE2 context\r
+//\r
+typedef struct {\r
+  UINT8  Buffer[512];\r
+} IA32_FX_BUFFER;\r
+\r
+//\r
+// Structures for the 16-bit real mode thunks\r
+//\r
+typedef struct {\r
+  UINT32                            Reserved1;\r
+  UINT32                            Reserved2;\r
+  UINT32                            Reserved3;\r
+  UINT32                            Reserved4;\r
+  UINT8                             BL;\r
+  UINT8                             BH;\r
+  UINT16                            Reserved5;\r
+  UINT8                             DL;\r
+  UINT8                             DH;\r
+  UINT16                            Reserved6;\r
+  UINT8                             CL;\r
+  UINT8                             CH;\r
+  UINT16                            Reserved7;\r
+  UINT8                             AL;\r
+  UINT8                             AH;\r
+  UINT16                            Reserved8;\r
+} IA32_BYTE_REGS;\r
+\r
+typedef struct {\r
+  UINT16                            DI;\r
+  UINT16                            Reserved1;\r
+  UINT16                            SI;\r
+  UINT16                            Reserved2;\r
+  UINT16                            BP;\r
+  UINT16                            Reserved3;\r
+  UINT16                            SP;\r
+  UINT16                            Reserved4;\r
+  UINT16                            BX;\r
+  UINT16                            Reserved5;\r
+  UINT16                            DX;\r
+  UINT16                            Reserved6;\r
+  UINT16                            CX;\r
+  UINT16                            Reserved7;\r
+  UINT16                            AX;\r
+  UINT16                            Reserved8;\r
+} IA32_WORD_REGS;\r
+\r
+typedef struct {\r
+  UINT32                            EDI;\r
+  UINT32                            ESI;\r
+  UINT32                            EBP;\r
+  UINT32                            ESP;\r
+  UINT32                            EBX;\r
+  UINT32                            EDX;\r
+  UINT32                            ECX;\r
+  UINT32                            EAX;\r
+  UINT16                            DS;\r
+  UINT16                            ES;\r
+  UINT16                            FS;\r
+  UINT16                            GS;\r
+  IA32_EFLAGS32                     EFLAGS;\r
+  UINT32                            Eip;\r
+  UINT16                            CS;\r
+  UINT16                            SS;\r
+} IA32_DWORD_REGS;\r
+\r
+typedef union {\r
+  IA32_DWORD_REGS                   E;\r
+  IA32_WORD_REGS                    X;\r
+  IA32_BYTE_REGS                    H;\r
+} IA32_REGISTER_SET;\r
+\r
+//\r
+// Byte packed structure for an 16-bit real mode thunks\r
+//\r
+typedef struct {\r
+  IA32_REGISTER_SET                 *RealModeState;\r
+  VOID                              *RealModeBuffer;\r
+  UINT32                            RealModeBufferSize;\r
+  UINT32                            ThunkAttributes;\r
+} THUNK_CONTEXT;\r
+\r
+#define THUNK_ATTRIBUTE_BIG_REAL_MODE             0x00000001\r
+#define THUNK_ATTRIBUTE_DISABLE_A20_MASK_INT_15   0x00000002\r
+#define THUNK_ATTRIBUTE_DISABLE_A20_MASK_KBD_CTRL 0x00000004\r
+\r
+/**\r
+  Retrieves CPUID information.\r
+\r
+  Executes the CPUID instruction with EAX set to the value specified by Index.\r
+  This function always returns Index.\r
+  If Eax is not NULL, then the value of EAX after CPUID is returned in Eax.\r
+  If Ebx is not NULL, then the value of EBX after CPUID is returned in Ebx.\r
+  If Ecx is not NULL, then the value of ECX after CPUID is returned in Ecx.\r
+  If Edx is not NULL, then the value of EDX after CPUID is returned in Edx.\r
+  This function is only available on IA-32 and X64.\r
+\r
+  @param  Index The 32-bit value to load into EAX prior to invoking the CPUID\r
+                instruction.\r
+  @param  Eax   Pointer to the 32-bit EAX value returned by the CPUID\r
+                instruction. This is an optional parameter that may be NULL.\r
+  @param  Ebx   Pointer to the 32-bit EBX value returned by the CPUID\r
+                instruction. This is an optional parameter that may be NULL.\r
+  @param  Ecx   Pointer to the 32-bit ECX value returned by the CPUID\r
+                instruction. This is an optional parameter that may be NULL.\r
+  @param  Edx   Pointer to the 32-bit EDX value returned by the CPUID\r
+                instruction. This is an optional parameter that may be NULL.\r
+\r
+  @return Index\r
+\r
+**/\r
+UINT32\r
+EFIAPI\r
+AsmCpuid (\r
+  IN      UINT32                    Index,\r
+  OUT     UINT32                    *Eax,  OPTIONAL\r
+  OUT     UINT32                    *Ebx,  OPTIONAL\r
+  OUT     UINT32                    *Ecx,  OPTIONAL\r
+  OUT     UINT32                    *Edx   OPTIONAL\r
+  );\r
+\r
+/**\r
+  Returns the lower 32-bits of a Machine Specific Register(MSR).\r
+\r
+  Reads and returns the lower 32-bits of the MSR specified by Index.\r
+  No parameter checking is performed on Index, and some Index values may cause\r
+  CPU exceptions. The caller must either guarantee that Index is valid, or the\r
+  caller must set up exception handlers to catch the exceptions. This function\r
+  is only available on IA-32 and X64.\r
+\r
+  @param  Index The 32-bit MSR index to read.\r
+\r
+  @return The lower 32 bits of the MSR identified by Index.\r
+\r
+**/\r
+UINT32\r
+EFIAPI\r
+AsmReadMsr32 (\r
+  IN      UINT32                    Index\r
+  );\r
+\r
+/**\r
+  Zero-extend a 32-bit value and writes it to a Machine Specific Register(MSR).\r
+\r
+  Writes the 32-bit value specified by Value to the MSR specified by Index. The\r
+  upper 32-bits of the MSR write are set to zero. The 32-bit value written to\r
+  the MSR is returned. No parameter checking is performed on Index or Value,\r
+  and some of these may cause CPU exceptions. The caller must either guarantee\r
+  that Index and Value are valid, or the caller must establish proper exception\r
+  handlers. This function is only available on IA-32 and X64.\r
+\r
+  @param  Index The 32-bit MSR index to write.\r
+  @param  Value The 32-bit value to write to the MSR.\r
+\r
+  @return Value\r
+\r
+**/\r
+UINT32\r
+EFIAPI\r
+AsmWriteMsr32 (\r
+  IN      UINT32                    Index,\r
+  IN      UINT32                    Value\r
+  );\r
+\r
+/**\r
+  Reads a 64-bit MSR, performs a bitwise inclusive OR on the lower 32-bits, and\r
+  writes the result back to the 64-bit MSR.\r
+\r
+  Reads the 64-bit MSR specified by Index, performs a bitwise inclusive OR\r
+  between the lower 32-bits of the read result and the value specified by\r
+  OrData, and writes the result to the 64-bit MSR specified by Index. The lower\r
+  32-bits of the value written to the MSR is returned. No parameter checking is\r
+  performed on Index or OrData, and some of these may cause CPU exceptions. The\r
+  caller must either guarantee that Index and OrData are valid, or the caller\r
+  must establish proper exception handlers. This function is only available on\r
+  IA-32 and X64.\r
+\r
+  @param  Index   The 32-bit MSR index to write.\r
+  @param  OrData  The value to OR with the read value from the MSR.\r
+\r
+  @return The lower 32-bit value written to the MSR.\r
+\r
+**/\r
+UINT32\r
+EFIAPI\r
+AsmMsrOr32 (\r
+  IN      UINT32                    Index,\r
+  IN      UINT32                    OrData\r
+  );\r
+\r
+/**\r
+  Reads a 64-bit MSR, performs a bitwise AND on the lower 32-bits, and writes\r
+  the result back to the 64-bit MSR.\r
+\r
+  Reads the 64-bit MSR specified by Index, performs a bitwise AND between the\r
+  lower 32-bits of the read result and the value specified by AndData, and\r
+  writes the result to the 64-bit MSR specified by Index. The lower 32-bits of\r
+  the value written to the MSR is returned. No parameter checking is performed\r
+  on Index or AndData, and some of these may cause CPU exceptions. The caller\r
+  must either guarantee that Index and AndData are valid, or the caller must\r
+  establish proper exception handlers. This function is only available on IA-32\r
+  and X64.\r
+\r
+  @param  Index   The 32-bit MSR index to write.\r
+  @param  AndData The value to AND with the read value from the MSR.\r
+\r
+  @return The lower 32-bit value written to the MSR.\r
+\r
+**/\r
+UINT32\r
+EFIAPI\r
+AsmMsrAnd32 (\r
+  IN      UINT32                    Index,\r
+  IN      UINT32                    AndData\r
+  );\r
+\r
+/**\r
+  Reads a 64-bit MSR, performs a bitwise AND followed by a bitwise inclusive OR\r
+  on the lower 32-bits, and writes the result back to the 64-bit MSR.\r
+\r
+  Reads the 64-bit MSR specified by Index, performs a bitwise AND between the\r
+  lower 32-bits of the read result and the value specified by AndData\r
+  preserving the upper 32-bits, performs a bitwise inclusive OR between the\r
+  result of the AND operation and the value specified by OrData, and writes the\r
+  result to the 64-bit MSR specified by Address. The lower 32-bits of the value\r
+  written to the MSR is returned. No parameter checking is performed on Index,\r
+  AndData, or OrData, and some of these may cause CPU exceptions. The caller\r
+  must either guarantee that Index, AndData, and OrData are valid, or the\r
+  caller must establish proper exception handlers. This function is only\r
+  available on IA-32 and X64.\r
+\r
+  @param  Index   The 32-bit MSR index to write.\r
+  @param  AndData The value to AND with the read value from the MSR.\r
+  @param  OrData  The value to OR with the result of the AND operation.\r
+\r
+  @return The lower 32-bit value written to the MSR.\r
+\r
+**/\r
+UINT32\r
+EFIAPI\r
+AsmMsrAndThenOr32 (\r
+  IN      UINT32                    Index,\r
+  IN      UINT32                    AndData,\r
+  IN      UINT32                    OrData\r
+  );\r
+\r
+/**\r
+  Reads a bit field of an MSR.\r
+\r
+  Reads the bit field in the lower 32-bits of a 64-bit MSR. The bit field is\r
+  specified by the StartBit and the EndBit. The value of the bit field is\r
+  returned. The caller must either guarantee that Index is valid, or the caller\r
+  must set up exception handlers to catch the exceptions. This function is only\r
+  available on IA-32 and X64.\r
+\r
+  If StartBit is greater than 31, then ASSERT().\r
+  If EndBit is greater than 31, then ASSERT().\r
+  If EndBit is less than or equal to StartBit, then ASSERT().\r
+\r
+  @param  Index     The 32-bit MSR index to read.\r
+  @param  StartBit  The ordinal of the least significant bit in the bit field.\r
+                    Range 0..31.\r
+  @param  EndBit    The ordinal of the most significant bit in the bit field.\r
+                    Range 0..31.\r
+\r
+  @return The bit field read from the MSR.\r
+\r
+**/\r
+UINT32\r
+EFIAPI\r
+AsmMsrBitFieldRead32 (\r
+  IN      UINT32                    Index,\r
+  IN      UINTN                     StartBit,\r
+  IN      UINTN                     EndBit\r
+  );\r
+\r
+/**\r
+  Writes a bit field to an MSR.\r
+\r
+  Writes Value to a bit field in the lower 32-bits of a  64-bit MSR. The bit\r
+  field is specified by the StartBit and the EndBit. All other bits in the\r
+  destination MSR are preserved. The lower 32-bits of the MSR written is\r
+  returned. Extra left bits in Value are stripped. The caller must either\r
+  guarantee that Index and the data written is valid, or the caller must set up\r
+  exception handlers to catch the exceptions. This function is only available\r
+  on IA-32 and X64.\r
+\r
+  If StartBit is greater than 31, then ASSERT().\r
+  If EndBit is greater than 31, then ASSERT().\r
+  If EndBit is less than or equal to StartBit, then ASSERT().\r
+\r
+  @param  Index     The 32-bit MSR index to write.\r
+  @param  StartBit  The ordinal of the least significant bit in the bit field.\r
+                    Range 0..31.\r
+  @param  EndBit    The ordinal of the most significant bit in the bit field.\r
+                    Range 0..31.\r
+  @param  Value     New value of the bit field.\r
+\r
+  @return The lower 32-bit of the value written to the MSR.\r
+\r
+**/\r
+UINT32\r
+EFIAPI\r
+AsmMsrBitFieldWrite32 (\r
+  IN      UINT32                    Index,\r
+  IN      UINTN                     StartBit,\r
+  IN      UINTN                     EndBit,\r
+  IN      UINT32                    Value\r
+  );\r
+\r
+/**\r
+  Reads a bit field in a 64-bit MSR, performs a bitwise OR, and writes the\r
+  result back to the bit field in the 64-bit MSR.\r
+\r
+  Reads the 64-bit MSR specified by Index, performs a bitwise inclusive OR\r
+  between the read result and the value specified by OrData, and writes the\r
+  result to the 64-bit MSR specified by Index. The lower 32-bits of the value\r
+  written to the MSR are returned. Extra left bits in OrData are stripped. The\r
+  caller must either guarantee that Index and the data written is valid, or\r
+  the caller must set up exception handlers to catch the exceptions. This\r
+  function is only available on IA-32 and X64.\r
+\r
+  If StartBit is greater than 31, then ASSERT().\r
+  If EndBit is greater than 31, then ASSERT().\r
+  If EndBit is less than or equal to StartBit, then ASSERT().\r
+\r
+  @param  Index     The 32-bit MSR index to write.\r
+  @param  StartBit  The ordinal of the least significant bit in the bit field.\r
+                    Range 0..31.\r
+  @param  EndBit    The ordinal of the most significant bit in the bit field.\r
+                    Range 0..31.\r
+  @param  OrData    The value to OR with the read value from the MSR.\r
+\r
+  @return The lower 32-bit of the value written to the MSR.\r
+\r
+**/\r
+UINT32\r
+EFIAPI\r
+AsmMsrBitFieldOr32 (\r
+  IN      UINT32                    Index,\r
+  IN      UINTN                     StartBit,\r
+  IN      UINTN                     EndBit,\r
+  IN      UINT32                    OrData\r
+  );\r
+\r
+/**\r
+  Reads a bit field in a 64-bit MSR, performs a bitwise AND, and writes the\r
+  result back to the bit field in the 64-bit MSR.\r
+\r
+  Reads the 64-bit MSR specified by Index, performs a bitwise AND between the\r
+  read result and the value specified by AndData, and writes the result to the\r
+  64-bit MSR specified by Index. The lower 32-bits of the value written to the\r
+  MSR are returned. Extra left bits in AndData are stripped. The caller must\r
+  either guarantee that Index and the data written is valid, or the caller must\r
+  set up exception handlers to catch the exceptions. This function is only\r
+  available on IA-32 and X64.\r
+\r
+  If StartBit is greater than 31, then ASSERT().\r
+  If EndBit is greater than 31, then ASSERT().\r
+  If EndBit is less than or equal to StartBit, then ASSERT().\r
+\r
+  @param  Index     The 32-bit MSR index to write.\r
+  @param  StartBit  The ordinal of the least significant bit in the bit field.\r
+                    Range 0..31.\r
+  @param  EndBit    The ordinal of the most significant bit in the bit field.\r
+                    Range 0..31.\r
+  @param  AndData   The value to AND with the read value from the MSR.\r
+\r
+  @return The lower 32-bit of the value written to the MSR.\r
+\r
+**/\r
+UINT32\r
+EFIAPI\r
+AsmMsrBitFieldAnd32 (\r
+  IN      UINT32                    Index,\r
+  IN      UINTN                     StartBit,\r
+  IN      UINTN                     EndBit,\r
+  IN      UINT32                    AndData\r
+  );\r
+\r
+/**\r
+  Reads a bit field in a 64-bit MSR, performs a bitwise AND followed by a\r
+  bitwise inclusive OR, and writes the result back to the bit field in the\r
+  64-bit MSR.\r
+\r
+  Reads the 64-bit MSR specified by Index, performs a bitwise AND followed by a\r
+  bitwise inclusive OR between the read result and the value specified by\r
+  AndData, and writes the result to the 64-bit MSR specified by Index. The\r
+  lower 32-bits of the value written to the MSR are returned. Extra left bits\r
+  in both AndData and OrData are stripped. The caller must either guarantee\r
+  that Index and the data written is valid, or the caller must set up exception\r
+  handlers to catch the exceptions. This function is only available on IA-32\r
+  and X64.\r
+\r
+  If StartBit is greater than 31, then ASSERT().\r
+  If EndBit is greater than 31, then ASSERT().\r
+  If EndBit is less than or equal to StartBit, then ASSERT().\r
+\r
+  @param  Index     The 32-bit MSR index to write.\r
+  @param  StartBit  The ordinal of the least significant bit in the bit field.\r
+                    Range 0..31.\r
+  @param  EndBit    The ordinal of the most significant bit in the bit field.\r
+                    Range 0..31.\r
+  @param  AndData   The value to AND with the read value from the MSR.\r
+  @param  OrData    The value to OR with the result of the AND operation.\r
+\r
+  @return The lower 32-bit of the value written to the MSR.\r
+\r
+**/\r
+UINT32\r
+EFIAPI\r
+AsmMsrBitFieldAndThenOr32 (\r
+  IN      UINT32                    Index,\r
+  IN      UINTN                     StartBit,\r
+  IN      UINTN                     EndBit,\r
+  IN      UINT32                    AndData,\r
+  IN      UINT32                    OrData\r
+  );\r
+\r
+/**\r
+  Returns a 64-bit Machine Specific Register(MSR).\r
+\r
+  Reads and returns the 64-bit MSR specified by Index. No parameter checking is\r
+  performed on Index, and some Index values may cause CPU exceptions. The\r
+  caller must either guarantee that Index is valid, or the caller must set up\r
+  exception handlers to catch the exceptions. This function is only available\r
+  on IA-32 and X64.\r
+\r
+  @param  Index The 32-bit MSR index to read.\r
+\r
+  @return The value of the MSR identified by Index.\r
+\r
+**/\r
+UINT64\r
+EFIAPI\r
+AsmReadMsr64 (\r
+  IN      UINT32                    Index\r
+  );\r
+\r
+/**\r
+  Writes a 64-bit value to a Machine Specific Register(MSR), and returns the\r
+  value.\r
+\r
+  Writes the 64-bit value specified by Value to the MSR specified by Index. The\r
+  64-bit value written to the MSR is returned. No parameter checking is\r
+  performed on Index or Value, and some of these may cause CPU exceptions. The\r
+  caller must either guarantee that Index and Value are valid, or the caller\r
+  must establish proper exception handlers. This function is only available on\r
+  IA-32 and X64.\r
+\r
+  @param  Index The 32-bit MSR index to write.\r
+  @param  Value The 64-bit value to write to the MSR.\r
+\r
+  @return Value\r
+\r
+**/\r
+UINT64\r
+EFIAPI\r
+AsmWriteMsr64 (\r
+  IN      UINT32                    Index,\r
+  IN      UINT64                    Value\r
+  );\r
+\r
+/**\r
+  Reads a 64-bit MSR, performs a bitwise inclusive OR, and writes the result\r
+  back to the 64-bit MSR.\r
+\r
+  Reads the 64-bit MSR specified by Index, performs a bitwise inclusive OR\r
+  between the read result and the value specified by OrData, and writes the\r
+  result to the 64-bit MSR specified by Index. The value written to the MSR is\r
+  returned. No parameter checking is performed on Index or OrData, and some of\r
+  these may cause CPU exceptions. The caller must either guarantee that Index\r
+  and OrData are valid, or the caller must establish proper exception handlers.\r
+  This function is only available on IA-32 and X64.\r
+\r
+  @param  Index   The 32-bit MSR index to write.\r
+  @param  OrData  The value to OR with the read value from the MSR.\r
+\r
+  @return The value written back to the MSR.\r
+\r
+**/\r
+UINT64\r
+EFIAPI\r
+AsmMsrOr64 (\r
+  IN      UINT32                    Index,\r
+  IN      UINT64                    OrData\r
+  );\r
+\r
+/**\r
+  Reads a 64-bit MSR, performs a bitwise AND, and writes the result back to the\r
+  64-bit MSR.\r
+\r
+  Reads the 64-bit MSR specified by Index, performs a bitwise AND between the\r
+  read result and the value specified by OrData, and writes the result to the\r
+  64-bit MSR specified by Index. The value written to the MSR is returned. No\r
+  parameter checking is performed on Index or OrData, and some of these may\r
+  cause CPU exceptions. The caller must either guarantee that Index and OrData\r
+  are valid, or the caller must establish proper exception handlers. This\r
+  function is only available on IA-32 and X64.\r
+\r
+  @param  Index   The 32-bit MSR index to write.\r
+  @param  AndData The value to AND with the read value from the MSR.\r
+\r
+  @return The value written back to the MSR.\r
+\r
+**/\r
+UINT64\r
+EFIAPI\r
+AsmMsrAnd64 (\r
+  IN      UINT32                    Index,\r
+  IN      UINT64                    AndData\r
+  );\r
+\r
+/**\r
+  Reads a 64-bit MSR, performs a bitwise AND followed by a bitwise inclusive\r
+  OR, and writes the result back to the 64-bit MSR.\r
+\r
+  Reads the 64-bit MSR specified by Index, performs a bitwise AND between read\r
+  result and the value specified by AndData, performs a bitwise inclusive OR\r
+  between the result of the AND operation and the value specified by OrData,\r
+  and writes the result to the 64-bit MSR specified by Index. The value written\r
+  to the MSR is returned. No parameter checking is performed on Index, AndData,\r
+  or OrData, and some of these may cause CPU exceptions. The caller must either\r
+  guarantee that Index, AndData, and OrData are valid, or the caller must\r
+  establish proper exception handlers. This function is only available on IA-32\r
+  and X64.\r
+\r
+  @param  Index   The 32-bit MSR index to write.\r
+  @param  AndData The value to AND with the read value from the MSR.\r
+  @param  OrData  The value to OR with the result of the AND operation.\r
+\r
+  @return The value written back to the MSR.\r
+\r
+**/\r
+UINT64\r
+EFIAPI\r
+AsmMsrAndThenOr64 (\r
+  IN      UINT32                    Index,\r
+  IN      UINT64                    AndData,\r
+  IN      UINT64                    OrData\r
+  );\r
+\r
+/**\r
+  Reads a bit field of an MSR.\r
+\r
+  Reads the bit field in the 64-bit MSR. The bit field is specified by the\r
+  StartBit and the EndBit. The value of the bit field is returned. The caller\r
+  must either guarantee that Index is valid, or the caller must set up\r
+  exception handlers to catch the exceptions. This function is only available\r
+  on IA-32 and X64.\r
+\r
+  If StartBit is greater than 63, then ASSERT().\r
+  If EndBit is greater than 63, then ASSERT().\r
+  If EndBit is less than or equal to StartBit, then ASSERT().\r
+\r
+  @param  Index     The 32-bit MSR index to read.\r
+  @param  StartBit  The ordinal of the least significant bit in the bit field.\r
+                    Range 0..63.\r
+  @param  EndBit    The ordinal of the most significant bit in the bit field.\r
+                    Range 0..63.\r
+\r
+  @return The value read from the MSR.\r
+\r
+**/\r
+UINT64\r
+EFIAPI\r
+AsmMsrBitFieldRead64 (\r
+  IN      UINT32                    Index,\r
+  IN      UINTN                     StartBit,\r
+  IN      UINTN                     EndBit\r
+  );\r
+\r
+/**\r
+  Writes a bit field to an MSR.\r
+\r
+  Writes Value to a bit field in a 64-bit MSR. The bit field is specified by\r
+  the StartBit and the EndBit. All other bits in the destination MSR are\r
+  preserved. The MSR written is returned. Extra left bits in Value are\r
+  stripped. The caller must either guarantee that Index and the data written is\r
+  valid, or the caller must set up exception handlers to catch the exceptions.\r
+  This function is only available on IA-32 and X64.\r
+\r
+  If StartBit is greater than 63, then ASSERT().\r
+  If EndBit is greater than 63, then ASSERT().\r
+  If EndBit is less than or equal to StartBit, then ASSERT().\r
+\r
+  @param  Index     The 32-bit MSR index to write.\r
+  @param  StartBit  The ordinal of the least significant bit in the bit field.\r
+                    Range 0..63.\r
+  @param  EndBit    The ordinal of the most significant bit in the bit field.\r
+                    Range 0..63.\r
+  @param  Value     New value of the bit field.\r
+\r
+  @return The value written back to the MSR.\r
+\r
+**/\r
+UINT64\r
+EFIAPI\r
+AsmMsrBitFieldWrite64 (\r
+  IN      UINT32                    Index,\r
+  IN      UINTN                     StartBit,\r
+  IN      UINTN                     EndBit,\r
+  IN      UINT64                    Value\r
+  );\r
+\r
+/**\r
+  Reads a bit field in a 64-bit MSR, performs a bitwise inclusive OR, and\r
+  writes the result back to the bit field in the 64-bit MSR.\r
+\r
+  Reads the 64-bit MSR specified by Index, performs a bitwise inclusive OR\r
+  between the read result and the value specified by OrData, and writes the\r
+  result to the 64-bit MSR specified by Index. The value written to the MSR is\r
+  returned. Extra left bits in OrData are stripped. The caller must either\r
+  guarantee that Index and the data written is valid, or the caller must set up\r
+  exception handlers to catch the exceptions. This function is only available\r
+  on IA-32 and X64.\r
+\r
+  If StartBit is greater than 63, then ASSERT().\r
+  If EndBit is greater than 63, then ASSERT().\r
+  If EndBit is less than or equal to StartBit, then ASSERT().\r
+\r
+  @param  Index     The 32-bit MSR index to write.\r
+  @param  StartBit  The ordinal of the least significant bit in the bit field.\r
+                    Range 0..63.\r
+  @param  EndBit    The ordinal of the most significant bit in the bit field.\r
+                    Range 0..63.\r
+  @param  OrData    The value to OR with the read value from the bit field.\r
+\r
+  @return The value written back to the MSR.\r
+\r
+**/\r
+UINT64\r
+EFIAPI\r
+AsmMsrBitFieldOr64 (\r
+  IN      UINT32                    Index,\r
+  IN      UINTN                     StartBit,\r
+  IN      UINTN                     EndBit,\r
+  IN      UINT64                    OrData\r
+  );\r
+\r
+/**\r
+  Reads a bit field in a 64-bit MSR, performs a bitwise AND, and writes the\r
+  result back to the bit field in the 64-bit MSR.\r
+\r
+  Reads the 64-bit MSR specified by Index, performs a bitwise AND between the\r
+  read result and the value specified by AndData, and writes the result to the\r
+  64-bit MSR specified by Index. The value written to the MSR is returned.\r
+  Extra left bits in AndData are stripped. The caller must either guarantee\r
+  that Index and the data written is valid, or the caller must set up exception\r
+  handlers to catch the exceptions. This function is only available on IA-32\r
+  and X64.\r
+\r
+  If StartBit is greater than 63, then ASSERT().\r
+  If EndBit is greater than 63, then ASSERT().\r
+  If EndBit is less than or equal to StartBit, then ASSERT().\r
+\r
+  @param  Index     The 32-bit MSR index to write.\r
+  @param  StartBit  The ordinal of the least significant bit in the bit field.\r
+                    Range 0..63.\r
+  @param  EndBit    The ordinal of the most significant bit in the bit field.\r
+                    Range 0..63.\r
+  @param  AndData   The value to AND with the read value from the bit field.\r
+\r
+  @return The value written back to the MSR.\r
+\r
+**/\r
+UINT64\r
+EFIAPI\r
+AsmMsrBitFieldAnd64 (\r
+  IN      UINT32                    Index,\r
+  IN      UINTN                     StartBit,\r
+  IN      UINTN                     EndBit,\r
+  IN      UINT64                    AndData\r
+  );\r
+\r
+/**\r
+  Reads a bit field in a 64-bit MSR, performs a bitwise AND followed by a\r
+  bitwise inclusive OR, and writes the result back to the bit field in the\r
+  64-bit MSR.\r
+\r
+  Reads the 64-bit MSR specified by Index, performs a bitwise AND followed by\r
+  a bitwise inclusive OR between the read result and the value specified by\r
+  AndData, and writes the result to the 64-bit MSR specified by Index. The\r
+  value written to the MSR is returned. Extra left bits in both AndData and\r
+  OrData are stripped. The caller must either guarantee that Index and the data\r
+  written is valid, or the caller must set up exception handlers to catch the\r
+  exceptions. This function is only available on IA-32 and X64.\r
+\r
+  If StartBit is greater than 63, then ASSERT().\r
+  If EndBit is greater than 63, then ASSERT().\r
+  If EndBit is less than or equal to StartBit, then ASSERT().\r
+\r
+  @param  Index     The 32-bit MSR index to write.\r
+  @param  StartBit  The ordinal of the least significant bit in the bit field.\r
+                    Range 0..63.\r
+  @param  EndBit    The ordinal of the most significant bit in the bit field.\r
+                    Range 0..63.\r
+  @param  AndData   The value to AND with the read value from the bit field.\r
+  @param  OrData    The value to OR with the result of the AND operation.\r
+\r
+  @return The value written back to the MSR.\r
+\r
+**/\r
+UINT64\r
+EFIAPI\r
+AsmMsrBitFieldAndThenOr64 (\r
+  IN      UINT32                    Index,\r
+  IN      UINTN                     StartBit,\r
+  IN      UINTN                     EndBit,\r
+  IN      UINT64                    AndData,\r
+  IN      UINT64                    OrData\r
+  );\r
+\r
+/**\r
+  Reads the current value of the EFLAGS register.\r
+\r
+  Reads and returns the current value of the EFLAGS register. This function is\r
+  only available on IA-32 and X64. This returns a 32-bit value on IA-32 and a\r
+  64-bit value on X64.\r
+\r
+  @return EFLAGS on IA-32 or RFLAGS on X64.\r
+\r
+**/\r
+UINTN\r
+EFIAPI\r
+AsmReadEflags (\r
+  VOID\r
+  );\r
+\r
+/**\r
+  Reads the current value of the Control Register 0 (CR0).\r
+\r
+  Reads and returns the current value of CR0. This function is only available\r
+  on IA-32 and X64. This returns a 32-bit value on IA-32 and a 64-bit value on\r
+  X64.\r
+\r
+  @return The value of the Control Register 0 (CR0).\r
+\r
+**/\r
+UINTN\r
+EFIAPI\r
+AsmReadCr0 (\r
+  VOID\r
+  );\r
+\r
+/**\r
+  Reads the current value of the Control Register 2 (CR2).\r
+\r
+  Reads and returns the current value of CR2. This function is only available\r
+  on IA-32 and X64. This returns a 32-bit value on IA-32 and a 64-bit value on\r
+  X64.\r
+\r
+  @return The value of the Control Register 2 (CR2).\r
+\r
+**/\r
+UINTN\r
+EFIAPI\r
+AsmReadCr2 (\r
+  VOID\r
+  );\r
+\r
+/**\r
+  Reads the current value of the Control Register 3 (CR3).\r
+\r
+  Reads and returns the current value of CR3. This function is only available\r
+  on IA-32 and X64. This returns a 32-bit value on IA-32 and a 64-bit value on\r
+  X64.\r
+\r
+  @return The value of the Control Register 3 (CR3).\r
+\r
+**/\r
+UINTN\r
+EFIAPI\r
+AsmReadCr3 (\r
+  VOID\r
+  );\r
+\r
+/**\r
+  Reads the current value of the Control Register 4 (CR4).\r
+\r
+  Reads and returns the current value of CR4. This function is only available\r
+  on IA-32 and X64. This returns a 32-bit value on IA-32 and a 64-bit value on\r
+  X64.\r
+\r
+  @return The value of the Control Register 4 (CR4).\r
+\r
+**/\r
+UINTN\r
+EFIAPI\r
+AsmReadCr4 (\r
+  VOID\r
+  );\r
+\r
+/**\r
+  Writes a value to Control Register 0 (CR0).\r
+\r
+  Writes and returns a new value to CR0. This function is only available on\r
+  IA-32 and X64. This writes a 32-bit value on IA-32 and a 64-bit value on X64.\r
+\r
+  @param  Cr0 The value to write to CR0.\r
+\r
+  @return The value written to CR0.\r
+\r
+**/\r
+UINTN\r
+EFIAPI\r
+AsmWriteCr0 (\r
+  UINTN  Cr0\r
+  );\r
+\r
+/**\r
+  Writes a value to Control Register 2 (CR2).\r
+\r
+  Writes and returns a new value to CR2. This function is only available on\r
+  IA-32 and X64. This writes a 32-bit value on IA-32 and a 64-bit value on X64.\r
+\r
+  @param  Cr2 The value to write to CR2.\r
+\r
+  @return The value written to CR2.\r
+\r
+**/\r
+UINTN\r
+EFIAPI\r
+AsmWriteCr2 (\r
+  UINTN  Cr2\r
+  );\r
+\r
+/**\r
+  Writes a value to Control Register 3 (CR3).\r
+\r
+  Writes and returns a new value to CR3. This function is only available on\r
+  IA-32 and X64. This writes a 32-bit value on IA-32 and a 64-bit value on X64.\r
+\r
+  @param  Cr3 The value to write to CR3.\r
+\r
+  @return The value written to CR3.\r
+\r
+**/\r
+UINTN\r
+EFIAPI\r
+AsmWriteCr3 (\r
+  UINTN  Cr3\r
+  );\r
+\r
+/**\r
+  Writes a value to Control Register 4 (CR4).\r
+\r
+  Writes and returns a new value to CR4. This function is only available on\r
+  IA-32 and X64. This writes a 32-bit value on IA-32 and a 64-bit value on X64.\r
+\r
+  @param  Cr4 The value to write to CR4.\r
+\r
+  @return The value written to CR4.\r
+\r
+**/\r
+UINTN\r
+EFIAPI\r
+AsmWriteCr4 (\r
+  UINTN  Cr4\r
+  );\r
+\r
+/**\r
+  Reads the current value of Debug Register 0 (DR0).\r
+\r
+  Reads and returns the current value of DR0. This function is only available\r
+  on IA-32 and X64. This returns a 32-bit value on IA-32 and a 64-bit value on\r
+  X64.\r
+\r
+  @return The value of Debug Register 0 (DR0).\r
+\r
+**/\r
+UINTN\r
+EFIAPI\r
+AsmReadDr0 (\r
+  VOID\r
+  );\r
+\r
+/**\r
+  Reads the current value of Debug Register 1 (DR1).\r
+\r
+  Reads and returns the current value of DR1. This function is only available\r
+  on IA-32 and X64. This returns a 32-bit value on IA-32 and a 64-bit value on\r
+  X64.\r
+\r
+  @return The value of Debug Register 1 (DR1).\r
+\r
+**/\r
+UINTN\r
+EFIAPI\r
+AsmReadDr1 (\r
+  VOID\r
+  );\r
+\r
+/**\r
+  Reads the current value of Debug Register 2 (DR2).\r
+\r
+  Reads and returns the current value of DR2. This function is only available\r
+  on IA-32 and X64. This returns a 32-bit value on IA-32 and a 64-bit value on\r
+  X64.\r
+\r
+  @return The value of Debug Register 2 (DR2).\r
+\r
+**/\r
+UINTN\r
+EFIAPI\r
+AsmReadDr2 (\r
+  VOID\r
+  );\r
+\r
+/**\r
+  Reads the current value of Debug Register 3 (DR3).\r
+\r
+  Reads and returns the current value of DR3. This function is only available\r
+  on IA-32 and X64. This returns a 32-bit value on IA-32 and a 64-bit value on\r
+  X64.\r
+\r
+  @return The value of Debug Register 3 (DR3).\r
+\r
+**/\r
+UINTN\r
+EFIAPI\r
+AsmReadDr3 (\r
+  VOID\r
+  );\r
+\r
+/**\r
+  Reads the current value of Debug Register 4 (DR4).\r
+\r
+  Reads and returns the current value of DR4. This function is only available\r
+  on IA-32 and X64. This returns a 32-bit value on IA-32 and a 64-bit value on\r
+  X64.\r
+\r
+  @return The value of Debug Register 4 (DR4).\r
+\r
+**/\r
+UINTN\r
+EFIAPI\r
+AsmReadDr4 (\r
+  VOID\r
+  );\r
+\r
+/**\r
+  Reads the current value of Debug Register 5 (DR5).\r
+\r
+  Reads and returns the current value of DR5. This function is only available\r
+  on IA-32 and X64. This returns a 32-bit value on IA-32 and a 64-bit value on\r
+  X64.\r
+\r
+  @return The value of Debug Register 5 (DR5).\r
+\r
+**/\r
+UINTN\r
+EFIAPI\r
+AsmReadDr5 (\r
+  VOID\r
+  );\r
+\r
+/**\r
+  Reads the current value of Debug Register 6 (DR6).\r
+\r
+  Reads and returns the current value of DR6. This function is only available\r
+  on IA-32 and X64. This returns a 32-bit value on IA-32 and a 64-bit value on\r
+  X64.\r
+\r
+  @return The value of Debug Register 6 (DR6).\r
+\r
+**/\r
+UINTN\r
+EFIAPI\r
+AsmReadDr6 (\r
+  VOID\r
+  );\r
+\r
+/**\r
+  Reads the current value of Debug Register 7 (DR7).\r
+\r
+  Reads and returns the current value of DR7. This function is only available\r
+  on IA-32 and X64. This returns a 32-bit value on IA-32 and a 64-bit value on\r
+  X64.\r
+\r
+  @return The value of Debug Register 7 (DR7).\r
+\r
+**/\r
+UINTN\r
+EFIAPI\r
+AsmReadDr7 (\r
+  VOID\r
+  );\r
+\r
+/**\r
+  Writes a value to Debug Register 0 (DR0).\r
+\r
+  Writes and returns a new value to DR0. This function is only available on\r
+  IA-32 and X64. This writes a 32-bit value on IA-32 and a 64-bit value on X64.\r
+\r
+  @param  Dr0 The value to write to Dr0.\r
+\r
+  @return The value written to Debug Register 0 (DR0).\r
+\r
+**/\r
+UINTN\r
+EFIAPI\r
+AsmWriteDr0 (\r
+  UINTN  Dr0\r
+  );\r
+\r
+/**\r
+  Writes a value to Debug Register 1 (DR1).\r
+\r
+  Writes and returns a new value to DR1. This function is only available on\r
+  IA-32 and X64. This writes a 32-bit value on IA-32 and a 64-bit value on X64.\r
+\r
+  @param  Dr1 The value to write to Dr1.\r
+\r
+  @return The value written to Debug Register 1 (DR1).\r
+\r
+**/\r
+UINTN\r
+EFIAPI\r
+AsmWriteDr1 (\r
+  UINTN  Dr1\r
+  );\r
+\r
+/**\r
+  Writes a value to Debug Register 2 (DR2).\r
+\r
+  Writes and returns a new value to DR2. This function is only available on\r
+  IA-32 and X64. This writes a 32-bit value on IA-32 and a 64-bit value on X64.\r
+\r
+  @param  Dr2 The value to write to Dr2.\r
+\r
+  @return The value written to Debug Register 2 (DR2).\r
+\r
+**/\r
+UINTN\r
+EFIAPI\r
+AsmWriteDr2 (\r
+  UINTN  Dr2\r
+  );\r
+\r
+/**\r
+  Writes a value to Debug Register 3 (DR3).\r
+\r
+  Writes and returns a new value to DR3. This function is only available on\r
+  IA-32 and X64. This writes a 32-bit value on IA-32 and a 64-bit value on X64.\r
+\r
+  @param  Dr3 The value to write to Dr3.\r
+\r
+  @return The value written to Debug Register 3 (DR3).\r
+\r
+**/\r
+UINTN\r
+EFIAPI\r
+AsmWriteDr3 (\r
+  UINTN  Dr3\r
+  );\r
+\r
+/**\r
+  Writes a value to Debug Register 4 (DR4).\r
+\r
+  Writes and returns a new value to DR4. This function is only available on\r
+  IA-32 and X64. This writes a 32-bit value on IA-32 and a 64-bit value on X64.\r
+\r
+  @param  Dr4 The value to write to Dr4.\r
+\r
+  @return The value written to Debug Register 4 (DR4).\r
+\r
+**/\r
+UINTN\r
+EFIAPI\r
+AsmWriteDr4 (\r
+  UINTN  Dr4\r
+  );\r
+\r
+/**\r
+  Writes a value to Debug Register 5 (DR5).\r
+\r
+  Writes and returns a new value to DR5. This function is only available on\r
+  IA-32 and X64. This writes a 32-bit value on IA-32 and a 64-bit value on X64.\r
+\r
+  @param  Dr5 The value to write to Dr5.\r
+\r
+  @return The value written to Debug Register 5 (DR5).\r
+\r
+**/\r
+UINTN\r
+EFIAPI\r
+AsmWriteDr5 (\r
+  UINTN  Dr5\r
+  );\r
+\r
+/**\r
+  Writes a value to Debug Register 6 (DR6).\r
+\r
+  Writes and returns a new value to DR6. This function is only available on\r
+  IA-32 and X64. This writes a 32-bit value on IA-32 and a 64-bit value on X64.\r
+\r
+  @param  Dr6 The value to write to Dr6.\r
+\r
+  @return The value written to Debug Register 6 (DR6).\r
+\r
+**/\r
+UINTN\r
+EFIAPI\r
+AsmWriteDr6 (\r
+  UINTN  Dr6\r
+  );\r
+\r
+/**\r
+  Writes a value to Debug Register 7 (DR7).\r
+\r
+  Writes and returns a new value to DR7. This function is only available on\r
+  IA-32 and X64. This writes a 32-bit value on IA-32 and a 64-bit value on X64.\r
+\r
+  @param  Dr7 The value to write to Dr7.\r
+\r
+  @return The value written to Debug Register 7 (DR7).\r
+\r
+**/\r
+UINTN\r
+EFIAPI\r
+AsmWriteDr7 (\r
+  UINTN  Dr7\r
+  );\r
+\r
+/**\r
+  Reads the current value of Code Segment Register (CS).\r
+\r
+  Reads and returns the current value of CS. This function is only available on\r
+  IA-32 and X64.\r
+\r
+  @return The current value of CS.\r
+\r
+**/\r
+UINT16\r
+EFIAPI\r
+AsmReadCs (\r
+  VOID\r
+  );\r
+\r
+/**\r
+  Reads the current value of Data Segment Register (DS).\r
+\r
+  Reads and returns the current value of DS. This function is only available on\r
+  IA-32 and X64.\r
+\r
+  @return The current value of DS.\r
+\r
+**/\r
+UINT16\r
+EFIAPI\r
+AsmReadDs (\r
+  VOID\r
+  );\r
+\r
+/**\r
+  Reads the current value of Extra Segment Register (ES).\r
+\r
+  Reads and returns the current value of ES. This function is only available on\r
+  IA-32 and X64.\r
+\r
+  @return The current value of ES.\r
+\r
+**/\r
+UINT16\r
+EFIAPI\r
+AsmReadEs (\r
+  VOID\r
+  );\r
+\r
+/**\r
+  Reads the current value of FS Data Segment Register (FS).\r
+\r
+  Reads and returns the current value of FS. This function is only available on\r
+  IA-32 and X64.\r
+\r
+  @return The current value of FS.\r
+\r
+**/\r
+UINT16\r
+EFIAPI\r
+AsmReadFs (\r
+  VOID\r
+  );\r
+\r
+/**\r
+  Reads the current value of GS Data Segment Register (GS).\r
+\r
+  Reads and returns the current value of GS. This function is only available on\r
+  IA-32 and X64.\r
+\r
+  @return The current value of GS.\r
+\r
+**/\r
+UINT16\r
+EFIAPI\r
+AsmReadGs (\r
+  VOID\r
+  );\r
+\r
+/**\r
+  Reads the current value of Stack Segment Register (SS).\r
+\r
+  Reads and returns the current value of SS. This function is only available on\r
+  IA-32 and X64.\r
+\r
+  @return The current value of SS.\r
+\r
+**/\r
+UINT16\r
+EFIAPI\r
+AsmReadSs (\r
+  VOID\r
+  );\r
+\r
+/**\r
+  Reads the current value of Task Register (TR).\r
+\r
+  Reads and returns the current value of TR. This function is only available on\r
+  IA-32 and X64.\r
+\r
+  @return The current value of TR.\r
+\r
+**/\r
+UINT16\r
+EFIAPI\r
+AsmReadTr (\r
+  VOID\r
+  );\r
+\r
+/**\r
+  Reads the current Global Descriptor Table Register(GDTR) descriptor.\r
+\r
+  Reads and returns the current GDTR descriptor and returns it in Gdtr. This\r
+  function is only available on IA-32 and X64.\r
+\r
+  If Gdtr is NULL, then ASSERT().\r
+\r
+  @param  Gdtr  Pointer to a GDTR descriptor.\r
+\r
+**/\r
+VOID\r
+EFIAPI\r
+AsmReadGdtr (\r
+  OUT     IA32_DESCRIPTOR           *Gdtr\r
+  );\r
+\r
+/**\r
+  Writes the current Global Descriptor Table Register (GDTR) descriptor.\r
+\r
+  Writes and the current GDTR descriptor specified by Gdtr. This function is\r
+  only available on IA-32 and X64.\r
+\r
+  If Gdtr is NULL, then ASSERT().\r
+\r
+  @param  Gdtr  Pointer to a GDTR descriptor.\r
+\r
+**/\r
+VOID\r
+EFIAPI\r
+AsmWriteGdtr (\r
+  IN      CONST IA32_DESCRIPTOR     *Gdtr\r
+  );\r
+\r
+/**\r
+  Reads the current Interrupt Descriptor Table Register(GDTR) descriptor.\r
+\r
+  Reads and returns the current IDTR descriptor and returns it in Idtr. This\r
+  function is only available on IA-32 and X64.\r
+\r
+  If Idtr is NULL, then ASSERT().\r
+\r
+  @param  Idtr  Pointer to a IDTR descriptor.\r
+\r
+**/\r
+VOID\r
+EFIAPI\r
+AsmReadIdtr (\r
+  OUT     IA32_DESCRIPTOR           *Idtr\r
+  );\r
+\r
+/**\r
+  Writes the current Interrupt Descriptor Table Register(GDTR) descriptor.\r
+\r
+  Writes the current IDTR descriptor and returns it in Idtr. This function is\r
+  only available on IA-32 and X64.\r
+\r
+  If Idtr is NULL, then ASSERT().\r
+\r
+  @param  Idtr  Pointer to a IDTR descriptor.\r
+\r
+**/\r
+VOID\r
+EFIAPI\r
+AsmWriteIdtr (\r
+  IN      CONST IA32_DESCRIPTOR     *Idtr\r
+  );\r
+\r
+/**\r
+  Reads the current Local Descriptor Table Register(LDTR) selector.\r
+\r
+  Reads and returns the current 16-bit LDTR descriptor value. This function is\r
+  only available on IA-32 and X64.\r
+\r
+  @return The current selector of LDT.\r
+\r
+**/\r
+UINT16\r
+EFIAPI\r
+AsmReadLdtr (\r
+  VOID\r
+  );\r
+\r
+/**\r
+  Writes the current Local Descriptor Table Register (GDTR) selector.\r
+\r
+  Writes and the current LDTR descriptor specified by Ldtr. This function is\r
+  only available on IA-32 and X64.\r
+\r
+  @param  Ldtr  16-bit LDTR selector value.\r
+\r
+**/\r
+VOID\r
+EFIAPI\r
+AsmWriteLdtr (\r
+  IN      UINT16                    Ldtr\r
+  );\r
+\r
+/**\r
+  Save the current floating point/SSE/SSE2 context to a buffer.\r
+\r
+  Saves the current floating point/SSE/SSE2 state to the buffer specified by\r
+  Buffer. Buffer must be aligned on a 16-byte boundary. This function is only\r
+  available on IA-32 and X64.\r
+\r
+  If Buffer is NULL, then ASSERT().\r
+  If Buffer is not aligned on a 16-byte boundary, then ASSERT().\r
+\r
+  @param  Buffer  Pointer to a buffer to save the floating point/SSE/SSE2 context.\r
+\r
+**/\r
+VOID\r
+EFIAPI\r
+AsmFxSave (\r
+  OUT     IA32_FX_BUFFER            *Buffer\r
+  );\r
+\r
+/**\r
+  Restores the current floating point/SSE/SSE2 context from a buffer.\r
+\r
+  Restores the current floating point/SSE/SSE2 state from the buffer specified\r
+  by Buffer. Buffer must be aligned on a 16-byte boundary. This function is\r
+  only available on IA-32 and X64.\r
+\r
+  If Buffer is NULL, then ASSERT().\r
+  If Buffer is not aligned on a 16-byte boundary, then ASSERT().\r
+  If Buffer was not saved with AsmFxSave(), then ASSERT().\r
+\r
+  @param  Buffer  Pointer to a buffer to save the floating point/SSE/SSE2 context.\r
+\r
+**/\r
+VOID\r
+EFIAPI\r
+AsmFxRestore (\r
+  IN      CONST IA32_FX_BUFFER      *Buffer\r
+  );\r
+\r
+/**\r
+  Reads the current value of 64-bit MMX Register #0 (MM0).\r
+\r
+  Reads and returns the current value of MM0. This function is only available\r
+  on IA-32 and X64.\r
+\r
+  @return The current value of MM0.\r
+\r
+**/\r
+UINT64\r
+EFIAPI\r
+AsmReadMm0 (\r
+  VOID\r
+  );\r
+\r
+/**\r
+  Reads the current value of 64-bit MMX Register #1 (MM1).\r
+\r
+  Reads and returns the current value of MM1. This function is only available\r
+  on IA-32 and X64.\r
+\r
+  @return The current value of MM1.\r
+\r
+**/\r
+UINT64\r
+EFIAPI\r
+AsmReadMm1 (\r
+  VOID\r
+  );\r
+\r
+/**\r
+  Reads the current value of 64-bit MMX Register #2 (MM2).\r
+\r
+  Reads and returns the current value of MM2. This function is only available\r
+  on IA-32 and X64.\r
+\r
+  @return The current value of MM2.\r
+\r
+**/\r
+UINT64\r
+EFIAPI\r
+AsmReadMm2 (\r
+  VOID\r
+  );\r
+\r
+/**\r
+  Reads the current value of 64-bit MMX Register #3 (MM3).\r
+\r
+  Reads and returns the current value of MM3. This function is only available\r
+  on IA-32 and X64.\r
+\r
+  @return The current value of MM3.\r
+\r
+**/\r
+UINT64\r
+EFIAPI\r
+AsmReadMm3 (\r
+  VOID\r
+  );\r
+\r
+/**\r
+  Reads the current value of 64-bit MMX Register #4 (MM4).\r
+\r
+  Reads and returns the current value of MM4. This function is only available\r
+  on IA-32 and X64.\r
+\r
+  @return The current value of MM4.\r
+\r
+**/\r
+UINT64\r
+EFIAPI\r
+AsmReadMm4 (\r
+  VOID\r
+  );\r
+\r
+/**\r
+  Reads the current value of 64-bit MMX Register #5 (MM5).\r
+\r
+  Reads and returns the current value of MM5. This function is only available\r
+  on IA-32 and X64.\r
+\r
+  @return The current value of MM5.\r
+\r
+**/\r
+UINT64\r
+EFIAPI\r
+AsmReadMm5 (\r
+  VOID\r
+  );\r
+\r
+/**\r
+  Reads the current value of 64-bit MMX Register #6 (MM6).\r
+\r
+  Reads and returns the current value of MM6. This function is only available\r
+  on IA-32 and X64.\r
+\r
+  @return The current value of MM6.\r
+\r
+**/\r
+UINT64\r
+EFIAPI\r
+AsmReadMm6 (\r
+  VOID\r
+  );\r
+\r
+/**\r
+  Reads the current value of 64-bit MMX Register #7 (MM7).\r
+\r
+  Reads and returns the current value of MM7. This function is only available\r
+  on IA-32 and X64.\r
+\r
+  @return The current value of MM7.\r
+\r
+**/\r
+UINT64\r
+EFIAPI\r
+AsmReadMm7 (\r
+  VOID\r
+  );\r
+\r
+/**\r
+  Writes the current value of 64-bit MMX Register #0 (MM0).\r
+\r
+  Writes the current value of MM0. This function is only available on IA32 and\r
+  X64.\r
+\r
+  @param  Value The 64-bit value to write to MM0.\r
+\r
+**/\r
+VOID\r
+EFIAPI\r
+AsmWriteMm0 (\r
+  IN      UINT64                    Value\r
+  );\r
+\r
+/**\r
+  Writes the current value of 64-bit MMX Register #1 (MM1).\r
+\r
+  Writes the current value of MM1. This function is only available on IA32 and\r
+  X64.\r
+\r
+  @param  Value The 64-bit value to write to MM1.\r
+\r
+**/\r
+VOID\r
+EFIAPI\r
+AsmWriteMm1 (\r
+  IN      UINT64                    Value\r
+  );\r
+\r
+/**\r
+  Writes the current value of 64-bit MMX Register #2 (MM2).\r
+\r
+  Writes the current value of MM2. This function is only available on IA32 and\r
+  X64.\r
+\r
+  @param  Value The 64-bit value to write to MM2.\r
+\r
+**/\r
+VOID\r
+EFIAPI\r
+AsmWriteMm2 (\r
+  IN      UINT64                    Value\r
+  );\r
+\r
+/**\r
+  Writes the current value of 64-bit MMX Register #3 (MM3).\r
+\r
+  Writes the current value of MM3. This function is only available on IA32 and\r
+  X64.\r
+\r
+  @param  Value The 64-bit value to write to MM3.\r
+\r
+**/\r
+VOID\r
+EFIAPI\r
+AsmWriteMm3 (\r
+  IN      UINT64                    Value\r
+  );\r
+\r
+/**\r
+  Writes the current value of 64-bit MMX Register #4 (MM4).\r
+\r
+  Writes the current value of MM4. This function is only available on IA32 and\r
+  X64.\r
+\r
+  @param  Value The 64-bit value to write to MM4.\r
+\r
+**/\r
+VOID\r
+EFIAPI\r
+AsmWriteMm4 (\r
+  IN      UINT64                    Value\r
+  );\r
+\r
+/**\r
+  Writes the current value of 64-bit MMX Register #5 (MM5).\r
+\r
+  Writes the current value of MM5. This function is only available on IA32 and\r
+  X64.\r
+\r
+  @param  Value The 64-bit value to write to MM5.\r
+\r
+**/\r
+VOID\r
+EFIAPI\r
+AsmWriteMm5 (\r
+  IN      UINT64                    Value\r
+  );\r
+\r
+/**\r
+  Writes the current value of 64-bit MMX Register #6 (MM6).\r
+\r
+  Writes the current value of MM6. This function is only available on IA32 and\r
+  X64.\r
+\r
+  @param  Value The 64-bit value to write to MM6.\r
+\r
+**/\r
+VOID\r
+EFIAPI\r
+AsmWriteMm6 (\r
+  IN      UINT64                    Value\r
+  );\r
+\r
+/**\r
+  Writes the current value of 64-bit MMX Register #7 (MM7).\r
+\r
+  Writes the current value of MM7. This function is only available on IA32 and\r
+  X64.\r
+\r
+  @param  Value The 64-bit value to write to MM7.\r
+\r
+**/\r
+VOID\r
+EFIAPI\r
+AsmWriteMm7 (\r
+  IN      UINT64                    Value\r
+  );\r
+\r
+/**\r
+  Reads the current value of Time Stamp Counter (TSC).\r
+\r
+  Reads and returns the current value of TSC. This function is only available\r
+  on IA-32 and X64.\r
+\r
+  @return The current value of TSC\r
+\r
+**/\r
+UINT64\r
+EFIAPI\r
+AsmReadTsc (\r
+  VOID\r
+  );\r
+\r
+/**\r
+  Reads the current value of a Performance Counter (PMC).\r
+\r
+  Reads and returns the current value of performance counter specified by\r
+  Index. This function is only available on IA-32 and X64.\r
+\r
+  @param  Index The 32-bit Performance Counter index to read.\r
+\r
+  @return The value of the PMC specified by Index.\r
+\r
+**/\r
+UINT64\r
+EFIAPI\r
+AsmReadPmc (\r
+  IN      UINT32                    Index\r
+  );\r
+\r
+/**\r
+  Sets up a monitor buffer that is used by AsmMwait().\r
+\r
+  Executes a MONITOR instruction with the register state specified by Eax, Ecx\r
+  and Edx. Returns Eax. This function is only available on IA-32 and X64.\r
+\r
+  @param  Eax The value to load into EAX or RAX before executing the MONITOR\r
+              instruction.\r
+  @param  Ecx The value to load into ECX or RCX before executing the MONITOR\r
+              instruction.\r
+  @param  Edx The value to load into EDX or RDX before executing the MONITOR\r
+              instruction.\r
+\r
+  @return Eax\r
+\r
+**/\r
+UINTN\r
+EFIAPI\r
+AsmMonitor (\r
+  IN      UINTN                     Eax,\r
+  IN      UINTN                     Ecx,\r
+  IN      UINTN                     Edx\r
+  );\r
+\r
+/**\r
+  Executes an MWAIT instruction.\r
+\r
+  Executes an MWAIT instruction with the register state specified by Eax and\r
+  Ecx. Returns Eax. This function is only available on IA-32 and X64.\r
+\r
+  @param  Eax The value to load into EAX or RAX before executing the MONITOR\r
+              instruction.\r
+  @param  Ecx The value to load into ECX or RCX before executing the MONITOR\r
+              instruction.\r
+\r
+  @return Eax\r
+\r
+**/\r
+UINTN\r
+EFIAPI\r
+AsmMwait (\r
+  IN      UINTN                     Eax,\r
+  IN      UINTN                     Ecx\r
+  );\r
+\r
+/**\r
+  Executes a WBINVD instruction.\r
+\r
+  Executes a WBINVD instruction. This function is only available on IA-32 and\r
+  X64.\r
+\r
+**/\r
+VOID\r
+EFIAPI\r
+AsmWbinvd (\r
+  VOID\r
+  );\r
+\r
+/**\r
+  Executes a INVD instruction.\r
+\r
+  Executes a INVD instruction. This function is only available on IA-32 and\r
+  X64.\r
+\r
+**/\r
+VOID\r
+EFIAPI\r
+AsmInvd (\r
+  VOID\r
+  );\r
+\r
+/**\r
+  Flushes a cache line from all the instruction and data caches within the\r
+  coherency domain of the CPU.\r
+\r
+  Flushed the cache line specified by LinearAddress, and returns LinearAddress.\r
+  This function is only available on IA-32 and X64.\r
+\r
+  @param  LinearAddress The address of the cache line to flush. If the CPU is\r
+                        in a physical addressing mode, then LinearAddress is a\r
+                        physical address. If the CPU is in a virtual\r
+                        addressing mode, then LinearAddress is a virtual\r
+                        address.\r
+\r
+  @return LinearAddress\r
+**/\r
+VOID *\r
+EFIAPI\r
+AsmFlushCacheLine (\r
+  IN      VOID                      *LinearAddress\r
+  );\r
+\r
+/**\r
+  Enables the 32-bit paging mode on the CPU.\r
+\r
+  Enables the 32-bit paging mode on the CPU. CR0, CR3, CR4, and the page tables\r
+  must be properly initialized prior to calling this service. This function\r
+  assumes the current execution mode is 32-bit protected mode. This function is\r
+  only available on IA-32. After the 32-bit paging mode is enabled, control is\r
+  transferred to the function specified by EntryPoint using the new stack\r
+  specified by NewStack and passing in the parameters specified by Context1 and\r
+  Context2. Context1 and Context2 are optional and may be NULL. The function\r
+  EntryPoint must never return.\r
+\r
+  If the current execution mode is not 32-bit protected mode, then ASSERT().\r
+  If EntryPoint is NULL, then ASSERT().\r
+  If NewStack is NULL, then ASSERT().\r
+\r
+  There are a number of constraints that must be followed before calling this\r
+  function:\r
+  1)  Interrupts must be disabled.\r
+  2)  The caller must be in 32-bit protected mode with flat descriptors. This\r
+      means all descriptors must have a base of 0 and a limit of 4GB.\r
+  3)  CR0 and CR4 must be compatible with 32-bit protected mode with flat\r
+      descriptors.\r
+  4)  CR3 must point to valid page tables that will be used once the transition\r
+      is complete, and those page tables must guarantee that the pages for this\r
+      function and the stack are identity mapped.\r
+\r
+  @param  EntryPoint  A pointer to function to call with the new stack after\r
+                      paging is enabled.\r
+  @param  Context1    A pointer to the context to pass into the EntryPoint\r
+                      function as the first parameter after paging is enabled.\r
+  @param  Context2    A pointer to the context to pass into the EntryPoint\r
+                      function as the second parameter after paging is enabled.\r
+  @param  NewStack    A pointer to the new stack to use for the EntryPoint\r
+                      function after paging is enabled.\r
+\r
+**/\r
+VOID\r
+EFIAPI\r
+AsmEnablePaging32 (\r
+  IN      SWITCH_STACK_ENTRY_POINT  EntryPoint,\r
+  IN      VOID                      *Context1,  OPTIONAL\r
+  IN      VOID                      *Context2,  OPTIONAL\r
+  IN      VOID                      *NewStack\r
+  );\r
+\r
+/**\r
+  Disables the 32-bit paging mode on the CPU.\r
+\r
+  Disables the 32-bit paging mode on the CPU and returns to 32-bit protected\r
+  mode. This function assumes the current execution mode is 32-paged protected\r
+  mode. This function is only available on IA-32. After the 32-bit paging mode\r
+  is disabled, control is transferred to the function specified by EntryPoint\r
+  using the new stack specified by NewStack and passing in the parameters\r
+  specified by Context1 and Context2. Context1 and Context2 are optional and\r
+  may be NULL. The function EntryPoint must never return.\r
+\r
+  If the current execution mode is not 32-bit paged mode, then ASSERT().\r
+  If EntryPoint is NULL, then ASSERT().\r
+  If NewStack is NULL, then ASSERT().\r
+\r
+  There are a number of constraints that must be followed before calling this\r
+  function:\r
+  1)  Interrupts must be disabled.\r
+  2)  The caller must be in 32-bit paged mode.\r
+  3)  CR0, CR3, and CR4 must be compatible with 32-bit paged mode.\r
+  4)  CR3 must point to valid page tables that guarantee that the pages for\r
+      this function and the stack are identity mapped.\r
+\r
+  @param  EntryPoint  A pointer to function to call with the new stack after\r
+                      paging is disabled.\r
+  @param  Context1    A pointer to the context to pass into the EntryPoint\r
+                      function as the first parameter after paging is disabled.\r
+  @param  Context2    A pointer to the context to pass into the EntryPoint\r
+                      function as the second parameter after paging is\r
+                      disabled.\r
+  @param  NewStack    A pointer to the new stack to use for the EntryPoint\r
+                      function after paging is disabled.\r
+\r
+**/\r
+VOID\r
+EFIAPI\r
+AsmDisablePaging32 (\r
+  IN      SWITCH_STACK_ENTRY_POINT  EntryPoint,\r
+  IN      VOID                      *Context1,  OPTIONAL\r
+  IN      VOID                      *Context2,  OPTIONAL\r
+  IN      VOID                      *NewStack\r
+  );\r
+\r
+/**\r
+  Enables the 64-bit paging mode on the CPU.\r
+\r
+  Enables the 64-bit paging mode on the CPU. CR0, CR3, CR4, and the page tables\r
+  must be properly initialized prior to calling this service. This function\r
+  assumes the current execution mode is 32-bit protected mode with flat\r
+  descriptors. This function is only available on IA-32. After the 64-bit\r
+  paging mode is enabled, control is transferred to the function specified by\r
+  EntryPoint using the new stack specified by NewStack and passing in the\r
+  parameters specified by Context1 and Context2. Context1 and Context2 are\r
+  optional and may be 0. The function EntryPoint must never return.\r
+\r
+  If the current execution mode is not 32-bit protected mode with flat\r
+  descriptors, then ASSERT().\r
+  If EntryPoint is 0, then ASSERT().\r
+  If NewStack is 0, then ASSERT().\r
+\r
+  @param  Cs          The 16-bit selector to load in the CS before EntryPoint\r
+                      is called. The descriptor in the GDT that this selector\r
+                      references must be setup for long mode.\r
+  @param  EntryPoint  The 64-bit virtual address of the function to call with\r
+                      the new stack after paging is enabled.\r
+  @param  Context1    The 64-bit virtual address of the context to pass into\r
+                      the EntryPoint function as the first parameter after\r
+                      paging is enabled.\r
+  @param  Context2    The 64-bit virtual address of the context to pass into\r
+                      the EntryPoint function as the second parameter after\r
+                      paging is enabled.\r
+  @param  NewStack    The 64-bit virtual address of the new stack to use for\r
+                      the EntryPoint function after paging is enabled.\r
+\r
+**/\r
+VOID\r
+EFIAPI\r
+AsmEnablePaging64 (\r
+  IN      UINT16                    CodeSelector,\r
+  IN      UINT64                    EntryPoint,\r
+  IN      UINT64                    Context1,  OPTIONAL\r
+  IN      UINT64                    Context2,  OPTIONAL\r
+  IN      UINT64                    NewStack\r
+  );\r
+\r
+/**\r
+  Disables the 64-bit paging mode on the CPU.\r
+\r
+  Disables the 64-bit paging mode on the CPU and returns to 32-bit protected\r
+  mode. This function assumes the current execution mode is 64-paging mode.\r
+  This function is only available on X64. After the 64-bit paging mode is\r
+  disabled, control is transferred to the function specified by EntryPoint\r
+  using the new stack specified by NewStack and passing in the parameters\r
+  specified by Context1 and Context2. Context1 and Context2 are optional and\r
+  may be 0. The function EntryPoint must never return.\r
+\r
+  If the current execution mode is not 64-bit paged mode, then ASSERT().\r
+  If EntryPoint is 0, then ASSERT().\r
+  If NewStack is 0, then ASSERT().\r
+\r
+  @param  Cs          The 16-bit selector to load in the CS before EntryPoint\r
+                      is called. The descriptor in the GDT that this selector\r
+                      references must be setup for 32-bit protected mode.\r
+  @param  EntryPoint  The 64-bit virtual address of the function to call with\r
+                      the new stack after paging is disabled.\r
+  @param  Context1    The 64-bit virtual address of the context to pass into\r
+                      the EntryPoint function as the first parameter after\r
+                      paging is disabled.\r
+  @param  Context2    The 64-bit virtual address of the context to pass into\r
+                      the EntryPoint function as the second parameter after\r
+                      paging is disabled.\r
+  @param  NewStack    The 64-bit virtual address of the new stack to use for\r
+                      the EntryPoint function after paging is disabled.\r
+\r
+**/\r
+VOID\r
+EFIAPI\r
+AsmDisablePaging64 (\r
+  IN      UINT16                    CodeSelector,\r
+  IN      UINT32                    EntryPoint,\r
+  IN      UINT32                    Context1,  OPTIONAL\r
+  IN      UINT32                    Context2,  OPTIONAL\r
+  IN      UINT32                    NewStack\r
+  );\r
+\r
+//\r
+// 16-bit thunking services\r
+//\r
+\r
+/**\r
+  Retrieves the properties for 16-bit thunk functions.\r
+\r
+  Computes the size of the buffer and stack below 1MB required to use the\r
+  AsmPrepareThunk16(), AsmThunk16() and AsmPrepareAndThunk16() functions. This\r
+  buffer size is returned in RealModeBufferSize, and the stack size is returned\r
+  in ExtraStackSize. If parameters are passed to the 16-bit real mode code,\r
+  then the actual minimum stack size is ExtraStackSize plus the maximum number\r
+  of bytes that need to be passed to the 16-bit real mode code.\r
+\r
+  If RealModeBufferSize is NULL, then ASSERT().\r
+  If ExtraStackSize is NULL, then ASSERT().\r
+\r
+  @param  RealModeBufferSize  A pointer to the size of the buffer below 1MB\r
+                              required to use the 16-bit thunk functions.\r
+  @param  ExtraStackSize      A pointer to the extra size of stack below 1MB\r
+                              that the 16-bit thunk functions require for\r
+                              temporary storage in the transition to and from\r
+                              16-bit real mode.\r
+\r
+**/\r
+VOID\r
+EFIAPI\r
+AsmGetThunk16Properties (\r
+  OUT     UINT32                    *RealModeBufferSize,\r
+  OUT     UINT32                    *ExtraStackSize\r
+  );\r
+\r
+/**\r
+  Prepares all structures a code required to use AsmThunk16().\r
+\r
+  Prepares all structures and code required to use AsmThunk16().\r
+\r
+  If ThunkContext is NULL, then ASSERT().\r
+\r
+  @param  ThunkContext  A pointer to the context structure that describes the\r
+                        16-bit real mode code to call.\r
+\r
+**/\r
+VOID\r
+EFIAPI\r
+AsmPrepareThunk16 (\r
+  OUT     THUNK_CONTEXT             *ThunkContext\r
+  );\r
+\r
+/**\r
+  Transfers control to a 16-bit real mode entry point and returns the results.\r
+\r
+  Transfers control to a 16-bit real mode entry point and returns the results.\r
+  AsmPrepareThunk16() must be called with ThunkContext before this function is\r
+  used.\r
+\r
+  If ThunkContext is NULL, then ASSERT().\r
+  If AsmPrepareThunk16() was not previously called with ThunkContext, then ASSERT().\r
+\r
+  @param  ThunkContext  A pointer to the context structure that describes the\r
+                        16-bit real mode code to call.\r
+\r
+**/\r
+VOID\r
+EFIAPI\r
+AsmThunk16 (\r
+  IN OUT  THUNK_CONTEXT             *ThunkContext\r
+  );\r
+\r
+/**\r
+  Prepares all structures and code for a 16-bit real mode thunk, transfers\r
+  control to a 16-bit real mode entry point, and returns the results.\r
+\r
+  Prepares all structures and code for a 16-bit real mode thunk, transfers\r
+  control to a 16-bit real mode entry point, and returns the results. If the\r
+  caller only need to perform a single 16-bit real mode thunk, then this\r
+  service should be used. If the caller intends to make more than one 16-bit\r
+  real mode thunk, then it is more efficient if AsmPrepareThunk16() is called\r
+  once and AsmThunk16() can be called for each 16-bit real mode thunk.\r
+\r
+  If ThunkContext is NULL, then ASSERT().\r
+\r
+  @param  ThunkContext  A pointer to the context structure that describes the\r
+                        16-bit real mode code to call.\r
+\r
+**/\r
+VOID\r
+EFIAPI\r
+AsmPrepareAndThunk16 (\r
+  IN OUT  THUNK_CONTEXT             *ThunkContext\r
+  );\r
+\r
+#endif\r
diff --git a/Tools/Source/TianoTools/Include/Library/BaseMemoryLib.h b/Tools/Source/TianoTools/Include/Library/BaseMemoryLib.h
new file mode 100644 (file)
index 0000000..5994530
--- /dev/null
@@ -0,0 +1,395 @@
+/** @file\r
+       Memory-only library functions with no library constructor/destructor\r
+\r
+       Copyright (c) 2006, Intel Corporation\r
+       All rights reserved. This program and the accompanying materials\r
+       are licensed and made available under the terms and conditions of the BSD License\r
+       which accompanies this distribution.  The full text of the license may be found at\r
+       http://opensource.org/licenses/bsd-license.php\r
+\r
+       THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+       WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+       Module Name:    BaseMemoryLib.h\r
+\r
+**/\r
+\r
+#ifndef __BASE_MEMORY_LIB__\r
+#define __BASE_MEMORY_LIB__\r
+\r
+/**\r
+  Copy Length bytes from Source to Destination.\r
+\r
+  This function copies Length bytes from SourceBuffer to DestinationBuffer, and\r
+  returns DestinationBuffer. The implementation must be reentrant, and it must\r
+  handle the case where SourceBuffer overlaps DestinationBuffer.\r
+\r
+  If Length is greater than (MAX_ADDRESS - DestinationBuffer + 1), then\r
+  ASSERT().\r
+  If Length is greater than (MAX_ADDRESS - SourceBuffer + 1), then ASSERT().\r
+\r
+  @param  Destination Target of copy\r
+  @param  Source Place to copy from\r
+  @param  Length Number of bytes to copy\r
+\r
+  @return Destination\r
+\r
+**/\r
+VOID *\r
+EFIAPI\r
+CopyMem (\r
+  OUT     VOID                      *DestinationBuffer,\r
+  IN      CONST VOID                *SourceBuffer,\r
+  IN      UINTN                     Length\r
+  );\r
+\r
+/**\r
+  Set Buffer to Value for Size bytes.\r
+\r
+  This function fills Length bytes of Buffer with Value, and returns Buffer.\r
+\r
+  If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().\r
+\r
+  @param  Buffer Memory to set.\r
+  @param  Size Number of bytes to set\r
+  @param  Value Value of the set operation.\r
+\r
+  @return Buffer\r
+\r
+**/\r
+VOID *\r
+EFIAPI\r
+SetMem (\r
+  OUT     VOID                      *Buffer,\r
+  IN      UINTN                     Length,\r
+  IN      UINT8                     Value\r
+  );\r
+\r
+/**\r
+  Fills a target buffer with a 16-bit value, and returns the target buffer.\r
+\r
+  This function fills Length bytes of Buffer with the 16-bit value specified by\r
+  Value, and returns Buffer. Value is repeated every 16-bits in for Length\r
+  bytes of Buffer.\r
+\r
+  If Buffer is NULL and Length > 0, then ASSERT().\r
+  If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().\r
+  If Buffer is not aligned on a 16-bit boundary, then ASSERT().\r
+  If Length is not aligned on a 16-bit boundary, then ASSERT().\r
+\r
+  @param  Buffer  Pointer to the target buffer to fill.\r
+  @param  Length  Number of bytes in Buffer to fill.\r
+  @param  Value   Value with which to fill Length bytes of Buffer.\r
+\r
+  @return Buffer\r
+\r
+**/\r
+VOID *\r
+EFIAPI\r
+SetMem16 (\r
+  OUT     VOID                      *Buffer,\r
+  IN      UINTN                     Length,\r
+  IN      UINT16                    Value\r
+  );\r
+\r
+/**\r
+  Fills a target buffer with a 32-bit value, and returns the target buffer.\r
+\r
+  This function fills Length bytes of Buffer with the 32-bit value specified by\r
+  Value, and returns Buffer. Value is repeated every 32-bits in for Length\r
+  bytes of Buffer.\r
+\r
+  If Buffer is NULL and Length > 0, then ASSERT().\r
+  If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().\r
+  If Buffer is not aligned on a 32-bit boundary, then ASSERT().\r
+  If Length is not aligned on a 32-bit boundary, then ASSERT().\r
+\r
+  @param  Buffer  Pointer to the target buffer to fill.\r
+  @param  Length  Number of bytes in Buffer to fill.\r
+  @param  Value   Value with which to fill Length bytes of Buffer.\r
+\r
+  @return Buffer\r
+\r
+**/\r
+VOID *\r
+EFIAPI\r
+SetMem32 (\r
+  OUT     VOID                      *Buffer,\r
+  IN      UINTN                     Length,\r
+  IN      UINT32                    Value\r
+  );\r
+\r
+/**\r
+  Fills a target buffer with a 64-bit value, and returns the target buffer.\r
+\r
+  This function fills Length bytes of Buffer with the 64-bit value specified by\r
+  Value, and returns Buffer. Value is repeated every 64-bits in for Length\r
+  bytes of Buffer.\r
+\r
+  If Buffer is NULL and Length > 0, then ASSERT().\r
+  If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().\r
+  If Buffer is not aligned on a 64-bit boundary, then ASSERT().\r
+  If Length is not aligned on a 64-bit boundary, then ASSERT().\r
+\r
+  @param  Buffer  Pointer to the target buffer to fill.\r
+  @param  Length  Number of bytes in Buffer to fill.\r
+  @param  Value   Value with which to fill Length bytes of Buffer.\r
+\r
+  @return Buffer\r
+\r
+**/\r
+VOID *\r
+EFIAPI\r
+SetMem64 (\r
+  OUT     VOID                      *Buffer,\r
+  IN      UINTN                     Length,\r
+  IN      UINT64                    Value\r
+  );\r
+\r
+/**\r
+  Set Buffer to 0 for Size bytes.\r
+\r
+  This function fills Length bytes of Buffer with zeros, and returns Buffer.\r
+\r
+  If Buffer is NULL and Length > 0, then ASSERT().\r
+  If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().\r
+\r
+  @param  Buffer Memory to set.\r
+  @param  Size Number of bytes to set\r
+\r
+  @return Buffer\r
+\r
+**/\r
+VOID *\r
+EFIAPI\r
+ZeroMem (\r
+  OUT     VOID                      *Buffer,\r
+  IN      UINTN                     Length\r
+  );\r
+\r
+/**\r
+  Compares two memory buffers of a given length.\r
+\r
+  This function compares Length bytes of SourceBuffer to Length bytes of\r
+  DestinationBuffer. If all Length bytes of the two buffers are identical, then\r
+  0 is returned. Otherwise, the value returned is the first mismatched byte in\r
+  SourceBuffer subtracted from the first mismatched byte in DestinationBuffer.\r
+\r
+  If DestinationBuffer is NULL and Length > 0, then ASSERT().\r
+  If SourceBuffer is NULL and Length > 0, then ASSERT().\r
+  If Length is greater than (MAX_ADDRESS - DestinationBuffer + 1), then\r
+  ASSERT().\r
+  If Length is greater than (MAX_ADDRESS - SourceBuffer + 1), then ASSERT().\r
+\r
+  @param  DestinationBuffer First memory buffer\r
+  @param  SourceBuffer      Second memory buffer\r
+  @param  Length            Length of DestinationBuffer and SourceBuffer memory\r
+                            regions to compare\r
+\r
+  @retval 0         if DestinationBuffer == SourceBuffer\r
+  @retval Non-zero  if DestinationBuffer != SourceBuffer\r
+\r
+**/\r
+INTN\r
+EFIAPI\r
+CompareMem (\r
+  IN      CONST VOID                *DestinationBuffer,\r
+  IN      CONST VOID                *SourceBuffer,\r
+  IN      UINTN                     Length\r
+  );\r
+\r
+/**\r
+  Scans a target buffer for an 8-bit value, and returns a pointer to the\r
+  matching 8-bit value in the target buffer.\r
+\r
+  This function searches target the buffer specified by Buffer and Length from\r
+  the lowest address to the highest address for an 8-bit value that matches\r
+  Value. If a match is found, then a pointer to the matching byte in the target\r
+  buffer is returned. If no match is found, then NULL is returned. If Length is\r
+  0, then NULL is returned.\r
+\r
+  If Buffer is NULL, then ASSERT().\r
+  If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().\r
+\r
+  @param  Buffer  Pointer to the target buffer to scan.\r
+  @param  Length  Number of bytes in Buffer to scan.\r
+  @param  Value   Value to search for in the target buffer.\r
+\r
+  @return Pointer to the first occurrence or NULL if not found.\r
+  @retval NULL  if Length == 0 or Value was not found.\r
+\r
+**/\r
+VOID *\r
+EFIAPI\r
+ScanMem8 (\r
+  IN      CONST VOID                *Buffer,\r
+  IN      UINTN                     Length,\r
+  IN      UINT8                     Value\r
+  );\r
+\r
+/**\r
+  Scans a target buffer for a 16-bit value, and returns a pointer to the\r
+  matching 16-bit value in the target buffer.\r
+\r
+  This function searches target the buffer specified by Buffer and Length from\r
+  the lowest address to the highest address at 16-bit increments for a 16-bit\r
+  value that matches Value. If a match is found, then a pointer to the matching\r
+  value in the target buffer is returned. If no match is found, then NULL is\r
+  returned. If Length is 0, then NULL is returned.\r
+\r
+  If Buffer is NULL, then ASSERT().\r
+  If Buffer is not aligned on a 16-bit boundary, then ASSERT().\r
+  If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().\r
+\r
+  @param  Buffer  Pointer to the target buffer to scan.\r
+  @param  Length  Number of bytes in Buffer to scan.\r
+  @param  Value   Value to search for in the target buffer.\r
+\r
+  @return Pointer to the first occurrence.\r
+  @retval NULL  if Length == 0 or Value was not found.\r
+\r
+**/\r
+VOID *\r
+EFIAPI\r
+ScanMem16 (\r
+  IN      CONST VOID                *Buffer,\r
+  IN      UINTN                     Length,\r
+  IN      UINT16                    Value\r
+  );\r
+\r
+/**\r
+  Scans a target buffer for a 32-bit value, and returns a pointer to the\r
+  matching 32-bit value in the target buffer.\r
+\r
+  This function searches target the buffer specified by Buffer and Length from\r
+  the lowest address to the highest address at 32-bit increments for a 32-bit\r
+  value that matches Value. If a match is found, then a pointer to the matching\r
+  value in the target buffer is returned. If no match is found, then NULL is\r
+  returned. If Length is 0, then NULL is returned.\r
+\r
+  If Buffer is NULL, then ASSERT().\r
+  If Buffer is not aligned on a 32-bit boundary, then ASSERT().\r
+  If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().\r
+\r
+  @param  Buffer  Pointer to the target buffer to scan.\r
+  @param  Length  Number of bytes in Buffer to scan.\r
+  @param  Value   Value to search for in the target buffer.\r
+\r
+  @return Pointer to the first occurrence or NULL if not found.\r
+  @retval NULL  if Length == 0 or Value was not found.\r
+\r
+**/\r
+VOID *\r
+EFIAPI\r
+ScanMem32 (\r
+  IN      CONST VOID                *Buffer,\r
+  IN      UINTN                     Length,\r
+  IN      UINT32                    Value\r
+  );\r
+\r
+/**\r
+  Scans a target buffer for a 64-bit value, and returns a pointer to the\r
+  matching 64-bit value in the target buffer.\r
+\r
+  This function searches target the buffer specified by Buffer and Length from\r
+  the lowest address to the highest address at 64-bit increments for a 64-bit\r
+  value that matches Value. If a match is found, then a pointer to the matching\r
+  value in the target buffer is returned. If no match is found, then NULL is\r
+  returned. If Length is 0, then NULL is returned.\r
+\r
+  If Buffer is NULL, then ASSERT().\r
+  If Buffer is not aligned on a 64-bit boundary, then ASSERT().\r
+  If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().\r
+\r
+  @param  Buffer  Pointer to the target buffer to scan.\r
+  @param  Length  Number of bytes in Buffer to scan.\r
+  @param  Value   Value to search for in the target buffer.\r
+\r
+  @return Pointer to the first occurrence or NULL if not found.\r
+  @retval NULL  if Length == 0 or Value was not found.\r
+\r
+**/\r
+VOID *\r
+EFIAPI\r
+ScanMem64 (\r
+  IN      CONST VOID                *Buffer,\r
+  IN      UINTN                     Length,\r
+  IN      UINT64                    Value\r
+  );\r
+\r
+/**\r
+  This function copies a source GUID to a destination GUID.\r
+\r
+  This function copies the contents of the 128-bit GUID specified by SourceGuid\r
+  to DestinationGuid, and returns DestinationGuid.\r
+\r
+  If DestinationGuid is NULL, then ASSERT().\r
+  If SourceGuid is NULL, then ASSERT().\r
+\r
+  @param  DestinationGuid Pointer to the destination GUID.\r
+  @param  SourceGuid Pointer to the source GUID.\r
+\r
+  @return DestinationGuid\r
+\r
+**/\r
+GUID *\r
+EFIAPI\r
+CopyGuid (\r
+  OUT     GUID                      *DestinationGuid,\r
+  IN      CONST GUID                *SourceGuid\r
+  );\r
+\r
+/**\r
+  Compares two GUIDs\r
+\r
+  This function compares Guid1 to Guid2. If the GUIDs are identical then TRUE\r
+  is returned. If there are any bit differences in the two GUIDs, then FALSE is\r
+  returned.\r
+\r
+  If Guid1 is NULL, then ASSERT().\r
+  If Guid2 is NULL, then ASSERT().\r
+\r
+  @param  Guid1 guid to compare\r
+  @param  Guid2 guid to compare\r
+\r
+  @retval TRUE  if Guid1 == Guid2\r
+  @retval FALSE if Guid1 != Guid2\r
+\r
+**/\r
+BOOLEAN\r
+EFIAPI\r
+CompareGuid (\r
+  IN      CONST GUID                *Guid1,\r
+  IN      CONST GUID                *Guid2\r
+  );\r
+\r
+/**\r
+  Scans a target buffer for a GUID, and returns a pointer to the matching GUID\r
+  in the target buffer.\r
+\r
+  This function searches target the buffer specified by Buffer and Length from\r
+  the lowest address to the highest address at 128-bit increments for the\r
+  128-bit GUID value that matches Guid. If a match is found, then a pointer to\r
+  the matching GUID in the target buffer is returned. If no match is found,\r
+  then NULL is returned. If Length is 0, then NULL is returned.\r
+\r
+  If Buffer is NULL, then ASSERT().\r
+  If Buffer is not aligned on a 64-bit boundary, then ASSERT().\r
+  If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().\r
+\r
+  @param  Buffer  Pointer to the target buffer to scan.\r
+  @param  Length  Number of bytes in Buffer to scan.\r
+  @param  Guid    Value to search for in the target buffer.\r
+\r
+  @return Pointer to the first occurrence.\r
+  @retval NULL  if Length == 0 or Guid was not found.\r
+**/\r
+VOID *\r
+EFIAPI\r
+ScanGuid (\r
+  IN      CONST VOID                *Buffer,\r
+  IN      UINTN                     Length,\r
+  IN      CONST GUID                *Guid\r
+  );\r
+\r
+#endif\r
diff --git a/Tools/Source/TianoTools/Include/Library/PcdLib.h b/Tools/Source/TianoTools/Include/Library/PcdLib.h
new file mode 100644 (file)
index 0000000..03493e2
--- /dev/null
@@ -0,0 +1,699 @@
+/** @file\r
+PCD Library Class Interface Declarations\r
+\r
+Copyright (c) 2006, Intel Corporation                                                         \r
+All rights reserved. This program and the accompanying materials                          \r
+are licensed and made available under the terms and conditions of the BSD License         \r
+which accompanies this distribution.  The full text of the license may be found at        \r
+http://opensource.org/licenses/bsd-license.php                                            \r
+                                                                                          \r
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+\r
+Module Name: PcdLib.h\r
+\r
+**/\r
+\r
+#ifndef __PCD_LIB_H__\r
+#define __PCD_LIB_H__\r
+\r
+#define PCD_INVALID_TOKEN_NUMBER ((UINTN) -1)\r
+\r
+#define PcdToken(TokenName)  _PCD_TOKEN_##TokenName\r
+\r
+\r
+//\r
+// Feature Flag is in the form of a global constant\r
+//\r
+#define FeaturePcdGet(TokenName)     _gPcd_FixedAtBuild_##TokenName\r
+\r
+\r
+//\r
+// Fixed is fixed at build time\r
+//\r
+#define FixedPcdGet8(TokenName)     _gPcd_FixedAtBuild_##TokenName\r
+#define FixedPcdGet16(TokenName)    _gPcd_FixedAtBuild_##TokenName\r
+#define FixedPcdGet32(TokenName)    _gPcd_FixedAtBuild_##TokenName\r
+#define FixedPcdGet64(TokenName)    _gPcd_FixedAtBuild_##TokenName\r
+#define FixedPcdGetBool(TokenName)  _gPcd_FixedAtBuild_##TokenName\r
+\r
+\r
+//\r
+// BugBug: This works for strings, but not constants.\r
+//\r
+#define FixedPcdGetPtr(TokenName)    ((VOID *)_gPcd_FixedAtBuild_##TokenName)\r
+\r
+\r
+//\r
+// (Binary) Patch is in the form of a global variable\r
+//\r
+#define PatchPcdGet8(TokenName)     _gPcd_BinaryPatch_##TokenName\r
+#define PatchPcdGet16(TokenName)    _gPcd_BinaryPatch_##TokenName\r
+#define PatchPcdGet32(TokenName)    _gPcd_BinaryPatch_##TokenName\r
+#define PatchPcdGet64(TokenName)    _gPcd_BinaryPatch_##TokenName\r
+#define PatchPcdGetBool(TokenName)  _gPcd_BinaryPatch_##TokenName\r
+#define PatchPcdGetPtr(TokenName)   ((VOID *)_gPcd_BinaryPatch_##TokenName)\r
+\r
+#define PatchPcdSet8(TokenName, Value)     (_gPcd_BinaryPatch_##TokenName = Value)\r
+#define PatchPcdSet16(TokenName, Value)    (_gPcd_BinaryPatch_##TokenName = Value)\r
+#define PatchPcdSet32(TokenName, Value)    (_gPcd_BinaryPatch_##TokenName = Value)\r
+#define PatchPcdSet64(TokenName, Value)    (_gPcd_BinaryPatch_##TokenName = Value)\r
+#define PatchPcdSetBool(TokenName, Value)  (_gPcd_BinaryPatch_##TokenName = Value)\r
+#define PatchPcdSetPtr(TokenName, Value, Size)   CopyMem (_gPcd_BinaryPatch_##TokenName, Value, Size)\r
+\r
+//\r
+// Dynamic is via the protocol with only the TokenNumber as argument\r
+//  It can also be Patch or Fixed type based on a build option\r
+//\r
+#define PcdGet8(TokenName)          _PCD_MODE_8_##TokenName\r
+#define PcdGet16(TokenName)         _PCD_MODE_16_##TokenName\r
+#define PcdGet32(TokenName)         _PCD_MODE_32_##TokenName\r
+#define PcdGet64(TokenName)         _PCD_MODE_64_##TokenName\r
+#define PcdGetPtr(TokenName)        _PCD_MODE_PTR_##TokenName\r
+#define PcdGetBool(TokenName)       _PCD_MODE_BOOL_##TokenName\r
+\r
+\r
+//\r
+// Dynamic Ex is to support binary distribution\r
+//\r
+#define PcdGetEx8(Guid, TokenName)     LibPcdGetEx8 (Guid, _PCD_TOKEN_##TokenName)\r
+#define PcdGetEx16(Guid, TokenName)    LibPcdGetEx16 (Guid, _PCD_TOKEN_##TokenName)\r
+#define PcdGetEx32(Guid, TokenName)    LibPcdGetEx32 (Guid, _PCD_TOKEN_##TokenName)\r
+#define PcdGetEx64(Guid, TokenName)    LibPcdGetEx64 (Guid, _PCD_TOKEN_##TokenName)\r
+#define PcdGetExPtr(Guid, TokenName)   LibPcdGetExPtr (Guid, _PCD_TOKEN_##TokenName)\r
+#define PcdGetExBool(Guid, TokenName)  LibPcdGetExBool (Guid, _PCD_TOKEN_##TokenName)\r
+\r
+\r
+//\r
+// Dynamic Set\r
+//\r
+#define PcdSet8(TokenName, Value)       LibPcdSet8   (_PCD_TOKEN_##TokenName, Value)\r
+#define PcdSet16(TokenName, Value)      LibPcdSet16  (_PCD_TOKEN_##TokenName, Value)\r
+#define PcdSet32(TokenName, Value)      LibPcdSet32  (_PCD_TOKEN_##TokenName, Value)\r
+#define PcdSet64(TokenName, Value)      LibPcdSet64  (_PCD_TOKEN_##TokenName, Value)\r
+#define PcdSetPtr(TokenName, SizeOfBuffer, Buffer)     LibPcdSetPtr (_PCD_TOKEN_##TokenName, SizeOfBuffer, Buffer)\r
+#define PcdSetBool(TokenName, Value)    LibPcdSetBool(_PCD_TOKEN_##TokenName, Value)\r
+\r
+\r
+//\r
+// Dynamic Set Ex\r
+//\r
+#define PcdSetEx8(Guid, TokenName, Value)      LibPcdSetEx8   (Guid, _PCD_TOKEN_##TokenName, Value)\r
+#define PcdSetEx16(Guid, TokenName, Value)     LibPcdSetEx16  (Guid, _PCD_TOKEN_##TokenName, Value)\r
+#define PcdSetEx32(Guid, TokenName, Value)     LibPcdSetEx32  (Guid, _PCD_TOKEN_##TokenName, Value)\r
+#define PcdSetEx64(Guid, TokenName, Value)     LibPcdSetEx64  (Guid, _PCD_TOKEN_##TokenName, Value)\r
+#define PcdSetExPtr(Guid, TokenName, SizeOfBuffer, Buffer)    LibPcdSetExPtr (Guid, _PCD_TOKEN_##TokenName, SizeOfBuffer, Buffer)\r
+#define PcdSetExBool(Guid, TokenName, Value)   LibPcdSetExBool(Guid, _PCD_TOKEN_##TokenName, Value)\r
+\r
+\r
+/**\r
+  Sets the current SKU in the PCD database to the value specified by SkuId.  SkuId is returned.\r
+\r
+  @param[in]  SkuId The SKU value that will be used when the PCD service will retrieve and \r
+              set values associated with a PCD token.\r
+\r
+  @retval SKU_ID Return the SKU ID that just be set.\r
+\r
+**/\r
+UINTN\r
+EFIAPI\r
+LibPcdSetSku (\r
+  IN UINTN   SkuId\r
+  );\r
+\r
+\r
+/**\r
+  Returns the 8-bit value for the token specified by TokenNumber. \r
+\r
+  @param[in]  The PCD token number to retrieve a current value for.\r
+\r
+  @retval UINT8 Returns the 8-bit value for the token specified by TokenNumber. \r
+\r
+**/\r
+UINT8\r
+EFIAPI\r
+LibPcdGet8 (\r
+  IN UINTN             TokenNumber\r
+  );\r
+\r
+\r
+/**\r
+  Returns the 16-bit value for the token specified by TokenNumber. \r
+\r
+  @param[in]  The PCD token number to retrieve a current value for.\r
+\r
+  @retval UINT16 Returns the 16-bit value for the token specified by TokenNumber. \r
+\r
+**/\r
+UINT16\r
+EFIAPI\r
+LibPcdGet16 (\r
+  IN UINTN             TokenNumber\r
+  );\r
+\r
+\r
+/**\r
+  Returns the 32-bit value for the token specified by TokenNumber. \r
+\r
+  @param[in]  TokenNumber The PCD token number to retrieve a current value for.\r
+\r
+  @retval UINT32 Returns the 32-bit value for the token specified by TokenNumber.\r
+\r
+**/\r
+UINT32\r
+EFIAPI\r
+LibPcdGet32 (\r
+  IN UINTN             TokenNumber\r
+  );\r
+\r
+\r
+/**\r
+  Returns the 64-bit value for the token specified by TokenNumber.\r
+\r
+  @param[in]  TokenNumber The PCD token number to retrieve a current value for.\r
+\r
+  @retval UINT64 Returns the 64-bit value for the token specified by TokenNumber.\r
+\r
+**/\r
+UINT64\r
+EFIAPI\r
+LibPcdGet64 (\r
+  IN UINTN             TokenNumber\r
+  );\r
+\r
+\r
+/**\r
+  Returns the pointer to the buffer of the token specified by TokenNumber.\r
+\r
+  @param[in]  TokenNumber The PCD token number to retrieve a current value for.\r
+\r
+  @retval VOID* Returns the pointer to the token specified by TokenNumber.\r
+\r
+**/\r
+VOID *\r
+EFIAPI\r
+LibPcdGetPtr (\r
+  IN UINTN             TokenNumber\r
+  );\r
+\r
+\r
+/**\r
+  Returns the Boolean value of the token specified by TokenNumber. \r
+\r
+  @param[in]  TokenNumber The PCD token number to retrieve a current value for.\r
+\r
+  @retval BOOLEAN Returns the Boolean value of the token specified by TokenNumber. \r
+\r
+**/\r
+BOOLEAN \r
+EFIAPI\r
+LibPcdGetBool (\r
+  IN UINTN             TokenNumber\r
+  );\r
+\r
+\r
+/**\r
+  Returns the size of the token specified by TokenNumber. \r
+\r
+  @param[in]  TokenNumber The PCD token number to retrieve a current value for.\r
+\r
+  @retval UINTN Returns the size of the token specified by TokenNumber. \r
+\r
+**/\r
+UINTN\r
+EFIAPI\r
+LibPcdGetSize (\r
+  IN UINTN             TokenNumber\r
+  );\r
+\r
+\r
+/**\r
+  Returns the 8-bit value for the token specified by TokenNumber and Guid.\r
+  If Guid is NULL, then ASSERT(). \r
+\r
+  @param[in]  Guid Pointer to a 128-bit unique value that designates \r
+              which namespace to retrieve a value from.\r
+  @param[in]  TokenNumber The PCD token number to retrieve a current value for.\r
+\r
+  @retval UINT8 Return the UINT8.\r
+\r
+**/\r
+UINT8\r
+EFIAPI\r
+LibPcdGetEx8 (\r
+  IN CONST GUID        *Guid,\r
+  IN UINTN             TokenNumber\r
+  );\r
+\r
+\r
+/**\r
+  Returns the 16-bit value for the token specified by TokenNumber and Guid.\r
+  If Guid is NULL, then ASSERT(). \r
+\r
+  @param[in]  Guid Pointer to a 128-bit unique value that designates \r
+              which namespace to retrieve a value from.\r
+  @param[in]  TokenNumber The PCD token number to retrieve a current value for.\r
+\r
+  @retval UINT16 Return the UINT16.\r
+\r
+**/\r
+UINT16\r
+EFIAPI\r
+LibPcdGetEx16 (\r
+  IN CONST GUID        *Guid,\r
+  IN UINTN             TokenNumber\r
+  );\r
+\r
+\r
+/**\r
+  Returns the 32-bit value for the token specified by TokenNumber and Guid.\r
+  If Guid is NULL, then ASSERT(). \r
+\r
+  @param[in]  Guid Pointer to a 128-bit unique value that designates \r
+              which namespace to retrieve a value from.\r
+  @param[in]  TokenNumber The PCD token number to retrieve a current value for.\r
+\r
+  @retval UINT32 Return the UINT32.\r
+\r
+**/\r
+UINT32\r
+EFIAPI\r
+LibPcdGetEx32 (\r
+  IN CONST GUID        *Guid,\r
+  IN UINTN             TokenNumber\r
+  );\r
+\r
+\r
+/**\r
+  Returns the 64-bit value for the token specified by TokenNumber and Guid.\r
+  If Guid is NULL, then ASSERT(). \r
+\r
+  @param[in]  Guid Pointer to a 128-bit unique value that designates \r
+              which namespace to retrieve a value from.\r
+  @param[in]  TokenNumber The PCD token number to retrieve a current value for.\r
+\r
+  @retval UINT64 Return the UINT64.\r
+\r
+**/\r
+UINT64\r
+EFIAPI\r
+LibPcdGetEx64 (\r
+  IN CONST GUID        *Guid,\r
+  IN UINTN             TokenNumber\r
+  );\r
+\r
+\r
+/**\r
+  Returns the pointer to the buffer of token specified by TokenNumber and Guid.\r
+  If Guid is NULL, then ASSERT(). \r
+\r
+  @param[in]  Guid Pointer to a 128-bit unique value that designates \r
+              which namespace to retrieve a value from.\r
+  @param[in]  TokenNumber The PCD token number to retrieve a current value for.\r
+\r
+  @retval VOID* Return the VOID* pointer.\r
+\r
+**/\r
+VOID *\r
+EFIAPI\r
+LibPcdGetExPtr (\r
+  IN CONST GUID        *Guid,\r
+  IN UINTN             TokenNumber\r
+  );\r
+\r
+\r
+/**\r
+  Returns the Boolean value of the token specified by TokenNumber and Guid. \r
+  If Guid is NULL, then ASSERT(). \r
+\r
+  @param[in]  Guid Pointer to a 128-bit unique value that designates \r
+              which namespace to retrieve a value from.\r
+  @param[in]  TokenNumber The PCD token number to retrieve a current value for.\r
+\r
+  @retval BOOLEAN Return the BOOLEAN.\r
+\r
+**/\r
+BOOLEAN\r
+EFIAPI\r
+LibPcdGetExBool (\r
+  IN CONST GUID        *Guid,\r
+  IN UINTN             TokenNumber\r
+  );\r
+\r
+\r
+/**\r
+  Returns the size of the token specified by TokenNumber and Guid. \r
+  If Guid is NULL, then ASSERT(). \r
+\r
+  @param[in]  Guid Pointer to a 128-bit unique value that designates \r
+              which namespace to retrieve a value from.\r
+  @param[in]  TokenNumber The PCD token number to retrieve a current value for.\r
+\r
+  @retval UINTN Return the size.\r
+\r
+**/\r
+UINTN\r
+EFIAPI\r
+LibPcdGetExSize (\r
+  IN CONST GUID        *Guid,\r
+  IN UINTN             TokenNumber\r
+  );\r
+\r
+\r
+/**\r
+  Sets the 8-bit value for the token specified by TokenNumber \r
+  to the value specified by Value.  Value is returned.\r
+  \r
+  @param[in]  TokenNumber The PCD token number to set a current value for.\r
+  @param[in]  Value The 8-bit value to set.\r
+\r
+  @retval UINT8 Return the value been set.\r
+\r
+**/\r
+UINT8\r
+EFIAPI\r
+LibPcdSet8 (\r
+  IN UINTN             TokenNumber,\r
+  IN UINT8             Value\r
+  );\r
+\r
+\r
+/**\r
+  Sets the 16-bit value for the token specified by TokenNumber \r
+  to the value specified by Value.  Value is returned.\r
+  \r
+  @param[in]  TokenNumber The PCD token number to set a current value for.\r
+  @param[in]  Value The 16-bit value to set.\r
+\r
+  @retval UINT16 Return the value been set.\r
+\r
+**/\r
+UINT16\r
+EFIAPI\r
+LibPcdSet16 (\r
+  IN UINTN             TokenNumber,\r
+  IN UINT16            Value\r
+  );\r
+\r
+\r
+/**\r
+  Sets the 32-bit value for the token specified by TokenNumber \r
+  to the value specified by Value.  Value is returned.\r
+  \r
+  @param[in]  TokenNumber The PCD token number to set a current value for.\r
+  @param[in]  Value The 32-bit value to set.\r
+\r
+  @retval UINT32 Return the value been set.\r
+\r
+**/\r
+UINT32\r
+EFIAPI\r
+LibPcdSet32 (\r
+  IN UINTN             TokenNumber,\r
+  IN UINT32            Value\r
+  );\r
+\r
+\r
+/**\r
+  Sets the 64-bit value for the token specified by TokenNumber \r
+  to the value specified by Value.  Value is returned.\r
+  \r
+  @param[in]  TokenNumber The PCD token number to set a current value for.\r
+  @param[in]  Value The 64-bit value to set.\r
+\r
+  @retval UINT64 Return the value been set.\r
+\r
+**/\r
+UINT64\r
+EFIAPI\r
+LibPcdSet64 (\r
+  IN UINTN             TokenNumber,\r
+  IN UINT64            Value\r
+  );\r
+\r
+\r
+/**\r
+  Sets a buffer for the token specified by TokenNumber to \r
+  the value specified by Value.     Value is returned.\r
+  If Value is NULL, then ASSERT().\r
+  \r
+  @param[in]  TokenNumber The PCD token number to set a current value for.\r
+  @param[in]  Value A pointer to the buffer to set.\r
+\r
+  @retval VOID* Return the pointer for the buffer been set.\r
+\r
+**/\r
+VOID*\r
+EFIAPI\r
+LibPcdSetPtr (\r
+  IN UINTN             TokenNumber,\r
+  IN UINTN             SizeOfBuffer,\r
+  IN VOID              *Value\r
+  );\r
+\r
+\r
+/**\r
+  Sets the Boolean value for the token specified by TokenNumber \r
+  to the value specified by Value.  Value is returned.\r
+  \r
+  @param[in]  TokenNumber The PCD token number to set a current value for.\r
+  @param[in]  Value The boolean value to set.\r
+\r
+  @retval BOOLEAN Return the value been set.\r
+\r
+**/\r
+BOOLEAN\r
+EFIAPI\r
+LibPcdSetBool (\r
+  IN UINTN             TokenNumber,\r
+  IN BOOLEAN           Value\r
+  );\r
+\r
+\r
+/**\r
+  Sets the 8-bit value for the token specified by TokenNumber and \r
+  Guid to the value specified by Value. Value is returned.\r
+  If Guid is NULL, then ASSERT().\r
+  \r
+  @param[in]  Guid Pointer to a 128-bit unique value that \r
+              designates which namespace to set a value from.\r
+  @param[in]  TokenNumber The PCD token number to set a current value for.\r
+  @param[in]  Value The 8-bit value to set.\r
+\r
+  @retval UINT8 Return the value been set.\r
+\r
+**/\r
+UINT8\r
+EFIAPI\r
+LibPcdSetEx8 (\r
+  IN CONST GUID        *Guid,\r
+  IN UINTN             TokenNumber,\r
+  IN UINT8             Value\r
+  );\r
+\r
+\r
+/**\r
+  Sets the 16-bit value for the token specified by TokenNumber and \r
+  Guid to the value specified by Value. Value is returned.\r
+  If Guid is NULL, then ASSERT().\r
+  \r
+  @param[in]  Guid Pointer to a 128-bit unique value that \r
+              designates which namespace to set a value from.\r
+  @param[in]  TokenNumber The PCD token number to set a current value for.\r
+  @param[in]  Value The 16-bit value to set.\r
+\r
+  @retval UINT8 Return the value been set.\r
+\r
+**/\r
+UINT16\r
+EFIAPI\r
+LibPcdSetEx16 (\r
+  IN CONST GUID        *Guid,\r
+  IN UINTN             TokenNumber,\r
+  IN UINT16            Value\r
+  );\r
+\r
+\r
+/**\r
+  Sets the 32-bit value for the token specified by TokenNumber and \r
+  Guid to the value specified by Value. Value is returned.\r
+  If Guid is NULL, then ASSERT().\r
+  \r
+  @param[in]  Guid Pointer to a 128-bit unique value that \r
+              designates which namespace to set a value from.\r
+  @param[in]  TokenNumber The PCD token number to set a current value for.\r
+  @param[in]  Value The 32-bit value to set.\r
+\r
+  @retval UINT32 Return the value been set.\r
+\r
+**/\r
+UINT32\r
+EFIAPI\r
+LibPcdSetEx32 (\r
+  IN CONST GUID        *Guid,\r
+  IN UINTN             TokenNumber,\r
+  IN UINT32            Value\r
+  );\r
+\r
+\r
+/**\r
+  Sets the 64-bit value for the token specified by TokenNumber and \r
+  Guid to the value specified by Value. Value is returned.\r
+  If Guid is NULL, then ASSERT().\r
+  \r
+  @param[in]  Guid Pointer to a 128-bit unique value that \r
+              designates which namespace to set a value from.\r
+  @param[in]  TokenNumber The PCD token number to set a current value for.\r
+  @param[in]  Value The 64-bit value to set.\r
+\r
+  @retval UINT64 Return the value been set.\r
+\r
+**/\r
+UINT64\r
+EFIAPI\r
+LibPcdSetEx64 (\r
+  IN CONST GUID        *Guid,\r
+  IN UINTN             TokenNumber,\r
+  IN UINT64            Value\r
+  );\r
+\r
+\r
+/**\r
+  Sets a buffer for the token specified by TokenNumber and \r
+  Guid to the value specified by Value. Value is returned.\r
+  If Guid is NULL, then ASSERT().\r
+  If Value is NULL, then ASSERT().\r
+  \r
+  @param[in]  Guid Pointer to a 128-bit unique value that \r
+              designates which namespace to set a value from.\r
+  @param[in]  TokenNumber The PCD token number to set a current value for.\r
+  @param[in]  Value The 8-bit value to set.\r
+\r
+  @retval VOID * Return the value been set.\r
+\r
+**/\r
+VOID *\r
+EFIAPI\r
+LibPcdSetExPtr (\r
+  IN CONST GUID        *Guid,\r
+  IN UINTN             TokenNumber,\r
+  IN UINTN             SizeOfBuffer,\r
+  IN VOID              *Value\r
+  );\r
+\r
+\r
+/**\r
+  Sets the Boolean value for the token specified by TokenNumber and \r
+  Guid to the value specified by Value. Value is returned.\r
+  If Guid is NULL, then ASSERT().\r
+  \r
+  @param[in]  Guid Pointer to a 128-bit unique value that \r
+              designates which namespace to set a value from.\r
+  @param[in]  TokenNumber The PCD token number to set a current value for.\r
+  @param[in]  Value The Boolean value to set.\r
+\r
+  @retval Boolean Return the value been set.\r
+\r
+**/\r
+BOOLEAN\r
+EFIAPI\r
+LibPcdSetExBool (\r
+  IN CONST GUID        *Guid,\r
+  IN UINTN             TokenNumber,\r
+  IN BOOLEAN           Value\r
+  );\r
+\r
+\r
+/**\r
+  When the token specified by TokenNumber and Guid is set, \r
+  then notification function specified by NotificationFunction is called.  \r
+  If Guid is NULL, then the default token space is used. \r
+  If NotificationFunction is NULL, then ASSERT().\r
+\r
+  @param[in]  CallBackGuid The PCD token GUID being set.\r
+  @param[in]  CallBackToken The PCD token number being set.\r
+  @param[in]  TokenData A pointer to the token data being set.\r
+  @param[in]  TokenDataSize The size, in bytes, of the data being set.\r
+\r
+  @retval VOID\r
+\r
+**/\r
+typedef\r
+VOID\r
+(EFIAPI *PCD_CALLBACK) (\r
+  IN        CONST GUID        *CallBackGuid, OPTIONAL\r
+  IN        UINTN             CallBackToken,\r
+  IN  OUT   VOID              *TokenData,\r
+  IN        UINTN             TokenDataSize\r
+  );\r
+\r
+\r
+/**\r
+  When the token specified by TokenNumber and Guid is set, \r
+  then notification function specified by NotificationFunction is called.  \r
+  If Guid is NULL, then the default token space is used. \r
+  If NotificationFunction is NULL, then ASSERT().\r
+\r
+  @param[in]  Guid Pointer to a 128-bit unique value that designates which \r
+              namespace to set a value from.  If NULL, then the default \r
+              token space is used.\r
+  @param[in]  TokenNumber The PCD token number to monitor.\r
+  @param[in]  NotificationFunction The function to call when the token \r
+              specified by Guid and TokenNumber is set.\r
+\r
+  @retval VOID\r
+\r
+**/\r
+VOID\r
+EFIAPI\r
+LibPcdCallbackOnSet (\r
+  IN CONST GUID               *Guid,       OPTIONAL\r
+  IN UINTN                    TokenNumber,\r
+  IN PCD_CALLBACK             NotificationFunction\r
+  );\r
+\r
+\r
+/**\r
+  Disable a notification function that was established with LibPcdCallbackonSet().\r
+\r
+  @param[in]  Guid Specify the GUID token space.\r
+  @param[in]  TokenNumber Specify the token number.\r
+  @param[in]  NotificationFunction The callback function to be unregistered.\r
+\r
+  @retval VOID\r
+\r
+**/\r
+VOID\r
+EFIAPI\r
+LibPcdCancelCallback (\r
+  IN CONST GUID               *Guid,       OPTIONAL\r
+  IN UINTN                    TokenNumber,\r
+  IN PCD_CALLBACK             NotificationFunction\r
+  );\r
+\r
+\r
+/**\r
+  Retrieves the next PCD token number from the token space specified by Guid.  \r
+  If Guid is NULL, then the default token space is used.  If TokenNumber is 0, \r
+  then the first token number is returned.  Otherwise, the token number that \r
+  follows TokenNumber in the token space is returned.  If TokenNumber is the last \r
+  token number in the token space, then 0 is returned.  If TokenNumber is not 0 and \r
+  is not in the token space specified by Guid, then ASSERT().\r
+\r
+  @param[in]  Pointer to a 128-bit unique value that designates which namespace \r
+              to set a value from.  If NULL, then the default token space is used.\r
+  @param[in]  The previous PCD token number.  If 0, then retrieves the first PCD \r
+              token number.\r
+\r
+  @retval UINTN            The next valid token number.\r
+\r
+**/\r
+UINTN           \r
+EFIAPI\r
+LibPcdGetNextToken (\r
+  IN CONST GUID               *Guid,       OPTIONAL\r
+  IN UINTN                    TokenNumber\r
+  );\r
+\r
+#endif\r
diff --git a/Tools/Source/TianoTools/Include/Library/PeCoffLib.h b/Tools/Source/TianoTools/Include/Library/PeCoffLib.h
new file mode 100644 (file)
index 0000000..08e8195
--- /dev/null
@@ -0,0 +1,131 @@
+/** @file\r
+       Memory Only PE COFF loader\r
+\r
+       Copyright (c) 2006, Intel Corporation                                                         \r
+       All rights reserved. This program and the accompanying materials                          \r
+       are licensed and made available under the terms and conditions of the BSD License         \r
+       which accompanies this distribution.  The full text of the license may be found at        \r
+       http://opensource.org/licenses/bsd-license.php                                            \r
+\r
+       THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+       WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+       Module Name:    PeCoffLib.h\r
+\r
+**/\r
+\r
+#ifndef __BASE_PE_COFF_LIB_H__\r
+#define __BASE_PE_COFF_LIB_H__\r
+\r
+//\r
+// Return status codes from the PE/COFF Loader services\r
+// BUGBUG: Find where used and see if can be replaced by RETURN_STATUS codes\r
+//\r
+#define IMAGE_ERROR_SUCCESS                      0\r
+#define IMAGE_ERROR_IMAGE_READ                   1  \r
+#define IMAGE_ERROR_INVALID_PE_HEADER_SIGNATURE  2\r
+#define IMAGE_ERROR_INVALID_MACHINE_TYPE         3\r
+#define IMAGE_ERROR_INVALID_SUBSYSTEM            4\r
+#define IMAGE_ERROR_INVALID_IMAGE_ADDRESS        5\r
+#define IMAGE_ERROR_INVALID_IMAGE_SIZE           6\r
+#define IMAGE_ERROR_INVALID_SECTION_ALIGNMENT    7\r
+#define IMAGE_ERROR_SECTION_NOT_LOADED           8\r
+#define IMAGE_ERROR_FAILED_RELOCATION            9\r
+#define IMAGE_ERROR_FAILED_ICACHE_FLUSH          10\r
+\r
+\r
+//\r
+// PE/COFF Loader Read Function passed in by caller\r
+//\r
+typedef\r
+RETURN_STATUS\r
+(EFIAPI *PE_COFF_LOADER_READ_FILE) (\r
+  IN     VOID   *FileHandle,\r
+  IN     UINTN  FileOffset,\r
+  IN OUT UINTN  *ReadSize,\r
+  OUT    VOID   *Buffer\r
+  );\r
+\r
+//\r
+// Context structure used while PE/COFF image is being loaded and relocated\r
+//\r
+typedef struct {\r
+  PHYSICAL_ADDRESS                  ImageAddress;\r
+  UINT64                            ImageSize;\r
+  PHYSICAL_ADDRESS                  DestinationAddress;\r
+  PHYSICAL_ADDRESS                  EntryPoint;\r
+  PE_COFF_LOADER_READ_FILE          ImageRead;\r
+  VOID                              *Handle;\r
+  VOID                              *FixupData;\r
+  UINT32                            SectionAlignment;\r
+  UINT32                            PeCoffHeaderOffset;\r
+  UINT32                            DebugDirectoryEntryRva;\r
+  VOID                              *CodeView;\r
+  CHAR8                             *PdbPointer;\r
+  UINTN                             SizeOfHeaders;\r
+  UINT32                            ImageCodeMemoryType;\r
+  UINT32                            ImageDataMemoryType;\r
+  UINT32                            ImageError;\r
+  UINTN                             FixupDataSize;\r
+  UINT16                            Machine;\r
+  UINT16                            ImageType;\r
+  BOOLEAN                           RelocationsStripped;\r
+  BOOLEAN                           IsTeImage;\r
+} PE_COFF_LOADER_IMAGE_CONTEXT;\r
+\r
+\r
+/**\r
+       Retrieves information on a PE/COFF image\r
+\r
+       @param  ImageContext The context of the image being loaded\r
+\r
+       @retval EFI_SUCCESS The information on the PE/COFF image was collected.\r
+       @retval EFI_INVALID_PARAMETER ImageContext is NULL.\r
+       @retval EFI_UNSUPPORTED The PE/COFF image is not supported.\r
+       @retval Otherwise The error status from reading the PE/COFF image using the\r
+       ImageContext->ImageRead() function\r
+\r
+**/\r
+RETURN_STATUS\r
+EFIAPI\r
+PeCoffLoaderGetImageInfo (\r
+  IN OUT PE_COFF_LOADER_IMAGE_CONTEXT  *ImageContext\r
+  )\r
+;\r
+\r
+/**\r
+       Relocates a PE/COFF image in memory\r
+\r
+       @param  ImageContext Contains information on the loaded image to relocate\r
+\r
+       @retval EFI_SUCCESS      if the PE/COFF image was relocated\r
+       @retval EFI_LOAD_ERROR   if the image is not a valid PE/COFF image\r
+       @retval EFI_UNSUPPORTED  not support\r
+\r
+**/\r
+RETURN_STATUS\r
+EFIAPI\r
+PeCoffLoaderRelocateImage (\r
+  IN OUT PE_COFF_LOADER_IMAGE_CONTEXT  *ImageContext\r
+  )\r
+;\r
+\r
+/**\r
+       Loads a PE/COFF image into memory\r
+\r
+       @param  ImageContext Contains information on image to load into memory\r
+\r
+       @retval EFI_SUCCESS            if the PE/COFF image was loaded\r
+       @retval EFI_BUFFER_TOO_SMALL   if the caller did not provide a large enough buffer\r
+       @retval EFI_LOAD_ERROR         if the image is a runtime driver with no relocations\r
+       @retval EFI_INVALID_PARAMETER  if the image address is invalid\r
+\r
+**/\r
+RETURN_STATUS\r
+EFIAPI\r
+PeCoffLoaderLoadImage (\r
+  IN OUT PE_COFF_LOADER_IMAGE_CONTEXT  *ImageContext\r
+  )\r
+;\r
+\r
+#endif\r
diff --git a/Tools/Source/TianoTools/Include/Library/PrintLib.h b/Tools/Source/TianoTools/Include/Library/PrintLib.h
new file mode 100644 (file)
index 0000000..9c65459
--- /dev/null
@@ -0,0 +1,406 @@
+/** @file\r
+       Library that provides print services\r
+\r
+       Copyright (c) 2006, Intel Corporation                                                         \r
+       All rights reserved. This program and the accompanying materials                          \r
+       are licensed and made available under the terms and conditions of the BSD License         \r
+       which accompanies this distribution.  The full text of the license may be found at        \r
+       http://opensource.org/licenses/bsd-license.php                                            \r
+\r
+       THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+       WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+       Module Name:    PrintLib.h\r
+\r
+**/\r
+\r
+#ifndef __PRINT_LIB_H__\r
+#define __PRINT_LIB_H__\r
+\r
+//\r
+// Print primitives\r
+//\r
+#define LEFT_JUSTIFY      0x01\r
+#define COMMA_TYPE        0x08\r
+#define PREFIX_ZERO       0x20\r
+\r
+/**\r
+  Produces a Null-terminated Unicode string in an output buffer based on \r
+  a Null-terminated Unicode format string and a VA_LIST argument list\r
+  \r
+  Produces a Null-terminated Unicode string in the output buffer specified by StartOfBuffer\r
+  and BufferSize.  \r
+  The Unicode string is produced by parsing the format string specified by FormatString.  \r
+  Arguments are pulled from the variable argument list specified by Marker based on the \r
+  contents of the format string.  \r
+  The length of the produced output buffer is returned.\r
+  If BufferSize is 0, then no output buffer is produced and 0 is returned.\r
+\r
+  If BufferSize is not 0 and StartOfBuffer is NULL, then ASSERT().\r
+  If BufferSize is not 0 and FormatString is NULL, then ASSERT().\r
+  If PcdMaximumUnicodeStringLength is not zero, and FormatString contains more than \r
+  PcdMaximumUnicodeStringLength Unicode characters, then ASSERT().\r
+  If PcdMaximumUnicodeStringLength is not zero, and produced Null-terminated Unicode string\r
+  contains more than PcdMaximumUnicodeStringLength Unicode characters, then ASSERT().\r
+\r
+  @param  StartOfBuffer   APointer to the output buffer for the produced Null-terminated \r
+                          Unicode string.\r
+  @param  BufferSize      The size, in bytes, of the output buffer specified by StartOfBuffer.\r
+  @param  FormatString    Null-terminated Unicode format string.\r
+  @param  Marker          VA_LIST marker for the variable argument list.\r
+  \r
+  @return return Length of the produced output buffer.\r
+\r
+**/\r
+UINTN\r
+EFIAPI\r
+UnicodeVSPrint (\r
+  OUT CHAR16        *StartOfBuffer,\r
+  IN  UINTN         BufferSize,\r
+  IN  CONST CHAR16  *FormatString,\r
+  IN  VA_LIST       Marker\r
+  );\r
+\r
+/**\r
+  Produces a Null-terminated Unicode string in an output buffer based on a Null-terminated \r
+  Unicode format string and variable argument list.\r
+  \r
+  Produces a Null-terminated Unicode string in the output buffer specified by StartOfBuffer\r
+  and BufferSize.\r
+  The Unicode string is produced by parsing the format string specified by FormatString.\r
+  Arguments are pulled from the variable argument list based on the contents of the format string.\r
+  The length of the produced output buffer is returned.  \r
+  If BufferSize is 0, then no output buffer is produced and 0 is returned.\r
+\r
+  If BufferSize is not 0 and StartOfBuffer is NULL, then ASSERT().\r
+  If BufferSize is not 0 and FormatString is NULL, then ASSERT().\r
+  If PcdMaximumUnicodeStringLength is not zero, and FormatString contains more than \r
+  PcdMaximumUnicodeStringLength Unicode characters, then ASSERT().\r
+  If PcdMaximumUnicodeStringLength is not zero, and produced Null-terminated Unicode string\r
+  contains more than PcdMaximumUnicodeStringLength Unicode characters, then ASSERT().\r
+\r
+  @param  StartOfBuffer   APointer to the output buffer for the produced Null-terminated \r
+                          Unicode string.\r
+  @param  BufferSize      The size, in bytes, of the output buffer specified by StartOfBuffer.\r
+  @param  FormatString    Null-terminated Unicode format string.\r
+  \r
+  @return Length of the produced output buffer.\r
+\r
+**/\r
+UINTN\r
+EFIAPI\r
+UnicodeSPrint (\r
+  OUT CHAR16        *StartOfBuffer,\r
+  IN  UINTN         BufferSize,\r
+  IN  CONST CHAR16  *FormatString,\r
+  ...\r
+  );\r
+\r
+/**\r
+  Produces a Null-terminated Unicode string in an output buffer based on a Null-terminated\r
+  ASCII format string and a VA_LIST argument list\r
+  \r
+  Produces a Null-terminated Unicode string in the output buffer specified by StartOfBuffer\r
+  and BufferSize.\r
+  The Unicode string is produced by parsing the format string specified by FormatString.\r
+  Arguments are pulled from the variable argument list specified by Marker based on the \r
+  contents of the format string.\r
+  The length of the produced output buffer is returned.\r
+  If BufferSize is 0, then no output buffer is produced and 0 is returned.\r
+\r
+  If BufferSize is not 0 and StartOfBuffer is NULL, then ASSERT().\r
+  If BufferSize is not 0 and FormatString is NULL, then ASSERT().\r
+  If PcdMaximumUnicodeStringLength is not zero, and FormatString contains more than \r
+  PcdMaximumUnicodeStringLength Unicode characters, then ASSERT().\r
+  If PcdMaximumUnicodeStringLength is not zero, and produced Null-terminated Unicode string\r
+  contains more than PcdMaximumUnicodeStringLength Unicode characters, then ASSERT().\r
+\r
+  @param  StartOfBuffer   APointer to the output buffer for the produced Null-terminated \r
+                          Unicode string.\r
+  @param  BufferSize      The size, in bytes, of the output buffer specified by StartOfBuffer.\r
+  @param  FormatString    Null-terminated Unicode format string.\r
+  @param  Marker          VA_LIST marker for the variable argument list.\r
+  \r
+  @return Length of the produced output buffer.\r
+\r
+**/\r
+UINTN\r
+EFIAPI\r
+UnicodeVSPrintAsciiFormat (\r
+  OUT CHAR16       *StartOfBuffer,\r
+  IN  UINTN        BufferSize,\r
+  IN  CONST CHAR8  *FormatString,\r
+  IN  VA_LIST      Marker\r
+  );\r
+\r
+/**\r
+  Produces a Null-terminated Unicode string in an output buffer based on a Null-terminated \r
+  ASCII format string and  variable argument list.\r
+  \r
+  Produces a Null-terminated Unicode string in the output buffer specified by StartOfBuffer\r
+  and BufferSize.\r
+  The Unicode string is produced by parsing the format string specified by FormatString.\r
+  Arguments are pulled from the variable argument list based on the contents of the \r
+  format string.\r
+  The length of the produced output buffer is returned.\r
+  If BufferSize is 0, then no output buffer is produced and 0 is returned.\r
+\r
+  If BufferSize is not 0 and StartOfBuffer is NULL, then ASSERT().\r
+  If BufferSize is not 0 and FormatString is NULL, then ASSERT().\r
+  If PcdMaximumUnicodeStringLength is not zero, and FormatString contains more than \r
+  PcdMaximumUnicodeStringLength Unicode characters, then ASSERT().\r
+  If PcdMaximumUnicodeStringLength is not zero, and produced Null-terminated Unicode string\r
+  contains more than PcdMaximumUnicodeStringLength Unicode characters, then ASSERT().\r
+\r
+  @param  StartOfBuffer   APointer to the output buffer for the produced Null-terminated \r
+                          Unicode string.\r
+  @param  BufferSize      The size, in bytes, of the output buffer specified by StartOfBuffer.\r
+  @param  FormatString    Null-terminated Unicode format string.\r
+  \r
+  @return Length of the produced output buffer.\r
+\r
+**/\r
+UINTN\r
+EFIAPI\r
+UnicodeSPrintAsciiFormat (\r
+  OUT CHAR16       *StartOfBuffer,\r
+  IN  UINTN        BufferSize,\r
+  IN  CONST CHAR8  *FormatString,\r
+  ...\r
+  );\r
+\r
+/**\r
+  Produces a Null-terminated ASCII string in an output buffer based on a Null-terminated\r
+  ASCII format string and a VA_LIST argument list.\r
+  \r
+  Produces a Null-terminated ASCII string in the output buffer specified by StartOfBuffer\r
+  and BufferSize.\r
+  The ASCII string is produced by parsing the format string specified by FormatString.\r
+  Arguments are pulled from the variable argument list specified by Marker based on \r
+  the contents of the format string.\r
+  The length of the produced output buffer is returned.\r
+  If BufferSize is 0, then no output buffer is produced and 0 is returned.\r
+\r
+  If BufferSize is not 0 and StartOfBuffer is NULL, then ASSERT().\r
+  If BufferSize is not 0 and FormatString is NULL, then ASSERT().\r
+  If PcdMaximumUnicodeStringLength is not zero, and FormatString contains more than \r
+  PcdMaximumUnicodeStringLength ASCII characters, then ASSERT().\r
+  If PcdMaximumUnicodeStringLength is not zero, and produced Null-terminated Unicode string\r
+  contains more than PcdMaximumUnicodeStringLength ASCII characters, then ASSERT().\r
+\r
+  @param  StartOfBuffer   APointer to the output buffer for the produced Null-terminated \r
+                          ASCII string.\r
+  @param  BufferSize      The size, in bytes, of the output buffer specified by StartOfBuffer.\r
+  @param  FormatString    Null-terminated Unicode format string.\r
+  @param  Marker          VA_LIST marker for the variable argument list.\r
+  \r
+  @return Length of the produced output buffer.\r
+\r
+**/\r
+UINTN\r
+EFIAPI\r
+AsciiVSPrint (\r
+  OUT CHAR8         *StartOfBuffer,\r
+  IN  UINTN         BufferSize,\r
+  IN  CONST CHAR8   *FormatString,\r
+  IN  VA_LIST       Marker\r
+  );\r
+\r
+/**\r
+  Produces a Null-terminated ASCII string in an output buffer based on a Null-terminated\r
+  ASCII format string and  variable argument list.\r
+  \r
+  Produces a Null-terminated ASCII string in the output buffer specified by StartOfBuffer\r
+  and BufferSize.\r
+  The ASCII string is produced by parsing the format string specified by FormatString.\r
+  Arguments are pulled from the variable argument list based on the contents of the \r
+  format string.\r
+  The length of the produced output buffer is returned.\r
+  If BufferSize is 0, then no output buffer is produced and 0 is returned.\r
+\r
+  If BufferSize is not 0 and StartOfBuffer is NULL, then ASSERT().\r
+  If BufferSize is not 0 and FormatString is NULL, then ASSERT().\r
+  If PcdMaximumUnicodeStringLength is not zero, and FormatString contains more than \r
+  PcdMaximumUnicodeStringLength ASCII characters, then ASSERT().\r
+  If PcdMaximumUnicodeStringLength is not zero, and produced Null-terminated Unicode string\r
+  contains more than PcdMaximumUnicodeStringLength ASCII characters, then ASSERT().\r
+\r
+  @param  StartOfBuffer   APointer to the output buffer for the produced Null-terminated \r
+                          ASCII string.\r
+  @param  BufferSize      The size, in bytes, of the output buffer specified by StartOfBuffer.\r
+  @param  FormatString    Null-terminated Unicode format string.\r
+  \r
+  @return Length of the produced output buffer.\r
+\r
+**/\r
+UINTN\r
+EFIAPI\r
+AsciiSPrint (\r
+  OUT CHAR8        *StartOfBuffer,\r
+  IN  UINTN        BufferSize,\r
+  IN  CONST CHAR8  *FormatString,\r
+  ...\r
+  );\r
+\r
+/**\r
+  Produces a Null-terminated ASCII string in an output buffer based on a Null-terminated\r
+  ASCII format string and a VA_LIST argument list.\r
+  \r
+  Produces a Null-terminated ASCII string in the output buffer specified by StartOfBuffer\r
+  and BufferSize.\r
+  The ASCII string is produced by parsing the format string specified by FormatString.\r
+  Arguments are pulled from the variable argument list specified by Marker based on \r
+  the contents of the format string.\r
+  The length of the produced output buffer is returned.\r
+  If BufferSize is 0, then no output buffer is produced and 0 is returned.\r
+\r
+  If BufferSize is not 0 and StartOfBuffer is NULL, then ASSERT().\r
+  If BufferSize is not 0 and FormatString is NULL, then ASSERT().\r
+  If PcdMaximumUnicodeStringLength is not zero, and FormatString contains more than \r
+  PcdMaximumUnicodeStringLength ASCII characters, then ASSERT().\r
+  If PcdMaximumUnicodeStringLength is not zero, and produced Null-terminated Unicode string\r
+  contains more than PcdMaximumUnicodeStringLength ASCII characters, then ASSERT().\r
+\r
+  @param  StartOfBuffer   APointer to the output buffer for the produced Null-terminated \r
+                          ASCII string.\r
+  @param  BufferSize      The size, in bytes, of the output buffer specified by StartOfBuffer.\r
+  @param  FormatString    Null-terminated Unicode format string.\r
+  @param  Marker          VA_LIST marker for the variable argument list.\r
+  \r
+  @return Length of the produced output buffer.\r
+\r
+**/\r
+UINTN\r
+EFIAPI\r
+AsciiVSPrintUnicodeFormat (\r
+  OUT CHAR8         *StartOfBuffer,\r
+  IN  UINTN         BufferSize,\r
+  IN  CONST CHAR16  *FormatString,\r
+  IN  VA_LIST       Marker\r
+  );\r
+\r
+/**\r
+  Produces a Null-terminated ASCII string in an output buffer based on a Null-terminated\r
+  ASCII format string and  variable argument list.\r
+  \r
+  Produces a Null-terminated ASCII string in the output buffer specified by StartOfBuffer\r
+  and BufferSize.\r
+  The ASCII string is produced by parsing the format string specified by FormatString.\r
+  Arguments are pulled from the variable argument list based on the contents of the \r
+  format string.\r
+  The length of the produced output buffer is returned.\r
+  If BufferSize is 0, then no output buffer is produced and 0 is returned.\r
+\r
+  If BufferSize is not 0 and StartOfBuffer is NULL, then ASSERT().\r
+  If BufferSize is not 0 and FormatString is NULL, then ASSERT().\r
+  If PcdMaximumUnicodeStringLength is not zero, and FormatString contains more than \r
+  PcdMaximumUnicodeStringLength ASCII characters, then ASSERT().\r
+  If PcdMaximumUnicodeStringLength is not zero, and produced Null-terminated Unicode string\r
+  contains more than PcdMaximumUnicodeStringLength ASCII characters, then ASSERT().\r
+\r
+  @param  StartOfBuffer   APointer to the output buffer for the produced Null-terminated \r
+                          ASCII string.\r
+  @param  BufferSize      The size, in bytes, of the output buffer specified by StartOfBuffer.\r
+  @param  FormatString    Null-terminated Unicode format string.\r
+  \r
+  @return Length of the produced output buffer.\r
+\r
+**/\r
+UINTN\r
+EFIAPI\r
+AsciiSPrintUnicodeFormat (\r
+  OUT CHAR8         *StartOfBuffer,\r
+  IN  UINTN         BufferSize,\r
+  IN  CONST CHAR16  *FormatString,\r
+  ...\r
+  );\r
+\r
+/**\r
+  Converts a decimal value to a Null-terminated Unicode string.\r
+  \r
+  Converts the decimal number specified by Value to a Null-terminated Unicode \r
+  string specified by Buffer containing at most Width characters.\r
+  If Width is 0 then a width of  MAXIMUM_VALUE_CHARACTERS is assumed.\r
+  The total number of characters placed in Buffer is returned.\r
+  If the conversion contains more than Width characters, then only the first\r
+  Width characters are returned, and the total number of characters \r
+  required to perform the conversion is returned.\r
+  Additional conversion parameters are specified in Flags.  \r
+  The Flags bit LEFT_JUSTIFY is always ignored.\r
+  All conversions are left justified in Buffer.\r
+  If Width is 0, PREFIX_ZERO is ignored in Flags.\r
+  If COMMA_TYPE is set in Flags, then PREFIX_ZERO is ignored in Flags, and commas\r
+  are inserted every 3rd digit starting from the right.\r
+  If Value is < 0, then the fist character in Buffer is a '-'.\r
+  If PREFIX_ZERO is set in Flags and PREFIX_ZERO is not being ignored, \r
+  then Buffer is padded with '0' characters so the combination of the optional '-' \r
+  sign character, '0' characters, digit characters for Value, and the Null-terminator\r
+  add up to Width characters.\r
+\r
+  If Buffer is NULL, then ASSERT().\r
+  If unsupported bits are set in Flags, then ASSERT().\r
+  If Width >= MAXIMUM_VALUE_CHARACTERS, then ASSERT()\r
+\r
+  @param  Buffer  Pointer to the output buffer for the produced Null-terminated\r
+                  Unicode string.\r
+  @param  Flags   The bitmask of flags that specify left justification, zero pad, and commas.\r
+  @param  Value   The 64-bit signed value to convert to a string.\r
+  @param  Width          The maximum number of Unicode characters to place in Buffer.\r
+  \r
+  @return Total number of characters required to perform the conversion.\r
+\r
+**/\r
+UINTN\r
+EFIAPI\r
+UnicodeValueToString (\r
+  IN OUT CHAR16  *Buffer,\r
+  IN UINTN       Flags,\r
+  IN INT64       Value,\r
+  IN UINTN       Width\r
+  );\r
+\r
+/**\r
+  Converts a decimal value to a Null-terminated ASCII string.\r
+  \r
+  Converts the decimal number specified by Value to a Null-terminated ASCII string \r
+  specified by Buffer containing at most Width characters.\r
+  If Width is 0 then a width of  MAXIMUM_VALUE_CHARACTERS is assumed.\r
+  The total number of characters placed in Buffer is returned.\r
+  If the conversion contains more than Width characters, then only the first Width\r
+  characters are returned, and the total number of characters required to perform\r
+  the conversion is returned.\r
+  Additional conversion parameters are specified in Flags.  \r
+  The Flags bit LEFT_JUSTIFY is always ignored.\r
+  All conversions are left justified in Buffer.\r
+  If Width is 0, PREFIX_ZERO is ignored in Flags.\r
+  If COMMA_TYPE is set in Flags, then PREFIX_ZERO is ignored in Flags, and commas \r
+  are inserted every 3rd digit starting from the right.\r
+  If Value is < 0, then the fist character in Buffer is a '-'.\r
+  If PREFIX_ZERO is set in Flags and PREFIX_ZERO is not being ignored, then Buffer\r
+  is padded with '0' characters so the combination of the optional '-'\r
+  sign character, '0' characters, digit characters for Value, and the \r
+  Null-terminator add up to Width characters.\r
+\r
+  If Buffer is NULL, then ASSERT().\r
+  If unsupported bits are set in Flags, then ASSERT().\r
+  If Width >= MAXIMUM_VALUE_CHARACTERS, then ASSERT()\r
+\r
+  @param  Buffer  Pointer to the output buffer for the produced Null-terminated\r
+                  ASCII string.\r
+  @param  Flags   The bitmask of flags that specify left justification, zero pad, and commas.\r
+  @param  Value   The 64-bit signed value to convert to a string.\r
+  @param  Width          The maximum number of ASCII characters to place in Buffer.\r
+  \r
+  @return Total number of characters required to perform the conversion.\r
+\r
+**/\r
+UINTN\r
+EFIAPI\r
+AsciiValueToString (\r
+  IN OUT CHAR8  *Buffer,\r
+  IN UINTN      Flags,\r
+  IN INT64      Value,\r
+  IN UINTN      Width\r
+  );\r
+\r
+#endif\r
diff --git a/Tools/Source/TianoTools/Include/Protocol/AcpiSupport.h b/Tools/Source/TianoTools/Include/Protocol/AcpiSupport.h
new file mode 100644 (file)
index 0000000..790cdf2
--- /dev/null
@@ -0,0 +1,173 @@
+/** @file\r
+  Definition of the ACPI Support protocol.\r
+\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. This program and the accompanying materials                          \r
+  are licensed and made available under the terms and conditions of the BSD License         \r
+  which accompanies this distribution.  The full text of the license may be found at        \r
+  http://opensource.org/licenses/bsd-license.php                                            \r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+  Module Name:  AcpiSupport.h\r
+\r
+  @par Revision Reference:\r
+  This is defined in the ACPI Specification 0.9.\r
+  \r
+**/\r
+\r
+#ifndef _ACPI_SUPPORT_PROTOCOL_H_\r
+#define _ACPI_SUPPORT_PROTOCOL_H_\r
+\r
+typedef struct _EFI_ACPI_SUPPORT_PROTOCOL EFI_ACPI_SUPPORT_PROTOCOL;\r
+\r
+//\r
+// ACPI Support Protocol GUID\r
+//\r
+#define EFI_ACPI_SUPPORT_GUID \\r
+  { \\r
+    0xdbff9d55, 0x89b7, 0x46da, {0xbd, 0xdf, 0x67, 0x7d, 0x3d, 0xc0, 0x24, 0x1d } \\r
+  }\r
+\r
+//\r
+// Protocol Data Definitions\r
+//\r
+//\r
+// ACPI Version bitmap definition:\r
+//\r
+// EFI_ACPI_TABLE_VERSION_1_0B - ACPI Version 1.0b\r
+// EFI_ACPI_TABLE_VERSION_2_0 - ACPI Version 2.0\r
+// EFI_ACPI_TABLE_VERSION_3_0 - ACPI Version 3.0\r
+// EFI_ACPI_TABLE_VERSION_NONE - No ACPI Versions.  This might be used\r
+//  to create memory-based operation regions or other information\r
+//  that is not part of the ACPI "tree" but must still be found\r
+//  in ACPI memory space and/or managed by the core ACPI driver.\r
+//\r
+// Note that EFI provides discrete GUIDs for each version of ACPI\r
+// that is supported.  It is expected that each EFI GUIDed\r
+// version of ACPI will also have a corresponding bitmap\r
+// definition.  This allows maintenance of separate ACPI trees\r
+// for each distinctly different version of ACPI.\r
+//\r
+#define EFI_ACPI_TABLE_VERSION      UINT32\r
+\r
+#define EFI_ACPI_TABLE_VERSION_NONE (1 << 0)\r
+#define EFI_ACPI_TABLE_VERSION_1_0B (1 << 1)\r
+#define EFI_ACPI_TABLE_VERSION_2_0  (1 << 2)\r
+#define EFI_ACPI_TABLE_VERSION_3_0  (1 << 3)\r
+\r
+//\r
+// Protocol Member Functions\r
+//\r
+\r
+/**\r
+  Returns a requested ACPI table.\r
+\r
+  @param  This A pointer to the EFI_ACPI_SUPPORT_PROTOCOL instance.\r
+  \r
+  @param  Index The zero-based index of the table to retrieve.\r
+  \r
+  @param  Table Pointer for returning the table buffer.\r
+  \r
+  @param  Version Updated with the ACPI versions to which this table belongs.\r
+  \r
+  @param  Handle Pointer for identifying the table.\r
+\r
+  @retval EFI_SUCCESS The function completed successfully.\r
+  \r
+  @retval EFI_NOT_FOUND The requested index is too large and a table was not found.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_ACPI_GET_ACPI_TABLE) (\r
+  IN EFI_ACPI_SUPPORT_PROTOCOL            *This,\r
+  IN INTN                                 Index,\r
+  OUT VOID                                **Table,\r
+  OUT EFI_ACPI_TABLE_VERSION              *Version,\r
+  OUT UINTN                               *Handle\r
+  );\r
+\r
+/**\r
+  Used to add, remove, or update ACPI tables.\r
+\r
+  @param  This A pointer to the EFI_ACPI_SUPPORT_PROTOCOL instance.\r
+  \r
+  @param  Table Pointer to the new table to add or update.\r
+  \r
+  @param  Checksum If TRUE, indicates that the checksum should be \r
+  calculated for this table.\r
+  \r
+  @param  Version Indicates to which version(s) of ACPI the table should be added.\r
+  \r
+  @param  Pointer to the handle of the table to remove or update.\r
+\r
+  @retval EFI_SUCCESS The function completed successfully.\r
+  \r
+  @retval EFI_INVALID_PARAMETER *Handle was zero and Table was NULL.\r
+  \r
+  @retval EFI_ABORTED Could not complete the desired action.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_ACPI_SET_ACPI_TABLE) (\r
+  IN EFI_ACPI_SUPPORT_PROTOCOL            *This,\r
+  IN VOID                                 *Table OPTIONAL,\r
+  IN BOOLEAN                              Checksum,\r
+  IN EFI_ACPI_TABLE_VERSION               Version,\r
+  IN OUT UINTN                            *Handle\r
+  );\r
+\r
+/**\r
+  Causes one or more versions of the ACPI tables to be published in \r
+  the EFI system configuration tables.\r
+\r
+  @param  This A pointer to the EFI_ACPI_SUPPORT_PROTOCOL instance.\r
+  \r
+  @param  Version Indicates to which version(s) of ACPI that the table should be published. \r
+\r
+  @retval EFI_SUCCESS The function completed successfully.\r
+  \r
+  @retval EFI_ABORTED An error occurred and the function could not complete successfully.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_ACPI_PUBLISH_TABLES) (\r
+  IN EFI_ACPI_SUPPORT_PROTOCOL            *This,\r
+  IN EFI_ACPI_TABLE_VERSION               Version\r
+  );\r
+\r
+//\r
+// ACPI Support Protocol\r
+//\r
+/**\r
+  @par Protocol Description:\r
+  This protocol provides some basic services to support publishing ACPI system \r
+  tables. The services handle many of the more mundane tasks that are required \r
+  to publish a set of tables. \r
+\r
+  @param GetAcpiTable\r
+  Returns a table specified by an index if it exists.\r
+\r
+  @param SetAcpiTable\r
+  Adds, removes, or updates ACPI tables\r
+\r
+  @param PublishTables\r
+  Publishes the ACPI tables.\r
+\r
+**/\r
+struct _EFI_ACPI_SUPPORT_PROTOCOL {\r
+  EFI_ACPI_GET_ACPI_TABLE GetAcpiTable;\r
+  EFI_ACPI_SET_ACPI_TABLE SetAcpiTable;\r
+  EFI_ACPI_PUBLISH_TABLES PublishTables;\r
+};\r
+\r
+//\r
+// Extern the GUID for protocol users.\r
+//\r
+extern EFI_GUID gEfiAcpiSupportProtocolGuid;\r
+\r
+#endif\r
diff --git a/Tools/Source/TianoTools/Include/Protocol/Arp.h b/Tools/Source/TianoTools/Include/Protocol/Arp.h
new file mode 100644 (file)
index 0000000..7394f3f
--- /dev/null
@@ -0,0 +1,259 @@
+/** @file\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. This program and the accompanying materials                          \r
+  are licensed and made available under the terms and conditions of the BSD License         \r
+  which accompanies this distribution.  The full text of the license may be found at        \r
+  http://opensource.org/licenses/bsd-license.php                                            \r
+  \r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+  \r
+  Module Name:  Arp.h\r
+  \r
+**/\r
+\r
+#ifndef __EFI_ARP_PROTOCOL_H__\r
+#define __EFI_ARP_PROTOCOL_H__\r
+\r
+#define EFI_ARP_SERVICE_BINDING_PROTOCOL_GUID \\r
+  { \\r
+    0xf44c00ee, 0x1f2c, 0x4a00, {0xaa, 0x9, 0x1c, 0x9f, 0x3e, 0x8, 0x0, 0xa3 } \\r
+  }\r
+\r
+#define EFI_ARP_PROTOCOL_GUID \\r
+  { \\r
+    0xf4b427bb, 0xba21, 0x4f16, {0xbc, 0x4e, 0x43, 0xe4, 0x16, 0xab, 0x61, 0x9c } \\r
+  }\r
+\r
+typedef struct _EFI_ARP_PROTOCOL EFI_ARP_PROTOCOL;\r
+\r
+typedef struct {\r
+UINT32                      Size;\r
+BOOLEAN                     DenyFlag;\r
+BOOLEAN                     StaticFlag;\r
+UINT16                      HwAddressType;\r
+UINT16                      SwAddressType;\r
+UINT8                       HwAddressLength;\r
+UINT8                       SwAddressLength;\r
+} EFI_ARP_FIND_DATA;\r
+\r
+typedef struct {\r
+  UINT16                    SwAddressType;      // Host byte order\r
+  UINT8                     SwAddressLength;\r
+  VOID                      *StationAddress;    // Network byte order\r
+  UINT32                    EntryTimeOut;\r
+  UINT32                    RetryCount;\r
+  UINT32                    RetryTimeOut;\r
+} EFI_ARP_CONFIG_DATA;\r
+\r
+\r
+/**\r
+  Assigns a station address (protocol type and network address) to this instance of the ARP cache.\r
+\r
+  @param  This                   A pointer to the EFI_ARP_PROTOCOL instance.\r
+  @param  ConfigData             A pointer to the EFI_ARP_CONFIG_DATA structure.Buffer\r
+\r
+  @retval EFI_SUCCESS           The new station address was successfully registered.\r
+  @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:\r
+  @retval EFI_ACCESS_DENIED     The SwAddressType, SwAddressLength, or\r
+                                StationAddress is different from the one that is already\r
+                                registered.\r
+  @retval EFI_OUT_OF_RESOURCES  Storage for the new StationAddress could not be allocated.\r
+\r
+**/\r
+typedef \r
+EFI_STATUS\r
+(EFIAPI *EFI_ARP_CONFIGURE) (\r
+  IN EFI_ARP_PROTOCOL       *This,\r
+  IN EFI_ARP_CONFIG_DATA    *ConfigData   OPTIONAL\r
+  )\r
+;  \r
+\r
+/**\r
+  Inserts an entry to the ARP cache.\r
+\r
+  @param  This            A pointer to the EFI_ARP_PROTOCOL instance.  \r
+  @param  DenyFlag        Set to TRUE if this entry is a Â¡Â°deny¡± entry. Set to FALSE if this\r
+                          entry is a Â¡Â°normal¡± entry.\r
+  @param  TargetSwAddress Pointer to a protocol address to add (or deny). May be set to\r
+                          NULL if DenyFlag is TRUE.\r
+  @param  TargetHwAddress Pointer to a hardware address to add (or deny). May be set to\r
+                          NULL if DenyFlag is TRUE.\r
+  @param  TimeoutValue    Time in 100-ns units that this entry will remain in the ARP\r
+                          cache. A value of zero means that the entry is permanent. A\r
+                          nonzero value will override the one given by Configure() if\r
+                          the entry to be added is dynamic entry.\r
+  @param  Overwrite       If TRUE, the matching cache entry will be overwritten with the\r
+                          supplied parameters. If FALSE, EFI_ACCESS_DENIED\r
+\r
+  @retval EFI_SUCCESS           The entry has been added or updated.\r
+  @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:\r
+  @retval EFI_OUT_OF_RESOURCES  The new ARP cache entry could not be allocated.\r
+  @retval EFI_ACCESS_DENIED     The ARP cache entry already exists and Overwrite is not true.\r
+  @retval EFI_NOT_STARTED       The ARP driver instance has not been configured.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_ARP_ADD) (\r
+  IN EFI_ARP_PROTOCOL       *This,\r
+  IN BOOLEAN                DenyFlag,\r
+  IN VOID                   *TargetSwAddress  OPTIONAL,\r
+  IN VOID                   *TargetHwAddress  OPTIONAL,\r
+  IN UINT32                 TimeoutValue,\r
+  IN BOOLEAN                Overwrite\r
+  )\r
+;  \r
+\r
+/**\r
+  Locates one or more entries in the ARP cache.\r
+\r
+  @param  This            A pointer to the EFI_ARP_PROTOCOL instance.\r
+  @param  BySwAddress     Set to TRUE to look for matching software protocol addresses.\r
+                          Set to FALSE to look for matching hardware protocol addresses.\r
+  @param  AddressBuffer   Pointer to address buffer. Set to NULL to match all addresses.\r
+  @param  EntryLength     The size of an entry in the entries buffer. To keep the\r
+                          EFI_ARP_FIND_DATA structure properly aligned, this field\r
+                          may be longer than sizeof(EFI_ARP_FIND_DATA) plus\r
+                          the length of the software and hardware addresses.\r
+  @param  EntryCount      The number of ARP cache entries that are found by the specified criteria.\r
+  @param  Entries         Pointer to the buffer that will receive the ARP cache entries.\r
+  @param  Refresh         Set to TRUE to refresh the timeout value of the matching ARP\r
+                          cache entry.\r
+\r
+  @retval EFI_SUCCESS           The requested ARP cache entries were copied into the buffer.\r
+  @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:\r
+  @retval EFI_NOT_FOUND         No matching entries were found.\r
+  @retval EFI_NOT_STARTED       The ARP driver instance has not been configured.\r
+\r
+**/\r
+typedef \r
+EFI_STATUS\r
+(EFIAPI *EFI_ARP_FIND) (\r
+  IN EFI_ARP_PROTOCOL       *This,\r
+  IN BOOLEAN                BySwAddress,\r
+  IN VOID                   *AddressBuffer    OPTIONAL,\r
+  OUT UINT32                *EntryLength      OPTIONAL,\r
+  OUT UINT32                *EntryCount       OPTIONAL,\r
+  OUT EFI_ARP_FIND_DATA     **Entries         OPTIONAL,\r
+  IN BOOLEAN                Refresh\r
+  )\r
+;  \r
+\r
+\r
+/**\r
+  Removes entries from the ARP cache.\r
+\r
+  @param  This          A pointer to the EFI_ARP_PROTOCOL instance.\r
+  @param  BySwAddress   Set to TRUE to delete matching protocol addresses.\r
+                        Set to FALSE to delete matching hardware addresses.\r
+  @param  AddressBuffer Pointer to the address buffer that is used as a key to look for the\r
+                        cache entry. Set to NULL to delete all entries.\r
+\r
+  @retval EFI_SUCCESS           The entry was removed from the ARP cache.\r
+  @retval EFI_INVALID_PARAMETER This is NULL.\r
+  @retval EFI_NOT_FOUND         The specified deletion key was not found.\r
+  @retval EFI_NOT_STARTED       The ARP driver instance has not been configured.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_ARP_DELETE) (\r
+  IN EFI_ARP_PROTOCOL       *This,\r
+  IN BOOLEAN                BySwAddress,\r
+  IN VOID                   *AddressBuffer   OPTIONAL\r
+  )\r
+;  \r
+\r
+/**\r
+  Removes all dynamic ARP cache entries that were added by this interface.\r
+\r
+  @param  This                   A pointer to the EFI_ARP_PROTOCOL instance.\r
+                                 \r
+  @retval EFI_SUCCESS           The cache has been flushed.\r
+  @retval EFI_INVALID_PARAMETER This is NULL.\r
+  @retval EFI_NOT_FOUND         There are no matching dynamic cache entries.\r
+  @retval EFI_NOT_STARTED       The ARP driver instance has not been configured.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_ARP_FLUSH) (\r
+  IN EFI_ARP_PROTOCOL       *This\r
+  )\r
+;  \r
+\r
+/**\r
+  Starts an ARP request session.\r
+\r
+  @param  This            A pointer to the EFI_ARP_PROTOCOL instance.\r
+  @param  TargetSwAddress Pointer to the protocol address to resolve.\r
+  @param  ResolvedEvent   Pointer to the event that will be signaled when the address is\r
+                          resolved or some error occurs.\r
+  @param  TargetHwAddress Pointer to the buffer for the resolved hardware address in\r
+                          network byte order. The buffer must be large enough to hold the\r
+                          resulting hardware address. TargetHwAddress must not be\r
+                          NULL.\r
+\r
+  @retval EFI_SUCCESS           The data was copied from the ARP cache into the\r
+                                TargetHwAddress buffer.\r
+  @retval EFI_INVALID_PARAMETER This or TargetHwAddress is NULL.\r
+  @retval EFI_ACCESS_DENIED     The requested address is not present in the normal ARP cache but\r
+                                is present in the deny address list. Outgoing traffic to that address is\r
+                                forbidden.\r
+  @retval EFI_NOT_STARTED       The ARP driver instance has not been configured.\r
+  @retval EFI_NOT_READY         The request has been started and is not finished.\r
+  @retval EFI_UNSUPPORTED       The requested conversion is not supported in this implementation or\r
+                                configuration.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_ARP_REQUEST) (\r
+  IN EFI_ARP_PROTOCOL       *This, \r
+  IN VOID                   *TargetSwAddress  OPTIONAL,\r
+  IN EFI_EVENT              ResolvedEvent     OPTIONAL,\r
+  OUT VOID                  *TargetHwAddress  \r
+  )\r
+;  \r
+\r
+/**\r
+  Cancels an ARP request session.\r
+\r
+  @param  This            A pointer to the EFI_ARP_PROTOCOL instance.\r
+  @param  TargetSwAddress Pointer to the protocol address in previous request session.\r
+  @param  ResolvedEvent   Pointer to the event that is used as the notification event in\r
+                          previous request session.\r
+\r
+  @retval EFI_SUCCESS           The pending request session(s) is/are aborted and corresponding\r
+                                event(s) is/are signaled.\r
+  @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:\r
+  @retval EFI_NOT_STARTED       The ARP driver instance has not been configured.\r
+  @retval EFI_NOT_FOUND         The request is not issued by\r
+                                EFI_ARP_PROTOCOL.Request().\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_ARP_CANCEL) (\r
+  IN EFI_ARP_PROTOCOL       *This, \r
+  IN VOID                   *TargetSwAddress  OPTIONAL,\r
+  IN EFI_EVENT              ResolvedEvent     OPTIONAL\r
+  )\r
+;  \r
+\r
+struct _EFI_ARP_PROTOCOL {\r
+  EFI_ARP_CONFIGURE         Configure;\r
+  EFI_ARP_ADD               Add;\r
+  EFI_ARP_FIND              Find;\r
+  EFI_ARP_DELETE            Delete;\r
+  EFI_ARP_FLUSH             Flush;\r
+  EFI_ARP_REQUEST           Request;\r
+  EFI_ARP_CANCEL            Cancel;\r
+};\r
+\r
+\r
+extern EFI_GUID gEfiArpServiceBindingProtocolGuid;\r
+extern EFI_GUID gEfiArpProtocolGuid;\r
+\r
+#endif\r
diff --git a/Tools/Source/TianoTools/Include/Protocol/AuthenticationInfo.h b/Tools/Source/TianoTools/Include/Protocol/AuthenticationInfo.h
new file mode 100644 (file)
index 0000000..f80dbf3
--- /dev/null
@@ -0,0 +1,125 @@
+/** @file\r
+  EFI_AUTHENTICATION_INFO_PROTOCOL as defined in UEFI 2.0.\r
+  This protocol is used on any device handle to obtain authentication information \r
+  associated with the physical or logical device.\r
+\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. This program and the accompanying materials                          \r
+  are licensed and made available under the terms and conditions of the BSD License         \r
+  which accompanies this distribution.  The full text of the license may be found at        \r
+  http://opensource.org/licenses/bsd-license.php                                            \r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+  Module Name:  AuthenticationInfo.h\r
+\r
+**/\r
+\r
+#ifndef __AUTHENTICATION_INFO_H__\r
+#define __AUTHENTICATION_INFO_H__\r
+\r
+#define EFI_AUTHENTICATION_INFO_PROTOCOL_GUID \\r
+  { \\r
+    0x7671d9d0, 0x53db, 0x4173, {0xaa, 0x69, 0x23, 0x27, 0xf2, 0x1f, 0x0b, 0xc7 } \\r
+  }\r
+  \r
+#define EFI_AUTHENTICATION_CHAP_RADIUS_GUID \\r
+  { \\r
+    0xd6062b50, 0x15ca, 0x11da, {0x92, 0x19, 0x00, 0x10, 0x83, 0xff, 0xca, 0x4d } \\r
+  }\r
+\r
+#define EFI_AUTHENTICATION_CHAP_LOCAL_GUID \\r
+  { \\r
+    0xc280c73e, 0x15ca, 0x11da, {0xb0, 0xca, 0x00, 0x10, 0x83, 0xff, 0xca, 0x4d } \\r
+  }\r
+\r
+typedef struct _EFI_AUTHENTICATION_INFO_PROTOCOL EFI_AUTHENTICATION_INFO_PROTOCOL;\r
+\r
+typedef struct {\r
+  EFI_GUID         Guid;\r
+  UINT16           Length;\r
+} AUTH_NODE_HEADER;\r
+\r
+typedef struct {\r
+  AUTH_NODE_HEADER Header;\r
+  EFI_IPv6_ADDRESS RadiusIpAddr;             // IPv4 or IPv6 address\r
+  UINT16           Reserved;\r
+  EFI_IPv6_ADDRESS NasIpAddr;                // IPv4 or IPv6 address\r
+  UINT16           NasSecretLength; \r
+  UINT8            *NasSecret;      \r
+  UINT16           ChapSecretLength;\r
+  UINT8            *ChapSecret;\r
+  UINT16           ChapNameLength;\r
+  UINT8            *ChapName;\r
+} CHAP_RADIUS_AUTH_NODE;\r
+\r
+typedef struct {\r
+  AUTH_NODE_HEADER Header;\r
+  UINT16           Reserved;\r
+  UINT16           UserSecretLength;\r
+  UINT8            *UserSecret;     \r
+  UINT16           UserNameLength;\r
+  UINT8            *UserName;\r
+  UINT16           ChapSecretLength;\r
+  UINT8            *ChapSecret;\r
+  UINT16           ChapNameLength;\r
+  UINT8            *ChapName;\r
+} CHAP_LOCAL_AUTH_NODE;\r
+\r
+/**\r
+  Retrieves the Authentication information associated with a particular controller handle.\r
+\r
+  @param  This                   Pointer to the EFI_AUTHENTICATION_INFO_PROTOCOL\r
+  @param  ControllerHandle       Handle to the Controller\r
+  @param  Buffer                 Pointer to the authentication information.\r
+\r
+  @retval EFI_SUCCESS           Successfully retrieved Authentication information for the given ControllerHandle\r
+  @retval EFI_INVALID_PARAMETER No matching Authentication information found for the given ControllerHandle\r
+  @retval EFI_DEVICE_ERROR      The authentication information could not be retrieved due to a\r
+                                hardware error.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_AUTHENTICATION_PROTOCOL_INFO_GET) (\r
+  IN  EFI_AUTHENTICATION_INFO_PROTOCOL *This,\r
+  IN  EFI_HANDLE                       *ControllerHandle,\r
+  OUT VOID                             *Buffer\r
+  )\r
+;  \r
+\r
+/**\r
+  Set the Authentication information for a given controller handle.\r
+\r
+  @param  This                  Pointer to the EFI_AUTHENTICATION_INFO_PROTOCOL\r
+  @param  ControllerHandle      Handle to the Controller\r
+  @param  Buffer                Pointer to the authentication information.\r
+                                \r
+  @retval EFI_SUCCESS          Successfully set Authentication information for the given ControllerHandle\r
+  @retval EFI_UNSUPPORTED      If the platform policies do not allow setting of the Authentication\r
+                               information.\r
+  @retval EFI_DEVICE_ERROR     The authentication information could not be configured due to a\r
+                               hardware error.\r
+  @retval EFI_OUT_OF_RESOURCES Not enough storage is available to hold the data.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_AUTHENTICATION_PROTOCOL_INFO_SET) (\r
+  IN EFI_AUTHENTICATION_INFO_PROTOCOL  *This,\r
+  IN EFI_HANDLE                        *ControllerHandle,\r
+  IN VOID                              *Buffer\r
+  )\r
+;  \r
+\r
+struct _EFI_AUTHENTICATION_INFO_PROTOCOL {\r
+  EFI_AUTHENTICATION_PROTOCOL_INFO_GET Get;\r
+  EFI_AUTHENTICATION_PROTOCOL_INFO_SET Set;\r
+};\r
+\r
+extern EFI_GUID gEfiAuthenticationInfoProtocolGuid;\r
+extern EFI_GUID gEfiAuthenticationChapRadiusGuid;\r
+extern EFI_GUID gEfiAuthenticationChapLocalGuid;\r
+\r
+#endif\r
diff --git a/Tools/Source/TianoTools/Include/Protocol/Bis.h b/Tools/Source/TianoTools/Include/Protocol/Bis.h
new file mode 100644 (file)
index 0000000..ffc66f6
--- /dev/null
@@ -0,0 +1,418 @@
+/** @file\r
+  This file defines the BIS protocol.\r
+\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. This program and the accompanying materials                          \r
+  are licensed and made available under the terms and conditions of the BSD License         \r
+  which accompanies this distribution.  The full text of the license may be found at        \r
+  http://opensource.org/licenses/bsd-license.php                                            \r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+  Module Name:  Bis.h\r
+\r
+**/\r
+\r
+#ifndef __BIS_H__\r
+#define __BIS_H__\r
+\r
+#define EFI_BIS_PROTOCOL_GUID \\r
+  { \\r
+    0x0b64aab0, 0x5429, 0x11d4, {0x98, 0x16, 0x00, 0xa0, 0xc9, 0x1f, 0xad, 0xcf } \\r
+  }\r
+\r
+typedef struct _EFI_BIS_PROTOCOL  EFI_BIS_PROTOCOL;\r
+\r
+\r
+//\r
+// Basic types\r
+//\r
+typedef VOID    *BIS_APPLICATION_HANDLE;\r
+typedef UINT16  BIS_ALG_ID;\r
+typedef UINT32  BIS_CERT_ID;\r
+\r
+//\r
+// EFI_BIS_DATA type.\r
+//\r
+// EFI_BIS_DATA instances obtained from BIS must be freed by calling Free( ).\r
+//\r
+typedef struct {\r
+  UINT32  Length; // Length of Data in 8 bit bytes.\r
+  UINT8   *Data;  // 32 Bit Flat Address of data.\r
+} EFI_BIS_DATA;\r
+\r
+//\r
+// EFI_BIS_VERSION type.\r
+//\r
+typedef struct {\r
+  UINT32  Major;  // BIS Interface version number.\r
+  UINT32  Minor;  // Build number.\r
+} EFI_BIS_VERSION;\r
+\r
+//\r
+// ----------------------------------------------------//\r
+// Use these values to initialize EFI_BIS_VERSION.Major\r
+// and to interpret results of Initialize.\r
+// ----------------------------------------------------//\r
+//\r
+#define BIS_CURRENT_VERSION_MAJOR BIS_VERSION_1\r
+#define BIS_VERSION_1             1\r
+\r
+//\r
+// EFI_BIS_SIGNATURE_INFO type.\r
+//\r
+typedef struct {\r
+  BIS_CERT_ID CertificateID;  // Truncated hash of platform Boot Object\r
+  //  authorization certificate.\r
+  //\r
+  BIS_ALG_ID  AlgorithmID;  // A signature algorithm number.\r
+  UINT16      KeyLength;    // Length of alg. keys in bits.\r
+} EFI_BIS_SIGNATURE_INFO;\r
+\r
+//\r
+// Currently defined values for EFI_BIS_SIGNATURE_INFO.AlgorithmID.\r
+// The exact numeric values come from\r
+//    "Common Data Security Architecture (CDSA) Specification".\r
+//\r
+#define BIS_ALG_DSA     (41)  // CSSM_ALGID_DSA\r
+#define BIS_ALG_RSA_MD5 (42)  // CSSM_ALGID_MD5_WITH_RSA\r
+// Currently defined values for EFI_BIS_SIGNATURE_INFO.CertificateId.\r
+//\r
+#define BIS_CERT_ID_DSA     BIS_ALG_DSA     // CSSM_ALGID_DSA\r
+#define BIS_CERT_ID_RSA_MD5 BIS_ALG_RSA_MD5 // CSSM_ALGID_MD5_WITH_RSA\r
+// The  following  is a mask value that gets applied to the truncated hash of a\r
+// platform  Boot Object Authorization Certificate to create the certificateID.\r
+// A certificateID must not have any bits set to the value 1 other than bits in\r
+// this mask.\r
+//\r
+#define BIS_CERT_ID_MASK  (0xFF7F7FFF)\r
+\r
+//\r
+// Macros for dealing with the EFI_BIS_DATA object obtained\r
+// from BIS_GetSignatureInfo()\r
+// BIS_GET_SIGINFO_COUNT - tells how many EFI_BIS_SIGNATURE_INFO\r
+//  elements are contained in a EFI_BIS_DATA struct pointed to\r
+//  by the provided EFI_BIS_DATA*.\r
+//\r
+#define BIS_GET_SIGINFO_COUNT(BisDataPtr) ((BisDataPtr)->Length / sizeof (EFI_BIS_SIGNATURE_INFO))\r
+\r
+//\r
+// BIS_GET_SIGINFO_ARRAY - produces a EFI_BIS_SIGNATURE_INFO*\r
+//  from a given EFI_BIS_DATA*.\r
+//\r
+#define BIS_GET_SIGINFO_ARRAY(BisDataPtr) ((EFI_BIS_SIGNATURE_INFO *) (BisDataPtr)->Data)\r
+\r
+//\r
+// Binary Value of "X-Intel-BIS-ParameterSet" Attribute.\r
+// (Value is Base64 encoded in actual signed manifest).\r
+// {EDD35E31-07B9-11d2-83A3-00A0C91FADCF}\r
+//\r
+#define BOOT_OBJECT_AUTHORIZATION_PARMSET_GUID \\r
+  { \\r
+    0xedd35e31, 0x7b9, 0x11d2, \\r
+    { \\r
+      0x83, 0xa3, 0x0, 0xa0, 0xc9, 0x1f, 0xad, 0xcf \\r
+    } \\r
+  }\r
+\r
+//\r
+// Support old name for backward compatible\r
+//\r
+#define BOOT_OBJECT_AUTHORIZATION_PARMSET_GUIDVALUE \\r
+        BOOT_OBJECT_AUTHORIZATION_PARMSET_GUID\r
+\r
+/**                                                                 \r
+  Initializes the BIS service, checking that it is compatible with the version requested by the caller.\r
+  After this call, other BIS functions may be invoked.                                                 \r
+    \r
+  @param  This                     A pointer to the EFI_BIS_PROTOCOL object.\r
+  @param  AppHandle                The function writes the new BIS_APPLICATION_HANDLE if           \r
+                                   successful, otherwise it writes NULL. The caller must eventually\r
+                                   destroy this handle by calling Shutdown().                      \r
+  @param  InterfaceVersion         On input, the caller supplies the major version number of the\r
+                                   interface version desired.                                   \r
+                                   On output, both the major and minor                         \r
+                                   version numbers are updated with the major and minor version\r
+                                   numbers of the interface                                    \r
+  @param  TargetAddress            Indicates a network or device address of the BIS platform to connect to.                                                                 \r
+  \r
+  @retval EFI_SUCCESS              The function completed successfully.\r
+  @retval EFI_INCOMPATIBLE_VERSION The InterfaceVersion.Major requested by the                \r
+                                   caller was not compatible with the interface version of the\r
+  @retval EFI_UNSUPPORTED          This is a local-platform implementation and        \r
+                                   TargetAddress.Data was not NULL, or                \r
+                                   TargetAddress.Data was any other value that was not\r
+                                   supported by the implementation.                   \r
+  @retval EFI_OUT_OF_RESOURCES     The function failed due to lack of memory or other resources.                              \r
+  @retval EFI_DEVICE_ERROR         The function encountered an unexpected internal failure.\r
+  @retval EFI_INVALID_PARAMETER    One or more parameters are invalid.\r
+                                          \r
+**/                                       \r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_BIS_INITIALIZE) (\r
+  IN     EFI_BIS_PROTOCOL        *This,              \r
+  OUT    BIS_APPLICATION_HANDLE  *AppHandle,         \r
+  IN OUT EFI_BIS_VERSION         *InterfaceVersion,  \r
+  IN     EFI_BIS_DATA            *TargetAddress      \r
+  );\r
+\r
+/**                                                                 \r
+  Frees memory structures allocated and returned by other functions in the EFI_BIS protocol.  \r
+      \r
+  @param  AppHandle                An opaque handle that identifies the caller¡¯s instance of initialization\r
+                                   of the BIS service.                                                                                         \r
+  @param  ToFree                   An EFI_BIS_DATA* and associated memory block to be freed.\r
+  \r
+  @retval EFI_SUCCESS              The function completed successfully.\r
+  @retval EFI_NO_MAPPING           The AppHandle parameter is not or is no longer a valid\r
+                                   application instance handle associated with the EFI_BIS protocol.                                     \r
+  @retval EFI_OUT_OF_RESOURCES     The function failed due to lack of memory or other resources.                                \r
+  @retval EFI_INVALID_PARAMETER    The ToFree parameter is not or is no longer a memory resource\r
+                                   associated with this AppHandle.                              \r
+                                           \r
+**/     \r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_BIS_FREE) (\r
+  IN BIS_APPLICATION_HANDLE  AppHandle,               \r
+  IN EFI_BIS_DATA            *ToFree                  \r
+  );\r
+\r
+/**                                                                 \r
+  Shuts down an application¡¯s instance of the BIS service, invalidating the application handle. After\r
+  this call, other BIS functions may no longer be invoked using the application handle value.         \r
+      \r
+  @param  AppHandle                An opaque handle that identifies the caller¡¯s instance of initialization\r
+                                   of the BIS service.                                                                                           \r
+  \r
+  @retval EFI_SUCCESS              The function completed successfully.\r
+  @retval EFI_NO_MAPPING           The AppHandle parameter is not or is no longer a valid\r
+                                   application instance handle associated with the EFI_BIS protocol.                                     \r
+  @retval EFI_OUT_OF_RESOURCES     The function failed due to lack of memory or other resources.                                \r
+  @retval EFI_DEVICE_ERROR         The function encountered an unexpected internal failure.  \r
+                                           \r
+**/   \r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_BIS_SHUTDOWN) (\r
+  IN BIS_APPLICATION_HANDLE  AppHandle               \r
+  );\r
+\r
+/**                                                                 \r
+  Retrieves the certificate that has been configured as the identity of the organization designated as\r
+  the source of authorization for signatures of boot objects.\r
+      \r
+  @param  AppHandle                An opaque handle that identifies the caller¡¯s instance of initialization\r
+                                   of the BIS service.                                                                                           \r
+  @param  Certificate              The function writes an allocated EFI_BIS_DATA* containing the Boot\r
+                                   Object Authorization Certificate object.                            \r
+  \r
+  @retval EFI_SUCCESS              The function completed successfully.\r
+  @retval EFI_NO_MAPPING           The AppHandle parameter is not or is no longer a valid\r
+                                   application instance handle associated with the EFI_BIS protocol.                                     \r
+  @retval EFI_NOT_FOUND            There is no Boot Object Authorization Certificate currently installed.                        \r
+  @retval EFI_OUT_OF_RESOURCES     The function failed due to lack of memory or other resources.                                \r
+  @retval EFI_INVALID_PARAMETER    The Certificate parameter supplied by the caller is NULL or\r
+                                   an invalid memory reference.                                       \r
+                                   \r
+**/ \r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_BIS_GET_BOOT_OBJECT_AUTHORIZATION_CERTIFICATE) (\r
+  IN  BIS_APPLICATION_HANDLE  AppHandle,              \r
+  OUT EFI_BIS_DATA            **Certificate           \r
+  );\r
+\r
+/**                                                                 \r
+  Verifies the integrity and authorization of the indicated data object according to the\r
+  indicated credentials.                                                                \r
+      \r
+  @param  AppHandle                An opaque handle that identifies the caller¡¯s instance of initialization\r
+                                   of the BIS service.                                                                                           \r
+  @param  Credentials              A Signed Manifest containing verification information for the indicated\r
+                                   data object.                                                            \r
+  @param  DataObject               An in-memory copy of the raw data object to be verified.\r
+  @param  IsVerified               The function writes TRUE if the verification succeeded, otherwise\r
+                                   FALSE.                                                           \r
+                                   \r
+  @retval EFI_SUCCESS              The function completed successfully.\r
+  @retval EFI_NO_MAPPING           The AppHandle parameter is not or is no longer a valid\r
+                                   application instance handle associated with the EFI_BIS protocol.                                       \r
+  @retval EFI_OUT_OF_RESOURCES     The function failed due to lack of memory or other resources.                                \r
+  @retval EFI_INVALID_PARAMETER    One or more parameters are invalid.\r
+  @retval EFI_SECURITY_VIOLATION   The signed manifest supplied as the Credentials parameter\r
+                                   was invalid (could not be parsed) or Platform-specific authorization failed, etc.\r
+  @retval EFI_DEVICE_ERROR         An unexpected internal error occurred.                           \r
+                                   \r
+**/ \r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_BIS_VERIFY_BOOT_OBJECT) (\r
+  IN  BIS_APPLICATION_HANDLE AppHandle,               \r
+  IN  EFI_BIS_DATA           *Credentials,            \r
+  IN  EFI_BIS_DATA           *DataObject,             \r
+  OUT BOOLEAN                *IsVerified              \r
+  );\r
+\r
+/**                                                                 \r
+  Retrieves the current status of the Boot Authorization Check Flag.\r
+      \r
+  @param  AppHandle                An opaque handle that identifies the caller¡¯s instance of initialization\r
+                                   of the BIS service.                                                                                           \r
+  @param  CheckIsRequired          The function writes the value TRUE if a Boot Authorization Check is\r
+                                   currently required on this platform, otherwise the function writes \r
+                                   FALSE.                                                             \r
+                                   \r
+  @retval EFI_SUCCESS              The function completed successfully.\r
+  @retval EFI_NO_MAPPING           The AppHandle parameter is not or is no longer a valid\r
+                                   application instance handle associated with the EFI_BIS protocol.                                       \r
+  @retval EFI_OUT_OF_RESOURCES     The function failed due to lack of memory or other resources.                                \r
+  @retval EFI_INVALID_PARAMETER    The CheckIsRequired parameter supplied by the caller is\r
+                                   NULL or an invalid memory reference.                   \r
+                                   \r
+**/ \r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_BIS_GET_BOOT_OBJECT_AUTHORIZATION_CHECKFLAG) (\r
+  IN  BIS_APPLICATION_HANDLE  AppHandle,             \r
+  OUT BOOLEAN                 *CheckIsRequired       \r
+  );\r
+\r
+/**                                                                 \r
+  Retrieves a unique token value to be included in the request credential for the next update of any\r
+  parameter in the Boot Object Authorization set                                                    \r
+      \r
+  @param  AppHandle                An opaque handle that identifies the caller¡¯s instance of initialization\r
+                                   of the BIS service.                                                                                           \r
+  @param  UpdateToken              The function writes an allocated EFI_BIS_DATA* containing the new\r
+                                   unique update token value.                                                                          \r
+                                   \r
+  @retval EFI_SUCCESS              The function completed successfully.\r
+  @retval EFI_NO_MAPPING           The AppHandle parameter is not or is no longer a valid\r
+                                   application instance handle associated with the EFI_BIS protocol.                                       \r
+  @retval EFI_OUT_OF_RESOURCES     The function failed due to lack of memory or other resources.                                \r
+  @retval EFI_INVALID_PARAMETER    The UpdateToken parameter supplied by the caller is NULL or\r
+                                   an invalid memory reference.        \r
+  @retval EFI_DEVICE_ERROR         An unexpected internal error occurred.                                                            \r
+                                   \r
+**/ \r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_BIS_GET_BOOT_OBJECT_AUTHORIZATION_UPDATE_TOKEN) (\r
+  IN  BIS_APPLICATION_HANDLE  AppHandle,              \r
+  OUT EFI_BIS_DATA            **UpdateToken           \r
+  );\r
+\r
+/**                                                                 \r
+  Updates one of the configurable parameters of the Boot Object Authorization set.\r
+      \r
+  @param  AppHandle                An opaque handle that identifies the caller¡¯s instance of initialization\r
+                                   of the BIS service.                                                                                           \r
+  @param  RequestCredential        This is a Signed Manifest with embedded attributes that carry the details\r
+                                   of the requested update.                                                 \r
+  @param  NewUpdateToken           The function writes an allocated EFI_BIS_DATA* containing the new                        \r
+                                   unique update token value.                                       \r
+                                   \r
+  @retval EFI_SUCCESS              The function completed successfully.                                                \r
+  @retval EFI_NO_MAPPING           The AppHandle parameter is not or is no longer a valid                              \r
+                                   application instance handle associated with the EFI_BIS protocol.                   \r
+  @retval EFI_OUT_OF_RESOURCES     The function failed due to lack of memory or other resources.                       \r
+  @retval EFI_INVALID_PARAMETER    One or more parameters are invalid.                                                 \r
+  @retval EFI_SECURITY_VIOLATION   The signed manifest supplied as the RequestCredential parameter                           \r
+                                   was invalid (could not be parsed) or Platform-specific authorization failed, etc.   \r
+  @retval EFI_DEVICE_ERROR         An unexpected internal error occurred.                                                                                                                                                                   \r
+                                   \r
+**/ \r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_BIS_UPDATE_BOOT_OBJECT_AUTHORIZATION) (\r
+  IN  BIS_APPLICATION_HANDLE AppHandle,               \r
+  IN  EFI_BIS_DATA           *RequestCredential,      \r
+  OUT EFI_BIS_DATA           **NewUpdateToken         \r
+  );\r
+\r
+/**                                                                 \r
+  Verifies the integrity and authorization of the indicated data object according to the indicated\r
+  credentials and authority certificate.                                                          \r
+      \r
+  @param  AppHandle                An opaque handle that identifies the caller¡¯s instance of initialization\r
+                                   of the BIS service.                                                                                           \r
+  @param  Credentials              A Signed Manifest containing verification information for the\r
+                                   indicated data object.                                       \r
+  @param  DataObject               An in-memory copy of the raw data object to be verified.\r
+  @param  SectionName              An ASCII (not Unicode) string giving the section name in the  \r
+                                   manifest holding the verification information (in other words,\r
+                                   hash value) that corresponds to DataObject.                             \r
+  @param  AuthorityCertificate     A digital certificate whose public key must match the signer¡¯s                              \r
+                                   public key which is found in the credentials.                  \r
+  @param  IsVerified               The function writes TRUE if the verification was successful.\r
+                                   Otherwise, the function writes FALSE.                       \r
+                                   \r
+  @retval EFI_SUCCESS              The function completed successfully.                                                \r
+  @retval EFI_NO_MAPPING           The AppHandle parameter is not or is no longer a valid                              \r
+                                   application instance handle associated with the EFI_BIS protocol.                   \r
+  @retval EFI_OUT_OF_RESOURCES     The function failed due to lack of memory or other resources.                       \r
+  @retval EFI_INVALID_PARAMETER    One or more parameters are invalid.                                                 \r
+  @retval EFI_SECURITY_VIOLATION   The Credentials.Data supplied by the caller is NULL,\r
+                                   or the AuthorityCertificate supplied by the caller was \r
+                                   invalid (could not be parsed),                      \r
+                                   or Platform-specific authorization failed, etc.   \r
+  @retval EFI_DEVICE_ERROR         An unexpected internal error occurred.                                                                                                                                                                   \r
+                                   \r
+**/ \r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_BIS_VERIFY_OBJECT_WITH_CREDENTIAL) (\r
+  IN  BIS_APPLICATION_HANDLE AppHandle,              \r
+  IN  EFI_BIS_DATA           *Credentials,           \r
+  IN  EFI_BIS_DATA           *DataObject,            \r
+  IN  EFI_BIS_DATA           *SectionName,           \r
+  IN  EFI_BIS_DATA           *AuthorityCertificate,  \r
+  OUT BOOLEAN                *IsVerified             \r
+  );\r
+\r
+/**                                                                 \r
+  Retrieves a list of digital certificate identifier, digital signature algorithm, hash algorithm, and keylength\r
+  combinations that the platform supports.                                                                      \r
+      \r
+  @param  AppHandle                An opaque handle that identifies the caller¡¯s instance of initialization\r
+                                   of the BIS service.                                                                                           \r
+  @param  SignatureInfo            The function writes an allocated EFI_BIS_DATA* containing the array\r
+                                   of EFI_BIS_SIGNATURE_INFO structures representing the supported    \r
+                                   digital certificate identifier, algorithm, and key length combinations.                                   \r
+                                   \r
+  @retval EFI_SUCCESS              The function completed successfully.                                                \r
+  @retval EFI_NO_MAPPING           The AppHandle parameter is not or is no longer a valid                              \r
+                                   application instance handle associated with the EFI_BIS protocol.                   \r
+  @retval EFI_OUT_OF_RESOURCES     The function failed due to lack of memory or other resources.                       \r
+  @retval EFI_INVALID_PARAMETER    The SignatureInfo parameter supplied by the caller is NULL\r
+                                   or an invalid memory reference.                           \r
+  @retval EFI_DEVICE_ERROR         An unexpected internal error occurred.                                                                                                                                                                   \r
+                                   \r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_BIS_GET_SIGNATURE_INFO) (\r
+  IN  BIS_APPLICATION_HANDLE  AppHandle,           \r
+  OUT EFI_BIS_DATA            **SignatureInfo      \r
+  );\r
+\r
+struct _EFI_BIS_PROTOCOL {\r
+  EFI_BIS_INITIALIZE                                  Initialize;\r
+  EFI_BIS_SHUTDOWN                                    Shutdown;\r
+  EFI_BIS_FREE                                        Free;\r
+  EFI_BIS_GET_BOOT_OBJECT_AUTHORIZATION_CERTIFICATE   GetBootObjectAuthorizationCertificate;\r
+  EFI_BIS_GET_BOOT_OBJECT_AUTHORIZATION_CHECKFLAG     GetBootObjectAuthorizationCheckFlag;\r
+  EFI_BIS_GET_BOOT_OBJECT_AUTHORIZATION_UPDATE_TOKEN  GetBootObjectAuthorizationUpdateToken;\r
+  EFI_BIS_GET_SIGNATURE_INFO                          GetSignatureInfo;\r
+  EFI_BIS_UPDATE_BOOT_OBJECT_AUTHORIZATION            UpdateBootObjectAuthorization;\r
+  EFI_BIS_VERIFY_BOOT_OBJECT                          VerifyBootObject;\r
+  EFI_BIS_VERIFY_OBJECT_WITH_CREDENTIAL               VerifyObjectWithCredential;\r
+};\r
+\r
+extern EFI_GUID gEfiBisProtocolGuid;\r
+extern EFI_GUID gBootObjectAuthorizationParmsetGuid;\r
+\r
+#endif\r
diff --git a/Tools/Source/TianoTools/Include/Protocol/BlockIo.h b/Tools/Source/TianoTools/Include/Protocol/BlockIo.h
new file mode 100644 (file)
index 0000000..4c7e8b4
--- /dev/null
@@ -0,0 +1,173 @@
+/** @file\r
+  Block IO protocol as defined in the EFI 1.0 specification.\r
+\r
+  The Block IO protocol is used to abstract block devices like hard drives,\r
+  DVD-ROMs and floppy drives.\r
+\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. This program and the accompanying materials                          \r
+  are licensed and made available under the terms and conditions of the BSD License         \r
+  which accompanies this distribution.  The full text of the license may be found at        \r
+  http://opensource.org/licenses/bsd-license.php                                            \r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+  Module Name:  BlockIo.h\r
+\r
+**/\r
+\r
+#ifndef __BLOCK_IO_H__\r
+#define __BLOCK_IO_H__\r
+\r
+#define EFI_BLOCK_IO_PROTOCOL_GUID \\r
+  { \\r
+    0x964e5b21, 0x6459, 0x11d2, {0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b } \\r
+  }\r
+\r
+//\r
+// Forward reference for pure ANSI compatability\r
+//\r
+typedef struct _EFI_BLOCK_IO_PROTOCOL  EFI_BLOCK_IO_PROTOCOL;\r
+\r
+/**\r
+  Reset the Block Device.\r
+\r
+  @param  This                 Protocol instance pointer.\r
+  @param  ExtendedVerification Driver may perform diagnostics on reset.\r
+\r
+  @retval EFI_SUCCESS          The device was reset.\r
+  @retval EFI_DEVICE_ERROR     The device is not functioning properly and could\r
+                               not be reset.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_BLOCK_RESET) (\r
+  IN EFI_BLOCK_IO_PROTOCOL          *This,\r
+  IN BOOLEAN                        ExtendedVerification\r
+  )\r
+;\r
+\r
+/**\r
+  Read BufferSize bytes from Lba into Buffer.\r
+\r
+  @param  This       Protocol instance pointer.\r
+  @param  MediaId    Id of the media, changes every time the media is replaced.\r
+  @param  Lba        The starting Logical Block Address to read from\r
+  @param  BufferSize Size of Buffer, must be a multiple of device block size.\r
+  @param  Buffer     Buffer containing read data\r
+\r
+  @retval EFI_SUCCESS           The data was read correctly from the device.\r
+  @retval EFI_DEVICE_ERROR      The device reported an error while performing the read.\r
+  @retval EFI_NO_MEDIA          There is no media in the device.\r
+  @retval EFI_MEDIA_CHANGED     The MediaId does not matched the current device.\r
+  @retval EFI_BAD_BUFFER_SIZE   The Buffer was not a multiple of the block size of the device.\r
+  @retval EFI_INVALID_PARAMETER The read request contains device addresses that are not\r
+                                valid for the device.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_BLOCK_READ) (\r
+  IN EFI_BLOCK_IO_PROTOCOL          *This,\r
+  IN UINT32                         MediaId,\r
+  IN EFI_LBA                        Lba,\r
+  IN UINTN                          BufferSize,\r
+  OUT VOID                          *Buffer\r
+  )\r
+;\r
+\r
+/**\r
+  Write BufferSize bytes from Lba into Buffer.\r
+\r
+  @param  This       Protocol instance pointer.\r
+  @param  MediaId    Id of the media, changes every time the media is replaced.\r
+  @param  Lba        The starting Logical Block Address to read from\r
+  @param  BufferSize Size of Buffer, must be a multiple of device block size.\r
+  @param  Buffer     Buffer containing read data\r
+\r
+  @retval EFI_SUCCESS           The data was written correctly to the device.\r
+  @retval EFI_WRITE_PROTECTED   The device can not be written to.\r
+  @retval EFI_DEVICE_ERROR      The device reported an error while performing the write.\r
+  @retval EFI_NO_MEDIA          There is no media in the device.\r
+  @retval EFI_MEDIA_CHNAGED     The MediaId does not matched the current device.\r
+  @retval EFI_BAD_BUFFER_SIZE   The Buffer was not a multiple of the block size of the device.\r
+  @retval EFI_INVALID_PARAMETER The write request contains a LBA that is not\r
+                                valid for the device.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_BLOCK_WRITE) (\r
+  IN EFI_BLOCK_IO_PROTOCOL          *This,\r
+  IN UINT32                         MediaId,\r
+  IN EFI_LBA                        Lba,\r
+  IN UINTN                          BufferSize,\r
+  IN VOID                           *Buffer\r
+  )\r
+;\r
+\r
+/**\r
+  Flush the Block Device.\r
+\r
+  @param  This              Protocol instance pointer.\r
+\r
+  @retval EFI_SUCCESS       All outstanding data was written to the device\r
+  @retval EFI_DEVICE_ERROR  The device reported an error while writting back the data\r
+  @retval EFI_NO_MEDIA      There is no media in the device.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_BLOCK_FLUSH) (\r
+  IN EFI_BLOCK_IO_PROTOCOL  *This\r
+  )\r
+;\r
+\r
+/**\r
+  Block IO read only mode data and updated only via members of BlockIO\r
+\r
+**/\r
+typedef struct {\r
+  UINT32  MediaId;    ///< The curent media Id. If the media changes, this value is changed.\r
+  BOOLEAN RemovableMedia;  ///< TRUE if the media is removable; otherwise, FALSE.\r
+  BOOLEAN MediaPresent;    /**< TRUE if there is a media currently present in the device;\r
+             othersise, FALSE. THis field shows the media present status\r
+             as of the most recent ReadBlocks() or WriteBlocks() call.\r
+        **/\r
+  BOOLEAN LogicalPartition;  /**< TRUE if LBA 0 is the first block of a partition; otherwise\r
+             FALSE. For media with only one partition this would be TRUE.\r
+        **/\r
+  BOOLEAN ReadOnly;    /**< TRUE if the media is marked read-only otherwise, FALSE.\r
+             This field shows the read-only status as of the most recent WriteBlocks () call.\r
+        **/\r
+  BOOLEAN WriteCaching;    ///< TRUE if the WriteBlock () function caches write data.\r
+\r
+  UINT32  BlockSize;    /**< The intrinsic block size of the device. If the media changes, then\r
+             this field is updated.\r
+        **/\r
+  UINT32  IoAlign;    ///< Supplies the alignment requirement for any buffer to read or write block(s).\r
+\r
+  EFI_LBA LastBlock;    /**< The last logical block address on the device.\r
+             If the media changes, then this field is updated.\r
+        **/\r
+} EFI_BLOCK_IO_MEDIA;\r
+\r
+#define EFI_BLOCK_IO_PROTOCOL_REVISION  0x00010000\r
+\r
+struct _EFI_BLOCK_IO_PROTOCOL {\r
+  UINT64              Revision;\r
+\r
+  EFI_BLOCK_IO_MEDIA  *Media;\r
+\r
+  EFI_BLOCK_RESET     Reset;\r
+  EFI_BLOCK_READ      ReadBlocks;\r
+  EFI_BLOCK_WRITE     WriteBlocks;\r
+  EFI_BLOCK_FLUSH     FlushBlocks;\r
+\r
+};\r
+\r
+extern EFI_GUID gEfiBlockIoProtocolGuid;\r
+\r
+#endif\r
diff --git a/Tools/Source/TianoTools/Include/Protocol/BootScriptSave.h b/Tools/Source/TianoTools/Include/Protocol/BootScriptSave.h
new file mode 100644 (file)
index 0000000..4dff3a9
--- /dev/null
@@ -0,0 +1,110 @@
+/** @file\r
+  Definition of the Boot Script Save protocol.\r
+\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. This program and the accompanying materials                          \r
+  are licensed and made available under the terms and conditions of the BSD License         \r
+  which accompanies this distribution.  The full text of the license may be found at        \r
+  http://opensource.org/licenses/bsd-license.php                                            \r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+  Module Name:  BootScriptSave.h\r
+\r
+  @par Revision Reference:\r
+  This protocol defined in the Boot Script Specification, Version 0.91.\r
+\r
+**/\r
+\r
+#ifndef _BOOT_SCRIPT_SAVE_PROTOCOL_H\r
+#define _BOOT_SCRIPT_SAVE_PROTOCOL_H\r
+\r
+//\r
+// S3 Save Protocol GUID\r
+//\r
+#define EFI_BOOT_SCRIPT_SAVE_PROTOCOL_GUID \\r
+  { \\r
+    0x470e1529, 0xb79e, 0x4e32, {0xa0, 0xfe, 0x6a, 0x15, 0x6d, 0x29, 0xf9, 0xb2 } \\r
+  }\r
+\r
+typedef struct _EFI_BOOT_SCRIPT_SAVE_PROTOCOL EFI_BOOT_SCRIPT_SAVE_PROTOCOL;\r
+\r
+//\r
+// Protocol Member_Function\r
+//\r
+/**\r
+  Adds a record into a specified Framework boot script table.\r
+\r
+  @param  This A pointer to the EFI_BOOT_SCRIPT_SAVE_PROTOCOL instance.\r
+  \r
+  @param  TableName Name of the script table.Currently, the only meaningful \r
+  value is EFI_ACPI_S3_RESUME_SCRIPT_TABLE.\r
+  \r
+  @param  OpCode The operation code (opcode) number.\r
+  \r
+  @param  ... Argument list that is specific to each opcode.\r
+\r
+  @retval EFI_SUCCESS The operation succeeded. A record was added into the specified script table.\r
+  \r
+  @retval EFI_INVALID_PARAMETER The parameter is illegal or the given boot script is not supported.\r
+  \r
+  @retval EFI_OUT_OF_RESOURCES There is insufficient memory to store the boot script.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_BOOT_SCRIPT_WRITE) (\r
+  IN EFI_BOOT_SCRIPT_SAVE_PROTOCOL            *This,\r
+  IN UINT16                                   TableName,\r
+  IN UINT16                                   OpCode,\r
+  ...\r
+  );\r
+\r
+/**\r
+  Closes the specified script table.\r
+\r
+  @param  This A pointer to the EFI_BOOT_SCRIPT_SAVE_PROTOCOL instance.\r
+  \r
+  @param  TableName Name of the script table.\r
+  \r
+  @param  Address A pointer to the physical address where the table begins.\r
+\r
+  @retval EFI_SUCCESS The table was successfully returned.\r
+  \r
+  @retval EFI_NOT_FOUND The specified table was not created previously.\r
+  \r
+  @retval EFI_OUT_OF_RESOURCES Memory is insufficient to hold the reorganized boot script table.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_BOOT_SCRIPT_CLOSE_TABLE) (\r
+  IN EFI_BOOT_SCRIPT_SAVE_PROTOCOL            *This,\r
+  IN UINT16                                   TableName,\r
+  OUT EFI_PHYSICAL_ADDRESS                    *Address\r
+  );\r
+\r
+//\r
+// S3 Save Protocol data structure\r
+//\r
+/**\r
+  @par Protocol Description:\r
+  The EFI_BOOT_SCRIPT_SAVE_PROTOCOL publishes the Framework boot script abstractions\r
+  to store or record various boot scripts into boot script tables.\r
+\r
+  @param Write\r
+  Writes various boot scripts to a boot script table.\r
+\r
+  @param CloseTable\r
+  Retrieves and closes a script table.\r
+\r
+**/\r
+struct _EFI_BOOT_SCRIPT_SAVE_PROTOCOL {\r
+  EFI_BOOT_SCRIPT_WRITE       Write;\r
+  EFI_BOOT_SCRIPT_CLOSE_TABLE CloseTable;\r
+};\r
+\r
+extern EFI_GUID gEfiBootScriptSaveProtocolGuid;\r
+\r
+#endif\r
diff --git a/Tools/Source/TianoTools/Include/Protocol/BusSpecificDriverOverride.h b/Tools/Source/TianoTools/Include/Protocol/BusSpecificDriverOverride.h
new file mode 100644 (file)
index 0000000..c446940
--- /dev/null
@@ -0,0 +1,66 @@
+/** @file\r
+  Bus Specific Driver Override protocol as defined in the EFI 1.1 specification.\r
+\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. This program and the accompanying materials                          \r
+  are licensed and made available under the terms and conditions of the BSD License         \r
+  which accompanies this distribution.  The full text of the license may be found at        \r
+  http://opensource.org/licenses/bsd-license.php                                            \r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+  Module Name:  BusSpecificDriverOverride.h\r
+\r
+**/\r
+\r
+#ifndef _EFI_BUS_SPECIFIC_DRIVER_OVERRIDE_PROTOCOL_H_\r
+#define _EFI_BUS_SPECIFIC_DRIVER_OVERRIDE_PROTOCOL_H_\r
+\r
+//\r
+// Global ID for the Bus Specific Driver Override Protocol\r
+//\r
+#define EFI_BUS_SPECIFIC_DRIVER_OVERRIDE_PROTOCOL_GUID \\r
+  { \\r
+    0x3bc1b285, 0x8a15, 0x4a82, {0xaa, 0xbf, 0x4d, 0x7d, 0x13, 0xfb, 0x32, 0x65 } \\r
+  }\r
+\r
+typedef struct _EFI_BUS_SPECIFIC_DRIVER_OVERRIDE_PROTOCOL  EFI_BUS_SPECIFIC_DRIVER_OVERRIDE_PROTOCOL;\r
+\r
+//\r
+// Prototypes for the Bus Specific Driver Override Protocol\r
+//\r
+\r
+/**                                                                   \r
+  Uses a bus specific algorithm to retrieve a driver image handle for a controller.\r
+    \r
+  @param  This                  A pointer to the EFI_BUS_SPECIFIC_DRIVER_\r
+                                OVERRIDE_PROTOCOL instance.              \r
+  @param  DriverImageHandle     On input, a pointer to the previous driver image handle returned\r
+                                by GetDriver(). On output, a pointer to the next driver         \r
+                                image handle. Passing in a NULL, will return the first driver   \r
+                                image handle.                                                     \r
+                                \r
+  @retval EFI_SUCCESS           A bus specific override driver is returned in DriverImageHandle.\r
+  @retval EFI_NOT_FOUND         The end of the list of override drivers was reached.\r
+  @retval EFI_INVALID_PARAMETER DriverImageHandle is not a handle that was returned on a\r
+                                previous call to GetDriver().                           \r
+                                   \r
+**/   \r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_BUS_SPECIFIC_DRIVER_OVERRIDE_GET_DRIVER) (\r
+  IN EFI_BUS_SPECIFIC_DRIVER_OVERRIDE_PROTOCOL              *This,\r
+  IN OUT EFI_HANDLE                                         *DriverImageHandle\r
+  );\r
+\r
+//\r
+// Interface structure for the Bus Specific Driver Override Protocol\r
+//\r
+struct _EFI_BUS_SPECIFIC_DRIVER_OVERRIDE_PROTOCOL {\r
+  EFI_BUS_SPECIFIC_DRIVER_OVERRIDE_GET_DRIVER GetDriver;\r
+};\r
+\r
+extern EFI_GUID gEfiBusSpecificDriverOverrideProtocolGuid;\r
+\r
+#endif\r
diff --git a/Tools/Source/TianoTools/Include/Protocol/ComponentName.h b/Tools/Source/TianoTools/Include/Protocol/ComponentName.h
new file mode 100644 (file)
index 0000000..68fd31b
--- /dev/null
@@ -0,0 +1,123 @@
+/** @file\r
+  EFI Component Name Protocol\r
+\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. This program and the accompanying materials                          \r
+  are licensed and made available under the terms and conditions of the BSD License         \r
+  which accompanies this distribution.  The full text of the license may be found at        \r
+  http://opensource.org/licenses/bsd-license.php                                            \r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+  Module Name:  ComponentName.h\r
+\r
+**/\r
+\r
+#ifndef __EFI_COMPONENT_NAME_H__\r
+#define __EFI_COMPONENT_NAME_H__\r
+\r
+//\r
+// Global ID for the Component Name Protocol\r
+//\r
+#define EFI_COMPONENT_NAME_PROTOCOL_GUID \\r
+  { \\r
+    0x107a772c, 0xd5e1, 0x11d4, {0x9a, 0x46, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d } \\r
+  }\r
+\r
+typedef struct _EFI_COMPONENT_NAME_PROTOCOL  EFI_COMPONENT_NAME_PROTOCOL;\r
+\r
+\r
+/**\r
+  Retrieves a Unicode string that is the user readable name of the EFI Driver.\r
+\r
+  @param  This       A pointer to the EFI_COMPONENT_NAME_PROTOCOL instance.\r
+  @param  Language   A pointer to a three character ISO 639-2 language identifier.\r
+                     This is the language of the driver name that that the caller\r
+                     is requesting, and it must match one of the languages specified\r
+                     in SupportedLanguages.  The number of languages supported by a\r
+                     driver is up to the driver writer.\r
+  @param  DriverName A pointer to the Unicode string to return.  This Unicode string\r
+                     is the name of the driver specified by This in the language\r
+                     specified by Language.\r
+\r
+  @retval EFI_SUCCESS           The Unicode string for the Driver specified by This\r
+                                and the language specified by Language was returned\r
+                                in DriverName.\r
+  @retval EFI_INVALID_PARAMETER Language is NULL.\r
+  @retval EFI_INVALID_PARAMETER DriverName is NULL.\r
+  @retval EFI_UNSUPPORTED       The driver specified by This does not support the\r
+                                language specified by Language.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_COMPONENT_NAME_GET_DRIVER_NAME) (\r
+  IN EFI_COMPONENT_NAME_PROTOCOL           *This,\r
+  IN  CHAR8                                *Language,\r
+  OUT CHAR16                               **DriverName\r
+  );\r
+\r
+\r
+/**\r
+  Retrieves a Unicode string that is the user readable name of the controller\r
+  that is being managed by an EFI Driver.\r
+\r
+  @param  This             A pointer to the EFI_COMPONENT_NAME_PROTOCOL instance.\r
+  @param  ControllerHandle The handle of a controller that the driver specified by\r
+                           This is managing.  This handle specifies the controller\r
+                           whose name is to be returned.\r
+  @param  ChildHandle      The handle of the child controller to retrieve the name\r
+                           of.  This is an optional parameter that may be NULL.  It\r
+                           will be NULL for device drivers.  It will also be NULL\r
+                           for a bus drivers that wish to retrieve the name of the\r
+                           bus controller.  It will not be NULL for a bus driver\r
+                           that wishes to retrieve the name of a child controller.\r
+  @param  Language         A pointer to a three character ISO 639-2 language\r
+                           identifier.  This is the language of the controller name\r
+                           that that the caller is requesting, and it must match one\r
+                           of the languages specified in SupportedLanguages.  The\r
+                           number of languages supported by a driver is up to the\r
+                           driver writer.\r
+  @param  ControllerName   A pointer to the Unicode string to return.  This Unicode\r
+                           string is the name of the controller specified by\r
+                           ControllerHandle and ChildHandle in the language specified\r
+                           by Language from the point of view of the driver specified\r
+                           by This.\r
+\r
+  @retval EFI_SUCCESS           The Unicode string for the user readable name in the\r
+                                language specified by Language for the driver\r
+                                specified by This was returned in DriverName.\r
+  @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.\r
+  @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid EFI_HANDLE.\r
+  @retval EFI_INVALID_PARAMETER Language is NULL.\r
+  @retval EFI_INVALID_PARAMETER ControllerName is NULL.\r
+  @retval EFI_UNSUPPORTED       The driver specified by This is not currently managing\r
+                                the controller specified by ControllerHandle and\r
+                                ChildHandle.\r
+  @retval EFI_UNSUPPORTED       The driver specified by This does not support the\r
+                                language specified by Language.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_COMPONENT_NAME_GET_CONTROLLER_NAME) (\r
+  IN EFI_COMPONENT_NAME_PROTOCOL                              *This,\r
+  IN  EFI_HANDLE                                              ControllerHandle,\r
+  IN  EFI_HANDLE                                              ChildHandle        OPTIONAL,\r
+  IN  CHAR8                                                   *Language,\r
+  OUT CHAR16                                                  **ControllerName\r
+  );\r
+\r
+//\r
+// Interface structure for the Component Name Protocol\r
+//\r
+struct _EFI_COMPONENT_NAME_PROTOCOL {\r
+  EFI_COMPONENT_NAME_GET_DRIVER_NAME      GetDriverName;\r
+  EFI_COMPONENT_NAME_GET_CONTROLLER_NAME  GetControllerName;\r
+  CHAR8                                   *SupportedLanguages;\r
+};\r
+\r
+extern EFI_GUID gEfiComponentNameProtocolGuid;\r
+\r
+#endif\r
diff --git a/Tools/Source/TianoTools/Include/Protocol/CpuIo.h b/Tools/Source/TianoTools/Include/Protocol/CpuIo.h
new file mode 100644 (file)
index 0000000..619878c
--- /dev/null
@@ -0,0 +1,131 @@
+/** @file\r
+  This code abstracts the CPU IO Protocol\r
+\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. This program and the accompanying materials                          \r
+  are licensed and made available under the terms and conditions of the BSD License         \r
+  which accompanies this distribution.  The full text of the license may be found at        \r
+  http://opensource.org/licenses/bsd-license.php                                            \r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+  Module Name:  CpuIO.h\r
+\r
+  @par Revision Reference:\r
+  CPU IO Protocol is defined in Framework of EFI CPU IO Protocol Spec\r
+  Version 0.9\r
+\r
+**/\r
+\r
+#ifndef _CPUIO_H_\r
+#define _CPUIO_H_\r
+\r
+#define EFI_CPU_IO_PROTOCOL_GUID \\r
+  { \\r
+    0xB0732526, 0x38C8, 0x4b40, {0x88, 0x77, 0x61, 0xC7, 0xB0, 0x6A, 0xAC, 0x45 } \\r
+  }\r
+\r
+typedef struct _EFI_CPU_IO_PROTOCOL EFI_CPU_IO_PROTOCOL;\r
+\r
+//\r
+// *******************************************************\r
+// EFI_CPU_IO_PROTOCOL_WIDTH\r
+// *******************************************************\r
+//\r
+typedef enum {\r
+  EfiCpuIoWidthUint8,\r
+  EfiCpuIoWidthUint16,\r
+  EfiCpuIoWidthUint32,\r
+  EfiCpuIoWidthUint64,\r
+  EfiCpuIoWidthFifoUint8,\r
+  EfiCpuIoWidthFifoUint16,\r
+  EfiCpuIoWidthFifoUint32,\r
+  EfiCpuIoWidthFifoUint64,\r
+  EfiCpuIoWidthFillUint8,\r
+  EfiCpuIoWidthFillUint16,\r
+  EfiCpuIoWidthFillUint32,\r
+  EfiCpuIoWidthFillUint64,\r
+  EfiCpuIoWidthMaximum\r
+} EFI_CPU_IO_PROTOCOL_WIDTH;\r
+\r
+//\r
+// *******************************************************\r
+// EFI_CPU_IO_PROTOCOL_IO_MEM\r
+// *******************************************************\r
+//\r
+/**\r
+  Enables a driver to access memory-mapped registers in the EFI system memory space.\r
+  Or, Enables a driver to access registers in the EFI CPU I/O space.\r
+\r
+  @param  This A pointer to the EFI_CPU_IO_PROTOCOL instance.\r
+  \r
+  @param  Width Signifies the width of the I/O or Memory operation. \r
+  \r
+  @param  Address The base address of the I/O or Memoryoperation. \r
+  \r
+  @param  Count The number of I/O or Memory operations to perform.\r
+  The number of bytes moved is Width size * Count, starting at Address.\r
+  \r
+  @param  Buffer For read operations, the destination buffer to store the results.\r
+  For write operations, the source buffer from which to write data.\r
+\r
+  @retval EFI_SUCCESS The data was read from or written to the EFI system.\r
+  \r
+  @retval EFI_INVALID_PARAMETER Width is invalid for this EFI system.Or Buffer is NULL.\r
+  \r
+  @retval EFI_UNSUPPORTED The Buffer is not aligned for the given Width. \r
+  Or,The address range specified by Address, Width, and Count is not valid for this EFI system.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_CPU_IO_PROTOCOL_IO_MEM) (\r
+  IN EFI_CPU_IO_PROTOCOL                *This,\r
+  IN  EFI_CPU_IO_PROTOCOL_WIDTH         Width,\r
+  IN  UINT64                            Address,\r
+  IN  UINTN                             Count,\r
+  IN  OUT VOID                          *Buffer\r
+  );\r
+\r
+//\r
+// *******************************************************\r
+// EFI_CPU_IO_PROTOCOL_ACCESS\r
+// *******************************************************\r
+//\r
+typedef struct {\r
+  EFI_CPU_IO_PROTOCOL_IO_MEM  Read;\r
+  EFI_CPU_IO_PROTOCOL_IO_MEM  Write;\r
+} EFI_CPU_IO_PROTOCOL_ACCESS;\r
+\r
+//\r
+// *******************************************************\r
+// EFI_CPU_IO_PROTOCOL\r
+// *******************************************************\r
+//\r
+/**\r
+  @par Protocol Description:\r
+  Provides the basic memory and I/O interfaces that are used to abstract \r
+  accesses to devices in a system.\r
+\r
+  @param Mem.Read\r
+  Allows reads from memory-mapped I/O space.\r
+\r
+  @param Mem.Write\r
+  Allows writes to memory-mapped I/O space.\r
+\r
+  @param Io.Read\r
+  Allows reads from I/O space.\r
+\r
+  @param Io.Write\r
+  Allows writes to I/O space.\r
+\r
+**/\r
+struct _EFI_CPU_IO_PROTOCOL {\r
+  EFI_CPU_IO_PROTOCOL_ACCESS  Mem;\r
+  EFI_CPU_IO_PROTOCOL_ACCESS  Io;\r
+};\r
+\r
+extern EFI_GUID gEfiCpuIoProtocolGuid;\r
+\r
+#endif\r
diff --git a/Tools/Source/TianoTools/Include/Protocol/DataHub.h b/Tools/Source/TianoTools/Include/Protocol/DataHub.h
new file mode 100644 (file)
index 0000000..15d3cc6
--- /dev/null
@@ -0,0 +1,233 @@
+/** @file\r
+  The data hub protocol is used both by agents wishing to log\r
+  data and those wishing to be made aware of all information that\r
+  has been logged.\r
+\r
+  For more information please look at Intel Platform Innovation \r
+  Framework for EFI Data Hub Specification.\r
+\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. This program and the accompanying materials                          \r
+  are licensed and made available under the terms and conditions of the BSD License         \r
+  which accompanies this distribution.  The full text of the license may be found at        \r
+  http://opensource.org/licenses/bsd-license.php                                            \r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+  Module Name:  DataHub.h\r
+\r
+  @par Revision Reference:\r
+  This protocol is defined in Framework for EFI Data Hub Specification.\r
+  Version 0.9.\r
+\r
+**/\r
+\r
+#ifndef __DATA_HUB_H__\r
+#define __DATA_HUB_H__\r
+\r
+#define EFI_DATA_HUB_PROTOCOL_GUID \\r
+  { \\r
+    0xae80d021, 0x618e, 0x11d4, {0xbc, 0xd7, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81 } \\r
+  }\r
+\r
+//\r
+// EFI generic Data Hub Header\r
+//\r
+// A Data Record is an EFI_DATA_RECORD_HEADER followed by RecordSize bytes of\r
+//  data. The format of the data is defined by the DataRecordGuid.\r
+//\r
+// If EFI_DATA_RECORD_HEADER is extended in the future the Version number must\r
+//  change and the HeaderSize will change if the definition of\r
+//  EFI_DATA_RECORD_HEADER is extended.\r
+//\r
+// The logger is responcible for initializing:\r
+//  Version, HeaderSize, RecordSize, DataRecordGuid, DataRecordClass\r
+//\r
+// The Data Hub driver is responcible for initializing:\r
+//   LogTime and LogMonotonicCount.\r
+//\r
+#define EFI_DATA_RECORD_HEADER_VERSION  0x0100\r
+typedef struct {\r
+  UINT16    Version;\r
+  UINT16    HeaderSize;\r
+  UINT32    RecordSize;\r
+  EFI_GUID  DataRecordGuid;\r
+  EFI_GUID  ProducerName;\r
+  UINT64    DataRecordClass;\r
+  EFI_TIME  LogTime;\r
+  UINT64    LogMonotonicCount;\r
+} EFI_DATA_RECORD_HEADER;\r
+\r
+//\r
+// Definition of DataRecordClass. These are used to filter out class types\r
+// at a very high level. The DataRecordGuid still defines the format of\r
+// the data. See DateHub.doc for rules on what can and can not be a\r
+// new DataRecordClass\r
+//\r
+#define EFI_DATA_RECORD_CLASS_DEBUG         0x0000000000000001\r
+#define EFI_DATA_RECORD_CLASS_ERROR         0x0000000000000002\r
+#define EFI_DATA_RECORD_CLASS_DATA          0x0000000000000004\r
+#define EFI_DATA_RECORD_CLASS_PROGRESS_CODE 0x0000000000000008\r
+\r
+//\r
+// Forward reference for pure ANSI compatability\r
+//\r
+typedef struct _EFI_DATA_HUB_PROTOCOL EFI_DATA_HUB_PROTOCOL;\r
+\r
+/**\r
+  Logs a data record to the system event log.\r
+\r
+  @param  This The EFI_DATA_HUB_PROTOCOL instance.\r
+  \r
+  @param  description\r
+  \r
+  @param  DataRecordGuid A GUID that indicates the format of the data passed into RawData.\r
+  \r
+  @param  ProducerName A GUID that indicates the identity of the caller to this API.\r
+  \r
+  @param  DataRecordClass This class indicates the generic type of the data record. \r
+  \r
+  @param  RawData The DataRecordGuid-defined data to be logged.\r
+  \r
+  @param  RawDataSize The size in bytes of RawData.\r
+\r
+  @retval EFI_SUCCESS  Data was logged.\r
+  \r
+  @retval EFI_OUT_OF_RESOURCES  Data was not logged due to lack of system resources.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_DATA_HUB_LOG_DATA) (\r
+  IN  EFI_DATA_HUB_PROTOCOL   *This,\r
+  IN  EFI_GUID                *DataRecordGuid,\r
+  IN  EFI_GUID                *ProducerName,\r
+  IN  UINT64                  DataRecordClass,\r
+  IN  VOID                    *RawData,\r
+  IN  UINT32                  RawDataSize\r
+  );\r
+\r
+/**\r
+  Allows the system data log to be searched.\r
+\r
+  @param  This The EFI_DATA_HUB_PROTOCOL instance. \r
+  \r
+  @param  MonotonicCount On input, it specifies the Record to return. \r
+  An input of zero means to return the first record.\r
+  \r
+  @param  FilterDriver If FilterDriver is not passed in a MonotonicCount of zero, \r
+  it means to return the first data record. If FilterDriver is passed in, \r
+  then a MonotonicCount of zero means to return the first data not yet read \r
+  by FilterDriver.\r
+  \r
+  @param  Record Returns a dynamically allocated memory buffer with a data \r
+  record that matches MonotonicCount.\r
+\r
+  @retval EFI_SUCCESS  Data was returned in Record.\r
+  \r
+  @retval EFI_INVALID_PARAMETER  FilterDriver was passed in but does not exist.\r
+  \r
+  @retval EFI_NOT_FOUND  MonotonicCount does not match any data record \r
+  in the system.  If a MonotonicCount of zero was passed in, then no \r
+  data records exist in the system.\r
+  \r
+  @retval EFI_OUT_OF_RESOURCES  Record was not returned due to lack \r
+  of system resources.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_DATA_HUB_GET_NEXT_RECORD) (\r
+  IN EFI_DATA_HUB_PROTOCOL    *This,\r
+  IN OUT  UINT64              *MonotonicCount,\r
+  IN  EFI_EVENT               *FilterDriver OPTIONAL,\r
+  OUT EFI_DATA_RECORD_HEADER  **Record\r
+  );\r
+\r
+/**\r
+  Registers an event to be signaled every time a data record is logged in the system.\r
+\r
+  @param  This The EFI_DATA_HUB_PROTOCOL instance. \r
+  \r
+  @param  FilterEvent The EFI_EVENT to signal whenever data that matches \r
+  FilterClass is logged in the system. \r
+  \r
+  @param  FilterTpl The maximum EFI_TPL at which FilterEvent can be signaled.\r
+  It is strongly recommended that you use the lowest EFI_TPL possible. \r
+  \r
+  @param  FilterClass FilterEvent will be signaled whenever a bit \r
+  in EFI_DATA_RECORD_HEADER.DataRecordClass is also set in FilterClass. \r
+  If FilterClass is zero, no class-based filtering will be performed. \r
+  \r
+  @param  FilterDataRecordGuid FilterEvent will be signaled whenever \r
+  FilterDataRecordGuid matches EFI_DATA_RECORD_HEADER.DataRecordGuid. \r
+  If FilterDataRecordGuid is NULL, then no GUID-based filtering will be performed. \r
+\r
+  @retval EFI_SUCCESS  The filter driver event was registered\r
+  \r
+  @retval EFI_ALREADY_STARTED  FilterEvent was previously registered and cannot be registered again.\r
+  \r
+  @retval EFI_OUT_OF_RESOURCES  The filter driver event was not registered\r
+  due to lack of system resources.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_DATA_HUB_REGISTER_FILTER_DRIVER) (\r
+  IN EFI_DATA_HUB_PROTOCOL    *This,\r
+  IN EFI_EVENT                FilterEvent,\r
+  IN EFI_TPL                  FilterTpl,\r
+  IN UINT64                   FilterClass,\r
+  IN EFI_GUID                 *FilterDataRecordGuid OPTIONAL\r
+  );\r
+\r
+/**\r
+  Stops a filter driver from being notified when data records are logged.\r
+\r
+  @param  This The EFI_DATA_HUB_PROTOCOL instance. \r
+  \r
+  @param  FilterEvent The EFI_EVENT to remove from the list of events to be \r
+  signaled every time errors are logged.\r
+\r
+  @retval EFI_SUCCESS  The filter driver represented by FilterEvent was shut off.\r
+  \r
+  @retval EFI_NOT_FOUND  FilterEvent did not exist.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_DATA_HUB_UNREGISTER_FILTER_DRIVER) (\r
+  IN EFI_DATA_HUB_PROTOCOL    *This,\r
+  IN EFI_EVENT                FilterEvent\r
+  );\r
+\r
+/**\r
+  @par Protocol Description:\r
+  This protocol is used to log information and register filter drivers \r
+  to receive data records.\r
+\r
+  @param LogData\r
+  Logs a data record. \r
+\r
+  @param GetNextDataRecord\r
+  Gets a data record. Used both to view the memory-based log and to \r
+  get information about which data records have been consumed by a filter driver.\r
+\r
+  @param RegisterFilterDriver\r
+  Allows the registration of an EFI event to act as a filter driver for all data records that are logged. \r
+\r
+  @param UnregisterFilterDriver\r
+  Used to remove a filter driver that was added with RegisterFilterDriver(). \r
+\r
+**/\r
+struct _EFI_DATA_HUB_PROTOCOL {\r
+  EFI_DATA_HUB_LOG_DATA                 LogData;\r
+  EFI_DATA_HUB_GET_NEXT_RECORD          GetNextRecord;\r
+  EFI_DATA_HUB_REGISTER_FILTER_DRIVER   RegisterFilterDriver;\r
+  EFI_DATA_HUB_UNREGISTER_FILTER_DRIVER UnregisterFilterDriver;\r
+};\r
+\r
+extern EFI_GUID gEfiDataHubProtocolGuid;\r
+\r
+#endif\r
diff --git a/Tools/Source/TianoTools/Include/Protocol/DebugPort.h b/Tools/Source/TianoTools/Include/Protocol/DebugPort.h
new file mode 100644 (file)
index 0000000..ceffaf6
--- /dev/null
@@ -0,0 +1,141 @@
+/** @file\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. This program and the accompanying materials                          \r
+  are licensed and made available under the terms and conditions of the BSD License         \r
+  which accompanies this distribution.  The full text of the license may be found at        \r
+  http://opensource.org/licenses/bsd-license.php                                            \r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+  Module Name:  DebugPort.h\r
+\r
+**/\r
+\r
+#ifndef __DEBUG_PORT_H__\r
+#define __DEBUG_PORT_H__\r
+\r
+\r
+//\r
+// DebugPortIo protocol {EBA4E8D2-3858-41EC-A281-2647BA9660D0}\r
+//\r
+#define EFI_DEBUGPORT_PROTOCOL_GUID \\r
+  { \\r
+    0xEBA4E8D2, 0x3858, 0x41EC, {0xA2, 0x81, 0x26, 0x47, 0xBA, 0x96, 0x60, 0xD0 } \\r
+  }\r
+\r
+extern EFI_GUID gEfiDebugPortProtocolGuid;\r
+\r
+typedef struct _EFI_DEBUGPORT_PROTOCOL EFI_DEBUGPORT_PROTOCOL;\r
+\r
+//\r
+// DebugPort member functions\r
+//\r
+\r
+/**                                                                 \r
+  Resets the debugport.\r
+    \r
+  @param  This                  A pointer to the EFI_DEBUGPORT_PROTOCOL instance.\r
+                                \r
+  @retval EFI_SUCCESS           The debugport device was reset and is in usable state.\r
+  @retval EFI_DEVICE_ERROR      The debugport device could not be reset and is unusable.\r
+                                   \r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_DEBUGPORT_RESET) (\r
+  IN EFI_DEBUGPORT_PROTOCOL               *This\r
+  );\r
+\r
+/**                                                                 \r
+  Writes data to the debugport.\r
+    \r
+  @param  This                  A pointer to the EFI_DEBUGPORT_PROTOCOL instance.\r
+  @param  Timeout               The number of microseconds to wait before timing out a write operation.\r
+  @param  BufferSize            On input, the requested number of bytes of data to write. On output, the\r
+                                number of bytes of data actually written.\r
+  @param  Buffer                A pointer to a buffer containing the data to write.                                \r
+                                  \r
+  @retval EFI_SUCCESS           The data was written.\r
+  @retval EFI_DEVICE_ERROR      The device reported an error.\r
+  @retval EFI_TIMEOUT           The data write was stopped due to a timeout.\r
+                                   \r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_DEBUGPORT_WRITE) (\r
+  IN EFI_DEBUGPORT_PROTOCOL               *This,\r
+  IN UINT32                               Timeout,\r
+  IN OUT UINTN                            *BufferSize,\r
+  IN VOID                                 *Buffer\r
+  );\r
+\r
+/**                                                                 \r
+  Reads data from the debugport.\r
+    \r
+  @param  This                  A pointer to the EFI_DEBUGPORT_PROTOCOL instance.\r
+  @param  Timeout               The number of microseconds to wait before timing out a read operation.\r
+  @param  BufferSize            On input, the requested number of bytes of data to read. On output, the\r
+                                number of bytes of data actually number of bytes\r
+                                of data read and returned in Buffer.\r
+  @param  Buffer                A pointer to a buffer into which the data read will be saved.\r
+                                  \r
+  @retval EFI_SUCCESS           The data was read.\r
+  @retval EFI_DEVICE_ERROR      The device reported an error.\r
+  @retval EFI_TIMEOUT           The operation was stopped due to a timeout or overrun.\r
+                                   \r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_DEBUGPORT_READ) (\r
+  IN EFI_DEBUGPORT_PROTOCOL               *This,\r
+  IN UINT32                               Timeout,\r
+  IN OUT UINTN                            *BufferSize,\r
+  OUT VOID                                *Buffer\r
+  );\r
+\r
+/**                                                                 \r
+  Checks to see if any data is available to be read from the debugport device.\r
+    \r
+  @param  This                  A pointer to the EFI_DEBUGPORT_PROTOCOL instance.\r
+                                  \r
+  @retval EFI_SUCCESS           At least one byte of data is available to be read.\r
+  @retval EFI_DEVICE_ERROR      The debugport device is not functioning correctly.\r
+  @retval EFI_NOT_READY         No data is available to be read.\r
+                                   \r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_DEBUGPORT_POLL) (\r
+  IN EFI_DEBUGPORT_PROTOCOL               *This\r
+  );\r
+\r
+//\r
+// DebugPort protocol definition\r
+//\r
+struct _EFI_DEBUGPORT_PROTOCOL {\r
+  EFI_DEBUGPORT_RESET Reset;\r
+  EFI_DEBUGPORT_WRITE Write;\r
+  EFI_DEBUGPORT_READ  Read;\r
+  EFI_DEBUGPORT_POLL  Poll;\r
+};\r
+\r
+//\r
+// DEBUGPORT variable definitions...\r
+//\r
+#define EFI_DEBUGPORT_VARIABLE_NAME L"DEBUGPORT"\r
+#define EFI_DEBUGPORT_VARIABLE_GUID EFI_DEBUGPORT_PROTOCOL_GUID\r
+#define gEfiDebugPortVariableGuid   gEfiDebugPortProtocolGuid\r
+\r
+//\r
+// DebugPort device path definitions...\r
+//\r
+#define DEVICE_PATH_MESSAGING_DEBUGPORT EFI_DEBUGPORT_PROTOCOL_GUID\r
+#define gEfiDebugPortDevicePathGuid     gEfiDebugPortProtocolGuid\r
+\r
+typedef struct {\r
+  EFI_DEVICE_PATH_PROTOCOL  Header;\r
+  EFI_GUID                  Guid;\r
+} DEBUGPORT_DEVICE_PATH;\r
+\r
+#endif\r
diff --git a/Tools/Source/TianoTools/Include/Protocol/DebugSupport.h b/Tools/Source/TianoTools/Include/Protocol/DebugSupport.h
new file mode 100644 (file)
index 0000000..1b782cf
--- /dev/null
@@ -0,0 +1,517 @@
+/** @file\r
+  DebugSupport protocol and supporting definitions as defined in the EFI 1.1\r
+  specification.\r
+\r
+  The DebugSupport protocol is used by source level debuggers to abstract the\r
+  processor and handle context save and restore operations.\r
+\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. This program and the accompanying materials                          \r
+  are licensed and made available under the terms and conditions of the BSD License         \r
+  which accompanies this distribution.  The full text of the license may be found at        \r
+  http://opensource.org/licenses/bsd-license.php                                            \r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+  Module Name:  DebugSupport.h\r
+\r
+**/\r
+\r
+#ifndef __DEBUG_SUPPORT_H__\r
+#define __DEBUG_SUPPORT_H__\r
+\r
+typedef struct _EFI_DEBUG_SUPPORT_PROTOCOL EFI_DEBUG_SUPPORT_PROTOCOL;\r
+\r
+//\r
+// Debug Support protocol {2755590C-6F3C-42FA-9EA4-A3BA543CDA25}\r
+//\r
+#define EFI_DEBUG_SUPPORT_PROTOCOL_GUID \\r
+  { \\r
+    0x2755590C, 0x6F3C, 0x42FA, {0x9E, 0xA4, 0xA3, 0xBA, 0x54, 0x3C, 0xDA, 0x25 } \\r
+  }\r
+\r
+//\r
+// Debug Support definitions\r
+//\r
+typedef INTN  EFI_EXCEPTION_TYPE;\r
+\r
+//\r
+//  IA-32 processor exception types\r
+//\r
+#define EXCEPT_IA32_DIVIDE_ERROR    0\r
+#define EXCEPT_IA32_DEBUG           1\r
+#define EXCEPT_IA32_NMI             2\r
+#define EXCEPT_IA32_BREAKPOINT      3\r
+#define EXCEPT_IA32_OVERFLOW        4\r
+#define EXCEPT_IA32_BOUND           5\r
+#define EXCEPT_IA32_INVALID_OPCODE  6\r
+#define EXCEPT_IA32_DOUBLE_FAULT    8\r
+#define EXCEPT_IA32_INVALID_TSS     10\r
+#define EXCEPT_IA32_SEG_NOT_PRESENT 11\r
+#define EXCEPT_IA32_STACK_FAULT     12\r
+#define EXCEPT_IA32_GP_FAULT        13\r
+#define EXCEPT_IA32_PAGE_FAULT      14\r
+#define EXCEPT_IA32_FP_ERROR        16\r
+#define EXCEPT_IA32_ALIGNMENT_CHECK 17\r
+#define EXCEPT_IA32_MACHINE_CHECK   18\r
+#define EXCEPT_IA32_SIMD            19\r
+\r
+//\r
+//  IA-32 processor context definition\r
+//\r
+//\r
+// FXSAVE_STATE\r
+// FP / MMX / XMM registers (see fxrstor instruction definition)\r
+//\r
+typedef struct {\r
+  UINT16  Fcw;\r
+  UINT16  Fsw;\r
+  UINT16  Ftw;\r
+  UINT16  Opcode;\r
+  UINT32  Eip;\r
+  UINT16  Cs;\r
+  UINT16  Reserved1;\r
+  UINT32  DataOffset;\r
+  UINT16  Ds;\r
+  UINT8   Reserved2[10];\r
+  UINT8   St0Mm0[10], Reserved3[6];\r
+  UINT8   St0Mm1[10], Reserved4[6];\r
+  UINT8   St0Mm2[10], Reserved5[6];\r
+  UINT8   St0Mm3[10], Reserved6[6];\r
+  UINT8   St0Mm4[10], Reserved7[6];\r
+  UINT8   St0Mm5[10], Reserved8[6];\r
+  UINT8   St0Mm6[10], Reserved9[6];\r
+  UINT8   St0Mm7[10], Reserved10[6];\r
+  UINT8   Reserved11[22 * 16];\r
+} EFI_FX_SAVE_STATE_IA32;\r
+\r
+typedef struct {\r
+  UINT32                 ExceptionData;\r
+  EFI_FX_SAVE_STATE_IA32 FxSaveState;\r
+  UINT32                 Dr0;\r
+  UINT32                 Dr1;\r
+  UINT32                 Dr2;\r
+  UINT32                 Dr3;\r
+  UINT32                 Dr6;\r
+  UINT32                 Dr7;\r
+  UINT32                 Cr0;\r
+  UINT32                 Cr1;  \r
+  UINT32                 Cr2;\r
+  UINT32                 Cr3;\r
+  UINT32                 Cr4;\r
+  UINT32                 Eflags;\r
+  UINT32                 Ldtr;\r
+  UINT32                 Tr;\r
+  UINT32                 Gdtr[2];\r
+  UINT32                 Idtr[2];\r
+  UINT32                 Eip;\r
+  UINT32                 Gs;\r
+  UINT32                 Fs;\r
+  UINT32                 Es;\r
+  UINT32                 Ds;\r
+  UINT32                 Cs;\r
+  UINT32                 Ss;\r
+  UINT32                 Edi;\r
+  UINT32                 Esi;\r
+  UINT32                 Ebp;\r
+  UINT32                 Esp;\r
+  UINT32                 Ebx;\r
+  UINT32                 Edx;\r
+  UINT32                 Ecx;\r
+  UINT32                 Eax;\r
+} EFI_SYSTEM_CONTEXT_IA32;\r
+\r
+//\r
+//  IPF processor exception types\r
+//\r
+#define EXCEPT_IPF_VHTP_TRANSLATION       0\r
+#define EXCEPT_IPF_INSTRUCTION_TLB        1\r
+#define EXCEPT_IPF_DATA_TLB               2\r
+#define EXCEPT_IPF_ALT_INSTRUCTION_TLB    3\r
+#define EXCEPT_IPF_ALT_DATA_TLB           4\r
+#define EXCEPT_IPF_DATA_NESTED_TLB        5\r
+#define EXCEPT_IPF_INSTRUCTION_KEY_MISSED 6\r
+#define EXCEPT_IPF_DATA_KEY_MISSED        7\r
+#define EXCEPT_IPF_DIRTY_BIT              8\r
+#define EXCEPT_IPF_INSTRUCTION_ACCESS_BIT 9\r
+#define EXCEPT_IPF_DATA_ACCESS_BIT        10\r
+#define EXCEPT_IPF_BREAKPOINT             11\r
+#define EXCEPT_IPF_EXTERNAL_INTERRUPT     12\r
+//\r
+// 13 - 19 reserved\r
+//\r
+#define EXCEPT_IPF_PAGE_NOT_PRESENT           20\r
+#define EXCEPT_IPF_KEY_PERMISSION             21\r
+#define EXCEPT_IPF_INSTRUCTION_ACCESS_RIGHTS  22\r
+#define EXCEPT_IPF_DATA_ACCESS_RIGHTS         23\r
+#define EXCEPT_IPF_GENERAL_EXCEPTION          24\r
+#define EXCEPT_IPF_DISABLED_FP_REGISTER       25\r
+#define EXCEPT_IPF_NAT_CONSUMPTION            26\r
+#define EXCEPT_IPF_SPECULATION                27\r
+//\r
+// 28 reserved\r
+//\r
+#define EXCEPT_IPF_DEBUG                          29\r
+#define EXCEPT_IPF_UNALIGNED_REFERENCE            30\r
+#define EXCEPT_IPF_UNSUPPORTED_DATA_REFERENCE     31\r
+#define EXCEPT_IPF_FP_FAULT                       32\r
+#define EXCEPT_IPF_FP_TRAP                        33\r
+#define EXCEPT_IPF_LOWER_PRIVILEGE_TRANSFER_TRAP  34\r
+#define EXCEPT_IPF_TAKEN_BRANCH                   35\r
+#define EXCEPT_IPF_SINGLE_STEP                    36\r
+//\r
+// 37 - 44 reserved\r
+//\r
+#define EXCEPT_IPF_IA32_EXCEPTION 45\r
+#define EXCEPT_IPF_IA32_INTERCEPT 46\r
+#define EXCEPT_IPF_IA32_INTERRUPT 47\r
+\r
+//\r
+//  IPF processor context definition\r
+//\r
+typedef struct {\r
+  //\r
+  // The first reserved field is necessary to preserve alignment for the correct\r
+  // bits in UNAT and to insure F2 is 16 byte aligned..\r
+  //\r
+  UINT64  Reserved;\r
+  UINT64  R1;\r
+  UINT64  R2;\r
+  UINT64  R3;\r
+  UINT64  R4;\r
+  UINT64  R5;\r
+  UINT64  R6;\r
+  UINT64  R7;\r
+  UINT64  R8;\r
+  UINT64  R9;\r
+  UINT64  R10;\r
+  UINT64  R11;\r
+  UINT64  R12;\r
+  UINT64  R13;\r
+  UINT64  R14;\r
+  UINT64  R15;\r
+  UINT64  R16;\r
+  UINT64  R17;\r
+  UINT64  R18;\r
+  UINT64  R19;\r
+  UINT64  R20;\r
+  UINT64  R21;\r
+  UINT64  R22;\r
+  UINT64  R23;\r
+  UINT64  R24;\r
+  UINT64  R25;\r
+  UINT64  R26;\r
+  UINT64  R27;\r
+  UINT64  R28;\r
+  UINT64  R29;\r
+  UINT64  R30;\r
+  UINT64  R31;\r
+\r
+  UINT64  F2[2];\r
+  UINT64  F3[2];\r
+  UINT64  F4[2];\r
+  UINT64  F5[2];\r
+  UINT64  F6[2];\r
+  UINT64  F7[2];\r
+  UINT64  F8[2];\r
+  UINT64  F9[2];\r
+  UINT64  F10[2];\r
+  UINT64  F11[2];\r
+  UINT64  F12[2];\r
+  UINT64  F13[2];\r
+  UINT64  F14[2];\r
+  UINT64  F15[2];\r
+  UINT64  F16[2];\r
+  UINT64  F17[2];\r
+  UINT64  F18[2];\r
+  UINT64  F19[2];\r
+  UINT64  F20[2];\r
+  UINT64  F21[2];\r
+  UINT64  F22[2];\r
+  UINT64  F23[2];\r
+  UINT64  F24[2];\r
+  UINT64  F25[2];\r
+  UINT64  F26[2];\r
+  UINT64  F27[2];\r
+  UINT64  F28[2];\r
+  UINT64  F29[2];\r
+  UINT64  F30[2];\r
+  UINT64  F31[2];\r
+\r
+  UINT64  Pr;\r
+\r
+  UINT64  B0;\r
+  UINT64  B1;\r
+  UINT64  B2;\r
+  UINT64  B3;\r
+  UINT64  B4;\r
+  UINT64  B5;\r
+  UINT64  B6;\r
+  UINT64  B7;\r
+\r
+  //\r
+  // application registers\r
+  //\r
+  UINT64  ArRsc;\r
+  UINT64  ArBsp;\r
+  UINT64  ArBspstore;\r
+  UINT64  ArRnat;\r
+\r
+  UINT64  ArFcr;\r
+\r
+  UINT64  ArEflag;\r
+  UINT64  ArCsd;\r
+  UINT64  ArSsd;\r
+  UINT64  ArCflg;\r
+  UINT64  ArFsr;\r
+  UINT64  ArFir;\r
+  UINT64  ArFdr;\r
+\r
+  UINT64  ArCcv;\r
+\r
+  UINT64  ArUnat;\r
+\r
+  UINT64  ArFpsr;\r
+\r
+  UINT64  ArPfs;\r
+  UINT64  ArLc;\r
+  UINT64  ArEc;\r
+\r
+  //\r
+  // control registers\r
+  //\r
+  UINT64  CrDcr;\r
+  UINT64  CrItm;\r
+  UINT64  CrIva;\r
+  UINT64  CrPta;\r
+  UINT64  CrIpsr;\r
+  UINT64  CrIsr;\r
+  UINT64  CrIip;\r
+  UINT64  CrIfa;\r
+  UINT64  CrItir;\r
+  UINT64  CrIipa;\r
+  UINT64  CrIfs;\r
+  UINT64  CrIim;\r
+  UINT64  CrIha;\r
+\r
+  //\r
+  // debug registers\r
+  //\r
+  UINT64  Dbr0;\r
+  UINT64  Dbr1;\r
+  UINT64  Dbr2;\r
+  UINT64  Dbr3;\r
+  UINT64  Dbr4;\r
+  UINT64  Dbr5;\r
+  UINT64  Dbr6;\r
+  UINT64  Dbr7;\r
+\r
+  UINT64  Ibr0;\r
+  UINT64  Ibr1;\r
+  UINT64  Ibr2;\r
+  UINT64  Ibr3;\r
+  UINT64  Ibr4;\r
+  UINT64  Ibr5;\r
+  UINT64  Ibr6;\r
+  UINT64  Ibr7;\r
+\r
+  //\r
+  // virtual registers - nat bits for R1-R31\r
+  //\r
+  UINT64  IntNat;\r
+\r
+} EFI_SYSTEM_CONTEXT_IPF;\r
+\r
+//\r
+//  EBC processor exception types\r
+//\r
+#define EXCEPT_EBC_UNDEFINED            0\r
+#define EXCEPT_EBC_DIVIDE_ERROR         1\r
+#define EXCEPT_EBC_DEBUG                2\r
+#define EXCEPT_EBC_BREAKPOINT           3\r
+#define EXCEPT_EBC_OVERFLOW             4\r
+#define EXCEPT_EBC_INVALID_OPCODE       5   // opcode out of range\r
+#define EXCEPT_EBC_STACK_FAULT          6\r
+#define EXCEPT_EBC_ALIGNMENT_CHECK      7\r
+#define EXCEPT_EBC_INSTRUCTION_ENCODING 8   // malformed instruction\r
+#define EXCEPT_EBC_BAD_BREAK            9   // BREAK 0 or undefined BREAK\r
+#define EXCEPT_EBC_STEP                 10  // to support debug stepping\r
+//\r
+// For coding convenience, define the maximum valid EBC exception.\r
+//\r
+#define MAX_EBC_EXCEPTION EXCEPT_EBC_STEP\r
+\r
+//\r
+//  EBC processor context definition\r
+//\r
+typedef struct {\r
+  UINT64  R0;\r
+  UINT64  R1;\r
+  UINT64  R2;\r
+  UINT64  R3;\r
+  UINT64  R4;\r
+  UINT64  R5;\r
+  UINT64  R6;\r
+  UINT64  R7;\r
+  UINT64  Flags;\r
+  UINT64  ControlFlags;\r
+  UINT64  Ip;\r
+} EFI_SYSTEM_CONTEXT_EBC;\r
+\r
+//\r
+// Universal EFI_SYSTEM_CONTEXT definition\r
+//\r
+typedef union {\r
+  EFI_SYSTEM_CONTEXT_EBC  *SystemContextEbc;\r
+  EFI_SYSTEM_CONTEXT_IA32 *SystemContextIa32;\r
+  EFI_SYSTEM_CONTEXT_IPF  *SystemContextIpf;\r
+} EFI_SYSTEM_CONTEXT;\r
+\r
+//\r
+// DebugSupport callback function prototypes\r
+//\r
+\r
+/**                                                                 \r
+  Registers and enables an exception callback function for the specified exception.\r
+    \r
+  @param  ExceptionType         Exception types in EBC, IA-32, X64, or IPF\r
+  @param  SystemContext         Exception content.\r
+                                   \r
+**/\r
+typedef\r
+VOID\r
+(*EFI_EXCEPTION_CALLBACK) (\r
+  IN     EFI_EXCEPTION_TYPE               ExceptionType,\r
+  IN OUT EFI_SYSTEM_CONTEXT               SystemContext\r
+  );\r
+\r
+/**                                                                 \r
+  Registers and enables the on-target debug agent¡¯s periodic entry point.\r
+      \r
+  @param  SystemContext         Exception content.\r
+                                   \r
+**/\r
+typedef\r
+VOID\r
+(*EFI_PERIODIC_CALLBACK) (\r
+  IN OUT EFI_SYSTEM_CONTEXT               SystemContext\r
+  );\r
+\r
+//\r
+// Machine type definition\r
+//\r
+typedef enum {\r
+  IsaIa32 = IMAGE_FILE_MACHINE_I386, // 0x014C\r
+  IsaX64  = IMAGE_FILE_MACHINE_X64,   // 0x8664\r
+  IsaIpf  = IMAGE_FILE_MACHINE_IA64,  // 0x0200\r
+  IsaEbc  = IMAGE_FILE_MACHINE_EBC    // 0x0EBC\r
+} EFI_INSTRUCTION_SET_ARCHITECTURE;\r
+\r
+\r
+//\r
+// DebugSupport member function definitions\r
+//\r
+\r
+/**                                                                 \r
+  Returns the maximum value that may be used for the ProcessorIndex parameter in\r
+  RegisterPeriodicCallback() and RegisterExceptionCallback().                   \r
+    \r
+  @param  This                  A pointer to the EFI_DEBUG_SUPPORT_PROTOCOL instance.\r
+  @param  MaxProcessorIndex     Pointer to a caller-allocated UINTN in which the maximum supported\r
+                                processor index is returned.                                      \r
+                                \r
+  @retval EFI_SUCCESS           The function completed successfully.  \r
+                                   \r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_GET_MAXIMUM_PROCESSOR_INDEX) (\r
+  IN EFI_DEBUG_SUPPORT_PROTOCOL          *This,\r
+  OUT UINTN                              *MaxProcessorIndex\r
+  );\r
+\r
+/**                                                                 \r
+  Registers a function to be called back periodically in interrupt context.\r
+    \r
+  @param  This                  A pointer to the EFI_DEBUG_SUPPORT_PROTOCOL instance.\r
+  @param  ProcessorIndex        Specifies which processor the callback function applies to.\r
+  @param  PeriodicCallback      A pointer to a function of type PERIODIC_CALLBACK that is the main\r
+                                periodic entry point of the debug agent.\r
+                                \r
+  @retval EFI_SUCCESS           The function completed successfully.  \r
+  @retval EFI_ALREADY_STARTED   Non-NULL PeriodicCallback parameter when a callback\r
+                                function was previously registered.                \r
+  @retval EFI_OUT_OF_RESOURCES  System has insufficient memory resources to register new callback                               \r
+                                function.                                                           \r
+                                \r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_REGISTER_PERIODIC_CALLBACK) (\r
+  IN EFI_DEBUG_SUPPORT_PROTOCOL          *This,\r
+  IN UINTN                               ProcessorIndex,\r
+  IN EFI_PERIODIC_CALLBACK               PeriodicCallback\r
+  );\r
+\r
+/**                                                                 \r
+  Registers a function to be called when a given processor exception occurs.\r
+    \r
+  @param  This                  A pointer to the EFI_DEBUG_SUPPORT_PROTOCOL instance.\r
+  @param  ProcessorIndex        Specifies which processor the callback function applies to.\r
+  @param  PeriodicCallback      A pointer to a function of type EXCEPTION_CALLBACK that is called\r
+                                when the processor exception specified by ExceptionType occurs.  \r
+  @param  ExceptionType         Specifies which processor exception to hook.                       \r
+                                \r
+  @retval EFI_SUCCESS           The function completed successfully.  \r
+  @retval EFI_ALREADY_STARTED   Non-NULL PeriodicCallback parameter when a callback\r
+                                function was previously registered.                \r
+  @retval EFI_OUT_OF_RESOURCES  System has insufficient memory resources to register new callback                               \r
+                                function.                                                           \r
+                                \r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_REGISTER_EXCEPTION_CALLBACK) (\r
+  IN EFI_DEBUG_SUPPORT_PROTOCOL          *This,\r
+  IN UINTN                               ProcessorIndex,\r
+  IN EFI_EXCEPTION_CALLBACK              ExceptionCallback,\r
+  IN EFI_EXCEPTION_TYPE                  ExceptionType\r
+  );\r
+\r
+/**                                                                 \r
+  Invalidates processor instruction cache for a memory range. Subsequent execution in this range\r
+  causes a fresh memory fetch to retrieve code to be executed.                                  \r
+    \r
+  @param  This                  A pointer to the EFI_DEBUG_SUPPORT_PROTOCOL instance.\r
+  @param  ProcessorIndex        Specifies which processor¡¯s instruction cache is to be invalidated.\r
+  @param  Start                 Specifies the physical base of the memory range to be invalidated.                                \r
+  @param  Length                Specifies the minimum number of bytes in the processor¡¯s instruction\r
+                                cache to invalidate.                                                 \r
+                                \r
+  @retval EFI_SUCCESS           The function completed successfully.  \r
+                                \r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_INVALIDATE_INSTRUCTION_CACHE) (\r
+  IN EFI_DEBUG_SUPPORT_PROTOCOL          *This,\r
+  IN UINTN                               ProcessorIndex,\r
+  IN VOID                                *Start,\r
+  IN UINT64                              Length\r
+  );\r
+\r
+//\r
+// DebugSupport protocol definition\r
+//\r
+struct _EFI_DEBUG_SUPPORT_PROTOCOL {\r
+  EFI_INSTRUCTION_SET_ARCHITECTURE  Isa;\r
+  EFI_GET_MAXIMUM_PROCESSOR_INDEX   GetMaximumProcessorIndex;\r
+  EFI_REGISTER_PERIODIC_CALLBACK    RegisterPeriodicCallback;\r
+  EFI_REGISTER_EXCEPTION_CALLBACK   RegisterExceptionCallback;\r
+  EFI_INVALIDATE_INSTRUCTION_CACHE  InvalidateInstructionCache;\r
+};\r
+\r
+extern EFI_GUID gEfiDebugSupportProtocolGuid;\r
+\r
+#endif \r
diff --git a/Tools/Source/TianoTools/Include/Protocol/Decompress.h b/Tools/Source/TianoTools/Include/Protocol/Decompress.h
new file mode 100644 (file)
index 0000000..7c295f3
--- /dev/null
@@ -0,0 +1,121 @@
+/** @file\r
+  The Decompress Protocol Interface\r
+\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. This program and the accompanying materials                          \r
+  are licensed and made available under the terms and conditions of the BSD License         \r
+  which accompanies this distribution.  The full text of the license may be found at        \r
+  http://opensource.org/licenses/bsd-license.php                                            \r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+  Module Name:  Decompress.h\r
+\r
+**/\r
+\r
+#ifndef __DECOMPRESS_H__\r
+#define __DECOMPRESS_H__\r
+\r
+#define EFI_DECOMPRESS_PROTOCOL_GUID \\r
+  { \\r
+    0xd8117cfe, 0x94a6, 0x11d4, {0x9a, 0x3a, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d } \\r
+  }\r
+\r
+typedef struct _EFI_DECOMPRESS_PROTOCOL  EFI_DECOMPRESS_PROTOCOL;\r
+\r
+/**\r
+  The GetInfo() function retrieves the size of the uncompressed buffer \r
+  and the temporary scratch buffer required to decompress the buffer \r
+  specified by Source and SourceSize.  If the size of the uncompressed\r
+  buffer or the size of the scratch buffer cannot be determined from \r
+  the compressed data specified by Source and SourceData, then \r
+  EFI_INVALID_PARAMETER is returned.  Otherwise, the size of the uncompressed\r
+  buffer is returned in DestinationSize, the size of the scratch buffer is \r
+  returned in ScratchSize, and EFI_SUCCESS is returned.\r
+\r
+  The GetInfo() function does not have scratch buffer available to perform \r
+  a thorough checking of the validity of the source data. It just retrieves\r
+  the 'Original Size' field from the beginning bytes of the source data and\r
+  output it as DestinationSize.  And ScratchSize is specific to the decompression\r
+  implementation.\r
+\r
+  @param  This            The protocol instance pointer\r
+  @param  Source          The source buffer containing the compressed data.\r
+  @param  SourceSize      The size, in bytes, of source buffer.\r
+  @param  DestinationSize A pointer to the size, in bytes, of the uncompressed buffer\r
+                          that will be generated when the compressed buffer specified\r
+                          by Source and SourceSize is decompressed.\r
+  @param  ScratchSize     A pointer to the size, in bytes, of the scratch buffer that\r
+                          is required to decompress the compressed buffer specified by\r
+                          Source and SourceSize.\r
+\r
+  @retval  EFI_SUCCESS           The size of the uncompressed data was returned in DestinationSize\r
+                                 and the size of the scratch buffer was returned in ScratchSize.\r
+  @retval  EFI_INVALID_PARAMETER The size of the uncompressed data or the size of the scratch\r
+                                 buffer cannot be determined from the compressed data specified by\r
+                                 Source and SourceData.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_DECOMPRESS_GET_INFO) (\r
+  IN EFI_DECOMPRESS_PROTOCOL            *This,\r
+  IN   VOID                             *Source,\r
+  IN   UINT32                           SourceSize,\r
+  OUT  UINT32                           *DestinationSize,\r
+  OUT  UINT32                           *ScratchSize\r
+  );\r
+\r
+/**\r
+  The Decompress() function extracts decompressed data to its original form.\r
+\r
+  This protocol is designed so that the decompression algorithm can be \r
+  implemented without using any memory services.  As a result, the \r
+  Decompress() function is not allowed to call AllocatePool() or \r
+  AllocatePages() in its implementation.  It is the caller's responsibility \r
+  to allocate and free the Destination and Scratch buffers.\r
+\r
+  If the compressed source data specified by Source and SourceSize is \r
+  sucessfully decompressed into Destination, then EFI_SUCCESS is returned.  \r
+  If the compressed source data specified by Source and SourceSize is not in \r
+  a valid compressed data format, then EFI_INVALID_PARAMETER is returned.\r
+\r
+  @param  This            The protocol instance pointer\r
+  @param  Source          The source buffer containing the compressed data.\r
+  @param  SourceSize      The size of source data.\r
+  @param  Destination     On output, the destination buffer that contains\r
+                          the uncompressed data.\r
+  @param  DestinationSize The size of destination buffer. The size of destination\r
+                          buffer needed is obtained from GetInfo().\r
+  @param  Scratch         A temporary scratch buffer that is used to perform the\r
+                          decompression.          \r
+  @param  ScratchSize     The size of scratch buffer. The size of scratch buffer needed\r
+                          is obtained from GetInfo().\r
+\r
+  @retval  EFI_SUCCESS          Decompression completed successfully, and the uncompressed\r
+                                buffer is returned in Destination.\r
+  @retval EFI_INVALID_PARAMETER The source buffer specified by Source and SourceSize is\r
+                                corrupted (not in a valid compressed format).\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_DECOMPRESS_DECOMPRESS) (\r
+  IN EFI_DECOMPRESS_PROTOCOL              *This,\r
+  IN     VOID                             *Source,\r
+  IN     UINT32                           SourceSize,\r
+  IN OUT VOID                             *Destination,\r
+  IN     UINT32                           DestinationSize,\r
+  IN OUT VOID                             *Scratch,\r
+  IN     UINT32                           ScratchSize\r
+  );\r
+\r
+struct _EFI_DECOMPRESS_PROTOCOL {\r
+  EFI_DECOMPRESS_GET_INFO   GetInfo;\r
+  EFI_DECOMPRESS_DECOMPRESS Decompress;\r
+};\r
+\r
+extern EFI_GUID gEfiDecompressProtocolGuid;\r
+\r
+#endif\r
diff --git a/Tools/Source/TianoTools/Include/Protocol/DevicePath.h b/Tools/Source/TianoTools/Include/Protocol/DevicePath.h
new file mode 100644 (file)
index 0000000..d019999
--- /dev/null
@@ -0,0 +1,94 @@
+/** @file\r
+  The device path protocol as defined in EFI 1.0.\r
+\r
+  The device path represents a programatic path to a device. It's the view\r
+  from a software point of view. It also must persist from boot to boot, so \r
+  it can not contain things like PCI bus numbers that change from boot to boot.\r
+\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. This program and the accompanying materials                          \r
+  are licensed and made available under the terms and conditions of the BSD License         \r
+  which accompanies this distribution.  The full text of the license may be found at        \r
+  http://opensource.org/licenses/bsd-license.php                                            \r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+  Module Name:  DevicePath.h\r
+\r
+**/\r
+\r
+#ifndef __EFI_DEVICE_PATH_PROTOCOL_H__\r
+#define __EFI_DEVICE_PATH_PROTOCOL_H__\r
+\r
+//\r
+// Device Path protocol\r
+//\r
+#define EFI_DEVICE_PATH_PROTOCOL_GUID \\r
+  { \\r
+    0x9576e91, 0x6d3f, 0x11d2, {0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b } \\r
+  }\r
+\r
+#pragma pack(1)\r
+\r
+typedef struct {\r
+  UINT8 Type;\r
+  UINT8 SubType;\r
+  UINT8 Length[2];\r
+} EFI_DEVICE_PATH_PROTOCOL;\r
+\r
+#pragma pack()\r
+                                             \r
+#define EFI_DP_TYPE_MASK                     0x7F\r
+#define EFI_DP_TYPE_UNPACKED                 0x80\r
+#define END_DEVICE_PATH_TYPE                 0x7f\r
+                                             \r
+#define EFI_END_ENTIRE_DEVICE_PATH           0xff\r
+#define EFI_END_ENTIRE_DEVICE_PATH_SUBTYPE   0xff\r
+#define EFI_END_INSTANCE_DEVICE_PATH         0x01\r
+#define END_ENTIRE_DEVICE_PATH_SUBTYPE       EFI_END_ENTIRE_DEVICE_PATH_SUBTYPE\r
+#define END_INSTANCE_DEVICE_PATH_SUBTYPE     EFI_END_INSTANCE_DEVICE_PATH\r
+                                             \r
+#define EFI_END_DEVICE_PATH_LENGTH           (sizeof (EFI_DEVICE_PATH_PROTOCOL))\r
+#define END_DEVICE_PATH_LENGTH               EFI_END_DEVICE_PATH_LENGTH\r
+                                             \r
+#define DP_IS_END_TYPE(a)                    \r
+#define DP_IS_END_SUBTYPE(a)                 (((a)->SubType == END_ENTIRE_DEVICE_PATH_SUBTYPE)\r
+#define DevicePathSubType(a)                 ((a)->SubType)\r
+#define IsDevicePathUnpacked(a)              ((a)->Type & EFI_DP_TYPE_UNPACKED)\r
+                                             \r
+#define EfiDevicePathNodeLength(a)           (((a)->Length[0]) | ((a)->Length[1] << 8))\r
+#define DevicePathNodeLength(a)              (EfiDevicePathNodeLength(a))\r
+#define EfiNextDevicePathNode(a)             ((EFI_DEVICE_PATH_PROTOCOL *) (((UINT8 *) (a)) + EfiDevicePathNodeLength (a)))\r
+#define NextDevicePathNode(a)                (EfiNextDevicePathNode(a)) \r
+                                             \r
+#define EfiDevicePathType(a)                 (((a)->Type) & EFI_DP_TYPE_MASK)\r
+#define DevicePathType(a)                    (EfiDevicePathType(a))\r
+#define EfiIsDevicePathEndType(a)            (EfiDevicePathType (a) == END_DEVICE_PATH_TYPE)\r
+#define IsDevicePathEndType(a)               (EfiIsDevicePathEndType(a)) \r
+                                             \r
+                                             \r
+#define EfiIsDevicePathEndSubType(a)         ((a)->SubType == EFI_END_ENTIRE_DEVICE_PATH_SUBTYPE)\r
+#define IsDevicePathEndSubType(a)            (EfiIsDevicePathEndSubType(a))\r
+#define EfiIsDevicePathEndInstanceSubType(a) ((a)->SubType == EFI_END_INSTANCE_DEVICE_PATH)\r
+                                             \r
+#define EfiIsDevicePathEnd(a)                (EfiIsDevicePathEndType (a) && EfiIsDevicePathEndSubType (a))\r
+#define IsDevicePathEnd(a)                   (EfiIsDevicePathEnd(a))\r
+#define EfiIsDevicePathEndInstance(a)        (EfiIsDevicePathEndType (a) && EfiIsDevicePathEndInstanceSubType (a))\r
+\r
+\r
+#define SetDevicePathNodeLength(a,l) {                           \\r
+          (a)->Length[0] = (UINT8) (l);                          \\r
+          (a)->Length[1] = (UINT8) ((l) >> 8);                   \\r
+          }\r
+\r
+#define SetDevicePathEndNode(a)  {                               \\r
+          (a)->Type = END_DEVICE_PATH_TYPE;                      \\r
+          (a)->SubType = END_ENTIRE_DEVICE_PATH_SUBTYPE;         \\r
+          (a)->Length[0] = sizeof(EFI_DEVICE_PATH_PROTOCOL);     \\r
+          (a)->Length[1] = 0;                                    \\r
+          }\r
+\r
+extern EFI_GUID gEfiDevicePathProtocolGuid;\r
+\r
+#endif\r
diff --git a/Tools/Source/TianoTools/Include/Protocol/DevicePathFromText.h b/Tools/Source/TianoTools/Include/Protocol/DevicePathFromText.h
new file mode 100644 (file)
index 0000000..a3a6c43
--- /dev/null
@@ -0,0 +1,73 @@
+/** @file\r
+  EFI_DEVICE_PATH_FROM_TEXT_PROTOCOL as defined in UEFI 2.0.  \r
+  This protocol provides service to convert text to device paths and device nodes.\r
+\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. This program and the accompanying materials                          \r
+  are licensed and made available under the terms and conditions of the BSD License         \r
+  which accompanies this distribution.  The full text of the license may be found at        \r
+  http://opensource.org/licenses/bsd-license.php                                            \r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+  Module Name:  DevicePathFromText.h\r
+\r
+**/\r
+\r
+#ifndef __DEVICE_PATH_FROM_TEXT_PROTOCOL_H__\r
+#define __DEVICE_PATH_FROM_TEXT_PROTOCOL_H__\r
+\r
+//\r
+// Device Path From Text protocol\r
+//\r
+#define EFI_DEVICE_PATH_FROM_TEXT_PROTOCOL_GUID \\r
+  { \\r
+    0x5c99a21, 0xc70f, 0x4ad2, {0x8a, 0x5f, 0x35, 0xdf, 0x33, 0x43, 0xf5, 0x1e  } \\r
+  }\r
+\r
+/**\r
+  Convert text to the binary representation of a device node.\r
+\r
+  @param  TextDeviceNode TextDeviceNode points to the text representation of a device\r
+                         node. Conversion starts with the first character and continues\r
+                         until the first non-device node character.\r
+\r
+  @retval a_pointer      Pointer to the EFI device node.\r
+  @retval NULL           if TextDeviceNode is NULL or there was insufficient memory.\r
+\r
+**/\r
+typedef\r
+EFI_DEVICE_PATH_PROTOCOL*\r
+(EFIAPI *EFI_DEVICE_PATH_FROM_TEXT_NODE) (\r
+  IN CONST CHAR16                 *TextDeviceNode\r
+  )\r
+;    \r
+  \r
+\r
+/**\r
+  Convert text to the binary representation of a device node.\r
+\r
+  @param  TextDeviceNode TextDevicePath points to the text representation of a device\r
+                         path. Conversion starts with the first character and continues\r
+                         until the first non-device path character.\r
+\r
+  @retval a_pointer      Pointer to the allocated device path.\r
+  @retval NULL           if TextDeviceNode is NULL or there was insufficient memory.\r
+\r
+**/\r
+typedef\r
+EFI_DEVICE_PATH_PROTOCOL*\r
+(EFIAPI *EFI_DEVICE_PATH_FROM_TEXT_PATH) (\r
+  IN CONST CHAR16                 *TextDevicePath\r
+  )\r
+;  \r
+  \r
+typedef struct {\r
+  EFI_DEVICE_PATH_FROM_TEXT_NODE  ConvertDeviceNodeFromText;\r
+  EFI_DEVICE_PATH_FROM_TEXT_PATH  ConvertDevicePathFromText;\r
+} EFI_DEVICE_PATH_FROM_TEXT_PROTOCOL;\r
+\r
+extern EFI_GUID gEfiDevicePathFromTextProtocolGuid;\r
+\r
+#endif\r
diff --git a/Tools/Source/TianoTools/Include/Protocol/DevicePathToText.h b/Tools/Source/TianoTools/Include/Protocol/DevicePathToText.h
new file mode 100644 (file)
index 0000000..d888562
--- /dev/null
@@ -0,0 +1,86 @@
+/** @file\r
+  EFI_DEVICE_PATH_TO_TEXT_PROTOCOL as defined in UEFI 2.0.  \r
+  This protocol provides service to convert device nodes and paths to text.\r
+\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. This program and the accompanying materials                          \r
+  are licensed and made available under the terms and conditions of the BSD License         \r
+  which accompanies this distribution.  The full text of the license may be found at        \r
+  http://opensource.org/licenses/bsd-license.php                                            \r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+  Module Name:  DevicePathToText.h\r
+\r
+**/\r
+\r
+#ifndef __DEVICE_PATH_TO_TEXT_PROTOCOL_H__\r
+#define __DEVICE_PATH_TO_TEXT_PROTOCOL_H__\r
+\r
+//\r
+// Device Path To Text protocol\r
+//\r
+#define EFI_DEVICE_PATH_TO_TEXT_PROTOCOL_GUID \\r
+  { \\r
+    0x8b843e20, 0x8132, 0x4852, {0x90, 0xcc, 0x55, 0x1a, 0x4e, 0x4a, 0x7f, 0x1c } \\r
+  }\r
+\r
+/**\r
+  Convert a device node to its text representation.\r
+\r
+  @param  DeviceNode     Points to the device node to be converted.\r
+  @param  DisplayOnly    If DisplayOnly is TRUE, then the shorter text representation\r
+                         of the display node is used, where applicable. If DisplayOnly\r
+                         is FALSE, then the longer text representation of the display node\r
+                         is used.\r
+  @param  AllowShortcuts If AllowShortcuts is TRUE, then the shortcut forms of text\r
+                         representation for a device node can be used, where applicable.\r
+\r
+  @retval a_pointer      a pointer to the allocated text representation of the device node data\r
+  @retval NULL           if DeviceNode is NULL or there was insufficient memory.\r
+\r
+**/\r
+typedef\r
+CHAR16*\r
+(EFIAPI *EFI_DEVICE_PATH_TO_TEXT_NODE) (\r
+  IN CONST EFI_DEVICE_PATH_PROTOCOL   *DeviceNode,\r
+  IN BOOLEAN                          DisplayOnly,\r
+  IN BOOLEAN                          AllowShortcuts\r
+  )\r
+;      \r
+\r
+/**\r
+  Convert a device path to its text representation.\r
+\r
+  @param  DevicePath     Points to the device path to be converted.\r
+  @param  DisplayOnly    If DisplayOnly is TRUE, then the shorter text representation\r
+                         of the display node is used, where applicable. If DisplayOnly\r
+                         is FALSE, then the longer text representation of the display node\r
+                         is used.  \r
+  @param  AllowShortcuts The AllowShortcuts is FALSE, then the shortcut forms of\r
+                         text representation for a device node cannot be used.\r
+\r
+  @retval a_pointer      a pointer to the allocated text representation of the device node.\r
+  @retval NULL           if DevicePath is NULL or there was insufficient memory.\r
+\r
+**/\r
+typedef\r
+CHAR16*\r
+(EFIAPI *EFI_DEVICE_PATH_TO_TEXT_PATH) (\r
+  IN CONST EFI_DEVICE_PATH_PROTOCOL   *DevicePath,\r
+  IN BOOLEAN                          DisplayOnly,\r
+  IN BOOLEAN                          AllowShortcuts\r
+  )\r
+;    \r
+\r
+typedef struct {\r
+  EFI_DEVICE_PATH_TO_TEXT_NODE        ConvertDeviceNodeToText;\r
+  EFI_DEVICE_PATH_TO_TEXT_PATH        ConvertDevicePathToText;\r
+} EFI_DEVICE_PATH_TO_TEXT_PROTOCOL;\r
+\r
+extern EFI_GUID gEfiDevicePathToTextProtocolGuid;\r
+\r
+#endif\r
+\r
+\r
diff --git a/Tools/Source/TianoTools/Include/Protocol/DevicePathUtilities.h b/Tools/Source/TianoTools/Include/Protocol/DevicePathUtilities.h
new file mode 100644 (file)
index 0000000..e72f57c
--- /dev/null
@@ -0,0 +1,194 @@
+/** @file\r
+  EFI_DEVICE_PATH_UTILITIES_PROTOCOL as defined in UEFI 2.0.  \r
+  Use to create and manipulate device paths and device nodes.\r
+\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. This program and the accompanying materials                          \r
+  are licensed and made available under the terms and conditions of the BSD License         \r
+  which accompanies this distribution.  The full text of the license may be found at        \r
+  http://opensource.org/licenses/bsd-license.php                                            \r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+  Module Name:  DevicePathUtilities.h\r
+\r
+**/\r
+\r
+#ifndef __DEVICE_PATH_UTILITIES_PROTOCOL_H__\r
+#define __DEVICE_PATH_UTILITIES_PROTOCOL_H__\r
+\r
+//\r
+// Device Path Utilities protocol\r
+//\r
+#define EFI_DEVICE_PATH_UTILITIES_PROTOCOL_GUID \\r
+  { \\r
+    0x379be4e, 0xd706, 0x437d, {0xb0, 0x37, 0xed, 0xb8, 0x2f, 0xb7, 0x72, 0xa4 } \\r
+  }\r
+\r
+/**\r
+  Returns the size of the device path, in bytes.\r
+\r
+  @param  DevicePath Points to the start of the EFI device path.\r
+\r
+  @revtal Size       Size of the specified device path, in bytes, including the end-of-path tag.\r
+\r
+**/\r
+typedef\r
+UINTN\r
+(EFIAPI *EFI_DEVICE_PATH_UTILS_GET_DEVICE_PATH_SIZE) (\r
+  IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath\r
+  )\r
+;    \r
+  \r
+\r
+/**\r
+  Create a duplicate of the specified path.\r
+\r
+  @param  DevicePath Points to the source EFI device path.\r
+\r
+  @retval Pointer    A pointer to the duplicate device path.\r
+  @retval NULL       insufficient memory\r
+\r
+**/\r
+typedef\r
+EFI_DEVICE_PATH_PROTOCOL*\r
+(EFIAPI *EFI_DEVICE_PATH_UTILS_DUP_DEVICE_PATH) (\r
+  IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath\r
+  )\r
+;      \r
+\r
+/**\r
+  Create a new path by appending the second device path to the first.\r
+\r
+  @param  Src1 Points to the first device path. If NULL, then it is ignored.\r
+  @param  Src2 Points to the second device path. If NULL, then it is ignored.\r
+\r
+  @retval Pointer  A pointer to the newly created device path.\r
+  @retval NULL     Memory could not be allocated\r
+                   or either DevicePath or DeviceNode is NULL.\r
+\r
+**/\r
+typedef\r
+EFI_DEVICE_PATH_PROTOCOL*\r
+(EFIAPI *EFI_DEVICE_PATH_UTILS_APPEND_PATH) (\r
+  IN CONST EFI_DEVICE_PATH_PROTOCOL *Src1,\r
+  IN CONST EFI_DEVICE_PATH_PROTOCOL *Src2\r
+  )\r
+;     \r
+  \r
+/**\r
+  Creates a new path by appending the device node to the device path.\r
+\r
+  @param  DevicePath Points to the device path.\r
+  @param  DeviceNode Points to the device node.\r
+\r
+  @retval Pointer    A pointer to the allocated device node.\r
+  @retval NULL       Memory could not be allocated\r
+                     or either DevicePath or DeviceNode is NULL.\r
+\r
+**/\r
+typedef\r
+EFI_DEVICE_PATH_PROTOCOL*\r
+(EFIAPI *EFI_DEVICE_PATH_UTILS_APPEND_NODE) (\r
+  IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath,\r
+  IN CONST EFI_DEVICE_PATH_PROTOCOL *DeviceNode\r
+  )\r
+;\r
+\r
+/**\r
+  Creates a new path by appending the specified device path instance to the specified device path.\r
+\r
+  @param  DevicePath         Points to the device path. If NULL, then ignored.\r
+  @param  DevicePathInstance Points to the device path instance.\r
+\r
+  @retval Pointer            A pointer to the newly created device path\r
+  @retval NULL               Memory could not be allocated or DevicePathInstance is NULL.\r
+\r
+**/\r
+typedef\r
+EFI_DEVICE_PATH_PROTOCOL*\r
+(EFIAPI *EFI_DEVICE_PATH_UTILS_APPEND_INSTANCE) (\r
+  IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath,\r
+  IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePathInstance\r
+  )\r
+;  \r
+\r
+/**\r
+  Creates a copy of the current device path instance and returns a pointer to the next device path\r
+  instance.\r
+\r
+  @param  DevicePathInstance     On input, this holds the pointer to the current device path\r
+                                 instance. On output, this holds the pointer to the next\r
+                                 device path instance or NULL if there are no more device\r
+                                 path instances in the device path.  \r
+  @param  DevicePathInstanceSize On output, this holds the size of the device path instance,\r
+                                 in bytes or zero, if DevicePathInstance is zero.\r
+\r
+  @retval Pointer                A pointer to the copy of the current device path instance.\r
+  @retval NULL                   DevicePathInstace was NULL on entry or there was insufficient memory.\r
+\r
+**/\r
+typedef\r
+EFI_DEVICE_PATH_PROTOCOL*\r
+(EFIAPI *EFI_DEVICE_PATH_UTILS_GET_NEXT_INSTANCE) (\r
+  IN  OUT EFI_DEVICE_PATH_PROTOCOL  **DevicePathInstance,\r
+  OUT UINTN                         *DevicePathInstanceSize\r
+  )\r
+;  \r
+\r
+/**\r
+  Creates a device node\r
+\r
+  @param  NodeType    NodeType is the device node type (EFI_DEVICE_PATH.Type) for\r
+                      the new device node.\r
+  @param  NodeSubType NodeSubType is the device node sub-type\r
+                      EFI_DEVICE_PATH.SubType) for the new device node.\r
+  @param  NodeLength  NodeLength is the length of the device node\r
+                      (EFI_DEVICE_PATH.Length) for the new device node.\r
+\r
+  @retval Pointer     A pointer to the newly created device node.\r
+  @retval NULL        NodeLength is less than\r
+                      the size of the header or there was insufficient memory.\r
+\r
+**/\r
+typedef\r
+EFI_DEVICE_PATH_PROTOCOL*\r
+(EFIAPI *EFI_DEVICE_PATH_CREATE_NODE) (\r
+  IN UINT8                          NodeType,\r
+  IN UINT8                          NodeSubType,\r
+  IN UINT16                         NodeLength\r
+)\r
+;   \r
+\r
+/**\r
+  Returns whether a device path is multi-instance.\r
+\r
+  @param  DevicePath Points to the device path. If NULL, then ignored.\r
+\r
+  @retval TRUE       The device path has more than one instance\r
+  @retval FALSE      The device path is empty or contains only a single instance.\r
+\r
+**/\r
+typedef\r
+BOOLEAN\r
+(EFIAPI *EFI_DEVICE_PATH_UTILS_IS_MULTI_INSTANCE) (\r
+  IN CONST EFI_DEVICE_PATH_PROTOCOL         *DevicePath\r
+  )\r
+;                                                                                                       \r
+  \r
+\r
+typedef struct {\r
+  EFI_DEVICE_PATH_UTILS_GET_DEVICE_PATH_SIZE GetDevicePathSize;\r
+  EFI_DEVICE_PATH_UTILS_DUP_DEVICE_PATH      DuplicateDevicePath;\r
+  EFI_DEVICE_PATH_UTILS_APPEND_PATH          AppendDevicePath;\r
+  EFI_DEVICE_PATH_UTILS_APPEND_NODE          AppendDeviceNode;\r
+  EFI_DEVICE_PATH_UTILS_APPEND_INSTANCE      AppendDevicePathInstance;\r
+  EFI_DEVICE_PATH_UTILS_GET_NEXT_INSTANCE    GetNextDevicePathInstance;\r
+  EFI_DEVICE_PATH_UTILS_IS_MULTI_INSTANCE    IsDevicePathMultiInstance;\r
+  EFI_DEVICE_PATH_CREATE_NODE                CreateDeviceNode;\r
+} EFI_DEVICE_PATH_UTILITIES_PROTOCOL;\r
+\r
+extern EFI_GUID gEfiDevicePathUtilitiesProtocolGuid; \r
+\r
+#endif\r
diff --git a/Tools/Source/TianoTools/Include/Protocol/Dhcp4.h b/Tools/Source/TianoTools/Include/Protocol/Dhcp4.h
new file mode 100644 (file)
index 0000000..3adce1a
--- /dev/null
@@ -0,0 +1,442 @@
+/** @file\r
+  EFI_DHCP4_PROTOCOL as defined in UEFI 2.0.\r
+  EFI_DHCP4_SERVICE_BINDING_PROTOCOL as defined in UEFI 2.0.\r
+  These protocols are used to collect configuration information for the EFI IPv4 Protocol \r
+  drivers and to provide DHCPv4 server and PXE boot server discovery services.\r
+\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. This program and the accompanying materials                          \r
+  are licensed and made available under the terms and conditions of the BSD License         \r
+  which accompanies this distribution.  The full text of the license may be found at        \r
+  http://opensource.org/licenses/bsd-license.php                                            \r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+  Module Name:  DHCP4.h\r
+\r
+**/\r
+\r
+#ifndef __EFI_DHCP4_PROTOCOL_H__\r
+#define __EFI_DHCP4_PROTOCOL_H__\r
+\r
+#define EFI_DHCP4_PROTOCOL_GUID \\r
+  { \\r
+    0x8a219718, 0x4ef5, 0x4761, {0x91, 0xc8, 0xc0, 0xf0, 0x4b, 0xda, 0x9e, 0x56 } \\r
+  }\r
+\r
+#define EFI_DHCP4_SERVICE_BINDING_PROTOCOL_GUID \\r
+  { \\r
+    0x9d9a39d8, 0xbd42, 0x4a73, {0xa4, 0xd5, 0x8e, 0xe9, 0x4b, 0xe1, 0x13, 0x80 } \\r
+  }\r
+  \r
+typedef struct _EFI_DHCP4_PROTOCOL EFI_DHCP4_PROTOCOL;\r
+\r
+\r
+#pragma pack(1)\r
+typedef struct {\r
+  UINT8               OpCode;\r
+  UINT8               Length;\r
+  UINT8               Data[1];\r
+} EFI_DHCP4_PACKET_OPTION;\r
+#pragma pack()\r
+\r
+\r
+#pragma pack(1)\r
+typedef struct {\r
+    UINT8             OpCode;\r
+    UINT8             HwType;\r
+    UINT8             HwAddrLen;\r
+    UINT8             Hops;\r
+    UINT32            Xid;\r
+    UINT16            Seconds;\r
+    UINT16            Reserved;\r
+    EFI_IPv4_ADDRESS  ClientAddr;       //Client IP address from client\r
+    EFI_IPv4_ADDRESS  YourAddr;         //Client IP address from server\r
+    EFI_IPv4_ADDRESS  ServerAddr;       //IP address of next server in bootstrap \r
+    EFI_IPv4_ADDRESS  GatewayAddr;      //Relay agent IP address\r
+    UINT8             ClientHwAddr[16]; //Client hardware address\r
+    CHAR8             ServerName[64];   \r
+    CHAR8             BootFileName[128];\r
+}EFI_DHCP4_HEADER;\r
+#pragma pack()\r
+\r
+\r
+#pragma pack(1)\r
+typedef struct {\r
+  UINT32              Size;\r
+  UINT32              Length;\r
+\r
+  struct {\r
+    EFI_DHCP4_HEADER  Header;\r
+    UINT32            Magik;\r
+    UINT8             Option[1];\r
+  } Dhcp4;\r
+} EFI_DHCP4_PACKET;\r
+#pragma pack()\r
+\r
+\r
+typedef enum {\r
+  Dhcp4Stopped        = 0x0,\r
+  Dhcp4Init           = 0x1,\r
+  Dhcp4Selecting      = 0x2,\r
+  Dhcp4Requesting     = 0x3,\r
+  Dhcp4Bound          = 0x4,\r
+  Dhcp4Renewing       = 0x5,\r
+  Dhcp4Rebinding      = 0x6,\r
+  Dhcp4InitReboot     = 0x7,\r
+  Dhcp4Rebooting      = 0x8\r
+} EFI_DHCP4_STATE;\r
+\r
+\r
+typedef enum{\r
+  Dhcp4SendDiscover   = 0x01,\r
+  Dhcp4RcvdOffer      = 0x02,\r
+  Dhcp4SelectOffer    = 0x03,\r
+  Dhcp4SendRequest    = 0x04,\r
+  Dhcp4RcvdAck        = 0x05,\r
+  Dhcp4RcvdNak        = 0x06,\r
+  Dhcp4SendDecline    = 0x07,\r
+  Dhcp4BoundCompleted = 0x08,\r
+  Dhcp4EnterRenewing  = 0x09,\r
+  Dhcp4EnterRebinding = 0x0a,\r
+  Dhcp4AddressLost    = 0x0b,\r
+  Dhcp4Fail           = 0x0c\r
+} EFI_DHCP4_EVENT;\r
+\r
+/**                                                                 \r
+  Callback routine \r
+    \r
+  @param  This                  Pointer to the EFI DHCPv4 Protocol instance that is used to\r
+                                configure this callback function.                          \r
+  @param  Context               Pointer to the context that is initialized by\r
+                                EFI_DHCP4_PROTOCOL.Configure().                                              \r
+  @param  CurrentState          The current operational state of the EFI DHCPv4 Protocol\r
+                                driver.                                                 \r
+  @param  Dhcp4Event            The event that occurs in the current state, which usually means a\r
+                                state transition.                                                \r
+  @param  Packet                The DHCP packet that is going to be sent or already received.                \r
+  @param  NewPacket             The packet that is used to replace the above Packet.\r
+                                \r
+  @retval EFI_SUCCESS           Tells the EFI DHCPv4 Protocol driver to continue the DHCP process.\r
+  @retval EFI_NOT_READY         Only used in the Dhcp4Selecting state. The EFI DHCPv4 Protocol         \r
+                                driver will continue to wait for more DHCPOFFER packets until the retry\r
+                                timeout expires.                                                       \r
+  @retval EFI_ABORTED           Tells the EFI DHCPv4 Protocol driver to abort the current process and\r
+                                return to the Dhcp4Init or Dhcp4InitReboot state.                    \r
+                                   \r
+**/\r
+typedef \r
+EFI_STATUS \r
+(EFIAPI *EFI_DHCP4_CALLBACK) (\r
+  IN  EFI_DHCP4_PROTOCOL         *This,\r
+  IN  VOID                       *Context,\r
+  IN  EFI_DHCP4_STATE            CurrentState,\r
+  IN  EFI_DHCP4_EVENT            Dhcp4Event,\r
+  IN  EFI_DHCP4_PACKET           *Packet     OPTIONAL, \r
+  OUT EFI_DHCP4_PACKET           **NewPacket OPTIONAL\r
+  );\r
+\r
+\r
+typedef struct {\r
+  UINT32                      DiscoverTryCount;      \r
+  UINT32                      *DiscoverTimeout;\r
+  UINT32                      RequestTryCount;\r
+  UINT32                      *RequestTimeout;\r
+  EFI_IPv4_ADDRESS            ClientAddress;\r
+  EFI_DHCP4_CALLBACK          Dhcp4Callback;\r
+  void                        *CallbackContext;\r
+  UINT32                      OptionCount;\r
+  EFI_DHCP4_PACKET_OPTION     **OptionList;\r
+} EFI_DHCP4_CONFIG_DATA;\r
+\r
+\r
+typedef struct {\r
+  EFI_DHCP4_STATE             State;\r
+  EFI_DHCP4_CONFIG_DATA       ConfigData;\r
+  EFI_IPv4_ADDRESS            ClientAddress;\r
+  EFI_MAC_ADDRESS             ClientMacAddress;\r
+  EFI_IPv4_ADDRESS            ServerAddress;\r
+  EFI_IPv4_ADDRESS            RouterAddress;\r
+  EFI_IPv4_ADDRESS            SubnetMask;\r
+  UINT32                      LeaseTime;\r
+  EFI_DHCP4_PACKET            *ReplyPacket;\r
+} EFI_DHCP4_MODE_DATA;\r
+\r
+\r
+typedef struct {\r
+  EFI_IPv4_ADDRESS            ListenAddress;\r
+  EFI_IPv4_ADDRESS            SubnetMask;\r
+  UINT16                      ListenPort;\r
+} EFI_DHCP4_LISTEN_POINT;\r
+\r
+\r
+typedef struct {\r
+  OUT EFI_STATUS              Status;\r
+  IN  EFI_EVENT               CompletionEvent;\r
+  IN  EFI_IPv4_ADDRESS        RemoteAddress;\r
+  IN  UINT16                  RemotePort;\r
+  IN  EFI_IPv4_ADDRESS        GatewayAddress;\r
+  IN  UINT32                  ListenPointCount;\r
+  IN  EFI_DHCP4_LISTEN_POINT  *ListenPoints;\r
+  IN  UINT32                  TimeoutValue;\r
+  IN  EFI_DHCP4_PACKET        *Packet;\r
+  OUT UINT32                  ResponseCount;\r
+  OUT EFI_DHCP4_PACKET        *ResponseList;\r
+} EFI_DHCP4_TRANSMIT_RECEIVE_TOKEN;\r
+\r
+\r
+/**\r
+  Returns the current operating mode and cached data packet for the EFI DHCPv4 Protocol driver.\r
+\r
+  @param  This          Pointer to the EFI_DHCP4_PROTOCOL instance.\r
+  @param  Dhcp4ModeData Pointer to storage for the EFI_DHCP4_MODE_DATA structure.\r
+\r
+  @retval EFI_SUCCESS           The mode data was returned.\r
+  @retval EFI_INVALID_PARAMETER This is NULL.\r
+\r
+**/\r
+typedef \r
+EFI_STATUS \r
+(EFIAPI *EFI_DHCP4_GET_MODE_DATA)(\r
+  IN  EFI_DHCP4_PROTOCOL      *This,\r
+  OUT EFI_DHCP4_MODE_DATA     *Dhcp4ModeData\r
+  )\r
+;\r
+\r
+/**\r
+  Initializes, changes, or resets the operational settings for the EFI DHCPv4 Protocol driver.\r
+\r
+  @param  This                   Pointer to the EFI_DHCP4_PROTOCOL instance.\r
+  @param  Dhcp4CfgData           Pointer to the EFI_DHCP4_CONFIG_DATA.\r
+\r
+  @retval EFI_SUCCESS           The EFI DHCPv4 Protocol driver is now in the Dhcp4Init or\r
+                                Dhcp4InitReboot state, if the original state of this driver\r
+                                was Dhcp4Stopped and the value of Dhcp4CfgData was\r
+                                not NULL. Otherwise, the state was left unchanged.\r
+  @retval EFI_ACCESS_DENIED     This instance of the EFI DHCPv4 Protocol driver was not in the\r
+                                Dhcp4Stopped, Dhcp4Init, Dhcp4InitReboot, or Dhcp4Bound state;\r
+                                Or onother instance of this EFI DHCPv4 Protocol driver is already\r
+                                in a valid configured state.\r
+  @retval EFI_INVALID_PARAMETER Some parameter is NULL.\r
+  @retval EFI_OUT_OF_RESOURCES  Required system resources could not be allocated.\r
+  @retval EFI_DEVICE_ERROR      An unexpected system or network error occurred.\r
+\r
+**/\r
+typedef \r
+EFI_STATUS\r
+(EFIAPI *EFI_DHCP4_CONFIGURE) (\r
+  IN EFI_DHCP4_PROTOCOL       *This,\r
+  IN EFI_DHCP4_CONFIG_DATA    *Dhcp4CfgData  OPTIONAL\r
+  )\r
+;\r
+\r
+\r
+/**\r
+  Starts the DHCP configuration process.\r
+\r
+  @param  This            Pointer to the EFI_DHCP4_PROTOCOL instance.\r
+  @param  CompletionEvent If not NULL, indicates the event that will be signaled when the\r
+                          EFI DHCPv4 Protocol driver is transferred into the\r
+                          Dhcp4Bound state or when the DHCP process is aborted.\r
+                          EFI_DHCP4_PROTOCOL.GetModeData() can be called to\r
+                          check the completion status. If NULL,\r
+                          EFI_DHCP4_PROTOCOL.Start() will wait until the driver\r
+                          is transferred into the Dhcp4Bound state or the process fails.\r
+\r
+  @retval EFI_SUCCESS           The DHCP configuration process has started, or it has completed\r
+                                when CompletionEvent is NULL.\r
+  @retval EFI_NOT_STARTED       The EFI DHCPv4 Protocol driver is in the Dhcp4Stopped\r
+                                state. EFI_DHCP4_PROTOCOL. Configure() needs to be called.\r
+  @retval EFI_INVALID_PARAMETER This is NULL.\r
+  @retval EFI_OUT_OF_RESOURCES  Required system resources could not be allocated.\r
+  @retval EFI_TIMEOUT           The DHCP configuration process failed because no response was\r
+                                received from the server within the specified timeout value.\r
+  @retval EFI_ABORTED           The user aborted the DHCP process.\r
+  @retval EFI_ALREADY_STARTED   Some other EFI DHCPv4 Protocol instance already started the\r
+                                DHCP process.\r
+  @retval EFI_DEVICE_ERROR      An unexpected system or network error occurred.\r
+\r
+**/\r
+typedef \r
+EFI_STATUS\r
+(EFIAPI *EFI_DHCP4_START) (\r
+  IN EFI_DHCP4_PROTOCOL       *This,\r
+  IN EFI_EVENT                CompletionEvent   OPTIONAL\r
+  )\r
+;\r
+\r
+/**\r
+  Extends the lease time by sending a request packet.\r
+\r
+  @param  This            Pointer to the EFI_DHCP4_PROTOCOL instance.\r
+  @param  RebindRequest   If TRUE, this function broadcasts the request packets and enters\r
+                          the Dhcp4Rebinding state. Otherwise, it sends a unicast\r
+                          request packet and enters the Dhcp4Renewing state.\r
+  @param  CompletionEvent If not NULL, this event is signaled when the renew/rebind phase\r
+                          completes or some error occurs.\r
+                          EFI_DHCP4_PROTOCOL.GetModeData() can be called to\r
+                          check the completion status. If NULL,\r
+                          EFI_DHCP4_PROTOCOL.RenewRebind() will busy-wait\r
+                          until the DHCP process finishes.\r
+\r
+  @retval EFI_SUCCESS           The EFI DHCPv4 Protocol driver is now in the\r
+                                Dhcp4Renewing state or is back to the Dhcp4Bound state.\r
+  @retval EFI_NOT_STARTED       The EFI DHCPv4 Protocol driver is in the Dhcp4Stopped\r
+                                state. EFI_DHCP4_PROTOCOL.Configure() needs to\r
+                                be called.\r
+  @retval EFI_INVALID_PARAMETER This is NULL.\r
+  @retval EFI_TIMEOUT           There was no response from the server when the try count was\r
+                                exceeded.\r
+  @retval EFI_ACCESS_DENIED     The driver is not in the Dhcp4Bound state.\r
+  @retval EFI_DEVICE_ERROR      An unexpected system or network error occurred.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_DHCP4_RENEW_REBIND) (\r
+  IN EFI_DHCP4_PROTOCOL       *This,\r
+  IN BOOLEAN                  RebindRequest,\r
+  IN EFI_EVENT                CompletionEvent  OPTIONAL\r
+  )\r
+;  \r
+\r
+/**\r
+  Releases the current address configuration.\r
+\r
+  @param  This                  Pointer to the EFI_DHCP4_PROTOCOL instance.\r
+\r
+  @retval EFI_SUCCESS           The EFI DHCPv4 Protocol driver is now in the Dhcp4Init phase.\r
+  @retval EFI_INVALID_PARAMETER This is NULL.\r
+  @retval EFI_ACCESS_DENIED     The EFI DHCPv4 Protocol driver is not Dhcp4InitReboot state.\r
+  @retval EFI_DEVICE_ERROR      An unexpected system or network error occurred.\r
+\r
+**/\r
+typedef \r
+EFI_STATUS\r
+(EFIAPI *EFI_DHCP4_RELEASE) (\r
+  IN EFI_DHCP4_PROTOCOL       *This\r
+  )\r
+;  \r
+\r
+/**\r
+  Stops the current address configuration.\r
+\r
+  @param  This                  Pointer to the EFI_DHCP4_PROTOCOL instance.\r
+                                 \r
+  @retval EFI_SUCCESS           The EFI DHCPv4 Protocol driver is now in the Dhcp4Stopped phase.\r
+  @retval EFI_INVALID_PARAMETER This is NULL.\r
+\r
+**/\r
+typedef \r
+EFI_STATUS\r
+(EFIAPI *EFI_DHCP4_STOP) (\r
+  IN EFI_DHCP4_PROTOCOL       *This\r
+  )\r
+; \r
+\r
+/**\r
+  Builds a DHCP packet, given the options to be appended or deleted or replaced.\r
+\r
+  @param  This        Pointer to the EFI_DHCP4_PROTOCOL instance.\r
+  @param  SeedPacket  Initial packet to be used as a base for building new packet.\r
+  @param  DeleteCount Number of opcodes in the DeleteList.\r
+  @param  DeleteList  List of opcodes to be deleted from the seed packet.\r
+                      Ignored if DeleteCount is zero.\r
+  @param  AppendCount Number of entries in the OptionList.\r
+  @param  AppendList  Pointer to a DHCP option list to be appended to SeedPacket.\r
+                      If SeedPacket also contains options in this list, they are\r
+                      replaced by new options (except pad option). Ignored if\r
+                      AppendCount is zero. Type EFI_DHCP4_PACKET_OPTION\r
+  @param  NewPacket   Pointer to storage for the pointer to the new allocated packet.\r
+                      Use the EFI Boot Service FreePool() on the resulting pointer\r
+                      when done with the packet.\r
+\r
+  @retval EFI_SUCCESS           The new packet was built.\r
+  @retval EFI_OUT_OF_RESOURCES  Storage for the new packet could not be allocated.\r
+  @retval EFI_INVALID_PARAMETER Some parameter is NULL.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_DHCP4_BUILD) (\r
+  IN  EFI_DHCP4_PROTOCOL      *This,\r
+  IN  EFI_DHCP4_PACKET        *SeedPacket,\r
+  IN  UINT32                  DeleteCount,\r
+  IN  UINT8                   *DeleteList         OPTIONAL,\r
+  IN  UINT32                  AppendCount,\r
+  IN  EFI_DHCP4_PACKET_OPTION *AppendList[]       OPTIONAL,\r
+  OUT EFI_DHCP4_PACKET        **NewPacket\r
+  );\r
+;   \r
+\r
+/**\r
+  Transmits a DHCP formatted packet and optionally waits for responses.\r
+\r
+  @param  This    Pointer to the EFI_DHCP4_PROTOCOL instance.\r
+  @param  Token   Pointer to the EFI_DHCP4_TRANSMIT_RECEIVE_TOKEN structure.\r
+\r
+  @retval EFI_SUCCESS           The packet was successfully queued for transmission.\r
+  @retval EFI_INVALID_PARAMETER Some parameter is NULL.\r
+  @retval EFI_NOT_READY         The previous call to this function has not finished yet. Try to call\r
+                                this function after collection process completes.\r
+  @retval EFI_NO_MAPPING        The default station address is not available yet.\r
+  @retval EFI_OUT_OF_RESOURCES  Required system resources could not be allocated.\r
+  @retval Others                Some other unexpected error occurred.\r
+\r
+**/\r
+typedef \r
+EFI_STATUS\r
+(EFIAPI *EFI_DHCP4_TRANSMIT_RECEIVE) (\r
+  IN EFI_DHCP4_PROTOCOL                *This,\r
+  IN EFI_DHCP4_TRANSMIT_RECEIVE_TOKEN  *Token\r
+  )\r
+;\r
+\r
+\r
+/**\r
+  Parses the packed DHCP option data.\r
+\r
+  @param  This             Pointer to the EFI_DHCP4_PROTOCOL instance.\r
+  @param  Packet           Pointer to packet to be parsed.\r
+  @param  OptionCount      On input, the number of entries in the PacketOptionList.\r
+                           On output, the number of entries that were written into the\r
+                           PacketOptionList.\r
+  @param  PacketOptionList List of packet option entries to be filled in. End option or pad\r
+                           options are not included.\r
+\r
+  @retval EFI_SUCCESS           The packet was successfully parsed.\r
+  @retval EFI_INVALID_PARAMETER Some parameter is NULL.\r
+  @retval EFI_BUFFER_TOO_SMALL  One or more of the following conditions is TRUE:\r
+                                1) *OptionCount is smaller than the number of options that\r
+                                were found in the Packet.\r
+                                2) PacketOptionList is NULL.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_DHCP4_PARSE) (\r
+  IN EFI_DHCP4_PROTOCOL        *This,\r
+  IN EFI_DHCP4_PACKET          *Packet,\r
+  IN OUT UINT32                *OptionCount,\r
+  OUT EFI_DHCP4_PACKET_OPTION  *PacketOptionList[]  OPTIONAL\r
+  )\r
+;\r
+\r
+\r
+struct _EFI_DHCP4_PROTOCOL {\r
+  EFI_DHCP4_GET_MODE_DATA      GetModeData;\r
+  EFI_DHCP4_CONFIGURE          Configure;\r
+  EFI_DHCP4_START              Start;\r
+  EFI_DHCP4_RENEW_REBIND       RenewRebind;\r
+  EFI_DHCP4_RELEASE            Release;\r
+  EFI_DHCP4_STOP               Stop;\r
+  EFI_DHCP4_BUILD              Build;\r
+  EFI_DHCP4_TRANSMIT_RECEIVE   TransmitReceive;\r
+  EFI_DHCP4_PARSE              Parse;\r
+};\r
+\r
+extern EFI_GUID gEfiDhcp4ProtocolGuid;\r
+extern EFI_GUID gEfiDhcp4ServiceBindingProtocolGuid;\r
+\r
+#endif\r
diff --git a/Tools/Source/TianoTools/Include/Protocol/DiskIo.h b/Tools/Source/TianoTools/Include/Protocol/DiskIo.h
new file mode 100644 (file)
index 0000000..e36792c
--- /dev/null
@@ -0,0 +1,98 @@
+/** @file\r
+  Disk IO protocol as defined in the EFI 1.0 specification.\r
+\r
+  The Disk IO protocol is used to convert block oriented devices into byte\r
+  oriented devices. The Disk IO protocol is intended to layer on top of the\r
+  Block IO protocol.\r
+\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. This program and the accompanying materials                          \r
+  are licensed and made available under the terms and conditions of the BSD License         \r
+  which accompanies this distribution.  The full text of the license may be found at        \r
+  http://opensource.org/licenses/bsd-license.php                                            \r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+  Module Name:  DiskIo.h\r
+\r
+**/\r
+\r
+#ifndef __DISK_IO_H__\r
+#define __DISK_IO_H__\r
+\r
+#define EFI_DISK_IO_PROTOCOL_GUID \\r
+  { \\r
+    0xce345171, 0xba0b, 0x11d2, {0x8e, 0x4f, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b } \\r
+  }\r
+\r
+typedef struct _EFI_DISK_IO_PROTOCOL EFI_DISK_IO_PROTOCOL;\r
+\r
+/**\r
+  Read BufferSize bytes from Offset into Buffer.\r
+\r
+  @param  This                  Protocol instance pointer.\r
+  @param  MediaId               Id of the media, changes every time the media is replaced.\r
+  @param  Offset                The starting byte offset to read from\r
+  @param  BufferSize            Size of Buffer\r
+  @param  Buffer                Buffer containing read data\r
+\r
+  @retval EFI_SUCCESS           The data was read correctly from the device.\r
+  @retval EFI_DEVICE_ERROR      The device reported an error while performing the read.\r
+  @retval EFI_NO_MEDIA          There is no media in the device.\r
+  @retval EFI_MEDIA_CHNAGED     The MediaId does not matched the current device.\r
+  @retval EFI_INVALID_PARAMETER The read request contains device addresses that are not\r
+                                valid for the device.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_DISK_READ) (\r
+  IN EFI_DISK_IO_PROTOCOL         *This,\r
+  IN UINT32                       MediaId,\r
+  IN UINT64                       Offset,\r
+  IN UINTN                        BufferSize,\r
+  OUT VOID                        *Buffer\r
+  )\r
+;\r
+\r
+/**\r
+  Read BufferSize bytes from Offset into Buffer.\r
+\r
+  @param  This       Protocol instance pointer.\r
+  @param  MediaId    Id of the media, changes every time the media is replaced.\r
+  @param  Offset     The starting byte offset to read from\r
+  @param  BufferSize Size of Buffer\r
+  @param  Buffer     Buffer containing read data\r
+\r
+  @retval EFI_SUCCESS           The data was written correctly to the device.\r
+  @retval EFI_WRITE_PROTECTED   The device can not be written to.\r
+  @retval EFI_DEVICE_ERROR      The device reported an error while performing the write.\r
+  @retval EFI_NO_MEDIA          There is no media in the device.\r
+  @retval EFI_MEDIA_CHNAGED     The MediaId does not matched the current device.\r
+  @retval EFI_INVALID_PARAMETER The write request contains device addresses that are not\r
+                                 valid for the device.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_DISK_WRITE) (\r
+  IN EFI_DISK_IO_PROTOCOL         *This,\r
+  IN UINT32                       MediaId,\r
+  IN UINT64                       Offset,\r
+  IN UINTN                        BufferSize,\r
+  IN VOID                         *Buffer\r
+  )\r
+;\r
+\r
+#define EFI_DISK_IO_PROTOCOL_REVISION 0x00010000\r
+\r
+struct _EFI_DISK_IO_PROTOCOL {\r
+  UINT64          Revision;\r
+  EFI_DISK_READ   ReadDisk;\r
+  EFI_DISK_WRITE  WriteDisk;\r
+};\r
+\r
+extern EFI_GUID gEfiDiskIoProtocolGuid;\r
+\r
+#endif\r
diff --git a/Tools/Source/TianoTools/Include/Protocol/DriverBinding.h b/Tools/Source/TianoTools/Include/Protocol/DriverBinding.h
new file mode 100644 (file)
index 0000000..5f5d909
--- /dev/null
@@ -0,0 +1,111 @@
+/** @file\r
+  EFI ControllerHandle Driver Protocol\r
+\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. This program and the accompanying materials                          \r
+  are licensed and made available under the terms and conditions of the BSD License         \r
+  which accompanies this distribution.  The full text of the license may be found at        \r
+  http://opensource.org/licenses/bsd-license.php                                            \r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+  Module Name:  DriverBinding.h\r
+\r
+**/\r
+\r
+#ifndef __EFI_DRIVER_BINDING_H__\r
+#define __EFI_DRIVER_BINDING_H__\r
+\r
+//\r
+// Global ID for the ControllerHandle Driver Protocol\r
+//\r
+#define EFI_DRIVER_BINDING_PROTOCOL_GUID \\r
+  { \\r
+    0x18a031ab, 0xb443, 0x4d1a, {0xa5, 0xc0, 0xc, 0x9, 0x26, 0x1e, 0x9f, 0x71 } \\r
+  }\r
+\r
+typedef struct _EFI_DRIVER_BINDING_PROTOCOL  EFI_DRIVER_BINDING_PROTOCOL;\r
+\r
+/**\r
+  Test to see if this driver supports ControllerHandle. \r
+\r
+  @param  This                Protocol instance pointer.\r
+  @param  ControllerHandle    Handle of device to test\r
+  @param  RemainingDevicePath Optional parameter use to pick a specific child\r
+                              device to start.\r
+\r
+  @retval EFI_SUCCESS         This driver supports this device\r
+  @retval EFI_ALREADY_STARTED This driver is already running on this device\r
+  @retval other               This driver does not support this device\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_DRIVER_BINDING_SUPPORTED) (\r
+  IN EFI_DRIVER_BINDING_PROTOCOL            *This,\r
+  IN EFI_HANDLE                             ControllerHandle,\r
+  IN EFI_DEVICE_PATH_PROTOCOL               *RemainingDevicePath OPTIONAL\r
+  )\r
+;\r
+\r
+/**\r
+  Start this driver on ControllerHandle.\r
+\r
+  @param  This                 Protocol instance pointer.\r
+  @param  ControllerHandle     Handle of device to bind driver to\r
+  @param  RemainingDevicePath  Optional parameter use to pick a specific child\r
+                               device to start.\r
+\r
+  @retval EFI_SUCCESS          This driver is added to ControllerHandle\r
+  @retval EFI_ALREADY_STARTED  This driver is already running on ControllerHandle\r
+  @retval other                This driver does not support this device\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_DRIVER_BINDING_START) (\r
+  IN EFI_DRIVER_BINDING_PROTOCOL            *This,\r
+  IN EFI_HANDLE                             ControllerHandle,\r
+  IN EFI_DEVICE_PATH_PROTOCOL               *RemainingDevicePath OPTIONAL\r
+  )\r
+;\r
+\r
+/**\r
+  Stop this driver on ControllerHandle.\r
+\r
+  @param  This              Protocol instance pointer.\r
+  @param  ControllerHandle  Handle of device to stop driver on\r
+  @param  NumberOfChildren  Number of Handles in ChildHandleBuffer. If number of\r
+                            children is zero stop the entire bus driver.\r
+  @param  ChildHandleBuffer List of Child Handles to Stop.\r
+\r
+  @retval EFI_SUCCESS       This driver is removed ControllerHandle\r
+  @retval other             This driver was not removed from this device\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_DRIVER_BINDING_STOP) (\r
+  IN EFI_DRIVER_BINDING_PROTOCOL            *This,\r
+  IN  EFI_HANDLE                            ControllerHandle,\r
+  IN  UINTN                                 NumberOfChildren,\r
+  IN  EFI_HANDLE                            *ChildHandleBuffer OPTIONAL\r
+  )\r
+;\r
+\r
+//\r
+// Interface structure for the ControllerHandle Driver Protocol\r
+//\r
+struct _EFI_DRIVER_BINDING_PROTOCOL {\r
+  EFI_DRIVER_BINDING_SUPPORTED  Supported;\r
+  EFI_DRIVER_BINDING_START      Start;\r
+  EFI_DRIVER_BINDING_STOP       Stop;\r
+  UINT32                        Version;\r
+  EFI_HANDLE                    ImageHandle;\r
+  EFI_HANDLE                    DriverBindingHandle;\r
+};\r
+\r
+extern EFI_GUID gEfiDriverBindingProtocolGuid;\r
+\r
+#endif\r
diff --git a/Tools/Source/TianoTools/Include/Protocol/DriverConfiguration.h b/Tools/Source/TianoTools/Include/Protocol/DriverConfiguration.h
new file mode 100644 (file)
index 0000000..f4f0c7a
--- /dev/null
@@ -0,0 +1,203 @@
+/** @file\r
+  EFI Driver Configuration Protocol\r
+\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. This program and the accompanying materials                          \r
+  are licensed and made available under the terms and conditions of the BSD License         \r
+  which accompanies this distribution.  The full text of the license may be found at        \r
+  http://opensource.org/licenses/bsd-license.php                                            \r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+  Module Name:  DriverConfiguration.h\r
+\r
+**/\r
+\r
+#ifndef __EFI_DRIVER_CONFIGURATION_H__\r
+#define __EFI_DRIVER_CONFIGURATION_H__\r
+\r
+//\r
+// Global ID for the Driver Configuration Protocol defined in EFI 1.10\r
+//\r
+#define EFI_DRIVER_CONFIGURATION_PROTOCOL_GUID \\r
+  { \\r
+    0x107a772b, 0xd5e1, 0x11d4, {0x9a, 0x46, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d } \\r
+  }\r
+\r
+//\r
+// Global ID for the Driver Configuration Protocol defined in UEFI 2.0\r
+//\r
+#define UEFI_DRIVER_CONFIGURATION_PROTOCOL_GUID \\r
+  { \\r
+    0xbfd7dc1d, 0x24f1, 0x40d9, {0x82, 0xe7, 0x2e, 0x09, 0xbb, 0x6b, 0x4e, 0xbe } \\r
+  }\r
+  \r
+typedef struct _EFI_DRIVER_CONFIGURATION_PROTOCOL  EFI_DRIVER_CONFIGURATION_PROTOCOL;\r
+\r
+typedef enum {\r
+  EfiDriverConfigurationActionNone              = 0,\r
+  EfiDriverConfigurationActionStopController    = 1,\r
+  EfiDriverConfigurationActionRestartController = 2,\r
+  EfiDriverConfigurationActionRestartPlatform   = 3,\r
+  EfiDriverConfigurationActionMaximum\r
+} EFI_DRIVER_CONFIGURATION_ACTION_REQUIRED;\r
+\r
+#define EFI_DRIVER_CONFIGURATION_SAFE_DEFAULTS          0x00000000\r
+#define EFI_DRIVER_CONFIGURATION_MANUFACTURING_DEFAULTS 0x00000001\r
+#define EFI_DRIVER_CONFIGURATION_CUSTOM_DEFAULTS        0x00000002\r
+#define EFI_DRIVER_CONFIGURATION_PERORMANCE_DEFAULTS    0x00000003\r
+\r
+/**\r
+  Allows the user to set controller specific options for a controller that a \r
+  driver is currently managing.\r
+\r
+  @param  This             A pointer to the EFI_DRIVER_CONFIGURATION_ PROTOCOL instance.\r
+  @param  ControllerHandle The handle of the controller to set options on.\r
+  @param  ChildHandle      The handle of the child controller to set options on.  This\r
+                           is an optional parameter that may be NULL.  It will be NULL\r
+                           for device drivers, and for a bus drivers that wish to set\r
+                           options for the bus controller.  It will not be NULL for a\r
+                           bus driver that wishes to set options for one of its child\r
+                           controllers.\r
+  @param  Language         A pointer to a three character ISO 639-2 language identifier.\r
+                           This is the language of the user interface that should be\r
+                           presented to the user, and it must match one of the languages\r
+                           specified in SupportedLanguages.  The number of languages\r
+                           supported by a driver is up to the driver writer.\r
+  @param  ActionRequired   A pointer to the action that the calling agent is required\r
+                           to perform when this function returns.  See "Related\r
+                           Definitions" for a list of the actions that the calling\r
+                           agent is required to perform prior to accessing\r
+                           ControllerHandle again.\r
+\r
+  @retval EFI_SUCCESS           The driver specified by This successfully set the\r
+                                configuration options for the controller specified\r
+                                by ControllerHandle..\r
+  @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.\r
+  @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid EFI_HANDLE.\r
+  @retval EFI_INVALID_PARAMETER ActionRequired is NULL.\r
+  @retval EFI_UNSUPPORTED       The driver specified by This does not support setting\r
+                                configuration options for the controller specified by\r
+                                ControllerHandle and ChildHandle.\r
+  @retval EFI_UNSUPPORTED       The driver specified by This does not support the\r
+                                language specified by Language.\r
+  @retval EFI_DEVICE_ERROR      A device error occurred while attempt to set the\r
+                                configuration options for the controller specified\r
+                                by ControllerHandle and ChildHandle.\r
+  @retval EFI_OUT_RESOURCES     There are not enough resources available to set the\r
+                                configuration options for the controller specified\r
+                                by ControllerHandle and ChildHandle.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_DRIVER_CONFIGURATION_SET_OPTIONS) (\r
+  IN EFI_DRIVER_CONFIGURATION_PROTOCOL                        *This,\r
+  IN  EFI_HANDLE                                              ControllerHandle,\r
+  IN  EFI_HANDLE                                              ChildHandle  OPTIONAL,\r
+  IN  CHAR8                                                   *Language,\r
+  OUT EFI_DRIVER_CONFIGURATION_ACTION_REQUIRED                *ActionRequired\r
+  );\r
+\r
+/**\r
+  Tests to see if a controller's current configuration options are valid.\r
+\r
+  @param  This             A pointer to the EFI_DRIVER_CONFIGURATION_PROTOCOL instance.\r
+  @param  ControllerHandle The handle of the controller to test if it's current\r
+                           configuration options are valid.\r
+  @param  ChildHandle      The handle of the child controller to test if it's current\r
+                           configuration options are valid.  This is an optional\r
+                           parameter that may be NULL.  It will be NULL for device\r
+                           drivers.  It will also be NULL for a bus drivers that wish\r
+                           to test the configuration options for the bus controller.\r
+                           It will not be NULL for a bus driver that wishes to test\r
+                           configuration options for one of its child controllers.\r
+\r
+  @retval EFI_SUCCESS           The controller specified by ControllerHandle and\r
+                                ChildHandle that is being managed by the driver\r
+                                specified by This has a valid set of  configuration\r
+                                options.\r
+  @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.\r
+  @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid EFI_HANDLE.\r
+  @retval EFI_UNSUPPORTED       The driver specified by This is not currently\r
+                                managing the controller specified by ControllerHandle\r
+                                and ChildHandle.\r
+  @retval EFI_DEVICE_ERROR      The controller specified by ControllerHandle and\r
+                                ChildHandle that is being managed by the driver\r
+                                specified by This has an invalid set of configuration\r
+                                options.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_DRIVER_CONFIGURATION_OPTIONS_VALID) (\r
+  IN EFI_DRIVER_CONFIGURATION_PROTOCOL                        *This,\r
+  IN  EFI_HANDLE                                              ControllerHandle,\r
+  IN  EFI_HANDLE                                              ChildHandle  OPTIONAL\r
+  );\r
+\r
+/**\r
+  Forces a driver to set the default configuration options for a controller.\r
+\r
+  @param  This             A pointer to the EFI_DRIVER_CONFIGURATION_ PROTOCOL instance.\r
+  @param  ControllerHandle The handle of the controller to force default configuration options on.\r
+  @param  ChildHandle      The handle of the child controller to force default configuration options on  This is an optional parameter that may be NULL.  It will be NULL for device drivers.  It will also be NULL for a bus drivers that wish to force default configuration options for the bus controller.  It will not be NULL for a bus driver that wishes to force default configuration options for one of its child controllers.\r
+  @param  DefaultType      The type of default configuration options to force on the controller specified by ControllerHandle and ChildHandle.  See Table 9-1 for legal values.  A DefaultType of 0x00000000 must be supported by this protocol.\r
+  @param  ActionRequired   A pointer to the action that the calling agent is required to perform when this function returns.  See "Related Definitions" in Section 9.1for a list of the actions that the calling agent is required to perform prior to accessing ControllerHandle again.\r
+\r
+  @retval EFI_SUCCESS           The driver specified by This successfully forced the default configuration options on the controller specified by ControllerHandle and ChildHandle.\r
+  @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.\r
+  @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid EFI_HANDLE.\r
+  @retval EFI_INVALID_PARAMETER ActionRequired is NULL.\r
+  @retval EFI_UNSUPPORTED       The driver specified by This does not support forcing the default configuration options on the controller specified by ControllerHandle and ChildHandle.\r
+  @retval EFI_UNSUPPORTED       The driver specified by This does not support the configuration type specified by DefaultType.\r
+  @retval EFI_DEVICE_ERROR      A device error occurred while attempt to force the default configuration options on the controller specified by  ControllerHandle and ChildHandle.\r
+  @retval EFI_OUT_RESOURCES     There are not enough resources available to force the default configuration options on the controller specified by ControllerHandle and ChildHandle.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_DRIVER_CONFIGURATION_FORCE_DEFAULTS) (\r
+  IN EFI_DRIVER_CONFIGURATION_PROTOCOL                        *This,\r
+  IN  EFI_HANDLE                                              ControllerHandle,\r
+  IN  EFI_HANDLE                                              ChildHandle  OPTIONAL,\r
+  IN  UINT32                                                  DefaultType,\r
+  OUT EFI_DRIVER_CONFIGURATION_ACTION_REQUIRED                *ActionRequired\r
+  );\r
+\r
+\r
+//\r
+//\r
+struct _EFI_DRIVER_CONFIGURATION_PROTOCOL {\r
+  EFI_DRIVER_CONFIGURATION_SET_OPTIONS    SetOptions;\r
+  EFI_DRIVER_CONFIGURATION_OPTIONS_VALID  OptionsValid;\r
+  EFI_DRIVER_CONFIGURATION_FORCE_DEFAULTS ForceDefaults;\r
+  CHAR8                                   *SupportedLanguages;\r
+};\r
+\r
+/**\r
+  Interface structure for the Driver Configuration Protocol.\r
+\r
+  @par Protocol Description:  \r
+  Used to set configuration options for a controller that an EFI Driver is managing.\r
+\r
+  @param SetOptions          Allows the use to set drivers specific configuration \r
+                             options for a controller that the driver is currently managing.\r
+                             \r
+  @param OptionsValid        Tests to see if a controller's current configuration \r
+                             options are valid. \r
+                             \r
+  @param ForceDefaults       Forces a driver to set the default configuration options \r
+                             for a controller.\r
+\r
+  @param SupportedLanguages  A Null-terminated ASCII string that contains one or more \r
+                             ISO 639-2 language codes.  This is the list of language \r
+                             codes that this protocol supports.\r
+\r
+**/\r
+\r
+extern EFI_GUID gEfiDriverConfigurationProtocolGuid;\r
+extern EFI_GUID gUefiDriverConfigurationProtocolGuid;\r
+\r
+#endif\r
diff --git a/Tools/Source/TianoTools/Include/Protocol/DriverDiagnostics.h b/Tools/Source/TianoTools/Include/Protocol/DriverDiagnostics.h
new file mode 100644 (file)
index 0000000..c0a0cbc
--- /dev/null
@@ -0,0 +1,134 @@
+/** @file\r
+  EFI Driver Diagnostics Protocol\r
+\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. This program and the accompanying materials                          \r
+  are licensed and made available under the terms and conditions of the BSD License         \r
+  which accompanies this distribution.  The full text of the license may be found at        \r
+  http://opensource.org/licenses/bsd-license.php                                            \r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+  Module Name:  DriverDiagnostics.h\r
+\r
+**/\r
+\r
+#ifndef __EFI_DRIVER_DIAGNOSTICS_H__\r
+#define __EFI_DRIVER_DIAGNOSTICS_H__\r
+\r
+//\r
+// Global ID for the Driver Diagnostics Protocol as defined in EFI 1.10.\r
+//\r
+#define EFI_DRIVER_DIAGNOSTICS_PROTOCOL_GUID \\r
+  { \\r
+    0x0784924f, 0xe296, 0x11d4, {0x9a, 0x49, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d } \\r
+  }\r
+\r
+//\r
+// Global ID for the Driver Diagnostics Protocol as defined in UEFI 2.0.\r
+//\r
+#define UEFI_DRIVER_DIAGNOSTICS_PROTOCOL_GUID \\r
+  { \\r
+    0x4d330321, 0x025f, 0x4aac, {0x90, 0xd8, 0x5e, 0xd9, 0x00, 0x17, 0x3b, 0x63 } \\r
+  }\r
+  \r
+typedef struct _EFI_DRIVER_DIAGNOSTICS_PROTOCOL  EFI_DRIVER_DIAGNOSTICS_PROTOCOL;\r
+\r
+typedef enum {\r
+  EfiDriverDiagnosticTypeStandard     = 0,\r
+  EfiDriverDiagnosticTypeExtended     = 1,\r
+  EfiDriverDiagnosticTypeManufacturing= 2,\r
+  EfiDriverDiagnosticTypeMaximum\r
+} EFI_DRIVER_DIAGNOSTIC_TYPE;\r
+\r
+/**\r
+  Runs diagnostics on a controller.\r
+\r
+  @param  This             A pointer to the EFI_DRIVER_DIAGNOSTICS_PROTOCOL instance.\r
+  @param  ControllerHandle The handle of the controller to run diagnostics on.\r
+  @param  ChildHandle      The handle of the child controller to run diagnostics on\r
+                           This is an optional parameter that may be NULL.  It will\r
+                           be NULL for device drivers.  It will also be NULL for a\r
+                           bus drivers that wish to run diagnostics on the bus\r
+                           controller.  It will not be NULL for a bus driver that\r
+                           wishes to run diagnostics on one of its child controllers.\r
+  @param  DiagnosticType   Indicates type of diagnostics to perform on the controller\r
+                           specified by ControllerHandle and ChildHandle.   See\r
+                           "Related Definitions" for the list of supported types.\r
+  @param  Language         A pointer to a three character ISO 639-2 language\r
+                           identifier.  This is the language in which the optional\r
+                           error message should be returned in Buffer, and it must\r
+                           match one of the languages specified in SupportedLanguages.\r
+                           The number of languages supported by a driver is up to\r
+                           the driver writer.\r
+  @param  ErrorType        A GUID that defines the format of the data returned in Buffer.\r
+  @param  BufferSize       The size, in bytes, of the data returned in Buffer.\r
+  @param  Buffer           A buffer that contains a Null-terminated Unicode string\r
+                           plus some additional data whose format is defined by\r
+                           ErrorType.  Buffer is allocated by this function with\r
+                           AllocatePool(), and it is the caller's responsibility\r
+                           to free it with a call to FreePool().\r
+\r
+  @retval EFI_SUCCESS           The controller specified by ControllerHandle and\r
+                                ChildHandle passed the diagnostic.\r
+  @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.\r
+  @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid EFI_HANDLE.\r
+  @retval EFI_INVALID_PARAMETER Language is NULL.\r
+  @retval EFI_INVALID_PARAMETER ErrorType is NULL.\r
+  @retval EFI_INVALID_PARAMETER BufferType is NULL.\r
+  @retval EFI_INVALID_PARAMETER Buffer is NULL.\r
+  @retval EFI_UNSUPPORTED       The driver specified by This does not support\r
+                                running diagnostics for the controller specified\r
+                                by ControllerHandle and ChildHandle.\r
+  @retval EFI_UNSUPPORTED       The driver specified by This does not support the\r
+                                type of diagnostic specified by DiagnosticType.\r
+  @retval EFI_UNSUPPORTED       The driver specified by This does not support the\r
+                                language specified by Language.\r
+  @retval EFI_OUT_OF_RESOURCES  There are not enough resources available to complete\r
+                                the diagnostics.\r
+  @retval EFI_OUT_OF_RESOURCES  There are not enough resources available to return\r
+                                the status information in ErrorType, BufferSize,\r
+                                and Buffer.\r
+  @retval EFI_DEVICE_ERROR      The controller specified by ControllerHandle and\r
+                                ChildHandle did not pass the diagnostic.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_DRIVER_DIAGNOSTICS_RUN_DIAGNOSTICS) (\r
+  IN EFI_DRIVER_DIAGNOSTICS_PROTOCOL                        *This,\r
+  IN  EFI_HANDLE                                            ControllerHandle,\r
+  IN  EFI_HANDLE                                            ChildHandle  OPTIONAL,\r
+  IN  EFI_DRIVER_DIAGNOSTIC_TYPE                            DiagnosticType,\r
+  IN  CHAR8                                                 *Language,\r
+  OUT EFI_GUID                                              **ErrorType,\r
+  OUT UINTN                                                 *BufferSize,\r
+  OUT CHAR16                                                **Buffer\r
+  );\r
+\r
+\r
+//\r
+//\r
+\r
+/**\r
+  Interface structure for the Driver Diagnostics Protocol.\r
+\r
+  @par Protocol Description:\r
+  Used to perform diagnostics on a controller that an EFI Driver is managing.\r
+\r
+  @param RunDiagnostics      Runs diagnostics on a controller.\r
+  @param SupportedLanguages  A Null-terminated ASCII string that contains one or more\r
+                             ISO 639-2 language codes.  This is the list of language \r
+                             codes that this protocol supports.\r
+\r
+**/\r
+struct _EFI_DRIVER_DIAGNOSTICS_PROTOCOL {\r
+  EFI_DRIVER_DIAGNOSTICS_RUN_DIAGNOSTICS  RunDiagnostics;\r
+  CHAR8                                   *SupportedLanguages;\r
+};\r
+\r
+extern EFI_GUID gEfiDriverDiagnosticsProtocolGuid;\r
+extern EFI_GUID gUefiDriverDiagnosticsProtocolGuid;\r
+\r
+#endif\r
diff --git a/Tools/Source/TianoTools/Include/Protocol/Ebc.h b/Tools/Source/TianoTools/Include/Protocol/Ebc.h
new file mode 100644 (file)
index 0000000..c1abcba
--- /dev/null
@@ -0,0 +1,148 @@
+/** @file\r
+  Describes the protocol interface to the EBC interpreter.\r
+\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. This program and the accompanying materials                          \r
+  are licensed and made available under the terms and conditions of the BSD License         \r
+  which accompanies this distribution.  The full text of the license may be found at        \r
+  http://opensource.org/licenses/bsd-license.php                                            \r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+  Module Name:  Ebc.h\r
+\r
+**/\r
+\r
+#ifndef __EFI_EBC_PROTOCOL_H__\r
+#define __EFI_EBC_PROTOCOL_H__\r
+\r
+#define EFI_EBC_INTERPRETER_PROTOCOL_GUID \\r
+  { \\r
+    0x13AC6DD1, 0x73D0, 0x11D4, {0xB0, 0x6B, 0x00, 0xAA, 0x00, 0xBD, 0x6D, 0xE7 } \\r
+  }\r
+\r
+//\r
+// Protocol Guid Name defined in spec.\r
+//\r
+#define EFI_EBC_PROTOCOL_GUID EFI_EBC_INTERPRETER_PROTOCOL_GUID\r
+\r
+//\r
+// Define for forward reference.\r
+//\r
+typedef struct _EFI_EBC_PROTOCOL EFI_EBC_PROTOCOL;\r
+\r
+/**\r
+  Create a thunk for an image entry point. In short, given the physical address\r
+  of the entry point for a loaded image, create a thunk that does some \r
+  fixup of arguments (and perform any other necessary overhead) and then\r
+  calls the original entry point. The caller can then use the returned pointer\r
+  to the created thunk as the new entry point to image.\r
+\r
+  @param  This          protocol instance pointer\r
+  @param  ImageHandle   handle to the image. The EBC interpreter may use this to keep\r
+                        track of any resource allocations performed in loading and\r
+                        executing the image.\r
+  @param  EbcEntryPoint the entry point for the image (as defined in the file header)\r
+  @param  Thunk pointer to thunk pointer where the address of the created\r
+                        thunk is returned.\r
+\r
+  @return Standard EFI_STATUS\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_EBC_CREATE_THUNK) (\r
+  IN EFI_EBC_PROTOCOL           *This,\r
+  IN EFI_HANDLE                 ImageHandle,\r
+  IN VOID                       *EbcEntryPoint,\r
+  OUT VOID                      **Thunk\r
+  );\r
+\r
+/**\r
+  Perform any cleanup necessary when an image is unloaded. Basically it gives\r
+  the EBC interpreter the chance to free up any resources allocated during\r
+  load and execution of an EBC image.\r
+\r
+  @param  This        protocol instance pointer\r
+  @param  ImageHandle the handle of the image being unloaded.\r
+\r
+  @return Standard EFI_STATUS.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_EBC_UNLOAD_IMAGE) (\r
+  IN EFI_EBC_PROTOCOL           *This,\r
+  IN EFI_HANDLE                 ImageHandle\r
+  );\r
+\r
+/**\r
+  The I-Cache-flush registration service takes a pointer to a function to\r
+  call to flush the I-Cache. Here's the prototype for that function pointer.\r
+\r
+  @param  Start  physical start address of CPU instruction cache to flush.\r
+  @param  Length how many bytes to flush of the instruction cache.\r
+\r
+  @return Standard EFI_STATUS.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EBC_ICACHE_FLUSH) (\r
+  IN EFI_PHYSICAL_ADDRESS     Start,\r
+  IN UINT64                   Length\r
+  );\r
+\r
+/**\r
+  This routine is called by the core firmware to provide the EBC driver with\r
+  a function to call to flush the CPU's instruction cache following creation\r
+  of a thunk. It is not required.\r
+\r
+  @param  This  protocol instance pointer\r
+  @param  Flush pointer to the function to call to flush the CPU instruction\r
+  cache.\r
+\r
+  @return Standard EFI_STATUS.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_EBC_REGISTER_ICACHE_FLUSH) (\r
+  IN EFI_EBC_PROTOCOL           *This,\r
+  IN EBC_ICACHE_FLUSH           Flush\r
+  );\r
+\r
+/**\r
+  This routine can be called to get the VM revision. It returns the same\r
+  value as the EBC BREAK 1 instruction returns.\r
+\r
+  @param  This    protocol instance pointer\r
+  @param  Version pointer to where to return the VM version\r
+\r
+  @return Standard EFI_STATUS.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_EBC_GET_VERSION) (\r
+  IN EFI_EBC_PROTOCOL           *This,\r
+  IN OUT UINT64                 *Version\r
+  );\r
+\r
+//\r
+// Prototype for the actual EBC protocol interface\r
+//\r
+struct _EFI_EBC_PROTOCOL {\r
+  EFI_EBC_CREATE_THUNK          CreateThunk;\r
+  EFI_EBC_UNLOAD_IMAGE          UnloadImage;\r
+  EFI_EBC_REGISTER_ICACHE_FLUSH RegisterICacheFlush;\r
+  EFI_EBC_GET_VERSION           GetVersion;\r
+};\r
+\r
+//\r
+// Extern the global EBC protocol GUID\r
+//\r
+extern EFI_GUID gEfiEbcProtocolGuid;\r
+\r
+#endif\r
diff --git a/Tools/Source/TianoTools/Include/Protocol/EdidActive.h b/Tools/Source/TianoTools/Include/Protocol/EdidActive.h
new file mode 100644 (file)
index 0000000..0562cbe
--- /dev/null
@@ -0,0 +1,34 @@
+/** @file\r
+  EDID Active Protocol from the UEFI 2.0 specification.\r
+\r
+  Placed on the video output device child handle that are actively displaying output.\r
+\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. This program and the accompanying materials                          \r
+  are licensed and made available under the terms and conditions of the BSD License         \r
+  which accompanies this distribution.  The full text of the license may be found at        \r
+  http://opensource.org/licenses/bsd-license.php                                            \r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+  Module Name:  EdidActive.h\r
+\r
+**/\r
+\r
+#ifndef __EDID_ACTIVE_H__\r
+#define __EDID_ACTIVE_H__\r
+\r
+#define EFI_EDID_ACTIVE_PROTOCOL_GUID \\r
+  { \\r
+    0xbd8c1056, 0x9f36, 0x44ec, {0x92, 0xa8, 0xa6, 0x33, 0x7f, 0x81, 0x79, 0x86 } \\r
+  }\r
+\r
+typedef struct {\r
+  UINT32   SizeOfEdid;\r
+  UINT8    *Edid;\r
+} EFI_EDID_ACTIVE_PROTOCOL;\r
+\r
+extern EFI_GUID gEfiEdidActiveProtocolGuid;\r
+\r
+#endif\r
diff --git a/Tools/Source/TianoTools/Include/Protocol/EdidDiscovered.h b/Tools/Source/TianoTools/Include/Protocol/EdidDiscovered.h
new file mode 100644 (file)
index 0000000..6790666
--- /dev/null
@@ -0,0 +1,35 @@
+/** @file\r
+  EDID Discovered Protocol from the UEFI 2.0 specification.\r
+\r
+  This protocol is placed on the video output device child handle and it represents\r
+  the EDID information being used for output device represented by the child handle.\r
+\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. This program and the accompanying materials                          \r
+  are licensed and made available under the terms and conditions of the BSD License         \r
+  which accompanies this distribution.  The full text of the license may be found at        \r
+  http://opensource.org/licenses/bsd-license.php                                            \r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+  Module Name:  EdidDiscovered.h\r
+\r
+**/\r
+\r
+#ifndef __EDID_DISCOVERED_H__\r
+#define __EDID_DISCOVERED_H__\r
+\r
+#define EFI_EDID_DISCOVERED_PROTOCOL_GUID \\r
+  { \\r
+    0x1c0c34f6, 0xd380, 0x41fa, {0xa0, 0x49, 0x8a, 0xd0, 0x6c, 0x1a, 0x66, 0xaa } \\r
+  }\r
+\r
+typedef struct {\r
+  UINT32   SizeOfEdid;\r
+  UINT8    *Edid;\r
+} EFI_EDID_DISCOVERED_PROTOCOL;\r
+\r
+extern EFI_GUID gEfiEdidDiscoveredProtocolGuid;\r
+\r
+#endif\r
diff --git a/Tools/Source/TianoTools/Include/Protocol/EdidOverride.h b/Tools/Source/TianoTools/Include/Protocol/EdidOverride.h
new file mode 100644 (file)
index 0000000..3f4c576
--- /dev/null
@@ -0,0 +1,66 @@
+/** @file\r
+  EDID Override Protocol from the UEFI 2.0 specification.\r
+\r
+  Allow platform to provide EDID information to producer of the Graphics Output\r
+  protocol.\r
+\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. This program and the accompanying materials                          \r
+  are licensed and made available under the terms and conditions of the BSD License         \r
+  which accompanies this distribution.  The full text of the license may be found at        \r
+  http://opensource.org/licenses/bsd-license.php                                            \r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+  Module Name:  EdidOverride.h\r
+\r
+**/\r
+\r
+#ifndef __EDID_OVERRIDE_H__\r
+#define __EDID_OVERRIDE_H__\r
+\r
+#define EFI_EDID_OVERRIDE_PROTOCOL_GUID \\r
+  { \\r
+    0x48ecb431, 0xfb72, 0x45c0, {0xa9, 0x22, 0xf4, 0x58, 0xfe, 0x4, 0xb, 0xd5 } \\r
+  }\r
+\r
+typedef struct _EFI_EDID_OVERRIDE_PROTOCOL EFI_EDID_OVERRIDE_PROTOCOL;\r
+\r
+#define EFI_EDID_OVERRIDE_DONT_OVERRIDE   0x01\r
+#define EFI_EDID_OVERRIDE_ENABLE_HOT_PLUG 0x02\r
+\r
+/**\r
+  Return the current video mode information.\r
+\r
+  @param  This              Protocol instance pointer.\r
+  @param  ChildHandle       A child handle produced by the Graphics Output EFI\r
+                            driver that represents a video output device.\r
+  @param  Attributes        The attributes associated with ChildHandle video output device.\r
+  @param  EdidSize          A pointer to the size, in bytes, of the Edid buffer.\r
+  @param  Edid              A pointer to callee allocated buffer that contains the EDID that\r
+                            should be used for ChildHandle. A value of NULL\r
+                            represents no EDID override for ChildHandle.\r
+\r
+  @retval EFI_SUCCESS       Valid overrides returned for ChildHandle.\r
+  @retval EFI_UNSUPPORTED   ChildHandle has no overrides.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_EDID_OVERRIDE_PROTOCOL_GET_EDID) (\r
+  IN  EFI_EDID_OVERRIDE_PROTOCOL          *This,\r
+  IN  EFI_HANDLE                          *ChildHandle,\r
+  OUT UINT32                              *Attributes,\r
+  IN OUT UINTN                            *EdidSize,\r
+  IN OUT UINT8                            **Edid\r
+  )\r
+;\r
+\r
+struct _EFI_EDID_OVERRIDE_PROTOCOL {\r
+  EFI_EDID_OVERRIDE_PROTOCOL_GET_EDID   GetEdid;\r
+};\r
+                                             \r
+extern EFI_GUID gEfiEdidOverrideProtocolGuid;\r
+\r
+#endif\r
diff --git a/Tools/Source/TianoTools/Include/Protocol/EfiNetworkInterfaceIdentifier.h b/Tools/Source/TianoTools/Include/Protocol/EfiNetworkInterfaceIdentifier.h
new file mode 100644 (file)
index 0000000..98f1c59
--- /dev/null
@@ -0,0 +1,92 @@
+/** @file\r
+  Revision history:\r
+\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. This program and the accompanying materials                          \r
+  are licensed and made available under the terms and conditions of the BSD License         \r
+  which accompanies this distribution.  The full text of the license may be found at        \r
+  http://opensource.org/licenses/bsd-license.php                                            \r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+  Module name:\r
+\r
+  EfiNetworkInterfaceIdentifier.h\r
+\r
+**/\r
+\r
+#ifndef __EFI_NETWORK_INTERFACE_IDENTIFER_H__\r
+#define __EFI_NETWORK_INTERFACE_IDENTIFER_H__\r
+\r
+\r
+#define EFI_NETWORK_INTERFACE_IDENTIFIER_PROTOCOL_GUID \\r
+  { \\r
+    0xE18541CD, 0xF755, 0x4f73, {0x92, 0x8D, 0x64, 0x3C, 0x8A, 0x79, 0xB2, 0x29 } \\r
+  }\r
+\r
+#define EFI_NETWORK_INTERFACE_IDENTIFIER_PROTOCOL_REVISION    0x00010000\r
+\r
+//\r
+// Forward reference for pure ANSI compatability\r
+//\r
+typedef struct _EFI_NETWORK_INTERFACE_IDENTIFIER_PROTOCOL  EFI_NETWORK_INTERFACE_IDENTIFIER_PROTOCOL;\r
+\r
+typedef enum {\r
+  EfiNetworkInterfaceUndi = 1\r
+} EFI_NETWORK_PROTOCOL_TYPE;\r
+\r
+struct _EFI_NETWORK_INTERFACE_IDENTIFIER_PROTOCOL {\r
+\r
+  UINT64  Revision;\r
+  //\r
+  // Revision of the network interface identifier protocol interface.\r
+  //\r
+  UINT64  ID;\r
+  //\r
+  // Address of the first byte of the identifying structure for this\r
+  // network interface.  This is set to zero if there is no structure.\r
+  //\r
+  // For PXE/UNDI this is the first byte of the !PXE structure.\r
+  //\r
+  UINT64  ImageAddr;\r
+  //\r
+  // Address of the UNrelocated driver/ROM image.  This is set\r
+  // to zero if there is no driver/ROM image.\r
+  //\r
+  // For 16-bit UNDI, this is the first byte of the option ROM in\r
+  // upper memory.\r
+  //\r
+  // For 32/64-bit S/W UNDI, this is the first byte of the EFI ROM\r
+  // image.\r
+  //\r
+  // For H/W UNDI, this is set to zero.\r
+  //\r
+  UINT32  ImageSize;\r
+  //\r
+  // Size of the UNrelocated driver/ROM image of this network interface.\r
+  // This is set to zero if there is no driver/ROM image.\r
+  //\r
+  CHAR8   StringId[4];\r
+  //\r
+  // 4 char ASCII string to go in class identifier (option 60) in DHCP\r
+  // and Boot Server discover packets.\r
+  // For EfiNetworkInterfaceUndi this field is "UNDI".\r
+  // For EfiNetworkInterfaceSnp this field is "SNPN".\r
+  //\r
+  UINT8   Type;\r
+  UINT8   MajorVer;\r
+  UINT8   MinorVer;\r
+  //\r
+  // Information to be placed into the PXE DHCP and Discover packets.\r
+  // This is the network interface type and version number that will\r
+  // be placed into DHCP option 94 (client network interface identifier).\r
+  //\r
+  BOOLEAN Ipv6Supported;\r
+  UINT8   IfNum;  // interface number to be used with pxeid structure\r
+};\r
+\r
+extern EFI_GUID gEfiNetworkInterfaceIdentifierProtocolGuid;\r
+extern EFI_GUID gEfiNetworkInterfaceIdentifierProtocolGuid_31;\r
+\r
+#endif // _EFI_NII_H\r
diff --git a/Tools/Source/TianoTools/Include/Protocol/FileInfo.h b/Tools/Source/TianoTools/Include/Protocol/FileInfo.h
new file mode 100644 (file)
index 0000000..55cf6ae
--- /dev/null
@@ -0,0 +1,53 @@
+/** @file\r
+  SimpleFileSystem protocol as defined in the EFI 1.0 specification.\r
+\r
+  The SimpleFileSystem protocol is the programatic access to the FAT (12,16,32) \r
+  file system specified in EFI 1.0. It can also be used to abstract any \r
+  file system other than FAT.\r
+\r
+  EFI 1.0 can boot from any valid EFI image contained in a SimpleFileSystem\r
+\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. This program and the accompanying materials                          \r
+  are licensed and made available under the terms and conditions of the BSD License         \r
+  which accompanies this distribution.  The full text of the license may be found at        \r
+  http://opensource.org/licenses/bsd-license.php                                            \r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+  Module Name:  FileInfo.c\r
+\r
+**/\r
+\r
+#ifndef __FILE_INFO_H__\r
+#define __FILE_INFO_H__\r
+\r
+#define EFI_FILE_INFO_ID \\r
+  { \\r
+    0x9576e92, 0x6d3f, 0x11d2, {0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b } \\r
+  }\r
+\r
+typedef struct {\r
+  UINT64    Size;\r
+  UINT64    FileSize;\r
+  UINT64    PhysicalSize;\r
+  EFI_TIME  CreateTime;\r
+  EFI_TIME  LastAccessTime;\r
+  EFI_TIME  ModificationTime;\r
+  UINT64    Attribute;\r
+  CHAR16    FileName[1];\r
+} EFI_FILE_INFO;\r
+\r
+//\r
+// The FileName field of the EFI_FILE_INFO data structure is variable length.\r
+// Whenever code needs to know the size of the EFI_FILE_INFO data structure, it needs to\r
+// be the size of the data structure without the FileName field.  The following macro\r
+// computes this size correctly no matter how big the FileName array is declared.\r
+// This is required to make the EFI_FILE_INFO data structure ANSI compilant.\r
+//\r
+#define SIZE_OF_EFI_FILE_INFO EFI_FIELD_OFFSET (EFI_FILE_INFO, FileName)\r
+\r
+extern EFI_GUID gEfiFileInfoGuid;\r
+\r
+#endif\r
diff --git a/Tools/Source/TianoTools/Include/Protocol/FileSystemInfo.h b/Tools/Source/TianoTools/Include/Protocol/FileSystemInfo.h
new file mode 100644 (file)
index 0000000..f6e7488
--- /dev/null
@@ -0,0 +1,45 @@
+/** @file\r
+  FileSystemInfo protocol as defined in the EFI 1.0 specification.\r
+\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. This program and the accompanying materials                          \r
+  are licensed and made available under the terms and conditions of the BSD License         \r
+  which accompanies this distribution.  The full text of the license may be found at        \r
+  http://opensource.org/licenses/bsd-license.php                                            \r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+  Module Name:  FileSystemInfo.h\r
+\r
+**/\r
+\r
+#ifndef __FILE_SYSTEM_INFO_H__\r
+#define __FILE_SYSTEM_INFO_H__\r
+\r
+#define EFI_FILE_SYSTEM_INFO_ID_GUID \\r
+  { \\r
+    0x9576e93, 0x6d3f, 0x11d2, {0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b } \\r
+  }\r
+\r
+typedef struct {\r
+  UINT64  Size;\r
+  BOOLEAN ReadOnly;\r
+  UINT64  VolumeSize;\r
+  UINT64  FreeSpace;\r
+  UINT32  BlockSize;\r
+  CHAR16  VolumeLabel[1];\r
+} EFI_FILE_SYSTEM_INFO;\r
+\r
+//\r
+// The VolumeLabel field of the EFI_FILE_SYSTEM_INFO data structure is variable length.\r
+// Whenever code needs to know the size of the EFI_FILE_SYSTEM_INFO data structure, it needs\r
+// to be the size of the data structure without the VolumeLable field.  The following macro\r
+// computes this size correctly no matter how big the VolumeLable array is declared.\r
+// This is required to make the EFI_FILE_SYSTEM_INFO data structure ANSI compilant.\r
+//\r
+#define SIZE_OF_EFI_FILE_SYSTEM_INFO  EFI_FIELD_OFFSET (EFI_FILE_SYSTEM_INFO, VolumeLabel)\r
+\r
+extern EFI_GUID gEfiFileSystemInfoGuid;\r
+\r
+#endif\r
diff --git a/Tools/Source/TianoTools/Include/Protocol/FileSystemVolumeLabelInfo.h b/Tools/Source/TianoTools/Include/Protocol/FileSystemVolumeLabelInfo.h
new file mode 100644 (file)
index 0000000..baba276
--- /dev/null
@@ -0,0 +1,42 @@
+/** @file\r
+  FileSystemVolumeLabelInfo protocol as defined in the EFI 1.0 specification.\r
+\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. This program and the accompanying materials                          \r
+  are licensed and made available under the terms and conditions of the BSD License         \r
+  which accompanies this distribution.  The full text of the license may be found at        \r
+  http://opensource.org/licenses/bsd-license.php                                            \r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+  Module Name:  FileSystemVolumeLabelInfo.h\r
+\r
+**/\r
+\r
+#ifndef __FILE_SYSTEM_VOLUME_LABEL_INFO_H__\r
+#define __FILE_SYSTEM_VOLUME_LABEL_INFO_H__\r
+\r
+#define EFI_FILE_SYSTEM_VOLUME_LABEL_INFO_ID_GUID \\r
+  { \\r
+    0xDB47D7D3, 0xFE81, 0x11d3, {0x9A, 0x35, 0x00, 0x90, 0x27, 0x3F, 0xC1, 0x4D } \\r
+  }\r
+\r
+//\r
+// Protocol Name defined in spec.\r
+//\r
+#define EFI_FILE_SYSTEM_VOLUME_LABEL_ID \\r
+        EFI_FILE_SYSTEM_VOLUME_LABEL_INFO_ID_GUID\r
+\r
+typedef struct {\r
+  CHAR16  VolumeLabel[1];\r
+} EFI_FILE_SYSTEM_VOLUME_LABEL_INFO;\r
+\r
+typedef EFI_FILE_SYSTEM_VOLUME_LABEL_INFO EFI_FILE_SYSTEM_VOLUME_LABEL;\r
+\r
+#define SIZE_OF_EFI_FILE_SYSTEM_VOLUME_LABEL_INFO \\r
+        EFI_FIELD_OFFSET (EFI_FILE_SYSTEM_VOLUME_LABEL_INFO, VolumeLabel)\r
+\r
+extern EFI_GUID gEfiFileSystemVolumeLabelInfoIdGuid;\r
+\r
+#endif\r
diff --git a/Tools/Source/TianoTools/Include/Protocol/FirmwareVolume.h b/Tools/Source/TianoTools/Include/Protocol/FirmwareVolume.h
new file mode 100644 (file)
index 0000000..7f86dbb
--- /dev/null
@@ -0,0 +1,321 @@
+/** @file\r
+  This file declares Firmware Volume protocol.\r
+\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. This program and the accompanying materials                          \r
+  are licensed and made available under the terms and conditions of the BSD License         \r
+  which accompanies this distribution.  The full text of the license may be found at        \r
+  http://opensource.org/licenses/bsd-license.php                                            \r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+  Module Name:  FirmwareVolume.h\r
+\r
+  @par Revision Reference:\r
+  This protocol is defined in Firmware Volume specification.\r
+  Version 0.9\r
+\r
+**/\r
+\r
+#ifndef __FIRMWARE_VOLUME_H__\r
+#define __FIRMWARE_VOLUME_H__\r
+\r
+\r
+//\r
+// Firmware Volume Protocol GUID definition\r
+//\r
+#define EFI_FIRMWARE_VOLUME_PROTOCOL_GUID \\r
+  { \\r
+    0x389F751F, 0x1838, 0x4388, {0x83, 0x90, 0xCD, 0x81, 0x54, 0xBD, 0x27, 0xF8 } \\r
+  }\r
+\r
+#define FV_DEVICE_SIGNATURE EFI_SIGNATURE_32 ('_', 'F', 'V', '_')\r
+\r
+typedef struct _EFI_FIRMWARE_VOLUME_PROTOCOL  EFI_FIRMWARE_VOLUME_PROTOCOL;\r
+\r
+//\r
+// EFI_FV_ATTRIBUTES bit definitions\r
+//\r
+typedef UINT64  EFI_FV_ATTRIBUTES;\r
+\r
+//\r
+// ************************************************************\r
+// EFI_FV_ATTRIBUTES bit definitions\r
+// ************************************************************\r
+//\r
+#define EFI_FV_READ_DISABLE_CAP       0x0000000000000001ULL\r
+#define EFI_FV_READ_ENABLE_CAP        0x0000000000000002ULL\r
+#define EFI_FV_READ_STATUS            0x0000000000000004ULL\r
+\r
+#define EFI_FV_WRITE_DISABLE_CAP      0x0000000000000008ULL\r
+#define EFI_FV_WRITE_ENABLE_CAP       0x0000000000000010ULL\r
+#define EFI_FV_WRITE_STATUS           0x0000000000000020ULL\r
+\r
+#define EFI_FV_LOCK_CAP               0x0000000000000040ULL\r
+#define EFI_FV_LOCK_STATUS            0x0000000000000080ULL\r
+#define EFI_FV_WRITE_POLICY_RELIABLE  0x0000000000000100ULL\r
+\r
+#define EFI_FV_ALIGNMENT_CAP          0x0000000000008000ULL\r
+#define EFI_FV_ALIGNMENT_2            0x0000000000010000ULL\r
+#define EFI_FV_ALIGNMENT_4            0x0000000000020000ULL\r
+#define EFI_FV_ALIGNMENT_8            0x0000000000040000ULL\r
+#define EFI_FV_ALIGNMENT_16           0x0000000000080000ULL\r
+#define EFI_FV_ALIGNMENT_32           0x0000000000100000ULL\r
+#define EFI_FV_ALIGNMENT_64           0x0000000000200000ULL\r
+#define EFI_FV_ALIGNMENT_128          0x0000000000400000ULL\r
+#define EFI_FV_ALIGNMENT_256          0x0000000000800000ULL\r
+#define EFI_FV_ALIGNMENT_512          0x0000000001000000ULL\r
+#define EFI_FV_ALIGNMENT_1K           0x0000000002000000ULL\r
+#define EFI_FV_ALIGNMENT_2K           0x0000000004000000ULL\r
+#define EFI_FV_ALIGNMENT_4K           0x0000000008000000ULL\r
+#define EFI_FV_ALIGNMENT_8K           0x0000000010000000ULL\r
+#define EFI_FV_ALIGNMENT_16K          0x0000000020000000ULL\r
+#define EFI_FV_ALIGNMENT_32K          0x0000000040000000ULL\r
+#define EFI_FV_ALIGNMENT_64K          0x0000000080000000ULL\r
+\r
+//\r
+// Protocol API definitions\r
+//\r
+\r
+/**\r
+  Retrieves attributes, insures positive polarity of attribute bits, returns\r
+  resulting attributes in output parameter\r
+\r
+  @param  This Calling context\r
+  @param  Attributes output buffer which contains attributes\r
+\r
+  @retval EFI_INVALID_PARAMETER\r
+  @retval EFI_SUCCESS\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_FV_GET_ATTRIBUTES) (\r
+  IN  EFI_FIRMWARE_VOLUME_PROTOCOL  *This,\r
+  OUT EFI_FV_ATTRIBUTES             *Attributes\r
+  );\r
+\r
+/**\r
+  Sets volume attributes\r
+\r
+  @param  This Calling context\r
+  @param  Attributes Buffer which contains attributes\r
+\r
+  @retval EFI_INVALID_PARAMETER\r
+  @retval EFI_DEVICE_ERROR\r
+  @retval EFI_SUCCESS\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_FV_SET_ATTRIBUTES) (\r
+  IN EFI_FIRMWARE_VOLUME_PROTOCOL   *This,\r
+  IN OUT EFI_FV_ATTRIBUTES          *Attributes\r
+  );\r
+\r
+typedef UINT32  EFI_FV_FILE_ATTRIBUTES;\r
+\r
+#define EFI_FV_FILE_ATTRIB_ALIGNMENT  0x0000001F\r
+\r
+/**\r
+  Read the requested file (NameGuid) and returns data in Buffer.\r
+\r
+  @param  This Calling context\r
+  @param  NameGuid Filename identifying which file to read\r
+  @param  Buffer Pointer to pointer to buffer in which contents of file are returned.\r
+  <br>\r
+  If Buffer is NULL, only type, attributes, and size are returned as\r
+  there is no output buffer.\r
+  <br>\r
+  If Buffer != NULL and *Buffer == NULL, the output buffer is allocated\r
+  from BS pool by ReadFile\r
+  <br>\r
+  If Buffer != NULL and *Buffer != NULL, the output buffer has been\r
+  allocated by the caller and is being passed in.\r
+  \r
+  @param  BufferSize Indicates the buffer size passed in, and on output the size\r
+  required to complete the read\r
+  @param  FoundType Indicates the type of the file who's data is returned\r
+  @param  FileAttributes Indicates the attributes of the file who's data is resturned\r
+  @param  AuthenticationStatus Indicates the authentication status of the data\r
+\r
+  @retval EFI_SUCCESS\r
+  @retval EFI_WARN_BUFFER_TOO_SMALL\r
+  @retval EFI_NOT_FOUND\r
+  @retval EFI_DEVICE_ERROR\r
+  @retval EFI_ACCESS_DENIED\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_FV_READ_FILE) (\r
+  IN EFI_FIRMWARE_VOLUME_PROTOCOL   *This,\r
+  IN EFI_GUID                       *NameGuid,\r
+  IN OUT VOID                       **Buffer,\r
+  IN OUT UINTN                      *BufferSize,\r
+  OUT EFI_FV_FILETYPE               *FoundType,\r
+  OUT EFI_FV_FILE_ATTRIBUTES        *FileAttributes,\r
+  OUT UINT32                        *AuthenticationStatus\r
+  );\r
+\r
+/**\r
+  Read the requested section from the specified file and returns data in Buffer.\r
+\r
+  @param  This Calling context\r
+  @param  NameGuid Filename identifying the file from which to read\r
+  @param  SectionType Indicates what section type to retrieve\r
+  @param  SectionInstance Indicates which instance of SectionType to retrieve\r
+  @param  Buffer Pointer to pointer to buffer in which contents of file are returned.\r
+  <br>\r
+  If Buffer is NULL, only type, attributes, and size are returned as\r
+  there is no output buffer.\r
+  <br>\r
+  If Buffer != NULL and *Buffer == NULL, the output buffer is allocated\r
+  from BS pool by ReadFile\r
+  <br>\r
+  If Buffer != NULL and *Buffer != NULL, the output buffer has been\r
+  allocated by the caller and is being passed in.\r
+  \r
+  @param  BufferSize Indicates the buffer size passed in, and on output the size\r
+  required to complete the read\r
+  @param  AuthenticationStatus Indicates the authentication status of the data\r
+\r
+  @retval EFI_SUCCESS\r
+  @retval EFI_WARN_BUFFER_TOO_SMALL\r
+  @retval EFI_OUT_OF_RESOURCES\r
+  @retval EFI_NOT_FOUND\r
+  @retval EFI_DEVICE_ERROR\r
+  @retval EFI_ACCESS_DENIED\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_FV_READ_SECTION) (\r
+  IN EFI_FIRMWARE_VOLUME_PROTOCOL   *This,\r
+  IN EFI_GUID                       *NameGuid,\r
+  IN EFI_SECTION_TYPE               SectionType,\r
+  IN UINTN                          SectionInstance,\r
+  IN OUT VOID                       **Buffer,\r
+  IN OUT UINTN                      *BufferSize,\r
+  OUT UINT32                        *AuthenticationStatus\r
+  );\r
+\r
+typedef UINT32  EFI_FV_WRITE_POLICY;\r
+\r
+#define EFI_FV_UNRELIABLE_WRITE 0x00000000\r
+#define EFI_FV_RELIABLE_WRITE   0x00000001\r
+\r
+typedef struct {\r
+  EFI_GUID                *NameGuid;\r
+  EFI_FV_FILETYPE         Type;\r
+  EFI_FV_FILE_ATTRIBUTES  FileAttributes;\r
+  VOID                    *Buffer;\r
+  UINT32                  BufferSize;\r
+} EFI_FV_WRITE_FILE_DATA;\r
+\r
+/**\r
+  Write the supplied file (NameGuid) to the FV.\r
+\r
+  @param  This Calling context\r
+  @param  NumberOfFiles Indicates the number of file records pointed to by FileData\r
+  @param  WritePolicy Indicates the level of reliability of the write with respect to\r
+  things like power failure events.\r
+  @param  FileData A pointer to an array of EFI_FV_WRITE_FILE_DATA structures.  Each\r
+  element in the array indicates a file to write, and there are\r
+  NumberOfFiles elements in the input array.\r
+\r
+  @retval EFI_SUCCESS\r
+  @retval EFI_OUT_OF_RESOURCES\r
+  @retval EFI_DEVICE_ERROR\r
+  @retval EFI_WRITE_PROTECTED\r
+  @retval EFI_NOT_FOUND\r
+  @retval EFI_INVALID_PARAMETER\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_FV_WRITE_FILE) (\r
+  IN EFI_FIRMWARE_VOLUME_PROTOCOL   *This,\r
+  IN UINT32                         NumberOfFiles,\r
+  IN EFI_FV_WRITE_POLICY            WritePolicy,\r
+  IN EFI_FV_WRITE_FILE_DATA         *FileData\r
+  );\r
+\r
+/**\r
+  Given the input key, search for the next matching file in the volume.\r
+\r
+  @param  This Calling context\r
+  @param  Key Pointer to a caller allocated buffer that contains an implementation\r
+  specific key that is used to track where to begin searching on\r
+  successive calls.\r
+  @param  FileType Indicates the file type to filter for\r
+  @param  NameGuid Guid filename of the file found\r
+  @param  Attributes Attributes of the file found\r
+  @param  Size Size in bytes of the file found\r
+\r
+  @retval EFI_SUCCESS\r
+  @retval EFI_NOT_FOUND\r
+  @retval EFI_DEVICE_ERROR\r
+  @retval EFI_ACCESS_DENIED\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_FV_GET_NEXT_FILE) (\r
+  IN EFI_FIRMWARE_VOLUME_PROTOCOL   *This,\r
+  IN OUT VOID                       *Key,\r
+  IN OUT EFI_FV_FILETYPE            *FileType,\r
+  OUT EFI_GUID                      *NameGuid,\r
+  OUT EFI_FV_FILE_ATTRIBUTES        *Attributes,\r
+  OUT UINTN                         *Size\r
+  );\r
+\r
+/**\r
+  @par Protocol Description:\r
+  The Firmware Volume Protocol provides file-level access to the firmware volume.\r
+  Each firmware volume driver must produce an instance of the Firmware Volume \r
+  Protocol if the firmware volume is to be visible to the system. The Firmware \r
+  Volume Protocol also provides mechanisms for determining and modifying some \r
+  attributes of the firmware volume.  \r
+\r
+  @param GetVolumeAttributes\r
+  Retrieves volume capabilities and current settings. \r
+\r
+  @param SetVolumeAttributes\r
+  Modifies the current settings of the firmware volume.\r
+\r
+  @param ReadFile\r
+  Reads an entire file from the firmware volume. \r
+\r
+  @param ReadSection\r
+  Reads a single section from a file into a buffer.\r
+\r
+  @param WriteFile\r
+  Writes an entire file into the firmware volume.\r
+\r
+  @param GetNextFile\r
+  Provides service to allow searching the firmware volume.\r
+\r
+  @param KeySize\r
+  Data field that indicates the size in bytes of the Key input buffer for \r
+  the GetNextFile() API. \r
+\r
+  @param ParentHandle\r
+  Handle of the parent firmware volume.\r
+\r
+**/\r
+struct _EFI_FIRMWARE_VOLUME_PROTOCOL {\r
+  EFI_FV_GET_ATTRIBUTES GetVolumeAttributes;\r
+  EFI_FV_SET_ATTRIBUTES SetVolumeAttributes;\r
+  EFI_FV_READ_FILE      ReadFile;\r
+  EFI_FV_READ_SECTION   ReadSection;\r
+  EFI_FV_WRITE_FILE     WriteFile;\r
+  EFI_FV_GET_NEXT_FILE  GetNextFile;\r
+  UINT32                KeySize;\r
+  EFI_HANDLE            ParentHandle;\r
+};\r
+\r
+extern EFI_GUID gEfiFirmwareVolumeProtocolGuid;\r
+\r
+#endif\r
diff --git a/Tools/Source/TianoTools/Include/Protocol/FirmwareVolumeBlock.h b/Tools/Source/TianoTools/Include/Protocol/FirmwareVolumeBlock.h
new file mode 100644 (file)
index 0000000..ee849a1
--- /dev/null
@@ -0,0 +1,251 @@
+/** @file\r
+  This file declares Firmware Volume Block protocol.\r
+\r
+  Low level firmware device access routines to abstract firmware device\r
+  hardware.\r
+\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. This program and the accompanying materials                          \r
+  are licensed and made available under the terms and conditions of the BSD License         \r
+  which accompanies this distribution.  The full text of the license may be found at        \r
+  http://opensource.org/licenses/bsd-license.php                                            \r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+  Module Name:  FirmwareVolumeBlock.h\r
+\r
+  @par Revision Reference:\r
+  This protocol is defined in Framework of EFI Firmware Volume Block specification.\r
+  Version 0.9\r
+\r
+**/\r
+\r
+#ifndef __FIRMWARE_VOLUME_BLOCK_H__\r
+#define __FIRMWARE_VOLUME_BLOCK_H__\r
+\r
+\r
+#define EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL_GUID \\r
+  { \\r
+    0xDE28BC59, 0x6228, 0x41BD, {0xBD, 0xF6, 0xA3, 0xB9, 0xAD, 0xB5, 0x8D, 0xA1 } \\r
+  }\r
+\r
+typedef struct _EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL  EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL;\r
+\r
+/**\r
+  Retrieves Volume attributes.  No polarity translations are done.\r
+\r
+  @param  This Calling context\r
+  @param  Attributes output buffer which contains attributes\r
+\r
+  @retval EFI_INVALID_PARAMETER\r
+  @retval EFI_SUCCESS\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_FVB_GET_ATTRIBUTES) (\r
+  IN EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL           *This,\r
+  OUT EFI_FVB_ATTRIBUTES                          *Attributes\r
+  )\r
+;\r
+\r
+/**\r
+  Sets Volume attributes.  No polarity translations are done.\r
+\r
+  @param  This Calling context\r
+  @param  Attributes On input: contains new attributes\r
+  On output: contains current attributes of FV\r
+\r
+  @retval EFI_INVALID_PARAMETER\r
+  @retval EFI_SUCCESS\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_FVB_SET_ATTRIBUTES) (\r
+  IN EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL           *This,\r
+  IN OUT EFI_FVB_ATTRIBUTES                       *Attributes\r
+  )\r
+;\r
+\r
+/**\r
+  Retrieves the physical address of a memory mapped FV.\r
+\r
+  @param  This Calling context\r
+  @param  Attributes Address is a pointer to a caller allocated EFI_PHYSICAL_ADDRESS\r
+  that on successful return from GetPhysicalAddress() contains the\r
+  base address of the firmware volume.\r
+\r
+  @retval EFI_UNSUPPORTED\r
+  @retval EFI_SUCCESS\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_FVB_GET_PHYSICAL_ADDRESS) (\r
+  IN EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL           *This,\r
+  OUT EFI_PHYSICAL_ADDRESS                        *Address\r
+  )\r
+;\r
+\r
+/**\r
+  Retrieves the size in bytes of a specific block within an FV.\r
+\r
+  @param  This Calling context.\r
+  @param  Lba Indicates which block to return the size for.\r
+  @param  BlockSize BlockSize is a pointer to a caller allocated\r
+  UINTN in which the size of the block is returned.\r
+  @param  NumberOfBlocks NumberOfBlocks is a pointer to a caller allocated\r
+  UINTN in which the number of consecutive blocks\r
+  starting with Lba is returned. All blocks in this\r
+  range have a size of BlockSize.\r
+\r
+  @retval EFI_INVALID_PARAMETER\r
+  @retval EFI_SUCCESS\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_FVB_GET_BLOCK_SIZE) (\r
+  IN EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL           *This,\r
+  IN EFI_LBA                                      Lba,\r
+  OUT UINTN                                       *BlockSize,\r
+  OUT UINTN                                       *NumberOfBlocks\r
+  )\r
+;\r
+\r
+/**\r
+  Reads data beginning at Lba:Offset from FV and places the data in Buffer.\r
+  The read terminates either when *NumBytes of data have been read, or when\r
+  a block boundary is reached.  *NumBytes is updated to reflect the actual\r
+  number of bytes read.\r
+\r
+  @param  This Calling context\r
+  @param  Lba Block in which to begin read\r
+  @param  Offset Offset in the block at which to begin read\r
+  @param  NumBytes At input, indicates the requested read size.  At output, indicates\r
+  the actual number of bytes read.\r
+  @param  Buffer Data buffer in which to place data read.\r
+\r
+  @retval EFI_INVALID_PARAMETER\r
+  @retval EFI_NOT_FOUND\r
+  @retval EFI_DEVICE_ERROR\r
+  @retval EFI_SUCCESS\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_FVB_READ) (\r
+  IN EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL           *This,\r
+  IN EFI_LBA                                      Lba,\r
+  IN UINTN                                        Offset,\r
+  IN OUT UINTN                                    *NumBytes,\r
+  OUT UINT8                                       *Buffer\r
+  )\r
+;\r
+\r
+/**\r
+  Writes data beginning at Lba:Offset from FV. The write terminates either\r
+  when *NumBytes of data have been written, or when a block boundary is\r
+  reached.  *NumBytes is updated to reflect the actual number of bytes\r
+  written.\r
+\r
+  @param  This Calling context\r
+  @param  Lba Block in which to begin write\r
+  @param  Offset Offset in the block at which to begin write\r
+  @param  NumBytes At input, indicates the requested write size.  At output, indicates\r
+  the actual number of bytes written.\r
+  @param  Buffer Buffer containing source data for the write.\r
+\r
+  @retval EFI_INVALID_PARAMETER\r
+  @retval EFI_NOT_FOUND\r
+  @retval EFI_DEVICE_ERROR\r
+  @retval EFI_SUCCESS\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_FVB_WRITE) (\r
+  IN EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL           *This,\r
+  IN EFI_LBA                                      Lba,\r
+  IN UINTN                                        Offset,\r
+  IN OUT UINTN                                    *NumBytes,\r
+  IN UINT8                                        *Buffer\r
+  )\r
+;\r
+\r
+#define EFI_LBA_LIST_TERMINATOR 0xFFFFFFFFFFFFFFFFULL\r
+\r
+/**\r
+  The EraseBlock() function erases one or more blocks as denoted by the \r
+  variable argument list. The entire parameter list of blocks must be verified\r
+  prior to erasing any blocks.  If a block is requested that does not exist \r
+  within the associated firmware volume (it has a larger index than the last \r
+  block of the firmware volume), the EraseBlock() function must return\r
+  EFI_INVALID_PARAMETER without modifying the contents of the firmware volume.\r
+\r
+  @param  This Calling context\r
+  @param  ... Starting LBA followed by Number of Lba to erase. a -1 to terminate\r
+  the list.\r
+\r
+  @retval EFI_INVALID_PARAMETER\r
+  @retval EFI_DEVICE_ERROR\r
+  @retval EFI_SUCCESS\r
+  @retval EFI_ACCESS_DENIED\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_FVB_ERASE_BLOCKS) (\r
+  IN EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL           *This,\r
+  ...\r
+  )\r
+;\r
+\r
+/**\r
+  @par Protocol Description:\r
+  This protocol provides control over block-oriented firmware devices.  \r
+  Typically, the FFS (or an alternate file system) driver consumes the \r
+  Firmware Volume Block Protocol and produces the Firmware Volume Protocol. \r
+\r
+  @param GetAttributes\r
+  Retrieves the current volume attributes.\r
+\r
+  @param SetAttributes\r
+  Sets the current volume attributes. \r
+\r
+  @param GetPhysicalAddress\r
+  Retrieves the memory-mapped address of the firmware volume. \r
+\r
+  @param GetBlockSize\r
+  Retrieves the size for a specific block.\r
+\r
+  @param Read\r
+  Reads n bytes into a buffer from the firmware volume hardware.\r
+\r
+  @param Write\r
+  Writes n bytes from a buffer into the firmware volume hardware. \r
+\r
+  @param EraseBlocks\r
+  Erases specified block(s) and sets all values as indicated by \r
+  the EFI_FVB_ERASE_POLARITY bit.\r
+\r
+  @param ParentHandle\r
+  Handle of the parent firmware volume.\r
+\r
+**/\r
+struct _EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL {\r
+  EFI_FVB_GET_ATTRIBUTES        GetVolumeAttributes;\r
+  EFI_FVB_SET_ATTRIBUTES        SetVolumeAttributes;\r
+  EFI_FVB_GET_PHYSICAL_ADDRESS  GetPhysicalAddress;\r
+  EFI_FVB_GET_BLOCK_SIZE        GetBlockSize;\r
+  EFI_FVB_READ                  Read;\r
+  EFI_FVB_WRITE                 Write;\r
+  EFI_FVB_ERASE_BLOCKS          EraseBlocks;\r
+  EFI_HANDLE                    ParentHandle;\r
+};\r
+\r
+extern EFI_GUID gEfiFirmwareVolumeBlockProtocolGuid;\r
+\r
+#endif\r
diff --git a/Tools/Source/TianoTools/Include/Protocol/FirmwareVolumeDispatch.h b/Tools/Source/TianoTools/Include/Protocol/FirmwareVolumeDispatch.h
new file mode 100644 (file)
index 0000000..249a476
--- /dev/null
@@ -0,0 +1,33 @@
+/** @file\r
+  This file declares Firmware Volume Dispatch protocol.\r
+\r
+  Presence of this protocol tells the dispatch to dispatch from this Firmware \r
+  Volume\r
+\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. This program and the accompanying materials                          \r
+  are licensed and made available under the terms and conditions of the BSD License         \r
+  which accompanies this distribution.  The full text of the license may be found at        \r
+  http://opensource.org/licenses/bsd-license.php                                            \r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+  Module Name:  FirmwareVolumeDispatch.h\r
+\r
+  @par Revision Reference:\r
+  This protol will be defined in DXE CIS Spec.\r
+  Version 0.91C.\r
+\r
+**/\r
+\r
+#ifndef __FIRMWARE_VOLUME_DISPATCH_H__\r
+#define __FIRMWARE_VOLUME_DISPATCH_H__\r
+\r
+#define EFI_FIRMWARE_VOLUME_DISPATCH_PROTOCOL_GUID \\r
+  { 0x7aa35a69, 0x506c, 0x444f, {0xa7, 0xaf, 0x69, 0x4b, 0xf5, 0x6f, 0x71, 0xc8 } }\r
+\r
+\r
+extern EFI_GUID gEfiFirmwareVolumeDispatchProtocolGuid;\r
+\r
+#endif\r
diff --git a/Tools/Source/TianoTools/Include/Protocol/FormBrowser.h b/Tools/Source/TianoTools/Include/Protocol/FormBrowser.h
new file mode 100644 (file)
index 0000000..c0ee94a
--- /dev/null
@@ -0,0 +1,180 @@
+/** @file\r
+  The EFI_FORM_BROWSER_PROTOCOL is the interface to the EFI \r
+  Configuration Driver.  This will allow the caller to direct the \r
+  configuration driver to use either the HII database or use the passed \r
+  in packet of data.  This will also allow the caller to post messages \r
+  into the configuration drivers internal mailbox.\r
+\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. This program and the accompanying materials                          \r
+  are licensed and made available under the terms and conditions of the BSD License         \r
+  which accompanies this distribution.  The full text of the license may be found at        \r
+  http://opensource.org/licenses/bsd-license.php                                            \r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+  Module Name:  FormBrowser.h\r
+\r
+  @par Revision Reference:\r
+  This protocol is defined in HII spec 0.92.\r
+\r
+**/\r
+\r
+#ifndef __FORM_BROWSER_H__\r
+#define __FORM_BROWSER_H__\r
+\r
+\r
+#define EFI_FORM_BROWSER_PROTOCOL_GUID \\r
+  { \\r
+    0xe5a1333e, 0xe1b4, 0x4d55, {0xce, 0xeb, 0x35, 0xc3, 0xef, 0x13, 0x34, 0x43 } \\r
+  }\r
+\r
+typedef struct _EFI_FORM_BROWSER_PROTOCOL EFI_FORM_BROWSER_PROTOCOL;\r
+\r
+typedef struct {\r
+  UINT32  Length;\r
+  UINT16  Type;\r
+  UINT8   Data[1];\r
+} EFI_HII_PACKET;\r
+\r
+typedef struct {\r
+  EFI_HII_IFR_PACK    *IfrData;\r
+  EFI_HII_STRING_PACK *StringData;\r
+} EFI_IFR_PACKET;\r
+\r
+typedef struct {\r
+  UINTN LeftColumn;\r
+  UINTN RightColumn;\r
+  UINTN TopRow;\r
+  UINTN BottomRow;\r
+} EFI_SCREEN_DESCRIPTOR;\r
+\r
+/**\r
+  Provides direction to the configuration driver whether to use the HII \r
+  database or a passed-in set of data. This function also establishes a \r
+  pointer to the calling driver¡¯s callback interface. \r
+\r
+  @param  This A pointer to the EFI_FORM_BROWSER_PROTOCOL instance.\r
+  \r
+  @param  UseDatabase Determines whether the HII database is to be \r
+  used to gather information. If the value is FALSE, the configuration \r
+  driver will get the information provided in the passed-in Packet parameters.\r
+  \r
+  @param  Handle A pointer to an array of HII handles to display. This value \r
+  should correspond to the value of the HII form package that is required to \r
+  be displayed.\r
+  \r
+  @param  HandleCount The number of handles in the array specified by Handle.\r
+  \r
+  @param  Packet A pointer to a set of data containing pointers to IFR \r
+  and/or string data. \r
+  \r
+  @param  CallbackHandle The handle to the driver¡¯s callback interface. \r
+  This parameter is used only when the UseDatabase parameter is FALSE \r
+  and an application wants to register a callback with the browser\r
+  \r
+  @param  NvMapOverride This buffer is used only when there is no NV variable \r
+  to define the current settings and the caller needs to provide to the browser \r
+  the current settings for the "fake" NV variable.\r
+  \r
+  @param  ScreenDimensions Allows the browser to be called so that it occupies \r
+  a portion of the physical screen instead of dynamically determining the \r
+  screen dimensions. \r
+  \r
+  @param  ResetRequired This BOOLEAN value will tell the caller if a reset \r
+  is required based on the data that might have been changed. The ResetRequired \r
+  parameter is primarily applicable for configuration applications, and is an \r
+  optional parameter. \r
+\r
+  @retval EFI_SUCCESS The function completed successfully\r
+  \r
+  @retval EFI_NOT_FOUND The variable was not found.\r
+  \r
+  @retval EFI_BUFFER_TOO_SMALL The DataSize is too small for the result. \r
+  DataSize has been updated with the size needed to complete the request.\r
+  \r
+  @retval EFI_INVALID_PARAMETER One of the parameters has an invalid value.\r
+  \r
+  @retval EFI_DEVICE_ERROR The variable could not be saved due to a hardware failure. \r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_SEND_FORM) (\r
+  IN  EFI_FORM_BROWSER_PROTOCOL       *This,\r
+  IN  BOOLEAN                         UseDatabase,\r
+  IN  EFI_HII_HANDLE                  *Handle,\r
+  IN  UINTN                           HandleCount,\r
+  IN  EFI_IFR_PACKET                  *Packet, OPTIONAL\r
+  IN  EFI_HANDLE                      CallbackHandle, OPTIONAL\r
+  IN  UINT8                           *NvMapOverride, OPTIONAL\r
+  IN EFI_SCREEN_DESCRIPTOR            *ScreenDimensions, OPTIONAL\r
+  OUT BOOLEAN                         *ResetRequired OPTIONAL\r
+  );\r
+\r
+/**\r
+  Routine used to abstract a generic dialog interface and return the selected \r
+  key or string.\r
+\r
+  @param  NumberOfLines The number of lines for the dialog box.\r
+  \r
+  @param  HotKey Defines whether a single character is parsed (TRUE) \r
+  and returned in KeyValue or if a string is returned in StringBuffer. \r
+  \r
+  @param  MaximumStringSize The maximum size in bytes of a typed-in string. \r
+  Because each character is a CHAR16, the minimum string returned is two bytes.\r
+  \r
+  @param  StringBuffer The passed-in pointer to the buffer that will hold \r
+  the typed in string if HotKey is FALSE.\r
+  \r
+  @param  KeyValue The EFI_INPUT_KEY value returned if HotKey is TRUE.\r
+  \r
+  @param  String The pointer to the first string in the list of strings \r
+  that comprise the dialog box.\r
+  \r
+  @param  ... A series of NumberOfLines text strings that will be used \r
+  to construct the dialog box. \r
+\r
+  @retval EFI_SUCCESS The dialog was displayed and user interaction was received.\r
+  \r
+  @retval EFI_DEVICE_ERROR The user typed in an ESC character to exit the routine.\r
+  \r
+  @retval EFI_INVALID_PARAMETER One of the parameters was invalid\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_CREATE_POP_UP) (\r
+  IN  UINTN                           NumberOfLines,\r
+  IN  BOOLEAN                         HotKey,\r
+  IN  UINTN                           MaximumStringSize,\r
+  OUT CHAR16                          *StringBuffer,\r
+  OUT EFI_INPUT_KEY                   *KeyValue,\r
+  IN  CHAR16                          *String,\r
+  ...\r
+  );\r
+\r
+/**\r
+  @par Protocol Description:\r
+  The EFI_FORM_BROWSER_PROTOCOL is the interface to call for drivers to \r
+  leverage the EFI configuration driver interface. \r
+\r
+  @param SendForm\r
+  Provides direction to the configuration driver whether to use the HII \r
+  database or to use a passed-in set of data. This functions also establishes \r
+  a pointer to the calling driver¡¯s callback interface. \r
+\r
+  @param CreatePopUp\r
+  Routine used to abstract a generic dialog interface and return the \r
+  selected key or string.\r
+\r
+**/\r
+struct _EFI_FORM_BROWSER_PROTOCOL {\r
+  EFI_SEND_FORM     SendForm;\r
+  EFI_CREATE_POP_UP CreatePopUp;\r
+};\r
+\r
+extern EFI_GUID gEfiFormBrowserProtocolGuid;\r
+\r
+#endif\r
diff --git a/Tools/Source/TianoTools/Include/Protocol/FormCallback.h b/Tools/Source/TianoTools/Include/Protocol/FormCallback.h
new file mode 100644 (file)
index 0000000..7a1c539
--- /dev/null
@@ -0,0 +1,227 @@
+/** @file\r
+  The EFI_FORM_CALLBACK_PROTOCOL is the defined interface for access to custom \r
+  NV storage devices as well as communication of user selections in a more \r
+  interactive environment.  This protocol should be published by hardware \r
+  specific drivers which want to export access to custom hardware storage or \r
+  publish IFR which has a requirement to call back the original driver.\r
+\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. This program and the accompanying materials                          \r
+  are licensed and made available under the terms and conditions of the BSD License         \r
+  which accompanies this distribution.  The full text of the license may be found at        \r
+  http://opensource.org/licenses/bsd-license.php                                            \r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+  Module Name:  FormCallback.h\r
+\r
+  @par Revision Reference:\r
+  This protocol is defined in HII spec 0.92.\r
+\r
+**/\r
+\r
+#ifndef __FORM_CALLBACK_H__\r
+#define __FORM_CALLBACK_H__\r
+\r
+\r
+#define EFI_FORM_CALLBACK_PROTOCOL_GUID \\r
+  { \\r
+    0xf3e4543d, 0xcf35, 0x6cef, {0x35, 0xc4, 0x4f, 0xe6, 0x34, 0x4d, 0xfc, 0x54 } \\r
+  }\r
+\r
+//\r
+// Forward reference for pure ANSI compatability\r
+//\r
+typedef struct _EFI_FORM_CALLBACK_PROTOCOL  EFI_FORM_CALLBACK_PROTOCOL;\r
+\r
+\r
+#define RESET_REQUIRED  1 // Flags setting to signify that the callback operation resulted in an eventual\r
+// reset to be done upon exit of the browser\r
+//\r
+#define EXIT_REQUIRED   2   // Flags setting to signify that after the processing of the callback results - exit the browser\r
+#define SAVE_REQUIRED   4   // Flags setting to signify that after the processing of the callback results - save the NV data\r
+#define NV_CHANGED      8   // Flags setting to signify that after the processing of the callback results - turn the NV flag on\r
+#define NV_NOT_CHANGED  16  // Flags setting to signify that after the processing of the callback results - turn the NV flag off\r
+#pragma pack(1)\r
+typedef struct {\r
+  UINT8   OpCode;           // Likely a string, numeric, or one-of\r
+  UINT8   Length;           // Length of the EFI_IFR_DATA_ENTRY packet\r
+  UINT16  Flags;            // Flags settings to determine what behavior is desired from the browser after the callback\r
+  VOID    *Data;            // The data in the form based on the op-code type - this is not a pointer to the data, the data follows immediately\r
+  // If the OpCode is a OneOf or Numeric type - Data is a UINT16 value\r
+  // If the OpCode is a String type - Data is a CHAR16[x] type\r
+  // If the OpCode is a Checkbox type - Data is a UINT8 value\r
+  // If the OpCode is a NV Access type - Data is a EFI_IFR_NV_DATA structure\r
+  //\r
+} EFI_IFR_DATA_ENTRY;\r
+\r
+typedef struct {\r
+  VOID                *NvRamMap;  // If the flag of the op-code specified retrieval of a copy of the NVRAM map,\r
+  // this is a pointer to a buffer copy\r
+  //\r
+  UINT32              EntryCount; // How many EFI_IFR_DATA_ENTRY entries\r
+  //\r
+  // EFI_IFR_DATA_ENTRY  Data[1];    // The in-line Data entries.\r
+  //\r
+} EFI_IFR_DATA_ARRAY;\r
+\r
+typedef union {\r
+  EFI_IFR_DATA_ARRAY  DataArray;  // Primarily used by those who call back to their drivers and use HII as a repository\r
+  EFI_IFR_PACKET      DataPacket; // Primarily used by those which do not use HII as a repository\r
+  CHAR16              *String;  // If returning an error - fill the string with null-terminated contents\r
+} EFI_HII_CALLBACK_PACKET;\r
+\r
+typedef struct {\r
+  EFI_IFR_OP_HEADER Header;\r
+  UINT16            QuestionId;   // Offset into the map\r
+  UINT8             StorageWidth; // Width of the value\r
+  //\r
+  // CHAR8             Data[1];      // The Data itself\r
+  //\r
+} EFI_IFR_NV_DATA;\r
+\r
+#pragma pack()\r
+//\r
+// The following types are currently defined:\r
+//\r
+/**\r
+  Returns the value of a variable. \r
+\r
+  @param  This A pointer to the EFI_FORM_CALLBACK_PROTOCOL instance.\r
+  \r
+  @param  VariableName A NULL-terminated Unicode string that is the \r
+  name of the vendor¡¯s variable. \r
+  \r
+  @param  VendorGuid A unique identifier for the vendor.\r
+  \r
+  @param  Attributes If not NULL, a pointer to the memory location to \r
+  return the attribute's bit-mask for the variable. \r
+  \r
+  @param  DataSize The size in bytes of the Buffer. A size of zero causes \r
+  the variable to be deleted.\r
+  \r
+  @param  Buffer The buffer to return the contents of the variable.\r
+\r
+  @retval EFI_SUCCESS  The function completed successfully.\r
+  \r
+  @retval EFI_NOT_FOUND  The variable was not found.\r
+  \r
+  @retval EFI_BUFFER_TOO_SMALL  The DataSize is too small for the result. \r
+  DataSize has been updated with the size needed to complete the request.\r
+  \r
+  @retval EFI_INVALID_PARAMETER  One of the parameters has an invalid value.\r
+  \r
+  @retval EFI_DEVICE_ERROR  The variable could not be saved due to a hardware failure. \r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_NV_READ) (\r
+  IN     EFI_FORM_CALLBACK_PROTOCOL    *This,\r
+  IN     CHAR16                        *VariableName,\r
+  IN     EFI_GUID                      *VendorGuid,\r
+  OUT    UINT32                        *Attributes OPTIONAL,\r
+  IN OUT UINTN                         *DataSize,\r
+  OUT    VOID                          *Buffer\r
+  );\r
+\r
+/**\r
+  Sets the value of a variable. \r
+\r
+  @param  This A pointer to the EFI_FORM_CALLBACK_PROTOCOL instance.\r
+  \r
+  @param  VariableName A NULL-terminated Unicode string that is the \r
+  name of the vendor's variable. Each VariableName is unique for each VendorGuid.\r
+  \r
+  @param  VendorGuid A unique identifier for the vendor.\r
+  \r
+  @param  Attributes Attributes bit-mask to set for the variable. \r
+  \r
+  @param  DataSize The size in bytes of the Buffer. A size of zero causes \r
+  the variable to be deleted.\r
+  \r
+  @param  Buffer The buffer containing the contents of the variable.\r
+  \r
+  @param  ResetRequired Returns a value from the driver that abstracts \r
+  this information and will enable a system to know if a system reset \r
+  is required to achieve the configuration changes being enabled through \r
+  this function.\r
+\r
+  @retval EFI_SUCCESS  The firmware has successfully stored the variable and \r
+  its data as defined by the Attributes.\r
+  \r
+  @retval EFI_OUT_OF_RESOURCES  Not enough storage is available to hold \r
+  the variable and its data.\r
+  \r
+  @retval EFI_INVALID_PARAMETER  An invalid combination of Attributes bits \r
+  was supplied, or the DataSize exceeds the maximum allowed.\r
+  \r
+  @retval EFI_DEVICE_ERROR  The variable could not be saved due to a hardware failure. \r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_NV_WRITE) (\r
+  IN     EFI_FORM_CALLBACK_PROTOCOL    *This,\r
+  IN     CHAR16                        *VariableName,\r
+  IN     EFI_GUID                      *VendorGuid,\r
+  IN     UINT32                        Attributes,\r
+  IN     UINTN                         DataSize,\r
+  IN     VOID                          *Buffer,\r
+  OUT    BOOLEAN                       *ResetRequired\r
+  );\r
+\r
+/**\r
+  This function is called to provide results data to the driver. \r
+\r
+  @param  This A pointer to the EFI_FORM_CALLBACK_PROTOCOL instance.\r
+  \r
+  @param  KeyValue A unique value which is sent to the original exporting \r
+  driver so that it can identify the type of data to expect. The format of \r
+  the data tends to vary based on the opcode that generated the callback. \r
+  \r
+  @param  Data A pointer to the data being sent to the original exporting driver. \r
+  \r
+  @param  Packet A pointer to a packet of information which a driver passes \r
+  back to the browser.\r
+\r
+  @return Status Code\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_FORM_CALLBACK) (\r
+  IN     EFI_FORM_CALLBACK_PROTOCOL    *This,\r
+  IN     UINT16                        KeyValue,\r
+  IN     EFI_IFR_DATA_ARRAY            *Data,\r
+  OUT    EFI_HII_CALLBACK_PACKET       **Packet\r
+  );\r
+\r
+/**\r
+  @par Protocol Description:\r
+  The EFI_FORM_CALLBACK_PROTOCOL is the defined interface for access to \r
+  custom NVS devices as well as communication of user selections in a more \r
+  interactive environment. This protocol should be published by hardware-specific \r
+  drivers that want to export access to custom hardware storage or publish IFR \r
+  that has a requirement to call back the original driver.\r
+\r
+  @param NvRead\r
+  The read operation to access the NV data serviced by a hardware-specific driver.\r
+\r
+  @param NvWrite\r
+  The write operation to access the NV data serviced by a hardware-specific driver.\r
+\r
+  @param Callback\r
+  The function that is called from the configuration browser to communicate key value pairs. \r
+\r
+**/\r
+struct _EFI_FORM_CALLBACK_PROTOCOL {\r
+  EFI_NV_READ       NvRead;\r
+  EFI_NV_WRITE      NvWrite;\r
+  EFI_FORM_CALLBACK Callback;\r
+};\r
+\r
+extern EFI_GUID gEfiFormCallbackProtocolGuid;\r
+\r
+#endif\r
diff --git a/Tools/Source/TianoTools/Include/Protocol/GraphicsOutput.h b/Tools/Source/TianoTools/Include/Protocol/GraphicsOutput.h
new file mode 100644 (file)
index 0000000..1b4e1fc
--- /dev/null
@@ -0,0 +1,194 @@
+/** @file\r
+  Graphics Output Protocol from the UEFI 2.0 specification.\r
+\r
+  Abstraction of a very simple graphics device.\r
+\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. This program and the accompanying materials                          \r
+  are licensed and made available under the terms and conditions of the BSD License         \r
+  which accompanies this distribution.  The full text of the license may be found at        \r
+  http://opensource.org/licenses/bsd-license.php                                            \r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+  Module Name:  GraphicsOutput.h\r
+\r
+**/\r
+\r
+#ifndef __GRAPHICS_OUTPUT_H__\r
+#define __GRAPHICS_OUTPUT_H__\r
+\r
+#define EFI_GRAPHICS_OUTPUT_PROTOCOL_GUID \\r
+  { \\r
+    0x9042a9de, 0x23dc, 0x4a38, {0x96, 0xfb, 0x7a, 0xde, 0xd0, 0x80, 0x51, 0x6a } \\r
+  }\r
+\r
+typedef struct _EFI_GRAPHICS_OUTPUT_PROTOCOL EFI_GRAPHICS_OUTPUT_PROTOCOL;\r
+\r
+typedef struct {\r
+  UINT32            RedMask;\r
+  UINT32            GreenMask;\r
+  UINT32            BlueMask;\r
+  UINT32            ReservedMask;\r
+} EFI_PIXEL_BITMASK;\r
+\r
+typedef enum {\r
+  PixelRedGreenBlueReserved8BitPerColor,\r
+  PixelBlueGreenRedReserved8BitPerColor,\r
+  PixelBitMask,\r
+  PixelBltOnly,\r
+  PixelFormatMax\r
+} EFI_GRAPHICS_PIXEL_FORMAT;\r
+\r
+typedef struct {\r
+  UINT32                     Version;\r
+  UINT32                     HorizontalResolution;\r
+  UINT32                     VerticalResolution;\r
+  EFI_GRAPHICS_PIXEL_FORMAT  PixelFormat;\r
+  EFI_PIXEL_BITMASK          PixelInformation;\r
+  UINT32                     PixelsPerScanLine;\r
+} EFI_GRAPHICS_OUTPUT_MODE_INFORMATION;\r
+\r
+/**\r
+  Return the current video mode information.\r
+\r
+  @param  This       Protocol instance pointer.\r
+  @param  ModeNumber The mode number to return information on.\r
+  @param  SizeOfInfo A pointer to the size, in bytes, of the Info buffer.\r
+  @param  Info       A pointer to callee allocated buffer that returns information about ModeNumber.\r
+\r
+  @retval EFI_SUCCESS           Mode information returned.\r
+  @retval EFI_BUFFER_TOO_SMALL  The Info buffer was too small.\r
+  @retval EFI_DEVICE_ERROR      A hardware error occurred trying to retrieve the video mode.\r
+  @retval EFI_NOT_STARTED       Video display is not initialized. Call SetMode ()\r
+  @retval EFI_INVALID_PARAMETER One of the input args was NULL.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_GRAPHICS_OUTPUT_PROTOCOL_QUERY_MODE) (\r
+  IN  EFI_GRAPHICS_OUTPUT_PROTOCOL          *This,\r
+  IN  UINT32                                ModeNumber,\r
+  OUT UINTN                                 *SizeOfInfo,\r
+  OUT EFI_GRAPHICS_OUTPUT_MODE_INFORMATION  **Info\r
+  )\r
+;\r
+\r
+/**\r
+  Return the current video mode information.\r
+\r
+  @param  This              Protocol instance pointer.\r
+  @param  ModeNumber        The mode number to be set.\r
+\r
+  @retval EFI_SUCCESS       Graphics mode was changed.\r
+  @retval EFI_DEVICE_ERROR  The device had an error and could not complete the request.\r
+  @retval EFI_UNSUPPORTED   ModeNumber is not supported by this device.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_GRAPHICS_OUTPUT_PROTOCOL_SET_MODE) (\r
+  IN  EFI_GRAPHICS_OUTPUT_PROTOCOL *This,\r
+  IN  UINT32                       ModeNumber\r
+  )\r
+;\r
+\r
+typedef struct {\r
+  UINT8 Blue;\r
+  UINT8 Green;\r
+  UINT8 Red;\r
+  UINT8 Reserved;\r
+} EFI_GRAPHICS_OUTPUT_BLT_PIXEL;\r
+\r
+typedef union {\r
+  EFI_GRAPHICS_OUTPUT_BLT_PIXEL Pixel;\r
+  UINT32                        Raw;\r
+} EFI_GRAPHICS_OUTPUT_BLT_PIXEL_UNION;\r
+\r
+typedef enum {\r
+  EfiBltVideoFill,\r
+  EfiBltVideoToBltBuffer,\r
+  EfiBltBufferToVideo, \r
+  EfiBltVideoToVideo,\r
+  EfiGraphicsOutputBltOperationMax\r
+} EFI_GRAPHICS_OUTPUT_BLT_OPERATION;\r
+\r
+/**\r
+  The following table defines actions for BltOperations:\r
+\r
+  <B>EfiBltVideoFill</B> - Write data from the  BltBuffer pixel (SourceX, SourceY) \r
+  directly to every pixel of the video display rectangle \r
+  (DestinationX, DestinationY) (DestinationX + Width, DestinationY + Height). \r
+  Only one pixel will be used from the BltBuffer. Delta is NOT used.\r
+\r
+  <B>EfiBltVideoToBltBuffer</B> - Read data from the video display rectangle \r
+  (SourceX, SourceY) (SourceX + Width, SourceY + Height) and place it in \r
+  the BltBuffer rectangle (DestinationX, DestinationY ) \r
+  (DestinationX + Width, DestinationY + Height). If DestinationX or \r
+  DestinationY is not zero then Delta must be set to the length in bytes \r
+  of a row in the BltBuffer.\r
+\r
+  <B>EfiBltBufferToVideo</B> - Write data from the  BltBuffer rectangle \r
+  (SourceX, SourceY) (SourceX + Width, SourceY + Height) directly to the \r
+  video display rectangle (DestinationX, DestinationY) \r
+  (DestinationX + Width, DestinationY + Height). If SourceX or SourceY is \r
+  not zero then Delta must be set to the length in bytes of a row in the \r
+  BltBuffer.\r
+\r
+  <B>EfiBltVideoToVideo</B> - Copy from the video display rectangle (SourceX, SourceY)\r
+  (SourceX + Width, SourceY + Height) .to the video display rectangle \r
+  (DestinationX, DestinationY) (DestinationX + Width, DestinationY + Height). \r
+  The BltBuffer and Delta  are not used in this mode.\r
+\r
+  @param  This         Protocol instance pointer.\r
+  @param  BltBuffer    Buffer containing data to blit into video buffer. This\r
+                       buffer has a size of Width*Height*sizeof(EFI_GRAPHICS_OUTPUT_BLT_PIXEL)\r
+  @param  BltOperation Operation to perform on BlitBuffer and video memory\r
+  @param  SourceX      X coordinate of source for the BltBuffer.\r
+  @param  SourceY      Y coordinate of source for the BltBuffer.\r
+  @param  DestinationX X coordinate of destination for the BltBuffer.\r
+  @param  DestinationY Y coordinate of destination for the BltBuffer.\r
+  @param  Width        Width of rectangle in BltBuffer in pixels.\r
+  @param  Height       Hight of rectangle in BltBuffer in pixels.\r
+  @param  Delta        OPTIONAL\r
+\r
+  @retval EFI_SUCCESS           The Blt operation completed.\r
+  @retval EFI_INVALID_PARAMETER BltOperation is not valid.\r
+  @retval EFI_DEVICE_ERROR      A hardware error occured writting to the video buffer.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_GRAPHICS_OUTPUT_PROTOCOL_BLT) (\r
+  IN  EFI_GRAPHICS_OUTPUT_PROTOCOL            *This,\r
+  IN  EFI_GRAPHICS_OUTPUT_BLT_PIXEL           *BltBuffer,   OPTIONAL\r
+  IN  EFI_GRAPHICS_OUTPUT_BLT_OPERATION       BltOperation,\r
+  IN  UINTN                                   SourceX,\r
+  IN  UINTN                                   SourceY,\r
+  IN  UINTN                                   DestinationX,\r
+  IN  UINTN                                   DestinationY,\r
+  IN  UINTN                                   Width,\r
+  IN  UINTN                                   Height,\r
+  IN  UINTN                                   Delta         OPTIONAL\r
+  );\r
+\r
+typedef struct {\r
+  UINT32                                 MaxMode;\r
+  UINT32                                 Mode;\r
+  EFI_GRAPHICS_OUTPUT_MODE_INFORMATION   *Info;\r
+  UINTN                                  SizeOfInfo;\r
+  EFI_PHYSICAL_ADDRESS                   FrameBufferBase;\r
+  UINTN                                  FrameBufferSize;\r
+} EFI_GRAPHICS_OUTPUT_PROTOCOL_MODE;\r
+\r
+struct _EFI_GRAPHICS_OUTPUT_PROTOCOL {\r
+  EFI_GRAPHICS_OUTPUT_PROTOCOL_QUERY_MODE  QueryMode;\r
+  EFI_GRAPHICS_OUTPUT_PROTOCOL_SET_MODE    SetMode;\r
+  EFI_GRAPHICS_OUTPUT_PROTOCOL_BLT         Blt;\r
+  EFI_GRAPHICS_OUTPUT_PROTOCOL_MODE        *Mode;\r
+};\r
+\r
+extern EFI_GUID gEfiGraphicsOutputProtocolGuid;\r
+\r
+#endif\r
diff --git a/Tools/Source/TianoTools/Include/Protocol/GuidedSectionExtraction.h b/Tools/Source/TianoTools/Include/Protocol/GuidedSectionExtraction.h
new file mode 100644 (file)
index 0000000..d98c56a
--- /dev/null
@@ -0,0 +1,102 @@
+/** @file\r
+  This file declares GUIDed section extraction protocol.\r
+\r
+  This interface provides a means of decoding a GUID defined encapsulation \r
+  section. There may be multiple different GUIDs associated with the GUIDed\r
+  section extraction protocol. That is, all instances of the GUIDed section\r
+  extraction protocol must have the same interface structure.\r
+\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. This program and the accompanying materials                          \r
+  are licensed and made available under the terms and conditions of the BSD License         \r
+  which accompanies this distribution.  The full text of the license may be found at        \r
+  http://opensource.org/licenses/bsd-license.php                                            \r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+  Module Name:  GuidedSectionExtraction.h\r
+\r
+  @par Revision Reference:\r
+  This protocol is defined in Firmware Volume Specification.\r
+  Version 0.9\r
+\r
+**/\r
+\r
+#ifndef __GUIDED_SECTION_EXTRACTION_PROTOCOL_H__\r
+#define __GUIDED_SECTION_EXTRACTION_PROTOCOL_H__\r
+\r
+\r
+//\r
+// Protocol GUID definition. Each GUIDed section extraction protocol has the\r
+// same interface but with different GUID. All the GUIDs is defined here.\r
+// May add multiple GUIDs here.\r
+//\r
+#define EFI_CRC32_GUIDED_SECTION_EXTRACTION_PROTOCOL_GUID \\r
+  { \\r
+    0xFC1BCDB0, 0x7D31, 0x49aa, {0x93, 0x6A, 0xA4, 0x60, 0x0D, 0x9D, 0xD0, 0x83 } \\r
+  }\r
+\r
+//\r
+// Forward reference for pure ANSI compatability\r
+//\r
+typedef struct _EFI_GUIDED_SECTION_EXTRACTION_PROTOCOL  EFI_GUIDED_SECTION_EXTRACTION_PROTOCOL;\r
+\r
+//\r
+// Protocol member functions\r
+//\r
+/**\r
+  Processes the input section and returns the data contained therein along \r
+  with the authentication status.\r
+\r
+  @param  This                  Indicates the EFI_GUIDED_SECTION_EXTRACTION_PROTOCOL instance.  \r
+  @param  InputSection          Buffer containing the input GUIDed section to be processed.  \r
+  @param  OutputBuffer          *OutputBuffer is allocated from boot services pool memory \r
+                                and contains the new section stream.  \r
+  @param  OutputSize            A pointer to a caller-allocated UINTN in which the size \r
+                                of *OutputBuffer allocation is stored.   \r
+  @param  AuthenticationStatus  A pointer to a caller-allocated UINT32 that \r
+                                indicates the authentication status of the output buffer.\r
+                                \r
+  @retval EFI_SUCCESS           The InputSection was successfully processed and the \r
+                                section contents were returned.\r
+  @retval EFI_OUT_OF_RESOURCES  The system has insufficient resources to \r
+                                process the request.\r
+  @retval EFI_INVALID_PARAMETER The GUID in InputSection does not match \r
+                                this instance of the GUIDed Section Extraction Protocol.\r
+\r
+**/\r
+\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_EXTRACT_GUIDED_SECTION) (\r
+  IN  EFI_GUIDED_SECTION_EXTRACTION_PROTOCOL          *This,\r
+  IN  VOID                                            *InputSection,\r
+  OUT VOID                                            **OutputBuffer,\r
+  OUT UINTN                                           *OutputSize,\r
+  OUT UINT32                                          *AuthenticationStatus\r
+  );\r
+\r
+//\r
+// Protocol definition\r
+//\r
+/**\r
+  @par Protocol Description:\r
+  If a GUID-defined section is encountered when doing section extraction, \r
+  the section extraction driver calls the appropriate instance of the GUIDed \r
+  Section Extraction Protocol to extract the section stream contained therein.\r
+\r
+  @param ExtractSection\r
+  Takes the GUIDed section as input and produces the section stream data. \r
+\r
+**/\r
+struct _EFI_GUIDED_SECTION_EXTRACTION_PROTOCOL {\r
+  EFI_EXTRACT_GUIDED_SECTION  ExtractSection;\r
+};\r
+\r
+//\r
+// may add other GUID here\r
+//\r
+extern EFI_GUID gEfiCrc32GuidedSectionExtractionProtocolGuid;\r
+\r
+#endif\r
diff --git a/Tools/Source/TianoTools/Include/Protocol/Hash.h b/Tools/Source/TianoTools/Include/Protocol/Hash.h
new file mode 100644 (file)
index 0000000..7007c78
--- /dev/null
@@ -0,0 +1,149 @@
+/** @file\r
+  EFI_HASH_SERVICE_BINDING_PROTOCOL as defined in UEFI 2.0.\r
+  EFI_HASH_PROTOCOL as defined in UEFI 2.0.\r
+  The EFI Hash Service Binding Protocol is used to locate hashing services support \r
+  provided by a driver and create and destroy instances of the EFI Hash Protocol \r
+  so that a multiple drivers can use the underlying hashing services.\r
+  The EFI Service Binding Protocol defines the generic Service Binding Protocol functions.\r
+\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. This program and the accompanying materials                          \r
+  are licensed and made available under the terms and conditions of the BSD License         \r
+  which accompanies this distribution.  The full text of the license may be found at        \r
+  http://opensource.org/licenses/bsd-license.php                                            \r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+  Module Name:  Hash.h\r
+\r
+**/\r
+\r
+#ifndef __EFI_HASH_PROTOCOL_H__\r
+#define __EFI_HASH_PROTOCOL_H__\r
+\r
+#define EFI_HASH_SERVICE_BINDING_PROTOCOL \\r
+  { \\r
+    0x42881c98, 0xa4f3, 0x44b0, {0xa3, 0x9d, 0xdf, 0xa1, 0x86, 0x67, 0xd8, 0xcd } \\r
+  }\r
+  \r
+#define EFI_HASH_PROTOCOL_GUID \\r
+  { \\r
+    0xc5184932, 0xdba5, 0x46db, {0xa5, 0xba, 0xcc, 0x0b, 0xda, 0x9c, 0x14, 0x35 } \\r
+  }\r
+\r
+#define EFI_HASH_ALGORITHM_SHA1_GUID \\r
+  { \\r
+    0x2ae9d80f, 0x3fb2, 0x4095, {0xb7, 0xb1, 0xe9, 0x31, 0x57, 0xb9, 0x46, 0xb6 } \\r
+  }\r
+\r
+#define EFI_HASH_ALGORITHM_SHA224_GUID \\r
+  { \\r
+    0x8df01a06, 0x9bd5, 0x4bf7, {0xb0, 0x21, 0xdb, 0x4f, 0xd9, 0xcc, 0xf4, 0x5b } \\r
+  } \r
+\r
+#define EFI_HASH_ALGORITHM_SHA256_GUID \\r
+  { \\r
+    0x51aa59de, 0xfdf2, 0x4ea3, {0xbc, 0x63, 0x87, 0x5f, 0xb7, 0x84, 0x2e, 0xe9 } \\r
+  } \r
+\r
+#define EFI_HASH_ALGORITHM_SHA384_GUID \\r
+  { \\r
+    0xefa96432, 0xde33, 0x4dd2, {0xae, 0xe6, 0x32, 0x8c, 0x33, 0xdf, 0x77, 0x7a } \\r
+  } \r
+\r
+#define EFI_HASH_ALGORITHM_SHA512_GUID \\r
+  { \\r
+    0xcaa4381e, 0x750c, 0x4770, {0xb8, 0x70, 0x7a, 0x23, 0xb4, 0xe4, 0x21, 0x30 } \\r
+  }\r
+\r
+#define EFI_HASH_ALGORTIHM_MD5_GUID \\r
+  { \\r
+    0xaf7c79c, 0x65b5, 0x4319, {0xb0, 0xae, 0x44, 0xec, 0x48, 0x4e, 0x4a, 0xd7 } \\r
+  }\r
+\r
+typedef struct _EFI_HASH_PROTOCOL EFI_HASH_PROTOCOL;\r
+\r
+typedef UINT8  EFI_MD5_HASH[16];\r
+typedef UINT8  EFI_SHA1_HASH[20];\r
+typedef UINT8  EFI_SHA224_HASH[28];\r
+typedef UINT8  EFI_SHA256_HASH[32];\r
+typedef UINT8  EFI_SHA384_HASH[48];\r
+typedef UINT8  EFI_SHA512_HASH[64];\r
+\r
+typedef union {\r
+  EFI_MD5_HASH     *Md5Hash;\r
+  EFI_SHA1_HASH    *Sha1Hash;\r
+  EFI_SHA224_HASH  *Sha224Hash;\r
+  EFI_SHA256_HASH  *Sha256Hash;\r
+  EFI_SHA384_HASH  *Sha384Hash;\r
+  EFI_SHA512_HASH  *Sha512Hash;\r
+} EFI_HASH_OUTPUT;\r
+\r
+/**\r
+  Returns the size of the hash which results from a specific algorithm.\r
+\r
+  @param  This                  Points to this instance of EFI_HASH_PROTOCOL.\r
+  @param  HashAlgorithm         Points to the EFI_GUID which identifies the algorithm to use.\r
+  @param  HashSize              Holds the returned size of the algorithm¡¯s hash.\r
+\r
+  @retval EFI_SUCCESS           Hash size returned successfully.\r
+  @retval EFI_INVALID_PARAMETER HashSize is NULL\r
+  @retval EFI_UNSUPPORTED       The algorithm specified by HashAlgorithm is not supported \r
+                                by this driver.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_HASH_GET_HASH_SIZE) (\r
+  IN  CONST EFI_HASH_PROTOCOL     *This,\r
+  IN  CONST EFI_GUID              *HashAlgorithm,\r
+  OUT UINTN                       *HashSize\r
+  )\r
+;      \r
+\r
+/**\r
+  Returns the size of the hash which results from a specific algorithm.\r
+\r
+  @param  This          Points to this instance of EFI_HASH_PROTOCOL.\r
+  @param  HashAlgorithm Points to the EFI_GUID which identifies the algorithm to use.\r
+  @param  Extend        Specifies whether to create a new hash (FALSE) or extend the specified\r
+                        existing hash (TRUE).\r
+  @param  Message       Points to the start of the message.\r
+  @param  MessageSize   The size of Message, in bytes.\r
+  @param  Hash          On input, if Extend is TRUE, then this holds the hash to extend. On\r
+                        output, holds the resulting hash computed from the message.\r
+\r
+  @retval EFI_SUCCESS           Hash returned successfully.\r
+  @retval EFI_INVALID_PARAMETER Message or Hash is NULL\r
+  @retval EFI_UNSUPPORTED       The algorithm specified by HashAlgorithm is not supported by this\r
+                                 driver. Or extend is TRUE and the algorithm doesn¡¯t support extending the hash.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_HASH_HASH) (\r
+  IN CONST EFI_HASH_PROTOCOL      *This,\r
+  IN CONST EFI_GUID               *HashAlgorithm,\r
+  IN BOOLEAN                      Extend,\r
+  IN CONST UINT8                  *Message,\r
+  IN UINT64                       MessageSize,\r
+  IN OUT EFI_HASH_OUTPUT          *Hash\r
+  )\r
+;    \r
+\r
+struct _EFI_HASH_PROTOCOL {\r
+  EFI_HASH_GET_HASH_SIZE          GetHashSize;\r
+  EFI_HASH_HASH                   Hash;\r
+};\r
+\r
+extern EFI_GUID gEfiHashServiceBindingProtocolGuid;\r
+extern EFI_GUID gEfiHashProtocolGuid;\r
+extern EFI_GUID gEfiHashAlgorithmSha1Guid;\r
+extern EFI_GUID gEfiHashAlgorithmSha224Guid;\r
+extern EFI_GUID gEfiHashAlgorithmSha256Guid;\r
+extern EFI_GUID gEfiHashAlgorithmSha384Guid;\r
+extern EFI_GUID gEfiHashAlgorithmSha512Guid;\r
+extern EFI_GUID gEfiHashAlgorithmMD5Guid;\r
+\r
+#endif\r
diff --git a/Tools/Source/TianoTools/Include/Protocol/Hii.h b/Tools/Source/TianoTools/Include/Protocol/Hii.h
new file mode 100644 (file)
index 0000000..ceeba1c
--- /dev/null
@@ -0,0 +1,1024 @@
+/** @file\r
+  This file defines the Human Interface Infrastructure protocol which will \r
+  be used by resources which want to publish IFR/Font/String data and have it \r
+  collected by the Configuration engine.\r
+\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. This program and the accompanying materials                          \r
+  are licensed and made available under the terms and conditions of the BSD License         \r
+  which accompanies this distribution.  The full text of the license may be found at        \r
+  http://opensource.org/licenses/bsd-license.php                                            \r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+  Module Name:  Hii.h\r
+\r
+  @par Revision Reference:\r
+  This protocol is defined in HII spec 0.92.\r
+\r
+**/\r
+\r
+#ifndef __HII_H__\r
+#define __HII_H__\r
+\r
+\r
+#define EFI_HII_PROTOCOL_GUID \\r
+  { \\r
+    0xea816d2c, 0xcee5, 0x4f02, {0x99, 0xb5, 0xd3, 0x90, 0x5c, 0xbb, 0xd0, 0x77 } \\r
+  }\r
+\r
+// BugBug:\r
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\r
+// If UGA goes away we need to put this some place. I'm not sure where?\r
+//\r
+//typedef struct {\r
+//  UINT8 Blue;\r
+//  UINT8 Green;\r
+//  UINT8 Red;\r
+//  UINT8 Reserved;\r
+//} EFI_UGA_PIXEL;\r
+\r
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\r
+//\r
+\r
+typedef struct _EFI_HII_PROTOCOL  EFI_HII_PROTOCOL;\r
+\r
+//\r
+// Global definition\r
+//\r
+#define NARROW_CHAR         0xFFF0\r
+#define WIDE_CHAR           0xFFF1\r
+#define NON_BREAKING_CHAR   0xFFF2\r
+#define GLYPH_WIDTH         8\r
+#define GLYPH_HEIGHT        19\r
+\r
+#define EFI_HII_FONT        1\r
+#define EFI_HII_STRING      2\r
+#define EFI_HII_IFR         3\r
+#define EFI_HII_KEYBOARD    4\r
+#define EFI_HII_HANDLES     5\r
+#define EFI_HII_VARIABLE    6\r
+#define EFI_HII_DEVICE_PATH 7\r
+\r
+\r
+// References to string tokens must use this macro to enable scanning for\r
+// token usages.\r
+//\r
+#define STRING_TOKEN(t) t\r
+\r
+//\r
+// The following types are currently defined:\r
+//\r
+typedef UINT16  EFI_FORM_ID;\r
+typedef UINT16  EFI_FORM_LABEL;\r
+\r
+#pragma pack(1)\r
+\r
+typedef struct {\r
+  UINT32  Length;\r
+  UINT16  Type;\r
+} EFI_HII_PACK_HEADER;\r
+\r
+//\r
+// A form list consists of a large variety of structure\r
+// possibilities so to represent the binary blob of data\r
+// associated with a package of forms, we will assume a\r
+// pointer to a self-describing data buffer.\r
+//\r
+typedef struct {\r
+  EFI_HII_PACK_HEADER Header;\r
+} EFI_HII_IFR_PACK;\r
+\r
+typedef struct {\r
+  EFI_HII_PACK_HEADER Header;           // Must be filled in\r
+  EFI_HANDLE          ImageHandle;      // Must be filled in\r
+  EFI_HANDLE          DeviceHandle;     // Optional\r
+  EFI_HANDLE          ControllerHandle; // Optional\r
+  EFI_HANDLE          CallbackHandle;   // Optional\r
+  EFI_HANDLE          COBExportHandle;  // Optional\r
+} EFI_HII_HANDLE_PACK;\r
+\r
+//\r
+// ********************************************************\r
+// EFI_VARIABLE_CONTENTS\r
+// ********************************************************\r
+//\r
+typedef struct {\r
+  EFI_HII_PACK_HEADER Header;\r
+  EFI_GUID            VariableGuid;\r
+  UINT32              VariableNameLength;\r
+  UINT16              VariableId;\r
+  //\r
+  //  CHAR16                VariableName[]; //Null-terminated\r
+  //\r
+} EFI_HII_VARIABLE_PACK;\r
+\r
+//\r
+// ********************************************************\r
+// EFI_DEVICE_PATH_PACK\r
+// ********************************************************\r
+//\r
+typedef struct {\r
+  EFI_HII_PACK_HEADER Header;\r
+  //\r
+  //  EFI_DEVICE_PATH       DevicePath[];\r
+  //\r
+} EFI_HII_DEVICE_PATH_PACK;\r
+\r
+//\r
+// ********************************************************\r
+// EFI_HII_DATA_TABLE\r
+// ********************************************************\r
+//\r
+typedef struct {\r
+  EFI_HII_HANDLE  HiiHandle;\r
+  EFI_GUID        PackageGuid;\r
+  UINT32          DataTableSize;\r
+  UINT32          IfrDataOffset;\r
+  UINT32          StringDataOffset;\r
+  UINT32          VariableDataOffset;\r
+  UINT32          DevicePathOffset;\r
+  UINT32          NumberOfVariableData;\r
+  UINT32          NumberOfLanguages;\r
+  //\r
+  // EFI_HII_DEVICE_PATH_PACK DevicePath[];\r
+  // EFI_HII_VARIABLE_PACK VariableData[];\r
+  // EFI_HII_IFR_PACK IfrData;\r
+  // EFI_HII_STRING_PACK StringData[];\r
+  //\r
+} EFI_HII_DATA_TABLE;\r
+\r
+//\r
+// ********************************************************\r
+// EFI_HII_EXPORT_TABLE\r
+// ********************************************************\r
+//\r
+typedef struct {\r
+  UINT32    NumberOfHiiDataTables;\r
+  EFI_GUID  Revision;\r
+  //\r
+  // EFI_HII_DATA_TABLE HiiDataTable[];\r
+  //\r
+} EFI_HII_EXPORT_TABLE;\r
+\r
+typedef struct {\r
+  BOOLEAN               FormSetUpdate;      // If TRUE, next variable is significant\r
+  EFI_PHYSICAL_ADDRESS  FormCallbackHandle; // If not 0, will update Formset with this info\r
+  BOOLEAN               FormUpdate;         // If TRUE, next variable is significant\r
+  UINT16                FormValue;          // specify which form is to be updated if FormUpdate value is TRUE.\r
+  STRING_REF            FormTitle;          // If not 0, will update Form with this info\r
+  UINT16                DataCount;          // The number of Data entries in this structure\r
+  UINT8                 *Data;              // An array of 1+ op-codes, specified by DataCount\r
+} EFI_HII_UPDATE_DATA;\r
+\r
+//\r
+// String attributes\r
+//\r
+#define LANG_RIGHT_TO_LEFT  0x00000001\r
+\r
+//\r
+// A string package is used to localize strings to a particular\r
+// language.  The package is associated with a particular driver\r
+// or set of drivers.  Tools are used to associate tokens with\r
+// string references in forms and in programs.  These tokens are\r
+// language agnostic.  When paired with a language pack (directly\r
+// or indirectly), the string token resolves into an actual\r
+// UNICODE string.  The NumStringPointers determines how many\r
+// StringPointers (offset values) there are as well as the total\r
+// number of Strings that are defined.\r
+//\r
+typedef struct {\r
+  EFI_HII_PACK_HEADER Header;\r
+  RELOFST             LanguageNameString;\r
+  RELOFST             PrintableLanguageName;\r
+  UINT32              NumStringPointers;\r
+  UINT32              Attributes;\r
+  //\r
+  //  RELOFST               StringPointers[];\r
+  //  EFI_STRING            Strings[];\r
+  //\r
+} EFI_HII_STRING_PACK;\r
+\r
+//\r
+// Glyph Attributes\r
+//\r
+#define EFI_GLYPH_NON_SPACING   1\r
+#define EFI_GLYPH_WIDE          2\r
+\r
+typedef struct {\r
+  CHAR16  UnicodeWeight;\r
+  UINT8   Attributes;\r
+  UINT8   GlyphCol1[GLYPH_HEIGHT];\r
+} EFI_NARROW_GLYPH;\r
+\r
+typedef struct {\r
+  CHAR16  UnicodeWeight;\r
+  UINT8   Attributes;\r
+  UINT8   GlyphCol1[GLYPH_HEIGHT];\r
+  UINT8   GlyphCol2[GLYPH_HEIGHT];\r
+  UINT8   Pad[3];\r
+} EFI_WIDE_GLYPH;\r
+\r
+//\r
+// A font list consists of a font header followed by a series\r
+// of glyph structures.  Note that fonts are not language specific.\r
+//\r
+typedef struct {\r
+  EFI_HII_PACK_HEADER Header;\r
+  UINT16              NumberOfNarrowGlyphs;\r
+  UINT16              NumberOfWideGlyphs;\r
+} EFI_HII_FONT_PACK;\r
+\r
+//\r
+// The IfrData in the EFI_HII_IFR_PACK structure definition\r
+// is variable length, and not really part of the header. To\r
+// simplify from code the size of the header, define an\r
+// identical structure that does not include the IfrData field.\r
+// Then use sizeof() this new structure to determine the\r
+// actual size of the header.\r
+//\r
+typedef struct {\r
+  EFI_HII_PACK_HEADER Header;\r
+} EFI_HII_IFR_PACK_HEADER;\r
+\r
+//\r
+// pedef EFI_HII_PACK_HEADER EFI_HII_IFR_PACK_HEADER;\r
+//\r
+typedef enum {\r
+  EfiKeyLCtrl,\r
+  EfiKeyA0,\r
+  EfiKeyLAlt,\r
+  EfiKeySpaceBar,\r
+  EfiKeyA2,\r
+  EfiKeyA3,\r
+  EfiKeyA4,\r
+  EfiKeyRCtrl,\r
+  EfiKeyLeftArrow,\r
+  EfiKeyDownArrow,\r
+  EfiKeyRightArrow,\r
+  EfiKeyZero,\r
+  EfiKeyPeriod,\r
+  EfiKeyEnter,\r
+  EfiKeyLShift,\r
+  EfiKeyB0,\r
+  EfiKeyB1,\r
+  EfiKeyB2,\r
+  EfiKeyB3,\r
+  EfiKeyB4,\r
+  EfiKeyB5,\r
+  EfiKeyB6,\r
+  EfiKeyB7,\r
+  EfiKeyB8,\r
+  EfiKeyB9,\r
+  EfiKeyB10,\r
+  EfiKeyRshift,\r
+  EfiKeyUpArrow,\r
+  EfiKeyOne,\r
+  EfiKeyTwo,\r
+  EfiKeyThree,\r
+  EfiKeyCapsLock,\r
+  EfiKeyC1,\r
+  EfiKeyC2,\r
+  EfiKeyC3,\r
+  EfiKeyC4,\r
+  EfiKeyC5,\r
+  EfiKeyC6,\r
+  EfiKeyC7,\r
+  EfiKeyC8,\r
+  EfiKeyC9,\r
+  EfiKeyC10,\r
+  EfiKeyC11,\r
+  EfiKeyC12,\r
+  EfiKeyFour,\r
+  EfiKeyFive,\r
+  EfiKeySix,\r
+  EfiKeyPlus,\r
+  EfiKeyTab,\r
+  EfiKeyD1,\r
+  EfiKeyD2,\r
+  EfiKeyD3,\r
+  EfiKeyD4,\r
+  EfiKeyD5,\r
+  EfiKeyD6,\r
+  EfiKeyD7,\r
+  EfiKeyD8,\r
+  EfiKeyD9,\r
+  EfiKeyD10,\r
+  EfiKeyD11,\r
+  EfiKeyD12,\r
+  EfiKeyD13,\r
+  EfiKeyDel,\r
+  EfiKeyEnd,\r
+  EfiKeyPgDn,\r
+  EfiKeySeven,\r
+  EfiKeyEight,\r
+  EfiKeyNine,\r
+  EfiKeyE0,\r
+  EfiKeyE1,\r
+  EfiKeyE2,\r
+  EfiKeyE3,\r
+  EfiKeyE4,\r
+  EfiKeyE5,\r
+  EfiKeyE6,\r
+  EfiKeyE7,\r
+  EfiKeyE8,\r
+  EfiKeyE9,\r
+  EfiKeyE10,\r
+  EfiKeyE11,\r
+  EfiKeyE12,\r
+  EfiKeyBackSpace,\r
+  EfiKeyIns,\r
+  EfiKeyHome,\r
+  EfiKeyPgUp,\r
+  EfiKeyNLck,\r
+  EfiKeySlash,\r
+  EfiKeyAsterisk,\r
+  EfiKeyMinus,\r
+  EfiKeyEsc,\r
+  EfiKeyF1,\r
+  EfiKeyF2,\r
+  EfiKeyF3,\r
+  EfiKeyF4,\r
+  EfiKeyF5,\r
+  EfiKeyF6,\r
+  EfiKeyF7,\r
+  EfiKeyF8,\r
+  EfiKeyF9,\r
+  EfiKeyF10,\r
+  EfiKeyF11,\r
+  EfiKeyF12,\r
+  EfiKeyPrint,\r
+  EfiKeySLck,\r
+  EfiKeyPause\r
+} EFI_KEY;\r
+\r
+typedef struct {\r
+  EFI_KEY Key;\r
+  CHAR16  Unicode;\r
+  CHAR16  ShiftedUnicode;\r
+  CHAR16  AltGrUnicode;\r
+  CHAR16  ShiftedAltGrUnicode;\r
+  UINT16  Modifier;\r
+} EFI_KEY_DESCRIPTOR;\r
+\r
+//\r
+// This structure allows a sparse set of keys to be redefined\r
+// or a complete redefinition of the keyboard layout.  Most\r
+// keyboards have a lot of commonality in their layouts, therefore\r
+// only defining those keys that need to change from the default\r
+// minimizes the passed in information.\r
+//\r
+// Additionally, when an update occurs, the active keyboard layout\r
+// will be switched to the newly updated keyboard layout.  This\r
+// allows for situations that when a keyboard layout driver is\r
+// loaded as part of system initialization, the system will default\r
+// the keyboard behavior to the new layout.\r
+//\r
+// Each call to update the keyboard mapping should contain the\r
+// complete set of key descriptors to be updated, since every\r
+// call to the HII which contains an EFI_HII_KEYBOARD_PACK will\r
+// wipe the previous set of overrides.  A call to\r
+//\r
+typedef struct {\r
+  EFI_HII_PACK_HEADER Header;\r
+  EFI_KEY_DESCRIPTOR  *Descriptor;\r
+  UINT8               DescriptorCount;\r
+} EFI_HII_KEYBOARD_PACK;\r
+\r
+//\r
+// The EFI_HII_PACKAGES can contain different types of packages just\r
+// after the structure as inline data.\r
+//\r
+typedef struct {\r
+  UINTN     NumberOfPackages;\r
+  EFI_GUID  *GuidId;\r
+  //\r
+  // EFI_HII_HANDLE_PACK    *HandlePack;        // Only one pack.\r
+  // EFI_HII_IFR_PACK       *IfrPack;           // Only one pack.\r
+  // EFI_HII_FONT_PACK      *FontPack[];        // Multiple packs ok\r
+  // EFI_HII_STRING_PACK    *StringPack[];      // Multiple packs ok\r
+  // EFI_HII_KEYBOARD_PACK  *KeyboardPack[];    // Multiple packs ok\r
+  //\r
+} EFI_HII_PACKAGES;\r
+\r
+typedef struct _EFI_HII_VARIABLE_PACK_LIST {\r
+  struct _EFI_HII_VARIABLE_PACK_LIST   *NextVariablePack;\r
+  EFI_HII_VARIABLE_PACK                *VariablePack;\r
+} EFI_HII_VARIABLE_PACK_LIST;\r
+\r
+#pragma pack()\r
+\r
+/**\r
+  Registers the various packs that are passed in via the Packages parameter. \r
+\r
+  @param  This A pointer to the EFI_HII_PROTOCOL instance.\r
+  \r
+  @param  Packages A pointer to an EFI_HII_PACKAGES package instance.\r
+  \r
+  @param  Handle A pointer to the EFI_HII_HANDLE instance.\r
+\r
+  @retval EFI_SUCCESS Data was extracted from Packages, the database \r
+  was updated with the data, and Handle returned successfully.\r
+  \r
+  @retval EFI_INVALID_PARAMETER The content of Packages  was invalid. \r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_HII_NEW_PACK) (\r
+  IN  EFI_HII_PROTOCOL    *This,\r
+  IN  EFI_HII_PACKAGES    *Packages,\r
+  OUT EFI_HII_HANDLE      *Handle\r
+  );\r
+\r
+/**\r
+  Removes a package from the HII database. \r
+\r
+  @param  This A pointer to the EFI_HII_PROTOCOL instance.\r
+  \r
+  @param  Handle The handle that was registered to the data that is requested \r
+  for removal. \r
+\r
+  @retval EFI_SUCCESS The data associated with the Handle was removed \r
+  from the HII database.\r
+  \r
+  @retval EFI_INVALID_PARAMETER The Handle was not valid. \r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_HII_REMOVE_PACK) (\r
+  IN EFI_HII_PROTOCOL    *This,\r
+  IN EFI_HII_HANDLE      Handle\r
+  );\r
+\r
+/**\r
+  Determines the handles that are currently active in the database.\r
+\r
+  @param  This A pointer to the EFI_HII_PROTOCOL instance.\r
+  \r
+  @param  HandleBufferLength On input, a pointer to the length of the handle \r
+  buffer. On output, the length of the handle buffer that is required \r
+  for the handles found.\r
+  \r
+  @param  Handle An array of EFI_HII_HANDLE instances returned.\r
+\r
+  @retval EFI_SUCCESS Handle was updated successfully.\r
+  \r
+  @retval EFI_BUFFER_TOO_SMALL The HandleBufferLength parameter indicates \r
+  that Handle is too small to support the number of handles.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_HII_FIND_HANDLES) (\r
+  IN     EFI_HII_PROTOCOL *This,\r
+  IN OUT UINT16           *HandleBufferLength,\r
+  OUT    EFI_HII_HANDLE   *Handle\r
+  );\r
+\r
+/**\r
+  Exports the contents of the database into a buffer.\r
+\r
+  @param  This A pointer to the EFI_HII_PROTOCOL instance.\r
+  \r
+  @param  Handle An EFI_HII_HANDLE that corresponds to the desired \r
+  handle to export. If the value is 0, the entire database will be exported.\r
+  In either case, the data will be exported in a format described by the \r
+  structure definition of EFI_HII_EXPORT_TABLE.\r
+  \r
+  @param  BufferSize\r
+  On input, a pointer to the length of the buffer. On output, the length \r
+  of the buffer that is required for the export data.\r
+  \r
+  @param  Buffer A pointer to a buffer that will contain the results of the export function.\r
+\r
+  @retval EFI_SUCCESS The buffer was successfully filled with BufferSize amount of data.\r
+  \r
+  @retval EFI_BUFFER_TOO_SMALL The value in BufferSize was too small to contain the export data.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_HII_EXPORT) (\r
+  IN     EFI_HII_PROTOCOL *This,\r
+  IN     EFI_HII_HANDLE   Handle,\r
+  IN OUT UINTN            *BufferSize,\r
+  OUT    VOID             *Buffer\r
+  );\r
+\r
+/**\r
+  Remove any new strings that were added after the initial string export \r
+  for this handle.\r
+\r
+  @param  This A pointer to the EFI_HII_PROTOCOL instance.\r
+  \r
+  @param  Handle The handle on which the string resides.\r
+\r
+  @retval EFI_SUCCESS Remove strings from the handle successfully.\r
+  \r
+  @retval EFI_INVALID_PARAMETER The Handle was unknown.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_HII_RESET_STRINGS) (\r
+  IN     EFI_HII_PROTOCOL   *This,\r
+  IN     EFI_HII_HANDLE     Handle\r
+  );\r
+\r
+/**\r
+  Tests if all of the characters in a string have corresponding font characters.\r
+\r
+  @param  This A pointer to the EFI_HII_PROTOCOL instance.\r
+  \r
+  @param  StringToTest A pointer to a Unicode string.\r
+  \r
+  @param  FirstMissing A pointer to an index into the string. On input, \r
+  the index of the first character in the StringToTest to examine. On exit, \r
+  the index of the first character encountered for which a glyph is unavailable.\r
+  If all glyphs in the string are available, the index is the index of the \r
+  terminator of the string.\r
+  \r
+  @param  GlyphBufferSize A pointer to a value. On output, if the function \r
+  returns EFI_SUCCESS, it contains the amount of memory that is required to \r
+  store the string¡¯s glyph equivalent.\r
+\r
+  @retval EFI_SUCCESS All glyphs are available. Note that an empty string \r
+  always returns this value.\r
+  \r
+  @retval EFI_NOT_FOUND A glyph was not found for a character.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_HII_TEST_STRING) (\r
+  IN     EFI_HII_PROTOCOL  *This,\r
+  IN     CHAR16            *StringToTest,\r
+  IN OUT UINT32            *FirstMissing,\r
+  OUT    UINT32            *GlyphBufferSize\r
+  );\r
+\r
+/**\r
+  Translates a Unicode character into the corresponding font glyph.\r
+\r
+  @param  This A pointer to the EFI_HII_PROTOCOL instance.\r
+  \r
+  @param  Source A pointer to a Unicode string.\r
+  \r
+  @param  Index On input, the offset into the string from which to fetch \r
+  the character.On successful completion, the index is updated to the first \r
+  character past the character(s) making up the just extracted glyph. \r
+  \r
+  @param  GlyphBuffer Pointer to an array where the glyphs corresponding \r
+  to the characters in the source may be stored. GlyphBuffer is assumed \r
+  to be wide enough to accept a wide glyph character.\r
+  \r
+  @param  BitWidth If EFI_SUCCESS was returned, the UINT16 pointed to by \r
+  this value is filled with the length of the glyph in pixels. It is unchanged \r
+  if the call was unsuccessful.\r
+  \r
+  @param  InternalStatus The cell pointed to by this parameter must be \r
+  initialized to zero prior to invoking the call the first time for any string.\r
+\r
+  @retval EFI_SUCCESS It worked.\r
+  \r
+  @retval EFI_NOT_FOUND A glyph for a character was not found.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_HII_GET_GLYPH) (\r
+  IN     EFI_HII_PROTOCOL  *This,\r
+  IN     CHAR16            *Source,\r
+  IN OUT UINT16            *Index,\r
+  OUT    UINT8             **GlyphBuffer,\r
+  OUT    UINT16            *BitWidth,\r
+  IN OUT UINT32            *InternalStatus\r
+  );\r
+\r
+/**\r
+  Translates a glyph into the format required for input to the Universal \r
+  Graphics Adapter (UGA) Block Transfer (BLT) routines.\r
+\r
+  @param  This A pointer to the EFI_HII_PROTOCOL instance.\r
+  \r
+  @param  GlyphBuffer A pointer to the buffer that contains glyph data.\r
+  \r
+  @param  Foreground The foreground setting requested to be used for the \r
+  generated BltBuffer data. \r
+  \r
+  @param  Background The background setting requested to be used for the \r
+  generated BltBuffer data.\r
+  \r
+  @param  Count The entry in the BltBuffer upon which to act.\r
+  \r
+  @param  Width The width in bits of the glyph being converted.\r
+  \r
+  @param  Height The height in bits of the glyph being converted\r
+  \r
+  @param  BltBuffer A pointer to the buffer that contains the data that is \r
+  ready to be used by the UGA BLT routines. \r
+\r
+  @retval EFI_SUCCESS It worked.\r
+  \r
+  @retval EFI_NOT_FOUND A glyph for a character was not found.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_HII_GLYPH_TO_BLT) (\r
+  IN     EFI_HII_PROTOCOL   *This,\r
+  IN     UINT8              *GlyphBuffer,\r
+  IN     EFI_UGA_PIXEL      Foreground,\r
+  IN     EFI_UGA_PIXEL      Background,\r
+  IN     UINTN              Count,\r
+  IN     UINTN              Width,\r
+  IN     UINTN              Height,\r
+  IN OUT EFI_UGA_PIXEL      *BltBuffer\r
+  );\r
+\r
+/**\r
+  Allows a new string to be added to an already existing string package.\r
+\r
+  @param  This A pointer to the EFI_HII_PROTOCOL instance.\r
+  \r
+  @param  Pointer to a NULL-terminated string containing a single ISO 639-2 \r
+  language identifier, indicating the language in which the string is translated. \r
+  \r
+  @param  Handle The handle of the language pack to which the string is to be added.\r
+  \r
+  @param  Reference The identifier of the string to be added. If the reference \r
+  value is zero, then the string will be assigned a new identifier on that \r
+  handle for the language specified. Otherwise, the string will be updated \r
+  with the NewString Value. \r
+  \r
+  @param  NewString The string to be added.\r
+\r
+  @retval EFI_SUCCESS The string was effectively registered.\r
+  \r
+  @retval EFI_INVALID_PARAMETER The Handle was unknown.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_HII_NEW_STRING) (\r
+  IN     EFI_HII_PROTOCOL      *This,\r
+  IN     CHAR16                *Language,\r
+  IN     EFI_HII_HANDLE        Handle,\r
+  IN OUT STRING_REF            *Reference,\r
+  IN     CHAR16                *NewString\r
+  );\r
+\r
+/**\r
+  Allows a program to determine the primary languages that are supported \r
+  on a given handle.\r
+\r
+  @param  This A pointer to the EFI_HII_PROTOCOL instance.\r
+  \r
+  @param  Handle The handle on which the strings reside.\r
+  \r
+  @param  LanguageString A string allocated by GetPrimaryLanguages() that \r
+  contains a list of all primary languages registered on the handle. \r
+\r
+  @retval EFI_SUCCESS LanguageString was correctly returned.\r
+  \r
+  @retval EFI_INVALID_PARAMETER The Handle was unknown.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_HII_GET_PRI_LANGUAGES) (\r
+  IN  EFI_HII_PROTOCOL    *This,\r
+  IN  EFI_HII_HANDLE      Handle,\r
+  OUT EFI_STRING          *LanguageString\r
+  );\r
+\r
+/**\r
+  Allows a program to determine which secondary languages are supported \r
+  on a given handle for a given primary language.\r
+\r
+  @param  This A pointer to the EFI_HII_PROTOCOL instance.\r
+  \r
+  @param  Handle The handle on which the strings reside.\r
+  \r
+  @param  PrimaryLanguage Pointer to a NULL-terminated string containing a single \r
+  ISO 639-2 language identifier, indicating the primary language.\r
+  \r
+  @param  LanguageString A string allocated by GetSecondaryLanguages() \r
+  containing a list of all secondary languages registered on the handle.\r
+\r
+  @retval EFI_SUCCESS LanguageString was correctly returned.\r
+  \r
+  @retval EFI_INVALID_PARAMETER The Handle was unknown.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_HII_GET_SEC_LANGUAGES) (\r
+  IN  EFI_HII_PROTOCOL    *This,\r
+  IN  EFI_HII_HANDLE      Handle,\r
+  IN  CHAR16              *PrimaryLanguage,\r
+  OUT EFI_STRING          *LanguageString\r
+  );\r
+\r
+/**\r
+  Extracts a string from a package already registered with the EFI HII database.\r
+\r
+  @param  This A pointer to the EFI_HII_PROTOCOL instance.\r
+  \r
+  @param  Handle The handle on which the string resides.\r
+  \r
+  @param  Token The string token assigned to the string.\r
+  \r
+  @param  Raw If TRUE, the string is returned unedited in the internal \r
+  storage format described above. If false, the string returned is edited \r
+  by replacing <cr> with <space> and by removing special characters such \r
+  as the <wide> prefix.\r
+  \r
+  @param  LanguageString Pointer to a NULL-terminated string containing a \r
+  single ISO 639-2 language identifier, indicating the language to print. \r
+  If the LanguageString is empty (starts with a NULL), the default system \r
+  language will be used to determine the language.\r
+  \r
+  @param  BufferLength Length of the StringBuffer.\r
+  \r
+  @param  StringBuffer The buffer designed to receive the characters in the string.\r
+\r
+  @retval EFI_SUCCESS StringBuffer is filled with a NULL-terminated string.\r
+  \r
+  @retval EFI_INVALID_PARAMETER The handle or string token is unknown.\r
+  \r
+  @retval EFI_BUFFER_TOO_SMALL The buffer provided was not large enough to \r
+  allow the entire string to be stored. \r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_HII_GET_STRING) (\r
+  IN     EFI_HII_PROTOCOL  *This,\r
+  IN     EFI_HII_HANDLE    Handle,\r
+  IN     STRING_REF        Token,\r
+  IN     BOOLEAN           Raw,\r
+  IN     CHAR16            *LanguageString,\r
+  IN OUT UINTN             *BufferLength,\r
+  OUT    EFI_STRING        StringBuffer\r
+  );\r
+\r
+/**\r
+  Allows a program to extract a part of a string of not more than a given width. \r
+\r
+  @param  This A pointer to the EFI_HII_PROTOCOL instance.\r
+  \r
+  @param  Handle The handle on which the string resides.\r
+  \r
+  @param  Token The string token assigned to the string. \r
+  \r
+  @param  Index On input, the offset into the string where the line is to start.\r
+  On output, the index is updated to point to beyond the last character returned \r
+  in the call.\r
+  \r
+  @param  LineWidth The maximum width of the line in units of narrow glyphs.\r
+  \r
+  @param  LanguageString Pointer to a NULL-terminated string containing a \r
+  single ISO 639-2 language identifier, indicating the language to print.\r
+  \r
+  @param  BufferLength Pointer to the length of the StringBuffer. \r
+  \r
+  @param  StringBuffer The buffer designed to receive the characters in the string. \r
+\r
+  @retval EFI_SUCCESS StringBuffer filled with characters that will fit on the line.\r
+  \r
+  @retval EFI_NOT_FOUND The font glyph for at least one of the characters in \r
+  the string is not in the font database.\r
+  \r
+  @retval EFI_BUFFER_TOO_SMALL The buffer provided was not large enough \r
+  to allow the entire string to be stored.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_HII_GET_LINE) (\r
+  IN     EFI_HII_PROTOCOL  *This,\r
+  IN     EFI_HII_HANDLE    Handle,\r
+  IN     STRING_REF        Token,\r
+  IN OUT UINT16            *Index,\r
+  IN     UINT16            LineWidth,\r
+  IN     CHAR16            *LanguageString,\r
+  IN OUT UINT16            *BufferLength,\r
+  OUT    EFI_STRING        StringBuffer\r
+  );\r
+\r
+/**\r
+  Allows a program to extract a form or form package that has previously \r
+  been registered with the HII database.\r
+\r
+  @param  This A pointer to the EFI_HII_PROTOCOL instance.\r
+  \r
+  @param  Handle Handle on which the form resides.\r
+  \r
+  @param  FormId The ID of the form to return. If the ID is zero, \r
+  the entire form package is returned. \r
+  \r
+  @param  BufferLength On input, the length of the Buffer. On output, \r
+  the length of the returned buffer, \r
+  \r
+  @param  Buffer The buffer designed to receive the form(s).\r
+\r
+  @retval EFI_SUCCESS Buffer filled with the requested forms. BufferLength \r
+  was updated.\r
+  \r
+  @retval EFI_INVALID_PARAMETER The handle is unknown.\r
+  \r
+  @retval EFI_NOT_FOUND A form on the requested handle cannot be found with \r
+  the requested FormId.\r
+  \r
+  @retval EFI_BUFFER_TOO_SMALL The buffer provided was not large enough \r
+  to allow the form to be stored. \r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_HII_GET_FORMS) (\r
+  IN     EFI_HII_PROTOCOL  *This,\r
+  IN     EFI_HII_HANDLE    Handle,\r
+  IN     EFI_FORM_ID       FormId,\r
+  IN OUT UINTN             *BufferLength,\r
+  OUT    UINT8             *Buffer\r
+  );\r
+\r
+/**\r
+  Extracts the defaults that are associated with a given handle in the HII database.\r
+\r
+  @param  This A pointer to the EFI_HII_PROTOCOL instance.\r
+  \r
+  @param  Handle The HII handle from which will have default data retrieved.\r
+  \r
+  @param  DefaultMask The mask used to specify some type of default override when extracting \r
+  the default image data.\r
+  \r
+  @param  VariablePackList A indirect pointer to the first entry of a link list with \r
+  type EFI_HII_VARIABLE_PACK_LIST. \r
+\r
+  @retval EFI_SUCCESS The VariablePackList was populated with the appropriate \r
+  default setting data.\r
+  \r
+  @retval EFI_NOT_FOUND The IFR does not have any explicit or default map(s).\r
+  \r
+  @retval EFI_INVALID_PARAMETER The HII database entry associated with Handle \r
+  contain invalid data.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_HII_GET_DEFAULT_IMAGE) (\r
+  IN     EFI_HII_PROTOCOL           *This,\r
+  IN     EFI_HII_HANDLE             Handle,\r
+  IN     UINTN                      DefaultMask,\r
+  OUT    EFI_HII_VARIABLE_PACK_LIST **VariablePackList\r
+  );\r
+\r
+/**\r
+  Allows the caller to update a form or form package that has previously been \r
+  registered with the EFI HII database.\r
+\r
+  @param  This A pointer to the EFI_HII_PROTOCOL instance.\r
+  \r
+  @param  Handle Handle of the package where the form to be updated resides.\r
+  \r
+  @param  Label The label inside the form package where the update is to take place.\r
+  \r
+  @param  AddData If TRUE, adding data at a given Label; otherwise, \r
+  if FALSE, removing data at a given Label.\r
+  \r
+  @param  Data The buffer containing the new tags to insert after the Label\r
+\r
+  @retval EFI_SUCCESS The form was updated with the new tags.\r
+  \r
+  @retval EFI_INVALID_PARAMETER The buffer for the buffer length does not \r
+  contain an integral number of tags.\r
+  \r
+  @retval EFI_NOT_FOUND The Handle, Label, or FormId was not found. \r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_HII_UPDATE_FORM) (\r
+  IN EFI_HII_PROTOCOL     *This,\r
+  IN EFI_HII_HANDLE       Handle,\r
+  IN EFI_FORM_LABEL       Label,\r
+  IN BOOLEAN              AddData,\r
+  IN EFI_HII_UPDATE_DATA  *Data\r
+  );\r
+\r
+/**\r
+  Retrieves the current keyboard layout. \r
+\r
+  @param  This A pointer to the EFI_HII_PROTOCOL instance.\r
+  \r
+  @param  DescriptorCount A pointer to the number of Descriptor entries being \r
+  described in the keyboard layout being retrieved.\r
+  \r
+  @param  Descriptor A pointer to a buffer containing an array of EFI_KEY_DESCRIPTOR \r
+  entries. Each entry will reflect the definition of a specific physical key.\r
+\r
+  @retval EFI_SUCCESS The keyboard layout was retrieved successfully.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_HII_GET_KEYBOARD_LAYOUT) (\r
+  IN     EFI_HII_PROTOCOL    *This,\r
+  OUT    UINT16              *DescriptorCount,\r
+  OUT    EFI_KEY_DESCRIPTOR  *Descriptor\r
+  );\r
+\r
+/**\r
+  @par Protocol Description:\r
+  The HII Protocol manages the HII database, which is a repository for data \r
+  having to do with fonts, strings, forms, keyboards, and other future human \r
+  interface items.\r
+\r
+  @param NewPack\r
+  Extracts the various packs from a package list.\r
+\r
+  @param RemovePack\r
+  Removes a package from the HII database.\r
+\r
+  @param FindHandles\r
+  Determines the handles that are currently active in the database.\r
+\r
+  @param ExportDatabase\r
+  Export the entire contents of the database to a buffer.\r
+\r
+  @param TestString\r
+  Tests if all of the characters in a string have corresponding font characters.\r
+\r
+  @param GetGlyph\r
+  Translates a Unicode character into the corresponding font glyph. \r
+\r
+  @param GlyphToBlt\r
+  Converts a glyph value into a format that is ready for a UGA BLT command. \r
+\r
+  @param NewString\r
+  Allows a new string to be added to an already existing string package.\r
+\r
+  @param GetPrimaryLanguages\r
+  Allows a program to determine the primary languages that are supported \r
+  on a given handle. \r
+\r
+  @param GetSecondaryLanguages\r
+  Allows a program to determine which secondary languages are supported \r
+  on a given handle for a given primary language.\r
+\r
+  @param GetString\r
+  Extracts a string from a package that is already registered with the \r
+  EFI HII database. \r
+\r
+  @param ResetString\r
+  Remove any new strings that were added after the initial string export \r
+  for this handle.\r
+\r
+  @param GetLine\r
+  Allows a program to extract a part of a string of not more than a given width.\r
+\r
+  @param GetForms\r
+  Allows a program to extract a form or form package that has been previously registered.\r
+\r
+  @param GetDefaultImage\r
+  Allows a program to extract the nonvolatile image that represents the default storage image. \r
+\r
+  @param UpdateForm\r
+  Allows a program to update a previously registered form. \r
+\r
+  @param GetKeyboardLayout\r
+  Allows a program to extract the current keyboard layout.\r
+\r
+**/\r
+struct _EFI_HII_PROTOCOL {\r
+  EFI_HII_NEW_PACK            NewPack;\r
+  EFI_HII_REMOVE_PACK         RemovePack;\r
+  EFI_HII_FIND_HANDLES        FindHandles;\r
+  EFI_HII_EXPORT              ExportDatabase;\r
+\r
+  EFI_HII_TEST_STRING         TestString;\r
+  EFI_HII_GET_GLYPH           GetGlyph;\r
+  EFI_HII_GLYPH_TO_BLT        GlyphToBlt;\r
+\r
+  EFI_HII_NEW_STRING          NewString;\r
+  EFI_HII_GET_PRI_LANGUAGES   GetPrimaryLanguages;\r
+  EFI_HII_GET_SEC_LANGUAGES   GetSecondaryLanguages;\r
+  EFI_HII_GET_STRING          GetString;\r
+  EFI_HII_RESET_STRINGS       ResetStrings;\r
+  EFI_HII_GET_LINE            GetLine;\r
+  EFI_HII_GET_FORMS           GetForms;\r
+  EFI_HII_GET_DEFAULT_IMAGE   GetDefaultImage;\r
+  EFI_HII_UPDATE_FORM         UpdateForm;\r
+\r
+  EFI_HII_GET_KEYBOARD_LAYOUT GetKeyboardLayout;\r
+};\r
+\r
+extern EFI_GUID gEfiHiiProtocolGuid;\r
+\r
+#endif\r
diff --git a/Tools/Source/TianoTools/Include/Protocol/IP4.h b/Tools/Source/TianoTools/Include/Protocol/IP4.h
new file mode 100644 (file)
index 0000000..0decc17
--- /dev/null
@@ -0,0 +1,411 @@
+/** @file\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. This program and the accompanying materials                          \r
+  are licensed and made available under the terms and conditions of the BSD License         \r
+  which accompanies this distribution.  The full text of the license may be found at        \r
+  http://opensource.org/licenses/bsd-license.php                                            \r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+  Module Name:  IP4.h\r
+\r
+**/\r
+\r
+#ifndef __EFI_IP4_PROTOCOL_H__\r
+#define __EFI_IP4_PROTOCOL_H__\r
+\r
+#define EFI_IP4_SERVICE_BINDING_PROTOCOL_GUID \\r
+  { \\r
+    0xc51711e7, 0xb4bf, 0x404a, {0xbf, 0xb8, 0x0a, 0x04, 0x8e, 0xf1, 0xff, 0xe4 } \\r
+  }\r
+\r
+#define EFI_IP4_PROTOCOL_GUID \\r
+  { \\r
+    0x41d94cd2, 0x35b6, 0x455a, {0x82, 0x58, 0xd4, 0xe5, 0x13, 0x34, 0xaa, 0xdd } \\r
+  }\r
+\r
+typedef struct _EFI_IP4_PROTOCOL EFI_IP4_PROTOCOL;\r
+  \r
+typedef struct {\r
+  EFI_IPv4_ADDRESS        Ip4Address;\r
+  EFI_IPv4_ADDRESS        SubnetMask;\r
+} EFI_IP4_ADDRESS_PAIR; \r
+\r
+typedef struct {\r
+  EFI_HANDLE              DriverHandle;\r
+  UINT32                  AddressCount;\r
+  EFI_IP4_ADDRESS_PAIR    AddressPairs[1];\r
+} EFI_IP4_VARIABLE_DATA;\r
+\r
+typedef struct {\r
+  UINT8                   DefaultProtocol;\r
+  BOOLEAN                 AcceptAnyProtocol;\r
+  BOOLEAN                 AcceptIcmpErrors;\r
+  BOOLEAN                 AcceptBroadcast;\r
+  BOOLEAN                 AcceptPromiscuous;\r
+  BOOLEAN                 UseDefaultAddress;\r
+  EFI_IPv4_ADDRESS        StationAddress;\r
+  EFI_IPv4_ADDRESS        SubnetMask;\r
+  UINT8                   TypeOfService;\r
+  UINT8                   TimeToLive;\r
+  BOOLEAN                 DoNotFragment;\r
+  BOOLEAN                 RawData;\r
+  UINT32                  ReceiveTimeout;\r
+  UINT32                  TransmitTimeout;\r
+} EFI_IP4_CONFIG_DATA;\r
+\r
+\r
+typedef struct {\r
+  EFI_IPv4_ADDRESS        SubnetAddress;\r
+  EFI_IPv4_ADDRESS        SubnetMask;\r
+  EFI_IPv4_ADDRESS        GatewayAddress;\r
+} EFI_IP4_ROUTE_TABLE;\r
+\r
+typedef struct {\r
+  UINT8                   Type;\r
+  UINT8                   Code;\r
+} EFI_IP4_ICMP_TYPE;\r
+\r
+typedef struct {\r
+  BOOLEAN                 IsStarted;\r
+  EFI_IP4_CONFIG_DATA     ConfigData;\r
+  BOOLEAN                 IsConfigured;\r
+  UINT32                  GroupCount;\r
+  EFI_IPv4_ADDRESS        *GroupTable;\r
+  UINT32                  RouteCount;\r
+  EFI_IP4_ROUTE_TABLE     *RouteTable;\r
+  UINT32                  IcmpTypeCount;\r
+  EFI_IP4_ICMP_TYPE       *IcmpTypeList;\r
+} EFI_IP4_MODE_DATA;\r
+\r
+#pragma pack(1)\r
+\r
+typedef struct {\r
+#ifdef EFI_NET_LITTLE_ENDIAN\r
+  UINT8                   HeaderLength:4;\r
+  UINT8                   Version:4;\r
+#else \r
+  UINT8                   Version:4;\r
+  UINT8                   HeaderLength:4;\r
+#endif\r
+  UINT8                   TypeOfService;\r
+  UINT16                  TotalLength;\r
+  UINT16                  Identification;\r
+  UINT16                  Fragmentation;\r
+  UINT8                   TimeToLive;\r
+  UINT8                   Protocol;\r
+  UINT16                  Checksum;\r
+  EFI_IPv4_ADDRESS        SourceAddress;\r
+  EFI_IPv4_ADDRESS        DestinationAddress;\r
+} EFI_IP4_HEADER;\r
+#pragma pack()\r
+\r
+\r
+typedef struct {\r
+  UINT32                  FragmentLength;\r
+  VOID                    *FragmentBuffer;\r
+} EFI_IP4_FRAGMENT_DATA;\r
+\r
+\r
+typedef struct {\r
+  EFI_TIME               TimeStamp;\r
+  EFI_EVENT              RecycleSignal;\r
+  UINT32                 HeaderLength;\r
+  EFI_IP4_HEADER         *Header;\r
+  UINT32                 OptionsLength;\r
+  VOID                   *Options;\r
+  UINT32                 DataLength;\r
+  UINT32                 FragmentCount;\r
+  EFI_IP4_FRAGMENT_DATA  FragmentTable[1];\r
+} EFI_IP4_RECEIVE_DATA;\r
+\r
+\r
+typedef struct {\r
+  EFI_IPv4_ADDRESS       SourceAddress;\r
+  EFI_IPv4_ADDRESS       GatewayAddress;\r
+  UINT8                  Protocol;\r
+  UINT8                  TypeOfService;\r
+  UINT8                  TimeToLive;\r
+  BOOLEAN                DoNotFragment;\r
+} EFI_IP4_OVERRIDE_DATA;\r
+\r
+typedef struct {\r
+  EFI_IPv4_ADDRESS       DestinationAddress;\r
+  EFI_IP4_OVERRIDE_DATA  *OverrideData;      //OPTIONAL\r
+  UINT32                 OptionsLength;      //OPTIONAL\r
+  VOID                   *OptionsBuffer;     //OPTIONAL\r
+  UINT32                 TotalDataLength;\r
+  UINT32                 FragmentCount;\r
+  EFI_IP4_FRAGMENT_DATA  FragmentTable[1];\r
+} EFI_IP4_TRANSMIT_DATA;\r
+\r
+typedef struct {\r
+  EFI_EVENT                Event;\r
+  EFI_STATUS               Status;\r
+  union {\r
+    EFI_IP4_RECEIVE_DATA   *RxData;\r
+    EFI_IP4_TRANSMIT_DATA  *TxData;\r
+  } Packet;\r
+} EFI_IP4_COMPLETION_TOKEN;\r
+\r
+/**\r
+  Gets the current operational settings for this instance of the EFI IPv4 Protocol driver.\r
+\r
+  @param  This          Pointer to the EFI_IP4_PROTOCOL instance.\r
+  @param  Ip4ModeData   Pointer to the EFI IPv4 Protocol mode data structure.\r
+  @param  MnpConfigData Pointer to the managed network configuration data structure.\r
+  @param  SnpData       Pointer to the simple network mode data structure.\r
+\r
+  @retval EFI_SUCCESS           The operation completed successfully.\r
+  @retval EFI_INVALID_PARAMETER This is NULL.\r
+  @retval EFI_OUT_OF_RESOURCES  The required mode data could not be allocated.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_IP4_GET_MODE_DATA) (\r
+  IN  EFI_IP4_PROTOCOL                *This,\r
+  OUT EFI_IP4_MODE_DATA               *Ip4ModeData     OPTIONAL,\r
+  OUT EFI_MANAGED_NETWORK_CONFIG_DATA *MnpConfigData   OPTIONAL,\r
+  OUT EFI_SIMPLE_NETWORK_MODE         *SnpModeData     OPTIONAL\r
+  )\r
+;  \r
+\r
+/**\r
+  Assigns an IPv4 address and subnet mask to this EFI IPv4 Protocol driver instance.\r
+\r
+  @param  This         Pointer to the EFI_IP4_PROTOCOL instance.\r
+  @param  IpConfigData Pointer to the EFI IPv4 Protocol configuration data structure.\r
+\r
+  @retval EFI_SUCCESS           The driver instance was successfully opened.\r
+  @retval EFI_NO_MAPPING        When using the default address, configuration (DHCP, BOOTP,\r
+                                RARP, etc.) is not finished yet.\r
+  @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:\r
+  @retval EFI_UNSUPPORTED       One or more of the following conditions is TRUE:\r
+                                A configuration protocol (DHCP, BOOTP, RARP, etc.) could\r
+                                not be located when clients choose to use the default IPv4\r
+                                address. This EFI IPv4 Protocol implementation does not\r
+                                support this requested filter or timeout setting.\r
+  @retval EFI_OUT_OF_RESOURCES  The EFI IPv4 Protocol driver instance data could not be allocated.\r
+  @retval EFI_ALREADY_STARTED   The interface is already open and must be stopped before the\r
+                                IPv4 address or subnet mask can be changed. The interface must\r
+                                also be stopped when switching to/from raw packet mode.\r
+  @retval EFI_DEVICE_ERROR      An unexpected system or network error occurred. The EFI IPv4\r
+                                 Protocol driver instance is not opened.\r
+\r
+**/\r
+typedef \r
+EFI_STATUS\r
+(EFIAPI *EFI_IP4_CONFIGURE) (\r
+  IN EFI_IP4_PROTOCOL    *This,\r
+  IN EFI_IP4_CONFIG_DATA *IpConfigData     OPTIONAL\r
+  )\r
+;  \r
+\r
+/**\r
+  Joins and leaves multicast groups.\r
+\r
+  @param  This                  Pointer to the EFI_IP4_PROTOCOL instance.\r
+  @param  JoinFlag              Set to TRUE to join the multicast group session and FALSE to leave.\r
+  @param  GroupAddress          Pointer to the IPv4 multicast address.\r
+\r
+  @retval EFI_SUCCESS           The operation completed successfully.\r
+  @retval EFI_INVALID_PARAMETER One or more of the following is TRUE:\r
+                                - This is NULL.\r
+                                - JoinFlag is TRUE and GroupAddress is NULL.\r
+                                - GroupAddress is not NULL and *GroupAddress is\r
+                                not a multicast IPv4 address.\r
+  @retval EFI_NOT_STARTED       This instance has not been started.\r
+  @retval EFI_NO_MAPPING        When using the default address, configuration (DHCP, BOOTP,\r
+                                RARP, etc.) is not finished yet.\r
+  @retval EFI_OUT_OF_RESOURCES  System resources could not be allocated.\r
+  @retval EFI_UNSUPPORTED       This EFI IPv4 Protocol implementation does not support multicast groups.\r
+  @retval EFI_ALREADY_STARTED   The group address is already in the group table (when\r
+                                JoinFlag is TRUE).\r
+  @retval EFI_NOT_FOUND         The group address is not in the group table (when JoinFlag is FALSE).\r
+  @retval EFI_DEVICE_ERROR      An unexpected system or network error occurred.\r
+\r
+**/\r
+typedef \r
+EFI_STATUS\r
+(EFIAPI *EFI_IP4_GROUPS) (\r
+  IN EFI_IP4_PROTOCOL    *This,\r
+  IN BOOLEAN             JoinFlag,\r
+  IN EFI_IPv4_ADDRESS    *GroupAddress  OPTIONAL\r
+  )\r
+;    \r
+\r
+/**\r
+  Adds and deletes routing table entries.\r
+\r
+  @param  This                   Pointer to the EFI_IP4_PROTOCOL instance.\r
+  @param  DeleteRoute            Set to TRUE to delete this route from the routing table. Set to\r
+                                 FALSE to add this route to the routing table. SubnetAddress\r
+                                 and SubnetMask are used as the key to each route entry.\r
+  @param  SubnetAddress          The address of the subnet that needs to be routed.\r
+  @param  SubnetMask             The subnet mask of SubnetAddress.\r
+  @param  GatewayAddress         The unicast gateway IPv4 address for this route.\r
+\r
+  @retval EFI_SUCCESS            The operation completed successfully.\r
+  @retval EFI_NOT_STARTED        The driver instance has not been started.\r
+  @retval EFI_NO_MAPPING         When using the default address, configuration (DHCP, BOOTP,\r
+                                 RARP, etc.) is not finished yet.\r
+  @retval EFI_INVALID_PARAMETER  One or more of the following conditions is TRUE:\r
+                                 - This is NULL.\r
+                                 - SubnetAddress is NULL.\r
+                                 - SubnetMask is NULL.\r
+                                 - GatewayAddress is NULL.\r
+                                 - *SubnetAddress is not a valid subnet address.\r
+                                 - *SubnetMask is not a valid subnet mask.\r
+                                 - *GatewayAddress is not a valid unicast IPv4 address.\r
+  @retval EFI_OUT_OF_RESOURCES   Could not add the entry to the routing table.\r
+  @retval EFI_NOT_FOUND          This route is not in the routing table (when DeleteRoute is TRUE).\r
+  @retval EFI_ACCESS_DENIED      The route is already defined in the routing table (when\r
+                                  DeleteRoute is FALSE).\r
+                                 \r
+**/\r
+typedef \r
+EFI_STATUS\r
+(EFIAPI *EFI_IP4_ROUTES) (\r
+  IN EFI_IP4_PROTOCOL    *This,\r
+  IN BOOLEAN             DeleteRoute,\r
+  IN EFI_IPv4_ADDRESS    *SubnetAddress,\r
+  IN EFI_IPv4_ADDRESS    *SubnetMask,\r
+  IN EFI_IPv4_ADDRESS    *GatewayAddress  \r
+  )\r
+;  \r
+\r
+/**\r
+  Places outgoing data packets into the transmit queue.\r
+\r
+  @param  This  Pointer to the EFI_IP4_PROTOCOL instance.\r
+  @param  Token Pointer to the transmit token.\r
+\r
+  @retval  EFI_SUCCESS           The data has been queued for transmission.\r
+  @retval  EFI_NOT_STARTED       This instance has not been started.\r
+  @retval  EFI_NO_MAPPING        When using the default address, configuration (DHCP, BOOTP,\r
+                                 RARP, etc.) is not finished yet.\r
+  @retval  EFI_INVALID_PARAMETER One or more pameters are invalid.\r
+  @retval  EFI_ACCESS_DENIED     The transmit completion token with the same Token.Event\r
+                                 was already in the transmit queue.\r
+  @retval  EFI_NOT_READY         The completion token could not be queued because the transmit\r
+                                 queue is full. \r
+  @retval  EFI_NOT_FOUND         Not route is found to destination address.\r
+  @retval  EFI_OUT_OF_RESOURCES  Could not queue the transmit data.\r
+  @retval  EFI_BUFFER_TOO_SMALL  Token.Packet.TxData.TotalDataLength is too\r
+                                 short to transmit.\r
+  @retval  EFI_BAD_BUFFER_SIZE   The length of the IPv4 header + option length + total data length is\r
+                                 greater than MTU (or greater than the maximum packet size if\r
+                                 Token.Packet.TxData.OverrideData.\r
+                                 DoNotFragment is TRUE.)\r
+\r
+**/\r
+typedef \r
+EFI_STATUS\r
+(EFIAPI *EFI_IP4_TRANSMIT) (\r
+  IN EFI_IP4_PROTOCOL          *This,\r
+  IN EFI_IP4_COMPLETION_TOKEN  *Token\r
+  )\r
+;    \r
+\r
+/**\r
+  Places a receiving request into the receiving queue.\r
+\r
+  @param  This  Pointer to the EFI_IP4_PROTOCOL instance.\r
+  @param  Token Pointer to a token that is associated with the receive data descriptor.\r
+\r
+  @retval EFI_SUCCESS           The receive completion token was cached.\r
+  @retval EFI_NOT_STARTED       This EFI IPv4 Protocol instance has not been started.\r
+  @retval EFI_NO_MAPPING        When using the default address, configuration (DHCP, BOOTP, RARP, etc.)\r
+                                is not finished yet.\r
+  @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:\r
+                                - This is NULL.\r
+                                - Token is NULL.\r
+                                - Token.Event is NULL.\r
+  @retval EFI_OUT_OF_RESOURCES  The receive completion token could not be queued due to a lack of system\r
+                                resources (usually memory).\r
+  @retval EFI_DEVICE_ERROR      An unexpected system or network error occurred.\r
+                                The EFI IPv4 Protocol instance has been reset to startup defaults.\r
+                                EFI_ACCESS_DENIED The receive completion token with the same Token.Event was already\r
+                                in the receive queue.\r
+  @retval EFI_NOT_READY         The receive request could not be queued because the receive queue is full.\r
+  @retval EFI_ICMP_ERROR        An ICMP error packet was received.\r
+\r
+**/\r
+typedef \r
+EFI_STATUS\r
+(EFIAPI *EFI_IP4_RECEIVE) (\r
+  IN EFI_IP4_PROTOCOL          *This,\r
+  IN EFI_IP4_COMPLETION_TOKEN  *Token\r
+  )\r
+;      \r
+\r
+/**\r
+  Abort an asynchronous transmit or receive request.\r
+\r
+  @param  This  Pointer to the EFI_IP4_PROTOCOL instance.\r
+  @param  Token Pointer to a token that has been issued by\r
+                EFI_IP4_PROTOCOL.Transmit() or\r
+                EFI_IP4_PROTOCOL.Receive(). If NULL, all pending\r
+                tokens are aborted. Type EFI_IP4_COMPLETION_TOKEN is\r
+                defined in EFI_IP4_PROTOCOL.Transmit().\r
+\r
+  @retval EFI_SUCCESS           The asynchronous I/O request was aborted and\r
+                                Token.->Event was signaled. When Token is NULL, all\r
+                                pending requests were aborted and their events were signaled.\r
+  @retval EFI_INVALID_PARAMETER This is NULL.\r
+  @retval EFI_NOT_STARTED       This instance has not been started.\r
+  @retval EFI_NO_MAPPING        When using the default address, configuration (DHCP, BOOTP,\r
+                                RARP, etc.) is not finished yet.\r
+  @retval EFI_NOT_FOUND         When Token is not NULL, the asynchronous I/O request was\r
+                                not found in the transmit or receive queue. It has either completed\r
+                                or was not issued by Transmit() and Receive().\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_IP4_CANCEL) (\r
+  IN EFI_IP4_PROTOCOL          *This,\r
+  IN EFI_IP4_COMPLETION_TOKEN  *Token OPTIONAL\r
+  )\r
+;      \r
+  \r
+/**\r
+  Polls for incoming data packets and processes outgoing data packets.\r
+\r
+  @param  This Pointer to the EFI_IP4_PROTOCOL instance.\r
+\r
+  @retval  EFI_SUCCESS           Incoming or outgoing data was processed.\r
+  @retval  EFI_NOT_STARTED       This EFI IPv4 Protocol instance has not been started.\r
+  @retval  EFI_NO_MAPPING        When using the default address, configuration (DHCP, BOOTP,\r
+                                 RARP, etc.) is not finished yet.\r
+  @retval  EFI_INVALID_PARAMETER This is NULL.\r
+  @retval  EFI_DEVICE_ERROR      An unexpected system or network error occurred.\r
+  @retval  EFI_NOT_READY         No incoming or outgoing data is processed.\r
+  @retval  EFI_TIMEOUT           Data was dropped out of the transmit and/or receive queue.\r
+                                 Consider increasing the polling rate.\r
+\r
+**/\r
+typedef \r
+EFI_STATUS\r
+(EFIAPI *EFI_IP4_POLL) (\r
+  IN EFI_IP4_PROTOCOL          *This\r
+  )\r
+;  \r
+\r
+struct _EFI_IP4_PROTOCOL {\r
+  EFI_IP4_GET_MODE_DATA        GetModeData;\r
+  EFI_IP4_CONFIGURE            Configure;\r
+  EFI_IP4_GROUPS               Groups;\r
+  EFI_IP4_ROUTES               Routes;\r
+  EFI_IP4_TRANSMIT             Transmit;\r
+  EFI_IP4_RECEIVE              Receive;\r
+  EFI_IP4_CANCEL               Cancel;\r
+  EFI_IP4_POLL                 Poll;\r
+};\r
+\r
+extern EFI_GUID gEfiIp4ServiceBindingProtocolGuid;\r
+extern EFI_GUID gEfiIp4ProtocolGuid;\r
+\r
+#endif\r
diff --git a/Tools/Source/TianoTools/Include/Protocol/IP4Config.h b/Tools/Source/TianoTools/Include/Protocol/IP4Config.h
new file mode 100644 (file)
index 0000000..0212f35
--- /dev/null
@@ -0,0 +1,121 @@
+/** @file\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. This program and the accompanying materials                          \r
+  are licensed and made available under the terms and conditions of the BSD License         \r
+  which accompanies this distribution.  The full text of the license may be found at        \r
+  http://opensource.org/licenses/bsd-license.php                                            \r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+  Module Name:  IP4Config.h\r
+\r
+**/\r
+\r
+#ifndef __EFI_IP4CONFIG_PROTOCOL_H__\r
+#define __EFI_IP4CONFIG_PROTOCOL_H__\r
+\r
+#define EFI_IP4_CONFIG_PROTOCOL_GUID \\r
+  { \\r
+    0x3b95aa31, 0x3793, 0x434b, {0x86, 0x67, 0xc8, 0x07, 0x08, 0x92, 0xe0, 0x5e } \\r
+  }\r
+\r
+typedef struct _EFI_IP4_CONFIG_PROTOCOL EFI_IP4_CONFIG_PROTOCOL;\r
+\r
+#define IP4_CONFIG_VARIABLE_ATTRIBUTES \\r
+        (EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS | \\r
+         EFI_VARIABLE_RUNTIME_ACCESS )\r
+\r
+typedef struct {\r
+  EFI_IPv4_ADDRESS             StationAddress;\r
+  EFI_IPv4_ADDRESS             SubnetMask;\r
+  UINT32                       RouteTableSize;\r
+  EFI_IP4_ROUTE_TABLE          *RouteTable;    //OPTIONAL\r
+} EFI_IP4_IPCONFIG_DATA;\r
+\r
+\r
+/**\r
+  Starts running the configuration policy for the EFI IPv4 Protocol driver.\r
+\r
+  @param  This          Pointer to the EFI_IP4_CONFIG_PROTOCOL instance.\r
+  @param  DoneEvent     Event that will be signaled when the EFI IPv4 Protocol driver\r
+                        configuration policy completes execution. This event must be of\r
+                        type EVT_NOTIFY_SIGNAL.\r
+  @param  ReconfigEvent Event that will be signaled when the EFI IPv4 Protocol driver\r
+                        configuration needs to be updated. This event must be of type\r
+                        EVT_NOTIFY_SIGNAL.\r
+\r
+  @retval EFI_SUCCESS           The configuration policy for the EFI IPv4 Protocol driver is now\r
+                                running.\r
+  @retval EFI_INVALID_PARAMETER This, DoneEvent, or ReconfigEvent is NULL.\r
+  @retval EFI_OUT_OF_RESOURCES  Required system resources could not be allocated.\r
+  @retval EFI_ALREADY_STARTED   The configuration policy for the EFI IPv4 Protocol driver was\r
+                                already started.\r
+  @retval EFI_DEVICE_ERROR      An unexpected system error or network error occurred.\r
+  @retval EFI_UNSUPPORTED       This interface does not support the EFI IPv4 Protocol driver\r
+                                 configuration.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_IP4_CONFIG_START) (\r
+  IN EFI_IP4_CONFIG_PROTOCOL   *This,\r
+  IN EFI_EVENT                 DoneEvent,\r
+  IN EFI_EVENT                 ReconfigEvent \r
+  )\r
+;    \r
+\r
+/**\r
+  Stops running the configuration policy for the EFI IPv4 Protocol driver.\r
+\r
+  @param  This Pointer to the EFI_IP4_CONFIG_PROTOCOL instance.\r
+\r
+  @retval EFI_SUCCESS           The configuration policy for the EFI IPv4 Protocol driver has been stopped.\r
+  @retval EFI_INVALID_PARAMETER This is NULL.\r
+  @retval EFI_NOT_STARTED       The configuration policy for the EFI IPv4 Protocol driver was not started.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_IP4_CONFIG_STOP) (\r
+  IN EFI_IP4_CONFIG_PROTOCOL   *This \r
+  )\r
+;   \r
+\r
+/**\r
+  Returns the default configuration data (if any) for the EFI IPv4 Protocol driver.\r
+\r
+  @param  This             Pointer to the EFI_IP4_CONFIG_PROTOCOL instance.\r
+  @param  IpConfigDataSize On input, the size of the IpConfigData buffer.\r
+                           On output, the count of bytes that were written into the IpConfigData buffer.\r
+  @param  IpConfigData     Pointer to the EFI IPv4 Configuration Protocol driver\r
+                           configuration data structure.\r
+\r
+  @retval EFI_SUCCESS           The EFI IPv4 Protocol driver configuration has been returned.\r
+  @retval EFI_INVALID_PARAMETER This is NULL.\r
+  @retval EFI_NOT_STARTED       The configuration policy for the EFI IPv4 Protocol driver is not\r
+                                running.\r
+  @retval EFI_NOT_READY         EFI IPv4 Protocol driver configuration is still running.\r
+  @retval EFI_ABORTED           EFI IPv4 Protocol driver configuration could not complete.\r
+  @retval EFI_BUFFER_TOO_SMALL  *IpConfigDataSize is smaller than the configuration data\r
+                                buffer or IpConfigData is NULL.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_IP4_CONFIG_GET_DATA) (\r
+  IN EFI_IP4_CONFIG_PROTOCOL   *This,\r
+  IN OUT UINTN                 *IpConfigDataSize,\r
+  OUT EFI_IP4_IPCONFIG_DATA    *IpConfigData    OPTIONAL \r
+  )\r
+;    \r
+\r
+struct _EFI_IP4_CONFIG_PROTOCOL {\r
+  EFI_IP4_CONFIG_START         Start;\r
+  EFI_IP4_CONFIG_STOP          Stop;\r
+  EFI_IP4_CONFIG_GET_DATA      GetData;\r
+};\r
+\r
+extern EFI_GUID gEfiIp4ConfigProtocolGuid;\r
+\r
+#endif\r
diff --git a/Tools/Source/TianoTools/Include/Protocol/IScsiInitatorName.h b/Tools/Source/TianoTools/Include/Protocol/IScsiInitatorName.h
new file mode 100644 (file)
index 0000000..48131e8
--- /dev/null
@@ -0,0 +1,92 @@
+/** @file\r
+  EFI_ISCSI_INITIATOR_NAME_PROTOCOL as defined in UEFI 2.0.\r
+  It rovides the ability to get and set the iSCSI Initiator Name.                                                  \r
+\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. This program and the accompanying materials                          \r
+  are licensed and made available under the terms and conditions of the BSD License         \r
+  which accompanies this distribution.  The full text of the license may be found at        \r
+  http://opensource.org/licenses/bsd-license.php                                            \r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+  Module Name:  IScsiInitatorName.h\r
+\r
+**/\r
+\r
+#ifndef __ISCSI_INITIATOR_NAME_H__\r
+#define __ISCSI_INITIATOR_NAME_H__\r
+\r
+#define EFI_ISCSI_INITIATOR_NAME_PROTOCOL_GUID \\r
+{ \\r
+  0xa6a72875, 0x2962, 0x4c18, {0x9f, 0x46, 0x8d, 0xa6, 0x44, 0xcc, 0xfe } \\r
+}\r
+\r
+typedef struct _EFI_ISCSI_INITIATOR_NAME_PROTOCOL EFI_ISCSI_INITIATOR_NAME_PROTOCOL;\r
+\r
+/**\r
+  Retrieves the current set value of iSCSI Initiator Name.\r
+\r
+  @param  This       Pointer to the EFI_ISCSI_INITIATOR_NAME_PROTOCOL instance.\r
+  @param  BufferSize Size of the buffer in bytes pointed to by Buffer / Actual size of the\r
+                     variable data buffer.\r
+  @param  Buffer     Pointer to the buffer for data to be read.\r
+\r
+  @retval EFI_SUCCESS           Data was successfully retrieved into the provided buffer and the\r
+                                BufferSize was sufficient to handle the iSCSI initiator name\r
+  @retval EFI_BUFFER_TOO_SMALL  BufferSize is too small for the result.\r
+  @retval EFI_INVALID_PARAMETER BufferSize or Buffer is NULL.\r
+  @retval EFI_DEVICE_ERROR      The iSCSI initiator name could not be retrieved due to a hardware error.\r
+\r
+**/\r
+typedef \r
+EFI_STATUS\r
+(EFIAPI *EFI_ISCSI_INITIATOR_NAME_GET) (\r
+  IN EFI_ISCSI_INITIATOR_NAME_PROTOCOL *This,\r
+  IN OUT UINTN                         *BufferSize,\r
+  OUT VOID                             *Buffer\r
+  )\r
+;\r
+\r
+  \r
+\r
+/**\r
+  Sets the iSCSI Initiator Name.\r
+\r
+  @param  This       Pointer to the EFI_ISCSI_INITIATOR_NAME_PROTOCOL instance.\r
+  @param  BufferSize Size of the buffer in bytes pointed to by Buffer.\r
+  @param  Buffer     Pointer to the buffer for data to be written.\r
+\r
+  @retval EFI_SUCCESS           Data was successfully stored by the protocol.\r
+  @retval EFI_UNSUPPORTED       Platform policies do not allow for data to be written.\r
+  @retval EFI_INVALID_PARAMETER BufferSize or Buffer is NULL, or BufferSize exceeds the maximum allowed limit.\r
+  @retval EFI_DEVICE_ERROR      The data could not be stored due to a hardware error.\r
+  @retval EFI_OUT_OF_RESOURCES  Not enough storage is available to hold the data.\r
+  @retval EFI_PROTOCOL_ERROR    Input iSCSI initiator name does not adhere to RFC 3720\r
+                                (and other related protocols)\r
+\r
+**/\r
+typedef EFI_STATUS\r
+(EFIAPI *EFI_ISCSI_INITIATOR_NAME_SET) (\r
+  IN EFI_ISCSI_INITIATOR_NAME_PROTOCOL *This,\r
+  IN OUT UINTN                         *BufferSize,\r
+  IN VOID                              *Buffer\r
+  )\r
+;  \r
+\r
+struct _EFI_ISCSI_INITIATOR_NAME_PROTOCOL {\r
+  EFI_ISCSI_INITIATOR_NAME_GET         Get;\r
+  EFI_ISCSI_INITIATOR_NAME_SET         Set;\r
+};\r
+\r
+extern EFI_GUID gEfiIScsiInitiatorNameProtocolGuid;\r
+\r
+#endif\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
diff --git a/Tools/Source/TianoTools/Include/Protocol/IdeControllerInit.h b/Tools/Source/TianoTools/Include/Protocol/IdeControllerInit.h
new file mode 100644 (file)
index 0000000..beaac30
--- /dev/null
@@ -0,0 +1,485 @@
+/** @file\r
+  This file declares EFI IDE Controller Init Protocol\r
+\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. This program and the accompanying materials                          \r
+  are licensed and made available under the terms and conditions of the BSD License         \r
+  which accompanies this distribution.  The full text of the license may be found at        \r
+  http://opensource.org/licenses/bsd-license.php                                            \r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+  Module Name:  IdeControllerInit.h\r
+\r
+  @par Revision Reference:\r
+  This Protocol is defined in IDE Controller Initialization Protocol Specification\r
+  Version 0.9\r
+\r
+**/\r
+\r
+#ifndef _EFI_IDE_CONTROLLER_INIT_PROTOCOL_H\r
+#define _EFI_IDE_CONTROLLER_INIT_PROTOCOL_H\r
+\r
+//\r
+// Global ID for the EFI Platform IDE Protocol GUID\r
+//\r
+#define EFI_IDE_CONTROLLER_INIT_PROTOCOL_GUID \\r
+  { 0xa1e37052, 0x80d9, 0x4e65, {0xa3, 0x17, 0x3e, 0x9a, 0x55, 0xc4, 0x3e, 0xc9 } }\r
+\r
+//\r
+// Forward reference for pure ANSI compatability\r
+//\r
+typedef struct _EFI_IDE_CONTROLLER_INIT_PROTOCOL  EFI_IDE_CONTROLLER_INIT_PROTOCOL;\r
+\r
+//\r
+//////////////////////////////////////////////////////////////////////////////////////////\r
+// EFI_IDE_BUS_ENUMERATION_PHASE\r
+// EFI_IDE_CONTROLLER_ENUM_PHASE\r
+//\r
+typedef enum{\r
+  EfiIdeBeforeChannelEnumeration,\r
+  EfiIdeAfterChannelEnumeration,\r
+  EfiIdeBeforeChannelReset,\r
+  EfiIdeAfterChannelReset,\r
+  EfiIdeBusBeforeDevicePresenceDetection,\r
+  EfiIdeBusAfterDevicePresenceDetection,\r
+  EfiIdeResetMode,\r
+  EfiIdeBusPhaseMaximum\r
+} EFI_IDE_CONTROLLER_ENUM_PHASE;\r
+\r
+//\r
+//******************************************************\r
+// EFI_ATA_EXT_TRANSFER_PROTOCOL\r
+//******************************************************\r
+//\r
+// This extended mode describes the SATA physical protocol.\r
+// SATA physical layers can operate at different speeds. \r
+// These speeds are defined below. Various PATA protocols \r
+// and associated modes are not applicable to SATA devices.\r
+//\r
+\r
+typedef enum {\r
+  EfiAtaSataTransferProtocol  \r
+} EFI_ATA_EXT_TRANSFER_PROTOCOL;\r
+\r
+#define  EFI_SATA_AUTO_SPEED  0\r
+#define  EFI_SATA_GEN1_SPEED  1\r
+#define  EFI_SATA_GEN2_SPEED  2\r
+\r
+//\r
+//*******************************************************\r
+// EFI_IDE_CABLE_TYPE\r
+//*******************************************************\r
+//\r
+typedef enum {\r
+  EfiIdeCableTypeUnknown,\r
+  EfiIdeCableType40pin,\r
+  EfiIdeCableType80Pin,\r
+  EfiIdeCableTypeSerial,\r
+  EfiIdeCableTypeMaximum\r
+} EFI_IDE_CABLE_TYPE;\r
+\r
+//\r
+//******************************************************\r
+// EFI_ATA_MODE\r
+//******************************************************\r
+//\r
+typedef struct {\r
+  BOOLEAN      Valid;\r
+  UINT32       Mode; \r
+} EFI_ATA_MODE;\r
+\r
+//\r
+//******************************************************\r
+// EFI_ATA_EXTENDED_MODE\r
+//******************************************************\r
+//\r
+typedef struct {\r
+  EFI_ATA_EXT_TRANSFER_PROTOCOL  TransferProtocol;\r
+  UINT32                         Mode;\r
+} EFI_ATA_EXTENDED_MODE;\r
+\r
+//\r
+//******************************************************\r
+// EFI_ATA_COLLECTIVE_MODE\r
+//******************************************************\r
+//\r
+typedef struct {\r
+  EFI_ATA_MODE           PioMode; \r
+  EFI_ATA_MODE           SingleWordDmaMode;\r
+  EFI_ATA_MODE           MultiWordDmaMode;\r
+  EFI_ATA_MODE           UdmaMode;\r
+  UINT32                 ExtModeCount;\r
+  EFI_ATA_EXTENDED_MODE  ExtMode[1]; \r
+} EFI_ATA_COLLECTIVE_MODE;\r
+\r
+//\r
+//*******************************************************\r
+// EFI_ATA_IDENTIFY_DATA\r
+//*******************************************************\r
+//\r
+\r
+#pragma pack(1)\r
+\r
+typedef struct {   \r
+  UINT16  config;             // General Configuration\r
+  UINT16  cylinders;          // Number of Cylinders\r
+  UINT16  reserved_2;\r
+  UINT16  heads;              //Number of logical heads\r
+  UINT16  vendor_data1;\r
+  UINT16  vendor_data2;\r
+  UINT16  sectors_per_track;\r
+  UINT16  vendor_specific_7_9[3];\r
+  CHAR8   SerialNo[20];       // ASCII \r
+  UINT16  vendor_specific_20_21[2]; \r
+  UINT16  ecc_bytes_available;   \r
+  CHAR8   FirmwareVer[8];     // ASCII \r
+  CHAR8   ModelName[40];      // ASCII   \r
+  UINT16  multi_sector_cmd_max_sct_cnt;\r
+  UINT16  reserved_48;\r
+  UINT16  capabilities;\r
+  UINT16  reserved_50;    \r
+  UINT16  pio_cycle_timing;   \r
+  UINT16  reserved_52;            \r
+  UINT16  field_validity;    \r
+  UINT16  current_cylinders;\r
+  UINT16  current_heads;\r
+  UINT16  current_sectors;   \r
+  UINT16  CurrentCapacityLsb;\r
+  UINT16  CurrentCapacityMsb;    \r
+  UINT16  reserved_59;    \r
+  UINT16  user_addressable_sectors_lo;\r
+  UINT16  user_addressable_sectors_hi;\r
+  UINT16  reserved_62;    \r
+  UINT16  multi_word_dma_mode;   \r
+  UINT16  advanced_pio_modes;\r
+  UINT16  min_multi_word_dma_cycle_time;\r
+  UINT16  rec_multi_word_dma_cycle_time;\r
+  UINT16  min_pio_cycle_time_without_flow_control;\r
+  UINT16  min_pio_cycle_time_with_flow_control;\r
+  UINT16  reserved_69_79[11];    \r
+  UINT16  major_version_no;\r
+  UINT16  minor_version_no;\r
+  UINT16  command_set_supported_82; // word 82\r
+  UINT16  command_set_supported_83; // word 83\r
+  UINT16  command_set_feature_extn; // word 84\r
+  UINT16  command_set_feature_enb_85; // word 85\r
+  UINT16  command_set_feature_enb_86; // word 86\r
+  UINT16  command_set_feature_default; // word 87\r
+  UINT16  ultra_dma_mode; // word 88\r
+  UINT16  reserved_89_127[39];\r
+  UINT16  security_status;\r
+  UINT16  vendor_data_129_159[31];\r
+  UINT16  reserved_160_255[96];\r
+} EFI_ATA_IDENTIFY_DATA;\r
+\r
+#pragma pack()\r
+//\r
+//*******************************************************\r
+// EFI_ATAPI_IDENTIFY_DATA\r
+//*******************************************************\r
+//\r
+#pragma pack(1)\r
+typedef struct {\r
+    UINT16  config;             // General Configuration\r
+    UINT16  obsolete_1;\r
+    UINT16  specific_config;\r
+    UINT16  obsolete_3;   \r
+    UINT16  retired_4_5[2];\r
+    UINT16  obsolete_6;   \r
+    UINT16  cfa_reserved_7_8[2];\r
+    UINT16  retired_9;\r
+    CHAR8   SerialNo[20];       // ASCII \r
+    UINT16  retired_20_21[2];\r
+    UINT16  obsolete_22;\r
+    CHAR8   FirmwareVer[8];     // ASCII \r
+    CHAR8   ModelName[40];      // ASCII \r
+    UINT16  multi_sector_cmd_max_sct_cnt;\r
+    UINT16  reserved_48;\r
+    UINT16  capabilities_49;\r
+    UINT16  capabilities_50;\r
+    UINT16  obsolete_51_52[2];   \r
+    UINT16  field_validity;\r
+    UINT16  obsolete_54_58[5];\r
+    UINT16  mutil_sector_setting;\r
+    UINT16  user_addressable_sectors_lo;\r
+    UINT16  user_addressable_sectors_hi;\r
+    UINT16  obsolete_62;\r
+    UINT16  multi_word_dma_mode;\r
+    UINT16  advanced_pio_modes;\r
+    UINT16  min_multi_word_dma_cycle_time;\r
+    UINT16  rec_multi_word_dma_cycle_time;\r
+    UINT16  min_pio_cycle_time_without_flow_control;\r
+    UINT16  min_pio_cycle_time_with_flow_control;\r
+    UINT16  reserved_69_74[6];\r
+    UINT16  queue_depth;\r
+    UINT16  reserved_76_79[4];\r
+    UINT16  major_version_no;\r
+    UINT16  minor_version_no;\r
+    UINT16  cmd_set_support_82;\r
+    UINT16  cmd_set_support_83;\r
+    UINT16  cmd_feature_support;\r
+    UINT16  cmd_feature_enable_85;\r
+    UINT16  cmd_feature_enable_86;\r
+    UINT16  cmd_feature_default;\r
+    UINT16  ultra_dma_select;\r
+    UINT16  time_required_for_sec_erase;\r
+    UINT16  time_required_for_enhanced_sec_erase;\r
+    UINT16  current_advanced_power_mgmt_value;\r
+    UINT16  master_pwd_revison_code;\r
+    UINT16  hardware_reset_result;\r
+    UINT16  current_auto_acoustic_mgmt_value;\r
+    UINT16  reserved_95_99[5];\r
+    UINT16  max_user_lba_for_48bit_addr[4];\r
+    UINT16  reserved_104_126[23];\r
+    UINT16  removable_media_status_notification_support;\r
+    UINT16  security_status;\r
+    UINT16  vendor_data_129_159[31];\r
+    UINT16  cfa_power_mode;\r
+    UINT16  cfa_reserved_161_175[15];\r
+    UINT16  current_media_serial_no[30];\r
+    UINT16  reserved_206_254[49];\r
+    UINT16  integrity_word;\r
+} EFI_ATAPI_IDENTIFY_DATA;\r
+\r
+#pragma pack()\r
+//\r
+//*******************************************************\r
+// EFI_IDENTIFY_DATA\r
+//*******************************************************\r
+//\r
+typedef union {\r
+  EFI_ATA_IDENTIFY_DATA       AtaData;\r
+  EFI_ATAPI_IDENTIFY_DATA     AtapiData;\r
+} EFI_IDENTIFY_DATA; \r
+\r
+#define   EFI_ATAPI_DEVICE_IDENTIFY_DATA  0x8000\r
+\r
+//\r
+/////////////////////////////////////////////////////////////////////////////////////////\r
+// Function prototype declaration, for ANSI compatability\r
+//\r
+/**\r
+  Returns the information about the specified IDE channel. \r
+\r
+  @param  This Pointer to the EFI_IDE_CONTROLLER_INIT_PROTOCOL instance. \r
+  \r
+  @param  Channel Zero-based channel number.\r
+  \r
+  @param  Enabled TRUE if this channel is enabled. Disabled channels are not scanned \r
+  to see if any devices are present.\r
+  \r
+  @param  MaxDevices The maximum number of IDE devices that the bus driver \r
+  can expect on this channel. \r
+\r
+  @retval EFI_SUCCESS Information was returned without any errors.\r
+  \r
+  @retval EFI_INVALID_PARAMETER Channel is invalid (Channel >= ChannelCount).\r
+\r
+**/\r
+typedef \r
+EFI_STATUS\r
+(EFIAPI *EFI_IDE_CONTROLLER_GET_CHANNEL_INFO) (\r
+  IN EFI_IDE_CONTROLLER_INIT_PROTOCOL *This,\r
+  IN  UINT8                           Channel, \r
+  OUT BOOLEAN                         *Enabled,\r
+  OUT UINT8                           *MaxDevices\r
+);\r
+\r
+/**\r
+  The notifications from the IDE bus driver that it is about to enter a certain \r
+  phase of the IDE channel enumeration process. \r
+\r
+  @param  This Pointer to the EFI_IDE_CONTROLLER_INIT_PROTOCOL instance. \r
+  \r
+  @param  Phase The phase during enumeration. \r
+  \r
+  @param  Channel Zero-based channel number.\r
+\r
+  @retval EFI_SUCCESS The notification was accepted without any errors.\r
+  \r
+  @retval EFI_NOT_SUPPORTED Phase is not supported.\r
+  \r
+  @retval EFI_INVALID_PARAMETER Channel is invalid (Channel >= ChannelCount).\r
+  \r
+  @retval EFI_NOT_READY This phase cannot be entered at this time.\r
+\r
+**/\r
+typedef \r
+EFI_STATUS\r
+(EFIAPI *EFI_IDE_CONTROLLER_NOTIFY_PHASE) (\r
+  IN EFI_IDE_CONTROLLER_INIT_PROTOCOL  *This,\r
+  IN EFI_IDE_CONTROLLER_ENUM_PHASE     Phase,\r
+  IN UINT8                             Channel\r
+);\r
+\r
+/**\r
+  Submits the device information to the IDE controller driver. \r
+\r
+  @param  This Pointer to the EFI_IDE_CONTROLLER_INIT_PROTOCOL instance. \r
+  \r
+  @param  Channel Zero-based channel number.\r
+  \r
+  @param  Device Zero-based device number on the Channel.\r
+  \r
+  @param  IdentifyData The device¡¯s response to the ATA IDENTIFY_DEVICE command.\r
+\r
+  @retval EFI_SUCCESS The information was accepted without any errors.\r
+  \r
+  @retval EFI_INVALID_PARAMETER Channel is invalid (Channel >= ChannelCount).\r
+  Or Device is invalid.\r
+\r
+**/\r
+typedef \r
+EFI_STATUS\r
+(EFIAPI *EFI_IDE_CONTROLLER_SUBMIT_DATA) (\r
+  IN EFI_IDE_CONTROLLER_INIT_PROTOCOL *This,\r
+  IN  UINT8                           Channel,\r
+  IN  UINT8                           Device,\r
+  IN  EFI_IDENTIFY_DATA               *IdentifyData\r
+);\r
+\r
+/**\r
+  Disqualifies specific modes for an IDE device. \r
+\r
+  @param  This Pointer to the EFI_IDE_CONTROLLER_INIT_PROTOCOL instance. \r
+  \r
+  @param  Channel Zero-based channel number.\r
+  \r
+  @param  Device Zero-based device number on the Channel.\r
+  \r
+  @param  BadModes The modes that the device does not support and that \r
+  should be disqualified.\r
+\r
+  @retval EFI_SUCCESS The modes were accepted without any errors.\r
+  \r
+  @retval EFI_INVALID_PARAMETER Channel is invalid (Channel >= ChannelCount).\r
+  Or Device is invalid.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_IDE_CONTROLLER_DISQUALIFY_MODE) (\r
+  IN EFI_IDE_CONTROLLER_INIT_PROTOCOL *This,\r
+  IN  UINT8                           Channel,\r
+  IN  UINT8                           Device,\r
+  IN  EFI_ATA_COLLECTIVE_MODE         *BadModes\r
+);\r
+\r
+/**\r
+  Returns the information about the optimum modes for the specified IDE device.\r
+\r
+  @param  This Pointer to the EFI_IDE_CONTROLLER_INIT_PROTOCOL instance. \r
+  \r
+  @param  Channel Zero-based channel number.\r
+  \r
+  @param  Device Zero-based device number on the Channel.\r
+  \r
+  @param  SupportedModes The optimum modes for the device. \r
+\r
+  @retval EFI_SUCCESS SupportedModes was returned.\r
+  \r
+  @retval EFI_INVALID_PARAMETER Channel is invalid (Channel >= ChannelCount).\r
+  Or Device is invalid. Or SupportedModes is NULL.\r
+  \r
+  @retval EFI_NOT_READY Modes cannot be calculated due to a lack of data. \r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_IDE_CONTROLLER_CALCULATE_MODE) (\r
+  IN EFI_IDE_CONTROLLER_INIT_PROTOCOL *This,\r
+  IN  UINT8                           Channel,\r
+  IN  UINT8                           Device,\r
+  OUT EFI_ATA_COLLECTIVE_MODE         **SupportedModes\r
+);\r
+\r
+/**\r
+  Commands the IDE controller driver to program the IDE controller hardware \r
+  so that the specified device can operate at the specified mode. \r
+\r
+  @param  This Pointer to the EFI_IDE_CONTROLLER_INIT_PROTOCOL instance. \r
+  \r
+  @param  Channel Zero-based channel number.\r
+  \r
+  @param  Device Zero-based device number on the Channel.\r
+  \r
+  @param  Modes The modes to set. \r
+\r
+  @retval EFI_SUCCESS The command was accepted without any errors.\r
+  \r
+  @retval EFI_INVALID_PARAMETER Channel is invalid (Channel >= ChannelCount).\r
+  Or Device is invalid.\r
+  \r
+  @retval EFI_NOT_READY Modes cannot be set at this time due to lack of data.\r
+  \r
+  @retval EFI_DEVICE_ERROR Modes cannot be set due to hardware failure. \r
+  The IDE bus driver should not use this device.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_IDE_CONTROLLER_SET_TIMING) (\r
+  IN EFI_IDE_CONTROLLER_INIT_PROTOCOL *This,\r
+  IN  UINT8                           Channel,\r
+  IN  UINT8                           Device,\r
+  IN  EFI_ATA_COLLECTIVE_MODE         *Modes\r
+);\r
+\r
+//\r
+////////////////////////////////////////////////////////////////////////////////////////////////////\r
+// Interface structure \r
+// EFI_IDE_CONTROLLER_INIT_PROTOCOL protocol provides the chipset specific information to the IDE bus driver.\r
+// An IDE Bus driver wants to manage an IDE bus and possible IDE devices will have to retrieve the \r
+// EFI_IDE_CONTROLLER_INIT_PROTOCOL instances.\r
+//\r
+/**\r
+  @par Protocol Description:\r
+  Provides the basic interfaces to abstract an IDE controller.\r
+\r
+  @param GetChannelInfo\r
+  Returns the information about a specific channel. \r
+\r
+  @param NotifyPhase\r
+  The notification that the IDE bus driver is about to enter the \r
+  specified phase during the enumeration process. \r
+\r
+  @param SubmitData \r
+  Submits the Drive Identify data that was returned by the device. \r
+\r
+  @param DisqualifyMode \r
+  Submits information about modes that should be disqualified. \r
+\r
+  @param CalculateMode \r
+  Calculates and returns the optimum mode for a particular IDE device.\r
+\r
+  @param SetTiming \r
+  Programs the IDE controller hardware to the default timing or per the modes \r
+  that were returned by the last call to CalculateMode().\r
+\r
+  @param EnumAll \r
+  Set to TRUE if the enumeration group includes all the channels that are \r
+  produced by this controller. FALSE if an enumeration group consists of \r
+  only one channel. \r
+\r
+  @param ChannelCount\r
+  The number of channels that are produced by this controller.\r
+\r
+**/\r
+struct _EFI_IDE_CONTROLLER_INIT_PROTOCOL {\r
+  EFI_IDE_CONTROLLER_GET_CHANNEL_INFO    GetChannelInfo;\r
+  EFI_IDE_CONTROLLER_NOTIFY_PHASE        NotifyPhase;\r
+  EFI_IDE_CONTROLLER_SUBMIT_DATA         SubmitData;\r
+  EFI_IDE_CONTROLLER_DISQUALIFY_MODE     DisqualifyMode;\r
+  EFI_IDE_CONTROLLER_CALCULATE_MODE      CalculateMode;\r
+  EFI_IDE_CONTROLLER_SET_TIMING          SetTiming;\r
+  BOOLEAN                                EnumAll;\r
+  UINT8                                  ChannelCount; \r
+};\r
+\r
+extern EFI_GUID gEfiIdeControllerInitProtocolGuid;\r
+\r
+#endif\r
+\r
+\r
diff --git a/Tools/Source/TianoTools/Include/Protocol/IncompatiblePciDeviceSupport.h b/Tools/Source/TianoTools/Include/Protocol/IncompatiblePciDeviceSupport.h
new file mode 100644 (file)
index 0000000..03a5b2e
--- /dev/null
@@ -0,0 +1,84 @@
+/** @file\r
+  This file declares EFI Incompatible PCI Device Support Protocol\r
+\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. This program and the accompanying materials                          \r
+  are licensed and made available under the terms and conditions of the BSD License         \r
+  which accompanies this distribution.  The full text of the license may be found at        \r
+  http://opensource.org/licenses/bsd-license.php                                            \r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+  Module Name:  IncompatiblePciDeviceSupport.h\r
+\r
+  @par Revision Reference:\r
+  This protocol is defined in Framework of EFI PCI Platform Support Specification.\r
+  Version0.9\r
+\r
+**/\r
+\r
+#ifndef _INCOMPATIBLE_PCI_DEVICE_SUPPORT_H_\r
+#define _INCOMPATIBLE_PCI_DEVICE_SUPPORT_H_\r
+\r
+#define EFI_INCOMPATIBLE_PCI_DEVICE_SUPPORT_PROTOCOL_GUID \\r
+        {0xeb23f55a, 0x7863, 0x4ac2, {0x8d, 0x3d, 0x95, 0x65, 0x35, 0xde, 0x03, 0x75} }\r
+\r
+typedef struct _EFI_INCOMPATIBLE_PCI_DEVICE_SUPPORT_PROTOCOL EFI_INCOMPATIBLE_PCI_DEVICE_SUPPORT_PROTOCOL;\r
+\r
+/**\r
+  Returns a list of ACPI resource descriptors that detail the special \r
+  resource configuration requirements for an incompatible PCI device.\r
+\r
+  @param  This Pointer to the EFI_INCOMPATIBLE_PCI_DEVICE_SUPPORT_PROTOCOL instance. \r
+  \r
+  @param  VendorID A unique ID to identify the manufacturer of the PCI device.\r
+  \r
+  @param  DeviceID A unique ID to identify the particular PCI device.\r
+  \r
+  @param  RevisionID A PCI device-specific revision identifier.\r
+  \r
+  @param  SubsystemVendorId Specifies the subsystem vendor ID. \r
+  \r
+  @param  SubsystemDeviceId Specifies the subsystem device ID.\r
+  \r
+  @param  Configuration A list of ACPI resource descriptors that detail \r
+  the configuration requirement. \r
+\r
+  @retval EFI_SUCCESS The function always returns EFI_SUCCESS.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_INCOMPATIBLE_PCI_DEVICE_SUPPORT_CHECK_DEVICE) (\r
+  IN EFI_INCOMPATIBLE_PCI_DEVICE_SUPPORT_PROTOCOL   *This,\r
+  IN  UINTN                                         VendorId,\r
+  IN  UINTN                                         DeviceId,\r
+  IN  UINTN                                         Revision,\r
+  IN  UINTN                                         SubVendorId,OPTIONAL\r
+  IN  UINTN                                         SubDeviceId,OPTIONAL\r
+  OUT VOID                                          **Configuration\r
+); \r
+\r
+\r
+//\r
+// Interface structure for the Incompatible PCI Device Support Protocol\r
+//\r
+/**\r
+  @par Protocol Description:\r
+  This protocol can find some incompatible PCI devices and report their \r
+  special resource requirements to the PCI bus driver.\r
+\r
+  @param CheckDevice\r
+  Returns a list of ACPI resource descriptors that detail any special \r
+  resource configuration requirements if the specified device is a recognized \r
+  incompatible PCI device. \r
+\r
+**/\r
+struct _EFI_INCOMPATIBLE_PCI_DEVICE_SUPPORT_PROTOCOL {\r
+  EFI_INCOMPATIBLE_PCI_DEVICE_SUPPORT_CHECK_DEVICE      CheckDevice;  \r
+};\r
+\r
+extern EFI_GUID gEfiIncompatiblePciDeviceSupportProtocolGuid;\r
+  \r
+#endif\r
diff --git a/Tools/Source/TianoTools/Include/Protocol/Legacy8259.h b/Tools/Source/TianoTools/Include/Protocol/Legacy8259.h
new file mode 100644 (file)
index 0000000..c30a5e5
--- /dev/null
@@ -0,0 +1,307 @@
+/** @file\r
+  This protocol abstracts the 8259 interrupt controller. This includes\r
+  PCI IRQ routing need to program the PCI Interrupt Line register.\r
+\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. This program and the accompanying materials                          \r
+  are licensed and made available under the terms and conditions of the BSD License         \r
+  which accompanies this distribution.  The full text of the license may be found at        \r
+  http://opensource.org/licenses/bsd-license.php                                            \r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.    \r
+\r
+  Module Name:  Legacy8259.h\r
+\r
+  @par Revision Reference:\r
+  This protocol is defined in Framework for EFI Compatibility Support Module spec\r
+  Version 0.96\r
+\r
+**/\r
+\r
+#ifndef _EFI_LEGACY_8259_H\r
+#define _EFI_LEGACY_8259_H\r
+\r
+#define EFI_LEGACY_8259_PROTOCOL_GUID \\r
+  { \\r
+    0x38321dba, 0x4fe0, 0x4e17, {0x8a, 0xec, 0x41, 0x30, 0x55, 0xea, 0xed, 0xc1 } \\r
+  }\r
+\r
+typedef struct _EFI_LEGACY_8259_PROTOCOL EFI_LEGACY_8259_PROTOCOL;\r
+\r
+typedef enum {\r
+  Efi8259Irq0,\r
+  Efi8259Irq1,\r
+  Efi8259Irq2,\r
+  Efi8259Irq3,\r
+  Efi8259Irq4,\r
+  Efi8259Irq5,\r
+  Efi8259Irq6,\r
+  Efi8259Irq7,\r
+  Efi8259Irq8,\r
+  Efi8259Irq9,\r
+  Efi8259Irq10,\r
+  Efi8259Irq11,\r
+  Efi8259Irq12,\r
+  Efi8259Irq13,\r
+  Efi8259Irq14,\r
+  Efi8259Irq15,\r
+  Efi8259IrqMax\r
+} EFI_8259_IRQ;\r
+\r
+typedef enum {\r
+  Efi8259LegacyMode,\r
+  Efi8259ProtectedMode,\r
+  Efi8259MaxMode\r
+} EFI_8259_MODE;\r
+\r
+/**\r
+  Get the 8259 interrupt masks for Irq0 - Irq15. A different mask exists for\r
+  the legacy mode mask and the protected mode mask. The base address for the 8259\r
+  is different for legacy and protected mode, so two masks are required.\r
+\r
+  @param  This Protocol instance pointer.\r
+  @param  MasterBase The base vector for the Master PIC in the 8259 controller\r
+  @param  Slavebase The base vector for the Master PIC in the 8259 controller\r
+\r
+  @retval  EFI_SUCCESS The new bases were programmed\r
+  @retval  EFI_DEVICE_ERROR A device erro occured programming the vector bases\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_LEGACY_8259_SET_VECTOR_BASE) (\r
+  IN EFI_LEGACY_8259_PROTOCOL           *This,\r
+  IN  UINT8                             MasterBase,\r
+  IN  UINT8                             SlaveBase\r
+  )\r
+;\r
+\r
+/**\r
+  Get the 8259 interrupt masks for Irq0 - Irq15. A different mask exists for\r
+  the legacy mode mask and the protected mode mask. The base address for the 8259\r
+  is different for legacy and protected mode, so two masks are required.\r
+\r
+  @param  This Protocol instance pointer.\r
+  @param  LegacyMask Bit 0 is Irq0 - Bit 15 is Irq15\r
+  @param  LegacyEdgeLevel Bit 0 is Irq0 - Bit 15 is Irq15\r
+  @param  ProtectedMask Bit 0 is Irq0 - Bit 15 is Irq15\r
+  @param  ProtectedEdgeLevel Bit 0 is Irq0 - Bit 15 is Irq15\r
+\r
+  @retval  EFI_SUCCESS 8259 status returned\r
+  @retval  EFI_DEVICE_ERROR Error reading 8259\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_LEGACY_8259_GET_MASK) (\r
+  IN EFI_LEGACY_8259_PROTOCOL           *This,\r
+  OUT UINT16                            *LegacyMask, OPTIONAL\r
+  OUT UINT16                            *LegacyEdgeLevel, OPTIONAL\r
+  OUT UINT16                            *ProtectedMask, OPTIONAL\r
+  OUT UINT16                            *ProtectedEdgeLevel OPTIONAL\r
+  )\r
+;\r
+\r
+/**\r
+  Set the 8259 interrupt masks for Irq0 - Irq15. A different mask exists for\r
+  the legacy mode mask and the protected mode mask. The base address for the 8259\r
+  is different for legacy and protected mode, so two masks are required.\r
+  Also set the edge/level masks.\r
+\r
+  @param  This Protocol instance pointer.\r
+  @param  LegacyMask Bit 0 is Irq0 - Bit 15 is Irq15\r
+  @param  LegacyEdgeLevel Bit 0 is Irq0 - Bit 15 is Irq15\r
+  @param  ProtectedMask Bit 0 is Irq0 - Bit 15 is Irq15\r
+  @param  ProtectedEdgeLevel Bit 0 is Irq0 - Bit 15 is Irq15\r
+\r
+  @retval  EFI_SUCCESS 8259 status returned\r
+  @retval  EFI_DEVICE_ERROR Error reading 8259\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_LEGACY_8259_SET_MASK) (\r
+  IN EFI_LEGACY_8259_PROTOCOL           *This,\r
+  IN  UINT16                            *LegacyMask, OPTIONAL\r
+  IN  UINT16                            *LegacyEdgeLevel, OPTIONAL\r
+  IN  UINT16                            *ProtectedMask, OPTIONAL\r
+  IN  UINT16                            *ProtectedEdgeLevel OPTIONAL\r
+  )\r
+;\r
+\r
+/**\r
+  Set the 8259 mode of operation. The base address for the 8259 is different for\r
+  legacy and protected mode. The legacy mode requires the master 8259 to have a\r
+  master base of 0x08 and the slave base of 0x70. The protected mode base locations\r
+  are not defined. Interrupts must be masked by the caller before this function\r
+  is called. The interrupt mask from the current mode is saved. The interrupt \r
+  mask for the new mode is Mask, or if Mask does not exist the previously saved\r
+  mask is used.\r
+\r
+  @param  This Protocol instance pointer.\r
+  @param  Mode Mode of operation. i.e. real mode or protected mode\r
+  @param  Mask Optional interupt mask for the new mode.\r
+  @param  EdgeLevel Optional trigger mask for the new mode.\r
+\r
+  @retval  EFI_SUCCESS 8259 programmed\r
+  @retval  EFI_DEVICE_ERROR Error writting to 8259\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_LEGACY_8259_SET_MODE) (\r
+  IN EFI_LEGACY_8259_PROTOCOL         *This,\r
+  IN  EFI_8259_MODE                   Mode,\r
+  IN  UINT16                          *Mask, OPTIONAL\r
+  IN  UINT16                          *EdgeLevel OPTIONAL\r
+  )\r
+;\r
+\r
+/**\r
+  Convert from IRQ to processor interrupt vector number.\r
+\r
+  @param  This Protocol instance pointer.\r
+  @param  Irq 8259 IRQ0 - IRQ15\r
+  @param  Vector Processor vector number that matches Irq\r
+\r
+  @retval  EFI_SUCCESS The Vector matching Irq is returned\r
+  @retval  EFI_INVALID_PARAMETER Irq not valid\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_LEGACY_8259_GET_VECTOR) (\r
+  IN EFI_LEGACY_8259_PROTOCOL           *This,\r
+  IN  EFI_8259_IRQ                      Irq,\r
+  OUT UINT8                             *Vector\r
+  )\r
+;\r
+\r
+/**\r
+  Enable Irq by unmasking interrupt in 8259\r
+\r
+  @param  This Protocol instance pointer.\r
+  @param  Irq 8259 IRQ0 - IRQ15\r
+  @param  LevelTriggered TRUE if level triggered.  FALSE if edge triggered.\r
+\r
+  @retval  EFI_SUCCESS Irq enabled on 8259\r
+  @retval  EFI_INVALID_PARAMETER Irq not valid\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_LEGACY_8259_ENABLE_IRQ) (\r
+  IN EFI_LEGACY_8259_PROTOCOL           *This,\r
+  IN  EFI_8259_IRQ                      Irq,\r
+  IN  BOOLEAN                           LevelTriggered\r
+  )\r
+;\r
+\r
+/**\r
+  Disable Irq by masking interrupt in 8259\r
+\r
+  @param  This Protocol instance pointer.\r
+  @param  Irq 8259 IRQ0 - IRQ15\r
+\r
+  @retval  EFI_SUCCESS Irq disabled on 8259\r
+  @retval  EFI_INVALID_PARAMETER Irq not valid\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_LEGACY_8259_DISABLE_IRQ) (\r
+  IN EFI_LEGACY_8259_PROTOCOL           *This,\r
+  IN  EFI_8259_IRQ                      Irq\r
+  )\r
+;\r
+\r
+/**\r
+  PciHandle represents a PCI config space of a PCI function. Vector \r
+  represents Interrupt Pin (from PCI config space) and it is the data\r
+  that is programmed into the Interrupt Line (from the PCI config space)\r
+  register.\r
+\r
+  @param  This Protocol instance pointer.\r
+  @param  PciHandle PCI function to return vector for\r
+  @param  Vector Vector for fucntion that matches\r
+\r
+  @retval  EFI_SUCCESS A valid Vector is returned\r
+  @retval  EFI_INVALID_PARAMETER PciHandle not valid\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_LEGACY_8259_GET_INTERRUPT_LINE) (\r
+  IN EFI_LEGACY_8259_PROTOCOL           *This,\r
+  IN  EFI_HANDLE                        PciHandle,\r
+  OUT UINT8                             *Vector\r
+  )\r
+;\r
+\r
+/**\r
+  Send an EOI to 8259\r
+\r
+  @param  This Protocol instance pointer.\r
+  @param  Irq 8259 IRQ0 - IRQ15\r
+\r
+  @retval  EFI_SUCCESS EOI successfully sent to 8259\r
+  @retval  EFI_INVALID_PARAMETER Irq not valid\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_LEGACY_8259_END_OF_INTERRUPT) (\r
+  IN EFI_LEGACY_8259_PROTOCOL           *This,\r
+  IN  EFI_8259_IRQ                      Irq\r
+  )\r
+;\r
+\r
+/**\r
+  @par Protocol Description:\r
+  Abstracts the 8259 and APIC hardware control between EFI usage and \r
+  Compatibility16 usage.\r
+\r
+  @param SetVectorBase\r
+  Sets the vector bases for master and slave PICs. \r
+\r
+  @param GetMask\r
+  Gets IRQ and edge/level masks for 16-bit real mode and 32-bit protected mode. \r
+\r
+  @param SetMask\r
+  Sets the IRQ and edge\level masks for 16-bit real mode and 32-bit protected mode.\r
+\r
+  @param SetMode\r
+  Sets PIC mode to 16-bit real mode or 32-bit protected mode.\r
+\r
+  @param GetVector\r
+  Gets the base vector assigned to an IRQ.\r
+\r
+  @param EnableIrq\r
+  Enables an IRQ. \r
+\r
+  @param DisableIrq\r
+  Disables an IRQ.\r
+\r
+  @param GetInterruptLine\r
+  Gets an IRQ that is assigned to a PCI device. \r
+\r
+  @param EndOfInterrupt\r
+  Issues the end of interrupt command. \r
+\r
+**/\r
+struct _EFI_LEGACY_8259_PROTOCOL {\r
+  EFI_LEGACY_8259_SET_VECTOR_BASE     SetVectorBase;\r
+  EFI_LEGACY_8259_GET_MASK            GetMask;\r
+  EFI_LEGACY_8259_SET_MASK            SetMask;\r
+  EFI_LEGACY_8259_SET_MODE            SetMode;\r
+  EFI_LEGACY_8259_GET_VECTOR          GetVector;\r
+  EFI_LEGACY_8259_ENABLE_IRQ          EnableIrq;\r
+  EFI_LEGACY_8259_DISABLE_IRQ         DisableIrq;\r
+  EFI_LEGACY_8259_GET_INTERRUPT_LINE  GetInterruptLine;\r
+  EFI_LEGACY_8259_END_OF_INTERRUPT    EndOfInterrupt;\r
+};\r
+\r
+extern EFI_GUID gEfiLegacy8259ProtocolGuid;\r
+\r
+#endif\r
diff --git a/Tools/Source/TianoTools/Include/Protocol/LegacyBios.h b/Tools/Source/TianoTools/Include/Protocol/LegacyBios.h
new file mode 100644 (file)
index 0000000..aa94cfb
--- /dev/null
@@ -0,0 +1,701 @@
+/** @file\r
+  The EFI Legacy BIOS Protocol is used to abstract legacy Option ROM usage\r
+  under EFI and Legacy OS boot.\r
+\r
+  Note: The names for EFI_IA32_REGISTER_SET elements were picked to follow \r
+  well known naming conventions.\r
+\r
+  Thunk - A thunk is a transition from one processor mode to another. A Thunk\r
+  is a transition from native EFI mode to 16-bit mode. A reverse thunk\r
+  would be a transition from 16-bit mode to native EFI mode.\r
+\r
+  You most likely should not use this protocol! Find the EFI way to solve the\r
+  problem to make your code portable\r
+\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. This program and the accompanying materials                          \r
+  are licensed and made available under the terms and conditions of the BSD License         \r
+  which accompanies this distribution.  The full text of the license may be found at        \r
+  http://opensource.org/licenses/bsd-license.php                                            \r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+  Module Name:  LegacyBios.h\r
+\r
+  @par Revision Reference:\r
+  This protocol is defined in Framework for EFI Compatibility Support Module spec\r
+  Version 0.96\r
+\r
+**/\r
+\r
+#ifndef _EFI_LEGACY_BIOS_H\r
+#define _EFI_LEGACY_BIOS_H\r
+\r
+#define EFI_LEGACY_BIOS_PROTOCOL_GUID \\r
+  { \\r
+    0xdb9a1e3d, 0x45cb, 0x4abb, {0x85, 0x3b, 0xe5, 0x38, 0x7f, 0xdb, 0x2e, 0x2d } \\r
+  }\r
+\r
+typedef struct _EFI_LEGACY_BIOS_PROTOCOL EFI_LEGACY_BIOS_PROTOCOL;\r
+\r
+//\r
+// Convert from 32-bit address (_Adr) to Segment:Offset 16-bit form\r
+//\r
+#define EFI_SEGMENT(_Adr)     (UINT16) ((UINT16) (((UINTN) (_Adr)) >> 4) & 0xf000)\r
+#define EFI_OFFSET(_Adr)      (UINT16) (((UINT16) ((UINTN) (_Adr))) & 0xffff)\r
+#define BYTE_GRANULARITY      0x01\r
+#define WORD_GRANULARITY      0x02\r
+#define DWORD_GRANULARITY     0x04\r
+#define QWORD_GRANULARITY     0x08\r
+#define PARAGRAPH_GRANULARITY 0x10\r
+\r
+#define CARRY_FLAG            0x01\r
+\r
+//*********************************************************\r
+// EFI_EFLAGS_REG\r
+//*********************************************************\r
+typedef struct {\r
+  UINT32 CF:1;\r
+  UINT32 Reserved1:1;\r
+  UINT32 PF:1;\r
+  UINT32 Reserved2:1;\r
+  UINT32 AF:1;\r
+  UINT32 Reserved3:1;\r
+  UINT32 ZF:1;\r
+  UINT32 SF:1;\r
+  UINT32 TF:1;\r
+  UINT32 IF:1;\r
+  UINT32 DF:1;\r
+  UINT32 OF:1;\r
+  UINT32 IOPL:2;\r
+  UINT32 NT:1;\r
+  UINT32 Reserved4:2;\r
+  UINT32 VM:1;\r
+  UINT32 Reserved5:14;\r
+} EFI_EFLAGS_REG;\r
+\r
+//*********************************************************\r
+// EFI_DWORD_REGS\r
+//*********************************************************\r
+\r
+typedef struct {\r
+    UINT32           EAX;\r
+    UINT32           EBX;\r
+    UINT32           ECX;\r
+    UINT32           EDX;\r
+    UINT32           ESI;\r
+    UINT32           EDI;\r
+    EFI_EFLAGS_REG   EFlags;\r
+    UINT16           ES;\r
+    UINT16           CS;\r
+    UINT16           SS;\r
+    UINT16           DS;\r
+    UINT16           FS;\r
+    UINT16           GS;\r
+    UINT32           EBP;\r
+    UINT32           ESP;\r
+} EFI_DWORD_REGS;\r
+\r
+//*******************************************\r
+// EFI_FLAGS_REG\r
+//*******************************************\r
+typedef struct {\r
+  UINT16     CF:1;\r
+  UINT16     Reserved1:1;\r
+  UINT16     PF:1;\r
+  UINT16     Reserved2:1;\r
+  UINT16     AF:1;\r
+  UINT16     Reserved3:1;\r
+  UINT16     ZF:1;\r
+  UINT16     SF:1;\r
+  UINT16     TF:1;\r
+  UINT16     IF:1;\r
+  UINT16     DF:1;\r
+  UINT16     OF:1;\r
+  UINT16     IOPL:2;\r
+  UINT16     NT:1;\r
+  UINT16     Reserved4:1;\r
+} EFI_FLAGS_REG;\r
+\r
+\r
+//*********************************************************\r
+// EFI_WORD_REGS\r
+//*********************************************************\r
+\r
+typedef struct {\r
+    UINT16           AX;\r
+    UINT16           ReservedAX;\r
+    UINT16           BX;\r
+    UINT16           ReservedBX;    \r
+    UINT16           CX;\r
+    UINT16           ReservedCX;\r
+    UINT16           DX;\r
+    UINT16           ReservedDX;\r
+    UINT16           SI;\r
+    UINT16           ReservedSI;\r
+    UINT16           DI;\r
+    UINT16           ReservedDI;\r
+    EFI_FLAGS_REG    Flags;\r
+    UINT16           ReservedFlags;\r
+    UINT16           ES;\r
+    UINT16           CS;\r
+    UINT16           SS;\r
+    UINT16           DS;\r
+    UINT16           FS;\r
+     UINT16           GS; \r
+    UINT16           BP;\r
+    UINT16           ReservedBP; \r
+    UINT16           SP;\r
+    UINT16           ReservedSP; \r
+} EFI_WORD_REGS;\r
+\r
+//*********************************************************\r
+// EFI_BYTE_REGS\r
+//*********************************************************\r
+\r
+typedef struct {\r
+    UINT8   AL, AH;\r
+    UINT16  ReservedAX;\r
+    UINT8   BL, BH;\r
+    UINT16  ReservedBX;\r
+    UINT8   CL, CH;\r
+    UINT16  ReservedCX;\r
+    UINT8   DL, DH;\r
+    UINT16  ReservedDX;\r
+} EFI_BYTE_REGS;\r
+\r
+typedef union {\r
+  EFI_DWORD_REGS  E;\r
+  EFI_WORD_REGS   X;\r
+  EFI_BYTE_REGS   H;\r
+} EFI_IA32_REGISTER_SET;\r
+\r
+#pragma pack(1)\r
+//\r
+// $EFI table created by Legacy16 code and consumed by EFI Legacy driver\r
+//\r
+typedef struct {\r
+  UINT32  Signature;      // "$EFI"\r
+  UINT8   TableChecksum;\r
+  UINT8   TableLength;\r
+  UINT8   EfiMajorRevision;\r
+  UINT8   EfiMinorRevision;\r
+  UINT8   TableMajorRevision;\r
+  UINT8   TableMinorRevision;\r
+  UINT8   Reserved[2];\r
+  UINT16  Legacy16CallSegment;\r
+  UINT16  Legacy16CallOffset;\r
+\r
+  UINT16  PnPInstallationCheckSegment;\r
+  UINT16  PnPInstallationCheckOffset;\r
+\r
+  UINT32  EfiSystemTable;\r
+  UINT32  OemStringPointer;\r
+  UINT32  AcpiRsdPtrPointer;\r
+  UINT16  OemRevision;\r
+  UINT32  E820Pointer;\r
+  UINT32  E820Length;\r
+  UINT32  IrqRoutingTablePointer;\r
+  UINT32  IrqRoutingTableLength;\r
+  UINT32  MpTablePtr;\r
+  UINT32  MpTableLength;\r
+  UINT16  OemIntSegment;\r
+  UINT16  OemIntOffset;\r
+  UINT16  Oem32Segment;\r
+  UINT16  Oem32Offset;\r
+  UINT16  Oem16Segment;\r
+  UINT16  Oem16Offset;\r
+  UINT16  TpmSegment;\r
+  UINT16  TpmOffset;\r
+  UINT32  IbvPointer;\r
+  UINT32  PciExpressBase;\r
+  UINT8   LastPciBus;\r
+} EFI_COMPATIBILITY16_TABLE;\r
+//\r
+// define maximum number of HDD system supports\r
+//\r
+#define MAX_HDD_ENTRIES 0x30\r
+\r
+typedef struct {\r
+  UINT16  Raw[256];\r
+} ATAPI_IDENTIFY;\r
+\r
+//\r
+// HDD_INFO status\r
+//\r
+#define HDD_PRIMARY               0x01\r
+#define HDD_SECONDARY             0x02\r
+#define HDD_MASTER_ATAPI_CDROM    0x04\r
+#define HDD_SLAVE_ATAPI_CDROM     0x08\r
+#define HDD_MASTER_IDE            0x20\r
+#define HDD_SLAVE_IDE             0x40\r
+#define HDD_MASTER_ATAPI_ZIPDISK  0x10\r
+#define HDD_SLAVE_ATAPI_ZIPDISK   0x80\r
+\r
+typedef struct {\r
+  UINT16          Status;\r
+  UINT32          Bus;\r
+  UINT32          Device;\r
+  UINT32          Function;\r
+  UINT16          CommandBaseAddress;\r
+  UINT16          ControlBaseAddress;\r
+  UINT16          BusMasterAddress;\r
+  UINT8           HddIrq;\r
+  ATAPI_IDENTIFY  IdentifyDrive[2];\r
+} HDD_INFO;\r
+\r
+//\r
+// Parties data structures\r
+//\r
+typedef struct {\r
+  UINT8 DirectoryServiceValidity : 1;\r
+  UINT8 RabcaUsedFlag : 1;\r
+  UINT8 ExecuteHddDiagnosticsFlag : 1;\r
+  UINT8 Reserved : 5;\r
+} UDC_ATTRIBUTES;\r
+\r
+typedef struct {\r
+  UDC_ATTRIBUTES  Attributes;\r
+  UINT8           DeviceNumber;\r
+  UINT8           BbsTableEntryNumberForParentDevice;\r
+  UINT8           BbsTableEntryNumberForBoot;\r
+  UINT8           BbsTableEntryNumberForHddDiag;\r
+  UINT8           BeerData[128];\r
+  UINT8           ServiceAreaData[64];\r
+} UD_TABLE;\r
+\r
+//\r
+// define BBS Device Types\r
+//\r
+#define BBS_FLOPPY        0x01\r
+#define BBS_HARDDISK      0x02\r
+#define BBS_CDROM         0x03\r
+#define BBS_PCMCIA        0x04\r
+#define BBS_USB           0x05\r
+#define BBS_EMBED_NETWORK 0x06\r
+#define BBS_BEV_DEVICE    0x80\r
+#define BBS_UNKNOWN       0xff\r
+\r
+typedef struct {\r
+  UINT16  OldPosition : 4;\r
+  UINT16  Reserved1 : 4;\r
+  UINT16  Enabled : 1;\r
+  UINT16  Failed : 1;\r
+  UINT16  MediaPresent : 2;\r
+  UINT16  Reserved2 : 4;\r
+} BBS_STATUS_FLAGS;\r
+\r
+#define MAX_BBS_ENTRIES 0x100\r
+//\r
+// BBS_IGNORE_ENTRY is placed in the BootPriority field if the entry is to\r
+// be skipped.\r
+// BBS_UNPRIORITIZED_ENTRY is placed in the BootPriority field before\r
+// priority has been assigned but indicates valid entry.\r
+// BBS_LOWEST_PRIORITY is normally used for removable media with no media\r
+//   inserted. This allows the 16-bit CSM to allocate a drive letter to\r
+//   the device.\r
+// BBS_DO_NOT_BOOT_FROM is used for devices that the 16-bit CSM is to assign\r
+//   a drive letter to but never boot from.\r
+//\r
+// AdditionalIrq??Handler usage is IBV specific. The fields have been added\r
+// for:\r
+//   1. Saving non-BBS card info about IRQs taken by card.\r
+//   2. For BBS compliant cards that hook IRQs in order to have their SETUP\r
+//      executed.\r
+//\r
+#define BBS_DO_NOT_BOOT_FROM    0xFFFC\r
+#define BBS_LOWEST_PRIORITY     0xFFFD\r
+#define BBS_UNPRIORITIZED_ENTRY 0xFFFE\r
+#define BBS_IGNORE_ENTRY        0xFFFF\r
+\r
+typedef struct {\r
+  UINT16            BootPriority;\r
+  UINT32            Bus;\r
+  UINT32            Device;\r
+  UINT32            Function;\r
+  UINT8             Class;\r
+  UINT8             SubClass;\r
+  UINT16            MfgStringOffset;\r
+  UINT16            MfgStringSegment;\r
+  UINT16            DeviceType;\r
+  BBS_STATUS_FLAGS  StatusFlags;\r
+  UINT16            BootHandlerOffset;\r
+  UINT16            BootHandlerSegment;\r
+  UINT16            DescStringOffset;\r
+  UINT16            DescStringSegment;\r
+  UINT32            InitPerReserved;\r
+  UINT32            AdditionalIrq13Handler;\r
+  UINT32            AdditionalIrq18Handler;\r
+  UINT32            AdditionalIrq19Handler;\r
+  UINT32            AdditionalIrq40Handler;\r
+  UINT8             AssignedDriveNumber;\r
+  UINT32            AdditionalIrq41Handler;\r
+  UINT32            AdditionalIrq46Handler;\r
+  UINT32            IBV1;\r
+  UINT32            IBV2;\r
+} BBS_TABLE;\r
+\r
+#pragma pack()\r
+\r
+/**\r
+  Thunk to 16-bit real mode and execute a software interrupt with a vector \r
+  of BiosInt. Regs will contain the 16-bit register context on entry and \r
+  exit.\r
+\r
+  @param  This Protocol instance pointer.\r
+  @param  BiosInt Processor interrupt vector to invoke\r
+  @param  Reg Register contexted passed into (and returned) from thunk to\r
+  16-bit mode\r
+\r
+  @retval  FALSE Thunk completed, and there were no BIOS errors in the target code.\r
+  See Regs for status.\r
+  @retval  TRUE There was a BIOS erro in the target code.\r
+\r
+**/\r
+typedef\r
+BOOLEAN\r
+(EFIAPI *EFI_LEGACY_BIOS_INT86) (\r
+  IN EFI_LEGACY_BIOS_PROTOCOL         *This,\r
+  IN  UINT8                           BiosInt,\r
+  IN OUT  EFI_IA32_REGISTER_SET       *Regs\r
+  )\r
+;\r
+\r
+/**\r
+  Thunk to 16-bit real mode and call Segment:Offset. Regs will contain the \r
+  16-bit register context on entry and exit. Arguments can be passed on \r
+  the Stack argument\r
+\r
+  @param  This Protocol instance pointer.\r
+  @param  Segment Segemnt of 16-bit mode call\r
+  @param  Offset Offset of 16-bit mdoe call\r
+  @param  Reg Register contexted passed into (and returned) from thunk to\r
+  16-bit mode\r
+  @param  Stack Caller allocated stack used to pass arguments\r
+  @param  StackSize Size of Stack in bytes\r
+\r
+  @retval  FALSE Thunk completed, and there were no BIOS errors in the target code.\r
+  See Regs for status.\r
+  @retval  TRUE There was a BIOS erro in the target code.\r
+\r
+**/\r
+typedef\r
+BOOLEAN\r
+(EFIAPI *EFI_LEGACY_BIOS_FARCALL86) (\r
+  IN EFI_LEGACY_BIOS_PROTOCOL         *This,\r
+  IN  UINT16                          Segment,\r
+  IN  UINT16                          Offset,\r
+  IN  EFI_IA32_REGISTER_SET           *Regs,\r
+  IN  VOID                            *Stack,\r
+  IN  UINTN                           StackSize\r
+  )\r
+;\r
+\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_LEGACY_BIOS_CHECK_ROM) (\r
+  IN EFI_LEGACY_BIOS_PROTOCOL         *This,\r
+  IN  EFI_HANDLE                      PciHandle,\r
+  OUT VOID                            **RomImage, OPTIONAL\r
+  OUT UINTN                           *RomSize, OPTIONAL\r
+  OUT UINTN                           *Flags\r
+\r
+/**\r
+  Test to see if a legacy PCI ROM exists for this device. Optionally return\r
+  the Legacy ROM instance for this PCI device.\r
+\r
+  @param  This Protocol instance pointer.\r
+  @param  PciHandle The PCI PC-AT OPROM from this devices ROM BAR will be loaded\r
+  @param  RomImage Return the legacy PCI ROM for this device\r
+  @param  RomSize Size of ROM Image\r
+  @param  Flags Indicates if ROM found and if PC-AT.\r
+\r
+  @retval  EFI_SUCCESS Legacy Option ROM availible for this device\r
+  @retval  EFI_UNSUPPORTED Legacy Option ROM not supported.\r
+\r
+**/\r
+  )\r
+;\r
+\r
+/**\r
+  Load a legacy PC-AT OPROM on the PciHandle device. Return information\r
+  about how many disks were added by the OPROM and the shadow address and\r
+  size. DiskStart & DiskEnd are INT 13h drive letters. Thus 0x80 is C:\r
+\r
+  @param  This Protocol instance pointer.\r
+  @param  PciHandle The PCI PC-AT OPROM from this devices ROM BAR will be loaded.\r
+  This value is NULL if RomImage is non-NULL. This is the normal\r
+  case.\r
+  @param  RomImage A PCI PC-AT ROM image. This argument is non-NULL if there is\r
+  no hardware associated with the ROM and thus no PciHandle,\r
+  otherwise is must be NULL.\r
+  Example is PXE base code.\r
+  @param  Flags Return Status if ROM was found and if was Legacy OPROM.\r
+  @param  DiskStart Disk number of first device hooked by the ROM. If DiskStart\r
+  is the same as DiskEnd no disked were hooked.\r
+  @param  DiskEnd Disk number of the last device hooked by the ROM.\r
+  @param  RomShadowAddress Shadow address of PC-AT ROM\r
+  @param  RomShadowSize Size of RomShadowAddress in bytes\r
+\r
+  @retval  EFI_SUCCESS Thunk completed, see Regs for status.\r
+  @retval  EFI_INVALID_PARAMETER PciHandle not found\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_LEGACY_BIOS_INSTALL_ROM) (\r
+  IN EFI_LEGACY_BIOS_PROTOCOL         *This,\r
+  IN  EFI_HANDLE                      PciHandle,\r
+  IN  VOID                            **RomImage,\r
+  OUT UINTN                           *Flags,\r
+  OUT UINT8                           *DiskStart, OPTIONAL\r
+  OUT UINT8                           *DiskEnd, OPTIONAL\r
+  OUT VOID                            **RomShadowAddress, OPTIONAL\r
+  OUT UINT32                          *ShadowedRomSize OPTIONAL\r
+  )\r
+;\r
+\r
+/**\r
+  Attempt to legacy boot the BootOption. If the EFI contexted has been \r
+  compromised this function will not return.\r
+\r
+  @param  This Protocol instance pointer.\r
+  @param  BootOption EFI Device Path from BootXXXX variable.\r
+  @param  LoadOptionSize Size of LoadOption in size.\r
+  @param  LoadOption LoadOption from BootXXXX variable\r
+\r
+  @retval  EFI_SUCCESS Removable media not present\r
+\r
+**/\r
+/**\r
+  Update BDA with current Scroll, Num & Cap lock LEDS\r
+\r
+  @param  This Protocol instance pointer.\r
+  @param  Leds Status of current Scroll, Num & Cap lock LEDS\r
+  Bit 0 is Scroll Lock  0 = Not locked\r
+  Bit 1 is Num Lock\r
+  Bit 2 is Caps Lock\r
+\r
+  @retval  EFI_SUCCESS Removable media not present\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_LEGACY_BIOS_BOOT) (\r
+  IN EFI_LEGACY_BIOS_PROTOCOL         *This,\r
+  IN  BBS_BBS_DEVICE_PATH             *BootOption,\r
+  IN  UINT32                          LoadOptionsSize,\r
+  IN  VOID                            *LoadOptions\r
+  )\r
+;\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_LEGACY_BIOS_UPDATE_KEYBOARD_LED_STATUS) (\r
+  IN EFI_LEGACY_BIOS_PROTOCOL         *This,\r
+  IN  UINT8                           Leds\r
+  )\r
+;\r
+\r
+/**\r
+  Retrieve legacy BBS info and assign boot priority.\r
+\r
+  @param  This Protocol instance pointer.\r
+  @param  HddCount Number of HDD_INFO structures\r
+  @param  HddInfo Onboard IDE controller information\r
+  @param  BbsCount Number of BBS_TABLE structures\r
+  @param  BbsTable List BBS entries\r
+\r
+  @retval  EFI_SUCCESS Tables returned\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_LEGACY_BIOS_GET_BBS_INFO) (\r
+  IN EFI_LEGACY_BIOS_PROTOCOL         *This,\r
+  OUT UINT16                          *HddCount,\r
+  OUT HDD_INFO                        **HddInfo,\r
+  OUT UINT16                          *BbsCount,\r
+  OUT IN BBS_TABLE                    **BbsTable\r
+  )\r
+;\r
+\r
+/**\r
+  Assign drive number to legacy HDD drives prior to booting an EFI\r
+  aware OS so the OS can access drives without an EFI driver.\r
+\r
+  @param  This Protocol instance pointer.\r
+  @param  BbsCount Number of BBS_TABLE structures\r
+  @param  BbsTable List BBS entries\r
+\r
+  @retval  EFI_SUCCESS Drive numbers assigned\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_LEGACY_BIOS_PREPARE_TO_BOOT_EFI) (\r
+  IN EFI_LEGACY_BIOS_PROTOCOL         *This,\r
+  OUT UINT16                          *BbsCount,\r
+  OUT IN BBS_TABLE                    **BbsTable\r
+  )\r
+;\r
+\r
+/**\r
+  To boot from an unconventional device like parties and/or execute\r
+  HDD diagnostics.\r
+\r
+  @param  This Protocol instance pointer.\r
+  @param  Attributes How to interpret the other input parameters\r
+  @param  BbsEntry The 0-based index into the BbsTable for the parent\r
+  device.\r
+  @param  BeerData Pointer to the 128 bytes of ram BEER data.\r
+  @param  ServiceAreaData Pointer to the 64 bytes of raw Service Area data. The\r
+  caller must provide a pointer to the specific Service\r
+  Area and not the start all Service Areas.\r
+\r
+  EFI_INVALID_PARAMETER if error. Does NOT return if no error.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_LEGACY_BIOS_BOOT_UNCONVENTIONAL_DEVICE) (\r
+  IN EFI_LEGACY_BIOS_PROTOCOL         *This,\r
+  IN UDC_ATTRIBUTES                   Attributes,\r
+  IN UINTN                            BbsEntry,\r
+  IN VOID                             *BeerData,\r
+  IN VOID                             *ServiceAreaData\r
+  )\r
+;\r
+\r
+/**\r
+  Shadow all legacy16 OPROMs that haven't been shadowed.\r
+  Warning: Use this with caution. This routine disconnects all EFI\r
+  drivers. If used externally then caller must re-connect EFI\r
+  drivers.\r
+\r
+  @retval  EFI_SUCCESS OPROMs shadowed\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_LEGACY_BIOS_SHADOW_ALL_LEGACY_OPROMS) (\r
+  IN EFI_LEGACY_BIOS_PROTOCOL *This\r
+  )\r
+;\r
+\r
+/**\r
+  Get a region from the LegacyBios for S3 usage.\r
+\r
+  @param  This Protocol instance pointer.\r
+  @param  LegacyMemorySize Size of required region\r
+  @param  Region Region to use.\r
+  00 = Either 0xE0000 or 0xF0000 block\r
+  Bit0 = 1 0xF0000 block\r
+  Bit1 = 1 0xE0000 block\r
+  @param  Alignment Address alignment. Bit mapped. First non-zero\r
+  bit from right is alignment.\r
+  @param  LegacyMemoryAddress Region Assigned\r
+\r
+  @retval  EFI_SUCCESS Region assigned\r
+  \r
+  @retval  Other Region not assigned\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_LEGACY_BIOS_GET_LEGACY_REGION) (\r
+  IN EFI_LEGACY_BIOS_PROTOCOL *This,\r
+  IN    UINTN                 LegacyMemorySize,\r
+  IN    UINTN                 Region,\r
+  IN    UINTN                 Alignment,\r
+  OUT   VOID                  **LegacyMemoryAddress\r
+  )\r
+;\r
+\r
+/**\r
+  Get a region from the LegacyBios for Tiano usage. Can only be invoked once.\r
+\r
+  @param  This Protocol instance pointer.\r
+  @param  LegacyMemorySize Size of data to copy\r
+  @param  LegacyMemoryAddress Legacy Region destination address\r
+  Note: must be in region assigned by\r
+  LegacyBiosGetLegacyRegion\r
+  @param  LegacyMemorySourceAddress Source of data\r
+\r
+  @retval  EFI_SUCCESS Region assigned\r
+  @retval  EFI_ACCESS_DENIED Destination outside assigned region\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_LEGACY_BIOS_COPY_LEGACY_REGION) (\r
+  IN EFI_LEGACY_BIOS_PROTOCOL *This,\r
+  IN    UINTN                 LegacyMemorySize,\r
+  IN    VOID                  *LegacyMemoryAddress,\r
+  IN    VOID                  *LegacyMemorySourceAddress\r
+  )\r
+;\r
+\r
+/**\r
+  @par Protocol Description:\r
+  Abstracts the traditional BIOS from the rest of EFI. The LegacyBoot() \r
+  member function allows the BDS to support booting a traditional OS. \r
+  EFI thunks drivers that make EFI bindings for BIOS INT services use \r
+  all the other member functions.\r
+\r
+  @param Int86\r
+  Performs traditional software INT. See the Int86() function description.\r
+\r
+  @param FarCall86\r
+  Performs a far call into Compatibility16 or traditional OpROM code. \r
+\r
+  @param CheckPciRom\r
+  Checks if a traditional OpROM exists for this device.\r
+\r
+  @param InstallPciRom\r
+  Loads a traditional OpROM in traditional OpROM address space.\r
+\r
+  @param LegacyBoot\r
+  Boots a traditional OS.\r
+\r
+  @param UpdateKeyboardLedStatus\r
+  Updates BDA to reflect the current EFI keyboard LED status.\r
+\r
+  @param GetBbsInfo\r
+  Allows an external agent, such as BIOS Setup, to get the BBS data. \r
+\r
+  @param ShadowAllLegacyOproms\r
+  Causes all legacy OpROMs to be shadowed.\r
+\r
+  @param PrepareToBootEfi\r
+  Performs all actions prior to boot. Used when booting an EFI-aware OS \r
+  rather than a legacy OS. \r
+\r
+  @param GetLegacyRegion\r
+  Allows EFI to reserve an area in the 0xE0000 or 0xF0000 block.\r
+\r
+  @param CopyLegacyRegion\r
+  Allows EFI to copy data to the area specified by GetLegacyRegion. \r
+\r
+  @param BootUnconventionalDevice\r
+  Allows the user to boot off an unconventional device such as a PARTIES partition.\r
+\r
+**/\r
+struct _EFI_LEGACY_BIOS_PROTOCOL {\r
+  EFI_LEGACY_BIOS_INT86                       Int86;\r
+  EFI_LEGACY_BIOS_FARCALL86                   FarCall86;\r
+  EFI_LEGACY_BIOS_CHECK_ROM                   CheckPciRom;\r
+  EFI_LEGACY_BIOS_INSTALL_ROM                 InstallPciRom;\r
+  EFI_LEGACY_BIOS_BOOT                        LegacyBoot;\r
+  EFI_LEGACY_BIOS_UPDATE_KEYBOARD_LED_STATUS  UpdateKeyboardLedStatus;\r
+  EFI_LEGACY_BIOS_GET_BBS_INFO                GetBbsInfo;\r
+  EFI_LEGACY_BIOS_PREPARE_TO_BOOT_EFI         PrepareToBootEfi;\r
+  EFI_LEGACY_BIOS_SHADOW_ALL_LEGACY_OPROMS    ShadowAllLegacyOproms;\r
+  EFI_LEGACY_BIOS_GET_LEGACY_REGION           GetLegacyRegion;\r
+  EFI_LEGACY_BIOS_COPY_LEGACY_REGION          CopyLegacyRegion;\r
+  EFI_LEGACY_BIOS_BOOT_UNCONVENTIONAL_DEVICE  BootUnconventionalDevice;\r
+};\r
+\r
+extern EFI_GUID gEfiLegacyBiosProtocolGuid;\r
+\r
+#endif\r
diff --git a/Tools/Source/TianoTools/Include/Protocol/LegacyBiosPlatform.h b/Tools/Source/TianoTools/Include/Protocol/LegacyBiosPlatform.h
new file mode 100644 (file)
index 0000000..56d6724
--- /dev/null
@@ -0,0 +1,307 @@
+/** @file\r
+  The EFI Legacy BIOS Patform Protocol is used to mate a Legacy16 \r
+  implementation with this EFI code. The EFI driver that produces \r
+  the Legacy BIOS protocol is generic and consumes this protocol.\r
+  A driver that matches the Legacy16 produces this protocol\r
+\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. This program and the accompanying materials                          \r
+  are licensed and made available under the terms and conditions of the BSD License         \r
+  which accompanies this distribution.  The full text of the license may be found at        \r
+  http://opensource.org/licenses/bsd-license.php                                            \r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.    \r
+\r
+  Module Name:  LegacyBiosPlatform.h\r
+\r
+  @par Revision Reference:\r
+  This protocol is defined in Framework for EFI Compatibility Support Module spec\r
+  Version 0.96\r
+**/\r
+\r
+#ifndef _EFI_LEGACY_BIOS_PLATFORM_H\r
+#define _EFI_LEGACY_BIOS_PLATFORM_H\r
+\r
+#define EFI_LEGACY_BIOS_PLATFORM_PROTOCOL_GUID \\r
+  { \\r
+    0x783658a3, 0x4172, 0x4421, {0xa2, 0x99, 0xe0, 0x9, 0x7, 0x9c, 0xc, 0xb4 } \\r
+  }\r
+\r
+typedef struct _EFI_LEGACY_BIOS_PLATFORM_PROTOCOL EFI_LEGACY_BIOS_PLATFORM_PROTOCOL;\r
+\r
+#pragma pack(1)\r
+//\r
+// Define structures for GetOemIntData\r
+//  Note:\r
+//    OemIntDataElenent is an array of structures from 0 to Count-1.\r
+//    RawData is an array of bytes from 0 to RamDataLength-1.\r
+//\r
+typedef struct {\r
+  UINT16  Int;\r
+  UINT16  Ax;\r
+  UINT32  RawDataLength;\r
+  UINT8   RawData[1];\r
+} EFI_OEM_INT_DATA_ELEMENT;\r
+\r
+typedef struct {\r
+  UINT16                    Count;\r
+  EFI_OEM_INT_DATA_ELEMENT  OemIntDataElement[1];\r
+} EFI_OEM_INT_DATA;\r
+#pragma pack()\r
+\r
+typedef enum {\r
+  EfiGetPlatformBinaryMpTable      = 0,\r
+  EfiGetPlatformBinaryOemIntData   = 1,\r
+  EfiGetPlatformBinaryOem16Data    = 2,\r
+  EfiGetPlatformBinaryOem32Data    = 3,\r
+  EfiGetPlatformBinaryTpmBinary    = 4,\r
+  EfiGetPlatformBinarySystemRom    = 5,\r
+  EfiGetPlatformPciExpressBase     = 6,\r
+  EfiGetPlatformPmmSize            = 7,\r
+  EfiGetPlatformEndOpromShadowAddr = 8,\r
+\r
+} EFI_GET_PLATFORM_INFO_MODE;\r
+\r
+typedef enum {\r
+  EfiGetPlatformVgaHandle       = 0,\r
+  EfiGetPlatformIdeHandle       = 1,\r
+  EfiGetPlatformIsaBusHandle    = 2,\r
+  EfiGetPlatformUsbHandle       = 3\r
+} EFI_GET_PLATFORM_HANDLE_MODE;\r
+\r
+typedef enum {\r
+  EfiPlatformHookPrepareToScanRom = 0,\r
+  EfiPlatformHookShadowServiceRoms= 1,\r
+  EfiPlatformHookAfterRomInit     = 2\r
+} EFI_GET_PLATFORM_HOOK_MODE;\r
+\r
+/**\r
+  Finds the binary data or other platform information.\r
+\r
+  @param  This Protocol instance pointer.\r
+  @param  Mode Specifies what data to return\r
+  @param  Table Pointer to MP table.\r
+  @param  TableSize Size in bytes of table.\r
+  @param  Location Legacy region requested\r
+  0x00 = Any location\r
+  Bit 0 = 0xF0000 region\r
+  Bit 1 = 0xE0000 region\r
+  Multiple bits can be set\r
+  @param  Alignment Address alignment for allocation.\r
+  Bit mapped. First non-zero bit from right\r
+  is alignment.\r
+  @param  LegacySegment Segment in LegacyBios where Table is stored\r
+  @param  LegacyOffset Offset in LegacyBios where Table is stored\r
+\r
+  @retval  EFI_SUCCESS Data was returned successfully.\r
+  @retval  EFI_UNSUPPORTED Mode is not supported on the platform.\r
+  @retval  EFI_NOT_FOUND Binary image or table not found.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_LEGACY_BIOS_PLATFORM_GET_PLATFORM_INFO) (\r
+  IN EFI_LEGACY_BIOS_PLATFORM_PROTOCOL   *This,\r
+  IN EFI_GET_PLATFORM_INFO_MODE          Mode,\r
+  OUT VOID                               **Table,\r
+  OUT UINTN                              *TableSize,\r
+  OUT UINTN                              *Location,\r
+  OUT UINTN                              *Alignment,\r
+  IN  UINT16                             LegacySegment,\r
+  IN  UINT16                             LegacyOffset\r
+  )\r
+;\r
+\r
+/**\r
+  Returns a buffer of handles for the requested sub-function.\r
+\r
+  @param  This Protocol instance pointer.\r
+  @param  Mode Specifies what handle to return.\r
+  @param  Type Type from Device Path for Handle to represent.\r
+  @param  HandleBuffer Handles of the device/controller in priority order\r
+  with HandleBuffer[0] highest priority.\r
+  @param  HandleCount Number of handles in the buffer.\r
+  @param  AdditionalData Mode specific.\r
+\r
+  @retval  EFI_SUCCESS Handle is valid\r
+  @retval  EFI_UNSUPPORTED Mode is not supported on the platform.\r
+  @retval  EFI_NOT_FOUND Handle is not known\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_LEGACY_BIOS_PLATFORM_GET_PLATFORM_HANDLE) (\r
+  IN EFI_LEGACY_BIOS_PLATFORM_PROTOCOL   *This,\r
+  IN EFI_GET_PLATFORM_HANDLE_MODE        Mode,\r
+  IN UINT16                              Type,\r
+  OUT EFI_HANDLE                         **HandleBuffer,\r
+  OUT UINTN                              *HandleCount,\r
+  IN  VOID                               **AdditionalData OPTIONAL\r
+  )\r
+;\r
+\r
+/**\r
+  Load and initialize the Legacy BIOS SMM handler.\r
+\r
+  @param  This Protocol instance pointer.\r
+  @param  EfiToLegacy16BootTable Pointer to Legacy16 boot table.\r
+\r
+  @retval  EFI_SUCCESS SMM code loaded.\r
+  @retval  EFI_DEVICE_ERROR SMM code failed to load\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_LEGACY_BIOS_PLATFORM_SMM_INIT) (\r
+  IN EFI_LEGACY_BIOS_PLATFORM_PROTOCOL   *This,\r
+  IN  VOID                               *EfiToLegacy16BootTable\r
+  )\r
+;\r
+\r
+/**\r
+  Allows platform to perform any required action after a LegacyBios operation.\r
+\r
+  @param  This Protocol instance pointer.\r
+  @param  Mode Specifies what handle to return.\r
+  @param  Type Mode specific.\r
+  @param  DeviceHandle List of PCI devices in the system.\r
+  @param  ShadowAddress First free OpROM area, after other OpROMs have been dispatched.\r
+  @param  Compatibility16Table Pointer to Compatibility16Table.\r
+  @param  AdditionalData Mode specific Pointer to additional data returned Â¨C mode specific.\r
+\r
+  @retval  EFI_SUCCESS RomImage is valid\r
+  @retval  EFI_UNSUPPORTED Mode is not supported on the platform.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_LEGACY_BIOS_PLATFORM_HOOKS) (\r
+  IN EFI_LEGACY_BIOS_PLATFORM_PROTOCOL   *This,\r
+  IN EFI_GET_PLATFORM_HOOK_MODE          Mode,\r
+  IN UINT16                              Type,\r
+  IN  EFI_HANDLE                         DeviceHandle,\r
+  IN  OUT UINTN                          *ShadowAddress,\r
+  IN  EFI_COMPATIBILITY16_TABLE          *Compatibility16Table,\r
+  IN  VOID                               **AdditionalData OPTIONAL\r
+  )\r
+;\r
+\r
+/**\r
+  Returns information associated with PCI IRQ routing.\r
+\r
+  @param  This Protocol instance pointer.\r
+  @param  RoutingTable Pointer to PCI IRQ Routing table.\r
+  @param  RoutingTableEntries Number of entries in table.\r
+  @param  LocalPirqTable $PIR table\r
+  @param  PirqTableSize $PIR table size\r
+  @param  LocalIrqPriorityTable List of interrupts in priority order to assign\r
+  @param  IrqPriorityTableEntries- Number of entries in priority table\r
+\r
+  @retval  EFI_SUCCESS Data was successfully returned.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_LEGACY_BIOS_PLATFORM_GET_ROUTING_TABLE) (\r
+  IN EFI_LEGACY_BIOS_PLATFORM_PROTOCOL   *This,\r
+  OUT VOID                               **RoutingTable,\r
+  OUT UINTN                              *RoutingTableEntries,\r
+  OUT VOID                               **LocalPirqTable, OPTIONAL\r
+  OUT UINTN                              *PirqTableSize, OPTIONAL\r
+  OUT VOID                               **LocalIrqPriorityTable, OPTIONAL\r
+  OUT UINTN                              *IrqPriorityTableEntries OPTIONAL\r
+  )\r
+;\r
+\r
+/**\r
+  Translates the given PIRQ accounting for bridge\r
+\r
+  @param  This Protocol instance pointer.\r
+  @param  PciBus PCI bus number for this device.\r
+  @param  PciDevice PCI device number for this device.\r
+  @param  PciFunction PCI function number for this device.\r
+  @param  Pirq Input is PIRQ reported by device, output is true PIRQ.\r
+  @param  PciIrq The IRQ already assigned to the PIRQ or the IRQ to be\r
+  assigned to the PIRQ.\r
+\r
+  @retval  EFI_SUCCESS The PIRQ was translated.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_LEGACY_BIOS_PLATFORM_TRANSLATE_PIRQ) (\r
+  IN EFI_LEGACY_BIOS_PLATFORM_PROTOCOL   *This,\r
+  IN  UINTN                              PciBus,\r
+  IN  UINTN                              PciDevice,\r
+  IN  UINTN                              PciFunction,\r
+  IN  OUT UINT8                          *Pirq,\r
+  OUT UINT8                              *PciIrq\r
+  )\r
+;\r
+\r
+/**\r
+  Attempt to legacy boot the BootOption. If the EFI contexted has been \r
+  compromised this function will not return.\r
+\r
+  @param  This Protocol instance pointer.\r
+  @param  BbsDevicePath EFI Device Path from BootXXXX variable.\r
+  @param  BbsTable Internal BBS table.\r
+  @param  LoadOptionSize Size of LoadOption in size.\r
+  @param  LoadOption LoadOption from BootXXXX variable\r
+  @param  EfiToLegacy16BootTable Pointer to BootTable structure\r
+\r
+  @retval  EFI_SUCCESS Ready to boot.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_LEGACY_BIOS_PLATFORM_PREPARE_TO_BOOT) (\r
+  IN EFI_LEGACY_BIOS_PLATFORM_PROTOCOL   *This,\r
+  IN  BBS_BBS_DEVICE_PATH                *BbsDevicePath,\r
+  IN  VOID                               *BbsTable,\r
+  IN  UINT32                             LoadOptionsSize,\r
+  IN  VOID                               *LoadOptions,\r
+  IN  VOID                               *EfiToLegacy16BootTable\r
+  )\r
+;\r
+\r
+/**\r
+  @par Protocol Description:\r
+  Abstracts the platform portion of the traditional BIOS. \r
+\r
+  @param GetPlatformInfo\r
+  Gets binary data or other platform information.\r
+\r
+  @param GetPlatformHandle\r
+  Returns a buffer of all handles matching the requested subfunction. \r
+\r
+  @param SmmInit\r
+  Loads and initializes the traditional BIOS SMM handler.\r
+\r
+  @param PlatformHooks\r
+  Allows platform to perform any required actions after a LegacyBios operation.\r
+\r
+  @param GetRoutingTable\r
+  Gets $PIR table. \r
+\r
+  @param TranslatePirq \r
+  Translates the given PIRQ to the final value after traversing any PCI bridges. \r
+\r
+  @param PrepareToBoot\r
+  Final platform function before the system attempts to boot to a traditional OS. \r
+\r
+**/\r
+struct _EFI_LEGACY_BIOS_PLATFORM_PROTOCOL {\r
+  EFI_LEGACY_BIOS_PLATFORM_GET_PLATFORM_INFO    GetPlatformInfo;\r
+  EFI_LEGACY_BIOS_PLATFORM_GET_PLATFORM_HANDLE  GetPlatformHandle;\r
+  EFI_LEGACY_BIOS_PLATFORM_SMM_INIT             SmmInit;\r
+  EFI_LEGACY_BIOS_PLATFORM_HOOKS                PlatformHooks;\r
+  EFI_LEGACY_BIOS_PLATFORM_GET_ROUTING_TABLE    GetRoutingTable;\r
+  EFI_LEGACY_BIOS_PLATFORM_TRANSLATE_PIRQ       TranslatePirq;\r
+  EFI_LEGACY_BIOS_PLATFORM_PREPARE_TO_BOOT      PrepareToBoot;\r
+};\r
+\r
+extern EFI_GUID gEfiLegacyBiosPlatformProtocolGuid;\r
+\r
+#endif\r
diff --git a/Tools/Source/TianoTools/Include/Protocol/LegacyInterrupt.h b/Tools/Source/TianoTools/Include/Protocol/LegacyInterrupt.h
new file mode 100644 (file)
index 0000000..54dc9aa
--- /dev/null
@@ -0,0 +1,131 @@
+/** @file\r
+  This protocol manages the legacy memory regions between 0xc0000 - 0xfffff\r
+\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. This program and the accompanying materials                          \r
+  are licensed and made available under the terms and conditions of the BSD License         \r
+  which accompanies this distribution.  The full text of the license may be found at        \r
+  http://opensource.org/licenses/bsd-license.php                                            \r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.    \r
+\r
+  Module Name:  LegacyInterrupt.h\r
+\r
+  @par Revision Reference:\r
+  This protocol is defined in Framework for EFI Compatibility Support Module spec\r
+  Version 0.96\r
+\r
+**/\r
+\r
+#ifndef _EFI_LEGACY_INTERRUPT_H_\r
+#define _EFI_LEGACY_INTERRUPT_H_\r
+\r
+#define EFI_LEGACY_INTERRUPT_PROTOCOL_GUID \\r
+  { \\r
+    0x31ce593d, 0x108a, 0x485d, {0xad, 0xb2, 0x78, 0xf2, 0x1f, 0x29, 0x66, 0xbe } \\r
+  }\r
+\r
+typedef struct _EFI_LEGACY_INTERRUPT_PROTOCOL EFI_LEGACY_INTERRUPT_PROTOCOL;\r
+\r
+/**\r
+  Get the number of PIRQs this hardware supports.\r
+\r
+  @param  This Protocol instance pointer.\r
+  @param  NumberPirsq Number of PIRQs.\r
+\r
+  @retval  EFI_SUCCESS Number of PIRQs returned.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_LEGACY_INTERRUPT_GET_NUMBER_PIRQS) (\r
+  IN EFI_LEGACY_INTERRUPT_PROTOCOL            *This,\r
+  OUT UINT8                                   *NumberPirqs\r
+  );\r
+\r
+/**\r
+  Gets the PCI location associated with this protocol.\r
+\r
+  @param  This Protocol instance pointer.\r
+  @param  Bus PCI Bus\r
+  @param  Device PCI Device\r
+  @param  Function PCI Function\r
+\r
+  @retval  EFI_SUCCESS Bus/Device/Function returned\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_LEGACY_INTERRUPT_GET_LOCATION) (\r
+  IN EFI_LEGACY_INTERRUPT_PROTOCOL            *This,\r
+  OUT UINT8                                   *Bus,\r
+  OUT UINT8                                   *Device,\r
+  OUT UINT8                                   *Function\r
+  );\r
+\r
+/**\r
+  Read the PIRQ register and return the data\r
+\r
+  @param  This Protocol instance pointer.\r
+  @param  PirqNumber PIRQ register to read\r
+  @param  PirqData Data read\r
+\r
+  @retval  EFI_SUCCESS Data was read\r
+  @retval  EFI_INVALID_PARAMETER Invalid PIRQ number\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_LEGACY_INTERRUPT_READ_PIRQ) (\r
+  IN EFI_LEGACY_INTERRUPT_PROTOCOL           *This,\r
+  IN  UINT8                                  PirqNumber,\r
+  OUT UINT8                                  *PirqData\r
+  );\r
+\r
+/**\r
+  Write the specified PIRQ register with the given data.\r
+\r
+  @param  This Protocol instance pointer.\r
+  @param  PirqNumber PIRQ register to read.\r
+  @param  PirqData Data written.\r
+\r
+  @retval  EFI_SUCCESS Table pointer returned\r
+  @retval  EFI_INVALID_PARAMETER Invalid PIRQ number\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_LEGACY_INTERRUPT_WRITE_PIRQ) (\r
+  IN EFI_LEGACY_INTERRUPT_PROTOCOL           *This,\r
+  IN  UINT8                                  PirqNumber,\r
+  IN UINT8                                   PirqData\r
+  );\r
+\r
+/**\r
+  @par Protocol Description:\r
+  Abstracts the PIRQ programming from the generic EFI Compatibility Support Modules\r
+\r
+  @param GetNumberPirqs\r
+  Gets the number of PIRQs supported.\r
+\r
+  @param GetLocation\r
+  Gets the PCI bus, device, and function that associated with this protocol. \r
+\r
+  @param ReadPirq\r
+  Reads the indicated PIRQ register.\r
+\r
+  @param WritePirq\r
+  Writes to the indicated PIRQ register. \r
+\r
+**/\r
+struct _EFI_LEGACY_INTERRUPT_PROTOCOL {\r
+  EFI_LEGACY_INTERRUPT_GET_NUMBER_PIRQS GetNumberPirqs;\r
+  EFI_LEGACY_INTERRUPT_GET_LOCATION     GetLocation;\r
+  EFI_LEGACY_INTERRUPT_READ_PIRQ        ReadPirq;\r
+  EFI_LEGACY_INTERRUPT_WRITE_PIRQ       WritePirq;\r
+};\r
+\r
+extern EFI_GUID gEfiLegacyInterruptProtocolGuid;\r
+\r
+#endif\r
diff --git a/Tools/Source/TianoTools/Include/Protocol/LegacyRegion.h b/Tools/Source/TianoTools/Include/Protocol/LegacyRegion.h
new file mode 100644 (file)
index 0000000..db7d346
--- /dev/null
@@ -0,0 +1,152 @@
+/** @file\r
+  This protocol manages the legacy memory regions between 0xc0000 - 0xfffff\r
+\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. This program and the accompanying materials                          \r
+  are licensed and made available under the terms and conditions of the BSD License         \r
+  which accompanies this distribution.  The full text of the license may be found at        \r
+  http://opensource.org/licenses/bsd-license.php                                            \r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.    \r
+\r
+  Module Name:  LegacyRegion.h\r
+\r
+  @par Revision Reference:\r
+  This protocol is defined in Framework for EFI Compatibility Support Module spec\r
+  Version 0.96\r
+\r
+**/\r
+\r
+#ifndef _EFI_LEGACY_REGION_H_\r
+#define _EFI_LEGACY_REGION_H_\r
+\r
+#define EFI_LEGACY_REGION_PROTOCOL_GUID \\r
+  { \\r
+    0xfc9013a, 0x568, 0x4ba9, {0x9b, 0x7e, 0xc9, 0xc3, 0x90, 0xa6, 0x60, 0x9b } \\r
+  }\r
+\r
+typedef struct _EFI_LEGACY_REGION_PROTOCOL EFI_LEGACY_REGION_PROTOCOL;\r
+\r
+/**\r
+  Sets hardware to decode or not decode a region.\r
+\r
+  @param  This Indicates the EFI_LEGACY_REGION_PROTOCOL instance\r
+  \r
+  @param  Start Start of region to decode.\r
+  \r
+  @param  Length Size in bytes of the region.\r
+  \r
+  @param  On Decode/nondecode flag.\r
+\r
+  @retval EFI_SUCCESS Decode range successfully changed.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_LEGACY_REGION_DECODE) (\r
+  IN EFI_LEGACY_REGION_PROTOCOL           *This,\r
+  IN  UINT32                              Start,\r
+  IN  UINT32                              Length,\r
+  IN  BOOLEAN                             *On\r
+  );\r
+\r
+/**\r
+  Sets a region to read only.\r
+\r
+  @param  This Indicates the EFI_LEGACY_REGION_PROTOCOL instance\r
+  \r
+  @param  Start Start of region to lock.\r
+  \r
+  @param  Length Size in bytes of the region.\r
+  \r
+  @param  Granularity Lock attribute affects this granularity in bytes.\r
+\r
+  @retval EFI_SUCCESS The region was made read only.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_LEGACY_REGION_LOCK) (\r
+  IN EFI_LEGACY_REGION_PROTOCOL           *This,\r
+  IN  UINT32                              Start,\r
+  IN  UINT32                              Length,\r
+  OUT UINT32                              *Granularity OPTIONAL\r
+  );\r
+\r
+/**\r
+  Sets a region to read only and ensures that flash is locked from being \r
+  inadvertently modified.\r
+\r
+  @param  This Indicates the EFI_LEGACY_REGION_PROTOCOL instance\r
+  \r
+  @param  Start Start of region to lock.\r
+  \r
+  @param  Length Size in bytes of the region.\r
+  \r
+  @param  Granularity Lock attribute affects this granularity in bytes.\r
+\r
+  @retval EFI_SUCCESS The region was made read only and flash is locked.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_LEGACY_REGION_BOOT_LOCK) (\r
+  IN EFI_LEGACY_REGION_PROTOCOL           *This,\r
+  IN  UINT32                              Start,\r
+  IN  UINT32                              Length,\r
+  OUT UINT32                              *Granularity OPTIONAL\r
+  );\r
+\r
+/**\r
+  Sets a region to read-write.\r
+\r
+  @param  This Indicates the EFI_LEGACY_REGION_PROTOCOL instance\r
+  \r
+  @param  Start Start of region to lock.\r
+  \r
+  @param  Length Size in bytes of the region.\r
+  \r
+  @param  Granularity Lock attribute affects this granularity in bytes.\r
+\r
+  @retval EFI_SUCCESS The region was successfully made read-write.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_LEGACY_REGION_UNLOCK) (\r
+  IN EFI_LEGACY_REGION_PROTOCOL           *This,\r
+  IN  UINT32                              Start,\r
+  IN  UINT32                              Length,\r
+  OUT UINT32                              *Granularity OPTIONAL\r
+  );\r
+\r
+/**\r
+  @par Protocol Description:\r
+  Abstracts the hardware control of the physical address region 0xC0000¨C0xFFFFF \r
+  for the traditional BIOS.\r
+\r
+  @param Decode\r
+  Specifies a region for the chipset to decode\r
+\r
+  @param Lock\r
+  Makes the specified OpROM region read only or locked.\r
+\r
+  @param BootLock\r
+  Sets a region to read only and ensures tat flash is locked from \r
+  inadvertent modification.\r
+\r
+  @param Unlock\r
+  Makes the specified OpROM region read-write or unlocked. \r
+\r
+**/\r
+struct _EFI_LEGACY_REGION_PROTOCOL {\r
+  EFI_LEGACY_REGION_DECODE    Decode;\r
+  EFI_LEGACY_REGION_LOCK      Lock;\r
+  EFI_LEGACY_REGION_BOOT_LOCK BootLock;\r
+  EFI_LEGACY_REGION_UNLOCK    UnLock;\r
+};\r
+\r
+extern EFI_GUID gEfiLegacyRegionProtocolGuid;\r
+\r
+#endif\r
diff --git a/Tools/Source/TianoTools/Include/Protocol/LoadFile.h b/Tools/Source/TianoTools/Include/Protocol/LoadFile.h
new file mode 100644 (file)
index 0000000..346039f
--- /dev/null
@@ -0,0 +1,83 @@
+/** @file\r
+  Load File protocol as defined in the EFI 1.0 specification.\r
+\r
+  Load file protocol exists to supports the addition of new boot devices, \r
+  and to support booting from devices that do not map well to file system. \r
+  Network boot is done via a LoadFile protocol.\r
+\r
+  EFI 1.0 can boot from any device that produces a LoadFile protocol.\r
+\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. This program and the accompanying materials                          \r
+  are licensed and made available under the terms and conditions of the BSD License         \r
+  which accompanies this distribution.  The full text of the license may be found at        \r
+  http://opensource.org/licenses/bsd-license.php                                            \r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+  Module Name:  LoadFile.h\r
+\r
+**/\r
+\r
+#ifndef __EFI_LOAD_FILE_PROTOCOL_H__\r
+#define __EFI_LOAD_FILE_PROTOCOL_H__\r
+\r
+#define LOAD_FILE_PROTOCOL_GUID \\r
+  { \\r
+    0x56EC3091, 0x954C, 0x11d2, {0x8E, 0x3F, 0x00, 0xA0, 0xC9, 0x69, 0x72, 0x3B } \\r
+  }\r
+\r
+//\r
+// Protocol Guid Name defined by UEFI 2.0 spec.\r
+//\r
+#define EFI_LOAD_FILE_PROTOCOL_GUID LOAD_FILE_PROTOCOL_GUID\r
+\r
+typedef struct _EFI_LOAD_FILE_PROTOCOL EFI_LOAD_FILE_PROTOCOL;\r
+\r
+/**\r
+  Causes the driver to load a specified file.\r
+\r
+  @param  This       Protocol instance pointer.\r
+  @param  FilePath   The device specific path of the file to load.\r
+  @param  BootPolicy If TRUE, indicates that the request originates from the\r
+                     boot manager is attempting to load FilePath as a boot\r
+                     selection. If FALSE, then FilePath must match as exact file\r
+                     to be loaded.\r
+  @param  BufferSize On input the size of Buffer in bytes. On output with a return\r
+                     code of EFI_SUCCESS, the amount of data transferred to\r
+                     Buffer. On output with a return code of EFI_BUFFER_TOO_SMALL,\r
+                     the size of Buffer required to retrieve the requested file.\r
+  @param  Buffer     The memory buffer to transfer the file to. IF Buffer is NULL,\r
+                     then no the size of the requested file is returned in\r
+                     BufferSize.\r
+\r
+  @retval EFI_SUCCESS           The file was loaded.\r
+  @retval EFI_UNSUPPORTED       The device does not support the provided BootPolicy\r
+  @retval EFI_INVALID_PARAMETER FilePath is not a valid device path, or\r
+                                BufferSize is NULL.\r
+  @retval EFI_NO_MEDIA          No medium was present to load the file.\r
+  @retval EFI_DEVICE_ERROR      The file was not loaded due to a device error.\r
+  @retval EFI_NO_RESPONSE       The remote system did not respond.\r
+  @retval EFI_NOT_FOUND         The file was not found\r
+  @retval EFI_ABORTED           The file load process was manually cancelled.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_LOAD_FILE) (\r
+  IN EFI_LOAD_FILE_PROTOCOL           *This,\r
+  IN EFI_DEVICE_PATH_PROTOCOL         *FilePath,\r
+  IN BOOLEAN                          BootPolicy,\r
+  IN OUT UINTN                        *BufferSize,\r
+  IN VOID                             *Buffer OPTIONAL\r
+  )\r
+;\r
+\r
+struct _EFI_LOAD_FILE_PROTOCOL {\r
+  EFI_LOAD_FILE LoadFile;\r
+};\r
+\r
+extern EFI_GUID gEfiLoadFileProtocolGuid;\r
+\r
+#endif\r
diff --git a/Tools/Source/TianoTools/Include/Protocol/LoadedImage.h b/Tools/Source/TianoTools/Include/Protocol/LoadedImage.h
new file mode 100644 (file)
index 0000000..aee063c
--- /dev/null
@@ -0,0 +1,69 @@
+/** @file\r
+  EFI 1.0 Loaded image protocol definition.\r
+\r
+  Every EFI driver and application is passed an image handle when it is loaded.\r
+  This image handle will contain a Loaded Image Protocol.\r
+\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. This program and the accompanying materials                          \r
+  are licensed and made available under the terms and conditions of the BSD License         \r
+  which accompanies this distribution.  The full text of the license may be found at        \r
+  http://opensource.org/licenses/bsd-license.php                                            \r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+  Module Name:  LoadedImage.h\r
+\r
+**/\r
+\r
+#ifndef __LOADED_IMAGE_PROTOCOL_H__\r
+#define __LOADED_IMAGE_PROTOCOL_H__\r
+\r
+#define EFI_LOADED_IMAGE_PROTOCOL_GUID \\r
+  { \\r
+    0x5B1B31A1, 0x9562, 0x11d2, {0x8E, 0x3F, 0x00, 0xA0, 0xC9, 0x69, 0x72, 0x3B } \\r
+  }\r
+\r
+//\r
+// EFI_SYSTEM_TABLE & EFI_IMAGE_UNLOAD are defined in EfiApi.h\r
+//\r
+#define EFI_LOADED_IMAGE_INFORMATION_REVISION 0x1000\r
+#define EFI_LOADED_IMAGE_PROTOCOL_REVISION    EFI_LOADED_IMAGE_INFORMATION_REVISION\r
+\r
+typedef struct {\r
+  UINT32                    Revision;\r
+  EFI_HANDLE                ParentHandle;\r
+  EFI_SYSTEM_TABLE          *SystemTable;\r
+\r
+  //\r
+  // Source location of image\r
+  //\r
+  EFI_HANDLE                DeviceHandle;\r
+  EFI_DEVICE_PATH_PROTOCOL  *FilePath;\r
+  VOID                      *Reserved;\r
+\r
+  //\r
+  // Images load options\r
+  //\r
+  UINT32                    LoadOptionsSize;\r
+  VOID                      *LoadOptions;\r
+\r
+  //\r
+  // Location of where image was loaded\r
+  //\r
+  VOID                      *ImageBase;\r
+  UINT64                    ImageSize;\r
+  EFI_MEMORY_TYPE           ImageCodeType;\r
+  EFI_MEMORY_TYPE           ImageDataType;\r
+\r
+  //\r
+  // If the driver image supports a dynamic unload request\r
+  //\r
+  EFI_IMAGE_UNLOAD          Unload;\r
+\r
+} EFI_LOADED_IMAGE_PROTOCOL;\r
+\r
+extern EFI_GUID gEfiLoadedImageProtocolGuid;\r
+\r
+#endif\r
diff --git a/Tools/Source/TianoTools/Include/Protocol/ManagedNetwork.h b/Tools/Source/TianoTools/Include/Protocol/ManagedNetwork.h
new file mode 100644 (file)
index 0000000..1bf9a13
--- /dev/null
@@ -0,0 +1,314 @@
+/** @file\r
+  EFI_MANAGED_NETWORK_SERVICE_BINDING_PROTOCOL as defined in UEFI 2.0.\r
+  EFI_MANAGED_NETWORK_PROTOCOL as defined in UEFI 2.0.\r
+\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. This program and the accompanying materials                          \r
+  are licensed and made available under the terms and conditions of the BSD License         \r
+  which accompanies this distribution.  The full text of the license may be found at        \r
+  http://opensource.org/licenses/bsd-license.php                                            \r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+  Module Name:  ManagedNetwork.h\r
+\r
+**/\r
+\r
+#ifndef _EFI_MANAGED_NETWORK_PROTOCOL_H\r
+#define _EFI_MANAGED_NETWORK_PROTOCOL_H\r
+\r
+#define EFI_MANAGED_NETWORK_SERVICE_BINDING_PROTOCOL_GUID \\r
+  { \\r
+    0xf36ff770, 0xa7e1, 0x42cf, {0x9e, 0xd2, 0x56, 0xf0, 0xf2, 0x71, 0xf4, 0x4c } \\r
+  }\r
+\r
+#define EFI_MANAGED_NETWORK_PROTOCOL_GUID \\r
+  { \\r
+    0x3b95aa31, 0x3793, 0x434b, {0x86, 0x67, 0xc8, 0x7, 0x8, 0x92, 0xe0, 0x5e } \\r
+  }\r
+\r
+typedef struct _EFI_MANAGED_NETWORK_PROTOCOL EFI_MANAGED_NETWORK_PROTOCOL;\r
+\r
+typedef struct {\r
+  UINT32     ReceivedQueueTimeoutValue;\r
+  UINT32     TransmitQueueTimeoutValue;\r
+  UINT16     ProtocolTypeFilter;\r
+  BOOLEAN    EnableUnicastReceive;\r
+  BOOLEAN    EnableMulticastReceive;\r
+  BOOLEAN    EnableBroadcastReceive;\r
+  BOOLEAN    EnablePromiscuousReceive;\r
+  BOOLEAN    FlushQueuesOnReset;\r
+  BOOLEAN    EnableReceiveTimestamps;\r
+  BOOLEAN    DisableBackgroundPolling;\r
+} EFI_MANAGED_NETWORK_CONFIG_DATA;\r
+\r
+typedef struct {\r
+  EFI_TIME      Timestamp;\r
+  EFI_EVENT     RecycleEvent;\r
+  UINT32        PacketLength;\r
+  UINT32        HeaderLength;\r
+  UINT32        AddressLength;\r
+  UINT32        DataLength;\r
+  BOOLEAN       BroadcastFlag;\r
+  BOOLEAN       MulticastFlag;\r
+  BOOLEAN       PromiscuousFlag;\r
+  UINT16        ProtocolType;\r
+  VOID          *DestinationAddress;\r
+  VOID          *SourceAddress;\r
+  VOID          *MediaHeader;\r
+  VOID          *PacketData;\r
+} EFI_MANAGED_NETWORK_RECEIVE_DATA;\r
+\r
+typedef struct {\r
+  UINT32        FragmentLength;\r
+  VOID          *FragmentBuffer;\r
+} EFI_MANAGED_NETWORK_FRAGMENT_DATA;\r
+\r
+typedef struct {\r
+  EFI_MAC_ADDRESS                   *DestinationAddress; //OPTIONAL\r
+  EFI_MAC_ADDRESS                   *SourceAddress;      //OPTIONAL\r
+  UINT16                            ProtocolType;        //OPTIONAL\r
+  UINT32                            DataLength;\r
+  UINT16                            HeaderLength;        //OPTIONAL\r
+  UINT16                            FragmentCount;\r
+  EFI_MANAGED_NETWORK_FRAGMENT_DATA FragmentTable[1];\r
+} EFI_MANAGED_NETWORK_TRANSMIT_DATA;\r
+\r
+\r
+typedef struct {\r
+  EFI_EVENT                             Event;\r
+  EFI_STATUS                            Status;\r
+  union {\r
+    EFI_MANAGED_NETWORK_RECEIVE_DATA    *RxData;\r
+    EFI_MANAGED_NETWORK_TRANSMIT_DATA   *TxData;\r
+  } Packet;\r
+} EFI_MANAGED_NETWORK_COMPLETION_TOKEN;\r
+\r
+/**\r
+  Returns the operational parameters for the current MNP child driver.\r
+\r
+  @param  This          Pointer to the EFI_MANAGED_NETWORK_PROTOCOL instance.\r
+  @param  MnpConfigData Pointer to storage for MNP operational parameters.\r
+  @param  SnpModeData   Pointer to storage for SNP operational parameters.\r
+\r
+  @retval EFI_SUCCESS           The operation completed successfully.\r
+  @retval EFI_INVALID_PARAMETER This is NULL.\r
+  @retval EFI_UNSUPPORTED       The requested feature is unsupported in this MNP implementation.\r
+  @retval EFI_NOT_STARTED       This MNP child driver instance has not been configured. The default\r
+                                values are returned in MnpConfigData if it is not NULL.\r
+  @retval Other                 The mode data could not be read.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_MANAGED_NETWORK_GET_MODE_DATA) (\r
+  IN  EFI_MANAGED_NETWORK_PROTOCOL     *This,\r
+  OUT EFI_MANAGED_NETWORK_CONFIG_DATA  *MnpConfigData  OPTIONAL,\r
+  OUT EFI_SIMPLE_NETWORK_MODE          *SnpModeData    OPTIONAL \r
+  )\r
+;  \r
+\r
+/**\r
+  Sets or clears the operational parameters for the MNP child driver.\r
+\r
+  @param  This          Pointer to the EFI_MANAGED_NETWORK_PROTOCOL instance.\r
+  @param  MnpConfigData Pointer to configuration data that will be assigned to the MNP\r
+                        child driver instance. If NULL, the MNP child driver instance is\r
+                        reset to startup defaults and all pending transmit and receive\r
+                        requests are flushed.\r
+\r
+  @retval EFI_SUCCESS           The operation completed successfully.\r
+  @retval EFI_INVALID_PARAMETER One or more parameters are invalid.\r
+  @retval EFI_OUT_OF_RESOURCES  Required system resources (usually memory) could not be\r
+                                allocated.\r
+  @retval EFI_UNSUPPORTED       The requested feature is unsupported in this [MNP]\r
+                                implementation.\r
+  @retval EFI_DEVICE_ERROR      An unexpected network or system error occurred.\r
+  @retval Other                 The MNP child driver instance has been reset to startup defaults.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_MANAGED_NETWORK_CONFIGURE) (\r
+  IN EFI_MANAGED_NETWORK_PROTOCOL     *This,\r
+  IN EFI_MANAGED_NETWORK_CONFIG_DATA  *MnpConfigData  OPTIONAL \r
+  )\r
+;    \r
+    \r
+/**\r
+  Translates an IP multicast address to a hardware (MAC) multicast address.\r
+\r
+  @param  This       Pointer to the EFI_MANAGED_NETWORK_PROTOCOL instance.\r
+  @param  Ipv6Flag   Set to TRUE to if IpAddress is an IPv6 multicast address.\r
+                     Set to FALSE if IpAddress is an IPv4 multicast address.\r
+  @param  IpAddress  Pointer to the multicast IP address (in network byte order) to convert.\r
+  @param  MacAddress Pointer to the resulting multicast MAC address.\r
+\r
+  @retval EFI_SUCCESS           The operation completed successfully.\r
+  @retval EFI_INVALID_PARAMETER One of the following conditions is TRUE:\r
+                                - This is NULL.\r
+                                - IpAddress is NULL.\r
+                                - *IpAddress is not a valid multicast IP address.\r
+                                - MacAddress is NULL.\r
+  @retval EFI_NOT_STARTED       This MNP child driver instance has not been configured.\r
+  @retval EFI_UNSUPPORTED       The requested feature is unsupported in this MNP implementation.\r
+  @retval EFI_DEVICE_ERROR      An unexpected network or system error occurred.\r
+  @retval Other                 The address could not be converted.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_MANAGED_NETWORK_MCAST_IP_TO_MAC) (\r
+  IN  EFI_MANAGED_NETWORK_PROTOCOL  *This,\r
+  IN  BOOLEAN                       Ipv6Flag,\r
+  IN  EFI_IP_ADDRESS                *IpAddress,\r
+  OUT EFI_MAC_ADDRESS               *MacAddress \r
+  )\r
+;      \r
+\r
+/**\r
+  Enables and disables receive filters for multicast address.\r
+\r
+  @param  This       Pointer to the EFI_MANAGED_NETWORK_PROTOCOL instance.\r
+  @param  JoinFlag   Set to TRUE to join this multicast group.\r
+                     Set to FALSE to leave this multicast group.\r
+  @param  MacAddress Pointer to the multicast MAC group (address) to join or leave.\r
+\r
+  @retval EFI_SUCCESS           The requested operation completed successfully.\r
+  @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:\r
+                                - This is NULL.\r
+                                - JoinFlag is TRUE and MacAddress is NULL.\r
+                                - *MacAddress is not a valid multicast MAC address.\r
+  @retval EFI_NOT_STARTED       This MNP child driver instance has not been configured.\r
+  @retval EFI_ALREADY_STARTED   The supplied multicast group is already joined.\r
+  @retval EFI_NOT_FOUND         The supplied multicast group is not joined.\r
+  @retval EFI_DEVICE_ERROR      An unexpected network or system error occurred.  \r
+  @retval EFI_UNSUPPORTED       The requested feature is unsupported in this MNP implementation.\r
+  @retval Other                 The requested operation could not be completed.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_MANAGED_NETWORK_GROUPS) (\r
+  IN EFI_MANAGED_NETWORK_PROTOCOL  *This,\r
+  IN BOOLEAN                       JoinFlag,\r
+  IN EFI_MAC_ADDRESS               *MacAddress  OPTIONAL \r
+  )\r
+;      \r
+  \r
+/**\r
+  Places asynchronous outgoing data packets into the transmit queue.\r
+\r
+  @param  This  Pointer to the EFI_MANAGED_NETWORK_PROTOCOL instance.\r
+  @param  Token Pointer to a token associated with the transmit data descriptor.\r
+\r
+  @retval EFI_SUCCESS           The transmit completion token was cached.\r
+  @retval EFI_NOT_STARTED       This MNP child driver instance has not been configured.\r
+  @retval EFI_INVALID_PARAMETER One or more parameters are invalid.\r
+  @retval EFI_ACCESS_DENIED     The transmit completion token is already in the transmit queue.\r
+  @retval EFI_OUT_OF_RESOURCES  The transmit data could not be queued due to a lack of system resources\r
+                                (usually memory).\r
+  @retval EFI_DEVICE_ERROR      An unexpected system or network error occurred.\r
+  @retval EFI_NOT_READY         The transmit request could not be queued because the transmit queue is full.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_MANAGED_NETWORK_TRANSMIT) (\r
+  IN EFI_MANAGED_NETWORK_PROTOCOL          *This,\r
+  IN EFI_MANAGED_NETWORK_COMPLETION_TOKEN  *Token \r
+  )\r
+;      \r
+    \r
+/**\r
+  Places an asynchronous receiving request into the receiving queue.\r
+\r
+  @param  This  Pointer to the EFI_MANAGED_NETWORK_PROTOCOL instance.\r
+  @param  Token Pointer to a token associated with the receive data descriptor.\r
+\r
+  @retval EFI_SUCCESS           The receive completion token was cached.\r
+  @retval EFI_NOT_STARTED       This MNP child driver instance has not been configured.\r
+  @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:\r
+                                - This is NULL.\r
+                                - Token is NULL.\r
+                                - Token.Event is NULL\r
+  @retval EFI_OUT_OF_RESOURCES  The transmit data could not be queued due to a lack of system resources\r
+                                (usually memory).\r
+  @retval EFI_DEVICE_ERROR      An unexpected system or network error occurred.\r
+  @retval EFI_ACCESS_DENIED     The receive completion token was already in the receive queue.\r
+  @retval EFI_NOT_READY         The receive request could not be queued because the receive queue is full.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_MANAGED_NETWORK_RECEIVE) (\r
+  IN EFI_MANAGED_NETWORK_PROTOCOL          *This,\r
+  IN EFI_MANAGED_NETWORK_COMPLETION_TOKEN  *Token \r
+  )\r
+;      \r
+   \r
+\r
+/**\r
+  Aborts an asynchronous transmit or receive request.\r
+\r
+  @param  This  Pointer to the EFI_MANAGED_NETWORK_PROTOCOL instance.\r
+  @param  Token Pointer to a token that has been issued by\r
+                EFI_MANAGED_NETWORK_PROTOCOL.Transmit() or\r
+                EFI_MANAGED_NETWORK_PROTOCOL.Receive(). If\r
+                NULL, all pending tokens are aborted.\r
+\r
+  @retval  EFI_SUCCESS           The asynchronous I/O request was aborted and Token.Event\r
+                                 was signaled. When Token is NULL, all pending requests were\r
+                                 aborted and their events were signaled.\r
+  @retval  EFI_NOT_STARTED       This MNP child driver instance has not been configured.\r
+  @retval  EFI_INVALID_PARAMETER This is NULL.\r
+  @retval  EFI_NOT_FOUND         When Token is not NULL, the asynchronous I/O request was\r
+                                 not found in the transmit or receive queue. It has either completed\r
+                                 or was not issued by Transmit() and Receive().\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_MANAGED_NETWORK_CANCEL) (\r
+  IN EFI_MANAGED_NETWORK_PROTOCOL          *This,\r
+  IN EFI_MANAGED_NETWORK_COMPLETION_TOKEN  *Token  OPTIONAL \r
+  )\r
+;   \r
+\r
+/**\r
+  Polls for incoming data packets and processes outgoing data packets.\r
+\r
+  @param  This Pointer to the EFI_MANAGED_NETWORK_PROTOCOL instance.\r
+\r
+  @retval EFI_SUCCESS      Incoming or outgoing data was processed.\r
+  @retval EFI_NOT_STARTED  This MNP child driver instance has not been configured.\r
+  @retval EFI_DEVICE_ERROR An unexpected system or network error occurred.\r
+  @retval EFI_NOT_READY    No incoming or outgoing data was processed. Consider increasing\r
+                           the polling rate.\r
+  @retval EFI_TIMEOUT      Data was dropped out of the transmit and/or receive queue.\r
+                            Consider increasing the polling rate.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_MANAGED_NETWORK_POLL) (\r
+  IN EFI_MANAGED_NETWORK_PROTOCOL    *This \r
+  )\r
+;     \r
+\r
+struct _EFI_MANAGED_NETWORK_PROTOCOL {\r
+  EFI_MANAGED_NETWORK_GET_MODE_DATA       GetModeData;\r
+  EFI_MANAGED_NETWORK_CONFIGURE           Configure;\r
+  EFI_MANAGED_NETWORK_MCAST_IP_TO_MAC     McastIpToMac;\r
+  EFI_MANAGED_NETWORK_GROUPS              Groups;\r
+  EFI_MANAGED_NETWORK_TRANSMIT            Transmit;\r
+  EFI_MANAGED_NETWORK_RECEIVE             Receive;\r
+  EFI_MANAGED_NETWORK_CANCEL              Cancel;\r
+  EFI_MANAGED_NETWORK_POLL                Poll;\r
+};\r
+\r
+extern EFI_GUID gEfiManagedNetworkServiceBindingProtocolGuid;\r
+extern EFI_GUID gEfiManagedNetworkProtocolGuid;\r
+\r
+#endif\r
diff --git a/Tools/Source/TianoTools/Include/Protocol/Mtftp4.h b/Tools/Source/TianoTools/Include/Protocol/Mtftp4.h
new file mode 100644 (file)
index 0000000..840e04b
--- /dev/null
@@ -0,0 +1,508 @@
+/** @file\r
+  EFI Multicast Trivial File Tranfer Protocol Definition\r
+\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. This program and the accompanying materials                          \r
+  are licensed and made available under the terms and conditions of the BSD License         \r
+  which accompanies this distribution.  The full text of the license may be found at        \r
+  http://opensource.org/licenses/bsd-license.php                                            \r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+  Module Name:  Mtftp4.h\r
+\r
+**/\r
+\r
+#ifndef __EFI_MTFTP4_PROTOCOL_H__\r
+#define __EFI_MTFTP4_PROTOCOL_H__\r
+\r
+#define EFI_MTFTP4_SERVICE_BINDING_PROTOCOL_GUID \\r
+  { \\r
+    0x2FE800BE, 0x8F01, 0x4aa6, {0x94, 0x6B, 0xD7, 0x13, 0x88, 0xE1, 0x83, 0x3F } \\r
+  }\r
+\r
+#define EFI_MTFTP4_PROTOCOL_GUID \\r
+  { \\r
+    0x3ad9df29, 0x4501, 0x478d, {0xb1, 0xf8, 0x7f, 0x7f, 0xe7, 0x0e, 0x50, 0xf3 } \\r
+  }\r
+\r
+typedef struct _EFI_MTFTP4_PROTOCOL EFI_MTFTP4_PROTOCOL;\r
+typedef struct _EFI_MTFTP4_TOKEN EFI_MTFTP4_TOKEN;\r
+\r
+//\r
+//MTFTP4 packet opcode definition\r
+//\r
+#define EFI_MTFTP4_OPCODE_RRQ                     1\r
+#define EFI_MTFTP4_OPCODE_WRQ                     2\r
+#define EFI_MTFTP4_OPCODE_DATA                    3\r
+#define EFI_MTFTP4_OPCODE_ACK                     4\r
+#define EFI_MTFTP4_OPCODE_ERROR                   5\r
+#define EFI_MTFTP4_OPCODE_OACK                    6\r
+#define EFI_MTFTP4_OPCODE_DIR                     7\r
+#define EFI_MTFTP4_OPCODE_DATA8                   8\r
+#define EFI_MTFTP4_OPCODE_ACK8                    9\r
+\r
+//\r
+// MTFTP4 error code definition\r
+//\r
+#define EFI_MTFTP4_ERRORCODE_NOT_DEFINED          0\r
+#define EFI_MTFTP4_ERRORCODE_FILE_NOT_FOUND       1\r
+#define EFI_MTFTP4_ERRORCODE_ACCESS_VIOLATION     2\r
+#define EFI_MTFTP4_ERRORCODE_DISK_FULL            3\r
+#define EFI_MTFTP4_ERRORCODE_ILLEGAL_OPERATION    4\r
+#define EFI_MTFTP4_ERRORCODE_UNKNOWN_TRANSFER_ID  5\r
+#define EFI_MTFTP4_ERRORCODE_FILE_ALREADY_EXISTS  6\r
+#define EFI_MTFTP4_ERRORCODE_NO_SUCH_USER         7\r
+#define EFI_MTFTP4_ERRORCODE_REQUEST_DENIED       8\r
+\r
+//\r
+// MTFTP4 pacekt definitions\r
+//\r
+#pragma pack(1)\r
+\r
+typedef struct {\r
+  UINT16                  OpCode;\r
+  UINT8                   Filename[1];\r
+} EFI_MTFTP4_REQ_HEADER;\r
+\r
+typedef struct {\r
+  UINT16                  OpCode;\r
+  UINT8                   Data[1];\r
+} EFI_MTFTP4_OACK_HEADER;\r
+\r
+typedef struct {\r
+  UINT16                  OpCode;\r
+  UINT16                  Block;\r
+  UINT8                   Data[1];\r
+} EFI_MTFTP4_DATA_HEADER;\r
+\r
+typedef struct {\r
+  UINT16                  OpCode;\r
+  UINT16                  Block[1];\r
+} EFI_MTFTP4_ACK_HEADER;\r
+\r
+typedef struct {\r
+  UINT16                  OpCode;\r
+  UINT64                  Block;\r
+  UINT8                   Data[1];\r
+} EFI_MTFTP4_DATA8_HEADER;\r
+\r
+typedef struct {\r
+  UINT16                  OpCode;\r
+  UINT64                  Block[1];\r
+} EFI_MTFTP4_ACK8_HEADER;\r
+\r
+typedef struct {\r
+  UINT16                  OpCode;\r
+  UINT16                  ErrorCode;\r
+  UINT8                   ErrorMessage[1];\r
+} EFI_MTFTP4_ERROR_HEADER;\r
+\r
+typedef union {\r
+  UINT16                  OpCode;\r
+  EFI_MTFTP4_REQ_HEADER   Rrq;\r
+  EFI_MTFTP4_REQ_HEADER   Wrq;\r
+  EFI_MTFTP4_OACK_HEADER  Oack;\r
+  EFI_MTFTP4_DATA_HEADER  Data;\r
+  EFI_MTFTP4_ACK_HEADER   Ack;\r
+  EFI_MTFTP4_DATA8_HEADER Data8;\r
+  EFI_MTFTP4_ACK8_HEADER  Ack8;\r
+  EFI_MTFTP4_ERROR_HEADER Error;\r
+} EFI_MTFTP4_PACKET;\r
+\r
+#pragma pack()\r
+\r
+//\r
+// MTFTP4 option definition\r
+//\r
+typedef struct {\r
+  UINT8                   *OptionStr;\r
+  UINT8                   *ValueStr;\r
+} EFI_MTFTP4_OPTION;\r
+\r
+\r
+typedef struct {\r
+  BOOLEAN                 UseDefaultSetting;\r
+  EFI_IPv4_ADDRESS        StationIp;\r
+  EFI_IPv4_ADDRESS        SubnetMask;\r
+  UINT16                  LocalPort;\r
+  EFI_IPv4_ADDRESS        GatewayIp;\r
+  EFI_IPv4_ADDRESS        ServerIp;\r
+  UINT16                  InitialServerPort;\r
+  UINT16                  TryCount;\r
+  UINT16                  TimeoutValue;\r
+} EFI_MTFTP4_CONFIG_DATA;\r
+\r
+\r
+typedef struct {\r
+  EFI_MTFTP4_CONFIG_DATA  ConfigData;\r
+  UINT8                   SupportedOptionCount;  \r
+  UINT8                   **SupportedOptoins;\r
+  UINT8                   UnsupportedOptionCount;  \r
+  UINT8                   **UnsupportedOptoins;\r
+} EFI_MTFTP4_MODE_DATA;\r
+\r
+\r
+typedef struct {\r
+  EFI_IPv4_ADDRESS        GatewayIp;\r
+  EFI_IPv4_ADDRESS        ServerIp;\r
+  UINT16                  ServerPort;\r
+  UINT16                  TryCount;\r
+  UINT16                  TimeoutValue;\r
+} EFI_MTFTP4_OVERRIDE_DATA;\r
+\r
+//\r
+// Protocol interfaces definition\r
+//\r
+\r
+/**\r
+  a callback function that is provided by the caller to intercept               \r
+  the EFI_MTFTP4_OPCODE_DATA or EFI_MTFTP4_OPCODE_DATA8 packets processed in the\r
+  EFI_MTFTP4_PROTOCOL.ReadFile() function, and alternatively to intercept       \r
+  EFI_MTFTP4_OPCODE_OACK or EFI_MTFTP4_OPCODE_ERROR packets during a call to    \r
+  EFI_MTFTP4_PROTOCOL.ReadFile(), WriteFile() or ReadDirectory().                   \r
+\r
+  @param  This        Pointer to the EFI_MTFTP4_PROTOCOL instance.\r
+  @param  Token       The token that the caller provided in the\r
+                      EFI_MTFTP4_PROTOCOL.ReadFile(), WriteFile()\r
+                      or ReadDirectory() function.\r
+  @param  PacketLen   Indicates the length of the packet.\r
+  @param  Packet      Pointer to an MTFTPv4 packet.\r
+\r
+  @retval EFI_SUCCESS Operation sucess\r
+  @retval Others      Abort transfer process\r
+\r
+**/\r
+typedef \r
+EFI_STATUS \r
+(EFIAPI *EFI_MTFTP4_CHECK_PACKET)( \r
+  IN EFI_MTFTP4_PROTOCOL  *This,\r
+  IN EFI_MTFTP4_TOKEN     *Token,\r
+  IN UINT16               PacketLen,\r
+  IN EFI_MTFTP4_PACKET    *Paket\r
+  )\r
+;\r
+\r
+/**\r
+  Timeout callback funtion.            \r
+\r
+  @param  This           Pointer to the EFI_MTFTP4_PROTOCOL instance.\r
+  @param  Token          The token that is provided in the\r
+                         EFI_MTFTP4_PROTOCOL.ReadFile() or\r
+                         EFI_MTFTP4_PROTOCOL.WriteFile() or\r
+                         EFI_MTFTP4_PROTOCOL.ReadDirectory() functions\r
+                         by the caller.\r
+                         \r
+  @retval EFI_SUCCESS   Operation sucess\r
+  @retval Others        Aborts download process.\r
+\r
+**/\r
+typedef \r
+EFI_STATUS \r
+(EFIAPI *EFI_MTFTP4_TIMEOUT_CALLBACK)( \r
+  IN EFI_MTFTP4_PROTOCOL  *This,\r
+  IN EFI_MTFTP4_TOKEN     *Token\r
+  )\r
+;\r
+\r
+/**\r
+  a callback function that the caller provides to feed data to the\r
+  EFI_MTFTP4_PROTOCOL.WriteFile() function.\r
+\r
+  @param  This   Pointer to the EFI_MTFTP4_PROTOCOL instance.\r
+  @param  Token  The token provided in the\r
+                 EFI_MTFTP4_PROTOCOL.WriteFile() by the caller.\r
+  @param  Length Indicates the length of the raw data wanted on input, and the\r
+                 length the data available on output.\r
+  @param  Buffer Pointer to the buffer where the data is stored.\r
+\r
+  @retval EFI_SUCCESS Operation sucess\r
+  @retval Others      Aborts session.\r
+\r
+**/\r
+typedef \r
+EFI_STATUS \r
+(EFIAPI *EFI_MTFTP4_PACKET_NEEDED)( \r
+  IN  EFI_MTFTP4_PROTOCOL *This,\r
+  IN  EFI_MTFTP4_TOKEN    *Token,\r
+  IN  OUT UINT16          *Length,\r
+  OUT VOID                **Buffer\r
+  )\r
+;\r
+\r
+\r
+/**\r
+  Submits an asynchronous interrupt transfer to an interrupt endpoint of a USB device.\r
+\r
+  @param  This     Pointer to the EFI_MTFTP4_PROTOCOL instance.\r
+  @param  ModeData Pointer to storage for the EFI MTFTPv4 Protocol driver mode data.\r
+\r
+  @retval EFI_SUCCESS           The configuration data was successfully returned.\r
+  @retval EFI_OUT_OF_RESOURCES  The required mode data could not be allocated.\r
+  @retval EFI_INVALID_PARAMETER This is NULL or ModeData is NULL.\r
+\r
+**/\r
+typedef \r
+EFI_STATUS \r
+(EFIAPI *EFI_MTFTP4_GET_MODE_DATA)(\r
+  IN  EFI_MTFTP4_PROTOCOL     *This,\r
+  OUT EFI_MTFTP4_MODE_DATA    *ModeData\r
+  )\r
+;\r
+\r
+\r
+/**\r
+  Initializes, changes, or resets the default operational setting for this \r
+  EFI MTFTPv4 Protocol driver instance.\r
+\r
+  @param  This            Pointer to the EFI_MTFTP4_PROTOCOL instance.\r
+  @param  MtftpConfigData Pointer to the configuration data structure.\r
+\r
+  @retval EFI_SUCCESS           The EFI MTFTPv4 Protocol driver was configured successfully.\r
+  @retval EFI_INVALID_PARAMETER One or more parameters are invalid.\r
+  @retval EFI_ACCESS_DENIED     The EFI configuration could not be changed at this time because\r
+                                there is one MTFTP background operation in progress.\r
+  @retval EFI_NO_MAPPING        When using a default address, configuration (DHCP, BOOTP,\r
+                                RARP, etc.) has not finished yet.\r
+  @retval EFI_UNSUPPORTED       A configuration protocol (DHCP, BOOTP, RARP, etc.) could not\r
+                                be located when clients choose to use the default address\r
+                                settings.\r
+  @retval EFI_OUT_OF_RESOURCES  The EFI MTFTPv4 Protocol driver instance data could not be\r
+                                allocated.\r
+  @retval EFI_DEVICE_ERROR      An unexpected system or network error occurred. The EFI\r
+                                 MTFTPv4 Protocol driver instance is not configured.\r
+\r
+**/\r
+typedef \r
+EFI_STATUS \r
+(EFIAPI *EFI_MTFTP4_CONFIGURE)(\r
+  IN EFI_MTFTP4_PROTOCOL       *This,\r
+  IN EFI_MTFTP4_CONFIG_DATA    *MtftpConfigData OPTIONAL\r
+  )\r
+;   \r
+    \r
+    \r
+/**\r
+  Gets information about a file from an MTFTPv4 server.\r
+\r
+  @param  This         Pointer to the EFI_MTFTP4_PROTOCOL instance.\r
+  @param  OverrideData Data that is used to override the existing parameters. If NULL,\r
+                       the default parameters that were set in the\r
+                       EFI_MTFTP4_PROTOCOL.Configure() function are used.\r
+  @param  Filename     Pointer to ASCIIZ file name string.\r
+  @param  ModeStr      Pointer to ASCIIZ mode string. If NULL, Â¡Â°octet¡± will be used.\r
+  @param  OptionCount  Number of option/value string pairs in OptionList.\r
+  @param  OptionList   Pointer to array of option/value string pairs. Ignored if\r
+                       OptionCount is zero.\r
+  @param  PacketLength The number of bytes in the returned packet.\r
+  @param  Packet       The pointer to the received packet. This buffer must be freed by\r
+                       the caller.\r
+\r
+  @retval EFI_SUCCESS           An MTFTPv4 OACK packet was received and is in the Buffer.\r
+  @retval EFI_INVALID_PARAMETER One or more parameters are invalid.\r
+  @retval EFI_UNSUPPORTED       One or more options in the OptionList are in the\r
+                                unsupported list of structure EFI_MTFTP4_MODE_DATA.\r
+  \r
+  @retval EFI_NOT_STARTED       The EFI MTFTPv4 Protocol driver has not been started.\r
+  @retval EFI_NO_MAPPING        When using a default address, configuration (DHCP, BOOTP,\r
+                                RARP, etc.) has not finished yet.\r
+  @retval EFI_ACCESS_DENIED     The previous operation has not completed yet.\r
+  @retval EFI_OUT_OF_RESOURCES  Required system resources could not be allocated.\r
+  @retval EFI_TFTP_ERROR        An MTFTPv4 ERROR packet was received and is in the buffer.\r
+  @retval EFI_ICMP_ERROR        An ICMP ERROR packet was received and is in the Buffer.\r
+  @retval EFI_PROTOCOL_ERROR    An unexpected MTFTPv4 packet was received and is in the buffer.\r
+  @retval EFI_TIMEOUT           No responses were received from the MTFTPv4 server.\r
+  @retval EFI_DEVICE_ERROR      An unexpected network error or system error occurred.\r
+\r
+**/\r
+typedef \r
+EFI_STATUS \r
+(EFIAPI *EFI_MTFTP4_GET_INFO)(\r
+  IN  EFI_MTFTP4_PROTOCOL      *This,\r
+  IN  EFI_MTFTP4_OVERRIDE_DATA *OverrideData   OPTIONAL,\r
+  IN  UINT8                    *Filename,\r
+  IN  UINT8                    *ModeStr        OPTIONAL,\r
+  IN  UINT8                    OptionCount,\r
+  IN  EFI_MTFTP4_OPTION        *OptionList,\r
+  OUT UINT32                   *PacketLength,\r
+  OUT EFI_MTFTP4_PACKET        **Packet        OPTIONAL\r
+  )\r
+;\r
+\r
+/**\r
+  Parses the options in an MTFTPv4 OACK packet.\r
+\r
+  @param  This         Pointer to the EFI_MTFTP4_PROTOCOL instance.\r
+  @param  PacketLen    Length of the OACK packet to be parsed.\r
+  @param  Packet       Pointer to the OACK packet to be parsed.\r
+  @param  OptionCount  Pointer to the number of options in following OptionList.\r
+  @param  OptionList   Pointer to EFI_MTFTP4_OPTION storage. Call the EFI Boot\r
+                       Service FreePool() to release each option if they are not\r
+                       needed any more.\r
+\r
+  @retval EFI_SUCCESS           The OACK packet was valid and the OptionCount and\r
+                                OptionList parameters have been updated.\r
+  @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:\r
+                                - PacketLen is 0.\r
+                                - Packet is NULL or Packet is not a valid MTFTPv4 packet.\r
+                                - OptionCount is NULL.\r
+  @retval EFI_NOT_FOUND         No options were found in the OACK packet.\r
+  @retval EFI_OUT_OF_RESOURCES  Storage for the OptionList array cannot be allocated.\r
+  @retval EFI_PROTOCOL_ERROR    One or more of the option fields is invalid.\r
+\r
+**/\r
+typedef \r
+EFI_STATUS \r
+(EFIAPI *EFI_MTFTP4_PARSE_OPTIONS)(\r
+  IN  EFI_MTFTP4_PROTOCOL      *This,\r
+  IN  UINT32                   PacketLen,\r
+  IN  EFI_MTFTP4_PACKET        *Packet,\r
+  OUT UINT32                   *OptionCount,\r
+  OUT EFI_MTFTP4_OPTION        **OptionList OPTIONAL\r
+  )\r
+;  \r
+\r
+\r
+/**\r
+  Downloads a file from an MTFTPv4 server.\r
+\r
+  @param  This  Pointer to the EFI_MTFTP4_PROTOCOL instance.\r
+  @param  Token Pointer to the token structure to provide the parameters that are\r
+                used in this operation.\r
+\r
+  @retval EFI_SUCCESS          The data file has been transferred successfully.\r
+  @retval EFI_OUT_OF_RESOURCES Required system resources could not be allocated.\r
+  @retval EFI_BUFFER_TOO_SMALL BufferSize is not large enough to hold the downloaded data\r
+                               in downloading process.\r
+  @retval EFI_ABORTED          Current operation is aborted by user.\r
+  @retval EFI_ICMP_ERROR       An ICMP ERROR packet was received.\r
+  @retval EFI_TIMEOUT          No responses were received from the MTFTPv4 server.\r
+  @retval EFI_TFTP_ERROR       An MTFTPv4 ERROR packet was received.\r
+  @retval EFI_DEVICE_ERROR     An unexpected network error or system error occurred.\r
+\r
+**/\r
+typedef \r
+EFI_STATUS \r
+(EFIAPI *EFI_MTFTP4_READ_FILE)(\r
+  IN EFI_MTFTP4_PROTOCOL       *This,\r
+  IN EFI_MTFTP4_TOKEN          *Token\r
+  )\r
+;  \r
+  \r
+\r
+\r
+/**\r
+  Sends a file to an MTFTPv4 server.\r
+\r
+  @param  This Pointer to the EFI_MTFTP4_PROTOCOL instance.\r
+  @param  Token Pointer to the token structure to provide the parameters that are\r
+  used in this operation.\r
+\r
+  @retval EFI_SUCCESS           The upload session has started.\r
+  @retval EFI_UNSUPPORTED       The operation is not supported by this implementation.\r
+  @retval EFI_INVALID_PARAMETER One or more parameters are invalid.\r
+  @retval EFI_UNSUPPORTED       One or more options in the Token.OptionList are in\r
+                                the unsupported list of structure EFI_MTFTP4_MODE_DATA.\r
+  @retval EFI_NOT_STARTED       The EFI MTFTPv4 Protocol driver has not been started.\r
+  @retval EFI_NO_MAPPING        When using a default address, configuration (DHCP, BOOTP,\r
+                                RARP, etc.) is not finished yet.\r
+  @retval EFI_ALREADY_STARTED   This Token is already being used in another MTFTPv4 session.\r
+  @retval EFI_OUT_OF_RESOURCES  Required system resources could not be allocated.\r
+  @retval EFI_ACCESS_DENIED     The previous operation has not completed yet.\r
+  @retval EFI_DEVICE_ERROR      An unexpected network error or system error occurred.\r
+\r
+**/\r
+typedef \r
+EFI_STATUS \r
+(EFIAPI *EFI_MTFTP4_WRITE_FILE)(\r
+  IN EFI_MTFTP4_PROTOCOL       *This,\r
+  IN EFI_MTFTP4_TOKEN          *Token\r
+  )\r
+;  \r
+  \r
+\r
+/**\r
+  Downloads a data file Â¡Â°directory¡± from an MTFTPv4 server. May be unsupported in some EFI\r
+  implementations.                                                                                                                                                                                 \r
+\r
+  @param  This  Pointer to the EFI_MTFTP4_PROTOCOL instance.\r
+  @param  Token Pointer to the token structure to provide the parameters that are\r
+                used in this operation.\r
+\r
+  @retval EFI_SUCCESS           The MTFTPv4 related file "directory" has been downloaded.\r
+  @retval EFI_UNSUPPORTED       The operation is not supported by this implementation.\r
+  @retval EFI_INVALID_PARAMETER One or more parameters are invalid.\r
+  @retval EFI_UNSUPPORTED       One or more options in the Token.OptionList are in\r
+                                the unsupported list of structure EFI_MTFTP4_MODE_DATA.\r
+  @retval EFI_NOT_STARTED       The EFI MTFTPv4 Protocol driver has not been started.\r
+  @retval EFI_NO_MAPPING        When using a default address, configuration (DHCP, BOOTP,\r
+                                RARP, etc.) is not finished yet.\r
+  @retval EFI_ALREADY_STARTED   This Token is already being used in another MTFTPv4 session.\r
+  @retval EFI_OUT_OF_RESOURCES  Required system resources could not be allocated.\r
+  @retval EFI_ACCESS_DENIED     The previous operation has not completed yet.\r
+  @retval EFI_DEVICE_ERROR      An unexpected network error or system error occurred.\r
+\r
+**/\r
+typedef \r
+EFI_STATUS \r
+(EFIAPI *EFI_MTFTP4_READ_DIRECTORY)(\r
+  IN EFI_MTFTP4_PROTOCOL       *This,\r
+  IN EFI_MTFTP4_TOKEN          *Token\r
+  )\r
+;    \r
+\r
+/**\r
+  Polls for incoming data packets and processes outgoing data packets.\r
+\r
+  @param  This Pointer to the EFI_MTFTP4_PROTOCOL instance.\r
+\r
+  @retval  EFI_SUCCESS           Incoming or outgoing data was processed.\r
+  @retval  EFI_NOT_STARTED       This EFI MTFTPv4 Protocol instance has not been started.\r
+  @retval  EFI_NO_MAPPING        When using a default address, configuration (DHCP, BOOTP,\r
+                                 RARP, etc.) is not finished yet.\r
+  @retval  EFI_INVALID_PARAMETER This is NULL.\r
+  @retval  EFI_DEVICE_ERROR      An unexpected system or network error occurred.\r
+  @retval  EFI_TIMEOUT           Data was dropped out of the transmit and/or receive queue.\r
+                                 Consider increasing the polling rate.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_MTFTP4_POLL) (\r
+  IN EFI_MTFTP4_PROTOCOL       *This\r
+  )\r
+;                                                                                                                 \r
+                                                                                                                  \r
+  \r
+struct _EFI_MTFTP4_PROTOCOL {\r
+  EFI_MTFTP4_GET_MODE_DATA     GetModeData;\r
+  EFI_MTFTP4_CONFIGURE         Configure;\r
+  EFI_MTFTP4_GET_INFO          GetInfo;\r
+  EFI_MTFTP4_PARSE_OPTIONS     ParseOptions;\r
+  EFI_MTFTP4_READ_FILE         ReadFile;\r
+  EFI_MTFTP4_WRITE_FILE        WriteFile;\r
+  EFI_MTFTP4_READ_DIRECTORY    ReadDirectory;\r
+  EFI_MTFTP4_POLL              Poll;\r
+};\r
+\r
+struct _EFI_MTFTP4_TOKEN {\r
+  OUT EFI_STATUS                  Status;\r
+  IN  EFI_EVENT                   Event;\r
+  IN  EFI_MTFTP4_OVERRIDE_DATA    *OverrideData;\r
+  IN  UINT8                       *Filename;\r
+  IN  UINT8                       *ModeStr;\r
+  IN  UINT32                      OptionCount;\r
+  IN  EFI_MTFTP4_OPTION           *OptionList;\r
+  IN  OUT UINT64                  BufferSize;\r
+  IN  OUT VOID                    *Buffer;\r
+  IN  EFI_MTFTP4_CHECK_PACKET     CheckPacket;\r
+  IN  EFI_MTFTP4_TIMEOUT_CALLBACK TimeoutCallback;\r
+  IN  EFI_MTFTP4_PACKET_NEEDED    PacketNeeded;\r
+};\r
+\r
+extern EFI_GUID gEfiMtftp4ServiceBindingProtocolGuid;\r
+extern EFI_GUID gEfiMtftp4ProtocolGuid;  \r
+\r
+#endif\r
+\r
diff --git a/Tools/Source/TianoTools/Include/Protocol/Pcd.h b/Tools/Source/TianoTools/Include/Protocol/Pcd.h
new file mode 100644 (file)
index 0000000..323c16c
--- /dev/null
@@ -0,0 +1,297 @@
+/** @file\r
+  Platform Configuration Database (PCD) Protocol\r
+\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. This program and the accompanying materials                          \r
+  are licensed and made available under the terms and conditions of the BSD License         \r
+  which accompanies this distribution.  The full text of the license may be found at        \r
+  http://opensource.org/licenses/bsd-license.php                                            \r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+  Module Name:  Pcd.h\r
+\r
+**/\r
+\r
+#ifndef __PCD_H__\r
+#define __PCD_H__\r
+\r
+extern EFI_GUID gPcdProtocolGuid;\r
+\r
+#define PCD_PROTOCOL_GUID \\r
+  { 0x11b34006, 0xd85b, 0x4d0a, { 0xa2, 0x90, 0xd5, 0xa5, 0x71, 0x31, 0xe, 0xf7 } }\r
+\r
+#define PCD_INVALID_TOKEN_NUMBER ((UINTN) -1)\r
+\r
+typedef \r
+VOID\r
+(EFIAPI *PCD_PROTOCOL_SET_SKU) (\r
+  IN  UINTN                  SkuId\r
+  );\r
+\r
+typedef\r
+UINT8\r
+(EFIAPI *PCD_PROTOCOL_GET8) (\r
+  IN UINTN             TokenNumber\r
+  );\r
+\r
+typedef\r
+UINT16\r
+(EFIAPI *PCD_PROTOCOL_GET16) (\r
+  IN UINTN             TokenNumber\r
+  );\r
+\r
+typedef\r
+UINT32\r
+(EFIAPI *PCD_PROTOCOL_GET32) (\r
+  IN UINTN             TokenNumber\r
+  );\r
+\r
+typedef\r
+UINT64\r
+(EFIAPI *PCD_PROTOCOL_GET64) (\r
+  IN UINTN             TokenNumber\r
+  );\r
+\r
+typedef\r
+VOID *\r
+(EFIAPI *PCD_PROTOCOL_GET_POINTER) (\r
+  IN UINTN             TokenNumber\r
+  );\r
+\r
+typedef\r
+BOOLEAN\r
+(EFIAPI *PCD_PROTOCOL_GET_BOOLEAN) (\r
+  IN UINTN             TokenNumber\r
+  );\r
+\r
+typedef\r
+UINTN\r
+(EFIAPI *PCD_PROTOCOL_GET_SIZE) (\r
+  IN UINTN             TokenNumber\r
+  );\r
+\r
+typedef\r
+UINT8\r
+(EFIAPI *PCD_PROTOCOL_GET_EX_8) (\r
+  IN CONST EFI_GUID    *Guid,\r
+  IN UINTN             TokenNumber\r
+  );\r
+\r
+typedef\r
+UINT16\r
+(EFIAPI *PCD_PROTOCOL_GET_EX_16) (\r
+  IN CONST EFI_GUID    *Guid,\r
+  IN UINTN             TokenNumber\r
+  );\r
+\r
+typedef\r
+UINT32\r
+(EFIAPI *PCD_PROTOCOL_GET_EX_32) (\r
+  IN CONST EFI_GUID    *Guid,\r
+  IN UINTN             TokenNumber\r
+  );\r
+\r
+typedef\r
+UINT64\r
+(EFIAPI *PCD_PROTOCOL_GET_EX_64) (\r
+  IN CONST EFI_GUID    *Guid,\r
+  IN UINTN             TokenNumber\r
+  );\r
+\r
+typedef\r
+VOID *\r
+(EFIAPI *PCD_PROTOCOL_GET_EX_POINTER) (\r
+  IN CONST EFI_GUID    *Guid,\r
+  IN UINTN             TokenNumber\r
+  );\r
+\r
+typedef\r
+BOOLEAN\r
+(EFIAPI *PCD_PROTOCOL_GET_EX_BOOLEAN) (\r
+  IN CONST EFI_GUID    *Guid,\r
+  IN UINTN             TokenNumber\r
+  );\r
+\r
+typedef\r
+UINTN\r
+(EFIAPI *PCD_PROTOCOL_GET_EX_SIZE) (\r
+  IN CONST EFI_GUID    *Guid,\r
+  IN UINTN             TokenNumber\r
+  );\r
+\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *PCD_PROTOCOL_SET8) (\r
+  IN UINTN             TokenNumber,\r
+  IN UINT8             Value\r
+  );\r
+\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *PCD_PROTOCOL_SET16) (\r
+  IN UINTN              TokenNumber,\r
+  IN UINT16             Value\r
+  );\r
+\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *PCD_PROTOCOL_SET32) (\r
+  IN UINTN              TokenNumber,\r
+  IN UINT32             Value\r
+  );\r
+\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *PCD_PROTOCOL_SET64) (\r
+  IN UINTN             TokenNumber,\r
+  IN UINT64            Value\r
+  );\r
+\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *PCD_PROTOCOL_SET_POINTER) (\r
+  IN UINTN             TokenNumber,\r
+  IN UINTN             SizeOfBuffer,\r
+  IN VOID              *Buffer\r
+  );\r
+\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *PCD_PROTOCOL_SET_BOOLEAN) (\r
+  IN UINTN             TokenNumber,\r
+  IN BOOLEAN           Value\r
+  );\r
+\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *PCD_PROTOCOL_SET_EX_8) (\r
+  IN CONST EFI_GUID    *Guid,\r
+  IN UINTN             TokenNumber,\r
+  IN UINT8             Value\r
+  );\r
+\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *PCD_PROTOCOL_SET_EX_16) (\r
+  IN CONST EFI_GUID    *Guid,\r
+  IN UINTN             TokenNumber,\r
+  IN UINT16            Value\r
+  );\r
+\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *PCD_PROTOCOL_SET_EX_32) (\r
+  IN CONST EFI_GUID     *Guid,\r
+  IN UINTN              TokenNumber,\r
+  IN UINT32             Value\r
+  );\r
+\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *PCD_PROTOCOL_SET_EX_64) (\r
+  IN CONST EFI_GUID    *Guid,\r
+  IN UINTN             TokenNumber,\r
+  IN UINT64            Value\r
+  );\r
+\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *PCD_PROTOCOL_SET_EX_POINTER) (\r
+  IN CONST EFI_GUID    *Guid,\r
+  IN UINTN             TokenNumber,\r
+  IN UINTN             SizeOfBuffer,\r
+  IN VOID              *Buffer\r
+  );\r
+\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *PCD_PROTOCOL_SET_EX_BOOLEAN) (\r
+  IN CONST EFI_GUID    *Guid,\r
+  IN UINTN             TokenNumber,\r
+  IN BOOLEAN           Value\r
+  );\r
+  \r
+/**\r
+  Callback on SET function prototype definition.\r
+\r
+  @param[in]  CallBackGuid The PCD token GUID being set.\r
+  @param[in]  CallBackToken The PCD token number being set.\r
+  @param[in]  TokenData A pointer to the token data being set.\r
+  @param[in]  TokenDataSize The size, in bytes, of the data being set.\r
+\r
+  @retval VOID\r
+\r
+--*/\r
+typedef\r
+VOID\r
+(EFIAPI *PCD_PROTOCOL_CALLBACK) (\r
+  IN      CONST EFI_GUID   *CallBackGuid, OPTIONAL\r
+  IN      UINTN                       CallBackToken,\r
+  IN  OUT VOID             *TokenData,\r
+  IN      UINTN            TokenDataSize\r
+  );\r
+\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *PCD_PROTOCOL_CALLBACK_ONSET) (\r
+  IN  UINTN                   TokenNumber,\r
+  IN  CONST EFI_GUID          *Guid, OPTIONAL\r
+  IN  PCD_PROTOCOL_CALLBACK   CallBackFunction\r
+  );\r
+\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *PCD_PROTOCOL_CANCEL_CALLBACK) (\r
+  IN  UINTN                   TokenNumber,\r
+  IN  CONST EFI_GUID          *Guid, OPTIONAL\r
+  IN  PCD_PROTOCOL_CALLBACK   CallBackFunction\r
+  );\r
+\r
+typedef \r
+EFI_STATUS\r
+(EFIAPI *PCD_PROTOCOL_GET_NEXT_TOKEN) (\r
+  IN      CONST EFI_GUID      *Guid, OPTIONAL\r
+  IN OUT  UINTN               *TokenNumber\r
+  );\r
+\r
+typedef struct {\r
+  PCD_PROTOCOL_SET_SKU              SetSku;\r
+\r
+  PCD_PROTOCOL_GET8                 Get8;\r
+  PCD_PROTOCOL_GET16                Get16;\r
+  PCD_PROTOCOL_GET32                Get32;\r
+  PCD_PROTOCOL_GET64                Get64;\r
+  PCD_PROTOCOL_GET_POINTER          GetPtr;\r
+  PCD_PROTOCOL_GET_BOOLEAN          GetBool;\r
+  PCD_PROTOCOL_GET_SIZE             GetSize;\r
+\r
+  PCD_PROTOCOL_GET_EX_8             Get8Ex;\r
+  PCD_PROTOCOL_GET_EX_16            Get16Ex;\r
+  PCD_PROTOCOL_GET_EX_32            Get32Ex;\r
+  PCD_PROTOCOL_GET_EX_64            Get64Ex;\r
+  PCD_PROTOCOL_GET_EX_POINTER       GetPtrEx;\r
+  PCD_PROTOCOL_GET_EX_BOOLEAN       GetBoolEx;\r
+  PCD_PROTOCOL_GET_EX_SIZE          GetSizeEx;\r
+\r
+  PCD_PROTOCOL_SET8                 Set8;\r
+  PCD_PROTOCOL_SET16                Set16;\r
+  PCD_PROTOCOL_SET32                Set32;\r
+  PCD_PROTOCOL_SET64                Set64;\r
+  PCD_PROTOCOL_SET_POINTER          SetPtr;\r
+  PCD_PROTOCOL_SET_BOOLEAN          SetBool;\r
+\r
+  PCD_PROTOCOL_SET_EX_8             Set8Ex;\r
+  PCD_PROTOCOL_SET_EX_16            Set16Ex;\r
+  PCD_PROTOCOL_SET_EX_32            Set32Ex;\r
+  PCD_PROTOCOL_SET_EX_64            Set64Ex;\r
+  PCD_PROTOCOL_SET_EX_POINTER       SetPtrEx;\r
+  PCD_PROTOCOL_SET_EX_BOOLEAN       SetBoolEx;\r
+\r
+  PCD_PROTOCOL_CALLBACK_ONSET       CallbackOnSet;\r
+  PCD_PROTOCOL_CANCEL_CALLBACK      CancelCallback;\r
+  PCD_PROTOCOL_GET_NEXT_TOKEN       GetNextToken;\r
+} PCD_PROTOCOL;\r
+\r
+#endif\r
diff --git a/Tools/Source/TianoTools/Include/Protocol/PciHostBridgeResourceAllocation.h b/Tools/Source/TianoTools/Include/Protocol/PciHostBridgeResourceAllocation.h
new file mode 100644 (file)
index 0000000..9d83c5a
--- /dev/null
@@ -0,0 +1,363 @@
+/** @file\r
+  This file declares Pci Host Bridge Resource Allocation Protocol\r
+\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. This program and the accompanying materials                          \r
+  are licensed and made available under the terms and conditions of the BSD License         \r
+  which accompanies this distribution.  The full text of the license may be found at        \r
+  http://opensource.org/licenses/bsd-license.php                                            \r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+  Module Name:  PciHostBridgeResourceAllocation.h\r
+\r
+  @par Revision Reference:\r
+  This protocol is defined in Framework of EFI Pci Host Bridge Resource Allocation Protocol Spec\r
+  Version 0.9\r
+\r
+**/\r
+\r
+#ifndef _PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_H_\r
+#define _PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_H_\r
+\r
+#define EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL_GUID \\r
+  { 0xCF8034BE, 0x6768, 0x4d8b, {0xB7,0x39,0x7C,0xCE,0x68,0x3A,0x9F,0xBE }}\r
+\r
+\r
+typedef struct _EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL;\r
+\r
+\r
+//\r
+// EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_ATTRIBUTES\r
+//\r
+\r
+// If this bit is set, then the PCI Root Bridge does not \r
+// support separate windows for Non-prefetchable and Prefetchable \r
+// memory. A PCI bus driver needs to include requests for Prefetchable \r
+// memory in the Non-prefetchable memory pool.\r
+//\r
+#define EFI_PCI_HOST_BRIDGE_COMBINE_MEM_PMEM  1\r
+\r
+//\r
+// If this bit is set, then the PCI Root Bridge supports \r
+// 64 bit memory windows.  If this bit is not set, \r
+// the PCI bus driver needs to include requests for 64 bit \r
+// memory address in the corresponding 32 bit memory pool. \r
+//\r
+#define EFI_PCI_HOST_BRIDGE_MEM64_DECODE   2\r
+\r
+\r
+//\r
+// EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PHASE\r
+//\r
+typedef enum {\r
+  EfiPciHostBridgeBeginEnumeration,\r
+  EfiPciHostBridgeBeginBusAllocation,\r
+  EfiPciHostBridgeEndBusAllocation,\r
+  EfiPciHostBridgeBeginResourceAllocation,\r
+  EfiPciHostBridgeAllocateResources,\r
+  EfiPciHostBridgeSetResources,\r
+  EfiPciHostBridgeFreeResources,\r
+  EfiPciHostBridgeEndResourceAllocation\r
+} EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PHASE;\r
+\r
+//\r
+// EfiPciHostBridgeBeginEnumeration\r
+// Reset the host bridge PCI apertures and internal data structures. \r
+// PCI enumerator should issue this notification before starting fresh \r
+// enumeration process. Enumeration cannot be restarted after sending \r
+// any other notification such as EfiPciHostBridgeBeginBusAllocation. \r
+//\r
+// EfiPciHostBridgeBeginBusAllocation  \r
+// The bus allocation phase is about to begin. No specific action \r
+// is required here. This notification can be used to perform any \r
+// chipset specific programming. \r
+//\r
+// EfiPciHostBridgeEndBusAllocation\r
+// The bus allocation and bus programming phase is complete. No specific\r
+// action is required here. This notification can be used to perform any \r
+// chipset specific programming. \r
+//\r
+// EfiPciHostBridgeBeginResourceAllocation\r
+// The resource allocation phase is about to begin.No specific action is \r
+// required here. This notification can be used to perform any chipset specific programming. \r
+//\r
+// EfiPciHostBridgeAllocateResources\r
+// Allocate resources per previously submitted requests for all the PCI Root \r
+// Bridges. These resource settings are returned on the next call to \r
+// GetProposedResources(). \r
+//\r
+// EfiPciHostBridgeSetResources\r
+// Program the Host Bridge hardware to decode previously allocated resources\r
+// (proposed resources) for all the PCI Root Bridges. \r
+//\r
+// EfiPciHostBridgeFreeResources\r
+// De-allocate previously allocated resources previously for all the PCI \r
+// Root Bridges and reset the I/O and memory apertures to initial state. \r
+//\r
+// EfiPciHostBridgeEndResourceAllocation\r
+// The resource allocation phase is completed.  No specific action is required \r
+// here. This notification can be used to perform any chipset specific programming. \r
+\r
+\r
+\r
+//\r
+// EFI_PCI_CONTROLLER_RESOURCE_ALLOCATION_PHASE\r
+//\r
+typedef enum {\r
+  EfiPciBeforeChildBusEnumeration,        \r
+  EfiPciBeforeResourceCollection\r
+} EFI_PCI_CONTROLLER_RESOURCE_ALLOCATION_PHASE;\r
+\r
+//\r
+// EfiPciBeforeChildBusEnumeration\r
+// This notification is only applicable to PCI-PCI bridges and \r
+// indicates that the PCI enumerator is about to begin enumerating \r
+// the bus behind the PCI-PCI Bridge. This notification is sent after \r
+// the primary bus number, the secondary bus number and the subordinate \r
+// bus number registers in the PCI-PCI Bridge are programmed to valid \r
+// (not necessary final) values\r
+//\r
+// EfiPciBeforeResourceCollection\r
+// This notification is sent before the PCI enumerator probes BAR registers \r
+// for every valid PCI function.\r
+//\r
+\r
+\r
+/**\r
+  Enter a certain phase of the PCI enumeration process\r
+\r
+  @param  This The EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL instance\r
+  @param  Phase The phase during enumeration\r
+\r
+  @retval  EFI_SUCCESS Success\r
+  @retval  EFI_OUT_OF_RESOURCES If SubmitResources ( ) could not allocate resources\r
+  @retval  EFI_NOT_READY This phase cannot be entered at this time\r
+  @retval  EFI_DEVICE_ERROR SetResources failed due to HW error.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL_NOTIFY_PHASE) (\r
+  IN EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL         *This,\r
+  IN EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PHASE            Phase\r
+  );\r
+\r
+  \r
+/**\r
+  Return the device handle of the next PCI root bridge that is associated with \r
+  this Host Bridge\r
+\r
+  @param  This The EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_ PROTOCOL instance\r
+  @param  RootBridgeHandle Returns the device handle of the next PCI Root Bridge.\r
+  On input, it holds the RootBridgeHandle returned by the most\r
+  recent call to GetNextRootBridge().The handle for the first\r
+  PCI Root Bridge is returned if RootBridgeHandle is NULL on input\r
+\r
+  @retval  EFI_SUCCESS Success\r
+  @retval  EFI_INVALID_PARAMETER RootBridgeHandle is invalid\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL_GET_NEXT_ROOT_BRIDGE) (\r
+  IN EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL     *This,\r
+  IN OUT EFI_HANDLE                                       *RootBridgeHandle\r
+  );\r
+\r
+\r
+/**\r
+  Returns the attributes of a PCI Root Bridge.\r
+\r
+  @param  This The EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_ PROTOCOL instance\r
+  @param  RootBridgeHandle The device handle of the PCI Root Bridge\r
+  that the caller is interested in\r
+  @param  Attribute The pointer to attributes of the PCI Root Bridge\r
+\r
+  @retval  EFI_SUCCESS Success\r
+  @retval  EFI_INVALID_PARAMETER RootBridgeHandle is invalid\r
+  @retval  EFI_INVALID_PARAMETER Attributes is NULL\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL_GET_ATTRIBUTES) (\r
+  IN EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL           *This,\r
+  IN  EFI_HANDLE                                                RootBridgeHandle,\r
+  OUT UINT64                                                    *Attributes\r
+  );\r
+\r
+\r
+/**\r
+  This is the request from the PCI enumerator to set up \r
+  the specified PCI Root Bridge for bus enumeration process. \r
+\r
+  @param  This The EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_ PROTOCOL instance\r
+  @param  RootBridgeHandle The PCI Root Bridge to be set up\r
+  @param  Configuration Pointer to the pointer to the PCI bus resource descriptor\r
+\r
+  @retval  EFI_SUCCESS Success\r
+  @retval  EFI_INVALID_PARAMETER RootBridgeHandle is invalid\r
+  @retval  EFI_DEVICE_ERROR Request failed due to hardware error\r
+  @retval  EFI_OUT_OF_RESOURCES Request failed due to lack of resources\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL_START_BUS_ENUMERATION) (\r
+  IN EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL           *This,\r
+  IN  EFI_HANDLE                                                RootBridgeHandle,\r
+  OUT VOID                                                      **Configuration\r
+  );\r
+\r
+  \r
+/**\r
+  This function programs the PCI Root Bridge hardware so that \r
+  it decodes the specified PCI bus range\r
+\r
+  @param  This The EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_ PROTOCOL instance\r
+  @param  RootBridgeHandle The PCI Root Bridge whose bus range is to be programmed\r
+  @param  Configuration The pointer to the PCI bus resource descriptor\r
+\r
+  @retval  EFI_SUCCESS Success\r
+  @retval  EFI_INVALID_PARAMETER RootBridgeHandle is invalid\r
+  @retval  EFI_INVALID_PARAMETER Configuration is NULL\r
+  @retval  EFI_INVALID_PARAMETER Configuration does not point to a valid ACPI resource descriptor\r
+  @retval  EFI_INVALID_PARAMETER Configuration contains one or more memory or IO ACPI resource descriptor\r
+  @retval  EFI_INVALID_PARAMETER Address Range Minimum or Address Range Length fields in Configuration\r
+  are invalid for this Root Bridge.\r
+  @retval  EFI_INVALID_PARAMETER Configuration contains one or more invalid ACPI resource descriptor\r
+  @retval  EFI_DEVICE_ERROR Request failed due to hardware error\r
+  @retval  EFI_OUT_OF_RESOURCES Request failed due to lack of resources\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL_SET_BUS_NUMBERS) (\r
+  IN EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL          *This,\r
+  IN EFI_HANDLE                                                RootBridgeHandle,\r
+  IN VOID                                                      *Configuration\r
+  );\r
+\r
+\r
+/**\r
+  Submits the I/O and memory resource requirements for the specified PCI Root Bridge\r
+\r
+  @param  This The EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_ PROTOCOL instance\r
+  @param  RootBridgeHandle The PCI Root Bridge whose I/O and memory resource requirements\r
+  are being submitted\r
+  @param  Configuration The pointer to the PCI I/O and PCI memory resource descriptor\r
+\r
+  @retval  EFI_SUCCESS Success\r
+  @retval  EFI_INVALID_PARAMETER RootBridgeHandle is invalid\r
+  @retval  EFI_INVALID_PARAMETER Configuration is NULL\r
+  @retval  EFI_INVALID_PARAMETER Configuration does not point to a valid ACPI resource descriptor\r
+  @retval  EFI_INVALID_PARAMETER Configuration includes a resource descriptor of unsupported type\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL_SUBMIT_RESOURCES) (\r
+  IN EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL          *This,\r
+  IN EFI_HANDLE                                                RootBridgeHandle,\r
+  IN VOID                                                      *Configuration\r
+  );\r
+\r
+\r
+/**\r
+  This function returns the proposed resource settings for the specified \r
+  PCI Root Bridge\r
+\r
+  @param  This The EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_ PROTOCOL instance\r
+  @param  RootBridgeHandle The PCI Root Bridge handle\r
+  @param  Configuration The pointer to the pointer to the PCI I/O\r
+  and memory resource descriptor\r
+\r
+  @retval  EFI_SUCCESS Success\r
+  @retval  EFI_INVALID_PARAMETER RootBridgeHandle is invalid\r
+  @retval  EFI_DEVICE_ERROR Request failed due to hardware error\r
+  @retval  EFI_OUT_OF_RESOURCES Request failed due to lack of resources\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL_GET_PROPOSED_RESOURCES) (\r
+  IN EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL           *This,\r
+  IN  EFI_HANDLE                                                RootBridgeHandle,\r
+  OUT VOID                                                      **Configuration\r
+  );\r
+\r
+\r
+\r
+/**\r
+  This function is called for all the PCI controllers that the PCI \r
+  bus driver finds. Can be used to Preprogram the controller.\r
+\r
+  @param  This The EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_ PROTOCOL instance\r
+  @param  RootBridgeHandle The PCI Root Bridge handle\r
+  @param  PciBusAddress Address of the controller on the PCI bus\r
+  @param Phase The Phase during resource allocation\r
+\r
+  @retval  EFI_SUCCESS Success\r
+  @retval  EFI_INVALID_PARAMETER RootBridgeHandle is invalid\r
+  @retval  EFI_DEVICE_ERROR Device pre-initialization failed due to hardware error.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL_PREPROCESS_CONTROLLER) (\r
+  IN EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL            *This,\r
+  IN  EFI_HANDLE                                                 RootBridgeHandle,\r
+  IN  EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_PCI_ADDRESS                PciAddress,\r
+  IN  EFI_PCI_CONTROLLER_RESOURCE_ALLOCATION_PHASE               Phase\r
+  );\r
+\r
+/**\r
+  @par Protocol Description:\r
+  Provides the basic interfaces to abstract a PCI host bridge resource allocation. \r
+\r
+  @param NotifyPhase\r
+  The notification from the PCI bus enumerator that it is about to enter \r
+  a certain phase during the enumeration process.\r
+\r
+  @param GetNextRootBridge  \r
+  Retrieves the device handle for the next PCI root bridge that is produced by the \r
+  host bridge to which this instance of the EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL is attached. \r
+\r
+  @param GetAllocAttributes \r
+  Retrieves the allocation-related attributes of a PCI root bridge.\r
+\r
+  @param StartBusEnumeration \r
+  Sets up a PCI root bridge for bus enumeration. \r
+\r
+  @param SetBusNumbers \r
+  Sets up the PCI root bridge so that it decodes a specific range of bus numbers.\r
+\r
+  @param SubmitResources\r
+  Submits the resource requirements for the specified PCI root bridge. \r
+\r
+  @param GetProposedResources \r
+  Returns the proposed resource assignment for the specified PCI root bridges.\r
+\r
+  @param PreprocessController\r
+  Provides hooks from the PCI bus driver to every PCI controller \r
+  (device/function) at various stages of the PCI enumeration process that \r
+  allow the host bridge driver to preinitialize individual PCI controllers \r
+  before enumeration.\r
+\r
+**/\r
+struct _EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL {\r
+  EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL_NOTIFY_PHASE           NotifyPhase;\r
+  EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL_GET_NEXT_ROOT_BRIDGE   GetNextRootBridge;\r
+  EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL_GET_ATTRIBUTES         GetAllocAttributes;\r
+  EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL_START_BUS_ENUMERATION  StartBusEnumeration;\r
+  EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL_SET_BUS_NUMBERS        SetBusNumbers;\r
+  EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL_SUBMIT_RESOURCES       SubmitResources;\r
+  EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL_GET_PROPOSED_RESOURCES GetProposedResources;\r
+  EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL_PREPROCESS_CONTROLLER  PreprocessController;\r
+};\r
+\r
+extern EFI_GUID gEfiPciHostBridgeResourceAllocationProtocolGuid;\r
+\r
+#endif\r
diff --git a/Tools/Source/TianoTools/Include/Protocol/PciHotPlugInit.h b/Tools/Source/TianoTools/Include/Protocol/PciHotPlugInit.h
new file mode 100644 (file)
index 0000000..b4b5a3d
--- /dev/null
@@ -0,0 +1,185 @@
+/** @file\r
+  This file declares EFI PCI Hot Plug Init Protocol\r
+\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. This program and the accompanying materials                          \r
+  are licensed and made available under the terms and conditions of the BSD License         \r
+  which accompanies this distribution.  The full text of the license may be found at        \r
+  http://opensource.org/licenses/bsd-license.php                                            \r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+  Module Name:  PciHotPlugInit.h\r
+\r
+  @par Revision Reference:\r
+  This protocol is defined in Framework of EFI Hot Plug Pci Initialization Protocol Spec\r
+  Version 0.9\r
+\r
+**/\r
+\r
+#ifndef _EFI_PCI_HOT_PLUG_INIT_H\r
+#define _EFI_PCI_HOT_PLUG_INIT_H\r
+\r
+//\r
+// Global ID for the PCI Hot Plug Protocol\r
+//\r
+#define EFI_PCI_HOT_PLUG_INIT_PROTOCOL_GUID \\r
+  { 0xaa0e8bc1, 0xdabc, 0x46b0, {0xa8, 0x44, 0x37, 0xb8, 0x16, 0x9b, 0x2b, 0xea } }\r
+\r
+  \r
+typedef struct _EFI_PCI_HOT_PLUG_INIT_PROTOCOL EFI_PCI_HOT_PLUG_INIT_PROTOCOL;\r
+\r
+#define  EFI_HPC_STATE_INITIALIZED    0x01\r
+#define  EFI_HPC_STATE_ENABLED        0x02\r
+\r
+typedef UINT16 EFI_HPC_STATE;\r
+\r
+\r
+typedef struct{\r
+  EFI_DEVICE_PATH_PROTOCOL  *HpcDevicePath;\r
+  EFI_DEVICE_PATH_PROTOCOL  *HpbDevicePath;\r
+} EFI_HPC_LOCATION;\r
+\r
+\r
+typedef enum{\r
+  EfiPaddingPciBus,\r
+  EfiPaddingPciRootBridge\r
+} EFI_HPC_PADDING_ATTRIBUTES;\r
+\r
+/**\r
+  Returns a list of root Hot Plug Controllers (HPCs) that require initialization \r
+  during the boot process.\r
+\r
+  @param  This Pointer to the EFI_PCI_HOT_PLUG_INIT_PROTOCOL instance.\r
+  \r
+  @param  HpcCount The number of root HPCs that were returned.\r
+  \r
+  @param  HpcList The list of root HPCs. HpcCount defines the number of \r
+  elements in this list.\r
+\r
+  @retval EFI_SUCCESS HpcList was returned.\r
+  \r
+  @retval EFI_OUT_OF_RESOURCES HpcList was not returned due to insufficient resources.\r
+  \r
+  @retval EFI_INVALID_PARAMETER HpcCount is NULL or HpcList is NULL.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_GET_ROOT_HPC_LIST) (\r
+  IN EFI_PCI_HOT_PLUG_INIT_PROTOCOL   *This,\r
+  OUT UINTN                           *HpcCount,\r
+  OUT EFI_HPC_LOCATION                **HpcList\r
+);\r
+\r
+/**\r
+  Initializes one root Hot Plug Controller (HPC). This process may causes \r
+  initialization of its subordinate buses. \r
+\r
+  @param  This Pointer to the EFI_PCI_HOT_PLUG_INIT_PROTOCOL instance.\r
+  \r
+  @param  HpcDevicePath The device path to the HPC that is being initialized.\r
+  \r
+  @param  HpcPciAddress The address of the HPC function on the PCI bus.\r
+  \r
+  @param  Event The event that should be signaled when the HPC initialization \r
+  is complete.\r
+  \r
+  @param  HpcState The state of the HPC hardware. \r
+\r
+  @retval EFI_SUCCESS If Event is NULL, the specific HPC was successfully \r
+  initialized. If Event is not NULL,  Event will be signaled at a later time \r
+  when initialization is complete.\r
+  \r
+  @retval EFI_UNSUPPORTED This instance of EFI_PCI_HOT_PLUG_INIT_PROTOCOL \r
+  does not support the specified HPC.\r
+  \r
+  @retval EFI_OUT_OF_RESOURCES Initialization failed due to insufficient \r
+  resources.\r
+  \r
+  @retval EFI_INVALID_PARAMETER HpcState is NULL.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_INITIALIZE_ROOT_HPC) (\r
+  IN EFI_PCI_HOT_PLUG_INIT_PROTOCOL     *This,\r
+  IN  EFI_DEVICE_PATH_PROTOCOL          *HpcDevicePath,\r
+  IN  UINT64                            HpcPciAddress,\r
+  IN  EFI_EVENT                         Event, OPTIONAL\r
+  OUT EFI_HPC_STATE                     *HpcState\r
+);\r
+\r
+/**\r
+  Returns the resource padding that is required by the PCI bus that is controlled \r
+  by the specified Hot Plug Controller (HPC).\r
+\r
+  @param  This Pointer to the EFI_PCI_HOT_PLUG_INIT_PROTOCOL instance.\r
+  \r
+  @param  HpcDevicePath The device path to the HPC.\r
+  \r
+  @param  HpcPciAddress The address of the HPC function on the PCI bus. \r
+  \r
+  @param  HpcState The state of the HPC hardware. \r
+  \r
+  @param  Padding The amount of resource padding that is required by the \r
+  PCI bus under the control of the specified HPC. \r
+  \r
+  @param  Attributes Describes how padding is accounted for. The padding \r
+  is returned in the form of ACPI 2.0 resource descriptors. \r
+\r
+  @retval EFI_SUCCESS The resource padding was successfully returned.\r
+  \r
+  @retval EFI_UNSUPPORTED This instance of the EFI_PCI_HOT_PLUG_INIT_PROTOCOL \r
+  does not support the specified HPC.\r
+  \r
+  @retval EFI_NOT_READY This function was called before HPC initialization is complete.\r
+  \r
+  @retval EFI_INVALID_PARAMETER  HpcState or Padding or Attributes is NULL.\r
+  \r
+  @retval EFI_OUT_OF_RESOURCES ACPI 2.0 resource descriptors for Padding \r
+  cannot be allocated due to insufficient resources.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_GET_PCI_HOT_PLUG_PADDING) (\r
+  IN EFI_PCI_HOT_PLUG_INIT_PROTOCOL     *This,\r
+  IN  EFI_DEVICE_PATH_PROTOCOL          *HpcDevicePath,\r
+  IN  UINT64                            HpcPciAddress,\r
+  OUT EFI_HPC_STATE                     *HpcState,\r
+  OUT VOID                              **Padding,\r
+  OUT EFI_HPC_PADDING_ATTRIBUTES        *Attributes\r
+); \r
+\r
+\r
+//\r
+// Prototypes for the PCI Hot Plug Init Protocol\r
+//\r
+\r
+/**\r
+  @par Protocol Description:\r
+  This protocol provides the necessary functionality to initialize the \r
+  Hot Plug Controllers (HPCs) and the buses that they control. This protocol \r
+  also provides information regarding resource padding. \r
+\r
+  @param GetRootHpcList\r
+  Returns a list of root HPCs and the buses that they control.\r
+\r
+  @param InitializeRootHpc\r
+  Initializes the specified root HPC.\r
+\r
+  @param GetResourcePadding\r
+  Returns the resource padding that is required by the HPC.\r
+\r
+**/\r
+struct _EFI_PCI_HOT_PLUG_INIT_PROTOCOL {\r
+  EFI_GET_ROOT_HPC_LIST                                  GetRootHpcList;\r
+  EFI_INITIALIZE_ROOT_HPC                                InitializeRootHpc;\r
+  EFI_GET_PCI_HOT_PLUG_PADDING                           GetResourcePadding;\r
+};\r
+\r
+extern EFI_GUID gEfiPciHotPlugInitProtocolGuid;\r
+\r
+#endif\r
diff --git a/Tools/Source/TianoTools/Include/Protocol/PciIo.h b/Tools/Source/TianoTools/Include/Protocol/PciIo.h
new file mode 100644 (file)
index 0000000..18494b3
--- /dev/null
@@ -0,0 +1,503 @@
+/** @file\r
+  EFI PCI I/O Protocol\r
+\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. This program and the accompanying materials                          \r
+  are licensed and made available under the terms and conditions of the BSD License         \r
+  which accompanies this distribution.  The full text of the license may be found at        \r
+  http://opensource.org/licenses/bsd-license.php                                            \r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+  Module Name:  PciIo.h\r
+\r
+**/\r
+\r
+#ifndef __PCI_IO_H__\r
+#define __PCI_IO_H__\r
+\r
+//\r
+// Global ID for the PCI I/O Protocol\r
+//\r
+#define EFI_PCI_IO_PROTOCOL_GUID \\r
+  { \\r
+    0x4cf5b200, 0x68b8, 0x4ca5, {0x9e, 0xec, 0xb2, 0x3e, 0x3f, 0x50, 0x2, 0x9a } \\r
+  }\r
+\r
+typedef struct _EFI_PCI_IO_PROTOCOL  EFI_PCI_IO_PROTOCOL;\r
+\r
+//\r
+// Prototypes for the PCI I/O Protocol\r
+//\r
+typedef enum {\r
+  EfiPciIoWidthUint8      = 0,\r
+  EfiPciIoWidthUint16,\r
+  EfiPciIoWidthUint32,\r
+  EfiPciIoWidthUint64,\r
+  EfiPciIoWidthFifoUint8,\r
+  EfiPciIoWidthFifoUint16,\r
+  EfiPciIoWidthFifoUint32,\r
+  EfiPciIoWidthFifoUint64,\r
+  EfiPciIoWidthFillUint8,\r
+  EfiPciIoWidthFillUint16,\r
+  EfiPciIoWidthFillUint32,\r
+  EfiPciIoWidthFillUint64,\r
+  EfiPciIoWidthMaximum\r
+} EFI_PCI_IO_PROTOCOL_WIDTH;\r
+\r
+//\r
+// Complete PCI address generater\r
+//\r
+#define EFI_PCI_IO_PASS_THROUGH_BAR               0xff    // Special BAR that passes a memory or I/O cycle through unchanged\r
+#define EFI_PCI_IO_ATTRIBUTE_MASK                 0x077f  // All the following I/O and Memory cycles\r
+#define EFI_PCI_IO_ATTRIBUTE_ISA_MOTHERBOARD_IO   0x0001  // I/O cycles 0x0000-0x00FF (10 bit decode)\r
+#define EFI_PCI_IO_ATTRIBUTE_ISA_IO               0x0002  // I/O cycles 0x0100-0x03FF or greater (10 bit decode)\r
+#define EFI_PCI_IO_ATTRIBUTE_VGA_PALETTE_IO       0x0004  // I/O cycles 0x3C6, 0x3C8, 0x3C9 (10 bit decode)\r
+#define EFI_PCI_IO_ATTRIBUTE_VGA_MEMORY           0x0008  // MEM cycles 0xA0000-0xBFFFF (24 bit decode)\r
+#define EFI_PCI_IO_ATTRIBUTE_VGA_IO               0x0010  // I/O cycles 0x3B0-0x3BB and 0x3C0-0x3DF (10 bit decode)\r
+#define EFI_PCI_IO_ATTRIBUTE_IDE_PRIMARY_IO       0x0020  // I/O cycles 0x1F0-0x1F7, 0x3F6, 0x3F7 (10 bit decode)\r
+#define EFI_PCI_IO_ATTRIBUTE_IDE_SECONDARY_IO     0x0040  // I/O cycles 0x170-0x177, 0x376, 0x377 (10 bit decode)\r
+#define EFI_PCI_IO_ATTRIBUTE_MEMORY_WRITE_COMBINE 0x0080  // Map a memory range so write are combined\r
+#define EFI_PCI_IO_ATTRIBUTE_IO                   0x0100  // Enable the I/O decode bit in the PCI Config Header\r
+#define EFI_PCI_IO_ATTRIBUTE_MEMORY               0x0200  // Enable the Memory decode bit in the PCI Config Header\r
+#define EFI_PCI_IO_ATTRIBUTE_BUS_MASTER           0x0400  // Enable the DMA bit in the PCI Config Header\r
+#define EFI_PCI_IO_ATTRIBUTE_MEMORY_CACHED        0x0800  // Map a memory range so all r/w accesses are cached\r
+#define EFI_PCI_IO_ATTRIBUTE_MEMORY_DISABLE       0x1000  // Disable a memory range\r
+#define EFI_PCI_IO_ATTRIBUTE_EMBEDDED_DEVICE      0x2000  // Clear for an add-in PCI Device\r
+#define EFI_PCI_IO_ATTRIBUTE_EMBEDDED_ROM         0x4000  // Clear for a physical PCI Option ROM accessed through ROM BAR\r
+#define EFI_PCI_IO_ATTRIBUTE_DUAL_ADDRESS_CYCLE   0x8000  // Clear for PCI controllers that can not genrate a DAC\r
+#define EFI_PCI_IO_ATTRIBUTE_ISA_IO_16            0x10000 // I/O cycles 0x0100-0x03FF or greater (16 bit decode)\r
+#define EFI_PCI_IO_ATTRIBUTE_VGA_PALETTE_IO_16    0x20000 // I/O cycles 0x3C6, 0x3C8, 0x3C9 (16 bit decode)\r
+#define EFI_PCI_IO_ATTRIBUTE_VGA_IO_16            0x30000 // I/O cycles 0x3B0-0x3BB and 0x3C0-0x3DF (16 bit decode)\r
+\r
+#define EFI_PCI_DEVICE_ENABLE                     (EFI_PCI_IO_ATTRIBUTE_IO | EFI_PCI_IO_ATTRIBUTE_MEMORY | EFI_PCI_IO_ATTRIBUTE_BUS_MASTER)\r
+#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)\r
+\r
+//\r
+// *******************************************************\r
+// EFI_PCI_IO_PROTOCOL_OPERATION\r
+// *******************************************************\r
+//\r
+typedef enum {\r
+  EfiPciIoOperationBusMasterRead,\r
+  EfiPciIoOperationBusMasterWrite,\r
+  EfiPciIoOperationBusMasterCommonBuffer,\r
+  EfiPciIoOperationMaximum\r
+} EFI_PCI_IO_PROTOCOL_OPERATION;\r
+\r
+//\r
+// *******************************************************\r
+// EFI_PCI_IO_PROTOCOL_ATTRIBUTE_OPERATION\r
+// *******************************************************\r
+//\r
+typedef enum {\r
+  EfiPciIoAttributeOperationGet,\r
+  EfiPciIoAttributeOperationSet,\r
+  EfiPciIoAttributeOperationEnable,\r
+  EfiPciIoAttributeOperationDisable,\r
+  EfiPciIoAttributeOperationSupported,\r
+  EfiPciIoAttributeOperationMaximum\r
+} EFI_PCI_IO_PROTOCOL_ATTRIBUTE_OPERATION;\r
+\r
+/**                                                                 \r
+  Reads from the memory space of a PCI controller. Returns when either the polling exit criteria is\r
+  satisfied or after a defined duration.                                                           \r
+          \r
+  @param  This                  A pointer to the EFI_PCI_IO_PROTOCOL instance.\r
+  @param  Width                 Signifies the width of the memory or I/O operations.\r
+  @param  BarIndex              The BAR index of the standard PCI Configuration header to use as the\r
+                                base address for the memory operation to perform.                   \r
+  @param  Offset                The offset within the selected BAR to start the memory operation.\r
+  @param  Mask                  Mask used for the polling criteria.\r
+  @param  Value                 The comparison value used for the polling exit criteria.\r
+  @param  Delay                 The number of 100 ns units to poll.\r
+  @param  Result                Pointer to the last value read from the memory location.\r
+                                \r
+  @retval EFI_SUCCESS           The last data returned from the access matched the poll exit criteria.\r
+  @retval EFI_UNSUPPORTED       BarIndex not valid for this PCI controller.\r
+  @retval EFI_UNSUPPORTED       Offset is not valid for the BarIndex of this PCI controller.\r
+  @retval EFI_TIMEOUT           Delay expired before a match occurred.\r
+  @retval EFI_OUT_OF_RESOURCES  The request could not be completed due to a lack of resources.\r
+  @retval EFI_INVALID_PARAMETER One or more parameters are invalid.\r
+                                   \r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_PCI_IO_PROTOCOL_POLL_IO_MEM) (\r
+  IN EFI_PCI_IO_PROTOCOL           *This,\r
+  IN  EFI_PCI_IO_PROTOCOL_WIDTH    Width,\r
+  IN  UINT8                        BarIndex,\r
+  IN  UINT64                       Offset,\r
+  IN  UINT64                       Mask,\r
+  IN  UINT64                       Value,\r
+  IN  UINT64                       Delay,\r
+  OUT UINT64                       *Result\r
+  );\r
+\r
+/**                                                                 \r
+  Enable a PCI driver to access PCI controller registers in the PCI memory or I/O space.\r
+          \r
+  @param  This                  A pointer to the EFI_PCI_IO_PROTOCOL instance.\r
+  @param  Width                 Signifies the width of the memory or I/O operations.\r
+  @param  BarIndex              The BAR index of the standard PCI Configuration header to use as the\r
+                                base address for the memory or I/O operation to perform.                    \r
+  @param  Offset                The offset within the selected BAR to start the memory or I/O operation.                                \r
+  @param  Count                 The number of memory or I/O operations to perform.\r
+  @param  Buffer                For read operations, the destination buffer to store the results. For write\r
+                                operations, the source buffer to write data from.                          \r
+  \r
+  @retval EFI_SUCCESS           The data was read from or written to the PCI controller.\r
+  @retval EFI_UNSUPPORTED       BarIndex not valid for this PCI controller.\r
+  @retval EFI_UNSUPPORTED       The address range specified by Offset, Width, and Count is not\r
+                                valid for the PCI BAR specified by BarIndex.                  \r
+  @retval EFI_OUT_OF_RESOURCES  The request could not be completed due to a lack of resources.\r
+  @retval EFI_INVALID_PARAMETER One or more parameters are invalid.\r
+                                   \r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_PCI_IO_PROTOCOL_IO_MEM) (\r
+  IN EFI_PCI_IO_PROTOCOL              *This,\r
+  IN     EFI_PCI_IO_PROTOCOL_WIDTH    Width,\r
+  IN     UINT8                        BarIndex,\r
+  IN     UINT64                       Offset,\r
+  IN     UINTN                        Count,\r
+  IN OUT VOID                         *Buffer\r
+  );\r
+\r
+typedef struct {\r
+  EFI_PCI_IO_PROTOCOL_IO_MEM  Read;\r
+  EFI_PCI_IO_PROTOCOL_IO_MEM  Write;\r
+} EFI_PCI_IO_PROTOCOL_ACCESS;\r
+\r
+/**                                                                 \r
+  Enable a PCI driver to access PCI controller registers in PCI configuration space.\r
+            \r
+  @param  This                  A pointer to the EFI_PCI_IO_PROTOCOL instance.  \r
+  @param  Width                 Signifies the width of the memory operations.\r
+  @param  Offset                The offset within the PCI configuration space for the PCI controller.\r
+  @param  Count                 The number of PCI configuration operations to perform.\r
+  @param  Buffer                For read operations, the destination buffer to store the results. For write\r
+                                operations, the source buffer to write data from.\r
+  \r
+                                  \r
+  @retval EFI_SUCCESS           The data was read from or written to the PCI controller.\r
+  @retval EFI_UNSUPPORTED       The address range specified by Offset, Width, and Count is not\r
+                                valid for the PCI configuration header of the PCI controller.\r
+  @retval EFI_OUT_OF_RESOURCES  The request could not be completed due to a lack of resources.                                 \r
+  @retval EFI_INVALID_PARAMETER Buffer is NULL or Width is invalid.                                \r
+                                     \r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_PCI_IO_PROTOCOL_CONFIG) (\r
+  IN EFI_PCI_IO_PROTOCOL              *This,\r
+  IN     EFI_PCI_IO_PROTOCOL_WIDTH    Width,\r
+  IN     UINT32                       Offset,\r
+  IN     UINTN                        Count,\r
+  IN OUT VOID                         *Buffer\r
+  );\r
+\r
+typedef struct {\r
+  EFI_PCI_IO_PROTOCOL_CONFIG  Read;\r
+  EFI_PCI_IO_PROTOCOL_CONFIG  Write;\r
+} EFI_PCI_IO_PROTOCOL_CONFIG_ACCESS;\r
+\r
+/**                                                                 \r
+  Enables a PCI driver to copy one region of PCI memory space to another region of PCI\r
+  memory space.\r
+            \r
+  @param  This                  A pointer to the EFI_PCI_IO_PROTOCOL instance.\r
+  @param  Width                 Signifies the width of the memory operations.\r
+  @param  DestBarIndex          The BAR index in the standard PCI Configuration header to use as the\r
+                                base address for the memory operation to perform.                   \r
+  @param  DestOffset            The destination offset within the BAR specified by DestBarIndex to\r
+                                start the memory writes for the copy operation.                   \r
+  @param  SrcBarIndex           The BAR index in the standard PCI Configuration header to use as the\r
+                                base address for the memory operation to perform.                   \r
+  @param  SrcOffset             The source offset within the BAR specified by SrcBarIndex to start\r
+                                the memory reads for the copy operation.                          \r
+  @param  Count                 The number of memory operations to perform. Bytes moved is Width\r
+                                size * Count, starting at DestOffset and SrcOffset.             \r
+                                \r
+  @retval EFI_SUCCESS           The data was copied from one memory region to another memory region.\r
+  @retval EFI_UNSUPPORTED       DestBarIndex not valid for this PCI controller.\r
+  @retval EFI_UNSUPPORTED       SrcBarIndex not valid for this PCI controller.\r
+  @retval EFI_UNSUPPORTED       The address range specified by DestOffset, Width, and Count\r
+                                is not valid for the PCI BAR specified by DestBarIndex.    \r
+  @retval EFI_UNSUPPORTED       The address range specified by SrcOffset, Width, and Count is\r
+                                not valid for the PCI BAR specified by SrcBarIndex.          \r
+  @retval EFI_INVALID_PARAMETER Width is invalid.\r
+  @retval EFI_OUT_OF_RESOURCES  The request could not be completed due to a lack of resources.\r
+                                   \r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_PCI_IO_PROTOCOL_COPY_MEM) (\r
+  IN EFI_PCI_IO_PROTOCOL              *This,\r
+  IN     EFI_PCI_IO_PROTOCOL_WIDTH    Width,\r
+  IN     UINT8                        DestBarIndex,\r
+  IN     UINT64                       DestOffset,\r
+  IN     UINT8                        SrcBarIndex,\r
+  IN     UINT64                       SrcOffset,\r
+  IN     UINTN                        Count\r
+  );\r
+\r
+/**                                                                 \r
+  Provides the PCI controller¨Cspecific addresses needed to access system memory.\r
+            \r
+  @param  This                  A pointer to the EFI_PCI_IO_PROTOCOL instance.\r
+  @param  Operation             Indicates if the bus master is going to read or write to system memory.\r
+  @param  HostAddress           The system memory address to map to the PCI controller.\r
+  @param  NumberOfBytes         On input the number of bytes to map. On output the number of bytes\r
+                                that were mapped.                                                 \r
+  @param  DeviceAddress         The resulting map address for the bus master PCI controller to use to\r
+                                access the hosts HostAddress.                                        \r
+  @param  Mapping               A resulting value to pass to Unmap().\r
+                                  \r
+  @retval EFI_SUCCESS           The range was mapped for the returned NumberOfBytes.\r
+  @retval EFI_UNSUPPORTED       The HostAddress cannot be mapped as a common buffer.                                \r
+  @retval EFI_INVALID_PARAMETER One or more parameters are invalid.\r
+  @retval EFI_OUT_OF_RESOURCES  The request could not be completed due to a lack of resources.\r
+  @retval EFI_DEVICE_ERROR      The system hardware could not map the requested address.\r
+                                   \r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_PCI_IO_PROTOCOL_MAP) (\r
+  IN EFI_PCI_IO_PROTOCOL                *This,\r
+  IN     EFI_PCI_IO_PROTOCOL_OPERATION  Operation,\r
+  IN     VOID                           *HostAddress,\r
+  IN OUT UINTN                          *NumberOfBytes,\r
+  OUT    EFI_PHYSICAL_ADDRESS           *DeviceAddress,\r
+  OUT    VOID                           **Mapping\r
+  );\r
+\r
+/**                                                                 \r
+  Completes the Map() operation and releases any corresponding resources.\r
+            \r
+  @param  This                  A pointer to the EFI_PCI_IO_PROTOCOL instance.                                      \r
+  @param  Mapping               The mapping value returned from Map().\r
+                                  \r
+  @retval EFI_SUCCESS           The range was unmapped.\r
+  @retval EFI_DEVICE_ERROR      The data was not committed to the target system memory.\r
+                                   \r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_PCI_IO_PROTOCOL_UNMAP) (\r
+  IN EFI_PCI_IO_PROTOCOL           *This,\r
+  IN  VOID                         *Mapping\r
+  );\r
+\r
+/**                                                                 \r
+  Allocates pages that are suitable for an EfiPciIoOperationBusMasterCommonBuffer\r
+  mapping.                                                                       \r
+            \r
+  @param  This                  A pointer to the EFI_PCI_IO_PROTOCOL instance.\r
+  @param  Type                  This parameter is not used and must be ignored.\r
+  @param  MemoryType            The type of memory to allocate, EfiBootServicesData or\r
+                                EfiRuntimeServicesData.                               \r
+  @param  Pages                 The number of pages to allocate.                                \r
+  @param  HostAddress           A pointer to store the base system memory address of the\r
+                                allocated range.                                        \r
+  @param  Attributes            The requested bit mask of attributes for the allocated range.\r
+                                  \r
+  @retval EFI_SUCCESS           The requested memory pages were allocated.\r
+  @retval EFI_UNSUPPORTED       Attributes is unsupported. The only legal attribute bits are\r
+                                MEMORY_WRITE_COMBINE and MEMORY_CACHED.                     \r
+  @retval EFI_INVALID_PARAMETER One or more parameters are invalid.\r
+  @retval EFI_OUT_OF_RESOURCES  The memory pages could not be allocated.  \r
+                                   \r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_PCI_IO_PROTOCOL_ALLOCATE_BUFFER) (\r
+  IN EFI_PCI_IO_PROTOCOL           *This,\r
+  IN  EFI_ALLOCATE_TYPE            Type,\r
+  IN  EFI_MEMORY_TYPE              MemoryType,\r
+  IN  UINTN                        Pages,\r
+  OUT VOID                         **HostAddress,\r
+  IN  UINT64                       Attributes\r
+  );\r
+\r
+/**                                                                 \r
+  Frees memory that was allocated with AllocateBuffer().\r
+            \r
+  @param  This                  A pointer to the EFI_PCI_IO_PROTOCOL instance.  \r
+  @param  Pages                 The number of pages to free.                                \r
+  @param  HostAddress           The base system memory address of the allocated range.                                    \r
+                                  \r
+  @retval EFI_SUCCESS           The requested memory pages were freed.\r
+  @retval EFI_INVALID_PARAMETER The memory range specified by HostAddress and Pages\r
+                                was not allocated with AllocateBuffer().\r
+                                     \r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_PCI_IO_PROTOCOL_FREE_BUFFER) (\r
+  IN EFI_PCI_IO_PROTOCOL           *This,\r
+  IN  UINTN                        Pages,\r
+  IN  VOID                         *HostAddress\r
+  );\r
+\r
+/**                                                                 \r
+  Flushes all PCI posted write transactions from a PCI host bridge to system memory.\r
+            \r
+  @param  This                  A pointer to the EFI_PCI_IO_PROTOCOL instance.  \r
+                                  \r
+  @retval EFI_SUCCESS           The PCI posted write transactions were flushed from the PCI host\r
+                                bridge to system memory.                                        \r
+  @retval EFI_DEVICE_ERROR      The PCI posted write transactions were not flushed from the PCI\r
+                                host bridge due to a hardware error.                           \r
+                                     \r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_PCI_IO_PROTOCOL_FLUSH) (\r
+  IN EFI_PCI_IO_PROTOCOL  *This\r
+  );\r
+\r
+/**                                                                 \r
+  Retrieves this PCI controller¡¯s current PCI bus number, device number, and function number.\r
+            \r
+  @param  This                  A pointer to the EFI_PCI_IO_PROTOCOL instance.  \r
+  @param  SegmentNumber         The PCI controller¡¯s current PCI segment number.\r
+  @param  BusNumber             The PCI controller¡¯s current PCI bus number.\r
+  @param  DeviceNumber          The PCI controller¡¯s current PCI device number.\r
+  @param  FunctionNumber        The PCI controller¡¯s current PCI function number.\r
+                                  \r
+  @retval EFI_SUCCESS           The PCI controller location was returned.                                                       \r
+  @retval EFI_INVALID_PARAMETER One or more parameters are invalid.                              \r
+                                     \r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_PCI_IO_PROTOCOL_GET_LOCATION) (\r
+  IN EFI_PCI_IO_PROTOCOL          *This,\r
+  OUT UINTN                       *SegmentNumber,\r
+  OUT UINTN                       *BusNumber,\r
+  OUT UINTN                       *DeviceNumber,\r
+  OUT UINTN                       *FunctionNumber\r
+  );\r
+\r
+/**                                                                 \r
+  Performs an operation on the attributes that this PCI controller supports. The operations include\r
+  getting the set of supported attributes, retrieving the current attributes, setting the current  \r
+  attributes, enabling attributes, and disabling attributes.                                       \r
+            \r
+  @param  This                  A pointer to the EFI_PCI_IO_PROTOCOL instance.  \r
+  @param  Operation             The operation to perform on the attributes for this PCI controller.\r
+  @param  Attributes            The mask of attributes that are used for Set, Enable, and Disable\r
+                                operations.                                                      \r
+  @param  Result                A pointer to the result mask of attributes that are returned for the Get\r
+                                and Supported operations.                                               \r
+                                  \r
+  @retval EFI_SUCCESS           The operation on the PCI controller's attributes was completed.\r
+  @retval EFI_INVALID_PARAMETER One or more parameters are invalid.                              \r
+  @retval EFI_UNSUPPORTED       one or more of the bits set in                               \r
+                                Attributes are not supported by this PCI controller or one of\r
+                                its parent bridges when Operation is Set, Enable or Disable.\r
+                                       \r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_PCI_IO_PROTOCOL_ATTRIBUTES) (\r
+  IN EFI_PCI_IO_PROTOCOL                       *This,\r
+  IN  EFI_PCI_IO_PROTOCOL_ATTRIBUTE_OPERATION  Operation,\r
+  IN  UINT64                                   Attributes,\r
+  OUT UINT64                                   *Result OPTIONAL\r
+  );\r
+\r
+/**                                                                 \r
+  Gets the attributes that this PCI controller supports setting on a BAR using\r
+  SetBarAttributes(), and retrieves the list of resource descriptors for a BAR.\r
+            \r
+  @param  This                  A pointer to the EFI_PCI_IO_PROTOCOL instance.  \r
+  @param  BarIndex              The BAR index of the standard PCI Configuration header to use as the\r
+                                base address for resource range. The legal range for this field is 0..5.\r
+  @param  Supports              A pointer to the mask of attributes that this PCI controller supports\r
+                                setting for this BAR with SetBarAttributes().                        \r
+  @param  Resources             A pointer to the ACPI 2.0 resource descriptors that describe the current\r
+                                configuration of this BAR of the PCI controller.                        \r
+                                  \r
+  @retval EFI_SUCCESS           If Supports is not NULL, then the attributes that the PCI       \r
+                                controller supports are returned in Supports. If Resources      \r
+                                is not NULL, then the ACPI 2.0 resource descriptors that the PCI\r
+                                controller is currently using are returned in Resources.          \r
+  @retval EFI_INVALID_PARAMETER Both Supports and Attributes are NULL.\r
+  @retval EFI_UNSUPPORTED       BarIndex not valid for this PCI controller.\r
+  @retval EFI_OUT_OF_RESOURCES  There are not enough resources available to allocate\r
+                                Resources.                                                 \r
+                                \r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_PCI_IO_PROTOCOL_GET_BAR_ATTRIBUTES) (\r
+  IN EFI_PCI_IO_PROTOCOL             *This,\r
+  IN  UINT8                          BarIndex,\r
+  OUT UINT64                         *Supports, OPTIONAL\r
+  OUT VOID                           **Resources OPTIONAL\r
+  );\r
+\r
+/**                                                                 \r
+  Sets the attributes for a range of a BAR on a PCI controller.\r
+            \r
+  @param  This                  A pointer to the EFI_PCI_IO_PROTOCOL instance.  \r
+  @param  Attributes            The mask of attributes to set for the resource range specified by\r
+                                BarIndex, Offset, and Length.                                    \r
+  @param  BarIndex              The BAR index of the standard PCI Configuration header to use as the\r
+                                base address for resource range. The legal range for this field is 0..5.\r
+  @param  Offset                A pointer to the BAR relative base address of the resource range to be\r
+                                modified by the attributes specified by Attributes.                   \r
+  @param  Length                A pointer to the length of the resource range to be modified by the\r
+                                attributes specified by Attributes.                                \r
+                                  \r
+  @retval EFI_SUCCESS           The set of attributes specified by Attributes for the resource      \r
+                                range specified by BarIndex, Offset, and Length were                \r
+                                set on the PCI controller, and the actual resource range is returned\r
+                                in Offset and Length.                                               \r
+  @retval EFI_INVALID_PARAMETER Offset or Length is NULL.\r
+  @retval EFI_UNSUPPORTED       BarIndex not valid for this PCI controller.\r
+  @retval EFI_OUT_OF_RESOURCES  There are not enough resources to set the attributes on the\r
+                                resource range specified by BarIndex, Offset, and          \r
+                                Length.                                                    \r
+                                \r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_PCI_IO_PROTOCOL_SET_BAR_ATTRIBUTES) (\r
+  IN EFI_PCI_IO_PROTOCOL              *This,\r
+  IN     UINT64                       Attributes,\r
+  IN     UINT8                        BarIndex,\r
+  IN OUT UINT64                       *Offset,\r
+  IN OUT UINT64                       *Length\r
+  );\r
+\r
+//\r
+// Interface structure for the PCI I/O Protocol\r
+//\r
+struct _EFI_PCI_IO_PROTOCOL {\r
+  EFI_PCI_IO_PROTOCOL_POLL_IO_MEM         PollMem;\r
+  EFI_PCI_IO_PROTOCOL_POLL_IO_MEM         PollIo;\r
+  EFI_PCI_IO_PROTOCOL_ACCESS              Mem;\r
+  EFI_PCI_IO_PROTOCOL_ACCESS              Io;\r
+  EFI_PCI_IO_PROTOCOL_CONFIG_ACCESS       Pci;\r
+  EFI_PCI_IO_PROTOCOL_COPY_MEM            CopyMem;\r
+  EFI_PCI_IO_PROTOCOL_MAP                 Map;\r
+  EFI_PCI_IO_PROTOCOL_UNMAP               Unmap;\r
+  EFI_PCI_IO_PROTOCOL_ALLOCATE_BUFFER     AllocateBuffer;\r
+  EFI_PCI_IO_PROTOCOL_FREE_BUFFER         FreeBuffer;\r
+  EFI_PCI_IO_PROTOCOL_FLUSH               Flush;\r
+  EFI_PCI_IO_PROTOCOL_GET_LOCATION        GetLocation;\r
+  EFI_PCI_IO_PROTOCOL_ATTRIBUTES          Attributes;\r
+  EFI_PCI_IO_PROTOCOL_GET_BAR_ATTRIBUTES  GetBarAttributes;\r
+  EFI_PCI_IO_PROTOCOL_SET_BAR_ATTRIBUTES  SetBarAttributes;\r
+  UINT64                                  RomSize;\r
+  VOID                                    *RomImage;\r
+};\r
+\r
+extern EFI_GUID gEfiPciIoProtocolGuid;\r
+\r
+#endif\r
diff --git a/Tools/Source/TianoTools/Include/Protocol/PciPlatform.h b/Tools/Source/TianoTools/Include/Protocol/PciPlatform.h
new file mode 100644 (file)
index 0000000..5b0add1
--- /dev/null
@@ -0,0 +1,207 @@
+/** @file\r
+  This file declares PlatfromOpRom protocols.\r
+\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. This program and the accompanying materials                          \r
+  are licensed and made available under the terms and conditions of the BSD License         \r
+  which accompanies this distribution.  The full text of the license may be found at        \r
+  http://opensource.org/licenses/bsd-license.php                                            \r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+  Module Name:  PciPlatform.h\r
+\r
+  @par Revision Reference:\r
+  This protocol is defined in PCI Platform Support Specification\r
+  Version 0.9\r
+\r
+**/\r
+\r
+#ifndef _PCI_PLATFORM_H_\r
+#define _PCI_PLATFORM_H_\r
+\r
+//\r
+// Protocol for GUID.\r
+//\r
+\r
+#define EFI_PCI_PLATFORM_PROTOCOL_GUID \\r
+{ 0x7d75280, 0x27d4, 0x4d69, {0x90, 0xd0, 0x56, 0x43, 0xe2, 0x38, 0xb3, 0x41} }\r
+\r
+typedef struct _EFI_PCI_PLATFORM_PROTOCOL EFI_PCI_PLATFORM_PROTOCOL;\r
+\r
+typedef    UINT32   EFI_PCI_PLATFORM_POLICY;\r
+\r
+\r
+#define     EFI_RESERVE_NONE_IO_ALIAS        0x0000\r
+#define     EFI_RESERVE_ISA_IO_ALIAS         0x0001\r
+#define     EFI_RESERVE_ISA_IO_NO_ALIAS      0x0002\r
+#define     EFI_RESERVE_VGA_IO_ALIAS         0x0004\r
+#define     EFI_RESERVE_VGA_IO_NO_ALIAS      0x0008\r
+\r
+\r
+typedef enum {\r
+  ChipsetEntry,\r
+  ChipsetExit,\r
+  MaximumChipsetPhase\r
+} EFI_PCI_CHIPSET_EXECUTION_PHASE;\r
+\r
+\r
+/**\r
+  The PlatformNotify() function can be used to notify the platform driver so that \r
+  it can perform platform-specific actions. No specific actions are required. \r
+  Eight notification points are defined at this time. More synchronization points \r
+  may be added as required in the future. The PCI bus driver calls the platform driver \r
+  twice for every Phase-once before the PCI Host Bridge Resource Allocation Protocol \r
+  driver is notified, and once after the PCI Host Bridge Resource Allocation Protocol \r
+  driver has been notified. \r
+  This member function may not perform any error checking on the input parameters. It \r
+  also does not return any error codes. If this member function detects any error condition, \r
+  it needs to handle those errors on its own because there is no way to surface any \r
+  errors to the caller.\r
+\r
+  @param  This Pointer to the EFI_PCI_PLATFORM_PROTOCOL instance.\r
+  @param  HostBridge The handle of the host bridge controller.\r
+  @param  Phase The phase of the PCI bus enumeration.\r
+  @param  ChipsetPhase Defines the execution phase of the PCI chipset driver.\r
+\r
+  @retval  EFI_SUCCESS The function completed successfully.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_PCI_PLATFORM_PHASE_NOTIFY) (\r
+  IN EFI_PCI_PLATFORM_PROTOCOL                       *This,\r
+  IN  EFI_HANDLE                                     HostBridge,\r
+  IN  EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PHASE  Phase,\r
+  IN  EFI_PCI_CHIPSET_EXECUTION_PHASE                ChipsetPhase  \r
+)\r
+;\r
+\r
+\r
+/**\r
+  The PlatformPrepController() function can be used to notify the platform driver so that \r
+  it can perform platform-specific actions. No specific actions are required. \r
+  Several notification points are defined at this time. More synchronization points may be \r
+  added as required in the future. The PCI bus driver calls the platform driver twice for \r
+  every PCI controller-once before the PCI Host Bridge Resource Allocation Protocol driver \r
+  is notified, and once after the PCI Host Bridge Resource Allocation Protocol driver has \r
+  been notified. \r
+  This member function may not perform any error checking on the input parameters. It also \r
+  does not return any error codes. If this member function detects any error condition, it \r
+  needs to handle those errors on its own because there is no way to surface any errors to \r
+  the caller.  \r
+\r
+  @param  This Pointer to the EFI_PCI_PLATFORM_PROTOCOL instance.\r
+  @param  HostBridge The associated PCI host bridge handle.\r
+  @param  RootBridge The associated PCI root bridge handle.\r
+  @param  PciAddress The address of the PCI device on the PCI bus.\r
+  @param  Phase The phase of the PCI controller enumeration.\r
+  @param  ChipsetPhase Defines the execution phase of the PCI chipset driver.\r
+\r
+  @retval  EFI_SUCCESS The function completed successfully.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_PCI_PLATFORM_PREPROCESS_CONTROLLER) (\r
+  IN  EFI_PCI_PLATFORM_PROTOCOL                      *This,\r
+  IN  EFI_HANDLE                                     HostBridge,\r
+  IN  EFI_HANDLE                                     RootBridge,\r
+  IN  EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_PCI_ADDRESS    PciAddress,\r
+  IN  EFI_PCI_CONTROLLER_RESOURCE_ALLOCATION_PHASE   Phase,\r
+  IN  EFI_PCI_CHIPSET_EXECUTION_PHASE                ChipsetPhase\r
+)\r
+;\r
+\r
+\r
+/**\r
+  The GetPlatformPolicy() function retrieves the platform policy regarding PCI \r
+  enumeration. The PCI bus driver and the PCI Host Bridge Resource Allocation Protocol \r
+  driver can call this member function to retrieve the policy.\r
+\r
+  @param  This Pointer to the EFI_PCI_PLATFORM_PROTOCOL instance.\r
+  @param  PciPolicy The platform policy with respect to VGA and ISA aliasing.\r
+\r
+  @retval  EFI_SUCCESS The function completed successfully.\r
+  @retval  EFI_INVALID_PARAMETER PciPolicy is NULL.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_PCI_PLATFORM_GET_PLATFORM_POLICY) (\r
+  IN  EFI_PCI_PLATFORM_PROTOCOL           *This,\r
+  OUT EFI_PCI_PLATFORM_POLICY             *PciPolicy\r
+)\r
+;\r
+\r
+\r
+/**\r
+  The GetPciRom() function gets the PCI device's option ROM from a platform-specific location. \r
+  The option ROM will be loaded into memory. This member function is used to return an image \r
+  that is packaged as a PCI 2.2 option ROM. The image may contain both legacy and EFI option \r
+  ROMs. See the EFI 1.10 Specification for details. This member function can be used to return \r
+  option ROM images for embedded controllers. Option ROMs for embedded controllers are typically \r
+  stored in platform-specific storage, and this member function can retrieve it from that storage \r
+  and return it to the PCI bus driver. The PCI bus driver will call this member function before \r
+  scanning the ROM that is attached to any controller, which allows a platform to specify a ROM \r
+  image that is different from the ROM image on a PCI card.\r
+\r
+  @param  This Pointer to the EFI_PCI_PLATFORM_PROTOCOL instance.\r
+  @param  PciHandle The handle of the PCI device.\r
+  @param  RomImage If the call succeeds, the pointer to the pointer to the option ROM image.\r
+  Otherwise, this field is undefined. The memory for RomImage is allocated\r
+  by EFI_PCI_PLATFORM_PROTOCOL.GetPciRom() using the EFI Boot Service AllocatePool().\r
+  It is the caller's responsibility to free the memory using the EFI Boot Service\r
+  FreePool(), when the caller is done with the option ROM.\r
+  @param  RomSize If the call succeeds, a pointer to the size of the option ROM size. Otherwise,\r
+  this field is undefined.\r
+\r
+  @retval  EFI_SUCCESS The option ROM was available for this device and loaded into memory.\r
+  @retval  EFI_NOT_FOUND No option ROM was available for this device.\r
+  @retval  EFI_OUT_OF_RESOURCES No memory was available to load the option ROM.\r
+  @retval  EFI_DEVICE_ERROR An error occurred in getting the option ROM.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_PCI_PLATFORM_GET_PCI_ROM) (        \r
+  IN   EFI_PCI_PLATFORM_PROTOCOL    *This,\r
+  IN   EFI_HANDLE                   PciHandle,\r
+  OUT  VOID                         **RomImage,\r
+  OUT  UINTN                        *RomSize              \r
+)\r
+;\r
+\r
+/**\r
+  @par Protocol Description:\r
+  This protocol provides the interface between the PCI bus driver/PCI Host \r
+  Bridge Resource Allocation driver and a platform-specific driver to describe \r
+  the unique features of a platform.\r
+\r
+  @param PlatformNotify\r
+  The notification from the PCI bus enumerator to the platform that it is \r
+  about to enter a certain phase during the enumeration process.\r
+\r
+  @param PlatformPrepController\r
+  The notification from the PCI bus enumerator to the platform for each PCI \r
+  controller at several predefined points during PCI controller initialization.\r
+\r
+  @param GetPlatformPolicy\r
+  Retrieves the platform policy regarding enumeration.\r
+\r
+  @param GetPciRom\r
+  Gets the PCI device¡¯s option ROM from a platform-specific location.\r
+\r
+**/\r
+struct _EFI_PCI_PLATFORM_PROTOCOL {\r
+  EFI_PCI_PLATFORM_PHASE_NOTIFY          PhaseNotify;\r
+  EFI_PCI_PLATFORM_PREPROCESS_CONTROLLER PlatformPrepController;\r
+  EFI_PCI_PLATFORM_GET_PLATFORM_POLICY   GetPlatformPolicy;\r
+  EFI_PCI_PLATFORM_GET_PCI_ROM           GetPciRom;\r
+};\r
+\r
+extern EFI_GUID   gEfiPciPlatformProtocolGuid;\r
+\r
+\r
+#endif\r
diff --git a/Tools/Source/TianoTools/Include/Protocol/PciRootBridgeIo.h b/Tools/Source/TianoTools/Include/Protocol/PciRootBridgeIo.h
new file mode 100644 (file)
index 0000000..06912da
--- /dev/null
@@ -0,0 +1,384 @@
+/** @file\r
+  PCI Root Bridge I/O protocol as defined in the EFI 1.1 specification.\r
+\r
+  PCI Root Bridge I/O protocol is used by PCI Bus Driver to perform PCI Memory, PCI I/O, \r
+  and PCI Configuration cycles on a PCI Root Bridge. It also provides services to perform \r
+  defferent types of bus mastering DMA\r
+\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. This program and the accompanying materials                          \r
+  are licensed and made available under the terms and conditions of the BSD License         \r
+  which accompanies this distribution.  The full text of the license may be found at        \r
+  http://opensource.org/licenses/bsd-license.php                                            \r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+  Module Name:  PciRootBridgeIo.h\r
+\r
+**/\r
+\r
+#ifndef __PCI_ROOT_BRIDGE_IO_H__\r
+#define __PCI_ROOT_BRIDGE_IO_H__\r
+\r
+#define EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_GUID \\r
+  { \\r
+    0x2f707ebb, 0x4a1a, 0x11d4, {0x9a, 0x38, 0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d } \\r
+  }\r
+\r
+typedef struct _EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL  EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL;\r
+\r
+typedef enum {\r
+  EfiPciWidthUint8,\r
+  EfiPciWidthUint16,\r
+  EfiPciWidthUint32,\r
+  EfiPciWidthUint64,\r
+  EfiPciWidthFifoUint8,\r
+  EfiPciWidthFifoUint16,\r
+  EfiPciWidthFifoUint32,\r
+  EfiPciWidthFifoUint64,\r
+  EfiPciWidthFillUint8,\r
+  EfiPciWidthFillUint16,\r
+  EfiPciWidthFillUint32,\r
+  EfiPciWidthFillUint64,\r
+  EfiPciWidthMaximum\r
+} EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH;\r
+\r
+typedef enum {\r
+  EfiPciOperationBusMasterRead,\r
+  EfiPciOperationBusMasterWrite,\r
+  EfiPciOperationBusMasterCommonBuffer,\r
+  EfiPciOperationBusMasterRead64,\r
+  EfiPciOperationBusMasterWrite64,\r
+  EfiPciOperationBusMasterCommonBuffer64,\r
+  EfiPciOperationMaximum\r
+} EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_OPERATION;\r
+\r
+#define EFI_PCI_ATTRIBUTE_ISA_MOTHERBOARD_IO          0x0001\r
+#define EFI_PCI_ATTRIBUTE_ISA_IO                      0x0002\r
+#define EFI_PCI_ATTRIBUTE_VGA_PALETTE_IO              0x0004\r
+#define EFI_PCI_ATTRIBUTE_VGA_MEMORY                  0x0008\r
+#define EFI_PCI_ATTRIBUTE_VGA_IO                      0x0010\r
+#define EFI_PCI_ATTRIBUTE_IDE_PRIMARY_IO              0x0020\r
+#define EFI_PCI_ATTRIBUTE_IDE_SECONDARY_IO            0x0040\r
+#define EFI_PCI_ATTRIBUTE_MEMORY_WRITE_COMBINE        0x0080\r
+#define EFI_PCI_ATTRIBUTE_MEMORY_CACHED               0x0800\r
+#define EFI_PCI_ATTRIBUTE_MEMORY_DISABLE              0x1000\r
+#define EFI_PCI_ATTRIBUTE_DUAL_ADDRESS_CYCLE          0x8000\r
+\r
+#define EFI_PCI_ATTRIBUTE_VALID_FOR_ALLOCATE_BUFFER   (EFI_PCI_ATTRIBUTE_MEMORY_WRITE_COMBINE | EFI_PCI_ATTRIBUTE_MEMORY_CACHED | EFI_PCI_ATTRIBUTE_DUAL_ADDRESS_CYCLE)\r
+\r
+#define EFI_PCI_ATTRIBUTE_INVALID_FOR_ALLOCATE_BUFFER (~EFI_PCI_ATTRIBUTE_VALID_FOR_ALLOCATE_BUFFER)\r
+\r
+#define EFI_PCI_ADDRESS(bus, dev, func, reg) \\r
+    ((UINT64) ((((UINTN) bus) << 24) + (((UINTN) dev) << 16) + (((UINTN) func) << 8) + ((UINTN) reg)))\r
+\r
+typedef struct {\r
+  UINT8   Register;\r
+  UINT8   Function;\r
+  UINT8   Device;\r
+  UINT8   Bus;\r
+  UINT32  ExtendedRegister;\r
+} EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_PCI_ADDRESS;\r
+\r
+/**                                                                 \r
+  Reads from the I/O space of a PCI Root Bridge. Returns when either the polling exit criteria is\r
+  satisfied or after a defined duration.\r
+          \r
+  @param  This                  A pointer to the EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL.\r
+  @param  Width                 Signifies the width of the memory or I/O operations.\r
+  @param  Address               The base address of the memory or I/O operations.  \r
+  @param  Mask                  Mask used for the polling criteria.\r
+  @param  Value                 The comparison value used for the polling exit criteria.\r
+  @param  Delay                 The number of 100 ns units to poll.\r
+  @param  Result                Pointer to the last value read from the memory location.\r
+                                \r
+  @retval EFI_SUCCESS           The last data returned from the access matched the poll exit criteria.\r
+  @retval EFI_TIMEOUT           Delay expired before a match occurred.\r
+  @retval EFI_OUT_OF_RESOURCES  The request could not be completed due to a lack of resources.\r
+  @retval EFI_INVALID_PARAMETER One or more parameters are invalid.\r
+                                   \r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_POLL_IO_MEM) (\r
+  IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL           *This,\r
+  IN  EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH    Width,\r
+  IN  UINT64                                   Address,\r
+  IN  UINT64                                   Mask,\r
+  IN  UINT64                                   Value,\r
+  IN  UINT64                                   Delay,\r
+  OUT UINT64                                   *Result\r
+  );\r
+\r
+/**                                                                 \r
+  Enables a PCI driver to access PCI controller registers in the PCI root bridge memory space.\r
+          \r
+  @param  This                  A pointer to the EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL.\r
+  @param  Width                 Signifies the width of the memory operations.\r
+  @param  Address               The base address of the memory operations.                                  \r
+  @param  Count                 The number of memory operations to perform.\r
+  @param  Buffer                For read operations, the destination buffer to store the results. For write\r
+                                operations, the source buffer to write data from.                          \r
+  \r
+  @retval EFI_SUCCESS           The data was read from or written to the PCI root bridge.  \r
+  @retval EFI_OUT_OF_RESOURCES  The request could not be completed due to a lack of resources.\r
+  @retval EFI_INVALID_PARAMETER One or more parameters are invalid.\r
+                                   \r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_IO_MEM) (\r
+  IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL              *This,\r
+  IN     EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH    Width,\r
+  IN     UINT64                                   Address,\r
+  IN     UINTN                                    Count,\r
+  IN OUT VOID                                     *Buffer\r
+  );\r
+\r
+typedef struct {\r
+  EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_IO_MEM  Read;\r
+  EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_IO_MEM  Write;\r
+} EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_ACCESS;\r
+\r
+/**                                                                 \r
+  Enables a PCI driver to copy one region of PCI root bridge memory space to another region of PCI\r
+  root bridge memory space.                                                                       \r
+            \r
+  @param  This                  A pointer to the EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL instance.\r
+  @param  Width                 Signifies the width of the memory operations.\r
+  @param  DestAddress           The destination address of the memory operation.                                \r
+  @param  SrcAddress            The source address of the memory operation.                                \r
+  @param  Count                 The number of memory operations to perform.    \r
+                                \r
+  @retval EFI_SUCCESS           The data was copied from one memory region to another memory region.  \r
+  @retval EFI_INVALID_PARAMETER Width is invalid for this PCI root bridge.\r
+  @retval EFI_OUT_OF_RESOURCES  The request could not be completed due to a lack of resources.\r
+                                   \r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_COPY_MEM) (\r
+  IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL              *This,\r
+  IN     EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH    Width,\r
+  IN     UINT64                                   DestAddress,\r
+  IN     UINT64                                   SrcAddress,\r
+  IN     UINTN                                    Count\r
+  );\r
+\r
+/**                                                                 \r
+  Provides the PCI controller¨Cspecific addresses required to access system memory from a\r
+  DMA bus master.                                                                        \r
+            \r
+  @param  This                  A pointer to the EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL.\r
+  @param  Operation             Indicates if the bus master is going to read or write to system memory.\r
+  @param  HostAddress           The system memory address to map to the PCI controller.\r
+  @param  NumberOfBytes         On input the number of bytes to map. On output the number of bytes\r
+                                that were mapped.                                                 \r
+  @param  DeviceAddress         The resulting map address for the bus master PCI controller to use to\r
+                                access the hosts HostAddress.                                        \r
+  @param  Mapping               A resulting value to pass to Unmap().\r
+                                  \r
+  @retval EFI_SUCCESS           The range was mapped for the returned NumberOfBytes.\r
+  @retval EFI_UNSUPPORTED       The HostAddress cannot be mapped as a common buffer.                                \r
+  @retval EFI_INVALID_PARAMETER One or more parameters are invalid.\r
+  @retval EFI_OUT_OF_RESOURCES  The request could not be completed due to a lack of resources.\r
+  @retval EFI_DEVICE_ERROR      The system hardware could not map the requested address.\r
+                                   \r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_MAP) (\r
+  IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL                *This,\r
+  IN     EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_OPERATION  Operation,\r
+  IN     VOID                                       *HostAddress,\r
+  IN OUT UINTN                                      *NumberOfBytes,\r
+  OUT    EFI_PHYSICAL_ADDRESS                       *DeviceAddress,\r
+  OUT    VOID                                       **Mapping\r
+  );\r
+\r
+/**                                                                 \r
+  Completes the Map() operation and releases any corresponding resources.\r
+            \r
+  @param  This                  A pointer to the EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL.\r
+  @param  Mapping               The mapping value returned from Map().\r
+                                  \r
+  @retval EFI_SUCCESS           The range was unmapped.\r
+  @retval EFI_INVALID_PARAMETER Mapping is not a value that was returned by Map().\r
+  @retval EFI_DEVICE_ERROR      The data was not committed to the target system memory.\r
+                                   \r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_UNMAP) (\r
+  IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL           *This,\r
+  IN  VOID                                     *Mapping\r
+  );\r
+\r
+/**                                                                 \r
+  Allocates pages that are suitable for an EfiPciOperationBusMasterCommonBuffer or\r
+  EfiPciOperationBusMasterCommonBuffer64 mapping.                                 \r
+            \r
+  @param  This                  A pointer to the EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL.\r
+  @param  Type                  This parameter is not used and must be ignored.\r
+  @param  MemoryType            The type of memory to allocate, EfiBootServicesData or\r
+                                EfiRuntimeServicesData.                               \r
+  @param  Pages                 The number of pages to allocate.                                \r
+  @param  HostAddress           A pointer to store the base system memory address of the\r
+                                allocated range.                                        \r
+  @param  Attributes            The requested bit mask of attributes for the allocated range.\r
+                                  \r
+  @retval EFI_SUCCESS           The requested memory pages were allocated.\r
+  @retval EFI_UNSUPPORTED       Attributes is unsupported. The only legal attribute bits are\r
+                                MEMORY_WRITE_COMBINE and MEMORY_CACHED.                     \r
+  @retval EFI_INVALID_PARAMETER One or more parameters are invalid.\r
+  @retval EFI_OUT_OF_RESOURCES  The memory pages could not be allocated.  \r
+                                   \r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_ALLOCATE_BUFFER) (\r
+  IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL              *This,\r
+  IN     EFI_ALLOCATE_TYPE                        Type,\r
+  IN     EFI_MEMORY_TYPE                          MemoryType,\r
+  IN     UINTN                                    Pages,\r
+  IN OUT VOID                                     **HostAddress,\r
+  IN     UINT64                                   Attributes\r
+  );\r
+\r
+/**                                                                 \r
+  Frees memory that was allocated with AllocateBuffer().\r
+            \r
+  @param  This                  A pointer to the EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL.\r
+  @param  Pages                 The number of pages to free.                                \r
+  @param  HostAddress           The base system memory address of the allocated range.                                    \r
+                                  \r
+  @retval EFI_SUCCESS           The requested memory pages were freed.\r
+  @retval EFI_INVALID_PARAMETER The memory range specified by HostAddress and Pages\r
+                                was not allocated with AllocateBuffer().\r
+                                     \r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_FREE_BUFFER) (\r
+  IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL           *This,\r
+  IN  UINTN                                    Pages,\r
+  IN  VOID                                     *HostAddress\r
+  );\r
+\r
+/**                                                                 \r
+  Flushes all PCI posted write transactions from a PCI host bridge to system memory.\r
+            \r
+  @param  This                  A pointer to the EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL.\r
+                                  \r
+  @retval EFI_SUCCESS           The PCI posted write transactions were flushed from the PCI host\r
+                                bridge to system memory.                                        \r
+  @retval EFI_DEVICE_ERROR      The PCI posted write transactions were not flushed from the PCI\r
+                                host bridge due to a hardware error.                           \r
+                                     \r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_FLUSH) (\r
+  IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL  *This\r
+  );\r
+\r
+/**                                                                 \r
+  Gets the attributes that a PCI root bridge supports setting with SetAttributes(), and the\r
+  attributes that a PCI root bridge is currently using.                                    \r
+            \r
+  @param  This                  A pointer to the EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL.\r
+  @param  Supports              A pointer to the mask of attributes that this PCI root bridge supports\r
+                                setting with SetAttributes().                                         \r
+  @param  Attributes            A pointer to the mask of attributes that this PCI root bridge is currently\r
+                                using.                                                                      \r
+                                \r
+  @retval EFI_SUCCESS           If Supports is not NULL, then the attributes that the PCI root     \r
+                                bridge supports is returned in Supports. If Attributes is          \r
+                                not NULL, then the attributes that the PCI root bridge is currently\r
+                                using is returned in Attributes.                                   \r
+  @retval EFI_INVALID_PARAMETER Both Supports and Attributes are NULL.\r
+                                \r
+                                     \r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_GET_ATTRIBUTES) (\r
+  IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL           *This,\r
+  OUT UINT64                                   *Supports,\r
+  OUT UINT64                                   *Attributes\r
+  );\r
+\r
+/**                                                                 \r
+  Sets attributes for a resource range on a PCI root bridge.\r
+            \r
+  @param  This                  A pointer to the EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL.\r
+  @param  Attributes            The mask of attributes to set.\r
+  @param  ResourceBase          A pointer to the base address of the resource range to be modified by the\r
+                                attributes specified by Attributes.\r
+  @param  ResourceLength        A pointer to the length of the resource range to be modified by the\r
+                                attributes specified by Attributes.                                                                                                              \r
+                                \r
+  @retval EFI_SUCCESS           The set of attributes specified by Attributes for the resource   \r
+                                range specified by ResourceBase and ResourceLength               \r
+                                were set on the PCI root bridge, and the actual resource range is\r
+                                returned in ResuourceBase and ResourceLength.                    \r
+  @retval EFI_UNSUPPORTED       A bit is set in Attributes that is not supported by the PCI Root\r
+                                Bridge.                                                         \r
+  @retval EFI_OUT_OF_RESOURCES  There are not enough resources to set the attributes on the                              \r
+                                resource range specified by BaseAddress and Length.        \r
+  @retval EFI_INVALID_PARAMETER One or more parameters are invalid.                               \r
+                                     \r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_SET_ATTRIBUTES) (\r
+  IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL              *This,\r
+  IN     UINT64                                   Attributes,\r
+  IN OUT UINT64                                   *ResourceBase,\r
+  IN OUT UINT64                                   *ResourceLength\r
+  );\r
+\r
+/**                                                                 \r
+  Retrieves the current resource settings of this PCI root bridge in the form of a set of ACPI 2.0\r
+  resource descriptors.                                                                           \r
+            \r
+  @param  This                  A pointer to the EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL.\r
+  @param  Resources             A pointer to the ACPI 2.0 resource descriptors that describe the current\r
+                                configuration of this PCI root bridge.                                  \r
+                                \r
+  @retval EFI_SUCCESS           The current configuration of this PCI root bridge was returned in\r
+                                Resources.                                                                                                                       \r
+  @retval EFI_UNSUPPORTED       The current configuration of this PCI root bridge could not be\r
+                                retrieved.                                                                          \r
+                                       \r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_CONFIGURATION) (\r
+  IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL           *This,\r
+  IN  VOID                                     **Resources\r
+  );\r
+\r
+struct _EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL {\r
+  EFI_HANDLE                                      ParentHandle;\r
+  EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_POLL_IO_MEM     PollMem;\r
+  EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_POLL_IO_MEM     PollIo;\r
+  EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_ACCESS          Mem;\r
+  EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_ACCESS          Io;\r
+  EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_ACCESS          Pci;\r
+  EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_COPY_MEM        CopyMem;\r
+  EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_MAP             Map;\r
+  EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_UNMAP           Unmap;\r
+  EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_ALLOCATE_BUFFER AllocateBuffer;\r
+  EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_FREE_BUFFER     FreeBuffer;\r
+  EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_FLUSH           Flush;\r
+  EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_GET_ATTRIBUTES  GetAttributes;\r
+  EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_SET_ATTRIBUTES  SetAttributes;\r
+  EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_CONFIGURATION   Configuration;\r
+  UINT32                                          SegmentNumber;\r
+};\r
+\r
+extern EFI_GUID gEfiPciRootBridgeIoProtocolGuid;\r
+\r
+#endif\r
diff --git a/Tools/Source/TianoTools/Include/Protocol/PlatformDriverOverride.h b/Tools/Source/TianoTools/Include/Protocol/PlatformDriverOverride.h
new file mode 100644 (file)
index 0000000..1015c50
--- /dev/null
@@ -0,0 +1,135 @@
+/** @file\r
+  Platform Driver Override protocol as defined in the EFI 1.1 specification.\r
+\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. This program and the accompanying materials                          \r
+  are licensed and made available under the terms and conditions of the BSD License         \r
+  which accompanies this distribution.  The full text of the license may be found at        \r
+  http://opensource.org/licenses/bsd-license.php                                            \r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+  Module Name:  PlatformDriverOverride.h\r
+\r
+**/\r
+\r
+#ifndef __EFI_PLATFORM_DRIVER_OVERRIDE_PROTOCOL_H__\r
+#define __EFI_PLATFORM_DRIVER_OVERRIDE_PROTOCOL_H__\r
+\r
+//\r
+// Global ID for the Platform Driver Override Protocol\r
+//\r
+#define EFI_PLATFORM_DRIVER_OVERRIDE_PROTOCOL_GUID \\r
+  { \\r
+    0x6b30c738, 0xa391, 0x11d4, {0x9a, 0x3b, 0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d } \\r
+  }\r
+\r
+typedef struct _EFI_PLATFORM_DRIVER_OVERRIDE_PROTOCOL  EFI_PLATFORM_DRIVER_OVERRIDE_PROTOCOL;\r
+\r
+//\r
+// Prototypes for the Platform Driver Override Protocol\r
+//\r
+\r
+/**                                                                 \r
+  Retrieves the image handle of the platform override driver for a controller in the system.\r
+    \r
+  @param  This                  A pointer to the EFI_PLATFORM_DRIVER_OVERRIDE_\r
+                                PROTOCOL instance.                            \r
+  @param  ControllerHandle      The device handle of the controller to check if a driver override\r
+                                exists.                                                          \r
+  @param  DriverImageHandle     On input, a pointer to the previous driver image handle returned\r
+                                by GetDriver(). On output, a pointer to the next driver         \r
+                                image handle.                                                   \r
+                                \r
+  @retval EFI_SUCCESS           The driver override for ControllerHandle was returned in\r
+                                DriverImageHandle.                                      \r
+  @retval EFI_NOT_FOUND         A driver override for ControllerHandle was not found.\r
+  @retval EFI_INVALID_PARAMETER The handle specified by ControllerHandle is not a valid handle.\r
+  @retval EFI_INVALID_PARAMETER DriverImageHandle is not a handle that was returned on a\r
+                                previous call to GetDriver().                           \r
+                                   \r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_PLATFORM_DRIVER_OVERRIDE_GET_DRIVER) (\r
+  IN EFI_PLATFORM_DRIVER_OVERRIDE_PROTOCOL              *This,\r
+  IN     EFI_HANDLE                                     ControllerHandle,\r
+  IN OUT EFI_HANDLE                                     *DriverImageHandle\r
+  );\r
+\r
+/**                                                                 \r
+  Retrieves the device path of the platform override driver for a controller in the system.\r
+    \r
+  @param  This                  A pointer to the EFI_PLATFORM_DRIVER_OVERRIDE_\r
+                                PROTOCOL instance.                            \r
+  @param  ControllerHandle      The device handle of the controller to check if a driver override\r
+                                exists.                                                          \r
+  @param  DriverImageHandle     On input, a pointer to the previous driver image handle returned\r
+                                by GetDriverPath(). On output, a pointer to the next driver         \r
+                                device path.\r
+                                \r
+  @retval EFI_SUCCESS           The driver override for ControllerHandle was returned in\r
+                                DriverImageHandle.                                      \r
+  @retval EFI_UNSUPPORTED       The operation is not supported.                                \r
+  @retval EFI_NOT_FOUND         A driver override for ControllerHandle was not found.\r
+  @retval EFI_INVALID_PARAMETER The handle specified by ControllerHandle is not a valid handle.\r
+  @retval EFI_INVALID_PARAMETER DriverImagePath is not a device path that was returned on a\r
+                                previous call to GetDriverPath().                          \r
+                                   \r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_PLATFORM_DRIVER_OVERRIDE_GET_DRIVER_PATH) (\r
+  IN EFI_PLATFORM_DRIVER_OVERRIDE_PROTOCOL              *This,\r
+  IN     EFI_HANDLE                                     ControllerHandle,\r
+  IN OUT EFI_DEVICE_PATH_PROTOCOL                       **DriverImagePath\r
+  );\r
+\r
+/**                                                                 \r
+  Used to associate a driver image handle with a device path that was returned on a prior call to the\r
+  GetDriverPath() service. This driver image handle will then be available through the               \r
+  GetDriver() service.                                                                               \r
+    \r
+  @param  This                  A pointer to the EFI_PLATFORM_DRIVER_OVERRIDE_\r
+                                PROTOCOL instance.                            \r
+  @param  ControllerHandle      The device handle of the controller.                                                             \r
+  @param  DriverImagePath       A pointer to the driver device path that was returned in a prior\r
+                                call to GetDriverPath().                                                                        \r
+  @param  DriverImageHandle     The driver image handle that was returned by LoadImage()\r
+                                when the driver specified by DriverImagePath was loaded \r
+                                into memory.                                            \r
+                                \r
+  @retval EFI_SUCCESS           The association between DriverImagePath and                   \r
+                                DriverImageHandle was established for the controller specified\r
+                                by ControllerHandle.                                                                            \r
+  @retval EFI_UNSUPPORTED       The operation is not supported.                                \r
+  @retval EFI_NOT_FOUND         DriverImagePath is not a device path that was returned on a prior\r
+                                call to GetDriverPath() for the controller specified by          \r
+                                ControllerHandle.                                                \r
+  @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid device handle.\r
+  @retval EFI_INVALID_PARAMETER DriverImagePath is not a valid device path.\r
+  @retval EFI_INVALID_PARAMETER DriverImageHandle is not a valid image handle.\r
+                                   \r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_PLATFORM_DRIVER_OVERRIDE_DRIVER_LOADED) (\r
+  IN EFI_PLATFORM_DRIVER_OVERRIDE_PROTOCOL          *This,\r
+  IN EFI_HANDLE                                     ControllerHandle,\r
+  IN EFI_DEVICE_PATH_PROTOCOL                       *DriverImagePath,\r
+  IN EFI_HANDLE                                     DriverImageHandle\r
+  );\r
+\r
+//\r
+// Interface structure for the Platform Driver Override Protocol\r
+//\r
+struct _EFI_PLATFORM_DRIVER_OVERRIDE_PROTOCOL {\r
+  EFI_PLATFORM_DRIVER_OVERRIDE_GET_DRIVER       GetDriver;\r
+  EFI_PLATFORM_DRIVER_OVERRIDE_GET_DRIVER_PATH  GetDriverPath;\r
+  EFI_PLATFORM_DRIVER_OVERRIDE_DRIVER_LOADED    DriverLoaded;\r
+};\r
+\r
+extern EFI_GUID gEfiPlatformDriverOverrideProtocolGuid;\r
+\r
+#endif\r
diff --git a/Tools/Source/TianoTools/Include/Protocol/PxeBaseCode.h b/Tools/Source/TianoTools/Include/Protocol/PxeBaseCode.h
new file mode 100644 (file)
index 0000000..14a6848
--- /dev/null
@@ -0,0 +1,622 @@
+/** @file\r
+  EFI PXE Base Code Protocol definitions.\r
+\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. This program and the accompanying materials                          \r
+  are licensed and made available under the terms and conditions of the BSD License         \r
+  which accompanies this distribution.  The full text of the license may be found at        \r
+  http://opensource.org/licenses/bsd-license.php                                            \r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+  Module Name:  PxeBaseCode.h\r
+\r
+**/\r
+#ifndef __PXE_BASE_CODE_PROTOCOL_H__\r
+#define __PXE_BASE_CODE_PROTOCOL_H__\r
+\r
+//\r
+// PXE Base Code protocol\r
+//\r
+#define EFI_PXE_BASE_CODE_PROTOCOL_GUID \\r
+  { \\r
+    0x03c4e603, 0xac28, 0x11d3, {0x9a, 0x2d, 0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d } \\r
+  }\r
+\r
+typedef struct _EFI_PXE_BASE_CODE_PROTOCOL EFI_PXE_BASE_CODE_PROTOCOL;\r
+\r
+//\r
+// Default IP TTL and ToS.\r
+//\r
+#define DEFAULT_TTL 16\r
+#define DEFAULT_ToS 0\r
+\r
+//\r
+// ICMP error format\r
+//\r
+typedef struct {\r
+  UINT8   Type;\r
+  UINT8   Code;\r
+  UINT16  Checksum;\r
+  union {\r
+    UINT32  reserved;\r
+    UINT32  Mtu;\r
+    UINT32  Pointer;\r
+    struct {\r
+      UINT16  Identifier;\r
+      UINT16  Sequence;\r
+    } Echo;\r
+  } u;\r
+  UINT8 Data[494];\r
+} EFI_PXE_BASE_CODE_ICMP_ERROR;\r
+\r
+//\r
+// TFTP error format\r
+//\r
+typedef struct {\r
+  UINT8 ErrorCode;\r
+  CHAR8 ErrorString[127];\r
+} EFI_PXE_BASE_CODE_TFTP_ERROR;\r
+\r
+//\r
+// IP Receive Filter definitions\r
+//\r
+#define EFI_PXE_BASE_CODE_MAX_IPCNT 8\r
+\r
+typedef struct {\r
+  UINT8           Filters;\r
+  UINT8           IpCnt;\r
+  UINT16          reserved;\r
+  EFI_IP_ADDRESS  IpList[EFI_PXE_BASE_CODE_MAX_IPCNT];\r
+} EFI_PXE_BASE_CODE_IP_FILTER;\r
+\r
+#define EFI_PXE_BASE_CODE_IP_FILTER_STATION_IP            0x0001\r
+#define EFI_PXE_BASE_CODE_IP_FILTER_BROADCAST             0x0002\r
+#define EFI_PXE_BASE_CODE_IP_FILTER_PROMISCUOUS           0x0004\r
+#define EFI_PXE_BASE_CODE_IP_FILTER_PROMISCUOUS_MULTICAST 0x0008\r
+\r
+//\r
+// ARP Cache definitions\r
+//\r
+typedef struct {\r
+  EFI_IP_ADDRESS  IpAddr;\r
+  EFI_MAC_ADDRESS MacAddr;\r
+} EFI_PXE_BASE_CODE_ARP_ENTRY;\r
+\r
+typedef struct {\r
+  EFI_IP_ADDRESS  IpAddr;\r
+  EFI_IP_ADDRESS  SubnetMask;\r
+  EFI_IP_ADDRESS  GwAddr;\r
+} EFI_PXE_BASE_CODE_ROUTE_ENTRY;\r
+\r
+//\r
+// UDP definitions\r
+//\r
+typedef UINT16  EFI_PXE_BASE_CODE_UDP_PORT;\r
+\r
+#define EFI_PXE_BASE_CODE_UDP_OPFLAGS_ANY_SRC_IP    0x0001\r
+#define EFI_PXE_BASE_CODE_UDP_OPFLAGS_ANY_SRC_PORT  0x0002\r
+#define EFI_PXE_BASE_CODE_UDP_OPFLAGS_ANY_DEST_IP   0x0004\r
+#define EFI_PXE_BASE_CODE_UDP_OPFLAGS_ANY_DEST_PORT 0x0008\r
+#define EFI_PXE_BASE_CODE_UDP_OPFLAGS_USE_FILTER    0x0010\r
+#define EFI_PXE_BASE_CODE_UDP_OPFLAGS_MAY_FRAGMENT  0x0020\r
+\r
+//\r
+// Discover() definitions\r
+//\r
+#define EFI_PXE_BASE_CODE_BOOT_TYPE_BOOTSTRAP         0\r
+#define EFI_PXE_BASE_CODE_BOOT_TYPE_MS_WINNT_RIS      1\r
+#define EFI_PXE_BASE_CODE_BOOT_TYPE_INTEL_LCM         2\r
+#define EFI_PXE_BASE_CODE_BOOT_TYPE_DOSUNDI           3\r
+#define EFI_PXE_BASE_CODE_BOOT_TYPE_NEC_ESMPRO        4\r
+#define EFI_PXE_BASE_CODE_BOOT_TYPE_IBM_WSoD          5\r
+#define EFI_PXE_BASE_CODE_BOOT_TYPE_IBM_LCCM          6\r
+#define EFI_PXE_BASE_CODE_BOOT_TYPE_CA_UNICENTER_TNG  7\r
+#define EFI_PXE_BASE_CODE_BOOT_TYPE_HP_OPENVIEW       8\r
+#define EFI_PXE_BASE_CODE_BOOT_TYPE_ALTIRIS_9         9\r
+#define EFI_PXE_BASE_CODE_BOOT_TYPE_ALTIRIS_10        10\r
+#define EFI_PXE_BASE_CODE_BOOT_TYPE_ALTIRIS_11        11\r
+#define EFI_PXE_BASE_CODE_BOOT_TYPE_NOT_USED_12       12\r
+#define EFI_PXE_BASE_CODE_BOOT_TYPE_REDHAT_INSTALL    13\r
+#define EFI_PXE_BASE_CODE_BOOT_TYPE_REDHAT_BOOT       14\r
+#define EFI_PXE_BASE_CODE_BOOT_TYPE_REMBO             15\r
+#define EFI_PXE_BASE_CODE_BOOT_TYPE_BEOBOOT           16\r
+//\r
+// 17 through 32767 are reserved\r
+// 32768 through 65279 are for vendor use\r
+// 65280 through 65534 are reserved\r
+//\r
+#define EFI_PXE_BASE_CODE_BOOT_TYPE_PXETEST   65535\r
+\r
+#define EFI_PXE_BASE_CODE_BOOT_LAYER_MASK     0x7FFF\r
+#define EFI_PXE_BASE_CODE_BOOT_LAYER_INITIAL  0x0000\r
+\r
+//\r
+// Discover() server list structure.\r
+//\r
+typedef struct {\r
+  UINT16          Type;\r
+  BOOLEAN         AcceptAnyResponse;\r
+  UINT8           Reserved;\r
+  EFI_IP_ADDRESS  IpAddr;\r
+} EFI_PXE_BASE_CODE_SRVLIST;\r
+\r
+//\r
+// Discover() information override structure.\r
+//\r
+typedef struct {\r
+  BOOLEAN                   UseMCast;\r
+  BOOLEAN                   UseBCast;\r
+  BOOLEAN                   UseUCast;\r
+  BOOLEAN                   MustUseList;\r
+  EFI_IP_ADDRESS            ServerMCastIp;\r
+  UINT16                    IpCnt;\r
+  EFI_PXE_BASE_CODE_SRVLIST SrvList[1];\r
+} EFI_PXE_BASE_CODE_DISCOVER_INFO;\r
+\r
+//\r
+// Mtftp() definitions\r
+//\r
+typedef enum {\r
+  EFI_PXE_BASE_CODE_TFTP_FIRST,\r
+  EFI_PXE_BASE_CODE_TFTP_GET_FILE_SIZE,\r
+  EFI_PXE_BASE_CODE_TFTP_READ_FILE,\r
+  EFI_PXE_BASE_CODE_TFTP_WRITE_FILE,\r
+  EFI_PXE_BASE_CODE_TFTP_READ_DIRECTORY,\r
+  EFI_PXE_BASE_CODE_MTFTP_GET_FILE_SIZE,\r
+  EFI_PXE_BASE_CODE_MTFTP_READ_FILE,\r
+  EFI_PXE_BASE_CODE_MTFTP_READ_DIRECTORY,\r
+  EFI_PXE_BASE_CODE_MTFTP_LAST\r
+} EFI_PXE_BASE_CODE_TFTP_OPCODE;\r
+\r
+typedef struct {\r
+  EFI_IP_ADDRESS              MCastIp;\r
+  EFI_PXE_BASE_CODE_UDP_PORT  CPort;\r
+  EFI_PXE_BASE_CODE_UDP_PORT  SPort;\r
+  UINT16                      ListenTimeout;\r
+  UINT16                      TransmitTimeout;\r
+} EFI_PXE_BASE_CODE_MTFTP_INFO;\r
+\r
+//\r
+// PXE Base Code Mode structure\r
+//\r
+#define EFI_PXE_BASE_CODE_MAX_ARP_ENTRIES   8\r
+#define EFI_PXE_BASE_CODE_MAX_ROUTE_ENTRIES 8\r
+\r
+typedef struct {\r
+  BOOLEAN                       Started;\r
+  BOOLEAN                       Ipv6Available;\r
+  BOOLEAN                       Ipv6Supported;\r
+  BOOLEAN                       UsingIpv6;\r
+  BOOLEAN                       BisSupported;\r
+  BOOLEAN                       BisDetected;\r
+  BOOLEAN                       AutoArp;\r
+  BOOLEAN                       SendGUID;\r
+  BOOLEAN                       DhcpDiscoverValid;\r
+  BOOLEAN                       DhcpAckReceived;\r
+  BOOLEAN                       ProxyOfferReceived;\r
+  BOOLEAN                       PxeDiscoverValid;\r
+  BOOLEAN                       PxeReplyReceived;\r
+  BOOLEAN                       PxeBisReplyReceived;\r
+  BOOLEAN                       IcmpErrorReceived;\r
+  BOOLEAN                       TftpErrorReceived;\r
+  BOOLEAN                       MakeCallbacks;\r
+  UINT8                         TTL;\r
+  UINT8                         ToS;\r
+  EFI_IP_ADDRESS                StationIp;\r
+  EFI_IP_ADDRESS                SubnetMask;\r
+  EFI_PXE_BASE_CODE_PACKET      DhcpDiscover;\r
+  EFI_PXE_BASE_CODE_PACKET      DhcpAck;\r
+  EFI_PXE_BASE_CODE_PACKET      ProxyOffer;\r
+  EFI_PXE_BASE_CODE_PACKET      PxeDiscover;\r
+  EFI_PXE_BASE_CODE_PACKET      PxeReply;\r
+  EFI_PXE_BASE_CODE_PACKET      PxeBisReply;\r
+  EFI_PXE_BASE_CODE_IP_FILTER   IpFilter;\r
+  UINT32                        ArpCacheEntries;\r
+  EFI_PXE_BASE_CODE_ARP_ENTRY   ArpCache[EFI_PXE_BASE_CODE_MAX_ARP_ENTRIES];\r
+  UINT32                        RouteTableEntries;\r
+  EFI_PXE_BASE_CODE_ROUTE_ENTRY RouteTable[EFI_PXE_BASE_CODE_MAX_ROUTE_ENTRIES];\r
+  EFI_PXE_BASE_CODE_ICMP_ERROR  IcmpError;\r
+  EFI_PXE_BASE_CODE_TFTP_ERROR  TftpError;\r
+} EFI_PXE_BASE_CODE_MODE;\r
+\r
+//\r
+// PXE Base Code Interface Function definitions\r
+//\r
+\r
+/**                                                                 \r
+  Enables the use of the PXE Base Code Protocol functions.\r
+    \r
+  @param  This                  Pointer to the EFI_PXE_BASE_CODE_PROTOCOL instance.\r
+  @param  UseIpv6               Specifies the type of IP addresses that are to be used during the session\r
+                                that is being started. Set to TRUE for IPv6 addresses, and FALSE for     \r
+                                IPv4 addresses.                                                                                                   \r
+                                \r
+  @retval EFI_SUCCESS           The PXE Base Code Protocol was started.\r
+  @retval EFI_DEVICE_ERROR      The network device encountered an error during this oper  \r
+  @retval EFI_UNSUPPORTED       UseIpv6 is TRUE, but the Ipv6Supported field of the\r
+                                EFI_PXE_BASE_CODE_MODE structure is FALSE.  \r
+  @retval EFI_ALREADY_STARTED   The PXE Base Code Protocol is already in the started state.                                   \r
+  @retval EFI_INVALID_PARAMETER The This parameter is NULL or does not point to a valid\r
+                                EFI_PXE_BASE_CODE_PROTOCOL structure.      \r
+  @retval EFI_OUT_OF_RESOURCES  Could not allocate enough memory or other resources to start the                                          \r
+                                PXE Base Code Protocol.                                         \r
+                                     \r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_PXE_BASE_CODE_START) (\r
+  IN EFI_PXE_BASE_CODE_PROTOCOL            *This,\r
+  IN BOOLEAN                               UseIpv6\r
+  );\r
+\r
+/**                                                                 \r
+  Disables the use of the PXE Base Code Protocol functions.\r
+    \r
+  @param  This                  Pointer to the EFI_PXE_BASE_CODE_PROTOCOL instance.\r
\r
+  @retval EFI_SUCCESS           The PXE Base Code Protocol was stopped.\r
+  @retval EFI_NOT_STARTED       The PXE Base Code Protocol is already in the stopped state.  \r
+  @retval EFI_INVALID_PARAMETER The This parameter is NULL or does not point to a valid\r
+                                EFI_PXE_BASE_CODE_PROTOCOL structure.                  \r
+  @retval EFI_DEVICE_ERROR      The network device encountered an error during this operation.                                \r
+                                     \r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_PXE_BASE_CODE_STOP) (\r
+  IN EFI_PXE_BASE_CODE_PROTOCOL    *This\r
+  );\r
+\r
+/**                                                                 \r
+  Attempts to complete a DHCPv4 D.O.R.A. (discover / offer / request / acknowledge) or DHCPv6\r
+  S.A.R.R (solicit / advertise / request / reply) sequence.\r
+    \r
+  @param  This                  Pointer to the EFI_PXE_BASE_CODE_PROTOCOL instance.\r
+  @param  SortOffers            TRUE if the offers received should be sorted. Set to FALSE to try the\r
+                                offers in the order that they are received.                          \r
\r
+  @retval EFI_SUCCESS           Valid DHCP has completed.\r
+  @retval EFI_NOT_STARTED       The PXE Base Code Protocol is in the stopped state.\r
+  @retval EFI_INVALID_PARAMETER The This parameter is NULL or does not point to a valid\r
+                                EFI_PXE_BASE_CODE_PROTOCOL structure.                  \r
+  @retval EFI_DEVICE_ERROR      The network device encountered an error during this operation.                                \r
+  @retval EFI_OUT_OF_RESOURCES  Could not allocate enough memory to complete the DHCP Protocol.\r
+  @retval EFI_ABORTED           The callback function aborted the DHCP Protocol.\r
+  @retval EFI_TIMEOUT           The DHCP Protocol timed out.\r
+  @retval EFI_ICMP_ERROR        An ICMP error packet was received during the DHCP session.\r
+  @retval EFI_NO_RESPONSE       Valid PXE offer was not received.\r
+                                     \r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_PXE_BASE_CODE_DHCP) (\r
+  IN EFI_PXE_BASE_CODE_PROTOCOL            *This,\r
+  IN BOOLEAN                               SortOffers\r
+  );\r
+\r
+/**                                                                 \r
+  Attempts to complete the PXE Boot Server and/or boot image discovery sequence.\r
+    \r
+  @param  This                  Pointer to the EFI_PXE_BASE_CODE_PROTOCOL instance.\r
+  @param  Type                  The type of bootstrap to perform.\r
+  @param  Layer                 Pointer to the boot server layer number to discover, which must be\r
+                                PXE_BOOT_LAYER_INITIAL when a new server type is being            \r
+                                discovered.                                                       \r
+  @param  UseBis                TRUE if Boot Integrity Services are to be used. FALSE otherwise.                                \r
+  @param  Info                  Pointer to a data structure that contains additional information on the\r
+                                type of discovery operation that is to be performed.                   \r
+                                  \r
+  @retval EFI_SUCCESS           The Discovery sequence has been completed.\r
+  @retval EFI_NOT_STARTED       The PXE Base Code Protocol is in the stopped state.\r
+  @retval EFI_INVALID_PARAMETER One or more parameters are invalid.                                \r
+  @retval EFI_DEVICE_ERROR      The network device encountered an error during this operation.                                \r
+  @retval EFI_OUT_OF_RESOURCES  Could not allocate enough memory to complete Discovery.\r
+  @retval EFI_ABORTED           The callback function aborted the Discovery sequence.\r
+  @retval EFI_TIMEOUT           The Discovery sequence timed out.\r
+  @retval EFI_ICMP_ERROR        An ICMP error packet was received during the PXE discovery\r
+                                session.                                                  \r
+                                       \r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_PXE_BASE_CODE_DISCOVER) (\r
+  IN EFI_PXE_BASE_CODE_PROTOCOL           *This,\r
+  IN UINT16                               Type,\r
+  IN UINT16                               *Layer,\r
+  IN BOOLEAN                              UseBis,\r
+  IN EFI_PXE_BASE_CODE_DISCOVER_INFO      *Info   OPTIONAL\r
+  );\r
+\r
+/**                                                                 \r
+  Used to perform TFTP and MTFTP services.\r
+    \r
+  @param  This                  Pointer to the EFI_PXE_BASE_CODE_PROTOCOL instance.\r
+  @param  Operation             The type of operation to perform.\r
+  @param  BufferPtr             A pointer to the data buffer.                                                                     \r
+  @param  Overwrite             Only used on write file operations. TRUE if a file on a remote server can\r
+                                be overwritten.                                                          \r
+  @param  BufferSize            For get-file-size operations, *BufferSize returns the size of the\r
+                                requested file.                                                  \r
+  @param  BlockSize             The requested block size to be used during a TFTP transfer.\r
+  @param  ServerIp              The TFTP / MTFTP server IP address.\r
+  @param  Filename              A Null-terminated ASCII string that specifies a directory name or a file\r
+                                name.                                                                   \r
+  @param  Info                  Pointer to the MTFTP information.\r
+  @param  DontUseBuffer         Set to FALSE for normal TFTP and MTFTP read file operation.                       \r
+                                  \r
+  @retval EFI_SUCCESS           The TFTP/MTFTP operation was completed.\r
+  @retval EFI_NOT_STARTED       The PXE Base Code Protocol is in the stopped state.\r
+  @retval EFI_INVALID_PARAMETER One or more parameters are invalid.                                \r
+  @retval EFI_DEVICE_ERROR      The network device encountered an error during this operation.                                \r
+  @retval EFI_BUFFER_TOO_SMALL  The buffer is not large enough to complete the read operation.   \r
+  @retval EFI_ABORTED           The callback function aborted the TFTP/MTFTP operation.\r
+  @retval EFI_TIMEOUT           The TFTP/MTFTP operation timed out.\r
+  @retval EFI_ICMP_ERROR        An ICMP error packet was received during the MTFTP session.\r
+  @retval EFI_TFTP_ERROR        A TFTP error packet was received during the MTFTP session.\r
+                                                                      \r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_PXE_BASE_CODE_MTFTP) (\r
+  IN EFI_PXE_BASE_CODE_PROTOCOL                *This,\r
+  IN EFI_PXE_BASE_CODE_TFTP_OPCODE             Operation,\r
+  IN OUT VOID                                  *BufferPtr OPTIONAL,\r
+  IN BOOLEAN                                   Overwrite,\r
+  IN OUT UINT64                                *BufferSize,\r
+  IN UINTN                                     *BlockSize OPTIONAL,\r
+  IN EFI_IP_ADDRESS                            *ServerIp,\r
+  IN UINT8                                     *Filename  OPTIONAL,\r
+  IN EFI_PXE_BASE_CODE_MTFTP_INFO              *Info      OPTIONAL,\r
+  IN BOOLEAN                                   DontUseBuffer\r
+  );\r
+\r
+/**                                                                 \r
+  Writes a UDP packet to the network interface.\r
+    \r
+  @param  This                  Pointer to the EFI_PXE_BASE_CODE_PROTOCOL instance.\r
+  @param  OpFlags               The UDP operation flags. \r
+  @param  DestIp                The destination IP address.\r
+  @param  DestPort              The destination UDP port number.                                                                         \r
+  @param  GatewayIp             The gateway IP address.                                                 \r
+  @param  SrcIp                 The source IP address.\r
+  @param  SrcPort               The source UDP port number.\r
+  @param  HeaderSize            An optional field which may be set to the length of a header at\r
+                                HeaderPtr to be prefixed to the data at BufferPtr.             \r
+  @param  HeaderPtr             If HeaderSize is not NULL, a pointer to a header to be prefixed to the\r
+                                data at BufferPtr.                                                    \r
+  @param  BufferSize            A pointer to the size of the data at BufferPtr.\r
+  @param  BufferPtr             A pointer to the data to be written.\r
+                                  \r
+  @retval EFI_SUCCESS           The UDP Write operation was completed.\r
+  @retval EFI_NOT_STARTED       The PXE Base Code Protocol is in the stopped state.\r
+  @retval EFI_INVALID_PARAMETER One or more parameters are invalid.                                \r
+  @retval EFI_BAD_BUFFER_SIZE   The buffer is too long to be transmitted.  \r
+  @retval EFI_ABORTED           The callback function aborted the UDP Write operation.\r
+  @retval EFI_TIMEOUT           The UDP Write operation timed out.\r
+  @retval EFI_ICMP_ERROR        An ICMP error packet was received during the UDP write session.  \r
+                                                                      \r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_PXE_BASE_CODE_UDP_WRITE) (\r
+  IN EFI_PXE_BASE_CODE_PROTOCOL                *This,\r
+  IN UINT16                                    OpFlags,\r
+  IN EFI_IP_ADDRESS                            *DestIp,\r
+  IN EFI_PXE_BASE_CODE_UDP_PORT                *DestPort,\r
+  IN EFI_IP_ADDRESS                            *GatewayIp,  OPTIONAL\r
+  IN EFI_IP_ADDRESS                            *SrcIp,      OPTIONAL\r
+  IN OUT EFI_PXE_BASE_CODE_UDP_PORT            *SrcPort,    OPTIONAL\r
+  IN UINTN                                     *HeaderSize, OPTIONAL\r
+  IN VOID                                      *HeaderPtr,  OPTIONAL\r
+  IN UINTN                                     *BufferSize,\r
+  IN VOID                                      *BufferPtr\r
+  );\r
+\r
+/**                                                                 \r
+  Reads a UDP packet from the network interface.\r
+    \r
+  @param  This                  Pointer to the EFI_PXE_BASE_CODE_PROTOCOL instance.\r
+  @param  OpFlags               The UDP operation flags. \r
+  @param  DestIp                The destination IP address.\r
+  @param  DestPort              The destination UDP port number.                                                                         \r
+  @param  GatewayIp             The gateway IP address.                                                 \r
+  @param  SrcIp                 The source IP address.\r
+  @param  SrcPort               The source UDP port number.\r
+  @param  HeaderSize            An optional field which may be set to the length of a header at\r
+                                HeaderPtr to be prefixed to the data at BufferPtr.             \r
+  @param  HeaderPtr             If HeaderSize is not NULL, a pointer to a header to be prefixed to the\r
+                                data at BufferPtr.                                                    \r
+  @param  BufferSize            A pointer to the size of the data at BufferPtr.\r
+  @param  BufferPtr             A pointer to the data to be read.\r
+                                  \r
+  @retval EFI_SUCCESS           The UDP Write operation was completed.\r
+  @retval EFI_NOT_STARTED       The PXE Base Code Protocol is in the stopped state.\r
+  @retval EFI_INVALID_PARAMETER One or more parameters are invalid.                                \r
+  @retval EFI_DEVICE_ERROR      The network device encountered an error during this operation.\r
+  @retval EFI_BUFFER_TOO_SMALL  The packet is larger than Buffer can hold.\r
+  @retval EFI_ABORTED           The callback function aborted the UDP Read operation.\r
+  @retval EFI_TIMEOUT           The UDP Read operation timed out.  \r
+                                                                      \r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_PXE_BASE_CODE_UDP_READ) (\r
+  IN EFI_PXE_BASE_CODE_PROTOCOL                *This,\r
+  IN UINT16                                    OpFlags,\r
+  IN OUT EFI_IP_ADDRESS                        *DestIp,     OPTIONAL\r
+  IN OUT EFI_PXE_BASE_CODE_UDP_PORT            *DestPort,   OPTIONAL\r
+  IN OUT EFI_IP_ADDRESS                        *SrcIp,      OPTIONAL\r
+  IN OUT EFI_PXE_BASE_CODE_UDP_PORT            *SrcPort,    OPTIONAL\r
+  IN UINTN                                     *HeaderSize, OPTIONAL\r
+  IN VOID                                      *HeaderPtr,  OPTIONAL\r
+  IN OUT UINTN                                 *BufferSize,\r
+  IN VOID                                      *BufferPtr\r
+  );\r
+\r
+/**                                                                 \r
+  Updates the IP receive filters of a network device and enables software filtering.\r
+    \r
+  @param  This                  Pointer to the EFI_PXE_BASE_CODE_PROTOCOL instance.\r
+  @param  NewFilter             Pointer to the new set of IP receive filters.\r
+  \r
+  @retval EFI_SUCCESS           The IP receive filter settings were updated.\r
+  @retval EFI_NOT_STARTED       The PXE Base Code Protocol is in the stopped state.\r
+  @retval EFI_INVALID_PARAMETER One or more parameters are invalid.                                  \r
+                                                                      \r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_PXE_BASE_CODE_SET_IP_FILTER) (\r
+  IN EFI_PXE_BASE_CODE_PROTOCOL            *This,\r
+  IN EFI_PXE_BASE_CODE_IP_FILTER           *NewFilter\r
+  );\r
+\r
+/**                                                                 \r
+  Uses the ARP protocol to resolve a MAC address.\r
+    \r
+  @param  This                  Pointer to the EFI_PXE_BASE_CODE_PROTOCOL instance.\r
+  @param  IpAddr                Pointer to the IP address that is used to resolve a MAC address.\r
+  @param  MacAddr               If not NULL, a pointer to the MAC address that was resolved with the\r
+                                ARP protocol.                                                       \r
+                                  \r
+  @retval EFI_SUCCESS           The IP or MAC address was resolved.\r
+  @retval EFI_NOT_STARTED       The PXE Base Code Protocol is in the stopped state.\r
+  @retval EFI_INVALID_PARAMETER One or more parameters are invalid.                                \r
+  @retval EFI_DEVICE_ERROR      The network device encountered an error during this operation.  \r
+  @retval EFI_ABORTED           The callback function aborted the ARP Protocol.\r
+  @retval EFI_TIMEOUT           The ARP Protocol encountered a timeout condition.\r
+                                                                      \r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_PXE_BASE_CODE_ARP) (\r
+  IN EFI_PXE_BASE_CODE_PROTOCOL            *This,\r
+  IN EFI_IP_ADDRESS                        *IpAddr,\r
+  IN EFI_MAC_ADDRESS                       *MacAddr OPTIONAL\r
+  );\r
+\r
+/**                                                                 \r
+  Updates the parameters that affect the operation of the PXE Base Code Protocol.\r
+    \r
+  @param  This                  Pointer to the EFI_PXE_BASE_CODE_PROTOCOL instance.\r
+  @param  NewAutoArp            If not NULL, a pointer to a value that specifies whether to replace the\r
+                                current value of AutoARP.                                              \r
+  @param  NewSendGUID           If not NULL, a pointer to a value that specifies whether to replace the\r
+                                current value of SendGUID.                                             \r
+  @param  NewTTL                If not NULL, a pointer to be used in place of the current value of TTL,\r
+                                the Â¡Â°time to live¡± field of the IP header.                           \r
+  @param  NewToS                If not NULL, a pointer to be used in place of the current value of ToS,\r
+                                the Â¡Â°type of service¡± field of the IP header.                        \r
+  @param  NewMakeCallback       If not NULL, a pointer to a value that specifies whether to replace the\r
+                                current value of the MakeCallback field of the Mode structure.                                                                \r
+                                  \r
+  @retval EFI_SUCCESS           The new parameters values were updated.\r
+  @retval EFI_NOT_STARTED       The PXE Base Code Protocol is in the stopped state.\r
+  @retval EFI_INVALID_PARAMETER One or more parameters are invalid.                                  \r
+                                                                      \r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_PXE_BASE_CODE_SET_PARAMETERS) (\r
+  IN EFI_PXE_BASE_CODE_PROTOCOL            *This,\r
+  IN BOOLEAN                               *NewAutoArp,     OPTIONAL\r
+  IN BOOLEAN                               *NewSendGUID,    OPTIONAL\r
+  IN UINT8                                 *NewTTL,         OPTIONAL\r
+  IN UINT8                                 *NewToS,         OPTIONAL\r
+  IN BOOLEAN                               *NewMakeCallback OPTIONAL\r
+  );\r
+\r
+/**                                                                 \r
+  Updates the station IP address and/or subnet mask values of a network device.\r
+    \r
+  @param  This                  Pointer to the EFI_PXE_BASE_CODE_PROTOCOL instance.\r
+  @param  NewStationIp          Pointer to the new IP address to be used by the network device.  \r
+  @param  NewSubnetMask         Pointer to the new subnet mask to be used by the network device.                                 \r
+                                  \r
+  @retval EFI_SUCCESS           The new station IP address and/or subnet mask were updated.\r
+  @retval EFI_NOT_STARTED       The PXE Base Code Protocol is in the stopped state.\r
+  @retval EFI_INVALID_PARAMETER One or more parameters are invalid.                                  \r
+                                                                      \r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_PXE_BASE_CODE_SET_STATION_IP) (\r
+  IN EFI_PXE_BASE_CODE_PROTOCOL            *This,\r
+  IN EFI_IP_ADDRESS                        *NewStationIp,   OPTIONAL\r
+  IN EFI_IP_ADDRESS                        *NewSubnetMask   OPTIONAL\r
+  );\r
+\r
+/**                                                                 \r
+  Updates the contents of the cached DHCP and Discover packets.\r
+    \r
+  @param  This                   Pointer to the EFI_PXE_BASE_CODE_PROTOCOL instance.\r
+  @param  NewDhcpDiscoverValid   Pointer to a value that will replace the current\r
+                                 DhcpDiscoverValid field.                        \r
+  @param  NewDhcpAckReceived     Pointer to a value that will replace the current\r
+                                 DhcpAckReceived field.                          \r
+  @param  NewProxyOfferReceived  Pointer to a value that will replace the current\r
+                                 ProxyOfferReceived field.                       \r
+  @param  NewPxeDiscoverValid    Pointer to a value that will replace the current     \r
+                                 ProxyOfferReceived field.                       \r
+  @param  NewPxeReplyReceived    Pointer to a value that will replace the current\r
+                                 PxeReplyReceived field.                         \r
+  @param  NewPxeBisReplyReceived Pointer to a value that will replace the current\r
+                                 PxeBisReplyReceived field.                      \r
+  @param  NewDhcpDiscover        Pointer to the new cached DHCP Discover packet contents.   \r
+  @param  NewDhcpAck             Pointer to the new cached DHCP Ack packet contents.\r
+  @param  NewProxyOffer          Pointer to the new cached Proxy Offer packet contents.\r
+  @param  NewPxeDiscover         Pointer to the new cached PXE Discover packet contents.\r
+  @param  NewPxeReply            Pointer to the new cached PXE Reply packet contents.\r
+  @param  NewPxeBisReply         Pointer to the new cached PXE BIS Reply packet contents.\r
+                                   \r
+  @retval EFI_SUCCESS            The cached packet contents were updated.\r
+  @retval EFI_NOT_STARTED        The PXE Base Code Protocol is in the stopped state.\r
+  @retval EFI_INVALID_PARAMETER  This is NULL or not point to a valid EFI_PXE_BASE_CODE_PROTOCOL structure.\r
+                                                                      \r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_PXE_BASE_CODE_SET_PACKETS) (\r
+  IN EFI_PXE_BASE_CODE_PROTOCOL            *This,\r
+  BOOLEAN                                  *NewDhcpDiscoverValid,   OPTIONAL\r
+  BOOLEAN                                  *NewDhcpAckReceived,     OPTIONAL\r
+  BOOLEAN                                  *NewProxyOfferReceived,  OPTIONAL\r
+  BOOLEAN                                  *NewPxeDiscoverValid,    OPTIONAL\r
+  BOOLEAN                                  *NewPxeReplyReceived,    OPTIONAL\r
+  BOOLEAN                                  *NewPxeBisReplyReceived, OPTIONAL\r
+  IN EFI_PXE_BASE_CODE_PACKET              *NewDhcpDiscover,        OPTIONAL\r
+  IN EFI_PXE_BASE_CODE_PACKET              *NewDhcpAck,             OPTIONAL\r
+  IN EFI_PXE_BASE_CODE_PACKET              *NewProxyOffer,          OPTIONAL\r
+  IN EFI_PXE_BASE_CODE_PACKET              *NewPxeDiscover,         OPTIONAL\r
+  IN EFI_PXE_BASE_CODE_PACKET              *NewPxeReply,            OPTIONAL\r
+  IN EFI_PXE_BASE_CODE_PACKET              *NewPxeBisReply          OPTIONAL\r
+  );\r
+\r
+//\r
+// PXE Base Code Protocol structure\r
+//\r
+#define EFI_PXE_BASE_CODE_INTERFACE_REVISION  0x00010000\r
+#define EFI_PXE_BASE_CODE_PROTOCOL_REVISION   EFI_PXE_BASE_CODE_INTERFACE_REVISION\r
+\r
+struct _EFI_PXE_BASE_CODE_PROTOCOL {\r
+  UINT64                            Revision;\r
+  EFI_PXE_BASE_CODE_START           Start;\r
+  EFI_PXE_BASE_CODE_STOP            Stop;\r
+  EFI_PXE_BASE_CODE_DHCP            Dhcp;\r
+  EFI_PXE_BASE_CODE_DISCOVER        Discover;\r
+  EFI_PXE_BASE_CODE_MTFTP           Mtftp;\r
+  EFI_PXE_BASE_CODE_UDP_WRITE       UdpWrite;\r
+  EFI_PXE_BASE_CODE_UDP_READ        UdpRead;\r
+  EFI_PXE_BASE_CODE_SET_IP_FILTER   SetIpFilter;\r
+  EFI_PXE_BASE_CODE_ARP             Arp;\r
+  EFI_PXE_BASE_CODE_SET_PARAMETERS  SetParameters;\r
+  EFI_PXE_BASE_CODE_SET_STATION_IP  SetStationIp;\r
+  EFI_PXE_BASE_CODE_SET_PACKETS     SetPackets;\r
+  EFI_PXE_BASE_CODE_MODE            *Mode;\r
+};\r
+\r
+extern EFI_GUID gEfiPxeBaseCodeProtocolGuid;\r
+\r
+#endif \r
diff --git a/Tools/Source/TianoTools/Include/Protocol/PxeBaseCodeCallBack.h b/Tools/Source/TianoTools/Include/Protocol/PxeBaseCodeCallBack.h
new file mode 100644 (file)
index 0000000..7f16701
--- /dev/null
@@ -0,0 +1,94 @@
+/** @file\r
+  EFI PXE Base Code CallBack Protocol\r
+\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. This program and the accompanying materials                          \r
+  are licensed and made available under the terms and conditions of the BSD License         \r
+  which accompanies this distribution.  The full text of the license may be found at        \r
+  http://opensource.org/licenses/bsd-license.php                                            \r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+  Module Name:  PxeBaseCodeCallBack.h\r
+\r
+**/\r
+\r
+#ifndef _PXE_BASE_CODE_CALLBACK_H_\r
+#define _PXE_BASE_CODE_CALLBACK_H_\r
+\r
+//\r
+// Call Back Definitions\r
+//\r
+#define EFI_PXE_BASE_CODE_CALLBACK_PROTOCOL_GUID \\r
+  { \\r
+    0x245dca21, 0xfb7b, 0x11d3, {0x8f, 0x01, 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b } \\r
+  }\r
+\r
+//\r
+// Revision Number\r
+//\r
+#define EFI_PXE_BASE_CODE_CALLBACK_INTERFACE_REVISION 0x00010000\r
+#define EFI_PXE_BASE_CODE_CALLBACK_PROTOCOL_REVISION  \\r
+        EFI_PXE_BASE_CODE_CALLBACK_INTERFACE_REVISION\r
+\r
+//\r
+// Protocol definition\r
+//\r
+typedef struct _EFI_PXE_BASE_CODE_CALLBACK_PROTOCOL  EFI_PXE_BASE_CODE_CALLBACK_PROTOCOL;\r
+\r
+typedef enum {\r
+  EFI_PXE_BASE_CODE_FUNCTION_FIRST,\r
+  EFI_PXE_BASE_CODE_FUNCTION_DHCP,\r
+  EFI_PXE_BASE_CODE_FUNCTION_DISCOVER,\r
+  EFI_PXE_BASE_CODE_FUNCTION_MTFTP,\r
+  EFI_PXE_BASE_CODE_FUNCTION_UDP_WRITE,\r
+  EFI_PXE_BASE_CODE_FUNCTION_UDP_READ,\r
+  EFI_PXE_BASE_CODE_FUNCTION_ARP,\r
+  EFI_PXE_BASE_CODE_FUNCTION_IGMP,\r
+  EFI_PXE_BASE_CODE_PXE_FUNCTION_LAST\r
+} EFI_PXE_BASE_CODE_FUNCTION;\r
+\r
+typedef enum {\r
+  EFI_PXE_BASE_CODE_CALLBACK_STATUS_FIRST,\r
+  EFI_PXE_BASE_CODE_CALLBACK_STATUS_CONTINUE,\r
+  EFI_PXE_BASE_CODE_CALLBACK_STATUS_ABORT,\r
+  EFI_PXE_BASE_CODE_CALLBACK_STATUS_LAST\r
+} EFI_PXE_BASE_CODE_CALLBACK_STATUS;\r
+\r
+/**                                                                 \r
+  Callback function that is invoked when the PXE Base Code Protocol is about to transmit, has\r
+  received, or is waiting to receive a packet.                                                 \r
+  \r
+  @param  This                  Pointer to the EFI_PXE_BASE_CODE_CALLBACK_PROTOCOL instance.\r
+  @param  Function              The PXE Base Code Protocol function that is waiting for an event.                                                              \r
+  @param  Received              TRUE if the callback is being invoked due to a receive event. FALSE if\r
+                                the callback is being invoked due to a transmit event.                \r
+  @param  PacketLen             The length, in bytes, of Packet. This field will have a value of zero if\r
+                                this is a wait for receive event.                                       \r
+  @param  Packet                If Received is TRUE, a pointer to the packet that was just received;\r
+                                otherwise a pointer to the packet that is about to be transmitted.  \r
+                                  \r
+  @retval EFI_PXE_BASE_CODE_CALLBACK_STATUS_CONTINUE if Function specifies a continue operation    \r
+  @retval EFI_PXE_BASE_CODE_CALLBACK_STATUS_ABORT    if Function specifies an abort operation\r
+                                   \r
+**/\r
+typedef \r
+EFI_PXE_BASE_CODE_CALLBACK_STATUS \r
+(EFIAPI *EFI_PXE_CALLBACK)(\r
+  IN EFI_PXE_BASE_CODE_CALLBACK_PROTOCOL  *This,\r
+  IN EFI_PXE_BASE_CODE_FUNCTION           Function,\r
+  IN BOOLEAN                              Received,\r
+  IN UINT32                               PacketLen,\r
+  IN EFI_PXE_BASE_CODE_PACKET             *Packet     OPTIONAL\r
+  );\r
+\r
+struct _EFI_PXE_BASE_CODE_CALLBACK_PROTOCOL {\r
+  UINT64            Revision;\r
+  EFI_PXE_CALLBACK  Callback;\r
+};\r
+\r
+extern EFI_GUID gEfiPxeBaseCodeCallbackProtocolGuid;\r
+\r
+#endif \r
+\r
diff --git a/Tools/Source/TianoTools/Include/Protocol/ScsiIo.h b/Tools/Source/TianoTools/Include/Protocol/ScsiIo.h
new file mode 100644 (file)
index 0000000..e1019ba
--- /dev/null
@@ -0,0 +1,233 @@
+/** @file\r
+  EFI_SCSI_IO_PROTOCOL as defined in UEFI 2.0.\r
+\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. This program and the accompanying materials                          \r
+  are licensed and made available under the terms and conditions of the BSD License         \r
+  which accompanies this distribution.  The full text of the license may be found at        \r
+  http://opensource.org/licenses/bsd-license.php                                            \r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+  Module Name:  ScsiIo.h\r
+\r
+**/\r
+\r
+#ifndef __EFI_SCSI_IO_PROTOCOL_H__\r
+#define __EFI_SCSI_IO_PROTOCOL_H__\r
+\r
+#define EFI_SCSI_IO_PROTOCOL_GUID \\r
+  { \\r
+    0x932f4736, 0x2362, 0x4002, {0x80, 0x3e, 0x3c, 0xd5, 0x4b, 0x13, 0x8f, 0x85 } \\r
+  }\r
+\r
+//\r
+// Forward reference for pure ANSI compatability\r
+//\r
+typedef struct _EFI_SCSI_IO_PROTOCOL EFI_SCSI_IO_PROTOCOL;\r
+\r
+//\r
+// SCSI Data Direction definition\r
+//\r
+#define EFI_SCSI_IO_DATA_DIRECTION_READ                        0\r
+#define EFI_SCSI_IO_DATA_DIRECTION_WRITE                       1\r
+#define EFI_SCSI_IO_DATA_DIRECTION_BIDIRECTIONAL               2\r
+\r
+//\r
+// SCSI Host Adapter Status definition\r
+//\r
+#define EFI_SCSI_IO_STATUS_HOST_ADAPTER_OK                     0x00\r
+#define EFI_SCSI_IO_STATUS_HOST_ADAPTER_TIMEOUT_COMMAND        0x09    // timeout when processing the command\r
+#define EFI_SCSI_IO_STATUS_HOST_ADAPTER_TIMEOUT                0x0b    // timeout when waiting for the command processing\r
+#define EFI_SCSI_IO_STATUS_HOST_ADAPTER_MESSAGE_REJECT         0x0d    // a message reject was received when processing command\r
+#define EFI_SCSI_IO_STATUS_HOST_ADAPTER_BUS_RESET              0x0e    // a bus reset was detected\r
+#define EFI_SCSI_IO_STATUS_HOST_ADAPTER_PARITY_ERROR           0x0f\r
+#define EFI_SCSI_IO_STATUS_HOST_ADAPTER_REQUEST_SENSE_FAILED   0x10    // the adapter failed in issuing request sense command\r
+#define EFI_SCSI_IO_STATUS_HOST_ADAPTER_SELECTION_TIMEOUT      0x11    // selection timeout\r
+#define EFI_SCSI_IO_STATUS_HOST_ADAPTER_DATA_OVERRUN_UNDERRUN  0x12    // data overrun or data underrun\r
+#define EFI_SCSI_IO_STATUS_HOST_ADAPTER_BUS_FREE               0x13    // Unexepected bus free\r
+#define EFI_SCSI_IO_STATUS_HOST_ADAPTER_PHASE_ERROR            0x14    // Target bus phase sequence failure\r
+#define EFI_SCSI_IO_STATUS_HOST_ADAPTER_OTHER                  0x7f\r
+\r
+\r
+//\r
+// SCSI Target Status definition\r
+//\r
+#define EFI_SCSI_IO_STATUS_TARGET_GOOD                         0x00\r
+#define EFI_SCSI_IO_STATUS_TARGET_CHECK_CONDITION              0x02    // check condition\r
+#define EFI_SCSI_IO_STATUS_TARGET_CONDITION_MET                0x04    // condition met\r
+#define EFI_SCSI_IO_STATUS_TARGET_BUSY                         0x08    // busy\r
+#define EFI_SCSI_IO_STATUS_TARGET_INTERMEDIATE                 0x10    // intermediate\r
+#define EFI_SCSI_IO_STATUS_TARGET_INTERMEDIATE_CONDITION_MET   0x14    // intermediate-condition met\r
+#define EFI_SCSI_IO_STATUS_TARGET_RESERVATION_CONFLICT         0x18    // reservation conflict\r
+#define EFI_SCSI_IO_STATUS_TARGET_COMMOND_TERMINATED           0x22    // command terminated\r
+#define EFI_SCSI_IO_STATUS_TARGET_QUEUE_FULL                   0x28    // queue full\r
+\r
+typedef struct {\r
+  UINT64                              Timeout;\r
+  VOID                                *InDataBuffer;\r
+  VOID                                *OutDataBuffer;\r
+  VOID                                *SenseData;\r
+  VOID                                *Cdb;\r
+  UINT32                              InTransferLength;\r
+  UINT32                              OutTransferLength;\r
+  UINT8                               CdbLength;\r
+  UINT8                               DataDirection;\r
+  UINT8                               HostAdapterStatus;\r
+  UINT8                               TargetStatus;\r
+  UINT8                               SenseDataLength;\r
+} EFI_SCSI_IO_SCSI_REQUEST_PACKET;\r
+\r
+/**\r
+  Retrieves the device type information of the SCSI Controller.\r
+\r
+  @param  This       Protocol instance pointer.\r
+  @param  DeviceType A pointer to the device type information\r
+                     retrieved from the SCSI Controller.\r
+\r
+  @retval EFI_SUCCESS           Retrieves the device type information successfully.\r
+  @retval EFI_INVALID_PARAMETER The DeviceType is NULL.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_SCSI_IO_PROTOCOL_GET_DEVICE_TYPE) (\r
+  IN  EFI_SCSI_IO_PROTOCOL            *This,\r
+  OUT UINT8                           *DeviceType\r
+  )\r
+;\r
+\r
+/**\r
+  Retrieves the device location in the SCSI channel.\r
+\r
+  @param  This   Protocol instance pointer.\r
+  @param  Target A pointer to the Target ID of a SCSI device\r
+                 on the SCSI channel.\r
+  @param  Lun    A pointer to the LUN of the SCSI device on\r
+                 the SCSI channel.\r
+\r
+  @retval EFI_SUCCESS           Retrieves the device location successfully.\r
+  @retval EFI_INVALID_PARAMETER The Target or Lun is NULL.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_SCSI_IO_PROTOCOL_GET_DEVICE_LOCATION) (\r
+  IN EFI_SCSI_IO_PROTOCOL           *This,\r
+  IN OUT UINT8                      **Target,\r
+  OUT UINT64                        *Lun\r
+  )\r
+;\r
+\r
+/**\r
+  Resets the SCSI Bus that the SCSI Controller is attached to.\r
+\r
+  @param  This Protocol instance pointer.\r
+\r
+  @retval EFI_SUCCESS      The SCSI bus is reset successfully.\r
+  @retval EFI_DEVICE_ERROR Errors encountered when resetting the SCSI bus.\r
+  @retval EFI_UNSUPPORTED  The bus reset operation is not supported by the\r
+                           SCSI Host Controller.\r
+  @retval EFI_TIMEOUT      A timeout occurred while attempting to reset\r
+                            the SCSI bus.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_SCSI_IO_PROTOCOL_RESET_BUS) (\r
+  IN EFI_SCSI_IO_PROTOCOL     *This\r
+  )\r
+;\r
+\r
+/**\r
+  Resets the SCSI Controller that the device handle specifies.\r
+\r
+  @param  This Protocol instance pointer.\r
+\r
+  @retval EFI_SUCCESS      Reset the SCSI controller successfully.\r
+  @retval EFI_DEVICE_ERROR Errors are encountered when resetting the\r
+                           SCSI Controller.\r
+  @retval EFI_UNSUPPORTED  The SCSI bus does not support a device\r
+                           reset operation.\r
+  @retval EFI_TIMEOUT      A timeout occurred while attempting to\r
+                           reset the SCSI Controller.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_SCSI_IO_PROTOCOL_RESET_DEVICE) (\r
+  IN EFI_SCSI_IO_PROTOCOL     *This\r
+  )\r
+;\r
+\r
+\r
+/**\r
+  Sends a SCSI Request Packet to the SCSI Controller for execution.\r
+\r
+  @param  This    Protocol instance pointer.\r
+  @param  Packet  The SCSI request packet to send to the SCSI\r
+                  Controller specified by the device handle.\r
+  @param  Event   If the SCSI bus where the SCSI device is attached\r
+                  does not support non-blocking I/O, then Event is\r
+                  ignored, and blocking I/O is performed.\r
+                  If Event is NULL, then blocking I/O is performed.\r
+                  If Event is not NULL and non-blocking I/O is\r
+                  supported, then non-blocking I/O is performed,\r
+                  and Event will be signaled when the SCSI Request\r
+                  Packet completes.\r
+\r
+  @retval EFI_SUCCESS               The SCSI Request Packet was sent by the host\r
+                                    successfully, and TransferLength bytes were\r
+                                    transferred to/from DataBuffer.See\r
+                                    HostAdapterStatus, TargetStatus,\r
+                                    SenseDataLength, and SenseData in that order\r
+                                    for additional status information.\r
+  @retval EFI_WARN_BUFFER_TOO_SMALL The SCSI Request Packet was executed,\r
+                                    but the entire DataBuffer could not be transferred.\r
+                                    The actual number of bytes transferred is returned\r
+                                    in TransferLength. See HostAdapterStatus,\r
+                                    TargetStatus, SenseDataLength, and SenseData in\r
+                                    that order for additional status information.\r
+  @retval EFI_NOT_READY             The SCSI Request Packet could not be sent because\r
+                                    there are too many SCSI Command Packets already\r
+                                    queued.The caller may retry again later.\r
+  @retval EFI_DEVICE_ERROR          A device error occurred while attempting to send\r
+                                    the SCSI Request Packet. See HostAdapterStatus,\r
+                                    TargetStatus, SenseDataLength, and SenseData in\r
+                                    that order for additional status information.\r
+  @retval EFI_INVALID_PARAMETER     The contents of CommandPacket are invalid.\r
+                                    The SCSI Request Packet was not sent, so no\r
+                                    additional status information is available.\r
+  @retval EFI_UNSUPPORTED           The command described by the SCSI Request Packet\r
+                                    is not supported by the SCSI initiator(i.e., SCSI\r
+                                    Host Controller). The SCSI Request Packet was not\r
+                                    sent, so no additional status information is\r
+                                    available.\r
+  @retval EFI_TIMEOUT               A timeout occurred while waiting for the SCSI\r
+                                    Request Packet to execute. See HostAdapterStatus,\r
+                                    TargetStatus, SenseDataLength, and SenseData in\r
+                                    that order for additional status information.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_SCSI_IO_PROTOCOL_EXEC_SCSI_COMMAND) (\r
+  IN EFI_SCSI_IO_PROTOCOL                   *This,\r
+  IN OUT  EFI_SCSI_IO_SCSI_REQUEST_PACKET   *Packet,\r
+  IN EFI_EVENT                              Event  OPTIONAL\r
+  )\r
+;\r
+\r
+struct _EFI_SCSI_IO_PROTOCOL {\r
+  EFI_SCSI_IO_PROTOCOL_GET_DEVICE_TYPE      GetDeviceType;\r
+  EFI_SCSI_IO_PROTOCOL_GET_DEVICE_LOCATION  GetDeviceLocation;\r
+  EFI_SCSI_IO_PROTOCOL_RESET_BUS            ResetBus;\r
+  EFI_SCSI_IO_PROTOCOL_RESET_DEVICE         ResetDevice;\r
+  EFI_SCSI_IO_PROTOCOL_EXEC_SCSI_COMMAND    ExecuteSCSICommand;    \r
+  UINT32                                    IoAlign;\r
+};\r
+\r
+extern EFI_GUID gEfiScsiIoProtocolGuid;\r
+\r
+#endif\r
diff --git a/Tools/Source/TianoTools/Include/Protocol/ScsiPassThru.h b/Tools/Source/TianoTools/Include/Protocol/ScsiPassThru.h
new file mode 100644 (file)
index 0000000..a5aa6c4
--- /dev/null
@@ -0,0 +1,312 @@
+/** @file\r
+  SCSI Pass Through protocol.\r
+\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. This program and the accompanying materials                          \r
+  are licensed and made available under the terms and conditions of the BSD License         \r
+  which accompanies this distribution.  The full text of the license may be found at        \r
+  http://opensource.org/licenses/bsd-license.php                                            \r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+  Module Name:  ScsiPassThru.h\r
+\r
+**/\r
+\r
+#ifndef __SCSI_PASS_THROUGH_H__\r
+#define __SCSI_PASS_THROUGH_H__\r
+\r
+#define EFI_SCSI_PASS_THRU_PROTOCOL_GUID \\r
+  { \\r
+    0xa59e8fcf, 0xbda0, 0x43bb, {0x90, 0xb1, 0xd3, 0x73, 0x2e, 0xca, 0xa8, 0x77 } \\r
+  }\r
+\r
+//\r
+// Forward reference for pure ANSI compatability\r
+//\r
+typedef struct _EFI_SCSI_PASS_THRU_PROTOCOL  EFI_SCSI_PASS_THRU_PROTOCOL;\r
+\r
+#define EFI_SCSI_PASS_THRU_ATTRIBUTES_PHYSICAL    0x0001\r
+#define EFI_SCSI_PASS_THRU_ATTRIBUTES_LOGICAL     0x0002\r
+#define EFI_SCSI_PASS_THRU_ATTRIBUTES_NONBLOCKIO  0x0004\r
+\r
+//\r
+// SCSI Host Adapter Status definition\r
+//\r
+#define EFI_SCSI_STATUS_HOST_ADAPTER_OK                     0x00\r
+#define EFI_SCSI_STATUS_HOST_ADAPTER_TIMEOUT_COMMAND        0x09  // timeout when processing the command\r
+#define EFI_SCSI_STATUS_HOST_ADAPTER_TIMEOUT                0x0b  // timeout when waiting for the command processing\r
+#define EFI_SCSI_STATUS_HOST_ADAPTER_MESSAGE_REJECT         0x0d  // a message reject was received when processing command\r
+#define EFI_SCSI_STATUS_HOST_ADAPTER_BUS_RESET              0x0e  // a bus reset was detected\r
+#define EFI_SCSI_STATUS_HOST_ADAPTER_PARITY_ERROR           0x0f\r
+#define EFI_SCSI_STATUS_HOST_ADAPTER_REQUEST_SENSE_FAILED   0x10  // the adapter failed in issuing request sense command\r
+#define EFI_SCSI_STATUS_HOST_ADAPTER_SELECTION_TIMEOUT      0x11  // selection timeout\r
+#define EFI_SCSI_STATUS_HOST_ADAPTER_DATA_OVERRUN_UNDERRUN  0x12  // data overrun or data underrun\r
+#define EFI_SCSI_STATUS_HOST_ADAPTER_BUS_FREE               0x13  // Unexepected bus free\r
+#define EFI_SCSI_STATUS_HOST_ADAPTER_PHASE_ERROR            0x14  // Target bus phase sequence failure\r
+#define EFI_SCSI_STATUS_HOST_ADAPTER_OTHER                  0x7f\r
+\r
+//\r
+// SCSI Target Status definition\r
+//\r
+#define EFI_SCSI_STATUS_TARGET_GOOD                       0x00\r
+#define EFI_SCSI_STATUS_TARGET_CHECK_CONDITION            0x02  // check condition\r
+#define EFI_SCSI_STATUS_TARGET_CONDITION_MET              0x04  // condition met\r
+#define EFI_SCSI_STATUS_TARGET_BUSY                       0x08  // busy\r
+#define EFI_SCSI_STATUS_TARGET_INTERMEDIATE               0x10  // intermediate\r
+#define EFI_SCSI_STATUS_TARGET_INTERMEDIATE_CONDITION_MET 0x14  // intermediate-condition met\r
+#define EFI_SCSI_STATUS_TARGET_RESERVATION_CONFLICT       0x18  // reservation conflict\r
+#define EFI_SCSI_STATUS_TARGET_COMMOND_TERMINATED         0x22  // command terminated\r
+#define EFI_SCSI_STATUS_TARGET_QUEUE_FULL                 0x28  // queue full\r
+\r
+typedef struct {\r
+  UINT64  Timeout;\r
+  VOID    *DataBuffer;\r
+  VOID    *SenseData;\r
+  VOID    *Cdb;\r
+  UINT32  TransferLength;\r
+  UINT8   CdbLength;\r
+  UINT8   DataDirection;\r
+  UINT8   HostAdapterStatus;\r
+  UINT8   TargetStatus;\r
+  UINT8   SenseDataLength;\r
+} EFI_SCSI_PASS_THRU_SCSI_REQUEST_PACKET;\r
+\r
+typedef struct {\r
+  CHAR16  *ControllerName;\r
+  CHAR16  *ChannelName;\r
+  UINT32  AdapterId;\r
+  UINT32  Attributes;\r
+  UINT32  IoAlign;\r
+} EFI_SCSI_PASS_THRU_MODE;\r
+\r
+/**\r
+  Sends a SCSI Request Packet to a SCSI device that is attached to \r
+  the SCSI channel. This function supports both blocking I/O and \r
+  non-blocking I/O.  The blocking I/O functionality is required, \r
+  and the non-blocking I/O functionality is optional.\r
+\r
+  @param  This   Protocol instance pointer.\r
+  @param  Target The Target ID of the SCSI device to\r
+                 send the SCSI Request Packet.\r
+  @param  Lun    The LUN of the SCSI device to send the\r
+                 SCSI Request Packet.\r
+  @param  Packet A pointer to the SCSI Request Packet to send\r
+                 to the SCSI device specified by Target and Lun.\r
+  @param  Event  If non-blocking I/O is not supported then Event\r
+                 is ignored, and blocking I/O is performed.\r
+                 If Event is NULL, then blocking I/O is performed.\r
+                 If Event is not NULL and non blocking I/O is\r
+                 supported, then non-blocking I/O is performed,\r
+                 and Event will be signaled when the SCSI Request\r
+                 Packet completes\r
+\r
+  @retval EFI_SUCCESS               The SCSI Request Packet was sent by the host, and\r
+                                    TransferLength bytes were transferred to/from\r
+                                    DataBuffer.See HostAdapterStatus, TargetStatus,\r
+                                    SenseDataLength,and SenseData in that order\r
+                                    for additional status information.\r
+  @retval EFI_WARN_BUFFER_TOO_SMALL The SCSI Request Packet was executed, but the\r
+                                    entire DataBuffer could not be transferred.\r
+                                    The actual number of bytes transferred is returned\r
+                                    in TransferLength. See HostAdapterStatus,\r
+                                    TargetStatus, SenseDataLength, and SenseData in\r
+                                    that order for additional status information.\r
+  @retval EFI_NOT_READY             The SCSI Request Packet could not be sent because\r
+                                    there are too many SCSI Request Packets already\r
+                                    queued.  The caller may retry again later.\r
+  @retval EFI_DEVICE_ERROR          A device error occurred while attempting to send\r
+                                    the SCSI Request Packet. See HostAdapterStatus,\r
+                                    TargetStatus, SenseDataLength, and SenseData in\r
+                                    that order for additional status information.\r
+  @retval EFI_INVALID_PARAMETER     Target, Lun, or the contents of ScsiRequestPacket\r
+                                    are invalid. The SCSI Request Packet was not sent,\r
+                                    so no additional status information is available.\r
+  @retval EFI_UNSUPPORTED           The command described by the SCSI Request Packet\r
+                                    is not supported by the host adapter. The SCSI\r
+                                    Request Packet was not sent, so no additional\r
+                                    status information is available.\r
+  @retval EFI_TIMEOUT               A timeout occurred while waiting for the SCSI\r
+                                    Request Packet to execute. See HostAdapterStatus,\r
+                                    TargetStatus, SenseDataLength, and SenseData in\r
+                                    that order for additional status information.\r
+                                    \r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_SCSI_PASS_THRU_PASSTHRU) (\r
+  IN EFI_SCSI_PASS_THRU_PROTOCOL                          *This,\r
+  IN UINT32                                               Target,\r
+  IN UINT64                                               Lun,\r
+  IN OUT EFI_SCSI_PASS_THRU_SCSI_REQUEST_PACKET           *Packet,\r
+  IN EFI_EVENT                                            Event   OPTIONAL\r
+  )\r
+;\r
+\r
+/**\r
+  Used to retrieve the list of legal Target IDs for SCSI devices \r
+  on a SCSI channel.\r
+\r
+  @param  This   Protocol instance pointer.\r
+  @param  Target On input, a pointer to the Target ID of a\r
+                 SCSI device present on the SCSI channel.\r
+                 On output, a pointer to the Target ID of\r
+                 the next SCSI device present on a SCSI channel.\r
+                 An input value of 0xFFFFFFFF retrieves the\r
+                 Target ID of the first SCSI device present on\r
+                 a SCSI channel.\r
+  @param  Lun    On input, a pointer to the LUN of a SCSI device\r
+                 present on the SCSI channel.On output, a pointer\r
+                 to the LUN of the next SCSI device present on a\r
+                 SCSI channel.\r
+\r
+  @retval EFI_SUCCESS           The Target ID of the next SCSI device on the SCSI\r
+                                channel was returned in Target and Lun.\r
+  @retval EFI_NOT_FOUND         There are no more SCSI devices on this SCSI channel.\r
+  @retval EFI_INVALID_PARAMETER Target is not 0xFFFFFFFF, and Target and Lun were\r
+                                 not returned on a previous call to GetNextDevice().\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_SCSI_PASS_THRU_GET_NEXT_DEVICE) (\r
+  IN EFI_SCSI_PASS_THRU_PROTOCOL            *This,\r
+  IN OUT UINT32                             *Target,\r
+  IN OUT UINT64                             *Lun\r
+  )\r
+;\r
+\r
+/**\r
+  Used to allocate and build a device path node for a SCSI device \r
+  on a SCSI channel.\r
+\r
+  @param  This       Protocol instance pointer.\r
+  @param  Target     The Target ID of the SCSI device for which\r
+                     a device path node is to be allocated and built.\r
+  @param  Lun        The LUN of the SCSI device for which a device\r
+                     path node is to be allocated and built.\r
+  @param  DevicePath A pointer to a single device path node that\r
+                     describes the SCSI device specified by\r
+                     Target and Lun. This function is responsible\r
+                     for allocating the buffer DevicePath with the boot\r
+                     service AllocatePool().  It is the caller's\r
+                     responsibility to free DevicePath when the caller\r
+                     is finished with DevicePath.\r
+\r
+  @retval EFI_SUCCESS           The device path node that describes the SCSI device\r
+                                specified by Target and Lun was allocated and\r
+                                returned in DevicePath.\r
+  @retval EFI_NOT_FOUND         The SCSI devices specified by Target and Lun does\r
+                                not exist on the SCSI channel.\r
+  @retval EFI_INVALID_PARAMETER DevicePath is NULL.\r
+  @retval EFI_OUT_OF_RESOURCES  There are not enough resources to allocate\r
+                                DevicePath.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_SCSI_PASS_THRU_BUILD_DEVICE_PATH) (\r
+  IN EFI_SCSI_PASS_THRU_PROTOCOL            *This,\r
+  IN     UINT32                             Target,\r
+  IN     UINT64                             Lun,\r
+  IN OUT EFI_DEVICE_PATH_PROTOCOL           **DevicePath\r
+  )\r
+;\r
+\r
+/**\r
+  Used to translate a device path node to a Target ID and LUN.\r
+\r
+  @param  This       Protocol instance pointer.\r
+  @param  DevicePath A pointer to the device path node that\r
+                     describes a SCSI device on the SCSI channel.\r
+  @param  Target     A pointer to the Target ID of a SCSI device\r
+                     on the SCSI channel.\r
+  @param  Lun        A pointer to the LUN of a SCSI device on\r
+                     the SCSI channel.\r
+\r
+  @retval EFI_SUCCESS           DevicePath was successfully translated to a\r
+                                Target ID and LUN, and they were returned\r
+                                in Target and Lun.\r
+  @retval EFI_INVALID_PARAMETER DevicePath is NULL.\r
+  @retval EFI_INVALID_PARAMETER Target is NULL.\r
+  @retval EFI_INVALID_PARAMETER Lun is NULL.\r
+  @retval EFI_UNSUPPORTED       This driver does not support the device path\r
+                                node type in DevicePath.\r
+  @retval EFI_NOT_FOUND         A valid translation from DevicePath to a\r
+                                Target ID and LUN does not exist.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_SCSI_PASS_THRU_GET_TARGET_LUN) (\r
+  IN EFI_SCSI_PASS_THRU_PROTOCOL            *This,\r
+  IN  EFI_DEVICE_PATH_PROTOCOL              *DevicePath,\r
+  OUT UINT32                                *Target,\r
+  OUT UINT64                                *Lun\r
+  )\r
+;\r
+\r
+/**\r
+  Resets a SCSI channel.This operation resets all the \r
+  SCSI devices connected to the SCSI channel.\r
+\r
+  @param  This Protocol instance pointer.\r
+\r
+  @retval EFI_SUCCESS      The SCSI channel was reset.\r
+  @retval EFI_UNSUPPORTED  The SCSI channel does not support\r
+                           a channel reset operation.\r
+  @retval EFI_DEVICE_ERROR A device error occurred while\r
+                           attempting to reset the SCSI channel.\r
+  @retval EFI_TIMEOUT      A timeout occurred while attempting\r
+                           to reset the SCSI channel.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_SCSI_PASS_THRU_RESET_CHANNEL) (\r
+  IN EFI_SCSI_PASS_THRU_PROTOCOL             *This\r
+  )\r
+;\r
+\r
+/**\r
+  Resets a SCSI device that is connected to a SCSI channel.\r
+\r
+  @param  This   Protocol instance pointer.\r
+  @param  Target The Target ID of the SCSI device to reset.\r
+  @param  Lun    The LUN of the SCSI device to reset.\r
+\r
+  @retval EFI_SUCCESS           The SCSI device specified by Target and\r
+                                Lun was reset.\r
+  @retval EFI_UNSUPPORTED       The SCSI channel does not support a target\r
+                                reset operation.\r
+  @retval EFI_INVALID_PARAMETER Target or Lun are invalid.\r
+  @retval EFI_DEVICE_ERROR      A device error occurred while attempting\r
+                                to reset the SCSI device specified by Target\r
+                                and Lun.\r
+  @retval EFI_TIMEOUT           A timeout occurred while attempting to reset\r
+                                the SCSI device specified by Target and Lun.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_SCSI_PASS_THRU_RESET_TARGET) (\r
+  IN EFI_SCSI_PASS_THRU_PROTOCOL             *This,\r
+  IN UINT32                                  Target,\r
+  IN UINT64                                  Lun\r
+  )\r
+;\r
+\r
+struct _EFI_SCSI_PASS_THRU_PROTOCOL {\r
+  EFI_SCSI_PASS_THRU_MODE               *Mode;\r
+  EFI_SCSI_PASS_THRU_PASSTHRU           PassThru;\r
+  EFI_SCSI_PASS_THRU_GET_NEXT_DEVICE    GetNextDevice;\r
+  EFI_SCSI_PASS_THRU_BUILD_DEVICE_PATH  BuildDevicePath;\r
+  EFI_SCSI_PASS_THRU_GET_TARGET_LUN     GetTargetLun;\r
+  EFI_SCSI_PASS_THRU_RESET_CHANNEL      ResetChannel;\r
+  EFI_SCSI_PASS_THRU_RESET_TARGET       ResetTarget;\r
+};\r
+\r
+extern EFI_GUID gEfiScsiPassThruProtocolGuid;\r
+\r
+#endif\r
diff --git a/Tools/Source/TianoTools/Include/Protocol/ScsiPassThruExt.h b/Tools/Source/TianoTools/Include/Protocol/ScsiPassThruExt.h
new file mode 100644 (file)
index 0000000..b522792
--- /dev/null
@@ -0,0 +1,332 @@
+/** @file\r
+  EFI_EXT_SCSI_PASS_THRU_PROTOCOL as defined in UEFI 2.0.\r
+\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. This program and the accompanying materials                          \r
+  are licensed and made available under the terms and conditions of the BSD License         \r
+  which accompanies this distribution.  The full text of the license may be found at        \r
+  http://opensource.org/licenses/bsd-license.php                                            \r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+  Module Name:  ScsiPassThruExt.h\r
+\r
+**/\r
+\r
+#ifndef __EXT_SCSI_PASS_THROUGH_PROTOCOL_H__\r
+#define __EXT_SCSI_PASS_THROUGH_PROTOCOL_H__\r
+\r
+#define EFI_EXT_SCSI_PASS_THRU_PROTOCOL_GUID \\r
+  { \\r
+    0x1d3de7f0, 0x0807, 0x424f, {0xaa, 0x69, 0x11, 0xa5, 0x4e, 0x19, 0xa4, 0x6f } \\r
+  }\r
+\r
+typedef struct _EFI_EXT_SCSI_PASS_THRU_PROTOCOL EFI_EXT_SCSI_PASS_THRU_PROTOCOL;\r
+\r
+#define TARGET_MAX_BYTES                             0x10\r
+\r
+#define EFI_EXT_SCSI_PASS_THRU_ATTRIBUTES_PHYSICAL   0x0001\r
+#define EFI_EXT_SCSI_PASS_THRU_ATTRIBUTES_LOGICAL    0x0002\r
+#define EFI_EXT_SCSI_PASS_THRU_ATTRIBUTES_NONBLOCKIO 0x0004\r
+\r
+//\r
+// DataDirection\r
+//\r
+#define EFI_EXT_SCSI_DATA_DIRECTION_READ             0\r
+#define EFI_EXT_SCSI_DATA_DIRECTION_WRITE            1\r
+#define EFI_EXT_SCSI_DATA_DIRECTION_BIDIRECTIONAL    2\r
+//\r
+// HostAdapterStatus\r
+//\r
+#define EFI_EXT_SCSI_STATUS_HOST_ADAPTER_OK                    0x00\r
+#define EFI_EXT_SCSI_STATUS_HOST_ADAPTER_TIMEOUT_COMMAND       0x09\r
+#define EFI_EXT_SCSI_STATUS_HOST_ADAPTER_TIMEOUT               0x0b\r
+#define EFI_EXT_SCSI_STATUS_HOST_ADAPTER_MESSAGE_REJECT        0x0d\r
+#define EFI_EXT_SCSI_STATUS_HOST_ADAPTER_BUS_RESET             0x0e\r
+#define EFI_EXT_SCSI_STATUS_HOST_ADAPTER_PARITY_ERROR          0x0f\r
+#define EFI_EXT_SCSI_STATUS_HOST_ADAPTER_REQUEST_SENSE_FAILED  0x10\r
+#define EFI_EXT_SCSI_STATUS_HOST_ADAPTER_SELECTION_TIMEOUT     0x11\r
+#define EFI_EXT_SCSI_STATUS_HOST_ADAPTER_DATA_OVERRUN_UNDERRUN 0x12\r
+#define EFI_EXT_SCSI_STATUS_HOST_ADAPTER_BUS_FREE              0x13\r
+#define EFI_EXT_SCSI_STATUS_HOST_ADAPTER_PHASE_ERROR           0x14\r
+#define EFI_EXT_SCSI_STATUS_HOST_ADAPTER_OTHER                 0x7f\r
+//\r
+// TargetStatus\r
+//\r
+#define EFI_EXT_SCSI_STATUS_TARGET_GOOD                        0x00\r
+#define EFI_EXT_SCSI_STATUS_TARGET_CHECK_CONDITION             0x02\r
+#define EFI_EXT_SCSI_STATUS_TARGET_CONDITION_MET               0x04\r
+#define EFI_EXT_SCSI_STATUS_TARGET_BUSY                        0x08\r
+#define EFI_EXT_SCSI_STATUS_TARGET_INTERMEDIATE                0x10\r
+#define EFI_EXT_SCSI_STATUS_TARGET_INTERMEDIATE_CONDITION_MET  0x14\r
+#define EFI_EXT_SCSI_STATUS_TARGET_RESERVATION_CONFLICT        0x18\r
+#define EFI_EXT_SCSI_STATUS_TARGET_TASK_SET_FULL               0x28\r
+#define EFI_EXT_SCSI_STATUS_TARGET_ACA_ACTIVE                  0x30\r
+#define EFI_EXT_SCSI_STATUS_TARGET_TASK_ABORTED                0x40\r
+\r
+typedef struct {\r
+  UINT32 AdapterId;\r
+  UINT32 Attributes;\r
+  UINT32 IoAlign;\r
+} EFI_EXT_SCSI_PASS_THRU_MODE;\r
+\r
+typedef struct {\r
+  UINT64 Timeout;\r
+  VOID   *InDataBuffer;\r
+  VOID   *OutDataBuffer;\r
+  VOID   *SenseData;\r
+  VOID   *Cdb;\r
+  UINT32 InTransferLength;\r
+  UINT32 OutTransferLength;\r
+  UINT8  CdbLength;\r
+  UINT8  DataDirection;\r
+  UINT8  HostAdapterStatus;\r
+  UINT8  TargetStatus;\r
+  UINT8  SenseDataLength;\r
+} EFI_EXT_SCSI_PASS_THRU_SCSI_REQUEST_PACKET;\r
+\r
+/**\r
+  Sends a SCSI Request Packet to a SCSI device that is attached to the SCSI channel. This function   \r
+  supports both blocking I/O and nonblocking I/O. The blocking I/O functionality is required, and the\r
+  nonblocking I/O functionality is optional.                                                             \r
+\r
+  @param  This    A pointer to the EFI_EXT_SCSI_PASS_THRU_PROTOCOL instance.\r
+  @param  Target  The Target is an array of size TARGET_MAX_BYTES and it represents\r
+                  the id of the SCSI device to send the SCSI Request Packet. Each\r
+                  transport driver may chose to utilize a subset of this size to suit the needs\r
+                  of transport target representation. For example, a Fibre Channel driver\r
+                  may use only 8 bytes (WWN) to represent an FC target.\r
+  @param  Lun     The LUN of the SCSI device to send the SCSI Request Packet.\r
+  @param  Packet  A pointer to the SCSI Request Packet to send to the SCSI device\r
+                  specified by Target and Lun.\r
+  @param  Event   If nonblocking I/O is not supported then Event is ignored, and blocking\r
+                  I/O is performed. If Event is NULL, then blocking I/O is performed. If\r
+                  Event is not NULL and non blocking I/O is supported, then\r
+                  nonblocking I/O is performed, and Event will be signaled when the\r
+                  SCSI Request Packet completes.\r
+\r
+  @retval EFI_SUCCESS           The SCSI Request Packet was sent by the host. For bi-directional\r
+                                commands, InTransferLength bytes were transferred from\r
+                                InDataBuffer. For write and bi-directional commands,\r
+                                OutTransferLength bytes were transferred by\r
+                                OutDataBuffer.\r
+  @retval EFI_BAD_BUFFER_SIZE   The SCSI Request Packet was not executed. The number of bytes that\r
+                                could be transferred is returned in InTransferLength. For write\r
+                                and bi-directional commands, OutTransferLength bytes were\r
+                                transferred by OutDataBuffer.\r
+  @retval EFI_NOT_READY         The SCSI Request Packet could not be sent because there are too many\r
+                                SCSI Request Packets already queued. The caller may retry again later.\r
+  @retval EFI_DEVICE_ERROR      A device error occurred while attempting to send the SCSI Request\r
+                                Packet.\r
+  @retval EFI_INVALID_PARAMETER Target, Lun, or the contents of ScsiRequestPacket are invalid.\r
+  @retval EFI_UNSUPPORTED       The command described by the SCSI Request Packet is not supported\r
+                                by the host adapter. This includes the case of Bi-directional SCSI\r
+                                commands not supported by the implementation. The SCSI Request\r
+                                Packet was not sent, so no additional status information is available.\r
+  @retval EFI_TIMEOUT           A timeout occurred while waiting for the SCSI Request Packet to execute.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_EXT_SCSI_PASS_THRU_PASSTHRU) (\r
+  IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL                *This,\r
+  IN UINT8                                          *Target,\r
+  IN UINT64                                         Lun,\r
+  IN OUT EFI_EXT_SCSI_PASS_THRU_SCSI_REQUEST_PACKET *Packet,\r
+  IN EFI_EVENT                                      Event     OPTIONAL\r
+  )\r
+;      \r
+\r
+/**\r
+  Used to retrieve the list of legal Target IDs and LUNs for SCSI devices on a SCSI channel. These       \r
+  can either be the list SCSI devices that are actually present on the SCSI channel, or the list of legal\r
+  Target Ids and LUNs for the SCSI channel. Regardless, the caller of this function must probe the       \r
+  Target ID and LUN returned to see if a SCSI device is actually present at that location on the SCSI    \r
+  channel.                                                                                               \r
+\r
+  @param  This   A pointer to the EFI_EXT_SCSI_PASS_THRU_PROTOCOL instance.\r
+  @param  Target On input, a pointer to the Target ID (an array of size\r
+                 TARGET_MAX_BYTES) of a SCSI device present on the SCSI channel.\r
+                 On output, a pointer to the Target ID (an array of\r
+                 TARGET_MAX_BYTES) of the next SCSI device present on a SCSI\r
+                 channel. An input value of 0xF(all bytes in the array are 0xF) in the\r
+                 Target array retrieves the Target ID of the first SCSI device present on a\r
+                 SCSI channel.\r
+  @param  Lun    On input, a pointer to the LUN of a SCSI device present on the SCSI\r
+                 channel. On output, a pointer to the LUN of the next SCSI device present\r
+                 on a SCSI channel.\r
+\r
+  @retval EFI_SUCCESS           The Target ID and LUN of the next SCSI device on the SCSI\r
+                                channel was returned in Target and Lun.\r
+  @retval EFI_INVALID_PARAMETER Target array is not all 0xF, and Target and Lun were\r
+                                not returned on a previous call to GetNextTargetLun().\r
+  @retval EFI_NOT_FOUND         There are no more SCSI devices on this SCSI channel.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_EXT_SCSI_PASS_THRU_GET_NEXT_TARGET_LUN) (\r
+  IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL                *This,\r
+  IN OUT UINT8                                      **Target,\r
+  IN OUT UINT64                                     *Lun\r
+  )\r
+;   \r
+\r
+/**\r
+  Used to allocate and build a device path node for a SCSI device on a SCSI channel.\r
+\r
+  @param  This       A pointer to the EFI_EXT_SCSI_PASS_THRU_PROTOCOL instance.\r
+  @param  Target     The Target is an array of size TARGET_MAX_BYTES and it specifies the\r
+                     Target ID of the SCSI device for which a device path node is to be\r
+                     allocated and built. Transport drivers may chose to utilize a subset of\r
+                     this size to suit the representation of targets. For example, a Fibre\r
+                     Channel driver may use only 8 bytes (WWN) in the array to represent a\r
+                     FC target.\r
+  @param  Lun        The LUN of the SCSI device for which a device path node is to be\r
+                     allocated and built.\r
+  \r
+  @param  DevicePath A pointer to a single device path node that describes the SCSI device\r
+                     specified by Target and Lun. This function is responsible for\r
+                     allocating the buffer DevicePath with the boot service\r
+                     AllocatePool(). It is the caller's responsibility to free\r
+                     DevicePath when the caller is finished with DevicePath.\r
+\r
+  @retval EFI_SUCCESS           The device path node that describes the SCSI device specified by\r
+                                Target and Lun was allocated and returned in\r
+                                DevicePath.\r
+  @retval EFI_INVALID_PARAMETER DevicePath is NULL.\r
+  @retval EFI_NOT_FOUND         The SCSI devices specified by Target and Lun does not exist\r
+                                on the SCSI channel.\r
+  @retval EFI_OUT_OF_RESOURCES  There are not enough resources to allocate DevicePath.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_EXT_SCSI_PASS_THRU_BUILD_DEVICE_PATH) (\r
+  IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL               *This,\r
+  IN UINT8                                         *Target,\r
+  IN UINT64                                        Lun,\r
+  IN OUT EFI_DEVICE_PATH_PROTOCOL                  **DevicePath\r
+  )\r
+;     \r
+\r
+/**\r
+  Used to translate a device path node to a Target ID and LUN.\r
+\r
+  @param  This       A pointer to the EFI_EXT_SCSI_PASS_THRU_PROTOCOL instance.\r
+  @param  DevicePath A pointer to a single device path node that describes the SCSI device\r
+                     on the SCSI channel.\r
+  @param  Target     A pointer to the Target Array which represents the ID of a SCSI device\r
+                     on the SCSI channel.\r
+  @param  Lun        A pointer to the LUN of a SCSI device on the SCSI channel.\r
+\r
+  @retval EFI_SUCCESS           DevicePath was successfully translated to a Target ID and\r
+                                LUN, and they were returned in Target and Lun.\r
+  @retval EFI_INVALID_PARAMETER DevicePath or Target or Lun is NULL.\r
+  @retval EFI_NOT_FOUND         A valid translation from DevicePath to a Target ID and LUN\r
+                                does not exist.\r
+  @retval EFI_UNSUPPORTED       This driver does not support the device path node type in\r
+                                 DevicePath.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_EXT_SCSI_PASS_THRU_GET_TARGET_LUN) (\r
+  IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL               *This,\r
+  IN EFI_DEVICE_PATH_PROTOCOL                      *DevicePath,\r
+  OUT UINT8                                        **Target,\r
+  OUT UINT64                                       *Lun\r
+  )\r
+;       \r
+\r
+/**\r
+  Resets a SCSI channel. This operation resets all the SCSI devices connected to the SCSI channel.\r
+\r
+  @param  This A pointer to the EFI_EXT_SCSI_PASS_THRU_PROTOCOL instance.\r
+\r
+  @retval EFI_SUCCESS      The SCSI channel was reset.\r
+  @retval EFI_DEVICE_ERROR A device error occurred while attempting to reset the SCSI channel.\r
+  @retval EFI_TIMEOUT      A timeout occurred while attempting to reset the SCSI channel.\r
+  @retval EFI_UNSUPPORTED  The SCSI channel does not support a channel reset operation.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_EXT_SCSI_PASS_THRU_RESET_CHANNEL) (\r
+  IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL               *This\r
+  )\r
+;    \r
+  \r
+/**\r
+  Resets a SCSI logical unit that is connected to a SCSI channel.\r
+\r
+  @param  This   A pointer to the EFI_EXT_SCSI_PASS_THRU_PROTOCOL instance.\r
+  @param  Target The Target is an array of size TARGET_MAX_BYTE and it represents the\r
+                 target port ID of the SCSI device containing the SCSI logical unit to\r
+                 reset. Transport drivers may chose to utilize a subset of this array to suit\r
+                 the representation of their targets.\r
+  @param  Lun    The LUN of the SCSI device to reset.\r
+\r
+  @retval EFI_SUCCESS           The SCSI device specified by Target and Lun was reset.\r
+  @retval EFI_INVALID_PARAMETER Target or Lun is NULL.\r
+  @retval EFI_TIMEOUT           A timeout occurred while attempting to reset the SCSI device\r
+                                specified by Target and Lun.\r
+  @retval EFI_UNSUPPORTED       The SCSI channel does not support a target reset operation.\r
+  @retval EFI_DEVICE_ERROR      A device error occurred while attempting to reset the SCSI device\r
+                                 specified by Target and Lun.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_EXT_SCSI_PASS_THRU_RESET_TARGET_LUN) (\r
+  IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL               *This,\r
+  IN UINT8                                         *Target,\r
+  IN UINT64                                        Lun\r
+  )\r
+;         \r
+\r
+/**\r
+  Used to retrieve the list of legal Target IDs for SCSI devices on a SCSI channel. These can either     \r
+  be the list SCSI devices that are actually present on the SCSI channel, or the list of legal Target IDs\r
+  for the SCSI channel. Regardless, the caller of this function must probe the Target ID returned to     \r
+  see if a SCSI device is actually present at that location on the SCSI channel.                         \r
+\r
+  @param  This   A pointer to the EFI_EXT_SCSI_PASS_THRU_PROTOCOL instance.\r
+  @param  Target (TARGET_MAX_BYTES) of a SCSI device present on the SCSI channel.\r
+                 On output, a pointer to the Target ID (an array of\r
+                 TARGET_MAX_BYTES) of the next SCSI device present on a SCSI\r
+                 channel. An input value of 0xF(all bytes in the array are 0xF) in the\r
+                 Target array retrieves the Target ID of the first SCSI device present on a\r
+                 SCSI channel.\r
+\r
+  @retval EFI_SUCCESS           The Target ID of the next SCSI device on the SCSI\r
+                                channel was returned in Target.\r
+  @retval EFI_INVALID_PARAMETER Target or Lun is NULL.\r
+  @retval EFI_TIMEOUT           Target array is not all 0xF, and Target were not\r
+                                returned on a previous call to GetNextTarget().\r
+  @retval EFI_NOT_FOUND         There are no more SCSI devices on this SCSI channel.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_EXT_SCSI_PASS_THRU_GET_NEXT_TARGET) (\r
+  IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL               *This,\r
+  IN OUT UINT8                                     **Target\r
+  )\r
+;          \r
+  \r
+struct _EFI_EXT_SCSI_PASS_THRU_PROTOCOL {\r
+  EFI_EXT_SCSI_PASS_THRU_MODE                *Mode;\r
+  EFI_EXT_SCSI_PASS_THRU_PASSTHRU            PassThru;\r
+  EFI_EXT_SCSI_PASS_THRU_GET_NEXT_TARGET_LUN GetNextTargetLun;\r
+  EFI_EXT_SCSI_PASS_THRU_BUILD_DEVICE_PATH   BuildDevicePath;\r
+  EFI_EXT_SCSI_PASS_THRU_GET_TARGET_LUN      GetTargetLun;\r
+  EFI_EXT_SCSI_PASS_THRU_RESET_CHANNEL       ResetChannel;\r
+  EFI_EXT_SCSI_PASS_THRU_RESET_TARGET_LUN    ResetTargetLun;\r
+  EFI_EXT_SCSI_PASS_THRU_GET_NEXT_TARGET     GetNextTarget;\r
+};\r
+\r
+extern EFI_GUID gEfiExtScsiPassThruProtocolGuid;\r
+\r
+#endif\r
diff --git a/Tools/Source/TianoTools/Include/Protocol/SectionExtraction.h b/Tools/Source/TianoTools/Include/Protocol/SectionExtraction.h
new file mode 100644 (file)
index 0000000..9200f8a
--- /dev/null
@@ -0,0 +1,162 @@
+/** @file\r
+  This file declares Section Extraction protocols.\r
+\r
+  This interface provides a means of decoding a set of sections into a linked list of\r
+  leaf sections.  This provides for an extensible and flexible file format.\r
+\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. This program and the materials                          \r
+  are licensed and made available under the terms and conditions of the BSD License         \r
+  which accompanies this distribution.  The full text of the license may be found at        \r
+  http://opensource.org/licenses/bsd-license.php                                            \r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+  Module Name:  SectionExtraction.h\r
+\r
+  @par Revision Reference:\r
+  This protocol is defined in Firmware Volume Specification.\r
+  Version 0.9\r
+\r
+**/\r
+\r
+#ifndef __SECTION_EXTRACTION_PROTOCOL_H__\r
+#define __SECTION_EXTRACTION_PROTOCOL_H__\r
+\r
+\r
+//\r
+// Protocol GUID definition\r
+//\r
+#define EFI_SECTION_EXTRACTION_PROTOCOL_GUID \\r
+  { \\r
+    0x448F5DA4, 0x6DD7, 0x4FE1, {0x93, 0x07, 0x69, 0x22, 0x41, 0x92, 0x21, 0x5D } \\r
+  }\r
+\r
+typedef struct _EFI_SECTION_EXTRACTION_PROTOCOL EFI_SECTION_EXTRACTION_PROTOCOL;\r
+\r
+//\r
+// Protocol member functions\r
+//\r
+/**\r
+  Creates and returns a new section stream handle to represent the new section stream.\r
+\r
+  @param  This                  Indicates the EFI_SECTION_EXTRACTION_PROTOCOL instance.  \r
+  @param  SectionStreamLength   Size in bytes of the section stream.  \r
+  @param  SectionStream         Buffer containing the new section stream.  \r
+  @param  SectionStreamHandle   A pointer to a caller-allocated UINTN that, \r
+                                on output, contains the new section stream handle.\r
+\r
+  @retval EFI_SUCCESS           The SectionStream  was successfully processed and \r
+                                the section stream handle was returned.  \r
+  @retval EFI_OUT_OF_RESOURCES  The system has insufficient resources to \r
+                                process the request.  \r
+  @retval EFI_INVALID_PARAMETER The section stream may be corrupt or the value \r
+                                of SectionStreamLength may be incorrect.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_OPEN_SECTION_STREAM) (\r
+  IN  EFI_SECTION_EXTRACTION_PROTOCOL                   *This,\r
+  IN  UINTN                                             SectionStreamLength,\r
+  IN  VOID                                              *SectionStream,\r
+  OUT UINTN                                             *SectionStreamHandle\r
+  );\r
+\r
+/**\r
+  Reads and returns a single section from a section stream.\r
+\r
+  @param  This                  Indicates the EFI_SECTION_EXTRACTION_PROTOCOL instance.                                \r
+  @param  SectionStreamHandle   Indicates from which section stream to read.                                \r
+  @param  SectionType           Pointer to an EFI_SECTION_TYPE.  \r
+  @param  SectionDefinitionGuid Pointer to an EFI_GUID.If SectionType == \r
+                                EFI_SECTION_GUID_DEFINED, SectionDefinitionGuid indicates what section GUID \r
+                                to search for.If SectionType !=EFI_SECTION_GUID_DEFINED, then \r
+                                SectionDefinitionGuid is unused and is ignored.  \r
+  @param  SectionInstance       Indicates which instance of the requested section \r
+                                type to return when SectionType is not NULL.  \r
+  @param  SectionStreamHandle   A pointer to a caller-allocated UINTN that, on output,\r
+                                contains the new section stream handle.  \r
+  @param  Buffer                Pointer to a pointer to a buffer in which the section \r
+                                contents are returned.   \r
+  @param  BufferSize            Pointer to a caller-allocated UINTN.  \r
+  @param  AuthenticationStatus  Pointer to a caller-allocated UINT32 in \r
+                                which any meta-data from encapsulation GUID-defined sections is returned.\r
+\r
+  @retval EFI_SUCCESS           The SectionStream was successfully processed and \r
+                                the section contents were returned in Buffer.  \r
+  @retval EFI_PROTOCOL_ERROR    A GUID-defined section was encountered in \r
+                                the section stream with its EFI_GUIDED_SECTION_PROCESSING_REQUIRED bit set, \r
+                                but there was no corresponding GUIDed Section Extraction Protocol in \r
+                                the handle database.  \r
+  @retval EFI_NOT_FOUND         An error was encountered when parsing the SectionStream, \r
+                                which indicates that the SectionStream is not correctly formatted.\r
+                                Or The requested section does not exist.  \r
+  @retval EFI_OUT_OF_RESOURCES  The system has insufficient resources to process \r
+                                the request.  \r
+  @retval EFI_INVALID_PARAMETER The SectionStreamHandle does not exist.  \r
+  @retval EFI_BUFFER_TOO_SMALL  The size of the input buffer is insufficient to \r
+                                contain the requested section.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_GET_SECTION) (\r
+  IN EFI_SECTION_EXTRACTION_PROTOCOL                    *This,\r
+  IN UINTN                                              SectionStreamHandle,\r
+  IN EFI_SECTION_TYPE                                   *SectionType,\r
+  IN EFI_GUID                                           *SectionDefinitionGuid,\r
+  IN UINTN                                              SectionInstance,\r
+  IN VOID                                               **Buffer,\r
+  IN OUT UINTN                                          *BufferSize,\r
+  OUT UINT32                                            *AuthenticationStatus\r
+  );\r
+\r
+/**\r
+  Deletes a section stream handle and returns all associated resources to the system.\r
+\r
+  @param  This                  Indicates the EFI_SECTION_EXTRACTION_PROTOCOL instance.  \r
+  @param  SectionStreamHandle   Indicates the section stream to close.\r
+  \r
+  @retval EFI_SUCCESS           The SectionStream was successfully processed and \r
+                                the section stream handle was returned.\r
+  \r
+  @retval EFI_INVALID_PARAMETER The SectionStreamHandle does not exist.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_CLOSE_SECTION_STREAM) (\r
+  IN EFI_SECTION_EXTRACTION_PROTOCOL                    *This,\r
+  IN UINTN                                              SectionStreamHandle\r
+  );\r
+\r
+//\r
+// Protocol definition\r
+//\r
+/**\r
+  @par Protocol Description:\r
+  The Section Extraction Protocol provides a simple method of extracting \r
+  sections from arbitrarily complex files.\r
+\r
+  @param OpenSectionStream\r
+  Takes a bounded stream of sections and returns a section stream handle. \r
+\r
+  @param GetSection\r
+  Given a section stream handle, retrieves the requested section and \r
+  meta-data from the section stream. \r
+\r
+  @param CloseSectionStream\r
+  Given a section stream handle, closes the section stream.\r
+\r
+**/\r
+struct _EFI_SECTION_EXTRACTION_PROTOCOL {\r
+  EFI_OPEN_SECTION_STREAM   OpenSectionStream;\r
+  EFI_GET_SECTION           GetSection;\r
+  EFI_CLOSE_SECTION_STREAM  CloseSectionStream;\r
+};\r
+\r
+extern EFI_GUID gEfiSectionExtractionProtocolGuid;\r
+\r
+#endif\r
diff --git a/Tools/Source/TianoTools/Include/Protocol/SerialIo.h b/Tools/Source/TianoTools/Include/Protocol/SerialIo.h
new file mode 100644 (file)
index 0000000..89a7340
--- /dev/null
@@ -0,0 +1,266 @@
+/** @file\r
+  Serial IO protocol as defined in the EFI 1.0 specification.\r
+\r
+  Abstraction of a basic serial device. Targeted at 16550 UART, but\r
+  could be much more generic.\r
+\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. This program and the accompanying materials                          \r
+  are licensed and made available under the terms and conditions of the BSD License         \r
+  which accompanies this distribution.  The full text of the license may be found at        \r
+  http://opensource.org/licenses/bsd-license.php                                            \r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+  Module Name:  SerialIo.h\r
+\r
+**/\r
+\r
+#ifndef __SERIAL_IO_PROTOCOL_H__\r
+#define __SERIAL_IO_PROTOCOL_H__\r
+\r
+#define EFI_SERIAL_IO_PROTOCOL_GUID \\r
+  { \\r
+    0xBB25CF6F, 0xF1D4, 0x11D2, {0x9A, 0x0C, 0x00, 0x90, 0x27, 0x3F, 0xC1, 0xFD } \\r
+  }\r
+\r
+typedef struct _EFI_SERIAL_IO_PROTOCOL EFI_SERIAL_IO_PROTOCOL;\r
+\r
+//\r
+// Serial IO Data structures\r
+//\r
+typedef enum {\r
+  DefaultParity,\r
+  NoParity,\r
+  EvenParity,\r
+  OddParity,\r
+  MarkParity,\r
+  SpaceParity\r
+} EFI_PARITY_TYPE;\r
+\r
+typedef enum {\r
+  DefaultStopBits,\r
+  OneStopBit,\r
+  OneFiveStopBits,\r
+  TwoStopBits\r
+} EFI_STOP_BITS_TYPE;\r
+\r
+//\r
+// define for Control bits, grouped by read only, write only, and read write\r
+//\r
+//\r
+// Read Only\r
+//\r
+#define EFI_SERIAL_CLEAR_TO_SEND        0x00000010\r
+#define EFI_SERIAL_DATA_SET_READY       0x00000020\r
+#define EFI_SERIAL_RING_INDICATE        0x00000040\r
+#define EFI_SERIAL_CARRIER_DETECT       0x00000080\r
+#define EFI_SERIAL_INPUT_BUFFER_EMPTY   0x00000100\r
+#define EFI_SERIAL_OUTPUT_BUFFER_EMPTY  0x00000200\r
+\r
+//\r
+// Write Only\r
+//\r
+#define EFI_SERIAL_REQUEST_TO_SEND      0x00000002\r
+#define EFI_SERIAL_DATA_TERMINAL_READY  0x00000001\r
+\r
+//\r
+// Read Write\r
+//\r
+#define EFI_SERIAL_HARDWARE_LOOPBACK_ENABLE     0x00001000\r
+#define EFI_SERIAL_SOFTWARE_LOOPBACK_ENABLE     0x00002000\r
+#define EFI_SERIAL_HARDWARE_FLOW_CONTROL_ENABLE 0x00004000\r
+\r
+//\r
+// Serial IO Member Functions\r
+//\r
+/**\r
+  Reset the serial device.\r
+\r
+  @param  This              Protocol instance pointer.\r
+                            \r
+  @retval EFI_SUCCESS       The device was reset.\r
+  @retval EFI_DEVICE_ERROR  The serial device could not be reset.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_SERIAL_RESET) (\r
+  IN EFI_SERIAL_IO_PROTOCOL *This\r
+  )\r
+;\r
+\r
+/**\r
+  Sets the baud rate, receive FIFO depth, transmit/receice time out, parity, \r
+  data buts, and stop bits on a serial device.\r
+\r
+  @param  This             Protocol instance pointer.\r
+  @param  BaudRate         The requested baud rate. A BaudRate value of 0 will use the the\r
+                           device's default interface speed.\r
+  @param  ReveiveFifoDepth The requested depth of the FIFO on the receive side of the\r
+                           serial interface. A ReceiveFifoDepth value of 0 will use\r
+                           the device's dfault FIFO depth.\r
+  @param  Timeout          The requested time out for a single character in microseconds.\r
+                           This timeout applies to both the transmit and receive side of the\r
+                           interface. A Timeout value of 0 will use the device's default time\r
+                           out value.\r
+  @param  Parity           The type of parity to use on this serial device. A Parity value of\r
+                           DefaultParity will use the device's default parity value.\r
+  @param  DataBits         The number of data bits to use on the serial device. A DataBits\r
+                           vaule of 0 will use the device's default data bit setting.\r
+  @param  StopBits         The number of stop bits to use on this serial device. A StopBits\r
+                           value of DefaultStopBits will use the device's default number of\r
+                           stop bits.\r
+\r
+  @retval EFI_SUCCESS      The device was reset.\r
+  @retval EFI_DEVICE_ERROR The serial device could not be reset.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_SERIAL_SET_ATTRIBUTES) (\r
+  IN EFI_SERIAL_IO_PROTOCOL         *This,\r
+  IN UINT64                         BaudRate,\r
+  IN UINT32                         ReceiveFifoDepth,\r
+  IN UINT32                         Timeout,\r
+  IN EFI_PARITY_TYPE                Parity,\r
+  IN UINT8                          DataBits,\r
+  IN EFI_STOP_BITS_TYPE             StopBits\r
+  )\r
+;\r
+\r
+/**\r
+  Set the control bits on a serial device\r
+\r
+  @param  This             Protocol instance pointer.\r
+  @param  Control          Set the bits of Control that are settable.\r
+\r
+  @retval EFI_SUCCESS      The new control bits were set on the serial device.\r
+  @retval EFI_UNSUPPORTED  The serial device does not support this operation.\r
+  @retval EFI_DEVICE_ERROR The serial device is not functioning correctly.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_SERIAL_SET_CONTROL_BITS) (\r
+  IN EFI_SERIAL_IO_PROTOCOL         *This,\r
+  IN UINT32                         Control\r
+  )\r
+;\r
+\r
+/**\r
+  Retrieves the status of thecontrol bits on a serial device\r
+\r
+  @param  This              Protocol instance pointer.\r
+  @param  Control           A pointer to return the current Control signals from the serial device.\r
+                            \r
+  @retval EFI_SUCCESS       The control bits were read from the serial device.\r
+  @retval EFI_DEVICE_ERROR  The serial device is not functioning correctly.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_SERIAL_GET_CONTROL_BITS) (\r
+  IN EFI_SERIAL_IO_PROTOCOL         *This,\r
+  OUT UINT32                        *Control\r
+  )\r
+;\r
+\r
+/**\r
+  Writes data to a serial device.\r
+\r
+  @param  This              Protocol instance pointer.\r
+  @param  BufferSize        On input, the size of the Buffer. On output, the amount of\r
+                            data actually written.\r
+  @param  Buffer            The buffer of data to write\r
+\r
+  @retval EFI_SUCCESS       The data was written.\r
+  @retval EFI_DEVICE_ERROR  The device reported an error.\r
+  @retval EFI_TIMEOUT       The data write was stopped due to a timeout.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_SERIAL_WRITE) (\r
+  IN EFI_SERIAL_IO_PROTOCOL         *This,\r
+  IN OUT UINTN                      *BufferSize,\r
+  IN VOID                           *Buffer\r
+  )\r
+;\r
+\r
+/**\r
+  Writes data to a serial device.\r
+\r
+  @param  This              Protocol instance pointer.\r
+  @param  BufferSize        On input, the size of the Buffer. On output, the amount of\r
+                            data returned in Buffer.\r
+  @param  Buffer            The buffer to return the data into.\r
+\r
+  @retval EFI_SUCCESS       The data was read.\r
+  @retval EFI_DEVICE_ERROR  The device reported an error.\r
+  @retval EFI_TIMEOUT       The data write was stopped due to a timeout.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_SERIAL_READ) (\r
+  IN EFI_SERIAL_IO_PROTOCOL         *This,\r
+  IN OUT UINTN                      *BufferSize,\r
+  OUT VOID                          *Buffer\r
+  )\r
+;\r
+\r
+/**\r
+  The data values in SERIAL_IO_MODE are read-only and are updated by the code \r
+  that produces the SERIAL_IO_PROTOCOL member functions.\r
+\r
+  ControlMask - A mask fo the Control bits that the device supports. The device\r
+  must always support the Input Buffer Empty control bit.\r
+  TimeOut  - If applicable, the number of microseconds to wait before timing out\r
+  a Read or Write operation.\r
+  BaudRate - If applicable, the current baud rate setting of the device; otherwise,\r
+  baud rate has the value of zero to indicate that device runs at the\r
+  device's designed speed.\r
+  ReceiveFifoDepth - The number of characters the device will buffer on input\r
+  DataBits - The number of characters the device will buffer on input\r
+  Parity   - If applicable, this is the EFI_PARITY_TYPE that is computed or \r
+  checked as each character is transmitted or reveived. If the device\r
+  does not support parity the value is the default parity value.\r
+  StopBits - If applicable, the EFI_STOP_BITS_TYPE number of stop bits per\r
+  character. If the device does not support stop bits the value is\r
+  the default stop bit values.\r
+\r
+**/\r
+typedef struct {\r
+  UINT32  ControlMask;\r
+\r
+  //\r
+  // current Attributes\r
+  //\r
+  UINT32  Timeout;\r
+  UINT64  BaudRate;\r
+  UINT32  ReceiveFifoDepth;\r
+  UINT32  DataBits;\r
+  UINT32  Parity;\r
+  UINT32  StopBits;\r
+} EFI_SERIAL_IO_MODE;\r
+\r
+#define SERIAL_IO_INTERFACE_REVISION    0x00010000\r
+#define EFI_SERIAL_IO_PROTOCOL_REVISION SERIAL_IO_INTERFACE_REVISION\r
+\r
+struct _EFI_SERIAL_IO_PROTOCOL {\r
+  UINT32                      Revision;\r
+  EFI_SERIAL_RESET            Reset;\r
+  EFI_SERIAL_SET_ATTRIBUTES   SetAttributes;\r
+  EFI_SERIAL_SET_CONTROL_BITS SetControl;\r
+  EFI_SERIAL_GET_CONTROL_BITS GetControl;\r
+  EFI_SERIAL_WRITE            Write;\r
+  EFI_SERIAL_READ             Read;\r
+\r
+  EFI_SERIAL_IO_MODE          *Mode;\r
+};\r
+\r
+extern EFI_GUID gEfiSerialIoProtocolGuid;\r
+\r
+#endif\r
diff --git a/Tools/Source/TianoTools/Include/Protocol/ServiceBinding.h b/Tools/Source/TianoTools/Include/Protocol/ServiceBinding.h
new file mode 100644 (file)
index 0000000..57ce92f
--- /dev/null
@@ -0,0 +1,74 @@
+/** @file\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. This program and the accompanying materials                          \r
+  are licensed and made available under the terms and conditions of the BSD License         \r
+  which accompanies this distribution.  The full text of the license may be found at        \r
+  http://opensource.org/licenses/bsd-license.php                                            \r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+  Module Name:  ServiceBinding.h\r
+\r
+**/\r
+\r
+#ifndef __EFI_SERVICE_BINDING_H__\r
+#define __EFI_SERVICE_BINDING_H__\r
+\r
+//\r
+// Forward reference for pure ANSI compatability\r
+//\r
+typedef struct _EFI_SERVICE_BINDING_PROTOCOL EFI_SERVICE_BINDING_PROTOCOL;\r
+\r
+/**\r
+  Creates a child handle with a set of I/O services.\r
+\r
+  @param  This        Protocol instance pointer.\r
+  @param  ChildHandle Pointer to the handle of the child to create.  If it is NULL,\r
+                      then a new handle is created.  If it is not NULL, then the\r
+                      I/O services are added to the existing child handle.\r
+\r
+  @retval EFI_SUCCES            The child handle was created with the I/O services\r
+  @retval EFI_INVALID_PARAMETER ChildHandle is NULL.\r
+  @retval EFI_OUT_OF_RESOURCES  There are not enough resources availabe to create\r
+                                the child\r
+  @retval other                 The child handle was not created\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_SERVICE_BINDING_CREATE_CHILD) (\r
+  IN     EFI_SERVICE_BINDING_PROTOCOL  *This,\r
+  IN OUT EFI_HANDLE                    *ChildHandle\r
+  )\r
+;\r
+\r
+/**\r
+  Destroys a child handle with a set of I/O services.\r
+\r
+  @param  This        Protocol instance pointer.\r
+  @param  ChildHandle Handle of the child to destroy\r
+\r
+  @retval EFI_SUCCES            The I/O services were removed from the child handle\r
+  @retval EFI_UNSUPPORTED       The child handle does not support the I/O services\r
+                                that are being removed.\r
+  @retval EFI_INVALID_PARAMETER Child handle is not a valid EFI Handle.\r
+  @retval EFI_ACCESS_DENIED     The child handle could not be destroyed because its\r
+                                I/O services are being used.\r
+  @retval other                 The child handle was not destroyed\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_SERVICE_BINDING_DESTROY_CHILD) (\r
+  IN EFI_SERVICE_BINDING_PROTOCOL          *This,\r
+  IN EFI_HANDLE                            ChildHandle\r
+  )\r
+;\r
+\r
+struct _EFI_SERVICE_BINDING_PROTOCOL {\r
+  EFI_SERVICE_BINDING_CREATE_CHILD         CreateChild;\r
+  EFI_SERVICE_BINDING_DESTROY_CHILD        DestroyChild;\r
+};\r
+\r
+#endif\r
diff --git a/Tools/Source/TianoTools/Include/Protocol/SimpleFileSystem.h b/Tools/Source/TianoTools/Include/Protocol/SimpleFileSystem.h
new file mode 100644 (file)
index 0000000..add8ad6
--- /dev/null
@@ -0,0 +1,328 @@
+/** @file\r
+  SimpleFileSystem protocol as defined in the EFI 1.0 specification.\r
+\r
+  The SimpleFileSystem protocol is the programatic access to the FAT (12,16,32) \r
+  file system specified in EFI 1.0. It can also be used to abstract a file  \r
+  system other than FAT.\r
+\r
+  EFI 1.0 can boot from any valid EFI image contained in a SimpleFileSystem\r
+\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. This program and the accompanying materials                          \r
+  are licensed and made available under the terms and conditions of the BSD License         \r
+  which accompanies this distribution.  The full text of the license may be found at        \r
+  http://opensource.org/licenses/bsd-license.php                                            \r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+  Module Name:  SimpleFileSystem.h\r
+\r
+**/\r
+\r
+#ifndef __SIMPLE_FILE_SYSTEM_H__\r
+#define __SIMPLE_FILE_SYSTEM_H__\r
+\r
+#define EFI_SIMPLE_FILE_SYSTEM_PROTOCOL_GUID \\r
+  { \\r
+    0x964e5b22, 0x6459, 0x11d2, {0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b } \\r
+  }\r
+\r
+typedef struct _EFI_SIMPLE_FILE_SYSTEM_PROTOCOL  EFI_SIMPLE_FILE_SYSTEM_PROTOCOL;\r
+typedef struct _EFI_FILE  EFI_FILE;\r
+typedef struct _EFI_FILE  *EFI_FILE_HANDLE;\r
+typedef struct _EFI_FILE  EFI_FILE_PROTOCOL;\r
+\r
+/**\r
+  Open the root directory on a volume.\r
+\r
+  @param  This Protocol instance pointer.\r
+  @param  Root Returns an Open file handle for the root directory\r
+\r
+  @retval EFI_SUCCESS          The device was opened.\r
+  @retval EFI_UNSUPPORTED      This volume does not suppor the file system.\r
+  @retval EFI_NO_MEDIA         The device has no media.\r
+  @retval EFI_DEVICE_ERROR     The device reported an error.\r
+  @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted\r
+  @retval EFI_ACCESS_DENIED    The service denied access to the file\r
+  @retval EFI_OUT_OF_RESOURCES The volume was not opened due to lack of resources\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_SIMPLE_FILE_SYSTEM_PROTOCOL_OPEN_VOLUME) (\r
+  IN EFI_SIMPLE_FILE_SYSTEM_PROTOCOL    *This,\r
+  OUT EFI_FILE                          **Root\r
+  )\r
+;\r
+\r
+#define EFI_SIMPLE_FILE_SYSTEM_PROTOCOL_REVISION  0x00010000\r
+\r
+struct _EFI_SIMPLE_FILE_SYSTEM_PROTOCOL {\r
+  UINT64                                      Revision;\r
+  EFI_SIMPLE_FILE_SYSTEM_PROTOCOL_OPEN_VOLUME OpenVolume;\r
+};\r
+\r
+/**\r
+  Open the root directory on a volume.\r
+\r
+  @param  This       Protocol instance pointer.\r
+  @param  NewHandle  Returns File Handle for FileName\r
+  @param  FileName   Null terminated string. "\", ".", and ".." are supported\r
+  @param  OpenMode   Open mode for file.\r
+  @param  Attributes Only used for EFI_FILE_MODE_CREATE\r
+\r
+  @retval EFI_SUCCESS          The device was opened.\r
+  @retval EFI_NOT_FOUND        The specified file could not be found on the device\r
+  @retval EFI_NO_MEDIA         The device has no media.\r
+  @retval EFI_MEDIA_CHANGED    The media has changed\r
+  @retval EFI_DEVICE_ERROR     The device reported an error.\r
+  @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted\r
+  @retval EFI_ACCESS_DENIED    The service denied access to the file\r
+  @retval EFI_OUT_OF_RESOURCES The volume was not opened due to lack of resources\r
+  @retval EFI_VOLUME_FULL      The volume is full.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_FILE_OPEN) (\r
+  IN EFI_FILE                 *This,\r
+  OUT EFI_FILE                **NewHandle,\r
+  IN CHAR16                   *FileName,\r
+  IN UINT64                   OpenMode,\r
+  IN UINT64                   Attributes\r
+  )\r
+;\r
+\r
+//\r
+// Open modes\r
+//\r
+#define EFI_FILE_MODE_READ    0x0000000000000001ULL\r
+#define EFI_FILE_MODE_WRITE   0x0000000000000002ULL\r
+#define EFI_FILE_MODE_CREATE  0x8000000000000000ULL\r
+\r
+//\r
+// File attributes\r
+//\r
+#define EFI_FILE_READ_ONLY  0x0000000000000001ULL\r
+#define EFI_FILE_HIDDEN     0x0000000000000002ULL\r
+#define EFI_FILE_SYSTEM     0x0000000000000004ULL\r
+#define EFI_FILE_RESERVED   0x0000000000000008ULL\r
+#define EFI_FILE_DIRECTORY  0x0000000000000010ULL\r
+#define EFI_FILE_ARCHIVE    0x0000000000000020ULL\r
+#define EFI_FILE_VALID_ATTR 0x0000000000000037ULL\r
+\r
+/**\r
+  Close the file handle\r
+\r
+  @param  This          Protocol instance pointer.\r
+\r
+  @retval EFI_SUCCESS   The device was opened.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_FILE_CLOSE) (\r
+  IN EFI_FILE  *This\r
+  )\r
+;\r
+\r
+/**\r
+  Close and delete the file handle\r
+\r
+  @param  This                     Protocol instance pointer.\r
+                                   \r
+  @retval EFI_SUCCESS              The device was opened.\r
+  @retval EFI_WARN_DELETE_FAILURE  The handle was closed but the file was not deleted\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_FILE_DELETE) (\r
+  IN EFI_FILE  *This\r
+  )\r
+;\r
+\r
+/**\r
+  Read data from the file.\r
+\r
+  @param  This       Protocol instance pointer.\r
+  @param  BufferSize On input size of buffer, on output amount of data in buffer.\r
+  @param  Buffer     The buffer in which data is read.\r
+\r
+  @retval EFI_SUCCESS          Data was read.\r
+  @retval EFI_NO_MEDIA         The device has no media\r
+  @retval EFI_DEVICE_ERROR     The device reported an error\r
+  @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted\r
+  @retval EFI_BUFFER_TO_SMALL  BufferSize is too small. BufferSize contains required size\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_FILE_READ) (\r
+  IN EFI_FILE                 *This,\r
+  IN OUT UINTN                *BufferSize,\r
+  OUT VOID                    *Buffer\r
+  )\r
+;\r
+\r
+/**\r
+  Write data from to the file.\r
+\r
+  @param  This       Protocol instance pointer.\r
+  @param  BufferSize On input size of buffer, on output amount of data in buffer.\r
+  @param  Buffer     The buffer in which data to write.\r
+\r
+  @retval EFI_SUCCESS          Data was written.\r
+  @retval EFI_UNSUPPORT        Writes to Open directory are not supported\r
+  @retval EFI_NO_MEDIA         The device has no media\r
+  @retval EFI_DEVICE_ERROR     The device reported an error\r
+  @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted\r
+  @retval EFI_WRITE_PROTECTED  The device is write protected\r
+  @retval EFI_ACCESS_DENIED    The file was open for read only\r
+  @retval EFI_VOLUME_FULL      The volume is full\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_FILE_WRITE) (\r
+  IN EFI_FILE                 *This,\r
+  IN OUT UINTN                *BufferSize,\r
+  IN VOID                     *Buffer\r
+  )\r
+;\r
+\r
+/**\r
+  Set a files current position\r
+\r
+  @param  This            Protocol instance pointer.\r
+  @param  Position        Byte possition from the start of the file\r
+                          \r
+  @retval EFI_SUCCESS     Data was written.\r
+  @retval EFI_UNSUPPORTED Seek request for non-zero is not valid on open.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_FILE_SET_POSITION) (\r
+  IN EFI_FILE                 *This,\r
+  IN UINT64                   Position\r
+  )\r
+;\r
+\r
+/**\r
+  Get a files current position\r
+\r
+  @param  This            Protocol instance pointer.\r
+  @param  Position        Byte possition from the start of the file\r
+                          \r
+  @retval EFI_SUCCESS     Data was written.\r
+  @retval EFI_UNSUPPORTED Seek request for non-zero is not valid on open.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_FILE_GET_POSITION) (\r
+  IN EFI_FILE                 *This,\r
+  OUT UINT64                  *Position\r
+  )\r
+;\r
+\r
+/**\r
+  Get information about a file\r
+\r
+  @param  This            Protocol instance pointer.\r
+  @param  InformationType Type of info to return in Buffer\r
+  @param  BufferSize      On input size of buffer, on output amount of data in buffer.\r
+  @param  Buffer          The buffer to return data.\r
+\r
+  @retval EFI_SUCCESS          Data was returned.\r
+  @retval EFI_UNSUPPORT        InformationType is not supported\r
+  @retval EFI_NO_MEDIA         The device has no media\r
+  @retval EFI_DEVICE_ERROR     The device reported an error\r
+  @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted\r
+  @retval EFI_WRITE_PROTECTED  The device is write protected\r
+  @retval EFI_ACCESS_DENIED    The file was open for read only\r
+  @retval EFI_BUFFER_TOO_SMALL Buffer was too small, required size returned in BufferSize\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_FILE_GET_INFO) (\r
+  IN EFI_FILE                 *This,\r
+  IN EFI_GUID                 *InformationType,\r
+  IN OUT UINTN                *BufferSize,\r
+  OUT VOID                    *Buffer\r
+  )\r
+;\r
+\r
+/**\r
+  Set information about a file\r
+\r
+  @param  File            Protocol instance pointer.\r
+  @param  InformationType Type of info in Buffer\r
+  @param  BufferSize      Size of buffer.\r
+  @param  Buffer          The data to write.\r
+\r
+  @retval EFI_SUCCESS          Data was returned.\r
+  @retval EFI_UNSUPPORT        InformationType is not supported\r
+  @retval EFI_NO_MEDIA         The device has no media\r
+  @retval EFI_DEVICE_ERROR     The device reported an error\r
+  @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted\r
+  @retval EFI_WRITE_PROTECTED  The device is write protected\r
+  @retval EFI_ACCESS_DENIED    The file was open for read only\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_FILE_SET_INFO) (\r
+  IN EFI_FILE                 *This,\r
+  IN EFI_GUID                 *InformationType,\r
+  IN UINTN                    BufferSize,\r
+  IN VOID                     *Buffer\r
+  )\r
+;\r
+\r
+/**\r
+  Flush data back for the file handle\r
+\r
+  @param  This Protocol instance pointer.\r
+\r
+  @retval EFI_SUCCESS          Data was written.\r
+  @retval EFI_UNSUPPORT        Writes to Open directory are not supported\r
+  @retval EFI_NO_MEDIA         The device has no media\r
+  @retval EFI_DEVICE_ERROR     The device reported an error\r
+  @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted\r
+  @retval EFI_WRITE_PROTECTED  The device is write protected\r
+  @retval EFI_ACCESS_DENIED    The file was open for read only\r
+  @retval EFI_VOLUME_FULL      The volume is full\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_FILE_FLUSH) (\r
+  IN EFI_FILE  *This\r
+  )\r
+;\r
+\r
+#define EFI_FILE_HANDLE_REVISION   0x00010000\r
+#define EFI_FILE_PROTOCOL_REVISION EFI_FILE_HANDLE_REVISION\r
+\r
+struct _EFI_FILE {\r
+  UINT64                Revision;\r
+  EFI_FILE_OPEN         Open;\r
+  EFI_FILE_CLOSE        Close;\r
+  EFI_FILE_DELETE       Delete;\r
+  EFI_FILE_READ         Read;\r
+  EFI_FILE_WRITE        Write;\r
+  EFI_FILE_GET_POSITION GetPosition;\r
+  EFI_FILE_SET_POSITION SetPosition;\r
+  EFI_FILE_GET_INFO     GetInfo;\r
+  EFI_FILE_SET_INFO     SetInfo;\r
+  EFI_FILE_FLUSH        Flush;\r
+};\r
+\r
+\r
+extern EFI_GUID gEfiSimpleFileSystemProtocolGuid;\r
+\r
+#endif\r
diff --git a/Tools/Source/TianoTools/Include/Protocol/SimpleNetwork.h b/Tools/Source/TianoTools/Include/Protocol/SimpleNetwork.h
new file mode 100644 (file)
index 0000000..0da64bb
--- /dev/null
@@ -0,0 +1,580 @@
+/** @file\r
+  Simple Network protocol as defined in the EFI 1.0 specification.\r
+\r
+  Basic network device abstraction.\r
+\r
+  Rx    - Received\r
+  Tx    - Transmit\r
+  MCast - MultiCast\r
+  ...\r
+\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. This program and the accompanying materials                          \r
+  are licensed and made available under the terms and conditions of the BSD License         \r
+  which accompanies this distribution.  The full text of the license may be found at        \r
+  http://opensource.org/licenses/bsd-license.php                                            \r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+  Module Name:  SimpleNetwork.h\r
+\r
+**/\r
+\r
+#ifndef __SIMPLE_NETWORK_H__\r
+#define __SIMPLE_NETWORK_H__\r
+\r
+#define EFI_SIMPLE_NETWORK_PROTOCOL_GUID \\r
+  { \\r
+    0xA19832B9, 0xAC25, 0x11D3, {0x9A, 0x2D, 0x00, 0x90, 0x27, 0x3F, 0xC1, 0x4D } \\r
+  }\r
+\r
+typedef struct _EFI_SIMPLE_NETWORK_PROTOCOL  EFI_SIMPLE_NETWORK_PROTOCOL;\r
+\r
+//\r
+// Simple Network Protocol data structures\r
+//\r
+typedef struct {\r
+  //\r
+  // Total number of frames received.  Includes frames with errors and\r
+  // dropped frames.\r
+  //\r
+  UINT64  RxTotalFrames;\r
+\r
+  //\r
+  // Number of valid frames received and copied into receive buffers.\r
+  //\r
+  UINT64  RxGoodFrames;\r
+\r
+  //\r
+  // Number of frames below the minimum length for the media.\r
+  // This would be <64 for ethernet.\r
+  //\r
+  UINT64  RxUndersizeFrames;\r
+\r
+  //\r
+  // Number of frames longer than the maxminum length for the\r
+  // media.  This would be >1500 for ethernet.\r
+  //\r
+  UINT64  RxOversizeFrames;\r
+\r
+  //\r
+  // Valid frames that were dropped because receive buffers were full.\r
+  //\r
+  UINT64  RxDroppedFrames;\r
+\r
+  //\r
+  // Number of valid unicast frames received and not dropped.\r
+  //\r
+  UINT64  RxUnicastFrames;\r
+\r
+  //\r
+  // Number of valid broadcast frames received and not dropped.\r
+  //\r
+  UINT64  RxBroadcastFrames;\r
+\r
+  //\r
+  // Number of valid mutlicast frames received and not dropped.\r
+  //\r
+  UINT64  RxMulticastFrames;\r
+\r
+  //\r
+  // Number of frames w/ CRC or alignment errors.\r
+  //\r
+  UINT64  RxCrcErrorFrames;\r
+\r
+  //\r
+  // Total number of bytes received.  Includes frames with errors\r
+  // and dropped frames.\r
+  //\r
+  UINT64  RxTotalBytes;\r
+\r
+  //\r
+  // Transmit statistics.\r
+  //\r
+  UINT64  TxTotalFrames;\r
+  UINT64  TxGoodFrames;\r
+  UINT64  TxUndersizeFrames;\r
+  UINT64  TxOversizeFrames;\r
+  UINT64  TxDroppedFrames;\r
+  UINT64  TxUnicastFrames;\r
+  UINT64  TxBroadcastFrames;\r
+  UINT64  TxMulticastFrames;\r
+  UINT64  TxCrcErrorFrames;\r
+  UINT64  TxTotalBytes;\r
+\r
+  //\r
+  // Number of collisions detection on this subnet.\r
+  //\r
+  UINT64  Collisions;\r
+\r
+  //\r
+  // Number of frames destined for unsupported protocol.\r
+  //\r
+  UINT64  UnsupportedProtocol;\r
+\r
+} EFI_NETWORK_STATISTICS;\r
+\r
+typedef enum {\r
+  EfiSimpleNetworkStopped,\r
+  EfiSimpleNetworkStarted,\r
+  EfiSimpleNetworkInitialized,\r
+  EfiSimpleNetworkMaxState\r
+} EFI_SIMPLE_NETWORK_STATE;\r
+\r
+#define EFI_SIMPLE_NETWORK_RECEIVE_UNICAST                0x01\r
+#define EFI_SIMPLE_NETWORK_RECEIVE_MULTICAST              0x02\r
+#define EFI_SIMPLE_NETWORK_RECEIVE_BROADCAST              0x04\r
+#define EFI_SIMPLE_NETWORK_RECEIVE_PROMISCUOUS            0x08\r
+#define EFI_SIMPLE_NETWORK_RECEIVE_PROMISCUOUS_MULTICAST  0x10\r
+\r
+#define EFI_SIMPLE_NETWORK_RECEIVE_INTERRUPT              0x01\r
+#define EFI_SIMPLE_NETWORK_TRANSMIT_INTERRUPT             0x02\r
+#define EFI_SIMPLE_NETWORK_COMMAND_INTERRUPT              0x04\r
+#define EFI_SIMPLE_NETWORK_SOFTWARE_INTERRUPT             0x08\r
+\r
+#define MAX_MCAST_FILTER_CNT                              16\r
+typedef struct {\r
+  UINT32          State;\r
+  UINT32          HwAddressSize;\r
+  UINT32          MediaHeaderSize;\r
+  UINT32          MaxPacketSize;\r
+  UINT32          NvRamSize;\r
+  UINT32          NvRamAccessSize;\r
+  UINT32          ReceiveFilterMask;\r
+  UINT32          ReceiveFilterSetting;\r
+  UINT32          MaxMCastFilterCount;\r
+  UINT32          MCastFilterCount;\r
+  EFI_MAC_ADDRESS MCastFilter[MAX_MCAST_FILTER_CNT];\r
+  EFI_MAC_ADDRESS CurrentAddress;\r
+  EFI_MAC_ADDRESS BroadcastAddress;\r
+  EFI_MAC_ADDRESS PermanentAddress;\r
+  UINT8           IfType;\r
+  BOOLEAN         MacAddressChangeable;\r
+  BOOLEAN         MultipleTxSupported;\r
+  BOOLEAN         MediaPresentSupported;\r
+  BOOLEAN         MediaPresent;\r
+} EFI_SIMPLE_NETWORK_MODE;\r
+\r
+//\r
+// Protocol Member Functions\r
+//\r
+/**\r
+  Changes the state of a network interface from "stopped" to "started".\r
+\r
+  @param  This Protocol instance pointer.\r
+\r
+  @retval EFI_SUCCESS           The network interface was started.\r
+  @retval EFI_ALREADY_STARTED   The network interface is already in the started state.\r
+  @retval EFI_INVALID_PARAMETER One or more of the parameters has an unsupported value.\r
+  @retval EFI_DEVICE_ERROR      The command could not be sent to the network interface.\r
+  @retval EFI_UNSUPPORTED       This function is not supported by the network interface.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_SIMPLE_NETWORK_START) (\r
+  IN EFI_SIMPLE_NETWORK_PROTOCOL  *This\r
+  )\r
+;\r
+\r
+/**\r
+  Changes the state of a network interface from "started" to "stopped".\r
+\r
+  @param  This Protocol instance pointer.\r
+\r
+  @retval EFI_SUCCESS           The network interface was stopped.\r
+  @retval EFI_ALREADY_STARTED   The network interface is already in the stopped state.\r
+  @retval EFI_INVALID_PARAMETER One or more of the parameters has an unsupported value.\r
+  @retval EFI_DEVICE_ERROR      The command could not be sent to the network interface.\r
+  @retval EFI_UNSUPPORTED       This function is not supported by the network interface.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_SIMPLE_NETWORK_STOP) (\r
+  IN EFI_SIMPLE_NETWORK_PROTOCOL  *This\r
+  )\r
+;\r
+\r
+/**\r
+  Resets a network adapter and allocates the transmit and receive buffers \r
+  required by the network interface; optionally, also requests allocation \r
+  of additional transmit and receive buffers.\r
+\r
+  @param  This              Protocol instance pointer.\r
+  @param  ExtraRxBufferSize The size, in bytes, of the extra receive buffer space\r
+                            that the driver should allocate for the network interface.\r
+                            Some network interfaces will not be able to use the extra\r
+                            buffer, and the caller will not know if it is actually\r
+                            being used.\r
+  @param  ExtraTxBufferSize The size, in bytes, of the extra transmit buffer space\r
+                            that the driver should allocate for the network interface.\r
+                            Some network interfaces will not be able to use the extra\r
+                            buffer, and the caller will not know if it is actually\r
+                            being used.\r
+\r
+  @retval EFI_SUCCESS           The network interface was initialized.\r
+  @retval EFI_NOT_STARTED       The network interface has not been started\r
+  @retval EFI_OUT_OF_RESOURCES  There was not enough memory for the transmit and\r
+                                receive buffers.   .\r
+  @retval EFI_INVALID_PARAMETER One or more of the parameters has an unsupported value.\r
+  @retval EFI_DEVICE_ERROR      The command could not be sent to the network interface.\r
+  @retval EFI_UNSUPPORTED       This function is not supported by the network interface.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_SIMPLE_NETWORK_INITIALIZE) (\r
+  IN EFI_SIMPLE_NETWORK_PROTOCOL                    *This,\r
+  IN UINTN                                          ExtraRxBufferSize  OPTIONAL,\r
+  IN UINTN                                          ExtraTxBufferSize  OPTIONAL\r
+  )\r
+;\r
+\r
+/**\r
+  Resets a network adapter and re-initializes it with the parameters that were \r
+  provided in the previous call to Initialize().  \r
+\r
+  @param  This                 Protocol instance pointer.\r
+  @param  ExtendedVerification Indicates that the driver may perform a more\r
+                               exhaustive verification operation of the device\r
+                               during reset.\r
+\r
+  @retval EFI_SUCCESS           The network interface was reset.\r
+  @retval EFI_NOT_STARTED       The network interface has not been started\r
+  @retval EFI_INVALID_PARAMETER One or more of the parameters has an unsupported value.\r
+  @retval EFI_DEVICE_ERROR      The command could not be sent to the network interface.\r
+  @retval EFI_UNSUPPORTED       This function is not supported by the network interface.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_SIMPLE_NETWORK_RESET) (\r
+  IN EFI_SIMPLE_NETWORK_PROTOCOL   *This,\r
+  IN BOOLEAN                       ExtendedVerification\r
+  )\r
+;\r
+\r
+/**\r
+  Resets a network adapter and leaves it in a state that is safe for \r
+  another driver to initialize.\r
+\r
+  @param  This Protocol instance pointer.\r
+\r
+  @retval EFI_SUCCESS           The network interface was shutdown.\r
+  @retval EFI_NOT_STARTED       The network interface has not been started\r
+  @retval EFI_INVALID_PARAMETER One or more of the parameters has an unsupported value.\r
+  @retval EFI_DEVICE_ERROR      The command could not be sent to the network interface.\r
+  @retval EFI_UNSUPPORTED       This function is not supported by the network interface.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_SIMPLE_NETWORK_SHUTDOWN) (\r
+  IN EFI_SIMPLE_NETWORK_PROTOCOL  *This\r
+  )\r
+;\r
+\r
+/**\r
+  Manages the multicast receive filters of a network interface.\r
+\r
+  @param  This             Protocol instance pointer.\r
+  @param  Enable           A bit mask of receive filters to enable on the network interface.\r
+  @param  Disable          A bit mask of receive filters to disable on the network interface.\r
+  @param  ResetMCastFilter Set to TRUE to reset the contents of the multicast receive\r
+                           filters on the network interface to their default values.\r
+  @param  McastFilterCnt   Number of multicast HW MAC addresses in the new\r
+                           MCastFilter list. This value must be less than or equal to\r
+                           the MCastFilterCnt field of EFI_SIMPLE_NETWORK_MODE. This\r
+                           field is optional if ResetMCastFilter is TRUE.\r
+  @param  MCastFilter      A pointer to a list of new multicast receive filter HW MAC\r
+                           addresses. This list will replace any existing multicast\r
+                           HW MAC address list. This field is optional if\r
+                           ResetMCastFilter is TRUE.\r
+\r
+  @retval EFI_SUCCESS           The multicast receive filter list was updated.\r
+  @retval EFI_NOT_STARTED       The network interface has not been started\r
+  @retval EFI_INVALID_PARAMETER One or more of the parameters has an unsupported value.\r
+  @retval EFI_DEVICE_ERROR      The command could not be sent to the network interface.\r
+  @retval EFI_UNSUPPORTED       This function is not supported by the network interface.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_SIMPLE_NETWORK_RECEIVE_FILTERS) (\r
+  IN EFI_SIMPLE_NETWORK_PROTOCOL                             *This,\r
+  IN UINT32                                                  Enable,\r
+  IN UINT32                                                  Disable,\r
+  IN BOOLEAN                                                 ResetMCastFilter,\r
+  IN UINTN                                                   MCastFilterCnt     OPTIONAL,\r
+  IN EFI_MAC_ADDRESS                                         *MCastFilter OPTIONAL\r
+  )\r
+;\r
+\r
+/**\r
+  Modifies or resets the current station address, if supported.\r
+\r
+  @param  This  Protocol instance pointer.\r
+  @param  Reset Flag used to reset the station address to the network interfaces\r
+                permanent address.\r
+  @param  New   New station address to be used for the network interface.\r
+\r
+  @retval EFI_SUCCESS           The network interfaces station address was updated.\r
+  @retval EFI_NOT_STARTED       The network interface has not been started\r
+  @retval EFI_INVALID_PARAMETER One or more of the parameters has an unsupported value.\r
+  @retval EFI_DEVICE_ERROR      The command could not be sent to the network interface.\r
+  @retval EFI_UNSUPPORTED       This function is not supported by the network interface.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_SIMPLE_NETWORK_STATION_ADDRESS) (\r
+  IN EFI_SIMPLE_NETWORK_PROTOCOL            *This,\r
+  IN BOOLEAN                                Reset,\r
+  IN EFI_MAC_ADDRESS                        *New OPTIONAL\r
+  )\r
+;\r
+\r
+/**\r
+  Resets or collects the statistics on a network interface.\r
+\r
+  @param  This            Protocol instance pointer.\r
+  @param  Reset           Set to TRUE to reset the statistics for the network interface.\r
+  @param  StatisticsSize  On input the size, in bytes, of StatisticsTable. On\r
+                          output the size, in bytes, of the resulting table of\r
+                          statistics.\r
+  @param  StatisticsTable A pointer to the EFI_NETWORK_STATISTICS structure that\r
+                          contains the statistics.\r
+\r
+  @retval EFI_SUCCESS           The statistics were collected from the network interface.\r
+  @retval EFI_NOT_STARTED       The network interface has not been started.\r
+  @retval EFI_BUFFER_TOO_SMALL  The Statistics buffer was too small. The current buffer\r
+                                size needed to hold the statistics is returned in\r
+                                StatisticsSize.\r
+  @retval EFI_INVALID_PARAMETER One or more of the parameters has an unsupported value.\r
+  @retval EFI_DEVICE_ERROR      The command could not be sent to the network interface.\r
+  @retval EFI_UNSUPPORTED       This function is not supported by the network interface.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_SIMPLE_NETWORK_STATISTICS) (\r
+  IN EFI_SIMPLE_NETWORK_PROTOCOL          *This,\r
+  IN BOOLEAN                              Reset,\r
+  IN OUT UINTN                            *StatisticsSize   OPTIONAL,\r
+  OUT EFI_NETWORK_STATISTICS              *StatisticsTable  OPTIONAL\r
+  )\r
+;\r
+\r
+/**\r
+  Converts a multicast IP address to a multicast HW MAC address.\r
+\r
+  @param  This Protocol instance pointer.\r
+  @param  IPv6 Set to TRUE if the multicast IP address is IPv6 [RFC 2460]. Set\r
+               to FALSE if the multicast IP address is IPv4 [RFC 791].\r
+  @param  IP   The multicast IP address that is to be converted to a multicast\r
+               HW MAC address.\r
+  @param  MAC  The multicast HW MAC address that is to be generated from IP.\r
+\r
+  @retval EFI_SUCCESS           The multicast IP address was mapped to the multicast\r
+                                HW MAC address.\r
+  @retval EFI_NOT_STARTED       The network interface has not been started.\r
+  @retval EFI_BUFFER_TOO_SMALL  The Statistics buffer was too small. The current buffer\r
+                                size needed to hold the statistics is returned in\r
+                                StatisticsSize.\r
+  @retval EFI_INVALID_PARAMETER One or more of the parameters has an unsupported value.\r
+  @retval EFI_DEVICE_ERROR      The command could not be sent to the network interface.\r
+  @retval EFI_UNSUPPORTED       This function is not supported by the network interface.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_SIMPLE_NETWORK_MCAST_IP_TO_MAC) (\r
+  IN EFI_SIMPLE_NETWORK_PROTOCOL          *This,\r
+  IN BOOLEAN                              IPv6,\r
+  IN EFI_IP_ADDRESS                       *IP,\r
+  OUT EFI_MAC_ADDRESS                     *MAC\r
+  )\r
+;\r
+\r
+/**\r
+  Performs read and write operations on the NVRAM device attached to a \r
+  network interface.\r
+\r
+  @param  This       Protocol instance pointer.\r
+  @param  ReadWrite  TRUE for read operations, FALSE for write operations.\r
+  @param  Offset     Byte offset in the NVRAM device at which to start the read or\r
+                     write operation. This must be a multiple of NvRamAccessSize and\r
+                     less than NvRamSize.\r
+  @param  BufferSize The number of bytes to read or write from the NVRAM device.\r
+                     This must also be a multiple of NvramAccessSize.\r
+  @param  Buffer     A pointer to the data buffer.\r
+\r
+  @retval EFI_SUCCESS           The NVRAM access was performed.\r
+  @retval EFI_NOT_STARTED       The network interface has not been started.\r
+  @retval EFI_INVALID_PARAMETER One or more of the parameters has an unsupported value.\r
+  @retval EFI_DEVICE_ERROR      The command could not be sent to the network interface.\r
+  @retval EFI_UNSUPPORTED       This function is not supported by the network interface.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_SIMPLE_NETWORK_NVDATA) (\r
+  IN EFI_SIMPLE_NETWORK_PROTOCOL          *This,\r
+  IN BOOLEAN                              ReadWrite,\r
+  IN UINTN                                Offset,\r
+  IN UINTN                                BufferSize,\r
+  IN OUT VOID                             *Buffer\r
+  )\r
+;\r
+\r
+/**\r
+  Reads the current interrupt status and recycled transmit buffer status from \r
+  a network interface.\r
+\r
+  @param  This            Protocol instance pointer.\r
+  @param  InterruptStatus A pointer to the bit mask of the currently active interrupts\r
+                          If this is NULL, the interrupt status will not be read from\r
+                          the device. If this is not NULL, the interrupt status will\r
+                          be read from the device. When the  interrupt status is read,\r
+                          it will also be cleared. Clearing the transmit  interrupt\r
+                          does not empty the recycled transmit buffer array.\r
+  @param  TxBuf           Recycled transmit buffer address. The network interface will\r
+                          not transmit if its internal recycled transmit buffer array\r
+                          is full. Reading the transmit buffer does not clear the\r
+                          transmit interrupt. If this is NULL, then the transmit buffer\r
+                          status will not be read. If there are no transmit buffers to\r
+                          recycle and TxBuf is not NULL, * TxBuf will be set to NULL.\r
+\r
+  @retval EFI_SUCCESS           The status of the network interface was retrieved.\r
+  @retval EFI_NOT_STARTED       The network interface has not been started.\r
+  @retval EFI_INVALID_PARAMETER One or more of the parameters has an unsupported value.\r
+  @retval EFI_DEVICE_ERROR      The command could not be sent to the network interface.\r
+  @retval EFI_UNSUPPORTED       This function is not supported by the network interface.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_SIMPLE_NETWORK_GET_STATUS) (\r
+  IN EFI_SIMPLE_NETWORK_PROTOCOL          *This,\r
+  OUT UINT32                              *InterruptStatus OPTIONAL,\r
+  OUT VOID                                **TxBuf OPTIONAL\r
+  )\r
+;\r
+\r
+/**\r
+  Places a packet in the transmit queue of a network interface.\r
+\r
+  @param  This       Protocol instance pointer.\r
+  @param  HeaderSize The size, in bytes, of the media header to be filled in by\r
+                     the Transmit() function. If HeaderSize is non-zero, then it\r
+                     must be equal to This->Mode->MediaHeaderSize and the DestAddr\r
+                     and Protocol parameters must not be NULL.\r
+  @param  BufferSize The size, in bytes, of the entire packet (media header and\r
+                     data) to be transmitted through the network interface.\r
+  @param  Buffer     A pointer to the packet (media header followed by data) to be\r
+                     transmitted. This parameter cannot be NULL. If HeaderSize is zero,\r
+                     then the media header in Buffer must already be filled in by the\r
+                     caller. If HeaderSize is non-zero, then the media header will be\r
+                     filled in by the Transmit() function.\r
+  @param  SrcAddr    The source HW MAC address. If HeaderSize is zero, then this parameter\r
+                     is ignored. If HeaderSize is non-zero and SrcAddr is NULL, then\r
+                     This->Mode->CurrentAddress is used for the source HW MAC address.\r
+  @param  DsetAddr   The destination HW MAC address. If HeaderSize is zero, then this\r
+                     parameter is ignored.\r
+  @param  Protocol   The type of header to build. If HeaderSize is zero, then this\r
+                     parameter is ignored. See RFC 1700, section "Ether Types", for\r
+                     examples.\r
+\r
+  @retval EFI_SUCCESS           The packet was placed on the transmit queue.\r
+  @retval EFI_NOT_STARTED       The network interface has not been started.\r
+  @retval EFI_NOT_READY         The network interface is too busy to accept this transmit request.                      \r
+  @retval EFI_BUFFER_TOO_SMALL  The BufferSize parameter is too small.\r
+  @retval EFI_INVALID_PARAMETER One or more of the parameters has an unsupported value.\r
+  @retval EFI_DEVICE_ERROR      The command could not be sent to the network interface.\r
+  @retval EFI_UNSUPPORTED       This function is not supported by the network interface.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_SIMPLE_NETWORK_TRANSMIT) (\r
+  IN EFI_SIMPLE_NETWORK_PROTOCOL          *This,\r
+  IN UINTN                                HeaderSize,\r
+  IN UINTN                                BufferSize,\r
+  IN VOID                                 *Buffer,\r
+  IN EFI_MAC_ADDRESS                      *SrcAddr  OPTIONAL,\r
+  IN EFI_MAC_ADDRESS                      *DestAddr OPTIONAL,\r
+  IN UINT16                               *Protocol OPTIONAL\r
+  )\r
+;\r
+\r
+/**\r
+  Receives a packet from a network interface.\r
+\r
+  @param  This       Protocol instance pointer.\r
+  @param  HeaderSize The size, in bytes, of the media header received on the network\r
+                     interface. If this parameter is NULL, then the media header size\r
+                     will not be returned.\r
+  @param  BufferSize On entry, the size, in bytes, of Buffer. On exit, the size, in\r
+                     bytes, of the packet that was received on the network interface.\r
+  @param  Buffer     A pointer to the data buffer to receive both the media header and\r
+                     the data.\r
+  @param  SrcAddr    The source HW MAC address. If this parameter is NULL, the\r
+                     HW MAC source address will not be extracted from the media\r
+                     header.\r
+  @param  DsetAddr   The destination HW MAC address. If this parameter is NULL,\r
+                     the HW MAC destination address will not be extracted from the\r
+                     media header.\r
+  @param  Protocol   The media header type. If this parameter is NULL, then the\r
+                     protocol will not be extracted from the media header. See\r
+                     RFC 1700 section "Ether Types" for examples.\r
+\r
+  @retval  EFI_SUCCESS           The received data was stored in Buffer, and BufferSize has\r
+                                 been updated to the number of bytes received.\r
+  @retval  EFI_NOT_STARTED       The network interface has not been started.\r
+  @retval  EFI_NOT_READY         The network interface is too busy to accept this transmit\r
+                                 request.\r
+  @retval  EFI_BUFFER_TOO_SMALL  The BufferSize parameter is too small.\r
+  @retval  EFI_INVALID_PARAMETER One or more of the parameters has an unsupported value.\r
+  @retval  EFI_DEVICE_ERROR      The command could not be sent to the network interface.\r
+  @retval  EFI_UNSUPPORTED       This function is not supported by the network interface.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_SIMPLE_NETWORK_RECEIVE) (\r
+  IN EFI_SIMPLE_NETWORK_PROTOCOL          *This,\r
+  OUT UINTN                               *HeaderSize OPTIONAL,\r
+  IN OUT UINTN                            *BufferSize,\r
+  OUT VOID                                *Buffer,\r
+  OUT EFI_MAC_ADDRESS                     *SrcAddr    OPTIONAL,\r
+  OUT EFI_MAC_ADDRESS                     *DestAddr   OPTIONAL,\r
+  OUT UINT16                              *Protocol   OPTIONAL\r
+  )\r
+;\r
+\r
+#define EFI_SIMPLE_NETWORK_PROTOCOL_REVISION  0x00010000\r
+\r
+struct _EFI_SIMPLE_NETWORK_PROTOCOL {\r
+  UINT64                              Revision;\r
+  EFI_SIMPLE_NETWORK_START            Start;\r
+  EFI_SIMPLE_NETWORK_STOP             Stop;\r
+  EFI_SIMPLE_NETWORK_INITIALIZE       Initialize;\r
+  EFI_SIMPLE_NETWORK_RESET            Reset;\r
+  EFI_SIMPLE_NETWORK_SHUTDOWN         Shutdown;\r
+  EFI_SIMPLE_NETWORK_RECEIVE_FILTERS  ReceiveFilters;\r
+  EFI_SIMPLE_NETWORK_STATION_ADDRESS  StationAddress;\r
+  EFI_SIMPLE_NETWORK_STATISTICS       Statistics;\r
+  EFI_SIMPLE_NETWORK_MCAST_IP_TO_MAC  MCastIpToMac;\r
+  EFI_SIMPLE_NETWORK_NVDATA           NvData;\r
+  EFI_SIMPLE_NETWORK_GET_STATUS       GetStatus;\r
+  EFI_SIMPLE_NETWORK_TRANSMIT         Transmit;\r
+  EFI_SIMPLE_NETWORK_RECEIVE          Receive;\r
+  EFI_EVENT                           WaitForPacket;\r
+  EFI_SIMPLE_NETWORK_MODE             *Mode;\r
+};\r
+\r
+extern EFI_GUID gEfiSimpleNetworkProtocolGuid;\r
+\r
+#endif\r
diff --git a/Tools/Source/TianoTools/Include/Protocol/SimplePointer.h b/Tools/Source/TianoTools/Include/Protocol/SimplePointer.h
new file mode 100644 (file)
index 0000000..a0e0804
--- /dev/null
@@ -0,0 +1,97 @@
+/** @file\r
+  Simple Pointer protocol from the EFI 1.1 specification.\r
+\r
+  Abstraction of a very simple pointer device like a mice or tracekballs.\r
+\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. This program and the accompanying materials                          \r
+  are licensed and made available under the terms and conditions of the BSD License         \r
+  which accompanies this distribution.  The full text of the license may be found at        \r
+  http://opensource.org/licenses/bsd-license.php                                            \r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+  Module Name:  SimplePointer.h\r
+\r
+**/\r
+\r
+#ifndef __SIMPLE_POINTER_H__\r
+#define __SIMPLE_POINTER_H__\r
+\r
+#define EFI_SIMPLE_POINTER_PROTOCOL_GUID \\r
+  { \\r
+    0x31878c87, 0xb75, 0x11d5, {0x9a, 0x4f, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d } \\r
+  }\r
+\r
+typedef struct _EFI_SIMPLE_POINTER_PROTOCOL  EFI_SIMPLE_POINTER_PROTOCOL;\r
+\r
+//\r
+// Data structures\r
+//\r
+typedef struct {\r
+  INT32   RelativeMovementX;\r
+  INT32   RelativeMovementY;\r
+  INT32   RelativeMovementZ;\r
+  BOOLEAN LeftButton;\r
+  BOOLEAN RightButton;\r
+} EFI_SIMPLE_POINTER_STATE;\r
+\r
+typedef struct {\r
+  UINT64  ResolutionX;\r
+  UINT64  ResolutionY;\r
+  UINT64  ResolutionZ;\r
+  BOOLEAN LeftButton;\r
+  BOOLEAN RightButton;\r
+} EFI_SIMPLE_POINTER_MODE;\r
+\r
+/**                                                                 \r
+  Resets the pointer device hardware.\r
+    \r
+  @param  This                  A pointer to the EFI_SIMPLE_POINTER_PROTOCOL\r
+                                instance.                                   \r
+  @param  ExtendedVerification  Indicates that the driver may perform a more exhaustive\r
+                                verification operation of the device during reset.                                       \r
+                                \r
+  @retval EFI_SUCCESS           The device was reset.\r
+  @retval EFI_DEVICE_ERROR      The device is not functioning correctly and could not be reset.  \r
+                                   \r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_SIMPLE_POINTER_RESET) (\r
+  IN EFI_SIMPLE_POINTER_PROTOCOL            *This,\r
+  IN BOOLEAN                                ExtendedVerification\r
+  );\r
+\r
+/**                                                                 \r
+  Retrieves the current state of a pointer device.\r
+    \r
+  @param  This                  A pointer to the EFI_SIMPLE_POINTER_PROTOCOL\r
+                                instance.                                   \r
+  @param  State                 A pointer to the state information on the pointer device.\r
+                                \r
+  @retval EFI_SUCCESS           The state of the pointer device was returned in State.\r
+  @retval EFI_NOT_READY         The state of the pointer device has not changed since the last call to\r
+                                GetState().                                                           \r
+  @retval EFI_DEVICE_ERROR      A device error occurred while attempting to retrieve the pointer device's\r
+                                current state.                                                           \r
+                                   \r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_SIMPLE_POINTER_GET_STATE) (\r
+  IN EFI_SIMPLE_POINTER_PROTOCOL          *This,\r
+  IN OUT EFI_SIMPLE_POINTER_STATE         *State\r
+  );\r
+\r
+struct _EFI_SIMPLE_POINTER_PROTOCOL {\r
+  EFI_SIMPLE_POINTER_RESET      Reset;\r
+  EFI_SIMPLE_POINTER_GET_STATE  GetState;\r
+  EFI_EVENT                     WaitForInput;\r
+  EFI_SIMPLE_POINTER_MODE       *Mode;\r
+};\r
+\r
+extern EFI_GUID gEfiSimplePointerProtocolGuid;\r
+\r
+#endif\r
diff --git a/Tools/Source/TianoTools/Include/Protocol/SimpleTextIn.h b/Tools/Source/TianoTools/Include/Protocol/SimpleTextIn.h
new file mode 100644 (file)
index 0000000..053ed58
--- /dev/null
@@ -0,0 +1,126 @@
+/** @file\r
+  Simple Text In protocol from the EFI 1.0 specification.\r
+\r
+  Abstraction of a very simple input device like a keyboard or serial\r
+  terminal.\r
+\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. This program and the accompanying materials                          \r
+  are licensed and made available under the terms and conditions of the BSD License         \r
+  which accompanies this distribution.  The full text of the license may be found at        \r
+  http://opensource.org/licenses/bsd-license.php                                            \r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+  Module Name:  SimpleTextIn.h\r
+\r
+**/\r
+\r
+#ifndef __SIMPLE_TEXT_IN_PROTOCOL_H__\r
+#define __SIMPLE_TEXT_IN_PROTOCOL_H__\r
+\r
+#define EFI_SIMPLE_TEXT_IN_PROTOCOL_GUID \\r
+  { \\r
+    0x387477c1, 0x69c7, 0x11d2, {0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b } \\r
+  }\r
+\r
+#define EFI_SIMPLE_INPUT_PROTOCOL_GUID      EFI_SIMPLE_TEXT_IN_PROTOCOL_GUID\r
+#define EFI_SIMPLE_TEXT_INPUT_PROTOCOL_GUID EFI_SIMPLE_TEXT_IN_PROTOCOL_GUID\r
+\r
+typedef struct _EFI_SIMPLE_TEXT_IN_PROTOCOL EFI_SIMPLE_TEXT_IN_PROTOCOL;\r
+typedef struct _EFI_SIMPLE_TEXT_IN_PROTOCOL EFI_SIMPLE_TEXT_INPUT_PROTOCOL;\r
+\r
+//\r
+// Data structures\r
+//\r
+typedef struct {\r
+  UINT16  ScanCode;\r
+  CHAR16  UnicodeChar;\r
+} EFI_INPUT_KEY;\r
+\r
+//\r
+// Required unicode control chars\r
+//\r
+#define CHAR_NULL             0x0000\r
+#define CHAR_BACKSPACE        0x0008\r
+#define CHAR_TAB              0x0009\r
+#define CHAR_LINEFEED         0x000A\r
+#define CHAR_CARRIAGE_RETURN  0x000D\r
+\r
+//\r
+// EFI Scan codes\r
+//\r
+#define SCAN_NULL       0x0000\r
+#define SCAN_UP         0x0001\r
+#define SCAN_DOWN       0x0002\r
+#define SCAN_RIGHT      0x0003\r
+#define SCAN_LEFT       0x0004\r
+#define SCAN_HOME       0x0005\r
+#define SCAN_END        0x0006\r
+#define SCAN_INSERT     0x0007\r
+#define SCAN_DELETE     0x0008\r
+#define SCAN_PAGE_UP    0x0009\r
+#define SCAN_PAGE_DOWN  0x000A\r
+#define SCAN_F1         0x000B\r
+#define SCAN_F2         0x000C\r
+#define SCAN_F3         0x000D\r
+#define SCAN_F4         0x000E\r
+#define SCAN_F5         0x000F\r
+#define SCAN_F6         0x0010\r
+#define SCAN_F7         0x0011\r
+#define SCAN_F8         0x0012\r
+#define SCAN_F9         0x0013\r
+#define SCAN_F10        0x0014\r
+#define SCAN_F11        0x0015\r
+#define SCAN_F12        0x0016\r
+#define SCAN_ESC        0x0017\r
+\r
+/**\r
+  Reset the input device and optionaly run diagnostics\r
+\r
+  @param  This                 Protocol instance pointer.\r
+  @param  ExtendedVerification Driver may perform diagnostics on reset.\r
+\r
+  @retval EFI_SUCCESS          The device was reset.\r
+  @retval EFI_DEVICE_ERROR     The device is not functioning properly and could not be reset.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_INPUT_RESET) (\r
+  IN EFI_SIMPLE_TEXT_IN_PROTOCOL          *This,\r
+  IN BOOLEAN                              ExtendedVerification\r
+  )\r
+;\r
+\r
+/**\r
+  Reads the next keystroke from the input device. The WaitForKey Event can \r
+  be used to test for existance of a keystroke via WaitForEvent () call.\r
+\r
+  @param  This Protocol instance pointer.\r
+  @param  Key  Driver may perform diagnostics on reset.\r
+\r
+  @retval EFI_SUCCESS      The keystroke information was returned.\r
+  @retval EFI_NOT_READY    There was no keystroke data availiable.\r
+  @retval EFI_DEVICE_ERROR The keydtroke information was not returned due to\r
+                           hardware errors.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_INPUT_READ_KEY) (\r
+  IN EFI_SIMPLE_TEXT_IN_PROTOCOL          *This,\r
+  OUT EFI_INPUT_KEY                       *Key\r
+  )\r
+;\r
+\r
+struct _EFI_SIMPLE_TEXT_IN_PROTOCOL {\r
+  EFI_INPUT_RESET     Reset;\r
+  EFI_INPUT_READ_KEY  ReadKeyStroke;\r
+  EFI_EVENT           WaitForKey;\r
+} EFI_SIMPLE_INPUT_PROTOCOL;\r
+\r
+extern EFI_GUID gEfiSimpleTextInProtocolGuid;\r
+\r
+#endif\r
diff --git a/Tools/Source/TianoTools/Include/Protocol/SimpleTextOut.h b/Tools/Source/TianoTools/Include/Protocol/SimpleTextOut.h
new file mode 100644 (file)
index 0000000..b568865
--- /dev/null
@@ -0,0 +1,390 @@
+/** @file\r
+  Simple Text Out protocol from the EFI 1.0 specification.\r
+\r
+  Abstraction of a very simple text based output device like VGA text mode or\r
+  a serial terminal. The Simple Text Out protocol instance can represent\r
+  a single hardware device or a virtual device that is an agregation\r
+  of multiple physical devices.\r
+\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. This program and the accompanying materials                          \r
+  are licensed and made available under the terms and conditions of the BSD License         \r
+  which accompanies this distribution.  The full text of the license may be found at        \r
+  http://opensource.org/licenses/bsd-license.php                                            \r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+  Module Name:  SimpleTextOut.h\r
+\r
+**/\r
+\r
+#ifndef __SIMPLE_TEXT_OUT_H__\r
+#define __SIMPLE_TEXT_OUT_H__\r
+\r
+#define EFI_SIMPLE_TEXT_OUT_PROTOCOL_GUID \\r
+  { \\r
+    0x387477c2, 0x69c7, 0x11d2, {0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b } \\r
+  }\r
+\r
+#define EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL_GUID  EFI_SIMPLE_TEXT_OUT_PROTOCOL_GUID\r
+\r
+typedef struct _EFI_SIMPLE_TEXT_OUT_PROTOCOL EFI_SIMPLE_TEXT_OUT_PROTOCOL;\r
+typedef struct _EFI_SIMPLE_TEXT_OUT_PROTOCOL EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL;\r
+\r
+//\r
+// Define's for required EFI Unicode Box Draw characters\r
+//\r
+#define BOXDRAW_HORIZONTAL                  0x2500\r
+#define BOXDRAW_VERTICAL                    0x2502\r
+#define BOXDRAW_DOWN_RIGHT                  0x250c\r
+#define BOXDRAW_DOWN_LEFT                   0x2510\r
+#define BOXDRAW_UP_RIGHT                    0x2514\r
+#define BOXDRAW_UP_LEFT                     0x2518\r
+#define BOXDRAW_VERTICAL_RIGHT              0x251c\r
+#define BOXDRAW_VERTICAL_LEFT               0x2524\r
+#define BOXDRAW_DOWN_HORIZONTAL             0x252c\r
+#define BOXDRAW_UP_HORIZONTAL               0x2534\r
+#define BOXDRAW_VERTICAL_HORIZONTAL         0x253c\r
+#define BOXDRAW_DOUBLE_HORIZONTAL           0x2550\r
+#define BOXDRAW_DOUBLE_VERTICAL             0x2551\r
+#define BOXDRAW_DOWN_RIGHT_DOUBLE           0x2552\r
+#define BOXDRAW_DOWN_DOUBLE_RIGHT           0x2553\r
+#define BOXDRAW_DOUBLE_DOWN_RIGHT           0x2554\r
+#define BOXDRAW_DOWN_LEFT_DOUBLE            0x2555\r
+#define BOXDRAW_DOWN_DOUBLE_LEFT            0x2556\r
+#define BOXDRAW_DOUBLE_DOWN_LEFT            0x2557\r
+#define BOXDRAW_UP_RIGHT_DOUBLE             0x2558\r
+#define BOXDRAW_UP_DOUBLE_RIGHT             0x2559\r
+#define BOXDRAW_DOUBLE_UP_RIGHT             0x255a\r
+#define BOXDRAW_UP_LEFT_DOUBLE              0x255b\r
+#define BOXDRAW_UP_DOUBLE_LEFT              0x255c\r
+#define BOXDRAW_DOUBLE_UP_LEFT              0x255d\r
+#define BOXDRAW_VERTICAL_RIGHT_DOUBLE       0x255e\r
+#define BOXDRAW_VERTICAL_DOUBLE_RIGHT       0x255f\r
+#define BOXDRAW_DOUBLE_VERTICAL_RIGHT       0x2560\r
+#define BOXDRAW_VERTICAL_LEFT_DOUBLE        0x2561\r
+#define BOXDRAW_VERTICAL_DOUBLE_LEFT        0x2562\r
+#define BOXDRAW_DOUBLE_VERTICAL_LEFT        0x2563\r
+#define BOXDRAW_DOWN_HORIZONTAL_DOUBLE      0x2564\r
+#define BOXDRAW_DOWN_DOUBLE_HORIZONTAL      0x2565\r
+#define BOXDRAW_DOUBLE_DOWN_HORIZONTAL      0x2566\r
+#define BOXDRAW_UP_HORIZONTAL_DOUBLE        0x2567\r
+#define BOXDRAW_UP_DOUBLE_HORIZONTAL        0x2568\r
+#define BOXDRAW_DOUBLE_UP_HORIZONTAL        0x2569\r
+#define BOXDRAW_VERTICAL_HORIZONTAL_DOUBLE  0x256a\r
+#define BOXDRAW_VERTICAL_DOUBLE_HORIZONTAL  0x256b\r
+#define BOXDRAW_DOUBLE_VERTICAL_HORIZONTAL  0x256c\r
+\r
+//\r
+// EFI Required Block Elements Code Chart\r
+//\r
+#define BLOCKELEMENT_FULL_BLOCK   0x2588\r
+#define BLOCKELEMENT_LIGHT_SHADE  0x2591\r
+\r
+//\r
+// EFI Required Geometric Shapes Code Chart\r
+//\r
+#define GEOMETRICSHAPE_UP_TRIANGLE    0x25b2\r
+#define GEOMETRICSHAPE_RIGHT_TRIANGLE 0x25ba\r
+#define GEOMETRICSHAPE_DOWN_TRIANGLE  0x25bc\r
+#define GEOMETRICSHAPE_LEFT_TRIANGLE  0x25c4\r
+\r
+//\r
+// EFI Required Arrow shapes\r
+//\r
+#define ARROW_LEFT  0x2190\r
+#define ARROW_UP    0x2191\r
+#define ARROW_RIGHT 0x2192\r
+#define ARROW_DOWN  0x2193\r
+\r
+//\r
+// EFI Console Colours\r
+//\r
+#define EFI_BLACK                 0x00\r
+#define EFI_BLUE                  0x01\r
+#define EFI_GREEN                 0x02\r
+#define EFI_CYAN                  (EFI_BLUE | EFI_GREEN)\r
+#define EFI_RED                   0x04\r
+#define EFI_MAGENTA               (EFI_BLUE | EFI_RED)\r
+#define EFI_BROWN                 (EFI_GREEN | EFI_RED)\r
+#define EFI_LIGHTGRAY             (EFI_BLUE | EFI_GREEN | EFI_RED)\r
+#define EFI_BRIGHT                0x08\r
+#define EFI_DARKGRAY              (EFI_BRIGHT)\r
+#define EFI_LIGHTBLUE             (EFI_BLUE | EFI_BRIGHT)\r
+#define EFI_LIGHTGREEN            (EFI_GREEN | EFI_BRIGHT)\r
+#define EFI_LIGHTCYAN             (EFI_CYAN | EFI_BRIGHT)\r
+#define EFI_LIGHTRED              (EFI_RED | EFI_BRIGHT)\r
+#define EFI_LIGHTMAGENTA          (EFI_MAGENTA | EFI_BRIGHT)\r
+#define EFI_YELLOW                (EFI_BROWN | EFI_BRIGHT)\r
+#define EFI_WHITE                 (EFI_BLUE | EFI_GREEN | EFI_RED | EFI_BRIGHT)\r
+\r
+#define EFI_TEXT_ATTR(f, b)       ((f) | ((b) << 4))\r
+\r
+#define EFI_BACKGROUND_BLACK      0x00\r
+#define EFI_BACKGROUND_BLUE       0x10\r
+#define EFI_BACKGROUND_GREEN      0x20\r
+#define EFI_BACKGROUND_CYAN       (EFI_BACKGROUND_BLUE | EFI_BACKGROUND_GREEN)\r
+#define EFI_BACKGROUND_RED        0x40\r
+#define EFI_BACKGROUND_MAGENTA    (EFI_BACKGROUND_BLUE | EFI_BACKGROUND_RED)\r
+#define EFI_BACKGROUND_BROWN      (EFI_BACKGROUND_GREEN | EFI_BACKGROUND_RED)\r
+#define EFI_BACKGROUND_LIGHTGRAY  (EFI_BACKGROUND_BLUE | EFI_BACKGROUND_GREEN | EFI_BACKGROUND_RED)\r
+\r
+//\r
+// We currently define attributes from 0 - 7F for color manipulations\r
+// To internally handle the local display characteristics for a particular character, we are defining\r
+// Bit 7 to signify the local glyph representation for a character.  If turned on, glyphs will be\r
+// pulled from the wide glyph database and will display locally as a wide character (16 X 19 versus 8 X 19)\r
+// If bit 7 is off, the narrow glyph database will be used.  This does NOT affect information that is sent to\r
+// non-local displays (e.g. serial or LAN consoles).\r
+//\r
+#define EFI_WIDE_ATTRIBUTE  0x80\r
+\r
+/**\r
+  Reset the text output device hardware and optionaly run diagnostics\r
+\r
+  @param  This                 Protocol instance pointer.\r
+  @param  ExtendedVerification Driver may perform more exhaustive verfication\r
+                               operation of the device during reset.\r
+\r
+  @retval EFI_SUCCESS          The text output device was reset.\r
+  @retval EFI_DEVICE_ERROR     The text output device is not functioning correctly and\r
+                               could not be reset.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_TEXT_RESET) (\r
+  IN EFI_SIMPLE_TEXT_OUT_PROTOCOL           *This,\r
+  IN BOOLEAN                                ExtendedVerification\r
+  )\r
+;\r
+\r
+/**\r
+  Write a Unicode string to the output device.\r
+\r
+  @param  This   Protocol instance pointer.\r
+  @param  String The NULL-terminated Unicode string to be displayed on the output\r
+                 device(s). All output devices must also support the Unicode\r
+                 drawing defined in this file.\r
+\r
+  @retval EFI_SUCCESS             The string was output to the device.\r
+  @retval EFI_DEVICE_ERROR        The device reported an error while attempting to output\r
+                                  the text.\r
+  @retval EFI_UNSUPPORTED         The output device's mode is not currently in a\r
+                                  defined text mode.\r
+  @retval EFI_WARN_UNKNOWN_GLYPH  This warning code indicates that some of the\r
+                                  characters in the Unicode string could not be\r
+                                  rendered and were skipped.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_TEXT_STRING) (\r
+  IN EFI_SIMPLE_TEXT_OUT_PROTOCOL           *This,\r
+  IN CHAR16                                 *String\r
+  )\r
+;\r
+\r
+/**\r
+  Verifies that all characters in a Unicode string can be output to the \r
+  target device.\r
+\r
+  @param  This   Protocol instance pointer.\r
+  @param  String The NULL-terminated Unicode string to be examined for the output\r
+                 device(s).\r
+\r
+  @retval EFI_SUCCESS      The device(s) are capable of rendering the output string.\r
+  @retval EFI_UNSUPPORTED  Some of the characters in the Unicode string cannot be\r
+                           rendered by one or more of the output devices mapped\r
+                           by the EFI handle.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_TEXT_TEST_STRING) (\r
+  IN EFI_SIMPLE_TEXT_OUT_PROTOCOL           *This,\r
+  IN CHAR16                                 *String\r
+  )\r
+;\r
+\r
+/**\r
+  Returns information for an available text mode that the output device(s)\r
+  supports.\r
+\r
+  @param  This       Protocol instance pointer.\r
+  @param  ModeNumber The mode number to return information on.\r
+  @param  Columns    Returns the geometry of the text output device for the\r
+                     requested ModeNumber.\r
+  @param  Rows       Returns the geometry of the text output device for the\r
+                     requested ModeNumber.\r
+                                          \r
+  @retval EFI_SUCCESS      The requested mode information was returned.\r
+  @retval EFI_DEVICE_ERROR The device had an error and could not complete the request.\r
+  @retval EFI_UNSUPPORTED  The mode number was not valid.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_TEXT_QUERY_MODE) (\r
+  IN EFI_SIMPLE_TEXT_OUT_PROTOCOL           *This,\r
+  IN UINTN                                  ModeNumber,\r
+  OUT UINTN                                 *Columns,\r
+  OUT UINTN                                 *Rows\r
+  )\r
+;\r
+\r
+/**\r
+  Sets the output device(s) to a specified mode.\r
+\r
+  @param  This       Protocol instance pointer.\r
+  @param  ModeNumber The mode number to set.\r
+\r
+  @retval EFI_SUCCESS      The requested text mode was set.\r
+  @retval EFI_DEVICE_ERROR The device had an error and could not complete the request.\r
+  @retval EFI_UNSUPPORTED  The mode number was not valid.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_TEXT_SET_MODE) (\r
+  IN EFI_SIMPLE_TEXT_OUT_PROTOCOL           *This,\r
+  IN UINTN                                  ModeNumber\r
+  )\r
+;\r
+\r
+/**\r
+  Sets the background and foreground colors for the OutputString () and\r
+  ClearScreen () functions.\r
+\r
+  @param  This      Protocol instance pointer.\r
+  @param  Attribute The attribute to set. Bits 0..3 are the foreground color, and\r
+                    bits 4..6 are the background color. All other bits are undefined\r
+                    and must be zero. The valid Attributes are defined in this file.\r
+\r
+  @retval EFI_SUCCESS     The attribute was set.\r
+  @retval EFI_DEVICE_     ERROR The device had an error and could not complete the request.\r
+  @retval EFI_UNSUPPORTED The attribute requested is not defined.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_TEXT_SET_ATTRIBUTE) (\r
+  IN EFI_SIMPLE_TEXT_OUT_PROTOCOL           *This,\r
+  IN UINTN                                  Attribute\r
+  )\r
+;\r
+\r
+/**\r
+  Clears the output device(s) display to the currently selected background \r
+  color.\r
+\r
+  @param  This              Protocol instance pointer.\r
+                           \r
+  @retval  EFI_SUCCESS      The operation completed successfully.\r
+  @retval  EFI_DEVICE_ERROR The device had an error and could not complete the request.\r
+  @retval  EFI_UNSUPPORTED  The output device is not in a valid text mode.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_TEXT_CLEAR_SCREEN) (\r
+  IN EFI_SIMPLE_TEXT_OUT_PROTOCOL   *This\r
+  )\r
+;\r
+\r
+/**\r
+  Sets the current coordinates of the cursor position\r
+\r
+  @param  This        Protocol instance pointer.\r
+  @param  Column      The position to set the cursor to. Must be greater than or\r
+                      equal to zero and less than the number of columns and rows\r
+                      by QueryMode ().\r
+  @param  Row         The position to set the cursor to. Must be greater than or\r
+                      equal to zero and less than the number of columns and rows\r
+                      by QueryMode ().\r
+\r
+  @retval EFI_SUCCESS      The operation completed successfully.\r
+  @retval EFI_DEVICE_ERROR The device had an error and could not complete the request.\r
+  @retval EFI_UNSUPPORTED  The output device is not in a valid text mode, or the\r
+                           cursor position is invalid for the current mode.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_TEXT_SET_CURSOR_POSITION) (\r
+  IN EFI_SIMPLE_TEXT_OUT_PROTOCOL           *This,\r
+  IN UINTN                                  Column,\r
+  IN UINTN                                  Row\r
+  )\r
+;\r
+\r
+/**\r
+  Makes the cursor visible or invisible\r
+\r
+  @param  This    Protocol instance pointer.\r
+  @param  Visible If TRUE, the cursor is set to be visible. If FALSE, the cursor is\r
+                  set to be invisible.\r
+\r
+  @retval EFI_SUCCESS      The operation completed successfully.\r
+  @retval EFI_DEVICE_ERROR The device had an error and could not complete the\r
+                           request, or the device does not support changing\r
+                           the cursor mode.\r
+  @retval EFI_UNSUPPORTED  The output device is not in a valid text mode.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_TEXT_ENABLE_CURSOR) (\r
+  IN EFI_SIMPLE_TEXT_OUT_PROTOCOL           *This,\r
+  IN BOOLEAN                                Visible\r
+  )\r
+;\r
+\r
+/**\r
+  Mode Structure pointed to by Simple Text Out protocol.\r
+\r
+  MaxMode   - The number of modes supported by QueryMode () and SetMode ().\r
+  Mode      - The text mode of the output device(s).\r
+  Attribute - The current character output attribute\r
+  CursorColumn  - The cursor's column.\r
+  CursorRow     - The cursor's row.\r
+  CursorVisible - The cursor is currently visbile or not.\r
+\r
+**/\r
+typedef struct {\r
+  INT32   MaxMode;\r
+\r
+  //\r
+  // current settings\r
+  //\r
+  INT32   Mode;\r
+  INT32   Attribute;\r
+  INT32   CursorColumn;\r
+  INT32   CursorRow;\r
+  BOOLEAN CursorVisible;\r
+} EFI_SIMPLE_TEXT_OUTPUT_MODE;\r
+\r
+struct _EFI_SIMPLE_TEXT_OUT_PROTOCOL {\r
+  EFI_TEXT_RESET                Reset;\r
+\r
+  EFI_TEXT_STRING               OutputString;\r
+  EFI_TEXT_TEST_STRING          TestString;\r
+\r
+  EFI_TEXT_QUERY_MODE           QueryMode;\r
+  EFI_TEXT_SET_MODE             SetMode;\r
+  EFI_TEXT_SET_ATTRIBUTE        SetAttribute;\r
+\r
+  EFI_TEXT_CLEAR_SCREEN         ClearScreen;\r
+  EFI_TEXT_SET_CURSOR_POSITION  SetCursorPosition;\r
+  EFI_TEXT_ENABLE_CURSOR        EnableCursor;\r
+\r
+  //\r
+  // Current mode\r
+  //\r
+  EFI_SIMPLE_TEXT_OUTPUT_MODE   *Mode;\r
+};\r
+\r
+extern EFI_GUID gEfiSimpleTextOutProtocolGuid;\r
+\r
+#endif\r
diff --git a/Tools/Source/TianoTools/Include/Protocol/Smbus.h b/Tools/Source/TianoTools/Include/Protocol/Smbus.h
new file mode 100644 (file)
index 0000000..8fe37b1
--- /dev/null
@@ -0,0 +1,237 @@
+/** @file\r
+  This file declares the EFI SMBus Host Controller protocol\r
+\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. This program and the accompanying materials                          \r
+  are licensed and made available under the terms and conditions of the BSD License         \r
+  which accompanies this distribution.  The full text of the license may be found at        \r
+  http://opensource.org/licenses/bsd-license.php                                            \r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+  Module Name:  Smbus.h\r
+\r
+  @par Revision Reference:\r
+  This protocol is defined in Framework of EFI SMBus Host Controller Specification\r
+  Version 0.9\r
+\r
+**/\r
+\r
+#ifndef _EFI_SMBUS_H\r
+#define _EFI_SMBUS_H\r
+\r
+#define EFI_SMBUS_HC_PROTOCOL_GUID \\r
+  { \\r
+    0xe49d33ed, 0x513d, 0x4634, {0xb6, 0x98, 0x6f, 0x55, 0xaa, 0x75, 0x1c, 0x1b } \\r
+  }\r
+\r
+typedef struct _EFI_SMBUS_HC_PROTOCOL EFI_SMBUS_HC_PROTOCOL;\r
+\r
+/**\r
+  Executes an SMBus operation to an SMBus controller.\r
+\r
+  @param  This A pointer to the EFI_SMBUS_HC_PROTOCOL instance.\r
+  \r
+  @param  SlaveAddress The SMBus slave address of the device with which to communicate.\r
+  \r
+  @param  Command This command is transmitted by the SMBus host \r
+  controller to the SMBus slave device and the interpretation is \r
+  SMBus slave device specific.\r
+  \r
+  @param  Operation Signifies which particular SMBus hardware protocol \r
+  instance that it will use to execute the SMBus transactions. \r
+  \r
+  @param  PecCheck Defines if Packet Error Code (PEC) checking is required \r
+  for this operation.\r
+  \r
+  @param  Length Signifies the number of bytes that this operation will do.\r
+  \r
+  @param  Buffer Contains the value of data to execute to the SMBus slave device.\r
+\r
+  @retval EFI_SUCCESS The last data that was returned from the access \r
+  matched the poll exit criteria.\r
+  \r
+  @retval EFI_CRC_ERROR The checksum is not correct (PEC is incorrect)\r
+  \r
+  @retval EFI_TIMEOUT Timeout expired before the operation was completed. \r
+  Timeout is determined by the SMBus host controller device.\r
+  \r
+  @retval EFI_OUT_OF_RESOURCES The request could not be completed \r
+  due to a lack of resources.\r
+  \r
+  @retval EFI_DEVICE_ERROR The request was not completed because \r
+  a failure reflected in the Host Status Register bit.\r
+  \r
+  @retval EFI_INVALID_PARAMETER Operation is not defined in EFI_SMBUS_OPERATION.\r
+  Or Length/Buffer is NULL for operations except for EfiSmbusQuickRead and \r
+  EfiSmbusQuickWrite. Length is outside the range of valid values.\r
+  \r
+  @retval EFI_UNSUPPORTED The SMBus operation or PEC is not supported.\r
+  \r
+  @retval EFI_BUFFER_TOO_SMALL Buffer is not sufficient for this operation.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_SMBUS_HC_EXECUTE_OPERATION) (\r
+  IN EFI_SMBUS_HC_PROTOCOL              *This,\r
+  IN      EFI_SMBUS_DEVICE_ADDRESS      SlaveAddress,\r
+  IN      EFI_SMBUS_DEVICE_COMMAND      Command,\r
+  IN      EFI_SMBUS_OPERATION           Operation,\r
+  IN      BOOLEAN                       PecCheck,\r
+  IN OUT  UINTN                         *Length,\r
+  IN OUT  VOID                          *Buffer\r
+  );\r
+\r
+typedef struct {\r
+  UINT32  VendorSpecificId;\r
+  UINT16  SubsystemDeviceId;\r
+  UINT16  SubsystemVendorId;\r
+  UINT16  Interface;\r
+  UINT16  DeviceId;\r
+  UINT16  VendorId;\r
+  UINT8   VendorRevision;\r
+  UINT8   DeviceCapabilities;\r
+} EFI_SMBUS_UDID;\r
+\r
+/**\r
+  CallBack function can be registered in EFI_SMBUS_HC_PROTOCOL_NOTIFY.\r
+\r
+  @param  SlaveAddress The SMBUS hardware address to which the SMBUS \r
+  device is preassigned or allocated.\r
+  \r
+  @param  Data Data of the SMBus host notify command that \r
+  the caller wants to be called.\r
+\r
+  @return Status Code\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_SMBUS_NOTIFY_FUNCTION) (\r
+  IN      EFI_SMBUS_DEVICE_ADDRESS      SlaveAddress,\r
+  IN      UINTN                         Data\r
+  );\r
+\r
+/**\r
+  Sets the SMBus slave device addresses for the device with a given unique ID \r
+  or enumerates the entire bus.\r
+\r
+  @param  This A pointer to the EFI_SMBUS_HC_PROTOCOL instance.\r
+  \r
+  @param  ArpAll A Boolean expression that indicates if the host drivers need \r
+  to enumerate all the devices or enumerate only the device that is identified \r
+  by SmbusUdid. If ArpAll is TRUE, SmbusUdid and SlaveAddress are optional. \r
+  If ArpAll is FALSE, ArpDevice will enumerate SmbusUdid and the address \r
+  will be at SlaveAddress.\r
+  \r
+  @param  SmbusUdid The Unique Device Identifier (UDID) that is associated \r
+  with this device.\r
+  \r
+  @param  SlaveAddress The SMBus slave address that is associated with an SMBus UDID. \r
+\r
+  @retval EFI_SUCCESS The SMBus slave device address was set.\r
+  \r
+  @retval EFI_INVALID_PARAMETER SlaveAddress is NULL.\r
+  \r
+  @retval EFI_OUT_OF_RESOURCES The request could not be completed \r
+  due to a lack of resources.\r
+  \r
+  @retval EFI_TIMEOUT The SMBus slave device did not respond.\r
+  \r
+  @retval EFI_DEVICE_ERROR The request was not completed because the transaction failed.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_SMBUS_HC_PROTOCOL_ARP_DEVICE) (\r
+  IN EFI_SMBUS_HC_PROTOCOL              *This,\r
+  IN      BOOLEAN                       ArpAll,\r
+  IN      EFI_SMBUS_UDID                *SmbusUdid, OPTIONAL\r
+  IN OUT  EFI_SMBUS_DEVICE_ADDRESS      *SlaveAddress OPTIONAL\r
+  );\r
+\r
+typedef struct {\r
+  EFI_SMBUS_DEVICE_ADDRESS  SmbusDeviceAddress;\r
+  EFI_SMBUS_UDID            SmbusDeviceUdid;\r
+} EFI_SMBUS_DEVICE_MAP;\r
+\r
+/**\r
+  The GetArpMap() function returns the mapping of all the SMBus devices \r
+  that are enumerated by the SMBus host driver. \r
+\r
+  @param  This A pointer to the EFI_SMBUS_HC_PROTOCOL instance.\r
+  \r
+  @param  Length Size of the buffer that contains the SMBus device map.\r
+  \r
+  @param  SmbusDeviceMap The pointer to the device map as enumerated \r
+  by the SMBus controller driver.\r
+\r
+  @retval EFI_SUCCESS The device map was returned correctly in the buffer.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_SMBUS_HC_PROTOCOL_GET_ARP_MAP) (\r
+  IN EFI_SMBUS_HC_PROTOCOL              *This,\r
+  IN OUT  UINTN                         *Length,\r
+  IN OUT  EFI_SMBUS_DEVICE_MAP          **SmbusDeviceMap\r
+  );\r
+\r
+/**\r
+  The Notify() function registers all the callback functions to allow the \r
+  bus driver to call these functions when the SlaveAddress/Data pair happens.\r
+\r
+  @param  This A pointer to the EFI_SMBUS_HC_PROTOCOL instance.\r
+  \r
+  @param  SlaveAddress Address that the host controller detects as \r
+  sending a message and calls all the registered functions.\r
+  \r
+  @param  Data Data that the host controller detects as sending a message \r
+  and calls all the registered functions.\r
+  \r
+  @param  NotifyFunction The function to call when the bus driver \r
+  detects the SlaveAddress and Data pair.\r
+\r
+  @retval EFI_SUCCESS NotifyFunction was registered.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_SMBUS_HC_PROTOCOL_NOTIFY) (\r
+  IN EFI_SMBUS_HC_PROTOCOL              *This,\r
+  IN      EFI_SMBUS_DEVICE_ADDRESS      SlaveAddress,\r
+  IN      UINTN                         Data,\r
+  IN      EFI_SMBUS_NOTIFY_FUNCTION     NotifyFunction\r
+  );\r
+\r
+/**\r
+  @par Protocol Description:\r
+  Provides basic SMBus host controller management and basic data \r
+  transactions over the SMBus.\r
+\r
+  @param Execute\r
+  Executes the SMBus operation to an SMBus slave device.\r
+\r
+  @param ArpDevice\r
+  Allows an SMBus 2.0 device(s) to be Address Resolution Protocol (ARP)\r
+\r
+  @param GetArpMap\r
+  Allows a driver to retrieve the address that was allocated by the SMBus \r
+  host controller during enumeration/ARP.\r
+\r
+  @param Notify\r
+  Allows a driver to register for a callback to the SMBus host \r
+  controller driver when the bus issues a notification to the bus controller driver.\r
+\r
+**/\r
+struct _EFI_SMBUS_HC_PROTOCOL {\r
+  EFI_SMBUS_HC_EXECUTE_OPERATION    Execute;\r
+  EFI_SMBUS_HC_PROTOCOL_ARP_DEVICE  ArpDevice;\r
+  EFI_SMBUS_HC_PROTOCOL_GET_ARP_MAP GetArpMap;\r
+  EFI_SMBUS_HC_PROTOCOL_NOTIFY      Notify;\r
+};\r
+\r
+extern EFI_GUID gEfiSmbusProtocolGuid;\r
+#endif\r
diff --git a/Tools/Source/TianoTools/Include/Protocol/SmmAccess.h b/Tools/Source/TianoTools/Include/Protocol/SmmAccess.h
new file mode 100644 (file)
index 0000000..f405c8f
--- /dev/null
@@ -0,0 +1,172 @@
+/** @file\r
+  This file declares SMM SMRAM Access abstraction protocol\r
+\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. This program and the accompanying materials                          \r
+  are licensed and made available under the terms and conditions of the BSD License         \r
+  which accompanies this distribution.  The full text of the license may be found at        \r
+  http://opensource.org/licenses/bsd-license.php                                            \r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+  Module Name:  SmmAccess.h\r
+\r
+  @par Revision Reference:\r
+  This Protocol is defined in Framework of EFI SMM Core Interface Spec\r
+  Version 0.9.\r
+**/\r
+\r
+#ifndef _SMM_ACCESS_H_\r
+#define _SMM_ACCESS_H_\r
+\r
+typedef struct _EFI_SMM_ACCESS_PROTOCOL  EFI_SMM_ACCESS_PROTOCOL;\r
+\r
+#define EFI_SMM_ACCESS_PROTOCOL_GUID \\r
+  { \\r
+    0x3792095a, 0xe309, 0x4c1e, {0xaa, 0x01, 0x85, 0xf5, 0x65, 0x5a, 0x17, 0xf1 } \\r
+  }\r
+\r
+//\r
+// SMM Access specification constant and types\r
+//\r
+// *******************************************************\r
+//  EFI_SMRAM_STATE\r
+// *******************************************************\r
+//\r
+#define EFI_SMRAM_OPEN    0x00000001\r
+#define EFI_SMRAM_CLOSED  0x00000002\r
+#define EFI_SMRAM_LOCKED  0x00000004\r
+#define EFI_CACHEABLE     0x00000008\r
+#define EFI_ALLOCATED     0x00000010\r
+\r
+//\r
+// SMM Access specification Member Function\r
+//\r
+/**\r
+  Opens the SMRAM area to be accessible by a boot-service driver.\r
+\r
+  @param  This The EFI_SMM_ACCESS_PROTOCOL instance. \r
+  \r
+  @param  DescriptorIndex Indicates that the driver wishes to open \r
+  the memory tagged by this index. \r
+\r
+  @retval EFI_SUCCESS The operation was successful.\r
+  \r
+  @retval EFI_INVALID_PARAMETER The given DescriptorIndex is not supported.\r
+  \r
+  @retval EFI_NOT_STARTED The SMM base service has not been initialized.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_SMM_OPEN) (\r
+  IN EFI_SMM_ACCESS_PROTOCOL         *This,\r
+  UINTN                              DescriptorIndex\r
+  );\r
+\r
+/**\r
+  Inhibits access to the SMRAM.\r
+\r
+  @param  This The EFI_SMM_ACCESS_PROTOCOL instance. \r
+  \r
+  @param  DescriptorIndex Indicates that the driver wishes to open \r
+  the memory tagged by this index. \r
+\r
+  @retval EFI_SUCCESS The operation was successful.\r
+  \r
+  @retval EFI_DEVICE_ERROR The given DescriptorIndex is not open.\r
+  \r
+  @retval EFI_INVALID_PARAMETER The given DescriptorIndex is not supported.\r
+  \r
+  @retval EFI_NOT_STARTED The SMM base service has not been initialized.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_SMM_CLOSE) (\r
+  IN EFI_SMM_ACCESS_PROTOCOL          *This,\r
+  UINTN                               DescriptorIndex\r
+  );\r
+\r
+/**\r
+  Inhibits access to the SMRAM.\r
+  \r
+  @param  This The EFI_SMM_ACCESS_PROTOCOL instance. \r
+  \r
+  @param  DescriptorIndex Indicates that the driver wishes to open \r
+  the memory tagged by this index. \r
+\r
+  @retval EFI_SUCCESS The operation was successful.\r
+  \r
+  @retval EFI_DEVICE_ERROR The given DescriptorIndex is not open.\r
+  \r
+  @retval EFI_INVALID_PARAMETER The given DescriptorIndex is not supported.\r
+  \r
+  @retval EFI_NOT_STARTED The SMM base service has not been initialized.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_SMM_LOCK) (\r
+  IN EFI_SMM_ACCESS_PROTOCOL         *This,\r
+  UINTN                              DescriptorIndex\r
+  );\r
+\r
+/**\r
+  Queries the memory controller for the possible regions that will support SMRAM.\r
+\r
+  @param  This The EFI_SMM_ACCESS_PROTOCOL instance. \r
+  \r
+  @param  SmramMapSize A pointer to the size, in bytes, of the SmramMemoryMap buffer.\r
+  \r
+  @param  SmramMap A pointer to the buffer in which firmware places the current memory map.\r
+\r
+  @retval EFI_SUCCESS The chipset supported the given resource.\r
+  \r
+  @retval EFI_BUFFER_TOO_SMALL The SmramMap parameter was too small.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_SMM_CAPABILITIES) (\r
+  IN EFI_SMM_ACCESS_PROTOCOL             *This,\r
+  IN OUT UINTN                           *SmramMapSize,\r
+  IN OUT EFI_SMRAM_DESCRIPTOR            *SmramMap\r
+  );\r
+\r
+/**\r
+  @par Protocol Description:\r
+  This protocol is used to control the visibility of the SMRAM on the platform.\r
+\r
+  @param Open\r
+  Opens the SMRAM. \r
+\r
+  @param Close\r
+  Closes the SMRAM.\r
+\r
+  @param Lock\r
+  Locks the SMRAM. \r
+\r
+  @param GetCapabilities\r
+  Gets information on possible SMRAM regions.\r
+\r
+  @param LockState\r
+Indicates the current state of the SMRAM. Set to TRUE if any region is locked. \r
+\r
+  @param OpenState\r
+Indicates the current state of the SMRAM. Set to TRUE if any region is open. \r
+\r
+**/\r
+struct _EFI_SMM_ACCESS_PROTOCOL {\r
+  EFI_SMM_OPEN          Open;\r
+  EFI_SMM_CLOSE         Close;\r
+  EFI_SMM_LOCK          Lock;\r
+  EFI_SMM_CAPABILITIES  GetCapabilities;\r
+  BOOLEAN               LockState;\r
+  BOOLEAN               OpenState;\r
+};\r
+\r
+extern EFI_GUID gEfiSmmAccessProtocolGuid;\r
+\r
+#endif\r
diff --git a/Tools/Source/TianoTools/Include/Protocol/SmmBase.h b/Tools/Source/TianoTools/Include/Protocol/SmmBase.h
new file mode 100644 (file)
index 0000000..6dd3a5d
--- /dev/null
@@ -0,0 +1,310 @@
+/** @file\r
+  This file declares SMM Base abstraction protocol.\r
+  This is the base level of compatiblity for SMM drivers.\r
+\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. This program and the accompanying materials                          \r
+  are licensed and made available under the terms and conditions of the BSD License         \r
+  which accompanies this distribution.  The full text of the license may be found at        \r
+  http://opensource.org/licenses/bsd-license.php                                            \r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+  Module Name:  SmmBase.h\r
+\r
+  @par Revision Reference:\r
+  This Protocol is defined in Framework of EFI SMM Core Interface Spec\r
+  Version 0.9.\r
+\r
+**/\r
+\r
+#ifndef _SMM_BASE_H_\r
+#define _SMM_BASE_H_\r
+\r
+#define EFI_SMM_BASE_PROTOCOL_GUID \\r
+  { \\r
+    0x1390954D, 0xda95, 0x4227, {0x93, 0x28, 0x72, 0x82, 0xc2, 0x17, 0xda, 0xa8 } \\r
+  }\r
+\r
+typedef struct _EFI_SMM_BASE_PROTOCOL             EFI_SMM_BASE_PROTOCOL;\r
+\r
+//\r
+// SMM Handler Definition\r
+//\r
+#define EFI_HANDLER_SUCCESS         0x0000\r
+#define EFI_HANDLER_CRITICAL_EXIT   0x0001\r
+#define EFI_HANDLER_SOURCE_QUIESCED 0x0002\r
+#define EFI_HANDLER_SOURCE_PENDING  0x0003\r
+\r
+/**\r
+  Entry Point to Callback service\r
+\r
+  @param  SmmImageHandle A handle allocated by the SMM infrastructure code \r
+  to uniquely designate a specific DXE SMM driver. \r
+  \r
+  @param  CommunicationBuffer A pointer to a collection of data in memory \r
+  that will be conveyed from a non-SMM environment into an SMM environment.\r
+  The buffer must be contiguous, physically mapped, and be a physical address.\r
+  \r
+  @param  SourceSize The size of the CommunicationBuffer.\r
+\r
+  @return Status code\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_SMM_CALLBACK_ENTRY_POINT) (\r
+  IN EFI_HANDLE             SmmImageHandle,\r
+  IN OUT VOID               *CommunicationBuffer OPTIONAL,\r
+  IN OUT UINTN              *SourceSize OPTIONAL\r
+  );\r
+\r
+//\r
+// SMM Base Protocol Definition\r
+//\r
+/**\r
+  Register a given driver into SMRAM.This is the equivalent of performing\r
+  the LoadImage/StartImage into System Management Mode.\r
+\r
+  @param  This Protocol instance pointer.\r
+  @param  FilePath Location of the image to be installed as the handler.\r
+  @param  SourceBuffer Optional source buffer in case of the image file\r
+  being in memory.\r
+  @param  SourceSize Size of the source image file, if in memory.\r
+  @param  ImageHandle Pointer to the handle that reflects the driver\r
+  loaded into SMM.\r
+  @param  LegacyIA32Binary The binary image to load is legacy 16 bit code.\r
+\r
+  @retval  EFI_SUCCESS The operation was successful.\r
+  @retval  EFI_OUT_OF_RESOURCES There were no additional SMRAM resources to load the handler\r
+  @retval  EFI_UNSUPPORTED This platform does not support 16-bit handlers.\r
+  @retval  EFI_UNSUPPORTED In runtime.\r
+  @retval  EFI_INVALID_PARAMETER The handlers was not the correct image type\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_SMM_REGISTER_HANDLER) (\r
+  IN EFI_SMM_BASE_PROTOCOL                           *This,\r
+  IN  EFI_DEVICE_PATH_PROTOCOL                       *FilePath,\r
+  IN  VOID                                           *SourceBuffer OPTIONAL,\r
+  IN  UINTN                                          SourceSize,\r
+  OUT EFI_HANDLE                                     *ImageHandle,\r
+  IN  BOOLEAN                                        LegacyIA32Binary OPTIONAL\r
+  )\r
+;\r
+\r
+/**\r
+  Remove a given driver SMRAM.  This is the equivalent of performing\r
+  the UnloadImage System Management Mode.\r
+\r
+  @param  This Protocol instance pointer.\r
+  @param  ImageHandle Pointer to the handle that reflects the driver\r
+  loaded into SMM.\r
+\r
+  @retval  EFI_SUCCESS The operation was successful\r
+  @retval  EFI_INVALID_PARAMETER The handler did not exist\r
+  @retval  EFI_UNSUPPORTED In runtime.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_SMM_UNREGISTER_HANDLER) (\r
+  IN EFI_SMM_BASE_PROTOCOL          *This,\r
+  IN EFI_HANDLE                     ImageHandle\r
+  )\r
+;\r
+\r
+/**\r
+  The SMM Inter-module Communicate Service Communicate() function \r
+  provides a services to send/received messages from a registered \r
+  EFI service.  The BASE protocol driver is responsible for doing \r
+  any of the copies such that the data lives in boot-service accessible RAM.\r
+\r
+  @param  This Protocol instance pointer.\r
+  @param  ImageHandle Pointer to the handle that reflects the driver\r
+  loaded into SMM.\r
+  @param  CommunicationBuffer Pointer to the buffer to convey into SMRAM.\r
+  @param  SourceSize Size of the contents of buffer..\r
+\r
+  @retval  EFI_SUCCESS The message was successfully posted\r
+  @retval  EFI_INVALID_PARAMETER The buffer was NULL\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_SMM_COMMUNICATE) (\r
+  IN EFI_SMM_BASE_PROTOCOL          *This,\r
+  IN EFI_HANDLE                     ImageHandle,\r
+  IN OUT VOID                       *CommunicationBuffer,\r
+  IN OUT UINTN                      *SourceSize\r
+  )\r
+;\r
+\r
+/**\r
+  Register a callback to execute within SMM.   \r
+  This allows receipt of messages created with the Boot Service COMMUNICATE.\r
+\r
+  @param  This Protocol instance pointer.\r
+  @param  CallbackAddress Address of the callback service\r
+  @param  MakeFirst If present, will stipulate that the handler is posted\r
+  to be the first module executed in the dispatch table.\r
+  @param  MakeLast If present, will stipulate that the handler is posted\r
+  to be last executed in the dispatch table.\r
+  @param  FloatingPointSave This is an optional parameter which informs the\r
+  EFI_SMM_ACCESS_PROTOCOL Driver core if it needs to save\r
+  the floating point register state.  If any of the handlers\r
+  require this, then the state will be saved for all of the handlers.\r
+\r
+  @retval  EFI_SUCCESS The operation was successful\r
+  @retval  EFI_OUT_OF_RESOURCES Not enough space in the dispatch queue\r
+  @retval  EFI_UNSUPPORTED In runtime.\r
+  @retval  EFI_UNSUPPORTED Not in SMM.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_SMM_CALLBACK_SERVICE) (\r
+  IN EFI_SMM_BASE_PROTOCOL                            *This,\r
+  IN EFI_HANDLE                                       SmmImageHandle,\r
+  IN EFI_SMM_CALLBACK_ENTRY_POINT                     CallbackAddress,\r
+  IN BOOLEAN                                          MakeLast OPTIONAL,\r
+  IN BOOLEAN                                          FloatingPointSave OPTIONAL\r
+  )\r
+;\r
+\r
+/**\r
+  The SmmAllocatePool() function allocates a memory region of Size bytes from memory of \r
+  type PoolType and returns the address of the allocated memory in the location referenced \r
+  by Buffer.  This function allocates pages from EFI SMRAM Memory as needed to grow the \r
+  requested pool type.  All allocations are eight-byte aligned.\r
+\r
+  @param  This Protocol instance pointer.\r
+  @param  PoolType The type of pool to allocate.\r
+  The only supported type is EfiRuntimeServicesData;\r
+  the interface will internally map this runtime request to SMRAM.\r
+  @param  Size The number of bytes to allocate from the pool.\r
+  @param  Buffer A pointer to a pointer to the allocated buffer if the call\r
+  succeeds; undefined otherwise.\r
+\r
+  @retval  EFI_SUCCESS The requested number of bytes was allocated.\r
+  @retval  EFI_OUT_OF_RESOURCES The pool requested could not be allocated.\r
+  @retval  EFI_INVALID_PARAMETER PoolType was invalid.\r
+  @retval  EFI_UNSUPPORTED In runtime.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_SMM_ALLOCATE_POOL) (\r
+  IN EFI_SMM_BASE_PROTOCOL          *This,\r
+  IN EFI_MEMORY_TYPE                PoolType,\r
+  IN UINTN                          Size,\r
+  OUT VOID                          **Buffer\r
+  )\r
+;\r
+\r
+/**\r
+  The SmmFreePool() function returns the memory specified by Buffer to the system.  \r
+  On return, the memory's type is EFI SMRAM Memory.  The Buffer that is freed must \r
+  have been allocated by SmmAllocatePool().\r
+\r
+  @param  This Protocol instance pointer.\r
+  @param  Buffer Pointer to the buffer allocation.\r
+\r
+  @retval  EFI_SUCCESS The memory was returned to the system.\r
+  @retval  EFI_INVALID_PARAMETER Buffer was invalid.\r
+  @retval  EFI_UNSUPPORTED In runtime.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_SMM_FREE_POOL) (\r
+  IN EFI_SMM_BASE_PROTOCOL          *This,\r
+  IN VOID                           *Buffer\r
+  )\r
+;\r
+\r
+/**\r
+  This routine tells caller if execution context is SMM or not.\r
+\r
+  @param  This Protocol instance pointer.\r
+  @param  InSmm Whether the caller is inside SMM for IA-32 or servicing a PMI for the Itanium processor family.\r
+\r
+  @retval  EFI_SUCCESS The operation was successful\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_SMM_INSIDE_OUT) (\r
+  IN EFI_SMM_BASE_PROTOCOL          *This,\r
+  OUT BOOLEAN                       *InSmm\r
+  )\r
+;\r
+\r
+/**\r
+  The GetSmstLocation() function returns the locatin of the System Management \r
+  Service Table.  The use of the API is such that a driver can discover the \r
+  location of the SMST in its entry point and then cache it in some driver \r
+  global variable so that the SMST can be invoked in subsequent callbacks.\r
+\r
+  @param  This Protocol instance pointer.\r
+  @param  Smst Pointer to the SMST.\r
+\r
+  @retval  EFI_SUCCESS The operation was successful\r
+  @retval  EFI_INVALID_PARAMETER Smst was invalid.\r
+  @retval  EFI_UNSUPPORTED Not in SMM.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_SMM_GET_SMST_LOCATION) (\r
+  IN EFI_SMM_BASE_PROTOCOL          *This,\r
+  IN OUT EFI_SMM_SYSTEM_TABLE       **Smst\r
+  )\r
+;\r
+\r
+/**\r
+  @par Protocol Description:\r
+  This protocol is used to install SMM handlers for support of subsequent SMI/PMI \r
+  activations. This protocol is available on both IA-32 and Itanium-based systems.\r
+\r
+  @param Register\r
+  Registers a handler to run in System Management RAM (SMRAM).\r
+\r
+  @param UnRegister\r
+  Removes a handler from execution in SMRAM.\r
+\r
+  @param Communicate\r
+  Sends/receives a message for a registered handler.\r
+\r
+  @param RegisterCallback\r
+  Registers a callback from the constructor.\r
+\r
+  @param InSmm\r
+  Detects whether the caller is inside or outside of SMM. SName\r
+\r
+  @param SmmAllocatePool\r
+  Allocates SMRAM.\r
+\r
+  @param SmmFreePool\r
+  Deallocates SMRAM.\r
+\r
+  @param GetSmstLocation\r
+  Retrieves the location of the System Management System Table (SMST).\r
+\r
+**/\r
+struct _EFI_SMM_BASE_PROTOCOL {\r
+  EFI_SMM_REGISTER_HANDLER    Register;\r
+  EFI_SMM_UNREGISTER_HANDLER  UnRegister;\r
+  EFI_SMM_COMMUNICATE         Communicate;\r
+  EFI_SMM_CALLBACK_SERVICE    RegisterCallback;\r
+  EFI_SMM_INSIDE_OUT          InSmm;\r
+  EFI_SMM_ALLOCATE_POOL       SmmAllocatePool;\r
+  EFI_SMM_FREE_POOL           SmmFreePool;\r
+  EFI_SMM_GET_SMST_LOCATION   GetSmstLocation;\r
+};\r
+\r
+extern EFI_GUID gEfiSmmBaseProtocolGuid;\r
+\r
+#endif\r
diff --git a/Tools/Source/TianoTools/Include/Protocol/SmmControl.h b/Tools/Source/TianoTools/Include/Protocol/SmmControl.h
new file mode 100644 (file)
index 0000000..3bcd0f7
--- /dev/null
@@ -0,0 +1,139 @@
+/** @file\r
+  This file declares SMM Control abstraction protocol.\r
+\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. This program and the accompanying materials                          \r
+  are licensed and made available under the terms and conditions of the BSD License         \r
+  which accompanies this distribution.  The full text of the license may be found at        \r
+  http://opensource.org/licenses/bsd-license.php                                            \r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+  Module Name:  SmmControl.h\r
+\r
+  @par Revision Reference:\r
+  This Protocol is defined in Framework of EFI SMM Core Interface Spec\r
+  Version 0.9.\r
+\r
+**/\r
+\r
+#ifndef _SMM_CONTROL_H_\r
+#define _SMM_CONTROL_H_\r
+\r
+typedef struct _EFI_SMM_CONTROL_PROTOCOL              EFI_SMM_CONTROL_PROTOCOL;\r
+\r
+#define EFI_SMM_CONTROL_PROTOCOL_GUID \\r
+  { \\r
+    0x8d12e231, 0xc667, 0x4fd1, {0x98, 0xf2, 0x24, 0x49, 0xa7, 0xe7, 0xb2, 0xe5 } \\r
+  }\r
+\r
+// SMM Access specification Data Structures\r
+//\r
+typedef struct {\r
+  UINT8 SmiTriggerRegister;\r
+  UINT8 SmiDataRegister;\r
+} EFI_SMM_CONTROL_REGISTER;\r
+\r
+//\r
+// SMM Control specification member function\r
+//\r
+/**\r
+  Invokes SMI activation from either the preboot or runtime environment.\r
+\r
+  @param  This The EFI_SMM_CONTROL_PROTOCOL instance. \r
+  \r
+  @param  ArgumentBuffer Optional sized data to pass into the protocol activation. \r
+  \r
+  @param  ArgumentBufferSize Optional size of the data.\r
+  \r
+  @param  Periodic Optional mechanism to engender a periodic stream.\r
+  \r
+  @param  ActivationInterval Optional parameter to repeat at this period one \r
+  time or, if the Periodic Boolean is set, periodically.\r
+\r
+  @retval EFI_SUCCESS  The SMI/PMI has been engendered.\r
+  \r
+  @retval EFI_DEVICE_ERROR  The timing is unsupported.\r
+  \r
+  @retval EFI_INVALID_PARAMETER  The activation period is unsupported.\r
+  \r
+  @retval EFI_NOT_STARTED  The SMM base service has not been initialized.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_SMM_ACTIVATE) (\r
+  IN EFI_SMM_CONTROL_PROTOCOL                             *This,\r
+  IN OUT INT8                                             *ArgumentBuffer OPTIONAL,\r
+  IN OUT UINTN                                            *ArgumentBufferSize OPTIONAL,\r
+  IN BOOLEAN                                              Periodic OPTIONAL,\r
+  IN UINTN                                                ActivationInterval OPTIONAL\r
+  );\r
+\r
+/**\r
+  Clears any system state that was created in response to the Active call.\r
+\r
+  @param  This The EFI_SMM_CONTROL_PROTOCOL instance. \r
+  \r
+  @param  Periodic Optional parameter to repeat at this period one time\r
+\r
+  @retval EFI_SUCCESS  The SMI/PMI has been engendered.\r
+  \r
+  @retval EFI_DEVICE_ERROR  The source could not be cleared.\r
+  \r
+  @retval EFI_INVALID_PARAMETER  The service did not support the Periodic input argument.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_SMM_DEACTIVATE) (\r
+  IN EFI_SMM_CONTROL_PROTOCOL                   *This,\r
+  IN BOOLEAN                                    Periodic OPTIONAL\r
+  );\r
+\r
+/**\r
+  Provides information on the source register used to generate the SMI.\r
+\r
+  @param  This The EFI_SMM_CONTROL_PROTOCOL instance. \r
+  \r
+  @param  SmiRegister Pointer to the SMI register description structure\r
+\r
+  @retval EFI_SUCCESS  The register structure has been returned.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_SMM_GET_REGISTER_INFO) (\r
+  IN EFI_SMM_CONTROL_PROTOCOL           *This,\r
+  IN OUT EFI_SMM_CONTROL_REGISTER       *SmiRegister\r
+  );\r
+\r
+/**\r
+  @par Protocol Description:\r
+  This protocol is used initiate SMI/PMI activations. \r
+\r
+  @param Trigger\r
+  Initiates the SMI/PMI activation.\r
+\r
+  @param Clear\r
+  Quiesces the SMI/PMI activation. \r
+\r
+  @param GetRegisterInfo\r
+  Provides data on the register used as the source of the SMI.\r
+\r
+  @param MinimumTriggerPeriod\r
+  Minimum interval at which the platform can set the period. \r
+\r
+**/\r
+\r
+struct _EFI_SMM_CONTROL_PROTOCOL {\r
+  EFI_SMM_ACTIVATE          Trigger;\r
+  EFI_SMM_DEACTIVATE        Clear;\r
+  EFI_SMM_GET_REGISTER_INFO GetRegisterInfo;\r
+  UINTN                     MinimumTriggerPeriod;\r
+};\r
+\r
+extern EFI_GUID gEfiSmmControlProtocolGuid;\r
+\r
+#endif\r
diff --git a/Tools/Source/TianoTools/Include/Protocol/SmmGpiDispatch.h b/Tools/Source/TianoTools/Include/Protocol/SmmGpiDispatch.h
new file mode 100644 (file)
index 0000000..b472e92
--- /dev/null
@@ -0,0 +1,150 @@
+/** @file\r
+  This file declares Smm Gpi Smi Child Protocol\r
+\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. This program and the accompanying materials                          \r
+  are licensed and made available under the terms and conditions of the BSD License         \r
+  which accompanies this distribution.  The full text of the license may be found at        \r
+  http://opensource.org/licenses/bsd-license.php                                            \r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+  Module Name:  SmmGpiDispatch.h\r
+\r
+  @par Revision Reference:\r
+  This Protocol is defined in Framework of EFI SMM Core Interface Spec\r
+  Version 0.9.\r
+\r
+**/\r
+\r
+#ifndef _EFI_SMM_GPI_DISPATCH_H_\r
+#define _EFI_SMM_GPI_DISPATCH_H_\r
+\r
+//\r
+// Global ID for the GPI SMI Protocol\r
+//\r
+#define EFI_SMM_GPI_DISPATCH_PROTOCOL_GUID \\r
+  { \\r
+    0xe0744b81, 0x9513, 0x49cd, {0x8c, 0xea, 0xe9, 0x24, 0x5e, 0x70, 0x39, 0xda } \\r
+  }\r
+\r
+typedef struct _EFI_SMM_GPI_DISPATCH_PROTOCOL  EFI_SMM_GPI_DISPATCH_PROTOCOL;\r
+\r
+//\r
+// Related Definitions\r
+//\r
+//\r
+// GpiMask is a bit mask of 32 possible general purpose inputs that can generate a\r
+// a SMI.  Bit 0 corresponds to logical GPI[0], 1 corresponds to logical GPI[1], etc.\r
+//\r
+// The logical GPI index to physical pin on device is described by the GPI device name\r
+// found on the same handle as the GpiSmi child dispatch protocol.  The GPI device name\r
+// is defined as protocol with a GUID name and NULL protocol pointer.\r
+//\r
+typedef struct {\r
+  UINTN GpiNum;\r
+} EFI_SMM_GPI_DISPATCH_CONTEXT;\r
+\r
+//\r
+// Member functions\r
+//\r
+/**\r
+  Dispatch function for a GPI SMI handler.\r
+\r
+  @param  DispatchHandle Handle of this dispatch function.\r
+  @param  DispatchContext Pointer to the dispatch function's context.\r
+  The DispatchContext fields are filled in by the dispatching driver prior to\r
+  invoking this dispatch function.\r
+\r
+  @return None\r
+\r
+**/\r
+typedef\r
+VOID\r
+(EFIAPI *EFI_SMM_GPI_DISPATCH) (\r
+  IN  EFI_HANDLE                    DispatchHandle,\r
+  IN  EFI_SMM_GPI_DISPATCH_CONTEXT  *DispatchContext\r
+  );\r
+\r
+/**\r
+  Register a child SMI source dispatch function with a parent SMM driver\r
+\r
+  @param  This Protocol instance pointer.\r
+  @param  DispatchFunction Pointer to dispatch function to be invoked for\r
+  this SMI source\r
+  @param  DispatchContext Pointer to the dispatch function's context.\r
+  The caller fills this context in before calling\r
+  the register function to indicate to the register\r
+  function the GPI(s) for which the dispatch function\r
+  should be invoked.\r
+  @param  DispatchHandle Handle of dispatch function, for when interfacing\r
+  with the parent Sx state SMM driver.\r
+\r
+  @retval  EFI_SUCCESS The dispatch function has been successfully\r
+  registered and the SMI source has been enabled.\r
+  @retval  EFI_DEVICE_ERROR The driver was unable to enable the SMI source.\r
+  @retval  EFI_OUT_OF_RESOURCES Not enough memory (system or SMM) to manage this\r
+  child.\r
+  @retval  EFI_INVALID_PARAMETER DispatchContext is invalid. The GPI input value\r
+  is not within valid range.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_SMM_GPI_REGISTER) (\r
+  IN EFI_SMM_GPI_DISPATCH_PROTOCOL            *This,\r
+  IN  EFI_SMM_GPI_DISPATCH                    DispatchFunction,\r
+  IN  EFI_SMM_GPI_DISPATCH_CONTEXT            *DispatchContext,\r
+  OUT EFI_HANDLE                              *DispatchHandle\r
+  );\r
+\r
+/**\r
+  Unregister a child SMI source dispatch function with a parent SMM driver\r
+\r
+  @param  This Protocol instance pointer.\r
+  @param  DispatchHandle Handle of dispatch function to deregister.\r
+\r
+  @retval  EFI_SUCCESS The dispatch function has been successfully\r
+  unregistered and the SMI source has been disabled\r
+  if there are no other registered child dispatch\r
+  functions for this SMI source.\r
+  @retval  EFI_INVALID_PARAMETER Handle is invalid.\r
+  @retval  other TBD\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_SMM_GPI_UNREGISTER) (\r
+  IN EFI_SMM_GPI_DISPATCH_PROTOCOL            *This,\r
+  IN  EFI_HANDLE                              DispatchHandle\r
+  );\r
+\r
+//\r
+// Interface structure for the SMM GPI SMI Dispatch Protocol\r
+//\r
+/**\r
+  @par Protocol Description:\r
+  Provides the parent dispatch service for the General Purpose Input \r
+  (GPI) SMI source generator.\r
+\r
+  @param Register\r
+  Installs a child service to be dispatched by this protocol.\r
+\r
+  @param UnRegister\r
+  Removes a child service dispatched by this protocol.\r
+\r
+  @param NumSupportedGpis\r
+  Denotes the maximum value of inputs that can have handlers attached.\r
+\r
+**/\r
+struct _EFI_SMM_GPI_DISPATCH_PROTOCOL {\r
+  EFI_SMM_GPI_REGISTER    Register;\r
+  EFI_SMM_GPI_UNREGISTER  UnRegister;\r
+  UINTN                   NumSupportedGpis;\r
+};\r
+\r
+extern EFI_GUID gEfiSmmGpiDispatchProtocolGuid;\r
+\r
+#endif\r
+\r
diff --git a/Tools/Source/TianoTools/Include/Protocol/SmmIchnDispatch.h b/Tools/Source/TianoTools/Include/Protocol/SmmIchnDispatch.h
new file mode 100644 (file)
index 0000000..8829f85
--- /dev/null
@@ -0,0 +1,193 @@
+/** @file\r
+  This file declares EFI Smm ICH [N] Specific Smi Child Protocol\r
+\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. This program and the accompanying materials                          \r
+  are licensed and made available under the terms and conditions of the BSD License         \r
+  which accompanies this distribution.  The full text of the license may be found at        \r
+  http://opensource.org/licenses/bsd-license.php                                            \r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+  Module Name:  SmmIchnDispatch.h\r
+\r
+  @par Revision Reference:\r
+  This Protocol is defined in Framework of EFI SMM Core Interface Spec\r
+  Version 0.9.\r
+\r
+**/\r
+\r
+#ifndef _EFI_SMM_ICHN_DISPATCH_H_\r
+#define _EFI_SMM_ICHN_DISPATCH_H_\r
+\r
+//\r
+// Global ID for the ICH SMI Protocol\r
+//\r
+#define EFI_SMM_ICHN_DISPATCH_PROTOCOL_GUID \\r
+  { \\r
+    0xc50b323e, 0x9075, 0x4f2a, {0xac, 0x8e, 0xd2, 0x59, 0x6a, 0x10, 0x85, 0xcc } \\r
+  }\r
+\r
+typedef struct _EFI_SMM_ICHN_DISPATCH_PROTOCOL  EFI_SMM_ICHN_DISPATCH_PROTOCOL;\r
+\r
+//\r
+// Related Definitions\r
+//\r
+//\r
+// ICHN Specific SMIs.  These are miscellaneous SMI sources that are supported by the\r
+// ICHN specific SMI implementation.  These may change over time.  TrapNumber is only\r
+// valid if the Type is Trap.\r
+//\r
+typedef enum {\r
+  //\r
+  // NOTE: NEVER delete items from this list/enumeration!  Doing so will prevent other versions\r
+  // of the code from compiling.  If the ICH version your driver is written for doesn't support\r
+  // some of these SMIs, then simply return EFI_UNSUPPORTED when a child/client tries to register\r
+  // for them.\r
+  //\r
+  IchnMch,\r
+  IchnPme,\r
+  IchnRtcAlarm,\r
+  IchnRingIndicate,\r
+  IchnAc97Wake,\r
+  IchnSerialIrq,\r
+  IchnY2KRollover,\r
+  IchnTcoTimeout,\r
+  IchnOsTco,\r
+  IchnNmi,\r
+  IchnIntruderDetect,\r
+  IchnBiosWp,\r
+  IchnMcSmi,\r
+  IchnPmeB0,\r
+  IchnThrmSts,\r
+  IchnSmBus,\r
+  IchnIntelUsb2,\r
+  IchnMonSmi7,\r
+  IchnMonSmi6,\r
+  IchnMonSmi5,\r
+  IchnMonSmi4,\r
+  IchnDevTrap13,\r
+  IchnDevTrap12,\r
+  IchnDevTrap11,\r
+  IchnDevTrap10,\r
+  IchnDevTrap9,\r
+  IchnDevTrap8,\r
+  IchnDevTrap7,\r
+  IchnDevTrap6,\r
+  IchnDevTrap5,\r
+  IchnDevTrap3,\r
+  IchnDevTrap2,\r
+  IchnDevTrap1,\r
+  IchnDevTrap0,\r
+  IchnIoTrap3,\r
+  IchnIoTrap2,\r
+  IchnIoTrap1,\r
+  IchnIoTrap0,\r
+  //\r
+  // INSERT NEW ITEMS JUST BEFORE THIS LINE\r
+  //\r
+  NUM_ICHN_TYPES  // the number of items in this enumeration\r
+} EFI_SMM_ICHN_SMI_TYPE;\r
+\r
+typedef struct {\r
+  EFI_SMM_ICHN_SMI_TYPE Type;\r
+} EFI_SMM_ICHN_DISPATCH_CONTEXT;\r
+\r
+//\r
+// Member functions\r
+//\r
+/**\r
+  Dispatch function for a ICH n specific SMI handler.\r
+\r
+  @param  DispatchHandle Handle of this dispatch function.\r
+  @param  DispatchContext Pointer to the dispatch function's context.\r
+  The DispatchContext fields are filled in\r
+  by the dispatching driver prior to\r
+  invoking this dispatch function.\r
+\r
+  Nothing\r
+\r
+**/\r
+typedef\r
+VOID\r
+(EFIAPI *EFI_SMM_ICHN_DISPATCH) (\r
+  IN  EFI_HANDLE                      DispatchHandle,\r
+  IN  EFI_SMM_ICHN_DISPATCH_CONTEXT   *DispatchContext\r
+  );\r
+\r
+/**\r
+  Register a child SMI source dispatch function with a parent SMM driver\r
+\r
+  @param  This Protocol instance pointer.\r
+  @param  DispatchFunction Pointer to dispatch function to be invoked for\r
+  this SMI source\r
+  @param  DispatchContext Pointer to the dispatch function's context.\r
+  The caller fills this context in before calling\r
+  the register function to indicate to the register\r
+  function the ICHN SMI source for which the dispatch\r
+  function should be invoked.\r
+  @param  DispatchHandle Handle of dispatch function, for when interfacing\r
+  with the parent Sx state SMM driver.\r
+\r
+  @retval  EFI_SUCCESS The dispatch function has been successfully\r
+  registered and the SMI source has been enabled.\r
+  @retval  EFI_DEVICE_ERROR The driver was unable to enable the SMI source.\r
+  @retval  EFI_OUT_OF_RESOURCES Not enough memory (system or SMM) to manage this\r
+  child.\r
+  @retval  EFI_INVALID_PARAMETER DispatchContext is invalid. The ICHN input value\r
+  is not within valid range.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_SMM_ICHN_REGISTER) (\r
+  IN EFI_SMM_ICHN_DISPATCH_PROTOCOL             *This,\r
+  IN  EFI_SMM_ICHN_DISPATCH                     DispatchFunction,\r
+  IN  EFI_SMM_ICHN_DISPATCH_CONTEXT             *DispatchContext,\r
+  OUT EFI_HANDLE                                *DispatchHandle\r
+  );\r
+\r
+/**\r
+  Unregister a child SMI source dispatch function with a parent SMM driver\r
+\r
+  @param  This Protocol instance pointer.\r
+  @param  DispatchHandle Handle of dispatch function to deregister.\r
+\r
+  @retval  EFI_SUCCESS The dispatch function has been successfully\r
+  unregistered and the SMI source has been disabled\r
+  if there are no other registered child dispatch\r
+  functions for this SMI source.\r
+  @retval  EFI_INVALID_PARAMETER Handle is invalid.\r
+  @retval  other TBD\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_SMM_ICHN_UNREGISTER) (\r
+  IN EFI_SMM_ICHN_DISPATCH_PROTOCOL             *This,\r
+  IN  EFI_HANDLE                                DispatchHandle\r
+  );\r
+\r
+//\r
+// Interface structure for the SMM Ich n specific SMI Dispatch Protocol\r
+//\r
+/**\r
+  @par Protocol Description:\r
+  Provides the parent dispatch service for a given SMI source generator.\r
+\r
+  @param Register\r
+  Installs a child service to be dispatched by this protocol.\r
+\r
+  @param UnRegister\r
+  Removes a child service dispatched by this protocol.\r
+\r
+**/\r
+struct _EFI_SMM_ICHN_DISPATCH_PROTOCOL {\r
+  EFI_SMM_ICHN_REGISTER   Register;\r
+  EFI_SMM_ICHN_UNREGISTER UnRegister;\r
+};\r
+\r
+extern EFI_GUID gEfiSmmIchnDispatchProtocolGuid;\r
+\r
+#endif\r
diff --git a/Tools/Source/TianoTools/Include/Protocol/SmmPeriodicTimerDispatch.h b/Tools/Source/TianoTools/Include/Protocol/SmmPeriodicTimerDispatch.h
new file mode 100644 (file)
index 0000000..c94843f
--- /dev/null
@@ -0,0 +1,194 @@
+/** @file\r
+  This file declares EFI Smm Periodic Timer Smi Child Protocol\r
+\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. This program and the accompanying materials                          \r
+  are licensed and made available under the terms and conditions of the BSD License         \r
+  which accompanies this distribution.  The full text of the license may be found at        \r
+  http://opensource.org/licenses/bsd-license.php                                            \r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+  Module Name:  SmmPeriodicTimerDispatch.h\r
+\r
+  @par Revision Reference:\r
+  This Protocol is defined in Framework of EFI SMM Core Interface Spec\r
+  Version 0.9.\r
+\r
+**/\r
+\r
+#ifndef _EFI_SMM_PERIODIC_TIMER_DISPATCH_H_\r
+#define _EFI_SMM_PERIODIC_TIMER_DISPATCH_H_\r
+\r
+//\r
+// Global ID for the Periodic Timer SMI Protocol\r
+//\r
+#define EFI_SMM_PERIODIC_TIMER_DISPATCH_PROTOCOL_GUID \\r
+  { \\r
+    0x9cca03fc, 0x4c9e, 0x4a19, {0x9b, 0x6, 0xed, 0x7b, 0x47, 0x9b, 0xde, 0x55 } \\r
+  }\r
+\r
+typedef struct _EFI_SMM_PERIODIC_TIMER_DISPATCH_PROTOCOL  EFI_SMM_PERIODIC_TIMER_DISPATCH_PROTOCOL;\r
+\r
+//\r
+// Related Definitions\r
+//\r
+//\r
+// Period is the minimum period of time in 100 nanosecond units that child gets called.\r
+// The child will be called back after a time greater than the time Period.\r
+//\r
+// SmiTickInterval is the period of time interval between SMIs.  Children of this interface\r
+// should use this field when registering for periodic timer intervals when a finer\r
+// granularity periodic SMI is desired.  Valid values for this field are those returned\r
+// by GetNextInterval.  A value of 0 indicates the parent is allowed to use any SMI\r
+// interval period to satisfy the requested period.\r
+//    Example: A chipset supports periodic SMIs on every 64ms or 2 seconds.\r
+//      A child wishes schedule a period SMI to fire on a period of 3 seconds, there\r
+//      are several ways to approach the problem:\r
+//      1. The child may accept a 4 second periodic rate, in which case it registers with\r
+//           Period = 40000\r
+//           SmiTickInterval = 20000\r
+//         The resulting SMI will occur every 2 seconds with the child called back on\r
+//         every 2nd SMI.\r
+//         NOTE: the same result would occur if the child set SmiTickInterval = 0.\r
+//      2. The child may choose the finer granularity SMI (64ms):\r
+//           Period = 30000\r
+//           SmiTickInterval = 640\r
+//         The resulting SMI will occur every 64ms with the child called back on\r
+//         every 47th SMI.\r
+//         NOTE: the child driver should be aware that this will result in more\r
+//           SMIs occuring during system runtime which can negatively impact system\r
+//           performance.\r
+//\r
+// ElapsedTime is the actual time in 100 nanosecond units elapsed since last called, a\r
+// value of 0 indicates an unknown amount of time.\r
+//\r
+typedef struct {\r
+  UINT64  Period;\r
+  UINT64  SmiTickInterval;\r
+  UINT64  ElapsedTime;\r
+} EFI_SMM_PERIODIC_TIMER_DISPATCH_CONTEXT;\r
+\r
+//\r
+// Member functions\r
+//\r
+/**\r
+  Dispatch function for a Periodic Timer SMI handler.\r
+\r
+  @param  DispatchHandle Handle of this dispatch function.\r
+  @param  DispatchContext Pointer to the dispatch function's context.\r
+  The DispatchContext fields are filled in\r
+  by the dispatching driver prior to\r
+  invoking this dispatch function.\r
+\r
+  Nothing\r
+\r
+**/\r
+typedef\r
+VOID\r
+(EFIAPI *EFI_SMM_PERIODIC_TIMER_DISPATCH) (\r
+  IN  EFI_HANDLE                                DispatchHandle,\r
+  IN  EFI_SMM_PERIODIC_TIMER_DISPATCH_CONTEXT   *DispatchContext\r
+  );\r
+\r
+/**\r
+  Returns the next SMI tick period supported by the chipset.  The order\r
+  returned is from longest to shortest interval period.\r
+\r
+  @param  This Protocol instance pointer.\r
+  @param  SmiTickInterval Pointer to pointer of next shorter SMI interval\r
+  period supported by the child.  This parameter works as a get-first, \r
+  get-next field.The first time this function is called, *SmiTickInterval \r
+  should be set to NULL to get the longest SMI interval.The returned \r
+  *SmiTickInterval should be passed in on subsequent calls to get the \r
+  next shorter interval period until *SmiTickInterval = NULL.\r
+\r
+  @retval EFI_SUCCESS The service returned successfully.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_SMM_PERIODIC_TIMER_INTERVAL) (\r
+  IN EFI_SMM_PERIODIC_TIMER_DISPATCH_PROTOCOL           *This,\r
+  IN OUT UINT64                                         **SmiTickInterval\r
+  );\r
+\r
+/**\r
+  Register a child SMI source dispatch function with a parent SMM driver\r
+\r
+  @param  This Protocol instance pointer.\r
+  @param  DispatchFunction Pointer to dispatch function to be invoked for\r
+  this SMI source\r
+  @param  DispatchContext Pointer to the dispatch function's context.\r
+  The caller fills this context in before calling\r
+  the register function to indicate to the register\r
+  function the period at which the dispatch function\r
+  should be invoked.\r
+  @param  DispatchHandle Handle of dispatch function, for when interfacing\r
+  with the parent Sx state SMM driver.\r
+\r
+  @retval  EFI_SUCCESS The dispatch function has been successfully\r
+  registered and the SMI source has been enabled.\r
+  @retval  EFI_DEVICE_ERROR The driver was unable to enable the SMI source.\r
+  @retval  EFI_OUT_OF_RESOURCES Not enough memory (system or SMM) to manage this\r
+  child.\r
+  @retval  EFI_INVALID_PARAMETER DispatchContext is invalid. The period input value\r
+  is not within valid range.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_SMM_PERIODIC_TIMER_REGISTER) (\r
+  IN EFI_SMM_PERIODIC_TIMER_DISPATCH_PROTOCOL           *This,\r
+  IN  EFI_SMM_PERIODIC_TIMER_DISPATCH                   DispatchFunction,\r
+  IN  EFI_SMM_PERIODIC_TIMER_DISPATCH_CONTEXT           *DispatchContext,\r
+  OUT EFI_HANDLE                                        *DispatchHandle\r
+  );\r
+\r
+/**\r
+  Unregister a child SMI source dispatch function with a parent SMM driver\r
+\r
+  @param  This Protocol instance pointer.\r
+  @param  DispatchHandle Handle of dispatch function to deregister.\r
+\r
+  @retval  EFI_SUCCESS The dispatch function has been successfully\r
+  unregistered and the SMI source has been disabled\r
+  if there are no other registered child dispatch\r
+  functions for this SMI source.\r
+  @retval  EFI_INVALID_PARAMETER Handle is invalid.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_SMM_PERIODIC_TIMER_UNREGISTER) (\r
+  IN EFI_SMM_PERIODIC_TIMER_DISPATCH_PROTOCOL           *This,\r
+  IN  EFI_HANDLE                                        DispatchHandle\r
+  );\r
+\r
+//\r
+// Interface structure for the SMM Periodic Timer Dispatch Protocol\r
+//\r
+/**\r
+  @par Protocol Description:\r
+  Provides the parent dispatch service for the periodical timer SMI source generator.\r
+\r
+  @param Register\r
+  Installs a child service to be dispatched by this protocol.\r
+\r
+  @param UnRegister\r
+  Removes a child service dispatched by this protocol.\r
+\r
+  @param GetNextShorterInterval\r
+  Returns the next SMI tick period that is supported by the chipset. \r
+\r
+**/\r
+struct _EFI_SMM_PERIODIC_TIMER_DISPATCH_PROTOCOL {\r
+  EFI_SMM_PERIODIC_TIMER_REGISTER   Register;\r
+  EFI_SMM_PERIODIC_TIMER_UNREGISTER UnRegister;\r
+  EFI_SMM_PERIODIC_TIMER_INTERVAL   GetNextShorterInterval;\r
+};\r
+\r
+extern EFI_GUID gEfiSmmPeriodicTimerDispatchProtocolGuid;\r
+\r
+#endif\r
diff --git a/Tools/Source/TianoTools/Include/Protocol/SmmPowerButtonDispatch.h b/Tools/Source/TianoTools/Include/Protocol/SmmPowerButtonDispatch.h
new file mode 100644 (file)
index 0000000..065d85f
--- /dev/null
@@ -0,0 +1,147 @@
+/** @file\r
+  This file declares EFI Smm Power Button Smi Child Protocol\r
+\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. This program and the accompanying materials                          \r
+  are licensed and made available under the terms and conditions of the BSD License         \r
+  which accompanies this distribution.  The full text of the license may be found at        \r
+  http://opensource.org/licenses/bsd-license.php                                            \r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+  Module Name:  SmmPowerButtonDispatch.h\r
+\r
+  @par Revision Reference:\r
+  This Protocol is defined in Framework of EFI SMM Core Interface Spec\r
+  Version 0.9.\r
+\r
+**/\r
+\r
+#ifndef _EFI_SMM_POWER_BUTTON_DISPATCH_H_\r
+#define _EFI_SMM_POWER_BUTTON_DISPATCH_H_\r
+\r
+//\r
+// Global ID for the Power Button SMI Protocol\r
+//\r
+#define EFI_SMM_POWER_BUTTON_DISPATCH_PROTOCOL_GUID \\r
+  { \\r
+    0xb709efa0, 0x47a6, 0x4b41, {0xb9, 0x31, 0x12, 0xec, 0xe7, 0xa8, 0xee, 0x56 } \\r
+  }\r
+\r
+typedef struct _EFI_SMM_POWER_BUTTON_DISPATCH_PROTOCOL  EFI_SMM_POWER_BUTTON_DISPATCH_PROTOCOL;\r
+\r
+//\r
+// Related Definitions\r
+//\r
+//\r
+// Power Button. Example, Use for changing LEDs before ACPI OS is on.\r
+//    - DXE/BDS Phase\r
+//    - OS Install Phase\r
+//\r
+typedef enum {\r
+  PowerButtonEntry,\r
+  PowerButtonExit\r
+} EFI_POWER_BUTTON_PHASE;\r
+\r
+typedef struct {\r
+  EFI_POWER_BUTTON_PHASE  Phase;\r
+} EFI_SMM_POWER_BUTTON_DISPATCH_CONTEXT;\r
+\r
+//\r
+// Member functions\r
+//\r
+/**\r
+  Dispatch function for a Power Button SMI handler.\r
+\r
+  @param  DispatchHandle Handle of this dispatch function.\r
+  @param  DispatchContext Pointer to the dispatch function's context.\r
+  The DispatchContext fields are filled in\r
+  by the dispatching driver prior to\r
+  invoking this dispatch function.\r
+\r
+  Nothing\r
+\r
+**/\r
+typedef\r
+VOID\r
+(EFIAPI *EFI_SMM_POWER_BUTTON_DISPATCH) (\r
+  IN  EFI_HANDLE                             DispatchHandle,\r
+  IN  EFI_SMM_POWER_BUTTON_DISPATCH_CONTEXT  *DispatchContext\r
+  );\r
+\r
+/**\r
+  Register a child SMI source dispatch function with a parent SMM driver\r
+\r
+  @param  This Protocol instance pointer.\r
+  @param  DispatchFunction Pointer to dispatch function to be invoked for\r
+  this SMI source\r
+  @param  DispatchContext Pointer to the dispatch function's context.\r
+  The caller fills this context in before calling\r
+  the register function to indicate to the register\r
+  function the Power Button SMI phase for which the dispatch\r
+  function should be invoked.\r
+  @param  DispatchHandle Handle of dispatch function, for when interfacing\r
+  with the parent Sx state SMM driver.\r
+\r
+  @retval  EFI_SUCCESS The dispatch function has been successfully\r
+  registered and the SMI source has been enabled.\r
+  @retval  EFI_DEVICE_ERROR The driver was unable to enable the SMI source.\r
+  @retval  EFI_OUT_OF_RESOURCES Not enough memory (system or SMM) to manage this\r
+  child.\r
+  @retval  EFI_INVALID_PARAMETER DispatchContext is invalid. The Power Button  SMI\r
+  phase is not within valid range.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_SMM_POWER_BUTTON_REGISTER) (\r
+  IN EFI_SMM_POWER_BUTTON_DISPATCH_PROTOCOL            *This,\r
+  IN  EFI_SMM_POWER_BUTTON_DISPATCH                    DispatchFunction,\r
+  IN  EFI_SMM_POWER_BUTTON_DISPATCH_CONTEXT            *DispatchContext,\r
+  OUT EFI_HANDLE                                       *DispatchHandle\r
+  );\r
+\r
+/**\r
+  Unregister a child SMI source dispatch function with a parent SMM driver\r
+\r
+  @param  This Protocol instance pointer.\r
+  @param  DispatchHandle Handle of dispatch function to deregister.\r
+\r
+  @retval  EFI_SUCCESS The dispatch function has been successfully\r
+  unregistered and the SMI source has been disabled\r
+  if there are no other registered child dispatch\r
+  functions for this SMI source.\r
+  @retval  EFI_INVALID_PARAMETER Handle is invalid.\r
+  @retval  other TBD\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_SMM_POWER_BUTTON_UNREGISTER) (\r
+  IN EFI_SMM_POWER_BUTTON_DISPATCH_PROTOCOL             *This,\r
+  IN  EFI_HANDLE                                        DispatchHandle\r
+  );\r
+\r
+//\r
+// Interface structure for the SMM Power Button SMI Dispatch Protocol\r
+//\r
+/**\r
+  @par Protocol Description:\r
+  Provides the parent dispatch service for the SMM power button SMI source generator.\r
+\r
+  @param Register\r
+  Installs a child service to be dispatched by this protocol.\r
+\r
+  @param UnRegister\r
+  Removes a child service dispatched by this protocol.\r
+\r
+**/\r
+struct _EFI_SMM_POWER_BUTTON_DISPATCH_PROTOCOL {\r
+  EFI_SMM_POWER_BUTTON_REGISTER   Register;\r
+  EFI_SMM_POWER_BUTTON_UNREGISTER UnRegister;\r
+};\r
+\r
+extern EFI_GUID gEfiSmmPowerButtonDispatchProtocolGuid;\r
+\r
+#endif\r
diff --git a/Tools/Source/TianoTools/Include/Protocol/SmmStandbyButtonDispatch.h b/Tools/Source/TianoTools/Include/Protocol/SmmStandbyButtonDispatch.h
new file mode 100644 (file)
index 0000000..7c52eb1
--- /dev/null
@@ -0,0 +1,147 @@
+/** @file\r
+  This file declares EFI Smm Standby Button Smi Child Protocol\r
+\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. This program and the accompanying materials                          \r
+  are licensed and made available under the terms and conditions of the BSD License         \r
+  which accompanies this distribution.  The full text of the license may be found at        \r
+  http://opensource.org/licenses/bsd-license.php                                            \r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+  Module Name:  SmmStandbyButtonDispatch.h\r
+\r
+  @par Revision Reference:\r
+  This Protocol is defined in Framework of EFI SMM Core Interface Spec\r
+  Version 0.9.\r
+\r
+**/\r
+\r
+#ifndef _EFI_SMM_STANDBY_BUTTON_DISPATCH_H_\r
+#define _EFI_SMM_STANDBY_BUTTON_DISPATCH_H_\r
+\r
+//\r
+// Global ID for the Standby Button SMI Protocol\r
+//\r
+#define EFI_SMM_STANDBY_BUTTON_DISPATCH_PROTOCOL_GUID \\r
+  { \\r
+    0x78965b98, 0xb0bf, 0x449e, {0x8b, 0x22, 0xd2, 0x91, 0x4e, 0x49, 0x8a, 0x98 } \\r
+  }\r
+\r
+typedef struct _EFI_SMM_STANDBY_BUTTON_DISPATCH_PROTOCOL  EFI_SMM_STANDBY_BUTTON_DISPATCH_PROTOCOL;\r
+\r
+//\r
+// Related Definitions\r
+//\r
+//\r
+// Standby Button. Example, Use for changing LEDs before ACPI OS is on.\r
+//    - DXE/BDS Phase\r
+//    - OS Install Phase\r
+//\r
+typedef enum {\r
+  Entry,\r
+  Exit\r
+} EFI_STANDBY_BUTTON_PHASE;\r
+\r
+typedef struct {\r
+  EFI_STANDBY_BUTTON_PHASE  Phase;\r
+} EFI_SMM_STANDBY_BUTTON_DISPATCH_CONTEXT;\r
+\r
+//\r
+// Member functions\r
+//\r
+/**\r
+  Dispatch function for a Standby Button SMI handler.\r
+\r
+  @param  DispatchHandle Handle of this dispatch function.\r
+  @param  DispatchContext Pointer to the dispatch function's context.\r
+  The DispatchContext fields are filled in\r
+  by the dispatching driver prior to\r
+  invoking this dispatch function.\r
+\r
+  @return Nothing\r
+\r
+**/\r
+typedef\r
+VOID\r
+(EFIAPI *EFI_SMM_STANDBY_BUTTON_DISPATCH) (\r
+  IN  EFI_HANDLE                                DispatchHandle,\r
+  IN  EFI_SMM_STANDBY_BUTTON_DISPATCH_CONTEXT   *DispatchContext\r
+  );\r
+\r
+/**\r
+  Register a child SMI source dispatch function with a parent SMM driver\r
+\r
+  @param  This Protocol instance pointer.\r
+  @param  DispatchFunction Pointer to dispatch function to be invoked for\r
+  this SMI source\r
+  @param  DispatchContext Pointer to the dispatch function's context.\r
+  The caller fills this context in before calling\r
+  the register function to indicate to the register\r
+  function the Standby Button SMI phase for which the dispatch\r
+  function should be invoked.\r
+  @param  DispatchHandle Handle of dispatch function, for when interfacing\r
+  with the parent Sx state SMM driver.\r
+\r
+  @retval  EFI_SUCCESS The dispatch function has been successfully\r
+  registered and the SMI source has been enabled.\r
+  @retval  EFI_DEVICE_ERROR The driver was unable to enable the SMI source.\r
+  @retval  EFI_OUT_OF_RESOURCES Not enough memory (system or SMM) to manage this\r
+  child.\r
+  @retval  EFI_INVALID_PARAMETER DispatchContext is invalid. The Standby Button  SMI\r
+  phase is not within valid range.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_SMM_STANDBY_BUTTON_REGISTER) (\r
+  IN EFI_SMM_STANDBY_BUTTON_DISPATCH_PROTOCOL           *This,\r
+  IN  EFI_SMM_STANDBY_BUTTON_DISPATCH                   DispatchFunction,\r
+  IN  EFI_SMM_STANDBY_BUTTON_DISPATCH_CONTEXT           *DispatchContext,\r
+  OUT EFI_HANDLE                                        *DispatchHandle\r
+  );\r
+\r
+/**\r
+  Unregister a child SMI source dispatch function with a parent SMM driver\r
+\r
+  @param  This Protocol instance pointer.\r
+  @param  DispatchHandle Handle of dispatch function to deregister.\r
+\r
+  @retval  EFI_SUCCESS The dispatch function has been successfully\r
+  unregistered and the SMI source has been disabled\r
+  if there are no other registered child dispatch\r
+  functions for this SMI source.\r
+  @retval  EFI_INVALID_PARAMETER Handle is invalid.\r
+  @retval  other TBD\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_SMM_STANDBY_BUTTON_UNREGISTER) (\r
+  IN EFI_SMM_STANDBY_BUTTON_DISPATCH_PROTOCOL           *This,\r
+  IN  EFI_HANDLE                                        DispatchHandle\r
+  );\r
+\r
+//\r
+// Interface structure for the SMM Standby Button SMI Dispatch Protocol\r
+//\r
+/**\r
+  @par Protocol Description:\r
+  Provides the parent dispatch service for the standby button SMI source generator.\r
+\r
+  @param Register\r
+  Installs a child service to be dispatched by this protocol.\r
+\r
+  @param UnRegister\r
+  Removes a child service dispatched by this protocol.\r
+\r
+**/\r
+struct _EFI_SMM_STANDBY_BUTTON_DISPATCH_PROTOCOL {\r
+  EFI_SMM_STANDBY_BUTTON_REGISTER   Register;\r
+  EFI_SMM_STANDBY_BUTTON_UNREGISTER UnRegister;\r
+};\r
+\r
+extern EFI_GUID gEfiSmmStandbyButtonDispatchProtocolGuid;\r
+\r
+#endif\r
diff --git a/Tools/Source/TianoTools/Include/Protocol/SmmStatusCode.h b/Tools/Source/TianoTools/Include/Protocol/SmmStatusCode.h
new file mode 100644 (file)
index 0000000..6608715
--- /dev/null
@@ -0,0 +1,86 @@
+/** @file\r
+  This file declares SMM Status code Protocol.\r
+\r
+  This code abstracts SMM Status Code reporting.\r
+\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. This program and the accompanying materials                          \r
+  are licensed and made available under the terms and conditions of the BSD License         \r
+  which accompanies this distribution.  The full text of the license may be found at        \r
+  http://opensource.org/licenses/bsd-license.php                                            \r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+  Module Name:  SmmStatusCode.h\r
+\r
+  @par Revision Reference:\r
+  This Protocol is defined in Framework of EFI SMM Core Interface Spec\r
+  Version 0.9.\r
+\r
+**/\r
+\r
+#ifndef _PROTOCOL_SMM_STATUS_CODE_H__\r
+#define _PROTOCOL_SMM_STATUS_CODE_H__\r
+\r
+//\r
+// Global ID for the Smm Status Code Protocol\r
+//\r
+#define EFI_SMM_STATUS_CODE_PROTOCOL_GUID \\r
+  { \\r
+    0x6afd2b77, 0x98c1, 0x4acd, {0xa6, 0xf9, 0x8a, 0x94, 0x39, 0xde, 0xf, 0xb1 } \\r
+  }\r
+\r
+typedef struct _EFI_SMM_STATUS_CODE_PROTOCOL  EFI_SMM_STATUS_CODE_PROTOCOL;\r
+\r
+/**\r
+  Service to emit the status code in SMM.\r
+\r
+  @param  This Pointer to EFI_SMM_STATUS_CODE_PROTOCOL instance.\r
+  \r
+  @param  CodeType Indicates the type of status code being reported.\r
+  \r
+  @param  Value Describes the current status of a hardware or software entity.\r
+  This included information about the class and subclass that is used to \r
+  classify the entity as well as an operation.\r
+  \r
+  @param  Instance The enumeration of a hardware or software entity within \r
+  the system. Valid instance numbers start with 1.\r
+  \r
+  @param  CallerId This optional parameter may be used to identify the caller.\r
+  This parameter allows the status code driver to apply different rules to \r
+  different callers.\r
+  \r
+  @param  Data This optional parameter may be used to pass additional data.\r
+\r
+  @retval EFI_SUCCESS The function completed successfully\r
+  \r
+  @retval EFI_DEVICE_ERROR The function should not be completed due to a device error.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_SMM_REPORT_STATUS_CODE) (\r
+  IN EFI_SMM_STATUS_CODE_PROTOCOL *This,\r
+  IN EFI_STATUS_CODE_TYPE         CodeType,\r
+  IN EFI_STATUS_CODE_VALUE        Value,\r
+  IN UINT32                       Instance,\r
+  IN EFI_GUID                     *CallerId,\r
+  IN EFI_STATUS_CODE_DATA         *Data OPTIONAL\r
+  );\r
+\r
+/**\r
+  @par Protocol Description:\r
+  Provides status code services from SMM.\r
+\r
+  @param ReportStatusCode\r
+  Allows for the SMM agent to produce a status code output.\r
+\r
+**/\r
+struct _EFI_SMM_STATUS_CODE_PROTOCOL {\r
+  EFI_SMM_REPORT_STATUS_CODE  ReportStatusCode;\r
+};\r
+\r
+extern EFI_GUID gEfiSmmStatusCodeProtocolGuid;\r
+\r
+#endif\r
diff --git a/Tools/Source/TianoTools/Include/Protocol/SmmSwDispatch.h b/Tools/Source/TianoTools/Include/Protocol/SmmSwDispatch.h
new file mode 100644 (file)
index 0000000..bc456cb
--- /dev/null
@@ -0,0 +1,149 @@
+/** @file\r
+  This file declares EFI Smm Software Smi Child Protocol\r
+\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. This program and the accompanying materials                          \r
+  are licensed and made available under the terms and conditions of the BSD License         \r
+  which accompanies this distribution.  The full text of the license may be found at        \r
+  http://opensource.org/licenses/bsd-license.php                                            \r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+  Module Name:  SmmSwDispatch.h\r
+\r
+  @par Revision Reference:\r
+  This Protocol is defined in Framework of EFI SMM Core Interface Spec\r
+  Version 0.9.\r
+\r
+**/\r
+\r
+#ifndef _EFI_SMM_SW_DISPATCH_H_\r
+#define _EFI_SMM_SW_DISPATCH_H_\r
+\r
+//\r
+// Global ID for the SW SMI Protocol\r
+//\r
+#define EFI_SMM_SW_DISPATCH_PROTOCOL_GUID \\r
+  { \\r
+    0xe541b773, 0xdd11, 0x420c, {0xb0, 0x26, 0xdf, 0x99, 0x36, 0x53, 0xf8, 0xbf } \\r
+  }\r
+\r
+typedef struct _EFI_SMM_SW_DISPATCH_PROTOCOL  EFI_SMM_SW_DISPATCH_PROTOCOL;\r
+\r
+//\r
+// Related Definitions\r
+//\r
+//\r
+// A particular chipset may not support all possible software SMI input values.\r
+// For example, the ICH supports only values 00h to 0FFh.  The parent only allows a single\r
+// child registration for each SwSmiInputValue.\r
+//\r
+typedef struct {\r
+  UINTN SwSmiInputValue;\r
+} EFI_SMM_SW_DISPATCH_CONTEXT;\r
+\r
+//\r
+// Member functions\r
+//\r
+/**\r
+  Dispatch function for a Software SMI handler.\r
+\r
+  @param  DispatchHandle Handle of this dispatch function.\r
+  @param  DispatchContext Pointer to the dispatch function's context.\r
+  The SwSmiInputValue field is filled in\r
+  by the software dispatch driver prior to\r
+  invoking this dispatch function.\r
+  The dispatch function will only be called\r
+  for input values for which it is registered.\r
+\r
+  Nothing\r
+\r
+**/\r
+typedef\r
+VOID\r
+(EFIAPI *EFI_SMM_SW_DISPATCH) (\r
+  IN  EFI_HANDLE                    DispatchHandle,\r
+  IN  EFI_SMM_SW_DISPATCH_CONTEXT   *DispatchContext\r
+  );\r
+\r
+/**\r
+  Register a child SMI source dispatch function with a parent SMM driver\r
+\r
+  @param  This Protocol instance pointer.\r
+  @param  DispatchFunction Pointer to dispatch function to be invoked for\r
+  this SMI source\r
+  @param  DispatchContext Pointer to the dispatch function's context.\r
+  The caller fills this context in before calling\r
+  the register function to indicate to the register\r
+  function which Software SMI input value the\r
+  dispatch function should be invoked for.\r
+  @param  DispatchHandle Handle of dispatch function, for when interfacing\r
+  with the parent Sx state SMM driver.\r
+\r
+  @retval  EFI_SUCCESS The dispatch function has been successfully\r
+  registered and the SMI source has been enabled.\r
+  @retval  EFI_DEVICE_ERROR The SW driver was unable to enable the SMI source.\r
+  @retval  EFI_OUT_OF_RESOURCES Not enough memory (system or SMM) to manage this\r
+  child.\r
+  @retval  EFI_INVALID_PARAMETER DispatchContext is invalid. The SW SMI input value\r
+  is not within valid range.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_SMM_SW_REGISTER) (\r
+  IN EFI_SMM_SW_DISPATCH_PROTOCOL           *This,\r
+  IN  EFI_SMM_SW_DISPATCH                   DispatchFunction,\r
+  IN  EFI_SMM_SW_DISPATCH_CONTEXT           *DispatchContext,\r
+  OUT EFI_HANDLE                            *DispatchHandle\r
+  );\r
+\r
+/**\r
+  Unregister a child SMI source dispatch function with a parent SMM driver\r
+\r
+  @param  This Protocol instance pointer.\r
+  @param  DispatchHandle Handle of dispatch function to deregister.\r
+\r
+  @retval  EFI_SUCCESS The dispatch function has been successfully\r
+  unregistered and the SMI source has been disabled\r
+  if there are no other registered child dispatch\r
+  functions for this SMI source.\r
+  @retval  EFI_INVALID_PARAMETER Handle is invalid.\r
+  @retval  other TBD\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_SMM_SW_UNREGISTER) (\r
+  IN EFI_SMM_SW_DISPATCH_PROTOCOL           *This,\r
+  IN  EFI_HANDLE                            DispatchHandle\r
+  );\r
+\r
+//\r
+// Interface structure for the SMM Software SMI Dispatch Protocol\r
+//\r
+/**\r
+  @par Protocol Description:\r
+  Provides the parent dispatch service for a given SMI source generator.\r
+\r
+  @param Register\r
+  Installs a child service to be dispatched by this protocol.\r
+\r
+  @param UnRegister\r
+  Removes a child service dispatched by this protocol.\r
+\r
+  @param MaximumSwiValue\r
+  A read-only field that describes the maximum value that can be used \r
+  in the EFI_SMM_SW_DISPATCH_PROTOCOL.Register() service.\r
+\r
+**/\r
+struct _EFI_SMM_SW_DISPATCH_PROTOCOL {\r
+  EFI_SMM_SW_REGISTER   Register;\r
+  EFI_SMM_SW_UNREGISTER UnRegister;\r
+  UINTN                 MaximumSwiValue;\r
+};\r
+\r
+extern EFI_GUID gEfiSmmSwDispatchProtocolGuid;\r
+\r
+#endif\r
diff --git a/Tools/Source/TianoTools/Include/Protocol/SmmSxDispatch.h b/Tools/Source/TianoTools/Include/Protocol/SmmSxDispatch.h
new file mode 100644 (file)
index 0000000..dcbc6a9
--- /dev/null
@@ -0,0 +1,160 @@
+/** @file\r
+  This file declares EFI Smm Sx Smi Child Protocol\r
+\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. This program and the accompanying materials                          \r
+  are licensed and made available under the terms and conditions of the BSD License         \r
+  which accompanies this distribution.  The full text of the license may be found at        \r
+  http://opensource.org/licenses/bsd-license.php                                            \r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+  Module Name:  SmmSxDispatch.h\r
+\r
+  @par Revision Reference:\r
+  This Protocol is defined in Framework of EFI SMM Core Interface Spec\r
+  Version 0.9.\r
+\r
+**/\r
+\r
+#ifndef _EFI_SMM_SX_DISPATCH_H_\r
+#define _EFI_SMM_SX_DISPATCH_H_\r
+\r
+//\r
+// Global ID for the Sx SMI Protocol\r
+//\r
+#define EFI_SMM_SX_DISPATCH_PROTOCOL_GUID \\r
+  { \\r
+    0x14fc52be, 0x1dc, 0x426c, {0x91, 0xae, 0xa2, 0x3c, 0x3e, 0x22, 0xa, 0xe8 } \\r
+  }\r
+\r
+typedef struct _EFI_SMM_SX_DISPATCH_PROTOCOL  EFI_SMM_SX_DISPATCH_PROTOCOL;\r
+//\r
+// Related Definitions\r
+//\r
+typedef enum {\r
+  SxS0,\r
+  SxS1,\r
+  SxS2,\r
+  SxS3,\r
+  SxS4,\r
+  SxS5,\r
+  EfiMaximumSleepType\r
+} EFI_SLEEP_TYPE;\r
+\r
+typedef enum {\r
+  SxEntry,\r
+  SxExit,\r
+  EfiMaximumPhase\r
+} EFI_SLEEP_PHASE;\r
+\r
+typedef struct {\r
+  EFI_SLEEP_TYPE  Type;\r
+  EFI_SLEEP_PHASE Phase;\r
+} EFI_SMM_SX_DISPATCH_CONTEXT;\r
+\r
+//\r
+// Member functions\r
+//\r
+/**\r
+  Dispatch function for a Sx state SMI handler.\r
+\r
+  @param  DispatchHandle Handle of this dispatch function.\r
+  @param  DispatchContext Pointer to the dispatch function¡¯s context. \r
+  The Type and Phase fields are filled in by the Sx dispatch driver \r
+  prior to invoking this dispatch function. For this interface, \r
+  the Sx driver will call the dispatch function for all Sx type \r
+  and phases, so the Sx state handler(s) must check the  Type and \r
+  Phase field of EFI_SMM_SX_DISPATCH_CONTEXT and act accordingly.\r
+\r
+  Nothing\r
+\r
+**/\r
+typedef\r
+VOID\r
+(EFIAPI *EFI_SMM_SX_DISPATCH) (\r
+  IN  EFI_HANDLE                    DispatchHandle,\r
+  IN  EFI_SMM_SX_DISPATCH_CONTEXT   *DispatchContext\r
+  );\r
+\r
+/**\r
+  Register a child SMI source dispatch function with a parent SMM driver\r
+\r
+  @param  This Protocol instance pointer.\r
+  @param  DispatchFunction Pointer to dispatch function to be invoked for\r
+  this SMI source\r
+  @param  DispatchContext Pointer to the dispatch function's context.\r
+  The caller fills this context in before calling\r
+  the register function to indicate to the register\r
+  function which Sx state type and phase the caller\r
+  wishes to be called back on.  For this intertace,\r
+  the Sx driver will call the registered handlers for\r
+  all Sx type and phases, so the Sx state handler(s)\r
+  must check the Type and Phase field of the Dispatch\r
+  context and act accordingly.\r
+  @param  DispatchHandle Handle of dispatch function, for when interfacing\r
+  with the parent Sx state SMM driver.\r
+\r
+  @retval  EFI_SUCCESS The dispatch function has been successfully\r
+  registered and the SMI source has been enabled.\r
+  @retval  EFI_UNSUPPORTED The Sx driver or hardware does not support that\r
+  Sx Type/Phase.\r
+  @retval  EFI_DEVICE_ERROR The Sx driver was unable to enable the SMI source.\r
+  @retval  EFI_OUT_OF_RESOURCES Not enough memory (system or SMM) to manage this\r
+  child.\r
+  @retval  EFI_INVALID_PARAMETER DispatchContext is invalid. Type & Phase are not\r
+  within valid range.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_SMM_SX_REGISTER) (\r
+  IN EFI_SMM_SX_DISPATCH_PROTOCOL           *This,\r
+  IN  EFI_SMM_SX_DISPATCH                   DispatchFunction,\r
+  IN  EFI_SMM_SX_DISPATCH_CONTEXT           *DispatchContext,\r
+  OUT EFI_HANDLE                            *DispatchHandle\r
+  );\r
+\r
+/**\r
+  Unregister a child SMI source dispatch function with a parent SMM driver\r
+\r
+  @param  This Protocol instance pointer.\r
+  @param  DispatchHandle Handle of dispatch function to deregister.\r
+\r
+  @retval  EFI_SUCCESS The dispatch function has been successfully unregistered and the\r
+  SMI source has been disabled if there are no other registered child\r
+  dispatch functions for this SMI source.\r
+  @retval  EFI_INVALID_PARAMETER Handle is invalid.\r
+  @retval  other TBD\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_SMM_SX_UNREGISTER) (\r
+  IN EFI_SMM_SX_DISPATCH_PROTOCOL           *This,\r
+  IN  EFI_HANDLE                            DispatchHandle\r
+  );\r
+\r
+//\r
+// Interface structure for the SMM Child Dispatch Protocol\r
+//\r
+/**\r
+  @par Protocol Description:\r
+  Provides the parent dispatch service for a given Sx-state source generator.\r
+\r
+  @param Register\r
+  Installs a child service to be dispatched by this protocol.\r
+\r
+  @param UnRegister\r
+  Removes a child service dispatched by this protocol.\r
+\r
+**/\r
+struct _EFI_SMM_SX_DISPATCH_PROTOCOL {\r
+  EFI_SMM_SX_REGISTER   Register;\r
+  EFI_SMM_SX_UNREGISTER UnRegister;\r
+};\r
+\r
+extern EFI_GUID gEfiSmmSxDispatchProtocolGuid;\r
+\r
+#endif\r
diff --git a/Tools/Source/TianoTools/Include/Protocol/SmmUsbDispatch.h b/Tools/Source/TianoTools/Include/Protocol/SmmUsbDispatch.h
new file mode 100644 (file)
index 0000000..f036171
--- /dev/null
@@ -0,0 +1,141 @@
+/** @file\r
+  This file declares EFI Smm USB Smi Child Protocol.\r
+\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. This program and the accompanying materials                          \r
+  are licensed and made available under the terms and conditions of the BSD License         \r
+  which accompanies this distribution.  The full text of the license may be found at        \r
+  http://opensource.org/licenses/bsd-license.php                                            \r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+  Module Name:  SmmUsbDispatch.h\r
+\r
+  @par Revision Reference:\r
+  This Protocol is defined in Framework of EFI SMM Core Interface Spec\r
+  Version 0.9.\r
+**/\r
+\r
+#ifndef _EFI_SMM_USB_DISPATCH_H_\r
+#define _EFI_SMM_USB_DISPATCH_H_\r
+\r
+//\r
+// Global ID for the USB Protocol\r
+//\r
+#define EFI_SMM_USB_DISPATCH_PROTOCOL_GUID \\r
+  { \\r
+    0xa05b6ffd, 0x87af, 0x4e42, {0x95, 0xc9, 0x62, 0x28, 0xb6, 0x3c, 0xf3, 0xf3 } \\r
+  }\r
+\r
+typedef struct _EFI_SMM_USB_DISPATCH_PROTOCOL  EFI_SMM_USB_DISPATCH_PROTOCOL;\r
+\r
+//\r
+// Related Definitions\r
+//\r
+typedef enum {\r
+  UsbLegacy,\r
+  UsbWake\r
+} EFI_USB_SMI_TYPE;\r
+\r
+typedef struct {\r
+  EFI_USB_SMI_TYPE          Type;\r
+  EFI_DEVICE_PATH_PROTOCOL  *Device;\r
+} EFI_SMM_USB_DISPATCH_CONTEXT;\r
+\r
+//\r
+// Member functions\r
+//\r
+/**\r
+  Dispatch function for a USB SMI handler.\r
+\r
+  @param  DispatchHandle Handle of this dispatch function.\r
+  @param  DispatchContext Pointer to the dispatch function's context.\r
+  The DispatchContext fields are filled in\r
+  by the dispatching driver prior to\r
+  invoking this dispatch function.\r
+\r
+  Nothing\r
+\r
+**/\r
+typedef\r
+VOID\r
+(EFIAPI *EFI_SMM_USB_DISPATCH) (\r
+  IN  EFI_HANDLE                    DispatchHandle,\r
+  IN  EFI_SMM_USB_DISPATCH_CONTEXT  *DispatchContext\r
+  );\r
+\r
+/**\r
+  Register a child SMI source dispatch function with a parent SMM driver\r
+\r
+  @param  This Protocol instance pointer.\r
+  @param  DispatchFunction Pointer to dispatch function to be invoked for\r
+  this SMI source\r
+  @param  DispatchContext Pointer to the dispatch function's context.\r
+  The caller fills this context in before calling\r
+  the register function to indicate to the register\r
+  function the USB SMI types for which the dispatch\r
+  function should be invoked.\r
+  @param  DispatchHandle Handle of dispatch function, for when interfacing\r
+  with the parent Sx state SMM driver.\r
+\r
+  @retval  EFI_SUCCESS The dispatch function has been successfully\r
+  registered and the SMI source has been enabled.\r
+  @retval  EFI_DEVICE_ERROR The driver was unable to enable the SMI source.\r
+  @retval  EFI_OUT_OF_RESOURCES Not enough memory (system or SMM) to manage this\r
+  child.\r
+  @retval  EFI_INVALID_PARAMETER DispatchContext is invalid. The USB SMI type\r
+  is not within valid range.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_SMM_USB_REGISTER) (\r
+  IN EFI_SMM_USB_DISPATCH_PROTOCOL            *This,\r
+  IN  EFI_SMM_USB_DISPATCH                    DispatchFunction,\r
+  IN  EFI_SMM_USB_DISPATCH_CONTEXT            *DispatchContext,\r
+  OUT EFI_HANDLE                              *DispatchHandle\r
+  );\r
+\r
+/**\r
+  Unregister a child SMI source dispatch function with a parent SMM driver\r
+\r
+  @param  This Protocol instance pointer.\r
+  @param  DispatchHandle Handle of dispatch function to deregister.\r
+\r
+  @retval  EFI_SUCCESS The dispatch function has been successfully\r
+  unregistered and the SMI source has been disabled\r
+  if there are no other registered child dispatch\r
+  functions for this SMI source.\r
+  @retval  EFI_INVALID_PARAMETER Handle is invalid.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_SMM_USB_UNREGISTER) (\r
+  IN EFI_SMM_USB_DISPATCH_PROTOCOL            *This,\r
+  IN  EFI_HANDLE                              DispatchHandle\r
+  );\r
+\r
+//\r
+// Interface structure for the SMM USB SMI Dispatch Protocol\r
+//\r
+/**\r
+  @par Protocol Description:\r
+  Provides the parent dispatch service for the USB SMI source generator.\r
+\r
+  @param Register\r
+  Installs a child service to be dispatched by this protocol.\r
+\r
+  @param UnRegister\r
+  Removes a child service dispatched by this protocol.\r
+\r
+**/\r
+struct _EFI_SMM_USB_DISPATCH_PROTOCOL {\r
+  EFI_SMM_USB_REGISTER    Register;\r
+  EFI_SMM_USB_UNREGISTER  UnRegister;\r
+};\r
+\r
+extern EFI_GUID gEfiSmmUsbDispatchProtocolGuid;\r
+\r
+#endif\r
diff --git a/Tools/Source/TianoTools/Include/Protocol/TapeIo.h b/Tools/Source/TianoTools/Include/Protocol/TapeIo.h
new file mode 100644 (file)
index 0000000..8f15b3a
--- /dev/null
@@ -0,0 +1,236 @@
+/** @file\r
+  EFI_TAPE_IO_PROTOCOL as defined in the UEFI 2.0.\r
+  Provide services to control and access a tape device.\r
+\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. This program and the accompanying materials                          \r
+  are licensed and made available under the terms and conditions of the BSD License         \r
+  which accompanies this distribution.  The full text of the license may be found at        \r
+  http://opensource.org/licenses/bsd-license.php                                            \r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+  Module Name:  TapeIo.h\r
+\r
+**/\r
+\r
+#ifndef __EFI_TAPE_IO_PROTOCOL_H__\r
+#define __EFI_TAPE_IO_PROTOCOL_H__\r
+\r
+#define EFI_TAPE_IO_PROTOCOL_GUID \\r
+  { \\r
+    0x1e93e633, 0xd65a, 0x459e, {0xab, 0x84, 0x93, 0xd9, 0xec, 0x26, 0x6d, 0x18 } \\r
+  }\r
+\r
+typedef struct _EFI_TAPE_IO_PROTOCOL EFI_TAPE_IO_PROTOCOL;\r
+\r
+typedef struct {\r
+  UINT64     Signature;\r
+  UINT32     Revision;\r
+  UINT32     BootDescSize;\r
+  UINT32     BootDescCRC;\r
+  EFI_GUID   TapeGUID;\r
+  EFI_GUID   TapeType;\r
+  EFI_GUID   TapeUnique;\r
+  UINT32     BLLocation;\r
+  UINT32     BLBlocksize;\r
+  UINT32     BLFilesize;\r
+  CHAR8      OSVersion[40];\r
+  CHAR8      AppVersion[40];\r
+  CHAR8      CreationDate[10];\r
+  CHAR8      CreationTime[10];\r
+  CHAR8      SystemName[256];  // UTF-8\r
+  CHAR8      TapeTitle[120];   // UTF-8\r
+  CHAR8      pad[468];         // pad to 1024\r
+} TAPE_HEADER;\r
+\r
+/**\r
+  Reads from the tape.\r
+\r
+  @param  This       A pointer to the EFI_TAPE_IO_PROTOCOL instance.\r
+  @param  BufferSize Size of the buffer in bytes pointed to by Buffer.\r
+  @param  Buffer     Pointer to the buffer for data to be read into.\r
+\r
+  @retval EFI_SUCCESS           Data was successfully transferred from the media.\r
+  @retval EFI_END_OF_FILE       A filemark was encountered which limited the data\r
+                                transferred by the read operation or the head is positioned\r
+                                just after a filemark.\r
+  @retval EFI_NO_MEDIA          No media is loaded in the device.\r
+  @retval EFI_NOT_READY         The transfer failed since the device was not ready (e.g. not\r
+                                online). The transfer may be retried at a later time.\r
+  @retval EFI_UNSUPPORTED       The device does not support this type of transfer.\r
+  @retval EFI_TIMEOUT           The transfer failed to complete within the timeout specified.\r
+  @retval EFI_MEDIA_CHANGED     The media in the device was changed since the last access.\r
+                                The transfer was aborted since the current position of the\r
+                                media may be incorrect.\r
+  @retval EFI_INVALID_PARAMETER A NULL Buffer was specified with a non-zero\r
+                                BufferSize or the device is operating in fixed block\r
+                                size mode and the BufferSize was not a multiple of\r
+                                device¡¯s fixed block size\r
+  @retval EFI_DEVICE_ERROR      A device error occurred while attempting to transfer data\r
+                                from the media.\r
+\r
+**/\r
+typedef \r
+EFI_STATUS\r
+(EFIAPI *EFI_TAPE_READ) (\r
+  IN EFI_TAPE_IO_PROTOCOL *This,\r
+  IN OUT UINTN            *BufferSize,\r
+  OUT VOID                *Buffer\r
+  )\r
+;    \r
+\r
+/**\r
+  Writes to the tape.\r
+\r
+  @param  This       A pointer to the EFI_TAPE_IO_PROTOCOL instance.\r
+  @param  BufferSize Size of the buffer in bytes pointed to by Buffer.\r
+  @param  Buffer     Pointer to the buffer for data to be written from.\r
+\r
+  @retval EFI_SUCCESS           Data was successfully transferred to the media.\r
+  @retval EFI_END_OF_MEDIA      The logical end of media has been reached. Data may have\r
+                                been successfully transferred to the media.\r
+  @retval EFI_NO_MEDIA          No media is loaded in the device.\r
+  @retval EFI_NOT_READY         The transfer failed since the device was not ready (e.g. not\r
+                                online). The transfer may be retried at a later time.\r
+  @retval EFI_UNSUPPORTED       The device does not support this type of transfer.\r
+  @retval EFI_TIMEOUT           The transfer failed to complete within the timeout specified.\r
+  @retval EFI_MEDIA_CHANGED     The media in the device was changed since the last access.\r
+                                The transfer was aborted since the current position of the\r
+                                media may be incorrect.\r
+  @retval EFI_WRITE_PROTECTED   The media in the device is write-protected. The transfer\r
+                                was aborted since a write cannot be completed.\r
+  @retval EFI_INVALID_PARAMETER A NULL Buffer was specified with a non-zero\r
+                                BufferSize or the device is operating in fixed block\r
+                                size mode and the BufferSize was not a multiple of\r
+                                device¡¯s fixed block size\r
+  @retval EFI_DEVICE_ERROR      A device error occurred while attempting to transfer data\r
+                                from the media.\r
+\r
+**/\r
+typedef \r
+EFI_STATUS\r
+(EFIAPI *EFI_TAPE_WRITE) (\r
+  IN EFI_TAPE_IO_PROTOCOL *This,\r
+  IN UINTN                *BufferSize,\r
+  IN VOID                 *Buffer\r
+  )\r
+; \r
+  \r
+\r
+/**\r
+  Rewinds the tape.\r
+\r
+  @param  This A pointer to the EFI_TAPE_IO_PROTOCOL instance.\r
+\r
+  @retval EFI_SUCCESS      The media was successfully repositioned.\r
+  @retval EFI_NO_MEDIA     No media is loaded in the device.\r
+  @retval EFI_NOT_READY    Repositioning the media failed since the device was not\r
+                           ready (e.g. not online). The transfer may be retried at a later time.\r
+  @retval EFI_UNSUPPORTED  The device does not support this type of media repositioning.\r
+  @retval EFI_TIMEOUT      Repositioning of the media did not complete within the timeout specified.\r
+  @retval EFI_DEVICE_ERROR A device error occurred while attempting to reposition the media.\r
+\r
+**/\r
+typedef \r
+EFI_STATUS\r
+(EFIAPI *EFI_TAPE_REWIND) (\r
+  IN EFI_TAPE_IO_PROTOCOL *This\r
+  )\r
+;   \r
+\r
+\r
+/**\r
+  Positions the tape.\r
+\r
+  @param  This      A pointer to the EFI_TAPE_IO_PROTOCOL instance.\r
+  @param  Direction Direction and number of data blocks or filemarks to space over on media.\r
+  @param  Type      Type of mark to space over on media.\r
+\r
+  @retval EFI_SUCCESS       The media was successfully repositioned.\r
+  @retval EFI_END_OF_MEDIA  Beginning or end of media was reached before the\r
+                            indicated number of data blocks or filemarks were found.\r
+  @retval EFI_NO_MEDIA      No media is loaded in the device.\r
+  @retval EFI_NOT_READY     The reposition failed since the device was not ready (e.g. not\r
+                            online). The reposition may be retried at a later time.\r
+  @retval EFI_UNSUPPORTED   The device does not support this type of repositioning.\r
+  @retval EFI_TIMEOUT       The repositioning failed to complete within the timeout specified.\r
+  @retval EFI_MEDIA_CHANGED The media in the device was changed since the last access.\r
+                            Repositioning the media was aborted since the current\r
+                            position of the media may be incorrect.\r
+  @retval EFI_DEVICE_ERROR  A device error occurred while attempting to reposition the media.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_TAPE_SPACE) (\r
+  IN EFI_TAPE_IO_PROTOCOL *This,\r
+  INTN                    Direction,\r
+  UINTN                   Type\r
+  )\r
+;   \r
+\r
+\r
+/**\r
+  Writes filemarks to the media.\r
+\r
+  @param  This  A pointer to the EFI_TAPE_IO_PROTOCOL instance.\r
+  @param  Count Number of filemarks to write to the media.\r
+\r
+  @retval EFI_SUCCESS       Data was successfully transferred from the media.\r
+  @retval EFI_NO_MEDIA      No media is loaded in the device.\r
+  @retval EFI_NOT_READY     The transfer failed since the device was not ready (e.g. not\r
+                            online). The transfer may be retried at a later time.\r
+  @retval EFI_UNSUPPORTED   The device does not support this type of repositioning.\r
+  @retval EFI_TIMEOUT       The transfer failed to complete within the timeout specified.\r
+  @retval EFI_MEDIA_CHANGED The media in the device was changed since the last access.\r
+                            The transfer was aborted since the current position of the\r
+                            media may be incorrect.\r
+  @retval EFI_DEVICE_ERROR  A device error occurred while attempting to transfer data from the media.\r
+\r
+**/\r
+typedef \r
+EFI_STATUS\r
+(EFIAPI *EFI_TAPE_WRITEFM) (\r
+  IN EFI_TAPE_IO_PROTOCOL *This,\r
+  IN UINTN                Count\r
+  )\r
+;   \r
+\r
+\r
+/**\r
+  Resets the tape device.\r
+\r
+  @param  This                 A pointer to the EFI_TAPE_IO_PROTOCOL instance.\r
+  @param  ExtendedVerification Indicates whether the parent bus should also be reset.\r
+\r
+  @retval  EFI_SUCCESS      The bus and/or device were successfully reset.\r
+  @retval  EFI_NO_MEDIA     No media is loaded in the device.\r
+  @retval  EFI_NOT_READY    The reset failed since the device and/or bus was not ready.\r
+                            The reset may be retried at a later time.\r
+  @retval  EFI_UNSUPPORTED  The device does not support this type of reset.\r
+  @retval  EFI_TIMEOUT      The reset did not complete within the timeout allowed.\r
+  @retval  EFI_DEVICE_ERROR A device error occurred while attempting to reset the bus and/or device.\r
+\r
+**/\r
+typedef \r
+EFI_STATUS\r
+(EFIAPI *EFI_TAPE_RESET) (\r
+  IN EFI_TAPE_IO_PROTOCOL *This,\r
+  IN BOOLEAN              ExtendedVerification\r
+  )\r
+;    \r
+\r
+struct _EFI_TAPE_IO_PROTOCOL {\r
+  EFI_TAPE_READ           TapeRead;\r
+  EFI_TAPE_WRITE          TapeWrite;\r
+  EFI_TAPE_REWIND         TapeRewind;\r
+  EFI_TAPE_SPACE          TapeSpace;\r
+  EFI_TAPE_WRITEFM        TapeWriteFM;\r
+  EFI_TAPE_RESET          TapeReset;\r
+};\r
+\r
+extern EFI_GUID gEfiTapeIoProtocolGuid;\r
+\r
+#endif\r
diff --git a/Tools/Source/TianoTools/Include/Protocol/Tcp4.h b/Tools/Source/TianoTools/Include/Protocol/Tcp4.h
new file mode 100644 (file)
index 0000000..87dea25
--- /dev/null
@@ -0,0 +1,507 @@
+/** @file\r
+  EFI TCPv4 Protocol Definition\r
+  The EFI TCPv4 Service Binding Protocol is used to locate EFI TCPv4 Protocol drivers to create\r
+  and destroy child of the driver to communicate with other host using TCP protocol.      \r
+  The EFI TCPv4 Protocol provides services to send and receive data stream.     \r
+\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. This program and the accompanying materials                          \r
+  are licensed and made available under the terms and conditions of the BSD License         \r
+  which accompanies this distribution.  The full text of the license may be found at        \r
+  http://opensource.org/licenses/bsd-license.php                                            \r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+  Module Name:  Tcp4.h\r
+\r
+**/\r
+\r
+#ifndef __EFI_TCP4_PROTOCOL_H__\r
+#define __EFI_TCP4_PROTOCOL_H__\r
+\r
+#define EFI_TCP4_SERVICE_BINDING_PROTOCOL_GUID \\r
+  { \\r
+    0x00720665, 0x67EB, 0x4a99, {0xBA, 0xF7, 0xD3, 0xC3, 0x3A, 0x1C, 0x7C, 0xC9 } \\r
+  }\r
+\r
+#define EFI_TCP4_PROTOCOL_GUID \\r
+  { \\r
+    0x65530BC7, 0xA359, 0x410f, {0xB0, 0x10, 0x5A, 0xAD, 0xC7, 0xEC, 0x2B, 0x62 } \\r
+  }\r
+\r
+typedef struct _EFI_TCP4_PROTOCOL EFI_TCP4_PROTOCOL;\r
+\r
+typedef struct {\r
+  EFI_IPv4_ADDRESS        LocalAddress;\r
+  UINT16                  LocalPort;\r
+  EFI_IPv4_ADDRESS        RemoteAddress;\r
+  UINT16                  RemotePort;\r
+} EFI_TCP4_SERVICE_POINT;\r
+\r
+typedef struct {\r
+  EFI_HANDLE              DriverHandle;\r
+  UINTN                   ServiceCount;\r
+  EFI_TCP4_SERVICE_POINT  Services[1];\r
+} EFI_TCP4_VARIABLE_DATA;\r
+\r
+typedef struct {\r
+  BOOLEAN                 UseDefaultAddress;\r
+  EFI_IPv4_ADDRESS        StationAddress;\r
+  EFI_IPv4_ADDRESS        SubnetMask;\r
+  UINT16                  StationPort;\r
+  EFI_IPv4_ADDRESS        RemoteAddress;\r
+  UINT16                  RemotePort;\r
+  BOOLEAN                 ActiveFlag;\r
+} EFI_TCP4_ACCESS_POINT;\r
+\r
+typedef struct {\r
+  UINTN                   ReceiveBufferSize;\r
+  UINTN                   SendBufferSize;\r
+  UINTN                   MaxSynBackLog;\r
+  UINTN                   ConnectionTimeout;\r
+  UINTN                   DataRetries;\r
+  UINTN                   FinTimeout;\r
+  UINTN                   TimeWaitTimeout;\r
+  UINTN                   KeepAliveProbes;\r
+  UINTN                   KeepAliveTime;\r
+  UINTN                   KeepAliveInterval;\r
+  BOOLEAN                 EnableNagle;\r
+  BOOLEAN                 EnableTimeStamp;\r
+  BOOLEAN                 EnableWindowScaling;\r
+  BOOLEAN                 EnableSelectiveAck;\r
+  BOOLEAN                 EnablePathMtuDiscovery;\r
+} EFI_TCP4_OPTION;\r
+\r
+typedef struct {\r
+  //\r
+  // I/O parameters\r
+  //\r
+  UINT8                   TypeOfService;\r
+  UINT8                   TimeToLive;\r
+\r
+  //\r
+  // Access Point\r
+  //\r
+  EFI_TCP4_ACCESS_POINT   AccessPoint;\r
+                          \r
+  //                      \r
+  // TCP Control Options  \r
+  //                      \r
+  EFI_TCP4_OPTION         *ControlOption;\r
+} EFI_TCP4_CONFIG_DATA;\r
+\r
+typedef enum {\r
+  Tcp4StateClosed         = 0,\r
+  Tcp4StateListen         = 1,\r
+  Tcp4StateSynSent        = 2,\r
+  Tcp4StateSynReceived    = 3,\r
+  Tcp4StateEstablished    = 4,\r
+  Tcp4StateFinWait1       = 5,\r
+  Tcp4StateFinWait2       = 6,\r
+  Tcp4StateClosing        = 7,\r
+  Tcp4StateTimeWait       = 8,\r
+  Tcp4StateCloseWait      = 9,\r
+  Tcp4StateLastAck        = 10\r
+} EFI_TCP4_CONNECTION_STATE;\r
+\r
+typedef struct {\r
+  EFI_EVENT   Event;\r
+  EFI_STATUS  Status;\r
+} EFI_TCP4_COMPLETION_TOKEN;\r
+\r
+typedef struct {\r
+  EFI_TCP4_COMPLETION_TOKEN CompletionToken;\r
+} EFI_TCP4_CONNECTION_TOKEN;\r
+\r
+typedef struct {\r
+  EFI_TCP4_COMPLETION_TOKEN CompletionToken;\r
+  EFI_HANDLE                NewChildHandle;\r
+} EFI_TCP4_LISTEN_TOKEN;\r
+\r
+typedef struct {\r
+  UINTN FragmentLength;\r
+  VOID  *FragmentBuffer;\r
+} EFI_TCP4_FRAGMENT_DATA;\r
+\r
+typedef struct {\r
+  BOOLEAN                   UrgentFlag;\r
+  IN OUT UINTN              DataLength;\r
+  UINTN                     FragmentCount;\r
+  EFI_TCP4_FRAGMENT_DATA    FragmentTable[1];\r
+} EFI_TCP4_RECEIVE_DATA;    \r
+\r
+typedef struct {            \r
+  BOOLEAN                   Push;\r
+  BOOLEAN                   Urgent;\r
+  UINTN                     DataLength;\r
+  UINTN                     FragmentCount;\r
+  EFI_TCP4_FRAGMENT_DATA    FragmentTable[1];\r
+} EFI_TCP4_TRANSMIT_DATA;\r
+\r
+typedef struct {\r
+  EFI_TCP4_COMPLETION_TOKEN CompletionToken;\r
+  union {\r
+    EFI_TCP4_RECEIVE_DATA   *RxData;\r
+    EFI_TCP4_TRANSMIT_DATA  *TxData;\r
+  } Packet;\r
+} EFI_TCP4_IO_TOKEN;\r
+\r
+typedef struct {\r
+  EFI_TCP4_COMPLETION_TOKEN CompletionToken;\r
+  BOOLEAN                   AbortOnClose;\r
+} EFI_TCP4_CLOSE_TOKEN;\r
+\r
+//\r
+// Interface definition for TCP4 protocol\r
+//\r
+\r
+/**\r
+  Get the current operational status.\r
+\r
+  @param  This           Pointer to the EFI_TCP4_PROTOCOL instance.\r
+  @param  Tcp4State      Pointer to the buffer to receive the current TCP state.\r
+  @param  Tcp4ConfigData Pointer to the buffer to receive the current TCP configuration.\r
+  @param  Ip4ModeData    Pointer to the buffer to receive the current IPv4 configuration\r
+                         data used by the TCPv4 instance.\r
+  @param  MnpConfigData  Pointer to the buffer to receive the current MNP configuration\r
+                         data used indirectly by the TCPv4 instance.\r
+  @param  SnpModeData    Pointer to the buffer to receive the current SNP configuration\r
+                         data used indirectly by the TCPv4 instance.\r
+\r
+  @retval EFI_SUCCESS           The mode data was read.\r
+  @retval EFI_INVALID_PARAMETER This is NULL.\r
+  @retval EFI_NOT_STARTED       No configuration data is available because this instance hasn¡¯t\r
+                                 been started.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_TCP4_GET_MODE_DATA) (\r
+  IN  EFI_TCP4_PROTOCOL                  *This,\r
+  OUT EFI_TCP4_CONNECTION_STATE          *Tcp4State      OPTIONAL,\r
+  OUT EFI_TCP4_CONFIG_DATA               *Tcp4ConfigData OPTIONAL,\r
+  OUT EFI_IP4_MODE_DATA                  *Ip4ModeData    OPTIONAL,\r
+  OUT EFI_MANAGED_NETWORK_CONFIG_DATA    *MnpConfigData  OPTIONAL,\r
+  OUT EFI_SIMPLE_NETWORK_MODE            *SnpModeData    OPTIONAL\r
+  )\r
+;\r
+  \r
+/**\r
+  Initialize or brutally reset the operational parameters for this EFI TCPv4 instance.\r
+\r
+  @param  This           Pointer to the EFI_TCP4_PROTOCOL instance.\r
+  @param  Tcp4ConfigData Pointer to the configure data to configure the instance.\r
+\r
+  @retval EFI_SUCCESS           The operational settings are set, changed, or reset\r
+                                successfully.\r
+  @retval EFI_INVALID_PARAMETER Some parameter is invalid.\r
+  @retval EFI_NO_MAPPING        When using a default address, configuration (through\r
+                                DHCP, BOOTP, RARP, etc.) is not finished yet.\r
+  @retval EFI_ACCESS_DENIED     Configuring TCP instance when it is configured without\r
+                                calling Configure() with NULL to reset it.\r
+  @retval EFI_DEVICE_ERROR      An unexpected network or system error occurred.\r
+  @retval EFI_UNSUPPORTED       One or more of the control options are not supported in\r
+                                the implementation.\r
+  @retval EFI_OUT_OF_RESOURCES  Could not allocate enough system resources when\r
+                                executing Configure().\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_TCP4_CONFIGURE) (\r
+  IN EFI_TCP4_PROTOCOL                   *This,\r
+  IN EFI_TCP4_CONFIG_DATA                *TcpConfigData OPTIONAL\r
+  )\r
+;\r
+    \r
+\r
+/**\r
+  Add or delete a route entry to the route table\r
+\r
+  @param  This           Pointer to the EFI_TCP4_PROTOCOL instance.\r
+  @param  DeleteRoute    Set it to TRUE to delete this route from the routing table. Set it to\r
+                         FALSE to add this route to the routing table.\r
+                         DestinationAddress and SubnetMask are used as the\r
+                         keywords to search route entry.\r
+  @param  SubnetAddress  The destination network.\r
+  @param  SubnetMask     The subnet mask of the destination network.\r
+  @param  GatewayAddress The gateway address for this route. It must be on the same\r
+                         subnet with the station address unless a direct route is specified.\r
+\r
+  @retval EFI_SUCCESS           The operation completed successfully.\r
+  @retval EFI_NOT_STARTED       The EFI TCPv4 Protocol instance has not been configured.\r
+  @retval EFI_NO_MAPPING        When using a default address, configuration (DHCP, BOOTP,\r
+                                RARP, etc.) is not finished yet.\r
+  @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:\r
+                                - This is NULL.\r
+                                - SubnetAddress is NULL.\r
+                                - SubnetMask is NULL.\r
+                                - GatewayAddress is NULL.\r
+                                - *SubnetAddress is not NULL a valid subnet address.\r
+                                - *SubnetMask is not a valid subnet mask.\r
+                                - *GatewayAddress is not a valid unicast IP address or it\r
+                                is not in the same subnet.\r
+  @retval EFI_OUT_OF_RESOURCES  Could not allocate enough resources to add the entry to the\r
+                                routing table.\r
+  @retval EFI_NOT_FOUND         This route is not in the routing table.\r
+  @retval EFI_ACCESS_DENIED     The route is already defined in the routing table.\r
+  @retval EFI_UNSUPPORTED       The TCP driver does not support this operation.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_TCP4_ROUTES) (\r
+  IN EFI_TCP4_PROTOCOL                   *This,\r
+  IN BOOLEAN                             DeleteRoute,\r
+  IN EFI_IPv4_ADDRESS                    *SubnetAddress,\r
+  IN EFI_IPv4_ADDRESS                    *SubnetMask,\r
+  IN EFI_IPv4_ADDRESS                    *GatewayAddress\r
+  )\r
+;  \r
+\r
+/**\r
+  Initiate a nonblocking TCP connection request for an active TCP instance.\r
+\r
+  @param  This                  Pointer to the EFI_TCP4_PROTOCOL instance.\r
+  @param  ConnectionToken       Pointer to the connection token to return when the TCP three\r
+                                way handshake finishes.\r
+                                 \r
+  @retval EFI_SUCCESS           The connection request is successfully initiated and the state\r
+                                - of this TCPv4 instance has been changed to\r
+                                - Tcp4StateSynSent.\r
+  @retval EFI_NOT_STARTED       This EFI TCPv4 Protocol instance has not been configured.\r
+  @retval EFI_ACCESS_DENIED     One or more of the following conditions are TRUE:\r
+                                - This instance is not configured as an active one.\r
+                                - This instance is not in Tcp4StateClosed state.\r
+  @retval EFI_INVALID_PARAMETER One or more of the following are TRUE:\r
+                                - This is NULL.\r
+                                - ConnectionToken is NULL.\r
+                                - ConnectionToken->CompletionToken.Event is NULL.\r
+  @retval EFI_OUT_OF_RESOURCES  The driver can¡¯t allocate enough resource to initiate the activeopen.\r
+  @retval EFI_DEVICE_ERROR      An unexpected system or network error occurred.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_TCP4_CONNECT) (\r
+  IN EFI_TCP4_PROTOCOL                   *This,\r
+  IN EFI_TCP4_CONNECTION_TOKEN           *ConnectionToken\r
+  )\r
+;  \r
+  \r
+\r
+/**\r
+  Listen on the passive instance to accept an incoming connection request. This is a nonblocking operation.\r
+\r
+  @param  This        Pointer to the EFI_TCP4_PROTOCOL instance.\r
+  @param  ListenToken Pointer to the listen token to return when operation finishes.\r
+\r
+  @retval EFI_SUCCESS           The listen token has been queued successfully.\r
+  @retval EFI_NOT_STARTED       This EFI TCPv4 Protocol instance has not been configured.\r
+  @retval EFI_ACCESS_DENIED     One or more of the following are TRUE:\r
+                                - This instance is not a passive instance.\r
+                                - This instance is not in Tcp4StateListen state.\r
+                                - The same listen token has already existed in the listen\r
+                                token queue of this TCP instance.\r
+  @retval EFI_INVALID_PARAMETER One or more of the following are TRUE:\r
+                                - This is NULL.\r
+                                - ListenToken is NULL.\r
+                                - ListentToken->CompletionToken.Event is NULL.\r
+  @retval EFI_OUT_OF_RESOURCES  Could not allocate enough resource to finish the operation.\r
+  @retval EFI_DEVICE_ERROR      Any unexpected and not belonged to above category error.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_TCP4_ACCEPT) (\r
+  IN EFI_TCP4_PROTOCOL                   *This,\r
+  IN EFI_TCP4_LISTEN_TOKEN               *ListenToken\r
+  )\r
+;    \r
+\r
+/**\r
+  Queues outgoing data into the transmit queue.\r
+\r
+  @param  This  Pointer to the EFI_TCP4_PROTOCOL instance.\r
+  @param  Token Pointer to the completion token to queue to the transmit queue.\r
+\r
+  @retval EFI_SUCCESS             The data has been queued for transmission.\r
+  @retval EFI_NOT_STARTED         This EFI TCPv4 Protocol instance has not been configured.\r
+  @retval EFI_NO_MAPPING          When using a default address, configuration (DHCP, BOOTP,\r
+                                  RARP, etc.) is not finished yet.\r
+  @retval EFI_INVALID_PARAMETER   One or more of the following are TRUE:\r
+                                  - This is NULL.\r
+                                  - Token is NULL.\r
+                                  - Token->CompletionToken.Event is NULL.\r
+                                  - Token->Packet.TxData is NULL L.\r
+                                  - Token->Packet.FragmentCount is zero.\r
+                                  - Token->Packet.DataLength is not equal to the sum of fragment lengths.\r
+  @retval EFI_ACCESS_DENIED       One or more of the following conditions is TRUE:\r
+                                  - A transmit completion token with the same Token->CompletionToken.Event\r
+                                  was already in the transmission queue.\r
+                                  - The current instance is in Tcp4StateClosed state.\r
+                                  - The current instance is a passive one and it is in\r
+                                  Tcp4StateListen state.\r
+                                  - User has called Close() to disconnect this connection.\r
+  @retval EFI_NOT_READY           The completion token could not be queued because the\r
+                                  transmit queue is full.\r
+  @retval EFI_OUT_OF_RESOURCES    Could not queue the transmit data because of resource\r
+                                  shortage.\r
+  @retval EFI_NETWORK_UNREACHABLE There is no route to the destination network or address.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_TCP4_TRANSMIT) (\r
+  IN EFI_TCP4_PROTOCOL                   *This,\r
+  IN EFI_TCP4_IO_TOKEN                   *Token\r
+  )\r
+;      \r
+\r
+\r
+/**\r
+  Places an asynchronous receive request into the receiving queue.\r
+\r
+  @param  This  Pointer to the EFI_TCP4_PROTOCOL instance.\r
+  @param  Token Pointer to a token that is associated with the receive data\r
+                descriptor.\r
+\r
+  @retval EFI_SUCCESS           The receive completion token was cached.\r
+  @retval EFI_NOT_STARTED       This EFI TCPv4 Protocol instance has not been configured.\r
+  @retval EFI_NO_MAPPING        When using a default address, configuration (DHCP, BOOTP, RARP,\r
+                                etc.) is not finished yet.\r
+  @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:\r
+                                - This is NULL.\r
+                                - Token is NULL.\r
+                                - Token->CompletionToken.Event is NULL.\r
+                                - Token->Packet.RxData is NULL.\r
+                                - Token->Packet.RxData->DataLength is 0.\r
+                                - The Token->Packet.RxData->DataLength is not\r
+                                the sum of all FragmentBuffer length in FragmentTable.\r
+  @retval EFI_OUT_OF_RESOURCES The receive completion token could not be queued due to a lack of\r
+                               system resources (usually memory).\r
+  @retval EFI_DEVICE_ERROR     An unexpected system or network error occurred.\r
+  @retval EFI_ACCESS_DENIED    One or more of the following conditions is TRUE:\r
+                               - A receive completion token with the same Token-\r
+                               >CompletionToken.Event was already in the receive\r
+                               queue.\r
+                               - The current instance is in Tcp4StateClosed state.\r
+                               - The current instance is a passive one and it is in\r
+                               Tcp4StateListen state.\r
+                               - User has called Close() to disconnect this connection.\r
+  @retval EFI_CONNECTION_FIN   The communication peer has closed the connection and there is\r
+                               no any buffered data in the receive buffer of this instance.\r
+  @retval EFI_NOT_READY        The receive request could not be queued because the receive queue is full.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_TCP4_RECEIVE) (\r
+  IN EFI_TCP4_PROTOCOL                   *This,\r
+  IN EFI_TCP4_IO_TOKEN                   *Token\r
+  )\r
+;       \r
+   \r
+/**\r
+  Disconnecting a TCP connection gracefully or reset a TCP connection. This function is a\r
+  nonblocking operation.                                                                                                                                                                        \r
+\r
+  @param  This       Pointer to the EFI_TCP4_PROTOCOL instance.\r
+  @param  CloseToken Pointer to the close token to return when operation finishes.\r
+\r
+  @retval EFI_SUCCESS           The Close() is called successfully.\r
+  @retval EFI_NOT_STARTED       This EFI TCPv4 Protocol instance has not been configured.\r
+  @retval EFI_ACCESS_DENIED     One or more of the following are TRUE:\r
+                                - Configure() has been called with\r
+                                TcpConfigData set to NULL and this function has\r
+                                not returned.\r
+                                - Previous Close() call on this instance has not\r
+                                finished.\r
+  @retval EFI_INVALID_PARAMETER One or more of the following are TRUE:\r
+                                - This is NULL.\r
+                                - CloseToken is NULL.\r
+                                - CloseToken->CompletionToken.Event is NULL.\r
+  @retval EFI_OUT_OF_RESOURCES  Could not allocate enough resource to finish the operation.\r
+  @retval EFI_DEVICE_ERROR      Any unexpected and not belonged to above category error.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_TCP4_CLOSE) (\r
+  IN EFI_TCP4_PROTOCOL                   *This,\r
+  IN EFI_TCP4_CLOSE_TOKEN                *CloseToken\r
+  )\r
+;      \r
+\r
+/**\r
+  Abort an asynchronous connection, listen, transmission or receive request.\r
+\r
+  @param  This  Pointer to the EFI_TCP4_PROTOCOL instance.\r
+  @param  Token Pointer to a token that has been issued by\r
+                EFI_TCP4_PROTOCOL.Connect(),\r
+                EFI_TCP4_PROTOCOL.Accept(),\r
+                EFI_TCP4_PROTOCOL.Transmit() or\r
+                EFI_TCP4_PROTOCOL.Receive(). If NULL, all pending\r
+                tokens issued by above four functions will be aborted. Type\r
+                EFI_TCP4_COMPLETION_TOKEN is defined in\r
+                EFI_TCP4_PROTOCOL.Connect().\r
+\r
+  @retval  EFI_SUCCESS           Incoming or outgoing data was processed.\r
+  @retval  EFI_INVALID_PARAMETER This is NULL.\r
+  @retval  EFI_DEVICE_ERROR      An unexpected system or network error occurred.\r
+  @retval  EFI_NOT_READY         No incoming or outgoing data is processed.\r
+  @retval  EFI_TIMEOUT           Data was dropped out of the transmission or receive queue.\r
+                                 Consider increasing the polling rate.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_TCP4_CANCEL) (\r
+  IN EFI_TCP4_PROTOCOL                   *This,\r
+  IN EFI_TCP4_COMPLETION_TOKEN           *Token OPTIONAL\r
+  )\r
+;      \r
+\r
+\r
+/**\r
+  Poll to receive incoming data and transmit outgoing segments.\r
+\r
+  @param  This Pointer to the EFI_TCP4_PROTOCOL instance.\r
+\r
+  @retval  EFI_SUCCESS           Incoming or outgoing data was processed.\r
+  @retval  EFI_INVALID_PARAMETER This is NULL.\r
+  @retval  EFI_DEVICE_ERROR      An unexpected system or network error occurred.\r
+  @retval  EFI_NOT_READY         No incoming or outgoing data is processed.\r
+  @retval  EFI_TIMEOUT           Data was dropped out of the transmission or receive queue.\r
+                                 Consider increasing the polling rate.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_TCP4_POLL) (\r
+  IN EFI_TCP4_PROTOCOL                   *This\r
+  )\r
+;      \r
+\r
+struct _EFI_TCP4_PROTOCOL {\r
+  EFI_TCP4_GET_MODE_DATA                 GetModeData;\r
+  EFI_TCP4_CONFIGURE                     Configure;\r
+  EFI_TCP4_ROUTES                        Routes;\r
+  EFI_TCP4_CONNECT                       Connect;\r
+  EFI_TCP4_ACCEPT                        Accept;\r
+  EFI_TCP4_TRANSMIT                      Transmit;\r
+  EFI_TCP4_RECEIVE                       Receive;\r
+  EFI_TCP4_CLOSE                         Close;\r
+  EFI_TCP4_CANCEL                        Cancel;\r
+  EFI_TCP4_POLL                          Poll;\r
+};\r
+\r
+#define EFI_CONNECTION_FIN               EFIERR (104)\r
+#define EFI_CONNECTION_RESET             EFIERR (105)\r
+#define EFI_CONNECTION_REFUSED           EFIERR (106)\r
+\r
+extern EFI_GUID gEfiTcp4ServiceBindingProtocolGuid;\r
+extern EFI_GUID gEfiTcp4ProtocolGuid;\r
+\r
+#endif\r
diff --git a/Tools/Source/TianoTools/Include/Protocol/Udp4.h b/Tools/Source/TianoTools/Include/Protocol/Udp4.h
new file mode 100644 (file)
index 0000000..7ac3c80
--- /dev/null
@@ -0,0 +1,363 @@
+/** @file\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. This program and the accompanying materials                          \r
+  are licensed and made available under the terms and conditions of the BSD License         \r
+  which accompanies this distribution.  The full text of the license may be found at        \r
+  http://opensource.org/licenses/bsd-license.php                                            \r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+  Module Name:  Udp4.h\r
+\r
+**/\r
+\r
+#ifndef __EFI_UDP4_PROTOCOL_H__\r
+#define __EFI_UDP4_PROTOCOL_H__\r
+\r
+//\r
+//GUID definitions\r
+//\r
+#define EFI_UDP4_SERVICE_BINDING_PROTOCOL_GUID \\r
+  { \\r
+    0x83f01464, 0x99bd, 0x45e5, {0xb3, 0x83, 0xaf, 0x63, 0x05, 0xd8, 0xe9, 0xe6 } \\r
+  }\r
+\r
+#define EFI_UDP4_PROTOCOL_GUID \\r
+  { \\r
+    0x3ad9df29, 0x4501, 0x478d, {0xb1, 0xf8, 0x7f, 0x7f, 0xe7, 0x0e, 0x50, 0xf3 } \\r
+  }\r
+\r
+typedef struct _EFI_UDP4_PROTOCOL EFI_UDP4_PROTOCOL; \r
+  \r
+typedef struct {\r
+  EFI_HANDLE              InstanceHandle;\r
+  EFI_IPv4_ADDRESS        LocalAddress;\r
+  UINT16                  LocalPort;\r
+  EFI_IPv4_ADDRESS        RemoteAddress;\r
+  UINT16                  RemotePort;\r
+} EFI_UDP4_SERVICE_POINT; \r
+\r
+typedef struct {\r
+  EFI_HANDLE              DriverHandle;\r
+  UINT32                  ServiceCount;\r
+  EFI_UDP4_SERVICE_POINT  Services[1];\r
+} EFI_UDP4_VARIABLE_DATA;\r
+\r
+//\r
+//ICMP error definitions\r
+//\r
+#define EFI_NETWORK_UNREACHABLE      EFIERR(100)\r
+#define EFI_HOST_UNREACHABLE         EFIERR(101) \r
+#define EFI_PROTOCOL_UNREACHABLE     EFIERR(102)\r
+#define EFI_PORT_UNREACHABLE         EFIERR(103)\r
+\r
+\r
+typedef struct {\r
+  UINT32             FragmentLength;\r
+  VOID               *FragmentBuffer;\r
+} EFI_UDP4_FRAGMENT_DATA;\r
+\r
+typedef struct {\r
+  EFI_IPv4_ADDRESS   SourceAddress;\r
+  UINT16             SourcePort;\r
+  EFI_IPv4_ADDRESS   DestinationAddress;\r
+  UINT16             DestinationPort;\r
+} EFI_UDP4_SESSION_DATA;\r
+typedef struct {\r
+  //\r
+  // Receiving Filters\r
+  //\r
+  BOOLEAN            AcceptBroadcast;\r
+  BOOLEAN            AcceptPromiscuous;\r
+  BOOLEAN            AcceptAnyPort;\r
+  BOOLEAN            AllowDuplicatePort;\r
+  //\r
+  // I/O parameters\r
+  //\r
+  UINT8              TypeOfService;\r
+  UINT8              TimeToLive;\r
+  BOOLEAN            DoNotFragment;\r
+  UINT32             ReceiveTimeout;\r
+  UINT32             TransmitTimeout;\r
+  //\r
+  // Access Point\r
+  //\r
+  BOOLEAN            UseDefaultAddress;\r
+  EFI_IPv4_ADDRESS   StationAddress;\r
+  EFI_IPv4_ADDRESS   SubnetMask;\r
+  UINT16             StationPort;\r
+  EFI_IPv4_ADDRESS   RemoteAddress;\r
+  UINT16             RemotePort;\r
+} EFI_UDP4_CONFIG_DATA;\r
+\r
+typedef struct {\r
+  EFI_UDP4_SESSION_DATA     *UdpSessionData;       //OPTIONAL\r
+  EFI_IPv4_ADDRESS          *GatewayAddress;       //OPTIONAL\r
+  UINT32                    DataLength;\r
+  UINT32                    FragmentCount; \r
+  EFI_UDP4_FRAGMENT_DATA    FragmentTable[1];\r
+} EFI_UDP4_TRANSMIT_DATA;\r
+\r
+typedef struct {\r
+  EFI_TIME                  TimeStamp;\r
+  EFI_EVENT                 RecycleSignal;\r
+  EFI_UDP4_SESSION_DATA     UdpSession;\r
+  UINT32                    DataLength;\r
+  UINT32                    FragmentCount;\r
+  EFI_UDP4_FRAGMENT_DATA    FragmentTable[1];\r
+} EFI_UDP4_RECEIVE_DATA;\r
+\r
+\r
+typedef struct {\r
+  EFI_EVENT                 Event;\r
+  EFI_STATUS                Status;\r
+  union {\r
+    EFI_UDP4_RECEIVE_DATA   *RxData;\r
+    EFI_UDP4_TRANSMIT_DATA  *TxData;\r
+  } Packet;\r
+} EFI_UDP4_COMPLETION_TOKEN;\r
+\r
+/**\r
+  Reads the current operational settings.\r
+\r
+  @param  This           Pointer to the EFI_UDP4_PROTOCOL instance.\r
+  @param  Udp4ConfigData Pointer to the buffer to receive the current configuration data.\r
+  @param  Ip4ModeData    Pointer to the EFI IPv4 Protocol mode data structure.\r
+  @param  MnpConfigData  Pointer to the managed network configuration data structure.\r
+  @param  SnpModeData    Pointer to the simple network mode data structure.\r
+\r
+  @retval EFI_SUCCESS           The mode data was read.\r
+  @retval EFI_NOT_STARTED       When Udp4ConfigData is queried, no configuration data is\r
+                                available because this instance has not been started.\r
+  @retval EFI_INVALID_PARAMETER This is NULL.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_UDP4_GET_MODE_DATA) (\r
+  IN  EFI_UDP4_PROTOCOL                *This,\r
+  OUT EFI_UDP4_CONFIG_DATA             *Udp4ConfigData OPTIONAL,\r
+  OUT EFI_IP4_MODE_DATA                *Ip4ModeData    OPTIONAL,\r
+  OUT EFI_MANAGED_NETWORK_CONFIG_DATA  *MnpConfigData  OPTIONAL,\r
+  OUT EFI_SIMPLE_NETWORK_MODE          *SnpModeData    OPTIONAL\r
+  )\r
+;  \r
+  \r
+\r
+/**\r
+  Initializes, changes, or resets the operational parameters for this instance of the EFI UDPv4\r
+  Protocol.\r
+\r
+  @param  This           Pointer to the EFI_UDP4_PROTOCOL instance.\r
+  @param  Udp4ConfigData Pointer to the buffer to receive the current configuration data.\r
+\r
+  @retval EFI_SUCCESS           The configuration settings were set, changed, or reset successfully.\r
+  @retval EFI_NO_MAPPING        When using a default address, configuration (DHCP, BOOTP,\r
+                                RARP, etc.) is not finished yet.\r
+  @retval EFI_INVALID_PARAMETER One or more following conditions are TRUE:\r
+  @retval EFI_ALREADY_STARTED   The EFI UDPv4 Protocol instance is already started/configured\r
+                                and must be stopped/reset before it can be reconfigured.\r
+  @retval EFI_ACCESS_DENIED     UdpConfigData. AllowDuplicatePort is FALSE\r
+                                and UdpConfigData.StationPort is already used by\r
+                                other instance.\r
+  @retval EFI_OUT_OF_RESOURCES  The EFI UDPv4 Protocol driver cannot allocate memory for this\r
+                                EFI UDPv4 Protocol instance.\r
+  @retval EFI_DEVICE_ERROR      An unexpected network or system error occurred and this instance\r
+                                 was not opened. \r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_UDP4_CONFIGURE) (\r
+  IN EFI_UDP4_PROTOCOL      *This,\r
+  IN EFI_UDP4_CONFIG_DATA   *UdpConfigData OPTIONAL\r
+  )\r
+;  \r
+\r
+/**\r
+  Joins and leaves multicast groups.\r
+\r
+  @param  This             Pointer to the EFI_UDP4_PROTOCOL instance.\r
+  @param  JoinFlag         Set to TRUE to join a multicast group. Set to FALSE to leave one\r
+                           or all multicast groups.\r
+  @param  MulticastAddress Pointer to multicast group address to join or leave.\r
+\r
+  @retval EFI_SUCCESS           The operation completed successfully.\r
+  @retval EFI_NOT_STARTED       The EFI UDPv4 Protocol instance has not been started.\r
+  @retval EFI_NO_MAPPING        When using a default address, configuration (DHCP, BOOTP,\r
+                                RARP, etc.) is not finished yet.\r
+  @retval EFI_OUT_OF_RESOURCES  Could not allocate resources to join the group.\r
+  @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:\r
+                                - This is NULL.\r
+                                - JoinFlag is TRUE and MulticastAddress is NULL.\r
+                                - JoinFlag is TRUE and *MulticastAddress is not\r
+                                  a valid multicast address.\r
+  @retval EFI_ALREADY_STARTED   The group address is already in the group table (when\r
+                                JoinFlag is TRUE).\r
+  @retval EFI_NOT_FOUND         The group address is not in the group table (when JoinFlag is\r
+                                FALSE).\r
+  @retval EFI_DEVICE_ERROR      An unexpected system or network error occurred.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_UDP4_GROUPS) (\r
+  IN EFI_UDP4_PROTOCOL      *This,\r
+  IN BOOLEAN                JoinFlag,\r
+  IN EFI_IPv4_ADDRESS       *MulticastAddress    OPTIONAL\r
+  )\r
+;   \r
+\r
+/**\r
+  Adds and deletes routing table entries.\r
+\r
+  @param  This           Pointer to the EFI_UDP4_PROTOCOL instance.\r
+  @param  DeleteRoute    Set to TRUE to delete this route from the routing table.\r
+                         Set to FALSE to add this route to the routing table.\r
+  @param  SubnetAddress  The destination network address that needs to be routed.\r
+  @param  SubnetMask     The subnet mask of SubnetAddress.\r
+  @param  GatewayAddress The gateway IP address for this route.\r
+\r
+  @retval EFI_SUCCESS           The operation completed successfully.\r
+  @retval EFI_NOT_STARTED       The EFI UDPv4 Protocol instance has not been started.\r
+  @retval EFI_NO_MAPPING        When using a default address, configuration (DHCP, BOOTP,\r
+                                - RARP, etc.) is not finished yet.\r
+  @retval EFI_INVALID_PARAMETER One or more parameters are invalid.\r
+  @retval EFI_OUT_OF_RESOURCES  Could not add the entry to the routing table.\r
+  @retval EFI_NOT_FOUND         This route is not in the routing table.\r
+  @retval EFI_ACCESS_DENIED     The route is already defined in the routing table.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_UDP4_ROUTES) (\r
+  IN EFI_UDP4_PROTOCOL      *This,\r
+  IN BOOLEAN                DeleteRoute,\r
+  IN EFI_IPv4_ADDRESS       *SubnetAddress,\r
+  IN EFI_IPv4_ADDRESS       *SubnetMask,\r
+  IN EFI_IPv4_ADDRESS       *GatewayAddress\r
+  )\r
+;     \r
+\r
+/**\r
+  Polls for incoming data packets and processes outgoing data packets.\r
+\r
+  @param  This Pointer to the EFI_UDP4_PROTOCOL instance.\r
+\r
+  @retval EFI_SUCCESS           Incoming or outgoing data was processed.\r
+  @retval EFI_INVALID_PARAMETER This is NULL.\r
+  @retval EFI_DEVICE_ERROR      An unexpected system or network error occurred.\r
+  @retval EFI_TIMEOUT           Data was dropped out of the transmit and/or receive queue.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_UDP4_POLL) (\r
+  IN EFI_UDP4_PROTOCOL      *This\r
+  )\r
+;   \r
+\r
+/**\r
+  Places an asynchronous receive request into the receiving queue.\r
+\r
+  @param  This  Pointer to the EFI_UDP4_PROTOCOL instance.\r
+  @param  Token Pointer to a token that is associated with the receive data\r
+                descriptor.\r
+\r
+  @retval EFI_SUCCESS           The receive completion token was cached.\r
+  @retval EFI_NOT_STARTED       This EFI UDPv4 Protocol instance has not been started.\r
+  @retval EFI_NO_MAPPING        When using a default address, configuration (DHCP, BOOTP, RARP, etc.)\r
+                                is not finished yet.\r
+  @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:\r
+  @retval EFI_OUT_OF_RESOURCES  The receive completion token could not be queued due to a lack of system\r
+                                resources (usually memory).\r
+  @retval EFI_DEVICE_ERROR      An unexpected system or network error occurred.\r
+  @retval EFI_ACCESS_DENIED     A receive completion token with the same Token.Event was already in\r
+                                the receive queue.\r
+  @retval EFI_NOT_READY         The receive request could not be queued because the receive queue is full.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_UDP4_RECEIVE) (\r
+  IN EFI_UDP4_PROTOCOL          *This,\r
+  IN EFI_UDP4_COMPLETION_TOKEN  *Token\r
+  )\r
+;   \r
+\r
+/**\r
+  Queues outgoing data packets into the transmit queue.\r
+\r
+  @param  This  Pointer to the EFI_UDP4_PROTOCOL instance.\r
+  @param  Token Pointer to the completion token that will be placed into the\r
+                transmit queue.\r
+\r
+  @retval EFI_SUCCESS           The data has been queued for transmission.\r
+  @retval EFI_NOT_STARTED       This EFI UDPv4 Protocol instance has not been started.\r
+  @retval EFI_NO_MAPPING        When using a default address, configuration (DHCP, BOOTP,\r
+                                RARP, etc.) is not finished yet.\r
+  @retval EFI_INVALID_PARAMETER One or more parameters are invalid.\r
+  @retval EFI_ACCESS_DENIED     The transmit completion token with the same\r
+                                Token.Event was already in the transmit queue.\r
+  @retval EFI_NOT_READY         The completion token could not be queued because the\r
+                                transmit queue is full.\r
+  @retval EFI_OUT_OF_RESOURCES  Could not queue the transmit data.\r
+  @retval EFI_NOT_FOUND         There is no route to the destination network or address.\r
+  @retval EFI_BAD_BUFFER_SIZE   The data length is greater than the maximum UDP packet\r
+                                size. Or the length of the IP header + UDP header + data\r
+                                length is greater than MTU if DoNotFragment is TRUE.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_UDP4_TRANSMIT) (\r
+  IN EFI_UDP4_PROTOCOL           *This,\r
+  IN EFI_UDP4_COMPLETION_TOKEN   *Token\r
+  )\r
+;     \r
+\r
+/**\r
+  Aborts an asynchronous transmit or receive request.\r
+\r
+  @param  This  Pointer to the EFI_UDP4_PROTOCOL instance.\r
+  @param  Token Pointer to a token that has been issued by\r
+                EFI_UDP4_PROTOCOL.Transmit() or\r
+                EFI_UDP4_PROTOCOL.Receive().If NULL, all pending\r
+                tokens are aborted.\r
+\r
+  @retval  EFI_SUCCESS           The asynchronous I/O request was aborted and Token.Event\r
+                                 was signaled. When Token is NULL, all pending requests are\r
+                                 aborted and their events are signaled.\r
+  @retval  EFI_INVALID_PARAMETER This is NULL.\r
+  @retval  EFI_NOT_STARTED       This instance has not been started.\r
+  @retval  EFI_NO_MAPPING        When using the default address, configuration (DHCP, BOOTP,\r
+                                 RARP, etc.) is not finished yet.\r
+  @retval  EFI_NOT_FOUND         When Token is not NULL, the asynchronous I/O request was\r
+                                 not found in the transmit or receive queue. It has either completed\r
+                                 or was not issued by Transmit() and Receive().\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_UDP4_CANCEL)(\r
+  IN EFI_UDP4_PROTOCOL          *This,\r
+  IN EFI_UDP4_COMPLETION_TOKEN  *Token  OPTIONAL\r
+  )\r
+;       \r
+\r
+struct _EFI_UDP4_PROTOCOL {\r
+  EFI_UDP4_GET_MODE_DATA        GetModeData;\r
+  EFI_UDP4_CONFIGURE            Configure;\r
+  EFI_UDP4_GROUPS               Groups;\r
+  EFI_UDP4_ROUTES               Routes;\r
+  EFI_UDP4_TRANSMIT             Transmit;\r
+  EFI_UDP4_RECEIVE              Receive;\r
+  EFI_UDP4_CANCEL               Cancel;\r
+  EFI_UDP4_POLL                 Poll;\r
+};\r
+\r
+extern EFI_GUID gEfiUdp4ServiceBindingProtocolGuid;\r
+extern EFI_GUID gEfiUdp4ProtocolGuid;\r
+\r
+#endif\r
diff --git a/Tools/Source/TianoTools/Include/Protocol/UgaDraw.h b/Tools/Source/TianoTools/Include/Protocol/UgaDraw.h
new file mode 100644 (file)
index 0000000..5586bdf
--- /dev/null
@@ -0,0 +1,168 @@
+/** @file\r
+  UGA Draw protocol from the EFI 1.1 specification.\r
+\r
+  Abstraction of a very simple graphics device.\r
+\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. This program and the accompanying materials                          \r
+  are licensed and made available under the terms and conditions of the BSD License         \r
+  which accompanies this distribution.  The full text of the license may be found at        \r
+  http://opensource.org/licenses/bsd-license.php                                            \r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+  Module Name:  UgaDraw.h\r
+\r
+**/\r
+\r
+#ifndef __UGA_DRAW_H__\r
+#define __UGA_DRAW_H__\r
+\r
+#define EFI_UGA_DRAW_PROTOCOL_GUID \\r
+  { \\r
+    0x982c298b, 0xf4fa, 0x41cb, {0xb8, 0x38, 0x77, 0xaa, 0x68, 0x8f, 0xb8, 0x39 } \\r
+  }\r
+\r
+typedef struct _EFI_UGA_DRAW_PROTOCOL EFI_UGA_DRAW_PROTOCOL;\r
+\r
+/**\r
+  Return the current video mode information.\r
+\r
+  @param  This                  Protocol instance pointer.\r
+  @param  HorizontalResolution  Current video horizontal resolution in pixels\r
+  @param  VerticalResolution    Current video vertical resolution in pixels\r
+  @param  ColorDepth            Current video color depth in bits per pixel\r
+  @param  RefreshRate           Current video refresh rate in Hz.\r
+\r
+  @retval EFI_SUCCESS           Mode information returned.\r
+  @retval EFI_NOT_STARTED       Video display is not initialized. Call SetMode ()\r
+  @retval EFI_INVALID_PARAMETER One of the input args was NULL.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_UGA_DRAW_PROTOCOL_GET_MODE) (\r
+  IN  EFI_UGA_DRAW_PROTOCOL *This,\r
+  OUT UINT32                *HorizontalResolution,\r
+  OUT UINT32                *VerticalResolution,\r
+  OUT UINT32                *ColorDepth,\r
+  OUT UINT32                *RefreshRate\r
+  )\r
+;\r
+\r
+/**\r
+  Return the current video mode information.\r
+\r
+  @param  This                 Protocol instance pointer.\r
+  @param  HorizontalResolution Current video horizontal resolution in pixels\r
+  @param  VerticalResolution   Current video vertical resolution in pixels\r
+  @param  ColorDepth           Current video color depth in bits per pixel\r
+  @param  RefreshRate          Current video refresh rate in Hz.\r
+\r
+  @retval EFI_SUCCESS          Mode information returned.\r
+  @retval EFI_NOT_STARTED      Video display is not initialized. Call SetMode ()\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_UGA_DRAW_PROTOCOL_SET_MODE) (\r
+  IN  EFI_UGA_DRAW_PROTOCOL *This,\r
+  IN  UINT32                HorizontalResolution,\r
+  IN  UINT32                VerticalResolution,\r
+  IN  UINT32                ColorDepth,\r
+  IN  UINT32                RefreshRate\r
+  )\r
+;\r
+\r
+typedef struct {\r
+  UINT8 Blue;\r
+  UINT8 Green;\r
+  UINT8 Red;\r
+  UINT8 Reserved;\r
+} EFI_UGA_PIXEL;\r
+\r
+typedef union {\r
+  EFI_UGA_PIXEL Pixel;\r
+  UINT32        Raw;\r
+} EFI_UGA_PIXEL_UNION;\r
+\r
+typedef enum {\r
+  EfiUgaVideoFill,\r
+  EfiUgaVideoToBltBuffer,\r
+  EfiUgaBltBufferToVideo,\r
+  EfiUgaVideoToVideo,\r
+  EfiUgaBltMax\r
+} EFI_UGA_BLT_OPERATION;\r
+\r
+/**\r
+  Type specifying a pointer to a function to perform an UGA Blt operation.\r
+\r
+    The following table defines actions for BltOperations:\r
+\r
+    <B>EfiUgaVideoFill</B> - Write data from the  BltBuffer pixel (SourceX, SourceY) \r
+      directly to every pixel of the video display rectangle \r
+      (DestinationX, DestinationY) (DestinationX + Width, DestinationY + Height). \r
+      Only one pixel will be used from the BltBuffer. Delta is NOT used.\r
+\r
+    <B>EfiUgaVideoToBltBuffer</B> - Read data from the video display rectangle \r
+      (SourceX, SourceY) (SourceX + Width, SourceY + Height) and place it in \r
+      the BltBuffer rectangle (DestinationX, DestinationY ) \r
+      (DestinationX + Width, DestinationY + Height). If DestinationX or \r
+      DestinationY is not zero then Delta must be set to the length in bytes \r
+      of a row in the BltBuffer.\r
+\r
+    <B>EfiUgaBltBufferToVideo</B> - Write data from the  BltBuffer rectangle \r
+      (SourceX, SourceY) (SourceX + Width, SourceY + Height) directly to the \r
+      video display rectangle (DestinationX, DestinationY) \r
+      (DestinationX + Width, DestinationY + Height). If SourceX or SourceY is \r
+      not zero then Delta must be set to the length in bytes of a row in the \r
+      BltBuffer.\r
+\r
+    <B>EfiUgaVideoToVideo</B> - Copy from the video display rectangle (SourceX, SourceY)\r
+     (SourceX + Width, SourceY + Height) .to the video display rectangle \r
+     (DestinationX, DestinationY) (DestinationX + Width, DestinationY + Height). \r
+     The BltBuffer and Delta  are not used in this mode.\r
+\r
+\r
+    @param[in] This          - Protocol instance pointer.\r
+    @param[in] BltBuffer     - Buffer containing data to blit into video buffer. This \r
+                               buffer has a size of Width*Height*sizeof(EFI_UGA_PIXEL)\r
+    @param[in] BltOperation  - Operation to perform on BlitBuffer and video memory\r
+    @param[in] SourceX       - X coordinate of source for the BltBuffer.\r
+    @param[in] SourceY       - Y coordinate of source for the BltBuffer.\r
+    @param[in] DestinationX  - X coordinate of destination for the BltBuffer.\r
+    @param[in] DestinationY  - Y coordinate of destination for the BltBuffer.\r
+    @param[in] Width         - Width of rectangle in BltBuffer in pixels.\r
+    @param[in] Height        - Hight of rectangle in BltBuffer in pixels.\r
+    @param[in] Delta         - OPTIONAL\r
+  \r
+    @retval EFI_SUCCESS           - The Blt operation completed.\r
+    @retval EFI_INVALID_PARAMETER - BltOperation is not valid.\r
+    @retval EFI_DEVICE_ERROR      - A hardware error occured writting to the video buffer.\r
+\r
+--*/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_UGA_DRAW_PROTOCOL_BLT) (\r
+  IN  EFI_UGA_DRAW_PROTOCOL                   * This,\r
+  IN  EFI_UGA_PIXEL                           * BltBuffer, OPTIONAL\r
+  IN  EFI_UGA_BLT_OPERATION                   BltOperation,\r
+  IN  UINTN                                   SourceX,\r
+  IN  UINTN                                   SourceY,\r
+  IN  UINTN                                   DestinationX,\r
+  IN  UINTN                                   DestinationY,\r
+  IN  UINTN                                   Width,\r
+  IN  UINTN                                   Height,\r
+  IN  UINTN                                   Delta         OPTIONAL\r
+  );\r
+\r
+struct _EFI_UGA_DRAW_PROTOCOL {\r
+  EFI_UGA_DRAW_PROTOCOL_GET_MODE  GetMode;\r
+  EFI_UGA_DRAW_PROTOCOL_SET_MODE  SetMode;\r
+  EFI_UGA_DRAW_PROTOCOL_BLT       Blt;\r
+};\r
+\r
+extern EFI_GUID gEfiUgaDrawProtocolGuid;\r
+\r
+#endif\r
diff --git a/Tools/Source/TianoTools/Include/Protocol/UnicodeCollation.h b/Tools/Source/TianoTools/Include/Protocol/UnicodeCollation.h
new file mode 100644 (file)
index 0000000..e027803
--- /dev/null
@@ -0,0 +1,183 @@
+/** @file\r
+  Unicode Collation protocol that follows the EFI 1.0 specification.\r
+\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. This program and the accompanying materials                          \r
+  are licensed and made available under the terms and conditions of the BSD License         \r
+  which accompanies this distribution.  The full text of the license may be found at        \r
+  http://opensource.org/licenses/bsd-license.php                                            \r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+  Module Name:  UnicodeCollation.h\r
+\r
+**/\r
+\r
+#ifndef __UNICODE_COLLATION_H__\r
+#define __UNICODE_COLLATION_H__\r
+\r
+#define EFI_UNICODE_COLLATION_PROTOCOL_GUID \\r
+  { \\r
+    0x1d85cd7f, 0xf43d, 0x11d2, {0x9a, 0xc, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d } \\r
+  }\r
+\r
+typedef struct _EFI_UNICODE_COLLATION_PROTOCOL   EFI_UNICODE_COLLATION_PROTOCOL;\r
+\r
+//\r
+// Protocol data structures and defines\r
+//\r
+#define EFI_UNICODE_BYTE_ORDER_MARK (CHAR16) (0xfeff)\r
+\r
+//\r
+// Protocol member functions\r
+//\r
+/**\r
+  Performs a case-insensitive comparison of two Null-terminated Unicode \r
+  strings.\r
+\r
+  @param  This Protocol instance pointer.\r
+  @param  Str1 A pointer to a Null-terminated Unicode string.\r
+  @param  Str2 A pointer to a Null-terminated Unicode string.\r
+\r
+  @retval 0   Str1 is equivalent to Str2\r
+  @retval >_0 Str1 is lexically greater than Str2\r
+  @retval <_0 Str1 is lexically less than Str2\r
+\r
+**/\r
+typedef\r
+INTN\r
+(EFIAPI *EFI_UNICODE_COLLATION_STRICOLL) (\r
+  IN EFI_UNICODE_COLLATION_PROTOCOL         *This,\r
+  IN CHAR16                                 *Str1,\r
+  IN CHAR16                                 *Str2\r
+  )\r
+;\r
+\r
+/**\r
+  Performs a case-insensitive comparison of a Null-terminated Unicode \r
+  pattern string and a Null-terminated Unicode string.\r
+\r
+  @param  This    Protocol instance pointer.\r
+  @param  String  A pointer to a Null-terminated Unicode string.\r
+  @param  Pattern A pointer to a Null-terminated Unicode pattern string.\r
+\r
+  @retval TRUE    Pattern was found in String.\r
+  @retval FALSE   Pattern was not found in String.\r
+\r
+**/\r
+typedef\r
+BOOLEAN\r
+(EFIAPI *EFI_UNICODE_COLLATION_METAIMATCH) (\r
+  IN EFI_UNICODE_COLLATION_PROTOCOL         *This,\r
+  IN CHAR16                                 *String,\r
+  IN CHAR16                                 *Pattern\r
+  )\r
+;\r
+\r
+/**\r
+  Converts all the Unicode characters in a Null-terminated Unicode string to \r
+  lower case Unicode characters.\r
+\r
+  @param  This   Protocol instance pointer.\r
+  @param  String A pointer to a Null-terminated Unicode string.\r
+\r
+  NONE\r
+\r
+**/\r
+typedef\r
+VOID\r
+(EFIAPI *EFI_UNICODE_COLLATION_STRLWR) (\r
+  IN EFI_UNICODE_COLLATION_PROTOCOL         *This,\r
+  IN OUT CHAR16                             *Str\r
+  )\r
+;\r
+\r
+/**\r
+  Converts all the Unicode characters in a Null-terminated Unicode string to upper\r
+  case Unicode characters.\r
+\r
+  @param  This   Protocol instance pointer.\r
+  @param  String A pointer to a Null-terminated Unicode string.\r
+\r
+  NONE\r
+\r
+**/\r
+typedef\r
+VOID\r
+(EFIAPI *EFI_UNICODE_COLLATION_STRUPR) (\r
+  IN EFI_UNICODE_COLLATION_PROTOCOL         *This,\r
+  IN OUT CHAR16                             *Str\r
+  )\r
+;\r
+\r
+/**\r
+  Converts an 8.3 FAT file name in an OEM character set to a Null-terminated \r
+  Unicode string.\r
+\r
+  @param  This    Protocol instance pointer.\r
+  @param  FatSize The size of the string Fat in bytes.\r
+  @param  Fat     A pointer to a Null-terminated string that contains an 8.3 file\r
+                  name using an OEM character set.\r
+  @param  String  A pointer to a Null-terminated Unicode string. The string must\r
+                  be preallocated to hold FatSize Unicode characters.\r
+\r
+  NONE\r
+\r
+**/\r
+typedef\r
+VOID\r
+(EFIAPI *EFI_UNICODE_COLLATION_FATTOSTR) (\r
+  IN EFI_UNICODE_COLLATION_PROTOCOL         *This,\r
+  IN UINTN                                  FatSize,\r
+  IN CHAR8                                  *Fat,\r
+  OUT CHAR16                                *String\r
+  )\r
+;\r
+\r
+/**\r
+  Converts a Null-terminated Unicode string to legal characters in a FAT \r
+  filename using an OEM character set. \r
+\r
+  @param  This    Protocol instance pointer.\r
+  @param  String  A pointer to a Null-terminated Unicode string. The string must\r
+                  be preallocated to hold FatSize Unicode characters.\r
+  @param  FatSize The size of the string Fat in bytes.\r
+  @param  Fat     A pointer to a Null-terminated string that contains an 8.3 file\r
+                  name using an OEM character set.\r
+\r
+  @retval TRUE    Fat is a Long File Name\r
+  @retval FALSE   Fat is an 8.3 file name\r
+\r
+**/\r
+typedef\r
+BOOLEAN\r
+(EFIAPI *EFI_UNICODE_COLLATION_STRTOFAT) (\r
+  IN EFI_UNICODE_COLLATION_PROTOCOL         *This,\r
+  IN CHAR16                                 *String,\r
+  IN UINTN                                  FatSize,\r
+  OUT CHAR8                                 *Fat\r
+  )\r
+;\r
+\r
+struct _EFI_UNICODE_COLLATION_PROTOCOL {\r
+  //\r
+  // general\r
+  //\r
+  EFI_UNICODE_COLLATION_STRICOLL    StriColl;\r
+  EFI_UNICODE_COLLATION_METAIMATCH  MetaiMatch;\r
+  EFI_UNICODE_COLLATION_STRLWR      StrLwr;\r
+  EFI_UNICODE_COLLATION_STRUPR      StrUpr;\r
+\r
+  //\r
+  // for supporting fat volumes\r
+  //\r
+  EFI_UNICODE_COLLATION_FATTOSTR    FatToStr;\r
+  EFI_UNICODE_COLLATION_STRTOFAT    StrToFat;\r
+\r
+  CHAR8                             *SupportedLanguages;\r
+};\r
+\r
+extern EFI_GUID gEfiUnicodeCollationProtocolGuid;\r
+\r
+#endif\r
diff --git a/Tools/Source/TianoTools/Include/Protocol/Usb2HostController.h b/Tools/Source/TianoTools/Include/Protocol/Usb2HostController.h
new file mode 100644 (file)
index 0000000..5326d5b
--- /dev/null
@@ -0,0 +1,497 @@
+/** @file\r
+  EFI_USB2_HC_PROTOCOL as defined in UEFI 2.0.\r
+\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. This program and the accompanying materials                          \r
+  are licensed and made available under the terms and conditions of the BSD License         \r
+  which accompanies this distribution.  The full text of the license may be found at        \r
+  http://opensource.org/licenses/bsd-license.php                                            \r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+  Module Name:  Usb2HostController.h\r
+\r
+**/\r
+\r
+#ifndef _USB2_HOSTCONTROLLER_H_\r
+#define _USB2_HOSTCONTROLLER_H_\r
+\r
+#define EFI_USB2_HC_PROTOCOL_GUID \\r
+  { \\r
+    0x3e745226, 0x9818, 0x45b6, {0xa2, 0xac, 0xd7, 0xcd, 0xe, 0x8b, 0xa2, 0xbc } \\r
+  }\r
+\r
+//\r
+// Forward reference for pure ANSI compatability\r
+//\r
+typedef struct _EFI_USB2_HC_PROTOCOL EFI_USB2_HC_PROTOCOL;\r
+\r
+#define EFI_USB_SPEED_FULL      0x0000  // 12 Mb/s, USB 1.1 OHCI and UHCI HC.\r
+#define EFI_USB_SPEED_LOW       0x0001  // 1 Mb/s, USB 1.1 OHCI and UHCI HC.\r
+#define EFI_USB_SPEED_HIGH      0x0002  // 480 Mb/s, USB 2.0 EHCI HC.\r
+\r
+typedef struct {\r
+  UINT8      TranslatorHubAddress;\r
+  UINT8      TranslatorPortNumber;\r
+} EFI_USB2_HC_TRANSACTION_TRANSLATOR;\r
+\r
+//\r
+// Protocol definitions\r
+//\r
+\r
+/**\r
+  Retrieves the Host Controller capabilities.\r
+\r
+  @param  This           A pointer to the EFI_USB2_HC_PROTOCOL instance.\r
+  @param  MaxSpeed       Host controller data transfer speed.\r
+  @param  PortNumber     Number of the root hub ports.\r
+  @param  Is64BitCapable TRUE if controller supports 64-bit memory addressing,\r
+                         FALSE otherwise.\r
+\r
+  @retval EFI_SUCCESS           The host controller capabilities were retrieved successfully.\r
+  @retval EFI_INVALID_PARAMETER One of the input args was NULL.\r
+  @retval EFI_DEVICE_ERROR      An error was encountered while attempting to\r
+                                retrieve the capabilities.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_USB2_HC_PROTOCOL_GET_CAPABILITY) (\r
+  IN  EFI_USB2_HC_PROTOCOL  *This,\r
+  OUT UINT8                 *MaxSpeed,\r
+  OUT UINT8                 *PortNumber,\r
+  OUT UINT8                 *Is64BitCapable\r
+  )\r
+;\r
+\r
+/**\r
+  Provides software reset for the USB host controller.\r
+\r
+  @param  This       A pointer to the EFI_USB2_HC_PROTOCOL instance.\r
+  @param  Attributes A bit mask of the reset operation to perform.\r
+\r
+  @retval EFI_SUCCESS           The reset operation succeeded.\r
+  @retval EFI_INVALID_PARAMETER Attributes is not valid.\r
+  @retval EFI_UNSUPPORTED       The type of reset specified by Attributes is not currently\r
+                                supported by the host controller hardware.\r
+  @retval EFI_ACCESS_DENIED     Reset operation is rejected due to the debug port being configured\r
+                                and active; only EFI_USB_HC_RESET_GLOBAL_WITH_DEBUG or\r
+                                EFI_USB_HC_RESET_HOST_WITH_DEBUG reset Attributes can be used to\r
+                                perform reset operation for this host controller.\r
+  @retval EFI_DEVICE_ERROR      An error was encountered while attempting to\r
+                                retrieve the capabilities.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_USB2_HC_PROTOCOL_RESET) (\r
+  IN EFI_USB2_HC_PROTOCOL   *This,\r
+  IN UINT16                 Attributes\r
+  )\r
+;\r
+\r
+/**\r
+  Retrieves current state of the USB host controller.\r
+\r
+  @param  This  A pointer to the EFI_USB2_HC_PROTOCOL instance.\r
+  @param  State A pointer to the EFI_USB_HC_STATE data structure that\r
+                indicates current state of the USB host controller.\r
+\r
+  @retval EFI_SUCCESS           The state information of the host controller was returned in State.\r
+  @retval EFI_INVALID_PARAMETER State is NULL.\r
+  @retval EFI_DEVICE_ERROR      An error was encountered while attempting to retrieve the\r
+                                host controller¡¯s current state.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_USB2_HC_PROTOCOL_GET_STATE) (\r
+  IN  EFI_USB2_HC_PROTOCOL    *This,\r
+  OUT EFI_USB_HC_STATE        *State\r
+  )\r
+;  \r
+\r
+/**\r
+  Sets the USB host controller to a specific state.\r
+\r
+  @param  This  A pointer to the EFI_USB2_HC_PROTOCOL instance.\r
+  @param  State Indicates the state of the host controller that will be set.\r
+\r
+  @retval EFI_SUCCESS           The USB host controller was successfully placed in the state\r
+                                specified by State.\r
+  @retval EFI_INVALID_PARAMETER State is not valid.\r
+  @retval EFI_DEVICE_ERROR      Failed to set the state specified by State due to device error.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_USB2_HC_PROTOCOL_SET_STATE) (\r
+  IN EFI_USB2_HC_PROTOCOL    *This,\r
+  IN EFI_USB_HC_STATE        State\r
+  )\r
+;\r
+\r
+/**\r
+  Submits control transfer to a target USB device.\r
+\r
+  @param  This                A pointer to the EFI_USB2_HC_PROTOCOL instance.\r
+  @param  DeviceAddress       Represents the address of the target device on the USB.\r
+  @param  DeviceSpeed         Indicates device speed.\r
+  @param  MaximumPacketLength Indicates the maximum packet size that the default control transfer\r
+                              endpoint is capable of sending or receiving.\r
+  @param  Request             A pointer to the USB device request that will be sent to the USB device.\r
+  @param  TransferDirection   Specifies the data direction for the transfer. There are three values\r
+                              available, EfiUsbDataIn, EfiUsbDataOut and EfiUsbNoData.\r
+  @param  Data                A pointer to the buffer of data that will be transmitted to USB device or\r
+                              received from USB device.\r
+  @param  DataLength          On input, indicates the size, in bytes, of the data buffer specified by Data.\r
+                              On output, indicates the amount of data actually transferred.\r
+  @param  Translator          A pointer to the transaction translator data.\r
+  @param  TimeOut             Indicates the maximum time, in milliseconds, which the transfer is\r
+                              allowed to complete.\r
+  @param  TransferResult      A pointer to the detailed result information generated by this control\r
+                              transfer.\r
+\r
+  @retval EFI_SUCCESS           The control transfer was completed successfully.\r
+  @retval EFI_INVALID_PARAMETER Some parameters are invalid.\r
+  @retval EFI_OUT_OF_RESOURCES  The control transfer could not be completed due to a lack of resources.\r
+  @retval EFI_TIMEOUT           The control transfer failed due to timeout.\r
+  @retval EFI_DEVICE_ERROR      The control transfer failed due to host controller or device error.\r
+                                Caller should check TransferResult for detailed error information.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_USB2_HC_PROTOCOL_CONTROL_TRANSFER) (\r
+  IN     EFI_USB2_HC_PROTOCOL               *This,\r
+  IN     UINT8                              DeviceAddress,\r
+  IN     UINT8                              DeviceSpeed,\r
+  IN     UINTN                              MaximumPacketLength,\r
+  IN     EFI_USB_DEVICE_REQUEST             *Request,\r
+  IN     EFI_USB_DATA_DIRECTION             TransferDirection,\r
+  IN OUT VOID                               *Data       OPTIONAL,\r
+  IN OUT UINTN                              *DataLength OPTIONAL,\r
+  IN     UINTN                              TimeOut,\r
+  IN     EFI_USB2_HC_TRANSACTION_TRANSLATOR *Translator,\r
+  OUT    UINT32                             *TransferResult\r
+  )\r
+;  \r
+\r
+#define EFI_USB_MAX_BULK_BUFFER_NUM 10\r
+\r
+/**\r
+  Submits bulk transfer to a bulk endpoint of a USB device.\r
+\r
+  @param  This                A pointer to the EFI_USB2_HC_PROTOCOL instance.\r
+  @param  DeviceAddress       Represents the address of the target device on the USB.\r
+  @param  EndPointAddress     The combination of an endpoint number and an endpoint direction of the\r
+                              target USB device.\r
+  @param  DeviceSpeed         Indicates device speed.\r
+  @param  MaximumPacketLength Indicates the maximum packet size the target endpoint is capable of\r
+                              sending or receiving.\r
+  @param  DataBuffersNumber   Number of data buffers prepared for the transfer.\r
+  @param  Data                Array of pointers to the buffers of data that will be transmitted to USB\r
+                              device or received from USB device.\r
+  @param  DataLength          When input, indicates the size, in bytes, of the data buffers specified by\r
+                              Data. When output, indicates the actually transferred data size.\r
+  @param  DataToggle          A pointer to the data toggle value.\r
+  @param  Translator          A pointer to the transaction translator data.\r
+  @param  TimeOut             Indicates the maximum time, in milliseconds, which the transfer is\r
+                              allowed to complete.\r
+  @param  TransferResult      A pointer to the detailed result information of the bulk transfer.\r
+\r
+  @retval EFI_SUCCESS           The bulk transfer was completed successfully.\r
+  @retval EFI_INVALID_PARAMETER Some parameters are invalid.\r
+  @retval EFI_OUT_OF_RESOURCES  The bulk transfer could not be submitted due to a lack of resources.\r
+  @retval EFI_TIMEOUT           The bulk transfer failed due to timeout.\r
+  @retval EFI_DEVICE_ERROR      The bulk transfer failed due to host controller or device error.\r
+                                Caller should check TransferResult for detailed error information.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_USB2_HC_PROTOCOL_BULK_TRANSFER) (\r
+  IN     EFI_USB2_HC_PROTOCOL               *This,\r
+  IN     UINT8                              DeviceAddress,\r
+  IN     UINT8                              EndPointAddress,\r
+  IN     UINT8                              DeviceSpeed,\r
+  IN     UINTN                              MaximumPacketLength,\r
+  IN     UINT8                              DataBuffersNumber,\r
+  IN OUT VOID                               *Data[EFI_USB_MAX_BULK_BUFFER_NUM],\r
+  IN OUT UINTN                              *DataLength,\r
+  IN OUT UINT8                              *DataToggle,\r
+  IN     UINTN                              TimeOut,\r
+  IN     EFI_USB2_HC_TRANSACTION_TRANSLATOR *Translator,\r
+  OUT    UINT32                             *TransferResult\r
+  )\r
+;\r
+\r
+/**\r
+  Submits an asynchronous interrupt transfer to an interrupt endpoint of a USB device.\r
+\r
+  @param  This                A pointer to the EFI_USB2_HC_PROTOCOL instance.\r
+  @param  DeviceAddress       Represents the address of the target device on the USB.\r
+  @param  EndPointAddress     The combination of an endpoint number and an endpoint direction of the\r
+                              target USB device.\r
+  @param  DeviceSpeed         Indicates device speed.\r
+  @param  MaximumPacketLength Indicates the maximum packet size the target endpoint is capable of\r
+                              sending or receiving.\r
+  @param  IsNewTransfer       If TRUE, an asynchronous interrupt pipe is built between the host and the\r
+                              target interrupt endpoint. If FALSE, the specified asynchronous interrupt\r
+                              pipe is canceled. If TRUE, and an interrupt transfer exists for the target\r
+                              end point, then EFI_INVALID_PARAMETER is returned.\r
+  @param  DataToggle          A pointer to the data toggle value.\r
+  @param  PollingInterval     Indicates the interval, in milliseconds, that the asynchronous interrupt\r
+                              transfer is polled.\r
+  @param  DataLength          Indicates the length of data to be received at the rate specified by\r
+                              PollingInterval from the target asynchronous interrupt endpoint.\r
+  @param  CallBackFunction    The Callback function. This function is called at the rate specified by\r
+                              PollingInterval.\r
+  @param  Context             The context that is passed to the CallBackFunction. This is an\r
+                              optional parameter and may be NULL.\r
+\r
+  @retval EFI_SUCCESS           The asynchronous interrupt transfer request has been successfully\r
+                                submitted or canceled.\r
+  @retval EFI_INVALID_PARAMETER Some parameters are invalid.\r
+  @retval EFI_OUT_OF_RESOURCES  The request could not be completed due to a lack of resources.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_USB2_HC_PROTOCOL_ASYNC_INTERRUPT_TRANSFER) (\r
+  IN     EFI_USB2_HC_PROTOCOL                                *This,\r
+  IN     UINT8                                               DeviceAddress,\r
+  IN     UINT8                                               EndPointAddress,\r
+  IN     UINT8                                               DeviceSpeed,\r
+  IN     UINTN                                               MaxiumPacketLength,\r
+  IN     BOOLEAN                                             IsNewTransfer,\r
+  IN OUT UINT8                                               *DataToggle,\r
+  IN     UINTN                                               PollingInterval  OPTIONAL,\r
+  IN     UINTN                                               DataLength       OPTIONAL,\r
+  IN     EFI_ASYNC_USB_TRANSFER_CALLBACK                     CallBackFunction OPTIONAL,\r
+  IN     VOID                                                *Context         OPTIONAL\r
+  )\r
+;\r
+\r
+/**\r
+  Submits synchronous interrupt transfer to an interrupt endpoint of a USB device.\r
+\r
+  @param  This                  A pointer to the EFI_USB2_HC_PROTOCOL instance.\r
+  @param  DeviceAddress         Represents the address of the target device on the USB.\r
+  @param  EndPointAddress       The combination of an endpoint number and an endpoint direction of the\r
+                                target USB device.\r
+  @param  DeviceSpeed           Indicates device speed.\r
+  @param  MaximumPacketLength   Indicates the maximum packet size the target endpoint is capable of\r
+                                sending or receiving.\r
+  @param  Data                  A pointer to the buffer of data that will be transmitted to USB device or\r
+                                received from USB device.\r
+  @param  DataLength            On input, the size, in bytes, of the data buffer specified by Data. On\r
+                                output, the number of bytes transferred.\r
+  @param  DataToggle            A pointer to the data toggle value.\r
+  @param  TimeOut               Indicates the maximum time, in milliseconds, which the transfer is\r
+                                allowed to complete.\r
+  @param  TransferResult        A pointer to the detailed result information from the synchronous\r
+                                interrupt transfer.\r
+\r
+  @retval EFI_SUCCESS           The synchronous interrupt transfer was completed successfully.\r
+  @retval EFI_INVALID_PARAMETER Some parameters are invalid.\r
+  @retval EFI_OUT_OF_RESOURCES  The synchronous interrupt transfer could not be submitted due to a lack of resources.\r
+  @retval EFI_TIMEOUT           The synchronous interrupt transfer failed due to timeout.\r
+  @retval EFI_DEVICE_ERROR      The synchronous interrupt transfer failed due to host controller or device error.\r
+                                Caller should check TransferResult for detailed error information.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_USB2_HC_PROTOCOL_SYNC_INTERRUPT_TRANSFER) (\r
+  IN     EFI_USB2_HC_PROTOCOL   *This,\r
+  IN     UINT8                  DeviceAddress,\r
+  IN     UINT8                  EndPointAddress,\r
+  IN     UINT8                  DeviceSpeed,\r
+  IN     UINTN                  MaximumPacketLength,\r
+  IN OUT VOID                   *Data,\r
+  IN OUT UINTN                  *DataLength,\r
+  IN OUT UINT8                  *DataToggle,\r
+  IN     UINTN                  TimeOut,\r
+  OUT    UINT32                 *TransferResult\r
+  )\r
+;\r
+\r
+#define EFI_USB_MAX_ISO_BUFFER_NUM  7\r
+#define EFI_USB_MAX_ISO_BUFFER_NUM1 2\r
+\r
+/**\r
+  Submits isochronous transfer to an isochronous endpoint of a USB device.\r
+\r
+  @param  This                  A pointer to the EFI_USB2_HC_PROTOCOL instance.\r
+  @param  DeviceAddress         Represents the address of the target device on the USB.\r
+  @param  EndPointAddress       The combination of an endpoint number and an endpoint direction of the\r
+                                target USB device.\r
+  @param  DeviceSpeed           Indicates device speed.\r
+  @param  MaximumPacketLength   Indicates the maximum packet size the target endpoint is capable of\r
+                                sending or receiving.\r
+  @param  DataBuffersNumber     Number of data buffers prepared for the transfer.\r
+  @param  Data                  Array of pointers to the buffers of data that will be transmitted to USB\r
+                                device or received from USB device.\r
+  @param  DataLength            Specifies the length, in bytes, of the data to be sent to or received from\r
+                                the USB device.\r
+  @param  Translator            A pointer to the transaction translator data.\r
+  @param  TransferResult        A pointer to the detailed result information of the isochronous transfer.\r
+\r
+  @retval EFI_SUCCESS           The isochronous transfer was completed successfully.\r
+  @retval EFI_INVALID_PARAMETER Some parameters are invalid.\r
+  @retval EFI_OUT_OF_RESOURCES  The isochronous transfer could not be submitted due to a lack of resources.\r
+  @retval EFI_TIMEOUT           The isochronous transfer cannot be completed within the one USB frame time.\r
+  @retval EFI_DEVICE_ERROR      The isochronous transfer failed due to host controller or device error.\r
+                                Caller should check TransferResult for detailed error information.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_USB2_HC_PROTOCOL_ISOCHRONOUS_TRANSFER) (\r
+  IN     EFI_USB2_HC_PROTOCOL               *This,\r
+  IN     UINT8                              DeviceAddress,\r
+  IN     UINT8                              EndPointAddress,\r
+  IN     UINT8                              DeviceSpeed,\r
+  IN     UINTN                              MaximumPacketLength,\r
+  IN     UINT8                              DataBuffersNumber,\r
+  IN OUT VOID                               *Data[EFI_USB_MAX_ISO_BUFFER_NUM],\r
+  IN     UINTN                              DataLength,\r
+  IN     EFI_USB2_HC_TRANSACTION_TRANSLATOR *Translator,\r
+  OUT    UINT32                             *TransferResult\r
+  )\r
+;\r
+\r
+/**\r
+  Submits nonblocking isochronous transfer to an isochronous endpoint of a USB device.\r
+\r
+  @param  This                  A pointer to the EFI_USB2_HC_PROTOCOL instance.\r
+  @param  DeviceAddress         Represents the address of the target device on the USB.\r
+  @param  EndPointAddress       The combination of an endpoint number and an endpoint direction of the\r
+                                target USB device.\r
+  @param  DeviceSpeed           Indicates device speed.\r
+  @param  MaximumPacketLength   Indicates the maximum packet size the target endpoint is capable of\r
+                                sending or receiving.\r
+  @param  DataBuffersNumber     Number of data buffers prepared for the transfer.\r
+  @param  Data                  Array of pointers to the buffers of data that will be transmitted to USB\r
+                                device or received from USB device.\r
+  @param  DataLength            Specifies the length, in bytes, of the data to be sent to or received from\r
+                                the USB device.\r
+  @param  Translator            A pointer to the transaction translator data.\r
+  @param  IsochronousCallback   The Callback function. This function is called if the requested\r
+                                isochronous transfer is completed.\r
+  @param  Context               Data passed to the IsochronousCallback function. This is an\r
+                                optional parameter and may be NULL.\r
+\r
+  @retval EFI_SUCCESS           The asynchronous isochronous transfer request has been successfully\r
+                                submitted or canceled.\r
+  @retval EFI_INVALID_PARAMETER Some parameters are invalid.\r
+  @retval EFI_OUT_OF_RESOURCES  The asynchronous isochronous transfer could not be submitted due to\r
+                                a lack of resources.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_USB2_HC_PROTOCOL_ASYNC_ISOCHRONOUS_TRANSFER) (\r
+  IN     EFI_USB2_HC_PROTOCOL               *This,\r
+  IN     UINT8                              DeviceAddress,\r
+  IN     UINT8                              EndPointAddress,\r
+  IN     UINT8                              DeviceSpeed,\r
+  IN     UINTN                              MaximumPacketLength,\r
+  IN     UINT8                              DataBuffersNumber,\r
+  IN OUT VOID                               *Data[EFI_USB_MAX_ISO_BUFFER_NUM],\r
+  IN     UINTN                              DataLength,\r
+  IN     EFI_USB2_HC_TRANSACTION_TRANSLATOR *Translator,\r
+  IN     EFI_ASYNC_USB_TRANSFER_CALLBACK    IsochronousCallBack,\r
+  IN     VOID                               *Context OPTIONAL\r
+  )\r
+;\r
+\r
+/**\r
+  Retrieves the current status of a USB root hub port.\r
+\r
+  @param  This       A pointer to the EFI_USB2_HC_PROTOCOL instance.\r
+  @param  PortNumber Specifies the root hub port from which the status is to be retrieved.\r
+                     This value is zero based.\r
+  @param  PortStatus A pointer to the current port status bits and port status change bits.\r
+\r
+  @retval EFI_SUCCESS           The status of the USB root hub port specified by PortNumber\r
+                                was returned in PortStatus.\r
+  @retval EFI_INVALID_PARAMETER PortNumber is invalid.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_USB2_HC_PROTOCOL_GET_ROOTHUB_PORT_STATUS) (\r
+  IN EFI_USB2_HC_PROTOCOL    *This,\r
+  IN  UINT8                  PortNumber,\r
+  OUT EFI_USB_PORT_STATUS    *PortStatus\r
+  )\r
+;  \r
+\r
+/**\r
+  Sets a feature for the specified root hub port.\r
+\r
+  @param  This        A pointer to the EFI_USB2_HC_PROTOCOL instance.\r
+  @param  PortNumber  Specifies the root hub port whose feature is requested to be set. This\r
+                      value is zero based.\r
+  @param  PortFeature Indicates the feature selector associated with the feature set request.\r
+\r
+  @retval EFI_SUCCESS           The feature specified by PortFeature was set for the USB\r
+                                root hub port specified by PortNumber.\r
+  @retval EFI_INVALID_PARAMETER PortNumber is invalid or PortFeature is invalid for this function.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_USB2_HC_PROTOCOL_SET_ROOTHUB_PORT_FEATURE) (\r
+  IN EFI_USB2_HC_PROTOCOL    *This,\r
+  IN UINT8                   PortNumber,\r
+  IN EFI_USB_PORT_FEATURE    PortFeature\r
+  )\r
+;  \r
+\r
+/**\r
+  Clears a feature for the specified root hub port.\r
+\r
+  @param  This        A pointer to the EFI_USB2_HC_PROTOCOL instance.\r
+  @param  PortNumber  Specifies the root hub port whose feature is requested to be cleared. This\r
+                      value is zero based.\r
+  @param  PortFeature Indicates the feature selector associated with the feature clear request.\r
+\r
+  @retval EFI_SUCCESS           The feature specified by PortFeature was cleared for the USB\r
+                                root hub port specified by PortNumber.\r
+  @retval EFI_INVALID_PARAMETER PortNumber is invalid or PortFeature is invalid for this function.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_USB2_HC_PROTOCOL_CLEAR_ROOTHUB_PORT_FEATURE) (\r
+  IN EFI_USB2_HC_PROTOCOL    *This,\r
+  IN UINT8                   PortNumber,\r
+  IN EFI_USB_PORT_FEATURE    PortFeature\r
+  )\r
+;  \r
+\r
+struct _EFI_USB2_HC_PROTOCOL {\r
+  EFI_USB2_HC_PROTOCOL_GET_CAPABILITY              GetCapability;\r
+  EFI_USB2_HC_PROTOCOL_RESET                       Reset;\r
+  EFI_USB2_HC_PROTOCOL_GET_STATE                   GetState;\r
+  EFI_USB2_HC_PROTOCOL_SET_STATE                   SetState;\r
+  EFI_USB2_HC_PROTOCOL_CONTROL_TRANSFER            ControlTransfer;\r
+  EFI_USB2_HC_PROTOCOL_BULK_TRANSFER               BulkTransfer;\r
+  EFI_USB2_HC_PROTOCOL_ASYNC_INTERRUPT_TRANSFER    AsyncInterruptTransfer;\r
+  EFI_USB2_HC_PROTOCOL_SYNC_INTERRUPT_TRANSFER     SyncInterruptTransfer;\r
+  EFI_USB2_HC_PROTOCOL_ISOCHRONOUS_TRANSFER        IsochronousTransfer;\r
+  EFI_USB2_HC_PROTOCOL_ASYNC_ISOCHRONOUS_TRANSFER  AsyncIsochronousTransfer;\r
+  EFI_USB2_HC_PROTOCOL_GET_ROOTHUB_PORT_STATUS     GetRootHubPortStatus;\r
+  EFI_USB2_HC_PROTOCOL_SET_ROOTHUB_PORT_FEATURE    SetRootHubPortFeature;\r
+  EFI_USB2_HC_PROTOCOL_CLEAR_ROOTHUB_PORT_FEATURE  ClearRootHubPortFeature;\r
+  UINT16                                           MajorRevision;\r
+  UINT16                                           MinorRevision;\r
+};\r
+\r
+extern EFI_GUID gEfiUsb2HcProtocolGuid;\r
+\r
+#endif\r
diff --git a/Tools/Source/TianoTools/Include/Protocol/UsbHostController.h b/Tools/Source/TianoTools/Include/Protocol/UsbHostController.h
new file mode 100644 (file)
index 0000000..f816d73
--- /dev/null
@@ -0,0 +1,446 @@
+/** @file\r
+  EFI_USB_HC_PROTOCOL as defined in EFI 1.10.\r
+\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. This program and the accompanying materials                          \r
+  are licensed and made available under the terms and conditions of the BSD License         \r
+  which accompanies this distribution.  The full text of the license may be found at        \r
+  http://opensource.org/licenses/bsd-license.php                                            \r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+  Module Name:  UsbHostController.h\r
+\r
+**/\r
+\r
+#ifndef _USB_HOSTCONTROLLER_H_\r
+#define _USB_HOSTCONTROLLER_H_\r
+\r
+#define EFI_USB_HC_PROTOCOL_GUID \\r
+  { \\r
+    0xf5089266, 0x1aa0, 0x4953, {0x97, 0xd8, 0x56, 0x2f, 0x8a, 0x73, 0xb5, 0x19 } \\r
+  }\r
+\r
+//\r
+// Forward reference for pure ANSI compatability\r
+//\r
+typedef struct _EFI_USB_HC_PROTOCOL EFI_USB_HC_PROTOCOL;\r
+\r
+//\r
+// Protocol definitions\r
+//\r
+\r
+/**                                                                 \r
+  Provides software reset for the USB host controller.\r
+    \r
+  @param  This                  A pointer to the EFI_USB_HC_PROTOCOL instance.\r
+  @param  Attributes            A bit mask of the reset operation to perform.\r
+                                \r
+  @retval EFI_SUCCESS           The reset operation succeeded.\r
+  @retval EFI_UNSUPPORTED       The type of reset specified by Attributes is not currently supported\r
+                                by the host controller hardware.                                    \r
+  @retval EFI_INVALID_PARAMETER Attributes is not valid.\r
+  @retval EFI_DEVICE_ERROR      An error was encountered while attempting to perform the reset operation.\r
+                                   \r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_USB_HC_PROTOCOL_RESET) (\r
+  IN EFI_USB_HC_PROTOCOL     *This,\r
+  IN UINT16                  Attributes\r
+  );\r
+\r
+/**                                                                 \r
+  Retrieves current state of the USB host controller.\r
+    \r
+  @param  This                  A pointer to the EFI_USB_HC_PROTOCOL instance.\r
+  @param  State                 A pointer to the EFI_USB_HC_STATE data structure that\r
+                                indicates current state of the USB host controller.  \r
+                                \r
+  @retval EFI_SUCCESS           The state information of the host controller was returned in State.\r
+  @retval EFI_INVALID_PARAMETER State is NULL.\r
+  @retval EFI_DEVICE_ERROR      An error was encountered while attempting to retrieve the host controller¡¯s\r
+                                current state.                                                                 \r
+                                \r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_USB_HC_PROTOCOL_GET_STATE) (\r
+  IN  EFI_USB_HC_PROTOCOL    *This,\r
+  OUT EFI_USB_HC_STATE       *State\r
+  );\r
+\r
+/**                                                                 \r
+  Sets the USB host controller to a specific state.\r
+    \r
+  @param  This                  A pointer to the EFI_USB_HC_PROTOCOL instance.\r
+  @param  State                 Indicates the state of the host controller that will be set.                                \r
+                                \r
+  @retval EFI_SUCCESS           The USB host controller was successfully placed in the state specified by\r
+                                State.                                                                   \r
+  @retval EFI_INVALID_PARAMETER State is NULL.\r
+  @retval EFI_DEVICE_ERROR      Failed to set the state specified by State due to device error.                                \r
+                                \r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_USB_HC_PROTOCOL_SET_STATE) (\r
+  IN EFI_USB_HC_PROTOCOL     *This,\r
+  IN EFI_USB_HC_STATE        State\r
+  );\r
+\r
+/**                                                                 \r
+  Submits control transfer to a target USB device.\r
+    \r
+  @param  This                  A pointer to the EFI_USB_HC_PROTOCOL instance.\r
+  @param  DeviceAddress         Represents the address of the target device on the USB, which is\r
+                                assigned during USB enumeration.                                \r
+  @param  IsSlowDevice          Indicates whether the target device is slow device or full-speed\r
+                                device.                                                         \r
+  @param  MaximumPacketLength   Indicates the maximum packet size that the default control \r
+                                transfer endpoint is capable of sending or receiving.     \r
+  @param  Request               A pointer to the USB device request that will be sent to the USB\r
+                                device.\r
+  @param  TransferDirection     Specifies the data direction for the transfer.  \r
+  @param  Data                  A pointer to the buffer of data that will be transmitted to USB  \r
+                                device or received from USB device.                            \r
+  @param  DataLength            On input, indicates the size, in bytes, of the data buffer specified\r
+                                by Data. On output, indicates the amount of data actually           \r
+                                transferred.                                                        \r
+  @param  TimeOut               Indicates the maximum time, in milliseconds, which the transfer\r
+                                is allowed to complete.                                        \r
+  @param  TransferResult        A pointer to the detailed result information generated by this  \r
+                                control transfer.\r
+                                \r
+  @retval EFI_SUCCESS           The control transfer was completed successfully.\r
+  @retval EFI_OUT_OF_RESOURCES  The control transfer could not be completed due to a lack of resources.                                \r
+  @retval EFI_INVALID_PARAMETER Some parameters are invalid.\r
+  @retval EFI_TIMEOUT           The control transfer failed due to timeout.\r
+  @retval EFI_DEVICE_ERROR      The control transfer failed due to host controller or device error.\r
+                                \r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_USB_HC_PROTOCOL_CONTROL_TRANSFER) (\r
+  IN     EFI_USB_HC_PROTOCOL       *This,\r
+  IN     UINT8                     DeviceAddress,\r
+  IN     BOOLEAN                   IsSlowDevice,\r
+  IN     UINT8                     MaximumPacketLength,\r
+  IN     EFI_USB_DEVICE_REQUEST    *Request,\r
+  IN     EFI_USB_DATA_DIRECTION    TransferDirection,\r
+  IN OUT VOID                      *Data       OPTIONAL,\r
+  IN OUT UINTN                     *DataLength OPTIONAL,\r
+  IN     UINTN                     TimeOut,\r
+  OUT    UINT32                    *TransferResult\r
+  );\r
+\r
+/**                                                                 \r
+  Submits bulk transfer to a bulk endpoint of a USB device.\r
+    \r
+  @param  This                  A pointer to the EFI_USB_HC_PROTOCOL instance.\r
+  @param  DeviceAddress         Represents the address of the target device on the USB, which is\r
+                                assigned during USB enumeration.                                \r
+  @param  EndPointAddress       The combination of an endpoint number and an endpoint\r
+                                direction of the target USB device.                  \r
+  @param  MaximumPacketLength   Indicates the maximum packet size that the default control \r
+                                transfer endpoint is capable of sending or receiving.     \r
+  @param  Data                  A pointer to the buffer of data that will be transmitted to USB  \r
+                                device or received from USB device.                            \r
+  @param  DataLength            On input, indicates the size, in bytes, of the data buffer specified\r
+                                by Data. On output, indicates the amount of data actually           \r
+                                transferred.             \r
+  @param  DataToggle            A pointer to the data toggle value.                                                                           \r
+  @param  TimeOut               Indicates the maximum time, in milliseconds, which the transfer\r
+                                is allowed to complete.                                        \r
+  @param  TransferResult        A pointer to the detailed result information of the bulk transfer.\r
+                                \r
+  @retval EFI_SUCCESS           The bulk transfer was completed successfully.\r
+  @retval EFI_OUT_OF_RESOURCES  The bulk transfer could not be completed due to a lack of resources.                                \r
+  @retval EFI_INVALID_PARAMETER Some parameters are invalid.\r
+  @retval EFI_TIMEOUT           The bulk transfer failed due to timeout.\r
+  @retval EFI_DEVICE_ERROR      The bulk transfer failed due to host controller or device error.\r
+                                \r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_USB_HC_PROTOCOL_BULK_TRANSFER) (\r
+  IN     EFI_USB_HC_PROTOCOL    *This,\r
+  IN     UINT8                  DeviceAddress,\r
+  IN     UINT8                  EndPointAddress,\r
+  IN     UINT8                  MaximumPacketLength,\r
+  IN OUT VOID                   *Data,\r
+  IN OUT UINTN                  *DataLength,\r
+  IN OUT UINT8                  *DataToggle,\r
+  IN     UINTN                  TimeOut,\r
+  OUT    UINT32                 *TransferResult\r
+  );\r
+\r
+/**                                                                 \r
+  Submits an asynchronous interrupt transfer to an interrupt endpoint of a USB device.\r
+    \r
+  @param  This                  A pointer to the EFI_USB_HC_PROTOCOL instance.\r
+  @param  DeviceAddress         Represents the address of the target device on the USB, which is\r
+                                assigned during USB enumeration.                                \r
+  @param  EndPointAddress       The combination of an endpoint number and an endpoint\r
+                                direction of the target USB device.   \r
+  @param  IsSlowDevice          Indicates whether the target device is slow device or full-speed\r
+                                device.                                                                          \r
+  @param  MaximumPacketLength   Indicates the maximum packet size that the default control \r
+                                transfer endpoint is capable of sending or receiving.     \r
+  @param  IsNewTransfer         If TRUE, an asynchronous interrupt pipe is built between the host                       \r
+                                and the target interrupt endpoint. If FALSE, the specified       \r
+  \r
+  @param  DataToggle            A pointer to the data toggle value.      \r
+  @param  PollingInterval       Indicates the interval, in milliseconds, that the asynchronous\r
+                                interrupt transfer is polled.                                                                                                      asynchronous interrupt pipe is canceled.                         \r
+  @param  DataLength            Indicates the length of data to be received at the rate specified by\r
+                                PollingInterval from the target asynchronous interrupt              \r
+                                endpoint.                                                             \r
+  @param  CallBackFunction      The Callback function.                                \r
+  @param  Context               The context that is passed to the CallBackFunction.\r
+                                \r
+  @retval EFI_SUCCESS           The asynchronous interrupt transfer request has been successfully\r
+                                submitted or canceled.    \r
+  @retval EFI_OUT_OF_RESOURCES  The request could not be completed due to a lack of resources.                                \r
+  @retval EFI_INVALID_PARAMETER Some parameters are invalid.\r
+  @retval EFI_TIMEOUT           The bulk transfer failed due to timeout.\r
+  @retval EFI_DEVICE_ERROR      The bulk transfer failed due to host controller or device error.\r
+                                \r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_USB_HC_PROTOCOL_ASYNC_INTERRUPT_TRANSFER) (\r
+  IN     EFI_USB_HC_PROTOCOL                                 *This,\r
+  IN     UINT8                                               DeviceAddress,\r
+  IN     UINT8                                               EndPointAddress,\r
+  IN     BOOLEAN                                             IsSlowDevice,\r
+  IN     UINT8                                               MaxiumPacketLength,\r
+  IN     BOOLEAN                                             IsNewTransfer,\r
+  IN OUT UINT8                                               *DataToggle,\r
+  IN     UINTN                                               PollingInterval  OPTIONAL,\r
+  IN     UINTN                                               DataLength       OPTIONAL,\r
+  IN     EFI_ASYNC_USB_TRANSFER_CALLBACK                     CallBackFunction OPTIONAL,\r
+  IN     VOID                                                *Context         OPTIONAL\r
+  );\r
+\r
+/**                                                                 \r
+  Submits synchronous interrupt transfer to an interrupt endpoint of a USB device.\r
+    \r
+  @param  This                  A pointer to the EFI_USB_HC_PROTOCOL instance.\r
+  @param  DeviceAddress         Represents the address of the target device on the USB, which is\r
+                                assigned during USB enumeration.                                \r
+  @param  EndPointAddress       The combination of an endpoint number and an endpoint\r
+                                direction of the target USB device.   \r
+  @param  IsSlowDevice          Indicates whether the target device is slow device or full-speed\r
+                                device.                                                                          \r
+  @param  MaximumPacketLength   Indicates the maximum packet size that the default control \r
+                                transfer endpoint is capable of sending or receiving.       \r
+  @param  Data                  A pointer to the buffer of data that will be transmitted to USB\r
+                                device or received from USB device.                                                                                            asynchronous interrupt pipe is canceled.                         \r
+  @param  DataLength            On input, the size, in bytes, of the data buffer specified by Data.\r
+                                On output, the number of bytes transferred.                          \r
+  @param  DataToggle            A pointer to the data toggle value.                                \r
+  @param  TimeOut               Indicates the maximum time, in milliseconds, which the transfer    \r
+                                is allowed to complete.                                            \r
+  @param  TransferResult        A pointer to the detailed result information from the synchronous\r
+                                interrupt transfer.\r
+                                \r
+  @retval EFI_SUCCESS           The synchronous interrupt transfer was completed successfully.\r
+  @retval EFI_OUT_OF_RESOURCES  The request could not be completed due to a lack of resources.                                  \r
+  @retval EFI_INVALID_PARAMETER Some parameters are invalid.\r
+  @retval EFI_TIMEOUT           The synchronous interrupt transfer failed due to timeout.\r
+  @retval EFI_DEVICE_ERROR      The synchronous interrupt transfer failed due to host controller or device error.\r
+                                \r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_USB_HC_PROTOCOL_SYNC_INTERRUPT_TRANSFER) (\r
+  IN     EFI_USB_HC_PROTOCOL    *This,\r
+  IN     UINT8                  DeviceAddress,\r
+  IN     UINT8                  EndPointAddress,\r
+  IN     BOOLEAN                IsSlowDevice,\r
+  IN     UINT8                  MaximumPacketLength,\r
+  IN OUT VOID                   *Data,\r
+  IN OUT UINTN                  *DataLength,\r
+  IN OUT UINT8                  *DataToggle,\r
+  IN     UINTN                  TimeOut,\r
+  OUT    UINT32                 *TransferResult\r
+  );\r
+\r
+/**                                                                 \r
+  Submits isochronous transfer to an isochronous endpoint of a USB device.\r
+    \r
+  @param  This                  A pointer to the EFI_USB_HC_PROTOCOL instance.\r
+  @param  DeviceAddress         Represents the address of the target device on the USB, which is\r
+                                assigned during USB enumeration.                                \r
+  @param  EndPointAddress       The combination of an endpoint number and an endpoint\r
+                                direction of the target USB device.                  \r
+  @param  MaximumPacketLength   Indicates the maximum packet size that the default control \r
+                                transfer endpoint is capable of sending or receiving.       \r
+  @param  Data                  A pointer to the buffer of data that will be transmitted to USB\r
+                                device or received from USB device.                                                                                            asynchronous interrupt pipe is canceled.                         \r
+  @param  DataLength            Specifies the length, in bytes, of the data to be sent to or received\r
+                                from the USB device.                                                 \r
+  @param  TransferResult        A pointer to the detailed result information from the isochronous\r
+                                transfer.\r
+                                \r
+  @retval EFI_SUCCESS           The isochronous transfer was completed successfully.\r
+  @retval EFI_OUT_OF_RESOURCES  The isochronous could not be completed due to a lack of resources.                                  \r
+  @retval EFI_INVALID_PARAMETER Some parameters are invalid.\r
+  @retval EFI_TIMEOUT           The isochronous transfer failed due to timeout.\r
+  @retval EFI_DEVICE_ERROR      The isochronous transfer failed due to host controller or device error.\r
+                                \r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_USB_HC_PROTOCOL_ISOCHRONOUS_TRANSFER) (\r
+  IN     EFI_USB_HC_PROTOCOL    *This,\r
+  IN     UINT8                  DeviceAddress,\r
+  IN     UINT8                  EndPointAddress,\r
+  IN     UINT8                  MaximumPacketLength,\r
+  IN OUT VOID                   *Data,\r
+  IN     UINTN                  DataLength,\r
+  OUT    UINT32                 *TransferResult\r
+  );\r
+\r
+/**                                                                 \r
+  Submits nonblocking isochronous transfer to an isochronous endpoint of a USB device.\r
+    \r
+  @param  This                  A pointer to the EFI_USB_HC_PROTOCOL instance.\r
+  @param  DeviceAddress         Represents the address of the target device on the USB, which is\r
+                                assigned during USB enumeration.                                \r
+  @param  EndPointAddress       The combination of an endpoint number and an endpoint\r
+                                direction of the target USB device.                  \r
+  @param  MaximumPacketLength   Indicates the maximum packet size that the default control \r
+                                transfer endpoint is capable of sending or receiving.       \r
+  @param  Data                  A pointer to the buffer of data that will be transmitted to USB\r
+                                device or received from USB device.                                                                                            asynchronous interrupt pipe is canceled.                         \r
+  @param  DataLength            Specifies the length, in bytes, of the data to be sent to or received\r
+                                from the USB device.                                                 \r
+  @param  IsochronousCallback   The Callback function.\r
+  @param  Context               Data passed to the IsochronousCallback function. This is\r
+                                an optional parameter and may be NULL.\r
+                                \r
+  @retval EFI_SUCCESS           The asynchronous isochronous transfer was completed successfully.\r
+  @retval EFI_OUT_OF_RESOURCES  The asynchronous isochronous could not be completed due to a lack of resources.                                  \r
+  @retval EFI_INVALID_PARAMETER Some parameters are invalid.\r
+                                \r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_USB_HC_PROTOCOL_ASYNC_ISOCHRONOUS_TRANSFER) (\r
+  IN     EFI_USB_HC_PROTOCOL                *This,\r
+  IN     UINT8                              DeviceAddress,\r
+  IN     UINT8                              EndPointAddress,\r
+  IN     UINT8                              MaximumPacketLength,\r
+  IN OUT VOID                               *Data,\r
+  IN     UINTN                              DataLength,\r
+  IN     EFI_ASYNC_USB_TRANSFER_CALLBACK    IsochronousCallBack,\r
+  IN     VOID                               *Context OPTIONAL\r
+  );\r
+\r
+/**                                                                 \r
+  Retrieves the number of root hub ports.\r
+    \r
+  @param  This                  A pointer to the EFI_USB_HC_PROTOCOL instance.\r
+  @param  PortNumber            A pointer to the number of the root hub ports.                                \r
+                                \r
+  @retval EFI_SUCCESS           The port number was retrieved successfully.\r
+  @retval EFI_DEVICE_ERROR      An error was encountered while attempting to retrieve the port number.\r
+  @retval EFI_INVALID_PARAMETER PortNumber is NULL.\r
+                                \r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_USB_HC_PROTOCOL_GET_ROOTHUB_PORT_NUMBER) (\r
+  IN EFI_USB_HC_PROTOCOL    *This,\r
+  OUT UINT8                 *PortNumber\r
+  );\r
+\r
+/**                                                                 \r
+  Retrieves the current status of a USB root hub port.\r
+    \r
+  @param  This                  A pointer to the EFI_USB_HC_PROTOCOL instance.\r
+  @param  PortNumber            Specifies the root hub port from which the status is to be retrieved.\r
+                                This value is zero based.\r
+  @param  PortStatus            A pointer to the current port status bits and port status change bits.                                \r
+                                \r
+  @retval EFI_SUCCESS           The status of the USB root hub port specified by PortNumber\r
+                                was returned in PortStatus.                                \r
+  @retval EFI_INVALID_PARAMETER PortNumber is invalid.\r
+                                \r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_USB_HC_PROTOCOL_GET_ROOTHUB_PORT_STATUS) (\r
+  IN EFI_USB_HC_PROTOCOL     *This,\r
+  IN  UINT8                  PortNumber,\r
+  OUT EFI_USB_PORT_STATUS    *PortStatus\r
+  );\r
+\r
+/**                                                                 \r
+  Sets a feature for the specified root hub port.\r
+    \r
+  @param  This                  A pointer to the EFI_USB_HC_PROTOCOL instance.\r
+  @param  PortNumber            Specifies the root hub port from which the status is to be retrieved.\r
+                                This value is zero based.\r
+  @param  PortFeature           Indicates the feature selector associated with the feature set\r
+                                request.\r
+                                \r
+  @retval EFI_SUCCESS           The feature specified by PortFeature was set for the USB\r
+                                root hub port specified by PortNumber.                  \r
+  @retval EFI_INVALID_PARAMETER PortNumber is invalid or PortFeature is invalid for this function.\r
+                                \r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_USB_HC_PROTOCOL_SET_ROOTHUB_PORT_FEATURE) (\r
+  IN EFI_USB_HC_PROTOCOL     *This,\r
+  IN UINT8                   PortNumber,\r
+  IN EFI_USB_PORT_FEATURE    PortFeature\r
+  );\r
+\r
+/**                                                                 \r
+  Clears a feature for the specified root hub port.\r
+    \r
+  @param  This                  A pointer to the EFI_USB_HC_PROTOCOL instance.\r
+  @param  PortNumber            Specifies the root hub port from which the status is to be cleared.\r
+                                This value is zero based.\r
+  @param  PortFeature           Indicates the feature selector associated with the feature clear\r
+                                request.\r
+                                \r
+  @retval EFI_SUCCESS           The feature specified by PortFeature was cleared for the USB\r
+                                root hub port specified by PortNumber.                  \r
+  @retval EFI_INVALID_PARAMETER PortNumber is invalid or PortFeature is invalid for this function.\r
+                                \r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_USB_HC_PROTOCOL_CLEAR_ROOTHUB_PORT_FEATURE) (\r
+  IN EFI_USB_HC_PROTOCOL     *This,\r
+  IN UINT8                   PortNumber,\r
+  IN EFI_USB_PORT_FEATURE    PortFeature\r
+  );\r
+\r
+struct _EFI_USB_HC_PROTOCOL {\r
+  EFI_USB_HC_PROTOCOL_RESET                       Reset;\r
+  EFI_USB_HC_PROTOCOL_GET_STATE                   GetState;\r
+  EFI_USB_HC_PROTOCOL_SET_STATE                   SetState;\r
+  EFI_USB_HC_PROTOCOL_CONTROL_TRANSFER            ControlTransfer;\r
+  EFI_USB_HC_PROTOCOL_BULK_TRANSFER               BulkTransfer;\r
+  EFI_USB_HC_PROTOCOL_ASYNC_INTERRUPT_TRANSFER    AsyncInterruptTransfer;\r
+  EFI_USB_HC_PROTOCOL_SYNC_INTERRUPT_TRANSFER     SyncInterruptTransfer;\r
+  EFI_USB_HC_PROTOCOL_ISOCHRONOUS_TRANSFER        IsochronousTransfer;\r
+  EFI_USB_HC_PROTOCOL_ASYNC_ISOCHRONOUS_TRANSFER  AsyncIsochronousTransfer;\r
+  EFI_USB_HC_PROTOCOL_GET_ROOTHUB_PORT_NUMBER     GetRootHubPortNumber;\r
+  EFI_USB_HC_PROTOCOL_GET_ROOTHUB_PORT_STATUS     GetRootHubPortStatus;\r
+  EFI_USB_HC_PROTOCOL_SET_ROOTHUB_PORT_FEATURE    SetRootHubPortFeature;\r
+  EFI_USB_HC_PROTOCOL_CLEAR_ROOTHUB_PORT_FEATURE  ClearRootHubPortFeature;\r
+  UINT16                                          MajorRevision;\r
+  UINT16                                          MinorRevision;\r
+};\r
+\r
+extern EFI_GUID gEfiUsbHcProtocolGuid;\r
+\r
+#endif\r
diff --git a/Tools/Source/TianoTools/Include/Protocol/UsbIo.h b/Tools/Source/TianoTools/Include/Protocol/UsbIo.h
new file mode 100644 (file)
index 0000000..30309e3
--- /dev/null
@@ -0,0 +1,418 @@
+/** @file\r
+  EFI Usb I/O Protocol\r
+\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. This program and the accompanying materials                          \r
+  are licensed and made available under the terms and conditions of the BSD License         \r
+  which accompanies this distribution.  The full text of the license may be found at        \r
+  http://opensource.org/licenses/bsd-license.php                                            \r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+  Module Name:  UsbIo.h\r
+\r
+**/\r
+\r
+#ifndef __USB_IO_H__\r
+#define __USB_IO_H__\r
+\r
+//\r
+// Global ID for the USB I/O Protocol\r
+//\r
+#define EFI_USB_IO_PROTOCOL_GUID \\r
+  { \\r
+    0x2B2F68D6, 0x0CD2, 0x44cf, {0x8E, 0x8B, 0xBB, 0xA2, 0x0B, 0x1B, 0x5B, 0x75 } \\r
+  }\r
+\r
+typedef struct _EFI_USB_IO_PROTOCOL   EFI_USB_IO_PROTOCOL;\r
+\r
+/**                                                                 \r
+  Async USB transfer callback routine.\r
+    \r
+  @param  Data                  Data received or sent via the USB Asynchronous Transfer, if the\r
+                                transfer completed successfully.                               \r
+  @param  DataLength            The length of Data received or sent via the Asynchronous\r
+                                Transfer, if transfer successfully completes.                                           \r
+  @param  Context               Data passed from UsbAsyncInterruptTransfer() request.\r
+  @param  Status                Indicates the result of the asynchronous transfer.\r
+                                \r
+  @retval EFI_SUCCESS           The asynchronous USB transfer request has been successfully executed.  \r
+  @retval EFI_DEVICE_ERROR      The asynchronous USB transfer request failed.\r
+                                   \r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_ASYNC_USB_TRANSFER_CALLBACK) (\r
+  IN VOID         *Data,\r
+  IN UINTN        DataLength,\r
+  IN VOID         *Context,\r
+  IN UINT32       Status\r
+  );\r
+\r
+//\r
+// Prototype for EFI USB I/O protocol\r
+//\r
+\r
+\r
+/**                                                                 \r
+  This function is used to manage a USB device with a control transfer pipe. A control transfer is\r
+  typically used to perform device initialization and configuration.                              \r
+    \r
+  @param  This                  A pointer to the EFI_USB_IO_PROTOCOL instance.                                \r
+  @param  Request               A pointer to the USB device request that will be sent to the USB\r
+                                device.                                                         \r
+  @param  Direction             Indicates the data direction.\r
+  @param  Data                  A pointer to the buffer of data that will be transmitted to USB\r
+                                device or received from USB device.                            \r
+  @param  Timeout               Indicating the transfer should be completed within this time frame.\r
+                                The units are in milliseconds.                                       \r
+  @param  DataLength            The size, in bytes, of the data buffer specified by Data.\r
+  @param  Status                A pointer to the result of the USB transfer.\r
+                                \r
+  @retval EFI_SUCCESS           The control transfer has been successfully executed.\r
+  @retval EFI_DEVICE_ERROR      The transfer failed. The transfer status is returned in Status.\r
+  @retval EFI_INVALID_PARAMETE  One or more parameters are invalid.\r
+  @retval EFI_OUT_OF_RESOURCES  The request could not be completed due to a lack of resources.\r
+  @retval EFI_TIMEOUT           The control transfer fails due to timeout.\r
+                                   \r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_USB_IO_CONTROL_TRANSFER) (\r
+  IN EFI_USB_IO_PROTOCOL                        *This,\r
+  IN EFI_USB_DEVICE_REQUEST                     *Request,\r
+  IN EFI_USB_DATA_DIRECTION                     Direction,\r
+  IN UINT32                                     Timeout,\r
+  IN OUT VOID                                   *Data OPTIONAL,\r
+  IN UINTN                                      DataLength  OPTIONAL,\r
+  OUT UINT32                                    *Status\r
+  );\r
+\r
+/**                                                                 \r
+  This function is used to manage a USB device with the bulk transfer pipe. Bulk Transfers are\r
+  typically used to transfer large amounts of data to/from USB devices.\r
+    \r
+  @param  This                  A pointer to the EFI_USB_IO_PROTOCOL instance.                                \r
+  @param  DeviceEndpoint        A pointer to the USB device request that will be sent to the USB\r
+                                device.                                                         \r
+  @param  Data                  A pointer to the buffer of data that will be transmitted to USB\r
+                                device or received from USB device.                            \r
+  @param  DataLength            The size, in bytes, of the data buffer specified by Data.\r
+  @param  Timeout               Indicating the transfer should be completed within this time frame.\r
+                                The units are in milliseconds.                                           \r
+  @param  Status                This parameter indicates the USB transfer status.\r
+                                \r
+  @retval EFI_SUCCESS           The bulk transfer has been successfully executed.\r
+  @retval EFI_DEVICE_ERROR      The transfer failed. The transfer status is returned in Status.\r
+  @retval EFI_INVALID_PARAMETE  One or more parameters are invalid.\r
+  @retval EFI_OUT_OF_RESOURCES  The request could not be submitted due to a lack of resources.\r
+  @retval EFI_TIMEOUT           The control transfer fails due to timeout.\r
+                                   \r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_USB_IO_BULK_TRANSFER) (\r
+  IN EFI_USB_IO_PROTOCOL            *This,\r
+  IN UINT8                          DeviceEndpoint,\r
+  IN OUT VOID                       *Data,\r
+  IN OUT UINTN                      *DataLength,\r
+  IN UINTN                          Timeout,\r
+  OUT UINT32                        *Status\r
+  );\r
+\r
+/**                                                                 \r
+  This function is used to manage a USB device with an interrupt transfer pipe. An Asynchronous   \r
+  Interrupt Transfer is typically used to query a device¡¯s status at a fixed rate. For example,  \r
+  keyboard, mouse, and hub devices use this type of transfer to query their interrupt endpoints at\r
+  a fixed rate.                                                                                   \r
+    \r
+  @param  This                  A pointer to the EFI_USB_IO_PROTOCOL instance.                                \r
+  @param  DeviceEndpoint        A pointer to the USB device request that will be sent to the USB\r
+                                device.                                                         \r
+  @param  IsNewTransfer         If TRUE, a new transfer will be submitted to USB controller. If                             \r
+                                FALSE, the interrupt transfer is deleted from the device¡¯s interrupt\r
+                                transfer queue.                                                      \r
+  @param  PollingInterval       Indicates the periodic rate, in milliseconds, that the transfer is to be                        \r
+                                executed.                                                                 \r
+  @param  DataLength            Specifies the length, in bytes, of the data to be received from the\r
+                                USB device.                                                        \r
+  @param  Context               Data passed to the InterruptCallback function.\r
+  @param  InterruptCallback     The Callback function. This function is called if the asynchronous\r
+                                interrupt transfer is completed.\r
+                                \r
+  @retval EFI_SUCCESS           The asynchronous USB transfer request transfer has been successfully executed.\r
+  @retval EFI_DEVICE_ERROR      The asynchronous USB transfer request failed.   \r
+                                   \r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_USB_IO_ASYNC_INTERRUPT_TRANSFER) (\r
+  IN EFI_USB_IO_PROTOCOL                                 *This,\r
+  IN UINT8                                               DeviceEndpoint,\r
+  IN BOOLEAN                                             IsNewTransfer,\r
+  IN UINTN                                               PollingInterval    OPTIONAL,\r
+  IN UINTN                                               DataLength         OPTIONAL,\r
+  IN EFI_ASYNC_USB_TRANSFER_CALLBACK                     InterruptCallBack  OPTIONAL,\r
+  IN VOID                                                *Context OPTIONAL\r
+  );\r
+\r
+/**                                                                 \r
+  This function is used to manage a USB device with an interrupt transfer pipe.\r
+    \r
+  @param  This                  A pointer to the EFI_USB_IO_PROTOCOL instance.                                \r
+  @param  DeviceEndpoint        A pointer to the USB device request that will be sent to the USB\r
+                                device.                                                         \r
+  @param  Data                  A pointer to the buffer of data that will be transmitted to USB\r
+                                device or received from USB device.                            \r
+  @param  DataLength            On input, then size, in bytes, of the buffer Data. On output, the\r
+                                amount of data actually transferred.                             \r
+  @param  Timeout               The time out, in seconds, for this transfer.\r
+  @param  Status                This parameter indicates the USB transfer status.                                \r
+                                \r
+  @retval EFI_SUCCESS           The sync interrupt transfer has been successfully executed.\r
+  @retval EFI_INVALID_PARAMETER One or more parameters are invalid.\r
+  @retval EFI_DEVICE_ERROR      The sync interrupt transfer request failed.   \r
+  @retval EFI_OUT_OF_RESOURCES  The request could not be submitted due to a lack of resources.\r
+  @retval EFI_TIMEOUT           The transfer fails due to timeout.                                                       \r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_USB_IO_SYNC_INTERRUPT_TRANSFER) (\r
+  IN EFI_USB_IO_PROTOCOL            *This,\r
+  IN     UINT8                      DeviceEndpoint,\r
+  IN OUT VOID                       *Data,\r
+  IN OUT UINTN                      *DataLength,\r
+  IN     UINTN                      Timeout,\r
+  OUT    UINT32                     *Status\r
+  );\r
+\r
+/**                                                                 \r
+  This function is used to manage a USB device with an isochronous transfer pipe. An Isochronous\r
+  transfer is typically used to transfer streaming data.\r
+    \r
+  @param  This                  A pointer to the EFI_USB_IO_PROTOCOL instance.                                \r
+  @param  DeviceEndpoint        A pointer to the USB device request that will be sent to the USB\r
+                                device.                                                         \r
+  @param  Data                  A pointer to the buffer of data that will be transmitted to USB\r
+                                device or received from USB device.                            \r
+  @param  DataLength            The size, in bytes, of the data buffer specified by Data.                                         \r
+  @param  Status                This parameter indicates the USB transfer status.                                \r
+                                \r
+  @retval EFI_SUCCESS           The isochronous transfer has been successfully executed.\r
+  @retval EFI_INVALID_PARAMETER The parameter DeviceEndpoint is not valid.\r
+  @retval EFI_DEVICE_ERROR      The transfer failed due to the reason other than timeout, The error status\r
+                                is returned in Status.                                                    \r
+  @retval EFI_OUT_OF_RESOURCES  The request could not be submitted due to a lack of resources.\r
+  @retval EFI_TIMEOUT           The transfer fails due to timeout.                                                       \r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_USB_IO_ISOCHRONOUS_TRANSFER) (\r
+  IN EFI_USB_IO_PROTOCOL            *This,\r
+  IN     UINT8                      DeviceEndpoint,\r
+  IN OUT VOID                       *Data,\r
+  IN     UINTN                      DataLength,\r
+  OUT    UINT32                     *Status\r
+  );\r
+\r
+/**                                                                 \r
+  This function is used to manage a USB device with an isochronous transfer pipe. An Isochronous\r
+  transfer is typically used to transfer streaming data.                                      \r
+    \r
+  @param  This                  A pointer to the EFI_USB_IO_PROTOCOL instance.                                \r
+  @param  DeviceEndpoint        A pointer to the USB device request that will be sent to the USB\r
+                                device.                                                         \r
+  @param  Data                  A pointer to the buffer of data that will be transmitted to USB\r
+                                device or received from USB device.                            \r
+  @param  DataLength            The size, in bytes, of the data buffer specified by Data.                                         \r
+  @param  Context               Data passed to the IsochronousCallback() function.\r
+  @param  IsochronousCallback   The IsochronousCallback() function.\r
+                                \r
+  @retval EFI_SUCCESS           The asynchronous isochronous transfer has been successfully submitted\r
+                                to the system.\r
+  @retval EFI_INVALID_PARAMETER The parameter DeviceEndpoint is not valid.\r
+  @retval EFI_OUT_OF_RESOURCES  The request could not be submitted due to a lack of resources.\r
+                                           \r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_USB_IO_ASYNC_ISOCHRONOUS_TRANSFER) (\r
+  IN EFI_USB_IO_PROTOCOL              *This,\r
+  IN UINT8                            DeviceEndpoint,\r
+  IN OUT VOID                         *Data,\r
+  IN     UINTN                        DataLength,\r
+  IN EFI_ASYNC_USB_TRANSFER_CALLBACK  IsochronousCallBack,\r
+  IN VOID                             *Context OPTIONAL\r
+  );\r
+\r
+/**                                                                 \r
+  Resets and reconfigures the USB controller. This function will work for all USB devices except\r
+  USB Hub Controllers.                                                                          \r
+    \r
+  @param  This                  A pointer to the EFI_USB_IO_PROTOCOL instance.                                  \r
+                                \r
+  @retval EFI_SUCCESS           The USB controller was reset.                                \r
+  @retval EFI_INVALID_PARAMETER If the controller specified by This is a USB hub.\r
+  @retval EFI_DEVICE_ERROR      An error occurred during the reconfiguration process.\r
+                                           \r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_USB_IO_PORT_RESET) (\r
+  IN EFI_USB_IO_PROTOCOL    *This\r
+  );\r
+\r
+/**                                                                 \r
+  Retrieves the USB Device Descriptor.\r
+    \r
+  @param  This                  A pointer to the EFI_USB_IO_PROTOCOL instance.                                  \r
+  @param  DeviceDescriptor      A pointer to the caller allocated USB Device Descriptor.\r
+                                \r
+  @retval EFI_SUCCESS           The device descriptor was retrieved successfully.\r
+  @retval EFI_INVALID_PARAMETER DeviceDescriptor is NULL.\r
+  @retval EFI_NOT_FOUND         The device descriptor was not found. The device may not be configured.\r
+                                           \r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_USB_IO_GET_DEVICE_DESCRIPTOR) (\r
+  IN EFI_USB_IO_PROTOCOL            *This,\r
+  OUT EFI_USB_DEVICE_DESCRIPTOR     *DeviceDescriptor\r
+  );\r
+\r
+/**                                                                 \r
+  Retrieves the USB Device Descriptor.\r
+    \r
+  @param  This                    A pointer to the EFI_USB_IO_PROTOCOL instance.                                  \r
+  @param  ConfigurationDescriptor A pointer to the caller allocated USB Active Configuration\r
+                                  Descriptor.                                               \r
+  @retval EFI_SUCCESS             The active configuration descriptor was retrieved successfully.\r
+  @retval EFI_INVALID_PARAMETER   ConfigurationDescriptor is NULL.\r
+  @retval EFI_NOT_FOUND           An active configuration descriptor cannot be found. The device may not\r
+                                  be configured.                                                        \r
+                                           \r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_USB_IO_GET_CONFIG_DESCRIPTOR) (\r
+  IN EFI_USB_IO_PROTOCOL            *This,\r
+  OUT EFI_USB_CONFIG_DESCRIPTOR     *ConfigurationDescriptor\r
+  );\r
+\r
+/**                                                                 \r
+  Retrieves the Interface Descriptor for a USB Device Controller. As stated earlier, an interface\r
+  within a USB device is equivalently to a USB Controller within the current configuration.      \r
+    \r
+  @param  This                    A pointer to the EFI_USB_IO_PROTOCOL instance.                                  \r
+  @param  InterfaceDescriptor     A pointer to the caller allocated USB Interface Descriptor within\r
+                                  the configuration setting.                                       \r
+  @retval EFI_SUCCESS             The interface descriptor retrieved successfully.\r
+  @retval EFI_INVALID_PARAMETER   InterfaceDescriptor is NULL.\r
+  @retval EFI_NOT_FOUND           The interface descriptor cannot be found. The device may not be\r
+                                  correctly configured.                                          \r
+                                           \r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_USB_IO_GET_INTERFACE_DESCRIPTOR) (\r
+  IN EFI_USB_IO_PROTOCOL            *This,\r
+  OUT EFI_USB_INTERFACE_DESCRIPTOR  *InterfaceDescriptor\r
+  );\r
+\r
+/**                                                                 \r
+  Retrieves an Endpoint Descriptor within a USB Controller.\r
+    \r
+  @param  This                    A pointer to the EFI_USB_IO_PROTOCOL instance.                                  \r
+  @param  EndpointIndex           Indicates which endpoint descriptor to retrieve.\r
+  @param  EndpointDescriptor      A pointer to the caller allocated USB Endpoint Descriptor of\r
+                                  a USB controller.                                           \r
+                                                    \r
+  @retval EFI_SUCCESS             The endpoint descriptor was retrieved successfully.\r
+  @retval EFI_INVALID_PARAMETER   One or more parameters are invalid.\r
+  @retval EFI_NOT_FOUND           The endpoint descriptor cannot be found. The device may not be\r
+                                  correctly configured.                                         \r
+                                           \r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_USB_IO_GET_ENDPOINT_DESCRIPTOR) (\r
+  IN EFI_USB_IO_PROTOCOL            *This,\r
+  IN  UINT8                         EndpointIndex,\r
+  OUT EFI_USB_ENDPOINT_DESCRIPTOR   *EndpointDescriptor\r
+  );\r
+\r
+/**                                                                 \r
+  Retrieves a Unicode string stored in a USB Device.\r
+    \r
+  @param  This                    A pointer to the EFI_USB_IO_PROTOCOL instance.                                  \r
+  @param  LangID                  The Language ID for the string being retrieved.\r
+  @param  StringID                The ID of the string being retrieved.                                                         \r
+  @param  String                  A pointer to a buffer allocated by this function with                \r
+                                  AllocatePool() to store the string.\r
+                                                    \r
+  @retval EFI_SUCCESS             The string was retrieved successfully.  \r
+  @retval EFI_NOT_FOUND           The string specified by LangID and StringID was not found.                                      \r
+  @retval EFI_OUT_OF_RESOURCES    There are not enough resources to allocate the return buffer String.\r
+                                           \r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_USB_IO_GET_STRING_DESCRIPTOR) (\r
+  IN EFI_USB_IO_PROTOCOL            *This,\r
+  IN  UINT16                        LangID,\r
+  IN  UINT8                         StringID,\r
+  OUT CHAR16                        **String\r
+  );\r
+\r
+/**                                                                 \r
+  Retrieves all the language ID codes that the USB device supports.\r
+    \r
+  @param  This                    A pointer to the EFI_USB_IO_PROTOCOL instance.                                  \r
+  @param  LangIDTable             Language ID for the string the caller wants to get.\r
+  @param  TableSize               The size, in bytes, of the table LangIDTable.\r
+                                                    \r
+  @retval EFI_SUCCESS             The support languages were retrieved successfully.  \r
+                                           \r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_USB_IO_GET_SUPPORTED_LANGUAGE) (\r
+  IN EFI_USB_IO_PROTOCOL            *This,\r
+  OUT UINT16                        **LangIDTable,\r
+  OUT UINT16                        *TableSize\r
+  );\r
+\r
+//\r
+//  Protocol Interface Structure\r
+//\r
+struct _EFI_USB_IO_PROTOCOL {\r
+  //\r
+  // IO transfer\r
+  //\r
+  EFI_USB_IO_CONTROL_TRANSFER           UsbControlTransfer;\r
+  EFI_USB_IO_BULK_TRANSFER              UsbBulkTransfer;\r
+  EFI_USB_IO_ASYNC_INTERRUPT_TRANSFER   UsbAsyncInterruptTransfer;\r
+  EFI_USB_IO_SYNC_INTERRUPT_TRANSFER    UsbSyncInterruptTransfer;\r
+  EFI_USB_IO_ISOCHRONOUS_TRANSFER       UsbIsochronousTransfer;\r
+  EFI_USB_IO_ASYNC_ISOCHRONOUS_TRANSFER UsbAsyncIsochronousTransfer;\r
+\r
+  //\r
+  // Common device request\r
+  //\r
+  EFI_USB_IO_GET_DEVICE_DESCRIPTOR      UsbGetDeviceDescriptor;\r
+  EFI_USB_IO_GET_CONFIG_DESCRIPTOR      UsbGetConfigDescriptor;\r
+  EFI_USB_IO_GET_INTERFACE_DESCRIPTOR   UsbGetInterfaceDescriptor;\r
+  EFI_USB_IO_GET_ENDPOINT_DESCRIPTOR    UsbGetEndpointDescriptor;\r
+  EFI_USB_IO_GET_STRING_DESCRIPTOR      UsbGetStringDescriptor;\r
+  EFI_USB_IO_GET_SUPPORTED_LANGUAGE     UsbGetSupportedLanguages;\r
+\r
+  //\r
+  // Reset controller's parent port\r
+  //\r
+  EFI_USB_IO_PORT_RESET                 UsbPortReset;\r
+};\r
+\r
+extern EFI_GUID gEfiUsbIoProtocolGuid;\r
+\r
+#endif\r
diff --git a/Tools/Source/TianoTools/Include/ToBeRemoved/Variable.h b/Tools/Source/TianoTools/Include/ToBeRemoved/Variable.h
new file mode 100644 (file)
index 0000000..bc0d640
--- /dev/null
@@ -0,0 +1,78 @@
+/*++\r
+\r
+Copyright (c) 2006, Intel Corporation                                                         \r
+All rights reserved. This program and the accompanying materials                          \r
+are licensed and made available under the terms and conditions of the BSD License         \r
+which accompanies this distribution.  The full text of the license may be found at        \r
+http://opensource.org/licenses/bsd-license.php                                            \r
+                                                                                          \r
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+Module Name:\r
+\r
+  EfiVariable.h\r
+  \r
+Abstract:\r
+  \r
+  Header file for EFI Variable Services\r
+\r
+--*/\r
+\r
+#ifndef _EFI_VARIABLE_H_\r
+#define _EFI_VARIABLE_H_\r
+\r
+#define VARIABLE_STORE_SIGNATURE  EFI_SIGNATURE_32 ('$', 'V', 'S', 'S')\r
+\r
+#define MAX_VARIABLE_SIZE         1024\r
+\r
+#define VARIABLE_DATA             0x55AA\r
+\r
+//\r
+// Variable Store Header flags\r
+//\r
+#define VARIABLE_STORE_FORMATTED  0x5a\r
+#define VARIABLE_STORE_HEALTHY    0xfe\r
+\r
+//\r
+// Variable Store Status\r
+//\r
+typedef enum {\r
+  EfiRaw,\r
+  EfiValid,\r
+  EfiInvalid,\r
+  EfiUnknown\r
+} VARIABLE_STORE_STATUS;\r
+\r
+//\r
+// Variable State flags\r
+//\r
+#define VAR_IN_DELETED_TRANSITION     0xfe  // Variable is in obsolete transistion\r
+#define VAR_DELETED                   0xfd  // Variable is obsolete\r
+#define VAR_ADDED                     0x7f  // Variable has been completely added\r
+#define IS_VARIABLE_STATE(_c, _Mask)  (BOOLEAN) (((~_c) & (~_Mask)) != 0)\r
+\r
+#pragma pack(1)\r
+\r
+typedef struct {\r
+  UINT32  Signature;\r
+  UINT32  Size;\r
+  UINT8   Format;\r
+  UINT8   State;\r
+  UINT16  Reserved;\r
+  UINT32  Reserved1;\r
+} VARIABLE_STORE_HEADER;\r
+\r
+typedef struct {\r
+  UINT16    StartId;\r
+  UINT8     State;\r
+  UINT8     Reserved;\r
+  UINT32    Attributes;\r
+  UINTN     NameSize;\r
+  UINTN     DataSize;\r
+  EFI_GUID  VendorGuid;\r
+} VARIABLE_HEADER;\r
+\r
+#pragma pack()\r
+\r
+#endif // _EFI_VARIABLE_H_\r
diff --git a/Tools/Source/TianoTools/Include/ToBeRemoved/WorkingBlockHeader.h b/Tools/Source/TianoTools/Include/ToBeRemoved/WorkingBlockHeader.h
new file mode 100644 (file)
index 0000000..235b740
--- /dev/null
@@ -0,0 +1,47 @@
+/*++\r
+\r
+Copyright (c) 2006, Intel Corporation                                                         \r
+All rights reserved. This program and the accompanying materials                          \r
+are licensed and made available under the terms and conditions of the BSD License         \r
+which accompanies this distribution.  The full text of the license may be found at        \r
+http://opensource.org/licenses/bsd-license.php                                            \r
+                                                                                          \r
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+Module Name:\r
+\r
+  EfiWorkingBlockHeader.h\r
+\r
+Abstract:\r
+\r
+  Defines data structure that is the headers found at the runtime \r
+  updatable firmware volumes, such as the FileSystemGuid of the \r
+  working block, the header structure of the variable block, FTW\r
+  working block, or event log block.\r
+\r
+--*/\r
+\r
+#ifndef _EFI_WORKING_BLOCK_HEADER_H_\r
+#define _EFI_WORKING_BLOCK_HEADER_H_\r
+\r
+//\r
+// EFI Fault tolerant working block header\r
+// The header is immediately followed by the write queue.\r
+//\r
+typedef struct {\r
+  EFI_GUID  Signature;\r
+  UINT32    Crc;\r
+  UINT32    WorkingBlockValid : 1;\r
+  UINT32    WorkingBlockInvalid : 1;\r
+#define WORKING_BLOCK_VALID   0x1\r
+#define WORKING_BLOCK_INVALID 0x2\r
+  UINT32    Reserved : 6;\r
+  UINT8     Reserved3[3];\r
+  UINTN     WriteQueueSize;\r
+  //\r
+  // UINT8                WriteQueue[WriteQueueSize];\r
+  //\r
+} EFI_FAULT_TOLERANT_WORKING_BLOCK_HEADER;\r
+\r
+#endif\r
diff --git a/Tools/Source/TianoTools/Include/Uefi/EfiPxe.h b/Tools/Source/TianoTools/Include/Uefi/EfiPxe.h
new file mode 100644 (file)
index 0000000..eadac3c
--- /dev/null
@@ -0,0 +1,1780 @@
+/** @file\r
+  This header file contains all of the PXE type definitions,\r
+  structure prototypes, global variables and constants that\r
+  are needed for porting PXE to EFI.\r
+  \r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. This program and the accompanying materials                          \r
+  are licensed and made available under the terms and conditions of the BSD License         \r
+  which accompanies this distribution.  The full text of the license may be found at        \r
+  http://opensource.org/licenses/bsd-license.php                                            \r
+  \r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+  \r
+  Module name: EfiPxe.h\r
+  \r
+  @par Revision Reference:\r
+  32/64-bit PXE specification:\r
+  alpha-4, 99-Dec-17\r
+  \r
+**/\r
+\r
+#ifndef __EFI_PXE_H__\r
+#define __EFI_PXE_H__\r
+\r
+#pragma pack(1)\r
+\r
+\r
+\r
+#define PXE_BUSTYPE(a, b, c, d) \\r
+    ( \\r
+      (((PXE_UINT32) (d) & 0xFF) << 24) | (((PXE_UINT32) (c) & 0xFF) << 16) | (((PXE_UINT32) (b) & 0xFF) << 8) | \\r
+        ((PXE_UINT32) (a) & 0xFF) \\r
+    )\r
+\r
+//\r
+// UNDI ROM ID and devive ID signature\r
+//\r
+#define PXE_BUSTYPE_PXE PXE_BUSTYPE ('!', 'P', 'X', 'E')\r
+\r
+//\r
+// BUS ROM ID signatures\r
+//\r
+#define PXE_BUSTYPE_PCI     PXE_BUSTYPE ('P', 'C', 'I', 'R')\r
+#define PXE_BUSTYPE_PC_CARD PXE_BUSTYPE ('P', 'C', 'C', 'R')\r
+#define PXE_BUSTYPE_USB     PXE_BUSTYPE ('U', 'S', 'B', 'R')\r
+#define PXE_BUSTYPE_1394    PXE_BUSTYPE ('1', '3', '9', '4')\r
+\r
+#define PXE_SWAP_UINT16(n)  ((((PXE_UINT16) (n) & 0x00FF) << 8) | (((PXE_UINT16) (n) & 0xFF00) >> 8))\r
+\r
+#define PXE_SWAP_UINT32(n) \\r
+  ((((PXE_UINT32)(n) & 0x000000FF) << 24) | \\r
+   (((PXE_UINT32)(n) & 0x0000FF00) << 8)  | \\r
+   (((PXE_UINT32)(n) & 0x00FF0000) >> 8)  | \\r
+   (((PXE_UINT32)(n) & 0xFF000000) >> 24))\r
+\r
+#define PXE_SWAP_UINT64(n) \\r
+  ((((PXE_UINT64)(n) & 0x00000000000000FFULL) << 56) | \\r
+   (((PXE_UINT64)(n) & 0x000000000000FF00ULL) << 40) | \\r
+   (((PXE_UINT64)(n) & 0x0000000000FF0000ULL) << 24) | \\r
+   (((PXE_UINT64)(n) & 0x00000000FF000000ULL) << 8)  | \\r
+   (((PXE_UINT64)(n) & 0x000000FF00000000ULL) >> 8)  | \\r
+   (((PXE_UINT64)(n) & 0x0000FF0000000000ULL) >> 24) | \\r
+   (((PXE_UINT64)(n) & 0x00FF000000000000ULL) >> 40) | \\r
+   (((PXE_UINT64)(n) & 0xFF00000000000000ULL) >> 56))\r
+\r
+\r
+#define PXE_CPBSIZE_NOT_USED  0               // zero\r
+#define PXE_DBSIZE_NOT_USED   0               // zero\r
+#define PXE_CPBADDR_NOT_USED  (PXE_UINT64) 0  // zero\r
+#define PXE_DBADDR_NOT_USED   (PXE_UINT64) 0  // zero\r
+#define PXE_CONST             const\r
+\r
+#define PXE_VOLATILE          volatile\r
+\r
+typedef VOID           PXE_VOID;\r
+typedef UINT8          PXE_UINT8;\r
+typedef UINT16         PXE_UINT16;\r
+typedef UINT32         PXE_UINT32;\r
+typedef UINTN          PXE_UINTN;\r
\r
+//\r
+// typedef unsigned long PXE_UINT64;\r
+//\r
+typedef UINT64      PXE_UINT64;\r
+\r
+typedef PXE_UINT8 PXE_BOOL;\r
+#define PXE_FALSE 0 // zero\r
+#define PXE_TRUE  (!PXE_FALSE)\r
+\r
+typedef PXE_UINT16      PXE_OPCODE;\r
+\r
+//\r
+// Return UNDI operational state.\r
+//\r
+#define PXE_OPCODE_GET_STATE  0x0000\r
+\r
+//\r
+// Change UNDI operational state from Stopped to Started.\r
+//\r
+#define PXE_OPCODE_START  0x0001\r
+\r
+//\r
+// Change UNDI operational state from Started to Stopped.\r
+//\r
+#define PXE_OPCODE_STOP 0x0002\r
+\r
+//\r
+// Get UNDI initialization information.\r
+//\r
+#define PXE_OPCODE_GET_INIT_INFO  0x0003\r
+\r
+//\r
+// Get NIC configuration information.\r
+//\r
+#define PXE_OPCODE_GET_CONFIG_INFO  0x0004\r
+\r
+//\r
+// Changed UNDI operational state from Started to Initialized.\r
+//\r
+#define PXE_OPCODE_INITIALIZE 0x0005\r
+\r
+//\r
+// Re-initialize the NIC H/W.\r
+//\r
+#define PXE_OPCODE_RESET  0x0006\r
+\r
+//\r
+// Change the UNDI operational state from Initialized to Started.\r
+//\r
+#define PXE_OPCODE_SHUTDOWN 0x0007\r
+\r
+//\r
+// Read & change state of external interrupt enables.\r
+//\r
+#define PXE_OPCODE_INTERRUPT_ENABLES  0x0008\r
+\r
+//\r
+// Read & change state of packet receive filters.\r
+//\r
+#define PXE_OPCODE_RECEIVE_FILTERS  0x0009\r
+\r
+//\r
+// Read & change station MAC address.\r
+//\r
+#define PXE_OPCODE_STATION_ADDRESS  0x000A\r
+\r
+//\r
+// Read traffic statistics.\r
+//\r
+#define PXE_OPCODE_STATISTICS 0x000B\r
+\r
+//\r
+// Convert multicast IP address to multicast MAC address.\r
+//\r
+#define PXE_OPCODE_MCAST_IP_TO_MAC  0x000C\r
+\r
+//\r
+// Read or change non-volatile storage on the NIC.\r
+//\r
+#define PXE_OPCODE_NVDATA 0x000D\r
+\r
+//\r
+// Get & clear interrupt status.\r
+//\r
+#define PXE_OPCODE_GET_STATUS 0x000E\r
+\r
+//\r
+// Fill media header in packet for transmit.\r
+//\r
+#define PXE_OPCODE_FILL_HEADER  0x000F\r
+\r
+//\r
+// Transmit packet(s).\r
+//\r
+#define PXE_OPCODE_TRANSMIT 0x0010\r
+\r
+//\r
+// Receive packet.\r
+//\r
+#define PXE_OPCODE_RECEIVE  0x0011\r
+\r
+//\r
+// Last valid PXE UNDI OpCode number.\r
+//\r
+#define PXE_OPCODE_LAST_VALID 0x0011\r
+\r
+typedef PXE_UINT16  PXE_OPFLAGS;\r
+\r
+#define PXE_OPFLAGS_NOT_USED  0x0000\r
+\r
+//\r
+// //////////////////////////////////////\r
+// UNDI Get State\r
+//\r
+// No OpFlags\r
+\r
+////////////////////////////////////////\r
+// UNDI Start\r
+//\r
+// No OpFlags\r
+\r
+////////////////////////////////////////\r
+// UNDI Stop\r
+//\r
+// No OpFlags\r
+\r
+////////////////////////////////////////\r
+// UNDI Get Init Info\r
+//\r
+// No Opflags\r
+\r
+////////////////////////////////////////\r
+// UNDI Get Config Info\r
+//\r
+// No Opflags\r
+\r
+////////////////////////////////////////\r
+// UNDI Initialize\r
+//\r
+#define PXE_OPFLAGS_INITIALIZE_CABLE_DETECT_MASK    0x0001\r
+#define PXE_OPFLAGS_INITIALIZE_DETECT_CABLE         0x0000\r
+#define PXE_OPFLAGS_INITIALIZE_DO_NOT_DETECT_CABLE  0x0001\r
+\r
+//\r
+// //////////////////////////////////////\r
+// UNDI Reset\r
+//\r
+#define PXE_OPFLAGS_RESET_DISABLE_INTERRUPTS  0x0001\r
+#define PXE_OPFLAGS_RESET_DISABLE_FILTERS     0x0002\r
+\r
+//\r
+// //////////////////////////////////////\r
+// UNDI Shutdown\r
+//\r
+// No OpFlags\r
+\r
+////////////////////////////////////////\r
+// UNDI Interrupt Enables\r
+//\r
+//\r
+// Select whether to enable or disable external interrupt signals.\r
+// Setting both enable and disable will return PXE_STATCODE_INVALID_OPFLAGS.\r
+//\r
+#define PXE_OPFLAGS_INTERRUPT_OPMASK  0xC000\r
+#define PXE_OPFLAGS_INTERRUPT_ENABLE  0x8000\r
+#define PXE_OPFLAGS_INTERRUPT_DISABLE 0x4000\r
+#define PXE_OPFLAGS_INTERRUPT_READ    0x0000\r
+\r
+//\r
+// Enable receive interrupts.  An external interrupt will be generated\r
+// after a complete non-error packet has been received.\r
+//\r
+#define PXE_OPFLAGS_INTERRUPT_RECEIVE 0x0001\r
+\r
+//\r
+// Enable transmit interrupts.  An external interrupt will be generated\r
+// after a complete non-error packet has been transmitted.\r
+//\r
+#define PXE_OPFLAGS_INTERRUPT_TRANSMIT  0x0002\r
+\r
+//\r
+// Enable command interrupts.  An external interrupt will be generated\r
+// when command execution stops.\r
+//\r
+#define PXE_OPFLAGS_INTERRUPT_COMMAND 0x0004\r
+\r
+//\r
+// Generate software interrupt.  Setting this bit generates an external\r
+// interrupt, if it is supported by the hardware.\r
+//\r
+#define PXE_OPFLAGS_INTERRUPT_SOFTWARE  0x0008\r
+\r
+//\r
+// //////////////////////////////////////\r
+// UNDI Receive Filters\r
+//\r
+//\r
+// Select whether to enable or disable receive filters.\r
+// Setting both enable and disable will return PXE_STATCODE_INVALID_OPCODE.\r
+//\r
+#define PXE_OPFLAGS_RECEIVE_FILTER_OPMASK   0xC000\r
+#define PXE_OPFLAGS_RECEIVE_FILTER_ENABLE   0x8000\r
+#define PXE_OPFLAGS_RECEIVE_FILTER_DISABLE  0x4000\r
+#define PXE_OPFLAGS_RECEIVE_FILTER_READ     0x0000\r
+\r
+//\r
+// To reset the contents of the multicast MAC address filter list,\r
+// set this OpFlag:\r
+//\r
+#define PXE_OPFLAGS_RECEIVE_FILTER_RESET_MCAST_LIST 0x2000\r
+\r
+//\r
+// Enable unicast packet receiving.  Packets sent to the current station\r
+// MAC address will be received.\r
+//\r
+#define PXE_OPFLAGS_RECEIVE_FILTER_UNICAST  0x0001\r
+\r
+//\r
+// Enable broadcast packet receiving.  Packets sent to the broadcast\r
+// MAC address will be received.\r
+//\r
+#define PXE_OPFLAGS_RECEIVE_FILTER_BROADCAST  0x0002\r
+\r
+//\r
+// Enable filtered multicast packet receiving.  Packets sent to any\r
+// of the multicast MAC addresses in the multicast MAC address filter\r
+// list will be received.  If the filter list is empty, no multicast\r
+//\r
+#define PXE_OPFLAGS_RECEIVE_FILTER_FILTERED_MULTICAST 0x0004\r
+\r
+//\r
+// Enable promiscuous packet receiving.  All packets will be received.\r
+//\r
+#define PXE_OPFLAGS_RECEIVE_FILTER_PROMISCUOUS  0x0008\r
+\r
+//\r
+// Enable promiscuous multicast packet receiving.  All multicast\r
+// packets will be received.\r
+//\r
+#define PXE_OPFLAGS_RECEIVE_FILTER_ALL_MULTICAST  0x0010\r
+\r
+//\r
+// //////////////////////////////////////\r
+// UNDI Station Address\r
+//\r
+#define PXE_OPFLAGS_STATION_ADDRESS_READ   0x0000\r
+#define PXE_OPFLAGS_STATION_ADDRESS_WRITE  0x0000\r
+#define PXE_OPFLAGS_STATION_ADDRESS_RESET  0x0001\r
+\r
+//\r
+// //////////////////////////////////////\r
+// UNDI Statistics\r
+//\r
+#define PXE_OPFLAGS_STATISTICS_READ   0x0000\r
+#define PXE_OPFLAGS_STATISTICS_RESET  0x0001\r
+\r
+//\r
+// //////////////////////////////////////\r
+// UNDI MCast IP to MAC\r
+//\r
+//\r
+// Identify the type of IP address in the CPB.\r
+//\r
+#define PXE_OPFLAGS_MCAST_IP_TO_MAC_OPMASK  0x0003\r
+#define PXE_OPFLAGS_MCAST_IPV4_TO_MAC       0x0000\r
+#define PXE_OPFLAGS_MCAST_IPV6_TO_MAC       0x0001\r
+\r
+//\r
+// //////////////////////////////////////\r
+// UNDI NvData\r
+//\r
+//\r
+// Select the type of non-volatile data operation.\r
+//\r
+#define PXE_OPFLAGS_NVDATA_OPMASK 0x0001\r
+#define PXE_OPFLAGS_NVDATA_READ   0x0000\r
+#define PXE_OPFLAGS_NVDATA_WRITE  0x0001\r
+\r
+//\r
+// //////////////////////////////////////\r
+// UNDI Get Status\r
+//\r
+//\r
+// Return current interrupt status.  This will also clear any interrupts\r
+// that are currently set.  This can be used in a polling routine.  The\r
+// interrupt flags are still set and cleared even when the interrupts\r
+// are disabled.\r
+//\r
+#define PXE_OPFLAGS_GET_INTERRUPT_STATUS  0x0001\r
+\r
+//\r
+// Return list of transmitted buffers for recycling.  Transmit buffers\r
+// must not be changed or unallocated until they have recycled.  After\r
+// issuing a transmit command, wait for a transmit complete interrupt.\r
+// When a transmit complete interrupt is received, read the transmitted\r
+// buffers.  Do not plan on getting one buffer per interrupt.  Some\r
+// NICs and UNDIs may transmit multiple buffers per interrupt.\r
+//\r
+#define PXE_OPFLAGS_GET_TRANSMITTED_BUFFERS 0x0002\r
+\r
+//\r
+// //////////////////////////////////////\r
+// UNDI Fill Header\r
+//\r
+#define PXE_OPFLAGS_FILL_HEADER_OPMASK      0x0001\r
+#define PXE_OPFLAGS_FILL_HEADER_FRAGMENTED  0x0001\r
+#define PXE_OPFLAGS_FILL_HEADER_WHOLE       0x0000\r
+\r
+//\r
+// //////////////////////////////////////\r
+// UNDI Transmit\r
+//\r
+//\r
+// S/W UNDI only.  Return after the packet has been transmitted.  A\r
+// transmit complete interrupt will still be generated and the transmit\r
+// buffer will have to be recycled.\r
+//\r
+#define PXE_OPFLAGS_SWUNDI_TRANSMIT_OPMASK  0x0001\r
+#define PXE_OPFLAGS_TRANSMIT_BLOCK          0x0001\r
+#define PXE_OPFLAGS_TRANSMIT_DONT_BLOCK     0x0000\r
+\r
+//\r
+//\r
+//\r
+#define PXE_OPFLAGS_TRANSMIT_OPMASK     0x0002\r
+#define PXE_OPFLAGS_TRANSMIT_FRAGMENTED 0x0002\r
+#define PXE_OPFLAGS_TRANSMIT_WHOLE      0x0000\r
+\r
+//\r
+// //////////////////////////////////////\r
+// UNDI Receive\r
+//\r
+// No OpFlags\r
+//\r
+typedef PXE_UINT16  PXE_STATFLAGS;\r
+\r
+#define PXE_STATFLAGS_INITIALIZE  0x0000\r
+\r
+//\r
+// //////////////////////////////////////\r
+// Common StatFlags that can be returned by all commands.\r
+//\r
+//\r
+// The COMMAND_COMPLETE and COMMAND_FAILED status flags must be\r
+// implemented by all UNDIs.  COMMAND_QUEUED is only needed by UNDIs\r
+// that support command queuing.\r
+//\r
+#define PXE_STATFLAGS_STATUS_MASK       0xC000\r
+#define PXE_STATFLAGS_COMMAND_COMPLETE  0xC000\r
+#define PXE_STATFLAGS_COMMAND_FAILED    0x8000\r
+#define PXE_STATFLAGS_COMMAND_QUEUED    0x4000\r
+\r
+//\r
+// //////////////////////////////////////\r
+// UNDI Get State\r
+//\r
+#define PXE_STATFLAGS_GET_STATE_MASK        0x0003\r
+#define PXE_STATFLAGS_GET_STATE_INITIALIZED 0x0002\r
+#define PXE_STATFLAGS_GET_STATE_STARTED     0x0001\r
+#define PXE_STATFLAGS_GET_STATE_STOPPED     0x0000\r
+\r
+//\r
+// //////////////////////////////////////\r
+// UNDI Start\r
+//\r
+// No additional StatFlags\r
+\r
+////////////////////////////////////////\r
+// UNDI Get Init Info\r
+//\r
+#define PXE_STATFLAGS_CABLE_DETECT_MASK           0x0001\r
+#define PXE_STATFLAGS_CABLE_DETECT_NOT_SUPPORTED  0x0000\r
+#define PXE_STATFLAGS_CABLE_DETECT_SUPPORTED      0x0001\r
+\r
+//\r
+// //////////////////////////////////////\r
+// UNDI Initialize\r
+//\r
+#define PXE_STATFLAGS_INITIALIZED_NO_MEDIA  0x0001\r
+\r
+//\r
+// //////////////////////////////////////\r
+// UNDI Reset\r
+//\r
+#define PXE_STATFLAGS_RESET_NO_MEDIA  0x0001\r
+\r
+//\r
+// //////////////////////////////////////\r
+// UNDI Shutdown\r
+//\r
+// No additional StatFlags\r
+\r
+////////////////////////////////////////\r
+// UNDI Interrupt Enables\r
+//\r
+//\r
+// If set, receive interrupts are enabled.\r
+//\r
+#define PXE_STATFLAGS_INTERRUPT_RECEIVE 0x0001\r
+\r
+//\r
+// If set, transmit interrupts are enabled.\r
+//\r
+#define PXE_STATFLAGS_INTERRUPT_TRANSMIT  0x0002\r
+\r
+//\r
+// If set, command interrupts are enabled.\r
+//\r
+#define PXE_STATFLAGS_INTERRUPT_COMMAND 0x0004\r
+\r
+//\r
+// //////////////////////////////////////\r
+// UNDI Receive Filters\r
+//\r
+//\r
+// If set, unicast packets will be received.\r
+//\r
+#define PXE_STATFLAGS_RECEIVE_FILTER_UNICAST  0x0001\r
+\r
+//\r
+// If set, broadcast packets will be received.\r
+//\r
+#define PXE_STATFLAGS_RECEIVE_FILTER_BROADCAST  0x0002\r
+\r
+//\r
+// If set, multicast packets that match up with the multicast address\r
+// filter list will be received.\r
+//\r
+#define PXE_STATFLAGS_RECEIVE_FILTER_FILTERED_MULTICAST 0x0004\r
+\r
+//\r
+// If set, all packets will be received.\r
+//\r
+#define PXE_STATFLAGS_RECEIVE_FILTER_PROMISCUOUS  0x0008\r
+\r
+//\r
+// If set, all multicast packets will be received.\r
+//\r
+#define PXE_STATFLAGS_RECEIVE_FILTER_ALL_MULTICAST  0x0010\r
+\r
+//\r
+// //////////////////////////////////////\r
+// UNDI Station Address\r
+//\r
+// No additional StatFlags\r
+\r
+////////////////////////////////////////\r
+// UNDI Statistics\r
+//\r
+// No additional StatFlags\r
+\r
+////////////////////////////////////////\r
+// UNDI MCast IP to MAC\r
+//\r
+// No additional StatFlags\r
+\r
+////////////////////////////////////////\r
+// UNDI NvData\r
+//\r
+// No additional StatFlags\r
+\r
+\r
+////////////////////////////////////////\r
+// UNDI Get Status\r
+//\r
+//\r
+// Use to determine if an interrupt has occurred.\r
+//\r
+#define PXE_STATFLAGS_GET_STATUS_INTERRUPT_MASK 0x000F\r
+#define PXE_STATFLAGS_GET_STATUS_NO_INTERRUPTS  0x0000\r
+\r
+//\r
+// If set, at least one receive interrupt occurred.\r
+//\r
+#define PXE_STATFLAGS_GET_STATUS_RECEIVE  0x0001\r
+\r
+//\r
+// If set, at least one transmit interrupt occurred.\r
+//\r
+#define PXE_STATFLAGS_GET_STATUS_TRANSMIT 0x0002\r
+\r
+//\r
+// If set, at least one command interrupt occurred.\r
+//\r
+#define PXE_STATFLAGS_GET_STATUS_COMMAND  0x0004\r
+\r
+//\r
+// If set, at least one software interrupt occurred.\r
+//\r
+#define PXE_STATFLAGS_GET_STATUS_SOFTWARE 0x0008\r
+\r
+//\r
+// This flag is set if the transmitted buffer queue is empty.  This flag\r
+// will be set if all transmitted buffer addresses get written into the DB.\r
+//\r
+#define PXE_STATFLAGS_GET_STATUS_TXBUF_QUEUE_EMPTY  0x0010\r
+\r
+//\r
+// This flag is set if no transmitted buffer addresses were written\r
+// into the DB.  (This could be because DBsize was too small.)\r
+//\r
+#define PXE_STATFLAGS_GET_STATUS_NO_TXBUFS_WRITTEN  0x0020\r
+\r
+//\r
+// //////////////////////////////////////\r
+// UNDI Fill Header\r
+//\r
+// No additional StatFlags\r
+\r
+////////////////////////////////////////\r
+// UNDI Transmit\r
+//\r
+// No additional StatFlags.\r
+\r
+////////////////////////////////////////\r
+// UNDI Receive\r
+//\r
+// No additional StatFlags.\r
+//\r
+typedef PXE_UINT16  PXE_STATCODE;\r
+\r
+#define PXE_STATCODE_INITIALIZE 0x0000\r
+\r
+//\r
+// //////////////////////////////////////\r
+// Common StatCodes returned by all UNDI commands, UNDI protocol functions\r
+// and BC protocol functions.\r
+//\r
+#define PXE_STATCODE_SUCCESS              0x0000\r
+\r
+#define PXE_STATCODE_INVALID_CDB          0x0001\r
+#define PXE_STATCODE_INVALID_CPB          0x0002\r
+#define PXE_STATCODE_BUSY                 0x0003\r
+#define PXE_STATCODE_QUEUE_FULL           0x0004\r
+#define PXE_STATCODE_ALREADY_STARTED      0x0005\r
+#define PXE_STATCODE_NOT_STARTED          0x0006\r
+#define PXE_STATCODE_NOT_SHUTDOWN         0x0007\r
+#define PXE_STATCODE_ALREADY_INITIALIZED  0x0008\r
+#define PXE_STATCODE_NOT_INITIALIZED      0x0009\r
+#define PXE_STATCODE_DEVICE_FAILURE       0x000A\r
+#define PXE_STATCODE_NVDATA_FAILURE       0x000B\r
+#define PXE_STATCODE_UNSUPPORTED          0x000C\r
+#define PXE_STATCODE_BUFFER_FULL          0x000D\r
+#define PXE_STATCODE_INVALID_PARAMETER    0x000E\r
+#define PXE_STATCODE_INVALID_UNDI         0x000F\r
+#define PXE_STATCODE_IPV4_NOT_SUPPORTED   0x0010\r
+#define PXE_STATCODE_IPV6_NOT_SUPPORTED   0x0011\r
+#define PXE_STATCODE_NOT_ENOUGH_MEMORY    0x0012\r
+#define PXE_STATCODE_NO_DATA              0x0013\r
+\r
+typedef PXE_UINT16  PXE_IFNUM;\r
+\r
+//\r
+// This interface number must be passed to the S/W UNDI Start command.\r
+//\r
+#define PXE_IFNUM_START 0x0000\r
+\r
+//\r
+// This interface number is returned by the S/W UNDI Get State and\r
+// Start commands if information in the CDB, CPB or DB is invalid.\r
+//\r
+#define PXE_IFNUM_INVALID 0x0000\r
+\r
+typedef PXE_UINT16  PXE_CONTROL;\r
+\r
+//\r
+// Setting this flag directs the UNDI to queue this command for later\r
+// execution if the UNDI is busy and it supports command queuing.\r
+// If queuing is not supported, a PXE_STATCODE_INVALID_CONTROL error\r
+// is returned.  If the queue is full, a PXE_STATCODE_CDB_QUEUE_FULL\r
+// error is returned.\r
+//\r
+#define PXE_CONTROL_QUEUE_IF_BUSY 0x0002\r
+\r
+//\r
+// These two bit values are used to determine if there are more UNDI\r
+// CDB structures following this one.  If the link bit is set, there\r
+// must be a CDB structure following this one.  Execution will start\r
+// on the next CDB structure as soon as this one completes successfully.\r
+// If an error is generated by this command, execution will stop.\r
+//\r
+#define PXE_CONTROL_LINK              0x0001\r
+#define PXE_CONTROL_LAST_CDB_IN_LIST  0x0000\r
+\r
+typedef PXE_UINT8   PXE_FRAME_TYPE;\r
+\r
+#define PXE_FRAME_TYPE_NONE                     0x00\r
+#define PXE_FRAME_TYPE_UNICAST                  0x01\r
+#define PXE_FRAME_TYPE_BROADCAST                0x02\r
+#define PXE_FRAME_TYPE_FILTERED_MULTICAST       0x03\r
+#define PXE_FRAME_TYPE_PROMISCUOUS              0x04\r
+#define PXE_FRAME_TYPE_PROMISCUOUS_MULTICAST    0x05\r
+\r
+#define PXE_FRAME_TYPE_MULTICAST                PXE_FRAME_TYPE_FILTERED_MULTICAST       \r
+\r
+typedef PXE_UINT32  PXE_IPV4;\r
+\r
+typedef PXE_UINT32  PXE_IPV6[4];\r
+#define PXE_MAC_LENGTH  32\r
+\r
+typedef PXE_UINT8   PXE_MAC_ADDR[PXE_MAC_LENGTH];\r
+\r
+typedef PXE_UINT8   PXE_IFTYPE;\r
+typedef UINT16      PXE_MEDIA_PROTOCOL;\r
+\r
+//\r
+// This information is from the ARP section of RFC 1700.\r
+//\r
+//     1 Ethernet (10Mb)                                    [JBP]\r
+//     2 Experimental Ethernet (3Mb)                        [JBP]\r
+//     3 Amateur Radio AX.25                                [PXK]\r
+//     4 Proteon ProNET Token Ring                          [JBP]\r
+//     5 Chaos                                              [GXP]\r
+//     6 IEEE 802 Networks                                  [JBP]\r
+//     7 ARCNET                                             [JBP]\r
+//     8 Hyperchannel                                       [JBP]\r
+//     9 Lanstar                                             [TU]\r
+//    10 Autonet Short Address                             [MXB1]\r
+//    11 LocalTalk                                         [JKR1]\r
+//    12 LocalNet (IBM* PCNet or SYTEK* LocalNET)           [JXM]\r
+//    13 Ultra link                                        [RXD2]\r
+//    14 SMDS                                              [GXC1]\r
+//    15 Frame Relay                                        [AGM]\r
+//    16 Asynchronous Transmission Mode (ATM)              [JXB2]\r
+//    17 HDLC                                               [JBP]\r
+//    18 Fibre Channel                            [Yakov Rekhter]\r
+//    19 Asynchronous Transmission Mode (ATM)      [Mark Laubach]\r
+//    20 Serial Line                                        [JBP]\r
+//    21 Asynchronous Transmission Mode (ATM)              [MXB1]\r
+//\r
+// * Other names and brands may be claimed as the property of others.\r
+//\r
+#define PXE_IFTYPE_ETHERNET       0x01\r
+#define PXE_IFTYPE_TOKENRING      0x04\r
+#define PXE_IFTYPE_FIBRE_CHANNEL  0x12\r
+\r
+typedef struct s_pxe_hw_undi {\r
+  PXE_UINT32  Signature;      // PXE_ROMID_SIGNATURE\r
+  PXE_UINT8   Len;            // sizeof(PXE_HW_UNDI)\r
+  PXE_UINT8   Fudge;          // makes 8-bit cksum equal zero\r
+  PXE_UINT8   Rev;            // PXE_ROMID_REV\r
+  PXE_UINT8   IFcnt;          // physical connector count\r
+  PXE_UINT8   MajorVer;       // PXE_ROMID_MAJORVER\r
+  PXE_UINT8   MinorVer;       // PXE_ROMID_MINORVER\r
+  PXE_UINT16  reserved;       // zero, not used\r
+  PXE_UINT32  Implementation; // implementation flags\r
+  // reserved             // vendor use\r
+  // UINT32 Status;       // status port\r
+  // UINT32 Command;      // command port\r
+  // UINT64 CDBaddr;      // CDB address port\r
+  //\r
+} PXE_HW_UNDI;\r
+\r
+//\r
+// Status port bit definitions\r
+//\r
+//\r
+// UNDI operation state\r
+//\r
+#define PXE_HWSTAT_STATE_MASK   0xC0000000\r
+#define PXE_HWSTAT_BUSY         0xC0000000\r
+#define PXE_HWSTAT_INITIALIZED  0x80000000\r
+#define PXE_HWSTAT_STARTED      0x40000000\r
+#define PXE_HWSTAT_STOPPED      0x00000000\r
+\r
+//\r
+// If set, last command failed\r
+//\r
+#define PXE_HWSTAT_COMMAND_FAILED 0x20000000\r
+\r
+//\r
+// If set, identifies enabled receive filters\r
+//\r
+#define PXE_HWSTAT_PROMISCUOUS_MULTICAST_RX_ENABLED 0x00001000\r
+#define PXE_HWSTAT_PROMISCUOUS_RX_ENABLED           0x00000800\r
+#define PXE_HWSTAT_BROADCAST_RX_ENABLED             0x00000400\r
+#define PXE_HWSTAT_MULTICAST_RX_ENABLED             0x00000200\r
+#define PXE_HWSTAT_UNICAST_RX_ENABLED               0x00000100\r
+\r
+//\r
+// If set, identifies enabled external interrupts\r
+//\r
+#define PXE_HWSTAT_SOFTWARE_INT_ENABLED     0x00000080\r
+#define PXE_HWSTAT_TX_COMPLETE_INT_ENABLED  0x00000040\r
+#define PXE_HWSTAT_PACKET_RX_INT_ENABLED    0x00000020\r
+#define PXE_HWSTAT_CMD_COMPLETE_INT_ENABLED 0x00000010\r
+\r
+//\r
+// If set, identifies pending interrupts\r
+//\r
+#define PXE_HWSTAT_SOFTWARE_INT_PENDING     0x00000008\r
+#define PXE_HWSTAT_TX_COMPLETE_INT_PENDING  0x00000004\r
+#define PXE_HWSTAT_PACKET_RX_INT_PENDING    0x00000002\r
+#define PXE_HWSTAT_CMD_COMPLETE_INT_PENDING 0x00000001\r
+\r
+//\r
+// Command port definitions\r
+//\r
+//\r
+// If set, CDB identified in CDBaddr port is given to UNDI.\r
+// If not set, other bits in this word will be processed.\r
+//\r
+#define PXE_HWCMD_ISSUE_COMMAND   0x80000000\r
+#define PXE_HWCMD_INTS_AND_FILTS  0x00000000\r
+\r
+//\r
+// Use these to enable/disable receive filters.\r
+//\r
+#define PXE_HWCMD_PROMISCUOUS_MULTICAST_RX_ENABLE 0x00001000\r
+#define PXE_HWCMD_PROMISCUOUS_RX_ENABLE           0x00000800\r
+#define PXE_HWCMD_BROADCAST_RX_ENABLE             0x00000400\r
+#define PXE_HWCMD_MULTICAST_RX_ENABLE             0x00000200\r
+#define PXE_HWCMD_UNICAST_RX_ENABLE               0x00000100\r
+\r
+//\r
+// Use these to enable/disable external interrupts\r
+//\r
+#define PXE_HWCMD_SOFTWARE_INT_ENABLE     0x00000080\r
+#define PXE_HWCMD_TX_COMPLETE_INT_ENABLE  0x00000040\r
+#define PXE_HWCMD_PACKET_RX_INT_ENABLE    0x00000020\r
+#define PXE_HWCMD_CMD_COMPLETE_INT_ENABLE 0x00000010\r
+\r
+//\r
+// Use these to clear pending external interrupts\r
+//\r
+#define PXE_HWCMD_CLEAR_SOFTWARE_INT      0x00000008\r
+#define PXE_HWCMD_CLEAR_TX_COMPLETE_INT   0x00000004\r
+#define PXE_HWCMD_CLEAR_PACKET_RX_INT     0x00000002\r
+#define PXE_HWCMD_CLEAR_CMD_COMPLETE_INT  0x00000001\r
+\r
+typedef struct s_pxe_sw_undi {\r
+  PXE_UINT32  Signature;      // PXE_ROMID_SIGNATURE\r
+  PXE_UINT8   Len;            // sizeof(PXE_SW_UNDI)\r
+  PXE_UINT8   Fudge;          // makes 8-bit cksum zero\r
+  PXE_UINT8   Rev;            // PXE_ROMID_REV\r
+  PXE_UINT8   IFcnt;          // physical connector count\r
+  PXE_UINT8   MajorVer;       // PXE_ROMID_MAJORVER\r
+  PXE_UINT8   MinorVer;       // PXE_ROMID_MINORVER\r
+  PXE_UINT16  reserved1;      // zero, not used\r
+  PXE_UINT32  Implementation; // Implementation flags\r
+  PXE_UINT64  EntryPoint;     // API entry point\r
+  PXE_UINT8   reserved2[3];   // zero, not used\r
+  PXE_UINT8   BusCnt;         // number of bustypes supported\r
+  PXE_UINT32  BusType[1];     // list of supported bustypes\r
+} PXE_SW_UNDI;\r
+\r
+typedef union u_pxe_undi {\r
+  PXE_HW_UNDI hw;\r
+  PXE_SW_UNDI sw;\r
+} PXE_UNDI;\r
+\r
+//\r
+// Signature of !PXE structure\r
+//\r
+#define PXE_ROMID_SIGNATURE PXE_BUSTYPE ('!', 'P', 'X', 'E')\r
+\r
+//\r
+// !PXE structure format revision\r
+//\r
+#define PXE_ROMID_REV 0x02\r
+\r
+//\r
+// UNDI command interface revision.  These are the values that get sent\r
+// in option 94 (Client Network Interface Identifier) in the DHCP Discover\r
+// and PXE Boot Server Request packets.\r
+//\r
+#define PXE_ROMID_MAJORVER    0x03\r
+#define PXE_ROMID_MINORVER    0x01\r
+\r
+//\r
+// Implementation flags\r
+//\r
+#define PXE_ROMID_IMP_HW_UNDI                             0x80000000\r
+#define PXE_ROMID_IMP_SW_VIRT_ADDR                        0x40000000\r
+#define PXE_ROMID_IMP_64BIT_DEVICE                        0x00010000\r
+#define PXE_ROMID_IMP_FRAG_SUPPORTED                      0x00008000\r
+#define PXE_ROMID_IMP_CMD_LINK_SUPPORTED                  0x00004000\r
+#define PXE_ROMID_IMP_CMD_QUEUE_SUPPORTED                 0x00002000\r
+#define PXE_ROMID_IMP_MULTI_FRAME_SUPPORTED               0x00001000\r
+#define PXE_ROMID_IMP_NVDATA_SUPPORT_MASK                 0x00000C00\r
+#define PXE_ROMID_IMP_NVDATA_BULK_WRITABLE                0x00000C00\r
+#define PXE_ROMID_IMP_NVDATA_SPARSE_WRITABLE              0x00000800\r
+#define PXE_ROMID_IMP_NVDATA_READ_ONLY                    0x00000400\r
+#define PXE_ROMID_IMP_NVDATA_NOT_AVAILABLE                0x00000000\r
+#define PXE_ROMID_IMP_STATISTICS_SUPPORTED                0x00000200\r
+#define PXE_ROMID_IMP_STATION_ADDR_SETTABLE               0x00000100\r
+#define PXE_ROMID_IMP_PROMISCUOUS_MULTICAST_RX_SUPPORTED  0x00000080\r
+#define PXE_ROMID_IMP_PROMISCUOUS_RX_SUPPORTED            0x00000040\r
+#define PXE_ROMID_IMP_BROADCAST_RX_SUPPORTED              0x00000020\r
+#define PXE_ROMID_IMP_FILTERED_MULTICAST_RX_SUPPORTED     0x00000010\r
+#define PXE_ROMID_IMP_SOFTWARE_INT_SUPPORTED              0x00000008\r
+#define PXE_ROMID_IMP_TX_COMPLETE_INT_SUPPORTED           0x00000004\r
+#define PXE_ROMID_IMP_PACKET_RX_INT_SUPPORTED             0x00000002\r
+#define PXE_ROMID_IMP_CMD_COMPLETE_INT_SUPPORTED          0x00000001\r
+\r
+typedef struct s_pxe_cdb {\r
+  PXE_OPCODE    OpCode;\r
+  PXE_OPFLAGS   OpFlags;\r
+  PXE_UINT16    CPBsize;\r
+  PXE_UINT16    DBsize;\r
+  PXE_UINT64    CPBaddr;\r
+  PXE_UINT64    DBaddr;\r
+  PXE_STATCODE  StatCode;\r
+  PXE_STATFLAGS StatFlags;\r
+  PXE_UINT16    IFnum;\r
+  PXE_CONTROL   Control;\r
+} PXE_CDB;\r
+\r
+typedef union u_pxe_ip_addr {\r
+  PXE_IPV6  IPv6;\r
+  PXE_IPV4  IPv4;\r
+} PXE_IP_ADDR;\r
+\r
+typedef union pxe_device {\r
+  //\r
+  // PCI and PC Card NICs are both identified using bus, device\r
+  // and function numbers.  For PC Card, this may require PC\r
+  // Card services to be loaded in the BIOS or preboot\r
+  // environment.\r
+  //\r
+  struct {\r
+    //\r
+    // See S/W UNDI ROMID structure definition for PCI and\r
+    // PCC BusType definitions.\r
+    //\r
+    PXE_UINT32  BusType;\r
+\r
+    //\r
+    // Bus, device & function numbers that locate this device.\r
+    //\r
+    PXE_UINT16  Bus;\r
+    PXE_UINT8   Device;\r
+    PXE_UINT8   Function;\r
+  }\r
+  PCI, PCC;\r
+\r
+  //\r
+  // %%TBD - More information is needed about enumerating\r
+  // USB and 1394 devices.\r
+  //\r
+  struct {\r
+    PXE_UINT32  BusType;\r
+    PXE_UINT32  tdb;\r
+  }\r
+  USB, _1394;\r
+} PXE_DEVICE;\r
+\r
+//\r
+// cpb and db definitions\r
+//\r
+#define MAX_PCI_CONFIG_LEN    64  // # of dwords\r
+#define MAX_EEPROM_LEN        128 // #of dwords\r
+#define MAX_XMIT_BUFFERS      32  // recycling Q length for xmit_done\r
+#define MAX_MCAST_ADDRESS_CNT 8\r
+\r
+typedef struct s_pxe_cpb_start_30 {\r
+  //\r
+  // PXE_VOID Delay(UINTN microseconds);\r
+  //\r
+  // UNDI will never request a delay smaller than 10 microseconds\r
+  // and will always request delays in increments of 10 microseconds.\r
+  // The Delay() CallBack routine must delay between n and n + 10\r
+  // microseconds before returning control to the UNDI.\r
+  //\r
+  // This field cannot be set to zero.\r
+  //\r
+  UINT64  Delay;\r
+\r
+  //\r
+  // PXE_VOID Block(UINT32 enable);\r
+  //\r
+  // UNDI may need to block multi-threaded/multi-processor access to\r
+  // critical code sections when programming or accessing the network\r
+  // device.  To this end, a blocking service is needed by the UNDI.\r
+  // When UNDI needs a block, it will call Block() passing a non-zero\r
+  // value.  When UNDI no longer needs a block, it will call Block()\r
+  // with a zero value.  When called, if the Block() is already enabled,\r
+  // do not return control to the UNDI until the previous Block() is\r
+  // disabled.\r
+  //\r
+  // This field cannot be set to zero.\r
+  //\r
+  UINT64  Block;\r
+\r
+  //\r
+  // PXE_VOID Virt2Phys(UINT64 virtual, UINT64 physical_ptr);\r
+  //\r
+  // UNDI will pass the virtual address of a buffer and the virtual\r
+  // address of a 64-bit physical buffer.  Convert the virtual address\r
+  // to a physical address and write the result to the physical address\r
+  // buffer.  If virtual and physical addresses are the same, just\r
+  // copy the virtual address to the physical address buffer.\r
+  //\r
+  // This field can be set to zero if virtual and physical addresses\r
+  // are equal.\r
+  //\r
+  UINT64  Virt2Phys;\r
+  //\r
+  // PXE_VOID Mem_IO(UINT8 read_write, UINT8 len, UINT64 port,\r
+  //              UINT64 buf_addr);\r
+  //\r
+  // UNDI will read or write the device io space using this call back\r
+  // function. It passes the number of bytes as the len parameter and it\r
+  // will be either 1,2,4 or 8.\r
+  //\r
+  // This field can not be set to zero.\r
+  //\r
+  UINT64  Mem_IO;\r
+} PXE_CPB_START_30;\r
+\r
+typedef struct s_pxe_cpb_start_31 {\r
+  //\r
+  // PXE_VOID Delay(UINT64 UnqId, UINTN microseconds);\r
+  //\r
+  // UNDI will never request a delay smaller than 10 microseconds\r
+  // and will always request delays in increments of 10 microseconds.\r
+  // The Delay() CallBack routine must delay between n and n + 10\r
+  // microseconds before returning control to the UNDI.\r
+  //\r
+  // This field cannot be set to zero.\r
+  //\r
+  UINT64  Delay;\r
+\r
+  //\r
+  // PXE_VOID Block(UINT64 unq_id, UINT32 enable);\r
+  //\r
+  // UNDI may need to block multi-threaded/multi-processor access to\r
+  // critical code sections when programming or accessing the network\r
+  // device.  To this end, a blocking service is needed by the UNDI.\r
+  // When UNDI needs a block, it will call Block() passing a non-zero\r
+  // value.  When UNDI no longer needs a block, it will call Block()\r
+  // with a zero value.  When called, if the Block() is already enabled,\r
+  // do not return control to the UNDI until the previous Block() is\r
+  // disabled.\r
+  //\r
+  // This field cannot be set to zero.\r
+  //\r
+  UINT64  Block;\r
+\r
+  //\r
+  // PXE_VOID Virt2Phys(UINT64 UnqId, UINT64 virtual, UINT64 physical_ptr);\r
+  //\r
+  // UNDI will pass the virtual address of a buffer and the virtual\r
+  // address of a 64-bit physical buffer.  Convert the virtual address\r
+  // to a physical address and write the result to the physical address\r
+  // buffer.  If virtual and physical addresses are the same, just\r
+  // copy the virtual address to the physical address buffer.\r
+  //\r
+  // This field can be set to zero if virtual and physical addresses\r
+  // are equal.\r
+  //\r
+  UINT64  Virt2Phys;\r
+  //\r
+  // PXE_VOID Mem_IO(UINT64 UnqId, UINT8 read_write, UINT8 len, UINT64 port,\r
+  //              UINT64 buf_addr);\r
+  //\r
+  // UNDI will read or write the device io space using this call back\r
+  // function. It passes the number of bytes as the len parameter and it\r
+  // will be either 1,2,4 or 8.\r
+  //\r
+  // This field can not be set to zero.\r
+  //\r
+  UINT64  Mem_IO;\r
+  //\r
+  // PXE_VOID Map_Mem(UINT64 unq_id, UINT64 virtual_addr, UINT32 size,\r
+  //                 UINT32 Direction, UINT64 mapped_addr);\r
+  //\r
+  // UNDI will pass the virtual address of a buffer, direction of the data\r
+  // flow from/to the mapped buffer (the constants are defined below)\r
+  // and a place holder (pointer) for the mapped address.\r
+  // This call will Map the given address to a physical DMA address and write\r
+  // the result to the mapped_addr pointer.  If there is no need to\r
+  // map the given address to a lower address (i.e. the given address is\r
+  // associated with a physical address that is already compatible to be\r
+  // used with the DMA, it converts the given virtual address to it's\r
+  // physical address and write that in the mapped address pointer.\r
+  //\r
+  // This field can be set to zero if there is no mapping service available\r
+  //\r
+  UINT64  Map_Mem;\r
+\r
+  //\r
+  // PXE_VOID UnMap_Mem(UINT64 unq_id, UINT64 virtual_addr, UINT32 size,\r
+  //            UINT32 Direction, UINT64 mapped_addr);\r
+  //\r
+  // UNDI will pass the virtual and mapped addresses of a buffer\r
+  // This call will un map the given address\r
+  //\r
+  // This field can be set to zero if there is no unmapping service available\r
+  //\r
+  UINT64  UnMap_Mem;\r
+\r
+  //\r
+  // PXE_VOID Sync_Mem(UINT64 unq_id, UINT64 virtual,\r
+  //            UINT32 size, UINT32 Direction, UINT64 mapped_addr);\r
+  //\r
+  // UNDI will pass the virtual and mapped addresses of a buffer\r
+  // This call will synchronize the contents of both the virtual and mapped\r
+  // buffers for the given Direction.\r
+  //\r
+  // This field can be set to zero if there is no service available\r
+  //\r
+  UINT64  Sync_Mem;\r
+\r
+  //\r
+  // protocol driver can provide anything for this Unique_ID, UNDI remembers\r
+  // that as just a 64bit value assocaited to the interface specified by\r
+  // the ifnum and gives it back as a parameter to all the call-back routines\r
+  // when calling for that interface!\r
+  //\r
+  UINT64  Unique_ID;\r
+  //\r
+} PXE_CPB_START_31;\r
+\r
+#define TO_AND_FROM_DEVICE    0\r
+#define FROM_DEVICE           1\r
+#define TO_DEVICE             2\r
+\r
+#define PXE_DELAY_MILLISECOND 1000\r
+#define PXE_DELAY_SECOND      1000000\r
+#define PXE_IO_READ           0\r
+#define PXE_IO_WRITE          1\r
+#define PXE_MEM_READ          2\r
+#define PXE_MEM_WRITE         4\r
+\r
+typedef struct s_pxe_db_get_init_info {\r
+  //\r
+  // Minimum length of locked memory buffer that must be given to\r
+  // the Initialize command. Giving UNDI more memory will generally\r
+  // give better performance.\r
+  //\r
+  // If MemoryRequired is zero, the UNDI does not need and will not\r
+  // use system memory to receive and transmit packets.\r
+  //\r
+  PXE_UINT32  MemoryRequired;\r
+\r
+  //\r
+  // Maximum frame data length for Tx/Rx excluding the media header.\r
+  //\r
+  PXE_UINT32  FrameDataLen;\r
+\r
+  //\r
+  // Supported link speeds are in units of mega bits.  Common ethernet\r
+  // values are 10, 100 and 1000.  Unused LinkSpeeds[] entries are zero\r
+  // filled.\r
+  //\r
+  PXE_UINT32  LinkSpeeds[4];\r
+\r
+  //\r
+  // Number of non-volatile storage items.\r
+  //\r
+  PXE_UINT32  NvCount;\r
+\r
+  //\r
+  // Width of non-volatile storage item in bytes.  0, 1, 2 or 4\r
+  //\r
+  PXE_UINT16  NvWidth;\r
+\r
+  //\r
+  // Media header length.  This is the typical media header length for\r
+  // this UNDI.  This information is needed when allocating receive\r
+  // and transmit buffers.\r
+  //\r
+  PXE_UINT16  MediaHeaderLen;\r
+\r
+  //\r
+  // Number of bytes in the NIC hardware (MAC) address.\r
+  //\r
+  PXE_UINT16  HWaddrLen;\r
+\r
+  //\r
+  // Maximum number of multicast MAC addresses in the multicast\r
+  // MAC address filter list.\r
+  //\r
+  PXE_UINT16  MCastFilterCnt;\r
+\r
+  //\r
+  // Default number and size of transmit and receive buffers that will\r
+  // be allocated by the UNDI.  If MemoryRequired is non-zero, this\r
+  // allocation will come out of the memory buffer given to the Initialize\r
+  // command.  If MemoryRequired is zero, this allocation will come out of\r
+  // memory on the NIC.\r
+  //\r
+  PXE_UINT16  TxBufCnt;\r
+  PXE_UINT16  TxBufSize;\r
+  PXE_UINT16  RxBufCnt;\r
+  PXE_UINT16  RxBufSize;\r
+\r
+  //\r
+  // Hardware interface types defined in the Assigned Numbers RFC\r
+  // and used in DHCP and ARP packets.\r
+  // See the PXE_IFTYPE typedef and PXE_IFTYPE_xxx macros.\r
+  //\r
+  PXE_UINT8   IFtype;\r
+\r
+  //\r
+  // Supported duplex.  See PXE_DUPLEX_xxxxx #defines below.\r
+  //\r
+  PXE_UINT8   SupportedDuplexModes;\r
+\r
+  //\r
+  // Supported loopback options.  See PXE_LOOPBACK_xxxxx #defines below.\r
+  //\r
+  PXE_UINT8   SupportedLoopBackModes;\r
+} PXE_DB_GET_INIT_INFO;\r
+\r
+#define PXE_MAX_TXRX_UNIT_ETHER           1500\r
+\r
+#define PXE_HWADDR_LEN_ETHER              0x0006\r
+#define PXE_MAC_HEADER_LEN_ETHER          0x000E\r
+\r
+#define PXE_DUPLEX_ENABLE_FULL_SUPPORTED  1\r
+#define PXE_DUPLEX_FORCE_FULL_SUPPORTED   2\r
+\r
+#define PXE_LOOPBACK_INTERNAL_SUPPORTED   1\r
+#define PXE_LOOPBACK_EXTERNAL_SUPPORTED   2\r
+\r
+typedef struct s_pxe_pci_config_info {\r
+  //\r
+  // This is the flag field for the PXE_DB_GET_CONFIG_INFO union.\r
+  // For PCI bus devices, this field is set to PXE_BUSTYPE_PCI.\r
+  //\r
+  UINT32  BusType;\r
+\r
+  //\r
+  // This identifies the PCI network device that this UNDI interface\r
+  // is bound to.\r
+  //\r
+  UINT16  Bus;\r
+  UINT8   Device;\r
+  UINT8   Function;\r
+\r
+  //\r
+  // This is a copy of the PCI configuration space for this\r
+  // network device.\r
+  //\r
+  union {\r
+    UINT8   Byte[256];\r
+    UINT16  Word[128];\r
+    UINT32  Dword[64];\r
+  } Config;\r
+} PXE_PCI_CONFIG_INFO;\r
+\r
+typedef struct s_pxe_pcc_config_info {\r
+  //\r
+  // This is the flag field for the PXE_DB_GET_CONFIG_INFO union.\r
+  // For PCC bus devices, this field is set to PXE_BUSTYPE_PCC.\r
+  //\r
+  PXE_UINT32  BusType;\r
+\r
+  //\r
+  // This identifies the PCC network device that this UNDI interface\r
+  // is bound to.\r
+  //\r
+  PXE_UINT16  Bus;\r
+  PXE_UINT8   Device;\r
+  PXE_UINT8   Function;\r
+\r
+  //\r
+  // This is a copy of the PCC configuration space for this\r
+  // network device.\r
+  //\r
+  union {\r
+    PXE_UINT8   Byte[256];\r
+    PXE_UINT16  Word[128];\r
+    PXE_UINT32  Dword[64];\r
+  } Config;\r
+} PXE_PCC_CONFIG_INFO;\r
+\r
+typedef union u_pxe_db_get_config_info {\r
+  PXE_PCI_CONFIG_INFO   pci;\r
+  PXE_PCC_CONFIG_INFO   pcc;\r
+} PXE_DB_GET_CONFIG_INFO;\r
+\r
+typedef struct s_pxe_cpb_initialize {\r
+  //\r
+  // Address of first (lowest) byte of the memory buffer.  This buffer must\r
+  // be in contiguous physical memory and cannot be swapped out.  The UNDI\r
+  // will be using this for transmit and receive buffering.\r
+  //\r
+  PXE_UINT64  MemoryAddr;\r
+\r
+  //\r
+  // MemoryLength must be greater than or equal to MemoryRequired\r
+  // returned by the Get Init Info command.\r
+  //\r
+  PXE_UINT32  MemoryLength;\r
+\r
+  //\r
+  // Desired link speed in Mbit/sec.  Common ethernet values are 10, 100\r
+  // and 1000.  Setting a value of zero will auto-detect and/or use the\r
+  // default link speed (operation depends on UNDI/NIC functionality).\r
+  //\r
+  PXE_UINT32  LinkSpeed;\r
+\r
+  //\r
+  // Suggested number and size of receive and transmit buffers to\r
+  // allocate.  If MemoryAddr and MemoryLength are non-zero, this\r
+  // allocation comes out of the supplied memory buffer.  If MemoryAddr\r
+  // and MemoryLength are zero, this allocation comes out of memory\r
+  // on the NIC.\r
+  //\r
+  // If these fields are set to zero, the UNDI will allocate buffer\r
+  // counts and sizes as it sees fit.\r
+  //\r
+  PXE_UINT16  TxBufCnt;\r
+  PXE_UINT16  TxBufSize;\r
+  PXE_UINT16  RxBufCnt;\r
+  PXE_UINT16  RxBufSize;\r
+\r
+  //\r
+  // The following configuration parameters are optional and must be zero\r
+  // to use the default values.\r
+  //\r
+  PXE_UINT8   DuplexMode;\r
+\r
+  PXE_UINT8   LoopBackMode;\r
+} PXE_CPB_INITIALIZE;\r
+\r
+#define PXE_DUPLEX_DEFAULT      0x00\r
+#define PXE_FORCE_FULL_DUPLEX   0x01\r
+#define PXE_ENABLE_FULL_DUPLEX  0x02\r
+#define PXE_FORCE_HALF_DUPLEX   0x04\r
+#define PXE_DISABLE_FULL_DUPLEX 0x08\r
+\r
+#define LOOPBACK_NORMAL         0\r
+#define LOOPBACK_INTERNAL       1\r
+#define LOOPBACK_EXTERNAL       2\r
+\r
+typedef struct s_pxe_db_initialize {\r
+  //\r
+  // Actual amount of memory used from the supplied memory buffer.  This\r
+  // may be less that the amount of memory suppllied and may be zero if\r
+  // the UNDI and network device do not use external memory buffers.\r
+  //\r
+  // Memory used by the UNDI and network device is allocated from the\r
+  // lowest memory buffer address.\r
+  //\r
+  PXE_UINT32  MemoryUsed;\r
+\r
+  //\r
+  // Actual number and size of receive and transmit buffers that were\r
+  // allocated.\r
+  //\r
+  PXE_UINT16  TxBufCnt;\r
+  PXE_UINT16  TxBufSize;\r
+  PXE_UINT16  RxBufCnt;\r
+  PXE_UINT16  RxBufSize;\r
+} PXE_DB_INITIALIZE;\r
+\r
+typedef struct s_pxe_cpb_receive_filters {\r
+  //\r
+  // List of multicast MAC addresses.  This list, if present, will\r
+  // replace the existing multicast MAC address filter list.\r
+  //\r
+  PXE_MAC_ADDR  MCastList[MAX_MCAST_ADDRESS_CNT];\r
+} PXE_CPB_RECEIVE_FILTERS;\r
+\r
+typedef struct s_pxe_db_receive_filters {\r
+  //\r
+  // Filtered multicast MAC address list.\r
+  //\r
+  PXE_MAC_ADDR  MCastList[MAX_MCAST_ADDRESS_CNT];\r
+} PXE_DB_RECEIVE_FILTERS;\r
+\r
+typedef struct s_pxe_cpb_station_address {\r
+  //\r
+  // If supplied and supported, the current station MAC address\r
+  // will be changed.\r
+  //\r
+  PXE_MAC_ADDR  StationAddr;\r
+} PXE_CPB_STATION_ADDRESS;\r
+\r
+typedef struct s_pxe_dpb_station_address {\r
+  //\r
+  // Current station MAC address.\r
+  //\r
+  PXE_MAC_ADDR  StationAddr;\r
+\r
+  //\r
+  // Station broadcast MAC address.\r
+  //\r
+  PXE_MAC_ADDR  BroadcastAddr;\r
+\r
+  //\r
+  // Permanent station MAC address.\r
+  //\r
+  PXE_MAC_ADDR  PermanentAddr;\r
+} PXE_DB_STATION_ADDRESS;\r
+\r
+typedef struct s_pxe_db_statistics {\r
+  //\r
+  // Bit field identifying what statistic data is collected by the\r
+  // UNDI/NIC.\r
+  // If bit 0x00 is set, Data[0x00] is collected.\r
+  // If bit 0x01 is set, Data[0x01] is collected.\r
+  // If bit 0x20 is set, Data[0x20] is collected.\r
+  // If bit 0x21 is set, Data[0x21] is collected.\r
+  // Etc.\r
+  //\r
+  PXE_UINT64  Supported;\r
+\r
+  //\r
+  // Statistic data.\r
+  //\r
+  PXE_UINT64  Data[64];\r
+} PXE_DB_STATISTICS;\r
+\r
+//\r
+// Total number of frames received.  Includes frames with errors and\r
+// dropped frames.\r
+//\r
+#define PXE_STATISTICS_RX_TOTAL_FRAMES  0x00\r
+\r
+//\r
+// Number of valid frames received and copied into receive buffers.\r
+//\r
+#define PXE_STATISTICS_RX_GOOD_FRAMES 0x01\r
+\r
+//\r
+// Number of frames below the minimum length for the media.\r
+// This would be <64 for ethernet.\r
+//\r
+#define PXE_STATISTICS_RX_UNDERSIZE_FRAMES  0x02\r
+\r
+//\r
+// Number of frames longer than the maxminum length for the\r
+// media.  This would be >1500 for ethernet.\r
+//\r
+#define PXE_STATISTICS_RX_OVERSIZE_FRAMES 0x03\r
+\r
+//\r
+// Valid frames that were dropped because receive buffers were full.\r
+//\r
+#define PXE_STATISTICS_RX_DROPPED_FRAMES  0x04\r
+\r
+//\r
+// Number of valid unicast frames received and not dropped.\r
+//\r
+#define PXE_STATISTICS_RX_UNICAST_FRAMES  0x05\r
+\r
+//\r
+// Number of valid broadcast frames received and not dropped.\r
+//\r
+#define PXE_STATISTICS_RX_BROADCAST_FRAMES  0x06\r
+\r
+//\r
+// Number of valid mutlicast frames received and not dropped.\r
+//\r
+#define PXE_STATISTICS_RX_MULTICAST_FRAMES  0x07\r
+\r
+//\r
+// Number of frames w/ CRC or alignment errors.\r
+//\r
+#define PXE_STATISTICS_RX_CRC_ERROR_FRAMES  0x08\r
+\r
+//\r
+// Total number of bytes received.  Includes frames with errors\r
+// and dropped frames.\r
+//\r
+#define PXE_STATISTICS_RX_TOTAL_BYTES 0x09\r
+\r
+//\r
+// Transmit statistics.\r
+//\r
+#define PXE_STATISTICS_TX_TOTAL_FRAMES      0x0A\r
+#define PXE_STATISTICS_TX_GOOD_FRAMES       0x0B\r
+#define PXE_STATISTICS_TX_UNDERSIZE_FRAMES  0x0C\r
+#define PXE_STATISTICS_TX_OVERSIZE_FRAMES   0x0D\r
+#define PXE_STATISTICS_TX_DROPPED_FRAMES    0x0E\r
+#define PXE_STATISTICS_TX_UNICAST_FRAMES    0x0F\r
+#define PXE_STATISTICS_TX_BROADCAST_FRAMES  0x10\r
+#define PXE_STATISTICS_TX_MULTICAST_FRAMES  0x11\r
+#define PXE_STATISTICS_TX_CRC_ERROR_FRAMES  0x12\r
+#define PXE_STATISTICS_TX_TOTAL_BYTES       0x13\r
+\r
+//\r
+// Number of collisions detection on this subnet.\r
+//\r
+#define PXE_STATISTICS_COLLISIONS 0x14\r
+\r
+//\r
+// Number of frames destined for unsupported protocol.\r
+//\r
+#define PXE_STATISTICS_UNSUPPORTED_PROTOCOL 0x15\r
+\r
+typedef struct s_pxe_cpb_mcast_ip_to_mac {\r
+  //\r
+  // Multicast IP address to be converted to multicast MAC address.\r
+  //\r
+  PXE_IP_ADDR IP;\r
+} PXE_CPB_MCAST_IP_TO_MAC;\r
+\r
+typedef struct s_pxe_db_mcast_ip_to_mac {\r
+  //\r
+  // Multicast MAC address.\r
+  //\r
+  PXE_MAC_ADDR  MAC;\r
+} PXE_DB_MCAST_IP_TO_MAC;\r
+\r
+typedef struct s_pxe_cpb_nvdata_sparse {\r
+  //\r
+  // NvData item list.  Only items in this list will be updated.\r
+  //\r
+  struct {\r
+    //\r
+    //  Non-volatile storage address to be changed.\r
+    //\r
+    PXE_UINT32  Addr;\r
+\r
+    //\r
+    // Data item to write into above storage address.\r
+    //\r
+    union {\r
+      PXE_UINT8   Byte;\r
+      PXE_UINT16  Word;\r
+      PXE_UINT32  Dword;\r
+    } Data;\r
+  } Item[MAX_EEPROM_LEN];\r
+}\r
+PXE_CPB_NVDATA_SPARSE;\r
+\r
+//\r
+// When using bulk update, the size of the CPB structure must be\r
+// the same size as the non-volatile NIC storage.\r
+//\r
+typedef union u_pxe_cpb_nvdata_bulk {\r
+  //\r
+  // Array of byte-wide data items.\r
+  //\r
+  PXE_UINT8   Byte[MAX_EEPROM_LEN << 2];\r
+\r
+  //\r
+  // Array of word-wide data items.\r
+  //\r
+  PXE_UINT16  Word[MAX_EEPROM_LEN << 1];\r
+\r
+  //\r
+  // Array of dword-wide data items.\r
+  //\r
+  PXE_UINT32  Dword[MAX_EEPROM_LEN];\r
+} PXE_CPB_NVDATA_BULK;\r
+\r
+typedef struct s_pxe_db_nvdata {\r
+  //\r
+  // Arrays of data items from non-volatile storage.\r
+  //\r
+  union {\r
+    //\r
+    // Array of byte-wide data items.\r
+    //\r
+    PXE_UINT8   Byte[MAX_EEPROM_LEN << 2];\r
+\r
+    //\r
+    // Array of word-wide data items.\r
+    //\r
+    PXE_UINT16  Word[MAX_EEPROM_LEN << 1];\r
+\r
+    //\r
+    // Array of dword-wide data items.\r
+    //\r
+    PXE_UINT32  Dword[MAX_EEPROM_LEN];\r
+  } Data;\r
+} PXE_DB_NVDATA;\r
+\r
+typedef struct s_pxe_db_get_status {\r
+  //\r
+  // Length of next receive frame (header + data).  If this is zero,\r
+  // there is no next receive frame available.\r
+  //\r
+  PXE_UINT32  RxFrameLen;\r
+\r
+  //\r
+  // Reserved, set to zero.\r
+  //\r
+  PXE_UINT32  reserved;\r
+\r
+  //\r
+  //  Addresses of transmitted buffers that need to be recycled.\r
+  //\r
+  PXE_UINT64  TxBuffer[MAX_XMIT_BUFFERS];\r
+} PXE_DB_GET_STATUS;\r
+\r
+typedef struct s_pxe_cpb_fill_header {\r
+  //\r
+  // Source and destination MAC addresses.  These will be copied into\r
+  // the media header without doing byte swapping.\r
+  //\r
+  PXE_MAC_ADDR  SrcAddr;\r
+  PXE_MAC_ADDR  DestAddr;\r
+\r
+  //\r
+  // Address of first byte of media header.  The first byte of packet data\r
+  // follows the last byte of the media header.\r
+  //\r
+  PXE_UINT64        MediaHeader;\r
+\r
+  //\r
+  // Length of packet data in bytes (not including the media header).\r
+  //\r
+  PXE_UINT32        PacketLen;\r
+\r
+  //\r
+  // Protocol type.  This will be copied into the media header without\r
+  // doing byte swapping.  Protocol type numbers can be obtained from\r
+  // the Assigned Numbers RFC 1700.\r
+  //\r
+  PXE_UINT16        Protocol;\r
+\r
+  //\r
+  // Length of the media header in bytes.\r
+  //\r
+  PXE_UINT16        MediaHeaderLen;\r
+} PXE_CPB_FILL_HEADER;\r
+\r
+#define PXE_PROTOCOL_ETHERNET_IP  0x0800\r
+#define PXE_PROTOCOL_ETHERNET_ARP 0x0806\r
+#define MAX_XMIT_FRAGMENTS        16\r
+\r
+typedef struct s_pxe_cpb_fill_header_fragmented {\r
+  //\r
+  // Source and destination MAC addresses.  These will be copied into\r
+  // the media header without doing byte swapping.\r
+  //\r
+  PXE_MAC_ADDR        SrcAddr;\r
+  PXE_MAC_ADDR        DestAddr;\r
+\r
+  //\r
+  // Length of packet data in bytes (not including the media header).\r
+  //\r
+  PXE_UINT32          PacketLen;\r
+\r
+  //\r
+  // Protocol type.  This will be copied into the media header without\r
+  // doing byte swapping.  Protocol type numbers can be obtained from\r
+  // the Assigned Numbers RFC 1700.\r
+  //\r
+  PXE_MEDIA_PROTOCOL  Protocol;\r
+\r
+  //\r
+  // Length of the media header in bytes.\r
+  //\r
+  PXE_UINT16          MediaHeaderLen;\r
+\r
+  //\r
+  // Number of packet fragment descriptors.\r
+  //\r
+  PXE_UINT16          FragCnt;\r
+\r
+  //\r
+  // Reserved, must be set to zero.\r
+  //\r
+  PXE_UINT16          reserved;\r
+\r
+  //\r
+  // Array of packet fragment descriptors.  The first byte of the media\r
+  // header is the first byte of the first fragment.\r
+  //\r
+  struct {\r
+    //\r
+    // Address of this packet fragment.\r
+    //\r
+    PXE_UINT64  FragAddr;\r
+\r
+    //\r
+    // Length of this packet fragment.\r
+    //\r
+    PXE_UINT32  FragLen;\r
+\r
+    //\r
+    // Reserved, must be set to zero.\r
+    //\r
+    PXE_UINT32  reserved;\r
+  } FragDesc[MAX_XMIT_FRAGMENTS];\r
+}\r
+PXE_CPB_FILL_HEADER_FRAGMENTED;\r
+\r
+typedef struct s_pxe_cpb_transmit {\r
+  //\r
+  // Address of first byte of frame buffer.  This is also the first byte\r
+  // of the media header.\r
+  //\r
+  PXE_UINT64  FrameAddr;\r
+\r
+  //\r
+  // Length of the data portion of the frame buffer in bytes.  Do not\r
+  // include the length of the media header.\r
+  //\r
+  PXE_UINT32  DataLen;\r
+\r
+  //\r
+  // Length of the media header in bytes.\r
+  //\r
+  PXE_UINT16  MediaheaderLen;\r
+\r
+  //\r
+  // Reserved, must be zero.\r
+  //\r
+  PXE_UINT16  reserved;\r
+} PXE_CPB_TRANSMIT;\r
+\r
+typedef struct s_pxe_cpb_transmit_fragments {\r
+  //\r
+  // Length of packet data in bytes (not including the media header).\r
+  //\r
+  PXE_UINT32  FrameLen;\r
+\r
+  //\r
+  // Length of the media header in bytes.\r
+  //\r
+  PXE_UINT16  MediaheaderLen;\r
+\r
+  //\r
+  // Number of packet fragment descriptors.\r
+  //\r
+  PXE_UINT16  FragCnt;\r
+\r
+  //\r
+  // Array of frame fragment descriptors.  The first byte of the first\r
+  // fragment is also the first byte of the media header.\r
+  //\r
+  struct {\r
+    //\r
+    // Address of this frame fragment.\r
+    //\r
+    PXE_UINT64  FragAddr;\r
+\r
+    //\r
+    // Length of this frame fragment.\r
+    //\r
+    PXE_UINT32  FragLen;\r
+\r
+    //\r
+    // Reserved, must be set to zero.\r
+    //\r
+    PXE_UINT32  reserved;\r
+  } FragDesc[MAX_XMIT_FRAGMENTS];\r
+}\r
+PXE_CPB_TRANSMIT_FRAGMENTS;\r
+\r
+typedef struct s_pxe_cpb_receive {\r
+  //\r
+  // Address of first byte of receive buffer.  This is also the first byte\r
+  // of the frame header.\r
+  //\r
+  PXE_UINT64  BufferAddr;\r
+\r
+  //\r
+  // Length of receive buffer.  This must be large enough to hold the\r
+  // received frame (media header + data).  If the length of smaller than\r
+  // the received frame, data will be lost.\r
+  //\r
+  PXE_UINT32  BufferLen;\r
+\r
+  //\r
+  // Reserved, must be set to zero.\r
+  //\r
+  PXE_UINT32  reserved;\r
+} PXE_CPB_RECEIVE;\r
+\r
+typedef struct s_pxe_db_receive {\r
+  //\r
+  // Source and destination MAC addresses from media header.\r
+  //\r
+  PXE_MAC_ADDR        SrcAddr;\r
+  PXE_MAC_ADDR        DestAddr;\r
+\r
+  //\r
+  // Length of received frame.  May be larger than receive buffer size.\r
+  // The receive buffer will not be overwritten.  This is how to tell\r
+  // if data was lost because the receive buffer was too small.\r
+  //\r
+  PXE_UINT32          FrameLen;\r
+\r
+  //\r
+  // Protocol type from media header.\r
+  //\r
+  PXE_MEDIA_PROTOCOL  Protocol;\r
+\r
+  //\r
+  // Length of media header in received frame.\r
+  //\r
+  PXE_UINT16          MediaHeaderLen;\r
+\r
+  //\r
+  // Type of receive frame.\r
+  //\r
+  PXE_FRAME_TYPE      Type;\r
+\r
+  //\r
+  // Reserved, must be zero.\r
+  //\r
+  PXE_UINT8           reserved[7];\r
+\r
+} PXE_DB_RECEIVE;\r
+\r
+#pragma pack()\r
+\r
+#endif\r
diff --git a/Tools/Source/TianoTools/Include/Uefi/UefiSpec.h b/Tools/Source/TianoTools/Include/Uefi/UefiSpec.h
new file mode 100644 (file)
index 0000000..d648b1b
--- /dev/null
@@ -0,0 +1,2460 @@
+/** @file\r
+  Include file that supportes UEFI.\r
+  \r
+  This include file must only contain things defined in the UEFI 2.0 specification.\r
+  If a code construct is defined in the UEFI 2.0 specification it must be included\r
+  by this include file.\r
+  \r
+  Copyright (c) 2006, Intel Corporation\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+  \r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+  \r
+  Module Name:    UefiSpec.h\r
+  \r
+**/\r
+\r
+#ifndef __UEFI_SPEC_H__\r
+#define __UEFI_SPEC_H__\r
+\r
+#include <Common/MultiPhase.h>\r
+\r
+//\r
+// EFI Data Types based on ANSI C integer types in EfiBind.h\r
+//\r
+\r
+\r
+//\r
+// EFI Data Types derived from other EFI data types.\r
+//\r
+\r
+#define NULL_HANDLE ((VOID *) 0)\r
+\r
+typedef VOID *EFI_EVENT;\r
+typedef UINTN EFI_TPL;\r
+\r
+//\r
+// EFI Time Abstraction:\r
+//  Year:       2000 - 20XX\r
+//  Month:      1 - 12\r
+//  Day:        1 - 31\r
+//  Hour:       0 - 23\r
+//  Minute:     0 - 59\r
+//  Second:     0 - 59\r
+//  Nanosecond: 0 - 999,999,999\r
+//  TimeZone:   -1440 to 1440 or 2047\r
+//\r
+typedef struct {\r
+  UINT16  Year;\r
+  UINT8   Month;\r
+  UINT8   Day;\r
+  UINT8   Hour;\r
+  UINT8   Minute;\r
+  UINT8   Second;\r
+  UINT8   Pad1;\r
+  UINT32  Nanosecond;\r
+  INT16   TimeZone;\r
+  UINT8   Daylight;\r
+  UINT8   Pad2;\r
+} EFI_TIME;\r
+\r
+//\r
+// Bit definitions for EFI_TIME.Daylight\r
+//\r
+#define EFI_TIME_ADJUST_DAYLIGHT  0x01\r
+#define EFI_TIME_IN_DAYLIGHT      0x02\r
+\r
+//\r
+// Value definition for EFI_TIME.TimeZone\r
+//\r
+#define EFI_UNSPECIFIED_TIMEZONE  0x07FF\r
+\r
+//\r
+// Networking\r
+//\r
+typedef struct {\r
+  UINT8 Addr[4];\r
+} EFI_IPv4_ADDRESS;\r
+\r
+typedef struct {\r
+  UINT8 Addr[16];\r
+} EFI_IPv6_ADDRESS;\r
+\r
+typedef struct {\r
+  UINT8 Addr[32];\r
+} EFI_MAC_ADDRESS;\r
+\r
+typedef union {\r
+  UINT32            Addr[4];\r
+  EFI_IPv4_ADDRESS  v4;\r
+  EFI_IPv6_ADDRESS  v6;\r
+} EFI_IP_ADDRESS;\r
+\r
+\r
+typedef enum {\r
+  AllocateAnyPages,\r
+  AllocateMaxAddress,\r
+  AllocateAddress,\r
+  MaxAllocateType\r
+} EFI_ALLOCATE_TYPE;\r
+\r
+\r
+//\r
+// possible caching types for the memory range\r
+//\r
+#define EFI_MEMORY_UC   0x0000000000000001ULL\r
+#define EFI_MEMORY_WC   0x0000000000000002ULL\r
+#define EFI_MEMORY_WT   0x0000000000000004ULL\r
+#define EFI_MEMORY_WB   0x0000000000000008ULL\r
+#define EFI_MEMORY_UCE  0x0000000000000010ULL\r
+\r
+//\r
+// physical memory protection on range\r
+//\r
+#define EFI_MEMORY_WP 0x0000000000001000ULL\r
+#define EFI_MEMORY_RP 0x0000000000002000ULL\r
+#define EFI_MEMORY_XP 0x0000000000004000ULL\r
+\r
+//\r
+// range requires a runtime mapping\r
+//\r
+#define EFI_MEMORY_RUNTIME  0x8000000000000000ULL\r
+\r
+typedef UINT64  EFI_VIRTUAL_ADDRESS;\r
+\r
+#define EFI_MEMORY_DESCRIPTOR_VERSION 1\r
+typedef struct {\r
+  UINT32                Type;\r
+  UINT32                Pad;\r
+  EFI_PHYSICAL_ADDRESS  PhysicalStart;\r
+  EFI_VIRTUAL_ADDRESS   VirtualStart;\r
+  UINT64                NumberOfPages;\r
+  UINT64                Attribute;\r
+} EFI_MEMORY_DESCRIPTOR;\r
+\r
+//\r
+//  EFI_FIELD_OFFSET - returns the byte offset to a field within a structure\r
+//\r
+#define EFI_FIELD_OFFSET(TYPE,Field) ((UINTN)(&(((TYPE *) 0)->Field)))\r
+\r
+#include <Protocol/DevicePath.h>\r
+#include <Protocol/SimpleTextIn.h>\r
+#include <Protocol/SimpleTextOut.h>\r
+\r
+//\r
+// Declare forward referenced data structures\r
+//\r
+typedef struct  _EFI_SYSTEM_TABLE   EFI_SYSTEM_TABLE;\r
+\r
+/**\r
+  Allocates memory pages from the system.\r
+  \r
+  @param  Type        The type of allocation to perform.\r
+  @param  MemoryType  The type of memory to allocate.\r
+  @param  Pages       The number of contiguous 4 KB pages to allocate.\r
+  @param  Memory      Pointer to a physical address. On input, the way in which the address is\r
+                      used depends on the value of Type.          \r
+                     \r
+  @retval EFI_SUCCESS           The requested pages were allocated.\r
+  @retval EFI_INVALID_PARAMETER 1) Type is not AllocateAnyPages or\r
+                                AllocateMaxAddress or AllocateAddress.\r
+                                2) MemoryType is in the range\r
+                                EfiMaxMemoryType..0x7FFFFFFF.\r
+  @retval EFI_OUT_OF_RESOURCES  The pages could not be allocated.\r
+  @retval EFI_NOT_FOUND         The requested pages could not be found.\r
+                     \r
+**/                  \r
+typedef              \r
+EFI_STATUS           \r
+(EFIAPI *EFI_ALLOCATE_PAGES) (\r
+  IN EFI_ALLOCATE_TYPE            Type,\r
+  IN EFI_MEMORY_TYPE              MemoryType,\r
+  IN UINTN                        Pages,\r
+  IN OUT EFI_PHYSICAL_ADDRESS     *Memory\r
+  );\r
+\r
+/**\r
+  Frees memory pages.\r
+    \r
+  @param  Memory      The base physical address of the pages to be freed.\r
+  @param  Pages       The number of contiguous 4 KB pages to free.\r
+                               \r
+  @retval EFI_SUCCESS           The requested pages were freed.\r
+  @retval EFI_INVALID_PARAMETER Memory is not a page-aligned address or Pages is invalid.    \r
+  @retval EFI_NOT_FOUND         The requested memory pages were not allocated with\r
+                                AllocatePages().\r
+                     \r
+**/          \r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_FREE_PAGES) (\r
+  IN EFI_PHYSICAL_ADDRESS         Memory,\r
+  IN UINTN                        Pages\r
+  );\r
+\r
+/**\r
+  Returns the current memory map.\r
+    \r
+  @param  MemoryMapSize         A pointer to the size, in bytes, of the MemoryMap buffer.\r
+  @param  MemoryMap             A pointer to the buffer in which firmware places the current memory\r
+                                map.\r
+  @param  MapKey                A pointer to the location in which firmware returns the key for the\r
+                                current memory map.                                                \r
+  @param  DescriptorSize        A pointer to the location in which firmware returns the size, in bytes, of\r
+                                an individual EFI_MEMORY_DESCRIPTOR.                                      \r
+  @param  DescriptorVersion     A pointer to the location in which firmware returns the version number\r
+                                associated with the EFI_MEMORY_DESCRIPTOR. \r
+                                                                 \r
+  @retval EFI_SUCCESS           The memory map was returned in the MemoryMap buffer.\r
+  @retval EFI_BUFFER_TOO_SMALL  The MemoryMap buffer was too small. The current buffer size\r
+                                needed to hold the memory map is returned in MemoryMapSize.\r
+  @retval EFI_INVALID_PARAMETER 1) MemoryMapSize is NULL.\r
+                                2) The MemoryMap buffer is not too small and MemoryMap is\r
+                                   NULL.                                                 \r
+                     \r
+**/          \r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_GET_MEMORY_MAP) (\r
+  IN OUT UINTN                    *MemoryMapSize,\r
+  IN OUT EFI_MEMORY_DESCRIPTOR    *MemoryMap,\r
+  OUT UINTN                       *MapKey,\r
+  OUT UINTN                       *DescriptorSize,\r
+  OUT UINT32                      *DescriptorVersion\r
+  );\r
+\r
+#define NextMemoryDescriptor(_Ptr, _Size)   ((EFI_MEMORY_DESCRIPTOR *) (((UINT8 *) (_Ptr)) + (_Size)))\r
+#define NEXT_MEMORY_DESCRIPTOR(_Ptr, _Size) NextMemoryDescriptor (_Ptr, _Size)\r
+\r
+/**\r
+  Allocates pool memory.\r
+    \r
+  @param  PoolType              The type of pool to allocate.\r
+  @param  Size                  The number of bytes to allocate from the pool.                                \r
+  @param  Buffer                A pointer to a pointer to the allocated buffer if the call succeeds;\r
+                                undefined otherwise.                                \r
+                                                                 \r
+  @retval EFI_SUCCESS           The requested number of bytes was allocated.\r
+  @retval EFI_OUT_OF_RESOURCES  The pool requested could not be allocated.                                \r
+  @retval EFI_INVALID_PARAMETER PoolType was invalid.                                \r
+                     \r
+**/    \r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_ALLOCATE_POOL) (\r
+  IN EFI_MEMORY_TYPE              PoolType,\r
+  IN UINTN                        Size,\r
+  OUT VOID                        **Buffer\r
+  );\r
+\r
+/**\r
+  Returns pool memory to the system.\r
+    \r
+  @param  Buffer                Pointer to the buffer to free.                                                             \r
+                                                                 \r
+  @retval EFI_SUCCESS           The memory was returned to the system.  \r
+  @retval EFI_INVALID_PARAMETER Buffer was invalid.\r
+                     \r
+**/    \r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_FREE_POOL) (\r
+  IN VOID                         *Buffer\r
+  );\r
+\r
+/**\r
+  Changes the runtime addressing mode of EFI firmware from physical to virtual.\r
+    \r
+  @param  MemoryMapSize         The size in bytes of VirtualMap.\r
+  @param  DescriptorSize        The size in bytes of an entry in the VirtualMap.\r
+  @param  DescriptorVersion     The version of the structure entries in VirtualMap.\r
+  @param  VirtualMap            An array of memory descriptors which contain new virtual\r
+                                address mapping information for all runtime ranges.\r
+                                                                 \r
+  @retval EFI_SUCCESS           The virtual address map has been applied.\r
+  @retval EFI_UNSUPPORTED       EFI firmware is not at runtime, or the EFI firmware is already in\r
+                                virtual address mapped mode.                                     \r
+  @retval EFI_INVALID_PARAMETER DescriptorSize or DescriptorVersion is invalid.                              \r
+  @retval EFI_NO_MAPPING        A virtual address was not supplied for a range in the memory\r
+                                map that requires a mapping.                                \r
+  @retval EFI_NOT_FOUND         A virtual address was supplied for an address that is not found\r
+                                in the memory map.                                             \r
+                                \r
+**/                             \r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_SET_VIRTUAL_ADDRESS_MAP) (\r
+  IN UINTN                        MemoryMapSize,\r
+  IN UINTN                        DescriptorSize,\r
+  IN UINT32                       DescriptorVersion,\r
+  IN EFI_MEMORY_DESCRIPTOR        *VirtualMap\r
+  );\r
+\r
+/**\r
+  Connects one or more drivers to a controller.\r
+    \r
+  @param  ControllerHandle      The handle of the controller to which driver(s) are to be connected.\r
+  @param  DriverImageHandle     A pointer to an ordered list handles that support the\r
+                                EFI_DRIVER_BINDING_PROTOCOL.                         \r
+  @param  RemainingDevicePath   A pointer to the device path that specifies a child of the\r
+                                controller specified by ControllerHandle.                 \r
+  @param  Recursive             If TRUE, then ConnectController() is called recursively            \r
+                                until the entire tree of controllers below the controller specified\r
+                                by ControllerHandle have been created. If FALSE, then              \r
+                                the tree of controllers is only expanded one level.                                                                                                               \r
+                                \r
+  @retval EFI_SUCCESS           1) One or more drivers were connected to ControllerHandle.\r
+                                2) No drivers were connected to ControllerHandle, but      \r
+                                RemainingDevicePath is not NULL, and it is an End Device\r
+                                Path Node.                                                                                                                  \r
+  @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.       \r
+  @retval EFI_NOT_FOUND         1) There are no EFI_DRIVER_BINDING_PROTOCOL instances\r
+                                present in the system.                            \r
+                                2) No drivers were connected to ControllerHandle.\r
+                                \r
+**/ \r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_CONNECT_CONTROLLER) (\r
+  IN  EFI_HANDLE                    ControllerHandle,\r
+  IN  EFI_HANDLE                    *DriverImageHandle,   OPTIONAL\r
+  IN  EFI_DEVICE_PATH_PROTOCOL      *RemainingDevicePath, OPTIONAL\r
+  IN  BOOLEAN                       Recursive\r
+  );\r
+\r
+/**\r
+  Disconnects one or more drivers from a controller.\r
+    \r
+  @param  ControllerHandle      The handle of the controller from which driver(s) are to be disconnected.\r
+  @param  DriverImageHandle     The driver to disconnect from ControllerHandle.                       \r
+  @param  ChildHandle           The handle of the child to destroy.                                \r
+                                \r
+  @retval EFI_SUCCESS           1) One or more drivers were disconnected from the controller.\r
+                                2) On entry, no drivers are managing ControllerHandle.\r
+                                3) DriverImageHandle is not NULL, and on entry\r
+                                   DriverImageHandle is not managing ControllerHandle.\r
+                                   \r
+  @retval EFI_INVALID_PARAMETER One ore more parameters are invalid.\r
+  @retval EFI_OUT_OF_RESOURCES  There are not enough resources available to disconnect any drivers from\r
+                                ControllerHandle.                                                      \r
+  @retval EFI_DEVICE_ERROR      The controller could not be disconnected because of a device error.  \r
+                                \r
+**/ \r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_DISCONNECT_CONTROLLER) (\r
+  IN EFI_HANDLE                     ControllerHandle,\r
+  IN EFI_HANDLE                     DriverImageHandle, OPTIONAL\r
+  IN EFI_HANDLE                     ChildHandle        OPTIONAL\r
+  );\r
+\r
+//\r
+// ConvertPointer DebugDisposition type.\r
+//\r
+#define EFI_OPTIONAL_PTR     0x00000001\r
+#define EFI_OPTIONAL_POINTER EFI_OPTIONAL_PTR\r
+\r
+/**\r
+  Determines the new virtual address that is to be used on subsequent memory accesses.\r
+    \r
+  @param  DebugDisposition      Supplies type information for the pointer being converted.\r
+  @param  Address               A pointer to a pointer that is to be fixed to be the value needed\r
+                                for the new virtual address mappings being applied.                              \r
+                                \r
+  @retval EFI_SUCCESS           The pointer pointed to by Address was modified.                                                                   \r
+  @retval EFI_INVALID_PARAMETER 1) Address is NULL.\r
+                                2) *Address is NULL and DebugDisposition does\r
+                                not have the EFI_OPTIONAL_PTR bit set.    \r
+  @retval EFI_NOT_FOUND         The pointer pointed to by Address was not found to be part\r
+                                of the current memory map. This is normally fatal.          \r
+                                \r
+**/ \r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_CONVERT_POINTER) (\r
+  IN UINTN                          DebugDisposition,\r
+  IN OUT VOID                       **Address\r
+  );\r
+\r
+//\r
+// EFI Event Types (name defined in spec)\r
+//\r
+#define EVENT_TIMER                             0x80000000\r
+#define EVENT_RUNTIME                           0x40000000\r
+#define EVENT_RUNTIME_CONTEXT                   0x20000000\r
+\r
+#define EVENT_NOTIFY_WAIT                       0x00000100\r
+#define EVENT_NOTIFY_SIGNAL                     0x00000200\r
+\r
+#define EVENT_SIGNAL_EXIT_BOOT_SERVICES         0x00000201\r
+#define EVENT_SIGNAL_VIRTUAL_ADDRESS_CHANGE     0x60000202\r
+\r
+#if ((EDK_RELEASE_VERSION != 0) && (EFI_SPECIFICATION_VERSION < 0x00020000))\r
+//\r
+// Prior to UEFI 2.0 Tiano extended these enums. This was replaced by\r
+// CreateEventEx() Event Groups in UEFI 2.0\r
+//\r
+#define EFI_EVENT_NOTIFY_SIGNAL_ALL     0x00000400\r
+\r
+#define EFI_EVENT_SIGNAL_READY_TO_BOOT  0x00000203\r
+#define EFI_EVENT_SIGNAL_LEGACY_BOOT    0x00000204\r
+\r
+#endif\r
+\r
+//\r
+// EFI Event Types (name following coding style)\r
+//\r
+#define EFI_EVENT_TIMER                         EVENT_TIMER\r
+#define EFI_EVENT_RUNTIME                       EVENT_RUNTIME\r
+#define EFI_EVENT_RUNTIME_CONTEXT               EVENT_RUNTIME_CONTEXT\r
+\r
+#define EFI_EVENT_NOTIFY_WAIT                   EVENT_NOTIFY_WAIT\r
+#define EFI_EVENT_NOTIFY_SIGNAL                 EVENT_NOTIFY_SIGNAL\r
+\r
+#define EFI_EVENT_SIGNAL_EXIT_BOOT_SERVICES     EVENT_SIGNAL_EXIT_BOOT_SERVICES\r
+#define EFI_EVENT_SIGNAL_VIRTUAL_ADDRESS_CHANGE EVENT_SIGNAL_VIRTUAL_ADDRESS_CHANGE\r
+\r
+\r
+/**                                                                                                   \r
+  Invoke a notification event\r
+                                                                                                      \r
+  @param  Event                 Event whose notification function is being invoked.\r
+  @param  Context               Pointer to the notification function¡¯s context, \r
+                                which is implementation-dependent.                                                  \r
+                                                                                                      \r
+**/                                                                                                   \r
+typedef\r
+VOID\r
+(EFIAPI *EFI_EVENT_NOTIFY) (\r
+  IN EFI_EVENT                Event,\r
+  IN VOID                     *Context\r
+  );\r
+\r
+/**                                                                                                   \r
+  Creates an event.\r
+                                                                                                      \r
+  @param  Type                  The type of event to create and its mode and attributes.\r
+  @param  NotifyTpl             Pointer to the notification function¡¯s context.\r
+  @param  NotifyFunction        Pointer to the event¡¯s notification function, if any.  \r
+  @param  NotifyContext         Pointer to the notification function¡¯s context; corresponds to parameter\r
+                                Context in the notification function.                                                                                                          \r
+  @param  Event                 Pointer to the newly created event if the call succeeds; undefined  \r
+                                otherwise.                                                          \r
+\r
+  @retval EFI_SUCCESS           The event structure was created.                    \r
+  @retval EFI_INVALID_PARAMETER One or more parameters are invalid.\r
+  @retval EFI_OUT_OF_RESOURCES  The event could not be allocated.\r
+  \r
+**/                                                                                   \r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_CREATE_EVENT) (\r
+  IN UINT32                       Type,\r
+  IN EFI_TPL                      NotifyTpl,\r
+  IN EFI_EVENT_NOTIFY             NotifyFunction,\r
+  IN VOID                         *NotifyContext,\r
+  OUT EFI_EVENT                   *Event\r
+  );\r
+\r
+/**                                                                                                   \r
+  Creates an event in a group.\r
+                                                                                                      \r
+  @param  Type                  The type of event to create and its mode and attributes.\r
+  @param  NotifyTpl             Pointer to the notification function¡¯s context.\r
+  @param  NotifyFunction        Pointer to the event¡¯s notification function, if any.  \r
+  @param  NotifyContext         Pointer to the notification function¡¯s context; corresponds to parameter\r
+                                Context in the notification function.          \r
+  @param  EventGroup            Pointer to the unique identifier of the group to which this event belongs.                                                                                                                                \r
+  @param  Event                 Pointer to the newly created event if the call succeeds; undefined  \r
+                                otherwise.                                                          \r
+\r
+  @retval EFI_SUCCESS           The event structure was created.                    \r
+  @retval EFI_INVALID_PARAMETER One or more parameters are invalid.\r
+  @retval EFI_OUT_OF_RESOURCES  The event could not be allocated.\r
+  \r
+**/                 \r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_CREATE_EVENT_EX) (\r
+  IN UINT32                 Type,\r
+  IN EFI_TPL                NotifyTpl      OPTIONAL,\r
+  IN EFI_EVENT_NOTIFY       NotifyFunction OPTIONAL,\r
+  IN CONST VOID             *NotifyContext OPTIONAL,\r
+  IN CONST EFI_GUID         *EventGroup    OPTIONAL,\r
+  OUT EFI_EVENT             *Event\r
+  );\r
+\r
+typedef enum {\r
+  TimerCancel,\r
+  TimerPeriodic,\r
+  TimerRelative\r
+} EFI_TIMER_DELAY;\r
+\r
+/**                                                 \r
+  Sets the type of timer and the trigger time for a timer event.\r
+                                                    \r
+  @param  Event                 The timer event that is to be signaled at the specified time.\r
+  @param  Type                  The type of time that is specified in TriggerTime.\r
+  @param  TriggerTime           The number of 100ns units until the timer expires.  \r
+\r
+  @retval EFI_SUCCESS           The event has been set to be signaled at the requested time.  \r
+  @retval EFI_INVALID_PARAMETER Event or Type is not valid.\r
+  \r
+**/         \r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_SET_TIMER) (\r
+  IN EFI_EVENT                Event,\r
+  IN EFI_TIMER_DELAY          Type,\r
+  IN UINT64                   TriggerTime\r
+  );\r
+\r
+/**                                                                                                   \r
+  Signals an event.\r
+                                                                                                       \r
+  @param  Event                 The event to signal.\r
+\r
+  @retval EFI_SUCCESS           The event has been signaled.  \r
+  \r
+**/                 \r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_SIGNAL_EVENT) (\r
+  IN EFI_EVENT                Event\r
+  );\r
+\r
+/**                                                                                                   \r
+  Stops execution until an event is signaled.\r
+                                                                                                       \r
+  @param  NumberOfEvents        The number of events in the Event array.\r
+  @param  Event                 An array of EFI_EVENT.\r
+  @param  Index                 Pointer to the index of the event which satisfied the wait condition.\r
+\r
+  @retval EFI_SUCCESS           The event indicated by Index was signaled.\r
+  @retval EFI_INVALID_PARAMETER 1) NumberOfEvents is 0.\r
+                                2) The event indicated by Index is of type\r
+                                   EVT_NOTIFY_SIGNAL.                     \r
+  @retval EFI_UNSUPPORTED       The current TPL is not TPL_APPLICATION.                                   \r
+  \r
+**/          \r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_WAIT_FOR_EVENT) (\r
+  IN UINTN                    NumberOfEvents,\r
+  IN EFI_EVENT                *Event,\r
+  OUT UINTN                   *Index\r
+  );\r
+\r
+/**                                                                                                   \r
+  Closes an event.\r
+                                                                                                       \r
+  @param  Event                 The event to close.\r
+\r
+  @retval EFI_SUCCESS           The event has been closed.  \r
+  \r
+**/                 \r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_CLOSE_EVENT) (\r
+  IN EFI_EVENT                Event\r
+  );\r
+\r
+/**                                                 \r
+  Checks whether an event is in the signaled state.\r
+                                                    \r
+  @param  Event                 The event to check.\r
+\r
+  @retval EFI_SUCCESS           The event is in the signaled state.\r
+  @retval EFI_NOT_READY         The event is not in the signaled state.\r
+  @retval EFI_INVALID_PARAMETER Event is of type EVT_NOTIFY_SIGNAL.\r
+  \r
+**/         \r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_CHECK_EVENT) (\r
+  IN EFI_EVENT                Event\r
+  );\r
+\r
+//\r
+// Task priority level (name defined in spec).\r
+//\r
+#define TPL_APPLICATION       4\r
+#define TPL_CALLBACK          8\r
+#define TPL_NOTIFY            16\r
+#define TPL_HIGH_LEVEL        31\r
+\r
+//\r
+// Task priority level (name following coding style).\r
+//\r
+#define EFI_TPL_APPLICATION   TPL_APPLICATION\r
+#define EFI_TPL_CALLBACK      TPL_CALLBACK\r
+#define EFI_TPL_NOTIFY        TPL_NOTIFY\r
+#define EFI_TPL_HIGH_LEVEL    TPL_HIGH_LEVEL\r
+\r
+/**                                                 \r
+  Raises a task¡¯s priority level and returns its previous level.\r
+                                                    \r
+  @param  NewTpl                The new task priority level.\r
+  \r
+  @retval                       Previous task priority level  \r
+  \r
+**/         \r
+typedef\r
+EFI_TPL\r
+(EFIAPI *EFI_RAISE_TPL) (\r
+  IN EFI_TPL      NewTpl\r
+  );\r
+\r
+/**                                                 \r
+  Restores a task¡¯s priority level to its previous value.\r
+                                                    \r
+  @param  OldTpl                The previous task priority level to restore    \r
+  \r
+**/       \r
+typedef\r
+VOID\r
+(EFIAPI *EFI_RESTORE_TPL) (\r
+  IN EFI_TPL      OldTpl\r
+  );\r
+\r
+//\r
+// Variable attributes\r
+//\r
+#define EFI_VARIABLE_NON_VOLATILE       0x00000001\r
+#define EFI_VARIABLE_BOOTSERVICE_ACCESS 0x00000002\r
+#define EFI_VARIABLE_RUNTIME_ACCESS     0x00000004\r
+\r
+/**                                                 \r
+  Returns the value of a variable.\r
+                                                    \r
+  @param  VariableName          A Null-terminated Unicode string that is the name of the\r
+                                vendor¡¯s variable.                                     \r
+  @param  VendorGuid            A unique identifier for the vendor.                    \r
+  @param  Attributes            If not NULL, a pointer to the memory location to return the\r
+                                attributes bitmask for the variable.                       \r
+  @param  DataSize              On input, the size in bytes of the return Data buffer.\r
+                                On output the size of data returned in Data.          \r
+  @param  Data                  The buffer to return the contents of the variable.                                \r
+  \r
+  @retval EFI_SUCCESS           The function completed successfully.\r
+  @retval EFI_NOT_FOUND         The variable was not found.\r
+  @retval EFI_BUFFER_TOO_SMALL  The DataSize is too small for the result.\r
+  @retval EFI_INVALID_PARAMETER One or more parameters are invalid.\r
+  @retval EFI_DEVICE_ERROR      The variable could not be retrieved due to a hardware error.\r
+  \r
+**/         \r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_GET_VARIABLE) (\r
+  IN CHAR16                       *VariableName,\r
+  IN EFI_GUID                     *VendorGuid,\r
+  OUT UINT32                      *Attributes,    OPTIONAL\r
+  IN OUT UINTN                    *DataSize,\r
+  OUT VOID                        *Data\r
+  );\r
+\r
+/**                                                 \r
+  Enumerates the current variable names.\r
+                                                    \r
+  @param  VariableNameSize      The size of the VariableName buffer.\r
+  @param  VariableName          On input, supplies the last VariableName that was returned     \r
+                                by GetNextVariableName(). On output, returns the Nullterminated\r
+                                Unicode string of the current variable.                                             \r
+  @param  VendorGuid            On input, supplies the last VendorGuid that was returned by\r
+                                GetNextVariableName(). On output, returns the              \r
+                                VendorGuid of the current variable.                          \r
+  \r
+  @retval EFI_SUCCESS           The function completed successfully.\r
+  @retval EFI_NOT_FOUND         The next variable was not found.\r
+  @retval EFI_BUFFER_TOO_SMALL  The VariableNameSize is too small for the result.\r
+  @retval EFI_INVALID_PARAMETER One or more parameters are invalid.\r
+  @retval EFI_DEVICE_ERROR      The variable could not be retrieved due to a hardware error.\r
+  \r
+**/        \r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_GET_NEXT_VARIABLE_NAME) (\r
+  IN OUT UINTN                    *VariableNameSize,\r
+  IN OUT CHAR16                   *VariableName,\r
+  IN OUT EFI_GUID                 *VendorGuid\r
+  );\r
+\r
+/**                                                                                               \r
+  Sets the value of a variable.\r
+                                                                                                    \r
+  @param  VariableName          A Null-terminated Unicode string that is the name of the\r
+                                vendor¡¯s variable.                                     \r
+  @param  VendorGuid            A unique identifier for the vendor.                                \r
+  @param  Attributes            Attributes bitmask to set for the variable.                                \r
+  @param  DataSize              The size in bytes of the Data buffer.\r
+  @param  Data                  The contents for the variable.\r
+                                                                                                  \r
+  @retval EFI_SUCCESS           The firmware has successfully stored the variable and its data as\r
+                                defined by the Attributes.                                       \r
+  @retval EFI_WRITE_PROTECTED   The variable in question is read-only.\r
+  @retval EFI_OUT_OF_RESOURCES  Not enough storage is available to hold the variable and its data.\r
+  @retval EFI_INVALID_PARAMETER One or more parameters are invalid.                               \r
+  @retval EFI_DEVICE_ERROR      The variable could not be retrieved due to a hardware error.      \r
+                                                                                                  \r
+**/                                                                                               \r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_SET_VARIABLE) (\r
+  IN CHAR16                       *VariableName,\r
+  IN EFI_GUID                     *VendorGuid,\r
+  IN UINT32                       Attributes,\r
+  IN UINTN                        DataSize,\r
+  IN VOID                         *Data\r
+  );\r
+\r
+//\r
+// EFI Time\r
+//\r
+typedef struct {\r
+  UINT32  Resolution;\r
+  UINT32  Accuracy;\r
+  BOOLEAN SetsToZero;\r
+} EFI_TIME_CAPABILITIES;\r
+\r
+/**                                                                 \r
+  Returns the current time and date information, and the time-keeping capabilities \r
+  of the hardware platform.\r
+                                                                    \r
+  @param  Time                  A pointer to storage to receive a snapshot of the current time.                                \r
+  @param  Capabilities          An optional pointer to a buffer to receive the real time clock \r
+                                device¡¯s capabilities.                                  \r
+                                                                    \r
+  @retval EFI_SUCCESS           The operation completed successfully.     \r
+  @retval EFI_INVALID_PARAMETER Time is NULL.\r
+  @retval EFI_DEVICE_ERROR      The time could not be retrieved due to hardware error.\r
+                                                                    \r
+**/                                                                 \r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_GET_TIME) (\r
+  OUT EFI_TIME                    *Time,\r
+  OUT EFI_TIME_CAPABILITIES       *Capabilities OPTIONAL\r
+  );\r
+\r
+/**                                                                 \r
+  Sets the current local time and date information.\r
+                                                                    \r
+  @param  Time                  A pointer to the current time.\r
+                                                                    \r
+  @retval EFI_SUCCESS           The operation completed successfully.     \r
+  @retval EFI_INVALID_PARAMETER A time field is out of range.\r
+  @retval EFI_DEVICE_ERROR      The time could not be set due due to hardware error.\r
+                                                                    \r
+**/    \r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_SET_TIME) (\r
+  IN EFI_TIME                     *Time\r
+  );\r
+  \r
+/**                                                                 \r
+  Returns the current wakeup alarm clock setting.\r
+  \r
+  @param  Enabled               Indicates if the alarm is currently enabled or disabled.\r
+  @param  Pending               Indicates if the alarm signal is pending and requires acknowledgement.                                                                      \r
+  @param  Time                  The current alarm setting.\r
+                                                                    \r
+  @retval EFI_SUCCESS           The alarm settings were returned.\r
+  @retval EFI_INVALID_PARAMETER Any parameter is NULL.\r
+  @retval EFI_DEVICE_ERROR      The wakeup time could not be retrieved due to a hardware error.\r
+                                                                    \r
+**/    \r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_GET_WAKEUP_TIME) (\r
+  OUT BOOLEAN                     *Enabled,\r
+  OUT BOOLEAN                     *Pending,\r
+  OUT EFI_TIME                    *Time\r
+  );\r
+\r
+/**                                                                 \r
+  Sets the system wakeup alarm clock time.\r
+  \r
+  @param  Enabled               Enable or disable the wakeup alarm.  \r
+  @param  Time                  If Enable is TRUE, the time to set the wakeup alarm for.\r
+                                                                    \r
+  @retval EFI_SUCCESS           If Enable is TRUE, then the wakeup alarm was enabled. If\r
+                                Enable is FALSE, then the wakeup alarm was disabled.    \r
+  @retval EFI_INVALID_PARAMETER A time field is out of range.\r
+  @retval EFI_DEVICE_ERROR      The wakeup time could not be set due to a hardware error.\r
+  @retval EFI_UNSUPPORTED       A wakeup timer is not supported on this platform.\r
+                                                                    \r
+**/    \r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_SET_WAKEUP_TIME) (\r
+  IN BOOLEAN                      Enable,\r
+  IN EFI_TIME                     *Time   OPTIONAL\r
+  );\r
+\r
+/**                                                                 \r
+  This is the declaration of an EFI image entry point. This can be the entry point to an application\r
+  written to this specification, an EFI boot service driver, or an EFI runtime driver.                \r
+  \r
+  @param  ImageHandle           Handle that identifies the loaded image.\r
+  @param  SystemTable           System Table for this image.\r
+                                                                    \r
+  @retval EFI_SUCCESS           The operation completed successfully.                                     \r
+  \r
+**/    \r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_IMAGE_ENTRY_POINT) (\r
+  IN EFI_HANDLE                   ImageHandle,\r
+  IN EFI_SYSTEM_TABLE             *SystemTable\r
+  );\r
+\r
+/**                                                                 \r
+  Loads an EFI image into memory.\r
+  \r
+  @param  BootPolicy            If TRUE, indicates that the request originates from the boot\r
+                                manager, and that the boot manager is attempting to load    \r
+                                FilePath as a boot selection. Ignored if SourceBuffer is    \r
+                                not NULL.                                                   \r
+  @param  ParentImageHandle     The caller¡¯s image handle.\r
+  @param  FilePath              The DeviceHandle specific file path from which the image is\r
+                                loaded.                                                     \r
+  @param  SourceBuffer          If not NULL, a pointer to the memory location containing a copy\r
+                                of the image to be loaded.                                     \r
+  @param  SourceSize            The size in bytes of SourceBuffer.  \r
+  @param  ImageHandle           Pointer to the returned image handle that is created when the\r
+                                image is successfully loaded.                                \r
+                                                                                 \r
+  @retval EFI_SUCCESS           Image was loaded into memory correctly.\r
+  @retval EFI_NOT_FOUND         Both SourceBuffer and FilePath are NULL.\r
+  @retval EFI_INVALID_PARAMETER One or more parametes are invalid.\r
+  @retval EFI_UNSUPPORTED       The image type is not supported.\r
+  @retval EFI_OUT_OF_RESOURCES  Image was not loaded due to insufficient resources.\r
+  @retval EFI_LOAD_ERROR        Image was not loaded because the image format was corrupt or not\r
+                                understood.                                                     \r
+  @retval EFI_DEVICE_ERROR      Image was not loaded because the device returned a read error.                          \r
+  \r
+**/    \r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_IMAGE_LOAD) (\r
+  IN BOOLEAN                      BootPolicy,\r
+  IN EFI_HANDLE                   ParentImageHandle,\r
+  IN EFI_DEVICE_PATH_PROTOCOL     *FilePath,\r
+  IN VOID                         *SourceBuffer OPTIONAL,\r
+  IN UINTN                        SourceSize,\r
+  OUT EFI_HANDLE                  *ImageHandle\r
+  );\r
+\r
+/**                                                                 \r
+  Transfers control to a loaded image¡¯s entry point.\r
+  \r
+  @param  ImageHandle           Handle of image to be started.  \r
+  @param  ExitDataSize          Pointer to the size, in bytes, of ExitData.\r
+  @param  ExitData              Pointer to a pointer to a data buffer that includes a Null-terminated\r
+                                Unicode string, optionally followed by additional binary data.       \r
+                                                                                  \r
+  @retval EFI_INVALID_PARAMETER ImageHandle is either an invalid image handle or the image\r
+                                has already been initialized with StartImage\r
+  @retval Exit code from image  Exit code from image\r
+  \r
+**/    \r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_IMAGE_START) (\r
+  IN EFI_HANDLE                   ImageHandle,\r
+  OUT UINTN                       *ExitDataSize,\r
+  OUT CHAR16                      **ExitData    OPTIONAL\r
+  );\r
+\r
+/**                                                                 \r
+  Terminates a loaded EFI image and returns control to boot services.\r
+  \r
+  @param  ImageHandle           Handle that identifies the image.\r
+  @param  ExitStatus            The image¡¯s exit code.\r
+  @param  ExitDataSize          The size, in bytes, of ExitData.\r
+  @param  ExitData              Pointer to a data buffer that includes a Null-terminated Unicode string,                    \r
+                                optionally followed by additional binary data.                                                                            \r
+                                \r
+  @retval EFI_SUCCESS           The image specified by ImageHandle was unloaded.  \r
+  @retval EFI_INVALID_PARAMETER The image specified by ImageHandle has been loaded and\r
+                                started with LoadImage() and StartImage(), but the    \r
+                                image is not the currently executing image.               \r
+  \r
+**/    \r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_EXIT) (\r
+  IN EFI_HANDLE                   ImageHandle,\r
+  IN EFI_STATUS                   ExitStatus,\r
+  IN UINTN                        ExitDataSize,\r
+  IN CHAR16                       *ExitData     OPTIONAL\r
+  );\r
+\r
+/**                                                                 \r
+  Unloads an image.\r
+  \r
+  @param  ImageHandle           Handle that identifies the image to be unloaded.\r
+                                \r
+  @retval EFI_SUCCESS           The image has been unloaded.\r
+  @retval EFI_INVALID_PARAMETER ImageHandle is not a valid image handle.\r
+  @retval EFI_UNSUPPORTED       The image has been started, and does not support unload.\r
+  @retval                       Exit code from the image's unload handler                                \r
+  \r
+**/    \r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_IMAGE_UNLOAD) (\r
+  IN EFI_HANDLE                   ImageHandle\r
+  );\r
+\r
+/**                                                                 \r
+  Terminates all boot services.\r
+  \r
+  @param  ImageHandle           Handle that identifies the exiting image.\r
+  @param  MapKey                Key to the latest memory map.\r
+                                \r
+  @retval EFI_SUCCESS           Boot services have been terminated.\r
+  @retval EFI_INVALID_PARAMETER MapKey is incorrect.  \r
+  \r
+**/  \r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_EXIT_BOOT_SERVICES) (\r
+  IN EFI_HANDLE                   ImageHandle,\r
+  IN UINTN                        MapKey\r
+  );\r
+\r
+/**                                                                 \r
+  Induces a fine-grained stall.\r
+  \r
+  @param  Microseconds          The number of microseconds to stall execution.  \r
+                                \r
+  @retval EFI_SUCCESS           Execution was stalled at least the requested number of\r
+                                Microseconds.  \r
+  \r
+**/  \r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_STALL) (\r
+  IN UINTN                    Microseconds\r
+  );\r
+\r
+/**                                                                 \r
+  Sets the system¡¯s watchdog timer.\r
+  \r
+  @param  Timeout               The number of seconds to set the watchdog timer to.\r
+  @param  WatchdogCode          The numeric code to log on a watchdog timer timeout event.\r
+  @param  DataSize              The size, in bytes, of WatchdogData.\r
+  @param  WatchdogData          A data buffer that includes a Null-terminated Unicode string, optionally\r
+                                followed by additional binary data.                                       \r
+                                \r
+  @retval EFI_SUCCESS           The timeout has been set.\r
+  @retval EFI_INVALID_PARAMETER The supplied WatchdogCode is invalid.                               \r
+  @retval EFI_UNSUPPORTED       The system does not have a watchdog timer.\r
+  @retval EFI_DEVICE_ERROR      The watch dog timer could not be programmed due to a hardware\r
+                                error.                                                       \r
+                                \r
+**/  \r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_SET_WATCHDOG_TIMER) (\r
+  IN UINTN                    Timeout,\r
+  IN UINT64                   WatchdogCode,\r
+  IN UINTN                    DataSize,\r
+  IN CHAR16                   *WatchdogData OPTIONAL\r
+  );\r
+\r
+typedef enum {\r
+  EfiResetCold,\r
+  EfiResetWarm,\r
+  EfiResetShutdown,\r
+#if ((EDK_RELEASE_VERSION != 0) && (EFI_SPECIFICATION_VERSION < 0x00020000))\r
+  //\r
+  // Tiano extension for capsules that was removed after UEFI 2.0 came out\r
+  //\r
+  EfiResetUpdate\r
+#endif\r
+} EFI_RESET_TYPE;\r
+\r
+/**                                                                 \r
+  Resets the entire platform.\r
+  \r
+  @param  ResetType             The type of reset to perform.\r
+  @param  ResetStatus           The status code for the reset.\r
+  @param  DataSize              The size, in bytes, of WatchdogData.\r
+  @param  ResetData             For a ResetType of EfiResetCold, EfiResetWarm, or             \r
+                                EfiResetShutdown the data buffer starts with a Null-terminated\r
+                                Unicode string, optionally followed by additional binary data.\r
+\r
+**/  \r
+typedef\r
+VOID\r
+(EFIAPI *EFI_RESET_SYSTEM) (\r
+  IN EFI_RESET_TYPE           ResetType,\r
+  IN EFI_STATUS               ResetStatus,\r
+  IN UINTN                    DataSize,\r
+  IN CHAR16                   *ResetData OPTIONAL\r
+  );\r
+\r
+/**                                                                 \r
+  Returns a monotonically increasing count for the platform.\r
+  \r
+  @param  Count                 Pointer to returned value.\r
+                                \r
+  @retval EFI_SUCCESS           The next monotonic count was returned.\r
+  @retval EFI_INVALID_PARAMETER Count is NULL.                         \r
+  @retval EFI_DEVICE_ERROR      The device is not functioning properly.                                                  \r
+                                \r
+**/  \r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_GET_NEXT_MONOTONIC_COUNT) (\r
+  OUT UINT64                  *Count\r
+  );\r
+\r
+/**                                                                 \r
+  Returns the next high 32 bits of the platform¡¯s monotonic counter.\r
+  \r
+  @param  HighCount             Pointer to returned value.\r
+                                \r
+  @retval EFI_SUCCESS           The next high monotonic count was returned.\r
+  @retval EFI_INVALID_PARAMETER HighCount is NULL.                         \r
+  @retval EFI_DEVICE_ERROR      The device is not functioning properly.                                                  \r
+                                \r
+**/  \r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_GET_NEXT_HIGH_MONO_COUNT) (\r
+  OUT UINT32                  *HighCount\r
+  );\r
+\r
+/**                                                                 \r
+  Computes and returns a 32-bit CRC for a data buffer.\r
+  \r
+  @param  Data                  A pointer to the buffer on which the 32-bit CRC is to be computed.\r
+  @param  DataSize              The number of bytes in the buffer Data.\r
+  @param  Crc32                 The 32-bit CRC that was computed for the data buffer specified by Data\r
+                                and DataSize.\r
+                                \r
+  @retval EFI_SUCCESS           The 32-bit CRC was computed for the data buffer and returned in\r
+                                Crc32.                                                           \r
+  @retval EFI_INVALID_PARAMETER One or more parameters are invalid.  \r
+                                \r
+**/  \r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_CALCULATE_CRC32) (\r
+  IN  VOID                              *Data,\r
+  IN  UINTN                             DataSize,\r
+  OUT UINT32                            *Crc32\r
+  );\r
+\r
+/**                                                                 \r
+  Copies the contents of one buffer to another buffer.\r
+  \r
+  @param  Destination           Pointer to the destination buffer of the memory copy.\r
+  @param  Source                Pointer to the source buffer of the memory copy.\r
+  @param  Length                Number of bytes to copy from Source to Destination.                                \r
+                                \r
+**/  \r
+typedef\r
+VOID\r
+(EFIAPI *EFI_COPY_MEM) (\r
+  IN VOID     *Destination,\r
+  IN VOID     *Source,\r
+  IN UINTN    Length\r
+  );\r
+\r
+/**                                                                 \r
+  The SetMem() function fills a buffer with a specified value.\r
+  \r
+  @param  Buffer                Pointer to the buffer to fill.\r
+  @param  Size                  Number of bytes in Buffer to fill.\r
+  @param  Value                 Value to fill Buffer with.\r
+                                \r
+**/  \r
+typedef\r
+VOID\r
+(EFIAPI *EFI_SET_MEM) (\r
+  IN VOID     *Buffer,\r
+  IN UINTN    Size,\r
+  IN UINT8    Value\r
+  );\r
+\r
+//\r
+// Protocol handler functions\r
+//\r
+typedef enum {\r
+  EFI_NATIVE_INTERFACE\r
+} EFI_INTERFACE_TYPE;\r
+\r
+/**                                                                 \r
+  Installs a protocol interface on a device handle. If the handle does not exist, it is created and added\r
+  to the list of handles in the system. InstallMultipleProtocolInterfaces() performs                     \r
+  more error checking than InstallProtocolInterface(), so it is recommended that                         \r
+  InstallMultipleProtocolInterfaces() be used in place of                                                \r
+  InstallProtocolInterface()                                                                             \r
+  \r
+  @param  Handle                A pointer to the EFI_HANDLE on which the interface is to be installed.\r
+  @param  Protocol              The numeric ID of the protocol interface.\r
+  @param  InterfaceType         Indicates whether Interface is supplied in native form.                                \r
+  @param  Interface             A pointer to the protocol interface.\r
+                                \r
+  @retval EFI_SUCCESS           The protocol interface was installed.\r
+  @retval EFI_OUT_OF_RESOURCES  Space for a new handle could not be allocated.                            \r
+  @retval EFI_INVALID_PARAMETER One or more parameters are invalid.  \r
+                                \r
+**/  \r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_INSTALL_PROTOCOL_INTERFACE) (\r
+  IN OUT EFI_HANDLE           *Handle,\r
+  IN EFI_GUID                 *Protocol,\r
+  IN EFI_INTERFACE_TYPE       InterfaceType,\r
+  IN VOID                     *Interface\r
+  );\r
+\r
+/**                                                                 \r
+  Installs one or more protocol interfaces into the boot services environment.\r
+  \r
+  @param  Handle                The handle to install the new protocol interfaces on, or NULL if a new\r
+                                handle is to be allocated.                                                                            \r
+  @param  ...                   A variable argument list containing pairs of protocol GUIDs and protocol\r
+                                interfaces.                                                               \r
+\r
+  @retval EFI_SUCCESS           All the protocol interface was installed.\r
+  @retval EFI_OUT_OF_RESOURCES  There was not enough memory in pool to install all the protocols.\r
+  @retval EFI_ALREADY_STARTED   A Device Path Protocol instance was passed in that is already present in\r
+                                the handle database.\r
+    \r
+**/  \r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_INSTALL_MULTIPLE_PROTOCOL_INTERFACES) (\r
+  IN OUT EFI_HANDLE           *Handle,\r
+  ...\r
+  );\r
+\r
+/**                                                                 \r
+  Reinstalls a protocol interface on a device handle.\r
+  \r
+  @param  Handle                Handle on which the interface is to be reinstalled.                                                                                   \r
+  @param  Protocol              The numeric ID of the interface.\r
+  @param  OldInterface          A pointer to the old interface. NULL can be used if a structure is not\r
+                                associated with Protocol.                                             \r
+  @param  NewInterface          A pointer to the new interface.                      \r
+  \r
+  @retval EFI_SUCCESS           The protocol interface was reinstalled.\r
+  @retval EFI_NOT_FOUND         The OldInterface on the handle was not found.\r
+  @retval EFI_ACCESS_DENIED     The protocol interface could not be reinstalled,\r
+                                because OldInterface is still being used by a   \r
+                                driver that will not release it.                \r
+  @retval EFI_INVALID_PARAMETER One or more parameters are invalid.                                \r
+    \r
+**/  \r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_REINSTALL_PROTOCOL_INTERFACE) (\r
+  IN EFI_HANDLE               Handle,\r
+  IN EFI_GUID                 *Protocol,\r
+  IN VOID                     *OldInterface,\r
+  IN VOID                     *NewInterface\r
+  );\r
+\r
+/**                                                                 \r
+  Removes a protocol interface from a device handle. It is recommended that\r
+  UninstallMultipleProtocolInterfaces() be used in place of                \r
+  UninstallProtocolInterface().                                            \r
+  \r
+  @param  Handle                The handle on which the interface was installed.\r
+  @param  Protocol              The numeric ID of the interface.\r
+  @param  Interface             A pointer to the interface.                      \r
+  \r
+  @retval EFI_SUCCESS           The interface was removed.\r
+  @retval EFI_NOT_FOUND         The interface was not found.\r
+  @retval EFI_ACCESS_DENIED     The interface was not removed because the interface\r
+                                is still being used by a driver.                                                                                               \r
+  @retval EFI_INVALID_PARAMETER One or more parameters are invalid.                                \r
+    \r
+**/  \r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_UNINSTALL_PROTOCOL_INTERFACE) (\r
+  IN EFI_HANDLE               Handle,\r
+  IN EFI_GUID                 *Protocol,\r
+  IN VOID                     *Interface\r
+  );\r
+\r
+/**                                                                 \r
+  Removes one or more protocol interfaces into the boot services environment.                                      \r
+  \r
+  @param  Handle                The handle to remove the protocol interfaces from.  \r
+  @param  ...                   A variable argument list containing pairs of protocol GUIDs and\r
+                                protocol interfaces.\r
+  \r
+  @retval EFI_SUCCESS           All the protocol interfaces were removed.                                                                                        \r
+  @retval EFI_INVALID_PARAMETER One of the protocol interfaces was not previously installed on Handle.                          \r
+    \r
+**/  \r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_UNINSTALL_MULTIPLE_PROTOCOL_INTERFACES) (\r
+  IN EFI_HANDLE           Handle,\r
+  ...\r
+  );\r
+\r
+/**                                                                 \r
+  Queries a handle to determine if it supports a specified protocol.\r
+  \r
+  @param  Handle                The handle being queried.\r
+  @param  Protocol              The published unique identifier of the protocol.\r
+  @param  Interface             Supplies the address where a pointer to the corresponding Protocol\r
+                                Interface is returned.                                            \r
+  @retval EFI_SUCCESS           The interface information for the specified protocol was returned.\r
+  @retval EFI_UNSUPPORTED       The device does not support the specified protocol.\r
+  @retval EFI_INVALID_PARAMETER One of the protocol interfaces was not previously installed on Handle.                          \r
+    \r
+**/  \r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_HANDLE_PROTOCOL) (\r
+  IN EFI_HANDLE               Handle,\r
+  IN EFI_GUID                 *Protocol,\r
+  OUT VOID                    **Interface\r
+  );\r
+\r
+#define EFI_OPEN_PROTOCOL_BY_HANDLE_PROTOCOL  0x00000001\r
+#define EFI_OPEN_PROTOCOL_GET_PROTOCOL        0x00000002\r
+#define EFI_OPEN_PROTOCOL_TEST_PROTOCOL       0x00000004\r
+#define EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER 0x00000008\r
+#define EFI_OPEN_PROTOCOL_BY_DRIVER           0x00000010\r
+#define EFI_OPEN_PROTOCOL_EXCLUSIVE           0x00000020\r
+\r
+/**                                                                 \r
+  Queries a handle to determine if it supports a specified protocol. If the protocol is supported by the\r
+  handle, it opens the protocol on behalf of the calling agent.\r
+    \r
+  @param  Handle                The handle for the protocol interface that is being opened.\r
+  @param  Protocol              The published unique identifier of the protocol.\r
+  @param  Interface             Supplies the address where a pointer to the corresponding Protocol\r
+                                Interface is returned.                                            \r
+  @param  AgentHandle           The handle of the agent that is opening the protocol interface\r
+                                specified by Protocol and Interface.                            \r
+  @param  ControllerHandle      If the agent that is opening a protocol is a driver that follows the                          \r
+                                UEFI Driver Model, then this parameter is the controller handle     \r
+                                that requires the protocol interface. If the agent does not follow  \r
+                                the UEFI Driver Model, then this parameter is optional and may      \r
+                                be NULL.                                                            \r
+  @param  Attributes            The open mode of the protocol interface specified by Handle                    \r
+                                and Protocol.             \r
+                                                                 \r
+  @retval EFI_SUCCESS           An item was added to the open list for the protocol interface, and the\r
+                                protocol interface was returned in Interface.                         \r
+  @retval EFI_UNSUPPORTED       Handle does not support Protocol.\r
+  @retval EFI_INVALID_PARAMETER One or more parameters are invalid.\r
+  @retval EFI_ACCESS_DENIED     Required attributes can't be supported in current environment.\r
+  @retval EFI_ALREADY_STARTED   Item on the open list already has requierd attributes whose agent\r
+                                handle is the same as AgentHandle.                                \r
+    \r
+**/  \r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_OPEN_PROTOCOL) (\r
+  IN EFI_HANDLE                 Handle,\r
+  IN EFI_GUID                   *Protocol,\r
+  OUT VOID                      **Interface,\r
+  IN  EFI_HANDLE                AgentHandle,\r
+  IN  EFI_HANDLE                ControllerHandle, OPTIONAL\r
+  IN  UINT32                    Attributes\r
+  );\r
+\r
+  \r
+/**                                                                 \r
+  Closes a protocol on a handle that was opened using OpenProtocol().\r
+    \r
+  @param  Handle                The handle for the protocol interface that was previously opened\r
+                                with OpenProtocol(), and is now being closed.                   \r
+  @param  Protocol              The published unique identifier of the protocol.\r
+  @param  Interface             Supplies the address where a pointer to the corresponding Protocol\r
+                                Interface is returned.                                            \r
+  @param  AgentHandle           The handle of the agent that is closing the protocol interface.                                 \r
+  @param  ControllerHandle      If the agent that opened a protocol is a driver that follows the\r
+                                UEFI Driver Model, then this parameter is the controller handle \r
+                                that required the protocol interface.                           \r
+                                                                 \r
+  @retval EFI_SUCCESS           The protocol instance was closed.                                  \r
+  @retval EFI_INVALID_PARAMETER One or more parameters are invalid.  \r
+  @retval EFI_NOT_FOUND         1) Handle does not support the protocol specified by Protocol.\r
+                                2) The protocol interface specified by Handle and Protocol is not\r
+                                   currently open by AgentHandle and ControllerHandle.           \r
+                                   \r
+**/  \r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_CLOSE_PROTOCOL) (\r
+  IN EFI_HANDLE               Handle,\r
+  IN EFI_GUID                 *Protocol,\r
+  IN EFI_HANDLE               AgentHandle,\r
+  IN EFI_HANDLE               ControllerHandle\r
+  );\r
+\r
+typedef struct {\r
+  EFI_HANDLE  AgentHandle;\r
+  EFI_HANDLE  ControllerHandle;\r
+  UINT32      Attributes;\r
+  UINT32      OpenCount;\r
+} EFI_OPEN_PROTOCOL_INFORMATION_ENTRY;\r
+\r
+/**                                                                 \r
+  Retrieves the list of agents that currently have a protocol interface opened.\r
+    \r
+  @param  Handle                The handle for the protocol interface that is being queried.                                    \r
+  @param  Protocol              The published unique identifier of the protocol.\r
+  @param  EntryBuffer           A pointer to a buffer of open protocol information in the form of\r
+                                EFI_OPEN_PROTOCOL_INFORMATION_ENTRY structures.                  \r
+  @param  EntryCount            A pointer to the number of entries in EntryBuffer.\r
+                                                                 \r
+  @retval EFI_SUCCESS           The open protocol information was returned in EntryBuffer, and the\r
+                                number of entries was returned EntryCount.                        \r
+  @retval EFI_OUT_OF_RESOURCES  There are not enough resources available to allocate EntryBuffer.\r
+  @retval EFI_NOT_FOUND         Handle does not support the protocol specified by Protocol.\r
+                                   \r
+**/  \r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_OPEN_PROTOCOL_INFORMATION) (\r
+  IN  EFI_HANDLE                          Handle,\r
+  IN  EFI_GUID                            *Protocol,\r
+  IN  EFI_OPEN_PROTOCOL_INFORMATION_ENTRY **EntryBuffer,\r
+  OUT UINTN                               *EntryCount\r
+  );\r
+\r
+/**                                                                 \r
+  Retrieves the list of protocol interface GUIDs that are installed on a handle in a buffer allocated\r
+  from pool.                                                                                           \r
+  \r
+  @param  Handle                The handle from which to retrieve the list of protocol interface\r
+                                GUIDs.                                                            \r
+  @param  ProtocolBuffer        A pointer to the list of protocol interface GUID pointers that are\r
+                                installed on Handle.                                                    \r
+  @param  ProtocolBufferCount   A pointer to the number of GUID pointers present in \r
+                                ProtocolBuffer.                                      \r
+                                \r
+  @retval EFI_SUCCESS           The list of protocol interface GUIDs installed on Handle was returned in\r
+                                ProtocolBuffer. The number of protocol interface GUIDs was              \r
+                                returned in ProtocolBufferCount.                                        \r
+  @retval EFI_OUT_OF_RESOURCES  There is not enough pool memory to store the results.\r
+  @retval EFI_INVALID_PARAMETER One or more parameters are invalid.\r
+                                   \r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_PROTOCOLS_PER_HANDLE) (\r
+  IN EFI_HANDLE       Handle,\r
+  OUT EFI_GUID        ***ProtocolBuffer,\r
+  OUT UINTN           *ProtocolBufferCount\r
+  );\r
+\r
+/**                                                                 \r
+  Creates an event that is to be signaled whenever an interface is installed for a specified protocol.  \r
+  \r
+  @param  Protocol              The numeric ID of the protocol for which the event is to be registered.                                \r
+  @param  Event                 Event that is to be signaled whenever a protocol interface is registered\r
+                                for Protocol.                                                           \r
+  @param  Registration          A pointer to a memory location to receive the registration value.                                \r
+                                \r
+  @retval EFI_SUCCESS           The notification event has been registered.                                                                \r
+  @retval EFI_OUT_OF_RESOURCES  Space for the notification event could not be allocated.\r
+  @retval EFI_INVALID_PARAMETER One or more parameters are invalid.\r
+                                   \r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_REGISTER_PROTOCOL_NOTIFY) (\r
+  IN EFI_GUID                 *Protocol,\r
+  IN EFI_EVENT                Event,\r
+  OUT VOID                    **Registration\r
+  );\r
+\r
+typedef enum {\r
+  AllHandles,\r
+  ByRegisterNotify,\r
+  ByProtocol\r
+} EFI_LOCATE_SEARCH_TYPE;\r
+\r
+/**                                                                 \r
+  Returns an array of handles that support a specified protocol.\r
+  \r
+  @param  SearchType            Specifies which handle(s) are to be returned.\r
+  @param  Protocol              Specifies the protocol to search by.\r
+  @param  SearchKey             Specifies the search key.                \r
+  @param  BufferSize            On input, the size in bytes of Buffer. On output, the size in bytes of     \r
+                                the array returned in Buffer (if the buffer was large enough) or the       \r
+                                size, in bytes, of the buffer needed to obtain the array (if the buffer was\r
+                                not large enough).                                                             \r
+  @param  Buffer                The buffer in which the array is returned.\r
+                                \r
+  @retval EFI_SUCCESS           The array of handles was returned.\r
+  @retval EFI_NOT_FOUND         No handles match the search.\r
+  @retval EFI_BUFFER_TOO_SMALL  The BufferSize is too small for the result.  \r
+  @retval EFI_INVALID_PARAMETER One or more parameters are invalid.\r
+                                   \r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_LOCATE_HANDLE) (\r
+  IN EFI_LOCATE_SEARCH_TYPE   SearchType,\r
+  IN EFI_GUID                 *Protocol,    OPTIONAL\r
+  IN VOID                     *SearchKey,   OPTIONAL\r
+  IN OUT UINTN                *BufferSize,\r
+  OUT EFI_HANDLE              *Buffer\r
+  );\r
+\r
+/**                                                                 \r
+  Locates the handle to a device on the device path that supports the specified protocol.\r
+    \r
+  @param  Protocol              Specifies the protocol to search for.\r
+  @param  DevicePath            On input, a pointer to a pointer to the device path. On output, the device\r
+                                path pointer is modified to point to the remaining part of the device     \r
+                                path.                                                                        \r
+  @param  Device                A pointer to the returned device handle.  \r
+                                \r
+  @retval EFI_SUCCESS           The resulting handle was returned.\r
+  @retval EFI_NOT_FOUND         No handles match the search.  \r
+  @retval EFI_INVALID_PARAMETER One or more parameters are invalid.\r
+                                   \r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_LOCATE_DEVICE_PATH) (\r
+  IN EFI_GUID                         *Protocol,\r
+  IN OUT EFI_DEVICE_PATH_PROTOCOL     **DevicePath,\r
+  OUT EFI_HANDLE                      *Device\r
+  );\r
+\r
+/**                                                                 \r
+  Adds, updates, or removes a configuration table entry from the EFI System Table.\r
+    \r
+  @param  Guid                  A pointer to the GUID for the entry to add, update, or remove.\r
+  @param  Table                 A pointer to the configuration table for the entry to add, update, or\r
+                                remove. May be NULL.                                                   \r
+                                \r
+  @retval EFI_SUCCESS           The (Guid, Table) pair was added, updated, or removed.\r
+  @retval EFI_NOT_FOUND         An attempt was made to delete a nonexistent entry.\r
+  @retval EFI_INVALID_PARAMETER Guid is not valid.\r
+  @retval EFI_OUT_OF_RESOURCES  There is not enough memory available to complete the operation.\r
+                                   \r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_INSTALL_CONFIGURATION_TABLE) (\r
+  IN EFI_GUID                 *Guid,\r
+  IN VOID                     *Table\r
+  );\r
+\r
+/**                                                                 \r
+  Reserved service.\r
+                                    \r
+  @retval EFI_SUCCESS           The operation has been completed successfully.\r
+                                   \r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_RESERVED_SERVICE) (\r
+  VOID\r
+  );\r
+\r
+/**                                                                 \r
+  Returns an array of handles that support the requested protocol in a buffer allocated from pool.\r
+  \r
+  @param  SearchType            Specifies which handle(s) are to be returned.\r
+  @param  Protocol              Specifies the protocol to search by.\r
+  @param  SearchKey             Supplies the search key depending on the SearchType.\r
+  @param  NoHandles             The number of handles returned in Buffer.\r
+  @param  Buffer                A pointer to the buffer to return the requested array of handles that\r
+                                support Protocol.                                                    \r
+                                \r
+  @retval EFI_SUCCESS           The array of handles was returned in Buffer, and the number of\r
+                                handles in Buffer was returned in NoHandles.                  \r
+  @retval EFI_NOT_FOUND         No handles match the search.\r
+  @retval EFI_OUT_OF_RESOURCES  There is not enough pool memory to store the matching results.\r
+  @retval EFI_INVALID_PARAMETER One or more parameters are invalid.\r
+                                   \r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_LOCATE_HANDLE_BUFFER) (\r
+  IN EFI_LOCATE_SEARCH_TYPE       SearchType,\r
+  IN EFI_GUID                     *Protocol,      OPTIONAL\r
+  IN VOID                         *SearchKey,     OPTIONAL\r
+  IN OUT UINTN                    *NoHandles,\r
+  OUT EFI_HANDLE                  **Buffer\r
+  );\r
+\r
+/**                                                                 \r
+  Returns the first protocol instance that matches the given protocol.\r
+    \r
+  @param  Protocol              Provides the protocol to search for.\r
+  @param  Registration          Optional registration key returned from\r
+                                RegisterProtocolNotify().              \r
+  @param  Interface             On return, a pointer to the first interface that matches Protocol and\r
+                                Registration.   \r
+                                                                                     \r
+  @retval EFI_SUCCESS           A protocol instance matching Protocol was found and returned in\r
+                                Interface.                                                     \r
+  @retval EFI_NOT_FOUND         No protocol instances were found that match Protocol and\r
+                                Registration.                                            \r
+  @retval EFI_INVALID_PARAMETER Interface is NULL.\r
+                                   \r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_LOCATE_PROTOCOL) (\r
+  IN EFI_GUID  *Protocol,\r
+  IN VOID      *Registration, OPTIONAL\r
+  OUT VOID      **Interface\r
+  );\r
+\r
+\r
+typedef struct {\r
+  UINT64                            Length;\r
+  union {\r
+    EFI_PHYSICAL_ADDRESS  DataBlock;\r
+    EFI_PHYSICAL_ADDRESS  ContinuationPointer;\r
+  } Union;\r
+} UEFI_CAPSULE_BLOCK_DESCRIPTOR;\r
+\r
+typedef struct {\r
+  EFI_GUID    CapsuleGuid;\r
+  UINT32            HeaderSize;\r
+  UINT32            Flags;\r
+  UINT32            CapsuleImageSize;\r
+} UEFI_CAPSULE_HEADER;\r
+\r
+#define CAPSULE_FLAGS_PERSIST_ACROSS_RESET        0x00010000\r
+#define CAPSULE_FLAGS_POPULATE_SYSTEM_TABLE         0x00020000\r
+\r
+/**                                                                 \r
+  Passes capsules to the firmware with both virtual and physical mapping. Depending on the intended\r
+  consumption, the firmware may process the capsule immediately. If the payload should persist     \r
+  across a system reset, the reset value returned from EFI_QueryCapsuleCapabilities must           \r
+  be passed into ResetSystem() and will cause the capsule to be processed by the firmware as       \r
+  part of the reset process.                                                                       \r
+    \r
+  @param  CapsuleHeaderArray    Virtual pointer to an array of virtual pointers to the capsules\r
+                                being passed into update capsule.                              \r
+  @param  CapsuleCount          Number of pointers to EFI_CAPSULE_HEADER in\r
+                                CaspuleHeaderArray.                        \r
+  @param  ScatterGatherList     Physical pointer to a set of                   \r
+                                EFI_CAPSULE_BLOCK_DESCRIPTOR that describes the\r
+                                location in physical memory of a set of capsules.\r
+                                                                                   \r
+  @retval EFI_SUCCESS           Valid capsule was passed. If                     \r
+                                CAPSULE_FLAGS_PERSIT_ACROSS_RESET is not set, the\r
+                                capsule has been successfully processed by the firmware.\r
+  @retval EFI_DEVICE_ERROR      The capsule update was started, but failed due to a device error.                                \r
+  @retval EFI_INVALID_PARAMETER CapsuleSize is NULL.\r
+                                   \r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_UPDATE_CAPSULE) (\r
+  IN UEFI_CAPSULE_HEADER    **CapsuleHeaderArray,\r
+  IN UINTN                  CapsuleCount,\r
+  IN EFI_PHYSICAL_ADDRESS   ScatterGatherList   OPTIONAL\r
+  );\r
+\r
+/**                                                                 \r
+  Returns if the capsule can be supported via UpdateCapsule().\r
+    \r
+  @param  CapsuleHeaderArray    Virtual pointer to an array of virtual pointers to the capsules\r
+                                being passed into update capsule.                              \r
+  @param  CapsuleCount          Number of pointers to EFI_CAPSULE_HEADER in\r
+                                CaspuleHeaderArray.                        \r
+  @param  MaxiumCapsuleSize     On output the maximum size that UpdateCapsule() can\r
+                                support as an argument to UpdateCapsule() via      \r
+                                CapsuleHeaderArray and ScatterGatherList.            \r
+  @param  ResetType             Returns the type of reset required for the capsule update.                                \r
+                                                                                   \r
+  @retval EFI_SUCCESS           Valid answer returned.                                                                \r
+  @retval EFI_UNSUPPORTED       The capsule type is not supported on this platform, and\r
+                                MaximumCapsuleSize and ResetType are undefined.        \r
+  @retval EFI_INVALID_PARAMETER MaximumCapsuleSize is NULL.\r
+                                   \r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_QUERY_CAPSULE_CAPABILITIES) (\r
+  IN UEFI_CAPSULE_HEADER    **CapsuleHeaderArray,\r
+  IN UINTN                  CapsuleCount,\r
+  OUT   UINT64              *MaximumCapsuleSize,\r
+  OUT EFI_RESET_TYPE        *ResetType\r
+  );\r
+\r
+/**                                                                                                    \r
+  Returns information about the EFI variables.\r
+                                                                                                       \r
+  @param  Attributes                   Attributes bitmask to specify the type of variables on\r
+                                       which to return information.                          \r
+  @param  MaximumVariableStorageSize   On output the maximum size of the storage space    \r
+                                       available for the EFI variables associated with the\r
+                                       attributes specified.                              \r
+  @param  RemainingVariableStorageSize Returns the remaining size of the storage space    \r
+                                       available for the EFI variables associated with the\r
+                                       attributes specified.                                \r
+  @param  MaximumVariableSize          Returns the maximum size of the individual EFI                        \r
+                                       variables associated with the attributes specified.                                                                \r
+                                       \r
+  @retval EFI_SUCCESS                  Valid answer returned.                                   \r
+  @retval EFI_INVALID_PARAMETER        An invalid combination of attribute bits was supplied                 \r
+  @retval EFI_UNSUPPORTED              The attribute is not supported on this platform, and the\r
+                                       MaximumVariableStorageSize,                             \r
+                                       RemainingVariableStorageSize, MaximumVariableSize       \r
+                                       are undefined.                                              \r
+                                                                                                       \r
+**/                                                                                                    \r
+typedef                         \r
+EFI_STATUS\r
+(EFIAPI *EFI_QUERY_VARIABLE_INFO) (\r
+  IN UINT32           Attributes,\r
+  OUT UINT64            *MaximumVariableStorageSize,\r
+  OUT    UINT64         *RemainingVariableStorageSize,\r
+  OUT UINT64            *MaximumVariableSize\r
+  );\r
+\r
+\r
+//\r
+// EFI Runtime Services Table\r
+//\r
+#define EFI_1_02_SYSTEM_TABLE_REVISION  ((1 << 16) | 02)\r
+#define EFI_1_10_SYSTEM_TABLE_REVISION  ((1 << 16) | 10)\r
+#define EFI_2_00_SYSTEM_TABLE_REVISION  ((2 << 16) | 0)\r
+\r
+#define EFI_RUNTIME_SERVICES_SIGNATURE  0x56524553544e5552ULL\r
+#define EFI_RUNTIME_SERVICES_REVISION   (EFI_2_00_SYSTEM_TABLE_REVISION)\r
+\r
+#if (EDK_RELEASE_VERSION != 0) && (EFI_SPECIFICATION_VERSION < 0x00020000)\r
+//\r
+// Include the definition for TIANO_REPORT_STATUS_CODE if this is the version\r
+//  of Tiano that extended the EFI specification. If Tiano mode is diabled\r
+//  don't include it.\r
+//\r
+#include <Dxe/ArchProtocol/StatusCode.h>\r
+#endif\r
+\r
+\r
+typedef struct {\r
+  EFI_TABLE_HEADER              Hdr;\r
+\r
+  //\r
+  // Time services\r
+  //\r
+  EFI_GET_TIME                  GetTime;\r
+  EFI_SET_TIME                  SetTime;\r
+  EFI_GET_WAKEUP_TIME           GetWakeupTime;\r
+  EFI_SET_WAKEUP_TIME           SetWakeupTime;\r
+\r
+  //\r
+  // Virtual memory services\r
+  //\r
+  EFI_SET_VIRTUAL_ADDRESS_MAP   SetVirtualAddressMap;\r
+  EFI_CONVERT_POINTER           ConvertPointer;\r
+\r
+  //\r
+  // Variable services\r
+  //\r
+  EFI_GET_VARIABLE              GetVariable;\r
+  EFI_GET_NEXT_VARIABLE_NAME    GetNextVariableName;\r
+  EFI_SET_VARIABLE              SetVariable;\r
+\r
+  //\r
+  // Misc\r
+  //\r
+  EFI_GET_NEXT_HIGH_MONO_COUNT  GetNextHighMonotonicCount;\r
+  EFI_RESET_SYSTEM              ResetSystem;\r
+\r
+#if (EFI_SPECIFICATION_VERSION >= 0x00020000)\r
+  //\r
+  // New Boot Services added by UEFI 2.0\r
+  //\r
+  EFI_UPDATE_CAPSULE              UpdateCapsule;\r
+  EFI_QUERY_CAPSULE_CAPABILITIES  QueryCapsuleCapabilities;\r
+  EFI_QUERY_VARIABLE_INFO         QueryVariableInfo;\r
+#elif (EDK_RELEASE_VERSION != 0)\r
+  //\r
+  // Tiano extension to EFI 1.10 runtime table\r
+  //  It was moved to a protocol to not conflict with UEFI 2.0\r
+  //  If Tiano is disabled this item is not enabled for EFI 1.10\r
+  //\r
+  TIANO_REPORT_STATUS_CODE          ReportStatusCode;\r
+#endif\r
+} EFI_RUNTIME_SERVICES;\r
+\r
+//\r
+// EFI Boot Services Table\r
+//\r
+#define EFI_BOOT_SERVICES_SIGNATURE 0x56524553544f4f42ULL\r
+#define EFI_BOOT_SERVICES_REVISION  (EFI_2_00_SYSTEM_TABLE_REVISION)\r
+\r
+typedef struct {\r
+  EFI_TABLE_HEADER                            Hdr;\r
+\r
+  //\r
+  // Task priority functions\r
+  //\r
+  EFI_RAISE_TPL                               RaiseTPL;\r
+  EFI_RESTORE_TPL                             RestoreTPL;\r
+\r
+  //\r
+  // Memory functions\r
+  //\r
+  EFI_ALLOCATE_PAGES                          AllocatePages;\r
+  EFI_FREE_PAGES                              FreePages;\r
+  EFI_GET_MEMORY_MAP                          GetMemoryMap;\r
+  EFI_ALLOCATE_POOL                           AllocatePool;\r
+  EFI_FREE_POOL                               FreePool;\r
+\r
+  //\r
+  // Event & timer functions\r
+  //\r
+  EFI_CREATE_EVENT                            CreateEvent;\r
+  EFI_SET_TIMER                               SetTimer;\r
+  EFI_WAIT_FOR_EVENT                          WaitForEvent;\r
+  EFI_SIGNAL_EVENT                            SignalEvent;\r
+  EFI_CLOSE_EVENT                             CloseEvent;\r
+  EFI_CHECK_EVENT                             CheckEvent;\r
+\r
+  //\r
+  // Protocol handler functions\r
+  //\r
+  EFI_INSTALL_PROTOCOL_INTERFACE              InstallProtocolInterface;\r
+  EFI_REINSTALL_PROTOCOL_INTERFACE            ReinstallProtocolInterface;\r
+  EFI_UNINSTALL_PROTOCOL_INTERFACE            UninstallProtocolInterface;\r
+  EFI_HANDLE_PROTOCOL                         HandleProtocol;\r
+  VOID                                        *Reserved;\r
+  EFI_REGISTER_PROTOCOL_NOTIFY                RegisterProtocolNotify;\r
+  EFI_LOCATE_HANDLE                           LocateHandle;\r
+  EFI_LOCATE_DEVICE_PATH                      LocateDevicePath;\r
+  EFI_INSTALL_CONFIGURATION_TABLE             InstallConfigurationTable;\r
+\r
+  //\r
+  // Image functions\r
+  //\r
+  EFI_IMAGE_LOAD                              LoadImage;\r
+  EFI_IMAGE_START                             StartImage;\r
+  EFI_EXIT                                    Exit;\r
+  EFI_IMAGE_UNLOAD                            UnloadImage;\r
+  EFI_EXIT_BOOT_SERVICES                      ExitBootServices;\r
+\r
+  //\r
+  // Misc functions\r
+  //\r
+  EFI_GET_NEXT_MONOTONIC_COUNT                GetNextMonotonicCount;\r
+  EFI_STALL                                   Stall;\r
+  EFI_SET_WATCHDOG_TIMER                      SetWatchdogTimer;\r
+\r
+  //\r
+  // ////////////////////////////////////////////////////\r
+  // EFI 1.1 Services\r
+    //////////////////////////////////////////////////////\r
+  //\r
+  // DriverSupport Services\r
+  //\r
+  EFI_CONNECT_CONTROLLER                      ConnectController;\r
+  EFI_DISCONNECT_CONTROLLER                   DisconnectController;\r
+\r
+  //\r
+  // Added Open and Close protocol for the new driver model\r
+  //\r
+  EFI_OPEN_PROTOCOL                           OpenProtocol;\r
+  EFI_CLOSE_PROTOCOL                          CloseProtocol;\r
+  EFI_OPEN_PROTOCOL_INFORMATION               OpenProtocolInformation;\r
+\r
+  //\r
+  // Added new services to EFI 1.1 as Lib to reduce code size.\r
+  //\r
+  EFI_PROTOCOLS_PER_HANDLE                    ProtocolsPerHandle;\r
+  EFI_LOCATE_HANDLE_BUFFER                    LocateHandleBuffer;\r
+  EFI_LOCATE_PROTOCOL                         LocateProtocol;\r
+\r
+  EFI_INSTALL_MULTIPLE_PROTOCOL_INTERFACES    InstallMultipleProtocolInterfaces;\r
+  EFI_UNINSTALL_MULTIPLE_PROTOCOL_INTERFACES  UninstallMultipleProtocolInterfaces;\r
+\r
+  //\r
+  // CRC32 services\r
+  //\r
+  EFI_CALCULATE_CRC32                         CalculateCrc32;\r
+\r
+  //\r
+  // Memory Utility Services\r
+  //\r
+  EFI_COPY_MEM                                CopyMem;\r
+  EFI_SET_MEM                                 SetMem;\r
+\r
+#if (EFI_SPECIFICATION_VERSION >= 0x00020000)\r
+  //\r
+  // UEFI 2.0 Extension to the table\r
+  //\r
+  EFI_CREATE_EVENT_EX                         CreateEventEx;\r
+#endif\r
+} EFI_BOOT_SERVICES;\r
+\r
+//\r
+// EFI Configuration Table\r
+//\r
+typedef struct {\r
+  EFI_GUID  VendorGuid;\r
+  VOID      *VendorTable;\r
+} EFI_CONFIGURATION_TABLE;\r
+\r
+//\r
+// EFI System Table\r
+//\r
+#define EFI_SYSTEM_TABLE_SIGNATURE      0x5453595320494249ULL\r
+#define EFI_SYSTEM_TABLE_REVISION       (EFI_2_00_SYSTEM_TABLE_REVISION)\r
+\r
+struct _EFI_SYSTEM_TABLE {\r
+  EFI_TABLE_HEADER              Hdr;\r
+\r
+  CHAR16                        *FirmwareVendor;\r
+  UINT32                        FirmwareRevision;\r
+\r
+  EFI_HANDLE                    ConsoleInHandle;\r
+  EFI_SIMPLE_TEXT_IN_PROTOCOL   *ConIn;\r
+\r
+  EFI_HANDLE                    ConsoleOutHandle;\r
+  EFI_SIMPLE_TEXT_OUT_PROTOCOL  *ConOut;\r
+\r
+  EFI_HANDLE                    StandardErrorHandle;\r
+  EFI_SIMPLE_TEXT_OUT_PROTOCOL  *StdErr;\r
+\r
+  EFI_RUNTIME_SERVICES          *RuntimeServices;\r
+  EFI_BOOT_SERVICES             *BootServices;\r
+\r
+  UINTN                         NumberOfTableEntries;\r
+  EFI_CONFIGURATION_TABLE       *ConfigurationTable;\r
+\r
+};\r
+\r
+//\r
+// Device Path information\r
+//\r
+\r
+#pragma pack(1)\r
+\r
+//\r
+// Hardware Device Paths\r
+//\r
+#define HARDWARE_DEVICE_PATH      0x01\r
+\r
+#define HW_PCI_DP                 0x01\r
+typedef struct {\r
+  EFI_DEVICE_PATH_PROTOCOL        Header;\r
+  UINT8                           Function;\r
+  UINT8                           Device;\r
+} PCI_DEVICE_PATH;\r
+\r
+#define HW_PCCARD_DP              0x02\r
+typedef struct {\r
+  EFI_DEVICE_PATH_PROTOCOL        Header;\r
+  UINT8                           FunctionNumber;\r
+} PCCARD_DEVICE_PATH;\r
+\r
+#define HW_MEMMAP_DP              0x03\r
+typedef struct {\r
+  EFI_DEVICE_PATH_PROTOCOL        Header;\r
+  UINT32                          MemoryType;\r
+  EFI_PHYSICAL_ADDRESS            StartingAddress;\r
+  EFI_PHYSICAL_ADDRESS            EndingAddress;\r
+} MEMMAP_DEVICE_PATH;\r
+\r
+#define HW_VENDOR_DP              0x04\r
+typedef struct {\r
+  EFI_DEVICE_PATH_PROTOCOL        Header;\r
+  EFI_GUID                        Guid;\r
+} VENDOR_DEVICE_PATH;\r
+\r
+#define HW_CONTROLLER_DP          0x05\r
+typedef struct {\r
+  EFI_DEVICE_PATH_PROTOCOL        Header;\r
+#if EDK_RELEASE_VERSION >= 0x00020000\r
+  UINT32                          ControllerNumber;\r
+#else\r
+  UINT32                          Controller;\r
+#endif\r
+} CONTROLLER_DEVICE_PATH;\r
+\r
+//\r
+// ACPI Device Paths\r
+//\r
+#define ACPI_DEVICE_PATH          0x02\r
+\r
+#define ACPI_DP                   0x01\r
+typedef struct {\r
+  EFI_DEVICE_PATH_PROTOCOL        Header;\r
+  UINT32                          HID;\r
+  UINT32                          UID;\r
+} ACPI_HID_DEVICE_PATH;\r
+\r
+#define ACPI_EXTENDED_DP          0x02\r
+typedef struct {\r
+  EFI_DEVICE_PATH_PROTOCOL        Header;\r
+  UINT32                          HID;\r
+  UINT32                          UID;\r
+  UINT32                          CID;\r
+  //\r
+  // Optional variable length _HIDSTR\r
+  // Optional variable length _UIDSTR\r
+  //\r
+} ACPI_EXTENDED_HID_DEVICE_PATH;\r
+\r
+//\r
+//  EISA ID Macro\r
+//  EISA ID Definition 32-bits\r
+//   bits[15:0] - three character compressed ASCII EISA ID.\r
+//   bits[31:16] - binary number\r
+//    Compressed ASCII is 5 bits per character 0b00001 = 'A' 0b11010 = 'Z'\r
+//\r
+#define PNP_EISA_ID_CONST         0x41d0\r
+#define EISA_ID(_Name, _Num)      ((UINT32) ((_Name) | (_Num) << 16))\r
+#define EISA_PNP_ID(_PNPId)       (EISA_ID(PNP_EISA_ID_CONST, (_PNPId)))\r
+#define EFI_PNP_ID(_PNPId)        (EISA_ID(PNP_EISA_ID_CONST, (_PNPId)))\r
+\r
+#define PNP_EISA_ID_MASK          0xffff\r
+#define EISA_ID_TO_NUM(_Id)       ((_Id) >> 16)\r
+\r
+\r
+#define ACPI_ADR_DP               0x03\r
+typedef struct {\r
+  EFI_DEVICE_PATH_PROTOCOL        Header;\r
+  UINT32                          ADR;\r
+} ACPI_ADR_DEVICE_PATH;\r
+\r
+\r
+//\r
+// Messaging Device Paths\r
+//\r
+#define MESSAGING_DEVICE_PATH     0x03\r
+\r
+#define MSG_ATAPI_DP              0x01\r
+typedef struct {\r
+  EFI_DEVICE_PATH_PROTOCOL        Header;\r
+  UINT8                           PrimarySecondary;\r
+  UINT8                           SlaveMaster;\r
+  UINT16                          Lun;\r
+} ATAPI_DEVICE_PATH;\r
+\r
+#define MSG_SCSI_DP               0x02\r
+typedef struct {\r
+  EFI_DEVICE_PATH_PROTOCOL        Header;\r
+  UINT16                          Pun;\r
+  UINT16                          Lun;\r
+} SCSI_DEVICE_PATH;\r
+\r
+#define MSG_FIBRECHANNEL_DP       0x03\r
+typedef struct {\r
+  EFI_DEVICE_PATH_PROTOCOL        Header;\r
+  UINT32                          Reserved;\r
+  UINT64                          WWN;\r
+  UINT64                          Lun;\r
+} FIBRECHANNEL_DEVICE_PATH;\r
+\r
+#define MSG_1394_DP               0x04\r
+typedef struct {\r
+  EFI_DEVICE_PATH_PROTOCOL        Header;\r
+  UINT32                          Reserved;\r
+  UINT64                          Guid;\r
+} F1394_DEVICE_PATH;\r
+\r
+#define MSG_USB_DP                0x05\r
+typedef struct {\r
+    EFI_DEVICE_PATH_PROTOCOL      Header;\r
+    UINT8                         ParentPortNumber;\r
+    UINT8                         InterfaceNumber;\r
+} USB_DEVICE_PATH;\r
+\r
+#define MSG_USB_CLASS_DP          0x0f\r
+typedef struct {\r
+    EFI_DEVICE_PATH_PROTOCOL      Header;\r
+    UINT16                        VendorId;\r
+    UINT16                        ProductId;\r
+    UINT8                         DeviceClass;\r
+    UINT8                         DeviceSubClass;\r
+    UINT8                         DeviceProtocol;\r
+} USB_CLASS_DEVICE_PATH;\r
+\r
+#define MSG_USB_WWID_DP          0x10\r
+typedef struct {\r
+    EFI_DEVICE_PATH_PROTOCOL      Header;\r
+    UINT16                        InterfaceNumber;\r
+    UINT16                        VendorId;\r
+    UINT16                        ProductId;\r
+    // CHAR16                     SerialNumber[];\r
+} USB_WWID_DEVICE_PATH;\r
+\r
+#define MSG_DEVICE_LOGICAL_UNIT_DP  0x11\r
+typedef struct {\r
+    EFI_DEVICE_PATH_PROTOCOL      Header;\r
+    UINT8                         LUN;\r
+} DEVICE_LOGICAL_UNIT_DEVICE_PATH;\r
+\r
+#define MSG_I2O_DP                0x06\r
+typedef struct {\r
+  EFI_DEVICE_PATH_PROTOCOL        Header;\r
+  UINT32                          Tid;\r
+} I2O_DEVICE_PATH;\r
+\r
+#define MSG_MAC_ADDR_DP           0x0b\r
+typedef struct {\r
+  EFI_DEVICE_PATH_PROTOCOL        Header;\r
+  EFI_MAC_ADDRESS                 MacAddress;\r
+  UINT8                           IfType;\r
+} MAC_ADDR_DEVICE_PATH;\r
+\r
+#define MSG_IPv4_DP               0x0c\r
+typedef struct {\r
+  EFI_DEVICE_PATH_PROTOCOL        Header;\r
+  EFI_IPv4_ADDRESS                LocalIpAddress;\r
+  EFI_IPv4_ADDRESS                RemoteIpAddress;\r
+  UINT16                          LocalPort;\r
+  UINT16                          RemotePort;\r
+  UINT16                          Protocol;\r
+  BOOLEAN                         StaticIpAddress;\r
+} IPv4_DEVICE_PATH;\r
+\r
+#define MSG_IPv6_DP               0x0d\r
+typedef struct {\r
+  EFI_DEVICE_PATH_PROTOCOL        Header;\r
+  EFI_IPv6_ADDRESS                LocalIpAddress;\r
+  EFI_IPv6_ADDRESS                RemoteIpAddress;\r
+  UINT16                          LocalPort;\r
+  UINT16                          RemotePort;\r
+  UINT16                          Protocol;\r
+  BOOLEAN                         StaticIpAddress;\r
+} IPv6_DEVICE_PATH;\r
+\r
+#define MSG_INFINIBAND_DP         0x09\r
+typedef struct {\r
+  EFI_DEVICE_PATH_PROTOCOL        Header;\r
+  UINT32                          ResourceFlags;\r
+  UINT8                           PortGid[16];\r
+  UINT64                          ServiceId;\r
+  UINT64                          TargetPortId;\r
+  UINT64                          DeviceId;\r
+} INFINIBAND_DEVICE_PATH;\r
+\r
+#define INFINIBAND_RESOURCE_FLAG_IOC_SERVICE                0x01\r
+#define INFINIBAND_RESOURCE_FLAG_EXTENDED_BOOT_ENVIRONMENT  0x02\r
+#define INFINIBAND_RESOURCE_FLAG_CONSOLE_PROTOCOL           0x04\r
+#define INFINIBAND_RESOURCE_FLAG_STORAGE_PROTOCOL           0x08\r
+#define INFINIBAND_RESOURCE_FLAG_NETWORK_PROTOCOL           0x10\r
+\r
+#define MSG_UART_DP               0x0e\r
+typedef struct {\r
+  EFI_DEVICE_PATH_PROTOCOL        Header;\r
+  UINT32                          Reserved;\r
+  UINT64                          BaudRate;\r
+  UINT8                           DataBits;\r
+  UINT8                           Parity;\r
+  UINT8                           StopBits;\r
+} UART_DEVICE_PATH;\r
+\r
+//\r
+// Use VENDOR_DEVICE_PATH struct\r
+//\r
+#define MSG_VENDOR_DP             0x0a\r
+\r
+#define DEVICE_PATH_MESSAGING_PC_ANSI     EFI_PC_ANSI_GUID\r
+#define DEVICE_PATH_MESSAGING_VT_100      EFI_VT_100_GUID\r
+#define DEVICE_PATH_MESSAGING_VT_100_PLUS EFI_VT_100_PLUS_GUID\r
+#define DEVICE_PATH_MESSAGING_VT_UTF8     EFI_VT_UTF8_GUID\r
+#define DEVICE_PATH_MESSAGING_SAS         EFI_SAS_DEVICE_PATH_GUID\r
+\r
+\r
+#define MSG_ISCSI_DP              0x13\r
+typedef struct {\r
+  EFI_DEVICE_PATH_PROTOCOL        Header;\r
+  UINT16                          NetworkProtocol;\r
+  UINT16                          LoginOption;\r
+  UINT16                          Reserved;\r
+  UINT16                          TargetPortalGroupTag;\r
+  UINT64                          LUN;\r
+  // CHAR8                        iSCSI Target Name\r
+} ISCSI_DEVICE_PATH;\r
+\r
+#define ISCSI_LOGIN_OPTION_NO_HEADER_DIGEST             0x0000\r
+#define ISCSI_LOGIN_OPTION_HEADER_DIGEST_USING_CRC32C   0x0002\r
+#define ISCSI_LOGIN_OPTION_NO_DATA_DIGEST               0x0000\r
+#define ISCSI_LOGIN_OPTION_DATA_DIGEST_USING_CRC32C     0x0008\r
+#define ISCSI_LOGIN_OPTION_AUTHMETHOD_CHAP              0x0000\r
+#define ISCSI_LOGIN_OPTION_AUTHMETHOD_NON               0x1000\r
+#define ISCSI_LOGIN_OPTION_CHAP_BI                      0x0000\r
+#define ISCSI_LOGIN_OPTION_CHAP_UNI                     0x2000\r
+\r
+\r
+//\r
+// Media Device Path\r
+//\r
+#define MEDIA_DEVICE_PATH         0x04\r
+\r
+#define MEDIA_HARDDRIVE_DP        0x01\r
+typedef struct {\r
+  EFI_DEVICE_PATH_PROTOCOL        Header;\r
+  UINT32                          PartitionNumber;\r
+  UINT64                          PartitionStart;\r
+  UINT64                          PartitionSize;\r
+  UINT8                           Signature[16];\r
+  UINT8                           MBRType;\r
+  UINT8                           SignatureType;\r
+} HARDDRIVE_DEVICE_PATH;\r
+\r
+#define MBR_TYPE_PCAT             0x01\r
+#define MBR_TYPE_EFI_PARTITION_TABLE_HEADER 0x02\r
+\r
+#define SIGNATURE_TYPE_MBR        0x01\r
+#define SIGNATURE_TYPE_GUID       0x02\r
+\r
+#define MEDIA_CDROM_DP            0x02\r
+typedef struct {\r
+  EFI_DEVICE_PATH_PROTOCOL        Header;\r
+  UINT32                          BootEntry;\r
+  UINT64                          PartitionStart;\r
+  UINT64                          PartitionSize;\r
+} CDROM_DEVICE_PATH;\r
+\r
+//\r
+// Use VENDOR_DEVICE_PATH struct\r
+//\r
+#define MEDIA_VENDOR_DP           0x03\r
+\r
+#define MEDIA_FILEPATH_DP         0x04\r
+typedef struct {\r
+  EFI_DEVICE_PATH_PROTOCOL        Header;\r
+  CHAR16                          PathName[1];\r
+} FILEPATH_DEVICE_PATH;\r
+\r
+#define SIZE_OF_FILEPATH_DEVICE_PATH EFI_FIELD_OFFSET(FILEPATH_DEVICE_PATH,PathName)\r
+\r
+#define MEDIA_PROTOCOL_DP         0x05\r
+typedef struct {\r
+  EFI_DEVICE_PATH_PROTOCOL        Header;\r
+  EFI_GUID                        Protocol;\r
+} MEDIA_PROTOCOL_DEVICE_PATH;\r
+\r
+#if ((EDK_RELEASE_VERSION != 0) && (EFI_SPECIFICATION_VERSION < 0x00020000))\r
+//\r
+// Prior to UEFI 2.0 Tiano extended this enum. UEFI owns device path values\r
+// and we moved to a new GUID'ed device path for Tiano\r
+//\r
+\r
+#define MEDIA_FV_FILEPATH_DP  0x06\r
+typedef struct {\r
+  EFI_DEVICE_PATH_PROTOCOL  Header;\r
+  EFI_GUID                  NameGuid;\r
+} MEDIA_FW_VOL_FILEPATH_DEVICE_PATH;\r
+\r
+#else\r
+\r
+typedef struct {\r
+  EFI_DEVICE_PATH_PROTOCOL  Header;\r
+  EFI_GUID                  PiwgSpecificDevicePath;\r
+  UINT32                    Type;\r
+} PIWG_DEVICE_PATH;\r
+\r
+#define PIWG_MEDIA_FW_VOL_FILEPATH_DEVICE_PATH_TYPE         0x01\r
+typedef struct {\r
+  PIWG_DEVICE_PATH      Piwg;\r
+  EFI_GUID              NameGuid;\r
+} MEDIA_FW_VOL_FILEPATH_DEVICE_PATH;\r
+\r
+//\r
+// Place holder for a future extension\r
+//\r
+#define PIWG_MEDIAFW_VOL_DEVICE_PATH_TYPE                   0x02\r
+typedef struct {\r
+  PIWG_DEVICE_PATH      Piwg;\r
+  EFI_GUID              VolumeGuid;\r
+} MEDIA_FW_VOL_DEVICE_PATH;\r
+\r
+#endif\r
+\r
+\r
+//\r
+// BBS Device Path\r
+//\r
+#define BBS_DEVICE_PATH           0x05\r
+#define BBS_BBS_DP                0x01\r
+typedef struct {\r
+  EFI_DEVICE_PATH_PROTOCOL        Header;\r
+  UINT16                          DeviceType;\r
+  UINT16                          StatusFlag;\r
+  CHAR8                           String[1];\r
+} BBS_BBS_DEVICE_PATH;\r
+\r
+//\r
+// DeviceType definitions - from BBS specification\r
+//\r
+#define BBS_TYPE_FLOPPY           0x01\r
+#define BBS_TYPE_HARDDRIVE        0x02\r
+#define BBS_TYPE_CDROM            0x03\r
+#define BBS_TYPE_PCMCIA           0x04\r
+#define BBS_TYPE_USB              0x05\r
+#define BBS_TYPE_EMBEDDED_NETWORK 0x06\r
+#define BBS_TYPE_BEV              0x80\r
+#define BBS_TYPE_UNKNOWN          0xFF\r
+\r
+\r
+//\r
+// Union of all possible Device Paths and pointers to Device Paths\r
+//\r
+\r
+typedef union {\r
+  EFI_DEVICE_PATH_PROTOCOL             DevPath;\r
+  PCI_DEVICE_PATH                      Pci;\r
+  PCCARD_DEVICE_PATH                   PcCard;\r
+  MEMMAP_DEVICE_PATH                   MemMap;\r
+  VENDOR_DEVICE_PATH                   Vendor;\r
+\r
+  CONTROLLER_DEVICE_PATH               Controller;\r
+  ACPI_HID_DEVICE_PATH                 Acpi;\r
+\r
+  ATAPI_DEVICE_PATH                    Atapi;\r
+  SCSI_DEVICE_PATH                     Scsi;\r
+  FIBRECHANNEL_DEVICE_PATH             FibreChannel;\r
+\r
+  F1394_DEVICE_PATH                    F1394;\r
+  USB_DEVICE_PATH                      Usb;\r
+  USB_CLASS_DEVICE_PATH                UsbClass;\r
+  I2O_DEVICE_PATH                      I2O;\r
+  MAC_ADDR_DEVICE_PATH                 MacAddr;\r
+  IPv4_DEVICE_PATH                     Ipv4;\r
+  IPv6_DEVICE_PATH                     Ipv6;\r
+  INFINIBAND_DEVICE_PATH               InfiniBand;\r
+  UART_DEVICE_PATH                     Uart;\r
+\r
+  HARDDRIVE_DEVICE_PATH                HardDrive;\r
+  CDROM_DEVICE_PATH                    CD;\r
+\r
+  FILEPATH_DEVICE_PATH                 FilePath;\r
+  MEDIA_PROTOCOL_DEVICE_PATH           MediaProtocol;\r
+\r
+  BBS_BBS_DEVICE_PATH                  Bbs;\r
+} EFI_DEV_PATH;\r
+\r
+\r
+\r
+typedef union {\r
+  EFI_DEVICE_PATH_PROTOCOL             *DevPath;\r
+  PCI_DEVICE_PATH                      *Pci;\r
+  PCCARD_DEVICE_PATH                   *PcCard;\r
+  MEMMAP_DEVICE_PATH                   *MemMap;\r
+  VENDOR_DEVICE_PATH                   *Vendor;\r
+\r
+  CONTROLLER_DEVICE_PATH               *Controller;\r
+  ACPI_HID_DEVICE_PATH                 *Acpi;\r
+  ACPI_EXTENDED_HID_DEVICE_PATH        *ExtendedAcpi;\r
+\r
+  ATAPI_DEVICE_PATH                    *Atapi;\r
+  SCSI_DEVICE_PATH                     *Scsi;\r
+  FIBRECHANNEL_DEVICE_PATH             *FibreChannel;\r
+\r
+  F1394_DEVICE_PATH                    *F1394;\r
+  USB_DEVICE_PATH                      *Usb;\r
+  USB_CLASS_DEVICE_PATH                *UsbClass;\r
+  I2O_DEVICE_PATH                      *I2O;\r
+  MAC_ADDR_DEVICE_PATH                 *MacAddr;\r
+  IPv4_DEVICE_PATH                     *Ipv4;\r
+  IPv6_DEVICE_PATH                     *Ipv6;\r
+  INFINIBAND_DEVICE_PATH               *InfiniBand;\r
+  UART_DEVICE_PATH                     *Uart;\r
+\r
+  HARDDRIVE_DEVICE_PATH                *HardDrive;\r
+  CDROM_DEVICE_PATH                    *CD;\r
+\r
+  FILEPATH_DEVICE_PATH                 *FilePath;\r
+  MEDIA_PROTOCOL_DEVICE_PATH           *MediaProtocol;\r
+\r
+  BBS_BBS_DEVICE_PATH                  *Bbs;\r
+  UINT8                                *Raw;\r
+} EFI_DEV_PATH_PTR;\r
+\r
+#pragma pack()\r
+\r
+\r
+//\r
+// PXE Informations\r
+//\r
+\r
+//\r
+// Packet definitions\r
+//\r
+typedef struct {\r
+  UINT8   BootpOpcode;\r
+  UINT8   BootpHwType;\r
+  UINT8   BootpHwAddrLen;\r
+  UINT8   BootpGateHops;\r
+  UINT32  BootpIdent;\r
+  UINT16  BootpSeconds;\r
+  UINT16  BootpFlags;\r
+  UINT8   BootpCiAddr[4];\r
+  UINT8   BootpYiAddr[4];\r
+  UINT8   BootpSiAddr[4];\r
+  UINT8   BootpGiAddr[4];\r
+  UINT8   BootpHwAddr[16];\r
+  UINT8   BootpSrvName[64];\r
+  UINT8   BootpBootFile[128];\r
+  UINT32  DhcpMagik;\r
+  UINT8   DhcpOptions[56];\r
+} EFI_PXE_BASE_CODE_DHCPV4_PACKET;\r
+\r
+typedef union {\r
+  UINT8                           Raw[1472];\r
+  EFI_PXE_BASE_CODE_DHCPV4_PACKET Dhcpv4;\r
+\r
+  //\r
+  //  EFI_PXE_BASE_CODE_DHCPV6_PACKET     Dhcpv6;\r
+  //\r
+} EFI_PXE_BASE_CODE_PACKET;\r
+\r
+#include <Uefi/EfiPxe.h>\r
+\r
+//\r
+// EFI Revision information\r
+//\r
+#define EFI_FIRMWARE_REVISION       (EFI_2_00_SYSTEM_TABLE_REVISION)\r
+\r
+#include <Common/EfiImage.h>\r
+#include <IndustryStandard/Usb.h>\r
+\r
+\r
+#define EFI_USB_HC_RESET_GLOBAL            0x0001\r
+#define EFI_USB_HC_RESET_HOST_CONTROLLER   0x0002\r
+#define EFI_USB_HC_RESET_GLOBAL_WITH_DEBUG 0x0004\r
+#define EFI_USB_HC_RESET_HOST_WITH_DEBUG   0x0008\r
+\r
+//\r
+// USB Host Controller state\r
+//\r
+typedef enum {\r
+  EfiUsbHcStateHalt,\r
+  EfiUsbHcStateOperational,\r
+  EfiUsbHcStateSuspend,\r
+  EfiUsbHcStateMaximum\r
+} EFI_USB_HC_STATE;\r
+\r
+\r
+//\r
+// EFI File location to boot from on removable media devices\r
+//\r
+#define EFI_REMOVABLE_MEDIA_FILE_NAME_IA32    L"\\EFI\\BOOT\\BOOTIA32.EFI"\r
+#define EFI_REMOVABLE_MEDIA_FILE_NAME_IA64    L"\\EFI\\BOOT\\BOOTIA64.EFI"\r
+#define EFI_REMOVABLE_MEDIA_FILE_NAME_X64     L"\\EFI\\BOOT\\BOOTX64.EFI"\r
+#define EFI_REMOVABLE_MEDIA_FILE_NAME_EBC     L"\\EFI\\BOOT\\BOOTEBC.EFI"\r
+\r
+#if   defined (MDE_CPU_IA32)\r
+  #define EFI_REMOVABLE_MEDIA_FILE_NAME   EFI_REMOVABLE_MEDIA_FILE_NAME_IA32\r
+#elif defined (MDE_CPU_IPF)\r
+  #define EFI_REMOVABLE_MEDIA_FILE_NAME   EFI_REMOVABLE_MEDIA_FILE_NAME_IA64\r
+#elif defined (MDE_CPU_X64)\r
+  #define EFI_REMOVABLE_MEDIA_FILE_NAME   EFI_REMOVABLE_MEDIA_FILE_NAME_X64\r
+#elif defined (MDE_CPU_EBC)\r
+  #define EFI_REMOVABLE_MEDIA_FILE_NAME   EFI_REMOVABLE_MEDIA_FILE_NAME_EBC\r
+#else\r
+  #error Unknown Processor Type\r
+#endif\r
+\r
+\r
+//\r
+// Protocols from EFI 1.10 that got thier names fixed in UEFI 2.0\r
+//\r
+#include <Protocol/LoadedImage.h>\r
+#include <Protocol/SimpleTextIn.h>\r
+#include <Protocol/SimpleTextOut.h>\r
+#include <Protocol/SerialIo.h>\r
+#include <Protocol/LoadFile.h>\r
+#include <Protocol/SimpleFileSystem.h>\r
+#include <Protocol/DiskIo.h>\r
+#include <Protocol/BlockIo.h>\r
+#include <Protocol/UnicodeCollation.h>\r
+#include <Protocol/SimpleNetwork.h>\r
+#include <Protocol/EfiNetworkInterfaceIdentifier.h>\r
+#include <Protocol/PxeBaseCode.h>\r
+#include <Protocol/PxeBaseCodeCallBack.h>\r
+\r
+//\r
+// EFI 1.10 Protocols\r
+//\r
+#include <Protocol/Bis.h>\r
+#include <Protocol/BusSpecificDriverOverride.h>\r
+#include <Protocol/ComponentName.h>\r
+#include <Protocol/DebugPort.h>\r
+#include <Protocol/DebugSupport.h>\r
+#include <Protocol/Decompress.h>\r
+#include <Protocol/DriverBinding.h>\r
+#include <Protocol/DriverConfiguration.h>\r
+#include <Protocol/DriverDiagnostics.h>\r
+#include <Protocol/Ebc.h>\r
+#include <Protocol/EfiNetworkInterfaceIdentifier.h>\r
+#include <Protocol/FileInfo.h>\r
+#include <Protocol/FileSystemInfo.h>\r
+#include <Protocol/FileSystemVolumeLabelInfo.h>\r
+#include <Protocol/PciIo.h>\r
+#include <Protocol/PciRootBridgeIo.h>\r
+#include <Protocol/PlatformDriverOverride.h>\r
+#include <Protocol/SimplePointer.h>\r
+#include <Protocol/ScsiPassThru.h>\r
+#include <Protocol/UsbIo.h>\r
+#include <Protocol/UsbHostController.h>\r
+#include <Protocol/UgaDraw.h>\r
+\r
+//\r
+// EFI 1.10 GUIDs\r
+//\r
+#include <Guid/Acpi.h>\r
+#include <Guid/DebugImageInfoTable.h>\r
+#include <Guid/GlobalVariable.h>\r
+#include <Guid/Gpt.h>\r
+#include <Guid/PcAnsi.h>\r
+#include <Guid/SmBios.h>\r
+#include <Guid/SalSystemTable.h>\r
+\r
+\r
+#if (EFI_SPECIFICATION_VERSION >= 0x00020000)\r
+//\r
+// Turn on UEFI 2.0 Protocols and GUIDs\r
+//\r
+#include <Protocol/AuthenticationInfo.h>\r
+#include <Protocol/DevicePathUtilities.h>\r
+#include <Protocol/DevicePathToText.h>\r
+#include <Protocol/DevicePathFromText.h>\r
+#include <Protocol/GraphicsOutput.h>\r
+#include <Protocol/EdidDiscovered.h>\r
+#include <Protocol/EdidActive.h>\r
+#include <Protocol/EdidOverride.h>\r
+#include <Protocol/ScsiIo.h>\r
+#include <Protocol/ScsiPassThruExt.h>\r
+#include <Protocol/IScsiInitatorName.h>\r
+#include <Protocol/Usb2HostController.h>\r
+#include <Protocol/TapeIo.h>\r
+#include <Protocol/ManagedNetwork.h>\r
+#include <Protocol/Arp.h>\r
+#include <Protocol/Dhcp4.h>\r
+#include <Protocol/IP4.h>\r
+#include <Protocol/IP4Config.h>\r
+#include <Protocol/Tcp4.h>\r
+#include <Protocol/Udp4.h>\r
+#include <Protocol/Mtftp4.h>\r
+#include <Protocol/ServiceBinding.h>\r
+#include <Protocol/Hash.h>\r
+\r
+#include <Guid/EventGroup.h>\r
+//#include <Guid/WinCertificateUefi.h>\r
+#endif\r
+\r
+\r
+#endif\r
index 10cad4e81f7795b1012712d1b1545daa5d5db509..05bf75bc3a7b6f3fd8a68c40b07635b7a83c6395 100755 (executable)
@@ -91,10 +91,10 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
         defaultexcludes="TRUE" \r
         excludes="*.xml *.inf"/>\r
 \r
         defaultexcludes="TRUE" \r
         excludes="*.xml *.inf"/>\r
 \r
-      <includepath path="${env.WORKSPACE}/MdePkg/Include"/>\r
-      <includepath path="${env.WORKSPACE}/MdePkg/Include/Ia32"/>\r
-      <includepath path="${env.WORKSPACE}/MdePkg/Include/Common"/>\r
-      <includepath path="${env.WORKSPACE}/MdePkg/Include/Protocol"/>\r
+      <includepath path="${PACKAGE_DIR}/Include"/>\r
+      <includepath path="${PACKAGE_DIR}/Include/Ia32"/>\r
+      <includepath path="${PACKAGE_DIR}/Include/Common"/>\r
+      <includepath path="${PACKAGE_DIR}/Include/Protocol"/>\r
       <includepath path="${PACKAGE_DIR}/Common"/>\r
       <libset dir="${LIB_DIR}" libs="CommonTools CustomizedCompress"/>\r
     </cc>\r
       <includepath path="${PACKAGE_DIR}/Common"/>\r
       <libset dir="${LIB_DIR}" libs="CommonTools CustomizedCompress"/>\r
     </cc>\r
index 7106bce7a5424bfa795915a69e6a9148778f4b85..b9d0f11354eebb6a7a653a5f792ed98a2bf08a7c 100644 (file)
@@ -124,12 +124,12 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
         includes="BasePeCoff.c Ia32/PeCoffLoaderEx.c" />\r
 \r
       <includepath path="${PACKAGE_DIR}/${LibName}"/>\r
         includes="BasePeCoff.c Ia32/PeCoffLoaderEx.c" />\r
 \r
       <includepath path="${PACKAGE_DIR}/${LibName}"/>\r
-      <includepath path="${env.WORKSPACE}/MdePkg/Include"/>\r
-      <includepath path="${env.WORKSPACE}/MdePkg/Include"/>\r
-      <includepath path="${env.WORKSPACE}/MdePkg/Include/Ia32"/>\r
-      <includepath path="${env.WORKSPACE}/MdePkg/Include/Common"/>\r
-      <includepath path="${env.WORKSPACE}/MdePkg/Include/Protocol"/>\r
-      <includepath path="${env.WORKSPACE}/MdePkg/Include/Library"/>\r
+      <includepath path="${PACKAGE_DIR}/Include"/>\r
+      <includepath path="${PACKAGE_DIR}/Include"/>\r
+      <includepath path="${PACKAGE_DIR}/Include/Ia32"/>\r
+      <includepath path="${PACKAGE_DIR}/Include/Common"/>\r
+      <includepath path="${PACKAGE_DIR}/Include/Protocol"/>\r
+      <includepath path="${PACKAGE_DIR}/Include/Library"/>\r
       <includepath path="${PACKAGE_DIR}/Common"/>\r
     </cc>\r
   </target>\r
       <includepath path="${PACKAGE_DIR}/Common"/>\r
     </cc>\r
   </target>\r
@@ -149,12 +149,12 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
         includes="BasePeCoff.c Ipf/PeCoffLoaderEx.c" />\r
 \r
       <includepath path="${PACKAGE_DIR}/${LibName}"/>\r
         includes="BasePeCoff.c Ipf/PeCoffLoaderEx.c" />\r
 \r
       <includepath path="${PACKAGE_DIR}/${LibName}"/>\r
-      <includepath path="${env.WORKSPACE}/MdePkg/Include"/>\r
-      <includepath path="${env.WORKSPACE}/MdePkg/Include"/>\r
-      <includepath path="${env.WORKSPACE}/MdePkg/Include/Ia32"/>\r
-      <includepath path="${env.WORKSPACE}/MdePkg/Include/Common"/>\r
-      <includepath path="${env.WORKSPACE}/MdePkg/Include/Protocol"/>\r
-      <includepath path="${env.WORKSPACE}/MdePkg/Include/Library"/>\r
+      <includepath path="${PACKAGE_DIR}/Include"/>\r
+      <includepath path="${PACKAGE_DIR}/Include"/>\r
+      <includepath path="${PACKAGE_DIR}/Include/Ia32"/>\r
+      <includepath path="${PACKAGE_DIR}/Include/Common"/>\r
+      <includepath path="${PACKAGE_DIR}/Include/Protocol"/>\r
+      <includepath path="${PACKAGE_DIR}/Include/Library"/>\r
       <includepath path="${PACKAGE_DIR}/Common"/>\r
     </cc>\r
   </target>\r
       <includepath path="${PACKAGE_DIR}/Common"/>\r
     </cc>\r
   </target>\r
@@ -174,12 +174,12 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
         includes="BasePeCoff.c X64/PeCoffLoaderEx.c" />\r
 \r
       <includepath path="${PACKAGE_DIR}/${LibName}"/>\r
         includes="BasePeCoff.c X64/PeCoffLoaderEx.c" />\r
 \r
       <includepath path="${PACKAGE_DIR}/${LibName}"/>\r
-      <includepath path="${env.WORKSPACE}/MdePkg/Include"/>\r
-      <includepath path="${env.WORKSPACE}/MdePkg/Include"/>\r
-      <includepath path="${env.WORKSPACE}/MdePkg/Include/Ia32"/>\r
-      <includepath path="${env.WORKSPACE}/MdePkg/Include/Common"/>\r
-      <includepath path="${env.WORKSPACE}/MdePkg/Include/Protocol"/>\r
-      <includepath path="${env.WORKSPACE}/MdePkg/Include/Library"/>\r
+      <includepath path="${PACKAGE_DIR}/Include"/>\r
+      <includepath path="${PACKAGE_DIR}/Include"/>\r
+      <includepath path="${PACKAGE_DIR}/Include/Ia32"/>\r
+      <includepath path="${PACKAGE_DIR}/Include/Common"/>\r
+      <includepath path="${PACKAGE_DIR}/Include/Protocol"/>\r
+      <includepath path="${PACKAGE_DIR}/Include/Library"/>\r
       <includepath path="${PACKAGE_DIR}/Common"/>\r
     </cc>\r
   </target>\r
       <includepath path="${PACKAGE_DIR}/Common"/>\r
     </cc>\r
   </target>\r
index b49193ce3d78fbbcf9480990f6cb094e13d1491e..187d5d69456e770d99719f539f6e94a70de5963f 100644 (file)
@@ -90,11 +90,11 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
       <fileset dir="${basedir}/${ToolName}" \r
         includes="${FileSet}"/>\r
 \r
       <fileset dir="${basedir}/${ToolName}" \r
         includes="${FileSet}"/>\r
 \r
-      <includepath path="${env.WORKSPACE}/MdePkg/Include"/>\r
-      <includepath path="${env.WORKSPACE}/MdePkg/Include/Ia32"/>\r
-      <includepath path="${env.WORKSPACE}/MdePkg/Include/Common"/>\r
-      <includepath path="${env.WORKSPACE}/MdePkg/Include/Protocol"/>\r
-      <includepath path="${env.WORKSPACE}/MdePkg/Include/Library"/>\r
+      <includepath path="${PACKAGE_DIR}/Include"/>\r
+      <includepath path="${PACKAGE_DIR}/Include/Ia32"/>\r
+      <includepath path="${PACKAGE_DIR}/Include/Common"/>\r
+      <includepath path="${PACKAGE_DIR}/Include/Protocol"/>\r
+      <includepath path="${PACKAGE_DIR}/Include/Library"/>\r
       <includepath path="${PACKAGE_DIR}/Common"/>\r
                        <libset dir="${LIB_DIR}" libs="CommonTools CustomizedCompress PeCoffLoader_Ia32"/>\r
     </cc>\r
       <includepath path="${PACKAGE_DIR}/Common"/>\r
                        <libset dir="${LIB_DIR}" libs="CommonTools CustomizedCompress PeCoffLoader_Ia32"/>\r
     </cc>\r
@@ -109,11 +109,11 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
       <fileset dir="${basedir}/${ToolName}" \r
         includes="${FileSet}"/>\r
 \r
       <fileset dir="${basedir}/${ToolName}" \r
         includes="${FileSet}"/>\r
 \r
-      <includepath path="${env.WORKSPACE}/MdePkg/Include"/>\r
-      <includepath path="${env.WORKSPACE}/MdePkg/Include/Ia32"/>\r
-      <includepath path="${env.WORKSPACE}/MdePkg/Include/Common"/>\r
-      <includepath path="${env.WORKSPACE}/MdePkg/Include/Protocol"/>\r
-      <includepath path="${env.WORKSPACE}/MdePkg/Include/Library"/>\r
+      <includepath path="${PACKAGE_DIR}/Include"/>\r
+      <includepath path="${PACKAGE_DIR}/Include/Ia32"/>\r
+      <includepath path="${PACKAGE_DIR}/Include/Common"/>\r
+      <includepath path="${PACKAGE_DIR}/Include/Protocol"/>\r
+      <includepath path="${PACKAGE_DIR}/Include/Library"/>\r
       <includepath path="${PACKAGE_DIR}/Common"/>\r
                        <libset dir="${LIB_DIR}" libs="CommonTools CustomizedCompress PeCoffLoader_Ipf"/>\r
     </cc>\r
       <includepath path="${PACKAGE_DIR}/Common"/>\r
                        <libset dir="${LIB_DIR}" libs="CommonTools CustomizedCompress PeCoffLoader_Ipf"/>\r
     </cc>\r
@@ -128,11 +128,11 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
       <fileset dir="${basedir}/${ToolName}" \r
         includes="${FileSet}" />\r
 \r
       <fileset dir="${basedir}/${ToolName}" \r
         includes="${FileSet}" />\r
 \r
-      <includepath path="${env.WORKSPACE}/MdePkg/Include"/>\r
-      <includepath path="${env.WORKSPACE}/MdePkg/Include/Ia32"/>\r
-      <includepath path="${env.WORKSPACE}/MdePkg/Include/Common"/>\r
-      <includepath path="${env.WORKSPACE}/MdePkg/Include/Protocol"/>\r
-      <includepath path="${env.WORKSPACE}/MdePkg/Include/Library"/>\r
+      <includepath path="${PACKAGE_DIR}/Include"/>\r
+      <includepath path="${PACKAGE_DIR}/Include/Ia32"/>\r
+      <includepath path="${PACKAGE_DIR}/Include/Common"/>\r
+      <includepath path="${PACKAGE_DIR}/Include/Protocol"/>\r
+      <includepath path="${PACKAGE_DIR}/Include/Library"/>\r
       <includepath path="${PACKAGE_DIR}/Common"/>\r
                        <libset dir="${LIB_DIR}" libs="CommonTools CustomizedCompress PeCoffLoader_X64"/>\r
     </cc>\r
       <includepath path="${PACKAGE_DIR}/Common"/>\r
                        <libset dir="${LIB_DIR}" libs="CommonTools CustomizedCompress PeCoffLoader_X64"/>\r
     </cc>\r
index 3df9dcc0736d990635b586d8e6a61e07edcc1639..06622cee5d15df7c03a25741818157c6103cdc77 100644 (file)
@@ -91,10 +91,10 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
         defaultexcludes="TRUE" \r
         excludes="*.xml *.inf"/>\r
 \r
         defaultexcludes="TRUE" \r
         excludes="*.xml *.inf"/>\r
 \r
-      <includepath path="${env.WORKSPACE}/MdePkg/Include"/>\r
-      <includepath path="${env.WORKSPACE}/MdePkg/Include/Ia32"/>\r
-      <includepath path="${env.WORKSPACE}/MdePkg/Include/Common"/>\r
-      <includepath path="${env.WORKSPACE}/MdePkg/Include/Protocol"/>\r
+      <includepath path="${PACKAGE_DIR}/Include"/>\r
+      <includepath path="${PACKAGE_DIR}/Include/Ia32"/>\r
+      <includepath path="${PACKAGE_DIR}/Include/Common"/>\r
+      <includepath path="${PACKAGE_DIR}/Include/Protocol"/>\r
       <includepath path="${PACKAGE_DIR}/Common"/>\r
       <libset dir="${LIB_DIR}" libs="CommonTools CustomizedCompress"/>\r
     </cc>\r
       <includepath path="${PACKAGE_DIR}/Common"/>\r
       <libset dir="${LIB_DIR}" libs="CommonTools CustomizedCompress"/>\r
     </cc>\r
index 2594fdd38af6843966b2d2d029e7af38f63f639d..aab82023716cc1f5806526179e2e863280189d36 100644 (file)
@@ -91,10 +91,10 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
         defaultexcludes="TRUE" \r
         excludes="*.xml *.inf"/>\r
 \r
         defaultexcludes="TRUE" \r
         excludes="*.xml *.inf"/>\r
 \r
-      <includepath path="${env.WORKSPACE}/MdePkg/Include"/>\r
-      <includepath path="${env.WORKSPACE}/MdePkg/Include/Ia32"/>\r
-      <includepath path="${env.WORKSPACE}/MdePkg/Include/Common"/>\r
-      <includepath path="${env.WORKSPACE}/MdePkg/Include/Protocol"/>\r
+      <includepath path="${PACKAGE_DIR}/Include"/>\r
+      <includepath path="${PACKAGE_DIR}/Include/Ia32"/>\r
+      <includepath path="${PACKAGE_DIR}/Include/Common"/>\r
+      <includepath path="${PACKAGE_DIR}/Include/Protocol"/>\r
       <includepath path="${PACKAGE_DIR}/Common"/>\r
       <libset dir="${LIB_DIR}" libs="CommonTools CustomizedCompress"/>\r
     </cc>\r
       <includepath path="${PACKAGE_DIR}/Common"/>\r
       <libset dir="${LIB_DIR}" libs="CommonTools CustomizedCompress"/>\r
     </cc>\r
index 6e4aecb4a16a2e0eeed33328d3d44b285e349830..f1be1e01b6515df0f3ac0a5fa1ea2f7a80774790 100644 (file)
@@ -91,9 +91,9 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
         defaultexcludes="TRUE" \r
         excludes="*.xml *.inf"/>\r
 \r
         defaultexcludes="TRUE" \r
         excludes="*.xml *.inf"/>\r
 \r
-      <includepath path="${env.WORKSPACE}/MdePkg/Include"/>\r
-      <includepath path="${env.WORKSPACE}/MdePkg/Include/Common"/>\r
-      <includepath path="${env.WORKSPACE}/MdePkg/Include/Ia32"/>\r
+      <includepath path="${PACKAGE_DIR}/Include"/>\r
+      <includepath path="${PACKAGE_DIR}/Include/Common"/>\r
+      <includepath path="${PACKAGE_DIR}/Include/Ia32"/>\r
       <includepath path="${PACKAGE_DIR}/Common"/>\r
                        <libset dir="${LIB_DIR}" libs="CommonTools"/>\r
 \r
       <includepath path="${PACKAGE_DIR}/Common"/>\r
                        <libset dir="${LIB_DIR}" libs="CommonTools"/>\r
 \r
index 51adc216db906af0b7fc6ff18c76d536e63897eb..0ed83128602e2688dd6ffe7c0903ca7c921fc77d 100644 (file)
@@ -91,10 +91,10 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
         defaultexcludes="TRUE" \r
         excludes="*.xml *.inf"/>\r
 \r
         defaultexcludes="TRUE" \r
         excludes="*.xml *.inf"/>\r
 \r
-      <includepath path="${env.WORKSPACE}/MdePkg/Include"/>\r
-      <includepath path="${env.WORKSPACE}/MdePkg/Include/Ia32"/>\r
-      <includepath path="${env.WORKSPACE}/MdePkg/Include/Common"/>\r
-      <includepath path="${env.WORKSPACE}/MdePkg/Include/Protocol"/>\r
+      <includepath path="${PACKAGE_DIR}/Include"/>\r
+      <includepath path="${PACKAGE_DIR}/Include/Ia32"/>\r
+      <includepath path="${PACKAGE_DIR}/Include/Common"/>\r
+      <includepath path="${PACKAGE_DIR}/Include/Protocol"/>\r
       <includepath path="${PACKAGE_DIR}/Common"/>\r
       <libset dir="${LIB_DIR}" libs="CommonTools CustomizedCompress"/>\r
     </cc>\r
       <includepath path="${PACKAGE_DIR}/Common"/>\r
       <libset dir="${LIB_DIR}" libs="CommonTools CustomizedCompress"/>\r
     </cc>\r
index 96658e870cc7583de847f74f7baf40668688f2fb..389701d8459839d5540b8e432e89dddbe7734140 100644 (file)
@@ -93,11 +93,11 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
         defaultexcludes="TRUE" \r
         excludes="*.xml *.inf"/>\r
 \r
         defaultexcludes="TRUE" \r
         excludes="*.xml *.inf"/>\r
 \r
-      <includepath path="${env.WORKSPACE}/MdePkg/Include"/>\r
-      <includepath path="${env.WORKSPACE}/MdePkg/Include/Ia32"/>\r
-      <includepath path="${env.WORKSPACE}/MdePkg/Include/Common"/>\r
-      <includepath path="${env.WORKSPACE}/MdePkg/Include/Protocol"/>\r
-      <includepath path="${env.WORKSPACE}/MdePkg/Include/Library"/>\r
+      <includepath path="${PACKAGE_DIR}/Include"/>\r
+      <includepath path="${PACKAGE_DIR}/Include/Ia32"/>\r
+      <includepath path="${PACKAGE_DIR}/Include/Common"/>\r
+      <includepath path="${PACKAGE_DIR}/Include/Protocol"/>\r
+      <includepath path="${PACKAGE_DIR}/Include/Library"/>\r
       <includepath path="${PACKAGE_DIR}/Common"/>\r
       <libset dir="${LIB_DIR}" libs="CommonTools CustomizedCompress String"/>\r
     </cc>\r
       <includepath path="${PACKAGE_DIR}/Common"/>\r
       <libset dir="${LIB_DIR}" libs="CommonTools CustomizedCompress String"/>\r
     </cc>\r
index 34f44ebb677dd5ab02c0b6cfda4b4a2ed24018d1..16c8768522b40a078a8677cf54ea27fc0516169f 100644 (file)
@@ -115,12 +115,12 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
         includes="*.c" />\r
 \r
       <includepath path="${PACKAGE_DIR}/${LibName}"/>\r
         includes="*.c" />\r
 \r
       <includepath path="${PACKAGE_DIR}/${LibName}"/>\r
-      <includepath path="${env.WORKSPACE}/MdePkg/Include"/>\r
-      <includepath path="${env.WORKSPACE}/MdePkg/Include"/>\r
-      <includepath path="${env.WORKSPACE}/MdePkg/Include/Ia32"/>\r
-      <includepath path="${env.WORKSPACE}/MdePkg/Include/Common"/>\r
-      <includepath path="${env.WORKSPACE}/MdePkg/Include/Protocol"/>\r
-      <includepath path="${env.WORKSPACE}/MdePkg/Include/Library"/>\r
+      <includepath path="${PACKAGE_DIR}/Include"/>\r
+      <includepath path="${PACKAGE_DIR}/Include"/>\r
+      <includepath path="${PACKAGE_DIR}/Include/Ia32"/>\r
+      <includepath path="${PACKAGE_DIR}/Include/Common"/>\r
+      <includepath path="${PACKAGE_DIR}/Include/Protocol"/>\r
+      <includepath path="${PACKAGE_DIR}/Include/Library"/>\r
       <includepath path="${PACKAGE_DIR}/Common"/>\r
     </cc>\r
   </target>\r
       <includepath path="${PACKAGE_DIR}/Common"/>\r
     </cc>\r
   </target>\r
index d63faebbbba349212dc9f3341cc44cae6a198fa3..d15141a9cc1a3da45b5b59a759a132d2e9dc2769 100644 (file)
@@ -91,10 +91,10 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
         defaultexcludes="TRUE" \r
         excludes="*.xml *.inf"/>\r
 \r
         defaultexcludes="TRUE" \r
         excludes="*.xml *.inf"/>\r
 \r
-      <includepath path="${env.WORKSPACE}/MdePkg/Include"/>\r
-      <includepath path="${env.WORKSPACE}/MdePkg/Include/Ia32"/>\r
-      <includepath path="${env.WORKSPACE}/MdePkg/Include/Common"/>\r
-      <includepath path="${env.WORKSPACE}/MdePkg/Include/Protocol"/>\r
+      <includepath path="${PACKAGE_DIR}/Include"/>\r
+      <includepath path="${PACKAGE_DIR}/Include/Ia32"/>\r
+      <includepath path="${PACKAGE_DIR}/Include/Common"/>\r
+      <includepath path="${PACKAGE_DIR}/Include/Protocol"/>\r
       <includepath path="${PACKAGE_DIR}/Common"/>\r
       <libset dir="${LIB_DIR}" libs="CommonTools CustomizedCompress"/>\r
     </cc>\r
       <includepath path="${PACKAGE_DIR}/Common"/>\r
       <libset dir="${LIB_DIR}" libs="CommonTools CustomizedCompress"/>\r
     </cc>\r
index 8fb9d74e10f86fb3343700b3e13ef30fb80c07e3..26d07878f7b411f48137a4a43da46adf37fc3f1f 100644 (file)
@@ -123,10 +123,10 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
         includes="${FileSetPccts}" />\r
 \r
       <includepath path="${env.WORKSPACE}/Tools/Source/TianoTools/Pccts/h"/>\r
         includes="${FileSetPccts}" />\r
 \r
       <includepath path="${env.WORKSPACE}/Tools/Source/TianoTools/Pccts/h"/>\r
-      <includepath path="${env.WORKSPACE}/MdePkg/Include"/>\r
-      <includepath path="${env.WORKSPACE}/MdePkg/Include/Ia32"/>\r
-      <includepath path="${env.WORKSPACE}/MdePkg/Include/Common"/>\r
-      <includepath path="${env.WORKSPACE}/MdePkg/Include/Protocol"/>\r
+      <includepath path="${PACKAGE_DIR}/Include"/>\r
+      <includepath path="${PACKAGE_DIR}/Include/Ia32"/>\r
+      <includepath path="${PACKAGE_DIR}/Include/Common"/>\r
+      <includepath path="${PACKAGE_DIR}/Include/Protocol"/>\r
       <includepath path="${PACKAGE_DIR}/Common"/>\r
       <libset dir="${LIB_DIR}" libs="CommonTools"/>\r
       <syslibset libs="${gxx_extra_libs}" if="gcc"/>\r
       <includepath path="${PACKAGE_DIR}/Common"/>\r
       <libset dir="${LIB_DIR}" libs="CommonTools"/>\r
       <syslibset libs="${gxx_extra_libs}" if="gcc"/>\r
index 3e00f7040f9160c415f2c1fc4f1ef830df98e355..34781cd0b7dbac1724d01f8193c5cb482998da33 100644 (file)
@@ -91,10 +91,10 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
         defaultexcludes="TRUE" \r
         excludes="*.xml *.inf"/>\r
 \r
         defaultexcludes="TRUE" \r
         excludes="*.xml *.inf"/>\r
 \r
-      <includepath path="${env.WORKSPACE}/MdePkg/Include"/>\r
-      <includepath path="${env.WORKSPACE}/MdePkg/Include/Ia32"/>\r
-      <includepath path="${env.WORKSPACE}/MdePkg/Include/Common"/>\r
-      <includepath path="${env.WORKSPACE}/MdePkg/Include/Protocol"/>\r
+      <includepath path="${PACKAGE_DIR}/Include"/>\r
+      <includepath path="${PACKAGE_DIR}/Include/Ia32"/>\r
+      <includepath path="${PACKAGE_DIR}/Include/Common"/>\r
+      <includepath path="${PACKAGE_DIR}/Include/Protocol"/>\r
       <includepath path="${PACKAGE_DIR}/Common"/>\r
       <libset dir="${LIB_DIR}" libs="CommonTools CustomizedCompress"/>\r
     </cc>\r
       <includepath path="${PACKAGE_DIR}/Common"/>\r
       <libset dir="${LIB_DIR}" libs="CommonTools CustomizedCompress"/>\r
     </cc>\r