58 lines · c
1/* SPDX-License-Identifier: GPL-2.0 */2#ifndef _LINUX_OBJTOOL_TYPES_H3#define _LINUX_OBJTOOL_TYPES_H4 5#ifndef __ASSEMBLY__6 7#include <linux/types.h>8 9/*10 * This struct is used by asm and inline asm code to manually annotate the11 * location of registers on the stack.12 */13struct unwind_hint {14 u32 ip;15 s16 sp_offset;16 u8 sp_reg;17 u8 type;18 u8 signal;19};20 21#endif /* __ASSEMBLY__ */22 23/*24 * UNWIND_HINT_TYPE_UNDEFINED: A blind spot in ORC coverage which can result in25 * a truncated and unreliable stack unwind.26 *27 * UNWIND_HINT_TYPE_END_OF_STACK: The end of the kernel stack unwind before28 * hitting user entry, boot code, or fork entry (when there are no pt_regs29 * available).30 *31 * UNWIND_HINT_TYPE_CALL: Indicates that sp_reg+sp_offset resolves to PREV_SP32 * (the caller's SP right before it made the call). Used for all callable33 * functions, i.e. all C code and all callable asm functions.34 *35 * UNWIND_HINT_TYPE_REGS: Used in entry code to indicate that sp_reg+sp_offset36 * points to a fully populated pt_regs from a syscall, interrupt, or exception.37 *38 * UNWIND_HINT_TYPE_REGS_PARTIAL: Used in entry code to indicate that39 * sp_reg+sp_offset points to the iret return frame.40 *41 * UNWIND_HINT_TYPE_FUNC: Generate the unwind metadata of a callable function.42 * Useful for code which doesn't have an ELF function annotation.43 *44 * UNWIND_HINT_TYPE_{SAVE,RESTORE}: Save the unwind metadata at a certain45 * location so that it can be restored later.46 */47#define UNWIND_HINT_TYPE_UNDEFINED 048#define UNWIND_HINT_TYPE_END_OF_STACK 149#define UNWIND_HINT_TYPE_CALL 250#define UNWIND_HINT_TYPE_REGS 351#define UNWIND_HINT_TYPE_REGS_PARTIAL 452/* The below hint types don't have corresponding ORC types */53#define UNWIND_HINT_TYPE_FUNC 554#define UNWIND_HINT_TYPE_SAVE 655#define UNWIND_HINT_TYPE_RESTORE 756 57#endif /* _LINUX_OBJTOOL_TYPES_H */58