Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1H4J8b-0000Sj-Qp for qemu-devel@nongnu.org; Tue, 09 Jan 2007 10:43:45 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1H4J8b-0000Ry-BE for qemu-devel@nongnu.org; Tue, 09 Jan 2007 10:43:45 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1H4J8a-0000Rn-Vm for qemu-devel@nongnu.org; Tue, 09 Jan 2007 10:43:45 -0500 Received: from [82.232.2.251] (helo=mail.aurel32.net) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1H4J8Z-0004N2-Oj for qemu-devel@nongnu.org; Tue, 09 Jan 2007 10:43:44 -0500 Received: from farad.aurel32.net ([2001:618:400:fc13:216:3eff:fe00:100c]) by mail.aurel32.net with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.63) (envelope-from ) id 1H4J8k-0004Uh-8t for qemu-devel@nongnu.org; Tue, 09 Jan 2007 16:43:54 +0100 Received: from aurel32 by farad.aurel32.net with local (Exim 4.63) (envelope-from ) id 1H4J8k-0001T4-4e for qemu-devel@nongnu.org; Tue, 09 Jan 2007 16:43:54 +0100 Date: Tue, 9 Jan 2007 16:43:54 +0100 From: Aurelien Jarno Message-ID: <20070109154354.GB5603@farad.aurel32.net> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline Subject: [Qemu-devel] [PATCH] devfn number for the PIIX3 southbridge 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 This patch adds a way to specify a devfn number for the PIIX3 southbridge, as the Malta platform rely on this number to setup the IRQ. Passing the value -1 makes the devfn automatically assigned as previously. diff -Nurd qemu/hw/pc.c qemu/hw/pc.c --- qemu/hw/pc.c 2006-12-26 15:28:42.000000000 +0100 +++ qemu/hw/pc.c 2006-12-26 16:01:05.000000000 +0100 @@ -582,7 +582,7 @@ if (pci_enabled) { pci_bus = i440fx_init(&i440fx_state); - piix3_devfn = piix3_init(pci_bus); + piix3_devfn = piix3_init(pci_bus, -1); } else { pci_bus = NULL; } diff -Nurd qemu/hw/piix_pci.c qemu/hw/piix_pci.c --- qemu/hw/piix_pci.c 2006-09-24 21:31:43.000000000 +0200 +++ qemu/hw/piix_pci.c 2006-12-26 16:01:05.000000000 +0100 @@ -196,7 +196,7 @@ /* PIIX3 PCI to ISA bridge */ -static PCIDevice *piix3_dev; +PCIDevice *piix3_dev; /* just used for simpler irq handling. */ #define PCI_IRQ_WORDS ((PCI_DEVICES_MAX + 31) / 32) @@ -273,13 +273,13 @@ return pci_device_load(d, f); } -int piix3_init(PCIBus *bus) +int piix3_init(PCIBus *bus, int devfn) { PCIDevice *d; uint8_t *pci_conf; d = pci_register_device(bus, "PIIX3", sizeof(PCIDevice), - -1, NULL, NULL); + devfn, NULL, NULL); register_savevm("PIIX3", 0, 2, piix_save, piix_load, d); piix3_dev = d; diff -Nurd qemu/vl.h qemu/vl.h --- qemu/vl.h 2006-12-26 12:31:58.000000000 +0100 +++ qemu/vl.h 2006-12-26 16:36:10.000000000 +0100 @@ -790,7 +790,7 @@ /* piix_pci.c */ PCIBus *i440fx_init(PCIDevice **pi440fx_state); void i440fx_set_smm(PCIDevice *d, int val); -int piix3_init(PCIBus *bus); +int piix3_init(PCIBus *bus, int devfn); void i440fx_init_memory_mappings(PCIDevice *d); /* openpic.c */ -- .''`. Aurelien Jarno | GPG: 1024D/F1BCDB73 : :' : Debian developer | Electrical Engineer `. `' aurel32@debian.org | aurelien@aurel32.net `- people.debian.org/~aurel32 | www.aurel32.net