Lines Matching refs:tbl
56 struct pvrdma_id_table *tbl = &dev->uar_table.tbl;
61 tbl->last = 0;
62 tbl->top = 0;
63 tbl->max = num;
64 tbl->mask = mask;
65 spin_lock_init(&tbl->lock);
66 tbl->table = bitmap_zalloc(num, GFP_KERNEL);
67 if (!tbl->table)
71 __set_bit(0, tbl->table);
78 struct pvrdma_id_table *tbl = &dev->uar_table.tbl;
80 bitmap_free(tbl->table);
85 struct pvrdma_id_table *tbl;
89 tbl = &dev->uar_table.tbl;
91 spin_lock_irqsave(&tbl->lock, flags);
92 obj = find_next_zero_bit(tbl->table, tbl->max, tbl->last);
93 if (obj >= tbl->max) {
94 tbl->top = (tbl->top + tbl->max) & tbl->mask;
95 obj = find_first_zero_bit(tbl->table, tbl->max);
98 if (obj >= tbl->max) {
99 spin_unlock_irqrestore(&tbl->lock, flags);
103 __set_bit(obj, tbl->table);
104 obj |= tbl->top;
106 spin_unlock_irqrestore(&tbl->lock, flags);
117 struct pvrdma_id_table *tbl = &dev->uar_table.tbl;
121 obj = uar->index & (tbl->max - 1);
122 spin_lock_irqsave(&tbl->lock, flags);
123 __clear_bit(obj, tbl->table);
124 tbl->last = min(tbl->last, obj);
125 tbl->top = (tbl->top + tbl->max) & tbl->mask;
126 spin_unlock_irqrestore(&tbl->lock, flags);