Path: blob/master/tools/perf/arch/riscv64/annotate/instructions.c
26295 views
// SPDX-License-Identifier: GPL-2.012static3struct ins_ops *riscv64__associate_ins_ops(struct arch *arch, const char *name)4{5struct ins_ops *ops = NULL;67if (!strncmp(name, "jal", 3) ||8!strncmp(name, "jr", 2) ||9!strncmp(name, "call", 4))10ops = &call_ops;11else if (!strncmp(name, "ret", 3))12ops = &ret_ops;13else if (name[0] == 'j' || name[0] == 'b')14ops = &jump_ops;15else16return NULL;1718arch__associate_ins_ops(arch, name, ops);1920return ops;21}2223static24int riscv64__annotate_init(struct arch *arch, char *cpuid __maybe_unused)25{26if (!arch->initialized) {27arch->associate_instruction_ops = riscv64__associate_ins_ops;28arch->initialized = true;29arch->objdump.comment_char = '#';30arch->e_machine = EM_RISCV;31arch->e_flags = 0;32}3334return 0;35}363738