]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Core/Dxe/Hand/DriverSupport.c
Patch from open source community for CryptoPkg to allow it to build for ARM using...
[mirror_edk2.git] / MdeModulePkg / Core / Dxe / Hand / DriverSupport.c
index 74cc5dfca7a9ba6678212e56358f155140156dc2..f542275a3dd3c4915a49913d15d6ee362698d704 100644 (file)
@@ -1,8 +1,8 @@
 /** @file\r
   Support functions to connect/disconnect UEFI Driver model Protocol\r
 \r
-Copyright (c) 2006 - 2008, Intel Corporation. <BR>\r
-All rights reserved. This program and the accompanying materials\r
+Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<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
@@ -13,6 +13,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 **/\r
 \r
 #include "DxeMain.h"\r
+#include "Handle.h"\r
 \r
 \r
 //\r
@@ -540,11 +541,13 @@ CoreConnectSingleController (
     for (Index = 0; (Index < NumberOfSortedDriverBindingProtocols) && !DriverFound; Index++) {\r
       if (SortedDriverBindingProtocols[Index] != NULL) {\r
         DriverBinding = SortedDriverBindingProtocols[Index];\r
+        PERF_START (DriverBinding->DriverBindingHandle, "DB:Support:", NULL, 0);\r
         Status = DriverBinding->Supported(\r
                                   DriverBinding,\r
                                   ControllerHandle,\r
                                   RemainingDevicePath\r
                                   );\r
+        PERF_END (DriverBinding->DriverBindingHandle, "DB:Support:", NULL, 0);\r
         if (!EFI_ERROR (Status)) {\r
           SortedDriverBindingProtocols[Index] = NULL;\r
           DriverFound = TRUE;\r
@@ -553,13 +556,13 @@ CoreConnectSingleController (
           // A driver was found that supports ControllerHandle, so attempt to start the driver\r
           // on ControllerHandle.\r
           //\r
-          PERF_START (DriverBinding->DriverBindingHandle, DRIVERBINDING_START_TOK, NULL, 0);\r
+          PERF_START (DriverBinding->DriverBindingHandle, "DB:Start:", NULL, 0);\r
           Status = DriverBinding->Start (\r
                                     DriverBinding,\r
                                     ControllerHandle,\r
                                     RemainingDevicePath\r
                                     );\r
-          PERF_END (DriverBinding->DriverBindingHandle, DRIVERBINDING_START_TOK, NULL, 0);\r
+          PERF_END (DriverBinding->DriverBindingHandle, "DB:Start:", NULL, 0);\r
 \r
           if (!EFI_ERROR (Status)) {\r
             //\r
@@ -763,7 +766,7 @@ CoreDisconnectController (
                &gEfiDriverBindingProtocolGuid,\r
                (VOID **)&DriverBinding\r
                );\r
-    if (EFI_ERROR (Status)) {\r
+    if (EFI_ERROR (Status) || DriverBinding == NULL) {\r
       Status = EFI_INVALID_PARAMETER;\r
       goto Done;\r
     }\r