1 // SPDX-License-Identifier: GPL-2.0
2 #include <linux/compiler.h>
11 static struct ins_ops *arm__associate_instruction_ops(struct arch *arch, const char *name)
13 struct arm_annotate *arm = arch->priv;
17 if (!regexec(&arm->call_insn, name, 2, match, 0))
19 else if (!regexec(&arm->jump_insn, name, 2, match, 0))
24 arch__associate_ins_ops(arch, name, ops);
28 static int arm__annotate_init(struct arch *arch, char *cpuid __maybe_unused)
30 struct arm_annotate *arm;
33 if (arch->initialized)
36 arm = zalloc(sizeof(*arm));
40 #define ARM_CONDS "(cc|cs|eq|ge|gt|hi|le|ls|lt|mi|ne|pl|vc|vs)"
41 err = regcomp(&arm->call_insn, "^blx?" ARM_CONDS "?$", REG_EXTENDED);
44 err = regcomp(&arm->jump_insn, "^bx?" ARM_CONDS "?$", REG_EXTENDED);
49 arch->initialized = true;
51 arch->associate_instruction_ops = arm__associate_instruction_ops;
52 arch->objdump.comment_char = ';';
53 arch->objdump.skip_functions_char = '+';
57 regfree(&arm->call_insn);