From 894a34715f41f7c819a593dc3ff8e3033ffaa9fe Mon Sep 17 00:00:00 2001 From: Myles Watson Date: Wed, 9 Jun 2010 22:41:35 +0000 Subject: Same conversion as with resources from static arrays to lists, except there is no free list. Converting resource arrays to lists reduced the size of each device struct from 1092 to 228 bytes. Converting link arrays to lists reduced the size of each device struct from 228 to 68 bytes. Signed-off-by: Myles Watson Acked-by: Stefan Reinauer git-svn-id: svn://svn.coreboot.org/coreboot/trunk@5626 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1 --- src/mainboard/emulation/qemu-x86/northbridge.c | 4 ++-- src/mainboard/ibase/mb899/mptable.c | 2 +- src/mainboard/kontron/986lcd-m/mptable.c | 2 +- src/mainboard/tyan/s2881/mainboard.c | 15 ++------------- 4 files changed, 6 insertions(+), 17 deletions(-) (limited to 'src/mainboard') diff --git a/src/mainboard/emulation/qemu-x86/northbridge.c b/src/mainboard/emulation/qemu-x86/northbridge.c index 7b84928883..f4a0cc2973 100644 --- a/src/mainboard/emulation/qemu-x86/northbridge.c +++ b/src/mainboard/emulation/qemu-x86/northbridge.c @@ -60,7 +60,7 @@ extern uint64_t high_tables_base, high_tables_size; static void cpu_pci_domain_set_resources(device_t dev) { - u32 pci_tolm = find_pci_tolm(&dev->link[0]); + u32 pci_tolm = find_pci_tolm(dev->link_list); unsigned long tomk = 0, tolmk; int idx; @@ -91,7 +91,7 @@ static void cpu_pci_domain_set_resources(device_t dev) high_tables_size = HIGH_TABLES_SIZE * 1024; #endif - assign_resources(&dev->link[0]); + assign_resources(dev->link_list); } static void cpu_pci_domain_read_resources(struct device *dev) diff --git a/src/mainboard/ibase/mb899/mptable.c b/src/mainboard/ibase/mb899/mptable.c index c1854ecad2..d582ec6526 100644 --- a/src/mainboard/ibase/mb899/mptable.c +++ b/src/mainboard/ibase/mb899/mptable.c @@ -70,7 +70,7 @@ static void *smp_write_config_table(void *v) if (!riser) riser = dev_find_device(0x3388, 0x0022, 0); if (riser) { - riser_bus = riser->link[0].secondary; + riser_bus = riser->link_list->secondary; printk(BIOS_SPEW, "Riser bus is %x\n", riser_bus); max_pci_bus = riser_bus; } diff --git a/src/mainboard/kontron/986lcd-m/mptable.c b/src/mainboard/kontron/986lcd-m/mptable.c index bdba295bfc..cfa7cb7cdc 100644 --- a/src/mainboard/kontron/986lcd-m/mptable.c +++ b/src/mainboard/kontron/986lcd-m/mptable.c @@ -70,7 +70,7 @@ static void *smp_write_config_table(void *v) if (!riser) riser = dev_find_device(0x3388, 0x0022, 0); if (riser) { - riser_bus = riser->link[0].secondary; + riser_bus = riser->link_list->secondary; printk(BIOS_SPEW, "Riser bus is %x\n", riser_bus); max_pci_bus = riser_bus; } diff --git a/src/mainboard/tyan/s2881/mainboard.c b/src/mainboard/tyan/s2881/mainboard.c index 773f2540a4..6c41839227 100644 --- a/src/mainboard/tyan/s2881/mainboard.c +++ b/src/mainboard/tyan/s2881/mainboard.c @@ -46,7 +46,7 @@ static void adt7463_init(device_t dev) /* Find the ADT7463 device. */ path.type = DEVICE_PATH_I2C; path.i2c.device = 0x2d; - adt7463 = find_dev_path(smbus_dev->link, &path); + adt7463 = find_dev_path(smbus_dev->link_list, &path); if (!adt7463) die("ADT7463 not found\n"); printk(BIOS_DEBUG, "ADT7463 found\n"); @@ -113,7 +113,6 @@ static unsigned int scan_root_bus(device_t root, unsigned int max) { struct device_path path; device_t dummy; - unsigned link_i; max = root_dev_scan_bus(root, max); @@ -126,20 +125,10 @@ static unsigned int scan_root_bus(device_t root, unsigned int max) * as the last device to be initialized. */ - link_i = root->links; - if (link_i >= MAX_LINKS) { - printk(BIOS_DEBUG, "Reached MAX_LINKS, not configuring ADT7463"); - return max; - } - root->link[link_i].link = link_i; - root->link[link_i].dev = root; - root->link[link_i].children = 0; - root->links++; - path.type = DEVICE_PATH_PNP; path.pnp.port = 0; path.pnp.device = 0; - dummy = alloc_dev(&root->link[link_i], &path); + dummy = alloc_dev(root->link_list, &path); dummy->ops = &dummy_operations; return max; -- cgit v1.2.3