TianoCore EDK2 master
Loading...
Searching...
No Matches
AcpiViewConfig.c
Go to the documentation of this file.
1
9#include <Library/DebugLib.h>
10
11#include "AcpiViewConfig.h"
12
13// Report variables
14STATIC BOOLEAN mConsistencyCheck;
15STATIC BOOLEAN mColourHighlighting;
16STATIC EREPORT_OPTION mReportType;
17STATIC BOOLEAN mMandatoryTableValidate;
18STATIC UINTN mMandatoryTableSpec;
19
20// User selection of which ACPI table should be checked
21SELECTED_ACPI_TABLE mSelectedAcpiTable;
22
26VOID
27EFIAPI
29 VOID
30 )
31{
32 mReportType = ReportAll;
33 mSelectedAcpiTable.Type = 0;
34 mSelectedAcpiTable.Name = NULL;
35 mSelectedAcpiTable.Found = FALSE;
36 mConsistencyCheck = TRUE;
37 mMandatoryTableValidate = FALSE;
38 mMandatoryTableSpec = 0;
39}
40
50UINT32
52 IN CONST CHAR16 *Str
53 )
54{
55 UINT8 Index;
56 CHAR8 Ptr[4];
57
58 ZeroMem (Ptr, sizeof (Ptr));
59 Index = 0;
60
61 // Convert to Upper case and convert to ASCII
62 while ((Index < 4) && (Str[Index] != 0)) {
63 if ((Str[Index] >= L'a') && (Str[Index] <= L'z')) {
64 Ptr[Index] = (CHAR8)(Str[Index] - (L'a' - L'A'));
65 } else {
66 Ptr[Index] = (CHAR8)Str[Index];
67 }
68
69 Index++;
70 }
71
72 return *(UINT32 *)Ptr;
73}
74
82VOID
83EFIAPI
85 IN CONST CHAR16 *TableName
86 )
87{
88 ASSERT (TableName != NULL);
89
90 mSelectedAcpiTable.Name = TableName;
91 mSelectedAcpiTable.Type = ConvertStrToAcpiSignature (mSelectedAcpiTable.Name);
92}
93
99VOID
100EFIAPI
102 OUT SELECTED_ACPI_TABLE **SelectedAcpiTable
103 )
104{
105 *SelectedAcpiTable = &mSelectedAcpiTable;
106}
107
113BOOLEAN
114EFIAPI
116 VOID
117 )
118{
119 return mColourHighlighting;
120}
121
127VOID
128EFIAPI
130 BOOLEAN Highlight
131 )
132{
133 mColourHighlighting = Highlight;
134}
135
141BOOLEAN
142EFIAPI
144 VOID
145 )
146{
147 return mConsistencyCheck;
148}
149
155VOID
156EFIAPI
158 BOOLEAN ConsistencyChecking
159 )
160{
161 mConsistencyCheck = ConsistencyChecking;
162}
163
170EFIAPI
172 VOID
173 )
174{
175 return mReportType;
176}
177
183VOID
184EFIAPI
186 EREPORT_OPTION ReportType
187 )
188{
189 mReportType = ReportType;
190}
191
197BOOLEAN
198EFIAPI
200 VOID
201 )
202{
203 return mMandatoryTableValidate;
204}
205
211VOID
212EFIAPI
214 BOOLEAN Validate
215 )
216{
217 mMandatoryTableValidate = Validate;
218}
219
226UINTN
227EFIAPI
229 VOID
230 )
231{
232 return mMandatoryTableSpec;
233}
234
241VOID
242EFIAPI
244 UINTN Spec
245 )
246{
247 mMandatoryTableSpec = Spec;
248}
UINT64 UINTN
EREPORT_OPTION EFIAPI GetReportOption(VOID)
UINTN EFIAPI GetMandatoryTableSpec(VOID)
VOID EFIAPI SetMandatoryTableSpec(UINTN Spec)
VOID EFIAPI SetMandatoryTableValidate(BOOLEAN Validate)
VOID EFIAPI SetColourHighlighting(BOOLEAN Highlight)
VOID EFIAPI SelectAcpiTable(IN CONST CHAR16 *TableName)
STATIC UINT32 ConvertStrToAcpiSignature(IN CONST CHAR16 *Str)
BOOLEAN EFIAPI GetConsistencyChecking(VOID)
BOOLEAN EFIAPI GetColourHighlighting(VOID)
BOOLEAN EFIAPI GetMandatoryTableValidate(VOID)
VOID EFIAPI SetReportOption(EREPORT_OPTION ReportType)
VOID EFIAPI GetSelectedAcpiTable(OUT SELECTED_ACPI_TABLE **SelectedAcpiTable)
VOID EFIAPI AcpiConfigSetDefaults(VOID)
VOID EFIAPI SetConsistencyChecking(BOOLEAN ConsistencyChecking)
EREPORT_OPTION
@ ReportAll
Report All tables.
VOID *EFIAPI ZeroMem(OUT VOID *Buffer, IN UINTN Length)
#define NULL
Definition: Base.h:319
#define CONST
Definition: Base.h:259
#define STATIC
Definition: Base.h:264
#define TRUE
Definition: Base.h:301
#define FALSE
Definition: Base.h:307
#define IN
Definition: Base.h:279
#define OUT
Definition: Base.h:284
BOOLEAN Found
The selected table has been found in the system.
CONST CHAR16 * Name
User friendly name of the selected ACPI table.
UINT32 Type
32bit signature of the selected ACPI table.