Code scrube for MdeModule Definitions.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@5428 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
/** @file
|
||||
This library includes the APIs that is specific to EDK II's implementation.
|
||||
It extended the UEFI Specification to define GUIDed device path.
|
||||
This library includes two extended HII functions to
|
||||
create and destory Hii Package by create the virtual Driver Handle.
|
||||
|
||||
Copyright (c) 2008, Intel Corporation. <BR>
|
||||
All rights reserved. This program and the accompanying materials
|
||||
|
@@ -31,6 +31,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
CreateBannerOpCode (
|
||||
IN EFI_STRING_ID Title,
|
||||
IN UINT16 LineNumber,
|
||||
@@ -62,6 +63,7 @@ CreateBannerOpCode (
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
IfrLibUpdateForm (
|
||||
IN EFI_HII_HANDLE Handle,
|
||||
IN EFI_GUID *FormSetGuid, OPTIONAL
|
||||
@@ -92,6 +94,7 @@ IfrLibUpdateForm (
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
IfrLibExtractClassFromHiiHandle (
|
||||
IN EFI_HII_HANDLE Handle,
|
||||
OUT UINT16 *Class,
|
||||
@@ -106,7 +109,8 @@ IfrLibExtractClassFromHiiHandle (
|
||||
|
||||
@param Buffer the start address of buffer.
|
||||
@param BufferSize the size of buffer.
|
||||
@param Number the number of the strings.
|
||||
@param Number the number of the ConfigBody strings.
|
||||
@param ... the ConfigBody strings
|
||||
|
||||
@retval EFI_BUFFER_TOO_SMALL the BufferSize is too small to operate.
|
||||
@retval EFI_INVALID_PARAMETER Buffer is NULL or BufferSize is 0.
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/** @file
|
||||
Generic BDS library definition, include the file and data structure
|
||||
Generic BDS library definition, include the data structure and function.
|
||||
|
||||
Copyright (c) 2004 - 2008, Intel Corporation. <BR>
|
||||
All rights reserved. This program and the accompanying materials
|
||||
@@ -25,7 +25,7 @@ extern EFI_HANDLE mBdsImageHandle;
|
||||
//
|
||||
// Constants which are variable names used to access variables
|
||||
//
|
||||
#define VarLegacyDevOrder L"LegacyDevOrder"
|
||||
#define VAR_LEGACY_DEV_ORDER L"LegacyDevOrder"
|
||||
|
||||
//
|
||||
// Data structures and defines
|
||||
@@ -105,10 +105,10 @@ typedef struct {
|
||||
//
|
||||
|
||||
//
|
||||
// Bds boot relate lib functions
|
||||
// Bds boot related lib functions
|
||||
//
|
||||
/**
|
||||
Boot from the EFI1.1 spec defined "BootNext" variable
|
||||
Boot from the UEFI spec defined "BootNext" variable.
|
||||
|
||||
**/
|
||||
VOID
|
||||
@@ -118,17 +118,17 @@ BdsLibBootNext (
|
||||
);
|
||||
|
||||
/**
|
||||
Process the boot option follow the EFI 1.1 specification and
|
||||
Process the boot option follow the UEFI specification and
|
||||
special treat the legacy boot option with BBS_DEVICE_PATH.
|
||||
|
||||
@param Option The boot option need to be processed
|
||||
@param DevicePath The device path which describe where to load the
|
||||
boot image or the legcy BBS device path to boot
|
||||
the legacy OS
|
||||
@param ExitDataSize Returned directly from gBS->StartImage ()
|
||||
@param ExitData Returned directly from gBS->StartImage ()
|
||||
@param ExitDataSize The size of exit data.
|
||||
@param ExitData Data returned when Boot image failed.
|
||||
|
||||
@retval EFI_SUCCESS Status from gBS->StartImage ()
|
||||
@retval EFI_SUCCESS Boot from the input boot option successfully.
|
||||
@retval EFI_NOT_FOUND If the Device Path is not found in the system
|
||||
|
||||
**/
|
||||
@@ -166,8 +166,7 @@ BdsLibEnumerateAllBootOption (
|
||||
boot option
|
||||
@param BdsBootOptionList The header of the link list which indexed all
|
||||
current boot options
|
||||
|
||||
@return VOID
|
||||
@param String The description of the boot option.
|
||||
|
||||
**/
|
||||
VOID
|
||||
@@ -180,15 +179,13 @@ BdsLibBuildOptionFromHandle (
|
||||
|
||||
|
||||
/**
|
||||
Build the on flash shell boot option with the handle parsed in
|
||||
Build the on flash shell boot option with the handle parsed in.
|
||||
|
||||
@param Handle The handle which present the device path to create
|
||||
on flash shell boot option
|
||||
@param BdsBootOptionList The header of the link list which indexed all
|
||||
current boot options
|
||||
|
||||
@return None
|
||||
|
||||
**/
|
||||
VOID
|
||||
EFIAPI
|
||||
@@ -270,8 +267,8 @@ BdsLibBuildOptionFromVar (
|
||||
@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.
|
||||
@return Caller is responsible freeing the buffer.
|
||||
@return Dynamically allocated memory that contains a copy of the EFI variable
|
||||
Caller is responsible freeing the buffer.
|
||||
@retval NULL Variable was not read
|
||||
|
||||
**/
|
||||
@@ -304,7 +301,7 @@ BdsLibOutputStrings (
|
||||
|
||||
/**
|
||||
Build the boot#### or driver#### option from the VariableName, the
|
||||
build boot#### or driver#### will also be linked to BdsCommonOptionList
|
||||
build boot#### or driver#### will also be linked to BdsCommonOptionList.
|
||||
|
||||
@param BdsCommonOptionList The header of the boot#### or driver#### option
|
||||
link list
|
||||
@@ -430,7 +427,7 @@ BdsLibDisconnectAllEfi (
|
||||
);
|
||||
|
||||
//
|
||||
// Bds console relate lib functions
|
||||
// Bds console related lib functions
|
||||
//
|
||||
/**
|
||||
This function will search every simpletxt devive in current system,
|
||||
@@ -450,8 +447,7 @@ BdsLibConnectAllConsoles (
|
||||
|
||||
@retval EFI_SUCCESS At least one of the ConIn and ConOut device have
|
||||
been connected success.
|
||||
@retval EFI_STATUS Return the status of
|
||||
BdsLibConnectConsoleVariable ().
|
||||
@retval EFI_STATUS Return the status of BdsLibConnectConsoleVariable ().
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
@@ -473,7 +469,7 @@ BdsLibConnectAllDefaultConsoles (
|
||||
from the console variable ConVarName, this
|
||||
parameter can not be multi-instance.
|
||||
|
||||
@retval EFI_UNSUPPORTED Add or remove the same device path.
|
||||
@retval EFI_UNSUPPORTED The added device path is same to the removed one.
|
||||
@retval EFI_SUCCESS Success add or remove the device path from the
|
||||
console variable.
|
||||
|
||||
@@ -508,7 +504,7 @@ BdsLibConnectConsoleVariable (
|
||||
);
|
||||
|
||||
//
|
||||
// Bds device path relate lib functions
|
||||
// Bds device path related lib functions
|
||||
//
|
||||
/**
|
||||
Function unpacks a device path data structure so that all the nodes
|
||||
@@ -555,8 +551,8 @@ BdsLibDelPartMatchInstance (
|
||||
@param Single A pointer to a single-instance device path data
|
||||
structure.
|
||||
|
||||
@retval TRUE If the Single is contained within Multi
|
||||
@retval FALSE The Single is not match within Multi
|
||||
@retval TRUE If the Single device path is contained within Multi device path.
|
||||
@retval FALSE The Single device path is not match within Multi device path.
|
||||
|
||||
**/
|
||||
BOOLEAN
|
||||
@@ -622,12 +618,20 @@ typedef struct {
|
||||
//
|
||||
#if defined (MDE_CPU_IPF)
|
||||
#define EFI64_SHADOW_ALL_LEGACY_ROM() ShadowAllOptionRom ();
|
||||
VOID
|
||||
ShadowAllOptionRom();
|
||||
#else
|
||||
#define EFI64_SHADOW_ALL_LEGACY_ROM()
|
||||
#endif
|
||||
|
||||
/**
|
||||
Shadow all Legacy OptionRom.
|
||||
|
||||
**/
|
||||
VOID
|
||||
EFIAPI
|
||||
ShadowAllOptionRom (
|
||||
VOID
|
||||
);
|
||||
|
||||
//
|
||||
// BBS support macros and functions
|
||||
//
|
||||
@@ -641,27 +645,76 @@ ShadowAllOptionRom();
|
||||
#define REFRESH_LEGACY_BOOT_OPTIONS
|
||||
#endif
|
||||
|
||||
/**
|
||||
Delete all the invalid legacy boot options.
|
||||
|
||||
@retval EFI_SUCCESS All invalide legacy boot options are deleted.
|
||||
@retval EFI_OUT_OF_RESOURCES Fail to allocate necessary memory.
|
||||
@retval EFI_NOT_FOUND Fail to retrive variable of boot order.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
BdsDeleteAllInvalidLegacyBootOptions (
|
||||
VOID
|
||||
);
|
||||
|
||||
/**
|
||||
|
||||
Add the legacy boot options from BBS table if they do not exist.
|
||||
|
||||
@retval EFI_SUCCESS The boot options are added successfully
|
||||
or they are already in boot options.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
BdsAddNonExistingLegacyBootOptions (
|
||||
VOID
|
||||
);
|
||||
|
||||
/**
|
||||
|
||||
Add the legacy boot devices from BBS table into
|
||||
the legacy device boot order.
|
||||
|
||||
@retval EFI_SUCCESS The boot devices are added successfully.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
BdsUpdateLegacyDevOrder (
|
||||
VOID
|
||||
);
|
||||
|
||||
/**
|
||||
|
||||
Set the boot priority for BBS entries based on boot option entry and boot order.
|
||||
|
||||
@param Entry The boot option is to be checked for refresh BBS table.
|
||||
|
||||
@retval EFI_SUCCESS The boot priority for BBS entries is refreshed successfully.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
BdsRefreshBbsTableForBoot (
|
||||
IN BDS_COMMON_OPTION *Entry
|
||||
);
|
||||
|
||||
/**
|
||||
|
||||
Delete boot option specified by OptionNumber and adjust the boot order.
|
||||
|
||||
@param OptionNumber The boot option to be deleted.
|
||||
@param BootOrder Boot order list to be adjusted by remove this boot option.
|
||||
@param BootOrderSize The size of Boot order list will be modified.
|
||||
|
||||
@retval EFI_SUCCESS The boot option is deleted successfully.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
BdsDeleteBootOption (
|
||||
IN UINTN OptionNumber,
|
||||
IN OUT UINT16 *BootOrder,
|
||||
@@ -755,8 +808,7 @@ SetupResetReminder (
|
||||
@param Device SimpleFileSystem device handle
|
||||
@param FileName File name for the image
|
||||
@param DosHeader Pointer to dos header
|
||||
@param ImageHeader Pointer to image header
|
||||
@param OptionalHeader Pointer to optional header
|
||||
@param Hdr The buffer in which to return the PE32, PE32+, or TE header.
|
||||
|
||||
@retval EFI_SUCCESS Successfully get the machine type.
|
||||
@retval EFI_NOT_FOUND The file is not found.
|
||||
@@ -818,8 +870,8 @@ BdsLibGetImageHeader (
|
||||
@param HardDriveDevicePath A device path which starts with a hard drive media
|
||||
device path.
|
||||
|
||||
@retval TRUE There is a matched device path instance FALSE
|
||||
-There is no matched device path instance
|
||||
@retval TRUE There is a matched device path instance.
|
||||
@retval FALSE There is no matched device path instance.
|
||||
|
||||
**/
|
||||
BOOLEAN
|
||||
@@ -858,7 +910,6 @@ BdsExpandPartitionPartialDevicePathToFull (
|
||||
|
||||
@param DevicePath Device Path to a bootable device
|
||||
|
||||
@retval NULL The device path points to an EFI bootable Media
|
||||
@retval NULL The media on the DevicePath is not bootable
|
||||
|
||||
**/
|
||||
@@ -873,11 +924,11 @@ BdsLibGetBootableHandle (
|
||||
Check whether the Device path in a boot option point to a valide bootable device,
|
||||
And if CheckMedia is true, check the device is ready to boot now.
|
||||
|
||||
DevPath -- the Device path in a boot option
|
||||
CheckMedia -- if true, check the device is ready to boot now.
|
||||
@param DevPath the Device path in a boot option
|
||||
@param CheckMedia if true, check the device is ready to boot now.
|
||||
|
||||
@return TRUE -- the Device path is valide
|
||||
@return FALSE -- the Device path is invalide .
|
||||
@retval TRUE the Device path is valide
|
||||
@retval FALSE the Device path is invalide .
|
||||
|
||||
**/
|
||||
BOOLEAN
|
||||
@@ -888,7 +939,7 @@ BdsLibIsValidEFIBootOptDevicePath (
|
||||
);
|
||||
|
||||
/**
|
||||
For a bootable Device path, return its boot type
|
||||
For a bootable Device path, return its boot type.
|
||||
|
||||
@param DevicePath The bootable device Path to check
|
||||
|
||||
@@ -919,8 +970,8 @@ BdsGetBootTypeFromDevicePath (
|
||||
|
||||
|
||||
/**
|
||||
This routine register a function to adjust the different type memory page number just before booting
|
||||
and save the updated info into the variable for next boot to use
|
||||
This routine register a function to adjust the different type memory page number
|
||||
just before booting and save the updated info into the variable for next boot to use.
|
||||
|
||||
**/
|
||||
VOID
|
||||
@@ -965,12 +1016,13 @@ BdsLibUpdateFvFileDevicePath (
|
||||
@param HostControllerPI Uhci (0x00) or Ehci (0x20) or Both uhci and ehci
|
||||
(0xFF)
|
||||
@param RemainingDevicePath a short-form device path that starts with the first
|
||||
element being a USB WWID or a USB Class device
|
||||
element being a USB WWID or a USB Class device
|
||||
path
|
||||
|
||||
@return EFI_INVALID_PARAMETER
|
||||
@return EFI_SUCCESS
|
||||
@return EFI_NOT_FOUND
|
||||
@retval EFI_SUCCESS The specific Usb device is connected successfully.
|
||||
@retval EFI_INVALID_PARAMETER Invalid HostControllerPi (not 0x00, 0x20 or 0xFF)
|
||||
or RemainingDevicePath is not the USB class device path.
|
||||
@retval EFI_NOT_FOUND The device specified by device path is not found.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
@@ -985,13 +1037,11 @@ BdsLibConnectUsbDevByShortFormDP(
|
||||
// The implementation of this function is provided by Platform code.
|
||||
//
|
||||
/**
|
||||
Convert Vendor device path to device name
|
||||
Convert Vendor device path to device name.
|
||||
|
||||
@param Str The buffer store device name
|
||||
@param DevPath Pointer to vendor device path
|
||||
|
||||
@return When it return, the device name have been stored in *Str.
|
||||
|
||||
**/
|
||||
VOID
|
||||
EFIAPI
|
||||
@@ -1005,13 +1055,13 @@ DevPathVendor (
|
||||
Concatenates a formatted unicode string to allocated pool.
|
||||
The caller must free the resulting buffer.
|
||||
|
||||
@param Str Tracks the allocated pool, size in use, and amount of pool
|
||||
allocated.
|
||||
@param Str Tracks the allocated pool, size in use, and amount of pool allocated.
|
||||
@param fmt The format string
|
||||
@param ... The data will be printed.
|
||||
|
||||
@return Allocated buffer with the formatted string printed in it.
|
||||
@return The caller must free the allocated buffer. The buffer
|
||||
@return allocation is not packed.
|
||||
The caller must free the allocated buffer.
|
||||
The buffer allocation is not packed.
|
||||
|
||||
**/
|
||||
CHAR16 *
|
||||
|
@@ -242,7 +242,8 @@ IpIoOpen (
|
||||
packet.
|
||||
@param Pkt Pointer to the IP packet to be sent.
|
||||
@param Sender The IP protocol instance used for sending.
|
||||
@param NotifyData
|
||||
@param Context
|
||||
@param NotifyData
|
||||
@param Dest The destination IP address to send this packet to.
|
||||
@param OverrideData The data to override some configuration of the IP
|
||||
instance used for sending.
|
||||
@@ -265,13 +266,11 @@ IpIoSend (
|
||||
);
|
||||
|
||||
/**
|
||||
Add a new IP instance for sending data.
|
||||
|
||||
@param IpIo Pointer to a IP_IO instance to add a new IP
|
||||
instance for sending purpose.
|
||||
|
||||
@return Pointer to the created IP_IO_IP_INFO structure, NULL is failed.
|
||||
Cancel the IP transmit token which wraps this Packet.
|
||||
|
||||
@param IpIo Pointer to the IP_IO instance.
|
||||
@param Packet Pointer to the packet to cancel.
|
||||
|
||||
**/
|
||||
VOID
|
||||
EFIAPI
|
||||
|
@@ -28,7 +28,7 @@ typedef UINT32 IP4_ADDR;
|
||||
typedef UINT32 TCP_SEQNO;
|
||||
typedef UINT16 TCP_PORTNO;
|
||||
|
||||
enum {
|
||||
typedef enum {
|
||||
NET_ETHER_ADDR_LEN = 6,
|
||||
NET_IFTYPE_ETHERNET = 0x01,
|
||||
|
||||
@@ -46,7 +46,7 @@ enum {
|
||||
IP4_ADDR_CLASSE,
|
||||
|
||||
IP4_MASK_NUM = 33
|
||||
};
|
||||
} IP4_CLASS_TYPE;
|
||||
|
||||
#pragma pack(1)
|
||||
|
||||
@@ -340,7 +340,7 @@ NetListRemoveTail (
|
||||
);
|
||||
|
||||
/**
|
||||
Insert the NewEntry after the PrevEntry
|
||||
Insert the NewEntry after the PrevEntry.
|
||||
|
||||
@param PrevEntry The previous entry to insert after
|
||||
@param NewEntry The new entry to insert
|
||||
@@ -356,7 +356,7 @@ NetListInsertAfter (
|
||||
);
|
||||
|
||||
/**
|
||||
Insert the NewEntry before the PostEntry
|
||||
Insert the NewEntry before the PostEntry.
|
||||
|
||||
@param PostEntry The entry to insert before
|
||||
@param NewEntry The new entry to insert
|
||||
@@ -519,7 +519,7 @@ NetMapRemoveItem (
|
||||
);
|
||||
|
||||
/**
|
||||
Remove the first entry on the netmap
|
||||
Remove the first entry on the netmap.
|
||||
|
||||
@param Map The netmap to remove the head from
|
||||
@param Value The variable to receive the value if not NULL
|
||||
@@ -535,7 +535,7 @@ NetMapRemoveHead (
|
||||
);
|
||||
|
||||
/**
|
||||
Remove the last entry on the netmap
|
||||
Remove the last entry on the netmap.
|
||||
|
||||
@param Map The netmap to remove the tail from
|
||||
@param Value The variable to receive the value if not NULL
|
||||
@@ -586,8 +586,8 @@ NetMapIterate (
|
||||
/**
|
||||
Create a child of the service that is identified by ServiceBindingGuid.
|
||||
|
||||
@param Controller The controller which has the service installed.
|
||||
@param Image The image handle used to open service.
|
||||
@param ControllerHandle The controller which has the service installed.
|
||||
@param ImageHandle The image handle used to open service.
|
||||
@param ServiceBindingGuid The service's Guid.
|
||||
@param ChildHandle The handle to receive the create child
|
||||
|
||||
@@ -607,8 +607,8 @@ NetLibCreateServiceChild (
|
||||
/**
|
||||
Destory a child of the service that is identified by ServiceBindingGuid.
|
||||
|
||||
@param Controller The controller which has the service installed.
|
||||
@param Image The image handle used to open service.
|
||||
@param ControllerHandle The controller which has the service installed.
|
||||
@param ImageHandle The image handle used to open service.
|
||||
@param ServiceBindingGuid The service's Guid.
|
||||
@param ChildHandle The child to destory
|
||||
|
||||
@@ -702,10 +702,10 @@ NetLibGetNicHandle (
|
||||
/**
|
||||
Add a Deferred Procedure Call to the end of the DPC queue.
|
||||
|
||||
@DpcTpl The EFI_TPL that the DPC should be invoked.
|
||||
@DpcProcedure Pointer to the DPC's function.
|
||||
@DpcContext Pointer to the DPC's context. Passed to DpcProcedure
|
||||
when DpcProcedure is invoked.
|
||||
@param DpcTpl The EFI_TPL that the DPC should be invoked.
|
||||
@param DpcProcedure Pointer to the DPC's function.
|
||||
@param DpcContext Pointer to the DPC's context. Passed to DpcProcedure
|
||||
when DpcProcedure is invoked.
|
||||
|
||||
@retval EFI_SUCCESS The DPC was queued.
|
||||
@retval EFI_INVALID_PARAMETER DpcTpl is not a valid EFI_TPL.
|
||||
@@ -735,17 +735,14 @@ NetLibDispatchDpc (
|
||||
VOID
|
||||
);
|
||||
|
||||
/**
|
||||
The constructor function caches the pointer to DPC protocol.
|
||||
|
||||
The constructor function locates DPC protocol from protocol database.
|
||||
It will ASSERT() if that operation fails and it will always return EFI_SUCCESS.
|
||||
|
||||
@param ImageHandle The firmware allocated handle for the EFI image.
|
||||
@param SystemTable A pointer to the EFI System Table.
|
||||
|
||||
@retval EFI_SUCCESS The constructor always returns EFI_SUCCESS.
|
||||
|
||||
/**
|
||||
This is the default unload handle for all the network drivers.
|
||||
|
||||
@param ImageHandle The drivers' driver image.
|
||||
|
||||
@retval EFI_SUCCESS The image is unloaded.
|
||||
@retval Others Failed to unload the image.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
@@ -753,7 +750,7 @@ NetLibDefaultUnload (
|
||||
IN EFI_HANDLE ImageHandle
|
||||
);
|
||||
|
||||
enum {
|
||||
typedef enum {
|
||||
//
|
||||
//Various signatures
|
||||
//
|
||||
@@ -766,7 +763,7 @@ enum {
|
||||
NET_BUF_HEAD = 1, // Trim or allocate space from head
|
||||
NET_BUF_TAIL = 0, // Trim or allocate space from tail
|
||||
NET_VECTOR_OWN_FIRST = 0x01 // We allocated the 1st block in the vector
|
||||
};
|
||||
} NET_SIGNATURE_TYPE;
|
||||
|
||||
#define NET_CHECK_SIGNATURE(PData, SIGNATURE) \
|
||||
ASSERT (((PData) != NULL) && ((PData)->Signature == (SIGNATURE)))
|
||||
@@ -1269,16 +1266,15 @@ NetbufQueCopy (
|
||||
IN UINT8 *Dest
|
||||
);
|
||||
|
||||
/**
|
||||
Copy some data from the buffer queue to the destination.
|
||||
|
||||
@param NbufQue Pointer to the net buffer queue.
|
||||
@param Offset The sequence number of the first byte to copy.
|
||||
@param Len Length of the data to copy.
|
||||
@param Dest The destination of the data to copy to.
|
||||
|
||||
@retval UINTN The length of the copied data.
|
||||
|
||||
/**
|
||||
Trim some data from the queue header, release the buffer if
|
||||
whole buffer is trimmed.
|
||||
|
||||
@param NbufQue Pointer to the net buffer queue.
|
||||
@param Len Length of the data to trim.
|
||||
|
||||
@retval UINTN The length of the data trimmed.
|
||||
|
||||
**/
|
||||
UINT32
|
||||
EFIAPI
|
||||
|
@@ -1,34 +1,29 @@
|
||||
/** @file
|
||||
|
||||
Copyright (c) 2007, 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.
|
||||
|
||||
Module Name:
|
||||
|
||||
PlatDriOverLib.h
|
||||
|
||||
Abstract:
|
||||
|
||||
|
||||
**/
|
||||
|
||||
#ifndef _PLAT_DRI_OVER_LIB_H_
|
||||
#define _PLAT_DRI_OVER_LIB_H_
|
||||
|
||||
#include <PiDxe.h>
|
||||
#include <Protocol/PlatformDriverOverride.h>
|
||||
#include <Protocol/DevicePath.h>
|
||||
#include <Protocol/DriverBinding.h>
|
||||
#include <Library/BaseLib.h>
|
||||
|
||||
#include <VariableFormat.h>
|
||||
|
||||
/** @file
|
||||
|
||||
This library provides basic platform driver override functions.
|
||||
|
||||
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_LIB_H_
|
||||
#define _PLAT_DRI_OVER_LIB_H_
|
||||
|
||||
#include <PiDxe.h>
|
||||
#include <Protocol/PlatformDriverOverride.h>
|
||||
#include <Protocol/DevicePath.h>
|
||||
#include <Protocol/DriverBinding.h>
|
||||
#include <Library/BaseLib.h>
|
||||
|
||||
#include <VariableFormat.h>
|
||||
|
||||
/**
|
||||
Install the Platform Driver Override Protocol, and ensure there is only one Platform Driver Override Protocol
|
||||
in the system.
|
||||
@@ -38,111 +33,67 @@ Abstract:
|
||||
|
||||
@retval EFI_ALREADY_STARTED There has been a Platform Driver Override
|
||||
Protocol in the system, cannot install it again.
|
||||
@retval Other Returned by InstallProtocolInterface
|
||||
@retval EFI_SUCCESS The protocol is installed successfully.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
InstallPlatformDriverOverrideProtocol (
|
||||
EFI_PLATFORM_DRIVER_OVERRIDE_PROTOCOL *gPlatformDriverOverride
|
||||
);
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
InstallPlatformDriverOverrideProtocol (
|
||||
EFI_PLATFORM_DRIVER_OVERRIDE_PROTOCOL *gPlatformDriverOverride
|
||||
);
|
||||
|
||||
/**
|
||||
Free all the mapping database memory resource and initialize the mapping list entry
|
||||
Free all the mapping database memory resource and initialize the mapping list entry.
|
||||
|
||||
@param MappingDataBase Mapping database list entry pointer
|
||||
|
||||
@retval EFI_INVALID_PARAMETER mapping database list entry is NULL
|
||||
@retval EFI_SUCCESS Free success
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
FreeMappingDatabase (
|
||||
IN OUT LIST_ENTRY *MappingDataBase
|
||||
);
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
FreeMappingDatabase (
|
||||
IN OUT LIST_ENTRY *MappingDataBase
|
||||
);
|
||||
|
||||
/**
|
||||
Read the environment variable(s) that contain the override mappings from Controller Device Path to
|
||||
a set of Driver Device Paths, and create the mapping database in memory with those variable info.
|
||||
VariableLayout{
|
||||
//
|
||||
// NotEnd indicate whether the variable is the last one, and has no subsequent variable need to load.
|
||||
// Each variable has MaximumVariableSize limitation, so we maybe need multi variables to store
|
||||
// large mapping infos.
|
||||
// The variable(s) name rule is PlatDriOver, PlatDriOver1, PlatDriOver2, ....
|
||||
//
|
||||
UINT32 NotEnd;
|
||||
//
|
||||
// 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; //EFI_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 SIGNATURE;
|
||||
UINT32 DriverNum;
|
||||
EFI_DEVICE_PATH_PROTOCOL ControllerDevicePath[];
|
||||
EFI_DEVICE_PATH_PROTOCOL DriverDevicePath[];
|
||||
EFI_DEVICE_PATH_PROTOCOL DriverDevicePath[];
|
||||
EFI_DEVICE_PATH_PROTOCOL DriverDevicePath[];
|
||||
......
|
||||
}
|
||||
typedef struct _PLATFORM_OVERRIDE_ITEM{
|
||||
UINTN Signature; //EFI_SIGNATURE_32('p','d','o','i')
|
||||
LIST_ENTRY Link;
|
||||
UINT32 DriverInfoNum;
|
||||
EFI_DEVICE_PATH_PROTOCOL *ControllerDevicePath;
|
||||
LIST_ENTRY DriverInfoList; //DRIVER_IMAGE_INFO List
|
||||
} PLATFORM_OVERRIDE_ITEM;
|
||||
typedef struct _DRIVER_IMAGE_INFO{
|
||||
UINTN Signature; //EFI_SIGNATURE_32('p','d','i','i')
|
||||
LIST_ENTRY Link;
|
||||
EFI_HANDLE ImageHandle;
|
||||
EFI_DEVICE_PATH_PROTOCOL *DriverImagePath;
|
||||
BOOLEAN UnLoadable;
|
||||
BOOLEAN UnStartable;
|
||||
} DRIVER_IMAGE_INFO;
|
||||
|
||||
@param MappingDataBase Mapping database list entry pointer
|
||||
|
||||
@retval EFI_INVALID_PARAMETER MappingDataBase pointer is null
|
||||
@retval EFI_NOT_FOUND Cannot find the 'PlatDriOver' NV variable
|
||||
@retval EFI_VOLUME_CORRUPTED The found NV variable is corrupted
|
||||
@retval EFI_SUCCESS Create the mapping database in memory
|
||||
successfully
|
||||
@retval EFI_SUCCESS Create the mapping database in memory successfully
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
InitOverridesMapping (
|
||||
OUT LIST_ENTRY *MappingDataBase
|
||||
);
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
InitOverridesMapping (
|
||||
OUT LIST_ENTRY *MappingDataBase
|
||||
);
|
||||
|
||||
/**
|
||||
Save the memory mapping database into NV environment variable(s)
|
||||
Save the memory mapping database into NV environment variable(s).
|
||||
|
||||
@param MappingDataBase Mapping database list entry pointer
|
||||
|
||||
@retval EFI_INVALID_PARAMETER MappingDataBase pointer is null
|
||||
@retval EFI_SUCCESS Save memory mapping database successfully
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
SaveOverridesMapping (
|
||||
IN LIST_ENTRY *MappingDataBase
|
||||
);
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
SaveOverridesMapping (
|
||||
IN LIST_ENTRY *MappingDataBase
|
||||
);
|
||||
|
||||
/**
|
||||
Retrieves the image handle of the platform override driver for a controller in the system from the memory mapping database.
|
||||
|
||||
@param This A pointer to the
|
||||
EFI_PLATFORM_DRIVER_OVERRIDE_PROTOCOL instance.
|
||||
@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 output, a pointer to the next driver handle.
|
||||
@@ -163,50 +114,56 @@ SaveOverridesMapping (
|
||||
@retval EFI_SUCCESS The driver override for ControllerHandle was
|
||||
returned in DriverImagePath.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
GetDriverFromMapping (
|
||||
IN EFI_PLATFORM_DRIVER_OVERRIDE_PROTOCOL * This,
|
||||
IN EFI_HANDLE ControllerHandle,
|
||||
IN OUT EFI_HANDLE * DriverImageHandle,
|
||||
IN LIST_ENTRY * MappingDataBase,
|
||||
IN EFI_HANDLE CallerImageHandle
|
||||
);
|
||||
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
DeleteOverridesVariables (
|
||||
VOID
|
||||
);
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
GetDriverFromMapping (
|
||||
IN EFI_PLATFORM_DRIVER_OVERRIDE_PROTOCOL * This,
|
||||
IN EFI_HANDLE ControllerHandle,
|
||||
IN OUT EFI_HANDLE * DriverImageHandle,
|
||||
IN LIST_ENTRY * MappingDataBase,
|
||||
IN EFI_HANDLE CallerImageHandle
|
||||
);
|
||||
|
||||
/**
|
||||
Deletes all environment variable(s) that contain the override mappings from Controller Device Path to
|
||||
a set of Driver Device Paths.
|
||||
|
||||
@retval EFI_SUCCESS Delete all variable(s) successfully.
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
DeleteOverridesVariables (
|
||||
VOID
|
||||
);
|
||||
|
||||
/**
|
||||
Check mapping database whether already has the mapping info which
|
||||
records the input Controller to input DriverImage.
|
||||
If has, the controller's total override driver number and input DriverImage's order number is return.
|
||||
|
||||
@param ControllerDevicePath The controller device path need to add a
|
||||
override driver image item
|
||||
@param DriverImageDevicePath The driver image device path need to be insert
|
||||
@param ControllerDevicePath The controller device path is to be check.
|
||||
@param DriverImageDevicePath The driver image device path is to be check.
|
||||
@param MappingDataBase Mapping database list entry pointer
|
||||
@param DriverInfoNum the controller's total override driver number
|
||||
@param DriverImageNO The inserted order number
|
||||
@param DriverImageNO The driver order number for the input DriverImage.
|
||||
If the DriverImageDevicePath is NULL, DriverImageNO is not set.
|
||||
|
||||
@return EFI_INVALID_PARAMETER
|
||||
@return EFI_NOT_FOUND
|
||||
@return EFI_SUCCESS
|
||||
@retval EFI_INVALID_PARAMETER ControllerDevicePath or MappingDataBase is NULL.
|
||||
@retval EFI_NOT_FOUND ControllerDevicePath is not found in MappingDataBase or
|
||||
DriverImageDevicePath is not found in the found DriverImage Info list.
|
||||
@retval EFI_SUCCESS The controller's total override driver number and
|
||||
input DriverImage's order number is correctly return.
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
CheckMapping (
|
||||
IN EFI_DEVICE_PATH_PROTOCOL *ControllerDevicePath,
|
||||
IN EFI_DEVICE_PATH_PROTOCOL *DriverImageDevicePath,
|
||||
IN LIST_ENTRY * MappingDataBase,
|
||||
OUT UINT32 *DriverInfoNum,
|
||||
OUT UINT32 *DriverImageNO
|
||||
);
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
CheckMapping (
|
||||
IN EFI_DEVICE_PATH_PROTOCOL *ControllerDevicePath,
|
||||
IN EFI_DEVICE_PATH_PROTOCOL *DriverImageDevicePath,
|
||||
IN LIST_ENTRY * MappingDataBase,
|
||||
OUT UINT32 *DriverInfoNum,
|
||||
OUT UINT32 *DriverImageNO
|
||||
);
|
||||
|
||||
/**
|
||||
Insert a driver image as a controller's override driver into the mapping database.
|
||||
The driver image's order number is indicated by DriverImageNO.
|
||||
@@ -215,50 +172,58 @@ CheckMapping (
|
||||
override driver image item
|
||||
@param DriverImageDevicePath The driver image device path need to be insert
|
||||
@param MappingDataBase Mapping database list entry pointer
|
||||
@param DriverImageNO The inserted order number
|
||||
@param DriverImageNO The inserted order number. If this number is taken,
|
||||
the larger available number will be used.
|
||||
|
||||
@return EFI_INVALID_PARAMETER
|
||||
@return EFI_ALREADY_STARTED
|
||||
@return EFI_SUCCESS
|
||||
@retval EFI_INVALID_PARAMETER ControllerDevicePath is NULL, or DriverImageDevicePath is NULL
|
||||
or MappingDataBase is NULL
|
||||
@retval EFI_ALREADY_STARTED The input Controller to input DriverImage has been
|
||||
recorded into the mapping database.
|
||||
@retval EFI_SUCCESS The Controller and DriverImage are inserted into
|
||||
the mapping database successfully.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
InsertDriverImage (
|
||||
IN EFI_DEVICE_PATH_PROTOCOL *ControllerDevicePath,
|
||||
IN EFI_DEVICE_PATH_PROTOCOL *DriverImageDevicePath,
|
||||
IN LIST_ENTRY *MappingDataBase,
|
||||
IN UINT32 DriverImageNO
|
||||
);
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
InsertDriverImage (
|
||||
IN EFI_DEVICE_PATH_PROTOCOL *ControllerDevicePath,
|
||||
IN EFI_DEVICE_PATH_PROTOCOL *DriverImageDevicePath,
|
||||
IN LIST_ENTRY *MappingDataBase,
|
||||
IN UINT32 DriverImageNO
|
||||
);
|
||||
|
||||
/**
|
||||
Delete a controller's override driver from the mapping database.
|
||||
|
||||
@param ControllerDevicePath The controller device path need to add a
|
||||
override driver image item
|
||||
@param DriverImageDevicePath The driver image device path need to be insert
|
||||
@param ControllerDevicePath The controller device path will be deleted
|
||||
when all drivers images on it are removed.
|
||||
@param DriverImageDevicePath The driver image device path will be delete.
|
||||
If NULL, all driver image will be delete.
|
||||
@param MappingDataBase Mapping database list entry pointer
|
||||
@param DriverImageNO The inserted order number
|
||||
|
||||
@return EFI_INVALID_PARAMETER
|
||||
@return EFI_NOT_FOUND
|
||||
@return EFI_SUCCESS
|
||||
@retval EFI_INVALID_PARAMETER ControllerDevicePath is NULL, or MappingDataBase is NULL
|
||||
@retval EFI_NOT_FOUND ControllerDevicePath is not found in MappingDataBase or
|
||||
DriverImageDevicePath is not found in the found DriverImage Info list.
|
||||
@retval EFI_SUCCESS Delete the specified driver successfully.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
DeleteDriverImage (
|
||||
IN EFI_DEVICE_PATH_PROTOCOL *ControllerDevicePath,
|
||||
IN EFI_DEVICE_PATH_PROTOCOL *DriverImageDevicePath,
|
||||
IN LIST_ENTRY *MappingDataBase
|
||||
);
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
DeleteDriverImage (
|
||||
IN EFI_DEVICE_PATH_PROTOCOL *ControllerDevicePath,
|
||||
IN EFI_DEVICE_PATH_PROTOCOL *DriverImageDevicePath,
|
||||
IN LIST_ENTRY *MappingDataBase
|
||||
);
|
||||
|
||||
/**
|
||||
Get the first Binding protocol which has the specific image handle
|
||||
|
||||
@param Image Image handle
|
||||
@param ImageHandle The Image handle
|
||||
@param BindingHandle The BindingHandle of the found Driver Binding protocol.
|
||||
If Binding protocol is not found, it is set to NULL.
|
||||
|
||||
@return Pointer into the Binding Protocol interface
|
||||
@return Pointer into the Binding Protocol interface
|
||||
@retval NULL The paramter is not valid or the binding protocol is not found.
|
||||
|
||||
**/
|
||||
EFI_DRIVER_BINDING_PROTOCOL *
|
||||
@@ -266,6 +231,6 @@ EFIAPI
|
||||
GetBindingProtocolFromImageHandle (
|
||||
IN EFI_HANDLE ImageHandle,
|
||||
OUT EFI_HANDLE *BindingHandle
|
||||
);
|
||||
|
||||
#endif
|
||||
);
|
||||
|
||||
#endif
|
||||
|
@@ -54,8 +54,6 @@ struct _EFI_BDS_ARCH_PROTOCOL_INSTANCE {
|
||||
|
||||
@param PrivateData The EFI_BDS_ARCH_PROTOCOL_INSTANCE instance
|
||||
|
||||
@return None.
|
||||
|
||||
**/
|
||||
VOID
|
||||
EFIAPI
|
||||
@@ -91,8 +89,6 @@ PlatformBdsPolicyBehavior (
|
||||
@param ExitData Exit data returned from failed boot.
|
||||
@param ExitDataSize Exit data size returned from failed boot.
|
||||
|
||||
@return None.
|
||||
|
||||
**/
|
||||
VOID
|
||||
EFIAPI
|
||||
@@ -126,7 +122,6 @@ PlatformBdsBootSuccess (
|
||||
The flash layout is platform specific.
|
||||
|
||||
@retval EFI_SUCCESS The non-updatable flash areas.
|
||||
@retval Others Some error occurs when locking non-updatable flash areas.
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
|
@@ -25,11 +25,11 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
typedef struct _UDP_IO_PORT UDP_IO_PORT;
|
||||
|
||||
enum {
|
||||
typedef enum {
|
||||
UDP_IO_RX_SIGNATURE = EFI_SIGNATURE_32 ('U', 'D', 'P', 'R'),
|
||||
UDP_IO_TX_SIGNATURE = EFI_SIGNATURE_32 ('U', 'D', 'P', 'T'),
|
||||
UDP_IO_SIGNATURE = EFI_SIGNATURE_32 ('U', 'D', 'P', 'I')
|
||||
};
|
||||
} UDP_IO_SIGNATURE_TYPE;
|
||||
|
||||
typedef struct {
|
||||
IP4_ADDR LocalAddr;
|
||||
@@ -130,7 +130,7 @@ BOOLEAN
|
||||
|
||||
@param Controller The controller that has the UDP service binding
|
||||
protocol installed.
|
||||
@param Image The image handle for the driver.
|
||||
@param ImageHandle The image handle for the driver.
|
||||
@param Configure The function to configure the created UDP child
|
||||
@param Context The opaque parameter for the Configure funtion.
|
||||
|
||||
@@ -204,14 +204,14 @@ UdpIoSendDatagram (
|
||||
IN VOID *Context
|
||||
);
|
||||
|
||||
/**
|
||||
The selection function to cancel a single sent datagram.
|
||||
|
||||
@param Token The UDP TX token to test againist.
|
||||
@param Context The context
|
||||
|
||||
@return TRUE if the packet is to be cancelled, otherwise FALSE.
|
||||
|
||||
/**
|
||||
Cancel a single sent datagram.
|
||||
|
||||
@param UdpIo The UDP IO port to cancel the packet from
|
||||
@param Packet The packet to cancel
|
||||
|
||||
@return None
|
||||
|
||||
**/
|
||||
VOID
|
||||
EFIAPI
|
||||
|
Reference in New Issue
Block a user