1 /* SPDX-License-Identifier: GPL-2.0-or-later */
3 * Copyright (C) 2015 Josh Poimboeuf <jpoimboe@redhat.com>
10 #include <linux/list.h>
11 #include <objtool/objtool.h>
12 #include <objtool/cfi.h>
15 INSN_JUMP_CONDITIONAL,
16 INSN_JUMP_UNCONDITIONAL,
18 INSN_JUMP_DYNAMIC_CONDITIONAL,
43 enum op_dest_type type;
59 enum op_src_type type;
67 struct list_head list;
72 void arch_initial_func_cfi_state(struct cfi_init_state *state);
74 int arch_decode_instruction(struct objtool_file *file, const struct section *sec,
75 unsigned long offset, unsigned int maxlen,
76 unsigned int *len, enum insn_type *type,
77 unsigned long *immediate,
78 struct list_head *ops_list);
80 bool arch_callee_saved_reg(unsigned char reg);
82 unsigned long arch_jump_destination(struct instruction *insn);
84 unsigned long arch_dest_reloc_offset(int addend);
86 const char *arch_nop_insn(int len);
87 const char *arch_ret_insn(int len);
89 int arch_decode_hint_reg(u8 sp_reg, int *base);
91 bool arch_is_retpoline(struct symbol *sym);
92 bool arch_is_rethunk(struct symbol *sym);
93 bool arch_is_embedded_insn(struct symbol *sym);
95 int arch_rewrite_retpolines(struct objtool_file *file);