TianoCore EDK2 master
Loading...
Searching...
No Matches
WsmtParser.c
Go to the documentation of this file.
1
12#include <Library/UefiLib.h>
14#include "AcpiParser.h"
15
17
28VOID
29EFIAPI
31 IN UINT8 *Ptr,
32 IN UINT32 Length,
33 IN VOID *Context
34 )
35{
36 UINT32 ProtectionFlag;
37
38 ProtectionFlag = *(UINT32 *)Ptr;
39
40 if ((ProtectionFlag & EFI_WSMT_PROTECTION_FLAGS_COMM_BUFFER_NESTED_PTR_PROTECTION) \
41 == EFI_WSMT_PROTECTION_FLAGS_COMM_BUFFER_NESTED_PTR_PROTECTION)
42 {
43 if ((ProtectionFlag & EFI_WSMT_PROTECTION_FLAGS_FIXED_COMM_BUFFERS) \
44 != EFI_WSMT_PROTECTION_FLAGS_FIXED_COMM_BUFFERS)
45 {
47 Print (L"ERROR: COMM_BUFFER_NESTED_PTR_PROTECTION is set but FIXED_COMM_BUFFERS is not set.\n");
48 }
49 }
50}
51
61VOID
62EFIAPI
64 IN UINT8 *Ptr,
65 IN UINT32 Length,
66 IN VOID *Context
67 )
68{
69 UINT32 ProtectionFlag;
70
71 ProtectionFlag = *(UINT32 *)Ptr;
72
73 if ((ProtectionFlag & 0xFFFFFFF8) != 0) {
75 Print (L"ERROR: Reserved bits are not zero.\n");
76 }
77}
78
83 { L"FIXED_COMM_BUFFERS ", 1, 0, L"0x%x", NULL, NULL, NULL, NULL },
84 { L"COMM_BUFFER_NESTED_PTR_PROTECTION ", 1, 1, L"0x%x", NULL, NULL, NULL, NULL },
85 { L"SYSTEM_RESOURCE_PROTECTION ", 1, 2, L"0x%x", NULL, NULL, NULL, NULL },
86 { L"Reserved ", 29, 3, L"0x%x", NULL, NULL, ValidateReserved, NULL },
87};
88
96VOID
97EFIAPI
99 IN CONST CHAR16 *Format OPTIONAL,
100 IN UINT8 *Ptr,
101 IN UINT32 Length
102 )
103{
104 if (Format != NULL) {
105 Print (Format, *(UINT32 *)Ptr);
106 return;
107 }
108
109 Print (L"0x%X\n", *(UINT32 *)Ptr);
111 TRUE,
112 2,
113 NULL,
114 Ptr,
115 4,
117 );
118}
119
124 PARSE_ACPI_HEADER (&AcpiHdrInfo),
125 { L"Protection Flag", 4,36, NULL, DumpWsmtProtectionFlag, NULL, ValidateWsmtProtectionFlag, NULL }
126};
127
136VOID
137EFIAPI
139 IN BOOLEAN Trace,
140 IN UINT8 *Ptr,
141 IN UINT32 AcpiTableLength,
142 IN UINT8 AcpiTableRevision
143 )
144{
145 ParseAcpi (
146 Trace,
147 0,
148 "WSMT",
149 Ptr,
150 AcpiTableLength,
152 );
153}
VOID EFIAPI IncrementErrorCount(VOID)
Definition: AcpiParser.c:83
UINT32 EFIAPI ParseAcpi(IN BOOLEAN Trace, IN UINT32 Indent, IN CONST CHAR8 *AsciiName OPTIONAL, IN UINT8 *Ptr, IN UINT32 Length, IN CONST ACPI_PARSER *Parser, IN UINT32 ParserItems)
Definition: AcpiParser.c:683
UINT32 EFIAPI ParseAcpiBitFields(IN BOOLEAN Trace, IN UINT32 Indent, IN CONST CHAR8 *AsciiName OPTIONAL, IN UINT8 *Ptr, IN UINT32 Length, IN CONST ACPI_PARSER *Parser, IN UINT32 ParserItems)
Definition: AcpiParser.c:968
#define PARSER_PARAMS(Parser)
Definition: AcpiParser.h:494
#define PARSE_ACPI_HEADER(Info)
Definition: AcpiParser.h:501
#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 IN
Definition: Base.h:279
UINTN EFIAPI Print(IN CONST CHAR16 *Format,...)
Definition: UefiLibPrint.c:113
VOID EFIAPI ParseAcpiWsmt(IN BOOLEAN Trace, IN UINT8 *Ptr, IN UINT32 AcpiTableLength, IN UINT8 AcpiTableRevision)
Definition: WsmtParser.c:138
STATIC VOID EFIAPI ValidateWsmtProtectionFlag(IN UINT8 *Ptr, IN UINT32 Length, IN VOID *Context)
Definition: WsmtParser.c:30
STATIC VOID EFIAPI ValidateReserved(IN UINT8 *Ptr, IN UINT32 Length, IN VOID *Context)
Definition: WsmtParser.c:63
STATIC CONST ACPI_PARSER WsmtParser[]
Definition: WsmtParser.c:123
VOID EFIAPI DumpWsmtProtectionFlag(IN CONST CHAR16 *Format OPTIONAL, IN UINT8 *Ptr, IN UINT32 Length)
Definition: WsmtParser.c:98
STATIC CONST ACPI_PARSER WsmtProtectionFlagParser[]
Definition: WsmtParser.c:82