From mboxrd@z Thu Jan 1 00:00:00 1970 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 Authentication-Results: mx.groups.io; dkim=missing; spf=none, err=permanent DNS error (domain: smic.int.bsdio.com, ip: 65.103.231.193, mailfrom: bcran@smic.int.bsdio.com) 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) 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: [PATCH 06/13] OvmfPkg: add QemuFwCfgPeiLibNull Date: Wed, 15 Apr 2020 17:09:32 -0600 Message-Id: <06ecbeed65ce8487798a2a39a51ed45e899cc9ca.1586991816.git.rebecca@bsdio.com> X-Mailer: git-send-email 2.26.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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=0D +#=0D +# Stateful, implicitly initialized fw_cfg library.=0D +#=0D +# Copyright (C) 2013, Red Hat, Inc.=0D +# Copyright (c) 2008 - 2012, Intel Corporation. All rights reserved.
= =0D +# Copyright (c) 2017, AMD Incorporated. All rights reserved.
=0D +#=0D +# SPDX-License-Identifier: BSD-2-Clause-Patent=0D +#=0D +##=0D +=0D +[Defines]=0D + INF_VERSION =3D 0x00010005=0D + BASE_NAME =3D QemuFwCfgPeiLibNull=0D + FILE_GUID =3D 404DEFA4-548D-4535-9D6B-915B14D98BC2= =0D + MODULE_TYPE =3D BASE=0D + VERSION_STRING =3D 1.0=0D + LIBRARY_CLASS =3D QemuFwCfgLib|PEIM=0D +=0D + CONSTRUCTOR =3D QemuFwCfgInitialize=0D +=0D +#=0D +# The following information is for reference only and not required by the = build tools.=0D +#=0D +# VALID_ARCHITECTURES =3D IA32 X64=0D +#=0D +=0D +[Sources]=0D + QemuFwCfgLibInternal.h=0D + QemuFwCfgLibNull.c=0D + QemuFwCfgPeiNull.c=0D +=0D +[Packages]=0D + MdePkg/MdePkg.dec=0D + OvmfPkg/OvmfPkg.dec=0D 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=0D +=0D + Stateful and implicitly initialized fw_cfg library implementation.=0D +=0D + Copyright (C) 2013, Red Hat, Inc.=0D + Copyright (c) 2011 - 2013, Intel Corporation. All rights reserved.
=0D + Copyright (c) 2017, Advanced Micro Devices. All rights reserved.
=0D +=0D + SPDX-License-Identifier: BSD-2-Clause-Patent=0D +**/=0D +=0D +#include =0D +#include =0D +#include =0D +#include =0D +#include =0D +=0D +#include "QemuFwCfgLibInternal.h"=0D +=0D +=0D +/**=0D + Returns a boolean indicating if the firmware configuration interface=0D + is available or not.=0D +=0D + This function may change fw_cfg state.=0D +=0D + @retval TRUE The interface is available=0D + @retval FALSE The interface is not available=0D +=0D +**/=0D +BOOLEAN=0D +EFIAPI=0D +QemuFwCfgIsAvailable (=0D + VOID=0D + )=0D +{=0D + return InternalQemuFwCfgIsAvailable ();=0D +}=0D +=0D +=0D +RETURN_STATUS=0D +EFIAPI=0D +QemuFwCfgInitialize (=0D + VOID=0D + )=0D +{=0D + return RETURN_SUCCESS;=0D +}=0D +=0D +=0D +/**=0D + Returns a boolean indicating if the firmware configuration interface is= =0D + available for library-internal purposes.=0D +=0D + This function never changes fw_cfg state.=0D +=0D + @retval TRUE The interface is available internally.=0D + @retval FALSE The interface is not available internally.=0D +**/=0D +BOOLEAN=0D +InternalQemuFwCfgIsAvailable (=0D + VOID=0D + )=0D +{=0D + return FALSE;=0D +}=0D +=0D +/**=0D + Returns a boolean indicating whether QEMU provides the DMA-like access m= ethod=0D + for fw_cfg.=0D +=0D + @retval TRUE The DMA-like access method is available.=0D + @retval FALSE The DMA-like access method is unavailable.=0D +**/=0D +BOOLEAN=0D +InternalQemuFwCfgDmaIsAvailable (=0D + VOID=0D + )=0D +{=0D + return FALSE;=0D +}=0D +=0D +/**=0D + Transfer an array of bytes, or skip a number of bytes, using the DMA=0D + interface.=0D +=0D + @param[in] Size Size in bytes to transfer or skip.=0D +=0D + @param[in,out] Buffer Buffer to read data into or write data from. Ign= ored,=0D + and may be NULL, if Size is zero, or Control is= =0D + FW_CFG_DMA_CTL_SKIP.=0D +=0D + @param[in] Control One of the following:=0D + FW_CFG_DMA_CTL_WRITE - write to fw_cfg from Buff= er.=0D + FW_CFG_DMA_CTL_READ - read from fw_cfg into Buf= fer.=0D + FW_CFG_DMA_CTL_SKIP - skip bytes in fw_cfg.=0D +**/=0D +VOID=0D +InternalQemuFwCfgDmaBytes (=0D + IN UINT32 Size,=0D + IN OUT VOID *Buffer OPTIONAL,=0D + IN UINT32 Control=0D + )=0D +{=0D +=0D +}=0D +=0D --=20 2.26.1