TianoCore EDK2 master
Loading...
Searching...
No Matches
UnitTestUefiBootServicesTableLib.h File Reference

Go to the source code of this file.

Functions

EFI_TPL EFIAPI UnitTestRaiseTpl (IN EFI_TPL NewTpl)
 
VOID EFIAPI UnitTestRestoreTpl (IN EFI_TPL NewTpl)
 
EFI_STATUS EFIAPI UnitTestAllocatePages (IN EFI_ALLOCATE_TYPE Type, IN EFI_MEMORY_TYPE MemoryType, IN UINTN NumberOfPages, IN OUT EFI_PHYSICAL_ADDRESS *Memory)
 
EFI_STATUS EFIAPI UnitTestFreePages (IN EFI_PHYSICAL_ADDRESS Memory, IN UINTN NumberOfPages)
 
EFI_STATUS EFIAPI UnitTestGetMemoryMap (IN OUT UINTN *MemoryMapSize, IN OUT EFI_MEMORY_DESCRIPTOR *MemoryMap, OUT UINTN *MapKey, OUT UINTN *DescriptorSize, OUT UINT32 *DescriptorVersion)
 
EFI_STATUS EFIAPI UnitTestAllocatePool (IN EFI_MEMORY_TYPE PoolType, IN UINTN Size, OUT VOID **Buffer)
 
EFI_STATUS EFIAPI UnitTestFreePool (IN VOID *Buffer)
 
EFI_STATUS EFIAPI UnitTestInternalFreePool (IN VOID *Buffer, OUT EFI_MEMORY_TYPE *PoolType OPTIONAL)
 
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)
 
EFI_STATUS EFIAPI UnitTestSetTimer (IN EFI_EVENT UserEvent, IN EFI_TIMER_DELAY Type, IN UINT64 TriggerTime)
 
EFI_STATUS EFIAPI UnitTestWaitForEvent (IN UINTN NumberOfEvents, IN EFI_EVENT *UserEvents, OUT UINTN *UserIndex)
 
EFI_STATUS EFIAPI UnitTestSignalEvent (IN EFI_EVENT UserEvent)
 
EFI_STATUS EFIAPI UnitTestCloseEvent (IN EFI_EVENT UserEvent)
 
EFI_STATUS EFIAPI UnitTestCheckEvent (IN EFI_EVENT UserEvent)
 
EFI_STATUS EFIAPI UnitTestInstallProtocolInterface (IN OUT EFI_HANDLE *UserHandle, IN EFI_GUID *Protocol, IN EFI_INTERFACE_TYPE InterfaceType, IN VOID *Interface)
 
EFI_STATUS EFIAPI UnitTestReinstallProtocolInterface (IN EFI_HANDLE UserHandle, IN EFI_GUID *Protocol, IN VOID *OldInterface, IN VOID *NewInterface)
 
EFI_STATUS EFIAPI UnitTestUninstallProtocolInterface (IN EFI_HANDLE UserHandle, IN EFI_GUID *Protocol, IN VOID *Interface)
 
EFI_STATUS EFIAPI UnitTestHandleProtocol (IN EFI_HANDLE UserHandle, IN EFI_GUID *Protocol, OUT VOID **Interface)
 
EFI_STATUS EFIAPI UnitTestRegisterProtocolNotify (IN EFI_GUID *Protocol, IN EFI_EVENT Event, OUT VOID **Registration)
 
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)
 
EFI_STATUS EFIAPI UnitTestLocateDevicePath (IN EFI_GUID *Protocol, IN OUT EFI_DEVICE_PATH_PROTOCOL **DevicePath, OUT EFI_HANDLE *Device)
 
EFI_STATUS EFIAPI UnitTestInstallConfigurationTable (IN EFI_GUID *Guid, IN VOID *Table)
 
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)
 
EFI_STATUS EFIAPI UnitTestStartImage (IN EFI_HANDLE ImageHandle, OUT UINTN *ExitDataSize, OUT CHAR16 **ExitData OPTIONAL)
 
EFI_STATUS EFIAPI UnitTestExit (IN EFI_HANDLE ImageHandle, IN EFI_STATUS Status, IN UINTN ExitDataSize, IN CHAR16 *ExitData OPTIONAL)
 
EFI_STATUS EFIAPI UnitTestUnloadImage (IN EFI_HANDLE ImageHandle)
 
EFI_STATUS EFIAPI UnitTestExitBootServices (IN EFI_HANDLE ImageHandle, IN UINTN MapKey)
 
EFI_STATUS EFIAPI UnitTestGetNextMonotonicCount (OUT UINT64 *Count)
 
EFI_STATUS EFIAPI UnitTestStall (IN UINTN Microseconds)
 
EFI_STATUS EFIAPI UnitTestSetWatchdogTimer (IN UINTN Timeout, IN UINT64 WatchdogCode, IN UINTN DataSize, IN CHAR16 *WatchdogData OPTIONAL)
 
EFI_STATUS EFIAPI UnitTestConnectController (IN EFI_HANDLE ControllerHandle, IN EFI_HANDLE *DriverImageHandle OPTIONAL, IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL, IN BOOLEAN Recursive)
 
EFI_STATUS EFIAPI UnitTestDisconnectController (IN EFI_HANDLE ControllerHandle, IN EFI_HANDLE DriverImageHandle OPTIONAL, IN EFI_HANDLE ChildHandle OPTIONAL)
 
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)
 
EFI_STATUS EFIAPI UnitTestCloseProtocol (IN EFI_HANDLE UserHandle, IN EFI_GUID *Protocol, IN EFI_HANDLE AgentHandle, IN EFI_HANDLE ControllerHandle)
 
EFI_STATUS EFIAPI UnitTestOpenProtocolInformation (IN EFI_HANDLE UserHandle, IN EFI_GUID *Protocol, OUT EFI_OPEN_PROTOCOL_INFORMATION_ENTRY **EntryBuffer, OUT UINTN *EntryCount)
 
EFI_STATUS EFIAPI UnitTestProtocolsPerHandle (IN EFI_HANDLE UserHandle, OUT EFI_GUID ***ProtocolBuffer, OUT UINTN *ProtocolBufferCount)
 
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)
 
EFI_STATUS EFIAPI UnitTestLocateProtocol (IN EFI_GUID *Protocol, IN VOID *Registration OPTIONAL, OUT VOID **Interface)
 
EFI_STATUS EFIAPI UnitTestInstallMultipleProtocolInterfaces (IN OUT EFI_HANDLE *Handle,...)
 
EFI_STATUS EFIAPI UnitTestUninstallMultipleProtocolInterfaces (IN EFI_HANDLE Handle,...)
 
EFI_STATUS EFIAPI UnitTestCalculateCrc32 (IN VOID *Data, IN UINTN DataSize, OUT UINT32 *Crc32)
 
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)
 

Detailed Description

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.

Function Documentation

◆ UnitTestAllocatePages()

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.

Parameters
TypeThe type of allocation to perform
MemoryTypeThe type of memory to turn the allocated pages into
NumberOfPagesThe number of pages to allocate
MemoryA pointer to receive the base allocated memory address
Returns
Status. On success, Memory is filled in with the base address allocated
Return values
EFI_INVALID_PARAMETERParameters violate checking rules defined in spec.
EFI_NOT_FOUNDCould not allocate pages match the requirement.
EFI_OUT_OF_RESOURCESNo enough pages to allocate.
EFI_SUCCESSPages successfully allocated.

Definition at line 31 of file UnitTestUefiBootServicesTableLibMemory.c.

◆ UnitTestAllocatePool()

EFI_STATUS EFIAPI UnitTestAllocatePool ( IN EFI_MEMORY_TYPE  PoolType,
IN UINTN  Size,
OUT VOID **  Buffer 
)

Allocate pool of a particular type.

Parameters
PoolTypeType of pool to allocate
SizeThe amount of pool to allocate
BufferThe address to return a pointer to the allocated pool
Return values
EFI_INVALID_PARAMETERPoolType not valid or Buffer is NULL
EFI_OUT_OF_RESOURCESSize exceeds max pool size or allocation failed.
EFI_SUCCESSPool successfully allocated.

Definition at line 120 of file UnitTestUefiBootServicesTableLibMemory.c.

◆ UnitTestCalculateCrc32()

EFI_STATUS EFIAPI UnitTestCalculateCrc32 ( IN VOID *  Data,
IN UINTN  DataSize,
OUT UINT32 *  Crc32 
)

Computes and returns a 32-bit CRC for a data buffer.

Parameters
[in]DataA pointer to the buffer on which the 32-bit CRC is to be computed.
[in]DataSizeThe number of bytes in the buffer Data.
[out]Crc32The 32-bit CRC that was computed for the data buffer specified by Data and DataSize.
Return values
EFI_SUCCESSThe 32-bit CRC was computed for the data buffer and returned in Crc32.
EFI_INVALID_PARAMETERData is NULL.
EFI_INVALID_PARAMETERCrc32 is NULL.
EFI_INVALID_PARAMETERDataSize is 0.

Definition at line 185 of file UnitTestUefiBootServicesTableLibMisc.c.

◆ UnitTestCheckEvent()

EFI_STATUS EFIAPI UnitTestCheckEvent ( IN EFI_EVENT  UserEvent)

Check the status of an event.

Parameters
UserEventThe event to check
Return values
EFI_SUCCESSThe event is in the signaled state
EFI_NOT_READYThe event is not in the signaled state
EFI_INVALID_PARAMETEREvent is of type EVT_NOTIFY_SIGNAL

Definition at line 141 of file UnitTestUefiBootServicesTableLibEventTimer.c.

◆ UnitTestCloseEvent()

EFI_STATUS EFIAPI UnitTestCloseEvent ( IN EFI_EVENT  UserEvent)

Closes an event and frees the event structure.

Parameters
UserEventEvent to close
Return values
EFI_INVALID_PARAMETERParameters are not valid.
EFI_SUCCESSThe event has been closed

Definition at line 122 of file UnitTestUefiBootServicesTableLibEventTimer.c.

◆ UnitTestCloseProtocol()

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().

Parameters
UserHandleThe handle for the protocol interface that was previously opened with OpenProtocol(), and is now being closed.
ProtocolThe published unique identifier of the protocol. It is the caller's responsibility to pass in a valid GUID.
AgentHandleThe handle of the agent that is closing the protocol interface.
ControllerHandleIf 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.
Return values
EFI_SUCCESSThe protocol instance was closed.
EFI_INVALID_PARAMETERHandle, AgentHandle or ControllerHandle is not a valid EFI_HANDLE.
EFI_NOT_FOUNDCan not find the specified protocol or AgentHandle.

Definition at line 1370 of file UnitTestUefiBootServicesTableLibProtocol.c.

◆ UnitTestConnectController()

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.

Parameters
ControllerHandleThe handle of the controller to which driver(s) are to be connected.
DriverImageHandleA pointer to an ordered list handles that support the EFI_DRIVER_BINDING_PROTOCOL.
RemainingDevicePathA pointer to the device path that specifies a child of the controller specified by ControllerHandle.
RecursiveIf 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.
Return values
EFI_SUCCESS1) 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_PARAMETERControllerHandle is NULL.
EFI_NOT_FOUND1) There are no EFI_DRIVER_BINDING_PROTOCOL instances present in the system. 2) No drivers were connected to ControllerHandle.
EFI_SECURITY_VIOLATIONThe 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.

◆ UnitTestCreateEvent()

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.

Parameters
TypeThe type of event to create and its mode and attributes
NotifyTplThe task priority level of event notifications
NotifyFunctionPointer to the events notification function
NotifyContextPointer to the notification functions context; corresponds to parameter "Context" in the notification function
EventPointer to the newly created event if the call succeeds; undefined otherwise
Return values
EFI_SUCCESSThe event structure was created
EFI_INVALID_PARAMETEROne of the parameters has an invalid value
EFI_OUT_OF_RESOURCESThe event could not be allocated

Creates an event.

Parameters
TypeThe type of event to create and its mode and attributes
NotifyTplThe task priority level of event notifications
NotifyFunctionPointer to the events notification function
NotifyContextPointer to the notification functions context corresponds to parameter "Context" in the notification function
EventPointer to the newly created event if the call succeeds undefined otherwise
Return values
EFI_SUCCESSThe event structure was created
EFI_INVALID_PARAMETEROne of the parameters has an invalid value
EFI_OUT_OF_RESOURCESThe event could not be allocated

Definition at line 31 of file UnitTestUefiBootServicesTableLibEventTimer.c.

◆ UnitTestCreateEventEx()

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.

Parameters
TypeThe type of event to create and its mode and attributes
NotifyTplThe task priority level of event notifications
NotifyFunctionPointer to the events notification function
NotifyContextPointer to the notification functions context; corresponds to parameter "Context" in the notification function
EventGroupGUID for EventGroup if NULL act the same as gBS->CreateEvent().
EventPointer to the newly created event if the call succeeds; undefined otherwise
Return values
EFI_SUCCESSThe event structure was created
EFI_INVALID_PARAMETEROne of the parameters has an invalid value
EFI_OUT_OF_RESOURCESThe event could not be allocated

Creates an event in a group.

Parameters
TypeThe type of event to create and its mode and attributes
NotifyTplThe task priority level of event notifications
NotifyFunctionPointer to the events notification function
NotifyContextPointer to the notification functions context corresponds to parameter "Context" in the notification function
EventGroupGUID for EventGroup if NULL act the same as gBS->CreateEvent().
EventPointer to the newly created event if the call succeeds undefined otherwise
Return values
EFI_SUCCESSThe event structure was created
EFI_INVALID_PARAMETEROne of the parameters has an invalid value
EFI_OUT_OF_RESOURCESThe event could not be allocated

Definition at line 170 of file UnitTestUefiBootServicesTableLibEventTimer.c.

◆ UnitTestDisconnectController()

EFI_STATUS EFIAPI UnitTestDisconnectController ( IN EFI_HANDLE  ControllerHandle,
IN EFI_HANDLE DriverImageHandle  OPTIONAL,
IN EFI_HANDLE ChildHandle  OPTIONAL 
)

Disconnects a controller from a driver

Parameters
ControllerHandleControllerHandle The handle of the controller from which driver(s) are to be disconnected.
DriverImageHandleDriverImageHandle The driver to disconnect from ControllerHandle.
ChildHandleChildHandle The handle of the child to destroy.
Return values
EFI_SUCCESSOne or more drivers were disconnected from the controller.
EFI_SUCCESSOn entry, no drivers are managing ControllerHandle.
EFI_SUCCESSDriverImageHandle is not NULL, and on entry DriverImageHandle is not managing ControllerHandle.
EFI_INVALID_PARAMETERControllerHandle is NULL.
EFI_INVALID_PARAMETERDriverImageHandle is not NULL, and it is not a valid EFI_HANDLE.
EFI_INVALID_PARAMETERChildHandle is not NULL, and it is not a valid EFI_HANDLE.
EFI_OUT_OF_RESOURCESThere are not enough resources available to disconnect any drivers from ControllerHandle.
EFI_DEVICE_ERRORThe controller could not be disconnected because of a device error.

Definition at line 159 of file UnitTestUefiBootServicesTableLibMisc.c.

◆ UnitTestExit()

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.

Parameters
ImageHandleHandle that identifies the image. This parameter is passed to the image on entry.
StatusThe image's exit code.
ExitDataSizeThe size, in bytes, of ExitData. Ignored if ExitStatus is EFI_SUCCESS.
ExitDataPointer 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.
Return values
EFI_INVALID_PARAMETERImage handle is NULL or it is not current image.
EFI_SUCCESSSuccessfully terminates the currently loaded EFI image.
EFI_ACCESS_DENIEDShould never reach there.
EFI_OUT_OF_RESOURCESCould not allocate pool

Definition at line 114 of file UnitTestUefiBootServicesTableLibImage.c.

◆ UnitTestExitBootServices()

EFI_STATUS EFIAPI UnitTestExitBootServices ( IN EFI_HANDLE  ImageHandle,
IN UINTN  MapKey 
)

Terminates all boot services.

Parameters
ImageHandleHandle that identifies the exiting image.
MapKeyKey to the latest memory map.
Return values
EFI_SUCCESSBoot Services terminated
EFI_INVALID_PARAMETERMapKey is incorrect.

Definition at line 157 of file UnitTestUefiBootServicesTableLibImage.c.

◆ UnitTestFreePages()

EFI_STATUS EFIAPI UnitTestFreePages ( IN EFI_PHYSICAL_ADDRESS  Memory,
IN UINTN  NumberOfPages 
)

Frees previous allocated pages.

Parameters
MemoryBase address of memory being freed
NumberOfPagesThe number of pages to free
Return values
EFI_NOT_FOUNDCould not find the entry that covers the range
EFI_INVALID_PARAMETERAddress not aligned
Returns
EFI_SUCCESS -Pages successfully freed.

Definition at line 54 of file UnitTestUefiBootServicesTableLibMemory.c.

◆ UnitTestFreePool()

EFI_STATUS EFIAPI UnitTestFreePool ( IN VOID *  Buffer)

Frees pool.

Parameters
BufferThe allocated pool entry to free
Return values
EFI_INVALID_PARAMETERBuffer is not a valid value.
EFI_SUCCESSPool successfully freed.

Definition at line 140 of file UnitTestUefiBootServicesTableLibMemory.c.

◆ UnitTestGetMemoryMap()

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.

Parameters
MemoryMapSizeA 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.
MemoryMapA pointer to the buffer in which firmware places the current memory map.
MapKeyA pointer to the location in which firmware returns the key for the current memory map.
DescriptorSizeA pointer to the location in which firmware returns the size, in bytes, of an individual EFI_MEMORY_DESCRIPTOR.
DescriptorVersionA pointer to the location in which firmware returns the version number associated with the EFI_MEMORY_DESCRIPTOR.
Return values
EFI_SUCCESSThe memory map was returned in the MemoryMap buffer.
EFI_BUFFER_TOO_SMALLThe MemoryMap buffer was too small. The current buffer size needed to hold the memory map is returned in MemoryMapSize.
EFI_INVALID_PARAMETEROne of the parameters has an invalid value.

Definition at line 94 of file UnitTestUefiBootServicesTableLibMemory.c.

◆ UnitTestGetNextMonotonicCount()

EFI_STATUS EFIAPI UnitTestGetNextMonotonicCount ( OUT UINT64 *  Count)

Returns a monotonically increasing count for the platform.

Parameters
[out]CountThe pointer to returned value.
Return values
EFI_SUCCESSThe next monotonic count was returned.
EFI_INVALID_PARAMETERCount is NULL.
EFI_DEVICE_ERRORThe device is not functioning properly.

Definition at line 23 of file UnitTestUefiBootServicesTableLibMisc.c.

◆ UnitTestHandleProtocol()

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.

Parameters
UserHandleThe handle being queried.
ProtocolThe published unique identifier of the protocol.
InterfaceSupplies the address where a pointer to the corresponding Protocol Interface is returned.
Returns
The requested protocol interface for the handle

Definition at line 841 of file UnitTestUefiBootServicesTableLibProtocol.c.

◆ UnitTestInstallConfigurationTable()

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.

Parameters
GuidPointer to the GUID for the entry to add, update, or remove
TablePointer to the configuration table for the entry to add, update, or remove, may be NULL.
Returns
EFI_SUCCESS Guid, Table pair added, updated, or removed.
EFI_INVALID_PARAMETER Input GUID not valid.
EFI_NOT_FOUND Attempted to delete non-existant entry
EFI_OUT_OF_RESOURCES Not enough memory available

Definition at line 1086 of file UnitTestUefiBootServicesTableLibProtocol.c.

◆ UnitTestInstallMultipleProtocolInterfaces()

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.

Parameters
HandleThe 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.
Return values
EFI_SUCCESSAll the protocol interface was installed.
EFI_OUT_OF_RESOURCESThere was not enough memory in pool to install all the protocols.
EFI_ALREADY_STARTEDA Device Path Protocol instance was passed in that is already present in the handle database.
EFI_INVALID_PARAMETERHandle is NULL.
EFI_INVALID_PARAMETERProtocol is already installed on the handle specified by Handle.

Definition at line 1575 of file UnitTestUefiBootServicesTableLibProtocol.c.

◆ UnitTestInstallProtocolInterface()

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

Parameters
UserHandleThe handle to install the protocol handler on, or NULL if a new handle is to be allocated
ProtocolThe protocol to add to the handle
InterfaceTypeIndicates whether Interface is supplied in native form.
InterfaceThe interface for the protocol being added
Returns
Status code

Definition at line 683 of file UnitTestUefiBootServicesTableLibProtocol.c.

◆ UnitTestInternalFreePool()

EFI_STATUS EFIAPI UnitTestInternalFreePool ( IN VOID *  Buffer,
OUT EFI_MEMORY_TYPE *PoolType  OPTIONAL 
)

Frees pool.

Parameters
BufferThe allocated pool entry to free
PoolTypePointer to pool type
Return values
EFI_INVALID_PARAMETERBuffer is not a valid value.
EFI_SUCCESSPool successfully freed.

◆ UnitTestLoadImage()

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.

Parameters
BootPolicyIf TRUE, indicates that the request originates from the boot manager, and that the boot manager is attempting to load FilePath as a boot selection.
ParentImageHandleThe caller's image handle.
FilePathThe specific file path from which the image is loaded.
SourceBufferIf not NULL, a pointer to the memory location containing a copy of the image to be loaded.
SourceSizeThe size in bytes of SourceBuffer.
ImageHandlePointer to the returned image handle that is created when the image is successfully loaded.
Return values
EFI_SUCCESSThe image was loaded into memory.
EFI_NOT_FOUNDThe FilePath was not found.
EFI_INVALID_PARAMETEROne of the parameters has an invalid value.
EFI_UNSUPPORTEDThe image type is not supported, or the device path cannot be parsed to locate the proper protocol for loading the file.
EFI_OUT_OF_RESOURCESImage was not loaded due to insufficient resources.
EFI_LOAD_ERRORImage was not loaded because the image format was corrupt or not understood.
EFI_DEVICE_ERRORImage was not loaded because the device returned a read error.
EFI_ACCESS_DENIEDImage was not loaded because the platform policy prohibits the image from being loaded. NULL is returned in *ImageHandle.
EFI_SECURITY_VIOLATIONImage 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.

◆ UnitTestLocateDevicePath()

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.

Parameters
ProtocolThe protocol to search for.
DevicePathOn 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.
DeviceA pointer to the returned device handle.
Return values
EFI_SUCCESSThe resulting handle was returned.
EFI_NOT_FOUNDNo handles matched the search.
EFI_INVALID_PARAMETEROne of the parameters has an invalid value.

Definition at line 1060 of file UnitTestUefiBootServicesTableLibProtocol.c.

◆ UnitTestLocateHandle()

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.

Parameters
SearchTypeThe type of search to perform to locate the handles
ProtocolThe protocol to search for
SearchKeyDependant on SearchType
BufferSizeOn input the size of Buffer. On output the size of data returned.
BufferThe buffer to return the results in
Return values
EFI_BUFFER_TOO_SMALLBuffer too small, required buffer size is returned in BufferSize.
EFI_INVALID_PARAMETERInvalid parameter
EFI_SUCCESSSuccessfully found the requested handle(s) and returns them in Buffer.

Definition at line 901 of file UnitTestUefiBootServicesTableLibProtocol.c.

◆ UnitTestLocateHandleBuffer()

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.

Parameters
SearchTypeSpecifies which handle(s) are to be returned.
ProtocolProvides the protocol to search by. This parameter is only valid for SearchType ByProtocol.
SearchKeySupplies the search key depending on the SearchType.
NumberHandlesThe number of handles returned in Buffer.
BufferA pointer to the buffer to return the requested array of handles that support Protocol.
Return values
EFI_SUCCESSThe result array of handles was returned.
EFI_NOT_FOUNDNo handles match the search.
EFI_OUT_OF_RESOURCESThere is not enough pool memory to store the matching results.
EFI_INVALID_PARAMETEROne or more parameters are not valid.

Definition at line 1461 of file UnitTestUefiBootServicesTableLibProtocol.c.

◆ UnitTestLocateProtocol()

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.

Parameters
ProtocolThe protocol to search for
RegistrationOptional Registration Key returned from RegisterProtocolNotify()
InterfaceReturn the Protocol interface (instance).
Return values
EFI_SUCCESSIf a valid Interface is returned
EFI_INVALID_PARAMETERInvalid parameter
EFI_NOT_FOUNDProtocol interface not found

Definition at line 1543 of file UnitTestUefiBootServicesTableLibProtocol.c.

◆ UnitTestOpenProtocol()

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.

Parameters
UserHandleThe handle to obtain the protocol interface on
ProtocolThe ID of the protocol
InterfaceThe location to return the protocol interface
ImageHandleThe handle of the Image that is opening the protocol interface specified by Protocol and Interface.
ControllerHandleThe controller handle that is requiring this interface.
AttributesThe open mode of the protocol interface specified by Handle and Protocol.
Return values
EFI_INVALID_PARAMETERProtocol is NULL.
EFI_SUCCESSGet the protocol interface.

Definition at line 1116 of file UnitTestUefiBootServicesTableLibProtocol.c.

◆ UnitTestOpenProtocolInformation()

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

Parameters
UserHandleThe handle to close the protocol interface on
ProtocolThe ID of the protocol
EntryBufferA pointer to a buffer of open protocol information in the form of EFI_OPEN_PROTOCOL_INFORMATION_ENTRY structures.
EntryCountNumber of EntryBuffer entries

Definition at line 1393 of file UnitTestUefiBootServicesTableLibProtocol.c.

◆ UnitTestProtocolsPerHandle()

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.

Parameters
UserHandleThe handle from which to retrieve the list of protocol interface GUIDs.
ProtocolBufferA pointer to the list of protocol interface GUID pointers that are installed on Handle.
ProtocolBufferCountA pointer to the number of GUID pointers present in ProtocolBuffer.
Return values
EFI_SUCCESSThe list of protocol interface GUIDs installed on Handle was returned in ProtocolBuffer. The number of protocol interface GUIDs was returned in ProtocolBufferCount.
EFI_INVALID_PARAMETERHandle is NULL.
EFI_INVALID_PARAMETERHandle is not a valid EFI_HANDLE.
EFI_INVALID_PARAMETERProtocolBuffer is NULL.
EFI_INVALID_PARAMETERProtocolBufferCount is NULL.
EFI_OUT_OF_RESOURCESThere is not enough pool memory to store the results.

Definition at line 1428 of file UnitTestUefiBootServicesTableLibProtocol.c.

◆ UnitTestRaiseTpl()

EFI_TPL EFIAPI UnitTestRaiseTpl ( IN EFI_TPL  NewTpl)

Raise the task priority level to the new level. High level is implemented by disabling processor interrupts.

Parameters
NewTplNew task priority level
Returns
The previous task priority level

Definition at line 22 of file UnitTestUefiBootServicesTableLibTpl.c.

◆ UnitTestRegisterProtocolNotify()

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.

Parameters
ProtocolThe requested protocol to add the notify registration
EventThe event to signal
RegistrationReturns the registration record
Return values
EFI_INVALID_PARAMETERInvalid parameter
EFI_SUCCESSSuccessfully returned the registration record that has been added

Definition at line 872 of file UnitTestUefiBootServicesTableLibProtocol.c.

◆ UnitTestReinstallProtocolInterface()

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.

Parameters
UserHandleHandle on which the interface is to be reinstalled
ProtocolThe numeric ID of the interface
OldInterfaceA pointer to the old interface
NewInterfaceA pointer to the new interface
Return values
EFI_SUCCESSThe protocol interface was installed
EFI_NOT_FOUNDThe OldInterface on the handle was not found
EFI_INVALID_PARAMETEROne of the parameters has an invalid value

Definition at line 715 of file UnitTestUefiBootServicesTableLibProtocol.c.

◆ UnitTestRestoreTpl()

VOID EFIAPI UnitTestRestoreTpl ( IN EFI_TPL  NewTpl)

Lowers the task priority to the previous value. If the new priority unmasks events at a higher priority, they are dispatched.

Parameters
NewTplNew, lower, task priority

Definition at line 38 of file UnitTestUefiBootServicesTableLibTpl.c.

◆ UnitTestSetTimer()

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.

Parameters
UserEventThe timer event that is to be signaled at the specified time
TypeThe type of time that is specified in TriggerTime
TriggerTimeThe number of 100ns units until the timer expires
Return values
EFI_SUCCESSThe event has been set to be signaled at the requested time
EFI_INVALID_PARAMETEREvent or Type is not valid

Definition at line 59 of file UnitTestUefiBootServicesTableLibEventTimer.c.

◆ UnitTestSetWatchdogTimer()

EFI_STATUS EFIAPI UnitTestSetWatchdogTimer ( IN UINTN  Timeout,
IN UINT64  WatchdogCode,
IN UINTN  DataSize,
IN CHAR16 *WatchdogData  OPTIONAL 
)

Sets the system's watchdog timer.

Parameters
TimeoutThe number of seconds to set the watchdog timer to. A value of zero disables the timer.
WatchdogCodeThe 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.
DataSizeThe size, in bytes, of WatchdogData.
WatchdogDataA 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.
Returns
EFI_SUCCESS Timeout has been set
EFI_NOT_AVAILABLE_YET WatchdogTimer is not available yet
EFI_UNSUPPORTED System does not have a timer (currently not used)
EFI_DEVICE_ERROR Could not complete due to hardware error

Definition at line 77 of file UnitTestUefiBootServicesTableLibMisc.c.

◆ UnitTestSignalEvent()

EFI_STATUS EFIAPI UnitTestSignalEvent ( IN EFI_EVENT  UserEvent)

Signals the event. Queues the event to be notified if needed.

Parameters
UserEventThe event to signal .
Return values
EFI_INVALID_PARAMETERParameters are not valid.
EFI_SUCCESSThe event was signaled.

Definition at line 104 of file UnitTestUefiBootServicesTableLibEventTimer.c.

◆ UnitTestStall()

EFI_STATUS EFIAPI UnitTestStall ( IN UINTN  Microseconds)

Introduces a fine-grained stall.

Parameters
MicrosecondsThe number of microseconds to stall execution.
Return values
EFI_SUCCESSExecution was stalled for at least the requested amount of microseconds.
EFI_NOT_AVAILABLE_YETgMetronome is not available yet

Definition at line 46 of file UnitTestUefiBootServicesTableLibMisc.c.

◆ UnitTestStartImage()

EFI_STATUS EFIAPI UnitTestStartImage ( IN EFI_HANDLE  ImageHandle,
OUT UINTN ExitDataSize,
OUT CHAR16 **ExitData  OPTIONAL 
)

Transfer control to a loaded image's entry point.

Parameters
ImageHandleHandle of image to be started.
ExitDataSizePointer of the size to ExitData
ExitDataPointer 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.
Return values
EFI_INVALID_PARAMETERInvalid parameter
EFI_OUT_OF_RESOURCESNo enough buffer to allocate
EFI_SECURITY_VIOLATIONThe current platform policy specifies that the image should not be started.
EFI_SUCCESSSuccessfully transfer control to the image's entry point.

Definition at line 80 of file UnitTestUefiBootServicesTableLibImage.c.

◆ UnitTestUninstallMultipleProtocolInterfaces()

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.

Parameters
HandleThe 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.
Returns
Status code

Definition at line 1599 of file UnitTestUefiBootServicesTableLibProtocol.c.

◆ UnitTestUninstallProtocolInterface()

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.

Parameters
UserHandleThe handle to remove the protocol handler from
ProtocolThe protocol, of protocol:interface, to remove
InterfaceThe interface, of protocol:interface, to remove
Return values
EFI_INVALID_PARAMETERProtocol is NULL.
EFI_SUCCESSProtocol interface successfully uninstalled.

Definition at line 740 of file UnitTestUefiBootServicesTableLibProtocol.c.

◆ UnitTestUnloadImage()

EFI_STATUS EFIAPI UnitTestUnloadImage ( IN EFI_HANDLE  ImageHandle)

Unloads an image.

Parameters
ImageHandleHandle that identifies the image to be unloaded.
Return values
EFI_SUCCESSThe image has been unloaded.
EFI_UNSUPPORTEDThe image has been started, and does not support unload.
EFI_INVALID_PARAMPETERImageHandle is not a valid image handle.

Definition at line 138 of file UnitTestUefiBootServicesTableLibImage.c.

◆ UnitTestWaitForEvent()

EFI_STATUS EFIAPI UnitTestWaitForEvent ( IN UINTN  NumberOfEvents,
IN EFI_EVENT UserEvents,
OUT UINTN UserIndex 
)

Stops execution until an event is signaled.

Parameters
NumberOfEventsThe number of events in the UserEvents array
UserEventsAn array of EFI_EVENT
UserIndexPointer to the index of the event which satisfied the wait condition
Return values
EFI_SUCCESSThe event indicated by Index was signaled.
EFI_INVALID_PARAMETERThe event indicated by Index has a notification function or Event was not a valid type
EFI_UNSUPPORTEDThe current TPL is not TPL_APPLICATION

Definition at line 84 of file UnitTestUefiBootServicesTableLibEventTimer.c.