Skip to content

Commit f335b10

Browse files
committed
csky: Add non-uapi asm/ptrace.h namespace
Move #ifdef __KERNEL__ code in the uapi namespace to non-uapi include/asm/ptrace.h namespace and remove #ifdef __KERNEL__ in include/asm/ptrace.h. Seperate ptrace.h in uapi and non-uapi is more common and clear. Signed-off-by: Guo Ren <ren_guo@c-sky.com> Cc: Dmitry V. Levin <ldv@altlinux.org>
1 parent ce63cd5 commit f335b10

2 files changed

Lines changed: 29 additions & 20 deletions

File tree

‎arch/csky/include/asm/ptrace.h‎

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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 */

‎arch/csky/include/uapi/asm/ptrace.h‎

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -48,25 +48,5 @@ struct user_fp {
4848
unsigned long reserved;
4949
};
5050

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__ */
7151
#endif /* __ASSEMBLY__ */
7252
#endif /* _CSKY_PTRACE_H */

0 commit comments

Comments
 (0)