TianoCore EDK2 master
|
#include <Uefi.h>
#include <Pi/PiMultiPhase.h>
#include <Library/BaseLib.h>
#include <Library/BaseMemoryLib.h>
#include <Library/DebugLib.h>
#include <Library/MemoryAllocationLib.h>
#include <Library/UnitTestLib.h>
#include <Library/UefiBootServicesTableLib.h>
Go to the source code of this file.
An internal header file for the Unit Test instance of the UEFI Boot Services Table Library.
This file includes common header files, defines internal structure and functions used by the library implementation.
Copyright (c) Microsoft Corporation SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file UnitTestUefiBootServicesTableLib.h.
EFI_STATUS EFIAPI UnitTestAllocatePages | ( | IN EFI_ALLOCATE_TYPE | Type, |
IN EFI_MEMORY_TYPE | MemoryType, | ||
IN UINTN | NumberOfPages, | ||
IN OUT EFI_PHYSICAL_ADDRESS * | Memory | ||
) |
Allocates pages from the memory map.
Type | The type of allocation to perform |
MemoryType | The type of memory to turn the allocated pages into |
NumberOfPages | The number of pages to allocate |
Memory | A pointer to receive the base allocated memory address |
EFI_INVALID_PARAMETER | Parameters violate checking rules defined in spec. |
EFI_NOT_FOUND | Could not allocate pages match the requirement. |
EFI_OUT_OF_RESOURCES | No enough pages to allocate. |
EFI_SUCCESS | Pages successfully allocated. |
Definition at line 31 of file UnitTestUefiBootServicesTableLibMemory.c.
EFI_STATUS EFIAPI UnitTestAllocatePool | ( | IN EFI_MEMORY_TYPE | PoolType, |
IN UINTN | Size, | ||
OUT VOID ** | Buffer | ||
) |
Allocate pool of a particular type.
PoolType | Type of pool to allocate |
Size | The amount of pool to allocate |
Buffer | The address to return a pointer to the allocated pool |
EFI_INVALID_PARAMETER | PoolType not valid or Buffer is NULL |
EFI_OUT_OF_RESOURCES | Size exceeds max pool size or allocation failed. |
EFI_SUCCESS | Pool successfully allocated. |
Definition at line 120 of file UnitTestUefiBootServicesTableLibMemory.c.
EFI_STATUS EFIAPI UnitTestCalculateCrc32 | ( | IN VOID * | Data, |
IN UINTN | DataSize, | ||
OUT UINT32 * | Crc32 | ||
) |
Computes and returns a 32-bit CRC for a data buffer.
[in] | Data | A pointer to the buffer on which the 32-bit CRC is to be computed. |
[in] | DataSize | The number of bytes in the buffer Data. |
[out] | Crc32 | The 32-bit CRC that was computed for the data buffer specified by Data and DataSize. |
EFI_SUCCESS | The 32-bit CRC was computed for the data buffer and returned in Crc32. |
EFI_INVALID_PARAMETER | Data is NULL. |
EFI_INVALID_PARAMETER | Crc32 is NULL. |
EFI_INVALID_PARAMETER | DataSize is 0. |
Definition at line 185 of file UnitTestUefiBootServicesTableLibMisc.c.
EFI_STATUS EFIAPI UnitTestCheckEvent | ( | IN EFI_EVENT | UserEvent | ) |
Check the status of an event.
UserEvent | The event to check |
EFI_SUCCESS | The event is in the signaled state |
EFI_NOT_READY | The event is not in the signaled state |
EFI_INVALID_PARAMETER | Event is of type EVT_NOTIFY_SIGNAL |
Definition at line 141 of file UnitTestUefiBootServicesTableLibEventTimer.c.
EFI_STATUS EFIAPI UnitTestCloseEvent | ( | IN EFI_EVENT | UserEvent | ) |
Closes an event and frees the event structure.
UserEvent | Event to close |
EFI_INVALID_PARAMETER | Parameters are not valid. |
EFI_SUCCESS | The event has been closed |
Definition at line 122 of file UnitTestUefiBootServicesTableLibEventTimer.c.
EFI_STATUS EFIAPI UnitTestCloseProtocol | ( | IN EFI_HANDLE | UserHandle, |
IN EFI_GUID * | Protocol, | ||
IN EFI_HANDLE | AgentHandle, | ||
IN EFI_HANDLE | ControllerHandle | ||
) |
Closes a protocol on a handle that was opened using OpenProtocol().
UserHandle | The handle for the protocol interface that was previously opened with OpenProtocol(), and is now being closed. |
Protocol | The published unique identifier of the protocol. It is the caller's responsibility to pass in a valid GUID. |
AgentHandle | The handle of the agent that is closing the protocol interface. |
ControllerHandle | If the agent that opened a protocol is a driver that follows the EFI Driver Model, then this parameter is the controller handle that required the protocol interface. If the agent does not follow the EFI Driver Model, then this parameter is optional and may be NULL. |
EFI_SUCCESS | The protocol instance was closed. |
EFI_INVALID_PARAMETER | Handle, AgentHandle or ControllerHandle is not a valid EFI_HANDLE. |
EFI_NOT_FOUND | Can not find the specified protocol or AgentHandle. |
Definition at line 1370 of file UnitTestUefiBootServicesTableLibProtocol.c.
EFI_STATUS EFIAPI UnitTestConnectController | ( | IN EFI_HANDLE | ControllerHandle, |
IN EFI_HANDLE *DriverImageHandle | OPTIONAL, | ||
IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath | OPTIONAL, | ||
IN BOOLEAN | Recursive | ||
) |
Connects one or more drivers to a controller.
ControllerHandle | The handle of the controller to which driver(s) are to be connected. |
DriverImageHandle | A pointer to an ordered list handles that support the EFI_DRIVER_BINDING_PROTOCOL. |
RemainingDevicePath | A pointer to the device path that specifies a child of the controller specified by ControllerHandle. |
Recursive | If TRUE, then ConnectController() is called recursively until the entire tree of controllers below the controller specified by ControllerHandle have been created. If FALSE, then the tree of controllers is only expanded one level. |
EFI_SUCCESS | 1) One or more drivers were connected to ControllerHandle. 2) No drivers were connected to ControllerHandle, but RemainingDevicePath is not NULL, and it is an End Device Path Node. |
EFI_INVALID_PARAMETER | ControllerHandle is NULL. |
EFI_NOT_FOUND | 1) There are no EFI_DRIVER_BINDING_PROTOCOL instances present in the system. 2) No drivers were connected to ControllerHandle. |
EFI_SECURITY_VIOLATION | The user has no permission to start UEFI device drivers on the device path associated with the ControllerHandle or specified by the RemainingDevicePath. |
Definition at line 115 of file UnitTestUefiBootServicesTableLibMisc.c.
EFI_STATUS EFIAPI UnitTestCreateEvent | ( | IN UINT32 | Type, |
IN EFI_TPL | NotifyTpl, | ||
IN EFI_EVENT_NOTIFY | NotifyFunction, | ||
OPTIONAL IN VOID * | NotifyContext, | ||
OPTIONAL OUT EFI_EVENT * | Event | ||
) |
Creates an event.
Type | The type of event to create and its mode and attributes |
NotifyTpl | The task priority level of event notifications |
NotifyFunction | Pointer to the events notification function |
NotifyContext | Pointer to the notification functions context; corresponds to parameter "Context" in the notification function |
Event | Pointer to the newly created event if the call succeeds; undefined otherwise |
EFI_SUCCESS | The event structure was created |
EFI_INVALID_PARAMETER | One of the parameters has an invalid value |
EFI_OUT_OF_RESOURCES | The event could not be allocated |
Creates an event.
Type | The type of event to create and its mode and attributes |
NotifyTpl | The task priority level of event notifications |
NotifyFunction | Pointer to the events notification function |
NotifyContext | Pointer to the notification functions context corresponds to parameter "Context" in the notification function |
Event | Pointer to the newly created event if the call succeeds undefined otherwise |
EFI_SUCCESS | The event structure was created |
EFI_INVALID_PARAMETER | One of the parameters has an invalid value |
EFI_OUT_OF_RESOURCES | The event could not be allocated |
Definition at line 31 of file UnitTestUefiBootServicesTableLibEventTimer.c.
EFI_STATUS EFIAPI UnitTestCreateEventEx | ( | IN UINT32 | Type, |
IN EFI_TPL | NotifyTpl, | ||
IN EFI_EVENT_NOTIFY | NotifyFunction, | ||
OPTIONAL IN CONST VOID * | NotifyContext, | ||
OPTIONAL IN CONST EFI_GUID * | EventGroup, | ||
OPTIONAL OUT EFI_EVENT * | Event | ||
) |
Creates an event in a group.
Type | The type of event to create and its mode and attributes |
NotifyTpl | The task priority level of event notifications |
NotifyFunction | Pointer to the events notification function |
NotifyContext | Pointer to the notification functions context; corresponds to parameter "Context" in the notification function |
EventGroup | GUID for EventGroup if NULL act the same as gBS->CreateEvent(). |
Event | Pointer to the newly created event if the call succeeds; undefined otherwise |
EFI_SUCCESS | The event structure was created |
EFI_INVALID_PARAMETER | One of the parameters has an invalid value |
EFI_OUT_OF_RESOURCES | The event could not be allocated |
Creates an event in a group.
Type | The type of event to create and its mode and attributes |
NotifyTpl | The task priority level of event notifications |
NotifyFunction | Pointer to the events notification function |
NotifyContext | Pointer to the notification functions context corresponds to parameter "Context" in the notification function |
EventGroup | GUID for EventGroup if NULL act the same as gBS->CreateEvent(). |
Event | Pointer to the newly created event if the call succeeds undefined otherwise |
EFI_SUCCESS | The event structure was created |
EFI_INVALID_PARAMETER | One of the parameters has an invalid value |
EFI_OUT_OF_RESOURCES | The event could not be allocated |
Definition at line 170 of file UnitTestUefiBootServicesTableLibEventTimer.c.
EFI_STATUS EFIAPI UnitTestDisconnectController | ( | IN EFI_HANDLE | ControllerHandle, |
IN EFI_HANDLE DriverImageHandle | OPTIONAL, | ||
IN EFI_HANDLE ChildHandle | OPTIONAL | ||
) |
Disconnects a controller from a driver
ControllerHandle | ControllerHandle The handle of the controller from which driver(s) are to be disconnected. |
DriverImageHandle | DriverImageHandle The driver to disconnect from ControllerHandle. |
ChildHandle | ChildHandle The handle of the child to destroy. |
EFI_SUCCESS | One or more drivers were disconnected from the controller. |
EFI_SUCCESS | On entry, no drivers are managing ControllerHandle. |
EFI_SUCCESS | DriverImageHandle is not NULL, and on entry DriverImageHandle is not managing ControllerHandle. |
EFI_INVALID_PARAMETER | ControllerHandle is NULL. |
EFI_INVALID_PARAMETER | DriverImageHandle is not NULL, and it is not a valid EFI_HANDLE. |
EFI_INVALID_PARAMETER | ChildHandle is not NULL, and it is not a valid EFI_HANDLE. |
EFI_OUT_OF_RESOURCES | There are not enough resources available to disconnect any drivers from ControllerHandle. |
EFI_DEVICE_ERROR | The controller could not be disconnected because of a device error. |
Definition at line 159 of file UnitTestUefiBootServicesTableLibMisc.c.
EFI_STATUS EFIAPI UnitTestExit | ( | IN EFI_HANDLE | ImageHandle, |
IN EFI_STATUS | Status, | ||
IN UINTN | ExitDataSize, | ||
IN CHAR16 *ExitData | OPTIONAL | ||
) |
Terminates the currently loaded EFI image and returns control to boot services.
ImageHandle | Handle that identifies the image. This parameter is passed to the image on entry. |
Status | The image's exit code. |
ExitDataSize | The size, in bytes, of ExitData. Ignored if ExitStatus is EFI_SUCCESS. |
ExitData | Pointer to a data buffer that includes a Null-terminated Unicode string, optionally followed by additional binary data. The string is a description that the caller may use to further indicate the reason for the image's exit. |
EFI_INVALID_PARAMETER | Image handle is NULL or it is not current image. |
EFI_SUCCESS | Successfully terminates the currently loaded EFI image. |
EFI_ACCESS_DENIED | Should never reach there. |
EFI_OUT_OF_RESOURCES | Could not allocate pool |
Definition at line 114 of file UnitTestUefiBootServicesTableLibImage.c.
EFI_STATUS EFIAPI UnitTestExitBootServices | ( | IN EFI_HANDLE | ImageHandle, |
IN UINTN | MapKey | ||
) |
Terminates all boot services.
ImageHandle | Handle that identifies the exiting image. |
MapKey | Key to the latest memory map. |
EFI_SUCCESS | Boot Services terminated |
EFI_INVALID_PARAMETER | MapKey is incorrect. |
Definition at line 157 of file UnitTestUefiBootServicesTableLibImage.c.
EFI_STATUS EFIAPI UnitTestFreePages | ( | IN EFI_PHYSICAL_ADDRESS | Memory, |
IN UINTN | NumberOfPages | ||
) |
Frees previous allocated pages.
Memory | Base address of memory being freed |
NumberOfPages | The number of pages to free |
EFI_NOT_FOUND | Could not find the entry that covers the range |
EFI_INVALID_PARAMETER | Address not aligned |
Definition at line 54 of file UnitTestUefiBootServicesTableLibMemory.c.
EFI_STATUS EFIAPI UnitTestFreePool | ( | IN VOID * | Buffer | ) |
Frees pool.
Buffer | The allocated pool entry to free |
EFI_INVALID_PARAMETER | Buffer is not a valid value. |
EFI_SUCCESS | Pool successfully freed. |
Definition at line 140 of file UnitTestUefiBootServicesTableLibMemory.c.
EFI_STATUS EFIAPI UnitTestGetMemoryMap | ( | IN OUT UINTN * | MemoryMapSize, |
IN OUT EFI_MEMORY_DESCRIPTOR * | MemoryMap, | ||
OUT UINTN * | MapKey, | ||
OUT UINTN * | DescriptorSize, | ||
OUT UINT32 * | DescriptorVersion | ||
) |
This function returns a copy of the current memory map. The map is an array of memory descriptors, each of which describes a contiguous block of memory.
MemoryMapSize | A pointer to the size, in bytes, of the MemoryMap buffer. On input, this is the size of the buffer allocated by the caller. On output, it is the size of the buffer returned by the firmware if the buffer was large enough, or the size of the buffer needed to contain the map if the buffer was too small. |
MemoryMap | A pointer to the buffer in which firmware places the current memory map. |
MapKey | A pointer to the location in which firmware returns the key for the current memory map. |
DescriptorSize | A pointer to the location in which firmware returns the size, in bytes, of an individual EFI_MEMORY_DESCRIPTOR. |
DescriptorVersion | A pointer to the location in which firmware returns the version number associated with the EFI_MEMORY_DESCRIPTOR. |
EFI_SUCCESS | The memory map was returned in the MemoryMap buffer. |
EFI_BUFFER_TOO_SMALL | The MemoryMap buffer was too small. The current buffer size needed to hold the memory map is returned in MemoryMapSize. |
EFI_INVALID_PARAMETER | One of the parameters has an invalid value. |
Definition at line 94 of file UnitTestUefiBootServicesTableLibMemory.c.
EFI_STATUS EFIAPI UnitTestGetNextMonotonicCount | ( | OUT UINT64 * | Count | ) |
Returns a monotonically increasing count for the platform.
[out] | Count | The pointer to returned value. |
EFI_SUCCESS | The next monotonic count was returned. |
EFI_INVALID_PARAMETER | Count is NULL. |
EFI_DEVICE_ERROR | The device is not functioning properly. |
Definition at line 23 of file UnitTestUefiBootServicesTableLibMisc.c.
EFI_STATUS EFIAPI UnitTestHandleProtocol | ( | IN EFI_HANDLE | UserHandle, |
IN EFI_GUID * | Protocol, | ||
OUT VOID ** | Interface | ||
) |
Queries a handle to determine if it supports a specified protocol.
UserHandle | The handle being queried. |
Protocol | The published unique identifier of the protocol. |
Interface | Supplies the address where a pointer to the corresponding Protocol Interface is returned. |
Definition at line 841 of file UnitTestUefiBootServicesTableLibProtocol.c.
EFI_STATUS EFIAPI UnitTestInstallConfigurationTable | ( | IN EFI_GUID * | Guid, |
IN VOID * | Table | ||
) |
Boot Service called to add, modify, or remove a system configuration table from the EFI System Table.
Guid | Pointer to the GUID for the entry to add, update, or remove |
Table | Pointer to the configuration table for the entry to add, update, or remove, may be NULL. |
Definition at line 1086 of file UnitTestUefiBootServicesTableLibProtocol.c.
EFI_STATUS EFIAPI UnitTestInstallMultipleProtocolInterfaces | ( | IN OUT EFI_HANDLE * | Handle, |
... | |||
) |
Installs a list of protocol interface into the boot services environment. This function calls InstallProtocolInterface() in a loop. If any error occurs all the protocols added by this function are removed. This is basically a lib function to save space.
Handle | The handle to install the protocol handlers on, or NULL if a new handle is to be allocated |
... | EFI_GUID followed by protocol instance. A NULL terminates the list. The pairs are the arguments to InstallProtocolInterface(). All the protocols are added to Handle. |
EFI_SUCCESS | All the protocol interface was installed. |
EFI_OUT_OF_RESOURCES | There was not enough memory in pool to install all the protocols. |
EFI_ALREADY_STARTED | A Device Path Protocol instance was passed in that is already present in the handle database. |
EFI_INVALID_PARAMETER | Handle is NULL. |
EFI_INVALID_PARAMETER | Protocol is already installed on the handle specified by Handle. |
Definition at line 1575 of file UnitTestUefiBootServicesTableLibProtocol.c.
EFI_STATUS EFIAPI UnitTestInstallProtocolInterface | ( | IN OUT EFI_HANDLE * | UserHandle, |
IN EFI_GUID * | Protocol, | ||
IN EFI_INTERFACE_TYPE | InterfaceType, | ||
IN VOID * | Interface | ||
) |
Wrapper function to UnitTestInstallProtocolInterfaceNotify. This is the public API which Calls the private one which contains a BOOLEAN parameter for notifications
UserHandle | The handle to install the protocol handler on, or NULL if a new handle is to be allocated |
Protocol | The protocol to add to the handle |
InterfaceType | Indicates whether Interface is supplied in native form. |
Interface | The interface for the protocol being added |
Definition at line 683 of file UnitTestUefiBootServicesTableLibProtocol.c.
EFI_STATUS EFIAPI UnitTestInternalFreePool | ( | IN VOID * | Buffer, |
OUT EFI_MEMORY_TYPE *PoolType | OPTIONAL | ||
) |
Frees pool.
Buffer | The allocated pool entry to free |
PoolType | Pointer to pool type |
EFI_INVALID_PARAMETER | Buffer is not a valid value. |
EFI_SUCCESS | Pool successfully freed. |
EFI_STATUS EFIAPI UnitTestLoadImage | ( | IN BOOLEAN | BootPolicy, |
IN EFI_HANDLE | ParentImageHandle, | ||
IN EFI_DEVICE_PATH_PROTOCOL * | FilePath, | ||
IN VOID *SourceBuffer | OPTIONAL, | ||
IN UINTN | SourceSize, | ||
OUT EFI_HANDLE * | ImageHandle | ||
) |
Loads an EFI image into memory and returns a handle to the image.
BootPolicy | If TRUE, indicates that the request originates from the boot manager, and that the boot manager is attempting to load FilePath as a boot selection. |
ParentImageHandle | The caller's image handle. |
FilePath | The specific file path from which the image is loaded. |
SourceBuffer | If not NULL, a pointer to the memory location containing a copy of the image to be loaded. |
SourceSize | The size in bytes of SourceBuffer. |
ImageHandle | Pointer to the returned image handle that is created when the image is successfully loaded. |
EFI_SUCCESS | The image was loaded into memory. |
EFI_NOT_FOUND | The FilePath was not found. |
EFI_INVALID_PARAMETER | One of the parameters has an invalid value. |
EFI_UNSUPPORTED | The image type is not supported, or the device path cannot be parsed to locate the proper protocol for loading the file. |
EFI_OUT_OF_RESOURCES | Image was not loaded due to insufficient resources. |
EFI_LOAD_ERROR | Image was not loaded because the image format was corrupt or not understood. |
EFI_DEVICE_ERROR | Image was not loaded because the device returned a read error. |
EFI_ACCESS_DENIED | Image was not loaded because the platform policy prohibits the image from being loaded. NULL is returned in *ImageHandle. |
EFI_SECURITY_VIOLATION | Image was loaded and an ImageHandle was created with a valid EFI_LOADED_IMAGE_PROTOCOL. However, the current platform policy specifies that the image should not be started. |
Definition at line 47 of file UnitTestUefiBootServicesTableLibImage.c.
EFI_STATUS EFIAPI UnitTestLocateDevicePath | ( | IN EFI_GUID * | Protocol, |
IN OUT EFI_DEVICE_PATH_PROTOCOL ** | DevicePath, | ||
OUT EFI_HANDLE * | Device | ||
) |
Locates the handle to a device on the device path that best matches the specified protocol.
Protocol | The protocol to search for. |
DevicePath | On input, a pointer to a pointer to the device path. On output, the device path pointer is modified to point to the remaining part of the devicepath. |
Device | A pointer to the returned device handle. |
EFI_SUCCESS | The resulting handle was returned. |
EFI_NOT_FOUND | No handles matched the search. |
EFI_INVALID_PARAMETER | One of the parameters has an invalid value. |
Definition at line 1060 of file UnitTestUefiBootServicesTableLibProtocol.c.
EFI_STATUS EFIAPI UnitTestLocateHandle | ( | IN EFI_LOCATE_SEARCH_TYPE | SearchType, |
IN EFI_GUID *Protocol | OPTIONAL, | ||
IN VOID *SearchKey | OPTIONAL, | ||
IN OUT UINTN * | BufferSize, | ||
OUT EFI_HANDLE * | Buffer | ||
) |
Locates the requested handle(s) and returns them in Buffer.
SearchType | The type of search to perform to locate the handles |
Protocol | The protocol to search for |
SearchKey | Dependant on SearchType |
BufferSize | On input the size of Buffer. On output the size of data returned. |
Buffer | The buffer to return the results in |
EFI_BUFFER_TOO_SMALL | Buffer too small, required buffer size is returned in BufferSize. |
EFI_INVALID_PARAMETER | Invalid parameter |
EFI_SUCCESS | Successfully found the requested handle(s) and returns them in Buffer. |
Definition at line 901 of file UnitTestUefiBootServicesTableLibProtocol.c.
EFI_STATUS EFIAPI UnitTestLocateHandleBuffer | ( | IN EFI_LOCATE_SEARCH_TYPE | SearchType, |
IN EFI_GUID *Protocol | OPTIONAL, | ||
IN VOID *SearchKey | OPTIONAL, | ||
IN OUT UINTN * | NumberHandles, | ||
OUT EFI_HANDLE ** | Buffer | ||
) |
Function returns an array of handles that support the requested protocol in a buffer allocated from pool. This is a version of UnitTestLocateHandle() that allocates a buffer for the caller.
SearchType | Specifies which handle(s) are to be returned. |
Protocol | Provides the protocol to search by. This parameter is only valid for SearchType ByProtocol. |
SearchKey | Supplies the search key depending on the SearchType. |
NumberHandles | The number of handles returned in Buffer. |
Buffer | A pointer to the buffer to return the requested array of handles that support Protocol. |
EFI_SUCCESS | The result array of handles was returned. |
EFI_NOT_FOUND | No handles match the search. |
EFI_OUT_OF_RESOURCES | There is not enough pool memory to store the matching results. |
EFI_INVALID_PARAMETER | One or more parameters are not valid. |
Definition at line 1461 of file UnitTestUefiBootServicesTableLibProtocol.c.
EFI_STATUS EFIAPI UnitTestLocateProtocol | ( | IN EFI_GUID * | Protocol, |
IN VOID *Registration | OPTIONAL, | ||
OUT VOID ** | Interface | ||
) |
Return the first Protocol Interface that matches the Protocol GUID. If Registration is passed in, return a Protocol Instance that was just add to the system. If Registration is NULL return the first Protocol Interface you find.
Protocol | The protocol to search for |
Registration | Optional Registration Key returned from RegisterProtocolNotify() |
Interface | Return the Protocol interface (instance). |
EFI_SUCCESS | If a valid Interface is returned |
EFI_INVALID_PARAMETER | Invalid parameter |
EFI_NOT_FOUND | Protocol interface not found |
Definition at line 1543 of file UnitTestUefiBootServicesTableLibProtocol.c.
EFI_STATUS EFIAPI UnitTestOpenProtocol | ( | IN EFI_HANDLE | UserHandle, |
IN EFI_GUID * | Protocol, | ||
OUT VOID **Interface | OPTIONAL, | ||
IN EFI_HANDLE | ImageHandle, | ||
IN EFI_HANDLE | ControllerHandle, | ||
IN UINT32 | Attributes | ||
) |
Locates the installed protocol handler for the handle, and invokes it to obtain the protocol interface. Usage information is registered in the protocol data base.
UserHandle | The handle to obtain the protocol interface on |
Protocol | The ID of the protocol |
Interface | The location to return the protocol interface |
ImageHandle | The handle of the Image that is opening the protocol interface specified by Protocol and Interface. |
ControllerHandle | The controller handle that is requiring this interface. |
Attributes | The open mode of the protocol interface specified by Handle and Protocol. |
EFI_INVALID_PARAMETER | Protocol is NULL. |
EFI_SUCCESS | Get the protocol interface. |
Definition at line 1116 of file UnitTestUefiBootServicesTableLibProtocol.c.
EFI_STATUS EFIAPI UnitTestOpenProtocolInformation | ( | IN EFI_HANDLE | UserHandle, |
IN EFI_GUID * | Protocol, | ||
OUT EFI_OPEN_PROTOCOL_INFORMATION_ENTRY ** | EntryBuffer, | ||
OUT UINTN * | EntryCount | ||
) |
Return information about Opened protocols in the system
UserHandle | The handle to close the protocol interface on |
Protocol | The ID of the protocol |
EntryBuffer | A pointer to a buffer of open protocol information in the form of EFI_OPEN_PROTOCOL_INFORMATION_ENTRY structures. |
EntryCount | Number of EntryBuffer entries |
Definition at line 1393 of file UnitTestUefiBootServicesTableLibProtocol.c.
EFI_STATUS EFIAPI UnitTestProtocolsPerHandle | ( | IN EFI_HANDLE | UserHandle, |
OUT EFI_GUID *** | ProtocolBuffer, | ||
OUT UINTN * | ProtocolBufferCount | ||
) |
Retrieves the list of protocol interface GUIDs that are installed on a handle in a buffer allocated from pool.
UserHandle | The handle from which to retrieve the list of protocol interface GUIDs. |
ProtocolBuffer | A pointer to the list of protocol interface GUID pointers that are installed on Handle. |
ProtocolBufferCount | A pointer to the number of GUID pointers present in ProtocolBuffer. |
EFI_SUCCESS | The list of protocol interface GUIDs installed on Handle was returned in ProtocolBuffer. The number of protocol interface GUIDs was returned in ProtocolBufferCount. |
EFI_INVALID_PARAMETER | Handle is NULL. |
EFI_INVALID_PARAMETER | Handle is not a valid EFI_HANDLE. |
EFI_INVALID_PARAMETER | ProtocolBuffer is NULL. |
EFI_INVALID_PARAMETER | ProtocolBufferCount is NULL. |
EFI_OUT_OF_RESOURCES | There is not enough pool memory to store the results. |
Definition at line 1428 of file UnitTestUefiBootServicesTableLibProtocol.c.
Raise the task priority level to the new level. High level is implemented by disabling processor interrupts.
NewTpl | New task priority level |
Definition at line 22 of file UnitTestUefiBootServicesTableLibTpl.c.
EFI_STATUS EFIAPI UnitTestRegisterProtocolNotify | ( | IN EFI_GUID * | Protocol, |
IN EFI_EVENT | Event, | ||
OUT VOID ** | Registration | ||
) |
Add a new protocol notification record for the request protocol.
Protocol | The requested protocol to add the notify registration |
Event | The event to signal |
Registration | Returns the registration record |
EFI_INVALID_PARAMETER | Invalid parameter |
EFI_SUCCESS | Successfully returned the registration record that has been added |
Definition at line 872 of file UnitTestUefiBootServicesTableLibProtocol.c.
EFI_STATUS EFIAPI UnitTestReinstallProtocolInterface | ( | IN EFI_HANDLE | UserHandle, |
IN EFI_GUID * | Protocol, | ||
IN VOID * | OldInterface, | ||
IN VOID * | NewInterface | ||
) |
Reinstall a protocol interface on a device handle. The OldInterface for Protocol is replaced by the NewInterface.
UserHandle | Handle on which the interface is to be reinstalled |
Protocol | The numeric ID of the interface |
OldInterface | A pointer to the old interface |
NewInterface | A pointer to the new interface |
EFI_SUCCESS | The protocol interface was installed |
EFI_NOT_FOUND | The OldInterface on the handle was not found |
EFI_INVALID_PARAMETER | One of the parameters has an invalid value |
Definition at line 715 of file UnitTestUefiBootServicesTableLibProtocol.c.
Lowers the task priority to the previous value. If the new priority unmasks events at a higher priority, they are dispatched.
NewTpl | New, lower, task priority |
Definition at line 38 of file UnitTestUefiBootServicesTableLibTpl.c.
EFI_STATUS EFIAPI UnitTestSetTimer | ( | IN EFI_EVENT | UserEvent, |
IN EFI_TIMER_DELAY | Type, | ||
IN UINT64 | TriggerTime | ||
) |
Sets the type of timer and the trigger time for a timer event.
UserEvent | The timer event that is to be signaled at the specified time |
Type | The type of time that is specified in TriggerTime |
TriggerTime | The number of 100ns units until the timer expires |
EFI_SUCCESS | The event has been set to be signaled at the requested time |
EFI_INVALID_PARAMETER | Event or Type is not valid |
Definition at line 59 of file UnitTestUefiBootServicesTableLibEventTimer.c.
EFI_STATUS EFIAPI UnitTestSetWatchdogTimer | ( | IN UINTN | Timeout, |
IN UINT64 | WatchdogCode, | ||
IN UINTN | DataSize, | ||
IN CHAR16 *WatchdogData | OPTIONAL | ||
) |
Sets the system's watchdog timer.
Timeout | The number of seconds to set the watchdog timer to. A value of zero disables the timer. |
WatchdogCode | The numeric code to log on a watchdog timer timeout event. The firmware reserves codes 0x0000 to 0xFFFF. Loaders and operating systems may use other timeout codes. |
DataSize | The size, in bytes, of WatchdogData. |
WatchdogData | A data buffer that includes a Null-terminated Unicode string, optionally followed by additional binary data. The string is a description that the call may use to further indicate the reason to be logged with a watchdog event. |
Definition at line 77 of file UnitTestUefiBootServicesTableLibMisc.c.
EFI_STATUS EFIAPI UnitTestSignalEvent | ( | IN EFI_EVENT | UserEvent | ) |
Signals the event. Queues the event to be notified if needed.
UserEvent | The event to signal . |
EFI_INVALID_PARAMETER | Parameters are not valid. |
EFI_SUCCESS | The event was signaled. |
Definition at line 104 of file UnitTestUefiBootServicesTableLibEventTimer.c.
EFI_STATUS EFIAPI UnitTestStall | ( | IN UINTN | Microseconds | ) |
Introduces a fine-grained stall.
Microseconds | The number of microseconds to stall execution. |
EFI_SUCCESS | Execution was stalled for at least the requested amount of microseconds. |
EFI_NOT_AVAILABLE_YET | gMetronome is not available yet |
Definition at line 46 of file UnitTestUefiBootServicesTableLibMisc.c.
EFI_STATUS EFIAPI UnitTestStartImage | ( | IN EFI_HANDLE | ImageHandle, |
OUT UINTN * | ExitDataSize, | ||
OUT CHAR16 **ExitData | OPTIONAL | ||
) |
Transfer control to a loaded image's entry point.
ImageHandle | Handle of image to be started. |
ExitDataSize | Pointer of the size to ExitData |
ExitData | Pointer to a pointer to a data buffer that includes a Null-terminated string, optionally followed by additional binary data. The string is a description that the caller may use to further indicate the reason for the image's exit. |
EFI_INVALID_PARAMETER | Invalid parameter |
EFI_OUT_OF_RESOURCES | No enough buffer to allocate |
EFI_SECURITY_VIOLATION | The current platform policy specifies that the image should not be started. |
EFI_SUCCESS | Successfully transfer control to the image's entry point. |
Definition at line 80 of file UnitTestUefiBootServicesTableLibImage.c.
EFI_STATUS EFIAPI UnitTestUninstallMultipleProtocolInterfaces | ( | IN EFI_HANDLE | Handle, |
... | |||
) |
Uninstalls a list of protocol interface in the boot services environment. This function calls UninstallProtocolInterface() in a loop. This is basically a lib function to save space.
Handle | The handle to uninstall the protocol |
... | EFI_GUID followed by protocol instance. A NULL terminates the list. The pairs are the arguments to UninstallProtocolInterface(). All the protocols are added to Handle. |
Definition at line 1599 of file UnitTestUefiBootServicesTableLibProtocol.c.
EFI_STATUS EFIAPI UnitTestUninstallProtocolInterface | ( | IN EFI_HANDLE | UserHandle, |
IN EFI_GUID * | Protocol, | ||
IN VOID * | Interface | ||
) |
Uninstalls all instances of a protocol:interfacer from a handle. If the last protocol interface is remove from the handle, the handle is freed.
UserHandle | The handle to remove the protocol handler from |
Protocol | The protocol, of protocol:interface, to remove |
Interface | The interface, of protocol:interface, to remove |
EFI_INVALID_PARAMETER | Protocol is NULL. |
EFI_SUCCESS | Protocol interface successfully uninstalled. |
Definition at line 740 of file UnitTestUefiBootServicesTableLibProtocol.c.
EFI_STATUS EFIAPI UnitTestUnloadImage | ( | IN EFI_HANDLE | ImageHandle | ) |
Unloads an image.
ImageHandle | Handle that identifies the image to be unloaded. |
EFI_SUCCESS | The image has been unloaded. |
EFI_UNSUPPORTED | The image has been started, and does not support unload. |
EFI_INVALID_PARAMPETER | ImageHandle is not a valid image handle. |
Definition at line 138 of file UnitTestUefiBootServicesTableLibImage.c.
EFI_STATUS EFIAPI UnitTestWaitForEvent | ( | IN UINTN | NumberOfEvents, |
IN EFI_EVENT * | UserEvents, | ||
OUT UINTN * | UserIndex | ||
) |
Stops execution until an event is signaled.
NumberOfEvents | The number of events in the UserEvents array |
UserEvents | An array of EFI_EVENT |
UserIndex | Pointer to the index of the event which satisfied the wait condition |
EFI_SUCCESS | The event indicated by Index was signaled. |
EFI_INVALID_PARAMETER | The event indicated by Index has a notification function or Event was not a valid type |
EFI_UNSUPPORTED | The current TPL is not TPL_APPLICATION |
Definition at line 84 of file UnitTestUefiBootServicesTableLibEventTimer.c.