TianoCore EDK2 master
Loading...
Searching...
No Matches
WsmtGenerator.c File Reference

Go to the source code of this file.

Macros

#define WSMT_PROTECTION_VALID_FLAGS
 
#define WSMT_GENERATOR_REVISION   CREATE_REVISION (1, 0)
 

Functions

 GET_OBJECT_LIST (EObjNameSpaceX64, EX64ObjWsmtFlagsInfo, CM_X64_WSMT_FLAGS_INFO)
 
STATIC EFI_STATUS EFIAPI WsmtAddProtectionFlagsInfo (IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST CfgMgrProtocol)
 
STATIC EFI_STATUS EFIAPI BuildWsmtTable (IN CONST ACPI_TABLE_GENERATOR *CONST This, IN CONST CM_STD_OBJ_ACPI_TABLE_INFO *CONST AcpiTableInfo, IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST CfgMgrProtocol, OUT EFI_ACPI_DESCRIPTION_HEADER **CONST Table)
 
EFI_STATUS EFIAPI AcpiWsmtLibConstructor (IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
 
EFI_STATUS EFIAPI AcpiWsmtLibDestructor (IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
 

Variables

STATIC EFI_ACPI_WSMT_TABLE AcpiWsmt
 
STATIC CONST ACPI_TABLE_GENERATOR WsmtGenerator
 

Detailed Description

WSMT Table Generator Implementation.

This file implements the WSMT Table Generator. The WSMT table is used to specify the security mitigation that are enabled in the Windows OS.

Copyright (c) 2024 Advanced Micro Devices, Inc. All rights reserved.

SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file WsmtGenerator.c.

Macro Definition Documentation

◆ WSMT_GENERATOR_REVISION

#define WSMT_GENERATOR_REVISION   CREATE_REVISION (1, 0)

This macro defines the WSMT Table Generator revision.

Definition at line 208 of file WsmtGenerator.c.

◆ WSMT_PROTECTION_VALID_FLAGS

#define WSMT_PROTECTION_VALID_FLAGS
Value:
(EFI_WSMT_PROTECTION_FLAGS_FIXED_COMM_BUFFERS | \
EFI_WSMT_PROTECTION_FLAGS_COMM_BUFFER_NESTED_PTR_PROTECTION | \
EFI_WSMT_PROTECTION_FLAGS_SYSTEM_RESOURCE_PROTECTION)

Definition at line 24 of file WsmtGenerator.c.

Function Documentation

◆ AcpiWsmtLibConstructor()

EFI_STATUS EFIAPI AcpiWsmtLibConstructor ( IN EFI_HANDLE  ImageHandle,
IN EFI_SYSTEM_TABLE SystemTable 
)

Register the Generator with the ACPI Table Factory.

Parameters
[in]ImageHandleThe handle to the image.
[in]SystemTablePointer to the System Table.
Return values
EFI_SUCCESSThe Generator is registered.
EFI_INVALID_PARAMETERA parameter is invalid.
EFI_ALREADY_STARTEDThe Generator for the Table ID is already registered.

Definition at line 253 of file WsmtGenerator.c.

◆ AcpiWsmtLibDestructor()

EFI_STATUS EFIAPI AcpiWsmtLibDestructor ( IN EFI_HANDLE  ImageHandle,
IN EFI_SYSTEM_TABLE SystemTable 
)

Deregister the Generator from the ACPI Table Factory.

Parameters
[in]ImageHandleThe handle to the image.
[in]SystemTablePointer to the System Table.
Return values
EFI_SUCCESSThe Generator is deregistered.
EFI_INVALID_PARAMETERA parameter is invalid.
EFI_NOT_FOUNDThe Generator is not registered.

Definition at line 277 of file WsmtGenerator.c.

◆ BuildWsmtTable()

Construct the WSMT table.

This function invokes the Configuration Manager protocol interface to get the required information for generating the ACPI table.

If this function allocates any resources then they must be freed in the FreeXXXXTableResources function.

Parameters
[in]ThisPointer to the table generator.
[in]AcpiTableInfoPointer to the ACPI Table Info.
[in]CfgMgrProtocolPointer to the Configuration Manager Protocol Interface.
[out]TablePointer to the constructed ACPI Table.
Return values
EFI_SUCCESSTable generated successfully.
EFI_INVALID_PARAMETERA parameter is invalid.
EFI_NOT_FOUNDThe required object was not found.
EFI_BAD_BUFFER_SIZEThe size returned by the Configuration Manager is less than the Object size for the requested object.

Definition at line 147 of file WsmtGenerator.c.

◆ GET_OBJECT_LIST()

This macro expands to a function that retrieves the WSMT protection flags information from the Configuration Manager.

◆ WsmtAddProtectionFlagsInfo()

STATIC EFI_STATUS EFIAPI WsmtAddProtectionFlagsInfo ( IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST  CfgMgrProtocol)

Update the protection flags information in the WSMT Table.

Parameters
[in]CfgMgrProtocolPointer to the Configuration Manager Protocol Interface.
Return values
EFI_SUCCESSSuccess.
EFI_INVALID_PARAMETERA parameter is invalid.
EFI_NOT_FOUNDThe required object was not found.
EFI_BAD_BUFFER_SIZEThe size returned by the Configuration Manager is less than the Object size for the requested object.
EFI_UNSUPPORTEDIf invalid protection flags provided.

Definition at line 67 of file WsmtGenerator.c.

Variable Documentation

◆ AcpiWsmt

Initial value:
= {
EFI_ACPI_WINDOWS_SMM_SECURITY_MITIGATION_TABLE_SIGNATURE,
EFI_WSMT_TABLE_REVISION
),
0
}
#define ACPI_HEADER(Signature, Type, Revision)

The ACPI WSMT Table.

Definition at line 41 of file WsmtGenerator.c.

◆ WsmtGenerator

Initial value:
= {
L"ACPI.STD.WSMT.GENERATOR",
EFI_ACPI_WINDOWS_SMM_SECURITY_MITIGATION_TABLE_SIGNATURE,
EFI_WSMT_TABLE_REVISION,
EFI_WSMT_TABLE_REVISION,
}
#define CREATE_STD_ACPI_TABLE_GEN_ID(TableId)
#define TABLE_GENERATOR_CREATOR_ID
@ EStdAcpiTableIdWsmt
WSMT Generator.
#define NULL
Definition: Base.h:319
#define WSMT_GENERATOR_REVISION
STATIC EFI_STATUS EFIAPI BuildWsmtTable(IN CONST ACPI_TABLE_GENERATOR *CONST This, IN CONST CM_STD_OBJ_ACPI_TABLE_INFO *CONST AcpiTableInfo, IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST CfgMgrProtocol, OUT EFI_ACPI_DESCRIPTION_HEADER **CONST Table)

The interface for the WSMT Table Generator.

Definition at line 214 of file WsmtGenerator.c.