diff options
-rw-r--r-- | arch/csky/include/asm/ptrace.h | 29 | ||||
-rw-r--r-- | arch/csky/include/uapi/asm/ptrace.h | 20 |
2 files changed, 29 insertions, 20 deletions
diff --git a/arch/csky/include/asm/ptrace.h b/arch/csky/include/asm/ptrace.h new file mode 100644 index 000000000000..1e00578166f0 --- /dev/null +++ b/arch/csky/include/asm/ptrace.h | |||
@@ -0,0 +1,29 @@ | |||
1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
2 | // Copyright (C) 2018 Hangzhou C-SKY Microsystems co.,ltd. | ||
3 | |||
4 | #ifndef __ASM_CSKY_PTRACE_H | ||
5 | #define __ASM_CSKY_PTRACE_H | ||
6 | |||
7 | #include <uapi/asm/ptrace.h> | ||
8 | |||
9 | #ifndef __ASSEMBLY__ | ||
10 | |||
11 | #define PS_S 0x80000000 /* Supervisor Mode */ | ||
12 | |||
13 | #define arch_has_single_step() (1) | ||
14 | #define current_pt_regs() \ | ||
15 | ({ (struct pt_regs *)((char *)current_thread_info() + THREAD_SIZE) - 1; }) | ||
16 | |||
17 | #define user_stack_pointer(regs) ((regs)->usp) | ||
18 | |||
19 | #define user_mode(regs) (!((regs)->sr & PS_S)) | ||
20 | #define instruction_pointer(regs) ((regs)->pc) | ||
21 | #define profile_pc(regs) instruction_pointer(regs) | ||
22 | |||
23 | static inline unsigned long regs_return_value(struct pt_regs *regs) | ||
24 | { | ||
25 | return regs->a0; | ||
26 | } | ||
27 | |||
28 | #endif /* __ASSEMBLY__ */ | ||
29 | #endif /* __ASM_CSKY_PTRACE_H */ | ||
diff --git a/arch/csky/include/uapi/asm/ptrace.h b/arch/csky/include/uapi/asm/ptrace.h index 9bf5b1a415d0..4e248d5b86ef 100644 --- a/arch/csky/include/uapi/asm/ptrace.h +++ b/arch/csky/include/uapi/asm/ptrace.h | |||
@@ -48,25 +48,5 @@ struct user_fp { | |||
48 | unsigned long reserved; | 48 | unsigned long reserved; |
49 | }; | 49 | }; |
50 | 50 | ||
51 | #ifdef __KERNEL__ | ||
52 | |||
53 | #define PS_S 0x80000000 /* Supervisor Mode */ | ||
54 | |||
55 | #define arch_has_single_step() (1) | ||
56 | #define current_pt_regs() \ | ||
57 | ({ (struct pt_regs *)((char *)current_thread_info() + THREAD_SIZE) - 1; }) | ||
58 | |||
59 | #define user_stack_pointer(regs) ((regs)->usp) | ||
60 | |||
61 | #define user_mode(regs) (!((regs)->sr & PS_S)) | ||
62 | #define instruction_pointer(regs) ((regs)->pc) | ||
63 | #define profile_pc(regs) instruction_pointer(regs) | ||
64 | |||
65 | static inline unsigned long regs_return_value(struct pt_regs *regs) | ||
66 | { | ||
67 | return regs->a0; | ||
68 | } | ||
69 | |||
70 | #endif /* __KERNEL__ */ | ||
71 | #endif /* __ASSEMBLY__ */ | 51 | #endif /* __ASSEMBLY__ */ |
72 | #endif /* _CSKY_PTRACE_H */ | 52 | #endif /* _CSKY_PTRACE_H */ |