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 <mylesgw@gmail.com>
Acked-by: Stefan Reinauer <stepan@coresystems.de>


git-svn-id: svn://svn.coreboot.org/coreboot/trunk@5626 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
diff --git a/src/include/device/device.h b/src/include/device/device.h
index 6ac2d10..b6e7a7b 100644
--- a/src/include/device/device.h
+++ b/src/include/device/device.h
@@ -40,8 +40,9 @@
 struct bus {
 	device_t 	dev;		/* This bridge device */
 	device_t 	children;	/* devices behind this bridge */
+	struct bus	*next;		/* The next bridge on this device */
 	unsigned	bridge_ctrl;	/* Bridge control register */
-	unsigned char	link;		/* The index of this link */
+	unsigned char	link_num;	/* The index of this link */
 	uint16_t	secondary; 	/* secondary bus number */
 	uint16_t	subordinate;	/* max subordinate bus number */
 	unsigned char   cap;		/* PCi capability offset */
@@ -49,8 +50,6 @@
 	unsigned	disable_relaxed_ordering : 1;
 };
 
-#define MAX_RESOURCES 24
-#define MAX_LINKS    8
 /*
  * There is one device structure for each slot-number/function-number
  * combination:
@@ -79,9 +78,7 @@
 	/* links are (downstream) buses attached to the device, usually a leaf
 	 * device with no children has 0 buses attached and a bridge has 1 bus
 	 */
-	struct bus link[MAX_LINKS];
-	/* number of buses attached to the device */
-	unsigned int links;
+	struct bus *link_list;
 
 	struct device_operations *ops;
 	const struct chip_operations *chip_ops;
@@ -96,6 +93,7 @@
 extern struct device	*all_devices;	/* list of all devices */
 
 extern struct resource	*free_resources;
+extern struct bus	*free_links;
 
 /* Generic device interface functions */
 device_t alloc_dev(struct bus *parent, struct device_path *path);