• Home
  • Raw
  • Download

Lines Matching refs:new

198 static struct resource * __request_resource(struct resource *root, struct resource *new)  in __request_resource()  argument
200 resource_size_t start = new->start; in __request_resource()
201 resource_size_t end = new->end; in __request_resource()
214 new->sibling = tmp; in __request_resource()
215 *p = new; in __request_resource()
216 new->parent = root; in __request_resource()
282 struct resource *request_resource_conflict(struct resource *root, struct resource *new) in request_resource_conflict() argument
287 conflict = __request_resource(root, new); in request_resource_conflict()
299 int request_resource(struct resource *root, struct resource *new) in request_resource() argument
303 conflict = request_resource_conflict(root, new); in request_resource()
444 struct resource *new, in __find_resource() argument
449 struct resource tmp = *new, avail, alloc; in __find_resource()
451 tmp.flags = new->flags; in __find_resource()
474 avail = *new; in __find_resource()
482 new->start = alloc.start; in __find_resource()
483 new->end = alloc.end; in __find_resource()
501 static int find_resource(struct resource *root, struct resource *new, in find_resource() argument
505 return __find_resource(root, NULL, new, size, constraint); in find_resource()
523 struct resource new = *old; in reallocate_resource() local
528 if ((err = __find_resource(root, old, &new, newsize, constraint))) in reallocate_resource()
531 if (resource_contains(&new, old)) { in reallocate_resource()
532 old->start = new.start; in reallocate_resource()
533 old->end = new.end; in reallocate_resource()
542 if (resource_contains(old, &new)) { in reallocate_resource()
543 old->start = new.start; in reallocate_resource()
544 old->end = new.end; in reallocate_resource()
547 *old = new; in reallocate_resource()
569 int allocate_resource(struct resource *root, struct resource *new, in allocate_resource() argument
590 if ( new->parent ) { in allocate_resource()
593 return reallocate_resource(root, new, size, &constraint); in allocate_resource()
597 err = find_resource(root, new, size, &constraint); in allocate_resource()
598 if (err >= 0 && __request_resource(root, new)) in allocate_resource()
631 static struct resource * __insert_resource(struct resource *parent, struct resource *new) in __insert_resource() argument
636 first = __request_resource(parent, new); in __insert_resource()
642 if (WARN_ON(first == new)) /* duplicated insertion */ in __insert_resource()
645 if ((first->start > new->start) || (first->end < new->end)) in __insert_resource()
647 if ((first->start == new->start) && (first->end == new->end)) in __insert_resource()
653 if (next->start < new->start || next->end > new->end) in __insert_resource()
657 if (next->sibling->start > new->end) in __insert_resource()
661 new->parent = parent; in __insert_resource()
662 new->sibling = next->sibling; in __insert_resource()
663 new->child = first; in __insert_resource()
667 next->parent = new; in __insert_resource()
670 parent->child = new; in __insert_resource()
675 next->sibling = new; in __insert_resource()
693 struct resource *insert_resource_conflict(struct resource *parent, struct resource *new) in insert_resource_conflict() argument
698 conflict = __insert_resource(parent, new); in insert_resource_conflict()
710 int insert_resource(struct resource *parent, struct resource *new) in insert_resource() argument
714 conflict = insert_resource_conflict(parent, new); in insert_resource()
726 void insert_resource_expand_to_fit(struct resource *root, struct resource *new) in insert_resource_expand_to_fit() argument
728 if (new->parent) in insert_resource_expand_to_fit()
735 conflict = __insert_resource(root, new); in insert_resource_expand_to_fit()
742 if (conflict->start < new->start) in insert_resource_expand_to_fit()
743 new->start = conflict->start; in insert_resource_expand_to_fit()
744 if (conflict->end > new->end) in insert_resource_expand_to_fit()
745 new->end = conflict->end; in insert_resource_expand_to_fit()
747 printk("Expanded resource %s due to conflict with %s\n", new->name, conflict->name); in insert_resource_expand_to_fit()