other versions
| ALLOCATE_RESOURCE(9) | Hardware Interfaces | ALLOCATE_RESOURCE(9) |
NAME¶
allocate_resource - allocate empty slot in the resource tree given range & alignment. The resource will be reallocated with a new size if it was already allocatedSYNOPSIS¶
int allocate_resource(struct resource * root, struct resource * new, resource_size_t size, resource_size_t min, resource_size_t max, resource_size_t align, resource_size_t (*alignf) (void *, const struct resource *, resource_size_t, resource_size_t), void * alignf_data);
ARGUMENTS¶
struct resource * rootroot resource descriptor
struct resource * new
resource descriptor desired by caller
resource_size_t size
requested resource region size
resource_size_t min
minimum boundary to allocate
resource_size_t max
maximum boundary to allocate
resource_size_t align
alignment requested, in bytes
resource_size_t (*)(void *, const struct resource *, resource_size_t, resource_size_t) alignf
alignment function, optional, called if not NULL
void * alignf_data
arbitrary data to pass to the alignf
function
COPYRIGHT¶
| July 2017 | Kernel Hackers Manual 4.11 |