]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Library/UefiBootManagerLib/BmConsole.c
MdeModulePkg: Change use of EFI_D_* to DEBUG_*
[mirror_edk2.git] / MdeModulePkg / Library / UefiBootManagerLib / BmConsole.c
index 80511814eec5b0a3bdac13895c3bbfafcdb94956..bdbb9a8770697b1ad52421835b01f46831bd4da6 100644 (file)
@@ -1,15 +1,9 @@
 /** @file\r
   Library functions which contain all the code to connect console device.\r
 \r
-Copyright (c) 2011 - 2015, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.<BR>\r
 (C) Copyright 2015 Hewlett Packard Enterprise Development LP<BR>\r
-This program and the accompanying materials\r
-are licensed and made available under the terms and conditions of the BSD License\r
-which accompanies this distribution.  The full text of the license may be found at\r
-http://opensource.org/licenses/bsd-license.php\r
-\r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+SPDX-License-Identifier: BSD-2-Clause-Patent\r
 \r
 **/\r
 \r
@@ -104,12 +98,12 @@ BmGetVideoController (
     }\r
   }\r
   FreePool (RootBridgeHandleBuffer);\r
-  \r
+\r
   return VideoController;\r
 }\r
 \r
 /**\r
-  Query all the children of VideoController and return the device paths of all the \r
+  Query all the children of VideoController and return the device paths of all the\r
   children that support GraphicsOutput protocol.\r
 \r
   @param VideoController       PCI handle of video controller.\r
@@ -205,7 +199,7 @@ EfiBootManagerGetGopDevicePath (
           //\r
           // Recursively look for GOP child in this frame buffer handle\r
           //\r
-          DEBUG ((EFI_D_INFO, "[Bds] Looking for GOP child deeper ... \n"));\r
+          DEBUG ((DEBUG_INFO, "[Bds] Looking for GOP child deeper ... \n"));\r
           TempDevicePath = GopPool;\r
           ReturnDevicePath = EfiBootManagerGetGopDevicePath (OpenInfoBuffer[Index].ControllerHandle);\r
           GopPool = AppendDevicePathInstance (GopPool, ReturnDevicePath);\r
@@ -238,14 +232,14 @@ EfiBootManagerConnectVideoController (
   )\r
 {\r
   EFI_DEVICE_PATH_PROTOCOL   *Gop;\r
-  \r
+\r
   if (VideoController == NULL) {\r
     //\r
     // Get the platform vga device\r
     //\r
     VideoController = BmGetVideoController ();\r
   }\r
\r
+\r
   if (VideoController == NULL) {\r
     return EFI_NOT_FOUND;\r
   }\r
@@ -253,7 +247,7 @@ EfiBootManagerConnectVideoController (
   //\r
   // Try to connect the PCI device path, so that GOP driver could start on this\r
   // device and create child handles with GraphicsOutput Protocol installed\r
-  // on them, then we get device paths of these child handles and select \r
+  // on them, then we get device paths of these child handles and select\r
   // them as possible console device.\r
   //\r
   gBS->ConnectController (VideoController, NULL, NULL, FALSE);\r
@@ -276,20 +270,20 @@ EfiBootManagerConnectVideoController (
   Fill console handle in System Table if there are no valid console handle in.\r
 \r
   Firstly, check the validation of console handle in System Table. If it is invalid,\r
-  update it by the first console device handle from EFI console variable. \r
+  update it by the first console device handle from EFI console variable.\r
 \r
   @param  VarName            The name of the EFI console variable.\r
   @param  ConsoleGuid        Specified Console protocol GUID.\r
-  @param  ConsoleHandle      On IN,  console handle in System Table to be checked. \r
+  @param  ConsoleHandle      On IN,  console handle in System Table to be checked.\r
                              On OUT, new console handle in system table.\r
-  @param  ProtocolInterface  On IN,  console protocol on console handle in System Table to be checked. \r
+  @param  ProtocolInterface  On IN,  console protocol on console handle in System Table to be checked.\r
                              On OUT, new console protocol on new console handle in system table.\r
 \r
   @retval TRUE               System Table has been updated.\r
   @retval FALSE              System Table hasn't been updated.\r
 \r
 **/\r
-BOOLEAN \r
+BOOLEAN\r
 BmUpdateSystemTableConsole (\r
   IN     CHAR16                   *VarName,\r
   IN     EFI_GUID                 *ConsoleGuid,\r
@@ -326,7 +320,7 @@ BmUpdateSystemTableConsole (
       return FALSE;\r
     }\r
   }\r
-  \r
+\r
   //\r
   // Get all possible consoles device path from EFI variable\r
   //\r
@@ -346,13 +340,13 @@ BmUpdateSystemTableConsole (
     //\r
     Instance  = GetNextDevicePathInstance (&VarConsole, &DevicePathSize);\r
     if (Instance == NULL) {\r
-      DEBUG ((EFI_D_ERROR, "[Bds] No valid console instance is found for %s!\n", VarName));\r
+      DEBUG ((DEBUG_ERROR, "[Bds] No valid console instance is found for %s!\n", VarName));\r
       // We should not ASSERT when all the console devices are removed.\r
       // ASSERT_EFI_ERROR (EFI_NOT_FOUND);\r
       FreePool (FullDevicePath);\r
       return FALSE;\r
     }\r
-    \r
+\r
     //\r
     // Find console device handle by device path instance\r
     //\r
@@ -559,7 +553,7 @@ EfiBootManagerConnectConsoleVariable (
       FreePool (StartDevicePath);\r
       return EFI_UNSUPPORTED;\r
     }\r
-    \r
+\r
     Next      = Instance;\r
     while (!IsDevicePathEndType (Next)) {\r
       Next = NextDevicePathNode (Next);\r
@@ -568,7 +562,7 @@ EfiBootManagerConnectConsoleVariable (
     SetDevicePathEndNode (Next);\r
     //\r
     // Connect the USB console\r
-    // USB console device path is a short-form device path that \r
+    // USB console device path is a short-form device path that\r
     //  starts with the first element being a USB WWID\r
     //  or a USB Class device path\r
     //\r
@@ -583,7 +577,7 @@ EfiBootManagerConnectConsoleVariable (
       for (Next = Instance; !IsDevicePathEnd (Next); Next = NextDevicePathNode (Next)) {\r
         if (DevicePathType (Next) == ACPI_DEVICE_PATH && DevicePathSubType (Next) == ACPI_ADR_DP) {\r
           break;\r
-        } else if (DevicePathType (Next) == HARDWARE_DEVICE_PATH && \r
+        } else if (DevicePathType (Next) == HARDWARE_DEVICE_PATH &&\r
                    DevicePathSubType (Next) == HW_CONTROLLER_DP &&\r
                    DevicePathType (NextDevicePathNode (Next)) == ACPI_DEVICE_PATH &&\r
                    DevicePathSubType (NextDevicePathNode (Next)) == ACPI_ADR_DP\r
@@ -722,23 +716,20 @@ EfiBootManagerConnectAllDefaultConsoles (
   if (!EFI_ERROR (Status)) {\r
     OneConnected = TRUE;\r
   }\r
-  PERF_START (NULL, "ConOutReady", "BDS", 1);\r
-  PERF_END   (NULL, "ConOutReady", "BDS", 0);\r
+  PERF_EVENT ("ConOutReady");\r
+\r
 \r
-  \r
   Status = EfiBootManagerConnectConsoleVariable (ConIn);\r
   if (!EFI_ERROR (Status)) {\r
     OneConnected = TRUE;\r
   }\r
-  PERF_START (NULL, "ConInReady", "BDS", 1);\r
-  PERF_END   (NULL, "ConInReady", "BDS", 0);\r
+  PERF_EVENT ("ConInReady");\r
 \r
   Status = EfiBootManagerConnectConsoleVariable (ErrOut);\r
   if (!EFI_ERROR (Status)) {\r
     OneConnected = TRUE;\r
   }\r
-  PERF_START (NULL, "ErrOutReady", "BDS", 1);\r
-  PERF_END   (NULL, "ErrOutReady", "BDS", 0);\r
+  PERF_EVENT ("ErrOutReady");\r
 \r
   SystemTableUpdated = FALSE;\r
   //\r