xref: /linux/arch/alpha/include/asm/ptrace.h (revision 249ebf3f65f8530beb2cbfb91bff1d83ba88d23c)
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef _ASMAXP_PTRACE_H
3 #define _ASMAXP_PTRACE_H
4 
5 #include <uapi/asm/ptrace.h>
6 
7 
8 #define arch_has_single_step()		(1)
9 #define user_mode(regs) (((regs)->ps & 8) != 0)
10 #define instruction_pointer(regs) ((regs)->pc)
11 #define profile_pc(regs) instruction_pointer(regs)
12 #define current_user_stack_pointer() rdusp()
13 
14 #define task_pt_regs(task) \
15   ((struct pt_regs *) (task_stack_page(task) + 2*PAGE_SIZE) - 1)
16 
17 #define current_pt_regs() \
18   ((struct pt_regs *) ((char *)current_thread_info() + 2*PAGE_SIZE) - 1)
19 
20 #define force_successful_syscall_return() (current_pt_regs()->r0 = 0)
21 
22 static inline unsigned long regs_return_value(struct pt_regs *regs)
23 {
24 	return regs->r0;
25 }
26 
27 #endif
28