SecurityPkg: Apply uncrustify changes
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3737 Apply uncrustify changes to .c/.h files in the SecurityPkg package Cc: Andrew Fish <afish@apple.com> Cc: Leif Lindholm <leif@nuviainc.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com> Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
This commit is contained in:
committed by
mergify[bot]
parent
39de741e2d
commit
c411b485b6
@@ -38,29 +38,29 @@ TCG_NVS *mTcgNvs;
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
PhysicalPresenceCallback (
|
||||
IN EFI_HANDLE DispatchHandle,
|
||||
IN CONST VOID *Context,
|
||||
IN OUT VOID *CommBuffer,
|
||||
IN OUT UINTN *CommBufferSize
|
||||
IN EFI_HANDLE DispatchHandle,
|
||||
IN CONST VOID *Context,
|
||||
IN OUT VOID *CommBuffer,
|
||||
IN OUT UINTN *CommBufferSize
|
||||
)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
UINTN DataSize;
|
||||
EFI_PHYSICAL_PRESENCE PpData;
|
||||
EFI_PHYSICAL_PRESENCE_FLAGS Flags;
|
||||
BOOLEAN RequestConfirmed;
|
||||
EFI_STATUS Status;
|
||||
UINTN DataSize;
|
||||
EFI_PHYSICAL_PRESENCE PpData;
|
||||
EFI_PHYSICAL_PRESENCE_FLAGS Flags;
|
||||
BOOLEAN RequestConfirmed;
|
||||
|
||||
//
|
||||
// Get the Physical Presence variable
|
||||
//
|
||||
DataSize = sizeof (EFI_PHYSICAL_PRESENCE);
|
||||
Status = mSmmVariable->SmmGetVariable (
|
||||
PHYSICAL_PRESENCE_VARIABLE,
|
||||
&gEfiPhysicalPresenceGuid,
|
||||
NULL,
|
||||
&DataSize,
|
||||
&PpData
|
||||
);
|
||||
Status = mSmmVariable->SmmGetVariable (
|
||||
PHYSICAL_PRESENCE_VARIABLE,
|
||||
&gEfiPhysicalPresenceGuid,
|
||||
NULL,
|
||||
&DataSize,
|
||||
&PpData
|
||||
);
|
||||
|
||||
DEBUG ((DEBUG_INFO, "[TPM] PP callback, Parameter = %x\n", mTcgNvs->PhysicalPresence.Parameter));
|
||||
if (mTcgNvs->PhysicalPresence.Parameter == ACPI_FUNCTION_RETURN_REQUEST_RESPONSE_TO_OS) {
|
||||
@@ -71,16 +71,19 @@ PhysicalPresenceCallback (
|
||||
DEBUG ((DEBUG_ERROR, "[TPM] Get PP variable failure! Status = %r\n", Status));
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
mTcgNvs->PhysicalPresence.ReturnCode = PP_RETURN_TPM_OPERATION_RESPONSE_SUCCESS;
|
||||
mTcgNvs->PhysicalPresence.LastRequest = PpData.LastPPRequest;
|
||||
mTcgNvs->PhysicalPresence.Response = PpData.PPResponse;
|
||||
} else if ((mTcgNvs->PhysicalPresence.Parameter == ACPI_FUNCTION_SUBMIT_REQUEST_TO_BIOS)
|
||||
|| (mTcgNvs->PhysicalPresence.Parameter == ACPI_FUNCTION_SUBMIT_REQUEST_TO_BIOS_2)) {
|
||||
} else if ( (mTcgNvs->PhysicalPresence.Parameter == ACPI_FUNCTION_SUBMIT_REQUEST_TO_BIOS)
|
||||
|| (mTcgNvs->PhysicalPresence.Parameter == ACPI_FUNCTION_SUBMIT_REQUEST_TO_BIOS_2))
|
||||
{
|
||||
if (EFI_ERROR (Status)) {
|
||||
mTcgNvs->PhysicalPresence.ReturnCode = TCG_PP_SUBMIT_REQUEST_TO_PREOS_GENERAL_FAILURE;
|
||||
DEBUG ((DEBUG_ERROR, "[TPM] Get PP variable failure! Status = %r\n", Status));
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
if (mTcgNvs->PhysicalPresence.Request == PHYSICAL_PRESENCE_SET_OPERATOR_AUTH) {
|
||||
//
|
||||
// This command requires UI to prompt user for Auth data.
|
||||
@@ -90,35 +93,37 @@ PhysicalPresenceCallback (
|
||||
}
|
||||
|
||||
if (PpData.PPRequest != mTcgNvs->PhysicalPresence.Request) {
|
||||
PpData.PPRequest = (UINT8) mTcgNvs->PhysicalPresence.Request;
|
||||
DataSize = sizeof (EFI_PHYSICAL_PRESENCE);
|
||||
Status = mSmmVariable->SmmSetVariable (
|
||||
PHYSICAL_PRESENCE_VARIABLE,
|
||||
&gEfiPhysicalPresenceGuid,
|
||||
EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,
|
||||
DataSize,
|
||||
&PpData
|
||||
);
|
||||
PpData.PPRequest = (UINT8)mTcgNvs->PhysicalPresence.Request;
|
||||
DataSize = sizeof (EFI_PHYSICAL_PRESENCE);
|
||||
Status = mSmmVariable->SmmSetVariable (
|
||||
PHYSICAL_PRESENCE_VARIABLE,
|
||||
&gEfiPhysicalPresenceGuid,
|
||||
EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,
|
||||
DataSize,
|
||||
&PpData
|
||||
);
|
||||
}
|
||||
|
||||
if (EFI_ERROR (Status)) {
|
||||
mTcgNvs->PhysicalPresence.ReturnCode = TCG_PP_SUBMIT_REQUEST_TO_PREOS_GENERAL_FAILURE;
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
mTcgNvs->PhysicalPresence.ReturnCode = TCG_PP_SUBMIT_REQUEST_TO_PREOS_SUCCESS;
|
||||
|
||||
if (mTcgNvs->PhysicalPresence.Request >= TCG_PHYSICAL_PRESENCE_VENDOR_SPECIFIC_OPERATION) {
|
||||
DataSize = sizeof (EFI_PHYSICAL_PRESENCE_FLAGS);
|
||||
Status = mSmmVariable->SmmGetVariable (
|
||||
PHYSICAL_PRESENCE_FLAGS_VARIABLE,
|
||||
&gEfiPhysicalPresenceGuid,
|
||||
NULL,
|
||||
&DataSize,
|
||||
&Flags
|
||||
);
|
||||
Status = mSmmVariable->SmmGetVariable (
|
||||
PHYSICAL_PRESENCE_FLAGS_VARIABLE,
|
||||
&gEfiPhysicalPresenceGuid,
|
||||
NULL,
|
||||
&DataSize,
|
||||
&Flags
|
||||
);
|
||||
if (EFI_ERROR (Status)) {
|
||||
Flags.PPFlags = TCG_BIOS_TPM_MANAGEMENT_FLAG_NO_PPI_PROVISION;
|
||||
}
|
||||
|
||||
mTcgNvs->PhysicalPresence.ReturnCode = TcgPpVendorLibSubmitRequestToPreOSFunction (mTcgNvs->PhysicalPresence.Request, Flags.PPFlags);
|
||||
}
|
||||
} else if (mTcgNvs->PhysicalPresence.Parameter == ACPI_FUNCTION_GET_USER_CONFIRMATION_STATUS_FOR_REQUEST) {
|
||||
@@ -127,17 +132,18 @@ PhysicalPresenceCallback (
|
||||
DEBUG ((DEBUG_ERROR, "[TPM] Get PP variable failure! Status = %r\n", Status));
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
//
|
||||
// Get the Physical Presence flags
|
||||
//
|
||||
DataSize = sizeof (EFI_PHYSICAL_PRESENCE_FLAGS);
|
||||
Status = mSmmVariable->SmmGetVariable (
|
||||
PHYSICAL_PRESENCE_FLAGS_VARIABLE,
|
||||
&gEfiPhysicalPresenceGuid,
|
||||
NULL,
|
||||
&DataSize,
|
||||
&Flags
|
||||
);
|
||||
Status = mSmmVariable->SmmGetVariable (
|
||||
PHYSICAL_PRESENCE_FLAGS_VARIABLE,
|
||||
&gEfiPhysicalPresenceGuid,
|
||||
NULL,
|
||||
&DataSize,
|
||||
&Flags
|
||||
);
|
||||
if (EFI_ERROR (Status)) {
|
||||
mTcgNvs->PhysicalPresence.ReturnCode = TCG_PP_GET_USER_CONFIRMATION_BLOCKED_BY_BIOS_CONFIGURATION;
|
||||
DEBUG ((DEBUG_ERROR, "[TPM] Get PP flags failure! Status = %r\n", Status));
|
||||
@@ -160,6 +166,7 @@ PhysicalPresenceCallback (
|
||||
if ((Flags.PPFlags & TCG_BIOS_TPM_MANAGEMENT_FLAG_NO_PPI_PROVISION) != 0) {
|
||||
RequestConfirmed = TRUE;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case PHYSICAL_PRESENCE_CLEAR:
|
||||
@@ -167,19 +174,22 @@ PhysicalPresenceCallback (
|
||||
if ((Flags.PPFlags & TCG_BIOS_TPM_MANAGEMENT_FLAG_NO_PPI_CLEAR) != 0) {
|
||||
RequestConfirmed = TRUE;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case PHYSICAL_PRESENCE_DEFERRED_PP_UNOWNERED_FIELD_UPGRADE:
|
||||
if ((Flags.PPFlags & TCG_BIOS_TPM_MANAGEMENT_FLAG_NO_PPI_MAINTENANCE) != 0) {
|
||||
RequestConfirmed = TRUE;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case PHYSICAL_PRESENCE_ENABLE_ACTIVATE_CLEAR_ENABLE_ACTIVATE:
|
||||
case PHYSICAL_PRESENCE_CLEAR_ENABLE_ACTIVATE:
|
||||
if ((Flags.PPFlags & TCG_BIOS_TPM_MANAGEMENT_FLAG_NO_PPI_CLEAR) != 0 && (Flags.PPFlags & TCG_BIOS_TPM_MANAGEMENT_FLAG_NO_PPI_PROVISION) != 0) {
|
||||
if (((Flags.PPFlags & TCG_BIOS_TPM_MANAGEMENT_FLAG_NO_PPI_CLEAR) != 0) && ((Flags.PPFlags & TCG_BIOS_TPM_MANAGEMENT_FLAG_NO_PPI_PROVISION) != 0)) {
|
||||
RequestConfirmed = TRUE;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case PHYSICAL_PRESENCE_SET_NO_PPI_PROVISION_FALSE:
|
||||
@@ -204,6 +214,7 @@ PhysicalPresenceCallback (
|
||||
} else {
|
||||
mTcgNvs->PhysicalPresence.ReturnCode = TCG_PP_GET_USER_CONFIRMATION_ALLOWED_AND_PPUSER_REQUIRED;
|
||||
}
|
||||
|
||||
if (mTcgNvs->PhysicalPresence.Request >= TCG_PHYSICAL_PRESENCE_VENDOR_SPECIFIC_OPERATION) {
|
||||
mTcgNvs->PhysicalPresence.ReturnCode = TcgPpVendorLibGetUserConfirmationStatusFunction (mTcgNvs->PhysicalPresence.Request, Flags.PPFlags);
|
||||
}
|
||||
@@ -212,7 +223,6 @@ PhysicalPresenceCallback (
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
Software SMI callback for MemoryClear which is called from ACPI method.
|
||||
|
||||
@@ -233,28 +243,28 @@ PhysicalPresenceCallback (
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
MemoryClearCallback (
|
||||
IN EFI_HANDLE DispatchHandle,
|
||||
IN CONST VOID *Context,
|
||||
IN OUT VOID *CommBuffer,
|
||||
IN OUT UINTN *CommBufferSize
|
||||
IN EFI_HANDLE DispatchHandle,
|
||||
IN CONST VOID *Context,
|
||||
IN OUT VOID *CommBuffer,
|
||||
IN OUT UINTN *CommBufferSize
|
||||
)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
UINTN DataSize;
|
||||
UINT8 MorControl;
|
||||
EFI_STATUS Status;
|
||||
UINTN DataSize;
|
||||
UINT8 MorControl;
|
||||
|
||||
mTcgNvs->MemoryClear.ReturnCode = MOR_REQUEST_SUCCESS;
|
||||
if (mTcgNvs->MemoryClear.Parameter == ACPI_FUNCTION_DSM_MEMORY_CLEAR_INTERFACE) {
|
||||
MorControl = (UINT8) mTcgNvs->MemoryClear.Request;
|
||||
MorControl = (UINT8)mTcgNvs->MemoryClear.Request;
|
||||
} else if (mTcgNvs->MemoryClear.Parameter == ACPI_FUNCTION_PTS_CLEAR_MOR_BIT) {
|
||||
DataSize = sizeof (UINT8);
|
||||
Status = mSmmVariable->SmmGetVariable (
|
||||
MEMORY_OVERWRITE_REQUEST_VARIABLE_NAME,
|
||||
&gEfiMemoryOverwriteControlDataGuid,
|
||||
NULL,
|
||||
&DataSize,
|
||||
&MorControl
|
||||
);
|
||||
Status = mSmmVariable->SmmGetVariable (
|
||||
MEMORY_OVERWRITE_REQUEST_VARIABLE_NAME,
|
||||
&gEfiMemoryOverwriteControlDataGuid,
|
||||
NULL,
|
||||
&DataSize,
|
||||
&MorControl
|
||||
);
|
||||
if (EFI_ERROR (Status)) {
|
||||
mTcgNvs->MemoryClear.ReturnCode = MOR_REQUEST_GENERAL_FAILURE;
|
||||
DEBUG ((DEBUG_ERROR, "[TPM] Get MOR variable failure! Status = %r\n", Status));
|
||||
@@ -264,6 +274,7 @@ MemoryClearCallback (
|
||||
if (MOR_CLEAR_MEMORY_VALUE (MorControl) == 0x0) {
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
MorControl &= ~MOR_CLEAR_MEMORY_BIT_MASK;
|
||||
} else {
|
||||
mTcgNvs->MemoryClear.ReturnCode = MOR_REQUEST_GENERAL_FAILURE;
|
||||
@@ -272,13 +283,13 @@ MemoryClearCallback (
|
||||
}
|
||||
|
||||
DataSize = sizeof (UINT8);
|
||||
Status = mSmmVariable->SmmSetVariable (
|
||||
MEMORY_OVERWRITE_REQUEST_VARIABLE_NAME,
|
||||
&gEfiMemoryOverwriteControlDataGuid,
|
||||
EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,
|
||||
DataSize,
|
||||
&MorControl
|
||||
);
|
||||
Status = mSmmVariable->SmmSetVariable (
|
||||
MEMORY_OVERWRITE_REQUEST_VARIABLE_NAME,
|
||||
&gEfiMemoryOverwriteControlDataGuid,
|
||||
EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,
|
||||
DataSize,
|
||||
&MorControl
|
||||
);
|
||||
if (EFI_ERROR (Status)) {
|
||||
mTcgNvs->MemoryClear.ReturnCode = MOR_REQUEST_GENERAL_FAILURE;
|
||||
DEBUG ((DEBUG_ERROR, "[TPM] Set MOR variable failure! Status = %r\n", Status));
|
||||
@@ -300,38 +311,39 @@ MemoryClearCallback (
|
||||
**/
|
||||
VOID *
|
||||
AssignOpRegion (
|
||||
EFI_ACPI_DESCRIPTION_HEADER *Table,
|
||||
UINT32 Name,
|
||||
UINT16 Size
|
||||
EFI_ACPI_DESCRIPTION_HEADER *Table,
|
||||
UINT32 Name,
|
||||
UINT16 Size
|
||||
)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
AML_OP_REGION_32_8 *OpRegion;
|
||||
EFI_PHYSICAL_ADDRESS MemoryAddress;
|
||||
EFI_STATUS Status;
|
||||
AML_OP_REGION_32_8 *OpRegion;
|
||||
EFI_PHYSICAL_ADDRESS MemoryAddress;
|
||||
|
||||
MemoryAddress = SIZE_4GB - 1;
|
||||
|
||||
//
|
||||
// Patch some pointers for the ASL code before loading the SSDT.
|
||||
//
|
||||
for (OpRegion = (AML_OP_REGION_32_8 *) (Table + 1);
|
||||
OpRegion <= (AML_OP_REGION_32_8 *) ((UINT8 *) Table + Table->Length);
|
||||
OpRegion = (AML_OP_REGION_32_8 *) ((UINT8 *) OpRegion + 1)) {
|
||||
for (OpRegion = (AML_OP_REGION_32_8 *)(Table + 1);
|
||||
OpRegion <= (AML_OP_REGION_32_8 *)((UINT8 *)Table + Table->Length);
|
||||
OpRegion = (AML_OP_REGION_32_8 *)((UINT8 *)OpRegion + 1))
|
||||
{
|
||||
if ((OpRegion->OpRegionOp == AML_EXT_REGION_OP) &&
|
||||
(OpRegion->NameString == Name) &&
|
||||
(OpRegion->DWordPrefix == AML_DWORD_PREFIX) &&
|
||||
(OpRegion->BytePrefix == AML_BYTE_PREFIX)) {
|
||||
|
||||
Status = gBS->AllocatePages(AllocateMaxAddress, EfiACPIMemoryNVS, EFI_SIZE_TO_PAGES (Size), &MemoryAddress);
|
||||
(OpRegion->BytePrefix == AML_BYTE_PREFIX))
|
||||
{
|
||||
Status = gBS->AllocatePages (AllocateMaxAddress, EfiACPIMemoryNVS, EFI_SIZE_TO_PAGES (Size), &MemoryAddress);
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
ZeroMem ((VOID *)(UINTN)MemoryAddress, Size);
|
||||
OpRegion->RegionOffset = (UINT32) (UINTN) MemoryAddress;
|
||||
OpRegion->RegionLen = (UINT8) Size;
|
||||
OpRegion->RegionOffset = (UINT32)(UINTN)MemoryAddress;
|
||||
OpRegion->RegionLen = (UINT8)Size;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return (VOID *) (UINTN) MemoryAddress;
|
||||
return (VOID *)(UINTN)MemoryAddress;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -346,26 +358,25 @@ PublishAcpiTable (
|
||||
VOID
|
||||
)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
EFI_ACPI_TABLE_PROTOCOL *AcpiTable;
|
||||
UINTN TableKey;
|
||||
EFI_ACPI_DESCRIPTION_HEADER *Table;
|
||||
UINTN TableSize;
|
||||
EFI_STATUS Status;
|
||||
EFI_ACPI_TABLE_PROTOCOL *AcpiTable;
|
||||
UINTN TableKey;
|
||||
EFI_ACPI_DESCRIPTION_HEADER *Table;
|
||||
UINTN TableSize;
|
||||
|
||||
Status = GetSectionFromFv (
|
||||
&gEfiCallerIdGuid,
|
||||
EFI_SECTION_RAW,
|
||||
0,
|
||||
(VOID **) &Table,
|
||||
(VOID **)&Table,
|
||||
&TableSize
|
||||
);
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
|
||||
|
||||
//
|
||||
// Measure to PCR[0] with event EV_POST_CODE ACPI DATA
|
||||
//
|
||||
TpmMeasureAndLogData(
|
||||
TpmMeasureAndLogData (
|
||||
0,
|
||||
EV_POST_CODE,
|
||||
EV_POSTCODE_INFO_ACPI_DATA,
|
||||
@@ -374,25 +385,24 @@ PublishAcpiTable (
|
||||
TableSize
|
||||
);
|
||||
|
||||
|
||||
ASSERT (Table->OemTableId == SIGNATURE_64 ('T', 'c', 'g', 'T', 'a', 'b', 'l', 'e'));
|
||||
CopyMem (Table->OemId, PcdGetPtr (PcdAcpiDefaultOemId), sizeof (Table->OemId) );
|
||||
mTcgNvs = AssignOpRegion (Table, SIGNATURE_32 ('T', 'N', 'V', 'S'), (UINT16) sizeof (TCG_NVS));
|
||||
CopyMem (Table->OemId, PcdGetPtr (PcdAcpiDefaultOemId), sizeof (Table->OemId));
|
||||
mTcgNvs = AssignOpRegion (Table, SIGNATURE_32 ('T', 'N', 'V', 'S'), (UINT16)sizeof (TCG_NVS));
|
||||
ASSERT (mTcgNvs != NULL);
|
||||
|
||||
//
|
||||
// Publish the TPM ACPI table
|
||||
//
|
||||
Status = gBS->LocateProtocol (&gEfiAcpiTableProtocolGuid, NULL, (VOID **) &AcpiTable);
|
||||
Status = gBS->LocateProtocol (&gEfiAcpiTableProtocolGuid, NULL, (VOID **)&AcpiTable);
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
|
||||
TableKey = 0;
|
||||
Status = AcpiTable->InstallAcpiTable (
|
||||
AcpiTable,
|
||||
Table,
|
||||
TableSize,
|
||||
&TableKey
|
||||
);
|
||||
Status = AcpiTable->InstallAcpiTable (
|
||||
AcpiTable,
|
||||
Table,
|
||||
TableSize,
|
||||
&TableKey
|
||||
);
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
|
||||
return Status;
|
||||
@@ -414,8 +424,8 @@ PublishAcpiTable (
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
InitializeTcgSmm (
|
||||
IN EFI_HANDLE ImageHandle,
|
||||
IN EFI_SYSTEM_TABLE *SystemTable
|
||||
IN EFI_HANDLE ImageHandle,
|
||||
IN EFI_SYSTEM_TABLE *SystemTable
|
||||
)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
@@ -423,7 +433,7 @@ InitializeTcgSmm (
|
||||
EFI_SMM_SW_REGISTER_CONTEXT SwContext;
|
||||
EFI_HANDLE SwHandle;
|
||||
|
||||
if (!CompareGuid (PcdGetPtr(PcdTpmInstanceGuid), &gEfiTpmDeviceInstanceTpm12Guid)){
|
||||
if (!CompareGuid (PcdGetPtr (PcdTpmInstanceGuid), &gEfiTpmDeviceInstanceTpm12Guid)) {
|
||||
DEBUG ((DEBUG_ERROR, "No TPM12 instance required!\n"));
|
||||
return EFI_UNSUPPORTED;
|
||||
}
|
||||
@@ -434,28 +444,30 @@ InitializeTcgSmm (
|
||||
//
|
||||
// Get the Sw dispatch protocol and register SMI callback functions.
|
||||
//
|
||||
Status = gSmst->SmmLocateProtocol (&gEfiSmmSwDispatch2ProtocolGuid, NULL, (VOID**)&SwDispatch);
|
||||
Status = gSmst->SmmLocateProtocol (&gEfiSmmSwDispatch2ProtocolGuid, NULL, (VOID **)&SwDispatch);
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
SwContext.SwSmiInputValue = (UINTN) -1;
|
||||
Status = SwDispatch->Register (SwDispatch, PhysicalPresenceCallback, &SwContext, &SwHandle);
|
||||
SwContext.SwSmiInputValue = (UINTN)-1;
|
||||
Status = SwDispatch->Register (SwDispatch, PhysicalPresenceCallback, &SwContext, &SwHandle);
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
if (EFI_ERROR (Status)) {
|
||||
return Status;
|
||||
}
|
||||
mTcgNvs->PhysicalPresence.SoftwareSmi = (UINT8) SwContext.SwSmiInputValue;
|
||||
|
||||
SwContext.SwSmiInputValue = (UINTN) -1;
|
||||
Status = SwDispatch->Register (SwDispatch, MemoryClearCallback, &SwContext, &SwHandle);
|
||||
mTcgNvs->PhysicalPresence.SoftwareSmi = (UINT8)SwContext.SwSmiInputValue;
|
||||
|
||||
SwContext.SwSmiInputValue = (UINTN)-1;
|
||||
Status = SwDispatch->Register (SwDispatch, MemoryClearCallback, &SwContext, &SwHandle);
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
if (EFI_ERROR (Status)) {
|
||||
return Status;
|
||||
}
|
||||
mTcgNvs->MemoryClear.SoftwareSmi = (UINT8) SwContext.SwSmiInputValue;
|
||||
|
||||
mTcgNvs->MemoryClear.SoftwareSmi = (UINT8)SwContext.SwSmiInputValue;
|
||||
|
||||
//
|
||||
// Locate SmmVariableProtocol.
|
||||
//
|
||||
Status = gSmst->SmmLocateProtocol (&gEfiSmmVariableProtocolGuid, NULL, (VOID**)&mSmmVariable);
|
||||
Status = gSmst->SmmLocateProtocol (&gEfiSmmVariableProtocolGuid, NULL, (VOID **)&mSmmVariable);
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
|
||||
return EFI_SUCCESS;
|
||||
|
@@ -34,66 +34,66 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||
|
||||
#pragma pack(1)
|
||||
typedef struct {
|
||||
UINT8 SoftwareSmi;
|
||||
UINT32 Parameter;
|
||||
UINT32 Response;
|
||||
UINT32 Request;
|
||||
UINT32 LastRequest;
|
||||
UINT32 ReturnCode;
|
||||
UINT8 SoftwareSmi;
|
||||
UINT32 Parameter;
|
||||
UINT32 Response;
|
||||
UINT32 Request;
|
||||
UINT32 LastRequest;
|
||||
UINT32 ReturnCode;
|
||||
} PHYSICAL_PRESENCE_NVS;
|
||||
|
||||
typedef struct {
|
||||
UINT8 SoftwareSmi;
|
||||
UINT32 Parameter;
|
||||
UINT32 Request;
|
||||
UINT32 ReturnCode;
|
||||
UINT8 SoftwareSmi;
|
||||
UINT32 Parameter;
|
||||
UINT32 Request;
|
||||
UINT32 ReturnCode;
|
||||
} MEMORY_CLEAR_NVS;
|
||||
|
||||
typedef struct {
|
||||
PHYSICAL_PRESENCE_NVS PhysicalPresence;
|
||||
MEMORY_CLEAR_NVS MemoryClear;
|
||||
UINT32 PPRequestUserConfirm;
|
||||
PHYSICAL_PRESENCE_NVS PhysicalPresence;
|
||||
MEMORY_CLEAR_NVS MemoryClear;
|
||||
UINT32 PPRequestUserConfirm;
|
||||
} TCG_NVS;
|
||||
|
||||
typedef struct {
|
||||
UINT8 OpRegionOp;
|
||||
UINT32 NameString;
|
||||
UINT8 RegionSpace;
|
||||
UINT8 DWordPrefix;
|
||||
UINT32 RegionOffset;
|
||||
UINT8 BytePrefix;
|
||||
UINT8 RegionLen;
|
||||
UINT8 OpRegionOp;
|
||||
UINT32 NameString;
|
||||
UINT8 RegionSpace;
|
||||
UINT8 DWordPrefix;
|
||||
UINT32 RegionOffset;
|
||||
UINT8 BytePrefix;
|
||||
UINT8 RegionLen;
|
||||
} AML_OP_REGION_32_8;
|
||||
#pragma pack()
|
||||
|
||||
//
|
||||
// The definition for TCG physical presence ACPI function
|
||||
//
|
||||
#define ACPI_FUNCTION_GET_PHYSICAL_PRESENCE_INTERFACE_VERSION 1
|
||||
#define ACPI_FUNCTION_SUBMIT_REQUEST_TO_BIOS 2
|
||||
#define ACPI_FUNCTION_GET_PENDING_REQUEST_BY_OS 3
|
||||
#define ACPI_FUNCTION_GET_PLATFORM_ACTION_TO_TRANSITION_TO_BIOS 4
|
||||
#define ACPI_FUNCTION_RETURN_REQUEST_RESPONSE_TO_OS 5
|
||||
#define ACPI_FUNCTION_SUBMIT_PREFERRED_USER_LANGUAGE 6
|
||||
#define ACPI_FUNCTION_SUBMIT_REQUEST_TO_BIOS_2 7
|
||||
#define ACPI_FUNCTION_GET_USER_CONFIRMATION_STATUS_FOR_REQUEST 8
|
||||
#define ACPI_FUNCTION_GET_PHYSICAL_PRESENCE_INTERFACE_VERSION 1
|
||||
#define ACPI_FUNCTION_SUBMIT_REQUEST_TO_BIOS 2
|
||||
#define ACPI_FUNCTION_GET_PENDING_REQUEST_BY_OS 3
|
||||
#define ACPI_FUNCTION_GET_PLATFORM_ACTION_TO_TRANSITION_TO_BIOS 4
|
||||
#define ACPI_FUNCTION_RETURN_REQUEST_RESPONSE_TO_OS 5
|
||||
#define ACPI_FUNCTION_SUBMIT_PREFERRED_USER_LANGUAGE 6
|
||||
#define ACPI_FUNCTION_SUBMIT_REQUEST_TO_BIOS_2 7
|
||||
#define ACPI_FUNCTION_GET_USER_CONFIRMATION_STATUS_FOR_REQUEST 8
|
||||
|
||||
//
|
||||
// The return code for Return TPM Operation Response to OS Environment
|
||||
//
|
||||
#define PP_RETURN_TPM_OPERATION_RESPONSE_SUCCESS 0
|
||||
#define PP_RETURN_TPM_OPERATION_RESPONSE_FAILURE 1
|
||||
#define PP_RETURN_TPM_OPERATION_RESPONSE_SUCCESS 0
|
||||
#define PP_RETURN_TPM_OPERATION_RESPONSE_FAILURE 1
|
||||
|
||||
//
|
||||
// The definition for TCG MOR
|
||||
//
|
||||
#define ACPI_FUNCTION_DSM_MEMORY_CLEAR_INTERFACE 1
|
||||
#define ACPI_FUNCTION_PTS_CLEAR_MOR_BIT 2
|
||||
#define ACPI_FUNCTION_DSM_MEMORY_CLEAR_INTERFACE 1
|
||||
#define ACPI_FUNCTION_PTS_CLEAR_MOR_BIT 2
|
||||
|
||||
//
|
||||
// The return code for Memory Clear Interface Functions
|
||||
//
|
||||
#define MOR_REQUEST_SUCCESS 0
|
||||
#define MOR_REQUEST_GENERAL_FAILURE 1
|
||||
#define MOR_REQUEST_SUCCESS 0
|
||||
#define MOR_REQUEST_GENERAL_FAILURE 1
|
||||
|
||||
#endif // __TCG_SMM_H__
|
||||
#endif // __TCG_SMM_H__
|
||||
|
Reference in New Issue
Block a user