treewide: remove redundant IS_ERR() before error code check
[linux/fpc-iii.git] / arch / csky / include / asm / ptrace.h
blobd0aba7b32417a021bff332992d02d8b587f3fa41
1 /* SPDX-License-Identifier: GPL-2.0 */
2 // Copyright (C) 2018 Hangzhou C-SKY Microsystems co.,ltd.
4 #ifndef __ASM_CSKY_PTRACE_H
5 #define __ASM_CSKY_PTRACE_H
7 #include <uapi/asm/ptrace.h>
8 #include <asm/traps.h>
9 #include <linux/types.h>
11 #ifndef __ASSEMBLY__
13 #define PS_S 0x80000000 /* Supervisor Mode */
15 #define arch_has_single_step() (1)
16 #define current_pt_regs() \
17 ({ (struct pt_regs *)((char *)current_thread_info() + THREAD_SIZE) - 1; })
19 #define user_stack_pointer(regs) ((regs)->usp)
21 #define user_mode(regs) (!((regs)->sr & PS_S))
22 #define instruction_pointer(regs) ((regs)->pc)
23 #define profile_pc(regs) instruction_pointer(regs)
25 static inline bool in_syscall(struct pt_regs const *regs)
27 return ((regs->sr >> 16) & 0xff) == VEC_TRAP0;
30 static inline void forget_syscall(struct pt_regs *regs)
32 regs->sr &= ~(0xff << 16);
35 static inline unsigned long regs_return_value(struct pt_regs *regs)
37 return regs->a0;
40 #endif /* __ASSEMBLY__ */
41 #endif /* __ASM_CSKY_PTRACE_H */