Lines Matching defs:range
8 #include <linux/range.h>
10 int add_range(struct range *range, int az, int nr_range, u64 start, u64 end)
19 range[nr_range].start = start;
20 range[nr_range].end = end;
27 int add_range_with_merge(struct range *range, int az, int nr_range,
40 if (!range[i].end)
43 common_start = max(range[i].start, start);
44 common_end = min(range[i].end, end);
48 final_start = min(range[i].start, start);
49 final_end = max(range[i].end, end);
51 range[i].start = final_start;
52 range[i].end = final_end;
57 return add_range(range, az, nr_range, start, end);
60 void subtract_range(struct range *range, int az, u64 start, u64 end)
68 if (!range[j].end)
71 if (start <= range[j].start && end >= range[j].end) {
72 range[j].start = 0;
73 range[j].end = 0;
77 if (start <= range[j].start && end < range[j].end &&
78 range[j].start < end) {
79 range[j].start = end;
84 if (start > range[j].start && end >= range[j].end &&
85 range[j].end > start) {
86 range[j].end = start;
90 if (start > range[j].start && end < range[j].end) {
93 if (range[i].end == 0)
97 range[i].end = range[j].end;
98 range[i].start = end;
102 range[j].end = start;
110 const struct range *r1 = x1;
111 const struct range *r2 = x2;
120 int clean_sort_range(struct range *range, int az)
125 if (range[i].end)
128 if (range[j].end) {
135 range[i].start = range[k].start;
136 range[i].end = range[k].end;
137 range[k].start = 0;
138 range[k].end = 0;
143 if (!range[i].end) {
150 sort(range, nr_range, sizeof(struct range), cmp_range, NULL);
155 void sort_range(struct range *range, int nr_range)
158 sort(range, nr_range, sizeof(struct range), cmp_range, NULL);