blob: c7c59c6a44eeacaeff9f0338bf6af83d5476e9f0 [file] [log] [blame]
David Brazdil0f672f62019-12-10 10:32:29 +00001/* SPDX-License-Identifier: GPL-2.0-or-later */
Andrew Scullb4b6d4a2019-01-02 15:54:55 +00002/*
3 * Copyright (C) 2015-2017 Josh Poimboeuf <jpoimboe@redhat.com>
Andrew Scullb4b6d4a2019-01-02 15:54:55 +00004 */
5
6#ifndef _OBJTOOL_CFI_H
7#define _OBJTOOL_CFI_H
8
Olivier Deprez157378f2022-04-04 15:47:50 +02009#include "cfi_regs.h"
10
Andrew Scullb4b6d4a2019-01-02 15:54:55 +000011#define CFI_UNDEFINED -1
12#define CFI_CFA -2
13#define CFI_SP_INDIRECT -3
14#define CFI_BP_INDIRECT -4
15
Andrew Scullb4b6d4a2019-01-02 15:54:55 +000016struct cfi_reg {
17 int base;
18 int offset;
19};
20
Olivier Deprez157378f2022-04-04 15:47:50 +020021struct cfi_init_state {
Andrew Scullb4b6d4a2019-01-02 15:54:55 +000022 struct cfi_reg regs[CFI_NUM_REGS];
Olivier Deprez157378f2022-04-04 15:47:50 +020023 struct cfi_reg cfa;
24};
25
26struct cfi_state {
27 struct cfi_reg regs[CFI_NUM_REGS];
28 struct cfi_reg vals[CFI_NUM_REGS];
29 struct cfi_reg cfa;
30 int stack_size;
31 int drap_reg, drap_offset;
32 unsigned char type;
33 bool bp_scratch;
34 bool drap;
35 bool end;
Andrew Scullb4b6d4a2019-01-02 15:54:55 +000036};
37
38#endif /* _OBJTOOL_CFI_H */