[PATCH 3/12] ppc64: Remove unused reloc_offset code
Michael Ellerman
michael at ellerman.id.au
Mon Aug 29 13:00:20 EST 2005
On Fri, 26 Aug 2005 21:59, Stephen Rothwell wrote:
> On Fri, 26 Aug 2005 21:40:15 +1000 Stephen Rothwell <sfr at canb.auug.org.au> wrote:
> > On Fri, 26 Aug 2005 12:53:21 +1000 (EST) Michael Ellerman <michael at ellerman.id.au> wrote:
> > > 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.
> >
> > except for the prototypes in cputable.c ...
>
> And, of course, the definition of cpu_set_t in cputable.h
Oops, glad the compiler caught those for me :/
Updated patch:
ppc64: Remove unused reloc_offset code
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.
As a side-effect, this patch changes the calling convention for
cpu_setup routines (cpu_setup_t).
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
/*
Index: work/include/asm-ppc64/cputable.h
===================================================================
--- work.orig/include/asm-ppc64/cputable.h
+++ work/include/asm-ppc64/cputable.h
@@ -37,7 +37,7 @@
*/
struct cpu_spec;
-typedef void (*cpu_setup_t)(unsigned long offset, struct cpu_spec* spec);
+typedef void (*cpu_setup_t)(struct cpu_spec* spec);
struct cpu_spec {
/* CPU is matched via (PVR & pvr_mask) == pvr_value */
Index: work/arch/ppc64/kernel/cputable.c
===================================================================
--- work.orig/arch/ppc64/kernel/cputable.c
+++ work/arch/ppc64/kernel/cputable.c
@@ -31,10 +31,10 @@ EXPORT_SYMBOL(cur_cpu_spec);
* part of the cputable though. That has to be fixed for both ppc32
* and ppc64
*/
-extern void __setup_cpu_power3(unsigned long offset, struct cpu_spec* spec);
-extern void __setup_cpu_power4(unsigned long offset, struct cpu_spec* spec);
-extern void __setup_cpu_ppc970(unsigned long offset, struct cpu_spec* spec);
-extern void __setup_cpu_be(unsigned long offset, struct cpu_spec* spec);
+extern void __setup_cpu_power3(struct cpu_spec* spec);
+extern void __setup_cpu_power4(struct cpu_spec* spec);
+extern void __setup_cpu_ppc970(struct cpu_spec* spec);
+extern void __setup_cpu_be(struct cpu_spec* spec);
/* We only set the altivec features if the kernel was compiled with altivec
More information about the Linuxppc64-dev
mailing list