]>
Commit | Line | Data |
---|---|---|
878ddf1f | 1 | /*++\r |
2 | \r | |
3 | Copyright (c) 2006, Intel Corporation \r | |
4 | All rights reserved. This program and the accompanying materials \r | |
5 | are licensed and made available under the terms and conditions of the BSD License \r | |
6 | which accompanies this distribution. The full text of the license may be found at \r | |
7 | http://opensource.org/licenses/bsd-license.php \r | |
8 | \r | |
9 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r | |
10 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r | |
11 | \r | |
12 | Module Name:\r | |
13 | \r | |
14 | RtPlatformStatusCode.c \r | |
15 | \r | |
16 | Abstract:\r | |
17 | \r | |
18 | Contains NT32 specific implementations required to use status codes.\r | |
19 | \r | |
20 | --*/\r | |
21 | \r | |
22 | //\r | |
23 | // Globals only work at BootService Time. NOT at Runtime!\r | |
24 | //\r | |
25 | // \r | |
26 | \r | |
27 | typedef\r | |
28 | EFI_STATUS\r | |
29 | (EFIAPI *REPORT_STATUS_CODE_FUNCTION) (\r | |
30 | IN EFI_STATUS_CODE_TYPE Type,\r | |
31 | IN EFI_STATUS_CODE_VALUE Value,\r | |
32 | IN UINT32 Instance,\r | |
33 | IN EFI_GUID *CallerId OPTIONAL,\r | |
34 | IN EFI_STATUS_CODE_DATA *Data OPTIONAL\r | |
35 | );\r | |
36 | \r | |
37 | REPORT_STATUS_CODE_FUNCTION mPeiReportStatusCode;\r | |
38 | \r | |
39 | //\r | |
40 | // Function implementations\r | |
41 | //\r | |
42 | EFI_STATUS\r | |
43 | RtPlatformReportStatusCode (\r | |
44 | IN EFI_STATUS_CODE_TYPE CodeType,\r | |
45 | IN EFI_STATUS_CODE_VALUE Value,\r | |
46 | IN UINT32 Instance,\r | |
47 | IN EFI_GUID * CallerId,\r | |
48 | IN EFI_STATUS_CODE_DATA * Data OPTIONAL\r | |
49 | )\r | |
50 | /*++\r | |
51 | \r | |
52 | Routine Description:\r | |
53 | \r | |
54 | Call all status code listeners in the MonoStatusCode.\r | |
55 | \r | |
56 | Arguments:\r | |
57 | \r | |
58 | Same as ReportStatusCode service\r | |
59 | \r | |
60 | Returns:\r | |
61 | \r | |
62 | EFI_SUCCESS Always returns success.\r | |
63 | \r | |
64 | --*/\r | |
65 | {\r | |
66 | RtMemoryReportStatusCode (CodeType, Value, Instance, CallerId, Data);\r | |
67 | if (EfiAtRuntime ()) {\r | |
68 | //\r | |
69 | // For now all we do is post code at runtime\r | |
70 | //\r | |
71 | return EFI_SUCCESS;\r | |
72 | }\r | |
73 | \r | |
74 | BsDataHubReportStatusCode (CodeType, Value, Instance, CallerId, Data);\r | |
75 | \r | |
76 | //\r | |
77 | // Call back into PEI to get status codes. This is because SecMain contains\r | |
78 | // status code that reports to Win32.\r | |
79 | //\r | |
80 | if (mPeiReportStatusCode != NULL) {\r | |
81 | return mPeiReportStatusCode (CodeType, Value, Instance, CallerId, Data);\r | |
82 | }\r | |
83 | \r | |
84 | return EFI_SUCCESS;\r | |
85 | }\r | |
86 | \r | |
87 | VOID\r | |
88 | RtPlatformStatusCodeInitialize (\r | |
89 | VOID\r | |
90 | )\r | |
91 | /*++\r | |
92 | \r | |
93 | Routine Description:\r | |
94 | \r | |
95 | Initialize the status code listeners.\r | |
96 | \r | |
97 | Arguments:\r | |
98 | \r | |
99 | (Standard EFI Image entry - EFI_IMAGE_ENTRY_POINT)\r | |
100 | \r | |
101 | Returns:\r | |
102 | \r | |
103 | None\r | |
104 | \r | |
105 | --*/\r | |
106 | {\r | |
107 | EFI_HOB_GUID_TYPE *GuidHob;\r | |
108 | void *Pointer;\r | |
109 | \r | |
110 | RtMemoryStatusCodeInitialize ();\r | |
111 | BsDataHubStatusCodeInitialize ();\r | |
112 | \r | |
113 | //\r | |
114 | // Play any prior status codes to the data hub.\r | |
115 | //\r | |
116 | PlaybackStatusCodes (BsDataHubReportStatusCode);\r | |
117 | \r | |
118 | //\r | |
119 | // If PEI has a ReportStatusCode callback find it and use it before StdErr\r | |
120 | // is connected.\r | |
121 | //\r | |
122 | mPeiReportStatusCode = NULL;\r | |
123 | \r | |
124 | GuidHob = GetFirstGuidHob (&gEfiStatusCodeRuntimeProtocolGuid);\r | |
125 | if (NULL == GuidHob) {\r | |
126 | return;\r | |
127 | }\r | |
128 | Pointer = GET_GUID_HOB_DATA (GuidHob);\r | |
129 | mPeiReportStatusCode = (REPORT_STATUS_CODE_FUNCTION) (*(UINTN *) Pointer);\r | |
130 | }\r |