summaryrefslogtreecommitdiff
path: root/EdkNt32Pkg/Pei/FirmwareVolume
diff options
context:
space:
mode:
authorbbahnsen <bbahnsen@6f19259b-4bc3-4df7-8a09-765794883524>2006-04-21 22:54:32 +0000
committerbbahnsen <bbahnsen@6f19259b-4bc3-4df7-8a09-765794883524>2006-04-21 22:54:32 +0000
commit878ddf1fc3540a715f63594ed22b6929e881afb4 (patch)
treec56c44dac138137b510e1fba7c3efe5e4d84bea2 /EdkNt32Pkg/Pei/FirmwareVolume
downloadedk2-878ddf1fc3540a715f63594ed22b6929e881afb4.zip
edk2-878ddf1fc3540a715f63594ed22b6929e881afb4.tar.gz
edk2-878ddf1fc3540a715f63594ed22b6929e881afb4.tar.bz2
Initial import.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@3 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'EdkNt32Pkg/Pei/FirmwareVolume')
-rw-r--r--EdkNt32Pkg/Pei/FirmwareVolume/WinNtFwh.dxs29
-rw-r--r--EdkNt32Pkg/Pei/FirmwareVolume/WinNtFwh.mbd43
-rw-r--r--EdkNt32Pkg/Pei/FirmwareVolume/WinNtFwh.msa69
-rw-r--r--EdkNt32Pkg/Pei/FirmwareVolume/WinntFwh.c123
-rw-r--r--EdkNt32Pkg/Pei/FirmwareVolume/build.xml47
5 files changed, 311 insertions, 0 deletions
diff --git a/EdkNt32Pkg/Pei/FirmwareVolume/WinNtFwh.dxs b/EdkNt32Pkg/Pei/FirmwareVolume/WinNtFwh.dxs
new file mode 100644
index 0000000..6270ef0
--- /dev/null
+++ b/EdkNt32Pkg/Pei/FirmwareVolume/WinNtFwh.dxs
@@ -0,0 +1,29 @@
+/*++
+
+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:
+
+ WinNtFwh.dxs
+
+Abstract:
+
+ Dependency expression file for WinNtFwh PEIM.
+
+--*/
+
+#include <AutoGen.h>
+#include <PeimDepex.h>
+
+DEPENDENCY_START
+ NT_FWH_PPI_GUID AND EFI_PEI_PERMANENT_MEMORY_INSTALLED_PPI_GUID
+DEPENDENCY_END
+
+
diff --git a/EdkNt32Pkg/Pei/FirmwareVolume/WinNtFwh.mbd b/EdkNt32Pkg/Pei/FirmwareVolume/WinNtFwh.mbd
new file mode 100644
index 0000000..3c61664
--- /dev/null
+++ b/EdkNt32Pkg/Pei/FirmwareVolume/WinNtFwh.mbd
@@ -0,0 +1,43 @@
+<?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>WinNtFwh</BaseName>
+ <Guid>F0384FFD-8633-452f-9010-F6B7D2EAE2F1</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-14 17:04</Created>
+ <Modified>2006-03-23 10:33</Modified>
+ </MbdHeader>
+ <Libraries>
+ <Library>PeimEntryPoint</Library>
+ <Library>PeiMemoryLib</Library>
+ <Library>PeiCoreLib</Library>
+ <Library>PeiServicesTablePointerLib</Library>
+ <Library>PeiHobLib</Library>
+ <Library>PeiReportStatusCodeLib</Library>
+ <Library>BaseDebugLibReportStatusCode</Library>
+ <Library>BaseLib</Library>
+ </Libraries>
+ <BuildOptions ToolChain="MSFT">
+ <ImageEntryPoint>_ModuleEntryPoint</ImageEntryPoint>
+ </BuildOptions>
+</ModuleBuildDescription>
diff --git a/EdkNt32Pkg/Pei/FirmwareVolume/WinNtFwh.msa b/EdkNt32Pkg/Pei/FirmwareVolume/WinNtFwh.msa
new file mode 100644
index 0000000..3101d48
--- /dev/null
+++ b/EdkNt32Pkg/Pei/FirmwareVolume/WinNtFwh.msa
@@ -0,0 +1,69 @@
+<?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>WinNtFwh</BaseName>
+ <ModuleType>PEIM</ModuleType>
+ <ComponentType>PE32_PEIM</ComponentType>
+ <Guid>F0384FFD-8633-452f-9010-F6B7D2EAE2F1</Guid>
+ <Version>0</Version>
+ <Abstract>Component description file for WinNtFwh module</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-14 17:04</Created>
+ <Updated>2006-03-23 10:33</Updated>
+ </MsaHeader>
+ <LibraryClassDefinitions>
+ <LibraryClass Usage="ALWAYS_CONSUMED">DebugLib</LibraryClass>
+ <LibraryClass Usage="ALWAYS_CONSUMED">PeimEntryPoint</LibraryClass>
+ <LibraryClass Usage="ALWAYS_CONSUMED">HobLib</LibraryClass>
+ <LibraryClass Usage="ALWAYS_CONSUMED">PeiCoreLib</LibraryClass>
+ <LibraryClass Usage="ALWAYS_CONSUMED">PeiServicesTablePointerLib</LibraryClass>
+ </LibraryClassDefinitions>
+ <SourceFiles>
+ <Filename>WinNtFwh.c</Filename>
+ <Filename>WinNtFwh.dxs</Filename>
+ </SourceFiles>
+ <Includes>
+ <PackageName>MdePkg</PackageName>
+ <PackageName>EdkModulePkg</PackageName>
+ <PackageName>EdkNt32Pkg</PackageName>
+ </Includes>
+ <Hobs>
+ <Hob Usage="ALWAYS_PRODUCED" HobType="FIRMWARE_VOLUME">
+ <Name>FvRecovery.fv</Name>
+ </Hob>
+ <Hob Usage="ALWAYS_PRODUCED" HobType="RESOURCE_DESCRIPTOR">
+ <Name>EFI_RESOURCE_FIRMWARE_DEVICE</Name>
+ </Hob>
+ <Hob Usage="ALWAYS_PRODUCED" HobType="FIRMWARE_VOLUME">
+ <Name>NVSTORAGE.fv</Name>
+ </Hob>
+ </Hobs>
+ <PPIs>
+ <Ppi Usage="ALWAYS_CONSUMED">NtFwh</Ppi>
+ </PPIs>
+ <Externs>
+ <Extern>
+ <ModuleEntryPoint>PeimInitializeWinNtFwh</ModuleEntryPoint>
+ </Extern>
+ </Externs>
+</ModuleSurfaceArea>
diff --git a/EdkNt32Pkg/Pei/FirmwareVolume/WinntFwh.c b/EdkNt32Pkg/Pei/FirmwareVolume/WinntFwh.c
new file mode 100644
index 0000000..3764cb7
--- /dev/null
+++ b/EdkNt32Pkg/Pei/FirmwareVolume/WinntFwh.c
@@ -0,0 +1,123 @@
+/*++
+
+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:
+ WinNtFwh.c
+
+Abstract:
+ PEIM to abstract construction of firmware volume in a Windows NT environment.
+
+Revision History
+
+--*/
+
+
+#include <FlashLayout.h>
+
+
+EFI_STATUS
+EFIAPI
+PeimInitializeWinNtFwh (
+ IN EFI_FFS_FILE_HEADER *FfsHeader,
+ IN EFI_PEI_SERVICES **PeiServices
+ )
+/*++
+
+Routine Description:
+ Perform a call-back into the SEC simulator to get address of the Firmware Hub
+
+Arguments:
+ FfsHeader - Ffs Header availible to every PEIM
+ PeiServices - General purpose services available to every PEIM.
+
+Returns:
+ None
+
+--*/
+{
+ EFI_STATUS Status;
+ EFI_PEI_PPI_DESCRIPTOR *PpiDescriptor;
+ NT_FWH_PPI *FwhPpi;
+ EFI_PHYSICAL_ADDRESS FdBase;
+ EFI_FIRMWARE_VOLUME_HEADER *FvHeader;
+ UINT64 FdSize;
+ UINTN Index;
+
+ DEBUG ((EFI_D_ERROR, "NT 32 Firmware Volume PEIM Loaded\n"));
+
+ //
+ // Get the Fwh Information PPI
+ //
+ Status = (**PeiServices).LocatePpi (
+ PeiServices,
+ &gNtFwhPpiGuid, // GUID
+ 0, // INSTANCE
+ &PpiDescriptor, // EFI_PEI_PPI_DESCRIPTOR
+ &FwhPpi // PPI
+ );
+ ASSERT_EFI_ERROR (Status);
+
+ Index = 0;
+ do {
+ //
+ // Get information about all the FD's in the system
+ //
+ Status = FwhPpi->NtFwh (Index, &FdBase, &FdSize);
+ if (!EFI_ERROR (Status)) {
+ //
+ // Assume the FD starts with an FV header
+ //
+ FvHeader = (EFI_FIRMWARE_VOLUME_HEADER *) (UINTN) FdBase;
+
+ //
+ // Make an FV Hob for the first FV in the FD
+ //
+ BuildFvHob (FdBase, FvHeader->FvLength);
+
+ if (Index == 0) {
+ //
+ // Assume the first FD was produced by the NT32.DSC
+ // All these strange offests are needed to keep in
+ // sync with the FlashMap and NT32.dsc file
+ //
+ BuildResourceDescriptorHob (
+ EFI_RESOURCE_FIRMWARE_DEVICE,
+ (EFI_RESOURCE_ATTRIBUTE_PRESENT | EFI_RESOURCE_ATTRIBUTE_INITIALIZED | EFI_RESOURCE_ATTRIBUTE_UNCACHEABLE),
+ FdBase,
+ (FvHeader->FvLength + EFI_WINNT_RUNTIME_UPDATABLE_LENGTH + EFI_WINNT_FTW_SPARE_BLOCK_LENGTH)
+ );
+
+ //
+ // Hard code the address of the spare block and variable services.
+ // Assume it's a hard coded offset from FV0 in FD0.
+ //
+ FdBase = FdBase + EFI_WINNT_RUNTIME_UPDATABLE_OFFSET;
+ FdSize = EFI_WINNT_RUNTIME_UPDATABLE_LENGTH + EFI_WINNT_FTW_SPARE_BLOCK_LENGTH;
+
+ BuildFvHob (FdBase, FdSize);
+ } else {
+ //
+ // For other FD's just map them in.
+ //
+ BuildResourceDescriptorHob (
+ EFI_RESOURCE_FIRMWARE_DEVICE,
+ (EFI_RESOURCE_ATTRIBUTE_PRESENT | EFI_RESOURCE_ATTRIBUTE_INITIALIZED | EFI_RESOURCE_ATTRIBUTE_UNCACHEABLE),
+ FdBase,
+ FdSize
+ );
+ }
+ }
+
+ Index++;
+ } while (!EFI_ERROR (Status));
+
+ return Status;
+}
diff --git a/EdkNt32Pkg/Pei/FirmwareVolume/build.xml b/EdkNt32Pkg/Pei/FirmwareVolume/build.xml
new file mode 100644
index 0000000..7aa147b
--- /dev/null
+++ b/EdkNt32Pkg/Pei/FirmwareVolume/build.xml
@@ -0,0 +1,47 @@
+<?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="WinNtFwh"><!--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="Pei\FirmwareVolume"/>
+ <property name="MODULE_DIR" value="${PACKAGE_DIR}\${MODULE_RELATIVE_PATH}"/>
+ <property name="COMMON_FILE" value="${WORKSPACE_DIR}\Tools\Conf\Common.xml"/>
+ <target name="WinNtFwh">
+ <GenBuild baseName="WinNtFwh" mbdFilename="${MODULE_DIR}\WinNtFwh.mbd" msaFilename="${MODULE_DIR}\WinNtFwh.msa"/>
+ </target>
+ <target depends="WinNtFwh_clean" name="clean"/>
+ <target depends="WinNtFwh_cleanall" name="cleanall"/>
+ <target name="WinNtFwh_clean">
+ <OutputDirSetup baseName="WinNtFwh" mbdFilename="${MODULE_DIR}\WinNtFwh.mbd" msaFilename="${MODULE_DIR}\WinNtFwh.msa"/>
+ <if>
+ <available file="${DEST_DIR_OUTPUT}\WinNtFwh_build.xml"/>
+ <then>
+ <ant antfile="${DEST_DIR_OUTPUT}\WinNtFwh_build.xml" target="clean"/>
+ </then>
+ </if>
+ <delete dir="${DEST_DIR_OUTPUT}" excludes="*.xml"/>
+ </target>
+ <target name="WinNtFwh_cleanall">
+ <OutputDirSetup baseName="WinNtFwh" mbdFilename="${MODULE_DIR}\WinNtFwh.mbd" msaFilename="${MODULE_DIR}\WinNtFwh.msa"/>
+ <if>
+ <available file="${DEST_DIR_OUTPUT}\WinNtFwh_build.xml"/>
+ <then>
+ <ant antfile="${DEST_DIR_OUTPUT}\WinNtFwh_build.xml" target="cleanall"/>
+ </then>
+ </if>
+ <delete dir="${DEST_DIR_OUTPUT}"/>
+ <delete dir="${DEST_DIR_DEBUG}"/>
+ <delete>
+ <fileset dir="${BIN_DIR}" includes="**WinNtFwh*"/>
+ </delete>
+ </target>
+</project> \ No newline at end of file