]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/DebugSupportDxe/DebugSupport.c
code scrub for DebugSpport Module.
[mirror_edk2.git] / MdeModulePkg / Universal / DebugSupportDxe / DebugSupport.c
index ed4d86038aa8d75b72f7d8a752e53e4d4139f613..4ef12cac19c74eb004bff9c389383630e995f82c 100644 (file)
@@ -12,15 +12,9 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 \r
 **/\r
 \r
-//\r
-// private header files\r
-//\r
 #include "PlDebugSupport.h"\r
 \r
-//\r
-// This is a global that is the actual interface\r
-//\r
-EFI_DEBUG_SUPPORT_PROTOCOL  gDebugSupportProtocolInterface = {\r
+EFI_DEBUG_SUPPORT_PROTOCOL  mDebugSupportProtocolInterface = {\r
   EFI_ISA,\r
   GetMaximumProcessorIndex,\r
   RegisterPeriodicCallback,\r
@@ -30,16 +24,16 @@ EFI_DEBUG_SUPPORT_PROTOCOL  gDebugSupportProtocolInterface = {
 \r
 \r
 /**\r
-  Debug Port Driver entry point. \r
+  Debug Support Driver entry point. \r
 \r
-  Checks to see there's not already a DebugSupport protocol installed for \r
-  the selected processor before installing protocol.\r
+  Checks to see if there's not already a Debug Support protocol installed for \r
+  the selected processor before installing it.\r
 \r
   @param[in] ImageHandle       The firmware allocated handle for the EFI image.  \r
   @param[in] SystemTable       A pointer to the EFI System Table.\r
   \r
   @retval EFI_SUCCESS          The entry point is executed successfully.\r
-  @retval EFI_ALREADY_STARTED  DebugSupport protocol is installed already.\r
+  @retval EFI_ALREADY_STARTED  DebugS upport protocol is installed already.\r
   @retval other                Some error occurs when executing this entry point.\r
 \r
 **/\r
@@ -56,8 +50,6 @@ InitializeDebugSupportDriver (
   UINTN                       NumHandles;\r
   EFI_DEBUG_SUPPORT_PROTOCOL  *DebugSupportProtocolPtr;\r
 \r
-  //\r
-  //  Install Protocol Interface...\r
   //\r
   // First check to see that the debug support protocol for this processor\r
   // type is not already installed\r
@@ -81,7 +73,10 @@ InitializeDebugSupportDriver (
                       NULL,\r
                       EFI_OPEN_PROTOCOL_GET_PROTOCOL\r
                       );\r
-      if (Status == EFI_SUCCESS && DebugSupportProtocolPtr->Isa == EFI_ISA) {\r
+      if ((Status == EFI_SUCCESS) && (DebugSupportProtocolPtr->Isa == EFI_ISA)) {\r
+        //\r
+        // a Debug Support protocol has been installed for this processor\r
+        //\r
         FreePool (HandlePtr);\r
         Status = EFI_ALREADY_STARTED;\r
         goto ErrExit;\r
@@ -109,7 +104,7 @@ InitializeDebugSupportDriver (
   LoadedImageProtocolPtr->Unload = PlUnloadDebugSupportDriver;\r
 \r
   //\r
-  // Call hook for platform specific initialization\r
+  // Call hook for processor specific initialization \r
   //\r
   Status = PlInitializeDebugSupportDriver ();\r
   ASSERT (!EFI_ERROR (Status));\r
@@ -118,14 +113,14 @@ InitializeDebugSupportDriver (
   }\r
 \r
   //\r
-  // Install DebugSupport protocol to new handle\r
+  // Install Debug Support protocol to new handle\r
   //\r
   Handle = NULL;\r
   Status = gBS->InstallProtocolInterface (\r
                   &Handle,\r
                   &gEfiDebugSupportProtocolGuid,\r
                   EFI_NATIVE_INTERFACE,\r
-                  &gDebugSupportProtocolInterface\r
+                  &mDebugSupportProtocolInterface\r
                   );\r
   ASSERT (!EFI_ERROR (Status));\r
   if (Status != EFI_SUCCESS) {\r