+EXIT:\r
+ //\r
+ // Sync PPRQ/PPRM from PP Variable if PP submission fails\r
+ //\r
+ if (ReturnCode != TCG_PP_SUBMIT_REQUEST_TO_PREOS_SUCCESS) {\r
+ DEBUG ((EFI_D_ERROR, "[TPM2] Submit PP Request failure! Sync PPRQ/PPRM with PP variable.\n", Status));\r
+ DataSize = sizeof (EFI_TCG2_PHYSICAL_PRESENCE);\r
+ ZeroMem(&PpData, DataSize);\r
+ Status = mTcg2PpSmmVariable->SmmGetVariable (\r
+ TCG2_PHYSICAL_PRESENCE_VARIABLE,\r
+ &gEfiTcg2PhysicalPresenceGuid,\r
+ NULL,\r
+ &DataSize,\r
+ &PpData\r
+ );\r
+ *OperationRequest = (UINT32)PpData.PPRequest;\r
+ *RequestParameter = PpData.PPRequestParameter;\r
+ }\r
+\r
+ return ReturnCode;\r
+}\r
+\r
+/**\r
+ The handler for TPM physical presence function:\r
+ Submit TPM Operation Request to Pre-OS Environment and\r
+ Submit TPM Operation Request to Pre-OS Environment 2.\r
+\r
+ This API should be invoked in OS runtime phase to interface with ACPI method.\r
+\r
+ Caution: This function may receive untrusted input.\r
+ \r
+ @param[in] OperationRequest TPM physical presence operation request.\r
+ @param[in] RequestParameter TPM physical presence operation request parameter.\r
+\r
+ @return Return Code for Submit TPM Operation Request to Pre-OS Environment and\r
+ Submit TPM Operation Request to Pre-OS Environment 2.\r
+**/\r
+UINT32\r
+EFIAPI\r
+Tcg2PhysicalPresenceLibSubmitRequestToPreOSFunction (\r
+ IN UINT32 OperationRequest,\r
+ IN UINT32 RequestParameter\r
+ )\r
+{\r
+ UINT32 TempOperationRequest;\r
+ UINT32 TempRequestParameter;\r
+\r
+ TempOperationRequest = OperationRequest;\r
+ TempRequestParameter = RequestParameter;\r
+\r
+ return Tcg2PhysicalPresenceLibSubmitRequestToPreOSFunctionEx(&TempOperationRequest, &TempRequestParameter);\r