Path: blob/master/tools/perf/arch/mips/annotate/instructions.c
26289 views
// SPDX-License-Identifier: GPL-2.012static3struct ins_ops *mips__associate_ins_ops(struct arch *arch, const char *name)4{5struct ins_ops *ops = NULL;67if (!strncmp(name, "bal", 3) ||8!strncmp(name, "bgezal", 6) ||9!strncmp(name, "bltzal", 6) ||10!strncmp(name, "bgtzal", 6) ||11!strncmp(name, "blezal", 6) ||12!strncmp(name, "beqzal", 6) ||13!strncmp(name, "bnezal", 6) ||14!strncmp(name, "bgtzl", 5) ||15!strncmp(name, "bltzl", 5) ||16!strncmp(name, "bgezl", 5) ||17!strncmp(name, "blezl", 5) ||18!strncmp(name, "jialc", 5) ||19!strncmp(name, "beql", 4) ||20!strncmp(name, "bnel", 4) ||21!strncmp(name, "jal", 3))22ops = &call_ops;23else if (!strncmp(name, "jr", 2))24ops = &ret_ops;25else if (name[0] == 'j' || name[0] == 'b')26ops = &jump_ops;27else28return NULL;2930arch__associate_ins_ops(arch, name, ops);3132return ops;33}3435static36int mips__annotate_init(struct arch *arch, char *cpuid __maybe_unused)37{38if (!arch->initialized) {39arch->associate_instruction_ops = mips__associate_ins_ops;40arch->initialized = true;41arch->objdump.comment_char = '#';42arch->e_machine = EM_MIPS;43arch->e_flags = 0;44}4546return 0;47}484950