Fix the issue that consplitter should not touch ConIn variable & do ConIn connection

Signed-off-by: Chao Zhang <chao.b.zhang@intel.com>
Reviewed-by  : Hot Tian <hot.tian@intel.com>
Reviewed-by  : Ni, Ruiyu <ruiyu.ni@intel.com>

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13644 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
czhang46
2012-08-17 07:36:56 +00:00
parent db1126d218
commit bc79c731b4
4 changed files with 245 additions and 97 deletions

View File

@ -1,7 +1,7 @@
/** @file
BDS Lib functions which relate with connect the device
Copyright (c) 2004 - 2008, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2004 - 2012, 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
@ -69,11 +69,13 @@ BdsLibGenericConnectAll (
/**
This function will create all handles associate with every device
path node. If the handle associate with one device path node can not
be created success, then still give one chance to do the dispatch,
which load the missing drivers if possible.
be created successfully, Dispatch service which load the missing drivers
is called according to input parameter, since in some cases no driver
dependency is assumed exist, so may need not to call this service.
@param DevicePathToConnect The device path which will be connected, it can be
a multi-instance device path
@param NeedDispatch Whether requires dispatch service during connection
@retval EFI_SUCCESS All handles associate with every device path node
have been created
@ -83,9 +85,9 @@ BdsLibGenericConnectAll (
**/
EFI_STATUS
EFIAPI
BdsLibConnectDevicePath (
IN EFI_DEVICE_PATH_PROTOCOL *DevicePathToConnect
ConnectDevicePathInternal (
IN EFI_DEVICE_PATH_PROTOCOL *DevicePathToConnect,
IN BOOLEAN NeedDispatch
)
{
EFI_STATUS Status;
@ -150,7 +152,15 @@ BdsLibConnectDevicePath (
// Status == EFI_SUCCESS means a driver was dispatched
// Status == EFI_NOT_FOUND means no new drivers were dispatched
//
Status = gDS->Dispatch ();
if (NeedDispatch) {
Status = gDS->Dispatch ();
} else {
//
// Always return EFI_NOT_FOUND here
// to prevent dead loop when control handle is found but connection failded case
//
Status = EFI_NOT_FOUND;
}
}
if (!EFI_ERROR (Status)) {
@ -190,6 +200,31 @@ BdsLibConnectDevicePath (
}
/**
This function will create all handles associate with every device
path node. If the handle associate with one device path node can not
be created successfully, then still give chance to do the dispatch,
which load the missing drivers if possible.
@param DevicePathToConnect The device path which will be connected, it can be
a multi-instance device path
@retval EFI_SUCCESS All handles associate with every device path node
have been created
@retval EFI_OUT_OF_RESOURCES There is no resource to create new handles
@retval EFI_NOT_FOUND Create the handle associate with one device path
node failed
**/
EFI_STATUS
EFIAPI
BdsLibConnectDevicePath (
IN EFI_DEVICE_PATH_PROTOCOL *DevicePathToConnect
)
{
return ConnectDevicePathInternal(DevicePathToConnect, TRUE);
}
/**
This function will connect all current system handles recursively.