mirror of
https://github.com/torvalds/linux.git
synced 2024-11-18 18:11:56 +00:00
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>
This commit is contained in:
parent
ce63cd5bd4
commit
f335b10f3b
29
arch/csky/include/asm/ptrace.h
Normal file
29
arch/csky/include/asm/ptrace.h
Normal file
@ -0,0 +1,29 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0 */
|
||||
// Copyright (C) 2018 Hangzhou C-SKY Microsystems co.,ltd.
|
||||
|
||||
#ifndef __ASM_CSKY_PTRACE_H
|
||||
#define __ASM_CSKY_PTRACE_H
|
||||
|
||||
#include <uapi/asm/ptrace.h>
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
|
||||
#define PS_S 0x80000000 /* Supervisor Mode */
|
||||
|
||||
#define arch_has_single_step() (1)
|
||||
#define current_pt_regs() \
|
||||
({ (struct pt_regs *)((char *)current_thread_info() + THREAD_SIZE) - 1; })
|
||||
|
||||
#define user_stack_pointer(regs) ((regs)->usp)
|
||||
|
||||
#define user_mode(regs) (!((regs)->sr & PS_S))
|
||||
#define instruction_pointer(regs) ((regs)->pc)
|
||||
#define profile_pc(regs) instruction_pointer(regs)
|
||||
|
||||
static inline unsigned long regs_return_value(struct pt_regs *regs)
|
||||
{
|
||||
return regs->a0;
|
||||
}
|
||||
|
||||
#endif /* __ASSEMBLY__ */
|
||||
#endif /* __ASM_CSKY_PTRACE_H */
|
@ -48,25 +48,5 @@ struct user_fp {
|
||||
unsigned long reserved;
|
||||
};
|
||||
|
||||
#ifdef __KERNEL__
|
||||
|
||||
#define PS_S 0x80000000 /* Supervisor Mode */
|
||||
|
||||
#define arch_has_single_step() (1)
|
||||
#define current_pt_regs() \
|
||||
({ (struct pt_regs *)((char *)current_thread_info() + THREAD_SIZE) - 1; })
|
||||
|
||||
#define user_stack_pointer(regs) ((regs)->usp)
|
||||
|
||||
#define user_mode(regs) (!((regs)->sr & PS_S))
|
||||
#define instruction_pointer(regs) ((regs)->pc)
|
||||
#define profile_pc(regs) instruction_pointer(regs)
|
||||
|
||||
static inline unsigned long regs_return_value(struct pt_regs *regs)
|
||||
{
|
||||
return regs->a0;
|
||||
}
|
||||
|
||||
#endif /* __KERNEL__ */
|
||||
#endif /* __ASSEMBLY__ */
|
||||
#endif /* _CSKY_PTRACE_H */
|
||||
|
Loading…
Reference in New Issue
Block a user