Lines Matching refs:range

11 int add_range(struct range *range, int az, int nr_range, u64 start, u64 end)  in add_range()  argument
20 range[nr_range].start = start; in add_range()
21 range[nr_range].end = end; in add_range()
28 int add_range_with_merge(struct range *range, int az, int nr_range, in add_range_with_merge() argument
40 if (!range[i].end) in add_range_with_merge()
43 common_start = max(range[i].start, start); in add_range_with_merge()
44 common_end = min(range[i].end, end); in add_range_with_merge()
49 start = min(range[i].start, start); in add_range_with_merge()
50 end = max(range[i].end, end); in add_range_with_merge()
52 memmove(&range[i], &range[i + 1], in add_range_with_merge()
53 (nr_range - (i + 1)) * sizeof(range[i])); in add_range_with_merge()
54 range[nr_range - 1].start = 0; in add_range_with_merge()
55 range[nr_range - 1].end = 0; in add_range_with_merge()
61 return add_range(range, az, nr_range, start, end); in add_range_with_merge()
64 void subtract_range(struct range *range, int az, u64 start, u64 end) in subtract_range() argument
72 if (!range[j].end) in subtract_range()
75 if (start <= range[j].start && end >= range[j].end) { in subtract_range()
76 range[j].start = 0; in subtract_range()
77 range[j].end = 0; in subtract_range()
81 if (start <= range[j].start && end < range[j].end && in subtract_range()
82 range[j].start < end) { in subtract_range()
83 range[j].start = end; in subtract_range()
88 if (start > range[j].start && end >= range[j].end && in subtract_range()
89 range[j].end > start) { in subtract_range()
90 range[j].end = start; in subtract_range()
94 if (start > range[j].start && end < range[j].end) { in subtract_range()
97 if (range[i].end == 0) in subtract_range()
101 range[i].end = range[j].end; in subtract_range()
102 range[i].start = end; in subtract_range()
107 range[j].end = start; in subtract_range()
115 const struct range *r1 = x1; in cmp_range()
116 const struct range *r2 = x2; in cmp_range()
125 int clean_sort_range(struct range *range, int az) in clean_sort_range() argument
130 if (range[i].end) in clean_sort_range()
133 if (range[j].end) { in clean_sort_range()
140 range[i].start = range[k].start; in clean_sort_range()
141 range[i].end = range[k].end; in clean_sort_range()
142 range[k].start = 0; in clean_sort_range()
143 range[k].end = 0; in clean_sort_range()
148 if (!range[i].end) { in clean_sort_range()
155 sort(range, nr_range, sizeof(struct range), cmp_range, NULL); in clean_sort_range()
160 void sort_range(struct range *range, int nr_range) in sort_range() argument
163 sort(range, nr_range, sizeof(struct range), cmp_range, NULL); in sort_range()