TianoCore EDK2 master
|
#include "UnitTestUefiBootServicesTableLib.h"
Go to the source code of this file.
Functions | |
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 | UnitTestCalculateCrc32 (IN VOID *Data, IN UINTN DataSize, OUT UINT32 *Crc32) |
Implementation of miscellaneous services in the UEFI Boot Services table for use in unit tests.
Copyright (c) Microsoft Corporation SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file UnitTestUefiBootServicesTableLibMisc.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 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 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 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 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 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.