Lines Matching defs:unit
132 * - unit, it corresponds to the MSR entry in the segment.
146 /* MSR_MTRRfix64K_00000, 1 unit. 64K fixed mtrr. */
178 * The size of unit is covered in one MSR, one MSR entry contains
179 * 8 ranges so that unit size is always 8 * 2^range_shift.
186 static bool fixed_msr_to_seg_unit(u32 msr, int *seg, int *unit)
191 *unit = 0;
195 *unit = array_index_nospec(
201 *unit = array_index_nospec(
212 static void fixed_mtrr_seg_unit_range(int seg, int unit, u64 *start, u64 *end)
217 *start = mtrr_seg->start + unit * unit_size;
222 static int fixed_mtrr_seg_unit_range_index(int seg, int unit)
226 WARN_ON(mtrr_seg->start + unit * fixed_mtrr_seg_unit_size(seg)
229 /* each unit has 8 ranges. */
230 return mtrr_seg->range_start + 8 * unit;
244 int seg, unit;
246 if (!fixed_msr_to_seg_unit(msr, &seg, &unit))
249 fixed_mtrr_seg_unit_range(seg, unit, start, end);
255 int seg, unit;
257 if (!fixed_msr_to_seg_unit(msr, &seg, &unit))
260 return fixed_mtrr_seg_unit_range_index(seg, unit);