summaryrefslogtreecommitdiffstats
path: root/arch/powerpc
diff options
context:
space:
mode:
authorMichael Neuling <mikey@neuling.org>2008-07-01 14:01:39 +1000
committerPaul Mackerras <paulus@samba.org>2008-07-01 14:47:09 +1000
commitf3e909c2750eb20536bacacc867dc9047b70546a (patch)
tree97bf54aafb93313d54aaeaa05eb99d1a9ab48c3c /arch/powerpc
parent436db693c4f4d02d375780a1f0b2ebdca2451cd6 (diff)
downloadblackbird-op-linux-f3e909c2750eb20536bacacc867dc9047b70546a.tar.gz
blackbird-op-linux-f3e909c2750eb20536bacacc867dc9047b70546a.zip
powerpc: Update for VSX core file and ptrace
This correctly hooks the VSX dump into Roland McGrath core file infrastructure. It adds the VSX dump information as an additional elf note in the core file (after talking more to the tool chain/gdb guys). This also ensures the formats are consistent between signals, ptrace and core files. Signed-off-by: Michael Neuling <mikey@neuling.org> Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc')
-rw-r--r--arch/powerpc/kernel/process.c19
-rw-r--r--arch/powerpc/kernel/ptrace.c21
2 files changed, 14 insertions, 26 deletions
diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c
index d52ded366f14..1924b57bd241 100644
--- a/arch/powerpc/kernel/process.c
+++ b/arch/powerpc/kernel/process.c
@@ -162,7 +162,7 @@ void flush_altivec_to_thread(struct task_struct *tsk)
}
}
-int dump_task_altivec(struct task_struct *tsk, elf_vrreg_t *vrregs)
+int dump_task_altivec(struct task_struct *tsk, elf_vrregset_t *vrregs)
{
/* ELF_NVRREG includes the VSCR and VRSAVE which we need to save
* separately, see below */
@@ -249,23 +249,6 @@ int dump_task_vsx(struct task_struct *tsk, elf_vrreg_t *vrregs)
}
#endif /* CONFIG_VSX */
-int dump_task_vector(struct task_struct *tsk, elf_vrregset_t *vrregs)
-{
- int rc = 0;
- elf_vrreg_t *regs = (elf_vrreg_t *)vrregs;
-#ifdef CONFIG_ALTIVEC
- rc = dump_task_altivec(tsk, regs);
- if (rc)
- return rc;
- regs += ELF_NVRREG;
-#endif
-
-#ifdef CONFIG_VSX
- rc = dump_task_vsx(tsk, regs);
-#endif
- return rc;
-}
-
#ifdef CONFIG_SPE
void enable_kernel_spe(void)
diff --git a/arch/powerpc/kernel/ptrace.c b/arch/powerpc/kernel/ptrace.c
index 4e203a89e189..8feb93e7890c 100644
--- a/arch/powerpc/kernel/ptrace.c
+++ b/arch/powerpc/kernel/ptrace.c
@@ -368,13 +368,15 @@ static int vsr_get(struct task_struct *target, const struct user_regset *regset,
unsigned int pos, unsigned int count,
void *kbuf, void __user *ubuf)
{
- int ret;
+ double buf[32];
+ int ret, i;
flush_vsx_to_thread(target);
+ for (i = 0; i < 32 ; i++)
+ buf[i] = current->thread.fpr[i][TS_VSRLOWOFFSET];
ret = user_regset_copyout(&pos, &count, &kbuf, &ubuf,
- target->thread.fpr, 0,
- 32 * sizeof(vector128));
+ buf, 0, 32 * sizeof(double));
return ret;
}
@@ -383,13 +385,16 @@ static int vsr_set(struct task_struct *target, const struct user_regset *regset,
unsigned int pos, unsigned int count,
const void *kbuf, const void __user *ubuf)
{
- int ret;
+ double buf[32];
+ int ret,i;
flush_vsx_to_thread(target);
ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf,
- target->thread.fpr, 0,
- 32 * sizeof(vector128));
+ buf, 0, 32 * sizeof(double));
+ for (i = 0; i < 32 ; i++)
+ current->thread.fpr[i][TS_VSRLOWOFFSET] = buf[i];
+
return ret;
}
@@ -499,8 +504,8 @@ static const struct user_regset native_regsets[] = {
#endif
#ifdef CONFIG_VSX
[REGSET_VSX] = {
- .n = 32,
- .size = sizeof(vector128), .align = sizeof(vector128),
+ .core_note_type = NT_PPC_VSX, .n = 32,
+ .size = sizeof(double), .align = sizeof(double),
.active = vsr_active, .get = vsr_get, .set = vsr_set
},
#endif
OpenPOWER on IntegriCloud