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 #include <asm/irqflags.h> 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() \ 21 (current_thread_info()->syscall_meta \ 22 |= ALPHA_SYSCALL_META_FORCE_SUCCESS) 23 24 static inline unsigned long regs_return_value(struct pt_regs *regs) 25 { 26 return regs->r0; 27 } 28 29 unsigned long user_stack_pointer(struct pt_regs *regs); 30 31 static __always_inline bool regs_irqs_disabled(struct pt_regs *regs) 32 { 33 return arch_irqs_disabled_flags(regs->ps); 34 } 35 36 /* Syscall emulation defines */ 37 #define PTRACE_SYSEMU 0x1d 38 #define PTRACE_SYSEMU_SINGLESTEP 0x1e 39 #endif 40