Lines Matching defs:unit
140 * - unit, it corresponds to the MSR entry in the segment.
154 /* MSR_MTRRfix64K_00000, 1 unit. 64K fixed mtrr. */
186 * The size of unit is covered in one MSR, one MSR entry contains
187 * 8 ranges so that unit size is always 8 * 2^range_shift.
194 static bool fixed_msr_to_seg_unit(u32 msr, int *seg, int *unit)
199 *unit = 0;
203 *unit = array_index_nospec(
209 *unit = array_index_nospec(
220 static void fixed_mtrr_seg_unit_range(int seg, int unit, u64 *start, u64 *end)
225 *start = mtrr_seg->start + unit * unit_size;
230 static int fixed_mtrr_seg_unit_range_index(int seg, int unit)
234 WARN_ON(mtrr_seg->start + unit * fixed_mtrr_seg_unit_size(seg)
237 /* each unit has 8 ranges. */
238 return mtrr_seg->range_start + 8 * unit;
252 int seg, unit;
254 if (!fixed_msr_to_seg_unit(msr, &seg, &unit))
257 fixed_mtrr_seg_unit_range(seg, unit, start, end);
263 int seg, unit;
265 if (!fixed_msr_to_seg_unit(msr, &seg, &unit))
268 return fixed_mtrr_seg_unit_range_index(seg, unit);