From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NRkq5-0007Er-UO for qemu-devel@nongnu.org; Mon, 04 Jan 2010 06:11:10 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NRkq1-0007DA-W0 for qemu-devel@nongnu.org; Mon, 04 Jan 2010 06:11:09 -0500 Received: from [199.232.76.173] (port=34433 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NRkq1-0007D4-FY for qemu-devel@nongnu.org; Mon, 04 Jan 2010 06:11:05 -0500 Received: from mx1.redhat.com ([209.132.183.28]:49889) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NRkq0-0002zO-DV for qemu-devel@nongnu.org; Mon, 04 Jan 2010 06:11:04 -0500 Date: Mon, 4 Jan 2010 13:07:58 +0200 From: "Michael S. Tsirkin" Subject: Re: [Qemu-devel] Re: [PATCH 1/6] Make config space accessor host bus trapable Message-ID: <20100104110758.GE8522@redhat.com> References: <75078DD9-314F-4FA8-896B-36C5B771C6A7@suse.de> <20100103172937.GB8508@redhat.com> <20100103174430.GA8522@redhat.com> <41679128-EE37-47DA-82F6-830A4C364183@suse.de> <20100103180609.GB8522@redhat.com> <472F306A-0699-401C-8E6A-8E79B86E4C95@suse.de> <1262551822.2173.267.camel@pasglop> <19BFDDD5-85E0-42EC-9D71-391CECC023F5@suse.de> <20100104104516.GD4672@valinux.co.jp> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20100104104516.GD4672@valinux.co.jp> List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Isaku Yamahata Cc: Blue Swirl , Alexander Graf , Aurelien Jarno , QEMU Developers On Mon, Jan 04, 2010 at 07:45:16PM +0900, Isaku Yamahata wrote: > +static PCIDevice *pci_host_dev_find_fn_noswap(PCIHostState *s, uint32_t addr) > +{ > + return pci_host_find_dev_active(s->bus, pci_host_pci_addr(s, addr)); > +} > + > +static PCIDevice *pci_host_dev_find_fn(PCIHostState *s, uint32_t addr) > +{ > +#ifdef TARGET_WORDS_BIGENDIAN > + addr = bswap32(addr); > +#endif > + return pci_host_find_dev_active(s->bus, pci_host_pci_addr(s, addr)); > +} > + BTW, I think we really should think about the right way to address the swap/noswap issue without using a preprocessor. Maybe make pci host bridge explicitly specify whether to swap bytes? How about adding a field in PCIHostState to make it do this? -- MST