From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LlPdH-0002IZ-Rk for qemu-devel@nongnu.org; Sun, 22 Mar 2009 11:30:39 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LlPdC-0002Fv-BY for qemu-devel@nongnu.org; Sun, 22 Mar 2009 11:30:38 -0400 Received: from [199.232.76.173] (port=53161 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LlPdC-0002Fs-6y for qemu-devel@nongnu.org; Sun, 22 Mar 2009 11:30:34 -0400 Received: from moutng.kundenserver.de ([212.227.126.188]:50274) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LlPdB-0007LY-HB for qemu-devel@nongnu.org; Sun, 22 Mar 2009 11:30:34 -0400 Received: from localhost ([127.0.0.1] ident=stefan) by flocke.weilnetz.de with esmtp (Exim 4.69) (envelope-from ) id 1LlPd6-0004Fx-Tu for qemu-devel@nongnu.org; Sun, 22 Mar 2009 16:30:28 +0100 Message-ID: <49C65994.40205@mail.berlios.de> Date: Sun, 22 Mar 2009 16:30:28 +0100 From: Stefan Weil MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH] [STABLE] Clean some PCI defines References: <49C62504.8070208@mail.berlios.de> <49C64930.1070509@mail.berlios.de> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit 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 Andreas Färber schrieb: > > Am 22.03.2009 um 15:20 schrieb Stefan Weil: > >> Andreas Färber schrieb: >>> Am 22.03.2009 um 12:46 schrieb Stefan Weil: >>> >>>> Some defines from linux/pci_regs.h had similar, but not >>>> the same defines in hw/pci.h (PCI_REVISION_ID / PCI_REVISION, >>>> PCI_SUBSYSTEM_VENDOR_ID / PCI_SUBVENDOR_ID, >>>> PCI_SUBSYSTEM_ID / PCI_SUBDEVICE_ID). >>>> >>>> I suggest to use the "standard" from linux/pci_regs.h and >>>> replace the "old" Qemu ones. [...] >>>> After a migration to the "standard" defines, >>>> pci.h could use linux/pci_regs.h which is far more complete. >>> >>> Please keep in mind that linux/pci_regs.h is most likely not suitable >>> for cross-platform use. >>> >>> You could of course do >>> >>> #ifdef __linux__ >>> #include >>> #else >>> #define PCI_... 0x1234 >>> ... >>> #endif >>> >>> but then you would still need to sync the two sections. >> >> There is nothing platform-specific in linux/pci_regs.h, only >> general PCI stuff. No need for conditional compilation. > > The *linux*/pci_regs.h file doesn't seem present on Mac OS X, Solaris, > Haiku, not to mention Windows. So either you need to #include it > conditionally where available, as outlined above, or ship a copy from > Linux/NetBSD with QEMU, as suggested by Warner, and #include that > local file only. > > Andreas > Oh, sorry, this was a misunderstanding. Of course I meant to include a copy (linux/pci_regs.h -> hw/pci_regs.h), in Qemu, like it was done with linux/pci_ids.h. Stefan