From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out03.mta.xmission.com (out03.mta.xmission.com [166.70.13.233]) by mx.groups.io with SMTP id smtpd.web12.6688.1588252932529514760 for ; Thu, 30 Apr 2020 06:22:12 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@bsdio.com header.s=xmission header.b=oXm4l/ME; spf=pass (domain: bsdio.com, ip: 166.70.13.233, 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=XWa9Sr30YIiT29N//50iPg1mZpxW1ChMQ4tgUj9vRwM=; b=oXm4l/MEfxDGi9Tvok9KLAnwqP Y+7dG5yIKDHbmh2yZsidmJu07dP0LZFr5bS1IdmUJ+ulcmhi77/i9s5/1uFzkV6nK14e7eDHHPWPr ETZg/z7RU6MOVNVW1Ii2PvU4x60ptEDlCg/bgRFqOIIkZn3dwvsQgetbKsL44Jp2L7os=; Received: from in02.mta.xmission.com ([166.70.13.52]) by out03.mta.xmission.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jU98k-0002Np-Uk; Thu, 30 Apr 2020 07:22:11 -0600 Received: from mta3.zcs.xmission.com ([166.70.13.67]) by in02.mta.xmission.com with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.87) (envelope-from ) id 1jU98j-00021U-F1; Thu, 30 Apr 2020 07:22:10 -0600 Received: from localhost (localhost [127.0.0.1]) by mta3.zcs.xmission.com (Postfix) with ESMTP id 3B57B1610AC; Thu, 30 Apr 2020 07:22:09 -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 PSCMyG2aLa-1; Thu, 30 Apr 2020 07:22:09 -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 01437160EE3; Thu, 30 Apr 2020 07:22:08 -0600 (MDT) From: "Rebecca Cran" To: devel@edk2.groups.io Cc: Rebecca Cran , Jordan Justen , Laszlo Ersek , Ard Biesheuvel Date: Thu, 30 Apr 2020 07:22:02 -0600 Message-Id: <20200430132202.627023-1-rebecca@bsdio.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-XM-SPF: eid=1jU98j-00021U-F1;;;mid=<20200430132202.627023-1-rebecca@bsdio.com>;;;hst=in02.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 sa07.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 * [sa07 1397; IP=ok Body=1 Fuz1=1] [Fuz2=2] X-Spam-DCC: XMission; sa07 1397; IP=ok Body=1 Fuz1=1 Fuz2=2 X-Spam-Combo: *;devel@edk2.groups.io X-Spam-Relay-Country: X-Spam-Timing: total 1198 ms - load_scoreonly_sql: 0.05 (0.0%), signal_user_changed: 11 (0.9%), b_tie_ro: 10 (0.8%), parse: 1.38 (0.1%), extract_message_metadata: 22 (1.9%), get_uri_detail_list: 3.4 (0.3%), tests_pri_-1000: 30 (2.5%), tests_pri_-950: 1.26 (0.1%), tests_pri_-900: 0.98 (0.1%), tests_pri_-90: 284 (23.7%), check_bayes: 281 (23.5%), b_tokenize: 14 (1.1%), b_tok_get_all: 133 (11.1%), b_comp_prob: 3.9 (0.3%), b_tok_touch_all: 127 (10.6%), b_finish: 0.81 (0.1%), tests_pri_0: 831 (69.4%), check_dkim_signature: 0.64 (0.1%), check_dkim_adsp: 24 (2.0%), poll_dns_idle: 22 (1.8%), tests_pri_10: 3.1 (0.3%), tests_pri_500: 9 (0.7%), rewrite_mail: 0.00 (0.0%) Subject: [PATCH v2] 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 in02.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..fc1d940721 --- /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