]> git.proxmox.com Git - mirror_edk2.git/blob - EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/BasePostCodeLibDebug/PostCode.c
Update the copyright notice format
[mirror_edk2.git] / EdkCompatibilityPkg / Foundation / Library / EdkIIGlueLib / Library / BasePostCodeLibDebug / PostCode.c
1 /*++
2
3 Copyright (c) 2004 - 2006, Intel Corporation. All rights reserved.<BR>
4 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
8
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.
11
12
13 Module Name:
14
15 PostCode.c
16
17 Abstract:
18
19 Post Code functions
20
21 --*/
22
23 #include "EdkIIGlueBase.h"
24
25 /**
26 Sends an 32-bit value to a POST card.
27
28 Sends the 32-bit value specified by Value to a POST card, and returns Value.
29 Some implementations of this library function may perform I/O operations
30 directly to a POST card device. Other implementations may send Value to
31 ReportStatusCode(), and the status code reporting mechanism will eventually
32 display the 32-bit value on the status reporting device.
33
34 PostCode() must actively prevent recursion. If PostCode() is called while
35 processing another any other Report Status Code Library function, then
36 PostCode() must return Value immediately.
37
38 @param Value The 32-bit value to write to the POST card.
39
40 @return Value
41
42 **/
43 UINT32
44 EFIAPI
45 GluePostCode (
46 IN UINT32 Value
47 )
48 {
49 DEBUG((EFI_D_INFO, "POST %08x\n", Value));
50 return Value;
51 }
52
53
54 /**
55 Sends an 32-bit value to a POST and associated ASCII string.
56
57 Sends the 32-bit value specified by Value to a POST card, and returns Value.
58 If Description is not NULL, then the ASCII string specified by Description is
59 also passed to the handler that displays the POST card value. Some
60 implementations of this library function may perform I/O operations directly
61 to a POST card device. Other implementations may send Value to ReportStatusCode(),
62 and the status code reporting mechanism will eventually display the 32-bit
63 value on the status reporting device.
64
65 PostCodeWithDescription()must actively prevent recursion. If
66 PostCodeWithDescription() is called while processing another any other Report
67 Status Code Library function, then PostCodeWithDescription() must return Value
68 immediately.
69
70 @param Value The 32-bit value to write to the POST card.
71 @param Description Pointer to an ASCII string that is a description of the
72 POST code value. This is an optional parameter that may
73 be NULL.
74
75 @return Value
76
77 **/
78 UINT32
79 EFIAPI
80 GluePostCodeWithDescription (
81 IN UINT32 Value,
82 IN CONST CHAR8 *Description OPTIONAL
83 )
84 {
85 DEBUG((EFI_D_INFO, "POST %08x - %s\n", Value, Description));
86 return Value;
87 }
88
89
90 /**
91 Returns TRUE if POST Codes are enabled.
92
93 This function returns TRUE if the POST_CODE_PROPERTY_POST_CODE_ENABLED
94 bit of PcdPostCodePropertyMask is set. Otherwise FALSE is returned.
95
96 @retval TRUE The POST_CODE_PROPERTY_POST_CODE_ENABLED bit of
97 PcdPostCodeProperyMask is set.
98 @retval FALSE The POST_CODE_PROPERTY_POST_CODE_ENABLED bit of
99 PcdPostCodeProperyMask is clear.
100
101 **/
102 BOOLEAN
103 EFIAPI
104 GluePostCodeEnabled (
105 VOID
106 )
107 {
108 return (BOOLEAN) ((PcdGet8(PcdPostCodePropertyMask) & POST_CODE_PROPERTY_POST_CODE_ENABLED) != 0);
109 }
110
111
112 /**
113 Returns TRUE if POST code descriptions are enabled.
114
115 This function returns TRUE if the POST_CODE_PROPERTY_POST_CODE_ENABLED
116 bit of PcdPostCodePropertyMask is set. Otherwise FALSE is returned.
117
118 @retval TRUE The POST_CODE_PROPERTY_POST_CODE_ENABLED bit of
119 PcdPostCodeProperyMask is set.
120 @retval FALSE The POST_CODE_PROPERTY_POST_CODE_ENABLED bit of
121 PcdPostCodeProperyMask is clear.
122
123 **/
124 BOOLEAN
125 EFIAPI
126 GluePostCodeDescriptionEnabled (
127 VOID
128 )
129 {
130 return (BOOLEAN) ((PcdGet8(PcdPostCodePropertyMask) & POST_CODE_PROPERTY_POST_CODE_ENABLED) != 0);
131 }