Lines Matching defs:range
28 #include <linux/range.h>
54 static struct range __initdata range[RANGE_NUM];
66 x86_get_mtrr_mem_range(struct range *range, int nr_range,
80 nr_range = add_range_with_merge(range, RANGE_NUM, nr_range,
87 range[i].start, range[i].end);
109 subtract_range(range, RANGE_NUM, base, base + size);
112 subtract_range(range, RANGE_NUM, extra_remove_base,
118 if (!range[i].end)
121 range[i].start, range[i].end);
126 nr_range = clean_sort_range(range, RANGE_NUM);
131 range[i].start, range[i].end);
139 static unsigned long __init sum_ranges(struct range *range, int nr_range)
145 sum += range[i].end - range[i].start;
259 /* Compute the maximum size with which we can make a range: */
278 "base: %ld%cB, range: %ld%cB, type %s\n",
386 /* Need to handle left over range: */
389 Dprintk("range: %016lx - %016lx\n",
422 /* See if I can merge with the last range: */
429 /* Write the range mtrrs: */
474 x86_setup_var_mtrrs(struct range *range, int nr_range,
489 /* Write the range: */
491 set_var_mtrr_range(&var_state, range[i].start,
492 range[i].end - range[i].start);
495 /* Write the last range: */
546 printk(KERN_DEBUG "reg %d, base: %ld%cB, range: %ld%cB, type %s\n",
595 static struct range range_new[RANGE_NUM];
601 num_reg = x86_setup_var_mtrrs(range, nr_range, chunk_size, gran_size);
622 if (nr_range_new != nr_range || memcmp(range, range_new, sizeof(range)))
711 memset(range, 0, sizeof(range));
717 nr_range = x86_get_mtrr_mem_range(range, 0, x_remove_base, x_remove_size);
722 nr_range = add_range_with_merge(range, RANGE_NUM, nr_range, 0,
725 sort_range(range, nr_range);
727 range_sums = sum_ranges(range, nr_range);
783 x86_setup_var_mtrrs(range, nr_range, chunk_size, gran_size);
938 memset(range, 0, sizeof(range));
941 range[nr_range].start = (1ULL<<(32 - PAGE_SHIFT));
942 range[nr_range].end = mtrr_tom2 >> PAGE_SHIFT;
943 if (highest_pfn < range[nr_range].end)
944 highest_pfn = range[nr_range].end;
947 nr_range = x86_get_mtrr_mem_range(range, nr_range, 0, 0);
951 if (range[0].start)
952 total_trim_size += real_trim_memory(0, range[0].start);
956 if (range[i].end < range[i+1].start)
957 total_trim_size += real_trim_memory(range[i].end,
958 range[i+1].start);
963 if (range[i].end < end_pfn)
964 total_trim_size += real_trim_memory(range[i].end,