support hot plug CPUs. This module can be copied into a CPU specific package\r
and customized if these additional features are required.\r
\r
-Copyright (c) 2013 - 2015, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2013 - 2016, Intel Corporation. All rights reserved.<BR>\r
Copyright (c) 2015, Red Hat, Inc.\r
\r
This program and the accompanying materials\r
/**\r
Callback function executed when the EndOfDxe event group is signaled.\r
\r
- We delay saving the MTRR settings until BDS signals EndOfDxe.\r
+ We delay allocating StartupVector and saving the MTRR settings until BDS signals EndOfDxe.\r
\r
@param[in] Event Event whose notification function is being invoked.\r
@param[out] Context Pointer to the MTRR_SETTINGS buffer to fill in.\r
**/\r
VOID\r
EFIAPI\r
-SaveMtrrsOnEndOfDxe (\r
+CpuS3DataOnEndOfDxe (\r
IN EFI_EVENT Event,\r
OUT VOID *Context\r
)\r
{\r
+ EFI_STATUS Status;\r
+ ACPI_CPU_DATA_EX *AcpiCpuDataEx;\r
+\r
+ AcpiCpuDataEx = (ACPI_CPU_DATA_EX *) Context;\r
+ //\r
+ // Allocate a 4KB reserved page below 1MB\r
+ //\r
+ AcpiCpuDataEx->AcpiCpuData.StartupVector = BASE_1MB - 1;\r
+ Status = gBS->AllocatePages (\r
+ AllocateMaxAddress,\r
+ EfiReservedMemoryType,\r
+ 1,\r
+ &AcpiCpuDataEx->AcpiCpuData.StartupVector\r
+ );\r
+ ASSERT_EFI_ERROR (Status);\r
+\r
DEBUG ((EFI_D_VERBOSE, "%a\n", __FUNCTION__));\r
- MtrrGetAllMtrrs (Context);\r
+ MtrrGetAllMtrrs (&AcpiCpuDataEx->MtrrTable);\r
\r
//\r
// Close event, so it will not be invoked again.\r
);\r
ASSERT_EFI_ERROR (Status);\r
\r
- //\r
- // Allocate a 4KB reserved page below 1MB\r
- //\r
- AcpiCpuData->StartupVector = BASE_1MB - 1;\r
- Status = gBS->AllocatePages (\r
- AllocateMaxAddress,\r
- EfiReservedMemoryType,\r
- 1,\r
- &AcpiCpuData->StartupVector\r
- );\r
- ASSERT_EFI_ERROR (Status);\r
-\r
//\r
// Get the number of CPUs\r
//\r
\r
//\r
// Register EFI_END_OF_DXE_EVENT_GROUP_GUID event.\r
- // The notification function saves MTRRs for ACPI_CPU_DATA\r
+ // The notification function allocates StartupVector and saves MTRRs for ACPI_CPU_DATA\r
//\r
Status = gBS->CreateEventEx (\r
EVT_NOTIFY_SIGNAL,\r
TPL_CALLBACK,\r
- SaveMtrrsOnEndOfDxe,\r
- &AcpiCpuDataEx->MtrrTable,\r
+ CpuS3DataOnEndOfDxe,\r
+ AcpiCpuData,\r
&gEfiEndOfDxeEventGroupGuid,\r
&Event\r
);\r