/*++ @file\r
\r
-Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2022, Intel Corporation. All rights reserved.<BR>\r
Portions copyright (c) 2008 - 2011, Apple Inc. All rights reserved.<BR>\r
SPDX-License-Identifier: BSD-2-Clause-Patent\r
\r
CHAR16 *FirmwareVolumesStr;\r
UINTN *StackPointer;\r
FILE *GdbTempFile;\r
+ EMU_THUNK_PPI *SecEmuThunkPpi;\r
\r
//\r
// Xcode does not support sourcing gdb scripts directly, so the Xcode XML\r
//\r
// PPIs pased into PEI_CORE\r
//\r
- AddThunkPpi (EFI_PEI_PPI_DESCRIPTOR_PPI, &gEmuThunkPpiGuid, &mSecEmuThunkPpi);\r
+ SecEmuThunkPpi = AllocateZeroPool (sizeof (EMU_THUNK_PPI) + FixedPcdGet32 (PcdPersistentMemorySize));\r
+ if (SecEmuThunkPpi == NULL) {\r
+ printf ("ERROR : Can not allocate memory for SecEmuThunkPpi. Exiting.\n");\r
+ exit (1);\r
+ }\r
+\r
+ CopyMem (SecEmuThunkPpi, &mSecEmuThunkPpi, sizeof (EMU_THUNK_PPI));\r
+ SecEmuThunkPpi->PersistentMemorySize = FixedPcdGet32 (PcdPersistentMemorySize);\r
+ AddThunkPpi (EFI_PEI_PPI_DESCRIPTOR_PPI, &gEmuThunkPpiGuid, SecEmuThunkPpi);\r
\r
SecInitThunkProtocol ();\r
\r