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
,
41 enum op_dest_type type
;
57 enum op_src_type type
;
65 struct list_head list
;
70 void arch_initial_func_cfi_state(struct cfi_init_state
*state
);
72 int arch_decode_instruction(const struct elf
*elf
, const struct section
*sec
,
73 unsigned long offset
, unsigned int maxlen
,
74 unsigned int *len
, enum insn_type
*type
,
75 unsigned long *immediate
,
76 struct list_head
*ops_list
);
78 bool arch_callee_saved_reg(unsigned char reg
);
80 unsigned long arch_jump_destination(struct instruction
*insn
);
82 unsigned long arch_dest_reloc_offset(int addend
);
84 const char *arch_nop_insn(int len
);
86 int arch_decode_hint_reg(struct instruction
*insn
, u8 sp_reg
);
88 bool arch_is_retpoline(struct symbol
*sym
);
90 int arch_rewrite_retpolines(struct objtool_file
*file
);