Lines Matching refs:t
563 static void table_offset_add(struct table *t, struct offset *offset) in table_offset_add() argument
565 list_add_tail(&offset->list, &t->offsets); in table_offset_add()
568 static void table_init(struct table *t) in table_init() argument
570 INIT_LIST_HEAD(&t->offsets); in table_init()
571 t->offset_max = 0; in table_init()
572 t->nentry = 0; in table_init()
573 t->table = NULL; in table_init()
576 static void table_print(struct table *t) in table_print() argument
580 nlloop = (t->nentry + 3) / 4; in table_print()
581 c = t->nentry; in table_print()
582 printf("static const unsigned %s_reg_safe_bm[%d] = {\n", t->gpu_prefix, in table_print()
583 t->nentry); in table_print()
594 printf("0x%08X,", t->table[id++]); in table_print()
601 static int table_build(struct table *t) in table_build() argument
606 t->nentry = ((t->offset_max >> 2) + 31) / 32; in table_build()
607 t->table = (unsigned *)malloc(sizeof(unsigned) * t->nentry); in table_build()
608 if (t->table == NULL) in table_build()
610 memset(t->table, 0xff, sizeof(unsigned) * t->nentry); in table_build()
611 list_for_each_entry(offset, &t->offsets, list) { in table_build()
615 t->table[i] ^= m; in table_build()
621 static int parser_auth(struct table *t, const char *filename) in parser_auth() argument
659 t->gpu_prefix = gpu_name; in parser_auth()
685 table_offset_add(t, offset); in parser_auth()
686 if (o > t->offset_max) in parser_auth()
687 t->offset_max = o; in parser_auth()
692 if (t->offset_max < last_reg) in parser_auth()
693 t->offset_max = last_reg; in parser_auth()
694 return table_build(t); in parser_auth()
699 struct table t; in main() local
705 table_init(&t); in main()
706 if (parser_auth(&t, argv[1])) { in main()
710 table_print(&t); in main()