diff options
| author | niruiyu <niruiyu@6f19259b-4bc3-4df7-8a09-765794883524> | 2011-05-24 07:32:42 +0400 |
|---|---|---|
| committer | niruiyu <niruiyu@6f19259b-4bc3-4df7-8a09-765794883524> | 2011-05-24 07:32:42 +0400 |
| commit | 396e9039aec00982e98392a843635c1dcff5364d (patch) | |
| tree | 78279cdcc5f1b3f2ba9a75c48383252eee9f0634 /MdeModulePkg/Core/Dxe/Hand | |
| parent | 244bff4e1468914c6b59d0317774edd2d52f85c1 (diff) | |
| download | edk2-396e9039aec00982e98392a843635c1dcff5364d.tar.xz | |
Add the DriverFamilyOverride support in DxeCore.
Signed-off-by: niruiyu
Reviewed-by: lgao4
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11698 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg/Core/Dxe/Hand')
| -rw-r--r-- | MdeModulePkg/Core/Dxe/Hand/DriverSupport.c | 39 |
1 files changed, 38 insertions, 1 deletions
diff --git a/MdeModulePkg/Core/Dxe/Hand/DriverSupport.c b/MdeModulePkg/Core/Dxe/Hand/DriverSupport.c index f542275a3d..16ebfec21c 100644 --- a/MdeModulePkg/Core/Dxe/Hand/DriverSupport.c +++ b/MdeModulePkg/Core/Dxe/Hand/DriverSupport.c @@ -1,7 +1,7 @@ /** @file
Support functions to connect/disconnect UEFI Driver model Protocol
-Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -352,8 +352,10 @@ CoreConnectSingleController ( UINTN NewDriverBindingHandleCount;
EFI_HANDLE *NewDriverBindingHandleBuffer;
EFI_DRIVER_BINDING_PROTOCOL *DriverBinding;
+ EFI_DRIVER_FAMILY_OVERRIDE_PROTOCOL *DriverFamilyOverride;
UINTN NumberOfSortedDriverBindingProtocols;
EFI_DRIVER_BINDING_PROTOCOL **SortedDriverBindingProtocols;
+ UINT32 DriverFamilyOverrideVersion;
UINT32 HighestVersion;
UINTN HighestIndex;
UINTN SortIndex;
@@ -437,6 +439,41 @@ CoreConnectSingleController ( }
//
+ // Add the Driver Family Override Protocol drivers for ControllerHandle
+ //
+ while (TRUE) {
+ HighestIndex = DriverBindingHandleCount;
+ HighestVersion = 0;
+ for (Index = 0; Index < DriverBindingHandleCount; Index++) {
+ Status = CoreHandleProtocol (
+ DriverBindingHandleBuffer[Index],
+ &gEfiDriverFamilyOverrideProtocolGuid,
+ (VOID **) &DriverFamilyOverride
+ );
+ if (!EFI_ERROR (Status) && (DriverFamilyOverride != NULL)) {
+ DriverFamilyOverrideVersion = DriverFamilyOverride->GetVersion (DriverFamilyOverride);
+ if ((HighestIndex == DriverBindingHandleCount) || (DriverFamilyOverrideVersion > HighestVersion)) {
+ HighestVersion = DriverFamilyOverrideVersion;
+ HighestIndex = Index;
+ }
+ }
+ }
+
+ if (HighestIndex == DriverBindingHandleCount) {
+ break;
+ }
+
+ AddSortedDriverBindingProtocol (
+ DriverBindingHandleBuffer[HighestIndex],
+ &NumberOfSortedDriverBindingProtocols,
+ SortedDriverBindingProtocols,
+ DriverBindingHandleCount,
+ DriverBindingHandleBuffer,
+ FALSE
+ );
+ }
+
+ //
// Get the Bus Specific Driver Override Protocol instance on the Controller Handle
//
Status = CoreHandleProtocol (
|
