From: yshang1 Date: Fri, 21 Jul 2006 14:28:01 +0000 (+0000) Subject: 1) Check in Pei/Dxe status code; X-Git-Tag: edk2-stable201903~24802 X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=commitdiff_plain;h=9fbf943fc137d3f7f3172cbf4ef42594b0e28679;hp=ba53dd4a1a070ab69a29f013f037fb8c8ce4bcc7 1) Check in Pei/Dxe status code; 2) OemHookStatusCodeLib and SerialPortLib class and null instance; 3) Remove all referenced code from EdkModulePkg,EdkNt32Pkg. 4) Add Nt32OemHookStatusCodeLib. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1069 6f19259b-4bc3-4df7-8a09-765794883524 --- diff --git a/EdkNt32Pkg/Pei/MonoStatusCode/MonoStatusCode.c b/EdkNt32Pkg/Pei/MonoStatusCode/MonoStatusCode.c deleted file mode 100644 index 27c73f576e..0000000000 --- a/EdkNt32Pkg/Pei/MonoStatusCode/MonoStatusCode.c +++ /dev/null @@ -1,150 +0,0 @@ -/*++ - -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: - - MonoStatusCode.c - -Abstract: - - PEIM to provide the status code functionality, to aid in system debug. - It includes output to 0x80 port and/or to serial port. - This PEIM is monolithic. Different platform should provide different library. - ---*/ - -#include "MonoStatusCode.h" - -// -// Module globals -// -// -EFI_PEI_PROGRESS_CODE_PPI mStatusCodePpi = { PlatformReportStatusCode }; - -EFI_PEI_PPI_DESCRIPTOR mPpiListStatusCode = { - (EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST), - &gEfiPeiStatusCodePpiGuid, - &mStatusCodePpi -}; - -// -// Function implemenations -// -EFI_STATUS -EFIAPI -TranslateDxeStatusCodeToPeiStatusCode ( - 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: - - Translate from a DXE status code interface into a PEI-callable - interface, making the PEI the least common denominator.. - -Arguments: - - Same as DXE ReportStatusCode RT service - -Returns: - - None - ---*/ -{ - return PlatformReportStatusCode (NULL, CodeType, Value, Instance, CallerId, Data); -} - -EFI_STATUS -EFIAPI -InitializeDxeReportStatusCode ( - IN EFI_PEI_SERVICES **PeiServices - ) -/*++ - -Routine Description: - - Build a hob describing the status code listener that has been installed. - This will be used by DXE code until a runtime status code listener is - installed. - -Arguments: - - PeiServices - General purpose services available to every PEIM. - -Returns: - - Status - EFI_SUCCESS if the interface could be successfully - installed - ---*/ -{ - VOID *Instance; - VOID *HobData; - - Instance = (VOID *) (UINTN) TranslateDxeStatusCodeToPeiStatusCode; - - HobData = BuildGuidDataHob ( - &gEfiStatusCodeRuntimeProtocolGuid, - &Instance, - sizeof (VOID *) - ); - - ASSERT (HobData != NULL); - return EFI_SUCCESS; -} - -VOID -EFIAPI -InitializeMonoStatusCode ( - IN EFI_FFS_FILE_HEADER *FfsHeader, - IN EFI_PEI_SERVICES **PeiServices - ) -/*++ - -Routine Description: - - Initialize the platform status codes and publish the platform status code - PPI. - -Arguments: - - FfsHeader - FV this PEIM was loaded from. - PeiServices - General purpose services available to every PEIM. - -Returns: - - Status - EFI_SUCCESS - ---*/ -{ - EFI_STATUS Status; - - // - // Initialize status code listeners. - // - PlatformInitializeStatusCode (FfsHeader, PeiServices); - - // - // Publish the status code capability to other modules - // - Status = (*PeiServices)->InstallPpi (PeiServices, &mPpiListStatusCode); - - ASSERT_EFI_ERROR (Status); - - DEBUG ((EFI_D_ERROR, "\nMono Status Code PEIM Loaded\n")); - - return ; -} diff --git a/EdkNt32Pkg/Pei/MonoStatusCode/MonoStatusCode.dxs b/EdkNt32Pkg/Pei/MonoStatusCode/MonoStatusCode.dxs deleted file mode 100644 index 3c86da0c63..0000000000 --- a/EdkNt32Pkg/Pei/MonoStatusCode/MonoStatusCode.dxs +++ /dev/null @@ -1,28 +0,0 @@ -/*++ - -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: - - MonoStatusCode.dxs - -Abstract: - - Dependency expression file for monolithic Status Code PEIM. - ---*/ -#include -#include - -DEPENDENCY_START - TRUE -DEPENDENCY_END - - diff --git a/EdkNt32Pkg/Pei/MonoStatusCode/MonoStatusCode.h b/EdkNt32Pkg/Pei/MonoStatusCode/MonoStatusCode.h deleted file mode 100644 index 38a9022558..0000000000 --- a/EdkNt32Pkg/Pei/MonoStatusCode/MonoStatusCode.h +++ /dev/null @@ -1,111 +0,0 @@ -/*++ - -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: - - MonoStatusCode.h - -Abstract: - - Monolithic single PEIM to provide the status code functionality. - The PEIM is a blend of libraries that correspond to the different status code - listeners that a platform installs. - ---*/ - -#ifndef _MONO_STATUS_CODE_H_ -#define _MONO_STATUS_CODE_H_ - -// -// Platform specific function Declarations. These must be implemented in a -// subdirectory named PlatformName in a file named PlatformStatusCode.c. -// See D845GRG\PlatformStatusCode.c for an example of a simple status code -// implementation. -// See Nt32\PlatformStatusCode.c for an example of a status code implementation -// that relocates itself into memory. -// -// -// This is the driver entry point and must be defined. -// -EFI_STATUS -EFIAPI -InstallMonoStatusCode ( - IN EFI_FFS_FILE_HEADER *FfsHeader, - IN EFI_PEI_SERVICES **PeiServices - ) -; - -// -// This is the platform function to initialize the listeners desired by the -// platform. -// -VOID -PlatformInitializeStatusCode ( - IN EFI_FFS_FILE_HEADER *FfsHeader, - IN EFI_PEI_SERVICES **PeiServices - ) -; - -// -// This is the platform function that calls all of the listeners desired by the -// platform. -// -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 - ) -; - -// -// Platform independent function Declarations -// -// -// Initialize the status code listeners and publish the status code PPI. -// -VOID -EFIAPI -InitializeMonoStatusCode ( - IN EFI_FFS_FILE_HEADER *FfsHeader, - IN EFI_PEI_SERVICES **PeiServices - ) -; - -// -// Convert a DXE status code call into a PEI status code call. -// -EFI_STATUS -EFIAPI -TranslateDxeStatusCodeToPeiStatusCode ( - 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 - ) -; - -// -// Publish a HOB that contains the listener to be used by DXE. -// -EFI_STATUS -EFIAPI -InitializeDxeReportStatusCode ( - IN EFI_PEI_SERVICES **PeiServices - ) -; - -#endif diff --git a/EdkNt32Pkg/Pei/MonoStatusCode/MonoStatusCode.msa b/EdkNt32Pkg/Pei/MonoStatusCode/MonoStatusCode.msa deleted file mode 100644 index b56436db27..0000000000 --- a/EdkNt32Pkg/Pei/MonoStatusCode/MonoStatusCode.msa +++ /dev/null @@ -1,81 +0,0 @@ - - - - - MonoStatusCode - PEIM - 1501614E-0E6C-4ef4-8B8F-C276CDFB646F - 1.0 - Mono status code driver - - PEIM to provide the status code functionality, to aid in system debug. - It includes output to 0x80 port and/or to serial port. - This PEIM is monolithic. Different platform should provide different library. - - 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. - FRAMEWORK_BUILD_PACKAGING_SPECIFICATION 0x00000052 - - - IA32 X64 IPF EBC - false - MonoStatusCode - - - - DebugLib - - - PeimEntryPoint - - - EdkMemoryStatusCodeLib - - - HobLib - - - - MonoStatusCode.dxs - MonoStatusCode.h - MonoStatusCode.c - PlatformStatusCode.c - - - - - - - - - gEfiStatusCodeRuntimeProtocolGuid - - - - - gEfiPeiStatusCodePpiGuid - - - gEfiPeiFvFileLoaderPpiGuid - - - - EFI_SPECIFICATION_VERSION 0x00020000 - EDK_RELEASE_VERSION 0x00020000 - - InstallMonoStatusCode - - - \ No newline at end of file diff --git a/EdkNt32Pkg/Pei/MonoStatusCode/PlatformStatusCode.c b/EdkNt32Pkg/Pei/MonoStatusCode/PlatformStatusCode.c deleted file mode 100644 index 919ab05ee7..0000000000 --- a/EdkNt32Pkg/Pei/MonoStatusCode/PlatformStatusCode.c +++ /dev/null @@ -1,164 +0,0 @@ -/*++ - -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. - ---*/ -{ - if (mSecReportStatusCode != NULL) { - 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; -}