]>
git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blob - arch/x86/include/asm/orc_types.h
2 * Copyright (C) 2017 Josh Poimboeuf <jpoimboe@redhat.com>
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.
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.
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/>.
21 #include <linux/types.h>
22 #include <linux/compiler.h>
25 * The ORC_REG_* registers are base registers which are used to find other
26 * registers on the stack.
28 * ORC_REG_PREV_SP, also known as DWARF Call Frame Address (CFA), is the
29 * address of the previous frame: the caller's SP before it called the current
32 * ORC_REG_UNDEFINED means the corresponding register's value didn't change in
35 * The most commonly used base registers are SP and BP -- which the previous SP
36 * is usually based on -- and PREV_SP and UNDEFINED -- which the previous BP is
39 * The rest of the base registers are needed for special cases like entry code
40 * and GCC realigned stacks.
42 #define ORC_REG_UNDEFINED 0
43 #define ORC_REG_PREV_SP 1
50 #define ORC_REG_BP_INDIRECT 8
51 #define ORC_REG_SP_INDIRECT 9
52 #define ORC_REG_MAX 15
55 * ORC_TYPE_CALL: Indicates that sp_reg+sp_offset resolves to PREV_SP (the
56 * caller's SP right before it made the call). Used for all callable
57 * functions, i.e. all C code and all callable asm functions.
59 * ORC_TYPE_REGS: Used in entry code to indicate that sp_reg+sp_offset points
60 * to a fully populated pt_regs from a syscall, interrupt, or exception.
62 * ORC_TYPE_REGS_IRET: Used in entry code to indicate that sp_reg+sp_offset
63 * points to the iret return frame.
65 * The UNWIND_HINT macros are used only for the unwind_hint struct. They
66 * aren't used in struct orc_entry due to size and complexity constraints.
67 * Objtool converts them to real types when it converts the hints to orc
70 #define ORC_TYPE_CALL 0
71 #define ORC_TYPE_REGS 1
72 #define ORC_TYPE_REGS_IRET 2
73 #define UNWIND_HINT_TYPE_SAVE 3
74 #define UNWIND_HINT_TYPE_RESTORE 4
78 * This struct is more or less a vastly simplified version of the DWARF Call
79 * Frame Information standard. It contains only the necessary parts of DWARF
80 * CFI, simplified for ease of access by the in-kernel unwinder. It tells the
81 * unwinder how to find the previous SP and BP (and sometimes entry regs) on
82 * the stack for a given code address. Each instance of the struct corresponds
83 * to one or more code locations.
94 * This struct is used by asm and inline asm code to manually annotate the
95 * location of registers on the stack for the ORC unwinder.
97 * Type can be either ORC_TYPE_* or UNWIND_HINT_TYPE_*.
105 #endif /* __ASSEMBLY__ */
107 #endif /* _ORC_TYPES_H */