Code Scrub for DxePlatDriOverLib.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@6410 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
xli24 2008-11-06 07:47:11 +00:00
parent 9636e0321a
commit b7a985d4e2
3 changed files with 479 additions and 370 deletions

View File

@ -1,8 +1,7 @@
#/** @file #/** @file
# Component name for module PlatDriOverLib # Instance of Platform Driver Override Library.
# #
# FIX ME! # Copyright (c) 2007 - 2008, Intel Corporation. All rights reserved.
# Copyright (c) 2007, Intel Corporation. All rights reserved.
# #
# All rights reserved. This program and the accompanying materials # All rights reserved. This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # are licensed and made available under the terms and conditions of the BSD License
@ -21,7 +20,7 @@
FILE_GUID = 8bd8d711-2736-46d7-8c81-5de68e0a9e88 FILE_GUID = 8bd8d711-2736-46d7-8c81-5de68e0a9e88
MODULE_TYPE = DXE_DRIVER MODULE_TYPE = DXE_DRIVER
VERSION_STRING = 1.0 VERSION_STRING = 1.0
LIBRARY_CLASS = PlatDriOverLib LIBRARY_CLASS = PlatDriOverLib|DXE_DRIVER UEFI_DRIVER UEFI_APPLICATION
EDK_RELEASE_VERSION = 0x00020000 EDK_RELEASE_VERSION = 0x00020000
EFI_SPECIFICATION_VERSION = 0x00020000 EFI_SPECIFICATION_VERSION = 0x00020000

View File

@ -1,20 +1,14 @@
/** @file /** @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
Copyright (c) 2007, Intel Corporation THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
All rights reserved. This program and the accompanying materials WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
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.
Module Name:
PlatDriOver.h
Abstract:
**/ **/
@ -46,17 +40,20 @@ Abstract:
#define PLATFORM_OVERRIDE_ITEM_SIGNATURE EFI_SIGNATURE_32('p','d','o','i') #define PLATFORM_OVERRIDE_ITEM_SIGNATURE EFI_SIGNATURE_32('p','d','o','i')
typedef struct _PLATFORM_OVERRIDE_ITEM{ typedef struct _PLATFORM_OVERRIDE_ITEM {
UINTN Signature; UINTN Signature;
LIST_ENTRY Link; LIST_ENTRY Link;
UINT32 DriverInfoNum; UINT32 DriverInfoNum;
EFI_DEVICE_PATH_PROTOCOL *ControllerDevicePath; EFI_DEVICE_PATH_PROTOCOL *ControllerDevicePath;
LIST_ENTRY DriverInfoList; //DRIVER_IMAGE_INFO List ///
/// List of DRIVER_IMAGE_INFO
///
LIST_ENTRY DriverInfoList;
EFI_HANDLE LastReturnedImageHandle; EFI_HANDLE LastReturnedImageHandle;
} PLATFORM_OVERRIDE_ITEM; } PLATFORM_OVERRIDE_ITEM;
#define DRIVER_IMAGE_INFO_SIGNATURE EFI_SIGNATURE_32('p','d','i','i') #define DRIVER_IMAGE_INFO_SIGNATURE EFI_SIGNATURE_32('p','d','i','i')
typedef struct _DRIVER_IMAGE_INFO{ typedef struct _DRIVER_IMAGE_INFO {
UINTN Signature; UINTN Signature;
LIST_ENTRY Link; LIST_ENTRY Link;
EFI_HANDLE ImageHandle; EFI_HANDLE ImageHandle;
@ -72,50 +69,121 @@ typedef struct _DEVICE_PATH_STACK_ITEM{
EFI_DEVICE_PATH_PROTOCOL *DevicePath; EFI_DEVICE_PATH_PROTOCOL *DevicePath;
} DEVICE_PATH_STACK_ITEM; } 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 EFI_STATUS
EFIAPI EFIAPI
PushDevPathStack ( PushDevPathStack (
IN EFI_DEVICE_PATH_PROTOCOL *DevicePath 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 EFI_STATUS
EFIAPI EFIAPI
PopDevPathStack ( PopDevPathStack (
OUT EFI_DEVICE_PATH_PROTOCOL **DevicePath 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 BOOLEAN
EFIAPI EFIAPI
CheckExistInStack ( CheckExistInStack (
IN EFI_DEVICE_PATH_PROTOCOL *DevicePath IN EFI_DEVICE_PATH_PROTOCOL *DevicePath
); );
/**
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 EFI_STATUS
EFIAPI EFIAPI
UpdateFvFileDevicePath ( UpdateFvFileDevicePath (
IN OUT EFI_DEVICE_PATH_PROTOCOL ** DevicePath, IN OUT EFI_DEVICE_PATH_PROTOCOL **DevicePath,
IN EFI_GUID *FileGuid, IN EFI_GUID *FileGuid,
IN EFI_HANDLE CallerImageHandle IN EFI_HANDLE CallerImageHandle
); );
/**
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 * VOID *
EFIAPI
GetVariableAndSize ( GetVariableAndSize (
IN CHAR16 *Name, IN CHAR16 *Name,
IN EFI_GUID *VendorGuid, IN EFI_GUID *VendorGuid,
OUT UINTN *VariableSize OUT UINTN *VariableSize
); );
/**
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 EFI_STATUS
EFIAPI
ConnectDevicePath ( ConnectDevicePath (
IN EFI_DEVICE_PATH_PROTOCOL *DevicePathToConnect IN EFI_DEVICE_PATH_PROTOCOL *DevicePathToConnect
); );
EFI_STATUS
BdsConnectDeviceByPciClassType (
UINT8 ClassType,
UINT8 SubClassCode,
UINT8 PI,
BOOLEAN Recursive
);
#endif #endif

File diff suppressed because it is too large Load Diff