Merge tag 'md/4.14-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/shli/md
[sfrench/cifs-2.6.git] / tools / objtool / check.h
index da85f5b00ec687290952cce155f3f27ec9c3ffad..47d9ea70a83d9f9326fb7bd68431c88337b5ce31 100644 (file)
 #include "elf.h"
 #include "cfi.h"
 #include "arch.h"
+#include "orc.h"
 #include <linux/hashtable.h>
 
 struct insn_state {
        struct cfi_reg cfa;
        struct cfi_reg regs[CFI_NUM_REGS];
        int stack_size;
+       unsigned char type;
        bool bp_scratch;
        bool drap;
-       int drap_reg;
+       int drap_reg, drap_offset;
+       struct cfi_reg vals[CFI_NUM_REGS];
 };
 
 struct instruction {
@@ -41,13 +44,14 @@ struct instruction {
        unsigned int len;
        unsigned char type;
        unsigned long immediate;
-       bool alt_group, visited, dead_end, ignore;
+       bool alt_group, visited, dead_end, ignore, hint, save, restore;
        struct symbol *call_dest;
        struct instruction *jump_dest;
        struct list_head alts;
        struct symbol *func;
        struct stack_op stack_op;
        struct insn_state state;
+       struct orc_entry orc;
 };
 
 struct objtool_file {
@@ -55,12 +59,22 @@ struct objtool_file {
        struct list_head insn_list;
        DECLARE_HASHTABLE(insn_hash, 16);
        struct section *rodata, *whitelist;
-       bool ignore_unreachables, c_file;
+       bool ignore_unreachables, c_file, hints;
 };
 
-int check(const char *objname, bool nofp);
+int check(const char *objname, bool no_fp, bool no_unreachable, bool orc);
+
+struct instruction *find_insn(struct objtool_file *file,
+                             struct section *sec, unsigned long offset);
 
 #define for_each_insn(file, insn)                                      \
        list_for_each_entry(insn, &file->insn_list, list)
 
+#define sec_for_each_insn(file, sec, insn)                             \
+       for (insn = find_insn(file, sec, 0);                            \
+            insn && &insn->list != &file->insn_list &&                 \
+                       insn->sec == sec;                               \
+            insn = list_next_entry(insn, list))
+
+
 #endif /* _CHECK_H */