aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc
diff options
context:
space:
mode:
authorPaul Mackerras <paulus@samba.org>2005-10-10 08:41:25 -0400
committerPaul Mackerras <paulus@samba.org>2005-10-10 08:41:25 -0400
commit5a408329ed19cf2a80e831d28cbd93d2e36155a6 (patch)
treedc5ae749f1da14819ef6947893b0c4f2d9e1ed1c /arch/powerpc
parent4a2885630bc0735e573bced7001dae9750cb80d5 (diff)
powerpc: Fix bug caused by negation of 64-bit reloc_offset value
Although both ppc32 and ppc64 have a reloc_offset function, the ppc64 one produced the opposite sign to the ppc32 one. This standardizes on the ppc32 sign and fixes the merged 64-bit code to account for that. Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc')
-rw-r--r--arch/powerpc/kernel/head_64.S20
-rw-r--r--arch/powerpc/kernel/prom_init.c2
2 files changed, 11 insertions, 11 deletions
diff --git a/arch/powerpc/kernel/head_64.S b/arch/powerpc/kernel/head_64.S
index 7889ff8473b9..3fcac3c37b9b 100644
--- a/arch/powerpc/kernel/head_64.S
+++ b/arch/powerpc/kernel/head_64.S
@@ -1385,7 +1385,7 @@ _STATIC(__boot_from_prom)
1385 addi r2,r2,0x4000 1385 addi r2,r2,0x4000
1386 1386
1387 /* Relocate the TOC from a virt addr to a real addr */ 1387 /* Relocate the TOC from a virt addr to a real addr */
1388 sub r2,r2,r3 1388 add r2,r2,r3
1389 1389
1390 /* Restore parameters */ 1390 /* Restore parameters */
1391 mr r3,r31 1391 mr r3,r31
@@ -1424,7 +1424,7 @@ _STATIC(__after_prom_start)
1424 li r3,0 /* target addr */ 1424 li r3,0 /* target addr */
1425 1425
1426 // XXX FIXME: Use phys returned by OF (r30) 1426 // XXX FIXME: Use phys returned by OF (r30)
1427 sub r4,r27,r26 /* source addr */ 1427 add r4,r27,r26 /* source addr */
1428 /* current address of _start */ 1428 /* current address of _start */
1429 /* i.e. where we are running */ 1429 /* i.e. where we are running */
1430 /* the source addr */ 1430 /* the source addr */
@@ -1444,7 +1444,7 @@ _STATIC(__after_prom_start)
1444 bctr 1444 bctr
1445 1445
14464: LOADADDR(r5,klimit) 14464: LOADADDR(r5,klimit)
1447 sub r5,r5,r26 1447 add r5,r5,r26
1448 ld r5,0(r5) /* get the value of klimit */ 1448 ld r5,0(r5) /* get the value of klimit */
1449 sub r5,r5,r27 1449 sub r5,r5,r27
1450 bl .copy_and_flush /* copy the rest */ 1450 bl .copy_and_flush /* copy the rest */
@@ -1703,7 +1703,7 @@ _STATIC(start_here_multiplatform)
1703 /* kernel but are still running in real mode. */ 1703 /* kernel but are still running in real mode. */
1704 1704
1705 LOADADDR(r3,init_thread_union) 1705 LOADADDR(r3,init_thread_union)
1706 sub r3,r3,r26 1706 add r3,r3,r26
1707 1707
1708 /* set up a stack pointer (physical address) */ 1708 /* set up a stack pointer (physical address) */
1709 addi r1,r3,THREAD_SIZE 1709 addi r1,r3,THREAD_SIZE
@@ -1714,12 +1714,12 @@ _STATIC(start_here_multiplatform)
1714 LOADADDR(r2,__toc_start) 1714 LOADADDR(r2,__toc_start)
1715 addi r2,r2,0x4000 1715 addi r2,r2,0x4000
1716 addi r2,r2,0x4000 1716 addi r2,r2,0x4000
1717 sub r2,r2,r26 1717 add r2,r2,r26
1718 1718
1719 LOADADDR(r3,cpu_specs) 1719 LOADADDR(r3,cpu_specs)
1720 sub r3,r3,r26 1720 add r3,r3,r26
1721 LOADADDR(r4,cur_cpu_spec) 1721 LOADADDR(r4,cur_cpu_spec)
1722 sub r4,r4,r26 1722 add r4,r4,r26
1723 mr r5,r26 1723 mr r5,r26
1724 bl .identify_cpu 1724 bl .identify_cpu
1725 1725
@@ -1735,13 +1735,13 @@ _STATIC(start_here_multiplatform)
1735 * code 1735 * code
1736 */ 1736 */
1737 LOADADDR(r27, boot_cpuid) 1737 LOADADDR(r27, boot_cpuid)
1738 sub r27,r27,r26 1738 add r27,r27,r26
1739 lwz r27,0(r27) 1739 lwz r27,0(r27)
1740 1740
1741 LOADADDR(r24, paca) /* Get base vaddr of paca array */ 1741 LOADADDR(r24, paca) /* Get base vaddr of paca array */
1742 mulli r13,r27,PACA_SIZE /* Calculate vaddr of right paca */ 1742 mulli r13,r27,PACA_SIZE /* Calculate vaddr of right paca */
1743 add r13,r13,r24 /* for this processor. */ 1743 add r13,r13,r24 /* for this processor. */
1744 sub r13,r13,r26 /* convert to physical addr */ 1744 add r13,r13,r26 /* convert to physical addr */
1745 mtspr SPRN_SPRG3,r13 /* PPPBBB: Temp... -Peter */ 1745 mtspr SPRN_SPRG3,r13 /* PPPBBB: Temp... -Peter */
1746 1746
1747 /* Do very early kernel initializations, including initial hash table, 1747 /* Do very early kernel initializations, including initial hash table,
@@ -1781,7 +1781,7 @@ _STATIC(start_here_multiplatform)
1781 andi. r3,r3,PLATFORM_LPAR 1781 andi. r3,r3,PLATFORM_LPAR
1782 bne 98f /* branch if result is !0 */ 1782 bne 98f /* branch if result is !0 */
1783 LOADADDR(r6,_SDR1) /* Only if NOT LPAR */ 1783 LOADADDR(r6,_SDR1) /* Only if NOT LPAR */
1784 sub r6,r6,r26 1784 add r6,r6,r26
1785 ld r6,0(r6) /* get the value of _SDR1 */ 1785 ld r6,0(r6) /* get the value of _SDR1 */
1786 mtspr SPRN_SDR1,r6 /* set the htab location */ 1786 mtspr SPRN_SDR1,r6 /* set the htab location */
178798: 178798:
diff --git a/arch/powerpc/kernel/prom_init.c b/arch/powerpc/kernel/prom_init.c
index 75b487f107c3..75dc7f3714bd 100644
--- a/arch/powerpc/kernel/prom_init.c
+++ b/arch/powerpc/kernel/prom_init.c
@@ -2019,7 +2019,7 @@ unsigned long __init prom_init(unsigned long r3, unsigned long r4,
2019 * On pSeries and BPA, copy the CPU hold code 2019 * On pSeries and BPA, copy the CPU hold code
2020 */ 2020 */
2021 if (RELOC(of_platform) & (PLATFORM_PSERIES | PLATFORM_BPA)) 2021 if (RELOC(of_platform) & (PLATFORM_PSERIES | PLATFORM_BPA))
2022 copy_and_flush(0, KERNELBASE - offset, 0x100, 0); 2022 copy_and_flush(0, KERNELBASE + offset, 0x100, 0);
2023#endif 2023#endif
2024 2024
2025 /* 2025 /*