20 #include <linux/kernel.h>
21 #include <linux/sched.h>
24 #include <linux/errno.h>
25 #include <linux/ptrace.h>
29 #include <linux/signal.h>
32 #include <asm/uaccess.h>
34 #include <asm/pgtable.h>
35 #include <asm/switch_to.h>
43 #define FPRNUMBER(i) (((i) - PT_FPR0) >> 1)
44 #define FPRHALF(i) (((i) - PT_FPR0) & 1)
45 #define FPRINDEX(i) TS_FPRWIDTH * FPRNUMBER(i) * 2 + FPRHALF(i)
46 #define FPRINDEX_3264(i) (TS_FPRWIDTH * ((i) - PT_FPR0))
51 unsigned long addr = caddr;
79 if (copied !=
sizeof(tmp))
92 index = (
unsigned long) addr >> 2;
93 if ((addr & 3) || (index > PT_FPSCR32))
106 tmp = ((
unsigned int *)child->
thread.fpr)
130 index = (
u64)addr >> 2;
141 if ((addr & 3) || numReg >
PT_FPSCR)
153 reg32bits = ((
u32*)&tmp)[
part];
178 sizeof(tmp), 1) ==
sizeof(tmp))
190 index = (
unsigned long) addr >> 2;
191 if ((addr & 3) || (index > PT_FPSCR32))
204 ((
unsigned int *)child->
thread.fpr)
224 index = (
u64)addr >> 2;
231 if ((addr & 3) || (numReg >
PT_FPSCR))
237 freg = (freg & ~0xfffffffful) | (data & 0xfffffffful);
239 freg = (freg & 0xfffffffful) | (data << 32);
248 ((
u32 *)tmp)[index % 2] =
data;
259 #ifdef CONFIG_PPC_ADV_DEBUG_REGS
268 return copy_regset_to_user(
274 return copy_regset_from_user(
300 ret = compat_ptrace_request(child, request, addr, data);