diff options
author | Paul Mackerras <paulus@samba.org> | 2008-08-29 21:41:12 -0400 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2008-09-15 14:08:35 -0400 |
commit | e31aa453bbc4886a7bd33e5c2afa526d6f55bd7a (patch) | |
tree | fefa13c13d7b1803fdaeb92143f83b1971f0ec8d /arch/powerpc/kernel/cpu_setup_ppc970.S | |
parent | 1f6a93e4c35e75d547b51f56ba8139ab1a91628c (diff) |
powerpc: Use LOAD_REG_IMMEDIATE only for constants on 64-bit
Using LOAD_REG_IMMEDIATE to get the address of kernel symbols
generates 5 instructions where LOAD_REG_ADDR can do it in one,
and will generate R_PPC64_ADDR16_* relocations in the output when
we get to making the kernel as a position-independent executable,
which we'd rather not have to handle. This changes various bits
of assembly code to use LOAD_REG_ADDR when we need to get the
address of a symbol, or to use suitable position-independent code
for cases where we can't access the TOC for various reasons, or
if we're not running at the address we were linked at.
It also cleans up a few minor things; there's no reason to save and
restore SRR0/1 around RTAS calls, __mmu_off can get the return
address from LR more conveniently than the caller can supply it in
R4 (and we already assume elsewhere that EA == RA if the MMU is on
in early boot), and enable_64b_mode was using 5 instructions where
2 would do.
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc/kernel/cpu_setup_ppc970.S')
-rw-r--r-- | arch/powerpc/kernel/cpu_setup_ppc970.S | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/powerpc/kernel/cpu_setup_ppc970.S b/arch/powerpc/kernel/cpu_setup_ppc970.S index bf118c385752..27f2507279d8 100644 --- a/arch/powerpc/kernel/cpu_setup_ppc970.S +++ b/arch/powerpc/kernel/cpu_setup_ppc970.S | |||
@@ -110,7 +110,7 @@ load_hids: | |||
110 | isync | 110 | isync |
111 | 111 | ||
112 | /* Save away cpu state */ | 112 | /* Save away cpu state */ |
113 | LOAD_REG_IMMEDIATE(r5,cpu_state_storage) | 113 | LOAD_REG_ADDR(r5,cpu_state_storage) |
114 | 114 | ||
115 | /* Save HID0,1,4 and 5 */ | 115 | /* Save HID0,1,4 and 5 */ |
116 | mfspr r3,SPRN_HID0 | 116 | mfspr r3,SPRN_HID0 |
@@ -134,7 +134,7 @@ _GLOBAL(__restore_cpu_ppc970) | |||
134 | rldicl. r0,r0,4,63 | 134 | rldicl. r0,r0,4,63 |
135 | beqlr | 135 | beqlr |
136 | 136 | ||
137 | LOAD_REG_IMMEDIATE(r5,cpu_state_storage) | 137 | LOAD_REG_ADDR(r5,cpu_state_storage) |
138 | /* Before accessing memory, we make sure rm_ci is clear */ | 138 | /* Before accessing memory, we make sure rm_ci is clear */ |
139 | li r0,0 | 139 | li r0,0 |
140 | mfspr r3,SPRN_HID4 | 140 | mfspr r3,SPRN_HID4 |