73 UINT64 NsCommBufferEnd;
74 UINT64 SCommBufferEnd;
81 (BufferAddr < NsCommBufferEnd))
83 CommBufferEnd = NsCommBufferEnd;
85 (BufferAddr < SCommBufferEnd))
87 CommBufferEnd = SCommBufferEnd;
89 return EFI_ACCESS_DENIED;
93 return EFI_ACCESS_DENIED;
100 return EFI_ACCESS_DENIED;
129 UINTN NsCommBufferSize;
131 DEBUG ((DEBUG_INFO,
"Received event - 0x%x on cpu %d\n", EventId, CpuNumber));
137 return EFI_INVALID_PARAMETER;
141 if (EFI_ERROR (Status)) {
142 DEBUG ((DEBUG_ERROR,
"Check Buffer failed: %r\n", Status));
150 GuidedEventContext =
NULL;
156 (VOID **)&GuidedEventContext
160 DEBUG ((DEBUG_ERROR,
"Mem alloc failed - 0x%x\n", EventId));
161 return EFI_OUT_OF_RESOURCES;
166 CopyMem (GuidedEventContext, (
CONST VOID *)NsCommBufferAddr, NsCommBufferSize);
169 PerCpuGuidedEventContext[CpuNumber] = GuidedEventContext;
174 MmEntryPointContext.
NumberOfCpus = mMpInformationHobData->NumberOfProcessors;
178 mMmst->
NumberOfCpus = mMpInformationHobData->NumberOfProcessors;
182 if (mMmEntryPoint ==
NULL) {
183 DEBUG ((DEBUG_ERROR,
"Mm Entry point Not Found\n"));
184 return EFI_UNSUPPORTED;
187 mMmEntryPoint (&MmEntryPointContext);
190 ASSERT (GuidedEventContext);
191 CopyMem ((VOID *)NsCommBufferAddr, (
CONST VOID *)GuidedEventContext, NsCommBufferSize);
193 Status = mMmst->MmFreePool ((VOID *)GuidedEventContext);
195 return EFI_OUT_OF_RESOURCES;
198 PerCpuGuidedEventContext[CpuNumber] =
NULL;
243 IN CONST VOID *Context OPTIONAL,
244 IN OUT VOID *CommBuffer OPTIONAL,
251 ASSERT (Context ==
NULL);
252 ASSERT (CommBuffer ==
NULL);
253 ASSERT (CommBufferSize ==
NULL);
256 if (PerCpuGuidedEventContext[CpuNumber] ==
NULL) {
257 return EFI_NOT_FOUND;
262 "CommBuffer - 0x%x, CommBufferSize - 0x%x\n",
263 PerCpuGuidedEventContext[CpuNumber],
264 PerCpuGuidedEventContext[CpuNumber]->MessageLength
268 &PerCpuGuidedEventContext[CpuNumber]->HeaderGuid,
270 PerCpuGuidedEventContext[CpuNumber]->Data,
271 &PerCpuGuidedEventContext[CpuNumber]->MessageLength
275 DEBUG ((DEBUG_WARN,
"Unable to manage Guided Event - %d\n", Status));
VOID *EFIAPI CopyMem(OUT VOID *DestinationBuffer, IN CONST VOID *SourceBuffer, IN UINTN Length)
VOID *EFIAPI ZeroMem(OUT VOID *Buffer, IN UINTN Length)
EFI_STATUS EFIAPI PiMmCpuTpFwRootMmiHandler(IN EFI_HANDLE DispatchHandle, IN CONST VOID *Context OPTIONAL, IN OUT VOID *CommBuffer OPTIONAL, IN OUT UINTN *CommBufferSize OPTIONAL)
STATIC EFI_STATUS CheckBufferAddr(IN UINTN BufferAddr)
EFI_STATUS PiMmStandaloneMmCpuDriverEntry(IN UINTN EventId, IN UINTN CpuNumber, IN UINTN NsCommBufferAddr)
EFI_STATUS EFIAPI MmFoundationEntryRegister(IN CONST EFI_MM_CONFIGURATION_PROTOCOL *This, IN EFI_MM_ENTRY_POINT MmEntryPoint)
#define DEBUG(Expression)
VOID(EFIAPI * EFI_MM_ENTRY_POINT)(IN CONST EFI_MM_ENTRY_CONTEXT *MmEntryContext)
VOID EFIAPI MmEntryPoint(IN CONST EFI_MM_ENTRY_CONTEXT *MmEntryContext)
UINTN CurrentlyExecutingCpu
UINTN CurrentlyExecutingCpu
EFI_MM_INTERRUPT_MANAGE MmiManage
EFI_ALLOCATE_POOL MmAllocatePool
EFI_PHYSICAL_ADDRESS PhysicalStart