aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel/head_64.S
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2009-07-14 16:52:54 -0400
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2009-08-19 20:12:27 -0400
commitee43eb788b3a06425fffb912677e2e1c8b00dd3b (patch)
tree7233cb47647837ab00af81270b3a16555d88a1f1 /arch/powerpc/kernel/head_64.S
parent8aa34ab8b2dc96ca6c4feecfb87ed13f0d40ef98 (diff)
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>
Diffstat (limited to 'arch/powerpc/kernel/head_64.S')
-rw-r--r--arch/powerpc/kernel/head_64.S14
1 files changed, 7 insertions, 7 deletions
diff --git a/arch/powerpc/kernel/head_64.S b/arch/powerpc/kernel/head_64.S
index 9196ef36d433..0552f01041ab 100644
--- a/arch/powerpc/kernel/head_64.S
+++ b/arch/powerpc/kernel/head_64.S
@@ -195,7 +195,7 @@ _GLOBAL(generic_secondary_smp_init)
195 mr r3,r24 /* not found, copy phys to r3 */ 195 mr r3,r24 /* not found, copy phys to r3 */
196 b .kexec_wait /* next kernel might do better */ 196 b .kexec_wait /* next kernel might do better */
197 197
1982: mtspr SPRN_SPRG3,r13 /* Save vaddr of paca in SPRG3 */ 1982: mtspr SPRN_SPRG_PACA,r13 /* Save vaddr of paca in an SPRG */
199 /* From now on, r24 is expected to be logical cpuid */ 199 /* From now on, r24 is expected to be logical cpuid */
200 mr r24,r5 200 mr r24,r5
2013: HMT_LOW 2013: HMT_LOW
@@ -484,7 +484,7 @@ _GLOBAL(pmac_secondary_start)
484 LOAD_REG_ADDR(r4,paca) /* Get base vaddr of paca array */ 484 LOAD_REG_ADDR(r4,paca) /* Get base vaddr of paca array */
485 mulli r13,r24,PACA_SIZE /* Calculate vaddr of right paca */ 485 mulli r13,r24,PACA_SIZE /* Calculate vaddr of right paca */
486 add r13,r13,r4 /* for this processor. */ 486 add r13,r13,r4 /* for this processor. */
487 mtspr SPRN_SPRG3,r13 /* Save vaddr of paca in SPRG3 */ 487 mtspr SPRN_SPRG_PACA,r13 /* Save vaddr of paca in an SPRG*/
488 488
489 /* Create a temp kernel stack for use before relocation is on. */ 489 /* Create a temp kernel stack for use before relocation is on. */
490 ld r1,PACAEMERGSP(r13) 490 ld r1,PACAEMERGSP(r13)
@@ -502,10 +502,10 @@ _GLOBAL(pmac_secondary_start)
502 * 1. Processor number 502 * 1. Processor number
503 * 2. Segment table pointer (virtual address) 503 * 2. Segment table pointer (virtual address)
504 * On entry the following are set: 504 * On entry the following are set:
505 * r1 = stack pointer. vaddr for iSeries, raddr (temp stack) for pSeries 505 * r1 = stack pointer. vaddr for iSeries, raddr (temp stack) for pSeries
506 * r24 = cpu# (in Linux terms) 506 * r24 = cpu# (in Linux terms)
507 * r13 = paca virtual address 507 * r13 = paca virtual address
508 * SPRG3 = paca virtual address 508 * SPRG_PACA = paca virtual address
509 */ 509 */
510 .globl __secondary_start 510 .globl __secondary_start
511__secondary_start: 511__secondary_start:
@@ -641,7 +641,7 @@ _INIT_STATIC(start_here_multiplatform)
641 641
642 /* Restore parameters passed from prom_init/kexec */ 642 /* Restore parameters passed from prom_init/kexec */
643 mr r3,r31 643 mr r3,r31
644 bl .early_setup /* also sets r13 and SPRG3 */ 644 bl .early_setup /* also sets r13 and SPRG_PACA */
645 645
646 LOAD_REG_ADDR(r3, .start_here_common) 646 LOAD_REG_ADDR(r3, .start_here_common)
647 ld r4,PACAKMSR(r13) 647 ld r4,PACAKMSR(r13)