efidriverlib.h
来自「EFI BIOS是Intel提出的下一代的BIOS标准。这里上传的Edk源代码是」· C头文件 代码 · 共 1,191 行 · 第 1/2 页
H
1,191 行
Arguments:
AllocationSize - Pool size
Returns:
Pointer to the pool allocated
--*/
;
VOID *
EfiLibAllocateZeroPool (
IN UINTN AllocationSize
)
/*++
Routine Description:
Allocate EfiBootServicesData pool of size AllocationSize and set memory to zero.
Arguments:
AllocationSize - Pool size
Returns:
Pointer to the pool allocated
--*/
;
VOID *
EfiLibAllocateRuntimeZeroPool (
IN UINTN AllocationSize
)
/*++
Routine Description:
Allocate EfiRuntimeServicesData pool of size AllocationSize and set memory to zero.
Arguments:
AllocationSize - Pool size
Returns:
Pointer to the pool allocated
--*/
;
VOID *
EfiLibAllocateCopyPool (
IN UINTN AllocationSize,
IN VOID *Buffer
)
/*++
Routine Description:
Allocate BootServicesData pool and use a buffer provided by
caller to fill it.
Arguments:
AllocationSize - The size to allocate
Buffer - Buffer that will be filled into the buffer allocated
Returns:
Pointer of the buffer allocated.
--*/
;
VOID *
EfiLibAllocateRuntimeCopyPool (
IN UINTN AllocationSize,
IN VOID *Buffer
)
/*++
Routine Description:
Allocate RuntimeServicesData pool and use a buffer provided by
caller to fill it.
Arguments:
AllocationSize - The size to allocate
Buffer - Buffer that will be filled into the buffer allocated
Returns:
Pointer of the buffer allocated.
--*/
;
//
// Event.c
//
EFI_EVENT
EfiLibCreateProtocolNotifyEvent (
IN EFI_GUID *ProtocolGuid,
IN EFI_TPL NotifyTpl,
IN EFI_EVENT_NOTIFY NotifyFunction,
IN VOID *NotifyContext,
OUT VOID **Registration
)
/*++
Routine Description:
Create a protocol notification event and return it.
Arguments:
ProtocolGuid - Protocol to register notification event on.
NotifyTpl - Maximum TPL to single the NotifyFunction.
NotifyFunction - EFI notification routine.
NotifyContext - Context passed into Event when it is created.
Registration - Registration key returned from RegisterProtocolNotify().
Returns:
The EFI_EVENT that has been registered to be signaled when a ProtocolGuid
is added to the system.
--*/
;
EFI_STATUS
EfiLibNamedEventSignal (
IN EFI_GUID *Name
)
/*++
Routine Description:
Signals a named event. All registered listeners will run.
The listeners should register using EfiLibNamedEventListen() function.
NOTE: For now, the named listening/signalling is implemented
on a protocol interface being installed and uninstalled.
In the future, this maybe implemented based on a dedicated mechanism.
Arguments:
Name - Name to perform the signaling on. The name is a GUID.
Returns:
EFI_SUCCESS if successfull.
--*/
;
EFI_STATUS
EfiLibNamedEventListen (
IN EFI_GUID * Name,
IN EFI_TPL NotifyTpl,
IN EFI_EVENT_NOTIFY NotifyFunction,
IN VOID *NotifyContext
)
/*++
Routine Description:
Listenes to signals on the name.
EfiLibNamedEventSignal() signals the event.
NOTE: For now, the named listening/signalling is implemented
on a protocol interface being installed and uninstalled.
In the future, this maybe implemented based on a dedicated mechanism.
Arguments:
Name - Name to register the listener on.
NotifyTpl - Maximum TPL to singnal the NotifyFunction.
NotifyFunction - The listener routine.
NotifyContext - Context passed into the listener routine.
Returns:
EFI_SUCCESS if successful.
--*/
;
//
// Handle.c
//
EFI_STATUS
EfiLibLocateHandleProtocolByProtocols (
IN OUT EFI_HANDLE * Handle, OPTIONAL
OUT VOID **Interface, OPTIONAL
...
)
/*++
Routine Description:
Function locates Protocol and/or Handle on which all Protocols specified
as a variable list are installed.
It supports continued search. The caller must assure that no handles are added
or removed while performing continued search, by e.g., rising the TPL and not
calling any handle routines. Otherwise the behavior is undefined.
Arguments:
Handle - The address of handle to receive the handle on which protocols
indicated by the variable list are installed.
If points to NULL, all handles are searched. If pointing to a
handle returned from previous call, searches starting from next handle.
If NULL, the parameter is ignored.
Interface - The address of a pointer to a protocol interface that will receive
the interface indicated by first variable argument.
If NULL, the parameter is ignored.
... - A variable argument list containing protocol GUIDs. Must end with NULL.
Returns:
EFI_SUCCESS - All the protocols where found on same handle.
EFI_NOT_FOUND - A Handle with all the protocols installed was not found.
Other values as may be returned from LocateHandleBuffer() or HandleProtocol().
--*/
;
//
// Debug.c init
//
EFI_STATUS
EfiDebugAssertInit (
VOID
)
/*++
Routine Description:
Locate Debug Assert Protocol and set as mDebugAssert
Arguments:
None
Returns:
Status code
--*/
;
//
// Unicode String Support
//
EFI_STATUS
EfiLibLookupUnicodeString (
CHAR8 *Language,
CHAR8 *SupportedLanguages,
EFI_UNICODE_STRING_TABLE *UnicodeStringTable,
CHAR16 **UnicodeString
)
/*++
Routine Description:
Translate a unicode string to a specified language if supported.
Arguments:
Language - The name of language to translate to
SupportedLanguages - Supported languages set
UnicodeStringTable - Pointer of one item in translation dictionary
UnicodeString - The translated string
Returns:
EFI_INVALID_PARAMETER - Invalid parameter
EFI_UNSUPPORTED - System not supported this language or this string translation
EFI_SUCCESS - String successfully translated
--*/
;
EFI_STATUS
EfiLibAddUnicodeString (
CHAR8 *Language,
CHAR8 *SupportedLanguages,
EFI_UNICODE_STRING_TABLE **UnicodeStringTable,
CHAR16 *UnicodeString
)
/*++
Routine Description:
Add an translation to the dictionary if this language if supported.
Arguments:
Language - The name of language to translate to
SupportedLanguages - Supported languages set
UnicodeStringTable - Translation dictionary
UnicodeString - The corresponding string for the language to be translated to
Returns:
EFI_INVALID_PARAMETER - Invalid parameter
EFI_UNSUPPORTED - System not supported this language
EFI_ALREADY_STARTED - Already has a translation item of this language
EFI_OUT_OF_RESOURCES - No enough buffer to be allocated
EFI_SUCCESS - String successfully translated
--*/
;
EFI_STATUS
EfiLibFreeUnicodeStringTable (
EFI_UNICODE_STRING_TABLE *UnicodeStringTable
)
/*++
Routine Description:
Free a string table.
Arguments:
UnicodeStringTable - The string table to be freed.
Returns:
EFI_SUCCESS - The table successfully freed.
--*/
;
EFI_STATUS
EfiLibReportStatusCode (
IN EFI_STATUS_CODE_TYPE Type,
IN EFI_STATUS_CODE_VALUE Value,
IN UINT32 Instance,
IN EFI_GUID *CallerId OPTIONAL,
IN EFI_STATUS_CODE_DATA *Data OPTIONAL
)
/*++
Routine Description:
Report status code.
Arguments:
Type - Code type
Value - Code value
Instance - Instance number
CallerId - Caller name
DevicePath - Device path that to be reported
Returns:
Status code.
EFI_OUT_OF_RESOURCES - No enough buffer could be allocated
--*/
;
EFI_STATUS
ReportStatusCodeWithDevicePath (
IN EFI_STATUS_CODE_TYPE Type,
IN EFI_STATUS_CODE_VALUE Value,
IN UINT32 Instance,
IN EFI_GUID * CallerId OPTIONAL,
IN EFI_DEVICE_PATH_PROTOCOL * DevicePath
)
/*++
Routine Description:
Report device path through status code.
Arguments:
Type - Code type
Value - Code value
Instance - Instance number
CallerId - Caller name
DevicePath - Device path that to be reported
Returns:
Status code.
EFI_OUT_OF_RESOURCES - No enough buffer could be allocated
--*/
;
EFI_STATUS
EFIAPI
EfiCreateEventLegacyBoot (
IN EFI_TPL NotifyTpl,
IN EFI_EVENT_NOTIFY NotifyFunction,
IN VOID *NotifyContext,
OUT EFI_EVENT *LegacyBootEvent
)
/*++
Routine Description:
Create a Legacy Boot Event.
Tiano extended the CreateEvent Type enum to add a legacy boot event type.
This was bad as Tiano did not own the enum. In UEFI 2.0 CreateEventEx was
added and now it's possible to not voilate the UEFI specification by
declaring a GUID for the legacy boot event class. This library supports
the R8.5/EFI 1.10 form and R8.6/UEFI 2.0 form and allows common code to
work both ways.
Arguments:
LegacyBootEvent Returns the EFI event returned from gBS->CreateEvent(Ex)
Returns:
EFI_SUCCESS Event was created.
Other Event was not created.
--*/
;
EFI_STATUS
EFIAPI
EfiCreateEventReadyToBoot (
IN EFI_TPL NotifyTpl,
IN EFI_EVENT_NOTIFY NotifyFunction,
IN VOID *NotifyContext,
OUT EFI_EVENT *ReadyToBootEvent
)
/*++
Routine Description:
Create a Read to Boot Event.
Tiano extended the CreateEvent Type enum to add a ready to boot event type.
This was bad as Tiano did not own the enum. In UEFI 2.0 CreateEventEx was
added and now it's possible to not voilate the UEFI specification and use
the ready to boot event class defined in UEFI 2.0. This library supports
the R8.5/EFI 1.10 form and R8.6/UEFI 2.0 form and allows common code to
work both ways.
Arguments:
@param LegacyBootEvent Returns the EFI event returned from gBS->CreateEvent(Ex)
Return:
EFI_SUCCESS - Event was created.
Other - Event was not created.
--*/
;
VOID
EFIAPI
EfiInitializeFwVolDevicepathNode (
IN MEDIA_FW_VOL_FILEPATH_DEVICE_PATH *FvDevicePathNode,
IN EFI_GUID *NameGuid
)
/*++
Routine Description:
Initialize a Firmware Volume (FV) Media Device Path node.
Tiano extended the EFI 1.10 device path nodes. Tiano does not own this enum
so as we move to UEFI 2.0 support we must use a mechanism that conforms with
the UEFI 2.0 specification to define the FV device path. An UEFI GUIDed
device path is defined for PIWG extensions of device path. If the code
is compiled to conform with the UEFI 2.0 specification use the new device path
else use the old form for backwards compatability.
Arguments:
FvDevicePathNode - Pointer to a FV device path node to initialize
NameGuid - FV file name to use in FvDevicePathNode
--*/
;
EFI_GUID *
EFIAPI
EfiGetNameGuidFromFwVolDevicePathNode (
IN MEDIA_FW_VOL_FILEPATH_DEVICE_PATH *FvDevicePathNode
)
/*++
Routine Description:
Check to see if the Firmware Volume (FV) Media Device Path is valid.
Tiano extended the EFI 1.10 device path nodes. Tiano does not own this enum
so as we move to UEFI 2.0 support we must use a mechanism that conforms with
the UEFI 2.0 specification to define the FV device path. An UEFI GUIDed
device path is defined for PIWG extensions of device path. If the code
is compiled to conform with the UEFI 2.0 specification use the new device path
else use the old form for backwards compatability. The return value to this
function points to a location in FvDevicePathNode and it does not allocate
new memory for the GUID pointer that is returned.
Arguments:
FvDevicePathNode - Pointer to FV device path to check
Return:
NULL - FvDevicePathNode is not valid.
Other - FvDevicePathNode is valid and pointer to NameGuid was returned.
--*/
;
VOID
EfiLibSafeFreePool (
IN VOID *Buffer
)
/*++
Routine Description:
Free pool safely.
Arguments:
Buffer - The allocated pool entry to free
Returns:
Pointer of the buffer allocated.
--*/
;
EFI_STATUS
EfiLibTestManagedDevice (
IN EFI_HANDLE ControllerHandle,
IN EFI_HANDLE DriverBindingHandle,
IN EFI_GUID *ManagedProtocolGuid
)
/*++
Routine Description:
Test to see if the controller is managed by a specific driver.
Arguments:
ControllerHandle - Handle for controller to test
DriverBindingHandle - Driver binding handle for controller
ManagedProtocolGuid - The protocol guid the driver opens on controller
Returns:
EFI_SUCCESS - The controller is managed by the driver
EFI_UNSUPPORTED - The controller is not managed by the driver
--*/
;
EFI_STATUS
EfiLibTestChildHandle (
IN EFI_HANDLE ControllerHandle,
IN EFI_HANDLE ChildHandle,
IN EFI_GUID *ConsumedGuid
)
/*++
Routine Description:
Test to see if the child handle is the child of the controller
Arguments:
ControllerHandle - Handle for controller (parent)
ChildHandle - Child handle to test
ConsumsedGuid - Protocol guid consumed by child from controller
Returns:
EFI_SUCCESS - The child handle is the child of the controller
EFI_UNSUPPORTED - The child handle is not the child of the controller
--*/
;
#endif
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?