summaryrefslogtreecommitdiffstats
path: root/EdkNt32Pkg/Pei/MonoStatusCode/Nt32
diff options
context:
space:
mode:
Diffstat (limited to 'EdkNt32Pkg/Pei/MonoStatusCode/Nt32')
-rw-r--r--EdkNt32Pkg/Pei/MonoStatusCode/Nt32/MonoStatusCode.mbd44
-rw-r--r--EdkNt32Pkg/Pei/MonoStatusCode/Nt32/MonoStatusCode.msa70
-rw-r--r--EdkNt32Pkg/Pei/MonoStatusCode/Nt32/PlatformStatusCode.c162
-rw-r--r--EdkNt32Pkg/Pei/MonoStatusCode/Nt32/build.xml47
4 files changed, 323 insertions, 0 deletions
diff --git a/EdkNt32Pkg/Pei/MonoStatusCode/Nt32/MonoStatusCode.mbd b/EdkNt32Pkg/Pei/MonoStatusCode/Nt32/MonoStatusCode.mbd
new file mode 100644
index 0000000000..f48b4c7f0e
--- /dev/null
+++ b/EdkNt32Pkg/Pei/MonoStatusCode/Nt32/MonoStatusCode.mbd
@@ -0,0 +1,44 @@
+<?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>MonoStatusCode</BaseName>
+ <Guid>1501614E-0E6C-4ef4-8B8F-C276CDFB646F</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>PeiReportStatusCodeLib</Library>
+ <Library>BaseDebugLibReportStatusCode</Library>
+ <Library>BaseLib</Library>
+ <Library>PeiMemoryLib</Library>
+ <Library>PeiServicesTablePointerLib</Library>
+ <Library>PeiHobLib</Library>
+ <Library>PeimEntryPoint</Library>
+ <Library>EdkMemoryStatusCodeLib</Library>
+ <Library>PeiCoreLib</Library>
+ </Libraries>
+ <BuildOptions ToolChain="MSFT">
+ <ImageEntryPoint>_ModuleEntryPoint</ImageEntryPoint>
+ </BuildOptions>
+</ModuleBuildDescription>
diff --git a/EdkNt32Pkg/Pei/MonoStatusCode/Nt32/MonoStatusCode.msa b/EdkNt32Pkg/Pei/MonoStatusCode/Nt32/MonoStatusCode.msa
new file mode 100644
index 0000000000..a1e96c7bf9
--- /dev/null
+++ b/EdkNt32Pkg/Pei/MonoStatusCode/Nt32/MonoStatusCode.msa
@@ -0,0 +1,70 @@
+<?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>MonoStatusCode</BaseName>
+ <ModuleType>PEIM</ModuleType>
+ <ComponentType>PE32_PEIM</ComponentType>
+ <Guid>1501614E-0E6C-4ef4-8B8F-C276CDFB646F</Guid>
+ <Version>0</Version>
+ <Abstract>Component description file for DiskIo 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">EdkMemoryStatusCodeLib</LibraryClass>
+ <LibraryClass Usage="ALWAYS_CONSUMED">HobLib</LibraryClass>
+ </LibraryClassDefinitions>
+ <SourceFiles>
+ <Filename>..\MonoStatusCode.c</Filename>
+ <Filename>..\MonoStatusCode.h</Filename>
+ <Filename>PlatformStatusCode.c</Filename>
+ <Filename>..\MonoStatusCode.dxs</Filename>
+ </SourceFiles>
+ <Includes>
+ <PackageName>MdePkg</PackageName>
+ <PackageName>EdkModulePkg</PackageName>
+ <PackageName>EdkNt32Pkg</PackageName>
+ </Includes>
+ <Protocols>
+ <Protocol Usage="SOMETIMES_CONSUMED">StatusCode</Protocol>
+ </Protocols>
+ <Hobs>
+ <Hob Usage="SOMETIMES_PRODUCED" HobType="GUID_EXTENSION">
+ <Name>TranslateDxeStatusCodeToPeiStatusCode</Name>
+ <C_Name>gEfiStatusCodeRuntimeProtocolGuid</C_Name>
+ <Guid>0xd2b2b828, 0x826, 0x48a7, 0xb3, 0xdf, 0x98, 0x3c, 0x0, 0x60, 0x24, 0xf0</Guid>
+ </Hob>
+ </Hobs>
+ <PPIs>
+ <Ppi Usage="ALWAYS_CONSUMED">StatusCode</Ppi>
+ <Ppi Usage="SOMETIMES_CONSUMED">FvFileLoader</Ppi>
+ </PPIs>
+ <Externs>
+ <Extern>
+ <ModuleEntryPoint>InstallMonoStatusCode</ModuleEntryPoint>
+ </Extern>
+ </Externs>
+</ModuleSurfaceArea>
diff --git a/EdkNt32Pkg/Pei/MonoStatusCode/Nt32/PlatformStatusCode.c b/EdkNt32Pkg/Pei/MonoStatusCode/Nt32/PlatformStatusCode.c
new file mode 100644
index 0000000000..9d1a57b2ee
--- /dev/null
+++ b/EdkNt32Pkg/Pei/MonoStatusCode/Nt32/PlatformStatusCode.c
@@ -0,0 +1,162 @@
+/*++
+
+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:
+
+ PlatformStatusCode.c
+
+Abstract:
+
+ Contains NT32 specific implementations required to use status codes.
+
+--*/
+
+#include "../MonoStatusCode.h"
+
+
+BOOLEAN gRunningFromMemory = FALSE;
+//
+// Platform definitions
+//
+EFI_PEI_REPORT_STATUS_CODE mSecReportStatusCode = NULL;
+
+extern EFI_PEI_PROGRESS_CODE_PPI mStatusCodePpi;
+
+//
+// Function implementations
+//
+EFI_STATUS
+EFIAPI
+PlatformReportStatusCode (
+ IN EFI_PEI_SERVICES **PeiServices,
+ IN EFI_STATUS_CODE_TYPE CodeType,
+ IN EFI_STATUS_CODE_VALUE Value,
+ IN UINT32 Instance,
+ IN EFI_GUID * CallerId,
+ IN EFI_STATUS_CODE_DATA * Data OPTIONAL
+ )
+/*++
+
+Routine Description:
+
+ Call all status code listeners in the MonoStatusCode.
+
+Arguments:
+
+ Same as ReportStatusCode service
+
+Returns:
+
+ EFI_SUCCESS Always returns success.
+
+--*/
+{
+ mSecReportStatusCode (PeiServices, CodeType, Value, Instance, CallerId, Data);
+ MemoryReportStatusCode (CodeType, Value, Instance, CallerId, Data);
+ return EFI_SUCCESS;
+}
+
+VOID
+PlatformInitializeStatusCode (
+ IN EFI_FFS_FILE_HEADER *FfsHeader,
+ IN EFI_PEI_SERVICES **PeiServices
+ )
+/*++
+
+Routine Description:
+
+ Initialize the status code listeners. This consists of locating the
+ listener produced by SecMain.exe.
+
+Arguments:
+
+ FfsHeader - FV this PEIM was loaded from.
+ PeiServices - General purpose services available to every PEIM.
+
+Returns:
+
+ None
+
+--*/
+{
+ EFI_STATUS Status;
+ EFI_PEI_PROGRESS_CODE_PPI *ReportStatusCodePpi;
+ EFI_PEI_PPI_DESCRIPTOR *ReportStatusCodeDescriptor;
+
+ //
+ // Cache the existing status code listener installed by the SEC core.
+ // We should actually do a heap allocate, install a PPI, etc, but since we
+ // know that we are running from a DLL, we can use global variables, and
+ // directly update the status code PPI descriptor
+ //
+ //
+ // Locate SEC status code PPI
+ //
+ Status = (*PeiServices)->LocatePpi (
+ PeiServices,
+ &gEfiPeiStatusCodePpiGuid,
+ 0,
+ &ReportStatusCodeDescriptor,
+ &ReportStatusCodePpi
+ );
+ if (EFI_ERROR (Status)) {
+ return ;
+ }
+
+ mSecReportStatusCode = ReportStatusCodePpi->ReportStatusCode;
+ ReportStatusCodeDescriptor->Ppi = &mStatusCodePpi;
+
+ //
+ // Always initialize memory status code listener.
+ //
+ MemoryStatusCodeInitialize (FfsHeader, PeiServices);
+
+}
+
+EFI_STATUS
+EFIAPI
+InstallMonoStatusCode (
+ IN EFI_FFS_FILE_HEADER *FfsHeader,
+ IN EFI_PEI_SERVICES **PeiServices
+ )
+/*++
+
+Routine Description:
+
+ Install the PEIM. Publish the DXE callback as well.
+
+Arguments:
+
+ FfsHeader - FV this PEIM was loaded from.
+ PeiServices - General purpose services available to every PEIM.
+
+Returns:
+
+ EFI_SUCCESS The function always returns success.
+
+--*/
+{
+ if (!gRunningFromMemory) {
+ //
+ // First pass, running from flash, initialize everything
+ //
+ InitializeMonoStatusCode (FfsHeader, PeiServices);
+ } else {
+ //
+ // Second pass, running from memory, initialize memory listener and
+ // publish the DXE listener in a HOB.
+ //
+ MemoryStatusCodeInitialize (FfsHeader, PeiServices);
+ InitializeDxeReportStatusCode (PeiServices);
+ }
+
+ return EFI_SUCCESS;
+}
diff --git a/EdkNt32Pkg/Pei/MonoStatusCode/Nt32/build.xml b/EdkNt32Pkg/Pei/MonoStatusCode/Nt32/build.xml
new file mode 100644
index 0000000000..e6c8551241
--- /dev/null
+++ b/EdkNt32Pkg/Pei/MonoStatusCode/Nt32/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="MonoStatusCode"><!--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\MonoStatusCode\Nt32"/>
+ <property name="MODULE_DIR" value="${PACKAGE_DIR}\${MODULE_RELATIVE_PATH}"/>
+ <property name="COMMON_FILE" value="${WORKSPACE_DIR}\Tools\Conf\Common.xml"/>
+ <target name="MonoStatusCode">
+ <GenBuild baseName="MonoStatusCode" mbdFilename="${MODULE_DIR}\MonoStatusCode.mbd" msaFilename="${MODULE_DIR}\MonoStatusCode.msa"/>
+ </target>
+ <target depends="MonoStatusCode_clean" name="clean"/>
+ <target depends="MonoStatusCode_cleanall" name="cleanall"/>
+ <target name="MonoStatusCode_clean">
+ <OutputDirSetup baseName="MonoStatusCode" mbdFilename="${MODULE_DIR}\MonoStatusCode.mbd" msaFilename="${MODULE_DIR}\MonoStatusCode.msa"/>
+ <if>
+ <available file="${DEST_DIR_OUTPUT}\MonoStatusCode_build.xml"/>
+ <then>
+ <ant antfile="${DEST_DIR_OUTPUT}\MonoStatusCode_build.xml" target="clean"/>
+ </then>
+ </if>
+ <delete dir="${DEST_DIR_OUTPUT}" excludes="*.xml"/>
+ </target>
+ <target name="MonoStatusCode_cleanall">
+ <OutputDirSetup baseName="MonoStatusCode" mbdFilename="${MODULE_DIR}\MonoStatusCode.mbd" msaFilename="${MODULE_DIR}\MonoStatusCode.msa"/>
+ <if>
+ <available file="${DEST_DIR_OUTPUT}\MonoStatusCode_build.xml"/>
+ <then>
+ <ant antfile="${DEST_DIR_OUTPUT}\MonoStatusCode_build.xml" target="cleanall"/>
+ </then>
+ </if>
+ <delete dir="${DEST_DIR_OUTPUT}"/>
+ <delete dir="${DEST_DIR_DEBUG}"/>
+ <delete>
+ <fileset dir="${BIN_DIR}" includes="**MonoStatusCode*"/>
+ </delete>
+ </target>
+</project> \ No newline at end of file