From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Jones Subject: Re: [kvm-unit-tests PATCH v2 05/10] x86: move x86/pci to the common lib Date: Mon, 18 Jan 2016 14:59:02 +0100 Message-ID: <20160118135902.GE4075@hawk.localdomain> References: <1452876695-9240-1-git-send-email-drjones@redhat.com> <1452876695-9240-6-git-send-email-drjones@redhat.com> <20160115215708.GB11566@potion.brq.redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: kvm@vger.kernel.org, pbonzini@redhat.com, mst@redhat.com, agordeev@redhat.com To: Radim =?utf-8?B?S3LEjW3DocWZ?= Return-path: Received: from mx1.redhat.com ([209.132.183.28]:44188 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755001AbcARN7H (ORCPT ); Mon, 18 Jan 2016 08:59:07 -0500 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id 4D978C1C579D for ; Mon, 18 Jan 2016 13:59:07 +0000 (UTC) Content-Disposition: inline In-Reply-To: <20160115215708.GB11566@potion.brq.redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On Fri, Jan 15, 2016 at 10:57:09PM +0100, Radim Kr=C4=8Dm=C3=A1=C5=99 w= rote: > 2016-01-15 17:51+0100, Andrew Jones: > > Also move pci_config_read into asm/pci.h > >=20 > > Signed-off-by: Andrew Jones > > --- > > +++ b/lib/asm-generic/pci.h > > @@ -0,0 +1,4 @@ > > +#ifndef _ASM_GENERIC_PCI_H_ > > +#define _ASM_GENERIC_PCI_H_ > > +#error need architecture specific asm/pci.h > > +#endif > > +++ b/lib/x86/asm/pci.h > > @@ -0,0 +1,19 @@ > > +#ifndef ASM_PCI_H > > +#define ASM_PCI_H > > +/* > > + * Copyright (C) 2013, Red Hat Inc, Michael S. Tsirkin > > + * > > + * This work is licensed under the terms of the GNU LGPL, version = 2. > > + */ > > +#include "libcflat.h" > > +#include "pci.h" > > +#include "asm/io.h" > > + > > +static inline uint32_t pci_config_read(pcidevaddr_t dev, uint8_t r= eg) > > +{ > > + uint32_t index =3D reg | (dev << 8) | (0x1 << 31); > > + outl(index, 0xCF8); > > + return inl(0xCFC); >=20 > Hm, why can't this be generalized with [1/10]? 0xcf8 and 0xcfc are special x86 ports. Other architectures need to do other things. >=20 > Thanks. >=20 > > +} > > + > > +#endif > -- > 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