#include "VirtualMemory.h"\r
#include <IndustryStandard/Tdx.h>\r
#include <Library/TdxLib.h>\r
+#include <Library/UefiBootServicesTableLib.h>\r
+#include <Protocol/MemoryAccept.h>\r
#include <ConfidentialComputingGuestAttr.h>\r
\r
typedef enum {\r
IN UINT64 Length\r
)\r
{\r
- UINT64 AddressEncMask;\r
- UINT64 Status;\r
+ UINT64 AddressEncMask;\r
+ UINT64 Status;\r
+ EDKII_MEMORY_ACCEPT_PROTOCOL *MemoryAcceptProtocol;\r
\r
AddressEncMask = GetMemEncryptionAddressMask ();\r
\r
// If changing shared to private, must accept-page again\r
//\r
if (Mode == ClearSharedBit) {\r
- TdAcceptPages (PhysicalAddress, Length / EFI_PAGE_SIZE, EFI_PAGE_SIZE);\r
+ Status = gBS->LocateProtocol (&gEdkiiMemoryAcceptProtocolGuid, NULL, (VOID **)&MemoryAcceptProtocol);\r
+ ASSERT (!EFI_ERROR (Status));\r
+ Status = MemoryAcceptProtocol->AcceptMemory (MemoryAcceptProtocol, PhysicalAddress, Length);\r
+ ASSERT (!EFI_ERROR (Status));\r
}\r
\r
DEBUG ((\r