mirror of
https://github.com/ipxe/ipxe
synced 2025-12-20 03:55:46 +03:00
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.)
This commit is contained in:
@@ -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 */
|
||||
|
||||
Reference in New Issue
Block a user