Lines Matching refs:t

131 static void table_offset_add(struct table *t, struct offset *offset)  in table_offset_add()  argument
133 list_add_tail(&offset->list, &t->offsets); in table_offset_add()
136 static void table_init(struct table *t) in table_init() argument
138 INIT_LIST_HEAD(&t->offsets); in table_init()
139 t->offset_max = 0; in table_init()
140 t->nentry = 0; in table_init()
141 t->table = NULL; in table_init()
144 static void table_print(struct table *t) in table_print() argument
148 nlloop = (t->nentry + 3) / 4; in table_print()
149 c = t->nentry; in table_print()
150 printf("static const unsigned %s_reg_safe_bm[%d] = {\n", t->gpu_prefix, in table_print()
151 t->nentry); in table_print()
162 printf("0x%08X,", t->table[id++]); in table_print()
169 static int table_build(struct table *t) in table_build() argument
174 t->nentry = ((t->offset_max >> 2) + 31) / 32; in table_build()
175 t->table = (unsigned *)malloc(sizeof(unsigned) * t->nentry); in table_build()
176 if (t->table == NULL) in table_build()
178 memset(t->table, 0xff, sizeof(unsigned) * t->nentry); in table_build()
179 list_for_each_entry(offset, &t->offsets, list) { in table_build()
183 t->table[i] ^= m; in table_build()
189 static int parser_auth(struct table *t, const char *filename) in parser_auth() argument
227 t->gpu_prefix = gpu_name; in parser_auth()
253 table_offset_add(t, offset); in parser_auth()
254 if (o > t->offset_max) in parser_auth()
255 t->offset_max = o; in parser_auth()
260 if (t->offset_max < last_reg) in parser_auth()
261 t->offset_max = last_reg; in parser_auth()
262 return table_build(t); in parser_auth()
267 struct table t; in main() local
273 table_init(&t); in main()
274 if (parser_auth(&t, argv[1])) { in main()
278 table_print(&t); in main()