Lines Matching defs:obj

46 	u32 obj;
50 obj = find_next_zero_bit(bitmap->table, bitmap->max, bitmap->last);
51 if (obj >= bitmap->max) {
54 obj = find_first_zero_bit(bitmap->table, bitmap->max);
57 if (obj < bitmap->max) {
58 set_bit(obj, bitmap->table);
59 bitmap->last = (obj + 1);
62 obj |= bitmap->top;
64 obj = -1;
66 if (obj != -1)
71 return obj;
74 void mlx4_bitmap_free(struct mlx4_bitmap *bitmap, u32 obj, int use_rr)
76 mlx4_bitmap_free_range(bitmap, obj, 1, use_rr);
112 u32 obj;
119 obj = find_aligned_range(bitmap->table, bitmap->last,
121 if (obj >= bitmap->max) {
124 obj = find_aligned_range(bitmap->table, 0, bitmap->max,
128 if (obj < bitmap->max) {
129 bitmap_set(bitmap->table, obj, cnt);
130 if (obj == bitmap->last) {
131 bitmap->last = (obj + cnt);
135 obj |= bitmap->top;
137 obj = -1;
139 if (obj != -1)
144 return obj;
152 static u32 mlx4_bitmap_masked_value(struct mlx4_bitmap *bitmap, u32 obj)
154 return obj & (bitmap->max + bitmap->reserved_top - 1);
157 void mlx4_bitmap_free_range(struct mlx4_bitmap *bitmap, u32 obj, int cnt,
160 obj &= bitmap->max + bitmap->reserved_top - 1;
164 bitmap->last = min(bitmap->last, obj);
168 bitmap_clear(bitmap->table, obj, cnt);
418 static void __mlx4_free_from_zone(struct mlx4_zone_entry *zone, u32 obj,
421 mlx4_bitmap_free_range(zone->bitmap, obj - zone->offset, count, zone->use_rr);
479 struct mlx4_zone_allocator *zones, u32 obj)
484 /* Search for the smallest zone that this obj could be
491 if (obj >= zone->offset) {
492 u32 mobj = (obj - zone->offset) & zones->mask;
529 u32 mlx4_zone_free_entries(struct mlx4_zone_allocator *zones, u32 uid, u32 obj, u32 count)
543 __mlx4_free_from_zone(zone, obj, count);
551 u32 mlx4_zone_free_entries_unique(struct mlx4_zone_allocator *zones, u32 obj, u32 count)
561 zone = __mlx4_find_zone_by_uid_unique(zones, obj);
568 __mlx4_free_from_zone(zone, obj, count);