Enable Report Status Code Router introduced in PI 1.2 for PEI and DXE.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9388 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
xli24
2009-11-03 02:39:10 +00:00
parent f8dddfdecf
commit 25126a0530
26 changed files with 2503 additions and 7 deletions

View File

@ -0,0 +1,69 @@
/** @file
Report Status Code Handler PEIM which produces general handlers and hook them
onto the PEI status code router.
Copyright (c) 2009, 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.
**/
#include "StatusCodeHandlerPei.h"
/**
Entry point of Status Code PEIM.
This function is the entry point of this Status Code PEIM.
It initializes supported status code devices according to PCD settings,
and installs Status Code PPI.
@param FileHandle Handle of the file being invoked.
@param PeiServices Describes the list of possible PEI Services.
@retval EFI_SUCESS The entry point of DXE IPL PEIM executes successfully.
**/
EFI_STATUS
EFIAPI
StatusCodeHandlerPeiEntry (
IN EFI_PEI_FILE_HANDLE FileHandle,
IN CONST EFI_PEI_SERVICES **PeiServices
)
{
EFI_STATUS Status;
EFI_PEI_RSC_HANDLER_PPI *RscHandlerPpi;
Status = PeiServicesLocatePpi (
&gEfiPeiRscHandlerPpiGuid,
0,
NULL,
(VOID **) &RscHandlerPpi
);
ASSERT_EFI_ERROR (Status);
//
// Dispatch initialization request to sub-statuscode-devices.
// If enable UseSerial, then initialize serial port.
// if enable UseMemory, then initialize memory status code worker.
//
if (FeaturePcdGet (PcdStatusCodeUseSerial)) {
Status = SerialPortInitialize();
ASSERT_EFI_ERROR (Status);
Status = RscHandlerPpi->Register (SerialStatusCodeReportWorker);
ASSERT_EFI_ERROR (Status);
}
if (FeaturePcdGet (PcdStatusCodeUseMemory)) {
Status = MemoryStatusCodeInitializeWorker ();
ASSERT_EFI_ERROR (Status);
Status = RscHandlerPpi->Register (MemoryStatusCodeReportWorker);
ASSERT_EFI_ERROR (Status);
}
return EFI_SUCCESS;
}