diff options
author | Myles Watson <mylesgw@gmail.com> | 2010-05-21 14:33:48 +0000 |
---|---|---|
committer | Myles Watson <mylesgw@gmail.com> | 2010-05-21 14:33:48 +0000 |
commit | c25cc11ae32e10a7d0c9f04c29bfb7eca4d9c210 (patch) | |
tree | fb5ada475647efc61ee1f51f50e3adad4ac74b6e /src/northbridge/amd/amdfam10 | |
parent | c5b87c8f895502b235e1619a23bd89dda955000e (diff) |
Use lists instead of arrays for resources in devices to reduce memory usage.
Signed-off-by: Myles Watson <mylesgw@gmail.com>
Acked-by: Patrick Georgi <patrick.georgi@coresystems.de>
git-svn-id: svn://svn.coreboot.org/coreboot/trunk@5576 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'src/northbridge/amd/amdfam10')
-rw-r--r-- | src/northbridge/amd/amdfam10/northbridge.c | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/src/northbridge/amd/amdfam10/northbridge.c b/src/northbridge/amd/amdfam10/northbridge.c index 3d968a9ded..009b57becc 100644 --- a/src/northbridge/amd/amdfam10/northbridge.c +++ b/src/northbridge/amd/amdfam10/northbridge.c @@ -592,7 +592,7 @@ static void amdfam10_create_vga_resource(device_t dev, unsigned nodeid) static void amdfam10_set_resources(device_t dev) { u32 nodeid, link; - int i; + struct resource *res; /* Find the nodeid */ nodeid = amdfam10_nodeid(dev); @@ -600,8 +600,8 @@ static void amdfam10_set_resources(device_t dev) amdfam10_create_vga_resource(dev, nodeid); /* Set each resource we have found */ - for(i = 0; i < dev->resources; i++) { - amdfam10_set_resource(dev, &dev->resource[i], nodeid); + for(res = dev->resource_list; res; res = res->next) { + amdfam10_set_resource(dev, res, nodeid); } for(link = 0; link < dev->links; link++) { @@ -889,7 +889,7 @@ static void pci_domain_set_resources(device_t dev) { #if CONFIG_PCI_64BIT_PREF_MEM == 1 struct resource *io, *mem1, *mem2; - struct resource *resource, *last; + struct resource *res; #endif unsigned long mmio_basek; u32 pci_tolm; @@ -943,14 +943,13 @@ static void pci_domain_set_resources(device_t dev) mem2->base, mem2->limit, mem2->size, mem2->align); } - last = &dev->resource[dev->resources]; - for(resource = &dev->resource[0]; resource < last; resource++) + for(res = &dev->resource_list; res; res = res->next) { - resource->flags |= IORESOURCE_ASSIGNED; - resource->flags &= ~IORESOURCE_STORED; - link = (resource>>2) & 3; - resource->flags |= IORESOURCE_STORED; - report_resource_stored(dev, resource, ""); + res->flags |= IORESOURCE_ASSIGNED; + res->flags &= ~IORESOURCE_STORED; + link = (res>>2) & 3; + res->flags |= IORESOURCE_STORED; + report_resource_stored(dev, res, ""); } #endif |