+++ /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