mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-28 11:18:45 +07:00
d37c90d47f
The objtool_file structure describes the files objtool works on, is used by the check subcommand, and the check.h header is included by the orc subcommands so it's presently used by all subcommands. Since the structure will be useful in all subcommands besides check, and some subcommands may not want to include check.h to get the definition, split the structure out into a new header meant for use by all objtool subcommands. Signed-off-by: Matt Helsley <mhelsley@vmware.com> Reviewed-by: Julien Thierry <jthierry@redhat.com> Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
66 lines
1.4 KiB
C
66 lines
1.4 KiB
C
/* SPDX-License-Identifier: GPL-2.0-or-later */
|
|
/*
|
|
* Copyright (C) 2017 Josh Poimboeuf <jpoimboe@redhat.com>
|
|
*/
|
|
|
|
#ifndef _CHECK_H
|
|
#define _CHECK_H
|
|
|
|
#include <stdbool.h>
|
|
#include "objtool.h"
|
|
#include "cfi.h"
|
|
#include "arch.h"
|
|
#include "orc.h"
|
|
|
|
struct insn_state {
|
|
struct cfi_state cfi;
|
|
unsigned int uaccess_stack;
|
|
bool uaccess;
|
|
bool df;
|
|
bool noinstr;
|
|
s8 instr;
|
|
};
|
|
|
|
struct instruction {
|
|
struct list_head list;
|
|
struct hlist_node hash;
|
|
struct section *sec;
|
|
unsigned long offset;
|
|
unsigned int len;
|
|
enum insn_type type;
|
|
unsigned long immediate;
|
|
bool dead_end, ignore, ignore_alts;
|
|
bool hint;
|
|
bool retpoline_safe;
|
|
s8 instr;
|
|
u8 visited;
|
|
u8 ret_offset;
|
|
int alt_group;
|
|
struct symbol *call_dest;
|
|
struct instruction *jump_dest;
|
|
struct instruction *first_jump_src;
|
|
struct rela *jump_table;
|
|
struct list_head alts;
|
|
struct symbol *func;
|
|
struct list_head stack_ops;
|
|
struct cfi_state cfi;
|
|
struct orc_entry orc;
|
|
};
|
|
|
|
int check(const char *objname, 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 */
|