2 Status Code Handler Driver which produces general handlers and hook them
3 onto the SMM status code router.
5 Copyright (c) 2009, Intel Corporation. All rights reserved.<BR>
6 This program and the accompanying materials
7 are licensed and made available under the terms and conditions of the BSD License
8 which accompanies this distribution. The full text of the license may be found at
9 http://opensource.org/licenses/bsd-license.php
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
16 #include "StatusCodeHandlerSmm.h"
18 EFI_SMM_RSC_HANDLER_PROTOCOL
*mRscHandlerProtocol
= NULL
;
22 Dispatch initialization request to sub status code devices based on
23 customized feature flags.
27 InitializationDispatcherWorker (
34 // If enable UseSerial, then initialize serial port.
35 // if enable UseRuntimeMemory, then initialize runtime memory status code worker.
37 if (FeaturePcdGet (PcdStatusCodeUseSerial
)) {
39 // Call Serial Port Lib API to initialize serial port.
41 Status
= SerialPortInitialize ();
42 ASSERT_EFI_ERROR (Status
);
44 if (FeaturePcdGet (PcdStatusCodeUseMemory
)) {
45 Status
= MemoryStatusCodeInitializeWorker ();
46 ASSERT_EFI_ERROR (Status
);
51 Entry point of SMM Status Code Driver.
53 This function is the entry point of SMM Status Code Driver.
55 @param ImageHandle The firmware allocated handle for the EFI image.
56 @param SystemTable A pointer to the EFI System Table.
58 @retval EFI_SUCCESS The entry point is executed successfully.
63 StatusCodeHandlerSmmEntry (
64 IN EFI_HANDLE ImageHandle
,
65 IN EFI_SYSTEM_TABLE
*SystemTable
70 Status
= gSmst
->SmmLocateProtocol (
71 &gEfiSmmRscHandlerProtocolGuid
,
73 (VOID
**) &mRscHandlerProtocol
75 ASSERT_EFI_ERROR (Status
);
78 // Dispatch initialization request to supported devices
80 InitializationDispatcherWorker ();
82 if (FeaturePcdGet (PcdStatusCodeUseSerial
)) {
83 mRscHandlerProtocol
->Register (SerialStatusCodeReportWorker
);
85 if (FeaturePcdGet (PcdStatusCodeUseMemory
)) {
86 mRscHandlerProtocol
->Register (MemoryStatusCodeReportWorker
);