summaryrefslogtreecommitdiff
path: root/src/northbridge/amd/amdk8
diff options
context:
space:
mode:
authorMyles Watson <mylesgw@gmail.com>2010-05-21 14:33:48 +0000
committerMyles Watson <mylesgw@gmail.com>2010-05-21 14:33:48 +0000
commitc25cc11ae32e10a7d0c9f04c29bfb7eca4d9c210 (patch)
treefb5ada475647efc61ee1f51f50e3adad4ac74b6e /src/northbridge/amd/amdk8
parentc5b87c8f895502b235e1619a23bd89dda955000e (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/amdk8')
-rw-r--r--src/northbridge/amd/amdk8/northbridge.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/src/northbridge/amd/amdk8/northbridge.c b/src/northbridge/amd/amdk8/northbridge.c
index 6938ec62b3..7910f291aa 100644
--- a/src/northbridge/amd/amdk8/northbridge.c
+++ b/src/northbridge/amd/amdk8/northbridge.c
@@ -520,14 +520,13 @@ static void amdk8_create_vga_resource(device_t dev, unsigned nodeid)
static void amdk8_set_resources(device_t dev)
{
unsigned nodeid, link;
- int i;
+ struct resource *res;
/* Find the nodeid */
nodeid = amdk8_nodeid(dev);
/* Set each resource we have found */
- for(i = 0; i < dev->resources; i++) {
- struct resource *res = &dev->resource[i];
+ for(res = dev->resource_list; res; res = res->next) {
struct resource *old = NULL;
unsigned index;
@@ -846,7 +845,7 @@ static void amdk8_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;
uint32_t pci_tolm;
@@ -905,12 +904,11 @@ static void amdk8_domain_set_resources(device_t dev)
mem2->base, mem2->limit, mem2->size, mem2->align);
#endif
- 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;
- report_resource_stored(dev, resource, "");
+ res->flags |= IORESOURCE_ASSIGNED;
+ res->flags |= IORESOURCE_STORED;
+ report_resource_stored(dev, res, "");
}
#endif