From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LTgoY-0001Dd-7K for qemu-devel@nongnu.org; Sun, 01 Feb 2009 13:13:02 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LTgoW-0001D2-Mx for qemu-devel@nongnu.org; Sun, 01 Feb 2009 13:13:01 -0500 Received: from [199.232.76.173] (port=44669 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LTgoW-0001Cz-Fm for qemu-devel@nongnu.org; Sun, 01 Feb 2009 13:13:00 -0500 Received: from fk-out-0910.google.com ([209.85.128.186]:4889) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LTgoW-0002Np-3x for qemu-devel@nongnu.org; Sun, 01 Feb 2009 13:13:00 -0500 Received: by fk-out-0910.google.com with SMTP id z23so1073344fkz.2 for ; Sun, 01 Feb 2009 10:12:59 -0800 (PST) MIME-Version: 1.0 In-Reply-To: <20090201175609.GA14322@miranda.arrow> References: <20090201175609.GA14322@miranda.arrow> Date: Sun, 1 Feb 2009 20:12:59 +0200 Message-ID: Subject: Re: [Qemu-devel] [PATCH] Add and use #defines for PCI device classes From: Blue Swirl Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit 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 2/1/09, Stuart Brady wrote: > This patch adds and uses #defines for PCI device classes and subclases, > using a new pci_config_set_class() function, similar to the recently > added pci_config_set_vendor_id() and pci_config_set_device_id(). Nice idea. I think I'll add similar stuff to OpenBIOS too. > Index: hw/sun4u.c > =================================================================== > --- hw/sun4u.c (revision 6490) > +++ hw/sun4u.c (working copy) > @@ -373,8 +373,7 @@ pci_ebus_init(PCIBus *bus, int devfn) > s->config[0x07] = 0x03; // status = medium devsel > s->config[0x08] = 0x01; // revision > s->config[0x09] = 0x00; // programming i/f > - s->config[0x0A] = 0x80; // class_sub = misc bridge > - s->config[0x0B] = 0x06; // class_base = PCI_bridge > + pci_config_set_class(d->config, PCI_CLASS_BRIDGE_OTHER); Borken, s != d.