]> git.proxmox.com Git - mirror_edk2.git/blobdiff - StandaloneMmPkg/Drivers/StandaloneMmCpu/AArch64/EventHandle.c
StandaloneMmPkg: Fix ECC error 4002 in StandaloneMmCpu
[mirror_edk2.git] / StandaloneMmPkg / Drivers / StandaloneMmCpu / AArch64 / EventHandle.c
index 20877480535c66761ba2420f9b3fbd8a709c2155..d86d21bb013ce3a9749cdf92bf950091df455537 100644 (file)
@@ -58,6 +58,19 @@ EFI_MM_CONFIGURATION_PROTOCOL mMmConfig = {
 \r
 STATIC EFI_MM_ENTRY_POINT     mMmEntryPoint = NULL;\r
 \r
+/**\r
+  The PI Standalone MM entry point for the TF-A CPU driver.\r
+\r
+  @param  [in] EventId            The event Id.\r
+  @param  [in] CpuNumber          The CPU number.\r
+  @param  [in] NsCommBufferAddr   Address of the NS common buffer.\r
+\r
+  @retval   EFI_SUCCESS             Success.\r
+  @retval   EFI_INVALID_PARAMETER   A parameter was invalid.\r
+  @retval   EFI_ACCESS_DENIED       Access not permitted.\r
+  @retval   EFI_OUT_OF_RESOURCES    Out of resources.\r
+  @retval   EFI_UNSUPPORTED         Operation not supported.\r
+**/\r
 EFI_STATUS\r
 PiMmStandaloneArmTfCpuDriverEntry (\r
   IN UINTN EventId,\r
@@ -65,8 +78,8 @@ PiMmStandaloneArmTfCpuDriverEntry (
   IN UINTN NsCommBufferAddr\r
   )\r
 {\r
-  EFI_MM_COMMUNICATE_HEADER *GuidedEventContext = NULL;\r
-  EFI_MM_ENTRY_CONTEXT        MmEntryPointContext = {0};\r
+  EFI_MM_COMMUNICATE_HEADER   *GuidedEventContext;\r
+  EFI_MM_ENTRY_CONTEXT        MmEntryPointContext;\r
   EFI_STATUS                  Status;\r
   UINTN                       NsCommBufferSize;\r
 \r
@@ -107,6 +120,7 @@ PiMmStandaloneArmTfCpuDriverEntry (
     return EFI_ACCESS_DENIED;\r
   }\r
 \r
+  GuidedEventContext = NULL;\r
   // Now that the secure world can see the normal world buffer, allocate\r
   // memory to copy the communication buffer to the secure world.\r
   Status = mMmst->MmAllocatePool (\r
@@ -127,6 +141,8 @@ PiMmStandaloneArmTfCpuDriverEntry (
   // Stash the pointer to the allocated Event Context for this CPU\r
   PerCpuGuidedEventContext[CpuNumber] = GuidedEventContext;\r
 \r
+  ZeroMem (&MmEntryPointContext, sizeof (EFI_MM_ENTRY_CONTEXT));\r
+\r
   MmEntryPointContext.CurrentlyExecutingCpu = CpuNumber;\r
   MmEntryPointContext.NumberOfCpus = mMpInformationHobData->NumberOfProcessors;\r
 \r
@@ -156,6 +172,14 @@ PiMmStandaloneArmTfCpuDriverEntry (
   return Status;\r
 }\r
 \r
+/**\r
+  Registers the MM foundation entry point.\r
+\r
+  @param  [in] This               Pointer to the MM Configuration protocol.\r
+  @param  [in] MmEntryPoint       Function pointer to the MM Entry point.\r
+\r
+  @retval   EFI_SUCCESS             Success.\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 MmFoundationEntryRegister (\r
@@ -172,10 +196,13 @@ MmFoundationEntryRegister (
   This function is the main entry point for an MM handler dispatch\r
   or communicate-based callback.\r
 \r
-  @param  DispatchHandle  The unique handle assigned to this handler by MmiHandlerRegister().\r
-  @param  Context         Points to an optional handler context which was specified when the handler was registered.\r
+  @param  DispatchHandle  The unique handle assigned to this handler by\r
+                          MmiHandlerRegister().\r
+  @param  Context         Points to an optional handler context which was\r
+                          specified when the handler was registered.\r
   @param  CommBuffer      A pointer to a collection of data in memory that will\r
-                          be conveyed from a non-MM environment into an MM environment.\r
+                          be conveyed from a non-MM environment into an\r
+                          MM environment.\r
   @param  CommBufferSize  The size of the CommBuffer.\r
 \r
   @return Status Code\r