allocate_resource — allocate empty slot in the resource tree given range & alignment
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, void (*alignf)
(void *, struct resource *, resource_size_t, resource_size_t), void * alignf_data);
root resource descriptor
resource descriptor desired by caller
requested resource region size
minimum size to allocate
maximum size to allocate
alignment requested, in bytes
alignment function, optional, called if not NULL
arbitrary data to pass to the alignf function