Lines Matching refs:range

12 int add_range(struct range *range, int az, int nr_range, u64 start, u64 end)  in add_range()  argument
21 range[nr_range].start = start; in add_range()
22 range[nr_range].end = end; in add_range()
29 int add_range_with_merge(struct range *range, int az, int nr_range, in add_range_with_merge() argument
41 if (!range[i].end) in add_range_with_merge()
44 common_start = max(range[i].start, start); in add_range_with_merge()
45 common_end = min(range[i].end, end); in add_range_with_merge()
50 start = min(range[i].start, start); in add_range_with_merge()
51 end = max(range[i].end, end); in add_range_with_merge()
53 memmove(&range[i], &range[i + 1], in add_range_with_merge()
54 (nr_range - (i + 1)) * sizeof(range[i])); in add_range_with_merge()
55 range[nr_range - 1].start = 0; in add_range_with_merge()
56 range[nr_range - 1].end = 0; in add_range_with_merge()
62 return add_range(range, az, nr_range, start, end); in add_range_with_merge()
65 void subtract_range(struct range *range, int az, u64 start, u64 end) in subtract_range() argument
73 if (!range[j].end) in subtract_range()
76 if (start <= range[j].start && end >= range[j].end) { in subtract_range()
77 range[j].start = 0; in subtract_range()
78 range[j].end = 0; in subtract_range()
82 if (start <= range[j].start && end < range[j].end && in subtract_range()
83 range[j].start < end) { in subtract_range()
84 range[j].start = end; in subtract_range()
89 if (start > range[j].start && end >= range[j].end && in subtract_range()
90 range[j].end > start) { in subtract_range()
91 range[j].end = start; in subtract_range()
95 if (start > range[j].start && end < range[j].end) { in subtract_range()
98 if (range[i].end == 0) in subtract_range()
102 range[i].end = range[j].end; in subtract_range()
103 range[i].start = end; in subtract_range()
108 range[j].end = start; in subtract_range()
116 const struct range *r1 = x1; in cmp_range()
117 const struct range *r2 = x2; in cmp_range()
126 int clean_sort_range(struct range *range, int az) in clean_sort_range() argument
131 if (range[i].end) in clean_sort_range()
134 if (range[j].end) { in clean_sort_range()
141 range[i].start = range[k].start; in clean_sort_range()
142 range[i].end = range[k].end; in clean_sort_range()
143 range[k].start = 0; in clean_sort_range()
144 range[k].end = 0; in clean_sort_range()
149 if (!range[i].end) { in clean_sort_range()
156 sort(range, nr_range, sizeof(struct range), cmp_range, NULL); in clean_sort_range()
161 void sort_range(struct range *range, int nr_range) in sort_range() argument
164 sort(range, nr_range, sizeof(struct range), cmp_range, NULL); in sort_range()