powerpc: Use names rather than numbers for SPRGs (v2)
commitee43eb788b3a06425fffb912677e2e1c8b00dd3b
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>
Tue, 14 Jul 2009 20:52:54 +0000 (14 20:52 +0000)
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>
Thu, 20 Aug 2009 00:12:27 +0000 (20 10:12 +1000)
tree7233cb47647837ab00af81270b3a16555d88a1f1
parent8aa34ab8b2dc96ca6c4feecfb87ed13f0d40ef98
powerpc: Use names rather than numbers for SPRGs (v2)

The kernel uses SPRG registers for various purposes, typically in
low level assembly code as scratch registers or to hold per-cpu
global infos such as the PACA or the current thread_info pointer.

We want to be able to easily shuffle the usage of those registers
as some implementations have specific constraints realted to some
of them, for example, some have userspace readable aliases, etc..
and the current choice isn't always the best.

This patch should not change any code generation, and replaces the
usage of SPRN_SPRGn everywhere in the kernel with a named replacement
and adds documentation next to the definition of the names as to
what those are used for on each processor family.

The only parts that still use the original numbers are bits of KVM
or suspend/resume code that just blindly needs to save/restore all
the SPRGs.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
20 files changed:
arch/powerpc/include/asm/exception-64s.h
arch/powerpc/include/asm/reg.h
arch/powerpc/kernel/cpu_setup_6xx.S
arch/powerpc/kernel/entry_32.S
arch/powerpc/kernel/entry_64.S
arch/powerpc/kernel/exceptions-64s.S
arch/powerpc/kernel/fpu.S
arch/powerpc/kernel/head_32.S
arch/powerpc/kernel/head_40x.S
arch/powerpc/kernel/head_44x.S
arch/powerpc/kernel/head_64.S
arch/powerpc/kernel/head_8xx.S
arch/powerpc/kernel/head_booke.h
arch/powerpc/kernel/head_fsl_booke.S
arch/powerpc/kernel/setup_64.c
arch/powerpc/kernel/vector.S
arch/powerpc/kvm/booke_interrupts.S
arch/powerpc/mm/hash_low_32.S
arch/powerpc/platforms/iseries/exception.S
arch/powerpc/platforms/iseries/exception.h