aboutsummaryrefslogtreecommitdiff
path: root/tools/objtool/arch.h
blob: a59e061c0b4a0abcf3e9fc7a76e462fd2c41954b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/*
 * Copyright (C) 2015 Josh Poimboeuf <jpoimboe@redhat.com>
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, see <http://www.gnu.org/licenses/>.
 */

#ifndef _ARCH_H
#define _ARCH_H

#include <stdbool.h>
#include "elf.h"

#define INSN_FP_SAVE		1
#define INSN_FP_SETUP		2
#define INSN_FP_RESTORE		3
#define INSN_JUMP_CONDITIONAL	4
#define INSN_JUMP_UNCONDITIONAL	5
#define INSN_JUMP_DYNAMIC	6
#define INSN_CALL		7
#define INSN_CALL_DYNAMIC	8
#define INSN_RETURN		9
#define INSN_CONTEXT_SWITCH	10
#define INSN_NOP		11
#define INSN_OTHER		12
#define INSN_LAST		INSN_OTHER

int arch_decode_instruction(struct elf *elf, struct section *sec,
			    unsigned long offset, unsigned int maxlen,
			    unsigned int *len, unsigned char *type,
			    unsigned long *displacement);

#endif /* _ARCH_H */