From: Andrew Jones Subject: Re: [PATCH kvm-unit-tests 12/17] pci: add bdf helpers Date: Fri, 4 Nov 2016 18:51:00 +0100 Message-ID: <20161104175100.obhb535arud5absu@kamzik.brq.redhat.com> References: <1477468040-21034-1-git-send-email-peterx@redhat.com> <1477468040-21034-13-git-send-email-peterx@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: kvm@vger.kernel.org, rkrcmar@redhat.com, agordeev@redhat.com, jan.kiszka@web.de, pbonzini@redhat.com To: Peter Xu Return-path: Received: from mx1.redhat.com ([209.132.183.28]:57680 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932283AbcKDRvE (ORCPT ); Fri, 4 Nov 2016 13:51:04 -0400 Content-Disposition: inline In-Reply-To: <1477468040-21034-13-git-send-email-peterx@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On Wed, Oct 26, 2016 at 03:47:15PM +0800, Peter Xu wrote: > Signed-off-by: Peter Xu > --- > lib/pci.h | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/lib/pci.h b/lib/pci.h > index 0336455..7a3bce9 100644 > --- a/lib/pci.h > +++ b/lib/pci.h > @@ -18,6 +18,9 @@ enum { > #define PCI_BAR_NUM (6) > #define PCI_DEVFN_MAX (256) > > +#define PCI_BDF_GET_DEVFN(x) ((x) & 0xff) > +#define PCI_BDF_GET_BUS(x) (((x) >> 8) & 0xff) I feel the above four defines (PCI_BAR_NUM, PCI_DEVFN_MAX, PCI_BDF_GET_DEVFN, PCI_BDF_GET_BUS) are on the crufty side, but I won't fight too hard to try to convince you to drop them :-) > + > struct pci_dev { > uint16_t pci_bdf; > phys_addr_t pci_bar[PCI_BAR_NUM]; > -- > 2.7.4 > > -- > To unsubscribe from this list: send the line "unsubscribe kvm" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html