From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LQksl-0005x2-JB for qemu-devel@nongnu.org; Sat, 24 Jan 2009 10:57:15 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LQksj-0005wn-6W for qemu-devel@nongnu.org; Sat, 24 Jan 2009 10:57:14 -0500 Received: from [199.232.76.173] (port=58926 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LQksi-0005wk-Tq for qemu-devel@nongnu.org; Sat, 24 Jan 2009 10:57:12 -0500 Received: from mtaout03-winn.ispmail.ntl.com ([81.103.221.49]:34406) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LQksi-0001E4-Cl for qemu-devel@nongnu.org; Sat, 24 Jan 2009 10:57:12 -0500 Received: from aamtaout01-winn.ispmail.ntl.com ([81.103.221.35]) by mtaout03-winn.ispmail.ntl.com (InterMail vM.7.08.04.00 201-2186-134-20080326) with ESMTP id <20090124155711.UYAT7670.mtaout03-winn.ispmail.ntl.com@aamtaout01-winn.ispmail.ntl.com> for ; Sat, 24 Jan 2009 15:57:11 +0000 Received: from miranda.arrow ([213.107.23.205]) by aamtaout01-winn.ispmail.ntl.com (InterMail vG.2.02.00.01 201-2161-120-102-20060912) with ESMTP id <20090124155710.YJZG19264.aamtaout01-winn.ispmail.ntl.com@miranda.arrow> for ; Sat, 24 Jan 2009 15:57:10 +0000 Received: from sdb by miranda.arrow with local (Exim 4.63) (envelope-from ) id 1LQkse-0007h2-Li for qemu-devel@nongnu.org; Sat, 24 Jan 2009 15:57:08 +0000 Date: Sat, 24 Jan 2009 15:57:08 +0000 From: Stuart Brady Subject: Re: [Qemu-devel] [PATCH] Define PCI vendor and device ID in pci.h Message-ID: <20090124155708.GA29561@miranda.arrow> References: <20090118132548.GA17854@miranda.arrow> <4978A6BF.9030606@us.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4978A6BF.9030606@us.ibm.com> Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org On Thu, Jan 22, 2009 at 11:02:55AM -0600, Anthony Liguori wrote: > >+ *(uint16_t *)&pci_conf[0x00] = cpu_to_le16(PCI_VENDOR_ID_INTEL); > >+ *(uint16_t *)&pci_conf[0x02] = > >cpu_to_le16(PCI_DEVICE_ID_INTEL_82371SB_2); > > > You should use cpu_to_le16uw here. That was my initial thought -- only cpu_to_le16uw() still requires the cast. The EEPro100 emulation uses its own style: PCI_CONFIG_16(PCI_VENDOR_ID, 0x8086); PCI_CONFIG_16(PCI_DEVICE_ID, 0x1209); ... but I didn't like this, because the name of 'pci_conf' is not specified explicitly, and PCI_CONFIG_* are just little-endian writes, and not anything particularly special. > Even better yet, you should introduce some PCI space accessors to > remove all of the open coded offset access. > You could start with just > pci_config_set_vendor_id()/pci_config_set_device_id(). That sounds much better! Will do! :) Cheers, -- Stuart Brady