1 // SPDX-License-Identifier: GPL-2.0
2 #include <linux/compiler.h>
3 #include <linux/zalloc.h>
13 static struct ins_ops
*arm__associate_instruction_ops(struct arch
*arch
, const char *name
)
15 struct arm_annotate
*arm
= arch
->priv
;
19 if (!regexec(&arm
->call_insn
, name
, 2, match
, 0))
21 else if (!regexec(&arm
->jump_insn
, name
, 2, match
, 0))
26 arch__associate_ins_ops(arch
, name
, ops
);
30 static int arm__annotate_init(struct arch
*arch
, char *cpuid __maybe_unused
)
32 struct arm_annotate
*arm
;
35 if (arch
->initialized
)
38 arm
= zalloc(sizeof(*arm
));
42 #define ARM_CONDS "(cc|cs|eq|ge|gt|hi|le|ls|lt|mi|ne|pl|vc|vs)"
43 err
= regcomp(&arm
->call_insn
, "^blx?" ARM_CONDS
"?$", REG_EXTENDED
);
46 err
= regcomp(&arm
->jump_insn
, "^bx?" ARM_CONDS
"?$", REG_EXTENDED
);
51 arch
->initialized
= true;
53 arch
->associate_instruction_ops
= arm__associate_instruction_ops
;
54 arch
->objdump
.comment_char
= ';';
55 arch
->objdump
.skip_functions_char
= '+';
59 regfree(&arm
->call_insn
);
62 return SYMBOL_ANNOTATE_ERRNO__ARCH_INIT_REGEXP
;