+++ /dev/null
-/*++\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
- MonoStatusCode.c\r
-\r
-Abstract:\r
-\r
- PEIM to provide the status code functionality, to aid in system debug.\r
- It includes output to 0x80 port and/or to serial port. \r
- This PEIM is monolithic. Different platform should provide different library.\r
-\r
---*/\r
-\r
-#include "MonoStatusCode.h"\r
-\r
-//\r
-// Module globals\r
-//\r
-// \r
-EFI_PEI_PROGRESS_CODE_PPI mStatusCodePpi = { PlatformReportStatusCode };\r
-\r
-EFI_PEI_PPI_DESCRIPTOR mPpiListStatusCode = {\r
- (EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST),\r
- &gEfiPeiStatusCodePpiGuid,\r
- &mStatusCodePpi\r
-};\r
-\r
-//\r
-// Function implemenations\r
-//\r
-EFI_STATUS\r
-EFIAPI\r
-TranslateDxeStatusCodeToPeiStatusCode (\r
- IN EFI_STATUS_CODE_TYPE CodeType,\r
- IN EFI_STATUS_CODE_VALUE Value,\r
- IN UINT32 Instance,\r
- IN EFI_GUID * CallerId,\r
- IN EFI_STATUS_CODE_DATA * Data OPTIONAL\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Translate from a DXE status code interface into a PEI-callable\r
- interface, making the PEI the least common denominator..\r
-\r
-Arguments:\r
-\r
- Same as DXE ReportStatusCode RT service\r
- \r
-Returns:\r
-\r
- None\r
-\r
---*/\r
-{\r
- return PlatformReportStatusCode (NULL, CodeType, Value, Instance, CallerId, Data);\r
-}\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-InitializeDxeReportStatusCode (\r
- IN EFI_PEI_SERVICES **PeiServices\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Build a hob describing the status code listener that has been installed.\r
- This will be used by DXE code until a runtime status code listener is \r
- installed.\r
-\r
-Arguments:\r
-\r
- PeiServices - General purpose services available to every PEIM.\r
- \r
-Returns:\r
-\r
- Status - EFI_SUCCESS if the interface could be successfully\r
- installed\r
-\r
---*/\r
-{\r
- VOID *Instance;\r
- VOID *HobData;\r
-\r
- Instance = (VOID *) (UINTN) TranslateDxeStatusCodeToPeiStatusCode;\r
-\r
- HobData = BuildGuidDataHob (\r
- &gEfiStatusCodeRuntimeProtocolGuid,\r
- &Instance,\r
- sizeof (VOID *)\r
- );\r
-\r
- ASSERT (HobData != NULL);\r
- return EFI_SUCCESS;\r
-}\r
-\r
-VOID\r
-EFIAPI\r
-InitializeMonoStatusCode (\r
- IN EFI_FFS_FILE_HEADER *FfsHeader,\r
- IN EFI_PEI_SERVICES **PeiServices\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Initialize the platform status codes and publish the platform status code \r
- PPI.\r
-\r
-Arguments:\r
-\r
- FfsHeader - FV this PEIM was loaded from.\r
- PeiServices - General purpose services available to every PEIM.\r
- \r
-Returns:\r
-\r
- Status - EFI_SUCCESS\r
-\r
---*/\r
-{\r
- EFI_STATUS Status;\r
-\r
- //\r
- // Initialize status code listeners.\r
- //\r
- PlatformInitializeStatusCode (FfsHeader, PeiServices);\r
-\r
- //\r
- // Publish the status code capability to other modules\r
- //\r
- Status = (*PeiServices)->InstallPpi (PeiServices, &mPpiListStatusCode);\r
-\r
- ASSERT_EFI_ERROR (Status);\r
-\r
- DEBUG ((EFI_D_ERROR, "\nMono Status Code PEIM Loaded\n"));\r
-\r
- return ;\r
-}\r
+++ /dev/null
-/*++\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
- MonoStatusCode.dxs\r
-\r
-Abstract:\r
-\r
- Dependency expression file for monolithic Status Code PEIM.\r
- \r
---*/ \r
-#include <AutoGen.h>\r
-#include <PeimDepex.h>\r
-\r
-DEPENDENCY_START\r
- TRUE\r
-DEPENDENCY_END\r
-\r
-\r
+++ /dev/null
-/*++\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
- MonoStatusCode.h\r
- \r
-Abstract:\r
-\r
- Monolithic single PEIM to provide the status code functionality.\r
- The PEIM is a blend of libraries that correspond to the different status code\r
- listeners that a platform installs.\r
-\r
---*/\r
-\r
-#ifndef _MONO_STATUS_CODE_H_\r
-#define _MONO_STATUS_CODE_H_\r
-\r
-//\r
-// Platform specific function Declarations. These must be implemented in a\r
-// subdirectory named PlatformName in a file named PlatformStatusCode.c.\r
-// See D845GRG\PlatformStatusCode.c for an example of a simple status code\r
-// implementation.\r
-// See Nt32\PlatformStatusCode.c for an example of a status code implementation\r
-// that relocates itself into memory.\r
-//\r
-//\r
-// This is the driver entry point and must be defined.\r
-//\r
-EFI_STATUS\r
-EFIAPI\r
-InstallMonoStatusCode (\r
- IN EFI_FFS_FILE_HEADER *FfsHeader,\r
- IN EFI_PEI_SERVICES **PeiServices\r
- )\r
-;\r
-\r
-//\r
-// This is the platform function to initialize the listeners desired by the\r
-// platform.\r
-//\r
-VOID\r
-PlatformInitializeStatusCode (\r
- IN EFI_FFS_FILE_HEADER *FfsHeader,\r
- IN EFI_PEI_SERVICES **PeiServices\r
- )\r
-;\r
-\r
-//\r
-// This is the platform function that calls all of the listeners desired by the\r
-// platform.\r
-//\r
-EFI_STATUS\r
-EFIAPI\r
-PlatformReportStatusCode (\r
- IN EFI_PEI_SERVICES **PeiServices,\r
- IN EFI_STATUS_CODE_TYPE CodeType,\r
- IN EFI_STATUS_CODE_VALUE Value,\r
- IN UINT32 Instance,\r
- IN EFI_GUID * CallerId,\r
- IN EFI_STATUS_CODE_DATA * Data OPTIONAL\r
- )\r
-;\r
-\r
-//\r
-// Platform independent function Declarations\r
-//\r
-//\r
-// Initialize the status code listeners and publish the status code PPI.\r
-//\r
-VOID\r
-EFIAPI\r
-InitializeMonoStatusCode (\r
- IN EFI_FFS_FILE_HEADER *FfsHeader,\r
- IN EFI_PEI_SERVICES **PeiServices\r
- )\r
-;\r
-\r
-//\r
-// Convert a DXE status code call into a PEI status code call.\r
-//\r
-EFI_STATUS\r
-EFIAPI\r
-TranslateDxeStatusCodeToPeiStatusCode (\r
- IN EFI_STATUS_CODE_TYPE CodeType,\r
- IN EFI_STATUS_CODE_VALUE Value,\r
- IN UINT32 Instance,\r
- IN EFI_GUID * CallerId,\r
- IN EFI_STATUS_CODE_DATA * Data OPTIONAL\r
- )\r
-;\r
-\r
-//\r
-// Publish a HOB that contains the listener to be used by DXE.\r
-//\r
-EFI_STATUS\r
-EFIAPI\r
-InitializeDxeReportStatusCode (\r
- IN EFI_PEI_SERVICES **PeiServices\r
- )\r
-;\r
-\r
-#endif\r
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>\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.-->\r
-<ModuleSurfaceArea xmlns="http://www.TianoCore.org/2006/Edk2.0">\r
- <MsaHeader>\r
- <ModuleName>MonoStatusCode</ModuleName>\r
- <ModuleType>PEIM</ModuleType>\r
- <GuidValue>1501614E-0E6C-4ef4-8B8F-C276CDFB646F</GuidValue>\r
- <Version>1.0</Version>\r
- <Abstract>Mono status code driver</Abstract>\r
- <Description>\r
- PEIM to provide the status code functionality, to aid in system debug.\r
- It includes output to 0x80 port and/or to serial port. \r
- This PEIM is monolithic. Different platform should provide different library.\r
- </Description>\r
- <Copyright>Copyright (c) 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>FRAMEWORK_BUILD_PACKAGING_SPECIFICATION 0x00000052</Specification>\r
- </MsaHeader>\r
- <ModuleDefinitions>\r
- <SupportedArchitectures>IA32 X64 IPF EBC</SupportedArchitectures>\r
- <BinaryModule>false</BinaryModule>\r
- <OutputFileBasename>MonoStatusCode</OutputFileBasename>\r
- </ModuleDefinitions>\r
- <LibraryClassDefinitions>\r
- <LibraryClass Usage="ALWAYS_CONSUMED">\r
- <Keyword>DebugLib</Keyword>\r
- </LibraryClass>\r
- <LibraryClass Usage="ALWAYS_CONSUMED">\r
- <Keyword>PeimEntryPoint</Keyword>\r
- </LibraryClass>\r
- <LibraryClass Usage="ALWAYS_CONSUMED">\r
- <Keyword>EdkMemoryStatusCodeLib</Keyword>\r
- </LibraryClass>\r
- <LibraryClass Usage="ALWAYS_CONSUMED">\r
- <Keyword>HobLib</Keyword>\r
- </LibraryClass>\r
- </LibraryClassDefinitions>\r
- <SourceFiles>\r
- <Filename>MonoStatusCode.dxs</Filename>\r
- <Filename>MonoStatusCode.h</Filename>\r
- <Filename>MonoStatusCode.c</Filename>\r
- <Filename>PlatformStatusCode.c</Filename>\r
- </SourceFiles>\r
- <PackageDependencies>\r
- <Package PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/>\r
- <Package PackageGuid="B6EC423C-21D2-490D-85C6-DD5864EAA674"/>\r
- <Package PackageGuid="0fb2aa2d-10d5-40a5-a9dc-060c12a4a3f3"/>\r
- </PackageDependencies>\r
- <Protocols>\r
- <Protocol Usage="SOMETIMES_CONSUMED">\r
- <ProtocolCName>gEfiStatusCodeRuntimeProtocolGuid</ProtocolCName>\r
- </Protocol>\r
- </Protocols>\r
- <PPIs>\r
- <Ppi Usage="ALWAYS_CONSUMED">\r
- <PpiCName>gEfiPeiStatusCodePpiGuid</PpiCName>\r
- </Ppi>\r
- <Ppi Usage="SOMETIMES_CONSUMED">\r
- <PpiCName>gEfiPeiFvFileLoaderPpiGuid</PpiCName>\r
- </Ppi>\r
- </PPIs>\r
- <Externs>\r
- <Specification>EFI_SPECIFICATION_VERSION 0x00020000</Specification>\r
- <Specification>EDK_RELEASE_VERSION 0x00020000</Specification>\r
- <Extern>\r
- <ModuleEntryPoint>InstallMonoStatusCode</ModuleEntryPoint>\r
- </Extern>\r
- </Externs>\r
-</ModuleSurfaceArea>
\ No newline at end of file
+++ /dev/null
-/*++\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
- PlatformStatusCode.c \r
- \r
-Abstract:\r
-\r
- Contains NT32 specific implementations required to use status codes.\r
-\r
---*/\r
-\r
-#include "MonoStatusCode.h"\r
-\r
-\r
-BOOLEAN gRunningFromMemory = FALSE;\r
-//\r
-// Platform definitions\r
-//\r
-EFI_PEI_REPORT_STATUS_CODE mSecReportStatusCode = NULL;\r
-\r
-extern EFI_PEI_PROGRESS_CODE_PPI mStatusCodePpi;\r
-\r
-//\r
-// Function implementations\r
-//\r
-EFI_STATUS\r
-EFIAPI\r
-PlatformReportStatusCode (\r
- IN EFI_PEI_SERVICES **PeiServices,\r
- IN EFI_STATUS_CODE_TYPE CodeType,\r
- IN EFI_STATUS_CODE_VALUE Value,\r
- IN UINT32 Instance,\r
- IN EFI_GUID * CallerId,\r
- IN EFI_STATUS_CODE_DATA * Data OPTIONAL\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Call all status code listeners in the MonoStatusCode.\r
-\r
-Arguments:\r
-\r
- Same as ReportStatusCode service\r
- \r
-Returns:\r
-\r
- EFI_SUCCESS Always returns success.\r
-\r
---*/\r
-{\r
- if (mSecReportStatusCode != NULL) {\r
- mSecReportStatusCode (PeiServices, CodeType, Value, Instance, CallerId, Data);\r
- }\r
- MemoryReportStatusCode (CodeType, Value, Instance, CallerId, Data);\r
- return EFI_SUCCESS;\r
-}\r
-\r
-VOID\r
-PlatformInitializeStatusCode (\r
- IN EFI_FFS_FILE_HEADER *FfsHeader,\r
- IN EFI_PEI_SERVICES **PeiServices\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Initialize the status code listeners. This consists of locating the \r
- listener produced by SecMain.exe.\r
-\r
-Arguments:\r
-\r
- FfsHeader - FV this PEIM was loaded from.\r
- PeiServices - General purpose services available to every PEIM.\r
-\r
-Returns:\r
-\r
- None\r
-\r
---*/\r
-{\r
- EFI_STATUS Status;\r
- EFI_PEI_PROGRESS_CODE_PPI *ReportStatusCodePpi;\r
- EFI_PEI_PPI_DESCRIPTOR *ReportStatusCodeDescriptor;\r
-\r
- //\r
- // Cache the existing status code listener installed by the SEC core.\r
- // We should actually do a heap allocate, install a PPI, etc, but since we\r
- // know that we are running from a DLL, we can use global variables, and\r
- // directly update the status code PPI descriptor\r
- //\r
- //\r
- // Locate SEC status code PPI\r
- //\r
- Status = (*PeiServices)->LocatePpi (\r
- PeiServices,\r
- &gEfiPeiStatusCodePpiGuid,\r
- 0,\r
- &ReportStatusCodeDescriptor,\r
- &ReportStatusCodePpi\r
- );\r
- if (EFI_ERROR (Status)) {\r
- return ;\r
- }\r
-\r
- mSecReportStatusCode = ReportStatusCodePpi->ReportStatusCode;\r
- ReportStatusCodeDescriptor->Ppi = &mStatusCodePpi;\r
-\r
- //\r
- // Always initialize memory status code listener.\r
- //\r
- MemoryStatusCodeInitialize (FfsHeader, PeiServices);\r
-\r
-}\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-InstallMonoStatusCode (\r
- IN EFI_FFS_FILE_HEADER *FfsHeader,\r
- IN EFI_PEI_SERVICES **PeiServices\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Install the PEIM. Publish the DXE callback as well.\r
-\r
-Arguments:\r
-\r
- FfsHeader - FV this PEIM was loaded from.\r
- PeiServices - General purpose services available to every PEIM.\r
-\r
-Returns:\r
-\r
- EFI_SUCCESS The function always returns success.\r
-\r
---*/\r
-{\r
- if (!gRunningFromMemory) {\r
- //\r
- // First pass, running from flash, initialize everything\r
- //\r
- InitializeMonoStatusCode (FfsHeader, PeiServices);\r
- } else {\r
- //\r
- // Second pass, running from memory, initialize memory listener and\r
- // publish the DXE listener in a HOB.\r
- //\r
- MemoryStatusCodeInitialize (FfsHeader, PeiServices);\r
- InitializeDxeReportStatusCode (PeiServices);\r
- }\r
-\r
- return EFI_SUCCESS;\r
-}\r