Lines Matching refs:range
51 util_range_set_empty(struct util_range *range) in util_range_set_empty() argument
53 range->start = ~0; in util_range_set_empty()
54 range->end = 0; in util_range_set_empty()
59 util_range_add(struct util_range *range, unsigned start, unsigned end) in util_range_add() argument
61 if (start < range->start || end > range->end) { in util_range_add()
62 mtx_lock(&range->write_mutex); in util_range_add()
63 range->start = MIN2(start, range->start); in util_range_add()
64 range->end = MAX2(end, range->end); in util_range_add()
65 mtx_unlock(&range->write_mutex); in util_range_add()
70 util_ranges_intersect(struct util_range *range, unsigned start, unsigned end) in util_ranges_intersect() argument
72 return MAX2(start, range->start) < MIN2(end, range->end); in util_ranges_intersect()
79 util_range_init(struct util_range *range) in util_range_init() argument
81 (void) mtx_init(&range->write_mutex, mtx_plain); in util_range_init()
82 util_range_set_empty(range); in util_range_init()
86 util_range_destroy(struct util_range *range) in util_range_destroy() argument
88 mtx_destroy(&range->write_mutex); in util_range_destroy()