summaryrefslogtreecommitdiffstats
path: root/EdkNt32Pkg/Pei/WinNtStuff
diff options
context:
space:
mode:
Diffstat (limited to 'EdkNt32Pkg/Pei/WinNtStuff')
-rw-r--r--EdkNt32Pkg/Pei/WinNtStuff/WinNtStuff.dxs29
-rw-r--r--EdkNt32Pkg/Pei/WinNtStuff/WinNtStuff.mbd43
-rw-r--r--EdkNt32Pkg/Pei/WinNtStuff/WinNtStuff.msa68
-rw-r--r--EdkNt32Pkg/Pei/WinNtStuff/build.xml47
-rw-r--r--EdkNt32Pkg/Pei/WinNtStuff/winntstuff.c73
5 files changed, 260 insertions, 0 deletions
diff --git a/EdkNt32Pkg/Pei/WinNtStuff/WinNtStuff.dxs b/EdkNt32Pkg/Pei/WinNtStuff/WinNtStuff.dxs
new file mode 100644
index 0000000000..107ddee3e1
--- /dev/null
+++ b/EdkNt32Pkg/Pei/WinNtStuff/WinNtStuff.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:
+
+ WinNtStuff.dxs
+
+Abstract:
+
+ Dependency expression file for WinNtStuff PEIM.
+
+--*/
+
+#include <AutoGen.h>
+#include <PeimDepex.h>
+
+DEPENDENCY_START
+ PEI_NT_THUNK_PPI_GUID AND EFI_PEI_PERMANENT_MEMORY_INSTALLED_PPI_GUID
+DEPENDENCY_END
+
+
diff --git a/EdkNt32Pkg/Pei/WinNtStuff/WinNtStuff.mbd b/EdkNt32Pkg/Pei/WinNtStuff/WinNtStuff.mbd
new file mode 100644
index 0000000000..ab862efcae
--- /dev/null
+++ b/EdkNt32Pkg/Pei/WinNtStuff/WinNtStuff.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>WinNtStuff</BaseName>
+ <Guid>D3AAD8DC-3A48-46ac-B1C7-28A9D3CF6755</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/WinNtStuff/WinNtStuff.msa b/EdkNt32Pkg/Pei/WinNtStuff/WinNtStuff.msa
new file mode 100644
index 0000000000..11aa06a21b
--- /dev/null
+++ b/EdkNt32Pkg/Pei/WinNtStuff/WinNtStuff.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>WinNtStuff</BaseName>
+ <ModuleType>PEIM</ModuleType>
+ <ComponentType>PE32_PEIM</ComponentType>
+ <Guid>D3AAD8DC-3A48-46ac-B1C7-28A9D3CF6755</Guid>
+ <Version>0</Version>
+ <Abstract>Component description file for WinNtStuff 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">HobLib</LibraryClass>
+ <LibraryClass Usage="ALWAYS_CONSUMED">PeiCoreLib</LibraryClass>
+ <LibraryClass Usage="ALWAYS_CONSUMED">PeiServicesTablePointerLib</LibraryClass>
+ </LibraryClassDefinitions>
+ <SourceFiles>
+ <Filename>WinNtStuff.c</Filename>
+ <Filename>WinNtStuff.dxs</Filename>
+ </SourceFiles>
+ <Includes>
+ <PackageName>MdePkg</PackageName>
+ <PackageName>EdkModulePkg</PackageName>
+ <PackageName>EdkNt32Pkg</PackageName>
+ </Includes>
+ <Protocols>
+ <Protocol Usage="ALWAYS_CONSUMED">WinNtThunk</Protocol>
+ </Protocols>
+ <Hobs>
+ <Hob Usage="ALWAYS_PRODUCED" HobType="GUID_EXTENSION">
+ <Name>WinNtThunkProtocol</Name>
+ <C_Name>gEfiWinNtThunkProtocolGuid</C_Name>
+ <Guid>0x58c518b1, 0x76f3, 0x11d4, 0xbc, 0xea, 0x00, 0x80, 0xc7, 0x3c, 0x88, 0x81</Guid>
+ </Hob>
+ </Hobs>
+ <PPIs>
+ <Ppi Usage="ALWAYS_CONSUMED">NtThunk</Ppi>
+ </PPIs>
+ <Externs>
+ <Extern>
+ <ModuleEntryPoint>PeimInitializeWinNtStuff</ModuleEntryPoint>
+ </Extern>
+ </Externs>
+</ModuleSurfaceArea>
diff --git a/EdkNt32Pkg/Pei/WinNtStuff/build.xml b/EdkNt32Pkg/Pei/WinNtStuff/build.xml
new file mode 100644
index 0000000000..885bacb1a2
--- /dev/null
+++ b/EdkNt32Pkg/Pei/WinNtStuff/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="WinNtStuff"><!--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\WinNtStuff"/>
+ <property name="MODULE_DIR" value="${PACKAGE_DIR}\${MODULE_RELATIVE_PATH}"/>
+ <property name="COMMON_FILE" value="${WORKSPACE_DIR}\Tools\Conf\Common.xml"/>
+ <target name="WinNtStuff">
+ <GenBuild baseName="WinNtStuff" mbdFilename="${MODULE_DIR}\WinNtStuff.mbd" msaFilename="${MODULE_DIR}\WinNtStuff.msa"/>
+ </target>
+ <target depends="WinNtStuff_clean" name="clean"/>
+ <target depends="WinNtStuff_cleanall" name="cleanall"/>
+ <target name="WinNtStuff_clean">
+ <OutputDirSetup baseName="WinNtStuff" mbdFilename="${MODULE_DIR}\WinNtStuff.mbd" msaFilename="${MODULE_DIR}\WinNtStuff.msa"/>
+ <if>
+ <available file="${DEST_DIR_OUTPUT}\WinNtStuff_build.xml"/>
+ <then>
+ <ant antfile="${DEST_DIR_OUTPUT}\WinNtStuff_build.xml" target="clean"/>
+ </then>
+ </if>
+ <delete dir="${DEST_DIR_OUTPUT}" excludes="*.xml"/>
+ </target>
+ <target name="WinNtStuff_cleanall">
+ <OutputDirSetup baseName="WinNtStuff" mbdFilename="${MODULE_DIR}\WinNtStuff.mbd" msaFilename="${MODULE_DIR}\WinNtStuff.msa"/>
+ <if>
+ <available file="${DEST_DIR_OUTPUT}\WinNtStuff_build.xml"/>
+ <then>
+ <ant antfile="${DEST_DIR_OUTPUT}\WinNtStuff_build.xml" target="cleanall"/>
+ </then>
+ </if>
+ <delete dir="${DEST_DIR_OUTPUT}"/>
+ <delete dir="${DEST_DIR_DEBUG}"/>
+ <delete>
+ <fileset dir="${BIN_DIR}" includes="**WinNtStuff*"/>
+ </delete>
+ </target>
+</project> \ No newline at end of file
diff --git a/EdkNt32Pkg/Pei/WinNtStuff/winntstuff.c b/EdkNt32Pkg/Pei/WinNtStuff/winntstuff.c
new file mode 100644
index 0000000000..46859286ea
--- /dev/null
+++ b/EdkNt32Pkg/Pei/WinNtStuff/winntstuff.c
@@ -0,0 +1,73 @@
+/*++
+
+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:
+
+ WinNtStuff.c
+
+Abstract:
+
+ Tiano PEIM to abstract construction of firmware volume in a Windows NT environment.
+
+Revision History
+
+--*/
+
+
+
+EFI_STATUS
+EFIAPI
+PeimInitializeWinNtStuff (
+ IN EFI_FFS_FILE_HEADER *FfsHeader,
+ IN EFI_PEI_SERVICES **PeiServices
+ )
+/*++
+
+Routine Description:
+
+ Perform a call-back into the SEC simulator to get NT Stuff
+
+Arguments:
+
+ PeiServices - General purpose services available to every PEIM.
+
+Returns:
+
+ None
+
+--*/
+// TODO: FfsHeader - add argument and description to function comment
+{
+ EFI_STATUS Status;
+ EFI_PEI_PPI_DESCRIPTOR *PpiDescriptor;
+ PEI_NT_THUNK_PPI *PeiNtService;
+ VOID *Ptr;
+
+ DEBUG ((EFI_D_ERROR, "NT 32 WinNT Stuff PEIM Loaded\n"));
+
+ Status = (**PeiServices).LocatePpi (
+ PeiServices,
+ &gPeiNtThunkPpiGuid, // GUID
+ 0, // INSTANCE
+ &PpiDescriptor, // EFI_PEI_PPI_DESCRIPTOR
+ &PeiNtService // PPI
+ );
+ ASSERT_EFI_ERROR (Status);
+
+ Ptr = PeiNtService->NtThunk ();
+
+ BuildGuidDataHob (
+ &gEfiWinNtThunkProtocolGuid, // Guid
+ &Ptr, // Buffer
+ sizeof (VOID *) // Sizeof Buffer
+ );
+ return Status;
+}