/** @file
It updates TPM items in ACPI table and registers SMI callback
functions for physical presence and ClearMemory.
Copyright (c) 2011 - 2012, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
#include "TcgSmm.h"
/**
Software SMI callback for TPM physical presence which is called from ACPI method.
@param[in] DispatchHandle The unique handle assigned to this handler by SmiHandlerRegister().
@param[in] Context Points to an optional handler context which was specified when the
handler was registered.
@param[in, out] CommBuffer A pointer to a collection of data in memory that will
be conveyed from a non-SMM environment into an SMM environment.
@param[in, out] CommBufferSize The size of the CommBuffer.
@retval EFI_SUCCESS The interrupt was handled successfully.
**/
)
{
//
// Get the Physical Presence variable
//
DataSize = sizeof (EFI_PHYSICAL_PRESENCE);
NULL,
&DataSize,
);
return EFI_SUCCESS;
}
//
// This command requires UI to prompt user for Auth data.
//
return EFI_SUCCESS;
}
DataSize = sizeof (EFI_PHYSICAL_PRESENCE);
);
}
return EFI_SUCCESS;
}
} else if (mTcgNvs->PhysicalPresence.Parameter == ACPI_FUNCTION_GET_USER_CONFIRMATION_STATUS_FOR_REQUEST) {
case PHYSICAL_PRESENCE_ENABLE:
if ((Flags & FLAG_NO_PPI_PROVISION) != 0) {
}
break;
case PHYSICAL_PRESENCE_CLEAR:
if ((Flags & FLAG_NO_PPI_CLEAR) != 0) {
}
break;
if ((Flags & FLAG_NO_PPI_MAINTENANCE) != 0) {
}
break;
}
break;
break;
//
// This command requires UI to prompt user for Auth data
//
return EFI_SUCCESS;
}
if (RequestConfirmed) {
} else {
}
}
return EFI_SUCCESS;
}
/**
Software SMI callback for MemoryClear which is called from ACPI method.
@param[in] DispatchHandle The unique handle assigned to this handler by SmiHandlerRegister().
@param[in] Context Points to an optional handler context which was specified when the
handler was registered.
@param[in, out] CommBuffer A pointer to a collection of data in memory that will
be conveyed from a non-SMM environment into an SMM environment.
@param[in, out] CommBufferSize The size of the CommBuffer.
@retval EFI_SUCCESS The interrupt was handled successfully.
**/
)
{
NULL,
&DataSize,
);
return EFI_SUCCESS;
}
return EFI_SUCCESS;
}
}
);
}
return EFI_SUCCESS;
}
/**
Find the operation region in TCG ACPI table by given Name and Size,
and initialize it if the region is found.
@param[in, out] Table The TPM item in ACPI table.
@param[in] Name The name string to find in TPM table.
@param[in] Size The size of the region to find.
@return The allocated address for the found region.
**/
VOID *
)
{
//
// Patch some pointers for the ASL code before loading the SSDT.
//
Status = gBS->AllocatePages(AllocateMaxAddress, EfiACPIMemoryNVS, EFI_SIZE_TO_PAGES (Size), &MemoryAddress);
break;
}
}
}
/**
Initialize and publish TPM items in ACPI table.
@retval EFI_SUCCESS The TCG ACPI table is published successfully.
@retval Others The TCG ACPI table is not published.
**/
)
{
0,
);
//
// Publish the TPM ACPI table
//
TableKey = 0;
);
return Status;
}
/**
The driver's entry point.
It install callbacks for TPM physical presence and MemoryClear, and locate
SMM variable to be used in the callback function.
@param[in] ImageHandle The firmware allocated handle for the EFI image.
@param[in] SystemTable A pointer to the EFI System Table.
@retval EFI_SUCCESS The entry point is executed successfully.
@retval Others Some error occurs when executing this entry point.
**/
)
{
Status = PublishAcpiTable ();
//
// Get the Sw dispatch protocol and register SMI callback functions.
//
return Status;
}
return Status;
}
//
// Locate SmmVariableProtocol.
//
return EFI_SUCCESS;
}