aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel/entry_64.S
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2009-07-23 19:15:07 -0400
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2009-08-19 20:12:36 -0400
commit6c1719942e19936044c4673b18afa26e45a02320 (patch)
treed235739a709ecf4f36d28ad34b80f8930ef525b1 /arch/powerpc/kernel/entry_64.S
parent7d60b02cc7e6d67b498eed9ecb58010f61422325 (diff)
powerpc/of: Remove useless register save/restore when calling OF back
enter_prom() used to save and restore registers such as CTR, XER etc.. which are volatile, or SRR0,1... which we don't care about. This removes a bunch of useless code and while at it turns an mtmsrd into an MTMSRD macro which will be useful to Book3E. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/kernel/entry_64.S')
-rw-r--r--arch/powerpc/kernel/entry_64.S38
1 files changed, 6 insertions, 32 deletions
diff --git a/arch/powerpc/kernel/entry_64.S b/arch/powerpc/kernel/entry_64.S
index dbf0e3115611..1cb0f3d1714b 100644
--- a/arch/powerpc/kernel/entry_64.S
+++ b/arch/powerpc/kernel/entry_64.S
@@ -823,30 +823,17 @@ _GLOBAL(enter_prom)
823 * of all registers that it saves. We therefore save those registers 823 * of all registers that it saves. We therefore save those registers
824 * PROM might touch to the stack. (r0, r3-r13 are caller saved) 824 * PROM might touch to the stack. (r0, r3-r13 are caller saved)
825 */ 825 */
826 SAVE_8GPRS(2, r1) 826 SAVE_GPR(2, r1)
827 SAVE_GPR(13, r1) 827 SAVE_GPR(13, r1)
828 SAVE_8GPRS(14, r1) 828 SAVE_8GPRS(14, r1)
829 SAVE_10GPRS(22, r1) 829 SAVE_10GPRS(22, r1)
830 mfcr r4 830 mfcr r10
831 std r4,_CCR(r1)
832 mfctr r5
833 std r5,_CTR(r1)
834 mfspr r6,SPRN_XER
835 std r6,_XER(r1)
836 mfdar r7
837 std r7,_DAR(r1)
838 mfdsisr r8
839 std r8,_DSISR(r1)
840 mfsrr0 r9
841 std r9,_SRR0(r1)
842 mfsrr1 r10
843 std r10,_SRR1(r1)
844 mfmsr r11 831 mfmsr r11
832 std r10,_CCR(r1)
845 std r11,_MSR(r1) 833 std r11,_MSR(r1)
846 834
847 /* Get the PROM entrypoint */ 835 /* Get the PROM entrypoint */
848 ld r0,GPR4(r1) 836 mtlr r4
849 mtlr r0
850 837
851 /* Switch MSR to 32 bits mode 838 /* Switch MSR to 32 bits mode
852 */ 839 */
@@ -860,8 +847,7 @@ _GLOBAL(enter_prom)
860 mtmsrd r11 847 mtmsrd r11
861 isync 848 isync
862 849
863 /* Restore arguments & enter PROM here... */ 850 /* Enter PROM here... */
864 ld r3,GPR3(r1)
865 blrl 851 blrl
866 852
867 /* Just make sure that r1 top 32 bits didn't get 853 /* Just make sure that r1 top 32 bits didn't get
@@ -871,7 +857,7 @@ _GLOBAL(enter_prom)
871 857
872 /* Restore the MSR (back to 64 bits) */ 858 /* Restore the MSR (back to 64 bits) */
873 ld r0,_MSR(r1) 859 ld r0,_MSR(r1)
874 mtmsrd r0 860 MTMSRD(r0)
875 isync 861 isync
876 862
877 /* Restore other registers */ 863 /* Restore other registers */
@@ -881,18 +867,6 @@ _GLOBAL(enter_prom)
881 REST_10GPRS(22, r1) 867 REST_10GPRS(22, r1)
882 ld r4,_CCR(r1) 868 ld r4,_CCR(r1)
883 mtcr r4 869 mtcr r4
884 ld r5,_CTR(r1)
885 mtctr r5
886 ld r6,_XER(r1)
887 mtspr SPRN_XER,r6
888 ld r7,_DAR(r1)
889 mtdar r7
890 ld r8,_DSISR(r1)
891 mtdsisr r8
892 ld r9,_SRR0(r1)
893 mtsrr0 r9
894 ld r10,_SRR1(r1)
895 mtsrr1 r10
896 870
897 addi r1,r1,PROM_FRAME_SIZE 871 addi r1,r1,PROM_FRAME_SIZE
898 ld r0,16(r1) 872 ld r0,16(r1)