Skip to content

Commit 7c1f8db

Browse files
chleroympe
authored andcommitted
powerpc/ptrace: split out TRANSACTIONAL_MEM related functions.
Move TRANSACTIONAL_MEM functions out of ptrace.c, into ptrace-tm.c Signed-off-by: Christophe Leroy <[email protected]> Signed-off-by: Michael Ellerman <[email protected]> Link: https://lore.kernel.org/r/2d0ef3bb2610c0344bd42252c7134f429818c000.1582848567.git.christophe.leroy@c-s.fr
1 parent 60ef9db commit 7c1f8db

File tree

4 files changed

+943
-914
lines changed

4 files changed

+943
-914
lines changed

arch/powerpc/kernel/ptrace/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,4 @@ obj-y += ptrace-novsx.o
1313
endif
1414
obj-$(CONFIG_ALTIVEC) += ptrace-altivec.o
1515
obj-$(CONFIG_SPE) += ptrace-spe.o
16+
obj-$(CONFIG_PPC_TRANSACTIONAL_MEM) += ptrace-tm.o

arch/powerpc/kernel/ptrace/ptrace-decl.h

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,27 @@
11
/* SPDX-License-Identifier: GPL-2.0-or-later */
22

3+
/*
4+
* Set of msr bits that gdb can change on behalf of a process.
5+
*/
6+
#ifdef CONFIG_PPC_ADV_DEBUG_REGS
7+
#define MSR_DEBUGCHANGE 0
8+
#else
9+
#define MSR_DEBUGCHANGE (MSR_SE | MSR_BE)
10+
#endif
11+
12+
/*
13+
* Max register writeable via put_reg
14+
*/
15+
#ifdef CONFIG_PPC32
16+
#define PT_MAX_PUT_REG PT_MQ
17+
#else
18+
#define PT_MAX_PUT_REG PT_CCR
19+
#endif
20+
21+
#define TVSO(f) (offsetof(struct thread_vr_state, f))
22+
#define TFSO(f) (offsetof(struct thread_fp_state, f))
23+
#define TSO(f) (offsetof(struct thread_struct, f))
24+
325
/* ptrace-(no)vsx */
426

527
int fpr_get(struct task_struct *target, const struct user_regset *regset,
@@ -37,8 +59,75 @@ int evr_set(struct task_struct *target, const struct user_regset *regset,
3759

3860
/* ptrace */
3961

62+
int gpr32_get_common(struct task_struct *target,
63+
const struct user_regset *regset,
64+
unsigned int pos, unsigned int count,
65+
void *kbuf, void __user *ubuf,
66+
unsigned long *regs);
67+
int gpr32_set_common(struct task_struct *target,
68+
const struct user_regset *regset,
69+
unsigned int pos, unsigned int count,
70+
const void *kbuf, const void __user *ubuf,
71+
unsigned long *regs);
72+
73+
/* ptrace-tm */
74+
4075
#ifdef CONFIG_PPC_TRANSACTIONAL_MEM
4176
void flush_tmregs_to_thread(struct task_struct *tsk);
4277
#else
4378
static inline void flush_tmregs_to_thread(struct task_struct *tsk) { }
4479
#endif
80+
81+
int tm_cgpr_active(struct task_struct *target, const struct user_regset *regset);
82+
int tm_cgpr_get(struct task_struct *target, const struct user_regset *regset,
83+
unsigned int pos, unsigned int count, void *kbuf, void __user *ubuf);
84+
int tm_cgpr_set(struct task_struct *target, const struct user_regset *regset,
85+
unsigned int pos, unsigned int count,
86+
const void *kbuf, const void __user *ubuf);
87+
int tm_cfpr_active(struct task_struct *target, const struct user_regset *regset);
88+
int tm_cfpr_get(struct task_struct *target, const struct user_regset *regset,
89+
unsigned int pos, unsigned int count, void *kbuf, void __user *ubuf);
90+
int tm_cfpr_set(struct task_struct *target, const struct user_regset *regset,
91+
unsigned int pos, unsigned int count,
92+
const void *kbuf, const void __user *ubuf);
93+
int tm_cvmx_active(struct task_struct *target, const struct user_regset *regset);
94+
int tm_cvmx_get(struct task_struct *target, const struct user_regset *regset,
95+
unsigned int pos, unsigned int count, void *kbuf, void __user *ubuf);
96+
int tm_cvmx_set(struct task_struct *target, const struct user_regset *regset,
97+
unsigned int pos, unsigned int count,
98+
const void *kbuf, const void __user *ubuf);
99+
int tm_cvsx_active(struct task_struct *target, const struct user_regset *regset);
100+
int tm_cvsx_get(struct task_struct *target, const struct user_regset *regset,
101+
unsigned int pos, unsigned int count, void *kbuf, void __user *ubuf);
102+
int tm_cvsx_set(struct task_struct *target, const struct user_regset *regset,
103+
unsigned int pos, unsigned int count,
104+
const void *kbuf, const void __user *ubuf);
105+
int tm_spr_active(struct task_struct *target, const struct user_regset *regset);
106+
int tm_spr_get(struct task_struct *target, const struct user_regset *regset,
107+
unsigned int pos, unsigned int count, void *kbuf, void __user *ubuf);
108+
int tm_spr_set(struct task_struct *target, const struct user_regset *regset,
109+
unsigned int pos, unsigned int count,
110+
const void *kbuf, const void __user *ubuf);
111+
int tm_tar_active(struct task_struct *target, const struct user_regset *regset);
112+
int tm_tar_get(struct task_struct *target, const struct user_regset *regset,
113+
unsigned int pos, unsigned int count, void *kbuf, void __user *ubuf);
114+
int tm_tar_set(struct task_struct *target, const struct user_regset *regset,
115+
unsigned int pos, unsigned int count,
116+
const void *kbuf, const void __user *ubuf);
117+
int tm_ppr_active(struct task_struct *target, const struct user_regset *regset);
118+
int tm_ppr_get(struct task_struct *target, const struct user_regset *regset,
119+
unsigned int pos, unsigned int count, void *kbuf, void __user *ubuf);
120+
int tm_ppr_set(struct task_struct *target, const struct user_regset *regset,
121+
unsigned int pos, unsigned int count,
122+
const void *kbuf, const void __user *ubuf);
123+
int tm_dscr_active(struct task_struct *target, const struct user_regset *regset);
124+
int tm_dscr_get(struct task_struct *target, const struct user_regset *regset,
125+
unsigned int pos, unsigned int count, void *kbuf, void __user *ubuf);
126+
int tm_dscr_set(struct task_struct *target, const struct user_regset *regset,
127+
unsigned int pos, unsigned int count,
128+
const void *kbuf, const void __user *ubuf);
129+
int tm_cgpr32_get(struct task_struct *target, const struct user_regset *regset,
130+
unsigned int pos, unsigned int count, void *kbuf, void __user *ubuf);
131+
int tm_cgpr32_set(struct task_struct *target, const struct user_regset *regset,
132+
unsigned int pos, unsigned int count,
133+
const void *kbuf, const void __user *ubuf);

0 commit comments

Comments
 (0)