From patchwork Fri Dec 30 08:55:53 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Xu X-Patchwork-Id: 709674 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3tqgTG0Whnz9ssP for ; Fri, 30 Dec 2016 20:02:10 +1100 (AEDT) Received: from localhost ([::1]:38963 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cMt4h-0004TM-Us for incoming@patchwork.ozlabs.org; Fri, 30 Dec 2016 04:02:07 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34413) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cMsyz-0008F0-RD for qemu-devel@nongnu.org; Fri, 30 Dec 2016 03:56:14 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cMsyz-0008BS-5Z for qemu-devel@nongnu.org; Fri, 30 Dec 2016 03:56:13 -0500 Received: from mx1.redhat.com ([209.132.183.28]:33132) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cMsyy-0008BJ-W8 for qemu-devel@nongnu.org; Fri, 30 Dec 2016 03:56:13 -0500 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0EC27C05678F; Fri, 30 Dec 2016 08:56:12 +0000 (UTC) Received: from pxdev.xzpeter.org (vpn1-4-51.pek2.redhat.com [10.72.4.51]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id uBU8u2Lr011949; Fri, 30 Dec 2016 03:56:08 -0500 From: Peter Xu To: qemu-devel@nongnu.org, kvm@vger.kernel.org Date: Fri, 30 Dec 2016 16:55:53 +0800 Message-Id: <1483088160-6714-2-git-send-email-peterx@redhat.com> In-Reply-To: <1483088160-6714-1-git-send-email-peterx@redhat.com> References: <1483088160-6714-1-git-send-email-peterx@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Fri, 30 Dec 2016 08:56:12 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [kvm-unit-tests PATCH 1/8] pci: introduce pci_intx_line() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Andrew Jones , =?UTF-8?q?Radim=20Kr=C4=8Dm=C3=A1=C5=99?= , peterx@redhat.com, agordeev@redhat.com, Jan Kiszka , Paolo Bonzini Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" To fetch INTx irq line number. Signed-off-by: Peter Xu --- lib/pci.c | 5 +++++ lib/pci.h | 1 + 2 files changed, 6 insertions(+) diff --git a/lib/pci.c b/lib/pci.c index 6416191..a7cfacb 100644 --- a/lib/pci.c +++ b/lib/pci.c @@ -327,6 +327,11 @@ void pci_scan_bars(struct pci_dev *dev) } } +uint8_t pci_intx_line(struct pci_dev *dev) +{ + return pci_config_readb(dev->bdf, PCI_INTERRUPT_LINE); +} + void pci_enable_defaults(struct pci_dev *dev) { pci_scan_bars(dev); diff --git a/lib/pci.h b/lib/pci.h index e71a05d..df86951 100644 --- a/lib/pci.h +++ b/lib/pci.h @@ -64,6 +64,7 @@ extern bool pci_bar_is_memory(struct pci_dev *dev, int bar_num); extern bool pci_bar_is_valid(struct pci_dev *dev, int bar_num); extern void pci_bar_print(struct pci_dev *dev, int bar_num); extern void pci_dev_print_id(pcidevaddr_t dev); +extern uint8_t pci_intx_line(struct pci_dev *dev); extern int pci_testdev(void);