diff options
author | Myles Watson <mylesgw@gmail.com> | 2010-06-09 22:41:35 +0000 |
---|---|---|
committer | Myles Watson <mylesgw@gmail.com> | 2010-06-09 22:41:35 +0000 |
commit | 894a34715f41f7c819a593dc3ff8e3033ffaa9fe (patch) | |
tree | 12ed2a5e10c6f181caa4c1add2ee8239abf82bfe /src/include | |
parent | 6507b390467591928f16aab68f247321ad3f2262 (diff) |
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
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/device/device.h | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/include/device/device.h b/src/include/device/device.h index 6ac2d10bfc..b6e7a7bac1 100644 --- a/src/include/device/device.h +++ b/src/include/device/device.h @@ -40,8 +40,9 @@ struct device_operations { 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 @@ struct bus { 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 @@ struct device { /* 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 dev_root; 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); |