linux-kernel-test/arch/powerpc
Benjamin Herrenschmidt e17666ba48 [POWERPC] ptrace updates & new, better requests
The powerpc ptrace interface is dodgy at best. We have defined our
"own" versions of GETREGS/SETREGS/GETFPREGS/SETFPREGS that strangely
take arguments in reverse order from other archs (in addition to having
different request numbers) and have subtle issue, like not accessing
all of the registers in their respective categories.

This patch moves the implementation of those to a separate function
in order to facilitate their deprecation in the future, and provides
new ptrace requests that mirror the x86 and sparc ones and use the
same numbers:

   PTRACE_GETREGS    : returns an entire pt_regs (the whole thing,
                       not only the 32 GPRs, though that doesn't
                       include the FPRs etc... There's a compat version
                       for 32 bits that returns a 32 bits compatible
                       pt_regs (44 uints)

   PTRACE_SETREGS    : sets an entire pt_regs (the whole thing,
                       not only the 32 GPRs, though that doesn't
                       include the FPRs etc... Some registers cannot be
                       written to and will just be dropped, this is the
                       same as with POKEUSR, that is anything above MQ
                       on 32 bits and CCR on 64 bits. There is a compat
                       version as well.

   PTRACE_GETFPREGS  : returns all the FP registers -including- the FPSCR
                       that is 33 doubles (regardless of 32/64 bits)

   PTRACE_SETFPREGS  : sets all the FP registers -including- the FPSCR
                       that is 33 doubles (regardless of 32/64 bits)

And two that only exist on 64 bits kernels:

   PTRACE_GETREGS64  : Same as PTRACE_GETREGS, except there is no compat
                       function, a 32 bits process will obtain the full 64
                       bits registers

   PTRACE_SETREGS64  : Same as PTRACE_SETREGS, except there is no compat
                       function, a 32 bits process will set the full 64
                       bits registers

The two later ones makes things easier to have a 32 bits debugger on a
64 bits program (or on a 32 bits program that uses the full 64 bits of
the GPRs, which is possible though has issues that will be fixed in a
later patch).

Finally, while at it, the patch removes a whole bunch of code duplication
between ptrace32.c and ptrace.c, in large part by having the former call
into the later for all requests that don't need any special "compat"
treatment.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2007-06-14 22:29:56 +10:00
..
boot [POWERPC] Fix building of COFF zImages 2007-06-07 22:21:31 +10:00
configs [POWERPC] cell_defconfig: Disable cpufreq and pmi 2007-05-17 21:11:14 +10:00
kernel [POWERPC] ptrace updates & new, better requests 2007-06-14 22:29:56 +10:00
lib [POWERPC] Fix alignment problem in rh_alloc_align() with exact-sized blocks 2007-05-17 21:10:16 +10:00
math-emu
mm [POWERPC] Rewrite IO allocation & mapping on powerpc64 2007-06-14 22:29:56 +10:00
oprofile Fix misspellings collected by members of KJ list. 2007-05-09 07:14:03 +02:00
platforms [POWERPC] spufs: Add a "capabilities" file to spu contexts 2007-06-14 22:29:56 +10:00
sysdev [POWERPC] QE: fix Kconfig 'select' warning with UCC_FAST 2007-05-23 07:23:55 -05:00
xmon Simplify kallsyms_lookup() 2007-05-08 11:15:08 -07:00
.gitignore [POWERPC] Add files build to .gitignore 2006-12-04 20:41:29 +11:00
Kconfig [POWERPC] Fix Kconfig warning 2007-05-23 09:51:46 -05:00
Kconfig.debug Fix trivial typos in Kconfig* files 2007-05-09 07:12:20 +02:00
Makefile [POWERPC] Create a zImage for legacy iSeries 2007-06-02 21:01:56 +10:00