summaryrefslogtreecommitdiffstats
path: root/ArmVirtPkg
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2023-06-01 13:57:11 +0200
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2023-06-01 12:48:45 +0000
commita196b04926e70880334fcd649837d0ac63b0bfd5 (patch)
treed122307a32f564133a943aeed49282280c983f7f /ArmVirtPkg
parent6925150febb3a76d8e40c19babcc578555ca78fe (diff)
downloadedk2-a196b04926e70880334fcd649837d0ac63b0bfd5.tar.gz
edk2-a196b04926e70880334fcd649837d0ac63b0bfd5.tar.bz2
edk2-a196b04926e70880334fcd649837d0ac63b0bfd5.zip
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>
Diffstat (limited to 'ArmVirtPkg')
-rw-r--r--ArmVirtPkg/Library/PlatformBootManagerLib/PlatformBm.c26
1 files changed, 21 insertions, 5 deletions
diff --git a/ArmVirtPkg/Library/PlatformBootManagerLib/PlatformBm.c b/ArmVirtPkg/Library/PlatformBootManagerLib/PlatformBm.c
index 10c815378c..5eb6f0f9c1 100644
--- a/ArmVirtPkg/Library/PlatformBootManagerLib/PlatformBm.c
+++ b/ArmVirtPkg/Library/PlatformBootManagerLib/PlatformBm.c
@@ -269,15 +269,16 @@ IsPciDisplay (
}
/**
- This FILTER_FUNCTION checks if a handle corresponds to a Virtio RNG device at
- the VIRTIO_DEVICE_PROTOCOL level.
+ This function checks if a handle corresponds to the Virtio Device ID given
+ at the VIRTIO_DEVICE_PROTOCOL level.
**/
STATIC
BOOLEAN
EFIAPI
-IsVirtioRng (
+IsVirtio (
IN EFI_HANDLE Handle,
- IN CONST CHAR16 *ReportText
+ IN CONST CHAR16 *ReportText,
+ IN UINT16 VirtIoDeviceId
)
{
EFI_STATUS Status;
@@ -293,7 +294,22 @@ IsVirtioRng (
}
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);
}
/**