3 Copyright (c) 2006, Intel Corporation
4 All rights reserved. This program and the accompanying materials
5 are licensed and made available under the terms and conditions of the BSD License
6 which accompanies this distribution. The full text of the license may be found at
7 http://opensource.org/licenses/bsd-license.php
9 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
14 RtPlatformStatusCode.c
18 Contains NT32 specific implementations required to use status codes.
23 // Globals only work at BootService Time. NOT at Runtime!
29 (EFIAPI
*REPORT_STATUS_CODE_FUNCTION
) (
30 IN EFI_STATUS_CODE_TYPE Type
,
31 IN EFI_STATUS_CODE_VALUE Value
,
33 IN EFI_GUID
*CallerId OPTIONAL
,
34 IN EFI_STATUS_CODE_DATA
*Data OPTIONAL
37 REPORT_STATUS_CODE_FUNCTION mPeiReportStatusCode
;
40 // Function implementations
43 RtPlatformReportStatusCode (
44 IN EFI_STATUS_CODE_TYPE CodeType
,
45 IN EFI_STATUS_CODE_VALUE Value
,
47 IN EFI_GUID
* CallerId
,
48 IN EFI_STATUS_CODE_DATA
* Data OPTIONAL
54 Call all status code listeners in the MonoStatusCode.
58 Same as ReportStatusCode service
62 EFI_SUCCESS Always returns success.
66 RtMemoryReportStatusCode (CodeType
, Value
, Instance
, CallerId
, Data
);
67 if (EfiAtRuntime ()) {
69 // For now all we do is post code at runtime
74 BsDataHubReportStatusCode (CodeType
, Value
, Instance
, CallerId
, Data
);
77 // Call back into PEI to get status codes. This is because SecMain contains
78 // status code that reports to Win32.
80 if (mPeiReportStatusCode
!= NULL
) {
81 return mPeiReportStatusCode (CodeType
, Value
, Instance
, CallerId
, Data
);
88 RtPlatformStatusCodeInitialize (
95 Initialize the status code listeners.
99 (Standard EFI Image entry - EFI_IMAGE_ENTRY_POINT)
107 EFI_HOB_GUID_TYPE
*GuidHob
;
110 RtMemoryStatusCodeInitialize ();
111 BsDataHubStatusCodeInitialize ();
114 // Play any prior status codes to the data hub.
116 PlaybackStatusCodes (BsDataHubReportStatusCode
);
119 // If PEI has a ReportStatusCode callback find it and use it before StdErr
122 mPeiReportStatusCode
= NULL
;
124 GuidHob
= GetFirstGuidHob (&gEfiStatusCodeRuntimeProtocolGuid
);
125 if (NULL
== GuidHob
) {
128 Pointer
= GET_GUID_HOB_DATA (GuidHob
);
129 mPeiReportStatusCode
= (REPORT_STATUS_CODE_FUNCTION
) (*(UINTN
*) Pointer
);