[PATCH 3/12] ppc64: Remove unused reloc_offset code
Michael Ellerman
michael at ellerman.id.au
Fri Aug 26 12:53:21 EST 2005
In head.S there are several routines that are written to use reloc_offset,
so they can run at a different address to their link address. However, some
of these routines are only ever called after the kernel's moved to it's linked
address, and so the reloc_offset business is redundant.
This patch changes the calling convention for cpu_setup routines, but currently
none of them actually consult their arguments so no further changes are
needed.
Signed-off-by: Michael Ellerman <michael at ellerman.id.au>
---
arch/ppc64/kernel/head.S | 13 -------------
arch/ppc64/kernel/misc.S | 10 ++--------
2 files changed, 2 insertions(+), 21 deletions(-)
Index: work/arch/ppc64/kernel/head.S
===================================================================
--- work.orig/arch/ppc64/kernel/head.S
+++ work/arch/ppc64/kernel/head.S
@@ -1342,7 +1342,6 @@ _STATIC(__start_initialization_iSeries)
LOADADDR(r3,cpu_specs)
LOADADDR(r4,cur_cpu_spec)
- li r5,0
bl .identify_cpu
LOADADDR(r2,__toc_start)
@@ -1689,10 +1688,6 @@ _GLOBAL(enable_64b_mode)
* This is where the main kernel code starts.
*/
_STATIC(start_here_multiplatform)
- /* get a new offset, now that the kernel has moved. */
- bl .reloc_offset
- mr r26,r3
-
/* Clear out the BSS. It may have been done in prom_init,
* already but that's irrelevant since prom_init will soon
* be detached from the kernel completely. Besides, we need
@@ -1738,7 +1733,6 @@ _STATIC(start_here_multiplatform)
/* kernel but are still running in real mode. */
LOADADDR(r3,init_thread_union)
- sub r3,r3,r26
/* set up a stack pointer (physical address) */
addi r1,r3,THREAD_SIZE
@@ -1749,13 +1743,9 @@ _STATIC(start_here_multiplatform)
LOADADDR(r2,__toc_start)
addi r2,r2,0x4000
addi r2,r2,0x4000
- sub r2,r2,r26
LOADADDR(r3,cpu_specs)
- sub r3,r3,r26
LOADADDR(r4,cur_cpu_spec)
- sub r4,r4,r26
- mr r5,r26
bl .identify_cpu
/* Save some low level config HIDs of CPU0 to be copied to
@@ -1770,13 +1760,11 @@ _STATIC(start_here_multiplatform)
* code
*/
LOADADDR(r27, boot_cpuid)
- sub r27,r27,r26
lwz r27,0(r27)
LOADADDR(r24, paca) /* Get base vaddr of paca array */
mulli r13,r27,PACA_SIZE /* Calculate vaddr of right paca */
add r13,r13,r24 /* for this processor. */
- sub r13,r13,r26 /* convert to physical addr */
mtspr SPRG3,r13 /* PPPBBB: Temp... -Peter */
/* Do very early kernel initializations, including initial hash table,
@@ -1814,7 +1802,6 @@ _STATIC(start_here_multiplatform)
andi. r3,r3,0x1
bne 98f
LOADADDR(r6,_SDR1) /* Only if NOT LPAR */
- sub r6,r6,r26
ld r6,0(r6) /* get the value of _SDR1 */
mtspr SDR1,r6 /* set the htab location */
98:
Index: work/arch/ppc64/kernel/misc.S
===================================================================
--- work.orig/arch/ppc64/kernel/misc.S
+++ work/arch/ppc64/kernel/misc.S
@@ -511,7 +511,6 @@ _GLOBAL(cvt_df)
* identify_cpu and calls setup_cpu
* In: r3 = base of the cpu_specs array
* r4 = address of cur_cpu_spec
- * r5 = relocation offset
*/
_GLOBAL(identify_cpu)
mfpvr r7
@@ -524,16 +523,11 @@ _GLOBAL(identify_cpu)
addi r3,r3,CPU_SPEC_ENTRY_SIZE
b 1b
1:
- add r0,r3,r5
- std r0,0(r4)
+ std r3,0(r4)
ld r4,CPU_SPEC_SETUP(r3)
- sub r4,r4,r5
ld r4,0(r4)
- sub r4,r4,r5
mtctr r4
- /* Calling convention for cpu setup is r3=offset, r4=cur_cpu_spec */
- mr r4,r3
- mr r3,r5
+ /* Calling convention for cpu setup is r3 = cur_cpu_spec */
bctr
/*
More information about the Linuxppc64-dev
mailing list