diff options
author | Eric Biederman <ebiederm@xmission.com> | 2004-10-14 21:10:23 +0000 |
---|---|---|
committer | Eric Biederman <ebiederm@xmission.com> | 2004-10-14 21:10:23 +0000 |
commit | 992cd008f1d4217c3e7dd6d0a1e8445ade5da63d (patch) | |
tree | 277eebe8ff539afd4a5953ecd9542e3e0b224719 /src/include/device/resource.h | |
parent | b78c1972feed4c57eebba8f94de86a91e32c3fa7 (diff) |
- Update the device header files
git-svn-id: svn://svn.coreboot.org/coreboot/trunk@1663 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'src/include/device/resource.h')
-rw-r--r-- | src/include/device/resource.h | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/src/include/device/resource.h b/src/include/device/resource.h index b79a296b5b..7ab8065c23 100644 --- a/src/include/device/resource.h +++ b/src/include/device/resource.h @@ -1,6 +1,7 @@ #ifndef RESOURCE_H #define RESOURCE_H +#include <stdint.h> #define IORESOURCE_BITS 0x000000ff /* Bus-specific bits */ @@ -60,10 +61,12 @@ #define IORESOURCE_MEM_SHADOWABLE (1<<5) /* dup: IORESOURCE_SHADOWABLE */ #define IORESOURCE_MEM_EXPANSIONROM (1<<6) + +typedef uint64_t resource_t; struct resource { - unsigned long base; /* Base address of the resource */ - unsigned long size; /* Size of the resource */ - unsigned long limit; /* Largest valid value base + size -1 */ + resource_t base; /* Base address of the resource */ + resource_t size; /* Size of the resource */ + resource_t limit; /* Largest valid value base + size -1 */ 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 */ @@ -71,4 +74,18 @@ struct resource { /* Alignment must be >= the granularity of the resource */ }; +/* Macros to generate index values for subtractive resources */ +#define IOINDEX_SUBTRACTIVE(IDX,LINK) (0x10000000 + ((IDX) << 8) + LINK) +#define IOINDEX_SUBTRACTIVE_LINK(IDX) (IDX & 0xff) + +/* Generic resource helper functions */ +struct device; +extern void compact_resources(struct device * dev); +extern struct resource *probe_resource(struct device *dev, unsigned index); +extern struct resource *new_resource(struct device * dev, unsigned index); +extern struct resource *find_resource(struct device * dev, unsigned index); +extern resource_t resource_end(struct resource *resource); +extern resource_t resource_max(struct resource *resource); +extern void report_resource_stored(struct device * dev, struct resource *resource, const char *comment); + #endif /* RESOURCE_H */ |