]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - tools/objtool/check.h
objtool: Add ORC unwind table generation
[mirror_ubuntu-bionic-kernel.git] / tools / objtool / check.h
index da85f5b00ec687290952cce155f3f27ec9c3ffad..046874bbe22664a23968249774e6c475e0d0c660 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;
@@ -48,6 +50,7 @@ struct instruction {
        struct symbol *func;
        struct stack_op stack_op;
        struct insn_state state;
+       struct orc_entry orc;
 };
 
 struct objtool_file {
@@ -58,9 +61,19 @@ struct objtool_file {
        bool ignore_unreachables, c_file;
 };
 
-int check(const char *objname, bool nofp);
+int check(const char *objname, bool nofp, 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 */