aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel
diff options
context:
space:
mode:
authorRoland McGrath <roland@redhat.com>2007-12-20 06:58:00 -0500
committerPaul Mackerras <paulus@samba.org>2008-02-07 04:40:16 -0500
commit80fdf4709497a276a826c9d8426ef1effc8f8e33 (patch)
treeb78b6a95c3ee7b70f03abb22ce8432e6a0c6c2e0 /arch/powerpc/kernel
parent44dd3f50d3848e332b49e83a142b39b960ec962e (diff)
[POWERPC] Add user_regset_view definitions
This provides the task_user_regset_view entry point and support for all the native-mode (64 on CONFIG_PPC64, 32 on CONFIG_PPC32) thread register state. This will enable generic machine-independent code to access user-mode threads' registers for debugging and dumping. Signed-off-by: Roland McGrath <roland@redhat.com> Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc/kernel')
-rw-r--r--arch/powerpc/kernel/Makefile2
-rw-r--r--arch/powerpc/kernel/ptrace.c52
2 files changed, 54 insertions, 0 deletions
diff --git a/arch/powerpc/kernel/Makefile b/arch/powerpc/kernel/Makefile
index 58dbfeff9b4d..ac07112b65de 100644
--- a/arch/powerpc/kernel/Makefile
+++ b/arch/powerpc/kernel/Makefile
@@ -2,6 +2,8 @@
2# Makefile for the linux kernel. 2# Makefile for the linux kernel.
3# 3#
4 4
5CFLAGS_ptrace.o += -DUTS_MACHINE='"$(UTS_MACHINE)"'
6
5ifeq ($(CONFIG_PPC64),y) 7ifeq ($(CONFIG_PPC64),y)
6CFLAGS_prom_init.o += -mno-minimal-toc 8CFLAGS_prom_init.o += -mno-minimal-toc
7endif 9endif
diff --git a/arch/powerpc/kernel/ptrace.c b/arch/powerpc/kernel/ptrace.c
index d9b952faee73..eb00274e84ba 100644
--- a/arch/powerpc/kernel/ptrace.c
+++ b/arch/powerpc/kernel/ptrace.c
@@ -455,6 +455,58 @@ static int set_evrregs(struct task_struct *task, unsigned long *data)
455#endif /* CONFIG_SPE */ 455#endif /* CONFIG_SPE */
456 456
457 457
458/*
459 * These are our native regset flavors.
460 */
461enum powerpc_regset {
462 REGSET_GPR,
463 REGSET_FPR,
464#ifdef CONFIG_ALTIVEC
465 REGSET_VMX,
466#endif
467#ifdef CONFIG_SPE
468 REGSET_SPE,
469#endif
470};
471
472static const struct user_regset native_regsets[] = {
473 [REGSET_GPR] = {
474 .core_note_type = NT_PRSTATUS, .n = ELF_NGREG,
475 .size = sizeof(long), .align = sizeof(long),
476 .get = gpr_get, .set = gpr_set
477 },
478 [REGSET_FPR] = {
479 .core_note_type = NT_PRFPREG, .n = ELF_NFPREG,
480 .size = sizeof(double), .align = sizeof(double),
481 .get = fpr_get, .set = fpr_set
482 },
483#ifdef CONFIG_ALTIVEC
484 [REGSET_VMX] = {
485 .core_note_type = NT_PPC_VMX, .n = 34,
486 .size = sizeof(vector128), .align = sizeof(vector128),
487 .active = vr_active, .get = vr_get, .set = vr_set
488 },
489#endif
490#ifdef CONFIG_SPE
491 [REGSET_SPE] = {
492 .n = 35,
493 .size = sizeof(u32), .align = sizeof(u32),
494 .active = evr_active, .get = evr_get, .set = evr_set
495 },
496#endif
497};
498
499static const struct user_regset_view user_ppc_native_view = {
500 .name = UTS_MACHINE, .e_machine = ELF_ARCH, .ei_osabi = ELF_OSABI,
501 .regsets = native_regsets, .n = ARRAY_SIZE(native_regsets)
502};
503
504const struct user_regset_view *task_user_regset_view(struct task_struct *task)
505{
506 return &user_ppc_native_view;
507}
508
509
458void user_enable_single_step(struct task_struct *task) 510void user_enable_single_step(struct task_struct *task)
459{ 511{
460 struct pt_regs *regs = task->thread.regs; 512 struct pt_regs *regs = task->thread.regs;