From 6b6096d28ba0ac47af9070df7ebaf1fdda099a4f Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Wed, 17 May 2006 01:12:11 +0000 Subject: Strip down i386 PCI configuration space I/O to the bare minimum. A typical build will now include 880 bytes of PCI support code, compared to 2327 bytes in Etherboot 5.4. (There is a slight cost of around 5 extra bytes per access to a non-constant config space address; this should be an overall win. Driver-specific accesses will usually be to constant addresses, for which there is no additional cost.) --- src/drivers/bus/pci.c | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) (limited to 'src/drivers') diff --git a/src/drivers/bus/pci.c b/src/drivers/bus/pci.c index 853dda64e..222f3eeab 100644 --- a/src/drivers/bus/pci.c +++ b/src/drivers/bus/pci.c @@ -38,15 +38,6 @@ static struct pci_driver pci_drivers_end[0] __table_end ( pci_drivers ); static void pcibus_remove ( struct root_device *rootdev ); -/** - * Maximum PCI bus number - * - * Architecture-specific code may know how many buses we have, in - * which case it can overwrite this value. - * - */ -unsigned int pci_max_bus = 0xff; - /** * Read PCI BAR * @@ -242,13 +233,15 @@ static void unregister_pcidev ( struct pci_device *pci ) { */ static int pcibus_probe ( struct root_device *rootdev ) { struct pci_device *pci = NULL; + unsigned int max_bus; unsigned int bus; unsigned int devfn; - uint8_t hdrtype; + uint8_t hdrtype = 0; uint32_t tmp; int rc; - for ( bus = 0 ; bus <= pci_max_bus ; bus++ ) { + max_bus = pci_max_bus(); + for ( bus = 0 ; bus <= max_bus ; bus++ ) { for ( devfn = 0 ; devfn <= 0xff ; devfn++ ) { /* Allocate struct pci_device */ -- cgit v1.2.3-55-g7522