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