From nobody Sat Feb 7 06:55:36 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+57440+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+57440+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1586992286; cv=none; d=zohomail.com; s=zohoarc; b=JAhygkhZnK/leLVUhoN4Bbd6w8Iq5dzkSR6IlcjUtdm8nhG729TMrjqbU+OhgRENJDXwCLTPPqlomKyR3TKMdlDYmpF4SJpSle8UMmPnH/IXwk74KgdWaEo/1FhSCbFY7YsfcArTpdYUVyHjFrIxdqPrukltGuy6/3Mhbowjtfg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1586992286; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=0vb867D8wPUN8lUar3KLrCXUgZMw6QBGn+beIVAXClQ=; b=ISXsLRVSbwmjIGNZp9EY0aFkciymuS7QCPeBZMEk89dF6QJCeJvsVs7KQ8hIrCSC81BgFJV8IC2p1MwEGed+Yt3A5xGJ0mjrBqjE1Tb6GgyRxOj1gVyJ7uSn5hWNUuRKpu8Hf0wTV9/U+yFw8uCgnW0LbjJzbquCvMn9jTTqiHw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+57440+1787277+3901457@groups.io Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1586992286643664.6551301036296; Wed, 15 Apr 2020 16:11:26 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id qtoNYY1788612x0Hxxf9t1Yg; Wed, 15 Apr 2020 16:11:26 -0700 X-Received: from smic.int.bsdio.com (smic.int.bsdio.com [65.103.231.193]) by mx.groups.io with SMTP id smtpd.web11.797.1586992285626676599 for ; Wed, 15 Apr 2020 16:11:25 -0700 X-Received: from smic.int.bsdio.com (localhost [127.0.0.1]) by smic.int.bsdio.com (8.15.2/8.15.2) with ESMTPS id 03FNA75G060142 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Wed, 15 Apr 2020 17:10:07 -0600 (MDT) (envelope-from bcran@smic.int.bsdio.com) X-Received: (from bcran@localhost) by smic.int.bsdio.com (8.15.2/8.15.2/Submit) id 03FNA7L4059586; Wed, 15 Apr 2020 17:10:07 -0600 (MDT) (envelope-from bcran) From: "Rebecca Cran" To: devel@edk2.groups.io Cc: Jordan Justen , Laszlo Ersek , Ard Biesheuvel , Rebecca Cran Subject: [edk2-devel] [PATCH 06/13] OvmfPkg: add QemuFwCfgPeiLibNull Date: Wed, 15 Apr 2020 17:09:32 -0600 Message-Id: <06ecbeed65ce8487798a2a39a51ed45e899cc9ca.1586991816.git.rebecca@bsdio.com> In-Reply-To: References: MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: 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,rebecca@bsdio.com X-Gm-Message-State: gyjG6w975Ka22D22Ds1OOpHix1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1586992286; bh=5C4GklhRNlJDXwLFmR3e3Dqg9BX9XyxLitUfGJeuSRQ=; h=Cc:Date:From:Reply-To:Subject:To; b=G6uLQ3J8Nm5E1gWlo0NCTFe1e/dIRHz/16su8Ii1k18XeIIIo8eUDbrfA26fPK/R4S4 ImBcuvyWQuSKBBT1yNZmgrGutlJdAj0hqTWP5c5b0sJ4GElq7EkTCRBs4Ob5cdnozAydR xZZScDy3MIe1z2j77841arQ9LgB9fJzBSYg= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" Add a null PEI implementation of QemuFwCfgLib for bhyve. Signed-off-by: Rebecca Cran --- .../QemuFwCfgLibNull/QemuFwCfgPeiLibNull.inf | 36 ++++++ .../QemuFwCfgLibNull/QemuFwCfgPeiNull.c | 107 ++++++++++++++++++ 2 files changed, 143 insertions(+) create mode 100644 OvmfPkg/Library/QemuFwCfgLibNull/QemuFwCfgPeiLibNull.inf create mode 100644 OvmfPkg/Library/QemuFwCfgLibNull/QemuFwCfgPeiNull.c diff --git a/OvmfPkg/Library/QemuFwCfgLibNull/QemuFwCfgPeiLibNull.inf b/Ovm= fPkg/Library/QemuFwCfgLibNull/QemuFwCfgPeiLibNull.inf new file mode 100644 index 0000000000..e5a7683b9b --- /dev/null +++ b/OvmfPkg/Library/QemuFwCfgLibNull/QemuFwCfgPeiLibNull.inf @@ -0,0 +1,36 @@ +## @file +# +# Stateful, implicitly initialized fw_cfg library. +# +# Copyright (C) 2013, Red Hat, Inc. +# Copyright (c) 2008 - 2012, Intel Corporation. All rights reserved.
+# Copyright (c) 2017, AMD Incorporated. All rights reserved.
+# +# SPDX-License-Identifier: BSD-2-Clause-Patent +# +## + +[Defines] + INF_VERSION =3D 0x00010005 + BASE_NAME =3D QemuFwCfgPeiLibNull + FILE_GUID =3D 404DEFA4-548D-4535-9D6B-915B14D98BC2 + MODULE_TYPE =3D BASE + VERSION_STRING =3D 1.0 + LIBRARY_CLASS =3D QemuFwCfgLib|PEIM + + CONSTRUCTOR =3D QemuFwCfgInitialize + +# +# The following information is for reference only and not required by the = build tools. +# +# VALID_ARCHITECTURES =3D IA32 X64 +# + +[Sources] + QemuFwCfgLibInternal.h + QemuFwCfgLibNull.c + QemuFwCfgPeiNull.c + +[Packages] + MdePkg/MdePkg.dec + OvmfPkg/OvmfPkg.dec diff --git a/OvmfPkg/Library/QemuFwCfgLibNull/QemuFwCfgPeiNull.c b/OvmfPkg/= Library/QemuFwCfgLibNull/QemuFwCfgPeiNull.c new file mode 100644 index 0000000000..54d5eb4e19 --- /dev/null +++ b/OvmfPkg/Library/QemuFwCfgLibNull/QemuFwCfgPeiNull.c @@ -0,0 +1,107 @@ +/** @file + + Stateful and implicitly initialized fw_cfg library implementation. + + Copyright (C) 2013, Red Hat, Inc. + Copyright (c) 2011 - 2013, Intel Corporation. All rights reserved.
+ Copyright (c) 2017, Advanced Micro Devices. All rights reserved.
+ + SPDX-License-Identifier: BSD-2-Clause-Patent +**/ + +#include +#include +#include +#include +#include + +#include "QemuFwCfgLibInternal.h" + + +/** + Returns a boolean indicating if the firmware configuration interface + is available or not. + + This function may change fw_cfg state. + + @retval TRUE The interface is available + @retval FALSE The interface is not available + +**/ +BOOLEAN +EFIAPI +QemuFwCfgIsAvailable ( + VOID + ) +{ + return InternalQemuFwCfgIsAvailable (); +} + + +RETURN_STATUS +EFIAPI +QemuFwCfgInitialize ( + VOID + ) +{ + return RETURN_SUCCESS; +} + + +/** + Returns a boolean indicating if the firmware configuration interface is + available for library-internal purposes. + + This function never changes fw_cfg state. + + @retval TRUE The interface is available internally. + @retval FALSE The interface is not available internally. +**/ +BOOLEAN +InternalQemuFwCfgIsAvailable ( + VOID + ) +{ + return FALSE; +} + +/** + Returns a boolean indicating whether QEMU provides the DMA-like access m= ethod + for fw_cfg. + + @retval TRUE The DMA-like access method is available. + @retval FALSE The DMA-like access method is unavailable. +**/ +BOOLEAN +InternalQemuFwCfgDmaIsAvailable ( + VOID + ) +{ + return FALSE; +} + +/** + Transfer an array of bytes, or skip a number of bytes, using the DMA + interface. + + @param[in] Size Size in bytes to transfer or skip. + + @param[in,out] Buffer Buffer to read data into or write data from. Ign= ored, + and may be NULL, if Size is zero, or Control is + FW_CFG_DMA_CTL_SKIP. + + @param[in] Control One of the following: + FW_CFG_DMA_CTL_WRITE - write to fw_cfg from Buff= er. + FW_CFG_DMA_CTL_READ - read from fw_cfg into Buf= fer. + FW_CFG_DMA_CTL_SKIP - skip bytes in fw_cfg. +**/ +VOID +InternalQemuFwCfgDmaBytes ( + IN UINT32 Size, + IN OUT VOID *Buffer OPTIONAL, + IN UINT32 Control + ) +{ + +} + --=20 2.26.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 (#57440): https://edk2.groups.io/g/devel/message/57440 Mute This Topic: https://groups.io/mt/73045135/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-