Lines Matching refs:seg

177 static u64 fixed_mtrr_seg_unit_size(int seg)  in fixed_mtrr_seg_unit_size()  argument
179 return 8 << fixed_seg_table[seg].range_shift; in fixed_mtrr_seg_unit_size()
182 static bool fixed_msr_to_seg_unit(u32 msr, int *seg, int *unit) in fixed_msr_to_seg_unit() argument
186 *seg = 0; in fixed_msr_to_seg_unit()
190 *seg = 1; in fixed_msr_to_seg_unit()
196 *seg = 2; in fixed_msr_to_seg_unit()
208 static void fixed_mtrr_seg_unit_range(int seg, int unit, u64 *start, u64 *end) in fixed_mtrr_seg_unit_range() argument
210 struct fixed_mtrr_segment *mtrr_seg = &fixed_seg_table[seg]; in fixed_mtrr_seg_unit_range()
211 u64 unit_size = fixed_mtrr_seg_unit_size(seg); in fixed_mtrr_seg_unit_range()
218 static int fixed_mtrr_seg_unit_range_index(int seg, int unit) in fixed_mtrr_seg_unit_range_index() argument
220 struct fixed_mtrr_segment *mtrr_seg = &fixed_seg_table[seg]; in fixed_mtrr_seg_unit_range_index()
222 WARN_ON(mtrr_seg->start + unit * fixed_mtrr_seg_unit_size(seg) in fixed_mtrr_seg_unit_range_index()
229 static int fixed_mtrr_seg_end_range_index(int seg) in fixed_mtrr_seg_end_range_index() argument
231 struct fixed_mtrr_segment *mtrr_seg = &fixed_seg_table[seg]; in fixed_mtrr_seg_end_range_index()
240 int seg, unit; in fixed_msr_to_range() local
242 if (!fixed_msr_to_seg_unit(msr, &seg, &unit)) in fixed_msr_to_range()
245 fixed_mtrr_seg_unit_range(seg, unit, start, end); in fixed_msr_to_range()
251 int seg, unit; in fixed_msr_to_range_index() local
253 if (!fixed_msr_to_seg_unit(msr, &seg, &unit)) in fixed_msr_to_range_index()
256 return fixed_mtrr_seg_unit_range_index(seg, unit); in fixed_msr_to_range_index()
262 int seg, seg_num = ARRAY_SIZE(fixed_seg_table); in fixed_mtrr_addr_to_seg() local
264 for (seg = 0; seg < seg_num; seg++) { in fixed_mtrr_addr_to_seg()
265 mtrr_seg = &fixed_seg_table[seg]; in fixed_mtrr_addr_to_seg()
267 return seg; in fixed_mtrr_addr_to_seg()
273 static int fixed_mtrr_addr_seg_to_range_index(u64 addr, int seg) in fixed_mtrr_addr_seg_to_range_index() argument
278 mtrr_seg = &fixed_seg_table[seg]; in fixed_mtrr_addr_seg_to_range_index()
284 static u64 fixed_mtrr_range_end_addr(int seg, int index) in fixed_mtrr_range_end_addr() argument
286 struct fixed_mtrr_segment *mtrr_seg = &fixed_seg_table[seg]; in fixed_mtrr_range_end_addr()
458 int seg; member
474 int seg, index; in mtrr_lookup_fixed_start() local
479 seg = fixed_mtrr_addr_to_seg(iter->start); in mtrr_lookup_fixed_start()
480 if (seg < 0) in mtrr_lookup_fixed_start()
484 index = fixed_mtrr_addr_seg_to_range_index(iter->start, seg); in mtrr_lookup_fixed_start()
486 iter->seg = seg; in mtrr_lookup_fixed_start()
541 if (fixed_mtrr_range_end_addr(iter->seg, iter->index) >= iter->end) { in mtrr_lookup_fixed_next()
554 if (iter->index > fixed_mtrr_seg_end_range_index(iter->seg)) in mtrr_lookup_fixed_next()
555 iter->seg++; in mtrr_lookup_fixed_next()