diff options
author | David Gibson <david@gibson.dropbear.id.au> | 2006-01-12 22:56:25 -0500 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2006-01-13 05:16:23 -0500 |
commit | e58c3495e6007af59382540bb21ee941e470d88d (patch) | |
tree | 24b559cb768bfa5cf4bdef69f2943b081a1f5afa /arch/powerpc/kernel/entry_64.S | |
parent | 7e78e5e502d4f220d24c6f738f2fdb078ad33607 (diff) |
[PATCH] powerpc: Cleanup LOADADDR etc. asm macros
This patch consolidates the variety of macros used for loading 32 or
64-bit constants in assembler (LOADADDR, LOADBASE, SET_REG_TO_*). The
idea is to make the set of macros consistent across 32 and 64 bit and
to make it more obvious which is the appropriate one to use in a given
situation. The new macros and their semantics are described in the
comments in ppc_asm.h.
In the process, we change several places that were unnecessarily using
immediate loads on ppc64 to use the GOT/TOC. Likewise we cleanup a
couple of places where we were clumsily subtracting PAGE_OFFSET with
asm instructions to use assemble-time arithmetic or the toreal() macro
instead.
Signed-off-by: David Gibson <dwg@au1.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc/kernel/entry_64.S')
-rw-r--r-- | arch/powerpc/kernel/entry_64.S | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/arch/powerpc/kernel/entry_64.S b/arch/powerpc/kernel/entry_64.S index aacebb33e98a..4ba81e1b6bf1 100644 --- a/arch/powerpc/kernel/entry_64.S +++ b/arch/powerpc/kernel/entry_64.S | |||
@@ -689,9 +689,8 @@ _GLOBAL(enter_rtas) | |||
689 | std r6,PACASAVEDMSR(r13) | 689 | std r6,PACASAVEDMSR(r13) |
690 | 690 | ||
691 | /* Setup our real return addr */ | 691 | /* Setup our real return addr */ |
692 | SET_REG_TO_LABEL(r4,.rtas_return_loc) | 692 | LOAD_REG_ADDR(r4,.rtas_return_loc) |
693 | SET_REG_TO_CONST(r9,PAGE_OFFSET) | 693 | clrldi r4,r4,2 /* convert to realmode address */ |
694 | sub r4,r4,r9 | ||
695 | mtlr r4 | 694 | mtlr r4 |
696 | 695 | ||
697 | li r0,0 | 696 | li r0,0 |
@@ -706,7 +705,7 @@ _GLOBAL(enter_rtas) | |||
706 | sync /* disable interrupts so SRR0/1 */ | 705 | sync /* disable interrupts so SRR0/1 */ |
707 | mtmsrd r0 /* don't get trashed */ | 706 | mtmsrd r0 /* don't get trashed */ |
708 | 707 | ||
709 | SET_REG_TO_LABEL(r4,rtas) | 708 | LOAD_REG_ADDR(r4, rtas) |
710 | ld r5,RTASENTRY(r4) /* get the rtas->entry value */ | 709 | ld r5,RTASENTRY(r4) /* get the rtas->entry value */ |
711 | ld r4,RTASBASE(r4) /* get the rtas->base value */ | 710 | ld r4,RTASBASE(r4) /* get the rtas->base value */ |
712 | 711 | ||
@@ -718,8 +717,7 @@ _GLOBAL(enter_rtas) | |||
718 | _STATIC(rtas_return_loc) | 717 | _STATIC(rtas_return_loc) |
719 | /* relocation is off at this point */ | 718 | /* relocation is off at this point */ |
720 | mfspr r4,SPRN_SPRG3 /* Get PACA */ | 719 | mfspr r4,SPRN_SPRG3 /* Get PACA */ |
721 | SET_REG_TO_CONST(r5, PAGE_OFFSET) | 720 | clrldi r4,r4,2 /* convert to realmode address */ |
722 | sub r4,r4,r5 /* RELOC the PACA base pointer */ | ||
723 | 721 | ||
724 | mfmsr r6 | 722 | mfmsr r6 |
725 | li r0,MSR_RI | 723 | li r0,MSR_RI |
@@ -728,7 +726,7 @@ _STATIC(rtas_return_loc) | |||
728 | mtmsrd r6 | 726 | mtmsrd r6 |
729 | 727 | ||
730 | ld r1,PACAR1(r4) /* Restore our SP */ | 728 | ld r1,PACAR1(r4) /* Restore our SP */ |
731 | LOADADDR(r3,.rtas_restore_regs) | 729 | LOAD_REG_IMMEDIATE(r3,.rtas_restore_regs) |
732 | ld r4,PACASAVEDMSR(r4) /* Restore our MSR */ | 730 | ld r4,PACASAVEDMSR(r4) /* Restore our MSR */ |
733 | 731 | ||
734 | mtspr SPRN_SRR0,r3 | 732 | mtspr SPRN_SRR0,r3 |