IN CONST VOID *Buffer\r
);\r
\r
-/**\r
- This function is hook point called after the gEfiSmmReadyToLockProtocolGuid\r
- notification is completely processed.\r
-**/\r
-VOID\r
-EFIAPI\r
-SmmCpuFeaturesCompleteSmmReadyToLock (\r
- VOID\r
- );\r
-\r
-/**\r
- This API provides a method for a CPU to allocate a specific region for storing page tables.\r
-\r
- This API can be called more once to allocate memory for page tables.\r
-\r
- Allocates the number of 4KB pages of type EfiRuntimeServicesData and returns a pointer to the\r
- allocated buffer. The buffer returned is aligned on a 4KB boundary. If Pages is 0, then NULL\r
- is returned. If there is not enough memory remaining to satisfy the request, then NULL is\r
- returned.\r
-\r
- This function can also return NULL if there is no preference on where the page tables are allocated in SMRAM.\r
-\r
- @param Pages The number of 4 KB pages to allocate.\r
-\r
- @return A pointer to the allocated buffer for page tables.\r
- @retval NULL Fail to allocate a specific region for storing page tables,\r
- Or there is no preference on where the page tables are allocated in SMRAM.\r
-\r
-**/\r
-VOID *\r
-EFIAPI\r
-SmmCpuFeaturesAllocatePageTableMemory (\r
- IN UINTN Pages\r
- );\r
-\r
#endif\r
{\r
return EFI_UNSUPPORTED;\r
}\r
-\r
-/**\r
- This function is hook point called after the gEfiSmmReadyToLockProtocolGuid\r
- notification is completely processed.\r
-**/\r
-VOID\r
-EFIAPI\r
-SmmCpuFeaturesCompleteSmmReadyToLock (\r
- VOID\r
- )\r
-{\r
-}\r
-\r
-/**\r
- This API provides a method for a CPU to allocate a specific region for storing page tables.\r
-\r
- This API can be called more once to allocate memory for page tables.\r
-\r
- Allocates the number of 4KB pages of type EfiRuntimeServicesData and returns a pointer to the\r
- allocated buffer. The buffer returned is aligned on a 4KB boundary. If Pages is 0, then NULL\r
- is returned. If there is not enough memory remaining to satisfy the request, then NULL is\r
- returned.\r
-\r
- This function can also return NULL if there is no preference on where the page tables are allocated in SMRAM.\r
-\r
- @param Pages The number of 4 KB pages to allocate.\r
-\r
- @return A pointer to the allocated buffer for page tables.\r
- @retval NULL Fail to allocate a specific region for storing page tables,\r
- Or there is no preference on where the page tables are allocated in SMRAM.\r
-\r
-**/\r
-VOID *\r
-EFIAPI\r
-SmmCpuFeaturesAllocatePageTableMemory (\r
- IN UINTN Pages\r
- )\r
-{\r
- return NULL;\r
-}\r
-\r
//\r
// Allocate the page table\r
//\r
- PageTable = AllocatePageTableMemory (ExtraPages + 5 + PagesNeeded);\r
+ PageTable = AllocatePages (ExtraPages + 5 + PagesNeeded);\r
ASSERT (PageTable != NULL);\r
\r
PageTable = (VOID *)((UINTN)PageTable + EFI_PAGES_TO_SIZE (ExtraPages));\r
//\r
// Allocate a page from SMRAM\r
//\r
- NewPageTableAddress = AllocatePageTableMemory (1);\r
+ NewPageTableAddress = AllocatePages (1);\r
ASSERT (NewPageTableAddress != NULL);\r
\r
NewPageTable = (UINT64 *)NewPageTableAddress;\r
//\r
BufferPages = EFI_SIZE_TO_PAGES (SIZE_32KB + TileSize * (mMaxNumberOfCpus - 1));\r
if ((FamilyId == 4) || (FamilyId == 5)) {\r
- Buffer = AllocateAlignedPages (BufferPages, SIZE_32KB);\r
+ Buffer = AllocateAlignedCodePages (BufferPages, SIZE_32KB);\r
} else {\r
- Buffer = AllocateAlignedPages (BufferPages, SIZE_4KB);\r
+ Buffer = AllocateAlignedCodePages (BufferPages, SIZE_4KB);\r
}\r
ASSERT (Buffer != NULL);\r
DEBUG ((EFI_D_INFO, "SMRAM SaveState Buffer (0x%08x, 0x%08x)\n", Buffer, EFI_PAGES_TO_SIZE(BufferPages)));\r
}\r
}\r
\r
-/**\r
- This API provides a way to allocate memory for page table.\r
-\r
- This API can be called more once to allocate memory for page tables.\r
-\r
- Allocates the number of 4KB pages of type EfiRuntimeServicesData and returns a pointer to the\r
- allocated buffer. The buffer returned is aligned on a 4KB boundary. If Pages is 0, then NULL\r
- is returned. If there is not enough memory remaining to satisfy the request, then NULL is\r
- returned.\r
-\r
- @param Pages The number of 4 KB pages to allocate.\r
-\r
- @return A pointer to the allocated buffer or NULL if allocation fails.\r
-\r
-**/\r
-VOID *\r
-AllocatePageTableMemory (\r
- IN UINTN Pages\r
- )\r
-{\r
- VOID *Buffer;\r
-\r
- Buffer = SmmCpuFeaturesAllocatePageTableMemory (Pages);\r
- if (Buffer != NULL) {\r
- return Buffer;\r
- }\r
- return AllocatePages (Pages);\r
-}\r
-\r
/**\r
Perform the remaining tasks.\r
\r
//\r
ConfigSmmCodeAccessCheck ();\r
\r
- SmmCpuFeaturesCompleteSmmReadyToLock ();\r
-\r
//\r
// Clean SMM ready to lock flag\r
//\r
//\r
ConfigSmmCodeAccessCheck ();\r
\r
- SmmCpuFeaturesCompleteSmmReadyToLock ();\r
-\r
mRestoreSmmConfigurationInS3 = FALSE;\r
}\r
}\r
DumpModuleInfoByIp (\r
IN UINTN CallerIpAddress\r
);\r
-\r
-/**\r
- This API provides a way to allocate memory for page table.\r
-\r
- This API can be called more once to allocate memory for page tables.\r
-\r
- Allocates the number of 4KB pages of type EfiRuntimeServicesData and returns a pointer to the\r
- allocated buffer. The buffer returned is aligned on a 4KB boundary. If Pages is 0, then NULL\r
- is returned. If there is not enough memory remaining to satisfy the request, then NULL is\r
- returned.\r
-\r
- @param Pages The number of 4 KB pages to allocate.\r
-\r
- @return A pointer to the allocated buffer or NULL if allocation fails.\r
-\r
-**/\r
-VOID *\r
-AllocatePageTableMemory (\r
- IN UINTN Pages\r
- );\r
-\r
#endif\r
//\r
ASSERT (Address == (*Pte & PHYSICAL_ADDRESS_MASK));\r
\r
- Pt = AllocatePageTableMemory (1);\r
+ Pt = AllocatePages (1);\r
ASSERT (Pt != NULL);\r
\r
// Split it\r