summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524>2009-04-24 07:02:52 +0000
committerlgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524>2009-04-24 07:02:52 +0000
commit6d8ced29b1486afd2e96a31c96474545cba30c7f (patch)
treec02b296eecba16a952f862dfa7a3789aa290b483
parent59f1d89250eceead2c0e33babe670a938a6a115c (diff)
downloadedk2-6d8ced29b1486afd2e96a31c96474545cba30c7f.zip
edk2-6d8ced29b1486afd2e96a31c96474545cba30c7f.tar.gz
edk2-6d8ced29b1486afd2e96a31c96474545cba30c7f.tar.bz2
Merge application PlatOverMngr and library DxePlatDriOverLib into driver PlatDriOverrideDxe.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@8169 6f19259b-4bc3-4df7-8a09-765794883524
-rw-r--r--MdeModulePkg/Application/PlatOverMngr/PlatOverMngr.inf86
-rw-r--r--MdeModulePkg/Include/Guid/OverrideVariable.h58
-rw-r--r--MdeModulePkg/Library/DxePlatDriOverLib/DxePlatDriOverLib.inf67
-rw-r--r--MdeModulePkg/Library/DxePlatDriOverLib/PlatDriOver.h195
-rw-r--r--MdeModulePkg/MdeModulePkg.dec8
-rw-r--r--MdeModulePkg/MdeModulePkg.dsc3
-rw-r--r--MdeModulePkg/Universal/PlatformDriOverrideDxe/InternalPlatDriOverrideDxe.h (renamed from MdeModulePkg/Include/Library/PlatformDriverOverrideLib.h)40
-rw-r--r--MdeModulePkg/Universal/PlatformDriOverrideDxe/PlatDriOverrideDxe.c (renamed from MdeModulePkg/Application/PlatOverMngr/PlatOverMngr.c)320
-rw-r--r--MdeModulePkg/Universal/PlatformDriOverrideDxe/PlatDriOverrideLib.c (renamed from MdeModulePkg/Library/DxePlatDriOverLib/PlatDriOverLib.c)1054
-rw-r--r--MdeModulePkg/Universal/PlatformDriOverrideDxe/PlatOverMngr.h (renamed from MdeModulePkg/Application/PlatOverMngr/PlatOverMngr.h)0
-rw-r--r--MdeModulePkg/Universal/PlatformDriOverrideDxe/PlatformDriOverride.c212
-rw-r--r--MdeModulePkg/Universal/PlatformDriOverrideDxe/PlatformDriOverrideDxe.inf74
-rw-r--r--MdeModulePkg/Universal/PlatformDriOverrideDxe/Vfr.vfr (renamed from MdeModulePkg/Application/PlatOverMngr/Vfr.vfr)2
-rw-r--r--MdeModulePkg/Universal/PlatformDriOverrideDxe/VfrStrings.uni (renamed from MdeModulePkg/Application/PlatOverMngr/VfrStrings.uni)bin10032 -> 10032 bytes
-rw-r--r--Nt32Pkg/Nt32Pkg.dsc2
15 files changed, 869 insertions, 1252 deletions
diff --git a/MdeModulePkg/Application/PlatOverMngr/PlatOverMngr.inf b/MdeModulePkg/Application/PlatOverMngr/PlatOverMngr.inf
deleted file mode 100644
index 0d5ea88..0000000
--- a/MdeModulePkg/Application/PlatOverMngr/PlatOverMngr.inf
+++ /dev/null
@@ -1,86 +0,0 @@
-#/** @file
-#
-# A UI application to offer an UI interface in device manager to let user configure
-# platform override protocol to override the default algorithm for matching
-# drivers to controllers.
-#
-# The main flow:
-# 1. The UI application dynamicly locate all controller device path.
-# 2. The UI application dynamicly locate all drivers which support binding protocol.
-# 3. The UI application export and dynamicly update two menu to let user select the
-# mapping between drivers to controllers.
-# 4. The UI application save all the mapping info in NV variables for the following boot,
-# which will be consumed by platform override protocol driver to publish the platform override protocol.
-#
-# Copyright (c) 2007 - 2009, Intel Corporation. All rights reserved.
-#
-# All rights reserved. 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
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-#
-#**/
-
-[Defines]
- INF_VERSION = 0x00010005
- BASE_NAME = PlatOverMngr
- FILE_GUID = 56D95BFE-F991-4898-B3BE-B8F37C927F48
- MODULE_TYPE = UEFI_APPLICATION
- VERSION_STRING = 1.0
- ENTRY_POINT = PlatOverMngrInit
-
-#
-# The following information is for reference only and not required by the build tools.
-#
-# VALID_ARCHITECTURES = IA32 X64 IPF EBC
-#
-
-[Sources.common]
- VfrStrings.uni
- Vfr.vfr
- PlatOverMngr.c
- PlatOverMngr.h
-
-[Packages]
- MdePkg/MdePkg.dec
- MdeModulePkg/MdeModulePkg.dec
-
-[LibraryClasses]
- BaseLib
- DebugLib
- UefiLib
- UefiApplicationEntryPoint
- UefiBootServicesTableLib
- PlatformDriverOverrideLib
- HiiLib
- BaseMemoryLib
- MemoryAllocationLib
- DevicePathLib
-
-[Guids]
-## This GUID C Name is not required for build since it is from UefiLib and not directly used by this module source.
-## gEfiGlobalVariableGuid ## SOMETIMES_CONSUMED ## Variable:L"PlatformLang" this variable specifies the platform supported language string (RFC 4646 format)
-## gEfiGlobalVariableGuid ## SOMETIMES_CONSUMED ## Variable:L"Lang" this variable specifies the platform supported language string (ISO 639-2 format)
- gEfiIfrTianoGuid ## CONSUMES ## Guid
-
-[Protocols]
- gEfiComponentName2ProtocolGuid ## SOMETIMES_CONSUMED (Get Driver Name if ComponentName2Protocol exists)
- gEfiComponentNameProtocolGuid ## SOMETIMES_CONSUMED (Get Driver Name if ComponentNameProtocol exists and ComponentName2Protocol doesn't exist)
- gEfiFirmwareVolume2ProtocolGuid ## SOMETIMES_CONSUMED (Get Driver Name from EFI UI section if ComponentName2Protocol and ComponentNameProtocol don't exist)
- gEfiPciIoProtocolGuid ## SOMETIMES_CONSUMED (Find the PCI device if PciIo protocol is installed)
- gEfiBusSpecificDriverOverrideProtocolGuid ## SOMETIMES_CONSUMED (Check whether the PCI device contains one or more efi drivers in its option rom by this protocol)
-
- gEfiDriverBindingProtocolGuid ## SOMETIMES_CONSUMED
- gEfiLoadedImageProtocolGuid ## SOMETIMES_CONSUMED
- gEfiLoadedImageDevicePathProtocolGuid ## SOMETIMES_CONSUMED (Show the drivers in the second page that support DriverBindingProtocol, LoadedImageProtocol and LoadedImageDevicePathProtocol)
- gEfiDevicePathProtocolGuid ## SOMETIMES_CONSUMED (Show the controller device in the first page that support DevicePathProtocol)
-
- gEfiHiiDatabaseProtocolGuid ## CONSUMED
- gEfiFormBrowser2ProtocolGuid ## CONSUMED
- gEfiHiiConfigRoutingProtocolGuid ## CONSUMED
- gEfiHiiConfigAccessProtocolGuid ## PRODUCED
- gEfiDevicePathToTextProtocolGuid ## CONSUMED
diff --git a/MdeModulePkg/Include/Guid/OverrideVariable.h b/MdeModulePkg/Include/Guid/OverrideVariable.h
deleted file mode 100644
index 2e6601d..0000000
--- a/MdeModulePkg/Include/Guid/OverrideVariable.h
+++ /dev/null
@@ -1,58 +0,0 @@
-/** @file
- This file defines the platform driver override variable name and variable guid.
- The variable(s) contain the override mappings from Controller Device Path to a set of Driver Device Paths.
-
- VariableLayout {
- //
- // NotEnd indicate whether the variable is the last one, and has no subsequent variable need to load.
- // Each variable has MaximumVariableSize limitation, so multiple variables are required to store
- // large mapping infos.
- // The variable(s) name rule is PlatDriOver, PlatDriOver1, PlatDriOver2, ....
- //
- UINT32 NotEnd; //Zero is the last one.
- //
- // The entry which contains the mapping that Controller Device Path to a set of Driver Device Paths
- // There are often multi mapping entries in a variable.
- //
- UINT32 SIGNATURE; //SIGNATURE_32('p','d','o','i')
- UINT32 DriverNum;
- EFI_DEVICE_PATH_PROTOCOL ControllerDevicePath[];
- EFI_DEVICE_PATH_PROTOCOL DriverDevicePath[];
- EFI_DEVICE_PATH_PROTOCOL DriverDevicePath[];
- EFI_DEVICE_PATH_PROTOCOL DriverDevicePath[];
- ......
- UINT32 NotEnd; //Zero is the last one.
- UINT32 SIGNATURE;
- UINT32 DriverNum;
- EFI_DEVICE_PATH_PROTOCOL ControllerDevicePath[];
- EFI_DEVICE_PATH_PROTOCOL DriverDevicePath[];
- EFI_DEVICE_PATH_PROTOCOL DriverDevicePath[];
- EFI_DEVICE_PATH_PROTOCOL DriverDevicePath[];
- ......
- }
-
-Copyright (c) 2008 - 2009, Intel Corporation
-All rights reserved. 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
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#ifndef __EFI_OVERRIDE_VARIABLE_GUID_H__
-#define __EFI_OVERRIDE_VARIABLE_GUID_H__
-
-///
-/// This guid is used for a platform driver override variable
-///
-#define EFI_OVERRIDE_VARIABLE_GUID \
- { 0x8e3d4ad5, 0xf762, 0x438a, { 0xa1, 0xc1, 0x5b, 0x9f, 0xe6, 0x8c, 0x6b, 0x15 }}
-
-#define EFI_PLATFORM_OVERRIDE_VARIABLE_NAME L"PlatDriOver"
-
-extern EFI_GUID gEfiOverrideVariableGuid;
-
-#endif // #ifndef __EFI_OVERRIDE_VARIABLE_GUID_H__
diff --git a/MdeModulePkg/Library/DxePlatDriOverLib/DxePlatDriOverLib.inf b/MdeModulePkg/Library/DxePlatDriOverLib/DxePlatDriOverLib.inf
deleted file mode 100644
index 8514bc2..0000000
--- a/MdeModulePkg/Library/DxePlatDriOverLib/DxePlatDriOverLib.inf
+++ /dev/null
@@ -1,67 +0,0 @@
-#/** @file
-# Instance of Platform Driver Override Library to manage driver overriding relationship.
-#
-# This library instance provides functions to manage the database of overriding relationship
-# between controllers and drivers. Each entry of the database contains the mapping that Controller
-# Device Path to a set of Driver Device Paths. The database is stored in non-volatile variables.
-#
-# Copyright (c) 2007 - 2008, Intel Corporation. All rights reserved.
-#
-# All rights reserved. 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
-# http://opensource.org/licenses/bsd-license.php
-#
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-#
-#**/
-
-[Defines]
- INF_VERSION = 0x00010005
- BASE_NAME = PlatDriOverLib
- FILE_GUID = 8bd8d711-2736-46d7-8c81-5de68e0a9e88
- MODULE_TYPE = DXE_DRIVER
- VERSION_STRING = 1.0
- LIBRARY_CLASS = PlatformDriverOverrideLib|DXE_DRIVER UEFI_DRIVER UEFI_APPLICATION
-
-#
-# The following information is for reference only and not required by the build tools.
-#
-# VALID_ARCHITECTURES = IA32 X64 IPF EBC
-#
-
-[Sources.common]
- PlatDriOver.h
- PlatDriOverLib.c
-
-[Packages]
- MdePkg/MdePkg.dec
- MdeModulePkg/MdeModulePkg.dec
-
-[LibraryClasses]
- DxeServicesTableLib
- MemoryAllocationLib
- DevicePathLib
- BaseLib
- UefiLib
- UefiBootServicesTableLib
- UefiRuntimeServicesTableLib
- BaseMemoryLib
- DebugLib
- PrintLib
-
-[Guids]
- ##
- # There could be more than one variables, from PlatDriOver, PlatDriOver1, PlatDriOver2,...
- #
- gEfiOverrideVariableGuid ## CONSUMES ## Variable:L"PlatDriOver"
-
-[Protocols]
- gEfiFirmwareVolume2ProtocolGuid ## CONSUMES
- gEfiLoadedImageProtocolGuid ## CONSUMES
- gEfiBusSpecificDriverOverrideProtocolGuid ## CONSUMES
- gEfiDriverBindingProtocolGuid ## CONSUMES
- gEfiDevicePathProtocolGuid ## CONSUMES
- gEfiLoadedImageDevicePathProtocolGuid ## CONSUMES
diff --git a/MdeModulePkg/Library/DxePlatDriOverLib/PlatDriOver.h b/MdeModulePkg/Library/DxePlatDriOverLib/PlatDriOver.h
deleted file mode 100644
index 7cede71..0000000
--- a/MdeModulePkg/Library/DxePlatDriOverLib/PlatDriOver.h
+++ /dev/null
@@ -1,195 +0,0 @@
-/** @file
- Internal include file for Platform Driver Override Library implementation.
-
- Copyright (c) 2007 - 2008, Intel Corporation
- All rights reserved. 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
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#ifndef _PLAT_DRI_OVER_H_
-#define _PLAT_DRI_OVER_H_
-
-#include <PiDxe.h>
-
-#include <Protocol/FirmwareVolume2.h>
-#include <Protocol/LoadedImage.h>
-#include <Protocol/DevicePath.h>
-#include <Protocol/BusSpecificDriverOverride.h>
-#include <Protocol/DriverBinding.h>
-
-#include <Library/BaseLib.h>
-#include <Library/DebugLib.h>
-#include <Library/BaseMemoryLib.h>
-#include <Library/PrintLib.h>
-#include <Library/UefiRuntimeServicesTableLib.h>
-#include <Library/UefiBootServicesTableLib.h>
-#include <Library/UefiLib.h>
-#include <Library/DevicePathLib.h>
-#include <Library/MemoryAllocationLib.h>
-#include <Library/DxeServicesTableLib.h>
-#include <Library/PlatformDriverOverrideLib.h>
-
-#include <Guid/OverrideVariable.h>
-#include <Guid/VariableFormat.h>
-
-
-#define PLATFORM_OVERRIDE_ITEM_SIGNATURE SIGNATURE_32('p','d','o','i')
- typedef struct _PLATFORM_OVERRIDE_ITEM {
- UINTN Signature;
- LIST_ENTRY Link;
- UINT32 DriverInfoNum;
- EFI_DEVICE_PATH_PROTOCOL *ControllerDevicePath;
- ///
- /// List of DRIVER_IMAGE_INFO
- ///
- LIST_ENTRY DriverInfoList;
- EFI_HANDLE LastReturnedImageHandle;
-} PLATFORM_OVERRIDE_ITEM;
-
-#define DRIVER_IMAGE_INFO_SIGNATURE SIGNATURE_32('p','d','i','i')
-typedef struct _DRIVER_IMAGE_INFO {
- UINTN Signature;
- LIST_ENTRY Link;
- EFI_HANDLE ImageHandle;
- EFI_DEVICE_PATH_PROTOCOL *DriverImagePath;
- BOOLEAN UnLoadable;
- BOOLEAN UnStartable;
-} DRIVER_IMAGE_INFO;
-
-#define DEVICE_PATH_STACK_ITEM_SIGNATURE SIGNATURE_32('d','p','s','i')
-typedef struct _DEVICE_PATH_STACK_ITEM{
- UINTN Signature;
- LIST_ENTRY Link;
- EFI_DEVICE_PATH_PROTOCOL *DevicePath;
-} DEVICE_PATH_STACK_ITEM;
-
-/**
- Push a controller device path into a globle device path list.
-
- @param DevicePath The controller device path to push into stack
-
- @retval EFI_SUCCESS Device path successfully pushed into the stack.
-
-**/
-EFI_STATUS
-EFIAPI
-PushDevPathStack (
- IN EFI_DEVICE_PATH_PROTOCOL *DevicePath
- );
-
-/**
- Pop a controller device path from a globle device path list
-
- @param DevicePath The controller device path popped from stack
-
- @retval EFI_SUCCESS Controller device path successfully popped.
- @retval EFI_NOT_FOUND Stack is empty.
-
-**/
-EFI_STATUS
-EFIAPI
-PopDevPathStack (
- OUT EFI_DEVICE_PATH_PROTOCOL **DevicePath
- );
-
-/**
- Check whether a controller device path is in a globle device path list
-
- @param DevicePath The controller device path to check
-
- @retval TRUE DevicePath exists in the stack.
- @retval FALSE DevicePath does not exist in the stack.
-
-**/
-BOOLEAN
-EFIAPI
-CheckExistInStack (
- IN EFI_DEVICE_PATH_PROTOCOL *DevicePath
- );
-
-/**
- Update the FV file device path if it is not valid.
-
- According to a file GUID, check a Fv file device path is valid. If it is invalid,
- try to return the valid device path.
- FV address maybe changes for memory layout adjust from time to time, use this funciton
- could promise the Fv file device path is right.
-
- @param DevicePath On input, the FV file device path to check
- On output, the updated valid FV file device path
- @param FileGuid The FV file GUID
- @param CallerImageHandle Image handle of the caller
-
- @retval EFI_INVALID_PARAMETER the input DevicePath or FileGuid is invalid
- parameter
- @retval EFI_UNSUPPORTED the input DevicePath does not contain FV file
- GUID at all
- @retval EFI_ALREADY_STARTED the input DevicePath has pointed to FV file, it
- is valid
- @retval EFI_SUCCESS Successfully updated the invalid DevicePath,
- and return the updated device path in DevicePath
-
-**/
-EFI_STATUS
-EFIAPI
-UpdateFvFileDevicePath (
- IN OUT EFI_DEVICE_PATH_PROTOCOL **DevicePath,
- IN EFI_GUID *FileGuid,
- IN EFI_HANDLE CallerImageHandle
- );
-
-/**
- Gets the data and size of a variable.
-
- Read the EFI variable (VendorGuid/Name) and return a dynamically allocated
- buffer, and the size of the buffer. If failure return NULL.
-
- @param Name String part of EFI variable name
- @param VendorGuid GUID part of EFI variable name
- @param VariableSize Returns the size of the EFI variable that was
- read
-
- @return Dynamically allocated memory that contains a copy of the EFI variable.
- Caller is responsible freeing the buffer.
- @retval NULL Variable was not read
-
-**/
-VOID *
-EFIAPI
-GetVariableAndSize (
- IN CHAR16 *Name,
- IN EFI_GUID *VendorGuid,
- OUT UINTN *VariableSize
- );
-
-/**
- Connect to the handle to a device on the device path.
-
- 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.
-
- @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
-ConnectDevicePath (
- IN EFI_DEVICE_PATH_PROTOCOL *DevicePathToConnect
- );
-
-#endif
diff --git a/MdeModulePkg/MdeModulePkg.dec b/MdeModulePkg/MdeModulePkg.dec
index 3517482..3c63b4c 100644
--- a/MdeModulePkg/MdeModulePkg.dec
+++ b/MdeModulePkg/MdeModulePkg.dec
@@ -50,10 +50,6 @@
## @libraryclass Defines a set of methods related recovery mode.
RecoveryLib|Include/Library/RecoveryLib.h
- ## @libraryclass Basic platform driver override functions.
- # This library is only intended to be used by Platform Driver Override Dxe Driver and Application.
- PlatformDriverOverrideLib|Include/Library/PlatformDriverOverrideLib.h
-
## @libraryclass Provides HII related functions.
HiiLib|Include/Library/HiiLib.h
@@ -121,10 +117,6 @@
## Include/Guid/VariableFormat.h
gEfiVariableGuid = { 0xddcf3616, 0x3275, 0x4164, { 0x98, 0xb6, 0xfe, 0x85, 0x70, 0x7f, 0xfe, 0x7d }}
- ## Platform Override Variable guid
- ## Include/Guid/OverrideVariable.h
- gEfiOverrideVariableGuid = { 0x8e3d4ad5, 0xf762, 0x438a, { 0xa1, 0xc1, 0x5b, 0x9f, 0xe6, 0x8c, 0x6b, 0x15 }}
-
## Performance protocol guid that also acts as the performance HOB guid and performance variable GUID
## Include/Guid/Performance.h
gPerformanceProtocolGuid = { 0x76B6BDFA, 0x2ACD, 0x4462, { 0x9E, 0x3F, 0xCB, 0x58, 0xC9, 0x69, 0xD9, 0x37 }}
diff --git a/MdeModulePkg/MdeModulePkg.dsc b/MdeModulePkg/MdeModulePkg.dsc
index 065121d..f338a9a 100644
--- a/MdeModulePkg/MdeModulePkg.dsc
+++ b/MdeModulePkg/MdeModulePkg.dsc
@@ -71,7 +71,6 @@
CapsuleLib|MdeModulePkg/Library/DxeCapsuleLibNull/DxeCapsuleLibNull.inf
DxeServicesLib|MdePkg/Library/DxeServicesLib/DxeServicesLib.inf
DxeServicesLib|MdePkg/Library/DxeServicesLib/DxeServicesLib.inf
- PlatformDriverOverrideLib|MdeModulePkg/Library/DxePlatDriOverLib/DxePlatDriOverLib.inf
HiiLib|MdeModulePkg/Library/UefiHiiLib/UefiHiiLib.inf
ReportStatusCodeLib|MdePkg/Library/BaseReportStatusCodeLibNull/BaseReportStatusCodeLibNull.inf
MemoryTestLib|MdeModulePkg/Library/BaseMemoryTestLibNull/BaseMemoryTestLibNull.inf
@@ -271,7 +270,6 @@
MdeModulePkg/Library/DxeIpIoLib/DxeIpIoLib.inf
MdeModulePkg/Library/DxeNetLib/DxeNetLib.inf
MdeModulePkg/Library/DxePerformanceLib/DxePerformanceLib.inf
- MdeModulePkg/Library/DxePlatDriOverLib/DxePlatDriOverLib.inf
MdeModulePkg/Library/DxeUdpIoLib/DxeUdpIoLib.inf
MdeModulePkg/Library/DxePrintLibPrint2Protocol/DxePrintLibPrint2Protocol.inf
MdeModulePkg/Library/PeiPerformanceLib/PeiPerformanceLib.inf
@@ -315,7 +313,6 @@
MdeModulePkg/Universal/PCD/Dxe/Pcd.inf
MdeModulePkg/Universal/PCD/Pei/Pcd.inf
MdeModulePkg/Universal/PlatformDriOverrideDxe/PlatformDriOverrideDxe.inf
- MdeModulePkg/Application/PlatOverMngr/PlatOverMngr.inf
MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf
MdeModulePkg/Universal/SetupBrowserDxe/SetupBrowserDxe.inf
MdeModulePkg/Application/VariableInfo/VariableInfo.inf
diff --git a/MdeModulePkg/Include/Library/PlatformDriverOverrideLib.h b/MdeModulePkg/Universal/PlatformDriOverrideDxe/InternalPlatDriOverrideDxe.h
index 2af25d5..efd87e9 100644
--- a/MdeModulePkg/Include/Library/PlatformDriverOverrideLib.h
+++ b/MdeModulePkg/Universal/PlatformDriOverrideDxe/InternalPlatDriOverrideDxe.h
@@ -1,6 +1,6 @@
/** @file
- Ihis library is only intended to be used by Platform Driver Override Dxe Driver and Application.
- It provides basic platform driver override functions.
+ Ihe internal heder file includes the required Protocol/Guid/Library
+ and the shared function APIs.
Copyright (c) 2007 - 2009, Intel Corporation
All rights reserved. This program and the accompanying materials
@@ -13,10 +13,40 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
-#ifndef _PLATFORM_DRIVER_OVERRIDE_LIB_H_
-#define _PLATFORM_DRIVER_OVERRIDE_LIB_H_
-
+#ifndef _INTERNAL_PLATFORM_DRIVER_OVERRIDE_H_
+#define _INTERNAL_PLATFORM_DRIVER_OVERRIDE_H_
+
+#include <PiDxe.h>
+
+#include <Protocol/HiiConfigAccess.h>
+#include <Protocol/HiiConfigRouting.h>
+#include <Protocol/HiiDatabase.h>
+#include <Protocol/FormBrowser2.h>
+#include <Protocol/LoadedImage.h>
+#include <Protocol/FirmwareVolume2.h>
+#include <Protocol/PciIo.h>
+#include <Protocol/BusSpecificDriverOverride.h>
+#include <Protocol/ComponentName2.h>
+#include <Protocol/ComponentName.h>
+#include <Protocol/DriverBinding.h>
+#include <Protocol/DevicePathToText.h>
#include <Protocol/DevicePath.h>
+#include <Protocol/PlatformDriverOverride.h>
+#include <Guid/MdeModuleHii.h>
+#include <Guid/VariableFormat.h>
+
+#include <Library/BaseLib.h>
+#include <Library/DebugLib.h>
+#include <Library/UefiLib.h>
+#include <Library/PrintLib.h>
+#include <Library/UefiDriverEntryPoint.h>
+#include <Library/UefiBootServicesTableLib.h>
+#include <Library/UefiRuntimeServicesTableLib.h>
+#include <Library/BaseMemoryLib.h>
+#include <Library/MemoryAllocationLib.h>
+#include <Library/DevicePathLib.h>
+#include <Library/DxeServicesTableLib.h>
+#include <Library/HiiLib.h>
/**
Free all the mapping database memory resource and initialize the mapping list entry.
diff --git a/MdeModulePkg/Application/PlatOverMngr/PlatOverMngr.c b/MdeModulePkg/Universal/PlatformDriOverrideDxe/PlatDriOverrideDxe.c
index 018917f..47921cd 100644
--- a/MdeModulePkg/Application/PlatOverMngr/PlatOverMngr.c
+++ b/MdeModulePkg/Universal/PlatformDriOverrideDxe/PlatDriOverrideDxe.c
@@ -1,18 +1,19 @@
/** @file
-
- A UI application to offer a UI interface in device manager to let user configure
+ This file also installs UEFI PLATFORM_DRIVER_OVERRIDE_PROTOCOL.
+
+ The main code offers a UI interface in device manager to let user configure
platform override protocol to override the default algorithm for matching
drivers to controllers.
The main flow:
- 1. The UI application dynamicly locate all controller device path.
- 2. The UI application dynamicly locate all drivers which support binding protocol.
- 3. The UI application export and dynamicly update two menu to let user select the
+ 1. It dynamicly locate all controller device path.
+ 2. It dynamicly locate all drivers which support binding protocol.
+ 3. It export and dynamicly update two menu to let user select the
mapping between drivers to controllers.
- 4. The UI application save all the mapping info in NV variables which will be consumed
+ 4. It save all the mapping info in NV variables which will be consumed
by platform override protocol driver to publish the platform override protocol.
-Copyright (c) 2007 - 2008, Intel Corporation
+Copyright (c) 2007 - 2009, Intel Corporation
All rights reserved. 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
@@ -23,35 +24,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
-#include <PiDxe.h>
-
-#include <Protocol/HiiConfigAccess.h>
-#include <Protocol/HiiConfigRouting.h>
-#include <Protocol/HiiDatabase.h>
-#include <Protocol/FormBrowser2.h>
-#include <Protocol/LoadedImage.h>
-#include <Protocol/FirmwareVolume2.h>
-#include <Protocol/PciIo.h>
-#include <Protocol/BusSpecificDriverOverride.h>
-#include <Protocol/ComponentName2.h>
-#include <Protocol/ComponentName.h>
-#include <Protocol/DriverBinding.h>
-#include <Protocol/DevicePathToText.h>
-#include <Protocol/DevicePath.h>
-#include <Guid/MdeModuleHii.h>
-
-#include <Library/DevicePathLib.h>
-#include <Library/BaseLib.h>
-#include <Library/DebugLib.h>
-#include <Library/UefiLib.h>
-#include <Library/UefiApplicationEntryPoint.h>
-#include <Library/UefiBootServicesTableLib.h>
-#include <Library/PlatformDriverOverrideLib.h>
-#include <Library/BaseMemoryLib.h>
-#include <Library/MemoryAllocationLib.h>
-#include <Library/DevicePathLib.h>
-#include <Library/HiiLib.h>
-
+#include "InternalPlatDriOverrideDxe.h"
#include "PlatOverMngr.h"
#define EFI_CALLBACK_INFO_SIGNATURE SIGNATURE_32 ('C', 'l', 'b', 'k')
@@ -64,6 +37,7 @@ typedef struct {
PLAT_OVER_MNGR_DATA FakeNvData;
EFI_HII_CONFIG_ROUTING_PROTOCOL *HiiConfigRouting;
EFI_HII_CONFIG_ACCESS_PROTOCOL ConfigAccess;
+ EFI_PLATFORM_DRIVER_OVERRIDE_PROTOCOL PlatformDriverOverride;
} EFI_CALLBACK_INFO;
#pragma pack(1)
@@ -82,7 +56,7 @@ typedef struct {
// uni string and Vfr Binary data.
//
extern UINT8 VfrBin[];
-extern UINT8 PlatOverMngrStrings[];
+extern UINT8 PlatDriOverrideDxeStrings[];
//
// module global data
@@ -90,6 +64,8 @@ extern UINT8 PlatOverMngrStrings[];
EFI_GUID mPlatformOverridesManagerGuid = PLAT_OVER_MNGR_GUID;
CHAR16 mVariableName[] = L"Data";
LIST_ENTRY mMappingDataBase = INITIALIZE_LIST_HEAD_VARIABLE (mMappingDataBase);
+BOOLEAN mEnvironmentVariableRead = FALSE;
+EFI_HANDLE mCallerImageHandle = NULL;
EFI_HANDLE *mDevicePathHandleBuffer;
EFI_HANDLE *mDriverImageHandleBuffer;
@@ -142,7 +118,33 @@ HII_VENDOR_DEVICE_PATH mHiiVendorDevicePath = {
CHAR16 *
DevicePathToStr (
IN EFI_DEVICE_PATH_PROTOCOL *DevPath
- );
+ )
+{
+ EFI_STATUS Status;
+ EFI_DEVICE_PATH_TO_TEXT_PROTOCOL *DevPathToText;
+ CHAR16 *ToText;
+
+ if (DevPath == NULL) {
+ return L"";
+ }
+
+ Status = gBS->LocateProtocol (
+ &gEfiDevicePathToTextProtocolGuid,
+ NULL,
+ (VOID **) &DevPathToText
+ );
+ if (!EFI_ERROR (Status)) {
+ ToText = DevPathToText->ConvertDevicePathToText (
+ DevPath,
+ FALSE,
+ TRUE
+ );
+ ASSERT (ToText != NULL);
+ return ToText;
+ }
+
+ return L"?";
+}
/**
Worker function to get the driver name by ComponentName or ComponentName2 protocol
@@ -1355,6 +1357,133 @@ PlatOverMngrCallback (
}
/**
+ Retrieves the image handle of the platform override driver for a controller in the system.
+
+ @param This A pointer to the
+ EFI_PLATFORM_DRIVER_OVERRIDE_PROTOCOL instance.
+ @param ControllerHandle The device handle of the controller to check if a
+ driver override exists.
+ @param DriverImageHandle On input, a pointer to the previous driver image
+ handle returned by GetDriver(). On output, a
+ pointer to the next driver image handle. Passing
+ in a NULL, will return the first driver image
+ handle for ControllerHandle.
+
+ @retval EFI_SUCCESS The driver override for ControllerHandle was
+ returned in DriverImageHandle.
+ @retval EFI_NOT_FOUND A driver override for ControllerHandle was not
+ found.
+ @retval EFI_INVALID_PARAMETER The handle specified by ControllerHandle is not a
+ valid handle. DriverImageHandle is not a handle
+ that was returned on a previous call to
+ GetDriver().
+
+**/
+EFI_STATUS
+EFIAPI
+GetDriver (
+ IN EFI_PLATFORM_DRIVER_OVERRIDE_PROTOCOL *This,
+ IN EFI_HANDLE ControllerHandle,
+ IN OUT EFI_HANDLE *DriverImageHandle
+ )
+{
+ EFI_STATUS Status;
+
+ //
+ // Check that ControllerHandle is a valid handle
+ //
+ if (ControllerHandle == NULL) {
+ return EFI_INVALID_PARAMETER;
+ }
+
+ //
+ // Read the environment variable(s) that contain the override mappings from Controller Device Path to
+ // a set of Driver Device Paths, and initialize in memory database of the overrides that map Controller
+ // Device Paths to an ordered set of Driver Device Paths and Driver Handles. This action is only performed
+ // once and finished in first call.
+ //
+ if (!mEnvironmentVariableRead) {
+ mEnvironmentVariableRead = TRUE;
+
+ Status = InitOverridesMapping (&mMappingDataBase);
+ if (EFI_ERROR (Status)){
+ DEBUG ((DEBUG_ERROR, "The status to Get Platform Driver Override Variable is %r\n", Status));
+ InitializeListHead (&mMappingDataBase);
+ return EFI_NOT_FOUND;
+ }
+ }
+
+ //
+ // if the environment variable does not exist, just return not found
+ //
+ if (IsListEmpty (&mMappingDataBase)) {
+ return EFI_NOT_FOUND;
+ }
+
+ return GetDriverFromMapping (
+ ControllerHandle,
+ DriverImageHandle,
+ &mMappingDataBase,
+ mCallerImageHandle
+ );
+}
+
+/**
+ Retrieves the device path of the platform override driver for a controller in the system.
+ This driver doesn't support this API.
+
+ @param This A pointer to the EFI_PLATFORM_DRIVER_OVERRIDE_
+ PROTOCOL instance.
+ @param ControllerHandle The device handle of the controller to check if a driver override
+ exists.
+ @param DriverImagePath On input, a pointer to the previous driver device path returned by
+ GetDriverPath(). On output, a pointer to the next driver
+ device path. Passing in a pointer to NULL, will return the first
+ driver device path for ControllerHandle.
+
+ @retval EFI_UNSUPPORTED
+**/
+EFI_STATUS
+EFIAPI
+GetDriverPath (
+ IN EFI_PLATFORM_DRIVER_OVERRIDE_PROTOCOL *This,
+ IN EFI_HANDLE ControllerHandle,
+ IN OUT EFI_DEVICE_PATH_PROTOCOL **DriverImagePath
+ )
+{
+ return EFI_UNSUPPORTED;
+}
+
+
+/**
+ Used to associate a driver image handle with a device path that was returned on a prior call to the
+ GetDriverPath() service. This driver image handle will then be available through the
+ GetDriver() service. This driver doesn't support this API.
+
+ @param This A pointer to the EFI_PLATFORM_DRIVER_OVERRIDE_
+ PROTOCOL instance.
+ @param ControllerHandle The device handle of the controller.
+ @param DriverImagePath A pointer to the driver device path that was returned in a prior
+ call to GetDriverPath().
+ @param DriverImageHandle The driver image handle that was returned by LoadImage()
+ when the driver specified by DriverImagePath was loaded
+ into memory.
+
+ @retval EFI_UNSUPPORTED
+**/
+EFI_STATUS
+EFIAPI
+DriverLoaded (
+ IN EFI_PLATFORM_DRIVER_OVERRIDE_PROTOCOL *This,
+ IN EFI_HANDLE ControllerHandle,
+ IN EFI_DEVICE_PATH_PROTOCOL *DriverImagePath,
+ IN EFI_HANDLE DriverImageHandle
+ )
+{
+ return EFI_UNSUPPORTED;
+}
+
+/**
The driver Entry Point. The funciton will export a disk device class formset and
its callback function to hii database.
@@ -1367,13 +1496,14 @@ PlatOverMngrCallback (
**/
EFI_STATUS
EFIAPI
-PlatOverMngrInit (
+PlatDriOverrideDxeInit (
IN EFI_HANDLE ImageHandle,
IN EFI_SYSTEM_TABLE *SystemTable
)
{
EFI_STATUS Status;
EFI_FORM_BROWSER2_PROTOCOL *FormBrowser2;
+ VOID *Instance;
//
// There should only be one Form Configuration protocol
@@ -1387,6 +1517,24 @@ PlatOverMngrInit (
return Status;
}
+ //
+ // According to UEFI spec, there can be at most a single instance
+ // in the system of the EFI_PLATFORM_DRIVER_OVERRIDE_PROTOCOL.
+ // So here we check the existence.
+ //
+ Status = gBS->LocateProtocol (
+ &gEfiPlatformDriverOverrideProtocolGuid,
+ NULL,
+ &Instance
+ );
+ //
+ // If there was no error, assume there is an installation and return error
+ //
+ if (!EFI_ERROR (Status)) {
+ return EFI_ALREADY_STARTED;
+ }
+
+ mCallerImageHandle = ImageHandle;
mCallbackInfo = AllocateZeroPool (sizeof (EFI_CALLBACK_INFO));
if (mCallbackInfo == NULL) {
return EFI_BAD_BUFFER_SIZE;
@@ -1396,9 +1544,12 @@ PlatOverMngrInit (
mCallbackInfo->ConfigAccess.ExtractConfig = PlatOverMngrExtractConfig;
mCallbackInfo->ConfigAccess.RouteConfig = PlatOverMngrRouteConfig;
mCallbackInfo->ConfigAccess.Callback = PlatOverMngrCallback;
-
+ mCallbackInfo->PlatformDriverOverride.GetDriver = GetDriver;
+ mCallbackInfo->PlatformDriverOverride.GetDriverPath = GetDriverPath;
+ mCallbackInfo->PlatformDriverOverride.DriverLoaded = DriverLoaded;
//
// Install Device Path Protocol and Config Access protocol to driver handle
+ // Install Platform Driver Override Protocol to driver handle
//
Status = gBS->InstallMultipleProtocolInterfaces (
&mCallbackInfo->DriverHandle,
@@ -1406,6 +1557,8 @@ PlatOverMngrInit (
&mHiiVendorDevicePath,
&gEfiHiiConfigAccessProtocolGuid,
&mCallbackInfo->ConfigAccess,
+ &gEfiPlatformDriverOverrideProtocolGuid,
+ &mCallbackInfo->PlatformDriverOverride,
NULL
);
if (EFI_ERROR (Status)) {
@@ -1419,7 +1572,7 @@ PlatOverMngrInit (
&mPlatformOverridesManagerGuid,
mCallbackInfo->DriverHandle,
VfrBin,
- PlatOverMngrStrings,
+ PlatDriOverrideDxeStrings,
NULL
);
if (mCallbackInfo->RegisteredHandle == NULL) {
@@ -1448,22 +1601,8 @@ PlatOverMngrInit (
ZeroMem (mDriverImageFilePathToken, MAX_CHOICE_NUM * sizeof (EFI_STRING_ID));
ZeroMem (mControllerToken, MAX_CHOICE_NUM * sizeof (EFI_STRING_ID));
ZeroMem (mDriverImageProtocol, MAX_CHOICE_NUM * sizeof (EFI_LOADED_IMAGE_PROTOCOL *));
-
- //
- // Show the page
- //
- Status = FormBrowser2->SendForm (
- FormBrowser2,
- &mCallbackInfo->RegisteredHandle,
- 1,
- NULL,
- 0,
- NULL,
- NULL
- );
-
- HiiRemovePackages (mCallbackInfo->RegisteredHandle);
- Status = EFI_SUCCESS;
+
+ return EFI_SUCCESS;
Finish:
if (mCallbackInfo->DriverHandle != NULL) {
@@ -1473,9 +1612,15 @@ Finish:
&mHiiVendorDevicePath,
&gEfiHiiConfigAccessProtocolGuid,
&mCallbackInfo->ConfigAccess,
+ &gEfiPlatformDriverOverrideProtocolGuid,
+ &mCallbackInfo->PlatformDriverOverride,
NULL
);
}
+
+ if (mCallbackInfo->RegisteredHandle != NULL) {
+ HiiRemovePackages (mCallbackInfo->RegisteredHandle);
+ }
if (mCallbackInfo != NULL) {
FreePool (mCallbackInfo);
@@ -1485,43 +1630,38 @@ Finish:
}
/**
- Converting a given device to an unicode string.
-
- This function will dependent on gEfiDevicePathToTextProtocolGuid, if protocol
- does not installed, then return unknown device path L"?" directly.
-
- @param DevPath Given device path instance
-
- @return Converted string from given device path.
- @retval L"?" Can not locate gEfiDevicePathToTextProtocolGuid protocol for converting.
+ Unload its installed protocol.
+
+ @param[in] ImageHandle Handle that identifies the image to be unloaded.
+
+ @retval EFI_SUCCESS The image has been unloaded.
**/
-CHAR16 *
-DevicePathToStr (
- IN EFI_DEVICE_PATH_PROTOCOL *DevPath
+EFI_STATUS
+EFIAPI
+PlatDriOverrideDxeUnload (
+ IN EFI_HANDLE ImageHandle
)
{
- EFI_STATUS Status;
- EFI_DEVICE_PATH_TO_TEXT_PROTOCOL *DevPathToText;
- CHAR16 *ToText;
-
- if (DevPath == NULL) {
- return L"";
+ if (mCallbackInfo->DriverHandle != NULL) {
+ gBS->UninstallMultipleProtocolInterfaces (
+ mCallbackInfo->DriverHandle,
+ &gEfiDevicePathProtocolGuid,
+ &mHiiVendorDevicePath,
+ &gEfiHiiConfigAccessProtocolGuid,
+ &mCallbackInfo->ConfigAccess,
+ &gEfiPlatformDriverOverrideProtocolGuid,
+ &mCallbackInfo->PlatformDriverOverride,
+ NULL
+ );
}
-
- Status = gBS->LocateProtocol (
- &gEfiDevicePathToTextProtocolGuid,
- NULL,
- (VOID **) &DevPathToText
- );
- if (!EFI_ERROR (Status)) {
- ToText = DevPathToText->ConvertDevicePathToText (
- DevPath,
- FALSE,
- TRUE
- );
- ASSERT (ToText != NULL);
- return ToText;
+
+ if (mCallbackInfo->RegisteredHandle != NULL) {
+ HiiRemovePackages (mCallbackInfo->RegisteredHandle);
}
- return L"?";
+ if (mCallbackInfo != NULL) {
+ FreePool (mCallbackInfo);
+ }
+
+ return EFI_SUCCESS;
}
diff --git a/MdeModulePkg/Library/DxePlatDriOverLib/PlatDriOverLib.c b/MdeModulePkg/Universal/PlatformDriOverrideDxe/PlatDriOverrideLib.c
index 006de75..48beba0 100644
--- a/MdeModulePkg/Library/DxePlatDriOverLib/PlatDriOverLib.c
+++ b/MdeModulePkg/Universal/PlatformDriOverrideDxe/PlatDriOverrideLib.c
@@ -1,7 +1,7 @@
/** @file
- Implementation of Platform Driver Override Library.
+ Implementation of the shared functions to do the platform driver vverride mapping.
- Copyright (c) 2007 - 2008, Intel Corporation
+ Copyright (c) 2007 - 2009, Intel Corporation
All rights reserved. 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
@@ -12,11 +12,542 @@
**/
-#include "PlatDriOver.h"
+#include "InternalPlatDriOverrideDxe.h"
+
+#define PLATFORM_OVERRIDE_ITEM_SIGNATURE SIGNATURE_32('p','d','o','i')
+ typedef struct _PLATFORM_OVERRIDE_ITEM {
+ UINTN Signature;
+ LIST_ENTRY Link;
+ UINT32 DriverInfoNum;
+ EFI_DEVICE_PATH_PROTOCOL *ControllerDevicePath;
+ ///
+ /// List of DRIVER_IMAGE_INFO
+ ///
+ LIST_ENTRY DriverInfoList;
+ EFI_HANDLE LastReturnedImageHandle;
+} PLATFORM_OVERRIDE_ITEM;
+
+#define DRIVER_IMAGE_INFO_SIGNATURE SIGNATURE_32('p','d','i','i')
+typedef struct _DRIVER_IMAGE_INFO {
+ UINTN Signature;
+ LIST_ENTRY Link;
+ EFI_HANDLE ImageHandle;
+ EFI_DEVICE_PATH_PROTOCOL *DriverImagePath;
+ BOOLEAN UnLoadable;
+ BOOLEAN UnStartable;
+} DRIVER_IMAGE_INFO;
+
+#define DEVICE_PATH_STACK_ITEM_SIGNATURE SIGNATURE_32('d','p','s','i')
+typedef struct _DEVICE_PATH_STACK_ITEM{
+ UINTN Signature;
+ LIST_ENTRY Link;
+ EFI_DEVICE_PATH_PROTOCOL *DevicePath;
+} DEVICE_PATH_STACK_ITEM;
+
LIST_ENTRY mDevicePathStack = INITIALIZE_LIST_HEAD_VARIABLE (mDevicePathStack);
/**
+ Push a controller device path into a globle device path list.
+
+ @param DevicePath The controller device path to push into stack
+
+ @retval EFI_SUCCESS Device path successfully pushed into the stack.
+
+**/
+EFI_STATUS
+EFIAPI
+PushDevPathStack (
+ IN EFI_DEVICE_PATH_PROTOCOL *DevicePath
+ )
+{
+ DEVICE_PATH_STACK_ITEM *DevicePathStackItem;
+
+ DevicePathStackItem = AllocateZeroPool (sizeof (DEVICE_PATH_STACK_ITEM));
+ ASSERT (DevicePathStackItem != NULL);
+ DevicePathStackItem->Signature = DEVICE_PATH_STACK_ITEM_SIGNATURE;
+ DevicePathStackItem->DevicePath = DuplicateDevicePath (DevicePath);
+ InsertTailList (&mDevicePathStack, &DevicePathStackItem->Link);
+ return EFI_SUCCESS;
+}
+
+
+/**
+ Pop a controller device path from a globle device path list
+
+ @param DevicePath The controller device path popped from stack
+
+ @retval EFI_SUCCESS Controller device path successfully popped.
+ @retval EFI_NOT_FOUND Stack is empty.
+
+**/
+EFI_STATUS
+EFIAPI
+PopDevPathStack (
+ OUT EFI_DEVICE_PATH_PROTOCOL **DevicePath
+ )
+{
+ DEVICE_PATH_STACK_ITEM *DevicePathStackItem;
+ LIST_ENTRY *ItemListIndex;
+
+ ItemListIndex = mDevicePathStack.BackLink;
+ //
+ // Check if the stack is empty
+ //
+ if (ItemListIndex != &mDevicePathStack){
+ DevicePathStackItem = CR(ItemListIndex, DEVICE_PATH_STACK_ITEM, Link, DEVICE_PATH_STACK_ITEM_SIGNATURE);
+ if (DevicePath != NULL) {
+ *DevicePath = DuplicateDevicePath (DevicePathStackItem->DevicePath);
+ }
+ FreePool (DevicePathStackItem->DevicePath);
+ RemoveEntryList (&DevicePathStackItem->Link);
+ FreePool (DevicePathStackItem);
+ return EFI_SUCCESS;
+ }
+ return EFI_NOT_FOUND;
+}
+
+
+/**
+ Check whether a controller device path is in a globle device path list
+
+ @param DevicePath The controller device path to check
+
+ @retval TRUE DevicePath exists in the stack.
+ @retval FALSE DevicePath does not exist in the stack.
+
+**/
+BOOLEAN
+EFIAPI
+CheckExistInStack (
+ IN EFI_DEVICE_PATH_PROTOCOL *DevicePath
+ )
+{
+ DEVICE_PATH_STACK_ITEM *DevicePathStackItem;
+ LIST_ENTRY *ItemListIndex;
+ UINTN DevicePathSize;
+
+ ItemListIndex = mDevicePathStack.BackLink;
+ while (ItemListIndex != &mDevicePathStack){
+ DevicePathStackItem = CR(ItemListIndex, DEVICE_PATH_STACK_ITEM, Link, DEVICE_PATH_STACK_ITEM_SIGNATURE);
+ DevicePathSize = GetDevicePathSize (DevicePath);
+ if (DevicePathSize == GetDevicePathSize (DevicePathStackItem->DevicePath)) {
+ if (CompareMem (DevicePath, DevicePathStackItem->DevicePath, DevicePathSize) == 0) {
+ return TRUE;
+ }
+ }
+ ItemListIndex = ItemListIndex->BackLink;
+ }
+
+ return FALSE;
+}
+
+/**
+ Update the FV file device path if it is not valid.
+
+ According to a file GUID, check a Fv file device path is valid. If it is invalid,
+ try to return the valid device path.
+ FV address maybe changes for memory layout adjust from time to time, use this funciton
+ could promise the Fv file device path is right.
+
+ @param DevicePath On input, the FV file device path to check
+ On output, the updated valid FV file device path
+ @param FileGuid The FV file GUID
+ @param CallerImageHandle Image handle of the caller
+
+ @retval EFI_INVALID_PARAMETER the input DevicePath or FileGuid is invalid
+ parameter
+ @retval EFI_UNSUPPORTED the input DevicePath does not contain FV file
+ GUID at all
+ @retval EFI_ALREADY_STARTED the input DevicePath has pointed to FV file, it
+ is valid
+ @retval EFI_SUCCESS Successfully updated the invalid DevicePath,
+ and return the updated device path in DevicePath
+
+**/
+EFI_STATUS
+EFIAPI
+UpdateFvFileDevicePath (
+ IN OUT EFI_DEVICE_PATH_PROTOCOL **DevicePath,
+ IN EFI_GUID *FileGuid,
+ IN EFI_HANDLE CallerImageHandle
+ )
+{
+ EFI_DEVICE_PATH_PROTOCOL *TempDevicePath;
+ EFI_DEVICE_PATH_PROTOCOL *LastDeviceNode;
+ EFI_STATUS Status;
+ EFI_GUID *GuidPoint;
+ UINTN Index;
+ UINTN FvHandleCount;
+ EFI_HANDLE *FvHandleBuffer;
+ EFI_FV_FILETYPE Type;
+ UINTN Size;
+ EFI_FV_FILE_ATTRIBUTES Attributes;
+ UINT32 AuthenticationStatus;
+ BOOLEAN FindFvFile;
+ EFI_LOADED_IMAGE_PROTOCOL *LoadedImage;
+ EFI_FIRMWARE_VOLUME2_PROTOCOL *Fv;
+ MEDIA_FW_VOL_FILEPATH_DEVICE_PATH FvFileNode;
+ EFI_HANDLE FoundFvHandle;
+ EFI_DEVICE_PATH_PROTOCOL *NewDevicePath;
+ BOOLEAN HasFvNode;
+
+ if (DevicePath == NULL) {
+ return EFI_INVALID_PARAMETER;
+ }
+
+ if (*DevicePath == NULL) {
+ return EFI_INVALID_PARAMETER;
+ }
+
+ //
+ // Check whether the device path points to the default the input FV file
+ //
+ TempDevicePath = *DevicePath;
+ LastDeviceNode = TempDevicePath;
+ while (!IsDevicePathEnd (TempDevicePath)) {
+ LastDeviceNode = TempDevicePath;
+ TempDevicePath = NextDevicePathNode (TempDevicePath);
+ }
+ GuidPoint = EfiGetNameGuidFromFwVolDevicePathNode ((MEDIA_FW_VOL_FILEPATH_DEVICE_PATH *) LastDeviceNode);
+ if (GuidPoint == NULL) {
+ //
+ // If this option does not point to a FV file, just return EFI_UNSUPPORTED.
+ //
+ return EFI_UNSUPPORTED;
+ }
+
+ if (FileGuid != NULL) {
+ if (!CompareGuid (GuidPoint, FileGuid)) {
+ //
+ // If the FV file is not the input file GUID, just return EFI_UNSUPPORTED
+ //
+ return EFI_UNSUPPORTED;
+ }
+ } else {
+ FileGuid = GuidPoint;
+ }
+
+ //
+ // Check to see if the device path contains memory map node
+ //
+ TempDevicePath = *DevicePath;
+ HasFvNode = FALSE;
+ while (!IsDevicePathEnd (TempDevicePath)) {
+ //
+ // Use old Device Path
+ //
+ if (DevicePathType (TempDevicePath) == HARDWARE_DEVICE_PATH &&
+ DevicePathSubType (TempDevicePath) == HW_MEMMAP_DP) {
+ HasFvNode = TRUE;
+ break;
+ }
+ TempDevicePath = NextDevicePathNode (TempDevicePath);
+ }
+
+ if (!HasFvNode) {
+ return EFI_UNSUPPORTED;
+ }
+
+ //
+ // Check whether the input Fv file device path is valid
+ //
+ TempDevicePath = *DevicePath;
+ FoundFvHandle = NULL;
+ Status = gBS->LocateDevicePath (
+ &gEfiFirmwareVolume2ProtocolGuid,
+ &TempDevicePath,
+ &FoundFvHandle
+ );
+ if (!EFI_ERROR (Status)) {
+ Status = gBS->HandleProtocol (
+ FoundFvHandle,
+ &gEfiFirmwareVolume2ProtocolGuid,
+ (VOID **) &Fv
+ );
+ if (!EFI_ERROR (Status)) {
+ //
+ // Set FV ReadFile Buffer as NULL, only need to check whether input Fv file exist there
+ //
+ Status = Fv->ReadFile (
+ Fv,
+ FileGuid,
+ NULL,
+ &Size,
+ &Type,
+ &Attributes,
+ &AuthenticationStatus
+ );
+ if (!EFI_ERROR (Status)) {
+ return EFI_ALREADY_STARTED;
+ }
+ }
+ }
+
+ //
+ // Look for the input wanted FV file in current FV
+ // First, try to look for in Caller own FV. Caller and input wanted FV file usually are in the same FV
+ //
+ FindFvFile = FALSE;
+ FoundFvHandle = NULL;
+ Status = gBS->HandleProtocol (
+ CallerImageHandle,
+ &gEfiLoadedImageProtocolGuid,
+ (VOID **) &LoadedImage
+ );
+ if (!EFI_ERROR (Status)) {
+ Status = gBS->HandleProtocol (
+ LoadedImage->DeviceHandle,
+ &gEfiFirmwareVolume2ProtocolGuid,
+ (VOID **) &Fv
+ );
+ if (!EFI_ERROR (Status)) {
+ Status = Fv->ReadFile (
+ Fv,
+ FileGuid,
+ NULL,
+ &Size,
+ &Type,
+ &Attributes,
+ &AuthenticationStatus
+ );
+ if (!EFI_ERROR (Status)) {
+ FindFvFile = TRUE;
+ FoundFvHandle = LoadedImage->DeviceHandle;
+ }
+ }
+ }
+ //
+ // Second, if fail to find, try to enumerate all FV
+ //
+ if (!FindFvFile) {
+ gBS->LocateHandleBuffer (
+ ByProtocol,
+ &gEfiFirmwareVolume2ProtocolGuid,
+ NULL,
+ &FvHandleCount,
+ &FvHandleBuffer
+ );
+ for (Index = 0; Index < FvHandleCount; Index++) {
+ gBS->HandleProtocol (
+ FvHandleBuffer[Index],
+ &gEfiFirmwareVolume2ProtocolGuid,
+ (VOID **) &Fv
+ );
+
+ Status = Fv->ReadFile (
+ Fv,
+ FileGuid,
+ NULL,
+ &Size,
+ &Type,
+ &Attributes,
+ &AuthenticationStatus
+ );
+ if (EFI_ERROR (Status)) {
+ //
+ // Skip if input Fv file not in the FV
+ //
+ continue;
+ }
+ FindFvFile = TRUE;
+ FoundFvHandle = FvHandleBuffer[Index];
+ break;
+ }
+ }
+
+ if (FindFvFile) {
+ //
+ // Build the shell device path
+ //
+ NewDevicePath = DevicePathFromHandle (FoundFvHandle);
+ EfiInitializeFwVolDevicepathNode (&FvFileNode, FileGuid);
+ NewDevicePath = AppendDevicePathNode (NewDevicePath, (EFI_DEVICE_PATH_PROTOCOL *) &FvFileNode);
+ *DevicePath = NewDevicePath;
+ return EFI_SUCCESS;
+ }
+ return EFI_NOT_FOUND;
+}
+
+/**
+ Gets the data and size of a variable.
+
+ Read the EFI variable (VendorGuid/Name) and return a dynamically allocated
+ buffer, and the size of the buffer. If failure return NULL.
+
+ @param Name String part of EFI variable name
+ @param VendorGuid GUID part of EFI variable name
+ @param VariableSize Returns the size of the EFI variable that was
+ read
+
+ @return Dynamically allocated memory that contains a copy of the EFI variable.
+ Caller is responsible freeing the buffer.
+ @retval NULL Variable was not read
+
+**/
+VOID *
+EFIAPI
+GetVariableAndSize (
+ IN CHAR16 *Name,
+ IN EFI_GUID *VendorGuid,
+ OUT UINTN *VariableSize
+ )
+{
+ EFI_STATUS Status;
+ UINTN BufferSize;
+ VOID *Buffer;
+
+ Buffer = NULL;
+
+ //
+ // Pass in a zero size buffer to find the required buffer size.
+ //
+ BufferSize = 0;
+ Status = gRT->GetVariable (Name, VendorGuid, NULL, &BufferSize, Buffer);
+ if (Status == EFI_BUFFER_TOO_SMALL) {
+ //
+ // Allocate the buffer to return
+ //
+ Buffer = AllocateZeroPool (BufferSize);
+ if (Buffer == NULL) {
+ return NULL;
+ }
+ //
+ // Read variable into the allocated buffer.
+ //
+ Status = gRT->GetVariable (Name, VendorGuid, NULL, &BufferSize, Buffer);
+ if (EFI_ERROR (Status)) {
+ BufferSize = 0;
+ }
+ }
+
+ *VariableSize = BufferSize;
+ return Buffer;
+}
+
+/**
+ Connect to the handle to a device on the device path.
+
+ 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.
+
+ @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
+ConnectDevicePath (
+ IN EFI_DEVICE_PATH_PROTOCOL *DevicePathToConnect
+ )
+{
+ EFI_STATUS Status;
+ EFI_DEVICE_PATH_PROTOCOL *DevicePath;
+ EFI_DEVICE_PATH_PROTOCOL *CopyOfDevicePath;
+ EFI_DEVICE_PATH_PROTOCOL *Instance;
+ EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath;
+ EFI_DEVICE_PATH_PROTOCOL *Next;
+ EFI_HANDLE Handle;
+ EFI_HANDLE PreviousHandle;
+ UINTN Size;
+
+ if (DevicePathToConnect == NULL) {
+ return EFI_SUCCESS;
+ }
+
+ DevicePath = DuplicateDevicePath (DevicePathToConnect);
+ CopyOfDevicePath = DevicePath;
+ if (DevicePath == NULL) {
+ return EFI_OUT_OF_RESOURCES;
+ }
+
+ do {
+ //
+ // The outer loop handles multi instance device paths.
+ // Only console variables contain multiple instance device paths.
+ //
+ // After this call DevicePath points to the next Instance
+ //
+ Instance = GetNextDevicePathInstance (&DevicePath, &Size);
+ ASSERT (Instance != NULL);
+
+ Next = Instance;
+ while (!IsDevicePathEndType (Next)) {
+ Next = NextDevicePathNode (Next);
+ }
+
+ SetDevicePathEndNode (Next);
+
+ //
+ // Start the real work of connect with RemainingDevicePath
+ //
+ PreviousHandle = NULL;
+ do {
+ //
+ // Find the handle that best matches the Device Path. If it is only a
+ // partial match the remaining part of the device path is returned in
+ // RemainingDevicePath.
+ //
+ RemainingDevicePath = Instance;
+ Status = gBS->LocateDevicePath (&gEfiDevicePathProtocolGuid, &RemainingDevicePath, &Handle);
+
+ if (!EFI_ERROR (Status)) {
+ if (Handle == PreviousHandle) {
+ //
+ // If no forward progress is made try invoking the Dispatcher.
+ // A new FV may have been added to the system an new drivers
+ // may now be found.
+ // Status == EFI_SUCCESS means a driver was dispatched
+ // Status == EFI_NOT_FOUND means no new drivers were dispatched
+ //
+ Status = gDS->Dispatch ();
+ }
+
+ if (!EFI_ERROR (Status)) {
+ PreviousHandle = Handle;
+ //
+ // Connect all drivers that apply to Handle and RemainingDevicePath,
+ // the Recursive flag is FALSE so only one level will be expanded.
+ //
+ // Do not check the connect status here, if the connect controller fail,
+ // then still give the chance to do dispatch, because partial
+ // RemainingDevicepath may be in the new FV
+ //
+ // 1. If the connect fails, RemainingDevicepath and handle will not
+ // change, so next time will do the dispatch, then dispatch's status
+ // will take effect
+ // 2. If the connect succeeds, the RemainingDevicepath and handle will
+ // change, then avoid the dispatch, we have chance to continue the
+ // next connection
+ //
+ gBS->ConnectController (Handle, NULL, RemainingDevicePath, FALSE);
+ }
+ }
+ //
+ // Loop until RemainingDevicePath is an empty device path
+ //
+ } while (!EFI_ERROR (Status) && !IsDevicePathEnd (RemainingDevicePath));
+
+ } while (DevicePath != NULL);
+
+ if (CopyOfDevicePath != NULL) {
+ FreePool (CopyOfDevicePath);
+ }
+ //
+ // All handle with DevicePath exists in the handle database
+ //
+ return Status;
+}
+
+/**
Free all the mapping database memory resource and initialize the mapping list entry.
@param MappingDataBase Mapping database list entry pointer
@@ -149,7 +680,7 @@ InitOverridesMapping (
//
// Check the environment variable(s) that contain the override mappings .
//
- VariableBuffer = GetVariableAndSize (L"PlatDriOver", &gEfiOverrideVariableGuid, &BufferSize);
+ VariableBuffer = GetVariableAndSize (L"PlatDriOver", &gEfiCallerIdGuid, &BufferSize);
ASSERT ((UINTN) VariableBuffer % sizeof(UINTN) == 0);
if (VariableBuffer == NULL) {
return EFI_NOT_FOUND;
@@ -241,7 +772,7 @@ InitOverridesMapping (
//
if (NotEnd != 0) {
UnicodeSPrint (OverrideVariableName, sizeof (OverrideVariableName), L"PlatDriOver%d", VariableNum++);
- VariableBuffer = GetVariableAndSize (OverrideVariableName, &gEfiOverrideVariableGuid, &BufferSize);
+ VariableBuffer = GetVariableAndSize (OverrideVariableName, &gEfiCallerIdGuid, &BufferSize);
ASSERT ((UINTN) VariableBuffer % sizeof(UINTN) == 0);
if (VariableBuffer == NULL) {
FreeMappingDatabase (MappingDataBase);
@@ -327,7 +858,7 @@ DeleteOverridesVariables (
// Get environment variable(s) number
//
VariableNum = 0;
- VariableBuffer = GetVariableAndSize (L"PlatDriOver", &gEfiOverrideVariableGuid, &BufferSize);
+ VariableBuffer = GetVariableAndSize (L"PlatDriOver", &gEfiCallerIdGuid, &BufferSize);
VariableNum++;
if (VariableBuffer == NULL) {
return EFI_NOT_FOUND;
@@ -337,7 +868,7 @@ DeleteOverridesVariables (
//
while ((*(UINT32*)VariableBuffer) != 0) {
UnicodeSPrint (OverrideVariableName, sizeof (OverrideVariableName), L"PlatDriOver%d", VariableNum);
- VariableBuffer = GetVariableAndSize (OverrideVariableName, &gEfiOverrideVariableGuid, &BufferSize);
+ VariableBuffer = GetVariableAndSize (OverrideVariableName, &gEfiCallerIdGuid, &BufferSize);
VariableNum++;
ASSERT (VariableBuffer != NULL);
}
@@ -347,7 +878,7 @@ DeleteOverridesVariables (
//
Status = gRT->SetVariable (
L"PlatDriOver",
- &gEfiOverrideVariableGuid,
+ &gEfiCallerIdGuid,
EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_NON_VOLATILE,
0,
NULL
@@ -357,7 +888,7 @@ DeleteOverridesVariables (
UnicodeSPrint (OverrideVariableName, sizeof (OverrideVariableName), L"PlatDriOver%d", Index);
Status = gRT->SetVariable (
OverrideVariableName,
- &gEfiOverrideVariableGuid,
+ &gEfiCallerIdGuid,
EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_NON_VOLATILE,
0,
NULL
@@ -522,7 +1053,7 @@ SaveOverridesMapping (
Status = gRT->SetVariable (
OverrideVariableName,
- &gEfiOverrideVariableGuid,
+ &gEfiCallerIdGuid,
EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_NON_VOLATILE,
VariableNeededSize,
VariableBuffer
@@ -1365,506 +1896,3 @@ DeleteDriverImage (
return EFI_SUCCESS;
}
-
-/**
- Push a controller device path into a globle device path list.
-
- @param DevicePath The controller device path to push into stack
-
- @retval EFI_SUCCESS Device path successfully pushed into the stack.
-
-**/
-EFI_STATUS
-EFIAPI
-PushDevPathStack (
- IN EFI_DEVICE_PATH_PROTOCOL *DevicePath
- )
-{
- DEVICE_PATH_STACK_ITEM *DevicePathStackItem;
-
- DevicePathStackItem = AllocateZeroPool (sizeof (DEVICE_PATH_STACK_ITEM));
- ASSERT (DevicePathStackItem != NULL);
- DevicePathStackItem->Signature = DEVICE_PATH_STACK_ITEM_SIGNATURE;
- DevicePathStackItem->DevicePath = DuplicateDevicePath (DevicePath);
- InsertTailList (&mDevicePathStack, &DevicePathStackItem->Link);
- return EFI_SUCCESS;
-}
-
-
-/**
- Pop a controller device path from a globle device path list
-
- @param DevicePath The controller device path popped from stack
-
- @retval EFI_SUCCESS Controller device path successfully popped.
- @retval EFI_NOT_FOUND Stack is empty.
-
-**/
-EFI_STATUS
-EFIAPI
-PopDevPathStack (
- OUT EFI_DEVICE_PATH_PROTOCOL **DevicePath
- )
-{
- DEVICE_PATH_STACK_ITEM *DevicePathStackItem;
- LIST_ENTRY *ItemListIndex;
-
- ItemListIndex = mDevicePathStack.BackLink;
- //
- // Check if the stack is empty
- //
- if (ItemListIndex != &mDevicePathStack){
- DevicePathStackItem = CR(ItemListIndex, DEVICE_PATH_STACK_ITEM, Link, DEVICE_PATH_STACK_ITEM_SIGNATURE);
- if (DevicePath != NULL) {
- *DevicePath = DuplicateDevicePath (DevicePathStackItem->DevicePath);
- }
- FreePool (DevicePathStackItem->DevicePath);
- RemoveEntryList (&DevicePathStackItem->Link);
- FreePool (DevicePathStackItem);
- return EFI_SUCCESS;
- }
- return EFI_NOT_FOUND;
-}
-
-
-/**
- Check whether a controller device path is in a globle device path list
-
- @param DevicePath The controller device path to check
-
- @retval TRUE DevicePath exists in the stack.
- @retval FALSE DevicePath does not exist in the stack.
-
-**/
-BOOLEAN
-EFIAPI
-CheckExistInStack (
- IN EFI_DEVICE_PATH_PROTOCOL *DevicePath
- )
-{
- DEVICE_PATH_STACK_ITEM *DevicePathStackItem;
- LIST_ENTRY *ItemListIndex;
- UINTN DevicePathSize;
-
- ItemListIndex = mDevicePathStack.BackLink;
- while (ItemListIndex != &mDevicePathStack){
- DevicePathStackItem = CR(ItemListIndex, DEVICE_PATH_STACK_ITEM, Link, DEVICE_PATH_STACK_ITEM_SIGNATURE);
- DevicePathSize = GetDevicePathSize (DevicePath);
- if (DevicePathSize == GetDevicePathSize (DevicePathStackItem->DevicePath)) {
- if (CompareMem (DevicePath, DevicePathStackItem->DevicePath, DevicePathSize) == 0) {
- return TRUE;
- }
- }
- ItemListIndex = ItemListIndex->BackLink;
- }
-
- return FALSE;
-}
-
-
-/**
- Update the FV file device path if it is not valid.
-
- According to a file GUID, check a Fv file device path is valid. If it is invalid,
- try to return the valid device path.
- FV address maybe changes for memory layout adjust from time to time, use this funciton
- could promise the Fv file device path is right.
-
- @param DevicePath On input, the FV file device path to check
- On output, the updated valid FV file device path
- @param FileGuid The FV file GUID
- @param CallerImageHandle Image handle of the caller
-
- @retval EFI_INVALID_PARAMETER the input DevicePath or FileGuid is invalid
- parameter
- @retval EFI_UNSUPPORTED the input DevicePath does not contain FV file
- GUID at all
- @retval EFI_ALREADY_STARTED the input DevicePath has pointed to FV file, it
- is valid
- @retval EFI_SUCCESS Successfully updated the invalid DevicePath,
- and return the updated device path in DevicePath
-
-**/
-EFI_STATUS
-EFIAPI
-UpdateFvFileDevicePath (
- IN OUT EFI_DEVICE_PATH_PROTOCOL **DevicePath,
- IN EFI_GUID *FileGuid,
- IN EFI_HANDLE CallerImageHandle
- )
-{
- EFI_DEVICE_PATH_PROTOCOL *TempDevicePath;
- EFI_DEVICE_PATH_PROTOCOL *LastDeviceNode;
- EFI_STATUS Status;
- EFI_GUID *GuidPoint;
- UINTN Index;
- UINTN FvHandleCount;
- EFI_HANDLE *FvHandleBuffer;
- EFI_FV_FILETYPE Type;
- UINTN Size;
- EFI_FV_FILE_ATTRIBUTES Attributes;
- UINT32 AuthenticationStatus;
- BOOLEAN FindFvFile;
- EFI_LOADED_IMAGE_PROTOCOL *LoadedImage;
- EFI_FIRMWARE_VOLUME2_PROTOCOL *Fv;
- MEDIA_FW_VOL_FILEPATH_DEVICE_PATH FvFileNode;
- EFI_HANDLE FoundFvHandle;
- EFI_DEVICE_PATH_PROTOCOL *NewDevicePath;
- BOOLEAN HasFvNode;
-
- if (DevicePath == NULL) {
- return EFI_INVALID_PARAMETER;
- }
-
- if (*DevicePath == NULL) {
- return EFI_INVALID_PARAMETER;
- }
-
- //
- // Check whether the device path points to the default the input FV file
- //
- TempDevicePath = *DevicePath;
- LastDeviceNode = TempDevicePath;
- while (!IsDevicePathEnd (TempDevicePath)) {
- LastDeviceNode = TempDevicePath;
- TempDevicePath = NextDevicePathNode (TempDevicePath);
- }
- GuidPoint = EfiGetNameGuidFromFwVolDevicePathNode ((MEDIA_FW_VOL_FILEPATH_DEVICE_PATH *) LastDeviceNode);
- if (GuidPoint == NULL) {
- //
- // If this option does not point to a FV file, just return EFI_UNSUPPORTED.
- //
- return EFI_UNSUPPORTED;
- }
-
- if (FileGuid != NULL) {
- if (!CompareGuid (GuidPoint, FileGuid)) {
- //
- // If the FV file is not the input file GUID, just return EFI_UNSUPPORTED
- //
- return EFI_UNSUPPORTED;
- }
- } else {
- FileGuid = GuidPoint;
- }
-
- //
- // Check to see if the device path contains memory map node
- //
- TempDevicePath = *DevicePath;
- HasFvNode = FALSE;
- while (!IsDevicePathEnd (TempDevicePath)) {
- //
- // Use old Device Path
- //
- if (DevicePathType (TempDevicePath) == HARDWARE_DEVICE_PATH &&
- DevicePathSubType (TempDevicePath) == HW_MEMMAP_DP) {
- HasFvNode = TRUE;
- break;
- }
- TempDevicePath = NextDevicePathNode (TempDevicePath);
- }
-
- if (!HasFvNode) {
- return EFI_UNSUPPORTED;
- }
-
- //
- // Check whether the input Fv file device path is valid
- //
- TempDevicePath = *DevicePath;
- FoundFvHandle = NULL;
- Status = gBS->LocateDevicePath (
- &gEfiFirmwareVolume2ProtocolGuid,
- &TempDevicePath,
- &FoundFvHandle
- );
- if (!EFI_ERROR (Status)) {
- Status = gBS->HandleProtocol (
- FoundFvHandle,
- &gEfiFirmwareVolume2ProtocolGuid,
- (VOID **) &Fv
- );
- if (!EFI_ERROR (Status)) {
- //
- // Set FV ReadFile Buffer as NULL, only need to check whether input Fv file exist there
- //
- Status = Fv->ReadFile (
- Fv,
- FileGuid,
- NULL,
- &Size,
- &Type,
- &Attributes,
- &AuthenticationStatus
- );
- if (!EFI_ERROR (Status)) {
- return EFI_ALREADY_STARTED;
- }
- }
- }
-
- //
- // Look for the input wanted FV file in current FV
- // First, try to look for in Caller own FV. Caller and input wanted FV file usually are in the same FV
- //
- FindFvFile = FALSE;
- FoundFvHandle = NULL;
- Status = gBS->HandleProtocol (
- CallerImageHandle,
- &gEfiLoadedImageProtocolGuid,
- (VOID **) &LoadedImage
- );
- if (!EFI_ERROR (Status)) {
- Status = gBS->HandleProtocol (
- LoadedImage->DeviceHandle,
- &gEfiFirmwareVolume2ProtocolGuid,
- (VOID **) &Fv
- );
- if (!EFI_ERROR (Status)) {
- Status = Fv->ReadFile (
- Fv,
- FileGuid,
- NULL,
- &Size,
- &Type,
- &Attributes,
- &AuthenticationStatus
- );
- if (!EFI_ERROR (Status)) {
- FindFvFile = TRUE;
- FoundFvHandle = LoadedImage->DeviceHandle;
- }
- }
- }
- //
- // Second, if fail to find, try to enumerate all FV
- //
- if (!FindFvFile) {
- gBS->LocateHandleBuffer (
- ByProtocol,
- &gEfiFirmwareVolume2ProtocolGuid,
- NULL,
- &FvHandleCount,
- &FvHandleBuffer
- );
- for (Index = 0; Index < FvHandleCount; Index++) {
- gBS->HandleProtocol (
- FvHandleBuffer[Index],
- &gEfiFirmwareVolume2ProtocolGuid,
- (VOID **) &Fv
- );
-
- Status = Fv->ReadFile (
- Fv,
- FileGuid,
- NULL,
- &Size,
- &Type,
- &Attributes,
- &AuthenticationStatus
- );
- if (EFI_ERROR (Status)) {
- //
- // Skip if input Fv file not in the FV
- //
- continue;
- }
- FindFvFile = TRUE;
- FoundFvHandle = FvHandleBuffer[Index];
- break;
- }
- }
-
- if (FindFvFile) {
- //
- // Build the shell device path
- //
- NewDevicePath = DevicePathFromHandle (FoundFvHandle);
- EfiInitializeFwVolDevicepathNode (&FvFileNode, FileGuid);
- NewDevicePath = AppendDevicePathNode (NewDevicePath, (EFI_DEVICE_PATH_PROTOCOL *) &FvFileNode);
- *DevicePath = NewDevicePath;
- return EFI_SUCCESS;
- }
- return EFI_NOT_FOUND;
-}
-
-
-/**
- Gets the data and size of a variable.
-
- Read the EFI variable (VendorGuid/Name) and return a dynamically allocated
- buffer, and the size of the buffer. If failure return NULL.
-
- @param Name String part of EFI variable name
- @param VendorGuid GUID part of EFI variable name
- @param VariableSize Returns the size of the EFI variable that was
- read
-
- @return Dynamically allocated memory that contains a copy of the EFI variable.
- Caller is responsible freeing the buffer.
- @retval NULL Variable was not read
-
-**/
-VOID *
-EFIAPI
-GetVariableAndSize (
- IN CHAR16 *Name,
- IN EFI_GUID *VendorGuid,
- OUT UINTN *VariableSize
- )
-{
- EFI_STATUS Status;
- UINTN BufferSize;
- VOID *Buffer;
-
- Buffer = NULL;
-
- //
- // Pass in a zero size buffer to find the required buffer size.
- //
- BufferSize = 0;
- Status = gRT->GetVariable (Name, VendorGuid, NULL, &BufferSize, Buffer);
- if (Status == EFI_BUFFER_TOO_SMALL) {
- //
- // Allocate the buffer to return
- //
- Buffer = AllocateZeroPool (BufferSize);
- if (Buffer == NULL) {
- return NULL;
- }
- //
- // Read variable into the allocated buffer.
- //
- Status = gRT->GetVariable (Name, VendorGuid, NULL, &BufferSize, Buffer);
- if (EFI_ERROR (Status)) {
- BufferSize = 0;
- }
- }
-
- *VariableSize = BufferSize;
- return Buffer;
-}
-
-
-/**
- Connect to the handle to a device on the device path.
-
- 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.
-
- @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
-ConnectDevicePath (
- IN EFI_DEVICE_PATH_PROTOCOL *DevicePathToConnect
- )
-{
- EFI_STATUS Status;
- EFI_DEVICE_PATH_PROTOCOL *DevicePath;
- EFI_DEVICE_PATH_PROTOCOL *CopyOfDevicePath;
- EFI_DEVICE_PATH_PROTOCOL *Instance;
- EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath;
- EFI_DEVICE_PATH_PROTOCOL *Next;
- EFI_HANDLE Handle;
- EFI_HANDLE PreviousHandle;
- UINTN Size;
-
- if (DevicePathToConnect == NULL) {
- return EFI_SUCCESS;
- }
-
- DevicePath = DuplicateDevicePath (DevicePathToConnect);
- CopyOfDevicePath = DevicePath;
- if (DevicePath == NULL) {
- return EFI_OUT_OF_RESOURCES;
- }
-
- do {
- //
- // The outer loop handles multi instance device paths.
- // Only console variables contain multiple instance device paths.
- //
- // After this call DevicePath points to the next Instance
- //
- Instance = GetNextDevicePathInstance (&DevicePath, &Size);
- ASSERT (Instance != NULL);
-
- Next = Instance;
- while (!IsDevicePathEndType (Next)) {
- Next = NextDevicePathNode (Next);
- }
-
- SetDevicePathEndNode (Next);
-
- //
- // Start the real work of connect with RemainingDevicePath
- //
- PreviousHandle = NULL;
- do {
- //
- // Find the handle that best matches the Device Path. If it is only a
- // partial match the remaining part of the device path is returned in
- // RemainingDevicePath.
- //
- RemainingDevicePath = Instance;
- Status = gBS->LocateDevicePath (&gEfiDevicePathProtocolGuid, &RemainingDevicePath, &Handle);
-
- if (!EFI_ERROR (Status)) {
- if (Handle == PreviousHandle) {
- //
- // If no forward progress is made try invoking the Dispatcher.
- // A new FV may have been added to the system an new drivers
- // may now be found.
- // Status == EFI_SUCCESS means a driver was dispatched
- // Status == EFI_NOT_FOUND means no new drivers were dispatched
- //
- Status = gDS->Dispatch ();
- }
-
- if (!EFI_ERROR (Status)) {
- PreviousHandle = Handle;
- //
- // Connect all drivers that apply to Handle and RemainingDevicePath,
- // the Recursive flag is FALSE so only one level will be expanded.
- //
- // Do not check the connect status here, if the connect controller fail,
- // then still give the chance to do dispatch, because partial
- // RemainingDevicepath may be in the new FV
- //
- // 1. If the connect fails, RemainingDevicepath and handle will not
- // change, so next time will do the dispatch, then dispatch's status
- // will take effect
- // 2. If the connect succeeds, the RemainingDevicepath and handle will
- // change, then avoid the dispatch, we have chance to continue the
- // next connection
- //
- gBS->ConnectController (Handle, NULL, RemainingDevicePath, FALSE);
- }
- }
- //
- // Loop until RemainingDevicePath is an empty device path
- //
- } while (!EFI_ERROR (Status) && !IsDevicePathEnd (RemainingDevicePath));
-
- } while (DevicePath != NULL);
-
- if (CopyOfDevicePath != NULL) {
- FreePool (CopyOfDevicePath);
- }
- //
- // All handle with DevicePath exists in the handle database
- //
- return Status;
-}
diff --git a/MdeModulePkg/Application/PlatOverMngr/PlatOverMngr.h b/MdeModulePkg/Universal/PlatformDriOverrideDxe/PlatOverMngr.h
index 2d73d0e..2d73d0e 100644
--- a/MdeModulePkg/Application/PlatOverMngr/PlatOverMngr.h
+++ b/MdeModulePkg/Universal/PlatformDriOverrideDxe/PlatOverMngr.h
diff --git a/MdeModulePkg/Universal/PlatformDriOverrideDxe/PlatformDriOverride.c b/MdeModulePkg/Universal/PlatformDriOverrideDxe/PlatformDriOverride.c
deleted file mode 100644
index 64e9a4d..0000000
--- a/MdeModulePkg/Universal/PlatformDriOverrideDxe/PlatformDriOverride.c
+++ /dev/null
@@ -1,212 +0,0 @@
-/** @file
-
-Copyright (c) 2007 - 2009, Intel Corporation
-All rights reserved. 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
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include <Uefi.h>
-
-#include <Library/BaseLib.h>
-#include <Library/DebugLib.h>
-#include <Library/UefiDriverEntryPoint.h>
-#include <Library/UefiBootServicesTableLib.h>
-#include <Library/PlatformDriverOverrideLib.h>
-#include <Protocol/PlatformDriverOverride.h>
-
-LIST_ENTRY mMappingDataBase = INITIALIZE_LIST_HEAD_VARIABLE (mMappingDataBase);
-BOOLEAN mEnvironmentVariableRead = FALSE;
-EFI_HANDLE mCallerImageHandle = NULL;
-
-/**
- Retrieves the image handle of the platform override driver for a controller in the system.
-
- @param This A pointer to the
- EFI_PLATFORM_DRIVER_OVERRIDE_PROTOCOL instance.
- @param ControllerHandle The device handle of the controller to check if a
- driver override exists.
- @param DriverImageHandle On input, a pointer to the previous driver image
- handle returned by GetDriver(). On output, a
- pointer to the next driver image handle. Passing
- in a NULL, will return the first driver image
- handle for ControllerHandle.
-
- @retval EFI_SUCCESS The driver override for ControllerHandle was
- returned in DriverImageHandle.
- @retval EFI_NOT_FOUND A driver override for ControllerHandle was not
- found.
- @retval EFI_INVALID_PARAMETER The handle specified by ControllerHandle is not a
- valid handle. DriverImageHandle is not a handle
- that was returned on a previous call to
- GetDriver().
-
-**/
-EFI_STATUS
-EFIAPI
-GetDriver (
- IN EFI_PLATFORM_DRIVER_OVERRIDE_PROTOCOL *This,
- IN EFI_HANDLE ControllerHandle,
- IN OUT EFI_HANDLE *DriverImageHandle
- )
-{
- EFI_STATUS Status;
-
- //
- // Check that ControllerHandle is a valid handle
- //
- if (ControllerHandle == NULL) {
- return EFI_INVALID_PARAMETER;
- }
-
- //
- // Read the environment variable(s) that contain the override mappings from Controller Device Path to
- // a set of Driver Device Paths, and initialize in memory database of the overrides that map Controller
- // Device Paths to an ordered set of Driver Device Paths and Driver Handles. This action is only performed
- // once and finished in first call.
- //
- if (!mEnvironmentVariableRead) {
- mEnvironmentVariableRead = TRUE;
-
- Status = InitOverridesMapping (&mMappingDataBase);
- if (EFI_ERROR (Status)){
- DEBUG ((DEBUG_ERROR, "The status to Get Platform Driver Override Variable is %r\n", Status));
- InitializeListHead (&mMappingDataBase);
- return EFI_NOT_FOUND;
- }
- }
-
- //
- // if the environment variable does not exist, just return not found
- //
- if (IsListEmpty (&mMappingDataBase)) {
- return EFI_NOT_FOUND;
- }
-
- return GetDriverFromMapping (
- ControllerHandle,
- DriverImageHandle,
- &mMappingDataBase,
- mCallerImageHandle
- );
-}
-
-/**
- Retrieves the device path of the platform override driver for a controller in the system.
- This driver doesn't support this API.
-
- @param This A pointer to the EFI_PLATFORM_DRIVER_OVERRIDE_
- PROTOCOL instance.
- @param ControllerHandle The device handle of the controller to check if a driver override
- exists.
- @param DriverImagePath On input, a pointer to the previous driver device path returned by
- GetDriverPath(). On output, a pointer to the next driver
- device path. Passing in a pointer to NULL, will return the first
- driver device path for ControllerHandle.
-
- @retval EFI_UNSUPPORTED
-**/
-EFI_STATUS
-EFIAPI
-GetDriverPath (
- IN EFI_PLATFORM_DRIVER_OVERRIDE_PROTOCOL *This,
- IN EFI_HANDLE ControllerHandle,
- IN OUT EFI_DEVICE_PATH_PROTOCOL **DriverImagePath
- )
-{
- return EFI_UNSUPPORTED;
-}
-
-
-/**
- Used to associate a driver image handle with a device path that was returned on a prior call to the
- GetDriverPath() service. This driver image handle will then be available through the
- GetDriver() service. This driver doesn't support this API.
-
- @param This A pointer to the EFI_PLATFORM_DRIVER_OVERRIDE_
- PROTOCOL instance.
- @param ControllerHandle The device handle of the controller.
- @param DriverImagePath A pointer to the driver device path that was returned in a prior
- call to GetDriverPath().
- @param DriverImageHandle The driver image handle that was returned by LoadImage()
- when the driver specified by DriverImagePath was loaded
- into memory.
-
- @retval EFI_UNSUPPORTED
-**/
-EFI_STATUS
-EFIAPI
-DriverLoaded (
- IN EFI_PLATFORM_DRIVER_OVERRIDE_PROTOCOL *This,
- IN EFI_HANDLE ControllerHandle,
- IN EFI_DEVICE_PATH_PROTOCOL *DriverImagePath,
- IN EFI_HANDLE DriverImageHandle
- )
-{
- return EFI_UNSUPPORTED;
-}
-
-EFI_PLATFORM_DRIVER_OVERRIDE_PROTOCOL mPlatformDriverOverride = {
- GetDriver,
- GetDriverPath,
- DriverLoaded
-};
-
-/**
- Platform Driver Override driver entry point, install the Platform Driver Override Protocol
-
- @param ImageHandle ImageHandle of the loaded driver.
- @param SystemTable Pointer to the EFI System Table.
-
- @retval EFI_SUCCESS The DXE Driver, DXE Runtime Driver, DXE SMM Driver,
- or UEFI Driver exited normally.
- @retval EFI_ALREADY_STARTED A protocol instance has been installed. Not need install again.
-**/
-EFI_STATUS
-EFIAPI
-PlatformDriverOverrideEntry (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-{
- EFI_HANDLE Handle;
- EFI_STATUS Status;
- VOID *Instance;
-
- mCallerImageHandle = ImageHandle;
-
- //
- // According to UEFI spec, there can be at most a single instance
- // in the system of the EFI_PLATFORM_DRIVER_OVERRIDE_PROTOCOL.
- // So here we check the existence.
- //
- Status = gBS->LocateProtocol (
- &gEfiPlatformDriverOverrideProtocolGuid,
- NULL,
- &Instance
- );
- //
- // If there was no error, assume there is an installation and return error
- //
- if (!EFI_ERROR (Status)) {
- return EFI_ALREADY_STARTED;
- }
-
- //
- // Install platform driver override protocol
- //
- Handle = NULL;
- Status = gBS->InstallProtocolInterface (
- &Handle,
- &gEfiPlatformDriverOverrideProtocolGuid,
- EFI_NATIVE_INTERFACE,
- &mPlatformDriverOverride
- );
- ASSERT_EFI_ERROR (Status);
- return EFI_SUCCESS;
-}
diff --git a/MdeModulePkg/Universal/PlatformDriOverrideDxe/PlatformDriOverrideDxe.inf b/MdeModulePkg/Universal/PlatformDriOverrideDxe/PlatformDriOverrideDxe.inf
index 855fb82..59bc3df 100644
--- a/MdeModulePkg/Universal/PlatformDriOverrideDxe/PlatformDriOverrideDxe.inf
+++ b/MdeModulePkg/Universal/PlatformDriOverrideDxe/PlatformDriOverrideDxe.inf
@@ -1,9 +1,21 @@
#/** @file
-# This driver produces UEFI PLATFORM_DRIVER_OVERRIDE_PROTOCOL if this protocol doesn't exist.
-# It doesn't install again if this protocol exists.
-# It only implements one interface GetDriver of PLATFORM_DRIVER_OVERRIDE_PROTOCOL protocol
-# and doesn't support other two interfaces GetDriverPath, DriverLoaded.
+# This driver produces UEFI PLATFORM_DRIVER_OVERRIDE_PROTOCOL if this protocol doesn't exist.
+# It doesn't install again if this protocol exists.
+# It only implements one interface GetDriver of PLATFORM_DRIVER_OVERRIDE_PROTOCOL protocol
+# and doesn't support other two interfaces GetDriverPath, DriverLoaded.
#
+# This driver also offers an UI interface in device manager to let user configure
+# platform override protocol to override the default algorithm for matching
+# drivers to controllers.
+#
+# The main flow:
+# 1. It dynamicly locate all controller device path.
+# 2. It dynamicly locate all drivers which support binding protocol.
+# 3. It export and dynamicly update two menu to let user select the
+# mapping between drivers to controllers.
+# 4. It save all the mapping info in NV variables for the following boot,
+# which will be consumed by GetDriver API of the produced the platform override protocol.
+#
# Copyright (c) 2007 - 2009, Intel Corporation. All rights reserved.
#
# All rights reserved. This program and the accompanying materials
@@ -18,11 +30,12 @@
[Defines]
INF_VERSION = 0x00010005
- BASE_NAME = PlatformDriOverrideDxe
+ BASE_NAME = PlatDriOverrideDxe
FILE_GUID = 35034CE2-A6E5-4fb4-BABE-A0156E9B2549
- MODULE_TYPE = UEFI_DRIVER
+ MODULE_TYPE = DXE_DRIVER
VERSION_STRING = 1.0
- ENTRY_POINT = PlatformDriverOverrideEntry
+ ENTRY_POINT = PlatDriOverrideDxeInit
+ UNLOAD_IMAGE = PlatDriOverrideDxeUnload
#
# The following information is for reference only and not required by the build tools.
@@ -31,7 +44,12 @@
#
[Sources.common]
- PlatformDriOverride.c
+ VfrStrings.uni
+ Vfr.vfr
+ PlatDriOverrideDxe.c
+ PlatOverMngr.h
+ PlatDriOverrideLib.c
+ InternalPlatDriOverrideDxe.h
[Packages]
MdePkg/MdePkg.dec
@@ -39,11 +57,43 @@
[LibraryClasses]
BaseLib
- UefiDriverEntryPoint
DebugLib
- PlatformDriverOverrideLib
+ UefiLib
+ UefiDriverEntryPoint
UefiBootServicesTableLib
+ HiiLib
+ BaseMemoryLib
+ MemoryAllocationLib
+ DevicePathLib
+ DxeServicesTableLib
+ UefiRuntimeServicesTableLib
+ PrintLib
+
+[Guids]
+ ## This GUID C Name is not required for build since it is from UefiLib and not directly used by this module source.
+ ## gEfiGlobalVariableGuid ## SOMETIMES_CONSUMED ## Variable:L"PlatformLang" this variable specifies the platform supported language string (RFC 4646 format)
+ ## gEfiGlobalVariableGuid ## SOMETIMES_CONSUMED ## Variable:L"Lang" this variable specifies the platform supported language string (ISO 639-2 format)
+ ##
+ # There could be more than one variables, from PlatDriOver, PlatDriOver1, PlatDriOver2,...
+ #
+ # gEfiCallerIdGuid ## Private ## Variable:L"PlatDriOver"
+ gEfiIfrTianoGuid ## CONSUMES ## Guid
[Protocols]
- gEfiPlatformDriverOverrideProtocolGuid ## PRODUCED
- \ No newline at end of file
+ gEfiComponentName2ProtocolGuid ## SOMETIMES_CONSUMED (Get Driver Name if ComponentName2Protocol exists)
+ gEfiComponentNameProtocolGuid ## SOMETIMES_CONSUMED (Get Driver Name if ComponentNameProtocol exists and ComponentName2Protocol doesn't exist)
+ gEfiFirmwareVolume2ProtocolGuid ## SOMETIMES_CONSUMED (Get Driver Name from EFI UI section if ComponentName2Protocol and ComponentNameProtocol don't exist)
+ gEfiPciIoProtocolGuid ## SOMETIMES_CONSUMED (Find the PCI device if PciIo protocol is installed)
+ gEfiBusSpecificDriverOverrideProtocolGuid ## SOMETIMES_CONSUMED (Check whether the PCI device contains one or more efi drivers in its option rom by this protocol)
+
+ gEfiDriverBindingProtocolGuid ## SOMETIMES_CONSUMED
+ gEfiLoadedImageProtocolGuid ## SOMETIMES_CONSUMED
+ gEfiLoadedImageDevicePathProtocolGuid ## SOMETIMES_CONSUMED (Show the drivers in the second page that support DriverBindingProtocol, LoadedImageProtocol and LoadedImageDevicePathProtocol)
+ gEfiDevicePathProtocolGuid ## SOMETIMES_CONSUMED (Show the controller device in the first page that support DevicePathProtocol)
+
+ gEfiHiiDatabaseProtocolGuid ## CONSUMED
+ gEfiFormBrowser2ProtocolGuid ## CONSUMED
+ gEfiHiiConfigRoutingProtocolGuid ## CONSUMED
+ gEfiHiiConfigAccessProtocolGuid ## PRODUCED
+ gEfiDevicePathToTextProtocolGuid ## CONSUMED
+ gEfiPlatformDriverOverrideProtocolGuid ## PRODUCED
diff --git a/MdeModulePkg/Application/PlatOverMngr/Vfr.vfr b/MdeModulePkg/Universal/PlatformDriOverrideDxe/Vfr.vfr
index a68073f..f00a510 100644
--- a/MdeModulePkg/Application/PlatOverMngr/Vfr.vfr
+++ b/MdeModulePkg/Universal/PlatformDriOverrideDxe/Vfr.vfr
@@ -1,6 +1,6 @@
// *++
//
-// Copyright (c) 2007 - 2008, Intel Corporation
+// Copyright (c) 2009, Intel Corporation
// All rights reserved. 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
diff --git a/MdeModulePkg/Application/PlatOverMngr/VfrStrings.uni b/MdeModulePkg/Universal/PlatformDriOverrideDxe/VfrStrings.uni
index fe14d30..c30fb5c 100644
--- a/MdeModulePkg/Application/PlatOverMngr/VfrStrings.uni
+++ b/MdeModulePkg/Universal/PlatformDriOverrideDxe/VfrStrings.uni
Binary files differ
diff --git a/Nt32Pkg/Nt32Pkg.dsc b/Nt32Pkg/Nt32Pkg.dsc
index 33769e7..c8422d3 100644
--- a/Nt32Pkg/Nt32Pkg.dsc
+++ b/Nt32Pkg/Nt32Pkg.dsc
@@ -74,7 +74,6 @@
DxeServicesLib|MdePkg/Library/DxeServicesLib/DxeServicesLib.inf
PeCoffGetEntryPointLib|MdePkg/Library/BasePeCoffGetEntryPointLib/BasePeCoffGetEntryPointLib.inf
DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf
- PlatformDriverOverrideLib|MdeModulePkg/Library/DxePlatDriOverLib/DxePlatDriOverLib.inf
[LibraryClasses.common.USER_DEFINED]
DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf
@@ -483,7 +482,6 @@
MdeModulePkg/Application/VariableInfo/VariableInfo.inf
MdeModulePkg/Universal/PlatformDriOverrideDxe/PlatformDriOverrideDxe.inf
- MdeModulePkg/Application/PlatOverMngr/PlatOverMngr.inf
[BuildOptions]
DEBUG_*_IA32_DLINK_FLAGS = /EXPORT:InitializeDriver=$(IMAGE_ENTRY_POINT) /ALIGN:4096 /SUBSYSTEM:CONSOLE