+ return -ENOSYS;
+}
+
+#ifdef CONFIG_COMPAT
+#include <linux/mm.h>
+#include <asm/uaccess.h>
+
+static const struct ptrace_layout_segment ppc32_uarea[] = {
+ {0, PT_FPR0 * sizeof(u32), 0, 0},
+ {PT_FPR0 * sizeof(u32), (PT_FPSCR32 + 1) * sizeof(u32), 1, 0},
+ {0, 0, -1, 0}
+};
+
+int arch_compat_ptrace(compat_long_t *request,
+ struct task_struct *child,
+ struct utrace_attached_engine *engine,
+ compat_ulong_t addr, compat_ulong_t data,
+ compat_long_t *val)
+{
+ void __user *uaddr = (void __user *) (unsigned long) addr;
+ int ret = -ENOSYS;
+
+ switch (*request) {
+ case PTRACE_PEEKUSR:
+ return ptrace_compat_peekusr(child, engine, ppc32_uarea,
+ addr, data);
+ case PTRACE_POKEUSR:
+ return ptrace_compat_pokeusr(child, engine, ppc32_uarea,
+ addr, data);
+
+ case PPC_PTRACE_GETREGS: /* Get GPRs 0 - 31. */
+ case PPC_PTRACE_SETREGS: /* Set GPRs 0 - 31. */
+ return ptrace_regset_access(child, engine,
+ utrace_native_view(current), 0,
+ 0, 32 * sizeof(compat_long_t),
+ uaddr,
+ *request == PPC_PTRACE_SETREGS);
+ case PPC_PTRACE_GETFPREGS: /* Get FPRs 0 - 31. */
+ case PPC_PTRACE_SETFPREGS: /* Get FPRs 0 - 31. */
+ return ptrace_regset_access(child, engine,
+ utrace_native_view(current), 1,
+ 0, 32 * sizeof(double),
+ uaddr,
+ *request == PPC_PTRACE_SETFPREGS);
+#ifdef CONFIG_ALTIVEC
+ case PTRACE_GETVRREGS:
+ return ptrace_whole_regset(child, engine, data, 2, 0);
+ case PTRACE_SETVRREGS:
+ return ptrace_whole_regset(child, engine, data, 2, 1);
+#endif
+ case PTRACE_GET_DEBUGREG:
+ case PTRACE_SET_DEBUGREG:
+ return ptrace_onereg_access(child, engine,
+ utrace_native_view(current), 3,
+ addr,
+ (unsigned long __user *)
+ (unsigned long) data,
+ *request == PTRACE_SET_DEBUGREG);
+
+ /*
+ * Read 4 bytes of the other process' storage
+ * data is a pointer specifying where the user wants the
+ * 4 bytes copied into
+ * addr is a pointer in the user's storage that contains an 8 byte
+ * address in the other process of the 4 bytes that is to be read
+ * (this is run in a 32-bit process looking at a 64-bit process)
+ * when I and D space are separate, these will need to be fixed.
+ */
+ case PPC_PTRACE_PEEKTEXT_3264:
+ case PPC_PTRACE_PEEKDATA_3264: {
+ u32 tmp;
+ int copied;
+ u32 __user * addrOthers;