Thomas Gleixner | 1ccea77 | 2019-05-19 15:51:43 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-or-later */ |
Josh Poimboeuf | baa4146 | 2017-06-28 10:11:07 -0500 | [diff] [blame] | 2 | /* |
| 3 | * Copyright (C) 2015-2017 Josh Poimboeuf <jpoimboe@redhat.com> |
Josh Poimboeuf | baa4146 | 2017-06-28 10:11:07 -0500 | [diff] [blame] | 4 | */ |
| 5 | |
| 6 | #ifndef _OBJTOOL_CFI_H |
| 7 | #define _OBJTOOL_CFI_H |
| 8 | |
Julien Thierry | 6f8ca67 | 2020-03-27 15:28:46 +0000 | [diff] [blame] | 9 | #include "cfi_regs.h" |
| 10 | |
Josh Poimboeuf | baa4146 | 2017-06-28 10:11:07 -0500 | [diff] [blame] | 11 | #define CFI_UNDEFINED -1 |
| 12 | #define CFI_CFA -2 |
| 13 | #define CFI_SP_INDIRECT -3 |
| 14 | #define CFI_BP_INDIRECT -4 |
| 15 | |
Josh Poimboeuf | baa4146 | 2017-06-28 10:11:07 -0500 | [diff] [blame] | 16 | struct cfi_reg { |
| 17 | int base; |
| 18 | int offset; |
| 19 | }; |
| 20 | |
Peter Zijlstra | a3608f5 | 2020-03-25 15:34:50 +0100 | [diff] [blame] | 21 | struct cfi_init_state { |
Josh Poimboeuf | baa4146 | 2017-06-28 10:11:07 -0500 | [diff] [blame] | 22 | struct cfi_reg regs[CFI_NUM_REGS]; |
Peter Zijlstra | e7c0219 | 2020-03-25 14:04:45 +0100 | [diff] [blame] | 23 | struct cfi_reg cfa; |
| 24 | }; |
| 25 | |
| 26 | struct 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; |
Josh Poimboeuf | baa4146 | 2017-06-28 10:11:07 -0500 | [diff] [blame] | 36 | }; |
| 37 | |
| 38 | #endif /* _OBJTOOL_CFI_H */ |