From: Gianni Tedesco Subject: Re: [PATCH]: change libxl IDL to export a saner interface for upcoming language bindings Date: Thu, 9 Sep 2010 15:38:58 +0100 Message-ID: <1284043138.17452.92.camel@qabil.uk.xensource.com> References: <1284037653.17452.74.camel@qabil.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1284037653.17452.74.camel@qabil.uk.xensource.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Xen Devel Cc: Ian Campbell , Ian Jackson , Vincent Hanquez , Stefano Stabellini List-Id: xen-devel@lists.xenproject.org On Thu, 2010-09-09 at 14:07 +0100, Gianni Tedesco wrote: > diff -r b19856f6dd76 tools/libxl/libxl_pci.c > --- a/tools/libxl/libxl_pci.c Thu Sep 09 09:24:24 2010 +0100 > +++ b/tools/libxl/libxl_pci.c Thu Sep 09 13:52:46 2010 +0100 > @@ -41,6 +41,15 @@ > #define PCI_BDF_SHORT "%02x:%02x.%01x" > #define PCI_BDF_VDEVFN "%04x:%02x:%02x.%01x@%02x" > > +static unsigned int pcidev_value(libxl_device_pci *pcidev) > +{ > + return ((pcidev->reg & 0x3f) << 24) | > + ((pcidev->func & 0x7) << 21) | > + ((pcidev->dev & 0x1f) << 16) | > + ((pcidev->bus & 0xff) << 8) | > + ((pcidev->enable) ? 1 : 0); > +} > + Gah, this bit is broken, don't apply. I assume it's due to endianness - changed it to put it in a temporary union and it works fine?! Will re-send a better tested patch-series with more exported functions next week.