diff options
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/device/resource.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/include/device/resource.h b/src/include/device/resource.h index 1d04e9a1c8..c97b01d22f 100644 --- a/src/include/device/resource.h +++ b/src/include/device/resource.h @@ -91,4 +91,24 @@ static inline void *res2mmio(struct resource *res, unsigned long offset, return (void *)(uintptr_t)((res->base + offset) & ~mask); } +/* + * Pick largest resource on the bus using the given mask and type. + * Params: + * bus = Bus from which the resource needs to picked from. + * result_res = If NULL, there was no previous resource picked on this bus, else it points to + * the last picked resource. + * type_mask = Mask to be applied when searching for resource + * type = Expected type for the resource + * + * Returns: + * If resource is found, returns the device and sets result_rest to point to the resource. Else + * returns NULL. + */ +const struct device *largest_resource(struct bus *bus, struct resource **result_res, + unsigned long type_mask, unsigned long type); + + +/* Compute and allocate resources. This is the main resource allocator entry point. */ +void allocate_resources(const struct device *root); + #endif /* DEVICE_RESOURCE_H */ |