From nobody Mon Feb 9 08:57:19 2026 Delivered-To: importer@patchew.org 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+57945+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=citrix.com ARC-Seal: i=1; a=rsa-sha256; t=1587635656; cv=none; d=zohomail.com; s=zohoarc; b=OllQ/yKJbAuZOK3rNbIoGnCj4BR3mGIyoLvA7HQ7euEfrnp5VxAa1ZhW5CPjGXjdGlSgFUUUf8xq3b1zVb+bhTc1/VQ16Xdx0L3vt0QPNZkTy6fgzkMOoQW2jcOGpwCxhSpDMlgjGIDoZHIhFB/9UwxInYcfbFnr+IqGFP8/InM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1587635656; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=9w7kFFjxAyHCo4gdS3XGllZF+dTm1CWKoooadQAqc8g=; b=PlnArrUQ7PhQa1b8BzdwJFAVPlw/k4VkO+tlsi1wFUka8XbEkXigKdJtfGtGSRNI6w1ui2cosNh2ROFgnHFPuyASU2Unlnvj4wjOfE5dTTo8Dgt0NTndpMw3zbYy3qNwBLL3uNGVpxzLgSYpt66ou0OkU0KuEshg42uw11qwaj0= 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+57945+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1587635656338619.33736893416; Thu, 23 Apr 2020 02:54:16 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id 1rLBYY1788612xMre3FBjIJG; Thu, 23 Apr 2020 02:54:16 -0700 X-Received: from esa1.hc3370-68.iphmx.com (esa1.hc3370-68.iphmx.com [216.71.145.142]) by mx.groups.io with SMTP id smtpd.web11.3280.1587635655505438317 for ; Thu, 23 Apr 2020 02:54:15 -0700 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+57945+1787277+3901457@groups.io; helo=web01.groups.io; Received-SPF: None (esa1.hc3370-68.iphmx.com: no sender authenticity information available from domain of anthony.perard@citrix.com) identity=pra; client-ip=162.221.158.21; receiver=esa1.hc3370-68.iphmx.com; envelope-from="anthony.perard@citrix.com"; x-sender="anthony.perard@citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa1.hc3370-68.iphmx.com: domain of anthony.perard@citrix.com designates 162.221.158.21 as permitted sender) identity=mailfrom; client-ip=162.221.158.21; receiver=esa1.hc3370-68.iphmx.com; envelope-from="anthony.perard@citrix.com"; x-sender="anthony.perard@citrix.com"; x-conformance=sidf_compatible; x-record-type="v=spf1"; x-record-text="v=spf1 ip4:209.167.231.154 ip4:178.63.86.133 ip4:195.66.111.40/30 ip4:85.115.9.32/28 ip4:199.102.83.4 ip4:192.28.146.160 ip4:192.28.146.107 ip4:216.52.6.88 ip4:216.52.6.188 ip4:162.221.158.21 ip4:162.221.156.83 ip4:168.245.78.127 ~all" Received-SPF: None (esa1.hc3370-68.iphmx.com: no sender authenticity information available from domain of postmaster@mail.citrix.com) identity=helo; client-ip=162.221.158.21; receiver=esa1.hc3370-68.iphmx.com; envelope-from="anthony.perard@citrix.com"; x-sender="postmaster@mail.citrix.com"; x-conformance=sidf_compatible IronPort-SDR: DJplUP6AUC1SUNzfptI0nFOcVVlzGNJijTlOp53RZDOl78jB/XSLD1/+pDAD4xrF4L5oYZZOz6 VHXc0FC2fAhQa6KeJ6rPPlD17gpTRBvwzjiSiLIwc98gUYKyqnHmm1CxbX5ekiBtrx8K9e/FF+ NoiNyz4gtHQqiSbud7UrJeH6Ahr02gIsaTX8XvpAMR1CUmk2f1UDNuJ7vE5fNiCUMEXs+eflA+ 0g68EB2weD9l9OvaGWj2MC4pLrsgS2nuqPP4a1gD2f7oXtzgl6Q7A0U97CD9DY4DDBVC1v60hN 7nY= X-SBRS: 2.7 X-MesageID: 16368776 X-Ironport-Server: esa1.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.73,306,1583211600"; d="scan'208";a="16368776" From: "Anthony PERARD" To: CC: Laszlo Ersek , Ard Biesheuvel , Jordan Justen , Julien Grall , Anthony Perard Subject: [edk2-devel] [PATCH v2 3/5] OvmfPkg/PlatformDebugLibIoPort: factor out debug port detection Date: Thu, 23 Apr 2020 10:53:56 +0100 Message-ID: <20200423095358.2518197-4-anthony.perard@citrix.com> In-Reply-To: <20200423095358.2518197-1-anthony.perard@citrix.com> References: <20200423095358.2518197-1-anthony.perard@citrix.com> 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,anthony.perard@citrix.com X-Gm-Message-State: DlrMEjtfjPY9Z02pTt5ldvTcx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1587635656; bh=9w7kFFjxAyHCo4gdS3XGllZF+dTm1CWKoooadQAqc8g=; h=CC:Content-Type:Date:From:Reply-To:Subject:To; b=I5KTNoWeIpAXEWl0TQvrR2HYhvrn0uMew6gUiEPg1bCtzOPrAAUDe9EkrpDhLzrN8AY evPLDysOU8u0yigcYDuv8CJApddwDpPDti2Octon2oHPOXhFzQbxRrMpoq5xWDM2GoDyg fEy/oJTGqZtjRRdGTQ3sBhEFdcnUln55dNo= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" Factor out debug port detection in PlatformDebugLibIoPort. Signed-off-by: Anthony PERARD Reviewed-by: Laszlo Ersek Reviewed-by: Philippe Mathieu-Daude --- .../PlatformDebugLibIoPort.inf | 1 + .../PlatformRomDebugLibIoPort.inf | 1 + .../PlatformDebugLibIoPort/DebugLibDetect.h | 6 ---- .../PlatformDebugLibIoPort/DebugIoPortQemu.c | 34 +++++++++++++++++++ .../Library/PlatformDebugLibIoPort/DebugLib.c | 16 --------- 5 files changed, 36 insertions(+), 22 deletions(-) create mode 100644 OvmfPkg/Library/PlatformDebugLibIoPort/DebugIoPortQemu.c diff --git a/OvmfPkg/Library/PlatformDebugLibIoPort/PlatformDebugLibIoPort.= inf b/OvmfPkg/Library/PlatformDebugLibIoPort/PlatformDebugLibIoPort.inf index c09f312ffb1d..94ab9105077a 100644 --- a/OvmfPkg/Library/PlatformDebugLibIoPort/PlatformDebugLibIoPort.inf +++ b/OvmfPkg/Library/PlatformDebugLibIoPort/PlatformDebugLibIoPort.inf @@ -24,6 +24,7 @@ [Defines] # =20 [Sources] + DebugIoPortQemu.c DebugLib.c DebugLibDetect.c DebugLibDetect.h diff --git a/OvmfPkg/Library/PlatformDebugLibIoPort/PlatformRomDebugLibIoPo= rt.inf b/OvmfPkg/Library/PlatformDebugLibIoPort/PlatformRomDebugLibIoPort.i= nf index ab27f6327a38..8f721d249dd5 100644 --- a/OvmfPkg/Library/PlatformDebugLibIoPort/PlatformRomDebugLibIoPort.inf +++ b/OvmfPkg/Library/PlatformDebugLibIoPort/PlatformRomDebugLibIoPort.inf @@ -24,6 +24,7 @@ [Defines] # =20 [Sources] + DebugIoPortQemu.c DebugLib.c DebugLibDetect.h DebugLibDetectRom.c diff --git a/OvmfPkg/Library/PlatformDebugLibIoPort/DebugLibDetect.h b/Ovmf= Pkg/Library/PlatformDebugLibIoPort/DebugLibDetect.h index 4677c85ac3c4..6d08909dbc58 100644 --- a/OvmfPkg/Library/PlatformDebugLibIoPort/DebugLibDetect.h +++ b/OvmfPkg/Library/PlatformDebugLibIoPort/DebugLibDetect.h @@ -12,12 +12,6 @@ =20 #include =20 -// -// The constant value that is read from the debug I/O port -// -#define BOCHS_DEBUG_PORT_MAGIC 0xE9 - - /** Helper function to return whether the virtual machine has a debug I/O po= rt. PlatformDebugLibIoPortFound can call this function directly or cache the diff --git a/OvmfPkg/Library/PlatformDebugLibIoPort/DebugIoPortQemu.c b/Ovm= fPkg/Library/PlatformDebugLibIoPort/DebugIoPortQemu.c new file mode 100644 index 000000000000..bf9119807a6c --- /dev/null +++ b/OvmfPkg/Library/PlatformDebugLibIoPort/DebugIoPortQemu.c @@ -0,0 +1,34 @@ +/** @file + Detection code for QEMU debug port. + + Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.
+ Copyright (c) 2012, Red Hat, Inc.
+ Copyright (c) 2020, Citrix Systems, Inc. + SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#include +#include +#include "DebugLibDetect.h" + +// +// The constant value that is read from the debug I/O port +// +#define BOCHS_DEBUG_PORT_MAGIC 0xE9 + +/** + Return the result of detecting the debug I/O port device. + + @retval TRUE if the debug I/O port device was detected. + @retval FALSE otherwise + +**/ +BOOLEAN +EFIAPI +PlatformDebugLibIoPortDetect ( + VOID + ) +{ + return IoRead8 (PcdGet16 (PcdDebugIoPort)) =3D=3D BOCHS_DEBUG_PORT_MAGIC; +} diff --git a/OvmfPkg/Library/PlatformDebugLibIoPort/DebugLib.c b/OvmfPkg/Li= brary/PlatformDebugLibIoPort/DebugLib.c index ec2e677afd8d..dffb20822d18 100644 --- a/OvmfPkg/Library/PlatformDebugLibIoPort/DebugLib.c +++ b/OvmfPkg/Library/PlatformDebugLibIoPort/DebugLib.c @@ -359,19 +359,3 @@ DebugPrintLevelEnabled ( { return (BOOLEAN) ((ErrorLevel & PcdGet32(PcdFixedDebugPrintErrorLevel)) = !=3D 0); } - -/** - Return the result of detecting the debug I/O port device. - - @retval TRUE if the debug I/O port device was detected. - @retval FALSE otherwise - -**/ -BOOLEAN -EFIAPI -PlatformDebugLibIoPortDetect ( - VOID - ) -{ - return IoRead8 (PcdGet16 (PcdDebugIoPort)) =3D=3D BOCHS_DEBUG_PORT_MAGIC; -} --=20 Anthony PERARD -=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 (#57945): https://edk2.groups.io/g/devel/message/57945 Mute This Topic: https://groups.io/mt/73215166/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-