From nobody Wed Oct 30 22:19:18 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+104801+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+104801+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1683901394; cv=none; d=zohomail.com; s=zohoarc; b=VM8JLpLnjSX2yqJh16acig8meWC8KiuJ4x84y80HByPqCWtjQWdXZHpxUdeY2RnWSyAKQpnsRxsTjTju6uVw3HVHIe194aXIAYl0dbaZgcGUFqZT/7ik+B/BhRaxt4toif4nVKW8wkgc30fnylveZgm7JEPFP2lG4fGyCF6xaqA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1683901394; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=twjJMInV2YwaXOfSXanXTNt4UQT+6ezu6m5ryK5VW+k=; b=Hbmy4s7iRy4ek7SGwy+XYVjvPZEigk2kIn/MASJ6wNFkJXWXYuMTNdkf37uTSo3xOIICk2Psw9zp//7weUYbctItL3n6vwm5fk7mTJOOhRUVdSBV3S2wdejvcQQJKJ5TX3SvN65RgSOHNKd75QgdypP7dQO8CaapE21YtPkdrHE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+104801+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1683901394964793.1088092106119; Fri, 12 May 2023 07:23:14 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id nu1oYY1788612x0hWVTKi657; Fri, 12 May 2023 07:23:14 -0700 X-Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.groups.io with SMTP id smtpd.web10.26250.1683901393029621354 for ; Fri, 12 May 2023 07:23:13 -0700 X-Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-397-RQ9iPL0aP6G_PotkWlGduw-1; Fri, 12 May 2023 10:23:10 -0400 X-MC-Unique: RQ9iPL0aP6G_PotkWlGduw-1 X-Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 73C7585A588; Fri, 12 May 2023 14:23:10 +0000 (UTC) X-Received: from sirius.home.kraxel.org (unknown [10.39.192.22]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 260222166B26; Fri, 12 May 2023 14:23:10 +0000 (UTC) X-Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id AFFB91800850; Fri, 12 May 2023 16:23:06 +0200 (CEST) From: "Gerd Hoffmann" To: devel@edk2.groups.io Cc: Gerd Hoffmann , Jiewen Yao , Jordan Justen , Leif Lindholm , Pawel Polawski , Sami Mujawar , Oliver Steffen , Ard Biesheuvel Subject: [edk2-devel] [PATCH 2/5] ArmVirt/PlatformBootManagerLib: factor out IsVirtio() Date: Fri, 12 May 2023 16:23:03 +0200 Message-Id: <20230512142306.1323983-3-kraxel@redhat.com> In-Reply-To: <20230512142306.1323983-1-kraxel@redhat.com> References: <20230512142306.1323983-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,kraxel@redhat.com X-Gm-Message-State: aqPX9iwBdlTkHOirO4O5HjcCx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1683901394; bh=j3mGhdDai7P3oSsQflrYe7VTZ7yKChwu0pAVvoOAOAc=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=C9j094rBmfFICCqqkvETDba3x9u9e5iLraR3WW4Ss+izBJc8Qe7uHZan3oI5vo1bPOu oDQA/pROiF8iBFNlyVHtXlLFFRqyTkXMRKcH4B3lEUY0ntinR/i82sBSJ8qXNWM1jr9b9 Hz1oKKEyVVJ4qREAqTIWRBIePkR/I4tJR9Y= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1683901465924100003 Content-Type: text/plain; charset="utf-8"; x-default="true" 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 Reviewed-by: Ard Biesheuvel --- .../PlatformBootManagerLib/PlatformBm.c | 26 +++++++++++++++---- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/ArmVirtPkg/Library/PlatformBootManagerLib/PlatformBm.c b/ArmVi= rtPkg/Library/PlatformBootManagerLib/PlatformBm.c index 10c815378cd5..5eb6f0f9c14a 100644 --- a/ArmVirtPkg/Library/PlatformBootManagerLib/PlatformBm.c +++ b/ArmVirtPkg/Library/PlatformBootManagerLib/PlatformBm.c @@ -269,15 +269,16 @@ IsPciDisplay ( } =20 /** - This FILTER_FUNCTION checks if a handle corresponds to a Virtio RNG devi= ce at - the VIRTIO_DEVICE_PROTOCOL level. + This function checks if a handle corresponds to the Virtio Device ID giv= en + 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 ( } =20 return (BOOLEAN)(VirtIo->SubSystemDeviceId =3D=3D - VIRTIO_SUBSYSTEM_ENTROPY_SOURCE); + VirtIoDeviceId); +} + +/** + This FILTER_FUNCTION checks if a handle corresponds to a Virtio RNG devi= ce 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); } =20 /** --=20 2.40.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#104801): https://edk2.groups.io/g/devel/message/104801 Mute This Topic: https://groups.io/mt/98850080/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-