- Update the device header files
git-svn-id: svn://svn.coreboot.org/coreboot/trunk@1663 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
diff --git a/src/include/device/resource.h b/src/include/device/resource.h
index b79a296..7ab8065 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 @@
/* 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 */