ArmVirt/PlatformBootManagerLib: factor out IsVirtio()

IsVirtioRng() becomes just a thin wrapper for IsVirtio().
This allows to add similar thin wrappers for other virtio
devices in the future.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
This commit is contained in:
Gerd Hoffmann 2023-06-01 13:57:11 +02:00 committed by mergify[bot]
parent 6925150feb
commit a196b04926

View File

@ -269,15 +269,16 @@ IsPciDisplay (
} }
/** /**
This FILTER_FUNCTION checks if a handle corresponds to a Virtio RNG device at This function checks if a handle corresponds to the Virtio Device ID given
the VIRTIO_DEVICE_PROTOCOL level. at the VIRTIO_DEVICE_PROTOCOL level.
**/ **/
STATIC STATIC
BOOLEAN BOOLEAN
EFIAPI EFIAPI
IsVirtioRng ( IsVirtio (
IN EFI_HANDLE Handle, IN EFI_HANDLE Handle,
IN CONST CHAR16 *ReportText IN CONST CHAR16 *ReportText,
IN UINT16 VirtIoDeviceId
) )
{ {
EFI_STATUS Status; EFI_STATUS Status;
@ -293,7 +294,22 @@ IsVirtioRng (
} }
return (BOOLEAN)(VirtIo->SubSystemDeviceId == return (BOOLEAN)(VirtIo->SubSystemDeviceId ==
VIRTIO_SUBSYSTEM_ENTROPY_SOURCE); VirtIoDeviceId);
}
/**
This FILTER_FUNCTION checks if a handle corresponds to a Virtio RNG device at
the VIRTIO_DEVICE_PROTOCOL level.
**/
STATIC
BOOLEAN
EFIAPI
IsVirtioRng (
IN EFI_HANDLE Handle,
IN CONST CHAR16 *ReportText
)
{
return IsVirtio (Handle, ReportText, VIRTIO_SUBSYSTEM_ENTROPY_SOURCE);
} }
/** /**