xref: /linux/arch/x86/include/asm/unwind_user.h (revision 49cf34c0815f93fb2ea3ab5cfbac1124bd9b45d0)
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef _ASM_X86_UNWIND_USER_H
3 #define _ASM_X86_UNWIND_USER_H
4 
5 #include <asm/ptrace.h>
6 
7 #define ARCH_INIT_USER_FP_FRAME(ws)			\
8 	.cfa_off	=  2*(ws),			\
9 	.ra_off		= -1*(ws),			\
10 	.fp_off		= -2*(ws),			\
11 	.use_fp		= true,
12 
13 static inline int unwind_user_word_size(struct pt_regs *regs)
14 {
15 	/* We can't unwind VM86 stacks */
16 	if (regs->flags & X86_VM_MASK)
17 		return 0;
18 #ifdef CONFIG_X86_64
19 	if (!user_64bit_mode(regs))
20 		return sizeof(int);
21 #endif
22 	return sizeof(long);
23 }
24 
25 #endif /* _ASM_X86_UNWIND_USER_H */
26