Lines Matching full:end

52 add_avail(uint64_t start, uint64_t end, uint64_t type)  in add_avail()  argument
59 segs[nr_seg - 1].end + 1 == start && in add_avail()
61 segs[nr_seg - 1].end = end; in add_avail()
66 * Otherwise we need to add a new range at the end, but don't need to in add_avail()
67 * adjust the current end. in add_avail()
71 segs[nr_seg].end = end; in add_avail()
82 remove_avail(uint64_t start, uint64_t end, uint64_t type) in remove_avail() argument
91 if (s->end + 1 == start && in remove_avail()
93 s->end = end; in remove_avail()
96 if (s->end == end) { in remove_avail()
102 s->start = end + 1; in remove_avail()
111 * we allocate 1 additional item. The current end is copied to the new end. The in remove_avail()
112 * current end is set to <start, end, type> and the new end's start is set to end + 1. in remove_avail()
114 * additional items. We copy the current end to the new end, set the new end's start in remove_avail()
115 * to end + 1, the old end's end to start - 1 and the new item is <start, end, type> in remove_avail()
116 * (3) The new chunk is at the end of the current end. In this case we allocate 1 more in remove_avail()
117 * and adjust the current end's end to start - 1 and set the new end to <start, end, type>. in remove_avail()
118 * (4) The new chunk is exactly the current end, except for type. In this case, we just adjust in remove_avail()
125 if (s->end == end) { /* (4) */ in remove_avail()
134 s->end = end; in remove_avail()
136 s[1].start = end + 1; in remove_avail()
140 if (s->end == end) { /* At end of old chunk (3) */ in remove_avail()
144 s->end = start - 1; in remove_avail()
154 s->end = start - 1; in remove_avail()
156 s[1].end = end; in remove_avail()
158 s[2].start = end + 1; in remove_avail()
170 (uintmax_t)segs[i].end, in print_avail()
184 if (s >= segs[i].end) /* roundup past end */ in first_avail()
186 len = segs[i].end - s + 1; in first_avail()
192 (uintmax_t)segs[i].end); in first_avail()
227 uint64_t start, end; in parse_line() local
242 end = strtoull(walker, &next, 16); in parse_line()
243 if (end == ULLONG_MAX || walker == next) in parse_line()
250 *endp = end; in parse_line()
283 uint64_t start, end; in populate_avail_from_iomem() local
307 str = parse_line(buf, &start, &end); in populate_avail_from_iomem()
314 add_avail(start, end, system_ram); in populate_avail_from_iomem()
316 add_avail(start, end, firmware_reserved); in populate_avail_from_iomem()
321 str = parse_line(buf, &start, &end); in populate_avail_from_iomem()
326 remove_avail(start, end, unknown); in populate_avail_from_iomem()
328 remove_avail(start, end, kv->type); in populate_avail_from_iomem()
353 * from @start@ to the end of the segment.
359 if (start >= segs[i].start && start <= segs[i].end) in space_avail()
360 return segs[i].end - start; in space_avail()