]> git.proxmox.com Git - mirror_edk2.git/blobdiff - StandaloneMmPkg/Core/Dispatcher.c
StandaloneMmPkg: Fix ECC error 4002 in StandaloneMmCpu
[mirror_edk2.git] / StandaloneMmPkg / Core / Dispatcher.c
index 2f795d01dc1ffe1512c28c4fb0b88b451bdca232..dbd5332fa9d362194056c6c8227929e705031eb8 100644 (file)
 \r
   Step #3 - Adding to the mScheduledQueue requires that you process Before\r
             and After dependencies. This is done recursively as the call to add\r
-            to the mScheduledQueue checks for Before and recursively adds\r
-            all Befores. It then addes the item that was passed in and then\r
-            processess the After dependecies by recursively calling the routine.\r
+            to the mScheduledQueue checks for Before Depexes and recursively\r
+            adds all Before Depexes. It then adds the item that was passed in\r
+            and then processess the After dependencies by recursively calling\r
+            the routine.\r
 \r
   Dispatcher Rules:\r
   The rules for the dispatcher are similar to the DXE dispatcher.\r
@@ -29,7 +30,7 @@
 \r
   Copyright (c) 2014, Hewlett-Packard Development Company, L.P.\r
   Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.<BR>\r
-  Copyright (c) 2016 - 2018, ARM Limited. All rights reserved.<BR>\r
+  Copyright (c) 2016 - 2021, Arm Limited. All rights reserved.<BR>\r
 \r
   SPDX-License-Identifier: BSD-2-Clause-Patent\r
 \r
@@ -60,8 +61,8 @@ MmCoreFfsFindMmDriver (
 /**\r
   Insert InsertedDriverEntry onto the mScheduledQueue. To do this you\r
   must add any driver with a before dependency on InsertedDriverEntry first.\r
-  You do this by recursively calling this routine. After all the Befores are\r
-  processed you can add InsertedDriverEntry to the mScheduledQueue.\r
+  You do this by recursively calling this routine. After all the Before Depexes\r
+  are processed you can add InsertedDriverEntry to the mScheduledQueue.\r
   Then you can add any driver with an After dependency on InsertedDriverEntry\r
   by recursively calling this routine.\r
 \r
@@ -92,7 +93,7 @@ LIST_ENTRY  mScheduledQueue = INITIALIZE_LIST_HEAD_VARIABLE (mScheduledQueue);
 LIST_ENTRY  mFwVolList = INITIALIZE_LIST_HEAD_VARIABLE (mFwVolList);\r
 \r
 //\r
-// Flag for the MM Dispacher.  TRUE if dispatcher is execuing.\r
+// Flag for the MM Dispacher.  TRUE if dispatcher is executing.\r
 //\r
 BOOLEAN  gDispatcherRunning = FALSE;\r
 \r
@@ -110,7 +111,7 @@ GLOBAL_REMOVE_IF_UNREFERENCED    UINT64                *mMmCodeMemoryRangeUsageB
 \r
 /**\r
   To check memory usage bit map array to figure out if the memory range in which the image will be loaded\r
-  is available or not. If memory range is avaliable, the function will mark the correponding bits to 1\r
+  is available or not. If memory range is avaliable, the function will mark the corresponding bits to 1\r
   which indicates the memory range is used. The function is only invoked when load modules at fixed address\r
   feature is enabled.\r
 \r
@@ -163,7 +164,7 @@ CheckAndMarkFixLoadingMemoryUsageBitMap (
   }\r
 \r
   //\r
-  // Test if the memory is avalaible or not.\r
+  // Test if the memory is available or not.\r
   //\r
   BaseOffsetPageNumber = (UINTN)EFI_SIZE_TO_PAGES ((UINT32)(ImageBase - MmCodeBase));\r
   TopOffsetPageNumber  = (UINTN)EFI_SIZE_TO_PAGES ((UINT32)(ImageBase + ImageSize - MmCodeBase));\r
@@ -328,7 +329,7 @@ MmLoadImage (
   ImageContext.ImageAddress = (EFI_PHYSICAL_ADDRESS)DstBuffer;\r
 \r
   //\r
-  // Align buffer on section boundry\r
+  // Align buffer on section boundary\r
   //\r
   ImageContext.ImageAddress += ImageContext.SectionAlignment - 1;\r
   ImageContext.ImageAddress &= ~((EFI_PHYSICAL_ADDRESS)(ImageContext.SectionAlignment - 1));\r
@@ -604,7 +605,7 @@ MmDispatcher (
 \r
       //\r
       // Load the MM Driver image into memory. If the Driver was transitioned from\r
-      // Untrused to Scheduled it would have already been loaded so we may need to\r
+      // Untrusted to Scheduled it would have already been loaded so we may need to\r
       // skip the LoadImage\r
       //\r
       if (DriverEntry->ImageHandle == NULL) {\r
@@ -703,8 +704,8 @@ MmDispatcher (
 /**\r
   Insert InsertedDriverEntry onto the mScheduledQueue. To do this you\r
   must add any driver with a before dependency on InsertedDriverEntry first.\r
-  You do this by recursively calling this routine. After all the Befores are\r
-  processed you can add InsertedDriverEntry to the mScheduledQueue.\r
+  You do this by recursively calling this routine. After all the Before Depexes\r
+  are processed you can add InsertedDriverEntry to the mScheduledQueue.\r
   Then you can add any driver with an After dependency on InsertedDriverEntry\r
   by recursively calling this routine.\r
 \r
@@ -816,7 +817,7 @@ FvIsBeingProcessed (
 {\r
   KNOWN_FWVOL   *KnownFwVol;\r
 \r
-  DEBUG ((DEBUG_INFO, "FvIsBeingProcessed - 0x%08x\n", KnownFwVol));\r
+  DEBUG ((DEBUG_INFO, "FvIsBeingProcessed - 0x%08x\n", FwVolHeader));\r
 \r
   KnownFwVol = AllocatePool (sizeof (KNOWN_FWVOL));\r
   ASSERT (KnownFwVol != NULL);\r
@@ -828,23 +829,19 @@ FvIsBeingProcessed (
 \r
 /**\r
   Add an entry to the mDiscoveredList. Allocate memory to store the DriverEntry,\r
-  and initilize any state variables. Read the Depex from the FV and store it\r
+  and initialise any state variables. Read the Depex from the FV and store it\r
   in DriverEntry. Pre-process the Depex to set the Before and After state.\r
-  The Discovered list is never free'ed and contains booleans that represent the\r
+  The Discovered list is never freed and contains booleans that represent the\r
   other possible MM driver states.\r
 \r
-  @param  Fv                    Fv protocol, needed to read Depex info out of\r
-                                FLASH.\r
-  @param  FvHandle              Handle for Fv, needed in the\r
-                                EFI_MM_DRIVER_ENTRY so that the PE image can be\r
-                                read out of the FV at a later time.\r
-  @param  DriverName            Name of driver to add to mDiscoveredList.\r
+  @param [in]   FwVolHeader     Pointer to the formware volume header.\r
+  @param [in]   Pe32Data        Pointer to the PE data.\r
+  @param [in]   Pe32DataSize    Size of the PE data.\r
+  @param [in]   Depex           Pointer to the Depex info.\r
+  @param [in]   DepexSize       Size of the Depex info.\r
+  @param [in]   DriverName      Name of driver to add to mDiscoveredList.\r
 \r
   @retval EFI_SUCCESS           If driver was added to the mDiscoveredList.\r
-  @retval EFI_ALREADY_STARTED   The driver has already been started. Only one\r
-                                DriverName may be active in the system at any one\r
-                                time.\r
-\r
 **/\r
 EFI_STATUS\r
 MmAddToDriverList (\r
@@ -885,7 +882,7 @@ MmAddToDriverList (
 \r
 /**\r
   Traverse the discovered list for any drivers that were discovered but not loaded\r
-  because the dependency experessions evaluated to false.\r
+  because the dependency expressions evaluated to false.\r
 \r
 **/\r
 VOID\r