/** @file\r
The module entry point for Tcg configuration module.\r
\r
-Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>\r
-This program and the accompanying materials \r
-are licensed and made available under the terms and conditions of the BSD License \r
-which accompanies this distribution. The full text of the license may be found at \r
+Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.<BR>\r
+This program and the accompanying materials\r
+are licensed and made available under the terms and conditions of the BSD License\r
+which accompanies this distribution. The full text of the license may be found at\r
http://opensource.org/licenses/bsd-license.php\r
\r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
\r
**/\r
\r
#include "TcgConfigImpl.h"\r
-\r
-EFI_GUID gTcgConfigPrivateGuid = TCG_CONFIG_PRIVATE_GUID;\r
+#include <Guid/TpmInstance.h>\r
\r
/**\r
The entry point for Tcg configuration driver.\r
TCG_CONFIG_PRIVATE_DATA *PrivateData;\r
EFI_TCG_PROTOCOL *TcgProtocol;\r
\r
- Status = TisPcRequestUseTpm ((TIS_TPM_HANDLE) (UINTN) TPM_BASE_ADDRESS);\r
+ if (!CompareGuid (PcdGetPtr(PcdTpmInstanceGuid), &gEfiTpmDeviceInstanceTpm12Guid)){\r
+ DEBUG ((EFI_D_ERROR, "No TPM12 instance required!\n"));\r
+ return EFI_UNSUPPORTED;\r
+ }\r
+\r
+ Status = Tpm12RequestUseTpm ();\r
if (EFI_ERROR (Status)) {\r
DEBUG ((EFI_D_ERROR, "TPM not detected!\n"));\r
return Status;\r
if (EFI_ERROR (Status)) {\r
TcgProtocol = NULL;\r
}\r
- \r
+\r
Status = gBS->OpenProtocol (\r
ImageHandle,\r
- &gTcgConfigPrivateGuid,\r
+ &gEfiCallerIdGuid,\r
NULL,\r
ImageHandle,\r
ImageHandle,\r
if (!EFI_ERROR (Status)) {\r
return EFI_ALREADY_STARTED;\r
}\r
- \r
+\r
//\r
// Create a private data structure.\r
//\r
if (PrivateData == NULL) {\r
return EFI_OUT_OF_RESOURCES;\r
}\r
- \r
+\r
+ PrivateData->Configuration = AllocatePool (sizeof (TCG_CONFIGURATION));\r
+ if (PrivateData->Configuration == NULL) {\r
+ Status = EFI_OUT_OF_RESOURCES;\r
+ goto ErrorExit;\r
+ }\r
+\r
PrivateData->TcgProtocol = TcgProtocol;\r
- PrivateData->HideTpm = PcdGetBool (PcdHideTpmSupport) && PcdGetBool (PcdHideTpm);\r
- \r
+\r
//\r
// Install TCG configuration form\r
//\r
\r
//\r
// Install private GUID.\r
- // \r
+ //\r
Status = gBS->InstallMultipleProtocolInterfaces (\r
&ImageHandle,\r
- &gTcgConfigPrivateGuid,\r
+ &gEfiCallerIdGuid,\r
PrivateData,\r
NULL\r
);\r
ErrorExit:\r
if (PrivateData != NULL) {\r
UninstallTcgConfigForm (PrivateData);\r
- } \r
- \r
+ }\r
+\r
return Status;\r
}\r
\r
\r
Status = gBS->HandleProtocol (\r
ImageHandle,\r
- &gTcgConfigPrivateGuid,\r
+ &gEfiCallerIdGuid,\r
(VOID **) &PrivateData\r
- ); \r
+ );\r
if (EFI_ERROR (Status)) {\r
- return Status; \r
+ return Status;\r
}\r
- \r
+\r
ASSERT (PrivateData->Signature == TCG_CONFIG_PRIVATE_DATA_SIGNATURE);\r
\r
gBS->UninstallMultipleProtocolInterfaces (\r
&ImageHandle,\r
- &gTcgConfigPrivateGuid,\r
+ &gEfiCallerIdGuid,\r
PrivateData,\r
NULL\r
);\r
- \r
+\r
UninstallTcgConfigForm (PrivateData);\r
\r
return EFI_SUCCESS;\r