Skip to content

Commit 6e0b797

Browse files
chleroympe
authored andcommitted
powerpc/ptrace: move register viewing functions out of ptrace.c
Create a dedicated ptrace-view.c file. Signed-off-by: Christophe Leroy <[email protected]> Signed-off-by: Michael Ellerman <[email protected]> Link: https://lore.kernel.org/r/bfd8c3ed57c9057e4a5d3816737b5ee98c6f7e43.1582848567.git.christophe.leroy@c-s.fr
1 parent 7c1f8db commit 6e0b797

File tree

4 files changed

+949
-968
lines changed

4 files changed

+949
-968
lines changed

arch/powerpc/kernel/ptrace/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
# Makefile for the linux kernel.
44
#
55

6-
CFLAGS_ptrace.o += -DUTS_MACHINE='"$(UTS_MACHINE)"'
6+
CFLAGS_ptrace-view.o += -DUTS_MACHINE='"$(UTS_MACHINE)"'
77

8-
obj-y += ptrace.o
8+
obj-y += ptrace.o ptrace-view.o
99
obj-$(CONFIG_PPC64) += ptrace32.o
1010
obj-$(CONFIG_VSX) += ptrace-vsx.o
1111
ifneq ($(CONFIG_VSX),y)

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

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,45 @@
2222
#define TFSO(f) (offsetof(struct thread_fp_state, f))
2323
#define TSO(f) (offsetof(struct thread_struct, f))
2424

25+
/*
26+
* These are our native regset flavors.
27+
*/
28+
enum powerpc_regset {
29+
REGSET_GPR,
30+
REGSET_FPR,
31+
#ifdef CONFIG_ALTIVEC
32+
REGSET_VMX,
33+
#endif
34+
#ifdef CONFIG_VSX
35+
REGSET_VSX,
36+
#endif
37+
#ifdef CONFIG_SPE
38+
REGSET_SPE,
39+
#endif
40+
#ifdef CONFIG_PPC_TRANSACTIONAL_MEM
41+
REGSET_TM_CGPR, /* TM checkpointed GPR registers */
42+
REGSET_TM_CFPR, /* TM checkpointed FPR registers */
43+
REGSET_TM_CVMX, /* TM checkpointed VMX registers */
44+
REGSET_TM_CVSX, /* TM checkpointed VSX registers */
45+
REGSET_TM_SPR, /* TM specific SPR registers */
46+
REGSET_TM_CTAR, /* TM checkpointed TAR register */
47+
REGSET_TM_CPPR, /* TM checkpointed PPR register */
48+
REGSET_TM_CDSCR, /* TM checkpointed DSCR register */
49+
#endif
50+
#ifdef CONFIG_PPC64
51+
REGSET_PPR, /* PPR register */
52+
REGSET_DSCR, /* DSCR register */
53+
#endif
54+
#ifdef CONFIG_PPC_BOOK3S_64
55+
REGSET_TAR, /* TAR register */
56+
REGSET_EBB, /* EBB registers */
57+
REGSET_PMR, /* Performance Monitor Registers */
58+
#endif
59+
#ifdef CONFIG_PPC_MEM_KEYS
60+
REGSET_PKEY, /* AMR register */
61+
#endif
62+
};
63+
2564
/* ptrace-(no)vsx */
2665

2766
int fpr_get(struct task_struct *target, const struct user_regset *regset,
@@ -131,3 +170,7 @@ int tm_cgpr32_get(struct task_struct *target, const struct user_regset *regset,
131170
int tm_cgpr32_set(struct task_struct *target, const struct user_regset *regset,
132171
unsigned int pos, unsigned int count,
133172
const void *kbuf, const void __user *ubuf);
173+
174+
/* ptrace-view */
175+
176+
extern const struct user_regset_view user_ppc_native_view;

0 commit comments

Comments
 (0)