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 allocated
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); |
rootroot resource descriptor
newresource descriptor desired by caller
sizerequested resource region size
minminimum boundary to allocate
maxmaximum boundary to allocate
alignalignment requested, in bytes
alignfalignment function, optional, called if not NULL
alignf_data
arbitrary data to pass to the alignf function