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
,
42 enum op_dest_type type
;
58 enum op_src_type type
;
66 struct list_head list
;
71 void arch_initial_func_cfi_state(struct cfi_init_state
*state
);
73 int arch_decode_instruction(const struct elf
*elf
, const struct section
*sec
,
74 unsigned long offset
, unsigned int maxlen
,
75 unsigned int *len
, enum insn_type
*type
,
76 unsigned long *immediate
,
77 struct list_head
*ops_list
);
79 bool arch_callee_saved_reg(unsigned char reg
);
81 unsigned long arch_jump_destination(struct instruction
*insn
);
83 unsigned long arch_dest_reloc_offset(int addend
);
85 const char *arch_nop_insn(int len
);
86 const char *arch_ret_insn(int len
);
88 int arch_decode_hint_reg(u8 sp_reg
, int *base
);
90 bool arch_is_retpoline(struct symbol
*sym
);
91 bool arch_is_rethunk(struct symbol
*sym
);
93 int arch_rewrite_retpolines(struct objtool_file
*file
);