summaryrefslogtreecommitdiffstats
path: root/EdkNt32Pkg/Pei/Autoscan
diff options
context:
space:
mode:
Diffstat (limited to 'EdkNt32Pkg/Pei/Autoscan')
-rw-r--r--EdkNt32Pkg/Pei/Autoscan/WinNtAutoScan.mbd43
-rw-r--r--EdkNt32Pkg/Pei/Autoscan/WinNtAutoScan.msa68
-rw-r--r--EdkNt32Pkg/Pei/Autoscan/WinNtAutoscan.dxs29
-rw-r--r--EdkNt32Pkg/Pei/Autoscan/WinntAutoscan.c132
-rw-r--r--EdkNt32Pkg/Pei/Autoscan/build.xml47
5 files changed, 319 insertions, 0 deletions
diff --git a/EdkNt32Pkg/Pei/Autoscan/WinNtAutoScan.mbd b/EdkNt32Pkg/Pei/Autoscan/WinNtAutoScan.mbd
new file mode 100644
index 0000000000..c6a123ddf9
--- /dev/null
+++ b/EdkNt32Pkg/Pei/Autoscan/WinNtAutoScan.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>WinNtAutoScan</BaseName>
+ <Guid>BE0FEABA-3443-4919-9F3A-2D4216329EA9</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-19 15:17</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/Autoscan/WinNtAutoScan.msa b/EdkNt32Pkg/Pei/Autoscan/WinNtAutoScan.msa
new file mode 100644
index 0000000000..5141634516
--- /dev/null
+++ b/EdkNt32Pkg/Pei/Autoscan/WinNtAutoScan.msa
@@ -0,0 +1,68 @@
+<?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>WinNtAutoScan</BaseName>
+ <ModuleType>PEIM</ModuleType>
+ <ComponentType>PE32_PEIM</ComponentType>
+ <Guid>BE0FEABA-3443-4919-9F3A-2D4216329EA9</Guid>
+ <Version>0</Version>
+ <Abstract>Component description file for WinNtAutoScan 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-19 15:17</Updated>
+ </MsaHeader>
+ <LibraryClassDefinitions>
+ <LibraryClass Usage="ALWAYS_CONSUMED">DebugLib</LibraryClass>
+ <LibraryClass Usage="ALWAYS_CONSUMED">PeimEntryPoint</LibraryClass>
+ <LibraryClass Usage="ALWAYS_CONSUMED">BaseLib</LibraryClass>
+ <LibraryClass Usage="ALWAYS_CONSUMED">BaseMemoryLib</LibraryClass>
+ <LibraryClass Usage="ALWAYS_CONSUMED">HobLib</LibraryClass>
+ <LibraryClass Usage="ALWAYS_CONSUMED">PeiCoreLib</LibraryClass>
+ <LibraryClass Usage="ALWAYS_CONSUMED">PeiServicesTablePointerLib</LibraryClass>
+ </LibraryClassDefinitions>
+ <SourceFiles>
+ <Filename>WinNtAutoScan.c</Filename>
+ <Filename>WinNtAutoscan.dxs</Filename>
+ </SourceFiles>
+ <Includes>
+ <PackageName>MdePkg</PackageName>
+ <PackageName>EdkModulePkg</PackageName>
+ <PackageName>EdkNt32Pkg</PackageName>
+ </Includes>
+ <Hobs>
+ <Hob Usage="ALWAYS_PRODUCED" HobType="RESOURCE_DESCRIPTOR">
+ <Name>EFI_RESOURCE_SYSTEM_MEMORY</Name>
+ </Hob>
+ <Hob Usage="ALWAYS_PRODUCED" HobType="CPU"></Hob>
+ </Hobs>
+ <PPIs>
+ <Ppi Usage="ALWAYS_CONSUMED">NtAutoScan</Ppi>
+ <Ppi Usage="ALWAYS_CONSUMED">BaseMemoryTest</Ppi>
+ <Ppi Usage="ALWAYS_PRODUCED">MemoryDiscovered</Ppi>
+ </PPIs>
+ <Externs>
+ <Extern>
+ <ModuleEntryPoint>PeimInitializeWinNtAutoScan</ModuleEntryPoint>
+ </Extern>
+ </Externs>
+</ModuleSurfaceArea>
diff --git a/EdkNt32Pkg/Pei/Autoscan/WinNtAutoscan.dxs b/EdkNt32Pkg/Pei/Autoscan/WinNtAutoscan.dxs
new file mode 100644
index 0000000000..5b3af0e337
--- /dev/null
+++ b/EdkNt32Pkg/Pei/Autoscan/WinNtAutoscan.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:
+
+ WinNtAutoscan.dxs
+
+Abstract:
+
+ Dependency expression file for WinNtAutoscan.
+
+--*/
+
+#include <AutoGen.h>
+#include <PeimDepex.h>
+
+DEPENDENCY_START
+ PEI_NT_AUTOSCAN_PPI_GUID AND EFI_PEI_MASTER_BOOT_MODE_PEIM_PPI AND PEI_BASE_MEMORY_TEST_GUID
+DEPENDENCY_END
+
+
diff --git a/EdkNt32Pkg/Pei/Autoscan/WinntAutoscan.c b/EdkNt32Pkg/Pei/Autoscan/WinntAutoscan.c
new file mode 100644
index 0000000000..c465ce68ca
--- /dev/null
+++ b/EdkNt32Pkg/Pei/Autoscan/WinntAutoscan.c
@@ -0,0 +1,132 @@
+/*++
+
+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:
+ WinNtAutoscan.c
+
+Abstract:
+ Tiano PEIM to abstract memory auto-scan in a Windows NT environment.
+
+Revision History
+
+--*/
+
+EFI_STATUS
+EFIAPI
+PeimInitializeWinNtAutoScan (
+ IN EFI_FFS_FILE_HEADER *FfsHeader,
+ IN EFI_PEI_SERVICES **PeiServices
+ )
+/*++
+
+Routine Description:
+ Perform a call-back into the SEC simulator to get a memory value
+
+Arguments:
+ FfsHeader - General purpose data available to every PEIM
+ PeiServices - General purpose services available to every PEIM.
+
+Returns:
+ None
+
+--*/
+{
+ EFI_STATUS Status;
+ EFI_PEI_PPI_DESCRIPTOR *PpiDescriptor;
+ PEI_NT_AUTOSCAN_PPI *PeiNtService;
+ UINT64 MemorySize;
+ EFI_PHYSICAL_ADDRESS MemoryBase;
+ PEI_BASE_MEMORY_TEST_PPI *MemoryTestPpi;
+ EFI_PHYSICAL_ADDRESS ErrorAddress;
+ UINTN Index;
+ EFI_RESOURCE_ATTRIBUTE_TYPE Attributes;
+
+
+ DEBUG ((EFI_D_ERROR, "NT 32 Autoscan PEIM Loaded\n"));
+
+ //
+ // Get the PEI NT Autoscan PPI
+ //
+ Status = (**PeiServices).LocatePpi (
+ PeiServices,
+ &gPeiNtAutoScanPpiGuid, // GUID
+ 0, // INSTANCE
+ &PpiDescriptor, // EFI_PEI_PPI_DESCRIPTOR
+ &PeiNtService // PPI
+ );
+ ASSERT_EFI_ERROR (Status);
+
+ //
+ // Get the Memory Test PPI
+ //
+ Status = (**PeiServices).LocatePpi (
+ PeiServices,
+ &gPeiBaseMemoryTestPpiGuid,
+ 0,
+ NULL,
+ &MemoryTestPpi
+ );
+ ASSERT_EFI_ERROR (Status);
+
+ Index = 0;
+ do {
+ Status = PeiNtService->NtAutoScan (Index, &MemoryBase, &MemorySize);
+ if (!EFI_ERROR (Status)) {
+ Attributes =
+ (
+ EFI_RESOURCE_ATTRIBUTE_PRESENT |
+ EFI_RESOURCE_ATTRIBUTE_INITIALIZED |
+ EFI_RESOURCE_ATTRIBUTE_UNCACHEABLE |
+ EFI_RESOURCE_ATTRIBUTE_WRITE_COMBINEABLE |
+ EFI_RESOURCE_ATTRIBUTE_WRITE_THROUGH_CACHEABLE |
+ EFI_RESOURCE_ATTRIBUTE_WRITE_BACK_CACHEABLE
+ );
+
+ if (Index == 0) {
+ //
+ // For the first area register it as PEI tested memory
+ //
+ Status = MemoryTestPpi->BaseMemoryTest (
+ PeiServices,
+ MemoryTestPpi,
+ MemoryBase,
+ MemorySize,
+ Quick,
+ &ErrorAddress
+ );
+ ASSERT_EFI_ERROR (Status);
+
+ //
+ // Register the "tested" memory with the PEI Core
+ //
+ Status = (**PeiServices).InstallPeiMemory (PeiServices, MemoryBase, MemorySize);
+ ASSERT_EFI_ERROR (Status);
+
+ Attributes |= EFI_RESOURCE_ATTRIBUTE_TESTED;
+ }
+
+ BuildResourceDescriptorHob (
+ EFI_RESOURCE_SYSTEM_MEMORY,
+ Attributes,
+ MemoryBase,
+ MemorySize
+ );
+ }
+ Index++;
+ } while (!EFI_ERROR (Status));
+
+ //
+ // Build the CPU hob with 36-bit addressing and 16-bits of IO space.
+ //
+ BuildCpuHob (36, 16);
+
+ return Status;
+}
diff --git a/EdkNt32Pkg/Pei/Autoscan/build.xml b/EdkNt32Pkg/Pei/Autoscan/build.xml
new file mode 100644
index 0000000000..bdbd4c930e
--- /dev/null
+++ b/EdkNt32Pkg/Pei/Autoscan/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="WinNtAutoScan"><!--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\Autoscan"/>
+ <property name="MODULE_DIR" value="${PACKAGE_DIR}\${MODULE_RELATIVE_PATH}"/>
+ <property name="COMMON_FILE" value="${WORKSPACE_DIR}\Tools\Conf\Common.xml"/>
+ <target name="WinNtAutoScan">
+ <GenBuild baseName="WinNtAutoScan" mbdFilename="${MODULE_DIR}\WinNtAutoScan.mbd" msaFilename="${MODULE_DIR}\WinNtAutoScan.msa"/>
+ </target>
+ <target depends="WinNtAutoScan_clean" name="clean"/>
+ <target depends="WinNtAutoScan_cleanall" name="cleanall"/>
+ <target name="WinNtAutoScan_clean">
+ <OutputDirSetup baseName="WinNtAutoScan" mbdFilename="${MODULE_DIR}\WinNtAutoScan.mbd" msaFilename="${MODULE_DIR}\WinNtAutoScan.msa"/>
+ <if>
+ <available file="${DEST_DIR_OUTPUT}\WinNtAutoScan_build.xml"/>
+ <then>
+ <ant antfile="${DEST_DIR_OUTPUT}\WinNtAutoScan_build.xml" target="clean"/>
+ </then>
+ </if>
+ <delete dir="${DEST_DIR_OUTPUT}" excludes="*.xml"/>
+ </target>
+ <target name="WinNtAutoScan_cleanall">
+ <OutputDirSetup baseName="WinNtAutoScan" mbdFilename="${MODULE_DIR}\WinNtAutoScan.mbd" msaFilename="${MODULE_DIR}\WinNtAutoScan.msa"/>
+ <if>
+ <available file="${DEST_DIR_OUTPUT}\WinNtAutoScan_build.xml"/>
+ <then>
+ <ant antfile="${DEST_DIR_OUTPUT}\WinNtAutoScan_build.xml" target="cleanall"/>
+ </then>
+ </if>
+ <delete dir="${DEST_DIR_OUTPUT}"/>
+ <delete dir="${DEST_DIR_DEBUG}"/>
+ <delete>
+ <fileset dir="${BIN_DIR}" includes="**WinNtAutoScan*"/>
+ </delete>
+ </target>
+</project> \ No newline at end of file