]> git.proxmox.com Git - mirror_edk2.git/commitdiff
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@150 6f19259b...
authorlgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524>
Sun, 14 May 2006 09:14:46 +0000 (09:14 +0000)
committerlgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524>
Sun, 14 May 2006 09:14:46 +0000 (09:14 +0000)
17 files changed:
EdkModulePkg/Bus/Pci/IdeBus/Dxe/idebus.c
EdkModulePkg/Core/Dxe/DxeMain.mbd
EdkModulePkg/Core/Dxe/DxeMain.msa
EdkModulePkg/Core/Dxe/DxeMain/DxeMain.c
EdkModulePkg/Core/Dxe/Event/event.c
EdkModulePkg/Core/DxeIplPeim/DxeIpl.mbd
EdkModulePkg/Core/DxeIplPeim/DxeIplX64.mbd
EdkModulePkg/Core/DxeIplPeim/DxeIplX64.msa
EdkModulePkg/Core/DxeIplPeim/DxeLoadX64.c
EdkModulePkg/Core/DxeIplPeim/build.xml
EdkModulePkg/Core/DxeIplPeim/x64/LongMode.asm
EdkModulePkg/Core/Pei/Image/Image.c
EdkModulePkg/Core/Pei/PeiMain.mbd
EdkModulePkg/Core/Pei/PeiMain/PeiMain.c
EdkModulePkg/EdkModulePkg.spd
EdkModulePkg/Universal/StatusCode/RuntimeDxe/StatusCode.mbd
EdkModulePkg/Universal/Variable/Pei/Variable.mbd

index 2b8f52aa54a7eacc423962a34a1168ed72501350..4cf882eb00f01d4abc4f6513eeedddbc95eda43e 100644 (file)
@@ -502,15 +502,6 @@ IDEBusDriverBindingStart (
       IdeBlkIoDevicePtr->IdeBusDriverPrivateData = IdeBusDriverPrivateData;\r
       IdeBlkIoDevicePtr->IoPort->BusMasterBaseAddr = IdeRegsBaseAddr[IdeChannel].BusMasterBaseAddr;\r
 \r
-      //\r
-      // Report Status code: is about to detect IDE drive\r
-      //\r
-      REPORT_STATUS_CODE_WITH_DEVICE_PATH (\r
-        EFI_PROGRESS_CODE,\r
-        (EFI_IO_BUS_ATA_ATAPI | EFI_P_PC_PRESENCE_DETECT),\r
-        IdeBlkIoDevicePtr->DevicePath\r
-        );\r
-\r
       //\r
       // Discover device, now!\r
       //\r
index ec084b5c5666076702ef5008b0eb43215d0a4879..55967cacded23c0fe0de5f4937e8f3c968cbd71d 100644 (file)
@@ -1,42 +1,42 @@
-<?xml version="1.0" encoding="UTF-8"?>\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
-<ModuleBuildDescription xmlns="http://www.TianoCore.org/2006/Edk2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.TianoCore.org/2006/Edk2.0  http://www.TianoCore.org/2006/Edk2.0/SurfaceArea.xsd">\r
-    <MbdHeader>\r
-        <BaseName>DxeMain</BaseName>\r
-        <Guid>D6A2CB7F-6A18-4e2f-B43B-9920A733700A</Guid>\r
-        <Version>0</Version>\r
-        <Description>FIX ME!</Description>\r
-        <Copyright>Copyright (c) 2004-2006, Intel Corporation</Copyright>\r
-        <License> All rights reserved. This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. </License>\r
-        <Created>2006-03-12 17:09</Created>\r
-        <Modified>2006-03-19 15:18</Modified>\r
-    </MbdHeader>\r
-    <Libraries>\r
-        <Library>BaseLib</Library>\r
-        <Library>BaseCacheMaintenanceLib</Library>\r
-        <Library>DxeReportStatusCodeLib</Library>\r
-        <Library>BaseDebugLibReportStatusCode</Library>\r
-        <Library>DxeCoreUefiDecompressLibFromHob</Library>\r
-        <Library>DxeCoreTianoDecompressLibFromHob</Library>\r
-        <Library>DxeCoreCustomDecompressLibFromHob</Library>\r
-        <Library>EdkDxePeCoffLoaderFromHobLib</Library>\r
-        <Library>DxeCoreHobLib</Library>\r
-        <Library>DxeCoreEntryPoint</Library>\r
-        <Library>BaseMemoryLib</Library>\r
-        <Library>UefiLib</Library>\r
-        <Library>BasePerformanceLibNull</Library>\r
-    </Libraries>\r
-    <BuildOptions ToolChain="MSFT">\r
-        <ImageEntryPoint>_ModuleEntryPoint</ImageEntryPoint>\r
-        <Option>C_PROJ_FLAGS = ${C_PROJ_FLAGS} /Ob0</Option>\r
-    </BuildOptions>\r
-</ModuleBuildDescription>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Copyright (c) 2006, Intel Corporation
+All rights reserved. This program and the accompanying materials
+are licensed and made available under the terms and conditions of the BSD License
+which accompanies this distribution.  The full text of the license may be found at
+http://opensource.org/licenses/bsd-license.php
+
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+-->
+<ModuleBuildDescription xmlns="http://www.TianoCore.org/2006/Edk2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.TianoCore.org/2006/Edk2.0  http://www.TianoCore.org/2006/Edk2.0/SurfaceArea.xsd">
+    <MbdHeader>
+        <BaseName>DxeMain</BaseName>
+        <Guid>D6A2CB7F-6A18-4e2f-B43B-9920A733700A</Guid>
+        <Version>0</Version>
+        <Description>FIX ME!</Description>
+        <Copyright>Copyright (c) 2004-2006, Intel Corporation</Copyright>
+        <License> All rights reserved. This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. </License>
+        <Created>2006-03-12 17:09</Created>
+        <Modified>2006-03-19 15:18</Modified>
+    </MbdHeader>
+    <Libraries>
+        <Library>BaseLib</Library>
+        <Library>BaseCacheMaintenanceLib</Library>
+        <Library>DxeReportStatusCodeLib</Library>
+        <Library>BaseDebugLibReportStatusCode</Library>
+        <Library OverrideID="1111">DxeCoreUefiDecompressLibFromHob</Library>
+        <Library OverrideID="1111">DxeCoreTianoDecompressLibFromHob</Library>
+        <Library OverrideID="3333">DxeCoreCustomDecompressLibFromHob</Library>
+        <Library OverrideID="4444">EdkDxePeCoffLoaderFromHobLib</Library>
+        <Library>DxeCoreHobLib</Library>
+        <Library>DxeCoreEntryPoint</Library>
+        <Library>BaseMemoryLib</Library>
+        <Library>UefiLib</Library>
+        <Library>BasePerformanceLibNull</Library>
+    </Libraries>
+    <BuildOptions ToolChain="MSFT">
+        <ImageEntryPoint>_ModuleEntryPoint</ImageEntryPoint>
+        <Option>C_PROJ_FLAGS = ${C_PROJ_FLAGS} /Ob0</Option>
+    </BuildOptions>
+</ModuleBuildDescription>
index 9f9de4a86a3d443e5bc59aa1766ef8583a4413c1..991e945ca038c138a4090796b6dfb3f37cd0d894 100644 (file)
-<?xml version="1.0" encoding="UTF-8"?>\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
-<ModuleSurfaceArea xmlns="http://www.TianoCore.org/2006/Edk2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.TianoCore.org/2006/Edk2.0  http://www.TianoCore.org/2006/Edk2.0/SurfaceArea.xsd">\r
-    <MsaHeader>\r
-        <BaseName>DxeMain</BaseName>\r
-        <ModuleType>DXE_CORE</ModuleType>\r
-        <ComponentType>BS_DRIVER</ComponentType>\r
-        <Guid>D6A2CB7F-6A18-4e2f-B43B-9920A733700A</Guid>\r
-        <Version>0</Version>\r
-        <Abstract>Component description file for DxeMain.</Abstract>\r
-        <Description>FIX ME!</Description>\r
-        <Copyright>Copyright (c) 2004-2006, Intel Corporation</Copyright>\r
-        <License> All rights reserved. This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. </License>\r
-        <Specification>0</Specification>\r
-        <Created>2006-03-12 17:09</Created>\r
-        <Updated>2006-03-19 15:18</Updated>\r
-    </MsaHeader>\r
-    <LibraryClassDefinitions>\r
-        <LibraryClass Usage="ALWAYS_CONSUMED">DxeCoreEntryPoint</LibraryClass>\r
-        <LibraryClass Usage="ALWAYS_CONSUMED">DebugLib</LibraryClass>\r
-        <LibraryClass Usage="ALWAYS_CONSUMED">UefiLib</LibraryClass>\r
-        <LibraryClass Usage="ALWAYS_CONSUMED">BaseLib</LibraryClass>\r
-        <LibraryClass Usage="ALWAYS_CONSUMED">HobLib</LibraryClass>\r
-        <LibraryClass Usage="ALWAYS_CONSUMED">PerformanceLib</LibraryClass>\r
-        <LibraryClass Usage="ALWAYS_CONSUMED">UefiDecompressLib</LibraryClass>\r
-        <LibraryClass Usage="ALWAYS_CONSUMED">TianoDecompressLib</LibraryClass>\r
-        <LibraryClass Usage="ALWAYS_CONSUMED">CustomDecompressLib</LibraryClass>\r
-        <LibraryClass Usage="ALWAYS_CONSUMED">EdkPeCoffLoaderLib</LibraryClass>\r
-        <LibraryClass Usage="ALWAYS_CONSUMED">CacheMaintenanceLib</LibraryClass>\r
-        <LibraryClass Usage="ALWAYS_CONSUMED">BaseMemoryLib</LibraryClass>\r
-    </LibraryClassDefinitions>\r
-    <SourceFiles>\r
-        <Filename>DxeMain/DxeMain.c</Filename>\r
-        <Filename>DxeMain/DxeProtocolNotify.c</Filename>\r
-        <Filename>Dispatcher/Dispatcher.c</Filename>\r
-        <Filename>Dispatcher/Dependency.c</Filename>\r
-        <Filename>Event/ExecData.c</Filename>\r
-        <Filename>Event/Event.c</Filename>\r
-        <Filename>Event/Timer.c</Filename>\r
-        <Filename>Event/Tpl.c</Filename>\r
-        <Filename>FwVol/FwVol.c</Filename>\r
-        <Filename>FwVol/Ffs.c</Filename>\r
-        <Filename>FwVol/FwVolAttrib.c</Filename>\r
-        <Filename>FwVol/FwVolRead.c</Filename>\r
-        <Filename>FwVol/FwVolWrite.c</Filename>\r
-        <Filename>FwVolBlock/FwVolBlock.c</Filename>\r
-        <Filename>Mem/MemData.c</Filename>\r
-        <Filename>Mem/Page.c</Filename>\r
-        <Filename>Mem/Pool.c</Filename>\r
-        <Filename>Gcd/Gcd.c</Filename>\r
-        <Filename>Hand/Handle.c</Filename>\r
-        <Filename>Hand/Locate.c</Filename>\r
-        <Filename>Hand/Notify.c</Filename>\r
-        <Filename>Hand/DriverSupport.c</Filename>\r
-        <Filename>Library/Library.c</Filename>\r
-        <Filename>Misc/InstallConfigurationTable.c</Filename>\r
-        <Filename>Misc/SetWatchdogTimer.c</Filename>\r
-        <Filename>Misc/Stall.c</Filename>\r
-        <Filename>Misc/DebugImageInfo.c</Filename>\r
-        <Filename>Image/Image.c</Filename>\r
-        <Filename>Image/ImageFile.c</Filename>\r
-        <Filename>SectionExtraction/CoreSectionExtraction.c</Filename>\r
-        <Filename>DebugImageInfo.h</Filename>\r
-        <Filename>DebugMask.h</Filename>\r
-        <Filename>DxeMain.h</Filename>\r
-        <Filename>Exec.h</Filename>\r
-        <Filename>FwVolBlock.h</Filename>\r
-        <Filename>FwVolDriver.h</Filename>\r
-        <Filename>Gcd.h</Filename>\r
-        <Filename>Hand.h</Filename>\r
-        <Filename>Image.h</Filename>\r
-        <Filename>Imem.h</Filename>\r
-        <Filename>Library.h</Filename>\r
-    </SourceFiles>\r
-    <Includes>\r
-        <PackageName>MdePkg</PackageName>\r
-        <PackageName>EdkModulePkg</PackageName>\r
-    </Includes>\r
-    <Protocols>\r
-        <Protocol Usage="SOMETIMES_CONSUMED">Ebc</Protocol>\r
-        <Protocol Usage="ALWAYS_CONSUMED">LoadedImage</Protocol>\r
-        <Protocol Usage="ALWAYS_CONSUMED">DevicePath</Protocol>\r
-        <Protocol Usage="ALWAYS_CONSUMED">Cpu</Protocol>\r
-        <Protocol Usage="ALWAYS_CONSUMED">FirmwareVolume</Protocol>\r
-        <Protocol Usage="ALWAYS_CONSUMED">FirmwareVolumeDispatch</Protocol>\r
-        <Protocol Usage="ALWAYS_CONSUMED">FirmwareVolumeBlock</Protocol>\r
-        <Protocol Usage="ALWAYS_CONSUMED">SectionExtraction</Protocol>\r
-        <Protocol Usage="SOMETIMES_CONSUMED">DriverBinding</Protocol>\r
-        <Protocol Usage="ALWAYS_CONSUMED">PlatformDriverOverride</Protocol>\r
-        <Protocol Usage="ALWAYS_CONSUMED">BusSpecificDriverOverride</Protocol>\r
-        <Protocol Usage="ALWAYS_CONSUMED">Timer</Protocol>\r
-        <Protocol Usage="ALWAYS_CONSUMED">Metronome</Protocol>\r
-        <Protocol Usage="ALWAYS_CONSUMED">MonotonicCounter</Protocol>\r
-        <Protocol Usage="ALWAYS_CONSUMED">VariableWrite</Protocol>\r
-        <Protocol Usage="ALWAYS_CONSUMED">Bds</Protocol>\r
-        <Protocol Usage="ALWAYS_CONSUMED">Variable</Protocol>\r
-        <Protocol Usage="ALWAYS_CONSUMED">Security</Protocol>\r
-        <Protocol Usage="ALWAYS_CONSUMED">WatchdogTimer</Protocol>\r
-        <Protocol Usage="ALWAYS_CONSUMED">Runtime</Protocol>\r
-        <Protocol Usage="ALWAYS_CONSUMED">RealTimeClock</Protocol>\r
-        <Protocol Usage="ALWAYS_CONSUMED">Reset</Protocol>\r
-        <Protocol Usage="ALWAYS_CONSUMED">LoadFile</Protocol>\r
-        <Protocol Usage="ALWAYS_CONSUMED">SimpleFileSystem</Protocol>\r
-        <Protocol Usage="ALWAYS_CONSUMED">LoadPeImage</Protocol>\r
-    </Protocols>\r
-    <Guids>\r
-        <GuidEntry Usage="ALWAYS_CONSUMED">\r
-            <C_Name>MemoryTypeInformation</C_Name>\r
-        </GuidEntry>\r
-        <GuidEntry Usage="ALWAYS_CONSUMED">\r
-            <C_Name>DxeServicesTable</C_Name>\r
-        </GuidEntry>\r
-        <GuidEntry Usage="ALWAYS_CONSUMED">\r
-            <C_Name>HobList</C_Name>\r
-        </GuidEntry>\r
-        <GuidEntry Usage="ALWAYS_CONSUMED">\r
-            <C_Name>DebugImageInfoTable</C_Name>\r
-        </GuidEntry>\r
-        <GuidEntry Usage="ALWAYS_CONSUMED">\r
-            <C_Name>Apriori</C_Name>\r
-        </GuidEntry>\r
-        <GuidEntry Usage="ALWAYS_CONSUMED">\r
-            <C_Name>FirmwareFileSystem</C_Name>\r
-        </GuidEntry>\r
-        <GuidEntry Usage="ALWAYS_CONSUMED">\r
-            <C_Name>FileInfo</C_Name>\r
-        </GuidEntry>\r
-        <GuidEntry Usage="ALWAYS_CONSUMED">\r
-            <C_Name>HobMemoryAllocModule</C_Name>\r
-        </GuidEntry>\r
-        <GuidEntry Usage="ALWAYS_CONSUMED">\r
-            <C_Name>PeiPeCoffLoader</C_Name>\r
-        </GuidEntry>\r
-        <GuidEntry Usage="ALWAYS_CONSUMED">\r
-            <C_Name>LoadPeImage</C_Name>\r
-        </GuidEntry>\r
-        <GuidEntry Usage="ALWAYS_CONSUMED">\r
-            <C_Name>EventExitBootServices</C_Name>\r
-        </GuidEntry>\r
-        <GuidEntry Usage="ALWAYS_CONSUMED">\r
-            <C_Name>EventVirtualAddressChange</C_Name>\r
-        </GuidEntry>\r
-        <GuidEntry Usage="ALWAYS_CONSUMED">\r
-            <C_Name>EventMemoryMapChange</C_Name>\r
-        </GuidEntry>\r
-    </Guids>\r
-    <Externs>\r
-        <Extern>\r
-            <ModuleEntryPoint>DxeMain</ModuleEntryPoint>\r
-        </Extern>\r
-    </Externs>\r
-    <BuildOptions>\r
-        <Option>BUILD_TYPE=DXE_CORE</Option>\r
-    </BuildOptions>\r
-</ModuleSurfaceArea>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Copyright (c) 2006, Intel Corporation
+All rights reserved. This program and the accompanying materials
+are licensed and made available under the terms and conditions of the BSD License
+which accompanies this distribution.  The full text of the license may be found at
+http://opensource.org/licenses/bsd-license.php
+
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+-->
+<ModuleSurfaceArea xmlns="http://www.TianoCore.org/2006/Edk2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.TianoCore.org/2006/Edk2.0  http://www.TianoCore.org/2006/Edk2.0/SurfaceArea.xsd">
+    <MsaHeader>
+        <BaseName>DxeMain</BaseName>
+        <ModuleType>DXE_CORE</ModuleType>
+        <ComponentType>BS_DRIVER</ComponentType>
+        <Guid>D6A2CB7F-6A18-4e2f-B43B-9920A733700A</Guid>
+        <Version>0</Version>
+        <Abstract>Component description file for DxeMain.</Abstract>
+        <Description>FIX ME!</Description>
+        <Copyright>Copyright (c) 2004-2006, Intel Corporation</Copyright>
+        <License> All rights reserved. This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. </License>
+        <Specification>0</Specification>
+        <Created>2006-03-12 17:09</Created>
+        <Updated>2006-03-19 15:18</Updated>
+    </MsaHeader>
+    <LibraryClassDefinitions>
+        <LibraryClass Usage="ALWAYS_CONSUMED">DxeCoreEntryPoint</LibraryClass>
+        <LibraryClass Usage="ALWAYS_CONSUMED">DebugLib</LibraryClass>
+        <LibraryClass Usage="ALWAYS_CONSUMED">UefiLib</LibraryClass>
+        <LibraryClass Usage="ALWAYS_CONSUMED">BaseLib</LibraryClass>
+        <LibraryClass Usage="ALWAYS_CONSUMED">HobLib</LibraryClass>
+        <LibraryClass Usage="ALWAYS_CONSUMED">PerformanceLib</LibraryClass>
+        <LibraryClass Usage="ALWAYS_CONSUMED">UefiDecompressLib</LibraryClass>
+        <LibraryClass Usage="ALWAYS_CONSUMED">TianoDecompressLib</LibraryClass>
+        <LibraryClass Usage="ALWAYS_CONSUMED">CustomDecompressLib</LibraryClass>
+        <LibraryClass Usage="ALWAYS_CONSUMED">EdkPeCoffLoaderLib</LibraryClass>
+        <LibraryClass Usage="ALWAYS_CONSUMED">CacheMaintenanceLib</LibraryClass>
+        <LibraryClass Usage="ALWAYS_CONSUMED">BaseMemoryLib</LibraryClass>
+    </LibraryClassDefinitions>
+    <SourceFiles>
+        <Filename>DxeMain/DxeMain.c</Filename>
+        <Filename>DxeMain/DxeProtocolNotify.c</Filename>
+        <Filename>Dispatcher/Dispatcher.c</Filename>
+        <Filename>Dispatcher/Dependency.c</Filename>
+        <Filename>Event/ExecData.c</Filename>
+        <Filename>Event/Event.c</Filename>
+        <Filename>Event/Timer.c</Filename>
+        <Filename>Event/Tpl.c</Filename>
+        <Filename>FwVol/FwVol.c</Filename>
+        <Filename>FwVol/Ffs.c</Filename>
+        <Filename>FwVol/FwVolAttrib.c</Filename>
+        <Filename>FwVol/FwVolRead.c</Filename>
+        <Filename>FwVol/FwVolWrite.c</Filename>
+        <Filename>FwVolBlock/FwVolBlock.c</Filename>
+        <Filename>Mem/MemData.c</Filename>
+        <Filename>Mem/Page.c</Filename>
+        <Filename>Mem/Pool.c</Filename>
+        <Filename>Gcd/Gcd.c</Filename>
+        <Filename>Hand/Handle.c</Filename>
+        <Filename>Hand/Locate.c</Filename>
+        <Filename>Hand/Notify.c</Filename>
+        <Filename>Hand/DriverSupport.c</Filename>
+        <Filename>Library/Library.c</Filename>
+        <Filename>Misc/InstallConfigurationTable.c</Filename>
+        <Filename>Misc/SetWatchdogTimer.c</Filename>
+        <Filename>Misc/Stall.c</Filename>
+        <Filename>Misc/DebugImageInfo.c</Filename>
+        <Filename>Image/Image.c</Filename>
+        <Filename>Image/ImageFile.c</Filename>
+        <Filename>SectionExtraction/CoreSectionExtraction.c</Filename>
+        <Filename>DebugImageInfo.h</Filename>
+        <Filename>DebugMask.h</Filename>
+        <Filename>DxeMain.h</Filename>
+        <Filename>Exec.h</Filename>
+        <Filename>FwVolBlock.h</Filename>
+        <Filename>FwVolDriver.h</Filename>
+        <Filename>Gcd.h</Filename>
+        <Filename>Hand.h</Filename>
+        <Filename>Image.h</Filename>
+        <Filename>Imem.h</Filename>
+        <Filename>Library.h</Filename>
+    </SourceFiles>
+    <Includes>
+        <PackageName>MdePkg</PackageName>
+        <PackageName>EdkModulePkg</PackageName>
+    </Includes>
+    <Protocols>
+        <Protocol Usage="SOMETIMES_CONSUMED">Ebc</Protocol>
+        <Protocol Usage="ALWAYS_CONSUMED">LoadedImage</Protocol>
+        <Protocol Usage="ALWAYS_CONSUMED">DevicePath</Protocol>
+        <Protocol Usage="ALWAYS_CONSUMED">Cpu</Protocol>
+        <Protocol Usage="ALWAYS_CONSUMED">FirmwareVolume</Protocol>
+        <Protocol Usage="ALWAYS_CONSUMED">FirmwareVolumeDispatch</Protocol>
+        <Protocol Usage="ALWAYS_CONSUMED">FirmwareVolumeBlock</Protocol>
+        <Protocol Usage="ALWAYS_CONSUMED">SectionExtraction</Protocol>
+        <Protocol Usage="SOMETIMES_CONSUMED">DriverBinding</Protocol>
+        <Protocol Usage="ALWAYS_CONSUMED">PlatformDriverOverride</Protocol>
+        <Protocol Usage="ALWAYS_CONSUMED">BusSpecificDriverOverride</Protocol>
+        <Protocol Usage="ALWAYS_CONSUMED">Timer</Protocol>
+        <Protocol Usage="ALWAYS_CONSUMED">Metronome</Protocol>
+        <Protocol Usage="ALWAYS_CONSUMED">MonotonicCounter</Protocol>
+        <Protocol Usage="ALWAYS_CONSUMED">VariableWrite</Protocol>
+        <Protocol Usage="ALWAYS_CONSUMED">Bds</Protocol>
+        <Protocol Usage="ALWAYS_CONSUMED">Variable</Protocol>
+        <Protocol Usage="ALWAYS_CONSUMED">Security</Protocol>
+        <Protocol Usage="ALWAYS_CONSUMED">WatchdogTimer</Protocol>
+        <Protocol Usage="ALWAYS_CONSUMED">Runtime</Protocol>
+        <Protocol Usage="ALWAYS_CONSUMED">RealTimeClock</Protocol>
+        <Protocol Usage="ALWAYS_CONSUMED">Reset</Protocol>
+        <Protocol Usage="ALWAYS_CONSUMED">LoadFile</Protocol>
+        <Protocol Usage="ALWAYS_CONSUMED">SimpleFileSystem</Protocol>
+        <Protocol Usage="ALWAYS_CONSUMED">LoadPeImage</Protocol>
+        <Protocol Usage="ALWAYS_CONSUMED">Decompress</Protocol>
+        <Protocol Usage="ALWAYS_CONSUMED">CustomizedDecompress</Protocol>
+        <Protocol Usage="ALWAYS_CONSUMED">TianoDecompress</Protocol>
+    </Protocols>
+    <Guids>
+        <GuidEntry Usage="ALWAYS_CONSUMED">
+            <C_Name>MemoryTypeInformation</C_Name>
+        </GuidEntry>
+        <GuidEntry Usage="ALWAYS_CONSUMED">
+            <C_Name>DxeServicesTable</C_Name>
+        </GuidEntry>
+        <GuidEntry Usage="ALWAYS_CONSUMED">
+            <C_Name>HobList</C_Name>
+        </GuidEntry>
+        <GuidEntry Usage="ALWAYS_CONSUMED">
+            <C_Name>DebugImageInfoTable</C_Name>
+        </GuidEntry>
+        <GuidEntry Usage="ALWAYS_CONSUMED">
+            <C_Name>Apriori</C_Name>
+        </GuidEntry>
+        <GuidEntry Usage="ALWAYS_CONSUMED">
+            <C_Name>FirmwareFileSystem</C_Name>
+        </GuidEntry>
+        <GuidEntry Usage="ALWAYS_CONSUMED">
+            <C_Name>FileInfo</C_Name>
+        </GuidEntry>
+        <GuidEntry Usage="ALWAYS_CONSUMED">
+            <C_Name>HobMemoryAllocModule</C_Name>
+        </GuidEntry>
+        <GuidEntry Usage="ALWAYS_CONSUMED">
+            <C_Name>PeiPeCoffLoader</C_Name>
+        </GuidEntry>
+        <GuidEntry Usage="ALWAYS_CONSUMED">
+            <C_Name>LoadPeImage</C_Name>
+        </GuidEntry>
+        <GuidEntry Usage="ALWAYS_CONSUMED">
+            <C_Name>EventExitBootServices</C_Name>
+        </GuidEntry>
+        <GuidEntry Usage="ALWAYS_CONSUMED">
+            <C_Name>EventVirtualAddressChange</C_Name>
+        </GuidEntry>
+        <GuidEntry Usage="ALWAYS_CONSUMED">
+            <C_Name>EventMemoryMapChange</C_Name>
+        </GuidEntry>
+    </Guids>
+    <Externs>
+        <Extern>
+            <ModuleEntryPoint>DxeMain</ModuleEntryPoint>
+        </Extern>
+    </Externs>
+    <BuildOptions>
+        <Option>BUILD_TYPE=DXE_CORE</Option>
+    </BuildOptions>
+</ModuleSurfaceArea>
index f98f0541ff14ec308f81fdd8f5818607ed54544c..67a26fe05c0799318f8e4d537c2cae5d41812954 100644 (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:\r
-\r
-  DxeMain.c\r
-\r
-Abstract:\r
-\r
-  DXE Core Main Entry Point\r
-\r
---*/\r
-\r
-#include <DxeMain.h>\r
-\r
-VOID\r
-EFIAPI\r
-DxeMain (\r
-  IN  VOID *HobStart\r
-  );\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-CoreEfiNotAvailableYetArg0 (\r
-  VOID\r
-  );\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-CoreEfiNotAvailableYetArg1 (\r
-  UINTN Arg1\r
-  );\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-CoreEfiNotAvailableYetArg2 (\r
-  UINTN Arg1,\r
-  UINTN Arg2\r
-  );\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-CoreEfiNotAvailableYetArg3 (\r
-  UINTN Arg1,\r
-  UINTN Arg2,\r
-  UINTN Arg3\r
-  );\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-CoreEfiNotAvailableYetArg4 (\r
-  UINTN Arg1,\r
-  UINTN Arg2,\r
-  UINTN Arg3,\r
-  UINTN Arg4\r
-  );\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-CoreEfiNotAvailableYetArg5 (\r
-  UINTN Arg1,\r
-  UINTN Arg2,\r
-  UINTN Arg3,\r
-  UINTN Arg4,\r
-  UINTN Arg5\r
-  );\r
-\r
-EFI_STATUS\r
-CoreGetPeiProtocol (\r
-  IN EFI_GUID  *ProtocolGuid,\r
-  IN VOID      **Interface\r
-  );\r
-  \r
-EFI_STATUS\r
-DxeMainUefiDecompressGetInfo (\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
-EFI_STATUS\r
-EFIAPI\r
-DxeMainUefiDecompress (\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
-EFI_STATUS\r
-DxeMainTianoDecompressGetInfo (\r
-  IN EFI_TIANO_DECOMPRESS_PROTOCOL      *This,\r
-  IN   VOID                             *Source,\r
-  IN   UINT32                           SourceSize,\r
-  OUT  UINT32                           *DestinationSize,\r
-  OUT  UINT32                           *ScratchSize\r
-  );\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-DxeMainTianoDecompress (\r
-  IN EFI_TIANO_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
-EFI_STATUS\r
-DxeMainCustomDecompressGetInfo (\r
-  IN EFI_CUSTOMIZED_DECOMPRESS_PROTOCOL  *This,\r
-  IN   VOID                              *Source,\r
-  IN   UINT32                            SourceSize,\r
-  OUT  UINT32                            *DestinationSize,\r
-  OUT  UINT32                            *ScratchSize\r
-  );\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-DxeMainCustomDecompress (\r
-  IN EFI_CUSTOMIZED_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
-//\r
-// DXE Core Global Variables for Protocols from PEI\r
-//\r
-EFI_HANDLE                                mDecompressHandle = NULL;\r
-EFI_PEI_PE_COFF_LOADER_PROTOCOL           *gEfiPeiPeCoffLoader          = NULL;\r
-\r
-//\r
-// DXE Core globals for Architecture Protocols\r
-//\r
-EFI_SECURITY_ARCH_PROTOCOL        *gSecurity      = NULL;\r
-EFI_CPU_ARCH_PROTOCOL             *gCpu           = NULL;\r
-EFI_METRONOME_ARCH_PROTOCOL       *gMetronome     = NULL;\r
-EFI_TIMER_ARCH_PROTOCOL           *gTimer         = NULL;\r
-EFI_BDS_ARCH_PROTOCOL             *gBds           = NULL;\r
-EFI_WATCHDOG_TIMER_ARCH_PROTOCOL  *gWatchdogTimer = NULL;\r
-EFI_RUNTIME_ARCH_PROTOCOL         *gRuntime       = NULL;\r
-\r
-//\r
-// BugBug: I'n not runtime, but is the PPI?\r
-//\r
-EFI_STATUS_CODE_PROTOCOL     gStatusCodeInstance = {\r
-  NULL\r
-};\r
-\r
-EFI_STATUS_CODE_PROTOCOL     *gStatusCode    = &gStatusCodeInstance;\r
-\r
-\r
-//\r
-// DXE Core Global used to update core loaded image protocol handle\r
-//\r
-EFI_GUID                           *gDxeCoreFileName;\r
-EFI_LOADED_IMAGE_PROTOCOL          *gDxeCoreLoadedImage;\r
-\r
-\r
-\r
-//\r
-// DXE Core Module Variables\r
-//\r
-\r
-EFI_BOOT_SERVICES mBootServices = {\r
-  {\r
-    EFI_BOOT_SERVICES_SIGNATURE,                                                          // Signature\r
-    EFI_BOOT_SERVICES_REVISION,                                                           // Revision\r
-    sizeof (EFI_BOOT_SERVICES),                                                           // HeaderSize\r
-    0,                                                                                    // CRC32\r
-    0                                                                                     // Reserved\r
-  },                                                                                      \r
-  (EFI_RAISE_TPL)                               CoreRaiseTpl,                             // RaiseTPL\r
-  (EFI_RESTORE_TPL)                             CoreRestoreTpl,                           // RestoreTPL\r
-  (EFI_ALLOCATE_PAGES)                          CoreAllocatePages,                        // AllocatePages\r
-  (EFI_FREE_PAGES)                              CoreFreePages,                            // FreePages\r
-  (EFI_GET_MEMORY_MAP)                          CoreGetMemoryMap,                         // GetMemoryMap\r
-  (EFI_ALLOCATE_POOL)                           CoreAllocatePool,                         // AllocatePool\r
-  (EFI_FREE_POOL)                               CoreFreePool,                             // FreePool\r
-  (EFI_CREATE_EVENT)                            CoreCreateEvent,                          // CreateEvent\r
-  (EFI_SET_TIMER)                               CoreSetTimer,                             // SetTimer\r
-  (EFI_WAIT_FOR_EVENT)                          CoreWaitForEvent,                         // WaitForEvent\r
-  (EFI_SIGNAL_EVENT)                            CoreSignalEvent,                          // SignalEvent\r
-  (EFI_CLOSE_EVENT)                             CoreCloseEvent,                           // CloseEvent\r
-  (EFI_CHECK_EVENT)                             CoreCheckEvent,                           // CheckEvent\r
-  (EFI_INSTALL_PROTOCOL_INTERFACE)              CoreInstallProtocolInterface,             // InstallProtocolInterface\r
-  (EFI_REINSTALL_PROTOCOL_INTERFACE)            CoreReinstallProtocolInterface,           // ReinstallProtocolInterface\r
-  (EFI_UNINSTALL_PROTOCOL_INTERFACE)            CoreUninstallProtocolInterface,           // UninstallProtocolInterface\r
-  (EFI_HANDLE_PROTOCOL)                         CoreHandleProtocol,                       // HandleProtocol\r
-  (VOID *)                                      NULL,                                     // Reserved\r
-  (EFI_REGISTER_PROTOCOL_NOTIFY)                CoreRegisterProtocolNotify,               // RegisterProtocolNotify\r
-  (EFI_LOCATE_HANDLE)                           CoreLocateHandle,                         // LocateHandle\r
-  (EFI_LOCATE_DEVICE_PATH)                      CoreLocateDevicePath,                     // LocateDevicePath\r
-  (EFI_INSTALL_CONFIGURATION_TABLE)             CoreInstallConfigurationTable,            // InstallConfigurationTable\r
-  (EFI_IMAGE_LOAD)                              CoreLoadImage,                            // LoadImage\r
-  (EFI_IMAGE_START)                             CoreStartImage,                           // StartImage\r
-  (EFI_EXIT)                                    CoreExit,                                 // Exit\r
-  (EFI_IMAGE_UNLOAD)                            CoreUnloadImage,                          // UnloadImage\r
-  (EFI_EXIT_BOOT_SERVICES)                      CoreExitBootServices,                     // ExitBootServices\r
-  (EFI_GET_NEXT_MONOTONIC_COUNT)                CoreEfiNotAvailableYetArg1,               // GetNextMonotonicCount\r
-  (EFI_STALL)                                   CoreStall,                                // Stall\r
-  (EFI_SET_WATCHDOG_TIMER)                      CoreSetWatchdogTimer,                     // SetWatchdogTimer\r
-  (EFI_CONNECT_CONTROLLER)                      CoreConnectController,                    // ConnectController\r
-  (EFI_DISCONNECT_CONTROLLER)                   CoreDisconnectController,                 // DisconnectController\r
-  (EFI_OPEN_PROTOCOL)                           CoreOpenProtocol,                         // OpenProtocol\r
-  (EFI_CLOSE_PROTOCOL)                          CoreCloseProtocol,                        // CloseProtocol\r
-  (EFI_OPEN_PROTOCOL_INFORMATION)               CoreOpenProtocolInformation,              // OpenProtocolInformation\r
-  (EFI_PROTOCOLS_PER_HANDLE)                    CoreProtocolsPerHandle,                   // ProtocolsPerHandle\r
-  (EFI_LOCATE_HANDLE_BUFFER)                    CoreLocateHandleBuffer,                   // LocateHandleBuffer\r
-  (EFI_LOCATE_PROTOCOL)                         CoreLocateProtocol,                       // LocateProtocol\r
-  (EFI_INSTALL_MULTIPLE_PROTOCOL_INTERFACES)    CoreInstallMultipleProtocolInterfaces,    // InstallMultipleProtocolInterfaces\r
-  (EFI_UNINSTALL_MULTIPLE_PROTOCOL_INTERFACES)  CoreUninstallMultipleProtocolInterfaces,  // UninstallMultipleProtocolInterfaces\r
-  (EFI_CALCULATE_CRC32)                         CoreEfiNotAvailableYetArg3,               // CalculateCrc32\r
-  (EFI_COPY_MEM)                                CopyMem,                                  // CopyMem\r
-  (EFI_SET_MEM)                                 SetMem                                    // SetMem\r
-#if (EFI_SPECIFICATION_VERSION >= 0x00020000)\r
-  ,                                   \r
-  (EFI_CREATE_EVENT_EX)                          CoreCreateEventEx                         // CreateEventEx\r
-#endif\r
-};\r
-\r
-EFI_DXE_SERVICES mDxeServices = {\r
-  {\r
-    EFI_DXE_SERVICES_SIGNATURE,                                           // Signature\r
-    EFI_DXE_SERVICES_REVISION,                                            // Revision\r
-    sizeof (EFI_DXE_SERVICES),                                            // HeaderSize\r
-    0,                                                                    // CRC32\r
-    0                                                                     // Reserved\r
-  },\r
-  (EFI_ADD_MEMORY_SPACE)             CoreAddMemorySpace,                  // AddMemorySpace\r
-  (EFI_ALLOCATE_MEMORY_SPACE)        CoreAllocateMemorySpace,             // AllocateMemorySpace\r
-  (EFI_FREE_MEMORY_SPACE)            CoreFreeMemorySpace,                 // FreeMemorySpace\r
-  (EFI_REMOVE_MEMORY_SPACE)          CoreRemoveMemorySpace,               // RemoveMemorySpace\r
-  (EFI_GET_MEMORY_SPACE_DESCRIPTOR)  CoreGetMemorySpaceDescriptor,        // GetMemorySpaceDescriptor\r
-  (EFI_SET_MEMORY_SPACE_ATTRIBUTES)  CoreSetMemorySpaceAttributes,        // SetMemorySpaceAttributes\r
-  (EFI_GET_MEMORY_SPACE_MAP)         CoreGetMemorySpaceMap,               // GetMemorySpaceMap\r
-  (EFI_ADD_IO_SPACE)                 CoreAddIoSpace,                      // AddIoSpace\r
-  (EFI_ALLOCATE_IO_SPACE)            CoreAllocateIoSpace,                 // AllocateIoSpace\r
-  (EFI_FREE_IO_SPACE)                CoreFreeIoSpace,                     // FreeIoSpace\r
-  (EFI_REMOVE_IO_SPACE)              CoreRemoveIoSpace,                   // RemoveIoSpace\r
-  (EFI_GET_IO_SPACE_DESCRIPTOR)      CoreGetIoSpaceDescriptor,            // GetIoSpaceDescriptor\r
-  (EFI_GET_IO_SPACE_MAP)             CoreGetIoSpaceMap,                   // GetIoSpaceMap\r
-  (EFI_DISPATCH)                     CoreDispatcher,                      // Dispatch\r
-  (EFI_SCHEDULE)                     CoreSchedule,                        // Schedule\r
-  (EFI_TRUST)                        CoreTrust,                           // Trust\r
-  (EFI_PROCESS_FIRMWARE_VOLUME)      CoreProcessFirmwareVolume,           // ProcessFirmwareVolume\r
-};\r
-\r
-EFI_SYSTEM_TABLE mEfiSystemTableTemplate = {\r
-  {\r
-    EFI_SYSTEM_TABLE_SIGNATURE,                                           // Signature\r
-    EFI_SYSTEM_TABLE_REVISION,                                            // Revision\r
-    sizeof (EFI_SYSTEM_TABLE),                                            // HeaderSize\r
-    0,                                                                    // CRC32\r
-    0                                                                     // Reserved\r
-  },\r
-  NULL,                                                                   // FirmwareVendor\r
-  0,                                                                      // FirmwareRevision\r
-  NULL,                                                                   // ConsoleInHandle\r
-  NULL,                                                                   // ConIn\r
-  NULL,                                                                   // ConsoleOutHandle\r
-  NULL,                                                                   // ConOut\r
-  NULL,                                                                   // StandardErrorHandle\r
-  NULL,                                                                   // StdErr\r
-  NULL,                                                                   // RuntimeServices\r
-  &mBootServices,                                                         // BootServices\r
-  0,                                                                      // NumberOfConfigurationTableEntries\r
-  NULL                                                                    // ConfigurationTable\r
-};\r
-\r
-EFI_RUNTIME_SERVICES mEfiRuntimeServicesTableTemplate = {\r
-  {\r
-    EFI_RUNTIME_SERVICES_SIGNATURE,                               // Signature\r
-    EFI_RUNTIME_SERVICES_REVISION,                                // Revision\r
-    sizeof (EFI_RUNTIME_SERVICES),                                // HeaderSize\r
-    0,                                                            // CRC32\r
-    0                                                             // Reserved\r
-  },\r
-  (EFI_GET_TIME)                 CoreEfiNotAvailableYetArg2,      // GetTime\r
-  (EFI_SET_TIME)                 CoreEfiNotAvailableYetArg1,      // SetTime\r
-  (EFI_GET_WAKEUP_TIME)          CoreEfiNotAvailableYetArg3,      // GetWakeupTime\r
-  (EFI_SET_WAKEUP_TIME)          CoreEfiNotAvailableYetArg2,      // SetWakeupTime\r
-  (EFI_SET_VIRTUAL_ADDRESS_MAP)  CoreEfiNotAvailableYetArg4,      // SetVirtualAddressMap\r
-  (EFI_CONVERT_POINTER)          CoreEfiNotAvailableYetArg2,      // ConvertPointer\r
-  (EFI_GET_VARIABLE)             CoreEfiNotAvailableYetArg5,      // GetVariable\r
-  (EFI_GET_NEXT_VARIABLE_NAME)   CoreEfiNotAvailableYetArg3,      // GetNextVariableName\r
-  (EFI_SET_VARIABLE)             CoreEfiNotAvailableYetArg5,      // SetVariable\r
-  (EFI_GET_NEXT_HIGH_MONO_COUNT) CoreEfiNotAvailableYetArg1,      // GetNextHighMonotonicCount\r
-  (EFI_RESET_SYSTEM)             CoreEfiNotAvailableYetArg4       // ResetSystem \r
-#if ((EDK_RELEASE_VERSION != 0) && (EFI_SPECIFICATION_VERSION <  0x00020000))\r
-  ,\r
-  (TIANO_REPORT_STATUS_CODE)       CoreEfiNotAvailableYetArg5     // ReportStatusCode\r
-#elif (EFI_SPECIFICATION_VERSION >= 0x00020000)\r
-  ,\r
-  (EFI_UPDATE_CAPSULE)              CoreEfiNotAvailableYetArg3,   // UpdateCapsule\r
-  (EFI_QUERY_CAPSULE_CAPABILITIES)  CoreEfiNotAvailableYetArg4,   // QueryCapsuleCapabilities\r
-  (EFI_QUERY_VARIABLE_INFO)         CoreEfiNotAvailableYetArg4    // QueryVariableInfo\r
-#endif\r
-};\r
-\r
-//\r
-// DXE Core Global Variables for the EFI System Table, Boot Services Table, \r
-// DXE Services Table, and Runtime Services Table\r
-//\r
-EFI_BOOT_SERVICES     *gBS = &mBootServices;\r
-EFI_DXE_SERVICES      *gDS = &mDxeServices;\r
-EFI_SYSTEM_TABLE      *gST = NULL;\r
-\r
-//\r
-// For debug initialize gRT to template. gRT must be allocated from RT memory\r
-//  but gRT is used for ASSERT () and DEBUG () type macros so lets give it\r
-//  a value that will not cause debug infrastructure to crash early on.\r
-//\r
-EFI_RUNTIME_SERVICES  *gRT = &mEfiRuntimeServicesTableTemplate;\r
-EFI_HANDLE            gDxeCoreImageHandle = NULL;\r
-\r
-VOID  *mHobStart;\r
-\r
-//\r
-// EFI Decompress Protocol\r
-//\r
-EFI_DECOMPRESS_PROTOCOL  gEfiDecompress = {\r
-  DxeMainUefiDecompressGetInfo,\r
-  DxeMainUefiDecompress\r
-};\r
-\r
-//\r
-// Tiano Decompress Protocol\r
-//\r
-EFI_TIANO_DECOMPRESS_PROTOCOL  gEfiTianoDecompress = {\r
-  DxeMainTianoDecompressGetInfo,\r
-  DxeMainTianoDecompress\r
-};\r
-\r
-//\r
-// Customized Decompress Protocol\r
-//\r
-EFI_CUSTOMIZED_DECOMPRESS_PROTOCOL  gEfiCustomizedDecompress = {\r
-  DxeMainCustomDecompressGetInfo,\r
-  DxeMainCustomDecompress\r
-};\r
-\r
-//\r
-// Main entry point to the DXE Core\r
-//\r
-VOID\r
-EFIAPI\r
-DxeMain (\r
-  IN  VOID *HobStart\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Main entry point to DXE Core.\r
-\r
-Arguments:\r
-\r
-  HobStart - Pointer to the beginning of the HOB List from PEI\r
-\r
-Returns:\r
-\r
-  This function should never return\r
-\r
---*/\r
-{\r
-  EFI_STATUS                         Status;\r
-  EFI_PHYSICAL_ADDRESS               MemoryBaseAddress;\r
-  UINT64                             MemoryLength;\r
-\r
-#ifdef EFI_DXE_PERFORMANCE\r
-  UINT64                             Tick;\r
-\r
-  GetTimerValue (&Tick);\r
-#endif\r
-\r
-  mHobStart = HobStart;\r
-  \r
-  //\r
-  // Initialize Memory Services\r
-  //\r
-  CoreInitializeMemoryServices (&HobStart, &MemoryBaseAddress, &MemoryLength);\r
-\r
-  //\r
-  // Allocate the EFI System Table and EFI Runtime Service Table from EfiRuntimeServicesData\r
-  // Use the templates to initialize the contents of the EFI System Table and EFI Runtime Services Table\r
-  //\r
-  gST = CoreAllocateRuntimeCopyPool (sizeof (EFI_SYSTEM_TABLE), &mEfiSystemTableTemplate);\r
-  ASSERT (gST != NULL);\r
-\r
-  gRT = CoreAllocateRuntimeCopyPool (sizeof (EFI_RUNTIME_SERVICES), &mEfiRuntimeServicesTableTemplate);\r
-  ASSERT (gRT != NULL);\r
-\r
-  gST->RuntimeServices = gRT;\r
-  \r
-  //\r
-  // Start the Image Services.\r
-  //\r
-  Status = CoreInitializeImageServices (HobStart);\r
-  ASSERT_EFI_ERROR (Status);\r
-\r
-  //\r
-  // Call constructor for all libraries\r
-  //\r
-  ProcessLibraryConstructorList (gDxeCoreImageHandle, gST);\r
-\r
-  //\r
-  // Initialize the Global Coherency Domain Services\r
-  //\r
-  Status = CoreInitializeGcdServices (&HobStart, MemoryBaseAddress, MemoryLength);\r
-  ASSERT_EFI_ERROR (Status);\r
-\r
-  //\r
-  // Install the DXE Services Table into the EFI System Tables's Configuration Table\r
-  //\r
-  Status = CoreInstallConfigurationTable (&gEfiDxeServicesTableGuid, gDS);\r
-  ASSERT_EFI_ERROR (Status);\r
-\r
-  //\r
-  // Install the HOB List into the EFI System Tables's Configuration Table\r
-  //\r
-  Status = CoreInstallConfigurationTable (&gEfiHobListGuid, HobStart);\r
-  ASSERT_EFI_ERROR (Status);\r
-\r
-  //\r
-  // Install Memory Type Information Table into the EFI System Tables's Configuration Table\r
-  //\r
-  Status = CoreInstallConfigurationTable (&gEfiMemoryTypeInformationGuid, &gMemoryTypeInformation);\r
-  ASSERT_EFI_ERROR (Status);\r
-\r
-  //\r
-  // Initialize the ReportStatusCode with PEI version, if availible\r
-  //\r
-  CoreGetPeiProtocol (&gEfiStatusCodeRuntimeProtocolGuid, (VOID **)&gStatusCode->ReportStatusCode);\r
-#if ((EDK_RELEASE_VERSION != 0) && (EFI_SPECIFICATION_VERSION < 0x00020000))\r
-  gRT->ReportStatusCode = gStatusCode->ReportStatusCode;\r
-#endif\r
-\r
-  //\r
-  // Report Status Code here for DXE_ENTRY_POINT once it is available\r
-  //\r
-  CoreReportProgressCode ((EFI_SOFTWARE_DXE_CORE | EFI_SW_DXE_CORE_PC_ENTRY_POINT));\r
-\r
-  //\r
-  // Create the aligned system table pointer structure that is used by external\r
-  // debuggers to locate the system table...  Also, install debug image info\r
-  // configuration table.\r
-  //\r
-  CoreInitializeDebugImageInfoTable ();\r
-  CoreNewDebugImageInfoEntry (\r
-    EFI_DEBUG_IMAGE_INFO_TYPE_NORMAL,\r
-    gDxeCoreLoadedImage,\r
-    gDxeCoreImageHandle\r
-    );\r
-\r
-  DEBUG ((EFI_D_INFO | EFI_D_LOAD, "HOBLIST address in DXE = 0x%08x\n", HobStart));\r
-\r
-  //\r
-  // Initialize the Event Services\r
-  //\r
-  Status = CoreInitializeEventServices ();\r
-  ASSERT_EFI_ERROR (Status);\r
-\r
-   \r
-  //\r
-  // Get the Protocols that were passed in from PEI to DXE through GUIDed HOBs\r
-  //\r
-  // These Protocols are not architectural. This implementation is sharing code between \r
-  // PEI and DXE in order to save FLASH space. These Protocols could also be implemented \r
-  // as part of the DXE Core. However, that would also require the DXE Core to be ported \r
-  // each time a different CPU is used, a different Decompression algorithm is used, or a \r
-  // different Image type is used. By placing these Protocols in PEI, the DXE Core remains \r
-  // generic, and only PEI and the Arch Protocols need to be ported from Platform to Platform, \r
-  // and from CPU to CPU.\r
-  //\r
-\r
-  //\r
-  // Publish the EFI, Tiano, and Custom Decompress protocols for use by other DXE components\r
-  //   \r
-  Status = CoreInstallMultipleProtocolInterfaces (\r
-              &mDecompressHandle,\r
-              &gEfiDecompressProtocolGuid,           &gEfiDecompress,\r
-              &gEfiTianoDecompressProtocolGuid,      &gEfiTianoDecompress,\r
-              &gEfiCustomizedDecompressProtocolGuid, &gEfiCustomizedDecompress,\r
-              NULL\r
-              );\r
-  ASSERT_EFI_ERROR (Status);\r
-\r
-  gEfiPeiPeCoffLoader = GetPeCoffLoaderProtocol ();\r
-  ASSERT (gEfiPeiPeCoffLoader != NULL);\r
-\r
-  //\r
-  // Register for the GUIDs of the Architectural Protocols, so the rest of the\r
-  // EFI Boot Services and EFI Runtime Services tables can be filled in.\r
-  //\r
-  CoreNotifyOnArchProtocolInstallation ();\r
-\r
-  //\r
-  // Produce Firmware Volume Protocols, one for each FV in the HOB list.\r
-  //\r
-  Status = FwVolBlockDriverInit (gDxeCoreImageHandle, gST);\r
-  ASSERT_EFI_ERROR (Status);\r
-\r
-  Status = FwVolDriverInit (gDxeCoreImageHandle, gST);\r
-  ASSERT_EFI_ERROR (Status);\r
-\r
-  //\r
-  // Produce the Section Extraction Protocol \r
-  //\r
-  Status = InitializeSectionExtraction (gDxeCoreImageHandle, gST);\r
-  ASSERT_EFI_ERROR (Status);\r
-\r
-  //\r
-  // Initialize the DXE Dispatcher\r
-  //\r
-  PERF_START (0,"CoreInitializeDispatcher", "DxeMain", 0) ;\r
-  CoreInitializeDispatcher ();\r
-  PERF_END (0,"CoreInitializeDispatcher", "DxeMain", 0) ;\r
-\r
-  //\r
-  // Invoke the DXE Dispatcher\r
-  //\r
-  PERF_START (0, "CoreDispatcher", "DxeMain", 0);\r
-  CoreDispatcher ();\r
-  PERF_END (0, "CoreDispatcher", "DxeMain", 0);\r
-\r
-  //\r
-  // Display Architectural protocols that were not loaded if this is DEBUG build\r
-  //\r
-  DEBUG_CODE (\r
-    CoreDisplayMissingArchProtocols ();\r
-  );\r
-  \r
-  //\r
-  // Assert if the Architectural Protocols are not present.\r
-  //\r
-  ASSERT_EFI_ERROR (CoreAllEfiServicesAvailable ());\r
-\r
-  //\r
-  // Report Status code before transfer control to BDS\r
-  //\r
-  CoreReportProgressCode ((EFI_SOFTWARE_DXE_CORE | EFI_SW_DXE_CORE_PC_HANDOFF_TO_NEXT));\r
-  //\r
-  // Display any drivers that were not dispatched because dependency expression\r
-  // evaluated to false if this is a debug build\r
-  //\r
-  DEBUG_CODE (\r
-    CoreDisplayDiscoveredNotDispatched ();\r
-  );\r
-\r
-  //\r
-  // Transfer control to the BDS Architectural Protocol\r
-  //\r
-  gBds->Entry (gBds);\r
-  \r
-  //\r
-  // BDS should never return\r
-  //\r
-  ASSERT (FALSE);\r
-  CpuDeadLoop ();\r
-}\r
-\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-CoreEfiNotAvailableYetArg0 (\r
-  VOID\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Place holder function until all the Boot Services and Runtime Services are available\r
-\r
-Arguments:\r
-\r
-  None\r
-\r
-Returns:\r
-\r
-  EFI_NOT_AVAILABLE_YET\r
-\r
---*/\r
-{\r
-  //\r
-  // This function should never be executed.  If it does, then the architectural protocols\r
-  // have not been designed correctly.  The CpuBreakpoint () is commented out for now until the\r
-  // DXE Core and all the Architectural Protocols are complete.\r
-  //\r
-\r
-  return EFI_NOT_AVAILABLE_YET;\r
-}\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-CoreEfiNotAvailableYetArg1 (\r
-  UINTN Arg1\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Place holder function until all the Boot Services and Runtime Services are available\r
-\r
-Arguments:\r
-\r
-  Arg1        - Undefined\r
-\r
-Returns:\r
-\r
-  EFI_NOT_AVAILABLE_YET\r
-\r
---*/\r
-{\r
-  //\r
-  // This function should never be executed.  If it does, then the architectural protocols\r
-  // have not been designed correctly.  The CpuBreakpoint () is commented out for now until the\r
-  // DXE Core and all the Architectural Protocols are complete.\r
-  //\r
-\r
-  return EFI_NOT_AVAILABLE_YET;\r
-}\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-CoreEfiNotAvailableYetArg2 (\r
-  UINTN Arg1,\r
-  UINTN Arg2\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Place holder function until all the Boot Services and Runtime Services are available\r
-\r
-Arguments:\r
-\r
-  Arg1        - Undefined\r
-  \r
-  Arg2        - Undefined\r
-\r
-Returns:\r
-\r
-  EFI_NOT_AVAILABLE_YET\r
-\r
---*/\r
-{\r
-  //\r
-  // This function should never be executed.  If it does, then the architectural protocols\r
-  // have not been designed correctly.  The CpuBreakpoint () is commented out for now until the\r
-  // DXE Core and all the Architectural Protocols are complete.\r
-  //\r
-\r
-  return EFI_NOT_AVAILABLE_YET;\r
-}\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-CoreEfiNotAvailableYetArg3 (\r
-  UINTN Arg1,\r
-  UINTN Arg2,\r
-  UINTN Arg3\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Place holder function until all the Boot Services and Runtime Services are available\r
-\r
-Arguments:\r
-\r
-  Arg1        - Undefined\r
-  \r
-  Arg2        - Undefined\r
-  \r
-  Arg3        - Undefined\r
-\r
-Returns:\r
-\r
-  EFI_NOT_AVAILABLE_YET\r
-\r
---*/\r
-{\r
-  //\r
-  // This function should never be executed.  If it does, then the architectural protocols\r
-  // have not been designed correctly.  The CpuBreakpoint () is commented out for now until the\r
-  // DXE Core and all the Architectural Protocols are complete.\r
-  //\r
-\r
-  return EFI_NOT_AVAILABLE_YET;\r
-}\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-CoreEfiNotAvailableYetArg4 (\r
-  UINTN Arg1,\r
-  UINTN Arg2,\r
-  UINTN Arg3,\r
-  UINTN Arg4\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Place holder function until all the Boot Services and Runtime Services are available\r
-\r
-Arguments:\r
-\r
-  Arg1        - Undefined\r
-  \r
-  Arg2        - Undefined\r
-  \r
-  Arg3        - Undefined\r
-  \r
-  Arg4        - Undefined\r
-\r
-Returns:\r
-\r
-  EFI_NOT_AVAILABLE_YET\r
-\r
---*/\r
-{\r
-  //\r
-  // This function should never be executed.  If it does, then the architectural protocols\r
-  // have not been designed correctly.  The CpuBreakpoint () is commented out for now until the\r
-  // DXE Core and all the Architectural Protocols are complete.\r
-  //\r
-\r
-  return EFI_NOT_AVAILABLE_YET;\r
-}\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-CoreEfiNotAvailableYetArg5 (\r
-  UINTN Arg1,\r
-  UINTN Arg2,\r
-  UINTN Arg3,\r
-  UINTN Arg4,\r
-  UINTN Arg5\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Place holder function until all the Boot Services and Runtime Services are available\r
-\r
-Arguments:\r
-\r
-  Arg1        - Undefined\r
-  \r
-  Arg2        - Undefined\r
-  \r
-  Arg3        - Undefined\r
-  \r
-  Arg4        - Undefined\r
-  \r
-  Arg5        - Undefined\r
-\r
-Returns:\r
-\r
-  EFI_NOT_AVAILABLE_YET\r
-\r
---*/\r
-{\r
-  //\r
-  // This function should never be executed.  If it does, then the architectural protocols\r
-  // have not been designed correctly.  The CpuBreakpoint () is commented out for now until the\r
-  // DXE Core and all the Architectural Protocols are complete.\r
-  //\r
-\r
-  return EFI_NOT_AVAILABLE_YET;\r
-}\r
-\r
-\r
-EFI_STATUS\r
-CoreGetPeiProtocol (\r
-  IN EFI_GUID  *ProtocolGuid,\r
-  IN VOID      **Interface\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Searches for a Protocol Interface passed from PEI through a HOB\r
-\r
-Arguments:\r
-\r
-  ProtocolGuid - The Protocol GUID to search for in the HOB List\r
-\r
-  Interface    - A pointer to the interface for the Protocol GUID\r
-\r
-Returns:\r
-\r
-  EFI_SUCCESS   - The Protocol GUID was found and its interface is returned in Interface\r
-\r
-  EFI_NOT_FOUND - The Protocol GUID was not found in the HOB List\r
-\r
---*/\r
-{\r
-  EFI_HOB_GUID_TYPE   *GuidHob;\r
-  VOID                *Buffer;\r
-\r
-  GuidHob = GetNextGuidHob (ProtocolGuid, mHobStart);\r
-  if (GuidHob == NULL) {\r
-    return EFI_NOT_FOUND;\r
-  }\r
-  \r
-  Buffer = GET_GUID_HOB_DATA (GuidHob);\r
-  ASSERT (Buffer != NULL);\r
-\r
-  *Interface = (VOID *)(*(UINTN *)(Buffer));\r
-\r
-  return EFI_SUCCESS;\r
-}\r
-\r
-\r
-VOID\r
-CalculateEfiHdrCrc (\r
-  IN  OUT EFI_TABLE_HEADER    *Hdr\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Calcualte the 32-bit CRC in a EFI table using the service provided by the\r
-  gRuntime service.\r
-\r
-Arguments:\r
-\r
-  Hdr  - Pointer to an EFI standard header\r
-\r
-Returns:\r
-\r
-  None\r
-\r
---*/\r
-{\r
-  UINT32 Crc;\r
-\r
-  Hdr->CRC32 = 0;\r
-  \r
-  //\r
-  // If gBS->CalculateCrce32 () == CoreEfiNotAvailableYet () then\r
-  //  Crc will come back as zero if we set it to zero here\r
-  //\r
-  Crc = 0;\r
-  gBS->CalculateCrc32 ((UINT8 *)Hdr, Hdr->HeaderSize, &Crc);\r
-  Hdr->CRC32 = Crc; \r
-}\r
-\r
-\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-CoreExitBootServices (\r
-  IN EFI_HANDLE   ImageHandle,\r
-  IN UINTN        MapKey\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  EFI 1.0 API to terminate Boot Services\r
-\r
-Arguments:\r
-\r
-  ImageHandle  - Handle that represents the identity of the calling image\r
-\r
-  MapKey -Key to the latest memory map.\r
-\r
-Returns:\r
-\r
-  EFI_SUCCESS - Boot Services terminated\r
-  EFI_INVALID_PARAMETER - MapKey is incorrect.\r
-\r
---*/\r
-{\r
-  EFI_STATUS    Status;\r
-\r
-  //\r
-  // Terminate memory services if the MapKey matches\r
-  //\r
-  Status = CoreTerminateMemoryMap (MapKey);\r
-  if (EFI_ERROR (Status)) {\r
-    return Status;\r
-  }\r
-\r
-  //\r
-  // Notify other drivers that we are exiting boot services.\r
-  //\r
-  CoreNotifySignalList (&gEfiEventExitBootServicesGuid);\r
-\r
-  //\r
-  // Disable Timer\r
-  //\r
-  gTimer->SetTimerPeriod (gTimer, 0);\r
-\r
-  //\r
-  // Disable CPU Interrupts\r
-  //\r
-  gCpu->DisableInterrupt (gCpu);\r
-\r
-  //\r
-  // Register Runtime events with the Runtime Architectural Protocol\r
-  //\r
-  CoreShutdownEventServices ();\r
-\r
-  //\r
-  // Register Runtime images with the Runtime Architectural Protocol\r
-  //\r
-  CoreShutdownImageServices ();\r
-\r
-  //\r
-  // Report that ExitBootServices() has been called\r
-  //\r
-  // We are using gEfiDxeServicesTableGuid as the caller ID for Dxe Core\r
-  //\r
-  CoreReportProgressCode ((EFI_SOFTWARE_EFI_BOOT_SERVICE | EFI_SW_BS_PC_EXIT_BOOT_SERVICES));\r
-\r
-  //\r
-  // Clear the non-runtime values of the EFI System Table\r
-  //\r
-  gST->BootServices        = NULL;\r
-  gST->ConIn               = NULL;\r
-  gST->ConsoleInHandle     = NULL;\r
-  gST->ConOut              = NULL;\r
-  gST->ConsoleOutHandle    = NULL;\r
-  gST->StdErr              = NULL;\r
-  gST->StandardErrorHandle = NULL;\r
-\r
-  //\r
-  // Recompute the 32-bit CRC of the EFI System Table\r
-  //\r
-  CalculateEfiHdrCrc (&gST->Hdr);\r
-\r
-  //\r
-  // Zero out the Boot Service Table\r
-  //\r
-  SetMem (gBS, sizeof (EFI_BOOT_SERVICES), 0);\r
-  gBS = NULL;\r
-\r
-  return Status;\r
-}\r
-\r
-EFI_STATUS\r
-DxeMainUefiDecompressGetInfo (\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
-  return UefiDecompressGetInfo (Source, SourceSize, DestinationSize, ScratchSize);\r
-}\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-DxeMainUefiDecompress (\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
-  EFI_STATUS  Status;\r
-  UINT32      TestDestinationSize;\r
-  UINT32      TestScratchSize;\r
-\r
-  Status = UefiDecompressGetInfo (Source, SourceSize, &TestDestinationSize, &TestScratchSize);\r
-  if (EFI_ERROR (Status)) {\r
-    return Status;\r
-  }\r
-\r
-  if (ScratchSize < TestScratchSize || DestinationSize < TestDestinationSize) {\r
-    return RETURN_INVALID_PARAMETER;\r
-  }\r
-\r
-  return UefiDecompress (Source, Destination, Scratch);\r
-}\r
-\r
-EFI_STATUS\r
-DxeMainTianoDecompressGetInfo (\r
-  IN EFI_TIANO_DECOMPRESS_PROTOCOL      *This,\r
-  IN   VOID                             *Source,\r
-  IN   UINT32                           SourceSize,\r
-  OUT  UINT32                           *DestinationSize,\r
-  OUT  UINT32                           *ScratchSize\r
-  )\r
-{\r
-  return TianoDecompressGetInfo (Source, SourceSize, DestinationSize, ScratchSize);\r
-}\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-DxeMainTianoDecompress (\r
-  IN EFI_TIANO_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
-  EFI_STATUS  Status;\r
-  UINT32      TestDestinationSize;\r
-  UINT32      TestScratchSize;\r
-\r
-  Status = TianoDecompressGetInfo (Source, SourceSize, &TestDestinationSize, &TestScratchSize);\r
-  if (EFI_ERROR (Status)) {\r
-    return Status;\r
-  }\r
-\r
-  if (ScratchSize < TestScratchSize || DestinationSize < TestDestinationSize) {\r
-    return RETURN_INVALID_PARAMETER;\r
-  }\r
-\r
-  return TianoDecompress (Source, Destination, Scratch);\r
-}\r
-\r
-EFI_STATUS\r
-DxeMainCustomDecompressGetInfo (\r
-  IN EFI_CUSTOMIZED_DECOMPRESS_PROTOCOL  *This,\r
-  IN   VOID                              *Source,\r
-  IN   UINT32                            SourceSize,\r
-  OUT  UINT32                            *DestinationSize,\r
-  OUT  UINT32                            *ScratchSize\r
-  )\r
-{\r
-  return CustomDecompressGetInfo (Source, SourceSize, DestinationSize, ScratchSize);\r
-}\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-DxeMainCustomDecompress (\r
-  IN EFI_CUSTOMIZED_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
-  EFI_STATUS  Status;\r
-  UINT32      TestDestinationSize;\r
-  UINT32      TestScratchSize;\r
-\r
-  Status = CustomDecompressGetInfo (Source, SourceSize, &TestDestinationSize, &TestScratchSize);\r
-  if (EFI_ERROR (Status)) {\r
-    return Status;\r
-  }\r
-\r
-  if (ScratchSize < TestScratchSize || DestinationSize < TestDestinationSize) {\r
-    return RETURN_INVALID_PARAMETER;\r
-  }\r
-\r
-  return CustomDecompress (Source, Destination, Scratch);\r
-}\r
-\r
+/*++
+
+Copyright (c) 2006, Intel Corporation                                                         
+All rights reserved. This program and the accompanying materials                          
+are licensed and made available under the terms and conditions of the BSD License         
+which accompanies this distribution.  The full text of the license may be found at        
+http://opensource.org/licenses/bsd-license.php                                            
+                                                                                          
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             
+
+Module Name:
+
+  DxeMain.c
+
+Abstract:
+
+  DXE Core Main Entry Point
+
+--*/
+
+#include <DxeMain.h>
+
+VOID
+EFIAPI
+DxeMain (
+  IN  VOID *HobStart
+  );
+
+EFI_STATUS
+EFIAPI
+CoreEfiNotAvailableYetArg0 (
+  VOID
+  );
+
+EFI_STATUS
+EFIAPI
+CoreEfiNotAvailableYetArg1 (
+  UINTN Arg1
+  );
+
+EFI_STATUS
+EFIAPI
+CoreEfiNotAvailableYetArg2 (
+  UINTN Arg1,
+  UINTN Arg2
+  );
+
+EFI_STATUS
+EFIAPI
+CoreEfiNotAvailableYetArg3 (
+  UINTN Arg1,
+  UINTN Arg2,
+  UINTN Arg3
+  );
+
+EFI_STATUS
+EFIAPI
+CoreEfiNotAvailableYetArg4 (
+  UINTN Arg1,
+  UINTN Arg2,
+  UINTN Arg3,
+  UINTN Arg4
+  );
+
+EFI_STATUS
+EFIAPI
+CoreEfiNotAvailableYetArg5 (
+  UINTN Arg1,
+  UINTN Arg2,
+  UINTN Arg3,
+  UINTN Arg4,
+  UINTN Arg5
+  );
+
+EFI_STATUS
+CoreGetPeiProtocol (
+  IN EFI_GUID  *ProtocolGuid,
+  IN VOID      **Interface
+  );
+  
+EFI_STATUS
+DxeMainUefiDecompressGetInfo (
+  IN EFI_DECOMPRESS_PROTOCOL            *This,
+  IN   VOID                             *Source,
+  IN   UINT32                           SourceSize,
+  OUT  UINT32                           *DestinationSize,
+  OUT  UINT32                           *ScratchSize
+  );
+
+EFI_STATUS
+EFIAPI
+DxeMainUefiDecompress (
+  IN EFI_DECOMPRESS_PROTOCOL              *This,
+  IN     VOID                             *Source,
+  IN     UINT32                           SourceSize,
+  IN OUT VOID                             *Destination,
+  IN     UINT32                           DestinationSize,
+  IN OUT VOID                             *Scratch,
+  IN     UINT32                           ScratchSize
+  );
+
+EFI_STATUS
+DxeMainTianoDecompressGetInfo (
+  IN EFI_TIANO_DECOMPRESS_PROTOCOL      *This,
+  IN   VOID                             *Source,
+  IN   UINT32                           SourceSize,
+  OUT  UINT32                           *DestinationSize,
+  OUT  UINT32                           *ScratchSize
+  );
+
+EFI_STATUS
+EFIAPI
+DxeMainTianoDecompress (
+  IN EFI_TIANO_DECOMPRESS_PROTOCOL        *This,
+  IN     VOID                             *Source,
+  IN     UINT32                           SourceSize,
+  IN OUT VOID                             *Destination,
+  IN     UINT32                           DestinationSize,
+  IN OUT VOID                             *Scratch,
+  IN     UINT32                           ScratchSize
+  );
+
+EFI_STATUS
+DxeMainCustomDecompressGetInfo (
+  IN EFI_CUSTOMIZED_DECOMPRESS_PROTOCOL  *This,
+  IN   VOID                              *Source,
+  IN   UINT32                            SourceSize,
+  OUT  UINT32                            *DestinationSize,
+  OUT  UINT32                            *ScratchSize
+  );
+
+EFI_STATUS
+EFIAPI
+DxeMainCustomDecompress (
+  IN EFI_CUSTOMIZED_DECOMPRESS_PROTOCOL  *This,
+  IN     VOID                            *Source,
+  IN     UINT32                          SourceSize,
+  IN OUT VOID                            *Destination,
+  IN     UINT32                          DestinationSize,
+  IN OUT VOID                            *Scratch,
+  IN     UINT32                          ScratchSize
+  );
+
+//
+// DXE Core Global Variables for Protocols from PEI
+//
+EFI_HANDLE                                mDecompressHandle = NULL;
+EFI_PEI_PE_COFF_LOADER_PROTOCOL           *gEfiPeiPeCoffLoader          = NULL;
+
+//
+// DXE Core globals for Architecture Protocols
+//
+EFI_SECURITY_ARCH_PROTOCOL        *gSecurity      = NULL;
+EFI_CPU_ARCH_PROTOCOL             *gCpu           = NULL;
+EFI_METRONOME_ARCH_PROTOCOL       *gMetronome     = NULL;
+EFI_TIMER_ARCH_PROTOCOL           *gTimer         = NULL;
+EFI_BDS_ARCH_PROTOCOL             *gBds           = NULL;
+EFI_WATCHDOG_TIMER_ARCH_PROTOCOL  *gWatchdogTimer = NULL;
+EFI_RUNTIME_ARCH_PROTOCOL         *gRuntime       = NULL;
+
+//
+// BugBug: I'n not runtime, but is the PPI?
+//
+EFI_STATUS_CODE_PROTOCOL     gStatusCodeInstance = {
+  NULL
+};
+
+EFI_STATUS_CODE_PROTOCOL     *gStatusCode    = &gStatusCodeInstance;
+
+
+//
+// DXE Core Global used to update core loaded image protocol handle
+//
+EFI_GUID                           *gDxeCoreFileName;
+EFI_LOADED_IMAGE_PROTOCOL          *gDxeCoreLoadedImage;
+
+
+
+//
+// DXE Core Module Variables
+//
+
+EFI_BOOT_SERVICES mBootServices = {
+  {
+    EFI_BOOT_SERVICES_SIGNATURE,                                                          // Signature
+    EFI_BOOT_SERVICES_REVISION,                                                           // Revision
+    sizeof (EFI_BOOT_SERVICES),                                                           // HeaderSize
+    0,                                                                                    // CRC32
+    0                                                                                     // Reserved
+  },                                                                                      
+  (EFI_RAISE_TPL)                               CoreRaiseTpl,                             // RaiseTPL
+  (EFI_RESTORE_TPL)                             CoreRestoreTpl,                           // RestoreTPL
+  (EFI_ALLOCATE_PAGES)                          CoreAllocatePages,                        // AllocatePages
+  (EFI_FREE_PAGES)                              CoreFreePages,                            // FreePages
+  (EFI_GET_MEMORY_MAP)                          CoreGetMemoryMap,                         // GetMemoryMap
+  (EFI_ALLOCATE_POOL)                           CoreAllocatePool,                         // AllocatePool
+  (EFI_FREE_POOL)                               CoreFreePool,                             // FreePool
+  (EFI_CREATE_EVENT)                            CoreCreateEvent,                          // CreateEvent
+  (EFI_SET_TIMER)                               CoreSetTimer,                             // SetTimer
+  (EFI_WAIT_FOR_EVENT)                          CoreWaitForEvent,                         // WaitForEvent
+  (EFI_SIGNAL_EVENT)                            CoreSignalEvent,                          // SignalEvent
+  (EFI_CLOSE_EVENT)                             CoreCloseEvent,                           // CloseEvent
+  (EFI_CHECK_EVENT)                             CoreCheckEvent,                           // CheckEvent
+  (EFI_INSTALL_PROTOCOL_INTERFACE)              CoreInstallProtocolInterface,             // InstallProtocolInterface
+  (EFI_REINSTALL_PROTOCOL_INTERFACE)            CoreReinstallProtocolInterface,           // ReinstallProtocolInterface
+  (EFI_UNINSTALL_PROTOCOL_INTERFACE)            CoreUninstallProtocolInterface,           // UninstallProtocolInterface
+  (EFI_HANDLE_PROTOCOL)                         CoreHandleProtocol,                       // HandleProtocol
+  (VOID *)                                      NULL,                                     // Reserved
+  (EFI_REGISTER_PROTOCOL_NOTIFY)                CoreRegisterProtocolNotify,               // RegisterProtocolNotify
+  (EFI_LOCATE_HANDLE)                           CoreLocateHandle,                         // LocateHandle
+  (EFI_LOCATE_DEVICE_PATH)                      CoreLocateDevicePath,                     // LocateDevicePath
+  (EFI_INSTALL_CONFIGURATION_TABLE)             CoreInstallConfigurationTable,            // InstallConfigurationTable
+  (EFI_IMAGE_LOAD)                              CoreLoadImage,                            // LoadImage
+  (EFI_IMAGE_START)                             CoreStartImage,                           // StartImage
+  (EFI_EXIT)                                    CoreExit,                                 // Exit
+  (EFI_IMAGE_UNLOAD)                            CoreUnloadImage,                          // UnloadImage
+  (EFI_EXIT_BOOT_SERVICES)                      CoreExitBootServices,                     // ExitBootServices
+  (EFI_GET_NEXT_MONOTONIC_COUNT)                CoreEfiNotAvailableYetArg1,               // GetNextMonotonicCount
+  (EFI_STALL)                                   CoreStall,                                // Stall
+  (EFI_SET_WATCHDOG_TIMER)                      CoreSetWatchdogTimer,                     // SetWatchdogTimer
+  (EFI_CONNECT_CONTROLLER)                      CoreConnectController,                    // ConnectController
+  (EFI_DISCONNECT_CONTROLLER)                   CoreDisconnectController,                 // DisconnectController
+  (EFI_OPEN_PROTOCOL)                           CoreOpenProtocol,                         // OpenProtocol
+  (EFI_CLOSE_PROTOCOL)                          CoreCloseProtocol,                        // CloseProtocol
+  (EFI_OPEN_PROTOCOL_INFORMATION)               CoreOpenProtocolInformation,              // OpenProtocolInformation
+  (EFI_PROTOCOLS_PER_HANDLE)                    CoreProtocolsPerHandle,                   // ProtocolsPerHandle
+  (EFI_LOCATE_HANDLE_BUFFER)                    CoreLocateHandleBuffer,                   // LocateHandleBuffer
+  (EFI_LOCATE_PROTOCOL)                         CoreLocateProtocol,                       // LocateProtocol
+  (EFI_INSTALL_MULTIPLE_PROTOCOL_INTERFACES)    CoreInstallMultipleProtocolInterfaces,    // InstallMultipleProtocolInterfaces
+  (EFI_UNINSTALL_MULTIPLE_PROTOCOL_INTERFACES)  CoreUninstallMultipleProtocolInterfaces,  // UninstallMultipleProtocolInterfaces
+  (EFI_CALCULATE_CRC32)                         CoreEfiNotAvailableYetArg3,               // CalculateCrc32
+  (EFI_COPY_MEM)                                CopyMem,                                  // CopyMem
+  (EFI_SET_MEM)                                 SetMem                                    // SetMem
+#if (EFI_SPECIFICATION_VERSION >= 0x00020000)
+  ,                                   
+  (EFI_CREATE_EVENT_EX)                          CoreCreateEventEx                         // CreateEventEx
+#endif
+};
+
+EFI_DXE_SERVICES mDxeServices = {
+  {
+    EFI_DXE_SERVICES_SIGNATURE,                                           // Signature
+    EFI_DXE_SERVICES_REVISION,                                            // Revision
+    sizeof (EFI_DXE_SERVICES),                                            // HeaderSize
+    0,                                                                    // CRC32
+    0                                                                     // Reserved
+  },
+  (EFI_ADD_MEMORY_SPACE)             CoreAddMemorySpace,                  // AddMemorySpace
+  (EFI_ALLOCATE_MEMORY_SPACE)        CoreAllocateMemorySpace,             // AllocateMemorySpace
+  (EFI_FREE_MEMORY_SPACE)            CoreFreeMemorySpace,                 // FreeMemorySpace
+  (EFI_REMOVE_MEMORY_SPACE)          CoreRemoveMemorySpace,               // RemoveMemorySpace
+  (EFI_GET_MEMORY_SPACE_DESCRIPTOR)  CoreGetMemorySpaceDescriptor,        // GetMemorySpaceDescriptor
+  (EFI_SET_MEMORY_SPACE_ATTRIBUTES)  CoreSetMemorySpaceAttributes,        // SetMemorySpaceAttributes
+  (EFI_GET_MEMORY_SPACE_MAP)         CoreGetMemorySpaceMap,               // GetMemorySpaceMap
+  (EFI_ADD_IO_SPACE)                 CoreAddIoSpace,                      // AddIoSpace
+  (EFI_ALLOCATE_IO_SPACE)            CoreAllocateIoSpace,                 // AllocateIoSpace
+  (EFI_FREE_IO_SPACE)                CoreFreeIoSpace,                     // FreeIoSpace
+  (EFI_REMOVE_IO_SPACE)              CoreRemoveIoSpace,                   // RemoveIoSpace
+  (EFI_GET_IO_SPACE_DESCRIPTOR)      CoreGetIoSpaceDescriptor,            // GetIoSpaceDescriptor
+  (EFI_GET_IO_SPACE_MAP)             CoreGetIoSpaceMap,                   // GetIoSpaceMap
+  (EFI_DISPATCH)                     CoreDispatcher,                      // Dispatch
+  (EFI_SCHEDULE)                     CoreSchedule,                        // Schedule
+  (EFI_TRUST)                        CoreTrust,                           // Trust
+  (EFI_PROCESS_FIRMWARE_VOLUME)      CoreProcessFirmwareVolume,           // ProcessFirmwareVolume
+};
+
+EFI_SYSTEM_TABLE mEfiSystemTableTemplate = {
+  {
+    EFI_SYSTEM_TABLE_SIGNATURE,                                           // Signature
+    EFI_SYSTEM_TABLE_REVISION,                                            // Revision
+    sizeof (EFI_SYSTEM_TABLE),                                            // HeaderSize
+    0,                                                                    // CRC32
+    0                                                                     // Reserved
+  },
+  NULL,                                                                   // FirmwareVendor
+  0,                                                                      // FirmwareRevision
+  NULL,                                                                   // ConsoleInHandle
+  NULL,                                                                   // ConIn
+  NULL,                                                                   // ConsoleOutHandle
+  NULL,                                                                   // ConOut
+  NULL,                                                                   // StandardErrorHandle
+  NULL,                                                                   // StdErr
+  NULL,                                                                   // RuntimeServices
+  &mBootServices,                                                         // BootServices
+  0,                                                                      // NumberOfConfigurationTableEntries
+  NULL                                                                    // ConfigurationTable
+};
+
+EFI_RUNTIME_SERVICES mEfiRuntimeServicesTableTemplate = {
+  {
+    EFI_RUNTIME_SERVICES_SIGNATURE,                               // Signature
+    EFI_RUNTIME_SERVICES_REVISION,                                // Revision
+    sizeof (EFI_RUNTIME_SERVICES),                                // HeaderSize
+    0,                                                            // CRC32
+    0                                                             // Reserved
+  },
+  (EFI_GET_TIME)                 CoreEfiNotAvailableYetArg2,      // GetTime
+  (EFI_SET_TIME)                 CoreEfiNotAvailableYetArg1,      // SetTime
+  (EFI_GET_WAKEUP_TIME)          CoreEfiNotAvailableYetArg3,      // GetWakeupTime
+  (EFI_SET_WAKEUP_TIME)          CoreEfiNotAvailableYetArg2,      // SetWakeupTime
+  (EFI_SET_VIRTUAL_ADDRESS_MAP)  CoreEfiNotAvailableYetArg4,      // SetVirtualAddressMap
+  (EFI_CONVERT_POINTER)          CoreEfiNotAvailableYetArg2,      // ConvertPointer
+  (EFI_GET_VARIABLE)             CoreEfiNotAvailableYetArg5,      // GetVariable
+  (EFI_GET_NEXT_VARIABLE_NAME)   CoreEfiNotAvailableYetArg3,      // GetNextVariableName
+  (EFI_SET_VARIABLE)             CoreEfiNotAvailableYetArg5,      // SetVariable
+  (EFI_GET_NEXT_HIGH_MONO_COUNT) CoreEfiNotAvailableYetArg1,      // GetNextHighMonotonicCount
+  (EFI_RESET_SYSTEM)             CoreEfiNotAvailableYetArg4       // ResetSystem 
+#if ((EDK_RELEASE_VERSION != 0) && (EFI_SPECIFICATION_VERSION <  0x00020000))
+  ,
+  (TIANO_REPORT_STATUS_CODE)       CoreEfiNotAvailableYetArg5     // ReportStatusCode
+#elif (EFI_SPECIFICATION_VERSION >= 0x00020000)
+  ,
+  (EFI_UPDATE_CAPSULE)              CoreEfiNotAvailableYetArg3,   // UpdateCapsule
+  (EFI_QUERY_CAPSULE_CAPABILITIES)  CoreEfiNotAvailableYetArg4,   // QueryCapsuleCapabilities
+  (EFI_QUERY_VARIABLE_INFO)         CoreEfiNotAvailableYetArg4    // QueryVariableInfo
+#endif
+};
+
+//
+// DXE Core Global Variables for the EFI System Table, Boot Services Table, 
+// DXE Services Table, and Runtime Services Table
+//
+EFI_BOOT_SERVICES     *gBS = &mBootServices;
+EFI_DXE_SERVICES      *gDS = &mDxeServices;
+EFI_SYSTEM_TABLE      *gST = NULL;
+
+//
+// For debug initialize gRT to template. gRT must be allocated from RT memory
+//  but gRT is used for ASSERT () and DEBUG () type macros so lets give it
+//  a value that will not cause debug infrastructure to crash early on.
+//
+EFI_RUNTIME_SERVICES  *gRT = &mEfiRuntimeServicesTableTemplate;
+EFI_HANDLE            gDxeCoreImageHandle = NULL;
+
+VOID  *mHobStart;
+
+//
+// EFI Decompress Protocol
+//
+EFI_DECOMPRESS_PROTOCOL  gEfiDecompress = {
+  DxeMainUefiDecompressGetInfo,
+  DxeMainUefiDecompress
+};
+
+//
+// Tiano Decompress Protocol
+//
+EFI_TIANO_DECOMPRESS_PROTOCOL  gEfiTianoDecompress = {
+  DxeMainTianoDecompressGetInfo,
+  DxeMainTianoDecompress
+};
+
+//
+// Customized Decompress Protocol
+//
+EFI_CUSTOMIZED_DECOMPRESS_PROTOCOL  gEfiCustomizedDecompress = {
+  DxeMainCustomDecompressGetInfo,
+  DxeMainCustomDecompress
+};
+
+//
+// Main entry point to the DXE Core
+//
+VOID
+EFIAPI
+DxeMain (
+  IN  VOID *HobStart
+  )
+/*++
+
+Routine Description:
+
+  Main entry point to DXE Core.
+
+Arguments:
+
+  HobStart - Pointer to the beginning of the HOB List from PEI
+
+Returns:
+
+  This function should never return
+
+--*/
+{
+  EFI_STATUS                         Status;
+  EFI_PHYSICAL_ADDRESS               MemoryBaseAddress;
+  UINT64                             MemoryLength;
+
+#ifdef EFI_DXE_PERFORMANCE
+  UINT64                             Tick;
+
+  GetTimerValue (&Tick);
+#endif
+
+  mHobStart = HobStart;
+
+  //
+  // Initialize Memory Services
+  //
+  CoreInitializeMemoryServices (&HobStart, &MemoryBaseAddress, &MemoryLength);
+
+  //
+  // Allocate the EFI System Table and EFI Runtime Service Table from EfiRuntimeServicesData
+  // Use the templates to initialize the contents of the EFI System Table and EFI Runtime Services Table
+  //
+  gST = CoreAllocateRuntimeCopyPool (sizeof (EFI_SYSTEM_TABLE), &mEfiSystemTableTemplate);
+  ASSERT (gST != NULL);
+
+  gRT = CoreAllocateRuntimeCopyPool (sizeof (EFI_RUNTIME_SERVICES), &mEfiRuntimeServicesTableTemplate);
+  ASSERT (gRT != NULL);
+
+  gST->RuntimeServices = gRT;
+  
+  //
+  // Start the Image Services.
+  //
+  Status = CoreInitializeImageServices (HobStart);
+  ASSERT_EFI_ERROR (Status);
+
+  //
+  // Call constructor for all libraries
+  //
+  ProcessLibraryConstructorList (gDxeCoreImageHandle, gST);
+
+  //
+  // Initialize the Global Coherency Domain Services
+  //
+  Status = CoreInitializeGcdServices (&HobStart, MemoryBaseAddress, MemoryLength);
+  ASSERT_EFI_ERROR (Status);
+
+  //
+  // Install the DXE Services Table into the EFI System Tables's Configuration Table
+  //
+  Status = CoreInstallConfigurationTable (&gEfiDxeServicesTableGuid, gDS);
+  ASSERT_EFI_ERROR (Status);
+
+  //
+  // Install the HOB List into the EFI System Tables's Configuration Table
+  //
+  Status = CoreInstallConfigurationTable (&gEfiHobListGuid, HobStart);
+  ASSERT_EFI_ERROR (Status);
+
+  //
+  // Install Memory Type Information Table into the EFI System Tables's Configuration Table
+  //
+  Status = CoreInstallConfigurationTable (&gEfiMemoryTypeInformationGuid, &gMemoryTypeInformation);
+  ASSERT_EFI_ERROR (Status);
+
+  //
+  // Initialize the ReportStatusCode with PEI version, if availible
+  //
+  CoreGetPeiProtocol (&gEfiStatusCodeRuntimeProtocolGuid, (VOID **)&gStatusCode->ReportStatusCode);
+#if ((EDK_RELEASE_VERSION != 0) && (EFI_SPECIFICATION_VERSION < 0x00020000))
+  gRT->ReportStatusCode = gStatusCode->ReportStatusCode;
+#endif
+
+  //
+  // Report Status Code here for DXE_ENTRY_POINT once it is available
+  //
+  CoreReportProgressCode ((EFI_SOFTWARE_DXE_CORE | EFI_SW_DXE_CORE_PC_ENTRY_POINT));
+
+  //
+  // Create the aligned system table pointer structure that is used by external
+  // debuggers to locate the system table...  Also, install debug image info
+  // configuration table.
+  //
+  CoreInitializeDebugImageInfoTable ();
+  CoreNewDebugImageInfoEntry (
+    EFI_DEBUG_IMAGE_INFO_TYPE_NORMAL,
+    gDxeCoreLoadedImage,
+    gDxeCoreImageHandle
+    );
+
+  DEBUG ((EFI_D_INFO | EFI_D_LOAD, "HOBLIST address in DXE = 0x%08x\n", HobStart));
+
+  //
+  // Initialize the Event Services
+  //
+  Status = CoreInitializeEventServices ();
+  ASSERT_EFI_ERROR (Status);
+
+   
+  //
+  // Get the Protocols that were passed in from PEI to DXE through GUIDed HOBs
+  //
+  // These Protocols are not architectural. This implementation is sharing code between 
+  // PEI and DXE in order to save FLASH space. These Protocols could also be implemented 
+  // as part of the DXE Core. However, that would also require the DXE Core to be ported 
+  // each time a different CPU is used, a different Decompression algorithm is used, or a 
+  // different Image type is used. By placing these Protocols in PEI, the DXE Core remains 
+  // generic, and only PEI and the Arch Protocols need to be ported from Platform to Platform, 
+  // and from CPU to CPU.
+  //
+
+  //
+  // Publish the EFI, Tiano, and Custom Decompress protocols for use by other DXE components
+  //   
+  Status = CoreInstallMultipleProtocolInterfaces (
+              &mDecompressHandle,
+              &gEfiDecompressProtocolGuid,           &gEfiDecompress,
+              &gEfiTianoDecompressProtocolGuid,      &gEfiTianoDecompress,
+              &gEfiCustomizedDecompressProtocolGuid, &gEfiCustomizedDecompress,
+              NULL
+              );
+  ASSERT_EFI_ERROR (Status);
+
+  gEfiPeiPeCoffLoader = GetPeCoffLoaderProtocol ();
+  ASSERT (gEfiPeiPeCoffLoader != NULL);
+
+  //
+  // Register for the GUIDs of the Architectural Protocols, so the rest of the
+  // EFI Boot Services and EFI Runtime Services tables can be filled in.
+  //
+  CoreNotifyOnArchProtocolInstallation ();
+
+  //
+  // Produce Firmware Volume Protocols, one for each FV in the HOB list.
+  //
+  Status = FwVolBlockDriverInit (gDxeCoreImageHandle, gST);
+  ASSERT_EFI_ERROR (Status);
+
+  Status = FwVolDriverInit (gDxeCoreImageHandle, gST);
+  ASSERT_EFI_ERROR (Status);
+
+  //
+  // Produce the Section Extraction Protocol 
+  //
+  Status = InitializeSectionExtraction (gDxeCoreImageHandle, gST);
+  ASSERT_EFI_ERROR (Status);
+
+  //
+  // Initialize the DXE Dispatcher
+  //
+  PERF_START (0,"CoreInitializeDispatcher", "DxeMain", 0) ;
+  CoreInitializeDispatcher ();
+  PERF_END (0,"CoreInitializeDispatcher", "DxeMain", 0) ;
+
+  //
+  // Invoke the DXE Dispatcher
+  //
+  PERF_START (0, "CoreDispatcher", "DxeMain", 0);
+  CoreDispatcher ();
+  PERF_END (0, "CoreDispatcher", "DxeMain", 0);
+
+  //
+  // Display Architectural protocols that were not loaded if this is DEBUG build
+  //
+  DEBUG_CODE (
+    CoreDisplayMissingArchProtocols ();
+  );
+  
+  //
+  // Assert if the Architectural Protocols are not present.
+  //
+  ASSERT_EFI_ERROR (CoreAllEfiServicesAvailable ());
+
+  //
+  // Report Status code before transfer control to BDS
+  //
+  CoreReportProgressCode ((EFI_SOFTWARE_DXE_CORE | EFI_SW_DXE_CORE_PC_HANDOFF_TO_NEXT));
+  //
+  // Display any drivers that were not dispatched because dependency expression
+  // evaluated to false if this is a debug build
+  //
+  DEBUG_CODE (
+    CoreDisplayDiscoveredNotDispatched ();
+  );
+
+  //
+  // Transfer control to the BDS Architectural Protocol
+  //
+  gBds->Entry (gBds);
+  
+  //
+  // BDS should never return
+  //
+  ASSERT (FALSE);
+  CpuDeadLoop ();
+}
+
+
+EFI_STATUS
+EFIAPI
+CoreEfiNotAvailableYetArg0 (
+  VOID
+  )
+/*++
+
+Routine Description:
+
+  Place holder function until all the Boot Services and Runtime Services are available
+
+Arguments:
+
+  None
+
+Returns:
+
+  EFI_NOT_AVAILABLE_YET
+
+--*/
+{
+  //
+  // This function should never be executed.  If it does, then the architectural protocols
+  // have not been designed correctly.  The CpuBreakpoint () is commented out for now until the
+  // DXE Core and all the Architectural Protocols are complete.
+  //
+
+  return EFI_NOT_AVAILABLE_YET;
+}
+
+EFI_STATUS
+EFIAPI
+CoreEfiNotAvailableYetArg1 (
+  UINTN Arg1
+  )
+/*++
+
+Routine Description:
+
+  Place holder function until all the Boot Services and Runtime Services are available
+
+Arguments:
+
+  Arg1        - Undefined
+
+Returns:
+
+  EFI_NOT_AVAILABLE_YET
+
+--*/
+{
+  //
+  // This function should never be executed.  If it does, then the architectural protocols
+  // have not been designed correctly.  The CpuBreakpoint () is commented out for now until the
+  // DXE Core and all the Architectural Protocols are complete.
+  //
+
+  return EFI_NOT_AVAILABLE_YET;
+}
+
+EFI_STATUS
+EFIAPI
+CoreEfiNotAvailableYetArg2 (
+  UINTN Arg1,
+  UINTN Arg2
+  )
+/*++
+
+Routine Description:
+
+  Place holder function until all the Boot Services and Runtime Services are available
+
+Arguments:
+
+  Arg1        - Undefined
+  
+  Arg2        - Undefined
+
+Returns:
+
+  EFI_NOT_AVAILABLE_YET
+
+--*/
+{
+  //
+  // This function should never be executed.  If it does, then the architectural protocols
+  // have not been designed correctly.  The CpuBreakpoint () is commented out for now until the
+  // DXE Core and all the Architectural Protocols are complete.
+  //
+
+  return EFI_NOT_AVAILABLE_YET;
+}
+
+EFI_STATUS
+EFIAPI
+CoreEfiNotAvailableYetArg3 (
+  UINTN Arg1,
+  UINTN Arg2,
+  UINTN Arg3
+  )
+/*++
+
+Routine Description:
+
+  Place holder function until all the Boot Services and Runtime Services are available
+
+Arguments:
+
+  Arg1        - Undefined
+  
+  Arg2        - Undefined
+  
+  Arg3        - Undefined
+
+Returns:
+
+  EFI_NOT_AVAILABLE_YET
+
+--*/
+{
+  //
+  // This function should never be executed.  If it does, then the architectural protocols
+  // have not been designed correctly.  The CpuBreakpoint () is commented out for now until the
+  // DXE Core and all the Architectural Protocols are complete.
+  //
+
+  return EFI_NOT_AVAILABLE_YET;
+}
+
+EFI_STATUS
+EFIAPI
+CoreEfiNotAvailableYetArg4 (
+  UINTN Arg1,
+  UINTN Arg2,
+  UINTN Arg3,
+  UINTN Arg4
+  )
+/*++
+
+Routine Description:
+
+  Place holder function until all the Boot Services and Runtime Services are available
+
+Arguments:
+
+  Arg1        - Undefined
+  
+  Arg2        - Undefined
+  
+  Arg3        - Undefined
+  
+  Arg4        - Undefined
+
+Returns:
+
+  EFI_NOT_AVAILABLE_YET
+
+--*/
+{
+  //
+  // This function should never be executed.  If it does, then the architectural protocols
+  // have not been designed correctly.  The CpuBreakpoint () is commented out for now until the
+  // DXE Core and all the Architectural Protocols are complete.
+  //
+
+  return EFI_NOT_AVAILABLE_YET;
+}
+
+EFI_STATUS
+EFIAPI
+CoreEfiNotAvailableYetArg5 (
+  UINTN Arg1,
+  UINTN Arg2,
+  UINTN Arg3,
+  UINTN Arg4,
+  UINTN Arg5
+  )
+/*++
+
+Routine Description:
+
+  Place holder function until all the Boot Services and Runtime Services are available
+
+Arguments:
+
+  Arg1        - Undefined
+  
+  Arg2        - Undefined
+  
+  Arg3        - Undefined
+  
+  Arg4        - Undefined
+  
+  Arg5        - Undefined
+
+Returns:
+
+  EFI_NOT_AVAILABLE_YET
+
+--*/
+{
+  //
+  // This function should never be executed.  If it does, then the architectural protocols
+  // have not been designed correctly.  The CpuBreakpoint () is commented out for now until the
+  // DXE Core and all the Architectural Protocols are complete.
+  //
+
+  return EFI_NOT_AVAILABLE_YET;
+}
+
+
+EFI_STATUS
+CoreGetPeiProtocol (
+  IN EFI_GUID  *ProtocolGuid,
+  IN VOID      **Interface
+  )
+/*++
+
+Routine Description:
+
+  Searches for a Protocol Interface passed from PEI through a HOB
+
+Arguments:
+
+  ProtocolGuid - The Protocol GUID to search for in the HOB List
+
+  Interface    - A pointer to the interface for the Protocol GUID
+
+Returns:
+
+  EFI_SUCCESS   - The Protocol GUID was found and its interface is returned in Interface
+
+  EFI_NOT_FOUND - The Protocol GUID was not found in the HOB List
+
+--*/
+{
+  EFI_HOB_GUID_TYPE   *GuidHob;
+  VOID                *Buffer;
+
+  GuidHob = GetNextGuidHob (ProtocolGuid, mHobStart);
+  if (GuidHob == NULL) {
+    return EFI_NOT_FOUND;
+  }
+  
+  Buffer = GET_GUID_HOB_DATA (GuidHob);
+  ASSERT (Buffer != NULL);
+
+  *Interface = (VOID *)(*(UINTN *)(Buffer));
+
+  return EFI_SUCCESS;
+}
+
+
+VOID
+CalculateEfiHdrCrc (
+  IN  OUT EFI_TABLE_HEADER    *Hdr
+  )
+/*++
+
+Routine Description:
+
+  Calcualte the 32-bit CRC in a EFI table using the service provided by the
+  gRuntime service.
+
+Arguments:
+
+  Hdr  - Pointer to an EFI standard header
+
+Returns:
+
+  None
+
+--*/
+{
+  UINT32 Crc;
+
+  Hdr->CRC32 = 0;
+  
+  //
+  // If gBS->CalculateCrce32 () == CoreEfiNotAvailableYet () then
+  //  Crc will come back as zero if we set it to zero here
+  //
+  Crc = 0;
+  gBS->CalculateCrc32 ((UINT8 *)Hdr, Hdr->HeaderSize, &Crc);
+  Hdr->CRC32 = Crc; 
+}
+
+
+
+EFI_STATUS
+EFIAPI
+CoreExitBootServices (
+  IN EFI_HANDLE   ImageHandle,
+  IN UINTN        MapKey
+  )
+/*++
+
+Routine Description:
+
+  EFI 1.0 API to terminate Boot Services
+
+Arguments:
+
+  ImageHandle  - Handle that represents the identity of the calling image
+
+  MapKey -Key to the latest memory map.
+
+Returns:
+
+  EFI_SUCCESS - Boot Services terminated
+  EFI_INVALID_PARAMETER - MapKey is incorrect.
+
+--*/
+{
+  EFI_STATUS    Status;
+
+  //
+  // Terminate memory services if the MapKey matches
+  //
+  Status = CoreTerminateMemoryMap (MapKey);
+  if (EFI_ERROR (Status)) {
+    return Status;
+  }
+
+  //
+  // Notify other drivers that we are exiting boot services.
+  //
+  CoreNotifySignalList (&gEfiEventExitBootServicesGuid);
+
+  //
+  // Disable Timer
+  //
+  gTimer->SetTimerPeriod (gTimer, 0);
+
+  //
+  // Disable CPU Interrupts
+  //
+  gCpu->DisableInterrupt (gCpu);
+
+  //
+  // Register Runtime events with the Runtime Architectural Protocol
+  //
+  CoreShutdownEventServices ();
+
+  //
+  // Register Runtime images with the Runtime Architectural Protocol
+  //
+  CoreShutdownImageServices ();
+
+  //
+  // Report that ExitBootServices() has been called
+  //
+  // We are using gEfiDxeServicesTableGuid as the caller ID for Dxe Core
+  //
+  CoreReportProgressCode ((EFI_SOFTWARE_EFI_BOOT_SERVICE | EFI_SW_BS_PC_EXIT_BOOT_SERVICES));
+
+  //
+  // Clear the non-runtime values of the EFI System Table
+  //
+  gST->BootServices        = NULL;
+  gST->ConIn               = NULL;
+  gST->ConsoleInHandle     = NULL;
+  gST->ConOut              = NULL;
+  gST->ConsoleOutHandle    = NULL;
+  gST->StdErr              = NULL;
+  gST->StandardErrorHandle = NULL;
+
+  //
+  // Recompute the 32-bit CRC of the EFI System Table
+  //
+  CalculateEfiHdrCrc (&gST->Hdr);
+
+  //
+  // Zero out the Boot Service Table
+  //
+  SetMem (gBS, sizeof (EFI_BOOT_SERVICES), 0);
+  gBS = NULL;
+
+  return Status;
+}
+
+EFI_STATUS
+DxeMainUefiDecompressGetInfo (
+  IN EFI_DECOMPRESS_PROTOCOL            *This,
+  IN   VOID                             *Source,
+  IN   UINT32                           SourceSize,
+  OUT  UINT32                           *DestinationSize,
+  OUT  UINT32                           *ScratchSize
+  )
+{
+  return UefiDecompressGetInfo (Source, SourceSize, DestinationSize, ScratchSize);
+}
+
+EFI_STATUS
+EFIAPI
+DxeMainUefiDecompress (
+  IN EFI_DECOMPRESS_PROTOCOL              *This,
+  IN     VOID                             *Source,
+  IN     UINT32                           SourceSize,
+  IN OUT VOID                             *Destination,
+  IN     UINT32                           DestinationSize,
+  IN OUT VOID                             *Scratch,
+  IN     UINT32                           ScratchSize
+  )
+{
+  EFI_STATUS  Status;
+  UINT32      TestDestinationSize;
+  UINT32      TestScratchSize;
+
+  Status = UefiDecompressGetInfo (Source, SourceSize, &TestDestinationSize, &TestScratchSize);
+  if (EFI_ERROR (Status)) {
+    return Status;
+  }
+
+  if (ScratchSize < TestScratchSize || DestinationSize < TestDestinationSize) {
+    return RETURN_INVALID_PARAMETER;
+  }
+
+  return UefiDecompress (Source, Destination, Scratch);
+}
+
+EFI_STATUS
+DxeMainTianoDecompressGetInfo (
+  IN EFI_TIANO_DECOMPRESS_PROTOCOL      *This,
+  IN   VOID                             *Source,
+  IN   UINT32                           SourceSize,
+  OUT  UINT32                           *DestinationSize,
+  OUT  UINT32                           *ScratchSize
+  )
+{
+  return TianoDecompressGetInfo (Source, SourceSize, DestinationSize, ScratchSize);
+}
+
+EFI_STATUS
+EFIAPI
+DxeMainTianoDecompress (
+  IN EFI_TIANO_DECOMPRESS_PROTOCOL        *This,
+  IN     VOID                             *Source,
+  IN     UINT32                           SourceSize,
+  IN OUT VOID                             *Destination,
+  IN     UINT32                           DestinationSize,
+  IN OUT VOID                             *Scratch,
+  IN     UINT32                           ScratchSize
+  )
+{
+  EFI_STATUS  Status;
+  UINT32      TestDestinationSize;
+  UINT32      TestScratchSize;
+
+  Status = TianoDecompressGetInfo (Source, SourceSize, &TestDestinationSize, &TestScratchSize);
+  if (EFI_ERROR (Status)) {
+    return Status;
+  }
+
+  if (ScratchSize < TestScratchSize || DestinationSize < TestDestinationSize) {
+    return RETURN_INVALID_PARAMETER;
+  }
+
+  return TianoDecompress (Source, Destination, Scratch);
+}
+
+EFI_STATUS
+DxeMainCustomDecompressGetInfo (
+  IN EFI_CUSTOMIZED_DECOMPRESS_PROTOCOL  *This,
+  IN   VOID                              *Source,
+  IN   UINT32                            SourceSize,
+  OUT  UINT32                            *DestinationSize,
+  OUT  UINT32                            *ScratchSize
+  )
+{
+  return CustomDecompressGetInfo (Source, SourceSize, DestinationSize, ScratchSize);
+}
+
+EFI_STATUS
+EFIAPI
+DxeMainCustomDecompress (
+  IN EFI_CUSTOMIZED_DECOMPRESS_PROTOCOL  *This,
+  IN     VOID                            *Source,
+  IN     UINT32                          SourceSize,
+  IN OUT VOID                            *Destination,
+  IN     UINT32                          DestinationSize,
+  IN OUT VOID                            *Scratch,
+  IN     UINT32                          ScratchSize
+  )
+{
+  EFI_STATUS  Status;
+  UINT32      TestDestinationSize;
+  UINT32      TestScratchSize;
+
+  Status = CustomDecompressGetInfo (Source, SourceSize, &TestDestinationSize, &TestScratchSize);
+  if (EFI_ERROR (Status)) {
+    return Status;
+  }
+
+  if (ScratchSize < TestScratchSize || DestinationSize < TestDestinationSize) {
+    return RETURN_INVALID_PARAMETER;
+  }
+
+  return CustomDecompress (Source, Destination, Scratch);
+}
+
index e8391419ab6768e3e2fc9a5c1f0bb7ee7ab2b422..6751b18e6f9c90358eb5bb0bf16f8af537eb6d5c 100644 (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:\r
-\r
-    event.c\r
-\r
-Abstract:\r
-\r
-    EFI Event support\r
\r
---*/\r
-\r
-\r
-#include <DxeMain.h>\r
-\r
-//\r
-// Enumerate the valid types\r
-//\r
-UINT32 mEventTable[] = {\r
-  //\r
-  // 0x80000200       Timer event with a notification function that is\r
-  // queue when the event is signaled with SignalEvent()\r
-  //\r
-  EFI_EVENT_TIMER | EFI_EVENT_NOTIFY_SIGNAL,\r
-  //\r
-  // 0x80000000       Timer event without a notification function. It can be\r
-  // signaled with SignalEvent() and checked with CheckEvent() or WaitForEvent().\r
-  //\r
-  EFI_EVENT_TIMER,\r
-  //\r
-  // 0x00000100       Generic event with a notification function that \r
-  // can be waited on with CheckEvent() or WaitForEvent()\r
-  //\r
-  EFI_EVENT_NOTIFY_WAIT,\r
-  //\r
-  // 0x00000200       Generic event with a notification function that \r
-  // is queue when the event is signaled with SignalEvent()\r
-  //\r
-  EFI_EVENT_NOTIFY_SIGNAL,\r
-  //\r
-  // 0x00000201       ExitBootServicesEvent.  \r
-  //\r
-  EFI_EVENT_SIGNAL_EXIT_BOOT_SERVICES,\r
-  //\r
-  // 0x60000202       SetVirtualAddressMapEvent.\r
-  //\r
-  EFI_EVENT_SIGNAL_VIRTUAL_ADDRESS_CHANGE,\r
-\r
-#if (EFI_SPECIFICATION_VERSION < 0x00020000)\r
-  //\r
-  // 0x00000203       ReadyToBootEvent.\r
-  //\r
-  EFI_EVENT_SIGNAL_READY_TO_BOOT,\r
-  //\r
-  // 0x00000204       LegacyBootEvent.\r
-  //\r
-  EFI_EVENT_SIGNAL_LEGACY_BOOT,\r
-  //\r
-  // 0x00000603       Signal all ReadyToBootEvents.\r
-  //\r
-  EFI_EVENT_NOTIFY_SIGNAL_ALL | EFI_EVENT_SIGNAL_READY_TO_BOOT,\r
-  //\r
-  // 0x00000604       Signal all LegacyBootEvents.\r
-  //\r
-  EFI_EVENT_NOTIFY_SIGNAL_ALL | EFI_EVENT_SIGNAL_LEGACY_BOOT,\r
-#endif\r
-\r
-  //\r
-  // 0x00000000       Generic event without a notification function. \r
-  // It can be signaled with SignalEvent() and checked with CheckEvent() \r
-  // or WaitForEvent().\r
-  //\r
-  0x00000000,\r
-  //\r
-  // 0x80000100       Timer event with a notification function that can be \r
-  // waited on with CheckEvent() or WaitForEvent()\r
-  //\r
-  EFI_EVENT_TIMER | EFI_EVENT_NOTIFY_WAIT,\r
-};\r
-\r
-\r
-VOID\r
-CoreAcquireEventLock (\r
-  VOID\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Enter critical section by acquiring the lock on gEventQueueLock.\r
-\r
-Arguments:\r
-\r
-  None\r
-\r
-Returns:\r
-\r
-  None\r
-\r
---*/\r
-{\r
-  CoreAcquireLock (&gEventQueueLock);\r
-}\r
-\r
-\r
-VOID\r
-CoreReleaseEventLock (\r
-  VOID\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Exit critical section by releasing the lock on gEventQueueLock.\r
-\r
-Arguments:\r
-\r
-  None\r
-\r
-Returns:\r
-\r
-  None\r
-\r
---*/\r
-{\r
-  CoreReleaseLock (&gEventQueueLock);\r
-}\r
-\r
-\r
-EFI_STATUS\r
-CoreInitializeEventServices (\r
-  VOID\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Initializes "event" support and populates parts of the System and Runtime Table.\r
-\r
-Arguments:\r
-\r
-  None\r
-    \r
-Returns:\r
-\r
-  EFI_SUCCESS - Always return success\r
-\r
---*/\r
-{\r
-  UINTN        Index;\r
-\r
-  for (Index=0; Index <= EFI_TPL_HIGH_LEVEL; Index++) {\r
-    InitializeListHead (&gEventQueue[Index]);\r
-  }\r
-\r
-  CoreInitializeTimer ();\r
-  \r
-  return EFI_SUCCESS;\r
-}\r
-\r
-\r
-EFI_STATUS\r
-CoreShutdownEventServices (\r
-  VOID\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Register all runtime events to make sure they are still available after ExitBootService.\r
-\r
-Arguments:\r
-\r
-  None\r
-    \r
-Returns:\r
-\r
-  EFI_SUCCESS - Always return success.\r
-\r
---*/\r
-{\r
-  LIST_ENTRY        *Link;\r
-  IEVENT            *Event;\r
-\r
-  //\r
-  // The Runtime AP is required for the core to function!\r
-  //\r
-  ASSERT (gRuntime != NULL);\r
-\r
-  for (Link = mRuntimeEventList.ForwardLink; Link != &mRuntimeEventList; Link = Link->ForwardLink) {\r
-    Event = CR (Link, IEVENT, RuntimeLink, EVENT_SIGNATURE);\r
-    gRuntime->RegisterEvent (\r
-                gRuntime, \r
-                Event->Type, \r
-                Event->NotifyTpl, \r
-                Event->NotifyFunction, \r
-                Event->NotifyContext, \r
-                (VOID **)Event\r
-                );\r
-  }\r
-\r
-  return EFI_SUCCESS;\r
-}\r
-\r
-\r
-VOID\r
-CoreDispatchEventNotifies (\r
-  IN EFI_TPL      Priority\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Dispatches all pending events. \r
-\r
-Arguments:\r
-\r
-  Priority - The task priority level of event notifications to dispatch\r
-    \r
-Returns:\r
-\r
-  None\r
-\r
---*/\r
-{\r
-  IEVENT          *Event;\r
-  LIST_ENTRY      *Head;\r
-  \r
-  CoreAcquireEventLock ();\r
-  ASSERT (gEventQueueLock.OwnerTpl == Priority);\r
-  Head = &gEventQueue[Priority];\r
-\r
-  //\r
-  // Dispatch all the pending notifications\r
-  //\r
-  while (!IsListEmpty (Head)) {\r
-      \r
-    Event = CR (Head->ForwardLink, IEVENT, NotifyLink, EVENT_SIGNATURE);\r
-    RemoveEntryList (&Event->NotifyLink);\r
-\r
-    Event->NotifyLink.ForwardLink = NULL;\r
-\r
-    //\r
-    // Only clear the SIGNAL status if it is a SIGNAL type event.\r
-    // WAIT type events are only cleared in CheckEvent()\r
-    //\r
-    if (Event->Type & EFI_EVENT_NOTIFY_SIGNAL) {\r
-      Event->SignalCount = 0;\r
-    }\r
-\r
-    CoreReleaseEventLock ();\r
-      \r
-    //\r
-    // Notify this event\r
-    //\r
-    ASSERT (Event->NotifyFunction != NULL);\r
-    Event->NotifyFunction (Event, Event->NotifyContext);\r
-\r
-    //\r
-    // Check for next pending event\r
-    //\r
-    CoreAcquireEventLock ();\r
-  }\r
-\r
-  gEventPending &= ~(1 << Priority);\r
-  CoreReleaseEventLock ();\r
-}\r
-\r
-\r
-VOID\r
-STATIC\r
-CoreNotifyEvent (\r
-  IN  IEVENT      *Event\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Queues the event's notification function to fire\r
-\r
-Arguments:\r
-\r
-  Event       - The Event to notify\r
-    \r
-Returns:\r
-\r
-  None\r
-\r
---*/\r
-{\r
-\r
-  //\r
-  // Event database must be locked\r
-  //\r
-  ASSERT_LOCKED (&gEventQueueLock);\r
-\r
-  //\r
-  // If the event is queued somewhere, remove it\r
-  //\r
-\r
-  if (Event->NotifyLink.ForwardLink != NULL) {\r
-    RemoveEntryList (&Event->NotifyLink);\r
-    Event->NotifyLink.ForwardLink = NULL;\r
-  }\r
-\r
-  // \r
-  // Queue the event to the pending notification list\r
-  //\r
-\r
-  InsertTailList (&gEventQueue[Event->NotifyTpl], &Event->NotifyLink);\r
-  gEventPending |= (UINTN)(1 << Event->NotifyTpl);\r
-}\r
-\r
-\r
-\r
-VOID\r
-CoreNotifySignalList (\r
-  IN EFI_GUID     *EventGroup\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-  Signals all events in the EventGroup\r
-\r
-Arguments:\r
-  EventGroup - The list to signal\r
-    \r
-Returns:\r
-\r
-  None\r
-\r
---*/\r
-{\r
-  LIST_ENTRY              *Link;\r
-  LIST_ENTRY              *Head;\r
-  IEVENT                  *Event;\r
-\r
-  CoreAcquireEventLock ();\r
-\r
-  Head = &gEventSignalQueue;\r
-  for (Link = Head->ForwardLink; Link != Head; Link = Link->ForwardLink) {\r
-    Event = CR (Link, IEVENT, SignalLink, EVENT_SIGNATURE);\r
-    if (CompareGuid (&Event->EventGroup, EventGroup)) {\r
-      CoreNotifyEvent (Event);\r
-    }\r
-  }\r
-\r
-  CoreReleaseEventLock ();\r
-}\r
-\r
-\r
-#if (EFI_SPECIFICATION_VERSION < 0x00020000)\r
-\r
-static\r
-VOID\r
-EFIAPI\r
-EventNofitySignalAllNullEvent (\r
-  IN EFI_EVENT                Event,\r
-  IN VOID                     *Context\r
-  )\r
-{\r
-  //\r
-  // This null event is a size efficent way to enusre that \r
-  // EFI_EVENT_NOTIFY_SIGNAL_ALL is error checked correctly.\r
-  // EFI_EVENT_NOTIFY_SIGNAL_ALL is now mapped into \r
-  // CreateEventEx() and this function is used to make the\r
-  // old error checking in CreateEvent() for Tiano extensions\r
-  // function.\r
-  //\r
-  return;\r
-}\r
-\r
-#endif\r
-\r
-\r
-\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-CoreCreateEvent (\r
-  IN UINT32                   Type,\r
-  IN EFI_TPL                  NotifyTpl,\r
-  IN EFI_EVENT_NOTIFY         NotifyFunction, OPTIONAL\r
-  IN VOID                     *NotifyContext, OPTIONAL\r
-  OUT EFI_EVENT               *Event\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-  Creates a general-purpose event structure\r
-\r
-Arguments:\r
-  Type                - The type of event to create and its mode and attributes\r
-  NotifyTpl           - The task priority level of event notifications\r
-  NotifyFunction      - Pointer to the events notification function\r
-  NotifyContext       - Pointer to the notification functions context; corresponds to\r
-                        parameter "Context" in the notification function\r
-  Event               - Pointer to the newly created event if the call succeeds; undefined otherwise\r
-\r
-Returns:\r
-  EFI_SUCCESS           - The event structure was created\r
-  EFI_INVALID_PARAMETER - One of the parameters has an invalid value\r
-  EFI_OUT_OF_RESOURCES  - The event could not be allocated\r
-\r
---*/\r
-{ \r
-  EFI_GUID            *GuidPtr;\r
-  EFI_EVENT_NOTIFY    Function;\r
-  \r
-  GuidPtr = NULL;\r
-  Function = NotifyFunction;\r
-\r
-#if (EFI_SPECIFICATION_VERSION < 0x00020000)\r
-  //\r
-  // Clear EFI_EVENT_NOFITY_SIGNAL_ALL (Tiano extension) as all events in the \r
-  //  EventGroup now have this property. So we need to filter it out.\r
-  //\r
-  if (Type & EFI_EVENT_NOTIFY_SIGNAL_ALL) {\r
-    Type &= ~EFI_EVENT_NOTIFY_SIGNAL_ALL;\r
-    Function = EventNofitySignalAllNullEvent;\r
-  }\r
-\r
-  //\r
-  // Map the Tiano extensions Events to CreateEventEx form\r
-  //\r
-  if (Type == EFI_EVENT_SIGNAL_READY_TO_BOOT) {\r
-    GuidPtr = &gEfiEventReadToBootGuid;\r
-  } else if (Type == EFI_EVENT_SIGNAL_LEGACY_BOOT) {\r
-    GuidPtr = &gEfiEventLegacyBootGuid\r
-  }\r
-#endif\r
-\r
-  //\r
-  // Convert EFI 1.10 Events to thier UEFI 2.0 CreateEventEx mapping\r
-  // \r
-  if (Type == EVENT_SIGNAL_EXIT_BOOT_SERVICES) {\r
-    GuidPtr = &gEfiEventExitBootServicesGuid;\r
-  } else if (Type == EVENT_SIGNAL_VIRTUAL_ADDRESS_CHANGE) {\r
-    GuidPtr = &gEfiEventVirtualAddressChangeGuid;\r
-  }\r
-  \r
-  return CoreCreateEventEx (Type, NotifyTpl, Function, NotifyContext, GuidPtr, Event);\r
-}\r
-\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-CoreCreateEventEx (\r
-  IN UINT32                   Type,\r
-  IN EFI_TPL                  NotifyTpl,\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
-\r
-Routine Description:\r
-  Creates a general-purpose event structure\r
-\r
-Arguments:\r
-  Type                - The type of event to create and its mode and attributes\r
-  NotifyTpl           - The task priority level of event notifications\r
-  NotifyFunction      - Pointer to the events notification function\r
-  NotifyContext       - Pointer to the notification functions context; corresponds to\r
-                        parameter "Context" in the notification function\r
-  EventGrout          - GUID for EventGroup if NULL act the same as gBS->CreateEvent().\r
-  Event               - Pointer to the newly created event if the call succeeds; undefined otherwise\r
-\r
-Returns:\r
-  EFI_SUCCESS           - The event structure was created\r
-  EFI_INVALID_PARAMETER - One of the parameters has an invalid value\r
-  EFI_OUT_OF_RESOURCES  - The event could not be allocated\r
-\r
---*/\r
-{\r
-  EFI_STATUS      Status;\r
-  IEVENT          *IEvent;\r
-  INTN            Index;\r
-\r
-\r
-  if ((Event == NULL) || (NotifyTpl == EFI_TPL_APPLICATION)) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-\r
-  //\r
-  // Check to make sure no reserved flags are set\r
-  //\r
-  Status = EFI_INVALID_PARAMETER;\r
-  for (Index = 0; Index < (sizeof (mEventTable) / sizeof (UINT32)); Index++) {\r
-     if (Type == mEventTable[Index]) {\r
-       Status = EFI_SUCCESS;\r
-       break;\r
-     }\r
-  }\r
-  if(EFI_ERROR (Status)) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-\r
-  //\r
-  // If it's a notify type of event, check its parameters\r
-  //\r
-  if ((Type & (EFI_EVENT_NOTIFY_WAIT | EFI_EVENT_NOTIFY_SIGNAL))) {\r
-    //\r
-    // Check for an invalid NotifyFunction or NotifyTpl\r
-    //\r
-    if ((NotifyFunction == NULL) || \r
-        (NotifyTpl < EFI_TPL_APPLICATION) || \r
-       (NotifyTpl >= EFI_TPL_HIGH_LEVEL)) {\r
-      return EFI_INVALID_PARAMETER;\r
-    }\r
-\r
-  } else {\r
-    //\r
-    // No notification needed, zero ignored values\r
-    //\r
-    NotifyTpl = 0;\r
-    NotifyFunction = NULL;\r
-    NotifyContext = NULL;\r
-  }\r
-\r
-  //\r
-  // Allcoate and initialize a new event structure.\r
-  //\r
-  Status = CoreAllocatePool (\r
-             (Type & EFI_EVENT_RUNTIME) ? EfiRuntimeServicesData: EfiBootServicesData, \r
-             sizeof (IEVENT),\r
-             (VOID **)&IEvent\r
-             );\r
-  if (EFI_ERROR (Status)) {\r
-    return EFI_OUT_OF_RESOURCES;\r
-  }\r
-\r
-  SetMem (IEvent, sizeof (IEVENT), 0);\r
-\r
-  IEvent->Signature = EVENT_SIGNATURE;\r
-  IEvent->Type = Type;\r
-  \r
-  IEvent->NotifyTpl      = NotifyTpl;\r
-  IEvent->NotifyFunction = NotifyFunction;\r
-  IEvent->NotifyContext  = (VOID *)NotifyContext;\r
-  if (EventGroup != NULL) {\r
-    CopyGuid (&IEvent->EventGroup, EventGroup);\r
-    IEvent->ExFlag = TRUE;\r
-  }\r
-\r
-  *Event = IEvent;\r
-\r
-  if (Type & EFI_EVENT_RUNTIME) {\r
-    //\r
-    // Keep a list of all RT events so we can tell the RT AP.\r
-    //\r
-    InsertTailList (&mRuntimeEventList, &IEvent->RuntimeLink);\r
-  }\r
-\r
-  CoreAcquireEventLock ();\r
-  \r
-  if ((Type & EFI_EVENT_NOTIFY_SIGNAL) != 0x00000000) {\r
-    //\r
-    // The Event's NotifyFunction must be queued whenever the event is signaled\r
-    //\r
-    InsertHeadList (&gEventSignalQueue, &IEvent->SignalLink);\r
-  }\r
-  \r
-  CoreReleaseEventLock ();\r
-  \r
-  //\r
-  // Done\r
-  //\r
-  return EFI_SUCCESS;\r
-}\r
-\r
-\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-CoreSignalEvent (\r
-  IN EFI_EVENT    UserEvent\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Signals the event.  Queues the event to be notified if needed\r
-    \r
-Arguments:\r
-\r
-  UserEvent - The event to signal\r
-    \r
-Returns:\r
-\r
-  EFI_INVALID_PARAMETER - Parameters are not valid.\r
-  \r
-  EFI_SUCCESS - The event was signaled.\r
-\r
---*/\r
-{\r
-  IEVENT          *Event;\r
-\r
-  Event = UserEvent;\r
-\r
-  if (Event == NULL) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-\r
-  if (Event->Signature != EVENT_SIGNATURE) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-\r
-  CoreAcquireEventLock ();\r
-\r
-  //\r
-  // If the event is not already signalled, do so\r
-  //\r
-\r
-  if (Event->SignalCount == 0x00000000) {\r
-    Event->SignalCount++;\r
-\r
-    //\r
-    // If signalling type is a notify function, queue it\r
-    //\r
-    if (Event->Type & EFI_EVENT_NOTIFY_SIGNAL) {\r
-      if (Event->ExFlag) {\r
-        //\r
-        // The CreateEventEx() style requires all members of the Event Group \r
-        //  to be signaled. \r
-        //\r
-        CoreReleaseEventLock ();\r
-        CoreNotifySignalList (&Event->EventGroup);\r
-        CoreAcquireEventLock ();\r
-       } else {\r
-        CoreNotifyEvent (Event);\r
-      }\r
-    }\r
-  }\r
-\r
-  CoreReleaseEventLock ();\r
-  return EFI_SUCCESS;\r
-}\r
-\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-CoreCheckEvent (\r
-  IN EFI_EVENT        UserEvent\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Check the status of an event\r
-    \r
-Arguments:\r
-\r
-  UserEvent - The event to check\r
-    \r
-Returns:\r
-\r
-  EFI_SUCCESS           - The event is in the signaled state\r
-  EFI_NOT_READY         - The event is not in the signaled state\r
-  EFI_INVALID_PARAMETER - Event is of type EVT_NOTIFY_SIGNAL\r
-\r
---*/\r
-\r
-{\r
-  IEVENT      *Event;\r
-  EFI_STATUS  Status;\r
-\r
-  Event = UserEvent;\r
-\r
-  if (Event == NULL) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-\r
-  if (Event->Signature != EVENT_SIGNATURE) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-\r
-  if (Event->Type & EFI_EVENT_NOTIFY_SIGNAL) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-\r
-  Status = EFI_NOT_READY;\r
-\r
-  if (!Event->SignalCount && (Event->Type & EFI_EVENT_NOTIFY_WAIT)) {\r
-\r
-    //\r
-    // Queue the wait notify function\r
-    //\r
-\r
-    CoreAcquireEventLock ();\r
-    if (!Event->SignalCount) {\r
-      CoreNotifyEvent (Event);\r
-    }\r
-    CoreReleaseEventLock ();\r
-  }\r
-\r
-  //\r
-  // If the even looks signalled, get the lock and clear it\r
-  //\r
-\r
-  if (Event->SignalCount) {\r
-    CoreAcquireEventLock ();\r
-\r
-    if (Event->SignalCount) {\r
-      Event->SignalCount = 0;\r
-      Status = EFI_SUCCESS;\r
-    }\r
-\r
-    CoreReleaseEventLock ();\r
-  }\r
-\r
-  return Status;\r
-}\r
-\r
-\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-CoreWaitForEvent (\r
-  IN UINTN        NumberOfEvents,\r
-  IN EFI_EVENT    *UserEvents,\r
-  OUT UINTN       *UserIndex\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Stops execution until an event is signaled.\r
-    \r
-Arguments:\r
-\r
-  NumberOfEvents  - The number of events in the UserEvents array\r
-  UserEvents      - An array of EFI_EVENT\r
-  UserIndex       - Pointer to the index of the event which satisfied the wait condition\r
-    \r
-Returns:\r
-\r
-  EFI_SUCCESS           - The event indicated by Index was signaled.\r
-  EFI_INVALID_PARAMETER - The event indicated by Index has a notification function or \r
-                          Event was not a valid type\r
-  EFI_UNSUPPORTED       - The current TPL is not TPL_APPLICATION\r
-\r
---*/\r
-\r
-{\r
-  EFI_STATUS      Status;\r
-  UINTN           Index;\r
-\r
-  //\r
-  // Can only WaitForEvent at TPL_APPLICATION\r
-  //\r
-  if (gEfiCurrentTpl != EFI_TPL_APPLICATION) {\r
-    return EFI_UNSUPPORTED;\r
-  }\r
-\r
-  for(;;) {\r
-      \r
-    for(Index = 0; Index < NumberOfEvents; Index++) {\r
-\r
-      Status = CoreCheckEvent (UserEvents[Index]);\r
-\r
-      //\r
-      // provide index of event that caused problem\r
-      //\r
-      if (Status != EFI_NOT_READY) {\r
-        *UserIndex = Index;\r
-        return Status;\r
-      }\r
-    }\r
-\r
-    //\r
-    // This was the location of the Idle loop callback in EFI 1.x reference\r
-    // code. We don't have that concept in this base at this point.\r
-    // \r
-  }\r
-}\r
-\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-CoreCloseEvent (\r
-  IN EFI_EVENT    UserEvent\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Closes an event and frees the event structure.\r
-    \r
-Arguments:\r
-\r
-  UserEvent - Event to close\r
-    \r
-Returns:\r
-\r
-  EFI_INVALID_PARAMETER - Parameters are not valid.\r
-  \r
-  EFI_SUCCESS - The event has been closed\r
-\r
---*/\r
-\r
-{\r
-  EFI_STATUS  Status;\r
-  IEVENT      *Event;\r
-\r
-  Event = UserEvent;\r
-\r
-  if (Event == NULL) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-\r
-  if (Event->Signature != EVENT_SIGNATURE) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-\r
-  //\r
-  // If it's a timer event, make sure it's not pending\r
-  //\r
-  if (Event->Type & EFI_EVENT_TIMER) {\r
-    CoreSetTimer (Event, TimerCancel, 0);\r
-  }\r
-\r
-  CoreAcquireEventLock ();\r
-\r
-  //\r
-  // If the event is queued somewhere, remove it\r
-  //\r
-\r
-  if (Event->RuntimeLink.ForwardLink != NULL) {\r
-    RemoveEntryList (&Event->RuntimeLink);\r
-  }\r
-\r
-  if (Event->NotifyLink.ForwardLink != NULL) {\r
-    RemoveEntryList (&Event->NotifyLink);\r
-  }\r
-\r
-  if (Event->SignalLink.ForwardLink != NULL) {\r
-    RemoveEntryList (&Event->SignalLink);\r
-  }\r
-\r
-  CoreReleaseEventLock ();\r
-\r
-  //\r
-  // If the event is registered on a protocol notify, then remove it from the protocol database\r
-  //\r
-  CoreUnregisterProtocolNotify (Event);\r
-\r
-  Status = CoreFreePool (Event);\r
-  ASSERT_EFI_ERROR (Status);\r
-\r
-  return Status;\r
-}\r
+/*++
+
+Copyright (c) 2006, Intel Corporation                                                         
+All rights reserved. This program and the accompanying materials                          
+are licensed and made available under the terms and conditions of the BSD License         
+which accompanies this distribution.  The full text of the license may be found at        
+http://opensource.org/licenses/bsd-license.php                                            
+                                                                                          
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             
+
+Module Name:
+
+    event.c
+
+Abstract:
+
+    EFI Event support
+--*/
+
+
+#include <DxeMain.h>
+
+//
+// Enumerate the valid types
+//
+UINT32 mEventTable[] = {
+  //
+  // 0x80000200       Timer event with a notification function that is
+  // queue when the event is signaled with SignalEvent()
+  //
+  EFI_EVENT_TIMER | EFI_EVENT_NOTIFY_SIGNAL,
+  //
+  // 0x80000000       Timer event without a notification function. It can be
+  // signaled with SignalEvent() and checked with CheckEvent() or WaitForEvent().
+  //
+  EFI_EVENT_TIMER,
+  //
+  // 0x00000100       Generic event with a notification function that 
+  // can be waited on with CheckEvent() or WaitForEvent()
+  //
+  EFI_EVENT_NOTIFY_WAIT,
+  //
+  // 0x00000200       Generic event with a notification function that 
+  // is queue when the event is signaled with SignalEvent()
+  //
+  EFI_EVENT_NOTIFY_SIGNAL,
+  //
+  // 0x00000201       ExitBootServicesEvent.  
+  //
+  EFI_EVENT_SIGNAL_EXIT_BOOT_SERVICES,
+  //
+  // 0x60000202       SetVirtualAddressMapEvent.
+  //
+  EFI_EVENT_SIGNAL_VIRTUAL_ADDRESS_CHANGE,
+
+#if (EFI_SPECIFICATION_VERSION < 0x00020000)
+  //
+  // 0x00000203       ReadyToBootEvent.
+  //
+  EFI_EVENT_SIGNAL_READY_TO_BOOT,
+  //
+  // 0x00000204       LegacyBootEvent.
+  //
+  EFI_EVENT_SIGNAL_LEGACY_BOOT,
+  //
+  // 0x00000603       Signal all ReadyToBootEvents.
+  //
+  EFI_EVENT_NOTIFY_SIGNAL_ALL | EFI_EVENT_SIGNAL_READY_TO_BOOT,
+  //
+  // 0x00000604       Signal all LegacyBootEvents.
+  //
+  EFI_EVENT_NOTIFY_SIGNAL_ALL | EFI_EVENT_SIGNAL_LEGACY_BOOT,
+#endif
+
+  //
+  // 0x00000000       Generic event without a notification function. 
+  // It can be signaled with SignalEvent() and checked with CheckEvent() 
+  // or WaitForEvent().
+  //
+  0x00000000,
+  //
+  // 0x80000100       Timer event with a notification function that can be 
+  // waited on with CheckEvent() or WaitForEvent()
+  //
+  EFI_EVENT_TIMER | EFI_EVENT_NOTIFY_WAIT,
+};
+
+
+VOID
+CoreAcquireEventLock (
+  VOID
+  )
+/*++
+
+Routine Description:
+
+  Enter critical section by acquiring the lock on gEventQueueLock.
+
+Arguments:
+
+  None
+
+Returns:
+
+  None
+
+--*/
+{
+  CoreAcquireLock (&gEventQueueLock);
+}
+
+
+VOID
+CoreReleaseEventLock (
+  VOID
+  )
+/*++
+
+Routine Description:
+
+  Exit critical section by releasing the lock on gEventQueueLock.
+
+Arguments:
+
+  None
+
+Returns:
+
+  None
+
+--*/
+{
+  CoreReleaseLock (&gEventQueueLock);
+}
+
+
+EFI_STATUS
+CoreInitializeEventServices (
+  VOID
+  )
+/*++
+
+Routine Description:
+
+  Initializes "event" support and populates parts of the System and Runtime Table.
+
+Arguments:
+
+  None
+    
+Returns:
+
+  EFI_SUCCESS - Always return success
+
+--*/
+{
+  UINTN        Index;
+
+  for (Index=0; Index <= EFI_TPL_HIGH_LEVEL; Index++) {
+    InitializeListHead (&gEventQueue[Index]);
+  }
+
+  CoreInitializeTimer ();
+  
+  return EFI_SUCCESS;
+}
+
+
+EFI_STATUS
+CoreShutdownEventServices (
+  VOID
+  )
+/*++
+
+Routine Description:
+
+  Register all runtime events to make sure they are still available after ExitBootService.
+
+Arguments:
+
+  None
+    
+Returns:
+
+  EFI_SUCCESS - Always return success.
+
+--*/
+{
+  LIST_ENTRY        *Link;
+  IEVENT            *Event;
+
+  //
+  // The Runtime AP is required for the core to function!
+  //
+  ASSERT (gRuntime != NULL);
+
+  for (Link = mRuntimeEventList.ForwardLink; Link != &mRuntimeEventList; Link = Link->ForwardLink) {
+    Event = CR (Link, IEVENT, RuntimeLink, EVENT_SIGNATURE);
+    gRuntime->RegisterEvent (
+                gRuntime, 
+                Event->Type, 
+                Event->NotifyTpl, 
+                Event->NotifyFunction, 
+                Event->NotifyContext, 
+                (VOID **)Event
+                );
+  }
+
+  return EFI_SUCCESS;
+}
+
+
+VOID
+CoreDispatchEventNotifies (
+  IN EFI_TPL      Priority
+  )
+/*++
+
+Routine Description:
+
+  Dispatches all pending events. 
+
+Arguments:
+
+  Priority - The task priority level of event notifications to dispatch
+    
+Returns:
+
+  None
+
+--*/
+{
+  IEVENT          *Event;
+  LIST_ENTRY      *Head;
+  
+  CoreAcquireEventLock ();
+  ASSERT (gEventQueueLock.OwnerTpl == Priority);
+  Head = &gEventQueue[Priority];
+
+  //
+  // Dispatch all the pending notifications
+  //
+  while (!IsListEmpty (Head)) {
+      
+    Event = CR (Head->ForwardLink, IEVENT, NotifyLink, EVENT_SIGNATURE);
+    RemoveEntryList (&Event->NotifyLink);
+
+    Event->NotifyLink.ForwardLink = NULL;
+
+    //
+    // Only clear the SIGNAL status if it is a SIGNAL type event.
+    // WAIT type events are only cleared in CheckEvent()
+    //
+    if (Event->Type & EFI_EVENT_NOTIFY_SIGNAL) {
+      Event->SignalCount = 0;
+    }
+
+    CoreReleaseEventLock ();
+      
+    //
+    // Notify this event
+    //
+    ASSERT (Event->NotifyFunction != NULL);
+    Event->NotifyFunction (Event, Event->NotifyContext);
+
+    //
+    // Check for next pending event
+    //
+    CoreAcquireEventLock ();
+  }
+
+  gEventPending &= ~(1 << Priority);
+  CoreReleaseEventLock ();
+}
+
+
+VOID
+STATIC
+CoreNotifyEvent (
+  IN  IEVENT      *Event
+  )
+/*++
+
+Routine Description:
+
+  Queues the event's notification function to fire
+
+Arguments:
+
+  Event       - The Event to notify
+    
+Returns:
+
+  None
+
+--*/
+{
+
+  //
+  // Event database must be locked
+  //
+  ASSERT_LOCKED (&gEventQueueLock);
+
+  //
+  // If the event is queued somewhere, remove it
+  //
+
+  if (Event->NotifyLink.ForwardLink != NULL) {
+    RemoveEntryList (&Event->NotifyLink);
+    Event->NotifyLink.ForwardLink = NULL;
+  }
+
+  // 
+  // Queue the event to the pending notification list
+  //
+
+  InsertTailList (&gEventQueue[Event->NotifyTpl], &Event->NotifyLink);
+  gEventPending |= (UINTN)(1 << Event->NotifyTpl);
+}
+
+
+
+VOID
+CoreNotifySignalList (
+  IN EFI_GUID     *EventGroup
+  )
+/*++
+
+Routine Description:
+  Signals all events in the EventGroup
+
+Arguments:
+  EventGroup - The list to signal
+    
+Returns:
+
+  None
+
+--*/
+{
+  LIST_ENTRY              *Link;
+  LIST_ENTRY              *Head;
+  IEVENT                  *Event;
+
+  CoreAcquireEventLock ();
+
+  Head = &gEventSignalQueue;
+  for (Link = Head->ForwardLink; Link != Head; Link = Link->ForwardLink) {
+    Event = CR (Link, IEVENT, SignalLink, EVENT_SIGNATURE);
+    if (CompareGuid (&Event->EventGroup, EventGroup)) {
+      CoreNotifyEvent (Event);
+    }
+  }
+
+  CoreReleaseEventLock ();
+}
+
+
+#if (EFI_SPECIFICATION_VERSION < 0x00020000)
+
+static
+VOID
+EFIAPI
+EventNofitySignalAllNullEvent (
+  IN EFI_EVENT                Event,
+  IN VOID                     *Context
+  )
+{
+  //
+  // This null event is a size efficent way to enusre that 
+  // EFI_EVENT_NOTIFY_SIGNAL_ALL is error checked correctly.
+  // EFI_EVENT_NOTIFY_SIGNAL_ALL is now mapped into 
+  // CreateEventEx() and this function is used to make the
+  // old error checking in CreateEvent() for Tiano extensions
+  // function.
+  //
+  return;
+}
+
+#endif
+
+
+
+
+EFI_STATUS
+EFIAPI
+CoreCreateEvent (
+  IN UINT32                   Type,
+  IN EFI_TPL                  NotifyTpl,
+  IN EFI_EVENT_NOTIFY         NotifyFunction, OPTIONAL
+  IN VOID                     *NotifyContext, OPTIONAL
+  OUT EFI_EVENT               *Event
+  )
+/*++
+
+Routine Description:
+  Creates a general-purpose event structure
+
+Arguments:
+  Type                - The type of event to create and its mode and attributes
+  NotifyTpl           - The task priority level of event notifications
+  NotifyFunction      - Pointer to the events notification function
+  NotifyContext       - Pointer to the notification functions context; corresponds to
+                        parameter "Context" in the notification function
+  Event               - Pointer to the newly created event if the call succeeds; undefined otherwise
+
+Returns:
+  EFI_SUCCESS           - The event structure was created
+  EFI_INVALID_PARAMETER - One of the parameters has an invalid value
+  EFI_OUT_OF_RESOURCES  - The event could not be allocated
+
+--*/
+{ 
+  EFI_GUID            *GuidPtr;
+  EFI_EVENT_NOTIFY    Function;
+  
+  GuidPtr = NULL;
+  Function = NotifyFunction;
+
+#if (EFI_SPECIFICATION_VERSION < 0x00020000)
+  //
+  // Clear EFI_EVENT_NOFITY_SIGNAL_ALL (Tiano extension) as all events in the 
+  //  EventGroup now have this property. So we need to filter it out.
+  //
+  if (Type & EFI_EVENT_NOTIFY_SIGNAL_ALL) {
+    Type &= ~EFI_EVENT_NOTIFY_SIGNAL_ALL;
+    Function = EventNofitySignalAllNullEvent;
+  }
+
+  //
+  // Map the Tiano extensions Events to CreateEventEx form
+  //
+  if (Type == EFI_EVENT_SIGNAL_READY_TO_BOOT) {
+    GuidPtr = &gEfiEventReadyToBootGuid;
+  } else if (Type == EFI_EVENT_SIGNAL_LEGACY_BOOT) {
+    GuidPtr = &gEfiEventLegacyBootGuid
+  }
+#endif
+
+  //
+  // Convert EFI 1.10 Events to thier UEFI 2.0 CreateEventEx mapping
+  // 
+  if (Type == EVENT_SIGNAL_EXIT_BOOT_SERVICES) {
+    GuidPtr = &gEfiEventExitBootServicesGuid;
+  } else if (Type == EVENT_SIGNAL_VIRTUAL_ADDRESS_CHANGE) {
+    GuidPtr = &gEfiEventVirtualAddressChangeGuid;
+  }
+  
+  return CoreCreateEventEx (Type, NotifyTpl, Function, NotifyContext, GuidPtr, Event);
+}
+
+
+EFI_STATUS
+EFIAPI
+CoreCreateEventEx (
+  IN UINT32                   Type,
+  IN EFI_TPL                  NotifyTpl,
+  IN EFI_EVENT_NOTIFY         NotifyFunction, OPTIONAL
+  IN CONST VOID               *NotifyContext, OPTIONAL
+  IN CONST EFI_GUID           *EventGroup,    OPTIONAL
+  OUT EFI_EVENT               *Event
+  )
+/*++
+
+Routine Description:
+  Creates a general-purpose event structure
+
+Arguments:
+  Type                - The type of event to create and its mode and attributes
+  NotifyTpl           - The task priority level of event notifications
+  NotifyFunction      - Pointer to the events notification function
+  NotifyContext       - Pointer to the notification functions context; corresponds to
+                        parameter "Context" in the notification function
+  EventGrout          - GUID for EventGroup if NULL act the same as gBS->CreateEvent().
+  Event               - Pointer to the newly created event if the call succeeds; undefined otherwise
+
+Returns:
+  EFI_SUCCESS           - The event structure was created
+  EFI_INVALID_PARAMETER - One of the parameters has an invalid value
+  EFI_OUT_OF_RESOURCES  - The event could not be allocated
+
+--*/
+{
+  EFI_STATUS      Status;
+  IEVENT          *IEvent;
+  INTN            Index;
+
+
+  if ((Event == NULL) || (NotifyTpl == EFI_TPL_APPLICATION)) {
+    return EFI_INVALID_PARAMETER;
+  }
+
+  //
+  // Check to make sure no reserved flags are set
+  //
+  Status = EFI_INVALID_PARAMETER;
+  for (Index = 0; Index < (sizeof (mEventTable) / sizeof (UINT32)); Index++) {
+     if (Type == mEventTable[Index]) {
+       Status = EFI_SUCCESS;
+       break;
+     }
+  }
+  if(EFI_ERROR (Status)) {
+    return EFI_INVALID_PARAMETER;
+  }
+
+  //
+  // If it's a notify type of event, check its parameters
+  //
+  if ((Type & (EFI_EVENT_NOTIFY_WAIT | EFI_EVENT_NOTIFY_SIGNAL))) {
+    //
+    // Check for an invalid NotifyFunction or NotifyTpl
+    //
+    if ((NotifyFunction == NULL) || 
+        (NotifyTpl < EFI_TPL_APPLICATION) || 
+       (NotifyTpl >= EFI_TPL_HIGH_LEVEL)) {
+      return EFI_INVALID_PARAMETER;
+    }
+
+  } else {
+    //
+    // No notification needed, zero ignored values
+    //
+    NotifyTpl = 0;
+    NotifyFunction = NULL;
+    NotifyContext = NULL;
+  }
+
+  //
+  // Allcoate and initialize a new event structure.
+  //
+  Status = CoreAllocatePool (
+             (Type & EFI_EVENT_RUNTIME) ? EfiRuntimeServicesData: EfiBootServicesData, 
+             sizeof (IEVENT),
+             (VOID **)&IEvent
+             );
+  if (EFI_ERROR (Status)) {
+    return EFI_OUT_OF_RESOURCES;
+  }
+
+  SetMem (IEvent, sizeof (IEVENT), 0);
+
+  IEvent->Signature = EVENT_SIGNATURE;
+  IEvent->Type = Type;
+  
+  IEvent->NotifyTpl      = NotifyTpl;
+  IEvent->NotifyFunction = NotifyFunction;
+  IEvent->NotifyContext  = (VOID *)NotifyContext;
+  if (EventGroup != NULL) {
+    CopyGuid (&IEvent->EventGroup, EventGroup);
+    IEvent->ExFlag = TRUE;
+  }
+
+  *Event = IEvent;
+
+  if (Type & EFI_EVENT_RUNTIME) {
+    //
+    // Keep a list of all RT events so we can tell the RT AP.
+    //
+    InsertTailList (&mRuntimeEventList, &IEvent->RuntimeLink);
+  }
+
+  CoreAcquireEventLock ();
+  
+  if ((Type & EFI_EVENT_NOTIFY_SIGNAL) != 0x00000000) {
+    //
+    // The Event's NotifyFunction must be queued whenever the event is signaled
+    //
+    InsertHeadList (&gEventSignalQueue, &IEvent->SignalLink);
+  }
+  
+  CoreReleaseEventLock ();
+  
+  //
+  // Done
+  //
+  return EFI_SUCCESS;
+}
+
+
+
+EFI_STATUS
+EFIAPI
+CoreSignalEvent (
+  IN EFI_EVENT    UserEvent
+  )
+/*++
+
+Routine Description:
+
+  Signals the event.  Queues the event to be notified if needed
+    
+Arguments:
+
+  UserEvent - The event to signal
+    
+Returns:
+
+  EFI_INVALID_PARAMETER - Parameters are not valid.
+  
+  EFI_SUCCESS - The event was signaled.
+
+--*/
+{
+  IEVENT          *Event;
+
+  Event = UserEvent;
+
+  if (Event == NULL) {
+    return EFI_INVALID_PARAMETER;
+  }
+
+  if (Event->Signature != EVENT_SIGNATURE) {
+    return EFI_INVALID_PARAMETER;
+  }
+
+  CoreAcquireEventLock ();
+
+  //
+  // If the event is not already signalled, do so
+  //
+
+  if (Event->SignalCount == 0x00000000) {
+    Event->SignalCount++;
+
+    //
+    // If signalling type is a notify function, queue it
+    //
+    if (Event->Type & EFI_EVENT_NOTIFY_SIGNAL) {
+      if (Event->ExFlag) {
+        //
+        // The CreateEventEx() style requires all members of the Event Group 
+        //  to be signaled. 
+        //
+        CoreReleaseEventLock ();
+        CoreNotifySignalList (&Event->EventGroup);
+        CoreAcquireEventLock ();
+       } else {
+        CoreNotifyEvent (Event);
+      }
+    }
+  }
+
+  CoreReleaseEventLock ();
+  return EFI_SUCCESS;
+}
+
+
+EFI_STATUS
+EFIAPI
+CoreCheckEvent (
+  IN EFI_EVENT        UserEvent
+  )
+/*++
+
+Routine Description:
+
+  Check the status of an event
+    
+Arguments:
+
+  UserEvent - The event to check
+    
+Returns:
+
+  EFI_SUCCESS           - The event is in the signaled state
+  EFI_NOT_READY         - The event is not in the signaled state
+  EFI_INVALID_PARAMETER - Event is of type EVT_NOTIFY_SIGNAL
+
+--*/
+
+{
+  IEVENT      *Event;
+  EFI_STATUS  Status;
+
+  Event = UserEvent;
+
+  if (Event == NULL) {
+    return EFI_INVALID_PARAMETER;
+  }
+
+  if (Event->Signature != EVENT_SIGNATURE) {
+    return EFI_INVALID_PARAMETER;
+  }
+
+  if (Event->Type & EFI_EVENT_NOTIFY_SIGNAL) {
+    return EFI_INVALID_PARAMETER;
+  }
+
+  Status = EFI_NOT_READY;
+
+  if (!Event->SignalCount && (Event->Type & EFI_EVENT_NOTIFY_WAIT)) {
+
+    //
+    // Queue the wait notify function
+    //
+
+    CoreAcquireEventLock ();
+    if (!Event->SignalCount) {
+      CoreNotifyEvent (Event);
+    }
+    CoreReleaseEventLock ();
+  }
+
+  //
+  // If the even looks signalled, get the lock and clear it
+  //
+
+  if (Event->SignalCount) {
+    CoreAcquireEventLock ();
+
+    if (Event->SignalCount) {
+      Event->SignalCount = 0;
+      Status = EFI_SUCCESS;
+    }
+
+    CoreReleaseEventLock ();
+  }
+
+  return Status;
+}
+
+
+
+EFI_STATUS
+EFIAPI
+CoreWaitForEvent (
+  IN UINTN        NumberOfEvents,
+  IN EFI_EVENT    *UserEvents,
+  OUT UINTN       *UserIndex
+  )
+/*++
+
+Routine Description:
+
+  Stops execution until an event is signaled.
+    
+Arguments:
+
+  NumberOfEvents  - The number of events in the UserEvents array
+  UserEvents      - An array of EFI_EVENT
+  UserIndex       - Pointer to the index of the event which satisfied the wait condition
+    
+Returns:
+
+  EFI_SUCCESS           - The event indicated by Index was signaled.
+  EFI_INVALID_PARAMETER - The event indicated by Index has a notification function or 
+                          Event was not a valid type
+  EFI_UNSUPPORTED       - The current TPL is not TPL_APPLICATION
+
+--*/
+
+{
+  EFI_STATUS      Status;
+  UINTN           Index;
+
+  //
+  // Can only WaitForEvent at TPL_APPLICATION
+  //
+  if (gEfiCurrentTpl != EFI_TPL_APPLICATION) {
+    return EFI_UNSUPPORTED;
+  }
+
+  for(;;) {
+      
+    for(Index = 0; Index < NumberOfEvents; Index++) {
+
+      Status = CoreCheckEvent (UserEvents[Index]);
+
+      //
+      // provide index of event that caused problem
+      //
+      if (Status != EFI_NOT_READY) {
+        *UserIndex = Index;
+        return Status;
+      }
+    }
+
+    //
+    // This was the location of the Idle loop callback in EFI 1.x reference
+    // code. We don't have that concept in this base at this point.
+    // 
+  }
+}
+
+
+EFI_STATUS
+EFIAPI
+CoreCloseEvent (
+  IN EFI_EVENT    UserEvent
+  )
+/*++
+
+Routine Description:
+
+  Closes an event and frees the event structure.
+    
+Arguments:
+
+  UserEvent - Event to close
+    
+Returns:
+
+  EFI_INVALID_PARAMETER - Parameters are not valid.
+  
+  EFI_SUCCESS - The event has been closed
+
+--*/
+
+{
+  EFI_STATUS  Status;
+  IEVENT      *Event;
+
+  Event = UserEvent;
+
+  if (Event == NULL) {
+    return EFI_INVALID_PARAMETER;
+  }
+
+  if (Event->Signature != EVENT_SIGNATURE) {
+    return EFI_INVALID_PARAMETER;
+  }
+
+  //
+  // If it's a timer event, make sure it's not pending
+  //
+  if (Event->Type & EFI_EVENT_TIMER) {
+    CoreSetTimer (Event, TimerCancel, 0);
+  }
+
+  CoreAcquireEventLock ();
+
+  //
+  // If the event is queued somewhere, remove it
+  //
+
+  if (Event->RuntimeLink.ForwardLink != NULL) {
+    RemoveEntryList (&Event->RuntimeLink);
+  }
+
+  if (Event->NotifyLink.ForwardLink != NULL) {
+    RemoveEntryList (&Event->NotifyLink);
+  }
+
+  if (Event->SignalLink.ForwardLink != NULL) {
+    RemoveEntryList (&Event->SignalLink);
+  }
+
+  CoreReleaseEventLock ();
+
+  //
+  // If the event is registered on a protocol notify, then remove it from the protocol database
+  //
+  CoreUnregisterProtocolNotify (Event);
+
+  Status = CoreFreePool (Event);
+  ASSERT_EFI_ERROR (Status);
+
+  return Status;
+}
index a604fccf0873a0b791f127da29453203de656c05..3b5ae36e0d87e4d1d2d997bb0f13d64e6fc3b460 100644 (file)
@@ -1,63 +1,63 @@
-<?xml version="1.0" encoding="UTF-8"?>\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
-<ModuleBuildDescription xmlns="http://www.TianoCore.org/2006/Edk2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.TianoCore.org/2006/Edk2.0  http://www.TianoCore.org/2006/Edk2.0/SurfaceArea.xsd">\r
-  <MbdHeader>\r
-    <BaseName>DxeIpl</BaseName>\r
-    <Guid>86D70125-BAA3-4296-A62F-602BEBBB9081</Guid>\r
-    <Version>EDK_RELEASE_VERSION        0x00020000</Version>\r
-    <Description>FIX ME!</Description>\r
-    <Copyright>Copyright (c) 2004-2006, Intel Corporation</Copyright>\r
-    <License>\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
-      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
-    </License>\r
-    <Created>2006-03-12 17:09</Created>\r
-    <Modified>2006-03-22 18:54</Modified>\r
-  </MbdHeader>\r
-  <Libraries>\r
-    <Library>PeimEntryPoint</Library>\r
-    <Library>PeiMemoryLib</Library>\r
-    <Library>PeiCoreLib</Library>\r
-    <Library>PeiServicesTablePointerLib</Library>\r
-    <Library>PeiHobLib</Library>\r
-    <Library>BaseCacheMaintenanceLib</Library>\r
-    <Library>BaseUefiTianoDecompressLib</Library>\r
-    <Library>BaseCustomDecompressLibNull</Library>\r
-    <Library>PeiReportStatusCodeLib</Library>\r
-    <Library>BaseDebugLibReportStatusCode</Library>\r
-    <Library>BaseLib</Library>\r
-    <Library>PeiMemoryAllocationLib</Library>\r
-    <Arch ArchType="IA32">\r
-      <Library OverrideID="8888">EdkPeCoffLoaderLib</Library>\r
-      <Library OverrideID="8888">BasePeCoffLib</Library>\r
-    </Arch>\r
-    <Arch ArchType="X64">\r
-      <Library>EdkPeCoffLoaderLib</Library>\r
-      <Library>BasePeCoffLib</Library>\r
-    </Arch>\r
-    <Arch ArchType="IPF">\r
-      <Library>EdkPeCoffLoaderLib</Library>\r
-      <Library>BasePeCoffLib</Library>\r
-    </Arch>\r
-    <Arch ArchType="EBC">\r
-      <Library>EdkPeCoffLoaderLib</Library>\r
-      <Library>BasePeCoffLib</Library>\r
-    </Arch>\r
-  </Libraries>\r
-  <BuildOptions ToolChain="MSFT">\r
-    <ImageEntryPoint>_ModuleEntryPoint</ImageEntryPoint>\r
-  </BuildOptions>\r
-</ModuleBuildDescription>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Copyright (c) 2006, Intel Corporation
+All rights reserved. This program and the accompanying materials
+are licensed and made available under the terms and conditions of the BSD License
+which accompanies this distribution.  The full text of the license may be found at
+http://opensource.org/licenses/bsd-license.php
+
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+-->
+<ModuleBuildDescription xmlns="http://www.TianoCore.org/2006/Edk2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.TianoCore.org/2006/Edk2.0  http://www.TianoCore.org/2006/Edk2.0/SurfaceArea.xsd">
+  <MbdHeader>
+    <BaseName>DxeIpl</BaseName>
+    <Guid>86D70125-BAA3-4296-A62F-602BEBBB9081</Guid>
+    <Version>EDK_RELEASE_VERSION        0x00020000</Version>
+    <Description>FIX ME!</Description>
+    <Copyright>Copyright (c) 2004-2006, Intel Corporation</Copyright>
+    <License>
+      All rights reserved. This program and the accompanying materials
+      are licensed and made available under the terms and conditions of the BSD License
+      which accompanies this distribution.  The full text of the license may be found at
+      http://opensource.org/licenses/bsd-license.php
+      THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+      WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+    </License>
+    <Created>2006-03-12 17:09</Created>
+    <Modified>2006-03-22 18:54</Modified>
+  </MbdHeader>
+  <Libraries>
+    <Library>PeimEntryPoint</Library>
+    <Library>PeiMemoryLib</Library>
+    <Library>PeiCoreLib</Library>
+    <Library OverrideID="4444">PeiServicesTablePointerLib</Library>
+    <Library>PeiHobLib</Library>
+    <Library>BaseCacheMaintenanceLib</Library>
+    <Library>BaseUefiTianoDecompressLib</Library>
+    <Library>BaseCustomDecompressLibNull</Library>
+    <Library>PeiReportStatusCodeLib</Library>
+    <Library>BaseDebugLibReportStatusCode</Library>
+    <Library>BaseLib</Library>
+    <Library>PeiMemoryAllocationLib</Library>
+    <Arch ArchType="IA32">
+      <Library OverrideID="8888">EdkPeCoffLoaderLib</Library>
+      <Library OverrideID="8888">BasePeCoffLib</Library>
+    </Arch>
+    <Arch ArchType="X64">
+      <Library>EdkPeCoffLoaderLib</Library>
+      <Library>BasePeCoffLib</Library>
+    </Arch>
+    <Arch ArchType="IPF">
+      <Library>EdkPeCoffLoaderLib</Library>
+      <Library>BasePeCoffLib</Library>
+    </Arch>
+    <Arch ArchType="EBC">
+      <Library>EdkPeCoffLoaderLib</Library>
+      <Library>BasePeCoffLib</Library>
+    </Arch>
+  </Libraries>
+  <BuildOptions ToolChain="MSFT">
+    <ImageEntryPoint>_ModuleEntryPoint</ImageEntryPoint>
+  </BuildOptions>
+</ModuleBuildDescription>
index 2df91ecde8c3856fe9687eff1f1a297a08bf5c6a..ef039fc800d9c9e5eb3e7eb4a35a2f6c5261789e 100644 (file)
@@ -1,49 +1,49 @@
-<?xml version="1.0" encoding="UTF-8"?>\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
-<ModuleBuildDescription xmlns="http://www.TianoCore.org/2006/Edk2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.TianoCore.org/2006/Edk2.0  http://www.TianoCore.org/2006/Edk2.0/SurfaceArea.xsd">\r
-  <MbdHeader>\r
-    <BaseName>DxeIpl</BaseName>\r
-    <Guid>86D70125-BAA3-4296-A62F-602BEBBB9081</Guid>\r
-    <Version>EDK_RELEASE_VERSION        0x00020000</Version>\r
-    <Description>FIX ME!</Description>\r
-    <Copyright>Copyright 2004-2006, Intel Corporation</Copyright>\r
-    <License>\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
-      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
-    </License>\r
-    <Created>2006-04-03 23:58</Created>\r
-  </MbdHeader>\r
-  <Libraries>\r
-    <Library>PeimEntryPoint</Library>\r
-    <Library>PeiMemoryLib</Library>\r
-    <Library>PeiCoreLib</Library>\r
-    <Library>PeiServicesTablePointerLib</Library>\r
-    <Library>PeiHobLib</Library>\r
-    <Library>BaseCacheMaintenanceLib</Library>\r
-    <Library>BaseUefiTianoDecompressLib</Library>\r
-    <Library>BaseCustomDecompressLibNull</Library>\r
-    <Library>PeiReportStatusCodeLib</Library>\r
-    <Library>BaseDebugLibReportStatusCode</Library>\r
-    <Library>BaseLib</Library>\r
-    <Library>PeiMemoryAllocationLib</Library>\r
-    <Library>PeiReportStatusCodeLib</Library>\r
-    <Arch ArchType="IA32" OverrideID="8888">\r
-      <Library>EdkPeCoffLoaderX64Lib</Library>\r
-      <Library>EdkPeCoffLoaderLib</Library>\r
-      <Library>BasePeCoffLib</Library>\r
-    </Arch>\r
-  </Libraries>\r
-</ModuleBuildDescription>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Copyright (c) 2006, Intel Corporation
+All rights reserved. This program and the accompanying materials
+are licensed and made available under the terms and conditions of the BSD License
+which accompanies this distribution.  The full text of the license may be found at
+http://opensource.org/licenses/bsd-license.php
+
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+-->
+<ModuleBuildDescription xmlns="http://www.TianoCore.org/2006/Edk2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.TianoCore.org/2006/Edk2.0  http://www.TianoCore.org/2006/Edk2.0/SurfaceArea.xsd">
+  <MbdHeader>
+    <BaseName>DxeIplX64</BaseName>
+    <Guid>86D70125-BAA3-4296-A62F-602BEBBB9081</Guid>
+    <Version>EDK_RELEASE_VERSION        0x00020000</Version>
+    <Description>FIX ME!</Description>
+    <Copyright>Copyright 2004-2006, Intel Corporation</Copyright>
+    <License>
+      All rights reserved. This program and the accompanying materials
+      are licensed and made available under the terms and conditions of the BSD License
+      which accompanies this distribution.  The full text of the license may be found at
+      http://opensource.org/licenses/bsd-license.php
+      THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+      WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+    </License>
+    <Created>2006-04-03 23:58</Created>
+  </MbdHeader>
+  <Libraries>
+    <Library>PeimEntryPoint</Library>
+    <Library>PeiMemoryLib</Library>
+    <Library>PeiCoreLib</Library>
+    <Library OverrideID="4444">PeiServicesTablePointerLib</Library>
+    <Library>PeiHobLib</Library>
+    <Library>BaseCacheMaintenanceLib</Library>
+    <Library>BaseUefiTianoDecompressLib</Library>
+    <Library>BaseCustomDecompressLibNull</Library>
+    <Library>BaseDebugLibReportStatusCode</Library>
+    <Library>BaseLib</Library>
+    <Library>PeiMemoryAllocationLib</Library>
+    <Library>PeiReportStatusCodeLib</Library>
+    <Library>EdkPeCoffLoaderX64Lib</Library>
+    <Library>EdkPeCoffLoaderLib</Library>
+    <Library>BasePeCoffLib</Library>
+  </Libraries>
+  <BuildOptions ToolChain="MSFT">
+    <ImageEntryPoint>_ModuleEntryPoint</ImageEntryPoint>
+  </BuildOptions>
+</ModuleBuildDescription>
index e69b824e10df2a3e67e72638efe316d6ec5b6639..638809dcd27ba3121f536bbc50f8a137bf7525cd 100644 (file)
-<?xml version="1.0" encoding="UTF-8"?>\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
-<ModuleSurfaceArea xmlns="http://www.TianoCore.org/2006/Edk2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.TianoCore.org/2006/Edk2.0  http://www.TianoCore.org/2006/Edk2.0/SurfaceArea.xsd">\r
-  <MsaHeader>\r
-    <BaseName>DxeIpl</BaseName>\r
-    <ModuleType>PEIM</ModuleType>\r
-    <ComponentType>PE32_PEIM</ComponentType>\r
-    <Guid>86D70125-BAA3-4296-A62F-602BEBBB9081</Guid>\r
-    <Version>EDK_RELEASE_VERSION        0x00020000</Version>\r
-    <Abstract>Component description file for DxeIpl module</Abstract>\r
-    <Description>FIX ME!</Description>\r
-    <Copyright>Copyright 2004-2006, Intel Corporation</Copyright>\r
-    <License>\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
-      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
-    </License>\r
-    <Specification>EFI_SPECIFICATION_VERSION    0x00000000</Specification>\r
-    <Created>2006-04-03 23:58</Created>\r
-  </MsaHeader>\r
-  <LibraryClassDefinitions>\r
-    <LibraryClass Usage="ALWAYS_CONSUMED">DebugLib</LibraryClass>\r
-    <LibraryClass Usage="ALWAYS_CONSUMED">PeimEntryPoint</LibraryClass>\r
-    <LibraryClass Usage="ALWAYS_CONSUMED">BaseLib</LibraryClass>\r
-    <LibraryClass Usage="ALWAYS_CONSUMED">HobLib</LibraryClass>\r
-    <LibraryClass Usage="ALWAYS_CONSUMED">PerformanceLib</LibraryClass>\r
-    <LibraryClass Usage="ALWAYS_CONSUMED">PeiCoreLib</LibraryClass>\r
-    <LibraryClass Usage="ALWAYS_CONSUMED">ReportStatusCodeLib</LibraryClass>\r
-    <LibraryClass Usage="ALWAYS_CONSUMED">CacheMaintenanceLib</LibraryClass>\r
-    <LibraryClass Usage="ALWAYS_CONSUMED">EdkPeCoffLoaderLib</LibraryClass>\r
-    <LibraryClass Usage="ALWAYS_CONSUMED">UefiDecompressLib</LibraryClass>\r
-    <LibraryClass Usage="ALWAYS_CONSUMED">TianoDecompressLib</LibraryClass>\r
-    <LibraryClass Usage="ALWAYS_CONSUMED">CustomDecompressLib</LibraryClass>\r
-    <LibraryClass Usage="ALWAYS_CONSUMED">PeiServicesTablePointerLib</LibraryClass>\r
-    <LibraryClass Usage="ALWAYS_CONSUMED">BaseMemoryLib</LibraryClass>\r
-    <LibraryClass Usage="ALWAYS_CONSUMED">MemoryAllocationLib</LibraryClass>\r
-    <LibraryClass Usage="ALWAYS_CONSUMED">EdkPeCoffLoaderX64Lib</LibraryClass>\r
-  </LibraryClassDefinitions>\r
-  <SourceFiles>\r
-    <Filename>DxeIpl.dxs</Filename>\r
-    <Filename>DxeLoadX64.c</Filename>\r
-    <Arch ArchType="IA32">\r
-      <Filename>x64/ImageRead.c</Filename>\r
-      <Filename>x64/LongMode.asm</Filename>\r
-      <Filename>x64/DxeLoadFunc.c</Filename>\r
-      <Filename>x64/VirtualMemory.c</Filename>\r
-    </Arch>\r
-  </SourceFiles>\r
-  <Includes>\r
-    <PackageName>MdePkg</PackageName>\r
-    <PackageName>EdkModulePkg</PackageName>\r
-  </Includes>\r
-  <Protocols>\r
-    <Protocol Usage="ALWAYS_CONSUMED">Decompress</Protocol>\r
-    <Protocol Usage="ALWAYS_CONSUMED">TianoDecompress</Protocol>\r
-    <Protocol Usage="ALWAYS_CONSUMED">CustomizedDecompress</Protocol>\r
-  </Protocols>\r
-  <PPIs>\r
-    <Ppi Usage="ALWAYS_CONSUMED">PeiInMemory</Ppi>\r
-    <Ppi Usage="ALWAYS_CONSUMED">RecoveryModule</Ppi>\r
-    <Ppi Usage="ALWAYS_CONSUMED">SectionExtraction</Ppi>\r
-    <Ppi Usage="ALWAYS_CONSUMED">Security</Ppi>\r
-    <Ppi Usage="ALWAYS_CONSUMED">DxeIpl</Ppi>\r
-    <Ppi Usage="ALWAYS_CONSUMED">S3Resume</Ppi>\r
-    <Ppi Usage="ALWAYS_CONSUMED">EndOfPeiSignal</Ppi>\r
-    <Ppi Usage="ALWAYS_CONSUMED">FvFileLoader</Ppi>\r
-  </PPIs>\r
-  <Guids>\r
-    <GuidEntry Usage="ALWAYS_CONSUMED">\r
-      <C_Name>PeiPeCoffLoader</C_Name>\r
-    </GuidEntry>\r
-  </Guids>\r
-</ModuleSurfaceArea>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Copyright (c) 2006, Intel Corporation
+All rights reserved. This program and the accompanying materials
+are licensed and made available under the terms and conditions of the BSD License
+which accompanies this distribution.  The full text of the license may be found at
+http://opensource.org/licenses/bsd-license.php
+
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+-->
+<ModuleSurfaceArea xmlns="http://www.TianoCore.org/2006/Edk2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.TianoCore.org/2006/Edk2.0  http://www.TianoCore.org/2006/Edk2.0/SurfaceArea.xsd">
+  <MsaHeader>
+    <BaseName>DxeIplX64</BaseName>
+    <ModuleType>PEIM</ModuleType>
+    <ComponentType>PE32_PEIM</ComponentType>
+    <Guid>86D70125-BAA3-4296-A62F-602BEBBB9081</Guid>
+    <Version>EDK_RELEASE_VERSION        0x00020000</Version>
+    <Abstract>Component description file for DxeIpl module</Abstract>
+    <Description>FIX ME!</Description>
+    <Copyright>Copyright 2004-2006, Intel Corporation</Copyright>
+    <License>
+      All rights reserved. This program and the accompanying materials
+      are licensed and made available under the terms and conditions of the BSD License
+      which accompanies this distribution.  The full text of the license may be found at
+      http://opensource.org/licenses/bsd-license.php
+      THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+      WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+    </License>
+    <Specification>EFI_SPECIFICATION_VERSION    0x00000000</Specification>
+    <Created>2006-04-03 23:58</Created>
+  </MsaHeader>
+  <LibraryClassDefinitions>
+    <LibraryClass Usage="ALWAYS_CONSUMED">DebugLib</LibraryClass>
+    <LibraryClass Usage="ALWAYS_CONSUMED">PeimEntryPoint</LibraryClass>
+    <LibraryClass Usage="ALWAYS_CONSUMED">BaseLib</LibraryClass>
+    <LibraryClass Usage="ALWAYS_CONSUMED">HobLib</LibraryClass>
+    <LibraryClass Usage="ALWAYS_CONSUMED">PerformanceLib</LibraryClass>
+    <LibraryClass Usage="ALWAYS_CONSUMED">PeiCoreLib</LibraryClass>
+    <LibraryClass Usage="ALWAYS_CONSUMED">ReportStatusCodeLib</LibraryClass>
+    <LibraryClass Usage="ALWAYS_CONSUMED">CacheMaintenanceLib</LibraryClass>
+    <LibraryClass Usage="ALWAYS_CONSUMED">EdkPeCoffLoaderLib</LibraryClass>
+    <LibraryClass Usage="ALWAYS_CONSUMED">UefiDecompressLib</LibraryClass>
+    <LibraryClass Usage="ALWAYS_CONSUMED">TianoDecompressLib</LibraryClass>
+    <LibraryClass Usage="ALWAYS_CONSUMED">CustomDecompressLib</LibraryClass>
+    <LibraryClass Usage="ALWAYS_CONSUMED">PeiServicesTablePointerLib</LibraryClass>
+    <LibraryClass Usage="ALWAYS_CONSUMED">BaseMemoryLib</LibraryClass>
+    <LibraryClass Usage="ALWAYS_CONSUMED">MemoryAllocationLib</LibraryClass>
+    <LibraryClass Usage="ALWAYS_CONSUMED">EdkPeCoffLoaderX64Lib</LibraryClass>
+  </LibraryClassDefinitions>
+  <SourceFiles>
+    <Filename>DxeIpl.dxs</Filename>
+    <Filename>DxeLoadX64.c</Filename>
+    <Arch ArchType="IA32">
+      <Filename>x64/ImageRead.c</Filename>
+      <Filename>x64/LongMode.asm</Filename>
+      <Filename>x64/DxeLoadFunc.c</Filename>
+      <Filename>x64/VirtualMemory.c</Filename>
+    </Arch>
+  </SourceFiles>
+  <Includes>
+    <PackageName>MdePkg</PackageName>
+    <PackageName>EdkModulePkg</PackageName>
+  </Includes>
+  <Protocols>
+    <Protocol Usage="ALWAYS_CONSUMED">Decompress</Protocol>
+    <Protocol Usage="ALWAYS_CONSUMED">TianoDecompress</Protocol>
+    <Protocol Usage="ALWAYS_CONSUMED">CustomizedDecompress</Protocol>
+  </Protocols>
+  <Hobs>
+    <Hob Usage="SOMETIMES_PRODUCED" HobType="MEMORY_ALLOCATION">
+      <C_Name>gEfiHobMemoryAllocBspStoreGuid</C_Name>
+      <Guid>0x564b33cd, 0xc92a, 0x4593, 0x90, 0xbf, 0x24, 0x73, 0xe4, 0x3c, 0x63, 0x22</Guid>
+    </Hob>
+    <Hob Usage="SOMETIMES_PRODUCED" HobType="GUID_EXTENSION">
+      <C_Name>gEfiDecompressProtocolGuid</C_Name>
+      <Guid>0xd8117cfe, 0x94a6, 0x11d4, 0x9a, 0x3a, 0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d</Guid>
+    </Hob>
+    <Hob Usage="SOMETIMES_PRODUCED" HobType="GUID_EXTENSION">
+      <C_Name>gEfiTianoDecompressProtocolGuid</C_Name>
+      <Guid>0xe84cf29c, 0x191f, 0x4eae, 0x96, 0xe1, 0xf4, 0x6a, 0xec, 0xea, 0xea, 0x0b</Guid>
+    </Hob>
+    <Hob Usage="SOMETIMES_PRODUCED" HobType="GUID_EXTENSION">
+      <C_Name>gEfiCustomizedDecompressProtocolGuid</C_Name>
+      <Guid>0x9a44198e, 0xa4a2, 0x44e6, 0x8a, 0x1f, 0x39, 0xbe, 0xfd, 0xac, 0x89, 0x6f</Guid>
+    </Hob>
+    <Hob Usage="SOMETIMES_PRODUCED" HobType="GUID_EXTENSION">
+      <C_Name>gEfiPeiPeCoffLoaderGuid</C_Name>
+      <Guid>0xd8117cff, 0x94a6, 0x11d4, 0x9a, 0x3a, 0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d</Guid>
+    </Hob>
+    <Hob Usage="SOMETIMES_PRODUCED" HobType="MEMORY_ALLOCATION">
+      <C_Name>gEfiHobMemoryAllocModuleGuid</C_Name>
+      <Guid>0xf8e21975, 0x0899, 0x4f58, 0xa4, 0xbe, 0x55, 0x25, 0xa9, 0xc6, 0xd7, 0x7a</Guid>
+    </Hob>
+    <Hob Usage="SOMETIMES_PRODUCED" HobType="FIRMWARE_VOLUME">
+      <Name>DecompressedFvmain.fv</Name>
+    </Hob>
+  </Hobs>
+  <PPIs>
+    <Ppi Usage="SOMETIMES_PRODUCED">DxeIpl</Ppi>
+    <Ppi Usage="SOMETIMES_PRODUCED">FvFileLoader</Ppi>
+    <Ppi Usage="SOMETIMES_PRODUCED">EndOfPeiSignal</Ppi>
+    <Ppi Usage="SOMETIMES_CONSUMED">RecoveryModule</Ppi>
+    <Ppi Usage="SOMETIMES_CONSUMED">S3Resume</Ppi>
+    <Ppi Usage="SOMETIMES_CONSUMED">SectionExtraction</Ppi>
+    <Ppi Usage="SOMETIMES_CONSUMED">Security</Ppi>
+    <Ppi Usage="PRIVATE">PeiInMemory</Ppi>
+  </PPIs>
+  <Guids>
+    <GuidEntry Usage="ALWAYS_CONSUMED">
+      <C_Name>PeiPeCoffLoader</C_Name>
+    </GuidEntry>
+  </Guids>
+  <Externs>
+    <Extern>
+      <ModuleEntryPoint>PeimInitializeDxeIpl</ModuleEntryPoint>
+    </Extern>
+  </Externs>
+  <BuildOptions ToolChain="MSFT">
+    <ImageEntryPoint>_ModuleEntryPoint</ImageEntryPoint>
+  </BuildOptions>
+</ModuleSurfaceArea>
index 6727bf4ca776c153b47c9f3ace0851abd9e549e2..e0dbe84c3611dc686c82d15fc6488a833d01d4ad 100644 (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:\r
-\r
-  DxeLoad.c\r
-\r
-Abstract:\r
-\r
-  Last PEIM.\r
-  Responsibility of this module is to load the DXE Core from a Firmware Volume.\r
-\r
---*/\r
-\r
-#include <DxeIpl.h>\r
-\r
-#pragma warning( disable : 4305 )\r
-\r
-BOOLEAN gInMemory = FALSE;\r
-\r
-//\r
-// GUID for EM64T\r
-//\r
-#define EFI_PPI_NEEDED_BY_DXE \\r
-  { \\r
-    0x4d37da42, 0x3a0c, 0x4eda, 0xb9, 0xeb, 0xbc, 0x0e, 0x1d, 0xb4, 0x71, 0x3b \\r
-  }\r
-EFI_GUID mPpiNeededByDxeGuid = EFI_PPI_NEEDED_BY_DXE;\r
-\r
-//\r
-// Module Globals used in the DXE to PEI handoff\r
-// These must be module globals, so the stack can be switched\r
-//\r
-static EFI_DXE_IPL_PPI mDxeIplPpi = {\r
-  DxeLoadCore\r
-};\r
-\r
-static EFI_PEI_FV_FILE_LOADER_PPI mLoadFilePpi = {\r
-  DxeIplLoadFile\r
-};\r
-\r
-static EFI_PEI_PPI_DESCRIPTOR     mPpiLoadFile = {\r
-  (EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST),\r
-  &gEfiPeiFvFileLoaderPpiGuid,\r
-  &mLoadFilePpi\r
-};\r
-\r
-static EFI_PEI_PPI_DESCRIPTOR     mPpiList = {\r
-  (EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST),\r
-  &gEfiDxeIplPpiGuid,\r
-  &mDxeIplPpi\r
-};\r
-\r
-static EFI_PEI_PPI_DESCRIPTOR     mPpiPeiInMemory = {\r
-  (EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST),\r
-  &gPeiInMemoryGuid,\r
-  NULL\r
-};\r
-\r
-static EFI_PEI_PPI_DESCRIPTOR     mPpiSignal = {\r
-  (EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST),\r
-  &gEfiEndOfPeiSignalPpiGuid,\r
-  NULL\r
-};\r
-\r
-DECOMPRESS_LIBRARY  gEfiDecompress = {\r
-  UefiDecompressGetInfo,\r
-  UefiDecompress\r
-};\r
-\r
-DECOMPRESS_LIBRARY  gTianoDecompress = {\r
-  TianoDecompressGetInfo,\r
-  TianoDecompress\r
-};\r
-\r
-DECOMPRESS_LIBRARY  gCustomDecompress = {\r
-  CustomDecompressGetInfo,\r
-  CustomDecompress\r
-};\r
-\r
-STATIC\r
-UINTN\r
-GetOccupiedSize (\r
-  IN UINTN   ActualSize,\r
-  IN UINTN   Alignment\r
-  )\r
-{\r
-  UINTN OccupiedSize;\r
-\r
-  OccupiedSize = ActualSize;\r
-  while ((OccupiedSize & (Alignment - 1)) != 0) {\r
-    OccupiedSize++;\r
-  }\r
-\r
-  return OccupiedSize;\r
-}\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-PeimInitializeDxeIpl (\r
-  IN EFI_FFS_FILE_HEADER       *FfsHeader,\r
-  IN EFI_PEI_SERVICES          **PeiServices\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Initializes the Dxe Ipl PPI\r
-\r
-Arguments:\r
-\r
-  FfsHeader   - Pointer to FFS file header\r
-  PeiServices - General purpose services available to every PEIM.\r
-\r
-Returns:\r
-\r
-  EFI_SUCCESS\r
-\r
---*/\r
-{\r
-  EFI_STATUS                                Status;\r
-  EFI_PEI_PE_COFF_LOADER_PROTOCOL           *PeiEfiPeiPeCoffLoader;\r
-  EFI_BOOT_MODE                             BootMode;\r
-\r
-  Status = PeiCoreGetBootMode (&BootMode);\r
-\r
-  ASSERT_EFI_ERROR (Status);\r
-\r
-  Status = PeiCoreLocatePpi (\r
-             &gPeiInMemoryGuid,\r
-             0,\r
-             NULL,\r
-             NULL\r
-             );\r
-\r
-  if (EFI_ERROR (Status) && (BootMode != BOOT_ON_S3_RESUME)) {   \r
-    //\r
-    // The DxeIpl has not yet been shadowed\r
-    //\r
-    PeiEfiPeiPeCoffLoader = (EFI_PEI_PE_COFF_LOADER_PROTOCOL *)GetPeCoffLoaderProtocol ();\r
-\r
-    //\r
-    // Shadow DxeIpl and then re-run its entry point\r
-    //\r
-    Status = ShadowDxeIpl (FfsHeader, PeiEfiPeiPeCoffLoader);\r
-    if (EFI_ERROR (Status)) {\r
-      return Status;\r
-    }\r
-\r
-  } else {\r
-    if (BootMode != BOOT_ON_S3_RESUME) {\r
-    //\r
-    // The DxeIpl has been shadowed\r
-    //\r
-    gInMemory = TRUE;\r
-\r
-    //\r
-    // Install LoadFile PPI\r
-    //\r
-    Status = PeiCoreInstallPpi (&mPpiLoadFile);\r
-\r
-    if (EFI_ERROR (Status)) {\r
-      return Status;\r
-      }\r
-    }\r
-    //\r
-    // Install DxeIpl PPI\r
-    //\r
-    PeiCoreInstallPpi (&mPpiList);\r
-\r
-    if (EFI_ERROR (Status)) {\r
-      return Status;\r
-    }\r
-\r
-  }\r
-\r
-  return EFI_SUCCESS;\r
-}\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-DxeLoadCore (\r
-  IN EFI_DXE_IPL_PPI       *This,\r
-  IN EFI_PEI_SERVICES      **PeiServices,\r
-  IN EFI_PEI_HOB_POINTERS  HobList\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Main entry point to last PEIM\r
-\r
-Arguments:\r
-\r
-  This         - Entry point for DXE IPL PPI\r
-  PeiServices  - General purpose services available to every PEIM.\r
-  HobList      - Address to the Pei HOB list\r
-\r
-Returns:\r
-\r
-  EFI_SUCCESS          - DEX core was successfully loaded.\r
-  EFI_OUT_OF_RESOURCES - There are not enough resources to load DXE core.\r
-\r
---*/\r
-{\r
-  EFI_STATUS                                                Status;\r
-  EFI_PHYSICAL_ADDRESS                                      TopOfStack;\r
-  EFI_PHYSICAL_ADDRESS                                      BaseOfStack;\r
-  EFI_PHYSICAL_ADDRESS                                      BspStore;\r
-  EFI_GUID                                                  DxeCoreFileName;\r
-  VOID                                                      *DxeCorePe32Data;\r
-  EFI_PHYSICAL_ADDRESS                                      DxeCoreAddress;\r
-  UINT64                                                    DxeCoreSize;\r
-  EFI_PHYSICAL_ADDRESS                                      DxeCoreEntryPoint;\r
-  VOID                                                      *PpisNeededByDxePe32Data;\r
-  EFI_PHYSICAL_ADDRESS                                      PpisNeededByDxeAddress;\r
-  UINT64                                                    PpisNeededByDxeSize;\r
-  EFI_PHYSICAL_ADDRESS                                      PpisNeededByDxeEntryPoint;\r
-  EFI_PEI_PE_COFF_LOADER_PROTOCOL                           *PeiEfiPeiPeCoffLoader;\r
-  EFI_BOOT_MODE                                             BootMode;\r
-  EFI_PEI_RECOVERY_MODULE_PPI                               *PeiRecovery;\r
-  EFI_PEI_S3_RESUME_PPI                                     *S3Resume;\r
-  EFI_PHYSICAL_ADDRESS                                      PageTables;\r
-  \r
-  TopOfStack  = 0;\r
-  BaseOfStack = 0;\r
-  BspStore    = 0;\r
-  Status      = EFI_SUCCESS;\r
-\r
-  //\r
-  // if in S3 Resume, restore configure\r
-  //\r
-  Status = PeiCoreGetBootMode (&BootMode);\r
-\r
-  if (!EFI_ERROR (Status) && (BootMode == BOOT_ON_S3_RESUME)) {\r
-    Status = PeiCoreLocatePpi (\r
-               &gEfiPeiS3ResumePpiGuid,\r
-               0,\r
-               NULL,\r
-               (VOID **)&S3Resume\r
-               );\r
-\r
-    ASSERT_EFI_ERROR (Status);\r
-\r
-    Status = S3Resume->S3RestoreConfig (PeiServices);\r
-\r
-    ASSERT_EFI_ERROR (Status);\r
-  }\r
-\r
-  Status = EFI_SUCCESS;\r
-\r
-  //\r
-  // Install the PEI Protocols that are shared between PEI and DXE\r
-  //\r
-#ifdef EFI_NT_EMULATOR\r
-  PeiEfiPeiPeCoffLoader = (EFI_PEI_PE_COFF_LOADER_PROTOCOL *)GetPeCoffLoaderProtocol ();\r
-  ASSERT (PeiEfiPeiPeCoffLoader != NULL);\r
-#else\r
-  PeiEfiPeiPeCoffLoader = (EFI_PEI_PE_COFF_LOADER_PROTOCOL *)GetPeCoffLoaderX64Protocol ();\r
-#endif \r
-\r
-#if 0\r
-  Status = InstallEfiPeiPeCoffLoader64 (PeiServices, &PeiEfiPeiPeCoffLoader, NULL);\r
-  ASSERT_EFI_ERROR (Status);\r
-#endif\r
-  //\r
-  // Allocate 128KB for the Stack\r
-  //\r
-  PeiCoreAllocatePages (EfiBootServicesData, EFI_SIZE_TO_PAGES (STACK_SIZE), &BaseOfStack);\r
-  ASSERT (BaseOfStack != 0);\r
-\r
-  //\r
-  // Compute the top of the stack we were allocated. Pre-allocate a 32 bytes\r
-  // for safety (PpisNeededByDxe and DxeCore).\r
-  //\r
-  TopOfStack = BaseOfStack + EFI_SIZE_TO_PAGES (STACK_SIZE) * EFI_PAGE_SIZE - 32;\r
-\r
-  //\r
-  // Add architecture-specifc HOBs (including the BspStore HOB)\r
-  //\r
-  Status = CreateArchSpecificHobs (&BspStore);\r
-  ASSERT_EFI_ERROR (Status);\r
-\r
-  //\r
-  // See if we are in crisis recovery\r
-  //\r
-  Status = PeiCoreGetBootMode (&BootMode);\r
-  if (!EFI_ERROR (Status) && (BootMode == BOOT_IN_RECOVERY_MODE)) {\r
-    Status = PeiCoreLocatePpi (\r
-               &gEfiPeiRecoveryModulePpiGuid,\r
-               0,\r
-               NULL,\r
-               (VOID **)&PeiRecovery\r
-               );\r
-\r
-    ASSERT_EFI_ERROR (Status);\r
-    Status = PeiRecovery->LoadRecoveryCapsule (PeiServices, PeiRecovery);\r
-    ASSERT_EFI_ERROR (Status);\r
-  }\r
-\r
-  //\r
-  // Find the DXE Core in a Firmware Volume\r
-  //\r
-  Status = PeiFindFile (\r
-             EFI_FV_FILETYPE_DXE_CORE,\r
-             EFI_SECTION_PE32,\r
-             &DxeCoreFileName,\r
-             &DxeCorePe32Data\r
-             );\r
-  ASSERT_EFI_ERROR (Status);\r
-\r
-  //\r
-  // Find the PpisNeededByDxe in a Firmware Volume\r
-  //\r
-  Status = PeiFindFile (\r
-             EFI_FV_FILETYPE_ALL,\r
-             EFI_SECTION_PE32,\r
-             &mPpiNeededByDxeGuid,\r
-             &PpisNeededByDxePe32Data\r
-             );\r
-  ASSERT_EFI_ERROR (Status);\r
-\r
-  //\r
-  // Transfer control to the DXE Core\r
-  // The handoff state is simply a pointer to the HOB list\r
-  //\r
-  // PEI_PERF_END (PeiServices, L"DxeIpl", NULL, 0);\r
-\r
-  Status = PeiCoreInstallPpi (&mPpiSignal);\r
-  ASSERT_EFI_ERROR (Status);\r
-\r
-  //\r
-  // Load the GDT of Go64. Since the GDT of 32-bit Tiano locates in the BS_DATA \\r
-  // memory, it may be corrupted when copying FV to high-end memory \r
-  LoadGo64Gdt();\r
-\r
-  //\r
-  // Limit to 36 bits of addressing for debug. Should get it from CPU\r
-  //\r
-  PageTables = CreateIdentityMappingPageTables (36);\r
-\r
-  //\r
-  // Load the PpiNeededByDxe from a Firmware Volume\r
-  //\r
-  Status = PeiLoadx64File (\r
-             PeiEfiPeiPeCoffLoader,\r
-             PpisNeededByDxePe32Data,\r
-             EfiBootServicesData,\r
-             &PpisNeededByDxeAddress,\r
-             &PpisNeededByDxeSize,\r
-             &PpisNeededByDxeEntryPoint\r
-             );\r
-  ASSERT_EFI_ERROR (Status);\r
-\r
-\r
-  //\r
-  // Load the DXE Core from a Firmware Volume\r
-  //\r
-  Status = PeiLoadx64File (\r
-             PeiEfiPeiPeCoffLoader,\r
-             DxeCorePe32Data,\r
-             EfiBootServicesData,\r
-             &DxeCoreAddress,\r
-             &DxeCoreSize,\r
-             &DxeCoreEntryPoint\r
-             );\r
-  ASSERT_EFI_ERROR (Status);\r
-\r
-  //\r
-  //\r
-  // Add HOB for the DXE Core\r
-  //\r
-  BuildModuleHob (\r
-    &DxeCoreFileName,\r
-    DxeCoreAddress,\r
-    DxeCoreSize,\r
-    DxeCoreEntryPoint\r
-    );\r
-\r
-  //\r
-  // Report Status Code EFI_SW_PEI_PC_HANDOFF_TO_NEXT\r
-  //\r
-  REPORT_STATUS_CODE (\r
-    EFI_PROGRESS_CODE,\r
-    EFI_SOFTWARE_PEI_MODULE | EFI_SW_PEI_CORE_PC_HANDOFF_TO_NEXT\r
-    );\r
-\r
-  DEBUG ((EFI_D_INFO, "DXE Core Entry\n"));\r
-  //\r
-  // Go to Long Mode. Interrupts will not get turned on until the CPU AP is loaded.\r
-  // Call x64 drivers passing in single argument, a pointer to the HOBs.\r
-  //\r
-  ActivateLongMode (\r
-    PageTables, \r
-    (EFI_PHYSICAL_ADDRESS)(UINTN)(HobList.Raw), \r
-    TopOfStack,\r
-    PpisNeededByDxeEntryPoint,\r
-    DxeCoreEntryPoint\r
-    );\r
-\r
-  //\r
-  // If we get here, then the DXE Core returned.  This is an error\r
-  //\r
-  ASSERT_EFI_ERROR (Status);\r
-\r
-  return EFI_OUT_OF_RESOURCES;\r
-}\r
-\r
-EFI_STATUS\r
-PeiFindFile (\r
-  IN  UINT8                  Type,\r
-  IN  UINT16                 SectionType,\r
-  OUT EFI_GUID               *FileName,\r
-  OUT VOID                   **Pe32Data\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Finds a PE/COFF of a specific Type and SectionType in the Firmware Volumes\r
-  described in the HOB list. Able to search in a compression set in a FFS file.\r
-  But only one level of compression is supported, that is, not able to search\r
-  in a compression set that is within another compression set.\r
-\r
-Arguments:\r
-\r
-  Type        - The Type of file to retrieve\r
-\r
-  SectionType - The type of section to retrieve from a file\r
-\r
-  FileName    - The name of the file found in the Firmware Volume\r
-\r
-  Pe32Data    - Pointer to the beginning of the PE/COFF file found in the Firmware Volume\r
-\r
-Returns:\r
-\r
-  EFI_SUCCESS   - The file was found, and the name is returned in FileName, and a pointer to\r
-                  the PE/COFF image is returned in Pe32Data\r
-\r
-  EFI_NOT_FOUND - The file was not found in the Firmware Volumes present in the HOB List\r
-\r
---*/\r
-{\r
-  EFI_FIRMWARE_VOLUME_HEADER  *FwVolHeader;\r
-  EFI_FFS_FILE_HEADER         *FfsFileHeader;\r
-  VOID                        *SectionData;\r
-  EFI_STATUS                  Status;\r
-  EFI_PEI_HOB_POINTERS        Hob;\r
-\r
-\r
-  FwVolHeader   = NULL;\r
-  FfsFileHeader = NULL;\r
-  SectionData   = NULL;\r
-\r
-  //\r
-  // Foreach Firmware Volume, look for a specified type\r
-  // of file and break out when one is found\r
-  //\r
-  Hob.Raw = GetHobList ();\r
-  while ((Hob.Raw = GetNextHob (EFI_HOB_TYPE_FV, Hob.Raw)) != NULL) {\r
-    FwVolHeader = (EFI_FIRMWARE_VOLUME_HEADER *) (UINTN) (Hob.FirmwareVolume->BaseAddress);\r
-    Status = PeiCoreFfsFindNextFile (\r
-               Type,\r
-               FwVolHeader,\r
-               &FfsFileHeader\r
-               );\r
-    if (!EFI_ERROR (Status)) {\r
-      CopyMem (FileName, &FfsFileHeader->Name, sizeof (EFI_GUID));\r
-      Status = PeiProcessFile (\r
-                 SectionType,\r
-                 FfsFileHeader,\r
-                 Pe32Data\r
-                 );\r
-      return Status;\r
-    }\r
-    Hob.Raw = GET_NEXT_HOB (Hob);\r
-  }\r
-  return EFI_NOT_FOUND;\r
-}\r
-\r
-EFI_STATUS\r
-PeiLoadx64File (\r
-  IN  EFI_PEI_PE_COFF_LOADER_PROTOCOL           *PeiEfiPeiPeCoffLoader,\r
-  IN  VOID                                      *Pe32Data,\r
-  IN  EFI_MEMORY_TYPE                           MemoryType,\r
-  OUT EFI_PHYSICAL_ADDRESS                      *ImageAddress,\r
-  OUT UINT64                                    *ImageSize,\r
-  OUT EFI_PHYSICAL_ADDRESS                      *EntryPoint\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Loads and relocates a PE/COFF image into memory.\r
-\r
-Arguments:\r
-\r
-  PeiEfiPeiPeCoffLoader - Pointer to a PE COFF loader protocol\r
-\r
-  Pe32Data         - The base address of the PE/COFF file that is to be loaded and relocated\r
-\r
-  ImageAddress     - The base address of the relocated PE/COFF image\r
-\r
-  ImageSize        - The size of the relocated PE/COFF image\r
-\r
-  EntryPoint       - The entry point of the relocated PE/COFF image\r
-\r
-Returns:\r
-\r
-  EFI_SUCCESS                     - The file was loaded and relocated\r
-  EFI_OUT_OF_RESOURCES            - There was not enough memory to load and relocate the PE/COFF file\r
-\r
---*/\r
-{\r
-  EFI_STATUS                            Status;\r
-  PE_COFF_LOADER_IMAGE_CONTEXT          ImageContext;\r
-  EFI_PHYSICAL_ADDRESS                  MemoryBuffer;\r
-\r
-  ZeroMem (&ImageContext, sizeof (ImageContext));\r
-  ImageContext.Handle = Pe32Data;\r
-  Status              = GetImageReadFunction (&ImageContext);\r
-\r
-  ASSERT_EFI_ERROR (Status);\r
-\r
-  Status = PeiEfiPeiPeCoffLoader->GetImageInfo (PeiEfiPeiPeCoffLoader, &ImageContext);\r
-  if (EFI_ERROR (Status)) {\r
-    return Status;\r
-  }\r
-  //\r
-  // Allocate Memory for the image\r
-  //\r
-  //\r
-  // Allocate Memory for the image\r
-  //\r
-  PeiCoreAllocatePages (MemoryType, EFI_SIZE_TO_PAGES ((UINT32) ImageContext.ImageSize), &MemoryBuffer);\r
-  ImageContext.ImageAddress = MemoryBuffer;\r
-  ASSERT (ImageContext.ImageAddress != 0);\r
-\r
-  //\r
-  // Load the image to our new buffer\r
-  //\r
-\r
-  Status = PeiEfiPeiPeCoffLoader->LoadImage (PeiEfiPeiPeCoffLoader, &ImageContext);\r
-  if (EFI_ERROR (Status)) {\r
-    return Status;\r
-  }\r
-  \r
-  //\r
-  // Relocate the image in our new buffer\r
-  //\r
-  Status = PeiEfiPeiPeCoffLoader->RelocateImage (PeiEfiPeiPeCoffLoader, &ImageContext);\r
-  if (EFI_ERROR (Status)) {\r
-    return Status;\r
-  }\r
-\r
-  //\r
-  // Flush the instruction cache so the image data is written before we execute it\r
-  //\r
-  InvalidateInstructionCacheRange ((VOID *)(UINTN)ImageContext.ImageAddress, (UINTN)ImageContext.ImageSize);\r
-\r
-  *ImageAddress = ImageContext.ImageAddress;\r
-  *ImageSize    = ImageContext.ImageSize;\r
-  *EntryPoint   = ImageContext.EntryPoint;\r
-\r
-  return EFI_SUCCESS;\r
-}\r
-\r
-EFI_STATUS\r
-ShadowDxeIpl (\r
-  IN EFI_FFS_FILE_HEADER                       *DxeIplFileHeader,\r
-  IN EFI_PEI_PE_COFF_LOADER_PROTOCOL           *PeiEfiPeiPeCoffLoader\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Shadow the DXE IPL to a different memory location. This occurs after permanent\r
-  memory has been discovered.\r
-\r
-Arguments:\r
-\r
-  DxeIplFileHeader      - Pointer to the FFS file header of the DXE IPL driver\r
-\r
-  PeiEfiPeiPeCoffLoader - Pointer to a PE COFF loader protocol\r
-\r
-Returns:\r
-\r
-  EFI_SUCCESS   - DXE IPL was successfully shadowed to a different memory location.\r
-\r
-  EFI_ ERROR    - The shadow was unsuccessful.\r
-\r
-\r
---*/\r
-{\r
-  UINTN                     SectionLength;\r
-  UINTN                     OccupiedSectionLength;\r
-  EFI_PHYSICAL_ADDRESS      DxeIplAddress;\r
-  UINT64                    DxeIplSize;\r
-  EFI_PHYSICAL_ADDRESS      DxeIplEntryPoint;\r
-  EFI_STATUS                Status;\r
-  EFI_COMMON_SECTION_HEADER *Section;\r
-\r
-  Section = (EFI_COMMON_SECTION_HEADER *) (DxeIplFileHeader + 1);\r
-\r
-  while ((Section->Type != EFI_SECTION_PE32) && (Section->Type != EFI_SECTION_TE)) {\r
-    SectionLength         = *(UINT32 *) (Section->Size) & 0x00ffffff;\r
-    OccupiedSectionLength = GetOccupiedSize (SectionLength, 4);\r
-    Section               = (EFI_COMMON_SECTION_HEADER *) ((UINT8 *) Section + OccupiedSectionLength);\r
-  }\r
-  \r
-  //\r
-  // Relocate DxeIpl into memory by using loadfile service\r
-  //\r
-  Status = PeiLoadx64File (\r
-            PeiEfiPeiPeCoffLoader,\r
-            (VOID *) (Section + 1),\r
-            EfiBootServicesData,\r
-            &DxeIplAddress,\r
-            &DxeIplSize,\r
-            &DxeIplEntryPoint\r
-            );\r
\r
-  if (Status == EFI_SUCCESS) {\r
-    //\r
-    // Install PeiInMemory to indicate the Dxeipl is shadowed\r
-    //\r
-    Status = PeiCoreInstallPpi (&mPpiPeiInMemory);\r
-\r
-    if (EFI_ERROR (Status)) {\r
-      return Status;\r
-    }\r
-\r
-    Status = ((EFI_PEIM_ENTRY_POINT) (UINTN) DxeIplEntryPoint) (DxeIplFileHeader, GetPeiServicesTablePointer());\r
-  }\r
-\r
-  return Status;\r
-}\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-DxeIplLoadFile (\r
-  IN EFI_PEI_FV_FILE_LOADER_PPI                 *This,\r
-  IN  EFI_FFS_FILE_HEADER                       *FfsHeader,\r
-  OUT EFI_PHYSICAL_ADDRESS                      *ImageAddress,\r
-  OUT UINT64                                    *ImageSize,\r
-  OUT EFI_PHYSICAL_ADDRESS                      *EntryPoint\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Given a pointer to an FFS file containing a PE32 image, get the\r
-  information on the PE32 image, and then "load" it so that it\r
-  can be executed.\r
-\r
-Arguments:\r
-\r
-  This  - pointer to our file loader protocol\r
-  FfsHeader - pointer to the FFS file header of the FFS file that\r
-              contains the PE32 image we want to load\r
-  ImageAddress  - returned address where the PE32 image is loaded\r
-  ImageSize     - returned size of the loaded PE32 image\r
-  EntryPoint    - entry point to the loaded PE32 image\r
-\r
-Returns:\r
\r
-  EFI_SUCCESS  - The FFS file was successfully loaded.\r
-  EFI_ERROR    - Unable to load the FFS file.\r
-\r
---*/\r
-{\r
-  EFI_PEI_PE_COFF_LOADER_PROTOCOL           *PeiEfiPeiPeCoffLoader;\r
-  EFI_STATUS                                Status;\r
-  VOID                                      *Pe32Data;\r
-\r
-  Pe32Data = NULL;\r
-  PeiEfiPeiPeCoffLoader = (EFI_PEI_PE_COFF_LOADER_PROTOCOL *)GetPeCoffLoaderProtocol ();\r
-\r
-  //\r
-  // Preprocess the FFS file to get a pointer to the PE32 information\r
-  // in the enclosed PE32 image.\r
-  //\r
-  Status = PeiProcessFile (\r
-            EFI_SECTION_PE32,\r
-            FfsHeader,\r
-            &Pe32Data\r
-            );\r
-\r
-  if (EFI_ERROR (Status)) {\r
-    return Status;\r
-  }\r
-  //\r
-  // Load the PE image from the FFS file\r
-  //\r
-  Status = PeiLoadx64File (\r
-            PeiEfiPeiPeCoffLoader,\r
-            Pe32Data,\r
-            EfiBootServicesData,\r
-            ImageAddress,\r
-            ImageSize,\r
-            EntryPoint\r
-            );\r
-\r
-  return Status;\r
-}\r
-\r
-EFI_STATUS\r
-PeiProcessFile (\r
-  IN  UINT16                 SectionType,\r
-  IN  EFI_FFS_FILE_HEADER    *FfsFileHeader,\r
-  OUT VOID                   **Pe32Data\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-Arguments:\r
-\r
-  SectionType       - The type of section in the FFS file to process.\r
-\r
-  FfsFileHeader     - Pointer to the FFS file to process, looking for the\r
-                      specified SectionType\r
-\r
-  Pe32Data          - returned pointer to the start of the PE32 image found\r
-                      in the FFS file.\r
-\r
-Returns:\r
-\r
-  EFI_SUCCESS       - found the PE32 section in the FFS file\r
-\r
---*/\r
-{\r
-  EFI_STATUS                      Status;\r
-  VOID                            *SectionData;\r
-  DECOMPRESS_LIBRARY              *DecompressLibrary;\r
-  UINT8                           *DstBuffer;\r
-  UINT8                           *ScratchBuffer;\r
-  UINT32                          DstBufferSize;\r
-  UINT32                          ScratchBufferSize;\r
-  EFI_COMMON_SECTION_HEADER       *CmpSection;\r
-  UINTN                           CmpSectionLength;\r
-  UINTN                           OccupiedCmpSectionLength;\r
-  VOID                            *CmpFileData;\r
-  UINTN                           CmpFileSize;\r
-  EFI_COMMON_SECTION_HEADER       *Section;\r
-  UINTN                           SectionLength;\r
-  UINTN                           OccupiedSectionLength;\r
-  UINT64                          FileSize;\r
-  EFI_GUID_DEFINED_SECTION        *GuidedSectionHeader;\r
-  UINT32                          AuthenticationStatus;\r
-  EFI_PEI_SECTION_EXTRACTION_PPI  *SectionExtract;\r
-  UINT32                          BufferSize;\r
-  UINT8                           *Buffer;\r
-  EFI_PEI_SECURITY_PPI            *Security;\r
-  BOOLEAN                         StartCrisisRecovery;\r
-  EFI_GUID                        TempGuid;\r
-  EFI_FIRMWARE_VOLUME_HEADER      *FvHeader;\r
-  EFI_COMPRESSION_SECTION         *CompressionSection;\r
-\r
-  Status = PeiCoreFfsFindSectionData (\r
-             EFI_SECTION_COMPRESSION,\r
-             FfsFileHeader,\r
-             &SectionData\r
-             );\r
-\r
-  //\r
-  // Upon finding a DXE Core file, see if there is first a compression section\r
-  //\r
-  if (!EFI_ERROR (Status)) {\r
-    //\r
-    // Yes, there is a compression section, so extract the contents\r
-    // Decompress the image here\r
-    //\r
-    Section = (EFI_COMMON_SECTION_HEADER *) (UINTN) (VOID *) ((UINT8 *) (FfsFileHeader) + (UINTN) sizeof (EFI_FFS_FILE_HEADER));\r
-\r
-    do {\r
-      SectionLength         = *(UINT32 *) (Section->Size) & 0x00ffffff;\r
-      OccupiedSectionLength = GetOccupiedSize (SectionLength, 4);\r
-\r
-      //\r
-      // Was the DXE Core file encapsulated in a GUID'd section?\r
-      //\r
-      if (Section->Type == EFI_SECTION_GUID_DEFINED) {\r
-        //\r
-        // Locate the GUID'd Section Extractor\r
-        //\r
-        GuidedSectionHeader = (VOID *) (Section + 1);\r
-\r
-        //\r
-        // This following code constitutes the addition of the security model\r
-        // to the DXE IPL.\r
-        //\r
-        //\r
-        // Set a default authenticatino state\r
-        //\r
-        AuthenticationStatus = 0;\r
-\r
-        Status = PeiCoreLocatePpi (\r
-                   &gEfiPeiSectionExtractionPpiGuid,\r
-                   0,\r
-                   NULL,\r
-                   (VOID **)&SectionExtract\r
-                   );\r
-\r
-        if (EFI_ERROR (Status)) {\r
-          return Status;\r
-        }\r
-        //\r
-        // Verify Authentication State\r
-        //\r
-        CopyMem (&TempGuid, Section + 1, sizeof (EFI_GUID));\r
-\r
-        Status = SectionExtract->PeiGetSection (\r
-                                  GetPeiServicesTablePointer(),\r
-                                  SectionExtract,\r
-                                  (EFI_SECTION_TYPE *) &SectionType,\r
-                                  &TempGuid,\r
-                                  0,\r
-                                  (VOID **) &Buffer,\r
-                                  &BufferSize,\r
-                                  &AuthenticationStatus\r
-                                  );\r
-\r
-        if (EFI_ERROR (Status)) {\r
-          return Status;\r
-        }\r
-        //\r
-        // If not ask the Security PPI, if exists, for disposition\r
-        //\r
-        //\r
-        Status = PeiCoreLocatePpi (\r
-                   &gEfiPeiSecurityPpiGuid,\r
-                   0,\r
-                   NULL,\r
-                   (VOID **)&Security\r
-                   );\r
-        if (EFI_ERROR (Status)) {\r
-          return Status;\r
-        }\r
-\r
-        Status = Security->AuthenticationState (\r
-                            GetPeiServicesTablePointer(),\r
-                            (struct _EFI_PEI_SECURITY_PPI *) Security,\r
-                            AuthenticationStatus,\r
-                            FfsFileHeader,\r
-                            &StartCrisisRecovery\r
-                            );\r
-\r
-        if (EFI_ERROR (Status)) {\r
-          return Status;\r
-        }\r
-        //\r
-        // If there is a security violation, report to caller and have\r
-        // the upper-level logic possible engender a crisis recovery\r
-        //\r
-        if (StartCrisisRecovery) {\r
-          return EFI_SECURITY_VIOLATION;\r
-        }\r
-      }\r
-\r
-      if (Section->Type == EFI_SECTION_PE32) {\r
-        //\r
-        // This is what we want\r
-        //\r
-        *Pe32Data = (VOID *) (Section + 1);\r
-        return EFI_SUCCESS;\r
-      } else if (Section->Type == EFI_SECTION_COMPRESSION) {\r
-        //\r
-        // This is a compression set, expand it\r
-        //\r
-        CompressionSection  = (EFI_COMPRESSION_SECTION *) Section;\r
-\r
-        switch (CompressionSection->CompressionType) {\r
-        case EFI_STANDARD_COMPRESSION:\r
-          DecompressLibrary = &gTianoDecompress;\r
-          break;\r
-\r
-        case EFI_CUSTOMIZED_COMPRESSION:\r
-          //\r
-          // Load user customized compression protocol.\r
-          //\r
-          DecompressLibrary = &gCustomDecompress;\r
-          break;\r
-\r
-        case EFI_NOT_COMPRESSED:\r
-        default:\r
-          //\r
-          // Need to support not compressed file\r
-          //\r
-          ASSERT_EFI_ERROR (Status);\r
-          return EFI_NOT_FOUND;\r
-        }\r
-\r
-        Status = DecompressLibrary->GetInfo (\r
-                   (UINT8 *) ((EFI_COMPRESSION_SECTION *) Section + 1),\r
-                   (UINT32) SectionLength - sizeof (EFI_COMPRESSION_SECTION),\r
-                   &DstBufferSize,\r
-                   &ScratchBufferSize\r
-                   );\r
-        if (EFI_ERROR (Status)) {\r
-          //\r
-          // GetInfo failed\r
-          //\r
-          return EFI_NOT_FOUND;\r
-        }\r
-\r
-        //\r
-        // Allocate scratch buffer\r
-        //\r
-        ScratchBuffer = AllocatePages (EFI_SIZE_TO_PAGES (ScratchBufferSize));\r
-        if (ScratchBuffer == NULL) {\r
-          return EFI_OUT_OF_RESOURCES;\r
-        }\r
-\r
-        //\r
-        // Allocate destination buffer\r
-        //\r
-        DstBuffer = AllocatePages (EFI_SIZE_TO_PAGES (DstBufferSize));\r
-        if (DstBuffer == NULL) {\r
-          return EFI_OUT_OF_RESOURCES;\r
-        }\r
-\r
-        //\r
-        // Call decompress function\r
-        //\r
-        Status = DecompressLibrary->Decompress (\r
-                    (CHAR8 *) ((EFI_COMPRESSION_SECTION *) Section + 1),\r
-                    DstBuffer,\r
-                    ScratchBuffer\r
-                    );\r
-\r
-        CmpSection = (EFI_COMMON_SECTION_HEADER *) DstBuffer;\r
-        if (CmpSection->Type == EFI_SECTION_RAW) {\r
-          //\r
-          // Skip the section header and\r
-          // adjust the pointer alignment to 16\r
-          //\r
-          FvHeader = (EFI_FIRMWARE_VOLUME_HEADER *) (DstBuffer + 16);\r
-\r
-          if (FvHeader->Signature == EFI_FVH_SIGNATURE) {\r
-            FfsFileHeader = NULL;\r
-            BuildFvHob ((EFI_PHYSICAL_ADDRESS) (UINTN) FvHeader, FvHeader->FvLength);\r
-            Status = PeiCoreFfsFindNextFile (\r
-                       EFI_FV_FILETYPE_DXE_CORE,\r
-                       FvHeader,\r
-                       &FfsFileHeader\r
-                       );\r
-\r
-            if (EFI_ERROR (Status)) {\r
-              return EFI_NOT_FOUND;\r
-            }\r
-\r
-            return PeiProcessFile (SectionType, FfsFileHeader, Pe32Data);\r
-          }\r
-        }\r
-        //\r
-        // Decompress successfully.\r
-        // Loop the decompressed data searching for expected section.\r
-        //\r
-        CmpFileData = (VOID *) DstBuffer;\r
-        CmpFileSize = DstBufferSize;\r
-        do {\r
-          CmpSectionLength = *(UINT32 *) (CmpSection->Size) & 0x00ffffff;\r
-          if (CmpSection->Type == EFI_SECTION_PE32) {\r
-            //\r
-            // This is what we want\r
-            //\r
-            *Pe32Data = (VOID *) (CmpSection + 1);\r
-            return EFI_SUCCESS;\r
-          }\r
-\r
-          OccupiedCmpSectionLength  = GetOccupiedSize (CmpSectionLength, 4);\r
-          CmpSection                = (EFI_COMMON_SECTION_HEADER *) ((UINT8 *) CmpSection + OccupiedCmpSectionLength);\r
-        } while (CmpSection->Type != 0 && (UINTN) ((UINT8 *) CmpSection - (UINT8 *) CmpFileData) < CmpFileSize);\r
-      }\r
-\r
-      Section   = (EFI_COMMON_SECTION_HEADER *) ((UINT8 *) Section + OccupiedSectionLength);\r
-      FileSize  = FfsFileHeader->Size[0] & 0xFF;\r
-      FileSize += (FfsFileHeader->Size[1] << 8) & 0xFF00;\r
-      FileSize += (FfsFileHeader->Size[2] << 16) & 0xFF0000;\r
-      FileSize &= 0x00FFFFFF;\r
-    } while (Section->Type != 0 && (UINTN) ((UINT8 *) Section - (UINT8 *) FfsFileHeader) < FileSize);\r
-\r
-    //\r
-    // End of the decompression activity\r
-    //\r
-  } else {\r
-\r
-    Status = PeiCoreFfsFindSectionData (\r
-               EFI_SECTION_PE32,\r
-               FfsFileHeader,\r
-               &SectionData\r
-               );\r
-\r
-    if (EFI_ERROR (Status)) {\r
-      Status = PeiCoreFfsFindSectionData (\r
-                 EFI_SECTION_TE,\r
-                 FfsFileHeader,\r
-                 &SectionData\r
-                 );\r
-      if (EFI_ERROR (Status)) {\r
-        return Status;\r
-      }\r
-    }\r
-  }\r
-\r
-  *Pe32Data = SectionData;\r
-\r
-  return EFI_SUCCESS;\r
+/*++
+
+Copyright (c) 2006, Intel Corporation                                                         
+All rights reserved. This program and the accompanying materials                          
+are licensed and made available under the terms and conditions of the BSD License         
+which accompanies this distribution.  The full text of the license may be found at        
+http://opensource.org/licenses/bsd-license.php                                            
+                                                                                          
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             
+
+Module Name:
+
+  DxeLoad.c
+
+Abstract:
+
+  Last PEIM.
+  Responsibility of this module is to load the DXE Core from a Firmware Volume.
+
+--*/
+
+#include <DxeIpl.h>
+
+#pragma warning( disable : 4305 )
+
+BOOLEAN gInMemory = FALSE;
+
+//
+// GUID for EM64T
+//
+#define EFI_PPI_NEEDED_BY_DXE \
+  { \
+    0x4d37da42, 0x3a0c, 0x4eda, 0xb9, 0xeb, 0xbc, 0x0e, 0x1d, 0xb4, 0x71, 0x3b \
+  }
+EFI_GUID mPpiNeededByDxeGuid = EFI_PPI_NEEDED_BY_DXE;
+
+//
+// Module Globals used in the DXE to PEI handoff
+// These must be module globals, so the stack can be switched
+//
+static EFI_DXE_IPL_PPI mDxeIplPpi = {
+  DxeLoadCore
+};
+
+static EFI_PEI_FV_FILE_LOADER_PPI mLoadFilePpi = {
+  DxeIplLoadFile
+};
+
+static EFI_PEI_PPI_DESCRIPTOR     mPpiLoadFile = {
+  (EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST),
+  &gEfiPeiFvFileLoaderPpiGuid,
+  &mLoadFilePpi
+};
+
+static EFI_PEI_PPI_DESCRIPTOR     mPpiList = {
+  (EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST),
+  &gEfiDxeIplPpiGuid,
+  &mDxeIplPpi
+};
+
+static EFI_PEI_PPI_DESCRIPTOR     mPpiPeiInMemory = {
+  (EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST),
+  &gPeiInMemoryGuid,
+  NULL
+};
+
+static EFI_PEI_PPI_DESCRIPTOR     mPpiSignal = {
+  (EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST),
+  &gEfiEndOfPeiSignalPpiGuid,
+  NULL
+};
+
+DECOMPRESS_LIBRARY  gEfiDecompress = {
+  UefiDecompressGetInfo,
+  UefiDecompress
+};
+
+DECOMPRESS_LIBRARY  gTianoDecompress = {
+  TianoDecompressGetInfo,
+  TianoDecompress
+};
+
+DECOMPRESS_LIBRARY  gCustomDecompress = {
+  CustomDecompressGetInfo,
+  CustomDecompress
+};
+
+STATIC
+UINTN
+GetOccupiedSize (
+  IN UINTN   ActualSize,
+  IN UINTN   Alignment
+  )
+{
+  UINTN OccupiedSize;
+
+  OccupiedSize = ActualSize;
+  while ((OccupiedSize & (Alignment - 1)) != 0) {
+    OccupiedSize++;
+  }
+
+  return OccupiedSize;
+}
+
+EFI_STATUS
+EFIAPI
+PeimInitializeDxeIpl (
+  IN EFI_FFS_FILE_HEADER       *FfsHeader,
+  IN EFI_PEI_SERVICES          **PeiServices
+  )
+/*++
+
+Routine Description:
+
+  Initializes the Dxe Ipl PPI
+
+Arguments:
+
+  FfsHeader   - Pointer to FFS file header
+  PeiServices - General purpose services available to every PEIM.
+
+Returns:
+
+  EFI_SUCCESS
+
+--*/
+{
+  EFI_STATUS                                Status;
+  EFI_PEI_PE_COFF_LOADER_PROTOCOL           *PeiEfiPeiPeCoffLoader;
+  EFI_BOOT_MODE                             BootMode;
+
+  Status = PeiCoreGetBootMode (&BootMode);
+
+  ASSERT_EFI_ERROR (Status);
+
+  Status = PeiCoreLocatePpi (
+             &gPeiInMemoryGuid,
+             0,
+             NULL,
+             NULL
+             );
+
+  if (EFI_ERROR (Status) && (BootMode != BOOT_ON_S3_RESUME)) {   
+    //
+    // The DxeIpl has not yet been shadowed
+    //
+    PeiEfiPeiPeCoffLoader = (EFI_PEI_PE_COFF_LOADER_PROTOCOL *)GetPeCoffLoaderProtocol ();
+
+    //
+    // Shadow DxeIpl and then re-run its entry point
+    //
+    Status = ShadowDxeIpl (FfsHeader, PeiEfiPeiPeCoffLoader);
+    if (EFI_ERROR (Status)) {
+      return Status;
+    }
+
+  } else {
+    if (BootMode != BOOT_ON_S3_RESUME) {
+    //
+    // The DxeIpl has been shadowed
+    //
+    gInMemory = TRUE;
+
+    //
+    // Install LoadFile PPI
+    //
+    Status = PeiCoreInstallPpi (&mPpiLoadFile);
+
+    if (EFI_ERROR (Status)) {
+      return Status;
+      }
+    }
+    //
+    // Install DxeIpl PPI
+    //
+    PeiCoreInstallPpi (&mPpiList);
+
+    if (EFI_ERROR (Status)) {
+      return Status;
+    }
+
+  }
+
+  return EFI_SUCCESS;
+}
+
+EFI_STATUS
+EFIAPI
+DxeLoadCore (
+  IN EFI_DXE_IPL_PPI       *This,
+  IN EFI_PEI_SERVICES      **PeiServices,
+  IN EFI_PEI_HOB_POINTERS  HobList
+  )
+/*++
+
+Routine Description:
+
+  Main entry point to last PEIM
+
+Arguments:
+
+  This         - Entry point for DXE IPL PPI
+  PeiServices  - General purpose services available to every PEIM.
+  HobList      - Address to the Pei HOB list
+
+Returns:
+
+  EFI_SUCCESS          - DEX core was successfully loaded.
+  EFI_OUT_OF_RESOURCES - There are not enough resources to load DXE core.
+
+--*/
+{
+  EFI_STATUS                                                Status;
+  EFI_PHYSICAL_ADDRESS                                      TopOfStack;
+  EFI_PHYSICAL_ADDRESS                                      BaseOfStack;
+  EFI_PHYSICAL_ADDRESS                                      BspStore;
+  EFI_GUID                                                  DxeCoreFileName;
+  VOID                                                      *DxeCorePe32Data;
+  EFI_PHYSICAL_ADDRESS                                      DxeCoreAddress;
+  UINT64                                                    DxeCoreSize;
+  EFI_PHYSICAL_ADDRESS                                      DxeCoreEntryPoint;
+  EFI_PEI_PE_COFF_LOADER_PROTOCOL                           *PeiEfiPeiPeCoffLoader;
+  EFI_BOOT_MODE                                             BootMode;
+  EFI_PEI_RECOVERY_MODULE_PPI                               *PeiRecovery;
+  EFI_PEI_S3_RESUME_PPI                                     *S3Resume;
+  EFI_PHYSICAL_ADDRESS                                      PageTables;
+  
+  TopOfStack  = 0;
+  BaseOfStack = 0;
+  BspStore    = 0;
+  Status      = EFI_SUCCESS;
+
+  //
+  // if in S3 Resume, restore configure
+  //
+  Status = PeiCoreGetBootMode (&BootMode);
+
+  if (!EFI_ERROR (Status) && (BootMode == BOOT_ON_S3_RESUME)) {
+    Status = PeiCoreLocatePpi (
+               &gEfiPeiS3ResumePpiGuid,
+               0,
+               NULL,
+               (VOID **)&S3Resume
+               );
+
+    ASSERT_EFI_ERROR (Status);
+
+    Status = S3Resume->S3RestoreConfig (PeiServices);
+
+    ASSERT_EFI_ERROR (Status);
+  }
+
+  Status = EFI_SUCCESS;
+
+  //
+  // Install the PEI Protocols that are shared between PEI and DXE
+  //
+#ifdef EFI_NT_EMULATOR
+  PeiEfiPeiPeCoffLoader = (EFI_PEI_PE_COFF_LOADER_PROTOCOL *)GetPeCoffLoaderProtocol ();
+  ASSERT (PeiEfiPeiPeCoffLoader != NULL);
+#else
+  PeiEfiPeiPeCoffLoader = (EFI_PEI_PE_COFF_LOADER_PROTOCOL *)GetPeCoffLoaderX64Protocol ();
+#endif 
+
+#if 0
+  Status = InstallEfiPeiPeCoffLoader64 (PeiServices, &PeiEfiPeiPeCoffLoader, NULL);
+  ASSERT_EFI_ERROR (Status);
+#endif
+  //
+  // Allocate 128KB for the Stack
+  //
+  PeiCoreAllocatePages (EfiBootServicesData, EFI_SIZE_TO_PAGES (STACK_SIZE), &BaseOfStack);
+  ASSERT (BaseOfStack != 0);
+
+  //
+  // Compute the top of the stack we were allocated. Pre-allocate a 32 bytes
+  // for safety (PpisNeededByDxe and DxeCore).
+  //
+  TopOfStack = BaseOfStack + EFI_SIZE_TO_PAGES (STACK_SIZE) * EFI_PAGE_SIZE - 32;
+
+  //
+  // Add architecture-specifc HOBs (including the BspStore HOB)
+  //
+  Status = CreateArchSpecificHobs (&BspStore);
+  ASSERT_EFI_ERROR (Status);
+
+  //
+  // See if we are in crisis recovery
+  //
+  Status = PeiCoreGetBootMode (&BootMode);
+  if (!EFI_ERROR (Status) && (BootMode == BOOT_IN_RECOVERY_MODE)) {
+    Status = PeiCoreLocatePpi (
+               &gEfiPeiRecoveryModulePpiGuid,
+               0,
+               NULL,
+               (VOID **)&PeiRecovery
+               );
+
+    ASSERT_EFI_ERROR (Status);
+    Status = PeiRecovery->LoadRecoveryCapsule (PeiServices, PeiRecovery);
+    ASSERT_EFI_ERROR (Status);
+  }
+
+  //
+  // Find the DXE Core in a Firmware Volume
+  //
+  Status = PeiFindFile (
+             EFI_FV_FILETYPE_DXE_CORE,
+             EFI_SECTION_PE32,
+             &DxeCoreFileName,
+             &DxeCorePe32Data
+             );
+  ASSERT_EFI_ERROR (Status);
+
+  //
+  // Transfer control to the DXE Core
+  // The handoff state is simply a pointer to the HOB list
+  //
+  // PEI_PERF_END (PeiServices, L"DxeIpl", NULL, 0);
+
+  Status = PeiCoreInstallPpi (&mPpiSignal);
+  ASSERT_EFI_ERROR (Status);
+
+  //
+  // Load the GDT of Go64. Since the GDT of 32-bit Tiano locates in the BS_DATA \
+  // memory, it may be corrupted when copying FV to high-end memory 
+  LoadGo64Gdt();
+
+  //
+  // Limit to 36 bits of addressing for debug. Should get it from CPU
+  //
+  PageTables = CreateIdentityMappingPageTables (36);
+
+
+  //
+  // Load the DXE Core from a Firmware Volume
+  //
+  Status = PeiLoadx64File (
+             PeiEfiPeiPeCoffLoader,
+             DxeCorePe32Data,
+             EfiBootServicesData,
+             &DxeCoreAddress,
+             &DxeCoreSize,
+             &DxeCoreEntryPoint
+             );
+  ASSERT_EFI_ERROR (Status);
+
+  //
+  //
+  // Add HOB for the DXE Core
+  //
+  BuildModuleHob (
+    &DxeCoreFileName,
+    DxeCoreAddress,
+    DxeCoreSize,
+    DxeCoreEntryPoint
+    );
+
+  //
+  // Report Status Code EFI_SW_PEI_PC_HANDOFF_TO_NEXT
+  //
+  REPORT_STATUS_CODE (
+    EFI_PROGRESS_CODE,
+    EFI_SOFTWARE_PEI_MODULE | EFI_SW_PEI_CORE_PC_HANDOFF_TO_NEXT
+    );
+
+  DEBUG ((EFI_D_INFO, "DXE Core Entry\n"));
+  //
+  // Go to Long Mode. Interrupts will not get turned on until the CPU AP is loaded.
+  // Call x64 drivers passing in single argument, a pointer to the HOBs.
+  //
+  ActivateLongMode (
+    PageTables, 
+    (EFI_PHYSICAL_ADDRESS)(UINTN)(HobList.Raw), 
+    TopOfStack,
+    0x00000000,
+    DxeCoreEntryPoint
+    );
+
+  //
+  // If we get here, then the DXE Core returned.  This is an error
+  //
+  ASSERT_EFI_ERROR (Status);
+
+  return EFI_OUT_OF_RESOURCES;
+}
+
+EFI_STATUS
+PeiFindFile (
+  IN  UINT8                  Type,
+  IN  UINT16                 SectionType,
+  OUT EFI_GUID               *FileName,
+  OUT VOID                   **Pe32Data
+  )
+/*++
+
+Routine Description:
+
+  Finds a PE/COFF of a specific Type and SectionType in the Firmware Volumes
+  described in the HOB list. Able to search in a compression set in a FFS file.
+  But only one level of compression is supported, that is, not able to search
+  in a compression set that is within another compression set.
+
+Arguments:
+
+  Type        - The Type of file to retrieve
+
+  SectionType - The type of section to retrieve from a file
+
+  FileName    - The name of the file found in the Firmware Volume
+
+  Pe32Data    - Pointer to the beginning of the PE/COFF file found in the Firmware Volume
+
+Returns:
+
+  EFI_SUCCESS   - The file was found, and the name is returned in FileName, and a pointer to
+                  the PE/COFF image is returned in Pe32Data
+
+  EFI_NOT_FOUND - The file was not found in the Firmware Volumes present in the HOB List
+
+--*/
+{
+  EFI_FIRMWARE_VOLUME_HEADER  *FwVolHeader;
+  EFI_FFS_FILE_HEADER         *FfsFileHeader;
+  VOID                        *SectionData;
+  EFI_STATUS                  Status;
+  EFI_PEI_HOB_POINTERS        Hob;
+
+
+  FwVolHeader   = NULL;
+  FfsFileHeader = NULL;
+  SectionData   = NULL;
+
+  //
+  // Foreach Firmware Volume, look for a specified type
+  // of file and break out when one is found
+  //
+  Hob.Raw = GetHobList ();
+  while ((Hob.Raw = GetNextHob (EFI_HOB_TYPE_FV, Hob.Raw)) != NULL) {
+    FwVolHeader = (EFI_FIRMWARE_VOLUME_HEADER *) (UINTN) (Hob.FirmwareVolume->BaseAddress);
+    Status = PeiCoreFfsFindNextFile (
+               Type,
+               FwVolHeader,
+               &FfsFileHeader
+               );
+    if (!EFI_ERROR (Status)) {
+      CopyMem (FileName, &FfsFileHeader->Name, sizeof (EFI_GUID));
+      Status = PeiProcessFile (
+                 SectionType,
+                 FfsFileHeader,
+                 Pe32Data
+                 );
+      return Status;
+    }
+    Hob.Raw = GET_NEXT_HOB (Hob);
+  }
+  return EFI_NOT_FOUND;
+}
+
+EFI_STATUS
+PeiLoadx64File (
+  IN  EFI_PEI_PE_COFF_LOADER_PROTOCOL           *PeiEfiPeiPeCoffLoader,
+  IN  VOID                                      *Pe32Data,
+  IN  EFI_MEMORY_TYPE                           MemoryType,
+  OUT EFI_PHYSICAL_ADDRESS                      *ImageAddress,
+  OUT UINT64                                    *ImageSize,
+  OUT EFI_PHYSICAL_ADDRESS                      *EntryPoint
+  )
+/*++
+
+Routine Description:
+
+  Loads and relocates a PE/COFF image into memory.
+
+Arguments:
+
+  PeiEfiPeiPeCoffLoader - Pointer to a PE COFF loader protocol
+
+  Pe32Data         - The base address of the PE/COFF file that is to be loaded and relocated
+
+  ImageAddress     - The base address of the relocated PE/COFF image
+
+  ImageSize        - The size of the relocated PE/COFF image
+
+  EntryPoint       - The entry point of the relocated PE/COFF image
+
+Returns:
+
+  EFI_SUCCESS                     - The file was loaded and relocated
+  EFI_OUT_OF_RESOURCES            - There was not enough memory to load and relocate the PE/COFF file
+
+--*/
+{
+  EFI_STATUS                            Status;
+  PE_COFF_LOADER_IMAGE_CONTEXT          ImageContext;
+  EFI_PHYSICAL_ADDRESS                  MemoryBuffer;
+
+  ZeroMem (&ImageContext, sizeof (ImageContext));
+  ImageContext.Handle = Pe32Data;
+  Status              = GetImageReadFunction (&ImageContext);
+
+  ASSERT_EFI_ERROR (Status);
+
+  Status = PeiEfiPeiPeCoffLoader->GetImageInfo (PeiEfiPeiPeCoffLoader, &ImageContext);
+  if (EFI_ERROR (Status)) {
+    return Status;
+  }
+  //
+  // Allocate Memory for the image
+  //
+  //
+  // Allocate Memory for the image
+  //
+  PeiCoreAllocatePages (MemoryType, EFI_SIZE_TO_PAGES ((UINT32) ImageContext.ImageSize), &MemoryBuffer);
+  ImageContext.ImageAddress = MemoryBuffer;
+  ASSERT (ImageContext.ImageAddress != 0);
+
+  //
+  // Load the image to our new buffer
+  //
+
+  Status = PeiEfiPeiPeCoffLoader->LoadImage (PeiEfiPeiPeCoffLoader, &ImageContext);
+  if (EFI_ERROR (Status)) {
+    return Status;
+  }
+  
+  //
+  // Relocate the image in our new buffer
+  //
+  Status = PeiEfiPeiPeCoffLoader->RelocateImage (PeiEfiPeiPeCoffLoader, &ImageContext);
+  if (EFI_ERROR (Status)) {
+    return Status;
+  }
+
+  //
+  // Flush the instruction cache so the image data is written before we execute it
+  //
+  InvalidateInstructionCacheRange ((VOID *)(UINTN)ImageContext.ImageAddress, (UINTN)ImageContext.ImageSize);
+
+  *ImageAddress = ImageContext.ImageAddress;
+  *ImageSize    = ImageContext.ImageSize;
+  *EntryPoint   = ImageContext.EntryPoint;
+
+  return EFI_SUCCESS;
+}
+
+EFI_STATUS
+ShadowDxeIpl (
+  IN EFI_FFS_FILE_HEADER                       *DxeIplFileHeader,
+  IN EFI_PEI_PE_COFF_LOADER_PROTOCOL           *PeiEfiPeiPeCoffLoader
+  )
+/*++
+
+Routine Description:
+
+  Shadow the DXE IPL to a different memory location. This occurs after permanent
+  memory has been discovered.
+
+Arguments:
+
+  DxeIplFileHeader      - Pointer to the FFS file header of the DXE IPL driver
+
+  PeiEfiPeiPeCoffLoader - Pointer to a PE COFF loader protocol
+
+Returns:
+
+  EFI_SUCCESS   - DXE IPL was successfully shadowed to a different memory location.
+
+  EFI_ ERROR    - The shadow was unsuccessful.
+
+
+--*/
+{
+  UINTN                     SectionLength;
+  UINTN                     OccupiedSectionLength;
+  EFI_PHYSICAL_ADDRESS      DxeIplAddress;
+  UINT64                    DxeIplSize;
+  EFI_PHYSICAL_ADDRESS      DxeIplEntryPoint;
+  EFI_STATUS                Status;
+  EFI_COMMON_SECTION_HEADER *Section;
+
+  Section = (EFI_COMMON_SECTION_HEADER *) (DxeIplFileHeader + 1);
+
+  while ((Section->Type != EFI_SECTION_PE32) && (Section->Type != EFI_SECTION_TE)) {
+    SectionLength         = *(UINT32 *) (Section->Size) & 0x00ffffff;
+    OccupiedSectionLength = GetOccupiedSize (SectionLength, 4);
+    Section               = (EFI_COMMON_SECTION_HEADER *) ((UINT8 *) Section + OccupiedSectionLength);
+  }
+  
+  //
+  // Relocate DxeIpl into memory by using loadfile service
+  //
+  Status = PeiLoadx64File (
+            PeiEfiPeiPeCoffLoader,
+            (VOID *) (Section + 1),
+            EfiBootServicesData,
+            &DxeIplAddress,
+            &DxeIplSize,
+            &DxeIplEntryPoint
+            );
+  if (Status == EFI_SUCCESS) {
+    //
+    // Install PeiInMemory to indicate the Dxeipl is shadowed
+    //
+    Status = PeiCoreInstallPpi (&mPpiPeiInMemory);
+
+    if (EFI_ERROR (Status)) {
+      return Status;
+    }
+
+    Status = ((EFI_PEIM_ENTRY_POINT) (UINTN) DxeIplEntryPoint) (DxeIplFileHeader, GetPeiServicesTablePointer());
+  }
+
+  return Status;
+}
+
+EFI_STATUS
+EFIAPI
+DxeIplLoadFile (
+  IN EFI_PEI_FV_FILE_LOADER_PPI                 *This,
+  IN  EFI_FFS_FILE_HEADER                       *FfsHeader,
+  OUT EFI_PHYSICAL_ADDRESS                      *ImageAddress,
+  OUT UINT64                                    *ImageSize,
+  OUT EFI_PHYSICAL_ADDRESS                      *EntryPoint
+  )
+/*++
+
+Routine Description:
+
+  Given a pointer to an FFS file containing a PE32 image, get the
+  information on the PE32 image, and then "load" it so that it
+  can be executed.
+
+Arguments:
+
+  This  - pointer to our file loader protocol
+  FfsHeader - pointer to the FFS file header of the FFS file that
+              contains the PE32 image we want to load
+  ImageAddress  - returned address where the PE32 image is loaded
+  ImageSize     - returned size of the loaded PE32 image
+  EntryPoint    - entry point to the loaded PE32 image
+
+Returns:
+  EFI_SUCCESS  - The FFS file was successfully loaded.
+  EFI_ERROR    - Unable to load the FFS file.
+
+--*/
+{
+  EFI_PEI_PE_COFF_LOADER_PROTOCOL           *PeiEfiPeiPeCoffLoader;
+  EFI_STATUS                                Status;
+  VOID                                      *Pe32Data;
+
+  Pe32Data = NULL;
+  PeiEfiPeiPeCoffLoader = (EFI_PEI_PE_COFF_LOADER_PROTOCOL *)GetPeCoffLoaderProtocol ();
+
+  //
+  // Preprocess the FFS file to get a pointer to the PE32 information
+  // in the enclosed PE32 image.
+  //
+  Status = PeiProcessFile (
+            EFI_SECTION_PE32,
+            FfsHeader,
+            &Pe32Data
+            );
+
+  if (EFI_ERROR (Status)) {
+    return Status;
+  }
+  //
+  // Load the PE image from the FFS file
+  //
+  Status = PeiLoadx64File (
+            PeiEfiPeiPeCoffLoader,
+            Pe32Data,
+            EfiBootServicesData,
+            ImageAddress,
+            ImageSize,
+            EntryPoint
+            );
+
+  return Status;
+}
+
+EFI_STATUS
+PeiProcessFile (
+  IN  UINT16                 SectionType,
+  IN  EFI_FFS_FILE_HEADER    *FfsFileHeader,
+  OUT VOID                   **Pe32Data
+  )
+/*++
+
+Routine Description:
+
+Arguments:
+
+  SectionType       - The type of section in the FFS file to process.
+
+  FfsFileHeader     - Pointer to the FFS file to process, looking for the
+                      specified SectionType
+
+  Pe32Data          - returned pointer to the start of the PE32 image found
+                      in the FFS file.
+
+Returns:
+
+  EFI_SUCCESS       - found the PE32 section in the FFS file
+
+--*/
+{
+  EFI_STATUS                      Status;
+  VOID                            *SectionData;
+  DECOMPRESS_LIBRARY              *DecompressLibrary;
+  UINT8                           *DstBuffer;
+  UINT8                           *ScratchBuffer;
+  UINT32                          DstBufferSize;
+  UINT32                          ScratchBufferSize;
+  EFI_COMMON_SECTION_HEADER       *CmpSection;
+  UINTN                           CmpSectionLength;
+  UINTN                           OccupiedCmpSectionLength;
+  VOID                            *CmpFileData;
+  UINTN                           CmpFileSize;
+  EFI_COMMON_SECTION_HEADER       *Section;
+  UINTN                           SectionLength;
+  UINTN                           OccupiedSectionLength;
+  UINT64                          FileSize;
+  EFI_GUID_DEFINED_SECTION        *GuidedSectionHeader;
+  UINT32                          AuthenticationStatus;
+  EFI_PEI_SECTION_EXTRACTION_PPI  *SectionExtract;
+  UINT32                          BufferSize;
+  UINT8                           *Buffer;
+  EFI_PEI_SECURITY_PPI            *Security;
+  BOOLEAN                         StartCrisisRecovery;
+  EFI_GUID                        TempGuid;
+  EFI_FIRMWARE_VOLUME_HEADER      *FvHeader;
+  EFI_COMPRESSION_SECTION         *CompressionSection;
+
+  Status = PeiCoreFfsFindSectionData (
+             EFI_SECTION_COMPRESSION,
+             FfsFileHeader,
+             &SectionData
+             );
+
+  //
+  // Upon finding a DXE Core file, see if there is first a compression section
+  //
+  if (!EFI_ERROR (Status)) {
+    //
+    // Yes, there is a compression section, so extract the contents
+    // Decompress the image here
+    //
+    Section = (EFI_COMMON_SECTION_HEADER *) (UINTN) (VOID *) ((UINT8 *) (FfsFileHeader) + (UINTN) sizeof (EFI_FFS_FILE_HEADER));
+
+    do {
+      SectionLength         = *(UINT32 *) (Section->Size) & 0x00ffffff;
+      OccupiedSectionLength = GetOccupiedSize (SectionLength, 4);
+
+      //
+      // Was the DXE Core file encapsulated in a GUID'd section?
+      //
+      if (Section->Type == EFI_SECTION_GUID_DEFINED) {
+        //
+        // Locate the GUID'd Section Extractor
+        //
+        GuidedSectionHeader = (VOID *) (Section + 1);
+
+        //
+        // This following code constitutes the addition of the security model
+        // to the DXE IPL.
+        //
+        //
+        // Set a default authenticatino state
+        //
+        AuthenticationStatus = 0;
+
+        Status = PeiCoreLocatePpi (
+                   &gEfiPeiSectionExtractionPpiGuid,
+                   0,
+                   NULL,
+                   (VOID **)&SectionExtract
+                   );
+
+        if (EFI_ERROR (Status)) {
+          return Status;
+        }
+        //
+        // Verify Authentication State
+        //
+        CopyMem (&TempGuid, Section + 1, sizeof (EFI_GUID));
+
+        Status = SectionExtract->PeiGetSection (
+                                  GetPeiServicesTablePointer(),
+                                  SectionExtract,
+                                  (EFI_SECTION_TYPE *) &SectionType,
+                                  &TempGuid,
+                                  0,
+                                  (VOID **) &Buffer,
+                                  &BufferSize,
+                                  &AuthenticationStatus
+                                  );
+
+        if (EFI_ERROR (Status)) {
+          return Status;
+        }
+        //
+        // If not ask the Security PPI, if exists, for disposition
+        //
+        //
+        Status = PeiCoreLocatePpi (
+                   &gEfiPeiSecurityPpiGuid,
+                   0,
+                   NULL,
+                   (VOID **)&Security
+                   );
+        if (EFI_ERROR (Status)) {
+          return Status;
+        }
+
+        Status = Security->AuthenticationState (
+                            GetPeiServicesTablePointer(),
+                            (struct _EFI_PEI_SECURITY_PPI *) Security,
+                            AuthenticationStatus,
+                            FfsFileHeader,
+                            &StartCrisisRecovery
+                            );
+
+        if (EFI_ERROR (Status)) {
+          return Status;
+        }
+        //
+        // If there is a security violation, report to caller and have
+        // the upper-level logic possible engender a crisis recovery
+        //
+        if (StartCrisisRecovery) {
+          return EFI_SECURITY_VIOLATION;
+        }
+      }
+
+      if (Section->Type == EFI_SECTION_PE32) {
+        //
+        // This is what we want
+        //
+        *Pe32Data = (VOID *) (Section + 1);
+        return EFI_SUCCESS;
+      } else if (Section->Type == EFI_SECTION_COMPRESSION) {
+        //
+        // This is a compression set, expand it
+        //
+        CompressionSection  = (EFI_COMPRESSION_SECTION *) Section;
+
+        switch (CompressionSection->CompressionType) {
+        case EFI_STANDARD_COMPRESSION:
+          DecompressLibrary = &gTianoDecompress;
+          break;
+
+        case EFI_CUSTOMIZED_COMPRESSION:
+          //
+          // Load user customized compression protocol.
+          //
+          DecompressLibrary = &gCustomDecompress;
+          break;
+
+        case EFI_NOT_COMPRESSED:
+        default:
+          //
+          // Need to support not compressed file
+          //
+          ASSERT_EFI_ERROR (Status);
+          return EFI_NOT_FOUND;
+        }
+
+        Status = DecompressLibrary->GetInfo (
+                   (UINT8 *) ((EFI_COMPRESSION_SECTION *) Section + 1),
+                   (UINT32) SectionLength - sizeof (EFI_COMPRESSION_SECTION),
+                   &DstBufferSize,
+                   &ScratchBufferSize
+                   );
+        if (EFI_ERROR (Status)) {
+          //
+          // GetInfo failed
+          //
+          return EFI_NOT_FOUND;
+        }
+
+        //
+        // Allocate scratch buffer
+        //
+        ScratchBuffer = AllocatePages (EFI_SIZE_TO_PAGES (ScratchBufferSize));
+        if (ScratchBuffer == NULL) {
+          return EFI_OUT_OF_RESOURCES;
+        }
+
+        //
+        // Allocate destination buffer
+        //
+        DstBuffer = AllocatePages (EFI_SIZE_TO_PAGES (DstBufferSize));
+        if (DstBuffer == NULL) {
+          return EFI_OUT_OF_RESOURCES;
+        }
+
+        //
+        // Call decompress function
+        //
+        Status = DecompressLibrary->Decompress (
+                    (CHAR8 *) ((EFI_COMPRESSION_SECTION *) Section + 1),
+                    DstBuffer,
+                    ScratchBuffer
+                    );
+
+        CmpSection = (EFI_COMMON_SECTION_HEADER *) DstBuffer;
+        if (CmpSection->Type == EFI_SECTION_RAW) {
+          //
+          // Skip the section header and
+          // adjust the pointer alignment to 16
+          //
+          FvHeader = (EFI_FIRMWARE_VOLUME_HEADER *) (DstBuffer + 16);
+
+          if (FvHeader->Signature == EFI_FVH_SIGNATURE) {
+            FfsFileHeader = NULL;
+            BuildFvHob ((EFI_PHYSICAL_ADDRESS) (UINTN) FvHeader, FvHeader->FvLength);
+            Status = PeiCoreFfsFindNextFile (
+                       EFI_FV_FILETYPE_DXE_CORE,
+                       FvHeader,
+                       &FfsFileHeader
+                       );
+
+            if (EFI_ERROR (Status)) {
+              return EFI_NOT_FOUND;
+            }
+
+            return PeiProcessFile (SectionType, FfsFileHeader, Pe32Data);
+          }
+        }
+        //
+        // Decompress successfully.
+        // Loop the decompressed data searching for expected section.
+        //
+        CmpFileData = (VOID *) DstBuffer;
+        CmpFileSize = DstBufferSize;
+        do {
+          CmpSectionLength = *(UINT32 *) (CmpSection->Size) & 0x00ffffff;
+          if (CmpSection->Type == EFI_SECTION_PE32) {
+            //
+            // This is what we want
+            //
+            *Pe32Data = (VOID *) (CmpSection + 1);
+            return EFI_SUCCESS;
+          }
+
+          OccupiedCmpSectionLength  = GetOccupiedSize (CmpSectionLength, 4);
+          CmpSection                = (EFI_COMMON_SECTION_HEADER *) ((UINT8 *) CmpSection + OccupiedCmpSectionLength);
+        } while (CmpSection->Type != 0 && (UINTN) ((UINT8 *) CmpSection - (UINT8 *) CmpFileData) < CmpFileSize);
+      }
+
+      Section   = (EFI_COMMON_SECTION_HEADER *) ((UINT8 *) Section + OccupiedSectionLength);
+      FileSize  = FfsFileHeader->Size[0] & 0xFF;
+      FileSize += (FfsFileHeader->Size[1] << 8) & 0xFF00;
+      FileSize += (FfsFileHeader->Size[2] << 16) & 0xFF0000;
+      FileSize &= 0x00FFFFFF;
+    } while (Section->Type != 0 && (UINTN) ((UINT8 *) Section - (UINT8 *) FfsFileHeader) < FileSize);
+
+    //
+    // End of the decompression activity
+    //
+  } else {
+
+    Status = PeiCoreFfsFindSectionData (
+               EFI_SECTION_PE32,
+               FfsFileHeader,
+               &SectionData
+               );
+
+    if (EFI_ERROR (Status)) {
+      Status = PeiCoreFfsFindSectionData (
+                 EFI_SECTION_TE,
+                 FfsFileHeader,
+                 &SectionData
+                 );
+      if (EFI_ERROR (Status)) {
+        return Status;
+      }
+    }
+  }
+
+  *Pe32Data = SectionData;
+
+  return EFI_SUCCESS;
 }
\ No newline at end of file
index bb88e8a2c8ecba5b0de27ac14399ad25994baa0d..158d088a132935c0a295b4fcadeb2342088e6e95 100644 (file)
@@ -1,47 +1,74 @@
-<?xml version="1.0" encoding="UTF-8"?><!-- 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
-<project basedir="." default="DxeIpl"><!--Apply external ANT tasks-->\r
-   <taskdef resource="GenBuild.tasks"/>\r
-   <taskdef resource="net/sf/antcontrib/antlib.xml"/>\r
-   <property environment="env"/>\r
-   <property name="WORKSPACE_DIR" value="${env.WORKSPACE}"/>\r
-   <import file="${WORKSPACE_DIR}/Tools/Conf/BuildMacro.xml"/><!--MODULE_RELATIVE PATH is relative to PACKAGE_DIR-->\r
-   <property name="MODULE_RELATIVE_PATH" value="Core/DxeIplPeim"/>\r
-   <property name="MODULE_DIR" value="${PACKAGE_DIR}/${MODULE_RELATIVE_PATH}"/>\r
-   <property name="COMMON_FILE" value="${WORKSPACE_DIR}/Tools/Conf/Common.xml"/>\r
-   <target name="DxeIpl">\r
-      <GenBuild baseName="DxeIpl" mbdFilename="${MODULE_DIR}/DxeIpl.mbd" msaFilename="${MODULE_DIR}/DxeIpl.msa"/>\r
-   </target>\r
-   <target depends="DxeIpl_clean" name="clean"/>\r
-   <target depends="DxeIpl_cleanall" name="cleanall"/>\r
-   <target name="DxeIpl_clean">\r
-      <OutputDirSetup baseName="DxeIpl" mbdFilename="${MODULE_DIR}/DxeIpl.mbd" msaFilename="${MODULE_DIR}/DxeIpl.msa"/>\r
-      <if>\r
-         <available file="${DEST_DIR_OUTPUT}/DxeIpl_build.xml"/>\r
-         <then>\r
-            <ant antfile="${DEST_DIR_OUTPUT}/DxeIpl_build.xml" target="clean"/>\r
-         </then>\r
-      </if>\r
-      <delete dir="${DEST_DIR_OUTPUT}" excludes="*.xml"/>\r
-   </target>\r
-   <target name="DxeIpl_cleanall">\r
-      <OutputDirSetup baseName="DxeIpl" mbdFilename="${MODULE_DIR}/DxeIpl.mbd" msaFilename="${MODULE_DIR}/DxeIpl.msa"/>\r
-      <if>\r
-         <available file="${DEST_DIR_OUTPUT}/DxeIpl_build.xml"/>\r
-         <then>\r
-            <ant antfile="${DEST_DIR_OUTPUT}/DxeIpl_build.xml" target="cleanall"/>\r
-         </then>\r
-      </if>\r
-      <delete dir="${DEST_DIR_OUTPUT}"/>\r
-      <delete dir="${DEST_DIR_DEBUG}"/>\r
-      <delete>\r
-         <fileset dir="${BIN_DIR}" includes="**DxeIpl*"/>\r
-      </delete>\r
-   </target>\r
+<?xml version="1.0" encoding="UTF-8"?><!-- Copyright (c) 2006, Intel Corporation 
+All rights reserved. This program and the accompanying materials 
+are licensed and made available under the terms and conditions of the BSD License 
+which accompanies this distribution.  The full text of the license may be found at  
+http://opensource.org/licenses/bsd-license.php 
+
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.-->
+<project basedir="." default="DxeIpl"><!--Apply external ANT tasks-->
+   <taskdef resource="GenBuild.tasks"/>
+   <taskdef resource="net/sf/antcontrib/antlib.xml"/>
+   <property environment="env"/>
+   <property name="WORKSPACE_DIR" value="${env.WORKSPACE}"/>
+   <import file="${WORKSPACE_DIR}/Tools/Conf/BuildMacro.xml"/><!--MODULE_RELATIVE PATH is relative to PACKAGE_DIR-->
+   <property name="MODULE_RELATIVE_PATH" value="Core/DxeIplPeim"/>
+   <property name="MODULE_DIR" value="${PACKAGE_DIR}/${MODULE_RELATIVE_PATH}"/>
+   <property name="COMMON_FILE" value="${WORKSPACE_DIR}/Tools/Conf/Common.xml"/>
+   <target name="DxeIplX64">
+      <GenBuild baseName="DxeIplX64" mbdFilename="${MODULE_DIR}/DxeIplX64.mbd" msaFilename="${MODULE_DIR}/DxeIplX64.msa"/>
+   </target>
+   <target name="DxeIpl">
+      <GenBuild baseName="DxeIpl" mbdFilename="${MODULE_DIR}/DxeIpl.mbd" msaFilename="${MODULE_DIR}/DxeIpl.msa"/>
+   </target>
+   <target depends="DxeIpl_clean" name="clean"/>
+   <target depends="DxeIpl_cleanall" name="cleanall"/>
+   <target name="DxeIplX64_clean">
+      <OutputDirSetup baseName="DxeIplX64" mbdFilename="${MODULE_DIR}/DxeIplX64.mbd" msaFilename="${MODULE_DIR}/DxeIplX64.msa"/>
+      <if>
+         <available file="${DEST_DIR_OUTPUT}/DxeIplX64_build.xml"/>
+         <then>
+            <ant antfile="${DEST_DIR_OUTPUT}/DxeIplX64_build.xml" target="clean"/>
+         </then>
+      </if>
+      <delete dir="${DEST_DIR_OUTPUT}" excludes="*.xml"/>
+   </target>
+   <target name="DxeIpl_clean">
+      <OutputDirSetup baseName="DxeIpl" mbdFilename="${MODULE_DIR}/DxeIpl.mbd" msaFilename="${MODULE_DIR}/DxeIpl.msa"/>
+      <if>
+         <available file="${DEST_DIR_OUTPUT}/DxeIpl_build.xml"/>
+         <then>
+            <ant antfile="${DEST_DIR_OUTPUT}/DxeIpl_build.xml" target="clean"/>
+         </then>
+      </if>
+      <delete dir="${DEST_DIR_OUTPUT}" excludes="*.xml"/>
+   </target>
+   <target name="DxeIplX64_cleanall">
+      <OutputDirSetup baseName="DxeIplX64" mbdFilename="${MODULE_DIR}/DxeIplX64.mbd" msaFilename="${MODULE_DIR}/DxeIplX64.msa"/>
+      <if>
+         <available file="${DEST_DIR_OUTPUT}/DxeIplX64_build.xml"/>
+         <then>
+            <ant antfile="${DEST_DIR_OUTPUT}/DxeIplX64_build.xml" target="cleanall"/>
+         </then>
+      </if>
+      <delete dir="${DEST_DIR_OUTPUT}"/>
+      <delete dir="${DEST_DIR_DEBUG}"/>
+      <delete>
+         <fileset dir="${BIN_DIR}" includes="**DxeIplX64*"/>
+      </delete>
+   </target>
+   <target name="DxeIpl_cleanall">
+      <OutputDirSetup baseName="DxeIpl" mbdFilename="${MODULE_DIR}/DxeIpl.mbd" msaFilename="${MODULE_DIR}/DxeIpl.msa"/>
+      <if>
+         <available file="${DEST_DIR_OUTPUT}/DxeIpl_build.xml"/>
+         <then>
+            <ant antfile="${DEST_DIR_OUTPUT}/DxeIpl_build.xml" target="cleanall"/>
+         </then>
+      </if>
+      <delete dir="${DEST_DIR_OUTPUT}"/>
+      <delete dir="${DEST_DIR_DEBUG}"/>
+      <delete>
+         <fileset dir="${BIN_DIR}" includes="**DxeIpl*"/>
+      </delete>
+   </target>
 </project>
\ No newline at end of file
index a9c4e774cf9993c8ee6eb384d8f1f3fbe700f58d..ae87bd83e4b78ce4d9429cd12deedd544cf4668a 100644 (file)
-      TITLE   LongMode.asm: Assembly code for the entering long mode\r
-\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
-;*    LongMode.asm\r
-;*  \r
-;*   Abstract:\r
-;*\r
-;*    Transition from 32-bit protected mode EFI environment into x64 \r
-;*    64-bit bit long mode.\r
-;*  \r
-;------------------------------------------------------------------------------\r
-\r
-.686p\r
-.model  flat        \r
-\r
-;\r
-; Create the exception handler code in IA32 C code\r
-;\r
-\r
-.code\r
-.stack\r
-.MMX\r
-.XMM\r
-\r
-_LoadGo64Gdt   PROC Near Public\r
-    push    ebp               ; C prolog\r
-    push    edi\r
-    mov     ebp, esp\r
-    ;\r
-    ; Disable interrupts\r
-    ;\r
-    cli\r
-    ;\r
-    ; Reload the selectors\r
-    ; Note:\r
-    ;      Make the Selectors 64-bit ready\r
-    ;\r
-    mov     edi, OFFSET gdtr    ; Load GDT register\r
-    mov     ax,cs               ; Get the selector data from our code image          \r
-    mov     es,ax\r
-    lgdt    FWORD PTR es:[edi]  ; and update the GDTR   \r
-\r
-    db      067h\r
-    db      0eah              ; Far Jump Offset:Selector to reload CS\r
-    dd      OFFSET DataSelectorRld;   Offset is ensuing instruction boundary\r
-    dw      LINEAR_CODE_SEL   ;   Selector is our code selector, 10h\r
-DataSelectorRld::\r
-    mov     ax, SYS_DATA_SEL ; Update the Base for the new selectors, too\r
-    mov     ds, ax\r
-    mov     es, ax\r
-    mov     fs, ax\r
-    mov     gs, ax\r
-    mov     ss, ax  \r
-    \r
-    pop     edi\r
-    pop     ebp\r
-    ret\r
-_LoadGo64Gdt endp   \r
-    \r
-\r
-; VOID\r
-; ActivateLongMode (\r
-;   IN  EFI_PHYSICAL_ADDRESS  PageTables,  \r
-;   IN  EFI_PHYSICAL_ADDRESS  HobStart,\r
-;   IN  EFI_PHYSICAL_ADDRESS  Stack,\r
-;   IN  EFI_PHYSICAL_ADDRESS  PpisNeededByDxeIplEntryPoint,\r
-;   IN  EFI_PHYSICAL_ADDRESS  DxeCoreEntryPoint\r
-;   )\r
-;\r
-; Input:  [ebp][0h]  = Original ebp\r
-;         [ebp][4h]  = Return address\r
-;         [ebp][8h]  = PageTables\r
-;         [ebp][10h] = HobStart\r
-;         [ebp][18h] = Stack\r
-;         [ebp][20h] = CodeEntryPoint1 <--- Call this first (for each call, pass HOB pointer)\r
-;         [ebp][28h] = CodeEntryPoint2 <--- Call this second\r
-;\r
-;\r
-_ActivateLongMode  PROC Near Public\r
-    push    ebp               ; C prolog\r
-    mov     ebp, esp\r
-\r
-    ;\r
-    ; Use CPUID to determine if the processor supports long mode.\r
-    ;\r
-    mov     eax, 80000000h  ; Extended-function code 8000000h.\r
-    cpuid                   ; Is largest extended function\r
-    cmp     eax, 80000000h  ; any function > 80000000h?\r
-    jbe     no_long_mode    ; If not, no long mode.\r
-    mov     eax, 80000001h  ; Extended-function code 8000001h.\r
-    cpuid                   ; Now EDX = extended-features flags.\r
-    bt      edx, 29         ; Test if long mode is supported.\r
-    jnc     no_long_mode    ; Exit if not supported.\r
-\r
-    ;\r
-    ; Enable the 64-bit page-translation-table entries by\r
-    ; setting CR4.PAE=1 (this is _required_ before activating\r
-    ; long mode). Paging is not enabled until after long mode\r
-    ; is enabled.\r
-    ;\r
-    mov eax, cr4\r
-    bts eax, 5\r
-    mov cr4, eax\r
-\r
-    ;\r
-    ; Get the long-mode page tables, and initialize the\r
-    ; 64-bit CR3 (page-table base address) to point to the base\r
-    ; of the PML4 page table. The PML4 page table must be located\r
-    ; below 4 Gbytes because only 32 bits of CR3 are loaded when\r
-    ; the processor is not in 64-bit mode.\r
-    ;\r
-    mov eax, [ebp+8h]       ; Get Page Tables\r
-    mov cr3, eax            ; Initialize CR3 with PML4 base.\r
-\r
-    ;\r
-    ; Enable long mode (set EFER.LME=1).\r
-    ;\r
-    mov ecx, 0c0000080h ; EFER MSR number.\r
-    rdmsr               ; Read EFER.\r
-    bts eax, 8          ; Set LME=1.\r
-    wrmsr               ; Write EFER.\r
-\r
-    ;\r
-    ; Enable paging to activate long mode (set CR0.PG=1)\r
-    ;\r
-   \r
-   \r
-    mov eax, cr0 ; Read CR0.\r
-    bts eax, 31  ; Set PG=1.\r
-    mov cr0, eax ; Write CR0.\r
-    jmp   go_to_long_mode\r
-go_to_long_mode:\r
-\r
-    ;\r
-    ; This is the next instruction after enabling paging.  Jump to long mode\r
-    ;\r
-    db      067h\r
-    db      0eah              ; Far Jump Offset:Selector to reload CS\r
-    dd      OFFSET in_long_mode;   Offset is ensuing instruction boundary\r
-    dw      SYS_CODE64_SEL    ;   Selector is our code selector, 10h\r
-in_long_mode::\r
-    mov     ax, SYS_DATA64_SEL\r
-    mov     es, ax\r
-    mov     ss, ax\r
-    mov     ds, ax\r
-;;    jmp     $\r
-    \r
-           \r
-    ;\r
-    ; We're in long mode, so marshall the arguments to call the\r
-    ; passed in function pointers\r
-    ; Recall\r
-    ;         [ebp][10h] = HobStart\r
-    ;         [ebp][18h] = Stack\r
-    ;         [ebp][20h] = PpisNeededByDxeIplEntryPoint <--- Call this first (for each call, pass HOB pointer)\r
-    ;         [ebp][28h] = DxeCoreEntryPoint            <--- Call this second\r
-    ;\r
-    db  48h\r
-    mov ebx, [ebp+18h]        ; Setup the stack\r
-    db  48h\r
-    mov esp, ebx              ; On a new stack now\r
-\r
-    db  48h\r
-    mov ecx, [ebp+10h]        ; Pass Hob Start in RCX\r
-    db  48h\r
-    mov eax, [ebp+20h]        ; Get the function pointer for \r
-                              ; PpisNeededByDxeIplEntryPoint into EAX\r
-\r
-;; 00000905  FF D0                 call rax\r
-    db 0ffh\r
-    db 0d0h\r
-\r
-    db  48h\r
-    mov ecx, [ebp+10h]        ; Pass Hob Start in RCX\r
-    db  48h\r
-    mov eax, [ebp+28h]        ; Get the function pointer for \r
-                              ; DxeCoreEntryPoint into EAX\r
-\r
-;; 00000905  FF D0                 call rax\r
-    db 0ffh\r
-    db 0d0h\r
-\r
-    ;\r
-    ; WE SHOULD NEVER GET HERE!!!!!!!!!!!!!\r
-    ;\r
-no_long_mode:\r
-    jmp   no_long_mode\r
-_ActivateLongMode endp\r
-\r
-        align 16\r
-\r
-gdtr    dw GDT_END - GDT_BASE - 1   ; GDT limit\r
-        dd OFFSET GDT_BASE          ; (GDT base gets set above)\r
-\r
-;-----------------------------------------------------------------------------;\r
-;   global descriptor table (GDT)\r
-;-----------------------------------------------------------------------------;\r
-\r
-        align 16\r
-\r
-public GDT_BASE\r
-GDT_BASE:\r
-; null descriptor\r
-NULL_SEL            equ $-GDT_BASE    ; Selector [0]\r
-        dw 0            ; limit 15:0\r
-        dw 0            ; base 15:0\r
-        db 0            ; base 23:16\r
-        db 0            ; type\r
-        db 0            ; limit 19:16, flags\r
-        db 0            ; base 31:24\r
-\r
-; linear data segment descriptor\r
-LINEAR_SEL      equ $-GDT_BASE        ; Selector [0x8]\r
-        dw 0FFFFh       ; limit 0xFFFFF\r
-        dw 0            ; base 0\r
-        db 0\r
-        db 092h         ; present, ring 0, data, expand-up, writable\r
-        db 0CFh                 ; page-granular, 32-bit\r
-        db 0\r
-\r
-; linear code segment descriptor\r
-LINEAR_CODE_SEL equ $-GDT_BASE        ; Selector [0x10]\r
-        dw 0FFFFh       ; limit 0xFFFFF\r
-        dw 0            ; base 0\r
-        db 0\r
-        db 09Fh         ; present, ring 0, data, expand-up, writable\r
-        db 0CFh                 ; page-granular, 32-bit\r
-        db 0\r
-\r
-; system data segment descriptor\r
-SYS_DATA_SEL    equ $-GDT_BASE        ; Selector [0x18]\r
-        dw 0FFFFh       ; limit 0xFFFFF\r
-        dw 0            ; base 0\r
-        db 0\r
-        db 093h         ; present, ring 0, data, expand-up, writable\r
-        db 0CFh                 ; page-granular, 32-bit\r
-        db 0\r
-\r
-; system code segment descriptor\r
-SYS_CODE_SEL    equ $-GDT_BASE        ; Selector [0x20]\r
-        dw 0FFFFh       ; limit 0xFFFFF\r
-        dw 0            ; base 0\r
-        db 0\r
-        db 09Ah         ; present, ring 0, data, expand-up, writable\r
-        db 0CFh                 ; page-granular, 32-bit\r
-        db 0\r
-\r
-; spare segment descriptor\r
-SPARE3_SEL  equ $-GDT_BASE            ; Selector [0x28]\r
-        dw 0            ; limit 0xFFFFF\r
-        dw 0            ; base 0\r
-        db 0\r
-        db 0            ; present, ring 0, data, expand-up, writable\r
-        db 0            ; page-granular, 32-bit\r
-        db 0\r
-\r
-;\r
-; system data segment descriptor\r
-;\r
-SYS_DATA64_SEL    equ $-GDT_BASE          ; Selector [0x30]\r
-        dw 0FFFFh       ; limit 0xFFFFF\r
-        dw 0            ; base 0\r
-        db 0\r
-        db 092h         ; P | DPL [1..2] | 1   | 1   | C | R | A\r
-        db 0CFh         ; G | D   | L    | AVL | Segment [19..16]\r
-        db 0\r
-\r
-;\r
-; system code segment descriptor\r
-;\r
-SYS_CODE64_SEL    equ $-GDT_BASE          ; Selector [0x38]\r
-        dw 0FFFFh       ; limit 0xFFFFF\r
-        dw 0            ; base 0\r
-        db 0\r
-        db 09Ah         ; P | DPL [1..2] | 1   | 1   | C | R | A\r
-        db 0AFh         ; G | D   | L    | AVL | Segment [19..16]\r
-        db 0\r
-\r
-; spare segment descriptor\r
-SPARE4_SEL  equ $-GDT_BASE            ; Selector [0x40]\r
-        dw 0            ; limit 0xFFFFF\r
-        dw 0            ; base 0\r
-        db 0\r
-        db 0            ; present, ring 0, data, expand-up, writable\r
-        db 0            ; page-granular, 32-bit\r
-        db 0\r
-\r
-GDT_END:\r
-\r
-;\r
-;\r
-;------------------------------------------------------------------------------\r
-;  Generic IDT Vector Handlers for the Host. They are all the same so they\r
-;  will compress really well.\r
-;\r
-;  By knowing the return address for Vector 00 you can can calculate the\r
-;  vector number by looking at the call CommonInterruptEntry return address.\r
-;  (return address - AsmIdtVector00Base)/8 == IDT index\r
-;\r
-;------------------------------------------------------------------------------\r
-\r
-_AsmIdtVector00 PROC NEAR PUBLIC\r
-    call  CommonInterruptEntry\r
-_AsmIdtVector00 ENDP\r
-AsmIdtVector00Base PROC NEAR PUBLIC\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-    call  CommonInterruptEntry\r
-       nop\r
-       nop\r
-       nop\r
-AsmIdtVector00Base ENDP\r
-\r
-\r
-;---------------------------------------;\r
-; CommonInterruptEntry                  ;\r
-;---------------------------------------;\r
-; The follow algorithm is used for the common interrupt routine.\r
-; TBD: Save EFI_SYSTEM_CONTEXT_x64 on the stack per AP definition\r
-;\r
-;\r
-CommonInterruptEntry PROC NEAR PUBLIC\r
-  cli\r
-  jmp   $  \r
-  iret\r
-\r
-CommonInterruptEntry ENDP\r
-\r
-END\r
-\r
+      TITLE   LongMode.asm: Assembly code for the entering long mode
+
+;------------------------------------------------------------------------------
+;*
+;*   Copyright (c) 2006, Intel Corporation                                                         
+;*   All rights reserved. This program and the accompanying materials                          
+;*   are licensed and made available under the terms and conditions of the BSD License         
+;*   which accompanies this distribution.  The full text of the license may be found at        
+;*   http://opensource.org/licenses/bsd-license.php                                            
+;*                                                                                             
+;*   THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     
+;*   WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             
+;*   
+;*    LongMode.asm
+;*  
+;*   Abstract:
+;*
+;*    Transition from 32-bit protected mode EFI environment into x64 
+;*    64-bit bit long mode.
+;*  
+;------------------------------------------------------------------------------
+
+.686p
+.model  flat        
+
+;
+; Create the exception handler code in IA32 C code
+;
+
+.code
+.stack
+.MMX
+.XMM
+
+_LoadGo64Gdt   PROC Near Public
+    push    ebp               ; C prolog
+    push    edi
+    mov     ebp, esp
+    ;
+    ; Disable interrupts
+    ;
+    cli
+    ;
+    ; Reload the selectors
+    ; Note:
+    ;      Make the Selectors 64-bit ready
+    ;
+    mov     edi, OFFSET gdtr    ; Load GDT register
+    mov     ax,cs               ; Get the selector data from our code image          
+    mov     es,ax
+    lgdt    FWORD PTR es:[edi]  ; and update the GDTR   
+
+    db      067h
+    db      0eah              ; Far Jump Offset:Selector to reload CS
+    dd      OFFSET DataSelectorRld;   Offset is ensuing instruction boundary
+    dw      LINEAR_CODE_SEL   ;   Selector is our code selector, 10h
+DataSelectorRld::
+    mov     ax, SYS_DATA_SEL ; Update the Base for the new selectors, too
+    mov     ds, ax
+    mov     es, ax
+    mov     fs, ax
+    mov     gs, ax
+    mov     ss, ax  
+    
+    pop     edi
+    pop     ebp
+    ret
+_LoadGo64Gdt endp   
+    
+
+; VOID
+; ActivateLongMode (
+;   IN  EFI_PHYSICAL_ADDRESS  PageTables,  
+;   IN  EFI_PHYSICAL_ADDRESS  HobStart,
+;   IN  EFI_PHYSICAL_ADDRESS  Stack,
+;   IN  EFI_PHYSICAL_ADDRESS  PpisNeededByDxeIplEntryPoint,
+;   IN  EFI_PHYSICAL_ADDRESS  DxeCoreEntryPoint
+;   )
+;
+; Input:  [ebp][0h]  = Original ebp
+;         [ebp][4h]  = Return address
+;         [ebp][8h]  = PageTables
+;         [ebp][10h] = HobStart
+;         [ebp][18h] = Stack
+;         [ebp][20h] = CodeEntryPoint1 <--- Call this first (for each call, pass HOB pointer)
+;         [ebp][28h] = CodeEntryPoint2 <--- Call this second
+;
+;
+_ActivateLongMode  PROC Near Public
+    push    ebp               ; C prolog
+    mov     ebp, esp
+
+    ;
+    ; Use CPUID to determine if the processor supports long mode.
+    ;
+    mov     eax, 80000000h  ; Extended-function code 8000000h.
+    cpuid                   ; Is largest extended function
+    cmp     eax, 80000000h  ; any function > 80000000h?
+    jbe     no_long_mode    ; If not, no long mode.
+    mov     eax, 80000001h  ; Extended-function code 8000001h.
+    cpuid                   ; Now EDX = extended-features flags.
+    bt      edx, 29         ; Test if long mode is supported.
+    jnc     no_long_mode    ; Exit if not supported.
+
+    ;
+    ; Enable the 64-bit page-translation-table entries by
+    ; setting CR4.PAE=1 (this is _required_ before activating
+    ; long mode). Paging is not enabled until after long mode
+    ; is enabled.
+    ;
+    mov eax, cr4
+    bts eax, 5
+    mov cr4, eax
+
+    ;
+    ; Get the long-mode page tables, and initialize the
+    ; 64-bit CR3 (page-table base address) to point to the base
+    ; of the PML4 page table. The PML4 page table must be located
+    ; below 4 Gbytes because only 32 bits of CR3 are loaded when
+    ; the processor is not in 64-bit mode.
+    ;
+    mov eax, [ebp+8h]       ; Get Page Tables
+    mov cr3, eax            ; Initialize CR3 with PML4 base.
+
+    ;
+    ; Enable long mode (set EFER.LME=1).
+    ;
+    mov ecx, 0c0000080h ; EFER MSR number.
+    rdmsr               ; Read EFER.
+    bts eax, 8          ; Set LME=1.
+    wrmsr               ; Write EFER.
+
+    ;
+    ; Enable paging to activate long mode (set CR0.PG=1)
+    ;
+   
+   
+    mov eax, cr0 ; Read CR0.
+    bts eax, 31  ; Set PG=1.
+    mov cr0, eax ; Write CR0.
+    jmp   go_to_long_mode
+go_to_long_mode:
+
+    ;
+    ; This is the next instruction after enabling paging.  Jump to long mode
+    ;
+    db      067h
+    db      0eah              ; Far Jump Offset:Selector to reload CS
+    dd      OFFSET in_long_mode;   Offset is ensuing instruction boundary
+    dw      SYS_CODE64_SEL    ;   Selector is our code selector, 10h
+in_long_mode::
+    mov     ax, SYS_DATA64_SEL
+    mov     es, ax
+    mov     ss, ax
+    mov     ds, ax
+;;    jmp     $
+    
+           
+    ;
+    ; We're in long mode, so marshall the arguments to call the
+    ; passed in function pointers
+    ; Recall
+    ;         [ebp][10h] = HobStart
+    ;         [ebp][18h] = Stack
+    ;         [ebp][20h] = PpisNeededByDxeIplEntryPoint <--- Call this first (for each call, pass HOB pointer)
+    ;         [ebp][28h] = DxeCoreEntryPoint            <--- Call this second
+    ;
+    db  48h
+    mov ebx, [ebp+18h]        ; Setup the stack
+    db  48h
+    mov esp, ebx              ; On a new stack now
+
+
+;; 00000905  FF D0                 call rax
+
+    db  48h
+    mov ecx, [ebp+10h]        ; Pass Hob Start in RCX
+    db  48h
+    mov eax, [ebp+28h]        ; Get the function pointer for 
+                              ; DxeCoreEntryPoint into EAX
+
+;; 00000905  FF D0                 call rax
+    db 0ffh
+    db 0d0h
+
+    ;
+    ; WE SHOULD NEVER GET HERE!!!!!!!!!!!!!
+    ;
+no_long_mode:
+    jmp   no_long_mode
+_ActivateLongMode endp
+
+        align 16
+
+gdtr    dw GDT_END - GDT_BASE - 1   ; GDT limit
+        dd OFFSET GDT_BASE          ; (GDT base gets set above)
+
+;-----------------------------------------------------------------------------;
+;   global descriptor table (GDT)
+;-----------------------------------------------------------------------------;
+
+        align 16
+
+public GDT_BASE
+GDT_BASE:
+; null descriptor
+NULL_SEL            equ $-GDT_BASE    ; Selector [0]
+        dw 0            ; limit 15:0
+        dw 0            ; base 15:0
+        db 0            ; base 23:16
+        db 0            ; type
+        db 0            ; limit 19:16, flags
+        db 0            ; base 31:24
+
+; linear data segment descriptor
+LINEAR_SEL      equ $-GDT_BASE        ; Selector [0x8]
+        dw 0FFFFh       ; limit 0xFFFFF
+        dw 0            ; base 0
+        db 0
+        db 092h         ; present, ring 0, data, expand-up, writable
+        db 0CFh                 ; page-granular, 32-bit
+        db 0
+
+; linear code segment descriptor
+LINEAR_CODE_SEL equ $-GDT_BASE        ; Selector [0x10]
+        dw 0FFFFh       ; limit 0xFFFFF
+        dw 0            ; base 0
+        db 0
+        db 09Fh         ; present, ring 0, data, expand-up, writable
+        db 0CFh                 ; page-granular, 32-bit
+        db 0
+
+; system data segment descriptor
+SYS_DATA_SEL    equ $-GDT_BASE        ; Selector [0x18]
+        dw 0FFFFh       ; limit 0xFFFFF
+        dw 0            ; base 0
+        db 0
+        db 093h         ; present, ring 0, data, expand-up, writable
+        db 0CFh                 ; page-granular, 32-bit
+        db 0
+
+; system code segment descriptor
+SYS_CODE_SEL    equ $-GDT_BASE        ; Selector [0x20]
+        dw 0FFFFh       ; limit 0xFFFFF
+        dw 0            ; base 0
+        db 0
+        db 09Ah         ; present, ring 0, data, expand-up, writable
+        db 0CFh                 ; page-granular, 32-bit
+        db 0
+
+; spare segment descriptor
+SPARE3_SEL  equ $-GDT_BASE            ; Selector [0x28]
+        dw 0            ; limit 0xFFFFF
+        dw 0            ; base 0
+        db 0
+        db 0            ; present, ring 0, data, expand-up, writable
+        db 0            ; page-granular, 32-bit
+        db 0
+
+;
+; system data segment descriptor
+;
+SYS_DATA64_SEL    equ $-GDT_BASE          ; Selector [0x30]
+        dw 0FFFFh       ; limit 0xFFFFF
+        dw 0            ; base 0
+        db 0
+        db 092h         ; P | DPL [1..2] | 1   | 1   | C | R | A
+        db 0CFh         ; G | D   | L    | AVL | Segment [19..16]
+        db 0
+
+;
+; system code segment descriptor
+;
+SYS_CODE64_SEL    equ $-GDT_BASE          ; Selector [0x38]
+        dw 0FFFFh       ; limit 0xFFFFF
+        dw 0            ; base 0
+        db 0
+        db 09Ah         ; P | DPL [1..2] | 1   | 1   | C | R | A
+        db 0AFh         ; G | D   | L    | AVL | Segment [19..16]
+        db 0
+
+; spare segment descriptor
+SPARE4_SEL  equ $-GDT_BASE            ; Selector [0x40]
+        dw 0            ; limit 0xFFFFF
+        dw 0            ; base 0
+        db 0
+        db 0            ; present, ring 0, data, expand-up, writable
+        db 0            ; page-granular, 32-bit
+        db 0
+
+GDT_END:
+
+;
+;
+;------------------------------------------------------------------------------
+;  Generic IDT Vector Handlers for the Host. They are all the same so they
+;  will compress really well.
+;
+;  By knowing the return address for Vector 00 you can can calculate the
+;  vector number by looking at the call CommonInterruptEntry return address.
+;  (return address - AsmIdtVector00Base)/8 == IDT index
+;
+;------------------------------------------------------------------------------
+
+_AsmIdtVector00 PROC NEAR PUBLIC
+    call  CommonInterruptEntry
+_AsmIdtVector00 ENDP
+AsmIdtVector00Base PROC NEAR PUBLIC
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+    call  CommonInterruptEntry
+       nop
+       nop
+       nop
+AsmIdtVector00Base ENDP
+
+
+;---------------------------------------;
+; CommonInterruptEntry                  ;
+;---------------------------------------;
+; The follow algorithm is used for the common interrupt routine.
+; TBD: Save EFI_SYSTEM_CONTEXT_x64 on the stack per AP definition
+;
+;
+CommonInterruptEntry PROC NEAR PUBLIC
+  cli
+  jmp   $  
+  iret
+
+CommonInterruptEntry ENDP
+
+END
+
index 74286cff3112f209f8e5918073a7a48eea97671c..4c1fcf606eedc4a4bb5e9d85756bffb0421fc84b 100644 (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:\r
-\r
-  Image.c\r
-\r
-Abstract:\r
-\r
-  Pei Core Load Image Support\r
-\r
---*/\r
-\r
-#include <PeiMain.h>\r
-\r
-EFI_STATUS\r
-PeiLoadImage (\r
-  IN EFI_PEI_SERVICES         **PeiServices,\r
-  IN EFI_FFS_FILE_HEADER      *PeimFileHeader,\r
-  OUT VOID                    **EntryPoint\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Routine for loading file image.\r
-\r
-Arguments:\r
-\r
-  PeiServices     - The PEI core services table.\r
-  PeimFileHeader  - Pointer to the FFS file header of the image.\r
-  EntryPoint      - Pointer to entry point of specified image file for output.\r
-\r
-Returns:\r
-\r
-  Status - EFI_SUCCESS    - Image is successfully loaded.\r
-           EFI_NOT_FOUND  - Fail to locate necessary PPI\r
-           Others         - Fail to load file.\r
-\r
---*/\r
-{\r
-  EFI_STATUS                  Status;\r
-  VOID                        *Pe32Data;\r
-  EFI_PEI_FV_FILE_LOADER_PPI  *FvLoadFilePpi;\r
-//#ifdef EFI_NT_EMULATOR\r
-//  EFI_PEI_PPI_DESCRIPTOR      *PpiDescriptor;\r
-//  NT_PEI_LOAD_FILE_PPI        *PeiNtService;\r
-//#endif\r
-  EFI_PHYSICAL_ADDRESS        ImageAddress;\r
-  UINT64                      ImageSize;\r
-  EFI_PHYSICAL_ADDRESS        ImageEntryPoint;\r
-  EFI_TE_IMAGE_HEADER         *TEImageHeader;\r
-\r
-  *EntryPoint   = NULL;\r
-  TEImageHeader = NULL;\r
-\r
-  //\r
-  // Try to find a PE32 section.\r
-  //\r
-  Status = PeiCoreFfsFindSectionData (\r
-             EFI_SECTION_PE32,\r
-             PeimFileHeader,\r
-             &Pe32Data\r
-             );\r
-  //\r
-  // If we didn't find a PE32 section, try to find a TE section.\r
-  //\r
-  if (EFI_ERROR (Status)) {\r
-    Status = PeiCoreFfsFindSectionData (\r
-               EFI_SECTION_TE,\r
-               PeimFileHeader,\r
-               (VOID **) &TEImageHeader\r
-               );\r
-    if (EFI_ERROR (Status) || TEImageHeader == NULL) {\r
-      //\r
-      // There was not a PE32 or a TE section, so assume that it's a Compressed section\r
-      // and use the LoadFile\r
-      //\r
-      Status = PeiCoreLocatePpi (\r
-                &gEfiPeiFvFileLoaderPpiGuid,\r
-                0,\r
-                NULL,\r
-                (VOID **)&FvLoadFilePpi\r
-                );\r
-      if (EFI_ERROR (Status)) {\r
-        return EFI_NOT_FOUND;\r
-      }\r
-\r
-      Status = FvLoadFilePpi->FvLoadFile (\r
-                                FvLoadFilePpi,\r
-                                PeimFileHeader,\r
-                                &ImageAddress,\r
-                                &ImageSize,\r
-                                &ImageEntryPoint\r
-                                );\r
-\r
-      if (EFI_ERROR (Status)) {\r
-        return EFI_NOT_FOUND;\r
-      }\r
-\r
-      //\r
-      // Retrieve the entry point from the PE/COFF image header\r
-      //\r
-      Status = PeCoffLoaderGetEntryPoint ((VOID *)(UINTN)ImageAddress, EntryPoint);\r
-      if (EFI_ERROR (Status)) {\r
-        return EFI_NOT_FOUND;\r
-      }\r
-    } else {\r
-      //\r
-      // Retrieve the entry point from the TE image header\r
-      //\r
-      ImageAddress = (EFI_PHYSICAL_ADDRESS) (UINTN) TEImageHeader;\r
-      *EntryPoint = (VOID *)((UINTN) TEImageHeader + sizeof (EFI_TE_IMAGE_HEADER) +\r
-                    TEImageHeader->AddressOfEntryPoint - TEImageHeader->StrippedSize);\r
-    }\r
-  } else {\r
-    //\r
-    // Retrieve the entry point from the PE/COFF image header\r
-    //\r
-    ImageAddress = (EFI_PHYSICAL_ADDRESS) (UINTN) Pe32Data;\r
-    Status = PeCoffLoaderGetEntryPoint (Pe32Data, EntryPoint);\r
-    if (EFI_ERROR (Status)) {\r
-      return EFI_NOT_FOUND;\r
-    }\r
-  }\r
-\r
-  //\r
-  // Print debug message: Loading PEIM at 0x12345678 EntryPoint=0x12345688 Driver.efi\r
-  //\r
-  DEBUG ((EFI_D_INFO | EFI_D_LOAD, "Loading PEIM at 0x%08x EntryPoint=0x%08x ", Pe32Data, *EntryPoint));\r
-  DEBUG_CODE (\r
-    EFI_IMAGE_DATA_DIRECTORY * DirectoryEntry;\r
-    EFI_IMAGE_DEBUG_DIRECTORY_ENTRY * DebugEntry;\r
-    UINTN DirCount;\r
-    UINTN Index;\r
-    UINTN Index1;\r
-    BOOLEAN FileNameFound;\r
-    CHAR8 *AsciiString;\r
-    CHAR8 AsciiBuffer[512];\r
-    VOID *CodeViewEntryPointer;\r
-    INTN TEImageAdjust;\r
-    EFI_IMAGE_DOS_HEADER  *DosHeader;\r
-    EFI_IMAGE_NT_HEADERS  *PeHeader;\r
-\r
-    DosHeader = (EFI_IMAGE_DOS_HEADER *)Pe32Data;\r
-    if (DosHeader->e_magic == EFI_IMAGE_DOS_SIGNATURE) {\r
-      //\r
-      // DOS image header is present, so read the PE header after the DOS image header\r
-      //\r
-      PeHeader = (EFI_IMAGE_NT_HEADERS *) ((UINTN) Pe32Data + (UINTN) ((DosHeader->e_lfanew) & 0x0ffff));\r
-    } else {\r
-      //\r
-      // DOS image header is not present, so PE header is at the image base\r
-      //\r
-      PeHeader = (EFI_IMAGE_NT_HEADERS *) Pe32Data;\r
-    }\r
-\r
-    //\r
-    // Find the codeview info in the image and display the file name\r
-    // being loaded.\r
-    //\r
-    // Per the PE/COFF spec, you can't assume that a given data directory\r
-    // is present in the image. You have to check the NumberOfRvaAndSizes in\r
-    // the optional header to verify a desired directory entry is there.\r
-    //\r
-    DebugEntry      = NULL;\r
-    DirectoryEntry  = NULL;\r
-    TEImageAdjust   = 0;\r
-    if (TEImageHeader == NULL) {\r
-      if (PeHeader->OptionalHeader.NumberOfRvaAndSizes > EFI_IMAGE_DIRECTORY_ENTRY_DEBUG) {\r
-        DirectoryEntry = (EFI_IMAGE_DATA_DIRECTORY *) &(PeHeader->OptionalHeader.DataDirectory[EFI_IMAGE_DIRECTORY_ENTRY_DEBUG]);\r
-        DebugEntry = (EFI_IMAGE_DEBUG_DIRECTORY_ENTRY *) ((UINTN) ImageAddress + DirectoryEntry->VirtualAddress);\r
-      }\r
-    } else {\r
-      if (TEImageHeader->DataDirectory[EFI_TE_IMAGE_DIRECTORY_ENTRY_DEBUG].VirtualAddress != 0) {\r
-        DirectoryEntry  = &TEImageHeader->DataDirectory[EFI_TE_IMAGE_DIRECTORY_ENTRY_DEBUG];\r
-        TEImageAdjust   = sizeof (EFI_TE_IMAGE_HEADER) - TEImageHeader->StrippedSize;\r
-        DebugEntry = (EFI_IMAGE_DEBUG_DIRECTORY_ENTRY *)((UINTN) TEImageHeader +\r
-                      TEImageHeader->DataDirectory[EFI_TE_IMAGE_DIRECTORY_ENTRY_DEBUG].VirtualAddress +\r
-                      TEImageAdjust);\r
-      }\r
-    }\r
-\r
-    if (DebugEntry != NULL && DirectoryEntry != NULL) {\r
-      for (DirCount = 0; DirCount < DirectoryEntry->Size; DirCount++, DebugEntry++) {\r
-        if (DebugEntry->Type == EFI_IMAGE_DEBUG_TYPE_CODEVIEW) {\r
-          if (DebugEntry->SizeOfData > 0) {\r
-            CodeViewEntryPointer = (VOID *) ((UINTN) DebugEntry->RVA + (UINTN) ImageAddress + (UINTN)TEImageAdjust);\r
-            switch (* (UINT32 *) CodeViewEntryPointer) {\r
-              case CODEVIEW_SIGNATURE_NB10:\r
-                AsciiString = (CHAR8 *) CodeViewEntryPointer + sizeof (EFI_IMAGE_DEBUG_CODEVIEW_NB10_ENTRY);\r
-                break;\r
-\r
-              case CODEVIEW_SIGNATURE_RSDS:\r
-                AsciiString = (CHAR8 *) CodeViewEntryPointer + sizeof (EFI_IMAGE_DEBUG_CODEVIEW_RSDS_ENTRY);\r
-                break;\r
-\r
-              default:\r
-                AsciiString = NULL;\r
-                break;\r
-            }\r
-            if (AsciiString != NULL) {\r
-              FileNameFound = FALSE;\r
-              for (Index = 0, Index1 = 0; AsciiString[Index] != 0; Index++) {\r
-                if (AsciiString[Index] == '\\') {\r
-                  Index1 = Index;\r
-                  FileNameFound = TRUE;\r
-                }\r
-              }\r
-\r
-              if (FileNameFound) {\r
-                for (Index = Index1 + 1; AsciiString[Index] != '.'; Index++) {\r
-                  AsciiBuffer[Index - (Index1 + 1)] = AsciiString[Index];\r
-                }\r
-                AsciiBuffer[Index - (Index1 + 1)] = 0;\r
-                DEBUG ((EFI_D_INFO | EFI_D_LOAD, "%a.efi", AsciiBuffer));\r
-                break;\r
-              }\r
-            }\r
-          }\r
-        }\r
-      }\r
-    }\r
-  );\r
-\r
-  DEBUG ((EFI_D_INFO | EFI_D_LOAD, "\n"));\r
-\r
-  return EFI_SUCCESS;\r
-}\r
+/*++
+
+Copyright (c) 2006, Intel Corporation                                                         
+All rights reserved. This program and the accompanying materials                          
+are licensed and made available under the terms and conditions of the BSD License         
+which accompanies this distribution.  The full text of the license may be found at        
+http://opensource.org/licenses/bsd-license.php                                            
+                                                                                          
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             
+
+Module Name:
+
+  Image.c
+
+Abstract:
+
+  Pei Core Load Image Support
+
+--*/
+
+#include <PeiMain.h>
+
+EFI_STATUS
+PeiLoadImage (
+  IN EFI_PEI_SERVICES         **PeiServices,
+  IN EFI_FFS_FILE_HEADER      *PeimFileHeader,
+  OUT VOID                    **EntryPoint
+  )
+/*++
+
+Routine Description:
+
+  Routine for loading file image.
+
+Arguments:
+
+  PeiServices     - The PEI core services table.
+  PeimFileHeader  - Pointer to the FFS file header of the image.
+  EntryPoint      - Pointer to entry point of specified image file for output.
+
+Returns:
+
+  Status - EFI_SUCCESS    - Image is successfully loaded.
+           EFI_NOT_FOUND  - Fail to locate necessary PPI
+           Others         - Fail to load file.
+
+--*/
+{
+  EFI_STATUS                  Status;
+  VOID                        *Pe32Data;
+  EFI_PEI_FV_FILE_LOADER_PPI  *FvLoadFilePpi;
+//#ifdef EFI_NT_EMULATOR
+//  EFI_PEI_PPI_DESCRIPTOR      *PpiDescriptor;
+//  NT_PEI_LOAD_FILE_PPI        *PeiNtService;
+//#endif
+  EFI_PHYSICAL_ADDRESS        ImageAddress;
+  UINT64                      ImageSize;
+  EFI_PHYSICAL_ADDRESS        ImageEntryPoint;
+  EFI_TE_IMAGE_HEADER         *TEImageHeader;
+
+  *EntryPoint   = NULL;
+  TEImageHeader = NULL;
+
+  //
+  // Try to find a PE32 section.
+  //
+  Status = PeiCoreFfsFindSectionData (
+             EFI_SECTION_PE32,
+             PeimFileHeader,
+             &Pe32Data
+             );
+  //
+  // If we didn't find a PE32 section, try to find a TE section.
+  //
+  if (EFI_ERROR (Status)) {
+    Status = PeiCoreFfsFindSectionData (
+               EFI_SECTION_TE,
+               PeimFileHeader,
+               (VOID **) &TEImageHeader
+               );
+    if (EFI_ERROR (Status) || TEImageHeader == NULL) {
+      //
+      // There was not a PE32 or a TE section, so assume that it's a Compressed section
+      // and use the LoadFile
+      //
+      Status = PeiCoreLocatePpi (
+                &gEfiPeiFvFileLoaderPpiGuid,
+                0,
+                NULL,
+                (VOID **)&FvLoadFilePpi
+                );
+      if (EFI_ERROR (Status)) {
+        return EFI_NOT_FOUND;
+      }
+
+      Status = FvLoadFilePpi->FvLoadFile (
+                                FvLoadFilePpi,
+                                PeimFileHeader,
+                                &ImageAddress,
+                                &ImageSize,
+                                &ImageEntryPoint
+                                );
+
+      if (EFI_ERROR (Status)) {
+        return EFI_NOT_FOUND;
+      }
+
+      //
+      // Retrieve the entry point from the PE/COFF image header
+      //
+      Status = PeCoffLoaderGetEntryPoint ((VOID *)(UINTN)ImageAddress, EntryPoint);
+      if (EFI_ERROR (Status)) {
+        return EFI_NOT_FOUND;
+      }
+    } else {
+      //
+      // Retrieve the entry point from the TE image header
+      //
+      ImageAddress = (EFI_PHYSICAL_ADDRESS) (UINTN) TEImageHeader;
+      *EntryPoint = (VOID *)((UINTN) TEImageHeader + sizeof (EFI_TE_IMAGE_HEADER) +
+                    TEImageHeader->AddressOfEntryPoint - TEImageHeader->StrippedSize);
+    }
+  } else {
+    //
+    // Retrieve the entry point from the PE/COFF image header
+    //
+    ImageAddress = (EFI_PHYSICAL_ADDRESS) (UINTN) Pe32Data;
+    Status = PeCoffLoaderGetEntryPoint (Pe32Data, EntryPoint);
+    if (EFI_ERROR (Status)) {
+      return EFI_NOT_FOUND;
+    }
+  }
+
+  //
+  // Print debug message: Loading PEIM at 0x12345678 EntryPoint=0x12345688 Driver.efi
+  //
+  DEBUG ((EFI_D_INFO | EFI_D_LOAD, "Loading PEIM at 0x%08x EntryPoint=0x%08x ", Pe32Data, *EntryPoint));
+  DEBUG_CODE (
+    EFI_IMAGE_DATA_DIRECTORY * DirectoryEntry;
+    EFI_IMAGE_DEBUG_DIRECTORY_ENTRY * DebugEntry;
+    UINTN DirCount;
+    UINTN Index;
+    UINTN Index1;
+    BOOLEAN FileNameFound;
+    CHAR8 *AsciiString;
+    CHAR8 AsciiBuffer[512];
+    VOID *CodeViewEntryPointer;
+    INTN TEImageAdjust;
+    EFI_IMAGE_DOS_HEADER  *DosHeader;
+    EFI_IMAGE_NT_HEADERS  *PeHeader;
+
+    //
+    // Pe32Data is NULL when load TE image 
+    //    
+    PeHeader = NULL;
+    if (TEImageHeader == NULL) {
+      DosHeader = (EFI_IMAGE_DOS_HEADER *)Pe32Data;
+      if (DosHeader->e_magic == EFI_IMAGE_DOS_SIGNATURE) {
+        //
+        // DOS image header is present, so read the PE header after the DOS image header
+        //
+        PeHeader = (EFI_IMAGE_NT_HEADERS *) ((UINTN) Pe32Data + (UINTN) ((DosHeader->e_lfanew) & 0x0ffff));
+      } else {
+        //
+        // DOS image header is not present, so PE header is at the image base
+        //
+        PeHeader = (EFI_IMAGE_NT_HEADERS *) Pe32Data;
+      }
+    }
+
+    //
+    // Find the codeview info in the image and display the file name
+    // being loaded.
+    //
+    // Per the PE/COFF spec, you can't assume that a given data directory
+    // is present in the image. You have to check the NumberOfRvaAndSizes in
+    // the optional header to verify a desired directory entry is there.
+    //
+    DebugEntry      = NULL;
+    DirectoryEntry  = NULL;
+    TEImageAdjust   = 0;
+    if (TEImageHeader == NULL) {
+      if (PeHeader->OptionalHeader.NumberOfRvaAndSizes > EFI_IMAGE_DIRECTORY_ENTRY_DEBUG) {
+        DirectoryEntry = (EFI_IMAGE_DATA_DIRECTORY *) &(PeHeader->OptionalHeader.DataDirectory[EFI_IMAGE_DIRECTORY_ENTRY_DEBUG]);
+        DebugEntry = (EFI_IMAGE_DEBUG_DIRECTORY_ENTRY *) ((UINTN) ImageAddress + DirectoryEntry->VirtualAddress);
+      }
+    } else {
+      if (TEImageHeader->DataDirectory[EFI_TE_IMAGE_DIRECTORY_ENTRY_DEBUG].VirtualAddress != 0) {
+        DirectoryEntry  = &TEImageHeader->DataDirectory[EFI_TE_IMAGE_DIRECTORY_ENTRY_DEBUG];
+        TEImageAdjust   = sizeof (EFI_TE_IMAGE_HEADER) - TEImageHeader->StrippedSize;
+        DebugEntry = (EFI_IMAGE_DEBUG_DIRECTORY_ENTRY *)((UINTN) TEImageHeader +
+                      TEImageHeader->DataDirectory[EFI_TE_IMAGE_DIRECTORY_ENTRY_DEBUG].VirtualAddress +
+                      TEImageAdjust);
+      }
+    }
+
+    if (DebugEntry != NULL && DirectoryEntry != NULL) {
+      for (DirCount = 0; DirCount < DirectoryEntry->Size; DirCount++, DebugEntry++) {
+        if (DebugEntry->Type == EFI_IMAGE_DEBUG_TYPE_CODEVIEW) {
+          if (DebugEntry->SizeOfData > 0) {
+            CodeViewEntryPointer = (VOID *) ((UINTN) DebugEntry->RVA + (UINTN) ImageAddress + (UINTN)TEImageAdjust);
+            switch (* (UINT32 *) CodeViewEntryPointer) {
+              case CODEVIEW_SIGNATURE_NB10:
+                AsciiString = (CHAR8 *) CodeViewEntryPointer + sizeof (EFI_IMAGE_DEBUG_CODEVIEW_NB10_ENTRY);
+                break;
+
+              case CODEVIEW_SIGNATURE_RSDS:
+                AsciiString = (CHAR8 *) CodeViewEntryPointer + sizeof (EFI_IMAGE_DEBUG_CODEVIEW_RSDS_ENTRY);
+                break;
+
+              default:
+                AsciiString = NULL;
+                break;
+            }
+            if (AsciiString != NULL) {
+              FileNameFound = FALSE;
+              for (Index = 0, Index1 = 0; AsciiString[Index] != 0; Index++) {
+                if (AsciiString[Index] == '\\') {
+                  Index1 = Index;
+                  FileNameFound = TRUE;
+                }
+              }
+
+              if (FileNameFound) {
+                for (Index = Index1 + 1; AsciiString[Index] != '.'; Index++) {
+                  AsciiBuffer[Index - (Index1 + 1)] = AsciiString[Index];
+                }
+                AsciiBuffer[Index - (Index1 + 1)] = 0;
+                DEBUG ((EFI_D_INFO | EFI_D_LOAD, "%a.efi", AsciiBuffer));
+                break;
+              }
+            }
+          }
+        }
+      }
+    }
+  );
+
+  DEBUG ((EFI_D_INFO | EFI_D_LOAD, "\n"));
+
+  return EFI_SUCCESS;
+}
index c9d64e336ae5bc1f49addc86707c39dfb263a476..145a5443a0a7cf8ba9f4e35fa7357fb8091b0d84 100644 (file)
@@ -1,53 +1,53 @@
-<?xml version="1.0" encoding="UTF-8"?>\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
-<ModuleBuildDescription xmlns="http://www.TianoCore.org/2006/Edk2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.TianoCore.org/2006/Edk2.0  http://www.TianoCore.org/2006/Edk2.0/SurfaceArea.xsd">\r
-  <MbdHeader>\r
-    <BaseName>PeiMain</BaseName>\r
-    <Guid>52C05B14-0B98-496c-BC3B-04B50211D680</Guid>\r
-    <Version>0</Version>\r
-    <Description>FIX ME!</Description>\r
-    <Copyright>Copyright (c) 2004-2006, Intel Corporation</Copyright>\r
-    <License>\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
-      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
-    </License>\r
-    <Created>2006-03-12 17:09</Created>\r
-    <Modified>2006-03-19 15:18</Modified>\r
-  </MbdHeader>\r
-  <Libraries>\r
-    <Library>PeiCoreEntryPoint</Library>\r
-    <Library>BaseLib</Library>\r
-    <Library>BaseMemoryLib</Library>\r
-    <Library>PeiServicesTablePointerLib</Library>\r
-    <Library>PeiCoreLib</Library>\r
-    <Library>PeiHobLib</Library>\r
-    <Library>PeiReportStatusCodeLib</Library>\r
-    <Library>BaseDebugLibReportStatusCode</Library>\r
-    <Library>BasePerformanceLibNull</Library>\r
-    <Arch ArchType="IA32">\r
-      <Library OverrideID="6666">BasePeCoffGetEntryPointLib</Library>\r
-    </Arch>\r
-    <Arch ArchType="X64">\r
-      <Library>BasePeCoffGetEntryPointLib</Library>\r
-    </Arch>\r
-    <Arch ArchType="IPF">\r
-      <Library>BasePeCoffGetEntryPointLib</Library>\r
-    </Arch>\r
-    <Arch ArchType="EBC">\r
-      <Library>BasePeCoffGetEntryPointLib</Library>\r
-    </Arch>\r
-  </Libraries>\r
-</ModuleBuildDescription>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Copyright (c) 2006, Intel Corporation
+All rights reserved. This program and the accompanying materials
+are licensed and made available under the terms and conditions of the BSD License
+which accompanies this distribution.  The full text of the license may be found at
+http://opensource.org/licenses/bsd-license.php
+
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+-->
+<ModuleBuildDescription xmlns="http://www.TianoCore.org/2006/Edk2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.TianoCore.org/2006/Edk2.0  http://www.TianoCore.org/2006/Edk2.0/SurfaceArea.xsd">
+  <MbdHeader>
+    <BaseName>PeiMain</BaseName>
+    <Guid>52C05B14-0B98-496c-BC3B-04B50211D680</Guid>
+    <Version>0</Version>
+    <Description>FIX ME!</Description>
+    <Copyright>Copyright (c) 2004-2006, Intel Corporation</Copyright>
+    <License>
+      All rights reserved. This program and the accompanying materials
+      are licensed and made available under the terms and conditions of the BSD License
+      which accompanies this distribution.  The full text of the license may be found at
+      http://opensource.org/licenses/bsd-license.php
+      THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+      WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+    </License>
+    <Created>2006-03-12 17:09</Created>
+    <Modified>2006-03-19 15:18</Modified>
+  </MbdHeader>
+  <Libraries>
+    <Library>PeiCoreEntryPoint</Library>
+    <Library>BaseLib</Library>
+    <Library>BaseMemoryLib</Library>
+    <Library OverrideID="4444">PeiServicesTablePointerLib</Library>
+    <Library>PeiCoreLib</Library>
+    <Library>PeiHobLib</Library>
+    <Library>PeiReportStatusCodeLib</Library>
+    <Library>BaseDebugLibReportStatusCode</Library>
+    <Library>BasePerformanceLibNull</Library>
+    <Arch ArchType="IA32">
+      <Library OverrideID="6666">BasePeCoffGetEntryPointLib</Library>
+    </Arch>
+    <Arch ArchType="X64">
+      <Library>BasePeCoffGetEntryPointLib</Library>
+    </Arch>
+    <Arch ArchType="IPF">
+      <Library>BasePeCoffGetEntryPointLib</Library>
+    </Arch>
+    <Arch ArchType="EBC">
+      <Library>BasePeCoffGetEntryPointLib</Library>
+    </Arch>
+  </Libraries>
+</ModuleBuildDescription>
index 014c571c05eaf208a228463f6ccc95e1868b28d2..a7ae320023e0a4db595eb037b3a8d5c8ad4afa8e 100644 (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:\r
-\r
-  PeiMain.c\r
-\r
-Abstract:\r
-\r
-  Pei Core Main Entry Point\r
-\r
-Revision History\r
-\r
---*/\r
-\r
-#include <PeiMain.h>\r
-\r
-//\r
-//CAR is filled with this initial value during SEC phase\r
-//\r
-#define INIT_CAR_VALUE 0x5AA55AA5\r
-\r
-static EFI_PEI_PPI_DESCRIPTOR mMemoryDiscoveredPpi = {\r
-  (EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST),\r
-  &gEfiPeiMemoryDiscoveredPpiGuid,\r
-  NULL\r
-};\r
-\r
-//\r
-// Pei Core Module Variables\r
-//\r
-//\r
-static EFI_PEI_SERVICES  mPS = {\r
-  {\r
-    PEI_SERVICES_SIGNATURE,\r
-    PEI_SERVICES_REVISION,\r
-    sizeof (EFI_PEI_SERVICES),\r
-    0,\r
-    0\r
-  },\r
-  PeiInstallPpi,\r
-  PeiReInstallPpi,\r
-  PeiLocatePpi,\r
-  PeiNotifyPpi,\r
-\r
-  PeiGetBootMode,\r
-  PeiSetBootMode,\r
-\r
-  PeiGetHobList,\r
-  PeiCreateHob,\r
-\r
-  PeiFvFindNextVolume,\r
-  PeiFfsFindNextFile,\r
-  PeiFfsFindSectionData,\r
-\r
-  PeiInstallPeiMemory,\r
-  PeiAllocatePages,\r
-  PeiAllocatePool,\r
-  (EFI_PEI_COPY_MEM)CopyMem,\r
-  (EFI_PEI_SET_MEM)SetMem,\r
-\r
-  PeiReportStatusCode,\r
-\r
-  PeiResetSystem\r
-};\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-PeiCore (\r
-  IN EFI_PEI_STARTUP_DESCRIPTOR  *PeiStartupDescriptor,\r
-  IN PEI_CORE_INSTANCE           *OldCoreData\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  The entry routine to Pei Core, invoked by PeiMain during transition\r
-  from SEC to PEI. After switching stack in the PEI core, it will restart\r
-  with the old core data.\r
-\r
-Arguments:\r
-\r
-  PeiStartupDescriptor - Information and services provided by SEC phase.\r
-  OldCoreData          - Pointer to old core data that is used to initialize the\r
-                         core's data areas.\r
-\r
-Returns:\r
-\r
-  This function never returns\r
-  EFI_NOT_FOUND        - Never reach\r
-\r
---*/\r
-{\r
-  PEI_CORE_INSTANCE                                     PrivateData;\r
-  EFI_STATUS                                            Status;\r
-  PEI_CORE_TEMP_POINTERS                                TempPtr;\r
-  PEI_CORE_DISPATCH_DATA                                *DispatchData;\r
-  UINT64                                                mTick;\r
-\r
-  mTick = 0;\r
-\r
-#ifdef EFI_PEI_PERFORMANCE\r
-  if (OldCoreData == NULL) {\r
-    mTick = GetPerformanceCounter ();\r
-  }\r
-#endif\r
-\r
-\r
-  //\r
-  // For IPF in CAR mode the real memory access is uncached,in InstallPeiMemory()\r
-  //  the 63-bit of address is set to 1.\r
-  //\r
-  SWITCH_TO_CACHE_MODE (OldCoreData);\r
-\r
-  if (OldCoreData != NULL) {\r
-    CopyMem (&PrivateData, OldCoreData, sizeof (PEI_CORE_INSTANCE));\r
-  } else {\r
-    ZeroMem (&PrivateData, sizeof (PEI_CORE_INSTANCE));\r
-  }\r
-\r
-  PrivateData.Signature = PEI_CORE_HANDLE_SIGNATURE;\r
-  PrivateData.PS = &mPS;\r
-\r
-  //\r
-  // Initialize libraries that the PeiCore is linked against\r
-  // BUGBUG: The FfsHeader is passed in as NULL.  Do we look it up or remove it from the lib init?\r
-  //\r
-  ProcessLibraryConstructorList (NULL, &PrivateData.PS);\r
-\r
-  InitializeMemoryServices (&PrivateData.PS, PeiStartupDescriptor, OldCoreData);\r
-\r
-  InitializePpiServices (&PrivateData.PS, OldCoreData);\r
-\r
-  InitializeSecurityServices (&PrivateData.PS, OldCoreData);\r
-\r
-  InitializeDispatcherData (&PrivateData.PS, OldCoreData, PeiStartupDescriptor);\r
-\r
-  if (OldCoreData != NULL) {\r
-\r
-    PERF_END (NULL,"PreMem", NULL, 0);\r
-    PERF_START (NULL,"PostMem", NULL, 0);\r
-\r
-    //\r
-    // The following code dumps out interesting cache as RAM usage information\r
-    // so we can keep tabs on how the cache as RAM is being utilized.  The\r
-    // DEBUG_CODE macro is used to prevent this code from being compiled\r
-    // on a debug build.\r
-    //\r
-    DEBUG_CODE (\r
-      UINTN  *StackPointer;\r
-      UINTN  StackValue;\r
-\r
-      StackValue = INIT_CAR_VALUE;\r
-      for (StackPointer = (UINTN *) OldCoreData->MaxTopOfCarHeap;\r
-           ((UINTN) StackPointer < ((UINTN) OldCoreData->BottomOfCarHeap + OldCoreData->SizeOfCacheAsRam))\r
-           && StackValue == INIT_CAR_VALUE;\r
-           StackPointer++) {\r
-        StackValue = *StackPointer;\r
-      }\r
-\r
-      DEBUG ((EFI_D_INFO, "Total Cache as RAM:    %d bytes.\n", OldCoreData->SizeOfCacheAsRam));\r
-      DEBUG ((EFI_D_INFO, "  CAR stack ever used: %d bytes.\n",\r
-        ((UINTN) OldCoreData->TopOfCarHeap - (UINTN) StackPointer)\r
-        ));\r
-      DEBUG ((EFI_D_INFO, "  CAR heap used:       %d bytes.\n",\r
-        ((UINTN) OldCoreData->HobList.HandoffInformationTable->EfiFreeMemoryBottom -\r
-        (UINTN) OldCoreData->HobList.Raw)\r
-        ));\r
-    );\r
-\r
-    //\r
-    // Alert any listeners that there is permanent memory available\r
-    //\r
-    PERF_START (NULL,"DisMem", NULL, 0);\r
-    Status = PeiCoreInstallPpi (&mMemoryDiscoveredPpi);\r
-    PERF_END (NULL,"DisMem", NULL, 0);\r
-\r
-  } else {\r
-\r
-    //\r
-    // Report Status Code EFI_SW_PC_INIT\r
-    //\r
-    REPORT_STATUS_CODE (\r
-      EFI_PROGRESS_CODE,\r
-      EFI_SOFTWARE_PEI_CORE | EFI_SW_PC_INIT\r
-      );\r
-\r
-    //\r
-    // If first pass, start performance measurement.\r
-    //\r
-    PERF_START (NULL,"PreMem", NULL, mTick);\r
-\r
-    //\r
-    // If SEC provided any PPI services to PEI, install them.\r
-    //\r
-    if (PeiStartupDescriptor->DispatchTable != NULL) {\r
-      Status = PeiCoreInstallPpi (PeiStartupDescriptor->DispatchTable);\r
-      ASSERT_EFI_ERROR (Status);\r
-    }\r
-  }\r
-\r
-  DispatchData = &PrivateData.DispatchData;\r
-\r
-  //\r
-  // Call PEIM dispatcher\r
-  //\r
-  PeiDispatcher (PeiStartupDescriptor, &PrivateData, DispatchData);\r
-\r
-  //\r
-  // Check if InstallPeiMemory service was called.\r
-  //\r
-  ASSERT(PrivateData.PeiMemoryInstalled == TRUE);\r
-\r
-  PERF_END (NULL, "PostMem", NULL, 0);\r
-\r
-  Status = PeiCoreLocatePpi (\r
-             &gEfiDxeIplPpiGuid,\r
-             0,\r
-             NULL,\r
-             (VOID **)&TempPtr.DxeIpl\r
-             );\r
-  ASSERT_EFI_ERROR (Status);\r
-\r
-  DEBUG ((EFI_D_INFO, "DXE IPL Entry\n"));\r
-  Status = TempPtr.DxeIpl->Entry (\r
-                             TempPtr.DxeIpl,\r
-                             &PrivateData.PS,\r
-                             PrivateData.HobList\r
-                             );\r
-\r
-  ASSERT_EFI_ERROR (Status);\r
-\r
-  return EFI_NOT_FOUND;\r
-}\r
-\r
+/*++
+
+Copyright (c) 2006, Intel Corporation
+All rights reserved. This program and the accompanying materials
+are licensed and made available under the terms and conditions of the BSD License
+which accompanies this distribution.  The full text of the license may be found at
+http://opensource.org/licenses/bsd-license.php
+
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+Module Name:
+
+  PeiMain.c
+
+Abstract:
+
+  Pei Core Main Entry Point
+
+Revision History
+
+--*/
+
+#include <PeiMain.h>
+
+//
+//CAR is filled with this initial value during SEC phase
+//
+#define INIT_CAR_VALUE 0x5AA55AA5
+
+static EFI_PEI_PPI_DESCRIPTOR mMemoryDiscoveredPpi = {
+  (EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST),
+  &gEfiPeiMemoryDiscoveredPpiGuid,
+  NULL
+};
+
+//
+// Pei Core Module Variables
+//
+//
+static EFI_PEI_SERVICES  mPS = {
+  {
+    PEI_SERVICES_SIGNATURE,
+    PEI_SERVICES_REVISION,
+    sizeof (EFI_PEI_SERVICES),
+    0,
+    0
+  },
+  PeiInstallPpi,
+  PeiReInstallPpi,
+  PeiLocatePpi,
+  PeiNotifyPpi,
+
+  PeiGetBootMode,
+  PeiSetBootMode,
+
+  PeiGetHobList,
+  PeiCreateHob,
+
+  PeiFvFindNextVolume,
+  PeiFfsFindNextFile,
+  PeiFfsFindSectionData,
+
+  PeiInstallPeiMemory,
+  PeiAllocatePages,
+  PeiAllocatePool,
+  (EFI_PEI_COPY_MEM)CopyMem,
+  (EFI_PEI_SET_MEM)SetMem,
+
+  PeiReportStatusCode,
+
+  PeiResetSystem
+};
+
+EFI_STATUS
+EFIAPI
+PeiCore (
+  IN EFI_PEI_STARTUP_DESCRIPTOR  *PeiStartupDescriptor,
+  IN PEI_CORE_INSTANCE           *OldCoreData
+  )
+/*++
+
+Routine Description:
+
+  The entry routine to Pei Core, invoked by PeiMain during transition
+  from SEC to PEI. After switching stack in the PEI core, it will restart
+  with the old core data.
+
+Arguments:
+
+  PeiStartupDescriptor - Information and services provided by SEC phase.
+  OldCoreData          - Pointer to old core data that is used to initialize the
+                         core's data areas.
+
+Returns:
+
+  This function never returns
+  EFI_NOT_FOUND        - Never reach
+
+--*/
+{
+  PEI_CORE_INSTANCE                                     PrivateData;
+  EFI_STATUS                                            Status;
+  PEI_CORE_TEMP_POINTERS                                TempPtr;
+  PEI_CORE_DISPATCH_DATA                                *DispatchData;
+  UINT64                                                mTick;
+
+  mTick = 0;
+
+#ifdef EFI_PEI_PERFORMANCE
+  if (OldCoreData == NULL) {
+    mTick = GetPerformanceCounter ();
+  }
+#endif
+
+  //
+  // For IPF in CAR mode the real memory access is uncached,in InstallPeiMemory()
+  //  the 63-bit of address is set to 1.
+  //
+  SWITCH_TO_CACHE_MODE (OldCoreData);
+
+  if (OldCoreData != NULL) {
+    CopyMem (&PrivateData, OldCoreData, sizeof (PEI_CORE_INSTANCE));
+  } else {
+    ZeroMem (&PrivateData, sizeof (PEI_CORE_INSTANCE));
+  }
+
+  PrivateData.Signature = PEI_CORE_HANDLE_SIGNATURE;
+  PrivateData.PS = &mPS;
+
+  //
+  // Initialize libraries that the PeiCore is linked against
+  // BUGBUG: The FfsHeader is passed in as NULL.  Do we look it up or remove it from the lib init?
+  //
+  ProcessLibraryConstructorList (NULL, &PrivateData.PS);
+
+  InitializeMemoryServices (&PrivateData.PS, PeiStartupDescriptor, OldCoreData);
+
+  InitializePpiServices (&PrivateData.PS, OldCoreData);
+
+  InitializeSecurityServices (&PrivateData.PS, OldCoreData);
+
+  InitializeDispatcherData (&PrivateData.PS, OldCoreData, PeiStartupDescriptor);
+
+  if (OldCoreData != NULL) {
+
+    PERF_END (NULL,"PreMem", NULL, 0);
+    PERF_START (NULL,"PostMem", NULL, 0);
+
+    //
+    // The following code dumps out interesting cache as RAM usage information
+    // so we can keep tabs on how the cache as RAM is being utilized.  The
+    // DEBUG_CODE macro is used to prevent this code from being compiled
+    // on a debug build.
+    //
+    DEBUG_CODE (
+      UINTN  *StackPointer;
+      UINTN  StackValue;
+
+      StackValue = INIT_CAR_VALUE;
+      for (StackPointer = (UINTN *) OldCoreData->MaxTopOfCarHeap;
+           ((UINTN) StackPointer < ((UINTN) OldCoreData->BottomOfCarHeap + OldCoreData->SizeOfCacheAsRam))
+           && StackValue == INIT_CAR_VALUE;
+           StackPointer++) {
+        StackValue = *StackPointer;
+      }
+
+      DEBUG ((EFI_D_INFO, "Total Cache as RAM:    %d bytes.\n", OldCoreData->SizeOfCacheAsRam));
+      DEBUG ((EFI_D_INFO, "  CAR stack ever used: %d bytes.\n",
+        ((UINTN) OldCoreData->TopOfCarHeap - (UINTN) StackPointer)
+        ));
+      DEBUG ((EFI_D_INFO, "  CAR heap used:       %d bytes.\n",
+        ((UINTN) OldCoreData->HobList.HandoffInformationTable->EfiFreeMemoryBottom -
+        (UINTN) OldCoreData->HobList.Raw)
+        ));
+    );
+
+    //
+    // Alert any listeners that there is permanent memory available
+    //
+    PERF_START (NULL,"DisMem", NULL, 0);
+    Status = PeiCoreInstallPpi (&mMemoryDiscoveredPpi);
+    PERF_END (NULL,"DisMem", NULL, 0);
+
+  } else {
+
+    //
+    // Report Status Code EFI_SW_PC_INIT
+    //
+    REPORT_STATUS_CODE (
+      EFI_PROGRESS_CODE,
+      EFI_SOFTWARE_PEI_CORE | EFI_SW_PC_INIT
+      );
+
+    //
+    // If first pass, start performance measurement.
+    //
+    PERF_START (NULL,"PreMem", NULL, mTick);
+
+    //
+    // If SEC provided any PPI services to PEI, install them.
+    //
+    if (PeiStartupDescriptor->DispatchTable != NULL) {
+      Status = PeiCoreInstallPpi (PeiStartupDescriptor->DispatchTable);
+      ASSERT_EFI_ERROR (Status);
+    }
+  }
+
+  DispatchData = &PrivateData.DispatchData;
+
+  //
+  // Call PEIM dispatcher
+  //
+  PeiDispatcher (PeiStartupDescriptor, &PrivateData, DispatchData);
+
+  //
+  // Check if InstallPeiMemory service was called.
+  //
+  ASSERT(PrivateData.PeiMemoryInstalled == TRUE);
+
+  PERF_END (NULL, "PostMem", NULL, 0);
+
+  Status = PeiCoreLocatePpi (
+             &gEfiDxeIplPpiGuid,
+             0,
+             NULL,
+             (VOID **)&TempPtr.DxeIpl
+             );
+  ASSERT_EFI_ERROR (Status);
+
+  DEBUG ((EFI_D_INFO, "DXE IPL Entry\n"));
+  Status = TempPtr.DxeIpl->Entry (
+                             TempPtr.DxeIpl,
+                             &PrivateData.PS,
+                             PrivateData.HobList
+                             );
+
+  ASSERT_EFI_ERROR (Status);
+
+  return EFI_NOT_FOUND;
+}
+
index 40c20d47c3ddb11ae2c4835ce5fe43eed9b37b8e..1d75273ceeda0507aa57ea74ebe24c57e8cc7a89 100644 (file)
-<?xml version="1.0" encoding="UTF-8"?>\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
-<PackageSurfaceArea xmlns="http://www.TianoCore.org/2006/Edk2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.TianoCore.org/2006/Edk2.0  http://www.TianoCore.org/2006/Edk2.0/SurfaceArea.xsd">\r
-  <SpdHeader>\r
-    <PackageName>EdkModulePkg</PackageName>\r
-    <Guid>0xb6ec423c, 0x21d2, 0x490d, 0x85, 0xc6, 0xdd, 0x58, 0x64, 0xea, 0xa6, 0x74</Guid>\r
-    <Version>0</Version>\r
-    <Abstract>Edk Module Package Reference Implementations</Abstract>\r
-    <Description>This Module provides standard reference information for EFI/Tiano implementations.</Description>\r
-    <Copyright>Copyright (c) 2006,  Intel Corporation.</Copyright>\r
-    <License>\r
-      All rights reserved.\r
-      This program and the accompanying materials are licensed and made available \r
-      under the terms and conditions of the BSD License which accompanies this distribution.\r
-      The full text of the license may be found at http://opensource.org/licenses/bsd-license.php\r
-      THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES\r
-      OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-    </License>\r
-    <Created>2006-02-21 17:43</Created>\r
-    <Updated>2006-03-19 16:26</Updated>\r
-    <URL>http://www.TianoCore.org</URL>\r
-    <PackageType>SOURCE</PackageType>\r
-    <ReadOnly>true</ReadOnly>\r
-    <RePackage>false</RePackage>\r
-  </SpdHeader>\r
-  <LibraryClassDeclarations>\r
-    <LibraryClassDeclaration>\r
-      <LibraryClass>CustomDecompressLib</LibraryClass>\r
-      <IncludeHeader>Include/Library/CustomDecompressLib.h</IncludeHeader>\r
-    </LibraryClassDeclaration>\r
-    <LibraryClassDeclaration>\r
-      <LibraryClass>EdkBsDataHubStatusCodeLib</LibraryClass>\r
-      <IncludeHeader>Include/Library/EdkBsDataHubStatusCodeLib.h</IncludeHeader>\r
-    </LibraryClassDeclaration>\r
-    <LibraryClassDeclaration>\r
-      <LibraryClass>EdkDxeSalLib</LibraryClass>\r
-      <IncludeHeader>Include/Library/EdkDxeSalLib.h</IncludeHeader>\r
-    </LibraryClassDeclaration>\r
-    <LibraryClassDeclaration>\r
-      <LibraryClass>EdkFvbServiceLib</LibraryClass>\r
-      <IncludeHeader>Include/Library/EdkFvbServiceLib.h</IncludeHeader>\r
-    </LibraryClassDeclaration>\r
-    <LibraryClassDeclaration>\r
-      <LibraryClass>EdkGraphicsLib</LibraryClass>\r
-      <IncludeHeader>Include/Library/EdkGraphicsLib.h</IncludeHeader>\r
-    </LibraryClassDeclaration>\r
-    <LibraryClassDeclaration>\r
-      <LibraryClass>EdkIfrSupportLib</LibraryClass>\r
-      <IncludeHeader>Include/Library/EdkIfrSupportLib.h</IncludeHeader>\r
-    </LibraryClassDeclaration>\r
-    <LibraryClassDeclaration>\r
-      <LibraryClass>EdkMemoryStatusCodeLib</LibraryClass>\r
-      <IncludeHeader>Include/Library/EdkMemoryStatusCodeLib.h</IncludeHeader>\r
-    </LibraryClassDeclaration>\r
-    <LibraryClassDeclaration>\r
-      <LibraryClass>EdkPeCoffLoaderLib</LibraryClass>\r
-      <IncludeHeader>Include/Library/EdkPeCoffLoaderLib.h</IncludeHeader>\r
-    </LibraryClassDeclaration>\r
-    <LibraryClassDeclaration>\r
-      <LibraryClass>EdkPeCoffLoaderX64Lib</LibraryClass>\r
-      <IncludeHeader>Include/Library/EdkPeCoffLoaderX64Lib.h</IncludeHeader>\r
-    </LibraryClassDeclaration>\r
-    <LibraryClassDeclaration>\r
-      <LibraryClass>EdkRtMemoryStatusCodeLib</LibraryClass>\r
-      <IncludeHeader>Include/Library/EdkRtMemoryStatusCodeLib.h</IncludeHeader>\r
-    </LibraryClassDeclaration>\r
-    <LibraryClassDeclaration>\r
-      <LibraryClass>EdkRtPlatformStatusCodeLib</LibraryClass>\r
-      <IncludeHeader>Include/Library/EdkRtPlatformStatusCodeLib.h</IncludeHeader>\r
-    </LibraryClassDeclaration>\r
-    <LibraryClassDeclaration>\r
-      <LibraryClass>EdkScsiLib</LibraryClass>\r
-      <IncludeHeader>Include/Library/EdkScsiLib.h</IncludeHeader>\r
-    </LibraryClassDeclaration>\r
-    <LibraryClassDeclaration>\r
-      <LibraryClass>EdkUsbLib</LibraryClass>\r
-      <IncludeHeader>Include/Library/EdkUsbLib.h</IncludeHeader>\r
-    </LibraryClassDeclaration>\r
-    <LibraryClassDeclaration>\r
-      <LibraryClass>TianoDecompressLib</LibraryClass>\r
-      <IncludeHeader>Include/Library/TianoDecompressLib.h</IncludeHeader>\r
-    </LibraryClassDeclaration>\r
-  </LibraryClassDeclarations>\r
-  <MsaFiles>\r
-    <MsaFile>\r
-      <Filename>Application/HelloWorld/HelloWorld.msa</Filename>\r
-    </MsaFile>\r
-    <MsaFile>\r
-      <Filename>Bus/Pci/AtapiPassThru/Dxe/AtapiPassThru.msa</Filename>\r
-    </MsaFile>\r
-    <MsaFile>\r
-      <Filename>Bus/Pci/CirrusLogic/Dxe/CirrusLogic5430.msa</Filename>\r
-    </MsaFile>\r
-    <MsaFile>\r
-      <Filename>Bus/Pci/IdeBus/Dxe/idebus.msa</Filename>\r
-    </MsaFile>\r
-    <MsaFile>\r
-      <Filename>Bus/Pci/IdeBus/Dxe/idebusLite.msa</Filename>\r
-    </MsaFile>\r
-    <MsaFile>\r
-      <Filename>Bus/Pci/PciBus/Dxe/LightPciBus.msa</Filename>\r
-    </MsaFile>\r
-    <MsaFile>\r
-      <Filename>Bus/Pci/PciBus/Dxe/PciBus.msa</Filename>\r
-    </MsaFile>\r
-    <MsaFile>\r
-      <Filename>Bus/Pci/PciBus/Dxe/PciBusLite.msa</Filename>\r
-    </MsaFile>\r
-    <MsaFile>\r
-      <Filename>Bus/Pci/Uhci/Dxe/Uhci.msa</Filename>\r
-    </MsaFile>\r
-    <MsaFile>\r
-      <Filename>Bus/Pci/Undi/RuntimeDxe/Undi.msa</Filename>\r
-    </MsaFile>\r
-    <MsaFile>\r
-      <Filename>Bus/Scsi/ScsiBus/Dxe/ScsiBus.msa</Filename>\r
-    </MsaFile>\r
-    <MsaFile>\r
-      <Filename>Bus/Scsi/ScsiDisk/Dxe/ScsiDisk.msa</Filename>\r
-    </MsaFile>\r
-    <MsaFile>\r
-      <Filename>Bus/Usb/UsbBot/Dxe/UsbBot.msa</Filename>\r
-    </MsaFile>\r
-    <MsaFile>\r
-      <Filename>Bus/Usb/UsbBus/Dxe/UsbBus.msa</Filename>\r
-    </MsaFile>\r
-    <MsaFile>\r
-      <Filename>Bus/Usb/UsbCbi/Dxe/Cbi0/UsbCbi0.msa</Filename>\r
-    </MsaFile>\r
-    <MsaFile>\r
-      <Filename>Bus/Usb/UsbCbi/Dxe/Cbi1/UsbCbi1.msa</Filename>\r
-    </MsaFile>\r
-    <MsaFile>\r
-      <Filename>Bus/Usb/UsbKb/Dxe/UsbKb.msa</Filename>\r
-    </MsaFile>\r
-    <MsaFile>\r
-      <Filename>Bus/Usb/UsbMassStorage/Dxe/UsbMassStorage.msa</Filename>\r
-    </MsaFile>\r
-    <MsaFile>\r
-      <Filename>Bus/Usb/UsbMouse/Dxe/UsbMouse.msa</Filename>\r
-    </MsaFile>\r
-    <MsaFile>\r
-      <Filename>Core/Dxe/DxeMain.msa</Filename>\r
-    </MsaFile>\r
-    <MsaFile>\r
-      <Filename>Core/DxeIplPeim/DxeIpl.msa</Filename>\r
-    </MsaFile>\r
-    <MsaFile>\r
-      <Filename>Core/Pei/PeiMain.msa</Filename>\r
-    </MsaFile>\r
-    <MsaFile>\r
-      <Filename>Library/BaseCustomDecompressLibNull/BaseCustomDecompressLibNull.msa</Filename>\r
-    </MsaFile>\r
-    <MsaFile>\r
-      <Filename>Library/BaseUefiTianoDecompressLib/BaseUefiTianoDecompressLib.msa</Filename>\r
-    </MsaFile>\r
-    <MsaFile>\r
-      <Filename>Library/DxeCoreCustomDecompressLibFromHob/DxeCoreCustomDecompressLibFromHob.msa</Filename>\r
-    </MsaFile>\r
-    <MsaFile>\r
-      <Filename>Library/DxeCorePerformanceLib/DxeCorePerformanceLib.msa</Filename>\r
-    </MsaFile>\r
-    <MsaFile>\r
-      <Filename>Library/DxeCoreTianoDecompressLibFromHob/DxeCoreTianoDecompressLibFromHob.msa</Filename>\r
-    </MsaFile>\r
-    <MsaFile>\r
-      <Filename>Library/DxeCoreUefiDecompressLibFromHob/DxeCoreUefiDecompressLibFromHob.msa</Filename>\r
-    </MsaFile>\r
-    <MsaFile>\r
-      <Filename>Library/EdkDxeDebugLibReportStatusCode/EdkDxeDebugLibReportStatusCode.msa</Filename>\r
-    </MsaFile>\r
-    <MsaFile>\r
-      <Filename>Library/EdkDxePeCoffLoaderFromHobLib/EdkDxePeCoffLoaderFromHobLib.msa</Filename>\r
-    </MsaFile>\r
-    <MsaFile>\r
-      <Filename>Library/EdkDxePerformanceLib/EdkDxePerformanceLib.msa</Filename>\r
-    </MsaFile>\r
-    <MsaFile>\r
-      <Filename>Library/EdkDxePrintLib/EdkDxePrintLib.msa</Filename>\r
-    </MsaFile>\r
-    <MsaFile>\r
-      <Filename>Library/EdkDxeRuntimeDriverLib/EdkDxeRuntimeDriverLib.msa</Filename>\r
-    </MsaFile>\r
-    <MsaFile>\r
-      <Filename>Library/EdkDxeSalLib/EdkDxeSalLib.msa</Filename>\r
-    </MsaFile>\r
-    <MsaFile>\r
-      <Filename>Library/EdkFvbServiceLib/EdkFvbServiceLib.msa</Filename>\r
-    </MsaFile>\r
-    <MsaFile>\r
-      <Filename>Library/EdkGraphicsLib/EdkGraphicsLib.msa</Filename>\r
-    </MsaFile>\r
-    <MsaFile>\r
-      <Filename>Library/EdkIfrSupportLib/EdkIfrSupportLib.msa</Filename>\r
-    </MsaFile>\r
-    <MsaFile>\r
-      <Filename>Library/EdkMemoryStatusCodeLib/EdkMemoryStatusCodeLib.msa</Filename>\r
-    </MsaFile>\r
-    <MsaFile>\r
-      <Filename>Library/EdkNullCustomizedDecompressLib/EdkNullCustomizedDecompressLib.msa</Filename>\r
-    </MsaFile>\r
-    <MsaFile>\r
-      <Filename>Library/EdkPeCoffLoaderLib/EdkPeCoffLoaderLib.msa</Filename>\r
-    </MsaFile>\r
-    <MsaFile>\r
-      <Filename>Library/EdkPeCoffLoaderX64Lib/EdkPeCoffLoaderX64Lib.msa</Filename>\r
-    </MsaFile>\r
-    <MsaFile>\r
-      <Filename>Library/EdkPeiPerformanceLib/EdkPeiPerformanceLib.msa</Filename>\r
-    </MsaFile>\r
-    <MsaFile>\r
-      <Filename>Library/EdkRuntimeStatusCodeLib/BsDataHubStatusCode/BsDataHubStatusCode.msa</Filename>\r
-    </MsaFile>\r
-    <MsaFile>\r
-      <Filename>Library/EdkRuntimeStatusCodeLib/RtMemoryStatusCode/RtMemoryStatusCode.msa</Filename>\r
-    </MsaFile>\r
-    <MsaFile>\r
-      <Filename>Library/EdkRuntimeStatusCodeLib/RtPlatformStatusCode/RtPlatformStatusCode.msa</Filename>\r
-    </MsaFile>\r
-    <MsaFile>\r
-      <Filename>Library/EdkScsiLib/EdkScsiLib.msa</Filename>\r
-    </MsaFile>\r
-    <MsaFile>\r
-      <Filename>Library/EdkUefiDebugLibConOut/EdkUefiDebugLibConOut.msa</Filename>\r
-    </MsaFile>\r
-    <MsaFile>\r
-      <Filename>Library/EdkUefiDebugLibStdErr/EdkUefiDebugLibStdErr.msa</Filename>\r
-    </MsaFile>\r
-    <MsaFile>\r
-      <Filename>Library/EdkUsbLib/EdkUsbLib.msa</Filename>\r
-    </MsaFile>\r
-    <MsaFile>\r
-      <Filename>Universal/Console/ConSplitter/Dxe/ConSplitter.msa</Filename>\r
-    </MsaFile>\r
-    <MsaFile>\r
-      <Filename>Universal/Console/GraphicsConsole/Dxe/GraphicsConsole.msa</Filename>\r
-    </MsaFile>\r
-    <MsaFile>\r
-      <Filename>Universal/Console/Terminal/Dxe/Terminal.msa</Filename>\r
-    </MsaFile>\r
-    <MsaFile>\r
-      <Filename>Universal/DataHub/DataHub/Dxe/DataHub.msa</Filename>\r
-    </MsaFile>\r
-    <MsaFile>\r
-      <Filename>Universal/DataHub/DataHubStdErr/Dxe/DataHubStdErr.msa</Filename>\r
-    </MsaFile>\r
-    <MsaFile>\r
-      <Filename>Universal/Debugger/Debugport/Dxe/DebugPort.msa</Filename>\r
-    </MsaFile>\r
-    <MsaFile>\r
-      <Filename>Universal/DebugSupport/Dxe/DebugSupport.msa</Filename>\r
-    </MsaFile>\r
-    <MsaFile>\r
-      <Filename>Universal/Disk/DiskIo/Dxe/DiskIo.msa</Filename>\r
-    </MsaFile>\r
-    <MsaFile>\r
-      <Filename>Universal/Disk/DiskIoPartition/dxe/DiskIoPartition.msa</Filename>\r
-    </MsaFile>\r
-    <MsaFile>\r
-      <Filename>Universal/Disk/Partition/Dxe/Partition.msa</Filename>\r
-    </MsaFile>\r
-    <MsaFile>\r
-      <Filename>Universal/Disk/UnicodeCollation/English/Dxe/English.msa</Filename>\r
-    </MsaFile>\r
-    <MsaFile>\r
-      <Filename>Universal/Ebc/Dxe/Ebc.msa</Filename>\r
-    </MsaFile>\r
-    <MsaFile>\r
-      <Filename>Universal/FirmwareVolume/FaultTolerantWriteLite/Dxe/FtwLite.msa</Filename>\r
-    </MsaFile>\r
-    <MsaFile>\r
-      <Filename>Universal/FirmwareVolume/GuidedSectionExtraction/Crc32SectionExtract/Dxe/Crc32SectionExtract.msa</Filename>\r
-    </MsaFile>\r
-    <MsaFile>\r
-      <Filename>Universal/GenericMemoryTest/Dxe/NullMemoryTest.msa</Filename>\r
-    </MsaFile>\r
-    <MsaFile>\r
-      <Filename>Universal/GenericMemoryTest/Pei/BaseMemoryTest.msa</Filename>\r
-    </MsaFile>\r
-    <MsaFile>\r
-      <Filename>Universal/MonotonicCounter/RuntimeDxe/MonotonicCounter.msa</Filename>\r
-    </MsaFile>\r
-    <MsaFile>\r
-      <Filename>Universal/Network/PxeBc/Dxe/BC.msa</Filename>\r
-    </MsaFile>\r
-    <MsaFile>\r
-      <Filename>Universal/Network/PxeDhcp4/Dxe/Dhcp4.msa</Filename>\r
-    </MsaFile>\r
-    <MsaFile>\r
-      <Filename>Universal/Network/Snp32_64/Dxe/SNP.msa</Filename>\r
-    </MsaFile>\r
-    <MsaFile>\r
-      <Filename>Universal/Runtime/RuntimeDxe/Runtime.msa</Filename>\r
-    </MsaFile>\r
-    <MsaFile>\r
-      <Filename>Universal/Security/SecurityStub/Dxe/SecurityStub.msa</Filename>\r
-    </MsaFile>\r
-    <MsaFile>\r
-      <Filename>Universal/StatusCode/RuntimeDxe/StatusCode.msa</Filename>\r
-    </MsaFile>\r
-    <MsaFile>\r
-      <Filename>Universal/UserInterface/HiiDataBase/Dxe/HiiDatabase.msa</Filename>\r
-    </MsaFile>\r
-    <MsaFile>\r
-      <Filename>Universal/UserInterface/SetupBrowser/Dxe/DriverSample/DriverSample.msa</Filename>\r
-    </MsaFile>\r
-    <MsaFile>\r
-      <Filename>Universal/UserInterface/SetupBrowser/Dxe/SetupBrowser.msa</Filename>\r
-    </MsaFile>\r
-    <MsaFile>\r
-      <Filename>Universal/Variable/Pei/Variable.msa</Filename>\r
-    </MsaFile>\r
-    <MsaFile>\r
-      <Filename>Universal/EmuVariable/RuntimeDxe/EmuVariable.msa</Filename>\r
-    </MsaFile>\r
-    <MsaFile>\r
-      <Filename>Universal/Variable/RuntimeDxe/Variable.msa</Filename>\r
-    </MsaFile>\r
-    <MsaFile>\r
-      <Filename>Universal/WatchdogTimer/Dxe/WatchDogTimer.msa</Filename>\r
-    </MsaFile>\r
-  </MsaFiles>\r
-  <PackageHeaders>\r
-    <IncludeHeader ModuleType="SEC">Include/EdkPeim.h</IncludeHeader>\r
-    <IncludeHeader ModuleType="PEI_CORE">Include/EdkPeiCore.h</IncludeHeader>\r
-    <IncludeHeader ModuleType="PEIM">Include/EdkPeim.h</IncludeHeader>\r
-    <IncludeHeader ModuleType="DXE_CORE">Include/EdkDxeCore.h</IncludeHeader>\r
-    <IncludeHeader ModuleType="DXE_DRIVER">Include/EdkDxe.h</IncludeHeader>\r
-    <IncludeHeader ModuleType="DXE_RUNTIME_DRIVER">Include/EdkDxe.h</IncludeHeader>\r
-    <IncludeHeader ModuleType="DXE_SMM_DRIVER">Include/EdkDxe.h</IncludeHeader>\r
-    <IncludeHeader ModuleType="DXE_SAL_DRIVER">Include/EdkDxe.h</IncludeHeader>\r
-    <IncludeHeader ModuleType="UEFI_DRIVER">Include/EdkDxe.h</IncludeHeader>\r
-  </PackageHeaders>\r
-  <GuidDeclarations>\r
-    <Entry Name="PeiPeCoffLoader">\r
-      <C_Name>gEfiPeiPeCoffLoaderGuid</C_Name>\r
-      <Guid>0xd8117cff, 0x94a6, 0x11d4, 0x9a, 0x3a, 0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d</Guid>\r
-    </Entry>\r
-    <Entry Name="FlashMapHob">\r
-      <C_Name>gEfiFlashMapHobGuid</C_Name>\r
-      <Guid>0xb091e7d2, 0x5a0, 0x4198, 0x94, 0xf0, 0x74, 0xb7, 0xb8, 0xc5, 0x54, 0x59</Guid>\r
-    </Entry>\r
-    <Entry Name="StatusCodeDataTypeString">\r
-      <C_Name>gEfiStatusCodeDataTypeStringGuid</C_Name>\r
-      <Guid>0x92D11080, 0x496F, 0x4D95, 0xBE, 0x7E, 0x03, 0x74, 0x88, 0x38, 0x2B, 0x0A</Guid>\r
-    </Entry>\r
-    <Entry Name="StatusCodeDataTypeDebug">\r
-      <C_Name>gEfiStatusCodeDataTypeDebugGuid</C_Name>\r
-      <Guid>0x9A4E9246, 0xD553, 0x11D5, 0x87, 0xE2, 0x00, 0x06, 0x29, 0x45, 0xC3, 0xb9</Guid>\r
-    </Entry>\r
-    <Entry Name="StatusCodeDataTypeAssert">\r
-      <C_Name>gEfiStatusCodeDataTypeAssertGuid</C_Name>\r
-      <Guid>0xDA571595, 0x4D99, 0x487C, 0x82, 0x7C, 0x26, 0x22, 0x67, 0x7D, 0x33, 0x07</Guid>\r
-    </Entry>\r
-    <Entry Name="StatusCodeDataTypeExceptionHandler">\r
-      <C_Name>gEfiStatusCodeDataTypeExceptionHandlerGuid</C_Name>\r
-      <Guid>0x3BC2BD12, 0xAD2E, 0x11D5, 0x87, 0xDD, 0x00, 0x06, 0x29, 0x45, 0xC3, 0xB9</Guid>\r
-    </Entry>\r
-    <Entry Name="StatusCodeDataTypeError">\r
-      <C_Name>gEfiStatusCodeDataTypeErrorGuid</C_Name>\r
-      <Guid>0xAB359CE3, 0x99B3, 0xAE18, 0xC8, 0x9D, 0x95, 0xD3, 0xB0, 0x72, 0xE1, 0x9B</Guid>\r
-    </Entry>\r
-    <Entry Name="StatusCodeDataTypeProgressCode">\r
-      <C_Name>gEfiStatusCodeDataTypeProgressCodeGuid</C_Name>\r
-      <Guid>0xA356AB39, 0x35C4, 0x35DA, 0xB3, 0x7A, 0xF8, 0xEA, 0x9E, 0x8B, 0x36, 0xA3</Guid>\r
-    </Entry>\r
-    <Entry Name="StatusCodeSpecificData">\r
-      <C_Name>gEfiStatusCodeSpecificDataGuid</C_Name>\r
-      <Guid>0x335984bd, 0xe805, 0x409a, 0xb8, 0xf8, 0xd2, 0x7e, 0xce, 0x5f, 0xf7, 0xa6</Guid>\r
-    </Entry>\r
-    <Entry Name="SystemNvDataHob">\r
-      <C_Name>gEfiSystemNvDataHobGuid</C_Name>\r
-      <Guid>0xd6e5092d, 0xc7b2, 0x4872, 0xaf, 0x66, 0xfd, 0xc0, 0xe6, 0xf9, 0x5e, 0x78</Guid>\r
-    </Entry>\r
-    <Entry Name="SystemNvDataFv">\r
-      <C_Name>gEfiSystemNvDataFvGuid</C_Name>\r
-      <Guid>0xfff12b8d, 0x7696, 0x4c8b, 0xa9, 0x85, 0x27, 0x47, 0x07, 0x5b, 0x4f, 0x50</Guid>\r
-    </Entry>\r
-    <Entry Name="DiskInfoIde">\r
-      <C_Name>gEfiDiskInfoIdeInterfaceGuid</C_Name>\r
-      <Guid>0x5e948fe3, 0x26d3, 0x42b5, 0xaf, 0x17, 0x61, 0x02, 0x87, 0x18, 0x8d, 0xec</Guid>\r
-    </Entry>\r
-    <Entry Name="DiskInfoScsi">\r
-      <C_Name>gEfiDiskInfoScsiInterfaceGuid</C_Name>\r
-      <Guid>0x8f74baa, 0xea36, 0x41d9, 0x95, 0x21, 0x21, 0xa7, 0x0f, 0x87, 0x80, 0xbc</Guid>\r
-    </Entry>\r
-    <Entry Name="DiskInfoUsb">\r
-      <C_Name>gEfiDiskInfoUsbInterfaceGuid</C_Name>\r
-      <Guid>0xcb871572, 0xc11a, 0x47b5, 0xb4, 0x92, 0x67, 0x5e, 0xaf, 0xa7, 0x77, 0x27</Guid>\r
-    </Entry>\r
-    <Entry Name="AlternateFvBlock">\r
-      <C_Name>gEfiAlternateFvBlockGuid</C_Name>\r
-      <Guid>0xf496922d, 0x172f, 0x4bbc, 0xa1, 0xeb, 0x0e, 0xeb, 0x94, 0x9c, 0x34, 0x86</Guid>\r
-    </Entry>\r
-    <Entry Name="ConsoleInDevice">\r
-      <C_Name>gEfiConsoleInDeviceGuid</C_Name>\r
-      <Guid>0xd3b36f2b, 0xd551, 0x11d4, 0x9a, 0x46, 0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d</Guid>\r
-    </Entry>\r
-    <Entry Name="ConsoleOutDevice">\r
-      <C_Name>gEfiConsoleOutDeviceGuid</C_Name>\r
-      <Guid>0xd3b36f2c, 0xd551, 0x11d4, 0x9a, 0x46, 0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d</Guid>\r
-    </Entry>\r
-    <Entry Name="StandardErrorDevice">\r
-      <C_Name>gEfiStandardErrorDeviceGuid</C_Name>\r
-      <Guid>0xd3b36f2d, 0xd551, 0x11d4, 0x9a, 0x46, 0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d</Guid>\r
-    </Entry>\r
-    <Entry Name="HotPlugDevice">\r
-      <C_Name>gEfiHotPlugDeviceGuid</C_Name>\r
-      <Guid>0x220ac432, 0x1d43, 0x49e5, 0xa7, 0x4f, 0x4c, 0x9d, 0xa6, 0x7a, 0xd2, 0x3b</Guid>\r
-    </Entry>\r
-    <Entry Name="PrimaryStandardErrorDevice">\r
-      <C_Name>gEfiPrimaryStandardErrorDeviceGuid</C_Name>\r
-      <Guid>0x5a68191b, 0x9b97, 0x4752, 0x99, 0x46, 0xe3, 0x6a, 0x5d, 0xa9, 0x42, 0xb1</Guid>\r
-    </Entry>\r
-    <Entry Name="PrimaryConsoleInDevice">\r
-      <C_Name>gEfiPrimaryConsoleInDeviceGuid</C_Name>\r
-      <Guid>0xe451dcbe, 0x96a1, 0x4729, 0xa5, 0xcf, 0x6b, 0x9c, 0x2c, 0xff, 0x47, 0xfd</Guid>\r
-    </Entry>\r
-    <Entry Name="PrimaryConsoleOutDevice">\r
-      <C_Name>gEfiPrimaryConsoleOutDeviceGuid</C_Name>\r
-      <Guid>0x62bdf38a, 0xe3d5, 0x492c, 0x95, 0x0c, 0x23, 0xa7, 0xf6, 0x6e, 0x67, 0x2e</Guid>\r
-    </Entry>\r
-    <Entry Name="Bmp">\r
-      <C_Name>gEfiDefaultBmpLogoGuid</C_Name>\r
-      <Guid>0x7BB28B99, 0x61BB, 0x11d5, 0x9A, 0x5D, 0x00, 0x90, 0x27, 0x3F, 0xC1, 0x4D</Guid>\r
-    </Entry>\r
-    <Entry Name="BootState">\r
-      <C_Name>gEfiBootStateGuid</C_Name>\r
-      <Guid>0x60b5e939, 0xfcf, 0x4227, 0xba, 0x83, 0x6b, 0xbe, 0xd4, 0x5b, 0xc0, 0xe3</Guid>\r
-    </Entry>\r
-    <Entry Name="ShellFile">\r
-      <C_Name>gEfiShellFileGuid</C_Name>\r
-      <Guid>0xc57ad6b7, 0x0515, 0x40a8, 0x9d, 0x21, 0x55, 0x16, 0x52, 0x85, 0x4e, 0x37</Guid>\r
-    </Entry>\r
-    <Entry Name="MiniShellFile">\r
-      <C_Name>gEfiMiniShellFileGuid</C_Name>\r
-      <Guid>0x86ad232b, 0xd33a, 0x465c, 0xbf, 0x5f, 0x41, 0x37, 0x0b, 0xa9, 0x2f, 0xe2</Guid>\r
-    </Entry>\r
-    <Entry Name="StatusCode">\r
-      <C_Name>gEfiStatusCodeGuid</C_Name>\r
-      <Guid>0xd083e94c, 0x6560, 0x42e4, 0xb6, 0xd4, 0x2d, 0xf7, 0x5a, 0xdf, 0x6a, 0x2a</Guid>\r
-    </Entry>\r
-    <Entry Name="PciOptionRomTable">\r
-      <C_Name>gEfiPciOptionRomTableGuid</C_Name>\r
-      <Guid>0x7462660f, 0x1cbd, 0x48da, 0xad, 0x11, 0x91, 0x71, 0x79, 0x13, 0x83, 0x1c</Guid>\r
-    </Entry>\r
-    <Entry Name="PciHotplugDevice">\r
-      <C_Name>gEfiPciHotplugDeviceGuid</C_Name>\r
-      <Guid>0x0b280816, 0x52e7, 0x4e51, 0xaa, 0x57, 0x11, 0xbd, 0x41, 0xcb, 0xef, 0xc3</Guid>\r
-    </Entry>\r
-    <Entry Name="MemoryTypeInformation">\r
-      <C_Name>gEfiMemoryTypeInformationGuid</C_Name>\r
-      <Guid>0x4c19049f, 0x4137, 0x4dd3, 0x9c, 0x10, 0x8b, 0x97, 0xa8, 0x3f, 0xfd, 0xfa</Guid>\r
-    </Entry>\r
-    <Entry Name="CapsuleVendor">\r
-      <C_Name>gEfiCapsuleVendorGuid</C_Name>\r
-      <Guid>0x711C703F, 0xC285, 0x4B10, 0xA3, 0xB0, 0x36, 0xEC, 0xBD, 0x3C, 0x8B, 0xE2</Guid>\r
-    </Entry>\r
-    <Entry Name="CompatibleMemoryTested">\r
-      <C_Name>gEfiCompatibleMemoryTestedGuid</C_Name>\r
-      <Guid>0x64c475ef, 0x344b, 0x492c, 0x93, 0xad, 0xab, 0x9e, 0xb4, 0x39, 0x50, 0x4</Guid>\r
-    </Entry>\r
-    <Entry Name="PeiPerformanceHob">\r
-      <C_Name>gPeiPerformanceHobGuid</C_Name>\r
-      <Guid>0xec4df5af, 0x4395, 0x4cc9, 0x94, 0xde, 0x77, 0x50, 0x6d, 0x12, 0xc7, 0xb8</Guid>\r
-    </Entry>\r
-  </GuidDeclarations>\r
-  <ProtocolDeclarations>\r
-    <Entry Name="CustomizedDecompress">\r
-      <C_Name>gEfiCustomizedDecompressProtocolGuid</C_Name>\r
-      <Guid>0x9a44198e, 0xa4a2, 0x44e6, 0x8a, 0x1f, 0x39, 0xbe, 0xfd, 0xac, 0x89, 0x6f</Guid>\r
-    </Entry>\r
-    <Entry Name="DebugLevel">\r
-      <C_Name>gEfiDebugLevelProtocolGuid</C_Name>\r
-      <Guid>0x8d4c62e6, 0xcd98, 0x4e1d, 0xad, 0x6e, 0x48, 0xbb, 0x50, 0xd2, 0x9f, 0xf7</Guid>\r
-    </Entry>\r
-    <Entry Name="TianoDecompress">\r
-      <C_Name>gEfiTianoDecompressProtocolGuid</C_Name>\r
-      <Guid>0xe84cf29c, 0x191f, 0x4eae, 0x96, 0xe1, 0xf4, 0x6a, 0xec, 0xea, 0xea, 0x0b</Guid>\r
-    </Entry>\r
-    <Entry Name="LoadPeImage">\r
-      <C_Name>gEfiLoadPeImageProtocolGuid</C_Name>\r
-      <Guid>0x5cb5c776, 0x60d5, 0x45ee, 0x88, 0x3c, 0x45, 0x27, 0x08, 0xcd, 0x74, 0x3f</Guid>\r
-    </Entry>\r
-    <Entry Name="Print">\r
-      <C_Name>gEfiPrintProtocolGuid</C_Name>\r
-      <Guid>0xdf2d868e, 0x32fc, 0x4cf0, 0x8e, 0x6b, 0xff, 0xd9, 0x5d, 0x13, 0x43, 0xd0</Guid>\r
-    </Entry>\r
-    <Entry Name="GenericMemTest">\r
-      <C_Name>gEfiGenericMemTestProtocolGuid</C_Name>\r
-      <Guid>0x309de7f1, 0x7f5e, 0x4ace, 0xb4, 0x9c, 0x53, 0x1b, 0xe5, 0xaa, 0x95, 0xef</Guid>\r
-    </Entry>\r
-    <Entry Name="DiskInfo">\r
-      <C_Name>gEfiDiskInfoProtocolGuid</C_Name>\r
-      <Guid>0xd432a67f, 0x14dc, 0x484b, 0xb3, 0xbb, 0x3f, 0x02, 0x91, 0x84, 0x93, 0x27</Guid>\r
-    </Entry>\r
-    <Entry Name="FvbExtension">\r
-      <C_Name>gEfiFvbExtensionProtocolGuid</C_Name>\r
-      <Guid>0x53a4c71b, 0xb581, 0x4170, 0x91, 0xb3, 0x8d, 0xb8, 0x7a, 0x4b, 0x5c, 0x46</Guid>\r
-    </Entry>\r
-    <Entry Name="FaultTolerantWriteLite">\r
-      <C_Name>gEfiFaultTolerantWriteLiteProtocolGuid</C_Name>\r
-      <Guid>0x3f557189, 0x8dae, 0x45ae, 0xa0, 0xb3, 0x2b, 0x99, 0xca, 0x7a, 0xa7, 0xa0</Guid>\r
-    </Entry>\r
-    <Entry Name="ConsoleControl">\r
-      <C_Name>gEfiConsoleControlProtocolGuid</C_Name>\r
-      <Guid>0xf42f7782, 0x12e, 0x4c12, 0x99, 0x56, 0x49, 0xf9, 0x43, 0x04, 0xf7, 0x21</Guid>\r
-    </Entry>\r
-    <Entry Name="OEMBadging">\r
-      <C_Name>gEfiOEMBadgingProtocolGuid</C_Name>\r
-      <Guid>0x170e13c0, 0xbf1b, 0x4218, 0x87, 0x1d, 0x2a, 0xbd, 0xc6, 0xf8, 0x87, 0xbc</Guid>\r
-    </Entry>\r
-    <Entry Name="UgaSplash">\r
-      <C_Name>gEfiUgaSplashProtocolGuid</C_Name>\r
-      <Guid>0xa45b3a0d, 0x2e55, 0x4c03, 0xad, 0x9c, 0x27, 0xd4, 0x82, 0x0b, 0x50, 0x7e</Guid>\r
-    </Entry>\r
-    <Entry Name="AcpiS3Save">\r
-      <C_Name>gEfiAcpiS3SaveProtocolGuid</C_Name>\r
-      <Guid>0x125f2de1, 0xfb85, 0x440c, 0xa5, 0x4c, 0x4d, 0x99, 0x35, 0x8a, 0x8d, 0x38</Guid>\r
-    </Entry>\r
-    <Entry Name="Performance">\r
-      <C_Name>gEfiPerformanceProtocolGuid</C_Name>\r
-      <Guid>0xFFECFFFF, 0x923C, 0x14d2, 0x9E, 0x3F, 0x22, 0xA0, 0xC9, 0x69, 0x56, 0x3B</Guid>\r
-    </Entry>\r
-    <Entry Name="PxeDhcp4">\r
-      <C_Name>gEfiPxeDhcp4ProtocolGuid</C_Name>\r
-      <Guid>0x03c4e624, 0xac28, 0x11d3, 0x9a, 0x2d, 0x00, 0x90, 0x29, 0x3f, 0xc1, 0x4d</Guid>\r
-    </Entry>\r
-    <Entry Name="PxeDhcp4Callback">\r
-      <C_Name>gEfiPxeDhcp4CallbackProtocolGuid</C_Name>\r
-      <Guid>0xc1544c01, 0x92a4, 0x4198, 0x8a, 0x84, 0x77, 0x85, 0x83, 0xc2, 0x36, 0x21</Guid>\r
-    </Entry>\r
-    <Entry Name="UgaIo">\r
-      <C_Name>gEfiUgaIoProtocolGuid</C_Name>\r
-      <Guid>0x61a4d49e, 0x6f68, 0x4f1b, 0xb9, 0x22, 0xa8, 0x6e, 0xed, 0x0b, 0x07, 0xa2</Guid>\r
-    </Entry>\r
-    <Entry Name="DebugAssert">\r
-      <C_Name>gEfiDebugAssertProtocolGuid</C_Name>\r
-      <Guid>0xbe499c92, 0x7d4b, 0x11d4, 0xbc, 0xee, 0x00, 0x80, 0xc7, 0x3c, 0x88, 0x81</Guid>\r
-    </Entry>\r
-    <Entry Name="UsbAtapi">\r
-      <C_Name>gEfiUsbAtapiProtocolGuid</C_Name>\r
-      <Guid>0x2B2F68DA, 0x0CD2, 0x44cf, 0x8E, 0x8B, 0xBB, 0xA2, 0x0B, 0x1B, 0x5B, 0x75</Guid>\r
-    </Entry>\r
-    <Entry Name="PciHotPlugRequest">\r
-      <C_Name>gEfiPciHotPlugRequestProtocolGuid</C_Name>\r
-      <Guid>0x19cb87ab, 0x2cb9, 0x4665, 0x83, 0x60, 0xdd, 0xcf, 0x60, 0x54, 0xf7, 0x9d</Guid>\r
-    </Entry>\r
-    <Entry Name="ExtendedSalBootService">\r
-      <C_Name>gEfiExtendedSalBootServiceProtocolGuid</C_Name>\r
-      <Guid>0xde0ee9a4, 0x3c7a, 0x44f2, 0xb7, 0x8b, 0xe3, 0xcc, 0xd6, 0x9c, 0x3a, 0xf7</Guid>\r
-    </Entry>\r
-    <Entry Name="ExtendedSalVariableServices">\r
-      <C_Name>gEfiExtendedSalVariableServicesProtocolGuid</C_Name>\r
-      <Guid>0x4ecb6c53, 0xc641, 0x4370, 0x8c, 0xb2, 0x3b, 0x0e, 0x49, 0x6e, 0x83, 0x78</Guid>\r
-    </Entry>\r
-    <Entry Name="ExtendedSalStatusCodeServices">\r
-      <C_Name>gEfiExtendedSalStatusCodeServicesProtocolGuid</C_Name>\r
-      <Guid>0x00dbd91d, 0x55e9, 0x420f, 0x96, 0x39, 0x5e, 0x9f, 0x84, 0x37, 0xb4, 0x4f</Guid>\r
-    </Entry>\r
-    <Entry Name="IsaIo">\r
-      <C_Name>gEfiIsaIoProtocolGuid</C_Name>\r
-      <Guid>0x7ee2bd44, 0x3da0, 0x11d4, 0x9a, 0x38, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d</Guid>\r
-    </Entry>\r
-    <Entry Name="IsaAcpi">\r
-      <C_Name>gEfiIsaAcpiProtocolGuid</C_Name>\r
-      <Guid>0x64a892dc, 0x5561, 0x4536, 0x92, 0xc7, 0x79, 0x9b, 0xfc, 0x18, 0x33, 0x55</Guid>\r
-    </Entry>\r
-    <Entry Name="Performance">\r
-      <C_Name>gPerformanceProtocolGuid</C_Name>\r
-      <Guid>0x76b6bdfa, 0x2acd, 0x4462, 0x9E, 0x3F, 0xcb, 0x58, 0xC9, 0x69, 0xd9, 0x37</Guid>\r
-    </Entry>\r
-  </ProtocolDeclarations>\r
-  <PpiDeclarations>\r
-    <Entry Name="PeiInMemory">\r
-      <C_Name>gPeiInMemoryGuid</C_Name>\r
-      <Guid>0x643b8786, 0xb417, 0x48d2, 0x8f, 0x5e, 0x78, 0x19, 0x93, 0x1c, 0xae, 0xd8</Guid>\r
-    </Entry>\r
-    <Entry Name="FlashMap">\r
-      <C_Name>gPeiFlashMapPpiGuid</C_Name>\r
-      <Guid>0xf34c2fa0, 0xde88, 0x4270, 0x84, 0x14, 0x96, 0x12, 0x22, 0xf4, 0x52, 0x1c</Guid>\r
-    </Entry>\r
-    <Entry Name="BaseMemoryTest">\r
-      <C_Name>gPeiBaseMemoryTestPpiGuid</C_Name>\r
-      <Guid>0xb6ec423c, 0x21d2, 0x490d, 0x85, 0xc6, 0xdd, 0x58, 0x64, 0xea, 0xa6, 0x74</Guid>\r
-    </Entry>\r
-    <Entry Name="StatusCodeMemory">\r
-      <C_Name>gPeiStatusCodeMemoryPpiGuid</C_Name>\r
-      <Guid>0x26f8ab01, 0xd3cd, 0x489c, 0x98, 0x4f, 0xdf, 0xde, 0xf7, 0x68, 0x39, 0x5b</Guid>\r
-    </Entry>\r
-  </PpiDeclarations>\r
-  <PcdDefinitions>\r
-    <PcdEntry ItemType="FIXED_AT_BUILD">\r
-      <C_Name>PcdMaximumUnicodeStringLength</C_Name>\r
-      <Token>0x00000001</Token>\r
-      <DatumType>UINT32</DatumType>\r
-      <DefaultValue>1000000</DefaultValue>\r
-    </PcdEntry>\r
-    <PcdEntry ItemType="FIXED_AT_BUILD">\r
-      <C_Name>PcdMaximumAsciiStringLength</C_Name>\r
-      <Token>0x00000002</Token>\r
-      <DatumType>UINT32</DatumType>\r
-      <DefaultValue>1000000</DefaultValue>\r
-    </PcdEntry>\r
-    <PcdEntry ItemType="FIXED_AT_BUILD">\r
-      <C_Name>PcdMaximumLinkedListLength</C_Name>\r
-      <Token>0x00000003</Token>\r
-      <DatumType>UINT32</DatumType>\r
-      <DefaultValue>1000000</DefaultValue>\r
-    </PcdEntry>\r
-    <PcdEntry ItemType="FIXED_AT_BUILD">\r
-      <C_Name>PcdSpinLockTimeout</C_Name>\r
-      <Token>0x00000004</Token>\r
-      <DatumType>UINT32</DatumType>\r
-      <DefaultValue>10000000</DefaultValue>\r
-    </PcdEntry>\r
-    <PcdEntry ItemType="FIXED_AT_BUILD">\r
-      <C_Name>PcdDebugPropertyMask</C_Name>\r
-      <Token>0x00000005</Token>\r
-      <DatumType>UINT8</DatumType>\r
-      <DefaultValue>0x0f</DefaultValue>\r
-    </PcdEntry>\r
-    <PcdEntry ItemType="PATCHABLE_IN_MODULE">\r
-      <C_Name>PcdDebugPrintErrorLevel</C_Name>\r
-      <Token>0x00000006</Token>\r
-      <DatumType>UINT32</DatumType>\r
-      <DefaultValue>0x80000000</DefaultValue>\r
-    </PcdEntry>\r
-    <PcdEntry ItemType="FIXED_AT_BUILD">\r
-      <C_Name>PcdReportStatusCodePropertyMask</C_Name>\r
-      <Token>0x00000007</Token>\r
-      <DatumType>UINT8</DatumType>\r
-      <DefaultValue>0x07</DefaultValue>\r
-    </PcdEntry>\r
-    <PcdEntry ItemType="FIXED_AT_BUILD">\r
-      <C_Name>PcdDebugClearMemoryValue</C_Name>\r
-      <Token>0x00000008</Token>\r
-      <DatumType>UINT8</DatumType>\r
-      <DefaultValue>0xAF</DefaultValue>\r
-    </PcdEntry>\r
-    <PcdEntry ItemType="FIXED_AT_BUILD">\r
-      <C_Name>PcdDebugClearMemoryValue</C_Name>\r
-      <Token>0x00000008</Token>\r
-      <DatumType>UINT8</DatumType>\r
-      <DefaultValue>0xAF</DefaultValue>\r
-    </PcdEntry>    \r
-    <PcdEntry ItemType="FIXED_AT_BUILD">\r
-      <C_Name>PcdPerformanceLibraryPropertyMask</C_Name>\r
-      <Token>0x00000009</Token>\r
-      <DatumType>UINT8</DatumType>\r
-      <DefaultValue>0</DefaultValue>\r
-    </PcdEntry>\r
-  </PcdDefinitions>\r
-</PackageSurfaceArea>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Copyright (c) 2006, Intel Corporation
+All rights reserved. This program and the accompanying materials
+are licensed and made available under the terms and conditions of the BSD License
+which accompanies this distribution.  The full text of the license may be found at
+http://opensource.org/licenses/bsd-license.php
+
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+-->
+<PackageSurfaceArea xmlns="http://www.TianoCore.org/2006/Edk2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.TianoCore.org/2006/Edk2.0  http://www.TianoCore.org/2006/Edk2.0/SurfaceArea.xsd">
+  <SpdHeader>
+    <PackageName>EdkModulePkg</PackageName>
+    <Guid>0xb6ec423c, 0x21d2, 0x490d, 0x85, 0xc6, 0xdd, 0x58, 0x64, 0xea, 0xa6, 0x74</Guid>
+    <Version>0</Version>
+    <Abstract>Edk Module Package Reference Implementations</Abstract>
+    <Description>This Module provides standard reference information for EFI/Tiano implementations.</Description>
+    <Copyright>Copyright (c) 2006,  Intel Corporation.</Copyright>
+    <License>
+      All rights reserved.
+      This program and the accompanying materials are licensed and made available 
+      under the terms and conditions of the BSD License which accompanies this distribution.
+      The full text of the license may be found at http://opensource.org/licenses/bsd-license.php
+      THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES
+      OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+    </License>
+    <Created>2006-02-21 17:43</Created>
+    <Updated>2006-03-19 16:26</Updated>
+    <URL>http://www.TianoCore.org</URL>
+    <PackageType>SOURCE</PackageType>
+    <ReadOnly>true</ReadOnly>
+    <RePackage>false</RePackage>
+  </SpdHeader>
+  <LibraryClassDeclarations>
+    <LibraryClassDeclaration>
+      <LibraryClass>CustomDecompressLib</LibraryClass>
+      <IncludeHeader>Include/Library/CustomDecompressLib.h</IncludeHeader>
+    </LibraryClassDeclaration>
+    <LibraryClassDeclaration>
+      <LibraryClass>EdkBsDataHubStatusCodeLib</LibraryClass>
+      <IncludeHeader>Include/Library/EdkBsDataHubStatusCodeLib.h</IncludeHeader>
+    </LibraryClassDeclaration>
+    <LibraryClassDeclaration>
+      <LibraryClass>EdkDxeSalLib</LibraryClass>
+      <IncludeHeader>Include/Library/EdkDxeSalLib.h</IncludeHeader>
+    </LibraryClassDeclaration>
+    <LibraryClassDeclaration>
+      <LibraryClass>EdkFvbServiceLib</LibraryClass>
+      <IncludeHeader>Include/Library/EdkFvbServiceLib.h</IncludeHeader>
+    </LibraryClassDeclaration>
+    <LibraryClassDeclaration>
+      <LibraryClass>EdkGraphicsLib</LibraryClass>
+      <IncludeHeader>Include/Library/EdkGraphicsLib.h</IncludeHeader>
+    </LibraryClassDeclaration>
+    <LibraryClassDeclaration>
+      <LibraryClass>EdkIfrSupportLib</LibraryClass>
+      <IncludeHeader>Include/Library/EdkIfrSupportLib.h</IncludeHeader>
+    </LibraryClassDeclaration>
+    <LibraryClassDeclaration>
+      <LibraryClass>EdkMemoryStatusCodeLib</LibraryClass>
+      <IncludeHeader>Include/Library/EdkMemoryStatusCodeLib.h</IncludeHeader>
+    </LibraryClassDeclaration>
+    <LibraryClassDeclaration>
+      <LibraryClass>EdkPeCoffLoaderLib</LibraryClass>
+      <IncludeHeader>Include/Library/EdkPeCoffLoaderLib.h</IncludeHeader>
+    </LibraryClassDeclaration>
+    <LibraryClassDeclaration>
+      <LibraryClass>EdkPeCoffLoaderX64Lib</LibraryClass>
+      <IncludeHeader>Include/Library/EdkPeCoffLoaderX64Lib.h</IncludeHeader>
+    </LibraryClassDeclaration>
+    <LibraryClassDeclaration>
+      <LibraryClass>EdkRtMemoryStatusCodeLib</LibraryClass>
+      <IncludeHeader>Include/Library/EdkRtMemoryStatusCodeLib.h</IncludeHeader>
+    </LibraryClassDeclaration>
+    <LibraryClassDeclaration>
+      <LibraryClass>EdkRtPlatformStatusCodeLib</LibraryClass>
+      <IncludeHeader>Include/Library/EdkRtPlatformStatusCodeLib.h</IncludeHeader>
+    </LibraryClassDeclaration>
+    <LibraryClassDeclaration>
+      <LibraryClass>EdkScsiLib</LibraryClass>
+      <IncludeHeader>Include/Library/EdkScsiLib.h</IncludeHeader>
+    </LibraryClassDeclaration>
+    <LibraryClassDeclaration>
+      <LibraryClass>EdkUsbLib</LibraryClass>
+      <IncludeHeader>Include/Library/EdkUsbLib.h</IncludeHeader>
+    </LibraryClassDeclaration>
+    <LibraryClassDeclaration>
+      <LibraryClass>TianoDecompressLib</LibraryClass>
+      <IncludeHeader>Include/Library/TianoDecompressLib.h</IncludeHeader>
+    </LibraryClassDeclaration>
+  </LibraryClassDeclarations>
+  <MsaFiles>
+    <MsaFile>
+      <Filename>Application/HelloWorld/HelloWorld.msa</Filename>
+    </MsaFile>
+    <MsaFile>
+      <Filename>Bus/Pci/AtapiPassThru/Dxe/AtapiPassThru.msa</Filename>
+    </MsaFile>
+    <MsaFile>
+      <Filename>Bus/Pci/CirrusLogic/Dxe/CirrusLogic5430.msa</Filename>
+    </MsaFile>
+    <MsaFile>
+      <Filename>Bus/Pci/IdeBus/Dxe/idebus.msa</Filename>
+    </MsaFile>
+    <MsaFile>
+      <Filename>Bus/Pci/IdeBus/Dxe/idebusLite.msa</Filename>
+    </MsaFile>
+    <MsaFile>
+      <Filename>Bus/Pci/PciBus/Dxe/LightPciBus.msa</Filename>
+    </MsaFile>
+    <MsaFile>
+      <Filename>Bus/Pci/PciBus/Dxe/PciBus.msa</Filename>
+    </MsaFile>
+    <MsaFile>
+      <Filename>Bus/Pci/PciBus/Dxe/PciBusLite.msa</Filename>
+    </MsaFile>
+    <MsaFile>
+      <Filename>Bus/Pci/Uhci/Dxe/Uhci.msa</Filename>
+    </MsaFile>
+    <MsaFile>
+      <Filename>Bus/Pci/Undi/RuntimeDxe/Undi.msa</Filename>
+    </MsaFile>
+    <MsaFile>
+      <Filename>Bus/Scsi/ScsiBus/Dxe/ScsiBus.msa</Filename>
+    </MsaFile>
+    <MsaFile>
+      <Filename>Bus/Scsi/ScsiDisk/Dxe/ScsiDisk.msa</Filename>
+    </MsaFile>
+    <MsaFile>
+      <Filename>Bus/Usb/UsbBot/Dxe/UsbBot.msa</Filename>
+    </MsaFile>
+    <MsaFile>
+      <Filename>Bus/Usb/UsbBus/Dxe/UsbBus.msa</Filename>
+    </MsaFile>
+    <MsaFile>
+      <Filename>Bus/Usb/UsbCbi/Dxe/Cbi0/UsbCbi0.msa</Filename>
+    </MsaFile>
+    <MsaFile>
+      <Filename>Bus/Usb/UsbCbi/Dxe/Cbi1/UsbCbi1.msa</Filename>
+    </MsaFile>
+    <MsaFile>
+      <Filename>Bus/Usb/UsbKb/Dxe/UsbKb.msa</Filename>
+    </MsaFile>
+    <MsaFile>
+      <Filename>Bus/Usb/UsbMassStorage/Dxe/UsbMassStorage.msa</Filename>
+    </MsaFile>
+    <MsaFile>
+      <Filename>Bus/Usb/UsbMouse/Dxe/UsbMouse.msa</Filename>
+    </MsaFile>
+    <MsaFile>
+      <Filename>Core/Dxe/DxeMain.msa</Filename>
+    </MsaFile>
+    <MsaFile>
+      <Filename>Core/DxeIplPeim/DxeIpl.msa</Filename>
+    </MsaFile>
+    <MsaFile>
+      <Filename>Core/DxeIplPeim/DxeIplX64.msa</Filename>
+    </MsaFile>
+    <MsaFile>
+      <Filename>Core/Pei/PeiMain.msa</Filename>
+    </MsaFile>
+    <MsaFile>
+      <Filename>Library/BaseCustomDecompressLibNull/BaseCustomDecompressLibNull.msa</Filename>
+    </MsaFile>
+    <MsaFile>
+      <Filename>Library/BaseUefiTianoDecompressLib/BaseUefiTianoDecompressLib.msa</Filename>
+    </MsaFile>
+    <MsaFile>
+      <Filename>Library/DxeCoreCustomDecompressLibFromHob/DxeCoreCustomDecompressLibFromHob.msa</Filename>
+    </MsaFile>
+    <MsaFile>
+      <Filename>Library/DxeCorePerformanceLib/DxeCorePerformanceLib.msa</Filename>
+    </MsaFile>
+    <MsaFile>
+      <Filename>Library/DxeCoreTianoDecompressLibFromHob/DxeCoreTianoDecompressLibFromHob.msa</Filename>
+    </MsaFile>
+    <MsaFile>
+      <Filename>Library/DxeCoreUefiDecompressLibFromHob/DxeCoreUefiDecompressLibFromHob.msa</Filename>
+    </MsaFile>
+    <MsaFile>
+      <Filename>Library/EdkDxeDebugLibReportStatusCode/EdkDxeDebugLibReportStatusCode.msa</Filename>
+    </MsaFile>
+    <MsaFile>
+      <Filename>Library/EdkDxePeCoffLoaderFromHobLib/EdkDxePeCoffLoaderFromHobLib.msa</Filename>
+    </MsaFile>
+    <MsaFile>
+      <Filename>Library/EdkDxePerformanceLib/EdkDxePerformanceLib.msa</Filename>
+    </MsaFile>
+    <MsaFile>
+      <Filename>Library/EdkDxePrintLib/EdkDxePrintLib.msa</Filename>
+    </MsaFile>
+    <MsaFile>
+      <Filename>Library/EdkDxeRuntimeDriverLib/EdkDxeRuntimeDriverLib.msa</Filename>
+    </MsaFile>
+    <MsaFile>
+      <Filename>Library/EdkDxeSalLib/EdkDxeSalLib.msa</Filename>
+    </MsaFile>
+    <MsaFile>
+      <Filename>Library/EdkFvbServiceLib/EdkFvbServiceLib.msa</Filename>
+    </MsaFile>
+    <MsaFile>
+      <Filename>Library/EdkGraphicsLib/EdkGraphicsLib.msa</Filename>
+    </MsaFile>
+    <MsaFile>
+      <Filename>Library/EdkIfrSupportLib/EdkIfrSupportLib.msa</Filename>
+    </MsaFile>
+    <MsaFile>
+      <Filename>Library/EdkMemoryStatusCodeLib/EdkMemoryStatusCodeLib.msa</Filename>
+    </MsaFile>
+    <MsaFile>
+      <Filename>Library/EdkNullCustomizedDecompressLib/EdkNullCustomizedDecompressLib.msa</Filename>
+    </MsaFile>
+    <MsaFile>
+      <Filename>Library/EdkPeCoffLoaderLib/EdkPeCoffLoaderLib.msa</Filename>
+    </MsaFile>
+    <MsaFile>
+      <Filename>Library/EdkPeCoffLoaderLibX64/EdkPeCoffLoaderLibX64.msa</Filename>
+    </MsaFile>
+    <MsaFile>
+      <Filename>Library/EdkPeCoffLoaderX64Lib/EdkPeCoffLoaderX64Lib.msa</Filename>
+    </MsaFile>
+    <MsaFile>
+      <Filename>Library/EdkPeiPerformanceLib/EdkPeiPerformanceLib.msa</Filename>
+    </MsaFile>
+    <MsaFile>
+      <Filename>Library/EdkRuntimeStatusCodeLib/BsDataHubStatusCode/BsDataHubStatusCode.msa</Filename>
+    </MsaFile>
+    <MsaFile>
+      <Filename>Library/EdkRuntimeStatusCodeLib/RtMemoryStatusCode/RtMemoryStatusCode.msa</Filename>
+    </MsaFile>
+    <MsaFile>
+      <Filename>Library/EdkRuntimeStatusCodeLib/RtPlatformStatusCode/RtPlatformStatusCode.msa</Filename>
+    </MsaFile>
+    <MsaFile>
+      <Filename>Library/EdkScsiLib/EdkScsiLib.msa</Filename>
+    </MsaFile>
+    <MsaFile>
+      <Filename>Library/EdkUefiDebugLibConOut/EdkUefiDebugLibConOut.msa</Filename>
+    </MsaFile>
+    <MsaFile>
+      <Filename>Library/EdkUefiDebugLibStdErr/EdkUefiDebugLibStdErr.msa</Filename>
+    </MsaFile>
+    <MsaFile>
+      <Filename>Library/EdkUsbLib/EdkUsbLib.msa</Filename>
+    </MsaFile>
+    <MsaFile>
+      <Filename>Universal/Console/ConSplitter/Dxe/ConSplitter.msa</Filename>
+    </MsaFile>
+    <MsaFile>
+      <Filename>Universal/Console/GraphicsConsole/Dxe/GraphicsConsole.msa</Filename>
+    </MsaFile>
+    <MsaFile>
+      <Filename>Universal/Console/Terminal/Dxe/Terminal.msa</Filename>
+    </MsaFile>
+    <MsaFile>
+      <Filename>Universal/DataHub/DataHub/Dxe/DataHub.msa</Filename>
+    </MsaFile>
+    <MsaFile>
+      <Filename>Universal/DataHub/DataHubStdErr/Dxe/DataHubStdErr.msa</Filename>
+    </MsaFile>
+    <MsaFile>
+      <Filename>Universal/Debugger/Debugport/Dxe/DebugPort.msa</Filename>
+    </MsaFile>
+    <MsaFile>
+      <Filename>Universal/DebugSupport/Dxe/DebugSupport.msa</Filename>
+    </MsaFile>
+    <MsaFile>
+      <Filename>Universal/Disk/DiskIo/Dxe/DiskIo.msa</Filename>
+    </MsaFile>
+    <MsaFile>
+      <Filename>Universal/Disk/DiskIoPartition/dxe/DiskIoPartition.msa</Filename>
+    </MsaFile>
+    <MsaFile>
+      <Filename>Universal/Disk/Partition/Dxe/Partition.msa</Filename>
+    </MsaFile>
+    <MsaFile>
+      <Filename>Universal/Disk/UnicodeCollation/English/Dxe/English.msa</Filename>
+    </MsaFile>
+    <MsaFile>
+      <Filename>Universal/Ebc/Dxe/Ebc.msa</Filename>
+    </MsaFile>
+    <MsaFile>
+      <Filename>Universal/FirmwareVolume/FaultTolerantWriteLite/Dxe/FtwLite.msa</Filename>
+    </MsaFile>
+    <MsaFile>
+      <Filename>Universal/FirmwareVolume/GuidedSectionExtraction/Crc32SectionExtract/Dxe/Crc32SectionExtract.msa</Filename>
+    </MsaFile>
+    <MsaFile>
+      <Filename>Universal/GenericMemoryTest/Dxe/NullMemoryTest.msa</Filename>
+    </MsaFile>
+    <MsaFile>
+      <Filename>Universal/GenericMemoryTest/Pei/BaseMemoryTest.msa</Filename>
+    </MsaFile>
+    <MsaFile>
+      <Filename>Universal/MonotonicCounter/RuntimeDxe/MonotonicCounter.msa</Filename>
+    </MsaFile>
+    <MsaFile>
+      <Filename>Universal/Network/PxeBc/Dxe/BC.msa</Filename>
+    </MsaFile>
+    <MsaFile>
+      <Filename>Universal/Network/PxeDhcp4/Dxe/Dhcp4.msa</Filename>
+    </MsaFile>
+    <MsaFile>
+      <Filename>Universal/Network/Snp32_64/Dxe/SNP.msa</Filename>
+    </MsaFile>
+    <MsaFile>
+      <Filename>Universal/Runtime/RuntimeDxe/Runtime.msa</Filename>
+    </MsaFile>
+    <MsaFile>
+      <Filename>Universal/Security/SecurityStub/Dxe/SecurityStub.msa</Filename>
+    </MsaFile>
+    <MsaFile>
+      <Filename>Universal/StatusCode/RuntimeDxe/StatusCode.msa</Filename>
+    </MsaFile>
+    <MsaFile>
+      <Filename>Universal/UserInterface/HiiDataBase/Dxe/HiiDatabase.msa</Filename>
+    </MsaFile>
+    <MsaFile>
+      <Filename>Universal/UserInterface/SetupBrowser/Dxe/DriverSample/DriverSample.msa</Filename>
+    </MsaFile>
+    <MsaFile>
+      <Filename>Universal/UserInterface/SetupBrowser/Dxe/SetupBrowser.msa</Filename>
+    </MsaFile>
+    <MsaFile>
+      <Filename>Universal/Variable/Pei/Variable.msa</Filename>
+    </MsaFile>
+    <MsaFile>
+      <Filename>Universal/EmuVariable/RuntimeDxe/EmuVariable.msa</Filename>
+    </MsaFile>
+    <MsaFile>
+      <Filename>Universal/Variable/RuntimeDxe/Variable.msa</Filename>
+    </MsaFile>
+    <MsaFile>
+      <Filename>Universal/WatchdogTimer/Dxe/WatchDogTimer.msa</Filename>
+    </MsaFile>
+  </MsaFiles>
+  <PackageHeaders>
+    <IncludeHeader ModuleType="SEC">Include/EdkPeim.h</IncludeHeader>
+    <IncludeHeader ModuleType="PEI_CORE">Include/EdkPeiCore.h</IncludeHeader>
+    <IncludeHeader ModuleType="PEIM">Include/EdkPeim.h</IncludeHeader>
+    <IncludeHeader ModuleType="DXE_CORE">Include/EdkDxeCore.h</IncludeHeader>
+    <IncludeHeader ModuleType="DXE_DRIVER">Include/EdkDxe.h</IncludeHeader>
+    <IncludeHeader ModuleType="DXE_RUNTIME_DRIVER">Include/EdkDxe.h</IncludeHeader>
+    <IncludeHeader ModuleType="DXE_SMM_DRIVER">Include/EdkDxe.h</IncludeHeader>
+    <IncludeHeader ModuleType="DXE_SAL_DRIVER">Include/EdkDxe.h</IncludeHeader>
+    <IncludeHeader ModuleType="UEFI_DRIVER">Include/EdkDxe.h</IncludeHeader>
+  </PackageHeaders>
+  <GuidDeclarations>
+    <Entry Name="PeiPeCoffLoader">
+      <C_Name>gEfiPeiPeCoffLoaderGuid</C_Name>
+      <Guid>0xd8117cff, 0x94a6, 0x11d4, 0x9a, 0x3a, 0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d</Guid>
+    </Entry>
+    <Entry Name="FlashMapHob">
+      <C_Name>gEfiFlashMapHobGuid</C_Name>
+      <Guid>0xb091e7d2, 0x5a0, 0x4198, 0x94, 0xf0, 0x74, 0xb7, 0xb8, 0xc5, 0x54, 0x59</Guid>
+    </Entry>
+    <Entry Name="StatusCodeDataTypeString">
+      <C_Name>gEfiStatusCodeDataTypeStringGuid</C_Name>
+      <Guid>0x92D11080, 0x496F, 0x4D95, 0xBE, 0x7E, 0x03, 0x74, 0x88, 0x38, 0x2B, 0x0A</Guid>
+    </Entry>
+    <Entry Name="StatusCodeDataTypeDebug">
+      <C_Name>gEfiStatusCodeDataTypeDebugGuid</C_Name>
+      <Guid>0x9A4E9246, 0xD553, 0x11D5, 0x87, 0xE2, 0x00, 0x06, 0x29, 0x45, 0xC3, 0xb9</Guid>
+    </Entry>
+    <Entry Name="StatusCodeDataTypeAssert">
+      <C_Name>gEfiStatusCodeDataTypeAssertGuid</C_Name>
+      <Guid>0xDA571595, 0x4D99, 0x487C, 0x82, 0x7C, 0x26, 0x22, 0x67, 0x7D, 0x33, 0x07</Guid>
+    </Entry>
+    <Entry Name="StatusCodeDataTypeExceptionHandler">
+      <C_Name>gEfiStatusCodeDataTypeExceptionHandlerGuid</C_Name>
+      <Guid>0x3BC2BD12, 0xAD2E, 0x11D5, 0x87, 0xDD, 0x00, 0x06, 0x29, 0x45, 0xC3, 0xB9</Guid>
+    </Entry>
+    <Entry Name="StatusCodeDataTypeError">
+      <C_Name>gEfiStatusCodeDataTypeErrorGuid</C_Name>
+      <Guid>0xAB359CE3, 0x99B3, 0xAE18, 0xC8, 0x9D, 0x95, 0xD3, 0xB0, 0x72, 0xE1, 0x9B</Guid>
+    </Entry>
+    <Entry Name="StatusCodeDataTypeProgressCode">
+      <C_Name>gEfiStatusCodeDataTypeProgressCodeGuid</C_Name>
+      <Guid>0xA356AB39, 0x35C4, 0x35DA, 0xB3, 0x7A, 0xF8, 0xEA, 0x9E, 0x8B, 0x36, 0xA3</Guid>
+    </Entry>
+    <Entry Name="StatusCodeSpecificData">
+      <C_Name>gEfiStatusCodeSpecificDataGuid</C_Name>
+      <Guid>0x335984bd, 0xe805, 0x409a, 0xb8, 0xf8, 0xd2, 0x7e, 0xce, 0x5f, 0xf7, 0xa6</Guid>
+    </Entry>
+    <Entry Name="SystemNvDataHob">
+      <C_Name>gEfiSystemNvDataHobGuid</C_Name>
+      <Guid>0xd6e5092d, 0xc7b2, 0x4872, 0xaf, 0x66, 0xfd, 0xc0, 0xe6, 0xf9, 0x5e, 0x78</Guid>
+    </Entry>
+    <Entry Name="SystemNvDataFv">
+      <C_Name>gEfiSystemNvDataFvGuid</C_Name>
+      <Guid>0xfff12b8d, 0x7696, 0x4c8b, 0xa9, 0x85, 0x27, 0x47, 0x07, 0x5b, 0x4f, 0x50</Guid>
+    </Entry>
+    <Entry Name="DiskInfoIde">
+      <C_Name>gEfiDiskInfoIdeInterfaceGuid</C_Name>
+      <Guid>0x5e948fe3, 0x26d3, 0x42b5, 0xaf, 0x17, 0x61, 0x02, 0x87, 0x18, 0x8d, 0xec</Guid>
+    </Entry>
+    <Entry Name="DiskInfoScsi">
+      <C_Name>gEfiDiskInfoScsiInterfaceGuid</C_Name>
+      <Guid>0x8f74baa, 0xea36, 0x41d9, 0x95, 0x21, 0x21, 0xa7, 0x0f, 0x87, 0x80, 0xbc</Guid>
+    </Entry>
+    <Entry Name="DiskInfoUsb">
+      <C_Name>gEfiDiskInfoUsbInterfaceGuid</C_Name>
+      <Guid>0xcb871572, 0xc11a, 0x47b5, 0xb4, 0x92, 0x67, 0x5e, 0xaf, 0xa7, 0x77, 0x27</Guid>
+    </Entry>
+    <Entry Name="AlternateFvBlock">
+      <C_Name>gEfiAlternateFvBlockGuid</C_Name>
+      <Guid>0xf496922d, 0x172f, 0x4bbc, 0xa1, 0xeb, 0x0e, 0xeb, 0x94, 0x9c, 0x34, 0x86</Guid>
+    </Entry>
+    <Entry Name="ConsoleInDevice">
+      <C_Name>gEfiConsoleInDeviceGuid</C_Name>
+      <Guid>0xd3b36f2b, 0xd551, 0x11d4, 0x9a, 0x46, 0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d</Guid>
+    </Entry>
+    <Entry Name="ConsoleOutDevice">
+      <C_Name>gEfiConsoleOutDeviceGuid</C_Name>
+      <Guid>0xd3b36f2c, 0xd551, 0x11d4, 0x9a, 0x46, 0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d</Guid>
+    </Entry>
+    <Entry Name="StandardErrorDevice">
+      <C_Name>gEfiStandardErrorDeviceGuid</C_Name>
+      <Guid>0xd3b36f2d, 0xd551, 0x11d4, 0x9a, 0x46, 0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d</Guid>
+    </Entry>
+    <Entry Name="HotPlugDevice">
+      <C_Name>gEfiHotPlugDeviceGuid</C_Name>
+      <Guid>0x220ac432, 0x1d43, 0x49e5, 0xa7, 0x4f, 0x4c, 0x9d, 0xa6, 0x7a, 0xd2, 0x3b</Guid>
+    </Entry>
+    <Entry Name="PrimaryStandardErrorDevice">
+      <C_Name>gEfiPrimaryStandardErrorDeviceGuid</C_Name>
+      <Guid>0x5a68191b, 0x9b97, 0x4752, 0x99, 0x46, 0xe3, 0x6a, 0x5d, 0xa9, 0x42, 0xb1</Guid>
+    </Entry>
+    <Entry Name="PrimaryConsoleInDevice">
+      <C_Name>gEfiPrimaryConsoleInDeviceGuid</C_Name>
+      <Guid>0xe451dcbe, 0x96a1, 0x4729, 0xa5, 0xcf, 0x6b, 0x9c, 0x2c, 0xff, 0x47, 0xfd</Guid>
+    </Entry>
+    <Entry Name="PrimaryConsoleOutDevice">
+      <C_Name>gEfiPrimaryConsoleOutDeviceGuid</C_Name>
+      <Guid>0x62bdf38a, 0xe3d5, 0x492c, 0x95, 0x0c, 0x23, 0xa7, 0xf6, 0x6e, 0x67, 0x2e</Guid>
+    </Entry>
+    <Entry Name="Bmp">
+      <C_Name>gEfiDefaultBmpLogoGuid</C_Name>
+      <Guid>0x7BB28B99, 0x61BB, 0x11d5, 0x9A, 0x5D, 0x00, 0x90, 0x27, 0x3F, 0xC1, 0x4D</Guid>
+    </Entry>
+    <Entry Name="BootState">
+      <C_Name>gEfiBootStateGuid</C_Name>
+      <Guid>0x60b5e939, 0xfcf, 0x4227, 0xba, 0x83, 0x6b, 0xbe, 0xd4, 0x5b, 0xc0, 0xe3</Guid>
+    </Entry>
+    <Entry Name="ShellFile">
+      <C_Name>gEfiShellFileGuid</C_Name>
+      <Guid>0xc57ad6b7, 0x0515, 0x40a8, 0x9d, 0x21, 0x55, 0x16, 0x52, 0x85, 0x4e, 0x37</Guid>
+    </Entry>
+    <Entry Name="MiniShellFile">
+      <C_Name>gEfiMiniShellFileGuid</C_Name>
+      <Guid>0x86ad232b, 0xd33a, 0x465c, 0xbf, 0x5f, 0x41, 0x37, 0x0b, 0xa9, 0x2f, 0xe2</Guid>
+    </Entry>
+    <Entry Name="StatusCode">
+      <C_Name>gEfiStatusCodeGuid</C_Name>
+      <Guid>0xd083e94c, 0x6560, 0x42e4, 0xb6, 0xd4, 0x2d, 0xf7, 0x5a, 0xdf, 0x6a, 0x2a</Guid>
+    </Entry>
+    <Entry Name="PciOptionRomTable">
+      <C_Name>gEfiPciOptionRomTableGuid</C_Name>
+      <Guid>0x7462660f, 0x1cbd, 0x48da, 0xad, 0x11, 0x91, 0x71, 0x79, 0x13, 0x83, 0x1c</Guid>
+    </Entry>
+    <Entry Name="PciHotplugDevice">
+      <C_Name>gEfiPciHotplugDeviceGuid</C_Name>
+      <Guid>0x0b280816, 0x52e7, 0x4e51, 0xaa, 0x57, 0x11, 0xbd, 0x41, 0xcb, 0xef, 0xc3</Guid>
+    </Entry>
+    <Entry Name="MemoryTypeInformation">
+      <C_Name>gEfiMemoryTypeInformationGuid</C_Name>
+      <Guid>0x4c19049f, 0x4137, 0x4dd3, 0x9c, 0x10, 0x8b, 0x97, 0xa8, 0x3f, 0xfd, 0xfa</Guid>
+    </Entry>
+    <Entry Name="CapsuleVendor">
+      <C_Name>gEfiCapsuleVendorGuid</C_Name>
+      <Guid>0x711C703F, 0xC285, 0x4B10, 0xA3, 0xB0, 0x36, 0xEC, 0xBD, 0x3C, 0x8B, 0xE2</Guid>
+    </Entry>
+    <Entry Name="CompatibleMemoryTested">
+      <C_Name>gEfiCompatibleMemoryTestedGuid</C_Name>
+      <Guid>0x64c475ef, 0x344b, 0x492c, 0x93, 0xad, 0xab, 0x9e, 0xb4, 0x39, 0x50, 0x4</Guid>
+    </Entry>
+    <Entry Name="PeiPerformanceHob">
+      <C_Name>gPeiPerformanceHobGuid</C_Name>
+      <Guid>0xec4df5af, 0x4395, 0x4cc9, 0x94, 0xde, 0x77, 0x50, 0x6d, 0x12, 0xc7, 0xb8</Guid>
+    </Entry>
+  </GuidDeclarations>
+  <ProtocolDeclarations>
+    <Entry Name="CustomizedDecompress">
+      <C_Name>gEfiCustomizedDecompressProtocolGuid</C_Name>
+      <Guid>0x9a44198e, 0xa4a2, 0x44e6, 0x8a, 0x1f, 0x39, 0xbe, 0xfd, 0xac, 0x89, 0x6f</Guid>
+    </Entry>
+    <Entry Name="DebugLevel">
+      <C_Name>gEfiDebugLevelProtocolGuid</C_Name>
+      <Guid>0x8d4c62e6, 0xcd98, 0x4e1d, 0xad, 0x6e, 0x48, 0xbb, 0x50, 0xd2, 0x9f, 0xf7</Guid>
+    </Entry>
+    <Entry Name="TianoDecompress">
+      <C_Name>gEfiTianoDecompressProtocolGuid</C_Name>
+      <Guid>0xe84cf29c, 0x191f, 0x4eae, 0x96, 0xe1, 0xf4, 0x6a, 0xec, 0xea, 0xea, 0x0b</Guid>
+    </Entry>
+    <Entry Name="LoadPeImage">
+      <C_Name>gEfiLoadPeImageProtocolGuid</C_Name>
+      <Guid>0x5cb5c776, 0x60d5, 0x45ee, 0x88, 0x3c, 0x45, 0x27, 0x08, 0xcd, 0x74, 0x3f</Guid>
+    </Entry>
+    <Entry Name="Print">
+      <C_Name>gEfiPrintProtocolGuid</C_Name>
+      <Guid>0xdf2d868e, 0x32fc, 0x4cf0, 0x8e, 0x6b, 0xff, 0xd9, 0x5d, 0x13, 0x43, 0xd0</Guid>
+    </Entry>
+    <Entry Name="GenericMemTest">
+      <C_Name>gEfiGenericMemTestProtocolGuid</C_Name>
+      <Guid>0x309de7f1, 0x7f5e, 0x4ace, 0xb4, 0x9c, 0x53, 0x1b, 0xe5, 0xaa, 0x95, 0xef</Guid>
+    </Entry>
+    <Entry Name="DiskInfo">
+      <C_Name>gEfiDiskInfoProtocolGuid</C_Name>
+      <Guid>0xd432a67f, 0x14dc, 0x484b, 0xb3, 0xbb, 0x3f, 0x02, 0x91, 0x84, 0x93, 0x27</Guid>
+    </Entry>
+    <Entry Name="FvbExtension">
+      <C_Name>gEfiFvbExtensionProtocolGuid</C_Name>
+      <Guid>0x53a4c71b, 0xb581, 0x4170, 0x91, 0xb3, 0x8d, 0xb8, 0x7a, 0x4b, 0x5c, 0x46</Guid>
+    </Entry>
+    <Entry Name="FaultTolerantWriteLite">
+      <C_Name>gEfiFaultTolerantWriteLiteProtocolGuid</C_Name>
+      <Guid>0x3f557189, 0x8dae, 0x45ae, 0xa0, 0xb3, 0x2b, 0x99, 0xca, 0x7a, 0xa7, 0xa0</Guid>
+    </Entry>
+    <Entry Name="ConsoleControl">
+      <C_Name>gEfiConsoleControlProtocolGuid</C_Name>
+      <Guid>0xf42f7782, 0x12e, 0x4c12, 0x99, 0x56, 0x49, 0xf9, 0x43, 0x04, 0xf7, 0x21</Guid>
+    </Entry>
+    <Entry Name="OEMBadging">
+      <C_Name>gEfiOEMBadgingProtocolGuid</C_Name>
+      <Guid>0x170e13c0, 0xbf1b, 0x4218, 0x87, 0x1d, 0x2a, 0xbd, 0xc6, 0xf8, 0x87, 0xbc</Guid>
+    </Entry>
+    <Entry Name="UgaSplash">
+      <C_Name>gEfiUgaSplashProtocolGuid</C_Name>
+      <Guid>0xa45b3a0d, 0x2e55, 0x4c03, 0xad, 0x9c, 0x27, 0xd4, 0x82, 0x0b, 0x50, 0x7e</Guid>
+    </Entry>
+    <Entry Name="AcpiS3Save">
+      <C_Name>gEfiAcpiS3SaveProtocolGuid</C_Name>
+      <Guid>0x125f2de1, 0xfb85, 0x440c, 0xa5, 0x4c, 0x4d, 0x99, 0x35, 0x8a, 0x8d, 0x38</Guid>
+    </Entry>
+    <Entry Name="Performance">
+      <C_Name>gEfiPerformanceProtocolGuid</C_Name>
+      <Guid>0xFFECFFFF, 0x923C, 0x14d2, 0x9E, 0x3F, 0x22, 0xA0, 0xC9, 0x69, 0x56, 0x3B</Guid>
+    </Entry>
+    <Entry Name="PxeDhcp4">
+      <C_Name>gEfiPxeDhcp4ProtocolGuid</C_Name>
+      <Guid>0x03c4e624, 0xac28, 0x11d3, 0x9a, 0x2d, 0x00, 0x90, 0x29, 0x3f, 0xc1, 0x4d</Guid>
+    </Entry>
+    <Entry Name="PxeDhcp4Callback">
+      <C_Name>gEfiPxeDhcp4CallbackProtocolGuid</C_Name>
+      <Guid>0xc1544c01, 0x92a4, 0x4198, 0x8a, 0x84, 0x77, 0x85, 0x83, 0xc2, 0x36, 0x21</Guid>
+    </Entry>
+    <Entry Name="UgaIo">
+      <C_Name>gEfiUgaIoProtocolGuid</C_Name>
+      <Guid>0x61a4d49e, 0x6f68, 0x4f1b, 0xb9, 0x22, 0xa8, 0x6e, 0xed, 0x0b, 0x07, 0xa2</Guid>
+    </Entry>
+    <Entry Name="DebugAssert">
+      <C_Name>gEfiDebugAssertProtocolGuid</C_Name>
+      <Guid>0xbe499c92, 0x7d4b, 0x11d4, 0xbc, 0xee, 0x00, 0x80, 0xc7, 0x3c, 0x88, 0x81</Guid>
+    </Entry>
+    <Entry Name="UsbAtapi">
+      <C_Name>gEfiUsbAtapiProtocolGuid</C_Name>
+      <Guid>0x2B2F68DA, 0x0CD2, 0x44cf, 0x8E, 0x8B, 0xBB, 0xA2, 0x0B, 0x1B, 0x5B, 0x75</Guid>
+    </Entry>
+    <Entry Name="PciHotPlugRequest">
+      <C_Name>gEfiPciHotPlugRequestProtocolGuid</C_Name>
+      <Guid>0x19cb87ab, 0x2cb9, 0x4665, 0x83, 0x60, 0xdd, 0xcf, 0x60, 0x54, 0xf7, 0x9d</Guid>
+    </Entry>
+    <Entry Name="ExtendedSalBootService">
+      <C_Name>gEfiExtendedSalBootServiceProtocolGuid</C_Name>
+      <Guid>0xde0ee9a4, 0x3c7a, 0x44f2, 0xb7, 0x8b, 0xe3, 0xcc, 0xd6, 0x9c, 0x3a, 0xf7</Guid>
+    </Entry>
+    <Entry Name="ExtendedSalVariableServices">
+      <C_Name>gEfiExtendedSalVariableServicesProtocolGuid</C_Name>
+      <Guid>0x4ecb6c53, 0xc641, 0x4370, 0x8c, 0xb2, 0x3b, 0x0e, 0x49, 0x6e, 0x83, 0x78</Guid>
+    </Entry>
+    <Entry Name="ExtendedSalStatusCodeServices">
+      <C_Name>gEfiExtendedSalStatusCodeServicesProtocolGuid</C_Name>
+      <Guid>0x00dbd91d, 0x55e9, 0x420f, 0x96, 0x39, 0x5e, 0x9f, 0x84, 0x37, 0xb4, 0x4f</Guid>
+    </Entry>
+    <Entry Name="IsaIo">
+      <C_Name>gEfiIsaIoProtocolGuid</C_Name>
+      <Guid>0x7ee2bd44, 0x3da0, 0x11d4, 0x9a, 0x38, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d</Guid>
+    </Entry>
+    <Entry Name="IsaAcpi">
+      <C_Name>gEfiIsaAcpiProtocolGuid</C_Name>
+      <Guid>0x64a892dc, 0x5561, 0x4536, 0x92, 0xc7, 0x79, 0x9b, 0xfc, 0x18, 0x33, 0x55</Guid>
+    </Entry>
+    <Entry Name="Performance">
+      <C_Name>gPerformanceProtocolGuid</C_Name>
+      <Guid>0x76b6bdfa, 0x2acd, 0x4462, 0x9E, 0x3F, 0xcb, 0x58, 0xC9, 0x69, 0xd9, 0x37</Guid>
+    </Entry>
+  </ProtocolDeclarations>
+  <PpiDeclarations>
+    <Entry Name="PeiInMemory">
+      <C_Name>gPeiInMemoryGuid</C_Name>
+      <Guid>0x643b8786, 0xb417, 0x48d2, 0x8f, 0x5e, 0x78, 0x19, 0x93, 0x1c, 0xae, 0xd8</Guid>
+    </Entry>
+    <Entry Name="FlashMap">
+      <C_Name>gPeiFlashMapPpiGuid</C_Name>
+      <Guid>0xf34c2fa0, 0xde88, 0x4270, 0x84, 0x14, 0x96, 0x12, 0x22, 0xf4, 0x52, 0x1c</Guid>
+    </Entry>
+    <Entry Name="BaseMemoryTest">
+      <C_Name>gPeiBaseMemoryTestPpiGuid</C_Name>
+      <Guid>0xb6ec423c, 0x21d2, 0x490d, 0x85, 0xc6, 0xdd, 0x58, 0x64, 0xea, 0xa6, 0x74</Guid>
+    </Entry>
+    <Entry Name="StatusCodeMemory">
+      <C_Name>gPeiStatusCodeMemoryPpiGuid</C_Name>
+      <Guid>0x26f8ab01, 0xd3cd, 0x489c, 0x98, 0x4f, 0xdf, 0xde, 0xf7, 0x68, 0x39, 0x5b</Guid>
+    </Entry>
+  </PpiDeclarations>
+  <PcdDefinitions>
+    <PcdEntry ItemType="FIXED_AT_BUILD">
+      <C_Name>PcdMaximumUnicodeStringLength</C_Name>
+      <Token>0x00000001</Token>
+      <DatumType>UINT32</DatumType>
+      <DefaultValue>1000000</DefaultValue>
+    </PcdEntry>
+    <PcdEntry ItemType="FIXED_AT_BUILD">
+      <C_Name>PcdMaximumAsciiStringLength</C_Name>
+      <Token>0x00000002</Token>
+      <DatumType>UINT32</DatumType>
+      <DefaultValue>1000000</DefaultValue>
+    </PcdEntry>
+    <PcdEntry ItemType="FIXED_AT_BUILD">
+      <C_Name>PcdMaximumLinkedListLength</C_Name>
+      <Token>0x00000003</Token>
+      <DatumType>UINT32</DatumType>
+      <DefaultValue>1000000</DefaultValue>
+    </PcdEntry>
+    <PcdEntry ItemType="FIXED_AT_BUILD">
+      <C_Name>PcdSpinLockTimeout</C_Name>
+      <Token>0x00000004</Token>
+      <DatumType>UINT32</DatumType>
+      <DefaultValue>10000000</DefaultValue>
+    </PcdEntry>
+    <PcdEntry ItemType="FIXED_AT_BUILD">
+      <C_Name>PcdDebugPropertyMask</C_Name>
+      <Token>0x00000005</Token>
+      <DatumType>UINT8</DatumType>
+      <DefaultValue>0x0f</DefaultValue>
+    </PcdEntry>
+    <PcdEntry ItemType="PATCHABLE_IN_MODULE">
+      <C_Name>PcdDebugPrintErrorLevel</C_Name>
+      <Token>0x00000006</Token>
+      <DatumType>UINT32</DatumType>
+      <DefaultValue>0x80000000</DefaultValue>
+    </PcdEntry>
+    <PcdEntry ItemType="FIXED_AT_BUILD">
+      <C_Name>PcdReportStatusCodePropertyMask</C_Name>
+      <Token>0x00000007</Token>
+      <DatumType>UINT8</DatumType>
+      <DefaultValue>0x07</DefaultValue>
+    </PcdEntry>
+    <PcdEntry ItemType="FIXED_AT_BUILD">
+      <C_Name>PcdDebugClearMemoryValue</C_Name>
+      <Token>0x00000008</Token>
+      <DatumType>UINT8</DatumType>
+      <DefaultValue>0xAF</DefaultValue>
+    </PcdEntry>
+    <PcdEntry ItemType="FIXED_AT_BUILD">
+      <C_Name>PcdDebugClearMemoryValue</C_Name>
+      <Token>0x00000008</Token>
+      <DatumType>UINT8</DatumType>
+      <DefaultValue>0xAF</DefaultValue>
+    </PcdEntry>    
+    <PcdEntry ItemType="FIXED_AT_BUILD">
+      <C_Name>PcdPerformanceLibraryPropertyMask</C_Name>
+      <Token>0x00000009</Token>
+      <DatumType>UINT8</DatumType>
+      <DefaultValue>0</DefaultValue>
+    </PcdEntry>
+  </PcdDefinitions>
+</PackageSurfaceArea>
index 923914aee9f10e814ba0b6c0f7a6f43aa05f35d6..f4030f4f9e975f25c8728b44544bc539b9003c1d 100644 (file)
@@ -1,55 +1,55 @@
-<?xml version="1.0" encoding="UTF-8"?>\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
-<ModuleBuildDescription xmlns="http://www.TianoCore.org/2006/Edk2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.TianoCore.org/2006/Edk2.0  http://www.TianoCore.org/2006/Edk2.0/SurfaceArea.xsd">\r
-  <MbdHeader>\r
-    <BaseName>StatusCode</BaseName>\r
-    <Guid>9F455D3B-2B8A-4c06-960B-A71B9714B9CD</Guid>\r
-    <Version>0</Version>\r
-    <Description>FIX ME!</Description>\r
-    <Copyright>Copyright (c) 2004-2006, Intel Corporation</Copyright>\r
-    <License>\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
-      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
-    </License>\r
-    <Created>2006-03-12 17:09</Created>\r
-    <Modified>2006-03-19 15:19</Modified>\r
-  </MbdHeader>\r
-  <Libraries>\r
-    <Library>UefiBootServicesTableLib</Library>\r
-    <Library>BaseLib</Library>\r
-    <Library>EdkDxeRuntimeDriverLib</Library>\r
-    <Library>UefiDriverEntryPoint</Library>\r
-    <Library>UefiLib</Library>\r
-    <Library>BasePrintLib</Library>\r
-    <Library>BaseDebugLibReportStatusCode</Library>\r
-    <Library>EdkRtPlatformStatusCodeLib</Library>\r
-    <Library>DxeIoLibCpuIo</Library>\r
-    <Library>BaseMemoryLib</Library>\r
-    <Library>DxeReportStatusCodeLib</Library>\r
-    <Library>EdkRtMemoryStatusCodeLib</Library>\r
-    <Library>EdkBsDataHubStatusCodeLib</Library>\r
-    <Library>DxeHobLib</Library>\r
-    <Library>DxeMemoryAllocationLib</Library>\r
-    <Library>EdkMemoryStatusCodeLib</Library>\r
-    \r
-    <Arch ArchType="IPF">\r
-      <Library>EdkDxeSalLib</Library>\r
-    </Arch>\r
-  </Libraries>\r
-  <BuildOptions ToolChain="MSFT">\r
-    <ImageEntryPoint>_ModuleEntryPoint</ImageEntryPoint>\r
-  </BuildOptions>\r
-</ModuleBuildDescription>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Copyright (c) 2006, Intel Corporation
+All rights reserved. This program and the accompanying materials
+are licensed and made available under the terms and conditions of the BSD License
+which accompanies this distribution.  The full text of the license may be found at
+http://opensource.org/licenses/bsd-license.php
+
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+-->
+<ModuleBuildDescription xmlns="http://www.TianoCore.org/2006/Edk2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.TianoCore.org/2006/Edk2.0  http://www.TianoCore.org/2006/Edk2.0/SurfaceArea.xsd">
+  <MbdHeader>
+    <BaseName>StatusCode</BaseName>
+    <Guid>9F455D3B-2B8A-4c06-960B-A71B9714B9CD</Guid>
+    <Version>0</Version>
+    <Description>FIX ME!</Description>
+    <Copyright>Copyright (c) 2004-2006, Intel Corporation</Copyright>
+    <License>
+      All rights reserved. This program and the accompanying materials
+      are licensed and made available under the terms and conditions of the BSD License
+      which accompanies this distribution.  The full text of the license may be found at
+      http://opensource.org/licenses/bsd-license.php
+      THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+      WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+    </License>
+    <Created>2006-03-12 17:09</Created>
+    <Modified>2006-03-19 15:19</Modified>
+  </MbdHeader>
+  <Libraries>
+    <Library>UefiBootServicesTableLib</Library>
+    <Library>BaseLib</Library>
+    <Library>EdkDxeRuntimeDriverLib</Library>
+    <Library>UefiDriverEntryPoint</Library>
+    <Library>UefiLib</Library>
+    <Library>BasePrintLib</Library>
+    <Library>BaseDebugLibReportStatusCode</Library>
+    <Library>DxeIoLibCpuIo</Library>
+    <Library>BaseMemoryLib</Library>
+    <Library>DxeReportStatusCodeLib</Library>
+    <Library OverrideID="1111">EdkRtPlatformStatusCodeLib</Library>
+    <Library OverrideID="1111">EdkRtMemoryStatusCodeLib</Library>
+    <Library OverrideID="1111">EdkBsDataHubStatusCodeLib</Library>
+    <Library>DxeHobLib</Library>
+    <Library>DxeMemoryAllocationLib</Library>
+    <Library>EdkMemoryStatusCodeLib</Library>
+    
+    <Arch ArchType="IPF">
+      <Library>EdkDxeSalLib</Library>
+    </Arch>
+  </Libraries>
+  <BuildOptions ToolChain="MSFT">
+    <ImageEntryPoint>_ModuleEntryPoint</ImageEntryPoint>
+  </BuildOptions>
+</ModuleBuildDescription>
index 036758dc62ada58e93e883086b210d12237efdfb..df87f466dea93c6cb70a64cb89d7acf06d0ed24b 100644 (file)
@@ -1,43 +1,43 @@
-<?xml version="1.0" encoding="UTF-8"?>\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
-<ModuleBuildDescription xmlns="http://www.TianoCore.org/2006/Edk2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.TianoCore.org/2006/Edk2.0  http://www.TianoCore.org/2006/Edk2.0/SurfaceArea.xsd">\r
-  <MbdHeader>\r
-    <BaseName>PeiVariable</BaseName>\r
-    <Guid>34C8C28F-B61C-45a2-8F2E-89E46BECC63B</Guid>\r
-    <Version>0</Version>\r
-    <Description>FIX ME!</Description>\r
-    <Copyright>Copyright (c) 2004-2006, Intel Corporation</Copyright>\r
-    <License>\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
-      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
-    </License>\r
-    <Created>2006-03-12 17:09</Created>\r
-    <Modified>2006-03-19 15:19</Modified>\r
-  </MbdHeader>\r
-  <Libraries>\r
-    <Library>PeiReportStatusCodeLib</Library>\r
-    <Library>BaseDebugLibReportStatusCode</Library>\r
-    <Library>BaseLib</Library>\r
-    <Library>PeiMemoryLib</Library>\r
-    <Library>PeiCoreLib</Library>\r
-    <Library>PeiServicesTablePointerLib</Library>\r
-    <Library>PeiHobLib</Library>\r
-    <Library>PeimEntryPoint</Library>\r
-  </Libraries>\r
-  <BuildOptions ToolChain="MSFT">\r
-    <ImageEntryPoint>_ModuleEntryPoint</ImageEntryPoint>\r
-  </BuildOptions>\r
-</ModuleBuildDescription>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Copyright (c) 2006, Intel Corporation
+All rights reserved. This program and the accompanying materials
+are licensed and made available under the terms and conditions of the BSD License
+which accompanies this distribution.  The full text of the license may be found at
+http://opensource.org/licenses/bsd-license.php
+
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+-->
+<ModuleBuildDescription xmlns="http://www.TianoCore.org/2006/Edk2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.TianoCore.org/2006/Edk2.0  http://www.TianoCore.org/2006/Edk2.0/SurfaceArea.xsd">
+  <MbdHeader>
+    <BaseName>PeiVariable</BaseName>
+    <Guid>34C8C28F-B61C-45a2-8F2E-89E46BECC63B</Guid>
+    <Version>0</Version>
+    <Description>FIX ME!</Description>
+    <Copyright>Copyright (c) 2004-2006, Intel Corporation</Copyright>
+    <License>
+      All rights reserved. This program and the accompanying materials
+      are licensed and made available under the terms and conditions of the BSD License
+      which accompanies this distribution.  The full text of the license may be found at
+      http://opensource.org/licenses/bsd-license.php
+      THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+      WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+    </License>
+    <Created>2006-03-12 17:09</Created>
+    <Modified>2006-03-19 15:19</Modified>
+  </MbdHeader>
+  <Libraries>
+    <Library>PeiReportStatusCodeLib</Library>
+    <Library>BaseDebugLibReportStatusCode</Library>
+    <Library>BaseLib</Library>
+    <Library>PeiMemoryLib</Library>
+    <Library>PeiCoreLib</Library>
+    <Library OverrideID="4444">PeiServicesTablePointerLib</Library>
+    <Library>PeiHobLib</Library>
+    <Library>PeimEntryPoint</Library>
+  </Libraries>
+  <BuildOptions ToolChain="MSFT">
+    <ImageEntryPoint>_ModuleEntryPoint</ImageEntryPoint>
+  </BuildOptions>
+</ModuleBuildDescription>