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/include | |
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/include')
-rw-r--r-- | src/include/device/device.h | 6 | ||||
-rw-r--r-- | src/include/device/resource.h | 1 |
2 files changed, 4 insertions, 3 deletions
diff --git a/src/include/device/device.h b/src/include/device/device.h index 59dd0815e6..6ac2d10bfc 100644 --- a/src/include/device/device.h +++ b/src/include/device/device.h @@ -74,11 +74,10 @@ struct device { u8 command; /* Base registers for this device. I/O, MEM and Expansion ROM */ - struct resource resource[MAX_RESOURCES]; - unsigned int resources; + struct resource *resource_list; /* links are (downstream) buses attached to the device, usually a leaf - * device with no children have 0 buses attached and a bridge has 1 bus + * 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 */ @@ -96,6 +95,7 @@ struct device { extern struct device dev_root; extern struct device *all_devices; /* list of all devices */ +extern struct resource *free_resources; /* Generic device interface functions */ device_t alloc_dev(struct bus *parent, struct device_path *path); diff --git a/src/include/device/resource.h b/src/include/device/resource.h index 5452d4360c..49e218531c 100644 --- a/src/include/device/resource.h +++ b/src/include/device/resource.h @@ -68,6 +68,7 @@ struct resource { resource_t base; /* Base address of the resource */ resource_t size; /* Size of the resource */ resource_t limit; /* Largest valid value base + size -1 */ + struct resource* next; /* Next resource in the list */ unsigned long flags; /* Descriptions of the kind of resource */ unsigned long index; /* Bus specific per device resource id */ unsigned char align; /* Required alignment (log 2) of the resource */ |