]>
Commit | Line | Data |
---|---|---|
878ddf1f | 1 | /** @file\r |
2 | Report Status Code Library Post Code functions for PEI Phase.\r | |
3 | \r | |
4 | Copyright (c) 2006, Intel Corporation<BR>\r | |
5 | All rights reserved. This program and the accompanying materials \r | |
6 | are licensed and made available under the terms and conditions of the BSD License \r | |
7 | which accompanies this distribution. The full text of the license may be found at \r | |
8 | http://opensource.org/licenses/bsd-license.php \r | |
9 | \r | |
10 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r | |
11 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r | |
12 | \r | |
13 | **/\r | |
14 | \r | |
15 | \r | |
16 | /**\r | |
17 | Sends an 32-bit value to a POST card.\r | |
18 | \r | |
19 | Sends the 32-bit value specified by Value to a POST card, and returns Value. \r | |
20 | Some implementations of this library function may perform I/O operations \r | |
21 | directly to a POST card device. Other implementations may send Value to \r | |
22 | ReportStatusCode(), and the status code reporting mechanism will eventually \r | |
23 | display the 32-bit value on the status reporting device.\r | |
24 | \r | |
25 | PostCode() must actively prevent recursion. If PostCode() is called while \r | |
26 | processing another any other Report Status Code Library function, then \r | |
27 | PostCode() must return Value immediately.\r | |
28 | \r | |
29 | @param Value The 32-bit value to write to the POST card.\r | |
30 | \r | |
31 | @return Value\r | |
32 | \r | |
33 | **/\r | |
34 | UINT32\r | |
35 | EFIAPI\r | |
36 | PostCode (\r | |
37 | IN UINT32 Value\r | |
38 | )\r | |
39 | {\r | |
40 | DEBUG((EFI_D_INFO, "POST %08x\n", Value));\r | |
41 | IoWrite8 (0x80, (UINT8)(Value));\r | |
42 | return Value;\r | |
43 | }\r | |
44 | \r | |
45 | \r | |
46 | /**\r | |
47 | Sends an 32-bit value to a POST and associated ASCII string.\r | |
48 | \r | |
49 | Sends the 32-bit value specified by Value to a POST card, and returns Value.\r | |
50 | If Description is not NULL, then the ASCII string specified by Description is \r | |
51 | also passed to the handler that displays the POST card value. Some \r | |
52 | implementations of this library function may perform I/O operations directly \r | |
53 | to a POST card device. Other implementations may send Value to ReportStatusCode(), \r | |
54 | and the status code reporting mechanism will eventually display the 32-bit \r | |
55 | value on the status reporting device. \r | |
56 | \r | |
57 | PostCodeWithDescription()must actively prevent recursion. If \r | |
58 | PostCodeWithDescription() is called while processing another any other Report \r | |
59 | Status Code Library function, then PostCodeWithDescription() must return Value \r | |
60 | immediately.\r | |
61 | \r | |
62 | @param Value The 32-bit value to write to the POST card.\r | |
63 | @param Description Pointer to an ASCII string that is a description of the \r | |
64 | POST code value. This is an optional parameter that may \r | |
65 | be NULL.\r | |
66 | \r | |
67 | @return Value\r | |
68 | \r | |
69 | **/\r | |
70 | UINT32\r | |
71 | EFIAPI\r | |
72 | PostCodeWithDescription (\r | |
73 | IN UINT32 Value,\r | |
74 | IN CONST CHAR8 *Description OPTIONAL\r | |
75 | )\r | |
76 | {\r | |
77 | DEBUG((EFI_D_INFO, "POST %08x - %s\n", Value, Description));\r | |
78 | IoWrite8 (0x80, (UINT8)(Value));\r | |
79 | return Value;\r | |
80 | }\r | |
81 | \r | |
82 | \r | |
83 | /**\r | |
84 | Returns TRUE if POST Codes are enabled.\r | |
85 | \r | |
86 | This function returns TRUE if the REPORT_STATUS_CODE_PROPERTY_POST_CODE_ENABLED \r | |
87 | bit of PcdReportStatusCodeProperyMask is set. Otherwise FALSE is returned.\r | |
88 | \r | |
89 | @retval TRUE The REPORT_STATUS_CODE_PROPERTY_POST_CODE_ENABLED bit of \r | |
90 | PcdReportStatusCodeProperyMask is set.\r | |
91 | @retval FALSE The REPORT_STATUS_CODE_PROPERTY_POST_CODE_ENABLED bit of \r | |
92 | PcdReportStatusCodeProperyMask is clear.\r | |
93 | \r | |
94 | **/\r | |
95 | BOOLEAN\r | |
96 | EFIAPI\r | |
97 | ReportPostCodeEnabled (\r | |
98 | VOID\r | |
99 | )\r | |
100 | {\r | |
101 | return ((PcdGet8(PcdReportStatusCodePropertyMask) & REPORT_STATUS_CODE_PROPERTY_POST_CODE_ENABLED) != 0);\r | |
102 | }\r | |
103 | \r | |
104 | \r | |
105 | /**\r | |
106 | Returns TRUE if POST code descriptions are enabled.\r | |
107 | \r | |
108 | This function returns TRUE if the \r | |
109 | REPORT_STATUS_CODE_PROPERTY_POST_CODE_DESCRIPTIONS_ENABLED bit of \r | |
110 | PcdReportStatusCodeProperyMask is set. Otherwise FALSE is returned.\r | |
111 | \r | |
112 | @retval TRUE The REPORT_STATUS_CODE_PROPERTY_POST_CODE_DESCRIPTIONS_ENABLED \r | |
113 | bit of PcdReportStatusCodeProperyMask is set.\r | |
114 | @retval FALSE The REPORT_STATUS_CODE_PROPERTY_POST_CODE_DESCRIPTIONS_ENABLED \r | |
115 | bit of PcdReportStatusCodeProperyMask is clear.\r | |
116 | \r | |
117 | **/\r | |
118 | BOOLEAN\r | |
119 | EFIAPI\r | |
120 | ReportPostCodeDescriptionEnabled (\r | |
121 | VOID\r | |
122 | )\r | |
123 | {\r | |
124 | return ((PcdGet8(PcdReportStatusCodePropertyMask) & REPORT_STATUS_CODE_PROPERTY_POST_CODE_DESCRIPTION_ENABLED) != 0);\r | |
125 | }\r |