From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out01.mta.xmission.com (out01.mta.xmission.com [166.70.13.231]) by mx.groups.io with SMTP id smtpd.web10.1761.1588209219770407015 for ; Wed, 29 Apr 2020 18:13:39 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@bsdio.com header.s=xmission header.b=Hvt4q4lU; spf=pass (domain: bsdio.com, ip: 166.70.13.231, mailfrom: rebecca@bsdio.com) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=simple/simple; d=bsdio.com; s=xmission; h=Subject:Content-Transfer-Encoding:MIME-Version:Message-Id:Date: Cc:To:From:Sender:Reply-To:Content-Type:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=O1nSH5byp6XPAU0lScTKlrnzwZcwhe0LDyDPAmiDgV4=; b=Hvt4q4lUj5/KTF9l+ymx4J26pN c9TTomhW1uu2+np7rRbH1H66LKbq7wScwmVoMrIVDq8Or7l1jePvDDWn1QpcsdwEFkwurFLN1oWYb l7wWDBWYck7sCTSBFrTW5EOYwu0FF1jqtjR3JmNfQUoLuTxQbuBIRvIhxPbSP/6YBZpY=; Received: from in01.mta.xmission.com ([166.70.13.51]) by out01.mta.xmission.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jTxli-0006Ub-VG; Wed, 29 Apr 2020 19:13:39 -0600 Received: from mta3.zcs.xmission.com ([166.70.13.67]) by in01.mta.xmission.com with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.87) (envelope-from ) id 1jTxlh-0008Vq-Ta; Wed, 29 Apr 2020 19:13:38 -0600 Received: from localhost (localhost [127.0.0.1]) by mta3.zcs.xmission.com (Postfix) with ESMTP id C34CE1619F1; Wed, 29 Apr 2020 19:13:37 -0600 (MDT) X-Amavis-Modified: Mail body modified (using disclaimer) - mta3.zcs.xmission.com Received: from mta3.zcs.xmission.com ([127.0.0.1]) by localhost (mta3.zcs.xmission.com [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id mfmXOw-vzM51; Wed, 29 Apr 2020 19:13:37 -0600 (MDT) Received: from photon.int.bluestop.org (c-174-52-16-57.hsd1.ut.comcast.net [174.52.16.57]) (Authenticated sender: rebecca@bsdio.com) by mta3.zcs.xmission.com (Postfix) with ESMTPSA id 742F01619F4; Wed, 29 Apr 2020 19:13:37 -0600 (MDT) From: "Rebecca Cran" To: devel@edk2.groups.io Cc: Rebecca Cran , Jordan Justen , Laszlo Ersek , Ard Biesheuvel Date: Wed, 29 Apr 2020 19:13:32 -0600 Message-Id: <20200430011332.612685-1-rebecca@bsdio.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-XM-SPF: eid=1jTxlh-0008Vq-Ta;;;mid=<20200430011332.612685-1-rebecca@bsdio.com>;;;hst=in01.mta.xmission.com;;;ip=166.70.13.67;;;frm=rebecca@bsdio.com;;;spf=pass X-SA-Exim-Connect-IP: 166.70.13.67 X-SA-Exim-Mail-From: rebecca@bsdio.com X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on sa06.xmission.com X-Spam-Level: * X-Spam-Status: No, score=1.0 required=8.0 tests=ALL_TRUSTED,BAYES_50, DCC_CHECK_NEGATIVE,LotsOfNums_01 autolearn=disabled version=3.4.2 X-Spam-Report: * -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP * 0.8 BAYES_50 BODY: Bayes spam probability is 40 to 60% * [score: 0.4921] * 1.2 LotsOfNums_01 BODY: Lots of long strings of numbers * -0.0 DCC_CHECK_NEGATIVE Not listed in DCC * [sa06 1397; IP=ok Body=1 Fuz1=1] [Fuz2=1] X-Spam-DCC: XMission; sa06 1397; IP=ok Body=1 Fuz1=1 Fuz2=1 X-Spam-Combo: *;devel@edk2.groups.io X-Spam-Relay-Country: X-Spam-Timing: total 650 ms - load_scoreonly_sql: 0.04 (0.0%), signal_user_changed: 11 (1.7%), b_tie_ro: 10 (1.5%), parse: 6 (1.0%), extract_message_metadata: 26 (4.1%), get_uri_detail_list: 3.6 (0.6%), tests_pri_-1000: 33 (5.0%), tests_pri_-950: 1.48 (0.2%), tests_pri_-900: 1.11 (0.2%), tests_pri_-90: 91 (13.9%), check_bayes: 88 (13.5%), b_tokenize: 14 (2.2%), b_tok_get_all: 11 (1.7%), b_comp_prob: 3.2 (0.5%), b_tok_touch_all: 56 (8.6%), b_finish: 0.99 (0.2%), tests_pri_0: 464 (71.3%), check_dkim_signature: 1.24 (0.2%), check_dkim_adsp: 23 (3.5%), poll_dns_idle: 21 (3.2%), tests_pri_10: 2.5 (0.4%), tests_pri_500: 10 (1.6%), rewrite_mail: 0.00 (0.0%) Subject: [PATCH] OvmfPkg: Add QemuFwCfgLibNull X-Spam-Flag: No X-SA-Exim-Version: 4.2.1 (built Thu, 05 May 2016 13:38:54 -0600) X-SA-Exim-Scanned: Yes (on in01.mta.xmission.com) Content-Transfer-Encoding: quoted-printable Add a null implementation library for QemuFwCfgLib, in order to support building PciHostBridgeLib for bhyve. Signed-off-by: Rebecca Cran Cc: Jordan Justen Cc: Laszlo Ersek Cc: Ard Biesheuvel --- .../Library/QemuFwCfgLib/QemuFwCfgLibNull.inf | 37 ++++ OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgNull.c | 209 ++++++++++++++++++ 2 files changed, 246 insertions(+) create mode 100644 OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLibNull.inf create mode 100644 OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgNull.c diff --git a/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLibNull.inf b/OvmfPkg/Li= brary/QemuFwCfgLib/QemuFwCfgLibNull.inf new file mode 100644 index 0000000000..09f86c2b02 --- /dev/null +++ b/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLibNull.inf @@ -0,0 +1,37 @@ +## @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 QemuFwCfgLibNull=0D + FILE_GUID =3D B9D1A1F2-01E2-4732-982D-C7F9ED51AC6B= =0D + MODULE_TYPE =3D BASE=0D + VERSION_STRING =3D 1.0=0D + LIBRARY_CLASS =3D QemuFwCfgLib=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 + QemuFwCfgNull.c=0D +=0D +[Packages]=0D + MdePkg/MdePkg.dec=0D + MdeModulePkg/MdeModulePkg.dec=0D + OvmfPkg/OvmfPkg.dec=0D +=0D +[LibraryClasses]=0D + DebugLib=0D diff --git a/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgNull.c b/OvmfPkg/Library= /QemuFwCfgLib/QemuFwCfgNull.c new file mode 100644 index 0000000000..e2cc5f3406 --- /dev/null +++ b/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgNull.c @@ -0,0 +1,209 @@ +/** @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 +=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 FALSE;=0D +}=0D +=0D +=0D +/**=0D + Selects a firmware configuration item for reading.=0D +=0D + Following this call, any data read from this item will start from=0D + the beginning of the configuration item's data.=0D +=0D + @param[in] QemuFwCfgItem - Firmware Configuration item to read=0D +=0D +**/=0D +VOID=0D +EFIAPI=0D +QemuFwCfgSelectItem (=0D + IN FIRMWARE_CONFIG_ITEM QemuFwCfgItem=0D + )=0D +{=0D + ASSERT (FALSE);=0D +}=0D +=0D +=0D +/**=0D + Reads firmware configuration bytes into a buffer=0D +=0D + If called multiple times, then the data read will=0D + continue at the offset of the firmware configuration=0D + item where the previous read ended.=0D +=0D + @param[in] Size - Size in bytes to read=0D + @param[in] Buffer - Buffer to store data into=0D +=0D +**/=0D +VOID=0D +EFIAPI=0D +QemuFwCfgReadBytes (=0D + IN UINTN Size,=0D + IN VOID *Buffer OPTIONAL=0D + )=0D +{=0D + ASSERT (FALSE);=0D +}=0D +=0D +=0D +/**=0D + Writes firmware configuration bytes from a buffer=0D +=0D + If called multiple times, then the data written will=0D + continue at the offset of the firmware configuration=0D + item where the previous write ended.=0D +=0D + @param[in] Size - Size in bytes to write=0D + @param[in] Buffer - Buffer to read data from=0D +=0D +**/=0D +VOID=0D +EFIAPI=0D +QemuFwCfgWriteBytes (=0D + IN UINTN Size,=0D + IN VOID *Buffer=0D + )=0D +{=0D + ASSERT (FALSE);=0D +}=0D +=0D +=0D +/**=0D + Skip bytes in the firmware configuration item.=0D +=0D + Increase the offset of the firmware configuration item without transferr= ing=0D + bytes between the item and a caller-provided buffer. Subsequent read, wr= ite=0D + or skip operations will commence at the increased offset.=0D +=0D + @param[in] Size Number of bytes to skip.=0D +**/=0D +VOID=0D +EFIAPI=0D +QemuFwCfgSkipBytes (=0D + IN UINTN Size=0D + )=0D +{=0D + ASSERT (FALSE);=0D +}=0D +=0D +=0D +/**=0D + Reads a UINT8 firmware configuration value=0D +=0D + @return Value of Firmware Configuration item read=0D +=0D +**/=0D +UINT8=0D +EFIAPI=0D +QemuFwCfgRead8 (=0D + VOID=0D + )=0D +{=0D + ASSERT (FALSE);=0D + return 0;=0D +}=0D +=0D +=0D +/**=0D + Reads a UINT16 firmware configuration value=0D +=0D + @return Value of Firmware Configuration item read=0D +=0D +**/=0D +UINT16=0D +EFIAPI=0D +QemuFwCfgRead16 (=0D + VOID=0D + )=0D +{=0D + ASSERT (FALSE);=0D + return 0;=0D +}=0D +=0D +=0D +/**=0D + Reads a UINT32 firmware configuration value=0D +=0D + @return Value of Firmware Configuration item read=0D +=0D +**/=0D +UINT32=0D +EFIAPI=0D +QemuFwCfgRead32 (=0D + VOID=0D + )=0D +{=0D + ASSERT (FALSE);=0D + return 0;=0D +}=0D +=0D +=0D +/**=0D + Reads a UINT64 firmware configuration value=0D +=0D + @return Value of Firmware Configuration item read=0D +=0D +**/=0D +UINT64=0D +EFIAPI=0D +QemuFwCfgRead64 (=0D + VOID=0D + )=0D +{=0D + ASSERT (FALSE);=0D + return 0;=0D +}=0D +=0D +=0D +/**=0D + Find the configuration item corresponding to the firmware configuration = file.=0D +=0D + @param[in] Name - Name of file to look up.=0D + @param[out] Item - Configuration item corresponding to the file, to be p= assed=0D + to QemuFwCfgSelectItem ().=0D + @param[out] Size - Number of bytes in the file.=0D +=0D + @return RETURN_SUCCESS If file is found.=0D + RETURN_NOT_FOUND If file is not found.=0D + RETURN_UNSUPPORTED If firmware configuration is unavailable= .=0D +=0D +**/=0D +RETURN_STATUS=0D +EFIAPI=0D +QemuFwCfgFindFile (=0D + IN CONST CHAR8 *Name,=0D + OUT FIRMWARE_CONFIG_ITEM *Item,=0D + OUT UINTN *Size=0D + )=0D +{=0D + return RETURN_UNSUPPORTED;=0D +}=0D +=0D --=20 2.25.1