Lines Matching refs:ftr
23 FTR_END, /* Mark the last ftr bits */
238 /* Return a safe value to a given ftr_bits an ftr value */
239 uint64_t get_safe_value(const struct reg_ftr_bits *ftr_bits, uint64_t ftr)
246 ftr = ftr_bits->safe_val;
249 if (ftr > ftr_bits->safe_val)
250 ftr--;
253 if (ftr < ftr_max)
254 ftr++;
257 if (ftr == ftr_max)
258 ftr = 0;
259 else if (ftr != 0)
260 ftr++;
265 } else if (ftr != ftr_max) {
268 ftr = ftr_bits->safe_val;
271 if (ftr > ftr_bits->safe_val)
272 ftr--;
275 if (ftr < ftr_max - 1)
276 ftr++;
279 if (ftr != 0 && ftr != ftr_max - 1)
280 ftr++;
287 return ftr;
290 /* Return an invalid value to a given ftr_bits an ftr value */
291 uint64_t get_invalid_value(const struct reg_ftr_bits *ftr_bits, uint64_t ftr)
298 ftr = max((uint64_t)ftr_bits->safe_val + 1, ftr + 1);
301 ftr++;
304 ftr--;
307 if (ftr == 0)
308 ftr = ftr_max;
310 ftr--;
315 } else if (ftr != ftr_max) {
318 ftr = max((uint64_t)ftr_bits->safe_val + 1, ftr + 1);
321 ftr++;
324 ftr--;
327 if (ftr == 0)
328 ftr = ftr_max - 1;
330 ftr--;
336 ftr = 0;
339 return ftr;
347 uint64_t val, new_val, ftr;
350 ftr = (val & mask) >> shift;
352 ftr = get_safe_value(ftr_bits, ftr);
354 ftr <<= shift;
356 val |= ftr;
370 uint64_t val, old_val, ftr;
374 ftr = (val & mask) >> shift;
376 ftr = get_invalid_value(ftr_bits, ftr);
379 ftr <<= shift;
381 val |= ftr;