Lines Matching refs:ins
77 struct ins *instructions;
105 struct ins *new_instructions; in arch__grow_instructions()
112 new_instructions = realloc(arch->instructions, new_nr_allocated * sizeof(struct ins)); in arch__grow_instructions()
123 new_instructions = calloc(new_nr_allocated, sizeof(struct ins)); in arch__grow_instructions()
133 struct ins *ins; in arch__associate_ins_ops() local
139 ins = &arch->instructions[arch->nr_instructions]; in arch__associate_ins_ops()
140 ins->name = strdup(name); in arch__associate_ins_ops()
141 if (!ins->name) in arch__associate_ins_ops()
144 ins->ops = ops; in arch__associate_ins_ops()
217 static int ins__raw_scnprintf(struct ins *ins, char *bf, size_t size, in ins__raw_scnprintf() argument
220 return scnprintf(bf, size, "%-*s %s", max_ins_name, ins->name, ops->raw); in ins__raw_scnprintf()
223 int ins__scnprintf(struct ins *ins, char *bf, size_t size, in ins__scnprintf() argument
226 if (ins->ops->scnprintf) in ins__scnprintf()
227 return ins->ops->scnprintf(ins, bf, size, ops, max_ins_name); in ins__scnprintf()
229 return ins__raw_scnprintf(ins, bf, size, ops, max_ins_name); in ins__scnprintf()
292 static int call__scnprintf(struct ins *ins, char *bf, size_t size, in call__scnprintf() argument
296 return scnprintf(bf, size, "%-*s %s", max_ins_name, ins->name, ops->target.sym->name); in call__scnprintf()
299 return ins__raw_scnprintf(ins, bf, size, ops, max_ins_name); in call__scnprintf()
302 return scnprintf(bf, size, "%-*s %s", max_ins_name, ins->name, ops->target.name); in call__scnprintf()
304 return scnprintf(bf, size, "%-*s *%" PRIx64, max_ins_name, ins->name, ops->target.addr); in call__scnprintf()
312 bool ins__is_call(const struct ins *ins) in ins__is_call() argument
314 return ins->ops == &call_ops || ins->ops == &s390_call_ops; in ins__is_call()
415 static int jump__scnprintf(struct ins *ins, char *bf, size_t size, in jump__scnprintf() argument
421 return ins__raw_scnprintf(ins, bf, size, ops, max_ins_name); in jump__scnprintf()
424 return scnprintf(bf, size, "%-*s %s", max_ins_name, ins->name, ops->target.sym->name); in jump__scnprintf()
444 ins->name, c ? c - ops->raw : 0, ops->raw, in jump__scnprintf()
453 bool ins__is_jump(const struct ins *ins) in ins__is_jump() argument
455 return ins->ops == &jump_ops; in ins__is_jump()
491 if (disasm_line__parse(ops->raw, &ops->locked.ins.name, &ops->locked.ops->raw) < 0) in lock__parse()
494 ops->locked.ins.ops = ins__find(arch, ops->locked.ins.name); in lock__parse()
496 if (ops->locked.ins.ops == NULL) in lock__parse()
499 if (ops->locked.ins.ops->parse && in lock__parse()
500 ops->locked.ins.ops->parse(arch, ops->locked.ops, ms) < 0) in lock__parse()
510 static int lock__scnprintf(struct ins *ins, char *bf, size_t size, in lock__scnprintf() argument
515 if (ops->locked.ins.ops == NULL) in lock__scnprintf()
516 return ins__raw_scnprintf(ins, bf, size, ops, max_ins_name); in lock__scnprintf()
518 printed = scnprintf(bf, size, "%-*s ", max_ins_name, ins->name); in lock__scnprintf()
519 return printed + ins__scnprintf(&ops->locked.ins, bf + printed, in lock__scnprintf()
525 struct ins *ins = &ops->locked.ins; in lock__delete() local
527 if (ins->ops && ins->ops->free) in lock__delete()
528 ins->ops->free(ops->locked.ops); in lock__delete()
591 static int mov__scnprintf(struct ins *ins, char *bf, size_t size, in mov__scnprintf() argument
594 return scnprintf(bf, size, "%-*s %s,%s", max_ins_name, ins->name, in mov__scnprintf()
631 static int dec__scnprintf(struct ins *ins, char *bf, size_t size, in dec__scnprintf() argument
634 return scnprintf(bf, size, "%-*s %s", max_ins_name, ins->name, in dec__scnprintf()
643 static int nop__scnprintf(struct ins *ins __maybe_unused, char *bf, size_t size, in nop__scnprintf()
657 bool ins__is_ret(const struct ins *ins) in ins__is_ret() argument
659 return ins->ops == &ret_ops; in ins__is_ret()
662 bool ins__is_lock(const struct ins *ins) in ins__is_lock() argument
664 return ins->ops == &lock_ops; in ins__is_lock()
669 const struct ins *ins = insp; in ins__key_cmp() local
671 return strcmp(name, ins->name); in ins__key_cmp()
676 const struct ins *ia = a; in ins__cmp()
677 const struct ins *ib = b; in ins__cmp()
686 qsort(arch->instructions, nmemb, sizeof(struct ins), ins__cmp); in ins__sort()
691 struct ins *ins; in __ins__find() local
699 ins = bsearch(name, arch->instructions, nmemb, sizeof(struct ins), ins__key_cmp); in __ins__find()
700 return ins ? ins->ops : NULL; in __ins__find()
1115 dl->ins.ops = ins__find(arch, dl->ins.name); in disasm_line__init_ins()
1117 if (!dl->ins.ops) in disasm_line__init_ins()
1120 if (dl->ins.ops->parse && dl->ins.ops->parse(arch, &dl->ops, ms) < 0) in disasm_line__init_ins()
1121 dl->ins.ops = NULL; in disasm_line__init_ins()
1213 if (disasm_line__parse(dl->al.line, &dl->ins.name, &dl->ops.raw) < 0) in disasm_line__new()
1230 if (dl->ins.ops && dl->ins.ops->free) in disasm_line__free()
1231 dl->ins.ops->free(&dl->ops); in disasm_line__free()
1234 zfree(&dl->ins.name); in disasm_line__free()
1241 if (raw || !dl->ins.ops) in disasm_line__scnprintf()
1242 return scnprintf(bf, size, "%-*s %s", max_ins_name, dl->ins.name, dl->ops.raw); in disasm_line__scnprintf()
1244 return ins__scnprintf(&dl->ins, bf, size, &dl->ops, max_ins_name); in disasm_line__scnprintf()
1527 if (dl->ins.ops && ins__is_call(&dl->ins) && !dl->ops.target.sym) { in symbol__parse_objdump_line()
1557 if (dl->ins.ops) { in delete_last_nop()
1558 if (dl->ins.ops != &nop_ops) in delete_last_nop()
2590 printed = fprintf(fp, "%#" PRIx64 " %s", dl->al.offset, dl->ins.name); in disasm_line__fprintf()
2613 if (!dl || !dl->ins.ops || !ins__is_jump(&dl->ins) || in disasm_line__is_valid_local_jump()
2700 len = strlen(disasm_line(al)->ins.name); in annotation__max_ins_name()
2854 if (dl->ins.ops && dl->ins.ops->scnprintf) { in disasm_line__write()
2855 if (ins__is_jump(&dl->ins)) { in disasm_line__write()
2863 } else if (ins__is_call(&dl->ins)) { in disasm_line__write()
2867 } else if (ins__is_ret(&dl->ins)) { in disasm_line__write()
3034 } else if (ins__is_call(&disasm_line(al)->ins) && in __annotation_line__write()