hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/tools/objtool/cfi.h
....@@ -1,55 +1,40 @@
1
+/* SPDX-License-Identifier: GPL-2.0-or-later */
12 /*
23 * Copyright (C) 2015-2017 Josh Poimboeuf <jpoimboe@redhat.com>
3
- *
4
- * This program is free software; you can redistribute it and/or
5
- * modify it under the terms of the GNU General Public License
6
- * as published by the Free Software Foundation; either version 2
7
- * of the License, or (at your option) any later version.
8
- *
9
- * This program is distributed in the hope that it will be useful,
10
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
11
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
- * GNU General Public License for more details.
13
- *
14
- * You should have received a copy of the GNU General Public License
15
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
164 */
175
186 #ifndef _OBJTOOL_CFI_H
197 #define _OBJTOOL_CFI_H
8
+
9
+#include "cfi_regs.h"
10
+#include <linux/list.h>
2011
2112 #define CFI_UNDEFINED -1
2213 #define CFI_CFA -2
2314 #define CFI_SP_INDIRECT -3
2415 #define CFI_BP_INDIRECT -4
2516
26
-#define CFI_AX 0
27
-#define CFI_DX 1
28
-#define CFI_CX 2
29
-#define CFI_BX 3
30
-#define CFI_SI 4
31
-#define CFI_DI 5
32
-#define CFI_BP 6
33
-#define CFI_SP 7
34
-#define CFI_R8 8
35
-#define CFI_R9 9
36
-#define CFI_R10 10
37
-#define CFI_R11 11
38
-#define CFI_R12 12
39
-#define CFI_R13 13
40
-#define CFI_R14 14
41
-#define CFI_R15 15
42
-#define CFI_RA 16
43
-#define CFI_NUM_REGS 17
44
-
4517 struct cfi_reg {
4618 int base;
4719 int offset;
4820 };
4921
50
-struct cfi_state {
51
- struct cfi_reg cfa;
22
+struct cfi_init_state {
5223 struct cfi_reg regs[CFI_NUM_REGS];
24
+ struct cfi_reg cfa;
25
+};
26
+
27
+struct cfi_state {
28
+ struct hlist_node hash; /* must be first, cficmp() */
29
+ struct cfi_reg regs[CFI_NUM_REGS];
30
+ struct cfi_reg vals[CFI_NUM_REGS];
31
+ struct cfi_reg cfa;
32
+ int stack_size;
33
+ int drap_reg, drap_offset;
34
+ unsigned char type;
35
+ bool bp_scratch;
36
+ bool drap;
37
+ bool end;
5338 };
5439
5540 #endif /* _OBJTOOL_CFI_H */