diff options
Diffstat (limited to 'StandaloneMmPkg/Drivers/StandaloneMmCpu/StandaloneMmCpu.c')
-rw-r--r-- | StandaloneMmPkg/Drivers/StandaloneMmCpu/StandaloneMmCpu.c | 134 |
1 files changed, 2 insertions, 132 deletions
diff --git a/StandaloneMmPkg/Drivers/StandaloneMmCpu/StandaloneMmCpu.c b/StandaloneMmPkg/Drivers/StandaloneMmCpu/StandaloneMmCpu.c index b6d8d37b97..f2b566b108 100644 --- a/StandaloneMmPkg/Drivers/StandaloneMmCpu/StandaloneMmCpu.c +++ b/StandaloneMmPkg/Drivers/StandaloneMmCpu/StandaloneMmCpu.c @@ -22,10 +22,6 @@ #include <StandaloneMmCpu.h>
-// GUID to identify HOB with whereabouts of communication buffer with Normal
-// World
-extern EFI_GUID gEfiStandaloneMmNonSecureBufferGuid;
-
//
// mPiMmCpuDriverEpProtocol for Cpu driver entry point to handle
// mm communication event.
@@ -42,42 +38,6 @@ EFI_MM_SYSTEM_TABLE *mMmst = NULL; //
STATIC EFI_HANDLE mMmCpuHandle = NULL;
-/** Returns the HOB data for the matching HOB GUID.
-
- @param [in] HobList Pointer to the HOB list.
- @param [in] HobGuid The GUID for the HOB.
- @param [out] HobData Pointer to the HOB data.
-
- @retval EFI_SUCCESS The function completed successfully.
- @retval EFI_INVALID_PARAMETER Invalid parameter.
- @retval EFI_NOT_FOUND Could not find HOB with matching GUID.
-**/
-EFI_STATUS
-GetGuidedHobData (
- IN VOID *HobList,
- IN CONST EFI_GUID *HobGuid,
- OUT VOID **HobData
- )
-{
- EFI_HOB_GUID_TYPE *Hob;
-
- if ((HobList == NULL) || (HobGuid == NULL) || (HobData == NULL)) {
- return EFI_INVALID_PARAMETER;
- }
-
- Hob = GetNextGuidHob (HobGuid, HobList);
- if (Hob == NULL) {
- return EFI_NOT_FOUND;
- }
-
- *HobData = GET_GUID_HOB_DATA (Hob);
- if (*HobData == NULL) {
- return EFI_NOT_FOUND;
- }
-
- return EFI_SUCCESS;
-}
-
/** Entry point for the Standalone MM CPU driver.
@param [in] ImageHandle Unused. Not actual image handle.
@@ -95,14 +55,8 @@ StandaloneMmCpuInitialize ( IN EFI_MM_SYSTEM_TABLE *SystemTable // not actual systemtable
)
{
- EFI_CONFIGURATION_TABLE *ConfigurationTable;
- MP_INFORMATION_HOB_DATA *MpInformationHobData;
- EFI_STATUS Status;
- EFI_HANDLE DispatchHandle;
- UINT32 MpInfoSize;
- UINTN Index;
- UINTN ArraySize;
- VOID *HobStart;
+ EFI_STATUS Status;
+ EFI_HANDLE DispatchHandle;
ASSERT (SystemTable != NULL);
mMmst = SystemTable;
@@ -141,89 +95,5 @@ StandaloneMmCpuInitialize ( return Status;
}
- // Retrieve the Hoblist from the MMST to extract the details of the NS
- // communication buffer that has been reserved for StandaloneMmPkg
- ConfigurationTable = mMmst->MmConfigurationTable;
- for (Index = 0; Index < mMmst->NumberOfTableEntries; Index++) {
- if (CompareGuid (&gEfiHobListGuid, &(ConfigurationTable[Index].VendorGuid))) {
- break;
- }
- }
-
- // Bail out if the Hoblist could not be found
- if (Index >= mMmst->NumberOfTableEntries) {
- DEBUG ((DEBUG_ERROR, "Hoblist not found - 0x%x\n", Index));
- return EFI_OUT_OF_RESOURCES;
- }
-
- HobStart = ConfigurationTable[Index].VendorTable;
-
- //
- // Extract the MP information from the Hoblist
- //
- Status = GetGuidedHobData (
- HobStart,
- &gMpInformationHobGuid,
- (VOID **)&MpInformationHobData
- );
- if (EFI_ERROR (Status)) {
- DEBUG ((DEBUG_ERROR, "MpInformationHob extraction failed - 0x%x\n", Status));
- return Status;
- }
-
- //
- // Allocate memory for the MP information and copy over the MP information
- // passed by Trusted Firmware. Use the number of processors passed in the HOB
- // to copy the processor information
- //
- MpInfoSize = sizeof (MP_INFORMATION_HOB_DATA) +
- (sizeof (EFI_PROCESSOR_INFORMATION) *
- MpInformationHobData->NumberOfProcessors);
- Status = mMmst->MmAllocatePool (
- EfiRuntimeServicesData,
- MpInfoSize,
- (VOID **)&mMpInformationHobData
- );
- if (EFI_ERROR (Status)) {
- DEBUG ((DEBUG_ERROR, "mMpInformationHobData mem alloc failed - 0x%x\n", Status));
- return Status;
- }
-
- CopyMem (mMpInformationHobData, MpInformationHobData, MpInfoSize);
-
- // Print MP information
- DEBUG ((
- DEBUG_INFO,
- "mMpInformationHobData: 0x%016lx - 0x%lx\n",
- mMpInformationHobData->NumberOfProcessors,
- mMpInformationHobData->NumberOfEnabledProcessors
- ));
- for (Index = 0; Index < mMpInformationHobData->NumberOfProcessors; Index++) {
- DEBUG ((
- DEBUG_INFO,
- "mMpInformationHobData[0x%lx]: %d, %d, %d\n",
- mMpInformationHobData->ProcessorInfoBuffer[Index].ProcessorId,
- mMpInformationHobData->ProcessorInfoBuffer[Index].Location.Package,
- mMpInformationHobData->ProcessorInfoBuffer[Index].Location.Core,
- mMpInformationHobData->ProcessorInfoBuffer[Index].Location.Thread
- ));
- }
-
- //
- // Allocate memory for a table to hold pointers to a
- // EFI_MM_COMMUNICATE_HEADER for each CPU
- //
- ArraySize = sizeof (EFI_MM_COMMUNICATE_HEADER *) *
- mMpInformationHobData->NumberOfEnabledProcessors;
- Status = mMmst->MmAllocatePool (
- EfiRuntimeServicesData,
- ArraySize,
- (VOID **)&PerCpuGuidedEventContext
- );
- if (EFI_ERROR (Status)) {
- DEBUG ((DEBUG_ERROR, "PerCpuGuidedEventContext mem alloc failed - 0x%x\n", Status));
- return Status;
- }
-
return Status;
}
|